[SCM] blender/upstream: Imported Upstream version 2.66

mfv-guest at users.alioth.debian.org mfv-guest at users.alioth.debian.org
Thu Feb 21 14:32:44 UTC 2013


The following commit has been merged in the upstream branch:
commit 891376799f4049c9f3497a1660c6551324e30ae9
Author: Matteo F. Vescovi <mfv.debian at gmail.com>
Date:   Thu Feb 21 15:24:18 2013 +0100

    Imported Upstream version 2.66

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ecc3f3e..d208d73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,7 +135,6 @@ option(WITH_GAMEENGINE    "Enable Game Engine" ON)
 option(WITH_PLAYER        "Build Player" OFF)
 option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ON)
 option(WITH_COMPOSITOR    "Enable the tile based nodal compositor" ON)
-option(WITH_COMPOSITOR_LEGACY "Enable legacy compositor" OFF)
 
 # GHOST Windowing Library Options
 option(WITH_GHOST_DEBUG   "Enable debugging output for the GHOST library" OFF)
@@ -269,6 +268,9 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
 option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
 mark_as_advanced(WITH_ASSERT_ABORT)
 
+option(WITH_BOOST					"Enable features depending no boost" ON)
+
+
 if(APPLE)
 	cmake_minimum_required(VERSION 2.8.8)
 	cmake_policy(VERSION 2.8.8)
@@ -396,9 +398,22 @@ if(WITH_CYCLES)
 	set(WITH_OPENIMAGEIO ON)
 endif()
 
-# auto enable boost for cycles, booleans, audaspace or i18n
-if(WITH_CYCLES OR WITH_MOD_BOOLEAN OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
-	set(WITH_BOOST ON)
+# enable boost for cycles, booleans, audaspace or i18n
+# otherwise if the user disabled
+if(NOT WITH_BOOST)
+	# Explicitly disabled. so disable all deps.
+	set(WITH_CYCLES         OFF)
+	set(WITH_MOD_BOOLEAN    OFF)
+	set(WITH_AUDASPACE      OFF)
+	set(WITH_INTERNATIONAL  OFF)
+
+	set(WITH_OPENAL         OFF)  # depends on AUDASPACE
+	set(WITH_GAMEENGINE     OFF)  # depends on AUDASPACE
+elseif(WITH_CYCLES OR WITH_MOD_BOOLEAN OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
+	# Keep enabled
+else()
+	# Enabled but we don't need it
+	set(WITH_BOOST OFF)
 endif()
 
 # auto enable llvm for cycles_osl
@@ -798,7 +813,11 @@ if(UNIX AND NOT APPLE)
 		set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_X11_LIB}")
 
 		if(WITH_X11_XINPUT)
-			set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xinput_LIB}")
+			if(X11_Xinput_LIB)
+				set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xinput_LIB}")
+			else()
+				set(WITH_X11_XINPUT OFF)
+			endif()
 		endif()
 
 		if(WITH_X11_XF86VMODE)
@@ -1137,11 +1156,16 @@ elseif(WIN32)
 				debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
 				debug libboost_regex-${BOOST_DEBUG_POSTFIX}
 				debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
+			if(WITH_CYCLES_OSL)
+				set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
+					optimized libboost_wave-${BOOST_POSTFIX}
+					debug libboost_wave-${BOOST_DEBUG_POSTFIX})
+			endif()
 			if(WITH_INTERNATIONAL)
 				set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
 					optimized libboost_locale-${BOOST_POSTFIX}
 					debug libboost_locale-${BOOST_DEBUG_POSTFIX})
-			endif(WITH_INTERNATIONAL)
+			endif()
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
 		endif()
 			
@@ -1327,6 +1351,11 @@ elseif(WIN32)
 					optimized boost_locale-${BOOST_POSTFIX}
 					debug boost_locale-${BOOST_DEBUG_POSTFIX}) 
 			endif()
+			if(WITH_CYCLES_OSL)
+				set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
+					optimized boost_wave-${BOOST_POSTFIX}
+					debug boost_wave-${BOOST_DEBUG_POSTFIX}) 
+			endif()
 			set(BOOST_LIBPATH ${BOOST}/lib)
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
 		endif()
@@ -1442,11 +1471,11 @@ elseif(APPLE)
 			# module must be compiled against Python framework
 
 			# normally cached but not since we include them with blender
-			set(PYTHON_VERSION 3.2)
+			set(PYTHON_VERSION 3.3)
 			set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
 			set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
 			#set(PYTHON_LIBRARY python${PYTHON_VERSION})
-			set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-3.2m")
+			set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
 			#set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  build with this enabled
 		endif()
 		
@@ -2160,12 +2189,10 @@ if(FIRST_RUN)
 	info_cfg_option(WITH_MOD_FLUID)
 	info_cfg_option(WITH_MOD_OCEANSIM)
 
+	# debug
+	message(STATUS "HAVE_STDBOOL_H = ${HAVE_STDBOOL_H}")
+
 	info_cfg_text("")
 
 	message("${_config_msg}")
 endif()
-
-# debug
-message(
-    STATUS "HAVE_STDBOOL_H = ${HAVE_STDBOOL_H}"
-)
diff --git a/SConstruct b/SConstruct
index 3b1be71..3f17c1c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -517,62 +517,89 @@ def data_to_c_simple(FILE_FROM):
 	data_to_c(FILE_FROM, FILE_TO, VAR_NAME)
 	
 
-data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
-          B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
-          "datatoc_COM_OpenCLKernels_cl")
-
-data_to_c_simple("release/datafiles/startup.blend")
-data_to_c_simple("release/datafiles/preview.blend")
-
-# --- glsl ---
-data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
-data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
-data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
-data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
-data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
-data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
-data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
-
-# --- blender ---
-data_to_c_simple("release/datafiles/bfont.pfb")
-data_to_c_simple("release/datafiles/bfont.ttf")
-data_to_c_simple("release/datafiles/bmonofont.ttf")
-
-data_to_c_simple("release/datafiles/splash.png")
-data_to_c_simple("release/datafiles/blender_icons16.png")
-data_to_c_simple("release/datafiles/blender_icons32.png")
-data_to_c_simple("release/datafiles/prvicons.png")
-
-data_to_c_simple("release/datafiles/brushicons/add.png")
-data_to_c_simple("release/datafiles/brushicons/blob.png")
-data_to_c_simple("release/datafiles/brushicons/blur.png")
-data_to_c_simple("release/datafiles/brushicons/clay.png")
-data_to_c_simple("release/datafiles/brushicons/claystrips.png")
-data_to_c_simple("release/datafiles/brushicons/clone.png")
-data_to_c_simple("release/datafiles/brushicons/crease.png")
-data_to_c_simple("release/datafiles/brushicons/darken.png")
-data_to_c_simple("release/datafiles/brushicons/draw.png")
-data_to_c_simple("release/datafiles/brushicons/fill.png")
-data_to_c_simple("release/datafiles/brushicons/flatten.png")
-data_to_c_simple("release/datafiles/brushicons/grab.png")
-data_to_c_simple("release/datafiles/brushicons/inflate.png")
-data_to_c_simple("release/datafiles/brushicons/layer.png")
-data_to_c_simple("release/datafiles/brushicons/lighten.png")
-data_to_c_simple("release/datafiles/brushicons/mask.png")
-data_to_c_simple("release/datafiles/brushicons/mix.png")
-data_to_c_simple("release/datafiles/brushicons/multiply.png")
-data_to_c_simple("release/datafiles/brushicons/nudge.png")
-data_to_c_simple("release/datafiles/brushicons/pinch.png")
-data_to_c_simple("release/datafiles/brushicons/scrape.png")
-data_to_c_simple("release/datafiles/brushicons/smear.png")
-data_to_c_simple("release/datafiles/brushicons/smooth.png")
-data_to_c_simple("release/datafiles/brushicons/snake_hook.png")
-data_to_c_simple("release/datafiles/brushicons/soften.png")
-data_to_c_simple("release/datafiles/brushicons/subtract.png")
-data_to_c_simple("release/datafiles/brushicons/texdraw.png")
-data_to_c_simple("release/datafiles/brushicons/thumb.png")
-data_to_c_simple("release/datafiles/brushicons/twist.png")
-data_to_c_simple("release/datafiles/brushicons/vertexdraw.png")
+if B.targets != ['cudakernels']:
+    data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
+              B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
+              "datatoc_COM_OpenCLKernels_cl")
+
+    data_to_c_simple("release/datafiles/startup.blend")
+    data_to_c_simple("release/datafiles/preview.blend")
+    data_to_c_simple("release/datafiles/preview_cycles.blend")
+
+    # --- glsl ---
+    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
+    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
+    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
+    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
+    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
+    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
+    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
+
+    # --- blender ---
+    data_to_c_simple("release/datafiles/bfont.pfb")
+    data_to_c_simple("release/datafiles/bfont.ttf")
+    data_to_c_simple("release/datafiles/bmonofont.ttf")
+
+    data_to_c_simple("release/datafiles/splash.png")
+    data_to_c_simple("release/datafiles/blender_icons16.png")
+    data_to_c_simple("release/datafiles/blender_icons32.png")
+    data_to_c_simple("release/datafiles/prvicons.png")
+
+    data_to_c_simple("release/datafiles/brushicons/add.png")
+    data_to_c_simple("release/datafiles/brushicons/blob.png")
+    data_to_c_simple("release/datafiles/brushicons/blur.png")
+    data_to_c_simple("release/datafiles/brushicons/clay.png")
+    data_to_c_simple("release/datafiles/brushicons/claystrips.png")
+    data_to_c_simple("release/datafiles/brushicons/clone.png")
+    data_to_c_simple("release/datafiles/brushicons/crease.png")
+    data_to_c_simple("release/datafiles/brushicons/darken.png")
+    data_to_c_simple("release/datafiles/brushicons/draw.png")
+    data_to_c_simple("release/datafiles/brushicons/fill.png")
+    data_to_c_simple("release/datafiles/brushicons/flatten.png")
+    data_to_c_simple("release/datafiles/brushicons/grab.png")
+    data_to_c_simple("release/datafiles/brushicons/inflate.png")
+    data_to_c_simple("release/datafiles/brushicons/layer.png")
+    data_to_c_simple("release/datafiles/brushicons/lighten.png")
+    data_to_c_simple("release/datafiles/brushicons/mask.png")
+    data_to_c_simple("release/datafiles/brushicons/mix.png")
+    data_to_c_simple("release/datafiles/brushicons/multiply.png")
+    data_to_c_simple("release/datafiles/brushicons/nudge.png")
+    data_to_c_simple("release/datafiles/brushicons/pinch.png")
+    data_to_c_simple("release/datafiles/brushicons/scrape.png")
+    data_to_c_simple("release/datafiles/brushicons/smear.png")
+    data_to_c_simple("release/datafiles/brushicons/smooth.png")
+    data_to_c_simple("release/datafiles/brushicons/snake_hook.png")
+    data_to_c_simple("release/datafiles/brushicons/soften.png")
+    data_to_c_simple("release/datafiles/brushicons/subtract.png")
+    data_to_c_simple("release/datafiles/brushicons/texdraw.png")
+    data_to_c_simple("release/datafiles/brushicons/thumb.png")
+    data_to_c_simple("release/datafiles/brushicons/twist.png")
+    data_to_c_simple("release/datafiles/brushicons/vertexdraw.png")
+
+    data_to_c_simple("release/datafiles/matcaps/mc01.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc02.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc03.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc04.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc05.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc06.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc07.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc08.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc09.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc10.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc11.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc12.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc13.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc14.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc15.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc16.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc17.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc18.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc19.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc20.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc21.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc22.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc23.jpg")
+    data_to_c_simple("release/datafiles/matcaps/mc24.jpg")
 
 ##### END DATAFILES ##########
 
@@ -838,6 +865,8 @@ if env['OURPLATFORM']=='linux':
         td, tf = os.path.split(targetdir)
         iconinstall.append(env.Install(dir=td, source=srcfile))
 
+    scriptinstall.append(env.Install(dir=env['BF_INSTALLDIR'], source='release/bin/blender-thumbnailer.py'))
+
 # dlls for linuxcross
 # TODO - add more libs, for now this lets blenderlite run
 if env['OURPLATFORM']=='linuxcross':
diff --git a/build_files/buildbot/master.cfg b/build_files/buildbot/master.cfg
index 9d0839b..3cfea2a 100644
--- a/build_files/buildbot/master.cfg
+++ b/build_files/buildbot/master.cfg
@@ -28,8 +28,8 @@ c['slavePortnum'] = 9989
 from buildbot.changes.svnpoller import SVNPoller
 
 c['change_source'] = SVNPoller(
-       'https://svn.blender.org/svnroot/bf-blender/trunk/',
-       pollinterval=1200)
+    'https://svn.blender.org/svnroot/bf-blender/trunk/',
+    pollinterval=1200)
 
 # BUILDERS
 #
@@ -74,9 +74,11 @@ def svn_step(branch=''):
     else:
         return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
 
+
 def lib_svn_step(dir):
     return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
 
+
 def rsync_step(id, branch, rsync_script):
     return ShellCommand(name='rsync', command=['python', rsync_script, id, branch], description='uploading', descriptionDone='uploaded', workdir='install')
 
@@ -155,9 +157,9 @@ for i in range(0, schedule_cycle):
 
     print(names)
     c['schedulers'].append(timed.Nightly(name='nightly' + str(i),
-        builderNames=names,
-        hour=3+i,
-        minute=0))
+                                         builderNames=names,
+                                         hour=3 + i,
+                                         minute=0))
 
 # STATUS TARGETS
 #
diff --git a/build_files/buildbot/slave_rsync.py b/build_files/buildbot/slave_rsync.py
index aea1b65..6936232 100644
--- a/build_files/buildbot/slave_rsync.py
+++ b/build_files/buildbot/slave_rsync.py
@@ -41,5 +41,3 @@ print(command)
 
 ret = os.system(command)
 sys.exit(ret)
-
-
diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py
index 6b82e22..55bad25 100644
--- a/build_files/cmake/cmake_consistency_check_config.py
+++ b/build_files/cmake/cmake_consistency_check_config.py
@@ -29,6 +29,22 @@ IGNORE = (
     "extern/recastnavigation/Recast/Source/RecastTimer.cpp",
     "intern/audaspace/SRC/AUD_SRCResampleFactory.cpp",
     "intern/audaspace/SRC/AUD_SRCResampleReader.cpp",
+    "intern/cycles/render/film_response.cpp",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_2.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_3.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_4.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_d.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_3.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_4.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_9.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_d.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_3.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_4.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_d.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_2.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_3.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_4.cc",
+    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_d.cc",
 
     "extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h",
     "extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h",
@@ -47,6 +63,11 @@ IGNORE = (
     "extern/recastnavigation/Recast/Include/RecastTimer.h",
     "intern/audaspace/SRC/AUD_SRCResampleFactory.h",
     "intern/audaspace/SRC/AUD_SRCResampleReader.h",
+    "intern/cycles/render/film_response.h",
+    "extern/carve/include/carve/config.h",
+    "extern/carve/include/carve/external/boost/random.hpp",
+    "extern/carve/patches/files/config.h",
+    "extern/carve/patches/files/random.hpp",
     )
 
 UTF8_CHECK = True
diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py
index 7f45cc6..448454c 100644
--- a/build_files/cmake/cmake_static_check_clang_array.py
+++ b/build_files/cmake/cmake_static_check_clang_array.py
@@ -50,7 +50,7 @@ def main():
     check_commands = []
     for c, inc_dirs, defs in source_info:
         cmd = ([CHECKER_BIN] +
-                CHECKER_ARGS +
+               CHECKER_ARGS +
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py
index d79145f..2f7ffa5 100644
--- a/build_files/cmake/cmake_static_check_cppcheck.py
+++ b/build_files/cmake/cmake_static_check_cppcheck.py
@@ -56,7 +56,7 @@ def main():
     check_commands = []
     for c, inc_dirs, defs in source_info:
         cmd = ([CHECKER_BIN] +
-                CHECKER_ARGS +
+               CHECKER_ARGS +
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
diff --git a/build_files/cmake/cmake_static_check_smatch.py b/build_files/cmake/cmake_static_check_smatch.py
index 7535f1c..2cf07b0 100644
--- a/build_files/cmake/cmake_static_check_smatch.py
+++ b/build_files/cmake/cmake_static_check_smatch.py
@@ -41,6 +41,7 @@ import os
 
 USE_QUIET = (os.environ.get("QUIET", None) is not None)
 
+
 def main():
     source_info = project_source_info.build_info(use_cxx=False, ignore_prefix_list=CHECKER_IGNORE_PREFIX)
 
@@ -48,7 +49,7 @@ def main():
     for c, inc_dirs, defs in source_info:
 
         cmd = ([CHECKER_BIN] +
-                CHECKER_ARGS +
+               CHECKER_ARGS +
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
diff --git a/build_files/cmake/cmake_static_check_sparse.py b/build_files/cmake/cmake_static_check_sparse.py
index 06bef1a..8a3fb47 100644
--- a/build_files/cmake/cmake_static_check_sparse.py
+++ b/build_files/cmake/cmake_static_check_sparse.py
@@ -47,7 +47,7 @@ def main():
     for c, inc_dirs, defs in source_info:
 
         cmd = ([CHECKER_BIN] +
-                CHECKER_ARGS +
+               CHECKER_ARGS +
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
diff --git a/build_files/cmake/cmake_static_check_splint.py b/build_files/cmake/cmake_static_check_splint.py
index 5b12075..6ad03f2 100644
--- a/build_files/cmake/cmake_static_check_splint.py
+++ b/build_files/cmake/cmake_static_check_splint.py
@@ -79,7 +79,7 @@ def main():
     check_commands = []
     for c, inc_dirs, defs in source_info:
         cmd = ([CHECKER_BIN] +
-                CHECKER_ARGS +
+               CHECKER_ARGS +
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
diff --git a/build_files/cmake/config/blender_headless.cmake b/build_files/cmake/config/blender_headless.cmake
index c4d6412..cfde86a 100644
--- a/build_files/cmake/config/blender_headless.cmake
+++ b/build_files/cmake/config/blender_headless.cmake
@@ -5,19 +5,19 @@
 #   cmake -C../blender/build_files/cmake/config/blender_headless.cmake  ../blender
 #
 
-set(WITH_HEADLESS            ON  CACHE FORCE BOOL) 
-set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
+set(WITH_HEADLESS            ON  CACHE BOOL "" FORCE) 
+set(WITH_GAMEENGINE          OFF CACHE BOOL "" FORCE)
 
 # disable audio, its possible some devs may want this but for now disable
 # so the python module doesnt hold the audio device and loads quickly.
-set(WITH_AUDASPACE           OFF CACHE FORCE BOOL)
-set(WITH_FFTW3               OFF CACHE FORCE BOOL)
-set(WITH_JACK                OFF CACHE FORCE BOOL)
-set(WITH_SDL                 OFF CACHE FORCE BOOL)
-set(WITH_OPENAL              OFF CACHE FORCE BOOL)
-set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
-set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
+set(WITH_AUDASPACE           OFF CACHE BOOL "" FORCE)
+set(WITH_FFTW3               OFF CACHE BOOL "" FORCE)
+set(WITH_JACK                OFF CACHE BOOL "" FORCE)
+set(WITH_SDL                 OFF CACHE BOOL "" FORCE)
+set(WITH_OPENAL              OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_FFMPEG        OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_SNDFILE       OFF CACHE BOOL "" FORCE)
 
 # other features which are not especially useful as a python module
-set(WITH_X11_XINPUT          OFF CACHE FORCE BOOL)
-set(WITH_INPUT_NDOF          OFF CACHE FORCE BOOL)
+set(WITH_X11_XINPUT          OFF CACHE BOOL "" FORCE)
+set(WITH_INPUT_NDOF          OFF CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index e74d1ad..f7778ac 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -5,47 +5,47 @@
 #   cmake -C../blender/build_files/cmake/config/blender_lite.cmake  ../blender
 #
 
-set(WITH_INSTALL_PORTABLE    ON  CACHE FORCE BOOL)
-set(WITH_SYSTEM_GLEW         ON  CACHE FORCE BOOL)
+set(WITH_INSTALL_PORTABLE    ON  CACHE BOOL "" FORCE)
+set(WITH_SYSTEM_GLEW         ON  CACHE BOOL "" FORCE)
 
-set(WITH_BUILDINFO           OFF CACHE FORCE BOOL)
-set(WITH_BULLET              OFF CACHE FORCE BOOL)
-set(WITH_CODEC_AVI           OFF CACHE FORCE BOOL)
-set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
-set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
-set(WITH_CYCLES              OFF CACHE FORCE BOOL)
-set(WITH_FFTW3               OFF CACHE FORCE BOOL)
-set(WITH_LIBMV               OFF CACHE FORCE BOOL)
-set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
-set(WITH_COMPOSITOR          OFF CACHE FORCE BOOL)
-set(WITH_GHOST_XDND          OFF CACHE FORCE BOOL)
-set(WITH_IK_SOLVER           OFF CACHE FORCE BOOL)
-set(WITH_IK_ITASC            OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_CINEON        OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_DDS           OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_FRAMESERVER   OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_HDR           OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_OPENEXR       OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_OPENJPEG      OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_REDCODE       OFF CACHE FORCE BOOL)
-set(WITH_IMAGE_TIFF          OFF CACHE FORCE BOOL)
-set(WITH_INPUT_NDOF          OFF CACHE FORCE BOOL)
-set(WITH_INTERNATIONAL       OFF CACHE FORCE BOOL)
-set(WITH_JACK                OFF CACHE FORCE BOOL)
-set(WITH_LZMA                OFF CACHE FORCE BOOL)
-set(WITH_LZO                 OFF CACHE FORCE BOOL)
-set(WITH_MOD_BOOLEAN         OFF CACHE FORCE BOOL)
-set(WITH_MOD_FLUID           OFF CACHE FORCE BOOL)
-set(WITH_MOD_REMESH          OFF CACHE FORCE BOOL)
-set(WITH_MOD_SMOKE           OFF CACHE FORCE BOOL)
-set(WITH_MOD_OCEANSIM        OFF CACHE FORCE BOOL)
-set(WITH_AUDASPACE           OFF CACHE FORCE BOOL)
-set(WITH_OPENAL              OFF CACHE FORCE BOOL)
-set(WITH_OPENCOLLADA         OFF CACHE FORCE BOOL)
-set(WITH_OPENCOLORIO         OFF CACHE FORCE BOOL)
-set(WITH_OPENMP              OFF CACHE FORCE BOOL)
-set(WITH_PYTHON_INSTALL      OFF CACHE FORCE BOOL)
-set(WITH_RAYOPTIMIZATION     OFF CACHE FORCE BOOL)
-set(WITH_SDL                 OFF CACHE FORCE BOOL)
-set(WITH_X11_XINPUT          OFF CACHE FORCE BOOL)
-set(WITH_X11_XF86VMODE       OFF CACHE FORCE BOOL)
+set(WITH_BUILDINFO           OFF CACHE BOOL "" FORCE)
+set(WITH_BULLET              OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_AVI           OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_FFMPEG        OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_SNDFILE       OFF CACHE BOOL "" FORCE)
+set(WITH_CYCLES              OFF CACHE BOOL "" FORCE)
+set(WITH_FFTW3               OFF CACHE BOOL "" FORCE)
+set(WITH_LIBMV               OFF CACHE BOOL "" FORCE)
+set(WITH_GAMEENGINE          OFF CACHE BOOL "" FORCE)
+set(WITH_COMPOSITOR          OFF CACHE BOOL "" FORCE)
+set(WITH_GHOST_XDND          OFF CACHE BOOL "" FORCE)
+set(WITH_IK_SOLVER           OFF CACHE BOOL "" FORCE)
+set(WITH_IK_ITASC            OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_CINEON        OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_DDS           OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_FRAMESERVER   OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_HDR           OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_OPENEXR       OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_OPENJPEG      OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_REDCODE       OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_TIFF          OFF CACHE BOOL "" FORCE)
+set(WITH_INPUT_NDOF          OFF CACHE BOOL "" FORCE)
+set(WITH_INTERNATIONAL       OFF CACHE BOOL "" FORCE)
+set(WITH_JACK                OFF CACHE BOOL "" FORCE)
+set(WITH_LZMA                OFF CACHE BOOL "" FORCE)
+set(WITH_LZO                 OFF CACHE BOOL "" FORCE)
+set(WITH_MOD_BOOLEAN         OFF CACHE BOOL "" FORCE)
+set(WITH_MOD_FLUID           OFF CACHE BOOL "" FORCE)
+set(WITH_MOD_REMESH          OFF CACHE BOOL "" FORCE)
+set(WITH_MOD_SMOKE           OFF CACHE BOOL "" FORCE)
+set(WITH_MOD_OCEANSIM        OFF CACHE BOOL "" FORCE)
+set(WITH_AUDASPACE           OFF CACHE BOOL "" FORCE)
+set(WITH_OPENAL              OFF CACHE BOOL "" FORCE)
+set(WITH_OPENCOLLADA         OFF CACHE BOOL "" FORCE)
+set(WITH_OPENCOLORIO         OFF CACHE BOOL "" FORCE)
+set(WITH_OPENMP              OFF CACHE BOOL "" FORCE)
+set(WITH_PYTHON_INSTALL      OFF CACHE BOOL "" FORCE)
+set(WITH_RAYOPTIMIZATION     OFF CACHE BOOL "" FORCE)
+set(WITH_SDL                 OFF CACHE BOOL "" FORCE)
+set(WITH_X11_XINPUT          OFF CACHE BOOL "" FORCE)
+set(WITH_X11_XF86VMODE       OFF CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/bpy_module.cmake b/build_files/cmake/config/bpy_module.cmake
index 6279f06..b5b13b4 100644
--- a/build_files/cmake/config/bpy_module.cmake
+++ b/build_files/cmake/config/bpy_module.cmake
@@ -4,30 +4,30 @@
 #   cmake -C../blender/build_files/cmake/config/bpy_module.cmake  ../blender
 #
 
-set(WITH_PYTHON_MODULE       ON  CACHE FORCE BOOL)
+set(WITH_PYTHON_MODULE       ON  CACHE BOOL "" FORCE)
 
 # install into the systems python dir
-set(WITH_INSTALL_PORTABLE    OFF CACHE FORCE BOOL)
+set(WITH_INSTALL_PORTABLE    OFF CACHE BOOL "" FORCE)
 
 # no point int copying python into python
-set(WITH_PYTHON_INSTALL      OFF CACHE FORCE BOOL)
+set(WITH_PYTHON_INSTALL      OFF CACHE BOOL "" FORCE)
 
 # dont build the game engine
-set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
+set(WITH_GAMEENGINE          OFF CACHE BOOL "" FORCE)
 
 # disable audio, its possible some devs may want this but for now disable
 # so the python module doesnt hold the audio device and loads quickly.
-set(WITH_AUDASPACE           OFF CACHE FORCE BOOL)
-set(WITH_FFTW3               OFF CACHE FORCE BOOL)
-set(WITH_JACK                OFF CACHE FORCE BOOL)
-set(WITH_SDL                 OFF CACHE FORCE BOOL)
-set(WITH_OPENAL              OFF CACHE FORCE BOOL)
-set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
-set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
+set(WITH_AUDASPACE           OFF CACHE BOOL "" FORCE)
+set(WITH_FFTW3               OFF CACHE BOOL "" FORCE)
+set(WITH_JACK                OFF CACHE BOOL "" FORCE)
+set(WITH_SDL                 OFF CACHE BOOL "" FORCE)
+set(WITH_OPENAL              OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_FFMPEG        OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_SNDFILE       OFF CACHE BOOL "" FORCE)
 
 # other features which are not especially useful as a python module
-set(WITH_X11_XINPUT          OFF CACHE FORCE BOOL)
-set(WITH_INPUT_NDOF          OFF CACHE FORCE BOOL)
-set(WITH_OPENCOLLADA         OFF CACHE FORCE BOOL)
-set(WITH_INTERNATIONAL       OFF CACHE FORCE BOOL)
-set(WITH_BULLET              OFF CACHE FORCE BOOL)
+set(WITH_X11_XINPUT          OFF CACHE BOOL "" FORCE)
+set(WITH_INPUT_NDOF          OFF CACHE BOOL "" FORCE)
+set(WITH_OPENCOLLADA         OFF CACHE BOOL "" FORCE)
+set(WITH_INTERNATIONAL       OFF CACHE BOOL "" FORCE)
+set(WITH_BULLET              OFF CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py
index e73b94a..73648be 100755
--- a/build_files/cmake/project_info.py
+++ b/build_files/cmake/project_info.py
@@ -141,7 +141,7 @@ def cmake_advanced_info():
         if sys.platform == "win32":
             cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR
         else:
-            if make_exe_basename.startswith("make"):
+            if make_exe_basename.startswith(("make", "gmake")):
                 cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % CMAKE_DIR
             elif make_exe_basename.startswith("ninja"):
                 cmd = 'cmake "%s" -G"Eclipse CDT4 - Ninja"' % CMAKE_DIR
@@ -150,7 +150,6 @@ def cmake_advanced_info():
 
         os.system(cmd)
         return join(CMAKE_DIR, ".cproject")
-        
 
     includes = []
     defines = []
diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py
index 69d09b0..90e240c 100644
--- a/build_files/cmake/project_source_info.py
+++ b/build_files/cmake/project_source_info.py
@@ -86,15 +86,15 @@ def makefile_log():
     make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
     make_exe_basename = os.path.basename(make_exe)
 
-    if make_exe_basename.startswith("make"):
+    if make_exe_basename.startswith(("make", "gmake")):
         print("running 'make' with --dry-run ...")
         process = subprocess.Popen([make_exe, "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
-                                    stdout=subprocess.PIPE,
+                                   stdout=subprocess.PIPE,
                                    )
     elif make_exe_basename.startswith("ninja"):
         print("running 'ninja' with -t commands ...")
         process = subprocess.Popen([make_exe, "-t", "commands"],
-                                    stdout=subprocess.PIPE,
+                                   stdout=subprocess.PIPE,
                                    )
 
     while process.poll():
diff --git a/build_files/scons/config/Modules/FindPython.py b/build_files/scons/config/Modules/FindPython.py
index c93a103..0121575 100644
--- a/build_files/scons/config/Modules/FindPython.py
+++ b/build_files/scons/config/Modules/FindPython.py
@@ -15,6 +15,13 @@ def FindPython():
             abi_flags = cur_flags
             break
 
+    # Find config.h. In some distros, such as ubuntu 12.10 they are not in standard include dir.
+    incconf64 = os.path.join(include, "x86_64-linux-gnu", "python" + version + cur_flags, "pyconfig.h")
+    if os.path.exists(incconf64):
+        incconf = os.path.join(include, "x86_64-linux-gnu", "python" + version + cur_flags)
+    else:
+        incconf = ''
+
     # Determine whether python is in /usr/lib or /usr/lib64
     lib32 = os.path.join(python, "lib", "python" + version, "sysconfig.py")
     lib64 = os.path.join(python, "lib64", "python" + version, "sysconfig.py")
@@ -29,4 +36,5 @@ def FindPython():
     return {'PYTHON': python,
             "VERSION": version,
             'LIBPATH': libpath,
-            'ABI_FLAGS': abi_flags}
+            'ABI_FLAGS': abi_flags,
+            'CONFIG': incconf}
diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py
index 207ddd3..5c0e13a 100644
--- a/build_files/scons/config/darwin-config.py
+++ b/build_files/scons/config/darwin-config.py
@@ -137,7 +137,7 @@ else:
     BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}m'
     BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
     #BF_PYTHON_LIB = ''
-    BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config-3.2m'
+    BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config-${BF_PYTHON_VERSION}m'
 
 WITH_BF_OPENAL = True
 #different lib must be used  following version of gcc
diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py
index db3b369..068273e 100644
--- a/build_files/scons/config/linux-config.py
+++ b/build_files/scons/config/linux-config.py
@@ -5,9 +5,10 @@ py = FindPython()
 BF_PYTHON_ABI_FLAGS = py['ABI_FLAGS']
 BF_PYTHON = py['PYTHON']
 BF_PYTHON_LIBPATH = py['LIBPATH']
+BF_PYTHON_CONFIG = py['CONFIG']
 BF_PYTHON_VERSION = py['VERSION']
 WITH_BF_STATICPYTHON = False
-BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'
+BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS} ' + BF_PYTHON_CONFIG
 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'  # BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
 BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
@@ -193,7 +194,7 @@ BF_OCIO_LIB = 'OpenColorIO yaml-cpp tinyxml'
 BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
 
-WITH_BF_BOOST = False
+WITH_BF_BOOST = True
 WITH_BF_STATICBOOST = False
 BF_BOOST = '/usr'
 BF_BOOST_INC = '${BF_BOOST}/include'
diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py
index 21488e7..95352bd 100644
--- a/build_files/scons/config/win32-vc-config.py
+++ b/build_files/scons/config/win32-vc-config.py
@@ -182,7 +182,7 @@ WITH_BF_STATICOCIO = True
 WITH_BF_BOOST = True
 BF_BOOST = '${LIBDIR}/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_49 libboost_filesystem-vc90-mt-s-1_49 libboost_regex-vc90-mt-s-1_49 libboost_system-vc90-mt-s-1_49 libboost_thread-vc90-mt-s-1_49'
+BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_49 libboost_filesystem-vc90-mt-s-1_49 libboost_regex-vc90-mt-s-1_49 libboost_system-vc90-mt-s-1_49 libboost_thread-vc90-mt-s-1_49 libboost_wave-vc90-mt-s-1_49'
 BF_BOOST_LIB_INTERNATIONAL = 'libboost_locale-vc90-mt-s-1_49'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py
index c0ea797..7597dd8 100644
--- a/build_files/scons/config/win64-vc-config.py
+++ b/build_files/scons/config/win64-vc-config.py
@@ -178,7 +178,7 @@ WITH_BF_STATICOCIO = True
 WITH_BF_BOOST = True
 BF_BOOST = '${LIBDIR}/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_49 libboost_filesystem-vc90-mt-s-1_49 libboost_regex-vc90-mt-s-1_49 libboost_system-vc90-mt-s-1_49 libboost_thread-vc90-mt-s-1_49'
+BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_49 libboost_filesystem-vc90-mt-s-1_49 libboost_regex-vc90-mt-s-1_49 libboost_system-vc90-mt-s-1_49 libboost_thread-vc90-mt-s-1_49 libboost_wave-vc90-mt-s-1_49'
 BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc90-mt-s-1_49'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index 94a9f1d..3688a82 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -29,6 +29,7 @@ from SCons.Script.SConscript import SConsEnvironment
 import SCons.Action
 import SCons.Util
 import SCons.Builder
+import SCons.Subst
 import SCons.Tool
 import bcolors
 bc = bcolors.bcolors()
@@ -234,10 +235,6 @@ def setup_staticlibs(lenv):
         if lenv['WITH_BF_STATICLLVM']:
             statlibs += Split(lenv['BF_LLVM_LIB_STATIC'])
 
-    # setting this last so any overriding of manually libs could be handled
-    if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross', 'win64-mingw'):
-        libincs.append('/usr/lib')
-
     if lenv['WITH_BF_JEMALLOC']:
         libincs += Split(lenv['BF_JEMALLOC_LIBPATH'])
         if lenv['WITH_BF_STATICJEMALLOC']:
@@ -249,6 +246,12 @@ def setup_staticlibs(lenv):
             if lenv['WITH_BF_STATIC3DMOUSE']:
                 statlibs += Split(lenv['BF_3DMOUSE_LIB_STATIC'])
 
+    # setting this last so any overriding of manually libs could be handled
+    if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross', 'win64-mingw'):
+        # We must remove any previous items defining this path, for same reason stated above!
+        libincs = [e for e in libincs if SCons.Subst.scons_subst(e, lenv, gvars=lenv.Dictionary()) != "/usr/lib"]
+        libincs.append('/usr/lib')
+
     return statlibs, libincs
 
 def setup_syslibs(lenv):
diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py
index 2236044..ee6dd20 100644
--- a/build_files/scons/tools/btools.py
+++ b/build_files/scons/tools/btools.py
@@ -108,7 +108,7 @@ def validate_arguments(args, bc):
             'WITH_BF_STATICFFMPEG', 'BF_FFMPEG_LIB_STATIC',
             'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
             'WITH_BF_FRAMESERVER',
-            'WITH_BF_COMPOSITOR', 'WITH_BF_COMPOSITOR_LEGACY',
+            'WITH_BF_COMPOSITOR',
             'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH', 'WITH_BF_STATICJPEG', 'BF_JPEG_LIB_STATIC',
             'WITH_BF_OPENJPEG', 'BF_OPENJPEG', 'BF_OPENJPEG_INC', 'BF_OPENJPEG_LIB', 'BF_OPENJPEG_LIBPATH',
             'WITH_BF_REDCODE', 'BF_REDCODE', 'BF_REDCODE_INC', 'BF_REDCODE_LIB', 'BF_REDCODE_LIBPATH',
@@ -599,7 +599,6 @@ def read_opts(env, cfg, args):
         ('BF_BOOST_LIB_STATIC', 'Boost static library', ''),
 
         (BoolVariable('WITH_GHOST_XDND', 'Build with drag-n-drop support on Linux platforms using XDND protocol', True)),
-        (BoolVariable('WITH_BF_COMPOSITOR_LEGACY', 'Enable the legacy compositor', False)),
 
         (BoolVariable('WITH_BF_CYCLES_OSL', 'Build with OSL sypport in Cycles', False)),
         (BoolVariable('WITH_BF_STATICOSL', 'Staticly link to OSL', False)),
diff --git a/doc/manpage/blender.1 b/doc/manpage/blender.1
index 2addb60..9cefe7a 100644
--- a/doc/manpage/blender.1
+++ b/doc/manpage/blender.1
@@ -1,4 +1,4 @@
-.TH "BLENDER" "1" "December 04, 2012" "Blender Blender 2\&.65"
+.TH "BLENDER" "1" "February 14, 2013" "Blender Blender 2\&.66"
 
 .SH NAME
 blender \- a 3D modelling and rendering package
@@ -15,7 +15,7 @@ Use Blender to create TV commercials, to make technical visualizations, business
 http://www.blender.org
 .SH OPTIONS
 
-Blender 2.65
+Blender 2.66
 Usage: blender [args ...] [file] [args ...]
 .br
 .SS "Render Options:"
@@ -218,6 +218,12 @@ Turn debugging on
 Enable floating point exceptions
 .br
 
+.TP
+.B \-\-disable\-crash\-handler
+.br
+Disable the crash handler
+.br
+
 .IP
 
 .TP
@@ -301,7 +307,13 @@ Disable automatic python script execution (pydrivers & startup scripts)
 .TP
 .B \-P or \-\-python <filename>
 .br
-Run the given Python script (filename or Blender Text)
+Run the given Python script file
+.br
+
+.TP
+.B \-\-python\-text <name>
+.br
+Run the given Python script text block
 .br
 
 .TP
@@ -398,6 +410,12 @@ Register .blend extension, then exit (Windows only)
 Silently register .blend extension, then exit (Windows only)
 .br
 
+.TP
+.B \-\-no\-native\-pixels
+.br
+Do not use native pixel size, for high resolution displays (MacBook 'Retina')
+.br
+
 .SS "Argument Parsing:"
 
     arguments must be separated by white space. eg
diff --git a/doc/python_api/examples/bpy.props.5.py b/doc/python_api/examples/bpy.props.5.py
index e49d0f2..1f61e33 100644
--- a/doc/python_api/examples/bpy.props.5.py
+++ b/doc/python_api/examples/bpy.props.5.py
@@ -16,6 +16,7 @@ import bpy
 def get_float(self):
     return self["testprop"]
 
+
 def set_float(self, value):
     self["testprop"] = value
 
@@ -36,6 +37,7 @@ bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
 def get_array(self):
     return (True, self["somebool"])
 
+
 def set_array(self, values):
     self["somebool"] = values[0] and values[1]
 
@@ -51,10 +53,12 @@ test_items = [
     ("YELLOW", "Red", "", 4),
     ]
 
+
 def get_enum(self):
     import random
     return random.randint(1, 4)
 
+
 def set_enum(self, value):
     print("setting value", value)
 
@@ -66,16 +70,16 @@ bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enu
 scene = bpy.context.scene
 
 scene.test_float = 12.34
-print (scene.test_float)
+print(scene.test_float)
 
 scene.test_array = (True, False)
-print ([x for x in scene.test_array])
+print([x for x in scene.test_array])
 
 #scene.test_date = "blah"   # this would fail, property is read-only
-print (scene.test_date)
+print(scene.test_date)
 
 scene.test_enum = 'BLUE'
-print (scene.test_enum)
+print(scene.test_enum)
 
 
 # >>> 12.34000015258789
diff --git a/doc/python_api/examples/bpy.types.AddonPreferences.1.py b/doc/python_api/examples/bpy.types.AddonPreferences.1.py
index 08de6f4..73f90ac 100644
--- a/doc/python_api/examples/bpy.types.AddonPreferences.1.py
+++ b/doc/python_api/examples/bpy.types.AddonPreferences.1.py
@@ -17,6 +17,8 @@ from bpy.props import StringProperty, IntProperty, BoolProperty
 
 
 class ExampleAddonPreferences(AddonPreferences):
+    # this must match the addon name, use '__package__'
+    # when defining this in a submodule of a python package.
     bl_idname = __name__
 
     filepath = StringProperty(
diff --git a/doc/python_api/examples/bpy.types.UIList.py b/doc/python_api/examples/bpy.types.UIList.py
index f2017e3..0f4ae07 100644
--- a/doc/python_api/examples/bpy.types.UIList.py
+++ b/doc/python_api/examples/bpy.types.UIList.py
@@ -31,7 +31,8 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
             # You should always start your row layout by a label (icon + text), this will also make the row easily
             # selectable in the list!
             # We use icon_value of label, as our given icon is an integer value, not an enum ID.
-            layout.label(ma.name if ma else "", icon_value=icon)
+            # Note "data" names should never be translated!
+            layout.label(text=ma.name if ma else "", translate=False, icon_value=icon)
             # And now we can add other UI stuff...
             # Here, we add nodes info if this material uses (old!) shading nodes.
             if ma and not context.scene.render.use_shading_nodes:
@@ -39,15 +40,15 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
                 if manode:
                     # The static method UILayout.icon returns the integer value of the icon ID "computed" for the given
                     # RNA object.
-                    layout.label("Node %s" % manode.name, icon_value=layout.icon(manode))
+                    layout.label(text="Node %s" % manode.name, translate=False, icon_value=layout.icon(manode))
                 elif ma.use_nodes:
-                    layout.label("Node <none>")
+                    layout.label(text="Node <none>", translate=False)
                 else:
-                    layout.label("")
+                    layout.label(text="")
         # 'GRID' layout type should be as compact as possible (typically a single icon!).
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 # And now we can use this list everywhere in Blender. Here is a small example panel.
@@ -86,4 +87,4 @@ def unregister():
 
 
 if __name__ == "__main__":
-    register()
\ No newline at end of file
+    register()
diff --git a/doc/python_api/rst/bge.events.rst b/doc/python_api/rst/bge.events.rst
index 074e928..2238fae 100644
--- a/doc/python_api/rst/bge.events.rst
+++ b/doc/python_api/rst/bge.events.rst
@@ -69,7 +69,7 @@ Functions
 
    Return the string name of a key event. Will raise a ValueError error if its invalid.
 
-   :arg event: key event from bge.keys or the keyboard sensor.
+   :arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
    :type event: int
    :rtype: string
    
@@ -78,7 +78,7 @@ Functions
    Return the string name of a key event. Returns an empty string if the event cant be represented as a character.
    
    :type event: int
-   :arg event: key event from :mod:`bge.keys` or the keyboard sensor.
+   :arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
    :type shift: bool
    :arg shift: set to true if shift is held.
    :rtype: string
diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst
index a86272d..f24cc3f 100644
--- a/doc/python_api/rst/bge.types.rst
+++ b/doc/python_api/rst/bge.types.rst
@@ -31,5381 +31,8 @@ a :class:`SCA_PythonController` logic brick.
 Types
 *****
 
-.. class:: PyObjectPlus
+.. toctree::
+   :glob:
 
-   PyObjectPlus base class of most other types in the Game Engine.
+   bge.types.*
 
-   .. attribute:: invalid
-
-      Test if the object has been freed by the game engine and is no longer valid.
-       
-      Normally this is not a problem but when storing game engine data in the GameLogic module, 
-      KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data.
-      Calling an attribute or method on an invalid object will raise a SystemError.
-       
-      The invalid attribute allows testing for this case without exception handling.
-
-      :type: boolean
-
-.. class:: CValue(PyObjectPlus)
-
-   This class is a basis for other classes.
-
-   .. attribute:: name
-
-      The name of this CValue derived object (read-only).
-
-      :type: string
-      
-.. class:: CPropValue(CValue)
-
-   This class has no python functions
-
-.. class:: SCA_ILogicBrick(CValue)
-
-   Base class for all logic bricks.
-
-   .. attribute:: executePriority
-
-      This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
-
-      :type: executePriority: int
-
-   .. attribute:: owner
-
-      The game object this logic brick is attached to (read-only).
-      
-      :type: :class:`KX_GameObject` or None in exceptional cases.
-
-   .. attribute:: name
-
-      The name of this logic brick (read-only).
-      
-      :type: string
-
-.. class:: SCA_PythonKeyboard(PyObjectPlus)
-
-   The current keyboard.
-
-   .. attribute:: events
-
-      A dictionary containing the status of each keyboard event or key. (read-only).
-
-      :type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...}
-
-   .. attribute:: active_events
-
-      A dictionary containing the status of only the active keyboard events or keys. (read-only).
-
-      :type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...}
-
-
-   .. function:: getClipboard()
-
-      Gets the clipboard text.
-
-      :rtype: string
-
-   .. function:: setClipboard(text)
-
-      Sets the clipboard text.
-
-      :arg text: New clipboard text
-      :type text: string
-
-.. class:: SCA_PythonMouse(PyObjectPlus)
-
-   The current mouse.
-
-   .. attribute:: events
-
-      a dictionary containing the status of each mouse event. (read-only).
-
-      :type: dictionary {:ref:`keycode<mouse-keys>`::ref:`status<input-status>`, ...}
-
-   .. attribute:: active_events
-
-      a dictionary containing the status of only the active mouse events. (read-only).
-
-      :type: dictionary {:ref:`keycode<mouse-keys>`::ref:`status<input-status>`, ...}
-      
-   .. attribute:: position
-
-      The normalized x and y position of the mouse cursor.
-
-      :type: list [x, y]
-
-   .. attribute:: visible
-
-      The visibility of the mouse cursor.
-      
-      :type: boolean
-
-.. class:: SCA_PythonJoystick(PyObjectPlus)
-
-   A Python interface to a joystick.
-
-   .. attribute:: name
-
-      The name assigned to the joystick by the operating system. (read-only)
-	  
-      :type: string
-
-   .. attribute:: activeButtons
-
-      A list of active button values. (read-only)
-	  
-      :type: list
-
-   .. attribute:: axisValues
-
-      The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only).
-
-      :type: list of ints.
-
-      Each specifying the value of an axis between -1.0 and 1.0 depending on how far the axis is pushed, 0 for nothing.
-      The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
-
-      * left:[-1.0, 0.0, ...]
-      * right:[1.0, 0.0, ...]
-      * up:[0.0, -1.0, ...]
-      * down:[0.0, 1.0, ...]
-
-   .. attribute:: hatValues
-
-      The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).
-
-      :type: list of ints
-
-      Each specifying the direction of the hat from 1 to 12, 0 when inactive.
-
-      Hat directions are as follows...
-
-      * 0:None
-      * 1:Up
-      * 2:Right
-      * 4:Down
-      * 8:Left
-      * 3:Up - Right
-      * 6:Down - Right
-      * 12:Down - Left
-      * 9:Up - Left
-
-   .. attribute:: numAxis
-
-      The number of axes for the joystick at this index. (read-only).
-
-      :type: integer
-
-   .. attribute:: numButtons
-
-      The number of buttons for the joystick at this index. (read-only).
-
-      :type: integer
-
-   .. attribute:: numHats
-
-      The number of hats for the joystick at this index. (read-only).
-
-      :type: integer
-
-.. class:: SCA_IObject(CValue)
-
-   This class has no python functions
-
-.. class:: SCA_ISensor(SCA_ILogicBrick)
-
-   Base class for all sensor logic bricks.
-
-   .. attribute:: usePosPulseMode
-
-      Flag to turn positive pulse mode on and off.
-      
-      :type: boolean
-
-   .. attribute:: useNegPulseMode
-
-      Flag to turn negative pulse mode on and off.
-      
-      :type: boolean
-
-   .. attribute:: frequency
-
-      The frequency for pulse mode sensors.
-      
-      :type: integer
-
-   .. attribute:: level
-
-      level Option whether to detect level or edge transition when entering a state.
-      It makes a difference only in case of logic state transition (state actuator).
-      A level detector will immediately generate a pulse, negative or positive
-      depending on the sensor condition, as soon as the state is activated.
-      A edge detector will wait for a state change before generating a pulse.
-      note: mutually exclusive with :data:`tap`, enabling will disable :data:`tap`.
-
-      :type: boolean
-
-   .. attribute:: tap
-
-      When enabled only sensors that are just activated will send a positive event, 
-      after this they will be detected as negative by the controllers.
-      This will make a key thats held act as if its only tapped for an instant.
-      note: mutually exclusive with :data:`level`, enabling will disable :data:`level`.
-
-      :type: boolean
-
-   .. attribute:: invert
-
-      Flag to set if this sensor activates on positive or negative events.
-      
-      :type: boolean
-
-   .. attribute:: triggered
-
-      True if this sensor brick is in a positive state. (read-only).
-     
-      :type: boolean
-
-   .. attribute:: positive
-
-      True if this sensor brick is in a positive state. (read-only).
-      
-      :type: boolean
-
-   .. attribute:: pos_ticks
-
-      The number of ticks since the last positive pulse (read-only).
-      
-      :type: int
-
-   .. attribute:: neg_ticks
-
-      The number of ticks since the last negative pulse (read-only).
-      
-      :type: int
-
-   .. attribute:: status
-
-      The status of the sensor (read-only): can be one of :ref:`these constants<sensor-status>`.
-
-      :type: int
-
-      .. note::
-      
-         This convenient attribute combines the values of triggered and positive attributes.
-
-   .. method:: reset()
-
-      Reset sensor internal state, effect depends on the type of sensor and settings.
-
-      The sensor is put in its initial state as if it was just activated.
-
-.. class:: SCA_IController(SCA_ILogicBrick)
-
-   Base class for all controller logic bricks.
-
-   .. attribute:: state
-
-      The controllers state bitmask. This can be used with the GameObject's state to test if the controller is active.
-      
-      :type: int bitmask
-
-   .. attribute:: sensors
-
-      A list of sensors linked to this controller.
-      
-      :type: sequence supporting index/string lookups and iteration.
-
-      .. note::
-
-         The sensors are not necessarily owned by the same object.
-
-      .. note::
-         
-         When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
-
-   .. attribute:: actuators
-
-      A list of actuators linked to this controller.
-      
-      :type: sequence supporting index/string lookups and iteration.
-
-      .. note::
-
-         The sensors are not necessarily owned by the same object.
-
-      .. note::
-         
-         When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
-
-   .. attribute:: useHighPriority
-
-      When set the controller executes always before all other controllers that dont have this set.
-      
-      :type: boolen
-
-      .. note::
-         
-         Order of execution between high priority controllers is not guaranteed.
-
-.. class:: SCA_IActuator(SCA_ILogicBrick)
-
-   Base class for all actuator logic bricks.
-
-.. class:: BL_ActionActuator(SCA_IActuator)
-
-   Action Actuators apply an action to an actor.
-
-   .. attribute:: action
-
-      The name of the action to set as the current action.
-
-      :type: string
-
-   .. attribute:: frameStart
-
-      Specifies the starting frame of the animation.
-
-      :type: float
-
-   .. attribute:: frameEnd
-
-      Specifies the ending frame of the animation.
-
-      :type: float
-
-   .. attribute:: blendIn
-
-      Specifies the number of frames of animation to generate when making transitions between actions.
-
-      :type: float
-
-   .. attribute:: priority
-
-      Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
-
-      :type: integer
-
-   .. attribute:: frame
-
-      Sets the current frame for the animation.
-
-      :type: float
-
-   .. attribute:: propName
-
-      Sets the property to be used in FromProp playback mode.
-
-      :type: string
-
-   .. attribute:: blendTime
-
-      Sets the internal frame timer. This property must be in the range from 0.0 to blendIn.
-
-      :type: float
-
-   .. attribute:: mode
-
-      The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
-
-      :type: integer
-
-   .. attribute:: useContinue
-
-      The actions continue option, True or False. When True, the action will always play from where last left off,
-      otherwise negative events to this actuator will reset it to its start frame.
-
-      :type: boolean
-
-   .. attribute:: framePropName
-
-      The name of the property that is set to the current frame number.
-
-      :type: string
-
-.. class:: BL_Shader(PyObjectPlus)
-
-   BL_Shader GLSL shaders.
-
-   TODO - Description
-
-   .. method:: setUniformfv(name, fList)
-
-      Set a uniform with a list of float values
-
-      :arg name: the uniform name
-      :type name: string
-      :arg fList: a list (2, 3 or 4 elements) of float values
-      :type fList: list[float]
-
-   .. method:: delSource()
-
-      Clear the shader. Use this method before the source is changed with :data:`setSource`.
-
-   .. method:: getFragmentProg()
-
-      Returns the fragment program.
-
-      :return: The fragment program.
-      :rtype: string
-
-   .. method:: getVertexProg()
-
-      Get the vertex program.
-
-      :return: The vertex program.
-      :rtype: string
-
-   .. method:: isValid()
-
-      Check if the shader is valid.
-
-      :return: True if the shader is valid
-      :rtype: boolean
-
-   .. method:: setAttrib(enum)
-
-      Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
-
-      :arg enum: attribute location value
-      :type enum: integer
-
-   .. method:: setNumberOfPasses( max_pass )
-
-      Set the maximum number of passes. Not used a.t.m.
-
-      :arg max_pass: the maximum number of passes
-      :type max_pass: integer
-
-   .. method:: setSampler(name, index)
-
-      Set uniform texture sample index.
-
-      :arg name: Uniform name
-      :type name: string
-      :arg index: Texture sample index.
-      :type index: integer
-
-   .. method:: setSource(vertexProgram, fragmentProgram)
-
-      Set the vertex and fragment programs
-
-      :arg vertexProgram: Vertex program
-      :type vertexProgram: string
-      :arg fragmentProgram: Fragment program
-      :type fragmentProgram: string
-
-   .. method:: setUniform1f(name, fx)
-
-      Set a uniform with 1 float value.
-
-      :arg name: the uniform name
-      :type name: string
-      :arg fx: Uniform value
-      :type fx: float
-
-   .. method:: setUniform1i(name, ix)
-
-      Set a uniform with an integer value.
-
-      :arg name: the uniform name
-      :type name: string
-      :arg ix: the uniform value
-      :type ix: integer
-
-   .. method:: setUniform2f(name, fx, fy)
-
-      Set a uniform with 2 float values
-
-      :arg name: the uniform name
-      :type name: string
-      :arg fx: first float value
-      :type fx: float
-
-      :arg fy: second float value
-      :type fy: float
-
-   .. method:: setUniform2i(name, ix, iy)
-
-      Set a uniform with 2 integer values
-
-      :arg name: the uniform name
-      :type name: string
-      :arg ix: first integer value
-      :type ix: integer
-      :arg iy: second integer value
-      :type iy: integer
-
-   .. method:: setUniform3f(name, fx, fy, fz)
-
-      Set a uniform with 3 float values.
-
-      :arg name: the uniform name
-      :type name: string
-      :arg fx: first float value
-      :type fx: float
-      :arg fy: second float value
-      :type fy: float
-      :arg fz: third float value
-      :type fz: float
-
-   .. method:: setUniform3i(name, ix, iy, iz)
-
-      Set a uniform with 3 integer values
-
-      :arg name: the uniform name
-      :type name: string
-      :arg ix: first integer value
-      :type ix: integer
-      :arg iy: second integer value
-      :type iy: integer
-      :arg iz: third integer value
-      :type iz: integer
-
-   .. method:: setUniform4f(name, fx, fy, fz, fw)
-
-      Set a uniform with 4 float values.
-
-      :arg name: the uniform name
-      :type name: string
-      :arg fx: first float value
-      :type fx: float
-      :arg fy: second float value
-      :type fy: float
-      :arg fz: third float value
-      :type fz: float
-      :arg fw: fourth float value
-      :type fw: float
-
-   .. method:: setUniform4i(name, ix, iy, iz, iw)
-
-      Set a uniform with 4 integer values
-
-      :arg name: the uniform name
-      :type name: string
-      :arg ix: first integer value
-      :type ix: integer
-      :arg iy: second integer value
-      :type iy: integer
-      :arg iz: third integer value
-      :type iz: integer
-      :arg iw: fourth integer value
-      :type iw: integer
-
-   .. method:: setUniformDef(name, type)
-
-      Define a new uniform
-
-      :arg name: the uniform name
-      :type name: string
-      :arg type: uniform type
-      :type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX
-
-   .. method:: setUniformMatrix3(name, mat, transpose)
-
-      Set a uniform with a 3x3 matrix value
-
-      :arg name: the uniform name
-      :type name: string
-      :arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]]
-      :type mat: 3x3 matrix
-      :arg transpose: set to True to transpose the matrix
-      :type transpose: boolean
-
-   .. method:: setUniformMatrix4(name, mat, transpose)
-
-      Set a uniform with a 4x4 matrix value
-
-      :arg name: the uniform name
-      :type name: string
-      :arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]]
-      :type mat: 4x4 matrix
-      :arg transpose: set to True to transpose the matrix
-      :type transpose: boolean
-
-   .. method:: setUniformiv(name, iList)
-
-      Set a uniform with a list of integer values
-
-      :arg name: the uniform name
-      :type name: string
-      :arg iList: a list (2, 3 or 4 elements) of integer values
-      :type iList: list[integer]
-
-   .. method:: validate()
-
-      Validate the shader object.
-
-.. class:: BL_ShapeActionActuator(SCA_IActuator)
-
-   ShapeAction Actuators apply an shape action to an mesh object.
-
-   .. attribute:: action
-
-      The name of the action to set as the current shape action.
-
-      :type: string
-
-   .. attribute:: frameStart
-
-      Specifies the starting frame of the shape animation.
-
-      :type: float
-
-   .. attribute:: frameEnd
-
-      Specifies the ending frame of the shape animation.
-
-      :type: float
-
-   .. attribute:: blendIn
-
-      Specifies the number of frames of animation to generate when making transitions between actions.
-
-      :type: float
-
-   .. attribute:: priority
-
-      Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
-
-      :type: integer
-
-   .. attribute:: frame
-
-      Sets the current frame for the animation.
-
-      :type: float
-
-   .. attribute:: propName
-
-      Sets the property to be used in FromProp playback mode.
-
-      :type: string
-
-   .. attribute:: blendTime
-
-      Sets the internal frame timer. This property must be in the range from 0.0 to blendin.
-
-      :type: float
-
-   .. attribute:: mode
-
-      The operation mode of the actuator. Can be one of :ref:`these constants<shape-action-actuator>`.
-
-      :type: integer
-
-   .. attribute:: framePropName
-
-      The name of the property that is set to the current frame number.
-
-      :type: string
-
-
-.. class:: KX_SteeringActuator(SCA_IActuator)
-
-   Steering Actuator for navigation.
-
-   .. attribute:: behavior
-
-      The steering behavior to use.
-
-      :type: one of :ref:`these constants <logic-steering-actuator>`
-
-   .. attribute:: velocity
-
-      Velocity magnitude
-
-      :type: float
-
-   .. attribute:: acceleration
-
-      Max acceleration
-
-      :type: float
-
-   .. attribute:: turnspeed
-
-      Max turn speed
-
-      :type: float
-
-   .. attribute:: distance
-
-      Relax distance
-
-      :type: float
-
-   .. attribute:: target
-
-      Target object
-
-      :type: :class:`KX_GameObject`
-
-   .. attribute:: navmesh
-
-      Navigation mesh
-
-      :type: :class:`KX_GameObject`
-
-   .. attribute:: selfterminated
-
-      Terminate when target is reached
-
-      :type: boolean
-
-   .. attribute:: enableVisualization
-
-      Enable debug visualization
-
-      :type: boolean
-
-   .. attribute:: pathUpdatePeriod
-
-      Path update period
-
-      :type: int
-
-.. class:: CListValue(CPropValue)
-
-   This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
-
-   As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``)
-
-   Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported.
-
-   .. method:: append(val)
-
-      Add an item to the list (like pythons append)
-
-      .. warning::
-      
-         Appending values to the list can cause crashes when the list is used internally by the game engine.
-
-   .. method:: count(val)
-
-      Count the number of instances of a value in the list.
-
-      :return: number of instances
-      :rtype: integer
-
-   .. method:: index(val)
-
-      Return the index of a value in the list.
-
-      :return: The index of the value in the list.
-      :rtype: integer
-
-   .. method:: reverse()
-
-      Reverse the order of the list.
-
-   .. method:: get(key, default=None)
-
-      Return the value matching key, or the default value if its not found.
-
-      :return: The key value or a default.
-
-   .. method:: from_id(id)
-
-      This is a funtion especially for the game engine to return a value with a spesific id.
-
-      Since object names are not always unique, the id of an object can be used to get an object from the CValueList.
-
-      Example:
-
-      .. code-block:: python
-        
-         myObID=id(gameObject)
-         ob= scene.objects.from_id(myObID)
-
-      Where ``myObID`` is an int or long from the id function.
-
-      This has the advantage that you can store the id in places you could not store a gameObject.
-
-      .. warning::
-
-         The id is derived from a memory location and will be different each time the game engine starts.
-
-      .. warning::
-
-         The id can't be stored as an integer in game object properties, as those only have a limited range that the id may not be contained in. Instead an id can be stored as a string game property and converted back to an integer for use in from_id lookups.
-
-.. class:: KX_BlenderMaterial(PyObjectPlus)
-
-   KX_BlenderMaterial
-
-   .. attribute:: shader
-
-      The materials shader.
-
-      :type: :class:`BL_Shader`
-
-   .. attribute:: blending
-
-      Ints used for pixel blending, (src, dst), matching the setBlending method.
-
-      :type: (integer, integer)
-
-   .. attribute:: material_index
-
-      The material's index.
-
-      :type: integer
-
-   .. method:: getShader()
-
-      Returns the material's shader.
-
-      :return: the material's shader
-      :rtype: :class:`BL_Shader`
-
-   .. method:: setBlending(src, dest)
-
-      Set the pixel color arithmetic functions.
-
-      :arg src: Specifies how the red, green, blue, and alpha source blending factors are computed.
-      :type src: Value in...
-
-         * GL_ZERO,
-         * GL_ONE, 
-         * GL_SRC_COLOR, 
-         * GL_ONE_MINUS_SRC_COLOR, 
-         * GL_DST_COLOR, 
-         * GL_ONE_MINUS_DST_COLOR, 
-         * GL_SRC_ALPHA, 
-         * GL_ONE_MINUS_SRC_ALPHA, 
-         * GL_DST_ALPHA, 
-         * GL_ONE_MINUS_DST_ALPHA, 
-         * GL_SRC_ALPHA_SATURATE
-
-      :arg dest: Specifies how the red, green, blue, and alpha destination blending factors are computed.
-      :type dest: Value in...
-
-         * GL_ZERO
-         * GL_ONE
-         * GL_SRC_COLOR
-         * GL_ONE_MINUS_SRC_COLOR
-         * GL_DST_COLOR
-         * GL_ONE_MINUS_DST_COLOR
-         * GL_SRC_ALPHA
-         * GL_ONE_MINUS_SRC_ALPHA
-         * GL_DST_ALPHA
-         * GL_ONE_MINUS_DST_ALPHA
-         * GL_SRC_ALPHA_SATURATE
-
-   .. method:: getMaterialIndex()
-
-      Returns the material's index.
-
-      :return: the material's index
-      :rtype: integer
-
-.. class:: KX_CameraActuator(SCA_IActuator)
-
-   Applies changes to a camera.
-
-   .. attribute:: damping
-
-      strength of of the camera following movement.
-
-      :type: float
-
-   .. attribute:: axis
-
-      The camera axis (0, 1, 2) for positive ``XYZ``, (3, 4, 5) for negative ``XYZ``.
-
-      :type: int
-
-   .. attribute:: min
-
-      minimum distance to the target object maintained by the actuator.
-
-      :type: float
-
-   .. attribute:: max
-
-      maximum distance to stay from the target object.
-
-      :type: float
-
-   .. attribute:: height
-
-      height to stay above the target object.
-
-      :type: float
-
-   .. attribute:: object
-
-      the object this actuator tracks.
-
-      :type: :class:`KX_GameObject` or None
-
-.. class:: KX_ConstraintActuator(SCA_IActuator)
-
-   A constraint actuator limits the position, rotation, distance or orientation of an object.
-
-   .. attribute:: damp
-
-      Time constant of the constraint expressed in frame (not use by Force field constraint).
-
-      :type: integer
-
-   .. attribute:: rotDamp
-
-      Time constant for the rotation expressed in frame (only for the distance constraint), 0 = use damp for rotation as well.
-
-      :type: integer
-
-   .. attribute:: direction
-
-      The reference direction in world coordinate for the orientation constraint.
-
-      :type: 3-tuple of float: (x, y, z)
-
-   .. attribute:: option
-
-      Binary combination of :ref:`these constants <constraint-actuator-option>`
-
-      :type: integer
-
-   .. attribute:: time
-
-      activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time.
-
-      :type: integer
-
-   .. attribute:: propName
-
-      the name of the property or material for the ray detection of the distance constraint.
-
-      :type: string
-
-   .. attribute:: min
-
-      The lower bound of the constraint. For the rotation and orientation constraint, it represents radiant.
-
-      :type: float
-
-   .. attribute:: distance
-
-      the target distance of the distance constraint.
-
-      :type: float
-
-   .. attribute:: max
-
-      the upper bound of the constraint. For rotation and orientation constraints, it represents radiant.
-
-      :type: float
-
-   .. attribute:: rayLength
-
-      the length of the ray of the distance constraint.
-
-      :type: float
-
-   .. attribute:: limit
-
-      type of constraint. Use one of the :ref:`these constants <constraint-actuator-limit>`
-
-      :type: integer.
-
-      
-.. class:: KX_ConstraintWrapper(PyObjectPlus)
-
-   KX_ConstraintWrapper
-
-   .. method:: getConstraintId(val)
-
-      Returns the contraint's ID
-
-      :return: the constraint's ID
-      :rtype: integer
-
-.. class:: KX_GameActuator(SCA_IActuator)
-
-   The game actuator loads a new .blend file, restarts the current .blend file or quits the game.
-
-   .. attribute:: fileName
-
-      the new .blend file to load.
-
-      :type: string
-
-   .. attribute:: mode
-
-      The mode of this actuator. Can be on of :ref:`these constants <game-actuator>`
-
-      :type: Int
-
-.. class:: KX_GameObject(SCA_IObject)
-
-   All game objects are derived from this class.
-
-   Properties assigned to game objects are accessible as attributes of this class.
-
-   .. note::
-      
-      Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError,
-      if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
-
-   KX_GameObject can be subclassed to extend functionality. For example:
-
-   .. code-block:: python
-
-        import bge
-
-        class CustomGameObject(bge.types.KX_GameObject):
-            RATE = 0.05
-
-            def __init__(self, old_owner):
-                # "old_owner" can just be ignored. At this point, "self" is
-                # already the object in the scene, and "old_owner" has been
-                # destroyed.
-
-                # New attributes can be defined - but we could also use a game
-                # property, like "self['rate']".
-                self.rate = CustomGameObject.RATE
-
-            def update(self):
-                self.worldPosition.z += self.rate
-
-                # switch direction
-                if self.worldPosition.z > 1.0:
-                    self.rate = -CustomGameObject.RATE
-                elif self.worldPosition.z < 0.0:
-                    self.rate = CustomGameObject.RATE
-
-        # Called first
-        def mutate(cont):
-            old_object = cont.owner
-            mutated_object = CustomGameObject(cont.owner)
-
-            # After calling the constructor above, references to the old object
-            # should not be used.
-            assert(old_object is not mutated_object)
-            assert(old_object.invalid)
-            assert(mutated_object is cont.owner)
-
-        # Called later - note we are now working with the mutated object.
-        def update(cont):
-            cont.owner.update()
-
-   When subclassing objects other than empties and meshes, the specific type
-   should be used - e.g. inherit from :class:`BL_ArmatureObject` when the object
-   to mutate is an armature.
-
-   .. attribute:: name
-
-      The object's name. (read-only).
-
-      :type: string
-
-   .. attribute:: mass
-
-      The object's mass
-
-      :type: float
-
-      .. note::
-         
-         The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
-      
-   .. attribute:: linVelocityMin
-
-      Enforces the object keeps moving at a minimum velocity.
-
-      :type: float
-      
-      .. note::
-      
-         Applies to dynamic and rigid body objects only.
-
-      .. note::
-         
-         A value of 0.0 disables this option.
-
-      .. note::
-      
-         While objects are stationary the minimum velocity will not be applied.
-
-   .. attribute:: linVelocityMax
-
-      Clamp the maximum linear velocity to prevent objects moving beyond a set speed.
-
-      :type: float
-      
-      .. note::
-         
-         Applies to dynamic and rigid body objects only.
-
-      .. note::
-
-         A value of 0.0 disables this option (rather then setting it stationary).
-
-   .. attribute:: localInertia
-
-      the object's inertia vector in local coordinates. Read only.
-
-      :type: list [ix, iy, iz]
-
-   .. attribute:: parent
-
-      The object's parent object. (read-only).
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: groupMembers
-
-      Returns the list of group members if the object is a group object, otherwise None is returned.
-
-      :type: :class:`CListValue` of :class:`KX_GameObject` or None
-
-   .. attribute:: groupObject
-
-      Returns the group object that the object belongs to or None if the object is not part of a group.
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: scene
-
-      The object's scene. (read-only).
-
-      :type: :class:`KX_Scene` or None
-
-   .. attribute:: visible
-
-      visibility flag.
-
-      :type: boolean
-      
-      .. note::
-      
-         Game logic will still run for invisible objects.
-
-   .. attribute:: color
-
-      The object color of the object. [r, g, b, a]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: occlusion
-
-      occlusion capability flag.
-
-      :type: boolean
-
-   .. attribute:: position
-
-      The object's position. [x, y, z] On write: local position, on read: world position
-
-      .. deprecated:: use :data:`localPosition` and :data:`worldPosition`.
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: orientation
-
-      The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. On write: local orientation, on read: world orientation
-
-      .. deprecated:: use :data:`localOrientation` and :data:`worldOrientation`.
-
-      :type: :class:`mathutils.Matrix`
-
-   .. attribute:: scaling
-
-      The object's scaling factor. [sx, sy, sz] On write: local scaling, on read: world scaling
-
-      .. deprecated:: use :data:`localScale` and :data:`worldScale`.
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: localOrientation
-
-      The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
-
-      :type: :class:`mathutils.Matrix`
-
-   .. attribute:: worldOrientation
-
-      The object's world orientation. 3x3 Matrix.
-
-      :type: :class:`mathutils.Matrix`
-
-   .. attribute:: localScale
-
-      The object's local scaling factor. [sx, sy, sz]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: worldScale
-
-      The object's world scaling factor. [sx, sy, sz]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: localPosition
-
-      The object's local position. [x, y, z]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: worldPosition
-
-      The object's world position. [x, y, z]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: localTransform
-
-      The object's local space transform matrix. 4x4 Matrix.
-
-      :type: :class:`mathutils.Matrix`
-
-   .. attribute:: worldTransform
-
-      The object's world space transform matrix. 4x4 Matrix.
-
-      :type: :class:`mathutils.Matrix`
-
-   .. attribute:: localLinearVelocity
-      
-      The object's local linear velocity. [x, y, z]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: worldLinearVelocity
-   
-      The object's world linear velocity. [x, y, z]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: localAngularVelocity
-   
-      The object's local angular velocity. [x, y, z]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: worldAngularVelocity
-   
-      The object's world angular velocity. [x, y, z]
-
-      :type: :class:`mathutils.Vector`
-
-   .. attribute:: timeOffset
-
-      adjust the slowparent delay at runtime.
-
-      :type: float
-
-   .. attribute:: state
-
-      the game object's state bitmask, using the first 30 bits, one bit must always be set.
-
-      :type: int
-
-   .. attribute:: meshes
-
-      a list meshes for this object.
-
-      :type: list of :class:`KX_MeshProxy`
-      
-      .. note::
-         
-         Most objects use only 1 mesh.
-
-      .. note::
-         
-         Changes to this list will not update the KX_GameObject.
-
-   .. attribute:: sensors
-
-      a sequence of :class:`SCA_ISensor` objects with string/index lookups and iterator support.
-
-      :type: list
-      
-      .. note::
-         
-         This attribute is experemental and may be removed (but probably wont be).
-
-      .. note::
-      
-         Changes to this list will not update the KX_GameObject.
-
-   .. attribute:: controllers
-
-      a sequence of :class:`SCA_IController` objects with string/index lookups and iterator support.
-
-      :type: list of :class:`SCA_ISensor`
-      
-      .. note::
-         
-         This attribute is experemental and may be removed (but probably wont be).
-
-      .. note::
-         
-         Changes to this list will not update the KX_GameObject.
-
-   .. attribute:: actuators
-
-      a list of :class:`SCA_IActuator` with string/index lookups and iterator support.
-
-      :type: list
-      
-      .. note::
-
-         This attribute is experemental and may be removed (but probably wont be).
-
-      .. note::
-
-         Changes to this list will not update the KX_GameObject.
-
-   .. attribute:: attrDict
-
-      get the objects internal python attribute dictionary for direct (faster) access.
-
-      :type: dict
-
-   .. attribute:: children
-
-      direct children of this object, (read-only).
-
-      :type: :class:`CListValue` of :class:`KX_GameObject`'s
-
-   .. attribute:: childrenRecursive
-
-      all children of this object including childrens children, (read-only).
-
-      :type: :class:`CListValue` of :class:`KX_GameObject`'s
-
-   .. attribute:: life
-
-      The number of seconds until the object ends, assumes 50fps.
-      (when added with an add object actuator), (read-only).
-
-      :type: float
-
-   .. method:: endObject()
-
-      Delete this object, can be used in place of the EndObject Actuator.
-
-      The actual removal of the object from the scene is delayed.
-
-   .. method:: replaceMesh(mesh, useDisplayMesh=True, usePhysicsMesh=False)
-
-      Replace the mesh of this object with a new mesh. This works the same was as the actuator.
-
-      :arg mesh: mesh to replace or the meshes name.
-      :type mesh: :class:`MeshProxy` or string
-      :arg useDisplayMesh: when enabled the display mesh will be replaced (optional argument).
-      :type useDisplayMesh: boolean
-      :arg usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument).
-      :type usePhysicsMesh: boolean
-
-   .. method:: setVisible(visible, recursive)
-
-      Sets the game object's visible flag.
-
-      :arg visible: the visible state to set.
-      :type visible: boolean
-      :arg recursive: optional argument to set all childrens visibility flag too.
-      :type recursive: boolean
-
-   .. method:: setOcclusion(occlusion, recursive)
-
-      Sets the game object's occlusion capability.
-
-      :arg occlusion: the state to set the occlusion to.
-      :type occlusion: boolean
-      :arg recursive: optional argument to set all childrens occlusion flag too.
-      :type recursive: boolean
-
-   .. method:: alignAxisToVect(vect, axis=2, factor=1.0)
-
-      Aligns any of the game object's axis along the given vector.
-
-
-      :arg vect: a vector to align the axis.
-      :type vect: 3D vector
-      :arg axis: The axis you want to align
-
-         * 0: X axis
-         * 1: Y axis
-         * 2: Z axis
-
-      :type axis: integer
-      :arg factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0)
-      :type factor: float
-
-   .. method:: getAxisVect(vect)
-
-      Returns the axis vector rotates by the objects worldspace orientation.
-      This is the equivalent of multiplying the vector by the orientation matrix.
-
-      :arg vect: a vector to align the axis.
-      :type vect: 3D Vector
-      :return: The vector in relation to the objects rotation.
-      :rtype: 3d vector.
-
-   .. method:: applyMovement(movement, local=False)
-
-      Sets the game object's movement.
-
-      :arg movement: movement vector.
-      :type movement: 3D Vector
-      :arg local:
-         * False: you get the "global" movement ie: relative to world orientation.
-         * True: you get the "local" movement ie: relative to object orientation.
-      :arg local: boolean
-
-   .. method:: applyRotation(rotation, local=False)
-
-      Sets the game object's rotation.
-
-      :arg rotation: rotation vector.
-      :type rotation: 3D Vector
-      :arg local:
-         * False: you get the "global" rotation ie: relative to world orientation.
-         * True: you get the "local" rotation ie: relative to object orientation.
-      :arg local: boolean
-
-   .. method:: applyForce(force, local=False)
-
-      Sets the game object's force.
-
-      This requires a dynamic object.
-
-      :arg force: force vector.
-      :type force: 3D Vector
-      :arg local:
-         * False: you get the "global" force ie: relative to world orientation.
-         * True: you get the "local" force ie: relative to object orientation.
-      :type local: boolean
-
-   .. method:: applyTorque(torque, local=False)
-
-      Sets the game object's torque.
-
-      This requires a dynamic object.
-
-      :arg torque: torque vector.
-      :type torque: 3D Vector
-      :arg local:
-         * False: you get the "global" torque ie: relative to world orientation.
-         * True: you get the "local" torque ie: relative to object orientation.
-      :type local: boolean
-
-   .. method:: getLinearVelocity(local=False)
-
-      Gets the game object's linear velocity.
-
-      This method returns the game object's velocity through it's centre of mass, ie no angular velocity component.
-
-      :arg local:
-         * False: you get the "global" velocity ie: relative to world orientation.
-         * True: you get the "local" velocity ie: relative to object orientation.
-      :type local: boolean
-      :return: the object's linear velocity.
-      :rtype: list [vx, vy, vz]
-
-   .. method:: setLinearVelocity(velocity, local=False)
-
-      Sets the game object's linear velocity.
-
-      This method sets game object's velocity through it's centre of mass, 
-      ie no angular velocity component.
-
-      This requires a dynamic object.
-
-      :arg velocity: linear velocity vector.
-      :type velocity: 3D Vector
-      :arg local:
-         * False: you get the "global" velocity ie: relative to world orientation.
-         * True: you get the "local" velocity ie: relative to object orientation.
-      :type local: boolean
-
-   .. method:: getAngularVelocity(local=False)
-
-      Gets the game object's angular velocity.
-
-      :arg local:
-         * False: you get the "global" velocity ie: relative to world orientation.
-         * True: you get the "local" velocity ie: relative to object orientation.
-      :type local: boolean
-      :return: the object's angular velocity.
-      :rtype: list [vx, vy, vz]
-
-   .. method:: setAngularVelocity(velocity, local=False)
-
-      Sets the game object's angular velocity.
-
-      This requires a dynamic object.
-
-      :arg velocity: angular velocity vector.
-      :type velocity: boolean
-      :arg local:
-         * False: you get the "global" velocity ie: relative to world orientation.
-         * True: you get the "local" velocity ie: relative to object orientation.
-
-   .. method:: getVelocity(point=(0, 0, 0))
-
-      Gets the game object's velocity at the specified point.
-
-      Gets the game object's velocity at the specified point, including angular
-      components.
-
-      :arg point: optional point to return the velocity for, in local coordinates.
-      :type point: 3D Vector
-      :return: the velocity at the specified point.
-      :rtype: list [vx, vy, vz]
-
-   .. method:: getReactionForce()
-
-      Gets the game object's reaction force.
-
-      The reaction force is the force applied to this object over the last simulation timestep.
-      This also includes impulses, eg from collisions.
-
-      :return: the reaction force of this object.
-      :rtype: list [fx, fy, fz]
-
-      .. note::
-
-         This is not implimented at the moment.
-
-   .. method:: applyImpulse(point, impulse)
-
-      Applies an impulse to the game object.
-
-      This will apply the specified impulse to the game object at the specified point.
-      If point != position, applyImpulse will also change the object's angular momentum.
-      Otherwise, only linear momentum will change.
-
-      :arg point: the point to apply the impulse to (in world coordinates)
-      :type point: the point to apply the impulse to (in world coordinates)
-
-   .. method:: suspendDynamics()
-
-      Suspends physics for this object.
-
-   .. method:: restoreDynamics()
-
-      Resumes physics for this object.
-
-      .. note::
-         
-         The objects linear velocity will be applied from when the dynamics were suspended.
-
-   .. method:: enableRigidBody()
-
-      Enables rigid body physics for this object.
-
-      Rigid body physics allows the object to roll on collisions.
-
-   .. method:: disableRigidBody()
-
-      Disables rigid body physics for this object.
-
-   .. method:: setParent(parent, compound=True, ghost=True)
-
-      Sets this object's parent.
-      Control the shape status with the optional compound and ghost parameters:
-
-      In that case you can control if it should be ghost or not:
-
-      :arg parent: new parent object.
-      :type parent: :class:`KX_GameObject`
-      :arg compound: whether the shape should be added to the parent compound shape.
-
-         * True: the object shape should be added to the parent compound shape.
-         * False: the object should keep its individual shape.
-
-      :type compound: boolean
-      :arg ghost: whether the object should be ghost while parented.
-
-         * True: if the object should be made ghost while parented.
-         * False: if the object should be solid while parented.
-
-      :type ghost: boolean
-
-      .. note::
-      
-         If the object type is sensor, it stays ghost regardless of ghost parameter
-
-   .. method:: removeParent()
-
-      Removes this objects parent.
-
-   .. method:: getPhysicsId()
-
-      Returns the user data object associated with this game object's physics controller.
-
-   .. method:: getPropertyNames()
-
-      Gets a list of all property names.
-
-      :return: All property names for this object.
-      :rtype: list
-
-   .. method:: getDistanceTo(other)
-
-      :arg other: a point or another :class:`KX_GameObject` to measure the distance to.
-      :type other: :class:`KX_GameObject` or list [x, y, z]
-      :return: distance to another object or point.
-      :rtype: float
-
-   .. method:: getVectTo(other)
-
-      Returns the vector and the distance to another object or point.
-      The vector is normalized unless the distance is 0, in which a zero length vector is returned.
-
-      :arg other: a point or another :class:`KX_GameObject` to get the vector and distance to.
-      :type other: :class:`KX_GameObject` or list [x, y, z]
-      :return: (distance, globalVector(3), localVector(3))
-      :rtype: 3-tuple (float, 3-tuple (x, y, z), 3-tuple (x, y, z))
-
-   .. method:: rayCastTo(other, dist, prop)
-
-      Look towards another point/object and find first object hit within dist that matches prop.
-
-      The ray is always casted from the center of the object, ignoring the object itself.
-      The ray is casted towards the center of another object or an explicit [x, y, z] point.
-      Use rayCast() if you need to retrieve the hit point
-
-      :arg other: [x, y, z] or object towards which the ray is casted
-      :type other: :class:`KX_GameObject` or 3-tuple
-      :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
-      :type dist: float
-      :arg prop: property name that object must have; can be omitted => detect any object
-      :type prop: string
-      :return: the first object hit or None if no object or object does not match prop
-      :rtype: :class:`KX_GameObject`
-
-   .. method:: rayCast(objto, objfrom, dist, prop, face, xray, poly)
-
-      Look from a point/object to another point/object and find first object hit within dist that matches prop.
-      if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None, None, None) if no hit.
-      if poly is 1, returns a 4-tuple with in addition a :class:`KX_PolyProxy` as 4th element.
-      if poly is 2, returns a 5-tuple with in addition a 2D vector with the UV mapping of the hit point as 5th element.
-
-      .. code-block:: python
-
-         # shoot along the axis gun-gunAim (gunAim should be collision-free)
-         obj, point, normal = gun.rayCast(gunAim, None, 50)
-         if obj:
-            # do something
-            pass
-
-      The face paremeter determines the orientation of the normal.
-
-      * 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
-      * 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
-
-      The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
-      The prop and xray parameters interact as follow.
-
-      * prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
-      * prop off, xray on : idem.
-      * prop on, xray off: return closest hit if it matches prop, no hit otherwise.
-      * prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
-
-      The :class:`KX_PolyProxy` 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray.
-      If there is no hit or the hit object is not a static mesh, None is returned as 4th element.
-
-      The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects.
-
-      :arg objto: [x, y, z] or object to which the ray is casted
-      :type objto: :class:`KX_GameObject` or 3-tuple
-      :arg objfrom: [x, y, z] or object from which the ray is casted; None or omitted => use self object center
-      :type objfrom: :class:`KX_GameObject` or 3-tuple or None
-      :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to
-      :type dist: float
-      :arg prop: property name that object must have; can be omitted or "" => detect any object
-      :type prop: string
-      :arg face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin
-      :type face: integer
-      :arg xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object
-      :type xray: integer
-      :arg poly: polygon option: 0, 1 or 2 to return a 3-, 4- or 5-tuple with information on the face hit.
-
-         * 0 or omitted: return value is a 3-tuple (object, hitpoint, hitnormal) or (None, None, None) if no hit
-         * 1: return value is a 4-tuple and the 4th element is a :class:`KX_PolyProxy` or None if no hit or the object doesn't use a mesh collision shape.
-         * 2: return value is a 5-tuple and the 5th element is a 2-tuple (u, v) with the UV mapping of the hit point or None if no hit, or the object doesn't use a mesh collision shape, or doesn't have a UV mapping.
-
-      :type poly: integer
-      :return: (object, hitpoint, hitnormal) or (object, hitpoint, hitnormal, polygon) or (object, hitpoint, hitnormal, polygon, hituv).
-
-         * object, hitpoint and hitnormal are None if no hit.
-         * polygon is valid only if the object is valid and is a static object, a dynamic object using mesh collision shape or a soft body object, otherwise it is None
-         * hituv is valid only if polygon is valid and the object has a UV mapping, otherwise it is None
-
-      :rtype:
-
-         * 3-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz))
-         * or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`)
-         * or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`, 2-tuple (u, v))
-
-      .. note::
-      
-         The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x, y, z] points.
-
-   .. method:: setCollisionMargin(margin)
-
-      Set the objects collision margin.
-
-      :arg margin: the collision margin distance in blender units.
-      :type margin: float
-
-      .. note::
-      
-         If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
-
-   .. method:: sendMessage(subject, body="", to="")
-
-      Sends a message.
-
-      :arg subject: The subject of the message
-      :type subject: string
-      :arg body: The body of the message (optional)
-      :type body: string
-      :arg to: The name of the object to send the message to (optional)
-      :type to: string
-
-   .. method:: reinstancePhysicsMesh(gameObject, meshObject)
-
-      Updates the physics system with the changed mesh.
-
-      If no arguments are given the physics mesh will be re-created from the first mesh assigned to the game object.
-
-      :arg gameObject: optional argument, set the physics shape from this gameObjets mesh.
-      :type gameObject: string, :class:`KX_GameObject` or None
-      :arg meshObject: optional argument, set the physics shape from this mesh.
-      :type meshObject: string, :class:`MeshProxy` or None
-
-      :return: True if reinstance succeeded, False if it failed.
-      :rtype: boolean
-
-      .. note::
-
-         If this object has instances the other instances will be updated too.
-      
-      .. note::
-
-         The gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as subsurf).
-      
-      .. warning::
-
-         Only triangle mesh type objects are supported currently (not convex hull)
-
-      .. warning::
-
-         If the object is a part of a combound object it will fail (parent or child)
-
-      .. warning::
-
-         Rebuilding the physics mesh can be slow, running many times per second will give a performance hit.
-
-   .. method:: get(key, default=None)
-
-      Return the value matching key, or the default value if its not found.
-      :return: The key value or a default.
-
-   .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0, blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0)
-
-      Plays an action.
-      
-      :arg name: the name of the action
-      :type name: string
-      :arg start: the start frame of the action
-      :type start: float
-      :arg end: the end frame of the action
-      :type end: float
-      :arg layer: the layer the action will play in (actions in different layers are added/blended together)
-      :type layer: integer
-      :arg priority: only play this action if there isn't an action currently playing in this layer with a higher (lower number) priority
-      :type priority: integer
-      :arg blendin: the amount of blending between this animation and the previous one on this layer
-      :type blendin: float
-      :arg play_mode: the play mode
-      :type play_mode: one of :ref:`these constants <gameobject-playaction-mode>`
-      :arg layer_weight: how much of the previous layer to use for blending (0 = add)
-      :type layer_weight: float
-      :arg ipo_flags: flags for the old IPO behaviors (force, etc)
-      :type ipo_flags: int bitfield
-      :arg speed: the playback speed of the action as a factor (1.0 = normal speed, 2.0 = 2x speed, etc)
-      :type speed: float
-
-   .. method:: stopAction(layer=0)
-      
-      Stop playing the action on the given layer.
-      
-      :arg layer: The layer to stop playing.
-      :type layer: integer
-      
-   .. method:: getActionFrame(layer=0)
-   
-      Gets the current frame of the action playing in the supplied layer.
-      
-      :arg layer: The layer that you want to get the frame from.
-      :type layer: integer
-      
-      :return: The current frame of the action
-      :rtype: float
-      
-   .. method:: setActionFrame(frame, layer=0)
-   
-      Set the current frame of the action playing in the supplied layer.
-      
-      :arg layer: The layer where you want to set the frame
-      :type layer: integer
-      :arg frame: The frame to set the action to
-      :type frame: float
-
-   .. method:: isPlayingAction(layer=0)
-   
-       Checks to see if there is an action playing in the given layer.
-       
-       :arg layer: The layer to check for a playing action.
-       :type layer: integer
-       
-       :return: Whether or not the action is playing
-       :rtype: boolean
-
-.. class:: KX_IpoActuator(SCA_IActuator)
-
-   IPO actuator activates an animation.
-
-   .. attribute:: frameStart
-
-      Start frame.
-
-      :type: float
-
-   .. attribute:: frameEnd
-
-      End frame.
-
-      :type: float
-
-   .. attribute:: propName
-
-      Use this property to define the Ipo position.
-
-      :type: string
-
-   .. attribute:: framePropName
-
-      Assign this property this action current frame number.
-
-      :type: string
-
-   .. attribute:: mode
-
-      Play mode for the ipo. Can be on of :ref:`these constants <ipo-actuator>`
-
-      :type: integer
-
-   .. attribute:: useIpoAsForce
-
-      Apply Ipo as a global or local force depending on the local option (dynamic objects only).
-
-      :type: boolean
-
-   .. attribute:: useIpoAdd
-
-      Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag.
-
-      :type: boolean
-
-   .. attribute:: useIpoLocal
-
-      Let the ipo acts in local coordinates, used in Force and Add mode.
-
-      :type: boolean
-
-   .. attribute:: useChildren
-
-      Update IPO on all children Objects as well.
-
-      :type: boolean
-
-.. class:: KX_LibLoadStatus(PyObjectPlus)
-
-   An object providing information about a LibLoad() operation.
-
-   .. code-block:: python
-
-      # Print a message when an async LibLoad is done
-      import bge
-
-      def finished_cb(status):
-          print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))
-
-      bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb
-
-   .. attribute:: onFinish
-
-      A callback that gets called when the lib load is done.
-
-      :type: callable
-
-   .. attribute:: progress
-
-      The current progress of the lib load as a normalized value from 0.0 to 1.0.
-
-      :type: float
-
-   .. attribute:: libraryName
-
-      The name of the library being loaded (the first argument to LibLoad).
-
-      :type: string
-
-   .. attribute:: timeTaken
-
-      The amount of time, in seconds, the lib load took (0 until the operation is complete).
-
-      :type: float
-
-.. class:: KX_LightObject(KX_GameObject)
-
-   A Light object.
-
-   .. code-block:: python
-
-      # Turn on a red alert light.
-      import bge
-
-      co = bge.logic.getCurrentController()
-      light = co.owner
-
-      light.energy = 1.0
-      light.color = [1.0, 0.0, 0.0]
-
-   .. data:: SPOT
-
-      A spot light source. See attribute :data:`type`
-
-   .. data:: SUN
-
-      A point light source with no attenuation. See attribute :data:`type`
-
-   .. data:: NORMAL
-
-      A point light source. See attribute :data:`type`
-
-   .. attribute:: type
-
-      The type of light - must be SPOT, SUN or NORMAL
-
-   .. attribute:: layer
-
-      The layer mask that this light affects object on.
-
-      :type: bitfield
-
-   .. attribute:: energy
-
-      The brightness of this light.
-
-      :type: float
-
-   .. attribute:: distance
-
-      The maximum distance this light can illuminate. (SPOT and NORMAL lights only).
-
-      :type: float
-
-   .. attribute:: color
-
-      The color of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
-
-      :type: list [r, g, b]
-
-   .. attribute:: lin_attenuation
-
-      The linear component of this light's attenuation. (SPOT and NORMAL lights only).
-
-      :type: float
-
-   .. attribute:: quad_attenuation
-
-      The quadratic component of this light's attenuation (SPOT and NORMAL lights only).
-
-      :type: float
-
-   .. attribute:: spotsize
-
-      The cone angle of the spot light, in degrees (SPOT lights only).
-
-      :type: float in [0 - 180].
-
-   .. attribute:: spotblend
-
-      Specifies the intensity distribution of the spot light (SPOT lights only).
-
-      :type: float in [0 - 1]
-
-      .. note::
-         
-         Higher values result in a more focused light source.
-
-.. class:: KX_MeshProxy(SCA_IObject)
-
-   A mesh object.
-
-   You can only change the vertex properties of a mesh object, not the mesh topology.
-
-   To use mesh objects effectively, you should know a bit about how the game engine handles them.
-
-   #. Mesh Objects are converted from Blender at scene load.
-   #. The Converter groups polygons by Material.  This means they can be sent to the renderer efficiently.  A material holds:
-
-      #. The texture.
-      #. The Blender material.
-      #. The Tile properties
-      #. The face properties - (From the "Texture Face" panel)
-      #. Transparency & z sorting
-      #. Light layer
-      #. Polygon shape (triangle/quad)
-      #. Game Object
-
-   #. Vertices will be split by face if necessary.  Vertices can only be shared between faces if:
-
-      #. They are at the same position
-      #. UV coordinates are the same
-      #. Their normals are the same (both polygons are "Set Smooth")
-      #. They are the same color, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
-
-   The correct method of iterating over every :class:`KX_VertexProxy` in a game object
-   
-   .. code-block:: python
-
-      from bge import logic
-
-      cont = logic.getCurrentController()
-      object = cont.owner
-
-      for mesh in object.meshes:
-         for m_index in range(len(mesh.materials)):
-            for v_index in range(mesh.getVertexArrayLength(m_index)):
-               vertex = mesh.getVertex(m_index, v_index)
-               # Do something with vertex here...
-               # ... eg: color the vertex red.
-               vertex.color = [1.0, 0.0, 0.0, 1.0]
-
-   .. attribute:: materials
-
-      :type: list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
-
-   .. attribute:: numPolygons
-
-      :type: integer
-
-   .. attribute:: numMaterials
-
-      :type: integer
-
-   .. method:: getMaterialName(matid)
-
-      Gets the name of the specified material.
-
-      :arg matid: the specified material.
-      :type matid: integer
-      :return: the attached material name.
-      :rtype: string
-
-   .. method:: getTextureName(matid)
-
-      Gets the name of the specified material's texture.
-
-      :arg matid: the specified material
-      :type matid: integer
-      :return: the attached material's texture name.
-      :rtype: string
-
-   .. method:: getVertexArrayLength(matid)
-
-      Gets the length of the vertex array associated with the specified material.
-
-      There is one vertex array for each material.
-
-      :arg matid: the specified material
-      :type matid: integer
-      :return: the number of verticies in the vertex array.
-      :rtype: integer
-
-   .. method:: getVertex(matid, index)
-
-      Gets the specified vertex from the mesh object.
-
-      :arg matid: the specified material
-      :type matid: integer
-      :arg index: the index into the vertex array.
-      :type index: integer
-      :return: a vertex object.
-      :rtype: :class:`KX_VertexProxy`
-
-   .. method:: getPolygon(index)
-
-      Gets the specified polygon from the mesh.
-
-      :arg index: polygon number
-      :type index: integer
-      :return: a polygon object.
-      :rtype: :class:`PolyProxy`
-
-   .. method:: transform(matid, matrix)
-
-      Transforms the vertices of a mesh.
-
-      :arg matid: material index, -1 transforms all.
-      :type matid: integer
-      :arg matrix: transformation matrix.
-      :type matrix: 4x4 matrix [[float]]
-
-   .. method:: transformUV(matid, matrix, uv_index=-1, uv_index_from=-1)
-
-      Transforms the vertices UV's of a mesh.
-
-      :arg matid: material index, -1 transforms all.
-      :type matid: integer
-      :arg matrix: transformation matrix.
-      :type matrix: 4x4 matrix [[float]]
-      :arg uv_index: optional uv index, -1 for all, otherwise 0 or 1.
-      :type uv_index: integer
-      :arg uv_index_from: optional uv index to copy from, -1 to transform the current uv.
-      :type uv_index_from: integer
-
-.. class:: SCA_MouseSensor(SCA_ISensor)
-
-   Mouse Sensor logic brick.
-
-   .. attribute:: position
-
-      current [x, y] coordinates of the mouse, in frame coordinates (pixels).
-
-      :type: [integer, interger]
-
-   .. attribute:: mode
-
-      sensor mode.
-
-      :type: integer
-
-         * KX_MOUSESENSORMODE_LEFTBUTTON(1)
-         * KX_MOUSESENSORMODE_MIDDLEBUTTON(2)
-         * KX_MOUSESENSORMODE_RIGHTBUTTON(3)
-         * KX_MOUSESENSORMODE_WHEELUP(4)
-         * KX_MOUSESENSORMODE_WHEELDOWN(5)
-         * KX_MOUSESENSORMODE_MOVEMENT(6)
-
-   .. method:: getButtonStatus(button)
-
-      Get the mouse button status.
- 
-      :arg button: The code that represents the key you want to get the state of, use one of :ref:`these constants<mouse-keys>`
-      :type button: int
-      :return: The state of the given key, can be one of :ref:`these constants<input-status>`
-      :rtype: int
-
-.. class:: KX_MouseFocusSensor(SCA_MouseSensor)
-
-   The mouse focus sensor detects when the mouse is over the current game object.
-
-   The mouse focus sensor works by transforming the mouse coordinates from 2d device
-   space to 3d space then raycasting away from the camera.
-
-   .. attribute:: raySource
-
-      The worldspace source of the ray (the view position).
-
-      :type: list (vector of 3 floats)
-
-   .. attribute:: rayTarget
-
-      The worldspace target of the ray.
-
-      :type: list (vector of 3 floats)
-
-   .. attribute:: rayDirection
-
-      The :data:`rayTarget` - :class:`raySource` normalized.
-
-      :type: list (normalized vector of 3 floats)
-
-   .. attribute:: hitObject
-
-      the last object the mouse was over.
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: hitPosition
-
-      The worldspace position of the ray intersecton.
-
-      :type: list (vector of 3 floats)
-
-   .. attribute:: hitNormal
-
-      the worldspace normal from the face at point of intersection.
-
-      :type: list (normalized vector of 3 floats)
-
-   .. attribute:: hitUV
-
-      the UV coordinates at the point of intersection.
-
-      :type: list (vector of 2 floats)
-
-      If the object has no UV mapping, it returns [0, 0].
-
-      The UV coordinates are not normalized, they can be < 0 or > 1 depending on the UV mapping.
-
-   .. attribute:: usePulseFocus
-
-      When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set).
-
-      :type: boolean
-
-.. class:: KX_TouchSensor(SCA_ISensor)
-
-   Touch sensor detects collisions between objects.
-
-   .. attribute:: propName
-
-      The property or material to collide with.
-
-      :type: string
-
-   .. attribute:: useMaterial
-
-      Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property.
-
-      :type: boolean
-
-   .. attribute:: usePulseCollision
-
-      When enabled, changes to the set of colliding objects generate a pulse.
-
-      :type: boolean
-
-   .. attribute:: hitObject
-
-      The last collided object. (read-only).
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: hitObjectList
-
-      A list of colliding objects. (read-only).
-
-      :type: :class:`CListValue` of :class:`KX_GameObject`
-
-.. class:: KX_NearSensor(KX_TouchSensor)
-
-   A near sensor is a specialised form of touch sensor.
-
-   .. attribute:: distance
-
-      The near sensor activates when an object is within this distance.
-
-      :type: float
-
-   .. attribute:: resetDistance
-
-      The near sensor deactivates when the object exceeds this distance.
-
-      :type: float
-
-.. class:: KX_NetworkMessageActuator(SCA_IActuator)
-
-   Message Actuator
-
-   .. attribute:: propName
-
-      Messages will only be sent to objects with the given property name.
-
-      :type: string
-
-   .. attribute:: subject
-
-      The subject field of the message.
-
-      :type: string
-
-   .. attribute:: body
-
-      The body of the message.
-
-      :type: string
-
-   .. attribute:: usePropBody
-
-      Send a property instead of a regular body message.
-
-      :type: boolean
-
-.. class:: KX_NetworkMessageSensor(SCA_ISensor)
-
-   The Message Sensor logic brick.
-
-   Currently only loopback (local) networks are supported.
-
-   .. attribute:: subject
-
-      The subject the sensor is looking for.
-
-      :type: string
-
-   .. attribute:: frameMessageCount
-
-      The number of messages received since the last frame. (read-only).
-
-      :type: integer
-
-   .. attribute:: subjects
-
-      The list of message subjects received. (read-only).
-
-      :type: list of strings
-
-   .. attribute:: bodies
-
-      The list of message bodies received. (read-only).
-
-      :type: list of strings
-
-
-.. class:: KX_FontObject(KX_GameObject)
-
-   TODO.
-
-
-.. class:: KX_NavMeshObject(KX_GameObject)
-
-   Python interface for using and controlling navigation meshes. 
-
-   .. method:: findPath(start, goal)
-
-      Finds the path from start to goal points.
-
-      :arg start: the start point
-      :arg start: 3D Vector
-      :arg goal: the goal point
-      :arg start: 3D Vector
-      :return: a path as a list of points
-      :rtype: list of points
-
-   .. method:: raycast(start, goal)
-
-      Raycast from start to goal points.
-
-      :arg start: the start point
-      :arg start: 3D Vector
-      :arg goal: the goal point
-      :arg start: 3D Vector
-      :return: the hit factor
-      :rtype: float
-
-   .. method:: draw(mode)
-
-      Draws a debug mesh for the navigation mesh.
-
-      :arg mode: the drawing mode (one of :ref:`these constants <navmesh-draw-mode>`)
-      :arg mode: integer
-      :return: None
-
-   .. method:: rebuild()
-
-      Rebuild the navigation mesh.
-
-      :return: None
-
-.. class:: KX_ObjectActuator(SCA_IActuator)
-
-   The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, 
-   velocity, or angular velocity to an object.
-   Servo control allows to regulate force to achieve a certain speed target.
-
-   .. attribute:: force
-
-      The force applied by the actuator.
-
-      :type: list [x, y, z]
-
-   .. attribute:: useLocalForce
-
-      A flag specifying if the force is local.
-
-      :type: boolean
-
-   .. attribute:: torque
-
-      The torque applied by the actuator.
-
-      :type: list [x, y, z]
-
-   .. attribute:: useLocalTorque
-
-      A flag specifying if the torque is local.
-
-      :type: boolean
-
-   .. attribute:: dLoc
-
-      The displacement vector applied by the actuator.
-
-      :type: list [x, y, z]
-
-   .. attribute:: useLocalDLoc
-
-      A flag specifying if the dLoc is local.
-
-      :type: boolean
-
-   .. attribute:: dRot
-
-      The angular displacement vector applied by the actuator
-
-      :type: list [x, y, z]
-      
-      .. note::
-      
-         Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed.
-
-   .. attribute:: useLocalDRot
-
-      A flag specifying if the dRot is local.
-
-      :type: boolean
-
-   .. attribute:: linV
-
-      The linear velocity applied by the actuator.
-
-      :type: list [x, y, z]
-
-   .. attribute:: useLocalLinV
-
-      A flag specifying if the linear velocity is local.
-
-      :type: boolean
-      
-      .. note::
-      
-         This is the target speed for servo controllers.
-
-   .. attribute:: angV
-
-      The angular velocity applied by the actuator.
-
-      :type: list [x, y, z]
-
-   .. attribute:: useLocalAngV
-
-      A flag specifying if the angular velocity is local.
-
-      :type: boolean
-
-   .. attribute:: damping
-
-      The damping parameter of the servo controller.
-
-      :type: short
-
-   .. attribute:: forceLimitX
-
-      The min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
-
-      :type: list [min(float), max(float), bool]
-
-   .. attribute:: forceLimitY
-
-      The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
-
-      :type: list [min(float), max(float), bool]
-
-   .. attribute:: forceLimitZ
-
-      The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
-
-      :type: list [min(float), max(float), bool]
-
-   .. attribute:: pid
-
-      The PID coefficients of the servo controller.
-
-      :type: list of floats [proportional, integral, derivate]
-
-   .. attribute:: reference
-
-      The object that is used as reference to compute the velocity for the servo controller.
-
-      :type: :class:`KX_GameObject` or None
-
-.. class:: KX_ParentActuator(SCA_IActuator)
-
-   The parent actuator can set or remove an objects parent object.
-
-   .. attribute:: object
-
-      the object this actuator sets the parent too.
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: mode
-
-      The mode of this actuator.
-
-      :type: integer from 0 to 1.
-
-   .. attribute:: compound
-
-      Whether the object shape should be added to the parent compound shape when parenting.
-
-      Effective only if the parent is already a compound shape.
-
-      :type: boolean
-
-   .. attribute:: ghost
-
-      Whether the object should be made ghost when parenting
-      Effective only if the shape is not added to the parent compound shape.
-
-      :type: boolean
-
-.. class:: KX_PolyProxy(SCA_IObject)
-
-   A polygon holds the index of the vertex forming the poylgon.
-
-   Note:
-   The polygon attributes are read-only, you need to retrieve the vertex proxy if you want
-   to change the vertex settings.
-
-   .. attribute:: material_name
-
-      The name of polygon material, empty if no material.
-
-      :type: string
-
-   .. attribute:: material
-
-      The material of the polygon.
-
-      :type: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
-
-   .. attribute:: texture_name
-
-      The texture name of the polygon.
-
-      :type: string
-
-   .. attribute:: material_id
-
-      The material index of the polygon, use this to retrieve vertex proxy from mesh proxy.
-
-      :type: integer
-
-   .. attribute:: v1
-
-      vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
-
-      :type: integer
-
-   .. attribute:: v2
-
-      vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
-
-      :type: integer
-
-   .. attribute:: v3
-
-      vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
-
-      :type: integer
-
-   .. attribute:: v4
-
-      Vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
-      Use this to retrieve vertex proxy from mesh proxy.
-
-      :type: integer
-
-   .. attribute:: visible
-
-      visible state of the polygon: 1=visible, 0=invisible.
-
-      :type: integer
-
-   .. attribute:: collide
-
-      collide state of the polygon: 1=receives collision, 0=collision free.
-
-      :type: integer
-
-   .. method:: getMaterialName()
-
-      Returns the polygon material name with MA prefix
-
-      :return: material name
-      :rtype: string
-
-   .. method:: getMaterial()
-
-      :return: The polygon material
-      :rtype: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
-
-   .. method:: getTextureName()
-
-      :return: The texture name
-      :rtype: string
-
-   .. method:: getMaterialIndex()
-
-      Returns the material bucket index of the polygon.
-      This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
-
-      :return: the material index in the mesh
-      :rtype: integer
-
-   .. method:: getNumVertex()
-
-      Returns the number of vertex of the polygon.
-
-      :return: number of vertex, 3 or 4.
-      :rtype: integer
-
-   .. method:: isVisible()
-
-      Returns whether the polygon is visible or not
-
-      :return: 0=invisible, 1=visible
-      :rtype: boolean
-
-   .. method:: isCollider()
-
-      Returns whether the polygon is receives collision or not
-
-      :return: 0=collision free, 1=receives collision
-      :rtype: integer
-
-   .. method:: getVertexIndex(vertex)
-
-      Returns the mesh vertex index of a polygon vertex
-      This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
-
-      :arg vertex: index of the vertex in the polygon: 0->3
-      :arg vertex: integer
-      :return: mesh vertex index
-      :rtype: integer
-
-   .. method:: getMesh()
-
-      Returns a mesh proxy
-
-      :return: mesh proxy
-      :rtype: :class:`MeshProxy`
-
-.. class:: KX_PolygonMaterial(PyObjectPlus)
-
-   This is the interface to materials in the game engine.
-
-   Materials define the render state to be applied to mesh objects.
-
-   .. warning::
-
-      Some of the methods/variables are CObjects.  If you mix these up, you will crash blender.
-
-   .. code-block:: python
-
-      from bge import logic
-      
-      vertex_shader = """
-      
-      void main(void)
-      {
-         // original vertex position, no changes
-         gl_Position = ftransform();
-         // coordinate of the 1st texture channel
-         gl_TexCoord[0] = gl_MultiTexCoord0;
-         // coordinate of the 2nd texture channel
-         gl_TexCoord[1] = gl_MultiTexCoord1;
-      }
-      """
-      
-      fragment_shader ="""
-
-      uniform sampler2D color_0;
-      uniform sampler2D color_1;
-      uniform float factor;
-
-      void main(void)
-      {
-         vec4 color_0 = texture2D(color_0, gl_TexCoord[0].st);
-         vec4 color_1 = texture2D(color_1, gl_TexCoord[1].st);
-         gl_FragColor = mix(color_0, color_1, factor);
-      }
-      """
-
-      object = logic.getCurrentController().owner
-      object = cont.owner
-      for mesh in object.meshes:
-          for material in mesh.materials:
-              shader = material.getShader()
-              if shader != None:
-                  if not shader.isValid():
-                      shader.setSource(vertex_shader, fragment_shader, True)
-
-                  # get the first texture channel of the material
-                  shader.setSampler('color_0', 0)
-                  # get the second texture channel of the material
-                  shader.setSampler('color_1', 1)
-                  # pass another uniform to the shader
-                  shader.setUniform1f('factor', 0.3)
-
-
-   .. attribute:: texture
-
-      Texture name.
-
-      :type: string (read-only)
-
-   .. attribute:: gl_texture
-
-      OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture).
-
-      :type: integer (read-only)
-
-   .. attribute:: material
-
-      Material name.
-
-      :type: string (read-only)
-
-   .. attribute:: tface
-
-      Texture face properties.
-
-      :type: CObject (read-only)
-
-   .. attribute:: tile
-
-      Texture is tiling.
-
-      :type: boolean
-
-   .. attribute:: tilexrep
-
-      Number of tile repetitions in x direction.
-
-      :type: integer
-
-   .. attribute:: tileyrep
-
-      Number of tile repetitions in y direction.
-
-      :type: integer
-
-   .. attribute:: drawingmode
-
-      Drawing mode for the material.
-      - 2  (drawingmode & 4)     Textured
-      - 4  (drawingmode & 16)    Light
-      - 14 (drawingmode & 16384) 3d Polygon Text.
-
-      :type: bitfield
-
-   .. attribute:: transparent
-
-      This material is transparent. All meshes with this
-      material will be rendered after non transparent meshes from back
-      to front.
-
-      :type: boolean
-
-   .. attribute:: zsort
-
-      Transparent polygons in meshes with this material will be sorted back to
-      front before rendering.
-      Non-Transparent polygons will be sorted front to back before rendering.
-
-      :type: boolean
-
-   .. attribute:: diffuse
-
-      The diffuse color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
-
-      :type: list [r, g, b]
-
-   .. attribute:: specular
-
-      The specular color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
-
-      :type: list [r, g, b]
-
-   .. attribute:: shininess
-
-      The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0.
-
-      :type: float
-
-   .. attribute:: specularity
-
-      The amount of specular of the material. 0.0 <= specularity <= 1.0.
-
-      :type: float
-
-   .. method:: updateTexture(tface, rasty)
-
-      Updates a realtime animation.
-
-      :arg tface: Texture face (eg mat.tface)
-      :type tface: CObject
-      :arg rasty: Rasterizer
-      :type rasty: CObject
-
-   .. method:: setTexture(tface)
-
-      Sets texture render state.
-
-      :arg tface: Texture face
-      :type tface: CObject
-
-      .. code-block:: python
-
-         mat.setTexture(mat.tface)
-         
-   .. method:: activate(rasty, cachingInfo)
-
-      Sets material parameters for this object for rendering.
-
-      Material Parameters set:
-
-      #. Texture
-      #. Backface culling
-      #. Line drawing
-      #. Specular Colour
-      #. Shininess
-      #. Diffuse Colour
-      #. Polygon Offset.
-
-      :arg rasty: Rasterizer instance.
-      :type rasty: CObject
-      :arg cachingInfo: Material cache instance.
-      :type cachingInfo: CObject
-
-   .. method:: setCustomMaterial(material)
-
-      Sets the material state setup object.
-
-      Using this method, you can extend or completely replace the gameengine material
-      to do your own advanced multipass effects.
-
-      Use this method to register your material class.  Instead of the normal material, 
-      your class's activate method will be called just before rendering the mesh.
-      This should setup the texture, material, and any other state you would like.
-      It should return True to render the mesh, or False if you are finished.  You should
-      clean up any state Blender does not set before returning False.
-
-      Activate Method Definition:
-
-      .. code-block:: python
-      
-         def activate(self, rasty, cachingInfo, material):
-
-      :arg material: The material object.
-      :type material: instance
-
-      .. code-block:: python
-
-         class PyMaterial:
-           def __init__(self):
-             self.pass_no = -1
-           
-           def activate(self, rasty, cachingInfo, material):
-             # Activate the material here.
-             #
-             # The activate method will be called until it returns False.
-             # Every time the activate method returns True the mesh will
-             # be rendered.
-             #
-             # rasty is a CObject for passing to material.updateTexture() 
-             #       and material.activate()
-             # cachingInfo is a CObject for passing to material.activate()
-             # material is the KX_PolygonMaterial instance this material
-             #          was added to
-             
-             # default material properties:
-             self.pass_no += 1
-             if self.pass_no == 0:
-               material.activate(rasty, cachingInfo)
-               # Return True to do this pass
-               return True
-             
-             # clean up and return False to finish.
-             self.pass_no = -1
-             return False
-         
-         # Create a new Python Material and pass it to the renderer.
-         mat.setCustomMaterial(PyMaterial())
-         
-.. class:: KX_RadarSensor(KX_NearSensor)
-
-   Radar sensor is a near sensor with a conical sensor object.
-
-   .. attribute:: coneOrigin
-
-      The origin of the cone with which to test. The origin is in the middle of the cone. (read-only).
-
-      :type: list of floats [x, y, z]
-
-   .. attribute:: coneTarget
-
-      The center of the bottom face of the cone with which to test. (read-only).
-
-      :type: list of floats [x, y, z]
-
-   .. attribute:: distance
-
-      The height of the cone with which to test.
-
-      :type: float
-
-   .. attribute:: angle
-
-      The angle of the cone (in degrees) with which to test.
-
-      :type: float
-
-   .. attribute:: axis
-
-      The axis on which the radar cone is cast.
-
-      :type: integer from 0 to 5
-
-      KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, 
-      KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
-
-.. class:: KX_RaySensor(SCA_ISensor)
-
-   A ray sensor detects the first object in a given direction.
-
-   .. attribute:: propName
-
-      The property the ray is looking for.
-
-      :type: string
-
-   .. attribute:: range
-
-      The distance of the ray.
-
-      :type: float
-
-   .. attribute:: useMaterial
-
-      Whether or not to look for a material (false = property).
-
-      :type: boolean
-
-   .. attribute:: useXRay
-
-      Whether or not to use XRay.
-
-      :type: boolean
-
-   .. attribute:: hitObject
-
-      The game object that was hit by the ray. (read-only).
-
-      :type: :class:`KX_GameObject`
-
-   .. attribute:: hitPosition
-
-      The position (in worldcoordinates) where the object was hit by the ray. (read-only).
-
-      :type: list [x, y, z]
-
-   .. attribute:: hitNormal
-
-      The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (read-only).
-
-      :type: list [x, y, z]
-
-   .. attribute:: rayDirection
-
-      The direction from the ray (in worldcoordinates). (read-only).
-
-      :type: list [x, y, z]
-
-   .. attribute:: axis
-
-      The axis the ray is pointing on.
-
-      :type: integer from 0 to 5
-
-      * KX_RAY_AXIS_POS_X
-      * KX_RAY_AXIS_POS_Y
-      * KX_RAY_AXIS_POS_Z
-      * KX_RAY_AXIS_NEG_X
-      * KX_RAY_AXIS_NEG_Y
-      * KX_RAY_AXIS_NEG_Z
-
-.. class:: KX_SCA_AddObjectActuator(SCA_IActuator)
-
-   Edit Object Actuator (in Add Object Mode)
-
-   .. warning::
-
-      An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer.
-
-      .. code-block:: none
-
-         Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer) 
-      
-   .. attribute:: object
-
-      the object this actuator adds.
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: objectLastCreated
-
-      the last added object from this actuator (read-only).
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: time
-
-      the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
-
-      :type: integer
-
-   .. attribute:: linearVelocity
-
-      the initial linear velocity of added objects.
-
-      :type: list [vx, vy, vz]
-
-   .. attribute:: angularVelocity
-
-      the initial angular velocity of added objects.
-
-      :type: list [vx, vy, vz]
-
-   .. method:: instantAddObject()
-
-      adds the object without needing to calling SCA_PythonController.activate()
-
-      .. note:: Use objectLastCreated to get the newly created object.
-
-.. class:: KX_SCA_DynamicActuator(SCA_IActuator)
-
-   Dynamic Actuator.
-
-   .. attribute:: mode
-
-      :type: integer
-
-      the type of operation of the actuator, 0-4
-
-      * KX_DYN_RESTORE_DYNAMICS(0)
-      * KX_DYN_DISABLE_DYNAMICS(1)
-      * KX_DYN_ENABLE_RIGID_BODY(2)
-      * KX_DYN_DISABLE_RIGID_BODY(3)
-      * KX_DYN_SET_MASS(4)
-
-   .. attribute:: mass
-
-      the mass value for the KX_DYN_SET_MASS operation.
-
-      :type: float
-
-.. class:: KX_SCA_EndObjectActuator(SCA_IActuator)
-
-   Edit Object Actuator (in End Object mode)
-
-   This actuator has no python methods.
-
-.. class:: KX_SCA_ReplaceMeshActuator(SCA_IActuator)
-
-   Edit Object actuator, in Replace Mesh mode.
-
-   .. warning::
-
-      Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist.
-
-      This will generate a warning in the console
-
-      .. code-block:: none
-      
-         Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object
-
-   .. code-block:: python
-
-      # Level-of-detail
-      # Switch a game object's mesh based on its depth in the camera view.
-      # +----------+     +-----------+     +-------------------------------------+
-      # | Always   +-----+ Python    +-----+ Edit Object (Replace Mesh) LOD.Mesh |
-      # +----------+     +-----------+     +-------------------------------------+
-      from bge import logic
-
-      # List detail meshes here
-      # Mesh (name, near, far)
-      # Meshes overlap so that they don't 'pop' when on the edge of the distance.
-      meshes = ((".Hi", 0.0, -20.0),
-            (".Med", -15.0, -50.0),
-            (".Lo", -40.0, -100.0)
-          )
-      
-      cont = logic.getCurrentController()
-      object = cont.owner
-      actuator = cont.actuators["LOD." + obj.name]
-      camera = logic.getCurrentScene().active_camera
-      
-      def Depth(pos, plane):
-        return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3]
-      
-      # Depth is negative and decreasing further from the camera
-      depth = Depth(object.position, camera.world_to_camera[2])
-      
-      newmesh = None
-      curmesh = None
-      # Find the lowest detail mesh for depth
-      for mesh in meshes:
-        if depth < mesh[1] and depth > mesh[2]:
-          newmesh = mesh
-        if "ME" + object.name + mesh[0] == actuator.getMesh():
-            curmesh = mesh
-      
-      if newmesh != None and "ME" + object.name + newmesh[0] != actuator.mesh:
-        # The mesh is a different mesh - switch it.
-        # Check the current mesh is not a better fit.
-        if curmesh == None or curmesh[1] < depth or curmesh[2] > depth:
-          actuator.mesh = object.name + newmesh[0]
-          cont.activate(actuator)
-
-   .. attribute:: mesh
-
-      :class:`MeshProxy` or the name of the mesh that will replace the current one.
-   
-      Set to None to disable actuator.
-
-      :type: :class:`MeshProxy` or None if no mesh is set
-
-   .. attribute:: useDisplayMesh
-
-      when true the displayed mesh is replaced.
-
-      :type: boolean
-
-   .. attribute:: usePhysicsMesh
-
-      when true the physics mesh is replaced.
-
-      :type: boolean
-
-   .. method:: instantReplaceMesh()
-
-      Immediately replace mesh without delay.
-
-.. class:: KX_Scene(PyObjectPlus)
-
-   An active scene that gives access to objects, cameras, lights and scene attributes.
-
-   The activity culling stuff is supposed to disable logic bricks when their owner gets too far
-   from the active camera.  It was taken from some code lurking at the back of KX_Scene - who knows
-   what it does!
-
-   .. code-block:: python
-
-      from bge import logic
-
-      # get the scene
-      scene = logic.getCurrentScene()
-
-      # print all the objects in the scene
-      for object in scene.objects:
-         print(object.name)
-
-      # get an object named 'Cube'
-      object = scene.objects["Cube"]
-
-      # get the first object in the scene.
-      object = scene.objects[0]
-
-   .. code-block:: python
-
-      # Get the depth of an object in the camera view.
-      from bge import logic
-
-      object = logic.getCurrentController().owner
-      cam = logic.getCurrentScene().active_camera
-
-      # Depth is negative and decreasing further from the camera
-      depth = object.position[0]*cam.world_to_camera[2][0] + object.position[1]*cam.world_to_camera[2][1] + object.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3]
-
-   @bug: All attributes are read only at the moment.
-
-   .. attribute:: name
-
-      The scene's name, (read-only).
-
-      :type: string
-
-   .. attribute:: objects
-
-      A list of objects in the scene, (read-only).
-
-      :type: :class:`CListValue` of :class:`KX_GameObject`
-
-   .. attribute:: objectsInactive
-
-      A list of objects on background layers (used for the addObject actuator), (read-only).
-
-      :type: :class:`CListValue` of :class:`KX_GameObject`
-
-   .. attribute:: lights
-
-      A list of lights in the scene, (read-only).
-
-      :type: :class:`CListValue` of :class:`KX_LightObject`
-
-   .. attribute:: cameras
-
-      A list of cameras in the scene, (read-only).
-
-      :type: :class:`CListValue` of :class:`KX_Camera`
-
-   .. attribute:: active_camera
-
-      The current active camera.
-
-      :type: :class:`KX_Camera`
-      
-      .. note::
-         
-         This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
-
-   .. attribute:: suspended
-
-      True if the scene is suspended, (read-only).
-
-      :type: boolean
-
-   .. attribute:: activity_culling
-
-      True if the scene is activity culling.
-
-      :type: boolean
-
-   .. attribute:: activity_culling_radius
-
-      The distance outside which to do activity culling. Measured in manhattan distance.
-
-      :type: float
-
-   .. attribute:: dbvt_culling
-
-      True when Dynamic Bounding box Volume Tree is set (read-only).
-
-      :type: boolean
-
-   .. attribute:: pre_draw
-
-      A list of callables to be run before the render step.
-
-      :type: list
-
-   .. attribute:: post_draw
-
-      A list of callables to be run after the render step.
-
-      :type: list
-
-   .. attribute:: gravity
-
-      The scene gravity using the world x, y and z axis.
-
-      :type: list [fx, fy, fz]
-
-   .. method:: addObject(object, other, time=0)
-
-      Adds an object to the scene like the Add Object Actuator would.
-
-      :arg object: The object to add
-      :type object: :class:`KX_GameObject` or string
-      :arg other: The object's center to use when adding the object
-      :type other: :class:`KX_GameObject` or string
-      :arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
-      :type time: integer
-      :return: The newly added object.
-      :rtype: :class:`KX_GameObject`
-
-   .. method:: end()
-
-      Removes the scene from the game.
-
-   .. method:: restart()
-
-      Restarts the scene.
-
-   .. method:: replace(scene)
-
-      Replaces this scene with another one.
-
-      :arg scene: The name of the scene to replace this scene with.
-      :type scene: string
-
-   .. method:: suspend()
-
-      Suspends this scene.
-
-   .. method:: resume()
-
-      Resume this scene.
-
-   .. method:: get(key, default=None)
-
-      Return the value matching key, or the default value if its not found.
-      :return: The key value or a default.
-
-   .. method:: drawObstacleSimulation()
-
-      Draw debug visualization of obstacle simulation.
-
-.. class:: KX_SceneActuator(SCA_IActuator)
-
-   Scene Actuator logic brick.
-
-   .. warning::
-
-      Scene actuators that use a scene name will be ignored if at game start, the named scene doesn't exist or is empty
-
-      This will generate a warning in the console:
-
-      .. code-block:: none
-      
-         Error: GameObject 'Name' has a SceneActuator 'ActuatorName' (SetScene) without scene
-
-   .. attribute:: scene
-
-      the name of the scene to change to/overlay/underlay/remove/suspend/resume.
-
-      :type: string
-
-   .. attribute:: camera
-
-      the camera to change to.
-
-      :type: :class:`KX_Camera` on read, string or :class:`KX_Camera` on write
-      
-      .. note::
-         
-         When setting the attribute, you can use either a :class:`KX_Camera` or the name of the camera.
-
-   .. attribute:: useRestart
-
-      Set flag to True to restart the sene.
-
-      :type: boolean
-
-   .. attribute:: mode
-
-      The mode of the actuator.
-
-      :type: integer from 0 to 5.
-
-.. class:: KX_SoundActuator(SCA_IActuator)
-
-   Sound Actuator.
-
-   The :data:`startSound`, :data:`pauseSound` and :data:`stopSound` do not require the actuator to be activated - they act instantly provided that the actuator has been activated once at least.
-
-   .. attribute:: volume
-
-      The volume (gain) of the sound.
-
-      :type: float
-
-   .. attribute:: time
-
-      The current position in the audio stream (in seconds).
-
-      :type: float
-
-   .. attribute:: pitch
-
-      The pitch of the sound.
-
-      :type: float
-
-   .. attribute:: mode
-
-      The operation mode of the actuator. Can be one of :ref:`these constants<logic-sound-actuator>`
-
-      :type: integer
-
-   .. attribute:: sound
-
-      The sound the actuator should play.
-
-      :type: Audaspace factory
-
-   .. attribute:: is3D
-
-      Whether or not the actuator should be using 3D sound. (read-only)
-
-      :type: boolean
-
-   .. attribute:: volume_maximum
-
-      The maximum gain of the sound, no matter how near it is.
-
-      :type: float
-
-   .. attribute:: volume_minimum
-
-      The minimum gain of the sound, no matter how far it is away.
-
-      :type: float
-
-   .. attribute:: distance_reference
-
-      The distance where the sound has a gain of 1.0.
-
-      :type: float
-
-   .. attribute:: distance_maximum
-
-      The maximum distance at which you can hear the sound.
-
-      :type: float
-
-   .. attribute:: attenuation
-
-      The influence factor on volume depending on distance.
-
-      :type: float
-
-   .. attribute:: cone_angle_inner
-
-      The angle of the inner cone.
-
-      :type: float
-
-   .. attribute:: cone_angle_outer
-
-      The angle of the outer cone.
-
-      :type: float
-
-   .. attribute:: cone_volume_outer
-
-      The gain outside the outer cone (the gain in the outer cone will be interpolated between this value and the normal gain in the inner cone).
-
-      :type: float
-
-   .. method:: startSound()
-
-      Starts the sound.
-
-      :return: None
-
-   .. method:: pauseSound()
-
-      Pauses the sound.
-
-      :return: None
-
-   .. method:: stopSound()
-
-      Stops the sound.
-
-      :return: None
-
-.. class:: KX_StateActuator(SCA_IActuator)
-
-   State actuator changes the state mask of parent object.
-
-   .. attribute:: operation
-
-      Type of bit operation to be applied on object state mask.
-      
-      You can use one of :ref:`these constants <state-actuator-operation>`
-
-      :type: integer
-
-   .. attribute:: mask
-
-      Value that defines the bits that will be modified by the operation.
-
-      The bits that are 1 in the mask will be updated in the object state.
-
-      The bits that are 0 are will be left unmodified expect for the Copy operation which copies the mask to the object state.
-
-      :type: integer
-
-.. class:: KX_TrackToActuator(SCA_IActuator)
-
-   Edit Object actuator in Track To mode.
-
-   .. warning::
-   
-      Track To Actuators will be ignored if at game start, the object to track to is invalid.
-
-      This will generate a warning in the console:
-
-      .. code-block:: none
-
-         GameObject 'Name' no object in EditObjectActuator 'ActuatorName'
-
-   .. attribute:: object
-
-      the object this actuator tracks.
-
-      :type: :class:`KX_GameObject` or None
-
-   .. attribute:: time
-
-      the time in frames with which to delay the tracking motion.
-
-      :type: integer
-
-   .. attribute:: use3D
-
-      the tracking motion to use 3D.
-
-      :type: boolean
-
-.. class:: KX_VehicleWrapper(PyObjectPlus)
-
-   KX_VehicleWrapper
-
-   TODO - description
-
-   .. method:: addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
-
-      Add a wheel to the vehicle
-
-      :arg wheel: The object to use as a wheel.
-      :type wheel: :class:`KX_GameObject` or a KX_GameObject name
-      :arg attachPos: The position that this wheel will attach to.
-      :type attachPos: vector of 3 floats
-      :arg attachDir: The direction this wheel points.
-      :type attachDir: vector of 3 floats
-      :arg axleDir: The direction of this wheels axle.
-      :type axleDir: vector of 3 floats
-      :arg suspensionRestLength: TODO - Description
-      :type suspensionRestLength: float
-      :arg wheelRadius: The size of the wheel.
-      :type wheelRadius: float
-
-   .. method:: applyBraking(force, wheelIndex)
-
-      Apply a braking force to the specified wheel
-
-      :arg force: the brake force
-      :type force: float
-
-      :arg wheelIndex: index of the wheel where the force needs to be applied
-      :type wheelIndex: integer
-
-   .. method:: applyEngineForce(force, wheelIndex)
-
-      Apply an engine force to the specified wheel
-
-      :arg force: the engine force
-      :type force: float
-
-      :arg wheelIndex: index of the wheel where the force needs to be applied
-      :type wheelIndex: integer
-
-   .. method:: getConstraintId()
-
-      Get the constraint ID
-
-      :return: the constraint id
-      :rtype: integer
-
-   .. method:: getConstraintType()
-
-      Returns the constraint type.
-
-      :return: constraint type
-      :rtype: integer
-
-   .. method:: getNumWheels()
-
-      Returns the number of wheels.
-
-      :return: the number of wheels for this vehicle
-      :rtype: integer
-
-   .. method:: getWheelOrientationQuaternion(wheelIndex)
-
-      Returns the wheel orientation as a quaternion.
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-      :return: TODO Description
-      :rtype: TODO - type should be quat as per method name but from the code it looks like a matrix
-
-   .. method:: getWheelPosition(wheelIndex)
-
-      Returns the position of the specified wheel
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-      :return: position vector
-      :rtype: list[x, y, z]
-
-   .. method:: getWheelRotation(wheelIndex)
-
-      Returns the rotation of the specified wheel
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-      :return: the wheel rotation
-      :rtype: float
-
-   .. method:: setRollInfluence(rollInfluece, wheelIndex)
-
-      Set the specified wheel's roll influence.
-      The higher the roll influence the more the vehicle will tend to roll over in corners.
-
-      :arg rollInfluece: the wheel roll influence
-      :type rollInfluece: float
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-   .. method:: setSteeringValue(steering, wheelIndex)
-
-      Set the specified wheel's steering
-
-      :arg steering: the wheel steering
-      :type steering: float
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-   .. method:: setSuspensionCompression(compression, wheelIndex)
-
-      Set the specified wheel's compression
-
-      :arg compression: the wheel compression
-      :type compression: float
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-   .. method:: setSuspensionDamping(damping, wheelIndex)
-
-      Set the specified wheel's damping
-
-      :arg damping: the wheel damping
-      :type damping: float
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-   .. method:: setSuspensionStiffness(stiffness, wheelIndex)
-
-      Set the specified wheel's stiffness
-
-      :arg stiffness: the wheel stiffness
-      :type stiffness: float
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-   .. method:: setTyreFriction(friction, wheelIndex)
-
-      Set the specified wheel's tyre friction
-
-      :arg friction: the tyre friction
-      :type friction: float
-
-      :arg wheelIndex: the wheel index
-      :type wheelIndex: integer
-
-.. class:: KX_CharacterWrapper(PyObjectPlus)
-
-   A wrapper to expose character physics options.
-
-   .. attribute:: onGround
-
-      Whether or not the character is on the ground. (read-only)
-
-      :type: boolean
-
-   .. attribute:: gravity
-
-      The gravity value used for the character.
-
-      :type: float
-
-   .. attribute:: maxJumps
-
-      The maximum number of jumps a character can perform before having to touch the ground. By default this is set to 1. 2 allows for a double jump, etc.
-
-      :type: int
-
-   .. attribute:: jumpCount
-
-      The current jump count. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump.
-
-      :type: int
-
-   .. method:: jump()
-
-      The character jumps based on it's jump speed.
-
-.. class:: KX_VertexProxy(SCA_IObject)
-
-   A vertex holds position, UV, color and normal information.
-
-   Note:
-   The physics simulation is NOT currently updated - physics will not respond
-   to changes in the vertex position.
-
-   .. attribute:: XYZ
-
-      The position of the vertex.
-
-      :type: list [x, y, z]
-
-   .. attribute:: UV
-
-      The texture coordinates of the vertex.
-
-      :type: list [u, v]
-
-   .. attribute:: normal
-
-      The normal of the vertex.
-
-      :type: list [nx, ny, nz]
-
-   .. attribute:: color
-
-      The color of the vertex.
-
-      :type: list [r, g, b, a]
-
-      Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
-
-   .. attribute:: x
-
-      The x coordinate of the vertex.
-
-      :type: float
-
-   .. attribute:: y
-
-      The y coordinate of the vertex.
-
-      :type: float
-
-   .. attribute:: z
-
-      The z coordinate of the vertex.
-
-      :type: float
-
-   .. attribute:: u
-
-      The u texture coordinate of the vertex.
-
-      :type: float
-
-   .. attribute:: v
-
-      The v texture coordinate of the vertex.
-
-      :type: float
-
-   .. attribute:: u2
-
-      The second u texture coordinate of the vertex.
-
-      :type: float
-
-   .. attribute:: v2
-
-      The second v texture coordinate of the vertex.
-
-      :type: float
-
-   .. attribute:: r
-
-      The red component of the vertex color. 0.0 <= r <= 1.0.
-
-      :type: float
-
-   .. attribute:: g
-
-      The green component of the vertex color. 0.0 <= g <= 1.0.
-
-      :type: float
-
-   .. attribute:: b
-
-      The blue component of the vertex color. 0.0 <= b <= 1.0.
-
-      :type: float
-
-   .. attribute:: a
-
-      The alpha component of the vertex color. 0.0 <= a <= 1.0.
-
-      :type: float
-
-   .. method:: getXYZ()
-
-      Gets the position of this vertex.
-
-      :return: this vertexes position in local coordinates.
-      :rtype: list [x, y, z]
-
-   .. method:: setXYZ(pos)
-
-      Sets the position of this vertex.
-
-      :type:  list [x, y, z]
-
-      :arg pos: the new position for this vertex in local coordinates.
-
-   .. method:: getUV()
-
-      Gets the UV (texture) coordinates of this vertex.
-
-      :return: this vertexes UV (texture) coordinates.
-      :rtype: list [u, v]
-
-   .. method:: setUV(uv)
-
-      Sets the UV (texture) coordinates of this vertex.
-
-      :type:  list [u, v]
-
-   .. method:: getUV2()
-
-      Gets the 2nd UV (texture) coordinates of this vertex.
-
-      :return: this vertexes UV (texture) coordinates.
-      :rtype: list [u, v]
-
-   .. method:: setUV2(uv, unit)
-
-      Sets the 2nd UV (texture) coordinates of this vertex.
-
-      :type:  list [u, v]
-
-      :arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
-      :arg unit:  integer
-
-   .. method:: getRGBA()
-
-      Gets the color of this vertex.
-
-      The color is represented as four bytes packed into an integer value.  The color is
-      packed as RGBA.
-
-      Since Python offers no way to get each byte without shifting, you must use the struct module to
-      access color in an machine independent way.
-
-      Because of this, it is suggested you use the r, g, b and a attributes or the color attribute instead.
-
-      .. code-block:: python
-
-         import struct;
-         col = struct.unpack('4B', struct.pack('I', v.getRGBA()))
-         # col = (r, g, b, a)
-         # black = (  0, 0, 0, 255)
-         # white = (255, 255, 255, 255)
-
-      :return: packed color. 4 byte integer with one byte per color channel in RGBA format.
-      :rtype: integer
-
-   .. method:: setRGBA(col)
-
-      Sets the color of this vertex.
-
-      See getRGBA() for the format of col, and its relevant problems.  Use the r, g, b and a attributes
-      or the color attribute instead.
-
-      setRGBA() also accepts a four component list as argument col.  The list represents the color as [r, g, b, a]
-      with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0]
-
-      .. code-block:: python
-
-         v.setRGBA(0xff0000ff) # Red
-         v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian
-         v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red
-         v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms.
-
-      :arg col: the new color of this vertex in packed RGBA format.
-      :type col: integer or list [r, g, b, a]
-
-   .. method:: getNormal()
-
-      Gets the normal vector of this vertex.
-
-      :return: normalized normal vector.
-      :rtype: list [nx, ny, nz]
-
-   .. method:: setNormal(normal)
-
-      Sets the normal vector of this vertex.
-
-      :type:  sequence of floats [r, g, b]
-
-      :arg normal: the new normal of this vertex.
-
-.. class:: KX_VisibilityActuator(SCA_IActuator)
-
-   Visibility Actuator.
-
-   .. attribute:: visibility
-
-      whether the actuator makes its parent object visible or invisible.
-
-      :type: boolean
-
-   .. attribute:: useOcclusion
-
-      whether the actuator makes its parent object an occluder or not.
-
-      :type: boolean
-
-   .. attribute:: useRecursion
-
-      whether the visibility/occlusion should be propagated to all children of the object.
-
-      :type: boolean
-
-.. class:: SCA_2DFilterActuator(SCA_IActuator)
-
-   Create, enable and disable 2D filters
-
-   The following properties don't have an immediate effect.
-   You must active the actuator to get the result.
-   The actuator is not persistent: it automatically stops itself after setting up the filter
-   but the filter remains active. To stop a filter you must activate the actuator with 'type'
-   set to :data:`~bge.logic.RAS_2DFILTER_DISABLED` or :data:`~bge.logic.RAS_2DFILTER_NOFILTER`.
-
-   .. attribute:: shaderText
-
-      shader source code for custom shader.
-
-      :type: string
-
-   .. attribute:: disableMotionBlur
-
-      action on motion blur: 0=enable, 1=disable.
-
-      :type: integer
-
-   .. attribute:: mode
-
-      Type of 2D filter, use one of :ref:`these constants <Two-D-FilterActuator-mode>`
-
-      :type: integer
-
-   .. attribute:: passNumber
-
-      order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb.
-
-      Only be one filter can be defined per passNb.
-
-      :type: integer (0-100)
-
-   .. attribute:: value
-
-      argument for motion blur filter.
-
-      :type: float (0.0-100.0)
-
-.. class:: SCA_ANDController(SCA_IController)
-
-   An AND controller activates only when all linked sensors are activated.
-
-   There are no special python methods for this controller.
-
-.. class:: SCA_ActuatorSensor(SCA_ISensor)
-
-   Actuator sensor detect change in actuator state of the parent object.
-   It generates a positive pulse if the corresponding actuator is activated
-   and a negative pulse if the actuator is deactivated.
-
-   .. attribute:: actuator
-
-      the name of the actuator that the sensor is monitoring.
-
-      :type: string
-
-.. class:: SCA_AlwaysSensor(SCA_ISensor)
-
-   This sensor is always activated.
-
-.. class:: SCA_DelaySensor(SCA_ISensor)
-
-   The Delay sensor generates positive and negative triggers at precise time, 
-   expressed in number of frames. The delay parameter defines the length of the initial OFF period. A positive trigger is generated at the end of this period.
-
-   The duration parameter defines the length of the ON period following the OFF period.
-   There is a negative trigger at the end of the ON period. If duration is 0, the sensor stays ON and there is no negative trigger.
-
-   The sensor runs the OFF-ON cycle once unless the repeat option is set: the OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0).
-
-   Use :class:`SCA_ISensor.reset` at any time to restart sensor.
-
-   .. attribute:: delay
-
-      length of the initial OFF period as number of frame, 0 for immediate trigger.
-
-      :type: integer.
-
-   .. attribute:: duration
-
-      length of the ON period in number of frame after the initial OFF period.
-
-      If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
-
-      :type: integer
-
-   .. attribute:: repeat
-
-      1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
-
-      :type: integer
-
-.. class:: SCA_JoystickSensor(SCA_ISensor)
-
-   This sensor detects player joystick events.
-
-   .. attribute:: axisValues
-
-      The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only).
-
-      :type: list of ints.
-
-      Each specifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
-      The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
-
-      * left:[-32767, 0, ...]
-      * right:[32767, 0, ...]
-      * up:[0, -32767, ...]
-      * down:[0, 32767, ...]
-
-   .. attribute:: axisSingle
-
-      like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only).
-
-      :type: integer
-
-      .. note::
-         
-         Only use this for "Single Axis" type sensors otherwise it will raise an error.
-
-   .. attribute:: hatValues
-
-      The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).
-
-      :type: list of ints
-
-      Each specifying the direction of the hat from 1 to 12, 0 when inactive.
-
-      Hat directions are as follows...
-
-      * 0:None
-      * 1:Up
-      * 2:Right
-      * 4:Down
-      * 8:Left
-      * 3:Up - Right
-      * 6:Down - Right
-      * 12:Down - Left
-      * 9:Up - Left
-
-   .. attribute:: hatSingle
-
-      Like :data:`hatValues` but returns a single hat direction value that is set by the sensor. (read-only).
-
-      :type: integer
-
-   .. attribute:: numAxis
-
-      The number of axes for the joystick at this index. (read-only).
-
-      :type: integer
-
-   .. attribute:: numButtons
-
-      The number of buttons for the joystick at this index. (read-only).
-
-      :type: integer
-
-   .. attribute:: numHats
-
-      The number of hats for the joystick at this index. (read-only).
-
-      :type: integer
-
-   .. attribute:: connected
-
-      True if a joystick is connected at this joysticks index. (read-only).
-
-      :type: boolean
-
-   .. attribute:: index
-
-      The joystick index to use (from 0 to 7). The first joystick is always 0.
-
-      :type: integer
-
-   .. attribute:: threshold
-
-      Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive.
-
-      :type: integer
-
-   .. attribute:: button
-
-      The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect.
-
-      :type: integer
-
-   .. attribute:: axis
-
-      The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection]
-
-      * axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control.
-      * axisDirection: 0=right, 1=up, 2=left, 3=down.
-
-      :type: [integer, integer]
-
-   .. attribute:: hat
-
-      The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection]
-
-      * hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max).
-      * hatDirection: 1-12.
-
-      :type: [integer, integer]
-
-   .. method:: getButtonActiveList()
-
-      :return: A list containing the indicies of the currently pressed buttons.
-      :rtype: list
-
-   .. method:: getButtonStatus(buttonIndex)
-
-      :arg buttonIndex: the button index, 0=first button
-      :type buttonIndex: integer
-      :return: The current pressed state of the specified button.
-      :rtype: boolean
-
-.. class:: SCA_KeyboardSensor(SCA_ISensor)
-
-   A keyboard sensor detects player key presses.
-
-   See module :mod:`bge.keys` for keycode values.
-
-   .. attribute:: key
-
-      The key code this sensor is looking for.
-
-      :type: keycode from :mod:`bge.keys` module
-
-   .. attribute:: hold1
-
-      The key code for the first modifier this sensor is looking for.
-
-      :type: keycode from :mod:`bge.keys` module
-
-   .. attribute:: hold2
-
-      The key code for the second modifier this sensor is looking for.
-
-      :type: keycode from :mod:`bge.keys` module
-
-   .. attribute:: toggleProperty
-
-      The name of the property that indicates whether or not to log keystrokes as a string.
-
-      :type: string
-
-   .. attribute:: targetProperty
-
-      The name of the property that receives keystrokes in case in case a string is logged.
-
-      :type: string
-
-   .. attribute:: useAllKeys
-
-      Flag to determine whether or not to accept all keys.
-
-      :type: boolean
-
-   .. attribute:: events
-
-      a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
-
-      :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...]
-
-   .. method:: getKeyStatus(keycode)
-
-      Get the status of a key.
-
-      :arg keycode: The code that represents the key you want to get the state of, use one of :ref:`these constants<keyboard-keys>`
-      :type keycode: integer
-      :return: The state of the given key, can be one of :ref:`these constants<input-status>`
-      :rtype: int
-
-.. class:: SCA_NANDController(SCA_IController)
-
-   An NAND controller activates when all linked sensors are not active.
-
-   There are no special python methods for this controller.
-
-.. class:: SCA_NORController(SCA_IController)
-
-   An NOR controller activates only when all linked sensors are de-activated.
-
-   There are no special python methods for this controller.
-
-.. class:: SCA_ORController(SCA_IController)
-
-   An OR controller activates when any connected sensor activates.
-
-   There are no special python methods for this controller.
-
-.. class:: SCA_PropertyActuator(SCA_IActuator)
-
-   Property Actuator
-
-   .. attribute:: propName
-
-      the property on which to operate.
-
-      :type: string
-
-   .. attribute:: value
-
-      the value with which the actuator operates.
-
-      :type: string
-
-   .. attribute:: mode
-
-      TODO - add constants to game logic dict!.
-
-      :type: integer
-
-.. class:: SCA_PropertySensor(SCA_ISensor)
-
-   Activates when the game object property matches.
-
-   .. attribute:: mode
-
-      Type of check on the property. Can be one of :ref:`these constants <logic-property-sensor>`
-
-      :type: integer.
-
-   .. attribute:: propName
-
-      the property the sensor operates.
-
-      :type: string
-
-   .. attribute:: value
-
-      the value with which the sensor compares to the value of the property.
-
-      :type: string
-
-   .. attribute:: min
-
-      the minimum value of the range used to evaluate the property when in interval mode.
-
-      :type: string
-
-   .. attribute:: max
-
-      the maximum value of the range used to evaluate the property when in interval mode.
-
-      :type: string
-
-.. class:: SCA_PythonController(SCA_IController)
-
-   A Python controller uses a Python script to activate it's actuators, 
-   based on it's sensors.
-
-   .. attribute:: script
-
-      The value of this variable depends on the execution methid.
-
-      * When 'Script' execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts.
-      * When 'Module' execution mode is set this value will contain a single line string - module name and function "module.func" or "package.modile.func" where the module names are python textblocks or external scripts.
-
-      :type: string
-      
-      .. note::
-      
-         Once this is set the script name given for warnings will remain unchanged.
-
-   .. attribute:: mode
-
-      the execution mode for this controller (read-only).
-
-      * Script: 0, Execite the :data:`script` as a python code.
-      * Module: 1, Execite the :data:`script` as a module and function.
-
-      :type: integer
-
-   .. method:: activate(actuator)
-
-      Activates an actuator attached to this controller.
-
-      :arg actuator: The actuator to operate on.
-      :type actuator: actuator or the actuator name as a string
-
-   .. method:: deactivate(actuator)
-
-      Deactivates an actuator attached to this controller.
-
-      :arg actuator: The actuator to operate on.
-      :type actuator: actuator or the actuator name as a string
-
-.. class:: SCA_RandomActuator(SCA_IActuator)
-
-   Random Actuator
-
-   .. attribute:: seed
-
-      Seed of the random number generator.
-
-      :type: integer.
-
-      Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call.
-
-   .. attribute:: para1
-
-      the first parameter of the active distribution.
-
-      :type: float, read-only.
-
-      Refer to the documentation of the generator types for the meaning of this value. 
-
-   .. attribute:: para2
-
-      the second parameter of the active distribution.
-
-      :type: float, read-only
-
-      Refer to the documentation of the generator types for the meaning of this value.
-
-   .. attribute:: distribution
-
-      Distribution type. (read-only). Can be one of :ref:`these constants <logic-random-distributions>`
-
-      :type: integer
-
-   .. attribute:: propName
-
-      the name of the property to set with the random value.
-
-      :type: string
-
-      If the generator and property types do not match, the assignment is ignored.
-
-   .. method:: setBoolConst(value)
-
-      Sets this generator to produce a constant boolean value.
-
-      :arg value: The value to return.
-      :type value: boolean
-
-   .. method:: setBoolUniform()
-
-      Sets this generator to produce a uniform boolean distribution.
-
-      The generator will generate True or False with 50% chance.
-
-   .. method:: setBoolBernouilli(value)
-
-      Sets this generator to produce a Bernouilli distribution.
-
-      :arg value: Specifies the proportion of False values to produce.
-
-         * 0.0: Always generate True
-         * 1.0: Always generate False
-      :type value: float
-
-   .. method:: setIntConst(value)
-
-      Sets this generator to always produce the given value.
-
-      :arg value: the value this generator produces.
-      :type value: integer
-
-   .. method:: setIntUniform(lower_bound, upper_bound)
-
-      Sets this generator to produce a random value between the given lower and
-      upper bounds (inclusive).
-
-      :type lower_bound: integer
-      :type upper_bound: integer
-
-   .. method:: setIntPoisson(value)
-
-      Generate a Poisson-distributed number.
-
-      This performs a series of Bernouilli tests with parameter value.
-      It returns the number of tries needed to achieve succes.
-
-      :type value: float
-
-   .. method:: setFloatConst(value)
-
-      Always generate the given value.
-
-      :type value: float
-
-   .. method:: setFloatUniform(lower_bound, upper_bound)
-
-      Generates a random float between lower_bound and upper_bound with a
-      uniform distribution.
-
-      :type lower_bound: float
-      :type upper_bound: float
-
-   .. method:: setFloatNormal(mean, standard_deviation)
-
-      Generates a random float from the given normal distribution.
-
-      :arg mean: The mean (average) value of the generated numbers
-      :type mean: float
-      :arg standard_deviation: The standard deviation of the generated numbers.
-      :type standard_deviation: float
-
-   .. method:: setFloatNegativeExponential(half_life)
-
-      Generate negative-exponentially distributed numbers.
-
-      The half-life 'time' is characterized by half_life.
-      
-      :type half_life: float
-
-.. class:: SCA_RandomSensor(SCA_ISensor)
-
-   This sensor activates randomly.
-
-   .. attribute:: lastDraw
-
-      The seed of the random number generator.
-
-      :type: integer
-
-   .. attribute:: seed
-
-      The seed of the random number generator.
-
-      :type: integer
-
-.. class:: SCA_XNORController(SCA_IController)
-
-   An XNOR controller activates when all linked sensors are the same (activated or inative).
-
-   There are no special python methods for this controller.
-
-.. class:: SCA_XORController(SCA_IController)
-
-   An XOR controller activates when there is the input is mixed, but not when all are on or off.
-
-   There are no special python methods for this controller.
-
-.. class:: KX_Camera(KX_GameObject)
-
-   A Camera object.
-
-   .. data:: INSIDE
-
-      See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
-
-   .. data:: INTERSECT
-
-      See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
-
-   .. data:: OUTSIDE
-
-      See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
-
-   .. attribute:: lens
-
-      The camera's lens value.
-
-      :type: float
-
-   .. attribute:: ortho_scale
-
-      The camera's view scale when in orthographic mode.
-
-      :type: float
-
-   .. attribute:: near
-
-      The camera's near clip distance.
-
-      :type: float
-
-   .. attribute:: far
-
-      The camera's far clip distance.
-
-      :type: float
-
-   .. attribute:: perspective
-
-      True if this camera has a perspective transform, False for an orthographic projection.
-
-      :type: boolean
-
-   .. attribute:: frustum_culling
-
-      True if this camera is frustum culling.
-
-      :type: boolean
-
-   .. attribute:: projection_matrix
-
-      This camera's 4x4 projection matrix.
-
-      .. note::
-      
-         This is the identity matrix prior to rendering the first frame (any Python done on frame 1). 
-
-      :type: 4x4 Matrix [[float]]
-
-   .. attribute:: modelview_matrix
-
-      This camera's 4x4 model view matrix. (read-only).
-
-      :type: 4x4 Matrix [[float]]
-
-      .. note::
-      
-         This matrix is regenerated every frame from the camera's position and orientation. Also, this is the identity matrix prior to rendering the first frame (any Python done on frame 1).
-
-   .. attribute:: camera_to_world
-
-      This camera's camera to world transform. (read-only).
-
-      :type: 4x4 Matrix [[float]]
-
-      .. note::
-      
-         This matrix is regenerated every frame from the camera's position and orientation.
-
-   .. attribute:: world_to_camera
-
-      This camera's world to camera transform. (read-only).
-
-      :type: 4x4 Matrix [[float]]
-
-      .. note::
-         
-         Regenerated every frame from the camera's position and orientation.
-
-      .. note::
-      
-         This is camera_to_world inverted.
-
-   .. attribute:: useViewport
-
-      True when the camera is used as a viewport, set True to enable a viewport for this camera.
-
-      :type: boolean
-
-   .. method:: sphereInsideFrustum(centre, radius)
-
-      Tests the given sphere against the view frustum.
-
-      :arg centre: The centre of the sphere (in world coordinates.)
-      :type centre: list [x, y, z]
-      :arg radius: the radius of the sphere
-      :type radius: float
-      :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
-      :rtype: integer
-
-      .. note::
-
-         When the camera is first initialized the result will be invalid because the projection matrix has not been set.
-
-      .. code-block:: python
-
-         from bge import logic
-         cont = logic.getCurrentController()
-         cam = cont.owner
-         
-         # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]
-         if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):
-             # Sphere is inside frustum !
-             # Do something useful !
-         else:
-             # Sphere is outside frustum
-
-   .. method:: boxInsideFrustum(box)
-
-      Tests the given box against the view frustum.
-
-      :arg box: Eight (8) corner points of the box (in world coordinates.)
-      :type box: list of lists
-      :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
-
-      .. note::
-      
-         When the camera is first initialized the result will be invalid because the projection matrix has not been set.
-
-      .. code-block:: python
-
-         from bge import logic
-         cont = logic.getCurrentController()
-         cam = cont.owner
-
-         # Box to test...
-         box = []
-         box.append([-1.0, -1.0, -1.0])
-         box.append([-1.0, -1.0,  1.0])
-         box.append([-1.0,  1.0, -1.0])
-         box.append([-1.0,  1.0,  1.0])
-         box.append([ 1.0, -1.0, -1.0])
-         box.append([ 1.0, -1.0,  1.0])
-         box.append([ 1.0,  1.0, -1.0])
-         box.append([ 1.0,  1.0,  1.0])
-         
-         if (cam.boxInsideFrustum(box) != cam.OUTSIDE):
-           # Box is inside/intersects frustum !
-           # Do something useful !
-         else:
-           # Box is outside the frustum !
-           
-   .. method:: pointInsideFrustum(point)
-
-      Tests the given point against the view frustum.
-
-      :arg point: The point to test (in world coordinates.)
-      :type point: 3D Vector
-      :return: True if the given point is inside this camera's viewing frustum.
-      :rtype: boolean
-
-      .. note::
-      
-         When the camera is first initialized the result will be invalid because the projection matrix has not been set.
-
-      .. code-block:: python
-
-         from bge import logic
-         cont = logic.getCurrentController()
-         cam = cont.owner
-
-         # Test point [0.0, 0.0, 0.0]
-         if (cam.pointInsideFrustum([0.0, 0.0, 0.0])):
-           # Point is inside frustum !
-           # Do something useful !
-         else:
-           # Box is outside the frustum !
-
-   .. method:: getCameraToWorld()
-
-      Returns the camera-to-world transform.
-
-      :return: the camera-to-world transform matrix.
-      :rtype: matrix (4x4 list)
-
-   .. method:: getWorldToCamera()
-
-      Returns the world-to-camera transform.
-
-      This returns the inverse matrix of getCameraToWorld().
-
-      :return: the world-to-camera transform matrix.
-      :rtype: matrix (4x4 list)
-
-   .. method:: setOnTop()
-
-      Set this cameras viewport ontop of all other viewport.
-
-   .. method:: setViewport(left, bottom, right, top)
-
-      Sets the region of this viewport on the screen in pixels.
-
-      Use :data:`bge.render.getWindowHeight` and :data:`bge.render.getWindowWidth` to calculate values relative to the entire display.
-
-      :arg left: left pixel coordinate of this viewport
-      :type left: integer
-      :arg bottom: bottom pixel coordinate of this viewport
-      :type bottom: integer
-      :arg right: right pixel coordinate of this viewport
-      :type right: integer
-      :arg top: top pixel coordinate of this viewport
-      :type top: integer
-
-   .. method:: getScreenPosition(object)
-
-      Gets the position of an object projected on screen space.
-
-      .. code-block:: python
-
-         # For an object in the middle of the screen, coord = [0.5, 0.5]
-         coord = camera.getScreenPosition(object)
-
-      :arg object: object name or list [x, y, z]
-      :type object: :class:`KX_GameObject` or 3D Vector
-      :return: the object's position in screen coordinates.
-      :rtype: list [x, y]
-
-   .. method:: getScreenVect(x, y)
-
-      Gets the vector from the camera position in the screen coordinate direction.
-
-      :arg x: X Axis
-      :type x: float
-      :arg y: Y Axis
-      :type y: float
-      :rtype: 3D Vector
-      :return: The vector from screen coordinate.
-
-      .. code-block:: python
-
-         # Gets the vector of the camera front direction:
-         m_vect = camera.getScreenVect(0.5, 0.5)
-
-   .. method:: getScreenRay(x, y, dist=inf, property=None)
-
-      Look towards a screen coordinate (x, y) and find first object hit within dist that matches prop.
-      The ray is similar to KX_GameObject->rayCastTo.
-
-      :arg x: X Axis
-      :type x: float
-      :arg y: Y Axis
-      :type y: float
-      :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
-      :type dist: float
-      :arg property: property name that object must have; can be omitted => detect any object
-      :type property: string
-      :rtype: :class:`KX_GameObject`
-      :return: the first object hit or None if no object or object does not match prop
-
-      .. code-block:: python
-
-         # Gets an object with a property "wall" in front of the camera within a distance of 100:
-         target = camera.getScreenRay(0.5, 0.5, 100, "wall")
-         
-.. class:: BL_ArmatureObject(KX_GameObject)
-
-   An armature object.
-
-   .. attribute:: constraints
-
-      The list of armature constraint defined on this armature.
-      Elements of the list can be accessed by index or string.
-      The key format for string access is '<bone_name>:<constraint_name>'.
-
-      :type: list of :class:`BL_ArmatureConstraint`
-
-   .. attribute:: channels
-
-      The list of armature channels.
-      Elements of the list can be accessed by index or name the bone.
-
-      :type: list of :class:`BL_ArmatureChannel`
-
-   .. method:: update()
-
-      Ensures that the armature will be updated on next graphic frame.
-
-      This action is unecessary if a KX_ArmatureActuator with mode run is active
-      or if an action is playing. Use this function in other cases. It must be called
-      on each frame to ensure that the armature is updated continously.
-
-.. class:: BL_ArmatureActuator(SCA_IActuator)
-
-   Armature Actuators change constraint condition on armatures.
-
-   .. attribute:: type
-
-      The type of action that the actuator executes when it is active.
-
-      Can be one of :ref:`these constants <armatureactuator-constants-type>`
-
-      :type: integer
-
-   .. attribute:: constraint
-
-      The constraint object this actuator is controlling.
-
-      :type: :class:`BL_ArmatureConstraint`
-
-   .. attribute:: target
-
-      The object that this actuator will set as primary target to the constraint it controls.
-
-      :type: :class:`KX_GameObject`
-
-   .. attribute:: subtarget
-
-      The object that this actuator will set as secondary target to the constraint it controls.
-
-      :type: :class:`KX_GameObject`.
-      
-      .. note::
-      
-         Currently, the only secondary target is the pole target for IK constraint.
-
-   .. attribute:: weight
-
-      The weight this actuator will set on the constraint it controls.
-
-      :type: float.
-
-      .. note::
-      
-         Currently only the IK constraint has a weight. It must be a value between 0 and 1.
-
-      .. note::
-      
-         A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
-
-   .. attribute:: influence
-
-      The influence this actuator will set on the constraint it controls.
-
-      :type: float.
-
-.. class:: KX_ArmatureSensor(SCA_ISensor)
-
-   Armature sensor detect conditions on armatures.
-
-   .. attribute:: type
-
-      The type of measurement that the sensor make when it is active.
-      
-      Can be one of :ref:`these constants <armaturesensor-type>`
-
-      :type: integer.
-
-   .. attribute:: constraint
-
-      The constraint object this sensor is watching.
-
-      :type: :class:`BL_ArmatureConstraint`
-
-   .. attribute:: value
-   
-      The threshold used in the comparison with the constraint error
-      The linear error is only updated on CopyPose/Distance IK constraint with iTaSC solver
-      The rotation error is only updated on CopyPose+rotation IK constraint with iTaSC solver
-      The linear error on CopyPose is always >= 0: it is the norm of the distance between the target and the bone
-      The rotation error on CopyPose is always >= 0: it is the norm of the equivalent rotation vector between the bone and the target orientations
-      The linear error on Distance can be positive if the distance between the bone and the target is greater than the desired distance, and negative if the distance is smaller.
-
-      :type: float
-      
-.. class:: BL_ArmatureConstraint(PyObjectPlus)
-
-   Proxy to Armature Constraint. Allows to change constraint on the fly.
-   Obtained through :class:`BL_ArmatureObject`.constraints.
-
-   .. note::
-   
-      Not all armature constraints are supported in the GE.
-
-      
-   .. attribute:: type
-
-      Type of constraint, (read-only).
-
-      Use one of :ref:`these constants<armatureconstraint-constants-type>`.
-      
-      :type: integer, one of CONSTRAINT_TYPE_* constants
-
-   .. attribute:: name
-
-      Name of constraint constructed as <bone_name>:<constraint_name>. constraints list.
-
-      :type: string
-
-      This name is also the key subscript on :class:`BL_ArmatureObject`.
-
-   .. attribute:: enforce
-
-      fraction of constraint effect that is enforced. Between 0 and 1.
-
-      :type: float
-
-   .. attribute:: headtail
-
-      Position of target between head and tail of the target bone: 0=head, 1=tail.
-
-      :type: float.
-
-      .. note::
-      
-         Only used if the target is a bone (i.e target object is an armature.
-
-   .. attribute:: lin_error
-
-      runtime linear error (in Blender units) on constraint at the current frame.
-
-      This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
-
-      :type: float
-
-   .. attribute:: rot_error
-
-      Runtime rotation error (in radiant) on constraint at the current frame.
-
-      :type: float.
-
-      This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
-
-      It is only set if the constraint has a rotation part, for example, a CopyPose+Rotation IK constraint.
-
-   .. attribute:: target
-
-      Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint.
-
-      :type: :class:`KX_GameObject`.
-
-   .. attribute:: subtarget
-
-      Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint.
-
-      :type: :class:`KX_GameObject`.
-
-      Currently this is only used for pole target on IK constraint.
-
-   .. attribute:: active
-
-      True if the constraint is active.
-
-      :type: boolean
-      
-      .. note::
-      
-         An inactive constraint does not update lin_error and rot_error.
-
-   .. attribute:: ik_weight
-
-      Weight of the IK constraint between 0 and 1.
-
-      Only defined for IK constraint.
-
-      :type: float
-
-   .. attribute:: ik_type
-
-      Type of IK constraint, (read-only).
-
-      Use one of :ref:`these constants<armatureconstraint-constants-ik-type>`.
-      
-      :type: integer.
-
-   .. attribute:: ik_flag
-
-      Combination of IK constraint option flags, read-only.
-      
-      Use one of :ref:`these constants<armatureconstraint-constants-ik-flag>`.
-
-      :type: integer
-
-   .. attribute:: ik_dist
-
-      Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE.
-
-      :type: float
-
-   .. attribute:: ik_mode
-
-      Use one of :ref:`these constants<armatureconstraint-constants-ik-mode>`.
-      
-      Additional mode for IK constraint. Currently only used for Distance constraint:
-
-      :type: integer
-
-.. class:: BL_ArmatureChannel(PyObjectPlus)
-
-   Proxy to armature pose channel. Allows to read and set armature pose.
-   The attributes are identical to RNA attributes, but mostly in read-only mode.
-
-   .. attribute:: name
-
-      channel name (=bone name), read-only.
-
-      :type: string
-
-   .. attribute:: bone
-
-      return the bone object corresponding to this pose channel, read-only.
-
-      :type: :class:`BL_ArmatureBone`
-
-   .. attribute:: parent
-
-      return the parent channel object, None if root channel, read-only.
-
-      :type: :class:`BL_ArmatureChannel`
-
-   .. attribute:: has_ik
-
-      true if the bone is part of an active IK chain, read-only.
-      This flag is not set when an IK constraint is defined but not enabled (miss target information for example).
-
-      :type: boolean
-
-   .. attribute:: ik_dof_x
-
-      true if the bone is free to rotation in the X axis, read-only.
-
-      :type: boolean
-
-   .. attribute:: ik_dof_y
-
-      true if the bone is free to rotation in the Y axis, read-only.
-
-      :type: boolean
-
-   .. attribute:: ik_dof_z
-
-      true if the bone is free to rotation in the Z axis, read-only.
-
-      :type: boolean
-
-   .. attribute:: ik_limit_x
-
-      true if a limit is imposed on X rotation, read-only.
-
-      :type: boolean
-
-   .. attribute:: ik_limit_y
-
-      true if a limit is imposed on Y rotation, read-only.
-
-      :type: boolean
-
-   .. attribute:: ik_limit_z
-
-      true if a limit is imposed on Z rotation, read-only.
-
-      :type: boolean
-
-   .. attribute:: ik_rot_control
-
-      true if channel rotation should applied as IK constraint, read-only.
-
-      :type: boolean
-
-   .. attribute:: ik_lin_control
-
-      true if channel size should applied as IK constraint, read-only.
-
-      :type: boolean
-
-   .. attribute:: location
-
-      displacement of the bone head in armature local space, read-write.
-
-      :type: vector [X, Y, Z].
-
-      .. note::
-      
-         You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
-
-      .. note::
-      
-         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
-
-   .. attribute:: scale
-
-      scale of the bone relative to its parent, read-write.
-
-      :type: vector [sizeX, sizeY, sizeZ].
-
-      .. note::
-      
-         An action playing on the armature may change the value.  An IK chain does not update this value, see joint_rotation.
-
-      .. note::
-      
-         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
-
-   .. attribute:: rotation_quaternion
-
-      rotation of the bone relative to its parent expressed as a quaternion, read-write.
-
-      :type: vector [qr, qi, qj, qk].
-
-      .. note::
-      
-         This field is only used if rotation_mode is 0. An action playing on the armature may change the value.  An IK chain does not update this value, see joint_rotation.
-
-      .. note::
-      
-         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
-
-   .. attribute:: rotation_euler
-
-      rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
-
-      :type: vector [X, Y, Z].
-
-      .. note::
-      
-         This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field.  An IK chain does not update this value, see joint_rotation.
-
-      .. note::
-      
-         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
-
-   .. attribute:: rotation_mode
-
-      Method of updating the bone rotation, read-write.
-
-      :type: integer (one of :ref:`these constants <armaturechannel-constants-rotation-mode>`)
-
-   .. attribute:: channel_matrix
-
-      pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
-      This field is updated after the graphic render, it represents the current pose.
-
-      :type: matrix [4][4]
-
-   .. attribute:: pose_matrix
-
-      pose matrix in armature space, read-only, 
-      This field is updated after the graphic render, it represents the current pose.
-
-      :type: matrix [4][4]
-
-   .. attribute:: pose_head
-
-      position of bone head in armature space, read-only.
-
-      :type: vector [x, y, z]
-
-   .. attribute:: pose_tail
-
-      position of bone tail in armature space, read-only.
-
-      :type: vector [x, y, z]
-
-   .. attribute:: ik_min_x
-
-      minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
-
-      :type: float
-
-   .. attribute:: ik_max_x
-
-      maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
-
-      :type: float
-
-   .. attribute:: ik_min_y
-
-      minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
-
-      :type: float
-
-   .. attribute:: ik_max_y
-
-      maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
-
-      :type: float
-
-   .. attribute:: ik_min_z
-
-      minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
-
-      :type: float
-
-   .. attribute:: ik_max_z
-
-      maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
-
-      :type: float
-
-   .. attribute:: ik_stiffness_x
-
-      bone rotation stiffness in X axis, read-only.
-
-      :type: float between 0 and 1
-
-   .. attribute:: ik_stiffness_y
-
-      bone rotation stiffness in Y axis, read-only.
-
-      :type: float between 0 and 1
-
-   .. attribute:: ik_stiffness_z
-
-      bone rotation stiffness in Z axis, read-only.
-
-      :type: float between 0 and 1
-
-   .. attribute:: ik_stretch
-
-      ratio of scale change that is allowed, 0=bone can't change size, read-only.
-
-      :type: float
-
-   .. attribute:: ik_rot_weight
-
-      weight of rotation constraint when ik_rot_control is set, read-write.
-
-      :type: float between 0 and 1
-
-   .. attribute:: ik_lin_weight
-
-      weight of size constraint when ik_lin_control is set, read-write.
-
-      :type: float between 0 and 1
-
-   .. attribute:: joint_rotation
-
-      Control bone rotation in term of joint angle (for robotic applications), read-write.
-
-      When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
-
-      When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
-
-      The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes:
-
-      * 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant
-      * 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants.
-      * 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
-      * 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
-
-      :type: vector [x, y, z]
-      
-      .. note::
-      
-         The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
-
-      .. note::
-      
-         [0, 0, 0] always corresponds to the rest pose.
-
-      .. note::
-      
-         You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
-
-      .. note::
-      
-         You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
-
-.. class:: BL_ArmatureBone(PyObjectPlus)
-
-   Proxy to Blender bone structure. All fields are read-only and comply to RNA names.
-   All space attribute correspond to the rest pose.
-
-   .. attribute:: name
-
-      bone name.
-
-      :type: string
-
-   .. attribute:: connected
-
-      true when the bone head is struck to the parent's tail.
-
-      :type: boolean
-
-   .. attribute:: hinge
-
-      true when bone doesn't inherit rotation or scale from parent bone.
-
-      :type: boolean
-
-   .. attribute:: inherit_scale
-
-      true when bone inherits scaling from parent bone.
-
-      :type: boolean
-
-   .. attribute:: bbone_segments
-
-      number of B-bone segments.
-
-      :type: integer
-
-   .. attribute:: roll
-
-      bone rotation around head-tail axis.
-
-      :type: float
-
-   .. attribute:: head
-
-      location of head end of the bone in parent bone space.
-
-      :type: vector [x, y, z]
-
-   .. attribute:: tail
-
-      location of head end of the bone in parent bone space.
-
-      :type: vector [x, y, z]
-
-   .. attribute:: length
-
-      bone length.
-
-      :type: float
-
-   .. attribute:: arm_head
-
-      location of head end of the bone in armature space.
-
-      :type: vector [x, y, z]
-
-   .. attribute:: arm_tail
-
-      location of tail end of the bone in armature space.
-
-      :type: vector [x, y, z]
-
-   .. attribute:: arm_mat
-
-      matrix of the bone head in armature space.
-
-      :type: matrix [4][4]
-
-      .. note::
-      
-         This matrix has no scale part. 
-
-   .. attribute:: bone_mat
-
-      rotation matrix of the bone in parent bone space.
-
-      :type: matrix [3][3]
-
-   .. attribute:: parent
-
-      parent bone, or None for root bone.
-
-      :type: :class:`BL_ArmatureBone`
-
-   .. attribute:: children
-
-      list of bone's children.
-
-      :type: list of :class:`BL_ArmatureBone`
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst b/doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst
new file mode 100644
index 0000000..9b95a5b
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst
@@ -0,0 +1,78 @@
+BL_ActionActuator(SCA_IActuator)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: BL_ActionActuator(SCA_IActuator)
+
+   Action Actuators apply an action to an actor.
+
+   .. attribute:: action
+
+      The name of the action to set as the current action.
+
+      :type: string
+
+   .. attribute:: frameStart
+
+      Specifies the starting frame of the animation.
+
+      :type: float
+
+   .. attribute:: frameEnd
+
+      Specifies the ending frame of the animation.
+
+      :type: float
+
+   .. attribute:: blendIn
+
+      Specifies the number of frames of animation to generate when making transitions between actions.
+
+      :type: float
+
+   .. attribute:: priority
+
+      Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
+
+      :type: integer
+
+   .. attribute:: frame
+
+      Sets the current frame for the animation.
+
+      :type: float
+
+   .. attribute:: propName
+
+      Sets the property to be used in FromProp playback mode.
+
+      :type: string
+
+   .. attribute:: blendTime
+
+      Sets the internal frame timer. This property must be in the range from 0.0 to blendIn.
+
+      :type: float
+
+   .. attribute:: mode
+
+      The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
+
+      :type: integer
+
+   .. attribute:: useContinue
+
+      The actions continue option, True or False. When True, the action will always play from where last left off,
+      otherwise negative events to this actuator will reset it to its start frame.
+
+      :type: boolean
+
+   .. attribute:: framePropName
+
+      The name of the property that is set to the current frame number.
+
+      :type: string
+
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureActuator.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureActuator.rst
new file mode 100644
index 0000000..579186a
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureActuator.rst
@@ -0,0 +1,61 @@
+BL_ArmatureActuator(SCA_IActuator)
+==================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: BL_ArmatureActuator(SCA_IActuator)
+
+   Armature Actuators change constraint condition on armatures.
+
+   .. attribute:: type
+
+      The type of action that the actuator executes when it is active.
+
+      Can be one of :ref:`these constants <armatureactuator-constants-type>`
+
+      :type: integer
+
+   .. attribute:: constraint
+
+      The constraint object this actuator is controlling.
+
+      :type: :class:`BL_ArmatureConstraint`
+
+   .. attribute:: target
+
+      The object that this actuator will set as primary target to the constraint it controls.
+
+      :type: :class:`KX_GameObject`
+
+   .. attribute:: subtarget
+
+      The object that this actuator will set as secondary target to the constraint it controls.
+
+      :type: :class:`KX_GameObject`.
+      
+      .. note::
+      
+         Currently, the only secondary target is the pole target for IK constraint.
+
+   .. attribute:: weight
+
+      The weight this actuator will set on the constraint it controls.
+
+      :type: float.
+
+      .. note::
+      
+         Currently only the IK constraint has a weight. It must be a value between 0 and 1.
+
+      .. note::
+      
+         A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
+
+   .. attribute:: influence
+
+      The influence this actuator will set on the constraint it controls.
+
+      :type: float.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst
new file mode 100644
index 0000000..14a9ebe
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst
@@ -0,0 +1,105 @@
+BL_ArmatureBone(PyObjectPlus)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: BL_ArmatureBone(PyObjectPlus)
+
+   Proxy to Blender bone structure. All fields are read-only and comply to RNA names.
+   All space attribute correspond to the rest pose.
+
+   .. attribute:: name
+
+      bone name.
+
+      :type: string
+
+   .. attribute:: connected
+
+      true when the bone head is struck to the parent's tail.
+
+      :type: boolean
+
+   .. attribute:: hinge
+
+      true when bone doesn't inherit rotation or scale from parent bone.
+
+      :type: boolean
+
+   .. attribute:: inherit_scale
+
+      true when bone inherits scaling from parent bone.
+
+      :type: boolean
+
+   .. attribute:: bbone_segments
+
+      number of B-bone segments.
+
+      :type: integer
+
+   .. attribute:: roll
+
+      bone rotation around head-tail axis.
+
+      :type: float
+
+   .. attribute:: head
+
+      location of head end of the bone in parent bone space.
+
+      :type: vector [x, y, z]
+
+   .. attribute:: tail
+
+      location of head end of the bone in parent bone space.
+
+      :type: vector [x, y, z]
+
+   .. attribute:: length
+
+      bone length.
+
+      :type: float
+
+   .. attribute:: arm_head
+
+      location of head end of the bone in armature space.
+
+      :type: vector [x, y, z]
+
+   .. attribute:: arm_tail
+
+      location of tail end of the bone in armature space.
+
+      :type: vector [x, y, z]
+
+   .. attribute:: arm_mat
+
+      matrix of the bone head in armature space.
+
+      :type: matrix [4][4]
+
+      .. note::
+      
+         This matrix has no scale part. 
+
+   .. attribute:: bone_mat
+
+      rotation matrix of the bone in parent bone space.
+
+      :type: matrix [3][3]
+
+   .. attribute:: parent
+
+      parent bone, or None for root bone.
+
+      :type: :class:`BL_ArmatureBone`
+
+   .. attribute:: children
+
+      list of bone's children.
+
+      :type: list of :class:`BL_ArmatureBone`
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst
new file mode 100644
index 0000000..0722053
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst
@@ -0,0 +1,278 @@
+BL_ArmatureChannel(PyObjectPlus)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: BL_ArmatureChannel(PyObjectPlus)
+
+   Proxy to armature pose channel. Allows to read and set armature pose.
+   The attributes are identical to RNA attributes, but mostly in read-only mode.
+
+   .. attribute:: name
+
+      channel name (=bone name), read-only.
+
+      :type: string
+
+   .. attribute:: bone
+
+      return the bone object corresponding to this pose channel, read-only.
+
+      :type: :class:`BL_ArmatureBone`
+
+   .. attribute:: parent
+
+      return the parent channel object, None if root channel, read-only.
+
+      :type: :class:`BL_ArmatureChannel`
+
+   .. attribute:: has_ik
+
+      true if the bone is part of an active IK chain, read-only.
+      This flag is not set when an IK constraint is defined but not enabled (miss target information for example).
+
+      :type: boolean
+
+   .. attribute:: ik_dof_x
+
+      true if the bone is free to rotation in the X axis, read-only.
+
+      :type: boolean
+
+   .. attribute:: ik_dof_y
+
+      true if the bone is free to rotation in the Y axis, read-only.
+
+      :type: boolean
+
+   .. attribute:: ik_dof_z
+
+      true if the bone is free to rotation in the Z axis, read-only.
+
+      :type: boolean
+
+   .. attribute:: ik_limit_x
+
+      true if a limit is imposed on X rotation, read-only.
+
+      :type: boolean
+
+   .. attribute:: ik_limit_y
+
+      true if a limit is imposed on Y rotation, read-only.
+
+      :type: boolean
+
+   .. attribute:: ik_limit_z
+
+      true if a limit is imposed on Z rotation, read-only.
+
+      :type: boolean
+
+   .. attribute:: ik_rot_control
+
+      true if channel rotation should applied as IK constraint, read-only.
+
+      :type: boolean
+
+   .. attribute:: ik_lin_control
+
+      true if channel size should applied as IK constraint, read-only.
+
+      :type: boolean
+
+   .. attribute:: location
+
+      displacement of the bone head in armature local space, read-write.
+
+      :type: vector [X, Y, Z].
+
+      .. note::
+      
+         You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
+
+      .. note::
+      
+         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
+
+   .. attribute:: scale
+
+      scale of the bone relative to its parent, read-write.
+
+      :type: vector [sizeX, sizeY, sizeZ].
+
+      .. note::
+      
+         An action playing on the armature may change the value.  An IK chain does not update this value, see joint_rotation.
+
+      .. note::
+      
+         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+
+   .. attribute:: rotation_quaternion
+
+      rotation of the bone relative to its parent expressed as a quaternion, read-write.
+
+      :type: vector [qr, qi, qj, qk].
+
+      .. note::
+      
+         This field is only used if rotation_mode is 0. An action playing on the armature may change the value.  An IK chain does not update this value, see joint_rotation.
+
+      .. note::
+      
+         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+
+   .. attribute:: rotation_euler
+
+      rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
+
+      :type: vector [X, Y, Z].
+
+      .. note::
+      
+         This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field.  An IK chain does not update this value, see joint_rotation.
+
+      .. note::
+      
+         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+
+   .. attribute:: rotation_mode
+
+      Method of updating the bone rotation, read-write.
+
+      :type: integer (one of :ref:`these constants <armaturechannel-constants-rotation-mode>`)
+
+   .. attribute:: channel_matrix
+
+      pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
+      This field is updated after the graphic render, it represents the current pose.
+
+      :type: matrix [4][4]
+
+   .. attribute:: pose_matrix
+
+      pose matrix in armature space, read-only, 
+      This field is updated after the graphic render, it represents the current pose.
+
+      :type: matrix [4][4]
+
+   .. attribute:: pose_head
+
+      position of bone head in armature space, read-only.
+
+      :type: vector [x, y, z]
+
+   .. attribute:: pose_tail
+
+      position of bone tail in armature space, read-only.
+
+      :type: vector [x, y, z]
+
+   .. attribute:: ik_min_x
+
+      minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
+
+      :type: float
+
+   .. attribute:: ik_max_x
+
+      maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
+
+      :type: float
+
+   .. attribute:: ik_min_y
+
+      minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
+
+      :type: float
+
+   .. attribute:: ik_max_y
+
+      maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
+
+      :type: float
+
+   .. attribute:: ik_min_z
+
+      minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
+
+      :type: float
+
+   .. attribute:: ik_max_z
+
+      maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
+
+      :type: float
+
+   .. attribute:: ik_stiffness_x
+
+      bone rotation stiffness in X axis, read-only.
+
+      :type: float between 0 and 1
+
+   .. attribute:: ik_stiffness_y
+
+      bone rotation stiffness in Y axis, read-only.
+
+      :type: float between 0 and 1
+
+   .. attribute:: ik_stiffness_z
+
+      bone rotation stiffness in Z axis, read-only.
+
+      :type: float between 0 and 1
+
+   .. attribute:: ik_stretch
+
+      ratio of scale change that is allowed, 0=bone can't change size, read-only.
+
+      :type: float
+
+   .. attribute:: ik_rot_weight
+
+      weight of rotation constraint when ik_rot_control is set, read-write.
+
+      :type: float between 0 and 1
+
+   .. attribute:: ik_lin_weight
+
+      weight of size constraint when ik_lin_control is set, read-write.
+
+      :type: float between 0 and 1
+
+   .. attribute:: joint_rotation
+
+      Control bone rotation in term of joint angle (for robotic applications), read-write.
+
+      When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
+
+      When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
+
+      The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes:
+
+      * 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant
+      * 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants.
+      * 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
+      * 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
+
+      :type: vector [x, y, z]
+      
+      .. note::
+      
+         The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
+
+      .. note::
+      
+         [0, 0, 0] always corresponds to the rest pose.
+
+      .. note::
+      
+         You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
+
+      .. note::
+      
+         You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst
new file mode 100644
index 0000000..1a43709
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst
@@ -0,0 +1,129 @@
+BL_ArmatureConstraint(PyObjectPlus)
+===================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: BL_ArmatureConstraint(PyObjectPlus)
+
+   Proxy to Armature Constraint. Allows to change constraint on the fly.
+   Obtained through :class:`BL_ArmatureObject`.constraints.
+
+   .. note::
+   
+      Not all armature constraints are supported in the GE.
+
+      
+   .. attribute:: type
+
+      Type of constraint, (read-only).
+
+      Use one of :ref:`these constants<armatureconstraint-constants-type>`.
+      
+      :type: integer, one of CONSTRAINT_TYPE_* constants
+
+   .. attribute:: name
+
+      Name of constraint constructed as <bone_name>:<constraint_name>. constraints list.
+
+      :type: string
+
+      This name is also the key subscript on :class:`BL_ArmatureObject`.
+
+   .. attribute:: enforce
+
+      fraction of constraint effect that is enforced. Between 0 and 1.
+
+      :type: float
+
+   .. attribute:: headtail
+
+      Position of target between head and tail of the target bone: 0=head, 1=tail.
+
+      :type: float.
+
+      .. note::
+      
+         Only used if the target is a bone (i.e target object is an armature.
+
+   .. attribute:: lin_error
+
+      runtime linear error (in Blender units) on constraint at the current frame.
+
+      This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
+
+      :type: float
+
+   .. attribute:: rot_error
+
+      Runtime rotation error (in radiant) on constraint at the current frame.
+
+      :type: float.
+
+      This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
+
+      It is only set if the constraint has a rotation part, for example, a CopyPose+Rotation IK constraint.
+
+   .. attribute:: target
+
+      Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint.
+
+      :type: :class:`KX_GameObject`.
+
+   .. attribute:: subtarget
+
+      Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint.
+
+      :type: :class:`KX_GameObject`.
+
+      Currently this is only used for pole target on IK constraint.
+
+   .. attribute:: active
+
+      True if the constraint is active.
+
+      :type: boolean
+      
+      .. note::
+      
+         An inactive constraint does not update lin_error and rot_error.
+
+   .. attribute:: ik_weight
+
+      Weight of the IK constraint between 0 and 1.
+
+      Only defined for IK constraint.
+
+      :type: float
+
+   .. attribute:: ik_type
+
+      Type of IK constraint, (read-only).
+
+      Use one of :ref:`these constants<armatureconstraint-constants-ik-type>`.
+      
+      :type: integer.
+
+   .. attribute:: ik_flag
+
+      Combination of IK constraint option flags, read-only.
+      
+      Use one of :ref:`these constants<armatureconstraint-constants-ik-flag>`.
+
+      :type: integer
+
+   .. attribute:: ik_dist
+
+      Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE.
+
+      :type: float
+
+   .. attribute:: ik_mode
+
+      Use one of :ref:`these constants<armatureconstraint-constants-ik-mode>`.
+      
+      Additional mode for IK constraint. Currently only used for Distance constraint:
+
+      :type: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst
new file mode 100644
index 0000000..8389aff
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst
@@ -0,0 +1,34 @@
+BL_ArmatureObject(KX_GameObject)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`KX_GameObject`
+
+.. class:: BL_ArmatureObject(KX_GameObject)
+
+   An armature object.
+
+   .. attribute:: constraints
+
+      The list of armature constraint defined on this armature.
+      Elements of the list can be accessed by index or string.
+      The key format for string access is '<bone_name>:<constraint_name>'.
+
+      :type: list of :class:`BL_ArmatureConstraint`
+
+   .. attribute:: channels
+
+      The list of armature channels.
+      Elements of the list can be accessed by index or name the bone.
+
+      :type: list of :class:`BL_ArmatureChannel`
+
+   .. method:: update()
+
+      Ensures that the armature will be updated on next graphic frame.
+
+      This action is unecessary if a KX_ArmatureActuator with mode run is active
+      or if an action is playing. Use this function in other cases. It must be called
+      on each frame to ensure that the armature is updated continously.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst b/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
new file mode 100644
index 0000000..f4f5c0d
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
@@ -0,0 +1,220 @@
+BL_Shader(PyObjectPlus)
+=======================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: BL_Shader(PyObjectPlus)
+
+   BL_Shader GLSL shaders.
+
+   TODO - Description
+
+   .. method:: setUniformfv(name, fList)
+
+      Set a uniform with a list of float values
+
+      :arg name: the uniform name
+      :type name: string
+      :arg fList: a list (2, 3 or 4 elements) of float values
+      :type fList: list[float]
+
+   .. method:: delSource()
+
+      Clear the shader. Use this method before the source is changed with :data:`setSource`.
+
+   .. method:: getFragmentProg()
+
+      Returns the fragment program.
+
+      :return: The fragment program.
+      :rtype: string
+
+   .. method:: getVertexProg()
+
+      Get the vertex program.
+
+      :return: The vertex program.
+      :rtype: string
+
+   .. method:: isValid()
+
+      Check if the shader is valid.
+
+      :return: True if the shader is valid
+      :rtype: boolean
+
+   .. method:: setAttrib(enum)
+
+      Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
+
+      :arg enum: attribute location value
+      :type enum: integer
+
+   .. method:: setNumberOfPasses( max_pass )
+
+      Set the maximum number of passes. Not used a.t.m.
+
+      :arg max_pass: the maximum number of passes
+      :type max_pass: integer
+
+   .. method:: setSampler(name, index)
+
+      Set uniform texture sample index.
+
+      :arg name: Uniform name
+      :type name: string
+      :arg index: Texture sample index.
+      :type index: integer
+
+   .. method:: setSource(vertexProgram, fragmentProgram)
+
+      Set the vertex and fragment programs
+
+      :arg vertexProgram: Vertex program
+      :type vertexProgram: string
+      :arg fragmentProgram: Fragment program
+      :type fragmentProgram: string
+
+   .. method:: setUniform1f(name, fx)
+
+      Set a uniform with 1 float value.
+
+      :arg name: the uniform name
+      :type name: string
+      :arg fx: Uniform value
+      :type fx: float
+
+   .. method:: setUniform1i(name, ix)
+
+      Set a uniform with an integer value.
+
+      :arg name: the uniform name
+      :type name: string
+      :arg ix: the uniform value
+      :type ix: integer
+
+   .. method:: setUniform2f(name, fx, fy)
+
+      Set a uniform with 2 float values
+
+      :arg name: the uniform name
+      :type name: string
+      :arg fx: first float value
+      :type fx: float
+
+      :arg fy: second float value
+      :type fy: float
+
+   .. method:: setUniform2i(name, ix, iy)
+
+      Set a uniform with 2 integer values
+
+      :arg name: the uniform name
+      :type name: string
+      :arg ix: first integer value
+      :type ix: integer
+      :arg iy: second integer value
+      :type iy: integer
+
+   .. method:: setUniform3f(name, fx, fy, fz)
+
+      Set a uniform with 3 float values.
+
+      :arg name: the uniform name
+      :type name: string
+      :arg fx: first float value
+      :type fx: float
+      :arg fy: second float value
+      :type fy: float
+      :arg fz: third float value
+      :type fz: float
+
+   .. method:: setUniform3i(name, ix, iy, iz)
+
+      Set a uniform with 3 integer values
+
+      :arg name: the uniform name
+      :type name: string
+      :arg ix: first integer value
+      :type ix: integer
+      :arg iy: second integer value
+      :type iy: integer
+      :arg iz: third integer value
+      :type iz: integer
+
+   .. method:: setUniform4f(name, fx, fy, fz, fw)
+
+      Set a uniform with 4 float values.
+
+      :arg name: the uniform name
+      :type name: string
+      :arg fx: first float value
+      :type fx: float
+      :arg fy: second float value
+      :type fy: float
+      :arg fz: third float value
+      :type fz: float
+      :arg fw: fourth float value
+      :type fw: float
+
+   .. method:: setUniform4i(name, ix, iy, iz, iw)
+
+      Set a uniform with 4 integer values
+
+      :arg name: the uniform name
+      :type name: string
+      :arg ix: first integer value
+      :type ix: integer
+      :arg iy: second integer value
+      :type iy: integer
+      :arg iz: third integer value
+      :type iz: integer
+      :arg iw: fourth integer value
+      :type iw: integer
+
+   .. method:: setUniformDef(name, type)
+
+      Define a new uniform
+
+      :arg name: the uniform name
+      :type name: string
+      :arg type: uniform type
+      :type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX
+
+   .. method:: setUniformMatrix3(name, mat, transpose)
+
+      Set a uniform with a 3x3 matrix value
+
+      :arg name: the uniform name
+      :type name: string
+      :arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]]
+      :type mat: 3x3 matrix
+      :arg transpose: set to True to transpose the matrix
+      :type transpose: boolean
+
+   .. method:: setUniformMatrix4(name, mat, transpose)
+
+      Set a uniform with a 4x4 matrix value
+
+      :arg name: the uniform name
+      :type name: string
+      :arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]]
+      :type mat: 4x4 matrix
+      :arg transpose: set to True to transpose the matrix
+      :type transpose: boolean
+
+   .. method:: setUniformiv(name, iList)
+
+      Set a uniform with a list of integer values
+
+      :arg name: the uniform name
+      :type name: string
+      :arg iList: a list (2, 3 or 4 elements) of integer values
+      :type iList: list[integer]
+
+   .. method:: validate()
+
+      Validate the shader object.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst b/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst
new file mode 100644
index 0000000..d08a761
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst
@@ -0,0 +1,72 @@
+BL_ShapeActionActuator(SCA_IActuator)
+=====================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: BL_ShapeActionActuator(SCA_IActuator)
+
+   ShapeAction Actuators apply an shape action to an mesh object.
+
+   .. attribute:: action
+
+      The name of the action to set as the current shape action.
+
+      :type: string
+
+   .. attribute:: frameStart
+
+      Specifies the starting frame of the shape animation.
+
+      :type: float
+
+   .. attribute:: frameEnd
+
+      Specifies the ending frame of the shape animation.
+
+      :type: float
+
+   .. attribute:: blendIn
+
+      Specifies the number of frames of animation to generate when making transitions between actions.
+
+      :type: float
+
+   .. attribute:: priority
+
+      Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
+
+      :type: integer
+
+   .. attribute:: frame
+
+      Sets the current frame for the animation.
+
+      :type: float
+
+   .. attribute:: propName
+
+      Sets the property to be used in FromProp playback mode.
+
+      :type: string
+
+   .. attribute:: blendTime
+
+      Sets the internal frame timer. This property must be in the range from 0.0 to blendin.
+
+      :type: float
+
+   .. attribute:: mode
+
+      The operation mode of the actuator. Can be one of :ref:`these constants<shape-action-actuator>`.
+
+      :type: integer
+
+   .. attribute:: framePropName
+
+      The name of the property that is set to the current frame number.
+
+      :type: string
+
+
diff --git a/doc/python_api/rst/bge_types/bge.types.CListValue.rst b/doc/python_api/rst/bge_types/bge.types.CListValue.rst
new file mode 100644
index 0000000..ca4cdc4
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.CListValue.rst
@@ -0,0 +1,72 @@
+CListValue(CPropValue)
+======================
+
+.. module:: bge.types
+
+base class --- :class:`CPropValue`
+
+.. class:: CListValue(CPropValue)
+
+   This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
+
+   As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``)
+
+   Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported.
+
+   .. method:: append(val)
+
+      Add an item to the list (like pythons append)
+
+      .. warning::
+      
+         Appending values to the list can cause crashes when the list is used internally by the game engine.
+
+   .. method:: count(val)
+
+      Count the number of instances of a value in the list.
+
+      :return: number of instances
+      :rtype: integer
+
+   .. method:: index(val)
+
+      Return the index of a value in the list.
+
+      :return: The index of the value in the list.
+      :rtype: integer
+
+   .. method:: reverse()
+
+      Reverse the order of the list.
+
+   .. method:: get(key, default=None)
+
+      Return the value matching key, or the default value if its not found.
+
+      :return: The key value or a default.
+
+   .. method:: from_id(id)
+
+      This is a funtion especially for the game engine to return a value with a spesific id.
+
+      Since object names are not always unique, the id of an object can be used to get an object from the CValueList.
+
+      Example:
+
+      .. code-block:: python
+        
+         myObID=id(gameObject)
+         ob= scene.objects.from_id(myObID)
+
+      Where ``myObID`` is an int or long from the id function.
+
+      This has the advantage that you can store the id in places you could not store a gameObject.
+
+      .. warning::
+
+         The id is derived from a memory location and will be different each time the game engine starts.
+
+      .. warning::
+
+         The id can't be stored as an integer in game object properties, as those only have a limited range that the id may not be contained in. Instead an id can be stored as a string game property and converted back to an integer for use in from_id lookups.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.CPropValue.rst b/doc/python_api/rst/bge_types/bge.types.CPropValue.rst
new file mode 100644
index 0000000..7be28c1
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.CPropValue.rst
@@ -0,0 +1,11 @@
+CPropValue(CValue)
+==================
+
+.. module:: bge.types
+
+base class --- :class:`CValue`
+
+.. class:: CPropValue(CValue)
+
+   This class has no python functions
+
diff --git a/doc/python_api/rst/bge_types/bge.types.CValue.rst b/doc/python_api/rst/bge_types/bge.types.CValue.rst
new file mode 100644
index 0000000..52906de
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.CValue.rst
@@ -0,0 +1,17 @@
+CValue(PyObjectPlus)
+====================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: CValue(PyObjectPlus)
+
+   This class is a basis for other classes.
+
+   .. attribute:: name
+
+      The name of this CValue derived object (read-only).
+
+      :type: string
+      
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ArmatureSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_ArmatureSensor.rst
new file mode 100644
index 0000000..a7123eb
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_ArmatureSensor.rst
@@ -0,0 +1,36 @@
+KX_ArmatureSensor(SCA_ISensor)
+==============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: KX_ArmatureSensor(SCA_ISensor)
+
+   Armature sensor detect conditions on armatures.
+
+   .. attribute:: type
+
+      The type of measurement that the sensor make when it is active.
+      
+      Can be one of :ref:`these constants <armaturesensor-type>`
+
+      :type: integer.
+
+   .. attribute:: constraint
+
+      The constraint object this sensor is watching.
+
+      :type: :class:`BL_ArmatureConstraint`
+
+   .. attribute:: value
+   
+      The threshold used in the comparison with the constraint error
+      The linear error is only updated on CopyPose/Distance IK constraint with iTaSC solver
+      The rotation error is only updated on CopyPose+rotation IK constraint with iTaSC solver
+      The linear error on CopyPose is always >= 0: it is the norm of the distance between the target and the bone
+      The rotation error on CopyPose is always >= 0: it is the norm of the equivalent rotation vector between the bone and the target orientations
+      The linear error on Distance can be positive if the distance between the bone and the target is greater than the desired distance, and negative if the distance is smaller.
+
+      :type: float
+      
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst b/doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst
new file mode 100644
index 0000000..0dfc7a1
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst
@@ -0,0 +1,77 @@
+KX_BlenderMaterial(PyObjectPlus)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_BlenderMaterial(PyObjectPlus)
+
+   KX_BlenderMaterial
+
+   .. attribute:: shader
+
+      The materials shader.
+
+      :type: :class:`BL_Shader`
+
+   .. attribute:: blending
+
+      Ints used for pixel blending, (src, dst), matching the setBlending method.
+
+      :type: (integer, integer)
+
+   .. attribute:: material_index
+
+      The material's index.
+
+      :type: integer
+
+   .. method:: getShader()
+
+      Returns the material's shader.
+
+      :return: the material's shader
+      :rtype: :class:`BL_Shader`
+
+   .. method:: setBlending(src, dest)
+
+      Set the pixel color arithmetic functions.
+
+      :arg src: Specifies how the red, green, blue, and alpha source blending factors are computed.
+      :type src: Value in...
+
+         * GL_ZERO,
+         * GL_ONE, 
+         * GL_SRC_COLOR, 
+         * GL_ONE_MINUS_SRC_COLOR, 
+         * GL_DST_COLOR, 
+         * GL_ONE_MINUS_DST_COLOR, 
+         * GL_SRC_ALPHA, 
+         * GL_ONE_MINUS_SRC_ALPHA, 
+         * GL_DST_ALPHA, 
+         * GL_ONE_MINUS_DST_ALPHA, 
+         * GL_SRC_ALPHA_SATURATE
+
+      :arg dest: Specifies how the red, green, blue, and alpha destination blending factors are computed.
+      :type dest: Value in...
+
+         * GL_ZERO
+         * GL_ONE
+         * GL_SRC_COLOR
+         * GL_ONE_MINUS_SRC_COLOR
+         * GL_DST_COLOR
+         * GL_ONE_MINUS_DST_COLOR
+         * GL_SRC_ALPHA
+         * GL_ONE_MINUS_SRC_ALPHA
+         * GL_DST_ALPHA
+         * GL_ONE_MINUS_DST_ALPHA
+         * GL_SRC_ALPHA_SATURATE
+
+   .. method:: getMaterialIndex()
+
+      Returns the material's index.
+
+      :return: the material's index
+      :rtype: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_Camera.rst b/doc/python_api/rst/bge_types/bge.types.KX_Camera.rst
new file mode 100644
index 0000000..baf60ec
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_Camera.rst
@@ -0,0 +1,284 @@
+KX_Camera(KX_GameObject)
+========================
+
+.. module:: bge.types
+
+base class --- :class:`KX_GameObject`
+
+.. class:: KX_Camera(KX_GameObject)
+
+   A Camera object.
+
+   .. data:: INSIDE
+
+      See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+
+   .. data:: INTERSECT
+
+      See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+
+   .. data:: OUTSIDE
+
+      See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+
+   .. attribute:: lens
+
+      The camera's lens value.
+
+      :type: float
+
+   .. attribute:: ortho_scale
+
+      The camera's view scale when in orthographic mode.
+
+      :type: float
+
+   .. attribute:: near
+
+      The camera's near clip distance.
+
+      :type: float
+
+   .. attribute:: far
+
+      The camera's far clip distance.
+
+      :type: float
+
+   .. attribute:: perspective
+
+      True if this camera has a perspective transform, False for an orthographic projection.
+
+      :type: boolean
+
+   .. attribute:: frustum_culling
+
+      True if this camera is frustum culling.
+
+      :type: boolean
+
+   .. attribute:: projection_matrix
+
+      This camera's 4x4 projection matrix.
+
+      .. note::
+      
+         This is the identity matrix prior to rendering the first frame (any Python done on frame 1). 
+
+      :type: 4x4 Matrix [[float]]
+
+   .. attribute:: modelview_matrix
+
+      This camera's 4x4 model view matrix. (read-only).
+
+      :type: 4x4 Matrix [[float]]
+
+      .. note::
+      
+         This matrix is regenerated every frame from the camera's position and orientation. Also, this is the identity matrix prior to rendering the first frame (any Python done on frame 1).
+
+   .. attribute:: camera_to_world
+
+      This camera's camera to world transform. (read-only).
+
+      :type: 4x4 Matrix [[float]]
+
+      .. note::
+      
+         This matrix is regenerated every frame from the camera's position and orientation.
+
+   .. attribute:: world_to_camera
+
+      This camera's world to camera transform. (read-only).
+
+      :type: 4x4 Matrix [[float]]
+
+      .. note::
+         
+         Regenerated every frame from the camera's position and orientation.
+
+      .. note::
+      
+         This is camera_to_world inverted.
+
+   .. attribute:: useViewport
+
+      True when the camera is used as a viewport, set True to enable a viewport for this camera.
+
+      :type: boolean
+
+   .. method:: sphereInsideFrustum(centre, radius)
+
+      Tests the given sphere against the view frustum.
+
+      :arg centre: The centre of the sphere (in world coordinates.)
+      :type centre: list [x, y, z]
+      :arg radius: the radius of the sphere
+      :type radius: float
+      :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
+      :rtype: integer
+
+      .. note::
+
+         When the camera is first initialized the result will be invalid because the projection matrix has not been set.
+
+      .. code-block:: python
+
+         from bge import logic
+         cont = logic.getCurrentController()
+         cam = cont.owner
+         
+         # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]
+         if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):
+             # Sphere is inside frustum !
+             # Do something useful !
+         else:
+             # Sphere is outside frustum
+
+   .. method:: boxInsideFrustum(box)
+
+      Tests the given box against the view frustum.
+
+      :arg box: Eight (8) corner points of the box (in world coordinates.)
+      :type box: list of lists
+      :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
+
+      .. note::
+      
+         When the camera is first initialized the result will be invalid because the projection matrix has not been set.
+
+      .. code-block:: python
+
+         from bge import logic
+         cont = logic.getCurrentController()
+         cam = cont.owner
+
+         # Box to test...
+         box = []
+         box.append([-1.0, -1.0, -1.0])
+         box.append([-1.0, -1.0,  1.0])
+         box.append([-1.0,  1.0, -1.0])
+         box.append([-1.0,  1.0,  1.0])
+         box.append([ 1.0, -1.0, -1.0])
+         box.append([ 1.0, -1.0,  1.0])
+         box.append([ 1.0,  1.0, -1.0])
+         box.append([ 1.0,  1.0,  1.0])
+         
+         if (cam.boxInsideFrustum(box) != cam.OUTSIDE):
+           # Box is inside/intersects frustum !
+           # Do something useful !
+         else:
+           # Box is outside the frustum !
+           
+   .. method:: pointInsideFrustum(point)
+
+      Tests the given point against the view frustum.
+
+      :arg point: The point to test (in world coordinates.)
+      :type point: 3D Vector
+      :return: True if the given point is inside this camera's viewing frustum.
+      :rtype: boolean
+
+      .. note::
+      
+         When the camera is first initialized the result will be invalid because the projection matrix has not been set.
+
+      .. code-block:: python
+
+         from bge import logic
+         cont = logic.getCurrentController()
+         cam = cont.owner
+
+         # Test point [0.0, 0.0, 0.0]
+         if (cam.pointInsideFrustum([0.0, 0.0, 0.0])):
+           # Point is inside frustum !
+           # Do something useful !
+         else:
+           # Box is outside the frustum !
+
+   .. method:: getCameraToWorld()
+
+      Returns the camera-to-world transform.
+
+      :return: the camera-to-world transform matrix.
+      :rtype: matrix (4x4 list)
+
+   .. method:: getWorldToCamera()
+
+      Returns the world-to-camera transform.
+
+      This returns the inverse matrix of getCameraToWorld().
+
+      :return: the world-to-camera transform matrix.
+      :rtype: matrix (4x4 list)
+
+   .. method:: setOnTop()
+
+      Set this cameras viewport ontop of all other viewport.
+
+   .. method:: setViewport(left, bottom, right, top)
+
+      Sets the region of this viewport on the screen in pixels.
+
+      Use :data:`bge.render.getWindowHeight` and :data:`bge.render.getWindowWidth` to calculate values relative to the entire display.
+
+      :arg left: left pixel coordinate of this viewport
+      :type left: integer
+      :arg bottom: bottom pixel coordinate of this viewport
+      :type bottom: integer
+      :arg right: right pixel coordinate of this viewport
+      :type right: integer
+      :arg top: top pixel coordinate of this viewport
+      :type top: integer
+
+   .. method:: getScreenPosition(object)
+
+      Gets the position of an object projected on screen space.
+
+      .. code-block:: python
+
+         # For an object in the middle of the screen, coord = [0.5, 0.5]
+         coord = camera.getScreenPosition(object)
+
+      :arg object: object name or list [x, y, z]
+      :type object: :class:`KX_GameObject` or 3D Vector
+      :return: the object's position in screen coordinates.
+      :rtype: list [x, y]
+
+   .. method:: getScreenVect(x, y)
+
+      Gets the vector from the camera position in the screen coordinate direction.
+
+      :arg x: X Axis
+      :type x: float
+      :arg y: Y Axis
+      :type y: float
+      :rtype: 3D Vector
+      :return: The vector from screen coordinate.
+
+      .. code-block:: python
+
+         # Gets the vector of the camera front direction:
+         m_vect = camera.getScreenVect(0.5, 0.5)
+
+   .. method:: getScreenRay(x, y, dist=inf, property=None)
+
+      Look towards a screen coordinate (x, y) and find first object hit within dist that matches prop.
+      The ray is similar to KX_GameObject->rayCastTo.
+
+      :arg x: X Axis
+      :type x: float
+      :arg y: Y Axis
+      :type y: float
+      :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
+      :type dist: float
+      :arg property: property name that object must have; can be omitted => detect any object
+      :type property: string
+      :rtype: :class:`KX_GameObject`
+      :return: the first object hit or None if no object or object does not match prop
+
+      .. code-block:: python
+
+         # Gets an object with a property "wall" in front of the camera within a distance of 100:
+         target = camera.getScreenRay(0.5, 0.5, 100, "wall")
+         
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_CameraActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_CameraActuator.rst
new file mode 100644
index 0000000..bc5efed
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_CameraActuator.rst
@@ -0,0 +1,47 @@
+KX_CameraActuator(SCA_IActuator)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_CameraActuator(SCA_IActuator)
+
+   Applies changes to a camera.
+
+   .. attribute:: damping
+
+      strength of of the camera following movement.
+
+      :type: float
+
+   .. attribute:: axis
+
+      The camera axis (0, 1, 2) for positive ``XYZ``, (3, 4, 5) for negative ``XYZ``.
+
+      :type: int
+
+   .. attribute:: min
+
+      minimum distance to the target object maintained by the actuator.
+
+      :type: float
+
+   .. attribute:: max
+
+      maximum distance to stay from the target object.
+
+      :type: float
+
+   .. attribute:: height
+
+      height to stay above the target object.
+
+      :type: float
+
+   .. attribute:: object
+
+      the object this actuator tracks.
+
+      :type: :class:`KX_GameObject` or None
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_CharacterWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_CharacterWrapper.rst
new file mode 100644
index 0000000..32e5c3e
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_CharacterWrapper.rst
@@ -0,0 +1,45 @@
+KX_CharacterWrapper(PyObjectPlus)
+=================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_CharacterWrapper(PyObjectPlus)
+
+   A wrapper to expose character physics options.
+
+   .. attribute:: onGround
+
+      Whether or not the character is on the ground. (read-only)
+
+      :type: boolean
+
+   .. attribute:: gravity
+
+      The gravity value used for the character.
+
+      :type: float
+
+   .. attribute:: maxJumps
+
+      The maximum number of jumps a character can perform before having to touch the ground. By default this is set to 1. 2 allows for a double jump, etc.
+
+      :type: int
+
+   .. attribute:: jumpCount
+
+      The current jump count. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump.
+
+      :type: int
+
+   .. attribute:: walkDirection
+   
+      The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.
+
+      :type: list [x, y, z]
+
+   .. method:: jump()
+
+      The character jumps based on it's jump speed.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintActuator.rst
new file mode 100644
index 0000000..4989904
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintActuator.rst
@@ -0,0 +1,78 @@
+KX_ConstraintActuator(SCA_IActuator)
+====================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_ConstraintActuator(SCA_IActuator)
+
+   A constraint actuator limits the position, rotation, distance or orientation of an object.
+
+   .. attribute:: damp
+
+      Time constant of the constraint expressed in frame (not use by Force field constraint).
+
+      :type: integer
+
+   .. attribute:: rotDamp
+
+      Time constant for the rotation expressed in frame (only for the distance constraint), 0 = use damp for rotation as well.
+
+      :type: integer
+
+   .. attribute:: direction
+
+      The reference direction in world coordinate for the orientation constraint.
+
+      :type: 3-tuple of float: (x, y, z)
+
+   .. attribute:: option
+
+      Binary combination of :ref:`these constants <constraint-actuator-option>`
+
+      :type: integer
+
+   .. attribute:: time
+
+      activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time.
+
+      :type: integer
+
+   .. attribute:: propName
+
+      the name of the property or material for the ray detection of the distance constraint.
+
+      :type: string
+
+   .. attribute:: min
+
+      The lower bound of the constraint. For the rotation and orientation constraint, it represents radiant.
+
+      :type: float
+
+   .. attribute:: distance
+
+      the target distance of the distance constraint.
+
+      :type: float
+
+   .. attribute:: max
+
+      the upper bound of the constraint. For rotation and orientation constraints, it represents radiant.
+
+      :type: float
+
+   .. attribute:: rayLength
+
+      the length of the ray of the distance constraint.
+
+      :type: float
+
+   .. attribute:: limit
+
+      type of constraint. Use one of the :ref:`these constants <constraint-actuator-limit>`
+
+      :type: integer.
+
+      
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
new file mode 100644
index 0000000..c266751
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
@@ -0,0 +1,18 @@
+KX_ConstraintWrapper(PyObjectPlus)
+==================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_ConstraintWrapper(PyObjectPlus)
+
+   KX_ConstraintWrapper
+
+   .. method:: getConstraintId(val)
+
+      Returns the contraint's ID
+
+      :return: the constraint's ID
+      :rtype: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst
new file mode 100644
index 0000000..1961f5e
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst
@@ -0,0 +1,12 @@
+KX_FontObject(KX_GameObject)
+============================
+
+.. module:: bge.types
+
+base class --- :class:`KX_GameObject`
+
+.. class:: KX_FontObject(KX_GameObject)
+
+   TODO.
+
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_GameActuator.rst
new file mode 100644
index 0000000..54702c5
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_GameActuator.rst
@@ -0,0 +1,23 @@
+KX_GameActuator(SCA_IActuator)
+==============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_GameActuator(SCA_IActuator)
+
+   The game actuator loads a new .blend file, restarts the current .blend file or quits the game.
+
+   .. attribute:: fileName
+
+      the new .blend file to load.
+
+      :type: string
+
+   .. attribute:: mode
+
+      The mode of this actuator. Can be on of :ref:`these constants <game-actuator>`
+
+      :type: Int
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
new file mode 100644
index 0000000..a9c9173
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
@@ -0,0 +1,839 @@
+KX_GameObject(SCA_IObject)
+==========================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IObject`
+
+.. class:: KX_GameObject(SCA_IObject)
+
+   All game objects are derived from this class.
+
+   Properties assigned to game objects are accessible as attributes of this class.
+
+   .. note::
+      
+      Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError,
+      if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
+
+   KX_GameObject can be subclassed to extend functionality. For example:
+
+   .. code-block:: python
+
+        import bge
+
+        class CustomGameObject(bge.types.KX_GameObject):
+            RATE = 0.05
+
+            def __init__(self, old_owner):
+                # "old_owner" can just be ignored. At this point, "self" is
+                # already the object in the scene, and "old_owner" has been
+                # destroyed.
+
+                # New attributes can be defined - but we could also use a game
+                # property, like "self['rate']".
+                self.rate = CustomGameObject.RATE
+
+            def update(self):
+                self.worldPosition.z += self.rate
+
+                # switch direction
+                if self.worldPosition.z > 1.0:
+                    self.rate = -CustomGameObject.RATE
+                elif self.worldPosition.z < 0.0:
+                    self.rate = CustomGameObject.RATE
+
+        # Called first
+        def mutate(cont):
+            old_object = cont.owner
+            mutated_object = CustomGameObject(cont.owner)
+
+            # After calling the constructor above, references to the old object
+            # should not be used.
+            assert(old_object is not mutated_object)
+            assert(old_object.invalid)
+            assert(mutated_object is cont.owner)
+
+        # Called later - note we are now working with the mutated object.
+        def update(cont):
+            cont.owner.update()
+
+   When subclassing objects other than empties and meshes, the specific type
+   should be used - e.g. inherit from :class:`BL_ArmatureObject` when the object
+   to mutate is an armature.
+
+   .. attribute:: name
+
+      The object's name. (read-only).
+
+      :type: string
+
+   .. attribute:: mass
+
+      The object's mass
+
+      :type: float
+
+      .. note::
+         
+         The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
+      
+   .. attribute:: linVelocityMin
+
+      Enforces the object keeps moving at a minimum velocity.
+
+      :type: float
+      
+      .. note::
+      
+         Applies to dynamic and rigid body objects only.
+
+      .. note::
+         
+         A value of 0.0 disables this option.
+
+      .. note::
+      
+         While objects are stationary the minimum velocity will not be applied.
+
+   .. attribute:: linVelocityMax
+
+      Clamp the maximum linear velocity to prevent objects moving beyond a set speed.
+
+      :type: float
+      
+      .. note::
+         
+         Applies to dynamic and rigid body objects only.
+
+      .. note::
+
+         A value of 0.0 disables this option (rather then setting it stationary).
+
+   .. attribute:: localInertia
+
+      the object's inertia vector in local coordinates. Read only.
+
+      :type: list [ix, iy, iz]
+
+   .. attribute:: parent
+
+      The object's parent object. (read-only).
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: groupMembers
+
+      Returns the list of group members if the object is a group object, otherwise None is returned.
+
+      :type: :class:`CListValue` of :class:`KX_GameObject` or None
+
+   .. attribute:: groupObject
+
+      Returns the group object that the object belongs to or None if the object is not part of a group.
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: scene
+
+      The object's scene. (read-only).
+
+      :type: :class:`KX_Scene` or None
+
+   .. attribute:: visible
+
+      visibility flag.
+
+      :type: boolean
+      
+      .. note::
+      
+         Game logic will still run for invisible objects.
+
+   .. attribute:: color
+
+      The object color of the object. [r, g, b, a]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: occlusion
+
+      occlusion capability flag.
+
+      :type: boolean
+
+   .. attribute:: position
+
+      The object's position. [x, y, z] On write: local position, on read: world position
+
+      .. deprecated:: use :data:`localPosition` and :data:`worldPosition`.
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: orientation
+
+      The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. On write: local orientation, on read: world orientation
+
+      .. deprecated:: use :data:`localOrientation` and :data:`worldOrientation`.
+
+      :type: :class:`mathutils.Matrix`
+
+   .. attribute:: scaling
+
+      The object's scaling factor. [sx, sy, sz] On write: local scaling, on read: world scaling
+
+      .. deprecated:: use :data:`localScale` and :data:`worldScale`.
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: localOrientation
+
+      The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
+
+      :type: :class:`mathutils.Matrix`
+
+   .. attribute:: worldOrientation
+
+      The object's world orientation. 3x3 Matrix.
+
+      :type: :class:`mathutils.Matrix`
+
+   .. attribute:: localScale
+
+      The object's local scaling factor. [sx, sy, sz]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: worldScale
+
+      The object's world scaling factor. [sx, sy, sz]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: localPosition
+
+      The object's local position. [x, y, z]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: worldPosition
+
+      The object's world position. [x, y, z]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: localTransform
+
+      The object's local space transform matrix. 4x4 Matrix.
+
+      :type: :class:`mathutils.Matrix`
+
+   .. attribute:: worldTransform
+
+      The object's world space transform matrix. 4x4 Matrix.
+
+      :type: :class:`mathutils.Matrix`
+
+   .. attribute:: localLinearVelocity
+      
+      The object's local linear velocity. [x, y, z]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: worldLinearVelocity
+   
+      The object's world linear velocity. [x, y, z]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: localAngularVelocity
+   
+      The object's local angular velocity. [x, y, z]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: worldAngularVelocity
+   
+      The object's world angular velocity. [x, y, z]
+
+      :type: :class:`mathutils.Vector`
+
+   .. attribute:: timeOffset
+
+      adjust the slowparent delay at runtime.
+
+      :type: float
+
+   .. attribute:: state
+
+      the game object's state bitmask, using the first 30 bits, one bit must always be set.
+
+      :type: int
+
+   .. attribute:: meshes
+
+      a list meshes for this object.
+
+      :type: list of :class:`KX_MeshProxy`
+      
+      .. note::
+         
+         Most objects use only 1 mesh.
+
+      .. note::
+         
+         Changes to this list will not update the KX_GameObject.
+
+   .. attribute:: sensors
+
+      a sequence of :class:`SCA_ISensor` objects with string/index lookups and iterator support.
+
+      :type: list
+      
+      .. note::
+         
+         This attribute is experemental and may be removed (but probably wont be).
+
+      .. note::
+      
+         Changes to this list will not update the KX_GameObject.
+
+   .. attribute:: controllers
+
+      a sequence of :class:`SCA_IController` objects with string/index lookups and iterator support.
+
+      :type: list of :class:`SCA_ISensor`
+      
+      .. note::
+         
+         This attribute is experemental and may be removed (but probably wont be).
+
+      .. note::
+         
+         Changes to this list will not update the KX_GameObject.
+
+   .. attribute:: actuators
+
+      a list of :class:`SCA_IActuator` with string/index lookups and iterator support.
+
+      :type: list
+      
+      .. note::
+
+         This attribute is experemental and may be removed (but probably wont be).
+
+      .. note::
+
+         Changes to this list will not update the KX_GameObject.
+
+   .. attribute:: attrDict
+
+      get the objects internal python attribute dictionary for direct (faster) access.
+
+      :type: dict
+
+   .. attribute:: children
+
+      direct children of this object, (read-only).
+
+      :type: :class:`CListValue` of :class:`KX_GameObject`'s
+
+   .. attribute:: childrenRecursive
+
+      all children of this object including childrens children, (read-only).
+
+      :type: :class:`CListValue` of :class:`KX_GameObject`'s
+
+   .. attribute:: life
+
+      The number of seconds until the object ends, assumes 50fps.
+      (when added with an add object actuator), (read-only).
+
+      :type: float
+
+   .. method:: endObject()
+
+      Delete this object, can be used in place of the EndObject Actuator.
+
+      The actual removal of the object from the scene is delayed.
+
+   .. method:: replaceMesh(mesh, useDisplayMesh=True, usePhysicsMesh=False)
+
+      Replace the mesh of this object with a new mesh. This works the same was as the actuator.
+
+      :arg mesh: mesh to replace or the meshes name.
+      :type mesh: :class:`MeshProxy` or string
+      :arg useDisplayMesh: when enabled the display mesh will be replaced (optional argument).
+      :type useDisplayMesh: boolean
+      :arg usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument).
+      :type usePhysicsMesh: boolean
+
+   .. method:: setVisible(visible, recursive)
+
+      Sets the game object's visible flag.
+
+      :arg visible: the visible state to set.
+      :type visible: boolean
+      :arg recursive: optional argument to set all childrens visibility flag too.
+      :type recursive: boolean
+
+   .. method:: setOcclusion(occlusion, recursive)
+
+      Sets the game object's occlusion capability.
+
+      :arg occlusion: the state to set the occlusion to.
+      :type occlusion: boolean
+      :arg recursive: optional argument to set all childrens occlusion flag too.
+      :type recursive: boolean
+
+   .. method:: alignAxisToVect(vect, axis=2, factor=1.0)
+
+      Aligns any of the game object's axis along the given vector.
+
+
+      :arg vect: a vector to align the axis.
+      :type vect: 3D vector
+      :arg axis: The axis you want to align
+
+         * 0: X axis
+         * 1: Y axis
+         * 2: Z axis
+
+      :type axis: integer
+      :arg factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0)
+      :type factor: float
+
+   .. method:: getAxisVect(vect)
+
+      Returns the axis vector rotates by the objects worldspace orientation.
+      This is the equivalent of multiplying the vector by the orientation matrix.
+
+      :arg vect: a vector to align the axis.
+      :type vect: 3D Vector
+      :return: The vector in relation to the objects rotation.
+      :rtype: 3d vector.
+
+   .. method:: applyMovement(movement, local=False)
+
+      Sets the game object's movement.
+
+      :arg movement: movement vector.
+      :type movement: 3D Vector
+      :arg local:
+         * False: you get the "global" movement ie: relative to world orientation.
+         * True: you get the "local" movement ie: relative to object orientation.
+      :arg local: boolean
+
+   .. method:: applyRotation(rotation, local=False)
+
+      Sets the game object's rotation.
+
+      :arg rotation: rotation vector.
+      :type rotation: 3D Vector
+      :arg local:
+         * False: you get the "global" rotation ie: relative to world orientation.
+         * True: you get the "local" rotation ie: relative to object orientation.
+      :arg local: boolean
+
+   .. method:: applyForce(force, local=False)
+
+      Sets the game object's force.
+
+      This requires a dynamic object.
+
+      :arg force: force vector.
+      :type force: 3D Vector
+      :arg local:
+         * False: you get the "global" force ie: relative to world orientation.
+         * True: you get the "local" force ie: relative to object orientation.
+      :type local: boolean
+
+   .. method:: applyTorque(torque, local=False)
+
+      Sets the game object's torque.
+
+      This requires a dynamic object.
+
+      :arg torque: torque vector.
+      :type torque: 3D Vector
+      :arg local:
+         * False: you get the "global" torque ie: relative to world orientation.
+         * True: you get the "local" torque ie: relative to object orientation.
+      :type local: boolean
+
+   .. method:: getLinearVelocity(local=False)
+
+      Gets the game object's linear velocity.
+
+      This method returns the game object's velocity through it's centre of mass, ie no angular velocity component.
+
+      :arg local:
+         * False: you get the "global" velocity ie: relative to world orientation.
+         * True: you get the "local" velocity ie: relative to object orientation.
+      :type local: boolean
+      :return: the object's linear velocity.
+      :rtype: list [vx, vy, vz]
+
+   .. method:: setLinearVelocity(velocity, local=False)
+
+      Sets the game object's linear velocity.
+
+      This method sets game object's velocity through it's centre of mass, 
+      ie no angular velocity component.
+
+      This requires a dynamic object.
+
+      :arg velocity: linear velocity vector.
+      :type velocity: 3D Vector
+      :arg local:
+         * False: you get the "global" velocity ie: relative to world orientation.
+         * True: you get the "local" velocity ie: relative to object orientation.
+      :type local: boolean
+
+   .. method:: getAngularVelocity(local=False)
+
+      Gets the game object's angular velocity.
+
+      :arg local:
+         * False: you get the "global" velocity ie: relative to world orientation.
+         * True: you get the "local" velocity ie: relative to object orientation.
+      :type local: boolean
+      :return: the object's angular velocity.
+      :rtype: list [vx, vy, vz]
+
+   .. method:: setAngularVelocity(velocity, local=False)
+
+      Sets the game object's angular velocity.
+
+      This requires a dynamic object.
+
+      :arg velocity: angular velocity vector.
+      :type velocity: boolean
+      :arg local:
+         * False: you get the "global" velocity ie: relative to world orientation.
+         * True: you get the "local" velocity ie: relative to object orientation.
+
+   .. method:: getVelocity(point=(0, 0, 0))
+
+      Gets the game object's velocity at the specified point.
+
+      Gets the game object's velocity at the specified point, including angular
+      components.
+
+      :arg point: optional point to return the velocity for, in local coordinates.
+      :type point: 3D Vector
+      :return: the velocity at the specified point.
+      :rtype: list [vx, vy, vz]
+
+   .. method:: getReactionForce()
+
+      Gets the game object's reaction force.
+
+      The reaction force is the force applied to this object over the last simulation timestep.
+      This also includes impulses, eg from collisions.
+
+      :return: the reaction force of this object.
+      :rtype: list [fx, fy, fz]
+
+      .. note::
+
+         This is not implimented at the moment.
+
+   .. method:: applyImpulse(point, impulse)
+
+      Applies an impulse to the game object.
+
+      This will apply the specified impulse to the game object at the specified point.
+      If point != position, applyImpulse will also change the object's angular momentum.
+      Otherwise, only linear momentum will change.
+
+      :arg point: the point to apply the impulse to (in world coordinates)
+      :type point: the point to apply the impulse to (in world coordinates)
+
+   .. method:: suspendDynamics()
+
+      Suspends physics for this object.
+
+   .. method:: restoreDynamics()
+
+      Resumes physics for this object.
+
+      .. note::
+         
+         The objects linear velocity will be applied from when the dynamics were suspended.
+
+   .. method:: enableRigidBody()
+
+      Enables rigid body physics for this object.
+
+      Rigid body physics allows the object to roll on collisions.
+
+   .. method:: disableRigidBody()
+
+      Disables rigid body physics for this object.
+
+   .. method:: setParent(parent, compound=True, ghost=True)
+
+      Sets this object's parent.
+      Control the shape status with the optional compound and ghost parameters:
+
+      In that case you can control if it should be ghost or not:
+
+      :arg parent: new parent object.
+      :type parent: :class:`KX_GameObject`
+      :arg compound: whether the shape should be added to the parent compound shape.
+
+         * True: the object shape should be added to the parent compound shape.
+         * False: the object should keep its individual shape.
+
+      :type compound: boolean
+      :arg ghost: whether the object should be ghost while parented.
+
+         * True: if the object should be made ghost while parented.
+         * False: if the object should be solid while parented.
+
+      :type ghost: boolean
+
+      .. note::
+      
+         If the object type is sensor, it stays ghost regardless of ghost parameter
+
+   .. method:: removeParent()
+
+      Removes this objects parent.
+
+   .. method:: getPhysicsId()
+
+      Returns the user data object associated with this game object's physics controller.
+
+   .. method:: getPropertyNames()
+
+      Gets a list of all property names.
+
+      :return: All property names for this object.
+      :rtype: list
+
+   .. method:: getDistanceTo(other)
+
+      :arg other: a point or another :class:`KX_GameObject` to measure the distance to.
+      :type other: :class:`KX_GameObject` or list [x, y, z]
+      :return: distance to another object or point.
+      :rtype: float
+
+   .. method:: getVectTo(other)
+
+      Returns the vector and the distance to another object or point.
+      The vector is normalized unless the distance is 0, in which a zero length vector is returned.
+
+      :arg other: a point or another :class:`KX_GameObject` to get the vector and distance to.
+      :type other: :class:`KX_GameObject` or list [x, y, z]
+      :return: (distance, globalVector(3), localVector(3))
+      :rtype: 3-tuple (float, 3-tuple (x, y, z), 3-tuple (x, y, z))
+
+   .. method:: rayCastTo(other, dist, prop)
+
+      Look towards another point/object and find first object hit within dist that matches prop.
+
+      The ray is always casted from the center of the object, ignoring the object itself.
+      The ray is casted towards the center of another object or an explicit [x, y, z] point.
+      Use rayCast() if you need to retrieve the hit point
+
+      :arg other: [x, y, z] or object towards which the ray is casted
+      :type other: :class:`KX_GameObject` or 3-tuple
+      :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
+      :type dist: float
+      :arg prop: property name that object must have; can be omitted => detect any object
+      :type prop: string
+      :return: the first object hit or None if no object or object does not match prop
+      :rtype: :class:`KX_GameObject`
+
+   .. method:: rayCast(objto, objfrom, dist, prop, face, xray, poly)
+
+      Look from a point/object to another point/object and find first object hit within dist that matches prop.
+      if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None, None, None) if no hit.
+      if poly is 1, returns a 4-tuple with in addition a :class:`KX_PolyProxy` as 4th element.
+      if poly is 2, returns a 5-tuple with in addition a 2D vector with the UV mapping of the hit point as 5th element.
+
+      .. code-block:: python
+
+         # shoot along the axis gun-gunAim (gunAim should be collision-free)
+         obj, point, normal = gun.rayCast(gunAim, None, 50)
+         if obj:
+            # do something
+            pass
+
+      The face paremeter determines the orientation of the normal.
+
+      * 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
+      * 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
+
+      The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
+      The prop and xray parameters interact as follow.
+
+      * prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
+      * prop off, xray on : idem.
+      * prop on, xray off: return closest hit if it matches prop, no hit otherwise.
+      * prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
+
+      The :class:`KX_PolyProxy` 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray.
+      If there is no hit or the hit object is not a static mesh, None is returned as 4th element.
+
+      The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects.
+
+      :arg objto: [x, y, z] or object to which the ray is casted
+      :type objto: :class:`KX_GameObject` or 3-tuple
+      :arg objfrom: [x, y, z] or object from which the ray is casted; None or omitted => use self object center
+      :type objfrom: :class:`KX_GameObject` or 3-tuple or None
+      :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to
+      :type dist: float
+      :arg prop: property name that object must have; can be omitted or "" => detect any object
+      :type prop: string
+      :arg face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin
+      :type face: integer
+      :arg xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object
+      :type xray: integer
+      :arg poly: polygon option: 0, 1 or 2 to return a 3-, 4- or 5-tuple with information on the face hit.
+
+         * 0 or omitted: return value is a 3-tuple (object, hitpoint, hitnormal) or (None, None, None) if no hit
+         * 1: return value is a 4-tuple and the 4th element is a :class:`KX_PolyProxy` or None if no hit or the object doesn't use a mesh collision shape.
+         * 2: return value is a 5-tuple and the 5th element is a 2-tuple (u, v) with the UV mapping of the hit point or None if no hit, or the object doesn't use a mesh collision shape, or doesn't have a UV mapping.
+
+      :type poly: integer
+      :return: (object, hitpoint, hitnormal) or (object, hitpoint, hitnormal, polygon) or (object, hitpoint, hitnormal, polygon, hituv).
+
+         * object, hitpoint and hitnormal are None if no hit.
+         * polygon is valid only if the object is valid and is a static object, a dynamic object using mesh collision shape or a soft body object, otherwise it is None
+         * hituv is valid only if polygon is valid and the object has a UV mapping, otherwise it is None
+
+      :rtype:
+
+         * 3-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz))
+         * or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`)
+         * or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`, 2-tuple (u, v))
+
+      .. note::
+      
+         The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x, y, z] points.
+
+   .. method:: setCollisionMargin(margin)
+
+      Set the objects collision margin.
+
+      :arg margin: the collision margin distance in blender units.
+      :type margin: float
+
+      .. note::
+      
+         If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
+
+   .. method:: sendMessage(subject, body="", to="")
+
+      Sends a message.
+
+      :arg subject: The subject of the message
+      :type subject: string
+      :arg body: The body of the message (optional)
+      :type body: string
+      :arg to: The name of the object to send the message to (optional)
+      :type to: string
+
+   .. method:: reinstancePhysicsMesh(gameObject, meshObject)
+
+      Updates the physics system with the changed mesh.
+
+      If no arguments are given the physics mesh will be re-created from the first mesh assigned to the game object.
+
+      :arg gameObject: optional argument, set the physics shape from this gameObjets mesh.
+      :type gameObject: string, :class:`KX_GameObject` or None
+      :arg meshObject: optional argument, set the physics shape from this mesh.
+      :type meshObject: string, :class:`MeshProxy` or None
+
+      :return: True if reinstance succeeded, False if it failed.
+      :rtype: boolean
+
+      .. note::
+
+         If this object has instances the other instances will be updated too.
+      
+      .. note::
+
+         The gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as subsurf).
+      
+      .. warning::
+
+         Only triangle mesh type objects are supported currently (not convex hull)
+
+      .. warning::
+
+         If the object is a part of a combound object it will fail (parent or child)
+
+      .. warning::
+
+         Rebuilding the physics mesh can be slow, running many times per second will give a performance hit.
+
+   .. method:: get(key, default=None)
+
+      Return the value matching key, or the default value if its not found.
+      :return: The key value or a default.
+
+   .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0, blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0)
+
+      Plays an action.
+      
+      :arg name: the name of the action
+      :type name: string
+      :arg start: the start frame of the action
+      :type start: float
+      :arg end: the end frame of the action
+      :type end: float
+      :arg layer: the layer the action will play in (actions in different layers are added/blended together)
+      :type layer: integer
+      :arg priority: only play this action if there isn't an action currently playing in this layer with a higher (lower number) priority
+      :type priority: integer
+      :arg blendin: the amount of blending between this animation and the previous one on this layer
+      :type blendin: float
+      :arg play_mode: the play mode
+      :type play_mode: one of :ref:`these constants <gameobject-playaction-mode>`
+      :arg layer_weight: how much of the previous layer to use for blending (0 = add)
+      :type layer_weight: float
+      :arg ipo_flags: flags for the old IPO behaviors (force, etc)
+      :type ipo_flags: int bitfield
+      :arg speed: the playback speed of the action as a factor (1.0 = normal speed, 2.0 = 2x speed, etc)
+      :type speed: float
+
+   .. method:: stopAction(layer=0)
+      
+      Stop playing the action on the given layer.
+      
+      :arg layer: The layer to stop playing.
+      :type layer: integer
+      
+   .. method:: getActionFrame(layer=0)
+   
+      Gets the current frame of the action playing in the supplied layer.
+      
+      :arg layer: The layer that you want to get the frame from.
+      :type layer: integer
+      
+      :return: The current frame of the action
+      :rtype: float
+      
+   .. method:: setActionFrame(frame, layer=0)
+   
+      Set the current frame of the action playing in the supplied layer.
+      
+      :arg layer: The layer where you want to set the frame
+      :type layer: integer
+      :arg frame: The frame to set the action to
+      :type frame: float
+
+   .. method:: isPlayingAction(layer=0)
+   
+       Checks to see if there is an action playing in the given layer.
+       
+       :arg layer: The layer to check for a playing action.
+       :type layer: integer
+       
+       :return: Whether or not the action is playing
+       :rtype: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_IpoActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_IpoActuator.rst
new file mode 100644
index 0000000..2cae4fb
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_IpoActuator.rst
@@ -0,0 +1,65 @@
+KX_IpoActuator(SCA_IActuator)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_IpoActuator(SCA_IActuator)
+
+   IPO actuator activates an animation.
+
+   .. attribute:: frameStart
+
+      Start frame.
+
+      :type: float
+
+   .. attribute:: frameEnd
+
+      End frame.
+
+      :type: float
+
+   .. attribute:: propName
+
+      Use this property to define the Ipo position.
+
+      :type: string
+
+   .. attribute:: framePropName
+
+      Assign this property this action current frame number.
+
+      :type: string
+
+   .. attribute:: mode
+
+      Play mode for the ipo. Can be on of :ref:`these constants <ipo-actuator>`
+
+      :type: integer
+
+   .. attribute:: useIpoAsForce
+
+      Apply Ipo as a global or local force depending on the local option (dynamic objects only).
+
+      :type: boolean
+
+   .. attribute:: useIpoAdd
+
+      Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag.
+
+      :type: boolean
+
+   .. attribute:: useIpoLocal
+
+      Let the ipo acts in local coordinates, used in Force and Add mode.
+
+      :type: boolean
+
+   .. attribute:: useChildren
+
+      Update IPO on all children Objects as well.
+
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_LibLoadStatus.rst b/doc/python_api/rst/bge_types/bge.types.KX_LibLoadStatus.rst
new file mode 100644
index 0000000..a5b7aaf
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_LibLoadStatus.rst
@@ -0,0 +1,45 @@
+KX_LibLoadStatus(PyObjectPlus)
+==============================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_LibLoadStatus(PyObjectPlus)
+
+   An object providing information about a LibLoad() operation.
+
+   .. code-block:: python
+
+      # Print a message when an async LibLoad is done
+      import bge
+
+      def finished_cb(status):
+          print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))
+
+      bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb
+
+   .. attribute:: onFinish
+
+      A callback that gets called when the lib load is done.
+
+      :type: callable
+
+   .. attribute:: progress
+
+      The current progress of the lib load as a normalized value from 0.0 to 1.0.
+
+      :type: float
+
+   .. attribute:: libraryName
+
+      The name of the library being loaded (the first argument to LibLoad).
+
+      :type: string
+
+   .. attribute:: timeTaken
+
+      The amount of time, in seconds, the lib load took (0 until the operation is complete).
+
+      :type: float
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst
new file mode 100644
index 0000000..2b2bdf7
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst
@@ -0,0 +1,90 @@
+KX_LightObject(KX_GameObject)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`KX_GameObject`
+
+.. class:: KX_LightObject(KX_GameObject)
+
+   A Light object.
+
+   .. code-block:: python
+
+      # Turn on a red alert light.
+      import bge
+
+      co = bge.logic.getCurrentController()
+      light = co.owner
+
+      light.energy = 1.0
+      light.color = [1.0, 0.0, 0.0]
+
+   .. data:: SPOT
+
+      A spot light source. See attribute :data:`type`
+
+   .. data:: SUN
+
+      A point light source with no attenuation. See attribute :data:`type`
+
+   .. data:: NORMAL
+
+      A point light source. See attribute :data:`type`
+
+   .. attribute:: type
+
+      The type of light - must be SPOT, SUN or NORMAL
+
+   .. attribute:: layer
+
+      The layer mask that this light affects object on.
+
+      :type: bitfield
+
+   .. attribute:: energy
+
+      The brightness of this light.
+
+      :type: float
+
+   .. attribute:: distance
+
+      The maximum distance this light can illuminate. (SPOT and NORMAL lights only).
+
+      :type: float
+
+   .. attribute:: color
+
+      The color of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
+
+      :type: list [r, g, b]
+
+   .. attribute:: lin_attenuation
+
+      The linear component of this light's attenuation. (SPOT and NORMAL lights only).
+
+      :type: float
+
+   .. attribute:: quad_attenuation
+
+      The quadratic component of this light's attenuation (SPOT and NORMAL lights only).
+
+      :type: float
+
+   .. attribute:: spotsize
+
+      The cone angle of the spot light, in degrees (SPOT lights only).
+
+      :type: float in [0 - 180].
+
+   .. attribute:: spotblend
+
+      Specifies the intensity distribution of the spot light (SPOT lights only).
+
+      :type: float in [0 - 1]
+
+      .. note::
+         
+         Higher values result in a more focused light source.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst b/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst
new file mode 100644
index 0000000..2ec8b8e
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst
@@ -0,0 +1,134 @@
+KX_MeshProxy(SCA_IObject)
+=========================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IObject`
+
+.. class:: KX_MeshProxy(SCA_IObject)
+
+   A mesh object.
+
+   You can only change the vertex properties of a mesh object, not the mesh topology.
+
+   To use mesh objects effectively, you should know a bit about how the game engine handles them.
+
+   #. Mesh Objects are converted from Blender at scene load.
+   #. The Converter groups polygons by Material.  This means they can be sent to the renderer efficiently.  A material holds:
+
+      #. The texture.
+      #. The Blender material.
+      #. The Tile properties
+      #. The face properties - (From the "Texture Face" panel)
+      #. Transparency & z sorting
+      #. Light layer
+      #. Polygon shape (triangle/quad)
+      #. Game Object
+
+   #. Vertices will be split by face if necessary.  Vertices can only be shared between faces if:
+
+      #. They are at the same position
+      #. UV coordinates are the same
+      #. Their normals are the same (both polygons are "Set Smooth")
+      #. They are the same color, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
+
+   The correct method of iterating over every :class:`KX_VertexProxy` in a game object
+   
+   .. code-block:: python
+
+      from bge import logic
+
+      cont = logic.getCurrentController()
+      object = cont.owner
+
+      for mesh in object.meshes:
+         for m_index in range(len(mesh.materials)):
+            for v_index in range(mesh.getVertexArrayLength(m_index)):
+               vertex = mesh.getVertex(m_index, v_index)
+               # Do something with vertex here...
+               # ... eg: color the vertex red.
+               vertex.color = [1.0, 0.0, 0.0, 1.0]
+
+   .. attribute:: materials
+
+      :type: list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
+
+   .. attribute:: numPolygons
+
+      :type: integer
+
+   .. attribute:: numMaterials
+
+      :type: integer
+
+   .. method:: getMaterialName(matid)
+
+      Gets the name of the specified material.
+
+      :arg matid: the specified material.
+      :type matid: integer
+      :return: the attached material name.
+      :rtype: string
+
+   .. method:: getTextureName(matid)
+
+      Gets the name of the specified material's texture.
+
+      :arg matid: the specified material
+      :type matid: integer
+      :return: the attached material's texture name.
+      :rtype: string
+
+   .. method:: getVertexArrayLength(matid)
+
+      Gets the length of the vertex array associated with the specified material.
+
+      There is one vertex array for each material.
+
+      :arg matid: the specified material
+      :type matid: integer
+      :return: the number of verticies in the vertex array.
+      :rtype: integer
+
+   .. method:: getVertex(matid, index)
+
+      Gets the specified vertex from the mesh object.
+
+      :arg matid: the specified material
+      :type matid: integer
+      :arg index: the index into the vertex array.
+      :type index: integer
+      :return: a vertex object.
+      :rtype: :class:`KX_VertexProxy`
+
+   .. method:: getPolygon(index)
+
+      Gets the specified polygon from the mesh.
+
+      :arg index: polygon number
+      :type index: integer
+      :return: a polygon object.
+      :rtype: :class:`PolyProxy`
+
+   .. method:: transform(matid, matrix)
+
+      Transforms the vertices of a mesh.
+
+      :arg matid: material index, -1 transforms all.
+      :type matid: integer
+      :arg matrix: transformation matrix.
+      :type matrix: 4x4 matrix [[float]]
+
+   .. method:: transformUV(matid, matrix, uv_index=-1, uv_index_from=-1)
+
+      Transforms the vertices UV's of a mesh.
+
+      :arg matid: material index, -1 transforms all.
+      :type matid: integer
+      :arg matrix: transformation matrix.
+      :type matrix: 4x4 matrix [[float]]
+      :arg uv_index: optional uv index, -1 for all, otherwise 0 or 1.
+      :type uv_index: integer
+      :arg uv_index_from: optional uv index to copy from, -1 to transform the current uv.
+      :type uv_index_from: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_MouseFocusSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_MouseFocusSensor.rst
new file mode 100644
index 0000000..dda73ea
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_MouseFocusSensor.rst
@@ -0,0 +1,66 @@
+KX_MouseFocusSensor(SCA_MouseSensor)
+====================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_MouseSensor`
+
+.. class:: KX_MouseFocusSensor(SCA_MouseSensor)
+
+   The mouse focus sensor detects when the mouse is over the current game object.
+
+   The mouse focus sensor works by transforming the mouse coordinates from 2d device
+   space to 3d space then raycasting away from the camera.
+
+   .. attribute:: raySource
+
+      The worldspace source of the ray (the view position).
+
+      :type: list (vector of 3 floats)
+
+   .. attribute:: rayTarget
+
+      The worldspace target of the ray.
+
+      :type: list (vector of 3 floats)
+
+   .. attribute:: rayDirection
+
+      The :data:`rayTarget` - :class:`raySource` normalized.
+
+      :type: list (normalized vector of 3 floats)
+
+   .. attribute:: hitObject
+
+      the last object the mouse was over.
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: hitPosition
+
+      The worldspace position of the ray intersecton.
+
+      :type: list (vector of 3 floats)
+
+   .. attribute:: hitNormal
+
+      the worldspace normal from the face at point of intersection.
+
+      :type: list (normalized vector of 3 floats)
+
+   .. attribute:: hitUV
+
+      the UV coordinates at the point of intersection.
+
+      :type: list (vector of 2 floats)
+
+      If the object has no UV mapping, it returns [0, 0].
+
+      The UV coordinates are not normalized, they can be < 0 or > 1 depending on the UV mapping.
+
+   .. attribute:: usePulseFocus
+
+      When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set).
+
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NavMeshObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_NavMeshObject.rst
new file mode 100644
index 0000000..5c73d0a
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_NavMeshObject.rst
@@ -0,0 +1,47 @@
+KX_NavMeshObject(KX_GameObject)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`KX_GameObject`
+
+.. class:: KX_NavMeshObject(KX_GameObject)
+
+   Python interface for using and controlling navigation meshes. 
+
+   .. method:: findPath(start, goal)
+
+      Finds the path from start to goal points.
+
+      :arg start: the start point
+      :arg start: 3D Vector
+      :arg goal: the goal point
+      :arg start: 3D Vector
+      :return: a path as a list of points
+      :rtype: list of points
+
+   .. method:: raycast(start, goal)
+
+      Raycast from start to goal points.
+
+      :arg start: the start point
+      :arg start: 3D Vector
+      :arg goal: the goal point
+      :arg start: 3D Vector
+      :return: the hit factor
+      :rtype: float
+
+   .. method:: draw(mode)
+
+      Draws a debug mesh for the navigation mesh.
+
+      :arg mode: the drawing mode (one of :ref:`these constants <navmesh-draw-mode>`)
+      :arg mode: integer
+      :return: None
+
+   .. method:: rebuild()
+
+      Rebuild the navigation mesh.
+
+      :return: None
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NearSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_NearSensor.rst
new file mode 100644
index 0000000..995e645
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_NearSensor.rst
@@ -0,0 +1,23 @@
+KX_NearSensor(KX_TouchSensor)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`KX_TouchSensor`
+
+.. class:: KX_NearSensor(KX_TouchSensor)
+
+   A near sensor is a specialised form of touch sensor.
+
+   .. attribute:: distance
+
+      The near sensor activates when an object is within this distance.
+
+      :type: float
+
+   .. attribute:: resetDistance
+
+      The near sensor deactivates when the object exceeds this distance.
+
+      :type: float
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageActuator.rst
new file mode 100644
index 0000000..b8dcd01
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageActuator.rst
@@ -0,0 +1,35 @@
+KX_NetworkMessageActuator(SCA_IActuator)
+========================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_NetworkMessageActuator(SCA_IActuator)
+
+   Message Actuator
+
+   .. attribute:: propName
+
+      Messages will only be sent to objects with the given property name.
+
+      :type: string
+
+   .. attribute:: subject
+
+      The subject field of the message.
+
+      :type: string
+
+   .. attribute:: body
+
+      The body of the message.
+
+      :type: string
+
+   .. attribute:: usePropBody
+
+      Send a property instead of a regular body message.
+
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageSensor.rst
new file mode 100644
index 0000000..a6b1082
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageSensor.rst
@@ -0,0 +1,38 @@
+KX_NetworkMessageSensor(SCA_ISensor)
+====================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: KX_NetworkMessageSensor(SCA_ISensor)
+
+   The Message Sensor logic brick.
+
+   Currently only loopback (local) networks are supported.
+
+   .. attribute:: subject
+
+      The subject the sensor is looking for.
+
+      :type: string
+
+   .. attribute:: frameMessageCount
+
+      The number of messages received since the last frame. (read-only).
+
+      :type: integer
+
+   .. attribute:: subjects
+
+      The list of message subjects received. (read-only).
+
+      :type: list of strings
+
+   .. attribute:: bodies
+
+      The list of message bodies received. (read-only).
+
+      :type: list of strings
+
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ObjectActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_ObjectActuator.rst
new file mode 100644
index 0000000..f10f101
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_ObjectActuator.rst
@@ -0,0 +1,129 @@
+KX_ObjectActuator(SCA_IActuator)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_ObjectActuator(SCA_IActuator)
+
+   The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, 
+   velocity, or angular velocity to an object.
+   Servo control allows to regulate force to achieve a certain speed target.
+
+   .. attribute:: force
+
+      The force applied by the actuator.
+
+      :type: list [x, y, z]
+
+   .. attribute:: useLocalForce
+
+      A flag specifying if the force is local.
+
+      :type: boolean
+
+   .. attribute:: torque
+
+      The torque applied by the actuator.
+
+      :type: list [x, y, z]
+
+   .. attribute:: useLocalTorque
+
+      A flag specifying if the torque is local.
+
+      :type: boolean
+
+   .. attribute:: dLoc
+
+      The displacement vector applied by the actuator.
+
+      :type: list [x, y, z]
+
+   .. attribute:: useLocalDLoc
+
+      A flag specifying if the dLoc is local.
+
+      :type: boolean
+
+   .. attribute:: dRot
+
+      The angular displacement vector applied by the actuator
+
+      :type: list [x, y, z]
+      
+      .. note::
+      
+         Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed.
+
+   .. attribute:: useLocalDRot
+
+      A flag specifying if the dRot is local.
+
+      :type: boolean
+
+   .. attribute:: linV
+
+      The linear velocity applied by the actuator.
+
+      :type: list [x, y, z]
+
+   .. attribute:: useLocalLinV
+
+      A flag specifying if the linear velocity is local.
+
+      :type: boolean
+      
+      .. note::
+      
+         This is the target speed for servo controllers.
+
+   .. attribute:: angV
+
+      The angular velocity applied by the actuator.
+
+      :type: list [x, y, z]
+
+   .. attribute:: useLocalAngV
+
+      A flag specifying if the angular velocity is local.
+
+      :type: boolean
+
+   .. attribute:: damping
+
+      The damping parameter of the servo controller.
+
+      :type: short
+
+   .. attribute:: forceLimitX
+
+      The min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
+
+      :type: list [min(float), max(float), bool]
+
+   .. attribute:: forceLimitY
+
+      The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
+
+      :type: list [min(float), max(float), bool]
+
+   .. attribute:: forceLimitZ
+
+      The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
+
+      :type: list [min(float), max(float), bool]
+
+   .. attribute:: pid
+
+      The PID coefficients of the servo controller.
+
+      :type: list of floats [proportional, integral, derivate]
+
+   .. attribute:: reference
+
+      The object that is used as reference to compute the velocity for the servo controller.
+
+      :type: :class:`KX_GameObject` or None
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ParentActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_ParentActuator.rst
new file mode 100644
index 0000000..77dcb90
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_ParentActuator.rst
@@ -0,0 +1,38 @@
+KX_ParentActuator(SCA_IActuator)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_ParentActuator(SCA_IActuator)
+
+   The parent actuator can set or remove an objects parent object.
+
+   .. attribute:: object
+
+      the object this actuator sets the parent too.
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: mode
+
+      The mode of this actuator.
+
+      :type: integer from 0 to 1.
+
+   .. attribute:: compound
+
+      Whether the object shape should be added to the parent compound shape when parenting.
+
+      Effective only if the parent is already a compound shape.
+
+      :type: boolean
+
+   .. attribute:: ghost
+
+      Whether the object should be made ghost when parenting
+      Effective only if the shape is not added to the parent compound shape.
+
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_PolyProxy.rst b/doc/python_api/rst/bge_types/bge.types.KX_PolyProxy.rst
new file mode 100644
index 0000000..534f6de
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_PolyProxy.rst
@@ -0,0 +1,139 @@
+KX_PolyProxy(SCA_IObject)
+=========================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IObject`
+
+.. class:: KX_PolyProxy(SCA_IObject)
+
+   A polygon holds the index of the vertex forming the poylgon.
+
+   Note:
+   The polygon attributes are read-only, you need to retrieve the vertex proxy if you want
+   to change the vertex settings.
+
+   .. attribute:: material_name
+
+      The name of polygon material, empty if no material.
+
+      :type: string
+
+   .. attribute:: material
+
+      The material of the polygon.
+
+      :type: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
+
+   .. attribute:: texture_name
+
+      The texture name of the polygon.
+
+      :type: string
+
+   .. attribute:: material_id
+
+      The material index of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+      :type: integer
+
+   .. attribute:: v1
+
+      vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+      :type: integer
+
+   .. attribute:: v2
+
+      vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+      :type: integer
+
+   .. attribute:: v3
+
+      vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+      :type: integer
+
+   .. attribute:: v4
+
+      Vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
+      Use this to retrieve vertex proxy from mesh proxy.
+
+      :type: integer
+
+   .. attribute:: visible
+
+      visible state of the polygon: 1=visible, 0=invisible.
+
+      :type: integer
+
+   .. attribute:: collide
+
+      collide state of the polygon: 1=receives collision, 0=collision free.
+
+      :type: integer
+
+   .. method:: getMaterialName()
+
+      Returns the polygon material name with MA prefix
+
+      :return: material name
+      :rtype: string
+
+   .. method:: getMaterial()
+
+      :return: The polygon material
+      :rtype: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
+
+   .. method:: getTextureName()
+
+      :return: The texture name
+      :rtype: string
+
+   .. method:: getMaterialIndex()
+
+      Returns the material bucket index of the polygon.
+      This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
+
+      :return: the material index in the mesh
+      :rtype: integer
+
+   .. method:: getNumVertex()
+
+      Returns the number of vertex of the polygon.
+
+      :return: number of vertex, 3 or 4.
+      :rtype: integer
+
+   .. method:: isVisible()
+
+      Returns whether the polygon is visible or not
+
+      :return: 0=invisible, 1=visible
+      :rtype: boolean
+
+   .. method:: isCollider()
+
+      Returns whether the polygon is receives collision or not
+
+      :return: 0=collision free, 1=receives collision
+      :rtype: integer
+
+   .. method:: getVertexIndex(vertex)
+
+      Returns the mesh vertex index of a polygon vertex
+      This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
+
+      :arg vertex: index of the vertex in the polygon: 0->3
+      :arg vertex: integer
+      :return: mesh vertex index
+      :rtype: integer
+
+   .. method:: getMesh()
+
+      Returns a mesh proxy
+
+      :return: mesh proxy
+      :rtype: :class:`MeshProxy`
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_PolygonMaterial.rst b/doc/python_api/rst/bge_types/bge.types.KX_PolygonMaterial.rst
new file mode 100644
index 0000000..3421e19
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_PolygonMaterial.rst
@@ -0,0 +1,250 @@
+KX_PolygonMaterial(PyObjectPlus)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_PolygonMaterial(PyObjectPlus)
+
+   This is the interface to materials in the game engine.
+
+   Materials define the render state to be applied to mesh objects.
+
+   .. warning::
+
+      Some of the methods/variables are CObjects.  If you mix these up, you will crash blender.
+
+   .. code-block:: python
+
+      from bge import logic
+      
+      vertex_shader = """
+      
+      void main(void)
+      {
+         // original vertex position, no changes
+         gl_Position = ftransform();
+         // coordinate of the 1st texture channel
+         gl_TexCoord[0] = gl_MultiTexCoord0;
+         // coordinate of the 2nd texture channel
+         gl_TexCoord[1] = gl_MultiTexCoord1;
+      }
+      """
+      
+      fragment_shader ="""
+
+      uniform sampler2D color_0;
+      uniform sampler2D color_1;
+      uniform float factor;
+
+      void main(void)
+      {
+         vec4 color_0 = texture2D(color_0, gl_TexCoord[0].st);
+         vec4 color_1 = texture2D(color_1, gl_TexCoord[1].st);
+         gl_FragColor = mix(color_0, color_1, factor);
+      }
+      """
+
+      object = logic.getCurrentController().owner
+      object = cont.owner
+      for mesh in object.meshes:
+          for material in mesh.materials:
+              shader = material.getShader()
+              if shader != None:
+                  if not shader.isValid():
+                      shader.setSource(vertex_shader, fragment_shader, True)
+
+                  # get the first texture channel of the material
+                  shader.setSampler('color_0', 0)
+                  # get the second texture channel of the material
+                  shader.setSampler('color_1', 1)
+                  # pass another uniform to the shader
+                  shader.setUniform1f('factor', 0.3)
+
+
+   .. attribute:: texture
+
+      Texture name.
+
+      :type: string (read-only)
+
+   .. attribute:: gl_texture
+
+      OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture).
+
+      :type: integer (read-only)
+
+   .. attribute:: material
+
+      Material name.
+
+      :type: string (read-only)
+
+   .. attribute:: tface
+
+      Texture face properties.
+
+      :type: CObject (read-only)
+
+   .. attribute:: tile
+
+      Texture is tiling.
+
+      :type: boolean
+
+   .. attribute:: tilexrep
+
+      Number of tile repetitions in x direction.
+
+      :type: integer
+
+   .. attribute:: tileyrep
+
+      Number of tile repetitions in y direction.
+
+      :type: integer
+
+   .. attribute:: drawingmode
+
+      Drawing mode for the material.
+      - 2  (drawingmode & 4)     Textured
+      - 4  (drawingmode & 16)    Light
+      - 14 (drawingmode & 16384) 3d Polygon Text.
+
+      :type: bitfield
+
+   .. attribute:: transparent
+
+      This material is transparent. All meshes with this
+      material will be rendered after non transparent meshes from back
+      to front.
+
+      :type: boolean
+
+   .. attribute:: zsort
+
+      Transparent polygons in meshes with this material will be sorted back to
+      front before rendering.
+      Non-Transparent polygons will be sorted front to back before rendering.
+
+      :type: boolean
+
+   .. attribute:: diffuse
+
+      The diffuse color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+
+      :type: list [r, g, b]
+
+   .. attribute:: specular
+
+      The specular color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+
+      :type: list [r, g, b]
+
+   .. attribute:: shininess
+
+      The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0.
+
+      :type: float
+
+   .. attribute:: specularity
+
+      The amount of specular of the material. 0.0 <= specularity <= 1.0.
+
+      :type: float
+
+   .. method:: updateTexture(tface, rasty)
+
+      Updates a realtime animation.
+
+      :arg tface: Texture face (eg mat.tface)
+      :type tface: CObject
+      :arg rasty: Rasterizer
+      :type rasty: CObject
+
+   .. method:: setTexture(tface)
+
+      Sets texture render state.
+
+      :arg tface: Texture face
+      :type tface: CObject
+
+      .. code-block:: python
+
+         mat.setTexture(mat.tface)
+         
+   .. method:: activate(rasty, cachingInfo)
+
+      Sets material parameters for this object for rendering.
+
+      Material Parameters set:
+
+      #. Texture
+      #. Backface culling
+      #. Line drawing
+      #. Specular Colour
+      #. Shininess
+      #. Diffuse Colour
+      #. Polygon Offset.
+
+      :arg rasty: Rasterizer instance.
+      :type rasty: CObject
+      :arg cachingInfo: Material cache instance.
+      :type cachingInfo: CObject
+
+   .. method:: setCustomMaterial(material)
+
+      Sets the material state setup object.
+
+      Using this method, you can extend or completely replace the gameengine material
+      to do your own advanced multipass effects.
+
+      Use this method to register your material class.  Instead of the normal material, 
+      your class's activate method will be called just before rendering the mesh.
+      This should setup the texture, material, and any other state you would like.
+      It should return True to render the mesh, or False if you are finished.  You should
+      clean up any state Blender does not set before returning False.
+
+      Activate Method Definition:
+
+      .. code-block:: python
+      
+         def activate(self, rasty, cachingInfo, material):
+
+      :arg material: The material object.
+      :type material: instance
+
+      .. code-block:: python
+
+         class PyMaterial:
+           def __init__(self):
+             self.pass_no = -1
+           
+           def activate(self, rasty, cachingInfo, material):
+             # Activate the material here.
+             #
+             # The activate method will be called until it returns False.
+             # Every time the activate method returns True the mesh will
+             # be rendered.
+             #
+             # rasty is a CObject for passing to material.updateTexture() 
+             #       and material.activate()
+             # cachingInfo is a CObject for passing to material.activate()
+             # material is the KX_PolygonMaterial instance this material
+             #          was added to
+             
+             # default material properties:
+             self.pass_no += 1
+             if self.pass_no == 0:
+               material.activate(rasty, cachingInfo)
+               # Return True to do this pass
+               return True
+             
+             # clean up and return False to finish.
+             self.pass_no = -1
+             return False
+         
+         # Create a new Python Material and pass it to the renderer.
+         mat.setCustomMaterial(PyMaterial())
+         
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_RadarSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_RadarSensor.rst
new file mode 100644
index 0000000..4274c11
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_RadarSensor.rst
@@ -0,0 +1,44 @@
+KX_RadarSensor(KX_NearSensor)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`KX_NearSensor`
+
+.. class:: KX_RadarSensor(KX_NearSensor)
+
+   Radar sensor is a near sensor with a conical sensor object.
+
+   .. attribute:: coneOrigin
+
+      The origin of the cone with which to test. The origin is in the middle of the cone. (read-only).
+
+      :type: list of floats [x, y, z]
+
+   .. attribute:: coneTarget
+
+      The center of the bottom face of the cone with which to test. (read-only).
+
+      :type: list of floats [x, y, z]
+
+   .. attribute:: distance
+
+      The height of the cone with which to test.
+
+      :type: float
+
+   .. attribute:: angle
+
+      The angle of the cone (in degrees) with which to test.
+
+      :type: float
+
+   .. attribute:: axis
+
+      The axis on which the radar cone is cast.
+
+      :type: integer from 0 to 5
+
+      KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, 
+      KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_RaySensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_RaySensor.rst
new file mode 100644
index 0000000..2ff9897
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_RaySensor.rst
@@ -0,0 +1,72 @@
+KX_RaySensor(SCA_ISensor)
+=========================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: KX_RaySensor(SCA_ISensor)
+
+   A ray sensor detects the first object in a given direction.
+
+   .. attribute:: propName
+
+      The property the ray is looking for.
+
+      :type: string
+
+   .. attribute:: range
+
+      The distance of the ray.
+
+      :type: float
+
+   .. attribute:: useMaterial
+
+      Whether or not to look for a material (false = property).
+
+      :type: boolean
+
+   .. attribute:: useXRay
+
+      Whether or not to use XRay.
+
+      :type: boolean
+
+   .. attribute:: hitObject
+
+      The game object that was hit by the ray. (read-only).
+
+      :type: :class:`KX_GameObject`
+
+   .. attribute:: hitPosition
+
+      The position (in worldcoordinates) where the object was hit by the ray. (read-only).
+
+      :type: list [x, y, z]
+
+   .. attribute:: hitNormal
+
+      The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (read-only).
+
+      :type: list [x, y, z]
+
+   .. attribute:: rayDirection
+
+      The direction from the ray (in worldcoordinates). (read-only).
+
+      :type: list [x, y, z]
+
+   .. attribute:: axis
+
+      The axis the ray is pointing on.
+
+      :type: integer from 0 to 5
+
+      * KX_RAY_AXIS_POS_X
+      * KX_RAY_AXIS_POS_Y
+      * KX_RAY_AXIS_POS_Z
+      * KX_RAY_AXIS_NEG_X
+      * KX_RAY_AXIS_NEG_Y
+      * KX_RAY_AXIS_NEG_Z
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_AddObjectActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_AddObjectActuator.rst
new file mode 100644
index 0000000..fecc863
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_SCA_AddObjectActuator.rst
@@ -0,0 +1,55 @@
+KX_SCA_AddObjectActuator(SCA_IActuator)
+=======================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_SCA_AddObjectActuator(SCA_IActuator)
+
+   Edit Object Actuator (in Add Object Mode)
+
+   .. warning::
+
+      An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer.
+
+      .. code-block:: none
+
+         Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer) 
+      
+   .. attribute:: object
+
+      the object this actuator adds.
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: objectLastCreated
+
+      the last added object from this actuator (read-only).
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: time
+
+      the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
+
+      :type: integer
+
+   .. attribute:: linearVelocity
+
+      the initial linear velocity of added objects.
+
+      :type: list [vx, vy, vz]
+
+   .. attribute:: angularVelocity
+
+      the initial angular velocity of added objects.
+
+      :type: list [vx, vy, vz]
+
+   .. method:: instantAddObject()
+
+      adds the object without needing to calling SCA_PythonController.activate()
+
+      .. note:: Use objectLastCreated to get the newly created object.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_DynamicActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_DynamicActuator.rst
new file mode 100644
index 0000000..055c409
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_SCA_DynamicActuator.rst
@@ -0,0 +1,29 @@
+KX_SCA_DynamicActuator(SCA_IActuator)
+=====================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_SCA_DynamicActuator(SCA_IActuator)
+
+   Dynamic Actuator.
+
+   .. attribute:: mode
+
+      :type: integer
+
+      the type of operation of the actuator, 0-4
+
+      * KX_DYN_RESTORE_DYNAMICS(0)
+      * KX_DYN_DISABLE_DYNAMICS(1)
+      * KX_DYN_ENABLE_RIGID_BODY(2)
+      * KX_DYN_DISABLE_RIGID_BODY(3)
+      * KX_DYN_SET_MASS(4)
+
+   .. attribute:: mass
+
+      the mass value for the KX_DYN_SET_MASS operation.
+
+      :type: float
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_EndObjectActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_EndObjectActuator.rst
new file mode 100644
index 0000000..8d9221f
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_SCA_EndObjectActuator.rst
@@ -0,0 +1,13 @@
+KX_SCA_EndObjectActuator(SCA_IActuator)
+=======================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_SCA_EndObjectActuator(SCA_IActuator)
+
+   Edit Object Actuator (in End Object mode)
+
+   This actuator has no python methods.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst
new file mode 100644
index 0000000..137c63e
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst
@@ -0,0 +1,89 @@
+KX_SCA_ReplaceMeshActuator(SCA_IActuator)
+=========================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_SCA_ReplaceMeshActuator(SCA_IActuator)
+
+   Edit Object actuator, in Replace Mesh mode.
+
+   .. warning::
+
+      Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist.
+
+      This will generate a warning in the console
+
+      .. code-block:: none
+      
+         Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object
+
+   .. code-block:: python
+
+      # Level-of-detail
+      # Switch a game object's mesh based on its depth in the camera view.
+      # +----------+     +-----------+     +-------------------------------------+
+      # | Always   +-----+ Python    +-----+ Edit Object (Replace Mesh) LOD.Mesh |
+      # +----------+     +-----------+     +-------------------------------------+
+      from bge import logic
+
+      # List detail meshes here
+      # Mesh (name, near, far)
+      # Meshes overlap so that they don't 'pop' when on the edge of the distance.
+      meshes = ((".Hi", 0.0, -20.0),
+            (".Med", -15.0, -50.0),
+            (".Lo", -40.0, -100.0)
+          )
+      
+      cont = logic.getCurrentController()
+      object = cont.owner
+      actuator = cont.actuators["LOD." + obj.name]
+      camera = logic.getCurrentScene().active_camera
+      
+      def Depth(pos, plane):
+        return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3]
+      
+      # Depth is negative and decreasing further from the camera
+      depth = Depth(object.position, camera.world_to_camera[2])
+      
+      newmesh = None
+      curmesh = None
+      # Find the lowest detail mesh for depth
+      for mesh in meshes:
+        if depth < mesh[1] and depth > mesh[2]:
+          newmesh = mesh
+        if "ME" + object.name + mesh[0] == actuator.getMesh():
+            curmesh = mesh
+      
+      if newmesh != None and "ME" + object.name + newmesh[0] != actuator.mesh:
+        # The mesh is a different mesh - switch it.
+        # Check the current mesh is not a better fit.
+        if curmesh == None or curmesh[1] < depth or curmesh[2] > depth:
+          actuator.mesh = object.name + newmesh[0]
+          cont.activate(actuator)
+
+   .. attribute:: mesh
+
+      :class:`MeshProxy` or the name of the mesh that will replace the current one.
+   
+      Set to None to disable actuator.
+
+      :type: :class:`MeshProxy` or None if no mesh is set
+
+   .. attribute:: useDisplayMesh
+
+      when true the displayed mesh is replaced.
+
+      :type: boolean
+
+   .. attribute:: usePhysicsMesh
+
+      when true the physics mesh is replaced.
+
+      :type: boolean
+
+   .. method:: instantReplaceMesh()
+
+      Immediately replace mesh without delay.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst b/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst
new file mode 100644
index 0000000..75630ae
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst
@@ -0,0 +1,172 @@
+KX_Scene(PyObjectPlus)
+======================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_Scene(PyObjectPlus)
+
+   An active scene that gives access to objects, cameras, lights and scene attributes.
+
+   The activity culling stuff is supposed to disable logic bricks when their owner gets too far
+   from the active camera.  It was taken from some code lurking at the back of KX_Scene - who knows
+   what it does!
+
+   .. code-block:: python
+
+      from bge import logic
+
+      # get the scene
+      scene = logic.getCurrentScene()
+
+      # print all the objects in the scene
+      for object in scene.objects:
+         print(object.name)
+
+      # get an object named 'Cube'
+      object = scene.objects["Cube"]
+
+      # get the first object in the scene.
+      object = scene.objects[0]
+
+   .. code-block:: python
+
+      # Get the depth of an object in the camera view.
+      from bge import logic
+
+      object = logic.getCurrentController().owner
+      cam = logic.getCurrentScene().active_camera
+
+      # Depth is negative and decreasing further from the camera
+      depth = object.position[0]*cam.world_to_camera[2][0] + object.position[1]*cam.world_to_camera[2][1] + object.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3]
+
+   @bug: All attributes are read only at the moment.
+
+   .. attribute:: name
+
+      The scene's name, (read-only).
+
+      :type: string
+
+   .. attribute:: objects
+
+      A list of objects in the scene, (read-only).
+
+      :type: :class:`CListValue` of :class:`KX_GameObject`
+
+   .. attribute:: objectsInactive
+
+      A list of objects on background layers (used for the addObject actuator), (read-only).
+
+      :type: :class:`CListValue` of :class:`KX_GameObject`
+
+   .. attribute:: lights
+
+      A list of lights in the scene, (read-only).
+
+      :type: :class:`CListValue` of :class:`KX_LightObject`
+
+   .. attribute:: cameras
+
+      A list of cameras in the scene, (read-only).
+
+      :type: :class:`CListValue` of :class:`KX_Camera`
+
+   .. attribute:: active_camera
+
+      The current active camera.
+
+      :type: :class:`KX_Camera`
+      
+      .. note::
+         
+         This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
+
+   .. attribute:: suspended
+
+      True if the scene is suspended, (read-only).
+
+      :type: boolean
+
+   .. attribute:: activity_culling
+
+      True if the scene is activity culling.
+
+      :type: boolean
+
+   .. attribute:: activity_culling_radius
+
+      The distance outside which to do activity culling. Measured in manhattan distance.
+
+      :type: float
+
+   .. attribute:: dbvt_culling
+
+      True when Dynamic Bounding box Volume Tree is set (read-only).
+
+      :type: boolean
+
+   .. attribute:: pre_draw
+
+      A list of callables to be run before the render step.
+
+      :type: list
+
+   .. attribute:: post_draw
+
+      A list of callables to be run after the render step.
+
+      :type: list
+
+   .. attribute:: gravity
+
+      The scene gravity using the world x, y and z axis.
+
+      :type: list [fx, fy, fz]
+
+   .. method:: addObject(object, other, time=0)
+
+      Adds an object to the scene like the Add Object Actuator would.
+
+      :arg object: The object to add
+      :type object: :class:`KX_GameObject` or string
+      :arg other: The object's center to use when adding the object
+      :type other: :class:`KX_GameObject` or string
+      :arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
+      :type time: integer
+      :return: The newly added object.
+      :rtype: :class:`KX_GameObject`
+
+   .. method:: end()
+
+      Removes the scene from the game.
+
+   .. method:: restart()
+
+      Restarts the scene.
+
+   .. method:: replace(scene)
+
+      Replaces this scene with another one.
+
+      :arg scene: The name of the scene to replace this scene with.
+      :type scene: string
+
+   .. method:: suspend()
+
+      Suspends this scene.
+
+   .. method:: resume()
+
+      Resume this scene.
+
+   .. method:: get(key, default=None)
+
+      Return the value matching key, or the default value if its not found.
+      :return: The key value or a default.
+
+   .. method:: drawObstacleSimulation()
+
+      Draw debug visualization of obstacle simulation.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SceneActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SceneActuator.rst
new file mode 100644
index 0000000..9d073ff
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_SceneActuator.rst
@@ -0,0 +1,49 @@
+KX_SceneActuator(SCA_IActuator)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_SceneActuator(SCA_IActuator)
+
+   Scene Actuator logic brick.
+
+   .. warning::
+
+      Scene actuators that use a scene name will be ignored if at game start, the named scene doesn't exist or is empty
+
+      This will generate a warning in the console:
+
+      .. code-block:: none
+      
+         Error: GameObject 'Name' has a SceneActuator 'ActuatorName' (SetScene) without scene
+
+   .. attribute:: scene
+
+      the name of the scene to change to/overlay/underlay/remove/suspend/resume.
+
+      :type: string
+
+   .. attribute:: camera
+
+      the camera to change to.
+
+      :type: :class:`KX_Camera` on read, string or :class:`KX_Camera` on write
+      
+      .. note::
+         
+         When setting the attribute, you can use either a :class:`KX_Camera` or the name of the camera.
+
+   .. attribute:: useRestart
+
+      Set flag to True to restart the sene.
+
+      :type: boolean
+
+   .. attribute:: mode
+
+      The mode of the actuator.
+
+      :type: integer from 0 to 5.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SoundActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SoundActuator.rst
new file mode 100644
index 0000000..aa85bd6
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_SoundActuator.rst
@@ -0,0 +1,115 @@
+KX_SoundActuator(SCA_IActuator)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_SoundActuator(SCA_IActuator)
+
+   Sound Actuator.
+
+   The :data:`startSound`, :data:`pauseSound` and :data:`stopSound` do not require the actuator to be activated - they act instantly provided that the actuator has been activated once at least.
+
+   .. attribute:: volume
+
+      The volume (gain) of the sound.
+
+      :type: float
+
+   .. attribute:: time
+
+      The current position in the audio stream (in seconds).
+
+      :type: float
+
+   .. attribute:: pitch
+
+      The pitch of the sound.
+
+      :type: float
+
+   .. attribute:: mode
+
+      The operation mode of the actuator. Can be one of :ref:`these constants<logic-sound-actuator>`
+
+      :type: integer
+
+   .. attribute:: sound
+
+      The sound the actuator should play.
+
+      :type: Audaspace factory
+
+   .. attribute:: is3D
+
+      Whether or not the actuator should be using 3D sound. (read-only)
+
+      :type: boolean
+
+   .. attribute:: volume_maximum
+
+      The maximum gain of the sound, no matter how near it is.
+
+      :type: float
+
+   .. attribute:: volume_minimum
+
+      The minimum gain of the sound, no matter how far it is away.
+
+      :type: float
+
+   .. attribute:: distance_reference
+
+      The distance where the sound has a gain of 1.0.
+
+      :type: float
+
+   .. attribute:: distance_maximum
+
+      The maximum distance at which you can hear the sound.
+
+      :type: float
+
+   .. attribute:: attenuation
+
+      The influence factor on volume depending on distance.
+
+      :type: float
+
+   .. attribute:: cone_angle_inner
+
+      The angle of the inner cone.
+
+      :type: float
+
+   .. attribute:: cone_angle_outer
+
+      The angle of the outer cone.
+
+      :type: float
+
+   .. attribute:: cone_volume_outer
+
+      The gain outside the outer cone (the gain in the outer cone will be interpolated between this value and the normal gain in the inner cone).
+
+      :type: float
+
+   .. method:: startSound()
+
+      Starts the sound.
+
+      :return: None
+
+   .. method:: pauseSound()
+
+      Pauses the sound.
+
+      :return: None
+
+   .. method:: stopSound()
+
+      Stops the sound.
+
+      :return: None
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_StateActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_StateActuator.rst
new file mode 100644
index 0000000..c9d0845
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_StateActuator.rst
@@ -0,0 +1,29 @@
+KX_StateActuator(SCA_IActuator)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_StateActuator(SCA_IActuator)
+
+   State actuator changes the state mask of parent object.
+
+   .. attribute:: operation
+
+      Type of bit operation to be applied on object state mask.
+      
+      You can use one of :ref:`these constants <state-actuator-operation>`
+
+      :type: integer
+
+   .. attribute:: mask
+
+      Value that defines the bits that will be modified by the operation.
+
+      The bits that are 1 in the mask will be updated in the object state.
+
+      The bits that are 0 are will be left unmodified expect for the Copy operation which copies the mask to the object state.
+
+      :type: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SteeringActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SteeringActuator.rst
new file mode 100644
index 0000000..f0ce248
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_SteeringActuator.rst
@@ -0,0 +1,71 @@
+KX_SteeringActuator(SCA_IActuator)
+==================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_SteeringActuator(SCA_IActuator)
+
+   Steering Actuator for navigation.
+
+   .. attribute:: behavior
+
+      The steering behavior to use.
+
+      :type: one of :ref:`these constants <logic-steering-actuator>`
+
+   .. attribute:: velocity
+
+      Velocity magnitude
+
+      :type: float
+
+   .. attribute:: acceleration
+
+      Max acceleration
+
+      :type: float
+
+   .. attribute:: turnspeed
+
+      Max turn speed
+
+      :type: float
+
+   .. attribute:: distance
+
+      Relax distance
+
+      :type: float
+
+   .. attribute:: target
+
+      Target object
+
+      :type: :class:`KX_GameObject`
+
+   .. attribute:: navmesh
+
+      Navigation mesh
+
+      :type: :class:`KX_GameObject`
+
+   .. attribute:: selfterminated
+
+      Terminate when target is reached
+
+      :type: boolean
+
+   .. attribute:: enableVisualization
+
+      Enable debug visualization
+
+      :type: boolean
+
+   .. attribute:: pathUpdatePeriod
+
+      Path update period
+
+      :type: int
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_TouchSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_TouchSensor.rst
new file mode 100644
index 0000000..fd8f319
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_TouchSensor.rst
@@ -0,0 +1,41 @@
+KX_TouchSensor(SCA_ISensor)
+===========================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: KX_TouchSensor(SCA_ISensor)
+
+   Touch sensor detects collisions between objects.
+
+   .. attribute:: propName
+
+      The property or material to collide with.
+
+      :type: string
+
+   .. attribute:: useMaterial
+
+      Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property.
+
+      :type: boolean
+
+   .. attribute:: usePulseCollision
+
+      When enabled, changes to the set of colliding objects generate a pulse.
+
+      :type: boolean
+
+   .. attribute:: hitObject
+
+      The last collided object. (read-only).
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: hitObjectList
+
+      A list of colliding objects. (read-only).
+
+      :type: :class:`CListValue` of :class:`KX_GameObject`
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst
new file mode 100644
index 0000000..070243c
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst
@@ -0,0 +1,39 @@
+KX_TrackToActuator(SCA_IActuator)
+=================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_TrackToActuator(SCA_IActuator)
+
+   Edit Object actuator in Track To mode.
+
+   .. warning::
+   
+      Track To Actuators will be ignored if at game start, the object to track to is invalid.
+
+      This will generate a warning in the console:
+
+      .. code-block:: none
+
+         GameObject 'Name' no object in EditObjectActuator 'ActuatorName'
+
+   .. attribute:: object
+
+      the object this actuator tracks.
+
+      :type: :class:`KX_GameObject` or None
+
+   .. attribute:: time
+
+      the time in frames with which to delay the tracking motion.
+
+      :type: integer
+
+   .. attribute:: use3D
+
+      the tracking motion to use 3D.
+
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_VehicleWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_VehicleWrapper.rst
new file mode 100644
index 0000000..9340d33
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_VehicleWrapper.rst
@@ -0,0 +1,161 @@
+KX_VehicleWrapper(PyObjectPlus)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_VehicleWrapper(PyObjectPlus)
+
+   KX_VehicleWrapper
+
+   TODO - description
+
+   .. method:: addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
+
+      Add a wheel to the vehicle
+
+      :arg wheel: The object to use as a wheel.
+      :type wheel: :class:`KX_GameObject` or a KX_GameObject name
+      :arg attachPos: The position that this wheel will attach to.
+      :type attachPos: vector of 3 floats
+      :arg attachDir: The direction this wheel points.
+      :type attachDir: vector of 3 floats
+      :arg axleDir: The direction of this wheels axle.
+      :type axleDir: vector of 3 floats
+      :arg suspensionRestLength: TODO - Description
+      :type suspensionRestLength: float
+      :arg wheelRadius: The size of the wheel.
+      :type wheelRadius: float
+
+   .. method:: applyBraking(force, wheelIndex)
+
+      Apply a braking force to the specified wheel
+
+      :arg force: the brake force
+      :type force: float
+
+      :arg wheelIndex: index of the wheel where the force needs to be applied
+      :type wheelIndex: integer
+
+   .. method:: applyEngineForce(force, wheelIndex)
+
+      Apply an engine force to the specified wheel
+
+      :arg force: the engine force
+      :type force: float
+
+      :arg wheelIndex: index of the wheel where the force needs to be applied
+      :type wheelIndex: integer
+
+   .. method:: getConstraintId()
+
+      Get the constraint ID
+
+      :return: the constraint id
+      :rtype: integer
+
+   .. method:: getConstraintType()
+
+      Returns the constraint type.
+
+      :return: constraint type
+      :rtype: integer
+
+   .. method:: getNumWheels()
+
+      Returns the number of wheels.
+
+      :return: the number of wheels for this vehicle
+      :rtype: integer
+
+   .. method:: getWheelOrientationQuaternion(wheelIndex)
+
+      Returns the wheel orientation as a quaternion.
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
+      :return: TODO Description
+      :rtype: TODO - type should be quat as per method name but from the code it looks like a matrix
+
+   .. method:: getWheelPosition(wheelIndex)
+
+      Returns the position of the specified wheel
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+      :return: position vector
+      :rtype: list[x, y, z]
+
+   .. method:: getWheelRotation(wheelIndex)
+
+      Returns the rotation of the specified wheel
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
+      :return: the wheel rotation
+      :rtype: float
+
+   .. method:: setRollInfluence(rollInfluece, wheelIndex)
+
+      Set the specified wheel's roll influence.
+      The higher the roll influence the more the vehicle will tend to roll over in corners.
+
+      :arg rollInfluece: the wheel roll influence
+      :type rollInfluece: float
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
+   .. method:: setSteeringValue(steering, wheelIndex)
+
+      Set the specified wheel's steering
+
+      :arg steering: the wheel steering
+      :type steering: float
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
+   .. method:: setSuspensionCompression(compression, wheelIndex)
+
+      Set the specified wheel's compression
+
+      :arg compression: the wheel compression
+      :type compression: float
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
+   .. method:: setSuspensionDamping(damping, wheelIndex)
+
+      Set the specified wheel's damping
+
+      :arg damping: the wheel damping
+      :type damping: float
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
+   .. method:: setSuspensionStiffness(stiffness, wheelIndex)
+
+      Set the specified wheel's stiffness
+
+      :arg stiffness: the wheel stiffness
+      :type stiffness: float
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
+   .. method:: setTyreFriction(friction, wheelIndex)
+
+      Set the specified wheel's tyre friction
+
+      :arg friction: the tyre friction
+      :type friction: float
+
+      :arg wheelIndex: the wheel index
+      :type wheelIndex: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_VertexProxy.rst b/doc/python_api/rst/bge_types/bge.types.KX_VertexProxy.rst
new file mode 100644
index 0000000..9c0d116
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_VertexProxy.rst
@@ -0,0 +1,209 @@
+KX_VertexProxy(SCA_IObject)
+===========================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IObject`
+
+.. class:: KX_VertexProxy(SCA_IObject)
+
+   A vertex holds position, UV, color and normal information.
+
+   Note:
+   The physics simulation is NOT currently updated - physics will not respond
+   to changes in the vertex position.
+
+   .. attribute:: XYZ
+
+      The position of the vertex.
+
+      :type: list [x, y, z]
+
+   .. attribute:: UV
+
+      The texture coordinates of the vertex.
+
+      :type: list [u, v]
+
+   .. attribute:: normal
+
+      The normal of the vertex.
+
+      :type: list [nx, ny, nz]
+
+   .. attribute:: color
+
+      The color of the vertex.
+
+      :type: list [r, g, b, a]
+
+      Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
+
+   .. attribute:: x
+
+      The x coordinate of the vertex.
+
+      :type: float
+
+   .. attribute:: y
+
+      The y coordinate of the vertex.
+
+      :type: float
+
+   .. attribute:: z
+
+      The z coordinate of the vertex.
+
+      :type: float
+
+   .. attribute:: u
+
+      The u texture coordinate of the vertex.
+
+      :type: float
+
+   .. attribute:: v
+
+      The v texture coordinate of the vertex.
+
+      :type: float
+
+   .. attribute:: u2
+
+      The second u texture coordinate of the vertex.
+
+      :type: float
+
+   .. attribute:: v2
+
+      The second v texture coordinate of the vertex.
+
+      :type: float
+
+   .. attribute:: r
+
+      The red component of the vertex color. 0.0 <= r <= 1.0.
+
+      :type: float
+
+   .. attribute:: g
+
+      The green component of the vertex color. 0.0 <= g <= 1.0.
+
+      :type: float
+
+   .. attribute:: b
+
+      The blue component of the vertex color. 0.0 <= b <= 1.0.
+
+      :type: float
+
+   .. attribute:: a
+
+      The alpha component of the vertex color. 0.0 <= a <= 1.0.
+
+      :type: float
+
+   .. method:: getXYZ()
+
+      Gets the position of this vertex.
+
+      :return: this vertexes position in local coordinates.
+      :rtype: list [x, y, z]
+
+   .. method:: setXYZ(pos)
+
+      Sets the position of this vertex.
+
+      :type:  list [x, y, z]
+
+      :arg pos: the new position for this vertex in local coordinates.
+
+   .. method:: getUV()
+
+      Gets the UV (texture) coordinates of this vertex.
+
+      :return: this vertexes UV (texture) coordinates.
+      :rtype: list [u, v]
+
+   .. method:: setUV(uv)
+
+      Sets the UV (texture) coordinates of this vertex.
+
+      :type:  list [u, v]
+
+   .. method:: getUV2()
+
+      Gets the 2nd UV (texture) coordinates of this vertex.
+
+      :return: this vertexes UV (texture) coordinates.
+      :rtype: list [u, v]
+
+   .. method:: setUV2(uv, unit)
+
+      Sets the 2nd UV (texture) coordinates of this vertex.
+
+      :type:  list [u, v]
+
+      :arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
+      :arg unit:  integer
+
+   .. method:: getRGBA()
+
+      Gets the color of this vertex.
+
+      The color is represented as four bytes packed into an integer value.  The color is
+      packed as RGBA.
+
+      Since Python offers no way to get each byte without shifting, you must use the struct module to
+      access color in an machine independent way.
+
+      Because of this, it is suggested you use the r, g, b and a attributes or the color attribute instead.
+
+      .. code-block:: python
+
+         import struct;
+         col = struct.unpack('4B', struct.pack('I', v.getRGBA()))
+         # col = (r, g, b, a)
+         # black = (  0, 0, 0, 255)
+         # white = (255, 255, 255, 255)
+
+      :return: packed color. 4 byte integer with one byte per color channel in RGBA format.
+      :rtype: integer
+
+   .. method:: setRGBA(col)
+
+      Sets the color of this vertex.
+
+      See getRGBA() for the format of col, and its relevant problems.  Use the r, g, b and a attributes
+      or the color attribute instead.
+
+      setRGBA() also accepts a four component list as argument col.  The list represents the color as [r, g, b, a]
+      with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0]
+
+      .. code-block:: python
+
+         v.setRGBA(0xff0000ff) # Red
+         v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian
+         v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red
+         v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms.
+
+      :arg col: the new color of this vertex in packed RGBA format.
+      :type col: integer or list [r, g, b, a]
+
+   .. method:: getNormal()
+
+      Gets the normal vector of this vertex.
+
+      :return: normalized normal vector.
+      :rtype: list [nx, ny, nz]
+
+   .. method:: setNormal(normal)
+
+      Sets the normal vector of this vertex.
+
+      :type:  sequence of floats [r, g, b]
+
+      :arg normal: the new normal of this vertex.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_VisibilityActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_VisibilityActuator.rst
new file mode 100644
index 0000000..4beb653
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_VisibilityActuator.rst
@@ -0,0 +1,29 @@
+KX_VisibilityActuator(SCA_IActuator)
+====================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_VisibilityActuator(SCA_IActuator)
+
+   Visibility Actuator.
+
+   .. attribute:: visibility
+
+      whether the actuator makes its parent object visible or invisible.
+
+      :type: boolean
+
+   .. attribute:: useOcclusion
+
+      whether the actuator makes its parent object an occluder or not.
+
+      :type: boolean
+
+   .. attribute:: useRecursion
+
+      whether the visibility/occlusion should be propagated to all children of the object.
+
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.PyObjectPlus.rst b/doc/python_api/rst/bge_types/bge.types.PyObjectPlus.rst
new file mode 100644
index 0000000..e035f45
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.PyObjectPlus.rst
@@ -0,0 +1,21 @@
+PyObjectPlus
+============
+
+.. module:: bge.types
+
+.. class:: PyObjectPlus
+
+   PyObjectPlus base class of most other types in the Game Engine.
+
+   .. attribute:: invalid
+
+      Test if the object has been freed by the game engine and is no longer valid.
+       
+      Normally this is not a problem but when storing game engine data in the GameLogic module, 
+      KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data.
+      Calling an attribute or method on an invalid object will raise a SystemError.
+       
+      The invalid attribute allows testing for this case without exception handling.
+
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_2DFilterActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_2DFilterActuator.rst
new file mode 100644
index 0000000..291ee84
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_2DFilterActuator.rst
@@ -0,0 +1,49 @@
+SCA_2DFilterActuator(SCA_IActuator)
+===================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: SCA_2DFilterActuator(SCA_IActuator)
+
+   Create, enable and disable 2D filters
+
+   The following properties don't have an immediate effect.
+   You must active the actuator to get the result.
+   The actuator is not persistent: it automatically stops itself after setting up the filter
+   but the filter remains active. To stop a filter you must activate the actuator with 'type'
+   set to :data:`~bge.logic.RAS_2DFILTER_DISABLED` or :data:`~bge.logic.RAS_2DFILTER_NOFILTER`.
+
+   .. attribute:: shaderText
+
+      shader source code for custom shader.
+
+      :type: string
+
+   .. attribute:: disableMotionBlur
+
+      action on motion blur: 0=enable, 1=disable.
+
+      :type: integer
+
+   .. attribute:: mode
+
+      Type of 2D filter, use one of :ref:`these constants <Two-D-FilterActuator-mode>`
+
+      :type: integer
+
+   .. attribute:: passNumber
+
+      order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb.
+
+      Only be one filter can be defined per passNb.
+
+      :type: integer (0-100)
+
+   .. attribute:: value
+
+      argument for motion blur filter.
+
+      :type: float (0.0-100.0)
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ANDController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ANDController.rst
new file mode 100644
index 0000000..0942f71
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_ANDController.rst
@@ -0,0 +1,13 @@
+SCA_ANDController(SCA_IController)
+==================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IController`
+
+.. class:: SCA_ANDController(SCA_IController)
+
+   An AND controller activates only when all linked sensors are activated.
+
+   There are no special python methods for this controller.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ActuatorSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ActuatorSensor.rst
new file mode 100644
index 0000000..5491638
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_ActuatorSensor.rst
@@ -0,0 +1,19 @@
+SCA_ActuatorSensor(SCA_ISensor)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_ActuatorSensor(SCA_ISensor)
+
+   Actuator sensor detect change in actuator state of the parent object.
+   It generates a positive pulse if the corresponding actuator is activated
+   and a negative pulse if the actuator is deactivated.
+
+   .. attribute:: actuator
+
+      the name of the actuator that the sensor is monitoring.
+
+      :type: string
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_AlwaysSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_AlwaysSensor.rst
new file mode 100644
index 0000000..a217b11
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_AlwaysSensor.rst
@@ -0,0 +1,11 @@
+SCA_AlwaysSensor(SCA_ISensor)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_AlwaysSensor(SCA_ISensor)
+
+   This sensor is always activated.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_DelaySensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_DelaySensor.rst
new file mode 100644
index 0000000..ce2b8e5
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_DelaySensor.rst
@@ -0,0 +1,39 @@
+SCA_DelaySensor(SCA_ISensor)
+============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_DelaySensor(SCA_ISensor)
+
+   The Delay sensor generates positive and negative triggers at precise time, 
+   expressed in number of frames. The delay parameter defines the length of the initial OFF period. A positive trigger is generated at the end of this period.
+
+   The duration parameter defines the length of the ON period following the OFF period.
+   There is a negative trigger at the end of the ON period. If duration is 0, the sensor stays ON and there is no negative trigger.
+
+   The sensor runs the OFF-ON cycle once unless the repeat option is set: the OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0).
+
+   Use :class:`SCA_ISensor.reset` at any time to restart sensor.
+
+   .. attribute:: delay
+
+      length of the initial OFF period as number of frame, 0 for immediate trigger.
+
+      :type: integer.
+
+   .. attribute:: duration
+
+      length of the ON period in number of frame after the initial OFF period.
+
+      If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
+
+      :type: integer
+
+   .. attribute:: repeat
+
+      1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
+
+      :type: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_IActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_IActuator.rst
new file mode 100644
index 0000000..1432d51
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_IActuator.rst
@@ -0,0 +1,11 @@
+SCA_IActuator(SCA_ILogicBrick)
+==============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ILogicBrick`
+
+.. class:: SCA_IActuator(SCA_ILogicBrick)
+
+   Base class for all actuator logic bricks.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_IController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_IController.rst
new file mode 100644
index 0000000..5eb225e
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_IController.rst
@@ -0,0 +1,55 @@
+SCA_IController(SCA_ILogicBrick)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ILogicBrick`
+
+.. class:: SCA_IController(SCA_ILogicBrick)
+
+   Base class for all controller logic bricks.
+
+   .. attribute:: state
+
+      The controllers state bitmask. This can be used with the GameObject's state to test if the controller is active.
+      
+      :type: int bitmask
+
+   .. attribute:: sensors
+
+      A list of sensors linked to this controller.
+      
+      :type: sequence supporting index/string lookups and iteration.
+
+      .. note::
+
+         The sensors are not necessarily owned by the same object.
+
+      .. note::
+         
+         When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+
+   .. attribute:: actuators
+
+      A list of actuators linked to this controller.
+      
+      :type: sequence supporting index/string lookups and iteration.
+
+      .. note::
+
+         The sensors are not necessarily owned by the same object.
+
+      .. note::
+         
+         When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+
+   .. attribute:: useHighPriority
+
+      When set the controller executes always before all other controllers that dont have this set.
+      
+      :type: boolen
+
+      .. note::
+         
+         Order of execution between high priority controllers is not guaranteed.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ILogicBrick.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ILogicBrick.rst
new file mode 100644
index 0000000..5ed44c4
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_ILogicBrick.rst
@@ -0,0 +1,29 @@
+SCA_ILogicBrick(CValue)
+=======================
+
+.. module:: bge.types
+
+base class --- :class:`CValue`
+
+.. class:: SCA_ILogicBrick(CValue)
+
+   Base class for all logic bricks.
+
+   .. attribute:: executePriority
+
+      This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
+
+      :type: executePriority: int
+
+   .. attribute:: owner
+
+      The game object this logic brick is attached to (read-only).
+      
+      :type: :class:`KX_GameObject` or None in exceptional cases.
+
+   .. attribute:: name
+
+      The name of this logic brick (read-only).
+      
+      :type: string
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_IObject.rst b/doc/python_api/rst/bge_types/bge.types.SCA_IObject.rst
new file mode 100644
index 0000000..2206594
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_IObject.rst
@@ -0,0 +1,11 @@
+SCA_IObject(CValue)
+===================
+
+.. module:: bge.types
+
+base class --- :class:`CValue`
+
+.. class:: SCA_IObject(CValue)
+
+   This class has no python functions
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst
new file mode 100644
index 0000000..9efd2e2
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst
@@ -0,0 +1,95 @@
+SCA_ISensor(SCA_ILogicBrick)
+============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ILogicBrick`
+
+.. class:: SCA_ISensor(SCA_ILogicBrick)
+
+   Base class for all sensor logic bricks.
+
+   .. attribute:: usePosPulseMode
+
+      Flag to turn positive pulse mode on and off.
+      
+      :type: boolean
+
+   .. attribute:: useNegPulseMode
+
+      Flag to turn negative pulse mode on and off.
+      
+      :type: boolean
+
+   .. attribute:: frequency
+
+      The frequency for pulse mode sensors.
+      
+      :type: integer
+
+   .. attribute:: level
+
+      level Option whether to detect level or edge transition when entering a state.
+      It makes a difference only in case of logic state transition (state actuator).
+      A level detector will immediately generate a pulse, negative or positive
+      depending on the sensor condition, as soon as the state is activated.
+      A edge detector will wait for a state change before generating a pulse.
+      note: mutually exclusive with :data:`tap`, enabling will disable :data:`tap`.
+
+      :type: boolean
+
+   .. attribute:: tap
+
+      When enabled only sensors that are just activated will send a positive event, 
+      after this they will be detected as negative by the controllers.
+      This will make a key thats held act as if its only tapped for an instant.
+      note: mutually exclusive with :data:`level`, enabling will disable :data:`level`.
+
+      :type: boolean
+
+   .. attribute:: invert
+
+      Flag to set if this sensor activates on positive or negative events.
+      
+      :type: boolean
+
+   .. attribute:: triggered
+
+      True if this sensor brick is in a positive state. (read-only).
+     
+      :type: boolean
+
+   .. attribute:: positive
+
+      True if this sensor brick is in a positive state. (read-only).
+      
+      :type: boolean
+
+   .. attribute:: pos_ticks
+
+      The number of ticks since the last positive pulse (read-only).
+      
+      :type: int
+
+   .. attribute:: neg_ticks
+
+      The number of ticks since the last negative pulse (read-only).
+      
+      :type: int
+
+   .. attribute:: status
+
+      The status of the sensor (read-only): can be one of :ref:`these constants<sensor-status>`.
+
+      :type: int
+
+      .. note::
+      
+         This convenient attribute combines the values of triggered and positive attributes.
+
+   .. method:: reset()
+
+      Reset sensor internal state, effect depends on the type of sensor and settings.
+
+      The sensor is put in its initial state as if it was just activated.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_JoystickSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_JoystickSensor.rst
new file mode 100644
index 0000000..5b6628f
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_JoystickSensor.rst
@@ -0,0 +1,133 @@
+SCA_JoystickSensor(SCA_ISensor)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_JoystickSensor(SCA_ISensor)
+
+   This sensor detects player joystick events.
+
+   .. attribute:: axisValues
+
+      The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only).
+
+      :type: list of ints.
+
+      Each specifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
+      The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
+
+      * left:[-32767, 0, ...]
+      * right:[32767, 0, ...]
+      * up:[0, -32767, ...]
+      * down:[0, 32767, ...]
+
+   .. attribute:: axisSingle
+
+      like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only).
+
+      :type: integer
+
+      .. note::
+         
+         Only use this for "Single Axis" type sensors otherwise it will raise an error.
+
+   .. attribute:: hatValues
+
+      The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).
+
+      :type: list of ints
+
+      Each specifying the direction of the hat from 1 to 12, 0 when inactive.
+
+      Hat directions are as follows...
+
+      * 0:None
+      * 1:Up
+      * 2:Right
+      * 4:Down
+      * 8:Left
+      * 3:Up - Right
+      * 6:Down - Right
+      * 12:Down - Left
+      * 9:Up - Left
+
+   .. attribute:: hatSingle
+
+      Like :data:`hatValues` but returns a single hat direction value that is set by the sensor. (read-only).
+
+      :type: integer
+
+   .. attribute:: numAxis
+
+      The number of axes for the joystick at this index. (read-only).
+
+      :type: integer
+
+   .. attribute:: numButtons
+
+      The number of buttons for the joystick at this index. (read-only).
+
+      :type: integer
+
+   .. attribute:: numHats
+
+      The number of hats for the joystick at this index. (read-only).
+
+      :type: integer
+
+   .. attribute:: connected
+
+      True if a joystick is connected at this joysticks index. (read-only).
+
+      :type: boolean
+
+   .. attribute:: index
+
+      The joystick index to use (from 0 to 7). The first joystick is always 0.
+
+      :type: integer
+
+   .. attribute:: threshold
+
+      Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive.
+
+      :type: integer
+
+   .. attribute:: button
+
+      The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect.
+
+      :type: integer
+
+   .. attribute:: axis
+
+      The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection]
+
+      * axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control.
+      * axisDirection: 0=right, 1=up, 2=left, 3=down.
+
+      :type: [integer, integer]
+
+   .. attribute:: hat
+
+      The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection]
+
+      * hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max).
+      * hatDirection: 1-12.
+
+      :type: [integer, integer]
+
+   .. method:: getButtonActiveList()
+
+      :return: A list containing the indicies of the currently pressed buttons.
+      :rtype: list
+
+   .. method:: getButtonStatus(buttonIndex)
+
+      :arg buttonIndex: the button index, 0=first button
+      :type buttonIndex: integer
+      :return: The current pressed state of the specified button.
+      :rtype: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_KeyboardSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_KeyboardSensor.rst
new file mode 100644
index 0000000..9161306
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_KeyboardSensor.rst
@@ -0,0 +1,64 @@
+SCA_KeyboardSensor(SCA_ISensor)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_KeyboardSensor(SCA_ISensor)
+
+   A keyboard sensor detects player key presses.
+
+   See module :mod:`bge.events` for keycode values.
+
+   .. attribute:: key
+
+      The key code this sensor is looking for.
+
+      :type: keycode from :mod:`bge.events` module
+
+   .. attribute:: hold1
+
+      The key code for the first modifier this sensor is looking for.
+
+      :type: keycode from :mod:`bge.events` module
+
+   .. attribute:: hold2
+
+      The key code for the second modifier this sensor is looking for.
+
+      :type: keycode from :mod:`bge.events` module
+
+   .. attribute:: toggleProperty
+
+      The name of the property that indicates whether or not to log keystrokes as a string.
+
+      :type: string
+
+   .. attribute:: targetProperty
+
+      The name of the property that receives keystrokes in case in case a string is logged.
+
+      :type: string
+
+   .. attribute:: useAllKeys
+
+      Flag to determine whether or not to accept all keys.
+
+      :type: boolean
+
+   .. attribute:: events
+
+      a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
+
+      :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...]
+
+   .. method:: getKeyStatus(keycode)
+
+      Get the status of a key.
+
+      :arg keycode: The code that represents the key you want to get the state of, use one of :ref:`these constants<keyboard-keys>`
+      :type keycode: integer
+      :return: The state of the given key, can be one of :ref:`these constants<input-status>`
+      :rtype: int
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_MouseSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_MouseSensor.rst
new file mode 100644
index 0000000..bbc695e
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_MouseSensor.rst
@@ -0,0 +1,39 @@
+SCA_MouseSensor(SCA_ISensor)
+============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_MouseSensor(SCA_ISensor)
+
+   Mouse Sensor logic brick.
+
+   .. attribute:: position
+
+      current [x, y] coordinates of the mouse, in frame coordinates (pixels).
+
+      :type: [integer, interger]
+
+   .. attribute:: mode
+
+      sensor mode.
+
+      :type: integer
+
+         * KX_MOUSESENSORMODE_LEFTBUTTON(1)
+         * KX_MOUSESENSORMODE_MIDDLEBUTTON(2)
+         * KX_MOUSESENSORMODE_RIGHTBUTTON(3)
+         * KX_MOUSESENSORMODE_WHEELUP(4)
+         * KX_MOUSESENSORMODE_WHEELDOWN(5)
+         * KX_MOUSESENSORMODE_MOVEMENT(6)
+
+   .. method:: getButtonStatus(button)
+
+      Get the mouse button status.
+ 
+      :arg button: The code that represents the key you want to get the state of, use one of :ref:`these constants<mouse-keys>`
+      :type button: int
+      :return: The state of the given key, can be one of :ref:`these constants<input-status>`
+      :rtype: int
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_NANDController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_NANDController.rst
new file mode 100644
index 0000000..4bd67fb
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_NANDController.rst
@@ -0,0 +1,13 @@
+SCA_NANDController(SCA_IController)
+===================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IController`
+
+.. class:: SCA_NANDController(SCA_IController)
+
+   An NAND controller activates when all linked sensors are not active.
+
+   There are no special python methods for this controller.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_NORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_NORController.rst
new file mode 100644
index 0000000..5a567c8
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_NORController.rst
@@ -0,0 +1,13 @@
+SCA_NORController(SCA_IController)
+==================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IController`
+
+.. class:: SCA_NORController(SCA_IController)
+
+   An NOR controller activates only when all linked sensors are de-activated.
+
+   There are no special python methods for this controller.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ORController.rst
new file mode 100644
index 0000000..ed57b0d
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_ORController.rst
@@ -0,0 +1,13 @@
+SCA_ORController(SCA_IController)
+=================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IController`
+
+.. class:: SCA_ORController(SCA_IController)
+
+   An OR controller activates when any connected sensor activates.
+
+   There are no special python methods for this controller.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PropertyActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PropertyActuator.rst
new file mode 100644
index 0000000..36a4ea7
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_PropertyActuator.rst
@@ -0,0 +1,29 @@
+SCA_PropertyActuator(SCA_IActuator)
+===================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: SCA_PropertyActuator(SCA_IActuator)
+
+   Property Actuator
+
+   .. attribute:: propName
+
+      the property on which to operate.
+
+      :type: string
+
+   .. attribute:: value
+
+      the value with which the actuator operates.
+
+      :type: string
+
+   .. attribute:: mode
+
+      TODO - add constants to game logic dict!.
+
+      :type: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PropertySensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PropertySensor.rst
new file mode 100644
index 0000000..3c41e46
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_PropertySensor.rst
@@ -0,0 +1,41 @@
+SCA_PropertySensor(SCA_ISensor)
+===============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_PropertySensor(SCA_ISensor)
+
+   Activates when the game object property matches.
+
+   .. attribute:: mode
+
+      Type of check on the property. Can be one of :ref:`these constants <logic-property-sensor>`
+
+      :type: integer.
+
+   .. attribute:: propName
+
+      the property the sensor operates.
+
+      :type: string
+
+   .. attribute:: value
+
+      the value with which the sensor compares to the value of the property.
+
+      :type: string
+
+   .. attribute:: min
+
+      the minimum value of the range used to evaluate the property when in interval mode.
+
+      :type: string
+
+   .. attribute:: max
+
+      the maximum value of the range used to evaluate the property when in interval mode.
+
+      :type: string
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonController.rst
new file mode 100644
index 0000000..a00e9c2
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_PythonController.rst
@@ -0,0 +1,48 @@
+SCA_PythonController(SCA_IController)
+=====================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IController`
+
+.. class:: SCA_PythonController(SCA_IController)
+
+   A Python controller uses a Python script to activate it's actuators, 
+   based on it's sensors.
+
+   .. attribute:: script
+
+      The value of this variable depends on the execution methid.
+
+      * When 'Script' execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts.
+      * When 'Module' execution mode is set this value will contain a single line string - module name and function "module.func" or "package.modile.func" where the module names are python textblocks or external scripts.
+
+      :type: string
+      
+      .. note::
+      
+         Once this is set the script name given for warnings will remain unchanged.
+
+   .. attribute:: mode
+
+      the execution mode for this controller (read-only).
+
+      * Script: 0, Execite the :data:`script` as a python code.
+      * Module: 1, Execite the :data:`script` as a module and function.
+
+      :type: integer
+
+   .. method:: activate(actuator)
+
+      Activates an actuator attached to this controller.
+
+      :arg actuator: The actuator to operate on.
+      :type actuator: actuator or the actuator name as a string
+
+   .. method:: deactivate(actuator)
+
+      Deactivates an actuator attached to this controller.
+
+      :arg actuator: The actuator to operate on.
+      :type actuator: actuator or the actuator name as a string
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst
new file mode 100644
index 0000000..2b97b59
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst
@@ -0,0 +1,75 @@
+SCA_PythonJoystick(PyObjectPlus)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: SCA_PythonJoystick(PyObjectPlus)
+
+   A Python interface to a joystick.
+
+   .. attribute:: name
+
+      The name assigned to the joystick by the operating system. (read-only)
+	  
+      :type: string
+
+   .. attribute:: activeButtons
+
+      A list of active button values. (read-only)
+	  
+      :type: list
+
+   .. attribute:: axisValues
+
+      The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only).
+
+      :type: list of ints.
+
+      Each specifying the value of an axis between -1.0 and 1.0 depending on how far the axis is pushed, 0 for nothing.
+      The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
+
+      * left:[-1.0, 0.0, ...]
+      * right:[1.0, 0.0, ...]
+      * up:[0.0, -1.0, ...]
+      * down:[0.0, 1.0, ...]
+
+   .. attribute:: hatValues
+
+      The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).
+
+      :type: list of ints
+
+      Each specifying the direction of the hat from 1 to 12, 0 when inactive.
+
+      Hat directions are as follows...
+
+      * 0:None
+      * 1:Up
+      * 2:Right
+      * 4:Down
+      * 8:Left
+      * 3:Up - Right
+      * 6:Down - Right
+      * 12:Down - Left
+      * 9:Up - Left
+
+   .. attribute:: numAxis
+
+      The number of axes for the joystick at this index. (read-only).
+
+      :type: integer
+
+   .. attribute:: numButtons
+
+      The number of buttons for the joystick at this index. (read-only).
+
+      :type: integer
+
+   .. attribute:: numHats
+
+      The number of hats for the joystick at this index. (read-only).
+
+      :type: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonKeyboard.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonKeyboard.rst
new file mode 100644
index 0000000..6cfef2f
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_PythonKeyboard.rst
@@ -0,0 +1,37 @@
+SCA_PythonKeyboard(PyObjectPlus)
+================================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: SCA_PythonKeyboard(PyObjectPlus)
+
+   The current keyboard.
+
+   .. attribute:: events
+
+      A dictionary containing the status of each keyboard event or key. (read-only).
+
+      :type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...}
+
+   .. attribute:: active_events
+
+      A dictionary containing the status of only the active keyboard events or keys. (read-only).
+
+      :type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...}
+
+
+   .. function:: getClipboard()
+
+      Gets the clipboard text.
+
+      :rtype: string
+
+   .. function:: setClipboard(text)
+
+      Sets the clipboard text.
+
+      :arg text: New clipboard text
+      :type text: string
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonMouse.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonMouse.rst
new file mode 100644
index 0000000..b1c6e5d
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_PythonMouse.rst
@@ -0,0 +1,35 @@
+SCA_PythonMouse(PyObjectPlus)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: SCA_PythonMouse(PyObjectPlus)
+
+   The current mouse.
+
+   .. attribute:: events
+
+      a dictionary containing the status of each mouse event. (read-only).
+
+      :type: dictionary {:ref:`keycode<mouse-keys>`::ref:`status<input-status>`, ...}
+
+   .. attribute:: active_events
+
+      a dictionary containing the status of only the active mouse events. (read-only).
+
+      :type: dictionary {:ref:`keycode<mouse-keys>`::ref:`status<input-status>`, ...}
+      
+   .. attribute:: position
+
+      The normalized x and y position of the mouse cursor.
+
+      :type: list [x, y]
+
+   .. attribute:: visible
+
+      The visibility of the mouse cursor.
+      
+      :type: boolean
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_RandomActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_RandomActuator.rst
new file mode 100644
index 0000000..6835722
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_RandomActuator.rst
@@ -0,0 +1,127 @@
+SCA_RandomActuator(SCA_IActuator)
+=================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: SCA_RandomActuator(SCA_IActuator)
+
+   Random Actuator
+
+   .. attribute:: seed
+
+      Seed of the random number generator.
+
+      :type: integer.
+
+      Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call.
+
+   .. attribute:: para1
+
+      the first parameter of the active distribution.
+
+      :type: float, read-only.
+
+      Refer to the documentation of the generator types for the meaning of this value. 
+
+   .. attribute:: para2
+
+      the second parameter of the active distribution.
+
+      :type: float, read-only
+
+      Refer to the documentation of the generator types for the meaning of this value.
+
+   .. attribute:: distribution
+
+      Distribution type. (read-only). Can be one of :ref:`these constants <logic-random-distributions>`
+
+      :type: integer
+
+   .. attribute:: propName
+
+      the name of the property to set with the random value.
+
+      :type: string
+
+      If the generator and property types do not match, the assignment is ignored.
+
+   .. method:: setBoolConst(value)
+
+      Sets this generator to produce a constant boolean value.
+
+      :arg value: The value to return.
+      :type value: boolean
+
+   .. method:: setBoolUniform()
+
+      Sets this generator to produce a uniform boolean distribution.
+
+      The generator will generate True or False with 50% chance.
+
+   .. method:: setBoolBernouilli(value)
+
+      Sets this generator to produce a Bernouilli distribution.
+
+      :arg value: Specifies the proportion of False values to produce.
+
+         * 0.0: Always generate True
+         * 1.0: Always generate False
+      :type value: float
+
+   .. method:: setIntConst(value)
+
+      Sets this generator to always produce the given value.
+
+      :arg value: the value this generator produces.
+      :type value: integer
+
+   .. method:: setIntUniform(lower_bound, upper_bound)
+
+      Sets this generator to produce a random value between the given lower and
+      upper bounds (inclusive).
+
+      :type lower_bound: integer
+      :type upper_bound: integer
+
+   .. method:: setIntPoisson(value)
+
+      Generate a Poisson-distributed number.
+
+      This performs a series of Bernouilli tests with parameter value.
+      It returns the number of tries needed to achieve succes.
+
+      :type value: float
+
+   .. method:: setFloatConst(value)
+
+      Always generate the given value.
+
+      :type value: float
+
+   .. method:: setFloatUniform(lower_bound, upper_bound)
+
+      Generates a random float between lower_bound and upper_bound with a
+      uniform distribution.
+
+      :type lower_bound: float
+      :type upper_bound: float
+
+   .. method:: setFloatNormal(mean, standard_deviation)
+
+      Generates a random float from the given normal distribution.
+
+      :arg mean: The mean (average) value of the generated numbers
+      :type mean: float
+      :arg standard_deviation: The standard deviation of the generated numbers.
+      :type standard_deviation: float
+
+   .. method:: setFloatNegativeExponential(half_life)
+
+      Generate negative-exponentially distributed numbers.
+
+      The half-life 'time' is characterized by half_life.
+      
+      :type half_life: float
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_RandomSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_RandomSensor.rst
new file mode 100644
index 0000000..05e61cc
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_RandomSensor.rst
@@ -0,0 +1,23 @@
+SCA_RandomSensor(SCA_ISensor)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_ISensor`
+
+.. class:: SCA_RandomSensor(SCA_ISensor)
+
+   This sensor activates randomly.
+
+   .. attribute:: lastDraw
+
+      The seed of the random number generator.
+
+      :type: integer
+
+   .. attribute:: seed
+
+      The seed of the random number generator.
+
+      :type: integer
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_XNORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_XNORController.rst
new file mode 100644
index 0000000..d0235f2
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_XNORController.rst
@@ -0,0 +1,13 @@
+SCA_XNORController(SCA_IController)
+===================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IController`
+
+.. class:: SCA_XNORController(SCA_IController)
+
+   An XNOR controller activates when all linked sensors are the same (activated or inative).
+
+   There are no special python methods for this controller.
+
diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_XORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_XORController.rst
new file mode 100644
index 0000000..98ccf14
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_XORController.rst
@@ -0,0 +1,13 @@
+SCA_XORController(SCA_IController)
+==================================
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IController`
+
+.. class:: SCA_XORController(SCA_IController)
+
+   An XOR controller activates when there is the input is mixed, but not when all are on or off.
+
+   There are no special python methods for this controller.
+
diff --git a/doc/python_api/rst/info_tutorial_addon.rst b/doc/python_api/rst/info_tutorial_addon.rst
index 2a10104..5637cf2 100644
--- a/doc/python_api/rst/info_tutorial_addon.rst
+++ b/doc/python_api/rst/info_tutorial_addon.rst
@@ -486,16 +486,14 @@ using :kbd:`Ctrl-Shift-Space` as the key shortcut to activate it.
        kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
        kmi.properties.total = 4
 
-       addon_keymaps.append(km)
+       addon_keymaps.append((km, kmi))
 
 
    def unregister():
 
        # handle the keymap
-       wm = bpy.context.window_manager
-       for km in addon_keymaps:
-           wm.keyconfigs.addon.keymaps.remove(km)
-       # clear the list
+       for km, kmi in addon_keymaps:
+           km.keymap_items.remove(kmi)
        addon_keymaps.clear()
 
 
@@ -568,18 +566,16 @@ Bringing it all together
        km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
        kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
        kmi.properties.total = 4
-       addon_keymaps.append(km)
+       addon_keymaps.append((km, kmi))
 
    def unregister():
        bpy.utils.unregister_class(ObjectCursorArray)
        bpy.types.VIEW3D_MT_object.remove(menu_func)
 
        # handle the keymap
-       wm = bpy.context.window_manager
-       for km in addon_keymaps:
-           wm.keyconfigs.addon.keymaps.remove(km)
-       # clear the list
-       del addon_keymaps[:]
+       for km, kmi in addon_keymaps:
+           km.keymap_items.remove(kmi)
+       addon_keymaps.clear()
 
 
    if __name__ == "__main__":
diff --git a/doc/python_api/rst_from_bmesh_opdefines.py b/doc/python_api/rst_from_bmesh_opdefines.py
index c1b6643..3776ef7 100644
--- a/doc/python_api/rst_from_bmesh_opdefines.py
+++ b/doc/python_api/rst_from_bmesh_opdefines.py
@@ -65,10 +65,10 @@ def main():
     fsrc = open(FILE_OP_DEFINES_C, 'r', encoding="utf-8")
 
     blocks = []
-    
+
     is_block = False
     is_comment = False  # /* global comments only */
-    
+
     comment_ctx = None
     block_ctx = None
 
@@ -82,7 +82,7 @@ def main():
         elif l.strip().startswith("/*"):
             is_comment = True
             comment_ctx = []
-        
+
         if is_block:
             if l.strip().startswith("//"):
                 pass
@@ -93,11 +93,11 @@ def main():
                     l = l[:cpp_comment]
 
                 block_ctx.append(l)
-            
+
             if l.strip() == "};":
                 is_block = False
                 comment_ctx = None
-        
+
         if is_comment:
             c_comment_start = l.find("/*")
             if c_comment_start != -1:
@@ -113,7 +113,6 @@ def main():
     fsrc.close()
     del fsrc
 
-
    # namespace hack
     vars = (
         "BMO_OP_SLOT_ELEMENT_BUF",
@@ -124,7 +123,7 @@ def main():
         "BMO_OP_SLOT_VEC",
         "BMO_OP_SLOT_PTR",
         "BMO_OP_SLOT_MAPPING",
-        
+
         "BMO_OP_SLOT_SUBTYPE_MAP_ELEM",
         "BMO_OP_SLOT_SUBTYPE_MAP_BOOL",
         "BMO_OP_SLOT_SUBTYPE_MAP_INT",
@@ -157,23 +156,23 @@ def main():
     for comment, b in blocks:
         # magic, translate into python
         b[0] = b[0].replace("static BMOpDefine ", "")
-        
+
         for i, l in enumerate(b):
             l = l.strip()
             l = l.replace("{", "(")
             l = l.replace("}", ")")
-            
+
             if l.startswith("/*"):
                 l = l.replace("/*", "'''own <")
             else:
                 l = l.replace("/*", "'''inline <")
             l = l.replace("*/", ">''',")
-            
+
             # exec func. eg: bmo_rotate_edges_exec,
             if l.startswith("bmo_") and l.endswith("_exec,"):
                 l = "None,"
             b[i] = l
-            
+
         #for l in b:
         #    print(l)
 
@@ -182,7 +181,7 @@ def main():
             "__file__": "generated",
             "__name__": "__main__",
         }
-        
+
         global_namespace.update(vars_dict)
 
         text_a, text_b = text.split("=", 1)
@@ -191,7 +190,6 @@ def main():
         # print(global_namespace["result"])
         blocks_py.append((comment, global_namespace["result"]))
 
-
     # ---------------------
     # Now convert into rst.
     fout = open(OUT_RST, 'w', encoding="utf-8")
@@ -217,7 +215,7 @@ def main():
             args_out_index[:] = [i for (i, a) in enumerate(args_out) if type(a) == tuple]
 
         fw(".. function:: %s(bm, %s)\n\n" % (b[0], ", ".join([args_in[i][0] for i in args_in_index])))
-        
+
         # -- wash the comment
         comment_washed = []
         for i, l in enumerate(comment):
@@ -236,7 +234,6 @@ def main():
         fw("\n")
         # -- done
 
-
         # get the args
         def get_args_wash(args, args_index, is_ret):
             args_wash = []
@@ -268,7 +265,7 @@ def main():
                         comment_next = comment_next[8:-1]  # strip inline <...>
                     else:
                         comment_next = ""
-                        
+
                 comment = ""
                 if comment_prev:
                     comment += comment_prev.strip()
@@ -304,18 +301,21 @@ def main():
 
                 elif tp == BMO_OP_SLOT_ELEMENT_BUF:
                     assert(tp_sub is not None)
-                    
+
                     ls = []
-                    if tp_sub & BM_VERT: ls.append(":class:`bmesh.types.BMVert`")
-                    if tp_sub & BM_EDGE: ls.append(":class:`bmesh.types.BMEdge`")
-                    if tp_sub & BM_FACE: ls.append(":class:`bmesh.types.BMFace`")
+                    if tp_sub & BM_VERT:
+                        ls.append(":class:`bmesh.types.BMVert`")
+                    if tp_sub & BM_EDGE:
+                        ls.append(":class:`bmesh.types.BMEdge`")
+                    if tp_sub & BM_FACE:
+                        ls.append(":class:`bmesh.types.BMFace`")
                     assert(ls)  # must be at least one
 
                     if tp_sub & BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE:
                         tp_str = "/".join(ls)
                     else:
                         tp_str = ("list of (%s)" % ", ".join(ls))
-                        
+
                     del ls
                 elif tp == BMO_OP_SLOT_MAPPING:
                     if tp_sub & BMO_OP_SLOT_SUBTYPE_MAP_EMPTY:
@@ -356,21 +356,21 @@ def main():
 
             fw("   :arg %s: %s\n" % (name, comment))
             fw("   :type %s: %s\n" % (name, tp))
-        
+
         if args_out_wash:
             fw("   :return:\n\n")
-            
+
             for (name, tp, comment) in args_out_wash:
                 assert(name.endswith(".out"))
                 name = name[:-4]
                 fw("      - ``%s``: %s\n\n" % (name, comment))
                 fw("        **type** %s\n" % tp)
-            
+
             fw("\n")
             fw("   :rtype: dict with string keys\n")
 
         fw("\n\n")
-        
+
     fout.close()
     del fout
     print(OUT_RST)
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index af6ddac..09e844a 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -612,10 +612,10 @@ def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
     '''
     function or class method to sphinx
     '''
-    
+
     if type(py_func) == type(bpy.types.Space.draw_handler_add):
         return
-    
+
     arg_str = inspect.formatargspec(*inspect.getargspec(py_func))
 
     if not is_class:
@@ -696,6 +696,8 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
     write_indented_lines(ident + "   ", fw, py_prop.__doc__)
     if py_prop.fset is None:
         fw(ident + "   (readonly)\n\n")
+    else:
+        fw("\n")
 
 
 def pymodule2sphinx(basepath, module_name, module, title):
@@ -984,6 +986,7 @@ context_type_map = {
     "world": ("World", False),
 }
 
+
 def pycontext2sphinx(basepath):
     # Only use once. very irregular
 
@@ -1011,7 +1014,6 @@ def pycontext2sphinx(basepath):
         "sequencer_context_dir",
     )
 
-
     unique = set()
     blend_cdll = ctypes.CDLL("")
     for ctx_str in context_strings:
@@ -1481,7 +1483,9 @@ def write_sphinx_conf_py(basepath):
 
 def execfile(filepath):
     global_namespace = {"__file__": filepath, "__name__": "__main__"}
-    exec(compile(open(filepath).read(), filepath, 'exec'), global_namespace)
+    file_handle = open(filepath)
+    exec(compile(file_handle.read(), filepath, 'exec'), global_namespace)
+    file_handle.close()
 
 
 def write_rst_contents(basepath):
@@ -1708,7 +1712,6 @@ def copy_handwritten_rsts(basepath):
 
     # TODO put this docs in blender's code and use import as per modules above
     handwritten_modules = [
-        "bge.types",
         "bge.logic",
         "bge.render",
         "bge.texture",
@@ -1727,6 +1730,14 @@ def copy_handwritten_rsts(basepath):
             # copy2 keeps time/date stamps
             shutil.copy2(os.path.join(RST_DIR, "%s.rst" % mod_name), basepath)
 
+    if "bge.types" not in EXCLUDE_MODULES:
+        shutil.copy2(os.path.join(RST_DIR, "bge.types.rst"), basepath)
+
+        bge_types_dir = os.path.join(RST_DIR, "bge_types")
+
+        for i in os.listdir(bge_types_dir):
+            shutil.copy2(os.path.join(bge_types_dir, i), basepath)
+
     # changelog
     shutil.copy2(os.path.join(RST_DIR, "change_log.rst"), basepath)
 
@@ -1814,8 +1825,19 @@ def refactor_sphinx_log(sphinx_logfile):
             refactored_logfile.write("%-12s %s\n             %s\n" % log)
 
 
+def monkey_patch():
+    filepath = os.path.join(SCRIPT_DIR, "sphinx_doc_gen_monkeypatch.py")
+    global_namespace = {"__file__": filepath, "__name__": "__main__"}
+    file = open(filepath, 'rb')
+    exec(compile(file.read(), filepath, 'exec'), global_namespace)
+    file.close()
+
+
 def main():
 
+    # first monkey patch to load in fake members
+    monkey_patch()
+
     # eventually, create the dirs
     for dir_path in [ARGS.output_dir, SPHINX_IN]:
         if not os.path.exists(dir_path):
diff --git a/doc/python_api/sphinx_doc_gen.sh b/doc/python_api/sphinx_doc_gen.sh
index 9246196..14919f6 100755
--- a/doc/python_api/sphinx_doc_gen.sh
+++ b/doc/python_api/sphinx_doc_gen.sh
@@ -32,8 +32,7 @@ blender_version_char=$(grep BLENDER_VERSION_CHAR $blender_srcdir/source/blender/
 blender_version_cycle=$(grep BLENDER_VERSION_CYCLE $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
 blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
 
-if [ "$blender_version_cycle" == "release" ]
-then
+if [ "$blender_version_cycle" == "release" ] ; then
 	BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
 else
 	BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
@@ -109,6 +108,11 @@ if $DO_UPLOAD ; then
 	# better redirect
 	ssh $SSH_USER at emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
 
+	# redirect for release only so wiki can point here
+	if [ "$blender_version_cycle" == "release" ] ; then
+		ssh $SSH_USER at emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/blender_python_api/index.html'
+	fi
+
 	if $DO_OUT_PDF ; then
 		# rename so local PDF has matching name.
 		rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
diff --git a/doc/python_api/sphinx_doc_gen_monkeypatch.py b/doc/python_api/sphinx_doc_gen_monkeypatch.py
new file mode 100644
index 0000000..1167ece
--- /dev/null
+++ b/doc/python_api/sphinx_doc_gen_monkeypatch.py
@@ -0,0 +1,47 @@
+ # ***** BEGIN GPL LICENSE BLOCK *****
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+ # as published by the Free Software Foundation; either version 2
+ # of the License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program; if not, write to the Free Software Foundation,
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ #
+ # Contributor(s): Campbell Barton
+ #
+ # #**** END GPL LICENSE BLOCK #****
+
+# <pep8 compliant>
+
+bpy_types_Operator_bl_property__doc__ = (
+"""
+The name of a property to use as this operators primary property.
+Currently this is only used to select the default property when
+expanding an operator into a menu.
+:type: string
+""")
+
+
+def main():
+    import bpy
+    from bpy.types import Operator
+
+    def dummy_func(test):
+        pass
+
+    kw_dummy = dict(fget=dummy_func, fset=dummy_func, fdel=dummy_func)
+
+    # bpy registration handles this,
+    # but its only checked for and not existing in the base class.
+    Operator.bl_property = property(doc=bpy_types_Operator_bl_property__doc__, **kw_dummy)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/extern/bullet2/CMakeLists.txt b/extern/bullet2/CMakeLists.txt
index c57474f..3d75794 100644
--- a/extern/bullet2/CMakeLists.txt
+++ b/extern/bullet2/CMakeLists.txt
@@ -242,14 +242,15 @@ set(SRC
 	src/BulletCollision/CollisionShapes/btUniformScalingShape.h
 	src/BulletCollision/Gimpact/btBoxCollision.h
 	src/BulletCollision/Gimpact/btClipPolygon.h
+	src/BulletCollision/Gimpact/btCompoundFromGimpact.h
 	src/BulletCollision/Gimpact/btContactProcessing.h
-	src/BulletCollision/Gimpact/btGenericPoolAllocator.h
-	src/BulletCollision/Gimpact/btGeometryOperations.h
 	src/BulletCollision/Gimpact/btGImpactBvh.h
 	src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h
 	src/BulletCollision/Gimpact/btGImpactMassUtil.h
 	src/BulletCollision/Gimpact/btGImpactQuantizedBvh.h
 	src/BulletCollision/Gimpact/btGImpactShape.h
+	src/BulletCollision/Gimpact/btGenericPoolAllocator.h
+	src/BulletCollision/Gimpact/btGeometryOperations.h
 	src/BulletCollision/Gimpact/btQuantization.h
 	src/BulletCollision/Gimpact/btTriangleShapeEx.h
 	src/BulletCollision/Gimpact/gim_array.h
diff --git a/extern/carve/lib/intersect_face_division.cpp b/extern/carve/lib/intersect_face_division.cpp
index c74b52d..c5d5d8c 100644
--- a/extern/carve/lib/intersect_face_division.cpp
+++ b/extern/carve/lib/intersect_face_division.cpp
@@ -719,6 +719,10 @@ namespace {
           unassigned--;
         }
       }
+
+      if (!removed.size())
+        throw carve::exception("Failed to merge holes");
+
       for (std::set<int>::iterator f = removed.begin(); f != removed.end(); ++f) {
         for (unsigned i = 0; i < containing_faces.size(); ++i) {
           containing_faces[i].erase(std::remove(containing_faces[i].begin(),
diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt
index a51f576..0cf2211 100644
--- a/extern/libmv/CMakeLists.txt
+++ b/extern/libmv/CMakeLists.txt
@@ -35,7 +35,6 @@ set(INC
 set(INC_SYS
 	../Eigen3
 	third_party/ssba
-	third_party/ldl/Include
 	${PNG_INCLUDE_DIR}
 	${ZLIB_INCLUDE_DIRS}
 )
@@ -83,9 +82,6 @@ set(SRC
 	third_party/gflags/gflags.cc
 	third_party/gflags/gflags_completions.cc
 	third_party/gflags/gflags_reporting.cc
-	third_party/ldl/Source/ldl.c
-	third_party/ssba/Geometry/v3d_metricbundle.cpp
-	third_party/ssba/Math/v3d_optimization.cpp
 
 	libmv-capi.h
 	libmv/base/id_generator.h
@@ -143,16 +139,8 @@ set(SRC
 	third_party/gflags/gflags/gflags.h
 	third_party/gflags/mutex.h
 	third_party/gflags/util.h
-	third_party/ldl/Include/ldl.h
 	third_party/msinttypes/inttypes.h
 	third_party/msinttypes/stdint.h
-	third_party/ssba/Geometry/v3d_cameramatrix.h
-	third_party/ssba/Geometry/v3d_distortion.h
-	third_party/ssba/Geometry/v3d_metricbundle.h
-	third_party/ssba/Math/v3d_linear.h
-	third_party/ssba/Math/v3d_linear_utils.h
-	third_party/ssba/Math/v3d_mathutilities.h
-	third_party/ssba/Math/v3d_optimization.h
 )
 
 if(WIN32)
@@ -191,14 +179,6 @@ if(WIN32)
 			third_party/msinttypes
 		)
 	endif()
-
-	if(MSVC)
-		set(MSVC_OFLAGS O1 O2 Ox)
-		foreach(FLAG ${MSVC_OFLAGS})
-			string(REPLACE "${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
-			string(REPLACE "${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
-		endforeach()
-	endif()
 else()
 	list(APPEND SRC
 		third_party/glog/src/demangle.cc
diff --git a/extern/libmv/SConscript b/extern/libmv/SConscript
index b47086f..a0ab5bd 100644
--- a/extern/libmv/SConscript
+++ b/extern/libmv/SConscript
@@ -11,10 +11,6 @@ Import('env')
 
 defs = []
 
-cflags_libmv = Split(env['CFLAGS'])
-ccflags_libmv = Split(env['CCFLAGS'])
-cxxflags_libmv = Split(env['CXXFLAGS'])
-
 defs.append('V3DLIB_ENABLE_SUITESPARSE')
 defs.append('GOOGLE_GLOG_DLL_DECL=')
 
@@ -26,9 +22,6 @@ src += env.Glob('libmv/simple_pipeline/*.cc')
 src += env.Glob('libmv/tracking/*.cc')
 src += env.Glob('third_party/fast/*.c')
 src += env.Glob('third_party/gflags/*.cc')
-src += env.Glob('third_party/ldl/Source/*.c')
-src += env.Glob('third_party/ssba/Geometry/*.cpp')
-src += env.Glob('third_party/ssba/Math/*.cpp')
 
 incs = '. ../Eigen3 third_party/ceres/include'
 incs += ' ' + env['BF_PNG_INC']
@@ -41,29 +34,12 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', '
 
     src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
     src += ['./third_party/glog/src/windows/port.cc']
-
-    if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
-        cflags_libmv.append('/Od')
-        ccflags_libmv.append('/Od')
-        cxxflags_libmv.append('/Od')
-
-        if not env['BF_DEBUG']:
-            defs.append('NDEBUG')
-    else:
-        if not env['BF_DEBUG']:
-            cflags_libmv += Split(env['REL_CFLAGS'])
-            ccflags_libmv += Split(env['REL_CCFLAGS'])
-            cxxflags_libmv += Split(env['REL_CXXFLAGS'])
 else:
     src += env.Glob("third_party/glog/src/*.cc")
     incs += ' ./third_party/glog/src'
-    if not env['BF_DEBUG']:
-        cflags_libmv += Split(env['REL_CFLAGS'])
-        ccflags_libmv += Split(env['REL_CCFLAGS'])
-        cxxflags_libmv += Split(env['REL_CXXFLAGS'])
 
-incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include'
+incs += ' ./third_party/ssba ../colamd/Include'
 
-env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags_libmv, cc_compileflags=ccflags_libmv, cxx_compileflags=cxxflags_libmv )
+env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
 
 SConscript(['third_party/SConscript'])
diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh
index 23e90fc..27f964a 100755
--- a/extern/libmv/bundle.sh
+++ b/extern/libmv/bundle.sh
@@ -122,6 +122,8 @@ cat > CMakeLists.txt << EOF
 #       If you're doing changes in this file, please update template
 #       in that script too
 
+add_subdirectory(third_party)
+
 set(INC
 	.
 	../colamd/Include
diff --git a/extern/libmv/third_party/CMakeLists.txt b/extern/libmv/third_party/CMakeLists.txt
index 6212fe4..7989d97 100644
--- a/extern/libmv/third_party/CMakeLists.txt
+++ b/extern/libmv/third_party/CMakeLists.txt
@@ -1,2 +1,3 @@
 
+add_subdirectory(ssba)
 add_subdirectory(ceres)
diff --git a/extern/libmv/third_party/SConscript b/extern/libmv/third_party/SConscript
index b05692e..2e30650 100644
--- a/extern/libmv/third_party/SConscript
+++ b/extern/libmv/third_party/SConscript
@@ -1,3 +1,4 @@
 #!/usr/bin/python
 
+SConscript(['ssba/SConscript'])
 SConscript(['ceres/SConscript'])
diff --git a/extern/libmv/third_party/ceres/CMakeLists.txt b/extern/libmv/third_party/ceres/CMakeLists.txt
index e2f06d7..f0c0a4b 100644
--- a/extern/libmv/third_party/ceres/CMakeLists.txt
+++ b/extern/libmv/third_party/ceres/CMakeLists.txt
@@ -31,6 +31,7 @@ set(INC
 	include
 	internal
 	../gflags
+	../../
 )
 
 set(INC_SYS
diff --git a/extern/libmv/third_party/ceres/bundle.sh b/extern/libmv/third_party/ceres/bundle.sh
index ccf6d0a..76630bc 100755
--- a/extern/libmv/third_party/ceres/bundle.sh
+++ b/extern/libmv/third_party/ceres/bundle.sh
@@ -120,6 +120,7 @@ set(INC
 	include
 	internal
 	../gflags
+	../..
 )
 
 set(INC_SYS
diff --git a/extern/libmv/third_party/ssba/CMakeLists.txt b/extern/libmv/third_party/ssba/CMakeLists.txt
new file mode 100644
index 0000000..7237962
--- /dev/null
+++ b/extern/libmv/third_party/ssba/CMakeLists.txt
@@ -0,0 +1,64 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2013, Blender Foundation
+# All rights reserved.
+#
+# Contributor(s): Blender Foundation,
+#                 Sergey Sharybin
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+	.
+	../ldl/Include
+	../../../colamd/Include
+)
+
+set(INC_SYS
+)
+
+set(SRC
+	Geometry/v3d_metricbundle.cpp
+	Math/v3d_optimization.cpp
+
+	Geometry/v3d_cameramatrix.h
+	Geometry/v3d_distortion.h
+	Geometry/v3d_metricbundle.h
+	Math/v3d_linear.h
+	Math/v3d_linear_utils.h
+	Math/v3d_mathutilities.h
+	Math/v3d_optimization.h
+
+	../ldl/Source/ldl.c
+	../ldl/Include/ldl.h
+)
+
+if(WIN32)
+	if(MSVC)
+		set(MSVC_OFLAGS O1 O2 Ox)
+		foreach(FLAG ${MSVC_OFLAGS})
+			string(REPLACE "${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+			string(REPLACE "${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+		endforeach()
+	endif()
+endif()
+
+add_definitions(
+	-DV3DLIB_ENABLE_SUITESPARSE
+)
+
+blender_add_lib(extern_ssba "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/extern/libmv/third_party/ssba/SConscript b/extern/libmv/third_party/ssba/SConscript
new file mode 100644
index 0000000..667b40f
--- /dev/null
+++ b/extern/libmv/third_party/ssba/SConscript
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+import sys
+import os
+
+Import('env')
+
+defs = []
+
+cflags_ssba = Split(env['CFLAGS'])
+ccflags_ssba = Split(env['CCFLAGS'])
+cxxflags_ssba = Split(env['CXXFLAGS'])
+
+defs.append('V3DLIB_ENABLE_SUITESPARSE')
+
+src = env.Glob('Geometry/*.cpp')
+src += env.Glob('Math/*.cpp')
+src += env.Glob('../ldl/Source/*.c')
+
+incs = '. ../ldl/Include ../../../colamd/Include'
+
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
+    if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
+        cflags_ssba.append('/Od')
+        ccflags_ssba.append('/Od')
+        cxxflags_ssba.append('/Od')
+
+        if not env['BF_DEBUG']:
+            defs.append('NDEBUG')
+    else:
+        if not env['BF_DEBUG']:
+            cflags_ssba += Split(env['REL_CFLAGS'])
+            ccflags_ssba += Split(env['REL_CCFLAGS'])
+            cxxflags_ssba += Split(env['REL_CXXFLAGS'])
+
+env.BlenderLib ( libname = 'extern_ssba', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags_ssba, cc_compileflags=ccflags_ssba, cxx_compileflags=cxxflags_ssba )
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt
index be797c4..bb8cd7a 100644
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@ -69,6 +69,14 @@ if(WITH_INTERNATIONAL)
 	add_subdirectory(locale)
 endif()
 
+if(WITH_BULLET)
+	add_subdirectory(rigidbody)
+endif()
+
+if(WITH_COMPOSITOR)
+	add_subdirectory(opencl)
+endif()
+
 # only windows needs utf16 converter
 if(WIN32)
 	add_subdirectory(utfconv)
diff --git a/intern/SConscript b/intern/SConscript
index a35c99b..828c1ad 100644
--- a/intern/SConscript
+++ b/intern/SConscript
@@ -59,6 +59,12 @@ if env['WITH_BF_BOOLEAN']:
 if env['WITH_BF_INTERNATIONAL']:
     SConscript(['locale/SConscript'])
 
+if env['WITH_BF_BULLET']:
+    SConscript (['rigidbody/SConscript'])
+
+if env['WITH_BF_COMPOSITOR']:
+    SConscript (['opencl/SConscript'])
+
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
     SConscript(['utfconv/SConscript'])
 
diff --git a/intern/bsp/intern/CSG_BooleanOps.cpp b/intern/bsp/intern/CSG_BooleanOps.cpp
index 4f71e79..f74dfc3 100644
--- a/intern/bsp/intern/CSG_BooleanOps.cpp
+++ b/intern/bsp/intern/CSG_BooleanOps.cpp
@@ -88,16 +88,16 @@ CSG_PerformBooleanOperation(
 
 	BoolOpType boolType;
 	
-	switch( op_type ) {
-	case e_csg_union:
-		boolType = BOP_UNION;
-		break;
-	case e_csg_difference:
-		boolType = BOP_DIFFERENCE;
-		break;
-	default:
-		boolType = BOP_INTERSECTION;
-		break;
+	switch (op_type) {
+		case e_csg_union:
+			boolType = BOP_UNION;
+			break;
+		case e_csg_difference:
+			boolType = BOP_DIFFERENCE;
+			break;
+		default:
+			boolType = BOP_INTERSECTION;
+			break;
 	}
 
 	BoolOpState boolOpResult;
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 3242acf..226218a 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -13,10 +13,12 @@ if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
 endif()
 
 if(WIN32 AND MSVC)
-	set(CYCLES_OPTIMIZED_KERNEL_FLAGS "/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc")
+	set(CYCLES_SSE2_KERNEL_FLAGS "/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc")
+	set(CYCLES_SSE3_KERNEL_FLAGS "/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc")
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast -D_CRT_SECURE_NO_WARNINGS /EHsc")
 elseif(CMAKE_COMPILER_IS_GNUCC)
-	set(CYCLES_OPTIMIZED_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mfpmath=sse")
+	set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2 -mfpmath=sse")
+	set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mfpmath=sse")
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
 endif()
 
@@ -44,13 +46,10 @@ endif()
 
 if(WITH_CYCLES_OSL)
 	add_definitions(-DWITH_OSL)
+	add_definitions(-DOSL_STATIC_LIBRARY)
 	include_directories(${OSL_INCLUDES})
 endif()
 
-if(WITH_CYCLES_CUDA_BINARIES)
-	add_definitions(-DWITH_CUDA_BINARIES)
-endif()
-
 add_definitions(-DWITH_OPENCL)
 add_definitions(-DWITH_CUDA)
 add_definitions(-DWITH_MULTI)
diff --git a/intern/cycles/SConscript b/intern/cycles/SConscript
index dcb684c..7b4d2db6 100644
--- a/intern/cycles/SConscript
+++ b/intern/cycles/SConscript
@@ -36,12 +36,15 @@ sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + cycles.Glob('
 
 sources.remove(path.join('util', 'util_view.cpp'))
 sources.remove(path.join('render', 'film_response.cpp'))
-sources.remove(path.join('kernel', 'kernel_optimized.cpp'))
+sources.remove(path.join('kernel', 'kernel_sse2.cpp'))
+sources.remove(path.join('kernel', 'kernel_sse3.cpp'))
 
 incs = [] 
 defs = []
 cxxflags = Split(env['CXXFLAGS'])
 
+defs.append('GLEW_STATIC')
+
 defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
 defs.append('CCL_NAMESPACE_END=}')
 
@@ -51,11 +54,9 @@ defs.append('WITH_CUDA')
 
 if env['WITH_BF_CYCLES_OSL']:
     defs.append('WITH_OSL')
+    defs.append('OSL_STATIC_LIBRARY')
     incs.append(cycles['BF_OSL_INC'])
 
-if env['WITH_BF_CYCLES_CUDA_BINARIES']:
-    defs.append('WITH_CUDA_BINARIES')
-
 incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split())
 incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna'.split())
 incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split())
@@ -75,21 +76,29 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', '
 
 # optimized kernel
 if env['WITH_BF_RAYOPTIMIZATION']:
-    optim_cxxflags = Split(env['CXXFLAGS'])
+    sse2_cxxflags = Split(env['CXXFLAGS'])
+    sse3_cxxflags = Split(env['CXXFLAGS'])
 
     if env['OURPLATFORM'] == 'win32-vc':
-        optim_cxxflags.append('/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
+        sse2_cxxflags.append('/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
+        sse3_cxxflags.append('/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
     elif env['OURPLATFORM'] == 'win64-vc':
-        optim_cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
+        sse2_cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
+        sse3_cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
     else:
-        optim_cxxflags.append('-ffast-math -msse -msse2 -msse3 -mfpmath=sse'.split())
+        sse2_cxxflags.append('-ffast-math -msse -msse2 -mfpmath=sse'.split())
+        sse3_cxxflags.append('-ffast-math -msse -msse2 -msse3 -mfpmath=sse'.split())
     
     defs.append('WITH_OPTIMIZED_KERNEL')
     optim_defs = defs[:]
-    optim_sources = [path.join('kernel', 'kernel_optimized.cpp')]
 
-    cycles_optim = cycles.Clone()
-    cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[10], cxx_compileflags=optim_cxxflags)
+    cycles_sse3 = cycles.Clone()
+    sse3_sources = [path.join('kernel', 'kernel_sse3.cpp')]
+    cycles_sse3.BlenderLib('bf_intern_cycles_sse3', sse3_sources, incs, optim_defs, libtype=['intern'], priority=[10], cxx_compileflags=sse3_cxxflags)
+
+    cycles_sse2 = cycles.Clone()
+    sse2_sources = [path.join('kernel', 'kernel_sse2.cpp')]
+    cycles_sse2.BlenderLib('bf_intern_cycles_sse2', sse2_sources, incs, optim_defs, libtype=['intern'], priority=[10], cxx_compileflags=sse2_cxxflags)
 
 cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], cxx_compileflags=cxxflags)
 
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index 5de9d71..40fbb7a 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -233,16 +233,16 @@ static void xml_read_film(const XMLReadState& state, pugi::xml_node node)
 	float aspect = (float)cam->width/(float)cam->height;
 
 	if(cam->width >= cam->height) {
-		cam->left = -aspect;
-		cam->right = aspect;
-		cam->bottom = -1.0f;
-		cam->top = 1.0f;
+		cam->viewplane.left = -aspect;
+		cam->viewplane.right = aspect;
+		cam->viewplane.bottom = -1.0f;
+		cam->viewplane.top = 1.0f;
 	}
 	else {
-		cam->left = -1.0f;
-		cam->right = 1.0f;
-		cam->bottom = -1.0f/aspect;
-		cam->top = 1.0f/aspect;
+		cam->viewplane.left = -1.0f;
+		cam->viewplane.right = 1.0f;
+		cam->viewplane.bottom = -1.0f/aspect;
+		cam->viewplane.top = 1.0f/aspect;
 	}
 
 	cam->need_update = true;
diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py
index dddf7ba..16cfdca 100644
--- a/intern/cycles/blender/addon/__init__.py
+++ b/intern/cycles/blender/addon/__init__.py
@@ -34,13 +34,14 @@ import bpy
 
 from . import engine
 
+
 class CyclesRender(bpy.types.RenderEngine):
     bl_idname = 'CYCLES'
     bl_label = "Cycles Render"
     bl_use_shading_nodes = True
+    bl_use_preview = True
 
     def __init__(self):
-        engine.init()
         self.session = None
 
     def __del__(self):
@@ -48,28 +49,28 @@ class CyclesRender(bpy.types.RenderEngine):
 
     # final render
     def update(self, data, scene):
-        if not self.session:
-            engine.create(self, data, scene)
+        if self.is_preview:
+            if not self.session:
+                use_osl = bpy.context.scene.cycles.shading_system
+
+                engine.create(self, data, scene,
+                              None, None, None, use_osl)
         else:
-            engine.reset(self, data, scene)
+            if not self.session:
+                engine.create(self, data, scene)
+            else:
+                engine.reset(self, data, scene)
 
         engine.update(self, data, scene)
 
     def render(self, scene):
         engine.render(self)
 
-    # preview render
-    # def preview_update(self, context, id):
-    #    pass
-    #
-    # def preview_render(self):
-    #    pass
-
     # viewport render
     def view_update(self, context):
         if not self.session:
             engine.create(self, context.blend_data, context.scene,
-                context.region, context.space_data, context.region_data)
+                          context.region, context.space_data, context.region_data)
         engine.update(self, context.blend_data, context.scene)
 
     def view_draw(self, context):
@@ -88,6 +89,8 @@ def register():
     from . import properties
     from . import presets
 
+    engine.init()
+
     properties.register()
     ui.register()
     presets.register()
@@ -103,4 +106,3 @@ def unregister():
     properties.unregister()
     presets.unregister()
     bpy.utils.unregister_module(__name__)
-
diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py
index 9641128..8958ca3 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -18,6 +18,7 @@
 
 # <pep8 compliant>
 
+
 def init():
     import bpy
     import _cycles
@@ -29,7 +30,7 @@ def init():
     _cycles.init(path, user_path)
 
 
-def create(engine, data, scene, region=0, v3d=0, rv3d=0):
+def create(engine, data, scene, region=0, v3d=0, rv3d=0, preview_osl=False):
     import bpy
     import _cycles
 
@@ -43,7 +44,7 @@ def create(engine, data, scene, region=0, v3d=0, rv3d=0):
     if rv3d:
         rv3d = rv3d.as_pointer()
 
-    engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d)
+    engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d, preview_osl)
 
 
 def free(engine):
@@ -89,4 +90,3 @@ def available_devices():
 def with_osl():
     import _cycles
     return _cycles.with_osl
-
diff --git a/intern/cycles/blender/addon/osl.py b/intern/cycles/blender/addon/osl.py
index 79ce3df..0a67eda 100644
--- a/intern/cycles/blender/addon/osl.py
+++ b/intern/cycles/blender/addon/osl.py
@@ -18,10 +18,13 @@
 
 # <pep8 compliant>
 
-import bpy, _cycles, os, tempfile
+import bpy
+import _cycles
+
 
-# compile .osl file with given filepath to temporary .oso file
 def osl_compile(input_path, report):
+    """compile .osl file with given filepath to temporary .oso file"""
+    import tempfile
     output_file = tempfile.NamedTemporaryFile(mode='w', suffix=".oso", delete=False)
     output_path = output_file.name
     output_file.close()
@@ -33,9 +36,12 @@ def osl_compile(input_path, report):
 
     return ok, output_path
 
-# compile and update shader script node
+
 def update_script_node(node, report):
-    import os, shutil
+    """compile and update shader script node"""
+    import os
+    import shutil
+    import tempfile
 
     if node.mode == 'EXTERNAL':
         # compile external script file
@@ -103,7 +109,7 @@ def update_script_node(node, report):
 
                 report({'ERROR'}, "Can't read OSO bytecode to store in node at %r" % oso_path)
                 ok = False
-    
+
     else:
         report({'WARNING'}, "No text or file specified in node, nothing to compile")
         return
@@ -125,4 +131,3 @@ def update_script_node(node, report):
             pass
 
     return ok
-
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 8b90b0b..65f245f 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -66,21 +66,24 @@ enum_panorama_types = (
 
 enum_curve_presets = (
     ('CUSTOM', "Custom", "Set general parameters"),
-    ('TANGENT_SHADING', "Tangent Normal", "Use planar geometry and tangent normals"),
-    ('TRUE_NORMAL', "True Normal", "Use true normals (good for thin strands)"),
-    ('ACCURATE_PRESET', "Accurate", "Use best settings (suitable for glass materials)"),
+    ('FAST_PLANES', "Fast Planes", "Use camera facing triangles (fast but memory intensive)"),
+    ('TANGENT_SHADING', "Tangent Normal", "Use planar line segments and tangent normals"),
+    ('TRUE_NORMAL', "True Normal", "Use true normals with line segments(good for thin strands)"),
+    ('ACCURATE_PRESET', "Accurate", "Use best line segment settings (suitable for glass materials)"),
+    ('SMOOTH_CURVES', "Smooth Curves", "Use smooth cardinal curves (slowest)"),
     )
 
 enum_curve_primitives = (
     ('TRIANGLES', "Triangles", "Create triangle geometry around strands"),
     ('LINE_SEGMENTS', "Line Segments", "Use line segment primitives"),
-    ('CURVE_SEGMENTS', "?Curve Segments?", "Use curve segment primitives (not implemented)"),
+    ('CURVE_SEGMENTS', "Curve Segments", "Use segmented cardinal curve primitives"),
+    ('CURVE_RIBBONS', "Curve Ribbons", "Use smooth cardinal curve ribbon primitives"),
     )
 
 enum_triangle_curves = (
-    ('CAMERA', "Planes", "Create individual triangles forming planes that face camera"),
-    ('RIBBONS', "Ribbons", "Create individual triangles forming ribbon"),
-    ('TESSELLATED', "Tessellated", "Create mesh surrounding each strand"),
+    ('CAMERA_TRIANGLES', "Planes", "Create individual triangles forming planes that face camera"),
+    ('RIBBON_TRIANGLES', "Ribbons", "Create individual triangles forming ribbon"),
+    ('TESSELLATED_TRIANGLES', "Tessellated", "Create mesh surrounding each strand"),
     )
 
 enum_line_curves = (
@@ -95,7 +98,7 @@ enum_curves_interpolation = (
     ('CARDINAL', "Cardinal interpolation", "Use cardinal interpolation between segments"),
     ('BSPLINE', "B-spline interpolation", "Use b-spline interpolation between segments"),
     )
-    
+
 enum_tile_order = (
     ('CENTER', "Center", "Render from center to the edges"),
     ('RIGHT_TO_LEFT', "Right to Left", "Render from right to left"),
@@ -104,6 +107,7 @@ enum_tile_order = (
     ('BOTTOM_TO_TOP', "Bottom to Top", "Render from bottom to top"),
     )
 
+
 class CyclesRenderSettings(bpy.types.PropertyGroup):
     @classmethod
     def register(cls):
@@ -460,8 +464,8 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup):
                 type=cls,
                 )
         cls.sample_as_light = BoolProperty(
-                name="Sample as Lamp",
-                description="Use direct light sampling for this material, "
+                name="Multiple Importance Sample",
+                description="Use multiple importance sampling for this material, "
                             "disabling may reduce overall noise for large "
                             "objects that emit little light compared to other light sources",
                 default=True,
@@ -497,6 +501,12 @@ class CyclesLampSettings(bpy.types.PropertyGroup):
                 min=1, max=10000,
                 default=1,
                 )
+        cls.use_multiple_importance_sampling = BoolProperty(
+                name="Multiple Importance Sample",
+                description="Use multiple importance sampling for the lamp, "
+                            "reduces noise for area lamps and sharp glossy materials",
+                default=False,
+                )
 
     @classmethod
     def unregister(cls):
@@ -512,8 +522,8 @@ class CyclesWorldSettings(bpy.types.PropertyGroup):
                 type=cls,
                 )
         cls.sample_as_light = BoolProperty(
-                name="Sample as Lamp",
-                description="Use direct light sampling for the environment, "
+                name="Multiple Importance Sample",
+                description="Use multiple importance sampling for the environment, "
                             "enabling for non-solid colors is recommended",
                 default=False,
                 )
@@ -619,6 +629,7 @@ class CyclesMeshSettings(bpy.types.PropertyGroup):
         del bpy.types.Curve.cycles
         del bpy.types.MetaBall.cycles
 
+
 class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
     @classmethod
     def register(cls):
@@ -643,7 +654,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
                 name="Mesh Geometry",
                 description="Method for creating triangle geometry",
                 items=enum_triangle_curves,
-                default='CAMERA',
+                default='CAMERA_TRIANGLES',
                 )
         cls.line_method = EnumProperty(
                 name="Intersection Method",
@@ -682,10 +693,6 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
                 description="Correct the tangent normal for the strand's slope",
                 default=False,
                 )
-        cls.use_cache = BoolProperty(
-                name="Export Cached data",
-                default=True,
-                )
         cls.use_parents = BoolProperty(
                 name="Use parent strands",
                 description="Use parents with children",
@@ -705,7 +712,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
                 name="Use Cycles Hair Rendering",
                 description="Activate Cycles hair rendering for particle system",
                 default=True,
-                )        
+                )
         cls.segments = IntProperty(
                 name="Segments",
                 description="Number of segments between path keys (note that this combines with the 'draw step' value)",
@@ -730,11 +737,18 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
                 min=0, max=100.0,
                 default=1.01,
                 )
+        cls.subdivisions = IntProperty(
+                name="Subdivisions",
+                description="Number of subdivisions used in Cardinal curve intersection (power of 2)",
+                min=0, max=24,
+                default=3,
+                )
 
     @classmethod
     def unregister(cls):
         del bpy.types.Scene.cycles_curves
 
+
 class CyclesCurveSettings(bpy.types.PropertyGroup):
     @classmethod
     def register(cls):
@@ -771,6 +785,7 @@ class CyclesCurveSettings(bpy.types.PropertyGroup):
     def unregister(cls):
         del bpy.types.ParticleSettings.cycles
 
+
 def register():
     bpy.utils.register_class(CyclesRenderSettings)
     bpy.utils.register_class(CyclesCameraSettings)
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index a24da59..0debb54 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -168,6 +168,19 @@ class CyclesRender_PT_film(CyclesButtonsPanel, Panel):
         if cscene.filter_type != 'BOX':
             sub.prop(cscene, "filter_width", text="Width")
 
+        layout.separator()
+
+        rd = scene.render
+        col = layout.column()
+
+        split = col.split(percentage=0.40)
+        split.prop(rd, "use_antialiasing", "OpenGL AA")
+        row = split.row()
+        row.active = rd.use_antialiasing
+        row.prop(rd, "antialiasing_samples", expand=True)
+
+        col.prop(rd, "alpha_mode", text="OpenGL Alpha")
+
 
 class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
     bl_label = "Performance"
@@ -522,6 +535,19 @@ def panel_node_draw(layout, id_data, output_type, input_name):
     return True
 
 
+class CyclesLamp_PT_preview(CyclesButtonsPanel, Panel):
+    bl_label = "Preview"
+    bl_context = "data"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.lamp and CyclesButtonsPanel.poll(context)
+
+    def draw(self, context):
+        self.layout.template_preview(context.lamp)
+
+
 class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
     bl_label = "Lamp"
     bl_context = "data"
@@ -561,6 +587,8 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
         col = split.column()
         col.prop(clamp, "cast_shadow")
 
+        layout.prop(clamp, "use_multiple_importance_sampling")
+
         if lamp.type == 'HEMI':
             layout.label(text="Not supported, interpreted as sun lamp.")
 
@@ -606,6 +634,19 @@ class CyclesLamp_PT_spot(CyclesButtonsPanel, Panel):
         col.prop(lamp, "show_cone")
 
 
+class CyclesWorld_PT_preview(CyclesButtonsPanel, Panel):
+    bl_label = "Preview"
+    bl_context = "world"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.world and CyclesButtonsPanel.poll(context)
+
+    def draw(self, context):
+        self.layout.template_preview(context.world)
+
+
 class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
     bl_label = "Surface"
     bl_context = "world"
@@ -692,6 +733,19 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
             sub.prop(cworld, "samples")
 
 
+class CyclesMaterial_PT_preview(CyclesButtonsPanel, Panel):
+    bl_label = "Preview"
+    bl_context = "material"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.material and CyclesButtonsPanel.poll(context)
+
+    def draw(self, context):
+        self.layout.template_preview(context.material)
+
+
 class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
     bl_label = "Surface"
     bl_context = "material"
@@ -768,9 +822,10 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel):
         col.prop(mat, "diffuse_color", text="Viewport Color")
 
         col = split.column()
-        col.prop(cmat, "sample_as_light")
         col.prop(mat, "pass_index")
 
+        layout.prop(cmat, "sample_as_light")
+
 
 class CyclesTexture_PT_context(CyclesButtonsPanel, Panel):
     bl_label = ""
@@ -808,24 +863,8 @@ class CyclesTexture_PT_context(CyclesButtonsPanel, Panel):
                 split = layout.split(percentage=0.2)
                 split.label(text="Type:")
                 split.prop(tex, "type", text="")
-
-
-class CyclesTexture_PT_nodes(CyclesButtonsPanel, Panel):
-    bl_label = "Nodes"
-    bl_context = "texture"
-
-    @classmethod
-    def poll(cls, context):
-        tex = context.texture
-        return (tex and tex.use_nodes) and CyclesButtonsPanel.poll(context)
-
-    def draw(self, context):
-        layout = self.layout
-
-        tex = context.texture
-        panel_node_draw(layout, tex, 'OUTPUT_TEXTURE', 'Color')
-
-
+                
+                
 class CyclesTexture_PT_node(CyclesButtonsPanel, Panel):
     bl_label = "Node"
     bl_context = "texture"
@@ -849,14 +888,12 @@ class CyclesTexture_PT_mapping(CyclesButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        tex = context.texture
         node = context.texture_node
-        return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
+        return node and CyclesButtonsPanel.poll(context)
 
     def draw(self, context):
         layout = self.layout
-
-        # tex = context.texture
+        
         node = context.texture_node
 
         mapping = node.texture_mapping
@@ -882,15 +919,13 @@ class CyclesTexture_PT_colors(CyclesButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        # tex = context.texture
         # node = context.texture_node
         return False
-        #return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
+        #return node and CyclesButtonsPanel.poll(context)
 
     def draw(self, context):
         layout = self.layout
-
-        # tex = context.texture
+        
         node = context.texture_node
 
         mapping = node.color_mapping
@@ -946,84 +981,96 @@ class CyclesParticle_PT_textures(CyclesButtonsPanel, Panel):
             slot = part.texture_slots[part.active_texture_index]
             layout.template_ID(slot, "texture", new="texture.new")
 
+
 class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
     bl_label = "Cycles Hair Rendering"
     bl_context = "particle"
-    
+
     @classmethod
     def poll(cls, context):
+        scene = context.scene
+        cscene = scene.cycles
         psys = context.particle_system
         device_type = context.user_preferences.system.compute_device_type
-        experimental = context.scene.cycles.feature_set == 'EXPERIMENTAL' and (context.scene.cycles.device == 'CPU' or device_type == 'NONE')
+        experimental = ((cscene.feature_set == 'EXPERIMENTAL') and (cscene.device == 'CPU' or device_type == 'NONE'))
         return CyclesButtonsPanel.poll(context) and experimental and psys
-        
+
     def draw_header(self, context):
-        cscene = context.scene.cycles_curves
-        self.layout.prop(cscene, "use_curves", text="")
-    
+        ccscene = context.scene.cycles_curves
+        self.layout.prop(ccscene, "use_curves", text="")
+
     def draw(self, context):
         layout = self.layout
-        
+
         scene = context.scene
-        cscene = scene.cycles_curves
-        
-        layout.active = cscene.use_curves
-        
-        layout.prop(cscene, "preset", text="Mode")
-        
-        if cscene.preset == 'CUSTOM':
-            layout.prop(cscene, "primitive", text="Primitive")
-        
-            if cscene.primitive == 'TRIANGLES':
-                layout.prop(cscene, "triangle_method", text="Method")
-                if cscene.triangle_method == 'TESSELLATED':
-                    layout.prop(cscene, "resolution", text="Resolution")
-                layout.prop(cscene, "use_smooth", text="Smooth")
-            elif cscene.primitive == 'LINE_SEGMENTS':
-                layout.prop(cscene, "use_backfacing", text="Check back-faces")
-                
+        ccscene = scene.cycles_curves
+
+        layout.active = ccscene.use_curves
+
+        layout.prop(ccscene, "preset", text="Mode")
+
+        if ccscene.preset == 'CUSTOM':
+            layout.prop(ccscene, "primitive", text="Primitive")
+
+            if ccscene.primitive == 'TRIANGLES':
+                layout.prop(ccscene, "triangle_method", text="Method")
+                if ccscene.triangle_method == 'TESSELLATED_TRIANGLES':
+                    layout.prop(ccscene, "resolution", text="Resolution")
+                layout.prop(ccscene, "use_smooth", text="Smooth")
+            elif ccscene.primitive == 'LINE_SEGMENTS':
+                layout.prop(ccscene, "use_backfacing", text="Check back-faces")
+
                 row = layout.row()
-                row.prop(cscene, "use_encasing", text="Exclude encasing")
+                row.prop(ccscene, "use_encasing", text="Exclude encasing")
                 sub = row.row()
-                sub.active = cscene.use_encasing
-                sub.prop(cscene, "encasing_ratio", text="Ratio for encasing")
-                
-                layout.prop(cscene, "line_method", text="Method")
-                layout.prop(cscene, "use_tangent_normal", text="Use tangent normal as default")
-                layout.prop(cscene, "use_tangent_normal_geometry", text="Use tangent normal geometry")
-                layout.prop(cscene, "use_tangent_normal_correction", text="Correct tangent normal for slope")
-                layout.prop(cscene, "interpolation", text="Interpolation")
-                
+                sub.active = ccscene.use_encasing
+                sub.prop(ccscene, "encasing_ratio", text="Ratio for encasing")
+
+                layout.prop(ccscene, "line_method", text="Method")
+                layout.prop(ccscene, "use_tangent_normal", text="Use tangent normal as default")
+                layout.prop(ccscene, "use_tangent_normal_geometry", text="Use tangent normal geometry")
+                layout.prop(ccscene, "use_tangent_normal_correction", text="Correct tangent normal for slope")
+                layout.prop(ccscene, "interpolation", text="Interpolation")
+
+                row = layout.row()
+                row.prop(ccscene, "segments", text="Segments")
+                row.prop(ccscene, "normalmix", text="Ray Mix")
+            elif ccscene.primitive in {'CURVE_SEGMENTS', 'CURVE_RIBBONS'}:
+                layout.prop(ccscene, "subdivisions", text="Curve subdivisions")
+                layout.prop(ccscene, "use_backfacing", text="Check back-faces")
+
+                layout.prop(ccscene, "interpolation", text="Interpolation")
                 row = layout.row()
-                row.prop(cscene, "segments", text="Segments")
-                row.prop(cscene, "normalmix", text="Ray Mix")
-            
+                row.prop(ccscene, "segments", text="Segments")
+
             row = layout.row()
-            row.prop(cscene, "use_cache", text="Export cache with children")
-            if cscene.use_cache:
-                row.prop(cscene, "use_parents", text="Include parents")  
-            
+            row.prop(ccscene, "use_parents", text="Include parents")
+
+
 class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel):
     bl_label = "Cycles Hair Settings"
     bl_context = "particle"
-    
+
     @classmethod
     def poll(cls, context):
-        use_curves = context.scene.cycles_curves.use_curves and context.particle_system
+        scene = context.scene
+        cscene = scene.cycles
+        ccscene = scene.cycles_curves
+        use_curves = ccscene.use_curves and context.particle_system
         device_type = context.user_preferences.system.compute_device_type
-        experimental = context.scene.cycles.feature_set == 'EXPERIMENTAL' and (context.scene.cycles.device == 'CPU' or device_type == 'NONE')
+        experimental = cscene.feature_set == 'EXPERIMENTAL' and (cscene.device == 'CPU' or device_type == 'NONE')
         return CyclesButtonsPanel.poll(context) and experimental and use_curves
 
     def draw(self, context):
         layout = self.layout
-        
+
         psys = context.particle_settings
         cpsys = psys.cycles
-        
+
         row = layout.row()
         row.prop(cpsys, "shape", text="Shape")
         row.prop(cpsys, "use_closetip", text="Close tip")
-        
+
         layout.label(text="Width multiplier:")
         row = layout.row()
         row.prop(cpsys, "root_width", text="Root")
@@ -1090,74 +1137,89 @@ def draw_pause(self, context):
 
 
 def get_panels():
+    types = bpy.types
     return (
-        bpy.types.RENDER_PT_render,
-        bpy.types.RENDER_PT_output,
-        bpy.types.RENDER_PT_encoding,
-        bpy.types.RENDER_PT_dimensions,
-        bpy.types.RENDER_PT_stamp,
-        bpy.types.SCENE_PT_scene,
-        bpy.types.SCENE_PT_audio,
-        bpy.types.SCENE_PT_unit,
-        bpy.types.SCENE_PT_keying_sets,
-        bpy.types.SCENE_PT_keying_set_paths,
-        bpy.types.SCENE_PT_physics,
-        bpy.types.WORLD_PT_context_world,
-        bpy.types.DATA_PT_context_mesh,
-        bpy.types.DATA_PT_context_camera,
-        bpy.types.DATA_PT_context_lamp,
-        bpy.types.DATA_PT_context_speaker,
-        bpy.types.DATA_PT_texture_space,
-        bpy.types.DATA_PT_curve_texture_space,
-        bpy.types.DATA_PT_mball_texture_space,
-        bpy.types.DATA_PT_vertex_groups,
-        bpy.types.DATA_PT_shape_keys,
-        bpy.types.DATA_PT_uv_texture,
-        bpy.types.DATA_PT_vertex_colors,
-        bpy.types.DATA_PT_camera,
-        bpy.types.DATA_PT_camera_display,
-        bpy.types.DATA_PT_lens,
-        bpy.types.DATA_PT_speaker,
-        bpy.types.DATA_PT_distance,
-        bpy.types.DATA_PT_cone,
-        bpy.types.DATA_PT_customdata,
-        bpy.types.DATA_PT_custom_props_mesh,
-        bpy.types.DATA_PT_custom_props_camera,
-        bpy.types.DATA_PT_custom_props_lamp,
-        bpy.types.DATA_PT_custom_props_speaker,
-        bpy.types.TEXTURE_PT_clouds,
-        bpy.types.TEXTURE_PT_wood,
-        bpy.types.TEXTURE_PT_marble,
-        bpy.types.TEXTURE_PT_magic,
-        bpy.types.TEXTURE_PT_blend,
-        bpy.types.TEXTURE_PT_stucci,
-        bpy.types.TEXTURE_PT_image,
-        bpy.types.TEXTURE_PT_image_sampling,
-        bpy.types.TEXTURE_PT_image_mapping,
-        bpy.types.TEXTURE_PT_musgrave,
-        bpy.types.TEXTURE_PT_voronoi,
-        bpy.types.TEXTURE_PT_distortednoise,
-        bpy.types.TEXTURE_PT_voxeldata,
-        bpy.types.TEXTURE_PT_pointdensity,
-        bpy.types.TEXTURE_PT_pointdensity_turbulence,
-        bpy.types.TEXTURE_PT_mapping,
-        bpy.types.TEXTURE_PT_influence,
-        bpy.types.TEXTURE_PT_colors,
-        bpy.types.PARTICLE_PT_context_particles,
-        bpy.types.PARTICLE_PT_emission,
-        bpy.types.PARTICLE_PT_hair_dynamics,
-        bpy.types.PARTICLE_PT_cache,
-        bpy.types.PARTICLE_PT_velocity,
-        bpy.types.PARTICLE_PT_rotation,
-        bpy.types.PARTICLE_PT_physics,
-        bpy.types.PARTICLE_PT_boidbrain,
-        bpy.types.PARTICLE_PT_render,
-        bpy.types.PARTICLE_PT_draw,
-        bpy.types.PARTICLE_PT_children,
-        bpy.types.PARTICLE_PT_field_weights,
-        bpy.types.PARTICLE_PT_force_fields,
-        bpy.types.PARTICLE_PT_vertexgroups,
-        bpy.types.PARTICLE_PT_custom_props,
+        types.RENDER_PT_render,
+        types.RENDER_PT_output,
+        types.RENDER_PT_encoding,
+        types.RENDER_PT_dimensions,
+        types.RENDER_PT_stamp,
+        types.SCENE_PT_scene,
+        types.SCENE_PT_color_management,
+        types.SCENE_PT_custom_props,
+        types.SCENE_PT_audio,
+        types.SCENE_PT_unit,
+        types.SCENE_PT_keying_sets,
+        types.SCENE_PT_keying_set_paths,
+        types.SCENE_PT_physics,
+        types.WORLD_PT_context_world,
+        types.WORLD_PT_custom_props,
+        types.DATA_PT_context_mesh,
+        types.DATA_PT_context_camera,
+        types.DATA_PT_context_lamp,
+        types.DATA_PT_context_speaker,
+        types.DATA_PT_texture_space,
+        types.DATA_PT_curve_texture_space,
+        types.DATA_PT_mball_texture_space,
+        types.DATA_PT_vertex_groups,
+        types.DATA_PT_shape_keys,
+        types.DATA_PT_uv_texture,
+        types.DATA_PT_vertex_colors,
+        types.DATA_PT_camera,
+        types.DATA_PT_camera_display,
+        types.DATA_PT_lens,
+        types.DATA_PT_speaker,
+        types.DATA_PT_distance,
+        types.DATA_PT_cone,
+        types.DATA_PT_customdata,
+        types.DATA_PT_custom_props_mesh,
+        types.DATA_PT_custom_props_camera,
+        types.DATA_PT_custom_props_lamp,
+        types.DATA_PT_custom_props_speaker,
+        types.DATA_PT_custom_props_arm,
+        types.DATA_PT_custom_props_curve,
+        types.DATA_PT_custom_props_lattice,
+        types.DATA_PT_custom_props_metaball,
+        types.TEXTURE_PT_custom_props,
+        types.TEXTURE_PT_clouds,
+        types.TEXTURE_PT_wood,
+        types.TEXTURE_PT_marble,
+        types.TEXTURE_PT_magic,
+        types.TEXTURE_PT_blend,
+        types.TEXTURE_PT_stucci,
+        types.TEXTURE_PT_image,
+        types.TEXTURE_PT_image_sampling,
+        types.TEXTURE_PT_image_mapping,
+        types.TEXTURE_PT_musgrave,
+        types.TEXTURE_PT_voronoi,
+        types.TEXTURE_PT_distortednoise,
+        types.TEXTURE_PT_voxeldata,
+        types.TEXTURE_PT_pointdensity,
+        types.TEXTURE_PT_pointdensity_turbulence,
+        types.TEXTURE_PT_mapping,
+        types.TEXTURE_PT_influence,
+        types.TEXTURE_PT_colors,
+        types.PARTICLE_PT_context_particles,
+        types.PARTICLE_PT_custom_props,
+        types.PARTICLE_PT_emission,
+        types.PARTICLE_PT_hair_dynamics,
+        types.PARTICLE_PT_cache,
+        types.PARTICLE_PT_velocity,
+        types.PARTICLE_PT_rotation,
+        types.PARTICLE_PT_physics,
+        types.SCENE_PT_rigid_body_world,
+        types.SCENE_PT_rigid_body_cache,
+        types.SCENE_PT_rigid_body_field_weights,
+        types.PARTICLE_PT_boidbrain,
+        types.PARTICLE_PT_render,
+        types.PARTICLE_PT_draw,
+        types.PARTICLE_PT_children,
+        types.PARTICLE_PT_field_weights,
+        types.PARTICLE_PT_force_fields,
+        types.PARTICLE_PT_vertexgroups,
+        types.MATERIAL_PT_custom_props,
+        types.BONE_PT_custom_props,
+        types.OBJECT_PT_custom_props,
         )
 
 
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 41e1249..5b8d495 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -37,15 +37,15 @@ void curveinterp_v3_v3v3v3v3(float3 *p, float3 *v1, float3 *v2, float3 *v3, floa
 void interp_weights(float t, float data[4], int type);
 float shaperadius(float shape, float root, float tip, float time);
 void InterpolateKeySegments(int seg, int segno, int key, int curve, float3 *keyloc, float *time, ParticleCurveData *CData, int interpolation);
-bool ObtainParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData);
-bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents);
-bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, int vcol_num);
-bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents);
+bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, bool background, int uv_num);
+bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, bool background, int vcol_num);
+bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, bool background);
+void ExportCurveSegments(Mesh *mesh, ParticleCurveData *CData, int interpolation, int segments);
 void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData, int interpolation, bool use_smooth, int segments, float3 RotCam);
 void ExportCurveTriangleRibbons(Mesh *mesh, ParticleCurveData *CData, int interpolation, bool use_smooth, int segments);
 void ExportCurveTriangleGeometry(Mesh *mesh, ParticleCurveData *CData, int interpolation, bool use_smooth, int resolution, int segments);
-void ExportCurveSegments(Mesh *mesh, ParticleCurveData *CData, int interpolation, int segments);
-void ExportCurveTriangleUVs(Mesh *mesh, ParticleCurveData *CData, int interpolation, bool use_smooth, int segments, int vert_offset, int resol);
+void ExportCurveTriangleUV(Mesh *mesh, ParticleCurveData *CData, int interpolation, int segments, int vert_offset, int resol, float3 *uvdata);
+void ExportCurveTriangleVcol(Mesh *mesh, ParticleCurveData *CData, int interpolation, int segments, int vert_offset, int resol, float3 *fdata);
 
 ParticleCurveData::ParticleCurveData()
 {
@@ -152,94 +152,7 @@ void InterpolateKeySegments(int seg, int segno, int key, int curve, float3 *keyl
 		curveinterp_v3_v3v3v3v3(keyloc, &ckey_loc1, &ckey_loc2, &ckey_loc3, &ckey_loc4, t);
 }
 
-bool ObtainParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData)
-{
-
-	int curvenum = 0;
-	int keyno = 0;
-
-	if(!(mesh && b_mesh && b_ob && CData))
-		return false;
-
-	BL::Object::modifiers_iterator b_mod;
-	for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
-		if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && (b_mod->show_viewport()) && (b_mod->show_render())) {
-
-			BL::ParticleSystemModifier psmd(b_mod->ptr);
-
-			BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr);
-
-			BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr);
-
-			if((b_psys.settings().render_type()==BL::ParticleSettings::render_type_PATH)&&(b_psys.settings().type()==BL::ParticleSettings::type_HAIR)) {
-
-				int mi = clamp(b_psys.settings().material()-1, 0, mesh->used_shaders.size()-1);
-				int shader = mesh->used_shaders[mi];
-
-				int totcurves = b_psys.particles.length();
-
-				if(totcurves == 0)
-					continue;
-
-				PointerRNA cpsys = RNA_pointer_get(&b_part.ptr, "cycles");
-
-				CData->psys_firstcurve.push_back(curvenum);
-				CData->psys_curvenum.push_back(totcurves);
-				CData->psys_shader.push_back(shader);
-
-				float radius = b_psys.settings().particle_size() * 0.5f;
-	
-				CData->psys_rootradius.push_back(radius * get_float(cpsys, "root_width"));
-				CData->psys_tipradius.push_back(radius * get_float(cpsys, "tip_width"));
-				CData->psys_shape.push_back(get_float(cpsys, "shape"));
-				CData->psys_closetip.push_back(get_boolean(cpsys, "use_closetip"));
-
-				BL::ParticleSystem::particles_iterator b_pa;
-				for(b_psys.particles.begin(b_pa); b_pa != b_psys.particles.end(); ++b_pa) {
-					CData->curve_firstkey.push_back(keyno);
-
-					int keylength = b_pa->hair_keys.length();
-					CData->curve_keynum.push_back(keylength);
-
-					float curve_length = 0.0f;
-					float3 pcKey;
-					int step_no = 0;
-					BL::Particle::hair_keys_iterator b_cKey;
-					for(b_pa->hair_keys.begin(b_cKey); b_cKey != b_pa->hair_keys.end(); ++b_cKey) {
-						float nco[3];
-						b_cKey->co_object( *b_ob, psmd, *b_pa, nco);
-						float3 cKey = make_float3(nco[0],nco[1],nco[2]);
-						if(step_no > 0)
-							curve_length += len(cKey - pcKey);
-						CData->curvekey_co.push_back(cKey);
-						CData->curvekey_time.push_back(curve_length);
-						pcKey = cKey;
-						keyno++;
-						step_no++;
-					}
-
-					CData->curve_length.push_back(curve_length);
-					/*add uvs*/
-					BL::Mesh::tessface_uv_textures_iterator l;
-					b_mesh->tessface_uv_textures.begin(l);
-
-					float3 uv = make_float3(0.0f, 0.0f, 0.0f);
-					if(b_mesh->tessface_uv_textures.length())
-						b_pa->uv_on_emitter(psmd,&uv.x);
-					CData->curve_uv.push_back(uv);
-
-					curvenum++;
-
-				}
-			}
-		}
-	}
-
-	return true;
-
-}
-
-bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents)
+bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, bool background)
 {
 
 	int curvenum = 0;
@@ -264,12 +177,10 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 
 				int mi = clamp(b_psys.settings().material()-1, 0, mesh->used_shaders.size()-1);
 				int shader = mesh->used_shaders[mi];
-				int draw_step = b_psys.settings().draw_step();
+				int draw_step = background ? b_psys.settings().render_step() : b_psys.settings().draw_step();
 				int ren_step = (int)pow((float)2.0f,(float)draw_step);
-				/*b_psys.settings().render_step(draw_step);*/
-
 				int totparts = b_psys.particles.length();
-				int totchild = b_psys.child_particles.length() * b_psys.settings().draw_percentage() / 100;
+				int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_psys.settings().draw_percentage() / 100.0f);
 				int totcurves = totchild;
 				
 				if(use_parents || b_psys.settings().child_type() == 0)
@@ -328,7 +239,7 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 
 }
 
-bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents)
+bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, bool background, int uv_num)
 {
 #if 0
 	int keyno = 0;
@@ -342,6 +253,8 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
 	Transform itfm = transform_quick_inverse(tfm);
 #endif
 
+	CData->curve_uv.clear();
+
 	BL::Object::modifiers_iterator b_mod;
 	for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
 		if ((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && (b_mod->show_viewport()) && (b_mod->show_render())) {
@@ -355,13 +268,10 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
 #if 0
 				int mi = clamp(b_psys.settings().material()-1, 0, mesh->used_shaders.size()-1);
 				int shader = mesh->used_shaders[mi];
-				int draw_step = b_psys.settings().draw_step();
-				int ren_step = (int)pow((float)2.0f,(float)draw_step);
-				b_psys.settings().render_step(draw_step);
 #endif
 
 				int totparts = b_psys.particles.length();
-				int totchild = b_psys.child_particles.length() * b_psys.settings().draw_percentage() / 100;
+				int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_psys.settings().draw_percentage() / 100.0f);
 				int totcurves = totchild;
 				
 				if (use_parents || b_psys.settings().child_type() == 0)
@@ -384,7 +294,7 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
 
 					float3 uv = make_float3(0.0f, 0.0f, 0.0f);
 					if(b_mesh->tessface_uv_textures.length())
-						b_psys.uv_on_emitter(psmd, *b_pa, pa_no, &uv.x);
+						b_psys.uv_on_emitter(psmd, *b_pa, pa_no, uv_num, &uv.x);
 					CData->curve_uv.push_back(uv);
 
 					if(pa_no < totparts && b_pa != b_psys.particles.end())
@@ -400,7 +310,7 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
 
 }
 
-bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, int vcol_num)
+bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, bool background, int vcol_num)
 {
 #if 0
 	int keyno = 0;
@@ -413,6 +323,8 @@ bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 	Transform itfm = transform_quick_inverse(tfm);
 #endif
 
+	CData->curve_vcol.clear();
+
 	BL::Object::modifiers_iterator b_mod;
 	for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
 		if ((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && (b_mod->show_viewport()) && (b_mod->show_render())) {
@@ -426,12 +338,9 @@ bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 #if 0
 				int mi = clamp(b_psys.settings().material()-1, 0, mesh->used_shaders.size()-1);
 				int shader = mesh->used_shaders[mi];
-				int draw_step = b_psys.settings().draw_step();
-				int ren_step = (int)pow((float)2.0f,(float)draw_step);
-				b_psys.settings().render_step(draw_step);
 #endif
 				int totparts = b_psys.particles.length();
-				int totchild = b_psys.child_particles.length() * b_psys.settings().draw_percentage() / 100;
+				int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_psys.settings().draw_percentage() / 100.0f);
 				int totcurves = totchild;
 				
 				if (use_parents || b_psys.settings().child_type() == 0)
@@ -470,6 +379,18 @@ bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 
 }
 
+static void set_resolution(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, BL::Scene *scene, bool render)
+{
+	BL::Object::modifiers_iterator b_mod;
+	for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
+		if ((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && (b_mod->show_viewport()) && (b_mod->show_render())) {
+			BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr);
+			BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr);
+			b_psys.set_resolution(*scene, *b_ob, (render)? 2: 1);
+		}
+	}
+}
+
 void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData, int interpolation, bool use_smooth, int segments, float3 RotCam)
 {
 	int vertexno = mesh->verts.size();
@@ -507,13 +428,13 @@ void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData, int interpo
 
 					float radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], time);
 
-					if(CData->psys_closetip[sys] && (subv == segments) && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1))
-						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], 0.0f, 0.95f);
-
-					if((curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1) && (subv == segments))
+					if((curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 2) && (subv == segments))
 						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], 0.95f);
 
-					xbasis = normalize(cross(v1,RotCam - ickey_loc));
+					if(CData->psys_closetip[sys] && (subv == segments) && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 2))
+						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], 0.0f, 0.95f);
+
+					xbasis = normalize(cross(RotCam - ickey_loc,v1));
 					float3 ickey_loc_shfl = ickey_loc - radius * xbasis;
 					float3 ickey_loc_shfr = ickey_loc + radius * xbasis;
 					mesh->verts.push_back(ickey_loc_shfl);
@@ -621,12 +542,12 @@ void ExportCurveTriangleRibbons(Mesh *mesh, ParticleCurveData *CData, int interp
 
 					float radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], time);
 
-					if(CData->psys_closetip[sys] && (subv == segments) && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1))
-						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], 0.0f, 0.95f);
-
-					if((curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1) && (subv == segments))
+					if((curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 2) && (subv == segments))
 						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], 0.95f);
 
+					if(CData->psys_closetip[sys] && (subv == segments) && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 2))
+						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], 0.0f, 0.95f);
+
 					float3 ickey_loc_shfl = ickey_loc - radius * xbasis;
 					float3 ickey_loc_shfr = ickey_loc + radius * xbasis;
 					mesh->verts.push_back(ickey_loc_shfl);
@@ -738,12 +659,12 @@ void ExportCurveTriangleGeometry(Mesh *mesh, ParticleCurveData *CData, int inter
 
 					float radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], time);
 
-					if(CData->psys_closetip[sys] && (subv == segments) && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1))
-						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], 0.0f, 0.95f);
-
-					if((curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1) && (subv == segments))
+					if((curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 2) && (subv == segments))
 						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], 0.95f);
 
+					if(CData->psys_closetip[sys] && (subv == segments) && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 2))
+						radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], 0.0f, 0.95f);
+
 					float angle = 2 * M_PI_F / (float)resolution;
 					for(int section = 0 ; section < resolution; section++) {
 						float3 ickey_loc_shf = ickey_loc + radius * (cosf(angle * section) * xbasis + sinf(angle * section) * ybasis);
@@ -782,10 +703,8 @@ static void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CDa
 	if(!(mesh->curves.empty() && mesh->curve_keys.empty()))
 		return;
 
-	Attribute *attr_uv = NULL, *attr_intercept = NULL;
+	Attribute *attr_intercept = NULL;
 	
-	if(mesh->need_attribute(scene, ATTR_STD_UV))
-		attr_uv = mesh->curve_attributes.add(ATTR_STD_UV);
 	if(mesh->need_attribute(scene, ATTR_STD_CURVE_INTERCEPT))
 		attr_intercept = mesh->curve_attributes.add(ATTR_STD_CURVE_INTERCEPT);
 
@@ -831,9 +750,6 @@ static void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CDa
 			}
 
 			mesh->add_curve(num_keys, num_curve_keys, CData->psys_shader[sys]);
-			if(attr_uv)
-				attr_uv->add(CData->curve_uv[curve]);
-
 			num_keys += num_curve_keys;
 			num_curves++;
 		}
@@ -848,17 +764,14 @@ static void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CDa
 	}
 }
 
-void ExportCurveTriangleUVs(Mesh *mesh, ParticleCurveData *CData, int interpolation, bool use_smooth, int segments, int vert_offset, int resol)
+void ExportCurveTriangleUV(Mesh *mesh, ParticleCurveData *CData, int interpolation, int segments, int vert_offset, int resol, float3 *uvdata)
 {
+	if(uvdata == NULL)
+		return;
+
 	float time = 0.0f;
 	float prevtime = 0.0f;
 
-	Attribute *attr = mesh->attributes.find(ATTR_STD_UV);
-	if (attr == NULL)
-		return;
-		
-	float3 *uvdata = attr->data_float3();
-
 	int vertexindex = vert_offset;
 
 	for( int sys = 0; sys < CData->psys_firstcurve.size() ; sys++) {
@@ -907,6 +820,58 @@ void ExportCurveTriangleUVs(Mesh *mesh, ParticleCurveData *CData, int interpolat
 	}
 
 }
+
+void ExportCurveTriangleVcol(Mesh *mesh, ParticleCurveData *CData, int interpolation, int segments, int vert_offset, int resol, float3 *fdata)
+{
+	if(fdata == NULL)
+		return;
+
+	float time = 0.0f;
+//	float prevtime = 0.0f; // UNUSED
+
+	int vertexindex = vert_offset;
+
+	for( int sys = 0; sys < CData->psys_firstcurve.size() ; sys++) {
+		for( int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys] ; curve++) {
+
+			for( int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1; curvekey++) {
+
+				int subv = 1;
+
+				if (curvekey == CData->curve_firstkey[curve])
+					subv = 0;
+				
+				for (; subv <= segments; subv++) {
+
+					float3 ickey_loc = make_float3(0.0f,0.0f,0.0f);
+
+					InterpolateKeySegments(subv, segments, curvekey, curve, &ickey_loc, &time, CData , interpolation);
+
+					if(subv!=0) {
+						for(int section = 0 ; section < resol; section++) {
+							fdata[vertexindex] = color_srgb_to_scene_linear(CData->curve_vcol[curve]);
+							vertexindex++;
+							fdata[vertexindex] = color_srgb_to_scene_linear(CData->curve_vcol[curve]);
+							vertexindex++;
+							fdata[vertexindex] = color_srgb_to_scene_linear(CData->curve_vcol[curve]);
+							vertexindex++;
+							fdata[vertexindex] = color_srgb_to_scene_linear(CData->curve_vcol[curve]);
+							vertexindex++;
+							fdata[vertexindex] = color_srgb_to_scene_linear(CData->curve_vcol[curve]);
+							vertexindex++;
+							fdata[vertexindex] = color_srgb_to_scene_linear(CData->curve_vcol[curve]);
+							vertexindex++;
+						}
+					}
+
+					// prevtime = time;  // UNUSED
+				}
+			}
+		}
+	}
+
+}
+
 /* Hair Curve Sync */
 
 void BlenderSync::sync_curve_settings()
@@ -929,11 +894,11 @@ void BlenderSync::sync_curve_settings()
 		curve_system_manager->resolution = get_int(csscene, "resolution");
 		curve_system_manager->segments = get_int(csscene, "segments");
 		curve_system_manager->use_smooth = get_boolean(csscene, "use_smooth");
+		curve_system_manager->subdivisions = get_int(csscene, "subdivisions");
 
 		curve_system_manager->normalmix = get_float(csscene, "normalmix");
 		curve_system_manager->encasing_ratio = get_float(csscene, "encasing_ratio");
 
-		curve_system_manager->use_cache = get_boolean(csscene, "use_cache");
 		curve_system_manager->use_parents = get_boolean(csscene, "use_parents");
 		curve_system_manager->use_encasing = get_boolean(csscene, "use_encasing");
 		curve_system_manager->use_backfacing = get_boolean(csscene, "use_backfacing");
@@ -947,12 +912,18 @@ void BlenderSync::sync_curve_settings()
 		curve_system_manager->interpolation = CURVE_CARDINAL;
 		curve_system_manager->normalmix = 1.0f;
 		curve_system_manager->encasing_ratio = 1.01f;
-		curve_system_manager->use_cache = true;
 		curve_system_manager->use_parents = false;
 		curve_system_manager->segments = 1;
 		curve_system_manager->use_joined = false;
 
 		switch(preset) {
+			case CURVE_FAST_PLANES:
+				/*camera facing planes*/
+				curve_system_manager->primitive = CURVE_TRIANGLES;
+				curve_system_manager->triangle_method = CURVE_CAMERA_TRIANGLES;
+				curve_system_manager->use_smooth = true;
+				curve_system_manager->resolution = 1;
+				break;
 			case CURVE_TANGENT_SHADING:
 				/*tangent shading*/
 				curve_system_manager->line_method = CURVE_UNCORRECTED;
@@ -980,6 +951,12 @@ void BlenderSync::sync_curve_settings()
 				curve_system_manager->use_tangent_normal_geometry = false;
 				curve_system_manager->use_tangent_normal_correction = false;
 				break;
+			case CURVE_SMOOTH_CURVES:
+				/*Cardinal curves preset*/
+				curve_system_manager->primitive = CURVE_SEGMENTS;
+				curve_system_manager->use_backfacing = true;
+				curve_system_manager->subdivisions = 4;
+				break;
 		}
 		
 	}
@@ -1028,22 +1005,22 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
 	int resolution = scene->curve_system_manager->resolution;
 	int segments = scene->curve_system_manager->segments;
 	bool use_smooth = scene->curve_system_manager->use_smooth;
-	bool use_cache = scene->curve_system_manager->use_cache;
 	bool use_parents = scene->curve_system_manager->use_parents;
 	bool export_tgs = scene->curve_system_manager->use_joined;
+	size_t vert_num = mesh->verts.size();
+	size_t tri_num = mesh->triangles.size();
+	int used_res = 1;
 
 	/* extract particle hair data - should be combined with connecting to mesh later*/
 
 	ParticleCurveData CData;
 
-	if(use_cache) {
-		ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, use_parents);
-		ObtainCacheParticleUV(mesh, &b_mesh, &b_ob, &CData, use_parents);
-	}
-	else
-		ObtainParticleData(mesh, &b_mesh, &b_ob, &CData);
+	if(!preview)
+		set_resolution(mesh, &b_mesh, &b_ob, &b_scene, true);
+
+	ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, use_parents, !preview);
 
-	/* attach strands to mesh */
+	/* obtain camera parameters */
 	BL::Object b_CamOb = b_scene.camera();
 	float3 RotCam = make_float3(0.0f, 0.0f, 0.0f);
 	if(b_CamOb) {
@@ -1053,21 +1030,16 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
 		RotCam = transform_point(&itfm, make_float3(ctfm.x.w, ctfm.y.w, ctfm.z.w));
 	}
 
+	/* add hair geometry to mesh */
 	if(primitive == CURVE_TRIANGLES){
-		int vert_num = mesh->triangles.size() * 3;
-		if(triangle_method == CURVE_CAMERA) {
+		if(triangle_method == CURVE_CAMERA_TRIANGLES)
 			ExportCurveTrianglePlanes(mesh, &CData, interpolation, use_smooth, segments, RotCam);
-			ExportCurveTriangleUVs(mesh, &CData, interpolation, use_smooth, segments, vert_num, 1);
-		}
-		else if(triangle_method == CURVE_RIBBONS) {
+		else if(triangle_method == CURVE_RIBBON_TRIANGLES)
 			ExportCurveTriangleRibbons(mesh, &CData, interpolation, use_smooth, segments);
-			ExportCurveTriangleUVs(mesh, &CData, interpolation, use_smooth, segments, vert_num, 1);
-		}
 		else {
 			ExportCurveTriangleGeometry(mesh, &CData, interpolation, use_smooth, resolution, segments);
-			ExportCurveTriangleUVs(mesh, &CData, interpolation, use_smooth, segments, vert_num, resolution);
+			used_res = resolution;
 		}
-
 	}
 	else {
 		ExportCurveSegments(scene, mesh, &CData, interpolation, segments);
@@ -1085,24 +1057,38 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
 				data_tangent[ck] = tg;
 			}
 		}
+	}
+
 
-		/* generated coordinates from first key. we should ideally get this from
-		 * blender to handle deforming objects */
+	/* generated coordinates from first key. we should ideally get this from
+	 * blender to handle deforming objects */
+	{
 		if(mesh->need_attribute(scene, ATTR_STD_GENERATED)) {
 			float3 loc, size;
 			mesh_texture_space(b_mesh, loc, size);
 
-			Attribute *attr_generated = mesh->curve_attributes.add(ATTR_STD_GENERATED);
-			float3 *generated = attr_generated->data_float3();
-			size_t i = 0;
+			if(primitive == CURVE_TRIANGLES) {
+				Attribute *attr_generated = mesh->attributes.add(ATTR_STD_GENERATED);
+				float3 *generated = attr_generated->data_float3();
 
-			foreach(Mesh::Curve& curve, mesh->curves) {
-				float3 co = mesh->curve_keys[curve.first_key].co;
-				generated[i++] = co*size - loc;
+				for(size_t i = vert_num; i < mesh->verts.size(); i++)
+					generated[i] = mesh->verts[i]*size - loc;
+			}
+			else {
+				Attribute *attr_generated = mesh->curve_attributes.add(ATTR_STD_GENERATED);
+				float3 *generated = attr_generated->data_float3();
+				size_t i = 0;
+
+				foreach(Mesh::Curve& curve, mesh->curves) {
+					float3 co = mesh->curve_keys[curve.first_key].co;
+					generated[i++] = co*size - loc;
+				}
 			}
 		}
+	}
 
-		/* create vertex color attributes */
+	/* create vertex color attributes */
+	{
 		BL::Mesh::tessface_vertex_colors_iterator l;
 		int vcol_num = 0;
 
@@ -1110,26 +1096,77 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
 			if(!mesh->need_attribute(scene, ustring(l->name().c_str())))
 				continue;
 
-			/*error occurs with more than one vertex colour attribute so avoided*/
-			if(vcol_num!=0)
-				break;
+			ObtainCacheParticleVcol(mesh, &b_mesh, &b_ob, &CData, use_parents, !preview, vcol_num);
 
-			Attribute *attr_vcol = mesh->curve_attributes.add(
-				ustring(l->name().c_str()), TypeDesc::TypeColor, ATTR_ELEMENT_CURVE);
+			if(primitive == CURVE_TRIANGLES) {
 
-			ObtainCacheParticleVcol(mesh, &b_mesh, &b_ob, &CData, use_parents, 0);
+				Attribute *attr_vcol = mesh->attributes.add(
+					ustring(l->name().c_str()), TypeDesc::TypeColor, ATTR_ELEMENT_CORNER);
 
-			float3 *vcol = attr_vcol->data_float3();
+				float3 *fdata = attr_vcol->data_float3();
 
-			if(vcol) {
-				for(size_t curve = 0; curve < CData.curve_vcol.size() ;curve++)
-					vcol[curve] = color_srgb_to_scene_linear(CData.curve_vcol[curve]);
+				ExportCurveTriangleVcol(mesh, &CData, interpolation, segments, tri_num * 3, used_res, fdata);
 			}
+			else {
+				Attribute *attr_vcol = mesh->curve_attributes.add(
+					ustring(l->name().c_str()), TypeDesc::TypeColor, ATTR_ELEMENT_CURVE);
+
+				float3 *fdata = attr_vcol->data_float3();
 
+				if(fdata) {
+					for(size_t curve = 0; curve < CData.curve_vcol.size() ;curve++)
+						fdata[curve] = color_srgb_to_scene_linear(CData.curve_vcol[curve]);
+				}
+			}
 		}
+	}
+
+	/* create UV attributes */
+	{
+		BL::Mesh::tessface_uv_textures_iterator l;
+		int uv_num = 0;
+
+		for(b_mesh.tessface_uv_textures.begin(l); l != b_mesh.tessface_uv_textures.end(); ++l, uv_num++) {
+			bool active_render = l->active_render();
+			AttributeStandard std = (active_render)? ATTR_STD_UV: ATTR_STD_NONE;
+			ustring name = ustring(l->name().c_str());
+
+			/* UV map */
+			if(mesh->need_attribute(scene, name) || mesh->need_attribute(scene, std)) {
+				Attribute *attr_uv;
+
+				ObtainCacheParticleUV(mesh, &b_mesh, &b_ob, &CData, use_parents, !preview, uv_num);
+
+				if(primitive == CURVE_TRIANGLES) {
+					if(active_render)
+						attr_uv = mesh->attributes.add(std, name);
+					else
+						attr_uv = mesh->attributes.add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CORNER);
+
+					float3 *uv = attr_uv->data_float3();
+
+					ExportCurveTriangleUV(mesh, &CData, interpolation, segments, tri_num * 3, used_res, uv);
+				}
+				else {
+					if(active_render)
+						attr_uv = mesh->curve_attributes.add(std, name);
+					else
+						attr_uv = mesh->curve_attributes.add(name, TypeDesc::TypePoint,  ATTR_ELEMENT_CURVE);
 
+					float3 *uv = attr_uv->data_float3();
+
+					if(uv) {
+						for(size_t curve = 0; curve < CData.curve_uv.size(); curve++)
+							uv[curve] = CData.curve_uv[curve];
+					}
+				}
+			}
+		}
 	}
 
+	if(!preview)
+		set_resolution(mesh, &b_mesh, &b_ob, &b_scene, false);
+
 	mesh->compute_bounds();
 }
 
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index 1dd7800..c61a7fa 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -313,7 +313,7 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
 			std = (active_render)? ATTR_STD_UV_TANGENT: ATTR_STD_NONE;
 			name = ustring((string(l->name().c_str()) + ".tangent").c_str());
 
-			if(mesh->need_attribute(scene, name) || mesh->need_attribute(scene, std)) {
+			if(mesh->need_attribute(scene, name) || (active_render && mesh->need_attribute(scene, std))) {
 				std = (active_render)? ATTR_STD_UV_TANGENT_SIGN: ATTR_STD_NONE;
 				name = ustring((string(l->name().c_str()) + ".tangent_sign").c_str());
 				bool need_sign = (mesh->need_attribute(scene, name) || mesh->need_attribute(scene, std));
@@ -435,7 +435,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
 	mesh_synced.insert(mesh);
 
 	/* create derived mesh */
-	BL::Mesh b_mesh = object_to_mesh(b_ob, b_scene, true, !preview);
+	BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview);
 	PointerRNA cmesh = RNA_pointer_get(&b_ob_data.ptr, "cycles");
 
 	vector<Mesh::Triangle> oldtriangle = mesh->triangles;
@@ -507,7 +507,7 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion)
 		return;
 
 	/* get derived mesh */
-	BL::Mesh b_mesh = object_to_mesh(b_ob, b_scene, true, !preview);
+	BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview);
 
 	if(b_mesh) {
 		BL::Mesh::vertices_iterator v;
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index e9bcea7..a9d37db 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -156,6 +156,7 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI
 	/* shadow */
 	PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles");
 	light->cast_shadow = get_boolean(clamp, "cast_shadow");
+	light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling");
 	light->samples = get_int(clamp, "samples");
 
 	/* tag */
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp
index d164920..a10f3b6 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -52,8 +52,9 @@ static PyObject *init_func(PyObject *self, PyObject *args)
 static PyObject *create_func(PyObject *self, PyObject *args)
 {
 	PyObject *pyengine, *pyuserpref, *pydata, *pyscene, *pyregion, *pyv3d, *pyrv3d;
+	int preview_osl;
 
-	if(!PyArg_ParseTuple(args, "OOOOOOO", &pyengine, &pyuserpref, &pydata, &pyscene, &pyregion, &pyv3d, &pyrv3d))
+	if(!PyArg_ParseTuple(args, "OOOOOOOi", &pyengine, &pyuserpref, &pydata, &pyscene, &pyregion, &pyv3d, &pyrv3d, &preview_osl))
 		return NULL;
 
 	/* RNA */
@@ -91,14 +92,22 @@ static PyObject *create_func(PyObject *self, PyObject *args)
 	Py_BEGIN_ALLOW_THREADS
 
 	if(rv3d) {
-		/* interactive session */
+		/* interactive viewport session */
 		int width = region.width();
 		int height = region.height();
 
 		session = new BlenderSession(engine, userpref, data, scene, v3d, rv3d, width, height);
 	}
 	else {
-		/* offline session */
+		/* override some settings for preview */
+		if(engine.is_preview()) {
+			PointerRNA cscene = RNA_pointer_get(&sceneptr, "cycles");
+
+			RNA_boolean_set(&cscene, "shading_system", preview_osl);
+			RNA_boolean_set(&cscene, "use_progressive_refine", true);
+		}
+
+		/* offline session or preview render */
 		session = new BlenderSession(engine, userpref, data, scene);
 	}
 
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp
index 60dfe37..dda7eb0 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -111,9 +111,9 @@ void BlenderSession::create_session()
 	b_engine.use_highlight_tiles(session_params.progressive_refine == false);
 
 	/* setup callbacks for builtin image support */
-	scene->image_manager->builtin_image_info_cb = function_bind(&BlenderSession::builtin_image_info, this, _1, _2, _3, _4, _5);
-	scene->image_manager->builtin_image_pixels_cb = function_bind(&BlenderSession::builtin_image_pixels, this, _1, _2);
-	scene->image_manager->builtin_image_float_pixels_cb = function_bind(&BlenderSession::builtin_image_float_pixels, this, _1, _2);
+	scene->image_manager->builtin_image_info_cb = function_bind(&BlenderSession::builtin_image_info, this, _1, _2, _3, _4, _5, _6);
+	scene->image_manager->builtin_image_pixels_cb = function_bind(&BlenderSession::builtin_image_pixels, this, _1, _2, _3);
+	scene->image_manager->builtin_image_float_pixels_cb = function_bind(&BlenderSession::builtin_image_float_pixels, this, _1, _2, _3);
 }
 
 void BlenderSession::reset_session(BL::BlendData b_data_, BL::Scene b_scene_)
@@ -128,7 +128,8 @@ void BlenderSession::reset_session(BL::BlendData b_data_, BL::Scene b_scene_)
 	height = b_engine.resolution_y();
 
 	if(scene->params.modified(scene_params) ||
-	   session->params.modified(session_params))
+	   session->params.modified(session_params) ||
+	   !scene_params.persistent_data)
 	{
 		/* if scene or session parameters changed, it's easier to simply re-create
 		 * them rather than trying to distinguish which settings need to be updated
@@ -288,7 +289,14 @@ void BlenderSession::write_render_tile(RenderTile& rtile)
 
 void BlenderSession::update_render_tile(RenderTile& rtile)
 {
-	do_write_update_render_tile(rtile, true);
+	/* use final write for preview renders, otherwise render result wouldn't be
+	 * be updated in blender side
+	 * would need to be investigated a bit further, but for now shall be fine
+	 */
+	if (!b_engine.is_preview())
+		do_write_update_render_tile(rtile, true);
+	else
+		do_write_update_render_tile(rtile, false);
 }
 
 void BlenderSession::render()
@@ -403,8 +411,10 @@ void BlenderSession::do_write_update_render_result(BL::RenderResult b_rr, BL::Re
 			int components = b_pass.channels();
 
 			/* copy pixels */
-			if(buffers->get_pass_rect(pass_type, exposure, rtile.sample, components, &pixels[0]))
-				b_pass.rect(&pixels[0]);
+			if(!buffers->get_pass_rect(pass_type, exposure, rtile.sample, components, &pixels[0]))
+				memset(&pixels[0], 0, pixels.size()*sizeof(float));
+
+			b_pass.rect(&pixels[0]);
 		}
 	}
 
@@ -486,11 +496,10 @@ bool BlenderSession::draw(int w, int h)
 		}
 		else {
 			/* update camera from 3d view */
-			bool need_update = scene->camera->need_update;
 
 			sync->sync_view(b_v3d, b_rv3d, w, h);
 
-			if(scene->camera->need_update && !need_update)
+			if(scene->camera->need_update)
 				reset = true;
 
 			session->scene->mutex.unlock();
@@ -511,6 +520,9 @@ bool BlenderSession::draw(int w, int h)
 			session->reset(buffer_params, session_params.samples);
 		}
 	}
+	else {
+		tag_update();
+	}
 
 	/* update status and progress for 3d view draw */
 	update_status_progress();
@@ -612,9 +624,22 @@ void BlenderSession::test_cancel()
 			session->progress.set_cancel("Cancelled");
 }
 
-void BlenderSession::builtin_image_info(const string &name, bool &is_float, int &width, int &height, int &channels)
+/* builtin image file name is actually an image datablock name with
+ * absolute sequence frame number concatenated via '@' character
+ *
+ * this function splits frame from builtin name
+ */
+int BlenderSession::builtin_image_frame(const string &builtin_name)
+{
+	int last = builtin_name.find_last_of('@');
+	return atoi(builtin_name.substr(last + 1, builtin_name.size() - last - 1).c_str());
+}
+
+void BlenderSession::builtin_image_info(const string &builtin_name, void *builtin_data, bool &is_float, int &width, int &height, int &channels)
 {
-	BL::Image b_image = b_data.images[name];
+	PointerRNA ptr;
+	RNA_id_pointer_create((ID*)builtin_data, &ptr);
+	BL::Image b_image(ptr);
 
 	if(b_image) {
 		is_float = b_image.is_float();
@@ -630,25 +655,40 @@ void BlenderSession::builtin_image_info(const string &name, bool &is_float, int
 	}
 }
 
-bool BlenderSession::builtin_image_pixels(const string &name, unsigned char *pixels)
+bool BlenderSession::builtin_image_pixels(const string &builtin_name, void *builtin_data, unsigned char *pixels)
 {
-	BL::Image b_image = b_data.images[name];
+	int frame = builtin_image_frame(builtin_name);
+
+	PointerRNA ptr;
+	RNA_id_pointer_create((ID*)builtin_data, &ptr);
+	BL::Image b_image(ptr);
 
 	if(b_image) {
 		int width = b_image.size()[0];
 		int height = b_image.size()[1];
 		int channels = b_image.channels();
 
-		BL::DynamicArray<float> pixels_array = b_image.pixels();
-		float *float_pixels = pixels_array.data;
+		unsigned char *image_pixels;
+		image_pixels = image_get_pixels_for_frame(b_image, frame);
 
-		/* a bit of shame, but Py API currently only returns float array,
-		 * which need to be converted back to char buffer
-		 */
-		unsigned char *cp = pixels;
-		float *fp = float_pixels;
-		for(int i = 0; i < channels * width * height; i++, cp++, fp++) {
-			*cp = *fp * 255;
+		if(image_pixels) {
+			memcpy(pixels, image_pixels, width * height * channels * sizeof(unsigned char));
+			MEM_freeN(image_pixels);
+		}
+		else {
+			if(channels == 1) {
+				memset(pixels, 0, width * height * sizeof(unsigned char));
+			}
+			else {
+				unsigned char *cp = pixels;
+				for(int i = 0; i < width * height; i++, cp += channels) {
+					cp[0] = 255;
+					cp[1] = 0;
+					cp[2] = 255;
+					if(channels == 4)
+						cp[3] = 255;
+				}
+			}
 		}
 
 		return true;
@@ -657,18 +697,41 @@ bool BlenderSession::builtin_image_pixels(const string &name, unsigned char *pix
 	return false;
 }
 
-bool BlenderSession::builtin_image_float_pixels(const string &name, float *pixels)
+bool BlenderSession::builtin_image_float_pixels(const string &builtin_name, void *builtin_data, float *pixels)
 {
-	BL::Image b_image = b_data.images[name];
+	int frame = builtin_image_frame(builtin_name);
+
+	PointerRNA ptr;
+	RNA_id_pointer_create((ID*)builtin_data, &ptr);
+	BL::Image b_image(ptr);
 
 	if(b_image) {
 		int width = b_image.size()[0];
 		int height = b_image.size()[1];
 		int channels = b_image.channels();
 
-		BL::DynamicArray<float> pixels_array = b_image.pixels();
+		float *image_pixels;
+		image_pixels = image_get_float_pixels_for_frame(b_image, frame);
 
-		memcpy(pixels, pixels_array.data, width * height * channels * sizeof(float));
+		if(image_pixels) {
+			memcpy(pixels, image_pixels, width * height * channels * sizeof(float));
+			MEM_freeN(image_pixels);
+		}
+		else {
+			if(channels == 1) {
+				memset(pixels, 0, width * height * sizeof(float));
+			}
+			else {
+				float *fp = pixels;
+				for(int i = 0; i < width * height; i++, fp += channels) {
+					fp[0] = 1.0f;
+					fp[1] = 0.0f;
+					fp[2] = 1.0f;
+					if(channels == 4)
+						fp[3] = 1.0f;
+				}
+			}
+		}
 
 		return true;
 	}
diff --git a/intern/cycles/blender/blender_session.h b/intern/cycles/blender/blender_session.h
index dfa487b..0210df9 100644
--- a/intern/cycles/blender/blender_session.h
+++ b/intern/cycles/blender/blender_session.h
@@ -94,9 +94,10 @@ protected:
 	void do_write_update_render_result(BL::RenderResult b_rr, BL::RenderLayer b_rlay, RenderTile& rtile, bool do_update_only);
 	void do_write_update_render_tile(RenderTile& rtile, bool do_update_only);
 
-	void builtin_image_info(const string &name, bool &is_float, int &width, int &height, int &channels);
-	bool builtin_image_pixels(const string &name, unsigned char *pixels);
-	bool builtin_image_float_pixels(const string &name, float *pixels);
+	int builtin_image_frame(const string &builtin_name);
+	void builtin_image_info(const string &builtin_name, void *builtin_data, bool &is_float, int &width, int &height, int &channels);
+	bool builtin_image_pixels(const string &builtin_name, void *builtin_data, unsigned char *pixels);
+	bool builtin_image_float_pixels(const string &builtin_name, void *builtin_data, float *pixels);
 };
 
 CCL_NAMESPACE_END
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 3bb02bb..0f7dc15 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -511,22 +511,29 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
 			BL::ShaderNodeTexImage b_image_node(b_node);
 			BL::Image b_image(b_image_node.image());
 			ImageTextureNode *image = new ImageTextureNode();
-			/* todo: handle movie images */
-			if(b_image && b_image.source() != BL::Image::source_MOVIE) {
+			if(b_image) {
 				/* builtin images will use callback-based reading because
 				 * they could only be loaded correct from blender side
 				 */
 				bool is_builtin = b_image.packed_file() ||
-				                  b_image.source() == BL::Image::source_GENERATED;
+				                  b_image.source() == BL::Image::source_GENERATED ||
+				                  b_image.source() == BL::Image::source_MOVIE;
 
 				if(is_builtin) {
-					/* for builtin images we're using image datablock name to find an image to read pixels from later */
-					image->filename = b_image.name();
-					image->is_builtin = true;
+					/* for builtin images we're using image datablock name to find an image to
+					 * read pixels from later
+					 *
+					 * also store frame number as well, so there's no differences in handling
+					 * builtin names for packed images and movies
+					 */
+					int scene_frame = b_scene.frame_current();
+					int image_frame = image_user_frame_number(b_image_node.image_user(), scene_frame);
+					image->filename = b_image.name() + "@" + string_printf("%d", image_frame);
+					image->builtin_data = b_image.ptr.data;
 				}
 				else {
 					image->filename = image_user_file_path(b_image_node.image_user(), b_image, b_scene.frame_current());
-					image->is_builtin = false;
+					image->builtin_data = NULL;
 				}
 
 				image->animated = b_image_node.image_user().use_auto_refresh();
@@ -542,17 +549,21 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
 			BL::ShaderNodeTexEnvironment b_env_node(b_node);
 			BL::Image b_image(b_env_node.image());
 			EnvironmentTextureNode *env = new EnvironmentTextureNode();
-			if(b_image && b_image.source() != BL::Image::source_MOVIE) {
+			if(b_image) {
 				bool is_builtin = b_image.packed_file() ||
-				                  b_image.source() == BL::Image::source_GENERATED;
+				                  b_image.source() == BL::Image::source_GENERATED ||
+				                  b_image.source() == BL::Image::source_MOVIE;
 
 				if(is_builtin) {
-					env->filename = b_image.name();
-					env->is_builtin = true;
+					int scene_frame = b_scene.frame_current();
+					int image_frame = image_user_frame_number(b_env_node.image_user(), scene_frame);
+					env->filename = b_image.name() + "@" + string_printf("%d", image_frame);
+					env->builtin_data = b_image.ptr.data;
 				}
 				else {
 					env->filename = image_user_file_path(b_env_node.image_user(), b_image, b_scene.frame_current());
 					env->animated = b_env_node.image_user().use_auto_refresh();
+					env->builtin_data = NULL;
 				}
 			}
 			env->color_space = EnvironmentTextureNode::color_space_enum[(int)b_env_node.color_space()];
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index a2a8c23..f6ff78a 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -307,7 +307,10 @@ SceneParams BlenderSync::get_scene_params(BL::Scene b_scene, bool background)
 	params.use_bvh_spatial_split = RNA_boolean_get(&cscene, "debug_use_spatial_splits");
 	params.use_bvh_cache = (background)? RNA_boolean_get(&cscene, "use_cache"): false;
 
-	params.persistent_images = (background)? r.use_persistent_data(): false;
+	if(background && params.shadingsystem != SceneParams::OSL)
+		params.persistent_data = r.use_persistent_data();
+	else
+		params.persistent_data = false;
 
 	return params;
 }
@@ -359,22 +362,22 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
 	params.background = background;
 
 	/* samples */
-	if(get_boolean(cscene, "progressive")) {
+	if(get_boolean(cscene, "progressive") == 0 && params.device.type == DEVICE_CPU){
 		if(background) {
-			params.samples = get_int(cscene, "samples");
+			params.samples = get_int(cscene, "aa_samples");
 		}
 		else {
-			params.samples = get_int(cscene, "preview_samples");
+			params.samples = get_int(cscene, "preview_aa_samples");
 			if(params.samples == 0)
 				params.samples = INT_MAX;
 		}
 	}
 	else {
 		if(background) {
-			params.samples = get_int(cscene, "aa_samples");
+			params.samples = get_int(cscene, "samples");
 		}
 		else {
-			params.samples = get_int(cscene, "preview_aa_samples");
+			params.samples = get_int(cscene, "preview_samples");
 			if(params.samples == 0)
 				params.samples = INT_MAX;
 		}
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index 88c9886..976ed87 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -33,13 +33,15 @@ extern "C" {
 void BLI_timestr(double _time, char *str);
 void BKE_image_user_frame_calc(void *iuser, int cfra, int fieldnr);
 void BKE_image_user_file_path(void *iuser, void *ima, char *path);
+unsigned char *BKE_image_get_pixels_for_frame(void *image, int frame);
+float *BKE_image_get_float_pixels_for_frame(void *image, int frame);
 }
 
 CCL_NAMESPACE_BEGIN
 
-static inline BL::Mesh object_to_mesh(BL::Object self, BL::Scene scene, bool apply_modifiers, bool render)
+static inline BL::Mesh object_to_mesh(BL::BlendData data, BL::Object object, BL::Scene scene, bool apply_modifiers, bool render)
 {
-	return self.to_mesh(scene, apply_modifiers, (render)? 2: 1);
+	return data.meshes.new_from_object(scene, object, apply_modifiers, (render)? 2: 1, true);
 }
 
 static inline void colorramp_to_array(BL::ColorRamp ramp, float4 *data, int size)
@@ -100,6 +102,22 @@ static inline string image_user_file_path(BL::ImageUser iuser, BL::Image ima, in
 	return string(filepath);
 }
 
+static inline int image_user_frame_number(BL::ImageUser iuser, int cfra)
+{
+	BKE_image_user_frame_calc(iuser.ptr.data, cfra, 0);
+	return iuser.frame_current();
+}
+
+static inline unsigned char *image_get_pixels_for_frame(BL::Image image, int frame)
+{
+	return BKE_image_get_pixels_for_frame(image.ptr.data, frame);
+}
+
+static inline float *image_get_float_pixels_for_frame(BL::Image image, int frame)
+{
+	return BKE_image_get_float_pixels_for_frame(image.ptr.data, frame);
+}
+
 /* Utilities */
 
 static inline Transform get_transform(BL::Array<float, 16> array)
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 412b440..f11b3c4 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -18,6 +18,7 @@
 #include "mesh.h"
 #include "object.h"
 #include "scene.h"
+#include "curves.h"
 
 #include "bvh.h"
 #include "bvh_build.h"
@@ -29,6 +30,7 @@
 #include "util_foreach.h"
 #include "util_map.h"
 #include "util_progress.h"
+#include "util_system.h"
 #include "util_types.h"
 
 CCL_NAMESPACE_BEGIN
@@ -70,6 +72,7 @@ BVH *BVH::create(const BVHParams& params, const vector<Object*>& objects)
 
 bool BVH::cache_read(CacheData& key)
 {
+	key.add(system_cpu_bits());
 	key.add(&params, sizeof(params));
 
 	foreach(Object *ob, objects) {
@@ -339,6 +342,10 @@ void BVH::pack_primitives()
 			Object *ob = objects[tob];
 			pack.prim_visibility[i] = ob->visibility;
 		}
+		else {
+			memset(&pack.tri_woop[i * nsize], 0, sizeof(float4)*3);
+			pack.prim_visibility[i] = 0;
+		}
 	}
 }
 
@@ -475,7 +482,7 @@ void BVH::pack_instances(size_t nodes_size)
 		}
 
 		/* merge nodes */
-		if( bvh->pack.nodes.size()) {
+		if(bvh->pack.nodes.size()) {
 			size_t nsize_bbox = (use_qbvh)? nsize-2: nsize-1;
 			int4 *bvh_nodes = &bvh->pack.nodes[0];
 			size_t bvh_nodes_size = bvh->pack.nodes.size(); 
@@ -631,8 +638,19 @@ void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility
 					int k0 = mesh->curves[pidx - str_offset].first_key + pack.prim_segment[prim]; // XXX!
 					int k1 = k0 + 1;
 
-					bbox.grow(mesh->curve_keys[k0].co, mesh->curve_keys[k0].radius);
-					bbox.grow(mesh->curve_keys[k1].co, mesh->curve_keys[k1].radius);
+					float3 p[4];
+					p[0] = mesh->curve_keys[max(k0 - 1,mesh->curves[pidx - str_offset].first_key)].co;
+					p[1] = mesh->curve_keys[k0].co;
+					p[2] = mesh->curve_keys[k1].co;
+					p[3] = mesh->curve_keys[min(k1 + 1,mesh->curves[pidx - str_offset].first_key + mesh->curves[pidx - str_offset].num_keys - 1)].co;
+					float3 lower;
+					float3 upper;
+					curvebounds(&lower.x, &upper.x, p, 0);
+					curvebounds(&lower.y, &upper.y, p, 1);
+					curvebounds(&lower.z, &upper.z, p, 2);
+					float mr = max(mesh->curve_keys[k0].radius,mesh->curve_keys[k1].radius);
+					bbox.grow(lower, mr);
+					bbox.grow(upper, mr);
 				}
 				else {
 					/* triangles */
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index 38fb1a1..022c4c8 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -24,6 +24,7 @@
 #include "mesh.h"
 #include "object.h"
 #include "scene.h"
+#include "curves.h"
 
 #include "util_debug.h"
 #include "util_foreach.h"
@@ -91,11 +92,20 @@ void BVHBuild::add_reference_mesh(BoundBox& root, BoundBox& center, Mesh *mesh,
 		for(int k = 0; k < curve.num_keys - 1; k++) {
 			BoundBox bounds = BoundBox::empty;
 
-			float3 co0 = mesh->curve_keys[curve.first_key + k].co;
-			float3 co1 = mesh->curve_keys[curve.first_key + k + 1].co;
-
-			bounds.grow(co0, mesh->curve_keys[curve.first_key + k].radius);
-			bounds.grow(co1, mesh->curve_keys[curve.first_key + k + 1].radius);
+			float3 co[4];
+			co[0] = mesh->curve_keys[max(curve.first_key + k - 1,curve.first_key)].co;
+			co[1] = mesh->curve_keys[curve.first_key + k].co;
+			co[2] = mesh->curve_keys[curve.first_key + k + 1].co;
+			co[3] = mesh->curve_keys[min(curve.first_key + k + 2, curve.first_key + curve.num_keys - 1)].co;
+
+			float3 lower;
+			float3 upper;
+			curvebounds(&lower.x, &upper.x, co, 0);
+			curvebounds(&lower.y, &upper.y, co, 1);
+			curvebounds(&lower.z, &upper.z, co, 2);
+			float mr = max(mesh->curve_keys[curve.first_key + k].radius, mesh->curve_keys[curve.first_key + k + 1].radius);
+			bounds.grow(lower, mr);
+			bounds.grow(upper, mr);
 
 			if(bounds.valid()) {
 				references.push_back(BVHReference(bounds, j, i, k));
diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt
index 661d43a..fe2368b 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -23,7 +23,9 @@ set(SRC
 )
 
 if(WITH_NETWORK)
-	list(APPEND SRC device_network.cpp)
+	list(APPEND SRC
+		device_network.cpp
+	)
 endif()
 
 set(SRC_HEADERS
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index a1d7706..c2ba91f 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -58,7 +58,8 @@ public:
 #endif
 
 		/* do now to avoid thread issues */
-		system_cpu_support_optimized();
+		system_cpu_support_sse2();
+		system_cpu_support_sse3();
 	}
 
 	~CPUDevice()
@@ -170,7 +171,7 @@ public:
 			int end_sample = tile.start_sample + tile.num_samples;
 
 #ifdef WITH_OPTIMIZED_KERNEL
-			if(system_cpu_support_optimized()) {
+			if(system_cpu_support_sse3()) {
 				for(int sample = start_sample; sample < end_sample; sample++) {
 					if (task.get_cancel() || task_pool.cancelled()) {
 						if(task.need_finish_queue == false)
@@ -179,7 +180,26 @@ public:
 
 					for(int y = tile.y; y < tile.y + tile.h; y++) {
 						for(int x = tile.x; x < tile.x + tile.w; x++) {
-							kernel_cpu_optimized_path_trace(&kg, render_buffer, rng_state,
+							kernel_cpu_sse3_path_trace(&kg, render_buffer, rng_state,
+								sample, x, y, tile.offset, tile.stride);
+						}
+					}
+
+					tile.sample = sample + 1;
+
+					task.update_progress(tile);
+				}
+			}
+			else if(system_cpu_support_sse2()) {
+				for(int sample = start_sample; sample < end_sample; sample++) {
+					if (task.get_cancel() || task_pool.cancelled()) {
+						if(task.need_finish_queue == false)
+							break;
+					}
+
+					for(int y = tile.y; y < tile.y + tile.h; y++) {
+						for(int x = tile.x; x < tile.x + tile.w; x++) {
+							kernel_cpu_sse2_path_trace(&kg, render_buffer, rng_state,
 								sample, x, y, tile.offset, tile.stride);
 						}
 					}
@@ -227,10 +247,16 @@ public:
 	void thread_tonemap(DeviceTask& task)
 	{
 #ifdef WITH_OPTIMIZED_KERNEL
-		if(system_cpu_support_optimized()) {
+		if(system_cpu_support_sse3()) {
+			for(int y = task.y; y < task.y + task.h; y++)
+				for(int x = task.x; x < task.x + task.w; x++)
+					kernel_cpu_sse3_tonemap(&kernel_globals, (uchar4*)task.rgba, (float*)task.buffer,
+						task.sample, task.resolution, x, y, task.offset, task.stride);
+		}
+		else if(system_cpu_support_sse2()) {
 			for(int y = task.y; y < task.y + task.h; y++)
 				for(int x = task.x; x < task.x + task.w; x++)
-					kernel_cpu_optimized_tonemap(&kernel_globals, (uchar4*)task.rgba, (float*)task.buffer,
+					kernel_cpu_sse2_tonemap(&kernel_globals, (uchar4*)task.rgba, (float*)task.buffer,
 						task.sample, task.resolution, x, y, task.offset, task.stride);
 		}
 		else
@@ -252,9 +278,17 @@ public:
 #endif
 
 #ifdef WITH_OPTIMIZED_KERNEL
-		if(system_cpu_support_optimized()) {
+		if(system_cpu_support_sse3()) {
+			for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) {
+				kernel_cpu_sse3_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x);
+
+				if(task_pool.cancelled())
+					break;
+			}
+		}
+		else if(system_cpu_support_sse2()) {
 			for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) {
-				kernel_cpu_optimized_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x);
+				kernel_cpu_sse2_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x);
 
 				if(task_pool.cancelled())
 					break;
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 040f304..7708200 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -109,11 +109,11 @@ public:
 		}
 	}
 
-#ifdef NDEBUG
+/*#ifdef NDEBUG
 #define cuda_abort()
 #else
 #define cuda_abort() abort()
-#endif
+#endif*/
 
 #define cuda_assert(stmt) \
 	{ \
@@ -128,19 +128,21 @@ public:
 		} \
 	}
 
-	bool cuda_error(CUresult result)
+	bool cuda_error_(CUresult result, const string& stmt)
 	{
 		if(result == CUDA_SUCCESS)
 			return false;
 
-		string message = string_printf("CUDA error: %s", cuda_error_string(result));
+		string message = string_printf("CUDA error at %s: %s", stmt.c_str(), cuda_error_string(result));
 		if(error_msg == "")
 			error_msg = message;
 		fprintf(stderr, "%s\n", message.c_str());
 		return true;
 	}
 
-	void cuda_error(const string& message)
+#define cuda_error(stmt) cuda_error_(stmt, #stmt)
+
+	void cuda_error_message(const string& message)
 	{
 		if(error_msg == "")
 			error_msg = message;
@@ -187,7 +189,7 @@ public:
 			}
 		}
 
-		if(cuda_error(result))
+		if(cuda_error_(result, "cuCtxCreate"))
 			return;
 
 		cuda_pop_context();
@@ -208,7 +210,7 @@ public:
 			cuDeviceComputeCapability(&major, &minor, cuDevId);
 
 			if(major <= 1 && minor <= 2) {
-				cuda_error(string_printf("CUDA device supported only with compute capability 1.3 or up, found %d.%d.", major, minor));
+				cuda_error_message(string_printf("CUDA device supported only with compute capability 1.3 or up, found %d.%d.", major, minor));
 				return false;
 			}
 		}
@@ -238,18 +240,21 @@ public:
 		if(path_exists(cubin))
 			return cubin;
 
-#if defined(WITH_CUDA_BINARIES) && defined(_WIN32)
-		if(major <= 1 && minor <= 2)
-			cuda_error(string_printf("CUDA device supported only compute capability 1.3 or up, found %d.%d.", major, minor));
-		else
-			cuda_error(string_printf("CUDA binary kernel for this graphics card compute capability (%d.%d) not found.", major, minor));
-		return "";
-#else
+#ifdef _WIN32
+		if(cuHavePrecompiledKernels()) {
+			if(major <= 1 && minor <= 2)
+				cuda_error_message(string_printf("CUDA device requires compute capability 1.3 or up, found %d.%d. Your GPU is not supported.", major, minor));
+			else
+				cuda_error_message(string_printf("CUDA binary kernel for this graphics card compute capability (%d.%d) not found.", major, minor));
+			return "";
+		}
+#endif
+
 		/* if not, find CUDA compiler */
 		string nvcc = cuCompilerPath();
 
 		if(nvcc == "") {
-			cuda_error("CUDA nvcc compiler not found. Install CUDA toolkit in default location.");
+			cuda_error_message("CUDA nvcc compiler not found. Install CUDA toolkit in default location.");
 			return "";
 		}
 
@@ -269,20 +274,19 @@ public:
 			nvcc.c_str(), major, minor, machine, kernel.c_str(), cubin.c_str(), maxreg, include.c_str());
 
 		if(system(command.c_str()) == -1) {
-			cuda_error("Failed to execute compilation command, see console for details.");
+			cuda_error_message("Failed to execute compilation command, see console for details.");
 			return "";
 		}
 
 		/* verify if compilation succeeded */
 		if(!path_exists(cubin)) {
-			cuda_error("CUDA kernel compilation failed, see console for details.");
+			cuda_error_message("CUDA kernel compilation failed, see console for details.");
 			return "";
 		}
 
 		printf("Kernel compilation finished in %.2lfs.\n", time_dt() - starttime);
 
 		return cubin;
-#endif
 	}
 
 	bool load_kernels(bool experimental)
@@ -304,8 +308,8 @@ public:
 		cuda_push_context();
 
 		CUresult result = cuModuleLoad(&cuModule, cubin.c_str());
-		if(cuda_error(result))
-			cuda_error(string_printf("Failed loading CUDA kernel %s.", cubin.c_str()));
+		if(cuda_error_(result, "cuModuleLoad"))
+			cuda_error_message(string_printf("Failed loading CUDA kernel %s.", cubin.c_str()));
 
 		cuda_pop_context();
 
@@ -735,7 +739,7 @@ public:
 			
 			CUresult result = cuGraphicsGLRegisterBuffer(&pmem.cuPBOresource, pmem.cuPBO, CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE);
 
-			if(!cuda_error(result)) {
+			if(result == CUDA_SUCCESS) {
 				cuda_pop_context();
 
 				mem.device_pointer = pmem.cuTexId;
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 69287f1..3ab5d9e 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -303,7 +303,7 @@ public:
 		string build_options = " -cl-fast-relaxed-math ";
 		
 		if(platform_name == "NVIDIA CUDA")
-			build_options += "-D__KERNEL_SHADING__ -D__KERNEL_OPENCL_NVIDIA__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
+			build_options += "-D__KERNEL_OPENCL_NVIDIA__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
 
 		else if(platform_name == "Apple")
 			build_options += "-D__CL_NO_FLOAT3__ -D__KERNEL_OPENCL_APPLE__ ";
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 6d5b9a0..e83756b 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -12,7 +12,8 @@ set(INC_SYS
 
 set(SRC
 	kernel.cpp
-	kernel_optimized.cpp
+	kernel_sse2.cpp
+	kernel_sse3.cpp
 	kernel.cl
 	kernel.cu
 )
@@ -149,7 +150,8 @@ include_directories(SYSTEM ${INC_SYS})
 add_library(cycles_kernel ${SRC} ${SRC_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_SVM_HEADERS})
 
 if(WITH_CYCLES_OPTIMIZED_KERNEL)
-	set_source_files_properties(kernel_optimized.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_OPTIMIZED_KERNEL_FLAGS}")
+	set_source_files_properties(kernel_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
+	set_source_files_properties(kernel_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
 endif()
 
 if(WITH_CYCLES_CUDA)
diff --git a/intern/cycles/kernel/kernel.h b/intern/cycles/kernel/kernel.h
index 26c0bcd..20ea5a6 100644
--- a/intern/cycles/kernel/kernel.h
+++ b/intern/cycles/kernel/kernel.h
@@ -44,11 +44,18 @@ void kernel_cpu_shader(KernelGlobals *kg, uint4 *input, float4 *output,
 	int type, int i);
 
 #ifdef WITH_OPTIMIZED_KERNEL
-void kernel_cpu_optimized_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state,
+void kernel_cpu_sse2_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state,
 	int sample, int x, int y, int offset, int stride);
-void kernel_cpu_optimized_tonemap(KernelGlobals *kg, uchar4 *rgba, float *buffer,
+void kernel_cpu_sse2_tonemap(KernelGlobals *kg, uchar4 *rgba, float *buffer,
 	int sample, int resolution, int x, int y, int offset, int stride);
-void kernel_cpu_optimized_shader(KernelGlobals *kg, uint4 *input, float4 *output,
+void kernel_cpu_sse2_shader(KernelGlobals *kg, uint4 *input, float4 *output,
+	int type, int i);
+
+void kernel_cpu_sse3_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state,
+	int sample, int x, int y, int offset, int stride);
+void kernel_cpu_sse3_tonemap(KernelGlobals *kg, uchar4 *rgba, float *buffer,
+	int sample, int resolution, int x, int y, int offset, int stride);
+void kernel_cpu_sse3_shader(KernelGlobals *kg, uint4 *input, float4 *output,
 	int type, int i);
 #endif
 
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h
index d99beb8..1cf2306 100644
--- a/intern/cycles/kernel/kernel_accumulate.h
+++ b/intern/cycles/kernel/kernel_accumulate.h
@@ -133,6 +133,10 @@ __device_inline void path_radiance_init(PathRadiance *L, int use_light_pass)
 		L->indirect_glossy = make_float3(0.0f, 0.0f, 0.0f);
 		L->indirect_transmission = make_float3(0.0f, 0.0f, 0.0f);
 
+		L->path_diffuse = make_float3(0.0f, 0.0f, 0.0f);
+		L->path_glossy = make_float3(0.0f, 0.0f, 0.0f);
+		L->path_transmission = make_float3(0.0f, 0.0f, 0.0f);
+
 		L->emission = make_float3(0.0f, 0.0f, 0.0f);
 		L->background = make_float3(0.0f, 0.0f, 0.0f);
 		L->ao = make_float3(0.0f, 0.0f, 0.0f);
@@ -156,11 +160,11 @@ __device_inline void path_radiance_bsdf_bounce(PathRadiance *L, float3 *throughp
 			/* first on directly visible surface */
 			float3 value = *throughput*inverse_pdf;
 
-			L->indirect_diffuse = bsdf_eval->diffuse*value;
-			L->indirect_glossy = bsdf_eval->glossy*value;
-			L->indirect_transmission = bsdf_eval->transmission*value;
+			L->path_diffuse = bsdf_eval->diffuse*value;
+			L->path_glossy = bsdf_eval->glossy*value;
+			L->path_transmission = bsdf_eval->transmission*value;
 
-			*throughput = L->indirect_diffuse + L->indirect_glossy + L->indirect_transmission;
+			*throughput = L->path_diffuse + L->path_glossy + L->path_transmission;
 			
 			L->direct_throughput = *throughput;
 		}
@@ -216,7 +220,7 @@ __device_inline void path_radiance_accum_ao(PathRadiance *L, float3 throughput,
 #endif
 }
 
-__device_inline void path_radiance_accum_light(PathRadiance *L, float3 throughput, BsdfEval *bsdf_eval, float3 shadow, int bounce, bool is_lamp)
+__device_inline void path_radiance_accum_light(PathRadiance *L, float3 throughput, BsdfEval *bsdf_eval, float3 shadow, float shadow_fac, int bounce, bool is_lamp)
 {
 #ifdef __PASSES__
 	if(L->use_light_pass) {
@@ -229,9 +233,9 @@ __device_inline void path_radiance_accum_light(PathRadiance *L, float3 throughpu
 			if(is_lamp) {
 				float3 sum = throughput*(bsdf_eval->diffuse + bsdf_eval->glossy + bsdf_eval->transmission);
 
-				L->shadow.x += shadow.x;
-				L->shadow.y += shadow.y;
-				L->shadow.z += shadow.z;
+				L->shadow.x += shadow.x*shadow_fac;
+				L->shadow.y += shadow.y*shadow_fac;
+				L->shadow.z += shadow.z*shadow_fac;
 				L->shadow.w += average(sum);
 			}
 		}
@@ -266,22 +270,45 @@ __device_inline void path_radiance_accum_background(PathRadiance *L, float3 thro
 #endif
 }
 
-__device_inline float3 path_radiance_sum(KernelGlobals *kg, PathRadiance *L)
+__device_inline void path_radiance_sum_indirect(PathRadiance *L)
 {
 #ifdef __PASSES__
+	/* this division is a bit ugly, but means we only have to keep track of
+	 * only a single throughput further along the path, here we recover just
+	 * the indirect parth that is not influenced by any particular BSDF type */
 	if(L->use_light_pass) {
-		/* this division is a bit ugly, but means we only have to keep track of
-		 * only a single throughput further along the path, here we recover just
-		 * the indirect parth that is not influenced by any particular BSDF type */
 		L->direct_emission = safe_divide_color(L->direct_emission, L->direct_throughput);
-		L->direct_diffuse += L->indirect_diffuse*L->direct_emission;
-		L->direct_glossy += L->indirect_glossy*L->direct_emission;
-		L->direct_transmission += L->indirect_transmission*L->direct_emission;
+		L->direct_diffuse += L->path_diffuse*L->direct_emission;
+		L->direct_glossy += L->path_glossy*L->direct_emission;
+		L->direct_transmission += L->path_transmission*L->direct_emission;
 
 		L->indirect = safe_divide_color(L->indirect, L->direct_throughput);
-		L->indirect_diffuse *= L->indirect;
-		L->indirect_glossy *= L->indirect;
-		L->indirect_transmission *= L->indirect;
+		L->indirect_diffuse += L->path_diffuse*L->indirect;
+		L->indirect_glossy += L->path_glossy*L->indirect;
+		L->indirect_transmission += L->path_transmission*L->indirect;
+	}
+#endif
+}
+
+__device_inline void path_radiance_reset_indirect(PathRadiance *L)
+{
+#ifdef __PASSES__
+	if(L->use_light_pass) {
+		L->path_diffuse = make_float3(0.0f, 0.0f, 0.0f);
+		L->path_glossy = make_float3(0.0f, 0.0f, 0.0f);
+		L->path_transmission = make_float3(0.0f, 0.0f, 0.0f);
+
+		L->direct_emission = make_float3(0.0f, 0.0f, 0.0f);
+		L->indirect = make_float3(0.0f, 0.0f, 0.0f);
+	}
+#endif
+}
+
+__device_inline float3 path_radiance_sum(KernelGlobals *kg, PathRadiance *L)
+{
+#ifdef __PASSES__
+	if(L->use_light_pass) {
+		path_radiance_sum_indirect(L);
 
 		float3 L_sum = L->emission
 			+ L->direct_diffuse + L->direct_glossy + L->direct_transmission
diff --git a/intern/cycles/kernel/kernel_bvh.h b/intern/cycles/kernel/kernel_bvh.h
index 2cb2920..2b9ebf3 100644
--- a/intern/cycles/kernel/kernel_bvh.h
+++ b/intern/cycles/kernel/kernel_bvh.h
@@ -126,21 +126,21 @@ __device_inline void bvh_node_intersect(KernelGlobals *kg,
 
 	/* intersect ray against child nodes */
 	float3 ood = P * idir;
-	float c0lox = n0xy.x * idir.x - ood.x;
-	float c0hix = n0xy.y * idir.x - ood.x;
-	float c0loy = n0xy.z * idir.y - ood.y;
-	float c0hiy = n0xy.w * idir.y - ood.y;
-	float c0loz = nz.x * idir.z - ood.z;
-	float c0hiz = nz.y * idir.z - ood.z;
+	NO_EXTENDED_PRECISION float c0lox = n0xy.x * idir.x - ood.x;
+	NO_EXTENDED_PRECISION float c0hix = n0xy.y * idir.x - ood.x;
+	NO_EXTENDED_PRECISION float c0loy = n0xy.z * idir.y - ood.y;
+	NO_EXTENDED_PRECISION float c0hiy = n0xy.w * idir.y - ood.y;
+	NO_EXTENDED_PRECISION float c0loz = nz.x * idir.z - ood.z;
+	NO_EXTENDED_PRECISION float c0hiz = nz.y * idir.z - ood.z;
 	NO_EXTENDED_PRECISION float c0min = max4(min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz), 0.0f);
 	NO_EXTENDED_PRECISION float c0max = min4(max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz), t);
 
-	float c1loz = nz.z * idir.z - ood.z;
-	float c1hiz = nz.w * idir.z - ood.z;
-	float c1lox = n1xy.x * idir.x - ood.x;
-	float c1hix = n1xy.y * idir.x - ood.x;
-	float c1loy = n1xy.z * idir.y - ood.y;
-	float c1hiy = n1xy.w * idir.y - ood.y;
+	NO_EXTENDED_PRECISION float c1loz = nz.z * idir.z - ood.z;
+	NO_EXTENDED_PRECISION float c1hiz = nz.w * idir.z - ood.z;
+	NO_EXTENDED_PRECISION float c1lox = n1xy.x * idir.x - ood.x;
+	NO_EXTENDED_PRECISION float c1hix = n1xy.y * idir.x - ood.x;
+	NO_EXTENDED_PRECISION float c1loy = n1xy.z * idir.y - ood.y;
+	NO_EXTENDED_PRECISION float c1hiy = n1xy.w * idir.y - ood.y;
 	NO_EXTENDED_PRECISION float c1min = max4(min(c1lox, c1hix), min(c1loy, c1hiy), min(c1loz, c1hiz), 0.0f);
 	NO_EXTENDED_PRECISION float c1max = min4(max(c1lox, c1hix), max(c1loy, c1hiy), max(c1loz, c1hiz), t);
 
@@ -206,6 +206,317 @@ __device_inline void bvh_triangle_intersect(KernelGlobals *kg, Intersection *ise
 }
 
 #ifdef __HAIR__
+__device_inline void curvebounds(float *lower, float *upper, float *extremta, float *extrema, float *extremtb, float *extremb, float p0, float p1, float p2, float p3)
+{
+	float halfdiscroot = (p2 * p2 - 3 * p3 * p1);
+	float ta = -1.0f;
+	float tb = -1.0f;
+	*extremta = -1.0f;
+	*extremtb = -1.0f;
+	*upper = p0;
+	*lower = p0 + p1 + p2 + p3;
+	*extrema = *upper;
+	*extremb = *lower;
+	if(*lower >= *upper) {
+		*upper = *lower;
+		*lower = p0;
+	}
+
+	if(halfdiscroot >= 0) {
+		halfdiscroot = sqrt(halfdiscroot);
+		ta = (-p2 - halfdiscroot) / (3 * p3);
+		tb = (-p2 + halfdiscroot) / (3 * p3);
+	}
+
+	float t2;
+	float t3;
+	if(ta > 0.0f && ta < 1.0f) {
+		t2 = ta * ta;
+		t3 = t2 * ta;
+		*extremta = ta;
+		*extrema = p3 * t3 + p2 * t2 + p1 * ta + p0;
+		if(*extrema > *upper) {
+			*upper = *extrema;
+		}
+		if(*extrema < *lower) {
+			*lower = *extrema;
+		}
+	}
+	if(tb > 0.0f && tb < 1.0f) {
+		t2 = tb * tb;
+		t3 = t2 * tb;
+		*extremtb = tb;
+		*extremb = p3 * t3 + p2 * t2 + p1 * tb + p0;
+		if(*extremb >= *upper) {
+			*upper = *extremb;
+		}
+		if(*extremb <= *lower) {
+			*lower = *extremb;
+		}
+	}
+}
+
+__device_inline void bvh_cardinal_curve_intersect(KernelGlobals *kg, Intersection *isect,
+	float3 P, float3 idir, uint visibility, int object, int curveAddr, int segment)
+{
+	int depth = kernel_data.curve_kernel_data.subdivisions;
+
+	/* curve Intersection check */
+	float3 dir = 1.0f/idir;
+	
+	int flags = kernel_data.curve_kernel_data.curveflags;
+
+	int prim = kernel_tex_fetch(__prim_index, curveAddr);
+
+	float3 curve_coef[4];
+	float r_st,r_en;
+
+	/*obtain curve parameters*/
+	{
+		/*ray transform created - this shold be created at beginning of intersection loop*/
+		Transform htfm;
+		float d = sqrtf(dir.x * dir.x + dir.z * dir.z);
+		htfm = make_transform(
+			dir.z / d, 0, -dir.x /d, 0,
+			-dir.x * dir.y /d, d, -dir.y * dir.z /d, 0,
+			dir.x, dir.y, dir.z, 0,
+			0, 0, 0, 1) * make_transform(
+			1, 0, 0, -P.x,
+			0, 1, 0, -P.y,
+			0, 0, 1, -P.z,
+			0, 0, 0, 1);
+
+		float4 v00 = kernel_tex_fetch(__curves, prim);
+
+		int k0 = __float_as_int(v00.x) + segment;
+		int k1 = k0 + 1;
+
+		int ka = max(k0 - 1,__float_as_int(v00.x));
+		int kb = min(k1 + 1,__float_as_int(v00.x) + __float_as_int(v00.y) - 1);
+
+		float4 P0 = kernel_tex_fetch(__curve_keys, ka);
+		float4 P1 = kernel_tex_fetch(__curve_keys, k0);
+		float4 P2 = kernel_tex_fetch(__curve_keys, k1);
+		float4 P3 = kernel_tex_fetch(__curve_keys, kb);
+
+		float3 p0 = transform_point(&htfm, float4_to_float3(P0));
+		float3 p1 = transform_point(&htfm, float4_to_float3(P1));
+		float3 p2 = transform_point(&htfm, float4_to_float3(P2));
+		float3 p3 = transform_point(&htfm, float4_to_float3(P3));
+
+		float fc = 0.71f;
+		curve_coef[0] = p1;
+		curve_coef[1] = -fc*p0 + fc*p2;
+		curve_coef[2] = 2.0f * fc * p0 + (fc - 3.0f) * p1 + (3.0f - 2.0f * fc) * p2 - fc * p3;
+		curve_coef[3] = -fc * p0 + (2.0f - fc) * p1 + (fc - 2.0f) * p2 + fc * p3;
+		r_st = P1.w;
+		r_en = P2.w;
+	}
+	
+
+	float r_curr = max(r_st, r_en);
+
+	/*find bounds - this is slow for cubic curves*/
+	float upper,lower;
+	float xextrem[4];
+	curvebounds(&lower, &upper, &xextrem[0], &xextrem[1], &xextrem[2], &xextrem[3], curve_coef[0].x, curve_coef[1].x, curve_coef[2].x, curve_coef[3].x);
+	if(lower > r_curr || upper < -r_curr)
+		return;
+
+	float yextrem[4];
+	curvebounds(&lower, &upper, &yextrem[0], &yextrem[1], &yextrem[2], &yextrem[3], curve_coef[0].y, curve_coef[1].y, curve_coef[2].y, curve_coef[3].y);
+	if(lower > r_curr || upper < -r_curr)
+		return;
+
+	float zextrem[4];
+	curvebounds(&lower, &upper, &zextrem[0], &zextrem[1], &zextrem[2], &zextrem[3], curve_coef[0].z, curve_coef[1].z, curve_coef[2].z, curve_coef[3].z);
+	if(lower - r_curr > isect->t || upper + r_curr < 0.0f)
+		return;
+
+	/*setup recurrent loop*/
+	int level = 1 << depth;
+	int tree = 0;
+	float resol = 1.0f / (float)level;
+
+	/*begin loop*/
+	while(!(tree >> (depth))) {
+		float i_st = tree * resol;
+		float i_en = i_st + (level * resol);
+		float3 p_st = ((curve_coef[3] * i_st + curve_coef[2]) * i_st + curve_coef[1]) * i_st + curve_coef[0];
+		float3 p_en = ((curve_coef[3] * i_en + curve_coef[2]) * i_en + curve_coef[1]) * i_en + curve_coef[0];
+		
+		float bminx = min(p_st.x, p_en.x);
+		float bmaxx = max(p_st.x, p_en.x);
+		float bminy = min(p_st.y, p_en.y);
+		float bmaxy = max(p_st.y, p_en.y);
+		float bminz = min(p_st.z, p_en.z);
+		float bmaxz = max(p_st.z, p_en.z);
+
+		if(xextrem[0] >= i_st && xextrem[0] <= i_en) {
+			bminx = min(bminx,xextrem[1]);
+			bmaxx = max(bmaxx,xextrem[1]);
+		}
+		if(xextrem[2] >= i_st && xextrem[2] <= i_en) {
+			bminx = min(bminx,xextrem[3]);
+			bmaxx = max(bmaxx,xextrem[3]);
+		}
+		if(yextrem[0] >= i_st && yextrem[0] <= i_en) {
+			bminy = min(bminy,yextrem[1]);
+			bmaxy = max(bmaxy,yextrem[1]);
+		}
+		if(yextrem[2] >= i_st && yextrem[2] <= i_en) {
+			bminy = min(bminy,yextrem[3]);
+			bmaxy = max(bmaxy,yextrem[3]);
+		}
+		if(zextrem[0] >= i_st && zextrem[0] <= i_en) {
+			bminz = min(bminz,zextrem[1]);
+			bmaxz = max(bmaxz,zextrem[1]);
+		}
+		if(zextrem[2] >= i_st && zextrem[2] <= i_en) {
+			bminz = min(bminz,zextrem[3]);
+			bmaxz = max(bmaxz,zextrem[3]);
+		}
+
+		float r1 = r_st + (r_en - r_st) * i_st;
+		float r2 = r_st + (r_en - r_st) * i_en;
+		r_curr = max(r1, r2);
+
+		if (bminz - r_curr > isect->t || bmaxz + r_curr < 0.0f|| bminx > r_curr || bmaxx < -r_curr || bminy > r_curr || bmaxy < -r_curr) {
+			/* the bounding box does not overlap the square centered at O.*/
+			tree += level;
+			level = tree & -tree;
+		}
+		else if (level == 1) {
+
+			/* the maximum recursion depth is reached.
+			* check if dP0.(Q-P0)>=0 and dPn.(Pn-Q)>=0.
+			* dP* is reversed if necessary.*/
+			float t = isect->t;
+			float u = 0.0f;
+			if(flags & CURVE_KN_RIBBONS) {
+				float3 tg = (p_en - p_st);
+				float w = tg.x * tg.x + tg.y * tg.y;
+				if (w == 0) {
+					tree++;
+					level = tree & -tree;
+					continue;
+				}
+				w = -(p_st.x * tg.x + p_st.y * tg.y) / w;
+				w = clamp((float)w, 0.0f, 1.0f);
+
+				/* compute u on the curve segment.*/
+				u = i_st * (1 - w) + i_en * w;
+				r_curr = r_st + (r_en - r_st) * u;
+				/* compare x-y distances.*/
+				float3 p_curr = ((curve_coef[3] * u + curve_coef[2]) * u + curve_coef[1]) * u + curve_coef[0];
+
+				float3 dp_st = (3 * curve_coef[3] * i_st + 2 * curve_coef[2]) * i_st + curve_coef[1];
+				if (dot(tg, dp_st)< 0)
+					dp_st *= -1;
+				if (dot(dp_st, -p_st) + p_curr.z * dp_st.z < 0) {
+					tree++;
+					level = tree & -tree;
+					continue;
+				}
+				float3 dp_en = (3 * curve_coef[3] * i_en + 2 * curve_coef[2]) * i_en + curve_coef[1];
+				if (dot(tg, dp_en) < 0)
+					dp_en *= -1;
+				if (dot(dp_en, p_en) - p_curr.z * dp_en.z < 0) {
+					tree++;
+					level = tree & -tree;
+					continue;
+				}
+				
+				if (p_curr.x * p_curr.x + p_curr.y * p_curr.y >= r_curr * r_curr || p_curr.z <= 0.0f) {
+					tree++;
+					level = tree & -tree;
+					continue;
+				}
+				/* compare z distances.*/
+				if (isect->t < p_curr.z) {
+					tree++;
+					level = tree & -tree;
+					continue;
+				}
+				t = p_curr.z;
+			}
+			else {
+				float l = len(p_en - p_st);
+				float3 tg = (p_en - p_st) / l;
+				float gd = (r2 - r1) / l;
+				float difz = -dot(p_st,tg);
+				float cyla = 1.0f - (tg.z * tg.z * (1 + gd*gd));
+				float halfb = (-p_st.z - tg.z*(difz + gd*(difz*gd + r1)));
+				float tcentre = -halfb/cyla;
+				float zcentre = difz + (tg.z * tcentre);
+				float3 tdif = - p_st;
+				tdif.z += tcentre;
+				float tdifz = dot(tdif,tg);
+				float tb = 2*(tdif.z - tg.z*(tdifz + gd*(tdifz*gd + r1)));
+				float tc = dot(tdif,tdif) - tdifz * tdifz * (1 + gd*gd) - r1*r1 - 2*r1*tdifz*gd;
+				float td = tb*tb - 4*cyla*tc;
+				if (td < 0.0f){
+					tree++;
+					level = tree & -tree;
+					continue;
+				}
+				
+				float rootd = sqrtf(td);
+				float correction = ((-tb - rootd)/(2*cyla));
+				t = tcentre + correction;
+				float w = (zcentre + (tg.z * correction))/l;
+
+				float3 dp_st = (3 * curve_coef[3] * i_st + 2 * curve_coef[2]) * i_st + curve_coef[1];
+				if (dot(tg, dp_st)< 0)
+					dp_st *= -1;
+				float3 dp_en = (3 * curve_coef[3] * i_en + 2 * curve_coef[2]) * i_en + curve_coef[1];
+				if (dot(tg, dp_en) < 0)
+					dp_en *= -1;
+
+
+				if(flags & CURVE_KN_BACKFACING && (dot(dp_st, -p_st) + t * dp_st.z < 0 || dot(dp_en, p_en) - t * dp_en.z < 0 || isect->t < t || t <= 0.0f)) {
+					correction = ((-tb + rootd)/(2*cyla));
+					t = tcentre + correction;
+					w = (zcentre + (tg.z * correction))/l;
+				}			
+
+				if (dot(dp_st, -p_st) + t * dp_st.z < 0 || dot(dp_en, p_en) - t * dp_en.z < 0 || isect->t < t || t <= 0.0f) {
+					tree++;
+					level = tree & -tree;
+					continue;
+				}
+
+				w = clamp((float)w, 0.0f, 1.0f);
+				/* compute u on the curve segment.*/
+				u = i_st * (1 - w) + i_en * w;	
+
+			}
+			/* we found a new intersection.*/
+#ifdef __VISIBILITY_FLAG__
+			/* visibility flag test. we do it here under the assumption
+			 * that most triangles are culled by node flags */
+			if(kernel_tex_fetch(__prim_visibility, curveAddr) & visibility)
+#endif
+			{
+				/* record intersection */
+				isect->prim = curveAddr;
+				isect->segment = segment;
+				isect->object = object;
+				isect->u = u;
+				isect->v = 0.0f;
+				isect->t = t;
+			}
+			
+			tree++;
+			level = tree & -tree;
+		}
+		else {
+			/* split the curve into two curves and process */
+			level = level >> 1;
+		}
+	}
+}
+
 __device_inline void bvh_curve_intersect(KernelGlobals *kg, Intersection *isect,
 	float3 P, float3 idir, uint visibility, int object, int curveAddr, int segment)
 {
@@ -222,7 +533,6 @@ __device_inline void bvh_curve_intersect(KernelGlobals *kg, Intersection *isect,
 	float4 P1 = kernel_tex_fetch(__curve_keys, k0);
 	float4 P2 = kernel_tex_fetch(__curve_keys, k1);
 
-	float l = len(P2 - P1);
 	float r1 = P1.w;
 	float r2 = P2.w;
 	float mr = max(r1,r2);
@@ -230,6 +540,7 @@ __device_inline void bvh_curve_intersect(KernelGlobals *kg, Intersection *isect,
 	float3 p2 = float4_to_float3(P2);
 	float3 dif = P - p1;
 	float3 dir = 1.0f/idir;
+	float l = len(p2 - p1);
 
 	float sp_r = mr + 0.5f * l;
 	float3 sphere_dif = P - ((p1 + p2) * 0.5f);
@@ -344,7 +655,7 @@ __device_inline void bvh_curve_intersect(KernelGlobals *kg, Intersection *isect,
 }
 #endif
 
-__device_inline bool bvh_intersect(KernelGlobals *kg, const Ray *ray, const uint visibility, Intersection *isect)
+__device bool bvh_intersect(KernelGlobals *kg, const Ray *ray, const uint visibility, Intersection *isect)
 {
 	/* traversal stack in CUDA thread-local memory */
 	int traversalStack[BVH_STACK_SIZE];
@@ -425,8 +736,12 @@ __device_inline bool bvh_intersect(KernelGlobals *kg, const Ray *ray, const uint
 						/* intersect ray against primitive */
 #ifdef __HAIR__
 						uint segment = kernel_tex_fetch(__prim_segment, primAddr);
-						if(segment != ~0)
-							bvh_curve_intersect(kg, isect, P, idir, visibility, object, primAddr, segment);
+						if(segment != ~0) {
+							if(kernel_data.curve_kernel_data.curveflags & CURVE_KN_INTERPOLATE) 
+								bvh_cardinal_curve_intersect(kg, isect, P, idir, visibility, object, primAddr, segment);
+							else
+								bvh_curve_intersect(kg, isect, P, idir, visibility, object, primAddr, segment);
+						}
 						else
 #endif
 							bvh_triangle_intersect(kg, isect, P, idir, visibility, object, primAddr);
@@ -470,7 +785,7 @@ __device_inline bool bvh_intersect(KernelGlobals *kg, const Ray *ray, const uint
 }
 
 #ifdef __OBJECT_MOTION__
-__device_inline bool bvh_intersect_motion(KernelGlobals *kg, const Ray *ray, const uint visibility, Intersection *isect)
+__device bool bvh_intersect_motion(KernelGlobals *kg, const Ray *ray, const uint visibility, Intersection *isect)
 {
 	/* traversal stack in CUDA thread-local memory */
 	int traversalStack[BVH_STACK_SIZE];
@@ -551,8 +866,12 @@ __device_inline bool bvh_intersect_motion(KernelGlobals *kg, const Ray *ray, con
 						/* intersect ray against primitive */
 #ifdef __HAIR__
 						uint segment = kernel_tex_fetch(__prim_segment, primAddr);
-						if(segment != ~0)
-							bvh_curve_intersect(kg, isect, P, idir, visibility, object, primAddr, segment);
+						if(segment != ~0) {
+							if(kernel_data.curve_kernel_data.curveflags & CURVE_KN_INTERPOLATE) 
+								bvh_cardinal_curve_intersect(kg, isect, P, idir, visibility, object, primAddr, segment);
+							else
+								bvh_curve_intersect(kg, isect, P, idir, visibility, object, primAddr, segment);
+						}
 						else
 #endif
 							bvh_triangle_intersect(kg, isect, P, idir, visibility, object, primAddr);
@@ -610,7 +929,7 @@ __device_inline float3 ray_offset(float3 P, float3 Ng)
 	const float epsilon_f = 1e-5f;
 	/* ideally this should match epsilon_f, but instancing/mblur
 	 * precision makes it problematic */
-	const float epsilon_test = 1e-1f;
+	const float epsilon_test = 1.0f;
 	const int epsilon_i = 32;
 
 	float3 res;
@@ -697,6 +1016,32 @@ __device_inline float3 bvh_triangle_refine(KernelGlobals *kg, ShaderData *sd, co
 }
 
 #ifdef __HAIR__
+
+__device_inline float3 curvetangent(float t, float3 p0, float3 p1, float3 p2, float3 p3)
+{
+	float fc = 0.71f;
+	float data[4];
+	float t2 = t * t;
+    data[0] = -3.0f * fc          * t2  + 4.0f * fc * t                  - fc;
+    data[1] =  3.0f * (2.0f - fc) * t2  + 2.0f * (fc - 3.0f) * t;
+    data[2] =  3.0f * (fc - 2.0f) * t2  + 2.0f * (3.0f - 2.0f * fc) * t  + fc;
+    data[3] =  3.0f * fc          * t2  - 2.0f * fc * t;
+	return data[0] * p0 + data[1] * p1 + data[2] * p2 + data[3] * p3;
+}
+
+__device_inline float3 curvepoint(float t, float3 p0, float3 p1, float3 p2, float3 p3)
+{
+	float data[4];
+	float fc = 0.71f;
+	float t2 = t * t;
+	float t3 = t2 * t;
+	data[0] = -fc          * t3  + 2.0f * fc          * t2 - fc * t;
+	data[1] =  (2.0f - fc) * t3  + (fc - 3.0f)        * t2 + 1.0f;
+	data[2] =  (fc - 2.0f) * t3  + (3.0f - 2.0f * fc) * t2 + fc * t;
+	data[3] =  fc          * t3  - fc * t2;
+	return data[0] * p0 + data[1] * p1 + data[2] * p2 + data[3] * p3;
+}
+
 __device_inline float3 bvh_curve_refine(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray, float t)
 {
 	int flag = kernel_data.curve_kernel_data.curveflags;
@@ -723,64 +1068,92 @@ __device_inline float3 bvh_curve_refine(KernelGlobals *kg, ShaderData *sd, const
 
 	float4 P1 = kernel_tex_fetch(__curve_keys, k0);
 	float4 P2 = kernel_tex_fetch(__curve_keys, k1);
-	float l = len(P2 - P1);
+	float l = 1.0f;
+	float3 tg = normalize_len(float4_to_float3(P2 - P1),&l);
 	float r1 = P1.w;
 	float r2 = P2.w;
-	float3 tg = float4_to_float3(P2 - P1) / l;
-	float3 dif = P - float4_to_float3(P1) + t * D;
 	float gd = ((r2 - r1)/l);
-
+	
 	P = P + D*t;
 
-	dif = P - float4_to_float3(P1);
+	if(flag & CURVE_KN_INTERPOLATE) {
+		int ka = max(k0 - 1,__float_as_int(v00.x));
+		int kb = min(k1 + 1,__float_as_int(v00.x) + __float_as_int(v00.y) - 1);
 
-	#ifdef __UV__
-	sd->u = dot(dif,tg)/l;
-	sd->v = 0.0f;
-	#endif
+		float4 P0 = kernel_tex_fetch(__curve_keys, ka);
+		float4 P3 = kernel_tex_fetch(__curve_keys, kb);
 
-	if (flag & CURVE_KN_TRUETANGENTGNORMAL) {
-		sd->Ng = -(D - tg * (dot(tg,D) * kernel_data.curve_kernel_data.normalmix));
-		sd->Ng = normalize(sd->Ng);
-		if (flag & CURVE_KN_NORMALCORRECTION)
-		{
-			//sd->Ng = normalize(sd->Ng);
+		float3 p[4];
+		p[0] = float4_to_float3(P0);
+		p[1] = float4_to_float3(P1);
+		p[2] = float4_to_float3(P2);
+		p[3] = float4_to_float3(P3);
+
+		tg = normalize(curvetangent(isect->u,p[0],p[1],p[2],p[3]));
+		float3 p_curr = curvepoint(isect->u,p[0],p[1],p[2],p[3]);
+
+#ifdef __UV__
+		sd->u = isect->u;
+		sd->v = 0.0f;
+#endif
+
+		if(kernel_data.curve_kernel_data.curveflags & CURVE_KN_RIBBONS)
+			sd->Ng = normalize(-(D - tg * (dot(tg,D))));
+		else {
+			sd->Ng = normalize(P - p_curr);
 			sd->Ng = sd->Ng - gd * tg;
 			sd->Ng = normalize(sd->Ng);
 		}
+		sd->N = sd->Ng;
 	}
 	else {
-		sd->Ng = (dif - tg * sd->u * l) / (P1.w + sd->u * l * gd);
-		if (gd != 0.0f) {
-			sd->Ng = sd->Ng - gd * tg ;
+		float3 dif = P - float4_to_float3(P1);
+
+#ifdef __UV__
+		sd->u = dot(dif,tg)/l;
+		sd->v = 0.0f;
+#endif
+
+		if (flag & CURVE_KN_TRUETANGENTGNORMAL) {
+			sd->Ng = -(D - tg * (dot(tg,D) * kernel_data.curve_kernel_data.normalmix));
 			sd->Ng = normalize(sd->Ng);
+			if (flag & CURVE_KN_NORMALCORRECTION) {
+				sd->Ng = sd->Ng - gd * tg;
+				sd->Ng = normalize(sd->Ng);
+			}
+		}
+		else {
+			sd->Ng = (dif - tg * sd->u * l) / (P1.w + sd->u * l * gd);
+			if (gd != 0.0f) {
+				sd->Ng = sd->Ng - gd * tg ;
+				sd->Ng = normalize(sd->Ng);
+			}
 		}
-	}
 
-	sd->N = sd->Ng;
+		sd->N = sd->Ng;
 
-	if (flag & CURVE_KN_TANGENTGNORMAL && !(flag & CURVE_KN_TRUETANGENTGNORMAL)) {
-		sd->N = -(D - tg * (dot(tg,D) * kernel_data.curve_kernel_data.normalmix));
-		sd->N = normalize(sd->N);
-		if (flag & CURVE_KN_NORMALCORRECTION) {
-			//sd->N = normalize(sd->N);
-			sd->N = sd->N - gd * tg;
+		if (flag & CURVE_KN_TANGENTGNORMAL && !(flag & CURVE_KN_TRUETANGENTGNORMAL)) {
+			sd->N = -(D - tg * (dot(tg,D) * kernel_data.curve_kernel_data.normalmix));
 			sd->N = normalize(sd->N);
+			if (flag & CURVE_KN_NORMALCORRECTION) {
+				sd->N = sd->N - gd * tg;
+				sd->N = normalize(sd->N);
+			}
 		}
-	}
-	if (!(flag & CURVE_KN_TANGENTGNORMAL) && flag & CURVE_KN_TRUETANGENTGNORMAL) {
-		sd->N = (dif - tg * sd->u * l) / (P1.w + sd->u * l * gd);
-		if (gd != 0.0f) {
-			sd->N = sd->N - gd * tg ;
-			sd->N = normalize(sd->N);
+		if (!(flag & CURVE_KN_TANGENTGNORMAL) && flag & CURVE_KN_TRUETANGENTGNORMAL) {
+			sd->N = (dif - tg * sd->u * l) / (P1.w + sd->u * l * gd);
+			if (gd != 0.0f) {
+				sd->N = sd->N - gd * tg ;
+				sd->N = normalize(sd->N);
+			}
 		}
 	}
 
-	#ifdef __DPDU__
+#ifdef __DPDU__
 	/* dPdu/dPdv */
 	sd->dPdu = tg;
 	sd->dPdv = cross(tg,sd->Ng);
-	#endif
+#endif
 
 	if(isect->object != ~0) {
 #ifdef __OBJECT_MOTION__
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h
index cd896ff..f9d5bd3 100644
--- a/intern/cycles/kernel/kernel_camera.h
+++ b/intern/cycles/kernel/kernel_camera.h
@@ -213,7 +213,7 @@ __device void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, flo
 
 #ifdef __CAMERA_MOTION__
 	/* motion blur */
-	if(kernel_data.cam.shuttertime == 0.0f)
+	if(kernel_data.cam.shuttertime == -1.0f)
 		ray->time = TIME_INVALID;
 	else
 		ray->time = 0.5f + 0.5f*(time - 0.5f)*kernel_data.cam.shuttertime;
diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h
index 54bc071..9787af5 100644
--- a/intern/cycles/kernel/kernel_emission.h
+++ b/intern/cycles/kernel/kernel_emission.h
@@ -20,7 +20,7 @@ CCL_NAMESPACE_BEGIN
 
 /* Direction Emission */
 
-__device float3 direct_emissive_eval(KernelGlobals *kg, float rando,
+__device_noinline float3 direct_emissive_eval(KernelGlobals *kg, float rando,
 	LightSample *ls, float u, float v, float3 I, float t, float time)
 {
 	/* setup shading at emitter */
@@ -74,9 +74,9 @@ __device float3 direct_emissive_eval(KernelGlobals *kg, float rando,
 	return eval;
 }
 
-__device bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex,
+__device_noinline bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex,
 	float randt, float rando, float randu, float randv, Ray *ray, BsdfEval *eval,
-	int *lamp)
+	bool *is_lamp)
 {
 	LightSample ls;
 
@@ -92,12 +92,6 @@ __device bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex,
 		light_sample(kg, randt, randu, randv, sd->time, sd->P, &ls);
 	}
 
-	/* return lamp index for MIS */
-	if(ls.use_mis)
-		*lamp = ls.lamp;
-	else
-		*lamp= ~0;
-
 	if(ls.pdf == 0.0f)
 		return false;
 
@@ -114,7 +108,7 @@ __device bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex,
 
 	shader_bsdf_eval(kg, sd, ls.D, eval, &bsdf_pdf);
 
-	if(ls.use_mis) {
+	if(ls.shader & SHADER_USE_MIS) {
 		/* multiple importance sampling */
 		float mis_weight = power_heuristic(ls.pdf, bsdf_pdf);
 		light_eval *= mis_weight;
@@ -146,12 +140,15 @@ __device bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex,
 		ray->t = 0.0f;
 	}
 
+	/* return if it's a lamp for shadow pass */
+	*is_lamp = (ls.prim == ~0 && ls.type != LIGHT_BACKGROUND);
+
 	return true;
 }
 
 /* Indirect Primitive Emission */
 
-__device float3 indirect_primitive_emission(KernelGlobals *kg, ShaderData *sd, float t, int path_flag, float bsdf_pdf)
+__device_noinline float3 indirect_primitive_emission(KernelGlobals *kg, ShaderData *sd, float t, int path_flag, float bsdf_pdf)
 {
 	/* evaluate emissive closure */
 	float3 L = shader_emissive_eval(kg, sd);
@@ -174,7 +171,7 @@ __device float3 indirect_primitive_emission(KernelGlobals *kg, ShaderData *sd, f
 
 /* Indirect Lamp Emission */
 
-__device bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf, float randt, float3 *emission)
+__device_noinline bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf, float randt, float3 *emission)
 {
 	LightSample ls;
 	int lamp = lamp_light_eval_sample(kg, randt);
@@ -203,7 +200,7 @@ __device bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int path_flag,
 
 /* Indirect Background */
 
-__device float3 indirect_background(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf)
+__device_noinline float3 indirect_background(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf)
 {
 #ifdef __BACKGROUND__
 	/* evaluate background closure */
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index e0d0802..f6fbd35 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -31,7 +31,6 @@ typedef struct LightSample {
 	int prim;			/* primitive id for triangle/curve ligths */
 	int shader;			/* shader id */
 	int lamp;			/* lamp id */
-	int use_mis;		/* for lamps with size zero */
 	LightType type;		/* type of light */
 } LightSample;
 
@@ -218,11 +217,10 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
 
 	LightType type = (LightType)__float_as_int(data0.x);
 	ls->type = type;
-#ifdef __LAMP_MIS__
-	ls->use_mis = true;
-#else
-	ls->use_mis = false;
-#endif
+	ls->shader = __float_as_int(data1.x);
+	ls->object = ~0;
+	ls->prim = ~0;
+	ls->lamp = lamp;
 
 	if(type == LIGHT_DISTANT) {
 		/* distant light */
@@ -233,8 +231,6 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
 
 		if(radius > 0.0f)
 			D = distant_light_sample(D, radius, randu, randv);
-		else
-			ls->use_mis = false;
 
 		ls->P = D;
 		ls->Ng = D;
@@ -266,8 +262,6 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
 			if(radius > 0.0f)
 				/* sphere light */
 				ls->P += sphere_light_sample(P, ls->P, radius, randu, randv);
-			else
-				ls->use_mis = false;
 
 			ls->D = normalize_len(ls->P - P, &ls->t);
 			ls->Ng = -ls->D;
@@ -297,11 +291,6 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
 
 			float invarea = data2.x;
 
-			if(invarea == 0.0f) {
-				ls->use_mis = false;
-				invarea = 1.0f;
-			}
-
 			ls->eval_fac = 0.25f*invarea;
 			ls->pdf = invarea;
 		}
@@ -309,11 +298,6 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
 		ls->eval_fac *= kernel_data.integrator.inv_pdf_lights;
 		ls->pdf *= lamp_light_pdf(kg, ls->Ng, -ls->D, ls->t);
 	}
-
-	ls->shader = __float_as_int(data1.x);
-	ls->object = ~0;
-	ls->prim = ~0;
-	ls->lamp = lamp;
 }
 
 __device bool lamp_light_eval(KernelGlobals *kg, int lamp, float3 P, float3 D, float t, LightSample *ls)
@@ -327,7 +311,9 @@ __device bool lamp_light_eval(KernelGlobals *kg, int lamp, float3 P, float3 D, f
 	ls->object = ~0;
 	ls->prim = ~0;
 	ls->lamp = lamp;
-	ls->use_mis = false; /* flag not used for eval */
+
+	if(!(ls->shader & SHADER_USE_MIS))
+		return false;
 
 	if(type == LIGHT_DISTANT) {
 		/* distant light */
@@ -466,9 +452,9 @@ __device void triangle_light_sample(KernelGlobals *kg, int prim, int object,
 	ls->object = object;
 	ls->prim = prim;
 	ls->lamp = ~0;
-	ls->use_mis = true;
+	ls->shader |= SHADER_USE_MIS;
 	ls->t = 0.0f;
-	ls->type = LIGHT_AREA;
+	ls->type = LIGHT_TRIANGLE;
 	ls->eval_fac = 1.0f;
 
 	object_transform_light_sample(kg, ls, object, time);
@@ -520,11 +506,10 @@ __device void curve_segment_light_sample(KernelGlobals *kg, int prim, int object
 	ls->object = object;
 	ls->prim = prim;
 	ls->lamp = ~0;
-	ls->use_mis = true;
 	ls->t = 0.0f;
 	ls->type = LIGHT_STRAND;
 	ls->eval_fac = 1.0f;
-	ls->shader = __float_as_int(v00.z);
+	ls->shader = __float_as_int(v00.z) | SHADER_USE_MIS;
 
 	object_transform_light_sample(kg, ls, object, time);
 }
diff --git a/intern/cycles/kernel/kernel_optimized.cpp b/intern/cycles/kernel/kernel_optimized.cpp
deleted file mode 100644
index 0b66209..0000000
--- a/intern/cycles/kernel/kernel_optimized.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2011, Blender Foundation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-/* Optimized CPU kernel entry points. This file is compiled with SSE3
- * optimization flags and nearly all functions inlined, while kernel.cpp
- * is compiled without for other CPU's. */
-
-#ifdef WITH_OPTIMIZED_KERNEL
-
-#include "kernel.h"
-#include "kernel_compat_cpu.h"
-#include "kernel_math.h"
-#include "kernel_types.h"
-#include "kernel_globals.h"
-#include "kernel_film.h"
-#include "kernel_path.h"
-#include "kernel_displace.h"
-
-CCL_NAMESPACE_BEGIN
-
-/* Path Tracing */
-
-void kernel_cpu_optimized_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, int sample, int x, int y, int offset, int stride)
-{
-	kernel_path_trace(kg, buffer, rng_state, sample, x, y, offset, stride);
-}
-
-/* Tonemapping */
-
-void kernel_cpu_optimized_tonemap(KernelGlobals *kg, uchar4 *rgba, float *buffer, int sample, int resolution, int x, int y, int offset, int stride)
-{
-	kernel_film_tonemap(kg, rgba, buffer, sample, resolution, x, y, offset, stride);
-}
-
-/* Shader Evaluate */
-
-void kernel_cpu_optimized_shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int i)
-{
-	kernel_shader_evaluate(kg, input, output, (ShaderEvalType)type, i);
-}
-
-CCL_NAMESPACE_END
-
-#endif
-
diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h
index 7276393..57dbdc2 100644
--- a/intern/cycles/kernel/kernel_passes.h
+++ b/intern/cycles/kernel/kernel_passes.h
@@ -125,14 +125,7 @@ __device_inline void kernel_write_light_passes(KernelGlobals *kg, __global float
 		kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_color, sample, L->color_transmission);
 	if(flag & PASS_SHADOW) {
 		float4 shadow = L->shadow;
-
-		/* bit of an ugly hack to compensate for emitting triangles influencing
-		 * amount of samples we get for this pass */
-		if(kernel_data.integrator.progressive && kernel_data.integrator.pdf_triangles != 0.0f)
-			shadow.w = 0.5f;
-		else
-			shadow.w = 1.0f;
-
+		shadow.w = kernel_data.film.pass_shadow_scale;
 		kernel_write_pass_float4(buffer + kernel_data.film.pass_shadow, sample, shadow);
 	}
 #endif
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index 532c328..9b13f4d 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -254,7 +254,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
 		bool hit = scene_intersect(kg, &ray, visibility, &isect);
 
 #ifdef __LAMP_MIS__
-		if(kernel_data.integrator.pdf_lights > 0.0f && !(state.flag & PATH_RAY_CAMERA)) {
+		if(kernel_data.integrator.use_lamp_mis && !(state.flag & PATH_RAY_CAMERA)) {
 			/* ray starting from previous non-transparent bounce */
 			Ray light_ray;
 
@@ -399,20 +399,19 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
 
 				Ray light_ray;
 				BsdfEval L_light;
-				int lamp;
+				bool is_lamp;
 
 #ifdef __OBJECT_MOTION__
 				light_ray.time = sd.time;
 #endif
 
-				if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &lamp)) {
+				if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
 					/* trace shadow ray */
 					float3 shadow;
 
 					if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
 						/* accumulate */
-						bool is_lamp = (lamp != ~0);
-						path_radiance_accum_light(&L, throughput, &L_light, shadow, state.bounce, is_lamp);
+						path_radiance_accum_light(&L, throughput, &L_light, shadow, 1.0f, state.bounce, is_lamp);
 					}
 				}
 			}
@@ -501,7 +500,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
 		bool hit = scene_intersect(kg, &ray, visibility, &isect);
 
 #ifdef __LAMP_MIS__
-		if(kernel_data.integrator.pdf_lights > 0.0f && !(state.flag & PATH_RAY_CAMERA)) {
+		if(kernel_data.integrator.use_lamp_mis && !(state.flag & PATH_RAY_CAMERA)) {
 			/* ray starting from previous non-transparent bounce */
 			Ray light_ray;
 
@@ -612,21 +611,20 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
 
 				Ray light_ray;
 				BsdfEval L_light;
-				int lamp;
+				bool is_lamp;
 
 #ifdef __OBJECT_MOTION__
 				light_ray.time = sd.time;
 #endif
 
 				/* sample random light */
-				if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &lamp)) {
+				if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
 					/* trace shadow ray */
 					float3 shadow;
 
 					if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
 						/* accumulate */
-						bool is_lamp = (lamp != ~0);
-						path_radiance_accum_light(L, throughput, &L_light, shadow, state.bounce, is_lamp);
+						path_radiance_accum_light(L, throughput, &L_light, shadow, 1.0f, state.bounce, is_lamp);
 					}
 				}
 			}
@@ -819,7 +817,7 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
 		if(sd.flag & SD_BSDF_HAS_EVAL) {
 			Ray light_ray;
 			BsdfEval L_light;
-			int lamp;
+			bool is_lamp;
 
 #ifdef __OBJECT_MOTION__
 			light_ray.time = sd.time;
@@ -837,14 +835,13 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
 					float light_u = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_LIGHT_U);
 					float light_v = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_LIGHT_V);
 
-					if(direct_emission(kg, &sd, i, 0.0f, 0.0f, light_u, light_v, &light_ray, &L_light, &lamp)) {
+					if(direct_emission(kg, &sd, i, 0.0f, 0.0f, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
 						/* trace shadow ray */
 						float3 shadow;
 
 						if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
 							/* accumulate */
-							bool is_lamp = (lamp != ~0);
-							path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, state.bounce, is_lamp);
+							path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, num_samples_inv, state.bounce, is_lamp);
 						}
 					}
 				}
@@ -867,14 +864,13 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
 					if(kernel_data.integrator.num_all_lights)
 						light_t = 0.5f*light_t;
 
-					if(direct_emission(kg, &sd, -1, light_t, 0.0f, light_u, light_v, &light_ray, &L_light, &lamp)) {
+					if(direct_emission(kg, &sd, -1, light_t, 0.0f, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
 						/* trace shadow ray */
 						float3 shadow;
 
 						if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
 							/* accumulate */
-							bool is_lamp = (lamp != ~0);
-							path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, state.bounce, is_lamp);
+							path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, num_samples_inv, state.bounce, is_lamp);
 						}
 					}
 				}
@@ -949,6 +945,11 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
 				kernel_path_indirect(kg, rng, sample*num_samples + j, bsdf_ray, buffer,
 					tp*num_samples_inv, num_samples,
 					min_ray_pdf, bsdf_pdf, ps, rng_offset+PRNG_BOUNCE_NUM, &L);
+
+				/* for render passes, sum and reset indirect light pass variables
+				 * for the next samples */
+				path_radiance_sum_indirect(&L);
+				path_radiance_reset_indirect(&L);
 			}
 		}
 
diff --git a/intern/cycles/kernel/kernel_primitive.h b/intern/cycles/kernel/kernel_primitive.h
index 0851af2..323394c 100644
--- a/intern/cycles/kernel/kernel_primitive.h
+++ b/intern/cycles/kernel/kernel_primitive.h
@@ -106,7 +106,7 @@ __device float3 primitive_tangent(KernelGlobals *kg, ShaderData *sd)
 		float3 data = primitive_attribute_float3(kg, sd, attr_elem, attr_offset, NULL, NULL);
 		data = make_float3(-(data.y - 0.5f), (data.x - 0.5f), 0.0f);
 		object_normal_transform(kg, sd, &data);
-		return cross(sd->N, normalize(cross(data, sd->N)));;
+		return cross(sd->N, normalize(cross(data, sd->N)));
 	}
 	else {
 		/* otherwise use surface derivatives */
diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h
index 0a5a2ab..df86b35 100644
--- a/intern/cycles/kernel/kernel_shader.h
+++ b/intern/cycles/kernel/kernel_shader.h
@@ -53,7 +53,7 @@ __device_noinline void shader_setup_object_transforms(KernelGlobals *kg, ShaderD
 }
 #endif
 
-__device_inline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
+__device_noinline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
 	const Intersection *isect, const Ray *ray)
 {
 #ifdef __INSTANCING__
@@ -160,7 +160,7 @@ __device_inline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
 
 /* ShaderData setup from position sampled on mesh */
 
-__device void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd,
+__device_noinline void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd,
 	const float3 P, const float3 Ng, const float3 I,
 	int shader, int object, int prim, float u, float v, float t, float time, int segment = ~0)
 {
@@ -283,7 +283,7 @@ __device void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd,
 
 /* ShaderData setup for displacement */
 
-__device void shader_setup_from_displace(KernelGlobals *kg, ShaderData *sd,
+__device_noinline void shader_setup_from_displace(KernelGlobals *kg, ShaderData *sd,
 	int object, int prim, float u, float v)
 {
 	/* Note: no OSLShader::init call here, this is done in shader_setup_from_sample! */
diff --git a/intern/cycles/kernel/kernel_sse2.cpp b/intern/cycles/kernel/kernel_sse2.cpp
new file mode 100644
index 0000000..e9d482a
--- /dev/null
+++ b/intern/cycles/kernel/kernel_sse2.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* Optimized CPU kernel entry points. This file is compiled with SSE2
+ * optimization flags and nearly all functions inlined, while kernel.cpp
+ * is compiled without for other CPU's. */
+
+#ifdef WITH_OPTIMIZED_KERNEL
+
+#include "kernel.h"
+#include "kernel_compat_cpu.h"
+#include "kernel_math.h"
+#include "kernel_types.h"
+#include "kernel_globals.h"
+#include "kernel_film.h"
+#include "kernel_path.h"
+#include "kernel_displace.h"
+
+CCL_NAMESPACE_BEGIN
+
+/* Path Tracing */
+
+void kernel_cpu_sse2_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, int sample, int x, int y, int offset, int stride)
+{
+	kernel_path_trace(kg, buffer, rng_state, sample, x, y, offset, stride);
+}
+
+/* Tonemapping */
+
+void kernel_cpu_sse2_tonemap(KernelGlobals *kg, uchar4 *rgba, float *buffer, int sample, int resolution, int x, int y, int offset, int stride)
+{
+	kernel_film_tonemap(kg, rgba, buffer, sample, resolution, x, y, offset, stride);
+}
+
+/* Shader Evaluate */
+
+void kernel_cpu_sse2_shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int i)
+{
+	kernel_shader_evaluate(kg, input, output, (ShaderEvalType)type, i);
+}
+
+CCL_NAMESPACE_END
+
+#endif
+
diff --git a/intern/cycles/kernel/kernel_sse3.cpp b/intern/cycles/kernel/kernel_sse3.cpp
new file mode 100644
index 0000000..9a8b389
--- /dev/null
+++ b/intern/cycles/kernel/kernel_sse3.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* Optimized CPU kernel entry points. This file is compiled with SSE3
+ * optimization flags and nearly all functions inlined, while kernel.cpp
+ * is compiled without for other CPU's. */
+
+#ifdef WITH_OPTIMIZED_KERNEL
+
+#include "kernel.h"
+#include "kernel_compat_cpu.h"
+#include "kernel_math.h"
+#include "kernel_types.h"
+#include "kernel_globals.h"
+#include "kernel_film.h"
+#include "kernel_path.h"
+#include "kernel_displace.h"
+
+CCL_NAMESPACE_BEGIN
+
+/* Path Tracing */
+
+void kernel_cpu_sse3_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, int sample, int x, int y, int offset, int stride)
+{
+	kernel_path_trace(kg, buffer, rng_state, sample, x, y, offset, stride);
+}
+
+/* Tonemapping */
+
+void kernel_cpu_sse3_tonemap(KernelGlobals *kg, uchar4 *rgba, float *buffer, int sample, int resolution, int x, int y, int offset, int stride)
+{
+	kernel_film_tonemap(kg, rgba, buffer, sample, resolution, x, y, offset, stride);
+}
+
+/* Shader Evaluate */
+
+void kernel_cpu_sse3_shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int i)
+{
+	kernel_shader_evaluate(kg, input, output, (ShaderEvalType)type, i);
+}
+
+CCL_NAMESPACE_END
+
+#endif
+
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 102be44..ddbda92 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -43,12 +43,11 @@ CCL_NAMESPACE_BEGIN
 #ifdef __KERNEL_CPU__
 #define __KERNEL_SHADING__
 #define __KERNEL_ADV_SHADING__
+#define __NON_PROGRESSIVE__
+#define __HAIR__
 #ifdef WITH_OSL
 #define __OSL__
 #endif
-#define __NON_PROGRESSIVE__
-#define __HAIR__
-#define __LAMP_MIS__
 #endif
 
 #ifdef __KERNEL_CUDA__
@@ -113,9 +112,10 @@ CCL_NAMESPACE_BEGIN
 #define __TRANSPARENT_SHADOWS__
 #define __PASSES__
 #define __BACKGROUND_MIS__
+#define __LAMP_MIS__
 #define __AO__
-#define __CAMERA_MOTION__
 #define __ANISOTROPIC__
+#define __CAMERA_MOTION__
 #define __OBJECT_MOTION__
 #endif
 //#define __SOBOL_FULL_SCREEN__
@@ -255,6 +255,10 @@ typedef struct PathRadiance {
 	float3 indirect_glossy;
 	float3 indirect_transmission;
 
+	float3 path_diffuse;
+	float3 path_glossy;
+	float3 path_transmission;
+
 	float4 shadow;
 } PathRadiance;
 
@@ -281,8 +285,9 @@ typedef enum ShaderFlag {
 	SHADER_SMOOTH_NORMAL = (1 << 31),
 	SHADER_CAST_SHADOW = (1 << 30),
 	SHADER_AREA_LIGHT = (1 << 29),
+	SHADER_USE_MIS = (1 << 28),
 
-	SHADER_MASK = ~(SHADER_SMOOTH_NORMAL|SHADER_CAST_SHADOW|SHADER_AREA_LIGHT)
+	SHADER_MASK = ~(SHADER_SMOOTH_NORMAL|SHADER_CAST_SHADOW|SHADER_AREA_LIGHT|SHADER_USE_MIS)
 } ShaderFlag;
 
 /* Light Type */
@@ -294,6 +299,7 @@ typedef enum LightType {
 	LIGHT_AREA,
 	LIGHT_AO,
 	LIGHT_SPOT,
+	LIGHT_TRIANGLE,
 	LIGHT_STRAND
 } LightType;
 
@@ -604,9 +610,9 @@ typedef struct KernelFilm {
 	int pass_ao;
 
 	int pass_shadow;
+	float pass_shadow_scale;
 	int pass_pad1;
 	int pass_pad2;
-	int pass_pad3;
 } KernelFilm;
 
 typedef struct KernelBackground {
@@ -673,7 +679,7 @@ typedef struct KernelIntegrator {
 	int transmission_samples;
 	int ao_samples;
 	int mesh_light_samples;
-	int pad1;
+	int use_lamp_mis;
 } KernelIntegrator;
 
 typedef struct KernelBVH {
@@ -696,6 +702,7 @@ typedef enum CurveFlag {
 	CURVE_KN_NORMALCORRECTION = 128,		/* correct tangent normal for slope? */
 	CURVE_KN_TRUETANGENTGNORMAL = 256,		/* use tangent normal for geometry? */
 	CURVE_KN_TANGENTGNORMAL = 512,			/* use tangent normal for shader? */
+	CURVE_KN_RIBBONS = 1024,				/* use flat curve ribbons */
 } CurveFlag;
 
 typedef struct KernelCurves {
@@ -703,7 +710,7 @@ typedef struct KernelCurves {
 	float normalmix;
 	float encasing_ratio;
 	int curveflags;
-	int pad;
+	int subdivisions;
 
 } KernelCurves;
 
diff --git a/intern/cycles/kernel/osl/SConscript b/intern/cycles/kernel/osl/SConscript
index fe7fec4..0989956 100644
--- a/intern/cycles/kernel/osl/SConscript
+++ b/intern/cycles/kernel/osl/SConscript
@@ -46,6 +46,7 @@ defs.append('WITH_OSL')
 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
     cxxflags.append('-DBOOST_NO_RTTI -DBOOST_NO_TYPEID'.split())
     incs.append(env['BF_PTHREADS_INC'])
+    defs.append('OSL_STATIC_LIBRARY')
 else:
     cxxflags.append('-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID'.split())
 
diff --git a/intern/cycles/kernel/shaders/node_musgrave_texture.osl b/intern/cycles/kernel/shaders/node_musgrave_texture.osl
index 38232ea..8675c23 100644
--- a/intern/cycles/kernel/shaders/node_musgrave_texture.osl
+++ b/intern/cycles/kernel/shaders/node_musgrave_texture.osl
@@ -37,14 +37,14 @@ float noise_musgrave_fBm(point p, string basis, float H, float lacunarity, float
 	int i;
 
 	for (i = 0; i < (int)octaves; i++) {
-		value += safe_noise(p) * pwr;
+		value += safe_noise(p, 0) * pwr;
 		pwr *= pwHL;
 		p *= lacunarity;
 	}
 
 	rmd = octaves - floor(octaves);
 	if (rmd != 0.0)
-		value += rmd * safe_noise(p) * pwr;
+		value += rmd * safe_noise(p, 0) * pwr;
 
 	return value;
 }
@@ -65,14 +65,14 @@ float noise_musgrave_multi_fractal(point p, string basis, float H, float lacunar
 	int i;
 
 	for (i = 0; i < (int)octaves; i++) {
-		value *= (pwr * safe_noise(p) + 1.0);
+		value *= (pwr * safe_noise(p, 0) + 1.0);
 		pwr *= pwHL;
 		p *= lacunarity;
 	}
 
 	rmd = octaves - floor(octaves);
 	if (rmd != 0.0)
-		value *= (rmd * pwr * safe_noise(p) + 1.0); /* correct? */
+		value *= (rmd * pwr * safe_noise(p, 0) + 1.0); /* correct? */
 
 	return value;
 }
@@ -93,11 +93,11 @@ float noise_musgrave_hetero_terrain(point p, string basis, float H, float lacuna
 	int i;
 
 	/* first unscaled octave of function; later octaves are scaled */
-	value = offset + safe_noise(p);
+	value = offset + safe_noise(p, 0);
 	p *= lacunarity;
 
 	for (i = 1; i < (int)octaves; i++) {
-		increment = (safe_noise(p) + offset) * pwr * value;
+		increment = (safe_noise(p, 0) + offset) * pwr * value;
 		value += increment;
 		pwr *= pwHL;
 		p *= lacunarity;
@@ -105,7 +105,7 @@ float noise_musgrave_hetero_terrain(point p, string basis, float H, float lacuna
 
 	rmd = octaves - floor(octaves);
 	if (rmd != 0.0) {
-		increment = (safe_noise(p) + offset) * pwr * value;
+		increment = (safe_noise(p, 0) + offset) * pwr * value;
 		value += rmd * increment;
 	}
 
@@ -128,7 +128,7 @@ float noise_musgrave_hybrid_multi_fractal(point p, string basis, float H,
 	float pwr = pwHL;
 	int i;
 
-	result = safe_noise(p) + offset;
+	result = safe_noise(p, 0) + offset;
 	weight = gain * result;
 	p *= lacunarity;
 
@@ -136,7 +136,7 @@ float noise_musgrave_hybrid_multi_fractal(point p, string basis, float H,
 		if (weight > 1.0)
 			weight = 1.0;
 
-		signal = (safe_noise(p) + offset) * pwr;
+		signal = (safe_noise(p, 0) + offset) * pwr;
 		pwr *= pwHL;
 		result += weight * signal;
 		weight *= gain * signal;
@@ -145,7 +145,7 @@ float noise_musgrave_hybrid_multi_fractal(point p, string basis, float H,
 
 	rmd = octaves - floor(octaves);
 	if (rmd != 0.0)
-		result += rmd * ((safe_noise(p) + offset) * pwr);
+		result += rmd * ((safe_noise(p, 0) + offset) * pwr);
 
 	return result;
 }
@@ -166,7 +166,7 @@ float noise_musgrave_ridged_multi_fractal(point p, string basis, float H,
 	float pwr = pwHL;
 	int i;
 
-	signal = offset - fabs(safe_noise(p));
+	signal = offset - fabs(safe_noise(p, 0));
 	signal *= signal;
 	result = signal;
 	weight = 1.0;
@@ -174,7 +174,7 @@ float noise_musgrave_ridged_multi_fractal(point p, string basis, float H,
 	for (i = 1; i < (int)octaves; i++) {
 		p *= lacunarity;
 		weight = clamp(signal * gain, 0.0, 1.0);
-		signal = offset - fabs(safe_noise(p));
+		signal = offset - fabs(safe_noise(p, 0));
 		signal *= signal;
 		signal *= weight;
 		result += signal * pwr;
diff --git a/intern/cycles/kernel/shaders/node_normal_map.osl b/intern/cycles/kernel/shaders/node_normal_map.osl
index dc25eb8..21382fa 100644
--- a/intern/cycles/kernel/shaders/node_normal_map.osl
+++ b/intern/cycles/kernel/shaders/node_normal_map.osl
@@ -31,15 +31,23 @@ shader node_normal_map(
 
 	if (space == "Tangent") {
 		vector tangent;
+		vector ninterp;
 		float tangent_sign;
 
-		getattribute(attr_name, tangent);
-		getattribute(attr_sign_name, tangent_sign);
+		// get _unnormalized_ interpolated normal and tangent
+		if(!getattribute(attr_name, tangent) ||
+		   !getattribute(attr_sign_name, tangent_sign) ||
+		   !getattribute("geom:N", ninterp)) {
+			Normal = normal(0, 0, 0);
+		}
+		else {
+			// apply normal map
+			vector B = tangent_sign * cross(ninterp, tangent);
+			Normal = normalize(mcolor[0] * tangent + mcolor[1] * B + mcolor[2] * ninterp);
 
-		tangent = transform("object", "world", tangent);
-
-		vector B = tangent_sign * cross(NormalIn, tangent);
-		Normal = normalize(mcolor[0] * tangent + mcolor[1] * B + mcolor[2] * NormalIn);
+			// transform to world space
+			Normal = normalize(transform("object", "world", Normal));
+		}
 	}
 	else if (space == "Object")
 		Normal = normalize(transform("object", "world", vector(mcolor)));
diff --git a/intern/cycles/kernel/shaders/node_texture.h b/intern/cycles/kernel/shaders/node_texture.h
index 2de0fc0..463c68a 100644
--- a/intern/cycles/kernel/shaders/node_texture.h
+++ b/intern/cycles/kernel/shaders/node_texture.h
@@ -151,9 +151,17 @@ float voronoi_CrS(point p) { return 2.0 * voronoi_Cr(p) - 1.0; }
 
 /* Noise Bases */
 
-float safe_noise(point p)
+float safe_noise(point p, int type)
 {
-	float f = noise(p);
+	float f = 0.0;
+	
+	/* Perlin noise in range -1..1 */
+	if (type == 0)
+		f = noise("perlin", p);
+	
+	/* Perlin noise in range 0..1 */
+	else
+		f = noise(p);
 
 	/* can happen for big coordinates, things even out to 0.5 then anyway */
 	if(!isfinite(f))
@@ -167,7 +175,7 @@ float noise_basis(point p, string basis)
 	float result = 0.0;
 
 	if (basis == "Perlin")
-		result = safe_noise(p); /* returns perlin noise in range 0..1 */
+		result = safe_noise(p, 1);
 	if (basis == "Voronoi F1")
 		result = voronoi_F1S(p);
 	if (basis == "Voronoi F2")
diff --git a/intern/cycles/kernel/svm/svm_tex_coord.h b/intern/cycles/kernel/svm/svm_tex_coord.h
index 7a1af43..d793169 100644
--- a/intern/cycles/kernel/svm/svm_tex_coord.h
+++ b/intern/cycles/kernel/svm/svm_tex_coord.h
@@ -248,24 +248,27 @@ __device void svm_node_normal_map(KernelGlobals *kg, ShaderData *sd, float *stac
 		}
 
 		/* first try to get tangent attribute */
-		AttributeElement attr_elem, attr_sign_elem;
+		AttributeElement attr_elem, attr_sign_elem, attr_normal_elem;
 		int attr_offset = find_attribute(kg, sd, node.z, &attr_elem);
 		int attr_sign_offset = find_attribute(kg, sd, node.w, &attr_sign_elem);
+		int attr_normal_offset = find_attribute(kg, sd, ATTR_STD_VERTEX_NORMAL, &attr_normal_elem);
 
-		if(attr_offset == ATTR_STD_NOT_FOUND || attr_sign_offset == ATTR_STD_NOT_FOUND) {
+		if(attr_offset == ATTR_STD_NOT_FOUND || attr_sign_offset == ATTR_STD_NOT_FOUND || attr_normal_offset == ATTR_STD_NOT_FOUND) {
 			stack_store_float3(stack, normal_offset, make_float3(0.0f, 0.0f, 0.0f));
 			return;
 		}
 
-		/* ensure orthogonal and normalized (interpolation breaks it) */
+		/* get _unnormalized_ interpolated normal and tangent */
 		float3 tangent = primitive_attribute_float3(kg, sd, attr_elem, attr_offset, NULL, NULL);
 		float sign = primitive_attribute_float(kg, sd, attr_sign_elem, attr_sign_offset, NULL, NULL);
+		float3 normal = primitive_attribute_float3(kg, sd, attr_normal_elem, attr_normal_offset, NULL, NULL);
 
-		object_normal_transform(kg, sd, &tangent);
-		tangent = cross(sd->N, normalize(cross(tangent, sd->N)));;
+		/* apply normal map */
+		float3 B = sign * cross(normal, tangent);
+		N = normalize(color.x * tangent + color.y * B + color.z * normal);
 
-		float3 B = sign * cross(sd->N, tangent);
-		N = normalize(color.x * tangent + color.y * B + color.z * sd->N);
+		/* transform to world space */
+		object_normal_transform(kg, sd, &N);
 	}
 	else {
 		/* object, world space */
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
index 3b61ccd..572cfae 100644
--- a/intern/cycles/render/buffers.cpp
+++ b/intern/cycles/render/buffers.cpp
@@ -83,6 +83,7 @@ RenderTile::RenderTile()
 	w = 0;
 	h = 0;
 
+	sample = 0;
 	start_sample = 0;
 	num_samples = 0;
 	resolution = 0;
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp
index a78ede9..3ca1949 100644
--- a/intern/cycles/render/camera.cpp
+++ b/intern/cycles/render/camera.cpp
@@ -216,9 +216,9 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
 
 	/* motion blur */
 #ifdef __CAMERA_MOTION__
-	kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: 0.0f;
+	kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: -1.0f;
 #else
-	kcam->shuttertime = 0.0f;
+	kcam->shuttertime = -1.0f;
 #endif
 
 	/* type */
diff --git a/intern/cycles/render/camera.h b/intern/cycles/render/camera.h
index 9696161..197a4da 100644
--- a/intern/cycles/render/camera.h
+++ b/intern/cycles/render/camera.h
@@ -90,7 +90,7 @@ public:
 	Transform worldtocamera;
 
 	Transform rastertocamera;
-	Transform cameratoraster;;
+	Transform cameratoraster;
 
 	float3 dx;
 	float3 dy;
diff --git a/intern/cycles/render/curves.cpp b/intern/cycles/render/curves.cpp
index 3299503..9fa867a 100644
--- a/intern/cycles/render/curves.cpp
+++ b/intern/cycles/render/curves.cpp
@@ -29,6 +29,52 @@
 
 CCL_NAMESPACE_BEGIN
 
+/* Curve functions */
+
+void curvebounds(float *lower, float *upper, float3 *p, int dim)
+{
+	float *p0 = &p[0].x;
+	float *p1 = &p[1].x;
+	float *p2 = &p[2].x;
+	float *p3 = &p[3].x;
+	float fc = 0.71f;
+	float curve_coef[4];
+	curve_coef[0] = p1[dim];
+	curve_coef[1] = -fc*p0[dim] + fc*p2[dim];
+	curve_coef[2] = 2.0f * fc * p0[dim] + (fc - 3.0f) * p1[dim] + (3.0f - 2.0f * fc) * p2[dim] - fc * p3[dim];
+	curve_coef[3] = -fc * p0[dim] + (2.0f - fc) * p1[dim] + (fc - 2.0f) * p2[dim] + fc * p3[dim];
+	float discroot = curve_coef[2] * curve_coef[2] - 3 * curve_coef[3] * curve_coef[1];
+	float ta = -1.0f;
+	float tb = -1.0f;
+	if(discroot >= 0) {
+		discroot = sqrt(discroot);
+		ta = (-curve_coef[2] - discroot) / (3 * curve_coef[3]);
+		tb = (-curve_coef[2] + discroot) / (3 * curve_coef[3]);
+		ta = (ta > 1.0f || ta < 0.0f) ? -1.0f : ta;
+		tb = (tb > 1.0f || tb < 0.0f) ? -1.0f : tb;
+	}
+
+	*upper = max(p1[dim],p2[dim]);
+	*lower = min(p1[dim],p2[dim]);
+	float exa = p1[dim];
+	float exb = p2[dim];
+	float t2;
+	float t3;
+	if(ta >= 0.0f) {
+		t2 = ta * ta;
+		t3 = t2 * ta;
+		exa = curve_coef[3] * t3 + curve_coef[2] * t2 + curve_coef[1] * ta + curve_coef[0];
+	}
+	if(tb >= 0.0f) {
+		t2 = tb * tb;
+		t3 = t2 * tb;
+		exb = curve_coef[3] * t3 + curve_coef[2] * t2 + curve_coef[1] * tb + curve_coef[0];
+	}
+	*upper = max(*upper, max(exa,exb));
+	*lower = min(*lower, min(exa,exb));
+	
+}
+
 /* Hair System Manager */
 
 CurveSystemManager::CurveSystemManager()
@@ -36,16 +82,16 @@ CurveSystemManager::CurveSystemManager()
 	primitive = CURVE_LINE_SEGMENTS;
 	line_method = CURVE_CORRECTED;
 	interpolation = CURVE_CARDINAL;
-	triangle_method = CURVE_CAMERA;
+	triangle_method = CURVE_CAMERA_TRIANGLES;
 	resolution = 3;
 	segments = 1;
+	subdivisions = 3;
 
 	normalmix = 1.0f;
 	encasing_ratio = 1.01f;
 
 	use_curves = true;
 	use_smooth = true;
-	use_cache = true;
 	use_parents = false;
 	use_encasing = true;
 	use_backfacing = false;
@@ -75,31 +121,36 @@ void CurveSystemManager::device_update(Device *device, DeviceScene *dscene, Scen
 
 	kcurve->curveflags = 0;
 
-	if(primitive == CURVE_SEGMENTS)
-		kcurve->curveflags |= CURVE_KN_INTERPOLATE;
-
-	if(line_method == CURVE_ACCURATE)
-		kcurve->curveflags |= CURVE_KN_ACCURATE;
-	if(line_method == CURVE_CORRECTED)
-		kcurve->curveflags |= CURVE_KN_INTERSECTCORRECTION;
-	if(line_method == CURVE_POSTCORRECTED)
-		kcurve->curveflags |= CURVE_KN_POSTINTERSECTCORRECTION;
-
-	if(use_tangent_normal)
-		kcurve->curveflags |= CURVE_KN_TANGENTGNORMAL;
-	if(use_tangent_normal_correction)
-		kcurve->curveflags |= CURVE_KN_NORMALCORRECTION;
-	if(use_tangent_normal_geometry)
-		kcurve->curveflags |= CURVE_KN_TRUETANGENTGNORMAL;
-	if(use_joined)
-		kcurve->curveflags |= CURVE_KN_CURVEDATA;
-	if(use_backfacing)
-		kcurve->curveflags |= CURVE_KN_BACKFACING;
-	if(use_encasing)
-		kcurve->curveflags |= CURVE_KN_ENCLOSEFILTER;
-
-	kcurve->normalmix = normalmix;
-	kcurve->encasing_ratio = encasing_ratio;
+	if(use_curves) {
+		if(primitive == CURVE_SEGMENTS || primitive == CURVE_RIBBONS)
+			kcurve->curveflags |= CURVE_KN_INTERPOLATE;
+		if(primitive == CURVE_RIBBONS)
+			kcurve->curveflags |= CURVE_KN_RIBBONS;
+
+		if(line_method == CURVE_ACCURATE)
+			kcurve->curveflags |= CURVE_KN_ACCURATE;
+		if(line_method == CURVE_CORRECTED)
+			kcurve->curveflags |= CURVE_KN_INTERSECTCORRECTION;
+		if(line_method == CURVE_POSTCORRECTED)
+			kcurve->curveflags |= CURVE_KN_POSTINTERSECTCORRECTION;
+
+		if(use_tangent_normal)
+			kcurve->curveflags |= CURVE_KN_TANGENTGNORMAL;
+		if(use_tangent_normal_correction)
+			kcurve->curveflags |= CURVE_KN_NORMALCORRECTION;
+		if(use_tangent_normal_geometry)
+			kcurve->curveflags |= CURVE_KN_TRUETANGENTGNORMAL;
+		if(use_joined)
+			kcurve->curveflags |= CURVE_KN_CURVEDATA;
+		if(use_backfacing)
+			kcurve->curveflags |= CURVE_KN_BACKFACING;
+		if(use_encasing)
+			kcurve->curveflags |= CURVE_KN_ENCLOSEFILTER;
+
+		kcurve->normalmix = normalmix;
+		kcurve->encasing_ratio = encasing_ratio;
+		kcurve->subdivisions = subdivisions;
+	}
 
 	if(progress.get_cancel()) return;
 
@@ -123,14 +174,14 @@ bool CurveSystemManager::modified(const CurveSystemManager& CurveSystemManager)
 		encasing_ratio == CurveSystemManager.encasing_ratio &&
 		use_backfacing == CurveSystemManager.use_backfacing &&
 		normalmix == CurveSystemManager.normalmix &&
-		use_cache == CurveSystemManager.use_cache &&
 		use_smooth == CurveSystemManager.use_smooth &&
 		triangle_method == CurveSystemManager.triangle_method &&
 		resolution == CurveSystemManager.resolution &&
 		use_curves == CurveSystemManager.use_curves &&
 		use_joined == CurveSystemManager.use_joined &&
 		segments == CurveSystemManager.segments &&
-		use_parents == CurveSystemManager.use_parents);
+		use_parents == CurveSystemManager.use_parents &&
+		subdivisions == CurveSystemManager.subdivisions);
 }
 
 bool CurveSystemManager::modified_mesh(const CurveSystemManager& CurveSystemManager)
@@ -143,8 +194,7 @@ bool CurveSystemManager::modified_mesh(const CurveSystemManager& CurveSystemMana
 		resolution == CurveSystemManager.resolution &&
 		use_curves == CurveSystemManager.use_curves &&
 		use_joined == CurveSystemManager.use_joined &&
-		segments == CurveSystemManager.segments &&
-		use_cache == CurveSystemManager.use_cache);
+		segments == CurveSystemManager.segments);
 }
 
 void CurveSystemManager::tag_update(Scene *scene)
diff --git a/intern/cycles/render/curves.h b/intern/cycles/render/curves.h
index bb9ef6d..3527998 100644
--- a/intern/cycles/render/curves.h
+++ b/intern/cycles/render/curves.h
@@ -29,23 +29,28 @@ class DeviceScene;
 class Progress;
 class Scene;
 
+void curvebounds(float *lower, float *upper, float3 *p, int dim);
+
 typedef enum curve_presets {
 	CURVE_CUSTOM,
+	CURVE_FAST_PLANES,
 	CURVE_TANGENT_SHADING,
 	CURVE_TRUE_NORMAL,
-	CURVE_ACCURATE_PRESET
+	CURVE_ACCURATE_PRESET,
+	CURVE_SMOOTH_CURVES
 } curve_presets;
 
 typedef enum curve_primitives {
 	CURVE_TRIANGLES,
 	CURVE_LINE_SEGMENTS,
-	CURVE_SEGMENTS
+	CURVE_SEGMENTS,
+	CURVE_RIBBONS
 } curve_primitives;
 
 typedef enum curve_triangles {
-	CURVE_CAMERA,
-	CURVE_RIBBONS,
-	CURVE_TESSELATED
+	CURVE_CAMERA_TRIANGLES,
+	CURVE_RIBBON_TRIANGLES,
+	CURVE_TESSELATED_TRIANGLES
 } curve_triangles;
 
 typedef enum curve_lines {
@@ -98,13 +103,13 @@ public:
 	int triangle_method;
 	int resolution;
 	int segments;
+	int subdivisions;
 
 	float normalmix;
 	float encasing_ratio;
 
 	bool use_curves;
 	bool use_smooth;
-	bool use_cache;
 	bool use_parents;
 	bool use_encasing;
 	bool use_backfacing;
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 14b2193..af27b46 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -708,7 +708,8 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight
 				value2_in->value.x = 1.0f;
 
 			weight_out = math_node->output("Value");
-			disconnect(weight_in);
+			if(weight_in->link)
+				disconnect(weight_in);
 		}
 
 		/* connected to closure mix weight */
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index e6f8ab4..8e844bc 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -85,16 +85,20 @@ bool ImageManager::set_animation_frame_update(int frame)
 	return false;
 }
 
-bool ImageManager::is_float_image(const string& filename, bool is_builtin)
+bool ImageManager::is_float_image(const string& filename, void *builtin_data, bool& is_linear)
 {
 	bool is_float = false;
+	is_linear = false;
 
-	if(is_builtin) {
+	if(builtin_data) {
 		if(builtin_image_info_cb) {
 			int width, height, channels;
-			builtin_image_info_cb(filename, is_float, width, height, channels);
+			builtin_image_info_cb(filename, builtin_data, is_float, width, height, channels);
 		}
 
+		if(is_float)
+			is_linear = true;
+
 		return is_float;
 	}
 
@@ -106,13 +110,29 @@ bool ImageManager::is_float_image(const string& filename, bool is_builtin)
 		if(in->open(filename, spec)) {
 			/* check the main format, and channel formats;
 			 * if any take up more than one byte, we'll need a float texture slot */
-			if(spec.format.basesize() > 1)
+			if(spec.format.basesize() > 1) {
 				is_float = true;
+				is_linear = true;
+			}
 
 			for(size_t channel = 0; channel < spec.channelformats.size(); channel++) {
-				if(spec.channelformats[channel].basesize() > 1)
+				if(spec.channelformats[channel].basesize() > 1) {
 					is_float = true;
+					is_linear = true;
+				}
+			}
+
+			/* basic color space detection, not great but better than nothing
+			 * before we do OpenColorIO integration */
+			if(is_float) {
+				string colorspace = spec.get_string_attribute("oiio:ColorSpace");
+
+				is_linear = !(colorspace == "sRGB" ||
+				              colorspace == "GammaCorrected" ||
+							  strcmp(in->format_name(), "png") == 0);
 			}
+			else
+				is_linear = false;
 
 			in->close();
 		}
@@ -123,13 +143,13 @@ bool ImageManager::is_float_image(const string& filename, bool is_builtin)
 	return is_float;
 }
 
-int ImageManager::add_image(const string& filename, bool is_builtin, bool animated, bool& is_float)
+int ImageManager::add_image(const string& filename, void *builtin_data, bool animated, bool& is_float, bool& is_linear)
 {
 	Image *img;
 	size_t slot;
 
 	/* load image info and find out if we need a float texture */
-	is_float = (pack_images)? false: is_float_image(filename, is_builtin);
+	is_float = (pack_images)? false: is_float_image(filename, builtin_data, is_linear);
 
 	if(is_float) {
 		/* find existing image */
@@ -160,7 +180,7 @@ int ImageManager::add_image(const string& filename, bool is_builtin, bool animat
 		/* add new image */
 		img = new Image();
 		img->filename = filename;
-		img->is_builtin = is_builtin;
+		img->builtin_data = builtin_data;
 		img->need_load = true;
 		img->animated = animated;
 		img->users = 1;
@@ -195,7 +215,7 @@ int ImageManager::add_image(const string& filename, bool is_builtin, bool animat
 		/* add new image */
 		img = new Image();
 		img->filename = filename;
-		img->is_builtin = is_builtin;
+		img->builtin_data = builtin_data;
 		img->need_load = true;
 		img->animated = animated;
 		img->users = 1;
@@ -209,12 +229,12 @@ int ImageManager::add_image(const string& filename, bool is_builtin, bool animat
 	return slot;
 }
 
-void ImageManager::remove_image(const string& filename, bool is_builtin)
+void ImageManager::remove_image(const string& filename, void *builtin_data)
 {
 	size_t slot;
 
 	for(slot = 0; slot < images.size(); slot++) {
-		if(images[slot] && images[slot]->filename == filename && images[slot]->is_builtin == is_builtin) {
+		if(images[slot] && images[slot]->filename == filename && images[slot]->builtin_data == builtin_data) {
 			/* decrement user count */
 			images[slot]->users--;
 			assert(images[slot]->users >= 0);
@@ -232,7 +252,7 @@ void ImageManager::remove_image(const string& filename, bool is_builtin)
 	if(slot == images.size()) {
 		/* see if it's in a float texture slot */
 		for(slot = 0; slot < float_images.size(); slot++) {
-			if(float_images[slot] && float_images[slot]->filename == filename && float_images[slot]->is_builtin == is_builtin) {
+			if(float_images[slot] && float_images[slot]->filename == filename && float_images[slot]->builtin_data == builtin_data) {
 				/* decrement user count */
 				float_images[slot]->users--;
 				assert(float_images[slot]->users >= 0);
@@ -257,7 +277,7 @@ bool ImageManager::file_load_image(Image *img, device_vector<uchar4>& tex_img)
 	ImageInput *in = NULL;
 	int width, height, components;
 
-	if(!img->is_builtin) {
+	if(!img->builtin_data) {
 		/* load image from file through OIIO */
 		in = ImageInput::create(img->filename);
 
@@ -281,7 +301,7 @@ bool ImageManager::file_load_image(Image *img, device_vector<uchar4>& tex_img)
 			return false;
 
 		bool is_float;
-		builtin_image_info_cb(img->filename, is_float, width, height, components);
+		builtin_image_info_cb(img->filename, img->builtin_data, is_float, width, height, components);
 	}
 
 	/* we only handle certain number of components */
@@ -309,7 +329,7 @@ bool ImageManager::file_load_image(Image *img, device_vector<uchar4>& tex_img)
 		delete in;
 	}
 	else {
-		builtin_image_pixels_cb(img->filename, pixels);
+		builtin_image_pixels_cb(img->filename, img->builtin_data, pixels);
 	}
 
 	if(components == 3) {
@@ -340,7 +360,7 @@ bool ImageManager::file_load_float_image(Image *img, device_vector<float4>& tex_
 	ImageInput *in = NULL;
 	int width, height, components;
 
-	if(!img->is_builtin) {
+	if(!img->builtin_data) {
 		/* load image from file through OIIO */
 		in = ImageInput::create(img->filename);
 
@@ -365,7 +385,7 @@ bool ImageManager::file_load_float_image(Image *img, device_vector<float4>& tex_
 			return false;
 
 		bool is_float;
-		builtin_image_info_cb(img->filename, is_float, width, height, components);
+		builtin_image_info_cb(img->filename, img->builtin_data, is_float, width, height, components);
 	}
 
 	if(!(components == 1 || components == 3 || components == 4)) {
@@ -391,7 +411,7 @@ bool ImageManager::file_load_float_image(Image *img, device_vector<float4>& tex_
 		delete in;
 	}
 	else {
-		builtin_image_float_pixels_cb(img->filename, pixels);
+		builtin_image_float_pixels_cb(img->filename, img->builtin_data, pixels);
 	}
 
 	if(components == 3) {
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h
index e39ac14..b20ff23 100644
--- a/intern/cycles/render/image.h
+++ b/intern/cycles/render/image.h
@@ -51,9 +51,9 @@ public:
 	ImageManager();
 	~ImageManager();
 
-	int add_image(const string& filename, bool is_builtin, bool animated, bool& is_float);
-	void remove_image(const string& filename, bool is_builtin);
-	bool is_float_image(const string& filename, bool is_builtin);
+	int add_image(const string& filename, void *builtin_data, bool animated, bool& is_float, bool& is_linear);
+	void remove_image(const string& filename, void *builtin_data);
+	bool is_float_image(const string& filename, void *builtin_data, bool& is_linear);
 
 	void device_update(Device *device, DeviceScene *dscene, Progress& progress);
 	void device_free(Device *device, DeviceScene *dscene);
@@ -65,9 +65,9 @@ public:
 
 	bool need_update;
 
-	boost::function<void(const string &filename, bool &is_float, int &width, int &height, int &channels)> builtin_image_info_cb;
-	boost::function<bool(const string &filename, unsigned char *pixels)> builtin_image_pixels_cb;
-	boost::function<bool(const string &filename, float *pixels)> builtin_image_float_pixels_cb;
+	boost::function<void(const string &filename, void *data, bool &is_float, int &width, int &height, int &channels)> builtin_image_info_cb;
+	boost::function<bool(const string &filename, void *data, unsigned char *pixels)> builtin_image_pixels_cb;
+	boost::function<bool(const string &filename, void *data, float *pixels)> builtin_image_float_pixels_cb;
 private:
 	int tex_num_images;
 	int tex_num_float_images;
@@ -77,7 +77,7 @@ private:
 
 	struct Image {
 		string filename;
-		bool is_builtin;
+		void *builtin_data;
 
 		bool need_load;
 		bool animated;
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 1b94d60..47e9dd8 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -115,6 +115,8 @@ Light::Light()
 	spot_smooth = 0.0f;
 
 	cast_shadow = true;
+	use_mis = false;
+
 	shader = 0;
 	samples = 1;
 }
@@ -141,6 +143,7 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 
 	/* count */
 	size_t num_lights = scene->lights.size();
+	size_t num_background_lights = 0;
 	size_t num_triangles = 0;
 	size_t num_curve_segments = 0;
 
@@ -198,8 +201,10 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 		bool have_emission = false;
 
 		/* skip if we are not visible for BSDFs */
-		if(!(object->visibility & (PATH_RAY_DIFFUSE|PATH_RAY_GLOSSY|PATH_RAY_TRANSMIT)))
+		if(!(object->visibility & (PATH_RAY_DIFFUSE|PATH_RAY_GLOSSY|PATH_RAY_TRANSMIT))) {
+			j++;
 			continue;
+		}
 
 		/* skip if we have no emission shaders */
 		foreach(uint sindex, mesh->used_shaders) {
@@ -289,13 +294,21 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 
 	/* point lights */
 	float lightarea = (totarea > 0.0f)? totarea/scene->lights.size(): 1.0f;
+	bool use_lamp_mis = false;
 
 	for(int i = 0; i < scene->lights.size(); i++, offset++) {
+		Light *light = scene->lights[i];
+
 		distribution[offset].x = totarea;
 		distribution[offset].y = __int_as_float(~(int)i);
 		distribution[offset].z = 1.0f;
-		distribution[offset].w = scene->lights[i]->size;
+		distribution[offset].w = light->size;
 		totarea += lightarea;
+
+		if(light->size > 0.0f && light->use_mis)
+			use_lamp_mis = true;
+		if(light->type == LIGHT_BACKGROUND)
+			num_background_lights++;
 	}
 
 	/* normalize cumulative distribution functions */
@@ -314,6 +327,7 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 
 	/* update device */
 	KernelIntegrator *kintegrator = &dscene->data.integrator;
+	KernelFilm *kfilm = &dscene->data.film;
 	kintegrator->use_direct_light = (totarea > 0.0f);
 
 	if(kintegrator->use_direct_light) {
@@ -342,6 +356,18 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 			kintegrator->inv_pdf_lights = 1.0f/kintegrator->pdf_lights;
 		}
 
+		kintegrator->use_lamp_mis = use_lamp_mis;
+
+		/* bit of an ugly hack to compensate for emitting triangles influencing
+		 * amount of samples we get for this pass */
+		kfilm->pass_shadow_scale = 1.0f;
+
+		if(kintegrator->pdf_triangles != 0.0f)
+			kfilm->pass_shadow_scale *= 0.5f;
+
+		if(num_background_lights < num_lights)
+			kfilm->pass_shadow_scale *= (float)(num_lights - num_background_lights)/(float)num_lights;
+
 		/* CDF */
 		device->tex_alloc("__light_distribution", dscene->light_distribution);
 	}
@@ -353,6 +379,8 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 		kintegrator->pdf_triangles = 0.0f;
 		kintegrator->pdf_lights = 0.0f;
 		kintegrator->inv_pdf_lights = 0.0f;
+		kintegrator->use_lamp_mis = false;
+		kfilm->pass_shadow_scale = 1.0f;
 	}
 }
 
@@ -482,6 +510,9 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
 			float radius = light->size;
 			float invarea = (radius > 0.0f)? 1.0f/(M_PI_F*radius*radius): 1.0f;
 
+			if(light->use_mis && radius > 0.0f)
+				shader_id |= SHADER_USE_MIS;
+
 			light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z);
 			light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), radius, invarea, 0.0f);
 			light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
@@ -496,6 +527,9 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
 			float area = M_PI_F*radius*radius;
 			float invarea = (area > 0.0f)? 1.0f/area: 1.0f;
 
+			if(light->use_mis && area > 0.0f)
+				shader_id |= SHADER_USE_MIS;
+
 			light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), dir.x, dir.y, dir.z);
 			light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), radius, cosangle, invarea);
 			light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
@@ -503,6 +537,7 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
 		}
 		else if(light->type == LIGHT_BACKGROUND) {
 			shader_id &= ~SHADER_AREA_LIGHT;
+			shader_id |= SHADER_USE_MIS;
 
 			light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), 0.0f, 0.0f, 0.0f);
 			light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), 0.0f, 0.0f, 0.0f);
@@ -513,7 +548,10 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
 			float3 axisu = light->axisu*(light->sizeu*light->size);
 			float3 axisv = light->axisv*(light->sizev*light->size);
 			float area = len(axisu)*len(axisv);
-			float invarea = (area > 0.0f)? 1.0f/area: 0.0f;
+			float invarea = (area > 0.0f)? 1.0f/area: 1.0f;
+
+			if(light->use_mis && area > 0.0f)
+				shader_id |= SHADER_USE_MIS;
 
 			light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z);
 			light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), axisu.x, axisu.y, axisu.z);
@@ -528,6 +566,9 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
 			float spot_angle = cosf(light->spot_angle*0.5f);
 			float spot_smooth = (1.0f - spot_angle)*light->spot_smooth;
 
+			if(light->use_mis && radius > 0.0f)
+				shader_id |= SHADER_USE_MIS;
+
 			light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z);
 			light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), radius, invarea, spot_angle);
 			light_data[i*LIGHT_SIZE + 2] = make_float4(spot_smooth, dir.x, dir.y, dir.z);
diff --git a/intern/cycles/render/light.h b/intern/cycles/render/light.h
index 3cedde2..acd1692 100644
--- a/intern/cycles/render/light.h
+++ b/intern/cycles/render/light.h
@@ -52,6 +52,7 @@ public:
 	float spot_smooth;
 
 	bool cast_shadow;
+	bool use_mis;
 
 	int shader;
 	int samples;
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp
index d4619dc..8d12ace 100644
--- a/intern/cycles/render/mesh.cpp
+++ b/intern/cycles/render/mesh.cpp
@@ -43,6 +43,7 @@ Mesh::Mesh()
 	need_update = true;
 	transform_applied = false;
 	transform_negative_scaled = false;
+	transform_normal = transform_identity();
 	displacement_method = DISPLACE_BUMP;
 	bounds = BoundBox::empty;
 
@@ -94,6 +95,7 @@ void Mesh::clear()
 
 	transform_applied = false;
 	transform_negative_scaled = false;
+	transform_normal = transform_identity();
 }
 
 void Mesh::add_triangle(int v0, int v1, int v2, int shader_, bool smooth_)
@@ -151,7 +153,7 @@ void Mesh::add_face_normals()
 	/* don't compute if already there */
 	if(attributes.find(ATTR_STD_FACE_NORMAL))
 		return;
-
+	
 	/* get attributes */
 	Attribute *attr_fN = attributes.add(ATTR_STD_FACE_NORMAL);
 	float3 *fN = attr_fN->data_float3();
@@ -181,6 +183,14 @@ void Mesh::add_face_normals()
 				fN[i] = -fN[i];
 		}
 	}
+
+	/* expected to be in local space */
+	if(transform_applied) {
+		Transform ntfm = transform_inverse(transform_normal);
+
+		for(size_t i = 0; i < triangles_size; i++)
+			fN[i] = normalize(transform_direction(&ntfm, fN[i]));
+	}
 }
 
 void Mesh::add_vertex_normals()
@@ -188,7 +198,7 @@ void Mesh::add_vertex_normals()
 	/* don't compute if already there */
 	if(attributes.find(ATTR_STD_VERTEX_NORMAL))
 		return;
-
+	
 	/* get attributes */
 	Attribute *attr_fN = attributes.find(ATTR_STD_FACE_NORMAL);
 	Attribute *attr_vN = attributes.add(ATTR_STD_VERTEX_NORMAL);
@@ -232,10 +242,18 @@ void Mesh::pack_normals(Scene *scene, float4 *normal, float4 *vnormal)
 	size_t triangles_size = triangles.size();
 	uint *shader_ptr = (shader.size())? &shader[0]: NULL;
 
+	bool do_transform = transform_applied;
+	Transform ntfm = transform_normal;
+
 	for(size_t i = 0; i < triangles_size; i++) {
-		normal[i].x = fN[i].x;
-		normal[i].y = fN[i].y;
-		normal[i].z = fN[i].z;
+		float3 fNi = fN[i];
+
+		if(do_transform)
+			fNi = normalize(transform_direction(&ntfm, fNi));
+
+		normal[i].x = fNi.x;
+		normal[i].y = fNi.y;
+		normal[i].z = fNi.z;
 
 		/* stuff shader id in here too */
 		if(shader_ptr[i] != last_shader || last_smooth != smooth[i]) {
@@ -249,8 +267,14 @@ void Mesh::pack_normals(Scene *scene, float4 *normal, float4 *vnormal)
 
 	size_t verts_size = verts.size();
 
-	for(size_t i = 0; i < verts_size; i++)
-		vnormal[i] = make_float4(vN[i].x, vN[i].y, vN[i].z, 0.0f);
+	for(size_t i = 0; i < verts_size; i++) {
+		float3 vNi = vN[i];
+
+		if(do_transform)
+			vNi = normalize(transform_direction(&ntfm, vNi));
+
+		vnormal[i] = make_float4(vNi.x, vNi.y, vNi.z, 0.0f);
+	}
 }
 
 void Mesh::pack_verts(float4 *tri_verts, float4 *tri_vindex, size_t vert_offset)
@@ -942,6 +966,16 @@ void MeshManager::device_free(Device *device, DeviceScene *dscene)
 	dscene->attributes_map.clear();
 	dscene->attributes_float.clear();
 	dscene->attributes_float3.clear();
+
+#ifdef WITH_OSL
+	OSLGlobals *og = (OSLGlobals*)device->osl_memory();
+
+	if(og) {
+		og->object_name_map.clear();
+		og->attribute_map.clear();
+		og->object_names.clear();
+	}
+#endif
 }
 
 void MeshManager::tag_update(Scene *scene)
diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h
index b83752a..dca1b00 100644
--- a/intern/cycles/render/mesh.h
+++ b/intern/cycles/render/mesh.h
@@ -90,6 +90,7 @@ public:
 	BoundBox bounds;
 	bool transform_applied;
 	bool transform_negative_scaled;
+	Transform transform_normal;
 	DisplacementMethod displacement_method;
 
 	/* Update Flags */
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index d1297c9..8ac1224 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -141,10 +141,11 @@ ImageTextureNode::ImageTextureNode()
 	image_manager = NULL;
 	slot = -1;
 	is_float = -1;
+	is_linear = false;
 	filename = "";
-	is_builtin = false;
+	builtin_data = NULL;
 	color_space = ustring("Color");
-	projection = ustring("Flat");;
+	projection = ustring("Flat");
 	projection_blend = 0.0f;
 	animated = false;
 
@@ -156,7 +157,7 @@ ImageTextureNode::ImageTextureNode()
 ImageTextureNode::~ImageTextureNode()
 {
 	if(image_manager)
-		image_manager->remove_image(filename, is_builtin);
+		image_manager->remove_image(filename, builtin_data);
 }
 
 ShaderNode *ImageTextureNode::clone() const
@@ -165,6 +166,7 @@ ShaderNode *ImageTextureNode::clone() const
 	node->image_manager = NULL;
 	node->slot = -1;
 	node->is_float = -1;
+	node->is_linear = false;
 	return node;
 }
 
@@ -177,7 +179,7 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
 	image_manager = compiler.image_manager;
 	if(is_float == -1) {
 		bool is_float_bool;
-		slot = image_manager->add_image(filename, is_builtin, animated, is_float_bool);
+		slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool, is_linear);
 		is_float = (int)is_float_bool;
 	}
 
@@ -189,7 +191,7 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
 	if(slot != -1) {
 		compiler.stack_assign(vector_in);
 
-		int srgb = (is_float || color_space != "Color")? 0: 1;
+		int srgb = (is_linear || color_space != "Color")? 0: 1;
 		int vector_offset = vector_in->stack_offset;
 
 		if(!tex_mapping.skip()) {
@@ -238,10 +240,10 @@ void ImageTextureNode::compile(OSLCompiler& compiler)
 	tex_mapping.compile(compiler);
 
 	if(is_float == -1)
-		is_float = (int)image_manager->is_float_image(filename, false);
+		is_float = (int)image_manager->is_float_image(filename, NULL, is_linear);
 
 	compiler.parameter("filename", filename.c_str());
-	if(is_float || color_space != "Color")
+	if(is_linear || color_space != "Color")
 		compiler.parameter("color_space", "Linear");
 	else
 		compiler.parameter("color_space", "sRGB");
@@ -271,8 +273,9 @@ EnvironmentTextureNode::EnvironmentTextureNode()
 	image_manager = NULL;
 	slot = -1;
 	is_float = -1;
+	is_linear = false;
 	filename = "";
-	is_builtin = false;
+	builtin_data = NULL;
 	color_space = ustring("Color");
 	projection = ustring("Equirectangular");
 	animated = false;
@@ -285,7 +288,7 @@ EnvironmentTextureNode::EnvironmentTextureNode()
 EnvironmentTextureNode::~EnvironmentTextureNode()
 {
 	if(image_manager)
-		image_manager->remove_image(filename, is_builtin);
+		image_manager->remove_image(filename, builtin_data);
 }
 
 ShaderNode *EnvironmentTextureNode::clone() const
@@ -294,6 +297,7 @@ ShaderNode *EnvironmentTextureNode::clone() const
 	node->image_manager = NULL;
 	node->slot = -1;
 	node->is_float = -1;
+	node->is_linear = false;
 	return node;
 }
 
@@ -306,7 +310,7 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler)
 	image_manager = compiler.image_manager;
 	if(slot == -1) {
 		bool is_float_bool;
-		slot = image_manager->add_image(filename, is_builtin, animated, is_float_bool);
+		slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool, is_linear);
 		is_float = (int)is_float_bool;
 	}
 
@@ -318,7 +322,7 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler)
 	if(slot != -1) {
 		compiler.stack_assign(vector_in);
 
-		int srgb = (is_float || color_space != "Color")? 0: 1;
+		int srgb = (is_linear || color_space != "Color")? 0: 1;
 		int vector_offset = vector_in->stack_offset;
 
 		if(!tex_mapping.skip()) {
@@ -356,11 +360,11 @@ void EnvironmentTextureNode::compile(OSLCompiler& compiler)
 	tex_mapping.compile(compiler);
 
 	if(is_float == -1)
-		is_float = (int)image_manager->is_float_image(filename, false);
+		is_float = (int)image_manager->is_float_image(filename, NULL, is_linear);
 
 	compiler.parameter("filename", filename.c_str());
 	compiler.parameter("projection", projection);
-	if(is_float || color_space != "Color")
+	if(is_linear || color_space != "Color")
 		compiler.parameter("color_space", "Linear");
 	else
 		compiler.parameter("color_space", "sRGB");
@@ -3257,6 +3261,8 @@ void NormalMapNode::attributes(AttributeRequestSet *attributes)
 			attributes->add(ustring((string(attribute.c_str()) + ".tangent").c_str()));
 			attributes->add(ustring((string(attribute.c_str()) + ".tangent_sign").c_str()));
 		}
+
+		attributes->add(ATTR_STD_VERTEX_NORMAL);
 	}
 	
 	ShaderNode::attributes(attributes);
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 8b2d6a0..3609497 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -69,8 +69,9 @@ public:
 	ImageManager *image_manager;
 	int slot;
 	int is_float;
+	bool is_linear;
 	string filename;
-	bool is_builtin;
+	void *builtin_data;
 	ustring color_space;
 	ustring projection;
 	float projection_blend;
@@ -89,8 +90,9 @@ public:
 	ImageManager *image_manager;
 	int slot;
 	int is_float;
+	bool is_linear;
 	string filename;
-	bool is_builtin;
+	void *builtin_data;
 	ustring color_space;
 	ustring projection;
 	bool animated;
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index a89f8af..b31650c 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -84,45 +84,31 @@ void Object::apply_transform()
 {
 	if(!mesh || tfm == transform_identity())
 		return;
-	
+
+	float3 c0 = transform_get_column(&tfm, 0);
+	float3 c1 = transform_get_column(&tfm, 1);
+	float3 c2 = transform_get_column(&tfm, 2);
+	float scalar = pow(fabsf(dot(cross(c0, c1), c2)), 1.0f/3.0f);
+
 	for(size_t i = 0; i < mesh->verts.size(); i++)
 		mesh->verts[i] = transform_point(&tfm, mesh->verts[i]);
 
-	for(size_t i = 0; i < mesh->curve_keys.size(); i++)
+	for(size_t i = 0; i < mesh->curve_keys.size(); i++) {
 		mesh->curve_keys[i].co = transform_point(&tfm, mesh->curve_keys[i].co);
+		/* scale for strand radius - only correct for uniform transforms*/
+		mesh->curve_keys[i].radius *= scalar;
+	}
 
-	Attribute *attr_tangent = mesh->curve_attributes.find(ATTR_STD_CURVE_TANGENT);
-	Attribute *attr_fN = mesh->attributes.find(ATTR_STD_FACE_NORMAL);
-	Attribute *attr_vN = mesh->attributes.find(ATTR_STD_VERTEX_NORMAL);
-
-	Transform ntfm = transform_transpose(transform_inverse(tfm));
+	/* store matrix to transform later. when accessing these as attributes we
+	 * do not want the transform to be applied for consistency between static
+	 * and dynamic BVH, so we do it on packing. */
+	mesh->transform_normal = transform_transpose(transform_inverse(tfm));
 
 	/* we keep normals pointing in same direction on negative scale, notify
 	 * mesh about this in it (re)calculates normals */
 	if(transform_negative_scale(tfm))
 		mesh->transform_negative_scaled = true;
 
-	if(attr_fN) {
-		float3 *fN = attr_fN->data_float3();
-
-		for(size_t i = 0; i < mesh->triangles.size(); i++)
-			fN[i] = transform_direction(&ntfm, fN[i]);
-	}
-
-	if(attr_vN) {
-		float3 *vN = attr_vN->data_float3();
-
-		for(size_t i = 0; i < mesh->verts.size(); i++)
-			vN[i] = transform_direction(&ntfm, vN[i]);
-	}
-
-	if(attr_tangent) {
-		float3 *tangent = attr_tangent->data_float3();
-
-		for(size_t i = 0; i < mesh->curve_keys.size(); i++)
-			tangent[i] = transform_direction(&tfm, tangent[i]);
-	}
-
 	if(bounds.valid()) {
 		mesh->compute_bounds();
 		compute_bounds(false, 0.0f);
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp
index 28de56f..5615827 100644
--- a/intern/cycles/render/osl.cpp
+++ b/intern/cycles/render/osl.cpp
@@ -47,15 +47,25 @@ OSLShaderManager::OSLShaderManager()
 {
 	services = new OSLRenderServices();
 
-	shading_system_init();
 	texture_system_init();
+	shading_system_init();
 }
 
 OSLShaderManager::~OSLShaderManager()
 {
 	OSL::ShadingSystem::destroy(ss);
 	OSL::TextureSystem::destroy(ts);
+
+	delete services;
+}
+
+void OSLShaderManager::reset(Scene *scene)
+{
+	OSL::ShadingSystem::destroy(ss);
 	delete services;
+
+	services = new OSLRenderServices();
+	shading_system_init();
 }
 
 void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)
@@ -88,6 +98,7 @@ void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
 	og->ss = ss;
 	og->ts = ts;
 	og->services = services;
+
 	int background_id = scene->shader_manager->get_shader_id(scene->default_background);
 	og->background_state = og->surface_state[background_id & SHADER_MASK];
 	og->use = true;
diff --git a/intern/cycles/render/osl.h b/intern/cycles/render/osl.h
index 3c599ca..4b4ed6c 100644
--- a/intern/cycles/render/osl.h
+++ b/intern/cycles/render/osl.h
@@ -36,7 +36,7 @@ class Device;
 class DeviceScene;
 class ImageManager;
 class OSLRenderServices;
-class OSLGlobals;
+struct OSLGlobals;
 class Scene;
 class ShaderGraph;
 class ShaderNode;
@@ -64,6 +64,8 @@ public:
 	OSLShaderManager();
 	~OSLShaderManager();
 
+	void reset(Scene *scene);
+
 	bool use_osl() { return true; }
 
 	void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress);
diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp
index 093bfec..7b82a91 100644
--- a/intern/cycles/render/scene.cpp
+++ b/intern/cycles/render/scene.cpp
@@ -85,6 +85,12 @@ void Scene::free_memory(bool final)
 	foreach(ParticleSystem *p, particle_systems)
 		delete p;
 
+	shaders.clear();
+	meshes.clear();
+	objects.clear();
+	lights.clear();
+	particle_systems.clear();
+
 	if(device) {
 		camera->device_free(device, &dscene);
 		filter->device_free(device, &dscene);
@@ -100,7 +106,7 @@ void Scene::free_memory(bool final)
 		particle_system_manager->device_free(device, &dscene);
 		curve_system_manager->device_free(device, &dscene);
 
-		if(!params.persistent_images || final)
+		if(!params.persistent_data || final)
 			image_manager->device_free(device, &dscene);
 	}
 
@@ -118,13 +124,6 @@ void Scene::free_memory(bool final)
 		delete curve_system_manager;
 		delete image_manager;
 	}
-	else {
-		shaders.clear();
-		meshes.clear();
-		objects.clear();
-		lights.clear();
-		particle_systems.clear();
-	}
 }
 
 void Scene::device_update(Device *device_, Progress& progress)
@@ -257,6 +256,7 @@ bool Scene::need_reset()
 
 void Scene::reset()
 {
+	shader_manager->reset(this);
 	shader_manager->add_default(this);
 
 	/* ensure all objects are updated */
diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h
index f6e1dae..fc6b538 100644
--- a/intern/cycles/render/scene.h
+++ b/intern/cycles/render/scene.h
@@ -125,7 +125,7 @@ public:
 	bool use_bvh_cache;
 	bool use_bvh_spatial_split;
 	bool use_qbvh;
-	bool persistent_images;
+	bool persistent_data;
 
 	SceneParams()
 	{
@@ -146,7 +146,7 @@ public:
 		&& use_bvh_cache == params.use_bvh_cache
 		&& use_bvh_spatial_split == params.use_bvh_spatial_split
 		&& use_qbvh == params.use_qbvh
-		&& persistent_images == params.persistent_images); }
+		&& persistent_data == params.persistent_data); }
 };
 
 /* Scene */
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index e49a4a3..6ed1445 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -132,6 +132,8 @@ bool Session::ready_to_reset()
 
 void Session::reset_gpu(BufferParams& buffer_params, int samples)
 {
+	thread_scoped_lock pause_lock(pause_mutex);
+
 	/* block for buffer acces and reset immediately. we can't do this
 	 * in the thread, because we need to allocate an OpenGL buffer, and
 	 * that only works in the main thread */
@@ -208,7 +210,12 @@ void Session::run_gpu()
 			 * wait for pause condition notify to wake up again */
 			thread_scoped_lock pause_lock(pause_mutex);
 
-			if(pause || no_tiles) {
+			if(!pause && !tile_manager.done()) {
+				/* reset could have happened after no_tiles was set, before this lock.
+				 * in this case we shall not wait for pause condition
+				 */
+			}
+			else if(pause || no_tiles) {
 				update_status_time(pause, no_tiles);
 
 				while(1) {
@@ -295,6 +302,7 @@ void Session::run_gpu()
 void Session::reset_cpu(BufferParams& buffer_params, int samples)
 {
 	thread_scoped_lock reset_lock(delayed_reset.mutex);
+	thread_scoped_lock pause_lock(pause_mutex);
 
 	display_outdated = true;
 	reset_time = time_dt();
@@ -381,7 +389,7 @@ bool Session::acquire_tile(Device *tile_device, RenderTile& rtile)
 
 	buffer_params.get_offset_stride(rtile.offset, rtile.stride);
 
-	RenderBuffers *tilebuffers = new RenderBuffers(tile_device);
+	RenderBuffers *tilebuffers;
 
 	/* allocate buffers */
 	if(params.progressive_refine) {
@@ -484,7 +492,16 @@ void Session::run_cpu()
 			 * wait for pause condition notify to wake up again */
 			thread_scoped_lock pause_lock(pause_mutex);
 
-			if(pause || no_tiles) {
+			if(!pause && delayed_reset.do_reset) {
+				/* reset once to start */
+				thread_scoped_lock reset_lock(delayed_reset.mutex);
+				thread_scoped_lock buffers_lock(buffers_mutex);
+				thread_scoped_lock display_lock(display_mutex);
+
+				reset_(delayed_reset.params, delayed_reset.samples);
+				delayed_reset.do_reset = false;
+			}
+			else if(pause || no_tiles) {
 				update_status_time(pause, no_tiles);
 
 				while(1) {
@@ -552,7 +569,7 @@ void Session::run_cpu()
 			}
 			else if(need_tonemap) {
 				/* tonemap only if we do not reset, we don't we don't
-				 * wan't to show the result of an incomplete sample*/
+				 * want to show the result of an incomplete sample*/
 				tonemap();
 			}
 
diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h
index d442100..b38e098 100644
--- a/intern/cycles/render/shader.h
+++ b/intern/cycles/render/shader.h
@@ -110,6 +110,8 @@ public:
 	static ShaderManager *create(Scene *scene, int shadingsystem);
 	virtual ~ShaderManager();
 
+	virtual void reset(Scene *scene) = 0;
+
 	virtual bool use_osl() { return false; }
 
 	/* device update */
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index f7cb8f6..5cb11a4 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -40,6 +40,10 @@ SVMShaderManager::~SVMShaderManager()
 {
 }
 
+void SVMShaderManager::reset(Scene *scene)
+{
+}
+
 void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)
 {
 	if(!need_update)
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index 0b15c5a..c1ce619 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -45,6 +45,8 @@ public:
 	SVMShaderManager();
 	~SVMShaderManager();
 
+	void reset(Scene *scene);
+
 	void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress);
 	void device_free(Device *device, DeviceScene *dscene);
 };
diff --git a/intern/cycles/util/util_boundbox.h b/intern/cycles/util/util_boundbox.h
index 0c857f9..7564c1f 100644
--- a/intern/cycles/util/util_boundbox.h
+++ b/intern/cycles/util/util_boundbox.h
@@ -61,15 +61,17 @@ public:
 
 	__forceinline void grow(const float3& pt)  
 	{
-		min = ccl::min(min, pt);
-		max = ccl::max(max, pt);
+		/* the order of arguments to min is such that if pt is nan, it will not
+		 * influence the resulting bounding box */
+		min = ccl::min(pt, min);
+		max = ccl::max(pt, max);
 	}
 
 	__forceinline void grow(const float3& pt, float border)  
 	{
 		float3 shift = {border, border, border, 0.0f};
-		min = ccl::min(min, pt - shift);
-		max = ccl::max(max, pt + shift);
+		min = ccl::min(pt - shift, min);
+		max = ccl::max(pt + shift, max);
 	}
 
 	__forceinline void grow(const BoundBox& bbox)
diff --git a/intern/cycles/util/util_cache.h b/intern/cycles/util/util_cache.h
index e8f111a..deff05f 100644
--- a/intern/cycles/util/util_cache.h
+++ b/intern/cycles/util/util_cache.h
@@ -72,7 +72,7 @@ public:
 		buffers.push_back(buffer);
 	}
 
-	void add(void *data, size_t size)
+	void add(const void *data, size_t size)
 	{
 		if(size) {
 			CacheBuffer buffer(data, size);
@@ -80,19 +80,19 @@ public:
 		}
 	}
 
-	void add(int& data)
+	void add(const int& data)
 	{
 		CacheBuffer buffer(&data, sizeof(int));
 		buffers.push_back(buffer);
 	}
 
-	void add(float& data)
+	void add(const float& data)
 	{
 		CacheBuffer buffer(&data, sizeof(float));
 		buffers.push_back(buffer);
 	}
 
-	void add(size_t& data)
+	void add(const size_t& data)
 	{
 		CacheBuffer buffer(&data, sizeof(size_t));
 		buffers.push_back(buffer);
diff --git a/intern/cycles/util/util_cuda.cpp b/intern/cycles/util/util_cuda.cpp
index 12cb0d3..6c9ee7c 100644
--- a/intern/cycles/util/util_cuda.cpp
+++ b/intern/cycles/util/util_cuda.cpp
@@ -376,21 +376,23 @@ bool cuLibraryInit()
 	/* cuda 4.0 */
 	CUDA_LIBRARY_FIND(cuCtxSetCurrent);
 
-#ifndef WITH_CUDA_BINARIES
-#ifdef _WIN32
-	return false; /* runtime build doesn't work at the moment */
-#else
-	if(cuCompilerPath() == "")
-		return false;
-#endif
+	if(cuHavePrecompiledKernels())
+		result = true;
+#ifndef _WIN32
+	else if(cuCompilerPath() != "")
+		result = true;
 #endif
 
-	/* success */
-	result = true;
-
 	return result;
 }
 
+bool cuHavePrecompiledKernels()
+{
+	string cubins_path = path_get("lib");
+
+	return path_exists(cubins_path);
+}
+
 string cuCompilerPath()
 {
 #ifdef _WIN32
diff --git a/intern/cycles/util/util_cuda.h b/intern/cycles/util/util_cuda.h
index 9682f1c..69cf025 100644
--- a/intern/cycles/util/util_cuda.h
+++ b/intern/cycles/util/util_cuda.h
@@ -30,6 +30,7 @@ CCL_NAMESPACE_BEGIN
  * matrixMulDynlinkJIT in the CUDA SDK. */
 
 bool cuLibraryInit();
+bool cuHavePrecompiledKernels();
 string cuCompilerPath();
 
 CCL_NAMESPACE_END
diff --git a/intern/cycles/util/util_dynlib.cpp b/intern/cycles/util/util_dynlib.cpp
index 5836073..3eaa16a 100644
--- a/intern/cycles/util/util_dynlib.cpp
+++ b/intern/cycles/util/util_dynlib.cpp
@@ -22,7 +22,7 @@
 
 #ifdef _WIN32
 
-#include <Windows.h>
+#include <windows.h>
 
 CCL_NAMESPACE_BEGIN
 
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index 2d9f0ff..4fda090 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -136,7 +136,7 @@ struct CPUCapabilities {
 	bool fma4;
 };
 
-bool system_cpu_support_optimized()
+static CPUCapabilities& system_cpu_capabilities()
 {
 	static CPUCapabilities caps;
 	static bool caps_init = false;
@@ -182,7 +182,18 @@ bool system_cpu_support_optimized()
 		caps_init = true;
 	}
 
-	/* optimization flags use these */
+	return caps;
+}
+
+bool system_cpu_support_sse2()
+{
+	CPUCapabilities& caps = system_cpu_capabilities();
+	return caps.sse && caps.sse2;
+}
+
+bool system_cpu_support_sse3()
+{
+	CPUCapabilities& caps = system_cpu_capabilities();
 	return caps.sse && caps.sse2 && caps.sse3;
 }
 
diff --git a/intern/cycles/util/util_system.h b/intern/cycles/util/util_system.h
index f25e009..2571128 100644
--- a/intern/cycles/util/util_system.h
+++ b/intern/cycles/util/util_system.h
@@ -26,7 +26,8 @@ CCL_NAMESPACE_BEGIN
 int system_cpu_thread_count();
 string system_cpu_brand_string();
 int system_cpu_bits();
-bool system_cpu_support_optimized();
+bool system_cpu_support_sse2();
+bool system_cpu_support_sse3();
 
 CCL_NAMESPACE_END
 
diff --git a/intern/cycles/util/util_task.cpp b/intern/cycles/util/util_task.cpp
index 8c4ec31..43f15ba 100644
--- a/intern/cycles/util/util_task.cpp
+++ b/intern/cycles/util/util_task.cpp
@@ -152,7 +152,6 @@ void TaskPool::num_increase()
 thread_mutex TaskScheduler::mutex;
 int TaskScheduler::users = 0;
 vector<thread*> TaskScheduler::threads;
-vector<int> TaskScheduler::thread_level;
 volatile bool TaskScheduler::do_exit = false;
 
 list<TaskScheduler::Entry> TaskScheduler::queue;
@@ -179,12 +178,9 @@ void TaskScheduler::init(int num_threads)
 
 		/* launch threads that will be waiting for work */
 		threads.resize(num_threads);
-		thread_level.resize(num_threads);
 
-		for(size_t i = 0; i < threads.size(); i++) {
+		for(size_t i = 0; i < threads.size(); i++)
 			threads[i] = new thread(function_bind(&TaskScheduler::thread_run, i));
-			thread_level[i] = 0;
-		}
 	}
 	
 	users++;
@@ -208,7 +204,6 @@ void TaskScheduler::exit()
 		}
 
 		threads.clear();
-		thread_level.clear();
 	}
 }
 
diff --git a/intern/cycles/util/util_task.h b/intern/cycles/util/util_task.h
index b795ca7..5bca3f2 100644
--- a/intern/cycles/util/util_task.h
+++ b/intern/cycles/util/util_task.h
@@ -111,7 +111,6 @@ protected:
 	static thread_mutex mutex;
 	static int users;
 	static vector<thread*> threads;
-	static vector<int> thread_level;
 	static volatile bool do_exit;
 
 	static list<Entry> queue;
diff --git a/intern/dualcon/intern/MemoryAllocator.h b/intern/dualcon/intern/MemoryAllocator.h
index b704542..e673d94 100644
--- a/intern/dualcon/intern/MemoryAllocator.h
+++ b/intern/dualcon/intern/MemoryAllocator.h
@@ -43,6 +43,8 @@
 class VirtualMemoryAllocator
 {
 public:
+virtual ~VirtualMemoryAllocator() {}
+
 virtual void *allocate( ) = 0;
 virtual void deallocate(void *obj) = 0;
 virtual void destroy( ) = 0;
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index 5492a7b..c07dc86 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -74,7 +74,9 @@
 
 #if ((LIBAVUTIL_VERSION_MAJOR > 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && (LIBAVUTIL_VERSION_MINOR >= 32))
 #define FFMPEG_FFV1_ALPHA_SUPPORTED
-#else
+#endif
+
+#if ((LIBAVUTIL_VERSION_MAJOR < 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && (LIBAVUTIL_VERSION_MINOR < 22))
 static inline
 int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
 {
@@ -111,7 +113,7 @@ int av_opt_set_double(void *obj, const char *name, double val, int search_flags)
 #define avformat_close_input(x) av_close_input_file(*(x))
 #endif
 
-#if ((LIBAVCODEC_VERSION_MAJOR < 53) || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR < 42))
+#if ((LIBAVCODEC_VERSION_MAJOR < 53) || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR < 35))
 static inline
 int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)
 {
@@ -120,7 +122,7 @@ int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)
 }
 #endif
 
-#if ((LIBAVFORMAT_VERSION_MAJOR < 53) || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVFORMAT_VERSION_MINOR < 24))
+#if ((LIBAVFORMAT_VERSION_MAJOR < 53) || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVFORMAT_VERSION_MINOR < 21))
 static inline
 AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)
 {
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index ea09987..12dd4c0 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -271,6 +271,9 @@ elseif(UNIX)
 
 	if(WITH_X11_XINPUT)
 		add_definitions(-DWITH_X11_XINPUT)
+		list(APPEND INC_SYS
+			${X11_Xinput_INCLUDE_PATH}
+		)
 	endif()
 
 elseif(WIN32)
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index ab5feb2..a92d0d3 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -149,6 +149,20 @@ extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
                                            GHOST_TUns32 *height);
 
 /**
+ * Returns the dimensions of all displays combine
+ * (the current workspace).
+ * No need to worrky about overlapping monitors.
+ * \param systemhandle The handle to the system
+ * \param width A pointer the width gets put in
+ * \param height A pointer the height gets put in
+ * \return void.
+ */
+extern void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
+                                           GHOST_TUns32 *width,
+                                           GHOST_TUns32 *height);
+
+
+/**
  * Create a new window.
  * The new window is added to the list of windows managed. 
  * Never explicitly delete the window, use disposeWindow() instead.
@@ -860,7 +874,7 @@ extern int GHOST_UseNativePixels(void);
 /**
  * If window was opened using native pixel size, it returns scaling factor.
  */
-extern float GHOST_GetNativePixelSize(void);
+extern float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle);
 
 
 #ifdef __cplusplus
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index dfe0152..841293e 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -227,6 +227,12 @@ public:
 	virtual void getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const = 0;
 
 	/**
+	 * Returns the combine dimensions of all monitors.
+	 * \return The dimension of the workspace.
+	 */
+	virtual void getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const = 0;
+
+	/**
 	 * Create a new window.
 	 * The new window is added to the list of windows managed.
 	 * Never explicitly delete the window, use disposeWindow() instead.
@@ -297,10 +303,8 @@ public:
 	
 	/**
 	 * Native pixel size support (MacBook 'retina').
-	 * \return The pixel size in float.
 	 */
 	virtual bool useNativePixel(void) = 0;
-	virtual float getNativePixelSize(void) = 0;
 
 	/***************************************************************************************
 	 * Event management functionality
diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h
index 88f130a..4cf0dbf 100644
--- a/intern/ghost/GHOST_IWindow.h
+++ b/intern/ghost/GHOST_IWindow.h
@@ -305,6 +305,10 @@ public:
 	 */
 	virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds, GHOST_TInt32 mouse_ungrab_xy[2]) { return GHOST_kSuccess; }
 
+	
+	virtual float getNativePixelSize(void) = 0;
+
+	
 #ifdef WITH_CXX_GUARDEDALLOC
 	MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_IWindow")
 #endif
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 868d787..35dff73 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -183,6 +183,7 @@ typedef enum {
 	GHOST_kEventDraggingDropDone,
 	
 	GHOST_kEventOpenMainFile, // Needed for Cocoa to open double-clicked .blend file at startup
+	GHOST_kEventNativeResolutionChange, // Needed for Cocoa when window moves to other display
 
 	GHOST_kEventTimer,
 
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index ba0a6eb..7622a2a 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -123,7 +123,14 @@ void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
 	system->getMainDisplayDimensions(*width, *height);
 }
 
+void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
+                                    GHOST_TUns32 *width,
+                                    GHOST_TUns32 *height)
+{
+	GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
 
+	system->getAllDisplayDimensions(*width, *height);
+}
 
 GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
                                       const char *title,
@@ -885,9 +892,11 @@ int GHOST_UseNativePixels(void)
 	return system->useNativePixel();
 }
 
-float GHOST_GetNativePixelSize(void)
+float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
 {
-	GHOST_ISystem *system = GHOST_ISystem::getSystem();
-	return system->getNativePixelSize();
+	GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
+	if (window)
+		return window->getNativePixelSize();
+	return 1.0f;
 }
 
diff --git a/intern/ghost/intern/GHOST_Debug.h b/intern/ghost/intern/GHOST_Debug.h
index f0db1b3..9292235 100644
--- a/intern/ghost/intern/GHOST_Debug.h
+++ b/intern/ghost/intern/GHOST_Debug.h
@@ -58,12 +58,23 @@
 #  define GHOST_PRINTF(x, ...)
 #endif // GHOST_DEBUG
 
-
-#ifdef GHOST_DEBUG
+#ifdef WITH_ASSERT_ABORT
+#  include <stdio.h>  //for fprintf()
+#  include <stdlib.h> //for abort()
+#  define GHOST_ASSERT(x, info)                                               \
+	{                                                                         \
+		if (!(x)) {                                                           \
+			fprintf(stderr, "GHOST_ASSERT failed: ");                         \
+			fprintf(stderr, info);                                            \
+			fprintf(stderr, "\n");                                            \
+			abort();                                                          \
+		}                                                                     \
+	} (void)0
+#elif defined(GHOST_DEBUG)
 #  define GHOST_ASSERT(x, info)                                               \
 	{                                                                         \
 	    if (!(x)) {                                                           \
-	        GHOST_PRINT("assertion failed: ");                                \
+	        GHOST_PRINT("GHOST_ASSERT failed: ");                             \
 	        GHOST_PRINT(info);                                                \
 	        GHOST_PRINT("\n");                                                \
 	    }                                                                     \
diff --git a/intern/ghost/intern/GHOST_DisplayManagerCarbon.cpp b/intern/ghost/intern/GHOST_DisplayManagerCarbon.cpp
index 3f7d210..25e9123 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerCarbon.cpp
+++ b/intern/ghost/intern/GHOST_DisplayManagerCarbon.cpp
@@ -150,7 +150,7 @@ GHOST_TSuccess GHOST_DisplayManagerCarbon::setCurrentDisplaySetting(GHOST_TUns8
 #endif // GHOST_DEBUG
 
 	CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues);
-        
+
 	return err == CGDisplayNoErr ? GHOST_kSuccess : GHOST_kFailure;
 }
 
@@ -158,19 +158,18 @@ GHOST_TSuccess GHOST_DisplayManagerCarbon::setCurrentDisplaySetting(GHOST_TUns8
 long GHOST_DisplayManagerCarbon::getValue(CFDictionaryRef values, CFStringRef key) const
 {
 	CFNumberRef numberValue = (CFNumberRef) CFDictionaryGetValue(values, key);
-    
+
 	if (!numberValue)
 	{
 		return -1;
 	}
-    
+
 	long intValue;
-    
+
 	if (!CFNumberGetValue(numberValue, kCFNumberLongType, &intValue))
 	{
 		return -1;
 	}
-    
+
 	return intValue;
 }
-
diff --git a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
index 83df997..0bfc67a 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
+++ b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
@@ -52,11 +52,15 @@ GHOST_DisplayManagerWin32::GHOST_DisplayManagerWin32(void)
 
 GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplays(GHOST_TUns8& numDisplays) const
 {
-	// We do not support multiple monitors at the moment
 	numDisplays = ::GetSystemMetrics(SM_CMONITORS);
 	return numDisplays > 0 ? GHOST_kSuccess : GHOST_kFailure;
 }
 
+static BOOL get_dd(DWORD d, DISPLAY_DEVICE* dd)
+{
+	dd->cb = sizeof(DISPLAY_DEVICE);
+	return ::EnumDisplayDevices(NULL, d, dd, 0);
+}
 
 /*
  * When you call EnumDisplaySettings with iModeNum set to zero, the operating system 
@@ -67,10 +71,12 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplays(GHOST_TUns8& numDisplay
  */
 GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32& numSettings) const
 {
-	GHOST_ASSERT((display == kMainDisplay), "GHOST_DisplayManagerWin32::getNumDisplaySettings(): only main displlay is supported");
+	DISPLAY_DEVICE display_device;
+	if (!get_dd(display, &display_device)) return GHOST_kFailure;
+
 	numSettings = 0;
 	DEVMODE dm;
-	while (::EnumDisplaySettings(NULL, numSettings, &dm)) {
+	while (::EnumDisplaySettings(display_device.DeviceName, numSettings, &dm)) {
 		numSettings++;
 	}
 	return GHOST_kSuccess;
@@ -79,10 +85,12 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplaySettings(GHOST_TUns8 disp
 
 GHOST_TSuccess GHOST_DisplayManagerWin32::getDisplaySetting(GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting) const
 {
-	GHOST_ASSERT((display == kMainDisplay), "GHOST_DisplayManagerWin32::getDisplaySetting(): only main display is supported");
+	DISPLAY_DEVICE display_device;
+	if (!get_dd(display, &display_device)) return GHOST_kFailure;
+
 	GHOST_TSuccess success;
 	DEVMODE dm;
-	if (::EnumDisplaySettings(NULL, index, &dm)) {
+	if (::EnumDisplaySettings(display_device.DeviceName, index, &dm)) {
 #ifdef GHOST_DEBUG
 		printf("display mode: width=%d, height=%d, bpp=%d, frequency=%d\n", dm.dmPelsWidth, dm.dmPelsHeight, dm.dmBitsPerPel, dm.dmDisplayFrequency);
 #endif // GHOST_DEBUG
@@ -112,23 +120,23 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::getDisplaySetting(GHOST_TUns8 display,
 
 GHOST_TSuccess GHOST_DisplayManagerWin32::getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_DisplaySetting& setting) const
 {
-	GHOST_ASSERT((display == kMainDisplay), "GHOST_DisplayManagerWin32::getCurrentDisplaySetting(): only main display is supported");
-	return getDisplaySetting(kMainDisplay, ENUM_CURRENT_SETTINGS, setting);
+	return getDisplaySetting(display, ENUM_CURRENT_SETTINGS, setting);
 }
 
 
 GHOST_TSuccess GHOST_DisplayManagerWin32::setCurrentDisplaySetting(GHOST_TUns8 display, const GHOST_DisplaySetting& setting)
 {
-	GHOST_ASSERT((display == kMainDisplay), "GHOST_DisplayManagerWin32::setCurrentDisplaySetting(): only main display is supported");
+	DISPLAY_DEVICE display_device;
+	if (!get_dd(display, &display_device)) return GHOST_kFailure;
 
 	GHOST_DisplaySetting match;
 	findMatch(display, setting, match);
 	DEVMODE dm;
 	int i = 0;
-	while (::EnumDisplaySettings(NULL, i++, &dm)) {
-		if ((dm.dmBitsPerPel == match.bpp) &&
-		    (dm.dmPelsWidth == match.xPixels) &&
-		    (dm.dmPelsHeight == match.yPixels) &&
+	while (::EnumDisplaySettings(display_device.DeviceName, i++, &dm)) {
+		if ((dm.dmBitsPerPel       == match.bpp    ) &&
+		    (dm.dmPelsWidth        == match.xPixels) &&
+		    (dm.dmPelsHeight       == match.yPixels) &&
 		    (dm.dmDisplayFrequency == match.frequency))
 		{
 			break;
diff --git a/intern/ghost/intern/GHOST_DropTargetWin32.cpp b/intern/ghost/intern/GHOST_DropTargetWin32.cpp
index 89e9a91..5288b77 100644
--- a/intern/ghost/intern/GHOST_DropTargetWin32.cpp
+++ b/intern/ghost/intern/GHOST_DropTargetWin32.cpp
@@ -32,7 +32,7 @@
  
 #include "GHOST_Debug.h"
 #include "GHOST_DropTargetWin32.h"
-#include <ShellApi.h>
+#include <shellapi.h>
 
 #include "utf_winfunc.h"
 #include "utfconv.h"
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index 41beeac..080619b 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -46,7 +46,6 @@
 
 GHOST_System::GHOST_System()
 	: m_nativePixel(false),
-	m_nativePixelSize(1),
 	m_displayManager(0),
 	m_timerManager(0),
 	m_windowManager(0),
@@ -382,9 +381,3 @@ bool GHOST_System::useNativePixel(void)
 	return 1;
 }
 
-float GHOST_System::getNativePixelSize(void)
-{
-	if (m_nativePixel)
-		return m_nativePixelSize;
-	return 1.0f;
-}
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index 5060f22..928bbe6 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -175,9 +175,6 @@ public:
 	virtual bool useNativePixel(void);
 	bool m_nativePixel;
 
-	virtual float getNativePixelSize(void);
-	float m_nativePixelSize;
-
 	/***************************************************************************************
 	 * Event management functionality
 	 ***************************************************************************************/
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp
index f5784c7..bb6b1bf 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp
@@ -396,6 +396,11 @@ void GHOST_SystemCarbon::getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUn
 	height = bnds.bottom - bnds.top;
 }
 
+void GHOST_SystemCarbon::getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const
+{
+	/* TODO */
+	getMainDisplayDimensions(width, height);
+}
 
 GHOST_IWindow *GHOST_SystemCarbon::createWindow(
 		const STR_String& title,
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.h b/intern/ghost/intern/GHOST_SystemCarbon.h
index 61e5a08..b6821bc 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.h
+++ b/intern/ghost/intern/GHOST_SystemCarbon.h
@@ -91,6 +91,12 @@ public:
 	 * \return The dimension of the main display.
 	 */
 	virtual void getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const;
+
+	/**
+	 * Returns the combine dimensions of all monitors.
+	 * \return The dimension of the workspace.
+	 */
+	virtual void getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const;
 	
 	/**
 	 * Create a new window.
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index a1b372d..257aeb5 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -89,6 +89,11 @@ public:
 	 */
 	virtual void getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const;
 	
+	/** Returns the combine dimensions of all monitors.
+	 * \return The dimension of the workspace.
+	 */
+	virtual void getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const;
+
 	/**
 	 * Create a new window.
 	 * The new window is added to the list of windows managed.
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index ac3e223..6cf4ada 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -719,6 +719,11 @@ void GHOST_SystemCocoa::getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns
 	[pool drain];
 }
 
+void GHOST_SystemCocoa::getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const
+{
+	/* TODO! */
+	getMainDisplayDimensions(width, height);
+}
 
 GHOST_IWindow* GHOST_SystemCocoa::createWindow(
 	const STR_String& title, 
@@ -1023,8 +1028,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
 	if (!validWindow(window)) {
 		return GHOST_kFailure;
 	}
-		switch(eventType) 
-		{
+		switch (eventType) {
 			case GHOST_kEventWindowClose:
 				pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window) );
 				break;
@@ -1038,6 +1042,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
 				pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowDeactivate, window) );
 				break;
 			case GHOST_kEventWindowUpdate:
+				if (m_nativePixel) {
+					window->setNativePixelSize();
+					pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventNativeResolutionChange, window) );
+				}
 				pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowUpdate, window) );
 				break;
 			case GHOST_kEventWindowMove:
@@ -1054,6 +1062,13 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
 					//m_ignoreWindowSizedMessages = true;
 				}
 				break;
+			case GHOST_kEventNativeResolutionChange:
+				
+				if (m_nativePixel) {
+					window->setNativePixelSize();
+					pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventNativeResolutionChange, window) );
+				}
+
 			default:
 				return GHOST_kFailure;
 				break;
@@ -1070,8 +1085,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
 	if (!validWindow(window)) {
 		return GHOST_kFailure;
 	}
-	switch(eventType) 
-	{
+	switch (eventType) {
 		case GHOST_kEventDraggingEntered:
 		case GHOST_kEventDraggingUpdated:
 		case GHOST_kEventDraggingExited:
@@ -1592,7 +1606,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
 			}
 			break;
 			
-			/* these events only happen on swiping trackpads */
+			/* these events only happen on swiping trackpads or tablets */
+			/* warning: using tablet + trackpad at same time frustrates this static variable */
 		case NSEventTypeBeginGesture:
 			m_hasMultiTouchTrackpad = 1;
 			break;
@@ -1626,9 +1641,17 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
 					double dy;
 					
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+					int phase = [event phase];
+					
 					/* with 10.7 nice scrolling deltas are supported */
 					dx = [event scrollingDeltaX];
 					dy = [event scrollingDeltaY];
+					
+					/* however, wacom tablet (intuos5) needs old deltas, it then has momentum and phase at zero */
+					if (phase == 0 && momentum==NULL) {
+						dx = [event deltaX];
+						dy = [event deltaY];
+					}
 
 #else
 					/* trying to pretend you have nice scrolls... */
diff --git a/intern/ghost/intern/GHOST_SystemNULL.h b/intern/ghost/intern/GHOST_SystemNULL.h
index 63e3b5b..7021dea 100644
--- a/intern/ghost/intern/GHOST_SystemNULL.h
+++ b/intern/ghost/intern/GHOST_SystemNULL.h
@@ -38,7 +38,7 @@ class GHOST_WindowNULL;
 class GHOST_SystemNULL : public GHOST_System {
 public:
 
-	GHOST_SystemNULL( ) : GHOST_System() { /* nop */ }
+	GHOST_SystemNULL() : GHOST_System() { /* nop */ }
 	~GHOST_SystemNULL() { /* nop */ }
 	bool processEvents(bool waitForEvent) { return false; }
 	int toggleConsole(int action) { return 0; }
@@ -46,11 +46,12 @@ public:
 	GHOST_TSuccess getButtons(GHOST_Buttons& buttons) const { return GHOST_kSuccess; }
 	GHOST_TUns8 *getClipboard(bool selection) const { return NULL; }
 	void putClipboard(GHOST_TInt8 *buffer, bool selection) const { /* nop */ }
-	GHOST_TUns64 getMilliSeconds( ) const { return 0; }
-	GHOST_TUns8 getNumDisplays( ) const { return GHOST_TUns8(1); }
-	GHOST_TSuccess getCursorPosition( GHOST_TInt32& x, GHOST_TInt32& y ) const { return GHOST_kFailure; }
-	GHOST_TSuccess setCursorPosition( GHOST_TInt32 x, GHOST_TInt32 y ) { return GHOST_kFailure; }
-	void getMainDisplayDimensions( GHOST_TUns32& width, GHOST_TUns32& height ) const { /* nop */ }
+	GHOST_TUns64 getMilliSeconds() const { return 0; }
+	GHOST_TUns8 getNumDisplays() const { return GHOST_TUns8(1); }
+	GHOST_TSuccess getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const { return GHOST_kFailure; }
+	GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) { return GHOST_kFailure; }
+	void getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const { /* nop */ }
+	void getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const { /* nop */ }
 
 	GHOST_TSuccess init() {
 		GHOST_TSuccess success = GHOST_System::init();
@@ -82,11 +83,4 @@ public:
 	}
 };
 
-#endif
-
-
-
-
-
-
-
+#endif  /* __GHOST_SYSTEMNULL_H__ */
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index fdc4f33..da1836d 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -114,6 +114,20 @@ GHOST_SystemSDL::init() {
 	return GHOST_kFailure;
 }
 
+/**
+ * Returns the dimensions of the main display on this system.
+ * \return The dimension of the main display.
+ */
+void
+GHOST_SystemSDL::getAllDisplayDimensions(GHOST_TUns32& width,
+                                         GHOST_TUns32& height) const
+{
+	SDL_DisplayMode mode;
+	SDL_GetDesktopDisplayMode(0, &mode); /* note, always 0 display */
+	width = mode.w;
+	height = mode.h;
+}
+
 void
 GHOST_SystemSDL::getMainDisplayDimensions(GHOST_TUns32& width,
                                           GHOST_TUns32& height) const
diff --git a/intern/ghost/intern/GHOST_SystemSDL.h b/intern/ghost/intern/GHOST_SystemSDL.h
index 43c9129..776dc2f 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.h
+++ b/intern/ghost/intern/GHOST_SystemSDL.h
@@ -88,6 +88,10 @@ public:
 	                  GHOST_TInt32 y);
 
 	void
+	getAllDisplayDimensions(GHOST_TUns32& width,
+	                        GHOST_TUns32& height) const;
+
+	void
 	getMainDisplayDimensions(GHOST_TUns32& width,
 	                         GHOST_TUns32& height) const;
 
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 75d606a..138109c 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -215,6 +215,11 @@ void GHOST_SystemWin32::getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns
 	height = ::GetSystemMetrics(SM_CYSCREEN);
 }
 
+void GHOST_SystemWin32::getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const
+{
+	width = ::GetSystemMetrics(SM_XVIRTUALSCREEN);
+	height = ::GetSystemMetrics(SM_YVIRTUALSCREEN);
+}
 
 GHOST_IWindow *GHOST_SystemWin32::createWindow(
 		const STR_String& title,
@@ -783,8 +788,8 @@ GHOST_TSuccess GHOST_SystemWin32::pushDragDropEvent(GHOST_TEventType eventType,
 
 void GHOST_SystemWin32::processMinMaxInfo(MINMAXINFO *minmax)
 {
-	minmax->ptMinTrackSize.x = 640;
-	minmax->ptMinTrackSize.y = 480;
+	minmax->ptMinTrackSize.x = 320;
+	minmax->ptMinTrackSize.y = 240;
 }
 
 #ifdef WITH_INPUT_NDOF
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h
index 6a756d3..e47dbda 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -100,7 +100,13 @@ public:
 	 * \return The dimension of the main display.
 	 */
 	virtual void getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const;
-	
+
+	/**
+	 * Returns the dimensions of all displays on this system.
+	 * \return The dimension of the main display.
+	 */
+	virtual void getAllDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const;
+
 	/**
 	 * Create a new window.
 	 * The new window is added to the list of windows managed. 
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index f5cb0d9..48fb837 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -69,8 +69,13 @@
 #include <stdio.h> /* for fprintf only */
 #include <cstdlib> /* for exit */
 
-static GHOST_TKey
-convertXKey(KeySym key);
+/* for debugging - so we can breakpoint X11 errors */
+// #define USE_X11_ERROR_HANDLERS
+
+/* see [#34039] Fix Alt key glitch on Unity desktop */
+#define USE_UNITY_WORKAROUND
+
+static GHOST_TKey convertXKey(KeySym key);
 
 /* these are for copy and select copy */
 static char *txt_cut_buffer = NULL;
@@ -91,6 +96,11 @@ GHOST_SystemX11(
 		abort(); /* was return before, but this would just mean it will crash later */
 	}
 
+#ifdef USE_X11_ERROR_HANDLERS
+	(void) XSetErrorHandler(GHOST_X11_ApplicationErrorHandler);
+	(void) XSetIOErrorHandler(GHOST_X11_ApplicationIOErrorHandler);
+#endif
+
 #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
 	/* note -- don't open connection to XIM server here, because the locale
 	 * has to be set before opening the connection but setlocale() has not
@@ -99,32 +109,37 @@ GHOST_SystemX11(
 	m_xim = NULL;
 #endif
 
-	m_delete_window_atom 
-	    = XInternAtom(m_display, "WM_DELETE_WINDOW", True);
-
-	m_wm_protocols = XInternAtom(m_display, "WM_PROTOCOLS", False);
-	m_wm_take_focus = XInternAtom(m_display, "WM_TAKE_FOCUS", False);
-	m_wm_state = XInternAtom(m_display, "WM_STATE", False);
-	m_wm_change_state = XInternAtom(m_display, "WM_CHANGE_STATE", False);
-	m_net_state = XInternAtom(m_display, "_NET_WM_STATE", False);
-	m_net_max_horz = XInternAtom(m_display,
-	                             "_NET_WM_STATE_MAXIMIZED_HORZ", False);
-	m_net_max_vert = XInternAtom(m_display,
-	                             "_NET_WM_STATE_MAXIMIZED_VERT", False);
-	m_net_fullscreen = XInternAtom(m_display,
-	                               "_NET_WM_STATE_FULLSCREEN", False);
-	m_motif = XInternAtom(m_display, "_MOTIF_WM_HINTS", False);
-	m_targets = XInternAtom(m_display, "TARGETS", False);
-	m_string = XInternAtom(m_display, "STRING", False);
-	m_compound_text = XInternAtom(m_display, "COMPOUND_TEXT", False);
-	m_text = XInternAtom(m_display, "TEXT", False);
-	m_clipboard = XInternAtom(m_display, "CLIPBOARD", False);
-	m_primary = XInternAtom(m_display, "PRIMARY", False);
-	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;
+#define GHOST_INTERN_ATOM_IF_EXISTS(atom) { m_atom.atom = XInternAtom(m_display, #atom , True);  } (void)0
+#define GHOST_INTERN_ATOM(atom)           { m_atom.atom = XInternAtom(m_display, #atom , False); } (void)0
+
+	GHOST_INTERN_ATOM_IF_EXISTS(WM_DELETE_WINDOW);
+	GHOST_INTERN_ATOM(WM_PROTOCOLS);
+	GHOST_INTERN_ATOM(WM_TAKE_FOCUS);
+	GHOST_INTERN_ATOM(WM_STATE);
+	GHOST_INTERN_ATOM(WM_CHANGE_STATE);
+	GHOST_INTERN_ATOM(_NET_WM_STATE);
+	GHOST_INTERN_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ);
+	GHOST_INTERN_ATOM(_NET_WM_STATE_MAXIMIZED_VERT);
+
+	GHOST_INTERN_ATOM(_NET_WM_STATE_FULLSCREEN);
+	GHOST_INTERN_ATOM(_MOTIF_WM_HINTS);
+	GHOST_INTERN_ATOM(TARGETS);
+	GHOST_INTERN_ATOM(STRING);
+	GHOST_INTERN_ATOM(COMPOUND_TEXT);
+	GHOST_INTERN_ATOM(TEXT);
+	GHOST_INTERN_ATOM(CLIPBOARD);
+	GHOST_INTERN_ATOM(PRIMARY);
+	GHOST_INTERN_ATOM(XCLIP_OUT);
+	GHOST_INTERN_ATOM(INCR);
+	GHOST_INTERN_ATOM(UTF8_STRING);
+#ifdef WITH_X11_XINPUT
+	m_atom.TABLET = XInternAtom(m_display, XI_TABLET, False);
+#endif
 
+#undef GHOST_INTERN_ATOM_IF_EXISTS
+#undef GHOST_INTERN_ATOM
+
+	m_last_warp = 0;
 
 	/* compute the initial time */
 	timeval tv;
@@ -146,6 +161,12 @@ GHOST_SystemX11(
 		XkbSetDetectableAutoRepeat(m_display, true, NULL);
 	}
 	
+#ifdef WITH_X11_XINPUT
+	/* initialize incase X11 fails to load */
+	memset(&m_xtablet, 0, sizeof(m_xtablet));
+
+	initXInputDevices();
+#endif
 }
 
 GHOST_SystemX11::
@@ -157,6 +178,15 @@ GHOST_SystemX11::
 	}
 #endif
 
+#ifdef WITH_X11_XINPUT
+	/* close tablet devices */
+	if (m_xtablet.StylusDevice)
+		XCloseDevice(m_display, m_xtablet.StylusDevice);
+	
+	if (m_xtablet.EraserDevice)
+		XCloseDevice(m_display, m_xtablet.EraserDevice);
+#endif /* WITH_X11_XINPUT */
+
 	XCloseDisplay(m_display);
 }
 
@@ -212,6 +242,25 @@ getMainDisplayDimensions(
 		GHOST_TUns32& height) const
 {
 	if (m_display) {
+		/* note, for this to work as documented,
+		 * we would need to use Xinerama check r54370 for code that did thia,
+		 * we've since removed since its not worth the extra dep - campbell */
+		getAllDisplayDimensions(width, height);
+	}
+}
+
+
+/**
+ * Returns the dimensions of the main display on this system.
+ * \return The dimension of the main display.
+ */
+void
+GHOST_SystemX11::
+getAllDisplayDimensions(
+		GHOST_TUns32& width,
+		GHOST_TUns32& height) const
+{
+	if (m_display) {
 		width  = DisplayWidth(m_display, DefaultScreen(m_display));
 		height = DisplayHeight(m_display, DefaultScreen(m_display));
 	}
@@ -474,6 +523,54 @@ processEvents(
 
 			processEvent(&xevent);
 			anyProcessed = true;
+
+
+#ifdef USE_UNITY_WORKAROUND
+			/* note: processEvent() can't include this code because
+			 * KeymapNotify event have no valid window information. */
+
+			/* the X server generates KeymapNotify event immediately after
+			 * every EnterNotify and FocusIn event.  we handle this event
+			 * to correct modifier states. */
+			if (xevent.type == FocusIn) {
+				/* use previous event's window, because KeymapNotify event
+				 * has no window information. */
+				GHOST_WindowX11 *window = findGhostWindow(xevent.xany.window);
+				if (window && XPending(m_display) >= 2) {
+					XNextEvent(m_display, &xevent);
+
+					if (xevent.type == KeymapNotify) {
+						XEvent xev_next;
+
+						/* check if KeyPress or KeyRelease event was generated
+						 * in order to confirm the window is active. */
+						XPeekEvent(m_display, &xev_next);
+
+						if (xev_next.type == KeyPress || xev_next.type == KeyRelease) {
+							/* XK_Hyper_L/R currently unused */
+							const static KeySym modifiers[8] = {XK_Shift_L, XK_Shift_R,
+							                                    XK_Control_L, XK_Control_R,
+							                                    XK_Alt_L, XK_Alt_R,
+							                                    XK_Super_L, XK_Super_R};
+
+							for (int i = 0; i < (sizeof(modifiers) / sizeof(*modifiers)); i++) {
+								KeyCode kc = XKeysymToKeycode(m_display, modifiers[i]);
+								if (((xevent.xkeymap.key_vector[kc >> 3] >> (kc & 7)) & 1) != 0) {
+									pushEvent(new GHOST_EventKey(
+									              getMilliSeconds(),
+									              GHOST_kEventKeyDown,
+									              window,
+									              convertXKey(modifiers[i]),
+									              '\0',
+									              NULL));
+								}
+							}
+						}
+					}
+				}
+			}
+#endif  /* USE_UNITY_WORKAROUND */
+
 		}
 		
 		if (generateWindowExposeEvents()) {
@@ -494,12 +591,52 @@ processEvents(
 
 #ifdef WITH_X11_XINPUT
 /* set currently using tablet mode (stylus or eraser) depending on device ID */
-static void setTabletMode(GHOST_WindowX11 *window, XID deviceid)
+static void setTabletMode(GHOST_SystemX11 *system, GHOST_WindowX11 *window, XID deviceid)
+{
+	if (deviceid == system->GetXTablet().StylusID)
+		window->GetTabletData()->Active = GHOST_kTabletModeStylus;
+	else if (deviceid == system->GetXTablet().EraserID)
+		window->GetTabletData()->Active = GHOST_kTabletModeEraser;
+}
+#endif /* WITH_X11_XINPUT */
+
+#ifdef WITH_X11_XINPUT
+static bool checkTabletProximity(Display *display, XDevice *device)
 {
-	if (deviceid == window->GetXTablet().StylusID)
-		window->GetXTablet().CommonData.Active = GHOST_kTabletModeStylus;
-	else if (deviceid == window->GetXTablet().EraserID)
-		window->GetXTablet().CommonData.Active = GHOST_kTabletModeEraser;
+	/* we could have true/false/not-found return value, but for now false is OK */
+
+	/* see: state.c from xinput, to get more data out of the device */
+	XDeviceState *state;
+
+	if (device == NULL) {
+		return false;
+	}
+
+	state = XQueryDeviceState(display, device);
+
+	if (state) {
+		XInputClass *cls = state->data;
+		// printf("%d class%s :\n", state->num_classes,
+		//       (state->num_classes > 1) ? "es" : "");
+		for (int loop = 0; loop < state->num_classes; loop++) {
+			switch (cls->c_class) {
+				case ValuatorClass:
+					XValuatorState *val_state = (XValuatorState *)cls;
+					// printf("ValuatorClass Mode=%s Proximity=%s\n",
+					//        val_state->mode & 1 ? "Absolute" : "Relative",
+					//        val_state->mode & 2 ? "Out" : "In");
+
+					if ((val_state->mode & 2) == 0) {
+						XFreeDeviceState(state);
+						return true;
+					}
+					break;
+			}
+			cls = (XInputClass *) ((char *)cls + cls->length);
+		}
+		XFreeDeviceState(state);
+	}
+	return false;
 }
 #endif /* WITH_X11_XINPUT */
 
@@ -512,7 +649,23 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 	if (!window) {
 		return;
 	}
-	
+
+#ifdef WITH_X11_XINPUT
+	/* Proximity-Out Events are not reliable, if the tablet is active - check on each event
+	 * this adds a little overhead but only while the tablet is in use.
+	 * in the futire we could have a ghost call window->CheckTabletProximity()
+	 * but for now enough parts of the code are checking 'Active'
+	 * - campbell */
+	if (window->GetTabletData()->Active != GHOST_kTabletModeNone) {
+		if (checkTabletProximity(xe->xany.display, m_xtablet.StylusDevice) == false &&
+		    checkTabletProximity(xe->xany.display, m_xtablet.EraserDevice) == false)
+		{
+			// printf("proximity disable\n");
+			window->GetTabletData()->Active = GHOST_kTabletModeNone;
+		}
+	}
+#endif /* WITH_X11_XINPUT */
+
 	switch (xe->type) {
 		case Expose:
 		{
@@ -537,7 +690,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 			XMotionEvent &xme = xe->xmotion;
 
 #ifdef WITH_X11_XINPUT
-			bool is_tablet = window->GetXTablet().CommonData.Active != GHOST_kTabletModeNone;
+			bool is_tablet = window->GetTabletData()->Active != GHOST_kTabletModeNone;
 #else
 			bool is_tablet = false;
 #endif
@@ -811,7 +964,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 		{
 			XClientMessageEvent & xcme = xe->xclient;
 
-			if (((Atom)xcme.data.l[0]) == m_delete_window_atom) {
+			if (((Atom)xcme.data.l[0]) == m_atom.WM_DELETE_WINDOW) {
 				g_event = new 
 				          GHOST_Event(
 				    getMilliSeconds(),
@@ -819,7 +972,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 				    window
 				    );
 			}
-			else if (((Atom)xcme.data.l[0]) == m_wm_take_focus) {
+			else if (((Atom)xcme.data.l[0]) == m_atom.WM_TAKE_FOCUS) {
 				XWindowAttributes attr;
 				Window fwin;
 				int revert_to;
@@ -983,31 +1136,31 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 		
 		default: {
 #ifdef WITH_X11_XINPUT
-			if (xe->type == window->GetXTablet().MotionEvent) {
+			if (xe->type == m_xtablet.MotionEvent) {
 				XDeviceMotionEvent *data = (XDeviceMotionEvent *)xe;
 
 				/* stroke might begin without leading ProxyIn event,
 				 * this happens when window is opened when stylus is already hovering
 				 * around tablet surface */
-				setTabletMode(window, data->deviceid);
+				setTabletMode(this, window, data->deviceid);
 
-				window->GetXTablet().CommonData.Pressure =
-				        data->axis_data[2] / ((float)window->GetXTablet().PressureLevels);
+				window->GetTabletData()->Pressure =
+				        data->axis_data[2] / ((float)m_xtablet.PressureLevels);
 
 				/* the (short) cast and the &0xffff is bizarre and unexplained anywhere,
 				 * but I got garbage data without it. Found it in the xidump.c source --matt */
-				window->GetXTablet().CommonData.Xtilt =
-				        (short)(data->axis_data[3] & 0xffff) / ((float)window->GetXTablet().XtiltLevels);
-				window->GetXTablet().CommonData.Ytilt =
-				        (short)(data->axis_data[4] & 0xffff) / ((float)window->GetXTablet().YtiltLevels);
+				window->GetTabletData()->Xtilt =
+				        (short)(data->axis_data[3] & 0xffff) / ((float)m_xtablet.XtiltLevels);
+				window->GetTabletData()->Ytilt =
+				        (short)(data->axis_data[4] & 0xffff) / ((float)m_xtablet.YtiltLevels);
 			}
-			else if (xe->type == window->GetXTablet().ProxInEvent) {
+			else if (xe->type == m_xtablet.ProxInEvent) {
 				XProximityNotifyEvent *data = (XProximityNotifyEvent *)xe;
 
-				setTabletMode(window, data->deviceid);
+				setTabletMode(this, window, data->deviceid);
 			}
-			else if (xe->type == window->GetXTablet().ProxOutEvent) {
-				window->GetXTablet().CommonData.Active = GHOST_kTabletModeNone;
+			else if (xe->type == m_xtablet.ProxOutEvent) {
+				window->GetTabletData()->Active = GHOST_kTabletModeNone;
 			}
 #endif // WITH_X11_XINPUT
 			break;
@@ -1372,7 +1525,7 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 			}
 
 			/* Send a selection request */
-			XConvertSelection(m_display, sel, target, m_xclip_out, win, CurrentTime);
+			XConvertSelection(m_display, sel, target, m_atom.XCLIP_OUT, win, CurrentTime);
 			*context = XCLIB_XCOUT_SENTCONVSEL;
 			return;
 
@@ -1380,28 +1533,28 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 			if (evt.type != SelectionNotify)
 				return;
 
-			if (target == m_utf8_string && evt.xselection.property == None) {
+			if (target == m_atom.UTF8_STRING && evt.xselection.property == None) {
 				*context = XCLIB_XCOUT_FALLBACK_UTF8;
 				return;
 			}
-			else if (target == m_compound_text && evt.xselection.property == None) {
+			else if (target == m_atom.COMPOUND_TEXT && evt.xselection.property == None) {
 				*context = XCLIB_XCOUT_FALLBACK_COMP;
 				return;
 			}
-			else if (target == m_text && evt.xselection.property == None) {
+			else if (target == m_atom.TEXT && evt.xselection.property == None) {
 				*context = XCLIB_XCOUT_FALLBACK_TEXT;
 				return;
 			}
 
 			/* find the size and format of the data in property */
-			XGetWindowProperty(m_display, win, m_xclip_out, 0, 0, False,
+			XGetWindowProperty(m_display, win, m_atom.XCLIP_OUT, 0, 0, False,
 			                   AnyPropertyType, &pty_type, &pty_format,
 			                   &pty_items, &pty_size, &buffer);
 			XFree(buffer);
 
-			if (pty_type == m_incr) {
+			if (pty_type == m_atom.INCR) {
 				/* start INCR mechanism by deleting property */
-				XDeleteProperty(m_display, win, m_xclip_out);
+				XDeleteProperty(m_display, win, m_atom.XCLIP_OUT);
 				XFlush(m_display);
 				*context = XCLIB_XCOUT_INCR;
 				return;
@@ -1416,12 +1569,12 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 			}
 
 			// not using INCR mechanism, just read the property
-			XGetWindowProperty(m_display, win, m_xclip_out, 0, (long) pty_size,
+			XGetWindowProperty(m_display, win, m_atom.XCLIP_OUT, 0, (long) pty_size,
 			                   False, AnyPropertyType, &pty_type,
 			                   &pty_format, &pty_items, &pty_size, &buffer);
 
 			/* finished with property, delete it */
-			XDeleteProperty(m_display, win, m_xclip_out);
+			XDeleteProperty(m_display, win, m_atom.XCLIP_OUT);
 
 			/* copy the buffer to the pointer for returned data */
 			ltxt = (unsigned char *) malloc(pty_items);
@@ -1454,7 +1607,7 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 				return;
 
 			/* check size and format of the property */
-			XGetWindowProperty(m_display, win, m_xclip_out, 0, 0, False,
+			XGetWindowProperty(m_display, win, m_atom.XCLIP_OUT, 0, 0, False,
 			                   AnyPropertyType, &pty_type, &pty_format,
 			                   &pty_items, &pty_size, &buffer);
 
@@ -1463,14 +1616,14 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 				 * to tell the other X client that we have read
 				 * it and to send the next property */
 				XFree(buffer);
-				XDeleteProperty(m_display, win, m_xclip_out);
+				XDeleteProperty(m_display, win, m_atom.XCLIP_OUT);
 				return;
 			}
 
 			if (pty_size == 0) {
 				/* no more data, exit from loop */
 				XFree(buffer);
-				XDeleteProperty(m_display, win, m_xclip_out);
+				XDeleteProperty(m_display, win, m_atom.XCLIP_OUT);
 				*context = XCLIB_XCOUT_NONE;
 
 				/* this means that an INCR transfer is now
@@ -1482,7 +1635,7 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 
 			/* if we have come this far, the property contains
 			 * text, we know the size. */
-			XGetWindowProperty(m_display, win, m_xclip_out, 0, (long) pty_size,
+			XGetWindowProperty(m_display, win, m_atom.XCLIP_OUT, 0, (long) pty_size,
 			                   False, AnyPropertyType, &pty_type, &pty_format,
 			                   &pty_items, &pty_size, &buffer);
 
@@ -1503,7 +1656,7 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 			XFree(buffer);
 
 			/* delete property to get the next item */
-			XDeleteProperty(m_display, win, m_xclip_out);
+			XDeleteProperty(m_display, win, m_atom.XCLIP_OUT);
 			XFlush(m_display);
 			return;
 	}
@@ -1513,7 +1666,7 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
 GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
 {
 	Atom sseln;
-	Atom target = m_utf8_string;
+	Atom target = m_atom.UTF8_STRING;
 	Window owner;
 
 	/* from xclip.c doOut() v0.11 */
@@ -1523,9 +1676,9 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
 	unsigned int context = XCLIB_XCOUT_NONE;
 
 	if (selection == True)
-		sseln = m_primary;
+		sseln = m_atom.PRIMARY;
 	else
-		sseln = m_clipboard;
+		sseln = m_atom.CLIPBOARD;
 
 	vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();
 	vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
@@ -1535,7 +1688,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
 	/* check if we are the owner. */
 	owner = XGetSelectionOwner(m_display, sseln);
 	if (owner == win) {
-		if (sseln == m_clipboard) {
+		if (sseln == m_atom.CLIPBOARD) {
 			sel_buf = (unsigned char *)malloc(strlen(txt_cut_buffer) + 1);
 			strcpy((char *)sel_buf, txt_cut_buffer);
 			return sel_buf;
@@ -1560,19 +1713,19 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
 		/* fallback is needed. set XA_STRING to target and restart the loop. */
 		if (context == XCLIB_XCOUT_FALLBACK) {
 			context = XCLIB_XCOUT_NONE;
-			target = m_string;
+			target = m_atom.STRING;
 			continue;
 		}
 		else if (context == XCLIB_XCOUT_FALLBACK_UTF8) {
 			/* utf8 fail, move to compouned text. */
 			context = XCLIB_XCOUT_NONE;
-			target = m_compound_text;
+			target = m_atom.COMPOUND_TEXT;
 			continue;
 		}
 		else if (context == XCLIB_XCOUT_FALLBACK_COMP) {
 			/* compouned text faile, move to text. */
 			context = XCLIB_XCOUT_NONE;
-			target = m_text;
+			target = m_atom.TEXT;
 			continue;
 		}
 
@@ -1589,7 +1742,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
 		memcpy((char *)tmp_data, (char *)sel_buf, sel_len);
 		tmp_data[sel_len] = '\0';
 		
-		if (sseln == m_string)
+		if (sseln == m_atom.STRING)
 			XFree(sel_buf);
 		else
 			free(sel_buf);
@@ -1610,8 +1763,8 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
 
 	if (buffer) {
 		if (selection == False) {
-			XSetSelectionOwner(m_display, m_clipboard, m_window, CurrentTime);
-			owner = XGetSelectionOwner(m_display, m_clipboard);
+			XSetSelectionOwner(m_display, m_atom.CLIPBOARD, m_window, CurrentTime);
+			owner = XGetSelectionOwner(m_display, m_atom.CLIPBOARD);
 			if (txt_cut_buffer)
 				free((void *)txt_cut_buffer);
 
@@ -1619,8 +1772,8 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
 			strcpy(txt_cut_buffer, buffer);
 		}
 		else {
-			XSetSelectionOwner(m_display, m_primary, m_window, CurrentTime);
-			owner = XGetSelectionOwner(m_display, m_primary);
+			XSetSelectionOwner(m_display, m_atom.PRIMARY, m_window, CurrentTime);
+			owner = XGetSelectionOwner(m_display, m_atom.PRIMARY);
 			if (txt_select_buffer)
 				free((void *)txt_select_buffer);
 
@@ -1648,3 +1801,208 @@ GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType,
 	                         );
 }
 #endif
+
+#ifdef WITH_X11_XINPUT
+/* 
+ * Dummy function to get around IO Handler exiting if device invalid
+ * Basically it will not crash blender now if you have a X device that
+ * is configured but not plugged in.
+ */
+int GHOST_X11_ApplicationErrorHandler(Display *display, XErrorEvent *theEvent)
+{
+	fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n",
+	        theEvent->error_code, theEvent->request_code);
+
+	/* No exit! - but keep lint happy */
+	return 0;
+}
+
+int GHOST_X11_ApplicationIOErrorHandler(Display *display)
+{
+	fprintf(stderr, "Ignoring Xlib error: error IO\n");
+
+	/* No exit! - but keep lint happy */
+	return 0;
+}
+
+/* These C functions are copied from Wine 1.1.13's wintab.c */
+#define BOOL int
+#define TRUE 1
+#define FALSE 0
+
+static bool match_token(const char *haystack, const char *needle)
+{
+	const char *p, *q;
+	for (p = haystack; *p; )
+	{
+		while (*p && isspace(*p))
+			p++;
+		if (!*p)
+			break;
+
+		for (q = needle; *q && *p && tolower(*p) == tolower(*q); q++)
+			p++;
+		if (!*q && (isspace(*p) || !*p))
+			return TRUE;
+
+		while (*p && !isspace(*p))
+			p++;
+	}
+	return FALSE;
+}
+
+
+/* Determining if an X device is a Tablet style device is an imperfect science.
+ * We rely on common conventions around device names as well as the type reported
+ * by Wacom tablets.  This code will likely need to be expanded for alternate tablet types
+ *
+ * Wintab refers to any device that interacts with the tablet as a cursor,
+ * (stylus, eraser, tablet mouse, airbrush, etc)
+ * this is not to be confused with wacom x11 configuration "cursor" device.
+ * Wacoms x11 config "cursor" refers to its device slot (which we mirror with
+ * our gSysCursors) for puck like devices (tablet mice essentially).
+ */
+#if 0 // unused
+static BOOL is_tablet_cursor(const char *name, const char *type)
+{
+	int i;
+	static const char *tablet_cursor_whitelist[] = {
+		"wacom",
+		"wizardpen",
+		"acecad",
+		"tablet",
+		"cursor",
+		"stylus",
+		"eraser",
+		"pad",
+		NULL
+	};
+
+	for (i = 0; tablet_cursor_whitelist[i] != NULL; i++) {
+		if (name && match_token(name, tablet_cursor_whitelist[i]))
+			return TRUE;
+		if (type && match_token(type, tablet_cursor_whitelist[i]))
+			return TRUE;
+	}
+	return FALSE;
+}
+#endif
+static BOOL is_stylus(const char *name, const char *type)
+{
+	int i;
+	static const char *tablet_stylus_whitelist[] = {
+		"stylus",
+		"wizardpen",
+		"acecad",
+		NULL
+	};
+
+	for (i = 0; tablet_stylus_whitelist[i] != NULL; i++) {
+		if (name && match_token(name, tablet_stylus_whitelist[i]))
+			return TRUE;
+		if (type && match_token(type, tablet_stylus_whitelist[i]))
+			return TRUE;
+	}
+
+	return FALSE;
+}
+
+static BOOL is_eraser(const char *name, const char *type)
+{
+	if (name && match_token(name, "eraser"))
+		return TRUE;
+	if (type && match_token(type, "eraser"))
+		return TRUE;
+	return FALSE;
+}
+#undef BOOL
+#undef TRUE
+#undef FALSE
+/* end code copied from wine */
+
+void GHOST_SystemX11::initXInputDevices()
+{
+	static XErrorHandler   old_handler = (XErrorHandler) 0;
+	static XIOErrorHandler old_handler_io = (XIOErrorHandler) 0;
+
+	XExtensionVersion *version = XGetExtensionVersion(m_display, INAME);
+
+	if (version && (version != (XExtensionVersion *)NoSuchExtension)) {
+		if (version->present) {
+			int device_count;
+			XDeviceInfo *device_info = XListInputDevices(m_display, &device_count);
+			m_xtablet.StylusDevice = NULL;
+			m_xtablet.EraserDevice = NULL;
+
+			/* Install our error handler to override Xlib's termination behavior */
+			old_handler = XSetErrorHandler(GHOST_X11_ApplicationErrorHandler);
+			old_handler_io = XSetIOErrorHandler(GHOST_X11_ApplicationIOErrorHandler);
+
+			for (int i = 0; i < device_count; ++i) {
+				char *device_type = device_info[i].type ? XGetAtomName(m_display, device_info[i].type) : NULL;
+				
+//				printf("Tablet type:'%s', name:'%s', index:%d\n", device_type, device_info[i].name, i);
+
+
+				if ((m_xtablet.StylusDevice == NULL) &&
+				    (is_stylus(device_info[i].name, device_type) || (device_info[i].type == m_atom.TABLET)))
+				{
+//					printf("\tfound stylus\n");
+					m_xtablet.StylusID = device_info[i].id;
+					m_xtablet.StylusDevice = XOpenDevice(m_display, m_xtablet.StylusID);
+
+					if (m_xtablet.StylusDevice != NULL) {
+						/* Find how many pressure levels tablet has */
+						XAnyClassPtr ici = device_info[i].inputclassinfo;
+						for (int j = 0; j < m_xtablet.StylusDevice->num_classes; ++j) {
+							if (ici->c_class == ValuatorClass) {
+//								printf("\t\tfound ValuatorClass\n");
+								XValuatorInfo *xvi = (XValuatorInfo *)ici;
+								m_xtablet.PressureLevels = xvi->axes[2].max_value;
+
+								if (xvi->num_axes > 3) {
+									/* this is assuming that the tablet has the same tilt resolution in both
+									 * positive and negative directions. It would be rather weird if it didn't.. */
+									m_xtablet.XtiltLevels = xvi->axes[3].max_value;
+									m_xtablet.YtiltLevels = xvi->axes[4].max_value;
+								}
+								else {
+									m_xtablet.XtiltLevels = 0;
+									m_xtablet.YtiltLevels = 0;
+								}
+
+								break;
+							}
+						
+							ici = (XAnyClassPtr)(((char *)ici) + ici->length);
+						}
+					}
+					else {
+						m_xtablet.StylusID = 0;
+					}
+				}
+				else if ((m_xtablet.EraserDevice == NULL) &&
+				         (is_eraser(device_info[i].name, device_type)))
+				{
+//					printf("\tfound eraser\n");
+					m_xtablet.EraserID = device_info[i].id;
+					m_xtablet.EraserDevice = XOpenDevice(m_display, m_xtablet.EraserID);
+					if (m_xtablet.EraserDevice == NULL) m_xtablet.EraserID = 0;
+				}
+
+				if (device_type) {
+					XFree((void *)device_type);
+				}
+			}
+
+			/* Restore handler */
+			(void) XSetErrorHandler(old_handler);
+			(void) XSetIOErrorHandler(old_handler_io);
+
+			XFreeDeviceList(device_info);
+		}
+		XFree(version);
+	}
+}
+
+#endif /* WITH_X11_XINPUT */
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 02c0109..a11aea2 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -39,11 +39,19 @@
 #include "GHOST_System.h"
 #include "../GHOST_Types.h"
 
+// For tablets
+#ifdef WITH_X11_XINPUT
+#  include <X11/extensions/XInput.h>
+#endif
+
 #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
 #  define GHOST_X11_RES_NAME  "Blender" /* res_name */
 #  define GHOST_X11_RES_CLASS "Blender" /* res_class */
 #endif
 
+/* generic error handlers */
+int GHOST_X11_ApplicationErrorHandler(Display *display, XErrorEvent *theEvent);
+int GHOST_X11_ApplicationIOErrorHandler(Display *display);
 
 class GHOST_WindowX11;
 
@@ -109,6 +117,16 @@ public:
 	    ) const;
 
 	/**
+	 * Returns the dimensions of all displays on this system.
+	 * \return The dimension of the main display.
+	 */
+	void
+	getAllDisplayDimensions(
+	    GHOST_TUns32& width,
+	    GHOST_TUns32& height
+	    ) const;
+
+	/**
 	 * Create a new window.
 	 * The new window is added to the list of windows managed. 
 	 * Never explicitly delete the window, use disposeWindow() instead.
@@ -256,33 +274,59 @@ public:
 		return 0;
 	}
 
-	/**
-	 * Atom used for ICCCM, WM-spec and Motif.
-	 * We only need get this atom at the start, it's relative
-	 * to the display not the window and are public for every
-	 * window that need it.
-	 */
-	Atom m_wm_state;
-	Atom m_wm_change_state;
-	Atom m_net_state;
-	Atom m_net_max_horz;
-	Atom m_net_max_vert;
-	Atom m_net_fullscreen;
-	Atom m_motif;
-	Atom m_wm_take_focus;
-	Atom m_wm_protocols;
-	Atom m_delete_window_atom;
-
-	/* Atoms for Selection, copy & paste. */
-	Atom m_targets;
-	Atom m_string;
-	Atom m_compound_text;
-	Atom m_text;
-	Atom m_clipboard;
-	Atom m_primary;
-	Atom m_xclip_out;
-	Atom m_incr;
-	Atom m_utf8_string;
+#ifdef WITH_X11_XINPUT
+	typedef struct GHOST_TabletX11 {
+		XDevice *StylusDevice;
+		XDevice *EraserDevice;
+
+		XID StylusID, EraserID;
+
+		int MotionEvent;
+		int ProxInEvent;
+		int ProxOutEvent;
+
+		int PressureLevels;
+		int XtiltLevels, YtiltLevels;
+	} GHOST_TabletX11;
+
+	GHOST_TabletX11 &GetXTablet()
+	{
+		return m_xtablet;
+	}
+#endif // WITH_X11_XINPUT
+
+	struct {
+		/**
+		 * Atom used for ICCCM, WM-spec and Motif.
+		 * We only need get this atom at the start, it's relative
+		 * to the display not the window and are public for every
+		 * window that need it.
+		 */
+		Atom WM_STATE;
+		Atom WM_CHANGE_STATE;
+		Atom _NET_WM_STATE;
+		Atom _NET_WM_STATE_MAXIMIZED_HORZ;
+		Atom _NET_WM_STATE_MAXIMIZED_VERT;
+		Atom _NET_WM_STATE_FULLSCREEN;
+		Atom _MOTIF_WM_HINTS;
+		Atom WM_TAKE_FOCUS;
+		Atom WM_PROTOCOLS;
+		Atom WM_DELETE_WINDOW;
+
+		/* Atoms for Selection, copy & paste. */
+		Atom TARGETS;
+		Atom STRING;
+		Atom COMPOUND_TEXT;
+		Atom TEXT;
+		Atom CLIPBOARD;
+		Atom PRIMARY;
+		Atom XCLIP_OUT;
+		Atom INCR;
+		Atom UTF8_STRING;
+#ifdef WITH_X11_XINPUT
+		Atom TABLET;
+#endif
+	} m_atom;
 
 private:
 
@@ -291,6 +335,11 @@ private:
 	XIM m_xim;
 #endif
 
+#ifdef WITH_X11_XINPUT
+	/* Tablet devices */
+	GHOST_TabletX11 m_xtablet;
+#endif
+
 	/// The vector of windows that need to be updated.
 	std::vector<GHOST_WindowX11 *> m_dirty_windows;
 
@@ -313,6 +362,10 @@ private:
 	bool openX11_IM();
 #endif
 
+#ifdef WITH_X11_XINPUT
+	void initXInputDevices();
+#endif
+
 	GHOST_WindowX11 *
 	findGhostWindow(
 	    Window xwind
diff --git a/intern/ghost/intern/GHOST_Window.cpp b/intern/ghost/intern/GHOST_Window.cpp
index fd3ff4f..ca12abe 100644
--- a/intern/ghost/intern/GHOST_Window.cpp
+++ b/intern/ghost/intern/GHOST_Window.cpp
@@ -61,6 +61,8 @@ GHOST_Window::GHOST_Window(
 	
 	m_cursorGrabAccumPos[0] = 0;
 	m_cursorGrabAccumPos[1] = 0;
+	
+	m_nativePixelSize = 1.0f;
 
 	m_fullScreen = state == GHOST_kWindowStateFullScreen;
 	if (m_fullScreen) {
@@ -194,3 +196,4 @@ bool GHOST_Window::getModifiedState()
 {
 	return m_isUnsavedChanges;
 }
+
diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h
index fd87032..f7c67bf 100644
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@ -257,6 +257,13 @@ public:
 	{
 		m_userData = userData;
 	}
+	
+	virtual float getNativePixelSize(void)
+	{
+		if (m_nativePixelSize > 0.0f)
+			return m_nativePixelSize;
+		return 1.0f;
+	}
 
 protected:
 	/**
@@ -351,6 +358,9 @@ protected:
 	GHOST_TUns32 m_fullScreenWidth;
 	/** Full-screen height */
 	GHOST_TUns32 m_fullScreenHeight;
+	
+	/* OSX only, retina screens */
+	float m_nativePixelSize;
 };
 
 
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp
index 99d8854..36d45b4 100644
--- a/intern/ghost/intern/GHOST_WindowCarbon.cpp
+++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp
@@ -182,7 +182,8 @@ GHOST_WindowCarbon::GHOST_WindowCarbon(
 		    (SInt32) this);                     // Store a pointer to the class in the refCon
 #endif
 		//GHOST_PRINT("GHOST_WindowCarbon::GHOST_WindowCarbon(): creating full-screen OpenGL context\n");
-		setDrawingContextType(GHOST_kDrawingContextTypeOpenGL);; installDrawingContext(GHOST_kDrawingContextTypeOpenGL);
+		setDrawingContextType(GHOST_kDrawingContextTypeOpenGL);
+		installDrawingContext(GHOST_kDrawingContextTypeOpenGL);
 		updateDrawingContext();
 		activateDrawingContext();
 
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h
index 3e5c675d..f1388c0 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.h
+++ b/intern/ghost/intern/GHOST_WindowCocoa.h
@@ -262,6 +262,11 @@ public:
 	 * Hides the progress bar icon
 	 */
 	virtual GHOST_TSuccess endProgressBar();
+	
+	
+	virtual void setNativePixelSize(void);
+
+	
 protected:
 	/**
 	 * Tries to install a rendering context in this window.
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index e89dd1b..8d5f8bf 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -58,9 +58,7 @@ extern "C" {
 	extern void wm_draw_update(bContext *C);
 };*/
 @interface CocoaWindowDelegate : NSObject
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
 <NSWindowDelegate>
-#endif
 {
 	GHOST_SystemCocoa *systemCocoa;
 	GHOST_WindowCocoa *associatedWindow;
@@ -74,8 +72,10 @@ extern "C" {
 - (void)windowDidMove:(NSNotification *)notification;
 - (void)windowWillMove:(NSNotification *)notification;
 - (BOOL)windowShouldClose:(id)sender;	
+- (void)windowDidChangeBackingProperties:(NSNotification *)notification;
 @end
 
+
 @implementation CocoaWindowDelegate : NSObject
 - (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa
 {
@@ -128,6 +128,11 @@ extern "C" {
 	}*/
 }
 
+- (void)windowDidChangeBackingProperties:(NSNotification *)notification
+{
+	systemCocoa->handleWindowEvent(GHOST_kEventNativeResolutionChange, associatedWindow);
+}
+
 - (BOOL)windowShouldClose:(id)sender;
 {
 	//Let Blender close the window rather than closing immediately
@@ -481,8 +486,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 	[m_window setSystemAndWindowCocoa:systemCocoa windowCocoa:this];
 	
 	//Forbid to resize the window below the blender defined minimum one
-	minSize.width = 640;
-	minSize.height = 480;
+	minSize.width = 320;
+	minSize.height = 240;
 	[m_window setContentMinSize:minSize];
 	
 	setTitle(title);
@@ -593,7 +598,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 			[m_openGLView setWantsBestResolutionOpenGLSurface:YES];
 		
 			NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
-			m_systemCocoa->m_nativePixelSize = (float)backingBounds.size.width / (float)rect.size.width;
+			m_nativePixelSize = (float)backingBounds.size.width / (float)rect.size.width;
 		}
 	}
 	
@@ -911,6 +916,19 @@ NSScreen* GHOST_WindowCocoa::getScreen()
 	return [m_window screen];
 }
 
+/* called for event, when window leaves monitor to another */
+void GHOST_WindowCocoa::setNativePixelSize(void)
+{
+	/* make sure 10.6 keeps running */
+	if ([m_openGLView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
+		NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
+		
+		GHOST_Rect rect;
+		getClientBounds(rect);
+
+		m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
+	}
+}
 
 /**
  * \note Fullscreen switch is not actual fullscreen with display capture.
@@ -978,9 +996,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
 				//Show the new window
 				[tmpWindow makeKeyAndOrderFront:m_openGLView];
 				//Close and release old window
-				[m_window setDelegate:nil]; // To avoid the notification of "window closed" event
 				[m_window close];
-				[m_window release];
 				m_window = tmpWindow;
 #endif
 			
@@ -1029,7 +1045,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
 				[tmpWindow registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
 												   NSStringPboardType, NSTIFFPboardType, nil]];
 				//Forbid to resize the window below the blender defined minimum one
-				[tmpWindow setContentMinSize:NSMakeSize(640, 480)];
+				[tmpWindow setContentMinSize:NSMakeSize(320, 240)];
 				
 				//Assign the openGL view to the new window
 				[tmpWindow setContentView:m_openGLView];
@@ -1037,9 +1053,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
 				//Show the new window
 				[tmpWindow makeKeyAndOrderFront:nil];
 				//Close and release old window
-				[m_window setDelegate:nil]; // To avoid the notification of "window closed" event
 				[m_window close];
-				[m_window release];
 				m_window = tmpWindow;
 #endif
 			
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 3440e3c..50520b7 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -186,11 +186,6 @@ GHOST_WindowX11(
 	int natom;
 	int glxVersionMajor, glxVersionMinor; /* As in GLX major.minor */
 
-#ifdef WITH_X11_XINPUT
-	/* initialize incase X11 fails to load */
-	memset(&m_xtablet, 0, sizeof(m_xtablet));
-#endif
-
 	m_visual = NULL;
 
 	if (!glXQueryVersion(m_display, &glxVersionMajor, &glxVersionMinor)) {
@@ -271,15 +266,14 @@ GHOST_WindowX11(
 	/* Specify which events we are interested in hearing. */
 
 	xattributes.event_mask =
-	    ExposureMask | StructureNotifyMask |
-	    KeyPressMask | KeyReleaseMask |
-	    EnterWindowMask | LeaveWindowMask |
-	    ButtonPressMask | ButtonReleaseMask |
-	    PointerMotionMask | FocusChangeMask | PropertyChangeMask;
+	        ExposureMask | StructureNotifyMask |
+	        KeyPressMask | KeyReleaseMask |
+	        EnterWindowMask | LeaveWindowMask |
+	        ButtonPressMask | ButtonReleaseMask |
+	        PointerMotionMask | FocusChangeMask |
+	        PropertyChangeMask | KeymapStateMask;
 
 	/* create the window! */
-
-	;
 	if (parentWindow == 0) {
 		m_window =  XCreateWindow(m_display,
 		                          RootWindow(m_display, m_visual->screen),
@@ -334,6 +328,26 @@ GHOST_WindowX11(
 	GHOST_PRINT("Set drop target\n");
 #endif
 
+	if (state == GHOST_kWindowStateMaximized || state == GHOST_kWindowStateFullScreen) {
+		Atom _NET_WM_STATE = XInternAtom(m_display, "_NET_WM_STATE", False);
+		Atom _NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
+		Atom _NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+		Atom _NET_WM_STATE_FULLSCREEN     = XInternAtom(m_display, "_NET_WM_STATE_FULLSCREEN", False);
+		Atom atoms[2];
+		int count = 0;
+
+		if (state == GHOST_kWindowStateMaximized) {
+			atoms[count++] = _NET_WM_STATE_MAXIMIZED_VERT;
+			atoms[count++] = _NET_WM_STATE_MAXIMIZED_HORZ;
+		}
+		else {
+			atoms[count++] = _NET_WM_STATE_FULLSCREEN;
+		}
+
+		XChangeProperty(m_display, m_window, _NET_WM_STATE, XA_ATOM, 32,
+		                PropModeReplace, (unsigned char *)atoms, count);
+		m_post_init = False;
+	}
 	/*
 	 * One of the problem with WM-spec is that can't set a property
 	 * to a window that isn't mapped. That is why we can't "just
@@ -345,7 +359,7 @@ GHOST_WindowX11(
 	 * So, m_post_init indicate that we need wait for the MapNotify
 	 * event and then set the Window state to the m_post_state.
 	 */
-	if ((state != GHOST_kWindowStateNormal) && (state != GHOST_kWindowStateMinimized)) {
+	else if ((state != GHOST_kWindowStateNormal) && (state != GHOST_kWindowStateMinimized)) {
 		m_post_init = True;
 		m_post_state = state;
 	}
@@ -363,8 +377,8 @@ GHOST_WindowX11(
 	xsizehints->y = top;
 	xsizehints->width = width;
 	xsizehints->height = height;
-	xsizehints->min_width = 640;     /* size hints, could be made apart of the ghost api */
-	xsizehints->min_height = 480;    /* limits are also arbitrary, but should not allow 1x1 window */
+	xsizehints->min_width = 320;     /* size hints, could be made apart of the ghost api */
+	xsizehints->min_height = 240;    /* limits are also arbitrary, but should not allow 1x1 window */
 	xsizehints->max_width = 65535;
 	xsizehints->max_height = 65535;
 	XSetWMNormalHints(m_display, m_window, xsizehints);
@@ -381,16 +395,16 @@ GHOST_WindowX11(
 	XFree(xclasshint);
 
 	/* The basic for a good ICCCM "work" */
-	if (m_system->m_wm_protocols) {
+	if (m_system->m_atom.WM_PROTOCOLS) {
 		natom = 0;
 
-		if (m_system->m_delete_window_atom) {
-			atoms[natom] = m_system->m_delete_window_atom;
+		if (m_system->m_atom.WM_DELETE_WINDOW) {
+			atoms[natom] = m_system->m_atom.WM_DELETE_WINDOW;
 			natom++;
 		}
 
-		if (m_system->m_wm_take_focus) {
-			atoms[natom] = m_system->m_wm_take_focus;
+		if (m_system->m_atom.WM_TAKE_FOCUS) {
+			atoms[natom] = m_system->m_atom.WM_TAKE_FOCUS;
 			natom++;
 		}
 
@@ -461,6 +475,8 @@ GHOST_WindowX11(
 
 #ifdef WITH_X11_XINPUT
 	initXInputDevices();
+
+	m_tabletData.Active = GHOST_kTabletModeNone;
 #endif
 
 	/* now set up the rendering context. */
@@ -511,206 +527,36 @@ bool GHOST_WindowX11::createX11_XIC()
 	             EnterWindowMask | LeaveWindowMask |
 	             ButtonPressMask | ButtonReleaseMask |
 	             PointerMotionMask | FocusChangeMask |
-	             PropertyChangeMask | fevent);
+	             PropertyChangeMask | KeymapStateMask | fevent);
 	return true;
 }
 #endif
 
 #ifdef WITH_X11_XINPUT
-/* 
- * Dummy function to get around IO Handler exiting if device invalid
- * Basically it will not crash blender now if you have a X device that
- * is configured but not plugged in.
- */
-static int ApplicationErrorHandler(Display *display, XErrorEvent *theEvent)
-{
-	fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n",
-	        theEvent->error_code, theEvent->request_code);
-
-	/* No exit! - but keep lint happy */
-	return 0;
-}
-
-/* These C functions are copied from Wine 1.1.13's wintab.c */
-#define BOOL int
-#define TRUE 1
-#define FALSE 0
-
-static bool match_token(const char *haystack, const char *needle)
-{
-	const char *p, *q;
-	for (p = haystack; *p; )
-	{
-		while (*p && isspace(*p))
-			p++;
-		if (!*p)
-			break;
-
-		for (q = needle; *q && *p && tolower(*p) == tolower(*q); q++)
-			p++;
-		if (!*q && (isspace(*p) || !*p))
-			return TRUE;
-
-		while (*p && !isspace(*p))
-			p++;
-	}
-	return FALSE;
-}
-
-
-/* Determining if an X device is a Tablet style device is an imperfect science.
- * We rely on common conventions around device names as well as the type reported
- * by Wacom tablets.  This code will likely need to be expanded for alternate tablet types
- *
- * Wintab refers to any device that interacts with the tablet as a cursor,
- * (stylus, eraser, tablet mouse, airbrush, etc)
- * this is not to be confused with wacom x11 configuration "cursor" device.
- * Wacoms x11 config "cursor" refers to its device slot (which we mirror with
- * our gSysCursors) for puck like devices (tablet mice essentially).
- */
-#if 0 // unused
-static BOOL is_tablet_cursor(const char *name, const char *type)
-{
-	int i;
-	static const char *tablet_cursor_whitelist[] = {
-		"wacom",
-		"wizardpen",
-		"acecad",
-		"tablet",
-		"cursor",
-		"stylus",
-		"eraser",
-		"pad",
-		NULL
-	};
-
-	for (i = 0; tablet_cursor_whitelist[i] != NULL; i++) {
-		if (name && match_token(name, tablet_cursor_whitelist[i]))
-			return TRUE;
-		if (type && match_token(type, tablet_cursor_whitelist[i]))
-			return TRUE;
-	}
-	return FALSE;
-}
-#endif
-static BOOL is_stylus(const char *name, const char *type)
-{
-	int i;
-	static const char *tablet_stylus_whitelist[] = {
-		"stylus",
-		"wizardpen",
-		"acecad",
-		NULL
-	};
-
-	for (i = 0; tablet_stylus_whitelist[i] != NULL; i++) {
-		if (name && match_token(name, tablet_stylus_whitelist[i]))
-			return TRUE;
-		if (type && match_token(type, tablet_stylus_whitelist[i]))
-			return TRUE;
-	}
-
-	return FALSE;
-}
-
-static BOOL is_eraser(const char *name, const char *type)
-{
-	if (name && match_token(name, "eraser"))
-		return TRUE;
-	if (type && match_token(type, "eraser"))
-		return TRUE;
-	return FALSE;
-}
-#undef BOOL
-#undef TRUE
-#undef FALSE
-/* end code copied from wine */
-
 void GHOST_WindowX11::initXInputDevices()
 {
-	static XErrorHandler old_handler = (XErrorHandler) 0;
 	XExtensionVersion *version = XGetExtensionVersion(m_display, INAME);
 
 	if (version && (version != (XExtensionVersion *)NoSuchExtension)) {
 		if (version->present) {
-			int device_count;
-			XDeviceInfo *device_info = XListInputDevices(m_display, &device_count);
-			m_xtablet.StylusDevice = NULL;
-			m_xtablet.EraserDevice = NULL;
-			m_xtablet.CommonData.Active = GHOST_kTabletModeNone;
-
-			/* Install our error handler to override Xlib's termination behavior */
-			old_handler = XSetErrorHandler(ApplicationErrorHandler);
-
-			for (int i = 0; i < device_count; ++i) {
-				char *device_type = device_info[i].type ? XGetAtomName(m_display, device_info[i].type) : NULL;
-				
-//				printf("Tablet type:'%s', name:'%s', index:%d\n", device_type, device_info[i].name, i);
-
-
-				if (m_xtablet.StylusDevice == NULL && is_stylus(device_info[i].name, device_type)) {
-//					printf("\tfound stylus\n");
-					m_xtablet.StylusID = device_info[i].id;
-					m_xtablet.StylusDevice = XOpenDevice(m_display, m_xtablet.StylusID);
-
-					if (m_xtablet.StylusDevice != NULL) {
-						/* Find how many pressure levels tablet has */
-						XAnyClassPtr ici = device_info[i].inputclassinfo;
-						for (int j = 0; j < m_xtablet.StylusDevice->num_classes; ++j) {
-							if (ici->c_class == ValuatorClass) {
-//								printf("\t\tfound ValuatorClass\n");
-								XValuatorInfo *xvi = (XValuatorInfo *)ici;
-								m_xtablet.PressureLevels = xvi->axes[2].max_value;
-							
-								/* this is assuming that the tablet has the same tilt resolution in both
-								 * positive and negative directions. It would be rather weird if it didn't.. */
-								m_xtablet.XtiltLevels = xvi->axes[3].max_value;
-								m_xtablet.YtiltLevels = xvi->axes[4].max_value;
-								break;
-							}
-						
-							ici = (XAnyClassPtr)(((char *)ici) + ici->length);
-						}
-					}
-					else {
-						m_xtablet.StylusID = 0;
-					}
-				}
-				else if (m_xtablet.EraserDevice == NULL && is_eraser(device_info[i].name, device_type)) {
-//					printf("\tfound eraser\n");
-					m_xtablet.EraserID = device_info[i].id;
-					m_xtablet.EraserDevice = XOpenDevice(m_display, m_xtablet.EraserID);
-					if (m_xtablet.EraserDevice == NULL) m_xtablet.EraserID = 0;
-				}
-
-				if (device_type) {
-					XFree((void *)device_type);
-				}
-			}
-
-			/* Restore handler */
-			(void) XSetErrorHandler(old_handler);
-
-			XFreeDeviceList(device_info);
-
-
+			GHOST_SystemX11::GHOST_TabletX11 &xtablet = m_system->GetXTablet();
 			XEventClass xevents[10], ev;
 			int dcount = 0;
 
-			if (m_xtablet.StylusDevice) {
-				DeviceMotionNotify(m_xtablet.StylusDevice, m_xtablet.MotionEvent, ev);
+			if (xtablet.StylusDevice) {
+				DeviceMotionNotify(xtablet.StylusDevice, xtablet.MotionEvent, ev);
 				if (ev) xevents[dcount++] = ev;
-				ProximityIn(m_xtablet.StylusDevice, m_xtablet.ProxInEvent, ev);
+				ProximityIn(xtablet.StylusDevice, xtablet.ProxInEvent, ev);
 				if (ev) xevents[dcount++] = ev;
-				ProximityOut(m_xtablet.StylusDevice, m_xtablet.ProxOutEvent, ev);
+				ProximityOut(xtablet.StylusDevice, xtablet.ProxOutEvent, ev);
 				if (ev) xevents[dcount++] = ev;
 			}
-			if (m_xtablet.EraserDevice) {
-				DeviceMotionNotify(m_xtablet.EraserDevice, m_xtablet.MotionEvent, ev);
+			if (xtablet.EraserDevice) {
+				DeviceMotionNotify(xtablet.EraserDevice, xtablet.MotionEvent, ev);
 				if (ev) xevents[dcount++] = ev;
-				ProximityIn(m_xtablet.EraserDevice, m_xtablet.ProxInEvent, ev);
+				ProximityIn(xtablet.EraserDevice, xtablet.ProxInEvent, ev);
 				if (ev) xevents[dcount++] = ev;
-				ProximityOut(m_xtablet.EraserDevice, m_xtablet.ProxOutEvent, ev);
+				ProximityOut(xtablet.EraserDevice, xtablet.ProxOutEvent, ev);
 				if (ev) xevents[dcount++] = ev;
 			}
 
@@ -898,7 +744,7 @@ void GHOST_WindowX11::icccmSetState(int state)
 	xev.xclient.display = m_display;
 	xev.xclient.window = m_window;
 	xev.xclient.format = 32;
-	xev.xclient.message_type = m_system->m_wm_change_state;
+	xev.xclient.message_type = m_system->m_atom.WM_CHANGE_STATE;
 	xev.xclient.data.l[0] = state;
 	XSendEvent(m_display, RootWindow(m_display, DefaultScreen(m_display)),
 	           False, SubstructureNotifyMask | SubstructureRedirectMask, &xev);
@@ -912,8 +758,8 @@ int GHOST_WindowX11::icccmGetState(void) const
 	int format_ret, st;
 
 	prop_ret = NULL;
-	st = XGetWindowProperty(m_display, m_window, m_system->m_wm_state, 0,
-	                        0x7fffffff, False, m_system->m_wm_state, &type_ret,
+	st = XGetWindowProperty(m_display, m_window, m_system->m_atom.WM_STATE, 0,
+	                        0x7fffffff, False, m_system->m_atom.WM_STATE, &type_ret,
 	                        &format_ret, &num_ret, &bytes_after, &prop_ret);
 
 	if ((st == Success) && (prop_ret) && (num_ret == 2))
@@ -934,7 +780,7 @@ void GHOST_WindowX11::netwmMaximized(bool set)
 	xev.xclient.serial = 0;
 	xev.xclient.send_event = True;
 	xev.xclient.window = m_window;
-	xev.xclient.message_type = m_system->m_net_state;
+	xev.xclient.message_type = m_system->m_atom._NET_WM_STATE;
 	xev.xclient.format = 32;
 
 	if (set == True)
@@ -942,8 +788,8 @@ void GHOST_WindowX11::netwmMaximized(bool set)
 	else
 		xev.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
 
-	xev.xclient.data.l[1] = m_system->m_net_max_horz;
-	xev.xclient.data.l[2] = m_system->m_net_max_vert;
+	xev.xclient.data.l[1] = m_system->m_atom._NET_WM_STATE_MAXIMIZED_HORZ;
+	xev.xclient.data.l[2] = m_system->m_atom._NET_WM_STATE_MAXIMIZED_VERT;
 	xev.xclient.data.l[3] = 0;
 	xev.xclient.data.l[4] = 0;
 	XSendEvent(m_display, RootWindow(m_display, DefaultScreen(m_display)),
@@ -960,15 +806,15 @@ bool GHOST_WindowX11::netwmIsMaximized(void) const
 
 	prop_ret = NULL;
 	st = False;
-	ret = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
+	ret = XGetWindowProperty(m_display, m_window, m_system->m_atom._NET_WM_STATE, 0,
 	                         0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
 	                         &num_ret, &bytes_after, &prop_ret);
 	if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
 		count = 0;
 		for (i = 0; i < num_ret; i++) {
-			if (((unsigned long *) prop_ret)[i] == m_system->m_net_max_horz)
+			if (((unsigned long *) prop_ret)[i] == m_system->m_atom._NET_WM_STATE_MAXIMIZED_HORZ)
 				count++;
-			if (((unsigned long *) prop_ret)[i] == m_system->m_net_max_vert)
+			if (((unsigned long *) prop_ret)[i] == m_system->m_atom._NET_WM_STATE_MAXIMIZED_VERT)
 				count++;
 			if (count == 2) {
 				st = True;
@@ -990,7 +836,7 @@ void GHOST_WindowX11::netwmFullScreen(bool set)
 	xev.xclient.serial = 0;
 	xev.xclient.send_event = True;
 	xev.xclient.window = m_window;
-	xev.xclient.message_type = m_system->m_net_state;
+	xev.xclient.message_type = m_system->m_atom._NET_WM_STATE;
 	xev.xclient.format = 32;
 
 	if (set == True)
@@ -998,7 +844,7 @@ void GHOST_WindowX11::netwmFullScreen(bool set)
 	else
 		xev.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
 
-	xev.xclient.data.l[1] = m_system->m_net_fullscreen;
+	xev.xclient.data.l[1] = m_system->m_atom._NET_WM_STATE_FULLSCREEN;
 	xev.xclient.data.l[2] = 0;
 	xev.xclient.data.l[3] = 0;
 	xev.xclient.data.l[4] = 0;
@@ -1016,12 +862,12 @@ bool GHOST_WindowX11::netwmIsFullScreen(void) const
 
 	prop_ret = NULL;
 	st = False;
-	ret = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
+	ret = XGetWindowProperty(m_display, m_window, m_system->m_atom._NET_WM_STATE, 0,
 	                         0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
 	                         &num_ret, &bytes_after, &prop_ret);
 	if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
 		for (i = 0; i < num_ret; i++) {
-			if (((unsigned long *) prop_ret)[i] == m_system->m_net_fullscreen) {
+			if (((unsigned long *) prop_ret)[i] == m_system->m_atom._NET_WM_STATE_FULLSCREEN) {
 				st = True;
 				break;
 			}
@@ -1043,8 +889,8 @@ void GHOST_WindowX11::motifFullScreen(bool set)
 	else
 		hints.decorations = 1;
 
-	XChangeProperty(m_display, m_window, m_system->m_motif,
-	                m_system->m_motif, 32, PropModeReplace,
+	XChangeProperty(m_display, m_window, m_system->m_atom._MOTIF_WM_HINTS,
+	                m_system->m_atom._MOTIF_WM_HINTS, 32, PropModeReplace,
 	                (unsigned char *) &hints, 4);
 }
 
@@ -1059,8 +905,8 @@ bool GHOST_WindowX11::motifIsFullScreen(void) const
 
 	prop_ret = NULL;
 	state = False;
-	st = XGetWindowProperty(m_display, m_window, m_system->m_motif, 0,
-	                        0x7fffffff, False, m_system->m_motif,
+	st = XGetWindowProperty(m_display, m_window, m_system->m_atom._MOTIF_WM_HINTS, 0,
+	                        0x7fffffff, False, m_system->m_atom._MOTIF_WM_HINTS,
 	                        &type_ret, &format_ret, &num_ret,
 	                        &bytes_after, &prop_ret);
 	if ((st == Success) && (prop_ret)) {
@@ -1089,12 +935,12 @@ GHOST_TWindowState GHOST_WindowX11::getState() const
 	 */
 	if ((state == IconicState) || (state == WithdrawnState))
 		state_ret = GHOST_kWindowStateMinimized;
-	else if (netwmIsMaximized() == True)
-		state_ret = GHOST_kWindowStateMaximized;
 	else if (netwmIsFullScreen() == True)
 		state_ret = GHOST_kWindowStateFullScreen;
 	else if (motifIsFullScreen() == True)
 		state_ret = GHOST_kWindowStateFullScreen;
+	else if (netwmIsMaximized() == True)
+		state_ret = GHOST_kWindowStateMaximized;
 	return (state_ret);
 }
 
@@ -1341,15 +1187,6 @@ GHOST_WindowX11::
 		XFreeCursor(m_display, m_custom_cursor);
 	}
 
-#ifdef WITH_X11_XINPUT
-	/* close tablet devices */
-	if (m_xtablet.StylusDevice)
-		XCloseDevice(m_display, m_xtablet.StylusDevice);
-	
-	if (m_xtablet.EraserDevice)
-		XCloseDevice(m_display, m_xtablet.EraserDevice);
-#endif /* WITH_X11_XINPUT */
-
 	if (m_context != s_firstContext) {
 		glXDestroyContext(m_display, m_context);
 	}
@@ -1392,6 +1229,15 @@ installDrawingContext(
 	GHOST_TSuccess success;
 	switch (type) {
 		case GHOST_kDrawingContextTypeOpenGL:
+		{
+#ifdef WITH_X11_XINPUT
+			/* use our own event handlers to avoid exiting blender,
+			 * this would happen for eg:
+			 * if you open blender, unplug a tablet, then open a new window. */
+			XErrorHandler old_handler      = XSetErrorHandler(GHOST_X11_ApplicationErrorHandler);
+			XIOErrorHandler old_handler_io = XSetIOErrorHandler(GHOST_X11_ApplicationIOErrorHandler);
+#endif
+
 			m_context = glXCreateContext(m_display, m_visual, s_firstContext, True);
 			if (m_context != NULL) {
 				if (!s_firstContext) {
@@ -1406,12 +1252,18 @@ installDrawingContext(
 				success = GHOST_kFailure;
 			}
 
+#ifdef WITH_X11_XINPUT
+			/* Restore handler */
+			(void) XSetErrorHandler(old_handler);
+			(void) XSetIOErrorHandler(old_handler_io);
+#endif
 			break;
-
+		}
 		case GHOST_kDrawingContextTypeNone:
+		{
 			success = GHOST_kSuccess;
 			break;
-
+		}
 		default:
 			success = GHOST_kFailure;
 	}
diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h
index 5b2ffce..10d4498 100644
--- a/intern/ghost/intern/GHOST_WindowX11.h
+++ b/intern/ghost/intern/GHOST_WindowX11.h
@@ -196,32 +196,9 @@ public:
 	getXWindow(
 	    );
 #ifdef WITH_X11_XINPUT
-	class XTablet
+	GHOST_TabletData *GetTabletData()
 	{
-public:
-		GHOST_TabletData CommonData;
-
-		XDevice *StylusDevice;
-		XDevice *EraserDevice;
-
-		XID StylusID, EraserID;
-
-		int MotionEvent;
-		int ProxInEvent;
-		int ProxOutEvent;
-
-		int PressureLevels;
-		int XtiltLevels, YtiltLevels;
-	};
-
-	XTablet& GetXTablet()
-	{
-		return m_xtablet;
-	}
-
-	const GHOST_TabletData *GetTabletData()
-	{
-		return &m_xtablet.CommonData;
+		return &m_tabletData;
 	}
 #else // WITH_X11_XINPUT
 	const GHOST_TabletData *GetTabletData()
@@ -387,8 +364,7 @@ private:
 #endif
 
 #ifdef WITH_X11_XINPUT
-	/* Tablet devices */
-	XTablet m_xtablet;
+	GHOST_TabletData m_tabletData;
 #endif
 
 #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 11fa477..93cb2f6 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -52,6 +52,10 @@
 #  include <sys/mman.h>
 #endif
 
+#if defined(_MSC_VER)
+#  define __func__ __FUNCTION__
+#endif
+
 #include "MEM_guardedalloc.h"
 
 /* Only for debugging:
@@ -68,6 +72,17 @@
 
 //#define DEBUG_MEMCOUNTER
 
+/* Only for debugging:
+ * defining DEBUG_THREADS will enable check whether memory manager
+ * is locked with a mutex when allocation is called from non-main
+ * thread.
+ *
+ * This helps troubleshooting memory issues caused by the fact
+ * guarded allocator is not thread-safe, however this check will
+ * fail to check allocations from openmp threads.
+ */
+//#define DEBUG_THREADS
+
 #ifdef DEBUG_MEMCOUNTER
    /* set this to the value that isn't being freed */
 #  define DEBUG_MEMCOUNTER_ERROR_VAL 0
@@ -122,6 +137,12 @@ typedef struct MemHead {
 #endif
 #endif
 
+#ifdef DEBUG_THREADS
+#  include <assert.h>
+#  include <pthread.h>
+static pthread_t mainid;
+#endif
+
 typedef struct MemTail {
 	int tag3, pad;
 } MemTail;
@@ -206,6 +227,20 @@ static void print_error(const char *str, ...)
 
 static void mem_lock_thread(void)
 {
+#ifdef DEBUG_THREADS
+	static int initialized = 0;
+
+	if (initialized == 0) {
+		/* assume first allocation happens from main thread */
+		mainid = pthread_self();
+		initialized = 1;
+	}
+
+	if (!pthread_equal(pthread_self(), mainid) && thread_lock_callback == NULL) {
+		assert(!"Memory function is called from non-main thread without lock");
+	}
+#endif
+
 #ifdef DEBUG_OMP_MALLOC
 	assert(omp_in_parallel() == 0);
 #endif
@@ -329,6 +364,9 @@ void *MEM_reallocN(void *vmemh, size_t len)
 
 		MEM_freeN(vmemh);
 	}
+	else {
+		newp = MEM_mallocN(len, __func__);
+	}
 
 	return newp;
 }
@@ -360,6 +398,9 @@ void *MEM_recallocN(void *vmemh, size_t len)
 
 		MEM_freeN(vmemh);
 	}
+	else {
+		newp = MEM_callocN(len, __func__);
+	}
 
 	return newp;
 }
diff --git a/intern/locale/boost_locale_wrapper.cpp b/intern/locale/boost_locale_wrapper.cpp
index 80e7529..ebd2dd6 100644
--- a/intern/locale/boost_locale_wrapper.cpp
+++ b/intern/locale/boost_locale_wrapper.cpp
@@ -33,6 +33,7 @@
 
 static std::string messages_path;
 static std::string default_domain;
+static std::string locale_str;
 
 void bl_locale_init(const char *_messages_path, const char *_default_domain)
 {
@@ -52,6 +53,7 @@ void bl_locale_init(const char *_messages_path, const char *_default_domain)
 void bl_locale_set(const char *locale)
 {
 	boost::locale::generator gen;
+	std::locale _locale;
 	// Specify location of dictionaries.
 	gen.add_messages_path(messages_path);
 	gen.add_messages_domain(default_domain);
@@ -59,7 +61,8 @@ void bl_locale_set(const char *locale)
 
 	try {
 		if (locale && locale[0]) {
-			std::locale::global(gen(locale));
+			_locale = gen(locale);
+			std::locale::global(_locale);
 		}
 		else {
 #ifdef __APPLE__
@@ -85,9 +88,11 @@ void bl_locale_set(const char *locale)
 			if (locale_osx == "")
 				fprintf(stderr, "Locale set: failed to read AppleLocale read from defaults\n");
 
-			std::locale::global(gen(locale_osx.c_str()));
+			_locale = gen(locale_osx.c_str());
+			std::locale::global(_locale);
 #else
-			std::locale::global(gen(""));
+			_locale = gen("");
+			std::locale::global(_locale);
 #endif
 		}
 		// Note: boost always uses "C" LC_NUMERIC by default!
@@ -95,6 +100,22 @@ void bl_locale_set(const char *locale)
 	catch(std::exception const &e) {
 		std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
 	}
+
+	/* Generate the locale string (useful to know which locale we are actually using in case of "default" one). */
+#define LOCALE_INFO std::use_facet<boost::locale::info>(_locale)
+
+	locale_str = LOCALE_INFO.language();
+	if (LOCALE_INFO.country() != "") {
+		locale_str += "_" + LOCALE_INFO.country();
+	}
+	if (LOCALE_INFO.variant() != "") {
+		locale_str += "@" + LOCALE_INFO.variant();
+	}
+}
+
+const char *bl_locale_get(void)
+{
+	return locale_str.c_str();
 }
 
 const char *bl_locale_pgettext(const char *msgctxt, const char *msgid)
@@ -115,5 +136,4 @@ const char *bl_locale_pgettext(const char *msgctxt, const char *msgid)
 //		std::cout << "bl_locale_pgettext(" << msgctxt << ", " << msgid << "): " << e.what() << " \n";
 		return msgid;
 	}
-}
-
+}
\ No newline at end of file
diff --git a/intern/locale/boost_locale_wrapper.h b/intern/locale/boost_locale_wrapper.h
index e7956d2..4e3a1f8 100644
--- a/intern/locale/boost_locale_wrapper.h
+++ b/intern/locale/boost_locale_wrapper.h
@@ -40,7 +40,8 @@ extern "C" {
 
 void bl_locale_init(const char *messages_path, const char *default_domain);
 void bl_locale_set(const char *locale);
-const char* bl_locale_pgettext(const char *msgctxt, const char *msgid);
+const char *bl_locale_get(void);
+const char *bl_locale_pgettext(const char *msgctxt, const char *msgid);
 
 #ifdef __cplusplus
 }
diff --git a/intern/opencl/CMakeLists.txt b/intern/opencl/CMakeLists.txt
new file mode 100644
index 0000000..03855cf
--- /dev/null
+++ b/intern/opencl/CMakeLists.txt
@@ -0,0 +1,42 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+	.
+)
+
+set(INC_SYS
+
+)
+
+set(SRC
+	OCL_opencl.h
+	intern/clew.h
+	intern/clew.c
+	intern/OCL_opencl.c
+)
+
+
+blender_add_lib(bf_intern_opencl "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/opencl/OCL_opencl.h b/intern/opencl/OCL_opencl.h
similarity index 100%
rename from source/blender/opencl/OCL_opencl.h
rename to intern/opencl/OCL_opencl.h
diff --git a/intern/opencl/SConscript b/intern/opencl/SConscript
new file mode 100644
index 0000000..41a6d72
--- /dev/null
+++ b/intern/opencl/SConscript
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Nathan Letwory.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+Import ('env')
+
+sources = env.Glob('intern/*.c')
+
+incs = '.'
+
+env.BlenderLib ( 'bf_intern_opencl', sources, Split(incs), libtype=['core','player'], priority = [192,192] )
diff --git a/source/blender/opencl/intern/OCL_opencl.c b/intern/opencl/intern/OCL_opencl.c
similarity index 100%
rename from source/blender/opencl/intern/OCL_opencl.c
rename to intern/opencl/intern/OCL_opencl.c
diff --git a/source/blender/opencl/intern/clew.c b/intern/opencl/intern/clew.c
similarity index 100%
rename from source/blender/opencl/intern/clew.c
rename to intern/opencl/intern/clew.c
diff --git a/source/blender/opencl/intern/clew.h b/intern/opencl/intern/clew.h
similarity index 100%
rename from source/blender/opencl/intern/clew.h
rename to intern/opencl/intern/clew.h
diff --git a/intern/rigidbody/CMakeLists.txt b/intern/rigidbody/CMakeLists.txt
new file mode 100644
index 0000000..a323e55
--- /dev/null
+++ b/intern/rigidbody/CMakeLists.txt
@@ -0,0 +1,35 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+SET(INC
+	.
+	../../extern/bullet2/src
+)
+
+set(SRC
+	rb_bullet_api.cpp
+	
+	RBI_api.h
+)
+
+blender_add_lib(bf_intern_rigidbody "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/intern/rigidbody/RBI_api.h b/intern/rigidbody/RBI_api.h
new file mode 100644
index 0000000..9dde2cc
--- /dev/null
+++ b/intern/rigidbody/RBI_api.h
@@ -0,0 +1,309 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation,
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file RBI_api.h
+ *  \ingroup RigidBody
+ *  \brief Rigid Body API for interfacing with external Physics Engines
+ */
+
+#ifndef __RB_API_H__
+#define __RB_API_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* API Notes:
+ * Currently, this API is optimised for Bullet RigidBodies, and doesn't
+ * take into account other Physics Engines. Some tweaking may be necessary
+ * to allow other systems to be used, in particular there may be references
+ * to datatypes that aren't used here...
+ *
+ * -- Joshua Leung (22 June 2010)
+ */
+
+/* ********************************** */
+/* Partial Type Defines - Aliases for the type of data we store */
+
+// ----------
+
+/* Dynamics World */
+typedef struct rbDynamicsWorld rbDynamicsWorld;
+
+/* Rigid Body */
+typedef struct rbRigidBody rbRigidBody;
+
+/* Collision Shape */
+typedef struct rbCollisionShape rbCollisionShape;
+
+/* Mesh Data (for Collision Shapes of Meshes) */
+typedef struct rbMeshData rbMeshData;
+
+/* Constraint */
+typedef struct rbConstraint rbConstraint;
+
+/* ********************************** */
+/* Dynamics World Methods */
+
+/* Setup ---------------------------- */
+
+/* Create a new dynamics world instance */
+// TODO: add args to set the type of constraint solvers, etc.
+extern rbDynamicsWorld *RB_dworld_new(const float gravity[3]);
+
+/* Delete the given dynamics world, and free any extra data it may require */
+extern void RB_dworld_delete(rbDynamicsWorld *world);
+
+/* Settings ------------------------- */
+
+/* Gravity */
+extern void RB_dworld_get_gravity(rbDynamicsWorld *world, float g_out[3]);
+extern void RB_dworld_set_gravity(rbDynamicsWorld *world, const float g_in[3]);
+
+/* Constraint Solver */
+extern void RB_dworld_set_solver_iterations(rbDynamicsWorld *world, int num_solver_iterations);
+/* Split Impulse */
+extern void RB_dworld_set_split_impulse(rbDynamicsWorld *world, int split_impulse);
+
+/* Simulation ----------------------- */
+
+/* Step the simulation by the desired amount (in seconds) with extra controls on substep sizes and maximum substeps */
+extern void RB_dworld_step_simulation(rbDynamicsWorld *world, float timeStep, int maxSubSteps, float timeSubStep);
+
+/* Export -------------------------- */
+
+/* Exports the dynamics world to physics simulator's serialisation format */
+void RB_dworld_export(rbDynamicsWorld *world, const char *filename);
+
+/* ********************************** */
+/* Rigid Body Methods */
+
+/* Setup ---------------------------- */
+
+/* Add RigidBody to dynamics world */
+extern void RB_dworld_add_body(rbDynamicsWorld *world, rbRigidBody *body, int col_groups);
+
+/* Remove RigidBody from dynamics world */
+extern void RB_dworld_remove_body(rbDynamicsWorld *world, rbRigidBody *body);
+
+/* ............ */
+
+/* Create new RigidBody instance */
+extern rbRigidBody *RB_body_new(rbCollisionShape *shape, const float loc[3], const float rot[4]);
+
+/* Delete the given RigidBody instance */
+extern void RB_body_delete(rbRigidBody *body);
+
+/* Settings ------------------------- */
+
+/* 'Type' */
+extern void RB_body_set_type(rbRigidBody *body, int type, float mass);
+
+/* ............ */
+
+/* Collision Shape */
+extern void RB_body_set_collision_shape(rbRigidBody *body, rbCollisionShape *shape);
+
+/* ............ */
+
+/* Mass */
+extern float RB_body_get_mass(rbRigidBody *body);
+extern void RB_body_set_mass(rbRigidBody *body, float value);
+
+/* Friction */
+extern float RB_body_get_friction(rbRigidBody *body);
+extern void RB_body_set_friction(rbRigidBody *body, float value);
+
+/* Restitution */
+extern float RB_body_get_restitution(rbRigidBody *body);
+extern void RB_body_set_restitution(rbRigidBody *body, float value);
+
+/* Damping */
+extern float RB_body_get_linear_damping(rbRigidBody *body);
+extern void RB_body_set_linear_damping(rbRigidBody *body, float value);
+
+extern float RB_body_get_angular_damping(rbRigidBody *body);
+extern void RB_body_set_angular_damping(rbRigidBody *body, float value);
+
+extern void RB_body_set_damping(rbRigidBody *object, float linear, float angular);
+
+/* Sleeping Thresholds */
+extern float RB_body_get_linear_sleep_thresh(rbRigidBody *body);
+extern void RB_body_set_linear_sleep_thresh(rbRigidBody *body, float value);
+
+extern float RB_body_get_angular_sleep_thresh(rbRigidBody *body);
+extern void RB_body_set_angular_sleep_thresh(rbRigidBody *body, float value);
+
+extern void RB_body_set_sleep_thresh(rbRigidBody *body, float linear, float angular);
+
+/* Linear Velocity */
+extern void RB_body_get_linear_velocity(rbRigidBody *body, float v_out[3]);
+extern void RB_body_set_linear_velocity(rbRigidBody *body, const float v_in[3]);
+
+/* Angular Velocity */
+extern void RB_body_get_angular_velocity(rbRigidBody *body, float v_out[3]);
+extern void RB_body_set_angular_velocity(rbRigidBody *body, const float v_in[3]);
+
+/* Linear/Angular Factor, used to lock translation/roation axes */
+extern void RB_body_set_linear_factor(rbRigidBody *object, float x, float y, float z);
+extern void RB_body_set_angular_factor(rbRigidBody *object, float x, float y, float z);
+
+/* Kinematic State */
+extern void RB_body_set_kinematic_state(rbRigidBody *body, int kinematic);
+
+/* RigidBody Interface - Rigid Body Activation States */
+extern int RB_body_get_activation_state(rbRigidBody *body);
+extern void RB_body_set_activation_state(rbRigidBody *body, int use_deactivation);
+extern void RB_body_activate(rbRigidBody *body);
+extern void RB_body_deactivate(rbRigidBody *body);
+
+
+/* Simulation ----------------------- */
+
+/* Get current transform matrix of RigidBody to use in Blender (OpenGL format) */
+extern void RB_body_get_transform_matrix(rbRigidBody *body, float m_out[4][4]);
+
+/* Set RigidBody's location and rotation */
+extern void RB_body_set_loc_rot(rbRigidBody *body, const float loc[3], const float rot[4]);
+/* Set RigidBody's local scaling */
+extern void RB_body_set_scale(rbRigidBody *body, const float scale[3]);
+
+/* ............ */
+
+/* Get RigidBody's position as vector */
+void RB_body_get_position(rbRigidBody *body, float v_out[3]);
+/* Get RigidBody's orientation as quaternion */
+void RB_body_get_orientation(rbRigidBody *body, float v_out[4]);
+
+/* ............ */
+
+extern void RB_body_apply_central_force(rbRigidBody *body, const float v_in[3]);
+
+/* ********************************** */
+/* Collision Shape Methods */
+
+/* Setup (Standard Shapes) ----------- */
+
+extern rbCollisionShape *RB_shape_new_box(float x, float y, float z);
+extern rbCollisionShape *RB_shape_new_sphere(float radius);
+extern rbCollisionShape *RB_shape_new_capsule(float radius, float height);
+extern rbCollisionShape *RB_shape_new_cone(float radius, float height);
+extern rbCollisionShape *RB_shape_new_cylinder(float radius, float height);
+
+/* Setup (Convex Hull) ------------ */
+
+extern rbCollisionShape *RB_shape_new_convex_hull(float *verts, int stride, int count, float margin, bool *can_embed);
+
+/* Setup (Triangle Mesh) ---------- */
+
+/* 1 */
+extern rbMeshData *RB_trimesh_data_new(void);
+extern void RB_trimesh_add_triangle(rbMeshData *mesh, const float v1[3], const float v2[3], const float v3[3]);
+/* 2a - Triangle Meshes */
+extern rbCollisionShape *RB_shape_new_trimesh(rbMeshData *mesh);
+/* 2b - GImpact Meshes */
+extern rbCollisionShape *RB_shape_new_gimpact_mesh(rbMeshData *mesh);
+
+
+/* Cleanup --------------------------- */
+
+extern void RB_shape_delete(rbCollisionShape *shape);
+
+/* Settings --------------------------- */
+
+/* Collision Margin */
+extern float RB_shape_get_margin(rbCollisionShape *shape);
+extern void RB_shape_set_margin(rbCollisionShape *shape, float value);
+
+/* ********************************** */
+/* Constraints */
+
+/* Setup ----------------------------- */
+
+/* Add Rigid Body Constraint to simulation world */
+extern void RB_dworld_add_constraint(rbDynamicsWorld *world, rbConstraint *con, int disable_collisions);
+
+/* Remove Rigid Body Constraint from simulation world */
+extern void RB_dworld_remove_constraint(rbDynamicsWorld *world, rbConstraint *con);
+
+extern rbConstraint *RB_constraint_new_point(float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2);
+extern rbConstraint *RB_constraint_new_fixed(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
+extern rbConstraint *RB_constraint_new_hinge(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
+extern rbConstraint *RB_constraint_new_slider(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
+extern rbConstraint *RB_constraint_new_piston(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
+extern rbConstraint *RB_constraint_new_6dof(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
+extern rbConstraint *RB_constraint_new_6dof_spring(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
+
+/* ............ */
+
+/* Cleanup --------------------------- */
+
+extern void RB_constraint_delete(rbConstraint *con);
+
+/* Settings --------------------------- */
+
+/* Enable or disable constraint */
+extern void RB_constraint_set_enabled(rbConstraint *con, int enabled);
+
+/* Limits */
+#define RB_LIMIT_LIN_X 0
+#define RB_LIMIT_LIN_Y 1
+#define RB_LIMIT_LIN_Z 2
+#define RB_LIMIT_ANG_X 3
+#define RB_LIMIT_ANG_Y 4
+#define RB_LIMIT_ANG_Z 5
+/* Bullet uses the following convention:
+ * - lower limit == upper limit -> axis is locked
+ * - lower limit > upper limit -> axis is free
+ * - lower limit < upper limit -> axis is limited in given range
+ */
+extern void RB_constraint_set_limits_hinge(rbConstraint *con, float lower, float upper);
+extern void RB_constraint_set_limits_slider(rbConstraint *con, float lower, float upper);
+extern void RB_constraint_set_limits_piston(rbConstraint *con, float lin_lower, float lin_upper, float ang_lower, float ang_upper);
+extern void RB_constraint_set_limits_6dof(rbConstraint *con, int axis, float lower, float upper);
+
+/* 6dof spring specific */
+extern void RB_constraint_set_stiffness_6dof_spring(rbConstraint *con, int axis, float stiffness);
+extern void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, float damping);
+extern void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable);
+extern void RB_constraint_set_equilibrium_6dof_spring(rbConstraint *con);
+
+/* Set number of constraint solver iterations made per step, this overrided world setting
+ * To use default set it to -1 */
+extern void RB_constraint_set_solver_iterations(rbConstraint *con, int num_solver_iterations);
+
+/* Set breaking impulse threshold, if constraint shouldn't break it can be set to FLT_MAX */
+extern void RB_constraint_set_breaking_threshold(rbConstraint *con, float threshold);
+
+/* ********************************** */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __RB_API_H__ */
+ 
diff --git a/intern/rigidbody/SConscript b/intern/rigidbody/SConscript
new file mode 100644
index 0000000..977281f
--- /dev/null
+++ b/intern/rigidbody/SConscript
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+# $Id: SConscript $
+# ***** 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) 2010, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Joshua Leung
+#
+# ***** END GPL LICENSE BLOCK *****
+
+Import('env')
+
+# XXX: we need a contingency plan for when not compiling with Bullet,
+# since this module will always get included... 
+# This problem will also apply to other engines at a later date too...
+sources = env.Glob('*.cpp')
+
+incs = [
+    '.',
+    '../../extern/bullet2/src',
+    ]
+
+env.BlenderLib('bf_intern_rigidbody', sources=sources,
+               includes=incs, defines=[],
+               libtype=['core', 'player'], priority=[180, 30])
diff --git a/intern/rigidbody/rb_bullet_api.cpp b/intern/rigidbody/rb_bullet_api.cpp
new file mode 100644
index 0000000..58345d4
--- /dev/null
+++ b/intern/rigidbody/rb_bullet_api.cpp
@@ -0,0 +1,950 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file rb_bullet_api.cpp
+ *  \ingroup RigidBody
+ *  \brief Rigid Body API implementation for Bullet
+ */
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors 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.
+*/
+ 
+/* This file defines the "RigidBody interface" for the 
+ * Bullet Physics Engine. This API is designed to be used
+ * from C-code in Blender as part of the Rigid Body simulation
+ * system.
+ *
+ * It is based on the Bullet C-API, but is heavily modified to 
+ * give access to more data types and to offer a nicer interface.
+ *
+ * -- Joshua Leung, June 2010
+ */
+
+#include <stdio.h>
+ 
+#include "RBI_api.h"
+
+#include "btBulletDynamicsCommon.h"
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btScalar.h"	
+#include "LinearMath/btMatrix3x3.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btConvexHullComputer.h"
+
+#include "BulletCollision/Gimpact/btGImpactShape.h"
+#include "BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h"
+#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
+
+struct rbDynamicsWorld {
+	btDiscreteDynamicsWorld *dynamicsWorld;
+	btDefaultCollisionConfiguration *collisionConfiguration;
+	btDispatcher *dispatcher;
+	btBroadphaseInterface *pairCache;
+	btConstraintSolver *constraintSolver;
+	btOverlapFilterCallback *filterCallback;
+};
+struct rbRigidBody {
+	btRigidBody *body;
+	int col_groups;
+};
+
+struct rbCollisionShape {
+	btCollisionShape *cshape;
+	btTriangleMesh *mesh;
+};
+
+struct rbFilterCallback : public btOverlapFilterCallback
+{
+	virtual bool needBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
+	{
+		rbRigidBody *rb0 = (rbRigidBody *)((btRigidBody *)proxy0->m_clientObject)->getUserPointer();
+		rbRigidBody *rb1 = (rbRigidBody *)((btRigidBody *)proxy1->m_clientObject)->getUserPointer();
+		
+		bool collides;
+		collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
+		collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+		collides = collides && (rb0->col_groups & rb1->col_groups);
+		
+		return collides;
+	}
+};
+
+static inline void copy_v3_btvec3(float vec[3], const btVector3 &btvec)
+{
+	vec[0] = (float)btvec[0];
+	vec[1] = (float)btvec[1];
+	vec[2] = (float)btvec[2];
+}
+static inline void copy_quat_btquat(float quat[3], const btQuaternion &btquat)
+{
+	quat[0] = btquat.getW();
+	quat[1] = btquat.getX();
+	quat[2] = btquat.getY();
+	quat[3] = btquat.getZ();
+}
+
+/* ********************************** */
+/* Dynamics World Methods */
+
+/* Setup ---------------------------- */
+
+rbDynamicsWorld *RB_dworld_new(const float gravity[3])
+{
+	rbDynamicsWorld *world = new rbDynamicsWorld;
+	
+	/* collision detection/handling */
+	world->collisionConfiguration = new btDefaultCollisionConfiguration();
+	
+	world->dispatcher = new btCollisionDispatcher(world->collisionConfiguration);
+	btGImpactCollisionAlgorithm::registerAlgorithm((btCollisionDispatcher *)world->dispatcher); // XXX: experimental
+	
+	world->pairCache = new btDbvtBroadphase();
+	
+	world->filterCallback = new rbFilterCallback();
+	world->pairCache->getOverlappingPairCache()->setOverlapFilterCallback(world->filterCallback);
+
+	/* constraint solving */
+	world->constraintSolver = new btSequentialImpulseConstraintSolver();
+
+	/* world */
+	world->dynamicsWorld = new btDiscreteDynamicsWorld(world->dispatcher,
+	                                                   world->pairCache,
+	                                                   world->constraintSolver,
+	                                                   world->collisionConfiguration);
+
+	RB_dworld_set_gravity(world, gravity);
+	
+	return world;
+}
+
+void RB_dworld_delete(rbDynamicsWorld *world)
+{
+	/* bullet doesn't like if we free these in a different order */
+	delete world->dynamicsWorld;
+	delete world->constraintSolver;
+	delete world->pairCache;
+	delete world->dispatcher;
+	delete world->collisionConfiguration;
+	delete world->filterCallback;
+	delete world;
+}
+
+/* Settings ------------------------- */
+
+/* Gravity */
+void RB_dworld_get_gravity(rbDynamicsWorld *world, float g_out[3])
+{
+	copy_v3_btvec3(g_out, world->dynamicsWorld->getGravity());
+}
+
+void RB_dworld_set_gravity(rbDynamicsWorld *world, const float g_in[3])
+{
+	world->dynamicsWorld->setGravity(btVector3(g_in[0], g_in[1], g_in[2]));
+}
+
+/* Constraint Solver */
+void RB_dworld_set_solver_iterations(rbDynamicsWorld *world, int num_solver_iterations)
+{
+	btContactSolverInfo& info = world->dynamicsWorld->getSolverInfo();
+	
+	info.m_numIterations = num_solver_iterations;
+}
+
+/* Split Impulse */
+void RB_dworld_set_split_impulse(rbDynamicsWorld *world, int split_impulse)
+{
+	btContactSolverInfo& info = world->dynamicsWorld->getSolverInfo();
+	
+	info.m_splitImpulse = split_impulse;
+}
+
+/* Simulation ----------------------- */
+
+void RB_dworld_step_simulation(rbDynamicsWorld *world, float timeStep, int maxSubSteps, float timeSubStep)
+{
+	world->dynamicsWorld->stepSimulation(timeStep, maxSubSteps, timeSubStep);
+}
+
+/* Export -------------------------- */
+
+/* Exports entire dynamics world to Bullet's "*.bullet" binary format
+ * which is similar to Blender's SDNA system...
+ * < rbDynamicsWorld: dynamics world to write to file
+ * < filename: assumed to be a valid filename, with .bullet extension 
+ */
+void RB_dworld_export(rbDynamicsWorld *world, const char *filename)
+{
+	//create a large enough buffer. There is no method to pre-calculate the buffer size yet.
+	int maxSerializeBufferSize = 1024 * 1024 * 5;
+	
+	btDefaultSerializer *serializer = new btDefaultSerializer(maxSerializeBufferSize);
+	world->dynamicsWorld->serialize(serializer);
+	
+	FILE *file = fopen(filename, "wb");
+	fwrite(serializer->getBufferPointer(), serializer->getCurrentBufferSize(), 1, file);
+	fclose(file);
+}
+
+/* ********************************** */
+/* Rigid Body Methods */
+
+/* Setup ---------------------------- */
+
+void RB_dworld_add_body(rbDynamicsWorld *world, rbRigidBody *object, int col_groups)
+{
+	btRigidBody *body = object->body;
+	object->col_groups = col_groups;
+	
+	world->dynamicsWorld->addRigidBody(body);
+}
+
+void RB_dworld_remove_body(rbDynamicsWorld *world, rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	
+	world->dynamicsWorld->removeRigidBody(body);
+}
+
+/* ............ */
+
+rbRigidBody *RB_body_new(rbCollisionShape *shape, const float loc[3], const float rot[4])
+{
+	rbRigidBody *object = new rbRigidBody;
+	/* current transform */
+	btTransform trans;
+	trans.setOrigin(btVector3(loc[0], loc[1], loc[2]));
+	trans.setRotation(btQuaternion(rot[1], rot[2], rot[3], rot[0]));
+	
+	/* create motionstate, which is necessary for interpolation (includes reverse playback) */
+	btDefaultMotionState *motionState = new btDefaultMotionState(trans);
+	
+	/* make rigidbody */
+	btRigidBody::btRigidBodyConstructionInfo rbInfo(1.0f, motionState, shape->cshape);
+	
+	object->body = new btRigidBody(rbInfo);
+	
+	object->body->setUserPointer(object);
+	
+	return object;
+}
+
+void RB_body_delete(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	
+	/* motion state */
+	btMotionState *ms = body->getMotionState();
+	if (ms)
+		delete ms;
+	
+	/* collision shape is done elsewhere... */
+	
+	/* body itself */
+	
+	/* manually remove constraint refs of the rigid body, normally this happens when removing constraints from the world
+	 * but since we delete everything when the world is rebult, we need to do it manually here */
+	for (int i = body->getNumConstraintRefs() - 1; i >= 0; i--) {
+		btTypedConstraint *con = body->getConstraintRef(i);
+		body->removeConstraintRef(con);
+	}
+	
+	delete body;
+	delete object;
+}
+
+/* Settings ------------------------- */
+
+void RB_body_set_collision_shape(rbRigidBody *object, rbCollisionShape *shape)
+{
+	btRigidBody *body = object->body;
+	
+	/* set new collision shape */
+	body->setCollisionShape(shape->cshape);
+	
+	/* recalculate inertia, since that depends on the collision shape... */
+	RB_body_set_mass(object, RB_body_get_mass(object));
+}
+
+/* ............ */
+
+float RB_body_get_mass(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	
+	/* there isn't really a mass setting, but rather 'inverse mass'  
+	 * which we convert back to mass by taking the reciprocal again 
+	 */
+	float value = (float)body->getInvMass();
+	
+	if (value)
+		value = 1.0 / value;
+		
+	return value;
+}
+
+void RB_body_set_mass(rbRigidBody *object, float value)
+{
+	btRigidBody *body = object->body;
+	btVector3 localInertia(0, 0, 0);
+	
+	/* calculate new inertia if non-zero mass */
+	if (value) {
+		btCollisionShape *shape = body->getCollisionShape();
+		shape->calculateLocalInertia(value, localInertia);
+	}
+	
+	body->setMassProps(value, localInertia);
+	body->updateInertiaTensor();
+}
+
+
+float RB_body_get_friction(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	return body->getFriction();
+}
+
+void RB_body_set_friction(rbRigidBody *object, float value)
+{
+	btRigidBody *body = object->body;
+	body->setFriction(value);
+}
+
+
+float RB_body_get_restitution(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	return body->getRestitution();
+}
+
+void RB_body_set_restitution(rbRigidBody *object, float value)
+{
+	btRigidBody *body = object->body;
+	body->setRestitution(value);
+}
+
+
+float RB_body_get_linear_damping(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	return body->getLinearDamping();
+}
+
+void RB_body_set_linear_damping(rbRigidBody *object, float value)
+{
+	RB_body_set_damping(object, value, RB_body_get_linear_damping(object));
+}
+
+float RB_body_get_angular_damping(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	return body->getAngularDamping();
+}
+
+void RB_body_set_angular_damping(rbRigidBody *object, float value)
+{
+	RB_body_set_damping(object, RB_body_get_linear_damping(object), value);
+}
+
+void RB_body_set_damping(rbRigidBody *object, float linear, float angular)
+{
+	btRigidBody *body = object->body;
+	body->setDamping(linear, angular);
+}
+
+
+float RB_body_get_linear_sleep_thresh(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	return body->getLinearSleepingThreshold();
+}
+
+void RB_body_set_linear_sleep_thresh(rbRigidBody *object, float value)
+{
+	RB_body_set_sleep_thresh(object, value, RB_body_get_angular_sleep_thresh(object));
+}
+
+float RB_body_get_angular_sleep_thresh(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	return body->getAngularSleepingThreshold();
+}
+
+void RB_body_set_angular_sleep_thresh(rbRigidBody *object, float value)
+{
+	RB_body_set_sleep_thresh(object, RB_body_get_linear_sleep_thresh(object), value);
+}
+
+void RB_body_set_sleep_thresh(rbRigidBody *object, float linear, float angular)
+{
+	btRigidBody *body = object->body;
+	body->setSleepingThresholds(linear, angular);
+}
+
+/* ............ */
+
+void RB_body_get_linear_velocity(rbRigidBody *object, float v_out[3])
+{
+	btRigidBody *body = object->body;
+	
+	copy_v3_btvec3(v_out, body->getLinearVelocity());
+}
+
+void RB_body_set_linear_velocity(rbRigidBody *object, const float v_in[3])
+{
+	btRigidBody *body = object->body;
+	
+	body->setLinearVelocity(btVector3(v_in[0], v_in[1], v_in[2]));
+}
+
+
+void RB_body_get_angular_velocity(rbRigidBody *object, float v_out[3])
+{
+	btRigidBody *body = object->body;
+	
+	copy_v3_btvec3(v_out, body->getAngularVelocity());
+}
+
+void RB_body_set_angular_velocity(rbRigidBody *object, const float v_in[3])
+{
+	btRigidBody *body = object->body;
+	
+	body->setAngularVelocity(btVector3(v_in[0], v_in[1], v_in[2]));
+}
+
+void RB_body_set_linear_factor(rbRigidBody *object, float x, float y, float z)
+{
+	btRigidBody *body = object->body;
+	body->setLinearFactor(btVector3(x, y, z));
+}
+
+void RB_body_set_angular_factor(rbRigidBody *object, float x, float y, float z)
+{
+	btRigidBody *body = object->body;
+	body->setAngularFactor(btVector3(x, y, z));
+}
+
+/* ............ */
+
+void RB_body_set_kinematic_state(rbRigidBody *object, int kinematic)
+{
+	btRigidBody *body = object->body;
+	if (kinematic)
+		body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
+	else
+		body->setCollisionFlags(body->getCollisionFlags() & ~btCollisionObject::CF_KINEMATIC_OBJECT);
+}
+
+/* ............ */
+
+void RB_body_set_activation_state(rbRigidBody *object, int use_deactivation)
+{
+	btRigidBody *body = object->body;
+	if (use_deactivation)
+		body->forceActivationState(ACTIVE_TAG);
+	else
+		body->setActivationState(DISABLE_DEACTIVATION);
+}
+void RB_body_activate(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	body->setActivationState(ACTIVE_TAG);
+}
+void RB_body_deactivate(rbRigidBody *object)
+{
+	btRigidBody *body = object->body;
+	body->setActivationState(ISLAND_SLEEPING);
+}
+
+/* ............ */
+
+
+
+/* Simulation ----------------------- */
+
+/* The transform matrices Blender uses are OpenGL-style matrices, 
+ * while Bullet uses the Right-Handed coordinate system style instead.
+ */
+
+void RB_body_get_transform_matrix(rbRigidBody *object, float m_out[4][4])
+{
+	btRigidBody *body = object->body;
+	btMotionState *ms = body->getMotionState();
+	
+	btTransform trans;
+	ms->getWorldTransform(trans);
+	
+	trans.getOpenGLMatrix((btScalar *)m_out);
+}
+
+void RB_body_set_loc_rot(rbRigidBody *object, const float loc[3], const float rot[4])
+{
+	btRigidBody *body = object->body;
+	btMotionState *ms = body->getMotionState();
+	
+	/* set transform matrix */
+	btTransform trans;
+	trans.setOrigin(btVector3(loc[0], loc[1], loc[2]));
+	trans.setRotation(btQuaternion(rot[1], rot[2], rot[3], rot[0]));
+	
+	ms->setWorldTransform(trans);
+}
+
+void RB_body_set_scale(rbRigidBody *object, const float scale[3])
+{
+	btRigidBody *body = object->body;
+	
+	/* apply scaling factor from matrix above to the collision shape */
+	btCollisionShape *cshape = body->getCollisionShape();
+	if (cshape) {
+		cshape->setLocalScaling(btVector3(scale[0], scale[1], scale[2]));
+		
+		/* GIimpact shapes have to be updated to take scaling into account */
+		if (cshape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE)
+			((btGImpactMeshShape *)cshape)->updateBound();
+	}
+}
+
+/* ............ */
+/* Read-only state info about status of simulation */
+
+void RB_body_get_position(rbRigidBody *object, float v_out[3])
+{
+	btRigidBody *body = object->body;
+	
+	copy_v3_btvec3(v_out, body->getWorldTransform().getOrigin());
+}
+
+void RB_body_get_orientation(rbRigidBody *object, float v_out[4])
+{
+	btRigidBody *body = object->body;
+	
+	copy_quat_btquat(v_out, body->getWorldTransform().getRotation());
+}
+
+/* ............ */
+/* Overrides for simulation */
+
+void RB_body_apply_central_force(rbRigidBody *object, const float v_in[3])
+{
+	btRigidBody *body = object->body;
+	
+	body->applyCentralForce(btVector3(v_in[0], v_in[1], v_in[2]));
+}
+
+/* ********************************** */
+/* Collision Shape Methods */
+
+/* Setup (Standard Shapes) ----------- */
+
+rbCollisionShape *RB_shape_new_box(float x, float y, float z)
+{
+	rbCollisionShape *shape = new rbCollisionShape;
+	shape->cshape = new btBoxShape(btVector3(x, y, z));
+	shape->mesh = NULL;
+	return shape;
+}
+
+rbCollisionShape *RB_shape_new_sphere(float radius)
+{
+	rbCollisionShape *shape = new rbCollisionShape;
+	shape->cshape = new btSphereShape(radius);
+	shape->mesh = NULL;
+	return shape;
+}
+
+rbCollisionShape *RB_shape_new_capsule(float radius, float height)
+{
+	rbCollisionShape *shape = new rbCollisionShape;
+	shape->cshape = new btCapsuleShapeZ(radius, height);
+	shape->mesh = NULL;
+	return shape;
+}
+
+rbCollisionShape *RB_shape_new_cone(float radius, float height)
+{
+	rbCollisionShape *shape = new rbCollisionShape;
+	shape->cshape = new btConeShapeZ(radius, height);
+	shape->mesh = NULL;
+	return shape;
+}
+
+rbCollisionShape *RB_shape_new_cylinder(float radius, float height)
+{
+	rbCollisionShape *shape = new rbCollisionShape;
+	shape->cshape = new btCylinderShapeZ(btVector3(radius, radius, height));
+	shape->mesh = NULL;
+	return shape;
+}
+
+/* Setup (Convex Hull) ------------ */
+
+rbCollisionShape *RB_shape_new_convex_hull(float *verts, int stride, int count, float margin, bool *can_embed)
+{
+	btConvexHullComputer hull_computer = btConvexHullComputer();
+	
+	// try to embed the margin, if that fails don't shrink the hull
+	if (hull_computer.compute(verts, stride, count, margin, 0.0f) < 0.0f) {
+		hull_computer.compute(verts, stride, count, 0.0f, 0.0f);
+		*can_embed = false;
+	}
+	
+	rbCollisionShape *shape = new rbCollisionShape;
+	btConvexHullShape *hull_shape = new btConvexHullShape(&(hull_computer.vertices[0].getX()), hull_computer.vertices.size());
+	
+	shape->cshape = hull_shape;
+	shape->mesh = NULL;
+	return shape;
+}
+
+/* Setup (Triangle Mesh) ---------- */
+
+/* Need to call rbTriMeshNewData() followed by rbTriMeshAddTriangle() several times 
+ * to set up the mesh buffer BEFORE calling rbShapeNewTriMesh(). Otherwise,
+ * we get nasty crashes...
+ */
+
+rbMeshData *RB_trimesh_data_new()
+{
+	// XXX: welding threshold?
+	return (rbMeshData *) new btTriangleMesh(true, false);
+}
+ 
+void RB_trimesh_add_triangle(rbMeshData *mesh, const float v1[3], const float v2[3], const float v3[3])
+{
+	btTriangleMesh *meshData = reinterpret_cast<btTriangleMesh*>(mesh);
+	
+	/* cast vertices to usable forms for Bt-API */
+	btVector3 vtx1((btScalar)v1[0], (btScalar)v1[1], (btScalar)v1[2]);
+	btVector3 vtx2((btScalar)v2[0], (btScalar)v2[1], (btScalar)v2[2]);
+	btVector3 vtx3((btScalar)v3[0], (btScalar)v3[1], (btScalar)v3[2]);
+	
+	/* add to the mesh 
+	 *	- remove duplicated verts is enabled
+	 */
+	meshData->addTriangle(vtx1, vtx2, vtx3, false);
+}
+ 
+rbCollisionShape *RB_shape_new_trimesh(rbMeshData *mesh)
+{
+	rbCollisionShape *shape = new rbCollisionShape;
+	btTriangleMesh *tmesh = reinterpret_cast<btTriangleMesh*>(mesh);
+	
+	/* triangle-mesh we create is a BVH wrapper for triangle mesh data (for faster lookups) */
+	// RB_TODO perhaps we need to allow saving out this for performance when rebuilding?
+	btBvhTriangleMeshShape *unscaledShape = new btBvhTriangleMeshShape(tmesh, true, true);
+	
+	shape->cshape = new btScaledBvhTriangleMeshShape(unscaledShape, btVector3(1.0f, 1.0f, 1.0f));
+	shape->mesh = tmesh;
+	return shape;
+}
+
+rbCollisionShape *RB_shape_new_gimpact_mesh(rbMeshData *mesh)
+{
+	rbCollisionShape *shape = new rbCollisionShape;
+	/* interpret mesh buffer as btTriangleIndexVertexArray (i.e. an impl of btStridingMeshInterface) */
+	btTriangleMesh *tmesh = reinterpret_cast<btTriangleMesh*>(mesh);
+	
+	btGImpactMeshShape *gimpactShape = new btGImpactMeshShape(tmesh);
+	gimpactShape->updateBound(); // TODO: add this to the update collision margin call?
+	
+	shape->cshape = gimpactShape;
+	shape->mesh = tmesh;
+	return shape;
+}
+
+/* Cleanup --------------------------- */
+
+void RB_shape_delete(rbCollisionShape *shape)
+{
+	if (shape->cshape->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE) {
+		btBvhTriangleMeshShape *child_shape = ((btScaledBvhTriangleMeshShape *)shape->cshape)->getChildShape();
+		if (child_shape)
+			delete child_shape;
+	}
+	if (shape->mesh)
+		delete shape->mesh;
+	delete shape->cshape;
+	delete shape;
+}
+
+/* Settings --------------------------- */
+
+float RB_shape_get_margin(rbCollisionShape *shape)
+{
+	return shape->cshape->getMargin();
+}
+
+void RB_shape_set_margin(rbCollisionShape *shape, float value)
+{
+	shape->cshape->setMargin(value);
+}
+
+/* ********************************** */
+/* Constraints */
+
+/* Setup ----------------------------- */
+
+void RB_dworld_add_constraint(rbDynamicsWorld *world, rbConstraint *con, int disable_collisions)
+{
+	btTypedConstraint *constraint = reinterpret_cast<btTypedConstraint*>(con);
+	
+	world->dynamicsWorld->addConstraint(constraint, disable_collisions);
+}
+
+void RB_dworld_remove_constraint(rbDynamicsWorld *world, rbConstraint *con)
+{
+	btTypedConstraint *constraint = reinterpret_cast<btTypedConstraint*>(con);
+	
+	world->dynamicsWorld->removeConstraint(constraint);
+}
+
+/* ............ */
+
+static void make_constraint_transforms(btTransform &transform1, btTransform &transform2, btRigidBody *body1, btRigidBody *body2, float pivot[3], float orn[4])
+{
+	btTransform pivot_transform = btTransform();
+	pivot_transform.setOrigin(btVector3(pivot[0], pivot[1], pivot[2]));
+	pivot_transform.setRotation(btQuaternion(orn[1], orn[2], orn[3], orn[0]));
+	
+	transform1 = body1->getWorldTransform().inverse() * pivot_transform;
+	transform2 = body2->getWorldTransform().inverse() * pivot_transform;
+}
+
+rbConstraint *RB_constraint_new_point(float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2)
+{
+	btRigidBody *body1 = rb1->body;
+	btRigidBody *body2 = rb2->body;
+	
+	btVector3 pivot1 = body1->getWorldTransform().inverse() * btVector3(pivot[0], pivot[1], pivot[2]);
+	btVector3 pivot2 = body2->getWorldTransform().inverse() * btVector3(pivot[0], pivot[1], pivot[2]);
+	
+	btTypedConstraint *con = new btPoint2PointConstraint(*body1, *body2, pivot1, pivot2);
+	
+	return (rbConstraint *)con;
+}
+
+rbConstraint *RB_constraint_new_fixed(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
+{
+	btRigidBody *body1 = rb1->body;
+	btRigidBody *body2 = rb2->body;
+	btTransform transform1;
+	btTransform transform2;
+	
+	make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
+	
+	btGeneric6DofConstraint *con = new btGeneric6DofConstraint(*body1, *body2, transform1, transform2, true);
+	
+	/* lock all axes */
+	for (int i = 0; i < 6; i++)
+		con->setLimit(i, 0, 0);
+	
+	return (rbConstraint *)con;
+}
+
+rbConstraint *RB_constraint_new_hinge(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
+{
+	btRigidBody *body1 = rb1->body;
+	btRigidBody *body2 = rb2->body;
+	btTransform transform1;
+	btTransform transform2;
+	
+	make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
+	
+	btHingeConstraint *con = new btHingeConstraint(*body1, *body2, transform1, transform2);
+	
+	return (rbConstraint *)con;
+}
+
+rbConstraint *RB_constraint_new_slider(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
+{
+	btRigidBody *body1 = rb1->body;
+	btRigidBody *body2 = rb2->body;
+	btTransform transform1;
+	btTransform transform2;
+	
+	make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
+	
+	btSliderConstraint *con = new btSliderConstraint(*body1, *body2, transform1, transform2, true);
+	
+	return (rbConstraint *)con;
+}
+
+rbConstraint *RB_constraint_new_piston(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
+{
+	btRigidBody *body1 = rb1->body;
+	btRigidBody *body2 = rb2->body;
+	btTransform transform1;
+	btTransform transform2;
+	
+	make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
+	
+	btSliderConstraint *con = new btSliderConstraint(*body1, *body2, transform1, transform2, true);
+	con->setUpperAngLimit(-1.0f); // unlock rotation axis
+	
+	return (rbConstraint *)con;
+}
+
+rbConstraint *RB_constraint_new_6dof(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
+{
+	btRigidBody *body1 = rb1->body;
+	btRigidBody *body2 = rb2->body;
+	btTransform transform1;
+	btTransform transform2;
+	
+	make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
+	
+	btTypedConstraint *con = new btGeneric6DofConstraint(*body1, *body2, transform1, transform2, true);
+	
+	return (rbConstraint *)con;
+}
+
+rbConstraint *RB_constraint_new_6dof_spring(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
+{
+	btRigidBody *body1 = rb1->body;
+	btRigidBody *body2 = rb2->body;
+	btTransform transform1;
+	btTransform transform2;
+	
+	make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
+	
+	btTypedConstraint *con = new btGeneric6DofSpringConstraint(*body1, *body2, transform1, transform2, true);
+	
+	return (rbConstraint *)con;
+}
+
+/* Cleanup ----------------------------- */
+
+void RB_constraint_delete(rbConstraint *con)
+{
+	btTypedConstraint *constraint = reinterpret_cast<btTypedConstraint*>(con);
+	delete constraint;
+}
+
+/* Settings ------------------------- */
+
+void RB_constraint_set_enabled(rbConstraint *con, int enabled)
+{
+	btTypedConstraint *constraint = reinterpret_cast<btTypedConstraint*>(con);
+	
+	constraint->setEnabled(enabled);
+}
+
+void RB_constraint_set_limits_hinge(rbConstraint *con, float lower, float upper)
+{
+	btHingeConstraint *constraint = reinterpret_cast<btHingeConstraint*>(con);
+	
+	// RB_TODO expose these
+	float softness = 0.9f;
+	float bias_factor = 0.3f;
+	float relaxation_factor = 1.0f;
+	
+	constraint->setLimit(lower, upper, softness, bias_factor, relaxation_factor);
+}
+
+void RB_constraint_set_limits_slider(rbConstraint *con, float lower, float upper)
+{
+	btSliderConstraint *constraint = reinterpret_cast<btSliderConstraint*>(con);
+	
+	constraint->setLowerLinLimit(lower);
+	constraint->setUpperLinLimit(upper);
+}
+
+void RB_constraint_set_limits_piston(rbConstraint *con, float lin_lower, float lin_upper, float ang_lower, float ang_upper)
+{
+	btSliderConstraint *constraint = reinterpret_cast<btSliderConstraint*>(con);
+	
+	constraint->setLowerLinLimit(lin_lower);
+	constraint->setUpperLinLimit(lin_upper);
+	constraint->setLowerAngLimit(ang_lower);
+	constraint->setUpperAngLimit(ang_upper);
+}
+
+void RB_constraint_set_limits_6dof(rbConstraint *con, int axis, float lower, float upper)
+{
+	btGeneric6DofConstraint *constraint = reinterpret_cast<btGeneric6DofConstraint*>(con);
+	
+	constraint->setLimit(axis, lower, upper);
+}
+
+void RB_constraint_set_stiffness_6dof_spring(rbConstraint *con, int axis, float stiffness)
+{
+	btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
+	
+	constraint->setStiffness(axis, stiffness);
+}
+
+void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, float damping)
+{
+	btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
+	
+	// invert damping range so that 0 = no damping
+	constraint->setDamping(axis, 1.0f - damping);
+}
+
+void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable)
+{
+	btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
+	
+	constraint->enableSpring(axis, enable);
+}
+
+void RB_constraint_set_equilibrium_6dof_spring(rbConstraint *con)
+{
+	btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
+	
+	constraint->setEquilibriumPoint();
+}
+
+void RB_constraint_set_solver_iterations(rbConstraint *con, int num_solver_iterations)
+{
+	btTypedConstraint *constraint = reinterpret_cast<btTypedConstraint*>(con);
+	
+	constraint->setOverrideNumSolverIterations(num_solver_iterations);
+}
+
+void RB_constraint_set_breaking_threshold(rbConstraint *con, float threshold)
+{
+	btTypedConstraint *constraint = reinterpret_cast<btTypedConstraint*>(con);
+	
+	constraint->setBreakingImpulseThreshold(threshold);
+}
+
+/* ********************************** */
diff --git a/intern/smoke/intern/FFT_NOISE.h b/intern/smoke/intern/FFT_NOISE.h
index 8b7e4f2..0d8be7d 100644
--- a/intern/smoke/intern/FFT_NOISE.h
+++ b/intern/smoke/intern/FFT_NOISE.h
@@ -94,9 +94,9 @@ static void generatTile_FFT(float* const noiseTileData, std::string filename)
 			for (int x = 0; x < xRes; x++)
 			{
 				int index = x + y * xRes + z * xRes * yRes;
-				float diff[] = {abs(x - xRes/2), 
-				abs(y - yRes/2), 
-				abs(z - zRes/2)};
+				float diff[] = {(float)abs(x - xRes / 2),
+				                (float)abs(y - yRes / 2),
+				                (float)abs(z - zRes / 2)};
 				float radius = sqrtf(diff[0] * diff[0] + 
 				diff[1] * diff[1] + 
 				diff[2] * diff[2]) / (xRes / 2);
diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp
index 4eb11a4..5f0b243 100644
--- a/intern/smoke/intern/FLUID_3D.cpp
+++ b/intern/smoke/intern/FLUID_3D.cpp
@@ -1055,7 +1055,7 @@ void FLUID_3D::project()
 			for (x = 1; x < _xRes - 1; x++, index++)
 			{
 				float vMask[3] = {1.0f, 1.0f, 1.0f}, vObst[3] = {0, 0, 0};
-				float vR = 0.0f, vL = 0.0f, vT = 0.0f, vB = 0.0f, vD = 0.0f, vU = 0.0f;
+				// float vR = 0.0f, vL = 0.0f, vT = 0.0f, vB = 0.0f, vD = 0.0f, vU = 0.0f;  // UNUSED
 
 				float pC = _pressure[index]; // center
 				float pR = _pressure[index + 1]; // right
@@ -1654,7 +1654,7 @@ void FLUID_3D::processBurn(float *fuel, float *smoke, float *react, float *flame
 		fuel[index] -= burning_rate * dt;
 		if (fuel[index] < 0.0f) fuel[index] = 0.0f;
 		/* process reaction coordinate */
-		if (orig_fuel) {
+		if (orig_fuel > FLT_EPSILON) {
 			react[index] *= fuel[index]/orig_fuel;
 			react_coord = react[index];
 		}
@@ -1681,7 +1681,7 @@ void FLUID_3D::processBurn(float *fuel, float *smoke, float *react, float *flame
 			heat[index] = (1.0f-flame[index])*ignition_point + flame[index]*temp_max;
 
 		/* mix new color */
-		if (r && smoke_emit) {
+		if (r && smoke_emit > FLT_EPSILON) {
 			float smoke_factor = smoke[index]/(orig_smoke+smoke_emit);
 			r[index] = (r[index] + _flame_smoke_color[0] * smoke_emit) * smoke_factor;
 			g[index] = (g[index] + _flame_smoke_color[1] * smoke_emit) * smoke_factor;
diff --git a/intern/smoke/intern/WAVELET_NOISE.h b/intern/smoke/intern/WAVELET_NOISE.h
index fce901b..1b2fbfa 100644
--- a/intern/smoke/intern/WAVELET_NOISE.h
+++ b/intern/smoke/intern/WAVELET_NOISE.h
@@ -45,6 +45,8 @@
 
 #include <MERSENNETWISTER.h>
 
+#include <string.h>
+
 #ifdef WIN32
 #include <float.h>
 #define isnan _isnan
diff --git a/intern/tools/credits_svn_gen.py b/intern/tools/credits_svn_gen.py
index 48cc8fe..4e8daa9 100755
--- a/intern/tools/credits_svn_gen.py
+++ b/intern/tools/credits_svn_gen.py
@@ -275,13 +275,13 @@ author_name_mapping = {
     "zaghaghi": "Hamed Zaghaghi",
     "zanqdo": "Daniel Salazar",
     "zuster": "Daniel Dunbar",
-    
+
     # TODO, find remaining names
     "nlin": "",
 
     # added for 'author_overrides'
     "farny": "Mike Farnsworth",
-    
+
     # --------------------
     # Extension Developers
     "aurel": "Aurel Wildfellner",
@@ -361,6 +361,7 @@ author_overrides_ext = {
     "vencax": (30897, ),
     }
 
+
 def build_patch_name_map(filepath):
     """ Uses the CSV from the patch tracker to build a
         patch <-> author name mapping.
@@ -489,7 +490,7 @@ def main_credits(min_rev_bfb=0, min_rev_ext=0):
     import argparse
 
     usage_text = (
-    "Run Script: %s [options]" % os.path.basename(__file__))
+            "Run Script: %s [options]" % os.path.basename(__file__))
 
     parser = argparse.ArgumentParser(description=usage_text)
     parser.add_argument("-s", "--svn_log_bfb", dest="svn_log_bfb",
@@ -525,7 +526,7 @@ def main_credits(min_rev_bfb=0, min_rev_ext=0):
             for author, revisions in author_overrides.items()
             for revision in revisions}
 
-        for commit in commits:            
+        for commit in commits:
             if not is_credit_commit_valid(commit):
                 continue
 
@@ -537,7 +538,7 @@ def main_credits(min_rev_bfb=0, min_rev_ext=0):
                                                       commit.author)
                 credit = credits.get(author)
                 if credit is None:
-                    
+
                     if commit.author not in alert_users:
                         print("warning: '%s' is not in "
                               "'author_name_mapping' !" % commit.author)
@@ -565,14 +566,13 @@ def main_credits(min_rev_bfb=0, min_rev_ext=0):
 
             credit.commits.append(commit)
 
-
     for (commits, author_overrides) in (
              (parse_commits(svn_log_bfb, min_rev=min_rev_bfb),
               author_overrides_bfb),
 
              (parse_commits(svn_log_ext, min_rev=min_rev_ext),
               author_overrides_ext)):
-        
+
         commit_to_credit(commits, author_overrides)
     del commits, author_overrides
 
@@ -584,8 +584,7 @@ def main_credits(min_rev_bfb=0, min_rev_ext=0):
         filename = "credits.html"
     else:
         filename = "credits_release.html"
-    
-    
+
     file = open(filename, 'w', encoding="utf-8")
 
     file.write("<h3>Individual Contributors</h3>\n\n")
@@ -639,7 +638,6 @@ def main_credits(min_rev_bfb=0, min_rev_ext=0):
 
     file.write("\n\n")
 
-
     # -------------------------------------------------------------------------
     # Companies, hard coded
     if is_main_credits:
diff --git a/intern/tools/pydna.py b/intern/tools/pydna.py
index 9f4d8e5..55ad41e 100644
--- a/intern/tools/pydna.py
+++ b/intern/tools/pydna.py
@@ -145,7 +145,7 @@ def _api():
             return
 
         stack.append(struct_name)
-        
+
         struct_type_name_pairs = blend_sdna_structs_dict[struct_name]
         fields = []
         fields_orig = []
@@ -227,7 +227,6 @@ def _api():
             struct_name = blend_sdna_types[struct_id]
             _create_dna_structs__recursive(ctypes_basic, ctypes_structs, blend_sdna_structs_dict, struct_name, [struct_name])
 
-
         # test fields
         error = 0
         for struct_id, struct_type_name_pairs in blend_sdna_structs:
diff --git a/intern/utfconv/utf_winfunc.c b/intern/utfconv/utf_winfunc.c
index 18f0e80..7720931 100644
--- a/intern/utfconv/utf_winfunc.c
+++ b/intern/utfconv/utf_winfunc.c
@@ -29,7 +29,7 @@
 
 #include "utf_winfunc.h"
 #include <io.h>
-#include <Windows.h>
+#include <windows.h>
 #include <wchar.h>
 
 
diff --git a/release/datafiles/blender_icons.svg b/release/datafiles/blender_icons.svg
index fcade5b..60c5ff9 100644
--- a/release/datafiles/blender_icons.svg
+++ b/release/datafiles/blender_icons.svg
@@ -14,12 +14,12 @@
    height="640"
    id="svg2"
    sodipodi:version="0.32"
-   inkscape:version="0.48.3.1 r9886"
+   inkscape:version="0.48.2 r9819"
    version="1.0"
    sodipodi:docname="blender_icons.svg"
    inkscape:output_extension="org.inkscape.output.svg.inkscape"
    style="display:inline;enable-background:new"
-   inkscape:export-filename="/home/wolter/Documenten/Blender/icons/D:\Documents\Blender\icons\BF icons v.2.5.08a.png"
+   inkscape:export-filename="blender_icons16.png"
    inkscape:export-xdpi="90"
    inkscape:export-ydpi="90">
   <title
@@ -28,6 +28,96 @@
      id="defs4">
     <linearGradient
        inkscape:collect="always"
+       id="linearGradient18134">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop18136" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop18138" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient18118">
+      <stop
+         style="stop-color:#d297eb;stop-opacity:1;"
+         offset="0"
+         id="stop18120" />
+      <stop
+         style="stop-color:#a329d6;stop-opacity:1;"
+         offset="1"
+         id="stop18122" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient18103">
+      <stop
+         id="stop18105"
+         offset="0"
+         style="stop-color:#42035d;stop-opacity:1" />
+      <stop
+         id="stop18108"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16367">
+      <stop
+         id="stop16369"
+         offset="0"
+         style="stop-color:#3c3c3c;stop-opacity:1" />
+      <stop
+         id="stop16371"
+         offset="1"
+         style="stop-color:#5a5a5a;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15806">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1"
+         offset="0"
+         id="stop15808" />
+      <stop
+         style="stop-color:#000000;stop-opacity:1"
+         offset="1"
+         id="stop15810" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient15796">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15798" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15800" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16595">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop16597" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop16599" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15647">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop15649" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop15651" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
        id="linearGradient30139">
       <stop
          style="stop-color:#ffffff;stop-opacity:1;"
@@ -65,11 +155,11 @@
     <linearGradient
        id="linearGradient30390">
       <stop
-         style="stop-color:#363636;stop-opacity:1;"
+         style="stop-color:#3d3d3d;stop-opacity:1"
          offset="0"
          id="stop30392" />
       <stop
-         style="stop-color:#4f4f4f;stop-opacity:1;"
+         style="stop-color:#5d5d5d;stop-opacity:1"
          offset="1"
          id="stop30394" />
     </linearGradient>
@@ -14191,26 +14281,6 @@
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient319"
-       id="linearGradient39630"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(0.8167109,0,0,0.8433415,239.34332,-149.78578)"
-       x1="104.90227"
-       y1="53.227627"
-       x2="121.22078"
-       y2="56.357628" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient319"
-       id="linearGradient39632"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(207,-246.99988)"
-       x1="-56.5"
-       y1="342.0625"
-       x2="-49"
-       y2="341" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient319"
        id="linearGradient40171"
        gradientUnits="userSpaceOnUse"
        gradientTransform="matrix(0.8167109,0,0,0.8433415,239.34332,-149.78578)"
@@ -20687,16 +20757,6 @@
        x2="388.78125"
        y2="411.78125" />
     <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient23974-3"
-       id="linearGradient37097-2"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.0028571,0,0,0.9943503,-0.4404318,0.129119)"
-       x1="184.00143"
-       y1="28.989071"
-       x2="193.51584"
-       y2="39.879452" />
-    <linearGradient
        id="linearGradient23974-3">
       <stop
          id="stop23976-6"
@@ -20708,15 +20768,6 @@
          style="stop-color:#ffffff;stop-opacity:1" />
     </linearGradient>
     <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient16504"
-       id="linearGradient15782-9"
-       gradientUnits="userSpaceOnUse"
-       x1="125.19086"
-       y1="125.66204"
-       x2="132.98256"
-       y2="118" />
-    <linearGradient
        id="linearGradient319-47">
       <stop
          style="stop-color:#ffffff;stop-opacity:1;"
@@ -20728,15 +20779,6 @@
          id="stop321-48" />
     </linearGradient>
     <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient319-47"
-       id="linearGradient33681-3"
-       gradientUnits="userSpaceOnUse"
-       x1="139.93341"
-       y1="110.56118"
-       x2="129.60957"
-       y2="120.41502" />
-    <linearGradient
        id="linearGradient23974-3-78">
       <stop
          id="stop23976-6-5"
@@ -20771,34 +20813,6 @@
     </linearGradient>
     <linearGradient
        inkscape:collect="always"
-       xlink:href="#linearGradient23974-3-78"
-       id="linearGradient16713"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.0028571,0,0,0.9943503,-0.4404318,0.129119)"
-       x1="186.25801"
-       y1="31.40288"
-       x2="193.51584"
-       y2="39.879452" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient16504-0"
-       id="linearGradient16716"
-       gradientUnits="userSpaceOnUse"
-       x1="125.19086"
-       y1="125.66204"
-       x2="132.98256"
-       y2="118" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient319-47-9"
-       id="linearGradient16718"
-       gradientUnits="userSpaceOnUse"
-       x1="139.93341"
-       y1="110.56118"
-       x2="127.39279"
-       y2="123.48748" />
-    <linearGradient
-       inkscape:collect="always"
        xlink:href="#linearGradient1610-36-6-5"
        id="linearGradient17833-9"
        gradientUnits="userSpaceOnUse"
@@ -21927,26 +21941,6 @@
        x2="-214.42857"
        y2="206"
        gradientUnits="userSpaceOnUse" />
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient29870"
-       id="radialGradient29940"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.311465,0.10059658,-0.15692472,2.0458095,520.8023,-36.428937)"
-       cx="-214.41437"
-       cy="203.04764"
-       fx="-214.41437"
-       fy="203.04764"
-       r="5.8999949" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient30390"
-       id="linearGradient28911"
-       gradientUnits="userSpaceOnUse"
-       x1="531.875"
-       y1="56.062489"
-       x2="542.99994"
-       y2="61.562489" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient23705-0"
@@ -22226,487 +22220,4465 @@
        x2="61.039909"
        y2="360.0625"
        gradientUnits="userSpaceOnUse" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     gridtolerance="10000"
-     guidetolerance="10000"
-     objecttolerance="10000"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="2"
-     inkscape:cx="199.42005"
-     inkscape:cy="320.97898"
-     inkscape:document-units="px"
-     inkscape:current-layer="layer3"
-     showgrid="false"
-     inkscape:window-width="2560"
-     inkscape:window-height="1571"
-     inkscape:window-x="0"
-     inkscape:window-y="1"
-     inkscape:snap-nodes="false"
-     inkscape:snap-bbox="true"
-     showguides="true"
-     inkscape:guide-bbox="true"
-     inkscape:object-nodes="false"
-     inkscape:object-paths="false"
-     inkscape:snap-intersection-line-segments="true"
-     inkscape:snap-intersection-grid-guide="false"
-     inkscape:window-maximized="1"
-     inkscape:bbox-paths="false"
-     inkscape:snap-global="true"
-     inkscape:snap-bbox-midpoints="false"
-     inkscape:snap-grids="true"
-     inkscape:snap-to-guides="false"
-     inkscape:snap-page="false"
-     units="pt"
-     inkscape:snap-center="false"
-     inkscape:snap-object-midpoints="true">
-    <inkscape:grid
-       type="xygrid"
-       id="grid17394"
-       visible="true"
-       enabled="true"
-       spacingx="0.25px"
-       spacingy="0.25px"
-       empspacing="4"
-       color="#808080"
-       opacity="0.09803922"
-       dotted="false"
-       empcolor="#7f7f7f"
-       empopacity="0.25098039"
-       snapvisiblegridlinesonly="true"
-       originx="0px"
-       originy="-2.7755576e-17px" />
-  </sodipodi:namedview>
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title>Blender icons v. 2.5.08</dc:title>
-        <dc:date>21.05.2012</dc:date>
-        <dc:creator>
-          <cc:Agent>
-            <dc:title>Andrzej Ambroż</dc:title>
-          </cc:Agent>
-        </dc:creator>
-        <dc:rights>
-          <cc:Agent>
-            <dc:title>Andrzej Ambroż</dc:title>
-          </cc:Agent>
-        </dc:rights>
-        <dc:publisher>
-          <cc:Agent>
-            <dc:title>Andrzej Ambroż</dc:title>
-          </cc:Agent>
-        </dc:publisher>
-        <dc:coverage />
-        <cc:license
-           rdf:resource="http://creativecommons.org/licenses/by-nc-sa/3.0/" />
-        <dc:description>This content is under CC Attribution-NonCommercial ShareAlike licence 3.0 as long as it's used for Blender 3D GUI. Any other uses are not allowed.</dc:description>
-      </cc:Work>
-      <cc:License
-         rdf:about="http://creativecommons.org/licenses/by-nc-sa/3.0/">
-        <cc:permits
-           rdf:resource="http://creativecommons.org/ns#Reproduction" />
-        <cc:permits
-           rdf:resource="http://creativecommons.org/ns#Distribution" />
-        <cc:requires
-           rdf:resource="http://creativecommons.org/ns#Notice" />
-        <cc:requires
-           rdf:resource="http://creativecommons.org/ns#Attribution" />
-        <cc:prohibits
-           rdf:resource="http://creativecommons.org/ns#CommercialUse" />
-        <cc:permits
-           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
-        <cc:requires
-           rdf:resource="http://creativecommons.org/ns#ShareAlike" />
-      </cc:License>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:groupmode="layer"
-     id="layer3"
-     inkscape:label="bckgrnd"
-     style="display:none">
-    <rect
-       style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-       id="rect20607"
-       width="1083.874"
-       height="650"
-       x="-4"
-       y="-4" />
-  </g>
-  <path
-     style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#1a1a1a;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-     id="path23417"
-     sodipodi:nodetypes="cc"
-     d="" />
-  <path
-     style="fill:none;stroke:#ffffff;stroke-width:1.79999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-     id="path23347"
-     sodipodi:nodetypes="cc"
-     d="" />
-  <g
-     inkscape:groupmode="layer"
-     id="layer5"
-     inkscape:label="grid"
-     style="opacity:0.3;display:inline"
-     sodipodi:insensitive="true">
-    <g
-       id="g40174"
-       transform="translate(0,2)">
-      <g
-         id="g22995">
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22955"
-           width="1"
-           height="7"
-           x="422"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="401"
-           height="7"
-           width="1"
-           id="rect22957"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22959"
-           width="1"
-           height="7"
-           x="380"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="359"
-           height="7"
-           width="1"
-           id="rect22961"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22963"
-           width="1"
-           height="7"
-           x="338"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="317"
-           height="7"
-           width="1"
-           id="rect22965"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22967"
-           width="1"
-           height="7"
-           x="296"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="275"
-           height="7"
-           width="1"
-           id="rect22969"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22971"
-           width="1"
-           height="7"
-           x="254"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="233"
-           height="7"
-           width="1"
-           id="rect22973"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22975"
-           width="1"
-           height="7"
-           x="212"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="191"
-           height="7"
-           width="1"
-           id="rect22977"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22979"
-           width="1"
-           height="7"
-           x="170"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="149"
-           height="7"
-           width="1"
-           id="rect22981"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22983"
-           width="1"
-           height="7"
-           x="128"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="107"
-           height="7"
-           width="1"
-           id="rect22985"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22987"
-           width="1"
-           height="7"
-           x="86"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="65"
-           height="7"
-           width="1"
-           id="rect22989"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect22991"
-           width="1"
-           height="7"
-           x="44"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="23"
-           height="7"
-           width="1"
-           id="rect22993"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="506"
-           height="7"
-           width="1"
-           id="rect23024"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23026"
-           width="1"
-           height="7"
-           x="485"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           ry="0"
-           rx="0"
-           y="0"
-           x="464"
-           height="7"
-           width="1"
-           id="rect23028"
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23030"
-           width="1"
-           height="7"
-           x="443"
-           y="0"
-           rx="0"
-           ry="0" />
-        <rect
-           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect10985"
-           width="1"
-           height="7"
-           x="527"
-           y="0"
-           rx="0"
-           ry="0" />
-      </g>
-      <g
-         id="g24954">
-        <g
-           id="g23711"
-           transform="translate(0,462)">
-          <rect
-             style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect23713"
-             width="6"
-             height="1"
-             x="0"
-             y="26"
-             rx="0"
-             ry="0" />
-          <g
-             id="g23715">
-            <path
-               id="path23717"
-               d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-            <path
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23719" />
-            <path
-               id="path23721"
-               d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-            <path
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23723" />
-            <path
-               id="path23725"
-               d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-            <path
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23727" />
-            <path
-               id="path23729"
-               d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-36-6-7-9-4-3"
+       id="linearGradient106641-3"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(39.8125,337.625)"
+       x1="209"
+       y1="238"
+       x2="226.625"
+       y2="251.71078" />
+    <linearGradient
+       id="linearGradient1610-36-6-7-9-4-3">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-1-9-4-5-0-6" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-5-9-87-3-7-8" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319"
+       id="linearGradient27496"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.8167109,0,0,0.8433415,239.34332,-149.78578)"
+       x1="104.90227"
+       y1="53.227627"
+       x2="121.22078"
+       y2="56.357628" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319"
+       id="linearGradient27498"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(207,-246.99988)"
+       x1="-56.5"
+       y1="342.0625"
+       x2="-49"
+       y2="341" />
+    <linearGradient
+       id="linearGradient37542-9">
+      <stop
+         id="stop37544-6"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-7"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15541">
+      <stop
+         id="stop15543"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop15545"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient37542-41-8-0-7-1-3">
+      <stop
+         id="stop37544-5-2-6-6-5-3"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-8-6-8-7-2-0"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-1-7"
+       id="linearGradient15721-8-1"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(19.97577,-6.0080883)"
+       x1="227.57907"
+       y1="118.47696"
+       x2="235"
+       y2="118.5" />
+    <linearGradient
+       id="linearGradient319-1-7">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0" />
+    </linearGradient>
+    <linearGradient
+       y2="118.5"
+       x2="235"
+       y1="118.47696"
+       x1="227.57907"
+       gradientTransform="translate(265.62095,336.21475)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient15670-3"
+       xlink:href="#linearGradient319-1-7-2"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient319-1-7-2">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-0" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-5" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient37542-41-8-0-7-4-0">
+      <stop
+         id="stop37544-5-2-6-6-9-0"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-8-6-8-7-3-2"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15647-2">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop15649-9" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop15651-4" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-0">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-1" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-2" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-2-2">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-0-1" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-5-4" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15647-1">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop15649-1" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop15651-2" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-7">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-9" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-0" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-1-7-2-7"
+       id="linearGradient15975-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(267.4022,339.9335)"
+       x1="227.57907"
+       y1="118.47696"
+       x2="235"
+       y2="118.5" />
+    <linearGradient
+       id="linearGradient319-1-7-2-7">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-0-2" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-5-5" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15647-3">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop15649-12" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop15651-7" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-1">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-00" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-4" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-2-9">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-0-8" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-5-9" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient37542-7-0">
+      <stop
+         id="stop37544-40-9"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-94-1"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-3">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-3" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-06" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15647-14">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop15649-7" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop15651-72" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-02">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-8" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-48" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-2-4">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-0-4" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-5-7" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1610-04">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-8" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-8" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10069-7">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-9" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-8" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-28">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-23" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-2" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16389">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16391" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16393" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15647-14-2">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop15649-7-5" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop15651-72-3" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-02-4">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-8-3" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-48-7" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-2-4-2">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-0-4-6" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-5-7-2" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-1-7-5"
+       id="linearGradient16591-3"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(266.10421,337.79176)"
+       x1="224.37904"
+       y1="118.78525"
+       x2="236.37904"
+       y2="118.78525" />
+    <linearGradient
+       id="linearGradient319-1-7-5">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-3" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-8" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15796"
+       id="linearGradient15802"
+       x1="192.4323"
+       y1="348.13098"
+       x2="208.33328"
+       y2="359.81409"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15806"
+       id="linearGradient15804"
+       x1="212.0226"
+       y1="361.34204"
+       x2="194.68611"
+       y2="348.34918"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       id="linearGradient319-715">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-74" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-58" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15840">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15842" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15844" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15847">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15849" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15851" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient16500-75">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop16502-17" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop16504-64" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15858">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15860" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15862" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5060-97">
+      <stop
+         id="stop5062-5"
+         offset="0"
+         style="stop-color:black;stop-opacity:1;" />
+      <stop
+         id="stop5064-5"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15869">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15871" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15873" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-8"
+       id="linearGradient35740-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.707654,0,0,0.707942,-206.46148,-296.13985)"
+       x1="35.597904"
+       y1="158.14117"
+       x2="10.490564"
+       y2="176.41806" />
+    <linearGradient
+       id="linearGradient37542-8">
+      <stop
+         id="stop37544-64"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-5"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-93"
+       id="linearGradient35742-9"
+       gradientUnits="userSpaceOnUse"
+       x1="58.060974"
+       y1="-23.721956"
+       x2="40"
+       y2="-35" />
+    <linearGradient
+       id="linearGradient1610-93">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-83" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-0" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-75"
+       id="linearGradient35744-6"
+       gradientUnits="userSpaceOnUse"
+       x1="46.1875"
+       y1="-28.59375"
+       x2="41.099998"
+       y2="-33.59375" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient36116-7"
+       id="linearGradient35746-7"
+       gradientUnits="userSpaceOnUse"
+       x1="46"
+       y1="-32"
+       x2="43.883884"
+       y2="-33.939339" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient36116-7">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop36118-4" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop36120-1" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-75"
+       id="linearGradient35750-3"
+       gradientUnits="userSpaceOnUse"
+       x1="48.662914"
+       y1="-27.071922"
+       x2="43.47097"
+       y2="-32.337086" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient35752-0"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(6.3,-4.7)"
+       x1="39.200001"
+       y1="-30.799999"
+       x2="41.200001"
+       y2="-28.640625" />
+    <linearGradient
+       id="linearGradient15902">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15904" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15906" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient35754-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(5.315625,-3.75)"
+       x1="39.200001"
+       y1="-30.799999"
+       x2="41.325001"
+       y2="-28.765625" />
+    <linearGradient
+       id="linearGradient15909">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15911" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15913" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient35756-7"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(3.3,0.3)"
+       x1="38.700001"
+       y1="-31.299999"
+       x2="40.012501"
+       y2="-29.799999" />
+    <linearGradient
+       id="linearGradient15916">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15918" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15920" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-75"
+       id="linearGradient35772-6"
+       gradientUnits="userSpaceOnUse"
+       x1="51.912914"
+       y1="-24.696922"
+       x2="40.75"
+       y2="-35.75"
+       gradientTransform="translate(-0.75,4.75)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient35748-0"
+       gradientUnits="userSpaceOnUse"
+       x1="41"
+       y1="-29"
+       x2="43"
+       y2="-27" />
+    <linearGradient
+       id="linearGradient15930">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15932" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15934" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient16186"
+       gradientUnits="userSpaceOnUse"
+       x1="41"
+       y1="-29"
+       x2="43"
+       y2="-27"
+       gradientTransform="translate(412,489)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-75"
+       id="linearGradient16189"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(411.25,493.75)"
+       x1="51.912914"
+       y1="-24.696922"
+       x2="40.75"
+       y2="-35.75" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient16194"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(415.3,489.3)"
+       x1="38.700001"
+       y1="-31.299999"
+       x2="40.012501"
+       y2="-29.799999" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient16197"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(417.31562,485.25)"
+       x1="39.200001"
+       y1="-30.799999"
+       x2="41.325001"
+       y2="-28.765625" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient16200"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(418.3,484.3)"
+       x1="39.200001"
+       y1="-30.799999"
+       x2="41.200001"
+       y2="-28.640625" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-75"
+       id="linearGradient16203"
+       gradientUnits="userSpaceOnUse"
+       x1="48.662914"
+       y1="-27.071922"
+       x2="43.47097"
+       y2="-32.337086"
+       gradientTransform="translate(412,489)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient36116-7"
+       id="linearGradient16208"
+       gradientUnits="userSpaceOnUse"
+       x1="46"
+       y1="-32"
+       x2="43.883884"
+       y2="-33.939339"
+       gradientTransform="translate(412,489)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-75"
+       id="linearGradient16211"
+       gradientUnits="userSpaceOnUse"
+       x1="46.1875"
+       y1="-28.59375"
+       x2="41.099998"
+       y2="-33.59375"
+       gradientTransform="translate(412,489)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-93"
+       id="linearGradient16214"
+       gradientUnits="userSpaceOnUse"
+       x1="58.060974"
+       y1="-23.721956"
+       x2="40"
+       y2="-35"
+       gradientTransform="translate(412,489)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-715"
+       id="linearGradient16252"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(417.31562,485.25)"
+       x1="39.200001"
+       y1="-30.799999"
+       x2="41.325001"
+       y2="-28.765625" />
+    <linearGradient
+       id="linearGradient319-6">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-87" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-64" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15804-5">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15806" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15808-8" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15811">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15813-7" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15815" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15818">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15820" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15822" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15825">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15827" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15829" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient15998"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-65.00001,-10.749995)"
+       x1="61.032951"
+       y1="5.9830923"
+       x2="46.491322"
+       y2="20.147326" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient16000"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.199998,0,0,1.199999,-74.19988,-12.499988)"
+       x1="59.02124"
+       y1="6.0129876"
+       x2="44.509518"
+       y2="20.110929" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient16003"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-64,-10)"
+       x1="18.773417"
+       y1="6.2494373"
+       x2="6.9718256"
+       y2="17.82831" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient16006"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.701513,0.712657,0.712657,0.701513,50.5916,-449.6745)"
+       x1="385.62408"
+       y1="244.3396"
+       x2="401.63013"
+       y2="244.38875" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient16056"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-64,-10)"
+       x1="18.773417"
+       y1="6.2494373"
+       x2="6.9718256"
+       y2="17.82831" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient16058"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.701513,0.712657,0.712657,0.701513,50.5916,-449.6745)"
+       x1="385.62408"
+       y1="244.3396"
+       x2="401.63013"
+       y2="244.38875" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient16084"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-65.00001,-10.749995)"
+       x1="61.032951"
+       y1="5.9830923"
+       x2="46.491322"
+       y2="20.147326" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-6"
+       id="linearGradient16086"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.199998,0,0,1.199999,-74.19988,-12.499988)"
+       x1="59.02124"
+       y1="6.0129876"
+       x2="44.509518"
+       y2="20.110929" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient25417-9"
+       id="linearGradient40731-5"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.997161,-259.00079,67.35344)"
+       x1="280.0918"
+       y1="129.28557"
+       x2="267.20212"
+       y2="116.41341" />
+    <linearGradient
+       id="linearGradient25417-9">
+      <stop
+         id="stop25419-9"
+         offset="0"
+         style="stop-color:#60553b;stop-opacity:1;" />
+      <stop
+         id="stop25421-2"
+         offset="1"
+         style="stop-color:#b0a17f;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-17-1-6-6"
+       id="linearGradient40733-04"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.7972867,-259.00009,90.24189)"
+       x1="255.63673"
+       y1="99.513062"
+       x2="275.1503"
+       y2="129.36641" />
+    <linearGradient
+       id="linearGradient319-17-1-6-6">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-115-1-5-8" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-27-3-7-8" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-6-1">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-87-5" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-64-0" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16451">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16453" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16455" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-6-4">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-87-9" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-64-1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16520">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16522" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16524" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-6-7">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-87-4" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-64-3" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-6-9">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-87-1" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-64-2" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16838">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16840" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16842" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-6-40">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-87-2" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-64-5" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16838-2">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16840-8" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16842-8" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask18666-3">
+      <rect
+         y="6"
+         x="62.921577"
+         height="14.000001"
+         width="15.098035"
+         id="rect18668-4"
+         style="fill:url(#linearGradient18670-3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.50000000000000000;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-08"
+       id="linearGradient18670-3"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.2078427,0,0,1.0516432,-357.40769,69.427229)"
+       x1="362.28571"
+       y1="-45.098213"
+       x2="352.46426"
+       y2="-54.124699" />
+    <linearGradient
+       id="linearGradient1610-08">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-2" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-48" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10069-33">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-7" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-36" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient17205">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop17207" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop17209" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient37542-0">
+      <stop
+         id="stop37544-77"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-2"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-14">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-27" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-629" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient23974-0">
+      <stop
+         id="stop23976-205"
+         offset="0"
+         style="stop-color:#2561b7;stop-opacity:1;" />
+      <stop
+         id="stop23978-6"
+         offset="1"
+         style="stop-color:#f9fbff;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-5-2">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-761-9" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-8-1" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath28964-0">
+      <path
+         inkscape:connector-curvature="0"
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
+         sodipodi:nodetypes="ccccc"
+         style="fill:url(#linearGradient28968);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;enable-background:new"
+         d="m 117.50984,228.63415 0,-15.01646 11.71735,5.49383 0,15.38271 -11.71735,-5.86008 z"
+         id="path28966-5" />
+    </clipPath>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask29419-5">
+      <path
+         inkscape:connector-curvature="0"
+         id="path29422-9"
+         d="m 117.50984,229.00041 0,-15.38272 11.71735,5.49383 0,15.74897 -11.71735,-5.86008 z"
+         style="opacity:0.50000000000000000;fill:url(#linearGradient29424-4);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;enable-background:new"
+         sodipodi:nodetypes="ccccc"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-7-8"
+       id="linearGradient29424-4"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.4646688,0,0,1.4650206,168.77325,-157.03253)"
+       x1="-26.511335"
+       y1="257.99881"
+       x2="-30.075666"
+       y2="259.87677" />
+    <linearGradient
+       id="linearGradient37542-7-8">
+      <stop
+         id="stop37544-40-5"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-94-0"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient21327-6-8-9">
+      <stop
+         style="stop-color:#1e3e70;stop-opacity:1;"
+         offset="0"
+         id="stop21329-3-4-7" />
+      <stop
+         style="stop-color:#1e3e70;stop-opacity:0;"
+         offset="1"
+         id="stop21331-4-0-6" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10069-9-71-7">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-1-6" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-5-4" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10069-9-71-7-2">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-1-6-2" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-5-4-8" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient18118-8">
+      <stop
+         style="stop-color:#cd8ce9;stop-opacity:1"
+         offset="0"
+         id="stop18120-5" />
+      <stop
+         style="stop-color:#9425c1;stop-opacity:1"
+         offset="1"
+         id="stop18122-5" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient18103-9">
+      <stop
+         id="stop18105-3"
+         offset="0"
+         style="stop-color:#42035d;stop-opacity:1" />
+      <stop
+         id="stop18108-4"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134-9"
+       id="linearGradient18140-0"
+       x1="121.48092"
+       y1="105.24046"
+       x2="137.67349"
+       y2="126.34584"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient18134-9">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop18136-5" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop18138-9" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118-8"
+       id="radialGradient18260"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.6671799,6.7886038e-8,-6.7869731e-8,0.66734014,43.604995,38.604049)"
+       cx="129.99182"
+       cy="114.84092"
+       fx="129.99182"
+       fy="114.84092"
+       r="8.781251" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134-9"
+       id="linearGradient18262"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="137.67349"
+       y2="126.34584" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18103"
+       id="linearGradient18264"
+       gradientUnits="userSpaceOnUse"
+       x1="123.80045"
+       y1="111.03492"
+       x2="130.94904"
+       y2="118.11919" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118"
+       id="radialGradient18266"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.09893643,0.88659058,-0.70877161,0.07913125,199.3109,-8.5183197)"
+       cx="129.83784"
+       cy="115.58929"
+       fx="129.83784"
+       fy="115.58929"
+       r="8.7812506" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134"
+       id="linearGradient18268"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="136.95143"
+       y2="123.69764" />
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath31849-4">
+      <path
+         inkscape:connector-curvature="0"
+         style="fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         d="m 232.13187,93.950853 4.84276,0 4.23742,4.237465 0,4.842822 -9.08018,0 0,-9.080287 0,0 z"
+         id="path31851-6"
+         sodipodi:nodetypes="cccccc" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118-8-8"
+       id="radialGradient18260-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.6671799,6.7886038e-8,-6.7869731e-8,0.66734014,43.604995,38.604049)"
+       cx="129.99182"
+       cy="114.84092"
+       fx="129.99182"
+       fy="114.84092"
+       r="8.781251" />
+    <linearGradient
+       id="linearGradient18118-8-8">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop18120-5-0" />
+      <stop
+         style="stop-color:#7b7b7b;stop-opacity:1;"
+         offset="1"
+         id="stop18122-5-4" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134-9-1"
+       id="linearGradient18262-3"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="137.67349"
+       y2="126.34584" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient18134-9-1">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop18136-5-1" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop18138-9-0" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18103-1"
+       id="linearGradient18264-4"
+       gradientUnits="userSpaceOnUse"
+       x1="123.80045"
+       y1="111.03492"
+       x2="130.94904"
+       y2="118.11919" />
+    <linearGradient
+       id="linearGradient18103-1">
+      <stop
+         id="stop18105-2"
+         offset="0"
+         style="stop-color:#42035d;stop-opacity:1" />
+      <stop
+         id="stop18108-8"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118-0"
+       id="radialGradient18266-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.09893643,0.88659058,-0.70877161,0.07913125,199.3109,-8.5183197)"
+       cx="129.83784"
+       cy="115.58929"
+       fx="129.83784"
+       fy="115.58929"
+       r="8.781251" />
+    <linearGradient
+       id="linearGradient18118-0">
+      <stop
+         style="stop-color:#d297eb;stop-opacity:1;"
+         offset="0"
+         id="stop18120-4" />
+      <stop
+         style="stop-color:#a329d6;stop-opacity:1;"
+         offset="1"
+         id="stop18122-52" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134-0"
+       id="linearGradient18268-0"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="136.95143"
+       y2="123.69764" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient18134-0">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop18136-2" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop18138-5" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118-8"
+       id="radialGradient19005"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.6671799,6.7886038e-8,-6.7869731e-8,0.66734014,43.604995,38.604049)"
+       cx="129.99182"
+       cy="114.84092"
+       fx="129.99182"
+       fy="114.84092"
+       r="8.781251" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134-9"
+       id="linearGradient19007"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="137.67349"
+       y2="126.34584" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18103"
+       id="linearGradient19009"
+       gradientUnits="userSpaceOnUse"
+       x1="123.80045"
+       y1="111.03492"
+       x2="130.94904"
+       y2="118.11919" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118"
+       id="radialGradient19011"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.09893643,0.88659058,-0.70877161,0.07913125,199.3109,-8.5183197)"
+       cx="129.83784"
+       cy="115.58929"
+       fx="129.83784"
+       fy="115.58929"
+       r="8.7812506" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134"
+       id="linearGradient19013"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="136.95143"
+       y2="123.69764" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118-8"
+       id="radialGradient19034"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.6671799,6.7886038e-8,-6.7869731e-8,0.66734014,43.604995,38.604049)"
+       cx="129.99182"
+       cy="114.84092"
+       fx="129.99182"
+       fy="114.84092"
+       r="8.781251" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134-9"
+       id="linearGradient19036"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="137.67349"
+       y2="126.34584" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18103"
+       id="linearGradient19038"
+       gradientUnits="userSpaceOnUse"
+       x1="123.80045"
+       y1="111.03492"
+       x2="130.94904"
+       y2="118.11919" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18118"
+       id="radialGradient19040"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.09893643,0.88659058,-0.70877161,0.07913125,199.3109,-8.5183197)"
+       cx="129.83784"
+       cy="115.58929"
+       fx="129.83784"
+       fy="115.58929"
+       r="8.7812506" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient18134"
+       id="linearGradient19042"
+       gradientUnits="userSpaceOnUse"
+       x1="121.48092"
+       y1="105.24046"
+       x2="136.95143"
+       y2="123.69764" />
+    <linearGradient
+       id="linearGradient40455-7-1-5">
+      <stop
+         id="stop40457-6-6-2"
+         offset="0"
+         style="stop-color:#fff991;stop-opacity:1;" />
+      <stop
+         id="stop40459-1-8-5"
+         offset="1"
+         style="stop-color:#fffbb9;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient40578-4-8-7-6">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop40580-8-9-6-8" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop40582-6-8-1-2" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient58334-9-6">
+      <stop
+         id="stop58336-27-0"
+         offset="0.0000000"
+         style="stop-color:#ffffff;stop-opacity:0.87628865;" />
+      <stop
+         id="stop58338-9-7"
+         offset="1.0000000"
+         style="stop-color:#fffffe;stop-opacity:0.0000000;" />
+    </linearGradient>
+    <linearGradient
+       y2="305"
+       x2="758"
+       y1="300.83292"
+       x1="754.28558"
+       gradientTransform="translate(1,-94.999998)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient37610-3-9"
+       xlink:href="#linearGradient16500-4-9"
+       inkscape:collect="always" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient16500-4-9">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop16502-31-5" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop16504-23-4" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient40455-7-1-5-1">
+      <stop
+         id="stop40457-6-6-2-9"
+         offset="0"
+         style="stop-color:#fff991;stop-opacity:1;" />
+      <stop
+         id="stop40459-1-8-5-0"
+         offset="1"
+         style="stop-color:#fffbb9;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient40578-4-8-7-6-5">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop40580-8-9-6-8-2" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop40582-6-8-1-2-8" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient58334-9-6-3">
+      <stop
+         id="stop58336-27-0-6"
+         offset="0.0000000"
+         style="stop-color:#ffffff;stop-opacity:0.87628865;" />
+      <stop
+         id="stop58338-9-7-0"
+         offset="1.0000000"
+         style="stop-color:#fffffe;stop-opacity:0.0000000;" />
+    </linearGradient>
+    <linearGradient
+       y2="305"
+       x2="758"
+       y1="300.83292"
+       x1="754.28558"
+       gradientTransform="translate(1,-94.999998)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient15428-6"
+       xlink:href="#linearGradient16500-4-9-3"
+       inkscape:collect="always" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient16500-4-9-3">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop16502-31-5-8" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop16504-23-4-6" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient37542-8-6">
+      <stop
+         id="stop37544-64-8"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-5-9"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1610-93-2">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-83-7" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-0-7" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-715-2">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-74-6" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-58-1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15669">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15671" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15673" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15683-0">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15685" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15687" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-715-8">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-74-0" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-58-2" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15876">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15878" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15880" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15883">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15885" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15887" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15894">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15896" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15898" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5060-97-8">
+      <stop
+         id="stop5062-5-3"
+         offset="0"
+         style="stop-color:black;stop-opacity:1;" />
+      <stop
+         id="stop5064-5-0"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15905">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15907" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15909" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient37542-8-7">
+      <stop
+         id="stop37544-64-6"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-5-6"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1610-93-1">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-83-5" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-0-1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-715-5">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-74-63" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-58-9" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16099">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16101" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16103-5" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16113">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16115" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16117" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient37542-8-78">
+      <stop
+         id="stop37544-64-1"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-5-0"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1610-93-9">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-83-8" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-0-3" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-715-9">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-74-4" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-58-8" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16099-6">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16101-5" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16103-7" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16113-7">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop16115-6" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop16117-5" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15806"
+       id="linearGradient15581"
+       gradientUnits="userSpaceOnUse"
+       x1="212.0226"
+       y1="361.34204"
+       x2="189.32315"
+       y2="340.89514" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15796"
+       id="linearGradient15583"
+       gradientUnits="userSpaceOnUse"
+       x1="192.4323"
+       y1="348.13098"
+       x2="208.33328"
+       y2="359.81409" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15796"
+       id="linearGradient16354"
+       gradientUnits="userSpaceOnUse"
+       x1="189.32315"
+       y1="340.89514"
+       x2="205.17293"
+       y2="357.81213" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15806"
+       id="linearGradient16399"
+       gradientUnits="userSpaceOnUse"
+       x1="212.0226"
+       y1="361.34204"
+       x2="189.32315"
+       y2="340.89514" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15796"
+       id="linearGradient16401"
+       gradientUnits="userSpaceOnUse"
+       x1="189.32315"
+       y1="340.89514"
+       x2="205.17293"
+       y2="357.81213" />
+    <linearGradient
+       id="linearGradient319-57">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-20" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-83" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15625">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15627" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15629" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient15632">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15634" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15636" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient23974-3-78-2">
+      <stop
+         id="stop23976-6-5-7"
+         offset="0"
+         style="stop-color:#a3a3a3;stop-opacity:1" />
+      <stop
+         id="stop23978-2-4-4"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16504-0-4">
+      <stop
+         id="stop16506-3-6"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1" />
+      <stop
+         id="stop16508-0-1"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-47-9-0">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-85-3-9" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-48-3-6" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-12-5-0"
+       id="linearGradient42487-4-5-2"
+       gradientUnits="userSpaceOnUse"
+       x1="130.39502"
+       y1="116.31751"
+       x2="140.66667"
+       y2="125.94853" />
+    <linearGradient
+       id="linearGradient319-12-5-0">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-34-1-3" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-81-9-0" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15425-8-7-5"
+       id="linearGradient42489-5-9-1"
+       gradientUnits="userSpaceOnUse"
+       x1="123.26987"
+       y1="108.56933"
+       x2="138.25778"
+       y2="124.59384" />
+    <linearGradient
+       id="linearGradient15425-8-7-5">
+      <stop
+         style="stop-color:#8c0000;stop-opacity:1;"
+         offset="0"
+         id="stop15427-5-9-7" />
+      <stop
+         style="stop-color:#c80000;stop-opacity:0;"
+         offset="1"
+         id="stop15429-7-2-8" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-12-5-0"
+       id="linearGradient42491-0-9-1"
+       gradientUnits="userSpaceOnUse"
+       x1="130.39502"
+       y1="116.31751"
+       x2="140.66667"
+       y2="125.94853" />
+    <linearGradient
+       id="linearGradient15695">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop15697" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop15699" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient15425-8-7-5"
+       id="linearGradient17232-8-1"
+       gradientUnits="userSpaceOnUse"
+       x1="123.26987"
+       y1="108.56933"
+       x2="141.64546"
+       y2="130.81215" />
+    <linearGradient
+       id="linearGradient15702">
+      <stop
+         style="stop-color:#8c0000;stop-opacity:1;"
+         offset="0"
+         id="stop15704" />
+      <stop
+         style="stop-color:#c80000;stop-opacity:0;"
+         offset="1"
+         id="stop15706" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-0"
+       id="linearGradient42326-4"
+       gradientUnits="userSpaceOnUse"
+       x1="124.8772"
+       y1="110.75571"
+       x2="133.97179"
+       y2="117.77643" />
+    <linearGradient
+       id="linearGradient10069-0">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-75" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-1" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-44"
+       id="linearGradient42328-9"
+       gradientUnits="userSpaceOnUse"
+       x1="129.32576"
+       y1="223.61363"
+       x2="123.33967"
+       y2="217.06438" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient16500-44">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop16502-2" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop16504-9" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-54"
+       id="linearGradient42330-3"
+       gradientUnits="userSpaceOnUse"
+       x1="130.39502"
+       y1="116.31751"
+       x2="142.64723"
+       y2="129.05313" />
+    <linearGradient
+       id="linearGradient319-54">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-68" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-7" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-54"
+       id="linearGradient16613"
+       gradientUnits="userSpaceOnUse"
+       x1="130.39502"
+       y1="116.31751"
+       x2="142.64723"
+       y2="129.05313" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-07"
+       id="linearGradient14167-8"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-636.98388,52.01562)"
+       x1="443.86667"
+       y1="133.98936"
+       x2="451.98389"
+       y2="143.58749" />
+    <linearGradient
+       id="linearGradient37542-07">
+      <stop
+         id="stop37544-66"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-6"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4138-3"
+       id="linearGradient14169-0"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-635.98388,53.01562)"
+       x1="456.03769"
+       y1="135.76678"
+       x2="453.61005"
+       y2="133.00301" />
+    <linearGradient
+       id="linearGradient4138-3">
+      <stop
+         style="stop-color:#6c432f;stop-opacity:1;"
+         offset="0"
+         id="stop4140-2" />
+      <stop
+         style="stop-color:#c0966d;stop-opacity:1;"
+         offset="1"
+         id="stop4142-0" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-07"
+       id="linearGradient14171-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-636.98388,52.01562)"
+       x1="449.14645"
+       y1="136.18045"
+       x2="453.24457"
+       y2="138.7879" />
+    <linearGradient
+       id="linearGradient16636">
+      <stop
+         id="stop16638"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop16640"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4138-3"
+       id="linearGradient14173-8"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-635.98388,53.01562)"
+       x1="456.03769"
+       y1="135.76678"
+       x2="454.31345"
+       y2="133.62801" />
+    <linearGradient
+       id="linearGradient16643">
+      <stop
+         style="stop-color:#6c432f;stop-opacity:1;"
+         offset="0"
+         id="stop16645" />
+      <stop
+         style="stop-color:#c0966d;stop-opacity:1;"
+         offset="1"
+         id="stop16647" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-2"
+       id="linearGradient14167-87"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-636.98388,52.01562)"
+       x1="443.86667"
+       y1="133.98936"
+       x2="451.98389"
+       y2="143.58749" />
+    <linearGradient
+       id="linearGradient37542-2">
+      <stop
+         id="stop37544-5"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-1"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4138-39"
+       id="linearGradient14169-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-635.98388,53.01562)"
+       x1="456.03769"
+       y1="135.76678"
+       x2="453.61005"
+       y2="133.00301" />
+    <linearGradient
+       id="linearGradient4138-39">
+      <stop
+         style="stop-color:#6c432f;stop-opacity:1;"
+         offset="0"
+         id="stop4140-0" />
+      <stop
+         style="stop-color:#c0966d;stop-opacity:1;"
+         offset="1"
+         id="stop4142-3" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-2"
+       id="linearGradient14171-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-636.98388,52.01562)"
+       x1="449.14645"
+       y1="136.18045"
+       x2="453.24457"
+       y2="138.7879" />
+    <linearGradient
+       id="linearGradient16738">
+      <stop
+         id="stop16740"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop16742"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4138-39"
+       id="linearGradient14173-89"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-635.98388,53.01562)"
+       x1="456.03769"
+       y1="135.76678"
+       x2="454.31345"
+       y2="133.62801" />
+    <linearGradient
+       id="linearGradient16745">
+      <stop
+         style="stop-color:#6c432f;stop-opacity:1;"
+         offset="0"
+         id="stop16747" />
+      <stop
+         style="stop-color:#c0966d;stop-opacity:1;"
+         offset="1"
+         id="stop16749" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-07-7"
+       id="linearGradient14167-8-4"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-636.98388,52.01562)"
+       x1="443.86667"
+       y1="133.98936"
+       x2="451.98389"
+       y2="143.58749" />
+    <linearGradient
+       id="linearGradient37542-07-7">
+      <stop
+         id="stop37544-66-6"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop37546-6-7"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4138-3-7"
+       id="linearGradient14169-0-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-635.98388,53.01562)"
+       x1="456.03769"
+       y1="135.76678"
+       x2="453.61005"
+       y2="133.00301" />
+    <linearGradient
+       id="linearGradient4138-3-7">
+      <stop
+         style="stop-color:#6c432f;stop-opacity:1;"
+         offset="0"
+         id="stop4140-2-0" />
+      <stop
+         style="stop-color:#c0966d;stop-opacity:1;"
+         offset="1"
+         id="stop4142-0-7" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient37542-07-7"
+       id="linearGradient14171-2-5"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-636.98388,52.01562)"
+       x1="449.14645"
+       y1="136.18045"
+       x2="453.24457"
+       y2="138.7879" />
+    <linearGradient
+       id="linearGradient16840">
+      <stop
+         id="stop16842-2"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop16844"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4138-3-7"
+       id="linearGradient14173-8-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-635.98388,53.01562)"
+       x1="456.03769"
+       y1="135.76678"
+       x2="454.31345"
+       y2="133.62801" />
+    <linearGradient
+       id="linearGradient16847">
+      <stop
+         style="stop-color:#6c432f;stop-opacity:1;"
+         offset="0"
+         id="stop16849" />
+      <stop
+         style="stop-color:#c0966d;stop-opacity:1;"
+         offset="1"
+         id="stop16851" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-9"
+       id="linearGradient42346-4"
+       gradientUnits="userSpaceOnUse"
+       x1="-57.780041"
+       y1="48.005856"
+       x2="-78.812721"
+       y2="31" />
+    <linearGradient
+       id="linearGradient319-9">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-98" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-56" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-9"
+       id="linearGradient42344-3"
+       gradientUnits="userSpaceOnUse"
+       x1="-69.457596"
+       y1="31.914484"
+       x2="-76.564636"
+       y2="28.695114" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient16500-9">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop16502-21" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop16504-8" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-22"
+       id="linearGradient42346-5"
+       gradientUnits="userSpaceOnUse"
+       x1="-57.780041"
+       y1="48.005856"
+       x2="-78.812721"
+       y2="31" />
+    <linearGradient
+       id="linearGradient319-22">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-61" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-3" />
+    </linearGradient>
+    <linearGradient
+       y2="31"
+       x2="-78.812721"
+       y1="48.005856"
+       x1="-57.780041"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient17071"
+       xlink:href="#linearGradient319-22"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient319-91">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-1" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-01" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient13938-6">
+      <stop
+         id="stop13940-6"
+         offset="0"
+         style="stop-color:#6e0c00;stop-opacity:1;" />
+      <stop
+         id="stop13942-0"
+         offset="1"
+         style="stop-color:#ee3800;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient29073">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop29075" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop29077" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient16595-2">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop16597-8" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop16599-9" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient319-1-7-5-6">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-4-4-3-0" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-0-0-8-6" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1610-3">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-3" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient40578-4-8-1">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop40580-8-9-2" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop40582-6-8-4" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient58334-93">
+      <stop
+         id="stop58336-4"
+         offset="0.0000000"
+         style="stop-color:#ffffff;stop-opacity:0.87628865;" />
+      <stop
+         id="stop58338-1"
+         offset="1.0000000"
+         style="stop-color:#fffffe;stop-opacity:0.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient16500-5"
+       id="linearGradient39260-4"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(0,-95.999998)"
+       x1="754.28558"
+       y1="300.83292"
+       x2="758"
+       y2="305" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient16500-5">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop16502-311" />
+      <stop
+         style="stop-color:black;stop-opacity:0;"
+         offset="1"
+         id="stop16504-5" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask43050-6">
+      <rect
+         y="-122"
+         x="-24"
+         height="14"
+         width="16"
+         id="rect43052-3"
+         style="opacity:0.5;fill:url(#linearGradient43054-6);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="linearGradient43054-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.3333333,0,0,1.2727273,2.6666667,29.454545)"
+       x1="-4.2231579"
+       y1="-92.440941"
+       x2="-18.697306"
+       y2="-115.04018" />
+    <linearGradient
+       id="linearGradient44627-7">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop44629-4" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop44631-0" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-5-1-8-2-5"
+       id="radialGradient24295-1"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.1558466,-0.5928702,0.3902392,0.7608013,47.408342,-36.891937)"
+       cx="-14.226811"
+       cy="-115.06647"
+       fx="-14.226811"
+       fy="-115.06647"
+       r="7.1500001" />
+    <linearGradient
+       id="linearGradient10069-9-5-1-8-2-5">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-43-3-0-0-4" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-1-8-2-5-2" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-5-1-8-2-5"
+       id="radialGradient24297-0"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.3236133,-0.01520056,0.01787935,0.3806433,-7.6938144,-72.764853)"
+       cx="-20.110701"
+       cy="-125.53457"
+       fx="-20.110701"
+       fy="-125.53457"
+       r="7.1500001" />
+    <linearGradient
+       id="linearGradient13837">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop13839" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop13841" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-74-1"
+       id="radialGradient24299-9"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.0312701,-2.5000045,2.468554,-0.03087567,251.90641,-216.06454)"
+       cx="-39.154209"
+       cy="-118.1383"
+       fx="-39.154209"
+       fy="-118.1383"
+       r="1" />
+    <linearGradient
+       id="linearGradient10069-9-7-4-74-1">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-4-5-0-5" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-0-5-9-2" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-74-1"
+       id="linearGradient33126-9"
+       gradientUnits="userSpaceOnUse"
+       x1="110.81759"
+       y1="99.274445"
+       x2="131.81595"
+       y2="116.38528" />
+    <linearGradient
+       id="linearGradient13848">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop13850" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop13852" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-8-5"
+       id="linearGradient33128-2"
+       gradientUnits="userSpaceOnUse"
+       x1="128.0486"
+       y1="112.48544"
+       x2="135.0885"
+       y2="121.2344" />
+    <linearGradient
+       id="linearGradient44939-8-5">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop44941-8-1" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop44943-2-7" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask48816-8">
+      <rect
+         y="-84"
+         x="-44"
+         height="14"
+         width="13"
+         id="rect48818-4"
+         style="opacity:0.85;fill:url(#radialGradient48820-9);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" />
+    </mask>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="radialGradient48820-9"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,1.0769231,0,5.9230769)"
+       cx="-31"
+       cy="-83.5"
+       fx="-31"
+       fy="-83.5"
+       r="6.5" />
+    <linearGradient
+       id="linearGradient13861">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop13863" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop13865" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24279-6"
+       gradientUnits="userSpaceOnUse"
+       x1="122.80294"
+       y1="107.95783"
+       x2="133.00108"
+       y2="118.79662" />
+    <linearGradient
+       id="linearGradient10069-9-7-4-4">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-4-5-8" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-0-5-6" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24281-3"
+       gradientUnits="userSpaceOnUse"
+       x1="127.94764"
+       y1="111.77869"
+       x2="139.37589"
+       y2="126.95278" />
+    <linearGradient
+       id="linearGradient44939-09">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop44941-0" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop44943-0" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask13875">
+      <rect
+         y="-84"
+         x="-44"
+         height="14"
+         width="13"
+         id="rect13877"
+         style="opacity:0.85;fill:url(#radialGradient48820-9);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" />
+    </mask>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="radialGradient13879"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,1.0769231,0,5.9230769)"
+       cx="-31"
+       cy="-83.5"
+       fx="-31"
+       fy="-83.5"
+       r="6.5" />
+    <linearGradient
+       id="linearGradient13881">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop13883" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop13885" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24283-7"
+       gradientUnits="userSpaceOnUse"
+       x1="122.80294"
+       y1="107.95783"
+       x2="133.00108"
+       y2="118.79662" />
+    <linearGradient
+       id="linearGradient13888">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop13890" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop13892" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24285-8"
+       gradientUnits="userSpaceOnUse"
+       x1="127.94764"
+       y1="111.77869"
+       x2="139.90622"
+       y2="126.33406" />
+    <linearGradient
+       id="linearGradient13895">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop13897" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop13899" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask28585-8">
+      <rect
+         style="opacity:0.85;fill:url(#radialGradient28589-9);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+         id="rect28587-2"
+         width="13"
+         height="14"
+         x="-44"
+         y="-84" />
+    </mask>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="radialGradient28589-9"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,1.0769231,0,5.9230769)"
+       cx="-30.28125"
+       cy="-84.341515"
+       fx="-30.28125"
+       fy="-84.341515"
+       r="6.5" />
+    <linearGradient
+       id="linearGradient13904">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop13906" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop13908" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24287-1"
+       gradientUnits="userSpaceOnUse"
+       x1="122.80294"
+       y1="107.95783"
+       x2="133.00108"
+       y2="118.79662" />
+    <linearGradient
+       id="linearGradient13911">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop13913" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop13915" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24289-3"
+       gradientUnits="userSpaceOnUse"
+       x1="127.94764"
+       y1="111.77869"
+       x2="141.05528"
+       y2="129.25089" />
+    <linearGradient
+       id="linearGradient13918">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop13920" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop13922" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24241-6"
+       gradientUnits="userSpaceOnUse"
+       x1="128.72093"
+       y1="113.87833"
+       x2="134.73141"
+       y2="121.3562" />
+    <linearGradient
+       id="linearGradient13925">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop13927" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop13929" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24243-1"
+       gradientUnits="userSpaceOnUse"
+       x1="127.94764"
+       y1="111.77869"
+       x2="140.59081"
+       y2="129.0453" />
+    <linearGradient
+       id="linearGradient13932">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop13934" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop13936" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24245-3"
+       gradientUnits="userSpaceOnUse"
+       x1="122.85946"
+       y1="108.45374"
+       x2="132.08098"
+       y2="118.71043" />
+    <linearGradient
+       id="linearGradient13939">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop13941" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop13943" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24247-8"
+       gradientUnits="userSpaceOnUse"
+       x1="127.94764"
+       y1="111.77869"
+       x2="142.87355"
+       y2="131.66185" />
+    <linearGradient
+       id="linearGradient13946">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop13948" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop13950" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient43271-3"
+       id="linearGradient24249-9"
+       gradientUnits="userSpaceOnUse"
+       x1="-38.5"
+       y1="-52.5"
+       x2="-37"
+       y2="-54" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient43271-3">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop43273-4" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop43275-4" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient43271-3"
+       id="linearGradient24251-6"
+       gradientUnits="userSpaceOnUse"
+       x1="-43.5"
+       y1="-56"
+       x2="-39"
+       y2="-52" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24253-0"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.2489483,0,0,0.2448135,-72.383415,-81.330431)"
+       x1="135.91603"
+       y1="121.04676"
+       x2="125.4409"
+       y2="99.924934" />
+    <linearGradient
+       id="linearGradient13964">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop13966" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop13968" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient43271-3"
+       id="linearGradient24255-6"
+       gradientUnits="userSpaceOnUse"
+       x1="130.92398"
+       y1="110.40864"
+       x2="122.93221"
+       y2="108.93221" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24257-6"
+       gradientUnits="userSpaceOnUse"
+       x1="122.80294"
+       y1="107.95783"
+       x2="133.00108"
+       y2="118.79662" />
+    <linearGradient
+       id="linearGradient13978">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop13980" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop13982" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24259-1"
+       gradientUnits="userSpaceOnUse"
+       x1="127.94764"
+       y1="111.77869"
+       x2="144.59082"
+       y2="133.6703" />
+    <linearGradient
+       id="linearGradient13985">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop13987" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop13989" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask43040-7">
+      <rect
+         style="opacity:0.5;fill:url(#linearGradient43044-5);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect43042-9"
+         width="15"
+         height="16"
+         x="-45.04018"
+         y="-24"
+         rx="0"
+         ry="0" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient43760-6-4"
+       id="linearGradient43044-5"
+       gradientUnits="userSpaceOnUse"
+       x1="-44.709698"
+       y1="-8.4836445"
+       x2="-37.784756"
+       y2="-18.517523"
+       gradientTransform="translate(-0.04018164,0)" />
+    <linearGradient
+       id="linearGradient43760-6-4">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop43762-7-3" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop43764-8-1" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient9030-71-3"
+       id="linearGradient24236-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,-1,-242.99992,269.00357)"
+       x1="202.85626"
+       y1="276.47174"
+       x2="212.82164"
+       y2="288.37567" />
+    <linearGradient
+       id="linearGradient9030-71-3">
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="0"
+         id="stop9032-15-3" />
+      <stop
+         style="stop-color:white;stop-opacity:0;"
+         offset="1"
+         id="stop9034-276-4" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-5-1-1"
+       id="linearGradient24239-1"
+       gradientUnits="userSpaceOnUse"
+       x1="125.93652"
+       y1="111.8362"
+       x2="132.65851"
+       y2="117.92533" />
+    <linearGradient
+       id="linearGradient10069-9-5-1-1">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-43-3-3" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-1-8-8" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-5-1-1"
+       id="linearGradient24230-5"
+       gradientUnits="userSpaceOnUse"
+       x1="117.00603"
+       y1="104.51898"
+       x2="132.99687"
+       y2="118.98331" />
+    <linearGradient
+       id="linearGradient14006">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop14008" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop14010" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-2-8"
+       id="linearGradient24232-9"
+       gradientUnits="userSpaceOnUse"
+       x1="128.0486"
+       y1="112.48544"
+       x2="139.58116"
+       y2="126.8241" />
+    <linearGradient
+       id="linearGradient44939-2-8">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop44941-7-4" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop44943-7-0" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-5-1-1"
+       id="linearGradient24234-7"
+       gradientUnits="userSpaceOnUse"
+       x1="117.00603"
+       y1="104.51898"
+       x2="132.99687"
+       y2="118.98331" />
+    <linearGradient
+       id="linearGradient14017">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop14019" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop14021" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask45865-7">
+      <g
+         id="g45867-3"
+         transform="translate(-14,0)">
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cssssssc"
+           id="path45869-7"
+           d="m -25.801826,-135.3217 c -0.907684,-0.32824 -0.906457,-1.55361 -0.440107,-2.23642 0.834186,-1.22138 2.593738,-1.15244 3.63669,-0.26277 1.530569,1.30563 1.388406,3.6923 0.08107,5.09763 -1.742467,1.8731 -4.73519,1.65156 -6.47424,-0.0993 -2.188413,-2.20322 -1.889457,-5.85971 0.277965,-7.95885 2.625036,-2.54234 6.931515,-2.199 9.311783,0.46129 2.764074,3.08924 2.372937,7.82808 -0.06591,10.77438"
+           style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           mask="none" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cc"
+           id="path45871-2"
+           d="m -19.40866,-140.32008 c 2.764074,3.08924 2.372937,7.82808 -0.06591,10.77438"
+           style="fill:none;stroke:url(#linearGradient45875-0);stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+        <path
+           inkscape:connector-curvature="0"
+           mask="none"
+           style="fill:none;stroke:url(#radialGradient45877-1);stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           d="m -25.801826,-135.3217 c -0.907684,-0.32824 -0.906457,-1.55361 -0.440107,-2.23642 0.834186,-1.22138 2.593738,-1.15244 3.63669,-0.26277"
+           id="path45873-6"
+           sodipodi:nodetypes="css" />
+      </g>
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient43760-7"
+       id="linearGradient45875-0"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(14,0)"
+       x1="-34.051685"
+       y1="-129.32457"
+       x2="-32.542458"
+       y2="-139.90228" />
+    <linearGradient
+       id="linearGradient43760-7">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop43762-79" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop43764-3" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient43760-7"
+       id="radialGradient45877-1"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.1099414,-0.9422316,0.4519816,0.05273803,38.220416,-152.21215)"
+       cx="-25.452209"
+       cy="-136.46503"
+       fx="-25.452209"
+       fy="-136.46503"
+       r="8.0066185" />
+    <linearGradient
+       id="linearGradient14033">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14035" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14037" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask45447-7">
+      <rect
+         ry="0"
+         style="opacity:0.8;fill:url(#radialGradient45451-2);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect45449-4"
+         width="15"
+         height="15"
+         x="216"
+         y="366" />
+    </mask>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient43760-7"
+       id="radialGradient45451-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9952162,167.99999,-60.91415)"
+       cx="59.000011"
+       cy="440.0191"
+       fx="59.000011"
+       fy="440.0191"
+       r="6.5080619" />
+    <linearGradient
+       id="linearGradient14042">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14044" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14046" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-42-9"
+       id="linearGradient24218-1"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9166695,0,0,0.9203753,-10.025729,345.78566)"
+       x1="80.60067"
+       y1="108.47212"
+       x2="68.0271"
+       y2="94.239906" />
+    <linearGradient
+       id="linearGradient319-42-9">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-32-8" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-21-6" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-0"
+       id="linearGradient24220-5"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-15.983875,338)"
+       x1="70.55275"
+       y1="97.5"
+       x2="79.355118"
+       y2="107.18619" />
+    <linearGradient
+       id="linearGradient10069-9-7-0">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-4-2" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-0-8" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient319-42-9"
+       id="linearGradient24222-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9998599,0,0,0.9960071,-15.972985,338.41149)"
+       x1="61.465469"
+       y1="88.058716"
+       x2="86.00116"
+       y2="112.03586" />
+    <linearGradient
+       id="linearGradient14057">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop14059" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop14061" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-0"
+       id="radialGradient24224-0"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9952162,0,2.085841)"
+       cx="60.007744"
+       cy="441.04678"
+       fx="60.007744"
+       fy="441.04678"
+       r="6.5080619" />
+    <linearGradient
+       id="linearGradient14064">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop14066" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop14068" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24226-2"
+       gradientUnits="userSpaceOnUse"
+       x1="113.01286"
+       y1="99.778664"
+       x2="132"
+       y2="118" />
+    <linearGradient
+       id="linearGradient14071">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop14073" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop14075" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24228-5"
+       gradientUnits="userSpaceOnUse"
+       x1="128.0486"
+       y1="112.48544"
+       x2="136.08115"
+       y2="122.99075" />
+    <linearGradient
+       id="linearGradient14078">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop14080" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop14082" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-4"
+       id="linearGradient24214-1"
+       gradientUnits="userSpaceOnUse"
+       x1="118.73534"
+       y1="106.55459"
+       x2="133.00108"
+       y2="118.79662" />
+    <linearGradient
+       id="linearGradient14085">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop14087" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop14089" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-09"
+       id="linearGradient24216-4"
+       gradientUnits="userSpaceOnUse"
+       x1="127.94764"
+       y1="111.77869"
+       x2="140.59081"
+       y2="129.0453" />
+    <linearGradient
+       id="linearGradient14092">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop14094" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop14096" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath43135-6">
+      <path
+         inkscape:connector-curvature="0"
+         id="path43137-1"
+         d="m -46,52 16,-16 -16,0 0,16 z"
+         style="opacity:0.5;fill:#ffff00;fill-rule:evenodd;stroke:none" />
+    </clipPath>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask43188-4">
+      <path
+         inkscape:connector-curvature="0"
+         style="opacity:0.5;fill:url(#linearGradient43192-3);fill-rule:evenodd;stroke:none"
+         d="m -46,52 16,-16 -16,0 0,16 z"
+         id="path43190-2" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-5-2"
+       id="linearGradient43192-3"
+       gradientUnits="userSpaceOnUse"
+       x1="-47"
+       y1="44"
+       x2="-43"
+       y2="44" />
+    <linearGradient
+       id="linearGradient1610-5-2">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop1611-17-2" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop1612-115-1" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath43178-6">
+      <path
+         inkscape:connector-curvature="0"
+         style="opacity:0.5;fill:#ffff00;fill-rule:evenodd;stroke:none"
+         d="m -30,36 -1,0 -15,15 0,1 16,0 0,-16 z"
+         id="path43180-8"
+         sodipodi:nodetypes="cccccc" />
+    </clipPath>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask43182-5">
+      <path
+         inkscape:connector-curvature="0"
+         id="path43184-7"
+         d="m -46,52 0,-1 15,-15 1,0 0,16 -16,0 z"
+         style="opacity:0.5;fill:url(#linearGradient43186-6);fill-rule:evenodd;stroke:none"
+         sodipodi:nodetypes="cccccc" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-5-2"
+       id="linearGradient43186-6"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0,-1,-1,0,6,6)"
+       x1="-47"
+       y1="44"
+       x2="-43"
+       y2="44" />
+    <linearGradient
+       id="linearGradient14111">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14113" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14115" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath14117">
+      <path
+         inkscape:connector-curvature="0"
+         style="opacity:0.5;fill:#ffff00;fill-rule:evenodd;stroke:none"
+         d="m -30,36 -1,0 -15,15 0,1 16,0 0,-16 z"
+         id="path14119"
+         sodipodi:nodetypes="cccccc" />
+    </clipPath>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask14121">
+      <path
+         inkscape:connector-curvature="0"
+         id="path14123"
+         d="m -46,52 0,-1 15,-15 1,0 0,16 -16,0 z"
+         style="opacity:0.5;fill:url(#linearGradient43186-6);fill-rule:evenodd;stroke:none"
+         sodipodi:nodetypes="cccccc" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-5-2"
+       id="linearGradient14125"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0,-1,-1,0,6,6)"
+       x1="-47"
+       y1="44"
+       x2="-43"
+       y2="44" />
+    <linearGradient
+       id="linearGradient14127">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14129" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14131" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath14133">
+      <path
+         inkscape:connector-curvature="0"
+         id="path14135"
+         d="m -46,52 16,-16 -16,0 0,16 z"
+         style="opacity:0.5;fill:#ffff00;fill-rule:evenodd;stroke:none" />
+    </clipPath>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask14137">
+      <path
+         inkscape:connector-curvature="0"
+         style="opacity:0.5;fill:url(#linearGradient43192-3);fill-rule:evenodd;stroke:none"
+         d="m -46,52 16,-16 -16,0 0,16 z"
+         id="path14139" />
+    </mask>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-5-2"
+       id="linearGradient14141"
+       gradientUnits="userSpaceOnUse"
+       x1="-47"
+       y1="44"
+       x2="-43"
+       y2="44" />
+    <linearGradient
+       id="linearGradient14143">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14145" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14147" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-74-1"
+       id="linearGradient24210-1"
+       gradientUnits="userSpaceOnUse"
+       x1="110.81759"
+       y1="99.274445"
+       x2="131.81595"
+       y2="116.38528" />
+    <linearGradient
+       id="linearGradient14150">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop14152" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop14154" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-8-5"
+       id="linearGradient24212-8"
+       gradientUnits="userSpaceOnUse"
+       x1="128.0486"
+       y1="112.48544"
+       x2="135.0885"
+       y2="121.2344" />
+    <linearGradient
+       id="linearGradient14157">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop14159" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop14161" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="linearGradient24044-1"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(21,0)"
+       x1="44.380783"
+       y1="251.66991"
+       x2="36.415714"
+       y2="247.47705" />
+    <linearGradient
+       id="linearGradient14164">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14166" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14168" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="linearGradient24046-9"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(21,0)"
+       x1="35.434578"
+       y1="250.11682"
+       x2="34"
+       y2="244" />
+    <linearGradient
+       id="linearGradient14171-1">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14173" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14175" />
+    </linearGradient>
+    <mask
+       maskUnits="userSpaceOnUse"
+       id="mask25021-4">
+      <rect
+         style="fill:url(#radialGradient25025-8);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect25023-8"
+         width="13"
+         height="14"
+         x="26"
+         y="243" />
+    </mask>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="radialGradient25025-8"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.8918342,0,0,0.8918344,-15.699877,27.900732)"
+       cx="49"
+       cy="254.64285"
+       fx="49"
+       fy="254.64285"
+       r="6.5" />
+    <linearGradient
+       id="linearGradient14180">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14182" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14184" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="radialGradient24048-2"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0474269,0.00526965,-0.00503098,0.9999873,-0.01415572,-0.141212)"
+       cx="27.411026"
+       cy="255.58899"
+       fx="27.411026"
+       fy="255.58899"
+       r="5.9250002" />
+    <linearGradient
+       id="linearGradient14187">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14189" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14191" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44627-7"
+       id="radialGradient24050-4"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0474269,0.00526965,-0.00503098,0.9999873,-0.01415572,-0.141212)"
+       cx="27.411026"
+       cy="255.58899"
+       fx="27.411026"
+       fy="255.58899"
+       r="5.9250002" />
+    <linearGradient
+       id="linearGradient14194">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14196" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14198" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-8-5"
+       id="linearGradient24053-5"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(21,0)"
+       x1="44.751385"
+       y1="254.98178"
+       x2="34.110981"
+       y2="244.60397" />
+    <linearGradient
+       id="linearGradient14201">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop14203" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop14205" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-4-74-1"
+       id="linearGradient24055-1"
+       gradientUnits="userSpaceOnUse"
+       x1="110.81759"
+       y1="99.274445"
+       x2="131.81595"
+       y2="116.38528" />
+    <linearGradient
+       id="linearGradient14208">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop14210" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop14212" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient44939-8-5"
+       id="linearGradient24057-7"
+       gradientUnits="userSpaceOnUse"
+       x1="128.0486"
+       y1="112.48544"
+       x2="137.44791"
+       y2="125.06842" />
+    <linearGradient
+       id="linearGradient14215">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop14217" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop14219" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10069-9-7-5-5"
+       id="linearGradient24022-6"
+       gradientUnits="userSpaceOnUse"
+       x1="-33.912659"
+       y1="-143.20003"
+       x2="-35.580078"
+       y2="-159.1228" />
+    <linearGradient
+       id="linearGradient10069-9-7-5-5">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop10071-5-4-58-7" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop10073-43-0-4-5" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient1610-5-2"
+       id="linearGradient24024-4"
+       gradientUnits="userSpaceOnUse"
+       x1="-41.5"
+       y1="-161.74199"
+       x2="-40.654259"
+       y2="-147.07195" />
+    <linearGradient
+       id="linearGradient14226">
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0"
+         id="stop14228" />
+      <stop
+         style="stop-color:white;stop-opacity:1;"
+         offset="1"
+         id="stop14230" />
+    </linearGradient>
+    <linearGradient
+       y2="-156.42979"
+       x2="-37.567211"
+       y1="-148.8125"
+       x1="-34.09375"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient61917"
+       xlink:href="#linearGradient319-76-2-0"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient319-76-2-0">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop320-142-0" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop321-32-0" />
+    </linearGradient>
+    <linearGradient
+       y2="-156.42979"
+       x2="-37.567211"
+       y1="-148.8125"
+       x1="-34.09375"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient14482-7"
+       xlink:href="#linearGradient319-76-2-0"
+       inkscape:collect="always" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10000"
+     objecttolerance="10000"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.2953846"
+     inkscape:cx="449.16029"
+     inkscape:cy="319"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer3"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="750"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:snap-nodes="false"
+     inkscape:snap-bbox="true"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:object-nodes="false"
+     inkscape:object-paths="false"
+     inkscape:snap-intersection-line-segments="true"
+     inkscape:snap-intersection-grid-guide="false"
+     inkscape:window-maximized="1"
+     inkscape:bbox-paths="false"
+     inkscape:snap-global="true"
+     inkscape:snap-bbox-midpoints="false"
+     inkscape:snap-grids="true"
+     inkscape:snap-to-guides="false"
+     inkscape:snap-page="false"
+     units="pt"
+     inkscape:snap-center="false"
+     inkscape:snap-object-midpoints="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid17394"
+       visible="true"
+       enabled="true"
+       spacingx="0.25px"
+       spacingy="0.25px"
+       empspacing="4"
+       color="#808080"
+       opacity="0.09803922"
+       dotted="false"
+       empcolor="#7f7f7f"
+       empopacity="0.25098039"
+       snapvisiblegridlinesonly="true"
+       originx="0px"
+       originy="-2.7755576e-17px" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>Blender icons v. 2.5.08</dc:title>
+        <dc:date>21.05.2012</dc:date>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Andrzej Ambroż</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:rights>
+          <cc:Agent>
+            <dc:title>Andrzej Ambroż</dc:title>
+          </cc:Agent>
+        </dc:rights>
+        <dc:publisher>
+          <cc:Agent>
+            <dc:title>Andrzej Ambroż</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:coverage />
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/by-nc-sa/3.0/" />
+        <dc:description>This content is under CC Attribution-NonCommercial ShareAlike licence 3.0 as long as it's used for Blender 3D GUI. Any other uses are not allowed.</dc:description>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/by-nc-sa/3.0/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#Notice" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#Attribution" />
+        <cc:prohibits
+           rdf:resource="http://creativecommons.org/ns#CommercialUse" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#ShareAlike" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="bckgrnd"
+     style="display:none"
+     sodipodi:insensitive="true">
+    <rect
+       style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       id="rect20607"
+       width="1083.874"
+       height="650"
+       x="-4"
+       y="-4" />
+  </g>
+  <path
+     style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#1a1a1a;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+     id="path23417"
+     sodipodi:nodetypes="cc"
+     d="" />
+  <path
+     style="fill:none;stroke:#ffffff;stroke-width:1.79999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     id="path23347"
+     sodipodi:nodetypes="cc"
+     d="" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer5"
+     inkscape:label="grid"
+     style="opacity:0.3;display:inline"
+     sodipodi:insensitive="true">
+    <g
+       id="g40174"
+       transform="translate(0,2)">
+      <g
+         id="g22995">
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22955"
+           width="1"
+           height="7"
+           x="422"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="401"
+           height="7"
+           width="1"
+           id="rect22957"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22959"
+           width="1"
+           height="7"
+           x="380"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="359"
+           height="7"
+           width="1"
+           id="rect22961"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22963"
+           width="1"
+           height="7"
+           x="338"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="317"
+           height="7"
+           width="1"
+           id="rect22965"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22967"
+           width="1"
+           height="7"
+           x="296"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="275"
+           height="7"
+           width="1"
+           id="rect22969"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22971"
+           width="1"
+           height="7"
+           x="254"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="233"
+           height="7"
+           width="1"
+           id="rect22973"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22975"
+           width="1"
+           height="7"
+           x="212"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="191"
+           height="7"
+           width="1"
+           id="rect22977"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22979"
+           width="1"
+           height="7"
+           x="170"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="149"
+           height="7"
+           width="1"
+           id="rect22981"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22983"
+           width="1"
+           height="7"
+           x="128"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="107"
+           height="7"
+           width="1"
+           id="rect22985"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22987"
+           width="1"
+           height="7"
+           x="86"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="65"
+           height="7"
+           width="1"
+           id="rect22989"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect22991"
+           width="1"
+           height="7"
+           x="44"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="23"
+           height="7"
+           width="1"
+           id="rect22993"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="506"
+           height="7"
+           width="1"
+           id="rect23024"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect23026"
+           width="1"
+           height="7"
+           x="485"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           ry="0"
+           rx="0"
+           y="0"
+           x="464"
+           height="7"
+           width="1"
+           id="rect23028"
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect23030"
+           width="1"
+           height="7"
+           x="443"
+           y="0"
+           rx="0"
+           ry="0" />
+        <rect
+           style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect10985"
+           width="1"
+           height="7"
+           x="527"
+           y="0"
+           rx="0"
+           ry="0" />
+      </g>
+      <g
+         id="g24954">
+        <g
+           id="g23711"
+           transform="translate(0,462)">
+          <rect
+             style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23713"
+             width="6"
+             height="1"
+             x="0"
+             y="26"
+             rx="0"
+             ry="0" />
+          <g
+             id="g23715">
+            <path
+               id="path23717"
+               d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
+            <path
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
+               id="path23719"
+               inkscape:connector-curvature="0" />
+            <path
+               id="path23721"
+               d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
+            <path
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
+               id="path23723"
+               inkscape:connector-curvature="0" />
+            <path
+               id="path23725"
+               d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
+            <path
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
+               id="path23727"
+               inkscape:connector-curvature="0" />
+            <path
+               id="path23729"
+               d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23731" />
+               id="path23731"
+               inkscape:connector-curvature="0" />
             <path
                id="path23733"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23735" />
+               id="path23735"
+               inkscape:connector-curvature="0" />
             <path
                id="path23737"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23739" />
+               id="path23739"
+               inkscape:connector-curvature="0" />
             <path
                id="path23741"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23743" />
+               id="path23743"
+               inkscape:connector-curvature="0" />
             <path
                id="path23745"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23747" />
+               id="path23747"
+               inkscape:connector-curvature="0" />
             <path
                id="path23749"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23751" />
+               id="path23751"
+               inkscape:connector-curvature="0" />
             <path
                id="path23753"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23755" />
+               id="path23755"
+               inkscape:connector-curvature="0" />
             <path
                id="path23757"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23759" />
+               id="path23759"
+               inkscape:connector-curvature="0" />
             <path
                id="path23761"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23763" />
+               id="path23763"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path10987" />
+               id="path10987"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -22726,103 +26698,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23771" />
+               id="path23771"
+               inkscape:connector-curvature="0" />
             <path
                id="path23773"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23775" />
+               id="path23775"
+               inkscape:connector-curvature="0" />
             <path
                id="path23777"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23779" />
+               id="path23779"
+               inkscape:connector-curvature="0" />
             <path
                id="path23781"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23783" />
+               id="path23783"
+               inkscape:connector-curvature="0" />
             <path
                id="path23785"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23787" />
+               id="path23787"
+               inkscape:connector-curvature="0" />
             <path
                id="path23789"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23791" />
+               id="path23791"
+               inkscape:connector-curvature="0" />
             <path
                id="path23793"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23795" />
+               id="path23795"
+               inkscape:connector-curvature="0" />
             <path
                id="path23797"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23799" />
+               id="path23799"
+               inkscape:connector-curvature="0" />
             <path
                id="path23801"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23803" />
+               id="path23803"
+               inkscape:connector-curvature="0" />
             <path
                id="path23805"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23807" />
+               id="path23807"
+               inkscape:connector-curvature="0" />
             <path
                id="path23809"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23811" />
+               id="path23811"
+               inkscape:connector-curvature="0" />
             <path
                id="path23813"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23815" />
+               id="path23815"
+               inkscape:connector-curvature="0" />
             <path
                id="path23817"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path10990"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -22842,103 +26839,128 @@
             <path
                id="path23825"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23827" />
+               id="path23827"
+               inkscape:connector-curvature="0" />
             <path
                id="path23829"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23831" />
+               id="path23831"
+               inkscape:connector-curvature="0" />
             <path
                id="path23833"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23835" />
+               id="path23835"
+               inkscape:connector-curvature="0" />
             <path
                id="path23837"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23839" />
+               id="path23839"
+               inkscape:connector-curvature="0" />
             <path
                id="path23841"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23843" />
+               id="path23843"
+               inkscape:connector-curvature="0" />
             <path
                id="path23845"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23847" />
+               id="path23847"
+               inkscape:connector-curvature="0" />
             <path
                id="path23849"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23851" />
+               id="path23851"
+               inkscape:connector-curvature="0" />
             <path
                id="path23853"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23855" />
+               id="path23855"
+               inkscape:connector-curvature="0" />
             <path
                id="path23857"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23859" />
+               id="path23859"
+               inkscape:connector-curvature="0" />
             <path
                id="path23861"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23863" />
+               id="path23863"
+               inkscape:connector-curvature="0" />
             <path
                id="path23865"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23867" />
+               id="path23867"
+               inkscape:connector-curvature="0" />
             <path
                id="path23869"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23871" />
+               id="path23871"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path10992" />
+               id="path10992"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -22958,103 +26980,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23879" />
+               id="path23879"
+               inkscape:connector-curvature="0" />
             <path
                id="path23881"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23883" />
+               id="path23883"
+               inkscape:connector-curvature="0" />
             <path
                id="path23885"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23887" />
+               id="path23887"
+               inkscape:connector-curvature="0" />
             <path
                id="path23889"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23891" />
+               id="path23891"
+               inkscape:connector-curvature="0" />
             <path
                id="path23893"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23895" />
+               id="path23895"
+               inkscape:connector-curvature="0" />
             <path
                id="path23897"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23899" />
+               id="path23899"
+               inkscape:connector-curvature="0" />
             <path
                id="path23901"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23903" />
+               id="path23903"
+               inkscape:connector-curvature="0" />
             <path
                id="path23905"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23907" />
+               id="path23907"
+               inkscape:connector-curvature="0" />
             <path
                id="path23909"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23911" />
+               id="path23911"
+               inkscape:connector-curvature="0" />
             <path
                id="path23913"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23915" />
+               id="path23915"
+               inkscape:connector-curvature="0" />
             <path
                id="path23917"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23919" />
+               id="path23919"
+               inkscape:connector-curvature="0" />
             <path
                id="path23921"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23923" />
+               id="path23923"
+               inkscape:connector-curvature="0" />
             <path
                id="path23925"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path10994"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23074,103 +27121,128 @@
             <path
                id="path23933"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23935" />
+               id="path23935"
+               inkscape:connector-curvature="0" />
             <path
                id="path23937"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23939" />
+               id="path23939"
+               inkscape:connector-curvature="0" />
             <path
                id="path23941"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23943" />
+               id="path23943"
+               inkscape:connector-curvature="0" />
             <path
                id="path23945"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23947" />
+               id="path23947"
+               inkscape:connector-curvature="0" />
             <path
                id="path23949"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23951" />
+               id="path23951"
+               inkscape:connector-curvature="0" />
             <path
                id="path23953"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23955" />
+               id="path23955"
+               inkscape:connector-curvature="0" />
             <path
                id="path23957"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23959" />
+               id="path23959"
+               inkscape:connector-curvature="0" />
             <path
                id="path23961"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23963" />
+               id="path23963"
+               inkscape:connector-curvature="0" />
             <path
                id="path23965"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23967" />
+               id="path23967"
+               inkscape:connector-curvature="0" />
             <path
                id="path23969"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23971" />
+               id="path23971"
+               inkscape:connector-curvature="0" />
             <path
                id="path23973"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23975" />
+               id="path23975"
+               inkscape:connector-curvature="0" />
             <path
                id="path23977"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23979" />
+               id="path23979"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path10996" />
+               id="path10996"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23190,103 +27262,128 @@
             <path
                id="path23987"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23989" />
+               id="path23989"
+               inkscape:connector-curvature="0" />
             <path
                id="path23991"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23993" />
+               id="path23993"
+               inkscape:connector-curvature="0" />
             <path
                id="path23995"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path23997" />
+               id="path23997"
+               inkscape:connector-curvature="0" />
             <path
                id="path23999"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24001" />
+               id="path24001"
+               inkscape:connector-curvature="0" />
             <path
                id="path24003"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24005" />
+               id="path24005"
+               inkscape:connector-curvature="0" />
             <path
                id="path24007"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24009" />
+               id="path24009"
+               inkscape:connector-curvature="0" />
             <path
                id="path24011"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24013" />
+               id="path24013"
+               inkscape:connector-curvature="0" />
             <path
                id="path24015"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24017" />
+               id="path24017"
+               inkscape:connector-curvature="0" />
             <path
                id="path24019"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24021" />
+               id="path24021"
+               inkscape:connector-curvature="0" />
             <path
                id="path24023"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24025" />
+               id="path24025"
+               inkscape:connector-curvature="0" />
             <path
                id="path24027"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24029" />
+               id="path24029"
+               inkscape:connector-curvature="0" />
             <path
                id="path24031"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24033" />
+               id="path24033"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path10998" />
+               id="path10998"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23306,103 +27403,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24041" />
+               id="path24041"
+               inkscape:connector-curvature="0" />
             <path
                id="path24043"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24045" />
+               id="path24045"
+               inkscape:connector-curvature="0" />
             <path
                id="path24047"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24049" />
+               id="path24049"
+               inkscape:connector-curvature="0" />
             <path
                id="path24051"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24053" />
+               id="path24053"
+               inkscape:connector-curvature="0" />
             <path
                id="path24055"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24057" />
+               id="path24057"
+               inkscape:connector-curvature="0" />
             <path
                id="path24059"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24061" />
+               id="path24061"
+               inkscape:connector-curvature="0" />
             <path
                id="path24063"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24065" />
+               id="path24065"
+               inkscape:connector-curvature="0" />
             <path
                id="path24067"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24069" />
+               id="path24069"
+               inkscape:connector-curvature="0" />
             <path
                id="path24071"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24073" />
+               id="path24073"
+               inkscape:connector-curvature="0" />
             <path
                id="path24075"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24077" />
+               id="path24077"
+               inkscape:connector-curvature="0" />
             <path
                id="path24079"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24081" />
+               id="path24081"
+               inkscape:connector-curvature="0" />
             <path
                id="path24083"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24085" />
+               id="path24085"
+               inkscape:connector-curvature="0" />
             <path
                id="path24087"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11000"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23422,103 +27544,128 @@
             <path
                id="path24095"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24097" />
+               id="path24097"
+               inkscape:connector-curvature="0" />
             <path
                id="path24099"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24101" />
+               id="path24101"
+               inkscape:connector-curvature="0" />
             <path
                id="path24103"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24105" />
+               id="path24105"
+               inkscape:connector-curvature="0" />
             <path
                id="path24107"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24109" />
+               id="path24109"
+               inkscape:connector-curvature="0" />
             <path
                id="path24111"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24113" />
+               id="path24113"
+               inkscape:connector-curvature="0" />
             <path
                id="path24115"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24117" />
+               id="path24117"
+               inkscape:connector-curvature="0" />
             <path
                id="path24119"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24121" />
+               id="path24121"
+               inkscape:connector-curvature="0" />
             <path
                id="path24123"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24125" />
+               id="path24125"
+               inkscape:connector-curvature="0" />
             <path
                id="path24127"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24129" />
+               id="path24129"
+               inkscape:connector-curvature="0" />
             <path
                id="path24131"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24133" />
+               id="path24133"
+               inkscape:connector-curvature="0" />
             <path
                id="path24135"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24137" />
+               id="path24137"
+               inkscape:connector-curvature="0" />
             <path
                id="path24139"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24141" />
+               id="path24141"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11002" />
+               id="path11002"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23538,103 +27685,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24149" />
+               id="path24149"
+               inkscape:connector-curvature="0" />
             <path
                id="path24151"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24153" />
+               id="path24153"
+               inkscape:connector-curvature="0" />
             <path
                id="path24155"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24157" />
+               id="path24157"
+               inkscape:connector-curvature="0" />
             <path
                id="path24159"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24161" />
+               id="path24161"
+               inkscape:connector-curvature="0" />
             <path
                id="path24163"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24165" />
+               id="path24165"
+               inkscape:connector-curvature="0" />
             <path
                id="path24167"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24169" />
+               id="path24169"
+               inkscape:connector-curvature="0" />
             <path
                id="path24171"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24173" />
+               id="path24173"
+               inkscape:connector-curvature="0" />
             <path
                id="path24175"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24177" />
+               id="path24177"
+               inkscape:connector-curvature="0" />
             <path
                id="path24179"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24181" />
+               id="path24181"
+               inkscape:connector-curvature="0" />
             <path
                id="path24183"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24185" />
+               id="path24185"
+               inkscape:connector-curvature="0" />
             <path
                id="path24187"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24189" />
+               id="path24189"
+               inkscape:connector-curvature="0" />
             <path
                id="path24191"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24193" />
+               id="path24193"
+               inkscape:connector-curvature="0" />
             <path
                id="path24195"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11004"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23654,103 +27826,128 @@
             <path
                id="path24203"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24205" />
+               id="path24205"
+               inkscape:connector-curvature="0" />
             <path
                id="path24207"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24209" />
+               id="path24209"
+               inkscape:connector-curvature="0" />
             <path
                id="path24211"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24213" />
+               id="path24213"
+               inkscape:connector-curvature="0" />
             <path
                id="path24215"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24217" />
+               id="path24217"
+               inkscape:connector-curvature="0" />
             <path
                id="path24219"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24221" />
+               id="path24221"
+               inkscape:connector-curvature="0" />
             <path
                id="path24223"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24225" />
+               id="path24225"
+               inkscape:connector-curvature="0" />
             <path
                id="path24227"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24229" />
+               id="path24229"
+               inkscape:connector-curvature="0" />
             <path
                id="path24231"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24233" />
+               id="path24233"
+               inkscape:connector-curvature="0" />
             <path
                id="path24235"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24237" />
+               id="path24237"
+               inkscape:connector-curvature="0" />
             <path
                id="path24239"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24241" />
+               id="path24241"
+               inkscape:connector-curvature="0" />
             <path
                id="path24243"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24245" />
+               id="path24245"
+               inkscape:connector-curvature="0" />
             <path
                id="path24247"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24249" />
+               id="path24249"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11006" />
+               id="path11006"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23770,103 +27967,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24257" />
+               id="path24257"
+               inkscape:connector-curvature="0" />
             <path
                id="path24259"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24261" />
+               id="path24261"
+               inkscape:connector-curvature="0" />
             <path
                id="path24263"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24265" />
+               id="path24265"
+               inkscape:connector-curvature="0" />
             <path
                id="path24267"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24269" />
+               id="path24269"
+               inkscape:connector-curvature="0" />
             <path
                id="path24271"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24273" />
+               id="path24273"
+               inkscape:connector-curvature="0" />
             <path
                id="path24275"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24277" />
+               id="path24277"
+               inkscape:connector-curvature="0" />
             <path
                id="path24279"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24281" />
+               id="path24281"
+               inkscape:connector-curvature="0" />
             <path
                id="path24283"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24285" />
+               id="path24285"
+               inkscape:connector-curvature="0" />
             <path
                id="path24287"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24289" />
+               id="path24289"
+               inkscape:connector-curvature="0" />
             <path
                id="path24291"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24293" />
+               id="path24293"
+               inkscape:connector-curvature="0" />
             <path
                id="path24295"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24297" />
+               id="path24297"
+               inkscape:connector-curvature="0" />
             <path
                id="path24299"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24301" />
+               id="path24301"
+               inkscape:connector-curvature="0" />
             <path
                id="path24303"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11008"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -23886,103 +28108,128 @@
             <path
                id="path24311"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24313" />
+               id="path24313"
+               inkscape:connector-curvature="0" />
             <path
                id="path24315"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24317" />
+               id="path24317"
+               inkscape:connector-curvature="0" />
             <path
                id="path24319"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24321" />
+               id="path24321"
+               inkscape:connector-curvature="0" />
             <path
                id="path24323"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24325" />
+               id="path24325"
+               inkscape:connector-curvature="0" />
             <path
                id="path24327"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24329" />
+               id="path24329"
+               inkscape:connector-curvature="0" />
             <path
                id="path24331"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24333" />
+               id="path24333"
+               inkscape:connector-curvature="0" />
             <path
                id="path24335"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24337" />
+               id="path24337"
+               inkscape:connector-curvature="0" />
             <path
                id="path24339"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24341" />
+               id="path24341"
+               inkscape:connector-curvature="0" />
             <path
                id="path24343"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24345" />
+               id="path24345"
+               inkscape:connector-curvature="0" />
             <path
                id="path24347"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24349" />
+               id="path24349"
+               inkscape:connector-curvature="0" />
             <path
                id="path24351"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24353" />
+               id="path24353"
+               inkscape:connector-curvature="0" />
             <path
                id="path24355"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24357" />
+               id="path24357"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11010" />
+               id="path11010"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24002,103 +28249,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24365" />
+               id="path24365"
+               inkscape:connector-curvature="0" />
             <path
                id="path24367"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24369" />
+               id="path24369"
+               inkscape:connector-curvature="0" />
             <path
                id="path24371"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24373" />
+               id="path24373"
+               inkscape:connector-curvature="0" />
             <path
                id="path24375"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24377" />
+               id="path24377"
+               inkscape:connector-curvature="0" />
             <path
                id="path24379"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24381" />
+               id="path24381"
+               inkscape:connector-curvature="0" />
             <path
                id="path24383"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24385" />
+               id="path24385"
+               inkscape:connector-curvature="0" />
             <path
                id="path24387"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24389" />
+               id="path24389"
+               inkscape:connector-curvature="0" />
             <path
                id="path24391"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24393" />
+               id="path24393"
+               inkscape:connector-curvature="0" />
             <path
                id="path24395"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24397" />
+               id="path24397"
+               inkscape:connector-curvature="0" />
             <path
                id="path24399"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24401" />
+               id="path24401"
+               inkscape:connector-curvature="0" />
             <path
                id="path24403"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24405" />
+               id="path24405"
+               inkscape:connector-curvature="0" />
             <path
                id="path24407"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24409" />
+               id="path24409"
+               inkscape:connector-curvature="0" />
             <path
                id="path24411"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11012"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24118,103 +28390,128 @@
             <path
                id="path24419"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24421" />
+               id="path24421"
+               inkscape:connector-curvature="0" />
             <path
                id="path24423"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24425" />
+               id="path24425"
+               inkscape:connector-curvature="0" />
             <path
                id="path24427"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24429" />
+               id="path24429"
+               inkscape:connector-curvature="0" />
             <path
                id="path24431"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24433" />
+               id="path24433"
+               inkscape:connector-curvature="0" />
             <path
                id="path24435"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24437" />
+               id="path24437"
+               inkscape:connector-curvature="0" />
             <path
                id="path24439"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24441" />
+               id="path24441"
+               inkscape:connector-curvature="0" />
             <path
                id="path24443"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24445" />
+               id="path24445"
+               inkscape:connector-curvature="0" />
             <path
                id="path24447"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24449" />
+               id="path24449"
+               inkscape:connector-curvature="0" />
             <path
                id="path24451"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24453" />
+               id="path24453"
+               inkscape:connector-curvature="0" />
             <path
                id="path24455"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24457" />
+               id="path24457"
+               inkscape:connector-curvature="0" />
             <path
                id="path24459"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24461" />
+               id="path24461"
+               inkscape:connector-curvature="0" />
             <path
                id="path24463"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24465" />
+               id="path24465"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11014" />
+               id="path11014"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24234,103 +28531,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24473" />
+               id="path24473"
+               inkscape:connector-curvature="0" />
             <path
                id="path24475"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24477" />
+               id="path24477"
+               inkscape:connector-curvature="0" />
             <path
                id="path24479"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24481" />
+               id="path24481"
+               inkscape:connector-curvature="0" />
             <path
                id="path24483"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24485" />
+               id="path24485"
+               inkscape:connector-curvature="0" />
             <path
                id="path24487"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24489" />
+               id="path24489"
+               inkscape:connector-curvature="0" />
             <path
                id="path24491"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24493" />
+               id="path24493"
+               inkscape:connector-curvature="0" />
             <path
                id="path24495"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24497" />
+               id="path24497"
+               inkscape:connector-curvature="0" />
             <path
                id="path24499"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24501" />
+               id="path24501"
+               inkscape:connector-curvature="0" />
             <path
                id="path24503"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24505" />
+               id="path24505"
+               inkscape:connector-curvature="0" />
             <path
                id="path24507"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24509" />
+               id="path24509"
+               inkscape:connector-curvature="0" />
             <path
                id="path24511"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24513" />
+               id="path24513"
+               inkscape:connector-curvature="0" />
             <path
                id="path24515"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24517" />
+               id="path24517"
+               inkscape:connector-curvature="0" />
             <path
                id="path24519"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11016"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24350,103 +28672,128 @@
             <path
                id="path24527"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24529" />
+               id="path24529"
+               inkscape:connector-curvature="0" />
             <path
                id="path24531"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24533" />
+               id="path24533"
+               inkscape:connector-curvature="0" />
             <path
                id="path24535"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24537" />
+               id="path24537"
+               inkscape:connector-curvature="0" />
             <path
                id="path24539"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24541" />
+               id="path24541"
+               inkscape:connector-curvature="0" />
             <path
                id="path24543"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24545" />
+               id="path24545"
+               inkscape:connector-curvature="0" />
             <path
                id="path24547"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24549" />
+               id="path24549"
+               inkscape:connector-curvature="0" />
             <path
                id="path24551"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24553" />
+               id="path24553"
+               inkscape:connector-curvature="0" />
             <path
                id="path24555"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24557" />
+               id="path24557"
+               inkscape:connector-curvature="0" />
             <path
                id="path24559"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24561" />
+               id="path24561"
+               inkscape:connector-curvature="0" />
             <path
                id="path24563"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24565" />
+               id="path24565"
+               inkscape:connector-curvature="0" />
             <path
                id="path24567"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24569" />
+               id="path24569"
+               inkscape:connector-curvature="0" />
             <path
                id="path24571"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24573" />
+               id="path24573"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11018" />
+               id="path11018"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24466,103 +28813,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24581" />
+               id="path24581"
+               inkscape:connector-curvature="0" />
             <path
                id="path24583"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24585" />
+               id="path24585"
+               inkscape:connector-curvature="0" />
             <path
                id="path24587"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24589" />
+               id="path24589"
+               inkscape:connector-curvature="0" />
             <path
                id="path24591"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24593" />
+               id="path24593"
+               inkscape:connector-curvature="0" />
             <path
                id="path24595"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24597" />
+               id="path24597"
+               inkscape:connector-curvature="0" />
             <path
                id="path24599"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24601" />
+               id="path24601"
+               inkscape:connector-curvature="0" />
             <path
                id="path24603"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24605" />
+               id="path24605"
+               inkscape:connector-curvature="0" />
             <path
                id="path24607"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24609" />
+               id="path24609"
+               inkscape:connector-curvature="0" />
             <path
                id="path24611"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24613" />
+               id="path24613"
+               inkscape:connector-curvature="0" />
             <path
                id="path24615"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24617" />
+               id="path24617"
+               inkscape:connector-curvature="0" />
             <path
                id="path24619"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24621" />
+               id="path24621"
+               inkscape:connector-curvature="0" />
             <path
                id="path24623"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24625" />
+               id="path24625"
+               inkscape:connector-curvature="0" />
             <path
                id="path24627"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11020"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24582,103 +28954,128 @@
             <path
                id="path24636"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24638" />
+               id="path24638"
+               inkscape:connector-curvature="0" />
             <path
                id="path24640"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24642" />
+               id="path24642"
+               inkscape:connector-curvature="0" />
             <path
                id="path24644"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24646" />
+               id="path24646"
+               inkscape:connector-curvature="0" />
             <path
                id="path24648"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24650" />
+               id="path24650"
+               inkscape:connector-curvature="0" />
             <path
                id="path24652"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24654" />
+               id="path24654"
+               inkscape:connector-curvature="0" />
             <path
                id="path24656"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24658" />
+               id="path24658"
+               inkscape:connector-curvature="0" />
             <path
                id="path24660"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24662" />
+               id="path24662"
+               inkscape:connector-curvature="0" />
             <path
                id="path24664"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24666" />
+               id="path24666"
+               inkscape:connector-curvature="0" />
             <path
                id="path24668"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24670" />
+               id="path24670"
+               inkscape:connector-curvature="0" />
             <path
                id="path24672"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24674" />
+               id="path24674"
+               inkscape:connector-curvature="0" />
             <path
                id="path24676"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24678" />
+               id="path24678"
+               inkscape:connector-curvature="0" />
             <path
                id="path24680"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24682" />
+               id="path24682"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11022" />
+               id="path11022"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24698,103 +29095,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24690" />
+               id="path24690"
+               inkscape:connector-curvature="0" />
             <path
                id="path24692"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24694" />
+               id="path24694"
+               inkscape:connector-curvature="0" />
             <path
                id="path24696"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24698" />
+               id="path24698"
+               inkscape:connector-curvature="0" />
             <path
                id="path24700"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24702" />
+               id="path24702"
+               inkscape:connector-curvature="0" />
             <path
                id="path24704"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24706" />
+               id="path24706"
+               inkscape:connector-curvature="0" />
             <path
                id="path24708"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24710" />
+               id="path24710"
+               inkscape:connector-curvature="0" />
             <path
                id="path24712"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24714" />
+               id="path24714"
+               inkscape:connector-curvature="0" />
             <path
                id="path24716"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24718" />
+               id="path24718"
+               inkscape:connector-curvature="0" />
             <path
                id="path24720"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24722" />
+               id="path24722"
+               inkscape:connector-curvature="0" />
             <path
                id="path24724"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24726" />
+               id="path24726"
+               inkscape:connector-curvature="0" />
             <path
                id="path24728"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24730" />
+               id="path24730"
+               inkscape:connector-curvature="0" />
             <path
                id="path24732"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24734" />
+               id="path24734"
+               inkscape:connector-curvature="0" />
             <path
                id="path24736"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11024"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24814,103 +29236,128 @@
             <path
                id="path24744"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24746" />
+               id="path24746"
+               inkscape:connector-curvature="0" />
             <path
                id="path24748"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24750" />
+               id="path24750"
+               inkscape:connector-curvature="0" />
             <path
                id="path24752"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24754" />
+               id="path24754"
+               inkscape:connector-curvature="0" />
             <path
                id="path24756"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24758" />
+               id="path24758"
+               inkscape:connector-curvature="0" />
             <path
                id="path24760"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24762" />
+               id="path24762"
+               inkscape:connector-curvature="0" />
             <path
                id="path24764"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24766" />
+               id="path24766"
+               inkscape:connector-curvature="0" />
             <path
                id="path24768"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24770" />
+               id="path24770"
+               inkscape:connector-curvature="0" />
             <path
                id="path24772"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24774" />
+               id="path24774"
+               inkscape:connector-curvature="0" />
             <path
                id="path24776"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24778" />
+               id="path24778"
+               inkscape:connector-curvature="0" />
             <path
                id="path24780"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24782" />
+               id="path24782"
+               inkscape:connector-curvature="0" />
             <path
                id="path24784"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24786" />
+               id="path24786"
+               inkscape:connector-curvature="0" />
             <path
                id="path24788"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24790" />
+               id="path24790"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11026" />
+               id="path11026"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -24930,103 +29377,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24798" />
+               id="path24798"
+               inkscape:connector-curvature="0" />
             <path
                id="path24800"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24802" />
+               id="path24802"
+               inkscape:connector-curvature="0" />
             <path
                id="path24804"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24806" />
+               id="path24806"
+               inkscape:connector-curvature="0" />
             <path
                id="path24808"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24810" />
+               id="path24810"
+               inkscape:connector-curvature="0" />
             <path
                id="path24812"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24814" />
+               id="path24814"
+               inkscape:connector-curvature="0" />
             <path
                id="path24816"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24818" />
+               id="path24818"
+               inkscape:connector-curvature="0" />
             <path
                id="path24820"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24822" />
+               id="path24822"
+               inkscape:connector-curvature="0" />
             <path
                id="path24824"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24826" />
+               id="path24826"
+               inkscape:connector-curvature="0" />
             <path
                id="path24828"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24830" />
+               id="path24830"
+               inkscape:connector-curvature="0" />
             <path
                id="path24832"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24834" />
+               id="path24834"
+               inkscape:connector-curvature="0" />
             <path
                id="path24836"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24838" />
+               id="path24838"
+               inkscape:connector-curvature="0" />
             <path
                id="path24840"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24842" />
+               id="path24842"
+               inkscape:connector-curvature="0" />
             <path
                id="path24844"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11028"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25046,103 +29518,128 @@
             <path
                id="path24852"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24854" />
+               id="path24854"
+               inkscape:connector-curvature="0" />
             <path
                id="path24856"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24858" />
+               id="path24858"
+               inkscape:connector-curvature="0" />
             <path
                id="path24860"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24862" />
+               id="path24862"
+               inkscape:connector-curvature="0" />
             <path
                id="path24864"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24866" />
+               id="path24866"
+               inkscape:connector-curvature="0" />
             <path
                id="path24868"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24870" />
+               id="path24870"
+               inkscape:connector-curvature="0" />
             <path
                id="path24872"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24874" />
+               id="path24874"
+               inkscape:connector-curvature="0" />
             <path
                id="path24876"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24878" />
+               id="path24878"
+               inkscape:connector-curvature="0" />
             <path
                id="path24880"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24882" />
+               id="path24882"
+               inkscape:connector-curvature="0" />
             <path
                id="path24884"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24886" />
+               id="path24886"
+               inkscape:connector-curvature="0" />
             <path
                id="path24888"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24890" />
+               id="path24890"
+               inkscape:connector-curvature="0" />
             <path
                id="path24892"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24894" />
+               id="path24894"
+               inkscape:connector-curvature="0" />
             <path
                id="path24896"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24898" />
+               id="path24898"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path11030" />
+               id="path11030"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25161,103 +29658,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24906" />
+               id="path24906"
+               inkscape:connector-curvature="0" />
             <path
                id="path24908"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24910" />
+               id="path24910"
+               inkscape:connector-curvature="0" />
             <path
                id="path24912"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24914" />
+               id="path24914"
+               inkscape:connector-curvature="0" />
             <path
                id="path24916"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24918" />
+               id="path24918"
+               inkscape:connector-curvature="0" />
             <path
                id="path24920"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24922" />
+               id="path24922"
+               inkscape:connector-curvature="0" />
             <path
                id="path24924"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24926" />
+               id="path24926"
+               inkscape:connector-curvature="0" />
             <path
                id="path24928"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24930" />
+               id="path24930"
+               inkscape:connector-curvature="0" />
             <path
                id="path24932"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24934" />
+               id="path24934"
+               inkscape:connector-curvature="0" />
             <path
                id="path24936"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24938" />
+               id="path24938"
+               inkscape:connector-curvature="0" />
             <path
                id="path24940"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24942" />
+               id="path24942"
+               inkscape:connector-curvature="0" />
             <path
                id="path24944"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24946" />
+               id="path24946"
+               inkscape:connector-curvature="0" />
             <path
                id="path24948"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path24950" />
+               id="path24950"
+               inkscape:connector-curvature="0" />
             <path
                id="path24952"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path11032"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25277,103 +29799,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39840" />
+               id="path39840"
+               inkscape:connector-curvature="0" />
             <path
                id="path39842"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39844" />
+               id="path39844"
+               inkscape:connector-curvature="0" />
             <path
                id="path39846"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39848" />
+               id="path39848"
+               inkscape:connector-curvature="0" />
             <path
                id="path39850"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39852" />
+               id="path39852"
+               inkscape:connector-curvature="0" />
             <path
                id="path39854"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39856" />
+               id="path39856"
+               inkscape:connector-curvature="0" />
             <path
                id="path39858"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39860" />
+               id="path39860"
+               inkscape:connector-curvature="0" />
             <path
                id="path39862"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39864" />
+               id="path39864"
+               inkscape:connector-curvature="0" />
             <path
                id="path39866"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39868" />
+               id="path39868"
+               inkscape:connector-curvature="0" />
             <path
                id="path39870"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39872" />
+               id="path39872"
+               inkscape:connector-curvature="0" />
             <path
                id="path39874"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39876" />
+               id="path39876"
+               inkscape:connector-curvature="0" />
             <path
                id="path39878"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39880" />
+               id="path39880"
+               inkscape:connector-curvature="0" />
             <path
                id="path39882"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39884" />
+               id="path39884"
+               inkscape:connector-curvature="0" />
             <path
                id="path39888"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path39890"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25393,103 +29940,128 @@
             <path
                id="path39898"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39900" />
+               id="path39900"
+               inkscape:connector-curvature="0" />
             <path
                id="path39902"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39904" />
+               id="path39904"
+               inkscape:connector-curvature="0" />
             <path
                id="path39907"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39909" />
+               id="path39909"
+               inkscape:connector-curvature="0" />
             <path
                id="path39911"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39913" />
+               id="path39913"
+               inkscape:connector-curvature="0" />
             <path
                id="path39915"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39917" />
+               id="path39917"
+               inkscape:connector-curvature="0" />
             <path
                id="path39919"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39921" />
+               id="path39921"
+               inkscape:connector-curvature="0" />
             <path
                id="path39923"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39925" />
+               id="path39925"
+               inkscape:connector-curvature="0" />
             <path
                id="path39927"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39929" />
+               id="path39929"
+               inkscape:connector-curvature="0" />
             <path
                id="path39931"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39933" />
+               id="path39933"
+               inkscape:connector-curvature="0" />
             <path
                id="path39935"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39937" />
+               id="path39937"
+               inkscape:connector-curvature="0" />
             <path
                id="path39939"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39941" />
+               id="path39941"
+               inkscape:connector-curvature="0" />
             <path
                id="path39943"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39945" />
+               id="path39945"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39947" />
+               id="path39947"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25509,103 +30081,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39955" />
+               id="path39955"
+               inkscape:connector-curvature="0" />
             <path
                id="path39957"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39959" />
+               id="path39959"
+               inkscape:connector-curvature="0" />
             <path
                id="path39961"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39963" />
+               id="path39963"
+               inkscape:connector-curvature="0" />
             <path
                id="path39965"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39967" />
+               id="path39967"
+               inkscape:connector-curvature="0" />
             <path
                id="path39969"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39971" />
+               id="path39971"
+               inkscape:connector-curvature="0" />
             <path
                id="path39973"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39975" />
+               id="path39975"
+               inkscape:connector-curvature="0" />
             <path
                id="path39977"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39979" />
+               id="path39979"
+               inkscape:connector-curvature="0" />
             <path
                id="path39981"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39983" />
+               id="path39983"
+               inkscape:connector-curvature="0" />
             <path
                id="path39985"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39987" />
+               id="path39987"
+               inkscape:connector-curvature="0" />
             <path
                id="path39989"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39991" />
+               id="path39991"
+               inkscape:connector-curvature="0" />
             <path
                id="path39993"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39995" />
+               id="path39995"
+               inkscape:connector-curvature="0" />
             <path
                id="path39997"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path39999" />
+               id="path39999"
+               inkscape:connector-curvature="0" />
             <path
                id="path40001"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path40003"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25625,103 +30222,128 @@
             <path
                id="path40011"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40013" />
+               id="path40013"
+               inkscape:connector-curvature="0" />
             <path
                id="path40015"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40017" />
+               id="path40017"
+               inkscape:connector-curvature="0" />
             <path
                id="path40019"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40021" />
+               id="path40021"
+               inkscape:connector-curvature="0" />
             <path
                id="path40023"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40025" />
+               id="path40025"
+               inkscape:connector-curvature="0" />
             <path
                id="path40027"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40029" />
+               id="path40029"
+               inkscape:connector-curvature="0" />
             <path
                id="path40031"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40033" />
+               id="path40033"
+               inkscape:connector-curvature="0" />
             <path
                id="path40035"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40038" />
+               id="path40038"
+               inkscape:connector-curvature="0" />
             <path
                id="path40040"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40042" />
+               id="path40042"
+               inkscape:connector-curvature="0" />
             <path
                id="path40044"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40046" />
+               id="path40046"
+               inkscape:connector-curvature="0" />
             <path
                id="path40048"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40050" />
+               id="path40050"
+               inkscape:connector-curvature="0" />
             <path
                id="path40052"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40054" />
+               id="path40054"
+               inkscape:connector-curvature="0" />
             <path
                id="path40056"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40058" />
+               id="path40058"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40060" />
+               id="path40060"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25741,103 +30363,128 @@
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40068" />
+               id="path40068"
+               inkscape:connector-curvature="0" />
             <path
                id="path40070"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40072" />
+               id="path40072"
+               inkscape:connector-curvature="0" />
             <path
                id="path40074"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40076" />
+               id="path40076"
+               inkscape:connector-curvature="0" />
             <path
                id="path40078"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40080" />
+               id="path40080"
+               inkscape:connector-curvature="0" />
             <path
                id="path40082"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40084" />
+               id="path40084"
+               inkscape:connector-curvature="0" />
             <path
                id="path40086"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40088" />
+               id="path40088"
+               inkscape:connector-curvature="0" />
             <path
                id="path40090"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40092" />
+               id="path40092"
+               inkscape:connector-curvature="0" />
             <path
                id="path40094"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40096" />
+               id="path40096"
+               inkscape:connector-curvature="0" />
             <path
                id="path40098"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40100" />
+               id="path40100"
+               inkscape:connector-curvature="0" />
             <path
                id="path40102"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40104" />
+               id="path40104"
+               inkscape:connector-curvature="0" />
             <path
                id="path40106"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40108" />
+               id="path40108"
+               inkscape:connector-curvature="0" />
             <path
                id="path40110"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40112" />
+               id="path40112"
+               inkscape:connector-curvature="0" />
             <path
                id="path40114"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                id="path40116"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
         <g
@@ -25857,103 +30504,128 @@
             <path
                id="path40124"
                d="m 506,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 485,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40126" />
+               id="path40126"
+               inkscape:connector-curvature="0" />
             <path
                id="path40128"
                d="m 464,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 443,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40130" />
+               id="path40130"
+               inkscape:connector-curvature="0" />
             <path
                id="path40132"
                d="m 422,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 401,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40134" />
+               id="path40134"
+               inkscape:connector-curvature="0" />
             <path
                id="path40136"
                d="m 380,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 359,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40138" />
+               id="path40138"
+               inkscape:connector-curvature="0" />
             <path
                id="path40140"
                d="m 338,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 317,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40142" />
+               id="path40142"
+               inkscape:connector-curvature="0" />
             <path
                id="path40144"
                d="m 296,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 275,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40146" />
+               id="path40146"
+               inkscape:connector-curvature="0" />
             <path
                id="path40148"
                d="m 254,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 233,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40150" />
+               id="path40150"
+               inkscape:connector-curvature="0" />
             <path
                id="path40152"
                d="m 212,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 191,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40154" />
+               id="path40154"
+               inkscape:connector-curvature="0" />
             <path
                id="path40156"
                d="m 170,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 149,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40158" />
+               id="path40158"
+               inkscape:connector-curvature="0" />
             <path
                id="path40160"
                d="m 128,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 107,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40162" />
+               id="path40162"
+               inkscape:connector-curvature="0" />
             <path
                id="path40164"
                d="m 86,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 65,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40166" />
+               id="path40166"
+               inkscape:connector-curvature="0" />
             <path
                id="path40168"
                d="m 44,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+               style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 23,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40170" />
+               id="path40170"
+               inkscape:connector-curvature="0" />
             <path
                style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
                d="m 527,20 0,6 -6,0 0,1 6,0 0,6 1,0 0,-6 6,0 0,-1 -6,0 0,-6 -1,0 z"
-               id="path40172" />
+               id="path40172"
+               inkscape:connector-curvature="0" />
           </g>
         </g>
       </g>
@@ -26675,7 +31347,7 @@
     </g>
     <g
        style="opacity:0.3;stroke:#ffffff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;display:inline;enable-background:new"
-       transform="translate(21,-1)"
+       transform="translate(22,-10)"
        id="g28646-1">
       <path
          id="path28648-3"
@@ -27237,7 +31909,7 @@
     <g
        style="display:inline;enable-background:new"
        id="g10857-3"
-       transform="translate(21,-1)">
+       transform="translate(22,-10)">
       <path
          style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          d="m 535,267 0,5 1,0 0,-3 1,0 0,-1 -1,0 0,-1 -1,0 z m 2,2 0,1 1,0 0,-1 -1,0 z m 1,0 1,0 0,3 1,0 0,-5 -1,0 0,1 -1,0 0,1 z"
@@ -29519,6 +34191,12 @@
          style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          inkscape:connector-curvature="0" />
     </g>
+    <path
+       style="opacity:0.4;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       d="m 545,238 0,1 9,0 0,41 -9,0 0,1 9,0 1,0 0,-21 1,0 0,-1 -1,0 0,-21 -1,0 z"
+       id="rect11044-9-4"
+       sodipodi:nodetypes="ccccccccccccccc"
+       inkscape:connector-curvature="0" />
   </g>
   <g
      inkscape:label="ICONS"
@@ -29677,7 +34355,7 @@
                id="path14745" />
             <path
                transform="matrix(3.625,0,0,3.1690202,-67.8125,318.31703)"
-               d="m 14.5,57.5 a 1,1.0000004 0 1 1 -2,0 1,1.0000004 0 1 1 2,0 z"
+               d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
                sodipodi:ry="1.0000004"
                sodipodi:rx="1"
                sodipodi:cy="57.5"
@@ -29694,7 +34372,7 @@
           </g>
           <path
              transform="matrix(3.5999897,0,0,3.1249932,-67.499871,320.6879)"
-             d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="57.5"
@@ -29716,11 +34394,11 @@
              sodipodi:cy="57.5"
              sodipodi:rx="1"
              sodipodi:ry="1"
-             d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
              transform="matrix(3.25,0,0,3.25,-62.875,313.125)" />
           <path
              transform="matrix(2,0,0,2,-46,385)"
-             d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="57.5"
@@ -29736,7 +34414,7 @@
              sodipodi:cy="57.5"
              sodipodi:rx="1"
              sodipodi:ry="1"
-             d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
              transform="matrix(4.7519907,0,0,4.1435313,-83.051884,262.12196)" />
           <path
              inkscape:connector-curvature="0"
@@ -29860,7 +34538,7 @@
            sodipodi:cy="38.98439"
            sodipodi:rx="15.467961"
            sodipodi:ry="5.3033009"
-           d="m 43.487067,38.98439 a 15.467961,5.3033009 0 1 1 -30.935922,0 15.467961,5.3033009 0 1 1 30.935922,0 z"
+           d="m 43.487067,38.98439 c 0,2.928932 -6.925242,5.303301 -15.467961,5.303301 -8.542719,0 -15.467961,-2.374369 -15.467961,-5.303301 0,-2.928932 6.925242,-5.303301 15.467961,-5.303301 8.542719,0 15.467961,2.374369 15.467961,5.303301 z"
            transform="matrix(1.274286,0,0,1.377124,-7.569123,-16.70193)" />
         <path
            style="fill:#f57900;fill-rule:evenodd;stroke:#aa4400;stroke-width:1.7812928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none"
@@ -29876,7 +34554,7 @@
            sodipodi:cy="25.75"
            sodipodi:rx="11.5625"
            sodipodi:ry="10.125"
-           d="m 42.75,25.75 a 11.5625,10.125 0 1 1 -23.125,0 11.5625,10.125 0 1 1 23.125,0 z"
+           d="m 42.75,25.75 c 0,5.591883 -5.176708,10.125 -11.5625,10.125 -6.385792,0 -11.5625,-4.533117 -11.5625,-10.125 0,-5.591883 5.176708,-10.125 11.5625,-10.125 6.385792,0 11.5625,4.533117 11.5625,10.125 z"
            transform="matrix(0.8018194,0,0,0.8471126,6.257567,4.5089892)" />
         <path
            sodipodi:nodetypes="csssssscssscsssccssscscccsccssssccscsscccssssc"
@@ -30019,7 +34697,7 @@
            sodipodi:cy="40"
            sodipodi:rx="6"
            sodipodi:ry="6"
-           d="m 36.5,40 a 6,6 0 1 1 -12,0"
+           d="m 36.5,40 c 0,3.313708 -2.686292,6 -6,6 -3.313708,0 -6,-2.686292 -6,-6 0,0 0,0 0,0"
            sodipodi:start="0"
            sodipodi:end="3.1415927"
            sodipodi:open="true"
@@ -30035,7 +34713,7 @@
            sodipodi:open="true"
            sodipodi:end="3.1415927"
            sodipodi:start="0"
-           d="m 36.5,40 a 6,6 0 1 1 -12,0"
+           d="m 36.5,40 c 0,3.313708 -2.686292,6 -6,6 -3.313708,0 -6,-2.686292 -6,-6 0,0 0,0 0,0"
            sodipodi:ry="6"
            sodipodi:rx="6"
            sodipodi:cy="40"
@@ -30063,7 +34741,7 @@
            sodipodi:open="true"
            sodipodi:end="3.1415927"
            sodipodi:start="0"
-           d="m 36.5,40 a 6,6 0 1 1 -12,0"
+           d="m 36.5,40 c 0,3.313708 -2.686292,6 -6,6 -3.313708,0 -6,-2.686292 -6,-6 0,0 0,0 0,0"
            sodipodi:ry="6"
            sodipodi:rx="6"
            sodipodi:cy="40"
@@ -30087,7 +34765,7 @@
            sodipodi:cy="40"
            sodipodi:rx="6"
            sodipodi:ry="6"
-           d="m 36.5,40 a 6,6 0 1 1 -12,0"
+           d="m 36.5,40 c 0,3.313708 -2.686292,6 -6,6 -3.313708,0 -6,-2.686292 -6,-6 0,0 0,0 0,0"
            sodipodi:start="0"
            sodipodi:end="3.1415927"
            sodipodi:open="true" />
@@ -30190,7 +34868,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -30208,7 +34886,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -30242,7 +34920,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -30251,7 +34929,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -30265,7 +34943,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -30283,7 +34961,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -30296,7 +34974,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -30339,7 +35017,7 @@
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            transform="matrix(1.0911926,0,0,1.176776,253.08415,-79.548088)"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            sodipodi:ry="1.5"
            sodipodi:rx="1.5"
            sodipodi:cy="14.5"
@@ -30806,7 +35484,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -30831,7 +35509,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -30840,7 +35518,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -30892,7 +35570,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -30909,7 +35587,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -30982,7 +35660,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -30991,7 +35669,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -31011,7 +35689,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -31028,7 +35706,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -31099,7 +35777,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -31114,7 +35792,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -31131,7 +35809,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -31153,7 +35831,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -31162,7 +35840,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -31233,7 +35911,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 141.08637,118 a 9.0863705,9.0860729 0 1 1 -18.17274,0 9.0863705,9.0860729 0 1 1 18.17274,0 z"
+           d="m 141.08637,118 c 0,5.0181 -4.06811,9.08607 -9.08637,9.08607 -5.01826,0 -9.08637,-4.06797 -9.08637,-9.08607 0,-5.0181 4.06811,-9.08607 9.08637,-9.08607 5.01826,0 9.08637,4.06797 9.08637,9.08607 z"
            sodipodi:ry="9.0860729"
            sodipodi:rx="9.0863705"
            sodipodi:cy="118"
@@ -31259,7 +35937,7 @@
            sodipodi:cy="118"
            sodipodi:rx="9.0863705"
            sodipodi:ry="9.0860729"
-           d="m 141.08637,118 a 9.0863705,9.0860729 0 1 1 -18.17274,0 9.0863705,9.0860729 0 1 1 18.17274,0 z"
+           d="m 141.08637,118 c 0,5.0181 -4.06811,9.08607 -9.08637,9.08607 -5.01826,0 -9.08637,-4.06797 -9.08637,-9.08607 0,-5.0181 4.06811,-9.08607 9.08637,-9.08607 5.01826,0 9.08637,4.06797 9.08637,9.08607 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -31506,7 +36184,7 @@
              sodipodi:cy="-222"
              sodipodi:rx="3.3084693"
              sodipodi:ry="1.2798798"
-             d="m 111.30847,-222 a 3.3084693,1.2798798 0 1 1 -6.61694,0 3.3084693,1.2798798 0 1 1 6.61694,0 z"
+             d="m 111.30847,-222 c 0,0.70686 -1.48125,1.27988 -3.30847,1.27988 -1.82722,0 -3.30847,-0.57302 -3.30847,-1.27988 0,-0.70686 1.48125,-1.27988 3.30847,-1.27988 1.82722,0 3.30847,0.57302 3.30847,1.27988 z"
              transform="matrix(1.0307577,0,0,0.9140456,39.651558,-39.251735)" />
           <path
              sodipodi:nodetypes="cssss"
@@ -31571,7 +36249,7 @@
              sodipodi:cy="-222"
              sodipodi:rx="3.3084693"
              sodipodi:ry="1.2798798"
-             d="m 111.30847,-222 a 3.3084693,1.2798798 0 1 1 -6.61694,0 3.3084693,1.2798798 0 1 1 6.61694,0 z"
+             d="m 111.30847,-222 c 0,0.70686 -1.48125,1.27988 -3.30847,1.27988 -1.82722,0 -3.30847,-0.57302 -3.30847,-1.27988 0,-0.70686 1.48125,-1.27988 3.30847,-1.27988 1.82722,0 3.30847,0.57302 3.30847,1.27988 z"
              transform="matrix(1.0307577,0,0,0.9140456,39.651558,-39.251735)" />
           <path
              sodipodi:nodetypes="cssss"
@@ -31665,7 +36343,7 @@
              inkscape:connector-curvature="0" />
           <path
              transform="matrix(1.0307577,0,0,0.9140456,39.651558,-39.251735)"
-             d="m 111.30847,-222 a 3.3084693,1.2798798 0 1 1 -6.61694,0 3.3084693,1.2798798 0 1 1 6.61694,0 z"
+             d="m 111.30847,-222 c 0,0.70686 -1.48125,1.27988 -3.30847,1.27988 -1.82722,0 -3.30847,-0.57302 -3.30847,-1.27988 0,-0.70686 1.48125,-1.27988 3.30847,-1.27988 1.82722,0 3.30847,0.57302 3.30847,1.27988 z"
              sodipodi:ry="1.2798798"
              sodipodi:rx="3.3084693"
              sodipodi:cy="-222"
@@ -31753,7 +36431,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            transform="matrix(1.176776,0,0,1.176776,-12.47787,-2.548088)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -31821,7 +36499,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -32050,7 +36728,7 @@
                inkscape:export-xdpi="90"
                inkscape:export-ydpi="90">
               <path
-                 d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+                 d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
                  sodipodi:ry="8"
                  sodipodi:rx="8"
                  sodipodi:cy="118"
@@ -32074,7 +36752,7 @@
                  sodipodi:cy="118"
                  sodipodi:rx="8"
                  sodipodi:ry="8"
-                 d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z" />
+                 d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z" />
             </g>
             <path
                style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
@@ -32123,7 +36801,7 @@
           </g>
         </g>
         <path
-           d="m 139.7074,118 a 7.7074003,7.7241406 0 1 1 -15.4148,0 7.7074003,7.7241406 0 1 1 15.4148,0 z"
+           d="m 139.7074,118 c 0,4.26593 -3.45072,7.72414 -7.7074,7.72414 -4.25668,0 -7.7074,-3.45821 -7.7074,-7.72414 0,-4.26593 3.45072,-7.72414 7.7074,-7.72414 4.25668,0 7.7074,3.45821 7.7074,7.72414 z"
            sodipodi:ry="7.7241406"
            sodipodi:rx="7.7074003"
            sodipodi:cy="118"
@@ -32279,7 +36957,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -32319,7 +36997,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -32451,7 +37129,7 @@
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -32562,7 +37240,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -32602,7 +37280,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -32641,7 +37319,7 @@
            sodipodi:cy="119.5"
            sodipodi:rx="5.5"
            sodipodi:ry="5.5"
-           d="m 196,119.5 a 5.5,5.5 0 1 1 -11,0 5.5,5.5 0 1 1 11,0 z"
+           d="m 196,119.5 c 0,3.03757 -2.46243,5.5 -5.5,5.5 -3.03757,0 -5.5,-2.46243 -5.5,-5.5 0,-3.03757 2.46243,-5.5 5.5,-5.5 3.03757,0 5.5,2.46243 5.5,5.5 z"
            transform="matrix(0.61819,0,0,0.618186,73.23488,45.12681)" />
       </g>
     </g>
@@ -32660,7 +37338,7 @@
          id="g24576">
         <path
            transform="matrix(1.4256767,0,0,1.4314068,-320.1963,68.175135)"
-           d="m 333.29445,35.5 a 2.7944512,2.7944512 0 1 1 -5.5889,0 2.7944512,2.7944512 0 1 1 5.5889,0 z"
+           d="m 333.29445,35.5 c 0,1.543333 -1.25112,2.794451 -2.79445,2.794451 -1.54333,0 -2.79445,-1.251118 -2.79445,-2.794451 0,-1.543333 1.25112,-2.794451 2.79445,-2.794451 1.54333,0 2.79445,1.251118 2.79445,2.794451 z"
            sodipodi:ry="2.7944512"
            sodipodi:rx="2.7944512"
            sodipodi:cy="35.5"
@@ -32670,7 +37348,7 @@
            sodipodi:type="arc" />
         <path
            transform="matrix(1.2885487,0,0,1.2885617,-274.87525,73.246084)"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            sodipodi:ry="3.5"
            sodipodi:rx="3.5"
            sodipodi:cy="35.5"
@@ -32686,7 +37364,7 @@
            sodipodi:cy="35.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(-1.288521,0,0,-1.2885339,576.8463,164.73299)" />
       </g>
     </g>
@@ -32964,7 +37642,7 @@
            sodipodi:cy="165"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 148,165 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 148,165 c 0,0.55228 -0.44772,1 -1,1 -0.55228,0 -1,-0.44772 -1,-1 0,-0.55228 0.44772,-1 1,-1 0.55228,0 1,0.44772 1,1 z"
            transform="matrix(1.5,0,0,1.5,-73.5,-83.5)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -32983,7 +37661,7 @@
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            transform="matrix(1.5,0,0,1.5,-66.5,-83.5)"
-           d="m 148,165 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 148,165 c 0,0.55228 -0.44772,1 -1,1 -0.55228,0 -1,-0.44772 -1,-1 0,-0.55228 0.44772,-1 1,-1 0.55228,0 1,0.44772 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="165"
@@ -33024,7 +37702,7 @@
            sodipodi:cy="78.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(-1.4308622,0,0,1.4308687,469.36987,363.18486)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -33052,7 +37730,7 @@
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            transform="matrix(-1.4308622,0,0,1.4308687,469.36987,363.18486)"
-           d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            sodipodi:ry="3.5"
            sodipodi:rx="3.5"
            sodipodi:cy="78.5"
@@ -33078,13 +37756,13 @@
              sodipodi:cy="78.5"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(-1.14287,0,0,1.142863,463.9317,115.7853)" />
           <g
              id="g35307">
             <path
                transform="matrix(1.1162596,0,0,1.1065394,80.948334,-350.49863)"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                sodipodi:ry="2.5"
                sodipodi:rx="2.5312502"
                sodipodi:cy="502"
@@ -33100,13 +37778,13 @@
                sodipodi:cy="502"
                sodipodi:rx="2.5312502"
                sodipodi:ry="2.5"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                transform="matrix(-1.087144,-0.2518404,0.2525206,-1.0776772,126.97246,766.619)" />
           </g>
           <path
              inkscape:transform-center-y="-6.490455"
              inkscape:transform-center-x="-3.3976162"
-             d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="135"
@@ -33692,7 +38370,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -33709,7 +38387,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -33723,7 +38401,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -33853,7 +38531,7 @@
            sodipodi:cy="35.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(1.000048,0,0,0.999998,-0.01591645,12.000064)" />
         <path
            style="opacity:0.6;fill:none;stroke:url(#linearGradient15711);stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0.5;display:inline"
@@ -33869,7 +38547,7 @@
            sodipodi:cy="35.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(0.857099,0,0,0.857147,47.22893,17.071296)" />
       </g>
     </g>
@@ -33897,7 +38575,7 @@
            style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline" />
         <path
            transform="matrix(1.000048,0,0,0.999998,-0.01591645,12.000064)"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            sodipodi:ry="3.5"
            sodipodi:rx="3.5"
            sodipodi:cy="35.5"
@@ -33913,7 +38591,7 @@
            inkscape:connector-curvature="0" />
         <path
            transform="matrix(0.857099,0,0,0.857147,47.22893,17.071296)"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            sodipodi:ry="3.5"
            sodipodi:rx="3.5"
            sodipodi:cy="35.5"
@@ -33940,7 +38618,7 @@
          style="display:inline">
         <path
            transform="matrix(1.142871,0,0,1.142855,-27.218817,-5.0713453)"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            sodipodi:ry="3.5"
            sodipodi:rx="3.5"
            sodipodi:cy="35.5"
@@ -33956,7 +38634,7 @@
            sodipodi:cy="35.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(0.857099,0,0,0.857147,67.228993,5.071249)" />
       </g>
     </g>
@@ -34302,7 +38980,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -34320,7 +38998,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -34973,7 +39651,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -34999,7 +39677,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -35134,7 +39812,7 @@
          sodipodi:cy="118"
          sodipodi:rx="8"
          sodipodi:ry="8"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90" />
@@ -35142,7 +39820,7 @@
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -35161,7 +39839,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -35170,7 +39848,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -36541,7 +41219,7 @@
            sodipodi:cy="35.5"
            sodipodi:rx="2.7944512"
            sodipodi:ry="2.7944512"
-           d="m 333.29445,35.5 a 2.7944512,2.7944512 0 1 1 -5.5889,0 2.7944512,2.7944512 0 1 1 5.5889,0 z"
+           d="m 333.29445,35.5 c 0,1.543333 -1.25112,2.794451 -2.79445,2.794451 -1.54333,0 -2.79445,-1.251118 -2.79445,-2.794451 0,-1.543333 1.25112,-2.794451 2.79445,-2.794451 1.54333,0 2.79445,1.251118 2.79445,2.794451 z"
            transform="matrix(1.4256767,0,0,1.4314068,-320.1963,68.175135)" />
         <path
            sodipodi:type="arc"
@@ -36551,11 +41229,11 @@
            sodipodi:cy="35.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(1.2885487,0,0,1.2885617,-274.87525,73.246084)" />
         <path
            transform="matrix(-1.288521,0,0,-1.2885339,576.8463,164.73299)"
-           d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            sodipodi:ry="3.5"
            sodipodi:rx="3.5"
            sodipodi:cy="35.5"
@@ -36667,7 +41345,7 @@
            inkscape:connector-curvature="0" />
         <path
            transform="matrix(0.8675713,0,0,-1.199958,80.598976,391.9948)"
-           d="m 93.25,125 a 1.75,1.25 0 1 1 -3.5,0 1.75,1.25 0 1 1 3.5,0 z"
+           d="m 93.25,125 c 0,0.69036 -0.783502,1.25 -1.75,1.25 -0.966498,0 -1.75,-0.55964 -1.75,-1.25 0,-0.69036 0.783502,-1.25 1.75,-1.25 0.966498,0 1.75,0.55964 1.75,1.25 z"
            sodipodi:ry="1.25"
            sodipodi:rx="1.75"
            sodipodi:cy="125"
@@ -36689,11 +41367,11 @@
            sodipodi:cy="125"
            sodipodi:rx="1.75"
            sodipodi:ry="1.25"
-           d="m 93.25,125 a 1.75,1.25 0 1 1 -3.5,0 1.75,1.25 0 1 1 3.5,0 z"
+           d="m 93.25,125 c 0,0.69036 -0.783502,1.25 -1.75,1.25 -0.966498,0 -1.75,-0.55964 -1.75,-1.25 0,-0.69036 0.783502,-1.25 1.75,-1.25 0.966498,0 1.75,0.55964 1.75,1.25 z"
            transform="matrix(0.8540253,0,0,-1.199954,81.814709,391.9942)" />
         <path
            transform="matrix(0.8540253,0,0,-1.199954,81.814709,391.9942)"
-           d="m 93.25,125 a 1.75,1.25 0 1 1 -3.5,0 1.75,1.25 0 1 1 3.5,0 z"
+           d="m 93.25,125 c 0,0.69036 -0.783502,1.25 -1.75,1.25 -0.966498,0 -1.75,-0.55964 -1.75,-1.25 0,-0.69036 0.783502,-1.25 1.75,-1.25 0.966498,0 1.75,0.55964 1.75,1.25 z"
            sodipodi:ry="1.25"
            sodipodi:rx="1.75"
            sodipodi:cy="125"
@@ -36738,7 +41416,7 @@
              inkscape:connector-curvature="0" />
           <path
              transform="matrix(3.625,0,0,3.1690202,-67.8125,318.31703)"
-             d="m 14.5,57.5 a 1,1.0000004 0 1 1 -2,0 1,1.0000004 0 1 1 2,0 z"
+             d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
              sodipodi:ry="1.0000004"
              sodipodi:rx="1"
              sodipodi:cy="57.5"
@@ -36755,7 +41433,7 @@
         </g>
         <path
            transform="matrix(3.5999897,0,0,3.1249932,-67.499871,320.6879)"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="57.5"
@@ -36777,11 +41455,11 @@
            sodipodi:cy="57.5"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            transform="matrix(3.25,0,0,3.25,-62.875,313.125)" />
         <path
            transform="matrix(2,0,0,2,-46,385)"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="57.5"
@@ -36797,7 +41475,7 @@
            sodipodi:cy="57.5"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            transform="matrix(4.7519907,0,0,4.1435313,-83.051884,262.12196)" />
         <path
            sodipodi:nodetypes="cccccc"
@@ -37037,7 +41715,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(1.3955004,0,0,1.2452423,11.18333,-121.72474)" />
         <rect
            rx="0.5078125"
@@ -37050,7 +41728,7 @@
            style="opacity:0.25;fill:none;stroke:#ffffff;stroke-width:0.99999988;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
            transform="matrix(1.5770887,0,0,1.5999841,-3.50675,-301.69208)"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            sodipodi:ry="2.5"
            sodipodi:rx="2.5312502"
            sodipodi:cy="502"
@@ -37066,11 +41744,11 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(1.1794014,0,0,0.8999954,27.50686,48.952303)" />
         <path
            transform="matrix(1.1827463,0,0,1.2,27.245789,-99.900024)"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            sodipodi:ry="2.5"
            sodipodi:rx="2.5312502"
            sodipodi:cy="502"
@@ -37086,7 +41764,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(0.790122,0,0,0.787736,57.870479,107.05649)" />
         <g
            id="g16548"
@@ -37099,7 +41777,7 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.7901234,0,0,0.2000006,9.8760061,395.5997)" />
           <path
              sodipodi:nodetypes="csccc"
@@ -37144,11 +41822,11 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(1.1827463,0,0,1.2,27.245789,-99.900024)" />
         <path
            transform="matrix(0.8888868,0,0,0.8862026,50.166822,57.626266)"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            sodipodi:ry="2.5"
            sodipodi:rx="2.5312502"
            sodipodi:cy="502"
@@ -37164,7 +41842,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(0.1975308,0,0,0.1999991,103.0926,401.10045)" />
         <path
            sodipodi:type="arc"
@@ -37174,7 +41852,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(-0.8867575,0.06148883,-0.06130315,-0.8840797,219.44126,941.51187)" />
       </g>
     </g>
@@ -37248,7 +41926,7 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.7834486,0,0,0.2000006,10.413535,395.5997)" />
           <path
              sodipodi:nodetypes="csccc"
@@ -37294,7 +41972,7 @@
            transform="translate(1.1408497e-7,0.5000446)">
           <path
              transform="matrix(1.187982,0,0,1.0569758,379.83032,-513.21497)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37310,11 +41988,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(1.3827154,0,0,1.4028327,364.1482,-688.72206)" />
           <path
              transform="matrix(0.987526,0,0,0.8124641,394.9733,-392.80617)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37330,11 +42008,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.9848328,0,0,0.9992585,395.19018,-485.12778)" />
           <path
              transform="matrix(0.591154,0,0,0.5887513,425.87219,-279.05319)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37344,7 +42022,7 @@
              sodipodi:type="arc" />
           <path
              transform="matrix(0.9913883,0,0,1.0058976,394.67318,-488.46061)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37360,11 +42038,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.6941559,0,0,0.6920597,417.67198,-331.15708)" />
           <path
              transform="matrix(0.1975308,0,0,0.1999991,456.0926,-84.399595)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37374,7 +42052,7 @@
              sodipodi:type="arc" />
           <path
              transform="matrix(-0.6760501,-0.1575078,0.1570322,-0.6740085,446.07727,367.34791)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37453,7 +42131,7 @@
            id="g22118">
           <path
              transform="matrix(0.7834486,0,0,0.2000006,10.413535,395.5997)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37511,11 +42189,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(1.187982,0,0,1.0569758,379.83032,-513.21497)" />
           <path
              transform="matrix(1.3827154,0,0,1.4028327,364.1482,-688.72206)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37531,11 +42209,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.987526,0,0,0.8124641,394.9733,-392.80617)" />
           <path
              transform="matrix(0.9848328,0,0,0.9992585,395.19018,-485.12778)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37551,7 +42229,7 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.591154,0,0,0.5887513,425.87219,-279.05319)" />
           <path
              sodipodi:type="arc"
@@ -37561,11 +42239,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.9913883,0,0,1.0058976,394.67318,-488.46061)" />
           <path
              transform="matrix(0.6941559,0,0,0.6920597,417.84876,-330.91401)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -37581,7 +42259,7 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.1975308,0,0,0.1999991,456.07844,-84.89955)" />
         </g>
         <path
@@ -37614,9 +42292,9 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37626,7 +42304,7 @@
          sodipodi:type="arc"
          transform="matrix(1.3340954,0,0,1.3333333,-184.1736,-187.16666)" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37653,7 +42331,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 440.514,108.7895 a 3,3 0 1 1 2.1568,2.59363" />
+         d="m 440.514,108.7895 c -0.15988,-1.64913 1.04738,-3.11561 2.6965,-3.2755 1.64913,-0.15988 3.11561,1.04738 3.2755,2.6965 0.15988,1.64913 -1.04738,3.11561 -2.6965,3.2755 -0.37605,0.0365 -0.75561,0.002 -1.1187,-0.10287" />
       <path
          transform="matrix(1.1662469,0,0,1.1666676,-109.73384,-169.08343)"
          sodipodi:type="arc"
@@ -37663,12 +42341,12 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <path
          sodipodi:open="true"
          sodipodi:end="5.930273"
          sodipodi:start="0.96146912"
-         d="m 445.21695,110.9601 a 3,3 0 1 1 1.09816,-3.497"
+         d="m 445.21695,110.9601 c -1.35868,0.94824 -3.22881,0.61552 -4.17705,-0.74315 -0.94824,-1.35868 -0.61552,-3.22881 0.74315,-4.17705 1.35868,-0.94824 3.22881,-0.61552 4.17705,0.74315 0.14695,0.21056 0.26626,0.43911 0.35501,0.68005"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37693,7 +42371,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <rect
          y="-43"
          x="407"
@@ -37702,7 +42380,7 @@
          id="rect30207"
          style="fill:#2b2200;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37785,7 +42463,7 @@
          x="403"
          y="-48" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37803,7 +42481,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <path
          transform="matrix(1.1662469,0,0,1.1666676,-103.72925,-170.08344)"
          sodipodi:type="arc"
@@ -37813,7 +42491,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <path
          style="fill:#787878;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          d="m 407.5,-39.5 0,1.999993 -2,0 0,2 2,0 0,1 1,1 5,7e-6 0,-1 2.99542,0 1.5,1 0.25,0 0,-5 -0.25,0 -1.5,1 -2.99542,0 0,-2 -6,0 z"
@@ -37821,7 +42499,7 @@
          sodipodi:nodetypes="cccccccccccccccccc"
          inkscape:connector-curvature="0" />
       <path
-         d="m 440.514,108.7895 a 3,3 0 1 1 2.1568,2.59363"
+         d="m 440.514,108.7895 c -0.15988,-1.64913 1.04738,-3.11561 2.6965,-3.2755 1.64913,-0.15988 3.11561,1.04738 3.2755,2.6965 0.15988,1.64913 -1.04738,3.11561 -2.6965,3.2755 -0.37605,0.0365 -0.75561,0.002 -1.1187,-0.10287"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37834,7 +42512,7 @@
          sodipodi:end="8.1340281"
          sodipodi:open="true" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37852,7 +42530,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 445.21695,110.9601 a 3,3 0 1 1 1.09816,-3.497"
+         d="m 445.21695,110.9601 c -1.35868,0.94824 -3.22881,0.61552 -4.17705,-0.74315 -0.94824,-1.35868 -0.61552,-3.22881 0.74315,-4.17705 1.35868,-0.94824 3.22881,-0.61552 4.17705,0.74315 0.14695,0.21056 0.26626,0.43911 0.35501,0.68005"
          sodipodi:start="0.96146912"
          sodipodi:end="5.930273"
          sodipodi:open="true" />
@@ -37864,7 +42542,7 @@
          x="409"
          y="-41" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37889,7 +42567,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <rect
          y="-43.99012"
          x="413.00003"
@@ -37964,7 +42642,7 @@
          x="403"
          y="-48" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -37982,7 +42660,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <path
          transform="matrix(1.1662469,0,0,1.1666676,-103.72925,-170.08344)"
          sodipodi:type="arc"
@@ -37992,7 +42670,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <path
          style="fill:#787878;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          d="m 407.5,-39.5 0,1.999993 -2,0 0,2 2,0 0,1 1,1 5,7e-6 0,-1 2.99542,0 1.5,1 0.25,0 0,-5 -0.25,0 -1.5,1 -2.99542,0 0,-2 -6,0 z"
@@ -38000,7 +42678,7 @@
          sodipodi:nodetypes="cccccccccccccccccc"
          inkscape:connector-curvature="0" />
       <path
-         d="m 440.514,108.7895 a 3,3 0 1 1 2.1568,2.59363"
+         d="m 440.514,108.7895 c -0.15988,-1.64913 1.04738,-3.11561 2.6965,-3.2755 1.64913,-0.15988 3.11561,1.04738 3.2755,2.6965 0.15988,1.64913 -1.04738,3.11561 -2.6965,3.2755 -0.37605,0.0365 -0.75561,0.002 -1.1187,-0.10287"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -38013,7 +42691,7 @@
          sodipodi:end="8.1340281"
          sodipodi:open="true" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -38031,7 +42709,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 445.21695,110.9601 a 3,3 0 1 1 1.09816,-3.497"
+         d="m 445.21695,110.9601 c -1.35868,0.94824 -3.22881,0.61552 -4.17705,-0.74315 -0.94824,-1.35868 -0.61552,-3.22881 0.74315,-4.17705 1.35868,-0.94824 3.22881,-0.61552 4.17705,0.74315 0.14695,0.21056 0.26626,0.43911 0.35501,0.68005"
          sodipodi:start="0.96146912"
          sodipodi:end="5.930273"
          sodipodi:open="true" />
@@ -38043,7 +42721,7 @@
          x="409"
          y="-41" />
       <path
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z"
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z"
          sodipodi:ry="3"
          sodipodi:rx="3"
          sodipodi:cy="108.5"
@@ -38068,7 +42746,7 @@
          sodipodi:cy="108.5"
          sodipodi:rx="3"
          sodipodi:ry="3"
-         d="m 446.5,108.5 a 3,3 0 1 1 -6,0 3,3 0 1 1 6,0 z" />
+         d="m 446.5,108.5 c 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 z" />
       <rect
          y="-43.99012"
          x="413.00003"
@@ -39088,11 +43766,11 @@
              sodipodi:cy="192.5"
              sodipodi:rx="1.75"
              sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              transform="matrix(1.9999998,0,0,2.0000014,-462.99991,-192.00026)" />
           <path
              transform="matrix(1.4285718,0,0,1.4285718,-197.57158,-82.000059)"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              sodipodi:ry="1.75"
              sodipodi:rx="1.75"
              sodipodi:cy="192.5"
@@ -39108,7 +43786,7 @@
              sodipodi:cy="192.5"
              sodipodi:rx="1.75"
              sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              transform="matrix(0.8571429,0,0,0.8571429,67.857123,27.999992)" />
         </g>
         <rect
@@ -39150,7 +43828,7 @@
              sodipodi:cy="-222"
              sodipodi:rx="3.3084693"
              sodipodi:ry="1.2798798"
-             d="m 111.30847,-222 a 3.3084693,1.2798798 0 1 1 -6.61694,0 3.3084693,1.2798798 0 1 1 6.61694,0 z"
+             d="m 111.30847,-222 c 0,0.70686 -1.48125,1.27988 -3.30847,1.27988 -1.82722,0 -3.30847,-0.57302 -3.30847,-1.27988 0,-0.70686 1.48125,-1.27988 3.30847,-1.27988 1.82722,0 3.30847,0.57302 3.30847,1.27988 z"
              transform="matrix(0.9067635,0,0,1.3047091,374.56954,447.97555)" />
           <path
              sodipodi:nodetypes="cccsccc"
@@ -39166,7 +43844,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -39180,7 +43858,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -39192,7 +43870,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -39440,7 +44118,7 @@
            y="328.03571" />
         <path
            transform="matrix(1.6666708,0,0,1.6666633,-190.66784,-215.66559)"
-           d="m 287.5,325 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="m 287.5,325 c 0,0.82843 -0.67157,1.5 -1.5,1.5 -0.82843,0 -1.5,-0.67157 -1.5,-1.5 0,-0.82843 0.67157,-1.5 1.5,-1.5 0.82843,0 1.5,0.67157 1.5,1.5 z"
            sodipodi:ry="1.5"
            sodipodi:rx="1.5"
            sodipodi:cy="325"
@@ -39470,7 +44148,7 @@
            sodipodi:cy="325"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 287.5,325 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="m 287.5,325 c 0,0.82843 -0.67157,1.5 -1.5,1.5 -0.82843,0 -1.5,-0.67157 -1.5,-1.5 0,-0.82843 0.67157,-1.5 1.5,-1.5 0.82843,0 1.5,0.67157 1.5,1.5 z"
            transform="matrix(1.333351,0,0,1.333345,-95.338377,-107.33714)" />
         <rect
            y="331"
@@ -39827,7 +44505,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -39840,7 +44518,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -39851,7 +44529,10 @@
     <g
        style="display:inline"
        id="g35565"
-       transform="translate(147,527.00001)">
+       transform="translate(147,527.00001)"
+       inkscape:export-filename="/home/wolter/Documenten/Blender/Icons/Fake2.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90">
       <rect
          y="71"
          x="215"
@@ -39866,7 +44547,7 @@
            id="g34916">
           <path
              transform="translate(58.032932,-27.838387)"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="-32"
@@ -39882,7 +44563,7 @@
              sodipodi:cy="-32"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(1.4285714,0,0,1.4274429,55.5,-11.825777)" />
         </g>
         <g
@@ -39896,11 +44577,11 @@
              sodipodi:cy="-32"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(1.1751782,0,0,1.1751782,56.000001,-1.2882925)" />
           <path
              transform="matrix(0.9994022,0,0,0.9994021,56.002092,-6.9152216)"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="-32"
@@ -39916,7 +44597,7 @@
              sodipodi:cy="-32"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(0.774689,0,0,0.7805148,56.890573,-14.812697)" />
           <path
              sodipodi:type="arc"
@@ -39926,11 +44607,11 @@
              sodipodi:cy="-32"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(1.0042021,0,0,1.0042021,55.985293,-6.7448206)" />
           <path
              transform="matrix(0.9108044,0,0,0.9108044,55.985293,-9.7335486)"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="-32"
@@ -39944,7 +44625,7 @@
            id="g34934">
           <path
              transform="matrix(0.8571429,0,0,0.8571429,58.032932,-32.409816)"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="-32"
@@ -39960,11 +44641,11 @@
              sodipodi:cy="-32"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(0.7142853,0,0,0.7142853,58.032932,-36.981258)" />
           <path
              transform="translate(58.032932,-27.838387)"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="-32"
@@ -39980,7 +44661,7 @@
              sodipodi:cy="-32"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 3.5,-32 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 3.5,-32 c 0,1.932997 -1.5670034,3.5 -3.5,3.5 -1.9329966,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.5670034,-3.5 3.5,-3.5 1.9329966,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(0.8571429,0,0,0.8571429,58.032932,-32.409816)" />
         </g>
       </g>
@@ -39988,7 +44669,10 @@
     <g
        style="display:inline"
        id="g35712"
-       transform="translate(307,636)">
+       transform="translate(307,636)"
+       inkscape:export-filename="/home/wolter/Documenten/Blender/Icons/Fake1.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90">
       <rect
          y="-38"
          x="34"
@@ -40261,7 +44945,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -40278,7 +44962,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -40287,7 +44971,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -41218,7 +45902,7 @@
          inkscape:export-ydpi="90"
          transform="matrix(1.0004639,0,0,0.9963165,-69.122722,304.28985)">
         <path
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -41244,7 +45928,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -41254,7 +45938,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -41267,7 +45951,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -41291,7 +45975,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -41388,7 +46072,7 @@
        inkscape:export-ydpi="90"
        transform="matrix(1.0004639,0,0,0.9963165,-237.12363,495.28986)">
       <path
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -41414,7 +46098,7 @@
          sodipodi:cy="118"
          sodipodi:rx="8"
          sodipodi:ry="8"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90"
@@ -41424,7 +46108,7 @@
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -41437,7 +46121,7 @@
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -41461,7 +46145,7 @@
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -41718,7 +46402,7 @@
              sodipodi:cy="-222"
              sodipodi:rx="3.3084693"
              sodipodi:ry="1.2798798"
-             d="m 111.30847,-222 a 3.3084693,1.2798798 0 1 1 -6.61694,0 3.3084693,1.2798798 0 1 1 6.61694,0 z"
+             d="m 111.30847,-222 c 0,0.70686 -1.48125,1.27988 -3.30847,1.27988 -1.82722,0 -3.30847,-0.57302 -3.30847,-1.27988 0,-0.70686 1.48125,-1.27988 3.30847,-1.27988 1.82722,0 3.30847,0.57302 3.30847,1.27988 z"
              transform="matrix(0.9067635,0,0,1.3047091,374.56954,447.97555)" />
           <path
              sodipodi:nodetypes="cccsccc"
@@ -42525,7 +47209,7 @@
          inkscape:export-ydpi="90"
          transform="matrix(1.0004639,0,0,0.9963165,-237.11238,367.28985)">
         <path
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -42546,7 +47230,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -42555,7 +47239,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -42583,7 +47267,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -42592,7 +47276,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -43071,11 +47755,11 @@
            sodipodi:cy="-23"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            transform="translate(0.5,-0.46875)" />
         <path
            transform="matrix(1.2143583,0,0,1.1512108,-28.054112,2.9290602)"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="-23"
@@ -43085,7 +47769,7 @@
            sodipodi:type="arc" />
         <path
            transform="matrix(0.8392157,0,0,0.8382979,21.884318,-4.2140957)"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="-23"
@@ -43114,7 +47798,7 @@
            sodipodi:cy="-23"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            transform="matrix(1.2116904,0,0,1.1282344,-22.693138,2.3776257)" />
         <path
            sodipodi:type="arc"
@@ -43124,7 +47808,7 @@
            sodipodi:cy="-23"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            transform="matrix(0.8392157,0,0,0.8382979,26.893134,-4.2140957)" />
         <path
            style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
@@ -43201,7 +47885,7 @@
              inkscape:connector-curvature="0" />
           <path
              transform="matrix(0.9067635,0,0,1.2421435,374.56954,430.00586)"
-             d="m 111.30847,-222 a 3.3084693,1.2798798 0 1 1 -6.61694,0 3.3084693,1.2798798 0 1 1 6.61694,0 z"
+             d="m 111.30847,-222 c 0,0.70686 -1.48125,1.27988 -3.30847,1.27988 -1.82722,0 -3.30847,-0.57302 -3.30847,-1.27988 0,-0.70686 1.48125,-1.27988 3.30847,-1.27988 1.82722,0 3.30847,0.57302 3.30847,1.27988 z"
              sodipodi:ry="1.2798798"
              sodipodi:rx="3.3084693"
              sodipodi:cy="-222"
@@ -43278,7 +47962,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -43295,7 +47979,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -43309,7 +47993,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -43351,7 +48035,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -43364,7 +48048,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -44093,7 +48777,7 @@
       </g>
       <path
          transform="matrix(0.9,0,0,0.9,7.6,60.3)"
-         d="m 80.166667,603 a 4.1666665,4.1666665 0 1 1 -8.333334,0 4.1666665,4.1666665 0 1 1 8.333334,0 z"
+         d="m 80.166667,603 c 0,2.30119 -1.865481,4.16667 -4.166667,4.16667 -2.301186,0 -4.166667,-1.86548 -4.166667,-4.16667 0,-2.30119 1.865481,-4.16667 4.166667,-4.16667 2.301186,0 4.166667,1.86548 4.166667,4.16667 z"
          sodipodi:ry="4.1666665"
          sodipodi:rx="4.1666665"
          sodipodi:cy="603"
@@ -45675,7 +50359,7 @@
            inkscape:connector-curvature="0" />
         <path
            transform="matrix(0.9552133,0,0,0.9315985,-40.901258,-140.2522)"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            sodipodi:ry="2.5"
            sodipodi:rx="2.5312502"
            sodipodi:cy="502"
@@ -45687,7 +50371,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="135"
@@ -45882,7 +50566,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(0.9552133,0,0,0.9315985,-40.901258,-140.2522)" />
         <path
            transform="matrix(0.99567,0,-0.00787885,1,-30.654936,191)"
@@ -45893,7 +50577,7 @@
            sodipodi:cy="135"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -46083,7 +50767,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(0.9552133,0,0,0.9315985,-40.901258,-140.2522)" />
         <path
            transform="matrix(0.99567,0,-0.00787885,1,-30.663533,191)"
@@ -46094,7 +50778,7 @@
            sodipodi:cy="135"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -46739,9 +51423,9 @@
          sodipodi:cy="79.5"
          sodipodi:rx="3.5"
          sodipodi:ry="3.5"
-         d="m 211,79.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z" />
+         d="m 211,79.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z" />
       <path
-         d="m 211,79.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+         d="m 211,79.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
          sodipodi:ry="3.5"
          sodipodi:rx="3.5"
          sodipodi:cy="79.5"
@@ -47283,7 +51967,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -47299,7 +51983,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -48171,13 +52855,13 @@
            sodipodi:cy="554"
            sodipodi:rx="4.5"
            sodipodi:ry="2.25"
-           d="m 57.5,554 a 4.5,2.25 0 1 1 -9,0 4.5,2.25 0 1 1 9,0 z"
+           d="m 57.5,554 c 0,1.24264 -2.014719,2.25 -4.5,2.25 -2.485281,0 -4.5,-1.00736 -4.5,-2.25 0,-1.24264 2.014719,-2.25 4.5,-2.25 2.485281,0 4.5,1.00736 4.5,2.25 z"
            transform="matrix(0.7630859,-0.2494396,0.2996015,0.9926766,-151.92281,17.77746)" />
         <path
            clip-path="url(#clipPath20586)"
            inkscape:transform-center-y="0.3813435"
            transform="matrix(0.3848865,-0.1700959,0.2278131,0.3626733,-93.107467,361.59408)"
-           d="m 57.5,554 a 4.5,2.25 0 1 1 -9,0 4.5,2.25 0 1 1 9,0 z"
+           d="m 57.5,554 c 0,1.24264 -2.014719,2.25 -4.5,2.25 -2.485281,0 -4.5,-1.00736 -4.5,-2.25 0,-1.24264 2.014719,-2.25 4.5,-2.25 2.485281,0 4.5,1.00736 4.5,2.25 z"
            sodipodi:ry="2.25"
            sodipodi:rx="4.5"
            sodipodi:cy="554"
@@ -48580,7 +53264,7 @@
                  sodipodi:cy="57.5"
                  sodipodi:rx="1"
                  sodipodi:ry="1.0000004"
-                 d="m 14.5,57.5 a 1,1.0000004 0 1 1 -2,0 1,1.0000004 0 1 1 2,0 z"
+                 d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
                  transform="matrix(3.625,0,0,3.1690202,-67.8125,318.31703)" />
               <path
                  sodipodi:nodetypes="cccc"
@@ -48597,7 +53281,7 @@
                sodipodi:cy="57.5"
                sodipodi:rx="1"
                sodipodi:ry="1"
-               d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+               d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
                transform="matrix(3.5999897,0,0,3.1249932,-67.499871,320.6879)" />
             <path
                id="path25721"
@@ -48607,7 +53291,7 @@
                inkscape:connector-curvature="0" />
             <path
                transform="matrix(3.25,0,0,3.25,-62.875,313.125)"
-               d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+               d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
                sodipodi:ry="1"
                sodipodi:rx="1"
                sodipodi:cy="57.5"
@@ -48623,11 +53307,11 @@
                sodipodi:cy="57.5"
                sodipodi:rx="1"
                sodipodi:ry="1"
-               d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+               d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
                transform="matrix(2,0,0,2,-46,385)" />
             <path
                transform="matrix(4.7519907,0,0,4.1435313,-83.051884,262.12196)"
-               d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+               d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
                sodipodi:ry="1"
                sodipodi:rx="1"
                sodipodi:cy="57.5"
@@ -48870,7 +53554,7 @@
            sodipodi:nodetypes="ccscz"
            inkscape:connector-curvature="0" />
         <path
-           d="m 434.99991,14.5 a 3.9999149,2.91429 0 1 1 -7.99982,0 3.9999149,2.91429 0 1 1 7.99982,0 z"
+           d="m 434.99991,14.5 c 0,1.609518 -1.79082,2.91429 -3.99991,2.91429 -2.20909,0 -3.99991,-1.304772 -3.99991,-2.91429 0,-1.609518 1.79082,-2.91429 3.99991,-2.91429 2.20909,0 3.99991,1.304772 3.99991,2.91429 z"
            sodipodi:ry="2.91429"
            sodipodi:rx="3.9999149"
            sodipodi:cy="14.5"
@@ -48880,7 +53564,7 @@
            sodipodi:type="arc"
            transform="matrix(0.7500463,0,0,1.0294111,88.73017,294.07354)" />
         <path
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="135"
@@ -48903,7 +53587,7 @@
            id="rect27926"
            style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
         <path
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="135"
@@ -48980,7 +53664,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="3.9999149"
            sodipodi:ry="2.91429"
-           d="m 434.99991,14.5 a 3.9999149,2.91429 0 1 1 -7.99982,0 3.9999149,2.91429 0 1 1 7.99982,0 z" />
+           d="m 434.99991,14.5 c 0,1.609518 -1.79082,2.91429 -3.99991,2.91429 -2.20909,0 -3.99991,-1.304772 -3.99991,-2.91429 0,-1.609518 1.79082,-2.91429 3.99991,-2.91429 2.20909,0 3.99991,1.304772 3.99991,2.91429 z" />
         <path
            transform="matrix(2.249956,0,0,2.251405,267.75278,4.81032)"
            sodipodi:type="arc"
@@ -48990,7 +53674,7 @@
            sodipodi:cy="135"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z" />
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z" />
         <path
            id="path27428"
            d="m 412,306.5 c -3.5,0 -5,1.5 -6.5,3 1.5,1.5 2.75,4 6.5,4 3.75,0 5,-2.5 6.5,-4 -1.5,-1.5 -3,-3 -6.5,-3 z"
@@ -49013,7 +53697,7 @@
            sodipodi:cy="135"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z" />
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z" />
       </g>
     </g>
     <g
@@ -49182,7 +53866,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(0.9552133,0,0,0.9315985,-40.901258,-140.2522)" />
         <path
            transform="matrix(0.99567,0,-0.00787885,1,-30.663533,191)"
@@ -49193,7 +53877,7 @@
            sodipodi:cy="135"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -49278,7 +53962,7 @@
          id="g28085">
         <path
            transform="matrix(1.1162596,0,0,1.1065394,67.801614,-350.49863)"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            sodipodi:ry="2.5"
            sodipodi:rx="2.5312502"
            sodipodi:cy="502"
@@ -49294,7 +53978,7 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(-1.3568764,-0.3150232,0.3151738,-1.348049,102.81491,906.57916)" />
       </g>
       <path
@@ -49317,7 +54001,7 @@
          sodipodi:cy="425"
          sodipodi:rx="1.5"
          sodipodi:ry="1"
-         d="m 880,425 a 1.5,1 0 1 1 -3,0 1.5,1 0 1 1 3,0 z"
+         d="m 880,425 c 0,0.55228 -0.67157,1 -1.5,1 -0.82843,0 -1.5,-0.44772 -1.5,-1 0,-0.55228 0.67157,-1 1.5,-1 0.82843,0 1.5,0.44772 1.5,1 z"
          transform="matrix(0.6434675,-0.7329672,0.7942866,0.5945179,-26.858149,815.24158)" />
       <path
          inkscape:transform-center-y="-7.1785015"
@@ -49329,7 +54013,7 @@
          sodipodi:cy="78.5"
          sodipodi:rx="3.5"
          sodipodi:ry="3.5"
-         d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+         d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
          transform="matrix(-1.2857095,0,0,1.2857143,1210.8559,325.57143)"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
@@ -49537,7 +54221,7 @@
              sodipodi:cy="78.5"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(-1.4627004,0,0,1.4628053,551.73128,85.525552)"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
              inkscape:export-xdpi="90"
@@ -49583,7 +54267,7 @@
                sodipodi:cy="78.5"
                sodipodi:rx="3.5"
                sodipodi:ry="3.5"
-               d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+               d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
                transform="matrix(-1.2468441,0,0,1.246865,503.16273,106.89331)" />
           </g>
           <path
@@ -49609,7 +54293,7 @@
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
              transform="matrix(-1.4627004,0,0,1.4628053,551.73128,85.525552)"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="78.5"
@@ -49631,11 +54315,11 @@
                sodipodi:cy="502"
                sodipodi:rx="2.5312502"
                sodipodi:ry="2.5"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                transform="matrix(1.1162596,0,0,1.1065394,80.948334,-350.49863)" />
             <path
                transform="matrix(-1.087144,-0.2518404,0.2525206,-1.0776772,126.97246,766.619)"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                sodipodi:ry="2.5"
                sodipodi:rx="2.5312502"
                sodipodi:cy="502"
@@ -49645,7 +54329,7 @@
                sodipodi:type="arc" />
           </g>
           <path
-             d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="135"
@@ -49689,7 +54373,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -49704,7 +54388,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -49861,13 +54545,13 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
            transform="matrix(0.787566,0,0,0.779223,26.709197,21.3179)" />
         <path
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -49891,7 +54575,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z" />
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z" />
         <path
            sodipodi:nodetypes="cc"
            id="path27757"
@@ -49909,7 +54593,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -49919,7 +54603,7 @@
            sodipodi:type="arc"
            transform="matrix(0.6657538,0,0,0.6588051,42.794535,35.527157)" />
         <path
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -50486,7 +55170,7 @@
                inkscape:export-xdpi="90"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
                transform="matrix(1.176776,0,0,1.176776,-12.47787,-2.548088)"
-               d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+               d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
                sodipodi:ry="1.5"
                sodipodi:rx="1.5"
                sodipodi:cy="14.5"
@@ -51075,7 +55759,7 @@
            inkscape:connector-curvature="0" />
         <path
            transform="matrix(0.8490785,0,0,0.8469086,71.921104,-98.093334)"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            sodipodi:ry="2.5"
            sodipodi:rx="2.5312502"
            sodipodi:cy="502"
@@ -51087,7 +55771,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="135"
@@ -51225,7 +55909,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -51242,7 +55926,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -51256,7 +55940,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -51526,7 +56210,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -51543,7 +56227,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -51557,7 +56241,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -51768,13 +56452,13 @@
          sodipodi:cy="78.5"
          sodipodi:rx="3.5"
          sodipodi:ry="3.5"
-         d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+         d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
          transform="matrix(-1.14287,0,0,1.142863,463.9317,115.80133)" />
       <g
          id="g36232">
         <path
            transform="matrix(1.1162596,0,0,1.1065394,80.948334,-350.49863)"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            sodipodi:ry="2.5"
            sodipodi:rx="2.5312502"
            sodipodi:cy="502"
@@ -51790,13 +56474,13 @@
            sodipodi:cy="502"
            sodipodi:rx="2.5312502"
            sodipodi:ry="2.5"
-           d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+           d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
            transform="matrix(-1.087144,-0.2518404,0.2525206,-1.0776772,126.97246,766.619)" />
       </g>
       <path
          inkscape:transform-center-y="-5.7593212"
          inkscape:transform-center-x="-3.1120555"
-         d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+         d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
          sodipodi:ry="1"
          sodipodi:rx="1"
          sodipodi:cy="135"
@@ -51940,7 +56624,7 @@
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
              transform="matrix(-1.4627004,0,0,1.4628053,551.73128,85.525552)"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="78.5"
@@ -51985,7 +56669,7 @@
              id="g36286">
             <path
                transform="matrix(-1.2468441,0,0,1.246865,503.16273,106.89331)"
-               d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+               d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
                sodipodi:ry="3.5"
                sodipodi:rx="3.5"
                sodipodi:cy="78.5"
@@ -52022,7 +56706,7 @@
              sodipodi:cy="78.5"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(-1.4627004,0,0,1.4628053,551.73128,85.525552)"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
              inkscape:export-xdpi="90"
@@ -52033,7 +56717,7 @@
              id="g36296">
             <path
                transform="matrix(1.1162596,0,0,1.1065394,80.948334,-350.49863)"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                sodipodi:ry="2.5"
                sodipodi:rx="2.5312502"
                sodipodi:cy="502"
@@ -52049,7 +56733,7 @@
                sodipodi:cy="502"
                sodipodi:rx="2.5312502"
                sodipodi:ry="2.5"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                transform="matrix(-1.087144,-0.2518404,0.2525206,-1.0776772,126.97246,766.619)" />
           </g>
           <path
@@ -52061,7 +56745,7 @@
              sodipodi:cy="135"
              sodipodi:rx="1"
              sodipodi:ry="1"
-             d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z" />
+             d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z" />
         </g>
       </g>
     </g>
@@ -52079,7 +56763,7 @@
          sodipodi:cy="78.5"
          sodipodi:rx="3.5"
          sodipodi:ry="3.5"
-         d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+         d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
          transform="matrix(-1.5000024,0,0,1.4990511,528.75064,424.32781)"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
@@ -52113,7 +56797,7 @@
            sodipodi:cy="78.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(-1.5714299,0,0,1.5714268,505.21462,331.643)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -52152,13 +56836,13 @@
              sodipodi:cy="78.5"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(-1.14287,0,0,1.142863,463.9317,115.7853)" />
           <g
              id="g36324">
             <path
                transform="matrix(1.1162596,0,0,1.1065394,80.948334,-350.49863)"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                sodipodi:ry="2.5"
                sodipodi:rx="2.5312502"
                sodipodi:cy="502"
@@ -52174,13 +56858,13 @@
                sodipodi:cy="502"
                sodipodi:rx="2.5312502"
                sodipodi:ry="2.5"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                transform="matrix(-1.087144,-0.2518404,0.2525206,-1.0776772,126.97246,766.619)" />
           </g>
           <path
              inkscape:transform-center-y="-5.7593212"
              inkscape:transform-center-x="-3.1120555"
-             d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="135"
@@ -52241,7 +56925,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -52259,7 +56943,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -52275,7 +56959,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -52293,7 +56977,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -52308,7 +56992,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -52327,7 +57011,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -52344,7 +57028,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -52353,7 +57037,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -52365,7 +57049,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -52409,7 +57093,7 @@
            sodipodi:cy="78.5"
            sodipodi:rx="3.5"
            sodipodi:ry="3.5"
-           d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            transform="matrix(-1.5714299,0,0,1.5714268,505.21462,331.643)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -52448,13 +57132,13 @@
              sodipodi:cy="78.5"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(-1.14287,0,0,1.142863,463.9317,115.7853)" />
           <g
              id="g36385">
             <path
                transform="matrix(1.1162596,0,0,1.1065394,80.948334,-350.49863)"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                sodipodi:ry="2.5"
                sodipodi:rx="2.5312502"
                sodipodi:cy="502"
@@ -52470,13 +57154,13 @@
                sodipodi:cy="502"
                sodipodi:rx="2.5312502"
                sodipodi:ry="2.5"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                transform="matrix(-1.087144,-0.2518404,0.2525206,-1.0776772,126.97246,766.619)" />
           </g>
           <path
              inkscape:transform-center-y="-5.7593212"
              inkscape:transform-center-x="-3.1120555"
-             d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="135"
@@ -52515,7 +57199,7 @@
          sodipodi:cy="78.5"
          sodipodi:rx="3.5"
          sodipodi:ry="3.5"
-         d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+         d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
          transform="matrix(-1.5002341,0,0,1.5000004,486.81053,424.24997)"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
@@ -52556,7 +57240,7 @@
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
          transform="matrix(-1.5000024,0,0,1.4990511,507.75064,424.32781)"
-         d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+         d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
          sodipodi:ry="3.5"
          sodipodi:rx="3.5"
          sodipodi:cy="78.5"
@@ -52590,7 +57274,7 @@
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            transform="matrix(-1.5714299,0,0,1.5714268,505.21462,331.643)"
-           d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+           d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
            sodipodi:ry="3.5"
            sodipodi:rx="3.5"
            sodipodi:cy="78.5"
@@ -52626,7 +57310,7 @@
            id="g36423">
           <path
              transform="matrix(-1.14287,0,0,1.142863,463.9317,115.7853)"
-             d="m 262,78.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 262,78.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="78.5"
@@ -52646,11 +57330,11 @@
                sodipodi:cy="502"
                sodipodi:rx="2.5312502"
                sodipodi:ry="2.5"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                transform="matrix(1.1162596,0,0,1.1065394,80.948334,-350.49863)" />
             <path
                transform="matrix(-1.087144,-0.2518404,0.2525206,-1.0776772,126.97246,766.619)"
-               d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+               d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
                sodipodi:ry="2.5"
                sodipodi:rx="2.5312502"
                sodipodi:cy="502"
@@ -52668,7 +57352,7 @@
              sodipodi:cy="135"
              sodipodi:rx="1"
              sodipodi:ry="1"
-             d="m 65,135 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 65,135 c 0,0.55228 -0.447715,1 -1,1 -0.552285,0 -1,-0.44772 -1,-1 0,-0.55228 0.447715,-1 1,-1 0.552285,0 1,0.44772 1,1 z"
              inkscape:transform-center-x="-3.1120555"
              inkscape:transform-center-y="-5.7593212" />
         </g>
@@ -52751,7 +57435,7 @@
            style="display:inline">
           <path
              transform="matrix(1.142871,0,0,1.142855,-27.218817,-5.0713453)"
-             d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              sodipodi:ry="3.5"
              sodipodi:rx="3.5"
              sodipodi:cy="35.5"
@@ -52767,7 +57451,7 @@
              sodipodi:cy="35.5"
              sodipodi:rx="3.5"
              sodipodi:ry="3.5"
-             d="m 334,35.5 a 3.5,3.5 0 1 1 -7,0 3.5,3.5 0 1 1 7,0 z"
+             d="m 334,35.5 c 0,1.932997 -1.567,3.5 -3.5,3.5 -1.933,0 -3.5,-1.567003 -3.5,-3.5 0,-1.932997 1.567,-3.5 3.5,-3.5 1.933,0 3.5,1.567003 3.5,3.5 z"
              transform="matrix(0.857099,0,0,0.857147,67.228993,5.071249)" />
         </g>
         <g
@@ -52991,7 +57675,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -52999,7 +57683,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -53018,7 +57702,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -53036,7 +57720,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -53705,7 +58389,7 @@
            id="g36930">
           <path
              transform="matrix(0.7834486,0,0,0.2000006,10.413535,395.5997)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -53763,11 +58447,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(1.187982,0,0,1.0569758,379.83032,-513.21497)" />
           <path
              transform="matrix(1.3827154,0,0,1.4028327,364.1482,-688.72206)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -53783,11 +58467,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.987526,0,0,0.8124641,394.9733,-392.80617)" />
           <path
              transform="matrix(0.9848328,0,0,0.9992585,395.19018,-485.12778)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -53803,7 +58487,7 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.591154,0,0,0.5887513,425.87219,-279.05319)" />
           <path
              sodipodi:type="arc"
@@ -53813,11 +58497,11 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.9913883,0,0,1.0058976,394.67318,-488.46061)" />
           <path
              transform="matrix(0.6941559,0,0,0.6920597,417.67198,-331.15708)"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              sodipodi:ry="2.5"
              sodipodi:rx="2.5312502"
              sodipodi:cy="502"
@@ -53833,7 +58517,7 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(0.1975308,0,0,0.1999991,456.0926,-84.399595)" />
           <path
              sodipodi:type="arc"
@@ -53843,7 +58527,7 @@
              sodipodi:cy="502"
              sodipodi:rx="2.5312502"
              sodipodi:ry="2.5"
-             d="m 80.53125,502 a 2.5312502,2.5 0 1 1 -5.0625,0 2.5312502,2.5 0 1 1 5.0625,0 z"
+             d="m 80.53125,502 c 0,1.38071 -1.133279,2.5 -2.53125,2.5 -1.397971,0 -2.53125,-1.11929 -2.53125,-2.5 0,-1.38071 1.133279,-2.5 2.53125,-2.5 1.397971,0 2.53125,1.11929 2.53125,2.5 z"
              transform="matrix(-0.6760501,-0.1575078,0.1570322,-0.6740085,446.07727,367.34791)" />
         </g>
         <path
@@ -54252,7 +58936,7 @@
              sodipodi:cy="330.5"
              sodipodi:rx="2"
              sodipodi:ry="2"
-             d="m 266.5,330.5 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z" />
+             d="m 266.5,330.5 c 0,1.10457 -0.89543,2 -2,2 -1.10457,0 -2,-0.89543 -2,-2 0,-1.10457 0.89543,-2 2,-2 1.10457,0 2,0.89543 2,2 z" />
         </g>
         <path
            style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
@@ -54303,7 +58987,7 @@
            style="fill:none;stroke:#ffffff;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
            inkscape:connector-curvature="0" />
         <path
-           d="m 266.5,330.5 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"
+           d="m 266.5,330.5 c 0,1.10457 -0.89543,2 -2,2 -1.10457,0 -2,-0.89543 -2,-2 0,-1.10457 0.89543,-2 2,-2 1.10457,0 2,0.89543 2,2 z"
            sodipodi:ry="2"
            sodipodi:rx="2"
            sodipodi:cy="330.5"
@@ -54451,12 +59135,12 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z" />
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z" />
         <path
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -54473,7 +59157,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -54495,7 +59179,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -54512,7 +59196,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -54769,7 +59453,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -54785,7 +59469,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -54803,7 +59487,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -54819,7 +59503,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -54837,7 +59521,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -54851,7 +59535,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -54866,7 +59550,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -54884,7 +59568,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -55007,7 +59691,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -55016,7 +59700,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -55033,7 +59717,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -55155,7 +59839,7 @@
            style="fill:#f9f9f9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.69999999;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
            transform="translate(0.5,-0.46875)"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="-23"
@@ -55171,7 +59855,7 @@
            sodipodi:cy="-23"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            transform="matrix(1.2143583,0,0,1.1512108,-28.054112,2.9290602)" />
         <path
            sodipodi:type="arc"
@@ -55181,7 +59865,7 @@
            sodipodi:cy="-23"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            transform="matrix(0.8392157,0,0,0.8382979,21.884318,-4.2140957)" />
         <rect
            style="opacity:0.5;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.69999999;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
@@ -55198,7 +59882,7 @@
            inkscape:connector-curvature="0" />
         <path
            transform="matrix(1.2116904,0,0,1.1282344,-22.693138,2.3776257)"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="-23"
@@ -55208,7 +59892,7 @@
            sodipodi:type="arc" />
         <path
            transform="matrix(0.8392157,0,0,0.8382979,26.893134,-4.2140957)"
-           d="m 134,-23 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 134,-23 c 0,0.552285 -0.44772,1 -1,1 -0.55228,0 -1,-0.447715 -1,-1 0,-0.552285 0.44772,-1 1,-1 0.55228,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="-23"
@@ -55458,7 +60142,7 @@
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -55475,7 +60159,7 @@
          sodipodi:cy="118"
          sodipodi:rx="8"
          sodipodi:ry="8"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90"
@@ -55489,7 +60173,7 @@
          sodipodi:cy="118"
          sodipodi:rx="8"
          sodipodi:ry="8"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90" />
@@ -55497,7 +60181,7 @@
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -55592,7 +60276,7 @@
          sodipodi:cy="40.5"
          sodipodi:rx="6.5"
          sodipodi:ry="2.5"
-         d="m -213.5,40.5 a 6.5,2.5 0 1 1 -13,0 6.5,2.5 0 1 1 13,0 z"
+         d="m -213.5,40.5 c 0,1.380712 -2.91015,2.5 -6.5,2.5 -3.58985,0 -6.5,-1.119288 -6.5,-2.5 0,-1.380712 2.91015,-2.5 6.5,-2.5 3.58985,0 6.5,1.119288 6.5,2.5 z"
          transform="matrix(0.9999986,0,0,1.799999,-2.971883e-4,111.10004)" />
     </g>
     <g
@@ -56002,7 +60686,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -56010,7 +60694,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -56091,7 +60775,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -56108,7 +60792,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -56122,7 +60806,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -56130,7 +60814,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -56216,7 +60900,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -56224,7 +60908,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -56803,7 +61487,7 @@
          inkscape:connector-curvature="0" />
       <path
          transform="matrix(0.9999986,0,0,1.799999,-2.971883e-4,111.10004)"
-         d="m -213.5,40.5 a 6.5,2.5 0 1 1 -13,0 6.5,2.5 0 1 1 13,0 z"
+         d="m -213.5,40.5 c 0,1.380712 -2.91015,2.5 -6.5,2.5 -3.58985,0 -6.5,-1.119288 -6.5,-2.5 0,-1.380712 2.91015,-2.5 6.5,-2.5 3.58985,0 6.5,1.119288 6.5,2.5 z"
          sodipodi:ry="2.5"
          sodipodi:rx="6.5"
          sodipodi:cy="40.5"
@@ -56886,7 +61570,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -56903,7 +61587,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -56917,7 +61601,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57050,7 +61734,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57058,7 +61742,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57076,7 +61760,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57089,7 +61773,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57149,7 +61833,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57167,7 +61851,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57175,7 +61859,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57188,7 +61872,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57255,7 +61939,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57263,7 +61947,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57281,7 +61965,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57294,7 +61978,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57346,7 +62030,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -57354,7 +62038,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -57372,7 +62056,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -57385,7 +62069,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -57402,7 +62086,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57419,7 +62103,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -57433,7 +62117,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57456,7 +62140,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57464,7 +62148,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57482,7 +62166,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57495,7 +62179,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57705,7 +62389,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57713,7 +62397,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57731,7 +62415,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57779,7 +62463,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57797,7 +62481,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57805,7 +62489,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57827,7 +62511,7 @@
            sodipodi:cy="292.5"
            sodipodi:rx="4"
            sodipodi:ry="4"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            transform="translate(20,0)" />
         <path
            sodipodi:type="arc"
@@ -57837,11 +62521,11 @@
            sodipodi:cy="292.5"
            sodipodi:rx="4"
            sodipodi:ry="4"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            transform="matrix(0.875,0,0,0.875,47.4375,36.5625)" />
         <path
            transform="matrix(0.7060003,0,0,0.7060647,84.532933,85.976064)"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            sodipodi:ry="4"
            sodipodi:rx="4"
            sodipodi:cy="292.5"
@@ -57851,7 +62535,7 @@
            sodipodi:type="arc" />
         <path
            transform="matrix(0.875,0,0,0.875,47.4375,36.5625)"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            sodipodi:ry="4"
            sodipodi:rx="4"
            sodipodi:cy="292.5"
@@ -57880,7 +62564,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57898,7 +62582,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57906,7 +62590,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57964,7 +62648,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -57972,7 +62656,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -57990,7 +62674,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -58001,7 +62685,7 @@
          style="opacity:0.9;display:inline;enable-background:new">
         <path
            transform="translate(20,0)"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            sodipodi:ry="4"
            sodipodi:rx="4"
            sodipodi:cy="292.5"
@@ -58011,7 +62695,7 @@
            sodipodi:type="arc" />
         <path
            transform="matrix(0.875,0,0,0.875,47.4375,36.5625)"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            sodipodi:ry="4"
            sodipodi:rx="4"
            sodipodi:cy="292.5"
@@ -58027,7 +62711,7 @@
            sodipodi:cy="292.5"
            sodipodi:rx="4"
            sodipodi:ry="4"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            transform="matrix(0.7060003,0,0,0.7060647,84.532933,85.976064)" />
         <path
            sodipodi:type="arc"
@@ -58037,7 +62721,7 @@
            sodipodi:cy="292.5"
            sodipodi:rx="4"
            sodipodi:ry="4"
-           d="m 223.5,292.5 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
+           d="m 223.5,292.5 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
            transform="matrix(0.875,0,0,0.875,47.4375,36.5625)" />
       </g>
     </g>
@@ -58061,11 +62745,11 @@
              sodipodi:cy="192.5"
              sodipodi:rx="1.75"
              sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              transform="matrix(1.7142856,0,0,1.7142871,-330.83199,-136.46043)" />
           <path
              transform="matrix(1.4285718,0,0,1.4285718,-198.61789,-81.960223)"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              sodipodi:ry="1.75"
              sodipodi:rx="1.75"
              sodipodi:cy="192.5"
@@ -58081,7 +62765,7 @@
              sodipodi:cy="192.5"
              sodipodi:rx="1.75"
              sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              transform="matrix(0.8571429,0,0,0.8571429,66.810813,28.039828)" />
         </g>
         <rect
@@ -58105,7 +62789,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -58123,7 +62807,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -58136,7 +62820,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -58144,7 +62828,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -58184,7 +62868,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -58193,7 +62877,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -58205,7 +62889,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -58398,7 +63082,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            transform="matrix(1.3333333,0,0,1.3333343,3,147.66665)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -58412,7 +63096,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -58459,844 +63143,840 @@
       </g>
     </g>
     <g
-       id="g36498"
-       transform="translate(0,-20.999998)">
+       transform="translate(105,337.99999)"
+       id="g35291"
+       style="display:inline;enable-background:new">
+      <rect
+         style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect35293"
+         width="16"
+         height="16"
+         x="-210"
+         y="-66"
+         transform="scale(-1,-1)" />
       <g
-         style="display:inline;enable-background:new"
-         id="g35291"
-         transform="translate(105,358.99999)">
-        <rect
-           transform="scale(-1,-1)"
-           y="-66"
-           x="-210"
-           height="16"
-           width="16"
-           id="rect35293"
-           style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         id="g35295"
+         transform="translate(22.999994,19)">
+        <path
+           inkscape:connector-curvature="0"
+           id="path35297"
+           d="m 178.00001,33.5 -1.5,0 L 174,36 c -1.00699,1.006986 -0.0205,3.604505 2.1875,5.8125 2.208,2.207997 4.80551,3.194485 5.8125,2.1875 l 2.50001,-2.5 0,-1.5 -0.75,-1.75 -4,-4 -1.75,-0.75 z"
+           style="fill:url(#linearGradient36648);fill-opacity:1;fill-rule:evenodd;stroke:none"
+           sodipodi:nodetypes="cccscccccc" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path35299"
+           style="fill:url(#linearGradient36650);fill-rule:evenodd;stroke:none"
+           d="m 186.50001,35.5 -2.75,2.75 -1,-1 -1,-1 -1,-1 -1,-1 2.75,-2.75 1.25,0 1.5,1.25 1.25,1.5 0,1.25 z"
+           sodipodi:nodetypes="ccccccccccc" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path35301"
+           d="m 182.50001,31.5 -2.75,2.75 -1.75,-0.75 -1.5,0 L 174,36 c -1.00699,1.006986 -0.0205,3.604505 2.1875,5.8125 2.208,2.207997 4.80551,3.194485 5.8125,2.1875 l 2.50001,-2.5 0,-1.5 -0.75,-1.75 2.75,-2.75 0,-1 -1.25,-1.75 -1.75,-1.25 -1,0 z"
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           sodipodi:nodetypes="cccccsccccccccc" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="ccccccccc"
+           style="fill:none;stroke:url(#linearGradient36652);stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 174.75001,36.5 2.25,-2.25 1.5,0.25 1.5,0.75 1.5,1.25 1.25,1.5 0.75,1.5 0.25,1.5 -1.5,1.5"
+           id="path35303" />
+        <path
+           sodipodi:type="arc"
+           style="fill:#d3c656;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.74147779;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path35305"
+           sodipodi:cx="181"
+           sodipodi:cy="35"
+           sodipodi:rx="1.2111344"
+           sodipodi:ry="4.9951267"
+           d="m 182.21113,35 c 0,2.758732 -0.54224,4.995127 -1.21113,4.995127 -0.66889,0 -1.21113,-2.236395 -1.21113,-4.995127 0,-2.758732 0.54224,-4.995127 1.21113,-4.995127 0.66788,0 1.20971,2.229902 1.21113,4.984465"
+           transform="matrix(1.2491741,-1.2491602,0.7680871,0.768079,-75.108556,239.34027)"
+           sodipodi:start="0"
+           sodipodi:end="6.2810509"
+           sodipodi:open="true" />
+        <path
+           transform="matrix(0.9589476,-0.9192618,0.5776079,0.5780619,-15.42366,185.77921)"
+           d="m 182.17638,35 c 0,3.053777 -0.52668,5.529352 -1.17638,5.529352 -0.6497,0 -1.17638,-2.475575 -1.17638,-5.529352 0,-3.053777 0.52668,-5.529352 1.17638,-5.529352 0.6497,0 1.17638,2.475575 1.17638,5.529352 z"
+           sodipodi:ry="5.5293522"
+           sodipodi:rx="1.1763829"
+           sodipodi:cy="35"
+           sodipodi:cx="181"
+           id="path35307"
+           style="fill:#f3eebb;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.74147779;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:type="arc" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="czs"
+           style="opacity:0.8;fill:none;stroke:url(#linearGradient36654);stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="M 182.25,43.75 C 182.25,42 182,41 179.5,38.5 177,36 175.75,35.75 174.25,35.75"
+           id="path35309" />
+        <path
+           inkscape:connector-curvature="0"
+           style="fill:none;stroke:url(#linearGradient36656);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+           d="m 180.50001,34.5 2,-2 1,0 1,1 1,1 0,1 -2,2"
+           id="path35311"
+           sodipodi:nodetypes="ccccccc" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path35313"
+           d="m 184.50001,41.5 c 0,-1.75 0,-3 -2.5,-5.5 -2.5,-2.5 -4,-2.5 -5.5,-2.5"
+           style="fill:none;stroke:url(#linearGradient36658);stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           sodipodi:nodetypes="czs" />
+      </g>
+      <g
+         id="g35315"
+         style="opacity:0.65">
         <g
-           transform="translate(22.999994,19)"
-           id="g35295">
-          <path
-             sodipodi:nodetypes="cccscccccc"
-             style="fill:url(#linearGradient36648);fill-opacity:1;fill-rule:evenodd;stroke:none"
-             d="m 178.00001,33.5 -1.5,0 L 174,36 c -1.00699,1.006986 -0.0205,3.604505 2.1875,5.8125 2.208,2.207997 4.80551,3.194485 5.8125,2.1875 l 2.50001,-2.5 0,-1.5 -0.75,-1.75 -4,-4 -1.75,-0.75 z"
-             id="path35297"
-             inkscape:connector-curvature="0" />
-          <path
-             sodipodi:nodetypes="ccccccccccc"
-             d="m 186.50001,35.5 -2.75,2.75 -1,-1 -1,-1 -1,-1 -1,-1 2.75,-2.75 1.25,0 1.5,1.25 1.25,1.5 0,1.25 z"
-             style="fill:url(#linearGradient36650);fill-rule:evenodd;stroke:none"
-             id="path35299"
-             inkscape:connector-curvature="0" />
-          <path
-             sodipodi:nodetypes="cccccsccccccccc"
-             style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-             d="m 182.50001,31.5 -2.75,2.75 -1.75,-0.75 -1.5,0 L 174,36 c -1.00699,1.006986 -0.0205,3.604505 2.1875,5.8125 2.208,2.207997 4.80551,3.194485 5.8125,2.1875 l 2.50001,-2.5 0,-1.5 -0.75,-1.75 2.75,-2.75 0,-1 -1.25,-1.75 -1.75,-1.25 -1,0 z"
-             id="path35301"
-             inkscape:connector-curvature="0" />
-          <path
-             id="path35303"
-             d="m 174.75001,36.5 2.25,-2.25 1.5,0.25 1.5,0.75 1.5,1.25 1.25,1.5 0.75,1.5 0.25,1.5 -1.5,1.5"
-             style="fill:none;stroke:url(#linearGradient36652);stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-             sodipodi:nodetypes="ccccccccc"
-             inkscape:connector-curvature="0" />
-          <path
-             sodipodi:open="true"
-             sodipodi:end="6.2810509"
-             sodipodi:start="0"
-             transform="matrix(1.2491741,-1.2491602,0.7680871,0.768079,-75.108556,239.34027)"
-             d="m 182.21113,35 a 1.2111344,4.9951267 0 1 1 0,-0.01066"
-             sodipodi:ry="4.9951267"
-             sodipodi:rx="1.2111344"
-             sodipodi:cy="35"
-             sodipodi:cx="181"
-             id="path35305"
-             style="fill:#d3c656;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.74147779;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             sodipodi:type="arc" />
-          <path
-             sodipodi:type="arc"
-             style="fill:#f3eebb;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.74147779;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="path35307"
-             sodipodi:cx="181"
-             sodipodi:cy="35"
-             sodipodi:rx="1.1763829"
-             sodipodi:ry="5.5293522"
-             d="m 182.17638,35 a 1.1763829,5.5293522 0 1 1 -2.35276,0 1.1763829,5.5293522 0 1 1 2.35276,0 z"
-             transform="matrix(0.9589476,-0.9192618,0.5776079,0.5780619,-15.42366,185.77921)" />
-          <path
-             id="path35309"
-             d="M 182.25,43.75 C 182.25,42 182,41 179.5,38.5 177,36 175.75,35.75 174.25,35.75"
-             style="opacity:0.8;fill:none;stroke:url(#linearGradient36654);stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-             sodipodi:nodetypes="czs"
-             inkscape:connector-curvature="0" />
+           id="g35317"
+           transform="translate(21,21)">
           <path
-             sodipodi:nodetypes="ccccccc"
-             id="path35311"
-             d="m 180.50001,34.5 2,-2 1,0 1,1 1,1 0,1 -2,2"
-             style="fill:none;stroke:url(#linearGradient36656);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-             inkscape:connector-curvature="0" />
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccc"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             d="m 174.5,40.5 0,3 3,0"
+             id="path35319" />
           <path
-             sodipodi:nodetypes="czs"
-             style="fill:none;stroke:url(#linearGradient36658);stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-             d="m 184.50001,41.5 c 0,-1.75 0,-3 -2.5,-5.5 -2.5,-2.5 -4,-2.5 -5.5,-2.5"
-             id="path35313"
-             inkscape:connector-curvature="0" />
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="cz"
+             id="path35321"
+             style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="M 175.5,42.5 179,39" />
         </g>
         <g
-           style="opacity:0.65"
-           id="g35315">
+           transform="matrix(-1,0,0,-1,383,116)"
+           id="g35323">
           <g
-             transform="translate(21,21)"
-             id="g35317">
+             style="display:inline"
+             transform="matrix(-1,0,0,-1,272.1613,155.99999)"
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             id="g35325">
             <path
-               id="path35319"
-               d="m 174.5,40.5 0,3 3,0"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-               sodipodi:nodetypes="ccc"
-               inkscape:connector-curvature="0" />
+               inkscape:connector-curvature="0"
+               d=""
+               sodipodi:nodetypes="cz"
+               id="path35327"
+               style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
             <path
-               d="M 175.5,42.5 179,39"
-               style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35321"
+               inkscape:connector-curvature="0"
                sodipodi:nodetypes="cz"
-               inkscape:connector-curvature="0" />
+               id="path35329"
+               style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 85.6613,103.49999 5,-5" />
           </g>
+          <path
+             inkscape:connector-curvature="0"
+             style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 188,51 0,4 -1,0 0,-3 -3,0 0,-1 4,0 z"
+             id="path35331"
+             sodipodi:nodetypes="ccccccc" />
           <g
-             id="g35323"
-             transform="matrix(-1,0,0,-1,383,116)">
-            <g
-               id="g35325"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-               inkscape:export-xdpi="90"
-               inkscape:export-ydpi="90"
-               transform="matrix(-1,0,0,-1,272.1613,155.99999)"
-               style="display:inline">
-              <path
-                 style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35327"
-                 sodipodi:nodetypes="cz"
-                 d=""
-                 inkscape:connector-curvature="0" />
-              <path
-                 d="m 85.6613,103.49999 5,-5"
-                 style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35329"
-                 sodipodi:nodetypes="cz"
-                 inkscape:connector-curvature="0" />
-            </g>
+             id="g35333"
+             style="opacity:0.2"
+             transform="matrix(-1,0,0,1,-29,-335)">
             <path
-               sodipodi:nodetypes="ccccccc"
-               id="path35331"
-               d="m 188,51 0,4 -1,0 0,-3 -3,0 0,-1 4,0 z"
-               style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               inkscape:connector-curvature="0" />
-            <g
-               transform="matrix(-1,0,0,1,-29,-335)"
-               style="opacity:0.2"
-               id="g35333">
-              <path
-                 sodipodi:nodetypes="ccccccc"
-                 id="path35335"
-                 d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
-                 style="fill:#b5a731;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:connector-curvature="0" />
-            </g>
+               inkscape:connector-curvature="0"
+               style="fill:#b5a731;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
+               id="path35335"
+               sodipodi:nodetypes="ccccccc" />
           </g>
         </g>
-        <rect
-           y="58"
-           x="200.75"
-           height="1.25"
-           width="1.25"
-           id="rect35337"
-           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="opacity:0.7;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect35339"
-           width="1.5"
-           height="1.5"
-           x="199.75"
-           y="58.75" />
-        <rect
-           y="59.75"
-           x="198.75"
-           height="1.5"
-           width="1.5"
-           id="rect35341"
-           style="opacity:0.5;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       </g>
+      <rect
+         style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect35337"
+         width="1.25"
+         height="1.25"
+         x="200.75"
+         y="58" />
+      <rect
+         y="58.75"
+         x="199.75"
+         height="1.5"
+         width="1.5"
+         id="rect35339"
+         style="opacity:0.7;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <rect
+         style="opacity:0.5;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect35341"
+         width="1.5"
+         height="1.5"
+         x="198.75"
+         y="59.75" />
+    </g>
+    <g
+       id="g35343"
+       transform="translate(0,-7e-6)">
+      <rect
+         transform="scale(-1,-1)"
+         y="-404"
+         x="-273"
+         height="16"
+         width="16"
+         id="rect35345"
+         style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         transform="translate(0,20.999991)"
-         id="g35343">
-        <rect
-           style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect35345"
-           width="16"
-           height="16"
-           x="-273"
-           y="-404"
-           transform="scale(-1,-1)" />
+         mask="url(#mask31861)"
+         id="g35347"
+         transform="translate(63,338)"
+         style="opacity:0.65">
         <g
-           style="opacity:0.65"
-           transform="translate(63,338)"
-           id="g35347"
-           mask="url(#mask31861)">
+           id="g35349"
+           transform="matrix(0,-1,1,0,104.00001,149.1613)"
+           style="stroke:#9e872a;stroke-opacity:1">
+          <path
+             inkscape:connector-curvature="0"
+             id="path35351"
+             d="m 187.5,53.75 0,-2.25 -2,0"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             sodipodi:nodetypes="ccc"
+             transform="matrix(0,1,-1,0,149.1613,-83.00001)" />
+          <path
+             inkscape:connector-curvature="0"
+             d="m 85.6613,103.49999 5.5,-5.5"
+             style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path35353"
+             sodipodi:nodetypes="cz"
+             transform="matrix(0,-1,1,0,-6.83869,189.16129)" />
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccc"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             d="m 187.5,53.5 0,-2 -2,0"
+             id="path35355"
+             transform="matrix(0,-1,1,0,33.1613,278.99999)" />
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="cz"
+             id="path35357"
+             style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 85.6613,103.49999 5.5,-5.5"
+             transform="matrix(0,1,-1,0,189.16129,6.83869)" />
+          <path
+             inkscape:connector-curvature="0"
+             id="path35359"
+             d="m 187.5,53.5 0,-2 -2,0"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             sodipodi:nodetypes="ccc"
+             transform="translate(-89.8387,39.99999)" />
+          <path
+             inkscape:connector-curvature="0"
+             d="m 85.6613,103.49999 5.5,-5.5"
+             style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path35361"
+             sodipodi:nodetypes="cz"
+             transform="matrix(-1,0,0,-1,182.3226,195.99998)" />
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccc"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             d="m 187.5,53.5 0,-2 -2,0"
+             id="path35363"
+             transform="matrix(-1,0,0,-1,272.1613,155.99999)" />
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="cz"
+             id="path35365"
+             style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 85.6613,103.49999 5.5,-5.5" />
+        </g>
+        <g
+           id="g35367"
+           transform="translate(21,0)">
           <g
-             style="stroke:#9e872a;stroke-opacity:1"
-             transform="matrix(0,-1,1,0,104.00001,149.1613)"
-             id="g35349">
-            <path
-               transform="matrix(0,1,-1,0,149.1613,-83.00001)"
-               sodipodi:nodetypes="ccc"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-               d="m 187.5,53.75 0,-2.25 -2,0"
-               id="path35351"
-               inkscape:connector-curvature="0" />
-            <path
-               transform="matrix(0,-1,1,0,-6.83869,189.16129)"
-               sodipodi:nodetypes="cz"
-               id="path35353"
-               style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 85.6613,103.49999 5.5,-5.5"
-               inkscape:connector-curvature="0" />
-            <path
-               transform="matrix(0,-1,1,0,33.1613,278.99999)"
-               id="path35355"
-               d="m 187.5,53.5 0,-2 -2,0"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-               sodipodi:nodetypes="ccc"
-               inkscape:connector-curvature="0" />
-            <path
-               transform="matrix(0,1,-1,0,189.16129,6.83869)"
-               d="m 85.6613,103.49999 5.5,-5.5"
-               style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35357"
-               sodipodi:nodetypes="cz"
-               inkscape:connector-curvature="0" />
-            <path
-               transform="translate(-89.8387,39.99999)"
-               sodipodi:nodetypes="ccc"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-               d="m 187.5,53.5 0,-2 -2,0"
-               id="path35359"
-               inkscape:connector-curvature="0" />
+             id="g35369"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90"
+             transform="matrix(-1,0,0,-1,272.1613,155.99999)"
+             style="display:inline">
             <path
-               transform="matrix(-1,0,0,-1,182.3226,195.99998)"
+               inkscape:connector-curvature="0"
+               style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               id="path35371"
                sodipodi:nodetypes="cz"
-               id="path35361"
-               style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 85.6613,103.49999 5.5,-5.5"
-               inkscape:connector-curvature="0" />
-            <path
-               transform="matrix(-1,0,0,-1,272.1613,155.99999)"
-               id="path35363"
-               d="m 187.5,53.5 0,-2 -2,0"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-               sodipodi:nodetypes="ccc"
-               inkscape:connector-curvature="0" />
+               d="" />
             <path
+               inkscape:connector-curvature="0"
                d="m 85.6613,103.49999 5.5,-5.5"
-               style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35365"
-               sodipodi:nodetypes="cz"
-               inkscape:connector-curvature="0" />
+               style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               id="path35373"
+               sodipodi:nodetypes="cz" />
           </g>
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccccccc"
+             id="path35375"
+             d="m 188,51 0,3 -1,0 0,-2 -2,0 0,-1 3,0 z"
+             style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
           <g
-             transform="translate(21,0)"
-             id="g35367">
-            <g
-               style="display:inline"
-               transform="matrix(-1,0,0,-1,272.1613,155.99999)"
-               inkscape:export-ydpi="90"
-               inkscape:export-xdpi="90"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-               id="g35369">
-              <path
-                 d=""
-                 sodipodi:nodetypes="cz"
-                 id="path35371"
-                 style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:connector-curvature="0" />
-              <path
-                 sodipodi:nodetypes="cz"
-                 id="path35373"
-                 style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 d="m 85.6613,103.49999 5.5,-5.5"
-                 inkscape:connector-curvature="0" />
-            </g>
+             transform="matrix(-1,0,0,1,-29,-335)"
+             style="opacity:0.3"
+             id="g35377">
             <path
-               style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 188,51 0,3 -1,0 0,-2 -2,0 0,-1 3,0 z"
-               id="path35375"
+               inkscape:connector-curvature="0"
                sodipodi:nodetypes="ccccccc"
-               inkscape:connector-curvature="0" />
-            <g
-               id="g35377"
-               style="opacity:0.3"
-               transform="matrix(-1,0,0,1,-29,-335)">
-              <path
-                 style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
-                 id="path35379"
-                 sodipodi:nodetypes="ccccccc"
-                 inkscape:connector-curvature="0" />
-            </g>
+               id="path35379"
+               d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
+               style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
           </g>
+        </g>
+        <g
+           transform="matrix(-1,0,0,-1,383,116)"
+           id="g35381">
           <g
-             id="g35381"
-             transform="matrix(-1,0,0,-1,383,116)">
-            <g
-               id="g35383"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-               inkscape:export-xdpi="90"
-               inkscape:export-ydpi="90"
-               transform="matrix(-1,0,0,-1,272.1613,155.99999)"
-               style="display:inline">
-              <path
-                 style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35385"
-                 sodipodi:nodetypes="cz"
-                 d=""
-                 inkscape:connector-curvature="0" />
-              <path
-                 d="m 85.6613,103.49999 5.5,-5.5"
-                 style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35387"
-                 sodipodi:nodetypes="cz"
-                 inkscape:connector-curvature="0" />
-            </g>
+             style="display:inline"
+             transform="matrix(-1,0,0,-1,272.1613,155.99999)"
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             id="g35383">
             <path
-               sodipodi:nodetypes="ccccccc"
-               id="path35391"
-               d="m 188,51 0,3 -1,0 0,-2 -2,0 0,-1 3,0 z"
-               style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               inkscape:connector-curvature="0" />
-            <g
-               transform="matrix(-1,0,0,1,-29,-335)"
-               style="opacity:0.3"
-               id="g35393">
-              <path
-                 sodipodi:nodetypes="ccccccc"
-                 id="path35395"
-                 d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
-                 style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:connector-curvature="0" />
-            </g>
+               inkscape:connector-curvature="0"
+               d=""
+               sodipodi:nodetypes="cz"
+               id="path35385"
+               style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+            <path
+               inkscape:connector-curvature="0"
+               sodipodi:nodetypes="cz"
+               id="path35387"
+               style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 85.6613,103.49999 5.5,-5.5" />
           </g>
+          <path
+             inkscape:connector-curvature="0"
+             style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 188,51 0,3 -1,0 0,-2 -2,0 0,-1 3,0 z"
+             id="path35391"
+             sodipodi:nodetypes="ccccccc" />
           <g
-             transform="matrix(0,-1,1,0,144,239)"
-             inkscape:transform-center-y="-3.125"
-             inkscape:transform-center-x="3.125"
-             id="g35398">
-            <g
-               style="display:inline"
-               transform="matrix(-1,0,0,-1,272.1613,155.99999)"
-               inkscape:export-ydpi="90"
-               inkscape:export-xdpi="90"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-               id="g35400">
-              <path
-                 d=""
-                 sodipodi:nodetypes="cz"
-                 id="path35405"
-                 style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:connector-curvature="0" />
-              <path
-                 sodipodi:nodetypes="cz"
-                 id="path35407"
-                 style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 d="m 85.6613,103.49999 5.5,-5.5"
-                 inkscape:connector-curvature="0" />
-            </g>
+             id="g35393"
+             style="opacity:0.3"
+             transform="matrix(-1,0,0,1,-29,-335)">
             <path
-               style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 188,51 0,3 -1,0 0,-2 -2,0 0,-1 3,0 z"
-               id="path35409"
-               sodipodi:nodetypes="ccccccc"
-               inkscape:connector-curvature="0" />
-            <g
-               id="g35411"
-               style="opacity:0.3"
-               transform="matrix(-1,0,0,1,-29,-335)">
-              <path
-                 style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
-                 id="path35413"
-                 sodipodi:nodetypes="ccccccc"
-                 inkscape:connector-curvature="0" />
-            </g>
+               inkscape:connector-curvature="0"
+               style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
+               id="path35395"
+               sodipodi:nodetypes="ccccccc" />
           </g>
+        </g>
+        <g
+           id="g35398"
+           inkscape:transform-center-x="3.125"
+           inkscape:transform-center-y="-3.125"
+           transform="matrix(0,-1,1,0,144,239)">
           <g
-             transform="translate(-16,0)"
-             id="g35415">
+             id="g35400"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90"
+             transform="matrix(-1,0,0,-1,272.1613,155.99999)"
+             style="display:inline">
             <path
+               inkscape:connector-curvature="0"
+               style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               id="path35405"
                sodipodi:nodetypes="cz"
-               id="path35417"
+               d="" />
+            <path
+               inkscape:connector-curvature="0"
+               d="m 85.6613,103.49999 5.5,-5.5"
                style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="M 223.5,63.5 218,58"
-               inkscape:connector-curvature="0" />
+               id="path35407"
+               sodipodi:nodetypes="cz" />
+          </g>
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccccccc"
+             id="path35409"
+             d="m 188,51 0,3 -1,0 0,-2 -2,0 0,-1 3,0 z"
+             style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <g
+             transform="matrix(-1,0,0,1,-29,-335)"
+             style="opacity:0.3"
+             id="g35411">
             <path
+               inkscape:connector-curvature="0"
                sodipodi:nodetypes="ccccccc"
-               id="path35420"
-               d="m 225,65 -3,0 0,-1 2,0 0,-2 1,0 0,3 z"
-               style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               inkscape:connector-curvature="0" />
-            <g
-               transform="matrix(0,-1,-1,0,611,-152)"
-               style="opacity:0.3"
-               id="g35422">
-              <path
-                 sodipodi:nodetypes="ccccccc"
-                 id="path35424"
-                 d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
-                 style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:connector-curvature="0" />
-            </g>
+               id="path35413"
+               d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
+               style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
           </g>
         </g>
         <g
-           id="g35426"
-           transform="translate(139.00002,324)"
-           style="display:inline;enable-background:new">
+           id="g35415"
+           transform="translate(-16,0)">
+          <path
+             inkscape:connector-curvature="0"
+             d="M 223.5,63.5 218,58"
+             style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path35417"
+             sodipodi:nodetypes="cz" />
+          <path
+             inkscape:connector-curvature="0"
+             style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 225,65 -3,0 0,-1 2,0 0,-2 1,0 0,3 z"
+             id="path35420"
+             sodipodi:nodetypes="ccccccc" />
           <g
-             transform="translate(-340.00002,-121.00001)"
-             id="g35429">
-            <path
-               sodipodi:type="arc"
-               style="opacity:0.1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#e9ddaf;stroke-width:0.49999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35431"
-               sodipodi:cx="464.5"
-               sodipodi:cy="192.5"
-               sodipodi:rx="1.75"
-               sodipodi:ry="1.75"
-               d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-               transform="matrix(1.9999998,0,0,2.0000014,-462.99991,-192.00026)" />
-            <path
-               transform="matrix(2.5714449,0,0,2.5714449,-728.43612,-302.00313)"
-               d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-               sodipodi:ry="1.75"
-               sodipodi:rx="1.75"
-               sodipodi:cy="192.5"
-               sodipodi:cx="464.5"
-               id="path35433"
-               style="opacity:0.15;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#fffc28;stroke-width:0.38888648;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               sodipodi:type="arc" />
-            <path
-               sodipodi:type="arc"
-               style="opacity:0.3;fill:#e1d98e;fill-opacity:1;fill-rule:nonzero;stroke:#f0d700;stroke-width:0.50000638;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35437"
-               sodipodi:cx="464.5"
-               sodipodi:cy="192.5"
-               sodipodi:rx="1.75"
-               sodipodi:ry="1.75"
-               d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-               transform="matrix(1.9999748,0,0,1.9999748,-462.98824,-191.99513)" />
+             id="g35422"
+             style="opacity:0.3"
+             transform="matrix(0,-1,-1,0,611,-152)">
             <path
-               sodipodi:type="arc"
-               style="fill:#fbf7e5;fill-opacity:1;fill-rule:nonzero;stroke:#474213;stroke-width:0.63000238;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35439"
-               sodipodi:cx="464.5"
-               sodipodi:cy="192.5"
-               sodipodi:rx="1.75"
-               sodipodi:ry="1.75"
-               d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-               transform="matrix(1.428566,0,0,1.428566,-197.56891,-81.998957)" />
+               inkscape:connector-curvature="0"
+               style="fill:#2b2600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
+               id="path35424"
+               sodipodi:nodetypes="ccccccc" />
           </g>
         </g>
+      </g>
+      <g
+         style="display:inline;enable-background:new"
+         transform="translate(139.00002,324)"
+         id="g35426">
+        <g
+           id="g35429"
+           transform="translate(-340.00002,-121.00001)">
+          <path
+             transform="matrix(1.9999998,0,0,2.0000014,-462.99991,-192.00026)"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+             sodipodi:ry="1.75"
+             sodipodi:rx="1.75"
+             sodipodi:cy="192.5"
+             sodipodi:cx="464.5"
+             id="path35431"
+             style="opacity:0.1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#e9ddaf;stroke-width:0.49999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             sodipodi:type="arc" />
+          <path
+             sodipodi:type="arc"
+             style="opacity:0.15;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#fffc28;stroke-width:0.38888648;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path35433"
+             sodipodi:cx="464.5"
+             sodipodi:cy="192.5"
+             sodipodi:rx="1.75"
+             sodipodi:ry="1.75"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+             transform="matrix(2.5714449,0,0,2.5714449,-728.43612,-302.00313)" />
+          <path
+             transform="matrix(1.9999748,0,0,1.9999748,-462.98824,-191.99513)"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+             sodipodi:ry="1.75"
+             sodipodi:rx="1.75"
+             sodipodi:cy="192.5"
+             sodipodi:cx="464.5"
+             id="path35437"
+             style="opacity:0.3;fill:#e1d98e;fill-opacity:1;fill-rule:nonzero;stroke:#f0d700;stroke-width:0.50000638;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             sodipodi:type="arc" />
+          <path
+             transform="matrix(1.428566,0,0,1.428566,-197.56891,-81.998957)"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+             sodipodi:ry="1.75"
+             sodipodi:rx="1.75"
+             sodipodi:cy="192.5"
+             sodipodi:cx="464.5"
+             id="path35439"
+             style="fill:#fbf7e5;fill-opacity:1;fill-rule:nonzero;stroke:#474213;stroke-width:0.63000238;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             sodipodi:type="arc" />
+        </g>
+      </g>
+      <rect
+         style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect35441"
+         width="2"
+         height="2"
+         x="264"
+         y="395" />
+    </g>
+    <g
+       transform="translate(147,337.99999)"
+       id="g35443"
+       style="display:inline;enable-background:new">
+      <rect
+         style="opacity:0;fill:#ffe680;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect35445"
+         width="16"
+         height="16"
+         x="131"
+         y="50" />
+      <path
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="ccccccccccccccccccccccccccccc"
+         id="path35447"
+         d="m 144.5,63.5 -1,0 -2.5,-1 -1.5,3 -1,0 -1.5,-3 -2.5,1 -1,10e-7 0,-1.000001 1,-2.5 -3,-1.5 0,-1 3,-1.5 -1,-2.5 0,-1 1,0 2.5,1 1.5,-3 1,0 1.5,3 2.5,-1 1,0 0,1 -1,2.5 3,1.5 0,1 -3,1.5 1,2.5 0,1 z"
+         style="opacity:0.85;fill:#f5efb2;fill-opacity:0.58823529;fill-rule:nonzero;stroke:#38330e;stroke-width:0.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         id="g35449">
+        <path
+           sodipodi:type="arc"
+           style="opacity:0.1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#e9ddaf;stroke-width:0.49999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path35451"
+           sodipodi:cx="464.5"
+           sodipodi:cy="192.5"
+           sodipodi:rx="1.75"
+           sodipodi:ry="1.75"
+           d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+           transform="matrix(1.9999998,0,0,2.0000014,-790.00001,-327.00035)" />
+        <path
+           transform="matrix(2.5714622,0,0,2.5714622,-1055.4442,-437.00638)"
+           d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+           sodipodi:ry="1.75"
+           sodipodi:rx="1.75"
+           sodipodi:cy="192.5"
+           sodipodi:cx="464.5"
+           id="path35453"
+           style="opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#fff6d5;stroke-width:0.38888386;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:type="arc" />
+        <path
+           transform="matrix(2.0000089,0,0,2.0000089,-790.00413,-327.00163)"
+           d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+           sodipodi:ry="1.75"
+           sodipodi:rx="1.75"
+           sodipodi:cy="192.5"
+           sodipodi:cx="464.5"
+           id="path35455"
+           style="fill:#b5a51f;fill-opacity:1;fill-rule:nonzero;stroke:#463f00;stroke-width:0.39999822;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:type="arc" />
         <rect
-           y="395"
-           x="264"
+           style="opacity:0.9;fill:#ffed55;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect35457"
+           width="5"
+           height="5"
+           x="136"
+           y="55"
+           rx="2.5"
+           ry="2.5" />
+        <rect
+           ry="1.875"
+           rx="1.875"
+           y="55.25"
+           x="136.25"
+           height="3.75"
+           width="3.75"
+           id="rect35459"
+           style="opacity:0.9;fill:#fbfaef;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           y="56"
+           x="137"
            height="2"
            width="2"
-           id="rect35441"
-           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           id="rect35461"
+           style="opacity:0.9;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       </g>
+    </g>
+    <g
+       transform="translate(189,295.99999)"
+       id="g35463"
+       style="display:inline;enable-background:new">
+      <rect
+         y="92"
+         x="152"
+         height="16"
+         width="16"
+         id="rect35465"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         style="display:inline;enable-background:new"
-         id="g35443"
-         transform="translate(147,358.99999)">
-        <rect
-           y="50"
-           x="131"
-           height="16"
-           width="16"
-           id="rect35445"
-           style="opacity:0;fill:#ffe680;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         id="g35467"
+         transform="matrix(1.6519496,0,0,1.6519309,-230.47015,-63.200317)"
+         style="opacity:0.25;display:inline;filter:url(#filter30564);enable-background:new"
+         clip-path="url(#clipPath31849)">
         <path
-           style="opacity:0.85;fill:#f5efb2;fill-opacity:0.58823529;fill-rule:nonzero;stroke:#38330e;stroke-width:0.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 144.5,63.5 -1,0 -2.5,-1 -1.5,3 -1,0 -1.5,-3 -2.5,1 -1,10e-7 0,-1.000001 1,-2.5 -3,-1.5 0,-1 3,-1.5 -1,-2.5 0,-1 1,0 2.5,1 1.5,-3 1,0 1.5,3 2.5,-1 1,0 0,1 -1,2.5 3,1.5 0,1 -3,1.5 1,2.5 0,1 z"
-           id="path35447"
-           sodipodi:nodetypes="ccccccccccccccccccccccccccccc"
-           inkscape:connector-curvature="0" />
+           sodipodi:type="arc"
+           style="opacity:0.1;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#fff6aa;stroke-width:0.26988116;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path35469"
+           sodipodi:cx="464.5"
+           sodipodi:cy="192.5"
+           sodipodi:rx="1.75"
+           sodipodi:ry="1.75"
+           d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+           transform="matrix(2.2376043,0,0,2.2484492,-801.20081,-335.84886)" />
+        <path
+           transform="matrix(1.9004611,0,0,1.899214,-644.62036,-268.6269)"
+           d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+           sodipodi:ry="1.75"
+           sodipodi:rx="1.75"
+           sodipodi:cy="192.5"
+           sodipodi:cx="464.5"
+           id="path35471"
+           style="opacity:0.25;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#ffe400;stroke-width:0.31863192;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:type="arc" />
+        <path
+           transform="matrix(1.5591172,0,0,1.559203,-486.06699,-203.16445)"
+           d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
+           sodipodi:ry="1.75"
+           sodipodi:rx="1.75"
+           sodipodi:cy="192.5"
+           sodipodi:cx="464.5"
+           id="path35473"
+           style="fill:#ffeeaa;fill-opacity:1;fill-rule:nonzero;stroke:#b4b200;stroke-width:0.38825312;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:type="arc" />
+      </g>
+      <g
+         id="g35477"
+         style="opacity:0.6"
+         transform="translate(-55,-1)">
         <g
-           id="g35449">
+           id="g35480">
           <path
-             transform="matrix(1.9999998,0,0,2.0000014,-790.00001,-327.00035)"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-             sodipodi:ry="1.75"
-             sodipodi:rx="1.75"
-             sodipodi:cy="192.5"
-             sodipodi:cx="464.5"
-             id="path35451"
-             style="opacity:0.1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#e9ddaf;stroke-width:0.49999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             sodipodi:type="arc" />
+             inkscape:connector-curvature="0"
+             id="path35482"
+             d="m 219.5,102 0,4.5"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             sodipodi:nodetypes="cc" />
           <path
-             sodipodi:type="arc"
-             style="opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#fff6d5;stroke-width:0.38888386;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="path35453"
-             sodipodi:cx="464.5"
-             sodipodi:cy="192.5"
-             sodipodi:rx="1.75"
-             sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-             transform="matrix(2.5714622,0,0,2.5714622,-1055.4442,-437.00638)" />
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccc"
+             id="path35484"
+             d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
+             style="fill:none;stroke:#2b2600;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        </g>
+        <g
+           id="g35486">
           <path
-             sodipodi:type="arc"
-             style="fill:#b5a51f;fill-opacity:1;fill-rule:nonzero;stroke:#463f00;stroke-width:0.39999822;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="path35455"
-             sodipodi:cx="464.5"
-             sodipodi:cy="192.5"
-             sodipodi:rx="1.75"
-             sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-             transform="matrix(2.0000089,0,0,2.0000089,-790.00413,-327.00163)" />
-          <rect
-             ry="2.5"
-             rx="2.5"
-             y="55"
-             x="136"
-             height="5"
-             width="5"
-             id="rect35457"
-             style="opacity:0.9;fill:#ffed55;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-          <rect
-             style="opacity:0.9;fill:#fbfaef;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect35459"
-             width="3.75"
-             height="3.75"
-             x="136.25"
-             y="55.25"
-             rx="1.875"
-             ry="1.875" />
-          <rect
-             style="opacity:0.9;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect35461"
-             width="2"
-             height="2"
-             x="137"
-             y="56" />
+             inkscape:connector-curvature="0"
+             style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 219.5,101.5 0,5.5"
+             id="path35488"
+             sodipodi:nodetypes="cc" />
+          <path
+             inkscape:connector-curvature="0"
+             style="fill:none;stroke:#ffffd5;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
+             id="path35490"
+             sodipodi:nodetypes="ccc" />
         </g>
       </g>
       <g
-         style="display:inline;enable-background:new"
-         id="g35463"
-         transform="translate(189,316.99999)">
-        <rect
-           style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect35465"
-           width="16"
-           height="16"
-           x="152"
-           y="92" />
+         style="opacity:0.6"
+         id="g35493"
+         transform="matrix(0,1,-1,0,261,-124)">
         <g
-           clip-path="url(#clipPath31849)"
-           style="opacity:0.25;display:inline;filter:url(#filter30564);enable-background:new"
-           transform="matrix(1.6519496,0,0,1.6519309,-230.47015,-63.200317)"
-           id="g35467">
-          <path
-             transform="matrix(2.2376043,0,0,2.2484492,-801.20081,-335.84886)"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-             sodipodi:ry="1.75"
-             sodipodi:rx="1.75"
-             sodipodi:cy="192.5"
-             sodipodi:cx="464.5"
-             id="path35469"
-             style="opacity:0.1;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#fff6aa;stroke-width:0.26988116;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             sodipodi:type="arc" />
+           id="g35496">
           <path
-             sodipodi:type="arc"
-             style="opacity:0.25;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#ffe400;stroke-width:0.31863192;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="path35471"
-             sodipodi:cx="464.5"
-             sodipodi:cy="192.5"
-             sodipodi:rx="1.75"
-             sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-             transform="matrix(1.9004611,0,0,1.899214,-644.62036,-268.6269)" />
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="cc"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 219.5,102 0,4.5"
+             id="path35498" />
           <path
-             sodipodi:type="arc"
-             style="fill:#ffeeaa;fill-opacity:1;fill-rule:nonzero;stroke:#b4b200;stroke-width:0.38825312;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="path35473"
-             sodipodi:cx="464.5"
-             sodipodi:cy="192.5"
-             sodipodi:rx="1.75"
-             sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
-             transform="matrix(1.5591172,0,0,1.559203,-486.06699,-203.16445)" />
+             inkscape:connector-curvature="0"
+             style="fill:none;stroke:#2b2600;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
+             id="path35500"
+             sodipodi:nodetypes="ccc" />
         </g>
         <g
-           transform="translate(-55,-1)"
-           style="opacity:0.6"
-           id="g35477">
-          <g
-             id="g35480">
-            <path
-               sodipodi:nodetypes="cc"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 219.5,102 0,4.5"
-               id="path35482"
-               inkscape:connector-curvature="0" />
-            <path
-               style="fill:none;stroke:#2b2600;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
-               id="path35484"
-               sodipodi:nodetypes="ccc"
-               inkscape:connector-curvature="0" />
-          </g>
-          <g
-             id="g35486">
-            <path
-               sodipodi:nodetypes="cc"
-               id="path35488"
-               d="m 219.5,101.5 0,5.5"
-               style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               inkscape:connector-curvature="0" />
-            <path
-               sodipodi:nodetypes="ccc"
-               id="path35490"
-               d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
-               style="fill:none;stroke:#ffffd5;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-               inkscape:connector-curvature="0" />
-          </g>
+           id="g35502">
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="cc"
+             id="path35504"
+             d="m 219.5,101.5 0,5.5"
+             style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccc"
+             id="path35506"
+             d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
+             style="fill:none;stroke:#ffffd5;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
         </g>
+      </g>
+      <g
+         id="g35508"
+         style="opacity:0.65;display:inline;enable-background:new"
+         transform="translate(-41,41)">
         <g
-           transform="matrix(0,1,-1,0,261,-124)"
-           id="g35493"
-           style="opacity:0.6">
-          <g
-             id="g35496">
-            <path
-               id="path35498"
-               d="m 219.5,102 0,4.5"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               sodipodi:nodetypes="cc"
-               inkscape:connector-curvature="0" />
-            <path
-               sodipodi:nodetypes="ccc"
-               id="path35500"
-               d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
-               style="fill:none;stroke:#2b2600;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               inkscape:connector-curvature="0" />
-          </g>
-          <g
-             id="g35502">
-            <path
-               style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 219.5,101.5 0,5.5"
-               id="path35504"
-               sodipodi:nodetypes="cc"
-               inkscape:connector-curvature="0" />
-            <path
-               style="fill:none;stroke:#ffffd5;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-               d="m 221.75,105.25 -2.25,2.25 -2.25,-2.25"
-               id="path35506"
-               sodipodi:nodetypes="ccc"
-               inkscape:connector-curvature="0" />
-          </g>
+           id="g35510"
+           transform="translate(21,21)">
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccc"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             d="m 174.5,40.5 0,3 3,0"
+             id="path35512" />
+          <path
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="cz"
+             id="path35514"
+             style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 175.5,42.5 5.75,-5.75" />
         </g>
         <g
-           transform="translate(-41,41)"
-           style="opacity:0.65;display:inline;enable-background:new"
-           id="g35508">
+           transform="matrix(-1,0,0,-1,383,116)"
+           id="g35516">
           <g
-             transform="translate(21,21)"
-             id="g35510">
+             style="display:inline"
+             transform="matrix(-1,0,0,-1,272.1613,155.99999)"
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             id="g35518">
             <path
-               id="path35512"
-               d="m 174.5,40.5 0,3 3,0"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-               sodipodi:nodetypes="ccc"
-               inkscape:connector-curvature="0" />
+               inkscape:connector-curvature="0"
+               d=""
+               sodipodi:nodetypes="cz"
+               id="path35520"
+               style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
             <path
-               d="m 175.5,42.5 5.75,-5.75"
-               style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35514"
+               inkscape:connector-curvature="0"
                sodipodi:nodetypes="cz"
-               inkscape:connector-curvature="0" />
+               id="path35522"
+               style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 85.6613,103.49999 6.25,-6.25" />
           </g>
+          <path
+             inkscape:connector-curvature="0"
+             style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 188,51 0,4 -1,0 0,-3 -3,0 0,-1 4,0 z"
+             id="path35524"
+             sodipodi:nodetypes="ccccccc" />
           <g
-             id="g35516"
-             transform="matrix(-1,0,0,-1,383,116)">
-            <g
-               id="g35518"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-               inkscape:export-xdpi="90"
-               inkscape:export-ydpi="90"
-               transform="matrix(-1,0,0,-1,272.1613,155.99999)"
-               style="display:inline">
-              <path
-                 style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35520"
-                 sodipodi:nodetypes="cz"
-                 d=""
-                 inkscape:connector-curvature="0" />
-              <path
-                 d="m 85.6613,103.49999 6.25,-6.25"
-                 style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35522"
-                 sodipodi:nodetypes="cz"
-                 inkscape:connector-curvature="0" />
-            </g>
+             id="g35526"
+             style="opacity:0.2"
+             transform="matrix(-1,0,0,1,-29,-335)">
             <path
-               sodipodi:nodetypes="ccccccc"
-               id="path35524"
-               d="m 188,51 0,4 -1,0 0,-3 -3,0 0,-1 4,0 z"
-               style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               inkscape:connector-curvature="0" />
-            <g
-               transform="matrix(-1,0,0,1,-29,-335)"
-               style="opacity:0.2"
-               id="g35526">
-              <path
-                 sodipodi:nodetypes="ccccccc"
-                 id="path35528"
-                 d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
-                 style="fill:#b5a731;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:connector-curvature="0" />
-            </g>
+               inkscape:connector-curvature="0"
+               style="fill:#b5a731;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
+               id="path35528"
+               sodipodi:nodetypes="ccccccc" />
           </g>
         </g>
+      </g>
+      <path
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="cc"
+         id="path35530"
+         d="m 161.5,95.5 3,3"
+         style="opacity:0.15;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#ffeeaa;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30556);enable-background:accumulate" />
+      <path
+         inkscape:connector-curvature="0"
+         style="opacity:0.25;fill:#ffdd55;fill-opacity:1;fill-rule:nonzero;stroke:#ffed55;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30552);enable-background:accumulate"
+         d="m 161.5,94.5 4,4"
+         id="path35532"
+         sodipodi:nodetypes="cc" />
+      <path
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="cc"
+         id="path35534"
+         d="m 161.5,93.5 5,5"
+         style="fill:none;stroke:#5a5310;stroke-width:3.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <path
+         inkscape:connector-curvature="0"
+         style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#fbf7e5;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         d="m 161.5,93.5 5,5"
+         id="path35536"
+         sodipodi:nodetypes="cc" />
+    </g>
+    <g
+       transform="translate(168,274.99999)"
+       id="g35538"
+       style="display:inline;enable-background:new">
+      <rect
+         style="opacity:0.01000001;fill:#333333;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect35540"
+         width="16"
+         height="16"
+         x="152"
+         y="113.00001" />
+      <g
+         id="g35542"
+         transform="translate(-21,21.000005)">
         <path
-           style="opacity:0.15;fill:#e1d18e;fill-opacity:1;fill-rule:nonzero;stroke:#ffeeaa;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30556);enable-background:accumulate"
-           d="m 161.5,95.5 3,3"
-           id="path35530"
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           style="opacity:0.12000002;fill:#fff6aa;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30544);enable-background:accumulate"
+           d="m 177,94.75 c 0,0 -0.47556,3.774441 2.5,6.75 2.97556,2.97556 7,2.5 7,2.5 3.44436,-0.63991 2.99995,-3.42845 0.0937,-4.5 -1.83387,-3.557342 -2.66053,-4.290113 -5.09375,-5.09375 -0.64623,-3.372957 -3.91818,-2.771894 -4.5,0.34375 l 5e-5,0 z"
+           id="path35544"
+           sodipodi:nodetypes="cscccc" />
         <path
-           sodipodi:nodetypes="cc"
-           id="path35532"
-           d="m 161.5,94.5 4,4"
-           style="opacity:0.25;fill:#ffdd55;fill-opacity:1;fill-rule:nonzero;stroke:#ffed55;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30552);enable-background:accumulate"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           style="opacity:0.17000002;fill:#ffed55;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30580);enable-background:accumulate"
+           d="m 179.15625,93.71875 c 0,0 -0.3702,1.0264 -0.21875,2.1875 0.15145,1.1611 0.76936,2.613109 2.15625,4 1.38689,1.38689 2.8389,2.0048 4,2.15625 1.1611,0.15145 2.1875,-0.21875 2.1875,-0.21875 1.01828,-0.43147 1.49397,-1.60672 1.0625,-2.625 l -5.65501,-5.846474 c -1.32148,-1.409979 -2.40864,-0.889298 -3.53249,0.346474 z"
+           id="path35546"
+           sodipodi:nodetypes="cssscccc" />
         <path
-           style="fill:none;stroke:#5a5310;stroke-width:3.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 161.5,93.5 5,5"
-           id="path35534"
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cssscccc"
+           id="path35548"
+           d="m 179.15625,93.71875 c 0,0 -0.3702,1.0264 -0.21875,2.1875 0.15145,1.1611 0.76936,2.613109 2.15625,4 1.38689,1.38689 2.8389,2.0048 4,2.15625 1.1611,0.15145 2.1875,-0.21875 2.1875,-0.21875 1.01828,-0.43147 1.49397,-1.60672 1.0625,-2.625 l -5.65501,-5.846474 c -1.32148,-1.409979 -2.40864,-0.889298 -3.53249,0.346474 z"
+           style="opacity:0.18000004;fill:#fff6aa;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30580);enable-background:accumulate"
+           transform="matrix(0.5121167,0,0,0.5121167,89.625148,47.477443)" />
         <path
-           sodipodi:nodetypes="cc"
-           id="path35536"
-           d="m 161.5,93.5 5,5"
-           style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#fbf7e5;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           style="fill:none;stroke:#5a5310;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 176.5,93.5 c 0,0 5.75,-0.25 8.5,2.5 2.75,2.75 2.5,8.5 2.5,8.5"
+           id="path35550"
+           sodipodi:nodetypes="czs" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="czs"
+           id="path35552"
+           d="m 176.5,93.5 c 0,0 5.75,-0.25 8.5,2.5 3,3 2.5,8.5 2.5,8.5"
+           style="fill:none;stroke:#fbf7e5;stroke-width:1.39999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       </g>
       <g
-         style="display:inline;enable-background:new"
-         id="g35538"
-         transform="translate(168,295.99999)">
-        <rect
-           y="113.00001"
-           x="152"
-           height="16"
-           width="16"
-           id="rect35540"
-           style="opacity:0.01000001;fill:#333333;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         id="g35554"
+         style="opacity:0.65;display:inline;enable-background:new"
+         transform="translate(-42,63.000005)">
         <g
-           transform="translate(-21,21.000005)"
-           id="g35542">
-          <path
-             sodipodi:nodetypes="cscccc"
-             id="path35544"
-             d="m 177,94.75 c 0,0 -0.47556,3.774441 2.5,6.75 2.97556,2.97556 7,2.5 7,2.5 3.44436,-0.63991 2.99995,-3.42845 0.0937,-4.5 -1.83387,-3.557342 -2.66053,-4.290113 -5.09375,-5.09375 -0.64623,-3.372957 -3.91818,-2.771894 -4.5,0.34375 l 5e-5,0 z"
-             style="opacity:0.12000002;fill:#fff6aa;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30544);enable-background:accumulate"
-             inkscape:connector-curvature="0" />
-          <path
-             sodipodi:nodetypes="cssscccc"
-             id="path35546"
-             d="m 179.15625,93.71875 c 0,0 -0.3702,1.0264 -0.21875,2.1875 0.15145,1.1611 0.76936,2.613109 2.15625,4 1.38689,1.38689 2.8389,2.0048 4,2.15625 1.1611,0.15145 2.1875,-0.21875 2.1875,-0.21875 1.01828,-0.43147 1.49397,-1.60672 1.0625,-2.625 l -5.65501,-5.846474 c -1.32148,-1.409979 -2.40864,-0.889298 -3.53249,0.346474 z"
-             style="opacity:0.17000002;fill:#ffed55;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30580);enable-background:accumulate"
-             inkscape:connector-curvature="0" />
-          <path
-             transform="matrix(0.5121167,0,0,0.5121167,89.625148,47.477443)"
-             style="opacity:0.18000004;fill:#fff6aa;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter30580);enable-background:accumulate"
-             d="m 179.15625,93.71875 c 0,0 -0.3702,1.0264 -0.21875,2.1875 0.15145,1.1611 0.76936,2.613109 2.15625,4 1.38689,1.38689 2.8389,2.0048 4,2.15625 1.1611,0.15145 2.1875,-0.21875 2.1875,-0.21875 1.01828,-0.43147 1.49397,-1.60672 1.0625,-2.625 l -5.65501,-5.846474 c -1.32148,-1.409979 -2.40864,-0.889298 -3.53249,0.346474 z"
-             id="path35548"
-             sodipodi:nodetypes="cssscccc"
-             inkscape:connector-curvature="0" />
+           id="g35556"
+           transform="translate(21,21)">
           <path
-             sodipodi:nodetypes="czs"
-             id="path35550"
-             d="m 176.5,93.5 c 0,0 5.75,-0.25 8.5,2.5 2.75,2.75 2.5,8.5 2.5,8.5"
-             style="fill:none;stroke:#5a5310;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             inkscape:connector-curvature="0" />
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccc"
+             style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             d="m 174.5,40.5 0,3 3,0"
+             id="path35558" />
           <path
-             style="fill:none;stroke:#fbf7e5;stroke-width:1.39999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             d="m 176.5,93.5 c 0,0 5.75,-0.25 8.5,2.5 3,3 2.5,8.5 2.5,8.5"
-             id="path35552"
-             sodipodi:nodetypes="czs"
-             inkscape:connector-curvature="0" />
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="cz"
+             id="path35561"
+             style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 175.5,42.5 6.25,-6.25" />
         </g>
         <g
-           transform="translate(-42,63.000005)"
-           style="opacity:0.65;display:inline;enable-background:new"
-           id="g35554">
+           transform="matrix(-1,0,0,-1,383,116)"
+           id="g35563">
           <g
-             transform="translate(21,21)"
-             id="g35556">
+             style="display:inline"
+             transform="matrix(-1,0,0,-1,272.1613,155.99999)"
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             id="g35566">
             <path
-               id="path35558"
-               d="m 174.5,40.5 0,3 3,0"
-               style="fill:none;stroke:#2b2600;stroke-width:2.5;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-               sodipodi:nodetypes="ccc"
-               inkscape:connector-curvature="0" />
+               inkscape:connector-curvature="0"
+               d=""
+               sodipodi:nodetypes="cz"
+               id="path35568"
+               style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
             <path
-               d="m 175.5,42.5 6.25,-6.25"
-               style="fill:none;stroke:#2b2600;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               id="path35561"
+               inkscape:connector-curvature="0"
                sodipodi:nodetypes="cz"
-               inkscape:connector-curvature="0" />
+               id="path35570"
+               style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 85.6613,103.49999 7,-7" />
           </g>
+          <path
+             inkscape:connector-curvature="0"
+             style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 188,51 0,4 -1,0 0,-3 -3,0 0,-1 4,0 z"
+             id="path35572"
+             sodipodi:nodetypes="ccccccc" />
           <g
-             id="g35563"
-             transform="matrix(-1,0,0,-1,383,116)">
-            <g
-               id="g35566"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-               inkscape:export-xdpi="90"
-               inkscape:export-ydpi="90"
-               transform="matrix(-1,0,0,-1,272.1613,155.99999)"
-               style="display:inline">
-              <path
-                 style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35568"
-                 sodipodi:nodetypes="cz"
-                 d=""
-                 inkscape:connector-curvature="0" />
-              <path
-                 d="m 85.6613,103.49999 7,-7"
-                 style="opacity:0.85;fill:none;stroke:#f4f1d7;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 id="path35570"
-                 sodipodi:nodetypes="cz"
-                 inkscape:connector-curvature="0" />
-            </g>
+             id="g35574"
+             style="opacity:0.2"
+             transform="matrix(-1,0,0,1,-29,-335)">
             <path
-               sodipodi:nodetypes="ccccccc"
-               id="path35572"
-               d="m 188,51 0,4 -1,0 0,-3 -3,0 0,-1 4,0 z"
-               style="fill:#fffbd5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               inkscape:connector-curvature="0" />
-            <g
-               transform="matrix(-1,0,0,1,-29,-335)"
-               style="opacity:0.2"
-               id="g35574">
-              <path
-                 sodipodi:nodetypes="ccccccc"
-                 id="path35576"
-                 d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
-                 style="fill:#b5a731;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:connector-curvature="0" />
-            </g>
+               inkscape:connector-curvature="0"
+               style="fill:#b5a731;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m -216,387 0,2 1,0 0,-1 1,0 0,-1 -2,0 z"
+               id="path35576"
+               sodipodi:nodetypes="ccccccc" />
           </g>
         </g>
       </g>
@@ -59942,7 +64622,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -59950,7 +64630,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -60109,7 +64789,7 @@
          sodipodi:cy="118"
          sodipodi:rx="8"
          sodipodi:ry="8"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90"
@@ -60122,7 +64802,7 @@
          sodipodi:cy="118"
          sodipodi:rx="8"
          sodipodi:ry="8"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90"
@@ -60170,7 +64850,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -60190,9 +64870,9 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z" />
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z" />
         <path
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -60226,7 +64906,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -60242,7 +64922,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z" />
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z" />
       </g>
     </g>
     <g
@@ -60348,7 +65028,7 @@
            sodipodi:cy="325"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 287.5,325 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="m 287.5,325 c 0,0.82843 -0.67157,1.5 -1.5,1.5 -0.82843,0 -1.5,-0.67157 -1.5,-1.5 0,-0.82843 0.67157,-1.5 1.5,-1.5 0.82843,0 1.5,0.67157 1.5,1.5 z"
            transform="matrix(1.6666708,0,0,1.6666633,-190.66784,-215.66559)" />
         <rect
            y="328.49997"
@@ -60366,7 +65046,7 @@
            y="328.49997" />
         <path
            transform="matrix(1.333351,0,0,1.333345,-95.338377,-107.33714)"
-           d="m 287.5,325 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="m 287.5,325 c 0,0.82843 -0.67157,1.5 -1.5,1.5 -0.82843,0 -1.5,-0.67157 -1.5,-1.5 0,-0.82843 0.67157,-1.5 1.5,-1.5 0.82843,0 1.5,0.67157 1.5,1.5 z"
            sodipodi:ry="1.5"
            sodipodi:rx="1.5"
            sodipodi:cy="325"
@@ -60878,7 +65558,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -60900,7 +65580,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -60950,7 +65630,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -60982,7 +65662,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -61332,7 +66012,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -61352,7 +66032,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -61365,7 +66045,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -61379,7 +66059,7 @@
            id="g36537">
           <path
              transform="matrix(1.1428645,0,0,1.1428645,-416.36057,256.4986)"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              sodipodi:ry="1.75"
              sodipodi:rx="1.75"
              sodipodi:cy="192.5"
@@ -61395,7 +66075,7 @@
              sodipodi:cy="192.5"
              sodipodi:rx="1.75"
              sodipodi:ry="1.75"
-             d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+             d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
              transform="matrix(0.5714297,0,0,0.5714297,-150.92912,366.49979)" />
           <rect
              y="476"
@@ -61416,7 +66096,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -61696,7 +66376,7 @@
            inkscape:connector-curvature="0" />
         <path
            transform="matrix(0.5714297,0,0,0.5714297,-362.92909,351.49978)"
-           d="m 466.25,192.5 a 1.75,1.75 0 1 1 -3.5,0 1.75,1.75 0 1 1 3.5,0 z"
+           d="m 466.25,192.5 c 0,0.9665 -0.7835,1.75 -1.75,1.75 -0.9665,0 -1.75,-0.7835 -1.75,-1.75 0,-0.9665 0.7835,-1.75 1.75,-1.75 0.9665,0 1.75,0.7835 1.75,1.75 z"
            sodipodi:ry="1.75"
            sodipodi:rx="1.75"
            sodipodi:cy="192.5"
@@ -61751,7 +66431,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -61773,7 +66453,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -61781,7 +66461,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -63691,7 +68371,7 @@
           </g>
           <path
              transform="matrix(1.99999,0,0,1.99999,571.48293,-823.49525)"
-             d="m -92,477.5 a 0.5,0.5 0 1 1 -1,0 0.5,0.5 0 1 1 1,0 z"
+             d="m -92,477.5 c 0,0.27614 -0.223858,0.5 -0.5,0.5 -0.276142,0 -0.5,-0.22386 -0.5,-0.5 0,-0.27614 0.223858,-0.5 0.5,-0.5 0.276142,0 0.5,0.22386 0.5,0.5 z"
              sodipodi:ry="0.5"
              sodipodi:rx="0.5"
              sodipodi:cy="477.5"
@@ -63720,7 +68400,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -63729,7 +68409,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -63859,7 +68539,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -63876,14 +68556,14 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
            transform="matrix(-0.683022,-0.07745026,0.0778507,-0.683064,209.4726,314.325)" />
         <path
            transform="matrix(0.5705005,0,0,0.5705012,53.193935,156.18087)"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -63937,7 +68617,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -63954,7 +68634,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -63963,7 +68643,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -63996,7 +68676,7 @@
            transform="matrix(0.928617,0,0,0.931035,10.2435,15.47372)"
            id="g15313">
           <path
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -64013,7 +68693,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -64029,7 +68709,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -64038,7 +68718,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -64074,7 +68754,7 @@
          x="-24.00001"
          y="114" />
       <path
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -64103,12 +68783,12 @@
          sodipodi:cy="118"
          sodipodi:rx="8"
          sodipodi:ry="8"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z" />
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z" />
       <path
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-         d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+         d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
          sodipodi:ry="8"
          sodipodi:rx="8"
          sodipodi:cy="118"
@@ -64142,7 +68822,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -64161,7 +68841,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            transform="matrix(0.8125001,0,0,0.8125002,-73.250026,4.1249738)" />
         <path
            inkscape:export-ydpi="90"
@@ -64174,7 +68854,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="10.07671"
-           d="m 140,118 a 8,10.07671 0 0 1 -15.99907,0.15349"
+           d="m 140,118 c 0,5.56521 -3.58172,10.07671 -8,10.07671 -4.37076,0 -7.9325,-4.4185 -7.99907,-9.92322"
            sodipodi:start="0"
            sodipodi:end="3.12636"
            transform="matrix(0.8077059,0,0,-0.2072667,-72.578821,124.6156)"
@@ -64184,7 +68864,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -64201,7 +68881,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 0 1 -15.99907,0.12186"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.37076,0 -7.9325,-3.50789 -7.99907,-7.87814"
            sodipodi:start="0"
            sodipodi:end="3.12636"
            sodipodi:open="true"
@@ -64219,7 +68899,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            transform="matrix(0.6875009,0,0,0.687501,-56.75013,18.874887)" />
         <path
            inkscape:export-ydpi="90"
@@ -64232,14 +68912,14 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -5.7e-4,-0.0952"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.38113,0 7.94728,3.52395 7.99943,7.90477"
            sodipodi:start="0"
            sodipodi:end="6.2712816"
            sodipodi:open="true"
            transform="matrix(0,0.7811136,-0.34375,0,74.562502,-3.1287373)" />
         <path
            transform="matrix(0.9374995,0,0,0.9374996,-89.749939,-10.62495)"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -64291,268 +68971,6 @@
       </g>
     </g>
     <g
-       transform="translate(226,40)"
-       id="g39541">
-      <rect
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect39543"
-         width="16"
-         height="16"
-         x="-95"
-         y="516" />
-      <g
-         transform="translate(-122,1.3e-4)"
-         id="g39545">
-        <g
-           transform="translate(-116,424.99975)"
-           style="opacity:0.75"
-           id="g39547">
-          <g
-             id="g39549"
-             transform="translate(-179,199.50012)">
-            <path
-               sodipodi:nodetypes="ccccccc"
-               style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.00000167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               d="m 328.5,-107.25 -4.5,1.75 0,6.5 4.5,2.25 4.25,-2 0,-6.75 -4.25,-1.75 z"
-               id="path39551"
-               inkscape:connector-curvature="0" />
-            <g
-               id="g39553"
-               transform="translate(179,-179)">
-              <path
-                 sodipodi:nodetypes="ccccc"
-                 id="path39556"
-                 d="m 154,80 0,-6.5 -4.5,-1.75 0,10.5 L 154,80 z"
-                 style="fill:#666666;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-                 inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
-                 inkscape:export-xdpi="90"
-                 inkscape:export-ydpi="90"
-                 inkscape:connector-curvature="0" />
-            </g>
-            <path
-               inkscape:export-ydpi="90"
-               inkscape:export-xdpi="90"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
-               id="path39558"
-               d="m 324,-99.00012 0,-6.49988 4.5,-1.75 0.5,0.25 0,10 -0.5,0.25 -4.5,-2.25012 z"
-               style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               sodipodi:nodetypes="ccccccc"
-               inkscape:connector-curvature="0" />
-            <path
-               sodipodi:nodetypes="ccccc"
-               id="path39560"
-               d="m 332.5,-105.5 0,6.25 -4,2 -4,-2.00012 0,-6.24988"
-               style="fill:none;stroke:url(#linearGradient39630);stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-               inkscape:connector-curvature="0" />
-            <path
-               id="path39562"
-               d="m 324,-105.5 4.5,-1.75 4.5,1.75 -4.5,2 -4.5,-2 z"
-               style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-               sodipodi:nodetypes="ccccc"
-               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
-               inkscape:export-xdpi="90"
-               inkscape:export-ydpi="90"
-               inkscape:connector-curvature="0" />
-          </g>
-          <path
-             id="path39564"
-             d="m 145.5,94.25012 c 0,0 4,1.75 4,1.75 l 4,-1.75"
-             style="opacity:0.95999995;fill:none;stroke:url(#linearGradient39632);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-             sodipodi:nodetypes="ccc"
-             inkscape:connector-curvature="0" />
-          <rect
-             y="96.000122"
-             x="149"
-             height="6.7500019"
-             width="1"
-             id="rect39567"
-             style="opacity:0.35;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-          <rect
-             style="opacity:0.09599998;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39569"
-             width="1"
-             height="6.7500019"
-             x="150"
-             y="96.000122" />
-        </g>
-        <rect
-           style="fill:none;stroke:#8c4800;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect39571"
-           width="2.9999485"
-           height="3.0001416"
-           x="27.500006"
-           y="517.49976"
-           ry="0"
-           rx="0" />
-        <rect
-           rx="0"
-           ry="0"
-           y="524.49951"
-           x="27.500006"
-           height="3.0001416"
-           width="2.9999485"
-           id="rect39574"
-           style="fill:none;stroke:#8c4800;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           y="517.99988"
-           x="28.021444"
-           height="4"
-           width="3.9785564"
-           id="rect37868-0-5"
-           style="opacity:0.12000002;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <path
-           style="fill:none;stroke:#5a2f00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 28.000006,520.49983 -0.5,0 0,-3.00014 2.99995,0"
-           id="path39576"
-           sodipodi:nodetypes="cccc"
-           inkscape:connector-curvature="0" />
-        <path
-           sodipodi:nodetypes="cccc"
-           id="path39583"
-           d="m 28.000006,524.49978 -0.5,0 0,3.00014 2.99995,0"
-           style="fill:none;stroke:#5a2f00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           inkscape:connector-curvature="0" />
-        <rect
-           rx="0"
-           ry="0"
-           y="517.99988"
-           x="28.000051"
-           height="2.0000772"
-           width="1.9999485"
-           id="rect39585"
-           style="fill:#ffd4a5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           y="524.99988"
-           x="28"
-           height="1.999992"
-           width="3.9785564"
-           id="rect37868-0-1"
-           style="opacity:0.12000002;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           rx="0"
-           ry="0"
-           y="524.99982"
-           x="28.000051"
-           height="2.0000772"
-           width="1.9999485"
-           id="rect39587"
-           style="fill:#ffd4a5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      </g>
-      <g
-         style="display:inline;enable-background:new"
-         id="g39589"
-         transform="translate(-309,277)">
-        <path
-           id="path39596"
-           d="m 223,243 0,10 1,0 0,-1 1,0 1,0 0,2 1,0 0,1 1,0 0,-1 1,0 0,-2 -1,0 0,-2 1,0 1,0 0,-1 -1,0 0,-1 -1,0 0,-1 -1,0 0,-1 -1,0 0,-1 -1,0 0,-1 -1,0 0,-1 -1,0 z"
-           style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           inkscape:connector-curvature="0" />
-        <g
-           transform="translate(5,-6.0000002e-7)"
-           style="fill:#1a1a1a;display:inline;enable-background:new"
-           id="g39599">
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39601"
-             width="1"
-             height="10"
-             x="218"
-             y="243" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39603"
-             width="1"
-             height="1"
-             x="219"
-             y="244" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39605"
-             width="1"
-             height="1"
-             x="220"
-             y="245" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39607"
-             width="1"
-             height="1"
-             x="221"
-             y="246" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39609"
-             width="1"
-             height="1"
-             x="222"
-             y="247" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39611"
-             width="1"
-             height="1"
-             x="223"
-             y="248" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39613"
-             width="1.0000017"
-             height="1"
-             x="224"
-             y="249" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39615"
-             width="1"
-             height="1"
-             x="219"
-             y="252" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39617"
-             width="1"
-             height="1"
-             x="220"
-             y="251" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39619"
-             width="1"
-             height="2"
-             x="221"
-             y="252" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39621"
-             width="0.75"
-             height="2"
-             x="222.25"
-             y="250" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39623"
-             width="1"
-             height="1.9999931"
-             x="223"
-             y="252" />
-          <rect
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             id="rect39625"
-             width="1.5"
-             height="1.0000006"
-             x="222"
-             y="254" />
-          <rect
-             y="250"
-             x="223.5"
-             height="1"
-             width="1.5"
-             id="rect39627"
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        </g>
-      </g>
-    </g>
-    <g
        id="g40247"
        transform="translate(63,-21.000002)">
       <rect
@@ -65278,7 +69696,7 @@
                sodipodi:cy="118"
                sodipodi:rx="8"
                sodipodi:ry="8"
-               d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
                inkscape:export-xdpi="90"
                inkscape:export-ydpi="90" />
@@ -65294,7 +69712,7 @@
                inkscape:export-ydpi="90"
                inkscape:export-xdpi="90"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-               d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
                sodipodi:ry="8"
                sodipodi:rx="8"
                sodipodi:cy="118"
@@ -65362,7 +69780,7 @@
                sodipodi:cy="118"
                sodipodi:rx="8"
                sodipodi:ry="8"
-               d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
                inkscape:export-xdpi="90"
                inkscape:export-ydpi="90" />
@@ -65378,7 +69796,7 @@
                inkscape:export-ydpi="90"
                inkscape:export-xdpi="90"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-               d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
                sodipodi:ry="8"
                sodipodi:rx="8"
                sodipodi:cy="118"
@@ -66073,13 +70491,13 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
            transform="matrix(0.787566,0,0,0.779223,26.709197,21.3179)" />
         <path
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -66103,7 +70521,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z" />
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z" />
         <path
            sodipodi:nodetypes="cc"
            id="path40271"
@@ -66121,7 +70539,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -66131,7 +70549,7 @@
            sodipodi:type="arc"
            transform="matrix(0.6429129,0,0,0.6362007,45.809534,38.194473)" />
         <path
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -66781,7 +71199,7 @@
                sodipodi:cy="14.5"
                sodipodi:rx="1.5"
                sodipodi:ry="1.5"
-               d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+               d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
                transform="matrix(1.176776,0,0,1.176776,-12.47787,-2.548088)"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
                inkscape:export-xdpi="90"
@@ -68077,7 +72495,7 @@
            transform="matrix(1.1428564,0,0,1.2000001,822.71436,-355.40005)">
           <path
              transform="matrix(0.7630859,-0.2494396,0.2996015,0.9926766,-151.92281,17.77746)"
-             d="m 57.5,554 a 4.5,2.25 0 1 1 -9,0 4.5,2.25 0 1 1 9,0 z"
+             d="m 57.5,554 c 0,1.24264 -2.014719,2.25 -4.5,2.25 -2.485281,0 -4.5,-1.00736 -4.5,-2.25 0,-1.24264 2.014719,-2.25 4.5,-2.25 2.485281,0 4.5,1.00736 4.5,2.25 z"
              sodipodi:ry="2.25"
              sodipodi:rx="4.5"
              sodipodi:cy="554"
@@ -68093,7 +72511,7 @@
              sodipodi:cy="554"
              sodipodi:rx="4.5"
              sodipodi:ry="2.25"
-             d="m 57.5,554 a 4.5,2.25 0 1 1 -9,0 4.5,2.25 0 1 1 9,0 z"
+             d="m 57.5,554 c 0,1.24264 -2.014719,2.25 -4.5,2.25 -2.485281,0 -4.5,-1.00736 -4.5,-2.25 0,-1.24264 2.014719,-2.25 4.5,-2.25 2.485281,0 4.5,1.00736 4.5,2.25 z"
              transform="matrix(0.3848865,-0.1700959,0.2278131,0.3626733,-93.107467,361.59408)"
              inkscape:transform-center-y="0.3813435"
              clip-path="url(#clipPath20586)" />
@@ -68115,13 +72533,13 @@
              sodipodi:cy="554"
              sodipodi:rx="4.5"
              sodipodi:ry="2.25"
-             d="m 57.5,554 a 4.5,2.25 0 1 1 -9,0 4.5,2.25 0 1 1 9,0 z"
+             d="m 57.5,554 c 0,1.24264 -2.014719,2.25 -4.5,2.25 -2.485281,0 -4.5,-1.00736 -4.5,-2.25 0,-1.24264 2.014719,-2.25 4.5,-2.25 2.485281,0 4.5,1.00736 4.5,2.25 z"
              transform="matrix(0.7630859,-0.2494396,0.2996015,0.9926766,-151.92281,17.77746)" />
           <path
              clip-path="url(#clipPath20586)"
              inkscape:transform-center-y="0.3813435"
              transform="matrix(0.3848865,-0.1700959,0.2278131,0.3626733,-93.107467,361.59408)"
-             d="m 57.5,554 a 4.5,2.25 0 1 1 -9,0 4.5,2.25 0 1 1 9,0 z"
+             d="m 57.5,554 c 0,1.24264 -2.014719,2.25 -4.5,2.25 -2.485281,0 -4.5,-1.00736 -4.5,-2.25 0,-1.24264 2.014719,-2.25 4.5,-2.25 2.485281,0 4.5,1.00736 4.5,2.25 z"
              sodipodi:ry="2.25"
              sodipodi:rx="4.5"
              sodipodi:cy="554"
@@ -68292,7 +72710,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -68300,7 +72718,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -68334,7 +72752,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -68454,7 +72872,7 @@
            transform="matrix(0.5406242,0,0,0.5829534,814.13667,247.65542)">
           <path
              transform="matrix(1.274286,0,0,1.377124,-7.569123,-16.70193)"
-             d="m 43.487067,38.98439 a 15.467961,5.3033009 0 1 1 -30.935922,0 15.467961,5.3033009 0 1 1 30.935922,0 z"
+             d="m 43.487067,38.98439 c 0,2.928932 -6.925242,5.303301 -15.467961,5.303301 -8.542719,0 -15.467961,-2.374369 -15.467961,-5.303301 0,-2.928932 6.925242,-5.303301 15.467961,-5.303301 8.542719,0 15.467961,2.374369 15.467961,5.303301 z"
              sodipodi:ry="5.3033009"
              sodipodi:rx="15.467961"
              sodipodi:cy="38.98439"
@@ -68470,7 +72888,7 @@
              style="fill:#f57900;fill-rule:evenodd;stroke:#aa4400;stroke-width:1.7812928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none" />
           <path
              transform="matrix(0.8018194,0,0,0.8471126,6.257567,4.5089892)"
-             d="m 42.75,25.75 a 11.5625,10.125 0 1 1 -23.125,0 11.5625,10.125 0 1 1 23.125,0 z"
+             d="m 42.75,25.75 c 0,5.591883 -5.176708,10.125 -11.5625,10.125 -6.385792,0 -11.5625,-4.533117 -11.5625,-10.125 0,-5.591883 5.176708,-10.125 11.5625,-10.125 6.385792,0 11.5625,4.533117 11.5625,10.125 z"
              sodipodi:ry="10.125"
              sodipodi:rx="11.5625"
              sodipodi:cy="25.75"
@@ -69032,7 +73450,7 @@
              d="m 930.5,344.5 0,3 c 0,1.73575 -1.26424,3 -3,3 l -5,0 c -1.73576,0 -3,1.26425 -3,3 l 0,3"
              style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.78431373;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
           <path
-             d="m 923,342 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 923,342 c 0,0.55228 -0.44772,1 -1,1 -0.55228,0 -1,-0.44772 -1,-1 0,-0.55228 0.44772,-1 1,-1 0.55228,0 1,0.44772 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="342"
@@ -69041,7 +73459,7 @@
              style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
              sodipodi:type="arc" />
           <path
-             d="m 929,359 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+             d="m 929,359 c 0,0.55228 -0.44772,1 -1,1 -0.55228,0 -1,-0.44772 -1,-1 0,-0.55228 0.44772,-1 1,-1 0.55228,0 1,0.44772 1,1 z"
              sodipodi:ry="1"
              sodipodi:rx="1"
              sodipodi:cy="359"
@@ -69084,7 +73502,7 @@
                sodipodi:cy="342"
                sodipodi:rx="1"
                sodipodi:ry="1"
-               d="m 923,342 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z" />
+               d="m 923,342 c 0,0.55228 -0.44772,1 -1,1 -0.55228,0 -1,-0.44772 -1,-1 0,-0.55228 0.44772,-1 1,-1 0.55228,0 1,0.44772 1,1 z" />
           </g>
           <g
              style="opacity:0.8;stroke:#ff0000"
@@ -69114,7 +73532,7 @@
                d="m 918.5,355.5 0,-2 c 0,-2.25 1.75,-4 4,-4 l 4.5,0 c 1.75,0 2.5,-0.75 2.5,-2.5 l 0,-0.5"
                style="fill:none;stroke:url(#radialGradient34973-2-5-7);stroke-linecap:round;stroke-linejoin:round" />
             <path
-               d="m 923,342 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+               d="m 923,342 c 0,0.55228 -0.44772,1 -1,1 -0.55228,0 -1,-0.44772 -1,-1 0,-0.55228 0.44772,-1 1,-1 0.55228,0 1,0.44772 1,1 z"
                sodipodi:ry="1"
                sodipodi:rx="1"
                sodipodi:cy="342"
@@ -69451,7 +73869,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 139.98403,118.50525 a 8,8 0 1 1 -8.39706,-8.49458"
+           d="m 139.98403,118.50525 c -0.27904,4.40946 -4.07982,7.75782 -8.48928,7.47878 -4.40946,-0.27904 -7.75782,-4.07982 -7.47878,-8.48928 0.25664,-4.05547 3.51283,-7.27428 7.571,-7.48408"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -69463,7 +73881,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 139.98403,118.50525 a 8,8 0 1 1 -8.39706,-8.49458"
+           d="m 139.98403,118.50525 c -0.27904,4.40946 -4.07982,7.75782 -8.48928,7.47878 -4.40946,-0.27904 -7.75782,-4.07982 -7.47878,-8.48928 0.25664,-4.05547 3.51283,-7.27428 7.571,-7.48408"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -69483,7 +73901,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 139.98403,118.50525 a 8,8 0 1 1 -8.39706,-8.49458"
+           d="m 139.98403,118.50525 c -0.27904,4.40946 -4.07982,7.75782 -8.48928,7.47878 -4.40946,-0.27904 -7.75782,-4.07982 -7.47878,-8.48928 0.25664,-4.05547 3.51283,-7.27428 7.571,-7.48408"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
@@ -69496,7 +73914,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 139.98403,118.50525 a 8,8 0 1 1 -8.39706,-8.49458"
+           d="m 139.98403,118.50525 c -0.27904,4.40946 -4.07982,7.75782 -8.48928,7.47878 -4.40946,-0.27904 -7.75782,-4.07982 -7.47878,-8.48928 0.25664,-4.05547 3.51283,-7.27428 7.571,-7.48408"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -69634,7 +74052,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -69643,7 +74061,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -69655,7 +74073,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -70507,231 +74925,6 @@
       </g>
     </g>
     <g
-       id="g23604"
-       transform="translate(0,-21)">
-      <g
-         id="g23590"
-         style="fill:#321900">
-        <rect
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23464"
-           width="1"
-           height="2"
-           x="-258"
-           y="-602"
-           transform="scale(-1,-1)" />
-        <rect
-           y="-606"
-           x="-258"
-           height="2"
-           width="1"
-           id="rect23466"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           transform="scale(-1,-1)" />
-        <rect
-           transform="scale(-1,-1)"
-           y="-602"
-           x="-273"
-           height="2"
-           width="1"
-           id="rect23548"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           transform="scale(-1,-1)"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23550"
-           width="1"
-           height="2"
-           x="-273"
-           y="-606" />
-        <rect
-           transform="matrix(0,1,-1,0,0,0)"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23472"
-           width="1"
-           height="2"
-           x="598"
-           y="-268" />
-        <rect
-           y="-264"
-           x="598"
-           height="2"
-           width="1"
-           id="rect23474"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           transform="matrix(0,1,-1,0,0,0)" />
-        <rect
-           y="-271.99207"
-           x="598"
-           height="2"
-           width="1"
-           id="rect23476"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           transform="matrix(0,1,-1,0,0,0)" />
-        <rect
-           transform="matrix(0,1,-1,0,0,0)"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23480"
-           width="1"
-           height="2"
-           x="598"
-           y="-259.99207" />
-        <rect
-           y="-268"
-           x="607"
-           height="2"
-           width="1"
-           id="rect23540"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           transform="matrix(0,1,-1,0,0,0)" />
-        <rect
-           transform="matrix(0,1,-1,0,0,0)"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23542"
-           width="1"
-           height="2"
-           x="607"
-           y="-264" />
-        <rect
-           transform="matrix(0,1,-1,0,0,0)"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23544"
-           width="1"
-           height="2"
-           x="607"
-           y="-271.99207" />
-        <rect
-           y="-259.99207"
-           x="607"
-           height="2"
-           width="1"
-           id="rect23546"
-           style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           transform="matrix(0,1,-1,0,0,0)" />
-      </g>
-      <g
-         id="g23572">
-        <rect
-           y="-270"
-           x="-608"
-           height="2"
-           width="1"
-           id="rect23461"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           transform="matrix(0,-1,-1,0,0,0)" />
-        <rect
-           y="-600"
-           x="-273"
-           height="2"
-           width="1"
-           id="rect23468"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           transform="scale(-1,-1)" />
-        <rect
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           id="rect23470"
-           width="1"
-           height="2"
-           x="-273"
-           y="-604"
-           transform="scale(-1,-1)" />
-        <rect
-           transform="matrix(0,-1,-1,0,0,0)"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           id="rect23478"
-           width="1"
-           height="2"
-           x="-608"
-           y="-266" />
-        <rect
-           y="-262"
-           x="-608"
-           height="2"
-           width="1"
-           id="rect23482"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           transform="matrix(0,-1,-1,0,0,0)" />
-        <rect
-           transform="matrix(0,1,-1,0,0,0)"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           id="rect23529"
-           width="1"
-           height="2"
-           x="598"
-           y="-262" />
-        <rect
-           y="-266"
-           x="598"
-           height="2"
-           width="1"
-           id="rect23531"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           transform="matrix(0,1,-1,0,0,0)" />
-        <rect
-           transform="matrix(0,1,-1,0,0,0)"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           id="rect23533"
-           width="1"
-           height="2"
-           x="598"
-           y="-270" />
-        <rect
-           transform="matrix(0,-1,-1,0,0,0)"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           id="rect23535"
-           width="2"
-           height="1"
-           x="-608"
-           y="-273" />
-        <rect
-           transform="scale(-1,-1)"
-           y="-600"
-           x="-258"
-           height="2"
-           width="1"
-           id="rect23525"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           transform="scale(-1,-1)"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect23527"
-           width="1"
-           height="2"
-           x="-258"
-           y="-604" />
-        <rect
-           y="-608"
-           x="-258"
-           height="2"
-           width="1"
-           id="rect23537"
-           style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           transform="scale(-1,-1)" />
-      </g>
-      <rect
-         style="opacity:0.2;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect23637"
-         width="14"
-         height="8"
-         x="258"
-         y="599" />
-      <path
-         id="path23639"
-         d="m 259,600 13,0 0,-1 -14,0 0,8 1,0 0,-7 z"
-         style="opacity:0.12999998;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         sodipodi:nodetypes="ccccccc"
-         inkscape:connector-curvature="0" />
-      <g
-         style="display:inline;enable-background:new"
-         id="g23641"
-         transform="translate(40,359)">
-        <g
-           transform="translate(5,-6.0000002e-7)"
-           style="fill:#1a1a1a;display:inline;enable-background:new"
-           id="g23646" />
-      </g>
-    </g>
-    <g
        style="display:inline;enable-background:new"
        id="g21623-4"
        transform="translate(-83.999976,274.99821)">
@@ -70879,7 +75072,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -70888,7 +75081,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -70907,7 +75100,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            transform="matrix(0.5705005,0,0,0.5705012,51.746079,156.18087)" />
       </g>
       <g
@@ -70921,7 +75114,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -70938,14 +75131,14 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
            transform="matrix(-0.683022,-0.07745026,0.0778507,-0.683064,209.4726,314.325)" />
         <path
            transform="matrix(0.5705005,0,0,0.5705012,53.193935,156.18087)"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -70984,7 +75177,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -71001,7 +75194,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -71015,7 +75208,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -71023,7 +75216,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -71036,7 +75229,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -71257,7 +75450,7 @@
              sodipodi:end="1.5729572"
              sodipodi:start="0"
              transform="matrix(-2.421633,0,0,-2.417581,92.2682,-69.13182)"
-             d="m 54,-32.5 a 4.5,4.5 0 0 1 -4.509724,4.499989"
+             d="m 54,-32.5 c 0,2.485281 -2.014719,4.5 -4.5,4.5 -0.0032,0 -0.0065,-4e-6 -0.0097,-1.1e-5"
              sodipodi:ry="4.5"
              sodipodi:rx="4.5"
              sodipodi:cy="-32.5"
@@ -71276,7 +75469,7 @@
              sodipodi:cy="-32.5"
              sodipodi:rx="4.5"
              sodipodi:ry="4.5"
-             d="m 54,-32.5 a 4.5,4.5 0 0 1 -4.509724,4.499989"
+             d="m 54,-32.5 c 0,2.485281 -2.014719,4.5 -4.5,4.5 -0.0032,0 -0.0065,-4e-6 -0.0097,-1.1e-5"
              transform="matrix(-2.421633,0,0,-2.417581,92.2682,-69.13182)"
              sodipodi:start="0"
              sodipodi:end="1.5729572"
@@ -71293,7 +75486,7 @@
              sodipodi:end="1.5729572"
              sodipodi:start="0"
              transform="matrix(-2.421633,0,0,-2.417581,92.2682,-69.13182)"
-             d="m 54,-32.5 a 4.5,4.5 0 0 1 -4.509724,4.499989"
+             d="m 54,-32.5 c 0,2.485281 -2.014719,4.5 -4.5,4.5 -0.0032,0 -0.0065,-4e-6 -0.0097,-1.1e-5"
              sodipodi:ry="4.5"
              sodipodi:rx="4.5"
              sodipodi:cy="-32.5"
@@ -71312,7 +75505,7 @@
              sodipodi:cy="-32.5"
              sodipodi:rx="4.5"
              sodipodi:ry="4.5"
-             d="m 54,-32.5 a 4.5,4.5 0 0 1 -4.509724,4.499989"
+             d="m 54,-32.5 c 0,2.485281 -2.014719,4.5 -4.5,4.5 -0.0032,0 -0.0065,-4e-6 -0.0097,-1.1e-5"
              transform="matrix(-2.587958,0,0,-2.597682,100.48861,-75.018268)"
              sodipodi:start="0"
              sodipodi:end="1.5729572"
@@ -71885,7 +76078,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -71899,7 +76092,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -71989,7 +76182,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -72025,7 +76218,7 @@
                inkscape:export-ydpi="90"
                inkscape:export-xdpi="90"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-               d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
                sodipodi:ry="8"
                sodipodi:rx="8"
                sodipodi:cy="118"
@@ -72051,7 +76244,7 @@
                sodipodi:cy="118"
                sodipodi:rx="8"
                sodipodi:ry="8"
-               d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
                inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
                inkscape:export-xdpi="90"
                inkscape:export-ydpi="90" />
@@ -72231,7 +76424,7 @@
         </g>
         <path
            transform="matrix(1.4399775,0,0,1.4399775,-171.50748,-44.947546)"
-           d="m 388.20316,122.5078 a 0.70312506,0.71093756 0 1 1 -1.40625,0 0.70312506,0.71093756 0 1 1 1.40625,0 z"
+           d="m 388.20316,122.5078 c 0,0.39264 -0.3148,0.71093 -0.70313,0.71093 -0.38832,0 -0.70312,-0.31829 -0.70312,-0.71093 0,-0.39264 0.3148,-0.71094 0.70312,-0.71094 0.38833,0 0.70313,0.3183 0.70313,0.71094 z"
            sodipodi:ry="0.71093756"
            sodipodi:rx="0.70312506"
            sodipodi:cy="122.5078"
@@ -72289,7 +76482,7 @@
           </g>
           <path
              transform="matrix(1.4399775,0,0,1.4399775,-171.50748,-44.947546)"
-             d="m 388.20316,122.5078 a 0.70312506,0.71093756 0 1 1 -1.40625,0 0.70312506,0.71093756 0 1 1 1.40625,0 z"
+             d="m 388.20316,122.5078 c 0,0.39264 -0.3148,0.71093 -0.70313,0.71093 -0.38832,0 -0.70312,-0.31829 -0.70312,-0.71093 0,-0.39264 0.3148,-0.71094 0.70312,-0.71094 0.38833,0 0.70313,0.3183 0.70313,0.71094 z"
              sodipodi:ry="0.71093756"
              sodipodi:rx="0.70312506"
              sodipodi:cy="122.5078"
@@ -72367,7 +76560,7 @@
            sodipodi:cy="122.5078"
            sodipodi:rx="0.70312506"
            sodipodi:ry="0.71093756"
-           d="m 388.20316,122.5078 a 0.70312506,0.71093756 0 1 1 -1.40625,0 0.70312506,0.71093756 0 1 1 1.40625,0 z"
+           d="m 388.20316,122.5078 c 0,0.39264 -0.3148,0.71093 -0.70313,0.71093 -0.38832,0 -0.70312,-0.31829 -0.70312,-0.71093 0,-0.39264 0.3148,-0.71094 0.70312,-0.71094 0.38833,0 0.70313,0.3183 0.70313,0.71094 z"
            transform="matrix(1.4399775,0,0,1.4399775,-171.50748,-44.947546)" />
       </g>
       <path
@@ -72412,7 +76605,7 @@
                sodipodi:cy="122.5078"
                sodipodi:rx="0.70312506"
                sodipodi:ry="0.71093756"
-               d="m 388.20316,122.5078 a 0.70312506,0.71093756 0 1 1 -1.40625,0 0.70312506,0.71093756 0 1 1 1.40625,0 z"
+               d="m 388.20316,122.5078 c 0,0.39264 -0.3148,0.71093 -0.70313,0.71093 -0.38832,0 -0.70312,-0.31829 -0.70312,-0.71093 0,-0.39264 0.3148,-0.71094 0.70312,-0.71094 0.38833,0 0.70313,0.3183 0.70313,0.71094 z"
                transform="matrix(1.7719122,0,0,1.7719122,-300.13217,-85.612134)" />
             <path
                sodipodi:nodetypes="czzzz"
@@ -72601,7 +76794,7 @@
              inkscape:connector-curvature="0" />
           <path
              transform="matrix(3.625,0,0,3.1690202,-67.8125,318.31703)"
-             d="m 14.5,57.5 a 1,1.0000004 0 1 1 -2,0 1,1.0000004 0 1 1 2,0 z"
+             d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
              sodipodi:ry="1.0000004"
              sodipodi:rx="1"
              sodipodi:cy="57.5"
@@ -72618,7 +76811,7 @@
         </g>
         <path
            transform="matrix(3.5999897,0,0,3.1249932,-67.499871,320.6879)"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="57.5"
@@ -72640,11 +76833,11 @@
            sodipodi:cy="57.5"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            transform="matrix(3.25,0,0,3.25,-62.875,313.125)" />
         <path
            transform="matrix(2,0,0,2,-46,385)"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="57.5"
@@ -72660,7 +76853,7 @@
            sodipodi:cy="57.5"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            transform="matrix(4.7519907,0,0,4.1435313,-83.051884,262.12196)" />
         <path
            sodipodi:nodetypes="cccccc"
@@ -72739,7 +76932,7 @@
              inkscape:connector-curvature="0" />
           <path
              transform="matrix(3.625,0,0,3.1690202,-67.8125,318.31703)"
-             d="m 14.5,57.5 a 1,1.0000004 0 1 1 -2,0 1,1.0000004 0 1 1 2,0 z"
+             d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
              sodipodi:ry="1.0000004"
              sodipodi:rx="1"
              sodipodi:cy="57.5"
@@ -72756,7 +76949,7 @@
         </g>
         <path
            transform="matrix(3.5999897,0,0,3.1249932,-67.499871,320.6879)"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="57.5"
@@ -72778,11 +76971,11 @@
            sodipodi:cy="57.5"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            transform="matrix(3.25,0,0,3.25,-62.875,313.125)" />
         <path
            transform="matrix(2,0,0,2,-46,385)"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            sodipodi:ry="1"
            sodipodi:rx="1"
            sodipodi:cy="57.5"
@@ -72798,7 +76991,7 @@
            sodipodi:cy="57.5"
            sodipodi:rx="1"
            sodipodi:ry="1"
-           d="m 14.5,57.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+           d="m 14.5,57.5 c 0,0.552285 -0.447715,1 -1,1 -0.552285,0 -1,-0.447715 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
            transform="matrix(4.7519907,0,0,4.1435313,-83.051884,262.12196)" />
         <path
            sodipodi:nodetypes="cccccc"
@@ -73235,7 +77428,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -73243,7 +77436,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -73257,7 +77450,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -73415,7 +77608,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -73423,7 +77616,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -73437,7 +77630,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -73571,7 +77764,7 @@
            sodipodi:cy="420.25"
            sodipodi:rx="2.5"
            sodipodi:ry="1.75"
-           d="m 751.5,420.25 a 2.5,1.75 0 1 1 -5,0 2.5,1.75 0 1 1 5,0 z"
+           d="m 751.5,420.25 c 0,0.9665 -1.11929,1.75 -2.5,1.75 -1.38071,0 -2.5,-0.7835 -2.5,-1.75 0,-0.9665 1.11929,-1.75 2.5,-1.75 1.38071,0 2.5,0.7835 2.5,1.75 z"
            transform="matrix(1,0,0,0.8571429,-212,-302.2143)" />
         <rect
            style="fill:#66ff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
@@ -73861,7 +78054,7 @@
            sodipodi:cy="420.25"
            sodipodi:rx="2.5"
            sodipodi:ry="1.75"
-           d="m 751.5,420.25 a 2.5,1.75 0 1 1 -5,0 2.5,1.75 0 1 1 5,0 z"
+           d="m 751.5,420.25 c 0,0.9665 -1.11929,1.75 -2.5,1.75 -1.38071,0 -2.5,-0.7835 -2.5,-1.75 0,-0.9665 1.11929,-1.75 2.5,-1.75 1.38071,0 2.5,0.7835 2.5,1.75 z"
            transform="matrix(1,0,0,0.8571429,-212,-302.2143)" />
         <rect
            style="fill:#66ff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
@@ -74181,7 +78374,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74207,7 +78400,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90" />
@@ -74331,7 +78524,7 @@
     <g
        style="display:inline;enable-background:new"
        id="g36339-2"
-       transform="translate(62.95064,128.9792)">
+       transform="translate(63.000002,128.99999)">
       <rect
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          id="rect36341-7"
@@ -74347,7 +78540,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -74366,7 +78559,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74384,7 +78577,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74400,7 +78593,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74418,7 +78611,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74433,7 +78626,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74452,7 +78645,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74469,7 +78662,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -74477,7 +78670,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -74491,7 +78684,7 @@
     <g
        style="display:inline;enable-background:new"
        id="g36339-2-8"
-       transform="translate(83.95064,128.9792)">
+       transform="translate(84.000002,128.99999)">
       <rect
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          id="rect36341-7-6"
@@ -74507,7 +78700,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -74526,7 +78719,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74544,7 +78737,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74560,7 +78753,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74578,7 +78771,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74593,7 +78786,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74612,7 +78805,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74629,7 +78822,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -74637,7 +78830,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -74651,7 +78844,7 @@
     <g
        style="display:inline;enable-background:new"
        id="g36339-2-9"
-       transform="translate(104.94175,128.97922)">
+       transform="translate(104.99111,129.00001)">
       <rect
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          id="rect36341-7-4"
@@ -74667,7 +78860,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -74686,7 +78879,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74704,7 +78897,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74720,7 +78913,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74738,7 +78931,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74753,7 +78946,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              sodipodi:ry="8"
              sodipodi:rx="8"
              sodipodi:cy="118"
@@ -74772,7 +78965,7 @@
              sodipodi:cy="118"
              sodipodi:rx="8"
              sodipodi:ry="8"
-             d="m 132,110 a 8,8 0 0 1 6.9282,4 L 132,118 z"
+             d="m 132,110 c 2.85812,0 5.49914,1.52479 6.9282,4 L 132,118 z"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
              inkscape:export-xdpi="90"
              inkscape:export-ydpi="90"
@@ -74789,7 +78982,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -74797,7 +78990,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -74825,7 +79018,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -74833,7 +79026,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -74851,7 +79044,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -74864,7 +79057,7 @@
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -74872,7 +79065,7 @@
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
@@ -75991,7 +80184,7 @@
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
              transform="matrix(1.3333333,0,0,1.3333343,3,147.66665)"
-             d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+             d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
              sodipodi:ry="1.5"
              sodipodi:rx="1.5"
              sodipodi:cy="14.5"
@@ -76003,7 +80196,7 @@
              inkscape:export-ydpi="90"
              inkscape:export-xdpi="90"
              inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-             d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+             d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
              sodipodi:ry="1.5"
              sodipodi:rx="1.5"
              sodipodi:cy="14.5"
@@ -76190,7 +80383,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            transform="matrix(1.3333333,0,0,1.3333343,170.99998,105.66665)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -76204,7 +80397,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -76381,7 +80574,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            transform="matrix(1.3333333,0,0,1.3333343,209.98999,105.66665)"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -76395,7 +80588,7 @@
            sodipodi:cy="14.5"
            sodipodi:rx="1.5"
            sodipodi:ry="1.5"
-           d="m 72,14.5 a 1.5,1.5 0 1 1 -3,0 1.5,1.5 0 1 1 3,0 z"
+           d="M 72,14.5 C 72,15.328427 71.328427,16 70.5,16 69.671573,16 69,15.328427 69,14.5 69,13.671573 69.671573,13 70.5,13 c 0.828427,0 1.5,0.671573 1.5,1.5 z"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90" />
@@ -76479,33 +80672,234 @@
       </g>
     </g>
     <g
-       transform="translate(189,-229)"
-       id="g22900-8"
+       transform="translate(189,-229)"
+       id="g22900-8"
+       style="display:inline;enable-background:new">
+      <rect
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect22902-0"
+         width="16"
+         height="16"
+         x="257"
+         y="449" />
+      <g
+         transform="translate(14.081669,359)"
+         id="g22904-5"
+         style="opacity:0.6;stroke:#162d50">
+        <path
+           style="opacity:0.9;fill:none;stroke:#2d3239;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 253.41833,95.5 c 1.5,1.5 1.5,3.5 0,5"
+           id="path22906-2"
+           sodipodi:nodetypes="cc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
+        <path
+           style="opacity:0.9;fill:none;stroke:#2d3239;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 255.41833,93.5 c 2.75,2.75 2.75,6.25 0,9"
+           id="path22908-5"
+           sodipodi:nodetypes="cc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
+      </g>
+      <path
+         style="opacity:0.9;fill:none;stroke:#e4e9f0;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         d="m 267.5,454.5 c 1.5,1.5 1.5,3.5 0,5"
+         id="path22910-1"
+         sodipodi:nodetypes="cc"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
+      <path
+         sodipodi:nodetypes="ccccccccccccc"
+         style="fill:url(#linearGradient22933-6);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
+         d="m 264.58167,451.5 -1.08167,0 -3,3 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 c -0.554,0 -1,0.446 -1,1 l 0,5 c 0,0.554 0.446,1 1,1 l 1,0 c 0.554,0 1,-0.446 1,-1 l 3,3 1.08167,0 0,-11 z"
+         id="path22912-6"
+         inkscape:connector-curvature="0" />
+      <path
+         style="fill:none;stroke:url(#linearGradient22935-6);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
+         d="m 258.5,459.5 1,0 1,-1 3.25,3"
+         id="path22914-3"
+         sodipodi:nodetypes="cccc"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path22916-2"
+         d="m 260.5,454.5 0,4.9091"
+         style="opacity:0.5;fill:none;stroke:url(#linearGradient22937-4);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path22918-7"
+         d="m 258.5,455.5 1,0"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         sodipodi:nodetypes="cc"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
+      <path
+         sodipodi:nodetypes="cc"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         d="m 262.59506,453.5 1,-1"
+         id="path22920-0"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
+      <path
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         sodipodi:nodetypes="cc"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         d="m 258.5,454.63598 1,0"
+         id="path22922-0"
+         inkscape:connector-curvature="0" />
+      <path
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         id="path22924-2"
+         d="m 262.59506,454.5 1,-1"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         sodipodi:nodetypes="cc"
+         inkscape:connector-curvature="0" />
+      <path
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         sodipodi:nodetypes="cc"
+         id="path22926-3"
+         d="m 269.5,452.5 c 2.75,2.75 2.75,6.25 0,9"
+         style="opacity:0.9;fill:none;stroke:#e4e9f0;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         inkscape:connector-curvature="0" />
+      <path
+         style="fill:none;stroke:url(#linearGradient22939-8);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         d="m 263.5,452.5 0,9"
+         id="path22928-8"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path22931-5"
+         d="m 258.5,454.3 0,5.4"
+         style="fill:none;stroke:url(#linearGradient17039);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         inkscape:connector-curvature="0" />
+    </g>
+    <g
+       transform="translate(210,-229)"
+       id="g22900-8-5"
+       style="display:inline;enable-background:new">
+      <rect
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect22902-0-6"
+         width="16"
+         height="16"
+         x="257"
+         y="449" />
+      <g
+         transform="translate(14.081669,359)"
+         id="g22904-5-2"
+         style="opacity:0.6;stroke:#162d50" />
+      <path
+         sodipodi:nodetypes="ccccccccccccc"
+         style="fill:url(#linearGradient22933-6-8);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
+         d="m 264.58167,451.5 -1.08167,0 -3,3 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 c -0.554,0 -1,0.446 -1,1 l 0,5 c 0,0.554 0.446,1 1,1 l 1,0 c 0.554,0 1,-0.446 1,-1 l 3,3 1.08167,0 0,-11 z"
+         id="path22912-6-4"
+         inkscape:connector-curvature="0" />
+      <path
+         style="fill:none;stroke:url(#linearGradient22935-6-2);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
+         d="m 258.5,459.5 1,0 1,-1 3.25,3"
+         id="path22914-3-7"
+         sodipodi:nodetypes="cccc"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path22916-2-2"
+         d="m 260.5,454.5 0,4.9091"
+         style="opacity:0.5;fill:none;stroke:url(#linearGradient22937-4-1);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path22918-7-7"
+         d="m 258.5,455.5 1,0"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         sodipodi:nodetypes="cc"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
+      <path
+         sodipodi:nodetypes="cc"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         d="m 262.59506,453.5 1,-1"
+         id="path22920-0-4"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
+      <path
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         sodipodi:nodetypes="cc"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         d="m 258.5,454.63598 1,0"
+         id="path22922-0-2"
+         inkscape:connector-curvature="0" />
+      <path
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         id="path22924-2-7"
+         d="m 262.59506,454.5 1,-1"
+         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         sodipodi:nodetypes="cc"
+         inkscape:connector-curvature="0" />
+      <path
+         style="fill:none;stroke:url(#linearGradient22939-8-6);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         d="m 263.5,452.5 0,9"
+         id="path22928-8-6"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path22931-5-7"
+         d="m 258.5,454.3 0,5.4"
+         style="fill:none;stroke:url(#linearGradient17172);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         inkscape:connector-curvature="0" />
+    </g>
+    <g
+       transform="translate(-42,-40)"
+       id="g22900-8-3"
        style="display:inline;enable-background:new">
       <rect
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect22902-0"
+         id="rect22902-0-4"
          width="16"
          height="16"
          x="257"
          y="449" />
       <g
          transform="translate(14.081669,359)"
-         id="g22904-5"
+         id="g22904-5-8"
          style="opacity:0.6;stroke:#162d50">
         <path
-           style="opacity:0.9;fill:none;stroke:#2d3239;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           style="opacity:0.9;fill:none;stroke:#333333;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
            d="m 253.41833,95.5 c 1.5,1.5 1.5,3.5 0,5"
-           id="path22906-2"
+           id="path22906-2-2"
            sodipodi:nodetypes="cc"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
            inkscape:connector-curvature="0" />
         <path
-           style="opacity:0.9;fill:none;stroke:#2d3239;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           style="opacity:0.9;fill:none;stroke:#333333;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
            d="m 255.41833,93.5 c 2.75,2.75 2.75,6.25 0,9"
-           id="path22908-5"
+           id="path22908-5-8"
            sodipodi:nodetypes="cc"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
@@ -76513,9 +80907,9 @@
            inkscape:connector-curvature="0" />
       </g>
       <path
-         style="opacity:0.9;fill:none;stroke:#e4e9f0;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         style="opacity:0.9;fill:none;stroke:#eaeaea;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
          d="m 267.5,454.5 c 1.5,1.5 1.5,3.5 0,5"
-         id="path22910-1"
+         id="path22910-1-6"
          sodipodi:nodetypes="cc"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
@@ -76523,26 +80917,26 @@
          inkscape:connector-curvature="0" />
       <path
          sodipodi:nodetypes="ccccccccccccc"
-         style="fill:url(#linearGradient22933-6);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
+         style="opacity:0.8;fill:url(#linearGradient22933-6-87);fill-opacity:1;fill-rule:nonzero;stroke:#1a1a1a;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
          d="m 264.58167,451.5 -1.08167,0 -3,3 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 c -0.554,0 -1,0.446 -1,1 l 0,5 c 0,0.554 0.446,1 1,1 l 1,0 c 0.554,0 1,-0.446 1,-1 l 3,3 1.08167,0 0,-11 z"
-         id="path22912-6"
+         id="path22912-6-9"
          inkscape:connector-curvature="0" />
       <path
-         style="fill:none;stroke:url(#linearGradient22935-6);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
+         style="fill:none;stroke:url(#linearGradient22935-6-22);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
          d="m 258.5,459.5 1,0 1,-1 3.25,3"
-         id="path22914-3"
+         id="path22914-3-3"
          sodipodi:nodetypes="cccc"
          inkscape:connector-curvature="0" />
       <path
-         id="path22916-2"
+         id="path22916-2-6"
          d="m 260.5,454.5 0,4.9091"
-         style="opacity:0.5;fill:none;stroke:url(#linearGradient22937-4);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         style="opacity:0.5;fill:none;stroke:url(#linearGradient22937-4-8);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90"
          inkscape:connector-curvature="0" />
       <path
-         id="path22918-7"
+         id="path22918-7-5"
          d="m 258.5,455.5 1,0"
          style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
          sodipodi:nodetypes="cc"
@@ -76554,7 +80948,7 @@
          sodipodi:nodetypes="cc"
          style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
          d="m 262.59506,453.5 1,-1"
-         id="path22920-0"
+         id="path22920-0-8"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
          inkscape:export-ydpi="90"
@@ -76566,13 +80960,13 @@
          sodipodi:nodetypes="cc"
          style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
          d="m 258.5,454.63598 1,0"
-         id="path22922-0"
+         id="path22922-0-0"
          inkscape:connector-curvature="0" />
       <path
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         id="path22924-2"
+         id="path22924-2-2"
          d="m 262.59506,454.5 1,-1"
          style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
          sodipodi:nodetypes="cc"
@@ -76582,2114 +80976,3770 @@
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
          sodipodi:nodetypes="cc"
-         id="path22926-3"
+         id="path22926-3-1"
          d="m 269.5,452.5 c 2.75,2.75 2.75,6.25 0,9"
-         style="opacity:0.9;fill:none;stroke:#e4e9f0;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         style="opacity:0.9;fill:none;stroke:#eaeaea;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
          inkscape:connector-curvature="0" />
       <path
-         style="fill:none;stroke:url(#linearGradient22939-8);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         style="fill:none;stroke:url(#linearGradient22939-8-3);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
          d="m 263.5,452.5 0,9"
-         id="path22928-8"
+         id="path22928-8-5"
          inkscape:connector-curvature="0" />
       <path
-         id="path22931-5"
+         id="path22931-5-2"
          d="m 258.5,454.3 0,5.4"
-         style="fill:none;stroke:url(#linearGradient17039);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         style="fill:none;stroke:url(#linearGradient17172-9);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
          inkscape:connector-curvature="0" />
     </g>
     <g
-       transform="translate(210,-229)"
-       id="g22900-8-5"
-       style="display:inline;enable-background:new">
+       style="display:inline;enable-background:new"
+       id="g17563">
       <rect
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect22902-0-6"
+         id="rect22902-0-2"
          width="16"
          height="16"
-         x="257"
-         y="449" />
+         x="215"
+         y="430" />
       <g
-         transform="translate(14.081669,359)"
-         id="g22904-5-2"
-         style="opacity:0.6;stroke:#162d50" />
-      <path
-         sodipodi:nodetypes="ccccccccccccc"
-         style="fill:url(#linearGradient22933-6-8);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
-         d="m 264.58167,451.5 -1.08167,0 -3,3 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 c -0.554,0 -1,0.446 -1,1 l 0,5 c 0,0.554 0.446,1 1,1 l 1,0 c 0.554,0 1,-0.446 1,-1 l 3,3 1.08167,0 0,-11 z"
-         id="path22912-6-4"
-         inkscape:connector-curvature="0" />
-      <path
-         style="fill:none;stroke:url(#linearGradient22935-6-2);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
-         d="m 258.5,459.5 1,0 1,-1 3.25,3"
-         id="path22914-3-7"
-         sodipodi:nodetypes="cccc"
-         inkscape:connector-curvature="0" />
-      <path
-         id="path22916-2-2"
-         d="m 260.5,454.5 0,4.9091"
-         style="opacity:0.5;fill:none;stroke:url(#linearGradient22937-4-1);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
+         id="g17546">
+        <path
+           style="opacity:0.6;fill:none;stroke:#643200;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           d="m 227.5,433.5 c 2.75,2.75 2.75,6.25 0,9"
+           id="path22908-5-0-4"
+           sodipodi:nodetypes="cc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
+        <path
+           style="opacity:0.6;fill:none;stroke:#633300;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           d="m 225.5,435.5 c 1.5,1.5 1.5,3.5 0,5"
+           id="path22906-2-9-6"
+           sodipodi:nodetypes="cc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
+        <path
+           inkscape:connector-curvature="0"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:nodetypes="cc"
+           id="path22910-1-4"
+           d="m 225.5,435.5 c 1.5,1.5 1.5,3.5 0,5"
+           style="opacity:0.9;fill:none;stroke:url(#linearGradient17582);stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path22912-6-7"
+           d="m 222.58167,432.5 -1.08167,0 -3,3 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 c -0.554,0 -1,0.446 -1,1 l 0,5 c 0,0.554 0.446,1 1,1 l 1,0 c 0.554,0 1,-0.446 1,-1 l 3,3 1.08167,0 0,-11 z"
+           style="fill:url(#linearGradient17584);fill-opacity:1;fill-rule:nonzero;stroke:#2b1600;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.84313725;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
+           sodipodi:nodetypes="ccccccccccccc" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cccc"
+           id="path22914-3-6"
+           d="m 216.5,440.5 1,0 1,-1 3.25,3"
+           style="fill:none;stroke:url(#linearGradient17586);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+        <path
+           inkscape:connector-curvature="0"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           style="opacity:0.65263157;fill:none;stroke:url(#linearGradient17588);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 218.5,435.5 0,4.9091"
+           id="path22916-2-0" />
+        <path
+           inkscape:connector-curvature="0"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:nodetypes="cc"
+           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+           d="m 216.5,436.5 1,0"
+           id="path22918-7-2" />
+        <path
+           inkscape:connector-curvature="0"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           id="path22920-0-2"
+           d="m 220.59506,434.5 1,-1"
+           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+           sodipodi:nodetypes="cc" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path22922-0-22"
+           d="m 216.5,435.63598 1,0"
+           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+           sodipodi:nodetypes="cc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cc"
+           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+           d="m 220.59506,435.5 1,-1"
+           id="path22924-2-9"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+        <path
+           inkscape:connector-curvature="0"
+           style="opacity:0.9;fill:none;stroke:url(#linearGradient17590);stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 227.5,433.5 c 2.75,2.75 2.75,6.25 0,9"
+           id="path22926-3-9"
+           sodipodi:nodetypes="cc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path22928-8-7"
+           d="m 221.5,433.5 0,9"
+           style="fill:none;stroke:url(#linearGradient17592);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           inkscape:connector-curvature="0"
+           style="fill:none;stroke:url(#linearGradient17594);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+           d="m 216.5,435.3 0,5.4"
+           id="path22931-5-72" />
+        <path
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:nodetypes="cc"
+           style="opacity:0.6;fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
+           d="m 225.37642,435.40307 0.60225,0.61872"
+           id="path22922-0-22-4"
+           inkscape:connector-curvature="0" />
+        <path
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:nodetypes="cc"
+           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
+           d="m 227.40936,433.37013 0.51386,0.59663"
+           id="path22922-0-22-2"
+           inkscape:connector-curvature="0" />
+      </g>
+    </g>
+    <rect
+       y="597"
+       x="383"
+       height="16"
+       width="16"
+       id="rect18740-5"
+       style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    <g
+       transform="matrix(0.78985507,0,0,0.78985507,384.77042,545.63116)"
+       id="g18742-8"
+       style="display:inline;enable-background:new">
+      <rect
+         y="70.999992"
+         x="4.9838772"
+         height="9.0000172"
+         width="11.999999"
+         id="rect38458-5"
+         style="opacity:0.7;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9999994px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <path
-         id="path22918-7-7"
-         d="m 258.5,455.5 1,0"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-         sodipodi:nodetypes="cc"
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="cccccccccc"
+         style="fill:url(#linearGradient17715);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.01284409;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         d="m 17.209985,82.052175 -1.174018,1.202898 -10.0887566,0 -1.2028894,-1.202898 -1e-7,-12.622124 12.4766491,0 -0.01099,12.622124 -5e-6,0 0,0 z"
+         id="path18744-0"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
+         inkscape:export-ydpi="90" />
       <path
-         sodipodi:nodetypes="cc"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-         d="m 262.59506,453.5 1,-1"
-         id="path22920-0-4"
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="ccccc"
+         style="fill:#666666;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9999994px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         d="m 15.536259,81.328571 -6.3832127,2e-6 0,-0.999998 6.3832127,-2e-6 0,0.999998 z"
+         id="path18746-7"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
          inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
+         inkscape:export-ydpi="90" />
       <path
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="ccccc"
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         sodipodi:nodetypes="cc"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-         d="m 258.5,454.63598 1,0"
-         id="path22922-0-2"
-         inkscape:connector-curvature="0" />
-      <path
+         id="path18748-3"
+         d="m 5.9039809,82.132474 0.025569,-11.527305 10.1868001,5.7e-5 0,11.527247 z"
+         style="fill:none;stroke:url(#linearGradient17717);stroke-width:1.26605475px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+      <rect
          inkscape:export-ydpi="90"
          inkscape:export-xdpi="90"
          inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         id="path22924-2-7"
-         d="m 262.59506,454.5 1,-1"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+         y="80.356544"
+         x="6.7951851"
+         height="1"
+         width="1"
+         id="rect18750-1"
+         style="fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    </g>
+    <g
+       style="display:inline;enable-background:new"
+       id="g43488-2-2"
+       transform="matrix(0,-0.75485957,0.75485957,0,327.67313,852.33908)">
+      <path
+         inkscape:connector-curvature="0"
+         style="fill:none;stroke:#000000;stroke-width:3.57682419;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         d="M 326.98536,85.889717 327,76"
+         id="path43490-2-2"
+         sodipodi:nodetypes="cc" />
+      <path
+         inkscape:connector-curvature="0"
+         style="fill:none;stroke:#000000;stroke-width:3.57682419;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         d="m 330.97424,79.255626 -3.97425,-3.974249 -3.97424,3.974249"
+         id="path43492-1-0"
+         sodipodi:nodetypes="ccc" />
+    </g>
+    <g
+       style="display:inline;enable-background:new"
+       id="g43494-2-5"
+       transform="matrix(0,-0.75485957,0.75485957,0,327.67313,852.33908)">
+      <path
+         inkscape:connector-curvature="0"
          sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0" />
+         id="path43496-7-5"
+         d="M 327,85.889717 327,76"
+         style="fill:none;stroke:#ebebeb;stroke-width:1.72217464;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <path
-         style="fill:none;stroke:url(#linearGradient22939-8-6);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-         d="m 263.5,452.5 0,9"
-         id="path22928-8-6"
-         inkscape:connector-curvature="0" />
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="ccc"
+         id="path43498-9-6"
+         d="m 330.97424,79.255626 -3.97425,-3.974249 -3.97424,3.974249"
+         style="fill:none;stroke:#ebebeb;stroke-width:1.72217464;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <path
-         id="path22931-5-7"
-         d="m 258.5,454.3 0,5.4"
-         style="fill:none;stroke:url(#linearGradient17172);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         style="fill:none;stroke:#ffffff;stroke-width:1.32474971;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         d="m 330.97424,79.255626 -2.24089,-2.206598"
+         id="path17874"
+         sodipodi:nodetypes="cc"
          inkscape:connector-curvature="0" />
     </g>
     <g
-       transform="translate(-42,-40)"
-       id="g22900-8-3"
-       style="display:inline;enable-background:new">
+       style="display:inline;enable-background:new"
+       id="g17941">
+      <rect
+         transform="scale(-1,1)"
+         y="220.00047"
+         x="-546"
+         height="16"
+         width="16"
+         id="rect14357-6"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         id="g17935">
+        <rect
+           style="fill:#ec0606;fill-opacity:1;fill-rule:nonzero;stroke:#910000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect43394-5-7"
+           width="6"
+           height="2"
+           x="540.12811"
+           y="231.61429"
+           rx="0.79505396"
+           ry="0.79505396" />
+        <path
+           sodipodi:nodetypes="czszcccc"
+           id="path14368-1"
+           style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;display:inline"
+           d="m 542.6613,230.54031 -4.34213,0.008 c -5.18824,0.0101 -5.3353,-2.04831 -3.33529,-4.04831 0.96487,-0.96488 3.61611,-2.89515 -1.50001,-5 m 6.83689,6.08925 2.34054,2.95106 m -2.32899,2.96017 2.32899,-2.96017"
+           inkscape:connector-curvature="0" />
+        <path
+           d="m 542.6613,230.54031 -4.34213,0.008 c -5.18824,0.0106 -5.3353,-2.04783 -3.33529,-4.04783 0.96487,-0.96488 3.83708,-2.76256 -1.50001,-5 m 6.83689,6.08877 2.34054,2.95106 m -2.32899,2.96017 2.32899,-2.96017"
+           style="fill:none;stroke:url(#linearGradient17932);stroke-width:1.50000143;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:7.40000034;display:inline"
+           id="path14375-4"
+           sodipodi:nodetypes="czszcccc"
+           inkscape:connector-curvature="0" />
+        <rect
+           ry="0.79505396"
+           rx="0.79505396"
+           y="220.375"
+           x="530.3125"
+           height="2"
+           width="6"
+           id="rect43396-5-4"
+           style="fill:#6996d7;fill-opacity:1;fill-rule:nonzero;stroke:#143564;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      </g>
+    </g>
+    <g
+       id="g20086">
+      <rect
+         y="598"
+         x="299"
+         height="16"
+         width="16"
+         id="rect25569-8"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         transform="translate(1.1,-0.09992002)"
+         id="g20068">
+        <rect
+           y="605.5"
+           x="-312.5"
+           height="7.0000267"
+           width="10"
+           id="rect15044-4"
+           style="fill:url(#linearGradient20080);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           transform="scale(-1,1)" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path15046-4"
+           style="fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           d="m 304.49848,605.5625 0,-2 c 0,-2 -0.62933,-3 -2.51731,-3.00008 -1.2779,5e-5 -2.17039,0.23501 -2.53494,1.78073"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           sodipodi:nodetypes="cccc" />
+        <path
+           inkscape:connector-curvature="0"
+           style="fill:none;stroke:url(#linearGradient20199);stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           d="m 304.49848,605.5625 0,-2.25 c 0,-1.75 -0.62933,-2.75 -2.51734,-2.75008 -1.27677,5e-5 -2.05659,0.20629 -2.29807,1.20103"
+           id="path15049-9"
+           sodipodi:nodetypes="cscc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+        <rect
+           ry="0"
+           rx="0"
+           y="606.5"
+           x="303.5"
+           height="5"
+           width="8"
+           id="rect15051-2"
+           style="fill:none;stroke:url(#linearGradient20084);stroke-width:1.00000024;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path19016-6"
+           d="m 304,607.5 7.5,0"
+           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           inkscape:connector-curvature="0"
+           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+           d="m 304,609.5 7.5,0"
+           id="path19018-0" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path19020-2"
+           d="m 304,611.5 7.5,0"
+           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+        <rect
+           style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect36041-6"
+           width="1"
+           height="2.0000124"
+           x="307"
+           y="608" />
+        <rect
+           y="608"
+           x="307"
+           height="0.99994379"
+           width="0.99998754"
+           id="rect36043-2"
+           style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <path
+           style="opacity:0.7;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 308,608 0,2 -1,0 0,1 1,0 1,0 0,-1 0,-2 -1,0 z"
+           id="path36045-7"
+           inkscape:connector-curvature="0" />
+      </g>
+    </g>
+    <g
+       transform="translate(21,0)"
+       style="display:inline;enable-background:new"
+       id="g20086-7">
+      <rect
+         y="598"
+         x="299"
+         height="16"
+         width="16"
+         id="rect25569-8-3"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         transform="translate(1.1,-0.09992002)"
+         id="g20068-2">
+        <rect
+           y="605.5"
+           x="-312.5"
+           height="7.0000267"
+           width="10"
+           id="rect15044-4-1"
+           style="fill:url(#linearGradient20080-5);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           transform="scale(-1,1)" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path15046-4-9"
+           style="fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           d="m 310.5,605.5 0,-2 c 0,-2 -0.75,-3 -3,-3.00008 -2.25,8e-5 -3,1.00008 -3,3.00008 l 0,2"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           sodipodi:nodetypes="ccccc" />
+        <path
+           inkscape:connector-curvature="0"
+           style="fill:none;stroke:url(#linearGradient20082-4);stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           d="m 310.5,605.5 c 0,0 0,-2.25 0,-2.25 0,-1.75 -0.75,-2.75 -3.00003,-2.75008 C 305.25,600.5 304.5,601.5 304.5,603.25 l 0,2.25005"
+           id="path15049-9-8"
+           sodipodi:nodetypes="csccc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+        <rect
+           ry="0"
+           rx="0"
+           y="606.5"
+           x="303.5"
+           height="5"
+           width="8"
+           id="rect15051-2-5"
+           style="fill:none;stroke:url(#linearGradient20084-9);stroke-width:1.00000024;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path19016-6-0"
+           d="m 304,607.5 7.5,0"
+           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           inkscape:connector-curvature="0"
+           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+           d="m 304,609.5 7.5,0"
+           id="path19018-0-2" />
+        <path
+           inkscape:connector-curvature="0"
+           id="path19020-2-9"
+           d="m 304,611.5 7.5,0"
+           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+        <rect
+           style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect36041-6-4"
+           width="1"
+           height="2.0000124"
+           x="307"
+           y="608" />
+        <rect
+           y="608"
+           x="307"
+           height="0.99994379"
+           width="0.99998754"
+           id="rect36043-2-8"
+           style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <path
+           style="opacity:0.7;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 308,608 0,2 -1,0 0,1 1,0 1,0 0,-1 0,-2 -1,0 z"
+           id="path36045-7-1"
+           inkscape:connector-curvature="0" />
+      </g>
+    </g>
+    <g
+       transform="translate(-105.02687,272.93951)"
+       style="display:inline;enable-background:new"
+       id="g17107">
       <rect
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect22902-0-4"
+         id="rect18696-0-4-1"
          width="16"
          height="16"
-         x="257"
-         y="449" />
+         x="299"
+         y="325" />
       <g
-         transform="translate(14.081669,359)"
-         id="g22904-5-8"
-         style="opacity:0.6;stroke:#162d50">
+         id="g17099">
         <path
-           style="opacity:0.9;fill:none;stroke:#333333;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 253.41833,95.5 c 1.5,1.5 1.5,3.5 0,5"
-           id="path22906-2-2"
+           style="fill:url(#linearGradient16783-1-6-0-2);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;enable-background:new"
+           d="M 309.7702,332.24765 304.5,337.5 l -1,0 -1,1 -1,0 0,-1 1,-1 0,-1 5.2702,-5.25235 z"
+           id="path18700-1-3-9"
+           sodipodi:nodetypes="cccccccccc"
+           inkscape:connector-curvature="0" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cccccccccc"
+           id="path17007-7"
+           d="M 309.7702,332.24765 304.5,337.5 l -1,0 -1,1 -1,0 0,-1 1,-1 0,-1 5.2702,-5.25235 z"
+           style="fill:none;stroke:#000000;stroke-width:0.69999999;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+        <path
+           sodipodi:nodetypes="ccszsccc"
+           id="path18711-5-8-1"
+           d="m 310.5,333.5 0,-2.75 c 1.1224,0 1.75,0 2.5,-0.75 0.75,-0.75 0.75,-2.25 0,-3 -0.75,-0.75 -2.25,-0.75 -3,0 -0.75,0.75 -0.75,1.49506 -0.75,2.5 l -2.75,0 4,4 z"
+           style="fill:#1a1a1a;fill-opacity:1;fill-rule:evenodd;stroke:#1a1a1a;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
+           inkscape:connector-curvature="0" />
+        <path
+           inkscape:transform-center-x="-1.4435745"
+           inkscape:transform-center-y="-1.4192649"
+           style="fill:url(#linearGradient16778-3-5-3-2);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;enable-background:new"
+           d="m 309.22323,329.79745 c -0.11594,-0.12547 0.0486,-1.2642 0.81343,-2.11918 1.04731,-1.1688 1.89745,-0.8692 1.99021,-0.61778 1.02063,2.76644 -1.73024,3.89859 -2.80364,2.73696 z"
+           id="path18713-4-2-0"
+           sodipodi:nodetypes="csss"
+           inkscape:connector-curvature="0" />
+        <path
+           sodipodi:nodetypes="ccc"
+           id="path18715-9-8-1"
+           d="m 308.26612,330.5 c 0,0 0.25,0 0.25,0 l 0,-1"
+           style="opacity:0.98000004;fill:none;stroke:url(#linearGradient16775-4-9-5-6);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           d="m 303.25,335.75 4.17237,-4.0625"
+           id="path18705-8-4-0"
            sodipodi:nodetypes="cc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
            inkscape:connector-curvature="0" />
+      </g>
+    </g>
+    <g
+       transform="translate(-42,231)"
+       style="display:inline;enable-background:new"
+       id="g17942-1">
+      <rect
+         y="304"
+         x="278"
+         height="16"
+         width="16"
+         id="rect22048-0-1-2"
+         style="opacity:0.01000001;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         id="g17930-6">
+        <rect
+           y="305.5"
+           x="281.5"
+           height="6.0211244"
+           width="9.0000076"
+           id="rect22050-0-1-6"
+           style="opacity:0.6;fill:#ffd6aa;fill-opacity:1;fill-rule:evenodd;stroke:#2b1600;stroke-width:0.40000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
-           style="opacity:0.9;fill:none;stroke:#333333;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 255.41833,93.5 c 2.75,2.75 2.75,6.25 0,9"
-           id="path22908-5-8"
+           sodipodi:nodetypes="ccccc"
+           id="path22056-3-7-1"
+           d="m 282.5,316.5 3,3 3,-3 -3,-3 -3,3 z"
+           style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 282.75,316.5 2.75,2.75 2.75,-2.75 -2.75,-2.75 -2.75,2.75 z"
+           id="path22058-8-8-7"
+           sodipodi:nodetypes="ccccc"
+           inkscape:connector-curvature="0" />
+        <path
+           id="path22060-3-9-9"
+           d="m 283.5,316.5 2,-2 2,2 -2,2 -2,-2 z"
+           style="fill:none;stroke:url(#linearGradient18148);stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
            sodipodi:nodetypes="cc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
            inkscape:connector-curvature="0" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path22157-2-9-1"
+           d="m 287.75,308.25 0,0.5 2.5,2.5 0.5,0 2.5,-2.5 0,-0.5 -2.5,-2.5 -0.5,0 -2.5,2.5 z"
+           style="fill:none;stroke:#552c00;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:#e98316;fill-opacity:1;fill-rule:evenodd;stroke:none"
+           d="m 288,308.5 2.5,2.5 2.5,-2.5 -2.5,-2.5 -2.5,2.5 z"
+           id="path22159-1-9-5"
+           sodipodi:nodetypes="ccccc"
+           inkscape:connector-curvature="0" />
+        <path
+           id="path22161-4-8-9"
+           d="M 288.64504,308.5 290.5,306.66161 292.35496,308.5 290.5,310.36049 z"
+           style="fill:none;stroke:url(#linearGradient17904-1);stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           sodipodi:nodetypes="ccccc"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 278.75,308.25 0,0.5 2.5,2.5 0.5,0 2.5,-2.5 0,-0.5 -2.5,-2.5 -0.5,0 -2.5,2.5 z"
+           id="path22208-0-8-1"
+           sodipodi:nodetypes="ccccccccc"
+           inkscape:connector-curvature="0" />
+        <path
+           sodipodi:nodetypes="ccccc"
+           id="path22212-5-4-4"
+           d="m 279,308.5 2.5,2.5 2.5,-2.5 -2.5,-2.5 z"
+           style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           inkscape:connector-curvature="0" />
+        <path
+           sodipodi:nodetypes="ccccc"
+           style="fill:none;stroke:url(#linearGradient17893-5);stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="M 279.64062,308.5 281.5,306.66406 283.35547,308.5 281.5,310.375 z"
+           id="path22214-3-8-8"
+           inkscape:connector-curvature="0" />
+      </g>
+    </g>
+    <g
+       id="g16806">
+      <rect
+         y="472"
+         x="257"
+         height="16"
+         width="16"
+         id="rect35680"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         inkscape:transform-center-y="2.2787562"
+         inkscape:transform-center-x="-0.78726"
+         id="g35844"
+         transform="translate(-186,256.02369)"
+         style="opacity:0.9;display:inline;enable-background:new">
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="ccc"
+           id="path35846"
+           d="m 454.5,218.5 c -1.25,-1.5 -2.5,-1.5 -4,1 -1.5,-2.5 -2.75,-2.5 -4,-1"
+           style="opacity:0.85;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           inkscape:connector-curvature="0"
+           style="fill:none;stroke:#f2f2f2;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 454.5,218.5 c -1.25,-1.5 -2.5,-1.5 -4,1 -1.5,-2.5 -2.75,-2.5 -4,-1"
+           id="path35848"
+           sodipodi:nodetypes="ccc" />
       </g>
       <path
-         style="opacity:0.9;fill:none;stroke:#eaeaea;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         d="m 267.5,454.5 c 1.5,1.5 1.5,3.5 0,5"
-         id="path22910-1-6"
-         sodipodi:nodetypes="cc"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
+         sodipodi:nodetypes="ccccc"
+         id="path35862"
+         d="m 264.5,485.5 -1,-1 -2,2 -2,-2 -1,1.02369"
+         style="opacity:0.76499999;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
          inkscape:connector-curvature="0" />
       <path
-         sodipodi:nodetypes="ccccccccccccc"
-         style="opacity:0.8;fill:url(#linearGradient22933-6-87);fill-opacity:1;fill-rule:nonzero;stroke:#1a1a1a;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
-         d="m 264.58167,451.5 -1.08167,0 -3,3 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 c -0.554,0 -1,0.446 -1,1 l 0,5 c 0,0.554 0.446,1 1,1 l 1,0 c 0.554,0 1,-0.446 1,-1 l 3,3 1.08167,0 0,-11 z"
-         id="path22912-6-9"
+         style="fill:none;stroke:#ffffff;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         d="m 264.5,485.5 -1,-1 -2,2 -2,-2 -1,1.02369"
+         id="path35864"
+         sodipodi:nodetypes="ccccc"
          inkscape:connector-curvature="0" />
+      <g
+         transform="translate(-21,21)"
+         id="g38276">
+        <path
+           inkscape:connector-curvature="0"
+           style="opacity:0.85;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 292.5,459.5 c -1.25,-1.5 -3.5,-1.5 -5,1 -1.5,-2.5 -3.75,-2.5 -5,-1"
+           id="path35702"
+           sodipodi:nodetypes="ccc" />
+        <path
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="ccc"
+           id="path35704"
+           d="m 292.5,459.5 c -1.25,-1.5 -3.5,-1.5 -5,1 -1.5,-2.5 -3.75,-2.5 -5,-1"
+           style="fill:none;stroke:#ececec;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+      </g>
       <path
-         style="fill:none;stroke:url(#linearGradient22935-6-22);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
-         d="m 258.5,459.5 1,0 1,-1 3.25,3"
-         id="path22914-3-3"
          sodipodi:nodetypes="cccc"
-         inkscape:connector-curvature="0" />
-      <path
-         id="path22916-2-6"
-         d="m 260.5,454.5 0,4.9091"
-         style="opacity:0.5;fill:none;stroke:url(#linearGradient22937-4-8);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
+         inkscape:connector-curvature="0"
+         d="m 266.53125,480.65625 -0.0312,0.9375 m -0.85937,-1.07813 c 0.49634,0.0684 0.8328,0.24341 1.79687,0"
+         style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+         id="path16745" />
       <path
-         id="path22918-7-5"
-         d="m 258.5,455.5 1,0"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-         sodipodi:nodetypes="cc"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
+         sodipodi:nodetypes="cccc"
+         inkscape:connector-curvature="0"
+         d="m 264.46875,474.79687 -0.0312,0.9375 m -0.85937,-1.07813 c 0.49634,0.0684 0.8328,0.24341 1.79687,0"
+         style="fill:none;stroke:#f0f0f0;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline;enable-background:new"
+         id="path16745-9" />
+    </g>
+    <g
+       id="g37076-6-0-2"
+       style="opacity:0.96000001;stroke:#1a1a1a;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;display:inline;enable-background:new"
+       transform="translate(127.00485,107.03779)" />
+    <g
+       style="opacity:0.96000001;stroke:#c8c8c8;stroke-opacity:1;display:inline;enable-background:new"
+       id="g37094-7-8-1"
+       transform="translate(190.00485,-60.962214)">
+      <g
+         transform="translate(-63.000001,168)"
+         id="g37096-1-5-3"
+         style="stroke:#c8c8c8;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+      <g
+         id="g37104-2-9-1"
+         transform="matrix(0,1,-1,0,511,255)"
+         style="stroke:#c8c8c8;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+    <g
+       transform="translate(105,0)"
+       style="opacity:0.3;display:inline;enable-background:new"
+       id="g17847-0">
       <path
-         sodipodi:nodetypes="cc"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-         d="m 262.59506,453.5 1,-1"
-         id="path22920-0-8"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="cccccccc"
+         id="path45378-1-5-0"
+         d="m 367.75,440.75 1.75,-1.5 2.5,5.25 1.75,-1 -2.25,-5 2.5,0 -6.25,-6.25 z"
+         style="fill:url(#linearGradient17833-9);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <rect
+         y="430"
+         x="362"
+         height="16"
+         width="16"
+         id="rect45374-0-5-0"
+         style="opacity:0;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <path
-         inkscape:export-ydpi="90"
-         inkscape:export-xdpi="90"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         sodipodi:nodetypes="cc"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-         d="m 258.5,454.63598 1,0"
-         id="path22922-0-0"
-         inkscape:connector-curvature="0" />
+         sodipodi:nodetypes="cccccccc"
+         inkscape:connector-curvature="0"
+         id="path17835-6"
+         d="m 367.5,431.5 7,7.25 -3,0 2.5,4.75 -1.75,1 -2.5,-5 -2.25,2.25 z"
+         style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
       <path
-         inkscape:export-ydpi="90"
-         inkscape:export-xdpi="90"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         id="path22924-2-2"
-         d="m 262.59506,454.5 1,-1"
-         style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
          sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0" />
+         inkscape:connector-curvature="0"
+         id="path17845-4"
+         d="m 368.34375,433.75 0,5.75"
+         style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+    <g
+       transform="translate(84,0)"
+       style="display:inline;enable-background:new"
+       id="g17847-9">
       <path
-         inkscape:export-ydpi="90"
-         inkscape:export-xdpi="90"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         sodipodi:nodetypes="cc"
-         id="path22926-3-1"
-         d="m 269.5,452.5 c 2.75,2.75 2.75,6.25 0,9"
-         style="opacity:0.9;fill:none;stroke:#eaeaea;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         inkscape:connector-curvature="0" />
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="cccccccc"
+         id="path45378-1-5-6"
+         d="m 367.75,440.75 1.75,-1.5 2.5,5.25 1.75,-1 -2.25,-5 2.5,0 -6.25,-6.25 z"
+         style="fill:url(#linearGradient17833-8);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <rect
+         y="430"
+         x="362"
+         height="16"
+         width="16"
+         id="rect45374-0-5-6"
+         style="opacity:0;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <path
-         style="fill:none;stroke:url(#linearGradient22939-8-3);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-         d="m 263.5,452.5 0,9"
-         id="path22928-8-5"
-         inkscape:connector-curvature="0" />
+         sodipodi:nodetypes="cccccccc"
+         inkscape:connector-curvature="0"
+         id="path17835-7"
+         d="m 367.5,431.5 7,7.25 -3,0 2.5,4.75 -1.75,1 -2.5,-5 -2.25,2.25 z"
+         style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
       <path
-         id="path22931-5-2"
-         d="m 258.5,454.3 0,5.4"
-         style="fill:none;stroke:url(#linearGradient17172-9);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-         inkscape:connector-curvature="0" />
+         sodipodi:nodetypes="cc"
+         inkscape:connector-curvature="0"
+         id="path17845-9"
+         d="m 368.34375,433.75 0,5.75"
+         style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
     </g>
     <g
        style="display:inline;enable-background:new"
-       id="g17563">
+       id="g10534-1"
+       transform="translate(189.0161,-397)">
       <rect
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect22902-0-2"
+         y="428"
+         x="193.9839"
+         height="16"
          width="16"
+         id="rect20642-6"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         transform="translate(-29.016109,339.00751)"
+         id="g20606-2">
+        <g
+           transform="translate(-199.98388,-106)"
+           id="g10953-7">
+          <path
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+             sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccc"
+             style="fill:none;stroke:#000000;stroke-width:1.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+             d="m 429.9998,196.99249 0,1.625 c -0.53409,0.12195 -1.02562,0.33162 -1.46875,0.625 l -1.53125,-1.25 -1,1 1.25,1.53125 c -0.29338,0.44313 -0.50305,0.93466 -0.625,1.46875 l -1.625,0 0,2 1.625,0 c 0.12195,0.53409 0.33162,1.02562 0.625,1.46875 l -1.25,1.53125 1,1 1.53125,-1.25 c 0.44313,0.29338 0.93466,0.50305 1.46875,0.625 l 0,1.625 2,0 0,-1.625 c 0.53409,-0.12195 1.02562,-0.33162 1.46875,-0.625 l 1.53125,1.25 1,-1 -1.25,-1.53125 c 0.29338,-0.44313 0.50305,-0.93466 0.625,-1.46875 l 1.625,0 0,-2 -1.625,0 c -0.12195,-0.53409 -0.33162,-1.02562 -0.625,-1.46875 l 1.25,-1.53125 -1,-1 -1.53125,1.25 c -0.44313,-0.29338 -0.93466,-0.50305 -1.46875,-0.625 l 0,-1.625 -2,0 z m -1,4 4,0 0,4 -4,0 0,-4 z"
+             id="path10955-5"
+             inkscape:connector-curvature="0" />
+          <path
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+             sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccc"
+             id="path10957-4"
+             d="m 429.9998,196.99249 0,1.625 c -0.53409,0.12195 -1.02562,0.33162 -1.46875,0.625 l -1.53125,-1.25 -1,1 1.25,1.53125 c -0.29338,0.44313 -0.50305,0.93466 -0.625,1.46875 l -1.625,0 0,2 1.625,0 c 0.12195,0.53409 0.33162,1.02562 0.625,1.46875 l -1.25,1.53125 1,1 1.53125,-1.25 c 0.44313,0.29338 0.93466,0.50305 1.46875,0.625 l 0,1.625 2,0 0,-1.625 c 0.53409,-0.12195 1.02562,-0.33162 1.46875,-0.625 l 1.53125,1.25 1,-1 -1.25,-1.53125 c 0.29338,-0.44313 0.50305,-0.93466 0.625,-1.46875 l 1.625,0 0,-2 -1.625,0 c -0.12195,-0.53409 -0.33162,-1.02562 -0.625,-1.46875 l 1.5,-1.78125 -1,-1 -1.78125,1.5 c -0.44313,-0.29338 -0.93466,-0.50305 -1.46875,-0.625 l 0,-1.625 -2,0 z m -1,4 4,0 0,4 -4,0 0,-4 z"
+             style="fill:url(#linearGradient20796-9);fill-opacity:1;fill-rule:nonzero;stroke:none"
+             inkscape:connector-curvature="0" />
+          <path
+             d="m 434.9998,198.49249 -1.5,1.25 m -2,-2.25 -1,0 0,1.5 c -0.35104,0.0802 -1.01806,0.29269 -1.5172,0.50569 m -1.49,1.50752 c -0.20864,0.49552 -0.41426,1.14284 -0.4928,1.48679 l -1.5,0 0,1 m 1.5,-5 -0.5,0.5 m 1.25,6.5 -1.25,1.5 m 6.5,-5.5 0,3.5 -3.5,0 m -3,-6 0.5,-0.5 1.5,1.25"
+             style="fill:none;stroke:#f9f9f9;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
+             id="path10959-0"
+             inkscape:connector-curvature="0" />
+        </g>
+        <g
+           transform="translate(-199.98388,-106)"
+           id="g10961-1">
+          <rect
+             ry="0"
+             rx="0"
+             y="202.46629"
+             x="430.49979"
+             height="8.1236582"
+             width="7.0000763"
+             id="rect10963-2"
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90" />
+          <path
+             d="m 432.53795,204.5065 2.96201,0 m -2.96201,1.993 2.96201,0 m -2.96201,1.993 2.96201,0"
+             style="fill:none;stroke:#000000;stroke-width:0.99999988px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+             id="path10965-7"
+             sodipodi:nodetypes="cccccc"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90"
+             inkscape:connector-curvature="0" />
+          <rect
+             ry="0"
+             rx="0"
+             y="202.48912"
+             x="430.49661"
+             height="8.0067444"
+             width="7.0067482"
+             id="rect10967-1"
+             style="fill:none;stroke:url(#linearGradient20798-1);stroke-width:0.99325603;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90" />
+        </g>
+      </g>
+    </g>
+    <g
+       style="display:inline;enable-background:new"
+       id="g79830">
+      <rect
+         y="73"
+         x="467"
          height="16"
-         x="215"
-         y="430" />
+         width="16"
+         id="rect52984-1"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         id="g17546">
-        <path
-           style="opacity:0.6;fill:none;stroke:#643200;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 227.5,433.5 c 2.75,2.75 2.75,6.25 0,9"
-           id="path22908-5-0-4"
-           sodipodi:nodetypes="cc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
-           inkscape:connector-curvature="0" />
-        <path
-           style="opacity:0.6;fill:none;stroke:#633300;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 225.5,435.5 c 1.5,1.5 1.5,3.5 0,5"
-           id="path22906-2-9-6"
-           sodipodi:nodetypes="cc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
-           inkscape:connector-curvature="0" />
-        <path
-           inkscape:connector-curvature="0"
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           sodipodi:nodetypes="cc"
-           id="path22910-1-4"
-           d="m 225.5,435.5 c 1.5,1.5 1.5,3.5 0,5"
-           style="opacity:0.9;fill:none;stroke:url(#linearGradient17582);stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+         id="g79032">
+        <g
+           style="display:inline;enable-background:new"
+           id="g39239-9"
+           transform="translate(-285,-131)">
+          <path
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+             sodipodi:nodetypes="cccccc"
+             id="path39241-0"
+             d="m 756.16666,204.50001 10.33334,0 0,14.99999 -13,0 -10e-6,-11.99999 2.66667,-3 z"
+             style="fill:url(#linearGradient39254-3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;display:inline"
+             inkscape:connector-curvature="0" />
+          <path
+             style="opacity:0.3;fill:url(#radialGradient39256-2);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 756.16666,204.50001 10.33334,0 0,14.99999 -13,0 -10e-6,-11.99999 2.66667,-3 z"
+             id="path39243-2"
+             sodipodi:nodetypes="cccccc"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90"
+             inkscape:connector-curvature="0" />
+          <path
+             sodipodi:nodetypes="cccc"
+             d="m 754.5,209 0,9.5 m 3.5,-13 7.5,0"
+             style="fill:none;stroke:url(#linearGradient39258-9);stroke-width:1px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+             id="path39245-4"
+             inkscape:connector-curvature="0" />
+          <path
+             style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline"
+             d="m 753,208 4,0 0,-4 -4,4 z"
+             id="path39247-4"
+             sodipodi:nodetypes="cccc"
+             inkscape:connector-curvature="0" />
+          <path
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+             d="m 753.5,207.00001 0,12.49999 13,0 0,-14.99999 -10.5,0 -2.5,2.5 z"
+             style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             id="path39249-3"
+             sodipodi:nodetypes="cccccc"
+             inkscape:connector-curvature="0" />
+          <path
+             id="path39251-7"
+             d="m 757.5,206.5 0,2 -2,0"
+             style="fill:none;stroke:url(#linearGradient16151);stroke-width:1px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1"
+             inkscape:connector-curvature="0" />
+        </g>
         <path
+           sodipodi:nodetypes="cccccccccccccccccssc"
            inkscape:connector-curvature="0"
-           id="path22912-6-7"
-           d="m 222.58167,432.5 -1.08167,0 -3,3 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 c -0.554,0 -1,0.446 -1,1 l 0,5 c 0,0.554 0.446,1 1,1 l 1,0 c 0.554,0 1,-0.446 1,-1 l 3,3 1.08167,0 0,-11 z"
-           style="fill:url(#linearGradient17584);fill-opacity:1;fill-rule:nonzero;stroke:#2b1600;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.84313725;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
-           sodipodi:nodetypes="ccccccccccccc" />
+           id="path52980-3"
+           d="m 481.21875,81.25 c -0.34507,-0.155271 -0.69504,-0.245578 -1.125,-0.34375 L 479.9375,79 l -1,0 -1,0 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.75 -1.75,1.75 1.75,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L 471.9375,85 l 0,1 0,1 1.90625,0.15625 c 0.092,0.4031 0.17505,0.738019 0.3125,1.0625 m 2.96875,0 C 476.47574,87.692174 476.0625,86.902037 476.0625,86 c 0,-1.58782 1.28718,-2.875 2.875,-2.875 0.94357,0 1.75793,0.454854 2.28125,1.15625"
+           style="color:#000000;fill:none;stroke:#000000;stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
            inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cccc"
-           id="path22914-3-6"
-           d="m 216.5,440.5 1,0 1,-1 3.25,3"
-           style="fill:none;stroke:url(#linearGradient17586);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+           id="path52982-4"
+           d="m 477.9375,79 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.5 -1.5,1.5 1.5,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L 471.9375,85 l 0,1 0,1 1.90625,0.15625 c 0.0981,0.429533 0.18992,0.780253 0.34375,1.125 l 2.8125,0 C 476.34893,87.730943 475.9375,86.919238 475.9375,86 c 0,-1.65685 1.34315,-3 3,-3 0.96105,0 1.7947,0.453338 2.34375,1.15625 l 0,-2.875 c -0.36595,-0.173211 -0.73124,-0.270823 -1.1875,-0.375 L 479.9375,79 l -1,0 -1,0 z m 3.34375,8.8125 c -0.12902,0.1662 -0.24569,0.333041 -0.40625,0.46875 l 0.40625,0 0,-0.46875 z"
+           style="color:#000000;fill:url(#linearGradient79029);fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
+           sodipodi:nodetypes="cssc"
            inkscape:connector-curvature="0"
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           style="opacity:0.65263157;fill:none;stroke:url(#linearGradient17588);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 218.5,435.5 0,4.9091"
-           id="path22916-2-0" />
+           id="rect52986-8"
+           d="M 481.28125,83.40625 C 480.661,82.839183 479.84801,82.5 478.9375,82.5 c -1.93397,0 -3.5,1.566029 -3.5,3.5 0,0.881253 0.34008,1.6682 0.875,2.28125"
+           style="fill:none;stroke:url(#linearGradient79025);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
+           sodipodi:nodetypes="ccccccccccccc"
            inkscape:connector-curvature="0"
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           sodipodi:nodetypes="cc"
-           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-           d="m 216.5,436.5 1,0"
-           id="path22918-7-2" />
+           id="path52988-6"
+           d="m 476.4375,81.75 c 0.49914,-0.213 1.64896,-0.6698 2,-0.75 l 0,-0.75 0,-0.75 1,0 m -5.25,1.25 -0.5,0.5 z m 0.5,2.75 c -0.20864,0.49552 -0.6715,1.65605 -0.75,2 l -0.75,0 -0.75,0 0,1"
+           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
         <path
            inkscape:connector-curvature="0"
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           id="path22920-0-2"
-           d="m 220.59506,434.5 1,-1"
-           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+           style="fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           d="m 473.43328,81.74394 1.25,-1.25"
+           id="path52990-8"
            sodipodi:nodetypes="cc" />
         <path
+           sodipodi:nodetypes="cssc"
            inkscape:connector-curvature="0"
-           id="path22922-0-22"
-           d="m 216.5,435.63598 1,0"
-           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-           sodipodi:nodetypes="cc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
+           id="rect52992-4"
+           d="M 481.28125,83.40625 C 480.661,82.839183 479.84801,82.5 478.9375,82.5 c -1.93397,0 -3.5,1.566029 -3.5,3.5 0,0.881253 0.34008,1.6682 0.875,2.28125"
+           style="opacity:0.4;fill:none;stroke:url(#linearGradient79020);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc"
-           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-           d="m 220.59506,435.5 1,-1"
-           id="path22924-2-9"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
-        <path
-           inkscape:connector-curvature="0"
-           style="opacity:0.9;fill:none;stroke:url(#linearGradient17590);stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 227.5,433.5 c 2.75,2.75 2.75,6.25 0,9"
-           id="path22926-3-9"
-           sodipodi:nodetypes="cc"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
+           d="m 468.49796,75.999224 0,12.49999 13,0 0,-14.99999 -10.5,0 -2.5,2.5 z"
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           id="path39249-3-7"
+           sodipodi:nodetypes="cccccc"
+           inkscape:connector-curvature="0" />
+      </g>
+    </g>
+    <g
+       transform="translate(-42.000002,-84)"
+       style="display:inline;enable-background:new"
+       id="g81158-5">
+      <rect
+         y="325"
+         x="299"
+         height="16"
+         width="16.000002"
+         id="rect44300-0-5-3-4"
+         style="opacity:0;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         id="g81149-2">
         <path
+           sodipodi:nodetypes="cssssssssssssssscssc"
            inkscape:connector-curvature="0"
-           id="path22928-8-7"
-           d="m 221.5,433.5 0,9"
-           style="fill:none;stroke:url(#linearGradient17592);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+           id="path41299-1-2-7-4-0"
+           d="m 306.46211,325.45009 c -1.82601,0 -3.30699,1.48105 -3.30699,3.30711 0,0.25952 0.0379,0.51035 0.087,0.75425 0.18833,0.93505 0.24637,1.73179 -0.11603,2.43677 -0.32404,0.63034 -0.67881,0.97731 -1.45039,1.27638 -1.27734,0.49511 -2.17564,1.6304 -2.17564,3.04602 0,0.7411 0.24647,1.42826 0.6672,1.97265 0.21236,0.27479 0.1962,0.24789 0.29008,0.34806 0.60044,0.64074 1.56724,0.98341 2.29168,0.95729 0.74932,-0.027 1.28404,-0.28854 1.8855,-0.60911 0.58287,-0.31066 0.97831,-0.70633 1.82755,-0.69624 0.70498,0.008 1.33214,0.39548 1.88546,0.75426 0.55206,0.35795 1.29426,0.55886 1.8275,0.55114 1.8258,-0.0264 3.30697,-1.48104 3.30697,-3.30711 0,-1.23932 -0.68675,-2.33495 -1.71151,-2.87196 -0.78932,-0.41364 -1.71989,-0.83441 -2.11757,-1.47945 -0.44817,-0.72695 0.029,-2.46582 0.029,-2.46582 0.0441,-0.21523 0.087,-0.43896 0.087,-0.66722 0,-1.82606 -1.48098,-3.30711 -3.30698,-3.30711 z"
+           style="fill:url(#linearGradient80406-8);fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.89999998;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
+           sodipodi:nodetypes="cscsscc"
            inkscape:connector-curvature="0"
-           style="fill:none;stroke:url(#linearGradient17594);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-           d="m 216.5,435.3 0,5.4"
-           id="path22931-5-72" />
+           id="path15475-1-1-9"
+           d="m 306.46211,326.3494 c -1.34707,0 -2.40772,1.06069 -2.40772,2.4078 0,0.17324 0.0147,0.36498 0.058,0.5802 0.2006,0.99599 0.30102,2.03645 -0.20306,3.017 -0.3838,0.74661 -1.01301,1.33313 -1.91455,1.68257 -0.98238,0.38077 -1.59548,1.19286 -1.59548,2.23374 0.0793,1.22982 0.59501,1.65939 1.12899,2.05552"
+           style="fill:none;stroke:url(#linearGradient80403-6);stroke-width:0.99999988;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           sodipodi:nodetypes="cc"
-           style="opacity:0.6;fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
-           d="m 225.37642,435.40307 0.60225,0.61872"
-           id="path22922-0-22-4"
+           d="m 306.5,333.5 -4,3 m 4,-3 4,3 m -4,-8 0,5"
+           style="fill:none;stroke:#acc1f5;stroke-width:2.29999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           id="path16558"
            inkscape:connector-curvature="0" />
         <path
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           sodipodi:nodetypes="cc"
-           style="fill:none;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
-           d="m 227.40936,433.37013 0.51386,0.59663"
-           id="path22922-0-22-2"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           id="path15730-0-3-9-7"
+           style="fill:none;stroke:#474747;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+           d="m 306.5,333.5 -4,3 m 4,-3 4,3 m -4,-8 0,5" />
+        <rect
+           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
+           id="rect16285-9-59-6-8-3"
+           width="2.0172396"
+           height="2.0000157"
+           x="305.48901"
+           y="327.52499" />
+        <rect
+           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
+           id="rect16285-9-59-6-82-7"
+           width="2.0172396"
+           height="2.0000157"
+           x="301.52026"
+           y="335.49374" />
+        <rect
+           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
+           id="rect16285-9-59-6-9-2"
+           width="2.0172396"
+           height="2.0000157"
+           x="309.49374"
+           y="335.49374" />
+        <rect
+           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
+           id="rect16285-9-59-6-1-6"
+           width="2.0172396"
+           height="2.0000157"
+           x="305.52499"
+           y="332.52499" />
       </g>
     </g>
-    <rect
-       y="597"
-       x="383"
-       height="16"
-       width="16"
-       id="rect18740-5"
-       style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-    <g
-       transform="matrix(0.78985507,0,0,0.78985507,384.77042,545.63116)"
-       id="g18742-8"
-       style="display:inline;enable-background:new">
-      <rect
-         y="70.999992"
-         x="4.9838772"
-         height="9.0000172"
-         width="11.999999"
-         id="rect38458-5"
-         style="opacity:0.7;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9999994px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="cccccccccc"
-         style="fill:url(#linearGradient17715);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.01284409;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         d="m 17.209985,82.052175 -1.174018,1.202898 -10.0887566,0 -1.2028894,-1.202898 -1e-7,-12.622124 12.4766491,0 -0.01099,12.622124 -5e-6,0 0,0 z"
-         id="path18744-0"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90" />
-      <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="ccccc"
-         style="fill:#666666;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9999994px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         d="m 15.536259,81.328571 -6.3832127,2e-6 0,-0.999998 6.3832127,-2e-6 0,0.999998 z"
-         id="path18746-7"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90" />
-      <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="ccccc"
-         inkscape:export-ydpi="90"
-         inkscape:export-xdpi="90"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         id="path18748-3"
-         d="m 5.9039809,82.132474 0.025569,-11.527305 10.1868001,5.7e-5 0,11.527247 z"
-         style="fill:none;stroke:url(#linearGradient17717);stroke-width:1.26605475px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
-      <rect
-         inkscape:export-ydpi="90"
-         inkscape:export-xdpi="90"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         y="80.356544"
-         x="6.7951851"
-         height="1"
-         width="1"
-         id="rect18750-1"
-         style="fill:#d40000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-    </g>
-    <g
-       style="display:inline;enable-background:new"
-       id="g43488-2-2"
-       transform="matrix(0,-0.75485957,0.75485957,0,327.67313,852.33908)">
-      <path
-         inkscape:connector-curvature="0"
-         style="fill:none;stroke:#000000;stroke-width:3.57682419;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         d="M 326.98536,85.889717 327,76"
-         id="path43490-2-2"
-         sodipodi:nodetypes="cc" />
-      <path
-         inkscape:connector-curvature="0"
-         style="fill:none;stroke:#000000;stroke-width:3.57682419;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         d="m 330.97424,79.255626 -3.97425,-3.974249 -3.97424,3.974249"
-         id="path43492-1-0"
-         sodipodi:nodetypes="ccc" />
-    </g>
-    <g
-       style="display:inline;enable-background:new"
-       id="g43494-2-5"
-       transform="matrix(0,-0.75485957,0.75485957,0,327.67313,852.33908)">
-      <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="cc"
-         id="path43496-7-5"
-         d="M 327,85.889717 327,76"
-         style="fill:none;stroke:#ebebeb;stroke-width:1.72217464;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="ccc"
-         id="path43498-9-6"
-         d="m 330.97424,79.255626 -3.97425,-3.974249 -3.97424,3.974249"
-         style="fill:none;stroke:#ebebeb;stroke-width:1.72217464;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <path
-         style="fill:none;stroke:#ffffff;stroke-width:1.32474971;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         d="m 330.97424,79.255626 -2.24089,-2.206598"
-         id="path17874"
-         sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0" />
-    </g>
+    <path
+       sodipodi:type="arc"
+       style="fill:none;stroke:#000000;stroke-width:0.9560194;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path81543"
+       sodipodi:cx="478.90625"
+       sodipodi:cy="86.03125"
+       sodipodi:rx="2.34375"
+       sodipodi:ry="2.34375"
+       d="m 478.63139,88.358828 a 2.34375,2.34375 0 1 1 2.61786,-2.38697"
+       transform="matrix(1.0460001,0,0,1.0460077,-22.029739,-4.0047766)"
+       sodipodi:start="1.6883393"
+       sodipodi:end="6.2578421"
+       sodipodi:open="true" />
     <g
        style="display:inline;enable-background:new"
-       id="g17941">
+       id="g16724-8-3">
       <rect
-         transform="scale(-1,1)"
-         y="220.00047"
-         x="-546"
+         y="598"
+         x="152"
          height="16"
          width="16"
-         id="rect14357-6"
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         id="rect38813-3-2"
+         style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         id="g17935">
-        <rect
-           style="fill:#ec0606;fill-opacity:1;fill-rule:nonzero;stroke:#910000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect43394-5-7"
-           width="6"
-           height="2"
-           x="540.12811"
-           y="231.61429"
-           rx="0.79505396"
-           ry="0.79505396" />
+         transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,76.587007,362.72598)"
+         id="g10876-8-5-8-64-4"
+         style="display:inline;enable-background:new">
         <path
-           sodipodi:nodetypes="czszcccc"
-           id="path14368-1"
-           style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;display:inline"
-           d="m 542.6613,230.54031 -4.34213,0.008 c -5.18824,0.0101 -5.3353,-2.04831 -3.33529,-4.04831 0.96487,-0.96488 3.61611,-2.89515 -1.50001,-5 m 6.83689,6.08925 2.34054,2.95106 m -2.32899,2.96017 2.32899,-2.96017"
+           style="fill:url(#linearGradient16663-3-0-8);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           d="m 226.05286,111.6246 3.53553,0 1e-5,-3.53553 2.82843,0 0,3.53553 3.53553,0 -1e-5,2.82843 -3.53553,0 0,3.53553 -2.82843,0 0,-3.53553 -3.53553,0 z"
+           id="path10878-4-0-1-4-6"
+           sodipodi:nodetypes="ccccccccccccc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
            inkscape:connector-curvature="0" />
         <path
-           d="m 542.6613,230.54031 -4.34213,0.008 c -5.18824,0.0106 -5.3353,-2.04783 -3.33529,-4.04783 0.96487,-0.96488 3.83708,-2.76256 -1.50001,-5 m 6.83689,6.08877 2.34054,2.95106 m -2.32899,2.96017 2.32899,-2.96017"
-           style="fill:none;stroke:url(#linearGradient17932);stroke-width:1.50000143;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:7.40000034;display:inline"
-           id="path14375-4"
-           sodipodi:nodetypes="czszcccc"
-           inkscape:connector-curvature="0" />
-        <rect
-           ry="0.79505396"
-           rx="0.79505396"
-           y="220.375"
-           x="530.3125"
-           height="2"
-           width="6"
-           id="rect43396-5-4"
-           style="fill:#6996d7;fill-opacity:1;fill-rule:nonzero;stroke:#143564;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           sodipodi:nodetypes="cc"
+           inkscape:connector-curvature="0"
+           id="path16661-5-1-6"
+           d="m 235.06847,113.56915 0,-1.06066"
+           style="fill:none;stroke:#d4d4d4;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           sodipodi:nodetypes="cc"
+           inkscape:connector-curvature="0"
+           id="path16659-5-9-6"
+           d="m 230.47227,114.62981 0,2.47487"
+           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           sodipodi:nodetypes="cc"
+           inkscape:connector-curvature="0"
+           id="path16657-8-5-2"
+           d="m 230.47227,108.97295 0,2.47488"
+           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           sodipodi:nodetypes="cc"
+           inkscape:connector-curvature="0"
+           id="path10880-7-5-7-5-9"
+           d="m 226.93674,112.50849 0,1.06066"
+           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
       </g>
     </g>
     <g
-       id="g20086">
+       transform="translate(252,21)"
+       style="display:inline;enable-background:new"
+       id="g16724-8-1">
       <rect
          y="598"
-         x="299"
+         x="152"
          height="16"
          width="16"
-         id="rect25569-8"
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         id="rect38813-3-1"
+         style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         transform="translate(1.1,-0.09992002)"
-         id="g20068">
-        <rect
-           y="605.5"
-           x="-312.5"
-           height="7.0000267"
-           width="10"
-           id="rect15044-4"
-           style="fill:url(#linearGradient20080);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+         transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,76.587007,362.72598)"
+         id="g10876-8-5-8-64-9"
+         style="display:inline;enable-background:new">
+        <path
+           style="fill:url(#linearGradient16663-3-0-0);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           d="m 224.63864,111.6246 4.94975,0 0,-4.94974 2.82843,0 1e-5,4.94974 4.94973,0 -1e-5,2.82843 -4.94973,0 0,4.94975 -2.82843,0 0,-4.94975 -4.94975,0 z"
+           id="path10878-4-0-1-4-9"
+           sodipodi:nodetypes="ccccccccccccc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
            inkscape:export-ydpi="90"
-           transform="scale(-1,1)" />
+           inkscape:connector-curvature="0" />
         <path
+           sodipodi:nodetypes="cc"
            inkscape:connector-curvature="0"
-           id="path15046-4"
-           style="fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           d="m 304.49848,605.5625 0,-2 c 0,-2 -0.62933,-3 -2.51731,-3.00008 -1.2779,5e-5 -2.17039,0.23501 -2.53494,1.78073"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
-           sodipodi:nodetypes="cccc" />
+           id="path16661-5-1-5"
+           d="m 236.48268,113.56915 0,-1.06066"
+           style="fill:none;stroke:#d4d4d4;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
         <path
+           sodipodi:nodetypes="cc"
            inkscape:connector-curvature="0"
-           style="fill:none;stroke:url(#linearGradient20199);stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           d="m 304.49848,605.5625 0,-2.25 c 0,-1.75 -0.62933,-2.75 -2.51734,-2.75008 -1.27677,5e-5 -2.05659,0.20629 -2.29807,1.20103"
-           id="path15049-9"
-           sodipodi:nodetypes="cscc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
+           id="path16659-5-9-5"
+           d="m 230.47227,114.62981 0,3.88908"
+           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           sodipodi:nodetypes="cc"
+           inkscape:connector-curvature="0"
+           id="path16657-8-5-5"
+           d="m 230.47227,107.55874 0,3.88909"
+           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           sodipodi:nodetypes="cc"
+           inkscape:connector-curvature="0"
+           id="path10880-7-5-7-5-6"
+           d="m 225.52253,112.50849 0,1.06066"
+           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+      </g>
+    </g>
+    <g
+       id="g27438">
+      <g
+         transform="translate(0,-21)"
+         id="g23604">
+        <g
+           style="fill:#321900"
+           id="g23590">
+          <rect
+             transform="scale(-1,-1)"
+             y="-602"
+             x="-258"
+             height="2"
+             width="1"
+             id="rect23464"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             transform="scale(-1,-1)"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23466"
+             width="1"
+             height="2"
+             x="-258"
+             y="-606" />
+          <rect
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23548"
+             width="1"
+             height="2"
+             x="-273"
+             y="-602"
+             transform="scale(-1,-1)" />
+          <rect
+             y="-606"
+             x="-273"
+             height="2"
+             width="1"
+             id="rect23550"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             transform="scale(-1,-1)" />
+          <rect
+             y="-268"
+             x="598"
+             height="2"
+             width="1"
+             id="rect23472"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             transform="matrix(0,1,-1,0,0,0)" />
+          <rect
+             transform="matrix(0,1,-1,0,0,0)"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23474"
+             width="1"
+             height="2"
+             x="598"
+             y="-264" />
+          <rect
+             transform="matrix(0,1,-1,0,0,0)"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23476"
+             width="1"
+             height="2"
+             x="598"
+             y="-271.99207" />
+          <rect
+             y="-259.99207"
+             x="598"
+             height="2"
+             width="1"
+             id="rect23480"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             transform="matrix(0,1,-1,0,0,0)" />
+          <rect
+             transform="matrix(0,1,-1,0,0,0)"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23540"
+             width="1"
+             height="2"
+             x="607"
+             y="-268" />
+          <rect
+             y="-264"
+             x="607"
+             height="2"
+             width="1"
+             id="rect23542"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             transform="matrix(0,1,-1,0,0,0)" />
+          <rect
+             y="-271.99207"
+             x="607"
+             height="2"
+             width="1"
+             id="rect23544"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             transform="matrix(0,1,-1,0,0,0)" />
+          <rect
+             transform="matrix(0,1,-1,0,0,0)"
+             style="fill:#321900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23546"
+             width="1"
+             height="2"
+             x="607"
+             y="-259.99207" />
+        </g>
+        <g
+           id="g23572">
+          <rect
+             transform="matrix(0,-1,-1,0,0,0)"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             id="rect23461"
+             width="1"
+             height="2"
+             x="-608"
+             y="-270" />
+          <rect
+             transform="scale(-1,-1)"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23468"
+             width="1"
+             height="2"
+             x="-273"
+             y="-600" />
+          <rect
+             transform="scale(-1,-1)"
+             y="-604"
+             x="-273"
+             height="2"
+             width="1"
+             id="rect23470"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+          <rect
+             y="-266"
+             x="-608"
+             height="2"
+             width="1"
+             id="rect23478"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             transform="matrix(0,-1,-1,0,0,0)" />
+          <rect
+             transform="matrix(0,-1,-1,0,0,0)"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             id="rect23482"
+             width="1"
+             height="2"
+             x="-608"
+             y="-262" />
+          <rect
+             y="-262"
+             x="598"
+             height="2"
+             width="1"
+             id="rect23529"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             transform="matrix(0,1,-1,0,0,0)" />
+          <rect
+             transform="matrix(0,1,-1,0,0,0)"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             id="rect23531"
+             width="1"
+             height="2"
+             x="598"
+             y="-266" />
+          <rect
+             y="-270"
+             x="598"
+             height="2"
+             width="1"
+             id="rect23533"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             transform="matrix(0,1,-1,0,0,0)" />
+          <rect
+             y="-273"
+             x="-608"
+             height="1"
+             width="2"
+             id="rect23535"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             transform="matrix(0,-1,-1,0,0,0)" />
+          <rect
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23525"
+             width="1"
+             height="2"
+             x="-258"
+             y="-600"
+             transform="scale(-1,-1)" />
+          <rect
+             y="-604"
+             x="-258"
+             height="2"
+             width="1"
+             id="rect23527"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             transform="scale(-1,-1)" />
+          <rect
+             transform="scale(-1,-1)"
+             style="fill:#ff982a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect23537"
+             width="1"
+             height="2"
+             x="-258"
+             y="-608" />
+        </g>
         <rect
-           ry="0"
-           rx="0"
-           y="606.5"
-           x="303.5"
-           height="5"
-           width="8"
-           id="rect15051-2"
-           style="fill:none;stroke:url(#linearGradient20084);stroke-width:1.00000024;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" />
+           y="599"
+           x="258"
+           height="8"
+           width="14"
+           id="rect23637"
+           style="opacity:0.2;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
            inkscape:connector-curvature="0"
-           id="path19016-6"
-           d="m 304,607.5 7.5,0"
-           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+           sodipodi:nodetypes="ccccccc"
+           style="opacity:0.12999998;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 259,600 13,0 0,-1 -14,0 0,8 1,0 0,-7 z"
+           id="path23639" />
+        <g
+           transform="translate(40,359)"
+           id="g23641"
+           style="display:inline;enable-background:new">
+          <g
+             id="g23646"
+             style="fill:#1a1a1a;display:inline;enable-background:new"
+             transform="translate(5,-6.0000002e-7)" />
+        </g>
+      </g>
+      <g
+         transform="translate(0.1767767,0.13258252)"
+         id="g106636">
         <path
-           inkscape:connector-curvature="0"
-           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-           d="m 304,609.5 7.5,0"
-           id="path19018-0" />
+           style="fill:url(#linearGradient106641);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 263.5625,590.375 1.75,-1.5 1.99177,3.7253 1.75,-1 -1.74177,-3.4753 2.5,0 -6.25,-6.25 z"
+           id="path45378-1-5-6-2-9"
+           sodipodi:nodetypes="cccccccc"
+           inkscape:connector-curvature="0" />
         <path
+           style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 263.3125,581.125 7,7.25 -3,0 1.69346,3.25845 -1.75,1 -1.69346,-3.50845 -2.25,2.25 z"
+           id="path17835-7-2-5"
            inkscape:connector-curvature="0"
-           id="path19020-2"
-           d="m 304,611.5 7.5,0"
-           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
-        <rect
-           style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect36041-6"
-           width="1"
-           height="2.0000124"
-           x="307"
-           y="608" />
-        <rect
-           y="608"
-           x="307"
-           height="0.99994379"
-           width="0.99998754"
-           id="rect36043-2"
-           style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           sodipodi:nodetypes="cccccccc" />
         <path
-           style="opacity:0.7;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 308,608 0,2 -1,0 0,1 1,0 1,0 0,-1 0,-2 -1,0 z"
-           id="path36045-7"
-           inkscape:connector-curvature="0" />
+           style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 264.15625,583.375 0,5.75"
+           id="path17845-9-1-1"
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cc" />
       </g>
     </g>
     <g
-       transform="translate(21,0)"
+       transform="translate(0.02855492,0)"
        style="display:inline;enable-background:new"
-       id="g20086-7">
+       id="g15868-5">
       <rect
-         y="598"
-         x="299"
-         height="16"
-         width="16"
-         id="rect25569-8-3"
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect18695-6-9-6"
+         width="15.971445"
+         height="16.000002"
+         x="110"
+         y="241" />
       <g
-         transform="translate(1.1,-0.09992002)"
-         id="g20068-2">
-        <rect
-           y="605.5"
-           x="-312.5"
-           height="7.0000267"
-           width="10"
-           id="rect15044-4-1"
-           style="fill:url(#linearGradient20080-5);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
-           transform="scale(-1,1)" />
+         id="g15853-0">
         <path
-           inkscape:connector-curvature="0"
-           id="path15046-4-9"
-           style="fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           d="m 310.5,605.5 0,-2 c 0,-2 -0.75,-3 -3,-3.00008 -2.25,8e-5 -3,1.00008 -3,3.00008 l 0,2"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
-           sodipodi:nodetypes="ccccc" />
+           sodipodi:nodetypes="ccccc"
+           id="path15095-5"
+           d="m 117.9106,247.99675 0.007,7.98875 -5.98631,-3.26708 -0.0121,-7.34356 z"
+           style="opacity:0.63859648;fill:url(#radialGradient15836-5);fill-opacity:1;stroke:none"
+           inkscape:connector-curvature="0" />
         <path
-           inkscape:connector-curvature="0"
-           style="fill:none;stroke:url(#linearGradient20082-4);stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           d="m 310.5,605.5 c 0,0 0,-2.25 0,-2.25 0,-1.75 -0.75,-2.75 -3.00003,-2.75008 C 305.25,600.5 304.5,601.5 304.5,603.25 l 0,2.25005"
-           id="path15049-9-8"
-           sodipodi:nodetypes="csccc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
-        <rect
-           ry="0"
-           rx="0"
-           y="606.5"
-           x="303.5"
-           height="5"
-           width="8"
-           id="rect15051-2-5"
-           style="fill:none;stroke:url(#linearGradient20084-9);stroke-width:1.00000024;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" />
+           sodipodi:nodetypes="ccccccc"
+           id="path18719-6-9-0"
+           d="m 117.94049,242.95683 -5.85545,2.34692 6.10637,2.4934 -0.17358,8.22275 6.00064,-3.2989 0.0442,-7.36753 z"
+           style="fill:url(#linearGradient15851-6);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           inkscape:connector-curvature="0" />
+        <g
+           id="g18703-4-7-7"
+           transform="matrix(1.2133883,0,0,1.2133883,-65.271004,156.45833)">
+          <path
+             id="path18707-3-8-5"
+             d="m 146.0019,73.295281 5,-2.007976 5,2.007976 -5,2.073959 z"
+             style="fill:url(#linearGradient15818-5);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             sodipodi:nodetypes="ccccc"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90"
+             inkscape:connector-curvature="0" />
+        </g>
         <path
-           inkscape:connector-curvature="0"
-           id="path19016-6-0"
-           d="m 304,607.5 7.5,0"
-           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+           id="path18763-2-5-8"
+           d="m 124.01757,245.38766 -6.11113,2.33515 0.39771,8.10095 5.71891,-3.11585 z"
+           style="fill:url(#linearGradient15846-4);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline"
+           sodipodi:nodetypes="ccccc"
+           inkscape:connector-curvature="0" />
+        <path
+           sodipodi:nodetypes="ccccc"
+           id="path18709-1-1-0"
+           d="m 114.36329,244.98044 3.58667,-1.46751 5.56035,2.22692 0.0356,6.65202 -4.34973,2.45342"
+           style="fill:none;stroke:url(#linearGradient15843-2);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           inkscape:connector-curvature="0" />
+        <g
+           id="g18737-4-8-8"
+           style="opacity:0.7"
+           transform="matrix(1.2133883,0,0,1.2133883,-282.46751,373.65484)" />
         <path
+           sodipodi:nodetypes="ccccccccccc"
            inkscape:connector-curvature="0"
-           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-           d="m 304,609.5 7.5,0"
-           id="path19018-0-2" />
+           id="path15957-6"
+           d="m 118.29703,256.35166 5.94799,-3.23942 c 0.0419,-0.0185 0.0806,-0.0443 0.11369,-0.0758 0.0689,-0.0703 0.11042,-0.16699 0.1137,-0.26543 l -0.0379,-7.432 c 10e-4,-0.16462 -0.1103,-0.32426 -0.26543,-0.37919 l -6.06694,-2.42677 c -0.0474,-0.0224 -0.0992,-0.0354 -0.15167,-0.0379 l 1.2e-4,0 c -0.0524,0.002 -0.10423,0.0154 -0.15167,0.0379 l -5.53168,2.30782"
+           style="fill:none;stroke:#0b1728;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+        <path
+           sodipodi:type="inkscape:offset"
+           inkscape:radius="0.4429636"
+           inkscape:original="M 111.90625 245.375 L 111.9375 252.71875 L 117.90625 256 L 117.90625 248 L 111.90625 245.375 z "
+           style="fill:none;stroke:url(#linearGradient16730);stroke-width:0.89999998;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           id="path16571-2"
+           d="m 111.78125,244.9375 a 0.4430079,0.4430079 0 0 0 -0.3125,0.4375 l 0.0312,7.34375 a 0.4430079,0.4430079 0 0 0 0.21875,0.375 l 5.96875,3.28125 A 0.4430079,0.4430079 0 0 0 118.34375,256 l 0,-8 a 0.4430079,0.4430079 0 0 0 -0.25,-0.40625 l -6,-2.625 a 0.4430079,0.4430079 0 0 0 -0.3125,-0.0312 z" />
         <path
            inkscape:connector-curvature="0"
-           id="path19020-2-9"
-           d="m 304,611.5 7.5,0"
-           style="opacity:0.5;fill:none;stroke:#939dac;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
-        <rect
-           style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect36041-6-4"
-           width="1"
-           height="2.0000124"
-           x="307"
-           y="608" />
-        <rect
-           y="608"
-           x="307"
-           height="0.99994379"
-           width="0.99998754"
-           id="rect36043-2-8"
-           style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           style="fill:none;stroke:url(#linearGradient16562-7);stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 117.31869,255.08504 -4.89325,-2.67466 -0.0154,-6.1798"
+           id="path16560-5"
+           sodipodi:nodetypes="ccc" />
         <path
-           style="opacity:0.7;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 308,608 0,2 -1,0 0,1 1,0 1,0 0,-1 0,-2 -1,0 z"
-           id="path36045-7-1"
-           inkscape:connector-curvature="0" />
+           style="opacity:0.75333408;fill:none;stroke:url(#linearGradient15773-7);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:0.38888891"
+           d="m 112.44393,252.43208 3.76322,-1.57568"
+           id="path15671-3"
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cc" />
       </g>
     </g>
+    <path
+       d="m -220,198.65625 -5.3125,8.6875 5.3125,3 5.28125,-3.0625 -5.28125,-8.625 z"
+       id="path29747"
+       style="opacity:0.55438597;fill:none;stroke:url(#linearGradient29763);stroke-width:1.14285719;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       inkscape:original="M -220 196.6875 L -226.71875 207.6875 L -220 211.5 L -213.3125 207.625 L -220 196.6875 z "
+       inkscape:radius="-1.0141826"
+       sodipodi:type="inkscape:offset" />
     <g
-       transform="translate(-105.02687,272.93951)"
-       style="display:inline;enable-background:new"
-       id="g17107">
+       id="g27538">
       <rect
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect18696-0-4-1"
+         id="rect39543"
          width="16"
          height="16"
-         x="299"
-         y="325" />
+         x="131"
+         y="556" />
       <g
-         id="g17099">
+         transform="translate(104,40.00013)"
+         id="g39545">
+        <g
+           transform="translate(-116,424.99975)"
+           style="opacity:0.75"
+           id="g39547">
+          <g
+             id="g39549"
+             transform="translate(-179,199.50012)">
+            <path
+               sodipodi:nodetypes="ccccccc"
+               style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.00000167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               d="m 328.5,-107.25 -4.5,1.75 0,6.5 4.5,2.25 4.25,-2 0,-6.75 -4.25,-1.75 z"
+               id="path39551"
+               inkscape:connector-curvature="0" />
+            <g
+               id="g39553"
+               transform="translate(179,-179)">
+              <path
+                 sodipodi:nodetypes="ccccc"
+                 id="path39556"
+                 d="m 154,80 0,-6.5 -4.5,-1.75 0,10.5 L 154,80 z"
+                 style="fill:#666666;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+                 inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
+                 inkscape:export-xdpi="90"
+                 inkscape:export-ydpi="90"
+                 inkscape:connector-curvature="0" />
+            </g>
+            <path
+               inkscape:export-ydpi="90"
+               inkscape:export-xdpi="90"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
+               id="path39558"
+               d="m 324,-99.00012 0,-6.49988 4.5,-1.75 0.5,0.25 0,10 -0.5,0.25 -4.5,-2.25012 z"
+               style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               sodipodi:nodetypes="ccccccc"
+               inkscape:connector-curvature="0" />
+            <path
+               sodipodi:nodetypes="ccccc"
+               id="path39560"
+               d="m 332.5,-105.5 0,6.25 -4,2 -4,-2.00012 0,-6.24988"
+               style="fill:none;stroke:url(#linearGradient27496);stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+               inkscape:connector-curvature="0" />
+            <path
+               id="path39562"
+               d="m 324,-105.5 4.5,-1.75 4.5,1.75 -4.5,2 -4.5,-2 z"
+               style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               sodipodi:nodetypes="ccccc"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
+               inkscape:export-xdpi="90"
+               inkscape:export-ydpi="90"
+               inkscape:connector-curvature="0" />
+          </g>
+          <path
+             id="path39564"
+             d="m 145.5,94.25012 c 0,0 4,1.75 4,1.75 l 4,-1.75"
+             style="opacity:0.95999995;fill:none;stroke:url(#linearGradient27498);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+             sodipodi:nodetypes="ccc"
+             inkscape:connector-curvature="0" />
+          <rect
+             y="96.000122"
+             x="149"
+             height="6.7500019"
+             width="1"
+             id="rect39567"
+             style="opacity:0.35;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             style="opacity:0.09599998;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect39569"
+             width="1"
+             height="6.7500019"
+             x="150"
+             y="96.000122" />
+        </g>
+        <rect
+           style="fill:none;stroke:#8c4800;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect39571"
+           width="2.9999485"
+           height="3.0001416"
+           x="27.500006"
+           y="517.49976"
+           ry="0"
+           rx="0" />
+        <rect
+           rx="0"
+           ry="0"
+           y="524.49951"
+           x="27.500006"
+           height="3.0001416"
+           width="2.9999485"
+           id="rect39574"
+           style="fill:none;stroke:#8c4800;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           y="517.99988"
+           x="28.021444"
+           height="4"
+           width="3.9785564"
+           id="rect37868-0-5"
+           style="opacity:0.12000002;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
-           style="fill:url(#linearGradient16783-1-6-0-2);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;enable-background:new"
-           d="M 309.7702,332.24765 304.5,337.5 l -1,0 -1,1 -1,0 0,-1 1,-1 0,-1 5.2702,-5.25235 z"
-           id="path18700-1-3-9"
-           sodipodi:nodetypes="cccccccccc"
+           style="fill:none;stroke:#5a2f00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 28.000006,520.49983 -0.5,0 0,-3.00014 2.99995,0"
+           id="path39576"
+           sodipodi:nodetypes="cccc"
            inkscape:connector-curvature="0" />
         <path
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cccccccccc"
-           id="path17007-7"
-           d="M 309.7702,332.24765 304.5,337.5 l -1,0 -1,1 -1,0 0,-1 1,-1 0,-1 5.2702,-5.25235 z"
-           style="fill:none;stroke:#000000;stroke-width:0.69999999;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
-        <path
-           sodipodi:nodetypes="ccszsccc"
-           id="path18711-5-8-1"
-           d="m 310.5,333.5 0,-2.75 c 1.1224,0 1.75,0 2.5,-0.75 0.75,-0.75 0.75,-2.25 0,-3 -0.75,-0.75 -2.25,-0.75 -3,0 -0.75,0.75 -0.75,1.49506 -0.75,2.5 l -2.75,0 4,4 z"
-           style="fill:#1a1a1a;fill-opacity:1;fill-rule:evenodd;stroke:#1a1a1a;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
+           sodipodi:nodetypes="cccc"
+           id="path39583"
+           d="m 28.000006,524.49978 -0.5,0 0,3.00014 2.99995,0"
+           style="fill:none;stroke:#5a2f00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
            inkscape:connector-curvature="0" />
+        <rect
+           rx="0"
+           ry="0"
+           y="517.99988"
+           x="28.000051"
+           height="2.0000772"
+           width="1.9999485"
+           id="rect39585"
+           style="fill:#ffd4a5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           y="524.99988"
+           x="28"
+           height="1.999992"
+           width="3.9785564"
+           id="rect37868-0-1"
+           style="opacity:0.12000002;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           rx="0"
+           ry="0"
+           y="524.99982"
+           x="28.000051"
+           height="2.0000772"
+           width="1.9999485"
+           id="rect39587"
+           style="fill:#ffd4a5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      </g>
+      <g
+         transform="translate(-122.79197,-20.867417)"
+         id="g106636-9"
+         style="display:inline;enable-background:new">
         <path
-           inkscape:transform-center-x="-1.4435745"
-           inkscape:transform-center-y="-1.4192649"
-           style="fill:url(#linearGradient16778-3-5-3-2);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;enable-background:new"
-           d="m 309.22323,329.79745 c -0.11594,-0.12547 0.0486,-1.2642 0.81343,-2.11918 1.04731,-1.1688 1.89745,-0.8692 1.99021,-0.61778 1.02063,2.76644 -1.73024,3.89859 -2.80364,2.73696 z"
-           id="path18713-4-2-0"
-           sodipodi:nodetypes="csss"
+           style="fill:url(#linearGradient106641-3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m 263.5625,590.375 1.75,-1.5 1.99177,3.7253 1.75,-1 -1.74177,-3.4753 2.5,0 -6.25,-6.25 z"
+           id="path45378-1-5-6-2-9-3"
+           sodipodi:nodetypes="cccccccc"
            inkscape:connector-curvature="0" />
         <path
-           sodipodi:nodetypes="ccc"
-           id="path18715-9-8-1"
-           d="m 308.26612,330.5 c 0,0 0.25,0 0.25,0 l 0,-1"
-           style="opacity:0.98000004;fill:none;stroke:url(#linearGradient16775-4-9-5-6);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
-           inkscape:connector-curvature="0" />
+           style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 263.3125,581.125 7,7.25 -3,0 1.69346,3.25845 -1.75,1 -1.69346,-3.50845 -2.25,2.25 z"
+           id="path17835-7-2-5-1"
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cccccccc" />
         <path
-           style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 303.25,335.75 4.17237,-4.0625"
-           id="path18705-8-4-0"
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0" />
+           style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m 264.15625,583.375 0,5.75"
+           id="path17845-9-1-1-8"
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cc" />
       </g>
     </g>
     <g
-       transform="translate(-42,231)"
        style="display:inline;enable-background:new"
-       id="g17942-1">
+       id="g52905"
+       transform="translate(398.95001,-42)">
       <rect
-         y="304"
-         x="278"
+         y="367"
+         x="-372.95001"
          height="16"
          width="16"
-         id="rect22048-0-1-2"
-         style="opacity:0.01000001;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         id="rect52907"
+         style="opacity:0;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <path
+         sodipodi:nodetypes="cc"
+         id="path52910"
+         d="m -368.95,374 5,-5"
+         style="fill:none;stroke:#000000;stroke-width:3.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         inkscape:connector-curvature="0" />
       <g
-         id="g17930-6">
-        <rect
-           y="305.5"
-           x="281.5"
-           height="6.0211244"
-           width="9.0000076"
-           id="rect22050-0-1-6"
-           style="opacity:0.6;fill:#ffd6aa;fill-opacity:1;fill-rule:evenodd;stroke:#2b1600;stroke-width:0.40000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         mask="url(#mask52637-8-8)"
+         id="g52912"
+         transform="translate(-18.95,-84)">
         <path
            sodipodi:nodetypes="ccccc"
-           id="path22056-3-7-1"
-           d="m 282.5,316.5 3,3 3,-3 -3,-3 -3,3 z"
-           style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m -352.5,465.5 2,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
+           style="color:#000000;fill:none;stroke:#3c0800;stroke-width:2.70000005;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path52914"
            inkscape:connector-curvature="0" />
         <path
-           style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 282.75,316.5 2.75,2.75 2.75,-2.75 -2.75,-2.75 -2.75,2.75 z"
-           id="path22058-8-8-7"
+           id="path52916"
+           style="color:#000000;fill:none;stroke:#ed7432;stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -353.25,465.5 2.75,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
            sodipodi:nodetypes="ccccc"
            inkscape:connector-curvature="0" />
         <path
-           id="path22060-3-9-9"
-           d="m 283.5,316.5 2,-2 2,2 -2,2 -2,-2 z"
-           style="fill:none;stroke:url(#linearGradient18148);stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0" />
-        <path
-           sodipodi:nodetypes="ccccccccc"
-           id="path22157-2-9-1"
-           d="m 287.75,308.25 0,0.5 2.5,2.5 0.5,0 2.5,-2.5 0,-0.5 -2.5,-2.5 -0.5,0 -2.5,2.5 z"
-           style="fill:none;stroke:#552c00;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           inkscape:connector-curvature="0" />
-        <path
-           style="fill:#e98316;fill-opacity:1;fill-rule:evenodd;stroke:none"
-           d="m 288,308.5 2.5,2.5 2.5,-2.5 -2.5,-2.5 -2.5,2.5 z"
-           id="path22159-1-9-5"
+           mask="none"
            sodipodi:nodetypes="ccccc"
+           d="m -353.25,465.5 2.75,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
+           style="color:#000000;fill:none;stroke:url(#linearGradient52998-5-5);stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path52918"
            inkscape:connector-curvature="0" />
+      </g>
+      <rect
+         ry="1.5"
+         rx="1.5"
+         style="fill:none;stroke:#000000;stroke-width:2.5999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect52920"
+         width="3"
+         height="3"
+         x="-371.45001"
+         y="-376.5"
+         transform="scale(1,-1)" />
+      <g
+         transform="matrix(-1,0,0,1,-711.95,-84)"
+         id="g52922"
+         mask="url(#mask52879-0-5)">
         <path
-           id="path22161-4-8-9"
-           d="M 288.64504,308.5 290.5,306.66161 292.35496,308.5 290.5,310.36049 z"
-           style="fill:none;stroke:url(#linearGradient17904-1);stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           id="path52924"
+           style="color:#000000;fill:none;stroke:#0b1728;stroke-width:2.70000005;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -353.5,465.5 3,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
            sodipodi:nodetypes="ccccc"
            inkscape:connector-curvature="0" />
         <path
-           style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 278.75,308.25 0,0.5 2.5,2.5 0.5,0 2.5,-2.5 0,-0.5 -2.5,-2.5 -0.5,0 -2.5,2.5 z"
-           id="path22208-0-8-1"
-           sodipodi:nodetypes="ccccccccc"
-           inkscape:connector-curvature="0" />
-        <path
            sodipodi:nodetypes="ccccc"
-           id="path22212-5-4-4"
-           d="m 279,308.5 2.5,2.5 2.5,-2.5 -2.5,-2.5 z"
-           style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -354.2,465.5 3.7,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
+           style="color:#000000;fill:none;stroke:#7be10f;stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path52926"
            inkscape:connector-curvature="0" />
         <path
+           id="path52928"
+           style="color:#000000;fill:none;stroke:url(#linearGradient53000-3-9);stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -354.2,465.5 3.75,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
            sodipodi:nodetypes="ccccc"
-           style="fill:none;stroke:url(#linearGradient17893-5);stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="M 279.64062,308.5 281.5,306.66406 283.35547,308.5 281.5,310.375 z"
-           id="path22214-3-8-8"
+           mask="none"
            inkscape:connector-curvature="0" />
       </g>
+      <rect
+         transform="scale(1,-1)"
+         y="-376.5"
+         x="-361.45001"
+         height="3"
+         width="3"
+         id="rect52930"
+         style="fill:none;stroke:#000000;stroke-width:2.5999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         rx="1.5"
+         ry="1.5" />
+      <path
+         style="fill:none;stroke:#b3b3b3;stroke-width:2.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         d="m -367.7,372.75 3.75,-3.75"
+         id="path52932"
+         sodipodi:nodetypes="cc"
+         inkscape:connector-curvature="0" />
+      <rect
+         transform="scale(1,-1)"
+         y="-376.5"
+         x="-371.45001"
+         height="3"
+         width="3"
+         id="rect52934"
+         style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#cccccc;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         rx="1.5"
+         ry="1.5" />
+      <rect
+         ry="1.5"
+         rx="1.5"
+         style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#cccccc;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect52936"
+         width="3"
+         height="3"
+         x="-361.45001"
+         y="-376.5"
+         transform="scale(1,-1)" />
+      <path
+         sodipodi:nodetypes="cc"
+         id="path52938"
+         d="m -368.45,372.5 4,-4 1,0"
+         style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         inkscape:connector-curvature="0" />
+      <rect
+         ry="1.5"
+         rx="1.5"
+         style="fill:none;stroke:url(#linearGradient53002-6-2);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect52940"
+         width="3"
+         height="3"
+         x="-371.45001"
+         y="-376.5"
+         transform="scale(1,-1)" />
+      <rect
+         transform="scale(1,-1)"
+         y="-376.5"
+         x="-361.45001"
+         height="3"
+         width="3"
+         id="rect52942"
+         style="fill:none;stroke:url(#linearGradient58927);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         rx="1.5"
+         ry="1.5" />
     </g>
-    <rect
-       style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-       id="rect18831-4-3"
-       width="16"
-       height="16"
-       x="467"
-       y="451" />
     <g
-       id="g16806">
+       style="display:inline;enable-background:new"
+       transform="translate(252,-210)"
+       id="g52978">
+      <path
+         style="color:#000000;fill:none;stroke:#000000;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         d="m -198,536 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.75 -1.75,1.75 1.75,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L -204,542 l 0,1 0,1 1.90625,0.15625 c 0.14227,0.6231 0.25145,1.07677 0.59375,1.59375 l -1.75,1.75 1.75,1.75 1.75,-1.75 c 0.51699,0.34229 0.97065,0.45148 1.59375,0.59375 L -198,550 l 1,0 1,0 0.15625,-1.90625 c 0.6231,-0.14227 1.07677,-0.25145 1.59375,-0.59375 l 1.75,1.75 1.75,-1.75 -1.75,-1.75 c 0.34229,-0.51699 0.45148,-0.97065 0.59375,-1.59375 L -190,544 l 0,-1 0,-1 -1.90625,-0.15625 c -0.14227,-0.6231 -0.25145,-1.07677 -0.59375,-1.59375 l 1.75,-1.75 -1.75,-1.75 -1.75,1.75 c -0.51699,-0.34229 -0.97065,-0.45148 -1.59375,-0.59375 L -196,536 l -1,0 -1,0 z m 1,4.125 c 1.58782,0 2.875,1.28718 2.875,2.875 0,1.58782 -1.28718,2.875 -2.875,2.875 -1.58782,0 -2.875,-1.28718 -2.875,-2.875 0,-1.58782 1.28718,-2.875 2.875,-2.875 z"
+         id="path52980"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path52982"
+         d="m -196,550 0.15625,-1.90625 c 0.6231,-0.14227 1.07677,-0.25145 1.59375,-0.59375 l 1.75,1.5 1.5,-1.5 -1.5,-1.75 c 0.34229,-0.51699 0.45148,-0.97065 0.59375,-1.59375 L -190,544 l 0,-1 0,-1 -1.90625,-0.15625 c -0.14227,-0.6231 -0.25145,-1.07677 -0.59375,-1.59375 l 1.5,-1.75 -1.5,-1.5 -1.75,1.5 c -0.51699,-0.34229 -0.97065,-0.45148 -1.59375,-0.59375 L -196,536 l -1,0 -1,0 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.5 -1.5,1.5 1.5,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L -204,542 l 0,1 0,1 1.90625,0.15625 c 0.14227,0.6231 0.25145,1.07677 0.59375,1.59375 l -1.5,1.75 1.5,1.5 1.75,-1.5 c 0.51699,0.34229 0.97065,0.45148 1.59375,0.59375 L -198,550 l 1,0 1,0 z m -1,-4 c -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 0,1.65685 -1.34315,3 -3,3 z"
+         style="color:#000000;fill:url(#linearGradient32854-6-2);fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         inkscape:connector-curvature="0" />
       <rect
-         y="472"
-         x="257"
+         y="535"
+         x="-205"
          height="16"
          width="16"
-         id="rect35680"
+         id="rect52984"
          style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <g
-         inkscape:transform-center-y="2.2787562"
-         inkscape:transform-center-x="-0.78726"
-         id="g35844"
-         transform="translate(-186,256.02369)"
-         style="opacity:0.9;display:inline;enable-background:new">
-        <path
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="ccc"
-           id="path35846"
-           d="m 454.5,218.5 c -1.25,-1.5 -2.5,-1.5 -4,1 -1.5,-2.5 -2.75,-2.5 -4,-1"
-           style="opacity:0.85;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-        <path
-           inkscape:connector-curvature="0"
-           style="fill:none;stroke:#f2f2f2;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 454.5,218.5 c -1.25,-1.5 -2.5,-1.5 -4,1 -1.5,-2.5 -2.75,-2.5 -4,-1"
-           id="path35848"
-           sodipodi:nodetypes="ccc" />
-      </g>
+      <rect
+         ry="6.4999995"
+         rx="6.4999995"
+         y="539.5"
+         x="-200.5"
+         height="6.981843"
+         width="6.981843"
+         id="rect52986"
+         style="fill:none;stroke:url(#linearGradient32856-3-2);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <path
-         sodipodi:nodetypes="ccccc"
-         id="path35862"
-         d="m 264.5,485.5 -1,-1 -2,2 -2,-2 -1,1.02369"
-         style="opacity:0.76499999;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+         d="m -192.5,537.5 -1.25,1.25 m -2.75,-2.25 -1,0 0,1.5 c -0.35104,0.0802 -1.50086,0.537 -2,0.75 m -1.75,1.75 c -0.20864,0.49552 -0.67146,1.65605 -0.75,2 l -1.5,0 0,1 m 1.75,-5.75 -0.5,0.5 m 1,8 -1.25,1.25"
+         id="path52988"
+         sodipodi:nodetypes="cccccscccccccc"
          inkscape:connector-curvature="0" />
       <path
-         style="fill:none;stroke:#ffffff;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         d="m 264.5,485.5 -1,-1 -2,2 -2,-2 -1,1.02369"
-         id="path35864"
-         sodipodi:nodetypes="ccccc"
+         sodipodi:nodetypes="cc"
+         id="path52990"
+         d="m -202.5,538.75 1.25,-1.25"
+         style="fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
          inkscape:connector-curvature="0" />
-      <g
-         transform="translate(-21,21)"
-         id="g38276">
-        <path
-           inkscape:connector-curvature="0"
-           style="opacity:0.85;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 292.5,459.5 c -1.25,-1.5 -3.5,-1.5 -5,1 -1.5,-2.5 -3.75,-2.5 -5,-1"
-           id="path35702"
-           sodipodi:nodetypes="ccc" />
-        <path
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="ccc"
-           id="path35704"
-           d="m 292.5,459.5 c -1.25,-1.5 -3.5,-1.5 -5,1 -1.5,-2.5 -3.75,-2.5 -5,-1"
-           style="fill:none;stroke:#ececec;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-      </g>
+      <rect
+         style="opacity:0.4;fill:none;stroke:url(#linearGradient32858-7-2);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect52992"
+         width="6.981843"
+         height="6.981843"
+         x="193.51816"
+         y="-546.48187"
+         rx="6.4999995"
+         ry="6.4999995"
+         transform="scale(-1,-1)" />
       <path
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         style="opacity:0.35;fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+         d="m -197.5,548.25 0,1.25 m 7,-7 -1.25,0"
+         id="path52994"
          sodipodi:nodetypes="cccc"
-         inkscape:connector-curvature="0"
-         d="m 266.53125,480.65625 -0.0312,0.9375 m -0.85937,-1.07813 c 0.49634,0.0684 0.8328,0.24341 1.79687,0"
-         style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-         id="path16745" />
+         inkscape:connector-curvature="0" />
       <path
-         sodipodi:nodetypes="cccc"
-         inkscape:connector-curvature="0"
-         d="m 264.46875,474.79687 -0.0312,0.9375 m -0.85937,-1.07813 c 0.49634,0.0684 0.8328,0.24341 1.79687,0"
-         style="fill:none;stroke:#f0f0f0;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline;enable-background:new"
-         id="path16745-9" />
-    </g>
-    <g
-       id="g37076-6-0-2"
-       style="opacity:0.96000001;stroke:#1a1a1a;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;display:inline;enable-background:new"
-       transform="translate(127.00485,107.03779)" />
-    <g
-       style="opacity:0.96000001;stroke:#c8c8c8;stroke-opacity:1;display:inline;enable-background:new"
-       id="g37094-7-8-1"
-       transform="translate(190.00485,-60.962214)">
-      <g
-         transform="translate(-63.000001,168)"
-         id="g37096-1-5-3"
-         style="stroke:#c8c8c8;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-      <g
-         id="g37104-2-9-1"
-         transform="matrix(0,1,-1,0,511,255)"
-         style="stroke:#c8c8c8;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+         sodipodi:nodetypes="cc"
+         id="path52996"
+         d="m -191.75,547.25 -1,1"
+         style="opacity:0.3;fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90"
+         inkscape:connector-curvature="0" />
     </g>
-    <rect
-       style="opacity:0.01000001;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-       id="rect45374-0"
-       width="16"
-       height="16"
-       x="383"
-       y="430" />
     <g
-       transform="translate(105,0)"
-       style="opacity:0.3;display:inline;enable-background:new"
-       id="g17847-0">
-      <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="cccccccc"
-         id="path45378-1-5-0"
-         d="m 367.75,440.75 1.75,-1.5 2.5,5.25 1.75,-1 -2.25,-5 2.5,0 -6.25,-6.25 z"
-         style="fill:url(#linearGradient17833-9);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+       style="display:inline;enable-background:new"
+       id="g32860"
+       transform="translate(231,-294)">
       <rect
-         y="430"
-         x="362"
-         height="16"
+         style="opacity:0;color:#000000;fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect32862"
          width="16"
-         id="rect45374-0-5-0"
-         style="opacity:0;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         height="16"
+         x="-226"
+         y="619" />
       <path
-         sodipodi:nodetypes="cccccccc"
-         inkscape:connector-curvature="0"
-         id="path17835-6"
-         d="m 367.5,431.5 7,7.25 -3,0 2.5,4.75 -1.75,1 -2.5,-5 -2.25,2.25 z"
-         style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+         sodipodi:nodetypes="cccsssscccc"
+         style="opacity:0.5;fill:url(#linearGradient32896-0-4);fill-opacity:1;stroke:none"
+         d="m -212.5,619.5 -2,0 -6.0625,6.0625 C -220.70928,625.548 -220.84942,625.5 -221,625.5 c -2.48528,0 -4.5,2.01473 -4.5,4.5 0,2.48527 2.01472,4.5 4.5,4.5 2.48528,0 4.5,-2.01473 4.5,-4.5 0,-0.14948 -0.017,-0.29176 -0.0312,-0.4375 l 6.0312,-6.0625 0,-2 -2,-2 z"
+         id="path32864"
+         inkscape:connector-curvature="0" />
       <path
-         sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0"
-         id="path17845-4"
-         d="m 368.34375,433.75 0,5.75"
-         style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-    </g>
-    <g
-       transform="translate(84,0)"
-       style="display:inline;enable-background:new"
-       id="g17847-9">
+         d="m -177.09897,651.49231 c 0,1.37646 -1.09713,2.49231 -2.45051,2.49231 -1.35339,0 -2.45052,-1.11585 -2.45052,-2.49231 0,-1.37646 1.09713,-2.49231 2.45052,-2.49231 1.35338,0 2.45051,1.11585 2.45051,2.49231 z"
+         sodipodi:ry="2.4923096"
+         sodipodi:rx="2.4505157"
+         sodipodi:cy="651.49231"
+         sodipodi:cx="-179.54948"
+         id="path32866"
+         style="color:#000000;fill:url(#linearGradient32899-8-3);fill-opacity:1;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         sodipodi:type="arc"
+         transform="matrix(1.224232,0,0,1.2036922,-1.189782,-154.19619)" />
       <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="cccccccc"
-         id="path45378-1-5-6"
-         d="m 367.75,440.75 1.75,-1.5 2.5,5.25 1.75,-1 -2.25,-5 2.5,0 -6.25,-6.25 z"
-         style="fill:url(#linearGradient17833-8);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <rect
-         y="430"
-         x="362"
-         height="16"
-         width="16"
-         id="rect45374-0-5-6"
-         style="opacity:0;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         sodipodi:nodetypes="ccccc"
+         id="path32868"
+         d="m -219.5,626.5 5.5,-5.5 0.5,-0.5 0.5,0.5 0.5,0.5"
+         style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
+         inkscape:connector-curvature="0" />
       <path
-         sodipodi:nodetypes="cccccccc"
-         inkscape:connector-curvature="0"
-         id="path17835-7"
-         d="m 367.5,431.5 7,7.25 -3,0 2.5,4.75 -1.75,1 -2.5,-5 -2.25,2.25 z"
-         style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+         transform="translate(-21,0)"
+         d="M -193.09375,620.46875 -198.875,626.25 a 0.95626367,0.95626367 0 0 1 -0.78125,0.25 c -0.29297,-0.0289 -0.39637,-0.0312 -0.34375,-0.0312 -1.96853,0 -3.53125,1.56273 -3.53125,3.53125 0,1.96852 1.56272,3.53125 3.53125,3.53125 1.96853,0 3.53125,-1.56273 3.53125,-3.53125 0,-0.0768 0.0155,-0.18427 0,-0.34375 a 0.95626367,0.95626367 0 0 1 0.25,-0.78125 l 5.75,-5.78125 0,-1.1875 -1.4375,-1.4375 -1.1875,0 z"
+         id="path32870"
+         style="fill:none;stroke:url(#radialGradient32901-4-9);stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         inkscape:original="M -193.5 619.5 L -199.5625 625.5625 C -199.70928 625.548 -199.84942 625.5 -200 625.5 C -202.48528 625.5 -204.5 627.51473 -204.5 630 C -204.5 632.48527 -202.48528 634.5 -200 634.5 C -197.51472 634.5 -195.5 632.48527 -195.5 630 C -195.5 629.85052 -195.51705 629.70824 -195.53125 629.5625 L -189.5 623.5 L -189.5 621.5 L -191.5 619.5 L -193.5 619.5 z "
+         inkscape:radius="-0.95616806"
+         sodipodi:type="inkscape:offset" />
+      <path
+         id="path32872"
+         d="m -217,624 0,1 -1,0 0,0.0312 -0.0312,0 0,0.96875 -0.96875,0 0,0.0312 -0.0312,0 0,1 -1,0 0,1 0,1 1,0 1,0 0,-1 1,0 0,-0.0312 0.0312,0 0,-0.96875 0.96875,0 0,-0.0312 0.0312,0 0,-1 1,0 0,-1 -1,0 0,-1 -1,0 z"
+         style="color:#000000;fill:url(#linearGradient32903-6-4);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         inkscape:connector-curvature="0" />
+      <path
+         transform="matrix(1.2638889,0,0,1.2222222,32.853009,-140.1836)"
+         d="m -201.22313,628.93835 c 0,0.44702 -0.36237,0.80939 -0.80939,0.80939 -0.44701,0 -0.80939,-0.36237 -0.80939,-0.80939 0,-0.44701 0.36238,-0.80938 0.80939,-0.80938 0.44702,0 0.80939,0.36237 0.80939,0.80938 z"
+         sodipodi:ry="0.80938911"
+         sodipodi:rx="0.80938911"
+         sodipodi:cy="628.93835"
+         sodipodi:cx="-202.03252"
+         id="path32874"
+         style="opacity:0.7;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         sodipodi:type="arc" />
+      <path
+         sodipodi:type="arc"
+         style="opacity:0.7;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="path32877"
+         sodipodi:cx="-202.03252"
+         sodipodi:cy="628.93835"
+         sodipodi:rx="0.80938911"
+         sodipodi:ry="0.80938911"
+         d="m -201.22313,628.93835 c 0,0.44702 -0.36237,0.80939 -0.80939,0.80939 -0.44701,0 -0.80939,-0.36237 -0.80939,-0.80939 0,-0.44701 0.36238,-0.80938 0.80939,-0.80938 0.44702,0 0.80939,0.36237 0.80939,0.80938 z"
+         transform="matrix(0.77047663,0,0,0.74507628,-63.8586,161.95861)" />
+      <path
+         transform="matrix(0.77047663,0,0,0.74507628,-64.708233,162.88548)"
+         d="m -201.22313,628.93835 c 0,0.44702 -0.36237,0.80939 -0.80939,0.80939 -0.44701,0 -0.80939,-0.36237 -0.80939,-0.80939 0,-0.44701 0.36238,-0.80938 0.80939,-0.80938 0.44702,0 0.80939,0.36237 0.80939,0.80938 z"
+         sodipodi:ry="0.80938911"
+         sodipodi:rx="0.80938911"
+         sodipodi:cy="628.93835"
+         sodipodi:cx="-202.03252"
+         id="path32879"
+         style="opacity:0.7;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         sodipodi:type="arc" />
       <path
+         style="opacity:0.35;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline;enable-background:new"
+         d="m -213.5,621.5 -6,6"
+         id="path32881"
          sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0"
-         id="path17845-9"
-         d="m 368.34375,433.75 0,5.75"
-         style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+         inkscape:connector-curvature="0" />
+      <path
+         id="path32883"
+         d="m -212.5,619.5 -2,0 -6.0625,6.0625 C -220.70928,625.548 -220.84942,625.5 -221,625.5 c -2.48528,0 -4.5,2.01473 -4.5,4.5 0,2.48527 2.01472,4.5 4.5,4.5 2.48528,0 4.5,-2.01473 4.5,-4.5 0,-0.14948 -0.017,-0.29176 -0.0312,-0.4375 l 6.0312,-6.0625 0,-2 -2,-2 z"
+         style="fill:none;stroke:#000000;stroke-width:0.69999999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         sodipodi:nodetypes="cccsssscccc"
+         inkscape:connector-curvature="0" />
+      <path
+         transform="translate(-21,0)"
+         sodipodi:type="inkscape:offset"
+         inkscape:radius="-0.95616806"
+         inkscape:original="M -193.5 619.5 L -199.5625 625.5625 C -199.70928 625.548 -199.84942 625.5 -200 625.5 C -202.48528 625.5 -204.5 627.51473 -204.5 630 C -204.5 632.48527 -202.48528 634.5 -200 634.5 C -197.51472 634.5 -195.5 632.48527 -195.5 630 C -195.5 629.85052 -195.51705 629.70824 -195.53125 629.5625 L -189.5 623.5 L -189.5 621.5 L -191.5 619.5 L -193.5 619.5 z "
+         style="fill:none;stroke:url(#radialGradient32905-9-5);stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         id="path32886"
+         d="M -193.09375,620.46875 -198.875,626.25 a 0.95626367,0.95626367 0 0 1 -0.78125,0.25 c -0.29297,-0.0289 -0.39637,-0.0312 -0.34375,-0.0312 -1.96853,0 -3.53125,1.56273 -3.53125,3.53125 0,1.96852 1.56272,3.53125 3.53125,3.53125 1.96853,0 3.53125,-1.56273 3.53125,-3.53125 0,-0.0768 0.0155,-0.18427 0,-0.34375 a 0.95626367,0.95626367 0 0 1 0.25,-0.78125 l 5.75,-5.78125 0,-1.1875 -1.4375,-1.4375 -1.1875,0 z" />
+      <g
+         style="opacity:0.3;fill:#ffffff"
+         id="g32888">
+        <rect
+           style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect32890"
+           width="1"
+           height="0.98873287"
+           x="-217"
+           y="622.98871" />
+        <rect
+           y="624"
+           x="-216"
+           height="0.98873287"
+           width="1"
+           id="rect32892"
+           style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <rect
+           style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect32894"
+           width="1"
+           height="0.98873287"
+           x="-215"
+           y="624.98871" />
+      </g>
+    </g>
+    <path
+       inkscape:connector-curvature="0"
+       d=""
+       sodipodi:nodetypes="cz"
+       id="path39078-8-8-1"
+       style="fill:none;stroke:#f2f2f2;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000034;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    <g
+       transform="matrix(0.90885089,0,0,0.92442422,-334.35843,100.27347)"
+       style="opacity:0.85"
+       id="g37781-7-2-5" />
+    <g
+       transform="translate(-118.46,211)"
+       style="opacity:0.6"
+       id="g35477-3">
+      <g
+         id="g35480-0" />
+      <g
+         id="g35486-7" />
+    </g>
+    <g
+       transform="matrix(0,1,-1,0,197.54,88)"
+       id="g35493-0"
+       style="opacity:0.6">
+      <g
+         id="g35496-1" />
+      <g
+         id="g35502-6" />
     </g>
     <g
        style="display:inline;enable-background:new"
-       id="g10534-1"
-       transform="translate(189.0161,-397)">
+       id="g43585-6"
+       transform="translate(72,509.96991)">
       <rect
-         y="428"
-         x="193.9839"
+         y="148"
+         x="-46"
          height="16"
          width="16"
-         id="rect20642-6"
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         id="rect45977-0"
+         style="opacity:0;fill:#666666;stroke:none;stroke-width:2.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         transform="scale(1,-1)" />
+      <path
+         sodipodi:nodetypes="cscccc"
+         id="path43354-7"
+         d="m -42,-162.5 c -1.383118,0 -2.5,2.0178 -2.5,4.5 0,2.4822 1.116881,4.5 2.5,4.5 l 9.5,-2 c 1.25,-0.25 1.25,-4.75 0,-5 -3.164485,-0.63789 -6.364604,-1.31719 -9.5,-2 z"
+         style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path43211-1"
+         d="m -42.46462,-153.21991 0,4"
+         style="fill:none;stroke:#000000;stroke-width:2.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+         sodipodi:nodetypes="cc"
+         inkscape:connector-curvature="0" />
+      <path
+         d="m -42,-163.5 c -1.175382,0 -2.068672,0.84122 -2.625,1.84375 -0.556328,1.00253 -0.875,2.26593 -0.875,3.65625 0,1.39032 0.318672,2.65372 0.875,3.65625 0.556328,1.00253 1.449618,1.84375 2.625,1.84375 a 0.9950207,0.9950207 0 0 0 0.21875,-0.0312 l 9.46875,-2 c 0.01655,-0.003 0.01506,-0.0275 0.03125,-0.0312 0.840076,-0.19179 1.234143,-0.86885 1.4375,-1.46875 0.207276,-0.61147 0.28125,-1.28773 0.28125,-1.96875 0,-0.68102 -0.07397,-1.35728 -0.28125,-1.96875 -0.207276,-0.61147 -0.593404,-1.32493 -1.46875,-1.5 -3.157727,-0.63653 -6.336828,-1.31795 -9.46875,-2 A 0.9950207,0.9950207 0 0 0 -42,-163.5 z"
+         id="path43480-7"
+         style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         inkscape:original="M -42 -162.5 C -43.383118 -162.5 -44.5 -160.4822 -44.5 -158 C -44.5 -155.5178 -43.383119 -153.5 -42 -153.5 L -32.5 -155.5 C -31.25 -155.75 -31.25 -160.25 -32.5 -160.5 C -35.664485 -161.13789 -38.864604 -161.81719 -42 -162.5 z "
+         inkscape:radius="0.99492121"
+         sodipodi:type="inkscape:offset" />
       <g
-         transform="translate(-29.016109,339.00751)"
-         id="g20606-2">
+         id="g43531-7"
+         style="fill:#bc2b00;stroke:none">
         <g
-           transform="translate(-199.98388,-106)"
-           id="g10953-7">
+           id="g43521-7"
+           style="fill:#bc2b00;stroke:none">
           <path
-             inkscape:export-ydpi="90"
-             inkscape:export-xdpi="90"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-             sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccc"
-             style="fill:none;stroke:#000000;stroke-width:1.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-             d="m 429.9998,196.99249 0,1.625 c -0.53409,0.12195 -1.02562,0.33162 -1.46875,0.625 l -1.53125,-1.25 -1,1 1.25,1.53125 c -0.29338,0.44313 -0.50305,0.93466 -0.625,1.46875 l -1.625,0 0,2 1.625,0 c 0.12195,0.53409 0.33162,1.02562 0.625,1.46875 l -1.25,1.53125 1,1 1.53125,-1.25 c 0.44313,0.29338 0.93466,0.50305 1.46875,0.625 l 0,1.625 2,0 0,-1.625 c 0.53409,-0.12195 1.02562,-0.33162 1.46875,-0.625 l 1.53125,1.25 1,-1 -1.25,-1.53125 c 0.29338,-0.44313 0.50305,-0.93466 0.625,-1.46875 l 1.625,0 0,-2 -1.625,0 c -0.12195,-0.53409 -0.33162,-1.02562 -0.625,-1.46875 l 1.25,-1.53125 -1,-1 -1.53125,1.25 c -0.44313,-0.29338 -0.93466,-0.50305 -1.46875,-0.625 l 0,-1.625 -2,0 z m -1,4 4,0 0,4 -4,0 0,-4 z"
-             id="path10955-5"
-             inkscape:connector-curvature="0" />
-          <path
-             inkscape:export-ydpi="90"
-             inkscape:export-xdpi="90"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-             sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccc"
-             id="path10957-4"
-             d="m 429.9998,196.99249 0,1.625 c -0.53409,0.12195 -1.02562,0.33162 -1.46875,0.625 l -1.53125,-1.25 -1,1 1.25,1.53125 c -0.29338,0.44313 -0.50305,0.93466 -0.625,1.46875 l -1.625,0 0,2 1.625,0 c 0.12195,0.53409 0.33162,1.02562 0.625,1.46875 l -1.25,1.53125 1,1 1.53125,-1.25 c 0.44313,0.29338 0.93466,0.50305 1.46875,0.625 l 0,1.625 2,0 0,-1.625 c 0.53409,-0.12195 1.02562,-0.33162 1.46875,-0.625 l 1.53125,1.25 1,-1 -1.25,-1.53125 c 0.29338,-0.44313 0.50305,-0.93466 0.625,-1.46875 l 1.625,0 0,-2 -1.625,0 c -0.12195,-0.53409 -0.33162,-1.02562 -0.625,-1.46875 l 1.5,-1.78125 -1,-1 -1.78125,1.5 c -0.44313,-0.29338 -0.93466,-0.50305 -1.46875,-0.625 l 0,-1.625 -2,0 z m -1,4 4,0 0,4 -4,0 0,-4 z"
-             style="fill:url(#linearGradient20796-9);fill-opacity:1;fill-rule:nonzero;stroke:none"
+             style="fill:#bc2b00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.57082754;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m -94.9375,-169.09375 c -0.02445,0.0114 -0.07282,0.0179 -0.09375,0.0312 -0.07655,0.0171 -0.129072,0.0618 -0.1875,0.0937 -0.06733,0.0426 -0.102853,0.0701 -0.125,0.125 -0.04225,0.0882 -0.02336,0.20307 0.0625,0.28125 0.425481,0.37342 0.870923,1.31835 1.09375,2.46875 0.222825,1.15041 0.26055,2.52729 0.0625,3.8125 -0.229814,1.49133 -0.739166,2.50981 -1.21875,2.875 -0.06733,0.0426 -0.134102,0.10133 -0.15625,0.15625 -0.02264,0.0932 0.04665,0.17736 0.15625,0.25 0.116379,0.0913 0.296118,0.15625 0.5,0.15625 0.203886,0 0.383626,-0.065 0.5,-0.15625 0.05375,-0.0409 0.10617,-0.08 0.15625,-0.125 0.100788,-0.012 0.199646,-0.0299 0.28125,-0.0625 0.05623,-0.0197 0.114869,-0.067 0.15625,-0.0937 0.879891,-0.58512 1.33731,-1.57799 1.59375,-3.03125 0.221887,-1.25745 0.188175,-2.58853 -0.0625,-3.71875 -0.250672,-1.13023 -0.67717,-2.06619 -1.40625,-2.625 -0.07644,-0.0471 -0.164946,-0.10325 -0.28125,-0.125 -0.08767,-0.0266 -0.180589,-0.0253 -0.28125,-0.0312 -0.03116,-0.0302 -0.0613,-0.0653 -0.09375,-0.0937 -0.05975,-0.064 -0.132554,-0.12368 -0.25,-0.15625 -0.124538,-0.0375 -0.266141,-0.0447 -0.40625,-0.0312 l 0,-1e-4 0,0 z"
+             transform="translate(56,6)"
+             id="path43515-7"
              inkscape:connector-curvature="0" />
+        </g>
+        <g
+           id="g43525-3"
+           transform="matrix(1,0,0,0.8248704,3.9999996,-27.664792)"
+           style="fill:#bc2b00;stroke:none">
           <path
-             d="m 434.9998,198.49249 -1.5,1.25 m -2,-2.25 -1,0 0,1.5 c -0.35104,0.0802 -1.01806,0.29269 -1.5172,0.50569 m -1.49,1.50752 c -0.20864,0.49552 -0.41426,1.14284 -0.4928,1.48679 l -1.5,0 0,1 m 1.5,-5 -0.5,0.5 m 1.25,6.5 -1.25,1.5 m 6.5,-5.5 0,3.5 -3.5,0 m -3,-6 0.5,-0.5 1.5,1.25"
-             style="fill:none;stroke:#f9f9f9;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
-             id="path10959-0"
+             id="path43527-3"
+             style="fill:#bc2b00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.62850982;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m -38.766635,-163.1299 c -0.1926,0.0198 -0.359499,0.088 -0.454803,0.18574 -0.141826,0.12415 -0.141826,0.2845 0,0.40865 0.393723,0.36252 0.827594,1.30384 1.03955,2.45188 0.211957,1.14804 0.253401,2.50645 0.06497,3.78928 -0.218694,1.48887 -0.72826,2.54519 -1.169495,2.89767 -0.09595,0.0836 -0.129342,0.18561 -0.09271,0.28335 0.03663,0.0977 0.140225,0.18301 0.287629,0.23675 0.146132,0.0549 0.324618,0.074 0.495554,0.053 0.170936,-0.0209 0.320068,-0.0802 0.414052,-0.16446 0.787677,-0.62926 1.137868,-1.68972 1.364411,-3.23203 0.196047,-1.33468 0.156543,-2.73807 -0.06497,-3.93787 -0.221514,-1.1998 -0.582737,-2.18614 -1.234468,-2.78623 -0.130885,-0.13138 -0.387364,-0.2047 -0.649719,-0.18574 l 0,0 -10e-7,1e-5 0,0 z m 0.338475,0.29257 c -0.244486,0.0286 -0.443513,0.11281 -0.531926,0.22492 -0.08841,0.11212 -0.05483,0.23776 0.08976,0.33579 0.442252,0.33867 0.938861,1.23068 1.179113,2.31292 0.24025,1.08225 0.287292,2.36512 0.07369,3.57452 -0.247925,1.40376 -0.831847,2.40481 -1.326503,2.73346 -0.229933,0.15651 -0.165504,0.37098 0.14739,0.49062 0.163456,0.0637 0.375184,0.0924 0.584711,0.0791 0.209527,-0.0133 0.398079,-0.0673 0.520708,-0.14918 0.899238,-0.59746 1.290496,-1.62825 1.547585,-3.0839 0.222494,-1.25976 0.177718,-2.58217 -0.0737,-3.71469 -0.251412,-1.13252 -0.582944,-2.05893 -1.326502,-2.62833 -0.04216,-0.0265 -0.09175,-0.05 -0.147388,-0.0701 -0.187804,-0.0957 -0.469403,-0.13585 -0.736946,-0.10513 l 8e-6,0 0,0 z"
              inkscape:connector-curvature="0" />
         </g>
+      </g>
+      <path
+         sodipodi:type="inkscape:offset"
+         inkscape:radius="0.99492121"
+         inkscape:original="M -42 -162.5 C -43.383118 -162.5 -44.5 -160.4822 -44.5 -158 C -44.5 -155.5178 -43.383119 -153.5 -42 -153.5 L -32.5 -155.5 C -31.25 -155.75 -31.25 -160.25 -32.5 -160.5 C -35.664485 -161.13789 -38.864604 -161.81719 -42 -162.5 z "
+         style="fill:url(#linearGradient24022-6);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="path43484-5"
+         d="m -42,-163.5 c -1.175382,0 -2.068672,0.84122 -2.625,1.84375 -0.556328,1.00253 -0.875,2.26593 -0.875,3.65625 0,1.39032 0.318672,2.65372 0.875,3.65625 0.556328,1.00253 1.449618,1.84375 2.625,1.84375 a 0.9950207,0.9950207 0 0 0 0.21875,-0.0312 l 9.46875,-2 c 0.01655,-0.003 0.01506,-0.0275 0.03125,-0.0312 0.840076,-0.19179 1.234143,-0.86885 1.4375,-1.46875 0.207276,-0.61147 0.28125,-1.28773 0.28125,-1.96875 0,-0.68102 -0.07397,-1.35728 -0.28125,-1.96875 -0.207276,-0.61147 -0.593404,-1.32493 -1.46875,-1.5 -3.157727,-0.63653 -6.336828,-1.31795 -9.46875,-2 A 0.9950207,0.9950207 0 0 0 -42,-163.5 z" />
+      <path
+         style="fill:none;stroke:#999999;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline;enable-background:new"
+         d="m -42.46462,-152.96991 0,4.5"
+         id="path43213-9"
+         sodipodi:nodetypes="cc"
+         inkscape:connector-curvature="0" />
+      <path
+         transform="matrix(2.5815738,0,0,1.0580577,65.140965,9.1698698)"
+         d="m -40.52941,-158 c 0,2.34721 -0.434548,4.25 -0.97059,4.25 -0.536042,0 -0.97059,-1.90279 -0.97059,-4.25 0,-2.34721 0.434548,-4.25 0.97059,-4.25 0.536042,0 0.97059,1.90279 0.97059,4.25 z"
+         sodipodi:ry="4.25"
+         sodipodi:rx="0.9705897"
+         sodipodi:cy="-158"
+         sodipodi:cx="-41.5"
+         id="path43356-9"
+         style="fill:url(#linearGradient24024-4);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.48405313;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         sodipodi:type="arc" />
+      <rect
+         style="opacity:0.3;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect43215-8"
+         width="1"
+         height="1"
+         x="-42.964619"
+         y="-152.96989" />
+      <path
+         d="m -42,-162.59375 c -0.74028,0 -1.381145,0.54136 -1.84375,1.375 -0.462605,0.83364 -0.75,1.96262 -0.75,3.21875 0,1.25613 0.287395,2.38511 0.75,3.21875 0.462605,0.83364 1.10347,1.375 1.84375,1.375 a 0.10019871,0.10019871 0 0 0 0.03125,0 l 9.5,-2 c 0.369179,-0.0738 0.619862,-0.43015 0.78125,-0.90625 0.161388,-0.4761 0.21875,-1.08496 0.21875,-1.6875 0,-0.60254 -0.05736,-1.2114 -0.21875,-1.6875 -0.161388,-0.4761 -0.412071,-0.83241 -0.78125,-0.90625 -3.163804,-0.63775 -6.364954,-1.31727 -9.5,-2 a 0.10019871,0.10019871 0 0 0 -0.03125,0 z"
+         id="path43218-1"
+         style="fill:none;stroke:url(#linearGradient14482-7);stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         inkscape:original="M -42 -162.5 C -43.383118 -162.5 -44.5 -160.4822 -44.5 -158 C -44.5 -155.5178 -43.383119 -153.5 -42 -153.5 L -32.5 -155.5 C -31.25 -155.75 -31.25 -160.25 -32.5 -160.5 C -35.664485 -161.13789 -38.864604 -161.81719 -42 -162.5 z "
+         inkscape:radius="0.10018869"
+         sodipodi:type="inkscape:offset" />
+    </g>
+    <g
+       style="display:inline;enable-background:new"
+       id="g24573-8"
+       transform="translate(189,104.96991)">
+      <g
+         id="g24558-2">
+        <rect
+           y="241"
+           x="47"
+           height="16"
+           width="16"
+           id="rect24365-6"
+           style="opacity:0;fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.10000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <path
+           sodipodi:nodetypes="cccccccccccsss"
+           id="path24370-6"
+           d="m 60.5,253 -1,0.5 -0.998035,-1 -7e-6,-2 -0.999999,-1 -2.251959,0 -0.75,-0.75 0.002,-2.25 -1.000001,-1 -1.999993,0 -1.001965,-0.75 0.498035,-1 c 1.618614,-3.25 6.964866,-2.7871 9.501965,-0.25 2.5371,2.53709 3,8 0,9.5 L 60.5,253 z"
+           style="fill:url(#linearGradient24044-1);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           inkscape:connector-curvature="0" />
+        <path
+           sodipodi:nodetypes="cccccccsccsccccc"
+           id="path24406-0"
+           d="m 55.40625,241.84375 c -1.752306,-0.0251 -3.360906,0.59103 -4.09375,2.0625 l -0.15625,0.3125 c -0.122559,0.2366 -0.05653,0.52711 0.15625,0.6875 l 0.15625,0.125 c 0.100886,0.0688 0.221909,0.1018 0.34375,0.0937 l 1.6875,0 c 0.01042,3e-4 0.02083,3e-4 0.03125,0 0.09863,-0.003 0.17826,0.0573 0.25,0.125 l 1,0.96875 c 0.06775,0.0718 0.09659,0.15137 0.09375,0.25 -2.98e-4,0.0104 -2.98e-4,0.0208 0,0.0312 l 0,2.09375 0.375,0.15625 4.96875,-4.96875 c -1.186918,-1.18692 -3.03835,-1.91206 -4.8125,-1.9375 l 0,1e-4 0,0 z"
+           style="fill:url(#linearGradient24046-9);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           inkscape:connector-curvature="0" />
         <g
-           transform="translate(-199.98388,-106)"
-           id="g10961-1">
-          <rect
-             ry="0"
-             rx="0"
-             y="202.46629"
-             x="430.49979"
-             height="8.1236582"
-             width="7.0000763"
-             id="rect10963-2"
-             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90" />
-          <path
-             d="m 432.53795,204.5065 2.96201,0 m -2.96201,1.993 2.96201,0 m -2.96201,1.993 2.96201,0"
-             style="fill:none;stroke:#000000;stroke-width:0.99999988px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
-             id="path10965-7"
+           style="opacity:0.82999998"
+           id="g24372-3"
+           transform="translate(21,0)"
+           mask="url(#mask25021-4)">
+          <path
+             id="path24374-8"
+             style="fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             d="m 30,246.5 -2,7 1.5,1.5 7,-2 m -3.5,-3 -4.5,4.5"
              sodipodi:nodetypes="cccccc"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90"
              inkscape:connector-curvature="0" />
-          <rect
-             ry="0"
-             rx="0"
-             y="202.48912"
-             x="430.49661"
-             height="8.0067444"
-             width="7.0067482"
-             id="rect10967-1"
-             style="fill:none;stroke:url(#linearGradient20798-1);stroke-width:0.99325603;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90" />
+          <path
+             id="path24380-0"
+             style="fill:none;stroke:url(#radialGradient24048-2);stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+             d="M 34.25,248.75 28.5,254.5"
+             mask="none"
+             sodipodi:nodetypes="cc"
+             inkscape:connector-curvature="0" />
+          <path
+             mask="none"
+             d="m 30.5,244.75 -2.5,8.75 1.5,1.5 8.75,-2.5"
+             style="fill:none;stroke:url(#radialGradient24050-4);stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
+             id="path24448-1"
+             sodipodi:nodetypes="cccc"
+             inkscape:connector-curvature="0" />
         </g>
+        <path
+           sodipodi:nodetypes="cccccccccccccccccssc"
+           id="path24408-2"
+           d="m 55.40625,242.375 c -1.622878,-0.0233 -2.972755,0.53436 -3.59375,1.78125 l -0.15625,0.3125 0.15625,0.125 1.6875,0 c 0.243249,-0.007 0.479315,0.0829 0.65625,0.25 l 1,1 c 0.167073,0.17694 0.257003,0.413 0.25,0.65625 L 55.5,248 l 0.5,0.5 1.5,0.0937 c 0.243249,-0.007 0.479315,0.0829 0.65625,0.25 l 1,1 c 0.167073,0.17694 0.257003,0.413 0.25,0.65625 l 0,1.59375 0.28125,0.28125 0.40625,-0.1875 c 1.084704,-0.54235 1.613412,-1.88556 1.5625,-3.53125 -0.05091,-1.64569 -0.757004,-3.44451 -1.8125,-4.5 -1.05838,-1.05838 -2.814635,-1.75798 -4.4375,-1.78125 l 0,5e-5 z"
+           style="fill:none;stroke:url(#linearGradient24053-5);stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           inkscape:connector-curvature="0" />
+        <rect
+           style="opacity:0.5;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect24450-5"
+           width="2"
+           height="1"
+           x="50"
+           y="245" />
+        <rect
+           style="opacity:0.5;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect24452-0"
+           width="1"
+           height="1"
+           x="54"
+           y="248" />
+        <rect
+           style="opacity:0.5;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect24454-9"
+           width="1"
+           height="1"
+           x="55"
+           y="249" />
+        <rect
+           style="opacity:0.3;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect24456-4"
+           width="1"
+           height="2"
+           x="58"
+           y="252" />
+        <rect
+           y="249"
+           x="54"
+           height="1"
+           width="1"
+           id="rect24659-7"
+           style="opacity:0.3;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      </g>
+      <g
+         style="display:inline;enable-background:new"
+         id="g24384-8"
+         transform="matrix(0.3350147,0,0,0.3350147,6.410699,179.66413)"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90">
+        <path
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path24396-3"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:#320b00;stroke-width:3.58193231;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:type="arc"
+           transform="matrix(0.75,0,0,0.75,29.5,135)" />
+        <path
+           sodipodi:type="arc"
+           style="opacity:0.6;fill:url(#linearGradient24055-1);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           id="path24398-5"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           transform="matrix(-0.6011908,-0.06817113,0.06852359,-0.6012277,199.77148,303.44348)" />
+        <path
+           transform="matrix(0.4463965,0,0,0.4463971,69.575658,170.82515)"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path24400-1"
+           style="opacity:0.7;fill:none;stroke:url(#linearGradient24057-7);stroke-width:6.6867547;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           sodipodi:type="arc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
       </g>
     </g>
     <g
        style="display:inline;enable-background:new"
-       id="g79830">
+       id="g43234-2"
+       transform="matrix(-1,0,0,1,185,310)">
       <rect
-         y="73"
-         x="467"
-         height="16"
+         transform="scale(1,-1)"
+         style="opacity:0;fill:#666666;stroke:none;stroke-width:2.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect44017-0"
          width="16"
-         id="rect52984-1"
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         height="16"
+         x="-46"
+         y="-52" />
       <g
-         id="g79032">
+         style="opacity:0.8"
+         id="g43226-1">
         <g
-           style="display:inline;enable-background:new"
-           id="g39239-9"
-           transform="translate(-285,-131)">
+           id="g43115-6"
+           clip-path="url(#clipPath43135-6)"
+           mask="url(#mask43188-4)">
           <path
-             inkscape:export-ydpi="90"
-             inkscape:export-xdpi="90"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-             sodipodi:nodetypes="cccccc"
-             id="path39241-0"
-             d="m 756.16666,204.50001 10.33334,0 0,14.99999 -13,0 -10e-6,-11.99999 2.66667,-3 z"
-             style="fill:url(#linearGradient39254-3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;display:inline"
+             d="m -45.5,42.5 1,1 3,-1 0.75,1 1.25,0 1,1 0,2 2,2 -2,2 0,1"
+             style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path43103-4"
+             sodipodi:nodetypes="cccccccccc"
              inkscape:connector-curvature="0" />
           <path
-             style="opacity:0.3;fill:url(#radialGradient39256-2);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             d="m 756.16666,204.50001 10.33334,0 0,14.99999 -13,0 -10e-6,-11.99999 2.66667,-3 z"
-             id="path39243-2"
-             sodipodi:nodetypes="cccccc"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90"
+             sodipodi:nodetypes="cccccccccc"
+             id="path43099-0"
+             style="fill:none;stroke:#ffffff;stroke-width:1.39999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m -45.5,42.5 1,1 3,-1 0.75,1 1.25,0 1,1 0,2 2,2 -2,2 0,1"
              inkscape:connector-curvature="0" />
+        </g>
+        <g
+           mask="url(#mask43182-5)"
+           clip-path="url(#clipPath43178-6)"
+           id="g43206-6">
           <path
-             sodipodi:nodetypes="cccc"
-             d="m 754.5,209 0,9.5 m 3.5,-13 7.5,0"
-             style="fill:none;stroke:url(#linearGradient39258-9);stroke-width:1px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1;display:inline"
-             id="path39245-4"
+             d="m -45.5,42.5 1,1 3,-1 0.75,1 1.25,0 1,1 0,3 2,2 -1,1 -1,1"
+             style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path43208-1"
+             sodipodi:nodetypes="cccccccccc"
              inkscape:connector-curvature="0" />
           <path
-             style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline"
-             d="m 753,208 4,0 0,-4 -4,4 z"
-             id="path39247-4"
-             sodipodi:nodetypes="cccc"
+             sodipodi:nodetypes="cccccccccc"
+             id="path43210-8"
+             style="fill:none;stroke:#ffffff;stroke-width:1.39999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m -45.5,42.5 1,1 3,-1 0.75,1 1.25,0 1,1 0,3 2,2 -1,1 -1,1"
              inkscape:connector-curvature="0" />
+        </g>
+      </g>
+      <g
+         id="g43218-9">
+        <g
+           id="g43129-8"
+           clip-path="url(#clipPath43178-6)"
+           mask="url(#mask43182-5)">
           <path
-             inkscape:export-ydpi="90"
-             inkscape:export-xdpi="90"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-             d="m 753.5,207.00001 0,12.49999 13,0 0,-14.99999 -10.5,0 -2.5,2.5 z"
-             style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-             id="path39249-3"
-             sodipodi:nodetypes="cccccc"
+             sodipodi:nodetypes="cccccccccccccccc"
+             id="path43131-4"
+             style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m -45.5,37.5 3,0 0,1 3,0 1,-1 2,2 0,1 1,1 2,0 1,1 0,1 -1,1 0,2 2,2 0,2 -1,1"
              inkscape:connector-curvature="0" />
           <path
-             id="path39251-7"
-             d="m 757.5,206.5 0,2 -2,0"
-             style="fill:none;stroke:url(#linearGradient16151);stroke-width:1px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1"
+             d="m -45.5,37.5 3,0 0,1 3,0 1,-1 2,2 0,1 1,1 2,0 1,1 0,1 -1,1 0,2 2,2 0,2 -1,1"
+             style="fill:none;stroke:#ffffff;stroke-width:1.39999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path43133-1"
+             sodipodi:nodetypes="cccccccccccccccc"
              inkscape:connector-curvature="0" />
         </g>
+        <g
+           mask="url(#mask43188-4)"
+           clip-path="url(#clipPath43135-6)"
+           id="g43212-4">
+          <path
+             sodipodi:nodetypes="ccccccccccccccc"
+             id="path43214-3"
+             style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m -45.5,37.5 3,0 0,1 3,0 1,-1 2,2 0,1 1,1 2,0 1,1 -1,1 0,3 2,2 0,2 -1,1"
+             inkscape:connector-curvature="0" />
+          <path
+             d="m -45.5,37.5 3,0 0,1 3,0 1,-1 2,2 0,1 1,1 2,0 1,1 -1,1 0,3 2,2 0,2 -1,1"
+             style="fill:none;stroke:#ffffff;stroke-width:1.39999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="path43216-9"
+             sodipodi:nodetypes="ccccccccccccccc"
+             inkscape:connector-curvature="0" />
+        </g>
+      </g>
+      <g
+         style="display:inline;enable-background:new"
+         id="g29725-8"
+         transform="matrix(-0.3350147,0,0,0.3350147,-0.450611,-25.365697)"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90">
         <path
-           sodipodi:nodetypes="cccccccccccccccccssc"
-           inkscape:connector-curvature="0"
-           id="path52980-3"
-           d="m 481.21875,81.25 c -0.34507,-0.155271 -0.69504,-0.245578 -1.125,-0.34375 L 479.9375,79 l -1,0 -1,0 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.75 -1.75,1.75 1.75,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L 471.9375,85 l 0,1 0,1 1.90625,0.15625 c 0.092,0.4031 0.17505,0.738019 0.3125,1.0625 m 2.96875,0 C 476.47574,87.692174 476.0625,86.902037 476.0625,86 c 0,-1.58782 1.28718,-2.875 2.875,-2.875 0.94357,0 1.75793,0.454854 2.28125,1.15625"
-           style="color:#000000;fill:none;stroke:#000000;stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path29727-8"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:#320b00;stroke-width:3.58193231;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:type="arc"
+           transform="matrix(0.75,0,0,0.75,29.5,135)" />
         <path
-           inkscape:connector-curvature="0"
-           id="path52982-4"
-           d="m 477.9375,79 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.5 -1.5,1.5 1.5,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L 471.9375,85 l 0,1 0,1 1.90625,0.15625 c 0.0981,0.429533 0.18992,0.780253 0.34375,1.125 l 2.8125,0 C 476.34893,87.730943 475.9375,86.919238 475.9375,86 c 0,-1.65685 1.34315,-3 3,-3 0.96105,0 1.7947,0.453338 2.34375,1.15625 l 0,-2.875 c -0.36595,-0.173211 -0.73124,-0.270823 -1.1875,-0.375 L 479.9375,79 l -1,0 -1,0 z m 3.34375,8.8125 c -0.12902,0.1662 -0.24569,0.333041 -0.40625,0.46875 l 0.40625,0 0,-0.46875 z"
-           style="color:#000000;fill:url(#linearGradient79029);fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           sodipodi:type="arc"
+           style="opacity:0.6;fill:url(#linearGradient24210-1);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           id="path29729-0"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           transform="matrix(-0.6011908,-0.06817113,0.06852359,-0.6012277,199.77148,303.44348)" />
         <path
-           sodipodi:nodetypes="cssc"
-           inkscape:connector-curvature="0"
-           id="rect52986-8"
-           d="M 481.28125,83.40625 C 480.661,82.839183 479.84801,82.5 478.9375,82.5 c -1.93397,0 -3.5,1.566029 -3.5,3.5 0,0.881253 0.34008,1.6682 0.875,2.28125"
-           style="fill:none;stroke:url(#linearGradient79025);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           transform="matrix(0.4463965,0,0,0.4463971,69.575658,170.82515)"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path29731-8"
+           style="opacity:0.7;fill:none;stroke:url(#linearGradient24212-8);stroke-width:6.6867547;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           sodipodi:type="arc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+      </g>
+    </g>
+    <g
+       transform="translate(0,336)"
+       style="display:inline;enable-background:new"
+       id="g21835-7">
+      <g
+         transform="translate(51,10)"
+         style="opacity:0.8"
+         id="g44612-7">
+        <rect
+           transform="scale(1,-1)"
+           style="opacity:0;fill:#666666;stroke:none;stroke-width:2.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect44610-8"
+           width="16"
+           height="16"
+           x="-46"
+           y="-16" />
+        <g
+           id="g44566-3"
+           transform="translate(0,22)">
+          <g
+             transform="translate(0,0.02014865)"
+             inkscape:transform-center-x="6.4341195"
+             id="g44395-8">
+            <g
+               id="g44383-3"
+               inkscape:transform-center-x="6.4130439"
+               style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+            <g
+               inkscape:transform-center-x="6.4130439"
+               id="g44315-7" />
+          </g>
+          <g
+             id="g44401-1"
+             inkscape:transform-center-x="-6.4341194"
+             transform="matrix(-1,0,0,-1,-76,-27.947857)">
+            <g
+               style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:transform-center-x="6.4130439"
+               id="g44403-0" />
+            <g
+               id="g44407-7"
+               inkscape:transform-center-x="6.4130439" />
+          </g>
+          <g
+             inkscape:transform-center-y="-6.3979735"
+             id="g44425-3"
+             transform="matrix(0,1,-1,0,-51.984003,24.036146)">
+            <g
+               style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               inkscape:transform-center-x="6.4130439"
+               id="g44427-4" />
+            <g
+               id="g44431-9"
+               inkscape:transform-center-x="6.4130439" />
+          </g>
+          <g
+             inkscape:transform-center-y="6.4702655"
+             transform="matrix(0,-1,1,0,-24.015997,-51.963854)"
+             id="g44435-6">
+            <g
+               id="g44437-5"
+               inkscape:transform-center-x="6.4130439"
+               style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+            <g
+               inkscape:transform-center-x="6.4130439"
+               id="g44441-1" />
+          </g>
+          <g
+             inkscape:transform-center-y="-4.4797485"
+             id="g44532-0">
+            <g
+               inkscape:transform-center-y="-4.4797485"
+               id="g44511-9"
+               transform="matrix(-0.7071068,0.7071068,-0.7071068,-0.7071068,-74.7838,3.0074334)"
+               inkscape:transform-center-x="-4.4797485">
+              <g
+                 style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+                 inkscape:transform-center-x="6.4130439"
+                 id="g44514-9" />
+              <g
+                 id="g44518-6"
+                 inkscape:transform-center-x="6.4130439" />
+            </g>
+            <g
+               inkscape:transform-center-x="4.4797488"
+               transform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,-20.992567,22.7838)"
+               id="g44522-8"
+               inkscape:transform-center-y="-4.4797486">
+              <g
+                 id="g44524-3"
+                 inkscape:transform-center-x="6.4130439"
+                 style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+              <g
+                 inkscape:transform-center-x="6.4130439"
+                 id="g44528-4" />
+            </g>
+          </g>
+          <g
+             transform="matrix(-1,0,0,-1,-75.995432,-28)"
+             id="g44544-8"
+             inkscape:transform-center-y="4.4797485">
+            <g
+               inkscape:transform-center-x="-4.4797485"
+               transform="matrix(-0.7071068,0.7071068,-0.7071068,-0.7071068,-74.7838,3.0074334)"
+               id="g44546-4"
+               inkscape:transform-center-y="-4.4797485">
+              <g
+                 id="g44548-9"
+                 inkscape:transform-center-x="6.4130439"
+                 style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+              <g
+                 inkscape:transform-center-x="6.4130439"
+                 id="g44552-9" />
+            </g>
+            <g
+               inkscape:transform-center-y="-4.4797486"
+               id="g44556-2"
+               transform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,-20.992567,22.7838)"
+               inkscape:transform-center-x="4.4797488">
+              <g
+                 style="fill:none;stroke:#000000;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+                 inkscape:transform-center-x="6.4130439"
+                 id="g44558-5">
+                <path
+                   d="m 139.82809,116.3993 c 0.21326,1.04297 0.21596,2.11803 0.008,3.16206 m -6.21068,6.20286 c -1.04294,0.21326 -2.11797,0.21596 -3.16197,0.008 m -6.20664,-6.20689 c -0.21326,-1.04297 -0.21596,-2.11803 -0.008,-3.16206 m 6.21068,-6.20286 c 1.04294,-0.21326 2.11797,-0.21596 3.16196,-0.008 m 5.10366,12.24081 c -0.58667,0.88829 -1.34493,1.65039 -2.23019,2.24157 m -11.07625,-11.07658 c 0.58667,-0.88829 1.34492,-1.65038 2.23019,-2.24157 m 8.8404,0.006 c 0.88827,0.58669 1.65034,1.34497 2.24151,2.23026 m -11.07626,11.07657 c -0.88826,-0.58669 -1.65033,-1.34496 -2.2415,-2.23025"
+                   style="stroke:#000000;stroke-width:3.44192362;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+                   transform="matrix(-0.8135104,0,0,-0.8134867,69.383376,81.991427)"
+                   id="path44560-5"
+                   inkscape:connector-curvature="0" />
+              </g>
+              <g
+                 id="g44562-3"
+                 inkscape:transform-center-x="6.4130439">
+                <path
+                   d="m 139.86607,116.59777 c 0.16588,0.93061 0.16532,1.88326 -0.002,2.81367 m -6.43712,6.39076 c -0.93059,0.16588 -1.88321,0.16532 -2.81359,-0.002 m -6.39454,-6.43334 c -0.16588,-0.93061 -0.16532,-1.88326 0.002,-2.81367 m 6.43712,-6.39076 c 0.93058,-0.16588 1.88321,-0.16532 2.81359,0.002 m 5.25357,12.26879 c -0.58667,0.88829 -1.34493,1.65039 -2.23019,2.24157 m -11.07625,-11.07658 c 0.58667,-0.88829 1.34492,-1.65038 2.23019,-2.24157 m 8.8404,0.006 c 0.88827,0.58669 1.65034,1.34497 2.24151,2.23026 m -11.07626,11.07657 c -0.88826,-0.58669 -1.65033,-1.34496 -2.2415,-2.23025"
+                   style="fill:none;stroke:#ffffff;stroke-width:1.72096181;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+                   transform="matrix(-0.8135104,0,0,-0.8134867,69.383376,81.991427)"
+                   id="path44564-3"
+                   inkscape:connector-curvature="0" />
+              </g>
+            </g>
+          </g>
+        </g>
+      </g>
+      <g
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         transform="matrix(0.4200287,0,0,0.4200289,-40.97369,-75.87647)"
+         id="g45379-3"
+         style="display:inline;enable-background:new">
         <path
-           sodipodi:nodetypes="ccccccccccccc"
-           inkscape:connector-curvature="0"
-           id="path52988-6"
-           d="m 476.4375,81.75 c 0.49914,-0.213 1.64896,-0.6698 2,-0.75 l 0,-0.75 0,-0.75 1,0 m -5.25,1.25 -0.5,0.5 z m 0.5,2.75 c -0.20864,0.49552 -0.6715,1.65605 -0.75,2 l -0.75,0 -0.75,0 0,1"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
+           transform="matrix(0.75,0,0,0.75,29.5,135)"
+           sodipodi:type="arc"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:#2b0000;stroke-width:2.5395081;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           id="path45381-7"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
         <path
-           inkscape:connector-curvature="0"
+           transform="matrix(-0.6011908,-0.06817113,0.06852359,-0.6012277,199.77148,303.44348)"
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           style="fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           d="m 473.43328,81.74394 1.25,-1.25"
-           id="path52990-8"
-           sodipodi:nodetypes="cc" />
-        <path
-           sodipodi:nodetypes="cssc"
-           inkscape:connector-curvature="0"
-           id="rect52992-4"
-           d="M 481.28125,83.40625 C 480.661,82.839183 479.84801,82.5 478.9375,82.5 c -1.93397,0 -3.5,1.566029 -3.5,3.5 0,0.881253 0.34008,1.6682 0.875,2.28125"
-           style="opacity:0.4;fill:none;stroke:url(#linearGradient79020);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path45383-4"
+           style="fill:url(#linearGradient24214-1);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           sodipodi:type="arc" />
         <path
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           d="m 468.49796,75.999224 0,12.49999 13,0 0,-14.99999 -10.5,0 -2.5,2.5 z"
-           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           id="path39249-3-7"
-           sodipodi:nodetypes="cccccc"
-           inkscape:connector-curvature="0" />
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:type="arc"
+           style="opacity:0.6;fill:none;stroke:url(#linearGradient24216-4);stroke-width:5.33335066;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           id="path45385-3"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           transform="matrix(0.4463965,0,0,0.4463971,69.575658,170.82515)" />
       </g>
     </g>
     <g
-       transform="translate(-42.000002,-84)"
        style="display:inline;enable-background:new"
-       id="g81158-5">
-      <rect
-         y="325"
-         x="299"
-         height="16"
-         width="16.000002"
-         id="rect44300-0-5-3-4"
-         style="opacity:0;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+       id="g45967-8"
+       transform="translate(198,390)">
       <g
-         id="g81149-2">
-        <path
-           sodipodi:nodetypes="cssssssssssssssscssc"
-           inkscape:connector-curvature="0"
-           id="path41299-1-2-7-4-0"
-           d="m 306.46211,325.45009 c -1.82601,0 -3.30699,1.48105 -3.30699,3.30711 0,0.25952 0.0379,0.51035 0.087,0.75425 0.18833,0.93505 0.24637,1.73179 -0.11603,2.43677 -0.32404,0.63034 -0.67881,0.97731 -1.45039,1.27638 -1.27734,0.49511 -2.17564,1.6304 -2.17564,3.04602 0,0.7411 0.24647,1.42826 0.6672,1.97265 0.21236,0.27479 0.1962,0.24789 0.29008,0.34806 0.60044,0.64074 1.56724,0.98341 2.29168,0.95729 0.74932,-0.027 1.28404,-0.28854 1.8855,-0.60911 0.58287,-0.31066 0.97831,-0.70633 1.82755,-0.69624 0.70498,0.008 1.33214,0.39548 1.88546,0.75426 0.55206,0.35795 1.29426,0.55886 1.8275,0.55114 1.8258,-0.0264 3.30697,-1.48104 3.30697,-3.30711 0,-1.23932 -0.68675,-2.33495 -1.71151,-2.87196 -0.78932,-0.41364 -1.71989,-0.83441 -2.11757,-1.47945 -0.44817,-0.72695 0.029,-2.46582 0.029,-2.46582 0.0441,-0.21523 0.087,-0.43896 0.087,-0.66722 0,-1.82606 -1.48098,-3.30711 -3.30698,-3.30711 z"
-           style="fill:url(#linearGradient80406-8);fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.89999998;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         mask="url(#mask45447-7)"
+         transform="translate(-261,-409)"
+         id="g15201-1-0"
+         style="opacity:0.8;display:inline;enable-background:new">
+        <rect
+           y="365"
+           x="215"
+           height="16"
+           width="16"
+           id="rect15183-3-8"
+           style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <g
+           transform="translate(167.99999,-62.999991)"
+           id="g15185-8-8">
+          <rect
+             ry="0"
+             style="fill:#ececec;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect15187-7-0"
+             width="13.016124"
+             height="12.953857"
+             x="48.499996"
+             y="429.54614" />
+          <rect
+             y="430"
+             x="50.016117"
+             height="11.046139"
+             width="11.000001"
+             id="rect15189-4-6"
+             style="fill:url(#linearGradient24218-1);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00207269;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             ry="0" />
+          <path
+             style="fill:url(#linearGradient24220-5);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             d="m 49,430 0,3 3,0 0,-3 -3,0 z m 3,3 0,3 3,0 0,-3 -3,0 z m 3,0 3,0 0,-3 -3,0 0,3 z m 3,0 0,3 3,0 0,-3 -3,0 z m 0,3 -3,0 0,3 3,0 0,-3 z m 0,3 0,3 3,0 0,-3 -3,0 z m -3,0 -3,0 0,3 3,0 0,-3 z m -3,0 0,-3 -3,0 0,3 3,0 z"
+             id="path15191-2-8"
+             sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccc"
+             inkscape:connector-curvature="0" />
+          <path
+             style="fill:none;stroke:url(#linearGradient24222-6);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+             d="m 60.517703,430.5 -11.017704,0 0,11 11.017704,0 0,-11"
+             id="path15193-7-1"
+             sodipodi:nodetypes="ccc"
+             inkscape:connector-curvature="0" />
+          <rect
+             y="429.54614"
+             x="48.499996"
+             height="12.953857"
+             width="13.016124"
+             id="rect45403-9"
+             style="fill:url(#radialGradient24224-0);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             ry="0" />
+        </g>
+      </g>
+      <g
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         transform="matrix(0.4200287,0,0,0.4200289,-86.973687,-124.87647)"
+         id="g45391-8"
+         style="display:inline;enable-background:new">
         <path
-           sodipodi:nodetypes="cscsscc"
-           inkscape:connector-curvature="0"
-           id="path15475-1-1-9"
-           d="m 306.46211,326.3494 c -1.34707,0 -2.40772,1.06069 -2.40772,2.4078 0,0.17324 0.0147,0.36498 0.058,0.5802 0.2006,0.99599 0.30102,2.03645 -0.20306,3.017 -0.3838,0.74661 -1.01301,1.33313 -1.91455,1.68257 -0.98238,0.38077 -1.59548,1.19286 -1.59548,2.23374 0.0793,1.22982 0.59501,1.65939 1.12899,2.05552"
-           style="fill:none;stroke:url(#linearGradient80403-6);stroke-width:0.99999988;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+           transform="matrix(0.75,0,0,0.75,29.5,135)"
+           sodipodi:type="arc"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:#2b0000;stroke-width:2.5395081;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path45393-9"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
         <path
-           d="m 306.5,333.5 -4,3 m 4,-3 4,3 m -4,-8 0,5"
-           style="fill:none;stroke:#acc1f5;stroke-width:2.29999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           id="path16558"
-           inkscape:connector-curvature="0" />
+           transform="matrix(-0.6011908,-0.06817113,0.06852359,-0.6012277,199.77148,303.44348)"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path45395-7"
+           style="fill:url(#linearGradient24226-2);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           sodipodi:type="arc" />
         <path
-           inkscape:connector-curvature="0"
-           id="path15730-0-3-9-7"
-           style="fill:none;stroke:#474747;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 306.5,333.5 -4,3 m 4,-3 4,3 m -4,-8 0,5" />
-        <rect
-           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
-           id="rect16285-9-59-6-8-3"
-           width="2.0172396"
-           height="2.0000157"
-           x="305.48901"
-           y="327.52499" />
-        <rect
-           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
-           id="rect16285-9-59-6-82-7"
-           width="2.0172396"
-           height="2.0000157"
-           x="301.52026"
-           y="335.49374" />
-        <rect
-           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
-           id="rect16285-9-59-6-9-2"
-           width="2.0172396"
-           height="2.0000157"
-           x="309.49374"
-           y="335.49374" />
-        <rect
-           style="fill:#d7e3f4;fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.5;display:inline;enable-background:new"
-           id="rect16285-9-59-6-1-6"
-           width="2.0172396"
-           height="2.0000157"
-           x="305.52499"
-           y="332.52499" />
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:type="arc"
+           style="opacity:0.75;fill:none;stroke:url(#linearGradient24228-5);stroke-width:5.33335066;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           id="path45397-2"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           transform="matrix(0.4463965,0,0,0.4463971,69.575658,170.82515)" />
       </g>
     </g>
-    <path
-       sodipodi:type="arc"
-       style="fill:none;stroke:#000000;stroke-width:0.9560194;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-       id="path81543"
-       sodipodi:cx="478.90625"
-       sodipodi:cy="86.03125"
-       sodipodi:rx="2.34375"
-       sodipodi:ry="2.34375"
-       d="m 478.63139,88.358828 a 2.34375,2.34375 0 1 1 2.61786,-2.38697"
-       transform="matrix(1.0460001,0,0,1.0460077,-22.029739,-4.0047766)"
-       sodipodi:start="1.6883393"
-       sodipodi:end="6.2578421"
-       sodipodi:open="true" />
     <g
        style="display:inline;enable-background:new"
-       id="g16724-8-3">
+       id="g43252-2"
+       transform="matrix(-1,0,0,1,16.999998,490)">
       <rect
-         y="598"
-         x="152"
-         height="16"
+         transform="scale(1,-1)"
+         style="opacity:0;fill:#666666;stroke:none;stroke-width:2.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect45977-5-8"
          width="16"
-         id="rect38813-3-2"
-         style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         height="16"
+         x="-46"
+         y="128" />
       <g
-         transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,76.587007,362.72598)"
-         id="g10876-8-5-8-64-4"
-         style="display:inline;enable-background:new">
+         mask="url(#mask45865-7)"
+         style="opacity:0.95"
+         id="g45749-2">
         <path
-           style="fill:url(#linearGradient16663-3-0-8);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           d="m 226.05286,111.6246 3.53553,0 1e-5,-3.53553 2.82843,0 0,3.53553 3.53553,0 -1e-5,2.82843 -3.53553,0 0,3.53553 -2.82843,0 0,-3.53553 -3.53553,0 z"
-           id="path10878-4-0-1-4-6"
-           sodipodi:nodetypes="ccccccccccccc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
+           sodipodi:nodetypes="cssssssc"
+           id="path45716-8"
+           d="m -37.991001,-135.06482 c -0.756259,0.48145 -1.648418,-0.21174 -1.880274,-0.94014 -0.414735,-1.30293 0.637877,-2.55676 1.880274,-2.82041 1.823267,-0.38691 3.481311,1.06592 3.760547,2.82041 0.372178,2.33846 -1.494127,4.41212 -3.760547,4.70069 -2.852058,0.36313 -5.346025,-1.9223 -5.640821,-4.70069 -0.357038,-3.365 2.346435,-6.33509 5.640821,-6.58096 3.825581,-0.28552 7.055689,2.67913 7.813138,6.13556"
+           style="fill:none;stroke:#000000;stroke-width:2.77754736;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           transform="matrix(0.6590823,0.8571222,-0.8500307,0.6645808,-129.57187,-12.997286)"
            inkscape:connector-curvature="0" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path16661-5-1-6"
-           d="m 235.06847,113.56915 0,-1.06066"
-           style="fill:none;stroke:#d4d4d4;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+           transform="matrix(0.6590823,0.8571222,-0.8500307,0.6645808,-129.57187,-12.997286)"
+           style="fill:none;stroke:#ffffff;stroke-width:1.1110189;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           d="m -37.991001,-135.06482 c -0.756259,0.48145 -1.648418,-0.21174 -1.880274,-0.94014 -0.414735,-1.30293 0.637877,-2.55676 1.880274,-2.82041 1.823267,-0.38691 3.481311,1.06592 3.760547,2.82041 0.372178,2.33846 -1.494127,4.41212 -3.760547,4.70069 -2.852058,0.36313 -5.346025,-1.9223 -5.640821,-4.70069 -0.357038,-3.365 2.346435,-6.33509 5.640821,-6.58096 3.825581,-0.28552 7.055689,2.67913 7.813138,6.13556"
+           id="path45712-9"
+           sodipodi:nodetypes="cssssssc"
+           inkscape:connector-curvature="0" />
+      </g>
+      <g
+         style="display:inline;enable-background:new"
+         id="g29693-0"
+         transform="matrix(-1,0,0,1,-78.286205,4.2655334)">
+        <rect
+           rx="1.4999387"
+           ry="1.4999387"
+           y="-141.76553"
+           x="-39.799313"
+           height="3"
+           width="2.9998772"
+           id="rect29695-7"
+           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#5a0d00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path16659-5-9-6"
-           d="m 230.47227,114.62981 0,2.47487"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           id="path29697-8"
+           d="m -37.299433,-141.26553 -1.999997,1e-5 0,1.99999 1.999997,-10e-6 0,-1.99999 z"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000072;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           sodipodi:nodetypes="ccccc"
+           inkscape:connector-curvature="0" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path16657-8-5-2"
-           d="m 230.47227,108.97295 0,2.47488"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+           id="path29699-1"
+           d="m -38.799427,-139.76553 0,-1 0.999994,0"
+           style="opacity:0.45;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline;enable-background:new"
+           inkscape:connector-curvature="0" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path10880-7-5-7-5-9"
-           d="m 226.93674,112.50849 0,1.06066"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+           sodipodi:nodetypes="ccccc"
+           style="opacity:0.4;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000072;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -38.29943,-141.26553 -1,1e-5 0,0.99999 1,0 0,-1 z"
+           id="path29701-5"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
       </g>
     </g>
     <g
-       transform="translate(252,21)"
        style="display:inline;enable-background:new"
-       id="g16724-8-1">
+       id="g45137-8"
+       transform="translate(156,308)">
       <rect
-         y="598"
-         x="152"
-         height="16"
+         transform="scale(1,-1)"
+         style="opacity:0;fill:#666666;stroke:none;stroke-width:2.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect46015-6"
          width="16"
-         id="rect38813-3-1"
-         style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         height="16"
+         x="-46"
+         y="-54" />
       <g
-         transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,76.587007,362.72598)"
-         id="g10876-8-5-8-64-9"
-         style="display:inline;enable-background:new">
-        <path
-           style="fill:url(#linearGradient16663-3-0-0);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-           d="m 224.63864,111.6246 4.94975,0 0,-4.94974 2.82843,0 1e-5,4.94974 4.94973,0 -1e-5,2.82843 -4.94973,0 0,4.94975 -2.82843,0 0,-4.94975 -4.94975,0 z"
-           id="path10878-4-0-1-4-9"
-           sodipodi:nodetypes="ccccccccccccc"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
-           inkscape:connector-curvature="0" />
-        <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path16661-5-1-5"
-           d="m 236.48268,113.56915 0,-1.06066"
-           style="fill:none;stroke:#d4d4d4;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-        <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path16659-5-9-5"
-           d="m 230.47227,114.62981 0,3.88908"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-        <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path16657-8-5-5"
-           d="m 230.47227,107.55874 0,3.88909"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-        <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path10880-7-5-7-5-6"
-           d="m 225.52253,112.50849 0,1.06066"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+         id="g45118-1">
+        <g
+           id="g45099-2"
+           transform="translate(0,6.9866005)">
+          <g
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+             transform="matrix(0.6645615,0,0,0.6645596,-126.90026,-106.03317)"
+             id="g37580-2-4"
+             style="display:inline;enable-background:new">
+            <path
+               transform="matrix(0.75,0,0,0.75,29.5,135)"
+               sodipodi:type="arc"
+               style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:#2b0000;stroke-width:1.60507059;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+               id="path37582-3-2"
+               sodipodi:cx="132"
+               sodipodi:cy="118"
+               sodipodi:rx="8"
+               sodipodi:ry="8"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               inkscape:export-xdpi="90"
+               inkscape:export-ydpi="90" />
+            <path
+               transform="matrix(-0.683022,-0.07745026,0.0778507,-0.683064,209.4726,314.325)"
+               inkscape:export-ydpi="90"
+               inkscape:export-xdpi="90"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               sodipodi:ry="8"
+               sodipodi:rx="8"
+               sodipodi:cy="118"
+               sodipodi:cx="132"
+               id="path37584-3-5"
+               style="opacity:0.6;fill:url(#linearGradient24230-5);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+               sodipodi:type="arc" />
+            <path
+               inkscape:export-ydpi="90"
+               inkscape:export-xdpi="90"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+               sodipodi:type="arc"
+               style="opacity:0.7;fill:none;stroke:url(#linearGradient24232-9);stroke-width:2.66303396;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+               id="path38120-7-4-8"
+               sodipodi:cx="132"
+               sodipodi:cy="118"
+               sodipodi:rx="8"
+               sodipodi:ry="8"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               transform="matrix(0.5650525,0,0,0.5650532,53.91307,156.82373)" />
+          </g>
+          <g
+             style="opacity:0.5;fill:#ffd5d5"
+             id="g45083-6">
+            <rect
+               ry="0.88169974"
+               rx="0.88169974"
+               y="42.25"
+               x="-44"
+               height="1.7633995"
+               width="5.5"
+               id="rect45079-2"
+               style="fill:#ffd5d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000083;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" />
+            <rect
+               ry="0.875"
+               rx="0.97123623"
+               style="fill:#ffd5d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000083;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+               id="rect45081-6"
+               width="5.5"
+               height="1.75"
+               x="40"
+               y="40"
+               transform="matrix(0,1,-1,0,0,0)" />
+          </g>
+          <rect
+             y="41.986599"
+             x="-44.006248"
+             height="1.0133995"
+             width="5.0062485"
+             id="rect45067-5"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000083;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" />
+          <rect
+             transform="matrix(0,-1,1,0,0,0)"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000083;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+             id="rect45069-3"
+             width="4.9865952"
+             height="1.0133995"
+             x="-44.986595"
+             y="-42.009823" />
+        </g>
+        <g
+           id="g45110-9"
+           transform="translate(0,-6.986599)">
+          <g
+             style="display:inline;enable-background:new"
+             id="g44887-2"
+             transform="matrix(0.6610822,0,0,0.6610806,-119.47405,-98.276513)"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90">
+            <path
+               inkscape:export-ydpi="90"
+               inkscape:export-xdpi="90"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               sodipodi:ry="8"
+               sodipodi:rx="8"
+               sodipodi:cy="118"
+               sodipodi:cx="132"
+               id="path44889-4"
+               style="fill:#f2f2f2;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.61351788;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+               sodipodi:type="arc"
+               transform="matrix(0.75,0,0,0.75,29.5,135)" />
+            <path
+               sodipodi:type="arc"
+               style="fill:url(#linearGradient24234-7);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+               id="path44891-6"
+               sodipodi:cx="132"
+               sodipodi:cy="118"
+               sodipodi:rx="8"
+               sodipodi:ry="8"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               inkscape:export-xdpi="90"
+               inkscape:export-ydpi="90"
+               transform="matrix(-0.683022,-0.07745026,0.0778507,-0.683064,209.4726,314.325)" />
+            <path
+               transform="matrix(0.5719769,0,0,0.5719777,52.999044,156.00665)"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               sodipodi:ry="8"
+               sodipodi:rx="8"
+               sodipodi:cy="118"
+               sodipodi:cx="132"
+               id="path44893-1"
+               style="opacity:0.5;fill:none;stroke:#ffffff;stroke-width:2.64463997;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+               sodipodi:type="arc"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+               inkscape:export-xdpi="90"
+               inkscape:export-ydpi="90" />
+          </g>
+          <rect
+             ry="1.0066998"
+             rx="1.0066998"
+             y="49"
+             x="-37"
+             height="2.0133996"
+             width="5.5"
+             id="rect45087-8"
+             style="opacity:0.7;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000083;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" />
+          <rect
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000083;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+             id="rect45077-2"
+             width="5.0062485"
+             height="1.0133995"
+             x="-37.006248"
+             y="48.986599" />
+        </g>
       </g>
     </g>
     <g
-       id="g106636"
-       transform="translate(0.1767767,0.13258252)">
-      <path
-         inkscape:connector-curvature="0"
-         sodipodi:nodetypes="cccccccc"
-         id="path45378-1-5-6-2-9"
-         d="m 263.5625,590.375 1.75,-1.5 1.99177,3.7253 1.75,-1 -1.74177,-3.4753 2.5,0 -6.25,-6.25 z"
-         style="fill:url(#linearGradient106641);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <path
-         sodipodi:nodetypes="cccccccc"
-         inkscape:connector-curvature="0"
-         id="path17835-7-2-5"
-         d="m 263.3125,581.125 7,7.25 -3,0 1.69346,3.25845 -1.75,1 -1.69346,-3.50845 -2.25,2.25 z"
-         style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-      <path
-         sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0"
-         id="path17845-9-1-1"
-         d="m 264.15625,583.375 0,5.75"
-         style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-    </g>
-    <g
-       transform="translate(0.02855492,0)"
        style="display:inline;enable-background:new"
-       id="g15868-5">
+       id="g24618-1"
+       transform="translate(168,176)">
       <rect
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect18695-6-9-6"
-         width="15.971445"
-         height="16.000002"
-         x="110"
-         y="241" />
+         ry="0"
+         rx="0"
+         y="170"
+         x="5"
+         height="16"
+         width="16"
+         id="rect42080-1"
+         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         id="g15853-0">
+         mask="url(#mask43040-7)"
+         transform="translate(51.040182,194)"
+         id="g42934-9">
         <path
-           sodipodi:nodetypes="ccccc"
-           id="path15095-5"
-           d="m 117.9106,247.99675 0.007,7.98875 -5.98631,-3.26708 -0.0121,-7.34356 z"
-           style="opacity:0.63859648;fill:url(#radialGradient15836-5);fill-opacity:1;stroke:none"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:nodetypes="csc"
+           id="path42084-7"
+           d="m -43,-12 c 4.5365,0 10.5,-1.75 10.5,-6 0,-1.75 -1.25,-4 -5.5,-4"
+           style="fill:none;stroke:#3c0800;stroke-width:3.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
            inkscape:connector-curvature="0" />
+        <rect
+           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#3c0800;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect42088-6"
+           width="2.9998772"
+           height="3"
+           x="-39.499878"
+           y="-23.5"
+           ry="1.4999387"
+           rx="1.4999387" />
+        <rect
+           rx="1.4999387"
+           ry="1.4999387"
+           y="-13.5"
+           x="-44.499878"
+           height="3"
+           width="2.9998772"
+           id="rect42092-2"
+           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#5a0d00;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
         <path
-           sodipodi:nodetypes="ccccccc"
-           id="path18719-6-9-0"
-           d="m 117.94049,242.95683 -5.85545,2.34692 6.10637,2.4934 -0.17358,8.22275 6.00064,-3.2989 0.0442,-7.36753 z"
-           style="fill:url(#linearGradient15851-6);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           style="fill:none;stroke:#ed5e32;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -43,-12 c 4.5365,0 10.5,-1.75 10.5,-6 0,-1.75 -1.25,-4 -5.5,-4"
+           id="path42142-9"
+           sodipodi:nodetypes="csc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
            inkscape:connector-curvature="0" />
-        <g
-           id="g18703-4-7-7"
-           transform="matrix(1.2133883,0,0,1.2133883,-65.271004,156.45833)">
-          <path
-             id="path18707-3-8-5"
-             d="m 146.0019,73.295281 5,-2.007976 5,2.007976 -5,2.073959 z"
-             style="fill:url(#linearGradient15818-5);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             sodipodi:nodetypes="ccccc"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90"
-             inkscape:connector-curvature="0" />
-        </g>
         <path
-           id="path18763-2-5-8"
-           d="m 124.01757,245.38766 -6.11113,2.33515 0.39771,8.10095 5.71891,-3.11585 z"
-           style="fill:url(#linearGradient15846-4);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline"
-           sodipodi:nodetypes="ccccc"
+           style="fill:none;stroke:url(#linearGradient24236-2);stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -43,-12 c 4.5365,0 10.5,-1.75 10.5,-6 0,-1.75 -1.25,-4 -5.5,-4"
+           id="path42140-5"
+           sodipodi:nodetypes="csc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
            inkscape:connector-curvature="0" />
         <path
-           sodipodi:nodetypes="ccccc"
-           id="path18709-1-1-0"
-           d="m 114.36329,244.98044 3.58667,-1.46751 5.56035,2.22692 0.0356,6.65202 -4.34973,2.45342"
-           style="fill:none;stroke:url(#linearGradient15843-2);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           id="path42094-2"
+           d="m -42,-13 c -0.67541,0 -1.35081,10e-6 -2.02623,10e-6 0,0.66939 0,1.33877 0,2.00817 0.67542,0 1.35082,-10e-6 2.02623,-10e-6 0,-0.66939 0,-1.33878 0,-2.00817 z"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000072;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
            inkscape:connector-curvature="0" />
-        <g
-           id="g18737-4-8-8"
-           style="opacity:0.7"
-           transform="matrix(1.2133883,0,0,1.2133883,-282.46751,373.65484)" />
         <path
-           sodipodi:nodetypes="ccccccccccc"
-           inkscape:connector-curvature="0"
-           id="path15957-6"
-           d="m 118.29703,256.35166 5.94799,-3.23942 c 0.0419,-0.0185 0.0806,-0.0443 0.11369,-0.0758 0.0689,-0.0703 0.11042,-0.16699 0.1137,-0.26543 l -0.0379,-7.432 c 10e-4,-0.16462 -0.1103,-0.32426 -0.26543,-0.37919 l -6.06694,-2.42677 c -0.0474,-0.0224 -0.0992,-0.0354 -0.15167,-0.0379 l 1.2e-4,0 c -0.0524,0.002 -0.10423,0.0154 -0.15167,0.0379 l -5.53168,2.30782"
-           style="fill:none;stroke:#0b1728;stroke-width:0.89999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+           style="fill:#ff8d69;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000072;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -37,-23 c -0.65334,0 -1.30668,10e-6 -1.96003,10e-6 0,0.66667 0,1.33332 0,1.99999 0.65335,0 1.30669,-10e-6 1.96003,-10e-6 0,-0.66666 0,-1.33332 0,-1.99999 z"
+           id="path42096-0"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
         <path
-           sodipodi:type="inkscape:offset"
-           inkscape:radius="0.4429636"
-           inkscape:original="M 111.90625 245.375 L 111.9375 252.71875 L 117.90625 256 L 117.90625 248 L 111.90625 245.375 z "
-           style="fill:none;stroke:url(#linearGradient16730);stroke-width:0.89999998;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           id="path16571-2"
-           d="m 111.78125,244.9375 a 0.4430079,0.4430079 0 0 0 -0.3125,0.4375 l 0.0312,7.34375 a 0.4430079,0.4430079 0 0 0 0.21875,0.375 l 5.96875,3.28125 A 0.4430079,0.4430079 0 0 0 118.34375,256 l 0,-8 a 0.4430079,0.4430079 0 0 0 -0.25,-0.40625 l -6,-2.625 a 0.4430079,0.4430079 0 0 0 -0.3125,-0.0312 z" />
+           style="opacity:0.6;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+           d="m -38.5,-21.5 0,-1 1,0"
+           id="path42098-0"
+           inkscape:connector-curvature="0" />
         <path
-           inkscape:connector-curvature="0"
-           style="fill:none;stroke:url(#linearGradient16562-7);stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 117.31869,255.08504 -4.89325,-2.67466 -0.0154,-6.1798"
-           id="path16560-5"
-           sodipodi:nodetypes="ccc" />
+           id="path42100-3"
+           d="m -43.52623,-11.5 0,-1 1,0"
+           style="opacity:0.6;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+           inkscape:connector-curvature="0" />
         <path
-           style="opacity:0.75333408;fill:none;stroke:url(#linearGradient15773-7);stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:0.38888891"
-           d="m 112.44393,252.43208 3.76322,-1.57568"
-           id="path15671-3"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           id="path42102-9"
+           d="m -36,-20.48792 c -0.32001,0 -0.64002,-10e-6 -0.96003,-10e-6 0,-0.63982 0,-1.27964 0,-1.91948 0.32001,0 0.64002,10e-6 0.96003,10e-6 0,0.63983 0,1.27966 0,1.91948 z"
+           style="opacity:0.15;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           inkscape:connector-curvature="0" />
+        <path
+           style="opacity:0.5;fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000072;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -40.999878,-11 c -0.32001,0 -0.64002,0 -0.96003,0 0,-0.21055 0,-0.42107 0,-0.63162 0.32001,0 0.64002,0 0.96003,0 0,0.21055 0,0.42107 0,0.63162 z"
+           id="path42104-1"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
+        <path
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           id="path42106-8"
+           d="m -40.999878,-11.33707 c -0.32001,0 -0.64002,-10e-6 -0.96003,-10e-6 0,-0.55431 0,-1.1086 0,-1.66292 0.32001,0 0.64002,10e-6 0.96003,10e-6 0,0.55431 0,1.10861 0,1.66292 z"
+           style="opacity:0.25;fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000072;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           inkscape:connector-curvature="0" />
+      </g>
+      <g
+         style="display:inline;enable-background:new"
+         id="g44965-1"
+         transform="matrix(0.5000262,0,0,0.5000067,-54.73874,70.74849)"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         inkscape:export-xdpi="90"
+         inkscape:export-ydpi="90">
+        <path
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path44967-9"
+           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.13326335;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           sodipodi:type="arc"
+           transform="matrix(0.75,0,0,0.75,29.5,135)" />
+        <path
+           sodipodi:type="arc"
+           style="fill:url(#linearGradient24239-1);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           id="path44969-5"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           transform="matrix(-0.683022,-0.07745026,0.0778507,-0.683064,209.4726,314.325)" />
+        <path
+           transform="matrix(0.4963171,0,0,0.4963178,62.986138,164.93452)"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path44971-3"
+           style="opacity:0.5;fill:none;stroke:#ffffff;stroke-width:4.0295496;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           sodipodi:type="arc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
       </g>
     </g>
-    <path
-       d="m -220,198.65625 -5.3125,8.6875 5.3125,3 5.28125,-3.0625 -5.28125,-8.625 z"
-       id="path29747"
-       style="opacity:0.55438597;fill:none;stroke:url(#linearGradient29763);stroke-width:1.14285719;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-       inkscape:original="M -220 196.6875 L -226.71875 207.6875 L -220 211.5 L -213.3125 207.625 L -220 196.6875 z "
-       inkscape:radius="-1.0141826"
-       sodipodi:type="inkscape:offset" />
     <g
-       id="g30046">
+       style="display:inline;enable-background:new"
+       id="g43314-2"
+       transform="translate(177,410)">
       <rect
-         ry="0"
-         y="346"
-         x="5"
-         height="16"
+         transform="scale(1,-1)"
+         style="opacity:0;fill:#666666;stroke:none;stroke-width:2.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect43157-5"
          width="16"
-         id="rect22783-6-9"
-         style="opacity:0;fill:#999999;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:6;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+         height="16"
+         x="-46"
+         y="48" />
       <g
-         id="g29741"
+         id="g43221-2"
+         transform="matrix(1.1891377,0,0,1.189137,-45.334548,102.47504)"
          style="display:inline;enable-background:new">
         <path
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path43224-5"
+           style="fill:#dcdcdc;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.86864018;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
            sodipodi:type="arc"
-           style="fill:url(#radialGradient107138);fill-opacity:1;stroke:#5a130a;stroke-width:0.87646502;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           id="path107107"
-           sodipodi:cx="12.90625"
-           sodipodi:cy="354.09375"
-           sodipodi:rx="2.46875"
-           sodipodi:ry="2.46875"
-           d="m 15.375,354.09375 a 2.46875,2.46875 0 1 1 -4.9375,0 2.46875,2.46875 0 1 1 4.9375,0 z"
-           transform="matrix(1.0268522,0,0,1.0268522,-0.28026938,-9.574472)" />
-        <path
-           d="m 15.375,354.09375 a 2.46875,2.46875 0 1 1 -4.9375,0 2.46875,2.46875 0 1 1 4.9375,0 z"
-           sodipodi:ry="2.46875"
-           sodipodi:rx="2.46875"
-           sodipodi:cy="354.09375"
-           sodipodi:cx="12.90625"
-           id="path107109"
-           style="fill:none;stroke:url(#linearGradient107140);stroke-width:1.17894268;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:0.52659577;stroke-dasharray:none;display:inline;enable-background:new"
-           sodipodi:type="arc"
-           transform="matrix(0.67857417,0,0,0.67857417,4.2225059,113.7564)" />
-        <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           d="m 11.5,347.5 3,0"
-           id="path107322"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
-        <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 11.5,360.5 3,0"
-           id="path107322-9"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
+           transform="matrix(0.3150215,0,0,0.3150217,-36.662669,-174.25239)" />
         <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 19.5,352.5 0,3"
-           id="path107322-9-7"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
-        <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 6.5,352.5 0,3"
-           id="path107322-9-7-0"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
-        <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 9.5606602,348.43934 -2.1213204,2.12132"
-           id="path107322-9-7-0-2"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
-        <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 18.455806,357.38951 -2.12132,2.12132"
-           id="path107322-9-7-0-2-6"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
+           sodipodi:type="arc"
+           style="opacity:0.79000005;fill:url(#linearGradient24241-6);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           id="path43226-8"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           transform="matrix(-0.2610878,-0.02960567,0.02975872,-0.2611039,35.872259,-102.36161)" />
         <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 7.4688155,357.37826 2.12132,2.12132"
-           id="path107322-9-7-0-2-6-1"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
+           transform="matrix(0.2102357,0,0,0.2102362,-22.830954,-161.8877)"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path43228-6"
+           style="opacity:0.6;fill:none;stroke:url(#linearGradient24243-1);stroke-width:4.00001144;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           sodipodi:type="arc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+      </g>
+      <g
+         transform="matrix(0.9963903,0,0,1,-2.1155075,0)"
+         id="g43169-7">
         <path
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 16.440233,348.49523 2.12132,2.12132"
-           id="path107322-9-7-0-2-6-1-7"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path43170-7"
+           style="fill:#ff5b29;fill-opacity:1;fill-rule:nonzero;stroke:#2b0000;stroke-width:1.6028651;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           sodipodi:type="arc"
+           transform="matrix(0.5625217,0,0,0.5624997,-110.25304,-122.37496)" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107450"
-           d="m 11.5,347.5 3,0"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+           sodipodi:type="arc"
+           style="fill:url(#linearGradient24245-3);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           id="path43172-2"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90"
+           transform="matrix(-0.5000291,-0.05669783,0.0569932,-0.5000402,23.278522,10.488883)" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107452"
-           d="m 11.5,360.5 3,0"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+           transform="matrix(0.4374781,0,0,0.4374622,-93.747286,-107.62054)"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path43174-2"
+           style="opacity:0.65;fill:none;stroke:url(#linearGradient24247-8);stroke-width:2.29000854;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           sodipodi:type="arc"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
+      </g>
+      <g
+         transform="matrix(0,-1,-1,0,-93.999999,-92)"
+         id="g42385-9">
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107454"
-           d="m 19.5,352.5 0,3"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+           sodipodi:nodetypes="csscc"
+           id="path42387-4"
+           d="m -36.5,-51.499999 c -0.5,1 -1.34258,1.996832 -2.996831,1.996832 -1.654251,0 -3,-1.345743 -3,-2.999994 0,-1.308742 0.996831,-2.496838 1.996831,-2.996838 l 4,4 z"
+           style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient24249-9);stroke-width:0.89999998;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           inkscape:connector-curvature="0" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107456"
-           d="m 6.5,352.5 0,3"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+           style="fill:url(#linearGradient24251-6);fill-opacity:1;fill-rule:nonzero"
+           d="m -36.5,-51.499999 c -0.5,1 -1.34258,1.996832 -2.996831,1.996832 -1.654251,0 -2.996872,-1.345746 -3,-2.999994 C -42.5,-54.175184 -41.5,-54.999999 -40.5,-55.499999 l 4,4 z"
+           id="path43279-1"
+           sodipodi:nodetypes="csscc"
+           inkscape:connector-curvature="0" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107458"
-           d="m 9.5606602,348.43934 -2.1213204,2.12132"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+           sodipodi:nodetypes="ccsss"
+           id="path42392-9"
+           d="m -40.75,-54.249999 3,3 c -0.25,0.25 -0.659057,0.708509 -1.758414,0.708509 -1.099355,0 -1.991586,-0.877412 -1.991586,-1.958509 0,-1.081096 0.5,-1.5 0.75,-1.75 z"
+           style="opacity:0.6;fill:none;stroke:url(#linearGradient24253-0);stroke-width:1.00000048;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           inkscape:connector-curvature="0" />
+      </g>
+      <g
+         transform="matrix(1.1891377,0,0,1.189137,-39.353927,107.5067)"
+         id="g43258-6"
+         style="display:inline;enable-background:new">
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107460"
-           d="m 18.455806,357.38951 -2.12132,2.12132"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+           transform="matrix(0.3150215,0,0,0.3150217,-36.662669,-174.25239)"
+           sodipodi:type="arc"
+           style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient24255-6);stroke-width:2.40253735;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+           id="path43260-9"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           inkscape:export-xdpi="90"
+           inkscape:export-ydpi="90" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107462"
-           d="m 7.4688155,357.37826 2.12132,2.12132"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+           transform="matrix(-0.2610878,-0.02960567,0.02975872,-0.2611039,35.872259,-102.36161)"
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           sodipodi:ry="8"
+           sodipodi:rx="8"
+           sodipodi:cy="118"
+           sodipodi:cx="132"
+           id="path43262-8"
+           style="fill:url(#linearGradient24257-6);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           sodipodi:type="arc" />
         <path
-           sodipodi:nodetypes="cc"
-           inkscape:connector-curvature="0"
-           id="path107464"
-           d="m 16.440233,348.49523 2.12132,2.12132"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new" />
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           sodipodi:type="arc"
+           style="opacity:0.7;fill:none;stroke:url(#linearGradient24259-1);stroke-width:4.00001144;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           id="path43264-2"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           transform="matrix(0.2102357,0,0,0.2102362,-22.830954,-161.8877)" />
       </g>
     </g>
     <g
-       id="g30162">
+       style="display:inline;enable-background:new"
+       transform="translate(135,431)"
+       id="g49017-5">
       <rect
-         ry="0"
-         y="346"
-         x="47"
-         height="16"
+         transform="scale(1,-1)"
+         style="opacity:0;fill:#666666;stroke:none;stroke-width:2.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         id="rect49020-5"
          width="16"
-         id="rect22783-6"
-         style="opacity:0;fill:#999999;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:6;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <g
-         id="g30155">
-        <path
-           sodipodi:type="spiral"
-           style="fill:none;stroke:#1e1e1e;stroke-width:2.5999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           id="path107466"
-           sodipodi:cx="56.5"
-           sodipodi:cy="353.8125"
-           sodipodi:expansion="0.63999999"
-           sodipodi:revolution="1.495979"
-           sodipodi:radius="7.3200541"
-           sodipodi:argument="-15.806237"
-           sodipodi:t0="0.095484339"
-           d="m 55.364822,352.64547 c 0.277148,-1.52497 2.279864,-1.6606 3.365012,-1.00195 1.811369,1.09946 1.937,3.62806 0.742803,5.22502 -1.598463,2.13758 -4.749991,2.24309 -6.743742,0.61214 -2.453842,-2.00732 -2.540329,-5.74156 -0.524915,-8.08474 2.369057,-2.75434 6.645845,-2.82434 9.3087,-0.45931 1.163266,1.03316 1.955747,2.44812 2.251586,3.97386"
-           transform="matrix(-1,0,0,1,112.28991,0.1875)"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
+         height="16"
+         x="-46"
+         y="69" />
+      <g
+         id="g49022-4"
+         style="opacity:0.5">
+        <g
+           id="g49024-9"
+           mask="url(#mask48816-8)"
+           style="opacity:0.4;display:inline;enable-background:new">
+          <path
+             id="path49027-1"
+             d="M -42.5,-79.5 -32,-83"
+             style="fill:none;stroke:#2b0800;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             sodipodi:nodetypes="cc"
+             inkscape:connector-curvature="0" />
+          <path
+             style="fill:none;stroke:#ff8d73;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="M -42.5,-79.5 -32,-83"
+             id="path49031-2"
+             sodipodi:nodetypes="cc"
+             inkscape:connector-curvature="0" />
+        </g>
+        <g
+           id="g49034-5">
+          <g
+             style="display:inline;enable-background:new"
+             id="g49036-0"
+             transform="matrix(1.1891377,0,0,1.189137,-48.353927,83.503529)">
+            <path
+               inkscape:export-ydpi="90"
+               inkscape:export-xdpi="90"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               sodipodi:ry="8"
+               sodipodi:rx="8"
+               sodipodi:cy="118"
+               sodipodi:cx="132"
+               id="path49039-8"
+               style="fill:#ececec;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.13558888;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+               sodipodi:type="arc"
+               transform="matrix(0.3150215,0,0,0.3150217,-36.662669,-174.25239)" />
+            <path
+               sodipodi:type="arc"
+               style="fill:url(#linearGradient24279-6);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+               id="path49043-3"
+               sodipodi:cx="132"
+               sodipodi:cy="118"
+               sodipodi:rx="8"
+               sodipodi:ry="8"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               inkscape:export-xdpi="90"
+               inkscape:export-ydpi="90"
+               transform="matrix(-0.2610878,-0.02960567,0.02975872,-0.2611039,35.872259,-102.36161)" />
+            <path
+               transform="matrix(0.2102357,0,0,0.2102362,-22.830954,-161.8877)"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               sodipodi:ry="8"
+               sodipodi:rx="8"
+               sodipodi:cy="118"
+               sodipodi:cx="132"
+               id="path49045-9"
+               style="fill:none;stroke:url(#linearGradient24281-3);stroke-width:4.00001144;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+               sodipodi:type="arc"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+               inkscape:export-xdpi="90"
+               inkscape:export-ydpi="90" />
+          </g>
+        </g>
+      </g>
+      <g
+         id="g49048-3"
+         style="opacity:0.8">
+        <g
+           style="opacity:0.5"
+           mask="url(#mask48816-8)"
+           id="g49050-9">
+          <path
+             sodipodi:nodetypes="cc"
+             style="fill:none;stroke:#2b0800;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="M -39.5,-75.5 -32,-83"
+             id="path49055-6"
+             inkscape:connector-curvature="0" />
+          <path
+             sodipodi:nodetypes="cc"
+             id="path49057-7"
+             d="M -39.5,-75.5 -32,-83"
+             style="fill:none;stroke:#ff8d73;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             inkscape:connector-curvature="0" />
+        </g>
+        <g
+           id="g49059-9">
+          <g
+             transform="matrix(1.1891377,0,0,1.189137,-45.367039,87.538326)"
+             id="g49061-9"
+             style="display:inline;enable-background:new">
+            <path
+               transform="matrix(0.3150215,0,0,0.3150217,-36.662669,-174.25239)"
+               sodipodi:type="arc"
+               style="fill:#ececec;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.13558888;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+               id="path49065-7"
+               sodipodi:cx="132"
+               sodipodi:cy="118"
+               sodipodi:rx="8"
+               sodipodi:ry="8"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               inkscape:export-xdpi="90"
+               inkscape:export-ydpi="90" />
+            <path
+               transform="matrix(-0.2610878,-0.02960567,0.02975872,-0.2611039,35.872259,-102.36161)"
+               inkscape:export-ydpi="90"
+               inkscape:export-xdpi="90"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               sodipodi:ry="8"
+               sodipodi:rx="8"
+               sodipodi:cy="118"
+               sodipodi:cx="132"
+               id="path49067-6"
+               style="fill:url(#linearGradient24283-7);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+               sodipodi:type="arc" />
+            <path
+               inkscape:export-ydpi="90"
+               inkscape:export-xdpi="90"
+               inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+               sodipodi:type="arc"
+               style="fill:none;stroke:url(#linearGradient24285-8);stroke-width:4.00001144;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+               id="path49069-9"
+               sodipodi:cx="132"
+               sodipodi:cy="118"
+               sodipodi:rx="8"
+               sodipodi:ry="8"
+               d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+               transform="matrix(0.2102357,0,0,0.2102362,-22.830954,-161.8877)" />
+          </g>
+        </g>
+      </g>
+      <g
+         id="g49071-3">
+        <g
+           id="g49073-5"
+           mask="url(#mask28585-8)">
+          <path
+             id="path49075-7"
+             d="M -34.5,-72.5 -32,-83"
+             style="fill:none;stroke:#2b0800;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             sodipodi:nodetypes="cc"
+             inkscape:connector-curvature="0" />
+          <path
+             style="fill:none;stroke:#ff8d73;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="M -34.5,-72.5 -32,-83"
+             id="path49077-6"
+             sodipodi:nodetypes="cc"
+             inkscape:connector-curvature="0" />
+        </g>
+        <g
+           transform="matrix(1.1891377,0,0,1.189137,-40.353927,90.509865)"
+           id="g49079-6"
+           style="display:inline;enable-background:new">
+          <path
+             transform="matrix(0.3150215,0,0,0.3150217,-36.662669,-174.25239)"
+             sodipodi:type="arc"
+             style="fill:#ececec;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.13558888;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+             id="path49082-5"
+             sodipodi:cx="132"
+             sodipodi:cy="118"
+             sodipodi:rx="8"
+             sodipodi:ry="8"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+             inkscape:export-xdpi="90"
+             inkscape:export-ydpi="90" />
+          <path
+             transform="matrix(-0.2610878,-0.02960567,0.02975872,-0.2611039,35.872259,-102.36161)"
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+             sodipodi:ry="8"
+             sodipodi:rx="8"
+             sodipodi:cy="118"
+             sodipodi:cx="132"
+             id="path49084-8"
+             style="fill:url(#linearGradient24287-1);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+             sodipodi:type="arc" />
+          <path
+             inkscape:export-ydpi="90"
+             inkscape:export-xdpi="90"
+             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+             sodipodi:type="arc"
+             style="fill:none;stroke:url(#linearGradient24289-3);stroke-width:4.00001144;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+             id="path49086-2"
+             sodipodi:cx="132"
+             sodipodi:cy="118"
+             sodipodi:rx="8"
+             sodipodi:ry="8"
+             d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+             transform="matrix(0.2102357,0,0,0.2102362,-22.830954,-161.8877)" />
+        </g>
+      </g>
+      <g
+         style="display:inline;enable-background:new"
+         transform="translate(6.299313,57.265533)"
+         id="g49088-5">
+        <rect
+           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#5a0d00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect49090-4"
+           width="2.9998772"
+           height="3"
+           x="-39.799313"
+           y="-141.76553"
+           ry="1.4999387"
+           rx="1.4999387" />
         <path
-           transform="matrix(-1,0,0,1,112.28991,0.1875)"
-           d="m 55.363791,352.64255 c 0.279362,-1.52663 2.284601,-1.66081 3.370811,-1.00022 1.812759,1.10247 1.936516,3.63442 0.739426,5.2325 -1.602239,2.13895 -4.757809,2.24207 -6.752762,0.60744 -2.455246,-2.01179 -2.538856,-5.75071 -0.519059,-8.09518 2.374165,-2.75579 6.656232,-2.82247 9.32045,-0.45241 1.457306,1.2964 2.314544,3.17928 2.379814,5.12465"
-           sodipodi:t0="0.093999997"
-           sodipodi:argument="-15.806237"
-           sodipodi:radius="7.4065847"
-           sodipodi:revolution="1.5209458"
-           sodipodi:expansion="0.63999999"
-           sodipodi:cy="353.8125"
-           sodipodi:cx="56.5"
-           id="path107468"
-           style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           sodipodi:type="spiral"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000072;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -37.299433,-141.26553 c -0.65334,0 -1.30668,1e-5 -1.96003,1e-5 0,0.66667 0,1.33332 0,1.99999 0.65335,0 1.30669,-10e-6 1.96003,-10e-6 0,-0.66666 0,-1.33332 0,-1.99999 z"
+           id="path49092-4"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
            inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
+           inkscape:export-ydpi="90"
+           inkscape:connector-curvature="0" />
         <path
-           sodipodi:type="arc"
-           style="fill:url(#radialGradient30090);fill-opacity:1;stroke:#5a130a;stroke-width:1.21390676;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           id="path107107-5"
-           sodipodi:cx="12.90625"
-           sodipodi:cy="354.09375"
-           sodipodi:rx="2.46875"
-           sodipodi:ry="2.46875"
-           d="m 15.375,354.09375 a 2.46875,2.46875 0 1 1 -4.9375,0 2.46875,2.46875 0 1 1 4.9375,0 z"
-           transform="matrix(0.6590292,0,0,0.6590292,48.151531,120.63684)" />
-        <path
-           style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:url(#linearGradient30129);fill-opacity:1;stroke:none;stroke-width:2.5999999;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
-           d="m 48.25,351.96875 a 1.30013,1.30013 0 0 0 -1.03125,1.0625 c -0.560356,3.27054 0.822741,6.58876 3.4375,8.5625 a 1.3062537,1.3062537 0 0 0 1.5625,-0.0312 A 0.50389111,0.50389111 0 0 1 51.9375,361.5 c -3.258538,-1.90713 -4.860221,-5.92414 -3.625,-9.53125 a 1.30013,1.30013 0 0 0 -0.0625,0 z m 1.03125,0.21875 c -1.14015,3.1617 0.271743,6.74928 3.15625,8.4375 a 0.50389111,0.50389111 0 0 1 0.25,0.3125 1.3062537,1.3062537 0 0 0 -0.46875,-1.4375 c -1.845415,-1.393 -2.825384,-3.76735 -2.4375,-6.03125 a 1.30013,1.30013 0 0 0 -0.5,-1.28125 z"
-           id="path30105"
-           inkscape:connector-curvature="0" />
-        <path
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           sodipodi:type="spiral"
-           style="fill:none;stroke:url(#linearGradient30145);stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-           id="path30107"
-           sodipodi:cx="56.5"
-           sodipodi:cy="353.8125"
-           sodipodi:expansion="0.63999999"
-           sodipodi:revolution="1.690941"
-           sodipodi:radius="7.9262452"
-           sodipodi:argument="-15.806237"
-           sodipodi:t0="0.86983246"
-           d="m 63.464088,351.79847 c 1.246144,3.40682 -0.280462,7.26967 -3.378975,9.08314"
-           transform="matrix(-1,0,0,1,112.28991,0.1875)" />
+           style="opacity:0.45;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           d="m -38.799433,-139.76553 0,-1 1,0"
+           id="path49094-1"
+           inkscape:connector-curvature="0" />
+      </g>
+    </g>
+    <g
+       style="display:inline;enable-background:new"
+       id="g33096-6"
+       transform="translate(189,147)">
+      <g
+         transform="translate(51,203)"
+         id="g45912-1">
+        <rect
+           style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="rect35680-9-6"
+           width="16"
+           height="16"
+           x="-46"
+           y="-4" />
+        <g
+           style="opacity:0.95;display:inline;enable-background:new"
+           transform="translate(-491,-214.9763)"
+           id="g35844-1-3"
+           inkscape:transform-center-x="-0.78726"
+           inkscape:transform-center-y="2.2787562">
+          <path
+             style="opacity:0.95;fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="m 454.5,218.5 c -1.25,-1.5 -2.5,-1.5 -4,1 -1.5,-2.5 -2.75,-2.5 -4,-1"
+             id="path35846-9-3"
+             sodipodi:nodetypes="ccc"
+             inkscape:connector-curvature="0" />
+          <path
+             sodipodi:nodetypes="ccc"
+             id="path35848-8-5"
+             d="m 454.5,218.5 c -1.25,-1.5 -2.5,-1.5 -4,1 -1.5,-2.5 -2.75,-2.5 -4,-1"
+             style="fill:none;stroke:#f2f2f2;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             inkscape:connector-curvature="0" />
+          <rect
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect35914-6-5"
+             width="1"
+             height="2"
+             x="450"
+             y="217.9763" />
+          <rect
+             y="217.9763"
+             x="449.25"
+             height="1"
+             width="0.75"
+             id="rect35916-5-3"
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect35919-0-2"
+             width="0.75"
+             height="1"
+             x="451"
+             y="217.9763" />
+        </g>
+        <g
+           id="g38276-9-8"
+           transform="translate(-324,-461)">
+          <path
+             sodipodi:nodetypes="ccc"
+             id="path35702-0-2"
+             d="m 292.5,459.5 c -1.25,-1.5 -3.5,-1.5 -5,1 -1.5,-2.5 -3.75,-2.5 -5,-1"
+             style="opacity:0.95;fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             inkscape:connector-curvature="0" />
+          <path
+             style="fill:none;stroke:#ececec;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="m 292.5,459.5 c -1.25,-1.5 -3.5,-1.5 -5,1 -1.5,-2.5 -3.75,-2.5 -5,-1"
+             id="path35704-0-5"
+             sodipodi:nodetypes="ccc"
+             inkscape:connector-curvature="0" />
+          <rect
+             y="459"
+             x="287"
+             height="2"
+             width="1"
+             id="rect35908-6-3"
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect35910-1-6"
+             width="0.75"
+             height="1"
+             x="286.25"
+             y="459" />
+          <rect
+             y="459"
+             x="288"
+             height="1"
+             width="0.75"
+             id="rect35912-3-1"
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        </g>
+        <g
+           style="opacity:0.9;display:inline;enable-background:new"
+           transform="translate(-484,-209.97631)"
+           id="g45582-8"
+           inkscape:transform-center-x="-0.78726"
+           inkscape:transform-center-y="2.2787562">
+          <path
+             style="opacity:0.95;fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="m 452.5,218.47631 -1,-1 -2,2 -2,-2 -1,1.02369"
+             id="path45584-6"
+             sodipodi:nodetypes="ccccc"
+             inkscape:connector-curvature="0" />
+          <path
+             sodipodi:nodetypes="ccccc"
+             id="path45586-2"
+             d="m 452.5,218.47631 -1,-1 -2,2 -2,-2 -1,1.02369"
+             style="fill:none;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             inkscape:connector-curvature="0" />
+          <rect
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect45588-1"
+             width="1"
+             height="1.4999862"
+             x="449"
+             y="218.4763" />
+          <rect
+             y="217.9763"
+             x="448"
+             height="0.99998617"
+             width="1"
+             id="rect45590-4"
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect45592-6"
+             width="1"
+             height="0.99998617"
+             x="447"
+             y="216.9763" />
+          <rect
+             y="217.9763"
+             x="446"
+             height="0.99998617"
+             width="1"
+             id="rect45594-2"
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect45596-9"
+             width="1"
+             height="0.99998617"
+             x="452"
+             y="217.9763" />
+          <rect
+             y="216.9763"
+             x="451"
+             height="0.99998617"
+             width="1"
+             id="rect45598-1"
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect45600-5"
+             width="1"
+             height="0.99998617"
+             x="450"
+             y="217.9763" />
+        </g>
       </g>
-    </g>
-    <image
-       y="178"
-       x="467"
-       id="image14814"
-       xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAArJJREFU
-OI2Nk0tIVXkcxz//c851sLJFKRFE1GaoRRSZFFgQvTQqo1NJDyiYJoWZ/UAEBa0iatGmh2WBlZhj
-hkjGBaOZoAE3XWY1m5FRKCgavfd6zrnn8X+1yLpO06Lv8gvfD7+noGE9X6gDaJlr1ORyoq5uviel
-sjNBqGbtPNDlfS18qfuBv7epnov33zBZGObCmZM0LK4jTgz/vE+JYsHJw3sAcJm/9D/ht+O/+/Xz
-LIW/XvNbfoTTHQe4crWPBUuW8/e7mHclQ++taxz/6ezql6ND0psb3tve6f9ycxyA6YlXAESp5eBx
-n4f3Bth18ChDPTfYvK8TJQMAnE/hwqtRf9GKjUxPjLFzg8v+tk0ASOuirEtr+xFG+rrZ0vYzcZxi
-tP0MaLnU/cB//WYKAN9v5uHAH8RSAFDJBIn2eNrbw6Y9nRTLAUEUI7X6DKC9eRlTkWJ6YoxYCra3
-buZR7xD1K5soFgX53nts2P0jpWJIFJRQSpNlEgAP4NydcSYLwwD09wwCUL+yCYAXT/tp3HGCcikk
-CooYY9EywdSIKmCyMEzLoSO4nsDgYBHEiWD0UQ/fN7YShRlheQprLVKDVgqlnWoLu9oOkx/oI9E5
-UuUxE3o8+/Uu67Yew/FqCcv/YiwoA67jzlZhqoC6xYvYuO8HntzvIkk9nj++zdptJ4jCkGimhLGg
-EQjHw3FctAXHqW6BmdAhCi2NracZ7b/Omi1HKZdKxFGAtmCEQOCglEZbS5rEYOYApkshlSRkbPAy
-q5oPEQZlZBpjjEXgAA7aWFzPI8sy0jTBYqtDTOMKf45cY832U1gjsUpirEEbTZxW+K6mFq0NMksJ
-g48XqJQGQNCwvgNoOXW2y19Ym0NLhbUaYS05F4w1oA3aGKTMqCSSOJH03zo/COTF7Dv/74W/QXmg
-6wPaEWghwWN1uQAAAABJRU5ErkJggg==
-"
-       height="16"
-       width="16" />
-  </g>
-  <g
-     inkscape:groupmode="layer"
-     id="layer6"
-     inkscape:label="New Icons"
-     style="display:none">
-    <g
-       style="display:inline;enable-background:new"
-       id="g30250-6"
-       transform="matrix(-1,0,0,1,788.49395,-2.4863553)" />
-    <g
-       style="display:inline;enable-background:new"
-       id="g33683-2"
-       transform="translate(42,296)">
-      <rect
-         y="176"
-         x="446"
-         height="16"
-         width="16"
-         id="rect18831-4"
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         transform="translate(263.91329,149.04559)"
-         id="g11360-5"
-         style="display:inline">
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\jendrzych's iconset.png"
+         transform="matrix(0.3350147,0,0,0.3350147,-35.55948,137.66413)"
+         id="g29713-0"
+         style="display:inline;enable-background:new">
         <path
-           inkscape:connector-curvature="0"
-           style="fill:url(#linearGradient37097-2);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 190.07108,29.454411 c -3.02619,0 -5.48439,2.463313 -5.48438,5.5 0,3.036688 2.45819,5.500001 5.48438,5.5 3.02619,0 5.48437,-2.46331 5.48437,-5.5 0,-3.036689 -2.45818,-5.500001 -5.48437,-5.5 z m 0,2.98305 c 1.36546,0 2.53849,1.100464 2.53848,2.454803 0,1.354341 -1.17303,2.501413 -2.53848,2.501412 -1.36546,0 -2.47581,-1.14707 -2.47581,-2.501412 0,-1.354341 1.11035,-2.454805 2.47581,-2.454803 z"
-           id="path11362-5"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
+           transform="matrix(0.75,0,0,0.75,29.5,135)"
+           sodipodi:type="arc"
+           style="fill:#ff541f;fill-opacity:1;fill-rule:nonzero;stroke:#320b00;stroke-width:3.58193231;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path29715-3"
+           sodipodi:cx="132"
+           sodipodi:cy="118"
+           sodipodi:rx="8"
+           sodipodi:ry="8"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
            inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90"
-           sodipodi:nodetypes="csssccsssc" />
+           inkscape:export-ydpi="90" />
         <path
+           transform="matrix(-0.6011908,-0.06817113,0.06852359,-0.6012277,199.77148,303.44348)"
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
+           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
            sodipodi:ry="8"
            sodipodi:rx="8"
            sodipodi:cy="118"
            sodipodi:cx="132"
-           id="path11364-7"
-           style="fill:none;stroke:url(#linearGradient15782-9);stroke-width:1.77120221;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
-           sodipodi:type="arc"
-           transform="matrix(0.566689,0,0,-0.562497,115.2063,101.3747)" />
-        <path
-           transform="matrix(0.4330916,0,0,-0.424074,132.95389,85.01929)"
-           sodipodi:type="arc"
-           style="fill:none;stroke:url(#linearGradient33681-3);stroke-width:2.33340454;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
-           id="path11366-4"
-           sodipodi:cx="132"
-           sodipodi:cy="118"
-           sodipodi:rx="8"
-           sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
-      </g>
-    </g>
-    <g
-       style="display:inline;enable-background:new"
-       id="g16706"
-       transform="translate(21,21)">
-      <rect
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect16672"
-         width="16"
-         height="16"
-         x="446"
-         y="451" />
-      <g
-         style="display:inline"
-         id="g16674"
-         transform="matrix(0.45569675,0,0,0.45569675,367.3696,443.07138)">
+           id="path29717-6"
+           style="opacity:0.6;fill:url(#linearGradient33126-9);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
+           sodipodi:type="arc" />
         <path
-           sodipodi:nodetypes="csssc"
            inkscape:export-ydpi="90"
            inkscape:export-xdpi="90"
            inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           id="path16676"
-           d="m 190.07108,29.454411 c -3.02619,0 -5.48439,2.463313 -5.48438,5.5 0,3.036688 2.45819,5.500001 5.48438,5.5 3.02619,0 5.48437,-2.46331 5.48437,-5.5 0,-3.036689 -2.45818,-5.500001 -5.48437,-5.5 z"
-           style="fill:url(#linearGradient16713);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.1944418;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           inkscape:connector-curvature="0" />
-        <path
-           transform="matrix(0.40900746,0,0,-0.40575459,136.02026,82.879096)"
            sodipodi:type="arc"
-           style="fill:none;stroke:url(#linearGradient16716);stroke-width:5.3867569;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
-           id="path16678"
+           style="opacity:0.7;fill:none;stroke:url(#linearGradient33128-2);stroke-width:6.6867547;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+           id="path29719-4"
            sodipodi:cx="132"
            sodipodi:cy="118"
            sodipodi:rx="8"
            sodipodi:ry="8"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
-        <path
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           d="m 140,118 a 8,8 0 1 1 -16,0 8,8 0 1 1 16,0 z"
-           sodipodi:ry="8"
-           sodipodi:rx="8"
-           sodipodi:cy="118"
-           sodipodi:cx="132"
-           id="path16680"
-           style="fill:none;stroke:url(#linearGradient16718);stroke-width:5.12052059;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
-           sodipodi:type="arc"
-           transform="matrix(0.4330916,0,0,-0.424074,132.95389,85.01929)" />
+           d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
+           transform="matrix(0.4463965,0,0,0.4463971,69.575658,170.82515)" />
       </g>
     </g>
     <g
        style="display:inline;enable-background:new"
-       id="g52905"
-       transform="translate(398.95001,-42)">
+       id="g24982-9"
+       transform="translate(21,273)">
       <rect
-         y="367"
-         x="-372.95001"
+         y="73"
+         x="47"
          height="16"
          width="16"
-         id="rect52907"
-         style="opacity:0;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <path
-         sodipodi:nodetypes="cc"
-         id="path52910"
-         d="m -368.95,374 5,-5"
-         style="fill:none;stroke:#000000;stroke-width:3.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         inkscape:connector-curvature="0" />
-      <g
-         mask="url(#mask52637-8-8)"
-         id="g52912"
-         transform="translate(-18.95,-84)">
-        <path
-           sodipodi:nodetypes="ccccc"
-           d="m -352.5,465.5 2,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
-           style="color:#000000;fill:none;stroke:#3c0800;stroke-width:2.70000005;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="path52914"
-           inkscape:connector-curvature="0" />
-        <path
-           id="path52916"
-           style="color:#000000;fill:none;stroke:#ed7432;stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m -353.25,465.5 2.75,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
-           sodipodi:nodetypes="ccccc"
-           inkscape:connector-curvature="0" />
-        <path
-           mask="none"
-           sodipodi:nodetypes="ccccc"
-           d="m -353.25,465.5 2.75,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
-           style="color:#000000;fill:none;stroke:url(#linearGradient52998-5-5);stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="path52918"
-           inkscape:connector-curvature="0" />
-      </g>
-      <rect
-         ry="1.5"
-         rx="1.5"
-         style="fill:none;stroke:#000000;stroke-width:2.5999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect52920"
-         width="3"
-         height="3"
-         x="-371.45001"
-         y="-376.5"
-         transform="scale(1,-1)" />
+         id="rect24980-2"
+         style="opacity:0;fill:#808080;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
       <g
-         transform="matrix(-1,0,0,1,-711.95,-84)"
-         id="g52922"
-         mask="url(#mask52879-0-5)">
+         clip-path="none"
+         mask="none"
+         id="g24568-9"
+         transform="translate(93,198.04787)">
         <path
-           id="path52924"
-           style="color:#000000;fill:none;stroke:#0b1728;stroke-width:2.70000005;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m -353.5,465.5 3,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
-           sodipodi:nodetypes="ccccc"
+           style="fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="m -44.5,-117.48534 c 0,1 1,3 5.5,3 5.25,0 7.5,-3.26466 7.5,-6.01466 0,-1.5 -0.5,-2.25 -1,-3"
+           id="path24570-3"
+           sodipodi:nodetypes="cssc"
            inkscape:connector-curvature="0" />
+        <g
+           id="g24572-4"
+           mask="url(#mask43050-6)"
+           transform="translate(-22,0)">
+          <path
+             style="fill:none;stroke:#000000;stroke-width:2.79999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="m -11.5,-110.54787 c 2.25,-1.5 2,-3.45213 2,-4.20213 0,-1.6875 -2.25,-5.75 -7.5,-5.75 -4.5,0 -5.5,2 -5.5,3"
+             id="path24574-4"
+             sodipodi:nodetypes="cssz"
+             inkscape:connector-curvature="0" />
+          <path
+             sodipodi:nodetypes="cssz"
+             id="path24576-0"
+             d="m -11.5,-110.54787 c 2.25,-1.5 2,-3.45213 2,-4.20213 0,-1.6875 -2.25,-5.75 -7.5,-5.75 -4.5,0 -5.5,2 -5.5,3"
+             style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             inkscape:connector-curvature="0" />
+          <path
+             style="opacity:0.65;fill:none;stroke:url(#radialGradient24295-1);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             d="m -11.5,-110.54787 c 2.25,-1.5 2,-3.45213 2,-4.20213 0,-1.6875 -2.25,-5.75 -7.5,-5.75 -4.5,0 -5.5,2 -5.5,3"
+             id="path24578-5"
+             sodipodi:nodetypes="cssz"
+             inkscape:connector-curvature="0" />
+          <path
+             sodipodi:nodetypes="cssz"
+             id="path24580-9"
+             d="m -11.5,-110.54787 c 2.5,-1.5 2,-3.45213 2,-4.20213 0,-1.6875 -2.25,-5.75 -7.5,-5.75 -4.5,0 -5.5,2 -5.5,3"
+             style="opacity:0.65;fill:none;stroke:url(#radialGradient24297-0);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+             inkscape:connector-curvature="0" />
+        </g>
         <path
-           sodipodi:nodetypes="ccccc"
-           d="m -354.2,465.5 3.7,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
-           style="color:#000000;fill:none;stroke:#7be10f;stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="path52926"
-           inkscape:connector-curvature="0" />
+           sodipodi:type="arc"
+           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path24582-6"
+           sodipodi:cx="-10.5"
+           sodipodi:cy="-117.5"
+           sodipodi:rx="1.5"
+           sodipodi:ry="1.5"
+           d="m -9,-117.5 c 0,0.82843 -0.6715729,1.5 -1.5,1.5 -0.828427,0 -1.5,-0.67157 -1.5,-1.5 0,-0.82843 0.671573,-1.5 1.5,-1.5 0.8284271,0 1.5,0.67157 1.5,1.5 z"
+           transform="matrix(1,0,0,1.4166681,-22,49.0835)" />
+        <g
+           id="g24584-3">
+          <rect
+             y="-124.50001"
+             x="-39.75"
+             height="14.999989"
+             width="2.5"
+             id="rect24586-4"
+             style="fill:#821b00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+          <rect
+             style="fill:#ff9d7d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect24588-2"
+             width="1"
+             height="14.999989"
+             x="-39"
+             y="-124.50001" />
+          <rect
+             style="fill:url(#radialGradient24299-9);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+             id="rect24590-8"
+             width="2"
+             height="14.999989"
+             x="-39.5"
+             y="-124.50001" />
+        </g>
         <path
-           id="path52928"
-           style="color:#000000;fill:none;stroke:url(#linearGradient53000-3-9);stroke-width:1.5;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m -354.2,465.5 3.75,0 c 1.10456,0 2,-0.89543 2,-1.99999 l 0,-1.00001 -2.5,-2.5"
-           sodipodi:nodetypes="ccccc"
-           mask="none"
+           sodipodi:nodetypes="cssc"
+           id="path24592-8"
+           d="m -44.5,-117.48534 c 0,1 1,3 5.5,3 5.25,0 7.5,-3.26466 7.5,-6.01466 0,-1.5 -0.5,-2.25 -1,-3"
+           style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
            inkscape:connector-curvature="0" />
       </g>
-      <rect
-         transform="scale(1,-1)"
-         y="-376.5"
-         x="-361.45001"
-         height="3"
-         width="3"
-         id="rect52930"
-         style="fill:none;stroke:#000000;stroke-width:2.5999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         rx="1.5"
-         ry="1.5" />
-      <path
-         style="fill:none;stroke:#b3b3b3;stroke-width:2.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         d="m -367.7,372.75 3.75,-3.75"
-         id="path52932"
-         sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0" />
-      <rect
-         transform="scale(1,-1)"
-         y="-376.5"
-         x="-371.45001"
-         height="3"
-         width="3"
-         id="rect52934"
-         style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#cccccc;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         rx="1.5"
-         ry="1.5" />
-      <rect
-         ry="1.5"
-         rx="1.5"
-         style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#cccccc;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect52936"
-         width="3"
-         height="3"
-         x="-361.45001"
-         y="-376.5"
-         transform="scale(1,-1)" />
-      <path
-         sodipodi:nodetypes="cc"
-         id="path52938"
-         d="m -368.45,372.5 4,-4 1,0"
-         style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         inkscape:connector-curvature="0" />
-      <rect
-         ry="1.5"
-         rx="1.5"
-         style="fill:none;stroke:url(#linearGradient53002-6-2);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect52940"
-         width="3"
-         height="3"
-         x="-371.45001"
-         y="-376.5"
-         transform="scale(1,-1)" />
-      <rect
-         transform="scale(1,-1)"
-         y="-376.5"
-         x="-361.45001"
-         height="3"
-         width="3"
-         id="rect52942"
-         style="fill:none;stroke:url(#linearGradient58927);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         rx="1.5"
-         ry="1.5" />
-    </g>
-    <g
-       style="display:inline;enable-background:new"
-       transform="translate(252,-210)"
-       id="g52978">
-      <path
-         style="color:#000000;fill:none;stroke:#000000;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         d="m -198,536 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.75 -1.75,1.75 1.75,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L -204,542 l 0,1 0,1 1.90625,0.15625 c 0.14227,0.6231 0.25145,1.07677 0.59375,1.59375 l -1.75,1.75 1.75,1.75 1.75,-1.75 c 0.51699,0.34229 0.97065,0.45148 1.59375,0.59375 L -198,550 l 1,0 1,0 0.15625,-1.90625 c 0.6231,-0.14227 1.07677,-0.25145 1.59375,-0.59375 l 1.75,1.75 1.75,-1.75 -1.75,-1.75 c 0.34229,-0.51699 0.45148,-0.97065 0.59375,-1.59375 L -190,544 l 0,-1 0,-1 -1.90625,-0.15625 c -0.14227,-0.6231 -0.25145,-1.07677 -0.59375,-1.59375 l 1.75,-1.75 -1.75,-1.75 -1.75,1.75 c -0.51699,-0.34229 -0.97065,-0.45148 -1.59375,-0.59375 L -196,536 l -1,0 -1,0 z m 1,4.125 c 1.58782,0 2.875,1.28718 2.875,2.875 0,1.58782 -1.28718,2.875 -2.875,2.875 -1.58782,0 -2.875,-1.28718 -2.875,-2.875 0,-1.58782 1.28718,-2.875 2.875,-2.875 z"
-         id="path52980"
-         inkscape:connector-curvature="0" />
-      <path
-         id="path52982"
-         d="m -196,550 0.15625,-1.90625 c 0.6231,-0.14227 1.07677,-0.25145 1.59375,-0.59375 l 1.75,1.5 1.5,-1.5 -1.5,-1.75 c 0.34229,-0.51699 0.45148,-0.97065 0.59375,-1.59375 L -190,544 l 0,-1 0,-1 -1.90625,-0.15625 c -0.14227,-0.6231 -0.25145,-1.07677 -0.59375,-1.59375 l 1.5,-1.75 -1.5,-1.5 -1.75,1.5 c -0.51699,-0.34229 -0.97065,-0.45148 -1.59375,-0.59375 L -196,536 l -1,0 -1,0 -0.15625,1.90625 c -0.6231,0.14227 -1.07677,0.25145 -1.59375,0.59375 l -1.75,-1.5 -1.5,1.5 1.5,1.75 c -0.34229,0.51699 -0.45148,0.97065 -0.59375,1.59375 L -204,542 l 0,1 0,1 1.90625,0.15625 c 0.14227,0.6231 0.25145,1.07677 0.59375,1.59375 l -1.5,1.75 1.5,1.5 1.75,-1.5 c 0.51699,0.34229 0.97065,0.45148 1.59375,0.59375 L -198,550 l 1,0 1,0 z m -1,-4 c -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 1.65685,0 3,1.34315 3,3 0,1.65685 -1.34315,3 -3,3 z"
-         style="color:#000000;fill:url(#linearGradient32854-6-2);fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         inkscape:connector-curvature="0" />
-      <rect
-         y="535"
-         x="-205"
-         height="16"
-         width="16"
-         id="rect52984"
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <rect
-         ry="6.4999995"
-         rx="6.4999995"
-         y="539.5"
-         x="-200.5"
-         height="6.981843"
-         width="6.981843"
-         id="rect52986"
-         style="fill:none;stroke:url(#linearGradient32856-3-2);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <path
-         inkscape:export-ydpi="90"
-         inkscape:export-xdpi="90"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-         d="m -192.5,537.5 -1.25,1.25 m -2.75,-2.25 -1,0 0,1.5 c -0.35104,0.0802 -1.50086,0.537 -2,0.75 m -1.75,1.75 c -0.20864,0.49552 -0.67146,1.65605 -0.75,2 l -1.5,0 0,1 m 1.75,-5.75 -0.5,0.5 m 1,8 -1.25,1.25"
-         id="path52988"
-         sodipodi:nodetypes="cccccscccccccc"
-         inkscape:connector-curvature="0" />
-      <path
-         sodipodi:nodetypes="cc"
-         id="path52990"
-         d="m -202.5,538.75 1.25,-1.25"
-         style="fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
-      <rect
-         style="opacity:0.4;fill:none;stroke:url(#linearGradient32858-7-2);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.26976086;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect52992"
-         width="6.981843"
-         height="6.981843"
-         x="193.51816"
-         y="-546.48187"
-         rx="6.4999995"
-         ry="6.4999995"
-         transform="scale(-1,-1)" />
-      <path
-         inkscape:export-ydpi="90"
-         inkscape:export-xdpi="90"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         style="opacity:0.35;fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-         d="m -197.5,548.25 0,1.25 m 7,-7 -1.25,0"
-         id="path52994"
-         sodipodi:nodetypes="cccc"
-         inkscape:connector-curvature="0" />
-      <path
-         sodipodi:nodetypes="cc"
-         id="path52996"
-         d="m -191.75,547.25 -1,1"
-         style="opacity:0.3;fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-         inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png"
-         inkscape:export-xdpi="90"
-         inkscape:export-ydpi="90"
-         inkscape:connector-curvature="0" />
     </g>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer6"
+     inkscape:label="Python icons"
+     style="display:none">
     <g
        style="display:inline;enable-background:new"
-       id="g32860"
-       transform="translate(231,-294)">
-      <rect
-         style="opacity:0;color:#000000;fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect32862"
-         width="16"
-         height="16"
-         x="-226"
-         y="619" />
-      <path
-         sodipodi:nodetypes="cccsssscccc"
-         style="opacity:0.5;fill:url(#linearGradient32896-0-4);fill-opacity:1;stroke:none"
-         d="m -212.5,619.5 -2,0 -6.0625,6.0625 C -220.70928,625.548 -220.84942,625.5 -221,625.5 c -2.48528,0 -4.5,2.01473 -4.5,4.5 0,2.48527 2.01472,4.5 4.5,4.5 2.48528,0 4.5,-2.01473 4.5,-4.5 0,-0.14948 -0.017,-0.29176 -0.0312,-0.4375 l 6.0312,-6.0625 0,-2 -2,-2 z"
-         id="path32864"
-         inkscape:connector-curvature="0" />
-      <path
-         d="m -177.09897,651.49231 a 2.4505157,2.4923096 0 1 1 -4.90103,0 2.4505157,2.4923096 0 1 1 4.90103,0 z"
-         sodipodi:ry="2.4923096"
-         sodipodi:rx="2.4505157"
-         sodipodi:cy="651.49231"
-         sodipodi:cx="-179.54948"
-         id="path32866"
-         style="color:#000000;fill:url(#linearGradient32899-8-3);fill-opacity:1;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         sodipodi:type="arc"
-         transform="matrix(1.224232,0,0,1.2036922,-1.189782,-154.19619)" />
-      <path
-         sodipodi:nodetypes="ccccc"
-         id="path32868"
-         d="m -219.5,626.5 5.5,-5.5 0.5,-0.5 0.5,0.5 0.5,0.5"
-         style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;display:inline;enable-background:new"
-         inkscape:connector-curvature="0" />
-      <path
-         transform="translate(-21,0)"
-         d="M -193.09375,620.46875 -198.875,626.25 a 0.95626367,0.95626367 0 0 1 -0.78125,0.25 c -0.29297,-0.0289 -0.39637,-0.0312 -0.34375,-0.0312 -1.96853,0 -3.53125,1.56273 -3.53125,3.53125 0,1.96852 1.56272,3.53125 3.53125,3.53125 1.96853,0 3.53125,-1.56273 3.53125,-3.53125 0,-0.0768 0.0155,-0.18427 0,-0.34375 a 0.95626367,0.95626367 0 0 1 0.25,-0.78125 l 5.75,-5.78125 0,-1.1875 -1.4375,-1.4375 -1.1875,0 z"
-         id="path32870"
-         style="fill:none;stroke:url(#radialGradient32901-4-9);stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         inkscape:original="M -193.5 619.5 L -199.5625 625.5625 C -199.70928 625.548 -199.84942 625.5 -200 625.5 C -202.48528 625.5 -204.5 627.51473 -204.5 630 C -204.5 632.48527 -202.48528 634.5 -200 634.5 C -197.51472 634.5 -195.5 632.48527 -195.5 630 C -195.5 629.85052 -195.51705 629.70824 -195.53125 629.5625 L -189.5 623.5 L -189.5 621.5 L -191.5 619.5 L -193.5 619.5 z "
-         inkscape:radius="-0.95616806"
-         sodipodi:type="inkscape:offset" />
-      <path
-         id="path32872"
-         d="m -217,624 0,1 -1,0 0,0.0312 -0.0312,0 0,0.96875 -0.96875,0 0,0.0312 -0.0312,0 0,1 -1,0 0,1 0,1 1,0 1,0 0,-1 1,0 0,-0.0312 0.0312,0 0,-0.96875 0.96875,0 0,-0.0312 0.0312,0 0,-1 1,0 0,-1 -1,0 0,-1 -1,0 z"
-         style="color:#000000;fill:url(#linearGradient32903-6-4);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         inkscape:connector-curvature="0" />
-      <path
-         transform="matrix(1.2638889,0,0,1.2222222,32.853009,-140.1836)"
-         d="m -201.22313,628.93835 a 0.80938911,0.80938911 0 1 1 -1.61878,0 0.80938911,0.80938911 0 1 1 1.61878,0 z"
-         sodipodi:ry="0.80938911"
-         sodipodi:rx="0.80938911"
-         sodipodi:cy="628.93835"
-         sodipodi:cx="-202.03252"
-         id="path32874"
-         style="opacity:0.7;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         sodipodi:type="arc" />
-      <path
-         sodipodi:type="arc"
-         style="opacity:0.7;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="path32877"
-         sodipodi:cx="-202.03252"
-         sodipodi:cy="628.93835"
-         sodipodi:rx="0.80938911"
-         sodipodi:ry="0.80938911"
-         d="m -201.22313,628.93835 a 0.80938911,0.80938911 0 1 1 -1.61878,0 0.80938911,0.80938911 0 1 1 1.61878,0 z"
-         transform="matrix(0.77047663,0,0,0.74507628,-63.8586,161.95861)" />
-      <path
-         transform="matrix(0.77047663,0,0,0.74507628,-64.708233,162.88548)"
-         d="m -201.22313,628.93835 a 0.80938911,0.80938911 0 1 1 -1.61878,0 0.80938911,0.80938911 0 1 1 1.61878,0 z"
-         sodipodi:ry="0.80938911"
-         sodipodi:rx="0.80938911"
-         sodipodi:cy="628.93835"
-         sodipodi:cx="-202.03252"
-         id="path32879"
-         style="opacity:0.7;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97113496;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         sodipodi:type="arc" />
-      <path
-         style="opacity:0.35;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;display:inline;enable-background:new"
-         d="m -213.5,621.5 -6,6"
-         id="path32881"
-         sodipodi:nodetypes="cc"
-         inkscape:connector-curvature="0" />
-      <path
-         id="path32883"
-         d="m -212.5,619.5 -2,0 -6.0625,6.0625 C -220.70928,625.548 -220.84942,625.5 -221,625.5 c -2.48528,0 -4.5,2.01473 -4.5,4.5 0,2.48527 2.01472,4.5 4.5,4.5 2.48528,0 4.5,-2.01473 4.5,-4.5 0,-0.14948 -0.017,-0.29176 -0.0312,-0.4375 l 6.0312,-6.0625 0,-2 -2,-2 z"
-         style="fill:none;stroke:#000000;stroke-width:0.69999999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         sodipodi:nodetypes="cccsssscccc"
-         inkscape:connector-curvature="0" />
-      <path
-         transform="translate(-21,0)"
-         sodipodi:type="inkscape:offset"
-         inkscape:radius="-0.95616806"
-         inkscape:original="M -193.5 619.5 L -199.5625 625.5625 C -199.70928 625.548 -199.84942 625.5 -200 625.5 C -202.48528 625.5 -204.5 627.51473 -204.5 630 C -204.5 632.48527 -202.48528 634.5 -200 634.5 C -197.51472 634.5 -195.5 632.48527 -195.5 630 C -195.5 629.85052 -195.51705 629.70824 -195.53125 629.5625 L -189.5 623.5 L -189.5 621.5 L -191.5 619.5 L -193.5 619.5 z "
-         style="fill:none;stroke:url(#radialGradient32905-9-5);stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         id="path32886"
-         d="M -193.09375,620.46875 -198.875,626.25 a 0.95626367,0.95626367 0 0 1 -0.78125,0.25 c -0.29297,-0.0289 -0.39637,-0.0312 -0.34375,-0.0312 -1.96853,0 -3.53125,1.56273 -3.53125,3.53125 0,1.96852 1.56272,3.53125 3.53125,3.53125 1.96853,0 3.53125,-1.56273 3.53125,-3.53125 0,-0.0768 0.0155,-0.18427 0,-0.34375 a 0.95626367,0.95626367 0 0 1 0.25,-0.78125 l 5.75,-5.78125 0,-1.1875 -1.4375,-1.4375 -1.1875,0 z" />
-      <g
-         style="opacity:0.3;fill:#ffffff"
-         id="g32888">
-        <rect
-           style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect32890"
-           width="1"
-           height="0.98873287"
-           x="-217"
-           y="622.98871" />
-        <rect
-           y="624"
-           x="-216"
-           height="0.98873287"
-           width="1"
-           id="rect32892"
-           style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <rect
-           style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           id="rect32894"
-           width="1"
-           height="0.98873287"
-           x="-215"
-           y="624.98871" />
-      </g>
-    </g>
+       id="g30250-6"
+       transform="matrix(-1,0,0,1,788.49395,-2.4863553)" />
     <g
        id="g59188"
        transform="translate(441,-963.36218)"
@@ -78894,147 +84944,5 @@ g48XqJQGQNCwvgNoOXW2y19Ym0NLhbUaYS05F4w1oA3aGKTMqCSSOJH03zo/COTF7Dv/74W/QXmg
          d="m 219.5,605.86218 2.00005,0.0128"
          inkscape:connector-curvature="0" />
     </g>
-    <g
-       style="display:inline;enable-background:new"
-       id="g29932"
-       transform="translate(-126.00002,-168.00003)"
-       inkscape:export-filename="/home/wolter/Documenten/Blender/icons/v.2.5.08/tri.png"
-       inkscape:export-xdpi="90"
-       inkscape:export-ydpi="90">
-      <rect
-         y="346.00003"
-         x="194.00002"
-         height="15.999971"
-         width="15.999971"
-         id="rect41325-5"
-         style="opacity:0;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-      <g
-         id="g29926">
-        <path
-           inkscape:connector-curvature="0"
-           style="opacity:0.55;fill:url(#radialGradient29940);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 202,347.61523 -5.88637,9.59973 5.88637,3.34754 5.86428,-3.39174 z"
-           id="path41327-4"
-           sodipodi:nodetypes="ccccc" />
-        <path
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="ccc"
-           id="path41331-0"
-           d="M 196.3125,357.5 202,354.4375 207.6875,357.5"
-           style="opacity:0.02749999;fill:none;stroke:#1a1a1a;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
-        <path
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cccc"
-           style="fill:#ffb769;fill-opacity:1;fill-rule:nonzero;stroke:#542b00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.8627451;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           d="m 202.01289,347.79311 -5.76159,9.41263 5.71099,3.22682 z"
-           id="path35820-3-3-0"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           inkscape:export-xdpi="90"
-           inkscape:export-ydpi="90" />
-        <path
-           inkscape:connector-curvature="0"
-           inkscape:export-ydpi="90"
-           inkscape:export-xdpi="90"
-           inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\blender-cvs-windows\.blender\.blender\icons\jendrzych's iconset.png"
-           id="path35822-5"
-           d="m 201.96384,360.43934 -5.70169,-3.25 5.73419,-9.4114"
-           style="fill:none;stroke:#462400;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:7.40000265;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-           sodipodi:nodetypes="ccc" />
-      </g>
-    </g>
-    <g
-       style="display:inline;enable-background:new"
-       id="g28913">
-      <rect
-         style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-         id="rect29107-2-4"
-         width="16"
-         height="16"
-         x="89"
-         y="178" />
-      <g
-         transform="translate(0.7527954,0.10835392)"
-         id="g28861">
-        <g
-           id="g56091-4-3"
-           transform="translate(-440.6432,125.89164)">
-          <path
-             style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-             d="m 532,57.5 4,-1.5 7.99996,3.49998 0,1.71875 -3.99999,2.24999 L 532,59.21875 z"
-             id="path29110-0-9"
-             sodipodi:nodetypes="ccccccc"
-             inkscape:connector-curvature="0" />
-          <path
-             id="path29112-19-0"
-             d="m 532,57.5 4,-1.5 7.99996,3.49998 0,0.5 -4,2 L 532,58.06558 z"
-             style="fill:url(#linearGradient28911);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.06666696px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             sodipodi:nodetypes="ccccccc"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90"
-             inkscape:connector-curvature="0" />
-          <path
-             sodipodi:nodetypes="cccccc"
-             style="fill:#252525;fill-opacity:1;fill-rule:evenodd;stroke:none"
-             d="M 532.00001,59.21875 532,58 l 7.99996,3.99998 0.01,1.4676 -8.00991,-4.24883 z"
-             id="path29114-14-3"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90"
-             inkscape:connector-curvature="0" />
-          <path
-             sodipodi:nodetypes="ccccc"
-             id="path29116-5-9"
-             d="m 543.99996,61.21873 0,-1.21875 -4,2 c 0,2.58362 0,0.90165 0,1.46875 z"
-             style="fill:#151515;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89207077px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
-             inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\4.png"
-             inkscape:export-xdpi="90"
-             inkscape:export-ydpi="90"
-             inkscape:connector-curvature="0" />
-          <path
-             sodipodi:nodetypes="ccc"
-             id="path29120-9-7"
-             d="m 536.02638,56.53466 -3.36588,1.240071 7.30821,3.725249"
-             style="opacity:0.6;fill:none;stroke:#606060;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
-             inkscape:connector-curvature="0" />
-        </g>
-        <path
-           style="fill:#e5b363;fill-opacity:1;stroke:#2c1907;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 89.80793,186.9661 1.06791,0.55608 0.8071,-0.42744 c 0,0 -0.0863,-0.49795 0.29882,-0.94997 0.32255,-0.37859 0.61819,-0.48727 0.61819,-0.48727 L 92.6,184.97585 91.49415,184.4 c 0,0 -0.64899,0.0667 -1.26647,0.81355 -0.63732,0.7709 -0.41973,1.75255 -0.41973,1.75255 z"
-           id="path30129"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cccscccscc" />
-        <path
-           style="fill:none;stroke:#ebd49a;stroke-width:0.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.71428576;stroke-dasharray:none"
-           d="m 91.42064,185.14551 c -0.22969,0.0907 -0.46636,0.27389 -0.62977,0.51928"
-           id="path30223"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
-        <path
-           style="fill:#e5b363;fill-opacity:1;stroke:#2c1907;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 95.76565,190.00646 1.06791,0.55608 0.8071,-0.42744 c 0,0 -0.0863,-0.49795 0.29882,-0.94997 0.32255,-0.37859 0.61819,-0.48727 0.61819,-0.48727 l 5e-5,-0.68165 -1.10585,-0.57585 c 0,0 -0.64899,0.0667 -1.26647,0.81355 -0.63732,0.7709 -0.41973,1.75255 -0.41973,1.75255 z"
-           id="path30129-1"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cccscccscc" />
-        <path
-           style="fill:none;stroke:#ebd49a;stroke-width:0.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.71428576;stroke-dasharray:none"
-           d="m 97.37836,188.18587 c -0.22969,0.0907 -0.46636,0.27389 -0.62977,0.51928"
-           id="path30223-1"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
-        <path
-           style="fill:#e5b363;fill-opacity:1;stroke:#2c1907;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;enable-background:new"
-           d="m 92.80464,188.48176 1.06791,0.55608 0.8071,-0.42744 c 0,0 -0.0863,-0.49795 0.29882,-0.94997 0.32255,-0.37859 0.61819,-0.48727 0.61819,-0.48727 l 5e-5,-0.68165 -1.10585,-0.57585 c 0,0 -0.64899,0.0667 -1.26647,0.81355 -0.63732,0.7709 -0.41973,1.75255 -0.41973,1.75255 z"
-           id="path30129-6"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cccscccscc" />
-        <path
-           style="fill:none;stroke:#ebd49a;stroke-width:0.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.71428576;stroke-dasharray:none"
-           d="m 94.41735,186.66117 c -0.22969,0.0907 -0.46636,0.27389 -0.62977,0.51928"
-           id="path30223-8"
-           inkscape:connector-curvature="0"
-           sodipodi:nodetypes="cc" />
-      </g>
-    </g>
   </g>
 </svg>
diff --git a/release/datafiles/blender_icons16.png b/release/datafiles/blender_icons16.png
index 64edb2a..a185192 100644
Binary files a/release/datafiles/blender_icons16.png and b/release/datafiles/blender_icons16.png differ
diff --git a/release/datafiles/blender_icons32.png b/release/datafiles/blender_icons32.png
index 5a2a076..050743e 100644
Binary files a/release/datafiles/blender_icons32.png and b/release/datafiles/blender_icons32.png differ
diff --git a/release/datafiles/locale/ar/LC_MESSAGES/blender.mo b/release/datafiles/locale/ar/LC_MESSAGES/blender.mo
index b663bcb..74f2ed0 100644
Binary files a/release/datafiles/locale/ar/LC_MESSAGES/blender.mo and b/release/datafiles/locale/ar/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/ca/LC_MESSAGES/blender.mo b/release/datafiles/locale/ca/LC_MESSAGES/blender.mo
index 9787b0e..aa0903a 100644
Binary files a/release/datafiles/locale/ca/LC_MESSAGES/blender.mo and b/release/datafiles/locale/ca/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/cs/LC_MESSAGES/blender.mo b/release/datafiles/locale/cs/LC_MESSAGES/blender.mo
index a80c280..541664e 100644
Binary files a/release/datafiles/locale/cs/LC_MESSAGES/blender.mo and b/release/datafiles/locale/cs/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/de/LC_MESSAGES/blender.mo b/release/datafiles/locale/de/LC_MESSAGES/blender.mo
index ab0bf66..2617bf6 100644
Binary files a/release/datafiles/locale/de/LC_MESSAGES/blender.mo and b/release/datafiles/locale/de/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/eo/LC_MESSAGES/blender.mo b/release/datafiles/locale/eo/LC_MESSAGES/blender.mo
index 07ee618..774f864 100644
Binary files a/release/datafiles/locale/eo/LC_MESSAGES/blender.mo and b/release/datafiles/locale/eo/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/es/LC_MESSAGES/blender.mo b/release/datafiles/locale/es/LC_MESSAGES/blender.mo
index 727f9e8..16f8b7b 100644
Binary files a/release/datafiles/locale/es/LC_MESSAGES/blender.mo and b/release/datafiles/locale/es/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/es_ES/LC_MESSAGES/blender.mo b/release/datafiles/locale/es_ES/LC_MESSAGES/blender.mo
index ec1ab02..5c14cfc 100644
Binary files a/release/datafiles/locale/es_ES/LC_MESSAGES/blender.mo and b/release/datafiles/locale/es_ES/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/fa/LC_MESSAGES/blender.mo b/release/datafiles/locale/fa/LC_MESSAGES/blender.mo
index 7354ea1..35f821e 100644
Binary files a/release/datafiles/locale/fa/LC_MESSAGES/blender.mo and b/release/datafiles/locale/fa/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/fr/LC_MESSAGES/blender.mo b/release/datafiles/locale/fr/LC_MESSAGES/blender.mo
index 37b2332..2ea7ac6 100644
Binary files a/release/datafiles/locale/fr/LC_MESSAGES/blender.mo and b/release/datafiles/locale/fr/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/he/LC_MESSAGES/blender.mo b/release/datafiles/locale/he/LC_MESSAGES/blender.mo
index a7d7769..54e75e3 100644
Binary files a/release/datafiles/locale/he/LC_MESSAGES/blender.mo and b/release/datafiles/locale/he/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/hi/LC_MESSAGES/blender.mo b/release/datafiles/locale/hi/LC_MESSAGES/blender.mo
new file mode 100644
index 0000000..b3975a0
Binary files /dev/null and b/release/datafiles/locale/hi/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/hr/LC_MESSAGES/blender.mo b/release/datafiles/locale/hr/LC_MESSAGES/blender.mo
index f9b8ca0..f429386 100644
Binary files a/release/datafiles/locale/hr/LC_MESSAGES/blender.mo and b/release/datafiles/locale/hr/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/hu/LC_MESSAGES/blender.mo b/release/datafiles/locale/hu/LC_MESSAGES/blender.mo
index 5e93f32..87aa552 100644
Binary files a/release/datafiles/locale/hu/LC_MESSAGES/blender.mo and b/release/datafiles/locale/hu/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/id/LC_MESSAGES/blender.mo b/release/datafiles/locale/id/LC_MESSAGES/blender.mo
index 95ceea5..26b75f0 100644
Binary files a/release/datafiles/locale/id/LC_MESSAGES/blender.mo and b/release/datafiles/locale/id/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/it/LC_MESSAGES/blender.mo b/release/datafiles/locale/it/LC_MESSAGES/blender.mo
index 2f0ce24..d928f19 100644
Binary files a/release/datafiles/locale/it/LC_MESSAGES/blender.mo and b/release/datafiles/locale/it/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/ja/LC_MESSAGES/blender.mo b/release/datafiles/locale/ja/LC_MESSAGES/blender.mo
index 95cb652..4cba9f8 100644
Binary files a/release/datafiles/locale/ja/LC_MESSAGES/blender.mo and b/release/datafiles/locale/ja/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/ko/LC_MESSAGES/blender.mo b/release/datafiles/locale/ko/LC_MESSAGES/blender.mo
new file mode 100644
index 0000000..c7ad6a3
Binary files /dev/null and b/release/datafiles/locale/ko/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/ky/LC_MESSAGES/blender.mo b/release/datafiles/locale/ky/LC_MESSAGES/blender.mo
index 1ebe68c..440e1bd 100644
Binary files a/release/datafiles/locale/ky/LC_MESSAGES/blender.mo and b/release/datafiles/locale/ky/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/languages b/release/datafiles/locale/languages
index b7b74ad..ab030a8 100644
--- a/release/datafiles/locale/languages
+++ b/release/datafiles/locale/languages
@@ -7,34 +7,40 @@
 # Line starting with a # are comments!
 #
 # Automatically generated by bl_i18n_utils/update_languages_menu.py script.
-# Highest ID currently in use: 39
+# Highest ID currently in use: 40
 #
 0:Complete::
 0:Default (Default):DEFAULT
 1:English (English):en_US
 9:Spanish (Español):es
 8:French (Français):fr_FR
+40:Hindi (मानक हिन्दी):hi_IN
+2:Japanese (日本語):ja_JP
 32:Brazilian Portuguese (Português do Brasil):pt_BR
 12:Portuguese (Português):pt_PT
 15:Russian (Русский):ru_RU
 18:Ukrainian (Український):uk_UA
+13:Simplified Chinese (简体中文):zh_CN
 #
 0:In Progress::
 21:Arabic (ﺔﻴﺑﺮﻌﻟﺍ):ar_EG
+10:Catalan (Català):ca_AD
+11:Czech (Český):cs_CZ
 5:German (Deutsch):de_DE
+36:Spanish from Spain (Español de España):es_ES
 4:Italian (Italiano):it_IT
-2:Japanese (日本語):ja_JP
-13:Simplified Chinese (简体中文):zh_CN
+24:Korean (한국 언어):ko_KR
+17:Serbian (Српски):sr_RS
+28:Serbian Latin (Srpski latinica):sr_RS at latin
+7:Swedish (Svenska):sv_SE
+30:Turkish (Türkçe):tr_TR
 14:Traditional Chinese (繁體中文):zh_TW
 #
 0:Starting::
 # No translation yet! #37:Amharic (አማርኛ):am_ET
 # No translation yet! #22:Bulgarian (Български):bg_BG
-10:Catalan (Català):ca_AD
-11:Czech (Český):cs_CZ
 # No translation yet! #23:Greek (Ελληνικά):el_GR
 35:Esperanto (Esperanto):eo
-36:Spanish from Spain (Español de España):es_ES
 # No translation yet! #34:Estonian (Eestlane):et_EE
 26:Persian (ﯽﺳﺭﺎﻓ):fa_IR
 # No translation yet! #6:Finnish (Suomi):fi_FI
@@ -42,15 +48,10 @@
 16:Croatian (Hrvatski):hr_HR
 31:Hungarian (Magyar):hu_HU
 27:Indonesian (Bahasa indonesia):id_ID
-# No translation yet! #24:Korean (한국 언어):ko_KR
 29:Kyrgyz (Кыргыз тили):ky_KG
 # No translation yet! #25:Nepali (नेपाली):ne_NP
 3:Dutch (Nederlandse taal):nl_NL
 # No translation yet! #19:Polish (Polski):pl_PL
 # No translation yet! #20:Romanian (Român):ro_RO
-17:Serbian (Српски):sr_RS
-28:Serbian Latin (Srpski latinica):sr_RS at latin
-7:Swedish (Svenska):sv_SE
-30:Turkish (Türkçe):tr_TR
 # No translation yet! #38:Uzbek (Oʻzbek):uz_UZ
 # No translation yet! #39:Uzbek Cyrillic (Ўзбек):uz_UZ at cyrillic
diff --git a/release/datafiles/locale/nl/LC_MESSAGES/blender.mo b/release/datafiles/locale/nl/LC_MESSAGES/blender.mo
index 451cce5..2341b20 100644
Binary files a/release/datafiles/locale/nl/LC_MESSAGES/blender.mo and b/release/datafiles/locale/nl/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/pt/LC_MESSAGES/blender.mo b/release/datafiles/locale/pt/LC_MESSAGES/blender.mo
index b118a44..5d43f9a 100644
Binary files a/release/datafiles/locale/pt/LC_MESSAGES/blender.mo and b/release/datafiles/locale/pt/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/pt_BR/LC_MESSAGES/blender.mo b/release/datafiles/locale/pt_BR/LC_MESSAGES/blender.mo
index 5001b4e..0911a2f 100644
Binary files a/release/datafiles/locale/pt_BR/LC_MESSAGES/blender.mo and b/release/datafiles/locale/pt_BR/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/ru/LC_MESSAGES/blender.mo b/release/datafiles/locale/ru/LC_MESSAGES/blender.mo
index 49034fb..b59f723 100644
Binary files a/release/datafiles/locale/ru/LC_MESSAGES/blender.mo and b/release/datafiles/locale/ru/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/sr/LC_MESSAGES/blender.mo b/release/datafiles/locale/sr/LC_MESSAGES/blender.mo
index df42978..574707b 100644
Binary files a/release/datafiles/locale/sr/LC_MESSAGES/blender.mo and b/release/datafiles/locale/sr/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/sr at latin/LC_MESSAGES/blender.mo b/release/datafiles/locale/sr at latin/LC_MESSAGES/blender.mo
index d5efeff..db22dd6 100644
Binary files a/release/datafiles/locale/sr at latin/LC_MESSAGES/blender.mo and b/release/datafiles/locale/sr at latin/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/sv/LC_MESSAGES/blender.mo b/release/datafiles/locale/sv/LC_MESSAGES/blender.mo
index 820d611..dd63ce6 100644
Binary files a/release/datafiles/locale/sv/LC_MESSAGES/blender.mo and b/release/datafiles/locale/sv/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/tr/LC_MESSAGES/blender.mo b/release/datafiles/locale/tr/LC_MESSAGES/blender.mo
index 5e071cb..fb48e2d 100644
Binary files a/release/datafiles/locale/tr/LC_MESSAGES/blender.mo and b/release/datafiles/locale/tr/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/uk/LC_MESSAGES/blender.mo b/release/datafiles/locale/uk/LC_MESSAGES/blender.mo
index 81e9f7f..05010a4 100644
Binary files a/release/datafiles/locale/uk/LC_MESSAGES/blender.mo and b/release/datafiles/locale/uk/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/zh_CN/LC_MESSAGES/blender.mo b/release/datafiles/locale/zh_CN/LC_MESSAGES/blender.mo
index 1969d2b..7b83dc8 100644
Binary files a/release/datafiles/locale/zh_CN/LC_MESSAGES/blender.mo and b/release/datafiles/locale/zh_CN/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/locale/zh_TW/LC_MESSAGES/blender.mo b/release/datafiles/locale/zh_TW/LC_MESSAGES/blender.mo
index 0864653..f29c052 100644
Binary files a/release/datafiles/locale/zh_TW/LC_MESSAGES/blender.mo and b/release/datafiles/locale/zh_TW/LC_MESSAGES/blender.mo differ
diff --git a/release/datafiles/matcaps/license.txt b/release/datafiles/matcaps/license.txt
new file mode 100644
index 0000000..358c8dc
--- /dev/null
+++ b/release/datafiles/matcaps/license.txt
@@ -0,0 +1,3 @@
+These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code.
+
+Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures.
diff --git a/release/datafiles/matcaps/mc01.jpg b/release/datafiles/matcaps/mc01.jpg
new file mode 100644
index 0000000..8c7aef2
Binary files /dev/null and b/release/datafiles/matcaps/mc01.jpg differ
diff --git a/release/datafiles/matcaps/mc02.jpg b/release/datafiles/matcaps/mc02.jpg
new file mode 100644
index 0000000..11deddf
Binary files /dev/null and b/release/datafiles/matcaps/mc02.jpg differ
diff --git a/release/datafiles/matcaps/mc03.jpg b/release/datafiles/matcaps/mc03.jpg
new file mode 100644
index 0000000..64d992f
Binary files /dev/null and b/release/datafiles/matcaps/mc03.jpg differ
diff --git a/release/datafiles/matcaps/mc04.jpg b/release/datafiles/matcaps/mc04.jpg
new file mode 100644
index 0000000..42be580
Binary files /dev/null and b/release/datafiles/matcaps/mc04.jpg differ
diff --git a/release/datafiles/matcaps/mc05.jpg b/release/datafiles/matcaps/mc05.jpg
new file mode 100644
index 0000000..586d233
Binary files /dev/null and b/release/datafiles/matcaps/mc05.jpg differ
diff --git a/release/datafiles/matcaps/mc06.jpg b/release/datafiles/matcaps/mc06.jpg
new file mode 100644
index 0000000..657883d
Binary files /dev/null and b/release/datafiles/matcaps/mc06.jpg differ
diff --git a/release/datafiles/matcaps/mc07.jpg b/release/datafiles/matcaps/mc07.jpg
new file mode 100644
index 0000000..372caf7
Binary files /dev/null and b/release/datafiles/matcaps/mc07.jpg differ
diff --git a/release/datafiles/matcaps/mc08.jpg b/release/datafiles/matcaps/mc08.jpg
new file mode 100644
index 0000000..50eec40
Binary files /dev/null and b/release/datafiles/matcaps/mc08.jpg differ
diff --git a/release/datafiles/matcaps/mc09.jpg b/release/datafiles/matcaps/mc09.jpg
new file mode 100644
index 0000000..e05d441
Binary files /dev/null and b/release/datafiles/matcaps/mc09.jpg differ
diff --git a/release/datafiles/matcaps/mc10.jpg b/release/datafiles/matcaps/mc10.jpg
new file mode 100644
index 0000000..ab82f17
Binary files /dev/null and b/release/datafiles/matcaps/mc10.jpg differ
diff --git a/release/datafiles/matcaps/mc11.jpg b/release/datafiles/matcaps/mc11.jpg
new file mode 100644
index 0000000..053550f
Binary files /dev/null and b/release/datafiles/matcaps/mc11.jpg differ
diff --git a/release/datafiles/matcaps/mc12.jpg b/release/datafiles/matcaps/mc12.jpg
new file mode 100644
index 0000000..beb16f3
Binary files /dev/null and b/release/datafiles/matcaps/mc12.jpg differ
diff --git a/release/datafiles/matcaps/mc13.jpg b/release/datafiles/matcaps/mc13.jpg
new file mode 100644
index 0000000..7fb8fa5
Binary files /dev/null and b/release/datafiles/matcaps/mc13.jpg differ
diff --git a/release/datafiles/matcaps/mc14.jpg b/release/datafiles/matcaps/mc14.jpg
new file mode 100644
index 0000000..ba868d2
Binary files /dev/null and b/release/datafiles/matcaps/mc14.jpg differ
diff --git a/release/datafiles/matcaps/mc15.jpg b/release/datafiles/matcaps/mc15.jpg
new file mode 100644
index 0000000..b10ea32
Binary files /dev/null and b/release/datafiles/matcaps/mc15.jpg differ
diff --git a/release/datafiles/matcaps/mc16.jpg b/release/datafiles/matcaps/mc16.jpg
new file mode 100644
index 0000000..c6ce02d
Binary files /dev/null and b/release/datafiles/matcaps/mc16.jpg differ
diff --git a/release/datafiles/matcaps/mc17.jpg b/release/datafiles/matcaps/mc17.jpg
new file mode 100644
index 0000000..14f15f7
Binary files /dev/null and b/release/datafiles/matcaps/mc17.jpg differ
diff --git a/release/datafiles/matcaps/mc18.jpg b/release/datafiles/matcaps/mc18.jpg
new file mode 100644
index 0000000..db57285
Binary files /dev/null and b/release/datafiles/matcaps/mc18.jpg differ
diff --git a/release/datafiles/matcaps/mc19.jpg b/release/datafiles/matcaps/mc19.jpg
new file mode 100644
index 0000000..56d2efb
Binary files /dev/null and b/release/datafiles/matcaps/mc19.jpg differ
diff --git a/release/datafiles/matcaps/mc20.jpg b/release/datafiles/matcaps/mc20.jpg
new file mode 100644
index 0000000..002a091
Binary files /dev/null and b/release/datafiles/matcaps/mc20.jpg differ
diff --git a/release/datafiles/matcaps/mc21.jpg b/release/datafiles/matcaps/mc21.jpg
new file mode 100644
index 0000000..cb2fea5
Binary files /dev/null and b/release/datafiles/matcaps/mc21.jpg differ
diff --git a/release/datafiles/matcaps/mc22.jpg b/release/datafiles/matcaps/mc22.jpg
new file mode 100644
index 0000000..2fc71b9
Binary files /dev/null and b/release/datafiles/matcaps/mc22.jpg differ
diff --git a/release/datafiles/matcaps/mc23.jpg b/release/datafiles/matcaps/mc23.jpg
new file mode 100644
index 0000000..3793c0f
Binary files /dev/null and b/release/datafiles/matcaps/mc23.jpg differ
diff --git a/release/datafiles/matcaps/mc24.jpg b/release/datafiles/matcaps/mc24.jpg
new file mode 100644
index 0000000..2a9618d
Binary files /dev/null and b/release/datafiles/matcaps/mc24.jpg differ
diff --git a/release/datafiles/preview_cycles.blend b/release/datafiles/preview_cycles.blend
new file mode 100644
index 0000000..11bf8bb
Binary files /dev/null and b/release/datafiles/preview_cycles.blend differ
diff --git a/release/datafiles/splash.png b/release/datafiles/splash.png
index 41284ef..7affcab 100644
Binary files a/release/datafiles/splash.png and b/release/datafiles/splash.png differ
diff --git a/release/datafiles/startup.blend b/release/datafiles/startup.blend
index 599bfb5..d19cd41 100644
Binary files a/release/datafiles/startup.blend and b/release/datafiles/startup.blend differ
diff --git a/release/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py b/release/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py
index 5cc5405..54081d6 100644
--- a/release/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py
+++ b/release/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py
@@ -282,6 +282,7 @@ def add_gear(teethNum, radius, Ad, De, base, p_angle,
     if rack:
         teethNum = 1
 
+    print(radius, width, conangle)
     scale = (radius - 2 * width * tan(conangle)) / radius
 
     verts = []
@@ -584,46 +585,55 @@ class AddGear(bpy.types.Operator):
         description="Radius of the gear, negative for crown gear",
         min=-100.0,
         max=100.0,
+        unit='LENGTH',
         default=1.0)
     addendum = FloatProperty(name="Addendum",
         description="Addendum, extent of tooth above radius",
         min=0.01,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     dedendum = FloatProperty(name="Dedendum",
         description="Dedendum, extent of tooth below radius",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     angle = FloatProperty(name="Pressure Angle",
-        description="Pressure angle, skewness of tooth tip (degrees)",
+        description="Pressure angle, skewness of tooth tip",
         min=0.0,
-        max=45.0,
+        max=radians(45.0),
+        unit='ROTATION',
         default=20.0)
     base = FloatProperty(name="Base",
         description="Base, extent of gear below radius",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.2)
     width = FloatProperty(name="Width",
         description="Width, thickness of gear",
         min=0.05,
         max=100.0,
+        unit='LENGTH',
         default=0.2)
     skew = FloatProperty(name="Skewness",
-        description="Skew of teeth (degrees)",
-        min=-90.0,
-        max=90.0,
+        description="Skew of teeth",
+        min=radians(-90.0),
+        max=radians(90.0),
+        unit='ROTATION',
         default=0.0)
     conangle = FloatProperty(name="Conical angle",
-        description="Conical angle of gear (degrees)",
+        description="Conical angle of gear",
         min=0.0,
-        max=90.0,
+        max=radians(90.0),
+        unit='ROTATION',
         default=0.0)
     crown = FloatProperty(name="Crown",
         description="Inward pointing extend of crown teeth",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.0)
 
     def draw(self, context):
@@ -655,10 +665,10 @@ class AddGear(bpy.types.Operator):
             self.addendum,
             self.dedendum,
             self.base,
-            radians(self.angle),
+            self.angle,
             width=self.width,
-            skew=radians(self.skew),
-            conangle=radians(self.conangle),
+            skew=self.skew,
+            conangle=self.conangle,
             crown=self.crown)
 
         # Actually create the mesh object from this geometry data.
@@ -695,36 +705,43 @@ class AddWormGear(bpy.types.Operator):
         description="Radius of the gear, negative for crown gear",
         min=-100.0,
         max=100.0,
+        unit='LENGTH',
         default=1.0)
     addendum = FloatProperty(name="Addendum",
         description="Addendum, extent of tooth above radius",
         min=0.01,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     dedendum = FloatProperty(name="Dedendum",
         description="Dedendum, extent of tooth below radius",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     angle = FloatProperty(name="Pressure Angle",
-        description="Pressure angle, skewness of tooth tip (degrees)",
+        description="Pressure angle, skewness of tooth tip",
         min=0.0,
-        max=45.0,
-        default=20.0)
+        max=radians(45.0),
+        default=radians(20.0),
+        unit='ROTATION')
     row_height = FloatProperty(name="Row Height",
         description="Height of each Row",
         min=0.05,
         max=100.0,
+        unit='LENGTH',
         default=0.2)
     skew = FloatProperty(name="Skewness per Row",
-        description="Skew of each row (degrees)",
-        min=-90.0,
-        max=90.0,
-        default=11.25)
+        description="Skew of each row",
+        min=radians(-90.0),
+        max=radians(90.0),
+        default=radians(11.25),
+        unit='ROTATION')
     crown = FloatProperty(name="Crown",
         description="Inward pointing extend of crown teeth",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.0)
 
     def draw(self, context):
@@ -750,9 +767,9 @@ class AddWormGear(bpy.types.Operator):
             self.radius,
             self.addendum,
             self.dedendum,
-            radians(self.angle),
+            self.angle,
             width=self.row_height,
-            skew=radians(self.skew),
+            skew=self.skew,
             crown=self.crown)
 
         # Actually create the mesh object from this geometry data.
diff --git a/release/scripts/addons/io_anim_acclaim/__init__.py b/release/scripts/addons/io_anim_acclaim/__init__.py
index 4b5b423..e47f50f 100644
--- a/release/scripts/addons/io_anim_acclaim/__init__.py
+++ b/release/scripts/addons/io_anim_acclaim/__init__.py
@@ -25,8 +25,8 @@
 bl_info = {
     "name": "Acclaim Motion Capture Files (.asf, .amc)",
     "author": "Daniel Monteiro Basso <daniel at basso.inf.br>",
-    "version": (2012, 2, 29, 1),
-    "blender": (2, 62, 0),
+    "version": (2013, 1, 26, 1),
+    "blender": (2, 65, 9),
     "location": "File > Import-Export",
     "description": "Imports Acclaim Skeleton and Motion Capture Files",
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
@@ -360,9 +360,9 @@ class AsfImporter(bpy.types.Operator):
         sb.create_armature()
         sb.build_structure(self.use_limits)
         if self.use_rot_x:
-            bpy.ops.transform.rotate(value=(radians(90.0),), axis=(1, 0, 0))
+            bpy.ops.transform.rotate(value=radians(90.0), axis=(1, 0, 0))
         if self.use_rot_z:
-            bpy.ops.transform.rotate(value=(radians(90.0),), axis=(0, 0, 1))
+            bpy.ops.transform.rotate(value=radians(90.0), axis=(0, 0, 1))
         return {'FINISHED'}
 
     def invoke(self, context, event):
diff --git a/release/scripts/addons/io_anim_c3d/__init__.py b/release/scripts/addons/io_anim_c3d/__init__.py
index 4ecc9da..0270455 100644
--- a/release/scripts/addons/io_anim_c3d/__init__.py
+++ b/release/scripts/addons/io_anim_c3d/__init__.py
@@ -25,8 +25,8 @@
 bl_info = {
     "name": "C3D Graphics Lab Motion Capture file (.c3d)",
     "author": "Daniel Monteiro Basso <daniel at basso.inf.br>",
-    "version": (2012, 7, 11, 1),
-    "blender": (2, 63, 0),
+    "version": (2013, 2, 16, 1),
+    "blender": (2, 65, 9),
     "location": "File > Import",
     "description": "Imports C3D Graphics Lab Motion Capture files",
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
diff --git a/release/scripts/addons/io_anim_c3d/import_c3d.py b/release/scripts/addons/io_anim_c3d/import_c3d.py
index 0c8cd8f..9381a53 100644
--- a/release/scripts/addons/io_anim_c3d/import_c3d.py
+++ b/release/scripts/addons/io_anim_c3d/import_c3d.py
@@ -204,6 +204,13 @@ class MarkerSet:
                 break
         # pg should be 'POINT', but let's be liberal and accept any group
         self.markerLabels = self.paramGroups[pg].params['LABELS'].decode()
+        repeats = {}
+        for i, m in enumerate(self.markerLabels):
+            if m in repeats:
+                self.markerLabels[i] = '{}.{}'.format(m, repeats[m])
+                repeats[m] += 1
+            else:
+                repeats[m] = 1
 
     def readMarker(self, infile):
         pass  # ...
diff --git a/release/scripts/addons/io_export_unreal_psk_psa.py b/release/scripts/addons/io_export_unreal_psk_psa.py
index 90c5a97..293b4c9 100644
--- a/release/scripts/addons/io_export_unreal_psk_psa.py
+++ b/release/scripts/addons/io_export_unreal_psk_psa.py
@@ -20,8 +20,7 @@ bl_info = {
     "name": "Export Unreal Engine Format(.psk/.psa)",
     "author": "Darknet/Optimus_P-Fat/Active_Trash/Sinsoft/VendorX/Spoof",
     "version": (2, 7),
-    "blender": (2, 65, 0),
-    "api": 36079,
+    "blender": (2, 65, 4),
     "location": "File > Export > Skeletal Mesh/Animation Data (.psk/.psa)",
     "description": "Export Skeleletal Mesh/Animation Data",
     "warning": "",
@@ -1038,7 +1037,7 @@ def parse_mesh( mesh, psk ):
     points_linked   = {}
     
     discarded_face_count = 0
-
+    sys.setrecursionlimit(1000000)
     smoothgroup_list = parse_smooth_groups(mesh.data)
     
     print("{} faces".format(len(mesh.data.tessfaces)))
@@ -1285,11 +1284,16 @@ def parse_mesh( mesh, psk ):
                     p.Point.X       = vpos.x
                     p.Point.Y       = vpos.y 
                     p.Point.Z       = vpos.z
-                        
-                    for point in points_linked[p]:
-                        point_index = points.get(point) #point index
-                        v_item      = (point_index, vertex_weight)
-                        vertex_list.append(v_item)
+                    #print(p)
+                    #print(len(points_linked[p]))
+                    try: #check if point doesn't give error
+                        for point in points_linked[p]:
+                            point_index = points.get(point) #point index
+                            v_item      = (point_index, vertex_weight)
+                            vertex_list.append(v_item)
+                    except Exception:#if get error ignore them #not safe I think
+                        print("Error link points!")
+                        pass
                     
         #bone name, [point id and wieght]
         #print("Add Vertex Group:",obj_vertex_group.name, " No. Points:",len(vertex_list))
@@ -1444,19 +1448,7 @@ def parse_animation( armature, udk_bones, actions_to_export, psa ):
         if not len(action.fcurves):
             print("{} has no keys, skipping".format(action.name))
             continue
-        '''
-        if bpy.context.scene.udk_option_selectanimations:
-            print("Action Set is selected!")
-            bready = False
-            for actionlist in bpy.context.scene.udkas_list:
-                if actionlist.name == action.name and actionlist.bmatch == True and actionlist.bexport == True:
-                    bready = True
-                    print("Added Action Set:",action.name)
-                    break
-            if bready == False:#don't export it
-                print("Skipping Action Set:",action.name)
-                continue
-        '''
+
         # apply action to armature and update scene
         # note if loop all actions that is not armature it will override and will break armature animation.
         armature.animation_data.action = action
@@ -1615,10 +1607,11 @@ def find_armature_and_mesh():
         else:
             raise Error("There is no Armature in the list!")
         meshselected = []
-        parented_meshes = [obj for obj in armature.children if obj.type == 'MESH']
-        for obj in armature.children:
+        #parented_meshes = [obj for obj in armature.children if obj.type == 'MESH']
+        meshes = [obj for obj in bpy.context.scene.objects if obj.type == 'MESH']
+        for obj in meshes:
             #print(dir(obj))
-            if obj.type == 'MESH' and obj.select == True:
+            if obj.type == 'MESH':
                 bexportmesh = False
                 #print("PARENT MESH:",obj.name)
                 for udkmeshlist in bpy.context.scene.udkmesh_list:
@@ -1638,12 +1631,12 @@ def find_armature_and_mesh():
     
         # otherwise, expect a single mesh parented to the armature (other object types are ignored)
         else:
-            print("Number of meshes:",len(parented_meshes))
-            print("Number of meshes (selected):",len(meshselected))
-            if len(parented_meshes) == 1:
-                mesh = parented_meshes[0]
+            print("Number of meshes:",len(meshes))
+            print("Number of meshes (selected):",len(meshes))
+            if len(meshes) == 1:
+                mesh = meshes[0]
                 
-            elif len(parented_meshes) > 1:
+            elif len(meshes) > 1:
                 if len(meshselected) >= 1:
                     mesh = sortmesh(meshselected)
                 else:
@@ -1661,10 +1654,17 @@ def find_armature_and_mesh():
             #bpy.ops.object.mode_set(mode='OBJECT')
             all_armatures = [obj for obj in bpy.context.scene.objects if obj.type == 'ARMATURE']
             
-            if len(all_armatures) == 1:
+            if len(all_armatures) == 1:#if armature has one scene just assign it
                 armature = all_armatures[0]
-            elif len(all_armatures) > 1:
-                raise Error("Please select an armature in the scene")
+            elif len(all_armatures) > 1:#if there more armature then find the select armature
+                barmselect = False
+                for _armobj in all_armatures:
+                    if _armobj.select:
+                        armature = _armobj
+                        barmselect = True
+                        break
+                if barmselect == False:
+                    raise Error("Please select an armatures in the scene")
             else:
                 raise Error("No armatures in scene")
         
@@ -1672,6 +1672,10 @@ def find_armature_and_mesh():
         
         meshselected = []
         parented_meshes = [obj for obj in armature.children if obj.type == 'MESH']
+        
+        if len(armature.children) == 0:
+            raise Error("The selected Armature has no mesh parented to the Armature Object!")
+        
         for obj in armature.children:
             #print(dir(obj))
             if obj.type == 'MESH' and obj.select == True:
@@ -1821,10 +1825,9 @@ def export(filepath):
 # Operator
 #===========================================================================
 class Operator_UDKExport( bpy.types.Operator ):
-
+    """Export to UDK"""
     bl_idname   = "object.udk_export"
     bl_label    = "Export now"
-    __doc__     = "Export to UDK"
     
     def execute(self, context):
         print( "\n"*8 )
@@ -1861,10 +1864,9 @@ class Operator_UDKExport( bpy.types.Operator ):
 # Operator
 #===========================================================================
 class Operator_ToggleConsole( bpy.types.Operator ):
-
+    """Show or hide the console"""
     bl_idname   = "object.toggle_console"
     bl_label    = "Toggle console"
-    __doc__     = "Show or hide the console"
     
     #def invoke(self, context, event):
     #   bpy.ops.wm.console_toggle()
@@ -1967,9 +1969,9 @@ bpy.types.Scene.udk_option_scale = FloatProperty(
 # User interface
 #===========================================================================
 class OBJECT_OT_UTSelectedFaceSmooth(bpy.types.Operator):
+    """It will only select smooth faces that is select mesh"""
     bl_idname = "object.utselectfacesmooth"  # XXX, name???
     bl_label = "Select Smooth Faces"#"Select Smooth faces"
-    __doc__ = """It will only select smooth faces that is select mesh"""
     
     def invoke(self, context, event):
         print("----------------------------------------")
@@ -2010,9 +2012,9 @@ class OBJECT_OT_UTSelectedFaceSmooth(bpy.types.Operator):
         return{'FINISHED'}
         
 class OBJECT_OT_MeshClearWeights(bpy.types.Operator):
+    """Remove all mesh vertex groups weights for the bones."""
     bl_idname = "object.meshclearweights"  # XXX, name???
     bl_label = "Remove Vertex Weights"#"Remove Mesh vertex weights"
-    __doc__ = """Remove all mesh vertex groups weights for the bones."""
     
     def invoke(self, context, event):
         for obj in bpy.data.objects:
@@ -2125,9 +2127,10 @@ def rebuildmesh(obj):
     return obmesh
 
 class OBJECT_OT_UTRebuildMesh(bpy.types.Operator):
+    """It rebuild the mesh from scrape from the selected mesh object. """ \
+    """Note the scale will be 1:1 for object mode. To keep from deforming"""
     bl_idname = "object.utrebuildmesh"  # XXX, name???
     bl_label = "Rebuild Mesh"#"Rebuild Mesh"
-    __doc__ = """It rebuild the mesh from scrape from the selected mesh object. Note the scale will be 1:1 for object mode. To keep from deforming"""
     
     def invoke(self, context, event):
         print("----------------------------------------")
@@ -2150,7 +2153,7 @@ def rebuildarmature(obj):
     armdata = bpy.data.armatures.new(objectname)
     ob_new = bpy.data.objects.new(meshname, armdata)
     bpy.context.scene.objects.link(ob_new)
-    bpy.ops.object.mode_set(mode='OBJECT')
+    #bpy.ops.object.mode_set(mode='OBJECT')
     for i in bpy.context.scene.objects: i.select = False #deselect all objects
     ob_new.select = True
     bpy.context.scene.objects.active = obj
@@ -2186,9 +2189,11 @@ def rebuildarmature(obj):
     return ob_new
         
 class OBJECT_OT_UTRebuildArmature(bpy.types.Operator):
+    """If mesh is deform when importing to unreal engine try this. """ \
+    """It rebuild the bones one at the time by select one armature object scrape to raw setup build. """ \
+    """Note the scale will be 1:1 for object mode. To keep from deforming"""
     bl_idname = "object.utrebuildarmature"  # XXX, name???
     bl_label = "Rebuild Armature" #Rebuild Armature
-    __doc__ = """If mesh is deform when importing to unreal engine try this. It rebuild the bones one at the time by select one armature object scrape to raw setup build. Note the scale will be 1:1 for object mode. To keep from deforming"""
     
     def invoke(self, context, event):
         print("----------------------------------------")
@@ -2208,48 +2213,68 @@ class UDKActionSetListPG(bpy.types.PropertyGroup):
     actionname  = StringProperty()
     bmatch    = BoolProperty(default=False,name="Match", options={"HIDDEN"},description = "This check against bone names and action group names matches and override boolean if true.")
     bexport    = BoolProperty(default=False,name="Export",description = "Check this to export the animation")
-    template_list_controls = StringProperty(default="bmatch:bexport", options={"HIDDEN"})
 
 bpy.utils.register_class(UDKActionSetListPG)
 bpy.types.Scene.udkas_list = CollectionProperty(type=UDKActionSetListPG)
 bpy.types.Scene.udkas_list_idx = IntProperty()
 
+class UL_UDKActionSetList(bpy.types.UIList):
+    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+        layout.label(item.name)
+        layout.prop(item, "bmatch", text="Match")
+        layout.prop(item, "bexport", text="Export")
+
 class UDKObjListPG(bpy.types.PropertyGroup):
     bool    = BoolProperty(default=False)
     string  = StringProperty()
     bexport    = BoolProperty(default=False,name="Export", options={"HIDDEN"},description = "This will be ignore when exported")
     bselect    = BoolProperty(default=False,name="Select", options={"HIDDEN"},description = "This will be ignore when exported")
     otype  = StringProperty(name="Type",description = "This will be ignore when exported")
-    template_list_controls = StringProperty(default="otype:bselect", options={"HIDDEN"})
 
 bpy.utils.register_class(UDKObjListPG)
 bpy.types.Scene.udkobj_list = CollectionProperty(type=UDKObjListPG)
 bpy.types.Scene.udkobj_list_idx = IntProperty()
 
+class UL_UDKObjList(bpy.types.UIList):
+    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+        layout.label(item.name)
+        layout.prop(item, "otype", text="")
+        layout.prop(item, "bselect", text="")
+
 class UDKMeshListPG(bpy.types.PropertyGroup):
     bool    = BoolProperty(default=False)
     string  = StringProperty()
     bexport    = BoolProperty(default=False,name="Export", options={"HIDDEN"},description = "This object will be export when true.")
     bselect    = BoolProperty(default=False,name="Select", options={"HIDDEN"},description = "Make sure you have Mesh is parent to Armature.")
     otype  = StringProperty(name="Type",description = "This will be ignore when exported")
-    template_list_controls = StringProperty(default="bselect:bexport", options={"HIDDEN"})
 
 bpy.utils.register_class(UDKMeshListPG)
 bpy.types.Scene.udkmesh_list = CollectionProperty(type=UDKMeshListPG)
 bpy.types.Scene.udkmesh_list_idx = IntProperty()
 
+class UL_UDKMeshList(bpy.types.UIList):
+    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+        layout.label(item.name)
+        layout.prop(item, "bselect", text="Select")
+        layout.prop(item, "bexport", text="Export")
+
 class UDKArmListPG(bpy.types.PropertyGroup):
     bool    = BoolProperty(default=False)
     string  = StringProperty()
     bexport    = BoolProperty(default=False,name="Export", options={"HIDDEN"},description = "This will be ignore when exported")
     bselect    = BoolProperty(default=False,name="Select", options={"HIDDEN"},description = "This will be ignore when exported")
     otype  = StringProperty(name="Type",description = "This will be ignore when exported")
-    template_list_controls = StringProperty(default="", options={"HIDDEN"})
 
 bpy.utils.register_class(UDKArmListPG)
 bpy.types.Scene.udkArm_list = CollectionProperty(type=UDKArmListPG)
 bpy.types.Scene.udkArm_list_idx = IntProperty()
 
+class UL_UDKArmList(bpy.types.UIList):
+    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+        layout.label(item.name)
+        layout.prop(item, "bselect", text="Select")
+        layout.prop(item, "bexport", text="Export")
+
 class Panel_UDKExport( bpy.types.Panel ):
 
     bl_label        = "UDK Export"
@@ -2295,14 +2320,17 @@ class Panel_UDKExport( bpy.types.Panel ):
         if context.scene.udk_option_selectobjects:
             layout.operator("object.selobjectpdate")
             layout.label(text="ARMATURE")
-            layout.template_list(context.scene, "udkArm_list", context.scene, "udkArm_list_idx",prop_list="template_list_controls", rows=3)
-            layout.label(text="MESH")
-            layout.template_list(context.scene, "udkmesh_list", context.scene, "udkmesh_list_idx",prop_list="template_list_controls", rows=5)
+            layout.template_list("UL_UDKArmList", "udk_armatures", context.scene, "udkArm_list",
+                                 context.scene, "udkArm_list_idx", rows=3)
+            layout.label(text="MESH - Select / Export")
+            layout.template_list("UL_UDKMeshList", "", context.scene, "udkmesh_list",
+                                 context.scene, "udkmesh_list_idx", rows=5)
         layout.prop(context.scene, "udk_option_selectanimations")
         if context.scene.udk_option_selectanimations:
             layout.operator("action.setanimupdate")
-            layout.label(text="Action Set(s)")
-            layout.template_list(context.scene, "udkas_list", context.scene, "udkas_list_idx",prop_list="template_list_controls", rows=5)
+            layout.label(text="Action Set(s) - Match / Export")
+            layout.template_list("UL_UDKActionSetList", "", context.scene, "udkas_list",
+                                 context.scene, "udkas_list_idx", rows=5)
         test = layout.separator()
         layout.prop(context.scene, "udk_option_scale")
         layout.prop(context.scene, "udk_option_rebuildobjects")
@@ -2390,9 +2418,10 @@ def udkupdateobjects():
                 count += 1
                 
 class OBJECT_OT_UDKObjUpdate(bpy.types.Operator):
+    """This will update the filter of the mesh and armature."""
     bl_idname = "object.selobjectpdate"
     bl_label = "Update Object(s)"
-    __doc__     = "This will update the filter of the mesh and armature."
+    
     actionname = bpy.props.StringProperty()
  
     def execute(self, context):
@@ -2469,9 +2498,10 @@ def udkcheckmeshline():
     return message
 
 class OBJECT_OT_UDKCheckMeshLines(bpy.types.Operator):
+    """Select the mesh for export test. This will create dummy mesh to see which area are broken. """ \
+    """If the vertices share the same position it will causes an bug."""
     bl_idname = "object.udkcheckmeshline"
     bl_label = "Check Mesh Vertices"
-    __doc__     = """Select the mesh for export test. This will create dummy mesh to see which area are broken. If the vertices share the same position it will causes an bug."""
  
     def execute(self, context):
         message = udkcheckmeshline()
@@ -2479,9 +2509,11 @@ class OBJECT_OT_UDKCheckMeshLines(bpy.types.Operator):
         return{'FINISHED'}
 
 class OBJECT_OT_ActionSetAnimUpdate(bpy.types.Operator):
+    """Select Armture to match the action set groups. """ \
+    """All bones keys must be set to match with number of bones."""
     bl_idname = "action.setanimupdate"
     bl_label = "Update Action Set(s)"
-    __doc__     = "Select Armture to match the action set groups. All bones keys must be set to match with number of bones."
+
     actionname = bpy.props.StringProperty()
  
     def execute(self, context):
@@ -2532,7 +2564,7 @@ class OBJECT_OT_ActionSetAnimUpdate(bpy.types.Operator):
                 my_item = my_sett.add()
                 #print(dir(my_item.bmatch))
                 my_item.name = action.name
-                my_item.template_list_controls = "bmatch:bexport"
+                #my_item.template_list_controls = "bmatch:bexport"
                 if len(bones) == len(action.groups) == count:
                     my_item.bmatch = True
                 else:
@@ -2564,10 +2596,10 @@ class OBJECT_OT_ActionSetAnimUpdate(bpy.types.Operator):
         return{'FINISHED'}      
         
 class ExportUDKAnimData(bpy.types.Operator):
-    """Export Skeleton Mesh / Animation Data file(s)"""
+    """Export Skeleton Mesh / Animation Data file(s). """ \
+    """One mesh and one armature else select one mesh or armature to be exported"""
     bl_idname = "export_anim.udk" # this is important since its how bpy.ops.export.udk_anim_data is constructed
     bl_label = "Export PSK/PSA"
-    __doc__ = """One mesh and one armature else select one mesh or armature to be exported"""
 
     # List of operator properties, the attributes will be assigned
     # to the class instance from the operator settings before calling.
diff --git a/release/scripts/addons/io_import_gimp_image_to_scene.py b/release/scripts/addons/io_import_gimp_image_to_scene.py
index e9aaf86..bb0cf8c 100644
--- a/release/scripts/addons/io_import_gimp_image_to_scene.py
+++ b/release/scripts/addons/io_import_gimp_image_to_scene.py
@@ -387,12 +387,12 @@ def main(File, Path, LayerViewers, MixerViewers, LayerOffset,
                 Tex = bpy.data.textures.new(NameShort+'_A', 'IMAGE')
                 Tex.extension = 'CLIP'
                 Tex.use_preview_alpha = True
-                Tex.use_alpha = False
                 
                 Img = bpy.data.images.new(NameShort+'_A', 128, 128)
                 Img.source = 'FILE'
                 Img.alpha_mode = AlphaMode
                 Img.filepath = '%s%s_A%s' % (PathSaveRaw, Name, ExtSave)
+                Img.use_alpha = False
                 
                 Tex.image = Img
                 
diff --git a/release/scripts/addons/io_import_scene_unreal_psa_psk.py b/release/scripts/addons/io_import_scene_unreal_psa_psk.py
index 6825511..64f0e6d 100644
--- a/release/scripts/addons/io_import_scene_unreal_psa_psk.py
+++ b/release/scripts/addons/io_import_scene_unreal_psa_psk.py
@@ -1120,7 +1120,7 @@ class Panel_UDKImport(bpy.types.Panel):
         layout.prop(context.scene, "udk_importarmatureselect")
         if bpy.context.scene.udk_importarmatureselect:
             layout.operator(OBJECT_OT_UDKImportArmature.bl_idname)
-            layout.template_list("UI_UL_list", "", context.scene, "udkimportarmature_list",
+            layout.template_list("UI_UL_list", "udkimportarmature_list", context.scene, "udkimportarmature_list",
                                  context.scene, "udkimportarmature_list_idx", rows=5)
         layout.operator(OBJECT_OT_PSAPath.bl_idname)
 
diff --git a/release/scripts/addons/io_mesh_pdb/__init__.py b/release/scripts/addons/io_mesh_pdb/__init__.py
index 92d937b..be787ca 100644
--- a/release/scripts/addons/io_mesh_pdb/__init__.py
+++ b/release/scripts/addons/io_mesh_pdb/__init__.py
@@ -24,7 +24,7 @@
 #
 #  Start of project              : 2011-08-31 by Clemens Barth
 #  First publication in Blender  : 2011-11-11
-#  Last modified                 : 2012-11-09
+#  Last modified                 : 2013-01-16
 #
 #  Acknowledgements 
 #  ================
@@ -121,7 +121,7 @@ class ImportPDB(Operator, ImportHelper):
         name="Color", default=True,
         description="The sticks appear in the color of the atoms")
     use_sticks_smooth = BoolProperty(
-        name="Smooth", default=False,
+        name="Smooth", default=True,
         description="The sticks are round (sectors are not visible)")     
     use_sticks_bonds = BoolProperty(
         name="Bonds", default=False,
diff --git a/release/scripts/addons/io_mesh_ply/__init__.py b/release/scripts/addons/io_mesh_ply/__init__.py
index 6672dae..92b0bbd 100644
--- a/release/scripts/addons/io_mesh_ply/__init__.py
+++ b/release/scripts/addons/io_mesh_ply/__init__.py
@@ -89,7 +89,7 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
     filename_ext = ".ply"
     filter_glob = StringProperty(default="*.ply", options={'HIDDEN'})
 
-    use_modifiers = BoolProperty(
+    use_mesh_modifiers = BoolProperty(
             name="Apply Modifiers",
             description="Apply Modifiers to the exported mesh",
             default=True,
@@ -127,7 +127,7 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
         layout = self.layout
 
         row = layout.row()
-        row.prop(self, "use_modifiers")
+        row.prop(self, "use_mesh_modifiers")
         row.prop(self, "use_normals")
         row = layout.row()
         row.prop(self, "use_uv_coords")
diff --git a/release/scripts/addons/io_mesh_ply/export_ply.py b/release/scripts/addons/io_mesh_ply/export_ply.py
index 4e67b0c..5b46681 100644
--- a/release/scripts/addons/io_mesh_ply/export_ply.py
+++ b/release/scripts/addons/io_mesh_ply/export_ply.py
@@ -31,7 +31,7 @@ import os
 def save(operator,
          context,
          filepath="",
-         use_modifiers=True,
+         use_mesh_modifiers=True,
          use_normals=True,
          use_uv_coords=True,
          use_colors=True,
@@ -55,7 +55,7 @@ def save(operator,
     if scene.objects.active:
         bpy.ops.object.mode_set(mode='OBJECT')
 
-    if use_modifiers:
+    if use_mesh_modifiers:
         mesh = obj.to_mesh(scene, True, 'PREVIEW')
     else:
         mesh = obj.data
@@ -200,7 +200,7 @@ def save(operator,
     file.close()
     print("writing %r done" % filepath)
 
-    if use_modifiers:
+    if use_mesh_modifiers:
         bpy.data.meshes.remove(mesh)
 
     # XXX
diff --git a/release/scripts/addons/io_mesh_stl/__init__.py b/release/scripts/addons/io_mesh_stl/__init__.py
index 34c586a..cb0badc 100644
--- a/release/scripts/addons/io_mesh_stl/__init__.py
+++ b/release/scripts/addons/io_mesh_stl/__init__.py
@@ -115,13 +115,16 @@ class ExportSTL(Operator, ExportHelper):
     filename_ext = ".stl"
     filter_glob = StringProperty(default="*.stl", options={'HIDDEN'})
 
-    ascii = BoolProperty(name="Ascii",
-                         description="Save the file in ASCII file format",
-                         default=False)
-    apply_modifiers = BoolProperty(name="Apply Modifiers",
-                                   description="Apply the modifiers "
-                                               "before saving",
-                                   default=True)
+    ascii = BoolProperty(
+            name="Ascii",
+            description="Save the file in ASCII file format",
+            default=False,
+            )
+    use_mesh_modifiers = BoolProperty(
+            name="Apply Modifiers",
+            description="Apply the modifiers before saving",
+            default=True,
+            )
 
     def execute(self, context):
         from . import stl_utils
@@ -129,7 +132,7 @@ class ExportSTL(Operator, ExportHelper):
         import itertools
 
         faces = itertools.chain.from_iterable(
-            blender_utils.faces_from_mesh(ob, self.apply_modifiers)
+            blender_utils.faces_from_mesh(ob, self.use_mesh_modifiers)
             for ob in context.selected_objects)
 
         stl_utils.write_stl(self.filepath, faces, self.ascii)
diff --git a/release/scripts/addons/io_mesh_stl/blender_utils.py b/release/scripts/addons/io_mesh_stl/blender_utils.py
index 1d24369..5589da4 100644
--- a/release/scripts/addons/io_mesh_stl/blender_utils.py
+++ b/release/scripts/addons/io_mesh_stl/blender_utils.py
@@ -41,14 +41,14 @@ def create_and_link_mesh(name, faces, points):
     obj.select = True
 
 
-def faces_from_mesh(ob, apply_modifier=False, triangulate=True):
+def faces_from_mesh(ob, use_mesh_modifiers=False, triangulate=True):
     """
     From an object, return a generator over a list of faces.
 
     Each faces is a list of his vertexes. Each vertex is a tuple of
     his coordinate.
 
-    apply_modifier
+    use_mesh_modifiers
         Apply the preview modifier to the returned liste
 
     triangulate
@@ -57,7 +57,7 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True):
 
     # get the modifiers
     try:
-        mesh = ob.to_mesh(bpy.context.scene, apply_modifier, "PREVIEW")
+        mesh = ob.to_mesh(bpy.context.scene, use_mesh_modifiers, "PREVIEW")
     except RuntimeError:
         raise StopIteration
 
diff --git a/release/scripts/addons/io_scene_fbx/export_fbx.py b/release/scripts/addons/io_scene_fbx/export_fbx.py
index 1c35fe8..802e795 100644
--- a/release/scripts/addons/io_scene_fbx/export_fbx.py
+++ b/release/scripts/addons/io_scene_fbx/export_fbx.py
@@ -28,7 +28,6 @@ import math  # math.pi
 import bpy
 from mathutils import Vector, Matrix
 
-
 # I guess FBX uses degrees instead of radians (Arystan).
 # Call this function just before writing to FBX.
 # 180 / math.pi == 57.295779513
diff --git a/release/scripts/addons/io_scene_ms3d/__init__.py b/release/scripts/addons/io_scene_ms3d/__init__.py
new file mode 100644
index 0000000..7353417
--- /dev/null
+++ b/release/scripts/addons/io_scene_ms3d/__init__.py
@@ -0,0 +1,107 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+bl_info = {
+    'name': "MilkShape3D MS3D format (.ms3d)",
+    'description': "Import / Export MilkShape3D MS3D files"\
+            " (conform with MilkShape3D v1.8.4)",
+    'author': "Alexander Nussbaumer",
+    'version': (0, 96, 0),
+    'blender': (2, 66, 0),
+    'location': "File > Import & File > Export",
+    'warning': "",
+    'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
+            "Scripts/Import-Export/MilkShape3D_MS3D",
+    'tracker_url': "http://projects.blender.org/tracker/index.php"\
+            "?func=detail&aid=34084",
+    'category': "Import-Export",
+    }
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011-2013 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+# To support reload properly, try to access a package var,
+# if it's there, reload everything
+if 'bpy' in locals():
+    import imp
+    if 'io_scene_ms3d.ms3d_ui' in locals():
+        imp.reload(io_scene_ms3d.ms3d_ui)
+else:
+    from io_scene_ms3d.ms3d_ui import (
+            Ms3dImportOperator,
+            Ms3dExportOperator,
+            )
+
+
+#import blender stuff
+from bpy.utils import (
+        register_module,
+        unregister_module,
+        )
+from bpy.types import (
+        INFO_MT_file_export,
+        INFO_MT_file_import,
+        )
+
+
+###############################################################################
+# registration
+def register():
+    ####################
+    # F8 - key
+    import imp
+    imp.reload(ms3d_ui)
+    # F8 - key
+    ####################
+
+    ms3d_ui.register()
+
+    register_module(__name__)
+    INFO_MT_file_export.append(Ms3dExportOperator.menu_func)
+    INFO_MT_file_import.append(Ms3dImportOperator.menu_func)
+
+
+def unregister():
+    ms3d_ui.unregister()
+
+    unregister_module(__name__)
+    INFO_MT_file_export.remove(Ms3dExportOperator.menu_func)
+    INFO_MT_file_import.remove(Ms3dImportOperator.menu_func)
+
+
+###############################################################################
+# global entry point
+if (__name__ == "__main__"):
+    register()
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# ##### END OF FILE #####
diff --git a/release/scripts/addons/io_scene_ms3d/ms3d_export.py b/release/scripts/addons/io_scene_ms3d/ms3d_export.py
new file mode 100644
index 0000000..1967558
--- /dev/null
+++ b/release/scripts/addons/io_scene_ms3d/ms3d_export.py
@@ -0,0 +1,904 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011-2013 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+#import python stuff
+import io
+from math import (
+        pi,
+        )
+from mathutils import (
+        Matrix,
+        )
+from os import (
+        path,
+        )
+from sys import (
+        exc_info,
+        )
+from time import (
+        time,
+        )
+
+
+# import io_scene_ms3d stuff
+from io_scene_ms3d.ms3d_strings import (
+        ms3d_str,
+        )
+from io_scene_ms3d.ms3d_spec import (
+        Ms3dSpec,
+        Ms3dModel,
+        Ms3dVertex,
+        Ms3dTriangle,
+        Ms3dGroup,
+        Ms3dMaterial,
+        Ms3dJoint,
+        Ms3dRotationKeyframe,
+        Ms3dTranslationKeyframe,
+        Ms3dCommentEx,
+        Ms3dComment,
+        )
+from io_scene_ms3d.ms3d_utils import (
+        select_all,
+        enable_edit_mode,
+        pre_setup_environment,
+        post_setup_environment,
+        matrix_difference,
+        )
+from io_scene_ms3d.ms3d_ui import (
+        Ms3dUi,
+        Ms3dMaterialProperties,
+        Ms3dMaterialHelper,
+        )
+
+
+#import blender stuff
+from bpy import (
+        ops,
+        )
+import bmesh
+
+
+###############################################################################
+class Ms3dExporter():
+    """
+    Load a MilkShape3D MS3D File
+    """
+    def __init__(self,
+            report,
+            verbose=False,
+            use_blender_names=True,
+            use_blender_materials=False,
+            apply_transform=True,
+            apply_modifiers=True,
+            apply_modifiers_mode='PREVIEW',
+            use_animation=True,
+            normalize_weights=True,
+            shrink_to_keys=False,
+            bake_each_frame=True,
+            ):
+        self.report = report
+        self.options_verbose = verbose
+        self.options_use_blender_names = use_blender_names
+        self.options_use_blender_materials = use_blender_materials
+        self.options_apply_transform = apply_transform
+        self.options_apply_modifiers = apply_modifiers
+        self.options_apply_modifiers_mode = apply_modifiers_mode
+        self.options_use_animation = use_animation
+        self.options_normalize_weights = normalize_weights
+        self.options_shrink_to_keys = shrink_to_keys
+        self.options_bake_each_frame = bake_each_frame
+        pass
+
+    # create a empty ms3d ms3d_model
+    # fill ms3d_model with blender content
+    # writer ms3d file
+    def write(self, blender_context, filepath):
+        """convert bender content to ms3d content and write it to file"""
+
+        t1 = time()
+        t2 = None
+
+        try:
+            # setup environment
+            pre_setup_environment(self, blender_context)
+
+            # create an empty ms3d template
+            ms3d_model = Ms3dModel()
+
+            # inject blender data to ms3d file
+            self.from_blender(blender_context, ms3d_model)
+
+            t2 = time()
+
+            try:
+                # write ms3d file to disk
+                with io.FileIO(filepath, "wb") as raw_io:
+                    ms3d_model.write(raw_io)
+                    raw_io.flush()
+                    raw_io.close()
+            finally:
+                pass
+
+            # if option is set, this time will enlargs the io time
+            if self.options_verbose:
+                ms3d_model.print_internal()
+
+            post_setup_environment(self, blender_context)
+            # restore active object
+            blender_context.scene.objects.active = self.active_object
+
+            if ((not blender_context.scene.objects.active)
+                    and (blender_context.selected_objects)):
+                blender_context.scene.objects.active \
+                        = blender_context.selected_objects[0]
+
+            # restore pre operator undo state
+            blender_context.user_preferences.edit.use_global_undo = self.undo
+
+            is_valid, statistics = ms3d_model.is_valid()
+            print()
+            print("##########################################################")
+            print("Export from Blender to MS3D")
+            print(statistics)
+            print("##########################################################")
+
+        except Exception:
+            type, value, traceback = exc_info()
+            print("write - exception in try block\n  type: '{0}'\n"
+                    "  value: '{1}'".format(type, value, traceback))
+
+            if t2 is None:
+                t2 = time()
+
+            raise
+
+        else:
+            pass
+
+        t3 = time()
+        print(ms3d_str['SUMMARY_EXPORT'].format(
+                (t3 - t1), (t2 - t1), (t3 - t2)))
+
+        return {"FINISHED"}
+
+
+    ###########################################################################
+    def from_blender(self, blender_context, ms3d_model):
+        blender_mesh_objects = []
+
+        source = (blender_context.active_object, )
+
+        for blender_object in source:
+            if blender_object and blender_object.type == 'MESH' \
+                    and blender_object.is_visible(blender_context.scene):
+                blender_mesh_objects.append(blender_object)
+
+        blender_to_ms3d_bones = {}
+
+        self.create_animation(blender_context, ms3d_model, blender_mesh_objects, blender_to_ms3d_bones)
+        self.create_geometry(blender_context, ms3d_model, blender_mesh_objects,
+                blender_to_ms3d_bones)
+
+
+    ###########################################################################
+    def create_geometry(self, blender_context, ms3d_model, blender_mesh_objects, blender_to_ms3d_bones):
+        blender_scene = blender_context.scene
+
+        blender_to_ms3d_vertices = {}
+        blender_to_ms3d_triangles = {}
+        blender_to_ms3d_groups = {}
+        blender_to_ms3d_materials = {}
+
+        for blender_mesh_object in blender_mesh_objects:
+            blender_mesh = blender_mesh_object.data
+
+            ms3d_model._model_ex_object.joint_size = \
+                    blender_mesh.ms3d.joint_size
+            ms3d_model._model_ex_object.alpha_ref = blender_mesh.ms3d.alpha_ref
+            ms3d_model._model_ex_object.transparency_mode = \
+                    Ms3dUi.transparency_mode_to_ms3d(
+                    blender_mesh.ms3d.transparency_mode)
+
+            if blender_mesh.ms3d.comment:
+                ms3d_model._comment_object = Ms3dComment(blender_mesh.ms3d.comment)
+
+            ##########################
+            # prepare ms3d groups if available
+            # works only for exporting active object
+            ##EXPORT_ACTIVE_ONLY:
+            for ms3d_local_group_index, blender_ms3d_group in enumerate(
+                    blender_mesh.ms3d.groups):
+                ms3d_group = Ms3dGroup()
+                ms3d_group.__index = len(ms3d_model._groups)
+                ms3d_group.name = blender_ms3d_group.name
+                ms3d_group.flags = Ms3dUi.flags_to_ms3d(blender_ms3d_group.flags)
+                if blender_ms3d_group.comment:
+                    ms3d_group._comment_object = Ms3dCommentEx()
+                    ms3d_group._comment_object.comment = \
+                            blender_ms3d_group.comment
+                    ms3d_group._comment_object.index = len(ms3d_model._groups)
+                ms3d_group.material_index = None # to mark as not setted
+                ms3d_model._groups.append(ms3d_group)
+                blender_to_ms3d_groups[blender_ms3d_group.id] = ms3d_group
+
+            ##########################
+            # i have to use BMesh, because there are several custom data stored.
+            # BMesh doesn't support quads_convert_to_tris()
+            # so, i use that very ugly way:
+            # create a complete copy of mesh and bend object data
+            # to be able to apply operations to it.
+
+            # temporary, create a full heavy copy of the model
+            # (object, mesh, modifiers)
+            blender_mesh_temp = blender_mesh_object.data.copy()
+            blender_mesh_object_temp = blender_mesh_object.copy()
+            blender_mesh_object_temp.data = blender_mesh_temp
+            blender_scene.objects.link(blender_mesh_object_temp)
+            blender_scene.objects.active = blender_mesh_object_temp
+
+            # apply transform
+            if self.options_apply_transform:
+                matrix_transform = blender_mesh_object_temp.matrix_basis
+            else:
+                matrix_transform = 1
+
+            # apply modifiers
+            for modifier in blender_mesh_object_temp.modifiers:
+                if self.options_apply_modifiers:
+                    # disable only armature modifiers and only,
+                    # when use_animation is enabled
+                    if  self.options_use_animation \
+                            and modifier.type in {'ARMATURE', }:
+                        modifier.show_viewport = False
+                        modifier.show_render = False
+                else:
+                    # disable all modifiers,
+                    # to be able to add and apply triangulate modifier later
+                    modifier.show_viewport = False
+                    modifier.show_render = False
+
+            # convert to tris by using the triangulate modifier
+            blender_mesh_object_temp.modifiers.new("temp", 'TRIANGULATE')
+            blender_mesh_temp = blender_mesh_object_temp.to_mesh(
+                    blender_scene,
+                    True,
+                    self.options_apply_modifiers_mode)
+
+            enable_edit_mode(True, blender_context)
+            bm = bmesh.new()
+            bm.from_mesh(blender_mesh_temp)
+
+            layer_texture = bm.faces.layers.tex.get(
+                    ms3d_str['OBJECT_LAYER_TEXTURE'])
+            if layer_texture is None:
+                layer_texture = bm.faces.layers.tex.new(
+                        ms3d_str['OBJECT_LAYER_TEXTURE'])
+
+            layer_smoothing_group = bm.faces.layers.int.get(
+                    ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
+            if layer_smoothing_group is None:
+                layer_smoothing_group = bm.faces.layers.int.new(
+                        ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
+
+            layer_group = bm.faces.layers.int.get(
+                    ms3d_str['OBJECT_LAYER_GROUP'])
+            if layer_group is None:
+                layer_group = bm.faces.layers.int.new(
+                        ms3d_str['OBJECT_LAYER_GROUP'])
+
+            layer_uv = bm.loops.layers.uv.get(ms3d_str['OBJECT_LAYER_UV'])
+            if layer_uv is None:
+                if bm.loops.layers.uv:
+                    layer_uv = bm.loops.layers.uv[0]
+                else:
+                    layer_uv = bm.loops.layers.uv.new(
+                            ms3d_str['OBJECT_LAYER_UV'])
+
+            layer_deform = bm.verts.layers.deform.active
+
+            layer_extra = bm.verts.layers.int.get(ms3d_str['OBJECT_LAYER_EXTRA'])
+            if layer_extra is None:
+                layer_extra = bm.verts.layers.int.new(
+                        ms3d_str['OBJECT_LAYER_EXTRA'])
+
+
+            ##########################
+            # handle vertices
+            for bmv in bm.verts:
+                item = blender_to_ms3d_vertices.get(bmv)
+                if item is None:
+                    index = len(ms3d_model._vertices)
+                    ms3d_vertex = Ms3dVertex()
+                    ms3d_vertex.__index = index
+
+                    ms3d_vertex._vertex = self.geometry_correction(
+                            matrix_transform * bmv.co)
+
+                    if self.options_use_animation and layer_deform:
+                        blender_vertex_group_ids = bmv[layer_deform]
+                        if blender_vertex_group_ids:
+                            bone_weights = {}
+                            for blender_index, blender_weight \
+                                    in blender_vertex_group_ids.items():
+                                ms3d_joint = blender_to_ms3d_bones.get(
+                                        blender_mesh_object_temp.vertex_groups[\
+                                                blender_index].name)
+                                if ms3d_joint:
+                                    weight = bone_weights.get(ms3d_joint.__index)
+                                    if not weight:
+                                        weight = 0
+                                    bone_weights[ms3d_joint.__index] = weight + blender_weight
+
+                            # sort (bone_id: weight) according its weights
+                            # to skip only less important weights in the next pass
+                            bone_weights_sorted = sorted(bone_weights.items(), key=lambda item: item[1], reverse=True)
+
+                            count = 0
+                            bone_ids = []
+                            weights = []
+                            for ms3d_index, blender_weight \
+                                    in bone_weights_sorted:
+
+                                if count == 0:
+                                    ms3d_vertex.bone_id = ms3d_index
+                                    weights.append(blender_weight)
+                                elif count == 1:
+                                    bone_ids.append(ms3d_index)
+                                    weights.append(blender_weight)
+                                elif count == 2:
+                                    bone_ids.append(ms3d_index)
+                                    weights.append(blender_weight)
+                                elif count == 3:
+                                    bone_ids.append(ms3d_index)
+                                    self.report(
+                                            {'WARNING', 'INFO'},
+                                            ms3d_str['WARNING_EXPORT_SKIP_WEIGHT'])
+                                else:
+                                    # only first three weights will be supported / four bones
+                                    self.report(
+                                            {'WARNING', 'INFO'},
+                                            ms3d_str['WARNING_EXPORT_SKIP_WEIGHT_EX'])
+                                    break
+                                count += 1
+
+                            # normalize weights to 100%
+                            if self.options_normalize_weights:
+                                weight_sum = 0.0
+                                for weight in weights:
+                                    weight_sum += weight
+
+                                if weight_sum > 0.0:
+                                    weight_normalize = 1.0 / weight_sum
+                                else:
+                                    weight_normalize = 1.0
+
+                                weight_sum = 100
+                                for index, weight in enumerate(weights):
+                                    if index >= count-1 or index >= 2:
+                                        # take the full rest instead of calculate,
+                                        # that should fill up to exactly 100%
+                                        # (in some cases it is only 99% bacaus of roulding errors)
+                                        weights[index] = int(weight_sum)
+                                        break
+                                    normalized_weight = int(weight * weight_normalize * 100)
+                                    weights[index] = normalized_weight
+                                    weight_sum -= normalized_weight
+
+                            # fill up missing values
+                            while len(bone_ids) < 3:
+                                bone_ids.append(Ms3dSpec.DEFAULT_VERTEX_BONE_ID)
+                            while len(weights) < 3:
+                                weights.append(0)
+
+                            ms3d_vertex._vertex_ex_object._bone_ids = \
+                                    tuple(bone_ids)
+                            ms3d_vertex._vertex_ex_object._weights = \
+                                    tuple(weights)
+
+                    if layer_extra:
+                        #ms3d_vertex._vertex_ex_object.extra = bmv[layer_extra]
+                        # bm.verts.layers.int does only support signed int32
+                        # convert signed int32 to unsigned int32 (little-endian)
+                        signed_int32 = bmv[layer_extra]
+                        bytes_int32 = signed_int32.to_bytes(
+                                4, byteorder='little', signed=True)
+                        unsigned_int32 = int.from_bytes(
+                                bytes_int32, byteorder='little', signed=False)
+                        ms3d_vertex._vertex_ex_object.extra = unsigned_int32
+
+                    ms3d_model._vertices.append(ms3d_vertex)
+                    blender_to_ms3d_vertices[bmv] = ms3d_vertex
+
+            ##########################
+            # handle faces / tris
+            for bmf in bm.faces:
+                item = blender_to_ms3d_triangles.get(bmf)
+                if item is None:
+                    index = len(ms3d_model._triangles)
+                    ms3d_triangle = Ms3dTriangle()
+                    ms3d_triangle.__index = index
+                    bmv0 = bmf.verts[0]
+                    bmv1 = bmf.verts[1]
+                    bmv2 = bmf.verts[2]
+                    ms3d_vertex0 = blender_to_ms3d_vertices[bmv0]
+                    ms3d_vertex1 = blender_to_ms3d_vertices[bmv1]
+                    ms3d_vertex2 = blender_to_ms3d_vertices[bmv2]
+                    ms3d_vertex0.reference_count += 1
+                    ms3d_vertex1.reference_count += 1
+                    ms3d_vertex2.reference_count += 1
+                    ms3d_triangle._vertex_indices = (
+                            ms3d_vertex0.__index,
+                            ms3d_vertex1.__index,
+                            ms3d_vertex2.__index,
+                            )
+                    ms3d_triangle._vertex_normals = (
+                            self.geometry_correction(bmv0.normal),
+                            self.geometry_correction(bmv1.normal),
+                            self.geometry_correction(bmv2.normal),
+                            )
+                    ms3d_triangle._s = (
+                            bmf.loops[0][layer_uv].uv.x,
+                            bmf.loops[1][layer_uv].uv.x,
+                            bmf.loops[2][layer_uv].uv.x,
+                            )
+                    ms3d_triangle._t = (
+                            1.0 - bmf.loops[0][layer_uv].uv.y,
+                            1.0 - bmf.loops[1][layer_uv].uv.y,
+                            1.0 - bmf.loops[2][layer_uv].uv.y,
+                            )
+
+                    ms3d_triangle.smoothing_group = bmf[layer_smoothing_group]
+                    ms3d_model._triangles.append(ms3d_triangle)
+
+                    ms3d_material = self.get_ms3d_material_add_if(
+                            blender_mesh, ms3d_model,
+                            blender_to_ms3d_materials, bmf.material_index)
+                    ms3d_group = blender_to_ms3d_groups.get(bmf[layer_group])
+
+                    ##EXPORT_ACTIVE_ONLY:
+                    if ms3d_group is not None:
+                        if ms3d_material is None:
+                            ms3d_group.material_index = \
+                                    Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX
+                        else:
+                            if ms3d_group.material_index is None:
+                                ms3d_group.material_index = \
+                                        ms3d_material.__index
+                            else:
+                                if ms3d_group.material_index != \
+                                        ms3d_material.__index:
+                                    ms3d_group = \
+                                            self.get_ms3d_group_by_material_add_if(
+                                            ms3d_model, ms3d_material)
+                    else:
+                        if ms3d_material is not None:
+                            ms3d_group = self.get_ms3d_group_by_material_add_if(
+                                    ms3d_model, ms3d_material)
+                        else:
+                            ms3d_group = self.get_ms3d_group_default_material_add_if(
+                                    ms3d_model)
+
+                    if ms3d_group is not None:
+                        ms3d_group._triangle_indices.append(
+                                ms3d_triangle.__index)
+                        ms3d_triangle.group_index = ms3d_group.__index
+
+                    blender_to_ms3d_triangles[bmf] = ms3d_triangle
+
+            if bm is not None:
+                bm.free()
+
+            enable_edit_mode(False, blender_context)
+
+            ##########################
+            # remove the temporary data
+            blender_scene.objects.unlink(blender_mesh_object_temp)
+            if blender_mesh_temp is not None:
+                blender_mesh_temp.user_clear()
+                blender_context.blend_data.meshes.remove(blender_mesh_temp)
+            blender_mesh_temp = None
+            if blender_mesh_object_temp is not None:
+                blender_mesh_temp = blender_mesh_object_temp.data.user_clear()
+                blender_mesh_object_temp.user_clear()
+                blender_context.blend_data.objects.remove(
+                        blender_mesh_object_temp)
+            if blender_mesh_temp is not None:
+                blender_mesh_temp.user_clear()
+                blender_context.blend_data.meshes.remove(blender_mesh_temp)
+
+
+    ###########################################################################
+    def create_animation(self, blender_context, ms3d_model,
+            blender_mesh_objects, blender_to_ms3d_bones):
+        ##########################
+        # setup scene
+        blender_scene = blender_context.scene
+
+        if not self.options_use_animation:
+            ms3d_model.animation_fps = 24
+            ms3d_model.number_total_frames = 1
+            ms3d_model.current_time = 0
+            return
+
+        frame_start = blender_scene.frame_start
+        frame_end = blender_scene.frame_end
+        frame_total = (frame_end - frame_start) + 1
+        frame_step = blender_scene.frame_step
+        frame_offset = 0
+
+        fps = blender_scene.render.fps * blender_scene.render.fps_base
+        time_base = 1.0 / fps
+
+        base_bone_correction = Matrix.Rotation(pi / 2, 4, 'Z')
+
+        for blender_mesh_object in blender_mesh_objects:
+            blender_bones = None
+            blender_action = None
+            blender_nla_tracks = None
+            for blender_modifier in blender_mesh_object.modifiers:
+                if blender_modifier.type == 'ARMATURE' \
+                        and blender_modifier.object.pose:
+                    blender_bones = blender_modifier.object.data.bones
+                    blender_pose_bones = blender_modifier.object.pose.bones
+                    if blender_modifier.object.animation_data:
+                        blender_action = \
+                                blender_modifier.object.animation_data.action
+                        blender_nla_tracks = \
+                                blender_modifier.object.animation_data.nla_tracks
+
+                    # apply transform
+                    if self.options_apply_transform:
+                        matrix_transform = blender_modifier.object.matrix_basis
+                    else:
+                        matrix_transform = 1
+
+                    break
+
+            if blender_bones is None \
+                    and (blender_action is None and blender_nla_tracks is None):
+                continue
+
+            ##########################
+            # bones
+            blender_bones_ordered = []
+            self.build_blender_bone_dependency_order(
+                    blender_bones, blender_bones_ordered)
+            for blender_bone_name in blender_bones_ordered:
+                blender_bone_oject = blender_bones[blender_bone_name]
+                ms3d_joint = Ms3dJoint()
+                ms3d_joint.__index = len(ms3d_model._joints)
+
+                blender_bone_ms3d = blender_bone_oject.ms3d
+                blender_bone = blender_bone_oject
+
+                ms3d_joint.flags = Ms3dUi.flags_to_ms3d(blender_bone_ms3d.flags)
+                if blender_bone_ms3d.comment:
+                    ms3d_joint._comment_object = Ms3dCommentEx()
+                    ms3d_joint._comment_object.comment = \
+                            blender_bone_ms3d.comment
+                    ms3d_joint._comment_object.index = ms3d_joint.__index
+
+                ms3d_joint.joint_ex_object._color = blender_bone_ms3d.color[:]
+
+                ms3d_joint.name = blender_bone.name
+
+                if blender_bone.parent:
+                    ms3d_joint.parent_name = blender_bone.parent.name
+                    ms3d_joint.__matrix = matrix_difference(
+                            matrix_transform * blender_bone.matrix_local,
+                            matrix_transform * blender_bone.parent.matrix_local)
+                else:
+                    ms3d_joint.__matrix = base_bone_correction \
+                            * matrix_transform * blender_bone.matrix_local
+
+                mat = ms3d_joint.__matrix
+                loc = mat.to_translation()
+                rot = mat.to_euler('XZY')
+                ms3d_joint._position = self.joint_correction(loc)
+                ms3d_joint._rotation = self.joint_correction(rot)
+
+                ms3d_model._joints.append(ms3d_joint)
+                blender_to_ms3d_bones[blender_bone.name] = ms3d_joint
+
+            ##########################
+            # animation
+            frames = None
+            frames_location = set()
+            frames_rotation = set()
+            frames_scale = set()
+
+            if blender_action:
+                self.fill_keyframe_sets(
+                        blender_action.fcurves,
+                        frames_location, frames_rotation, frames_scale,
+                        0)
+
+            if blender_nla_tracks:
+                for nla_track in blender_nla_tracks:
+                    if nla_track.mute:
+                        continue
+                    for strip in nla_track.strips:
+                        if strip.mute:
+                            continue
+                        frame_correction = strip.frame_start \
+                                - strip.action_frame_start
+                        self.fill_keyframe_sets(
+                                strip.action.fcurves,
+                                frames_location, frames_rotation, frames_scale,
+                                frame_correction)
+
+            frames = set(frames_location)
+            frames = frames.union(frames_rotation)
+            frames = frames.union(frames_scale)
+
+            if not self.options_shrink_to_keys:
+                frames = frames.intersection(range(
+                        blender_scene.frame_start, blender_scene.frame_end + 1))
+
+            frames_sorted = list(frames)
+            frames_sorted.sort()
+
+            if self.options_shrink_to_keys and len(frames_sorted) >= 2:
+                frame_start = frames_sorted[0]
+                frame_end = frames_sorted[len(frames_sorted)-1]
+                frame_total = (frame_end - frame_start) + 1
+                frame_offset = frame_start - 1
+
+            if self.options_bake_each_frame:
+                frames_sorted = range(int(frame_start), int(frame_end + 1),
+                        int(frame_step))
+
+            frame_temp = blender_scene.frame_current
+
+            for current_frame in frames_sorted:
+                blender_scene.frame_set(current_frame)
+
+                current_time = (current_frame - frame_offset) * time_base
+                for blender_bone_name in blender_bones_ordered:
+                    blender_bone = blender_bones[blender_bone_name]
+                    blender_pose_bone = blender_pose_bones[blender_bone_name]
+                    ms3d_joint = blender_to_ms3d_bones[blender_bone_name]
+
+                    m1 = blender_bone.matrix_local.inverted()
+                    if blender_pose_bone.parent:
+                        m2 = blender_pose_bone.parent.matrix_channel.inverted()
+                    else:
+                        m2 = 1
+                    m3 = blender_pose_bone.matrix.copy()
+                    m = ((m1 * m2) * m3)
+                    loc = m.to_translation()
+                    rot = m.to_euler('XZY')
+
+                    ms3d_joint.translation_key_frames.append(
+                            Ms3dTranslationKeyframe(
+                                    current_time, self.joint_correction(loc)
+                                    )
+                            )
+                    ms3d_joint.rotation_key_frames.append(
+                            Ms3dRotationKeyframe(
+                                    current_time, self.joint_correction(rot)
+                                    )
+                            )
+
+            blender_scene.frame_set(frame_temp)
+
+        ms3d_model.animation_fps = fps
+        if ms3d_model.number_joints > 0:
+            ms3d_model.number_total_frames = int(frame_total)
+            ms3d_model.current_time = ((blender_scene.frame_current \
+                    - blender_scene.frame_start) + 1) * time_base
+        else:
+            ms3d_model.number_total_frames = 1
+            ms3d_model.current_time = 0
+
+
+    ###########################################################################
+    def get_ms3d_group_default_material_add_if(self, ms3d_model):
+        markerName = "MaterialGroupDefault"
+        markerComment = "group without material"
+
+        for ms3d_group in ms3d_model._groups:
+            if ms3d_group.material_index == \
+                    Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX \
+                    and ms3d_group.name == markerName \
+                    and ms3d_group._comment_object \
+                    and ms3d_group._comment_object.comment == markerComment:
+                return ms3d_group
+
+        ms3d_group = Ms3dGroup()
+        ms3d_group.__index = len(ms3d_model._groups)
+        ms3d_group.name = markerName
+        ms3d_group._comment_object = Ms3dCommentEx()
+        ms3d_group._comment_object.comment = markerComment
+        ms3d_group._comment_object.index = len(ms3d_model._groups)
+        ms3d_group.material_index = Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX
+
+        ms3d_model._groups.append(ms3d_group)
+
+        return ms3d_group
+
+
+    ###########################################################################
+    def get_ms3d_group_by_material_add_if(self, ms3d_model, ms3d_material):
+        if ms3d_material.__index < 0 \
+                or ms3d_material.__index >= len(ms3d_model.materials):
+            return None
+
+        markerName = "MaterialGroup.{}".format(ms3d_material.__index)
+        markerComment = "MaterialGroup({})".format(ms3d_material.name)
+
+        for ms3d_group in ms3d_model._groups:
+            if ms3d_group.name == markerName \
+                    and ms3d_group._comment_object \
+                    and ms3d_group._comment_object.comment == markerComment:
+                return ms3d_group
+
+        ms3d_group = Ms3dGroup()
+        ms3d_group.__index = len(ms3d_model._groups)
+        ms3d_group.name = markerName
+        ms3d_group._comment_object = Ms3dCommentEx()
+        ms3d_group._comment_object.comment = markerComment
+        ms3d_group._comment_object.index = len(ms3d_model._groups)
+        ms3d_group.material_index = ms3d_material.__index
+
+        ms3d_model._groups.append(ms3d_group)
+
+        return ms3d_group
+
+
+    ###########################################################################
+    def get_ms3d_material_add_if(self, blender_mesh, ms3d_model,
+            blender_to_ms3d_materials, blender_index):
+        if blender_index < 0 or blender_index >= len(blender_mesh.materials):
+            return None
+
+        blender_material = blender_mesh.materials[blender_index]
+        ms3d_material = blender_to_ms3d_materials.get(blender_material)
+        if ms3d_material is None:
+            ms3d_material = Ms3dMaterial()
+            ms3d_material.__index = len(ms3d_model.materials)
+
+            blender_ms3d_material = blender_material.ms3d
+
+            if not self.options_use_blender_names \
+                    and not self.options_use_blender_materials \
+                    and blender_ms3d_material.name:
+                ms3d_material.name = blender_ms3d_material.name
+            else:
+                ms3d_material.name = blender_material.name
+
+            temp_material = None
+            if self.options_use_blender_materials:
+                temp_material = Ms3dMaterial()
+                Ms3dMaterialHelper.copy_from_blender(
+                        None, None, temp_material, blender_material)
+            else:
+                temp_material = blender_ms3d_material
+
+            ms3d_material._ambient = temp_material.ambient[:]
+            ms3d_material._diffuse = temp_material.diffuse[:]
+            ms3d_material._specular = temp_material.specular[:]
+            ms3d_material._emissive = temp_material.emissive[:]
+            ms3d_material.shininess = temp_material.shininess
+            ms3d_material.transparency = temp_material.transparency
+            ms3d_material.texture = temp_material.texture
+            ms3d_material.alphamap = temp_material.alphamap
+
+            ms3d_material.mode = Ms3dUi.texture_mode_to_ms3d(
+                    blender_ms3d_material.mode)
+            if blender_ms3d_material.comment:
+                ms3d_material._comment_object = Ms3dCommentEx()
+                ms3d_material._comment_object.comment = \
+                        blender_ms3d_material.comment
+                ms3d_material._comment_object.index = ms3d_material.__index
+
+            ms3d_model.materials.append(ms3d_material)
+
+            blender_to_ms3d_materials[blender_material] = ms3d_material
+
+        return ms3d_material
+
+
+    ###########################################################################
+    def geometry_correction(self, value):
+        return (value[1], value[2], value[0])
+
+
+    ###########################################################################
+    def joint_correction(self, value):
+        return (-value[0], value[2], value[1])
+
+
+    ###########################################################################
+    def build_blender_bone_dependency_order(self, blender_bones,
+            blender_bones_ordered):
+        if not blender_bones:
+            return blender_bones_ordered
+
+        blender_bones_children = {None: []}
+        for blender_bone in blender_bones:
+            if blender_bone.parent:
+                blender_bone_children = blender_bones_children.get(
+                        blender_bone.parent.name)
+                if blender_bone_children is None:
+                    blender_bone_children = blender_bones_children[
+                            blender_bone.parent.name] = []
+            else:
+                blender_bone_children = blender_bones_children[None]
+
+            blender_bone_children.append(blender_bone.name)
+
+        self.traverse_dependencies(
+                blender_bones_ordered,
+                blender_bones_children,
+                None)
+
+        return blender_bones_ordered
+
+
+    ###########################################################################
+    def traverse_dependencies(self, blender_bones_ordered,
+            blender_bones_children, key):
+        blender_bone_children = blender_bones_children.get(key)
+        if blender_bone_children:
+            for blender_bone_name in blender_bone_children:
+                blender_bones_ordered.append(blender_bone_name)
+                self.traverse_dependencies(
+                        blender_bones_ordered,
+                        blender_bones_children,
+                        blender_bone_name)
+
+    ###########################################################################
+    def fill_keyframe_sets(self,
+            fcurves,
+            frames_location, frames_rotation, frames_scale,
+            frame_correction):
+        for fcurve in fcurves:
+            if fcurve.data_path.endswith(".location"):
+                frames = frames_location
+            elif fcurve.data_path.endswith(".rotation_euler"):
+                frames = frames_rotation
+            elif fcurve.data_path.endswith(".rotation_quaternion"):
+                frames = frames_rotation
+            elif fcurve.data_path.endswith(".scale"):
+                frames = frames_scale
+            else:
+                pass
+
+            for keyframe_point in fcurve.keyframe_points:
+                frames.add(int(keyframe_point.co[0] + frame_correction))
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# ##### END OF FILE #####
diff --git a/release/scripts/addons/io_scene_ms3d/ms3d_import.py b/release/scripts/addons/io_scene_ms3d/ms3d_import.py
new file mode 100644
index 0000000..a9bfed1
--- /dev/null
+++ b/release/scripts/addons/io_scene_ms3d/ms3d_import.py
@@ -0,0 +1,1006 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011-2013 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+#import python stuff
+import io
+from mathutils import (
+        Vector,
+        Matrix,
+        )
+from os import (
+        path,
+        )
+from sys import (
+        exc_info,
+        )
+from time import (
+        time,
+        )
+
+
+# import io_scene_ms3d stuff
+from io_scene_ms3d.ms3d_strings import (
+        ms3d_str,
+        )
+from io_scene_ms3d.ms3d_spec import (
+        Ms3dSpec,
+        Ms3dModel,
+        Ms3dVertexEx2,
+        Ms3dVertexEx3,
+        )
+from io_scene_ms3d.ms3d_utils import (
+        select_all,
+        enable_pose_mode,
+        enable_edit_mode,
+        pre_setup_environment,
+        post_setup_environment,
+        get_edge_split_modifier_add_if,
+        )
+from io_scene_ms3d.ms3d_ui import (
+        Ms3dUi,
+        )
+
+
+#import blender stuff
+from bpy import (
+        ops,
+        )
+import bmesh
+from bpy_extras.image_utils import (
+        load_image,
+        )
+
+
+###############################################################################
+class Ms3dImporter():
+    """
+    Load a MilkShape3D MS3D File
+    """
+    def __init__(self,
+            report,
+            verbose=False,
+            use_extended_normal_handling=False,
+            use_animation=True,
+            use_quaternion_rotation=False,
+            use_joint_size=False,
+            joint_size=1.0,
+            use_joint_to_bones=False,
+            ):
+        self.report = report
+        self.options_verbose = verbose
+        self.options_use_extended_normal_handling = use_extended_normal_handling
+        self.options_use_animation = use_animation
+        self.options_use_quaternion_rotation = use_quaternion_rotation
+        self.options_use_joint_size = use_joint_size
+        self.options_joint_size = joint_size
+        self.options_use_joint_to_bones = use_joint_to_bones
+        self.directory_name = ""
+        self.file_name = ""
+        pass
+
+    ###########################################################################
+    # create empty blender ms3d_model
+    # read ms3d file
+    # fill blender with ms3d_model content
+    def read(self, blender_context, filepath):
+        """ read ms3d file and convert ms3d content to bender content """
+        t1 = time()
+        t2 = None
+        self.has_textures = False
+
+        try:
+            # setup environment
+            pre_setup_environment(self, blender_context)
+
+            # inject splitted filepath
+            self.directory_name, self.file_name = path.split(filepath)
+
+            # create an empty ms3d template
+            ms3d_model = Ms3dModel(self.file_name)
+
+            try:
+                # open ms3d file
+                with io.FileIO(filepath, 'rb') as raw_io:
+                    # read and inject ms3d data from disk to internal structure
+                    ms3d_model.read(raw_io)
+                    raw_io.close()
+            finally:
+                pass
+
+            # if option is set, this time will enlargs the io time
+            if self.options_verbose:
+                ms3d_model.print_internal()
+
+            t2 = time()
+
+            is_valid, statistics = ms3d_model.is_valid()
+
+            if is_valid:
+                # inject ms3d data to blender
+                self.to_blender(blender_context, ms3d_model)
+
+                blender_scene = blender_context.scene
+
+                # finalize/restore environment
+                blender_scene.update()
+
+                post_setup_environment(self, blender_context)
+
+            print()
+            print("##########################################################")
+            print("Import from MS3D to Blender")
+            print(statistics)
+            print("##########################################################")
+
+        except Exception:
+            type, value, traceback = exc_info()
+            print("read - exception in try block\n  type: '{0}'\n"
+                    "  value: '{1}'".format(type, value, traceback))
+
+            if t2 is None:
+                t2 = time()
+
+            raise
+
+        else:
+            pass
+
+        t3 = time()
+        print(ms3d_str['SUMMARY_IMPORT'].format(
+                (t3 - t1), (t2 - t1), (t3 - t2)))
+
+        return {"FINISHED"}
+
+
+    def internal_read(self, blender_context, raw_io):
+        try:
+            # setup environment
+            pre_setup_environment(self, blender_context)
+
+            try:
+                ms3d_model.read(raw_io)
+            finally:
+                pass
+
+            # if option is set, this time will enlargs the io time
+            if self.options_verbose:
+                ms3d_model.print_internal()
+
+            is_valid, statistics = ms3d_model.is_valid()
+
+            if is_valid:
+                # inject ms3d data to blender
+                blender_empty_object, blender_mesh_object = self.to_blender(blender_context, ms3d_model)
+
+                blender_scene = blender_context.scene
+
+                # finalize/restore environment
+                blender_scene.update()
+
+                post_setup_environment(self, blender_context)
+
+        except Exception:
+            type, value, traceback = exc_info()
+            print("read - exception in try block\n  type: '{0}'\n"
+                    "  value: '{1}'".format(type, value, traceback))
+
+            raise
+
+        else:
+            pass
+
+        return blender_empty_object, blender_mesh_object
+
+
+    ###########################################################################
+    def to_blender(self, blender_context, ms3d_model):
+        blender_mesh_object = self.create_geometry(blender_context, ms3d_model)
+        blender_armature_object = self.create_animation(
+                blender_context, ms3d_model, blender_mesh_object)
+
+        blender_empty_object = self.organize_objects(
+                blender_context, ms3d_model,
+                [blender_mesh_object, blender_armature_object])
+
+        return blender_empty_object, blender_mesh_object
+
+
+    ###########################################################################
+    def organize_objects(self, blender_context, ms3d_model, blender_objects):
+        ##########################
+        # blender_armature_object to blender_mesh_object
+        # that has bad side effects to the armature
+        # and causes cyclic dependecies
+        ###blender_armature_object.parent = blender_mesh_object
+        ###blender_mesh_object.parent = blender_armature_object
+
+        blender_scene = blender_context.scene
+
+        blender_group = blender_context.blend_data.groups.new(
+                "{}.g".format(ms3d_model.name))
+        blender_empty_object = blender_context.blend_data.objects.new(
+                "{}.e".format(ms3d_model.name), None)
+        blender_empty_object.location = blender_scene.cursor_location
+        blender_scene.objects.link(blender_empty_object)
+        blender_group.objects.link(blender_empty_object)
+
+        for blender_object in blender_objects:
+            if blender_object is not None:
+                blender_group.objects.link(blender_object)
+                blender_object.parent = blender_empty_object
+
+        return blender_empty_object
+
+
+    ###########################################################################
+    def create_geometry(self, blender_context, ms3d_model):
+        ##########################
+        # blender stuff:
+        # create a blender Mesh
+        blender_mesh = blender_context.blend_data.meshes.new(
+                "{}.m".format(ms3d_model.name))
+        blender_mesh.ms3d.name = ms3d_model.name
+
+        ms3d_comment = ms3d_model.comment_object
+        if ms3d_comment is not None:
+            blender_mesh.ms3d.comment = ms3d_comment.comment
+        ms3d_model_ex = ms3d_model.model_ex_object
+        if ms3d_model_ex is not None:
+            blender_mesh.ms3d.joint_size = ms3d_model_ex.joint_size
+            blender_mesh.ms3d.alpha_ref = ms3d_model_ex.alpha_ref
+            blender_mesh.ms3d.transparency_mode \
+                    = Ms3dUi.transparency_mode_from_ms3d(
+                            ms3d_model_ex.transparency_mode)
+
+        ##########################
+        # blender stuff:
+        # link to blender object
+        blender_mesh_object = blender_context.blend_data.objects.new(
+                "{}.m".format(ms3d_model.name), blender_mesh)
+
+        ##########################
+        # blender stuff:
+        # create edge split modifire, to make sharp edges visible
+        blender_modifier = get_edge_split_modifier_add_if(blender_mesh_object)
+
+        ##########################
+        # blender stuff:
+        # link to blender scene
+        blender_scene = blender_context.scene
+        blender_scene.objects.link(blender_mesh_object)
+        #blender_mesh_object.location = blender_scene.cursor_location
+        enable_edit_mode(False, blender_context)
+        select_all(False)
+        blender_mesh_object.select = True
+        blender_scene.objects.active = blender_mesh_object
+
+        ##########################
+        # take this as active object after import
+        self.active_object = blender_mesh_object
+
+        ##########################
+        # blender stuff:
+        # create all (ms3d) groups
+        ms3d_to_blender_group_index = {}
+        blender_group_manager = blender_mesh.ms3d
+        for ms3d_group_index, ms3d_group in enumerate(ms3d_model.groups):
+            blender_group = blender_group_manager.create_group()
+            blender_group.name = ms3d_group.name
+            blender_group.flags = Ms3dUi.flags_from_ms3d(ms3d_group.flags)
+            blender_group.material_index = ms3d_group.material_index
+
+            ms3d_comment = ms3d_group.comment_object
+            if ms3d_comment is not None:
+                blender_group.comment = ms3d_comment.comment
+
+            # translation dictionary
+            ms3d_to_blender_group_index[ms3d_group_index] = blender_group.id
+
+        ####################################################
+        # begin BMesh stuff
+        #
+
+        ##########################
+        # BMesh stuff:
+        # create an empty BMesh
+        bm = bmesh.new()
+
+        ##########################
+        # BMesh stuff:
+        # create new Layers for custom data per "mesh face"
+        layer_texture = bm.faces.layers.tex.get(
+                ms3d_str['OBJECT_LAYER_TEXTURE'])
+        if layer_texture is None:
+            layer_texture = bm.faces.layers.tex.new(
+                    ms3d_str['OBJECT_LAYER_TEXTURE'])
+
+        layer_smoothing_group = bm.faces.layers.int.get(
+                ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
+        if layer_smoothing_group is None:
+            layer_smoothing_group = bm.faces.layers.int.new(
+                    ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
+
+        layer_group = bm.faces.layers.int.get(
+                ms3d_str['OBJECT_LAYER_GROUP'])
+        if layer_group is None:
+            layer_group = bm.faces.layers.int.new(
+                    ms3d_str['OBJECT_LAYER_GROUP'])
+
+        ##########################
+        # BMesh stuff:
+        # create new Layers for custom data per "face vertex"
+        layer_uv = bm.loops.layers.uv.get(ms3d_str['OBJECT_LAYER_UV'])
+        if layer_uv is None:
+            layer_uv = bm.loops.layers.uv.new(ms3d_str['OBJECT_LAYER_UV'])
+
+        ##########################
+        # BMesh stuff:
+        # create new Layers for custom data per "vertex"
+        layer_extra = bm.verts.layers.int.get(ms3d_str['OBJECT_LAYER_EXTRA'])
+        if layer_extra is None:
+            layer_extra = bm.verts.layers.int.new(ms3d_str['OBJECT_LAYER_EXTRA'])
+
+        ##########################
+        # BMesh stuff:
+        # create all vertices
+        for ms3d_vertex_index, ms3d_vertex in enumerate(ms3d_model.vertices):
+            bmv = bm.verts.new(self.geometry_correction(ms3d_vertex.vertex))
+
+            if layer_extra and ms3d_vertex.vertex_ex_object and \
+                    (isinstance(ms3d_vertex.vertex_ex_object, Ms3dVertexEx2) \
+                    or isinstance(ms3d_vertex.vertex_ex_object, Ms3dVertexEx3)):
+
+                #bmv[layer_extra] = ms3d_vertex.vertex_ex_object.extra
+                # bm.verts.layers.int does only support signed int32
+                # convert unsigned int32 to signed int32 (little-endian)
+                unsigned_int32 = ms3d_vertex.vertex_ex_object.extra
+                bytes_int32 = unsigned_int32.to_bytes(
+                        4, byteorder='little', signed=False)
+                signed_int32 = int.from_bytes(
+                        bytes_int32, byteorder='little', signed=True)
+                bmv[layer_extra] = signed_int32
+
+        ##########################
+        # blender stuff (uses BMesh stuff):
+        # create all materials / image textures
+        ms3d_to_blender_material = {}
+        for ms3d_material_index, ms3d_material in enumerate(
+                ms3d_model.materials):
+            blender_material = blender_context.blend_data.materials.new(
+                    ms3d_material.name)
+
+            # custom datas
+            blender_material.ms3d.name = ms3d_material.name
+            blender_material.ms3d.ambient = ms3d_material.ambient
+            blender_material.ms3d.diffuse = ms3d_material.diffuse
+            blender_material.ms3d.specular = ms3d_material.specular
+            blender_material.ms3d.emissive = ms3d_material.emissive
+            blender_material.ms3d.shininess = ms3d_material.shininess
+            blender_material.ms3d.transparency = ms3d_material.transparency
+            blender_material.ms3d.mode = Ms3dUi.texture_mode_from_ms3d(
+                    ms3d_material.mode)
+
+            if ms3d_material.texture:
+                blender_material.ms3d.texture = ms3d_material.texture
+
+            if ms3d_material.alphamap:
+                blender_material.ms3d.alphamap = ms3d_material.alphamap
+
+            ms3d_comment = ms3d_material.comment_object
+            if ms3d_comment is not None:
+                blender_material.ms3d.comment = ms3d_comment.comment
+
+            # blender datas
+            blender_material.ambient = (
+                    (ms3d_material.ambient[0]
+                    + ms3d_material.ambient[1]
+                    + ms3d_material.ambient[2]) / 3.0)
+
+            blender_material.diffuse_color[0] = ms3d_material.diffuse[0]
+            blender_material.diffuse_color[1] = ms3d_material.diffuse[1]
+            blender_material.diffuse_color[2] = ms3d_material.diffuse[2]
+
+            blender_material.specular_color[0] = ms3d_material.specular[0]
+            blender_material.specular_color[1] = ms3d_material.specular[1]
+            blender_material.specular_color[2] = ms3d_material.specular[2]
+
+            blender_material.emit = (
+                    (ms3d_material.emissive[0]
+                    + ms3d_material.emissive[1]
+                    + ms3d_material.emissive[2]) / 3.0)
+
+            blender_material.specular_hardness = ms3d_material.shininess * 4.0
+            blender_material.alpha = 1.0 - ms3d_material.transparency
+
+            # diffuse texture
+            if ms3d_material.texture:
+                dir_name_diffuse = self.directory_name
+                file_name_diffuse = path.split(ms3d_material.texture)[1]
+                blender_image_diffuse = load_image(
+                        file_name_diffuse, dir_name_diffuse)
+                blender_texture_diffuse = \
+                        blender_context.blend_data.textures.new(
+                        name=file_name_diffuse, type='IMAGE')
+                blender_texture_diffuse.image = blender_image_diffuse
+                blender_texture_slot_diffuse \
+                        = blender_material.texture_slots.add()
+                blender_texture_slot_diffuse.texture = blender_texture_diffuse
+                blender_texture_slot_diffuse.texture_coords = 'UV'
+                blender_texture_slot_diffuse.uv_layer = layer_uv.name
+                blender_texture_slot_diffuse.use_map_color_diffuse = True
+                blender_texture_slot_diffuse.use_map_alpha = False
+                if blender_image_diffuse is not None:
+                    self.has_textures = True
+            else:
+                blender_image_diffuse = None
+
+            # alpha texture
+            if ms3d_material.alphamap:
+                dir_name_alpha = self.directory_name
+                file_name_alpha = path.split(ms3d_material.alphamap)[1]
+                blender_image_alpha = load_image(
+                        file_name_alpha, dir_name_alpha)
+                blender_texture_alpha = blender_context.blend_data.textures.new(
+                        name=file_name_alpha, type='IMAGE')
+                blender_texture_alpha.image = blender_image_alpha
+                blender_texture_slot_alpha \
+                        = blender_material.texture_slots.add()
+                blender_texture_slot_alpha.texture = blender_texture_alpha
+                blender_texture_slot_alpha.texture_coords = 'UV'
+                blender_texture_slot_alpha.uv_layer = layer_uv.name
+                blender_texture_slot_alpha.use_map_color_diffuse = False
+                blender_texture_slot_alpha.use_map_alpha = True
+                blender_texture_slot_alpha.use_rgb_to_intensity = True
+                blender_material.alpha = 0
+                blender_material.specular_alpha = 0
+
+            # append blender material to blender mesh, to be linked to
+            blender_mesh.materials.append(blender_material)
+
+            # translation dictionary
+            ms3d_to_blender_material[ms3d_material_index] \
+                    = blender_image_diffuse
+
+        ##########################
+        # BMesh stuff:
+        # create all triangles
+        length_verts = len(bm.verts)
+        vertex_extra_index = length_verts
+        blender_invalide_normal = Vector()
+        smoothing_group_blender_faces = {}
+        for ms3d_triangle_index, ms3d_triangle in enumerate(
+                ms3d_model.triangles):
+            bmv_list = []
+            bmf_normal = Vector()
+
+            for index, vert_index in enumerate(ms3d_triangle.vertex_indices):
+                if vert_index < 0 or vert_index >= length_verts:
+                    continue
+                bmv = bm.verts[vert_index]
+
+                blender_normal = self.geometry_correction(
+                        ms3d_triangle.vertex_normals[index])
+                if bmv.normal == blender_invalide_normal:
+                    bmv.normal = blender_normal
+                elif bmv.normal != blender_normal \
+                        and self.options_use_extended_normal_handling:
+                    ## search for an already created extra vertex
+                    bmv_new = None
+                    for vert_index_candidat in range(
+                            vertex_extra_index, length_verts):
+                        bmv_candidat = bm.verts[vert_index_candidat]
+                        if bmv_candidat.co == bmv.co \
+                                and bmv_candidat.normal == blender_normal:
+                            bmv_new = bmv_candidat
+                            vert_index = vert_index_candidat
+                            break
+
+                    ## if not exists, create one in blender and ms3d as well
+                    if bmv_new is None:
+                        ms3d_model.vertices.append(
+                                ms3d_model.vertices[vert_index])
+                        bmv_new = bm.verts.new(bmv.co)
+                        bmv_new.normal = blender_normal
+                        bmv_new[layer_extra] = bmv[layer_extra]
+                        vert_index = length_verts
+                        length_verts += 1
+                        self.report({'WARNING', 'INFO'},
+                                ms3d_str['WARNING_IMPORT_EXTRA_VERTEX_NORMAL'].format(
+                                bmv.normal, blender_normal))
+                    bmv = bmv_new
+
+                if [[x] for x in bmv_list if x == bmv]:
+                    self.report(
+                            {'WARNING', 'INFO'},
+                            ms3d_str['WARNING_IMPORT_SKIP_VERTEX_DOUBLE'].format(
+                                    ms3d_triangle_index))
+                    continue
+                bmv_list.append(bmv)
+                bmf_normal += bmv.normal
+
+            if len(bmv_list) < 3:
+                self.report(
+                        {'WARNING', 'INFO'},
+                        ms3d_str['WARNING_IMPORT_SKIP_LESS_VERTICES'].format(
+                                ms3d_triangle_index))
+                continue
+
+            bmf_normal.normalize()
+
+            bmf = bm.faces.get(bmv_list)
+            if bmf is not None:
+                self.report(
+                        {'WARNING', 'INFO'},
+                        ms3d_str['WARNING_IMPORT_SKIP_FACE_DOUBLE'].format(
+                                ms3d_triangle_index))
+                continue
+
+            bmf = bm.faces.new(bmv_list)
+            bmf.normal = bmf_normal
+
+            # blender uv custom data per "face vertex"
+            bmf.loops[0][layer_uv].uv = Vector(
+                    (ms3d_triangle.s[0], 1.0 - ms3d_triangle.t[0]))
+            bmf.loops[1][layer_uv].uv = Vector(
+                    (ms3d_triangle.s[1], 1.0 - ms3d_triangle.t[1]))
+            bmf.loops[2][layer_uv].uv = Vector(
+                    (ms3d_triangle.s[2], 1.0 - ms3d_triangle.t[2]))
+
+            # ms3d custom data per "mesh face"
+            bmf[layer_smoothing_group] = ms3d_triangle.smoothing_group
+
+            blender_group_id = ms3d_to_blender_group_index.get(
+                    ms3d_triangle.group_index)
+            if blender_group_id is not None:
+                bmf[layer_group] = blender_group_id
+
+            if ms3d_triangle.group_index >= 0 \
+                    and ms3d_triangle.group_index < len(ms3d_model.groups):
+                ms3d_material_index \
+                        = ms3d_model.groups[ms3d_triangle.group_index].material_index
+                if ms3d_material_index != Ms3dSpec.NONE_GROUP_MATERIAL_INDEX:
+                    bmf.material_index = ms3d_material_index
+                    # apply diffuse texture image to face, to be visible in 3d view
+                    bmf[layer_texture].image = ms3d_to_blender_material.get(
+                            ms3d_material_index)
+
+            # helper dictionary for post-processing smoothing_groups
+            smoothing_group_blender_face = smoothing_group_blender_faces.get(
+                    ms3d_triangle.smoothing_group)
+            if smoothing_group_blender_face is None:
+                smoothing_group_blender_face = []
+                smoothing_group_blender_faces[ms3d_triangle.smoothing_group] \
+                        = smoothing_group_blender_face
+            smoothing_group_blender_face.append(bmf)
+
+        ##########################
+        # BMesh stuff:
+        # create all sharp edges for blender to make smoothing_groups visible
+        for ms3d_smoothing_group_index, blender_face_list \
+                in smoothing_group_blender_faces.items():
+            edge_dict = {}
+            for bmf in blender_face_list:
+                bmf.smooth = True
+                for bme in bmf.edges:
+                    if edge_dict.get(bme) is None:
+                        edge_dict[bme] = 0
+                    else:
+                        edge_dict[bme] += 1
+                    bme.seam = (edge_dict[bme] == 0)
+                    bme.smooth = (edge_dict[bme] != 0)
+
+        ##########################
+        # BMesh stuff:
+        # finally tranfer BMesh to Mesh
+        bm.to_mesh(blender_mesh)
+        bm.free()
+
+
+        #
+        # end BMesh stuff
+        ####################################################
+
+        blender_mesh.validate(self.options_verbose)
+
+        return blender_mesh_object
+
+
+    ###########################################################################
+    def create_animation(self, blender_context, ms3d_model, blender_mesh_object):
+        ##########################
+        # setup scene
+        blender_scene = blender_context.scene
+        blender_scene.render.fps = ms3d_model.animation_fps
+        if ms3d_model.animation_fps:
+            blender_scene.render.fps_base = (blender_scene.render.fps /
+                    ms3d_model.animation_fps)
+
+        blender_scene.frame_start = 1
+        blender_scene.frame_end = (ms3d_model.number_total_frames
+                + blender_scene.frame_start) - 1
+        blender_scene.frame_current = (ms3d_model.current_time
+                * ms3d_model.animation_fps)
+
+        ##########################
+        if not ms3d_model.joints:
+            return
+
+        ##########################
+        ms3d_armature_name = "{}.a".format(ms3d_model.name)
+        ms3d_action_name = "{}.act".format(ms3d_model.name)
+
+        ##########################
+        # create new blender_armature_object
+        blender_armature = blender_context.blend_data.armatures.new(
+                ms3d_armature_name)
+        blender_armature.ms3d.name = ms3d_model.name
+        blender_armature.draw_type = 'STICK'
+        blender_armature.show_axes = True
+        blender_armature.use_auto_ik = True
+        blender_armature_object = blender_context.blend_data.objects.new(
+                ms3d_armature_name, blender_armature)
+        blender_scene.objects.link(blender_armature_object)
+        #blender_armature_object.location = blender_scene.cursor_location
+        blender_armature_object.show_x_ray = True
+
+        ##########################
+        # create new modifier
+        blender_modifier = blender_mesh_object.modifiers.new(
+                ms3d_armature_name, type='ARMATURE')
+        blender_modifier.show_expanded = False
+        blender_modifier.use_vertex_groups = True
+        blender_modifier.use_bone_envelopes = False
+        blender_modifier.object = blender_armature_object
+
+        ##########################
+        # prepare for vertex groups
+        ms3d_to_blender_vertex_groups = {}
+        for ms3d_vertex_index, ms3d_vertex in enumerate(ms3d_model.vertices):
+            # prepare for later use for blender vertex group
+            if ms3d_vertex.bone_id != Ms3dSpec.NONE_VERTEX_BONE_ID:
+                if ms3d_vertex.vertex_ex_object \
+                        and ( \
+                        ms3d_vertex.vertex_ex_object.bone_ids[0] != \
+                                Ms3dSpec.NONE_VERTEX_BONE_ID \
+                        or ms3d_vertex.vertex_ex_object.bone_ids[1] != \
+                                Ms3dSpec.NONE_VERTEX_BONE_ID \
+                        or ms3d_vertex.vertex_ex_object.bone_ids[2] != \
+                                Ms3dSpec.NONE_VERTEX_BONE_ID \
+                        ):
+                    ms3d_vertex_group_ids_weights = []
+                    ms3d_vertex_group_ids_weights.append(
+                            (ms3d_vertex.bone_id,
+                            float(ms3d_vertex.vertex_ex_object.weights[0] % 101) / 100.0,
+                            ))
+                    if ms3d_vertex.vertex_ex_object.bone_ids[0] != \
+                            Ms3dSpec.NONE_VERTEX_BONE_ID:
+                        ms3d_vertex_group_ids_weights.append(
+                                (ms3d_vertex.vertex_ex_object.bone_ids[0],
+                                float(ms3d_vertex.vertex_ex_object.weights[1] % 101) / 100.0
+                                ))
+                    if ms3d_vertex.vertex_ex_object.bone_ids[1] != \
+                            Ms3dSpec.NONE_VERTEX_BONE_ID:
+                        ms3d_vertex_group_ids_weights.append(
+                                (ms3d_vertex.vertex_ex_object.bone_ids[1],
+                                float(ms3d_vertex.vertex_ex_object.weights[2] % 101) / 100.0
+                                ))
+                    if ms3d_vertex.vertex_ex_object.bone_ids[2] != \
+                            Ms3dSpec.NONE_VERTEX_BONE_ID:
+                        ms3d_vertex_group_ids_weights.append(
+                                (ms3d_vertex.vertex_ex_object.bone_ids[2],
+                                1.0 -
+                                float((ms3d_vertex.vertex_ex_object.weights[0] % 101)
+                                + (ms3d_vertex.vertex_ex_object.weights[1] % 101)
+                                + (ms3d_vertex.vertex_ex_object.weights[2] % 101)) / 100.0
+                                ))
+
+                else:
+                    ms3d_vertex_group_ids_weights = [(ms3d_vertex.bone_id, 1.0), ]
+
+                for ms3d_vertex_group_id_weight in ms3d_vertex_group_ids_weights:
+                    ms3d_vertex_group_id = ms3d_vertex_group_id_weight[0]
+                    blender_vertex_weight = ms3d_vertex_group_id_weight[1]
+                    blender_vertex_group = ms3d_to_blender_vertex_groups.get(
+                            ms3d_vertex_group_id)
+                    if blender_vertex_group is None:
+                        ms3d_to_blender_vertex_groups[ms3d_vertex_group_id] \
+                                = blender_vertex_group = []
+                    blender_vertex_group.append((ms3d_vertex_index,
+                            blender_vertex_weight))
+
+        ##########################
+        # blender stuff:
+        # create all vertex groups to be used for bones
+        for ms3d_bone_id, blender_vertex_index_weight_list \
+                in ms3d_to_blender_vertex_groups.items():
+            ms3d_name = ms3d_model.joints[ms3d_bone_id].name
+            blender_vertex_group = blender_mesh_object.vertex_groups.new(
+                    ms3d_name)
+            for blender_vertex_id_weight in blender_vertex_index_weight_list:
+                blender_vertex_index = blender_vertex_id_weight[0]
+                blender_vertex_weight = blender_vertex_id_weight[1]
+                blender_vertex_group.add((blender_vertex_index, ),
+                        blender_vertex_weight, 'ADD')
+
+        ##########################
+        # bring joints in the correct order
+        ms3d_joints_ordered = []
+        self.build_ms3d_joint_dependency_order(ms3d_model.joints,
+                ms3d_joints_ordered)
+
+        ##########################
+        # prepare joint data for later use
+        ms3d_joint_by_name = {}
+        for ms3d_joint in ms3d_joints_ordered:
+            item = ms3d_joint_by_name.get(ms3d_joint.name)
+            if item is None:
+                ms3d_joint.__children = []
+                ms3d_joint_by_name[ms3d_joint.name] = ms3d_joint
+
+            matrix_local_rot = (Matrix.Rotation(ms3d_joint.rotation[2], 4, 'Z')
+                    * Matrix.Rotation(ms3d_joint.rotation[1], 4, 'Y')
+                    ) * Matrix.Rotation(ms3d_joint.rotation[0], 4, 'X')
+            matrix_local = Matrix.Translation(Vector(ms3d_joint.position)
+                    ) * matrix_local_rot
+
+            ms3d_joint.__matrix_local_rot = matrix_local_rot
+            ms3d_joint.__matrix_global_rot = matrix_local_rot
+            ms3d_joint.__matrix_local = matrix_local
+            ms3d_joint.__matrix_global = matrix_local
+
+            if ms3d_joint.parent_name:
+                ms3d_joint_parent = ms3d_joint_by_name.get(
+                        ms3d_joint.parent_name)
+                if ms3d_joint_parent is not None:
+                    ms3d_joint_parent.__children.append(ms3d_joint)
+
+                    matrix_global = ms3d_joint_parent.__matrix_global \
+                            * matrix_local
+                    ms3d_joint.__matrix_global = matrix_global
+
+                    matrix_global_rot = ms3d_joint_parent.__matrix_global_rot \
+                            * matrix_local_rot
+                    ms3d_joint.__matrix_global_rot = matrix_global_rot
+
+        ##########################
+        # ms3d_joint to blender_edit_bone
+        if ms3d_model.model_ex_object and not self.options_use_joint_size:
+            joint_length = ms3d_model.model_ex_object.joint_size
+        else:
+            joint_length = self.options_joint_size
+        if joint_length < 0.01:
+            joint_length = 0.01
+
+        blender_scene.objects.active = blender_armature_object
+        enable_edit_mode(True, blender_context)
+        for ms3d_joint in ms3d_joints_ordered:
+            blender_edit_bone = blender_armature.edit_bones.new(ms3d_joint.name)
+            blender_edit_bone.use_connect = False
+            blender_edit_bone.use_inherit_rotation = True
+            blender_edit_bone.use_inherit_scale = True
+            blender_edit_bone.use_local_location = True
+            blender_armature.edit_bones.active = blender_edit_bone
+
+            ms3d_joint = ms3d_joint_by_name[ms3d_joint.name]
+            ms3d_joint_vector = ms3d_joint.__matrix_global * Vector()
+
+            blender_edit_bone.head \
+                    = self.geometry_correction(ms3d_joint_vector)
+
+            vector_tail_end_up = ms3d_joint.__matrix_global_rot * Vector((0,1,0))
+            vector_tail_end_dir = ms3d_joint.__matrix_global_rot * Vector((0,0,1))
+            vector_tail_end_up.normalize()
+            vector_tail_end_dir.normalize()
+            blender_edit_bone.tail = blender_edit_bone.head \
+                    + self.geometry_correction(
+                    vector_tail_end_dir * joint_length)
+            blender_edit_bone.align_roll(self.geometry_correction(
+                    vector_tail_end_up))
+
+            if ms3d_joint.parent_name:
+                ms3d_joint_parent = ms3d_joint_by_name[ms3d_joint.parent_name]
+                blender_edit_bone_parent = ms3d_joint_parent.blender_edit_bone
+                blender_edit_bone.parent = blender_edit_bone_parent
+
+            ms3d_joint.blender_bone_name = blender_edit_bone.name
+            ms3d_joint.blender_edit_bone = blender_edit_bone
+        enable_edit_mode(False, blender_context)
+
+        if self.options_use_joint_to_bones:
+            enable_edit_mode(True, blender_context)
+            for ms3d_joint in ms3d_joints_ordered:
+                blender_edit_bone = blender_armature.edit_bones[ms3d_joint.name]
+                if blender_edit_bone.children:
+                    new_length = 0.0
+                    for child_bone in blender_edit_bone.children:
+                        length = (child_bone.head - blender_edit_bone.head).length
+                        if new_length <= 0 or length < new_length:
+                            new_length = length
+                    if new_length >= 0.01:
+                        direction = blender_edit_bone.tail - blender_edit_bone.head
+                        direction.normalize()
+                        blender_edit_bone.tail = blender_edit_bone.head + (direction * new_length)
+            enable_edit_mode(False, blender_context)
+
+        ##########################
+        # post process bones
+        enable_edit_mode(False, blender_context)
+        for ms3d_joint_name, ms3d_joint in ms3d_joint_by_name.items():
+            blender_bone = blender_armature.bones.get(
+                    ms3d_joint.blender_bone_name)
+            if blender_bone is None:
+                continue
+
+            blender_bone.ms3d.name = ms3d_joint.name
+            blender_bone.ms3d.flags = Ms3dUi.flags_from_ms3d(ms3d_joint.flags)
+
+            ms3d_joint_ex = ms3d_joint.joint_ex_object
+            if ms3d_joint_ex is not None:
+                blender_bone.ms3d.color = ms3d_joint_ex.color
+
+            ms3d_comment = ms3d_joint.comment_object
+            if ms3d_comment is not None:
+                blender_bone.ms3d.comment = ms3d_comment.comment
+
+        ##########################
+        if not self.options_use_animation:
+            return blender_armature_object
+
+
+        ##########################
+        # process pose bones
+        enable_pose_mode(True, blender_context)
+
+        blender_action = blender_context.blend_data.actions.new(ms3d_action_name)
+        if blender_armature_object.animation_data is None:
+            blender_armature_object.animation_data_create()
+        blender_armature_object.animation_data.action = blender_action
+
+        ##########################
+        # transition between keys may be incorrect
+        # because of the gimbal-lock problem!
+        # http://www.youtube.com/watch?v=zc8b2Jo7mno
+        # http://www.youtube.com/watch?v=rrUCBOlJdt4
+        # you can fix it manually by selecting the affected keyframes
+        # and allpy the following option to it:
+        # "Graph Editor -> Key -> Discontinuity (Euler) Filter"
+        # ==> "bpy.ops.graph.euler_filter()"
+        # but this option is only available for Euler rotation f-curves!
+        #
+        for ms3d_joint_name, ms3d_joint in ms3d_joint_by_name.items():
+            blender_pose_bone = blender_armature_object.pose.bones.get(
+                    ms3d_joint.blender_bone_name)
+            if blender_pose_bone is None:
+                continue
+
+            data_path = blender_pose_bone.path_from_id('location')
+            fcurve_location_x = blender_action.fcurves.new(data_path, index=0)
+            fcurve_location_y = blender_action.fcurves.new(data_path, index=1)
+            fcurve_location_z = blender_action.fcurves.new(data_path, index=2)
+            for translation_key_frames in ms3d_joint.translation_key_frames:
+                frame = (translation_key_frames.time * ms3d_model.animation_fps)
+                matrix_local = Matrix.Translation(
+                        Vector(translation_key_frames.position))
+                v = (matrix_local) * Vector()
+                fcurve_location_x.keyframe_points.insert(frame, -v[0])
+                fcurve_location_y.keyframe_points.insert(frame, v[2])
+                fcurve_location_z.keyframe_points.insert(frame, v[1])
+
+            if self.options_use_quaternion_rotation:
+                blender_pose_bone.rotation_mode = 'QUATERNION'
+                data_path = blender_pose_bone.path_from_id("rotation_quaternion")
+                fcurve_rotation_w = blender_action.fcurves.new(data_path, index=0)
+                fcurve_rotation_x = blender_action.fcurves.new(data_path, index=1)
+                fcurve_rotation_y = blender_action.fcurves.new(data_path, index=2)
+                fcurve_rotation_z = blender_action.fcurves.new(data_path, index=3)
+                for rotation_key_frames in ms3d_joint.rotation_key_frames:
+                    frame = (rotation_key_frames.time * ms3d_model.animation_fps)
+                    matrix_local_rot = (
+                            Matrix.Rotation(
+                                    rotation_key_frames.rotation[2], 4, 'Y')
+                            * Matrix.Rotation(
+                                    rotation_key_frames.rotation[1], 4, 'Z')
+                            ) * Matrix.Rotation(
+                                    -rotation_key_frames.rotation[0], 4, 'X')
+                    q = (matrix_local_rot).to_quaternion()
+                    fcurve_rotation_w.keyframe_points.insert(frame, q.w)
+                    fcurve_rotation_x.keyframe_points.insert(frame, q.x)
+                    fcurve_rotation_y.keyframe_points.insert(frame, q.y)
+                    fcurve_rotation_z.keyframe_points.insert(frame, q.z)
+            else:
+                blender_pose_bone.rotation_mode = 'XZY'
+                data_path = blender_pose_bone.path_from_id("rotation_euler")
+                fcurve_rotation_x = blender_action.fcurves.new(data_path, index=0)
+                fcurve_rotation_y = blender_action.fcurves.new(data_path, index=1)
+                fcurve_rotation_z = blender_action.fcurves.new(data_path, index=2)
+                for rotation_key_frames in ms3d_joint.rotation_key_frames:
+                    frame = (rotation_key_frames.time * ms3d_model.animation_fps)
+                    fcurve_rotation_x.keyframe_points.insert(
+                            frame, -rotation_key_frames.rotation[0])
+                    fcurve_rotation_y.keyframe_points.insert(
+                            frame, rotation_key_frames.rotation[2])
+                    fcurve_rotation_z.keyframe_points.insert(
+                            frame, rotation_key_frames.rotation[1])
+
+        enable_pose_mode(False, blender_context)
+
+        return blender_armature_object
+
+
+    ###########################################################################
+    def geometry_correction(self, value):
+        return Vector((value[2], value[0], value[1]))
+
+
+    ###########################################################################
+    def build_ms3d_joint_dependency_order(self, ms3d_joints, ms3d_joints_ordered):
+        ms3d_joints_children = {"": {}}
+        for ms3d_joint in ms3d_joints:
+            if ms3d_joint.parent_name:
+                ms3d_joint_children = ms3d_joints_children.get(
+                        ms3d_joint.parent_name)
+                if ms3d_joint_children is None:
+                    ms3d_joint_children = ms3d_joints_children[
+                            ms3d_joint.parent_name] = {}
+            else:
+                ms3d_joint_children = ms3d_joints_children[""]
+
+            ms3d_joint_children[ms3d_joint.name] = ms3d_joint
+
+        self.traverse_dependencies(
+                ms3d_joints_ordered,
+                ms3d_joints_children,
+                "")
+
+
+        return ms3d_joints_ordered
+
+
+    ###########################################################################
+    def traverse_dependencies(self, ms3d_joints_ordered, ms3d_joints_children,
+            key):
+        ms3d_joint_children = ms3d_joints_children.get(key)
+        if ms3d_joint_children:
+            for item in ms3d_joint_children.items():
+                ms3d_joint_name = item[0]
+                ms3d_joint = item[1]
+                ms3d_joints_ordered.append(ms3d_joint)
+                self.traverse_dependencies(
+                        ms3d_joints_ordered,
+                        ms3d_joints_children,
+                        ms3d_joint_name)
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# ##### END OF FILE #####
diff --git a/release/scripts/addons/io_scene_ms3d/ms3d_spec.py b/release/scripts/addons/io_scene_ms3d/ms3d_spec.py
new file mode 100644
index 0000000..740b333
--- /dev/null
+++ b/release/scripts/addons/io_scene_ms3d/ms3d_spec.py
@@ -0,0 +1,2075 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011-2013 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+from struct import (
+        pack,
+        unpack,
+        )
+from sys import (
+        exc_info,
+        )
+from codecs import (
+        register_error,
+        )
+
+###############################################################################
+#
+# MilkShape 3D 1.8.5 File Format Specification
+#
+# all specifications were taken from SDK 1.8.5
+#
+# some additional specifications were taken from
+# MilkShape 3D Viewer v2.0 (Nov 06 2007) - msMesh.h
+#
+
+
+###############################################################################
+#
+# sizes
+#
+
+class Ms3dSpec:
+    ###########################################################################
+    #
+    # max values
+    #
+    MAX_VERTICES = 65534 # 0..65533; note: (65534???, 65535???)
+    MAX_TRIANGLES = 65534 # 0..65533; note: (65534???, 65535???)
+    MAX_GROUPS = 255 # 1..255; note: (0 default group)
+    MAX_MATERIALS = 128 # 0..127; note: (-1 no material)
+    MAX_JOINTS = 128 # 0..127; note: (-1 no joint)
+    MAX_SMOOTH_GROUP = 32 # 0..32; note: (0 no smoothing group)
+    MAX_TEXTURE_FILENAME_SIZE = 128
+
+    ###########################################################################
+    #
+    # flags
+    #
+    FLAG_NONE = 0
+    FLAG_SELECTED = 1
+    FLAG_HIDDEN = 2
+    FLAG_SELECTED2 = 4
+    FLAG_DIRTY = 8
+    FLAG_ISKEY = 16 # additional spec from [2]
+    FLAG_NEWLYCREATED = 32 # additional spec from [2]
+    FLAG_MARKED = 64 # additional spec from [2]
+
+    FLAG_TEXTURE_NONE = 0x00
+    FLAG_TEXTURE_COMBINE_ALPHA = 0x20
+    FLAG_TEXTURE_HAS_ALPHA = 0x40
+    FLAG_TEXTURE_SPHERE_MAP = 0x80
+
+    MODE_TRANSPARENCY_SIMPLE = 0
+    MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF = 1
+    MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES = 2
+
+
+    ###########################################################################
+    #
+    # values
+    #
+    HEADER = "MS3D000000"
+
+
+    ## TEST_STR = 'START@€@µ@²@³@©@®@¶@ÿ@A at END.bmp'
+    ## TEST_RAW = b'START@\x80@\xb5@\xb2@\xb3@\xa9@\xae@\xb6@\xff at A@END.bmp\x00'
+    ##
+    STRING_MS3D_REPLACE = 'use_ms3d_replace'
+    STRING_ENCODING = "ascii" # wrong encoding (too limited), but there is an UnicodeEncodeError issue, that prevent using the correct one for the moment
+    ##STRING_ENCODING = "cp437" # US, wrong encoding and shows UnicodeEncodeError
+    ##STRING_ENCODING = "cp858" # Europe + €, wrong encoding and shows UnicodeEncodeError
+    ##STRING_ENCODING = "cp1252" # WIN EU, this would be the better codepage, but shows UnicodeEncodeError, on print on system console and writing to file
+    STRING_ERROR = STRING_MS3D_REPLACE
+    ##STRING_ERROR = 'replace'
+    ##STRING_ERROR = 'ignore'
+    ##STRING_ERROR = 'surrogateescape'
+    STRING_TERMINATION = b'\x00'
+    STRING_REPLACE = u'_'
+
+
+    ###########################################################################
+    #
+    # min, max, default values
+    #
+    NONE_VERTEX_BONE_ID = -1
+    NONE_GROUP_MATERIAL_INDEX = -1
+
+    DEFAULT_HEADER = HEADER
+    DEFAULT_HEADER_VERSION = 4
+    DEFAULT_VERTEX_BONE_ID = NONE_VERTEX_BONE_ID
+    DEFAULT_TRIANGLE_SMOOTHING_GROUP = 0
+    DEFAULT_TRIANGLE_GROUP = 0
+    DEFAULT_MATERIAL_MODE = FLAG_TEXTURE_NONE
+    DEFAULT_GROUP_MATERIAL_INDEX = NONE_GROUP_MATERIAL_INDEX
+    DEFAULT_MODEL_JOINT_SIZE = 1.0
+    DEFAULT_MODEL_TRANSPARENCY_MODE = MODE_TRANSPARENCY_SIMPLE
+    DEFAULT_MODEL_ANIMATION_FPS = 25.0
+    DEFAULT_MODEL_SUB_VERSION_COMMENTS = 1
+    DEFAULT_MODEL_SUB_VERSION_VERTEX_EXTRA = 2
+    DEFAULT_MODEL_SUB_VERSION_JOINT_EXTRA = 1
+    DEFAULT_MODEL_SUB_VERSION_MODEL_EXTRA = 1
+    DEFAULT_FLAGS = FLAG_NONE
+    MAX_MATERIAL_SHININESS = 128
+
+    # blender default / OpenGL default
+    DEFAULT_MATERIAL_AMBIENT = (0.2, 0.2, 0.2, 1.0)
+    DEFAULT_MATERIAL_DIFFUSE = (0.8, 0.8, 0.8, 1.0)
+    DEFAULT_MATERIAL_SPECULAR = (1.0, 1.0, 1.0, 1.0)
+    DEFAULT_MATERIAL_EMISSIVE = (0.0, 0.0, 0.0, 1.0)
+    DEFAULT_MATERIAL_SHININESS = 12.5
+
+    DEFAULT_JOINT_COLOR = (0.8, 0.8, 0.8)
+
+###############################################################################
+#
+# helper class for basic raw io
+#
+class Ms3dIo:
+    # sizes for IO
+    SIZE_BYTE = 1
+    SIZE_SBYTE = 1
+    SIZE_WORD = 2
+    SIZE_DWORD = 4
+    SIZE_FLOAT = 4
+    LENGTH_ID = 10
+    LENGTH_NAME = 32
+    LENGTH_FILENAME = 128
+
+    PRECISION = 4
+
+    @staticmethod
+    def read_byte(raw_io):
+        """ read a single byte from raw_io """
+        buffer = raw_io.read(Ms3dIo.SIZE_BYTE)
+        if not buffer:
+            raise EOFError()
+        value = unpack('<B', buffer)[0]
+        return value
+
+    @staticmethod
+    def write_byte(raw_io, value):
+        """ write a single byte to raw_io """
+        raw_io.write(pack('<B', value))
+
+    @staticmethod
+    def read_sbyte(raw_io):
+        """ read a single signed byte from raw_io """
+        buffer = raw_io.read(Ms3dIo.SIZE_BYTE)
+        if not buffer:
+            raise EOFError()
+        value = unpack('<b', buffer)[0]
+        return value
+
+    @staticmethod
+    def write_sbyte(raw_io, value):
+        """ write a single signed byte to raw_io """
+        raw_io.write(pack('<b', value))
+
+    @staticmethod
+    def read_word(raw_io):
+        """ read a word from raw_io """
+        buffer = raw_io.read(Ms3dIo.SIZE_WORD)
+        if not buffer:
+            raise EOFError()
+        value = unpack('<H', buffer)[0]
+        return value
+
+    @staticmethod
+    def write_word(raw_io, value):
+        """ write a word to raw_io """
+        raw_io.write(pack('<H', value))
+
+    @staticmethod
+    def read_dword(raw_io):
+        """ read a double word from raw_io """
+        buffer = raw_io.read(Ms3dIo.SIZE_DWORD)
+        if not buffer:
+            raise EOFError()
+        value = unpack('<I', buffer)[0]
+        return value
+
+    @staticmethod
+    def write_dword(raw_io, value):
+        """ write a double word to raw_io """
+        raw_io.write(pack('<I', value))
+
+    @staticmethod
+    def read_float(raw_io):
+        """ read a float from raw_io """
+        buffer = raw_io.read(Ms3dIo.SIZE_FLOAT)
+        if not buffer:
+            raise EOFError()
+        value = unpack('<f', buffer)[0]
+        return value
+
+    @staticmethod
+    def write_float(raw_io, value):
+        """ write a float to raw_io """
+        raw_io.write(pack('<f', value))
+
+    @staticmethod
+    def read_array(raw_io, itemReader, count):
+        """ read an array[count] of objects from raw_io, by using a itemReader """
+        value = []
+        for i in range(count):
+            itemValue = itemReader(raw_io)
+            value.append(itemValue)
+        return tuple(value)
+
+    @staticmethod
+    def write_array(raw_io, itemWriter, count, value):
+        """ write an array[count] of objects to raw_io, by using a itemWriter """
+        for i in range(count):
+            itemValue = value[i]
+            itemWriter(raw_io, itemValue)
+
+    @staticmethod
+    def read_array2(raw_io, itemReader, count, count2):
+        """ read an array[count][count2] of objects from raw_io,
+            by using a itemReader """
+        value = []
+        for i in range(count):
+            itemValue = Ms3dIo.read_array(raw_io, itemReader, count2)
+            value.append(tuple(itemValue))
+        return value
+
+    @staticmethod
+    def write_array2(raw_io, itemWriter, count, count2, value):
+        """ write an array[count][count2] of objects to raw_io,
+            by using a itemWriter """
+        for i in range(count):
+            itemValue = value[i]
+            Ms3dIo.write_array(raw_io, itemWriter, count2, itemValue)
+
+
+    @staticmethod
+    def ms3d_replace(exc):
+        """ http://www.python.org/dev/peps/pep-0293/ """
+        if isinstance(exc, UnicodeEncodeError):
+            return ((exc.end-exc.start)*Ms3dSpec.STRING_REPLACE, exc.end)
+        elif isinstance(exc, UnicodeDecodeError):
+            return (Ms3dSpec.STRING_REPLACE, exc.end)
+        elif isinstance(exc, UnicodeTranslateError):
+            return ((exc.end-exc.start)*Ms3dSpec.STRING_REPLACE, exc.end)
+        else:
+            raise TypeError("can't handle %s" % exc.__name__)
+
+    @staticmethod
+    def read_string(raw_io, length):
+        """ read a string of a specific length from raw_io """
+        buffer = raw_io.read(length)
+        if not buffer:
+            raise EOFError()
+        eol = buffer.find(Ms3dSpec.STRING_TERMINATION)
+        register_error(Ms3dSpec.STRING_MS3D_REPLACE, Ms3dIo.ms3d_replace)
+        s = buffer[:eol].decode(encoding=Ms3dSpec.STRING_ENCODING, errors=Ms3dSpec.STRING_ERROR)
+        return s
+
+    @staticmethod
+    def write_string(raw_io, length, value):
+        """ write a string of a specific length to raw_io """
+        register_error(Ms3dSpec.STRING_MS3D_REPLACE, Ms3dIo.ms3d_replace)
+        buffer = value.encode(encoding=Ms3dSpec.STRING_ENCODING, errors=Ms3dSpec.STRING_ERROR)
+        if not buffer:
+            buffer = bytes()
+        raw_io.write(pack('<{}s'.format(length), buffer))
+        return
+
+
+###############################################################################
+#
+# multi complex types
+#
+
+###############################################################################
+class Ms3dHeader:
+    """ Ms3dHeader """
+    __slots__ = (
+            'id',
+            'version',
+            )
+
+    def __init__(
+            self,
+            default_id=Ms3dSpec.DEFAULT_HEADER,
+            default_version=Ms3dSpec.DEFAULT_HEADER_VERSION
+            ):
+        self.id = default_id
+        self.version = default_version
+
+    def __repr__(self):
+        return "\n<id='{}', version={}>".format(
+            self.id,
+            self.version
+            )
+
+    def __hash__(self):
+        return hash(self.id) ^ hash(self.version)
+
+    def __eq__(self, other):
+        return ((self is not None) and (other is not None)
+                and (self.id == other.id)
+                and (self.version == other.version))
+
+    def read(self, raw_io):
+        self.id = Ms3dIo.read_string(raw_io, Ms3dIo.LENGTH_ID)
+        self.version = Ms3dIo.read_dword(raw_io)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_string(raw_io, Ms3dIo.LENGTH_ID, self.id)
+        Ms3dIo.write_dword(raw_io, self.version)
+
+
+###############################################################################
+class Ms3dVertex:
+    """ Ms3dVertex """
+    """
+    __slots__ was taking out,
+    to be able to inject additional attributes during runtime
+    __slots__ = (
+            'flags',
+            'bone_id',
+            'reference_count',
+            '_vertex',
+            '_vertex_ex_object', # Ms3dVertexEx
+            )
+    """
+
+    def __init__(
+            self,
+            default_flags=Ms3dSpec.DEFAULT_FLAGS,
+            default_vertex=(0.0, 0.0, 0.0),
+            default_bone_id=Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
+            default_reference_count=0,
+            default_vertex_ex_object=None, # Ms3dVertexEx
+            ):
+        self.flags = default_flags
+        self._vertex = default_vertex
+        self.bone_id = default_bone_id
+        self.reference_count = default_reference_count
+
+        if default_vertex_ex_object is None:
+            default_vertex_ex_object = Ms3dVertexEx2()
+            # Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_VERTEX_EXTRA = 2
+        self._vertex_ex_object = default_vertex_ex_object
+        # Ms3dVertexEx
+
+    def __repr__(self):
+        return "\n<flags={}, vertex=({:.{p}f}, {:.{p}f}, {:.{p}f}), bone_id={},"\
+                " reference_count={}>".format(
+                self.flags,
+                self._vertex[0],
+                self._vertex[1],
+                self._vertex[2],
+                self.bone_id,
+                self.reference_count,
+                p=Ms3dIo.PRECISION
+                )
+
+    def __hash__(self):
+        return (hash(self.vertex)
+                #^ hash(self.flags)
+                #^ hash(self.bone_id)
+                #^ hash(self.reference_count)
+                )
+
+    def __eq__(self, other):
+        return ((self.vertex == other.vertex)
+                #and (self.flags == other.flags)
+                #and (self.bone_id == other.bone_id)
+                #and (self.reference_count == other.reference_count)
+                )
+
+
+    @property
+    def vertex(self):
+        return self._vertex
+
+    @property
+    def vertex_ex_object(self):
+        return self._vertex_ex_object
+
+
+    def read(self, raw_io):
+        self.flags = Ms3dIo.read_byte(raw_io)
+        self._vertex = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        self.bone_id = Ms3dIo.read_sbyte(raw_io)
+        self.reference_count = Ms3dIo.read_byte(raw_io)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_byte(raw_io, self.flags)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.vertex)
+        Ms3dIo.write_sbyte(raw_io, self.bone_id)
+        Ms3dIo.write_byte(raw_io, self.reference_count)
+
+
+###############################################################################
+class Ms3dTriangle:
+    """ Ms3dTriangle """
+    """
+    __slots__ was taking out,
+    to be able to inject additional attributes during runtime
+    __slots__ = (
+            'flags',
+            'smoothing_group',
+            'group_index',
+            '_vertex_indices',
+            '_vertex_normals',
+            '_s',
+            '_t',
+            )
+    """
+
+    def __init__(
+            self,
+            default_flags=Ms3dSpec.DEFAULT_FLAGS,
+            default_vertex_indices=(0, 0, 0),
+            default_vertex_normals=(
+                    (0.0, 0.0, 0.0),
+                    (0.0, 0.0, 0.0),
+                    (0.0, 0.0, 0.0)),
+            default_s=(0.0, 0.0, 0.0),
+            default_t=(0.0, 0.0, 0.0),
+            default_smoothing_group=Ms3dSpec.DEFAULT_TRIANGLE_SMOOTHING_GROUP,
+            default_group_index=Ms3dSpec.DEFAULT_TRIANGLE_GROUP
+            ):
+        self.flags = default_flags
+        self._vertex_indices = default_vertex_indices
+        self._vertex_normals = default_vertex_normals
+        self._s = default_s
+        self._t = default_t
+        self.smoothing_group = default_smoothing_group
+        self.group_index = default_group_index
+
+    def __repr__(self):
+        return "\n<flags={}, vertex_indices={}, vertex_normals=(({:.{p}f}, "\
+                "{:.{p}f}, {:.{p}f}), ({:.{p}f}, {:.{p}f}, {:.{p}f}), ({:.{p}f}, "\
+                "{:.{p}f}, {:.{p}f})), s=({:.{p}f}, {:.{p}f}, {:.{p}f}), "\
+                "t=({:.{p}f}, {:.{p}f}, {:.{p}f}), smoothing_group={}, "\
+                "group_index={}>".format(
+                self.flags,
+                self.vertex_indices,
+                self.vertex_normals[0][0],
+                self.vertex_normals[0][1],
+                self.vertex_normals[0][2],
+                self.vertex_normals[1][0],
+                self.vertex_normals[1][1],
+                self.vertex_normals[1][2],
+                self.vertex_normals[2][0],
+                self.vertex_normals[2][1],
+                self.vertex_normals[2][2],
+                self.s[0],
+                self.s[1],
+                self.s[2],
+                self.t[0],
+                self.t[1],
+                self.t[2],
+                self.smoothing_group,
+                self.group_index,
+                p=Ms3dIo.PRECISION
+                )
+
+
+    @property
+    def vertex_indices(self):
+        return self._vertex_indices
+
+    @property
+    def vertex_normals(self):
+        return self._vertex_normals
+
+    @property
+    def s(self):
+        return self._s
+
+    @property
+    def t(self):
+        return self._t
+
+
+    def read(self, raw_io):
+        self.flags = Ms3dIo.read_word(raw_io)
+        self._vertex_indices = Ms3dIo.read_array(raw_io, Ms3dIo.read_word, 3)
+        self._vertex_normals = Ms3dIo.read_array2(raw_io, Ms3dIo.read_float, 3, 3)
+        self._s = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        self._t = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        self.smoothing_group = Ms3dIo.read_byte(raw_io)
+        self.group_index = Ms3dIo.read_byte(raw_io)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_word(raw_io, self.flags)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_word, 3, self.vertex_indices)
+        Ms3dIo.write_array2(raw_io, Ms3dIo.write_float, 3, 3, self.vertex_normals)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.s)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.t)
+        Ms3dIo.write_byte(raw_io, self.smoothing_group)
+        Ms3dIo.write_byte(raw_io, self.group_index)
+
+
+###############################################################################
+class Ms3dGroup:
+    """ Ms3dGroup """
+    """
+    __slots__ was taking out,
+    to be able to inject additional attributes during runtime
+    __slots__ = (
+            'flags',
+            'name',
+            'material_index',
+            '_triangle_indices',
+            '_comment_object', # Ms3dComment
+            )
+    """
+
+    def __init__(
+            self,
+            default_flags=Ms3dSpec.DEFAULT_FLAGS,
+            default_name="",
+            default_triangle_indices=None,
+            default_material_index=Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX,
+            default_comment_object=None, # Ms3dComment
+            ):
+        if (default_name is None):
+            default_name = ""
+
+        if (default_triangle_indices is None):
+            default_triangle_indices = []
+
+        self.flags = default_flags
+        self.name = default_name
+        self._triangle_indices = default_triangle_indices
+        self.material_index = default_material_index
+
+        if default_comment_object is None:
+            default_comment_object = Ms3dCommentEx()
+        self._comment_object = default_comment_object # Ms3dComment
+
+    def __repr__(self):
+        return "\n<flags={}, name='{}', number_triangles={},"\
+                " triangle_indices={}, material_index={}>".format(
+                self.flags,
+                self.name,
+                self.number_triangles,
+                self.triangle_indices,
+                self.material_index
+                )
+
+
+    @property
+    def number_triangles(self):
+        if self.triangle_indices is None:
+            return 0
+        return len(self.triangle_indices)
+
+    @property
+    def triangle_indices(self):
+        return self._triangle_indices
+
+    @property
+    def comment_object(self):
+        return self._comment_object
+
+
+    def read(self, raw_io):
+        self.flags = Ms3dIo.read_byte(raw_io)
+        self.name = Ms3dIo.read_string(raw_io, Ms3dIo.LENGTH_NAME)
+        _number_triangles = Ms3dIo.read_word(raw_io)
+        self._triangle_indices = Ms3dIo.read_array(
+                raw_io, Ms3dIo.read_word, _number_triangles)
+        self.material_index = Ms3dIo.read_sbyte(raw_io)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_byte(raw_io, self.flags)
+        Ms3dIo.write_string(raw_io, Ms3dIo.LENGTH_NAME, self.name)
+        Ms3dIo.write_word(raw_io, self.number_triangles)
+        Ms3dIo.write_array(
+                raw_io, Ms3dIo.write_word, self.number_triangles,
+                self.triangle_indices)
+        Ms3dIo.write_sbyte(raw_io, self.material_index)
+
+
+###############################################################################
+class Ms3dMaterial:
+    """ Ms3dMaterial """
+    """
+    __slots__ was taking out,
+    to be able to inject additional attributes during runtime
+    __slots__ = (
+            'name',
+            'shininess',
+            'transparency',
+            'mode',
+            'texture',
+            'alphamap',
+            '_ambient',
+            '_diffuse',
+            '_specular',
+            '_emissive',
+            '_comment_object', # Ms3dComment
+            )
+    """
+
+    def __init__(
+            self,
+            default_name="",
+            default_ambient=list(Ms3dSpec.DEFAULT_MATERIAL_AMBIENT),
+            default_diffuse=list(Ms3dSpec.DEFAULT_MATERIAL_DIFFUSE),
+            default_specular=list(Ms3dSpec.DEFAULT_MATERIAL_SPECULAR),
+            default_emissive=list(Ms3dSpec.DEFAULT_MATERIAL_EMISSIVE),
+            default_shininess=Ms3dSpec.DEFAULT_MATERIAL_SHININESS,
+            default_transparency=0.0,
+            default_mode=Ms3dSpec.DEFAULT_MATERIAL_MODE,
+            default_texture="",
+            default_alphamap="",
+            default_comment_object=None, # Ms3dComment
+            ):
+        if (default_name is None):
+            default_name = ""
+
+        if (default_texture is None):
+            default_texture = ""
+
+        if (default_alphamap is None):
+            default_alphamap = ""
+
+        self.name = default_name
+        self._ambient = default_ambient
+        self._diffuse = default_diffuse
+        self._specular = default_specular
+        self._emissive = default_emissive
+        self.shininess = default_shininess
+        self.transparency = default_transparency
+        self.mode = default_mode
+        self.texture = default_texture
+        self.alphamap = default_alphamap
+
+        if default_comment_object is None:
+            default_comment_object = Ms3dCommentEx()
+        self._comment_object = default_comment_object # Ms3dComment
+
+    def __repr__(self):
+        return "\n<name='{}', ambient=({:.{p}f}, {:.{p}f}, {:.{p}f}, {:.{p}f}), "\
+                "diffuse=({:.{p}f}, {:.{p}f}, {:.{p}f}, {:.{p}f}), specular=("\
+                "{:.{p}f}, {:.{p}f}, {:.{p}f}, {:.{p}f}), emissive=({:.{p}f}, "\
+                "{:.{p}f}, {:.{p}f}, {:.{p}f}), shininess={:.{p}f}, transparency="\
+                "{:.{p}f}, mode={}, texture='{}', alphamap='{}'>".format(
+                self.name,
+                self.ambient[0],
+                self.ambient[1],
+                self.ambient[2],
+                self.ambient[3],
+                self.diffuse[0],
+                self.diffuse[1],
+                self.diffuse[2],
+                self.diffuse[3],
+                self.specular[0],
+                self.specular[1],
+                self.specular[2],
+                self.specular[3],
+                self.emissive[0],
+                self.emissive[1],
+                self.emissive[2],
+                self.emissive[3],
+                self.shininess,
+                self.transparency,
+                self.mode,
+                self.texture,
+                self.alphamap,
+                p=Ms3dIo.PRECISION
+                )
+
+    def __hash__(self):
+        return (hash(self.name)
+
+                ^ hash(self.ambient)
+                ^ hash(self.diffuse)
+                ^ hash(self.specular)
+                ^ hash(self.emissive)
+
+                ^ hash(self.shininess)
+                ^ hash(self.transparency)
+                ^ hash(self.mode)
+
+                ^ hash(self.texture)
+                ^ hash(self.alphamap)
+                )
+
+    def __eq__(self, other):
+        return ((self.name == other.name)
+
+                and (self.ambient == other.ambient)
+                and (self.diffuse == other.diffuse)
+                and (self.specular == other.specular)
+                and (self.emissive == other.emissive)
+
+                and (self.shininess == other.shininess)
+                and (self.transparency == other.transparency)
+                and (self.mode == other.mode)
+
+                #and (self.texture == other.texture)
+                #and (self.alphamap == other.alphamap)
+                )
+
+
+    @property
+    def ambient(self):
+        return self._ambient
+
+    @property
+    def diffuse(self):
+        return self._diffuse
+
+    @property
+    def specular(self):
+        return self._specular
+
+    @property
+    def emissive(self):
+        return self._emissive
+
+    @property
+    def comment_object(self):
+        return self._comment_object
+
+
+    def read(self, raw_io):
+        self.name = Ms3dIo.read_string(raw_io, Ms3dIo.LENGTH_NAME)
+        self._ambient = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 4)
+        self._diffuse = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 4)
+        self._specular = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 4)
+        self._emissive = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 4)
+        self.shininess = Ms3dIo.read_float(raw_io)
+        self.transparency = Ms3dIo.read_float(raw_io)
+        self.mode = Ms3dIo.read_byte(raw_io)
+        self.texture = Ms3dIo.read_string(raw_io, Ms3dIo.LENGTH_FILENAME)
+        self.alphamap = Ms3dIo.read_string(raw_io, Ms3dIo.LENGTH_FILENAME)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_string(raw_io, Ms3dIo.LENGTH_NAME, self.name)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 4, self.ambient)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 4, self.diffuse)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 4, self.specular)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 4, self.emissive)
+        Ms3dIo.write_float(raw_io, self.shininess)
+        Ms3dIo.write_float(raw_io, self.transparency)
+        Ms3dIo.write_byte(raw_io, self.mode)
+        Ms3dIo.write_string(raw_io, Ms3dIo.LENGTH_FILENAME, self.texture)
+        Ms3dIo.write_string(raw_io, Ms3dIo.LENGTH_FILENAME, self.alphamap)
+
+
+###############################################################################
+class Ms3dRotationKeyframe:
+    """ Ms3dRotationKeyframe """
+    __slots__ = (
+            'time',
+            '_rotation',
+            )
+
+    def __init__(
+            self,
+            default_time=0.0,
+            default_rotation=(0.0, 0.0, 0.0)
+            ):
+        self.time = default_time
+        self._rotation = default_rotation
+
+    def __repr__(self):
+        return "\n<time={:.{p}f}, rotation=({:.{p}f}, {:.{p}f}, {:.{p}f})>".format(
+                self.time,
+                self.rotation[0],
+                self.rotation[1],
+                self.rotation[2],
+                p=Ms3dIo.PRECISION
+                )
+
+
+    @property
+    def rotation(self):
+        return self._rotation
+
+
+    def read(self, raw_io):
+        self.time = Ms3dIo.read_float(raw_io)
+        self._rotation = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_float(raw_io, self.time)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.rotation)
+
+
+###############################################################################
+class Ms3dTranslationKeyframe:
+    """ Ms3dTranslationKeyframe """
+    __slots__ = (
+            'time',
+            '_position',
+            )
+
+    def __init__(
+            self,
+            default_time=0.0,
+            default_position=(0.0, 0.0, 0.0)
+            ):
+        self.time = default_time
+        self._position = default_position
+
+    def __repr__(self):
+        return "\n<time={:.{p}f}, position=({:.{p}f}, {:.{p}f}, {:.{p}f})>".format(
+                self.time,
+                self.position[0],
+                self.position[1],
+                self.position[2],
+                p=Ms3dIo.PRECISION
+                )
+
+
+    @property
+    def position(self):
+        return self._position
+
+
+    def read(self, raw_io):
+        self.time = Ms3dIo.read_float(raw_io)
+        self._position = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_float(raw_io, self.time)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.position)
+
+
+###############################################################################
+class Ms3dJoint:
+    """ Ms3dJoint """
+    """
+    __slots__ was taking out,
+    to be able to inject additional attributes during runtime
+    __slots__ = (
+            'flags',
+            'name',
+            'parent_name',
+            '_rotation',
+            '_position',
+            '_rotation_keyframes',
+            '_translation_keyframes',
+            '_joint_ex_object', # Ms3dJointEx
+            '_comment_object', # Ms3dComment
+            )
+    """
+
+    def __init__(
+            self,
+            default_flags=Ms3dSpec.DEFAULT_FLAGS,
+            default_name="",
+            default_parent_name="",
+            default_rotation=(0.0, 0.0, 0.0),
+            default_position=(0.0, 0.0, 0.0),
+            default_rotation_keyframes=None,
+            default_translation_keyframes=None,
+            default_joint_ex_object=None, # Ms3dJointEx
+            default_comment_object=None, # Ms3dComment
+            ):
+        if (default_name is None):
+            default_name = ""
+
+        if (default_parent_name is None):
+            default_parent_name = ""
+
+        if (default_rotation_keyframes is None):
+            default_rotation_keyframes = [] #Ms3dRotationKeyframe()
+
+        if (default_translation_keyframes is None):
+            default_translation_keyframes = [] #Ms3dTranslationKeyframe()
+
+        self.flags = default_flags
+        self.name = default_name
+        self.parent_name = default_parent_name
+        self._rotation = default_rotation
+        self._position = default_position
+        self._rotation_keyframes = default_rotation_keyframes
+        self._translation_keyframes = default_translation_keyframes
+
+        if default_comment_object is None:
+            default_comment_object = Ms3dCommentEx()
+        self._comment_object = default_comment_object # Ms3dComment
+
+        if default_joint_ex_object is None:
+            default_joint_ex_object = Ms3dJointEx()
+        self._joint_ex_object = default_joint_ex_object # Ms3dJointEx
+
+    def __repr__(self):
+        return "\n<flags={}, name='{}', parent_name='{}', rotation=({:.{p}f}, "\
+                "{:.{p}f}, {:.{p}f}), position=({:.{p}f}, {:.{p}f}, {:.{p}f}), "\
+                "number_rotation_keyframes={}, number_translation_keyframes={},"\
+                " rotation_key_frames={}, translation_key_frames={}>".format(
+                self.flags,
+                self.name,
+                self.parent_name,
+                self.rotation[0],
+                self.rotation[1],
+                self.rotation[2],
+                self.position[0],
+                self.position[1],
+                self.position[2],
+                self.number_rotation_keyframes,
+                self.number_translation_keyframes,
+                self.rotation_key_frames,
+                self.translation_key_frames,
+                p=Ms3dIo.PRECISION
+                )
+
+
+    @property
+    def rotation(self):
+        return self._rotation
+
+    @property
+    def position(self):
+        return self._position
+
+    @property
+    def number_rotation_keyframes(self):
+        if self.rotation_key_frames is None:
+            return 0
+        return len(self.rotation_key_frames)
+
+    @property
+    def number_translation_keyframes(self):
+        if self.translation_key_frames is None:
+            return 0
+        return len(self.translation_key_frames)
+
+    @property
+    def rotation_key_frames(self):
+        return self._rotation_keyframes
+
+    @property
+    def translation_key_frames(self):
+        return self._translation_keyframes
+
+
+    @property
+    def joint_ex_object(self):
+        return self._joint_ex_object
+
+
+    @property
+    def comment_object(self):
+        return self._comment_object
+
+
+    def read(self, raw_io):
+        self.flags = Ms3dIo.read_byte(raw_io)
+        self.name = Ms3dIo.read_string(raw_io, Ms3dIo.LENGTH_NAME)
+        self.parent_name = Ms3dIo.read_string(raw_io, Ms3dIo.LENGTH_NAME)
+        self._rotation = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        self._position = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        _number_rotation_keyframes = Ms3dIo.read_word(raw_io)
+        _number_translation_keyframes = Ms3dIo.read_word(raw_io)
+        self._rotation_keyframes = []
+        for i in range(_number_rotation_keyframes):
+            self.rotation_key_frames.append(Ms3dRotationKeyframe().read(raw_io))
+        self._translation_keyframes = []
+        for i in range(_number_translation_keyframes):
+            self.translation_key_frames.append(
+                    Ms3dTranslationKeyframe().read(raw_io))
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_byte(raw_io, self.flags)
+        Ms3dIo.write_string(raw_io, Ms3dIo.LENGTH_NAME, self.name)
+        Ms3dIo.write_string(raw_io, Ms3dIo.LENGTH_NAME, self.parent_name)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.rotation)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.position)
+        Ms3dIo.write_word(raw_io, self.number_rotation_keyframes)
+        Ms3dIo.write_word(raw_io, self.number_translation_keyframes)
+        for i in range(self.number_rotation_keyframes):
+            self.rotation_key_frames[i].write(raw_io)
+        for i in range(self.number_translation_keyframes):
+            self.translation_key_frames[i].write(raw_io)
+
+
+###############################################################################
+class Ms3dCommentEx:
+    """ Ms3dCommentEx """
+    __slots__ = (
+            'index',
+            'comment',
+            )
+
+    def __init__(
+            self,
+            default_index=0,
+            default_comment=""
+            ):
+        if (default_comment is None):
+            default_comment = ""
+
+        self.index = default_index
+        self.comment = default_comment
+
+    def __repr__(self):
+        return "\n<index={}, comment_length={}, comment='{}'>".format(
+                self.index,
+                self.comment_length,
+                self.comment
+                )
+
+
+    @property
+    def comment_length(self):
+        if self.comment is None:
+            return 0
+        return len(self.comment)
+
+
+    def read(self, raw_io):
+        self.index = Ms3dIo.read_dword(raw_io)
+        _comment_length = Ms3dIo.read_dword(raw_io)
+        self.comment = Ms3dIo.read_string(raw_io, _comment_length)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_dword(raw_io, self.index)
+        Ms3dIo.write_dword(raw_io, self.comment_length)
+        Ms3dIo.write_string(raw_io, self.comment_length, self.comment)
+
+
+###############################################################################
+class Ms3dComment:
+    """ Ms3dComment """
+    __slots__ = (
+            'comment',
+            )
+
+    def __init__(
+            self,
+            default_comment=""
+            ):
+        if (default_comment is None):
+            default_comment = ""
+
+        self.comment = default_comment
+
+    def __repr__(self):
+        return "\n<comment_length={}, comment='{}'>".format(
+                self.comment_length,
+                self.comment
+                )
+
+
+    @property
+    def comment_length(self):
+        if self.comment is None:
+            return 0
+        return len(self.comment)
+
+
+    def read(self, raw_io):
+        _comment_length = Ms3dIo.read_dword(raw_io)
+        self.comment = Ms3dIo.read_string(raw_io, _comment_length)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_dword(raw_io, self.comment_length)
+        Ms3dIo.write_string(raw_io, self.comment_length, self.comment)
+
+
+###############################################################################
+class Ms3dVertexEx1:
+    """ Ms3dVertexEx1 """
+    __slots__ = (
+            '_bone_ids',
+            '_weights',
+            )
+
+    def __init__(
+            self,
+            default_bone_ids=(
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID),
+            default_weights=(100, 0, 0)
+            ):
+        self._bone_ids = default_bone_ids
+        self._weights = default_weights
+
+    def __repr__(self):
+        return "\n<bone_ids={}, weights={}>".format(
+                self.bone_ids,
+                self.weights
+                )
+
+
+    @property
+    def bone_ids(self):
+        return self._bone_ids
+
+    @property
+    def weights(self):
+        return self._weights
+
+
+    @property
+    def weight_bone_id(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights
+        return 100
+
+    @property
+    def weight_bone_id0(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights[0]
+        return 0
+
+    @property
+    def weight_bone_id1(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights[1]
+        return 0
+
+    @property
+    def weight_bone_id2(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return 100 - (self._weights[0] + self._weights[1] \
+                    + self._weights[2])
+        return 0
+
+
+    def read(self, raw_io):
+        self._bone_ids = Ms3dIo.read_array(raw_io, Ms3dIo.read_sbyte, 3)
+        self._weights = Ms3dIo.read_array(raw_io, Ms3dIo.read_byte, 3)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_sbyte, 3, self.bone_ids)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_byte, 3, self.weights)
+
+
+###############################################################################
+class Ms3dVertexEx2:
+    """ Ms3dVertexEx2 """
+    __slots__ = (
+            'extra',
+            '_bone_ids',
+            '_weights',
+            )
+
+    def __init__(
+            self,
+            default_bone_ids=(
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID),
+            default_weights=(100, 0, 0),
+            default_extra=0
+            ):
+        self._bone_ids = default_bone_ids
+        self._weights = default_weights
+        self.extra = default_extra
+
+    def __repr__(self):
+        return "\n<bone_ids={}, weights={}, extra={}>".format(
+                self.bone_ids,
+                self.weights,
+                self.extra
+                )
+
+
+    @property
+    def bone_ids(self):
+        return self._bone_ids
+
+    @property
+    def weights(self):
+        return self._weights
+
+
+    @property
+    def weight_bone_id(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights
+        return 100
+
+    @property
+    def weight_bone_id0(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights[0]
+        return 0
+
+    @property
+    def weight_bone_id1(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights[1]
+        return 0
+
+    @property
+    def weight_bone_id2(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return 100 - (self._weights[0] + self._weights[1] \
+                    + self._weights[2])
+        return 0
+
+
+    def read(self, raw_io):
+        self._bone_ids = Ms3dIo.read_array(raw_io, Ms3dIo.read_sbyte, 3)
+        self._weights = Ms3dIo.read_array(raw_io, Ms3dIo.read_byte, 3)
+        self.extra = Ms3dIo.read_dword(raw_io)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_sbyte, 3, self.bone_ids)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_byte, 3, self.weights)
+        Ms3dIo.write_dword(raw_io, self.extra)
+
+
+###############################################################################
+class Ms3dVertexEx3:
+    """ Ms3dVertexEx3 """
+    #char bone_ids[3]; // index of joint or -1, if -1, then that weight is
+    #    ignored, since subVersion 1
+    #byte weights[3]; // vertex weight ranging from 0 - 100, last weight is
+    #    computed by 1.0 - sum(all weights), since subVersion 1
+    #// weight[0] is the weight for bone_id in Ms3dVertex
+    #// weight[1] is the weight for bone_ids[0]
+    #// weight[2] is the weight for bone_ids[1]
+    #// 1.0f - weight[0] - weight[1] - weight[2] is the weight for bone_ids[2]
+    #unsigned int extra; // vertex extra, which can be used as color or
+    #    anything else, since subVersion 2
+    __slots__ = (
+            'extra',
+            '_bone_ids',
+            '_weights',
+            )
+
+    def __init__(
+            self,
+            default_bone_ids=(
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
+                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID),
+            default_weights=(100, 0, 0),
+            default_extra=0
+            ):
+        self._bone_ids = default_bone_ids
+        self._weights = default_weights
+        self.extra = default_extra
+
+    def __repr__(self):
+        return "\n<bone_ids={}, weights={}, extra={}>".format(
+                self.bone_ids,
+                self.weights,
+                self.extra
+                )
+
+
+    @property
+    def bone_ids(self):
+        return self._bone_ids
+
+    @property
+    def weights(self):
+        return self._weights
+
+
+    @property
+    def weight_bone_id(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights
+        return 100
+
+    @property
+    def weight_bone_id0(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights[0]
+        return 0
+
+    @property
+    def weight_bone_id1(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return self._weights[1]
+        return 0
+
+    @property
+    def weight_bone_id2(self):
+        if self._weights[0] or self._weights[1] or self._weights[2]:
+            return 100 - (self._weights[0] + self._weights[1] \
+                    + self._weights[2])
+        return 0
+
+
+    def read(self, raw_io):
+        self._bone_ids = Ms3dIo.read_array(raw_io, Ms3dIo.read_sbyte, 3)
+        self._weights = Ms3dIo.read_array(raw_io, Ms3dIo.read_byte, 3)
+        self.extra = Ms3dIo.read_dword(raw_io)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_sbyte, 3, self.bone_ids)
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_byte, 3, self.weights)
+        Ms3dIo.write_dword(raw_io, self.extra)
+
+
+###############################################################################
+class Ms3dJointEx:
+    """ Ms3dJointEx """
+    __slots__ = (
+            '_color',
+            )
+
+    def __init__(
+            self,
+            default_color=Ms3dSpec.DEFAULT_JOINT_COLOR
+            ):
+        self._color = default_color
+
+    def __repr__(self):
+        return "\n<color=({:.{p}f}, {:.{p}f}, {:.{p}f})>".format(
+                self.color[0],
+                self.color[1],
+                self.color[2],
+                p=Ms3dIo.PRECISION
+                )
+
+
+    @property
+    def color(self):
+        return self._color
+
+
+    def read(self, raw_io):
+        self._color = Ms3dIo.read_array(raw_io, Ms3dIo.read_float, 3)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_array(raw_io, Ms3dIo.write_float, 3, self.color)
+
+
+###############################################################################
+class Ms3dModelEx:
+    """ Ms3dModelEx """
+    __slots__ = (
+            'joint_size',
+            'transparency_mode',
+            'alpha_ref',
+            )
+
+    def __init__(
+            self,
+            default_joint_size=Ms3dSpec.DEFAULT_MODEL_JOINT_SIZE,
+            default_transparency_mode\
+                    =Ms3dSpec.DEFAULT_MODEL_TRANSPARENCY_MODE,
+            default_alpha_ref=0.0
+            ):
+        self.joint_size = default_joint_size
+        self.transparency_mode = default_transparency_mode
+        self.alpha_ref = default_alpha_ref
+
+    def __repr__(self):
+        return "\n<joint_size={:.{p}f}, transparency_mode={}, alpha_ref={:.{p}f}>".format(
+                self.joint_size,
+                self.transparency_mode,
+                self.alpha_ref,
+                p=Ms3dIo.PRECISION
+                )
+
+    def read(self, raw_io):
+        self.joint_size = Ms3dIo.read_float(raw_io)
+        self.transparency_mode = Ms3dIo.read_dword(raw_io)
+        self.alpha_ref = Ms3dIo.read_float(raw_io)
+        return self
+
+    def write(self, raw_io):
+        Ms3dIo.write_float(raw_io, self.joint_size)
+        Ms3dIo.write_dword(raw_io, self.transparency_mode)
+        Ms3dIo.write_float(raw_io, self.alpha_ref)
+
+
+###############################################################################
+#
+# file format
+#
+###############################################################################
+class Ms3dModel:
+    """ Ms3dModel """
+    __slot__ = (
+            'header',
+            'animation_fps',
+            'current_time',
+            'number_total_frames',
+            'sub_version_comments',
+            'sub_version_vertex_extra',
+            'sub_version_joint_extra',
+            'sub_version_model_extra',
+            'name',
+            '_vertices',
+            '_triangles',
+            '_groups',
+            '_materials',
+            '_joints',
+            '_has_model_comment',
+            '_comment_object', # Ms3dComment
+            '_model_ex_object', # Ms3dModelEx
+            )
+
+    def __init__(
+            self,
+            default_name=""
+            ):
+        if (default_name is None):
+            default_name = ""
+
+        self.name = default_name
+
+        self.animation_fps = Ms3dSpec.DEFAULT_MODEL_ANIMATION_FPS
+        self.current_time = 0.0
+        self.number_total_frames = 0
+        self.sub_version_comments \
+                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_COMMENTS
+        self.sub_version_vertex_extra \
+                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_VERTEX_EXTRA
+        self.sub_version_joint_extra \
+                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_JOINT_EXTRA
+        self.sub_version_model_extra \
+                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_MODEL_EXTRA
+
+        self._vertices = [] #Ms3dVertex()
+        self._triangles = [] #Ms3dTriangle()
+        self._groups = [] #Ms3dGroup()
+        self._materials = [] #Ms3dMaterial()
+        self._joints = [] #Ms3dJoint()
+
+        self.header = Ms3dHeader()
+        self._model_ex_object = Ms3dModelEx()
+        self._comment_object = None #Ms3dComment()
+
+
+    @property
+    def number_vertices(self):
+        if self.vertices is None:
+            return 0
+        return len(self.vertices)
+
+    @property
+    def vertices(self):
+        return self._vertices
+
+
+    @property
+    def number_triangles(self):
+        if self.triangles is None:
+            return 0
+        return len(self.triangles)
+
+    @property
+    def triangles(self):
+        return self._triangles
+
+
+    @property
+    def number_groups(self):
+        if self.groups is None:
+            return 0
+        return len(self.groups)
+
+    @property
+    def groups(self):
+        return self._groups
+
+
+    @property
+    def number_materials(self):
+        if self.materials is None:
+            return 0
+        return len(self.materials)
+
+    @property
+    def materials(self):
+        return self._materials
+
+
+    @property
+    def number_joints(self):
+        if self.joints is None:
+            return 0
+        return len(self.joints)
+
+    @property
+    def joints(self):
+        return self._joints
+
+
+    @property
+    def number_group_comments(self):
+        if self.groups is None:
+            return 0
+        number = 0
+        for item in self.groups:
+            if item.comment_object is not None and item.comment_object.comment:
+                number += 1
+        return number
+
+    @property
+    def group_comments(self):
+        if self.groups is None:
+            return None
+        items = []
+        for item in self.groups:
+            if item.comment_object is not None and item.comment_object.comment:
+                items.append(item)
+        return items
+
+
+    @property
+    def number_material_comments(self):
+        if self.materials is None:
+            return 0
+        number = 0
+        for item in self.materials:
+            if item.comment_object is not None and item.comment_object.comment:
+                number += 1
+        return number
+
+    @property
+    def material_comments(self):
+        if self.materials is None:
+            return None
+        items = []
+        for item in self.materials:
+            if item.comment_object is not None and item.comment_object.comment:
+                items.append(item)
+        return items
+
+
+    @property
+    def number_joint_comments(self):
+        if self.joints is None:
+            return 0
+        number = 0
+        for item in self.joints:
+            if item.comment_object is not None and item.comment_object.comment:
+                number += 1
+        return number
+
+    @property
+    def joint_comments(self):
+        if self.joints is None:
+            return None
+        items = []
+        for item in self.joints:
+            if item.comment_object is not None and item.comment_object.comment:
+                items.append(item)
+        return items
+
+
+    @property
+    def has_model_comment(self):
+        if self.comment_object is not None and self.comment_object.comment:
+            return 1
+        return 0
+
+    @property
+    def comment_object(self):
+        return self._comment_object
+
+
+    @property
+    def vertex_ex(self):
+        if not self.sub_version_vertex_extra:
+            return None
+        return [item.vertex_ex_object for item in self.vertices]
+
+    @property
+    def joint_ex(self):
+        if not self.sub_version_joint_extra:
+            return None
+        return [item.joint_ex_object for item in self.joints]
+
+    @property
+    def model_ex_object(self):
+        if not self.sub_version_model_extra:
+            return None
+        return self._model_ex_object
+
+
+    def print_internal(self):
+        print()
+        print("##############################################################")
+        print("## the internal data of Ms3dModel object...")
+        print("##")
+
+        print("header={}".format(self.header))
+
+        print("number_vertices={}".format(self.number_vertices))
+        print("vertices=[", end="")
+        if self.vertices:
+            for obj in self.vertices:
+                print("{}".format(obj), end="")
+        print("]")
+
+        print("number_triangles={}".format(self.number_triangles))
+        print("triangles=[", end="")
+        if self.triangles:
+            for obj in self.triangles:
+                print("{}".format(obj), end="")
+        print("]")
+
+        print("number_groups={}".format(self.number_groups))
+        print("groups=[", end="")
+        if self.groups:
+            for obj in self.groups:
+                print("{}".format(obj), end="")
+        print("]")
+
+        print("number_materials={}".format(self.number_materials))
+        print("materials=[", end="")
+        if self.materials:
+            for obj in self.materials:
+                print("{}".format(obj), end="")
+        print("]")
+
+        print("animation_fps={}".format(self.animation_fps))
+        print("current_time={}".format(self.current_time))
+        print("number_total_frames={}".format(self.number_total_frames))
+
+        print("number_joints={}".format(self.number_joints))
+        print("joints=[", end="")
+        if self.joints:
+            for obj in self.joints:
+                print("{}".format(obj), end="")
+        print("]")
+
+        print("sub_version_comments={}".format(self.sub_version_comments))
+
+        print("number_group_comments={}".format(self.number_group_comments))
+        print("group_comments=[", end="")
+        if self.group_comments:
+            for obj in self.group_comments:
+                print("{}".format(obj.comment_object), end="")
+        print("]")
+
+        print("number_material_comments={}".format(
+                self.number_material_comments))
+        print("material_comments=[", end="")
+        if self.material_comments:
+            for obj in self.material_comments:
+                print("{}".format(obj.comment_object), end="")
+        print("]")
+
+        print("number_joint_comments={}".format(self.number_joint_comments))
+        print("joint_comments=[", end="")
+        if self.joint_comments:
+            for obj in self.joint_comments:
+                print("{}".format(obj.comment_object), end="")
+        print("]")
+
+        print("has_model_comment={}".format(self.has_model_comment))
+        print("model_comment={}".format(self.comment_object))
+
+        print("sub_version_vertex_extra={}".format(
+                self.sub_version_vertex_extra))
+        print("vertex_ex=[", end="")
+        if self.vertex_ex:
+            for obj in self.vertex_ex:
+                print("{}".format(obj), end="")
+        print("]")
+
+        print("sub_version_joint_extra={}".format(
+                self.sub_version_joint_extra))
+        print("joint_ex=[", end="")
+        if self.joint_ex:
+            for obj in self.joint_ex:
+                print("{}".format(obj), end="")
+        print("]")
+
+        print("sub_version_model_extra={}".format(
+                self.sub_version_model_extra))
+        print("model_ex={}".format(self.model_ex_object))
+
+        print("##")
+        print("## ...end")
+        print("##############################################################")
+        print()
+
+
+    def read(self, raw_io):
+        """
+        opens, reads and pars MS3D file.
+        add content to blender scene
+        """
+
+        self.header.read(raw_io)
+        if (self.header != Ms3dHeader()):
+            print("\nwarning, invalid file header")
+
+        _number_vertices = Ms3dIo.read_word(raw_io)
+        if (_number_vertices > Ms3dSpec.MAX_VERTICES):
+            print("\nwarning, invalid count: number_vertices: {}".format(
+                    _number_vertices))
+        self._vertices = []
+        for i in range(_number_vertices):
+            self.vertices.append(Ms3dVertex().read(raw_io))
+
+        _number_triangles = Ms3dIo.read_word(raw_io)
+        if (_number_triangles > Ms3dSpec.MAX_TRIANGLES):
+            print("\nwarning, invalid count: number_triangles: {}".format(
+                    _number_triangles))
+        self._triangles = []
+        for i in range(_number_triangles):
+            self.triangles.append(Ms3dTriangle().read(raw_io))
+
+        _number_groups = Ms3dIo.read_word(raw_io)
+        if (_number_groups > Ms3dSpec.MAX_GROUPS):
+            print("\nwarning, invalid count: number_groups: {}".format(
+                    _number_groups))
+        self._groups = []
+        for i in range(_number_groups):
+            self.groups.append(Ms3dGroup().read(raw_io))
+
+        _number_materials = Ms3dIo.read_word(raw_io)
+        if (_number_materials > Ms3dSpec.MAX_MATERIALS):
+            print("\nwarning, invalid count: number_materials: {}".format(
+                    _number_materials))
+        self._materials = []
+        for i in range(_number_materials):
+            self.materials.append(Ms3dMaterial().read(raw_io))
+
+        self.animation_fps = Ms3dIo.read_float(raw_io)
+        self.current_time = Ms3dIo.read_float(raw_io)
+        self.number_total_frames = Ms3dIo.read_dword(raw_io)
+
+        _progress = set()
+
+        try:
+            # optional data
+            # doesn't matter if doesn't existing.
+
+            _number_joints = Ms3dIo.read_word(raw_io)
+            _progress.add('NUMBER_JOINTS')
+            if (_number_joints > Ms3dSpec.MAX_JOINTS):
+                print("\nwarning, invalid count: number_joints: {}".format(
+                        _number_joints))
+            self._joints = []
+            for i in range(_number_joints):
+                self.joints.append(Ms3dJoint().read(raw_io))
+            _progress.add('JOINTS')
+
+            self.sub_version_comments = Ms3dIo.read_dword(raw_io)
+            _progress.add('SUB_VERSION_COMMENTS')
+            _number_group_comments = Ms3dIo.read_dword(raw_io)
+            _progress.add('NUMBER_GROUP_COMMENTS')
+            if (_number_group_comments > Ms3dSpec.MAX_GROUPS):
+                print("\nwarning, invalid count:"\
+                        " number_group_comments: {}".format(
+                        _number_group_comments))
+            if _number_group_comments > _number_groups:
+                print("\nwarning, invalid count:"\
+                        " number_group_comments: {}, number_groups: {}".format(
+                        _number_group_comments, _number_groups))
+            for i in range(_number_group_comments):
+                item = Ms3dCommentEx().read(raw_io)
+                if item.index >= 0 and item.index < _number_groups:
+                    self.groups[item.index]._comment_object = item
+                else:
+                    print("\nwarning, invalid index:"\
+                            " group_index: {}, number_groups: {}".format(
+                            item.index, _number_groups))
+            _progress.add('GROUP_COMMENTS')
+
+            _number_material_comments = Ms3dIo.read_dword(raw_io)
+            _progress.add('NUMBER_MATERIAL_COMMENTS')
+            if (_number_material_comments > Ms3dSpec.MAX_MATERIALS):
+                print("\nwarning, invalid count:"\
+                        " number_material_comments: {}".format(
+                        _number_material_comments))
+            if _number_material_comments > _number_materials:
+                print("\nwarning, invalid count:"\
+                        " number_material_comments:"\
+                        " {}, number_materials: {}".format(
+                        _number_material_comments, _number_materials))
+            for i in range(_number_material_comments):
+                item = Ms3dCommentEx().read(raw_io)
+                if item.index >= 0 and item.index < _number_materials:
+                    self.materials[item.index]._comment_object = item
+                else:
+                    print("\nwarning, invalid index:"\
+                            " material_index: {}, number_materials:"\
+                            " {}".format(item.index, _number_materials))
+            _progress.add('MATERIAL_COMMENTS')
+
+            _number_joint_comments = Ms3dIo.read_dword(raw_io)
+            _progress.add('NUMBER_JOINT_COMMENTS')
+            if (_number_joint_comments > Ms3dSpec.MAX_JOINTS):
+                print("\nwarning, invalid count:"\
+                        " number_joint_comments: {}".format(
+                        _number_joint_comments))
+            if _number_joint_comments > _number_joints:
+                print("\nwarning, invalid count:"\
+                        " number_joint_comments: {}, number_joints: {}".format(
+                        _number_joint_comments, _number_joints))
+            for i in range(_number_joint_comments):
+                item = Ms3dCommentEx().read(raw_io)
+                if item.index >= 0 and item.index < _number_joints:
+                    self.joints[item.index]._comment_object = item
+                else:
+                    print("\nwarning, invalid index:"\
+                            " joint_index: {}, number_joints: {}".format(
+                            item.index, _number_joints))
+            _progress.add('JOINT_COMMENTS')
+
+            _has_model_comment = Ms3dIo.read_dword(raw_io)
+            _progress.add('HAS_MODEL_COMMENTS')
+            if (_has_model_comment != 0):
+                self._comment_object = Ms3dComment().read(raw_io)
+            else:
+                self._comment_object = None
+            _progress.add('MODEL_COMMENTS')
+
+            self.sub_version_vertex_extra = Ms3dIo.read_dword(raw_io)
+            _progress.add('SUB_VERSION_VERTEX_EXTRA')
+            if self.sub_version_vertex_extra > 0:
+                length = len(self.joints)
+                for i in range(_number_vertices):
+                    if self.sub_version_vertex_extra == 1:
+                        item = Ms3dVertexEx1()
+                    elif self.sub_version_vertex_extra == 2:
+                        item = Ms3dVertexEx2()
+                    elif self.sub_version_vertex_extra == 3:
+                        item = Ms3dVertexEx3()
+                    else:
+                        print("\nwarning, invalid version:"\
+                                " sub_version_vertex_extra: {}".format(
+                                sub_version_vertex_extra))
+                        continue
+                    self.vertices[i]._vertex_ex_object = item.read(raw_io)
+            _progress.add('VERTEX_EXTRA')
+
+            self.sub_version_joint_extra = Ms3dIo.read_dword(raw_io)
+            _progress.add('SUB_VERSION_JOINT_EXTRA')
+            if self.sub_version_joint_extra > 0:
+                for i in range(_number_joints):
+                    self.joints[i]._joint_ex_object = Ms3dJointEx().read(raw_io)
+            _progress.add('JOINT_EXTRA')
+
+            self.sub_version_model_extra = Ms3dIo.read_dword(raw_io)
+            _progress.add('SUB_VERSION_MODEL_EXTRA')
+            if self.sub_version_model_extra > 0:
+                self._model_ex_object.read(raw_io)
+            _progress.add('MODEL_EXTRA')
+
+        except EOFError:
+            # reached end of optional data.
+            print("Ms3dModel.read - optional data read: {}".format(_progress))
+            pass
+
+        except Exception:
+            type, value, traceback = exc_info()
+            print("Ms3dModel.read - exception in optional try block,"
+                    " _progress={0}\n  type: '{1}'\n  value: '{2}'".format(
+                    _progress, type, value, traceback))
+
+        else:
+            pass
+
+        # try best to continue far as possible
+        if not 'JOINTS' in _progress:
+            _number_joints = 0
+            self._joints = []
+
+        if not 'GROUP_COMMENTS' in _progress:
+            self.sub_version_comments = 0
+            _number_group_comments = 0
+
+        if not 'MATERIAL_COMMENTS' in _progress:
+            _number_material_comments = 0
+
+        if not 'JOINT_COMMENTS' in _progress:
+            _number_joint_comments = 0
+
+        if not 'MODEL_COMMENTS' in _progress:
+            _has_model_comment = 0
+            self._comment_object = None # Ms3dComment()
+
+        if not 'VERTEX_EXTRA' in _progress:
+            self.sub_version_vertex_extra = 0
+
+        if not 'JOINT_EXTRA' in _progress:
+            self.sub_version_joint_extra = 0
+
+        if not 'MODEL_EXTRA' in _progress:
+            self.sub_version_model_extra = 0
+            self._model_ex_object = Ms3dModelEx()
+
+        return
+
+
+    def write(self, raw_io):
+        """
+        add blender scene content to MS3D
+        creates, writes MS3D file.
+        """
+
+        self.header.write(raw_io)
+
+        Ms3dIo.write_word(raw_io, self.number_vertices)
+        for i in range(self.number_vertices):
+            self.vertices[i].write(raw_io)
+
+        Ms3dIo.write_word(raw_io, self.number_triangles)
+        for i in range(self.number_triangles):
+            self.triangles[i].write(raw_io)
+
+        Ms3dIo.write_word(raw_io, self.number_groups)
+        for i in range(self.number_groups):
+            self.groups[i].write(raw_io)
+
+        Ms3dIo.write_word(raw_io, self.number_materials)
+        for i in range(self.number_materials):
+            self.materials[i].write(raw_io)
+
+        Ms3dIo.write_float(raw_io, self.animation_fps)
+        Ms3dIo.write_float(raw_io, self.current_time)
+        Ms3dIo.write_dword(raw_io, self.number_total_frames)
+
+        try:
+            # optional part
+            # doesn't matter if it doesn't complete.
+            Ms3dIo.write_word(raw_io, self.number_joints)
+            for i in range(self.number_joints):
+                self.joints[i].write(raw_io)
+
+            Ms3dIo.write_dword(raw_io, self.sub_version_comments)
+
+            Ms3dIo.write_dword(raw_io, self.number_group_comments)
+            for i in range(self.number_group_comments):
+                self.group_comments[i].comment_object.write(raw_io)
+
+            Ms3dIo.write_dword(raw_io, self.number_material_comments)
+            for i in range(self.number_material_comments):
+                self.material_comments[i].comment_object.write(raw_io)
+
+            Ms3dIo.write_dword(raw_io, self.number_joint_comments)
+            for i in range(self.number_joint_comments):
+                self.joint_comments[i].comment_object.write(raw_io)
+
+            Ms3dIo.write_dword(raw_io, self.has_model_comment)
+            if (self.has_model_comment != 0):
+                self.comment_object.write(raw_io)
+
+            Ms3dIo.write_dword(raw_io, self.sub_version_vertex_extra)
+            if (self.sub_version_vertex_extra in {1, 2, 3}):
+                for i in range(self.number_vertices):
+                    self.vertex_ex[i].write(raw_io)
+
+            Ms3dIo.write_dword(raw_io, self.sub_version_joint_extra)
+            for i in range(self.number_joints):
+                self.joint_ex[i].write(raw_io)
+
+            Ms3dIo.write_dword(raw_io, self.sub_version_model_extra)
+            self.model_ex_object.write(raw_io)
+
+        except Exception:
+            type, value, traceback = exc_info()
+            print("Ms3dModel.write - exception in optional try block"
+                    "\n  type: '{0}'\n  value: '{1}'".format(
+                    type, value, traceback))
+            pass
+
+        else:
+            pass
+
+        return
+
+
+    def is_valid(self):
+        valid = True
+        result = []
+
+        format1 = "\n  number of {0}: {1}"
+        format2 = " limit exceeded! (limit is {0})"
+
+        result.append("MS3D statistics:")
+        result.append(format1.format("vertices ........",
+                self.number_vertices))
+        if (self.number_vertices > Ms3dSpec.MAX_VERTICES):
+            result.append(format2.format(Ms3dSpec.MAX_VERTICES))
+            valid &= False
+
+        result.append(format1.format("triangles .......",
+                self.number_triangles))
+        if (self.number_triangles > Ms3dSpec.MAX_TRIANGLES):
+            result.append(format2.format(Ms3dSpec.MAX_TRIANGLES))
+            valid &= False
+
+        result.append(format1.format("groups ..........",
+                self.number_groups))
+        if (self.number_groups > Ms3dSpec.MAX_GROUPS):
+            result.append(format2.format(Ms3dSpec.MAX_GROUPS))
+            valid &= False
+
+        result.append(format1.format("materials .......",
+                self.number_materials))
+        if (self.number_materials > Ms3dSpec.MAX_MATERIALS):
+            result.append(format2.format(Ms3dSpec.MAX_MATERIALS))
+            valid &= False
+
+        result.append(format1.format("joints ..........",
+                self.number_joints))
+        if (self.number_joints > Ms3dSpec.MAX_JOINTS):
+            result.append(format2.format(Ms3dSpec.MAX_JOINTS))
+            valid &= False
+
+        result.append(format1.format("model comments ..",
+                self.has_model_comment))
+        result.append(format1.format("group comments ..",
+                self.number_group_comments))
+        result.append(format1.format("material comments",
+                self.number_material_comments))
+        result.append(format1.format("joint comments ..",
+                self.number_joint_comments))
+
+        #if (not valid):
+        #    result.append("\n\nthe data may be corrupted.")
+
+        return (valid, ("".join(result)))
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# ##### END OF FILE #####
diff --git a/release/scripts/addons/io_scene_ms3d/ms3d_strings.py b/release/scripts/addons/io_scene_ms3d/ms3d_strings.py
new file mode 100644
index 0000000..9865876
--- /dev/null
+++ b/release/scripts/addons/io_scene_ms3d/ms3d_strings.py
@@ -0,0 +1,264 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011-2013 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+SEE_MS3D_DOC = "see MilkShape 3D documentation"
+
+ms3d_str = {
+        'lang': "en-US",
+        'RUNTIME_KEY': "Human friendly presentation",
+
+        ###############################
+        # blender key names
+        'OBJECT_LAYER_EXTRA': "ms3d_extra_layer",
+        'OBJECT_LAYER_GROUP': "ms3d_group_layer",
+        'OBJECT_LAYER_SMOOTHING_GROUP': "ms3d_smoothing_group_layer",
+        'OBJECT_MODIFIER_SMOOTHING_GROUP': "ms3d_smoothing_groups",
+        # for some reason after bm.to_mesh(..)
+        # the names of 'bm.loops.layers.uv' becomes to 'bm.faces.layers.tex'
+        # to bypass this issue, i give both the same name.
+        # 'OBJECT_LAYER_TEXTURE': "ms3d_texture_layer",
+        'OBJECT_LAYER_TEXTURE': "ms3d_uv_layer",
+        'OBJECT_LAYER_UV': "ms3d_uv_layer",
+
+        ###############################
+        # strings to be used with 'str().format()'
+        'STRING_FORMAT_GROUP': "Group.{:03d}",
+        'WARNING_IMPORT_SKIP_FACE_DOUBLE': "skipped face #{}:"\
+                " contains double faces with same vertices!",
+        'WARNING_IMPORT_SKIP_LESS_VERTICES': "skipped face #{}:"\
+                " contains faces too less vertices!",
+        'WARNING_IMPORT_SKIP_VERTEX_DOUBLE': "skipped face #{}:"\
+                " contains faces with double vertices!",
+        'WARNING_IMPORT_EXTRA_VERTEX_NORMAL': "created extra vertex"\
+                " because of different normals #{} -> {}.",
+        'SUMMARY_IMPORT': "elapsed time: {0:.4}s (media io:"\
+                " ~{1:.4}s, converter: ~{2:.4}s)",
+        'SUMMARY_EXPORT': "elapsed time: {0:.4}s (converter:"\
+                " ~{1:.4}s, media io: ~{2:.4}s)",
+        'WARNING_EXPORT_SKIP_WEIGHT' : "skipped weight (ms3d can handle 3 weighs max.,"\
+                " the less weighty weight was skipped)",
+        'WARNING_EXPORT_SKIP_WEIGHT_EX' : "skipped weight:"\
+                " limit exceeded (ms3d can handle 3 weighs max., the less weighty"\
+                " weights were skipped)",
+
+        ###############################
+        'TEXT_OPERATOR': "MilkShape 3D (.ms3d)",
+        'FILE_EXT': ".ms3d",
+        'FILE_FILTER': "*.ms3d",
+        'BL_DESCRIPTION_EXPORTER': "Export to a MilkShape 3D file format (.ms3d)",
+        'BL_DESCRIPTION_IMPORTER': "Import from a MilkShape 3D file format (.ms3d)",
+        'BL_LABEL_EXPORTER': "Export MS3D",
+        'BL_LABEL_GROUP_OPERATOR': "MS3D - Group Collection Operator",
+        'BL_LABEL_IMPORTER': "Import MS3D",
+        'BL_LABEL_PANEL_SMOOTHING_GROUP': "MS3D - Smoothing Group",
+        'BL_LABEL_SMOOTHING_GROUP_OPERATOR': "MS3D Set Smoothing Group"\
+                " Operator",
+        'BL_LABEL_MATERIAL_OPERATOR' : "MS3D - Copy Material Operator",
+        'ENUM_ADD_GROUP_1': "Add",
+        'ENUM_ADD_GROUP_2': "adds an item",
+        'ENUM_ASSIGN_1': "Assign",
+        'ENUM_ASSIGN_2_GROUP': "assign selected faces to selected group",
+        'ENUM_ASSIGN_2_SMOOTHING_GROUP': "assign all selected faces to"\
+                " selected smoothing group",
+        'ENUM_DESELECT_1': "Deselect",
+        'ENUM_DESELECT_2_GROUP': "deselects faces of selected group",
+        'ENUM_DESELECT_2_SMOOTHING_GROUP': "deselects all faces of selected"\
+                " smoothing group",
+        'ENUM_FLAG_DIRTY_1': "Dirty",
+        'ENUM_FLAG_DIRTY_2': SEE_MS3D_DOC,
+        'ENUM_FLAG_HIDDEN_1': "Hidden",
+        'ENUM_FLAG_HIDDEN_2': SEE_MS3D_DOC,
+        'ENUM_FLAG_ISKEY_1': "Is Key",
+        'ENUM_FLAG_ISKEY_2': SEE_MS3D_DOC,
+        'ENUM_FLAG_MARKED_1': "Marked",
+        'ENUM_FLAG_MARKED_2': SEE_MS3D_DOC,
+        'ENUM_FLAG_NEWLYCREATED_1': "Newly Created",
+        'ENUM_FLAG_NEWLYCREATED_2': SEE_MS3D_DOC,
+        'ENUM_FLAG_NONE_1': "None",
+        'ENUM_FLAG_NONE_2': SEE_MS3D_DOC,
+        'ENUM_FLAG_SELECTED_1': "Selected",
+        'ENUM_FLAG_SELECTED_2': SEE_MS3D_DOC,
+        'ENUM_FLAG_SELECTED2_1': "Selected Ex.",
+        'ENUM_FLAG_SELECTED2_2': SEE_MS3D_DOC,
+        'ENUM_REMOVE_1': "Remove",
+        'ENUM_REMOVE_2_GROUP': "remove selected faces from selected group",
+        'ENUM_REMOVE_GROUP_1': "Remove",
+        'ENUM_REMOVE_GROUP_2': "removes an item",
+        'ENUM_SELECT_1': "Select",
+        'ENUM_SELECT_2_GROUP': "selects faces of selected group",
+        'ENUM_SELECT_2_SMOOTHING_GROUP': "selects all faces of selected"\
+                " smoothing group",
+        'LABEL_NAME_ANIMATION': "Animation Processing:",
+        'LABEL_NAME_OBJECT': "World Processing:",
+        'LABEL_NAME_OPTIONS': "Advanced Options:",
+        'LABEL_NAME_PROCESSING': "Object Processing:",
+        'LABEL_NAME_MODIFIER': "Modifier Processing:",
+        'LABEL_PANEL_BUTTON_NONE': "None",
+        'LABEL_PANEL_GROUPS': "MS3D - Groups",
+        'LABEL_PANEL_JOINTS': "MS3D - Joint",
+        'LABEL_PANEL_MATERIALS': "MS3D - Material",
+        'LABEL_PANEL_MODEL': "MS3D - Model",
+        'PROP_DESC_ALPHA_REF': "ms3d internal raw 'alpha_ref' of Model",
+        'PROP_DESC_ALPHAMAP': "ms3d internal raw 'alphamap' file name of"\
+                " Material",
+        'PROP_DESC_AMBIENT': "ms3d internal raw 'ambient' of Material",
+        'PROP_DESC_USE_ANIMATION': "keyframes (rotations, positions)",
+        'PROP_DESC_COLOR_JOINT': "ms3d internal raw 'color' of Joint",
+        'PROP_DESC_COMMENT_GROUP': "ms3d internal raw 'comment' of Group",
+        'PROP_DESC_COMMENT_JOINT': "ms3d internal raw 'comment' of Joint",
+        'PROP_DESC_COMMENT_MATERIAL': "ms3d internal raw 'comment' of Material",
+        'PROP_DESC_COMMENT_MODEL': "ms3d internal raw 'comment' of Model",
+        'PROP_DESC_DIFFUSE': "ms3d internal raw 'diffuse' of Material",
+        'PROP_DESC_EMISSIVE': "ms3d internal raw 'emissive' of Material",
+        'PROP_DESC_FLAGS_GROUP': "ms3d internal raw 'flags' of Group",
+        'PROP_DESC_FLAGS_JOINT': "ms3d internal raw 'flags' of Joint",
+        'PROP_DESC_GROUP_NAME': "ms3d internal raw 'name' of Group",
+        'PROP_DESC_JOINT_SIZE': "ms3d internal raw 'joint_size' of Model",
+        'PROP_DESC_MODE_TEXTURE': "ms3d internal raw 'mode' of Material",
+        'PROP_DESC_NAME_ARMATURE': "ms3d internal raw 'name' of Model (not used"\
+                " for export)",
+        'PROP_DESC_NAME_JOINT': "ms3d internal raw 'name' of Joint",
+        'PROP_DESC_NAME_MATERIAL': "ms3d internal raw 'name' of Material",
+        'PROP_DESC_NAME_MODEL': "ms3d internal raw 'name' of Model (not used for export)",
+        'PROP_DESC_SHININESS': "ms3d internal raw 'shininess' of Material",
+        'PROP_DESC_SPECULAR': "ms3d internal raw 'specular' of Material",
+        'PROP_DESC_TEXTURE': "ms3d internal raw 'texture' file name of"\
+                " Material",
+        'PROP_DESC_TRANSPARENCY': "ms3d internal raw 'transparency' of"\
+                " Material",
+        'PROP_DESC_TRANSPARENCY_MODE': "ms3d internal raw 'transparency_mode'"\
+                " of Model",
+        'PROP_DESC_VERBOSE': "Run the converter in debug mode."\
+                " Check the console for output (Warning, may be very slow)",
+        'PROP_FLAG_TEXTURE_COMBINE_ALPHA_1': "Combine Alpha",
+        'PROP_FLAG_TEXTURE_COMBINE_ALPHA_2': SEE_MS3D_DOC,
+        'PROP_FLAG_TEXTURE_HAS_ALPHA_1': "Has Alpha",
+        'PROP_FLAG_TEXTURE_HAS_ALPHA_2': SEE_MS3D_DOC,
+        'PROP_FLAG_TEXTURE_SPHERE_MAP_1': "Sphere Map",
+        'PROP_FLAG_TEXTURE_SPHERE_MAP_2': SEE_MS3D_DOC,
+        'PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_1': "Depth"\
+                " Buffered with Alpha Ref",
+        'PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_2': SEE_MS3D_DOC,
+        'PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_1': "Depth Sorted"\
+                " Triangles",
+        'PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_2': SEE_MS3D_DOC,
+        'PROP_MODE_TRANSPARENCY_SIMPLE_1': "Simple",
+        'PROP_MODE_TRANSPARENCY_SIMPLE_2': SEE_MS3D_DOC,
+        'PROP_NAME_ALPHA_REF': "Alpha Ref.",
+        'PROP_NAME_ALPHAMAP': "Alphamap",
+        'PROP_NAME_AMBIENT': "Ambient",
+        'PROP_NAME_USE_ANIMATION': "Animation",
+        'PROP_NAME_COLOR': "Color",
+        'PROP_NAME_COMMENT': "Comment",
+        'PROP_NAME_DIFFUSE': "Diffuse",
+        'PROP_NAME_EMISSIVE': "Emissive",
+        'PROP_NAME_FLAGS': "Flags",
+        'PROP_NAME_JOINT_SIZE': "Joint Size",
+        'PROP_NAME_MODE': "Mode",
+        'PROP_NAME_NAME': "Name",
+        'PROP_NAME_ACTIVE': "Active Mesh:",
+        'PROP_NAME_SHININESS': "Shininess",
+        'PROP_NAME_SPECULAR': "Specular",
+        'PROP_NAME_TEXTURE': "Texture",
+        'PROP_NAME_TRANSPARENCY': "Transparency",
+        'PROP_NAME_TRANSPARENCY_MODE': "Transp. Mode",
+        'PROP_NAME_VERBOSE': "Verbose",
+        'PROP_SMOOTHING_GROUP_INDEX': "Smoothing group id",
+        'PROP_NAME_ROTATION_MODE' : "Bone Rotation Mode",
+        'PROP_DESC_ROTATION_MODE' : "set the preferred rotation mode of bones",
+        'PROP_ITEM_ROTATION_MODE_EULER_1' : "Euler",
+        'PROP_ITEM_ROTATION_MODE_EULER_2' : "use euler bone rotation"\
+                " (gimbal-lock can be fixed by using "\
+                "'Graph Editor -> Key -> Discontinuity (Euler) Filter')",
+        'PROP_ITEM_ROTATION_MODE_QUATERNION_1' : "Quaternion",
+        'PROP_ITEM_ROTATION_MODE_QUATERNION_2' : "use quaternion bone rotation"\
+                " (no gimbal-lock filter available!)",
+        'PROP_NAME_USE_JOINT_SIZE': "Override Joint Size",
+        'PROP_DESC_USE_JOINT_SIZE': "use value of 'Joint Size', the value of the"\
+                " ms3d file is ignored for representation.",
+        'PROP_NAME_IMPORT_JOINT_SIZE': "Joint Size",
+        'PROP_DESC_IMPORT_JOINT_SIZE': "size of the joint representation in"\
+                " blender",
+        'BL_LABEL_SET_SCENE_TO_METRIC' : "Set Scene to 'Metric' [1 mm]",
+        'BL_DESC_SET_SCENE_TO_METRIC' : "set Scene | Units to Metric"\
+                " (1 Unit = 1 mm),"\
+                " Display | Textured Solid,"\
+                " View | Clip (0.001 mm ... 1 km)",
+        'PROP_NAME_NORMALIZE_WEIGHTS' : "Normalize Weights",
+        'PROP_DESC_NORMALIZE_WEIGHTS' : "normalize all weights to 100%,",
+        'PROP_NAME_SHRINK_TO_KEYS' : "Shrink To Keys",
+        'PROP_DESC_SHRINK_TO_KEYS' : "shrinks the animation to region from"\
+                " first keyframe to last keyframe",
+        'PROP_NAME_BAKE_EACH_FRAME' : "Bake Each Frame As Key",
+        'PROP_DESC_BAKE_EACH_FRAME' : "if enabled, to each frame there will be"\
+                " a key baked",
+        'LABEL_NAME_JOINT_TO_BONES' : "use only for bones created in blender",
+        'PROP_NAME_JOINT_TO_BONES' : "Joints To Bones",
+        'PROP_DESC_JOINT_TO_BONES' : "changes the length of the bones",
+        'PROP_NAME_USE_BLENDER_NAMES' : "Use Blender Names Only",
+        'PROP_DESC_USE_BLENDER_NAMES' : "use only blender names, ignores ms3d"\
+                " names (bone names will always be taken from blender)",
+        'PROP_NAME_USE_BLENDER_MATERIALS' : "Use Blender Materials",
+        'PROP_DESC_USE_BLENDER_MATERIALS' : "ignores ms3d material definition"\
+                " (you loose some information by choosing this option)",
+        'ENUM_FROM_BLENDER_1' : "Copy From Blender",
+        'ENUM_FROM_BLENDER_2' : "takes and copies all available values from"\
+                " blender",
+        'ENUM_TO_BLENDER_1' : "Copy To Blender",
+        'ENUM_TO_BLENDER_2' : "copies and puts all available values to blender",
+        'PROP_NAME_EXTENDED_NORMAL_HANDLING': "Extended Normal Handling",
+        'PROP_DESC_EXTENDED_NORMAL_HANDLING': "adds extra vertices if normals"\
+                " are different",
+        'PROP_NAME_APPLY_TRANSFORM': "Apply Transform",
+        'PROP_DESC_APPLY_TRANSFORM': "applies location, rotation and scale on"\
+                " export",
+        'PROP_NAME_APPLY_MODIFIERS': "Apply Modifiers",
+        'PROP_DESC_APPLY_MODIFIERS': "applies modifiers on export that are"\
+                " enabled (except of armature modifiers)",
+        'PROP_NAME_APPLY_MODIFIERS_MODE': "Apply Mode",
+        'PROP_DESC_APPLY_MODIFIERS_MODE': "apply modifier, if enabled in its"\
+                " mode",
+        'PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_1': "View",
+        'PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_2': "apply modifiers that are"\
+                " enabled in viewport",
+        'PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_1': "Render",
+        'PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_2': "apply modifiers that are"\
+                " enabled in renderer",
+
+        'PROP_NAME_': "Name",
+        'PROP_DESC_': "Description",
+        # ms3d_str['']
+        }
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# ##### END OF FILE #####
diff --git a/release/scripts/addons/io_scene_ms3d/ms3d_ui.py b/release/scripts/addons/io_scene_ms3d/ms3d_ui.py
new file mode 100644
index 0000000..46d8a50
--- /dev/null
+++ b/release/scripts/addons/io_scene_ms3d/ms3d_ui.py
@@ -0,0 +1,1736 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011-2013 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+#import python stuff
+from random import (
+        randrange,
+        )
+
+
+# import io_scene_ms3d stuff
+from io_scene_ms3d.ms3d_strings import (
+        ms3d_str,
+        )
+from io_scene_ms3d.ms3d_spec import (
+        Ms3dSpec,
+        )
+from io_scene_ms3d.ms3d_utils import (
+        enable_edit_mode,
+        get_edge_split_modifier_add_if,
+        set_sence_to_metric,
+        )
+
+
+#import blender stuff
+from bmesh import (
+        from_edit_mesh,
+        )
+from bpy.utils import (
+        register_class,
+        unregister_class,
+        )
+from bpy_extras.io_utils import (
+        ExportHelper,
+        ImportHelper,
+        )
+from bpy.props import (
+        BoolProperty,
+        CollectionProperty,
+        EnumProperty,
+        FloatProperty,
+        FloatVectorProperty,
+        IntProperty,
+        StringProperty,
+        PointerProperty,
+        )
+from bpy.types import (
+        Operator,
+        PropertyGroup,
+        Panel,
+        Armature,
+        Bone,
+        Mesh,
+        Material,
+        Action,
+        Group,
+        UIList,
+        )
+from bpy.app import (
+        debug,
+        )
+
+
+class Ms3dUi:
+    DEFAULT_VERBOSE = debug
+
+    ###########################################################################
+    FLAG_TEXTURE_COMBINE_ALPHA = 'COMBINE_ALPHA'
+    FLAG_TEXTURE_HAS_ALPHA = 'HAS_ALPHA'
+    FLAG_TEXTURE_SPHERE_MAP = 'SPHERE_MAP'
+
+    @staticmethod
+    def texture_mode_from_ms3d(ms3d_value):
+        ui_value = set()
+        if (ms3d_value & Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA) \
+                == Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA:
+            ui_value.add(Ms3dUi.FLAG_TEXTURE_COMBINE_ALPHA)
+        if (ms3d_value & Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA) \
+                == Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA:
+            ui_value.add(Ms3dUi.FLAG_TEXTURE_HAS_ALPHA)
+        if (ms3d_value & Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP) \
+                == Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP:
+            ui_value.add(Ms3dUi.FLAG_TEXTURE_SPHERE_MAP)
+        return ui_value
+
+    @staticmethod
+    def texture_mode_to_ms3d(ui_value):
+        ms3d_value = Ms3dSpec.FLAG_TEXTURE_NONE
+
+        if Ms3dUi.FLAG_TEXTURE_COMBINE_ALPHA in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA
+        if Ms3dUi.FLAG_TEXTURE_HAS_ALPHA in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA
+        if Ms3dUi.FLAG_TEXTURE_SPHERE_MAP in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP
+        return ms3d_value
+
+
+    MODE_TRANSPARENCY_SIMPLE = 'SIMPLE'
+    MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF \
+            = 'DEPTH_BUFFERED_WITH_ALPHA_REF'
+    MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES = 'DEPTH_SORTED_TRIANGLES'
+
+    @staticmethod
+    def transparency_mode_from_ms3d(ms3d_value):
+        if(ms3d_value == Ms3dSpec.MODE_TRANSPARENCY_SIMPLE):
+            return Ms3dUi.MODE_TRANSPARENCY_SIMPLE
+        elif(ms3d_value == \
+                Ms3dSpec.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF):
+            return Ms3dUi.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF
+        elif(ms3d_value == Ms3dSpec.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES):
+            return Ms3dUi.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES
+        return None
+
+    @staticmethod
+    def transparency_mode_to_ms3d(ui_value):
+        if(ui_value == Ms3dUi.MODE_TRANSPARENCY_SIMPLE):
+            return Ms3dSpec.MODE_TRANSPARENCY_SIMPLE
+        elif(ui_value == Ms3dUi.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF):
+            return Ms3dSpec.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF
+        elif(ui_value == Ms3dUi.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES):
+            return Ms3dSpec.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES
+        return None
+
+
+    FLAG_NONE = 'NONE'
+    FLAG_SELECTED = 'SELECTED'
+    FLAG_HIDDEN = 'HIDDEN'
+    FLAG_SELECTED2 = 'SELECTED2'
+    FLAG_DIRTY = 'DIRTY'
+    FLAG_ISKEY = 'ISKEY'
+    FLAG_NEWLYCREATED = 'NEWLYCREATED'
+    FLAG_MARKED = 'MARKED'
+
+    @staticmethod
+    def flags_from_ms3d(ms3d_value):
+        ui_value = set()
+        if (ms3d_value & Ms3dSpec.FLAG_SELECTED) == Ms3dSpec.FLAG_SELECTED:
+            ui_value.add(Ms3dUi.FLAG_SELECTED)
+        if (ms3d_value & Ms3dSpec.FLAG_HIDDEN) == Ms3dSpec.FLAG_HIDDEN:
+            ui_value.add(Ms3dUi.FLAG_HIDDEN)
+        if (ms3d_value & Ms3dSpec.FLAG_SELECTED2) == Ms3dSpec.FLAG_SELECTED2:
+            ui_value.add(Ms3dUi.FLAG_SELECTED2)
+        if (ms3d_value & Ms3dSpec.FLAG_DIRTY) == Ms3dSpec.FLAG_DIRTY:
+            ui_value.add(Ms3dUi.FLAG_DIRTY)
+        if (ms3d_value & Ms3dSpec.FLAG_ISKEY) == Ms3dSpec.FLAG_ISKEY:
+            ui_value.add(Ms3dUi.FLAG_ISKEY)
+        if (ms3d_value & Ms3dSpec.FLAG_NEWLYCREATED) == \
+                Ms3dSpec.FLAG_NEWLYCREATED:
+            ui_value.add(Ms3dUi.FLAG_NEWLYCREATED)
+        if (ms3d_value & Ms3dSpec.FLAG_MARKED) == Ms3dSpec.FLAG_MARKED:
+            ui_value.add(Ms3dUi.FLAG_MARKED)
+        return ui_value
+
+    @staticmethod
+    def flags_to_ms3d(ui_value):
+        ms3d_value = Ms3dSpec.FLAG_NONE
+        if Ms3dUi.FLAG_SELECTED in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_SELECTED
+        if Ms3dUi.FLAG_HIDDEN in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_HIDDEN
+        if Ms3dUi.FLAG_SELECTED2 in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_SELECTED2
+        if Ms3dUi.FLAG_DIRTY in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_DIRTY
+        if Ms3dUi.FLAG_ISKEY in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_ISKEY
+        if Ms3dUi.FLAG_NEWLYCREATED in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_NEWLYCREATED
+        if Ms3dUi.FLAG_MARKED in ui_value:
+            ms3d_value |= Ms3dSpec.FLAG_MARKED
+        return ms3d_value
+
+    ###########################################################################
+    ICON_OPTIONS = 'LAMP'
+    ICON_OBJECT = 'WORLD'
+    ICON_PROCESSING = 'OBJECT_DATAMODE'
+    ICON_MODIFIER = 'MODIFIER'
+    ICON_ANIMATION = 'RENDER_ANIMATION'
+    ICON_ROTATION_MODE = 'BONE_DATA'
+    ICON_ERROR = 'ERROR'
+
+    ###########################################################################
+    PROP_DEFAULT_VERBOSE = DEFAULT_VERBOSE
+
+    ###########################################################################
+    PROP_DEFAULT_USE_JOINT_SIZE = False
+    PROP_DEFAULT_JOINT_SIZE = 0.01
+    PROP_JOINT_SIZE_MIN = 0.01
+    PROP_JOINT_SIZE_MAX = 10.0
+    PROP_JOINT_SIZE_STEP = 0.1
+    PROP_JOINT_SIZE_PRECISION = 2
+
+    ###########################################################################
+    PROP_DEFAULT_USE_ANIMATION = True
+    PROP_DEFAULT_NORMALIZE_WEIGHTS = True
+    PROP_DEFAULT_SHRINK_TO_KEYS = False
+    PROP_DEFAULT_BAKE_EACH_FRAME = True
+    PROP_DEFAULT_JOINT_TO_BONES = False
+    PROP_DEFAULT_USE_BLENDER_NAMES = True
+    PROP_DEFAULT_USE_BLENDER_MATERIALS = False
+    PROP_DEFAULT_EXTENDED_NORMAL_HANDLING = False
+    PROP_DEFAULT_APPLY_TRANSFORM = True
+    PROP_DEFAULT_APPLY_MODIFIERS = True
+
+    ###########################################################################
+    PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW = 'PREVIEW'
+    PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER = 'RENDER'
+    PROP_DEFAULT_APPLY_MODIFIERS_MODE = PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW
+
+    ###########################################################################
+    PROP_ITEM_ROTATION_MODE_EULER = 'EULER'
+    PROP_ITEM_ROTATION_MODE_QUATERNION = 'QUATERNION'
+    PROP_DEFAULT_ANIMATION_ROTATION = PROP_ITEM_ROTATION_MODE_EULER
+
+    ###########################################################################
+    OPT_SMOOTHING_GROUP_APPLY = 'io_scene_ms3d.apply_smoothing_group'
+    OPT_GROUP_APPLY = 'io_scene_ms3d.apply_group'
+    OPT_MATERIAL_APPLY = 'io_scene_ms3d.apply_material'
+
+
+###############################################################################
+class Ms3dImportOperator(Operator, ImportHelper):
+    """ Load a MilkShape3D MS3D File """
+    bl_idname = 'import_scene.ms3d'
+    bl_label = ms3d_str['BL_LABEL_IMPORTER']
+    bl_description = ms3d_str['BL_DESCRIPTION_IMPORTER']
+    bl_options = {'PRESET', }
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+
+    filepath = StringProperty(
+            subtype='FILE_PATH',
+            options={'HIDDEN', }
+            )
+
+    verbose = BoolProperty(
+            name=ms3d_str['PROP_NAME_VERBOSE'],
+            description=ms3d_str['PROP_DESC_VERBOSE'],
+            default=Ms3dUi.PROP_DEFAULT_VERBOSE,
+            )
+
+    use_animation = BoolProperty(
+            name=ms3d_str['PROP_NAME_USE_ANIMATION'],
+            description=ms3d_str['PROP_DESC_USE_ANIMATION'],
+            default=Ms3dUi.PROP_DEFAULT_USE_ANIMATION,
+            )
+
+    rotation_mode = EnumProperty(
+            name=ms3d_str['PROP_NAME_ROTATION_MODE'],
+            description=ms3d_str['PROP_DESC_ROTATION_MODE'],
+            items=( (Ms3dUi.PROP_ITEM_ROTATION_MODE_EULER,
+                            ms3d_str['PROP_ITEM_ROTATION_MODE_EULER_1'],
+                            ms3d_str['PROP_ITEM_ROTATION_MODE_EULER_2']),
+                    (Ms3dUi.PROP_ITEM_ROTATION_MODE_QUATERNION,
+                            ms3d_str['PROP_ITEM_ROTATION_MODE_QUATERNION_1'],
+                            ms3d_str['PROP_ITEM_ROTATION_MODE_QUATERNION_2']),
+                    ),
+            default=Ms3dUi.PROP_DEFAULT_ANIMATION_ROTATION,
+            )
+
+    use_joint_size = BoolProperty(
+            name=ms3d_str['PROP_NAME_USE_JOINT_SIZE'],
+            description=ms3d_str['PROP_DESC_USE_JOINT_SIZE'],
+            default=Ms3dUi.PROP_DEFAULT_USE_JOINT_SIZE,
+            )
+
+    joint_size = FloatProperty(
+            name=ms3d_str['PROP_NAME_IMPORT_JOINT_SIZE'],
+            description=ms3d_str['PROP_DESC_IMPORT_JOINT_SIZE'],
+            min=Ms3dUi.PROP_JOINT_SIZE_MIN, max=Ms3dUi.PROP_JOINT_SIZE_MAX,
+            precision=Ms3dUi.PROP_JOINT_SIZE_PRECISION, \
+                    step=Ms3dUi.PROP_JOINT_SIZE_STEP,
+            default=Ms3dUi.PROP_DEFAULT_JOINT_SIZE,
+            subtype='FACTOR',
+            #options={'HIDDEN', },
+            )
+
+    use_joint_to_bones = BoolProperty(
+            name=ms3d_str['PROP_NAME_JOINT_TO_BONES'],
+            description=ms3d_str['PROP_DESC_JOINT_TO_BONES'],
+            default=Ms3dUi.PROP_DEFAULT_JOINT_TO_BONES,
+            )
+
+    use_extended_normal_handling = BoolProperty(
+            name=ms3d_str['PROP_NAME_EXTENDED_NORMAL_HANDLING'],
+            description=ms3d_str['PROP_DESC_EXTENDED_NORMAL_HANDLING'],
+            default=Ms3dUi.PROP_DEFAULT_EXTENDED_NORMAL_HANDLING,
+            )
+
+    filename_ext = StringProperty(
+            default=ms3d_str['FILE_EXT'],
+            options={'HIDDEN', }
+            )
+
+    filter_glob = StringProperty(
+            default=ms3d_str['FILE_FILTER'],
+            options={'HIDDEN', }
+            )
+
+
+    @property
+    def use_euler_rotation(self):
+        return (Ms3dUi.PROP_ITEM_ROTATION_MODE_EULER \
+                in self.rotation_mode)
+
+    @property
+    def use_quaternion_rotation(self):
+        return (Ms3dUi.PROP_ITEM_ROTATION_MODE_QUATERNION \
+                in self.rotation_mode)
+
+
+    # draw the option panel
+    def draw(self, blender_context):
+        layout = self.layout
+
+        box = layout.box()
+        box.label(ms3d_str['LABEL_NAME_OPTIONS'], icon=Ms3dUi.ICON_OPTIONS)
+        box.prop(self, 'verbose', icon='SPEAKER')
+
+        box = layout.box()
+        box.label(ms3d_str['LABEL_NAME_PROCESSING'],
+                icon=Ms3dUi.ICON_PROCESSING)
+        box.prop(self, 'use_extended_normal_handling')
+
+        box = layout.box()
+        box.label(ms3d_str['LABEL_NAME_ANIMATION'], icon=Ms3dUi.ICON_ANIMATION)
+        box.prop(self, 'use_animation')
+        if (self.use_animation):
+            box.prop(self, 'rotation_mode', icon=Ms3dUi.ICON_ROTATION_MODE,
+                    expand=False)
+            flow = box.column_flow()
+            flow.prop(self, 'use_joint_size')
+            if (self.use_joint_size):
+                flow.prop(self, 'joint_size')
+            box.prop(self, 'use_joint_to_bones')
+            if (self.use_joint_to_bones):
+                box.box().label(ms3d_str['LABEL_NAME_JOINT_TO_BONES'],
+                        icon=Ms3dUi.ICON_ERROR)
+
+    # entrypoint for MS3D -> blender
+    def execute(self, blender_context):
+        """ start executing """
+        from io_scene_ms3d.ms3d_import import (Ms3dImporter, )
+        return Ms3dImporter(
+                report=self.report,
+                verbose=self.verbose,
+                use_extended_normal_handling=self.use_extended_normal_handling,
+                use_animation=self.use_animation,
+                use_quaternion_rotation=self.use_quaternion_rotation,
+                use_joint_size=self.use_joint_size,
+                joint_size=self.joint_size,
+                use_joint_to_bones=self.use_joint_to_bones,
+                ).read(
+                        blender_context,
+                        self.filepath
+                        )
+
+    def invoke(self, blender_context, event):
+        blender_context.window_manager.fileselect_add(self)
+        return {'RUNNING_MODAL', }
+
+    @staticmethod
+    def menu_func(cls, blender_context):
+        cls.layout.operator(
+                Ms3dImportOperator.bl_idname,
+                text=ms3d_str['TEXT_OPERATOR'],
+                )
+
+
+class Ms3dExportOperator(Operator, ExportHelper):
+    """Save a MilkShape3D MS3D File"""
+    bl_idname = 'export_scene.ms3d'
+    bl_label = ms3d_str['BL_LABEL_EXPORTER']
+    bl_description = ms3d_str['BL_DESCRIPTION_EXPORTER']
+    bl_options = {'PRESET', }
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+
+    filepath = StringProperty(
+            subtype='FILE_PATH',
+            options={'HIDDEN', }
+            )
+
+    verbose = BoolProperty(
+            name=ms3d_str['PROP_NAME_VERBOSE'],
+            description=ms3d_str['PROP_DESC_VERBOSE'],
+            default=Ms3dUi.PROP_DEFAULT_VERBOSE,
+            )
+
+    use_blender_names = BoolProperty(
+            name=ms3d_str['PROP_NAME_USE_BLENDER_NAMES'],
+            description=ms3d_str['PROP_DESC_USE_BLENDER_NAMES'],
+            default=Ms3dUi.PROP_DEFAULT_USE_BLENDER_NAMES,
+            )
+
+    use_blender_materials = BoolProperty(
+            name=ms3d_str['PROP_NAME_USE_BLENDER_MATERIALS'],
+            description=ms3d_str['PROP_DESC_USE_BLENDER_MATERIALS'],
+            default=Ms3dUi.PROP_DEFAULT_USE_BLENDER_MATERIALS,
+            )
+
+    apply_transform = BoolProperty(
+            name=ms3d_str['PROP_NAME_APPLY_TRANSFORM'],
+            description=ms3d_str['PROP_DESC_APPLY_TRANSFORM'],
+            default=Ms3dUi.PROP_DEFAULT_APPLY_TRANSFORM,
+            )
+
+    apply_modifiers = BoolProperty(
+            name=ms3d_str['PROP_NAME_APPLY_MODIFIERS'],
+            description=ms3d_str['PROP_DESC_APPLY_MODIFIERS'],
+            default=Ms3dUi.PROP_DEFAULT_APPLY_MODIFIERS,
+            )
+
+    apply_modifiers_mode =  EnumProperty(
+            name=ms3d_str['PROP_NAME_APPLY_MODIFIERS_MODE'],
+            description=ms3d_str['PROP_DESC_APPLY_MODIFIERS_MODE'],
+            items=( (Ms3dUi.PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW,
+                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_1'],
+                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_2']),
+                    (Ms3dUi.PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER,
+                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_1'],
+                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_2']),
+                    ),
+            default=Ms3dUi.PROP_DEFAULT_APPLY_MODIFIERS_MODE,
+            )
+
+    use_animation = BoolProperty(
+            name=ms3d_str['PROP_NAME_USE_ANIMATION'],
+            description=ms3d_str['PROP_DESC_USE_ANIMATION'],
+            default=Ms3dUi.PROP_DEFAULT_USE_ANIMATION,
+            )
+
+    normalize_weights = BoolProperty(
+            name=ms3d_str['PROP_NAME_NORMALIZE_WEIGHTS'],
+            description=ms3d_str['PROP_DESC_NORMALIZE_WEIGHTS'],
+            default=Ms3dUi.PROP_DEFAULT_NORMALIZE_WEIGHTS,
+            )
+
+    shrink_to_keys = BoolProperty(
+            name=ms3d_str['PROP_NAME_SHRINK_TO_KEYS'],
+            description=ms3d_str['PROP_DESC_SHRINK_TO_KEYS'],
+            default=Ms3dUi.PROP_DEFAULT_SHRINK_TO_KEYS,
+            )
+
+    bake_each_frame = BoolProperty(
+            name=ms3d_str['PROP_NAME_BAKE_EACH_FRAME'],
+            description=ms3d_str['PROP_DESC_BAKE_EACH_FRAME'],
+            default=Ms3dUi.PROP_DEFAULT_BAKE_EACH_FRAME,
+            )
+
+    check_existing = BoolProperty(
+            default=False,
+            options={'HIDDEN', }
+            )
+
+    filename_ext = StringProperty(
+            default=ms3d_str['FILE_EXT'],
+            options={'HIDDEN', }
+            )
+
+    filter_glob = StringProperty(
+            default=ms3d_str['FILE_FILTER'],
+            options={'HIDDEN', }
+            )
+
+    ##def object_items(self, blender_context):
+    ##    return[(item.name, item.name, "") for item in blender_context.selected_objects if item.type in {'MESH', }]
+    ##
+    ##object_name = EnumProperty(
+    ##        name="Object",
+    ##        description="select an object to export",
+    ##        items=object_items,
+    ##        )
+
+    ##EXPORT_ACTIVE_ONLY:
+    ##limit availability to only active mesh object
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.active_object
+                and blender_context.active_object.type in {'MESH', }
+                and blender_context.active_object.data
+                and blender_context.active_object.data.ms3d is not None
+                )
+
+    # draw the option panel
+    def draw(self, blender_context):
+        layout = self.layout
+
+        box = layout.box()
+        flow = box.column_flow()
+        flow.label(ms3d_str['LABEL_NAME_OPTIONS'], icon=Ms3dUi.ICON_OPTIONS)
+        flow.prop(self, 'verbose', icon='SPEAKER')
+
+        box = layout.box()
+        flow = box.column_flow()
+        flow.label(ms3d_str['LABEL_NAME_PROCESSING'],
+                icon=Ms3dUi.ICON_PROCESSING)
+        row = flow.row()
+        row.label(ms3d_str['PROP_NAME_ACTIVE'], icon='ROTACTIVE')
+        row.label(blender_context.active_object.name)
+        ##flow.prop(self, 'object_name')
+        flow.prop(self, 'use_blender_names')
+        flow.prop(self, 'use_blender_materials')
+
+        box = layout.box()
+        flow = box.column_flow()
+        flow.label(ms3d_str['LABEL_NAME_MODIFIER'],
+                icon=Ms3dUi.ICON_MODIFIER)
+        flow.prop(self, 'apply_transform')
+        row = flow.row()
+        row.prop(self, 'apply_modifiers')
+        sub = row.row()
+        sub.active = self.apply_modifiers
+        sub.prop(self, 'apply_modifiers_mode', text="")
+
+        box = layout.box()
+        flow = box.column_flow()
+        flow.label(ms3d_str['LABEL_NAME_ANIMATION'],
+                icon=Ms3dUi.ICON_ANIMATION)
+        flow.prop(self, 'use_animation')
+        if (self.use_animation):
+            flow.prop(self, 'normalize_weights')
+            flow.prop(self, 'shrink_to_keys')
+            flow.prop(self, 'bake_each_frame')
+
+    # entrypoint for blender -> MS3D
+    def execute(self, blender_context):
+        """start executing"""
+        from io_scene_ms3d.ms3d_export import (Ms3dExporter, )
+        return Ms3dExporter(
+                self.report,
+                verbose=self.verbose,
+                use_blender_names=self.use_blender_names,
+                use_blender_materials=self.use_blender_materials,
+                apply_transform=self.apply_transform,
+                apply_modifiers=self.apply_modifiers,
+                apply_modifiers_mode=self.apply_modifiers_mode,
+                use_animation=self.use_animation,
+                normalize_weights=self.normalize_weights,
+                shrink_to_keys=self.shrink_to_keys,
+                bake_each_frame=self.bake_each_frame,
+                ).write(
+                        blender_context,
+                        self.filepath
+                        )
+
+    #
+    def invoke(self, blender_context, event):
+        blender_context.window_manager.fileselect_add(self)
+        return {"RUNNING_MODAL", }
+
+    @staticmethod
+    def menu_func(cls, blender_context):
+        cls.layout.operator(
+                Ms3dExportOperator.bl_idname,
+                text=ms3d_str['TEXT_OPERATOR']
+                )
+
+
+###############################################################################
+##
+###############################################################################
+
+
+###############################################################################
+class Ms3dSetSmoothingGroupOperator(Operator):
+    bl_idname = Ms3dUi.OPT_SMOOTHING_GROUP_APPLY
+    bl_label = ms3d_str['BL_LABEL_SMOOTHING_GROUP_OPERATOR']
+    bl_options = {'INTERNAL', }
+
+    smoothing_group_index = IntProperty(
+            name=ms3d_str['PROP_SMOOTHING_GROUP_INDEX'],
+            options={'HIDDEN', 'SKIP_SAVE', },
+            )
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object
+                and blender_context.object.type in {'MESH', }
+                and blender_context.object.data
+                and blender_context.object.data.ms3d is not None
+                and blender_context.mode == 'EDIT_MESH'
+                and blender_context.tool_settings.mesh_select_mode[2]
+                )
+
+    def execute(self, blender_context):
+        custom_data = blender_context.object.data.ms3d
+        blender_mesh = blender_context.object.data
+        bm = from_edit_mesh(blender_mesh)
+        layer_smoothing_group = bm.faces.layers.int.get(
+                ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
+        if custom_data.apply_mode in {'SELECT', 'DESELECT', }:
+            if layer_smoothing_group is not None:
+                is_select = (custom_data.apply_mode == 'SELECT')
+                for bmf in bm.faces:
+                    if (bmf[layer_smoothing_group] \
+                            == self.smoothing_group_index):
+                        bmf.select_set(is_select)
+        elif custom_data.apply_mode == 'ASSIGN':
+            if layer_smoothing_group is None:
+                layer_smoothing_group = bm.faces.layers.int.new(
+                        ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
+                blender_mesh_object = blender_context.object
+                get_edge_split_modifier_add_if(blender_mesh_object)
+            blender_face_list = []
+            for bmf in bm.faces:
+                if not bmf.smooth:
+                    bmf.smooth = True
+                if bmf.select:
+                    bmf[layer_smoothing_group] = self.smoothing_group_index
+                    blender_face_list.append(bmf)
+            edge_dict = {}
+            for bmf in blender_face_list:
+                bmf.smooth = True
+                for bme in bmf.edges:
+                    if edge_dict.get(bme) is None:
+                        edge_dict[bme] = 0
+                    else:
+                        edge_dict[bme] += 1
+                    is_border = (edge_dict[bme] == 0)
+                    if is_border:
+                        surround_face_smoothing_group_index \
+                                = self.smoothing_group_index
+                        for bmf in bme.link_faces:
+                            if bmf[layer_smoothing_group] \
+                                    != surround_face_smoothing_group_index:
+                                surround_face_smoothing_group_index \
+                                        = bmf[layer_smoothing_group]
+                                break;
+                        if surround_face_smoothing_group_index \
+                                == self.smoothing_group_index:
+                            is_border = False
+                    bme.seam = is_border
+                    bme.smooth = not is_border
+        bm.free()
+        enable_edit_mode(False, blender_context)
+        enable_edit_mode(True, blender_context)
+        return {'FINISHED', }
+
+
+class Ms3dGroupOperator(Operator):
+    bl_idname = Ms3dUi.OPT_GROUP_APPLY
+    bl_label = ms3d_str['BL_LABEL_GROUP_OPERATOR']
+    bl_options = {'INTERNAL', }
+
+    mode = EnumProperty(
+            items=( ('', "", ""),
+                    ('ADD_GROUP',
+                            ms3d_str['ENUM_ADD_GROUP_1'],
+                            ms3d_str['ENUM_ADD_GROUP_2']),
+                    ('REMOVE_GROUP',
+                            ms3d_str['ENUM_REMOVE_GROUP_1'],
+                            ms3d_str['ENUM_REMOVE_GROUP_2']),
+                    ('ASSIGN',
+                            ms3d_str['ENUM_ASSIGN_1'],
+                            ms3d_str['ENUM_ASSIGN_2_GROUP']),
+                    ('REMOVE',
+                            ms3d_str['ENUM_REMOVE_1'],
+                            ms3d_str['ENUM_REMOVE_2_GROUP']),
+                    ('SELECT',
+                            ms3d_str['ENUM_SELECT_1'],
+                            ms3d_str['ENUM_SELECT_2_GROUP']),
+                    ('DESELECT',
+                            ms3d_str['ENUM_DESELECT_1'],
+                            ms3d_str['ENUM_DESELECT_2_GROUP']),
+                    ),
+            options={'HIDDEN', 'SKIP_SAVE', },
+            )
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object
+                and blender_context.object.type in {'MESH', }
+                and blender_context.object.data
+                and blender_context.object.data.ms3d is not None
+                and blender_context.mode == 'EDIT_MESH'
+                #and blender_context.object.data.ms3d.selected_group_index != -1
+                )
+
+    def execute(self, blender_context):
+        custom_data = blender_context.object.data.ms3d
+        blender_mesh = blender_context.object.data
+        bm = None
+        bm = from_edit_mesh(blender_mesh)
+
+        if self.mode == 'ADD_GROUP':
+            item = custom_data.create_group()
+            layer_group = bm.faces.layers.int.get(
+                    ms3d_str['OBJECT_LAYER_GROUP'])
+            if layer_group is None:
+                bm.faces.layers.int.new(ms3d_str['OBJECT_LAYER_GROUP'])
+
+        elif self.mode == 'REMOVE_GROUP':
+            custom_data.remove_group()
+
+        elif (custom_data.selected_group_index >= 0) and (
+                custom_data.selected_group_index < len(custom_data.groups)):
+            if self.mode in {'SELECT', 'DESELECT', }:
+                layer_group = bm.faces.layers.int.get(
+                        ms3d_str['OBJECT_LAYER_GROUP'])
+                if layer_group is not None:
+                    is_select = (self.mode == 'SELECT')
+                    id = custom_data.groups[
+                            custom_data.selected_group_index].id
+                    for bmf in bm.faces:
+                        if bmf[layer_group] == id:
+                            bmf.select_set(is_select)
+
+            elif self.mode in {'ASSIGN', 'REMOVE', }:
+                layer_group = bm.faces.layers.int.get(
+                        ms3d_str['OBJECT_LAYER_GROUP'])
+                if layer_group is None:
+                    layer_group = bm.faces.layers.int.new(
+                            ms3d_str['OBJECT_LAYER_GROUP'])
+
+                is_assign = (self.mode == 'ASSIGN')
+                id = custom_data.groups[custom_data.selected_group_index].id
+                for bmf in bm.faces:
+                    if bmf.select:
+                        if is_assign:
+                            bmf[layer_group] = id
+                        else:
+                            bmf[layer_group] = -1
+        if bm is not None:
+            bm.free()
+        enable_edit_mode(False, blender_context)
+        enable_edit_mode(True, blender_context)
+        return {'FINISHED', }
+
+
+class Ms3dMaterialOperator(Operator):
+    bl_idname = Ms3dUi.OPT_MATERIAL_APPLY
+    bl_label = ms3d_str['BL_LABEL_MATERIAL_OPERATOR']
+    bl_options = {'INTERNAL', }
+
+    mode = EnumProperty(
+            items=( ('', "", ""),
+                    ('FROM_BLENDER',
+                            ms3d_str['ENUM_FROM_BLENDER_1'],
+                            ms3d_str['ENUM_FROM_BLENDER_2']),
+                    ('TO_BLENDER',
+                            ms3d_str['ENUM_TO_BLENDER_1'],
+                            ms3d_str['ENUM_TO_BLENDER_2']),
+                    ),
+            options={'HIDDEN', 'SKIP_SAVE', },
+            )
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object
+                and blender_context.object.type in {'MESH', }
+                and blender_context.object.data
+                and blender_context.object.data.ms3d is not None
+                and blender_context.material
+                and blender_context.material.ms3d is not None
+                )
+
+    def execute(self, blender_context):
+        blender_material = blender_context.active_object.active_material
+        ms3d_material = blender_material.ms3d
+
+        if self.mode == 'FROM_BLENDER':
+            Ms3dMaterialHelper.copy_from_blender(self, blender_context,
+                    ms3d_material, blender_material)
+            pass
+
+        elif self.mode == 'TO_BLENDER':
+            # not implemented
+            pass
+
+        return {'FINISHED', }
+
+    # entrypoint for option via UI
+    def invoke(self, blender_context, event):
+        return blender_context.window_manager.invoke_props_dialog(self)
+
+
+###############################################################################
+class Ms3dGroupProperties(PropertyGroup):
+    name = StringProperty(
+            name=ms3d_str['PROP_NAME_NAME'],
+            description=ms3d_str['PROP_DESC_GROUP_NAME'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+    flags = EnumProperty(
+            name=ms3d_str['PROP_NAME_FLAGS'],
+            description=ms3d_str['PROP_DESC_FLAGS_GROUP'],
+            items=(#(Ms3dUi.FLAG_NONE, ms3d_str['ENUM_FLAG_NONE_1'],
+                   #         ms3d_str['ENUM_FLAG_NONE_2'],
+                   #         Ms3dSpec.FLAG_NONE),
+                    (Ms3dUi.FLAG_SELECTED,
+                            ms3d_str['ENUM_FLAG_SELECTED_1'],
+                            ms3d_str['ENUM_FLAG_SELECTED_2'],
+                            Ms3dSpec.FLAG_SELECTED),
+                    (Ms3dUi.FLAG_HIDDEN,
+                            ms3d_str['ENUM_FLAG_HIDDEN_1'],
+                            ms3d_str['ENUM_FLAG_HIDDEN_2'],
+                            Ms3dSpec.FLAG_HIDDEN),
+                    (Ms3dUi.FLAG_SELECTED2,
+                            ms3d_str['ENUM_FLAG_SELECTED2_1'],
+                            ms3d_str['ENUM_FLAG_SELECTED2_2'],
+                            Ms3dSpec.FLAG_SELECTED2),
+                    (Ms3dUi.FLAG_DIRTY,
+                            ms3d_str['ENUM_FLAG_DIRTY_1'],
+                            ms3d_str['ENUM_FLAG_DIRTY_2'],
+                            Ms3dSpec.FLAG_DIRTY),
+                    (Ms3dUi.FLAG_ISKEY,
+                            ms3d_str['ENUM_FLAG_ISKEY_1'],
+                            ms3d_str['ENUM_FLAG_ISKEY_2'],
+                            Ms3dSpec.FLAG_ISKEY),
+                    (Ms3dUi.FLAG_NEWLYCREATED,
+                            ms3d_str['ENUM_FLAG_NEWLYCREATED_1'],
+                            ms3d_str['ENUM_FLAG_NEWLYCREATED_2'],
+                            Ms3dSpec.FLAG_NEWLYCREATED),
+                    (Ms3dUi.FLAG_MARKED,
+                            ms3d_str['ENUM_FLAG_MARKED_1'],
+                            ms3d_str['ENUM_FLAG_MARKED_2'],
+                            Ms3dSpec.FLAG_MARKED),
+                    ),
+            default=Ms3dUi.flags_from_ms3d(Ms3dSpec.DEFAULT_FLAGS),
+            options={'ENUM_FLAG', 'ANIMATABLE', },
+            )
+
+    comment = StringProperty(
+            name=ms3d_str['PROP_NAME_COMMENT'],
+            description=ms3d_str['PROP_DESC_COMMENT_GROUP'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+    id = IntProperty(options={'HIDDEN', },)
+
+
+class Ms3dModelProperties(PropertyGroup):
+    name = StringProperty(
+            name=ms3d_str['PROP_NAME_NAME'],
+            description=ms3d_str['PROP_DESC_NAME_MODEL'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+    joint_size = FloatProperty(
+            name=ms3d_str['PROP_NAME_JOINT_SIZE'],
+            description=ms3d_str['PROP_DESC_JOINT_SIZE'],
+            min=Ms3dUi.PROP_JOINT_SIZE_MIN, max=Ms3dUi.PROP_JOINT_SIZE_MAX,
+            precision=Ms3dUi.PROP_JOINT_SIZE_PRECISION, \
+                    step=Ms3dUi.PROP_JOINT_SIZE_STEP,
+            default=Ms3dUi.PROP_DEFAULT_JOINT_SIZE,
+            subtype='FACTOR',
+            #options={'HIDDEN', },
+            )
+
+    transparency_mode = EnumProperty(
+            name=ms3d_str['PROP_NAME_TRANSPARENCY_MODE'],
+            description=ms3d_str['PROP_DESC_TRANSPARENCY_MODE'],
+            items=( (Ms3dUi.MODE_TRANSPARENCY_SIMPLE,
+                            ms3d_str['PROP_MODE_TRANSPARENCY_SIMPLE_1'],
+                            ms3d_str['PROP_MODE_TRANSPARENCY_SIMPLE_2'],
+                            Ms3dSpec.MODE_TRANSPARENCY_SIMPLE),
+                    (Ms3dUi.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES,
+                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_1'],
+                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_2'],
+                            Ms3dSpec.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES),
+                    (Ms3dUi.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF,
+                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_1'],
+                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_2'],
+                            Ms3dSpec.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF),
+                    ),
+            default=Ms3dUi.transparency_mode_from_ms3d(
+                    Ms3dSpec.DEFAULT_MODEL_TRANSPARENCY_MODE),
+            #options={'HIDDEN', },
+            )
+
+    alpha_ref = FloatProperty(
+            name=ms3d_str['PROP_NAME_ALPHA_REF'],
+            description=ms3d_str['PROP_DESC_ALPHA_REF'],
+            min=0, max=1, precision=3, step=0.1,
+            default=0.5,
+            subtype='FACTOR',
+            #options={'HIDDEN', },
+            )
+
+    comment = StringProperty(
+            name=ms3d_str['PROP_NAME_COMMENT'],
+            description=ms3d_str['PROP_DESC_COMMENT_MODEL'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+    ##########################
+    # ms3d group handling
+    #
+    apply_mode = EnumProperty(
+            items=( ('ASSIGN',
+                            ms3d_str['ENUM_ASSIGN_1'],
+                            ms3d_str['ENUM_ASSIGN_2_SMOOTHING_GROUP']),
+                    ('SELECT',
+                            ms3d_str['ENUM_SELECT_1'],
+                            ms3d_str['ENUM_SELECT_2_SMOOTHING_GROUP']),
+                    ('DESELECT',
+                            ms3d_str['ENUM_DESELECT_1'],
+                            ms3d_str['ENUM_DESELECT_2_SMOOTHING_GROUP']),
+                    ),
+            default='SELECT',
+            options={'HIDDEN', 'SKIP_SAVE', },
+            )
+
+    selected_group_index = IntProperty(
+            default=-1,
+            min=-1,
+            options={'HIDDEN', 'SKIP_SAVE', },
+            )
+    #
+    # ms3d group handling
+    ##########################
+
+    groups = CollectionProperty(
+            type=Ms3dGroupProperties,
+            #options={'HIDDEN', },
+            )
+
+
+    def generate_unique_id(self):
+        return randrange(1, 0x7FFFFFFF) # pseudo unique id
+
+    def create_group(self):
+        item = self.groups.add()
+        item.id = self.generate_unique_id()
+        length = len(self.groups)
+        self.selected_group_index = length - 1
+
+        item.name = ms3d_str['STRING_FORMAT_GROUP'].format(length)
+        return item
+
+    def remove_group(self):
+        index = self.selected_group_index
+        length = len(self.groups)
+        if (index >= 0) and (index < length):
+            if index > 0 or length == 1:
+                self.selected_group_index = index - 1
+            self.groups.remove(index)
+
+
+class Ms3dArmatureProperties(PropertyGroup):
+    name = StringProperty(
+            name=ms3d_str['PROP_NAME_NAME'],
+            description=ms3d_str['PROP_DESC_NAME_ARMATURE'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+
+class Ms3dJointProperties(PropertyGroup):
+    name = StringProperty(
+            name=ms3d_str['PROP_NAME_NAME'],
+            description=ms3d_str['PROP_DESC_NAME_JOINT'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+    flags = EnumProperty(
+            name=ms3d_str['PROP_NAME_FLAGS'],
+            description=ms3d_str['PROP_DESC_FLAGS_JOINT'],
+            items=(#(Ms3dUi.FLAG_NONE,
+                   #         ms3d_str['ENUM_FLAG_NONE_1'],
+                   #         ms3d_str['ENUM_FLAG_NONE_2'],
+                   #         Ms3dSpec.FLAG_NONE),
+                    (Ms3dUi.FLAG_SELECTED,
+                            ms3d_str['ENUM_FLAG_SELECTED_1'],
+                            ms3d_str['ENUM_FLAG_SELECTED_2'],
+                            Ms3dSpec.FLAG_SELECTED),
+                    (Ms3dUi.FLAG_HIDDEN,
+                            ms3d_str['ENUM_FLAG_HIDDEN_1'],
+                            ms3d_str['ENUM_FLAG_HIDDEN_2'],
+                            Ms3dSpec.FLAG_HIDDEN),
+                    (Ms3dUi.FLAG_SELECTED2,
+                            ms3d_str['ENUM_FLAG_SELECTED2_1'],
+                            ms3d_str['ENUM_FLAG_SELECTED2_2'],
+                            Ms3dSpec.FLAG_SELECTED2),
+                    (Ms3dUi.FLAG_DIRTY,
+                            ms3d_str['ENUM_FLAG_DIRTY_1'],
+                            ms3d_str['ENUM_FLAG_DIRTY_2'],
+                            Ms3dSpec.FLAG_DIRTY),
+                    (Ms3dUi.FLAG_ISKEY,
+                            ms3d_str['ENUM_FLAG_ISKEY_1'],
+                            ms3d_str['ENUM_FLAG_ISKEY_2'],
+                            Ms3dSpec.FLAG_ISKEY),
+                    (Ms3dUi.FLAG_NEWLYCREATED,
+                            ms3d_str['ENUM_FLAG_NEWLYCREATED_1'],
+                            ms3d_str['ENUM_FLAG_NEWLYCREATED_2'],
+                            Ms3dSpec.FLAG_NEWLYCREATED),
+                    (Ms3dUi.FLAG_MARKED,
+                            ms3d_str['ENUM_FLAG_MARKED_1'],
+                            ms3d_str['ENUM_FLAG_MARKED_2'],
+                            Ms3dSpec.FLAG_MARKED),
+                    ),
+            default=Ms3dUi.flags_from_ms3d(Ms3dSpec.DEFAULT_FLAGS),
+            options={'ENUM_FLAG', 'ANIMATABLE', },
+            )
+
+    color = FloatVectorProperty(
+            name=ms3d_str['PROP_NAME_COLOR'],
+            description=ms3d_str['PROP_DESC_COLOR_JOINT'],
+            subtype='COLOR', size=3, min=0, max=1, precision=3, step=0.1,
+            default=Ms3dSpec.DEFAULT_JOINT_COLOR,
+            #options={'HIDDEN', },
+            )
+
+    comment = StringProperty(
+            name=ms3d_str['PROP_NAME_COMMENT'],
+            description=ms3d_str['PROP_DESC_COMMENT_JOINT'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+
+class Ms3dMaterialHelper:
+    @staticmethod
+    def copy_to_blender_ambient(cls, blender_context):
+        pass
+
+    @staticmethod
+    def copy_to_blender_diffuse(cls, blender_context):
+        cls.id_data.diffuse_color = cls.diffuse[0:3]
+        #cls.id_data.diffuse_intensity = cls.diffuse[3]
+        pass
+
+    @staticmethod
+    def copy_to_blender_specular(cls, blender_context):
+        cls.id_data.specular_color = cls.specular[0:3]
+        #cls.id_data.specular_intensity = cls.specular[3]
+        pass
+
+    @staticmethod
+    def copy_to_blender_emissive(cls, blender_context):
+        cls.id_data.emit = (cls.emissive[0] + cls.emissive[1] \
+                + cls.emissive[2]) / 3.0
+        pass
+
+    @staticmethod
+    def copy_to_blender_shininess(cls, blender_context):
+        cls.id_data.specular_hardness = cls.shininess * 4.0
+        pass
+
+    @staticmethod
+    def copy_to_blender_transparency(cls, blender_context):
+        cls.id_data.alpha = 1.0 - cls.transparency
+        pass
+
+
+    @staticmethod
+    def copy_from_blender(cls, blender_context, ms3d_material, blender_material):
+        # copy, bacause of auto update, it would distord original values
+        blender_material_diffuse_color = blender_material.diffuse_color.copy()
+        blender_material_diffuse_intensity = blender_material.diffuse_intensity
+        blender_material_specular_color = blender_material.specular_color.copy()
+        blender_material_specular_intensity = \
+                blender_material.specular_intensity
+        blender_material_emit = blender_material.emit
+        blender_material_specular_hardness = \
+                blender_material.specular_hardness
+        blender_material_alpha = blender_material.alpha
+
+        blender_material_texture = None
+        for slot in blender_material.texture_slots:
+            if slot and slot.use_map_color_diffuse \
+                    and slot.texture.type == 'IMAGE':
+                blender_material_texture = slot.texture.image.filepath
+                break
+
+        blender_material_alphamap = None
+        for slot in blender_material.texture_slots:
+            if slot and not slot.use_map_color_diffuse \
+                    and slot.use_map_alpha and slot.texture.type == 'IMAGE':
+                blender_material_alphamap = slot.texture.image.filepath
+                break
+
+        ms3d_material.diffuse[0] = blender_material_diffuse_color[0]
+        ms3d_material.diffuse[1] = blender_material_diffuse_color[1]
+        ms3d_material.diffuse[2] = blender_material_diffuse_color[2]
+        ms3d_material.diffuse[3] = 1.0
+        ms3d_material.specular[0] = blender_material_specular_color[0]
+        ms3d_material.specular[1] = blender_material_specular_color[1]
+        ms3d_material.specular[2] = blender_material_specular_color[2]
+        ms3d_material.specular[3] = 1.0
+        ms3d_material.emissive[0] = blender_material_emit
+        ms3d_material.emissive[1] = blender_material_emit
+        ms3d_material.emissive[2] = blender_material_emit
+        ms3d_material.emissive[3] = 1.0
+        ms3d_material.shininess = blender_material_specular_hardness / 4.0
+        ms3d_material.transparency = 1.0 - blender_material_alpha
+
+        if blender_material_texture:
+            ms3d_material.texture = blender_material_texture
+        else:
+            ms3d_material.texture = ""
+
+        if blender_material_alphamap:
+            ms3d_material.alphamap = blender_material_alphamap
+        else:
+            ms3d_material.alphamap = ""
+
+
+class Ms3dMaterialProperties(PropertyGroup):
+    name = StringProperty(
+            name=ms3d_str['PROP_NAME_NAME'],
+            description=ms3d_str['PROP_DESC_NAME_MATERIAL'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+    ambient = FloatVectorProperty(
+            name=ms3d_str['PROP_NAME_AMBIENT'],
+            description=ms3d_str['PROP_DESC_AMBIENT'],
+            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
+            default=Ms3dSpec.DEFAULT_MATERIAL_AMBIENT,
+            update=Ms3dMaterialHelper.copy_to_blender_ambient,
+            #options={'HIDDEN', },
+            )
+
+    diffuse = FloatVectorProperty(
+            name=ms3d_str['PROP_NAME_DIFFUSE'],
+            description=ms3d_str['PROP_DESC_DIFFUSE'],
+            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
+            default=Ms3dSpec.DEFAULT_MATERIAL_DIFFUSE,
+            update=Ms3dMaterialHelper.copy_to_blender_diffuse,
+            #options={'HIDDEN', },
+            )
+
+    specular = FloatVectorProperty(
+            name=ms3d_str['PROP_NAME_SPECULAR'],
+            description=ms3d_str['PROP_DESC_SPECULAR'],
+            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
+            default=Ms3dSpec.DEFAULT_MATERIAL_SPECULAR,
+            update=Ms3dMaterialHelper.copy_to_blender_specular,
+            #options={'HIDDEN', },
+            )
+
+    emissive = FloatVectorProperty(
+            name=ms3d_str['PROP_NAME_EMISSIVE'],
+            description=ms3d_str['PROP_DESC_EMISSIVE'],
+            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
+            default=Ms3dSpec.DEFAULT_MATERIAL_EMISSIVE,
+            update=Ms3dMaterialHelper.copy_to_blender_emissive,
+            #options={'HIDDEN', },
+            )
+
+    shininess = FloatProperty(
+            name=ms3d_str['PROP_NAME_SHININESS'],
+            description=ms3d_str['PROP_DESC_SHININESS'],
+            min=0, max=Ms3dSpec.MAX_MATERIAL_SHININESS, precision=3, step=0.1,
+            default=Ms3dSpec.DEFAULT_MATERIAL_SHININESS,
+            subtype='FACTOR',
+            update=Ms3dMaterialHelper.copy_to_blender_shininess,
+            #options={'HIDDEN', },
+            )
+
+    transparency = FloatProperty(
+            name=ms3d_str['PROP_NAME_TRANSPARENCY'],
+            description=ms3d_str['PROP_DESC_TRANSPARENCY'],
+            min=0, max=1, precision=3, step=0.1,
+            default=0,
+            subtype='FACTOR',
+            update=Ms3dMaterialHelper.copy_to_blender_transparency,
+            #options={'HIDDEN', },
+            )
+
+    mode = EnumProperty(
+            name=ms3d_str['PROP_NAME_MODE'],
+            description=ms3d_str['PROP_DESC_MODE_TEXTURE'],
+            items=( (Ms3dUi.FLAG_TEXTURE_COMBINE_ALPHA,
+                            ms3d_str['PROP_FLAG_TEXTURE_COMBINE_ALPHA_1'],
+                            ms3d_str['PROP_FLAG_TEXTURE_COMBINE_ALPHA_2'],
+                            Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA),
+                    (Ms3dUi.FLAG_TEXTURE_HAS_ALPHA,
+                            ms3d_str['PROP_FLAG_TEXTURE_HAS_ALPHA_1'],
+                            ms3d_str['PROP_FLAG_TEXTURE_HAS_ALPHA_2'],
+                            Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA),
+                    (Ms3dUi.FLAG_TEXTURE_SPHERE_MAP,
+                            ms3d_str['PROP_FLAG_TEXTURE_SPHERE_MAP_1'],
+                            ms3d_str['PROP_FLAG_TEXTURE_SPHERE_MAP_2'],
+                            Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP),
+                    ),
+            default=Ms3dUi.texture_mode_from_ms3d(
+                    Ms3dSpec.DEFAULT_MATERIAL_MODE),
+            options={'ANIMATABLE', 'ENUM_FLAG', },
+            )
+
+    texture = StringProperty(
+            name=ms3d_str['PROP_NAME_TEXTURE'],
+            description=ms3d_str['PROP_DESC_TEXTURE'],
+            default="",
+            subtype = 'FILE_PATH'
+            #options={'HIDDEN', },
+            )
+
+    alphamap = StringProperty(
+            name=ms3d_str['PROP_NAME_ALPHAMAP'],
+            description=ms3d_str['PROP_DESC_ALPHAMAP'],
+            default="",
+            subtype = 'FILE_PATH'
+            #options={'HIDDEN', },
+            )
+
+    comment = StringProperty(
+            name=ms3d_str['PROP_NAME_COMMENT'],
+            description=ms3d_str['PROP_DESC_COMMENT_MATERIAL'],
+            default="",
+            #options={'HIDDEN', },
+            )
+
+
+###############################################################################
+# http://www.blender.org/documentation/blender_python_api_2_65_10/bpy.types.UIList.html
+class Ms3dGroupUILise(UIList):
+    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+        if self.layout_type in {'DEFAULT', 'COMPACT', }:
+            layout.label(text=item.name, icon_value=icon)
+        elif self.layout_type in {'GRID', }:
+            layout.alignment = 'CENTER'
+            layout.label(text="", icon_value=icon)
+
+###############################################################################
+class Ms3dMeshPanel(Panel):
+    bl_label = ms3d_str['LABEL_PANEL_MODEL']
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = 'object'
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object
+                and blender_context.object.type in {'MESH', }
+                and blender_context.object.data
+                and blender_context.object.data.ms3d is not None
+                )
+
+    def draw_header(self, blender_context):
+        layout = self.layout
+        layout.label(icon='PLUGIN')
+
+    def draw(self, blender_context):
+        layout = self.layout
+        custom_data = blender_context.object.data.ms3d
+
+        row = layout.row()
+        row.prop(custom_data, 'name')
+
+        col = layout.column()
+        row = col.row()
+        row.prop(custom_data, 'joint_size')
+        row = col.row()
+        row.prop(custom_data, 'transparency_mode')
+        row = col.row()
+        row.prop(custom_data, 'alpha_ref', )
+
+        row = layout.row()
+        row.prop(custom_data, 'comment')
+
+
+class Ms3dMaterialPanel(Panel):
+    bl_label = ms3d_str['LABEL_PANEL_MATERIALS']
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = 'material'
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object
+                and blender_context.object.type in {'MESH', }
+                and blender_context.object.data
+                and blender_context.object.data.ms3d is not None
+                and blender_context.material
+                and blender_context.material.ms3d is not None
+                )
+
+    def draw_header(self, blender_context):
+        layout = self.layout
+        layout.label(icon='PLUGIN')
+
+    def draw(self, blender_context):
+        layout = self.layout
+        custom_data = blender_context.material.ms3d
+
+        row = layout.row()
+        row.prop(custom_data, 'name')
+
+        col = layout.column()
+        row = col.row()
+        row.prop(custom_data, 'diffuse')
+        row.prop(custom_data, 'ambient')
+        row = col.row()
+        row.prop(custom_data, 'specular')
+        row.prop(custom_data, 'emissive')
+        row = col.row()
+        row.prop(custom_data, 'shininess')
+        row.prop(custom_data, 'transparency')
+
+        col = layout.column()
+        row = col.row()
+        row.prop(custom_data, 'texture')
+        row = col.row()
+        row.prop(custom_data, 'alphamap')
+        row = col.row()
+        row.prop(custom_data, 'mode', expand=True)
+
+        row = layout.row()
+        row.prop(custom_data, 'comment')
+
+        layout.row().operator(
+                Ms3dUi.OPT_MATERIAL_APPLY,
+                text=ms3d_str['ENUM_FROM_BLENDER_1'],
+                icon='APPEND_BLEND').mode = 'FROM_BLENDER'
+        pass
+
+
+class Ms3dBonePanel(Panel):
+    bl_label = ms3d_str['LABEL_PANEL_JOINTS']
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = 'bone'
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object.type in {'ARMATURE', }
+                and blender_context.active_bone
+                and isinstance(blender_context.active_bone, Bone)
+                and blender_context.active_bone.ms3d is not None
+                )
+
+    def draw_header(self, blender_context):
+        layout = self.layout
+        layout.label(icon='PLUGIN')
+
+    def draw(self, blender_context):
+        import bpy
+        layout = self.layout
+        custom_data = blender_context.active_bone.ms3d
+
+        row = layout.row()
+        row.prop(custom_data, 'name')
+        row = layout.row()
+        row.prop(custom_data, 'flags', expand=True)
+        row = layout.row()
+        row.prop(custom_data, 'color')
+        row = layout.row()
+        row.prop(custom_data, 'comment')
+
+
+class Ms3dGroupPanel(Panel):
+    bl_label = ms3d_str['LABEL_PANEL_GROUPS']
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = 'data'
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object
+                and blender_context.object.type in {'MESH', }
+                and blender_context.object.data
+                and blender_context.object.data.ms3d is not None
+                )
+
+    def draw_header(self, blender_context):
+        layout = self.layout
+        layout.label(icon='PLUGIN')
+
+    def draw(self, blender_context):
+        layout = self.layout
+        custom_data = blender_context.object.data.ms3d
+        layout.enabled = (blender_context.mode == 'EDIT_MESH') and (
+                blender_context.tool_settings.mesh_select_mode[2])
+
+        row = layout.row()
+
+        row.template_list(
+                listtype_name='Ms3dGroupUILise',
+                dataptr=custom_data,
+                propname='groups',
+                active_dataptr=custom_data,
+                active_propname='selected_group_index',
+                rows=2,
+                type='DEFAULT',
+                )
+
+        col = row.column(align=True)
+        col.operator(
+                Ms3dUi.OPT_GROUP_APPLY,
+                text="", icon='ZOOMIN').mode = 'ADD_GROUP'
+        col.operator(
+                Ms3dUi.OPT_GROUP_APPLY,
+                text="", icon='ZOOMOUT').mode = 'REMOVE_GROUP'
+
+        index = custom_data.selected_group_index
+        collection = custom_data.groups
+        if (index >= 0 and index < len(collection)):
+            row = layout.row()
+            row.prop(collection[index], 'name')
+
+            row = layout.row()
+            subrow = row.row(align=True)
+            subrow.operator(
+                    Ms3dUi.OPT_GROUP_APPLY,
+                    text=ms3d_str['ENUM_ASSIGN_1']).mode = 'ASSIGN'
+            subrow.operator(
+                    Ms3dUi.OPT_GROUP_APPLY,
+                    text=ms3d_str['ENUM_REMOVE_1']).mode = 'REMOVE'
+            subrow = row.row(align=True)
+            subrow.operator(
+                    Ms3dUi.OPT_GROUP_APPLY,
+                    text=ms3d_str['ENUM_SELECT_1']).mode = 'SELECT'
+            subrow.operator(
+                    Ms3dUi.OPT_GROUP_APPLY,
+                    text=ms3d_str['ENUM_DESELECT_1']).mode = 'DESELECT'
+
+            row = layout.row()
+            row.prop(collection[index], 'flags', expand=True)
+
+            row = layout.row()
+            row.prop(collection[index], 'comment')
+
+
+class Ms3dSmoothingGroupPanel(Panel):
+    bl_label = ms3d_str['BL_LABEL_PANEL_SMOOTHING_GROUP']
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = 'data'
+
+    def preview(self, dict, id, text):
+        item = dict.get(id)
+        if item is None:
+            return "{}".format(text)
+        elif item:
+            return "{}:".format(text)
+
+        return "{}.".format(text)
+
+    def build_preview(self, blender_context):
+        dict = {}
+        if (blender_context.mode != 'EDIT_MESH') or (
+                not blender_context.tool_settings.mesh_select_mode[2]):
+            return dict
+
+        custom_data = blender_context.object.data.ms3d
+        blender_mesh = blender_context.object.data
+        bm = from_edit_mesh(blender_mesh)
+        layer_smoothing_group = bm.faces.layers.int.get(
+                ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
+        if layer_smoothing_group is not None:
+            for bmf in bm.faces:
+                item = dict.get(bmf[layer_smoothing_group])
+                if item is None:
+                    dict[bmf[layer_smoothing_group]] = bmf.select
+                else:
+                    if not item:
+                        dict[bmf[layer_smoothing_group]] = bmf.select
+        return dict
+
+    @classmethod
+    def poll(cls, blender_context):
+        return (blender_context
+                and blender_context.object
+                and blender_context.object.type in {'MESH', }
+                and blender_context.object.data
+                and blender_context.object.data.ms3d is not None
+                )
+
+    def draw_header(self, blender_context):
+        layout = self.layout
+        layout.label(icon='PLUGIN')
+
+    def draw(self, blender_context):
+        dict = self.build_preview(blender_context)
+
+        custom_data = blender_context.object.data.ms3d
+        layout = self.layout
+        layout.enabled = (blender_context.mode == 'EDIT_MESH') and (
+                blender_context.tool_settings.mesh_select_mode[2])
+
+        row = layout.row()
+        subrow = row.row()
+        subrow.prop(custom_data, 'apply_mode', expand=True)
+
+        col = layout.column(align=True)
+        subrow = col.row(align=True)
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 1, "1")
+                ).smoothing_group_index = 1
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 2, "2")
+                ).smoothing_group_index = 2
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 3, "3")
+                ).smoothing_group_index = 3
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 4, "4")
+                ).smoothing_group_index = 4
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 5, "5")
+                ).smoothing_group_index = 5
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 6, "6")
+                ).smoothing_group_index = 6
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 7, "7")
+                ).smoothing_group_index = 7
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 8, "8")
+                ).smoothing_group_index = 8
+        subrow = col.row(align=True)
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 9, "9")
+                ).smoothing_group_index = 9
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 10, "10")
+                ).smoothing_group_index = 10
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 11, "11")
+                ).smoothing_group_index = 11
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 12, "12")
+                ).smoothing_group_index = 12
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 13, "13")
+                ).smoothing_group_index = 13
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 14, "14")
+                ).smoothing_group_index = 14
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 15, "15")
+                ).smoothing_group_index = 15
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 16, "16")
+                ).smoothing_group_index = 16
+        subrow = col.row(align=True)
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 17, "17")
+                ).smoothing_group_index = 17
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 18, "18")
+                ).smoothing_group_index = 18
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 19, "19")
+                ).smoothing_group_index = 19
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 20, "20")
+                ).smoothing_group_index = 20
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 21, "21")
+                ).smoothing_group_index = 21
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 22, "22")
+                ).smoothing_group_index = 22
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 23, "23")
+                ).smoothing_group_index = 23
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 24, "24")
+                ).smoothing_group_index = 24
+        subrow = col.row(align=True)
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 25, "25")
+                ).smoothing_group_index = 25
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 26, "26")
+                ).smoothing_group_index = 26
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 27, "27")
+                ).smoothing_group_index = 27
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 28, "28")
+                ).smoothing_group_index = 28
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 29, "29")
+                ).smoothing_group_index = 29
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 30, "30")
+                ).smoothing_group_index = 30
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 31, "31")
+                ).smoothing_group_index = 31
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 32, "32")
+                ).smoothing_group_index = 32
+        subrow = col.row()
+        subrow.operator(
+                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
+                text=self.preview(dict, 0, ms3d_str['LABEL_PANEL_BUTTON_NONE'])
+                ).smoothing_group_index = 0
+
+
+###############################################################################
+class Ms3dSetSceneToMetricOperator(Operator):
+    """ . """
+    bl_idname = 'io_scene_ms3d.set_sence_to_metric'
+    bl_label = ms3d_str['BL_LABEL_SET_SCENE_TO_METRIC']
+    bl_description = ms3d_str['BL_DESC_SET_SCENE_TO_METRIC']
+
+
+    #
+    @classmethod
+    def poll(cls, blender_context):
+        return True
+
+    # entrypoint for option
+    def execute(self, blender_context):
+        return self.set_sence_to_metric(blender_context)
+
+    # entrypoint for option via UI
+    def invoke(self, blender_context, event):
+        return blender_context.window_manager.invoke_props_dialog(self)
+
+
+    ###########################################################################
+    def set_sence_to_metric(self, blender_context):
+        set_sence_to_metric(blender_context)
+        return {"FINISHED"}
+
+
+###############################################################################
+def register():
+    register_class(Ms3dSetSceneToMetricOperator)
+    register_class(Ms3dGroupProperties)
+    register_class(Ms3dModelProperties)
+    register_class(Ms3dArmatureProperties)
+    register_class(Ms3dJointProperties)
+    register_class(Ms3dMaterialProperties)
+    inject_properties()
+    register_class(Ms3dSetSmoothingGroupOperator)
+    register_class(Ms3dGroupOperator)
+
+def unregister():
+    unregister_class(Ms3dGroupOperator)
+    unregister_class(Ms3dSetSmoothingGroupOperator)
+    delete_properties()
+    unregister_class(Ms3dMaterialProperties)
+    unregister_class(Ms3dJointProperties)
+    unregister_class(Ms3dArmatureProperties)
+    unregister_class(Ms3dModelProperties)
+    unregister_class(Ms3dGroupProperties)
+    unregister_class(Ms3dSetSceneToMetricOperator)
+
+def inject_properties():
+    Mesh.ms3d = PointerProperty(type=Ms3dModelProperties)
+    Armature.ms3d = PointerProperty(type=Ms3dArmatureProperties)
+    Bone.ms3d = PointerProperty(type=Ms3dJointProperties)
+    Material.ms3d = PointerProperty(type=Ms3dMaterialProperties)
+    Action.ms3d = PointerProperty(type=Ms3dArmatureProperties)
+    Group.ms3d = PointerProperty(type=Ms3dGroupProperties)
+
+def delete_properties():
+    del Mesh.ms3d
+    del Armature.ms3d
+    del Bone.ms3d
+    del Material.ms3d
+    del Action.ms3d
+    del Group.ms3d
+
+###############################################################################
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# ##### END OF FILE #####
diff --git a/release/scripts/addons/io_scene_ms3d/ms3d_utils.py b/release/scripts/addons/io_scene_ms3d/ms3d_utils.py
new file mode 100644
index 0000000..c44b19c
--- /dev/null
+++ b/release/scripts/addons/io_scene_ms3d/ms3d_utils.py
@@ -0,0 +1,221 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011-2013 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+#import python stuff
+from os import (
+        path
+        )
+
+
+# import io_scene_ms3d stuff
+from io_scene_ms3d.ms3d_strings import (
+        ms3d_str,
+        )
+
+
+#import blender stuff
+from bpy import (
+        ops,
+        )
+
+
+###############################################################################
+def enable_edit_mode(enable, blender_context):
+    if blender_context.active_object is None \
+            or not blender_context.active_object.type in {'MESH', 'ARMATURE', }:
+        return
+
+    if enable:
+        modeString = 'EDIT'
+    else:
+        modeString = 'OBJECT'
+
+    if ops.object.mode_set.poll():
+        ops.object.mode_set(mode=modeString)
+
+
+###############################################################################
+def enable_pose_mode(enable, blender_context):
+    if blender_context.active_object is None \
+            or not blender_context.active_object.type in {'ARMATURE', }:
+        return
+
+    if enable:
+        modeString = 'POSE'
+    else:
+        modeString = 'OBJECT'
+
+    if ops.object.mode_set.poll():
+        ops.object.mode_set(mode=modeString)
+
+
+###############################################################################
+def select_all(select):
+    if select:
+        actionString = 'SELECT'
+    else:
+        actionString = 'DESELECT'
+
+    if ops.object.select_all.poll():
+        ops.object.select_all(action=actionString)
+
+    if ops.mesh.select_all.poll():
+        ops.mesh.select_all(action=actionString)
+
+    if ops.pose.select_all.poll():
+        ops.pose.select_all(action=actionString)
+
+
+###############################################################################
+def pre_setup_environment(porter, blender_context):
+    # inject undo to porter
+    # and turn off undo
+    porter.undo = blender_context.user_preferences.edit.use_global_undo
+    blender_context.user_preferences.edit.use_global_undo = False
+
+    # inject active_object to self
+    porter.active_object = blender_context.scene.objects.active
+
+    # change to a well defined mode
+    enable_edit_mode(True, blender_context)
+
+    # enable face-selection-mode
+    blender_context.tool_settings.mesh_select_mode = (False, False, True)
+
+    # change back to object mode
+    enable_edit_mode(False, blender_context)
+
+    blender_context.scene.update()
+
+
+###############################################################################
+def post_setup_environment(porter, blender_context):
+    # restore active object
+    blender_context.scene.objects.active = porter.active_object
+
+    if not blender_context.scene.objects.active \
+            and blender_context.selected_objects:
+        blender_context.scene.objects.active \
+                = blender_context.selected_objects[0]
+
+    # restore pre operator undo state
+    blender_context.user_preferences.edit.use_global_undo = porter.undo
+
+
+###############################################################################
+def get_edge_split_modifier_add_if(blender_mesh_object):
+    blender_modifier = blender_mesh_object.modifiers.get(
+            ms3d_str['OBJECT_MODIFIER_SMOOTHING_GROUP'])
+
+    if blender_modifier is None:
+        blender_modifier = blender_mesh_object.modifiers.new(
+                ms3d_str['OBJECT_MODIFIER_SMOOTHING_GROUP'],
+                type='EDGE_SPLIT')
+        blender_modifier.show_expanded = False
+        blender_modifier.use_edge_angle = False
+        blender_modifier.use_edge_sharp = True
+
+        blender_mesh_object.data.show_edge_seams = True
+        blender_mesh_object.data.show_edge_sharp = True
+
+    return blender_modifier
+
+
+###########################################################################
+def rotation_matrix(v_track, v_up):
+    ## rotation matrix from two vectors
+    ## http://gamedev.stackexchange.com/questions/20097/how-to-calculate-a-3x3-rotation-matrix-from-2-direction-vectors
+    ## http://www.fastgraph.com/makegames/3drotation/
+    matrix = Matrix().to_3x3()
+
+    c1 = v_track
+    c1.normalize()
+
+    c0 = c1.cross(v_up)
+    c0.normalize()
+
+    c2 = c0.cross(c1)
+    c2.normalize()
+
+    matrix.col[0] = c0
+    matrix.col[1] = c1
+    matrix.col[2] = c2
+
+    return matrix
+
+
+###############################################################################
+def matrix_difference(mat_src, mat_dst):
+    mat_dst_inv = mat_dst.inverted()
+    return mat_dst_inv * mat_src
+
+
+###############################################################################
+def set_sence_to_metric(blender_context):
+    try:
+        # set metrics
+        blender_context.scene.unit_settings.system = 'METRIC'
+        blender_context.scene.unit_settings.system_rotation = 'DEGREES'
+        blender_context.scene.unit_settings.scale_length = 0.001 # 1.0mm
+        blender_context.scene.unit_settings.use_separate = False
+        blender_context.tool_settings.normal_size = 1.0 # 1.0mm
+
+        # set all 3D views to texture shaded
+        # and set up the clipping
+        for screen in blender_context.blend_data.screens:
+            for area in screen.areas:
+                if (area.type != 'VIEW_3D'):
+                    continue
+
+                for space in area.spaces:
+                    if (space.type != 'VIEW_3D'):
+                        continue
+
+                    #space.viewport_shade = 'SOLID'
+                    space.show_textured_solid = True
+                    space.clip_start = 0.1 # 0.1mm
+                    space.clip_end = 1000000.0 # 1km
+            #screen.scene.game_settings.material_mode = 'MULTITEXTURE'
+
+    except Exception:
+        raise
+
+    else:
+        pass
+
+
+###############################################################################
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# ##### END OF FILE #####
diff --git a/release/scripts/addons/io_scene_obj/__init__.py b/release/scripts/addons/io_scene_obj/__init__.py
index 501dc4b..a2b97bf 100644
--- a/release/scripts/addons/io_scene_obj/__init__.py
+++ b/release/scripts/addons/io_scene_obj/__init__.py
@@ -221,7 +221,7 @@ class ExportOBJ(bpy.types.Operator, ExportHelper):
             )
 
     # object group
-    use_apply_modifiers = BoolProperty(
+    use_mesh_modifiers = BoolProperty(
             name="Apply Modifiers",
             description="Apply modifiers (preview resolution)",
             default=True,
diff --git a/release/scripts/addons/io_scene_obj/export_obj.py b/release/scripts/addons/io_scene_obj/export_obj.py
index a0926cc..90d6931 100644
--- a/release/scripts/addons/io_scene_obj/export_obj.py
+++ b/release/scripts/addons/io_scene_obj/export_obj.py
@@ -33,6 +33,15 @@ def name_compat(name):
         return name.replace(' ', '_')
 
 
+def mesh_triangulate(me):
+    import bmesh
+    bm = bmesh.new()
+    bm.from_mesh(me)
+    bmesh.ops.triangulate(bm, faces=bm.faces)
+    bm.to_mesh(me)
+    bm.free()
+
+
 def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
     from mathutils import Color
 
@@ -115,7 +124,7 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
             image_map = {}
             # backwards so topmost are highest priority
             for mtex in reversed(mat.texture_slots):
-                if mtex and mtex.texture.type == 'IMAGE':
+                if mtex and mtex.texture and mtex.texture.type == 'IMAGE':
                     image = mtex.texture.image
                     if image:
                         # texface overrides others
@@ -350,7 +359,7 @@ def write_file(filepath, objects, scene,
             # END NURBS
 
             try:
-                me = ob.to_mesh(scene, EXPORT_APPLY_MODIFIERS, 'PREVIEW')
+                me = ob.to_mesh(scene, EXPORT_APPLY_MODIFIERS, 'PREVIEW', calc_tessface=False)
             except RuntimeError:
                 me = None
 
@@ -359,17 +368,22 @@ def write_file(filepath, objects, scene,
 
             me.transform(EXPORT_GLOBAL_MATRIX * ob_mat)
 
+            if EXPORT_TRI:
+                # _must_ do this first since it re-allocs arrays
+                mesh_triangulate(me)
+
             if EXPORT_UV:
                 faceuv = len(me.uv_textures) > 0
                 if faceuv:
-                    uv_layer = me.tessface_uv_textures.active.data[:]
+                    uv_texture = me.uv_textures.active.data[:]
+                    uv_layer = me.uv_layers.active.data[:]
             else:
                 faceuv = False
 
             me_verts = me.vertices[:]
 
             # Make our own list so it can be sorted to reduce context switching
-            face_index_pairs = [(face, index) for index, face in enumerate(me.tessfaces)]
+            face_index_pairs = [(face, index) for index, face in enumerate(me.polygons)]
             # faces = [ f for f in me.tessfaces ]
 
             if EXPORT_EDGES:
@@ -400,7 +414,7 @@ def write_file(filepath, objects, scene,
             if EXPORT_KEEP_VERT_ORDER:
                 pass
             elif faceuv:
-                face_index_pairs.sort(key=lambda a: (a[0].material_index, hash(uv_layer[a[1]].image), a[0].use_smooth))
+                face_index_pairs.sort(key=lambda a: (a[0].material_index, hash(uv_texture[a[1]].image), a[0].use_smooth))
             elif len(materials) > 1:
                 face_index_pairs.sort(key=lambda a: (a[0].material_index, a[0].use_smooth))
             else:
@@ -433,22 +447,25 @@ def write_file(filepath, objects, scene,
                 # in case removing some of these dont get defined.
                 uv = uvkey = uv_dict = f_index = uv_index = None
 
-                uv_face_mapping = [[0, 0, 0, 0] for i in range(len(face_index_pairs))]  # a bit of a waste for tri's :/
+                uv_face_mapping = [None] * len(face_index_pairs)
 
                 uv_dict = {}  # could use a set() here
-                uv_layer = me.tessface_uv_textures.active.data
                 for f, f_index in face_index_pairs:
-                    for uv_index, uv in enumerate(uv_layer[f_index].uv):
+                    uv_ls = uv_face_mapping[f_index] = []
+                    for uv_index, l_index in enumerate(f.loop_indices):
+                        uv = uv_layer[l_index].uv
+
                         uvkey = veckey2d(uv)
                         try:
-                            uv_face_mapping[f_index][uv_index] = uv_dict[uvkey]
+                            uv_k = uv_dict[uvkey]
                         except:
-                            uv_face_mapping[f_index][uv_index] = uv_dict[uvkey] = len(uv_dict)
+                            uv_k = uv_dict[uvkey] = len(uv_dict)
                             fw('vt %.6f %.6f\n' % uv[:])
+                        uv_ls.append(uv_k)
 
                 uv_unique_count = len(uv_dict)
 
-                del uv, uvkey, uv_dict, f_index, uv_index
+                del uv, uvkey, uv_dict, f_index, uv_index, uv_ls, uv_k
                 # Only need uv_unique_count and uv_face_mapping
 
             # NORMAL, Smooth/Non smoothed.
@@ -489,7 +506,7 @@ def write_file(filepath, objects, scene,
                 f_mat = min(f.material_index, len(materials) - 1)
 
                 if faceuv:
-                    tface = uv_layer[f_index]
+                    tface = uv_texture[f_index]
                     f_image = tface.image
 
                 # MAKE KEY
@@ -559,61 +576,53 @@ def write_file(filepath, objects, scene,
                         fw('s off\n')
                         contextSmooth = f_smooth
 
-                f_v_orig = [(vi, me_verts[v_idx]) for vi, v_idx in enumerate(f.vertices)]
+                f_v = [(vi, me_verts[v_idx]) for vi, v_idx in enumerate(f.vertices)]
 
-                if not EXPORT_TRI or len(f_v_orig) == 3:
-                    f_v_iter = (f_v_orig, )
-                else:
-                    f_v_iter = (f_v_orig[0], f_v_orig[1], f_v_orig[2]), (f_v_orig[0], f_v_orig[2], f_v_orig[3])
-
-                # support for triangulation
-                for f_v in f_v_iter:
-                    fw('f')
-
-                    if faceuv:
-                        if EXPORT_NORMALS:
-                            if f_smooth:  # Smoothed, use vertex normals
-                                for vi, v in f_v:
-                                    fw(" %d/%d/%d" %
-                                               (v.index + totverts,
-                                                totuvco + uv_face_mapping[f_index][vi],
-                                                globalNormals[veckey3d(v.normal)],
-                                                ))  # vert, uv, normal
-
-                            else:  # No smoothing, face normals
-                                no = globalNormals[veckey3d(f.normal)]
-                                for vi, v in f_v:
-                                    fw(" %d/%d/%d" %
-                                               (v.index + totverts,
-                                                totuvco + uv_face_mapping[f_index][vi],
-                                                no,
-                                                ))  # vert, uv, normal
-                        else:  # No Normals
+                fw('f')
+                if faceuv:
+                    if EXPORT_NORMALS:
+                        if f_smooth:  # Smoothed, use vertex normals
+                            for vi, v in f_v:
+                                fw(" %d/%d/%d" %
+                                           (v.index + totverts,
+                                            totuvco + uv_face_mapping[f_index][vi],
+                                            globalNormals[veckey3d(v.normal)],
+                                            ))  # vert, uv, normal
+
+                        else:  # No smoothing, face normals
+                            no = globalNormals[veckey3d(f.normal)]
+                            for vi, v in f_v:
+                                fw(" %d/%d/%d" %
+                                           (v.index + totverts,
+                                            totuvco + uv_face_mapping[f_index][vi],
+                                            no,
+                                            ))  # vert, uv, normal
+                    else:  # No Normals
+                        for vi, v in f_v:
+                            fw(" %d/%d" % (
+                                       v.index + totverts,
+                                       totuvco + uv_face_mapping[f_index][vi],
+                                       ))  # vert, uv
+
+                    face_vert_index += len(f_v)
+
+                else:  # No UV's
+                    if EXPORT_NORMALS:
+                        if f_smooth:  # Smoothed, use vertex normals
                             for vi, v in f_v:
-                                fw(" %d/%d" % (
+                                fw(" %d//%d" % (
                                            v.index + totverts,
-                                           totuvco + uv_face_mapping[f_index][vi],
-                                           ))  # vert, uv
-
-                        face_vert_index += len(f_v)
-
-                    else:  # No UV's
-                        if EXPORT_NORMALS:
-                            if f_smooth:  # Smoothed, use vertex normals
-                                for vi, v in f_v:
-                                    fw(" %d//%d" % (
-                                               v.index + totverts,
-                                               globalNormals[veckey3d(v.normal)],
-                                               ))
-                            else:  # No smoothing, face normals
-                                no = globalNormals[veckey3d(f.normal)]
-                                for vi, v in f_v:
-                                    fw(" %d//%d" % (v.index + totverts, no))
-                        else:  # No Normals
+                                           globalNormals[veckey3d(v.normal)],
+                                           ))
+                        else:  # No smoothing, face normals
+                            no = globalNormals[veckey3d(f.normal)]
                             for vi, v in f_v:
-                                fw(" %d" % (v.index + totverts))
+                                fw(" %d//%d" % (v.index + totverts, no))
+                    else:  # No Normals
+                        for vi, v in f_v:
+                            fw(" %d" % (v.index + totverts))
 
-                    fw('\n')
+                fw('\n')
 
             # Write edges.
             if EXPORT_EDGES:
@@ -732,7 +741,7 @@ def save(operator, context, filepath="",
          use_normals=False,
          use_uvs=True,
          use_materials=True,
-         use_apply_modifiers=True,
+         use_mesh_modifiers=True,
          use_blen_objects=True,
          group_by_object=False,
          group_by_material=False,
@@ -751,7 +760,7 @@ def save(operator, context, filepath="",
            EXPORT_NORMALS=use_normals,
            EXPORT_UV=use_uvs,
            EXPORT_MTL=use_materials,
-           EXPORT_APPLY_MODIFIERS=use_apply_modifiers,
+           EXPORT_APPLY_MODIFIERS=use_mesh_modifiers,
            EXPORT_BLEN_OBS=use_blen_objects,
            EXPORT_GROUP_BY_OB=group_by_object,
            EXPORT_GROUP_BY_MAT=group_by_material,
diff --git a/release/scripts/addons/io_scene_obj/import_obj.py b/release/scripts/addons/io_scene_obj/import_obj.py
index f9d7543..72c17bf 100644
--- a/release/scripts/addons/io_scene_obj/import_obj.py
+++ b/release/scripts/addons/io_scene_obj/import_obj.py
@@ -39,6 +39,25 @@ from bpy_extras.io_utils import unpack_list, unpack_face_list
 from bpy_extras.image_utils import load_image
 
 
+def mesh_untessellate(me, fgon_edges):
+    import bmesh
+    bm = bmesh.new()
+    bm.from_mesh(me)
+    verts = bm.verts[:]
+    get = bm.edges.get
+    edges = [get((verts[key[0]], verts[key[1]])) for key in fgon_edges]
+    try:
+        bmesh.ops.dissolve_edges(bm, edges=edges, use_verts=False)
+    except:
+        # Possible dissolve fails for some edges
+        # but dont fail silently unless this is a real bug.
+        import traceback
+        traceback.print_exc()
+
+    bm.to_mesh(me)
+    bm.free()
+
+
 def line_value(line_split):
     """
     Returns 1 string represneting the value for this line
@@ -88,7 +107,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
         has_data = False
         image_depth = 0
 
-        if image:
+        if image is not None:
             texture.image = image
             # note, this causes the image to load, see: [#32637]
             # which makes the following has_data work as expected.
@@ -108,7 +127,8 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
 
                 texture.use_mipmap = True
                 texture.use_interpolation = True
-                texture.use_alpha = True
+                if image is not None:
+                    image.use_alpha = True
                 blender_material.use_transparency = True
                 if "alpha" not in context_material_vars:
                     blender_material.alpha = 0.0
@@ -452,7 +472,7 @@ def create_mesh(new_objects,
         context_smooth_group_old = -1
 
     # Split ngons into tri's
-    fgon_edges = {}  # Used for storing fgon keys
+    fgon_edges = set()  # Used for storing fgon keys
     if use_edges:
         edges = []
 
@@ -536,7 +556,7 @@ def create_mesh(new_objects,
 
                     for key, users in edge_users.items():
                         if users > 1:
-                            fgon_edges[key] = None
+                            fgon_edges.add(key)
 
                 # remove all after 3, means we dont have to pop this one.
                 faces.pop(f_idx)
@@ -678,19 +698,7 @@ def create_mesh(new_objects,
         bm.free()
         del bm
 
-    # XXX slow
-#     if use_ngons and fgon_edges:
-#         for fgon_edge in fgon_edges.keys():
-#             for ed in me.edges:
-#                 if edges_match(fgon_edge, ed.vertices):
-#                     ed.is_fgon = True
-
-#     if use_ngons and fgon_edges:
-#         FGON= Mesh.EdgeFlags.FGON
-#         for ed in me.findEdges( fgon_edges.keys() ):
-#             if ed is not None:
-#                 me_edges[ed].flag |= FGON
-#         del FGON
+    mesh_untessellate(me, fgon_edges)
 
     # XXX slow
 #     if unique_smooth_groups and sharp_edges:
diff --git a/release/scripts/addons/io_scene_x3d/__init__.py b/release/scripts/addons/io_scene_x3d/__init__.py
index 1440684..6bf6401 100644
--- a/release/scripts/addons/io_scene_x3d/__init__.py
+++ b/release/scripts/addons/io_scene_x3d/__init__.py
@@ -109,7 +109,7 @@ class ExportX3D(bpy.types.Operator, ExportHelper):
             description="Export selected objects only",
             default=False,
             )
-    use_apply_modifiers = BoolProperty(
+    use_mesh_modifiers = BoolProperty(
             name="Apply Modifiers",
             description="Use transformed mesh data from each object",
             default=True,
diff --git a/release/scripts/addons/io_scene_x3d/export_x3d.py b/release/scripts/addons/io_scene_x3d/export_x3d.py
index eb5d346..477e6c2 100644
--- a/release/scripts/addons/io_scene_x3d/export_x3d.py
+++ b/release/scripts/addons/io_scene_x3d/export_x3d.py
@@ -239,7 +239,7 @@ def h3d_is_object_view(scene, obj):
 def export(file,
            global_matrix,
            scene,
-           use_apply_modifiers=False,
+           use_mesh_modifiers=False,
            use_selection=True,
            use_triangulate=False,
            use_normals=False,
@@ -1399,12 +1399,17 @@ def export(file,
 
             ident = writeTransform_begin(ident, obj_main_matrix if obj_main_parent else global_matrix * obj_main_matrix, suffix_quoted_str(obj_main_id, _TRANSFORM))
 
+        # Set here just incase we dont enter the loop below.
+        is_dummy_tx = False
+
         for obj, obj_matrix in (() if derived is None else derived):
             obj_type = obj.type
 
             if use_hierarchy:
                 # make transform node relative
                 obj_matrix = obj_main_matrix_world_invert * obj_matrix
+            else:
+                obj_matrix = global_matrix * obj_matrix
 
             # H3D - use for writing a dummy transform parent
             is_dummy_tx = False
@@ -1423,9 +1428,9 @@ def export(file,
                     ident += '\t'
 
             elif obj_type in {'MESH', 'CURVE', 'SURFACE', 'FONT'}:
-                if (obj_type != 'MESH') or (use_apply_modifiers and obj.is_modified(scene, 'PREVIEW')):
+                if (obj_type != 'MESH') or (use_mesh_modifiers and obj.is_modified(scene, 'PREVIEW')):
                     try:
-                        me = obj.to_mesh(scene, use_apply_modifiers, 'PREVIEW')
+                        me = obj.to_mesh(scene, use_mesh_modifiers, 'PREVIEW')
                     except:
                         me = None
                     do_remove = True
@@ -1563,7 +1568,7 @@ def gzip_open_utf8(filepath, mode):
 
 def save(operator, context, filepath="",
          use_selection=True,
-         use_apply_modifiers=False,
+         use_mesh_modifiers=False,
          use_triangulate=False,
          use_normals=False,
          use_compress=False,
@@ -1590,7 +1595,7 @@ def save(operator, context, filepath="",
     export(file,
            global_matrix,
            context.scene,
-           use_apply_modifiers=use_apply_modifiers,
+           use_mesh_modifiers=use_mesh_modifiers,
            use_selection=use_selection,
            use_triangulate=use_triangulate,
            use_normals=use_normals,
diff --git a/release/scripts/addons/io_scene_x3d/import_x3d.py b/release/scripts/addons/io_scene_x3d/import_x3d.py
index 1cfb283..6472f65 100644
--- a/release/scripts/addons/io_scene_x3d/import_x3d.py
+++ b/release/scripts/addons/io_scene_x3d/import_x3d.py
@@ -28,7 +28,7 @@ import shlex
 def imageConvertCompat(path):
 
     if os.sep == '\\':
-        return path  # assime win32 has quicktime, dont convert
+        return path  # assume win32 has quicktime, dont convert
 
     if path.lower().endswith('.gif'):
         path_to = path[:-3] + 'png'
@@ -1684,6 +1684,7 @@ def importMesh_IndexedFaceSet(geom, bpyima, ancestry):
 
     if len(bpymesh.tessfaces) != len(faces):
         print('\tWarning: adding faces did not work! file is invalid, not adding UVs or vcolors')
+        bpymesh.update()
         return bpymesh, ccw
 
     # Apply UVs if we have them
diff --git a/release/scripts/addons/mesh_f2.py b/release/scripts/addons/mesh_f2.py
new file mode 100644
index 0000000..b06bb19
--- /dev/null
+++ b/release/scripts/addons/mesh_f2.py
@@ -0,0 +1,298 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+bl_info = {
+    'name': "F2",
+    'author': "Bart Crouch",
+    'version': (1, 4, 0),
+    'blender': (2, 65, 9),
+    'location': "Editmode > F",
+    'warning': "",
+    'description': "Extends the 'Make Edge/Face' functionality",
+    'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
+        "Scripts/Modeling/F2",
+    'tracker_url': "http://projects.blender.org/tracker/index.php?"\
+        "func=detail&aid=33979",
+    'category': 'Mesh'}
+
+
+import bmesh
+import bpy
+import itertools
+import mathutils
+from bpy_extras import view3d_utils
+
+
+# create a face from a single selected edge
+def quad_from_edge(bm, edge_sel, context, event):
+    ob = context.active_object
+    region = context.region
+    region_3d = context.space_data.region_3d
+
+    # find linked edges that are open (<2 faces connected) and not part of
+    # the face the selected edge belongs to
+    all_edges = [[edge for edge in edge_sel.verts[i].link_edges if \
+        len(edge.link_faces) < 2 and edge != edge_sel and \
+        sum([face in edge_sel.link_faces for face in edge.link_faces]) == 0] \
+        for i in range(2)]
+    if not all_edges[0] or not all_edges[1]:
+        return
+
+    # determine which edges to use, based on mouse cursor position
+    mouse_pos = mathutils.Vector([event.mouse_region_x, event.mouse_region_y])
+    optimal_edges = []
+    for edges in all_edges:
+        min_dist = False
+        for edge in edges:
+            vert = [vert for vert in edge.verts if not vert.select][0]
+            world_pos = ob.matrix_world * vert.co.copy()
+            screen_pos = view3d_utils.location_3d_to_region_2d(region,
+                region_3d, world_pos)
+            dist = (mouse_pos - screen_pos).length
+            if not min_dist or dist < min_dist[0]:
+                min_dist = (dist, edge, vert)
+        optimal_edges.append(min_dist)
+
+    # determine the vertices, which make up the quad
+    v1 = edge_sel.verts[0]
+    v2 = edge_sel.verts[1]
+    edge_1 = optimal_edges[0][1]
+    edge_2 = optimal_edges[1][1]
+    v3 = optimal_edges[0][2]
+    v4 = optimal_edges[1][2]
+
+    # normal detection
+    flip_align = True
+    normal_edge = edge_1
+    if not normal_edge.link_faces:
+        normal_edge = edge_2
+        if not normal_edge.link_faces:
+            normal_edge = edge_sel
+            if not normal_edge.link_faces:
+                # no connected faces, so no need to flip the face normal
+                flip_align = False
+    if flip_align: # there is a face to which the normal can be aligned
+        ref_verts = [v for v in normal_edge.link_faces[0].verts]
+        if v3 in ref_verts:
+            va_1 = v3
+            va_2 = v1
+        elif normal_edge == edge_sel:
+            va_1 = v1
+            va_2 = v2
+        else:
+            va_1 = v2
+            va_2 = v4
+        if (va_1 == ref_verts[0] and va_2 == ref_verts[-1]) or \
+        (va_2 == ref_verts[0] and va_1 == ref_verts[-1]):
+            # reference verts are at start and end of the list -> shift list
+            ref_verts = ref_verts[1:] + [ref_verts[0]]
+        if ref_verts.index(va_1) > ref_verts.index(va_2):
+            # connected face has same normal direction, so don't flip
+            flip_align = False
+
+    # material index detection
+    ref_faces = edge_sel.link_faces
+    if not ref_faces:
+        ref_faces = edge_sel.verts[0].link_faces
+    if not ref_faces:
+        ref_faces = edge_sel.verts[1].link_faces
+    if not ref_faces:
+        mat_index = False
+        smooth = False
+    else:
+        mat_index = ref_faces[0].material_index
+        smooth = ref_faces[0].smooth
+
+    # create quad
+    try:
+        verts = [v3, v1, v2, v4]
+        if flip_align:
+            verts.reverse()
+        face = bm.faces.new(verts)
+        if mat_index:
+            face.material_index = mat_index
+        face.smooth = smooth
+    except:
+        # face already exists
+        return
+
+    # change selection
+    edge_sel.select = False
+    for vert in edge_sel.verts:
+        vert.select = False
+    for edge in face.edges:
+        if edge.index < 0:
+            edge.select = True
+    v3.select = True
+    v4.select = True
+
+    # toggle mode, to force correct drawing
+    bpy.ops.object.mode_set(mode='OBJECT')
+    bpy.ops.object.mode_set(mode='EDIT')
+
+
+# create a face from a single selected vertex, if it is an open vertex
+def quad_from_vertex(bm, vert_sel, context, event):
+    ob = context.active_object
+    region = context.region
+    region_3d = context.space_data.region_3d
+
+    # find linked edges that are open (<2 faces connected)
+    edges = [edge for edge in vert_sel.link_edges if len(edge.link_faces) < 2]
+    if len(edges) < 2:
+        return
+
+    # determine which edges to use, based on mouse cursor position
+    min_dist = False
+    mouse_pos = mathutils.Vector([event.mouse_region_x, event.mouse_region_y])
+    for a, b in itertools.combinations(edges, 2):
+        other_verts = [vert for edge in [a, b] for vert in edge.verts \
+            if not vert.select]
+        mid_other = (other_verts[0].co.copy() + other_verts[1].co.copy()) \
+            / 2
+        new_pos = 2 * (mid_other - vert_sel.co.copy()) + vert_sel.co.copy()
+        world_pos = ob.matrix_world * new_pos
+        screen_pos = view3d_utils.location_3d_to_region_2d(region, region_3d,
+            world_pos)
+        dist = (mouse_pos - screen_pos).length
+        if not min_dist or dist < min_dist[0]:
+            min_dist = (dist, (a, b), other_verts, new_pos)
+
+    # create vertex at location mirrored in the line, connecting the open edges
+    edges = min_dist[1]
+    other_verts = min_dist[2]
+    new_pos = min_dist[3]
+    vert_new = bm.verts.new(new_pos)
+
+    # normal detection
+    flip_align = True
+    normal_edge = edges[0]
+    if not normal_edge.link_faces:
+        normal_edge = edges[1]
+        if not normal_edge.link_faces:
+            # no connected faces, so no need to flip the face normal
+                flip_align = False
+    if flip_align: # there is a face to which the normal can be aligned
+        ref_verts = [v for v in normal_edge.link_faces[0].verts]
+        if other_verts[0] in ref_verts:
+            va_1 = other_verts[0]
+            va_2 = vert_sel
+        else:
+            va_1 = vert_sel
+            va_2 = other_verts[1]
+        if (va_1 == ref_verts[0] and va_2 == ref_verts[-1]) or \
+        (va_2 == ref_verts[0] and va_1 == ref_verts[-1]):
+            # reference verts are at start and end of the list -> shift list
+            ref_verts = ref_verts[1:] + [ref_verts[0]]
+        if ref_verts.index(va_1) > ref_verts.index(va_2):
+            # connected face has same normal direction, so don't flip
+            flip_align = False
+
+    # material index detection
+    ref_faces = vert_sel.link_faces
+    if not ref_faces:
+        mat_index = False
+        smooth = False
+    else:
+        mat_index = ref_faces[0].material_index
+        smooth = ref_faces[0].smooth
+
+    # create face between all 4 vertices involved
+    verts = [other_verts[0], vert_sel, other_verts[1], vert_new]
+    if flip_align:
+        verts.reverse()
+    face = bm.faces.new(verts)
+    if mat_index:
+        face.material_index = mat_index
+    face.smooth = smooth
+
+    # change selection
+    vert_new.select = True
+    vert_sel.select = False
+
+    # toggle mode, to force correct drawing
+    bpy.ops.object.mode_set(mode='OBJECT')
+    bpy.ops.object.mode_set(mode='EDIT')
+
+
+class MeshF2(bpy.types.Operator):
+    """Tooltip"""
+    bl_idname = "mesh.f2"
+    bl_label = "Make Edge/Face"
+    bl_description = "Extends the 'Make Edge/Face' functionality"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    @classmethod
+    def poll(cls, context):
+        # check we are in mesh editmode
+        ob = context.active_object
+        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
+
+    def invoke(self, context, event):
+        bm = bmesh.from_edit_mesh(context.active_object.data)
+        sel = [v for v in bm.verts if v.select]
+        if len(sel) > 2:
+            # original 'Make Edge/Face' behaviour
+            bpy.ops.mesh.edge_face_add()
+        elif len(sel) == 1:
+            # single vertex selected -> mirror vertex and create new face
+            quad_from_vertex(bm, sel[0], context, event)
+        elif len(sel) == 2:
+            edges_sel = [ed for ed in bm.edges if ed.select]
+            if len(edges_sel) != 1:
+                # 2 vertices selected, but not on the same edge
+                bpy.ops.mesh.edge_face_add()
+            else:
+                # single edge selected -> new face from linked open edges
+                quad_from_edge(bm, edges_sel[0], context, event)
+
+        return {'FINISHED'}
+
+
+# registration
+classes = [MeshF2]
+addon_keymaps = []
+
+
+def register():
+    # add operator
+    for c in classes:
+        bpy.utils.register_class(c)
+
+    # add keymap entry
+    km = bpy.context.window_manager.keyconfigs.addon.keymaps.new(\
+        name='Mesh', space_type='EMPTY')
+    kmi = km.keymap_items.new("mesh.f2", 'F', 'PRESS')
+    addon_keymaps.append(km)
+
+
+def unregister():
+    # remove operator
+    for c in classes:
+        bpy.utils.unregister_class(c)
+
+    # remove keymap entry
+    for km in addon_keymaps:
+        bpy.context.window_manager.keyconfigs.addon.keymaps.remove(km)
+    addon_keymaps.clear()
+
+
+if __name__ == "__main__":
+    register()
\ No newline at end of file
diff --git a/release/scripts/addons/modules/extensions_framework/ui.py b/release/scripts/addons/modules/extensions_framework/ui.py
index 2533a66..043b807 100644
--- a/release/scripts/addons/modules/extensions_framework/ui.py
+++ b/release/scripts/addons/modules/extensions_framework/ui.py
@@ -295,7 +295,7 @@ class property_group_renderer(bpy.types.Panel):
                                 )
 
                             elif current_property['type'] in ['template_list']:
-                                layout.template_list("UI_UL_list", "",
+                                layout.template_list("UI_UL_list", current_property['src_attr'],  # Use that as uid...
                                     current_property['src'](supercontext, context),
                                     current_property['src_attr'],
                                     current_property['trg'](supercontext, context),
diff --git a/release/scripts/addons/modules/rna_wiki_reference.py b/release/scripts/addons/modules/rna_wiki_reference.py
index ad3ad58..8501311 100644
--- a/release/scripts/addons/modules/rna_wiki_reference.py
+++ b/release/scripts/addons/modules/rna_wiki_reference.py
@@ -82,12 +82,24 @@ url_manual_prefix = url_manual_prefix \
 
 url_manual_mapping = (
 
+    # *** User Prefs ***
+    ("bpy.types.UserPreferences.*",                "Preferences"),
+    ("bpy.types.UserPreferencesView.*",            "Preferences/Interface"),
+    ("bpy.types.UserPreferencesEdit.*",            "Preferences/Editing"),
+    ("bpy.types.UserPreferencesInput.*",           "Preferences/Input"),
+    ("bpy.ops.wm.addon_*",                         "Preferences/Addons"),
+    ("bpy.types.Theme.*",                          "Preferences/Themes"),
+    ("bpy.types.UserPreferencesFilePaths.*",       "Preferences/File"),
+    ("bpy.types.UserPreferencesSystem.*",          "Preferences/System"),
+    ("bpy.types.UserSolidLight.*",                 "Preferences/System"),
+
     # *** Modifiers ***
     # --- Intro ---
     ("bpy.types.Modifier.show_*", "Modifiers/The_Stack"),
     ("bpy.types.Modifier.*", "Modifiers"),  # catchall for various generic options
     # --- Modify Modifiers ---
     ("bpy.types.UVProjectModifier.*",              "Modifiers/Modify/UV_Project"),
+    ("bpy.types.UVWarpModifier.*",                 "Modifiers/Modify/UV_Warp"),
     ("bpy.types.VertexWeightMixModifier.*",        "Modifiers/Modify/Vertex_Weight"),
     ("bpy.types.VertexWeightEditModifier.*",       "Modifiers/Modify/Vertex_Weight"),
     ("bpy.types.VertexWeightProximityModifier.*",  "Modifiers/Modify/Vertex_Weight"),
@@ -112,7 +124,9 @@ url_manual_mapping = (
     ("bpy.types.DisplaceModifier.*",      "Modifiers/Deform/Displace"),
     ("bpy.types.DynamicPaintModifier.*",  "Physics/Dynamic_Paint"),
     ("bpy.types.HookModifier.*",          "Modifiers/Deform/Hooks"),
+    ("bpy.types.LaplacianSmoothModifier.*", "Modifiers/Deform/Laplacian_Smooth"),
     ("bpy.types.LatticeModifier.*",       "Modifiers/Deform/Lattice"),
+    ("bpy.types.MeshCacheModifier.*",     "Modifiers/Deform/Mesh_Cache"),
     ("bpy.types.MeshDeformModifier.*",    "Modifiers/Deform/Mesh_Deform"),
     ("bpy.types.RemeshModifier.*",        "Modifiers/Deform/"),
     ("bpy.types.ShrinkwrapModifier.*",    "Modifiers/Deform/Shrinkwrap"),
diff --git a/release/scripts/addons/netrender/ui.py b/release/scripts/addons/netrender/ui.py
index 9d032cf..2b352a5 100644
--- a/release/scripts/addons/netrender/ui.py
+++ b/release/scripts/addons/netrender/ui.py
@@ -276,7 +276,8 @@ class RENDER_PT_network_slaves(NeedValidAddress, NetRenderButtonsPanel, bpy.type
         netsettings = context.scene.network_render
 
         row = layout.row()
-        row.template_list("UI_UL_list", "", netsettings, "slaves", netsettings, "active_slave_index", rows=2)
+        row.template_list("UI_UL_list", "net_render_slaves", netsettings, "slaves",
+                          netsettings, "active_slave_index", rows=2)
 
         sub = row.column(align=True)
         sub.operator("render.netclientslaves", icon='FILE_REFRESH', text="")
@@ -307,7 +308,7 @@ class RENDER_PT_network_slaves_blacklist(NeedValidAddress, NetRenderButtonsPanel
         netsettings = context.scene.network_render
 
         row = layout.row()
-        row.template_list("UI_UL_list", "", netsettings, "slaves_blacklist",
+        row.template_list("UI_UL_list", "net_render_slaves_blacklist", netsettings, "slaves_blacklist",
                           netsettings, "active_blacklisted_slave_index", rows=2)
 
         sub = row.column(align=True)
@@ -338,7 +339,7 @@ class RENDER_PT_network_jobs(NeedValidAddress, NetRenderButtonsPanel, bpy.types.
         netsettings = context.scene.network_render
 
         row = layout.row()
-        row.template_list("UI_UL_list", "", netsettings, "jobs", netsettings, "active_job_index", rows=2)
+        row.template_list("UI_UL_list", "net_render", netsettings, "jobs", netsettings, "active_job_index", rows=2)
 
         sub = row.column(align=True)
         sub.operator("render.netclientstatus", icon='FILE_REFRESH', text="")
diff --git a/release/scripts/addons/object_animrenderbake.py b/release/scripts/addons/object_animrenderbake.py
index e8dc0c1..c43b4f8 100644
--- a/release/scripts/addons/object_animrenderbake.py
+++ b/release/scripts/addons/object_animrenderbake.py
@@ -20,17 +20,17 @@ bl_info = {
     "name": "Animated Render Baker",
     "author": "Janne Karhu (jahka)",
     "version": (1, 0),
-    "blender": (2, 58, 0),
+    "blender": (2, 65, 0),
     "location": "Properties > Render > Bake Panel",
     "description": "Renderbakes a series of frames",
     "category": "Object",
-    'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.6/Py/' \
-        'Scripts/Object/Animated_Render_Baker',
-    'tracker_url': 'https://projects.blender.org/tracker/index.php?'\
-        'func=detail&aid=24836'}
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
+                "Scripts/Object/Animated_Render_Baker",
+    "tracker_url": "https://projects.blender.org/tracker/index.php?"
+                   "func=detail&aid=24836"}
 
 import bpy
-from bpy.props import *
+from bpy.props import IntProperty
 
 class OBJECT_OT_animrenderbake(bpy.types.Operator):
     bl_label = "Animated Render Bake"
@@ -38,15 +38,15 @@ class OBJECT_OT_animrenderbake(bpy.types.Operator):
     bl_idname = "object.anim_bake_image"
     bl_register = True
 
-    def framefile(self, orig, frame):
+    def framefile(self, filepath, frame):
         """
         Set frame number to file name image.png -> image0013.png
         """
-        dot = orig.rfind(".")
-        return orig[:dot] + ('%04d' % frame) + orig[dot:]
-    
+        import os
+        fn, ext = os.path.splitext(filepath)
+        return "%s%04d%s" % (fn, frame, ext)
+
     def invoke(self, context, event):
-        import bpy
         import shutil
         
         scene = context.scene
@@ -74,13 +74,18 @@ class OBJECT_OT_animrenderbake(bpy.types.Operator):
             self.report({'ERROR'}, "The baked object must be a mesh object")
             return {'CANCELLED'}
 
+        if context.active_object.mode == 'EDIT':
+            self.report({'ERROR'}, "Can't bake in edit-mode")
+            return {'CANCELLED'}
+
         img = None
 
-        #find the image that's used for rendering
+        # find the image that's used for rendering
+        # TODO: support multiple images per bake
         for uvtex in context.active_object.data.uv_textures:
             if uvtex.active_render == True:
                 for uvdata in uvtex.data:
-                    if uvdata.image != None:
+                    if uvdata.image is not None:
                         img = uvdata.image
                         break
 
@@ -92,13 +97,17 @@ class OBJECT_OT_animrenderbake(bpy.types.Operator):
             self.report({'ERROR'}, "Save the image that's used for baking before use")
             return {'CANCELLED'}
 
+        if img.packed_file is not None:
+            self.report({'ERROR'}, "Can't animation-bake packed file")
+            return {'CANCELLED'}
+
         # make sure we have an absolute path so that copying works for sure
-        absp = bpy.path.abspath(img.filepath, library=img.library)
+        img_filepath_abs = bpy.path.abspath(img.filepath, library=img.library)
 
-        print("Animated baking for frames " + str(start) + " - " + str(end))
+        print("Animated baking for frames (%d - %d)" % (start, end))
 
-        for cfra in range(start, end+1):
-            print("Baking frame " + str(cfra))
+        for cfra in range(start, end + 1):
+            print("Baking frame %d" % cfra)
 
             # update scene to new frame and bake to template image
             scene.frame_set(cfra)
@@ -106,95 +115,56 @@ class OBJECT_OT_animrenderbake(bpy.types.Operator):
             if 'CANCELLED' in ret:
                 return {'CANCELLED'}
 
-            #currently the api doesn't allow img.save_as(), so just save the template image as usual for every frame and copy to a file with frame specific filename
+            # Currently the api doesn't allow img.save_as()
+            # so just save the template image as usual for
+            # every frame and copy to a file with frame specific filename
             img.save()
-            shutil.copyfile(absp, self.framefile(absp, cfra))
+            img_filepath_new = self.framefile(img_filepath_abs, cfra)
+            shutil.copyfile(img_filepath_abs, img_filepath_new)
+            print("Saved %r" % img_filepath_new)
 
-            print("Saved " + self.framefile(absp, cfra))
         print("Baking done!")
 
         return{'FINISHED'}
 
-# modified copy of original bake panel draw function
-def draw_animrenderbake(self, context):
+
+def draw(self, context):
     layout = self.layout
 
-    rd = context.scene.render
+    scene = context.scene
 
     row = layout.row()
-    row.operator("object.bake_image", icon='RENDER_STILL')
-    
-    #----------- beginning of modifications ----------------
     row.operator("object.anim_bake_image", text="Animated Bake", icon="RENDER_ANIMATION")
-    row = layout.row(align=True)
-    row.prop(context.scene, "animrenderbake_start")
-    row.prop(context.scene, "animrenderbake_end")
-    #-------------- end of modifications ---------------------
-
-    layout.prop(rd, "bake_type")
-
-    multires_bake = False
-    if rd.bake_type in ['NORMALS', 'DISPLACEMENT']:
-        layout.prop(rd, 'use_bake_multires')
-        multires_bake = rd.use_bake_multires
-
-    if not multires_bake:
-        if rd.bake_type == 'NORMALS':
-            layout.prop(rd, "bake_normal_space")
-        elif rd.bake_type in {'DISPLACEMENT', 'AO'}:
-            layout.prop(rd, "use_bake_normalize")
+    rowsub = row.row(align=True)
+    rowsub.prop(scene, "animrenderbake_start")
+    rowsub.prop(scene, "animrenderbake_end")
 
-        # col.prop(rd, "bake_aa_mode")
-        # col.prop(rd, "use_bake_antialiasing")
-
-        layout.separator()
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(rd, "use_bake_clear")
-        col.prop(rd, "bake_margin")
-        col.prop(rd, "bake_quad_split", text="Split")
-
-        col = split.column()
-        col.prop(rd, "use_bake_selected_to_active")
-        sub = col.column()
-        sub.active = rd.use_bake_selected_to_active
-        sub.prop(rd, "bake_distance")
-        sub.prop(rd, "bake_bias")
-    else:
-        if rd.bake_type == 'DISPLACEMENT':
-            layout.prop(rd, "use_bake_lores_mesh")
-
-        layout.prop(rd, "use_bake_clear")
-        layout.prop(rd, "bake_margin")
 
 def register():
     bpy.utils.register_module(__name__)
 
     bpy.types.Scene.animrenderbake_start = IntProperty(
-        name="Start",
-        description="Start frame of the animated bake",
-        default=1)
+            name="Start",
+            description="Start frame of the animated bake",
+            default=1)
 
     bpy.types.Scene.animrenderbake_end = IntProperty(
-        name="End",
-        description="End frame of the animated bake",
-        default=250)
+            name="End",
+            description="End frame of the animated bake",
+            default=250)
+
+    bpy.types.RENDER_PT_bake.prepend(draw)
 
-    # replace original panel draw function with modified one
-    panel = bpy.types.RENDER_PT_bake
-    panel.old_draw = panel.draw
-    panel.draw = draw_animrenderbake
 
 def unregister():
     bpy.utils.unregister_module(__name__)
 
     # restore original panel draw function
-    bpy.types.RENDER_PT_bake.draw = bpy.types.RENDER_PT_bake.old_draw
-    del bpy.types.RENDER_PT_bake.old_draw
     del bpy.types.Scene.animrenderbake_start
     del bpy.types.Scene.animrenderbake_end
 
+    bpy.types.RENDER_PT_bake.remove(draw)
+
+
 if __name__ == "__main__":
     register()
diff --git a/release/scripts/addons/render_copy_settings/__init__.py b/release/scripts/addons/render_copy_settings/__init__.py
index 6d5e946..62b0ab3 100644
--- a/release/scripts/addons/render_copy_settings/__init__.py
+++ b/release/scripts/addons/render_copy_settings/__init__.py
@@ -18,25 +18,14 @@
 
 # <pep8 compliant>
 
-bl_info = {
-    "name": "Copy Settings",
-    "author": "Bastien Montagne",
-    "version": (0, 1, 5),
-    "blender": (2, 65, 0),
-    "location": "Render buttons (Properties window)",
-    "description": "Allows to copy a selection of render settings from current scene to others.",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Copy Settings",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=25832",
-    "category": "Render"}
-
-
 if "bpy" in locals():
     import imp
     imp.reload(operator)
     imp.reload(panel)
+    imp.reload(translations)
 
 else:
-    from . import operator, panel
+    from . import operator, panel, translations
 
 
 import bpy
@@ -46,6 +35,17 @@ from bpy.props import (StringProperty,
                        CollectionProperty,
                        PointerProperty)
 
+bl_info = {
+    "name": "Copy Settings",
+    "author": "Bastien Montagne",
+    "version": (0, 1, 5),
+    "blender": (2, 65, 9),
+    "location": "Render buttons (Properties window)",
+    "description": "Allows to copy a selection of render settings from current scene to others.",
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Copy Settings",
+    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=25832",
+    "category": "Render",
+}
 
 ########################################################################################################################
 # Global properties for the script, for UI (as there’s no way to let them in the operator…).
@@ -90,6 +90,7 @@ def register():
     bpy.types.Scene.render_copy_settings = PointerProperty(type=RenderCopySettings)
 
     bpy.utils.register_module(__name__)
+    bpy.app.translations.register(__name__, translations.translations_dict)
 
 
 def unregister():
@@ -100,6 +101,7 @@ def unregister():
     del bpy.types.Scene.render_copy_settings
 
     bpy.utils.unregister_module(__name__)
+    bpy.app.translations.unregister(__name__)
 
 
 if __name__ == "__main__":
diff --git a/release/scripts/addons/render_copy_settings/translations.py b/release/scripts/addons/render_copy_settings/translations.py
new file mode 100644
index 0000000..9d4bf66
--- /dev/null
+++ b/release/scripts/addons/render_copy_settings/translations.py
@@ -0,0 +1,35 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+# Tuple of tuples (key, (sources, comments), (lang, translation, (is_fuzzy, comments)), ...)
+translations_tuple = (
+    ((None, "Allows to copy a selection of render settings from current scene to others."),
+     ((), ()),
+     ("fr", "Permet de copier une sélection des réglages de rendu depuis la scène courante vers d’autres scènes.",
+      (False, ())),
+    ),
+)
+
+translations_dict = {}
+for msg in translations_tuple:
+    key = msg[0]
+    for lang, trans, (is_fuzzy, comments) in msg[2:]:
+        if trans and not is_fuzzy:
+            translations_dict.setdefault(lang, {})[key] = trans
diff --git a/release/scripts/addons/render_povray/__init__.py b/release/scripts/addons/render_povray/__init__.py
index 573f24f..e5e4560 100644
--- a/release/scripts/addons/render_povray/__init__.py
+++ b/release/scripts/addons/render_povray/__init__.py
@@ -26,10 +26,10 @@ bl_info = {
     "location": "Render > Engine > POV-Ray 3.7",
     "description": "Basic POV-Ray 3.7 integration for blender",
     "warning": "both POV-Ray 3.7 and this script are beta",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Render/POV-Ray",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=23145",
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
+                "Scripts/Render/POV-Ray",
+    "tracker_url": "https://projects.blender.org/tracker/index.php?"
+                   "func=detail&aid=23145",
     "category": "Render"}
 
 if "bpy" in locals():
@@ -40,8 +40,17 @@ if "bpy" in locals():
 
 else:
     import bpy
-    from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty, \
-                          FloatVectorProperty, EnumProperty, PointerProperty
+    from bpy.types import (AddonPreferences,
+                           PropertyGroup,
+                           )
+    from bpy.props import (StringProperty,
+                           BoolProperty,
+                           IntProperty,
+                           FloatProperty,
+                           FloatVectorProperty,
+                           EnumProperty,
+                           PointerProperty,
+                           )
     from . import ui
     from . import render
     from . import update_files
@@ -51,7 +60,7 @@ else:
 ###############################################################################
 # Scene POV properties.
 ###############################################################################
-class RenderPovSettingsScene(bpy.types.PropertyGroup):
+class RenderPovSettingsScene(PropertyGroup):
     # File Options
     tempfiles_enable = BoolProperty(
             name="Enable Tempfiles",
@@ -63,21 +72,21 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
             default=True)
     scene_name = StringProperty(
             name="Scene Name",
-            description="Name of POV-Ray scene to create. Empty name will use the name of " \
+            description="Name of POV-Ray scene to create. Empty name will use the name of "
                         "the blend file",
-            default="", maxlen=1024)
+            maxlen=1024)
     scene_path = StringProperty(
             name="Export scene path",
             # description="Path to directory where the exported scene (POV and INI) is created",  # Bug in POV-Ray RC3
             description="Path to directory where the files are created",
-            default="", maxlen=1024, subtype="DIR_PATH")
+            maxlen=1024, subtype="DIR_PATH")
     renderimage_path = StringProperty(
             name="Rendered image path",
             description="Full path to directory where the rendered image is saved",
-            default="", maxlen=1024, subtype="DIR_PATH")
+            maxlen=1024, subtype="DIR_PATH")
     list_lf_enable = BoolProperty(
             name="LF in lists",
-            description="Enable line breaks in lists (vectors and indices). Disabled: " \
+            description="Enable line breaks in lists (vectors and indices). Disabled: "
                         "lists are exported in one line",
             default=True)
 
@@ -96,7 +105,7 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
             default=False)
     media_samples = IntProperty(
             name="Samples",
-            description="Number of samples taken from camera to first object " \
+            description="Number of samples taken from camera to first object "
                         "encountered along ray path for media calculation",
             min=1, max=100, default=35)
 
@@ -112,10 +121,10 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
     indentation_character = EnumProperty(
             name="Indentation",
             description="Select the indentation type",
-            items=(("0", "None", "No indentation"),
-                   ("1", "Tabs", "Indentation with tabs"),
-                   ("2", "Spaces", "Indentation with spaces")),
-            default="2")
+            items=(('NONE', "None", "No indentation"),
+                   ('TAB', "Tabs", "Indentation with tabs"),
+                   ('SPACE', "Spaces", "Indentation with spaces")),
+            default='SPACE')
     indentation_spaces = IntProperty(
             name="Quantity of spaces",
             description="The number of spaces for indentation",
@@ -129,9 +138,9 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
     # Real pov options
     command_line_switches = StringProperty(
             name="Command Line Switches",
-            description="Command line switches consist of a + (plus) or - (minus) sign, followed " \
+            description="Command line switches consist of a + (plus) or - (minus) sign, followed "
                         "by one or more alphabetic characters and possibly a numeric value",
-            default="", maxlen=500)
+            maxlen=500)
 
     antialias_enable = BoolProperty(
             name="Anti-Alias", description="Enable Anti-Aliasing",
@@ -139,7 +148,7 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     antialias_method = EnumProperty(
             name="Method",
-            description="AA-sampling method. Type 1 is an adaptive, non-recursive, super-sampling "\
+            description="AA-sampling method. Type 1 is an adaptive, non-recursive, super-sampling "
                         "method. Type 2 is an adaptive and recursive super-sampling method",
             items=(("0", "non-recursive AA", "Type 1 Sampling in POV-Ray"),
                    ("1", "recursive AA", "Type 2 Sampling in POV-Ray")),
@@ -155,7 +164,7 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     jitter_enable = BoolProperty(
             name="Jitter",
-            description="Enable Jittering. Adds noise into the sampling process (it should be " \
+            description="Enable Jittering. Adds noise into the sampling process (it should be "
                         "avoided to use jitter in animation)",
             default=True)
 
@@ -165,7 +174,7 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     antialias_gamma = FloatProperty(
             name="Antialias Gamma",
-            description="POV-Ray compares gamma-adjusted values for super sampling. Antialias " \
+            description="POV-Ray compares gamma-adjusted values for super sampling. Antialias "
                         "Gamma sets the Gamma before comparison",
             min=0.0, max=5.0, soft_min=0.01, soft_max=2.5, default=2.5)
 
@@ -176,7 +185,7 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     photon_spacing = FloatProperty(
             name="Spacing",
-            description="Average distance between photons on surfaces. half this get four times " \
+            description="Average distance between photons on surfaces. half this get four times "
                         "as many surface photons",
             min=0.001, max=1.000, soft_min=0.001, soft_max=1.000, default=0.005, precision=3)
 
@@ -187,7 +196,7 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     photon_adc_bailout = FloatProperty(
             name="ADC Bailout",
-            description="The adc_bailout for photons. Use adc_bailout = " \
+            description="The adc_bailout for photons. Use adc_bailout = "
                         "0.01 / brightest_ambient_object for good results",
             min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.1, precision=3)
 
@@ -201,43 +210,43 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     radio_adc_bailout = FloatProperty(
             name="ADC Bailout",
-            description="The adc_bailout for radiosity rays. Use " \
+            description="The adc_bailout for radiosity rays. Use "
                         "adc_bailout = 0.01 / brightest_ambient_object for good results",
             min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.01, precision=3)
 
     radio_always_sample = BoolProperty(
             name="Always Sample",
-            description="Only use the data from the pretrace step and not gather " \
+            description="Only use the data from the pretrace step and not gather "
                         "any new samples during the final radiosity pass",
             default=True)
 
     radio_brightness = FloatProperty(
             name="Brightness",
-            description="Amount objects are brightened before being returned " \
+            description="Amount objects are brightened before being returned "
                         "upwards to the rest of the system",
             min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default=1.0)
 
     radio_count = IntProperty(
             name="Ray Count",
-            description="Number of rays for each new radiosity value to be calculated " \
+            description="Number of rays for each new radiosity value to be calculated "
                         "(halton sequence over 1600)",
             min=1, max=10000, soft_max=1600, default=35)
 
     radio_error_bound = FloatProperty(
             name="Error Bound",
-            description="One of the two main speed/quality tuning values, " \
+            description="One of the two main speed/quality tuning values, "
                         "lower values are more accurate",
             min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1.8)
 
     radio_gray_threshold = FloatProperty(
             name="Gray Threshold",
-            description="One of the two main speed/quality tuning values, " \
+            description="One of the two main speed/quality tuning values, "
                         "lower values are more accurate",
             min=0.0, max=1.0, soft_min=0, soft_max=1, default=0.0)
 
     radio_low_error_factor = FloatProperty(
             name="Low Error Factor",
-            description="Just enough samples is slightly blotchy. Low error changes error " \
+            description="Just enough samples is slightly blotchy. Low error changes error "
                         "tolerance for less critical last refining pass",
             min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.5)
 
@@ -248,13 +257,13 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     radio_minimum_reuse = FloatProperty(
             name="Minimum Reuse",
-            description="Fraction of the screen width which sets the minimum radius of reuse " \
+            description="Fraction of the screen width which sets the minimum radius of reuse "
                         "for each sample point (At values higher than 2% expect errors)",
             min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015, precision=3)
 
     radio_nearest_count = IntProperty(
             name="Nearest Count",
-            description="Number of old ambient values blended together to " \
+            description="Number of old ambient values blended together to "
                         "create a new interpolated value",
             min=1, max=20, default=5)
 
@@ -264,19 +273,19 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 
     radio_recursion_limit = IntProperty(
             name="Recursion Limit",
-            description="how many recursion levels are used to calculate " \
+            description="how many recursion levels are used to calculate "
                         "the diffuse inter-reflection",
             min=1, max=20, default=3)
 
     radio_pretrace_start = FloatProperty(
             name="Pretrace Start",
-            description="Fraction of the screen width which sets the size of the " \
+            description="Fraction of the screen width which sets the size of the "
                         "blocks in the mosaic preview first pass",
             min=0.01, max=1.00, soft_min=0.02, soft_max=1.0, default=0.08)
 
     radio_pretrace_end = FloatProperty(
             name="Pretrace End",
-            description="Fraction of the screen width which sets the size of the blocks " \
+            description="Fraction of the screen width which sets the size of the blocks "
                         "in the mosaic preview last pass",
             min=0.001, max=1.00, soft_min=0.01, soft_max=1.00, default=0.04, precision=3)
 
@@ -284,16 +293,16 @@ class RenderPovSettingsScene(bpy.types.PropertyGroup):
 ###############################################################################
 # Material POV properties.
 ###############################################################################
-class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
+class RenderPovSettingsMaterial(PropertyGroup):
     irid_enable = BoolProperty(
             name="Enable Iridescence",
-            description="Newton's thin film interference (like an oil slick on a puddle of " \
+            description="Newton's thin film interference (like an oil slick on a puddle of "
                         "water or the rainbow hues of a soap bubble.)",
             default=False)
 
     mirror_use_IOR = BoolProperty(
             name="Correct Reflection",
-            description="Use same IOR as raytrace transparency to calculate mirror reflections. " \
+            description="Use same IOR as raytrace transparency to calculate mirror reflections. "
                         "More physically correct",
             default=False)
 
@@ -304,21 +313,21 @@ class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
 
     conserve_energy = BoolProperty(
             name="Conserve Energy",
-            description="Light transmitted is more correctly reduced by mirror reflections, " \
+            description="Light transmitted is more correctly reduced by mirror reflections, "
                         "also the sum of diffuse and translucency gets reduced below one ",
             default=True)
 
     irid_amount = FloatProperty(
             name="amount",
-            description="Contribution of the iridescence effect to the overall surface color. " \
-                        "As a rule of thumb keep to around 0.25 (25% contribution) or less, " \
-                        "but experiment. If the surface is coming out too white, try lowering " \
+            description="Contribution of the iridescence effect to the overall surface color. "
+                        "As a rule of thumb keep to around 0.25 (25% contribution) or less, "
+                        "but experiment. If the surface is coming out too white, try lowering "
                         "the diffuse and possibly the ambient values of the surface",
             min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=0.25)
 
     irid_thickness = FloatProperty(
             name="thickness",
-            description="A very thin film will have a high frequency of color changes while a " \
+            description="A very thin film will have a high frequency of color changes while a "
                         "thick film will have large areas of color",
             min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1)
 
@@ -333,7 +342,7 @@ class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
 
     caustics_enable = BoolProperty(
             name="Caustics",
-            description="use only fake refractive caustics (default) or photon based " \
+            description="use only fake refractive caustics (default) or photon based "
                         "reflective/refractive caustics",
             default=True)
 
@@ -343,8 +352,8 @@ class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
 
     fake_caustics_power = FloatProperty(
             name="Fake caustics power",
-            description="Values typically range from 0.0 to 1.0 or higher. Zero is no caustics. " \
-                        "Low, non-zero values give broad hot-spots while higher values give " \
+            description="Values typically range from 0.0 to 1.0 or higher. Zero is no caustics. "
+                        "Low, non-zero values give broad hot-spots while higher values give "
                         "tighter, smaller simulated focal points",
             min=0.00, max=10.0, soft_min=0.00, soft_max=1.10, default=0.1)
 
@@ -354,8 +363,8 @@ class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
 
     photons_dispersion = FloatProperty(
             name="Chromatic Dispersion",
-            description="Light passing through will be separated according to wavelength. " \
-                        "This ratio of refractive indices for violet to red controls how much " \
+            description="Light passing through will be separated according to wavelength. "
+                        "This ratio of refractive indices for violet to red controls how much "
                         "the colors are spread out 1 = no dispersion, good values are 1.01 to 1.1",
             min=1.0000, max=10.000, soft_min=1.0000, soft_max=1.1000, precision=4, default=1.0000)
 
@@ -379,7 +388,7 @@ class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
     ##################################CustomPOV Code############################
     replacement_text = StringProperty(
             name="Declared name:",
-            description="Type the declared name in custom POV code or an external " \
+            description="Type the declared name in custom POV code or an external "
                         ".inc it points at. texture {} expected",
             default="")
 
@@ -387,12 +396,12 @@ class RenderPovSettingsMaterial(bpy.types.PropertyGroup):
 ###############################################################################
 # Texture POV properties.
 ###############################################################################
-class RenderPovSettingsTexture(bpy.types.PropertyGroup):
+class RenderPovSettingsTexture(PropertyGroup):
     #Custom texture gamma
     tex_gamma_enable = BoolProperty(
             name="Enable custom texture gamma",
-            description="Notify some custom gamma for which texture has been precorrected " \
-                        "without the file format carrying it and only if it differs from your " \
+            description="Notify some custom gamma for which texture has been precorrected "
+                        "without the file format carrying it and only if it differs from your "
                         "OS expected standard (see pov doc)",
             default=False)
 
@@ -405,7 +414,7 @@ class RenderPovSettingsTexture(bpy.types.PropertyGroup):
     #Only DUMMIES below for now:
     replacement_text = StringProperty(
             name="Declared name:",
-            description="Type the declared name in custom POV code or an external .inc " \
+            description="Type the declared name in custom POV code or an external .inc "
                         "it points at. pigment {} expected",
             default="")
 
@@ -413,36 +422,36 @@ class RenderPovSettingsTexture(bpy.types.PropertyGroup):
 ###############################################################################
 # Object POV properties.
 ###############################################################################
-class RenderPovSettingsObject(bpy.types.PropertyGroup):
-    #Importance sampling
+class RenderPovSettingsObject(PropertyGroup):
+    # Importance sampling
     importance_value = FloatProperty(
             name="Radiosity Importance",
-            description="Priority value relative to other objects for sampling radiosity rays. " \
-                        "Increase to get more radiosity rays at comparatively small yet " \
+            description="Priority value relative to other objects for sampling radiosity rays. "
+                        "Increase to get more radiosity rays at comparatively small yet "
                         "bright objects",
             min=0.01, max=1.00, default=1.00)
 
-    #Collect photons
+    # Collect photons
     collect_photons = BoolProperty(
             name="Receive Photon Caustics",
-            description="Enable object to collect photons from other objects caustics. Turn " \
-                        "off for objects that don't really need to receive caustics (e.g. objects" \
+            description="Enable object to collect photons from other objects caustics. Turn "
+                        "off for objects that don't really need to receive caustics (e.g. objects"
                         " that generate caustics often don't need to show any on themselves)",
             default=True)
 
-    #Photons spacing_multiplier
+    # Photons spacing_multiplier
     spacing_multiplier = FloatProperty(
             name="Photons Spacing Multiplier",
-            description="Multiplier value relative to global spacing of photons. " \
-                        "Decrease by half to get 4x more photons at surface of " \
+            description="Multiplier value relative to global spacing of photons. "
+                        "Decrease by half to get 4x more photons at surface of "
                         "this object (or 8x media photons than specified in the globals",
             min=0.01, max=1.00, default=1.00)
 
     ##################################CustomPOV Code############################
-    #Only DUMMIES below for now:
+    # Only DUMMIES below for now:
     replacement_text = StringProperty(
             name="Declared name:",
-            description="Type the declared name in custom POV code or an external .inc " \
+            description="Type the declared name in custom POV code or an external .inc "
                         "it points at. Any POV shape expected e.g: isosurface {}",
             default="")
 
@@ -450,21 +459,21 @@ class RenderPovSettingsObject(bpy.types.PropertyGroup):
 ###############################################################################
 # Camera POV properties.
 ###############################################################################
-class RenderPovSettingsCamera(bpy.types.PropertyGroup):
+class RenderPovSettingsCamera(PropertyGroup):
     #DOF Toggle
     dof_enable = BoolProperty(
             name="Depth Of Field", description="EnablePOV-Ray Depth Of Field ",
             default=False)
 
-    #Aperture (Intensity of the Blur)
+    # Aperture (Intensity of the Blur)
     dof_aperture = FloatProperty(
             name="Aperture",
-            description="Similar to a real camera's aperture effect over focal blur (though not " \
-                        "in physical units and independant of focal length). " \
+            description="Similar to a real camera's aperture effect over focal blur (though not "
+                        "in physical units and independant of focal length). "
                         "Increase to get more blur",
             min=0.01, max=1.00, default=0.25)
 
-    #Aperture adaptive sampling
+    # Aperture adaptive sampling
     dof_samples_min = IntProperty(
             name="Samples Min", description="Minimum number of rays to use for each pixel",
             min=1, max=128, default=96)
@@ -475,22 +484,22 @@ class RenderPovSettingsCamera(bpy.types.PropertyGroup):
 
     dof_variance = IntProperty(
             name="Variance",
-            description="Minimum threshold (fractional value) for adaptive DOF sampling (up " \
-                        "increases quality and render time). The value for the variance should " \
+            description="Minimum threshold (fractional value) for adaptive DOF sampling (up "
+                        "increases quality and render time). The value for the variance should "
                         "be in the range of the smallest displayable color difference",
             min=1, max=100000, soft_max=10000, default=256)
 
     dof_confidence = FloatProperty(
             name="Confidence",
-            description="Probability to reach the real color value. Larger confidence values " \
+            description="Probability to reach the real color value. Larger confidence values "
                         "will lead to more samples, slower traces and better images",
             min=0.01, max=0.99, default=0.90)
 
     ##################################CustomPOV Code############################
-    #Only DUMMIES below for now:
+    # Only DUMMIES below for now:
     replacement_text = StringProperty(
             name="Texts in blend file",
-            description="Type the declared name in custom POV code or an external .inc " \
+            description="Type the declared name in custom POV code or an external .inc "
                         "it points at. camera {} expected",
             default="")
 
@@ -498,13 +507,29 @@ class RenderPovSettingsCamera(bpy.types.PropertyGroup):
 ###############################################################################
 # Text POV properties.
 ###############################################################################
-class RenderPovSettingsText(bpy.types.PropertyGroup):
+class RenderPovSettingsText(PropertyGroup):
     custom_code = BoolProperty(
             name="Custom Code",
             description="Add this text at the top of the exported POV-Ray file",
             default=False)
 
 
+###############################################################################
+# Povray Preferences.
+###############################################################################
+class PovrayPreferences(AddonPreferences):
+    bl_idname = __name__
+
+    filepath_povray = StringProperty(
+                name="Povray Location",
+                description="Path to renderer executable",
+                subtype='FILE_PATH',
+                )
+    def draw(self, context):
+        layout = self.layout
+        layout.prop(self, "filepath_povray")
+
+
 def register():
     bpy.utils.register_module(__name__)
 
diff --git a/release/scripts/addons/render_povray/render.py b/release/scripts/addons/render_povray/render.py
index ddcd354..fdf969e 100644
--- a/release/scripts/addons/render_povray/render.py
+++ b/release/scripts/addons/render_povray/render.py
@@ -25,7 +25,7 @@ import sys
 import time
 from math import atan, pi, degrees, sqrt
 import re
-
+import random
 ##############################SF###########################
 ##############find image texture
 
@@ -168,11 +168,11 @@ def write_pov(filename, scene=None, info_callback=None):
 
     def setTab(tabtype, spaces):
         TabStr = ""
-        if tabtype == '0':
+        if tabtype == 'NONE':
             TabStr = ""
-        elif tabtype == '1':
+        elif tabtype == 'TAB':
             TabStr = "\t"
-        elif tabtype == '2':
+        elif tabtype == 'SPACE':
             TabStr = spaces * " "
         return TabStr
 
@@ -821,11 +821,12 @@ def write_pov(filename, scene=None, info_callback=None):
                 continue
                    
             # Export Hair
-
+            renderEmitter = True
             if hasattr(ob, 'particle_systems'):
+                renderEmitter = False
                 for pSys in ob.particle_systems:
-                    if not pSys.settings.use_render_emitter:
-                        continue #don't render mesh
+                    if pSys.settings.use_render_emitter:
+                        renderEmitter = True
                     for mod in [m for m in ob.modifiers if (m is not None) and (m.type == 'PARTICLE_SYSTEM')]:
                         if (pSys.settings.render_type == 'PATH') and mod.show_render and (pSys.name == mod.particle_system.name):
                             tstart = time.time()
@@ -834,57 +835,64 @@ def write_pov(filename, scene=None, info_callback=None):
                                 if pmaterial.strand.use_blender_units:
                                     strandStart = pmaterial.strand.root_size
                                     strandEnd = pmaterial.strand.tip_size
-                                    strandShape = pmaterial.strand.shape
+                                    strandShape = pmaterial.strand.shape 
                                 else:  # Blender unit conversion
-                                    strandStart = pmaterial.strand.root_size / 200
-                                    strandEnd = pmaterial.strand.tip_size / 200
+                                    strandStart = pmaterial.strand.root_size / 200.0
+                                    strandEnd = pmaterial.strand.tip_size / 200.0
                                     strandShape = pmaterial.strand.shape
                             else:
                                 pmaterial = "default"  # No material assigned in blender, use default one
                                 strandStart = 0.01
                                 strandEnd = 0.01
                                 strandShape = 0.0
-                                
-                            totalNumberOfHairs = len(pSys.particles)
-                            hairCounter = 0
+                            # Set the number of particles to render count rather than 3d view display    
+                            pSys.set_resolution(scene, ob, 'RENDER')    
+                            steps = pSys.settings.draw_step
+                            steps = 3 ** steps # or (power of 2 rather than 3) + 1 # Formerly : len(particle.hair_keys)
+                            
+                            totalNumberOfHairs = ( len(pSys.particles) + len(pSys.child_particles) )
+                            #hairCounter = 0
                             file.write('#declare HairArray = array[%i] {\n' % totalNumberOfHairs)
-                            for particle in pSys.particles:
-                                if particle.is_exist and particle.is_visible:
-                                    hairCounter += 1
-                                    controlPointCounter = 0
+                            for pindex in range(0, totalNumberOfHairs):
+
+                                #if particle.is_exist and particle.is_visible:
+                                    #hairCounter += 1
+                                    #controlPointCounter = 0
                                     # Each hair is represented as a separate sphere_sweep in POV-Ray.
                                     
                                     file.write('sphere_sweep{')
                                     if pSys.settings.use_hair_bspline:
                                         file.write('b_spline ')
-                                        file.write('%i,\n' % (len(particle.hair_keys) + 2))  # +2 because the first point needs tripling to be more than a handle in POV
-
+                                        file.write('%i,\n' % (steps + 2))  # +2 because the first point needs tripling to be more than a handle in POV
                                     else:
                                         file.write('linear_spline ')
-                                        file.write('%i,\n' % (len(particle.hair_keys)))
-                                    for controlPoint in particle.hair_keys:
+                                        file.write('%i,\n' % (steps))
+                                        
+                                    for step in range(0, steps):
+                                        co = pSys.co_hair(ob, mod, pindex, step)
+                                    #for controlPoint in particle.hair_keys:
                                         if pSys.settings.clump_factor != 0:
-                                            hDiameter = pSys.settings.clump_factor #* random.uniform(0.5, 1)
-                                        elif controlPointCounter == 0:
+                                            hDiameter = pSys.settings.clump_factor / 200.0 * random.uniform(0.5, 1)
+                                        elif step == 0:
                                             hDiameter = strandStart
                                         else:
-                                            hDiameter += (strandEnd-strandStart)/(len(particle.hair_keys)+1) #XXX +1 or not?
-                                        if controlPointCounter == 0 and pSys.settings.use_hair_bspline:
+                                            hDiameter += (strandEnd-strandStart)/(pSys.settings.draw_step+1) #XXX +1 or not?
+                                        if step == 0 and pSys.settings.use_hair_bspline:
                                             # Write three times the first point to compensate pov Bezier handling
-                                            file.write('<%.6g,%.6g,%.6g>,%.7g,\n' % (controlPoint.co[0], controlPoint.co[1], controlPoint.co[2], abs(hDiameter)))
-                                            file.write('<%.6g,%.6g,%.6g>,%.7g,\n' % (controlPoint.co[0], controlPoint.co[1], controlPoint.co[2], abs(hDiameter)))                                          
-											#file.write('<%.6g,%.6g,%.6g>,%.7g' % (particle.location[0], particle.location[1], particle.location[2], abs(hDiameter))) # Useless because particle location is the tip, not the root.
+                                            file.write('<%.6g,%.6g,%.6g>,%.7g,\n' % (co[0], co[1], co[2], abs(hDiameter)))
+                                            file.write('<%.6g,%.6g,%.6g>,%.7g,\n' % (co[0], co[1], co[2], abs(hDiameter)))                                          
+                                            #file.write('<%.6g,%.6g,%.6g>,%.7g' % (particle.location[0], particle.location[1], particle.location[2], abs(hDiameter))) # Useless because particle location is the tip, not the root.
                                             #file.write(',\n')
-                                        controlPointCounter += 1
+                                        #controlPointCounter += 1
                                         #totalNumberOfHairs += len(pSys.particles)# len(particle.hair_keys)
                                              
                                       # Each control point is written out, along with the radius of the
                                       # hair at that point.
-                                        file.write('<%.6g,%.6g,%.6g>,%.7g' % (controlPoint.co[0], controlPoint.co[1], controlPoint.co[2], abs(hDiameter)))
+                                        file.write('<%.6g,%.6g,%.6g>,%.7g' % (co[0], co[1], co[2], abs(hDiameter)))
 
                                       # All coordinates except the last need a following comma.
 
-                                        if controlPointCounter != len(particle.hair_keys):
+                                        if step != steps - 1:
                                             file.write(',\n')
                                         else:
                                             # End the sphere_sweep declaration for this hair
@@ -892,7 +900,7 @@ def write_pov(filename, scene=None, info_callback=None):
                                         
                                       # All but the final sphere_sweep (each array element) needs a terminating comma.
 
-                                    if hairCounter != totalNumberOfHairs:
+                                    if pindex != totalNumberOfHairs:
                                         file.write(',\n')
                                     else:
                                         file.write('\n')
@@ -950,9 +958,12 @@ def write_pov(filename, scene=None, info_callback=None):
                             file.write('}')
                             print('Totals hairstrands written: %i' % totalNumberOfHairs)
                             print('Number of tufts (particle systems)', len(ob.particle_systems))
-
-                                
-
+                            
+                            # Set back the displayed number of particles to preview count
+                            pSys.set_resolution(scene, ob, 'PREVIEW')
+                            
+                            if renderEmitter == False:
+                                continue #don't render mesh, skip to next object.
             try:
                 me = ob.to_mesh(scene, True, 'RENDER')
             except:
@@ -1854,9 +1865,9 @@ def write_pov(filename, scene=None, info_callback=None):
                 # In pov, the scale has reversed influence compared to blender. these number
                 # should correct that
                 tabWrite("mm_per_unit %.6f\n" % \
-                         (material.subsurface_scattering.scale * (-100.0) + 15.0))
+                         (material.subsurface_scattering.scale * 10000.0))# formerly ...scale * (-100.0) + 15.0))
                 # In POV-Ray, the scale factor for all subsurface shaders needs to be the same
-                sslt_samples = (11 - material.subsurface_scattering.error_threshold) * 100
+                sslt_samples = (11 - material.subsurface_scattering.error_threshold) * 10 # formerly ...*100
                 tabWrite("subsurface { samples %d, %d }\n" % (sslt_samples, sslt_samples / 10))
                 onceSss = 0
 
@@ -2010,6 +2021,46 @@ class PovrayRender(bpy.types.RenderEngine):
     bl_label = "POV-Ray 3.7"
     DELAY = 0.5
 
+    @staticmethod
+    def _locate_binary():
+        addon_prefs = bpy.context.user_preferences.addons[__package__].preferences
+
+        # Use the system preference if its set.
+        pov_binary = addon_prefs.filepath_povray
+        if pov_binary:
+            if os.path.exists(pov_binary):
+                return pov_binary
+            else:
+                print("User Preference to povray %r NOT FOUND, checking $PATH" % pov_binary)
+
+        # Windows Only
+        # assume if there is a 64bit binary that the user has a 64bit capable OS
+        if sys.platform[:3] == "win":
+            import winreg
+            win_reg_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\POV-Ray\\v3.7\\Windows")
+            win_home = winreg.QueryValueEx(win_reg_key, "Home")[0]
+
+            # First try 64bits
+            pov_binary = os.path.join(win_home, "bin", "pvengine64.exe")
+            if os.path.exists(pov_binary):
+                return pov_binary
+
+            # Then try 32bits
+            pov_binary = os.path.join(win_home, "bin", "pvengine.exe")
+            if os.path.exists(pov_binary):
+                return pov_binary
+
+        # search the path all os's
+        pov_binary_default = "povray"
+
+        os_path_ls = os.getenv("PATH").split(':') + [""]
+
+        for dir_name in os_path_ls:
+            pov_binary = os.path.join(dir_name, pov_binary_default)
+            if os.path.exists(pov_binary):
+                return pov_binary
+        return ""
+
     def _export(self, scene, povPath, renderImagePath):
         import tempfile
 
@@ -2042,18 +2093,20 @@ class PovrayRender(bpy.types.RenderEngine):
         write_pov(self._temp_file_in, scene, info_callback)
 
     def _render(self, scene):
-
         try:
             os.remove(self._temp_file_out)  # so as not to load the old file
         except OSError:
             pass
 
+        pov_binary = PovrayRender._locate_binary()
+        if not pov_binary:
+            print("POV-Ray 3.7: could not execute povray, possibly POV-Ray isn't installed")
+            return False
+
         write_pov_ini(scene, self._temp_file_ini, self._temp_file_in, self._temp_file_out)
 
         print ("***-STARTING-***")
 
-        pov_binary = "povray"
-
         extra_args = []
 
         if scene.pov.command_line_switches != "":
@@ -2064,127 +2117,26 @@ class PovrayRender(bpy.types.RenderEngine):
         if sys.platform[:3] == "win":
             self._is_windows = True
             #extra_args.append("/EXIT")
-
-            import winreg
-            import platform as pltfrm
-            if pltfrm.architecture()[0] == "64bit":
-                bitness = 64
-            else:
-                bitness = 32
-
-            regKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\POV-Ray\\v3.7\\Windows")
-
-            # TODO, report api
-
-            # 64 bits blender
-            if bitness == 64:
-                try:
-                    pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine64"
-                    self._process = subprocess.Popen(
-                            [pov_binary, self._temp_file_ini] + extra_args,
-                            stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-                    # This would work too but means we have to wait until its done:
-                    # os.system("%s %s" % (pov_binary, self._temp_file_ini))
-
-                except OSError:
-                    # someone might run povray 32 bits on a 64 bits blender machine
-                    try:
-                        pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine"
-                        self._process = subprocess.Popen(
-                                [pov_binary, self._temp_file_ini] + extra_args,
-                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-                    except OSError:
-                        # TODO, report api
-                        print("POV-Ray 3.7: could not execute '%s', possibly POV-Ray isn't " \
-                              "installed" % pov_binary)
-                        import traceback
-                        traceback.print_exc()
-                        print ("***-DONE-***")
-                        return False
-
-                    else:
-                        print("POV-Ray 3.7 64 bits could not execute, running 32 bits instead")
-                        print("Command line arguments passed: " + str(extra_args))
-                        return True
-
-                else:
-                    print("POV-Ray 3.7 64 bits found")
-                    print("Command line arguments passed: " + str(extra_args))
-                    return True
-
-            #32 bits blender
-            else:
-                try:
-                    pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine"
-                    self._process = subprocess.Popen(
-                            [pov_binary, self._temp_file_ini] + extra_args,
-                            stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-                # someone might also run povray 64 bits with a 32 bits build of blender.
-                except OSError:
-                    try:
-                        pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine64"
-                        self._process = subprocess.Popen(
-                                [pov_binary, self._temp_file_ini] + extra_args,
-                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-                    except OSError:
-                        # TODO, report api
-                        print("POV-Ray 3.7: could not execute '%s', possibly POV-Ray isn't " \
-                              "installed" % pov_binary)
-                        import traceback
-                        traceback.print_exc()
-                        print ("***-DONE-***")
-                        return False
-
-                    else:
-                        print("Running POV-Ray 3.7 64 bits build with 32 bits Blender,\n" \
-                              "You might want to run Blender 64 bits as well.")
-                        print("Command line arguments passed: " + str(extra_args))
-                        return True
-
-                else:
-                    print("POV-Ray 3.7 32 bits found")
-                    print("Command line arguments passed: " + str(extra_args))
-                    return True
-
         else:
-            # DH - added -d option to prevent render window popup which leads to segfault on linux
+            # added -d option to prevent render window popup which leads to segfault on linux
             extra_args.append("-d")
 
-            isExists = False
-            sysPathList = os.getenv("PATH").split(':')
-            sysPathList.append("")
-
-            for dirName in sysPathList:
-                if (os.path.exists(os.path.join(dirName, pov_binary))):
-                    isExists = True
-                    break
-
-            if not isExists:
-                print("POV-Ray 3.7: could not found execute '%s' - not if PATH" % pov_binary)
-                import traceback
-                traceback.print_exc()
-                print ("***-DONE-***")
-                return False
-
-            try:
-                self._process = subprocess.Popen([pov_binary, self._temp_file_ini] + extra_args,
-                                                 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-            except OSError:
-                # TODO, report api
-                print("POV-Ray 3.7: could not execute '%s'" % pov_binary)
-                import traceback
-                traceback.print_exc()
-                print ("***-DONE-***")
-                return False
+        # Start Rendering!
+        try:
+            self._process = subprocess.Popen([pov_binary, self._temp_file_ini] + extra_args,
+                                             stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+        except OSError:
+            # TODO, report api
+            print("POV-Ray 3.7: could not execute '%s'" % pov_binary)
+            import traceback
+            traceback.print_exc()
+            print ("***-DONE-***")
+            return False
 
-            else:
-                print("POV-Ray 3.7 found")
-                print("Command line arguments passed: " + str(extra_args))
-                return True
+        else:
+            print("POV-Ray 3.7 found")
+            print("Command line arguments passed: " + str(extra_args))
+            return True
 
         # Now that we have a valid process
 
@@ -2409,47 +2361,49 @@ class PovrayRender(bpy.types.RenderEngine):
 
             # Not needed right now, might only be useful if we find a way to use temp raw output of
             # pov 3.7 (in which case it might go under _test_wait()).
-#            def update_image():
-#                # possible the image wont load early on.
-#                try:
-#                    lay.load_from_file(self._temp_file_out)
-#                    # XXX, tests for border render.
-#                    #lay.load_from_file(self._temp_file_out, xmin, ymin)
-#                    #lay.load_from_file(self._temp_file_out, xmin, ymin)
-#                except RuntimeError:
-#                    pass
-
-#            # Update while POV-Ray renders
-#            while True:
-#                # print("***POV RENDER LOOP***")
-
-#                # test if POV-Ray exists
-#                if self._process.poll() is not None:
-#                    print("***POV PROCESS FINISHED***")
-#                    update_image()
-#                    break
-
-#                # user exit
-#                if self.test_break():
-#                    try:
-#                        self._process.terminate()
-#                        print("***POV PROCESS INTERRUPTED***")
-#                    except OSError:
-#                        pass
-
-#                    break
-
-#                # Would be nice to redirect the output
-#                # stdout_value, stderr_value = self._process.communicate() # locks
-
-#                # check if the file updated
-#                new_size = os.path.getsize(self._temp_file_out)
-
-#                if new_size != prev_size:
-#                    update_image()
-#                    prev_size = new_size
-
-#                time.sleep(self.DELAY)
+            '''
+            def update_image():
+                # possible the image wont load early on.
+                try:
+                    lay.load_from_file(self._temp_file_out)
+                    # XXX, tests for border render.
+                    #lay.load_from_file(self._temp_file_out, xmin, ymin)
+                    #lay.load_from_file(self._temp_file_out, xmin, ymin)
+                except RuntimeError:
+                    pass
+
+            # Update while POV-Ray renders
+            while True:
+                # print("***POV RENDER LOOP***")
+
+                # test if POV-Ray exists
+                if self._process.poll() is not None:
+                    print("***POV PROCESS FINISHED***")
+                    update_image()
+                    break
+
+                # user exit
+                if self.test_break():
+                    try:
+                        self._process.terminate()
+                        print("***POV PROCESS INTERRUPTED***")
+                    except OSError:
+                        pass
+
+                    break
+
+                # Would be nice to redirect the output
+                # stdout_value, stderr_value = self._process.communicate() # locks
+
+                # check if the file updated
+                new_size = os.path.getsize(self._temp_file_out)
+
+                if new_size != prev_size:
+                    update_image()
+                    prev_size = new_size
+
+                time.sleep(self.DELAY)
+            '''
 
             self.end_result(result)
 
diff --git a/release/scripts/addons/render_povray/ui.py b/release/scripts/addons/render_povray/ui.py
index 3c828d0..d53f280 100644
--- a/release/scripts/addons/render_povray/ui.py
+++ b/release/scripts/addons/render_povray/ui.py
@@ -179,7 +179,7 @@ class RENDER_PT_povray_export_settings(RenderButtonsPanel, bpy.types.Panel):
 
         scene = context.scene
 
-        layout.active = scene.pov.max_trace_level
+        layout.active = (scene.pov.max_trace_level != 0)
         split = layout.split()
 
         col = split.column()
@@ -199,7 +199,7 @@ class RENDER_PT_povray_export_settings(RenderButtonsPanel, bpy.types.Panel):
 
             split = layout.split()
             split.prop(scene.pov, "indentation_character", text="Indent")
-            if scene.pov.indentation_character == "2":
+            if scene.pov.indentation_character == 'SPACE':
                 split.prop(scene.pov, "indentation_spaces", text="Spaces")
 
             row = layout.row()
@@ -216,7 +216,7 @@ class RENDER_PT_povray_render_settings(RenderButtonsPanel, bpy.types.Panel):
 
         scene = context.scene
 
-        layout.active = scene.pov.max_trace_level
+        layout.active = (scene.pov.max_trace_level != 0)
 
         col = layout.column()
 
diff --git a/release/scripts/addons/render_renderfarmfi/__init__.py b/release/scripts/addons/render_renderfarmfi/__init__.py
index eec9ff6..ca55368 100644
--- a/release/scripts/addons/render_renderfarmfi/__init__.py
+++ b/release/scripts/addons/render_renderfarmfi/__init__.py
@@ -89,7 +89,10 @@ bpy.cancelError = False
 bpy.texturePackError = False
 bpy.linkedFileError = False
 bpy.uploadInProgress = False
-bpy.originalFileName = bpy.data.filepath
+try:
+    bpy.originalFileName = bpy.data.filepath
+except:
+    bpy.originalFileName = 'untitled.blend'
 bpy.particleBakeWarning = False
 bpy.childParticleWarning = False
 bpy.simulationWarning = False
@@ -117,7 +120,7 @@ class ORESession(bpy.types.PropertyGroup):
 class ORESettings(bpy.types.PropertyGroup):
     username = StringProperty(name='E-mail', description='E-mail for Renderfarm.fi', maxlen=256, default='')
     password = StringProperty(name='Password', description='Renderfarm.fi password', maxlen=256, default='')
-    
+
     shortdesc = StringProperty(name='Short description', description='A short description of the scene (100 characters)', maxlen=101, default='-')
     tags = StringProperty(name='Tags', description='A list of tags that best suit the animation', maxlen=102, default='')
     longdesc = StringProperty(name='Description', description='Description of the scene (2k)', maxlen=2048, default='')
@@ -127,7 +130,7 @@ class ORESettings(bpy.types.PropertyGroup):
     samples = IntProperty(name='Samples', description='Number of samples that is used (Cycles only)', min=1, max=1000000, soft_min=1, soft_max=100000, default=100)
     subsamples = IntProperty(name='Subsample Frames', description='Number of subsample frames that is used (Cycles only)', min=1, max=1000000, soft_min=1, soft_max=1000, default=10)
     file_format = StringProperty(name='File format', description='File format used for the rendering', maxlen=30, default='PNG_FORMAT')
-    
+
     parts = IntProperty(name='Parts/Frame', description='', min=1, max=1000, soft_min=1, soft_max=64, default=1)
     resox = IntProperty(name='Resolution X', description='X of render', min=1, max=10000, soft_min=1, soft_max=10000, default=1920)
     resoy = IntProperty(name='Resolution Y', description='Y of render', min=1, max=10000, soft_min=1, soft_max=10000, default=1080)
@@ -135,12 +138,12 @@ class ORESettings(bpy.types.PropertyGroup):
     start = IntProperty(name='Start Frame', description='Start Frame', default=1)
     end = IntProperty(name='End Frame', description='End Frame', default=250)
     fps = IntProperty(name='FPS', description='FPS', min=1, max=120, default=25)
-    
+
     prepared = BoolProperty(name='Prepared', description='Set to True if preparation has been run', default=False)
     debug = BoolProperty(name='Debug', description='Verbose output in console', default=False)
     selected_session = IntProperty(name='Selected Session', description='The selected session', default=0)
     hasUnsupportedSimulation = BoolProperty(name='HasSimulation', description='Set to True if therea re unsupported simulations', default=False)
-    
+
     inlicense = EnumProperty(items=licenses, name='Scene license', description='License speficied for the source files', default='1')
     outlicense = EnumProperty(items=licenses, name='Product license', description='License speficied for the output files', default='1')
     sessions = CollectionProperty(type=ORESession, name='Sessions', description='Sessions on Renderfarm.fi')
@@ -155,11 +158,11 @@ class ORESettings(bpy.types.PropertyGroup):
 
 class RENDERFARM_MT_Session(bpy.types.Menu):
     bl_label = "Show Session"
-    
+
     def draw(self, context):
         layout = self.layout
         ore = context.scene.ore_render
-        
+
         if (bpy.loginInserted == True):
             layout.operator('ore.completed_sessions')
             layout.operator('ore.accept_sessions')
diff --git a/release/scripts/addons/render_renderfarmfi/panels.py b/release/scripts/addons/render_renderfarmfi/panels.py
index b202a58..4c011a4 100644
--- a/release/scripts/addons/render_renderfarmfi/panels.py
+++ b/release/scripts/addons/render_renderfarmfi/panels.py
@@ -101,7 +101,7 @@ class SESSIONS_PT_RenderfarmFi(RenderButtonsPanel, bpy.types.Panel):
         if (bpy.passwordCorrect == True and bpy.loginInserted == True):
             layout = self.layout
             
-            layout.template_list("UI_UL_list", "", ore, 'all_sessions', ore, 'selected_session', rows=5)
+            layout.template_list("UI_UL_list", "rederfarmfi_render", ore, 'all_sessions', ore, 'selected_session', rows=5)
             layout.operator('ore.cancel_session')
             if (bpy.cancelError == True):
                 layout.label("This session cannot be cancelled")
diff --git a/release/scripts/addons/render_renderfarmfi/prepare.py b/release/scripts/addons/render_renderfarmfi/prepare.py
index 08b61b9..e59230d 100644
--- a/release/scripts/addons/render_renderfarmfi/prepare.py
+++ b/release/scripts/addons/render_renderfarmfi/prepare.py
@@ -71,7 +71,7 @@ def isFilterNode(node):
     return t==bpy.types.CompositorNodeBlur or t==bpy.types.CompositorNodeDBlur
 
 def changeSettings():
-    
+
     sce = bpy.context.scene
     rd = sce.render
     ore = sce.ore_render
@@ -82,17 +82,17 @@ def changeSettings():
     sce.frame_start = ore.start
     sce.frame_end = ore.end
     rd.fps = ore.fps
-    
+
     bpy.file_format_warning = False
     bpy.simulationWarning = False
     bpy.texturePackError = False
     bpy.particleBakeWarning = False
     bpy.childParticleWarning = False
-    
+
     if (rd.image_settings.file_format == 'HDR'):
         rd.image_settings.file_format = 'PNG'
         bpy.file_format_warning = True
-    
+
     # Convert between Blender's image format and BURP's formats
     if (rd.image_settings.file_format == 'PNG'):
         ore.file_format = 'PNG_FORMAT'
@@ -104,26 +104,26 @@ def changeSettings():
         ore.file_format = 'PNG_FORMAT'
     else:
         ore.file_format = 'PNG_FORMAT'
-        
+
     if (ore.engine == 'cycles'):
         bpy.context.scene.cycles.samples = ore.samples
-        
+
     if (ore.subsamples <= 0):
         ore.subsamples = 1
-    
+
     if (ore.samples / ore.subsamples < 100.0):
         ore.subsamples = float(ore.samples) / 100.0
-        
+
     # Multipart support doesn' work if SSS is used
     if ((rd.use_sss == True and hasSSSMaterial()) and ore.parts > 1):
         ore.parts = 1;
-    
+
     if (hasParticleSystem()):
         tuneParticles()
     else:
         bpy.particleBakeWarning = False
         bpy.childParticleWarning = False
-    
+
     if (hasUnsupportedSimulation()):
         simulationWarning = True
     else:
@@ -133,7 +133,7 @@ def _prepare_scene():
     sce = bpy.context.scene
     rd = sce.render
     ore = sce.ore_render
-    
+
     changeSettings()
 
     print("Packing external textures...")
@@ -143,7 +143,7 @@ def _prepare_scene():
     except Exception as e:
         bpy.texturePackError = True
         print(e)
-    
+
     linkedData = bpy.utils.blend_paths()
     if (len(linkedData) > 0):
         print("Appending linked .blend files...")
@@ -155,10 +155,13 @@ def _prepare_scene():
             print(e)
     else:
         print("No external .blends used, skipping...")
-    
+
     # Save with a different name
     print("Saving into a new file...")
-    bpy.originalFileName = bpy.data.filepath
+    try:
+        bpy.originalFileName = bpy.data.filepath
+    except:
+        bpy.originalFileName = 'untitled.blend'
     print("Original path is " + bpy.originalFileName)
     try:
         # If the filename is empty, we'll make one from the path of the user's resource folder
@@ -184,7 +187,7 @@ def _prepare_scene():
             bpy.ops.wm.save_mainfile(filepath=savePath)
     except Exception as e:
         print(e)
-    
+
     print(".blend prepared")
 
 
diff --git a/release/scripts/addons/rigify/__init__.py b/release/scripts/addons/rigify/__init__.py
index ca99e31..38f0c91 100644
--- a/release/scripts/addons/rigify/__init__.py
+++ b/release/scripts/addons/rigify/__init__.py
@@ -38,73 +38,11 @@ if "bpy" in locals():
     imp.reload(ui)
     imp.reload(utils)
     imp.reload(metarig_menu)
+    imp.reload(rig_lists)
 else:
-    from . import generate, ui, utils, metarig_menu
+    from . import utils, rig_lists, generate, ui, metarig_menu
 
 import bpy
-import os
-
-
-def get_rig_list(path):
-    """ Recursively searches for rig types, and returns a list.
-    """
-    rigs = []
-    MODULE_DIR = os.path.dirname(__file__)
-    RIG_DIR_ABS = os.path.join(MODULE_DIR, utils.RIG_DIR)
-    SEARCH_DIR_ABS = os.path.join(RIG_DIR_ABS, path)
-    files = os.listdir(SEARCH_DIR_ABS)
-    files.sort()
-
-    for f in files:
-        is_dir = os.path.isdir(os.path.join(SEARCH_DIR_ABS, f))  # Whether the file is a directory
-        if f[0] in {".", "_"}:
-            pass
-        elif f.count(".") >= 2 or (is_dir and "." in f):
-            print("Warning: %r, filename contains a '.', skipping" % os.path.join(SEARCH_DIR_ABS, f))
-        else:
-            if is_dir:
-                # Check directories
-                module_name = os.path.join(path, f).replace(os.sep, ".")
-                try:
-                    rig = utils.get_rig_type(module_name)
-                except ImportError as e:
-                    print("Rigify: " + str(e))
-                else:
-                    # Check if it's a rig itself
-                    if not hasattr(rig, "Rig"):
-                        # Check for sub-rigs
-                        ls = get_rig_list(os.path.join(path, f, ""))  # "" adds a final slash
-                        rigs.extend(["%s.%s" % (f, l) for l in ls])
-                    else:
-                        rigs += [f]
-
-            elif f.endswith(".py"):
-                # Check straight-up python files
-                t = f[:-3]
-                module_name = os.path.join(path, t).replace(os.sep, ".")
-                try:
-                    utils.get_rig_type(module_name).Rig
-                except (ImportError, AttributeError):
-                    pass
-                else:
-                    rigs += [t]
-    rigs.sort()
-    return rigs
-
-
-rig_list = get_rig_list("")
-
-
-collection_list = []
-for r in rig_list:
-    a = r.split(".")
-    if len(a) >= 2 and a[0] not in collection_list:
-        collection_list += [a[0]]
-
-
-col_enum_list = [("All", "All", ""), ("None", "None", "")]
-for c in collection_list:
-    col_enum_list += [(c, c, "")]
 
 
 class RigifyName(bpy.types.PropertyGroup):
@@ -131,18 +69,18 @@ def register():
     bpy.utils.register_class(RigifyArmatureLayer)
 
     bpy.types.PoseBone.rigify_type = bpy.props.StringProperty(name="Rigify Type", description="Rig type for this bone")
-    bpy.types.PoseBone.rigify_parameters = bpy.props.CollectionProperty(type=RigifyParameters)
+    bpy.types.PoseBone.rigify_parameters = bpy.props.PointerProperty(type=RigifyParameters)
 
     bpy.types.Armature.rigify_layers = bpy.props.CollectionProperty(type=RigifyArmatureLayer)
 
     IDStore = bpy.types.WindowManager
-    IDStore.rigify_collection = bpy.props.EnumProperty(items=col_enum_list, default="All", name="Rigify Active Collection", description="The selected rig collection")
+    IDStore.rigify_collection = bpy.props.EnumProperty(items=rig_lists.col_enum_list, default="All", name="Rigify Active Collection", description="The selected rig collection")
     IDStore.rigify_types = bpy.props.CollectionProperty(type=RigifyName)
     IDStore.rigify_active_type = bpy.props.IntProperty(name="Rigify Active Type", description="The selected rig type")
 
     # Add rig parameters
-    for rig in rig_list:
-        r = utils.get_rig_type(rig).Rig
+    for rig in rig_lists.rig_list:
+        r = utils.get_rig_type(rig)
         try:
             r.add_parameters(RigifyParameters)
         except AttributeError:
diff --git a/release/scripts/addons/rigify/generate.py b/release/scripts/addons/rigify/generate.py
index 2a6bb30..69c8863 100644
--- a/release/scripts/addons/rigify/generate.py
+++ b/release/scripts/addons/rigify/generate.py
@@ -24,14 +24,14 @@ import time
 import traceback
 import sys
 from rna_prop_ui import rna_idprop_ui_prop_get
-from rigify.utils import MetarigError, new_bone, get_rig_type
-from rigify.utils import ORG_PREFIX, MCH_PREFIX, DEF_PREFIX, WGT_PREFIX, ROOT_NAME, make_original_name
-from rigify.utils import RIG_DIR
-from rigify.utils import create_root_widget
-from rigify.utils import random_id
-from rigify.utils import copy_attributes
-from rigify.rig_ui_template import UI_SLIDERS, layers_ui, UI_REGISTER
-from rigify import rigs
+
+from .utils import MetarigError, new_bone, get_rig_type
+from .utils import ORG_PREFIX, MCH_PREFIX, DEF_PREFIX, WGT_PREFIX, ROOT_NAME, make_original_name
+from .utils import RIG_DIR
+from .utils import create_root_widget
+from .utils import random_id
+from .utils import copy_attributes
+from .rig_ui_template import UI_SLIDERS, layers_ui, UI_REGISTER
 
 RIG_MODULE = "rigs"
 ORG_LAYER = [n == 31 for n in range(0, 32)]  # Armature layer that original bones should be moved to.
@@ -157,17 +157,15 @@ def generate_rig(context, metarig):
 
         # rigify_type and rigify_parameters
         bone_gen.rigify_type = bone.rigify_type
-        if len(bone.rigify_parameters) > 0:
-            bone_gen.rigify_parameters.add()
-            for prop in dir(bone_gen.rigify_parameters[0]):
-                if (not prop.startswith("_")) \
-                and (not prop.startswith("bl_")) \
-                and (prop != "rna_type"):
-                    try:
-                        setattr(bone_gen.rigify_parameters[0], prop, \
-                                getattr(bone.rigify_parameters[0], prop))
-                    except AttributeError:
-                        print("FAILED TO COPY PARAMETER: " + str(prop))
+        for prop in dir(bone_gen.rigify_parameters):
+            if (not prop.startswith("_")) \
+            and (not prop.startswith("bl_")) \
+            and (prop != "rna_type"):
+                try:
+                    setattr(bone_gen.rigify_parameters, prop, \
+                            getattr(bone.rigify_parameters, prop))
+                except AttributeError:
+                    print("FAILED TO COPY PARAMETER: " + str(prop))
 
         # Custom properties
         for prop in bone.keys():
@@ -350,7 +348,7 @@ def generate_rig(context, metarig):
     # Assign shapes to bones
     # Object's with name WGT-<bone_name> get used as that bone's shape.
     for bone in bones:
-        wgt_name = (WGT_PREFIX + obj.data.bones[bone].name)[:21]  # Object names are limited to 21 characters... arg
+        wgt_name = (WGT_PREFIX + obj.data.bones[bone].name)[:63]  # Object names are limited to 63 characters... arg
         if wgt_name in context.scene.objects:
             # Weird temp thing because it won't let me index by object name
             for ob in context.scene.objects:
@@ -412,10 +410,7 @@ def get_bone_rigs(obj, bone_name, halt_on_missing=False):
         pass
     else:
         # Gather parameters
-        try:
-            params = obj.pose.bones[bone_name].rigify_parameters[0]
-        except (KeyError, IndexError):
-            params = None
+        params = obj.pose.bones[bone_name].rigify_parameters
 
         # Get the rig
         try:
diff --git a/release/scripts/addons/rigify/metarig_menu.py b/release/scripts/addons/rigify/metarig_menu.py
index 6133f37..4bdf270 100644
--- a/release/scripts/addons/rigify/metarig_menu.py
+++ b/release/scripts/addons/rigify/metarig_menu.py
@@ -18,40 +18,108 @@
 
 # <pep8 compliant>
 
+import os
+from string import capwords
+
 import bpy
-from rigify.metarigs import human
 
+from . import utils
+
+
+def get_metarig_list(path):
+    """ Searches for metarig modules, and returns a list of the
+        imported modules.
+    """
+    metarigs = []
+    MODULE_DIR = os.path.dirname(__file__)
+    METARIG_DIR_ABS = os.path.join(MODULE_DIR, utils.METARIG_DIR)
+    SEARCH_DIR_ABS = os.path.join(METARIG_DIR_ABS, path)
+    files = os.listdir(SEARCH_DIR_ABS)
+    files.sort()
+
+    for f in files:
+        # Is it a directory?
+        if os.path.isdir(os.path.join(SEARCH_DIR_ABS, f)):
+            continue
+        elif not f.endswith(".py"):
+            continue
+        elif f == "__init__.py":
+            continue
+        else:
+            module_name = f[:-3]
+            try:
+                metarigs += [utils.get_metarig_module(module_name)]
+            except (ImportError):
+                pass
+    return metarigs
 
-class AddHuman(bpy.types.Operator):
-    """Add an advanced human metarig base"""
-    bl_idname = "object.armature_human_advanced_add"
-    bl_label = "Add Humanoid (advanced metarig)"
-    bl_options = {'REGISTER', 'UNDO'}
 
+def make_metarig_add_execute(m):
+    """ Create an execute method for a metarig creation operator.
+    """
     def execute(self, context):
+        # Add armature object
         bpy.ops.object.armature_add()
         obj = context.active_object
-        mode_orig = obj.mode
-        bpy.ops.object.mode_set(mode='EDIT')  # grr, remove bone
+        obj.name = "metarig"
+
+        # Remove default bone
+        bpy.ops.object.mode_set(mode='EDIT')
         bones = context.active_object.data.edit_bones
         bones.remove(bones[0])
-        human.create(obj)
-        bpy.ops.object.mode_set(mode=mode_orig)
+
+        # Create metarig
+        m.create(obj)
+
+        bpy.ops.object.mode_set(mode='OBJECT')
         return {'FINISHED'}
+    return execute
+
+
+def make_metarig_menu_func(bl_idname, text):
+    """ For some reason lambda's don't work for adding multiple menu
+        items, so we use this instead to generate the functions.
+    """
+    def metarig_menu(self, context):
+        self.layout.operator(bl_idname, icon='OUTLINER_OB_ARMATURE', text=text)
+    return metarig_menu
+
+
+# Get the metarig modules
+metarigs = get_metarig_list("")
+
+# Create metarig add Operators
+metarig_ops = []
+for m in metarigs:
+    name = m.__name__.rsplit('.', 1)[1]
+
+    # Dynamically construct an Operator
+    T = type("Add_" + name + "_Metarig", (bpy.types.Operator,), {})
+    T.bl_idname = "object.armature_" + name + "_metarig_add"
+    T.bl_label = "Add " + name.replace("_", " ").capitalize() + " (metarig)"
+    T.bl_options = {'REGISTER', 'UNDO'}
+    T.execute = make_metarig_add_execute(m)
 
+    metarig_ops.append((T, name))
 
-# Add to a menu
-menu_func = (lambda self, context: self.layout.operator(AddHuman.bl_idname,
-                    icon='OUTLINER_OB_ARMATURE', text="Human (Meta-Rig)"))
+# Create menu functions
+menu_funcs = []
+for mop, name in metarig_ops:
+    text = capwords(name.replace("_", " ")) + " (Meta-Rig)"
+    menu_funcs += [make_metarig_menu_func(mop.bl_idname, text)]
 
 
 def register():
-    bpy.utils.register_class(AddHuman)
+    for mop, name in metarig_ops:
+        bpy.utils.register_class(mop)
 
-    bpy.types.INFO_MT_armature_add.append(menu_func)
+    for mf in menu_funcs:
+        bpy.types.INFO_MT_armature_add.append(mf)
 
 
 def unregister():
-    bpy.utils.unregister_class(AddHuman)
+    for mop, name in metarig_ops:
+        bpy.utils.unregister_class(mop)
 
-    bpy.types.INFO_MT_armature_add.remove(menu_func)
+    for mf in menu_funcs:
+        bpy.types.INFO_MT_armature_add.remove(mf)
diff --git a/release/scripts/addons/rigify/metarigs/human.py b/release/scripts/addons/rigify/metarigs/human.py
index 23ec248..3eafc98 100644
--- a/release/scripts/addons/rigify/metarigs/human.py
+++ b/release/scripts/addons/rigify/metarigs/human.py
@@ -83,13 +83,13 @@ def create(obj):
     bone.use_connect = False
     bone.parent = arm.edit_bones[bones['hips']]
     bones['thigh.R'] = bone.name
-    bone = arm.edit_bones.new('ribs')
+    bone = arm.edit_bones.new('chest')
     bone.head[:] = 0.0000, 0.0004, 1.3418
     bone.tail[:] = 0.0000, 0.0114, 1.6582
     bone.roll = 0.0000
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['spine']]
-    bones['ribs'] = bone.name
+    bones['chest'] = bone.name
     bone = arm.edit_bones.new('shin.L')
     bone.head[:] = 0.0980, -0.0286, 0.5372
     bone.tail[:] = 0.0980, 0.0162, 0.0852
@@ -109,21 +109,21 @@ def create(obj):
     bone.tail[:] = 0.0000, -0.0247, 1.7813
     bone.roll = 0.0000
     bone.use_connect = False
-    bone.parent = arm.edit_bones[bones['ribs']]
+    bone.parent = arm.edit_bones[bones['chest']]
     bones['neck'] = bone.name
     bone = arm.edit_bones.new('shoulder.L')
     bone.head[:] = 0.0183, -0.0684, 1.6051
     bone.tail[:] = 0.1694, 0.0205, 1.6050
     bone.roll = 0.0004
     bone.use_connect = False
-    bone.parent = arm.edit_bones[bones['ribs']]
+    bone.parent = arm.edit_bones[bones['chest']]
     bones['shoulder.L'] = bone.name
     bone = arm.edit_bones.new('shoulder.R')
     bone.head[:] = -0.0183, -0.0684, 1.6051
     bone.tail[:] = -0.1694, 0.0205, 1.6050
     bone.roll = -0.0004
     bone.use_connect = False
-    bone.parent = arm.edit_bones[bones['ribs']]
+    bone.parent = arm.edit_bones[bones['chest']]
     bones['shoulder.R'] = bone.name
     bone = arm.edit_bones.new('foot.L')
     bone.head[:] = 0.0980, 0.0162, 0.0852
@@ -286,13 +286,13 @@ def create(obj):
     bone.use_connect = False
     bone.parent = arm.edit_bones[bones['hand.R']]
     bones['palm.04.R'] = bone.name
-    bone = arm.edit_bones.new('finger_index.01.L')
+    bone = arm.edit_bones.new('f_index.01.L')
     bone.head[:] = 0.7464, 0.0051, 1.2482
     bone.tail[:] = 0.7718, 0.0013, 1.2112
     bone.roll = -2.0315
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.01.L']]
-    bones['finger_index.01.L'] = bone.name
+    bones['f_index.01.L'] = bone.name
     bone = arm.edit_bones.new('thumb.01.L')
     bone.head[:] = 0.6705, 0.0214, 1.2738
     bone.tail[:] = 0.6857, 0.0015, 1.2404
@@ -300,34 +300,34 @@ def create(obj):
     bone.use_connect = False
     bone.parent = arm.edit_bones[bones['palm.01.L']]
     bones['thumb.01.L'] = bone.name
-    bone = arm.edit_bones.new('finger_middle.01.L')
+    bone = arm.edit_bones.new('f_middle.01.L')
     bone.head[:] = 0.7518, 0.0277, 1.2487
     bone.tail[:] = 0.7762, 0.0234, 1.2058
     bone.roll = -2.0067
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.02.L']]
-    bones['finger_middle.01.L'] = bone.name
-    bone = arm.edit_bones.new('finger_ring.01.L')
+    bones['f_middle.01.L'] = bone.name
+    bone = arm.edit_bones.new('f_ring.01.L')
     bone.head[:] = 0.7540, 0.0521, 1.2482
     bone.tail[:] = 0.7715, 0.0499, 1.2070
     bone.roll = -2.0082
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.03.L']]
-    bones['finger_ring.01.L'] = bone.name
-    bone = arm.edit_bones.new('finger_pinky.01.L')
+    bones['f_ring.01.L'] = bone.name
+    bone = arm.edit_bones.new('f_pinky.01.L')
     bone.head[:] = 0.7528, 0.0763, 1.2428
     bone.tail[:] = 0.7589, 0.0765, 1.2156
     bone.roll = -1.9749
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.04.L']]
-    bones['finger_pinky.01.L'] = bone.name
-    bone = arm.edit_bones.new('finger_index.01.R')
+    bones['f_pinky.01.L'] = bone.name
+    bone = arm.edit_bones.new('f_index.01.R')
     bone.head[:] = -0.7464, 0.0051, 1.2482
     bone.tail[:] = -0.7718, 0.0012, 1.2112
     bone.roll = 2.0315
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.01.R']]
-    bones['finger_index.01.R'] = bone.name
+    bones['f_index.01.R'] = bone.name
     bone = arm.edit_bones.new('thumb.01.R')
     bone.head[:] = -0.6705, 0.0214, 1.2738
     bone.tail[:] = -0.6857, 0.0015, 1.2404
@@ -335,34 +335,34 @@ def create(obj):
     bone.use_connect = False
     bone.parent = arm.edit_bones[bones['palm.01.R']]
     bones['thumb.01.R'] = bone.name
-    bone = arm.edit_bones.new('finger_middle.01.R')
+    bone = arm.edit_bones.new('f_middle.01.R')
     bone.head[:] = -0.7518, 0.0277, 1.2487
     bone.tail[:] = -0.7762, 0.0233, 1.2058
     bone.roll = 2.0067
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.02.R']]
-    bones['finger_middle.01.R'] = bone.name
-    bone = arm.edit_bones.new('finger_ring.01.R')
+    bones['f_middle.01.R'] = bone.name
+    bone = arm.edit_bones.new('f_ring.01.R')
     bone.head[:] = -0.7540, 0.0521, 1.2482
     bone.tail[:] = -0.7715, 0.0499, 1.2070
     bone.roll = 2.0082
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.03.R']]
-    bones['finger_ring.01.R'] = bone.name
-    bone = arm.edit_bones.new('finger_pinky.01.R')
+    bones['f_ring.01.R'] = bone.name
+    bone = arm.edit_bones.new('f_pinky.01.R')
     bone.head[:] = -0.7528, 0.0763, 1.2428
     bone.tail[:] = -0.7589, 0.0765, 1.2156
     bone.roll = 1.9749
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['palm.04.R']]
-    bones['finger_pinky.01.R'] = bone.name
-    bone = arm.edit_bones.new('finger_index.02.L')
+    bones['f_pinky.01.R'] = bone.name
+    bone = arm.edit_bones.new('f_index.02.L')
     bone.head[:] = 0.7718, 0.0013, 1.2112
     bone.tail[:] = 0.7840, -0.0003, 1.1858
     bone.roll = -1.8799
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_index.01.L']]
-    bones['finger_index.02.L'] = bone.name
+    bone.parent = arm.edit_bones[bones['f_index.01.L']]
+    bones['f_index.02.L'] = bone.name
     bone = arm.edit_bones.new('thumb.02.L')
     bone.head[:] = 0.6857, 0.0015, 1.2404
     bone.tail[:] = 0.7056, -0.0057, 1.2145
@@ -370,34 +370,34 @@ def create(obj):
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['thumb.01.L']]
     bones['thumb.02.L'] = bone.name
-    bone = arm.edit_bones.new('finger_middle.02.L')
+    bone = arm.edit_bones.new('f_middle.02.L')
     bone.head[:] = 0.7762, 0.0234, 1.2058
     bone.tail[:] = 0.7851, 0.0218, 1.1749
     bone.roll = -1.8283
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_middle.01.L']]
-    bones['finger_middle.02.L'] = bone.name
-    bone = arm.edit_bones.new('finger_ring.02.L')
+    bone.parent = arm.edit_bones[bones['f_middle.01.L']]
+    bones['f_middle.02.L'] = bone.name
+    bone = arm.edit_bones.new('f_ring.02.L')
     bone.head[:] = 0.7715, 0.0499, 1.2070
     bone.tail[:] = 0.7794, 0.0494, 1.1762
     bone.roll = -1.8946
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_ring.01.L']]
-    bones['finger_ring.02.L'] = bone.name
-    bone = arm.edit_bones.new('finger_pinky.02.L')
+    bone.parent = arm.edit_bones[bones['f_ring.01.L']]
+    bones['f_ring.02.L'] = bone.name
+    bone = arm.edit_bones.new('f_pinky.02.L')
     bone.head[:] = 0.7589, 0.0765, 1.2156
     bone.tail[:] = 0.7618, 0.0770, 1.1932
     bone.roll = -1.9059
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_pinky.01.L']]
-    bones['finger_pinky.02.L'] = bone.name
-    bone = arm.edit_bones.new('finger_index.02.R')
+    bone.parent = arm.edit_bones[bones['f_pinky.01.L']]
+    bones['f_pinky.02.L'] = bone.name
+    bone = arm.edit_bones.new('f_index.02.R')
     bone.head[:] = -0.7718, 0.0012, 1.2112
     bone.tail[:] = -0.7840, -0.0003, 1.1858
     bone.roll = 1.8799
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_index.01.R']]
-    bones['finger_index.02.R'] = bone.name
+    bone.parent = arm.edit_bones[bones['f_index.01.R']]
+    bones['f_index.02.R'] = bone.name
     bone = arm.edit_bones.new('thumb.02.R')
     bone.head[:] = -0.6857, 0.0015, 1.2404
     bone.tail[:] = -0.7056, -0.0057, 1.2145
@@ -405,34 +405,34 @@ def create(obj):
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['thumb.01.R']]
     bones['thumb.02.R'] = bone.name
-    bone = arm.edit_bones.new('finger_middle.02.R')
+    bone = arm.edit_bones.new('f_middle.02.R')
     bone.head[:] = -0.7762, 0.0233, 1.2058
     bone.tail[:] = -0.7851, 0.0218, 1.1749
     bone.roll = 1.8283
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_middle.01.R']]
-    bones['finger_middle.02.R'] = bone.name
-    bone = arm.edit_bones.new('finger_ring.02.R')
+    bone.parent = arm.edit_bones[bones['f_middle.01.R']]
+    bones['f_middle.02.R'] = bone.name
+    bone = arm.edit_bones.new('f_ring.02.R')
     bone.head[:] = -0.7715, 0.0499, 1.2070
     bone.tail[:] = -0.7794, 0.0494, 1.1762
     bone.roll = 1.8946
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_ring.01.R']]
-    bones['finger_ring.02.R'] = bone.name
-    bone = arm.edit_bones.new('finger_pinky.02.R')
+    bone.parent = arm.edit_bones[bones['f_ring.01.R']]
+    bones['f_ring.02.R'] = bone.name
+    bone = arm.edit_bones.new('f_pinky.02.R')
     bone.head[:] = -0.7589, 0.0765, 1.2156
     bone.tail[:] = -0.7618, 0.0770, 1.1932
     bone.roll = 1.9059
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_pinky.01.R']]
-    bones['finger_pinky.02.R'] = bone.name
-    bone = arm.edit_bones.new('finger_index.03.L')
+    bone.parent = arm.edit_bones[bones['f_pinky.01.R']]
+    bones['f_pinky.02.R'] = bone.name
+    bone = arm.edit_bones.new('f_index.03.L')
     bone.head[:] = 0.7840, -0.0003, 1.1858
     bone.tail[:] = 0.7892, 0.0006, 1.1636
     bone.roll = -1.6760
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_index.02.L']]
-    bones['finger_index.03.L'] = bone.name
+    bone.parent = arm.edit_bones[bones['f_index.02.L']]
+    bones['f_index.03.L'] = bone.name
     bone = arm.edit_bones.new('thumb.03.L')
     bone.head[:] = 0.7056, -0.0057, 1.2145
     bone.tail[:] = 0.7194, -0.0098, 1.1995
@@ -440,34 +440,34 @@ def create(obj):
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['thumb.02.L']]
     bones['thumb.03.L'] = bone.name
-    bone = arm.edit_bones.new('finger_middle.03.L')
+    bone = arm.edit_bones.new('f_middle.03.L')
     bone.head[:] = 0.7851, 0.0218, 1.1749
     bone.tail[:] = 0.7888, 0.0216, 1.1525
     bone.roll = -1.7483
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_middle.02.L']]
-    bones['finger_middle.03.L'] = bone.name
-    bone = arm.edit_bones.new('finger_ring.03.L')
+    bone.parent = arm.edit_bones[bones['f_middle.02.L']]
+    bones['f_middle.03.L'] = bone.name
+    bone = arm.edit_bones.new('f_ring.03.L')
     bone.head[:] = 0.7794, 0.0494, 1.1762
     bone.tail[:] = 0.7781, 0.0498, 1.1577
     bone.roll = -1.6582
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_ring.02.L']]
-    bones['finger_ring.03.L'] = bone.name
-    bone = arm.edit_bones.new('finger_pinky.03.L')
+    bone.parent = arm.edit_bones[bones['f_ring.02.L']]
+    bones['f_ring.03.L'] = bone.name
+    bone = arm.edit_bones.new('f_pinky.03.L')
     bone.head[:] = 0.7618, 0.0770, 1.1932
     bone.tail[:] = 0.7611, 0.0772, 1.1782
     bone.roll = -1.7639
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_pinky.02.L']]
-    bones['finger_pinky.03.L'] = bone.name
-    bone = arm.edit_bones.new('finger_index.03.R')
+    bone.parent = arm.edit_bones[bones['f_pinky.02.L']]
+    bones['f_pinky.03.L'] = bone.name
+    bone = arm.edit_bones.new('f_index.03.R')
     bone.head[:] = -0.7840, -0.0003, 1.1858
     bone.tail[:] = -0.7892, 0.0006, 1.1636
     bone.roll = 1.6760
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_index.02.R']]
-    bones['finger_index.03.R'] = bone.name
+    bone.parent = arm.edit_bones[bones['f_index.02.R']]
+    bones['f_index.03.R'] = bone.name
     bone = arm.edit_bones.new('thumb.03.R')
     bone.head[:] = -0.7056, -0.0057, 1.2145
     bone.tail[:] = -0.7194, -0.0098, 1.1995
@@ -475,33 +475,32 @@ def create(obj):
     bone.use_connect = True
     bone.parent = arm.edit_bones[bones['thumb.02.R']]
     bones['thumb.03.R'] = bone.name
-    bone = arm.edit_bones.new('finger_middle.03.R')
+    bone = arm.edit_bones.new('f_middle.03.R')
     bone.head[:] = -0.7851, 0.0218, 1.1749
     bone.tail[:] = -0.7888, 0.0216, 1.1525
     bone.roll = 1.7483
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_middle.02.R']]
-    bones['finger_middle.03.R'] = bone.name
-    bone = arm.edit_bones.new('finger_ring.03.R')
+    bone.parent = arm.edit_bones[bones['f_middle.02.R']]
+    bones['f_middle.03.R'] = bone.name
+    bone = arm.edit_bones.new('f_ring.03.R')
     bone.head[:] = -0.7794, 0.0494, 1.1762
     bone.tail[:] = -0.7781, 0.0498, 1.1577
     bone.roll = 1.6582
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_ring.02.R']]
-    bones['finger_ring.03.R'] = bone.name
-    bone = arm.edit_bones.new('finger_pinky.03.R')
+    bone.parent = arm.edit_bones[bones['f_ring.02.R']]
+    bones['f_ring.03.R'] = bone.name
+    bone = arm.edit_bones.new('f_pinky.03.R')
     bone.head[:] = -0.7618, 0.0770, 1.1932
     bone.tail[:] = -0.7611, 0.0772, 1.1782
     bone.roll = 1.7639
     bone.use_connect = True
-    bone.parent = arm.edit_bones[bones['finger_pinky.02.R']]
-    bones['finger_pinky.03.R'] = bone.name
+    bone.parent = arm.edit_bones[bones['f_pinky.02.R']]
+    bones['f_pinky.03.R'] = bone.name
 
     bpy.ops.object.mode_set(mode='OBJECT')
     pbone = obj.pose.bones[bones['hips']]
     pbone.rigify_type = 'spine'
-    pbone.rigify_parameters.add()
-    pbone.rigify_parameters[0].chain_bone_controls = "1, 2, 3"
+    pbone.rigify_parameters.chain_bone_controls = "1, 2, 3"
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
     pbone.lock_rotation_w = False
@@ -524,13 +523,12 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_ik_layers = True
+        pbone.rigify_parameters.separate_ik_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
     pbone = obj.pose.bones[bones['thigh.R']]
@@ -541,16 +539,15 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_ik_layers = True
+        pbone.rigify_parameters.separate_ik_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['ribs']]
+    pbone = obj.pose.bones[bones['chest']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -590,7 +587,6 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'YXZ'
     pbone.bone.layers = [True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     pbone = obj.pose.bones[bones['shoulder.R']]
     pbone.rigify_type = 'basic.copy'
     pbone.lock_location = (True, True, True)
@@ -599,7 +595,6 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'YXZ'
     pbone.bone.layers = [True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     pbone = obj.pose.bones[bones['foot.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
@@ -664,13 +659,12 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_ik_layers = True
+        pbone.rigify_parameters.separate_ik_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
     pbone = obj.pose.bones[bones['upper_arm.R']]
@@ -681,13 +675,12 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_ik_layers = True
+        pbone.rigify_parameters.separate_ik_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
     pbone = obj.pose.bones[bones['toe.L']]
@@ -746,7 +739,6 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'YXZ'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     pbone = obj.pose.bones[bones['palm.02.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (True, True, True)
@@ -779,7 +771,6 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'YXZ'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     pbone = obj.pose.bones[bones['palm.02.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
@@ -804,7 +795,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'YXZ'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_index.01.L']]
+    pbone = obj.pose.bones[bones['f_index.01.L']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -812,13 +803,12 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
     pbone = obj.pose.bones[bones['thumb.01.L']]
@@ -829,16 +819,15 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_middle.01.L']]
+    pbone = obj.pose.bones[bones['f_middle.01.L']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -846,16 +835,15 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_ring.01.L']]
+    pbone = obj.pose.bones[bones['f_ring.01.L']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -863,16 +851,16 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
+
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_pinky.01.L']]
+    pbone = obj.pose.bones[bones['f_pinky.01.L']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -880,16 +868,16 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
+
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_index.01.R']]
+    pbone = obj.pose.bones[bones['f_index.01.R']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -897,13 +885,12 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     pbone = obj.pose.bones[bones['thumb.01.R']]
@@ -914,16 +901,15 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_middle.01.R']]
+    pbone = obj.pose.bones[bones['f_middle.01.R']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -931,16 +917,15 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_ring.01.R']]
+    pbone = obj.pose.bones[bones['f_ring.01.R']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -948,16 +933,15 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_pinky.01.R']]
+    pbone = obj.pose.bones[bones['f_pinky.01.R']]
     pbone.rigify_type = 'finger'
     pbone.lock_location = (True, True, True)
     pbone.lock_rotation = (False, False, False)
@@ -965,16 +949,15 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone.rigify_parameters.add()
     try:
-        pbone.rigify_parameters[0].separate_extra_layers = True
+        pbone.rigify_parameters.separate_extra_layers = True
     except AttributeError:
         pass
     try:
-        pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
+        pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
     except AttributeError:
         pass
-    pbone = obj.pose.bones[bones['finger_index.02.L']]
+    pbone = obj.pose.bones[bones['f_index.02.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -990,7 +973,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_middle.02.L']]
+    pbone = obj.pose.bones[bones['f_middle.02.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -998,7 +981,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_ring.02.L']]
+    pbone = obj.pose.bones[bones['f_ring.02.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1006,7 +989,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_pinky.02.L']]
+    pbone = obj.pose.bones[bones['f_pinky.02.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1014,7 +997,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_index.02.R']]
+    pbone = obj.pose.bones[bones['f_index.02.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1030,7 +1013,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_middle.02.R']]
+    pbone = obj.pose.bones[bones['f_middle.02.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1038,7 +1021,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_ring.02.R']]
+    pbone = obj.pose.bones[bones['f_ring.02.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1046,7 +1029,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_pinky.02.R']]
+    pbone = obj.pose.bones[bones['f_pinky.02.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1054,7 +1037,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_index.03.L']]
+    pbone = obj.pose.bones[bones['f_index.03.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1070,7 +1053,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_middle.03.L']]
+    pbone = obj.pose.bones[bones['f_middle.03.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1078,7 +1061,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_ring.03.L']]
+    pbone = obj.pose.bones[bones['f_ring.03.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1086,7 +1069,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_pinky.03.L']]
+    pbone = obj.pose.bones[bones['f_pinky.03.L']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1094,7 +1077,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_index.03.R']]
+    pbone = obj.pose.bones[bones['f_index.03.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1110,7 +1093,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_middle.03.R']]
+    pbone = obj.pose.bones[bones['f_middle.03.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1118,7 +1101,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_ring.03.R']]
+    pbone = obj.pose.bones[bones['f_ring.03.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
@@ -1126,7 +1109,7 @@ def create(obj):
     pbone.lock_scale = (False, False, False)
     pbone.rotation_mode = 'QUATERNION'
     pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
-    pbone = obj.pose.bones[bones['finger_pinky.03.R']]
+    pbone = obj.pose.bones[bones['f_pinky.03.R']]
     pbone.rigify_type = ''
     pbone.lock_location = (False, False, False)
     pbone.lock_rotation = (False, False, False)
diff --git a/release/scripts/addons/rigify/rig_lists.py b/release/scripts/addons/rigify/rig_lists.py
new file mode 100644
index 0000000..c8c5631
--- /dev/null
+++ b/release/scripts/addons/rigify/rig_lists.py
@@ -0,0 +1,83 @@
+#====================== BEGIN GPL LICENSE BLOCK ======================
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+#======================= END GPL LICENSE BLOCK ========================
+
+import os
+
+from . import utils
+
+
+def get_rig_list(path):
+    """ Recursively searches for rig types, and returns a list.
+    """
+    rigs = []
+    MODULE_DIR = os.path.dirname(__file__)
+    RIG_DIR_ABS = os.path.join(MODULE_DIR, utils.RIG_DIR)
+    SEARCH_DIR_ABS = os.path.join(RIG_DIR_ABS, path)
+    files = os.listdir(SEARCH_DIR_ABS)
+    files.sort()
+
+    for f in files:
+        is_dir = os.path.isdir(os.path.join(SEARCH_DIR_ABS, f))  # Whether the file is a directory
+        if f[0] in {".", "_"}:
+            pass
+        elif f.count(".") >= 2 or (is_dir and "." in f):
+            print("Warning: %r, filename contains a '.', skipping" % os.path.join(SEARCH_DIR_ABS, f))
+        else:
+            if is_dir:
+                # Check directories
+                module_name = os.path.join(path, f).replace(os.sep, ".")
+                try:
+                    rig = utils.get_rig_type(module_name)
+                except ImportError as e:
+                    print("Rigify: " + str(e))
+                else:
+                    # Check if it's a rig itself
+                    if not hasattr(rig, "Rig"):
+                        # Check for sub-rigs
+                        ls = get_rig_list(os.path.join(path, f, ""))  # "" adds a final slash
+                        rigs.extend(["%s.%s" % (f, l) for l in ls])
+                    else:
+                        rigs += [f]
+
+            elif f.endswith(".py"):
+                # Check straight-up python files
+                t = f[:-3]
+                module_name = os.path.join(path, t).replace(os.sep, ".")
+                try:
+                    utils.get_rig_type(module_name).Rig
+                except (ImportError, AttributeError):
+                    pass
+                else:
+                    rigs += [t]
+    rigs.sort()
+    return rigs
+
+
+def get_collection_list(rig_list):
+    collection_list = []
+    for r in rig_list:
+        a = r.split(".")
+        if len(a) >= 2 and a[0] not in collection_list:
+            collection_list += [a[0]]
+    return collection_list
+
+
+# Public variables
+rig_list = get_rig_list("")
+collection_list = get_collection_list(rig_list)
+col_enum_list = [("All", "All", ""), ("None", "None", "")] + [(c, c, "") for c in collection_list]
diff --git a/release/scripts/addons/rigify/rigs/basic/copy.py b/release/scripts/addons/rigify/rigs/basic/copy.py
index f0c5c38..50a2576 100644
--- a/release/scripts/addons/rigify/rigs/basic/copy.py
+++ b/release/scripts/addons/rigify/rigs/basic/copy.py
@@ -19,9 +19,10 @@
 # <pep8 compliant>
 
 import bpy
-from rigify.utils import copy_bone
-from rigify.utils import strip_org, make_deformer_name
-from rigify.utils import create_bone_widget
+
+from ...utils import copy_bone
+from ...utils import strip_org, make_deformer_name
+from ...utils import create_bone_widget
 
 
 class Rig:
@@ -82,61 +83,57 @@ class Rig:
             # Create control widget
             create_bone_widget(self.obj, bone)
 
-    @classmethod
-    def add_parameters(self, group):
-        """ Add the parameters of this rig type to the
-            RigifyParameters PropertyGroup
-        """
-        group.make_control = bpy.props.BoolProperty(name="Control", default=True, description="Create a control bone for the copy")
-        group.make_deform = bpy.props.BoolProperty(name="Deform", default=True, description="Create a deform bone for the copy")
-
-    @classmethod
-    def parameters_ui(self, layout, obj, bone):
-        """ Create the ui for the rig parameters.
-        """
-        params = obj.pose.bones[bone].rigify_parameters[0]
 
-        r = layout.row()
-        r.prop(params, "make_control")
-        r = layout.row()
-        r.prop(params, "make_deform")
-
-    @classmethod
-    def create_sample(self, obj):
-        """ Create a sample metarig for this rig type.
-
-        """
-        # generated by rigify.utils.write_metarig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
+def add_parameters(params):
+    """ Add the parameters of this rig type to the
+        RigifyParameters PropertyGroup
+    """
+    params.make_control = bpy.props.BoolProperty(name="Control", default=True, description="Create a control bone for the copy")
+    params.make_deform = bpy.props.BoolProperty(name="Deform", default=True, description="Create a deform bone for the copy")
 
-        bones = {}
 
-        bone = arm.edit_bones.new('Bone')
-        bone.head[:] = 0.0000, 0.0000, 0.0000
-        bone.tail[:] = 0.0000, 0.0000, 0.2000
-        bone.roll = 0.0000
-        bone.use_connect = False
-        bones['Bone'] = bone.name
+def parameters_ui(layout, params):
+    """ Create the ui for the rig parameters.
+    """
+    r = layout.row()
+    r.prop(params, "make_control")
+    r = layout.row()
+    r.prop(params, "make_deform")
 
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['Bone']]
-        pbone.rigify_type = 'simple.bone'
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone.rigify_parameters.add()
 
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+def create_sample(obj):
+    """ Create a sample metarig for this rig type.
+    """
+    # generated by rigify.utils.write_metarig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('Bone')
+    bone.head[:] = 0.0000, 0.0000, 0.0000
+    bone.tail[:] = 0.0000, 0.0000, 0.2000
+    bone.roll = 0.0000
+    bone.use_connect = False
+    bones['Bone'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['Bone']]
+    pbone.rigify_type = 'basic.copy'
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/rigs/basic/copy_chain.py b/release/scripts/addons/rigify/rigs/basic/copy_chain.py
index eaff060..4e42628 100644
--- a/release/scripts/addons/rigify/rigs/basic/copy_chain.py
+++ b/release/scripts/addons/rigify/rigs/basic/copy_chain.py
@@ -19,11 +19,12 @@
 # <pep8 compliant>
 
 import bpy
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone
-from rigify.utils import connected_children_names
-from rigify.utils import strip_org, make_deformer_name
-from rigify.utils import create_bone_widget
+
+from ...utils import MetarigError
+from ...utils import copy_bone
+from ...utils import connected_children_names
+from ...utils import strip_org, make_deformer_name
+from ...utils import create_bone_widget
 
 
 class Rig:
@@ -121,89 +122,85 @@ class Rig:
             for bone in ctrl_chain:
                 create_bone_widget(self.obj, bone)
 
-    @classmethod
-    def add_parameters(self, group):
-        """ Add the parameters of this rig type to the
-            RigifyParameters PropertyGroup
-        """
-        group.make_controls = bpy.props.BoolProperty(name="Controls", default=True, description="Create control bones for the copy")
-        group.make_deforms = bpy.props.BoolProperty(name="Deform", default=True, description="Create deform bones for the copy")
-
-    @classmethod
-    def parameters_ui(self, layout, obj, bone):
-        """ Create the ui for the rig parameters.
-        """
-        params = obj.pose.bones[bone].rigify_parameters[0]
 
-        r = layout.row()
-        r.prop(params, "make_controls")
-        r = layout.row()
-        r.prop(params, "make_deforms")
+def add_parameters(params):
+    """ Add the parameters of this rig type to the
+        RigifyParameters PropertyGroup
+    """
+    params.make_controls = bpy.props.BoolProperty(name="Controls", default=True, description="Create control bones for the copy")
+    params.make_deforms = bpy.props.BoolProperty(name="Deform", default=True, description="Create deform bones for the copy")
 
-    @classmethod
-    def create_sample(self, obj):
-        """ Create a sample metarig for this rig type.
 
-        """
-        # generated by rigify.utils.write_metarig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
-
-        bones = {}
-
-        bone = arm.edit_bones.new('bone.01')
-        bone.head[:] = 0.0000, 0.0000, 0.0000
-        bone.tail[:] = 0.0000, 0.0000, 0.3333
-        bone.roll = 0.0000
-        bone.use_connect = False
-        bones['bone.01'] = bone.name
-        bone = arm.edit_bones.new('bone.02')
-        bone.head[:] = 0.0000, 0.0000, 0.3333
-        bone.tail[:] = 0.0000, 0.0000, 0.6667
-        bone.roll = 3.1416
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['bone.01']]
-        bones['bone.02'] = bone.name
-        bone = arm.edit_bones.new('bone.03')
-        bone.head[:] = 0.0000, 0.0000, 0.6667
-        bone.tail[:] = 0.0000, 0.0000, 1.0000
-        bone.roll = 3.1416
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['bone.02']]
-        bones['bone.03'] = bone.name
+def parameters_ui(layout, params):
+    """ Create the ui for the rig parameters.
+    """
+    r = layout.row()
+    r.prop(params, "make_controls")
+    r = layout.row()
+    r.prop(params, "make_deforms")
 
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['bone.01']]
-        pbone.rigify_type = 'basic.copy_chain'
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone.rigify_parameters.add()
-        pbone = obj.pose.bones[bones['bone.02']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['bone.03']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
 
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+def create_sample(obj):
+    """ Create a sample metarig for this rig type.
+    """
+    # generated by rigify.utils.write_metarig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('bone.01')
+    bone.head[:] = 0.0000, 0.0000, 0.0000
+    bone.tail[:] = 0.0000, 0.0000, 0.3333
+    bone.roll = 0.0000
+    bone.use_connect = False
+    bones['bone.01'] = bone.name
+    bone = arm.edit_bones.new('bone.02')
+    bone.head[:] = 0.0000, 0.0000, 0.3333
+    bone.tail[:] = 0.0000, 0.0000, 0.6667
+    bone.roll = 3.1416
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['bone.01']]
+    bones['bone.02'] = bone.name
+    bone = arm.edit_bones.new('bone.03')
+    bone.head[:] = 0.0000, 0.0000, 0.6667
+    bone.tail[:] = 0.0000, 0.0000, 1.0000
+    bone.roll = 3.1416
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['bone.02']]
+    bones['bone.03'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['bone.01']]
+    pbone.rigify_type = 'basic.copy_chain'
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['bone.02']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['bone.03']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/rigs/biped/arm/__init__.py b/release/scripts/addons/rigify/rigs/biped/arm/__init__.py
index e6c426d..81b5535 100644
--- a/release/scripts/addons/rigify/rigs/biped/arm/__init__.py
+++ b/release/scripts/addons/rigify/rigs/biped/arm/__init__.py
@@ -88,148 +88,149 @@ class Rig:
         ik_controls = self.ik_rig.generate()
         return [script % (fk_controls[0], fk_controls[1], fk_controls[2], ik_controls[0], ik_controls[1], ik_controls[2], ik_controls[3])]
 
-    @classmethod
-    def add_parameters(self, group):
-        """ Add the parameters of this rig type to the
-            RigifyParameters PropertyGroup
 
-        """
-        items = [('X', 'X', ''), ('Y', 'Y', ''), ('Z', 'Z', ''), ('-X', '-X', ''), ('-Y', '-Y', ''), ('-Z', '-Z', '')]
-        group.primary_rotation_axis = bpy.props.EnumProperty(items=items, name="Primary Rotation Axis", default='X')
+def add_parameters(params):
+    """ Add the parameters of this rig type to the
+        RigifyParameters PropertyGroup
 
-        group.bend_hint = bpy.props.BoolProperty(name="Bend Hint", default=True, description="Give IK chain a hint about which way to bend.  Useful for perfectly straight chains")
+    """
+    items = [('X', 'X', ''), ('Y', 'Y', ''), ('Z', 'Z', ''), ('-X', '-X', ''), ('-Y', '-Y', ''), ('-Z', '-Z', '')]
+    params.primary_rotation_axis = bpy.props.EnumProperty(items=items, name="Primary Rotation Axis", default='X')
 
-        group.separate_ik_layers = bpy.props.BoolProperty(name="Separate IK Control Layers:", default=False, description="Enable putting the ik controls on a separate layer from the fk controls")
-        group.ik_layers = bpy.props.BoolVectorProperty(size=32, description="Layers for the ik controls to be on")
+    params.bend_hint = bpy.props.BoolProperty(name="Bend Hint", default=True, description="Give IK chain a hint about which way to bend.  Useful for perfectly straight chains")
+    params.elbow_target_base_name = bpy.props.StringProperty(name="Elbow Target Name", default="elbow_target", description="Base name for the generated elbow target")
 
-        group.use_upper_arm_twist = bpy.props.BoolProperty(name="Upper Arm Twist", default=True, description="Generate the dual-bone twist setup for the upper arm")
-        group.use_forearm_twist = bpy.props.BoolProperty(name="Forearm Twist", default=True, description="Generate the dual-bone twist setup for the forearm")
+    params.separate_ik_layers = bpy.props.BoolProperty(name="Separate IK Control Layers:", default=False, description="Enable putting the ik controls on a separate layer from the fk controls")
+    params.ik_layers = bpy.props.BoolVectorProperty(size=32, description="Layers for the ik controls to be on")
 
-    @classmethod
-    def parameters_ui(self, layout, obj, bone):
-        """ Create the ui for the rig parameters.
+    params.use_upper_arm_twist = bpy.props.BoolProperty(name="Upper Arm Twist", default=True, description="Generate the dual-bone twist setup for the upper arm")
+    params.use_forearm_twist = bpy.props.BoolProperty(name="Forearm Twist", default=True, description="Generate the dual-bone twist setup for the forearm")
 
-        """
-        params = obj.pose.bones[bone].rigify_parameters[0]
-
-        r = layout.row()
-        r.prop(params, "separate_ik_layers")
-
-        r = layout.row()
-        r.active = params.separate_ik_layers
-
-        col = r.column(align=True)
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=0, toggle=True, text="")
-        row.prop(params, "ik_layers", index=1, toggle=True, text="")
-        row.prop(params, "ik_layers", index=2, toggle=True, text="")
-        row.prop(params, "ik_layers", index=3, toggle=True, text="")
-        row.prop(params, "ik_layers", index=4, toggle=True, text="")
-        row.prop(params, "ik_layers", index=5, toggle=True, text="")
-        row.prop(params, "ik_layers", index=6, toggle=True, text="")
-        row.prop(params, "ik_layers", index=7, toggle=True, text="")
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=16, toggle=True, text="")
-        row.prop(params, "ik_layers", index=17, toggle=True, text="")
-        row.prop(params, "ik_layers", index=18, toggle=True, text="")
-        row.prop(params, "ik_layers", index=19, toggle=True, text="")
-        row.prop(params, "ik_layers", index=20, toggle=True, text="")
-        row.prop(params, "ik_layers", index=21, toggle=True, text="")
-        row.prop(params, "ik_layers", index=22, toggle=True, text="")
-        row.prop(params, "ik_layers", index=23, toggle=True, text="")
-
-        col = r.column(align=True)
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=8, toggle=True, text="")
-        row.prop(params, "ik_layers", index=9, toggle=True, text="")
-        row.prop(params, "ik_layers", index=10, toggle=True, text="")
-        row.prop(params, "ik_layers", index=11, toggle=True, text="")
-        row.prop(params, "ik_layers", index=12, toggle=True, text="")
-        row.prop(params, "ik_layers", index=13, toggle=True, text="")
-        row.prop(params, "ik_layers", index=14, toggle=True, text="")
-        row.prop(params, "ik_layers", index=15, toggle=True, text="")
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=24, toggle=True, text="")
-        row.prop(params, "ik_layers", index=25, toggle=True, text="")
-        row.prop(params, "ik_layers", index=26, toggle=True, text="")
-        row.prop(params, "ik_layers", index=27, toggle=True, text="")
-        row.prop(params, "ik_layers", index=28, toggle=True, text="")
-        row.prop(params, "ik_layers", index=29, toggle=True, text="")
-        row.prop(params, "ik_layers", index=30, toggle=True, text="")
-        row.prop(params, "ik_layers", index=31, toggle=True, text="")
-
-        r = layout.row()
-        r.label(text="Elbow rotation axis:")
-        r.prop(params, "primary_rotation_axis", text="")
-
-        r = layout.row()
-        r.prop(params, "bend_hint")
-
-        col = layout.column()
-        col.prop(params, "use_upper_arm_twist")
-        col.prop(params, "use_forearm_twist")
-
-    @classmethod
-    def create_sample(self, obj):
-        # generated by rigify.utils.write_meta_rig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
-
-        bones = {}
-
-        bone = arm.edit_bones.new('upper_arm')
-        bone.head[:] = 0.0000, 0.0000, 0.0000
-        bone.tail[:] = 0.3000, 0.0300, 0.0000
-        bone.roll = 1.5708
-        bone.use_connect = False
-        bones['upper_arm'] = bone.name
-        bone = arm.edit_bones.new('forearm')
-        bone.head[:] = 0.3000, 0.0300, 0.0000
-        bone.tail[:] = 0.6000, 0.0000, 0.0000
-        bone.roll = 1.5708
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['upper_arm']]
-        bones['forearm'] = bone.name
-        bone = arm.edit_bones.new('hand')
-        bone.head[:] = 0.6000, 0.0000, 0.0000
-        bone.tail[:] = 0.7000, 0.0000, 0.0000
-        bone.roll = 3.1416
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['forearm']]
-        bones['hand'] = bone.name
-
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['upper_arm']]
-        pbone.rigify_type = 'biped.arm'
-        pbone.lock_location = (True, True, True)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone.rigify_parameters.add()
-        pbone = obj.pose.bones[bones['forearm']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['hand']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+
+def parameters_ui(layout, params):
+    """ Create the ui for the rig parameters.
+
+    """
+    r = layout.row()
+    r.prop(params, "elbow_target_base_name")
+
+    r = layout.row()
+    r.prop(params, "separate_ik_layers")
+
+    r = layout.row()
+    r.active = params.separate_ik_layers
+
+    col = r.column(align=True)
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=0, toggle=True, text="")
+    row.prop(params, "ik_layers", index=1, toggle=True, text="")
+    row.prop(params, "ik_layers", index=2, toggle=True, text="")
+    row.prop(params, "ik_layers", index=3, toggle=True, text="")
+    row.prop(params, "ik_layers", index=4, toggle=True, text="")
+    row.prop(params, "ik_layers", index=5, toggle=True, text="")
+    row.prop(params, "ik_layers", index=6, toggle=True, text="")
+    row.prop(params, "ik_layers", index=7, toggle=True, text="")
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=16, toggle=True, text="")
+    row.prop(params, "ik_layers", index=17, toggle=True, text="")
+    row.prop(params, "ik_layers", index=18, toggle=True, text="")
+    row.prop(params, "ik_layers", index=19, toggle=True, text="")
+    row.prop(params, "ik_layers", index=20, toggle=True, text="")
+    row.prop(params, "ik_layers", index=21, toggle=True, text="")
+    row.prop(params, "ik_layers", index=22, toggle=True, text="")
+    row.prop(params, "ik_layers", index=23, toggle=True, text="")
+
+    col = r.column(align=True)
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=8, toggle=True, text="")
+    row.prop(params, "ik_layers", index=9, toggle=True, text="")
+    row.prop(params, "ik_layers", index=10, toggle=True, text="")
+    row.prop(params, "ik_layers", index=11, toggle=True, text="")
+    row.prop(params, "ik_layers", index=12, toggle=True, text="")
+    row.prop(params, "ik_layers", index=13, toggle=True, text="")
+    row.prop(params, "ik_layers", index=14, toggle=True, text="")
+    row.prop(params, "ik_layers", index=15, toggle=True, text="")
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=24, toggle=True, text="")
+    row.prop(params, "ik_layers", index=25, toggle=True, text="")
+    row.prop(params, "ik_layers", index=26, toggle=True, text="")
+    row.prop(params, "ik_layers", index=27, toggle=True, text="")
+    row.prop(params, "ik_layers", index=28, toggle=True, text="")
+    row.prop(params, "ik_layers", index=29, toggle=True, text="")
+    row.prop(params, "ik_layers", index=30, toggle=True, text="")
+    row.prop(params, "ik_layers", index=31, toggle=True, text="")
+
+    r = layout.row()
+    r.label(text="Elbow rotation axis:")
+    r.prop(params, "primary_rotation_axis", text="")
+
+    r = layout.row()
+    r.prop(params, "bend_hint")
+
+    col = layout.column()
+    col.prop(params, "use_upper_arm_twist")
+    col.prop(params, "use_forearm_twist")
+
+
+def create_sample(obj):
+    # generated by rigify.utils.write_meta_rig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('upper_arm')
+    bone.head[:] = 0.0000, 0.0000, 0.0000
+    bone.tail[:] = 0.3000, 0.0300, 0.0000
+    bone.roll = 1.5708
+    bone.use_connect = False
+    bones['upper_arm'] = bone.name
+    bone = arm.edit_bones.new('forearm')
+    bone.head[:] = 0.3000, 0.0300, 0.0000
+    bone.tail[:] = 0.6000, 0.0000, 0.0000
+    bone.roll = 1.5708
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['upper_arm']]
+    bones['forearm'] = bone.name
+    bone = arm.edit_bones.new('hand')
+    bone.head[:] = 0.6000, 0.0000, 0.0000
+    bone.tail[:] = 0.7000, 0.0000, 0.0000
+    bone.roll = 3.1416
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['forearm']]
+    bones['hand'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['upper_arm']]
+    pbone.rigify_type = 'biped.arm'
+    pbone.lock_location = (True, True, True)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['forearm']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['hand']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/rigs/biped/arm/deform.py b/release/scripts/addons/rigify/rigs/biped/arm/deform.py
index 4ed2cc4..ad6d863 100644
--- a/release/scripts/addons/rigify/rigs/biped/arm/deform.py
+++ b/release/scripts/addons/rigify/rigs/biped/arm/deform.py
@@ -18,13 +18,15 @@
 
 # <pep8 compliant>
 
-import bpy
 from math import acos
+
+import bpy
 from mathutils import Vector, Matrix
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone, put_bone
-from rigify.utils import connected_children_names
-from rigify.utils import strip_org, make_mechanism_name, make_deformer_name
+
+from ....utils import MetarigError
+from ....utils import copy_bone, put_bone
+from ....utils import connected_children_names
+from ....utils import strip_org, make_mechanism_name, make_deformer_name
 
 
 def align_roll(obj, bone1, bone2):
diff --git a/release/scripts/addons/rigify/rigs/biped/arm/fk.py b/release/scripts/addons/rigify/rigs/biped/arm/fk.py
index 7703122..54b1a45 100644
--- a/release/scripts/addons/rigify/rigs/biped/arm/fk.py
+++ b/release/scripts/addons/rigify/rigs/biped/arm/fk.py
@@ -19,14 +19,15 @@
 # <pep8 compliant>
 
 import bpy
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone
-from rigify.utils import connected_children_names
-from rigify.utils import strip_org, make_mechanism_name
-from rigify.utils import get_layers
-from rigify.utils import create_widget, create_limb_widget
 from rna_prop_ui import rna_idprop_ui_prop_get
 
+from ....utils import MetarigError
+from ....utils import copy_bone
+from ....utils import connected_children_names
+from ....utils import strip_org, make_mechanism_name, insert_before_lr
+from ....utils import get_layers
+from ....utils import create_widget, create_limb_widget
+
 
 class Rig:
     """ An FK arm rig, with hinge switch.
@@ -72,9 +73,9 @@ class Rig:
         bpy.ops.object.mode_set(mode='EDIT')
 
         # Create the control bones
-        uarm = copy_bone(self.obj, self.org_bones[0], strip_org(self.org_bones[0]))
-        farm = copy_bone(self.obj, self.org_bones[1], strip_org(self.org_bones[1]))
-        hand = copy_bone(self.obj, self.org_bones[2], strip_org(self.org_bones[2]))
+        uarm = copy_bone(self.obj, self.org_bones[0], strip_org(insert_before_lr(self.org_bones[0], ".fk")))
+        farm = copy_bone(self.obj, self.org_bones[1], strip_org(insert_before_lr(self.org_bones[1], ".fk")))
+        hand = copy_bone(self.obj, self.org_bones[2], strip_org(insert_before_lr(self.org_bones[2], ".fk")))
 
         # Create the hinge bones
         if self.org_parent != None:
diff --git a/release/scripts/addons/rigify/rigs/biped/arm/ik.py b/release/scripts/addons/rigify/rigs/biped/arm/ik.py
index 31383b5..8f28860 100644
--- a/release/scripts/addons/rigify/rigs/biped/arm/ik.py
+++ b/release/scripts/addons/rigify/rigs/biped/arm/ik.py
@@ -18,15 +18,17 @@
 
 # <pep8 compliant>
 
-import bpy
-from mathutils import Vector
 from math import pi, acos
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone
-from rigify.utils import connected_children_names
-from rigify.utils import strip_org, make_mechanism_name, insert_before_lr
-from rigify.utils import create_widget, create_line_widget, create_sphere_widget
+
+import bpy
 from rna_prop_ui import rna_idprop_ui_prop_get
+from mathutils import Vector
+
+from ....utils import MetarigError
+from ....utils import copy_bone
+from ....utils import connected_children_names
+from ....utils import strip_org, make_mechanism_name, insert_before_lr
+from ....utils import create_widget, create_line_widget, create_sphere_widget
 
 
 def angle_on_plane(plane, vec1, vec2):
@@ -98,14 +100,15 @@ class Rig:
         bpy.ops.object.mode_set(mode='EDIT')
 
         # Create the bones
-        uarm = copy_bone(self.obj, self.org_bones[0], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[0], "_ik"))))
-        farm = copy_bone(self.obj, self.org_bones[1], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[1], "_ik"))))
+        uarm = copy_bone(self.obj, self.org_bones[0], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[0], ".ik"))))
+        farm = copy_bone(self.obj, self.org_bones[1], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[1], ".ik"))))
 
-        hand = copy_bone(self.obj, self.org_bones[2], strip_org(insert_before_lr(self.org_bones[2], "_ik")))
-        pole = copy_bone(self.obj, self.org_bones[0], strip_org(insert_before_lr(self.org_bones[0], "_pole")))
+        hand = copy_bone(self.obj, self.org_bones[2], strip_org(insert_before_lr(self.org_bones[2], ".ik")))
+        pole_target_name = self.params.elbow_target_base_name + "." + insert_before_lr(self.org_bones[0], ".ik").split(".", 1)[1]
+        pole = copy_bone(self.obj, self.org_bones[0], pole_target_name)
 
-        vishand = copy_bone(self.obj, self.org_bones[2], "VIS-" + strip_org(insert_before_lr(self.org_bones[2], "_ik")))
-        vispole = copy_bone(self.obj, self.org_bones[1], "VIS-" + strip_org(insert_before_lr(self.org_bones[0], "_pole")))
+        vishand = copy_bone(self.obj, self.org_bones[2], "VIS-" + strip_org(insert_before_lr(self.org_bones[2], ".ik")))
+        vispole = copy_bone(self.obj, self.org_bones[1], "VIS-" + strip_org(insert_before_lr(self.org_bones[0], "_pole.ik")))
 
         # Get edit bones
         eb = self.obj.data.edit_bones
diff --git a/release/scripts/addons/rigify/rigs/biped/leg/__init__.py b/release/scripts/addons/rigify/rigs/biped/leg/__init__.py
index 3827d7c..36619c9 100644
--- a/release/scripts/addons/rigify/rigs/biped/leg/__init__.py
+++ b/release/scripts/addons/rigify/rigs/biped/leg/__init__.py
@@ -90,183 +90,185 @@ class Rig:
         ik_controls = self.ik_rig.generate()
         return [script % (fk_controls[0], fk_controls[1], fk_controls[2], fk_controls[3], ik_controls[0], ik_controls[1], ik_controls[2], ik_controls[3], ik_controls[4], ik_controls[5])]
 
-    @classmethod
-    def add_parameters(self, group):
-        """ Add the parameters of this rig type to the
-            RigifyParameters PropertyGroup
 
-        """
-        items = [('X', 'X', ''), ('Y', 'Y', ''), ('Z', 'Z', ''), ('-X', '-X', ''), ('-Y', '-Y', ''), ('-Z', '-Z', '')]
-        group.primary_rotation_axis = bpy.props.EnumProperty(items=items, name="Primary Rotation Axis", default='X')
+def add_parameters(params):
+    """ Add the parameters of this rig type to the
+        RigifyParameters PropertyGroup
 
-        group.bend_hint = bpy.props.BoolProperty(name="Bend Hint", default=True, description="Give IK chain a hint about which way to bend (useful for perfectly straight chains)")
+    """
+    items = [('X', 'X', ''), ('Y', 'Y', ''), ('Z', 'Z', ''), ('-X', '-X', ''), ('-Y', '-Y', ''), ('-Z', '-Z', '')]
+    params.primary_rotation_axis = bpy.props.EnumProperty(items=items, name="Primary Rotation Axis", default='X')
 
-        group.separate_ik_layers = bpy.props.BoolProperty(name="Separate IK Control Layers:", default=False, description="Enable putting the ik controls on a separate layer from the fk controls")
-        group.ik_layers = bpy.props.BoolVectorProperty(size=32, description="Layers for the ik controls to be on")
+    params.bend_hint = bpy.props.BoolProperty(name="Bend Hint", default=True, description="Give IK chain a hint about which way to bend (useful for perfectly straight chains)")
+    params.knee_target_base_name = bpy.props.StringProperty(name="Knee Target Name", default="knee_target", description="Base name for the generated knee target")
 
-        group.use_thigh_twist = bpy.props.BoolProperty(name="Thigh Twist", default=True, description="Generate the dual-bone twist setup for the thigh")
-        group.use_shin_twist = bpy.props.BoolProperty(name="Shin Twist", default=True, description="Generate the dual-bone twist setup for the shin")
 
-    @classmethod
-    def parameters_ui(self, layout, obj, bone):
-        """ Create the ui for the rig parameters.
+    params.separate_ik_layers = bpy.props.BoolProperty(name="Separate IK Control Layers:", default=False, description="Enable putting the ik controls on a separate layer from the fk controls")
+    params.ik_layers = bpy.props.BoolVectorProperty(size=32, description="Layers for the ik controls to be on")
 
-        """
-        params = obj.pose.bones[bone].rigify_parameters[0]
-
-        r = layout.row()
-        r.prop(params, "separate_ik_layers")
-
-        r = layout.row()
-        r.active = params.separate_ik_layers
-
-        col = r.column(align=True)
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=0, toggle=True, text="")
-        row.prop(params, "ik_layers", index=1, toggle=True, text="")
-        row.prop(params, "ik_layers", index=2, toggle=True, text="")
-        row.prop(params, "ik_layers", index=3, toggle=True, text="")
-        row.prop(params, "ik_layers", index=4, toggle=True, text="")
-        row.prop(params, "ik_layers", index=5, toggle=True, text="")
-        row.prop(params, "ik_layers", index=6, toggle=True, text="")
-        row.prop(params, "ik_layers", index=7, toggle=True, text="")
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=16, toggle=True, text="")
-        row.prop(params, "ik_layers", index=17, toggle=True, text="")
-        row.prop(params, "ik_layers", index=18, toggle=True, text="")
-        row.prop(params, "ik_layers", index=19, toggle=True, text="")
-        row.prop(params, "ik_layers", index=20, toggle=True, text="")
-        row.prop(params, "ik_layers", index=21, toggle=True, text="")
-        row.prop(params, "ik_layers", index=22, toggle=True, text="")
-        row.prop(params, "ik_layers", index=23, toggle=True, text="")
-
-        col = r.column(align=True)
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=8, toggle=True, text="")
-        row.prop(params, "ik_layers", index=9, toggle=True, text="")
-        row.prop(params, "ik_layers", index=10, toggle=True, text="")
-        row.prop(params, "ik_layers", index=11, toggle=True, text="")
-        row.prop(params, "ik_layers", index=12, toggle=True, text="")
-        row.prop(params, "ik_layers", index=13, toggle=True, text="")
-        row.prop(params, "ik_layers", index=14, toggle=True, text="")
-        row.prop(params, "ik_layers", index=15, toggle=True, text="")
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=24, toggle=True, text="")
-        row.prop(params, "ik_layers", index=25, toggle=True, text="")
-        row.prop(params, "ik_layers", index=26, toggle=True, text="")
-        row.prop(params, "ik_layers", index=27, toggle=True, text="")
-        row.prop(params, "ik_layers", index=28, toggle=True, text="")
-        row.prop(params, "ik_layers", index=29, toggle=True, text="")
-        row.prop(params, "ik_layers", index=30, toggle=True, text="")
-        row.prop(params, "ik_layers", index=31, toggle=True, text="")
-
-        r = layout.row()
-        r.label(text="Knee rotation axis:")
-        r.prop(params, "primary_rotation_axis", text="")
-
-        r = layout.row()
-        r.prop(params, "bend_hint")
-
-        col = layout.column()
-        col.prop(params, "use_thigh_twist")
-        col.prop(params, "use_shin_twist")
-
-    @classmethod
-    def create_sample(self, obj):
-        # generated by rigify.utils.write_meta_rig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
-
-        bones = {}
-
-        bone = arm.edit_bones.new('thigh')
-        bone.head[:] = -0.0000, 0.0000, 1.0000
-        bone.tail[:] = -0.0000, -0.0500, 0.5000
-        bone.roll = -0.0000
-        bone.use_connect = False
-        bones['thigh'] = bone.name
-        bone = arm.edit_bones.new('shin')
-        bone.head[:] = -0.0000, -0.0500, 0.5000
-        bone.tail[:] = -0.0000, 0.0000, 0.1000
-        bone.roll = -0.0000
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['thigh']]
-        bones['shin'] = bone.name
-        bone = arm.edit_bones.new('foot')
-        bone.head[:] = -0.0000, 0.0000, 0.1000
-        bone.tail[:] = 0.0000, -0.1200, 0.0300
-        bone.roll = 0.0000
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['shin']]
-        bones['foot'] = bone.name
-        bone = arm.edit_bones.new('heel')
-        bone.head[:] = -0.0000, 0.0000, 0.1000
-        bone.tail[:] = -0.0000, 0.0600, 0.0000
-        bone.roll = -0.0000
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['shin']]
-        bones['heel'] = bone.name
-        bone = arm.edit_bones.new('heel.02')
-        bone.head[:] = -0.0500, -0.0200, 0.0000
-        bone.tail[:] = 0.0500, -0.0200, 0.0000
-        bone.roll = 0.0000
-        bone.use_connect = False
-        bone.parent = arm.edit_bones[bones['heel']]
-        bones['heel.02'] = bone.name
-        bone = arm.edit_bones.new('toe')
-        bone.head[:] = 0.0000, -0.1200, 0.0300
-        bone.tail[:] = 0.0000, -0.2000, 0.0300
-        bone.roll = 3.1416
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['foot']]
-        bones['toe'] = bone.name
-
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['thigh']]
-        pbone.rigify_type = 'biped.leg'
-        pbone.lock_location = (True, True, True)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone.rigify_parameters.add()
-        pbone = obj.pose.bones[bones['shin']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['foot']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['heel']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['toe']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+    params.use_thigh_twist = bpy.props.BoolProperty(name="Thigh Twist", default=True, description="Generate the dual-bone twist setup for the thigh")
+    params.use_shin_twist = bpy.props.BoolProperty(name="Shin Twist", default=True, description="Generate the dual-bone twist setup for the shin")
+
+
+def parameters_ui(layout, params):
+    """ Create the ui for the rig parameters.
+
+    """
+    r = layout.row()
+    r.prop(params, "knee_target_base_name")
+
+    r = layout.row()
+    r.prop(params, "separate_ik_layers")
+
+    r = layout.row()
+    r.active = params.separate_ik_layers
+
+    col = r.column(align=True)
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=0, toggle=True, text="")
+    row.prop(params, "ik_layers", index=1, toggle=True, text="")
+    row.prop(params, "ik_layers", index=2, toggle=True, text="")
+    row.prop(params, "ik_layers", index=3, toggle=True, text="")
+    row.prop(params, "ik_layers", index=4, toggle=True, text="")
+    row.prop(params, "ik_layers", index=5, toggle=True, text="")
+    row.prop(params, "ik_layers", index=6, toggle=True, text="")
+    row.prop(params, "ik_layers", index=7, toggle=True, text="")
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=16, toggle=True, text="")
+    row.prop(params, "ik_layers", index=17, toggle=True, text="")
+    row.prop(params, "ik_layers", index=18, toggle=True, text="")
+    row.prop(params, "ik_layers", index=19, toggle=True, text="")
+    row.prop(params, "ik_layers", index=20, toggle=True, text="")
+    row.prop(params, "ik_layers", index=21, toggle=True, text="")
+    row.prop(params, "ik_layers", index=22, toggle=True, text="")
+    row.prop(params, "ik_layers", index=23, toggle=True, text="")
+
+    col = r.column(align=True)
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=8, toggle=True, text="")
+    row.prop(params, "ik_layers", index=9, toggle=True, text="")
+    row.prop(params, "ik_layers", index=10, toggle=True, text="")
+    row.prop(params, "ik_layers", index=11, toggle=True, text="")
+    row.prop(params, "ik_layers", index=12, toggle=True, text="")
+    row.prop(params, "ik_layers", index=13, toggle=True, text="")
+    row.prop(params, "ik_layers", index=14, toggle=True, text="")
+    row.prop(params, "ik_layers", index=15, toggle=True, text="")
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=24, toggle=True, text="")
+    row.prop(params, "ik_layers", index=25, toggle=True, text="")
+    row.prop(params, "ik_layers", index=26, toggle=True, text="")
+    row.prop(params, "ik_layers", index=27, toggle=True, text="")
+    row.prop(params, "ik_layers", index=28, toggle=True, text="")
+    row.prop(params, "ik_layers", index=29, toggle=True, text="")
+    row.prop(params, "ik_layers", index=30, toggle=True, text="")
+    row.prop(params, "ik_layers", index=31, toggle=True, text="")
+
+    r = layout.row()
+    r.label(text="Knee rotation axis:")
+    r.prop(params, "primary_rotation_axis", text="")
+
+    r = layout.row()
+    r.prop(params, "bend_hint")
+
+    col = layout.column()
+    col.prop(params, "use_thigh_twist")
+    col.prop(params, "use_shin_twist")
+
+
+def create_sample(obj):
+    # generated by rigify.utils.write_meta_rig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('thigh')
+    bone.head[:] = -0.0000, 0.0000, 1.0000
+    bone.tail[:] = -0.0000, -0.0500, 0.5000
+    bone.roll = -0.0000
+    bone.use_connect = False
+    bones['thigh'] = bone.name
+    bone = arm.edit_bones.new('shin')
+    bone.head[:] = -0.0000, -0.0500, 0.5000
+    bone.tail[:] = -0.0000, 0.0000, 0.1000
+    bone.roll = -0.0000
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['thigh']]
+    bones['shin'] = bone.name
+    bone = arm.edit_bones.new('foot')
+    bone.head[:] = -0.0000, 0.0000, 0.1000
+    bone.tail[:] = 0.0000, -0.1200, 0.0300
+    bone.roll = 0.0000
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['shin']]
+    bones['foot'] = bone.name
+    bone = arm.edit_bones.new('heel')
+    bone.head[:] = -0.0000, 0.0000, 0.1000
+    bone.tail[:] = -0.0000, 0.0600, 0.0000
+    bone.roll = -0.0000
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['shin']]
+    bones['heel'] = bone.name
+    bone = arm.edit_bones.new('heel.02')
+    bone.head[:] = -0.0500, -0.0200, 0.0000
+    bone.tail[:] = 0.0500, -0.0200, 0.0000
+    bone.roll = 0.0000
+    bone.use_connect = False
+    bone.parent = arm.edit_bones[bones['heel']]
+    bones['heel.02'] = bone.name
+    bone = arm.edit_bones.new('toe')
+    bone.head[:] = 0.0000, -0.1200, 0.0300
+    bone.tail[:] = 0.0000, -0.2000, 0.0300
+    bone.roll = 3.1416
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['foot']]
+    bones['toe'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['thigh']]
+    pbone.rigify_type = 'biped.leg'
+    pbone.lock_location = (True, True, True)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['shin']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['foot']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['heel']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['toe']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/rigs/biped/leg/deform.py b/release/scripts/addons/rigify/rigs/biped/leg/deform.py
index 76f751f..0d0bb2a 100644
--- a/release/scripts/addons/rigify/rigs/biped/leg/deform.py
+++ b/release/scripts/addons/rigify/rigs/biped/leg/deform.py
@@ -18,13 +18,15 @@
 
 # <pep8 compliant>
 
-import bpy
 from math import acos
+
+import bpy
 from mathutils import Vector, Matrix
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone, put_bone
-from rigify.utils import connected_children_names, has_connected_children
-from rigify.utils import strip_org, make_mechanism_name, make_deformer_name
+
+from ....utils import MetarigError
+from ....utils import copy_bone, put_bone
+from ....utils import connected_children_names, has_connected_children
+from ....utils import strip_org, make_mechanism_name, make_deformer_name
 
 
 def align_roll(obj, bone1, bone2):
diff --git a/release/scripts/addons/rigify/rigs/biped/leg/fk.py b/release/scripts/addons/rigify/rigs/biped/leg/fk.py
index 3d776cb..4e224ce 100644
--- a/release/scripts/addons/rigify/rigs/biped/leg/fk.py
+++ b/release/scripts/addons/rigify/rigs/biped/leg/fk.py
@@ -19,14 +19,15 @@
 # <pep8 compliant>
 
 import bpy
-from mathutils import Vector
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone
-from rigify.utils import connected_children_names, has_connected_children
-from rigify.utils import strip_org, make_mechanism_name
-from rigify.utils import get_layers
-from rigify.utils import create_widget, create_limb_widget
 from rna_prop_ui import rna_idprop_ui_prop_get
+from mathutils import Vector
+
+from ....utils import MetarigError
+from ....utils import copy_bone
+from ....utils import connected_children_names, has_connected_children
+from ....utils import strip_org, make_mechanism_name, insert_before_lr
+from ....utils import get_layers
+from ....utils import create_widget, create_limb_widget
 
 
 class Rig:
@@ -98,9 +99,9 @@ class Rig:
         bpy.ops.object.mode_set(mode='EDIT')
 
         # Create the control bones
-        thigh = copy_bone(self.obj, self.org_bones[0], strip_org(self.org_bones[0]))
-        shin = copy_bone(self.obj, self.org_bones[1], strip_org(self.org_bones[1]))
-        foot = copy_bone(self.obj, self.org_bones[2], strip_org(self.org_bones[2]))
+        thigh = copy_bone(self.obj, self.org_bones[0], strip_org(insert_before_lr(self.org_bones[0], ".fk")))
+        shin = copy_bone(self.obj, self.org_bones[1], strip_org(insert_before_lr(self.org_bones[1], ".fk")))
+        foot = copy_bone(self.obj, self.org_bones[2], strip_org(insert_before_lr(self.org_bones[2], ".fk")))
 
         # Create the foot mechanism bone
         foot_mch = copy_bone(self.obj, self.org_bones[2], make_mechanism_name(strip_org(self.org_bones[2])))
diff --git a/release/scripts/addons/rigify/rigs/biped/leg/ik.py b/release/scripts/addons/rigify/rigs/biped/leg/ik.py
index 7d01a60..52eae33 100644
--- a/release/scripts/addons/rigify/rigs/biped/leg/ik.py
+++ b/release/scripts/addons/rigify/rigs/biped/leg/ik.py
@@ -18,15 +18,17 @@
 
 # <pep8 compliant>
 
-import bpy
-from mathutils import Vector
 from math import pi, acos
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone, flip_bone, put_bone
-from rigify.utils import connected_children_names, has_connected_children
-from rigify.utils import strip_org, make_mechanism_name, insert_before_lr
-from rigify.utils import create_widget, create_line_widget, create_sphere_widget, create_circle_widget
+
+import bpy
 from rna_prop_ui import rna_idprop_ui_prop_get
+from mathutils import Vector
+
+from ....utils import MetarigError
+from ....utils import copy_bone, flip_bone, put_bone
+from ....utils import connected_children_names, has_connected_children
+from ....utils import strip_org, make_mechanism_name, insert_before_lr
+from ....utils import create_widget, create_line_widget, create_sphere_widget, create_circle_widget
 
 
 def align_x_axis(obj, bone, vec):
@@ -152,19 +154,20 @@ class Rig:
             make_rocker = True
 
         # Create the bones
-        thigh = copy_bone(self.obj, self.org_bones[0], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[0], "_ik"))))
-        shin = copy_bone(self.obj, self.org_bones[1], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[1], "_ik"))))
+        thigh = copy_bone(self.obj, self.org_bones[0], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[0], ".ik"))))
+        shin = copy_bone(self.obj, self.org_bones[1], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[1], ".ik"))))
 
-        foot = copy_bone(self.obj, self.org_bones[2], strip_org(insert_before_lr(self.org_bones[2], "_ik")))
+        foot = copy_bone(self.obj, self.org_bones[2], strip_org(insert_before_lr(self.org_bones[2], ".ik")))
         foot_ik_target = copy_bone(self.obj, self.org_bones[2], make_mechanism_name(strip_org(insert_before_lr(self.org_bones[2], "_ik_target"))))
-        pole = copy_bone(self.obj, self.org_bones[0], strip_org(insert_before_lr(self.org_bones[0], "_pole")))
+        pole_target_name = self.params.knee_target_base_name + "." + insert_before_lr(self.org_bones[0], ".ik").split(".", 1)[1]
+        pole = copy_bone(self.obj, self.org_bones[0], pole_target_name)
 
         toe = copy_bone(self.obj, self.org_bones[3], strip_org(self.org_bones[3]))
         toe_parent = copy_bone(self.obj, self.org_bones[2], make_mechanism_name(strip_org(self.org_bones[3] + ".parent")))
         toe_parent_socket1 = copy_bone(self.obj, self.org_bones[2], make_mechanism_name(strip_org(self.org_bones[3] + ".socket1")))
         toe_parent_socket2 = copy_bone(self.obj, self.org_bones[2], make_mechanism_name(strip_org(self.org_bones[3] + ".socket2")))
 
-        foot_roll = copy_bone(self.obj, self.org_bones[4], strip_org(insert_before_lr(self.org_bones[2], "_roll")))
+        foot_roll = copy_bone(self.obj, self.org_bones[4], strip_org(insert_before_lr(self.org_bones[2], "_roll.ik")))
         roll1 = copy_bone(self.obj, self.org_bones[4], make_mechanism_name(strip_org(self.org_bones[2] + ".roll.01")))
         roll2 = copy_bone(self.obj, self.org_bones[4], make_mechanism_name(strip_org(self.org_bones[2] + ".roll.02")))
 
@@ -172,8 +175,8 @@ class Rig:
             rocker1 = copy_bone(self.obj, self.org_bones[5], make_mechanism_name(strip_org(self.org_bones[2] + ".rocker.01")))
             rocker2 = copy_bone(self.obj, self.org_bones[5], make_mechanism_name(strip_org(self.org_bones[2] + ".rocker.02")))
 
-        visfoot = copy_bone(self.obj, self.org_bones[2], "VIS-" + strip_org(insert_before_lr(self.org_bones[2], "_ik")))
-        vispole = copy_bone(self.obj, self.org_bones[1], "VIS-" + strip_org(insert_before_lr(self.org_bones[0], "_pole")))
+        visfoot = copy_bone(self.obj, self.org_bones[2], "VIS-" + strip_org(insert_before_lr(self.org_bones[2], ".ik")))
+        vispole = copy_bone(self.obj, self.org_bones[1], "VIS-" + strip_org(insert_before_lr(self.org_bones[0], "_pole.ik")))
 
         # Get edit bones
         eb = self.obj.data.edit_bones
diff --git a/release/scripts/addons/rigify/rigs/finger.py b/release/scripts/addons/rigify/rigs/finger.py
index 0dee1b0..9ecaac3 100644
--- a/release/scripts/addons/rigify/rigs/finger.py
+++ b/release/scripts/addons/rigify/rigs/finger.py
@@ -18,15 +18,17 @@
 
 # <pep8 compliant>
 
+import re
+
 import bpy
-from mathutils import Vector
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone
-from rigify.utils import connected_children_names
-from rigify.utils import strip_org, make_mechanism_name, make_deformer_name
-from rigify.utils import create_widget, create_limb_widget
 from rna_prop_ui import rna_idprop_ui_prop_get
-import re
+from mathutils import Vector
+
+from ..utils import MetarigError
+from ..utils import copy_bone
+from ..utils import connected_children_names
+from ..utils import strip_org, make_mechanism_name, make_deformer_name
+from ..utils import create_widget, create_limb_widget
 
 
 class Rig:
@@ -274,139 +276,136 @@ class Rig:
         self.deform()
         self.control()
 
-    @classmethod
-    def add_parameters(self, group):
-        """ Add the parameters of this rig type to the
-            RigifyParameters PropertyGroup
-        """
-        items = [('X', 'X', ''), ('Y', 'Y', ''), ('Z', 'Z', ''), ('-X', '-X', ''), ('-Y', '-Y', ''), ('-Z', '-Z', '')]
-        group.primary_rotation_axis = bpy.props.EnumProperty(items=items, name="Primary Rotation Axis", default='X')
 
-        group.separate_extra_layers = bpy.props.BoolProperty(name="Separate Secondary Control Layers:", default=False, description="Enable putting the secondary controls on a separate layer from the primary controls")
-        group.extra_layers = bpy.props.BoolVectorProperty(size=32, description="Layers for the secondary controls to be on")
+def add_parameters(params):
+    """ Add the parameters of this rig type to the
+        RigifyParameters PropertyGroup
+    """
+    items = [('X', 'X', ''), ('Y', 'Y', ''), ('Z', 'Z', ''), ('-X', '-X', ''), ('-Y', '-Y', ''), ('-Z', '-Z', '')]
+    params.primary_rotation_axis = bpy.props.EnumProperty(items=items, name="Primary Rotation Axis", default='X')
 
-        group.use_digit_twist = bpy.props.BoolProperty(name="Digit Twist", default=True, description="Generate the dual-bone twist setup for the first finger digit")
+    params.separate_extra_layers = bpy.props.BoolProperty(name="Separate Secondary Control Layers:", default=False, description="Enable putting the secondary controls on a separate layer from the primary controls")
+    params.extra_layers = bpy.props.BoolVectorProperty(size=32, description="Layers for the secondary controls to be on")
 
-    @classmethod
-    def parameters_ui(self, layout, obj, bone):
-        """ Create the ui for the rig parameters.
-        """
-        params = obj.pose.bones[bone].rigify_parameters[0]
-
-        r = layout.row()
-        r.prop(params, "separate_extra_layers")
-
-        r = layout.row()
-        r.active = params.separate_extra_layers
-
-        col = r.column(align=True)
-        row = col.row(align=True)
-        row.prop(params, "extra_layers", index=0, toggle=True, text="")
-        row.prop(params, "extra_layers", index=1, toggle=True, text="")
-        row.prop(params, "extra_layers", index=2, toggle=True, text="")
-        row.prop(params, "extra_layers", index=3, toggle=True, text="")
-        row.prop(params, "extra_layers", index=4, toggle=True, text="")
-        row.prop(params, "extra_layers", index=5, toggle=True, text="")
-        row.prop(params, "extra_layers", index=6, toggle=True, text="")
-        row.prop(params, "extra_layers", index=7, toggle=True, text="")
-        row = col.row(align=True)
-        row.prop(params, "extra_layers", index=16, toggle=True, text="")
-        row.prop(params, "extra_layers", index=17, toggle=True, text="")
-        row.prop(params, "extra_layers", index=18, toggle=True, text="")
-        row.prop(params, "extra_layers", index=19, toggle=True, text="")
-        row.prop(params, "extra_layers", index=20, toggle=True, text="")
-        row.prop(params, "extra_layers", index=21, toggle=True, text="")
-        row.prop(params, "extra_layers", index=22, toggle=True, text="")
-        row.prop(params, "extra_layers", index=23, toggle=True, text="")
-
-        col = r.column(align=True)
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=8, toggle=True, text="")
-        row.prop(params, "ik_layers", index=9, toggle=True, text="")
-        row.prop(params, "ik_layers", index=10, toggle=True, text="")
-        row.prop(params, "ik_layers", index=11, toggle=True, text="")
-        row.prop(params, "ik_layers", index=12, toggle=True, text="")
-        row.prop(params, "ik_layers", index=13, toggle=True, text="")
-        row.prop(params, "ik_layers", index=14, toggle=True, text="")
-        row.prop(params, "ik_layers", index=15, toggle=True, text="")
-        row = col.row(align=True)
-        row.prop(params, "ik_layers", index=24, toggle=True, text="")
-        row.prop(params, "ik_layers", index=25, toggle=True, text="")
-        row.prop(params, "ik_layers", index=26, toggle=True, text="")
-        row.prop(params, "ik_layers", index=27, toggle=True, text="")
-        row.prop(params, "ik_layers", index=28, toggle=True, text="")
-        row.prop(params, "ik_layers", index=29, toggle=True, text="")
-        row.prop(params, "ik_layers", index=30, toggle=True, text="")
-        row.prop(params, "ik_layers", index=31, toggle=True, text="")
-
-        r = layout.row()
-        r.label(text="Bend rotation axis:")
-        r.prop(params, "primary_rotation_axis", text="")
-
-        col = layout.column()
-        col.prop(params, "use_digit_twist")
-
-    @classmethod
-    def create_sample(self, obj):
-        # generated by rigify.utils.write_metarig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
-
-        bones = {}
-
-        bone = arm.edit_bones.new('finger.01')
-        bone.head[:] = 0.0000, 0.0000, 0.0000
-        bone.tail[:] = 0.2529, 0.0000, 0.0000
-        bone.roll = 3.1416
-        bone.use_connect = False
-        bones['finger.01'] = bone.name
-        bone = arm.edit_bones.new('finger.02')
-        bone.head[:] = 0.2529, 0.0000, 0.0000
-        bone.tail[:] = 0.4024, 0.0000, -0.0264
-        bone.roll = -2.9671
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['finger.01']]
-        bones['finger.02'] = bone.name
-        bone = arm.edit_bones.new('finger.03')
-        bone.head[:] = 0.4024, 0.0000, -0.0264
-        bone.tail[:] = 0.4975, -0.0000, -0.0610
-        bone.roll = -2.7925
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['finger.02']]
-        bones['finger.03'] = bone.name
+    params.use_digit_twist = bpy.props.BoolProperty(name="Digit Twist", default=True, description="Generate the dual-bone twist setup for the first finger digit")
 
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['finger.01']]
-        pbone.rigify_type = 'finger'
-        pbone.lock_location = (True, True, True)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'YZX'
-        pbone.rigify_parameters.add()
-        pbone = obj.pose.bones[bones['finger.02']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'YZX'
-        pbone = obj.pose.bones[bones['finger.03']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'YZX'
 
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+def parameters_ui(layout, params):
+    """ Create the ui for the rig parameters.
+    """
+    r = layout.row()
+    r.prop(params, "separate_extra_layers")
+
+    r = layout.row()
+    r.active = params.separate_extra_layers
+
+    col = r.column(align=True)
+    row = col.row(align=True)
+    row.prop(params, "extra_layers", index=0, toggle=True, text="")
+    row.prop(params, "extra_layers", index=1, toggle=True, text="")
+    row.prop(params, "extra_layers", index=2, toggle=True, text="")
+    row.prop(params, "extra_layers", index=3, toggle=True, text="")
+    row.prop(params, "extra_layers", index=4, toggle=True, text="")
+    row.prop(params, "extra_layers", index=5, toggle=True, text="")
+    row.prop(params, "extra_layers", index=6, toggle=True, text="")
+    row.prop(params, "extra_layers", index=7, toggle=True, text="")
+    row = col.row(align=True)
+    row.prop(params, "extra_layers", index=16, toggle=True, text="")
+    row.prop(params, "extra_layers", index=17, toggle=True, text="")
+    row.prop(params, "extra_layers", index=18, toggle=True, text="")
+    row.prop(params, "extra_layers", index=19, toggle=True, text="")
+    row.prop(params, "extra_layers", index=20, toggle=True, text="")
+    row.prop(params, "extra_layers", index=21, toggle=True, text="")
+    row.prop(params, "extra_layers", index=22, toggle=True, text="")
+    row.prop(params, "extra_layers", index=23, toggle=True, text="")
+
+    col = r.column(align=True)
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=8, toggle=True, text="")
+    row.prop(params, "ik_layers", index=9, toggle=True, text="")
+    row.prop(params, "ik_layers", index=10, toggle=True, text="")
+    row.prop(params, "ik_layers", index=11, toggle=True, text="")
+    row.prop(params, "ik_layers", index=12, toggle=True, text="")
+    row.prop(params, "ik_layers", index=13, toggle=True, text="")
+    row.prop(params, "ik_layers", index=14, toggle=True, text="")
+    row.prop(params, "ik_layers", index=15, toggle=True, text="")
+    row = col.row(align=True)
+    row.prop(params, "ik_layers", index=24, toggle=True, text="")
+    row.prop(params, "ik_layers", index=25, toggle=True, text="")
+    row.prop(params, "ik_layers", index=26, toggle=True, text="")
+    row.prop(params, "ik_layers", index=27, toggle=True, text="")
+    row.prop(params, "ik_layers", index=28, toggle=True, text="")
+    row.prop(params, "ik_layers", index=29, toggle=True, text="")
+    row.prop(params, "ik_layers", index=30, toggle=True, text="")
+    row.prop(params, "ik_layers", index=31, toggle=True, text="")
+
+    r = layout.row()
+    r.label(text="Bend rotation axis:")
+    r.prop(params, "primary_rotation_axis", text="")
+
+    col = layout.column()
+    col.prop(params, "use_digit_twist")
+
+
+def create_sample(obj):
+    # generated by rigify.utils.write_metarig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('finger.01')
+    bone.head[:] = 0.0000, 0.0000, 0.0000
+    bone.tail[:] = 0.2529, 0.0000, 0.0000
+    bone.roll = 3.1416
+    bone.use_connect = False
+    bones['finger.01'] = bone.name
+    bone = arm.edit_bones.new('finger.02')
+    bone.head[:] = 0.2529, 0.0000, 0.0000
+    bone.tail[:] = 0.4024, 0.0000, -0.0264
+    bone.roll = -2.9671
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['finger.01']]
+    bones['finger.02'] = bone.name
+    bone = arm.edit_bones.new('finger.03')
+    bone.head[:] = 0.4024, 0.0000, -0.0264
+    bone.tail[:] = 0.4975, -0.0000, -0.0610
+    bone.roll = -2.7925
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['finger.02']]
+    bones['finger.03'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['finger.01']]
+    pbone.rigify_type = 'finger'
+    pbone.lock_location = (True, True, True)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'YZX'
+    pbone = obj.pose.bones[bones['finger.02']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'YZX'
+    pbone = obj.pose.bones[bones['finger.03']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'YZX'
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/rigs/misc/delta.py b/release/scripts/addons/rigify/rigs/misc/delta.py
index b32134f..a005fb6 100644
--- a/release/scripts/addons/rigify/rigs/misc/delta.py
+++ b/release/scripts/addons/rigify/rigs/misc/delta.py
@@ -18,74 +18,80 @@
 
 # <pep8 compliant>
 
-import bpy
-from math import acos
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone
-from rigify.utils import org_name, make_mechanism_name
-
-
-class Rig:
-    """ A delta rig.
-        Creates a setup that will place its child at its position in pose mode,
-        but will not modifying its child's position in edit mode.
-        This is a mechanism-only rig (no control or deformation bones).
-
-    """
-    def __init__(self, obj, bone, params):
-        """ Gather and validate data about the rig.
-            Store any data or references to data that will be needed later on.
-            In particular, store references to bones that will be needed.
-            Do NOT change any data in the scene.  This is a gathering phase only.
+if False:
+    # This rig type is disabled due to its obscurity.
+    # However, some of the code may be useful in the future, so
+    # I'm leaving it here.
+    from math import acos
 
-        """
-        bb = obj.data.bones
+    import bpy
 
-        if bb[bone].children is None:
-            raise MetarigError("RIGIFY ERROR: bone '%s': rig type requires one child" % org_name(bone.name))
-        if bb[bone].use_connect is True:
-            raise MetarigError("RIGIFY ERROR: bone '%s': rig type cannot be connected to parent" % org_name(bone.name))
+    from ...utils import MetarigError
+    from ...utils import copy_bone
+    from ...utils import org_name, make_mechanism_name
 
-        self.obj = obj
-        self.org_bones = {"delta": bone, "child": bb[bone].children[0].name}
-        self.org_names = [org_name(bone), org_name(bb[bone].children[0].name)]
 
-    def generate(self):
-        """ Generate the rig.
-            Do NOT modify any of the original bones, except for adding constraints.
-            The main armature should be selected and active before this is called.
+    class Rig:
+        """ A delta rig.
+            Creates a setup that will place its child at its position in pose mode,
+            but will not modifying its child's position in edit mode.
+            This is a mechanism-only rig (no control or deformation bones).
 
         """
-        bpy.ops.object.mode_set(mode='EDIT')
-        eb = self.obj.data.edit_bones
+        def __init__(self, obj, bone, params):
+            """ Gather and validate data about the rig.
+                Store any data or references to data that will be needed later on.
+                In particular, store references to bones that will be needed.
+                Do NOT change any data in the scene.  This is a gathering phase only.
 
-        org_delta = self.org_bones["delta"]
-        org_delta_e = eb[self.org_bones["delta"]]
-        # org_child = self.org_bones["child"]  # UNUSED
-        org_child_e = eb[self.org_bones["child"]]
+            """
+            bb = obj.data.bones
 
-        # Calculate the matrix for achieving the delta
-        child_mat = org_delta_e.matrix.invert() * org_child_e.matrix
-        mat = org_delta_e.matrix * child_mat.invert()
+            if bb[bone].children is None:
+                raise MetarigError("RIGIFY ERROR: bone '%s': rig type requires one child" % org_name(bone.name))
+            if bb[bone].use_connect is True:
+                raise MetarigError("RIGIFY ERROR: bone '%s': rig type cannot be connected to parent" % org_name(bone.name))
 
-        # Create the delta bones.
-        delta_e = eb[copy_bone(self.obj, self.org_bones["delta"])]
-        delta_e.name = make_mechanism_name(self.org_names[0])
-        delta = delta_e.name
+            self.obj = obj
+            self.org_bones = {"delta": bone, "child": bb[bone].children[0].name}
+            self.org_names = [org_name(bone), org_name(bb[bone].children[0].name)]
 
-        # Set the delta to the matrix's transforms
-        set_mat(self.obj, delta, mat)
+        def generate(self):
+            """ Generate the rig.
+                Do NOT modify any of the original bones, except for adding constraints.
+                The main armature should be selected and active before this is called.
 
-        bpy.ops.object.mode_set(mode='OBJECT')
+            """
+            bpy.ops.object.mode_set(mode='EDIT')
+            eb = self.obj.data.edit_bones
+
+            org_delta = self.org_bones["delta"]
+            org_delta_e = eb[self.org_bones["delta"]]
+            # org_child = self.org_bones["child"]  # UNUSED
+            org_child_e = eb[self.org_bones["child"]]
+
+            # Calculate the matrix for achieving the delta
+            child_mat = org_delta_e.matrix.invert() * org_child_e.matrix
+            mat = org_delta_e.matrix * child_mat.invert()
+
+            # Create the delta bones.
+            delta_e = eb[copy_bone(self.obj, self.org_bones["delta"])]
+            delta_e.name = make_mechanism_name(self.org_names[0])
+            delta = delta_e.name
 
-        # Constrain org_delta to delta
-        con = self.obj.pose.bones[org_delta].constraints.new('COPY_TRANSFORMS')
-        con.name = "delta"
-        con.target = self.obj
-        con.subtarget = delta
+            # Set the delta to the matrix's transforms
+            set_mat(self.obj, delta, mat)
 
-    @classmethod
-    def create_sample(self, obj):
+            bpy.ops.object.mode_set(mode='OBJECT')
+
+            # Constrain org_delta to delta
+            con = self.obj.pose.bones[org_delta].constraints.new('COPY_TRANSFORMS')
+            con.name = "delta"
+            con.target = self.obj
+            con.subtarget = delta
+
+
+    def create_sample(obj):
         # generated by rigify.utils.write_metarig
         bpy.ops.object.mode_set(mode='EDIT')
         arm = obj.data
@@ -114,7 +120,6 @@ class Rig:
         pbone.lock_rotation_w = False
         pbone.lock_scale = (False, False, False)
         pbone.rotation_mode = 'QUATERNION'
-        pbone.rigify_parameters.add()
         pbone = obj.pose.bones[bones['Bone']]
         pbone.rigify_type = ''
         pbone.lock_location = (False, False, False)
@@ -136,27 +141,27 @@ class Rig:
             arm.edit_bones.active = bone
 
 
-def set_mat(obj, bone_name, matrix):
-    """ Sets the bone to have the given transform matrix.
-    """
-    a = obj.data.edit_bones[bone_name]
-
-    a.head = (0, 0, 0)
-    a.tail = (0, 1, 0)
+    def set_mat(obj, bone_name, matrix):
+        """ Sets the bone to have the given transform matrix.
+        """
+        a = obj.data.edit_bones[bone_name]
 
-    a.transform(matrix)
+        a.head = (0, 0, 0)
+        a.tail = (0, 1, 0)
 
-    d = acos(a.matrix.to_quaternion().dot(matrix.to_quaternion())) * 2.0
+        a.transform(matrix)
 
-    roll_1 = a.roll + d
-    roll_2 = a.roll - d
+        d = acos(a.matrix.to_quaternion().dot(matrix.to_quaternion())) * 2.0
 
-    a.roll = roll_1
-    d1 = a.matrix.to_quaternion().dot(matrix.to_quaternion())
-    a.roll = roll_2
-    d2 = a.matrix.to_quaternion().dot(matrix.to_quaternion())
+        roll_1 = a.roll + d
+        roll_2 = a.roll - d
 
-    if d1 > d2:
         a.roll = roll_1
-    else:
+        d1 = a.matrix.to_quaternion().dot(matrix.to_quaternion())
         a.roll = roll_2
+        d2 = a.matrix.to_quaternion().dot(matrix.to_quaternion())
+
+        if d1 > d2:
+            a.roll = roll_1
+        else:
+            a.roll = roll_2
diff --git a/release/scripts/addons/rigify/rigs/neck_short.py b/release/scripts/addons/rigify/rigs/neck_short.py
index 0742087..9c24832 100644
--- a/release/scripts/addons/rigify/rigs/neck_short.py
+++ b/release/scripts/addons/rigify/rigs/neck_short.py
@@ -19,13 +19,15 @@
 # <pep8 compliant>
 
 import bpy
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone, new_bone, put_bone
-from rigify.utils import connected_children_names
-from rigify.utils import strip_org, make_mechanism_name, make_deformer_name
-from rigify.utils import obj_to_bone, create_circle_widget
 from rna_prop_ui import rna_idprop_ui_prop_get
 
+from ..utils import MetarigError
+from ..utils import copy_bone, new_bone, put_bone
+from ..utils import connected_children_names
+from ..utils import strip_org, make_mechanism_name, make_deformer_name
+from ..utils import obj_to_bone, create_circle_widget
+
+
 script1 = """
 head_neck = ["%s", "%s"]
 """
@@ -313,13 +315,8 @@ class Rig:
             i += 1
 
         # Create control widgets
-        w1 = create_circle_widget(self.obj, neck_ctrl, radius=1.0, head_tail=0.5)
-        w2 = create_circle_widget(self.obj, head_ctrl, radius=1.0, head_tail=0.5)
-
-        if w1 != None:
-            obj_to_bone(w1, self.obj, self.org_bones[(len(self.org_bones) - 1) // 2])
-        if w2 != None:
-            obj_to_bone(w2, self.obj, self.org_bones[-1])
+        w1 = create_circle_widget(self.obj, neck_ctrl, radius=1.0, head_tail=0.5, bone_transform_name=self.org_bones[(len(self.org_bones) - 1) // 2])
+        w2 = create_circle_widget(self.obj, head_ctrl, radius=1.0, head_tail=0.5, bone_transform_name=self.org_bones[-1])
 
         # Return control bones
         return (head_ctrl, neck_ctrl)
@@ -340,53 +337,52 @@ class Rig:
 
         return [script]
 
-    @classmethod
-    def create_sample(self, obj):
-        # generated by rigify.utils.write_metarig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
-
-        bones = {}
-
-        bone = arm.edit_bones.new('neck')
-        bone.head[:] = 0.0000, 0.0000, 0.0000
-        bone.tail[:] = 0.0000, -0.0500, 0.1500
-        bone.roll = 0.0000
-        bone.use_connect = False
-        bones['neck'] = bone.name
-        bone = arm.edit_bones.new('head')
-        bone.head[:] = 0.0000, -0.0500, 0.1500
-        bone.tail[:] = 0.0000, -0.0500, 0.4000
-        bone.roll = 3.1416
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['neck']]
-        bones['head'] = bone.name
 
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['neck']]
-        pbone.rigify_type = 'neck_short'
-        pbone.lock_location = (True, True, True)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone.rigify_parameters.add()
-        pbone = obj.pose.bones[bones['head']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+def create_sample(obj):
+    # generated by rigify.utils.write_metarig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('neck')
+    bone.head[:] = 0.0000, 0.0000, 0.0000
+    bone.tail[:] = 0.0000, -0.0500, 0.1500
+    bone.roll = 0.0000
+    bone.use_connect = False
+    bones['neck'] = bone.name
+    bone = arm.edit_bones.new('head')
+    bone.head[:] = 0.0000, -0.0500, 0.1500
+    bone.tail[:] = 0.0000, -0.0500, 0.4000
+    bone.roll = 3.1416
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['neck']]
+    bones['head'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['neck']]
+    pbone.rigify_type = 'neck_short'
+    pbone.lock_location = (True, True, True)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['head']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/rigs/palm.py b/release/scripts/addons/rigify/rigs/palm.py
index 1d25050..f556821 100644
--- a/release/scripts/addons/rigify/rigs/palm.py
+++ b/release/scripts/addons/rigify/rigs/palm.py
@@ -18,13 +18,15 @@
 
 # <pep8 compliant>
 
-import bpy
-from math import cos, pi
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone
-from rigify.utils import strip_org, deformer
-from rigify.utils import create_widget
 import re
+from math import cos, pi
+
+import bpy
+
+from ..utils import MetarigError
+from ..utils import copy_bone
+from ..utils import strip_org, deformer
+from ..utils import create_widget
 
 
 def bone_siblings(obj, bone):
@@ -160,115 +162,112 @@ class Rig:
             mod = w.modifiers.new("subsurf", 'SUBSURF')
             mod.levels = 2
 
-    @classmethod
-    def add_parameters(self, group):
-        """ Add the parameters of this rig type to the
-            RigifyParameters PropertyGroup
-
-        """
-        items = [('X', 'X', ''), ('Z', 'Z', '')]
-        group.palm_rotation_axis = bpy.props.EnumProperty(items=items, name="Palm Rotation Axis", default='X')
 
-    @classmethod
-    def parameters_ui(self, layout, obj, bone):
-        """ Create the ui for the rig parameters.
+def add_parameters(params):
+    """ Add the parameters of this rig type to the
+        RigifyParameters PropertyGroup
 
-        """
-        params = obj.pose.bones[bone].rigify_parameters[0]
+    """
+    items = [('X', 'X', ''), ('Z', 'Z', '')]
+    params.palm_rotation_axis = bpy.props.EnumProperty(items=items, name="Palm Rotation Axis", default='X')
 
-        r = layout.row()
-        r.label(text="Primary rotation axis:")
-        r.prop(params, "palm_rotation_axis", text="")
 
-    @classmethod
-    def create_sample(self, obj):
-        # generated by rigify.utils.write_metarig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
-
-        bones = {}
-
-        bone = arm.edit_bones.new('palm.parent')
-        bone.head[:] = 0.0000, 0.0000, 0.0000
-        bone.tail[:] = 0.0577, 0.0000, -0.0000
-        bone.roll = 3.1416
-        bone.use_connect = False
-        bones['palm.parent'] = bone.name
-        bone = arm.edit_bones.new('palm.04')
-        bone.head[:] = 0.0577, 0.0315, -0.0000
-        bone.tail[:] = 0.1627, 0.0315, -0.0000
-        bone.roll = 3.1416
-        bone.use_connect = False
-        bone.parent = arm.edit_bones[bones['palm.parent']]
-        bones['palm.04'] = bone.name
-        bone = arm.edit_bones.new('palm.03')
-        bone.head[:] = 0.0577, 0.0105, -0.0000
-        bone.tail[:] = 0.1627, 0.0105, -0.0000
-        bone.roll = 3.1416
-        bone.use_connect = False
-        bone.parent = arm.edit_bones[bones['palm.parent']]
-        bones['palm.03'] = bone.name
-        bone = arm.edit_bones.new('palm.02')
-        bone.head[:] = 0.0577, -0.0105, -0.0000
-        bone.tail[:] = 0.1627, -0.0105, -0.0000
-        bone.roll = 3.1416
-        bone.use_connect = False
-        bone.parent = arm.edit_bones[bones['palm.parent']]
-        bones['palm.02'] = bone.name
-        bone = arm.edit_bones.new('palm.01')
-        bone.head[:] = 0.0577, -0.0315, -0.0000
-        bone.tail[:] = 0.1627, -0.0315, -0.0000
-        bone.roll = 3.1416
-        bone.use_connect = False
-        bone.parent = arm.edit_bones[bones['palm.parent']]
-        bones['palm.01'] = bone.name
+def parameters_ui(layout, params):
+    """ Create the ui for the rig parameters.
 
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['palm.parent']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['palm.04']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, True, True)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'YXZ'
-        pbone = obj.pose.bones[bones['palm.03']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, True, True)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'YXZ'
-        pbone = obj.pose.bones[bones['palm.02']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, True, True)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'YXZ'
-        pbone = obj.pose.bones[bones['palm.01']]
-        pbone.rigify_type = 'palm'
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, True, True)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'YXZ'
-        pbone.rigify_parameters.add()
-
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+    """
+    r = layout.row()
+    r.label(text="Primary rotation axis:")
+    r.prop(params, "palm_rotation_axis", text="")
+
+
+def create_sample(obj):
+    # generated by rigify.utils.write_metarig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('palm.parent')
+    bone.head[:] = 0.0000, 0.0000, 0.0000
+    bone.tail[:] = 0.0577, 0.0000, -0.0000
+    bone.roll = 3.1416
+    bone.use_connect = False
+    bones['palm.parent'] = bone.name
+    bone = arm.edit_bones.new('palm.04')
+    bone.head[:] = 0.0577, 0.0315, -0.0000
+    bone.tail[:] = 0.1627, 0.0315, -0.0000
+    bone.roll = 3.1416
+    bone.use_connect = False
+    bone.parent = arm.edit_bones[bones['palm.parent']]
+    bones['palm.04'] = bone.name
+    bone = arm.edit_bones.new('palm.03')
+    bone.head[:] = 0.0577, 0.0105, -0.0000
+    bone.tail[:] = 0.1627, 0.0105, -0.0000
+    bone.roll = 3.1416
+    bone.use_connect = False
+    bone.parent = arm.edit_bones[bones['palm.parent']]
+    bones['palm.03'] = bone.name
+    bone = arm.edit_bones.new('palm.02')
+    bone.head[:] = 0.0577, -0.0105, -0.0000
+    bone.tail[:] = 0.1627, -0.0105, -0.0000
+    bone.roll = 3.1416
+    bone.use_connect = False
+    bone.parent = arm.edit_bones[bones['palm.parent']]
+    bones['palm.02'] = bone.name
+    bone = arm.edit_bones.new('palm.01')
+    bone.head[:] = 0.0577, -0.0315, -0.0000
+    bone.tail[:] = 0.1627, -0.0315, -0.0000
+    bone.roll = 3.1416
+    bone.use_connect = False
+    bone.parent = arm.edit_bones[bones['palm.parent']]
+    bones['palm.01'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['palm.parent']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['palm.04']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, True, True)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'YXZ'
+    pbone = obj.pose.bones[bones['palm.03']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, True, True)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'YXZ'
+    pbone = obj.pose.bones[bones['palm.02']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, True, True)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'YXZ'
+    pbone = obj.pose.bones[bones['palm.01']]
+    pbone.rigify_type = 'palm'
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, True, True)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'YXZ'
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/rigs/spine.py b/release/scripts/addons/rigify/rigs/spine.py
index cee0861..0983e83 100644
--- a/release/scripts/addons/rigify/rigs/spine.py
+++ b/release/scripts/addons/rigify/rigs/spine.py
@@ -20,19 +20,20 @@
 
 """ TODO:
     - Add parameters for bone transform alphas.
+    - Add IK spine controls
 """
 
 from math import floor
 
 import bpy
 from mathutils import Vector
-from rigify.utils import MetarigError
-from rigify.utils import copy_bone, new_bone, flip_bone, put_bone
-from rigify.utils import connected_children_names
-from rigify.utils import strip_org, make_mechanism_name, make_deformer_name
-from rigify.utils import obj_to_bone, create_circle_widget, create_compass_widget
 from rna_prop_ui import rna_idprop_ui_prop_get
 
+from ..utils import MetarigError
+from ..utils import copy_bone, new_bone, flip_bone, put_bone
+from ..utils import connected_children_names
+from ..utils import strip_org, make_mechanism_name, make_deformer_name
+from ..utils import obj_to_bone, create_circle_widget, create_cube_widget
 
 script = """
 main = "%s"
@@ -73,6 +74,7 @@ class Rig:
         self.control_indices.sort()
 
         self.pivot_rest = self.params.rest_pivot_slide
+        # Clamp pivot_rest to within the middle bones of the spine
         self.pivot_rest = max(self.pivot_rest, 1.0 / len(self.org_bones))
         self.pivot_rest = min(self.pivot_rest, 1.0 - (1.0 / len(self.org_bones)))
 
@@ -148,22 +150,12 @@ class Rig:
         # Create main control bone
         main_control = new_bone(self.obj, self.params.spine_main_control_name)
 
-        # Create main control WGT bones
-        main_wgt1 = new_bone(self.obj, make_mechanism_name(self.params.spine_main_control_name + ".01"))
-        main_wgt2 = new_bone(self.obj, make_mechanism_name(self.params.spine_main_control_name + ".02"))
-
         eb = self.obj.data.edit_bones
 
         # Parent the main control
         eb[main_control].use_connect = False
         eb[main_control].parent = eb[self.org_bones[0]].parent
 
-        # Parent the main WGTs
-        eb[main_wgt1].use_connect = False
-        eb[main_wgt1].parent = eb[main_control]
-        eb[main_wgt2].use_connect = False
-        eb[main_wgt2].parent = eb[main_wgt1]
-
         # Parent the controls and sub-controls
         for name, subname in zip(controls, subcontrols):
             eb[name].use_connect = False
@@ -181,12 +173,6 @@ class Rig:
         put_bone(self.obj, main_control, pivot_rest_pos)
         eb[main_control].length = sum([eb[b].length for b in self.org_bones]) / 2
 
-        # Position the main WGTs
-        eb[main_wgt1].tail = (0.0, 0.0, sum([eb[b].length for b in self.org_bones]) / 4)
-        eb[main_wgt2].length = sum([eb[b].length for b in self.org_bones]) / 4
-        put_bone(self.obj, main_wgt1, pivot_rest_pos)
-        put_bone(self.obj, main_wgt2, pivot_rest_pos)
-
         # Position the controls and sub-controls
         pos = eb[controls[0]].head.copy()
         for name, subname in zip(controls, subcontrols):
@@ -379,11 +365,6 @@ class Rig:
         con.target = self.obj
         con.subtarget = rev_bones[0]
 
-        con = pb[main_wgt1].constraints.new('COPY_ROTATION')
-        con.name = "copy_rotation"
-        con.target = self.obj
-        con.subtarget = rev_bones[0]
-
         # Slide constraints
         i = 1
         tot = len(rev_bones)
@@ -408,26 +389,6 @@ class Rig:
             mod.coefficients[0] = 1 - i
             mod.coefficients[1] = tot
 
-            # Main WGT
-            con = pb[main_wgt1].constraints.new('COPY_ROTATION')
-            con.name = "slide." + str(i)
-            con.target = self.obj
-            con.subtarget = rb
-
-            # Driver
-            fcurve = con.driver_add("influence")
-            driver = fcurve.driver
-            var = driver.variables.new()
-            driver.type = 'AVERAGE'
-            var.name = "slide"
-            var.targets[0].id_type = 'OBJECT'
-            var.targets[0].id = self.obj
-            var.targets[0].data_path = main_control_p.path_from_id() + '["pivot_slide"]'
-            mod = fcurve.modifiers[0]
-            mod.poly_order = 1
-            mod.coefficients[0] = 1.5 - i
-            mod.coefficients[1] = tot
-
             i += 1
 
         #----------------------------------
@@ -482,31 +443,23 @@ class Rig:
 
         # Control appearance
         # Main
-        pb[main_control].custom_shape_transform = pb[main_wgt2]
-        w = create_compass_widget(self.obj, main_control)
-        if w != None:
-            obj_to_bone(w, self.obj, main_wgt2)
+        w = create_cube_widget(self.obj, main_control)
 
         # Spines
         for name, i in zip(controls[1:-1], self.control_indices[1:-1]):
             pb[name].custom_shape_transform = pb[self.org_bones[i]]
             # Create control widgets
-            w = create_circle_widget(self.obj, name, radius=1.0, head_tail=0.5, with_line=True)
-            if w != None:
-                obj_to_bone(w, self.obj, self.org_bones[i])
+            w = create_circle_widget(self.obj, name, radius=1.0, head_tail=0.5, with_line=True, bone_transform_name=self.org_bones[i])
+
         # Hips
         pb[controls[0]].custom_shape_transform = pb[self.org_bones[0]]
         # Create control widgets
-        w = create_circle_widget(self.obj, controls[0], radius=1.0, head_tail=0.5, with_line=True)
-        if w != None:
-            obj_to_bone(w, self.obj, self.org_bones[0])
+        w = create_circle_widget(self.obj, controls[0], radius=1.0, head_tail=0.5, with_line=True, bone_transform_name=self.org_bones[0])
 
         # Ribs
         pb[controls[-1]].custom_shape_transform = pb[self.org_bones[-1]]
         # Create control widgets
-        w = create_circle_widget(self.obj, controls[-1], radius=1.0, head_tail=0.5, with_line=True)
-        if w != None:
-            obj_to_bone(w, self.obj, self.org_bones[-1])
+        w = create_circle_widget(self.obj, controls[-1], radius=1.0, head_tail=0.5, with_line=True, bone_transform_name=self.org_bones[-1])
 
         # Layers
         pb[main_control].bone.layers = pb[self.org_bones[0]].bone.layers
@@ -525,94 +478,91 @@ class Rig:
         controls_string = ", ".join(["'" + x + "'" for x in controls[1:]])
         return [script % (controls[0], controls_string)]
 
-    @classmethod
-    def add_parameters(self, group):
-        """ Add the parameters of this rig type to the
-            RigifyParameters PropertyGroup
-        """
-        group.spine_main_control_name = bpy.props.StringProperty(name="Main control name", default="torso", description="Name that the main control bone should be given")
-        group.rest_pivot_slide = bpy.props.FloatProperty(name="Rest Pivot Slide", default=0.0, min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, description="The pivot slide value in the rest pose")
-        group.chain_bone_controls = bpy.props.StringProperty(name="Control bone list", default="", description="Define which bones have controls")
-
-    @classmethod
-    def parameters_ui(self, layout, obj, bone):
-        """ Create the ui for the rig parameters.
-        """
-        params = obj.pose.bones[bone].rigify_parameters[0]
 
-        r = layout.row()
-        r.prop(params, "spine_main_control_name")
-
-        r = layout.row()
-        r.prop(params, "rest_pivot_slide", slider=True)
-
-        r = layout.row()
-        r.prop(params, "chain_bone_controls")
-
-    @classmethod
-    def create_sample(self, obj):
-        # generated by rigify.utils.write_metarig
-        bpy.ops.object.mode_set(mode='EDIT')
-        arm = obj.data
-
-        bones = {}
-
-        bone = arm.edit_bones.new('hips')
-        bone.head[:] = 0.0000, 0.0000, 0.0000
-        bone.tail[:] = -0.0000, -0.0590, 0.2804
-        bone.roll = -0.0000
-        bone.use_connect = False
-        bones['hips'] = bone.name
-        bone = arm.edit_bones.new('spine')
-        bone.head[:] = -0.0000, -0.0590, 0.2804
-        bone.tail[:] = 0.0000, 0.0291, 0.5324
-        bone.roll = 0.0000
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['hips']]
-        bones['spine'] = bone.name
-        bone = arm.edit_bones.new('ribs')
-        bone.head[:] = 0.0000, 0.0291, 0.5324
-        bone.tail[:] = -0.0000, 0.0000, 1.0000
-        bone.roll = -0.0000
-        bone.use_connect = True
-        bone.parent = arm.edit_bones[bones['spine']]
-        bones['ribs'] = bone.name
+def add_parameters(params):
+    """ Add the parameters of this rig type to the
+        RigifyParameters PropertyGroup
+    """
+    params.spine_main_control_name = bpy.props.StringProperty(name="Main control name", default="torso", description="Name that the main control bone should be given")
+    params.rest_pivot_slide = bpy.props.FloatProperty(name="Rest Pivot Slide", default=0.0, min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, description="The pivot slide value in the rest pose")
+    params.chain_bone_controls = bpy.props.StringProperty(name="Control bone list", default="", description="Define which bones have controls")
 
-        bpy.ops.object.mode_set(mode='OBJECT')
-        pbone = obj.pose.bones[bones['hips']]
-        pbone.rigify_type = 'spine'
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['spine']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['ribs']]
-        pbone.rigify_type = ''
-        pbone.lock_location = (False, False, False)
-        pbone.lock_rotation = (False, False, False)
-        pbone.lock_rotation_w = False
-        pbone.lock_scale = (False, False, False)
-        pbone.rotation_mode = 'QUATERNION'
-        pbone = obj.pose.bones[bones['hips']]
-        pbone['rigify_type'] = 'spine'
-        pbone.rigify_parameters.add()
-        pbone.rigify_parameters[0].chain_bone_controls = "1, 2, 3"
 
-        bpy.ops.object.mode_set(mode='EDIT')
-        for bone in arm.edit_bones:
-            bone.select = False
-            bone.select_head = False
-            bone.select_tail = False
-        for b in bones:
-            bone = arm.edit_bones[bones[b]]
-            bone.select = True
-            bone.select_head = True
-            bone.select_tail = True
-            arm.edit_bones.active = bone
+def parameters_ui(layout, params):
+    """ Create the ui for the rig parameters.
+    """
+    r = layout.row()
+    r.prop(params, "spine_main_control_name")
+
+    r = layout.row()
+    r.prop(params, "rest_pivot_slide", slider=True)
+
+    r = layout.row()
+    r.prop(params, "chain_bone_controls")
+
+
+def create_sample(obj):
+    # generated by rigify.utils.write_metarig
+    bpy.ops.object.mode_set(mode='EDIT')
+    arm = obj.data
+
+    bones = {}
+
+    bone = arm.edit_bones.new('hips')
+    bone.head[:] = 0.0000, 0.0000, 0.0000
+    bone.tail[:] = -0.0000, -0.0590, 0.2804
+    bone.roll = -0.0000
+    bone.use_connect = False
+    bones['hips'] = bone.name
+    bone = arm.edit_bones.new('spine')
+    bone.head[:] = -0.0000, -0.0590, 0.2804
+    bone.tail[:] = 0.0000, 0.0291, 0.5324
+    bone.roll = 0.0000
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['hips']]
+    bones['spine'] = bone.name
+    bone = arm.edit_bones.new('ribs')
+    bone.head[:] = 0.0000, 0.0291, 0.5324
+    bone.tail[:] = -0.0000, 0.0000, 1.0000
+    bone.roll = -0.0000
+    bone.use_connect = True
+    bone.parent = arm.edit_bones[bones['spine']]
+    bones['ribs'] = bone.name
+
+    bpy.ops.object.mode_set(mode='OBJECT')
+    pbone = obj.pose.bones[bones['hips']]
+    pbone.rigify_type = 'spine'
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['spine']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['ribs']]
+    pbone.rigify_type = ''
+    pbone.lock_location = (False, False, False)
+    pbone.lock_rotation = (False, False, False)
+    pbone.lock_rotation_w = False
+    pbone.lock_scale = (False, False, False)
+    pbone.rotation_mode = 'QUATERNION'
+    pbone = obj.pose.bones[bones['hips']]
+    pbone['rigify_type'] = 'spine'
+    pbone.rigify_parameters.chain_bone_controls = "1, 2, 3"
+
+    bpy.ops.object.mode_set(mode='EDIT')
+    for bone in arm.edit_bones:
+        bone.select = False
+        bone.select_head = False
+        bone.select_tail = False
+    for b in bones:
+        bone = arm.edit_bones[bones[b]]
+        bone.select = True
+        bone.select_head = True
+        bone.select_tail = True
+        arm.edit_bones.active = bone
diff --git a/release/scripts/addons/rigify/ui.py b/release/scripts/addons/rigify/ui.py
index 156ab0b..e95e477 100644
--- a/release/scripts/addons/rigify/ui.py
+++ b/release/scripts/addons/rigify/ui.py
@@ -18,13 +18,13 @@
 
 # <pep8 compliant>
 
-# test comment
-
 import bpy
 from bpy.props import StringProperty
-import rigify
-from rigify.utils import get_rig_type
-from rigify import generate
+
+from .utils import get_rig_type, MetarigError
+from .utils import write_metarig, write_widget
+from . import rig_lists
+from . import generate
 
 
 class DATA_PT_rigify_buttons(bpy.types.Panel):
@@ -59,7 +59,7 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
             for i in range(0, len(id_store.rigify_types)):
                 id_store.rigify_types.remove(0)
 
-            for r in rigify.rig_list:
+            for r in rig_lists.rig_list:
                 # collection = r.split('.')[0]  # UNUSED
                 if collection_name == "All":
                     a = id_store.rigify_types.add()
@@ -67,7 +67,7 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
                 elif r.startswith(collection_name + '.'):
                     a = id_store.rigify_types.add()
                     a.name = r
-                elif collection_name == "None" and len(r.split('.')) == 1:
+                elif (collection_name == "None") and ("." not in r):
                     a = id_store.rigify_types.add()
                     a.name = r
 
@@ -77,10 +77,10 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
 
             # Rig type list
             row = layout.row()
-            row.template_list("UI_UL_list", "", id_store, "rigify_types", id_store, 'rigify_active_type')
+            row.template_list("UI_UL_list", "rigify_types", id_store, "rigify_types", id_store, 'rigify_active_type')
 
-            op = layout.operator("armature.metarig_sample_add", text="Add sample")
-            op.metarig_type = id_store.rigify_types[id_store.rigify_active_type].name
+            props = layout.operator("armature.metarig_sample_add", text="Add sample")
+            props.metarig_type = id_store.rigify_types[id_store.rigify_active_type].name
 
 
 class DATA_PT_rigify_layer_names(bpy.types.Panel):
@@ -99,13 +99,21 @@ class DATA_PT_rigify_layer_names(bpy.types.Panel):
     def draw(self, context):
         layout = self.layout
         obj = context.object
+        arm = obj.data
 
         # Ensure that the layers exist
-        for i in range(1 + len(obj.data.rigify_layers), 29):
-            obj.data.rigify_layers.add()
+        if 0:
+            for i in range(1 + len(arm.rigify_layers), 29):
+                arm.rigify_layers.add()
+        else:
+            # Can't add while drawing, just use button
+            if len(arm.rigify_layers) < 28:
+                layout.operator("pose.rigify_layer_init")
+                return
 
         # UI
-        for i in range(28):
+        for i, rigify_layer in enumerate(arm.rigify_layers):
+            # note: rigify_layer == arm.rigify_layers[i]
             if (i % 16) == 0:
                 col = layout.column()
                 if i == 0:
@@ -115,11 +123,11 @@ class DATA_PT_rigify_layer_names(bpy.types.Panel):
             if (i % 8) == 0:
                 col = layout.column(align=True)
             row = col.row()
-            row.prop(obj.data, "layers", index=i, text="", toggle=True)
+            row.prop(arm, "layers", index=i, text="", toggle=True)
             split = row.split(percentage=0.8)
-            split.prop(obj.data.rigify_layers[i], "name", text="Layer %d" % (i + 1))
-            split.prop(obj.data.rigify_layers[i], "row", text="")
-            #split.prop(obj.data.rigify_layers[i], "column", text="")
+            split.prop(rigify_layer, "name", text="Layer %d" % (i + 1))
+            split.prop(rigify_layer, "row", text="")
+            #split.prop(rigify_layer, "column", text="")
 
 
 class BONE_PT_rigify_buttons(bpy.types.Panel):
@@ -151,7 +159,7 @@ class BONE_PT_rigify_buttons(bpy.types.Panel):
         for i in range(0, len(id_store.rigify_types)):
             id_store.rigify_types.remove(0)
 
-        for r in rigify.rig_list:
+        for r in rig_lists.rig_list:
             # collection = r.split('.')[0]  # UNUSED
             if collection_name == "All":
                 a = id_store.rigify_types.add()
@@ -169,9 +177,6 @@ class BONE_PT_rigify_buttons(bpy.types.Panel):
 
         # Rig type parameters / Rig type non-exist alert
         if rig_name != "":
-            if len(bone.rigify_parameters) < 1:
-                bone.rigify_parameters.add()
-
             try:
                 rig = get_rig_type(rig_name)
                 rig.Rig
@@ -181,16 +186,34 @@ class BONE_PT_rigify_buttons(bpy.types.Panel):
                 box.label(text="ALERT: type \"%s\" does not exist!" % rig_name)
             else:
                 try:
-                    rig.Rig.parameters_ui
+                    rig.parameters_ui
                 except AttributeError:
-                    pass
+                    col = layout.column()
+                    col.label(text="No options")
                 else:
                     col = layout.column()
                     col.label(text="Options:")
                     box = layout.box()
+                    rig.parameters_ui(box, bone.rigify_parameters)
+
 
-                    rig.Rig.parameters_ui(box, C.active_object, bone.name)
+class VIEW3D_PT_tools_rigify_dev(bpy.types.Panel):
+    bl_label = "Rigify Dev Tools"
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
 
+    def draw(self, context):
+        obj = context.active_object
+        if obj != None:
+            if context.mode == 'EDIT_ARMATURE':
+                r = self.layout.row()
+                r.operator("armature.rigify_encode_metarig", text="Encode Metarig to Python")
+                r = self.layout.row()
+                r.operator("armature.rigify_encode_metarig_sample", text="Encode Sample to Python")
+
+            if context.mode == 'EDIT_MESH':
+                r = self.layout.row()
+                r.operator("mesh.rigify_encode_mesh_widget", text="Encode Mesh Widget to Python")
 
 #~ class INFO_MT_armature_metarig_add(bpy.types.Menu):
     #~ bl_idname = "INFO_MT_armature_metarig_add"
@@ -229,6 +252,21 @@ def rigify_report_exception(operator, exception):
     operator.report({'INFO'}, '\n'.join(message))
 
 
+class LayerInit(bpy.types.Operator):
+    """Initialize armature rigify layers"""
+
+    bl_idname = "pose.rigify_layer_init"
+    bl_label = "Add Rigify Layers"
+    bl_options = {'UNDO'}
+
+    def execute(self, context):
+        obj = context.object
+        arm = obj.data
+        for i in range(1 + len(arm.rigify_layers), 29):
+            arm.rigify_layers.add()
+        return {'FINISHED'}
+
+
 class Generate(bpy.types.Operator):
     """Generates a rig from the active metarig armature"""
 
@@ -244,7 +282,7 @@ class Generate(bpy.types.Operator):
         context.user_preferences.edit.use_global_undo = False
         try:
             generate.generate_rig(context, context.object)
-        except rigify.utils.MetarigError as rig_exception:
+        except MetarigError as rig_exception:
             rigify_report_exception(self, rig_exception)
         finally:
             context.user_preferences.edit.use_global_undo = use_global_undo
@@ -271,10 +309,10 @@ class Sample(bpy.types.Operator):
             use_global_undo = context.user_preferences.edit.use_global_undo
             context.user_preferences.edit.use_global_undo = False
             try:
-                rig = get_rig_type(self.metarig_type).Rig
+                rig = get_rig_type(self.metarig_type)
                 create_sample = rig.create_sample
             except (ImportError, AttributeError):
-                print("Rigify: rig type has no sample.")
+                raise Exception("rig type '" + self.metarig_type + "' has no sample.")
             else:
                 create_sample(context.active_object)
             finally:
@@ -284,6 +322,88 @@ class Sample(bpy.types.Operator):
         return {'FINISHED'}
 
 
+class EncodeMetarig(bpy.types.Operator):
+    """ Creates Python code that will generate the selected metarig.
+    """
+    bl_idname = "armature.rigify_encode_metarig"
+    bl_label = "Rigify Encode Metarig"
+    bl_options = {'UNDO'}
+
+    @classmethod
+    def poll(self, context):
+        return context.mode == 'EDIT_ARMATURE'
+
+    def execute(self, context):
+        name = "metarig.py"
+
+        if name in bpy.data.texts:
+            text_block = bpy.data.texts[name]
+            text_block.clear()
+        else:
+            text_block = bpy.data.texts.new(name)
+
+        text = write_metarig(context.active_object, layers=True, func_name="create")
+        text_block.write(text)
+        bpy.ops.object.mode_set(mode='EDIT')
+
+        return {'FINISHED'}
+
+
+class EncodeMetarigSample(bpy.types.Operator):
+    """ Creates Python code that will generate the selected metarig
+        as a sample.
+    """
+    bl_idname = "armature.rigify_encode_metarig_sample"
+    bl_label = "Rigify Encode Metarig Sample"
+    bl_options = {'UNDO'}
+
+    @classmethod
+    def poll(self, context):
+        return context.mode == 'EDIT_ARMATURE'
+
+    def execute(self, context):
+        name = "metarig_sample.py"
+
+        if name in bpy.data.texts:
+            text_block = bpy.data.texts[name]
+            text_block.clear()
+        else:
+            text_block = bpy.data.texts.new(name)
+
+        text = write_metarig(context.active_object, layers=False, func_name="create_sample")
+        text_block.write(text)
+        bpy.ops.object.mode_set(mode='EDIT')
+
+        return {'FINISHED'}
+
+
+class EncodeWidget(bpy.types.Operator):
+    """ Creates Python code that will generate the selected metarig.
+    """
+    bl_idname = "mesh.rigify_encode_mesh_widget"
+    bl_label = "Rigify Encode Widget"
+    bl_options = {'UNDO'}
+
+    @classmethod
+    def poll(self, context):
+        return context.mode == 'EDIT_MESH'
+
+    def execute(self, context):
+        name = "widget.py"
+
+        if name in bpy.data.texts:
+            text_block = bpy.data.texts[name]
+            text_block.clear()
+        else:
+            text_block = bpy.data.texts.new(name)
+
+        text = write_widget(context.active_object)
+        text_block.write(text)
+        bpy.ops.object.mode_set(mode='EDIT')
+
+        return {'FINISHED'}
+
+
 #menu_func = (lambda self, context: self.layout.menu("INFO_MT_armature_metarig_add", icon='OUTLINER_OB_ARMATURE'))
 
 #from bl_ui import space_info  # ensure the menu is loaded first
@@ -292,8 +412,13 @@ def register():
     bpy.utils.register_class(DATA_PT_rigify_layer_names)
     bpy.utils.register_class(DATA_PT_rigify_buttons)
     bpy.utils.register_class(BONE_PT_rigify_buttons)
+    bpy.utils.register_class(VIEW3D_PT_tools_rigify_dev)
+    bpy.utils.register_class(LayerInit)
     bpy.utils.register_class(Generate)
     bpy.utils.register_class(Sample)
+    bpy.utils.register_class(EncodeMetarig)
+    bpy.utils.register_class(EncodeMetarigSample)
+    bpy.utils.register_class(EncodeWidget)
 
     #space_info.INFO_MT_armature_add.append(ui.menu_func)
 
@@ -302,5 +427,10 @@ def unregister():
     bpy.utils.unregister_class(DATA_PT_rigify_layer_names)
     bpy.utils.unregister_class(DATA_PT_rigify_buttons)
     bpy.utils.unregister_class(BONE_PT_rigify_buttons)
+    bpy.utils.unregister_class(VIEW3D_PT_tools_rigify_dev)
+    bpy.utils.unregister_class(LayerInit)
     bpy.utils.unregister_class(Generate)
     bpy.utils.unregister_class(Sample)
+    bpy.utils.unregister_class(EncodeMetarig)
+    bpy.utils.unregister_class(EncodeMetarigSample)
+    bpy.utils.unregister_class(EncodeWidget)
diff --git a/release/scripts/addons/rigify/utils.py b/release/scripts/addons/rigify/utils.py
index e97fce7..ec4c9e7 100644
--- a/release/scripts/addons/rigify/utils.py
+++ b/release/scripts/addons/rigify/utils.py
@@ -20,12 +20,14 @@
 
 import bpy
 import imp
+import importlib
 import random
 import time
 from mathutils import Vector
 from rna_prop_ui import rna_idprop_ui_prop_get
 
 RIG_DIR = "rigs"  # Name of the directory where rig types are kept
+METARIG_DIR = "metarigs"  # Name of the directory where metarigs are kept
 
 ORG_PREFIX = "ORG-"  # Prefix of original bones.
 MCH_PREFIX = "MCH-"  # Prefix of mechanism bones.
@@ -260,20 +262,37 @@ def obj_to_bone(obj, rig, bone_name):
     obj.scale = (bone.length * scl_avg), (bone.length * scl_avg), (bone.length * scl_avg)
 
 
-def create_widget(rig, bone_name):
+def create_widget(rig, bone_name, bone_transform_name=None):
     """ Creates an empty widget object for a bone, and returns the object.
     """
+    if bone_transform_name == None:
+        bone_transform_name = bone_name
+
     obj_name = WGT_PREFIX + bone_name
     scene = bpy.context.scene
-    # Check if it already exists
+
+    # Check if it already exists in the scene
     if obj_name in scene.objects:
+        # Move object to bone position, in case it changed
+        obj = scene.objects[obj_name]
+        obj_to_bone(obj, rig, bone_transform_name)
+
         return None
     else:
+        # Delete object if it exists in blend data but not scene data.
+        # This is necessary so we can then create the object without
+        # name conflicts.
+        if obj_name in bpy.data.objects:
+            bpy.data.objects[obj_name].user_clear()
+            bpy.data.objects.remove(bpy.data.objects[obj_name])
+
+        # Create mesh object
         mesh = bpy.data.meshes.new(obj_name)
         obj = bpy.data.objects.new(obj_name, mesh)
         scene.objects.link(obj)
 
-        obj_to_bone(obj, rig, bone_name)
+        # Move object to bone position and set layers
+        obj_to_bone(obj, rig, bone_transform_name)
         obj.layers = WGT_LAYERS
 
         return obj
@@ -281,22 +300,22 @@ def create_widget(rig, bone_name):
 
 # Common Widgets
 
-def create_line_widget(rig, bone_name):
+def create_line_widget(rig, bone_name, bone_transform_name=None):
     """ Creates a basic line widget, a line that spans the length of the bone.
     """
-    obj = create_widget(rig, bone_name)
+    obj = create_widget(rig, bone_name, bone_transform_name)
     if obj != None:
         mesh = obj.data
         mesh.from_pydata([(0, 0, 0), (0, 1, 0)], [(0, 1)], [])
         mesh.update()
 
 
-def create_circle_widget(rig, bone_name, radius=1.0, head_tail=0.0, with_line=False):
+def create_circle_widget(rig, bone_name, radius=1.0, head_tail=0.0, with_line=False, bone_transform_name=None):
     """ Creates a basic circle widget, a circle around the y-axis.
         radius: the radius of the circle
         head_tail: where along the length of the bone the circle is (0.0=head, 1.0=tail)
     """
-    obj = create_widget(rig, bone_name)
+    obj = create_widget(rig, bone_name, bone_transform_name)
     if obj != None:
         v = [(0.7071068286895752, 2.980232238769531e-07, -0.7071065306663513), (0.8314696550369263, 2.980232238769531e-07, -0.5555699467658997), (0.9238795042037964, 2.682209014892578e-07, -0.3826831877231598), (0.9807852506637573, 2.5331974029541016e-07, -0.19509011507034302), (1.0, 2.365559055306221e-07, 1.6105803979371558e-07), (0.9807853698730469, 2.2351741790771484e-07, 0.19509044289588928), (0.9238796234130859, 2.086162567138672e-07, 0.38268351554870605), (0.8314696550369263, 1.7881393432617188e-07, 0.5555704236030579), (0.7071068286895752, 1.7881393432617188e-07, 0.7071070075035095), (0.5555702447891235, 1.7881393432617188e-07, 0.8314698934555054), (0.38268327713012695, 1.7881393432617188e-07, 0.923879861831665), (0.19509008526802063, 1.7881393432617188e-07, 0.9807855486869812), (-3.2584136988589307e-07, 1.1920928955078125e-07, 1.000000238418579), (-0.19509072601795197, 1.7881393432617188e-07, 0.9807854294776917), (-0.3826838731765747, 1.7881393432617188e-07, 0.9238795638084412), (-0.5555707216262817, 1.7881393432617188e-07, 0.8314695358276367), (-0.7071071863174438, 1.7881393432617188e-07, 0.7071065902709961), (-0.8314700126647949, 1.7881393432617188e-07, 0.5555698871612549), (-0.923879861831665, 2.086162567138672e-07, 0.3826829195022583), (-0.9807853698730469, 2.2351741790771484e-07, 0.1950896978378296), (-1.0, 2.365559907957504e-07, -7.290432222362142e-07), (-0.9807850122451782, 2.5331974029541016e-07, -0.195091113448143), (-0.9238790273666382, 2.682209014892578e-07, -0.38268423080444336), (-0.831468939781189, 2.980232238769531e-07, -0.5555710196495056), (-0.7071058750152588, 2.980232238769531e-07, -0.707107424736023), (-0.555569052696228, 2.980232238769531e-07, -0.8314701318740845), (-0.38268208503723145, 2.980232238769531e-07, -0.923879861831665), (-0.19508881866931915, 2.980232238769531e-07, -0.9807853102684021), (1.6053570561780361e-06, 2.980232238769531e-07, -0.9999997615814209), (0.19509197771549225, 2.980232238769531e-07, -0.9807847142219543), (0.3826850652694702, 2.980232238769531e-07, -0.9238786101341248), (0.5555717945098877, 2.980232238769531e-07, -0.8314683437347412)]
         verts = [(a[0] * radius, head_tail, a[2] * radius) for a in v]
@@ -312,10 +331,23 @@ def create_circle_widget(rig, bone_name, radius=1.0, head_tail=0.0, with_line=Fa
         return None
 
 
-def create_sphere_widget(rig, bone_name):
+def create_cube_widget(rig, bone_name, radius=0.5, bone_transform_name=None):
+    """ Creates a basic cube widget.
+    """
+    obj = create_widget(rig, bone_name, bone_transform_name)
+    if obj != None:
+        r = radius
+        verts = [(r, r, r), (r, -r, r), (-r, -r, r), (-r, r, r), (r, r, -r), (r, -r, -r), (-r, -r, -r), (-r, r, -r)]
+        edges = [(0, 1), (1, 2), (2, 3), (3, 0), (4, 5), (5, 6), (6, 7), (7, 4), (0, 4), (1, 5), (2, 6), (3, 7)]
+        mesh = obj.data
+        mesh.from_pydata(verts, edges, [])
+        mesh.update()
+
+
+def create_sphere_widget(rig, bone_name, bone_transform_name=None):
     """ Creates a basic sphere widget, three pependicular overlapping circles.
     """
-    obj = create_widget(rig, bone_name)
+    obj = create_widget(rig, bone_name, bone_transform_name)
     if obj != None:
         verts = [(0.3535533845424652, 0.3535533845424652, 0.0), (0.4619397521018982, 0.19134171307086945, 0.0), (0.5, -2.1855694143368964e-08, 0.0), (0.4619397521018982, -0.19134175777435303, 0.0), (0.3535533845424652, -0.3535533845424652, 0.0), (0.19134174287319183, -0.4619397521018982, 0.0), (7.549790126404332e-08, -0.5, 0.0), (-0.1913416087627411, -0.46193981170654297, 0.0), (-0.35355329513549805, -0.35355350375175476, 0.0), (-0.4619397521018982, -0.19134178757667542, 0.0), (-0.5, 5.962440319251527e-09, 0.0), (-0.4619397222995758, 0.1913418024778366, 0.0), (-0.35355326533317566, 0.35355350375175476, 0.0), (-0.19134148955345154, 0.46193987131118774, 0.0), (3.2584136988589307e-07, 0.5, 0.0), (0.1913420855998993, 0.46193960309028625, 0.0), (7.450580596923828e-08, 0.46193960309028625, 0.19134199619293213), (5.9254205098113744e-08, 0.5, 2.323586443253589e-07), (4.470348358154297e-08, 0.46193987131118774, -0.1913415789604187), (2.9802322387695312e-08, 0.35355350375175476, -0.3535533547401428), (2.9802322387695312e-08, 0.19134178757667542, -0.46193981170654297), (5.960464477539063e-08, -1.1151834122813398e-08, -0.5000000596046448), (5.960464477539063e-08, -0.1913418024778366, -0.46193984150886536), (5.960464477539063e-08, -0.35355350375175476, -0.3535533845424652), (7.450580596923828e-08, -0.46193981170654297, -0.19134166836738586), (9.348272556053416e-08, -0.5, 1.624372103492533e-08), (1.043081283569336e-07, -0.4619397521018982, 0.19134168326854706), (1.1920928955078125e-07, -0.3535533845424652, 0.35355329513549805), (1.1920928955078125e-07, -0.19134174287319183, 0.46193966269493103), (1.1920928955078125e-07, -4.7414250303745575e-09, 0.49999991059303284), (1.1920928955078125e-07, 0.19134172797203064, 0.46193966269493103), (8.940696716308594e-08, 0.3535533845424652, 0.35355329513549805), (0.3535534739494324, 0.0, 0.35355329513549805), (0.1913418173789978, -2.9802322387695312e-08, 0.46193966269493103), (8.303572940349113e-08, -5.005858838558197e-08, 0.49999991059303284), (-0.19134165346622467, -5.960464477539063e-08, 0.46193966269493103), (-0.35355329513549805, -8.940696716308594e-08, 0.35355329513549805), (-0.46193963289260864, -5.960464477539063e-08, 0.19134168326854706), (-0.49999991059303284, -5.960464477539063e-08, 1.624372103492533e-08), (-0.4619397521018982, -2.9802322387695312e-08, -0.19134166836738586), (-0.3535534143447876, -2.9802322387695312e-08, -0.3535533845424652), (-0.19134171307086945, 0.0, -0.46193984150886536), (7.662531942287387e-08, 9.546055501630235e-09, -0.5000000596046448), (0.19134187698364258, 5.960464477539063e-08, -0.46193981170654297), (0.3535535931587219, 5.960464477539063e-08, -0.3535533547401428), (0.4619399905204773, 5.960464477539063e-08, -0.1913415789604187), (0.5000000596046448, 5.960464477539063e-08, 2.323586443253589e-07), (0.4619396924972534, 2.9802322387695312e-08, 0.19134199619293213)]
         edges = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 9), (9, 10), (10, 11), (11, 12), (12, 13), (13, 14), (14, 15), (0, 15), (16, 31), (16, 17), (17, 18), (18, 19), (19, 20), (20, 21), (21, 22), (22, 23), (23, 24), (24, 25), (25, 26), (26, 27), (27, 28), (28, 29), (29, 30), (30, 31), (32, 33), (33, 34), (34, 35), (35, 36), (36, 37), (37, 38), (38, 39), (39, 40), (40, 41), (41, 42), (42, 43), (43, 44), (44, 45), (45, 46), (46, 47), (32, 47)]
@@ -324,11 +356,11 @@ def create_sphere_widget(rig, bone_name):
         mesh.update()
 
 
-def create_limb_widget(rig, bone_name):
+def create_limb_widget(rig, bone_name, bone_transform_name=None):
     """ Creates a basic limb widget, a line that spans the length of the
         bone, with a circle around the center.
     """
-    obj = create_widget(rig, bone_name)
+    obj = create_widget(rig, bone_name, bone_transform_name)
     if obj != None:
         verts = [(-1.1920928955078125e-07, 1.7881393432617188e-07, 0.0), (3.5762786865234375e-07, 1.0000004768371582, 0.0), (0.1767769455909729, 0.5000001192092896, 0.17677664756774902), (0.20786768198013306, 0.5000001192092896, 0.1388925313949585), (0.23097014427185059, 0.5000001192092896, 0.09567084908485413), (0.24519658088684082, 0.5000001192092896, 0.048772573471069336), (0.2500002384185791, 0.5000001192092896, -2.545945676502015e-09), (0.24519658088684082, 0.5000001192092896, -0.048772573471069336), (0.23097014427185059, 0.5000001192092896, -0.09567084908485413), (0.20786768198013306, 0.5000001192092896, -0.13889259099960327), (0.1767769455909729, 0.5000001192092896, -0.1767767071723938), (0.13889282941818237, 0.5000001192092896, -0.20786744356155396), (0.09567105770111084, 0.5000001192092896, -0.23096990585327148), (0.04877278208732605, 0.5000001192092896, -0.24519634246826172), (1.7279069197684294e-07, 0.5000000596046448, -0.25), (-0.0487724244594574, 0.5000001192092896, -0.24519634246826172), (-0.09567070007324219, 0.5000001192092896, -0.2309698462486267), (-0.13889241218566895, 0.5000001192092896, -0.20786738395690918), (-0.17677652835845947, 0.5000001192092896, -0.17677664756774902), (-0.20786726474761963, 0.5000001192092896, -0.13889244198799133), (-0.23096972703933716, 0.5000001192092896, -0.09567070007324219), (-0.24519610404968262, 0.5000001192092896, -0.04877239465713501), (-0.2499997615814209, 0.5000001192092896, 2.1997936983098043e-07), (-0.24519598484039307, 0.5000001192092896, 0.04877282679080963), (-0.23096948862075806, 0.5000001192092896, 0.09567108750343323), (-0.20786696672439575, 0.5000001192092896, 0.1388927698135376), (-0.1767762303352356, 0.5000001192092896, 0.17677688598632812), (-0.13889199495315552, 0.5000001192092896, 0.2078675627708435), (-0.09567028284072876, 0.5000001192092896, 0.23097002506256104), (-0.048771947622299194, 0.5000001192092896, 0.24519634246826172), (6.555903269145347e-07, 0.5000001192092896, 0.25), (0.04877324402332306, 0.5000001192092896, 0.24519622325897217), (0.09567153453826904, 0.5000001192092896, 0.23096966743469238), (0.13889318704605103, 0.5000001192092896, 0.20786714553833008)]
         edges = [(0, 1), (2, 3), (4, 3), (5, 4), (5, 6), (6, 7), (8, 7), (8, 9), (10, 9), (10, 11), (11, 12), (13, 12), (14, 13), (14, 15), (16, 15), (16, 17), (17, 18), (19, 18), (19, 20), (21, 20), (21, 22), (22, 23), (24, 23), (25, 24), (25, 26), (27, 26), (27, 28), (29, 28), (29, 30), (30, 31), (32, 31), (32, 33), (2, 33)]
@@ -337,10 +369,10 @@ def create_limb_widget(rig, bone_name):
         mesh.update()
 
 
-def create_bone_widget(rig, bone_name):
+def create_bone_widget(rig, bone_name, bone_transform_name=None):
     """ Creates a basic bone widget, a simple obolisk-esk shape.
     """
-    obj = create_widget(rig, bone_name)
+    obj = create_widget(rig, bone_name, bone_transform_name)
     if obj != None:
         verts = [(0.04, 1.0, -0.04), (0.1, 0.0, -0.1), (-0.1, 0.0, -0.1), (-0.04, 1.0, -0.04), (0.04, 1.0, 0.04), (0.1, 0.0, 0.1), (-0.1, 0.0, 0.1), (-0.04, 1.0, 0.04)]
         edges = [(1, 2), (0, 1), (0, 3), (2, 3), (4, 5), (5, 6), (6, 7), (4, 7), (1, 5), (0, 4), (2, 6), (3, 7)]
@@ -349,10 +381,10 @@ def create_bone_widget(rig, bone_name):
         mesh.update()
 
 
-def create_compass_widget(rig, bone_name):
+def create_compass_widget(rig, bone_name, bone_transform_name=None):
     """ Creates a compass-shaped widget.
     """
-    obj = create_widget(rig, bone_name)
+    obj = create_widget(rig, bone_name, bone_transform_name)
     if obj != None:
         verts = [(0.0, 1.2000000476837158, 0.0), (0.19509032368659973, 0.9807852506637573, 0.0), (0.3826834559440613, 0.9238795042037964, 0.0), (0.5555702447891235, 0.8314695954322815, 0.0), (0.7071067690849304, 0.7071067690849304, 0.0), (0.8314696550369263, 0.5555701851844788, 0.0), (0.9238795042037964, 0.3826834261417389, 0.0), (0.9807852506637573, 0.19509035348892212, 0.0), (1.2000000476837158, 7.549790126404332e-08, 0.0), (0.9807853102684021, -0.19509020447731018, 0.0), (0.9238795638084412, -0.38268327713012695, 0.0), (0.8314696550369263, -0.5555701851844788, 0.0), (0.7071067690849304, -0.7071067690849304, 0.0), (0.5555701851844788, -0.8314696550369263, 0.0), (0.38268327713012695, -0.9238796234130859, 0.0), (0.19509008526802063, -0.9807853102684021, 0.0), (-3.2584136988589307e-07, -1.2999999523162842, 0.0), (-0.19509072601795197, -0.9807851910591125, 0.0), (-0.3826838731765747, -0.9238793253898621, 0.0), (-0.5555707216262817, -0.8314692974090576, 0.0), (-0.7071072459220886, -0.707106351852417, 0.0), (-0.8314700126647949, -0.5555696487426758, 0.0), (-0.923879861831665, -0.3826826810836792, 0.0), (-0.9807854294776917, -0.1950894594192505, 0.0), (-1.2000000476837158, 9.655991561885457e-07, 0.0), (-0.980785071849823, 0.1950913518667221, 0.0), (-0.923879086971283, 0.38268446922302246, 0.0), (-0.831468939781189, 0.5555712580680847, 0.0), (-0.7071058750152588, 0.707107663154602, 0.0), (-0.5555691123008728, 0.8314703702926636, 0.0), (-0.38268208503723145, 0.9238801002502441, 0.0), (-0.19508881866931915, 0.9807855486869812, 0.0)]
         edges = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 9), (9, 10), (10, 11), (11, 12), (12, 13), (13, 14), (14, 15), (15, 16), (16, 17), (17, 18), (18, 19), (19, 20), (20, 21), (21, 22), (22, 23), (23, 24), (24, 25), (25, 26), (26, 27), (27, 28), (28, 29), (29, 30), (30, 31), (0, 31)]
@@ -361,10 +393,10 @@ def create_compass_widget(rig, bone_name):
         mesh.update()
 
 
-def create_root_widget(rig, bone_name):
+def create_root_widget(rig, bone_name, bone_transform_name=None):
     """ Creates a widget for the root bone.
     """
-    obj = create_widget(rig, bone_name)
+    obj = create_widget(rig, bone_name, bone_transform_name)
     if obj != None:
         verts = [(0.7071067690849304, 0.7071067690849304, 0.0), (0.7071067690849304, -0.7071067690849304, 0.0), (-0.7071067690849304, 0.7071067690849304, 0.0), (-0.7071067690849304, -0.7071067690849304, 0.0), (0.8314696550369263, 0.5555701851844788, 0.0), (0.8314696550369263, -0.5555701851844788, 0.0), (-0.8314696550369263, 0.5555701851844788, 0.0), (-0.8314696550369263, -0.5555701851844788, 0.0), (0.9238795042037964, 0.3826834261417389, 0.0), (0.9238795042037964, -0.3826834261417389, 0.0), (-0.9238795042037964, 0.3826834261417389, 0.0), (-0.9238795042037964, -0.3826834261417389, 0.0), (0.9807852506637573, 0.19509035348892212, 0.0), (0.9807852506637573, -0.19509035348892212, 0.0), (-0.9807852506637573, 0.19509035348892212, 0.0), (-0.9807852506637573, -0.19509035348892212, 0.0), (0.19509197771549225, 0.9807849526405334, 0.0), (0.19509197771549225, -0.9807849526405334, 0.0), (-0.19509197771549225, 0.9807849526405334, 0.0), (-0.19509197771549225, -0.9807849526405334, 0.0), (0.3826850652694702, 0.9238788485527039, 0.0), (0.3826850652694702, -0.9238788485527039, 0.0), (-0.3826850652694702, 0.9238788485527039, 0.0), (-0.3826850652694702, -0.9238788485527039, 0.0), (0.5555717945098877, 0.8314685821533203, 0.0), (0.5555717945098877, -0.8314685821533203, 0.0), (-0.5555717945098877, 0.8314685821533203, 0.0), (-0.5555717945098877, -0.8314685821533203, 0.0), (0.19509197771549225, 1.2807848453521729, 0.0), (0.19509197771549225, -1.2807848453521729, 0.0), (-0.19509197771549225, 1.2807848453521729, 0.0), (-0.19509197771549225, -1.2807848453521729, 0.0), (1.280785322189331, 0.19509035348892212, 0.0), (1.280785322189331, -0.19509035348892212, 0.0), (-1.280785322189331, 0.19509035348892212, 0.0), (-1.280785322189331, -0.19509035348892212, 0.0), (0.3950919806957245, 1.2807848453521729, 0.0), (0.3950919806957245, -1.2807848453521729, 0.0), (-0.3950919806957245, 1.2807848453521729, 0.0), (-0.3950919806957245, -1.2807848453521729, 0.0), (1.280785322189331, 0.39509034156799316, 0.0), (1.280785322189331, -0.39509034156799316, 0.0), (-1.280785322189331, 0.39509034156799316, 0.0), (-1.280785322189331, -0.39509034156799316, 0.0), (0.0, 1.5807849168777466, 0.0), (0.0, -1.5807849168777466, 0.0), (1.5807852745056152, 0.0, 0.0), (-1.5807852745056152, 0.0, 0.0)]
         edges = [(0, 4), (1, 5), (2, 6), (3, 7), (4, 8), (5, 9), (6, 10), (7, 11), (8, 12), (9, 13), (10, 14), (11, 15), (16, 20), (17, 21), (18, 22), (19, 23), (20, 24), (21, 25), (22, 26), (23, 27), (0, 24), (1, 25), (2, 26), (3, 27), (16, 28), (17, 29), (18, 30), (19, 31), (12, 32), (13, 33), (14, 34), (15, 35), (28, 36), (29, 37), (30, 38), (31, 39), (32, 40), (33, 41), (34, 42), (35, 43), (36, 44), (37, 45), (38, 44), (39, 45), (40, 46), (41, 46), (42, 47), (43, 47)]
@@ -395,8 +427,17 @@ def copy_attributes(a, b):
 def get_rig_type(rig_type):
     """ Fetches a rig module by name, and returns it.
     """
-    #print("%s.%s.%s" % (__package__,RIG_DIR,rig_type))
-    submod = __import__(name="%s.%s.%s" % (MODULE_NAME, RIG_DIR, rig_type), fromlist=[rig_type])
+    name = ".%s.%s" % (RIG_DIR, rig_type)
+    submod = importlib.import_module(name, package=MODULE_NAME)
+    imp.reload(submod)
+    return submod
+
+
+def get_metarig_module(metarig_name):
+    """ Fetches a rig module by name, and returns it.
+    """
+    name = ".%s.%s" % (METARIG_DIR, metarig_name)
+    submod = importlib.import_module(name, package=MODULE_NAME)
     imp.reload(submod)
     return submod
 
@@ -461,13 +502,15 @@ def get_layers(layers):
             return [x in layers for x in range(0, 32)]
 
 
-def write_metarig(obj, layers=False, func_name="create_sample"):
+def write_metarig(obj, layers=False, func_name="create"):
     """
     Write a metarig as a python script, this rig is to have all info needed for
     generating the real rig with rigify.
     """
     code = []
 
+    code.append("import bpy\n")
+
     code.append("def %s(obj):" % func_name)
     code.append("    # generated by rigify.utils.write_metarig")
     bpy.ops.object.mode_set(mode='EDIT')
@@ -475,6 +518,18 @@ def write_metarig(obj, layers=False, func_name="create_sample"):
     code.append("    arm = obj.data")
 
     arm = obj.data
+
+    # Rigify layer layout info
+    if layers and len(arm.rigify_layers) > 0:
+        code.append("\n    for i in range(" + str(len(arm.rigify_layers)) + "):")
+        code.append("        arm.rigify_layers.add()\n")
+
+        for i in range(len(arm.rigify_layers)):
+            name = arm.rigify_layers[i].name
+            row = arm.rigify_layers[i].row
+            code.append('    arm.rigify_layers[' + str(i) + '].name = "' + name + '"')
+            code.append('    arm.rigify_layers[' + str(i) + '].row = ' + str(row))
+
     # write parents first
     bones = [(len(bone.parent_recursive), bone.name) for bone in arm.edit_bones]
     bones.sort(key=lambda item: item[0])
@@ -512,16 +567,16 @@ def write_metarig(obj, layers=False, func_name="create_sample"):
         if layers:
             code.append("    pbone.bone.layers = %s" % str(list(pbone.bone.layers)))
         # Rig type parameters
-        if len(pbone.rigify_parameters) > 0:
-            code.append("    pbone.rigify_parameters.add()")
-            for param_name in pbone.rigify_parameters[0].keys():
-                param = getattr(pbone.rigify_parameters[0], param_name)
-                if str(type(param)) == "<class 'bpy_prop_array'>":
-                    param = list(param)
-                code.append("    try:")
-                code.append("        pbone.rigify_parameters[0].%s = %s" % (param_name, str(param)))
-                code.append("    except AttributeError:")
-                code.append("        pass")
+        for param_name in pbone.rigify_parameters.keys():
+            param = getattr(pbone.rigify_parameters, param_name)
+            if str(type(param)) == "<class 'bpy_prop_array'>":
+                param = list(param)
+            if type(param) == str:
+                param = '"' + param + '"'
+            code.append("    try:")
+            code.append("        pbone.rigify_parameters.%s = %s" % (param_name, str(param)))
+            code.append("    except AttributeError:")
+            code.append("        pass")
 
     code.append("\n    bpy.ops.object.mode_set(mode='EDIT')")
     code.append("    for bone in arm.edit_bones:")
@@ -536,9 +591,70 @@ def write_metarig(obj, layers=False, func_name="create_sample"):
     code.append("        bone.select_tail = True")
     code.append("        arm.edit_bones.active = bone")
 
+    # Set appropriate layers visible
+    if layers:
+        # Find what layers have bones on them
+        active_layers = []
+        for bone_name in bones:
+            bone = obj.data.bones[bone_name]
+            for i in range(len(bone.layers)):
+                if bone.layers[i]:
+                    if i not in active_layers:
+                        active_layers.append(i)
+        active_layers.sort()
+
+        code.append("\n    arm.layers = [(x in " + str(active_layers) + ") for x in range(" + str(len(arm.layers)) + ")]")
+
+    code.append('\nif __name__ == "__main__":')
+    code.append("    " + func_name + "(bpy.context.active_object)")
+
     return "\n".join(code)
 
 
+def write_widget(obj):
+    """ Write a mesh object as a python script for widget use.
+    """
+    script = ""
+    script += "def create_thing_widget(rig, bone_name, size=1.0, bone_transform_name=None):\n"
+    script += "    obj = create_widget(rig, bone_name, bone_transform_name)\n"
+    script += "    if obj != None:\n"
+
+    # Vertices
+    if len(obj.data.vertices) > 0:
+        script += "        verts = ["
+        for v in obj.data.vertices:
+            script += "(" + str(v.co[0]) + "*size, " + str(v.co[1]) + "*size, " + str(v.co[2]) + "*size), "
+        script += "]\n"
+
+    # Edges
+    if len(obj.data.edges) > 0:
+        script += "        edges = ["
+        for e in obj.data.edges:
+            script += "(" + str(e.vertices[0]) + ", " + str(e.vertices[1]) + "), "
+        script += "]\n"
+
+    # Faces
+    if len(obj.data.polygons) > 0:
+        script += "        faces = ["
+        for f in obj.data.polygons:
+            script += "("
+            for v in f.vertices:
+                script += str(v) + ", "
+            script += "), "
+        script += "]\n"
+
+    # Build mesh
+    script += "\n        mesh = obj.data\n"
+    script += "        mesh.from_pydata(verts, edges, faces)\n"
+    script += "        mesh.update()\n"
+    script += "        mesh.update()\n"
+    script += "        return obj\n"
+    script += "    else:\n"
+    script += "        return None\n"
+
+    return script
+
+
 def random_id(length=8):
     """ Generates a random alphanumeric id string.
     """
diff --git a/release/scripts/addons/space_view3d_screencast_keys.py b/release/scripts/addons/space_view3d_screencast_keys.py
index 9296e35..8572187 100644
--- a/release/scripts/addons/space_view3d_screencast_keys.py
+++ b/release/scripts/addons/space_view3d_screencast_keys.py
@@ -515,6 +515,19 @@ class ScreencastKeysStatus(bpy.types.Operator):
     _handle = None
     _timer = None
 
+    @staticmethod
+    def handle_add(self, context):
+        ScreencastKeysStatus._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, (self, context), 'WINDOW', 'POST_PIXEL')
+        ScreencastKeysStatus._timer = context.window_manager.event_timer_add(0.075, context.window)
+
+    @staticmethod
+    def handle_remove(context):
+        if ScreencastKeysStatus._handle is not None:
+            context.window_manager.event_timer_remove(ScreencastKeysStatus._timer)
+            bpy.types.SpaceView3D.draw_handler_remove(ScreencastKeysStatus._handle, 'WINDOW')
+        ScreencastKeysStatus._handle = None
+        ScreencastKeysStatus._timer = None
+
     def modal(self, context, event):
         if context.area:
             context.area.tag_redraw()
@@ -580,16 +593,14 @@ class ScreencastKeysStatus(bpy.types.Operator):
 
         if not context.window_manager.screencast_keys_keys:
             # stop script
-            context.window_manager.event_timer_remove(self._timer)
-            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
+            ScreencastKeysStatus.handle_remove(context)
             return {'CANCELLED'}
 
         return {'PASS_THROUGH'}
 
     def cancel(self, context):
         if context.window_manager.screencast_keys_keys:
-            context.window_manager.event_timer_remove(self._timer)
-            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
+            ScreencastKeysStatus.handle_remove(context)
             context.window_manager.screencast_keys_keys = False
         return {'CANCELLED'}
 
@@ -603,10 +614,7 @@ class ScreencastKeysStatus(bpy.types.Operator):
                 self.mouse = []
                 self.mouse_time = []
                 ScreencastKeysStatus.overall_time = []
-                self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px,
-                    (self, context), 'WINDOW', 'POST_PIXEL')
-                self._timer = context.window_manager.event_timer_add(0.075,
-                    context.window)
+                ScreencastKeysStatus.handle_add(self, context)
                 ScreencastKeysStatus.overall_time.insert(0, time.time())
                 context.window_manager.modal_handler_add(self)
                 return {'RUNNING_MODAL'}
@@ -741,23 +749,30 @@ def init_properties():
 
 # removal of properties when script is disabled
 def clear_properties():
-    props = ["screencast_keys_keys", "screencast_keys_mouse",
-     "screencast_keys_font_size", "screencast_keys_mouse_size",
-     "screencast_keys_mouse_position", "screencast_keys_fade_time",
-     "screencast_keys_pos_x", "screencast_keys_pos_y",
-     "screencast_keys_box_draw", "screencast_keys_text_color",
-     "screencast_keys_box_color", "screencast_keys_box_hide",
-     "screencast_keys_box_width", "screencast_keys_show_operator",
-     "screencast_keys_timer_show", "screencast_keys_timer_color",
-     "screencast_keys_timer_size" ]
+    props = (
+        "screencast_keys_keys",
+        "screencast_keys_mouse",
+        "screencast_keys_font_size",
+        "screencast_keys_mouse_size",
+        "screencast_keys_mouse_position",
+        "screencast_keys_fade_time",
+        "screencast_keys_pos_x",
+        "screencast_keys_pos_y",
+        "screencast_keys_box_draw",
+        "screencast_keys_text_color",
+        "screencast_keys_box_color",
+        "screencast_keys_box_hide",
+        "screencast_keys_box_width",
+        "screencast_keys_show_operator",
+        "screencast_keys_timer_show",
+        "screencast_keys_timer_color",
+        "screencast_keys_timer_size",
+    )
+
+    wm = bpy.context.window_manager
     for p in props:
-        if bpy.context.window_manager.get(p) != None:
-            del bpy.context.window_manager[p]
-        try:
-            x = getattr(bpy.types.WindowManager, p)
-            del x
-        except:
-            pass
+        if p in wm:
+            del wm[p]
 
 
 # defining the panel
@@ -840,28 +855,34 @@ classes = (ScreencastKeysStatus,
            OBJECT_PT_keys_status)
 
 
+# store keymaps here to access after registration
+addon_keymaps = []
+
+
 def register():
     init_properties()
     for c in classes:
         bpy.utils.register_class(c)
 
-    kc = bpy.context.window_manager.keyconfigs.addon
+    wm = bpy.context.window_manager
+    kc = wm.keyconfigs.addon
     if kc:
         km = kc.keymaps.new(name='3D View', space_type='VIEW_3D')
         kmi = km.keymap_items.new('view3d.screencast_keys', 'C', 'PRESS', shift=True, alt=True)
+        addon_keymaps.append((km, kmi))
 
 
 def unregister():
+    # incase its enabled
+    ScreencastKeysStatus.handle_remove(bpy.context)
+
     for c in classes:
         bpy.utils.unregister_class(c)
 
-    kc = bpy.context.window_manager.keyconfigs.addon
-    if kc:
-        km = kc.keymaps['3D View']
-        for item in km.keymap_items:
-            if item.idname == 'view3d.screencast_keys':
-                km.keymap_items.remove(item)
-                break
+    # handle the keymap
+    for km, kmi in addon_keymaps:
+        km.keymap_items.remove(kmi)
+    addon_keymaps.clear()
 
     clear_properties()
 
diff --git a/release/scripts/addons/space_view3d_spacebar_menu.py b/release/scripts/addons/space_view3d_spacebar_menu.py
index 5732555..547d704 100644
--- a/release/scripts/addons/space_view3d_spacebar_menu.py
+++ b/release/scripts/addons/space_view3d_spacebar_menu.py
@@ -509,7 +509,7 @@ class VIEW3D_MT_Space_Dynamic_Menu(bpy.types.Menu):
             layout.operator("object.mode_set", text="Enter Object Mode",
                             icon='OBJECT_DATA')
 
-        elif ob.mode == 'EDIT_ARMATURE':
+        elif ob.mode == 'EDIT':
             # Armature menu
 
             # Search Menu
diff --git a/release/scripts/addons/texture_paint_layer_manager.py b/release/scripts/addons/texture_paint_layer_manager.py
index 192f9e6..dd8c3a0 100644
--- a/release/scripts/addons/texture_paint_layer_manager.py
+++ b/release/scripts/addons/texture_paint_layer_manager.py
@@ -155,7 +155,7 @@ class OBJECT_PT_Texture_paint_layers(bpy.types.Panel):
                 row.label(' Add a Material first!', icon = 'ERROR')
             else:
                 row = layout.row()
-                row.template_list("UI_UL_list", "", ob, "material_slots", ob,
+                row.template_list("UI_UL_list", "texture_paint_layers", ob, "material_slots", ob,
                                   "active_material_index", rows=2 )
 
                 #list Paintable textures
diff --git a/release/scripts/addons/ui_translate/__init__.py b/release/scripts/addons/ui_translate/__init__.py
index f74b177..da86a72 100644
--- a/release/scripts/addons/ui_translate/__init__.py
+++ b/release/scripts/addons/ui_translate/__init__.py
@@ -24,7 +24,7 @@ bl_info = {
     "blender": (2, 63, 0),
     "location": "Any UI control",
     "description": "Allow to translate UI directly from Blender",
-    "warning": "",
+    "warning": "Broken in this release!",
     "wiki_url": "",
     "tracker_url": "",
     "support": 'OFFICIAL',
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/Blocks.py b/release/scripts/addons_contrib/add_mesh_building_objects/Blocks.py
deleted file mode 100644
index 36ef5c0..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/Blocks.py
+++ /dev/null
@@ -1,1683 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you may redistribute it, and/or
-# modify it, under the terms of the GNU General Public License
-# as published by the Free Software Foundation - either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, write to:
-#
-#   the Free Software Foundation Inc.
-#   51 Franklin Street, Fifth Floor
-#   Boston, MA 02110-1301, USA
-#
-# or go online at: http://www.gnu.org/licenses/ to view license options.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-
-##
-#
-# Module notes:
-#
-# Grout needs to be implemented.
-# consider removing wedge crit for small "c" and "cl" values
-# wrap around for openings on radial stonework?
-# auto-clip wall edge to SMALL for radial and domes.
-# unregister doesn't release all references.
-# repeat for opening doesn't distribute evenly when radialized - see wrap around
-#   note above.
-# if opening width == indent*2 the edge blocks fail (row of blocks cross opening).
-# if openings overlap fills inverse with blocks - see h/v slots.
-# Negative grout width creates a pair of phantom blocks, seperated by grout
-#   width, inside the edges.
-# if block width variance is 0, and edging is on, right edge blocks create a "vertical seam".
-#
-##
-
-# <pep8-80 compliant>
-
-import bpy, time, math
-from random import random
-from math import fmod, sqrt, sin, cos, atan
-
-#A few constants
-SMALL = 0.000000000001
-NOTZERO = 0.01 # for values that must be != 0; see UI options/variables -
-# sort of a bug to be fixed.
-PI = math.pi
-
-#global variables
-
-#General masonry Settings
-settings = {'w': 1.2, 'wv': 0.3, 'h': .6, 'hv': 0.3, 'd': 0.3, 'dv': 0.1,
-            'g': 0.1, 'gv': 0.07, 'gd': 0.01, 'gdv': 0.0, 'b': 0, 'bv': 0,
-            'f': 0.0, 'fv': 0.0, 't': 0.0, 'sdv': 0.1, 'hwt': 0.5, 'aln':0,
-            'wm': 0.8, 'hm': 0.3, 'dm':0.1,
-            'woff':0.0, 'woffv':0.0, 'eoff':0.3, 'eoffv':0.0, 'rwhl':1,
-            'hb':0, 'ht':0, 'ge':0, 'physics':0}
-# 'w':width 'wv':widthVariation
-# 'h':height 'hv':heightVariation
-# 'd':depth 'dv':depthVariation
-# 'g':grout 'gv':groutVariation 'gd':groutDepth 'gdv':groutDepthVariation
-# 'b':bevel 'bv':bevelVariation
-# 'f':flawSize 'fv':flawSizeVariation 'ff':flawFraction
-# 't':taper
-# 'sdv':subdivision(distance or angle)
-# 'hwt':row height effect on block widths in the row (0=no effect,
-#     1=1:1 relationship, negative values allowed, 0.5 works well)
-# 'aln':alignment(0=none, 1=rows w/features, 2=features w/rows)
-#     (currently un-used)
-# 'wm':width minimum 'hm':height minimum 'dm':depth minimum
-# 'woff':row start offset(fraction of width)
-# 'woffv':width offset variation(fraction of width)
-# 'eoff':edge offset 'eoffv':edge offset variation
-# 'rwhl':row height lock(1 is all blocks in row have same height)
-# 'hb':bottom row height 'ht': top row height 'ge': grout the edges
-# 'physics': set up for physics
-
-# dims = area of wall (face)
-dims = {'s':0, 'e':PI*3/2, 'b':0.1, 't':12.3} # radial
-# 's':start x or theta 'e':end x or theta 'b':bottom z or r 't':top z or r
-# 'w' = e-s and h = t-b; calculated to optimize for various operations/usages
-#dims = {'s':-12, 'e':15, 'w':27, 'b':-15., 't':15., 'h':30}
-#dims = {'s':-bayDim/2, 'e':bayDim/2, 'b':-5., 't':10.} # bay settings?
-
-radialized = 0 # Radiating from one point - round/disc; instead of square
-slope = 0 # Warp/slope; curved over like a vaulted tunnel
-# 'bigblock': merge adjacent blocks into single large blocks
-bigBlock = 0 # Merge blocks
-
-# Gaps in blocks for various apertures.
-#openingSpecs = []
-openingSpecs = [{'w':0.5, 'h':0.5, 'x':0.8, 'z':2.7, 'rp':1, 'b':0.0,
-                 'v':0, 'vl':0, 't':0, 'tl':0}]
-# 'w': opening width, 'h': opening height,
-# 'x': horizontal position, 'z': vertical position,
-# 'rp': make multiple openings, with a spacing of x,
-# 'b': bevel the opening, inside only, like an arrow slit.
-# 'v': height of the top arch, 'vl':height of the bottom arch,
-# 't': thickness of the top arch, 'tl': thickness of the bottom arch
-
-# Add blocks to make platforms.
-shelfExt = 0
-#shelfSpecs = []
-shelfSpecs = {'w':0.5, 'h':0.5, 'd': 0.3, 'x':0.8, 'z':2.7}
-# 'w': block width, 'h': block height, 'd': block depth (shelf size; offset from wall)
-# 'x': horizontal start position, 'z': vertical start position
-
-# Add blocks to make steps.
-stepMod = 0
-stepSpecs = {'x':0.0, 'z':-10, 'w':10.0, 'h':10.0,
-    'v':0.7, 't':1.0, 'd':1.0 }
-# 'x': horizontal start position, 'z': vertical start position,
-# 'w': step area width, 'h': step area height,
-# 'v': riser height, 't': tread width, 'd': block depth (step size; offset from wall)
-
-
-    #easier way to get to the random function
-def rnd(): return random()
-
-    #random number from -0.5 to 0.5
-def rndc(): return (random() - 0.5)
-
-    #random number from -1.0 to 1.0
-def rndd(): return (random() - 0.5)*2.0
-
-
-#Opening Test suite
-#opening test function
-
-def test(TestN = 13):
-    dims = {'s':-29., 'e':29., 'b':-6., 't':TestN*7.5}
-    openingSpecs = []
-    for i in range(TestN):
-        x = (random() - 0.5) * 6
-        z = i*7.5
-        v = .2 + i*(3./TestN)
-        vl = 3.2 - i*(3./TestN)
-        t = 0.3 + random()
-        tl = 0.3 + random()
-        rn = random()*2
-        openingSpecs += [{'w':3.1 + rn, 'h':0.3 + rn, 'x':float(x),
-                          'z':float(z), 'rp':0, 'b':0.,
-                          'v':float(v), 'vl':float(vl),
-                          't':float(t), 'tl':float(tl)}]
-    return dims, openingSpecs
-
-#dims, openingSpecs = test(15)
-
-
-#For filling a linear space with divisions
-def fill(left, right, avedst, mindst=0.0, dev=0.0, pad=(0.0,0.0), num=0,
-         center=0):
-    __doc__ = """\
-    Fills a linear range with points and returns an ordered list of those points
-    including the end points.
-
-    left: the lower boundary
-    right: the upper boundary
-    avedst: the average distance between points
-    mindst: the minimum distance between points
-    dev: the maximum random deviation from avedst
-    pad: tends to move the points near the bounds right (positive) or
-        left (negative).
-        element 0 pads the lower bounds, element 1 pads the upper bounds
-    num: substitutes a numerical limit for the right limit.  fill will then make
-        a num+1 element list
-    center: flag to center the elements in the range, 0 == disabled
-        """
-
-    poslist = [left]
-    curpos = left+pad[0]
-
-    # Set offset by average spacing, then add blocks (fall through);
-    # if not at right edge.
-    if center:
-        curpos += ((right-left-mindst*2)%avedst)/2+mindst
-        if curpos-poslist[-1]<mindst: curpos = poslist[-1]+mindst+rnd()*dev/2
-
-        # clip to right edge.
-        if (right-curpos<mindst) or (right-curpos< mindst-pad[1]):
-            poslist.append(right)
-            return poslist
-
-        else: poslist.append(curpos)
-
-    #unused... for now.
-    if num:
-        idx = len(poslist)
-
-        while idx<num+1:
-            curpos += avedst+rndd()*dev
-            if curpos-poslist[-1]<mindst:
-                curpos = poslist[-1]+mindst+rnd()*dev/2
-            poslist.append(curpos)
-            idx += 1
-
-        return poslist
-
-    # make block edges
-    else:
-        while True: # loop for blocks
-            curpos += avedst+rndd()*dev
-            if curpos-poslist[-1]<mindst:
-                curpos = poslist[-1]+mindst+rnd()*dev/2
-            # close off edges at limit
-            if (right-curpos<mindst) or (right-curpos< mindst-pad[1]):
-                poslist.append(right)
-                return poslist
-
-            else: poslist.append(curpos)
-
-
-#For generating block geometry
-def MakeABlock(bounds, segsize, vll=0, Offsets=None, FaceExclude=[],
-               bevel=0, xBevScl=1):
-    __doc__ = """\
-    MakeABlock returns lists of points and faces to be made into a square
-            cornered block, subdivided along the length, with optional bevels.
-    bounds: a list of boundary positions:
-        0:left, 1:right, 2:bottom, 3:top, 4:back, 5:front
-    segsize: the maximum size before lengthwise subdivision occurs
-    vll: the number of vertexes already in the mesh. len(mesh.verts) should
-            give this number.
-    Offsets: list of coordinate delta values.
-        Offsets are lists, [x,y,z] in
-            [
-            0:left_bottom_back,
-            1:left_bottom_front,
-            2:left_top_back,
-            3:left_top_front,
-            4:right_bottom_back,
-            5:right_bottom_front,
-            6:right_top_back,
-            7:right_top_front,
-            ]
-    FaceExclude: list of faces to exclude from the faces list.  see bounds above for indices
-    xBevScl: how much to divide the end (+- x axis) bevel dimensions.  Set to current average radius to compensate for angular distortion on curved blocks
-    """
-
-    slices = fill(bounds[0], bounds[1], segsize, segsize, center=1)
-    points = []
-    faces = []
-
-    if Offsets == None:
-        points.append([slices[0],bounds[4],bounds[2]])
-        points.append([slices[0],bounds[5],bounds[2]])
-        points.append([slices[0],bounds[5],bounds[3]])
-        points.append([slices[0],bounds[4],bounds[3]])
-
-        for x in slices[1:-1]:
-            points.append([x,bounds[4],bounds[2]])
-            points.append([x,bounds[5],bounds[2]])
-            points.append([x,bounds[5],bounds[3]])
-            points.append([x,bounds[4],bounds[3]])
-
-        points.append([slices[-1],bounds[4],bounds[2]])
-        points.append([slices[-1],bounds[5],bounds[2]])
-        points.append([slices[-1],bounds[5],bounds[3]])
-        points.append([slices[-1],bounds[4],bounds[3]])
-
-    else:
-        points.append([slices[0]+Offsets[0][0],bounds[4]+Offsets[0][1],bounds[2]+Offsets[0][2]])
-        points.append([slices[0]+Offsets[1][0],bounds[5]+Offsets[1][1],bounds[2]+Offsets[1][2]])
-        points.append([slices[0]+Offsets[3][0],bounds[5]+Offsets[3][1],bounds[3]+Offsets[3][2]])
-        points.append([slices[0]+Offsets[2][0],bounds[4]+Offsets[2][1],bounds[3]+Offsets[2][2]])
-
-        for x in slices[1:-1]:
-            xwt = (x-bounds[0])/(bounds[1]-bounds[0])
-            points.append([x+Offsets[0][0]*(1-xwt)+Offsets[4][0]*xwt,bounds[4]+Offsets[0][1]*(1-xwt)+Offsets[4][1]*xwt,bounds[2]+Offsets[0][2]*(1-xwt)+Offsets[4][2]*xwt])
-            points.append([x+Offsets[1][0]*(1-xwt)+Offsets[5][0]*xwt,bounds[5]+Offsets[1][1]*(1-xwt)+Offsets[5][1]*xwt,bounds[2]+Offsets[1][2]*(1-xwt)+Offsets[5][2]*xwt])
-            points.append([x+Offsets[3][0]*(1-xwt)+Offsets[7][0]*xwt,bounds[5]+Offsets[3][1]*(1-xwt)+Offsets[7][1]*xwt,bounds[3]+Offsets[3][2]*(1-xwt)+Offsets[7][2]*xwt])
-            points.append([x+Offsets[2][0]*(1-xwt)+Offsets[6][0]*xwt,bounds[4]+Offsets[2][1]*(1-xwt)+Offsets[6][1]*xwt,bounds[3]+Offsets[2][2]*(1-xwt)+Offsets[6][2]*xwt])
-
-        points.append([slices[-1]+Offsets[4][0],bounds[4]+Offsets[4][1],bounds[2]+Offsets[4][2]])
-        points.append([slices[-1]+Offsets[5][0],bounds[5]+Offsets[5][1],bounds[2]+Offsets[5][2]])
-        points.append([slices[-1]+Offsets[7][0],bounds[5]+Offsets[7][1],bounds[3]+Offsets[7][2]])
-        points.append([slices[-1]+Offsets[6][0],bounds[4]+Offsets[6][1],bounds[3]+Offsets[6][2]])
-
-    faces.append([vll,vll+3,vll+2,vll+1])
-
-    for x in range(len(slices)-1):
-        faces.append([vll,vll+1,vll+5,vll+4])
-        vll+=1
-        faces.append([vll,vll+1,vll+5,vll+4])
-        vll+=1
-        faces.append([vll,vll+1,vll+5,vll+4])
-        vll+=1
-        faces.append([vll,vll-3,vll+1,vll+4])
-        vll+=1
-
-    faces.append([vll,vll+1,vll+2,vll+3])
-
-    return points, faces
-#
-#
-#
-
-#For generating Keystone Geometry
-def MakeAKeystone(xpos, width, zpos, ztop, zbtm, thick, bevel, vll=0, FaceExclude=[], xBevScl=1):
-    __doc__ = """\
-    MakeAKeystone returns lists of points and faces to be made into a square cornered keystone, with optional bevels.
-    xpos: x position of the centerline
-    width: x width of the keystone at the widest point (discounting bevels)
-    zpos: z position of the widest point
-    ztop: distance from zpos to the top
-    zbtm: distance from zpos to the bottom
-    thick: thickness
-    bevel: the amount to raise the back vertex to account for arch beveling
-    vll: the number of vertexes already in the mesh. len(mesh.verts) should give this number
-    faceExclude: list of faces to exclude from the faces list.  0:left, 1:right, 2:bottom, 3:top, 4:back, 5:front
-    xBevScl: how much to divide the end (+- x axis) bevel dimensions.  Set to current average radius to compensate for angular distortion on curved blocks
-    """
-
-    points = []
-    faces = []
-    faceinclude = [1 for x in range(6)]
-    for x in FaceExclude: faceinclude[x]=0
-    Top = zpos + ztop
-    Btm = zpos - zbtm
-    Wid = width/2.
-    Thk = thick/2.
-
-    # The front top point
-    points.append([xpos, Thk, Top])
-    # The front left point
-    points.append([xpos-Wid, Thk, zpos])
-    # The front bottom point
-    points.append([xpos, Thk, Btm])
-    # The front right point
-    points.append([xpos+Wid, Thk, zpos])
-
-    MirrorPoints = []
-    for i in points:
-        MirrorPoints.append([i[0],-i[1],i[2]])
-    points += MirrorPoints
-    points[6][2] += bevel
-
-    faces.append([3,2,1,0])
-    faces.append([4,5,6,7])
-    faces.append([4,7,3,0])
-    faces.append([5,4,0,1])
-    faces.append([6,5,1,2])
-    faces.append([7,6,2,3])
-    # Offset the vertex numbers by the number of verticies already in the list
-    for i in range(len(faces)):
-        for j in range(len(faces[i])): faces[i][j] += vll
-
-    return points, faces
-
-
-#for finding line/circle intercepts
-def circ(offs=0.,r=1.):
-    __doc__ = """\
-    offs is the distance perpendicular to the line to the center of the circle
-    r is the radius of the circle
-    circ returns the distance paralell to the line to the center of the circle at the intercept.
-    """
-    offs = abs(offs)
-    if offs > r: return None
-    elif offs == r: return 0.
-    else: return sqrt(r**2 - offs**2)
-
-
-#class openings in the wall
-class opening:
-    __doc__ = """\
-    This is the class for holding the data for the openings in the wall.
-    It has methods for returning the edges of the opening for any given position value,
-    as well as bevel settings and top and bottom positions.
-    It stores the 'style' of the opening, and all other pertinent information.
-    """
-    # x = 0. # x position of the opening
-    # z = 0. # x position of the opening
-    # w = 0. # width of the opening
-    # h = 0. # height of the opening
-    r = 0  # top radius of the arch (derived from 'v')
-    rl = 0 # lower radius of the arch (derived from 'vl')
-    rt = 0 # top arch thickness
-    rtl = 0# lower arch thickness
-    ts = 0 # Opening side thickness, if greater than average width, replaces it.
-    c = 0  # top arch corner position (for low arches), distance from the top of the straight sides
-    cl = 0 # lower arch corner position (for low arches), distance from the top of the straight sides
-    # form = 0 # arch type (unused for now)
-    # b = 0. # back face bevel distance, like an arrow slit
-    v = 0. # top arch height
-    vl = 0.# lower arch height
-    # variable "s" is used for "side" in the "edge" function.
-    # it is a signed int, multiplied by the width to get + or - of the center
-
-    def btm(self):
-        if self.vl <= self.w/2 : return self.z-self.h/2-self.vl-self.rtl
-        else: return self.z - sqrt((self.rl+self.rtl)**2 - (self.rl - self.w/2 )**2)  - self.h/2
-
-
-    def top(self):
-        if self.v <= self.w/2 : return self.z+self.h/2+self.v+self.rt
-        else: return sqrt((self.r+self.rt)**2 - (self.r - self.w/2 )**2) + self.z + self.h/2
-
-
-    #crits returns the critical split points, or discontinuities, used for making rows
-    def crits(self):
-        critlist = []
-        if self.vl>0: # for lower arch
-            # add the top point if it is pointed
-            #if self.vl >= self.w/2.: critlist.append(self.btm())
-            if self.vl < self.w/2.:#else: for low arches, with wedge blocks under them
-                #critlist.append(self.btm())
-                critlist.append(self.z-self.h/2 - self.cl)
-
-        if self.h>0: # if it has a height, append points at the top and bottom of the main square section
-            critlist += [self.z-self.h/2,self.z+self.h/2]
-        else:  # otherwise, append just one in the center
-            critlist.append(self.z)
-
-        if self.v>0:  # for the upper arch
-            if self.v < self.w/2.: # add the splits for the upper wedge blocks, if needed
-                critlist.append(self.z+self.h/2 + self.c)
-                #critlist.append(self.top())
-            #otherwise just add the top point, if it is pointed
-            #else: critlist.append(self.top())
-
-        return critlist
-
-
-    # get the side position of the opening.
-    # ht is the z position; s is the side: 1 for right, -1 for left
-    # if the height passed is above or below the opening, return None
-    #
-    def edgeS(self, ht, s):
-        # set the row radius: 1 for standard wall (flat)
-        if radialized:
-            if slope: r1 = abs(dims['t']*sin(ht*PI/(dims['t']*2)))
-            else: r1 = abs(ht)
-        else: r1 = 1
-
-        #Go through all the options, and return the correct value
-        if ht < self.btm(): #too low
-            return None
-        elif ht > self.top(): #too high
-            return None
-
-        # Check for circ returning None - prevent TypeError (script failure) with float.
-
-        # in this range, pass the lower arch info
-        elif ht <= self.z-self.h/2-self.cl:
-            if self.vl > self.w/2:
-                circVal = circ(ht-self.z+self.h/2,self.rl+self.rtl)
-                if circVal == None:
-                    return None
-                else: return self.x + s*(self.w/2.-self.rl+circVal)/r1
-            else:
-                circVal = circ(ht-self.z+self.h/2+self.vl-self.rl,self.rl+self.rtl)
-                if circVal == None:
-                    return None
-                else: return self.x + s*circVal/r1
-
-        #in this range, pass the top arch info
-        elif ht >= self.z+self.h/2+self.c:
-            if self.v > self.w/2:
-                circVal = circ(ht-self.z-self.h/2,self.r+self.rt)
-                if circVal == None:
-                    return None
-                else: return self.x + s*(self.w/2.-self.r+circVal)/r1
-            else:
-                circVal = circ(ht-(self.z+self.h/2+self.v-self.r),self.r+self.rt)
-                if circVal == None:
-                    return None
-                else: return self.x + s*circVal/r1
-
-        #in this range pass the lower corner edge info
-        elif ht <= self.z-self.h/2:
-            d = sqrt(self.rtl**2 - self.cl**2)
-            if self.cl > self.rtl/sqrt(2.): return self.x + s*(self.w/2 + (self.z - self.h/2 - ht)*d/self.cl)/r1
-            else: return self.x + s*( self.w/2 + d )/r1
-
-        #in this range pass the upper corner edge info
-        elif ht >= self.z+self.h/2:
-            d = sqrt(self.rt**2 - self.c**2)
-            if self.c > self.rt/sqrt(2.): return self.x + s*(self.w/2 + (ht - self.z - self.h/2 )*d/self.c)/r1
-            else: return self.x + s*( self.w/2 + d )/r1
-
-        #in this range, pass the middle info (straight sides)
-        else: return self.x + s*self.w/2/r1
-
-
-    # get the top or bottom of the opening
-    # ht is the x position; s is the side: 1 for top, -1 for bottom
-    #
-    def edgeV(self, ht, s):
-        dist = abs(self.x-ht)
-        def radialAdjust(dist, sideVal):
-            """take the distance and adjust for radial geometry, return dist.
-            """
-            if radialized:
-                if slope:
-                    dist = dist * abs(dims['t']*sin(sideVal*PI/(dims['t']*2)))
-                else:
-                    dist = dist * sideVal
-            return dist
-
-        if s > 0 :#and (dist <= self.edgeS(self.z+self.h/2+self.c,1)-self.x): #check top down
-            #hack for radialized masonry, import approx Z instead of self.top()
-            dist = radialAdjust(dist, self.top())
-
-            #no arch on top, flat
-            if not self.r: return self.z+self.h/2
-
-            #pointed arch on top
-            elif self.v > self.w/2:
-                circVal = circ(dist-self.w/2+self.r,self.r+self.rt)
-                if circVal == None:
-                    return None
-                else: return self.z+self.h/2+circVal
-
-            #domed arch on top
-            else:
-                circVal = circ(dist,self.r+self.rt)
-                if circVal == None:
-                    return None
-                else: return self.z+self.h/2+self.v-self.r+circVal
-
-        else:#and (dist <= self.edgeS(self.z-self.h/2-self.cl,1)-self.x): #check bottom up
-            #hack for radialized masonry, import approx Z instead of self.top()
-            dist = radialAdjust(dist, self.btm())
-
-            #no arch on bottom
-            if not self.rl: return self.z-self.h/2
-
-            #pointed arch on bottom
-            elif self.vl > self.w/2:
-                circVal = circ(dist-self.w/2+self.rl,self.rl+self.rtl)
-                if circVal == None:
-                    return None
-                else: return self.z-self.h/2-circVal
-
-            #old conditional? if (dist-self.w/2+self.rl)<=(self.rl+self.rtl):
-            #domed arch on bottom
-            else:
-                circVal = circ(dist,self.rl+self.rtl) # dist-self.w/2+self.rl
-                if circVal == None:
-                    return None
-                else: return self.z-self.h/2-self.vl+self.rl-circVal
-
-    # and this never happens - but, leave it as failsafe :)
-        print("got all the way out of the edgeV!  Not good!")
-        print("opening x = ", self.x, ", opening z = ", self.z)
-        return 0.0
-    #
-    def edgeBev(self, ht):
-        if ht > (self.z + self.h/2): return 0.0
-        if ht < (self.z - self.h/2): return 0.0
-        if radialized:
-            if slope: r1 = abs(dims['t']*sin(ht*PI/(dims['t']*2)))
-            else: r1 = abs(ht)
-        else: r1 = 1
-        bevel = self.b / r1
-        return bevel
-#
-##
-#
-
-    def __init__(self, xpos, zpos, width, height, archHeight=0, archThk=0,
-                 archHeightLower=0, archThkLower=0, bevel=0, edgeThk=0):
-        self.x = float(xpos)
-        self.z = float(zpos)
-        self.w = float(width)
-        self.h = float(height)
-        self.rt = archThk
-        self.rtl = archThkLower
-        self.v = archHeight
-        self.vl = archHeightLower
-        if self.w <= 0: self.w = SMALL
-
-        #find the upper arch radius
-        if archHeight >= width/2:
-            # just one arch, low long
-            self.r = (self.v**2)/self.w + self.w/4
-        elif archHeight <= 0:
-            # No arches
-            self.r = 0
-            self.v = 0
-        else:
-            # Two arches
-            self.r = (self.w**2)/(8*self.v) + self.v/2.
-            self.c = self.rt*cos(atan(self.w/(2*(self.r-self.v))))
-
-        #find the lower arch radius
-        if archHeightLower >= width/2:
-            self.rl = (self.vl**2)/self.w + self.w/4
-        elif archHeightLower <= 0:
-            self.rl = 0
-            self.vl = 0
-        else:
-            self.rl = (self.w**2)/(8*self.vl) + self.vl/2.
-            self.cl = self.rtl*cos(atan(self.w/(2*(self.rl-self.vl))))
-
-        #self.form = something?
-        self.b = float(bevel)
-        self.ts = edgeThk
-#
-#
-
-#class for the whole wall boundaries; a sub-class of "opening"
-class OpeningInv(opening):
-    #this is supposed to switch the sides of the opening
-    #so the wall will properly enclose the whole wall.
-    #We'll see if it works.
-
-    def edgeS(self, ht, s):
-        return opening.edgeS(self, ht, -s)
-
-    def edgeV(self, ht, s):
-        return opening.edgeV(self, ht, -s)
-
-#class rows in the wall
-class rowOb:
-    __doc__ = """\
-    This is the class for holding the data for individual rows of blocks.
-    each row is required to have some edge blocks, and can also have
-    intermediate sections of "normal" blocks.
-    """
-
-    #z = 0.
-    #h = 0.
-    radius = 1
-    EdgeOffset = 0.
-#    BlocksEdge = []
-#    RowSegments = []
-#    BlocksNorm = []
-
-    def FillBlocks(self):
-        # Set the radius variable, in the case of radial geometry
-        if radialized:
-            if slope: self.radius = dims['t']*(sin(self.z*PI/(dims['t']*2)))
-            else: self.radius = self.z
-
-        #initialize internal variables from global settings
-
-        SetH = settings['h']
-        SetHwt = settings['hwt']
-        SetWid = settings['w']
-        SetWidMin = settings['wm']
-        SetWidVar = settings['wv']
-        SetGrt = settings['g']
-        SetGrtVar = settings['gv']
-        SetRowHeightLink = settings['rwhl']
-        SetDepth = settings['d']
-        SetDepthVar = settings['dv']
-
-        #height weight, used for making shorter rows have narrower blocks, and vice-versa
-        hwt = ((self.h/SetH-1)*SetHwt+1)
-
-        # set variables for persistent values: loop optimization, readability, single ref for changes.
-
-        avgDist = hwt*SetWid/self.radius
-        minDist = SetWidMin/self.radius
-        deviation = hwt*SetWidVar/self.radius
-        grtOffset = SetGrt/(2*self.radius)
-
-        # init loop variables that may change...
-
-        grt = (SetGrt + rndc()*SetGrtVar)/(self.radius)
-        ThisBlockHeight = self.h+rndc()*(1-SetRowHeightLink)*SetGrtVar
-        ThisBlockDepth = rndd()*SetDepthVar+SetDepth
-
-        for segment in self.RowSegments:
-            divs = fill(segment[0]+grtOffset, segment[1]-grtOffset, avgDist, minDist, deviation)
-
-            #loop through the divisions, adding blocks for each one
-            for i in range(len(divs)-1):
-                ThisBlockx = (divs[i]+divs[i+1])/2
-                ThisBlockw = divs[i+1]-divs[i]-grt
-
-                self.BlocksNorm.append([ThisBlockx, self.z, ThisBlockw, ThisBlockHeight, ThisBlockDepth, None])
-
-                if SetDepthVar: # vary depth
-                    ThisBlockDepth = rndd()*SetDepthVar+SetDepth
-
-                if SetGrtVar: # vary grout
-                    grt = (SetGrt + rndc()*SetGrtVar)/(self.radius)
-                    ThisBlockHeight = self.h+rndc()*(1-SetRowHeightLink)*SetGrtVar
-
-
-    def __init__(self,centerheight,rowheight,edgeoffset = 0.):
-        self.z = float(centerheight)
-        self.h = float(rowheight)
-        self.EdgeOffset = float(edgeoffset)
-
-#THIS INITILIZATION IS IMPORTANT!  OTHERWISE ALL OBJECTS WILL HAVE THE SAME LISTS!
-        self.BlocksEdge = []
-        self.RowSegments = []
-        self.BlocksNorm = []
-
-#
-def arch(ra,rt,x,z, archStart, archEnd, bevel, bevAngle, vll):
-    __doc__ = """\
-    Makes a list of faces and vertexes for arches.
-    ra: the radius of the arch, to the center of the bricks
-    rt: the thickness of the arch
-    x: x center location of the circular arc, as if the arch opening were centered on x = 0
-    z: z center location of the arch
-    anglebeg: start angle of the arch, in radians, from vertical?
-    angleend: end angle of the arch, in radians, from vertical?
-    bevel: how much to bevel the inside of the arch.
-    vll: how long is the vertex list already?
-    """
-    avlist = []
-    aflist = []
-
-    #initialize internal variables for global settings
-#overkill?
-    SetH = settings['h']
-    SetHwt = settings['hwt']
-    SetWid = settings['w']
-    SetWidMin = settings['wm']
-    SetWidVar = settings['wv']
-    SetGrt = settings['g']
-    SetGrtVar = settings['gv']
-    SetRowHeightLink = settings['rwhl']
-    SetDepth = settings['d']
-    SetDepthVar = settings['dv']
-
-    # Init loop variables
-
-    def bevelEdgeOffset(offsets, bevel, side):
-        """
-        Take the block offsets and modify it for the correct bevel.
-
-        offsets = the offset list. See MakeABlock
-        bevel = how much to offset the edge
-        side = -1 for left (right side), 1 for right (left side)
-        """
-        left = (0,2,3)
-        right = (4,6,7)
-        if side == 1: pointsToAffect = right
-        else: pointsToAffect = left
-        for num in pointsToAffect:
-            offsets[num] = offsets[num][:]
-            offsets[num][0] += -bevel * side
-
-    ArchInner = ra-rt/2
-    ArchOuter = ra+rt/2-SetGrt + rndc()*SetGrtVar
-
-    DepthBack = -SetDepth/2-rndc()*SetDepthVar
-    DepthFront = SetDepth/2+rndc()*SetDepthVar
-
-    if radialized: subdivision = settings['sdv']
-    else: subdivision = 0.12
-
-    grt = (SetGrt + rndc()*SetGrtVar)/(2*ra) # init grout offset for loop
-    # set up the offsets, it will be the same for every block
-    offsets = ([[0]*2 + [bevel]] + [[0]*3]*3)*2
-
-    #make the divisions in the "length" of the arch
-    divs = fill(archStart, archEnd, settings['w']/ra, settings['wm']/ra, settings['wv']/ra)
-
-    for i in range(len(divs)-1):
-        if i == 0:
-            ThisOffset = offsets[:]
-            bevelEdgeOffset(ThisOffset, bevAngle, -1)
-        elif i == len(divs)-2:
-            ThisOffset = offsets[:]
-            bevelEdgeOffset(ThisOffset, bevAngle, 1)
-        else:
-            ThisOffset = offsets
-
-        geom = MakeABlock([divs[i]+grt, divs[i+1]-grt, ArchInner, ArchOuter, DepthBack, DepthFront],
-                          subdivision, len(avlist) + vll, ThisOffset, [], None, ra)
-
-        avlist += geom[0]
-        aflist += geom[1]
-
-        if SetDepthVar: # vary depth
-            DepthBack = -SetDepth/2-rndc()*SetDepthVar
-            DepthFront = SetDepth/2+rndc()*SetDepthVar
-
-        if SetGrtVar: # vary grout
-            grt = (settings['g'] + rndc()*SetGrtVar)/(2*ra)
-            ArchOuter = ra+rt/2-SetGrt + rndc()*SetGrtVar
-
-    for i,vert in enumerate(avlist):
-        v0 = vert[2]*sin(vert[0]) + x
-        v1 = vert[1]
-        v2 = vert[2]*cos(vert[0]) + z
-
-        if radialized==1:
-            if slope==1: r1 = dims['t']*(sin(v2*PI/(dims['t']*2)))
-            else: r1 = v2
-            v0 = v0/r1
-
-        avlist[i] = [v0,v1,v2]
-
-    return (avlist,aflist)
-
-#
-def sketch():
-    __doc__ = """\
-    The 'sketch' function creates a list of openings from the general specifications passed to it.
-    It takes curved and domed walls into account, placing the openings at the appropriate angular locations
-    """
-    boundlist = []
-    for x in openingSpecs:
-        if x['rp']:
-            if radialized: r1 = x['z']
-            else: r1 = 1
-
-            if x['x'] > (x['w'] + settings['wm']):spacing = x['x']/r1
-            else: spacing = (x['w'] + settings['wm'])/r1
-
-            minspacing = (x['w'] + settings['wm'])/r1
-
-            divs = fill(dims['s'],dims['e'],spacing,minspacing,center=1)
-
-            for posidx in range(len(divs)-2):
-                boundlist.append(opening(divs[posidx+1],x['z'],x['w'],x['h'],x['v'],x['t'],x['vl'],x['tl'],x['b']))
-
-        else: boundlist.append(opening(x['x'],x['z'],x['w'],x['h'],x['v'],x['t'],x['vl'],x['tl'],x['b']))
-        #check for overlaping edges?
-
-    return boundlist
-
-
-def wedgeBlocks(row, opening, leftPos, rightPos, edgeBinary, r1):
-    __doc__ = """\
-    Makes wedge blocks for the left and right sides, depending
-    example:
-    wedgeBlocks(row, LeftWedgeEdge, LNerEdge, LEB, r1)
-    wedgeBlocks(row, RNerEdge, RightWedgeEdge, REB, r1)
-    """
-    wedgeEdges = fill(leftPos, rightPos, settings['w']/r1, settings['wm']/r1,
-                      settings['wv']/r1)
-
-    for i in range(len(wedgeEdges)-1):
-        x = (wedgeEdges[i+1] + wedgeEdges[i])/2
-        grt = (settings['g'] + rndd()*settings['gv'])/r1
-        w = wedgeEdges[i+1] - wedgeEdges[i] - grt
-
-        ThisBlockDepth = rndd()*settings['dv']+settings['d']
-
-#edgeV may return "None" - causing TypeError for math op.
-#use 0 until wedgeBlocks operation worked out
-        edgeVal = opening.edgeV(x-w/2,edgeBinary)
-        if edgeVal == None: edgeVal = 0.0
-
-        LeftVertOffset =  -( row.z - (row.h/2)*edgeBinary - edgeVal )
-
-#edgeV may return "None" - causing TypeError for math op.
-#use 0 until wedgeBlocks operation worked out
-        edgeVal = opening.edgeV(x+w/2,edgeBinary)
-        if edgeVal == None: edgeVal = 0.0
-
-        RightVertOffset = -( row.z - (row.h/2)*edgeBinary - edgeVal )
-
-        #Wedges are on top = off, blank, off, blank
-        #Wedges are on btm = blank, off, blank, off
-        ThisBlockOffsets = [[0,0,LeftVertOffset]]*2 + [[0]*3]*2 + [[0,0,RightVertOffset]]*2
-
-        # Instert or append "blank" for top or bottom wedges.
-        if edgeBinary == 1: ThisBlockOffsets = ThisBlockOffsets + [[0]*3]*2
-        else: ThisBlockOffsets = [[0]*3]*2 + ThisBlockOffsets
-
-        row.BlocksEdge.append([x,row.z,w,row.h,ThisBlockDepth,ThisBlockOffsets])
-
-    return None
-
-def bevelBlockOffsets(offsets, bevel, side):
-    """
-    Take the block offsets and modify it for the correct bevel.
-
-    offsets = the offset list. See MakeABlock
-    bevel = how much to offset the edge
-    side = -1 for left (right side), 1 for right (left side)
-    """
-#    left = (4,6)
-#    right = (0,2)
-    if side == 1: pointsToAffect = (0,2) # right
-    else: pointsToAffect = (4,6) # left
-    for num in pointsToAffect:
-        offsets[num] = offsets[num][:]
-        offsets[num][0] += bevel * side
-
-def rowProcessing(row, Thesketch, WallBoundaries):
-    __doc__ = """\
-    Take row and opening data and process a single row, adding edge and fill blocks to the row data.
-    """
-    #set end blocks
-    #check for openings, record top and bottom of row for right and left of each
-    #if both top and bottom intersect create blocks on each edge, appropriate to the size of the overlap
-    #if only one side intersects, run fill to get edge positions, but this should never happen
-    #
-
-    if radialized:#this checks for radial stonework, and sets the row radius if required
-        if slope: r1 = abs(dims['t']*sin(row.z*PI/(dims['t']*2)))
-        else: r1 = abs(row.z)
-    else: r1 = 1
-
-    # set the edge grout thickness, especially with radial stonework in mind
-    edgrt = settings['ge']*(settings['g']/2 + rndc()*settings['gv'])/(2*r1)
-
-    # Sets up a list of  intersections of top of row with openings,
-    #from left to right [left edge of opening, right edge of opening, etc...]
-    #initially just the left and right edge of the wall
-    edgetop = [[dims['s']+row.EdgeOffset/r1+edgrt,WallBoundaries], [dims['e']+row.EdgeOffset/r1-edgrt,WallBoundaries]]
-    # Same as edgetop, but for the bottms of the rows
-    edgebtm = [[dims['s']+row.EdgeOffset/r1+edgrt,WallBoundaries], [dims['e']+row.EdgeOffset/r1-edgrt,WallBoundaries]]
-
-    # set up some useful values for the top and bottom of the rows.
-    rowTop = row.z+row.h/2
-    rowBtm = row.z-row.h/2
-
-    for hole in Thesketch:
-        #check the top and bottom of the row, looking at the opening from the right
-        e = [hole.edgeS(rowTop, -1), hole.edgeS(rowBtm, -1)]
-
-        # If either one hit the opening, make split points for the left side of the opening.
-        if e[0] or e[1]:
-            e += [hole.edgeS(rowTop, 1), hole.edgeS(rowBtm, 1)]
-
-            # If one of them missed for some reason, set that value to
-            # the middle of the opening.
-            for i,pos in enumerate(e):
-                if pos == None: e[i] = hole.x
-
-            # add the intersects to the list of edge points
-            edgetop.append([e[0],hole])
-            edgetop.append([e[2],hole])
-            edgebtm.append([e[1],hole])
-            edgebtm.append([e[3],hole])
-
-    # We want to make the walls in order, so sort the intersects.
-    # This is where you would want to remove edge points that are out of order
-    # so that you don't get the "oddity where overlapping openings create blocks inversely" problem
-    edgetop.sort()
-    edgebtm.sort()
-
-    #these two loops trim the edges to the limits of the wall.  This way openings extending outside the wall don't enlarge the wall.
-    while True:
-        try:
-            if (edgetop[-1][0] > dims['e']+row.EdgeOffset/r1) or (edgebtm[-1][0] > dims['e']+row.EdgeOffset/r1):
-                edgetop[-2:] = []
-                edgebtm[-2:] = []
-            else: break
-        except IndexError: break
-    #still trimming the edges...
-    while True:
-        try:
-            if (edgetop[0][0] < dims['s']+row.EdgeOffset/r1) or (edgebtm[0][0] < dims['s']+row.EdgeOffset/r1):
-                edgetop[:2] = []
-                edgebtm[:2] = []
-            else: break
-        except IndexError: break
-
-    #make those edge blocks and rows!  Wooo!
-    #This loop goes through each section, (a pair of points in edgetop)
-    #and places the edge blocks and inbetween normal block zones into the row object
-    for OpnSplitNo in range(int(len(edgetop)/2)):
-        #left edge is edge<x>[2*OpnSplitNo], right edge edgex[2*OpnSplitNo+1]
-        leftEdgeIndex = 2*OpnSplitNo
-        rightEdgeIndex = 2*OpnSplitNo + 1
-        # get the openings, to save time and confusion
-        leftOpening = edgetop[leftEdgeIndex][1]
-        rightOpening = edgetop[rightEdgeIndex][1]
-        #find the difference between the edge top and bottom on both sides
-        LTop = edgetop[leftEdgeIndex][0]
-        LBtm = edgebtm[leftEdgeIndex][0]
-        RTop = edgetop[rightEdgeIndex][0]
-        RBtm = edgebtm[rightEdgeIndex][0]
-        LDiff = LBtm-LTop
-        RDiff = RTop-RBtm
-
-        #which is furthur out on each side, top or bottom?
-        if LDiff > 0:
-            LFarEdge = LTop #The furthest edge left
-            LNerEdge = LBtm #the nearer edge left
-            LEB = 1 #Left Edge Boolean, set to 1 if furthest edge is top, -1 if it is bottom
-        else:
-            LFarEdge = LBtm
-            LNerEdge = LTop
-            LEB = -1
-
-        if RDiff > 0:
-            RFarEdge = RTop #The furthest edge right
-            RNerEdge = RBtm #the nearer edge right
-            REB = 1 #Right Edge Boolean, set to 1 if furthest edge is top, -1 if it is bottom
-
-        else:
-            RFarEdge = RBtm #The furthest edge right
-            RNerEdge = RTop
-            REB = -1 #Right Edge Boolean, set to 1 if furthest edge is top, -1 if it is bottom
-
-        #The space between the closest edges of the openings in this section of the row
-        InnerDiff = RNerEdge - LNerEdge
-        #The mid point between the nearest edges
-        InnerMid = (RNerEdge + LNerEdge)/2
-
-        #maximum distance to span with one block
-        MaxWid = (settings['w']+settings['wv'])/r1
-        AveWid = settings['w']
-        MinWid = settings['wm']
-
-        #check the left and right sides for wedge blocks
-        #Check and run the left edge first
-        #find the edge of the correct side, offset for minimum block height.  The LEB decides top or bottom
-        ZPositionCheck = row.z + (row.h/2-settings['hm'])*LEB
-#edgeS may return "None"
-        LeftWedgeEdge = leftOpening.edgeS(ZPositionCheck,1)
-
-        if (abs(LDiff) > AveWid) or (not LeftWedgeEdge):
-            #make wedge blocks
-            if not LeftWedgeEdge: LeftWedgeEdge = leftOpening.x
-            wedgeBlocks(row, leftOpening, LeftWedgeEdge, LNerEdge, LEB, r1)
-            #set the near and far edge settings to vertical, so the other edge blocks don't interfere
-            LFarEdge , LTop , LBtm = LNerEdge, LNerEdge, LNerEdge
-            LDiff = 0
-
-        #Now do the wedge blocks for the right, same drill... repeated code?
-        #find the edge of the correct side, offset for minimum block height.  The REB decides top or bottom
-        ZPositionCheck = row.z + (row.h/2-settings['hm'])*REB
-#edgeS may return "None"
-        RightWedgeEdge = rightOpening.edgeS(ZPositionCheck,-1)
-        if (abs(RDiff) > AveWid) or (not RightWedgeEdge):
-            #make wedge blocks
-            if not RightWedgeEdge: RightWedgeEdge = rightOpening.x
-            wedgeBlocks(row, rightOpening, RNerEdge, RightWedgeEdge, REB, r1)
-            #set the near and far edge settings to vertical, so the other edge blocks don't interfere
-            RFarEdge , RTop , RBtm = RNerEdge, RNerEdge, RNerEdge
-            RDiff = 0
-
-        #Check to see if the edges are close enough toegther to warrant a single block filling it
-        if (InnerDiff < MaxWid):
-            #if this is true, then this row is just one block!
-            x = (LNerEdge + RNerEdge)/2.
-            w = InnerDiff
-            ThisBlockDepth = rndd()*settings['dv']+settings['d']
-            BtmOff = LBtm - LNerEdge
-            TopOff = LTop - LNerEdge
-            ThisBlockOffsets = [[BtmOff,0,0]]*2 + [[TopOff,0,0]]*2
-            BtmOff = RBtm - RNerEdge
-            TopOff = RTop - RNerEdge
-            ThisBlockOffsets += [[BtmOff,0,0]]*2 + [[TopOff,0,0]]*2
-            bevel = leftOpening.edgeBev(rowTop)
-            bevelBlockOffsets(ThisBlockOffsets, bevel, 1)
-            bevel = rightOpening.edgeBev(rowTop)
-            bevelBlockOffsets(ThisBlockOffsets, bevel, -1)
-            row.BlocksEdge.append([x,row.z,w,row.h,ThisBlockDepth,ThisBlockOffsets])
-            continue
-
-        # it's not one block, must be two or more
-        # set up the offsets for the left
-        BtmOff = LBtm - LNerEdge
-        TopOff = LTop - LNerEdge
-        leftOffsets = [[BtmOff,0,0]]*2 + [[TopOff,0,0]]*2 + [[0]*3]*4
-        bevelL = leftOpening.edgeBev(rowTop)
-        bevelBlockOffsets(leftOffsets, bevelL, 1)
-        # and now for the right
-        BtmOff = RBtm - RNerEdge
-        TopOff = RTop - RNerEdge
-        rightOffsets = [[0]*3]*4 + [[BtmOff,0,0]]*2 + [[TopOff,0,0]]*2
-        bevelR = rightOpening.edgeBev(rowTop)
-        bevelBlockOffsets(rightOffsets, bevelR, -1)
-        # check to see if it is only two blocks
-        if (InnerDiff < MaxWid*2):
-        #this row is just two blocks! Left block, then right block
-            #div is the x position of the dividing point between the two bricks
-            div = InnerMid + (rndd()*settings['wv'])/r1
-            #set the grout distance, since we need grout seperation between the blocks
-            grt = (settings['g'] + rndc()*settings['gv'])/r1
-            #set the x position and width for the left block
-            x = (div + LNerEdge)/2 - grt/4
-            w = (div - LNerEdge) - grt/2
-            ThisBlockDepth = rndd()*settings['dv']+settings['d']
-            #For reference: EdgeBlocks = [[x,z,w,h,d,[corner offset matrix]],[etc.]]
-            row.BlocksEdge.append([x,row.z,w,row.h,ThisBlockDepth,leftOffsets])
-            #Initialize for the block on the right side
-            x = (div + RNerEdge)/2 + grt/4
-            w = (RNerEdge - div) - grt/2
-            ThisBlockDepth = rndd()*settings['dv']+settings['d']
-            row.BlocksEdge.append([x,row.z,w,row.h,ThisBlockDepth,rightOffsets])
-            continue
-
-        #program should only get here if there are more than two blocks in the row, and no wedge blocks
-
-        #make Left edge block
-        #set the grout
-        grt = (settings['g'] + rndc()*settings['gv'])/r1
-        #set the x position and width for the left block
-        widOptions = [settings['w'], bevelL + settings['wm'], leftOpening.ts]
-        baseWid = max(widOptions)
-        w = (rndd()*settings['wv']+baseWid+row.EdgeOffset)
-        widOptions[0] = settings['wm']
-        widOptions[2] = w
-        w = max(widOptions) / r1 - grt
-        x = w/2 + LNerEdge + grt/2
-        BlockRowL = x + w/2
-        ThisBlockDepth = rndd()*settings['dv']+settings['d']
-        row.BlocksEdge.append([x,row.z,w,row.h,ThisBlockDepth,leftOffsets])
-
-        #make Right edge block
-        #set the grout
-        grt = (settings['g'] + rndc()*settings['gv'])/r1
-        #set the x position and width for the left block
-        widOptions = [settings['w'], bevelR + settings['wm'], rightOpening.ts]
-        baseWid = max(widOptions)
-        w = (rndd()*settings['wv']+baseWid+row.EdgeOffset)
-        widOptions[0] = settings['wm']
-        widOptions[2] = w
-        w = max(widOptions) / r1 - grt
-        x = RNerEdge - w/2 - grt/2
-        BlockRowR = x - w/2
-        ThisBlockDepth = rndd()*settings['dv']+settings['d']
-        row.BlocksEdge.append([x,row.z,w,row.h,ThisBlockDepth,rightOffsets])
-
-        row.RowSegments.append([BlockRowL,BlockRowR])
-    return None
-
-
-def plan(Thesketch, oldrows = 0):
-    __doc__ = """\
-    The 'plan' function takes the data generated by the sketch function and the global settings
-    and creates a list of blocks.
-    It passes out a list of row heights, edge positions, edge blocks, and rows of blocks.
-    """
-    # if we were passed a list of rows already, use those; else make a list.
-    if oldrows: rows = oldrows
-    else:
-        #rows holds the important information common to all rows
-        #rows = [list of row objects]
-        rows = []
-
-        #splits are places where we NEED a row division, to accomidate openings
-        #add a split for the bottom row
-        splits = [dims['b']+settings['hb']]
-
-        #add a split for each critical point on each opening
-        for hole in Thesketch: splits += hole.crits()
-
-        #and, a split for the top row
-        splits.append(dims['t']-settings['ht'])
-        splits.sort()
-
-        #divs are the normal old row divisions, add them between the top and bottom split
-        divs = fill(splits[0],splits[-1],settings['h'],settings['hm']+settings['g'],settings['hv'])[1:-1]
-
-        #remove the divisions that are too close to the splits, so we don't get tiny thin rows
-        for i in range(len(divs)-1,-1,-1):
-            for j in range(len(splits)):
-                diff = abs(divs[i] - splits[j])
-                #(settings['hm']+settings['g']) is the old minimum value
-                if diff < (settings['h']-settings['hv']+settings['g']):
-                    del(divs[i])
-                    break
-
-        #now merge the divs and splits lists
-        divs += splits
-
-        #add bottom and/or top points, if bottom and/or top row heights are more than zero
-        if settings['hb']>0: divs.insert(0,dims['b'])
-        if settings['ht']>0: divs.append(dims['t'])
-
-        divs.sort()
-
-        #trim the rows to the bottom and top of the wall
-        if divs[0] < dims['b']: divs[:1] = []
-        if divs[-1] > dims['t']: divs[-1:] = []
-
-        #now, make the data for each row
-        #rows = [[center height,row height,edge offset],[etc.]]
-
-        divCount = len(divs)-1 # number of divs to check
-        divCheck = 0 # current div entry
-
-        while divCheck < divCount:
-            RowZ = (divs[divCheck]+divs[divCheck+1])/2
-            RowHeight = divs[divCheck+1]-divs[divCheck]-settings['g']+rndc()*settings['rwhl']*settings['gv']
-            EdgeOffset = settings['eoff']*(fmod(divCheck,2)-0.5)+settings['eoffv']*rndd()
-
-            # if row height is too shallow: delete next div entry, decrement total, and recheck current entry.
-            if RowHeight < settings['hm']:
-                del(divs[divCheck+1])
-                divCount -= 1 # Adjust count for removed div entry.
-                continue
-
-            rows.append(rowOb(RowZ, RowHeight, EdgeOffset))
-
-            divCheck += 1 # on to next div entry
-
-    #set up a special opening object to handle the edges of the wall
-    x = (dims['s'] + dims['e'])/2
-    z = (dims['t'] + dims['b'])/2
-    w = (dims['e'] - dims['s'])
-    h = (dims['t'] - dims['b'])
-    WallBoundaries = OpeningInv(x,z,w,h)
-
-    #Go over each row in the list, set up edge blocks and block sections
-    for rownum in range(len(rows)):
-        rowProcessing(rows[rownum], Thesketch, WallBoundaries)
-
-    #now return the things everyone needs
-    #return [rows,edgeBlocks,blockRows,Asketch]
-    return [rows,Thesketch]
-
-
-def archGeneration(hole, vlist, flist, sideSign):
-    __doc__ = """\
-    Makes arches for the top and bottom, depending on sideSign
-    example, Lower arch:
-    archGeneration(hole, vlist, flist, -1)
-    example, Upper arch:
-    archGeneration(hole, vlist, flist, 1)
-    hole is the opening object that the arch is for
-    add the verticies to vlist
-    add the faces to flist
-    sideSign is + or - 1, for the top or bottom arch. Other values may cause errors.
-    """
-
-    # working arrays for vectors and faces
-    avlist = []
-    aflist = []
-
-    # Top (1) or bottom (-1)
-    if sideSign == -1:
-        r = hole.rl #radius of the arch
-        rt = hole.rtl #thickness of the arch (stone height)
-        v = hole.vl #height of the arch
-        c = hole.cl
-    else:
-        r = hole.r #radius of the arch
-        rt = hole.rt #thickness of the arch (stone height)
-        v = hole.v #height of the arch
-        c = hole.c
-
-    ra = r + rt/2 #average radius of the arch
-    x = hole.x
-    w = hole.w
-    h = hole.h
-    z = hole.z
-    bev = hole.b
-    sideSignInv = -sideSign
-
-    if v > w/2: #two arcs, to make a pointed arch
-        # positioning
-        zpos = z + (h/2)*sideSign
-        xoffset = r - w/2
-        #left side top, right side bottom
-        #angles reference straight up, and are in radians
-        bevRad = r + bev
-        bevHt = sqrt(bevRad**2 - (bevRad - (w/2 + bev))**2)
-        midHalfAngle = atan(v/(r-w/2))
-        midHalfAngleBevel = atan(bevHt/(r-w/2))
-        bevelAngle = midHalfAngle - midHalfAngleBevel
-        anglebeg = (PI/2)*(sideSignInv)
-        angleend = (PI/2)*(sideSignInv) + midHalfAngle
-
-        avlist,aflist = arch(ra,rt,(xoffset)*(sideSign),zpos,anglebeg,angleend,bev,bevelAngle,len(vlist))
-
-        for i,vert in enumerate(avlist): avlist[i] = [vert[0]+hole.x,vert[1],vert[2]]
-        vlist += avlist
-        flist += aflist
-
-        #right side top, left side bottom
-
-        #angles reference straight up, and are in radians
-        anglebeg = (PI/2)*(sideSign) - midHalfAngle
-        angleend = (PI/2)*(sideSign)
-
-        avlist,aflist = arch(ra,rt,(xoffset)*(sideSignInv),zpos,anglebeg,angleend,bev,bevelAngle,len(vlist))
-
-        for i,vert in enumerate(avlist): avlist[i] = [vert[0]+hole.x,vert[1],vert[2]]
-
-        vlist += avlist
-        flist += aflist
-
-        #keystone
-        Dpth = settings['d']+rndc()*settings['dv']
-        Grout = settings['g'] + rndc()*settings['gv']
-        angleBevel = (PI/2)*(sideSign) - midHalfAngle
-        Wdth = (rt - Grout - bev) * 2 * sin(angleBevel) * sideSign #note, sin may be negative
-        MidZ = ((sideSign)*(bevHt + h/2.0) + z) + (rt - Grout - bev) * cos(angleBevel) #note, cos may come out negative too
-        nearCorner = sideSign*(MidZ - z) - v - h/2
-
-        if sideSign == 1:
-            TopHt = hole.top() - MidZ - Grout
-            BtmHt = nearCorner
-        else:
-            BtmHt =  - (hole.btm() - MidZ) - Grout
-            TopHt = nearCorner
-
-        # set the amout to bevel the keystone
-        keystoneBevel = (bevHt - v)*sideSign
-        if Wdth >= settings['hm']:
-            avlist,aflist = MakeAKeystone(x, Wdth, MidZ, TopHt, BtmHt, Dpth, keystoneBevel, len(vlist))
-
-            if radialized:
-                for i,vert in enumerate(avlist):
-                    if slope: r1 = dims['t']*sin(vert[2]*PI/(dims['t']*2))
-                    else: r1 = vert[2]
-                    avlist[i] = [((vert[0]-hole.x)/r1)+hole.x,vert[1],vert[2]]
-
-            vlist += avlist
-            flist += aflist
-# remove "debug note" once bevel is finalized.
-        else: print("keystone was too narrow - " + str(Wdth))
-
-    else: # only one arc - curve not peak.
-#bottom (sideSign -1) arch has poorly sized blocks...
-
-        zpos = z + (sideSign * (h/2 + v - r)) # single arc positioning
-
-        #angles reference straight up, and are in radians
-        if sideSign == -1: angleOffset = PI
-        else: angleOffset = 0.0
-
-        if v < w/2:
-            halfangle = atan(w/(2*(r-v)))
-
-            anglebeg = angleOffset - halfangle
-            angleend = angleOffset + halfangle
-        else:
-            anglebeg = angleOffset - PI/2
-            angleend = angleOffset + PI/2
-
-        avlist,aflist = arch(ra,rt,0,zpos,anglebeg,angleend,bev,0.0,len(vlist))
-
-        for i,vert in enumerate(avlist): avlist[i] = [vert[0]+x,vert[1],vert[2]]
-
-        vlist += avlist
-        flist += aflist
-
-        #Make the Side Stones
-        grt = (settings['g'] + rndc()*settings['gv'])
-        width = sqrt(rt**2 - c**2) - grt
-
-        if c > settings['hm'] + grt and c < width + grt:
-            if radialized: subdivision = settings['sdv'] * (zpos + (h/2)*sideSign)
-            else: subdivision = settings['sdv']
-
-            #set the height of the block, it should be as high as the max corner position, minus grout
-            height = c - grt*(0.5 + c/(width + grt))
-
-            #the vertical offset for the short side of the block
-            voff = sideSign * (settings['hm'] - height)
-            xstart = w/2
-            zstart = z + sideSign * (h/2 + grt/2)
-            woffset = width*(settings['hm'] + grt/2)/(c - grt/2)
-            depth = rndd()*settings['dv']+settings['d']
-
-            if sideSign == 1:
-                offsets = [[0]*3]*6 + [[0]*2 + [voff]]*2
-                topSide = zstart+height
-                btmSide = zstart
-            else:
-                offsets = [[0]*3]*4 + [[0]*2 + [voff]]*2 + [[0]*3]*2
-                topSide = zstart
-                btmSide = zstart-height
-            # Do some stuff to incorporate bev here
-            bevelBlockOffsets(offsets, bev, -1)
-
-            avlist,aflist = MakeABlock([x-xstart-width, x-xstart- woffset, btmSide, topSide, -depth/2, depth/2], subdivision, len(vlist), Offsets=offsets, xBevScl=1)
-
-# top didn't use radialized in prev version; just noting for clarity - may need to revise for "sideSign == 1"
-            if radialized:
-                for i,vert in enumerate(avlist): avlist[i] = [((vert[0]-x)/vert[2])+x,vert[1],vert[2]]
-
-            vlist += avlist
-            flist += aflist
-
-# keep sizing same - neat arches = master masons :)
-#           grt = (settings['g'] + rndc()*settings['gv'])
-#           height = c - grt*(0.5 + c/(width + grt))
-# if grout varies may as well change width too... width = sqrt(rt**2 - c**2) - grt
-#           voff = sideSign * (settings['hm'] - height)
-#           woffset = width*(settings['hm'] + grt/2)/(c - grt/2)
-
-            if sideSign == 1:
-                offsets = [[0]*3]*2 + [[0]*2 + [voff]]*2 + [[0]*3]*4
-                topSide = zstart+height
-                btmSide = zstart
-            else:
-                offsets = [[0]*2 + [voff]]*2 + [[0]*3]*6
-                topSide = zstart
-                btmSide = zstart-height
-            # Do some stuff to incorporate bev here
-            bevelBlockOffsets(offsets, bev, 1)
-
-            avlist,aflist = MakeABlock([x+xstart+woffset, x+xstart+width, btmSide, topSide, -depth/2, depth/2], subdivision, len(vlist), Offsets=offsets, xBevScl=1)
-
-# top didn't use radialized in prev version; just noting for clarity - may need to revise for "sideSign == 1"
-            if radialized:
-                for i,vert in enumerate(avlist): avlist[i] = [((vert[0]-x)/vert[2])+x,vert[1],vert[2]]
-
-            vlist += avlist
-            flist += aflist
-    return None
-
-
-def build(Aplan):
-    __doc__ = """\
-    Build creates the geometry for the wall, based on the
-    "Aplan" object from the "plan" function.  If physics is
-    enabled, then it make a number of individual blocks with
-    physics interaction enabled.  Otherwise it creates
-    geometry for the blocks, arches, etc. of the wall.
-    """
-
-    vlist = []
-    flist = []
-    rows = Aplan[0]
-
-#dead code...
-    #Physics setup is horribly broken.  Revisit when new API is in place.
-    '''if False: #settings['physics']:
-        geom = MakeABlock([-0.5,0.5,-0.5,0.5,-0.5,0.5], 3, 0, None,[], 3*settings['b']/(settings['w'] + settings['h'] + settings['d']))
-        blockmesh = Blender.Mesh.New('block')
-        vlist += geom[0]
-        flist += geom[1]
-        blockmesh.verts.extend(vlist)
-        blockmesh.faces.extend(flist)
-
-        for block in Aplan[1]:
-            x,z,w,h,d = block[:5]
-            block = scn.objects.new(blockmesh, 'block')
-            block.loc = [x, 0, z]
-            block.size = [w,d,h]
-            block.rbFlags = Blender.Object.RBFlags['BOUNDS'] | Blender.Object.RBFlags['ACTOR'] | Blender.Object.RBFlags['DYNAMIC'] | Blender.Object.RBFlags['RIGIDBODY']
-            block.rbShapeBoundType = Blender.Object.RBShapes['BOX']
-
-
-        for row in Aplan[2]:#row=[xstart,xend,z,h]
-            #currently, radial geometry is disabled for physics blocks setup
-            if radialized:
-                if slope: r1 = dims['t']*sin(row[2]*PI/(dims['t']*2))
-                else: r1 = row[2]
-
-            else: r1 = 1
-
-            divs = fill(row[0], row[1], settings['w'], settings['wm'], settings['wv'])
-            for i in range(len(divs)-1):
-                block = scn.objects.new(blockmesh, 'block')
-                block.loc = [(divs[i]+divs[i+1])/2, 0, row[2]]
-                block.size = [(divs[i + 1] - divs[i]) - settings['g'], (settings['d'] + rndd()*settings['dv'])*(1-settings['t']*((row[3]-dims['b'])/(dims['t'] - dims['b']))), row[3]]
-                block.rbFlags = Blender.Object.RBFlags['BOUNDS'] | Blender.Object.RBFlags['ACTOR'] | Blender.Object.RBFlags['DYNAMIC'] | Blender.Object.RBFlags['RIGIDBODY']
-                block.rbShapeBoundType = Blender.Object.RBShapes['BOX']
-
-        return None'''
-#end dead code...
-
-    # all the edge blocks, redacted
-    #AllBlocks = [[x,z,w,h,d,[corner offset matrix]],[etc.]]
-
-    #loop through each row, adding the normal old blocks
-    for rowidx in range(len(rows)):#row = row object
-        rows[rowidx].FillBlocks()
-
-    AllBlocks = []
-
-    #  If the wall is set to merge blocks, check all the blocks to see if you can merge any
-#seems to only merge vertical, should do horizontal too
-    if bigBlock:
-        for rowidx in range(len(rows)-1):
-            if radialized:
-                if slope: r1 = dims['t']*sin(abs(rows[rowidx].z)*PI/(dims['t']*2))
-                else: r1 = abs(rows[rowidx].z)
-            else: r1 = 1
-
-            Tollerance = settings['g']/r1
-            idxThis = len(rows[rowidx].BlocksNorm[:]) - 1
-            idxThat = len(rows[rowidx+1].BlocksNorm[:]) - 1
-
-            while True:
-                # end loop when either array idx wraps
-                if idxThis < 0 or idxThat < 0: break
-
-                blockThis = rows[rowidx].BlocksNorm[idxThis]
-                blockThat = rows[rowidx+1].BlocksNorm[idxThat]
-
-#seems to only merge vertical, should do horizontal too...
-                cx, cz, cw, ch, cd = blockThis[:5]
-                ox, oz, ow, oh, od = blockThat[:5]
-
-                if (abs(cw - ow) < Tollerance) and (abs(cx - ox) < Tollerance) :
-                    if cw > ow: BlockW = ow
-                    else: BlockW = cw
-
-                    AllBlocks.append([(cx+ox)/2,(cz+oz+(oh-ch)/2)/2,BlockW,abs(cz-oz)+(ch+oh)/2,(cd+od)/2,None])
-
-                    rows[rowidx].BlocksNorm.pop(idxThis)
-                    rows[rowidx+1].BlocksNorm.pop(idxThat)
-                    idxThis -= 1
-                    idxThat -= 1
-
-                elif cx > ox: idxThis -= 1
-                else: idxThat -= 1
-
-    #
-    #
-    # Add blocks to create a "shelf/platform".
-    # Does not account for openings (crosses gaps - which is a good thing)
-    if shelfExt:
-        SetGrtOff = settings['g']/2 # half grout for block size modifier
-
-        # Use wall block settings for shelf
-        SetBW = settings['w']
-        SetBWVar = settings['wv']
-        SetBWMin = settings['wm']
-        SetBH = settings['h']
-
-        # Shelf area settings
-        ShelfLft = shelfSpecs['x']
-        ShelfBtm = shelfSpecs['z']
-        ShelfEnd = ShelfLft + shelfSpecs['w']
-        ShelfTop = ShelfBtm + shelfSpecs['h']
-        ShelfThk = shelfSpecs['d'] * 2 # use double-depth due to offsets to position at cursor.
-
-        # Use "corners" to adjust position so not centered on depth.
-        # Facing shelf, at cursor (middle of wall blocks) - this way no gaps between platform and wall face due to wall block depth.
-        wallDepth = settings['d']/2 # offset by wall depth so step depth matches UI setting :)
-        if shelfBack: # place blocks on backside of wall
-            ShelfOffsets = [[0,ShelfThk/2,0],[0,wallDepth,0],[0,ShelfThk/2,0],[0,wallDepth,0],[0,ShelfThk/2,0],[0,wallDepth,0],[0,ShelfThk/2,0],[0,wallDepth,0]]
-        else:
-            ShelfOffsets = [[0,-wallDepth,0],[0,-ShelfThk/2,0],[0,-wallDepth,0],[0,-ShelfThk/2,0],[0,-wallDepth,0],[0,-ShelfThk/2,0],[0,-wallDepth,0],[0,-ShelfThk/2,0]]
-
-    # Add blocks for each "shelf row" in area
-        while ShelfBtm < ShelfTop:
-
-            # Make blocks for each row - based on rowOb::fillblocks
-            # Does not vary grout.
-            divs = fill(ShelfLft, ShelfEnd, SetBW, SetBWMin, SetBWVar)
-
-            #loop through the row divisions, adding blocks for each one
-            for i in range(len(divs)-1):
-                ThisBlockx = (divs[i]+divs[i+1])/2
-                ThisBlockw = divs[i+1]-divs[i]-SetGrtOff
-
-                AllBlocks.append([ThisBlockx, ShelfBtm, ThisBlockw, SetBH, ShelfThk, ShelfOffsets])
-
-            ShelfBtm += SetBH + SetGrtOff # moving up to next row...
-    #
-    #
-    # Add blocks to create "steps".
-    # Does not account for openings (crosses gaps - which is a good thing)
-    if stepMod:
-        SetGrtOff = settings['g']/2 # half grout for block size modifier
-
-        # Vary block width by wall block variations.
-        SetWidVar = settings['wv']
-        SetWidMin = settings['wm']
-
-        StepXMod = stepSpecs['t'] # width of step/tread, also sets basic block size.
-        StepZMod = stepSpecs['v']
-
-        StepLft = stepSpecs['x']
-        StepRt = stepSpecs['x'] + stepSpecs['w']
-        StepBtm = stepSpecs['z'] + StepZMod/2 # Start offset for centered blocks
-        StepWide = stepSpecs['w']
-        StepTop = StepBtm + stepSpecs['h']
-        StepThk = stepSpecs['d'] * 2 # use double-depth due to offsets to position at cursor.
-
-        # Use "corners" to adjust steps so not centered on depth.
-        # Facing steps, at cursor (middle of wall blocks) - this way no gaps between steps and wall face due to wall block depth.
-        # Also, will work fine as stand-alone if not used with wall (try block depth 0 and see what happens).
-        wallDepth = settings['d']/2 # offset by wall depth so step depth matches UI setting :)
-        if stepBack: # place blocks on backside of wall
-            StepOffsets = [[0,StepThk/2,0],[0,wallDepth,0],[0,StepThk/2,0],[0,wallDepth,0],[0,StepThk/2,0],[0,wallDepth,0],[0,StepThk/2,0],[0,wallDepth,0]]
-        else:
-            StepOffsets = [[0,-wallDepth,0],[0,-StepThk/2,0],[0,-wallDepth,0],[0,-StepThk/2,0],[0,-wallDepth,0],[0,-StepThk/2,0],[0,-wallDepth,0],[0,-StepThk/2,0]]
-
-    # Add steps for each "step row" in area (neg width is interesting but prevented)
-        while StepBtm < StepTop and StepWide > 0:
-
-            # Make blocks for each step row - based on rowOb::fillblocks
-            # Does not vary grout.
-
-            if stepOnly: # "cantilevered steps"
-                if stepLeft:
-                    stepStart = StepRt - StepXMod
-                else:
-                    stepStart = StepLft
-
-                AllBlocks.append([stepStart, StepBtm, StepXMod, StepZMod, StepThk, StepOffsets])
-            else:
-                divs = fill(StepLft, StepRt, StepXMod, SetWidMin, SetWidVar)
-
-                #loop through the row divisions, adding blocks for each one
-                for i in range(len(divs)-1):
-                    ThisBlockx = (divs[i]+divs[i+1])/2
-                    ThisBlockw = divs[i+1]-divs[i]-SetGrtOff
-
-                    AllBlocks.append([ThisBlockx, StepBtm, ThisBlockw, StepZMod, StepThk, StepOffsets])
-
-            StepBtm += StepZMod + SetGrtOff # moving up to next row...
-            StepWide -= StepXMod # reduce step width
-
-            # adjust side limit depending on direction of steps
-            if stepLeft:
-                StepRt -= StepXMod # move in from right
-            else:
-                StepLft += StepXMod # move in from left
-
-
-    #Copy all the blocks out of the rows
-    for row in rows:
-        AllBlocks += row.BlocksEdge
-        AllBlocks += row.BlocksNorm
-
-    #This loop makes individual blocks for each block specified in the plan
-    for block in AllBlocks:
-        x,z,w,h,d,corners = block
-        if radialized:
-            if slope: r1 = dims['t']*sin(z*PI/(dims['t']*2))
-            else: r1 = z
-        else: r1 = 1
-
-        geom = MakeABlock([x-w/2, x+w/2, z-h/2, z+h/2, -d/2, d/2], settings['sdv'], len(vlist), corners, None, settings['b']+rndd()*settings['bv'], r1)
-        vlist += geom[0]
-        flist += geom[1]
-
-
-    # This loop makes Arches for every opening specified in the plan.
-    for hole in Aplan[1]:
-        # lower arch stones
-        if hole.vl > 0 and hole.rtl > (settings['g'] + settings['hm']):#make lower arch blocks
-            archGeneration(hole, vlist, flist, -1)
-
-        #top arch stones
-        if hole.v > 0 and hole.rt > (settings['g'] + settings['hm']):#make upper arch blocks
-            archGeneration(hole, vlist, flist, 1)
-    #
-
-    #Warp all the points for domed stonework
-    if slope:
-        for i,vert in enumerate(vlist):
-            vlist[i] = [vert[0],(dims['t']+vert[1])*cos(vert[2]*PI/(2*dims['t'])),(dims['t']+vert[1])*sin(vert[2]*PI/(2*dims['t']))]
-
-    #Warp all the points for radial stonework
-    if radialized:
-        for i,vert in enumerate(vlist):
-            vlist[i] = [vert[2]*cos(vert[0]),vert[2]*sin(vert[0]),vert[1]]
-
-    return vlist, flist
-
-
-#The main function
-def createWall(radial, curve, openings, mergeBlox, shelf, shelfSide,
-        steps, stepDir, stepBare, stepSide):
-    __doc__ = """\
-    Call all the funcitons you need to make a wall, return the verts and faces.
-    """
-    global radialized
-    global slope
-    global openingSpecs
-    global bigBlock
-    global shelfExt
-    global stepMod
-    global stepLeft
-    global shelfBack
-    global stepOnly
-    global stepBack
-
-    # set all the working variables from passed parameters
-
-    radialized = radial
-    slope = curve
-    openingSpecs = openings
-    bigBlock = mergeBlox
-    shelfExt = shelf
-    stepMod = steps
-    stepLeft = stepDir
-    shelfBack = shelfSide
-    stepOnly = stepBare
-    stepBack = stepSide
-
-    asketch = sketch()
-    aplan = plan(asketch, 0)
-
-    return build(aplan)
-
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/Wallfactory.py b/release/scripts/addons_contrib/add_mesh_building_objects/Wallfactory.py
deleted file mode 100644
index 8c7fb93..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/Wallfactory.py
+++ /dev/null
@@ -1,647 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you may redistribute it, and/or
-# modify it, under the terms of the GNU General Public License
-# as published by the Free Software Foundation - either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, write to:
-#
-#	the Free Software Foundation Inc.
-#	51 Franklin Street, Fifth Floor
-#	Boston, MA 02110-1301, USA
-#
-# or go online at: http://www.gnu.org/licenses/ to view license options.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-#
-# This module contains the UI definition, display, and processing (create mesh)
-# functions.
-#
-# The routines to generate the vertices for the wall are found in the "Blocks" module.
-#
-
-
-import bpy
-import mathutils
-from bpy.props import *
-from add_mesh_building_objects.Blocks import *
-#from add_mesh_walls.preset_utils import *
-
-
-#
-class add_mesh_wallb(bpy.types.Operator):
-    """Add a wall mesh"""
-    bl_idname = "mesh.wall_add"
-    bl_label = "Add A Masonry Wall"
-    bl_options = {'REGISTER', 'UNDO'} # removes object, does not reset to "last" modification.
-    bl_description = "adds a block wall"
-
-    # UI items - API for properties - User accessable variables... 
-# not all options are via UI, and some operations just don't work yet.
-
-    # only create object when True
-    # False allows modifying several parameters without creating object
-    ConstructTog = BoolProperty(name="Construct",
-                                description="Generate the object",
-                                default = True)
-
-# need to modify so radial makes a tower (normal); want "flat" setting to make disk (alternate)
-    # make the wall circular - if not sloped it's a flat disc
-    RadialTog = BoolProperty(name="Radial",
-                             description="Make masonry radial",
-                             default = False)
-
-    # curve the wall - if radial creates dome.
-    SlopeTog = BoolProperty(name="Curved",
-                            description="Make masonry sloped, or curved",
-                            default = False)
-
-#need to review defaults and limits for all of these UI objects.
-
-    # wall area/size
-    WallStart = FloatProperty(name="Start",
-                              description="Left side, or start angle",
-                              default=-10.0, min=-100, max=100.0)
-    WallEnd = FloatProperty(name="End",
-                            description="Right side, or end angle",
-                            default=10.0, min=0.0, max=100.0)
-    WallBottom = FloatProperty(name="Bottom",
-                               description="Lower height or radius",
-                               default=0.0, min=-100, max=100)
-    WallTop = FloatProperty(name="Top",
-                            description="Upper height or radius",
-                            default=15.0, min=0.0, max=100.0)
-    EdgeOffset = FloatProperty(name="Edging",
-                               description="Block staggering on wall sides",
-                               default=0.6, min=0.0, max=100.0)
-
-    # block sizing
-    Width = FloatProperty(name="Width",
-                          description="Average width of each block",
-                          default=1.5, min=0.01, max=100.0)
-    WidthVariance = FloatProperty(name="Variance",
-                                  description="Random variance of block width",
-                                  default=0.5, min=0.0, max=100.0)
-    WidthMinimum = FloatProperty(name="Minimum",
-                                 description="Absolute minimum block width",
-                                 default=0.5, min=0.01, max=100.0)
-    Height = FloatProperty(name="Height",
-                           description="Average Height of each block",
-                           default=0.7, min=0.01, max=100.0)
-    HeightVariance = FloatProperty(name="Variance",
-                                   description="Random variance of block Height",
-                                   default=0.3, min=0.0, max=100.0)
-    HeightMinimum = FloatProperty(name="Minimum",
-                                  description="Absolute minimum block Height",
-                                  default=0.25, min=0.01, max=100.0)
-    Depth = FloatProperty(name="Depth",
-                          description="Average Depth of each block",
-                          default=2.0, min=0.01, max=100.0)
-    DepthVariance = FloatProperty(name="Variance",
-                                  description="Random variance of block Depth",
-                                  default=0.1, min=0.0, max=100.0)
-    DepthMinimum = FloatProperty(name="Minimum",
-                                 description="Absolute minimum block Depth",
-                                 default=1.0, min=0.01, max=100.0)
-    MergeBlock = BoolProperty(name="Merge Blocks",
-                              description="Make big blocks (merge closely adjoining blocks)",
-                              default = False)
-
-    # edging for blocks
-    Grout = FloatProperty(name="Thickness",
-                          description="Distance between blocks",
-                          default=0.1, min=-10.0, max=10.0)
-    GroutVariance = FloatProperty(name="Variance",
-                                  description="Random variance of block Grout",
-                                  default=0.03, min=0.0, max=100.0)
-    GroutDepth = FloatProperty(name="Depth",
-                          description="Grout Depth from the face of the blocks",
-                          default=0.1, min=0.0001, max=10.0)
-    GroutDepthVariance = FloatProperty(name="Variance",
-                                  description="Random variance of block Grout Depth",
-                                  default=0.03, min=0.0, max=100.0)
-    GroutEdge = BoolProperty(name="Edging",
-                             description="Grout perimiter",
-                             default = False)
-
-    #properties for openings
-    Opening1Tog = BoolProperty(name="Opening(s)",description="Make windows or doors", default = True)
-    Opening1Width = FloatProperty(name="Width",
-                                  description="The Width of opening 1",
-                                  default=2.5, min=0.01, max=100.0)
-    Opening1Height = FloatProperty(name="Height",
-                                   description="The Height of opening 1",
-                                   default=3.5, min=0.01, max=100.0)
-    Opening1X = FloatProperty(name="Indent",
-                              description="The x position or spacing of opening 1",
-                              default=5.0, min=-100, max=100.0)
-    Opening1Z = FloatProperty(name="Bottom",
-                              description="The z position of opening 1",
-                              default=5.0, min=-100, max=100.0)
-    Opening1Repeat = BoolProperty(name="Repeat",
-                                  description="make multiple openings, with spacing X1",
-                                  default=False)
-    Opening1TopArchTog = BoolProperty(name="Top Arch",
-                                      description="Add an arch to the top of opening 1",
-                                      default=True)
-    Opening1TopArch = FloatProperty(name="Curve",
-                                    description="Height of the arch on the top of the opening",
-                                    default=2.5, min=0.001, max=100.0)
-    Opening1TopArchThickness = FloatProperty(name="Thickness",
-                                             description="Thickness of the arch on the top of the opening",
-                                             default=0.75, min=0.001, max=100.0)
-    Opening1BtmArchTog = BoolProperty(name="Bottom Arch",
-                                      description="Add an arch to the bottom of opening 1",
-                                      default=False)
-    Opening1BtmArch = FloatProperty(name="Curve",
-                                    description="Height of the arch on the bottom of the opening",
-                                    default=1.0, min=0.01, max=100.0)
-    Opening1BtmArchThickness = FloatProperty(name="Thickness",
-                                             description="Thickness of the arch on the bottom of the opening",
-                                             default=0.5, min=0.01, max=100.0)
-    Opening1Bevel = FloatProperty(name="Bevel",
-                                             description="Angle block face",
-                                             default=0.25, min=-10.0, max=10.0)
-
-
-    # openings on top of wall.
-    CrenelTog = BoolProperty(name="Crenels",
-                             description="Make openings along top of wall",
-                             default = False)
-    CrenelXP = FloatProperty(name="Width %",
-                             description="Gap width in wall based % of wall width",
-                             default=0.25, min=0.10, max=1.0)
-    CrenelZP = FloatProperty(name="Height %",
-                             description="Crenel Height as % of wall height",
-                             default=0.10, min=0.10, max=1.0)
-
-
-    # narrow openings in wall.
-#need to prevent overlap with arch openings - though inversion is an interesting effect.
-    SlotTog = BoolProperty(name="Slots",
-                           description="Make narrow openings in wall",
-                           default = False)
-    SlotRpt = BoolProperty(name="Repeat",
-                           description="Repeat slots along wall",
-                           default = False)
-    SlotWdg = BoolProperty(name="Wedged (n/a)",
-                           description="Bevel edges of slots",
-                           default = False)
-    SlotX = FloatProperty(name="Indent",
-                          description="The x position or spacing of slots",
-                          default=0.0, min=-100, max=100.0)
-    SlotGap = FloatProperty(name="Opening",
-                            description="The opening size of slots",
-                            default=0.5, min=0.10, max=100.0)
-    SlotV = BoolProperty(name="Vertical",
-                         description="Vertical slots",
-                         default = True)
-    SlotVH = FloatProperty(name="Height",
-                           description="Height of vertical slot",
-                           default=3.5, min=0.10, max=100.0)
-    SlotVBtm = FloatProperty(name="Bottom",
-                             description="Z position for slot",
-                             default=5.00, min=-100.0, max=100.0)
-    SlotH = BoolProperty(name="Horizontal",
-                         description="Horizontal slots",
-                         default = False)
-    SlotHW = FloatProperty(name="Width",
-                           description="Width of horizontal slot",
-                           default=2.5, min=0.10, max=100.0)
-#this should offset from VBtm... maybe make a % like crenels?
-    SlotHBtm = FloatProperty(name="Bottom",
-                             description="Z position for horizontal slot",
-                             default=5.50, min=-100.0, max=100.0)
-
-
-    #properties for shelf (extend blocks in area)
-    ShelfTog = BoolProperty(name="Shelf",description="Add blocks in area by depth to make shelf/platform", default = False)
-    ShelfX = FloatProperty(name="Left",
-                              description="The x position of Shelf",
-                              default=-5.00, min=-100, max=100.0)
-    ShelfZ = FloatProperty(name="Bottom",
-                              description="The z position of Shelf",
-                              default=10.0, min=-100, max=100.0)
-    ShelfH = FloatProperty(name="Height",
-                                   description="The Height of Shelf area",
-                                   default=1.0, min=0.01, max=100.0)
-    ShelfW = FloatProperty(name="Width",
-                                  description="The Width of shelf area",
-                                  default=5.0, min=0.01, max=100.0)
-    ShelfD = FloatProperty(name="Depth",
-                          description="Depth of each block for shelf (from cursor + 1/2 wall depth)",
-                          default=2.0, min=0.01, max=100.0)
-    ShelfBack = BoolProperty(name="Backside",description="Shelf on backside of wall", default = False)
-
-
-    #properties for steps (extend blocks in area, progressive width)
-    StepTog = BoolProperty(name="Steps",description="Add blocks in area by depth with progressive width to make steps", default = False)
-    StepX = FloatProperty(name="Left",
-                              description="The x position of steps",
-                              default=-9.00, min=-100, max=100.0)
-    StepZ = FloatProperty(name="Bottom",
-                              description="The z position of steps",
-                              default=0.0, min=-100, max=100.0)
-    StepH = FloatProperty(name="Height",
-                                   description="The Height of step area",
-                                   default=10.0, min=0.01, max=100.0)
-    StepW = FloatProperty(name="Width",
-                                  description="The Width of step area",
-                                  default=8.0, min=0.01, max=100.0)
-    StepD = FloatProperty(name="Depth",
-                          description="Depth of each block for steps (from cursor + 1/2 wall depth)",
-                          default=1.0, min=0.01, max=100.0)
-    StepV = FloatProperty(name="Riser",
-                                  description="Height of each step",
-                                  default=0.70, min=0.01, max=100.0)
-    StepT = FloatProperty(name="Tread",
-                          description="Width of each step",
-                          default=1.0, min=0.01, max=100.0)
-    StepLeft = BoolProperty(name="High Left",description="Height left; else Height right", default = False)
-    StepOnly = BoolProperty(name="No Blocks",description="Steps only, no supporting blocks", default = False)
-    StepBack = BoolProperty(name="Backside",description="Steps on backside of wall", default = False)
-
-##
-##
-#####
-# Show the UI - expose the properties.
-#####
-##
-##
-    # Display the toolbox options
-
-    def draw(self, context):
-
-        layout = self.layout
-
-        box = layout.box()
-        box.prop(self, 'ConstructTog')
-
-# Wall area (size/position)
-        box = layout.box()
-        box.label(text='Wall Size (area)')
-        box.prop(self, 'WallStart')
-        box.prop(self, 'WallEnd')
-        box.prop(self, 'WallBottom')
-        box.prop(self, 'WallTop')
-        box.prop(self, 'EdgeOffset')
-
-# Wall block sizing
-        box = layout.box()
-        box.label(text='Block Sizing')
-        box.prop(self, 'MergeBlock')
-#add checkbox for "fixed" sizing (ignore variance) a.k.a. bricks.
-        box.prop(self, 'Width')
-        box.prop(self, 'WidthVariance')
-        box.prop(self, 'WidthMinimum')
-        box.prop(self, 'Height')
-        box.prop(self, 'HeightVariance')
-        box.prop(self, 'HeightMinimum')
-        box.prop(self, 'Depth')
-        box.prop(self, 'DepthVariance')
-        box.prop(self, 'DepthMinimum')
-
-# grout settings
-        box = layout.box()
-        bl_label = "Grout"
-        box.label(text='Grout')
-        box.prop(self, 'Grout')
-        box.prop(self, 'GroutVariance')
-        box.prop(self, 'GroutDepth')
-        box.prop(self, 'GroutDepthVariance')
-#		box.prop(self, 'GroutEdge')
-
-# Wall shape modifiers
-        box = layout.box()
-        box.label(text='Wall Shape')
-        box.prop(self, 'RadialTog')
-        box.prop(self, 'SlopeTog')
-
-# Openings (doors, windows; arched)
-        box = layout.box()
-        box.prop(self, 'Opening1Tog')
-        if self.properties.Opening1Tog:
-            box.prop(self, 'Opening1Width')
-            box.prop(self, 'Opening1Height')
-            box.prop(self, 'Opening1X')
-            box.prop(self, 'Opening1Z')
-            box.prop(self, 'Opening1Bevel')
-            box.prop(self, 'Opening1Repeat')
-            box.prop(self, 'Opening1TopArchTog')
-            box.prop(self, 'Opening1TopArch')
-            box.prop(self, 'Opening1TopArchThickness')
-            box.prop(self, 'Opening1BtmArchTog')
-            box.prop(self, 'Opening1BtmArch')
-            box.prop(self, 'Opening1BtmArchThickness')
-
-# Slots (narrow openings)
-        box = layout.box()
-        box.prop(self, 'SlotTog')
-        if self.properties.SlotTog:
-#		box.prop(self, 'SlotWdg')
-            box.prop(self, 'SlotX')
-            box.prop(self, 'SlotGap')
-            box.prop(self, 'SlotRpt')
-            box.prop(self, 'SlotV')
-            box.prop(self, 'SlotVH')
-            box.prop(self, 'SlotVBtm')
-            box.prop(self, 'SlotH')
-            box.prop(self, 'SlotHW')
-            box.prop(self, 'SlotHBtm')
-
-# Crenels, gaps in top of wall
-        box = layout.box()
-        box.prop(self, 'CrenelTog')
-        if self.properties.CrenelTog:
-            box.prop(self, 'CrenelXP')
-            box.prop(self, 'CrenelZP')
-
-# Shelfing (protrusions)
-        box = layout.box()
-        box.prop(self, 'ShelfTog')
-        if self.properties.ShelfTog:
-            box.prop(self, 'ShelfX')
-            box.prop(self, 'ShelfZ')
-            box.prop(self, 'ShelfH')
-            box.prop(self, 'ShelfW')
-            box.prop(self, 'ShelfD')
-            box.prop(self, 'ShelfBack')
-
-# Steps
-        box = layout.box()
-        box.prop(self, 'StepTog')
-        if self.properties.StepTog:
-            box.prop(self, 'StepX')
-            box.prop(self, 'StepZ')
-            box.prop(self, 'StepH')
-            box.prop(self, 'StepW')
-            box.prop(self, 'StepD')
-            box.prop(self, 'StepV')
-            box.prop(self, 'StepT')
-            box.prop(self, 'StepLeft')
-            box.prop(self, 'StepOnly')
-            box.prop(self, 'StepBack')
-
-##
-#####
-# Respond to UI - get the properties set by user.
-#####
-##
-    # Check and process UI settings to generate masonry
-
-    def execute(self, context):
-
-        global radialized
-        global slope
-        global openingSpecs
-        global bigBlock
-        global shelfExt
-        global stepMod
-        global stepLeft
-        global shelfBack
-        global stepOnly
-        global stepBack
-
-        # Create the wall when enabled (skip regen iterations when off)
-        if not self.properties.ConstructTog: return {'FINISHED'}
-
-        #enter the settings for the wall dimensions (area)
-# start can't be zero - min/max don't matter [if max less than end] but zero don't workie.
-# start can't exceed end.
-        if not self.properties.WallStart or self.properties.WallStart >= self.properties.WallEnd:
-            self.properties.WallStart = NOTZERO # Reset UI if input out of bounds...
-
-        dims['s'] = self.properties.WallStart
-        dims['e'] = self.properties.WallEnd
-        dims['b'] = self.properties.WallBottom
-        dims['t'] = self.properties.WallTop
-
-        settings['eoff'] = self.properties.EdgeOffset
-
-        #retrieve the settings for the wall block properties
-        settings['w'] = self.properties.Width
-        settings['wv'] = self.properties.WidthVariance
-        settings['wm'] = self.properties.WidthMinimum
-        if not radialized: settings['sdv'] = settings['w'] 
-        else: settings['sdv'] = 0.12
-
-        settings['h'] = self.properties.Height
-        settings['hv'] = self.properties.HeightVariance
-        settings['hm'] = self.properties.HeightMinimum
-
-        settings['d'] = self.properties.Depth
-        settings['dv'] = self.properties.DepthVariance
-        settings['dm'] = self.properties.DepthMinimum
-
-        if self.properties.MergeBlock:
-            bigBlock = 1
-        else: bigBlock = 0
-
-        settings['g'] = self.properties.Grout
-        settings['gv'] = self.properties.GroutVariance
-        settings['gd'] = self.properties.GroutDepth
-        settings['gdv'] = self.properties.GroutDepthVariance
-
-        if self.properties.GroutEdge: settings['ge'] = 1
-        else: settings['ge'] = 0
-
-        # set wall shape modifiers
-        if self.properties.RadialTog:
-            radialized = 1
-#eliminate to allow user control for start/completion?
-            dims['s'] = 0.0 # complete radial
-            if dims['e'] > PI*2: dims['e'] = PI*2 # max end for circle
-            if dims['b'] < settings['g']: dims['b'] = settings['g'] # min bottom for grout extension
-        else: radialized = 0
-
-        if self.properties.SlopeTog: slope = 1
-        else: slope = 0
-
-
-        shelfExt = 0
-        shelfBack = 0
-
-	# Add shelf if enabled
-        if self.properties.ShelfTog:
-            shelfExt = 1
-            shelfSpecs['h'] = self.properties.ShelfH
-            shelfSpecs['w'] = self.properties.ShelfW
-            shelfSpecs['d'] = self.properties.ShelfD
-            shelfSpecs['x'] = self.properties.ShelfX
-            shelfSpecs['z'] = self.properties.ShelfZ
-
-            if self.properties.ShelfBack:
-                shelfBack = 1
-
-
-        stepMod = 0
-        stepLeft = 0
-        stepOnly = 0
-        stepBack = 0
-
-	# Make steps if enabled
-        if self.properties.StepTog:
-            stepMod = 1
-            stepSpecs['x'] = self.properties.StepX
-            stepSpecs['z'] = self.properties.StepZ
-            stepSpecs['h'] = self.properties.StepH
-            stepSpecs['w'] = self.properties.StepW
-            stepSpecs['d'] = self.properties.StepD
-            stepSpecs['v'] = self.properties.StepV
-            stepSpecs['t'] = self.properties.StepT
-
-            if self.properties.StepLeft:
-                stepLeft = 1
-
-            if self.properties.StepOnly:
-                stepOnly = 1
-
-            if self.properties.StepBack:
-                stepBack = 1
-
-
-        #enter the settings for the openings
-#when openings overlap they create inverse stonework - interesting but not the desired effect :)
-#if opening width == indent*2 the edge blocks fail (row of blocks cross opening) - bug.
-        openingSpecs = []
-        openingIdx = 0 # track opening array references for multiple uses
-
-        # general openings with arch options - can be windows or doors.
-        if self.properties.Opening1Tog:
-            # set defaults...
-            openingSpecs += [{'w':0.5, 'h':0.5, 'x':0.8, 'z':2.7, 'rp':1, 'b':0.0, 'v':0, 'vl':0, 't':0, 'tl':0}]
-
-            openingSpecs[openingIdx]['w'] = self.properties.Opening1Width
-            openingSpecs[openingIdx]['h'] = self.properties.Opening1Height
-            openingSpecs[openingIdx]['x'] = self.properties.Opening1X
-            openingSpecs[openingIdx]['z'] = self.properties.Opening1Z
-            openingSpecs[openingIdx]['rp'] = self.properties.Opening1Repeat
-
-            if self.properties.Opening1TopArchTog:
-                openingSpecs[openingIdx]['v'] = self.properties.Opening1TopArch
-                openingSpecs[openingIdx]['t'] = self.properties.Opening1TopArchThickness
-
-            if self.properties.Opening1BtmArchTog:
-                openingSpecs[openingIdx]['vl'] = self.properties.Opening1BtmArch
-                openingSpecs[openingIdx]['tl'] = self.properties.Opening1BtmArchThickness
-            
-            openingSpecs[openingIdx]['b'] = self.properties.Opening1Bevel
-
-            openingIdx += 1 # count window/door/arch openings
-
-        # Slots (narrow openings)
-        if self.properties.SlotTog:
-
-            if self.properties.SlotV: # vertical slots
-                # set defaults...
-                openingSpecs += [{'w':0.5, 'h':0.5, 'x':0.0, 'z':2.7, 'rp':0, 'b':0.0, 'v':0, 'vl':0, 't':0, 'tl':0}]
-
-                openingSpecs[openingIdx]['w'] = self.properties.SlotGap
-                openingSpecs[openingIdx]['h'] = self.properties.SlotVH
-                openingSpecs[openingIdx]['x'] = self.properties.SlotX
-                openingSpecs[openingIdx]['z'] = self.properties.SlotVBtm
-                openingSpecs[openingIdx]['rp'] = self.properties.SlotRpt
-
-                # make them pointy...
-                openingSpecs[openingIdx]['v'] = self.properties.SlotGap
-                openingSpecs[openingIdx]['t'] = self.properties.SlotGap/2
-                openingSpecs[openingIdx]['vl'] = self.properties.SlotGap
-                openingSpecs[openingIdx]['tl'] = self.properties.SlotGap/2
-
-                openingIdx += 1 # count vertical slot openings
-
-# need to handle overlap of H and V slots...
-
-            if self.properties.SlotH: # Horizontal slots
-                # set defaults...
-                openingSpecs += [{'w':0.5, 'h':0.5, 'x':0.0, 'z':2.7, 'rp':0, 'b':0.0, 'v':0, 'vl':0, 't':0, 'tl':0}]
-
-                openingSpecs[openingIdx]['w'] = self.properties.SlotHW
-                openingSpecs[openingIdx]['h'] = self.properties.SlotGap
-                openingSpecs[openingIdx]['x'] = self.properties.SlotX
-                openingSpecs[openingIdx]['z'] = self.properties.SlotHBtm
-#horizontal repeat isn't same spacing as vertical...
-                openingSpecs[openingIdx]['rp'] = self.properties.SlotRpt
-
-                # make them pointy...
-# want arc to go sideways... maybe wedge will be sufficient and can skip horiz arcs.
-#				openingSpecs[openingIdx]['v'] = self.properties.SlotGap
-#				openingSpecs[openingIdx]['t'] = self.properties.SlotGap/2
-#				openingSpecs[openingIdx]['vl'] = self.properties.SlotGap
-#				openingSpecs[openingIdx]['tl'] = self.properties.SlotGap/2
-
-                openingIdx += 1 # count horizontal slot openings
-
-
-        # Crenellations (top row openings)
-        if self.properties.CrenelTog:
-
-# add bottom arch option?
-# perhaps a repeat toggle...
-# if crenel opening overlaps with arch opening it fills with blocks...
-
-            # set defaults...
-            openingSpecs += [{'w':0.5, 'h':0.5, 'x':0.0, 'z':2.7, 'rp':1, 'b':0.0, 'v':0, 'vl':0, 't':0, 'tl':0}]
-
-            wallW = self.properties.WallEnd - self.properties.WallStart
-            crenelW = wallW*self.properties.CrenelXP # Width % opening.
-
-            wallH = self.properties.WallTop - self.properties.WallBottom
-            crenelH = wallH*self.properties.CrenelZP # % proportional height.
-
-            openingSpecs[openingIdx]['w'] = crenelW
-            openingSpecs[openingIdx]['h'] = crenelH
-
-            # calculate the spacing between openings.
-            # this isn't the absolute start (left), it's opening center offset relative to cursor (space between openings)...
-            openingSpecs[openingIdx]['x'] = crenelW*2-1 # assume standard spacing
-
-            if not radialized: # normal wall?
-                # set indent 0 (center) if opening is 50% or more of wall width, no repeat.
-                if crenelW*2 >= wallW:
-                    openingSpecs[openingIdx]['x'] = 0
-                    openingSpecs[openingIdx]['rp'] = 0
-
-            openingSpecs[openingIdx]['z'] = self.properties.WallTop - (crenelH/2) # set bottom of opening (center of hole)
-
-            openingIdx += 1 # count crenel openings
-
-        #
-        # Process the user settings to generate a wall
-        #
-        # generate the list of vertices for the wall...
-        verts_array, faces_array = createWall(radialized, slope, openingSpecs, bigBlock,
-                shelfExt, shelfBack, stepMod, stepLeft, stepOnly, stepBack)
-
-        # Create new mesh
-        mesh = bpy.data.meshes.new("Wall")
-
-        # Make a mesh from a list of verts/edges/faces.
-        mesh.from_pydata(verts_array, [], faces_array)
-
-        scene = context.scene
-
-        # Deselect all objects.
-        bpy.ops.object.select_all(action='DESELECT')
-
-        mesh.update()
-
-        ob_new = bpy.data.objects.new("Wall", mesh)
-        scene.objects.link(ob_new)
-# leave this out to prevent 'Tab key" going into edit mode :):):)
-# Use rmb click to select and still modify.
-        scene.objects.active = ob_new
-        ob_new.select = True
-
-        ob_new.location = tuple(context.scene.cursor_location)
-        ob_new.rotation_quaternion = [1.0,0.0,0.0,0.0]
-
-        return {'FINISHED'}
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/__init__.py b/release/scripts/addons_contrib/add_mesh_building_objects/__init__.py
deleted file mode 100644
index 19623aa..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/__init__.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-# Contributed to by
-# SAYproductions, meta-androcto, jambay, brikbot#
-
-bl_info = {
-    "name": "Building Objects",
-    "author": "Multiple Authors",
-    "version": (0, 2),
-    "blender": (2, 64, 0),
-    "location": "View3D > Add > Mesh > Cad Objects",
-    "description": "Add building object types",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=32711",
-    "category": "Add Mesh"}
-
-
-if "bpy" in locals():
-    import imp
-    imp.reload(add_mesh_balcony)
-    imp.reload(add_mesh_sove)
-    imp.reload(add_mesh_window)
-    imp.reload(add_mesh_beam_builder)
-    imp.reload(Wallfactory)
-    imp.reload(stairbuilder)
-
-else:
-    from . import add_mesh_balcony
-    from . import add_mesh_sove
-    from . import add_mesh_window
-    from . import add_mesh_beam_builder
-    from . import Wallfactory
-    from . import stairbuilder
-
-import bpy
-
-
-class INFO_MT_mesh_objects_add(bpy.types.Menu):
-    # Define the "mesh objects" menu
-    bl_idname = "INFO_MT_cad_objects_add"
-    bl_label = "Building Objects"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.menu("INFO_MT_mesh_beambuilder_add",
-            text="Beam Builder")
-        layout.operator("mesh.add_say3d_balcony",
-            text="Balcony")
-        layout.operator("mesh.add_say3d_sove",
-            text="Sove")
-        layout.operator("mesh.add_say3d_pencere2",
-            text="Window")
-        layout.operator("mesh.wall_add",
-            text="Wall Factory")
-        layout.operator("mesh.stairs",
-            text="Stair Builder")
-
-
-# Register all operators and panels
-
-# Define "Extras" menu
-def menu_func(self, context):
-    self.layout.menu("INFO_MT_cad_objects_add", icon="PLUGIN")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    # Add "Extras" menu to the "Add Mesh" menu
-    bpy.types.INFO_MT_mesh_add.append(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    # Remove "Extras" menu from the "Add Mesh" menu.
-    bpy.types.INFO_MT_mesh_add.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_balcony.py b/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_balcony.py
deleted file mode 100644
index 4648849..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_balcony.py
+++ /dev/null
@@ -1,492 +0,0 @@
-'''
-bl_info = {
-    "name": "Balcony",
-    "author": "SayPRODUCTIONS",
-    "version": (1, 0),
-    "blender": (2, 59, 0),
-    "api": 33333,
-    "location": "View3D > Add > Mesh > Say3D",
-    "description": "Balcony olusturma",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Add Mesh"}
-'''
-import bpy, bmesh
-from bpy.props import *
-from bpy_extras.object_utils import object_data_add
-from mathutils import Vector
-import operator
-import os
-from math import pi, sin, cos, sqrt, atan
-def MAT(AD,R,G,B):
-    if AD not in bpy.data.materials:
-        mtl=bpy.data.materials.new(AD)
-        mtl.diffuse_color     = ([R,G,B])
-        mtl.diffuse_shader    = 'LAMBERT'
-        mtl.diffuse_intensity = 1.0
-    else:
-        mtl=bpy.data.materials[AD]
-    return mtl
-def Prs(s,v):
-    if v=='1':
-        s.lst=3
-        s.ls0='1';s.by0= 80;s.bk0=20;s.bf0=4;s.fh0=3;s.fd0=2;s.f00=16;s.f01=12;s.f02=12;s.f03=12
-        s.ls1='3';s.my1=  4;s.mg1= 4
-        s.ls2='4';s.kt2="2";s.ky2= 5;s.kk2=5
-    if v=='2':
-        s.lst=5
-        s.ls0='1';s.by0= 15;s.bk0=20;s.bf0=0
-        s.ls1='2';s.py1= 60;s.pd1=10
-        s.ls2='1';s.by2= 15;s.bk2=20;s.bf2=0
-        s.ls3='3';s.my3=  4;s.mg3= 4
-        s.ls4='4';s.kt4="2";s.ky4= 5;s.kk4=5
-    if v=='3':
-        s.lst=3
-        s.ls0='1';s.by0= 40;s.bk0=10;s.bf0=0
-        s.ls1='5';s.cy1= 56
-        s.ls2='4';s.kt2="1";s.ky2= 0;s.kk2=4
-    if v=='4':
-        s.lst=2
-        s.ls0='1';s.by0= 30;s.bk0=20;s.bf0=0
-        s.ls1='3';s.my1=  4;s.mg1= 4
-    if v=='5':
-        s.lst=2
-        s.ls0='1';s.by0= 27;s.bk0=20;s.bf0=2;s.fh0=3;s.fd0=2;s.f00=7;s.f01=7
-        s.ls1='3';s.my1=  4;s.mg1= 4
-    if v=='6':
-        s.lst=6
-        s.ls0='1';s.by0= 50;s.bk0=20;s.bf0=2;s.fh0=3;s.fd0=2;s.f00=12;s.f01=20
-        s.ls1='3';s.my1=  4;s.mg1= 4
-        s.ls2='4';s.kt2="2";s.ky2= 5;s.kk2=4
-        s.ls3='4';s.kt3="2";s.ky3= 5;s.kk3=4
-        s.ls4='4';s.kt4="2";s.ky4= 5;s.kk4=4
-        s.ls5='4';s.kt5="2";s.ky5= 5;s.kk5=5
-def EXT(PR,vr,fc,lz,mz,rz):
-    n=len(vr)
-    m=len(PR)
-    if lz==0:
-        for P in PR:vr.append([-mz,P[0],P[1]])
-    else:
-        for P in PR:vr.append([ P[0]-mz,  lz,P[1]])
-        for P in PR:vr.append([ P[0]-mz,P[0],P[1]])
-    if rz==0:
-        for P in PR:vr.append([ mz,P[0],P[1]])
-    else:
-        for P in PR:vr.append([-P[0]+mz,P[0],P[1]])
-        for P in PR:vr.append([-P[0]+mz,  rz,P[1]])
-    if   lz==0 and rz==0:l=1
-    elif lz==0 and rz> 0:l=2
-    elif lz> 0 and rz==0:l=2
-    elif lz> 0 and rz> 0:l=3
-    for j in range(0,l):
-        for i in range(0,m):
-            a=j*m
-            if i==m-1:fc.append([a+i+n,a+0+n+0,a+0+n+0+m,a+i+n+m])
-            else:     fc.append([a+i+n,a+i+n+1,a+i+n+1+m,a+i+n+m])
-def add_object(s,context):
-    fc=[];vr=[];SM=[]
-    Bal=[];Par=[];Mer=[];Krm=[];Glass=[];Dos=[]
-    blok=[]#    [ Tip ][             Balcony           [                    Joint_Gap                        ] [  Bulwark  ] [   Marble  ] [       Chrome      ] [  Glass  ]
-    blok.append([s.ls0,[s.by0,s.bk0,s.bf0,s.fh0,s.fd0,[s.f00,s.f01,s.f02,s.f03,s.f04,s.f05,s.f06,s.f07]],[s.py0,s.pd0],[s.my0,s.mg0],[s.kt0,s.ky0,s.kk0],[s.cy0]])
-    blok.append([s.ls1,[s.by1,s.bk1,s.bf1,s.fh1,s.fd1,[s.f10,s.f11,s.f12,s.f13,s.f14,s.f15,s.f16,s.f17]],[s.py1,s.pd1],[s.my1,s.mg1],[s.kt1,s.ky1,s.kk1],[s.cy1]])
-    blok.append([s.ls2,[s.by2,s.bk2,s.bf2,s.fh2,s.fd2,[s.f20,s.f21,s.f22,s.f23,s.f24,s.f25,s.f26,s.f27]],[s.py2,s.pd2],[s.my2,s.mg2],[s.kt2,s.ky2,s.kk2],[s.cy2]])
-    blok.append([s.ls3,[s.by3,s.bk3,s.bf3,s.fh3,s.fd3,[s.f30,s.f31,s.f32,s.f33,s.f34,s.f35,s.f36,s.f37]],[s.py3,s.pd3],[s.my3,s.mg3],[s.kt3,s.ky3,s.kk3],[s.cy3]])
-    blok.append([s.ls4,[s.by4,s.bk4,s.bf4,s.fh4,s.fd4,[s.f40,s.f41,s.f42,s.f43,s.f44,s.f45,s.f46,s.f47]],[s.py4,s.pd4],[s.my4,s.mg4],[s.kt4,s.ky4,s.kk4],[s.cy4]])
-    blok.append([s.ls5,[s.by5,s.bk5,s.bf5,s.fh5,s.fd5,[s.f50,s.f51,s.f52,s.f53,s.f54,s.f55,s.f56,s.f57]],[s.py5,s.pd5],[s.my5,s.mg5],[s.kt5,s.ky5,s.kk5],[s.cy5]])
-    blok.append([s.ls6,[s.by6,s.bk6,s.bf6,s.fh6,s.fd6,[s.f60,s.f61,s.f62,s.f63,s.f64,s.f65,s.f66,s.f67]],[s.py6,s.pd6],[s.my6,s.mg6],[s.kt6,s.ky6,s.kk6],[s.cy6]])
-    blok.append([s.ls7,[s.by7,s.bk7,s.bf7,s.fh7,s.fd7,[s.f70,s.f71,s.f72,s.f73,s.f74,s.f75,s.f76,s.f77]],[s.py7,s.pd7],[s.my7,s.mg7],[s.kt7,s.ky7,s.kk7],[s.cy7]])
-
-    h=-s.dds/100;dh=h+s.dhg/100;du=s.duz/100;
-    lz=s.luz/100;mz=s.muz/200;rz=s.ruz/100
-    dg=-((blok[0][1][1]-s.ddg)/100)
-    if h<0:#Pavement
-        if lz==0 and rz==0:
-            vr=[[-mz,du,h],[ mz,du, h],[-mz,dg, h],[ mz,dg, h],[-mz,dg, 0],
-                [ mz,dg,0],[-mz, 0,dh],[ mz, 0,dh],[-mz,du,dh],[ mz,du,dh]]
-            fc=[[0,1,3,2],[2,3,5,4],[6,7,9,8]];Dos=[0,1,2]
-        if lz==0 and rz >0:
-            vr=[[-mz,   du,h],[ mz-dg,du, h],[-mz,   dg, h],[ mz-dg,dg, h],[-mz,   dg, 0],
-                [ mz-dg,dg,0],[-mz, 0,   dh],[ mz-dg, 0,dh],[-mz,   du,dh],[ mz-dg,du,dh],[ mz-dg,du,0]]
-            fc=[[0,1,3,2],[2,3,5,4],[6,7,9,8],[3,1,10,5]];Dos=[0,1,2,3]
-        if lz >0 and rz==0:
-            vr=[[-mz+dg,du,h],[ mz,   du, h],[-mz+dg,dg, h],[ mz,   dg, h],[-mz+dg,dg, 0],
-                [ mz,   dg,0],[-mz+dg, 0,dh],[ mz,    0,dh],[-mz+dg,du,dh],[ mz,   du,dh],[-mz+dg,du,0]]
-            fc=[[0,1,3,2],[2,3,5,4],[6,7,9,8],[0,2,4,10]];Dos=[0,1,2,3]
-        if lz >0 and rz >0:
-            vr=[[-mz+dg,dg,0],[mz-dg,dg,0],[-mz+dg,dg, h],[mz-dg,dg, h],[-mz+dg,du, h],[mz-dg,du, h],
-                [-mz+dg,du,0],[mz-dg,du,0],[-mz,    0,dh],[mz,    0,dh],[-mz,   du,dh],[mz,   du,dh]]
-            fc=[[1,0,2,3],[3,2,4,5],[6,4,2,0],[3,5,7,1],[8,9,11,10]];Dos=[0,1,2,3,4]
-    else:
-        vr=[[-mz, 0, h],[mz, 0, h],[-mz,du, h],[mz,du, h],
-            [-mz,du,dh],[mz,du,dh],[-mz, 0,dh],[mz, 0,dh]]
-        fc=[[1,0,2,3],[5,4,6,7]];Dos=[0,1]
-    z=0
-    for i in range(s.lst):
-        if blok[i][0]=='1':#Balcony
-            k1=blok[i][1][1]/100;h =blok[i][1][0]/100
-            fh=blok[i][1][3]/100;fd=blok[i][1][4]/100
-            PR=[[-k1,z],[0,z],[0,z+h],[-k1,z+h]]
-            z+=h;fz=z
-            for f in range(blok[i][1][2]):
-                fz-=blok[i][1][5][f]/100
-                PR.append([-k1,   fz   ]);PR.append([-k1+fd,fz   ])
-                PR.append([-k1+fd,fz-fh]);PR.append([-k1,   fz-fh])
-                fz-=fh
-            BB=len(fc)
-            EXT(PR,vr,fc,lz,mz,rz)
-            BE=len(fc)
-            for F in range(BB,BE):Bal.append(F)
-        if blok[i][0]=='2':#Bulwark
-            k1=blok[i][2][1]/100;h=blok[i][2][0]/100
-            PR=[[-k1,z],[0,z],[0,z+h],[-k1,z+h]]
-            z+=h
-            BB=len(fc)
-            EXT(PR,vr,fc,lz,mz,rz)
-            BE=len(fc)
-            for F in range(BB,BE):Par.append(F)
-        if blok[i][0]=='3':#Marble
-            k1=blok[0][1][1]/100;k2=blok[i][3][1]/100;h=blok[i][3][0]/100
-            PR=[[-k1-k2,z],[k2,z],[k2,z+h],[-k1-k2,z+h]]
-            z+=h
-            BB=len(fc)
-            EXT(PR,vr,fc,lz,mz,rz)
-            BE=len(fc)
-            for F in range(BB,BE):Mer.append(F)
-        if blok[i][0]=='4':#Chrome
-            k1=blok[0][1][1]/200;k2=blok[i][4][2]/200;h=blok[i][4][1]/100
-            if blok[i][4][0]=="1":#Duz
-                z+=h
-                PR=[[-k1-k2,z],[-k1+k2,z],[-k1+k2,z+k2*2],[-k1-k2,z+k2*2]]
-                z+=k2*2
-            else:#Round
-                PR=[];z+=h+k2
-                for a in range(24):
-                    x=-k1+cos(a*pi/12)*k2;y=z+sin(a*pi/12)*k2
-                    PR.append([x,y])
-                z+=k2
-            BB=len(fc)
-            EXT(PR,vr,fc,lz,mz,rz)
-            BE=len(fc)
-            for F in range(BB,BE):Krm.append(F)
-            if blok[i][4][0]=="2":
-                for F in range(BB,BE):SM.append(F)
-        if blok[i][0]=='5':#Glass
-            k1=blok[0][1][1]/200;h=blok[i][5][0]/100
-            PR=[[-k1-0.001,z],[-k1+0.001,z],[-k1+0.001,z+h],[-k1-0.001,z+h]]
-            z+=h;BB=len(fc);n=len(vr)
-            fc.append([n+1,n,n+3,n+2])
-            EXT(PR,vr,fc,lz,mz,rz)
-            n=len(vr)
-            fc.append([n-2,n-1,n-4,n-3])
-            BE=len(fc)
-            for F in range(BB,BE):Glass.append(F)
-#OBJE -----------------------------------------------------------
-    mesh = bpy.data.meshes.new(name='Balcony')
-    mesh.from_pydata(vr,[],fc)
-    for i in SM:
-        mesh.polygons[i].use_smooth = 1
-    mesh.materials.append(MAT('Balcony', 0.66,0.64,0.72))
-    mesh.materials.append(MAT('Bulwark',0.46,0.44,0.52))
-    mesh.materials.append(MAT('Marble', 0.90,0.85,0.80))
-    mesh.materials.append(MAT('Chrome',   0.50,0.55,0.60))
-    mesh.materials.append(MAT('Glass',    0.50,0.80,1.00))
-    mesh.materials.append(MAT('Pavement', 1.00,1.00,1.00))
-
-    for i in Bal:mesh.polygons[i].material_index = 0
-    for i in Par:mesh.polygons[i].material_index = 1
-    for i in Mer:mesh.polygons[i].material_index = 2
-    for i in Krm:mesh.polygons[i].material_index = 3
-    for i in Glass:mesh.polygons[i].material_index = 4
-    for i in Dos:mesh.polygons[i].material_index = 5
-
-    mesh.update(calc_edges=True)
-    object_data_add(context, mesh, operator=None)
-    if bpy.context.mode != 'EDIT_MESH':
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.object.editmode_toggle()
-#----------------------------------------------------------------
-class OBJECT_OT_add_balcony(bpy.types.Operator):
-    bl_idname = "mesh.add_say3d_balcony"
-    bl_label = "Balcony"
-    bl_description = "Balcony Olustur"
-    bl_options = {'REGISTER', 'UNDO'}
-    prs = EnumProperty(items = (("1","Joint_Gap",    ""),
-                                ("2","Bulwark", ""),
-                                ("3","Glass",     ""),
-                                ("4","Marquise",  ""),
-                                ("5","Eaves",   ""),
-                                ("6","Railing","")))
-    son=prs
-    lst=IntProperty(         min=1,max=   8,default=  3)
-    luz=IntProperty(name='<',min=0,max=1000,default=100)
-    muz=IntProperty(         min=0,max=1000,default=200)
-    ruz=IntProperty(name='>',min=0,max=1000,default=100)
-
-    duz=IntProperty(min=  1,max=500,default=100,description="Pavement Width")
-    dhg=IntProperty(min=  1,max= 50,default= 17,description="Pavement Height")
-    dds=IntProperty(min=-50,max= 50,default= 10,description="Pavement Height")
-    ddg=IntProperty(min=  0,max= 50,default= 10,description="Pavement Width")
-    #Tip
-    ls0=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="1")
-    #Balcony
-    by0=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk0=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf0=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 4,description='Joint_Gap'     )
-    fh0=IntProperty(min=1,max= 10,default= 3);fd0=IntProperty(min=1,max= 10,default= 2)
-    f00=IntProperty(min=1,max=200,default=16);f01=IntProperty(min=1,max=200,default=12)
-    f02=IntProperty(min=1,max=200,default=12);f03=IntProperty(min=1,max=200,default=12)
-    f04=IntProperty(min=1,max=200,default= 3);f05=IntProperty(min=1,max=200,default= 3)
-    f06=IntProperty(min=1,max=200,default= 3);f07=IntProperty(min=1,max=200,default= 3)
-    #Bulwark
-    py0=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd0=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my0=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg0=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt0=EnumProperty(items=(("1","Square",""),("2","Round","")))
-    ky0=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk0=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy0=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    #Tip
-    ls1=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="3")
-    #Balcony
-    by1=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk1=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf1=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 0,description='Joint_Gap'     )
-    fh1=IntProperty(min=1,max= 10,default=3);fd1=IntProperty(min=1,max= 10,default=2)
-    f10=IntProperty(min=1,max=200,default=3);f11=IntProperty(min=1,max=200,default=3)
-    f12=IntProperty(min=1,max=200,default=3);f13=IntProperty(min=1,max=200,default=3)
-    f14=IntProperty(min=1,max=200,default=3);f15=IntProperty(min=1,max=200,default=3)
-    f16=IntProperty(min=1,max=200,default=3);f17=IntProperty(min=1,max=200,default=3)
-    #Bulwark
-    py1=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd1=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my1=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg1=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt1=EnumProperty(items=(("1","Square",""),("2","Round","")))
-    ky1=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk1=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy1=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    #Tip
-    ls2=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="4")
-    #Balcony
-    by2=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk2=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf2=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 0,description='Joint_Gap'     )
-    fh2=IntProperty(min=1,max= 10,default=3);fd2=IntProperty(min=1,max= 10,default=2)
-    f20=IntProperty(min=1,max=200,default=3);f21=IntProperty(min=1,max=200,default=3)
-    f22=IntProperty(min=1,max=200,default=3);f23=IntProperty(min=1,max=200,default=3)
-    f24=IntProperty(min=1,max=200,default=3);f25=IntProperty(min=1,max=200,default=3)
-    f26=IntProperty(min=1,max=200,default=3);f27=IntProperty(min=1,max=200,default=3)
-    #Bulwark
-    py2=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd2=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my2=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg2=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt2=EnumProperty(items=(("1","Square",""),("2","Round","")),default="2")
-    ky2=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk2=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy2=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    #Tip
-    ls3=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="4")
-    #Balcony
-    by3=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk3=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf3=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 0,description='Joint_Gap'     )
-    fh3=IntProperty(min=1,max= 10,default=3);fd3=IntProperty(min=1,max= 10,default=2)
-    f30=IntProperty(min=1,max=200,default=3);f31=IntProperty(min=1,max=200,default=3)
-    f32=IntProperty(min=1,max=200,default=3);f33=IntProperty(min=1,max=200,default=3)
-    f34=IntProperty(min=1,max=200,default=3);f35=IntProperty(min=1,max=200,default=3)
-    f36=IntProperty(min=1,max=200,default=3);f37=IntProperty(min=1,max=200,default=3)
-    #Bulwark
-    py3=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd3=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my3=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg3=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt3=EnumProperty(items=(("1","Square",""),("2","Round","")))
-    ky3=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk3=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy3=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    #Tip
-    ls4=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="4")
-    #Balcony
-    by4=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk4=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf4=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 0,description='Joint_Gap'     )
-    fh4=IntProperty(min=1,max= 10,default=3);fd4=IntProperty(min=1,max= 10,default=2)
-    f40=IntProperty(min=1,max=200,default=3);f41=IntProperty(min=1,max=200,default=3)
-    f42=IntProperty(min=1,max=200,default=3);f43=IntProperty(min=1,max=200,default=3)
-    f44=IntProperty(min=1,max=200,default=3);f45=IntProperty(min=1,max=200,default=3)
-    f46=IntProperty(min=1,max=200,default=3);f47=IntProperty(min=1,max=200,default=3)
-    #Bulwark
-    py4=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd4=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my4=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg4=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt4=EnumProperty(items=(("1","Square",""),("2","Round","")))
-    ky4=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk4=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy4=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    #Tip
-    ls5=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="4")
-    #Balcony
-    by5=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk5=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf5=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 0,description='Joint_Gap'     )
-    fh5=IntProperty(min=1,max= 10,default=3);fd5=IntProperty(min=1,max= 10,default=2)
-    f50=IntProperty(min=1,max=200,default=3);f51=IntProperty(min=1,max=200,default=3)
-    f52=IntProperty(min=1,max=200,default=3);f53=IntProperty(min=1,max=200,default=3)
-    f54=IntProperty(min=1,max=200,default=3);f55=IntProperty(min=1,max=200,default=3)
-    f56=IntProperty(min=1,max=200,default=3);f57=IntProperty(min=1,max=200,default=3)
-    #Bulwark
-    py5=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd5=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my5=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg5=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt5=EnumProperty(items=(("1","Square",""),("2","Round","")))
-    ky5=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk5=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy5=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    #Tip
-    ls6=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="4")
-    #Balcony
-    by6=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk6=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf6=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 0,description='Joint_Gap'     )
-    fh6=IntProperty(min=1,max= 10,default=3);fd6=IntProperty(min=1,max= 10,default=2)
-    f60=IntProperty(min=1,max=200,default=3);f61=IntProperty(min=1,max=200,default=3)
-    f62=IntProperty(min=1,max=200,default=3);f63=IntProperty(min=1,max=200,default=3)
-    f64=IntProperty(min=1,max=200,default=3);f65=IntProperty(min=1,max=200,default=3)
-    f66=IntProperty(min=1,max=200,default=3);f67=IntProperty(min=1,max=200,default=3)
-    #Bulwark
-    py6=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd6=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my6=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg6=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt6=EnumProperty(items=(("1","Square",""),("2","Round","")))
-    ky6=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk6=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy6=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    #Tip
-    ls7=EnumProperty(items=(("1","Balcony",""),("2","Bulwark",""),("3","Marble",""),("4","Chrome",""),("5","Glass","")),default="4")
-    #Balcony
-    by7=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    bk7=IntProperty(name='Thickness', min=1,max= 50,default=20,description='Thickness' )
-    bf7=IntProperty(name='Joint_Gap',     min=0,max=  8,default= 0,description='Joint_Gap'     )
-    fh7=IntProperty(min=1,max= 10,default=3);fd7=IntProperty(min=1,max= 10,default=2)
-    f70=IntProperty(min=1,max=200,default=3);f71=IntProperty(min=1,max=200,default=3)
-    f72=IntProperty(min=1,max=200,default=3);f73=IntProperty(min=1,max=200,default=3)
-    f74=IntProperty(min=1,max=200,default=3);f75=IntProperty(min=1,max=200,default=3)
-    f76=IntProperty(min=1,max=200,default=3);f77=IntProperty(min=1,max=200,default=3)
-    #Bulwark
-    py7=IntProperty(name='Elevation',min=1,max=200,default=80,description='Elevation')
-    pd7=IntProperty(name='Thickness', min=1,max= 50,default=10,description='Thickness' )
-    #Marble
-    my7=IntProperty(name='Elevation',min=1,max=50,default=4,description='Elevation')
-    mg7=IntProperty(name='maxWidth', min=0,max=20,default=4,description='maxWidth' )
-    #Chrome
-    kt7=EnumProperty(items=(("1","Square",""),("2","Round","")))
-    ky7=IntProperty(min=0,max=50,default=5,description='CutOut'  )
-    kk7=IntProperty(min=1,max=20,default=5,description='Thickness')
-    #Glass
-    cy7=IntProperty(name='Elevation',min=1,max=100,default=20,description='Elevation')
-    #--------------------------------------------------------------
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self,'prs', text="Wall Style")
-        layout.prop(self,'lst', text="Add Level")
-        row=layout.row()
-        row.label(text="Wall Length & Width")
-        row=layout.row()
-        row.prop(self,'luz')
-        row.prop(self,'muz')
-        row.prop(self,'ruz')
-
-        layout.label('Pavement XYZ')
-        row=layout.row();row.prop(self,'duz');row.prop(self,'dhg')
-        row=layout.row();row.prop(self,'dds');row.prop(self,'ddg')
-
-        ls=[];lf=[]
-        ls.append(self.ls0);lf.append(self.bf0)
-        ls.append(self.ls1);lf.append(self.bf1)
-        ls.append(self.ls2);lf.append(self.bf2)
-        ls.append(self.ls3);lf.append(self.bf3)
-        ls.append(self.ls4);lf.append(self.bf4)
-        ls.append(self.ls5);lf.append(self.bf5)
-        ls.append(self.ls6);lf.append(self.bf6)
-        ls.append(self.ls7);lf.append(self.bf7)
-        for i in range(self.lst-1,-1,-1):
-            box=layout.box()
-            box.prop(self,'ls'+str(i))
-            if  ls[i]=='1':#Balcony
-                box.prop(self,'by'+str(i))
-                box.prop(self,'bk'+str(i))
-                box.prop(self,'bf'+str(i))
-                if lf[i]>0:
-                    row=box.row()
-                    row.prop(self,'fh'+str(i))
-                    row.prop(self,'fd'+str(i))
-                for f in range(lf[i]):
-                    box.prop(self,'f'+str(i)+str(f))
-            if  ls[i]=='2':#Bulwark
-                box.prop(self,'py'+str(i))
-                box.prop(self,'pd'+str(i))
-            if  ls[i]=='3':#Marble
-                row=box.row()
-                row.prop(self,'my'+str(i))
-                row.prop(self,'mg'+str(i))
-            if  ls[i]=='4':#Chrome
-                row=box.row()
-                row.prop(self,'kt'+str(i))
-                row.prop(self,'ky'+str(i))
-                row.prop(self,'kk'+str(i))
-            if  ls[i]=='5':#Glass
-                box.prop(self,'cy'+str(i))
-    def execute(self, context):
-        if self.son!=self.prs:
-            Prs(self,self.prs)
-            self.son=self.prs
-        add_object(self,context)
-        return {'FINISHED'}
-# Registration
-def add_object_button(self, context):
-    self.layout.operator(
-        OBJECT_OT_add_balcony.bl_idname,
-        text="Balcony",
-        icon="SNAP_FACE")
-def register():
-    bpy.utils.register_class(OBJECT_OT_add_balcony)
-    bpy.types.INFO_MT_mesh_add.append(add_object_button)
-def unregister():
-    bpy.utils.unregister_class(OBJECT_OT_add_balcony)
-    bpy.types.INFO_MT_mesh_add.remove(add_object_button)
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_beam_builder.py b/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_beam_builder.py
deleted file mode 100644
index 446009e..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_beam_builder.py
+++ /dev/null
@@ -1,1477 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Beam Builder",
-    "description": "Creates various types of beams.",
-    "author": "revolt_randy",
-    "version": (0, 1, 3),
-    "blender": (2, 60, 0),
-    "location": "View3D > Add > Mesh",
-    "warning": "Currently under development.", 
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Add_Mesh/BeamBuilder",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?func=detail&aid=26911",
-    "category": "Add Mesh"}
-
-#
-# Creates a rectangluar, 'C', 'L', 'T', or 'I' - type beam.
-#
-       
-# Version History
-#
-# v0.1 - Script only generates a multi-sided mesh object,
-#           initial release for testing. 3/12/11
-#
-# v0.1.1 - Added 'C'-type beam, updated to work with 
-#           api r35499. 3/13/11
-#
-# v0.1.2 - Totally changed the way beams are created, size
-#           is now calculated based off width, length, & height
-#           (x,y,z). Added ability to taper beams as well.
-#           Add 'L' - type beam
-#           Add 'T' - type beam
-#           Add 'I' - type beam 
-#
-# v0.1.3 - Updated to work with api r41226, including using object_utils.py -
-#           part of blender's bpy_extras scripts. This is what handles
-#           the 'align to view', 'location', & 'rotation' options in the
-#           toolshelf when creating mesh. Added wiki & tracker url. Fixed
-#           a few bugs & fixed some debug prints that were still printing
-#           to console.  
-#     
-
-import bpy
-
-from bpy_extras import object_utils
-
-
-def create_mesh (self, context, name, verts, faces, debug):
-    # Creates mesh and object
-    # name - name of object to create
-    # verts - a list of vertex tuples
-    # faces - a list of face tuples
-    # debug - debug flag - if true prints data to console
-           
-    # Actually create mesh and object
-    mesh = bpy.data.meshes.new(name)
-
-    # add verts & faces to object
-    mesh.from_pydata(verts, [], faces)
-    mesh.update(calc_edges=True)
-    
-    if debug:
-        print("create_mesh function called and finished")    
-      
-    return object_utils.object_data_add(context, mesh, operator=self)
-
-
-def recalc_normals(debug):
-    # Recalculate normals
-    # parts of this script creates faces that are backwards or
-    # have thier normals facing the wrong way, so recalculate them
-    # debug - debug flag - if true prints data to console
-    
-    
-    if bpy.context.mode != 'EDIT_MESH':
-        bpy.ops.object.editmode_toggle()
-        # Recalcuate normals
-        bpy.ops.mesh.normals_make_consistent()
-        bpy.ops.object.editmode_toggle()
-        if debug:
-            print("\nObjectMode")
-    else:
-        bpy.ops.mesh.normals_make_consistent()
-        if debug:
-            print("\nEditMode")
-            
-    return
-
-
-def create_end_faces(verts_list, thick, debug):
-    # Create End Faces
-    # verts_list - list of vertices
-    # thick - if true object is hollow, so construct loop of end faces
-    #           instead of a solid end face
-    # debug - if true prints values from this function to console
-    
-    # returns:
-    # faces - a list of tuples defining the end faces
-    
-    faces = []
-    
-    num_of_verts = len(verts_list)
-    faces_temp = []
-
-    sides = 4 # sides - number of sides to mesh *added because of code re-write
-    
-    if thick:
-        # has thickness, so build end faces            
-        num_of_verts = int(num_of_verts / 2)
-        
-        # Create a list of the front faces
-        for index in range(num_of_verts):
-            if index == (num_of_verts - 1):
-                faces_temp.append(verts_list[index])
-                faces_temp.append(verts_list[index-index])
-                faces_temp.append(verts_list[index+1])
-                faces_temp.append(verts_list[index*2+1])
-            else:
-                faces_temp.append(verts_list[index])
-                faces_temp.append(verts_list[index+1])
-                faces_temp.append(verts_list[index+num_of_verts+1])
-                faces_temp.append(verts_list[index+num_of_verts])
-                        
-            faces.append(tuple(faces_temp))
-            faces_temp = []                
-    else:
-        #this code may not be needed, depends upon rewrite...
-        if sides > 4:
-            # more than 4 sides, so replace last list item (center vert) with first list item 
-            # for looping and building faces
-            center_vert = verts_list[num_of_verts - 1]
-            verts_list[num_of_verts - 1] = verts_list[0]
-
-            for index in range(int(num_of_verts - 1)):
-                faces_temp.append(verts_list[index])
-                faces_temp.append(verts_list[index + 1])
-                faces_temp.append(center_vert)
-                faces.append(tuple(faces_temp))
-                faces_temp = []
-        
-        else:
-            # create 1 end face
-            for index in range(num_of_verts):
-                faces_temp.append(verts_list[index])
-            faces.append(tuple(faces_temp))               
-    
-    # print debug info to console
-    if debug:
-        print("\ncreate_end_faces Function Starts")
-        print("\n End Face Verts list :", verts_list)
-        print("\n End Faces: ", faces)
-        print("\ncreate_end_faces Function Ends\n\n")
-            
-    return faces
-
-
-def create_side_faces(front_verts, back_verts, debug):
-    # Create side faces - simple bridging of front_verts & back_verts vertices,
-    #                     both front_verts & back_verts must be ordered in same direction
-    #                     with respect to y-axis
-    # front_verts - a list of front face vertices
-    # back_verts - a list of back face vertices
-    # debug - if true prints values from this function to console
-    
-    # returns:
-    # new_faces - a list of tuples defining the faces bridged between front_verts & back_verts
-    
-    # Number of faces to create
-    num_of_faces = (len(front_verts))
-    new_faces = []
-    
-    # add first value to end of lists for looping
-    front_verts.append(front_verts[0])
-    back_verts.append(back_verts[0])
-    
-    # Build the new_faces list with tuples defining each face    
-    for index in range(num_of_faces):
-        facestemp = (front_verts[index], front_verts[index+1], back_verts[index+1], back_verts[index])
-        new_faces.append(facestemp)
-    
-    # print debug info to console
-    if debug:
-        print("\ncreate_side_faces Function Starts") 
-        print("\n Number of faces to create: ", num_of_faces)
-        print("\n New faces :", new_faces)
-        print("\ncreate_side_faces Function Ends\n\n")
-
-    return new_faces
-
-
-def calc_end_verts(size, y_off, thick, debug):
-    # Calculates vertex location for end of mesh
-    
-    # size - tuple of x,y,z dimensions of mesh to create
-    # y_off - y offset, lets function know where to create verts on y-axis
-    # thick - thickness, if not zero this is the thickness of a hollow mesh
-    #         with the inner faces inset from size dimensions
-    # debug - if true prints values from this function to console
-    
-    # returns:
-    # verts - a list of tuples of the x,y,z location of each vertex
-    
-    verts = []
-    
-    if debug:
-        print ("\ncalc_end_verts Function Starts\n")
-        print("\nsize = ",size)
-        print("y_off = ",y_off)
-        
-    # Create vertices by calculation 
-    x_pos = 0 + size[0]/2
-    z_pos = 0 + size[2]/2
-    verts.append((x_pos, y_off, z_pos))
-
-    x_pos = 0 - size[0]/2
-    z_pos = 0 + size[2]/2
-    verts.append((x_pos, y_off, z_pos))
-    
-    x_pos = 0 - size[0]/2
-    z_pos = 0 - size[2]/2
-    verts.append((x_pos, y_off, z_pos)) 
-    
-    x_pos = 0 + size[0]/2
-    z_pos = 0 - size[2]/2
-    verts.append((x_pos, y_off, z_pos))   
-         
-    if thick:
-        # has thickness, so calculate inside vertices
-        #### not too sure about this, but it does work the way the 
-        #### solidify modifier works, so leaving as is for now
-        x_pos = size[0] - (thick * 2)
-        z_pos = size[2] - (thick * 2)
-        size = (x_pos, y_off, z_pos)
-        
-        # Create vertices by calculation 
-        x_pos = 0 + size[0]/2
-        z_pos = 0 + size[2]/2
-        verts.append((x_pos, y_off, z_pos))
-
-        x_pos = 0 - size[0]/2
-        z_pos = 0 + size[2]/2
-        verts.append((x_pos, y_off, z_pos))
-    
-        x_pos = 0 - size[0]/2
-        z_pos = 0 - size[2]/2
-        verts.append((x_pos, y_off, z_pos)) 
-    
-        x_pos = 0 + size[0]/2
-        z_pos = 0 - size[2]/2
-        verts.append((x_pos, y_off, z_pos))          
-            
-    if debug:
-        print ("verts :", verts)
-        print ("\ncalc_end_verts Function Ends.\n\n")
-    
-    return verts
-
-
-def adjust_c_beam_verts(verts, taper, debug):
-    # Adjusts verts produced to correct c beam shape
-    # verts - a list of tuples of vertex locations for one end of beam
-    # taper - % to taper outside verts by
-    # debug - if true values are printed to console for debugging
-    
-    # returns:
-    # verts - the corrected list of tuples of the adjustec vertex locations
-    
-    # This function corrects vertex locations to properly shape the
-    # beam, because creating a c beam uses the same code as the 
-    # create_rectangular_beam function does. Therefore the 5th & 6th
-    # vertice's z location needs to be changed to match the 1st & 2nd
-    # vertice's z location.
-
-    vert_orig = verts[0]
-    
-    # get 3rd value, the z location
-    vert_z = vert_orig[2] 
-    # get 1st value, the x location, for vert taper calcs    
-    vert_x = vert_orig[0]
-  
-    # vert_z has the z value to be used in the 5th & 6th verts
-    # get value of 5th vert 
-    vert_temp = verts[4]
-    
-
-    
-    # calculate the amount of taper, updating vert_x
-    # with the new value calculated.
-    vert_x = calc_taper(vert_orig[0], vert_temp[0], taper)
-    
-    vert_new = (vert_x,vert_temp[1],vert_z)
-    
-    if debug:
-        print ("\nadjust_c_beam_verts function starting")
-        print ("vert_orig = ",vert_orig[0])
-        print ("vert_x = ",vert_x)
-        print("vert_temp =",vert_temp)
-        print("vert_new =",vert_new)
-
-    # update 5th vert with new value
-    verts[4] = vert_new
-    
-    vert_orig = verts[1]
-    
-    # get 3rd value, the z location
-    vert_z = vert_orig[2] 
-    # get 1st value, the x location, for vert taper calcs    
-    vert_x = vert_orig[0]
-    # vert_z has the z value to be used in the 5th & 6th verts
-    # get value of 5th vert 
-    vert_temp = verts[5]
-    
-
-    
-    # calculate the amount of taper, updating vert_x
-    # with the new value calculated.
-    vert_x = calc_taper(vert_orig[0], vert_temp[0], taper)
-    
-    vert_new = (vert_x,vert_temp[1],vert_z)
-    
-    if debug:
-        print ("vert_orig = ",vert_orig[0])
-        print ("vert_x = ",vert_x)
-        print("vert_temp =",vert_temp)
-        print("vert_new =",vert_new)
-    
-    # update 6th vert with new value
-    verts[5] = vert_new    
-    
-    if debug:
-        print("\n adjust_c_beam_verts function ending")
-        print("verts =", verts)
-        
-    return verts        
-
-
-def calc_taper(outer_vert, inner_vert, taper):
-    # Calculate tapered edges of beam - inner vert is moved towards
-    #    outer vert based upon percentage value in taper
-    # outer_vert - the outside vertex
-    # inner_vert - the inside vertex to be moved
-    # taper - percentage to move vert
-    
-    # returns:
-    # adjusted_vert - the calculated vertex
-
-    #print("outer_vert =",outer_vert,"inner_vert",inner_vert)
-    
-    # taper values range from 0 to 100 for UI, but for calculations
-    # this value needs to be flipped, ranging from 100 to 0
-    taper = 100 - taper
-    
-    # calcuate taper & adjust vertex
-    vert_delta = inner_vert - outer_vert
-    adjusted_vert = outer_vert + ((vert_delta/100) * taper)    
-    
-    #print("adjusted_vert =", adjusted_vert)    
-    return adjusted_vert
-
-    
-def create_rectangular_beam(size, thick, debug):
-    # Creates a rectangular beam mesh object
-    # size - tuple of x,y,z dimensions of box
-    # thick - thickness, if not zero this is the thickness of a hollow 
-    #         box with inner faces inset from size dimensions
-    # debug - if true prints values from this function to console
-    
-    # returns: 
-    # verts_final - a list of tuples of the x, y, z, location of each vertice
-    # faces_final - a list of tuples of the vertices that make up each face  
-    
-    # Create temporarylists to hold vertices locations
-    verts_front_temp=[]
-    verts_back_temp=[]
-    
-    #calculate y offset from center for front vertices
-    y_off = size[1]/2 
-      
-        
-    # Create front vertices by calculation
-    verts_front_temp = calc_end_verts(size, y_off, thick, debug)
-    
-    # re-calculate y offset from center for back vertices
-    y_off = 0 - y_off
-    
-    # Create back vertices by calculation
-    verts_back_temp = calc_end_verts(size, y_off, thick, debug)
-    
-    # Combine all vertices into a final list of tuples
-    verts_final = verts_front_temp + verts_back_temp   
-           
-    # Print debug info to console
-    if debug:
-        print("\ncreate_multi_side_box Function Start")
-        print("\n Front vertices :", verts_front_temp)
-        print("\n Back vertices:", verts_back_temp)
-        print("\n All vertices:", verts_final)
-                      
-    # Create front face
-    faces_front_temp = []
-    verts_front_list = []
-    numofverts = len(verts_front_temp)
-    
-    # Build vertex list
-    for index in range(numofverts):
-        verts_front_list.append(index)
-       
-    faces_front_temp = create_end_faces(verts_front_list, thick, debug) 
-    
-    # Create back face
-    faces_back_temp = []
-    verts_back_list = []
-    numofverts = len(verts_back_temp)
-    
-    # Build vertex list
-    for index in range(numofverts):
-        verts_back_list.append(index + len(verts_back_temp))
-        
-    faces_back_temp = create_end_faces(verts_back_list, thick, debug)
-
-    # Create side faces
-    faces_side_temp = []
-    
-    # better code needed here???
-    if thick:
-        # Object has thickness, create list of outside vertices
-        numofverts = len(verts_front_list)
-        verts_front_temp = verts_front_list[0:int(numofverts/2)]
-        verts_back_temp = verts_back_list[0:int(numofverts/2)]
-        
-        faces_side_temp = create_side_faces(verts_front_temp, verts_back_temp, debug)
-        
-        # Create list of inside vertices
-        verts_front_temp = verts_front_list[int(numofverts/2):numofverts]
-        verts_back_temp = verts_back_list[int(numofverts/2):numofverts]
-        
-        faces_side_temp += create_side_faces(verts_front_temp, verts_back_temp, debug)            
-    else:
-        # Create list of only outside faces
-        faces_side_temp = create_side_faces(verts_front_list, verts_back_list, debug)
-    
-    # Combine all faces 
-    faces_final = faces_front_temp + faces_back_temp + faces_side_temp
-    
-    # print debug info to console   
-    if debug:
-        print("\ncreate_multi_side_box Function")
-        print("\nAll faces :",faces_final)
-        print("\ncreate_multi_side_box Function Ends\n\n")
-    
-    return verts_final, faces_final
-
-
-def create_C_beam(size, thick, taper, debug):
-    # Creates a C or U shaped mesh beam object 
-    # size - tuple of x,y,z dimensions of beam
-    # thick - thickness, the amount the inner faces will be
-    #           inset from size dimensions
-    # taper - % to taper outside edges by
-    # debug - if true prints values from this function to console
-    
-    # returns: 
-    # verts_final - a list of tuples of the x, y, z, location of each vertice
-    # faces_final - a list of tuples of the vertices that make up each face
-    
-    # print debug info to console
-    if debug:
-        print ("\ncreate_C_beam - function called")
-
-    # Get y offset of vertices from center
-    y_off = size[1] / 2
-    
-    # Create temporarylists to hold vertices locations
-    verts_front_temp=[]
-    verts_back_temp=[]
-    
-    # Create front vertices by calculation
-    verts_front_temp = calc_end_verts(size, y_off, thick, debug)
-    # Additional adjustment to the verts needed - 5th & 6th verts
-    # needed because the calc_end_verts creates a rectangluar beam
-    # the insides are inset, for a U channel we need the inside
-    # verts on the open end to match the z-loc of the outside verts 
-    verts_front_temp = adjust_c_beam_verts(verts_front_temp, taper, debug)       
-    
-    # recalculate y_off for other end vertices
-    y_off = 0 - y_off
-    
-    # Create back vertices by calculation
-    verts_back_temp = calc_end_verts(size, y_off, thick, debug)
-    # Additional adjustment to the verts needed - the z location
-    verts_back_temp = adjust_c_beam_verts(verts_back_temp, taper, debug)  
-    
-    # Combine all vertices into a final list of tuples
-    verts_final = verts_front_temp + verts_back_temp   
-  
-    # Print debug info to console
-    if debug:
-        print("\ncreate_C_beam function start")
-        print("\n Front vertices :", verts_front_temp)
-        print("\n Back vertices:", verts_back_temp)
-        print("\n All vertices:", verts_final)
-    
-    # Create front face
-    faces_front_temp = []
-    verts_front_list = []
-    numofverts = len(verts_front_temp)
-    
-    # Build vertex list
-    for index in range(numofverts):
-        verts_front_list.append(index)
-    # problem area   
-    faces_front_temp = create_end_faces(verts_front_list, thick, debug) 
-    # Remove 1st face - only 3 end faces needed
-    faces_front_temp = faces_front_temp[1:4]
-        
-    # Create back face
-    faces_back_temp = []
-    verts_back_list = []
-    numofverts = len(verts_back_temp)
-    
-    # Build vertex list
-    for index in range(numofverts):
-        verts_back_list.append(index + len(verts_back_temp))
-      
-    faces_back_temp = create_end_faces(verts_back_list, thick, debug)
-    # Remove 1st face - only 3 end faces needed
-    faces_back_temp = faces_back_temp[1:4]
-
-    # Create list of outside vertices for the 3 outside faces
-    numofverts = (len(verts_front_list))
-    verts_front_temp = verts_front_list[0:int(numofverts/2)]
-    verts_back_temp = verts_back_list[0:int(numofverts/2)]
-        
-    faces_side_temp = create_side_faces(verts_front_temp, verts_back_temp, debug)
-    # create_side_faces creates 4 outside faces, we only want 3
-    # so remove the 1st face
-    faces_side_temp  = faces_side_temp[1:]
-    
-    # Create list of inside vertices for the 3 inside faces
-    verts_front_temp = verts_front_list[int(numofverts/2):numofverts]
-    verts_back_temp = verts_back_list[int(numofverts/2):numofverts]
-        
-    faces_side_temp += create_side_faces(verts_front_temp, verts_back_temp, debug)
-    # create_side_faces creates 4 outside faces, we only want 3
-    # so remove the 1st face
-    faces_side_temp  = faces_side_temp[0:3] + faces_side_temp[4:]
-    
-    # fill in top two faces
-    faces_side_temp.append((0, 4, 12, 8))
-    faces_side_temp.append((5, 1, 9, 13))    
-    
-    # Combine all faces 
-    faces_final = faces_front_temp + faces_back_temp + faces_side_temp
-
-    # Print debug info to console
-    if debug:
-        print("\ncreate_C_beam function") 
-        print("\nAll faces =", faces_final)
-        print("\ncreate_C_beam function ending")
-         
-    return verts_final, faces_final
-
-
-def create_L_beam(size, thick, taper, debug):
-    # Creates a L shaped mesh beam object
-    # size - tuple of x,y,z dimensions of beam
-    # thick - thickness, the amount the inner faces will be
-    #           inset from size dimensions
-    # taper - % to taper outside edges by
-    # debug - if true prints values from this function to console
-    
-    # returns:
-    # verts_final - a list of tuples of the x, y, z, location of each vertice
-    # faces_final - a list of tuples of the vertices that make up each face
-    
-    if debug:
-        print("\ncreate_L_beam function starting")
-
-    # Get offset of vertices from center
-    x_off = size[0] / 2
-    y_off = size[1] / 2
-    z_off = size[2] / 2
-    
-    # Create temporarylists to hold vertices locations
-    verts_front_temp=[]
-    verts_back_temp=[]
-    
-    # Create front vertices by calculation
-    verts_front_temp = [(0 - x_off, 0 - y_off, z_off), \
-        (0 - (x_off - thick), 0 - y_off, z_off), \
-        (0 - (x_off - thick), 0 - y_off, 0 - (z_off - thick)), \
-        (x_off, 0 - y_off, 0 - (z_off - thick)), \
-        (x_off, 0 - y_off, 0 - z_off), \
-        (0 - x_off, 0 - y_off, 0 - z_off)]
-    
-    # Adjust taper
-    vert_outside = verts_front_temp[0]
-    vert_inside = verts_front_temp[1]
-    verts_front_temp[1] = [(calc_taper(vert_outside[0], vert_inside[0], taper)), vert_inside[1],vert_inside[2]]
-   
-    vert_outside = verts_front_temp[4]
-    vert_inside = verts_front_temp[3]
-    verts_front_temp[3] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    # Create back vertices by calculation
-    verts_back_temp = [(0 - x_off, y_off, z_off), \
-        (0 - (x_off - thick), y_off, z_off), \
-        (0 - (x_off - thick), y_off, 0 - (z_off - thick)), \
-        (x_off, y_off, 0 - (z_off - thick)), \
-        (x_off, y_off, 0 - z_off), \
-        (0 - x_off, y_off, 0 - z_off)]
-
-    # Adjust taper
-    vert_outside = verts_back_temp[0]
-    vert_inside = verts_back_temp[1]
-    verts_back_temp[1] = [(calc_taper(vert_outside[0], vert_inside[0], taper)), vert_inside[1],vert_inside[2]]   
-    
-    vert_outside = verts_back_temp[4]
-    vert_inside = verts_back_temp[3]
-    verts_back_temp[3] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))] 
-    
-    verts_final = verts_front_temp + verts_back_temp
-    
-    if debug:
-        print("\n verts_front_temp =", verts_front_temp)
-        print("\n verts_back_temp =", verts_back_temp)
-        print("\n verts_final =", verts_final)
-    
-    # define end faces, only 4 so just coded
-    faces_front_temp = []
-    faces_back_temp = []
-    faces_side_temp = []
-    
-    faces_front_temp = [(0, 1, 2, 5), (2, 3, 4, 5)]
-    faces_back_temp = [(6, 7, 8, 11), (8, 9, 10, 11)]
-    
-    verts_front_list = []
-    verts_back_list = []
-    num_of_verts = len(verts_front_temp)
-    
-    # build lists of back and front verts for create_side_faces function
-    for index in range(num_of_verts):
-        verts_front_list.append(index)
-    for index in range(num_of_verts):
-        verts_back_list.append(index  + 6)
-    
-    faces_side_temp = create_side_faces(verts_front_list, verts_back_list, debug)
-        
-    faces_final = faces_front_temp + faces_back_temp + faces_side_temp
-    
-    if debug:
-        print("\n faces_front_temp =", faces_front_temp)
-        print("\n faces_back_temp =", faces_back_temp)
-        print("\n faces_side_temp =", faces_side_temp)
-        print("\n faces_final =", faces_final)
-        print("\ncreate_L_beam function ending")
-        
-    return verts_final, faces_final
-
-
-
-def create_T_beam(size, thick, taper, debug):
-    # Creates a T shaped mesh beam object
-    # size - tuple of x,y,z dimensions of beam
-    # thick - thickness, the amount the inner faces will be
-    #           inset from size dimensions
-    # taper - % to taper outside edges by
-    # debug - if true prints values from this function to console
-    
-    # returns:
-    # verts_final - a list of tuples of the x, y, z, location of each vertice
-    # faces_final - a list of tuples of the vertices that make up each face
-    debug = 0
-    
-    if debug:
-        print("\ncreate_T_beam function starting")
-
-    # Get offset of vertices from center
-    x_off = size[0] / 2
-    y_off = size[1] / 2
-    z_off = size[2] / 2
-    thick_off = thick / 2
-
-    # Create temporarylists to hold vertices locations
-    verts_front_temp=[]
-    verts_back_temp=[]
-    
-    # Create front vertices by calculation
-    verts_front_temp = [(0 - x_off, 0 - y_off, z_off), \
-        (0 - thick_off, 0 - y_off, z_off), \
-        (thick_off, 0 - y_off, z_off), \
-        (x_off, 0 - y_off, z_off), \
-        (x_off, 0 - y_off, z_off - thick), \
-        (thick_off, 0 - y_off, z_off - thick), \
-        (thick_off, 0 - y_off, 0 - z_off), \
-        (0 - thick_off, 0 - y_off, 0 - z_off), \
-        (0 - thick_off, 0 - y_off, z_off - thick), \
-        (0 - x_off, 0 - y_off, z_off - thick)]
-
-    # Adjust taper
-    vert_outside = verts_front_temp[0]
-    vert_inside = verts_front_temp[9]
-    verts_front_temp[9] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-
-    vert_outside = verts_front_temp[3]
-    vert_inside = verts_front_temp[4]
-    verts_front_temp[4] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]  
-
-    # Adjust taper of bottom of beam, so 0 the center
-    # now becomes vert_outside, and vert_inside is calculated
-    # 1/2 way towards center
-    vert_outside = (0, 0 - y_off, 0 - z_off)
-    vert_inside = verts_front_temp[6]
-    verts_front_temp[6] = [(calc_taper(vert_outside[0], vert_inside[0], taper)), vert_inside[1], vert_inside[2]]  
-
-    vert_outside = (0, 0 - y_off, 0 - z_off)
-    vert_inside = verts_front_temp[7]
-    verts_front_temp[7] = [(calc_taper(vert_outside[0], vert_inside[0], taper)), vert_inside[1], vert_inside[2]]
-
-    # Create fack vertices by calculation
-    verts_back_temp = [(0 - x_off, y_off, z_off), \
-        (0 - thick_off, y_off, z_off), \
-        (thick_off, y_off, z_off), \
-        (x_off, y_off, z_off), \
-        (x_off, y_off, z_off - thick), \
-        (thick_off, y_off, z_off - thick), \
-        (thick_off, y_off, 0 - z_off), \
-        (0 - thick_off, y_off, 0 - z_off), \
-        (0 - thick_off, y_off, z_off - thick), \
-        (0 - x_off, y_off, z_off - thick)]
-
-    # Adjust taper
-    vert_outside = verts_back_temp[0]
-    vert_inside = verts_back_temp[9]
-    verts_back_temp[9] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-
-    vert_outside = verts_back_temp[3]
-    vert_inside = verts_back_temp[4]
-    verts_back_temp[4] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    # Adjust taper of bottom of beam, so 0 the center
-    # now becomes vert_outside, and vert_inside is calculated
-    # 1/2 way towards center
-    vert_outside = (0, 0 - y_off, 0 - z_off)
-    vert_inside = verts_back_temp[6]
-    verts_back_temp[6] = [(calc_taper(vert_outside[0], vert_inside[0], taper)), vert_inside[1], vert_inside[2]]  
-
-    vert_outside = (0, 0 - y_off, 0 - z_off)
-    vert_inside = verts_back_temp[7]
-    verts_back_temp[7] = [(calc_taper(vert_outside[0], vert_inside[0], taper)), vert_inside[1], vert_inside[2]]
-        
-    verts_final = verts_front_temp + verts_back_temp
-    
-    
-    # define end faces, only 8 so just coded
-    faces_front_temp = []
-    faces_back_temp = []
-    faces_side_temp = []
-    
-    faces_front_temp = [(0, 1, 8, 9), (1, 2, 5, 8), \
-        (2, 3, 4, 5), (5, 6, 7, 8)]
-        
-    faces_back_temp = [(10, 11, 18, 19), (11, 12, 15, 18), \
-        (12, 13, 14, 15), (15, 16, 17,  18)]
-
-    verts_front_list = []
-    verts_back_list = []
-    num_of_verts = len(verts_front_temp)
-    
-    # build lists of back and front verts for create_side_faces function
-    for index in range(num_of_verts):
-        verts_front_list.append(index)
-    for index in range(num_of_verts):
-        verts_back_list.append(index  + 10)
-    
-    faces_side_temp = create_side_faces(verts_front_list, verts_back_list, debug)
-    
-    faces_final = faces_front_temp + faces_back_temp + faces_side_temp
-
-    if debug:
-        print("\ncreate_T_beam function ending")    
-        
-    return verts_final, faces_final
-
-
-def create_I_beam(size, thick, taper, debug):
-    # Creates a T shaped mesh beam object
-    # size - tuple of x,y,z dimensions of beam
-    # thick - thickness, the amount the inner faces will be
-    #           inset from size dimensions
-    # taper - % to taper outside edges by
-    # debug - if true prints values from this function to console
-    
-    # returns:
-    # verts_final - a list of tuples of the x, y, z, location of each vertice
-    # faces_final - a list of tuples of the vertices that make up each face
-    debug = 0
-    
-    if debug:
-        print("\ncreate_I_beam function starting")
-
-    # Get offset of vertices from center
-    x_off = size[0] / 2
-    y_off = size[1] / 2
-    z_off = size[2] / 2
-    thick_off = thick / 2
-
-    # Create temporarylists to hold vertices locations
-    verts_front_temp=[]
-    verts_back_temp=[]
-    
-    # Create front vertices by calculation
-    verts_front_temp = [(0 - x_off, 0 - y_off, z_off), \
-        (0 - thick_off, 0 - y_off, z_off), \
-        (thick_off, 0 - y_off, z_off), \
-        (x_off, 0 - y_off, z_off), \
-        (x_off, 0 - y_off, z_off - thick), \
-        (thick_off, 0 - y_off, z_off - thick), \
-        (thick_off, 0 - y_off, 0 - z_off + thick), \
-        (x_off, 0 - y_off, 0 - z_off + thick), \
-        (x_off, 0 - y_off, 0 - z_off), \
-        (thick_off, 0 - y_off, 0 - z_off), \
-        (0 - thick_off, 0 - y_off, 0 - z_off), \
-        (0 - x_off, 0 - y_off, 0 - z_off), \
-        (0 - x_off, 0 - y_off, 0 -z_off  + thick), \
-        (0 - thick_off, 0 - y_off, 0 - z_off + thick), \
-        (0 - thick_off, 0 - y_off, z_off - thick), \
-        (0 - x_off, 0 - y_off, z_off - thick)]
-    
-    # Adjust taper
-    vert_outside = verts_front_temp[0]
-    vert_inside = verts_front_temp[15]
-    verts_front_temp[15] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    vert_outside = verts_front_temp[3]
-    vert_inside = verts_front_temp[4]
-    verts_front_temp[4] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    vert_outside = verts_front_temp[8]
-    vert_inside = verts_front_temp[7]
-    verts_front_temp[7] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    vert_outside = verts_front_temp[11]
-    vert_inside = verts_front_temp[12]
-    verts_front_temp[12] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-
-    # Create back vertices by calculation
-    verts_back_temp = [(0 - x_off, y_off, z_off), \
-        (0 - thick_off, y_off, z_off), \
-        (thick_off, y_off, z_off), \
-        (x_off, y_off, z_off), \
-        (x_off, y_off, z_off - thick), \
-        (thick_off, y_off, z_off - thick), \
-        (thick_off, y_off, 0 - z_off + thick), \
-        (x_off, y_off, 0 - z_off + thick), \
-        (x_off, y_off, 0 - z_off), \
-        (thick_off, y_off, 0 - z_off), \
-        (0 - thick_off, y_off, 0 - z_off), \
-        (0 - x_off, y_off, 0 - z_off), \
-        (0 - x_off, y_off, 0 -z_off  + thick), \
-        (0 - thick_off, y_off, 0 - z_off + thick), \
-        (0 - thick_off, y_off, z_off - thick), \
-        (0 - x_off, y_off, z_off - thick)]
-
-    # Adjust taper
-    vert_outside = verts_back_temp[0]
-    vert_inside = verts_back_temp[15]
-    verts_back_temp[15] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    vert_outside = verts_back_temp[3]
-    vert_inside = verts_back_temp[4]
-    verts_back_temp[4] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    vert_outside = verts_back_temp[8]
-    vert_inside = verts_back_temp[7]
-    verts_back_temp[7] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]
-    
-    vert_outside = verts_back_temp[11]
-    vert_inside = verts_back_temp[12]
-    verts_back_temp[12] = [vert_inside[0], vert_inside[1], (calc_taper(vert_outside[2], vert_inside[2], taper))]       
- 
-    verts_final = verts_front_temp + verts_back_temp
-
-
-# define end faces, only 7 per end, so just coded
-    faces_front_temp = []
-    faces_back_temp = []
-    faces_side_temp = []
-    
-    faces_front_temp = [(0, 1, 14, 15), (1, 2, 5, 14), \
-        (2, 3, 4, 5), (6, 7, 8, 9), \
-        (6, 9, 10, 13), (12, 13, 10, 11), \
-        (5, 6, 13, 14)]
-        
-    faces_back_temp = [(16, 17, 30, 31), (17, 18, 21, 30), \
-        (18, 19, 20, 21), (22, 23, 24, 25), \
-        (22, 25, 26, 29), (28, 29, 26, 27), \
-        (21, 22, 29, 30)]
-        
-    verts_front_list = []
-    verts_back_list = []
-    num_of_verts = len(verts_front_temp)
-    
-    # build lists of back and front verts for create_side_faces function
-    for index in range(num_of_verts):
-        verts_front_list.append(index)
-    for index in range(num_of_verts):
-        verts_back_list.append(index  + 16)
-    
-    faces_side_temp = create_side_faces(verts_front_list, verts_back_list, debug)
-    
-    faces_final = faces_front_temp + faces_back_temp + faces_side_temp   
-    
-    if debug:
-        print("\ncreate_I_beam function ending")
-    
-    return verts_final, faces_final
-
-        
-
-# Define "Add_Rectangular_Beam" operator
-########### Needs Work ###############        
-class Add_Rectangular_Beam(bpy.types.Operator):
-    
-    bl_idname = "mesh.primitive_rectangle_add"
-    bl_label = "Add Rectangluar Beam"
-    bl_description = "Create a Rectangular Beam mesh"
-    bl_options = {'REGISTER', 'UNDO'}
-        
-    mesh_z_size = bpy.props.FloatProperty(name = "Height(z)",
-        description = "Height (along the z-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 1)
-        
-    mesh_x_size = bpy.props.FloatProperty(name = "Width(x)",
-        description = "Width (along the x-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = .5)
-        
-    mesh_y_size = bpy.props.FloatProperty(name = "Length(y)",
-        description = "Length (along y-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 2)
-            
-    thick_bool = bpy.props.BoolProperty(name = "Hollow",
-        description = "Create a hollow mesh with a defined thickness",
-        default = True)
-
-    thick = bpy.props.FloatProperty(name = "Thickness",
-        description = "Thickness of hollow mesh",
-        min = 0.01,
-        max = 1,
-        default = 0.1)
-        
-    # generic transform props
-    # required by object_utils.py - part of blender's
-    # code and is what handles alignment amongst other
-    # things.
-    view_align = bpy.props.BoolProperty(
-            name="Align to View",
-            default=False
-            )
-    location = bpy.props.FloatVectorProperty(
-            name="Location",
-            subtype='TRANSLATION',
-            )
-    rotation = bpy.props.FloatVectorProperty(
-            name="Rotation",
-            subtype='EULER',
-            )
-            
-    # Define tool parameter layout
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, 'mesh_z_size')
-        layout.prop(self, 'mesh_x_size')
-        layout.prop(self, 'mesh_y_size')
-        layout.prop(self, 'thick_bool')
-        if self.thick_bool:
-            layout.prop(self, 'thick')
-        layout.prop(self, 'view_align')
-        col = layout.column()
-        col.prop(self, 'location')
-        col.prop(self, 'rotation')
-                
-    def execute(self, context):
-        # debug flag - True prints debug info to console
-        debug = 0
-        
-        size = (self.mesh_x_size, self.mesh_y_size, self.mesh_z_size)
-        if self.thick_bool is True:
-            thick = self.thick
-        else:
-            thick = 0
-                        
-        verts, faces = create_rectangular_beam(size, thick, debug)
-            
-        if debug:
-            print("\nCreated Verts:", verts)
-            print("\nCreated Faces:", faces)
-                
-        create_mesh(self, context, "Rectangular Beam", verts, faces, debug)
-        
-        recalc_normals(debug)        
-        
-        return {'FINISHED'}
-
-'''
-    def invoke(self, context, event):
-        #self.align_matrix = align_matrix(context)
-        self.execute(context)
-        return {'FINISHED'}    
-'''
-
-
-# Define "Add_C_Beam" operator        
-class Add_C_Beam(bpy.types.Operator):
-    
-    bl_idname = "mesh.primitive_c_beam_add"
-    bl_label = "Add C or U Channel"
-    bl_description = "Create a C or U channel mesh"
-    bl_options = {'REGISTER', 'UNDO'}
-    
-        
-    mesh_z_size = bpy.props.FloatProperty(name = "Height(z)",
-        description = "Height (along the z-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 1)
-        
-    mesh_x_size = bpy.props.FloatProperty(name = "Width(x)",
-        description = "Width (along the x-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = .5)
-        
-    mesh_y_size = bpy.props.FloatProperty(name = "Length(y)",
-        description = "Length (along y-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 2)
-
-    thick = bpy.props.FloatProperty(name = "Thickness",
-        description = "Thickness of mesh",
-        min = 0.01,
-        max = 1,
-        default = 0.1)
-
-    taper = bpy.props.IntProperty(name = "Taper",
-        description = "Percentage to taper outside edges, 0 = no taper, 100 = full taper",
-        min = 0,
-        max = 100,
-        default = 0)        
-
-    type = bpy.props.BoolProperty(name = "U-shaped",
-        description = "Create the beam in a U orientation rather than the defualt C orientation", 
-        default = True)
-                
-    # generic transform props
-    # required by object_utils.py - part of blender's
-    # code and is what handles alignment amongst other
-    # things.
-    view_align = bpy.props.BoolProperty(
-            name="Align to View",
-            default=False
-            )
-    location = bpy.props.FloatVectorProperty(
-            name="Location",
-            subtype='TRANSLATION',
-            )
-    rotation = bpy.props.FloatVectorProperty(
-            name="Rotation",
-            subtype='EULER',
-            )
-
-    # Define tool parameter layout
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, 'mesh_z_size')
-        layout.prop(self, 'mesh_x_size')
-        layout.prop(self, 'mesh_y_size')
-        layout.prop(self, 'thick')
-        layout.prop(self, 'taper')
-        layout.prop(self, 'type')
-        layout.prop(self, 'view_align')
-        col = layout.column()
-        col.prop(self, 'location')
-        col.prop(self, 'rotation')
-        
-                
-    def execute(self, context):
-        # debug flag - True prints debug info to console
-        debug = 0
-        
-        # if type == true beam is U chanel, otherwise it's a C
-        if self.type:
-            size = (self.mesh_x_size, self.mesh_y_size, self.mesh_z_size)
-            mesh_name = "U Beam"
-        else:
-            size = (self.mesh_z_size, self.mesh_y_size, self.mesh_x_size)
-            mesh_name = "C Beam"
-                        
-        verts, faces = create_C_beam(size, self.thick, self.taper, debug)      
-
-        if debug:
-            print("\nCreated Verts:", verts)
-            print("\nCreated Faces:", faces)
-                
-        create_mesh(self, context, mesh_name, verts, faces, debug)
-        
-        recalc_normals(debug)
-           
-        if not self.type:
-        # C-type beam is actually created as a u-type beam
-        # so rotate 90 degrees on y-axis to make a c-type
-        # and apply rotation to reset those values
-        # if self.type is true, do nothing as beam is alreay u-type.
-        # rotation value is in radians
-            bpy.ops.transform.rotate(value=[1.570796], constraint_axis=[False, True, False])
-            bpy.ops.object.transform_apply(location=False, rotation =True, scale=False)
-        
-        return {'FINISHED'}
-
-'''
-    def invoke(self, context, event):
-        #self.align_matrix = align_matrix(context)
-        self.execute(context)
-        return {'FINISHED'}
-'''
-    
-
-# Define "Add_L_Beam" operator    
-class Add_L_Beam(bpy.types.Operator):
-    
-    bl_idname = "mesh.primitive_l_beam_add"
-    bl_label = "Add L Beam"
-    bl_description = "Create a L shaped mesh"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    mesh_z_size = bpy.props.FloatProperty(name = "Height(z)",
-        description = "Height (along the z-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 1)
-        
-    mesh_x_size = bpy.props.FloatProperty(name = "Width(x)",
-        description = "Width (along the x-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = .5)
-        
-    mesh_y_size = bpy.props.FloatProperty(name = "Length(y)",
-        description = "Length (along y-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 2)
-
-    thick = bpy.props.FloatProperty(name = "Thickness",
-        description = "Thickness of mesh",
-        min = 0.01,
-        max = 1,
-        default = 0.1)
-
-    taper = bpy.props.IntProperty(name = "Taper",
-        description = "Percentage to taper outside edges, 0 = no taper, 100 = full taper",
-        min = 0,
-        max = 100,
-        default = 0)
-
-    # generic transform props
-    # required by object_utils.py - part of blender's
-    # code and is what handles alignment amongst other
-    # things.
-    view_align = bpy.props.BoolProperty(
-            name="Align to View",
-            default=False
-            )
-    location = bpy.props.FloatVectorProperty(
-            name="Location",
-            subtype='TRANSLATION',
-            )
-    rotation = bpy.props.FloatVectorProperty(
-            name="Rotation",
-            subtype='EULER',
-            )
-
-    # Define tool parameter layout
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, 'mesh_z_size')
-        layout.prop(self, 'mesh_x_size')
-        layout.prop(self, 'mesh_y_size')
-        layout.prop(self, 'thick')
-        layout.prop(self, 'taper')
-        layout.prop(self, 'view_align')
-        col = layout.column()
-        col.prop(self, 'location')
-        col.prop(self, 'rotation')
-        
-
-    def execute(self, context):
-        # debug flag - True prints debug info to console
-        debug = 0 
-        
-        size = (self.mesh_x_size, self.mesh_y_size, self.mesh_z_size)
-                           
-        verts, faces = create_L_beam(size, self.thick, self.taper, debug)
-        
-        if debug:
-            print("\nCreated Verts:", verts)
-            print("\nCreated Faces:", faces)
-                
-        create_mesh(self, context, "L Beam", verts, faces, debug)
-        
-        recalc_normals(debug) 
-        
-        return {'FINISHED'}
-
-'''
-    def invoke(self, context, event):
-        self.align_matrix = align_matrix(context)
-        self.execute(context)
-        return {'FINISHED'}
-'''
-    
-    
-# Define "Add_T_Beam" operator    
-class Add_T_Beam(bpy.types.Operator):
-    
-    bl_idname = "mesh.primitive_t_beam_add"
-    bl_label = "Add T Beam"
-    bl_description = "Create a T shaped mesh"
-    bl_options = {'REGISTER', 'UNDO'}    
-
-    mesh_z_size = bpy.props.FloatProperty(name = "Height(z)",
-        description = "Height (along the z-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 1)
-        
-    mesh_x_size = bpy.props.FloatProperty(name = "Width(x)",
-        description = "Width (along the x-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = .5)
-        
-    mesh_y_size = bpy.props.FloatProperty(name = "Length(y)",
-        description = "Length (along y-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 2)
-
-    thick = bpy.props.FloatProperty(name = "Thickness",
-        description = "Thickness of mesh",
-        min = 0.01,
-        max = 1,
-        default = 0.1)
-
-    taper = bpy.props.IntProperty(name = "Taper",
-        description = "Percentage to taper outside edges, 0 = no taper, 100 = full taper",
-        min = 0,
-        max = 100,
-        default = 0)
-
-    # generic transform props
-    # required by object_utils.py - part of blender's
-    # code and is what handles alignment amongst other
-    # things.
-    view_align = bpy.props.BoolProperty(
-            name="Align to View",
-            default=False
-            )
-    location = bpy.props.FloatVectorProperty(
-            name="Location",
-            subtype='TRANSLATION',
-            )
-    rotation = bpy.props.FloatVectorProperty(
-            name="Rotation",
-            subtype='EULER',
-            )
-
-    # Define tool parameter layout
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, 'mesh_z_size')
-        layout.prop(self, 'mesh_x_size')
-        layout.prop(self, 'mesh_y_size')
-        layout.prop(self, 'thick')
-        layout.prop(self, 'taper')
-        layout.prop(self, 'view_align')
-        col = layout.column()
-        col.prop(self, 'location')
-        col.prop(self, 'rotation')
-
-
-    def execute(self, context):
-        # debug flag - True prints debug info to console
-        debug = 0
-        
-        size = (self.mesh_x_size, self.mesh_y_size, self.mesh_z_size)
-                           
-        verts, faces = create_T_beam(size, self.thick, self.taper, debug)
-        
-        if debug:
-            print("\nCreated Verts:", verts)
-            print("\nCreated Faces:", faces)
-                
-        create_mesh(self, context, "T Beam", verts, faces, debug)
-        
-        recalc_normals(debug) 
-        
-        return {'FINISHED'}
-
-'''
-    def invoke(self, context, event):
-        self.align_matrix = align_matrix(context)
-        self.execute(context)
-        return {'FINISHED'}
-'''
-    
-    
-# Define "Add_I_Beam" operator    
-class Add_I_Beam(bpy.types.Operator):
-    
-    bl_idname = "mesh.primitive_i_beam_add"
-    bl_label = "Add I Beam"
-    bl_description = "Create a I shaped mesh"
-    bl_options = {'REGISTER', 'UNDO'}    
-
-    mesh_z_size = bpy.props.FloatProperty(name = "Height(z)",
-        description = "Height (along the z-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 1)
-        
-    mesh_x_size = bpy.props.FloatProperty(name = "Width(x)",
-        description = "Width (along the x-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = .5)
-        
-    mesh_y_size = bpy.props.FloatProperty(name = "Length(y)",
-        description = "Length (along y-axis) of mesh",
-        min = 0.01,
-        max = 100,
-        default = 2)
-
-    thick = bpy.props.FloatProperty(name = "Thickness",
-        description = "Thickness of mesh",
-        min = 0.01,
-        max = 1,
-        default = 0.1)
-
-    taper = bpy.props.IntProperty(name = "Taper",
-        description = "Percentage to taper outside edges, 0 = no taper, 100 = full taper",
-        min = 0,
-        max = 100,
-        default = 0)
-
-    # generic transform props
-    # required by object_utils.py - part of blender's
-    # code and is what handles alignment amongst other
-    # things.
-    view_align = bpy.props.BoolProperty(
-            name="Align to View",
-            default=False
-            )
-    location = bpy.props.FloatVectorProperty(
-            name="Location",
-            subtype='TRANSLATION',
-            )
-    rotation = bpy.props.FloatVectorProperty(
-            name="Rotation",
-            subtype='EULER',
-            )
-    
-    # Define tool parameter layout
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, 'mesh_z_size')
-        layout.prop(self, 'mesh_x_size')
-        layout.prop(self, 'mesh_y_size')
-        layout.prop(self, 'thick')
-        layout.prop(self, 'taper')
-        layout.prop(self, 'view_align')
-        col = layout.column()
-        col.prop(self, 'location')
-        col.prop(self, 'rotation')
-        
-
-    def execute(self, context):
-        # debug flag - True prints debug info to console
-        debug = 0
-        
-        size = (self.mesh_x_size, self.mesh_y_size, self.mesh_z_size)
-                           
-        verts, faces = create_I_beam(size, self.thick, self.taper, debug)
-        
-        if debug:
-            print("\nCreated Verts:", verts)
-            print("\nCreated Faces:", faces)
-                
-        create_mesh(self, context, "I Beam", verts, faces, debug)
-        
-        recalc_normals(debug) 
-        
-        return {'FINISHED'}
-
-
-'''
-    def invoke(self, context, event):
-        self.align_matrix = align_matrix(context)
-        self.execute(context)
-        return {'FINISHED'}    
-'''
-
-
-# Register all operators and define menus
-
-class INFO_MT_mesh_beambuilder_add(bpy.types.Menu):
-    # Define the "Beam Builder" menu
-    bl_idname = "INFO_MT_mesh_beambuilder_add"
-    bl_label = "Beam Builder"
-    
-    def draw(self, context):
-        layout = self.layout  
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.operator("mesh.primitive_rectangle_add", text = "Rectangluar Beam")  
-        layout.operator("mesh.primitive_c_beam_add", text = "C or U Channel")
-        layout.operator("mesh.primitive_l_beam_add", text = "L Shaped Beam")
-        layout.operator("mesh.primitive_t_beam_add", text = "T Shaped Beam")
-        layout.operator("mesh.primitive_i_beam_add", text = "I Shaped Beam")
-        
-        
-    
-# Define menu    
-def menu_func(self, context):
-    self.layout.menu("INFO_MT_mesh_beambuilder_add", icon='PLUGIN')
-
-
-# Add     
-def register():
-    bpy.utils.register_module(__name__)
-    
-    # Add BeamBuilder menu to the 'Add Mesh' menu
-    bpy.types.INFO_MT_mesh_add.append(menu_func)
-
- 
-# Remove 
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    
-    # Remove BeamBuilder menu from 'Add Mesh' menu
-    bpy.types.INFO_MT_mesh_add.remove(menu_func)
-
- 
-if __name__ == "__main__":
-    register() 
-     
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_sove.py b/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_sove.py
deleted file mode 100644
index b922239..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_sove.py
+++ /dev/null
@@ -1,222 +0,0 @@
-'''bl_info = {
-    "name": "Sove",
-    "author": "SayPRODUCTIONS",
-    "version": (1, 0),
-    "blender": (2, 59, 0),
-    "api": 33333,
-    "location": "View3D > Add > Mesh > Say3D",
-    "description": "Sove Framema",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Add Mesh"}
-	'''
-import bpy
-from bpy.props import *
-from bpy_extras.object_utils import object_data_add
-from mathutils import Vector
-import operator
-from math import pi, sin, cos, sqrt, atan
-
-def MSVE():
-    if 'Sove' not in bpy.data.materials:
-        mtl=bpy.data.materials.new('Sove')
-        mtl.diffuse_color     = (0.44,0.52,0.64)
-        mtl.diffuse_shader    = 'LAMBERT' 
-        mtl.diffuse_intensity = 1.0 
-    else:
-        mtl=bpy.data.materials['Sove']
-    return mtl
-def Prs(self,v1,v2,v3,v4,v5,v6,v7,v8,v9,fg,fh,fd,
-        f0,f1,f2,f3,f4,f5,f6,f7,f8,f9):
-    self.gen=v1;self.knr=v2;self.yuk=v3
-    self.alt=v4;self.ust=v5;self.sdr=v6
-    self.pdr=v7;self.dh =v8;self.dr =v9
-    self.fg =fg;self.fh =fh;self.fd =fd
-    self.f0 =f0;self.f1 =f1;self.f2 =f2;self.f3=f3;self.f4=f4
-    self.f5 =f5;self.f6 =f6;self.f7 =f7;self.f8=f8;self.f9=f9
-def add_object(self, context):
-    fc=[];vr=[]
-    mx =self.gen/200;my =self.yuk/100;k1=self.knr/100;dh=self.dh/100;fd=self.fd/100;fh=self.fh/100
-    alt=self.alt/100;ust=my-self.ust/100;drn=-self.sdr/100;pdr=self.pdr/100
-    vr.append([-mx-k1,  0,  0]);vr.append([ mx+k1,  0,  0]);vr.append([ mx+k1,  0, my]);vr.append([-mx-k1,  0, my])
-    vr.append([-mx,   pdr,alt]);vr.append([ mx,   pdr,alt]);vr.append([ mx,   pdr,ust]);vr.append([-mx,   pdr,ust])
-    vr.append([-mx-k1,drn,  0]);vr.append([ mx+k1,drn,  0]);vr.append([ mx+k1,drn, my]);vr.append([-mx-k1,drn, my])
-    vr.append([-mx,   drn,alt]);vr.append([ mx,   drn,alt]);vr.append([ mx,   drn,ust]);vr.append([-mx,   drn,ust])
-    fc.append([ 8, 0, 1, 9]);fc.append([ 8, 9,13,12])
-    fc.append([12,13, 5, 4]);fc.append([11,10, 2, 3])
-    if self.fg==0:
-        fc.append([ 0, 8,11, 3]);fc.append([ 8,12,15,11]);fc.append([12, 4, 7,15])
-        fc.append([ 5,13,14, 6]);fc.append([13, 9,10,14]);fc.append([ 9, 1, 2,10])
-    else:
-        fc.append([11, 3,16,17]);fc.append([15,11,17,18]);fc.append([ 7,15,18,24])
-        fc.append([25,19,14, 6]);fc.append([19,20,10,14]);fc.append([20,21, 2,10])
-        ou=self.fg*12
-        fc.append([4,7,12+ou,24+ou]);fc.append([6,5,25+ou,13+ou])
-    z=my
-    for i in range(self.fg):
-        if i==0:z-=self.f0/100
-        if i==1:z-=self.f1/100
-        if i==2:z-=self.f2/100
-        if i==3:z-=self.f3/100
-        if i==4:z-=self.f4/100
-        if i==5:z-=self.f5/100
-        if i==6:z-=self.f6/100
-        if i==7:z-=self.f7/100
-        if i==8:z-=self.f8/100
-        if i==9:z-=self.f9/100
-        vr.append([   -mx-k1,     0,z]);vr.append([   -mx-k1,   drn,z]);vr.append([     -mx,   drn,z])
-        vr.append([       mx,   drn,z]);vr.append([    mx+k1,   drn,z]);vr.append([   mx+k1,     0,z])
-        vr.append([-mx-k1+fd,     0,z]);vr.append([-mx-k1+fd,drn+fd,z]);vr.append([     -mx,drn+fd,z])
-        vr.append([       mx,drn+fd,z]);vr.append([ mx+k1-fd,drn+fd,z]);vr.append([mx+k1-fd,     0,z])
-        z-=fh
-        vr.append([   -mx-k1,     0,z]);vr.append([   -mx-k1,   drn,z]);vr.append([     -mx,   drn,z])
-        vr.append([       mx,   drn,z]);vr.append([    mx+k1,   drn,z]);vr.append([   mx+k1,     0,z])
-        vr.append([-mx-k1+fd,     0,z]);vr.append([-mx-k1+fd,drn+fd,z]);vr.append([     -mx,drn+fd,z])
-        vr.append([       mx,drn+fd,z]);vr.append([ mx+k1-fd,drn+fd,z]);vr.append([mx+k1-fd,     0,z])
-        n=len(vr)
-        fc.append([n- 1,n- 2,n- 8,n- 7]);fc.append([n- 3,n- 9,n- 8,n- 2]);fc.append([n- 2,n- 1,n-13,n-14])
-        fc.append([n- 3,n- 2,n-14,n-15]);fc.append([n-15,n-14,n-20,n-21]);fc.append([n-14,n-13,n-19,n-20])
-        fc.append([n- 4,n- 5,n-11,n-10]);fc.append([n- 5,n- 6,n-12,n-11]);fc.append([n- 5,n- 4,n-16,n-17])
-        fc.append([n- 6,n- 5,n-17,n-18]);fc.append([n-24,n-18,n-17,n-23]);fc.append([n-23,n-17,n-16,n-22])
-        if self.fg>1:
-            if self.fg%2==0:
-                if i < self.fg/2:fc.append([7,n-16,n-4]);fc.append([6,n-3,n-15])
-                if i+1<self.fg/2:fc.append([7,n- 4,n+8]);fc.append([6,n+9,n- 3])
-                if i+1>self.fg/2:fc.append([4,n-16,n-4]);fc.append([5,n-3,n-15])
-                if i+1>self.fg/2 and i+1<self.fg:fc.append([4,n-4,n+8]);fc.append([5,n+9,n-3])
-            else:
-                if i<self.fg//2:
-                    fc.append([7,n-16,n-4]);fc.append([6,n-3,n-15])
-                    fc.append([7,n- 4,n+8]);fc.append([6,n+9,n- 3])
-                if i > self.fg//2:fc.append([4,n-16,n-4]);fc.append([5,n-3,n-15])
-                if i+1>self.fg//2 and i+1<self.fg:fc.append([4,n- 4,n+8]);fc.append([5,n+9,n-3])
-        if i<self.fg-1 and self.fg>1:
-            fc.append([n- 7,n- 8,n+4,n+5]);fc.append([n- 8,n- 9,n+3,n+4]);fc.append([n-9,n- 3,n+9,n+3])
-            fc.append([n-10,n-11,n+1,n+2]);fc.append([n-11,n-12, n ,n+1]);fc.append([n-4,n-10,n+2,n+8])
-        if i==self.fg-1:
-            fc.append([0, 8,n-11,n-12]);fc.append([ 8,12,n-10,n-11]);fc.append([12,4,n-4,n-10])
-            fc.append([5,13,n- 9,n- 3]);fc.append([13, 9,n- 8,n- 9]);fc.append([ 9,1,n-7,n- 8])
-    SM=[]
-    #Duz----------------
-    if self.dr==False:
-        fc.append([14,10,11,15]);fc.append([6,14,15,7])
-    #Yuvarlak-----------
-    else:        
-        if dh>mx:dh=mx;self.dh=mx*100
-        vr[ 6][2]-=dh;vr[ 7][2]-=dh
-        vr[14][2]-=dh;vr[15][2]-=dh
-        O=mx/dh
-        H1=sqrt(mx**2+dh**2)/2
-        H2=H1*O
-        R=sqrt(H1**2+H2**2)
-        M=ust-R
-        A=pi-atan(O)*2
-        for a in range(1,24):
-            p=(a*A/12)+(pi*1.5)-A
-            vr.append([cos(p)*R,pdr,M-sin(p)*R])
-            vr.append([cos(p)*R,drn,M-sin(p)*R])
-            n=len(vr)
-            if a==1:
-                fc.append([n-1,15,7,n-2])
-                SM.append(len(fc))
-                fc.append([15,n-1,11])
-            elif a<23:
-                fc.append([n-1,n-3,n-4,n-2])
-                SM.append(len(fc))
-                if a<13:   fc.append([n-3,n-1,11])
-                elif a==13:fc.append([n-3,n-1,10,11])
-                else:      fc.append([n-3,n-1,10])
-            elif a==23:
-                fc.append([n-1,n-3,n-4,n-2])
-                SM.append(len(fc))
-                fc.append([n-3,n-1,10])
-                fc.append([14,n-1,n-2,6])
-                SM.append(len(fc))
-                fc.append([n-1,14,10])
-#OBJE -----------------------------------------------------------
-    mesh = bpy.data.meshes.new(name='Sove')
-    bpy.data.objects.new('Sove', mesh)
-    mesh.from_pydata(vr,[],fc)
- #   for i in SM:
- #       mesh.faces[i-1].shade_smooth()
-    mesh.materials.append(MSVE())
-    mesh.update(calc_edges=True)
-    object_data_add(context, mesh, operator=None)
-    if bpy.context.mode != 'EDIT_MESH':
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.object.editmode_toggle()
-#----------------------------------------------------------------
-class OBJECT_OT_add_object(bpy.types.Operator):
-    bl_idname = "mesh.add_say3d_sove"
-    bl_label = "Sove"
-    bl_description = "Sove Frame"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    prs = EnumProperty(items = (("1","PENCERE 200",""),
-                                ("2","PENCERE 180",""),
-                                ("3","PENCERE 160","")),
-                                name="",description="")
-    son=prs
-    gen=IntProperty(name='Width', min=1,max= 400,default=200,description='Width')
-    knr=IntProperty(name='Thickness', min=1,max= 100,default= 15,description='Thickness')
-    yuk=IntProperty(name='Elevation',min=1,max=3000,default=590,description='Elevation')
-    alt=IntProperty(name='Old Spacing',      min=1,max= 300,default= 44,description='Old Spacing')
-    ust=IntProperty(name='Top margin',      min=1,max= 300,default= 33,description='Top margin')
-    sdr=IntProperty(name='Jamb', min=1,max= 100,default= 15,description='jamb Depth')
-    pdr=IntProperty(name='Wall Thickness',    min=0,max= 100,default= 20,description='Wall Thickness')
-    dh =IntProperty(name='',         min=1,max= 200,default= 30,description='Height')
-    dr=BoolProperty(name='Rounded', default=True,  description='Rounded')
-
-    fg =IntProperty(name='Gap',min=0,max=10,default=1,description='Gap')
-    fh =IntProperty(name='',    min=1,max=10,default=3,description='Height')
-    fd =IntProperty(name='',    min=1,max=10,default=2,description='Depth')
-
-    f0 =IntProperty(name='Interval',min=1,max=3000,default=90,description='Interval')
-    f1 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f2 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f3 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f4 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f5 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f6 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f7 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f8 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    f9 =IntProperty(name='Interval',min=1,max=3000,default=30,description='Interval')
-    #--------------------------------------------------------------
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self,'prs')
-        box=layout.box()
-        box.prop(self,'gen');box.prop(self,'yuk')
-        box.prop(self,'knr')
-        row=box.row();row.prop(self,'alt');row.prop(self,'ust')
-        row=box.row();row.prop(self,'sdr');row.prop(self,'pdr')
-        row=box.row();row.prop(self, 'dr');row.prop(self, 'dh')
-        box=layout.box()
-        box.prop(self,'fg')
-        row=box.row();row.prop(self, 'fh');row.prop(self, 'fd')
-        for i in range(self.fg):
-            box.prop(self,'f'+str(i))
-            
-    def execute(self, context):
-        if self.son!=self.prs:
-            if self.prs=='1':Prs(self,200,15,590,44,33,15,20,30,True,1,2,3,90,30,30,30,30,30,30,30,30,30)
-            if self.prs=='2':Prs(self,180,15,590,44,33,15,20,30,True,1,2,3,90,30,30,30,30,30,30,30,30,30)
-            if self.prs=='3':Prs(self,160,15,590,44,33,15,20,30,True,1,2,3,90,30,30,30,30,30,30,30,30,30)
-            self.son=self.prs
-        add_object(self, context)
-        return {'FINISHED'}
-# Reg--------------------------------
-def add_object_button(self, context):
-    self.layout.operator(
-        OBJECT_OT_add_object.bl_idname,
-        text="Sove",
-        icon="MOD_MESHDEFORM")
-def register():
-    bpy.utils.register_class(OBJECT_OT_add_object)
-    bpy.types.INFO_MT_mesh_add.append(add_object_button)
-def unregister():
-    bpy.utils.unregister_class(OBJECT_OT_add_object)
-    bpy.types.INFO_MT_mesh_add.remove(add_object_button)
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_window.py b/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_window.py
deleted file mode 100644
index 459a612..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/add_mesh_window.py
+++ /dev/null
@@ -1,764 +0,0 @@
-bl_info = {
-    "name": "Window Generator 2",
-    "author": "SayPRODUCTIONS",
-    "version": (2, 0),
-    "blender": (2, 63, 0),
-    "api": 33333,
-    "location": "View3D > Add > Mesh > Say3D",
-    "description": "Window Generator 2",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Add Mesh"}
-import bpy
-from bpy.props import *
-from math import pi, sin, cos, sqrt
-def MAT(AD,R,G,B):
-    if AD not in bpy.data.materials:
-        mtl=bpy.data.materials.new(AD)
-        mtl.diffuse_color     = ([R,G,B])
-        mtl.diffuse_shader    = 'LAMBERT'
-        mtl.diffuse_intensity = 1.0
-    else:
-        mtl=bpy.data.materials[AD]
-    return mtl
-def Fitil(vr,fc,X,Z,x,y,z,zz,xx):
-    k3=z*2
-    vr.extend([[X[x  ]+xx,-z+zz,Z[y  ]+xx],[X[x  ]+xx+k3,-z+zz,Z[y  ]+xx+k3],[X[x  ]+xx+k3,z+zz,Z[y  ]+xx+k3],[X[x  ]+xx,z+zz,Z[y  ]+xx]])
-    vr.extend([[X[x  ]+xx,-z+zz,Z[y+1]-xx],[X[x  ]+xx+k3,-z+zz,Z[y+1]-xx-k3],[X[x  ]+xx+k3,z+zz,Z[y+1]-xx-k3],[X[x  ]+xx,z+zz,Z[y+1]-xx]])
-    vr.extend([[X[x+1]-xx,-z+zz,Z[y+1]-xx],[X[x+1]-xx-k3,-z+zz,Z[y+1]-xx-k3],[X[x+1]-xx-k3,z+zz,Z[y+1]-xx-k3],[X[x+1]-xx,z+zz,Z[y+1]-xx]])
-    vr.extend([[X[x+1]-xx,-z+zz,Z[y  ]+xx],[X[x+1]-xx-k3,-z+zz,Z[y  ]+xx+k3],[X[x+1]-xx-k3,z+zz,Z[y  ]+xx+k3],[X[x+1]-xx,z+zz,Z[y  ]+xx]])
-    n=len(vr)
-    fc.extend([[n-16,n-15,n-11,n-12],[n-15,n-14,n-10,n-11],[n-14,n-13,n- 9,n-10]])
-    fc.extend([[n-12,n-11,n- 7,n- 8],[n-11,n-10,n- 6,n- 7],[n-10,n- 9,n- 5,n- 6]])
-    fc.extend([[n- 8,n- 7,n- 3,n- 4],[n- 7,n- 6,n- 2,n- 3],[n- 6,n- 5,n- 1,n- 2]])
-    fc.extend([[n- 4,n- 3,n-15,n-16],[n- 3,n- 2,n-14,n-15],[n- 2,n- 1,n-13,n-14]])
-    z=0.005
-    vr.extend([[X[x]+xx+k3,-z+zz,Z[y]+xx+k3],[X[x]+xx+k3,-z+zz,Z[y+1]-xx-k3],[X[x+1]-xx-k3,-z+zz,Z[y+1]-xx-k3],[X[x+1]-xx-k3,-z+zz,Z[y]+xx+k3]])
-    vr.extend([[X[x]+xx+k3, z+zz,Z[y]+xx+k3],[X[x]+xx+k3, z+zz,Z[y+1]-xx-k3],[X[x+1]-xx-k3, z+zz,Z[y+1]-xx-k3],[X[x+1]-xx-k3, z+zz,Z[y]+xx+k3]])
-    fc.extend([[n+1,n+0,n+3,n+2],[n+4,n+5,n+6,n+7]])
-def Kapak(vr,fc,X,Z,x,y,z,zz):
-    k2=z*2
-    vr.extend([[X[x  ],-z+zz,Z[y  ]],[X[x  ]+k2,-z+zz,Z[y  ]+k2],[X[x  ]+k2,z+zz,Z[y  ]+k2],[X[x  ],z+zz,Z[y  ]]])
-    vr.extend([[X[x  ],-z+zz,Z[y+1]],[X[x  ]+k2,-z+zz,Z[y+1]-k2],[X[x  ]+k2,z+zz,Z[y+1]-k2],[X[x  ],z+zz,Z[y+1]]])
-    vr.extend([[X[x+1],-z+zz,Z[y+1]],[X[x+1]-k2,-z+zz,Z[y+1]-k2],[X[x+1]-k2,z+zz,Z[y+1]-k2],[X[x+1],z+zz,Z[y+1]]])
-    vr.extend([[X[x+1],-z+zz,Z[y  ]],[X[x+1]-k2,-z+zz,Z[y  ]+k2],[X[x+1]-k2,z+zz,Z[y  ]+k2],[X[x+1],z+zz,Z[y  ]]])
-    n=len(vr)
-    fc.extend([[n-16,n-15,n-11,n-12],[n-15,n-14,n-10,n-11],[n-14,n-13,n- 9,n-10],[n-13,n-16,n-12,n- 9]])
-    fc.extend([[n-12,n-11,n- 7,n- 8],[n-11,n-10,n- 6,n- 7],[n-10,n- 9,n- 5,n- 6],[n- 9,n-12,n- 8,n- 5]])
-    fc.extend([[n- 8,n- 7,n- 3,n- 4],[n- 7,n- 6,n- 2,n- 3],[n- 6,n- 5,n- 1,n- 2],[n- 5,n- 8,n- 4,n- 1]])
-    fc.extend([[n- 4,n- 3,n-15,n-16],[n- 3,n- 2,n-14,n-15],[n- 2,n- 1,n-13,n-14],[n- 1,n- 4,n-16,n-13]])
-def Prs(s):
-    if  s.prs=='1':
-        s.gen=3;s.yuk=1;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=190;s.mr=True
-        s.gnx0=  60;s.gnx1=  110;s.gnx2=  60
-        s.k00 =True;s.k01 =False;s.k02 =True
-    if  s.prs=='2':
-        s.gen=3;s.yuk=1;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=190;s.mr=True
-        s.gnx0=  60;s.gnx1=   60;s.gnx2=  60
-        s.k00 =True;s.k01 =False;s.k02 =True
-    if  s.prs=='3':
-        s.gen=3;s.yuk=1;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=190;s.mr=True
-        s.gnx0=  55;s.gnx1=   50;s.gnx2=  55
-        s.k00 =True;s.k01 =False;s.k02 =True
-    if  s.prs=='4':
-        s.gen=3;s.yuk=1;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=150;s.mr=True
-        s.gnx0=  55;s.gnx1=   50;s.gnx2=  55
-        s.k00 =True;s.k01 =False;s.k02 =True
-    if  s.prs=='5':
-        s.gen=3;s.yuk=1;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=150;s.mr=True
-        s.gnx0=  50;s.gnx1=   40;s.gnx2=  50
-        s.k00 =True;s.k01 =False;s.k02 =True
-    if  s.prs=='6':
-        s.gen=1;s.yuk=1;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=40;s.mr=True
-        s.gnx0=40
-        s.k00 =False
-    if  s.prs=='7':
-        s.gen=1;s.yuk=2;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=195;s.gny1=40
-        s.gnx0=70
-        s.k00 =True;s.k10 =False
-        s.mr=False
-    if  s.prs=='8':
-        s.gen=1;s.yuk=2;s.kl1=5;s.kl2=5;s.fk=2
-        s.gny0=180;s.gny1=35
-        s.gnx0=70
-        s.k00 =True;s.k10 =False
-        s.mr=False
-def add_object(self, context):
-    fc=[];vr=[];kx=[]
-    mx=self.gen;my=self.yuk;k1=self.kl1/100;y=my*4+4;k2=self.kl2/100;k3=self.fk/200;fr=(k1+k2)*0.5-0.01
-    RES=self.RES
-
-    u=self.kl1/100;X=[0,round(u,2)]
-    if mx> 0:u+=self.gnx0 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    if mx> 1:u+=self.gnx1 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    if mx> 2:u+=self.gnx2 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    if mx> 3:u+=self.gnx3 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    if mx> 4:u+=self.gnx4 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    if mx> 5:u+=self.gnx5 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    if mx> 6:u+=self.gnx6 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    if mx> 7:u+=self.gnx7 /100;X.append(round(u,2));u+=k2;X.append(round(u,2))
-    X[-1]=X[-2]+k1
-
-    u=self.kl1/100;Z=[0,round(u,2)]
-    if my> 0:u+=self.gny0 /100;Z.append(round(u,2));u+=k2;Z.append(round(u,2))
-    if my> 1:u+=self.gny1 /100;Z.append(round(u,2));u+=k2;Z.append(round(u,2))
-    if my> 2:u+=self.gny2 /100;Z.append(round(u,2));u+=k2;Z.append(round(u,2))
-    if my> 3:u+=self.gny3 /100;Z.append(round(u,2));u+=k2;Z.append(round(u,2))
-    if my> 4:u+=self.gny4 /100;Z.append(round(u,2));u+=k2;Z.append(round(u,2))
-    Z[-1]=Z[-2]+k1
-
-    u = X[-1]/2
-    for i in range(0,len(X)):X[i]-=u
-    kx=[[self.k00,self.k10,self.k20,self.k30,self.k40],
-        [self.k01,self.k11,self.k21,self.k31,self.k41],
-        [self.k02,self.k12,self.k22,self.k32,self.k42],
-        [self.k03,self.k13,self.k23,self.k33,self.k43],
-        [self.k04,self.k14,self.k24,self.k34,self.k44],
-        [self.k05,self.k15,self.k25,self.k35,self.k45],
-        [self.k06,self.k16,self.k26,self.k36,self.k46],
-        [self.k07,self.k17,self.k27,self.k37,self.k47]]
-    cam=[];mer=[];ftl=[];SM=[]
-#VERTICES ------------------------
-    vr.extend([[X[0],-k1/2,Z[0]],[X[0],k1/2,Z[0]]])
-    for x in range(1,len(X)-1):vr.extend([[X[x],-k1/2,Z[1]],[X[x], k1/2,Z[1]]])
-    vr.extend([[X[-1],-k1/2,Z[0]],[X[-1], k1/2,Z[0]]])
-    for z in range(2,len(Z)-2,2):
-        for x in range(0,len(X)):vr.extend([[X[x],-k1/2,Z[z]],[X[x], k1/2,Z[z]]])
-        for x in range(0,len(X)):vr.extend([[X[x],-k1/2,Z[z+1]],[X[x], k1/2,Z[z+1]]])
-    z=len(Z)-2
-    vr.extend([[X[0],-k1/2,Z[z+1]],[X[0], k1/2,Z[z+1]]])
-    ALT=[];UST=[len(vr)-2,len(vr)-1]
-    for x in range(1,len(X)-1):
-        vr.extend([[X[x],-k1/2,Z[z]],[X[x], k1/2,Z[z]]])
-        ALT.extend([len(vr)-2,len(vr)-1])
-    vr.extend([[X[-1],-k1/2,Z[z+1]],[X[-1],k1/2,Z[z+1]]])
-    SON=[len(vr)-2,len(vr)-1]
-#FACES ---------------------------
-    fc.append([0,1,3+mx*4,2+mx*4])
-    FB=[0];FR=[1]
-    for i in range(0,mx*4,4):
-        fc.append([i+3,i+2,i+4,i+5])
-        FB.extend([i+2,i+4])
-        FR.extend([i+3,i+5])
-    FR.append(3+mx*4);FB.append(2+mx*4)
-    FB.reverse()
-    fc.extend([FB,FR])
-    #Yatay
-    Y=(mx*4+4);V=mx*4+2
-    for z in range(0,(my-1)*Y*2,Y*2):
-        fc.extend([[z+Y+1,z+Y,z+Y+4+mx*4,z+Y+5+mx*4],[z+Y+V,z+Y+V+1,z+Y+V+5+mx*4,z+Y+V+4+mx*4]])
-        for i in range(0,mx*4+2,2):fc.extend([[z+i+Y+0,z+i+Y+2,z+i+Y+V+4,z+i+Y+V+2],[z+i+Y  +3,z+i+Y  +1,z+i+Y+V+3,z+i+Y+V+5]])
-        for i in range(0,mx*4-3,4):fc.extend([[z+i+Y+2,z+i+Y+3,z+i+Y  +5,z+i+Y  +4],[z+i+Y+V+5,z+i+Y+V+4,z+i+Y+V+6,z+i+Y+V+7]])
-    #Dikey
-    for Y in range(0,my):    
-        z=Y*(mx*4+4)*2
-        for i in range(0,mx*4+2,4):fc.extend([[z+i+1,z+i+0,z+i+V+2,z+i+V+3],[z+i+3,z+i+1,z+i+V+3,z+i+V+5],[z+i+2,z+i+3,z+i+V+5,z+i+V+4],[z+i+0,z+i+2,z+i+V+4,z+i+V+2]])
-    #Fitil-------------------
-    if self.UST=='1':y1=my
-    else:            y1=my-1
-    for y in range(0,y1):
-        for x in range(0,mx):
-            if  kx[x][y]==True:
-                Kapak(vr,fc,X,Z,x*2+1,y*2+1,k2/2,(k1+k2)*0.5-0.01)
-                Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,(k1+k2)*0.5-0.01,k2)
-            else:
-                Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,0,0)
-            m=len(fc);cam.extend([m-1,m-2])
-            ftl.extend([m-3,m-4,m-5,m-6,m-7,m-8,m-9,m-10,m-11,m-12,m-13,m-14])
-    #-----------------------------------------------------
-    if  self.UST=='1':#Duz
-        fc.append([UST[1],UST[0],SON[0],SON[1]])
-        for i in range(0,mx*4,4):
-            fc.append([ALT[i],ALT[i+1],ALT[i+3],ALT[i+2]])
-        ON=[UST[0]]
-        AR=[UST[1]]
-        for i in range(0,len(ALT)-1,2):
-            ON.append(ALT[i  ])
-            AR.append(ALT[i+1])
-        ON.append(SON[0])
-        fc.append(ON)
-        AR.append(SON[1])
-        AR.reverse();fc.append(AR)
-    elif self.UST=='2':#Yay
-        if   self.DT2=='1':
-            H=self.VL1/100
-            if   H<0.01:H=  0.01;self.VL1=1
-            elif H >= u:H=u-0.01;self.VL1=H*100
-            h=sqrt(u**2+H**2)/2
-            e=h*(u/H)
-            C=sqrt(h**2+e**2)
-            T1=Z[-1]-H
-        elif self.DT2=='2':
-            C=self.VL2/100
-            if  C<u+0.01:
-                C=u+0.01
-                self.VL2=C*100
-            T1=sqrt(C**2-u**2)+Z[-1]-C
-        R=C-k1;F=R-k3*2
-        K=R-k2;E=K-k3*2
-        z=Z[-1]-C
-
-        vr[UST[0]][2]=T1;vr[UST[1]][2]=T1
-        vr[SON[0]][2]=T1;vr[SON[1]][2]=T1
-        for i in ALT:vr[i][2]=sqrt(R**2-vr[i][0]**2)+z
-
-        ON=[SON[0]];U1=[]
-        for i in range(0,RES):
-            A=i*pi/RES;x=cos(A)*C
-            if  x>-u and x<u:
-                vr.append([x,-k1/2,sin(A)*C+z]);ON.append(len(vr)-1)
-        U1.extend(ON);U1.append(UST[0])
-        ON.extend([UST[0],ALT[0]])
-        AR=[];D1=[];D2=[]
-        for i in range(0,len(ALT)-2,4):
-            x1=vr[ALT[i+0]][0]; x2=vr[ALT[i+2]][0]
-            ON.append(ALT[i+0]);AR.append(ALT[i+1])
-            T1=[ALT[i+0]];      T2=[ALT[i+1]]
-            for j in range(0,RES):
-                A=j*pi/RES;x=-cos(A)*R
-                if  x1<x and x<x2:
-                    vr.extend([[x,-k1/2,sin(A)*R+z],[x,k1/2,sin(A)*R+z]])
-                    ON.append(len(vr)-2);AR.append(len(vr)-1)
-                    T1.append(len(vr)-2);T2.append(len(vr)-1)
-            ON.append(ALT[i+2]);AR.append(ALT[i+3])
-            T1.append(ALT[i+2]);T2.append(ALT[i+3])
-            D1.append(T1);      D2.append(T2)
-        AR.append(SON[1])
-        U2=[SON[1]]
-        for i in range(0,RES):
-            A=i*pi/RES;x=cos(A)*C
-            if  x>-u and x<u:
-                vr.append([x,k1/2,sin(A)*C+z])
-                AR.append(len(vr)-1);U2.append(len(vr)-1)
-        AR.append(UST[1])
-        U2.append(UST[1])
-        AR.reverse()
-        fc.extend([ON,AR])
-        for i in range(0,len(U1)-1):fc.append([U1[i+1],U1[i],U2[i],U2[i+1]]);SM.append(len(fc)-1)
-        for A in range(0,mx):
-            for i in range(0,len(D1[A])-1):
-                fc.append([D1[A][i+1],D1[A][i],D2[A][i],D2[A][i+1]]);SM.append(len(fc)-1)
-        y=my-1
-        for x in range(0,mx):
-            if  kx[x][y]==True:
-                fr=(k1+k2)*0.5-0.01;ek=k2                
-                R=C-k1;K=R-k2
-
-                x1=X[x*2+1];x2=X[x*2+2]
-                vr.extend([[x2,fr-k2/2,z+1  ],[x2-k2,fr-k2/2,z+1     ],[x2-k2,fr+k2/2,z+1     ],[x2,fr+k2/2,z+1  ]])
-                vr.extend([[x2,fr-k2/2,Z[-3]],[x2-k2,fr-k2/2,Z[-3]+k2],[x2-k2,fr+k2/2,Z[-3]+k2],[x2,fr+k2/2,Z[-3]]])
-                vr.extend([[x1,fr-k2/2,Z[-3]],[x1+k2,fr-k2/2,Z[-3]+k2],[x1+k2,fr+k2/2,Z[-3]+k2],[x1,fr+k2/2,Z[-3]]])
-                vr.extend([[x1,fr-k2/2,z+1  ],[x1+k2,fr-k2/2,z+1     ],[x1+k2,fr+k2/2,z+1     ],[x1,fr+k2/2,z+1  ]])
-
-                n=len(vr)
-                fc.extend([[n-16,n-15,n-11,n-12],[n-15,n-14,n-10,n-11],[n-14,n-13,n- 9,n-10],[n-13,n-16,n-12,n- 9]])
-                fc.extend([[n-12,n-11,n- 7,n- 8],[n-11,n-10,n- 6,n- 7],[n-10,n- 9,n- 5,n- 6],[n- 9,n-12,n- 8,n- 5]])
-                fc.extend([[n- 8,n- 7,n- 3,n- 4],[n- 7,n- 6,n- 2,n- 3],[n- 6,n- 5,n- 1,n- 2],[n- 5,n- 8,n- 4,n- 1]])
-                ALT=[n-16,n-15,n-14,n-13,n-4,n-3,n-2,n-1]
-                vr[ALT[0]][2]=sqrt(R**2-vr[ALT[0]][0]**2)+z;vr[ALT[1]][2]=sqrt(K**2-vr[ALT[1]][0]**2)+z
-                vr[ALT[2]][2]=sqrt(K**2-vr[ALT[2]][0]**2)+z;vr[ALT[3]][2]=sqrt(R**2-vr[ALT[3]][0]**2)+z
-                vr[ALT[4]][2]=sqrt(R**2-vr[ALT[4]][0]**2)+z;vr[ALT[5]][2]=sqrt(K**2-vr[ALT[5]][0]**2)+z
-                vr[ALT[6]][2]=sqrt(K**2-vr[ALT[6]][0]**2)+z;vr[ALT[7]][2]=sqrt(R**2-vr[ALT[7]][0]**2)+z
-
-                D1=[];D2=[];T1=[];T2=[]
-                for i in range(0,RES):
-                    A =i*pi/RES;y1=cos(A)*R;y2=-cos(A)*K
-                    if x1   <y1 and y1<x2:   vr.extend([[y1,fr-k2/2,sin(A)*R+z],[y1,fr+k2/2,sin(A)*R+z]]);T1.append(len(vr)-2);T2.append(len(vr)-1)
-                    if x1+k2<y2 and y2<x2-k2:vr.extend([[y2,fr-k2/2,sin(A)*K+z],[y2,fr+k2/2,sin(A)*K+z]]);D1.append(len(vr)-2);D2.append(len(vr)-1)
-                ON=[ALT[1],ALT[0]];ON.extend(T1);ON.extend([ALT[4],ALT[5]]);ON.extend(D1)
-                AR=[ALT[2],ALT[3]];AR.extend(T2);AR.extend([ALT[7],ALT[6]]);AR.extend(D2);AR.reverse()
-
-                if   D1==[] and T1==[]:fc.extend([ON,AR,[ALT[5],ALT[6],ALT[2],ALT[1]],[ALT[7],ALT[4],ALT[0],ALT[3]]]);                                                        m=len(fc);SM.extend([m-1,m-2])
-                elif D1==[] and T1!=[]:fc.extend([ON,AR,[ALT[5],ALT[6],ALT[2],ALT[1]],[ALT[7],ALT[4],T1[-1],T2[-1]],[ALT[0],ALT[3],T2[0],T1[0]]]);                            m=len(fc);SM.extend([m-1,m-2,m-3])
-                elif D1!=[] and T1==[]:fc.extend([ON,AR,[ALT[5],ALT[6],D2[0],D1[0]],[ALT[2],ALT[1],D1[-1],D2[-1]],[ALT[7],ALT[4],ALT[0],ALT[3]]]);                            m=len(fc);SM.extend([m-1,m-2,m-3])
-                else:                  fc.extend([ON,AR,[ALT[5],ALT[6],D2[0],D1[0]],[ALT[2],ALT[1],D1[-1],D2[-1]],[ALT[7],ALT[4],T1[-1],T2[-1]],[ALT[0],ALT[3],T2[0],T1[0]]]);m=len(fc);SM.extend([m-1,m-2,m-3,m-4])
-
-                for i in range(0,len(D1)-1):fc.append([D1[i+1],D1[i],D2[i],D2[i+1]]);SM.append(len(fc)-1)
-                for i in range(0,len(T1)-1):fc.append([T1[i+1],T1[i],T2[i],T2[i+1]]);SM.append(len(fc)-1)
-                R=C-k1-k2;K=R-k3*2
-            else:
-                fr=0;ek=0
-                R=C-k1;K=R-k3*2
-            #Fitil
-            x1=X[x*2+1]+ek;x2=X[x*2+2]-ek
-            vr.extend([[x2,fr-k3,z+1     ],[x2-k3*2,fr-k3,z+1          ],[x2-k3*2,fr+k3,z+1          ],[x2,fr+k3,z+1     ]])
-            vr.extend([[x2,fr-k3,Z[-3]+ek],[x2-k3*2,fr-k3,Z[-3]+ek+k3*2],[x2-k3*2,fr+k3,Z[-3]+ek+k3*2],[x2,fr+k3,Z[-3]+ek]])
-            vr.extend([[x1,fr-k3,Z[-3]+ek],[x1+k3*2,fr-k3,Z[-3]+ek+k3*2],[x1+k3*2,fr+k3,Z[-3]+ek+k3*2],[x1,fr+k3,Z[-3]+ek]])
-            vr.extend([[x1,fr-k3,z+1     ],[x1+k3*2,fr-k3,z+1          ],[x1+k3*2,fr+k3,z+1          ],[x1,fr+k3,z+1     ]])
-            n=len(vr)
-            fc.extend([[n-16,n-15,n-11,n-12],[n-15,n-14,n-10,n-11],[n-14,n-13,n- 9,n-10]])
-            fc.extend([[n-12,n-11,n- 7,n- 8],[n-11,n-10,n- 6,n- 7],[n-10,n- 9,n- 5,n- 6]])
-            fc.extend([[n- 8,n- 7,n- 3,n- 4],[n- 7,n- 6,n- 2,n- 3],[n- 6,n- 5,n- 1,n- 2]])
-            m=len(fc);ftl.extend([m-1,m-2,m-3,m-4,m-5,m-6,m-7,m-8,m-9])
-            ALT=[n-16,n-15,n-14,n-13,n-4,n-3,n-2,n-1]
-            vr[ALT[0]][2]=sqrt(R**2-vr[ALT[0]][0]**2)+z;vr[ALT[1]][2]=sqrt(K**2-vr[ALT[1]][0]**2)+z
-            vr[ALT[2]][2]=sqrt(K**2-vr[ALT[2]][0]**2)+z;vr[ALT[3]][2]=sqrt(R**2-vr[ALT[3]][0]**2)+z
-            vr[ALT[4]][2]=sqrt(R**2-vr[ALT[4]][0]**2)+z;vr[ALT[5]][2]=sqrt(K**2-vr[ALT[5]][0]**2)+z
-            vr[ALT[6]][2]=sqrt(K**2-vr[ALT[6]][0]**2)+z;vr[ALT[7]][2]=sqrt(R**2-vr[ALT[7]][0]**2)+z
-            D1=[];D2=[];T1=[];T2=[]
-            for i in range(0,RES):
-                A =i*pi/RES;y1=cos(A)*R;y2=-cos(A)*K
-                if x1     <y1 and y1<x2:     vr.extend([[y1,fr-k3,sin(A)*R+z],[y1,fr+k3,sin(A)*R+z]]);T1.append(len(vr)-2);T2.append(len(vr)-1);ftl.extend([len(fc)-1,len(fc)-2])
-                if x1+k3*2<y2 and y2<x2-k3*2:vr.extend([[y2,fr-k3,sin(A)*K+z],[y2,fr+k3,sin(A)*K+z]]);D1.append(len(vr)-2);D2.append(len(vr)-1);ftl.extend([len(fc)-1,len(fc)-2])
-            ON=[ALT[1],ALT[0]];ON.extend(T1);ON.extend([ALT[4],ALT[5]]);ON.extend(D1)
-            AR=[ALT[2],ALT[3]];AR.extend(T2);AR.extend([ALT[7],ALT[6]]);AR.extend(D2);AR.reverse()
-
-            if  D1==[]:fc.extend([ON,AR,[ALT[5],ALT[6],ALT[2],ALT[1]]]);                            m=len(fc);ftl.extend([m-1,m-2,m-3    ]);SM.extend([m-1    ])
-            else:      fc.extend([ON,AR,[ALT[5],ALT[6],D2[0],D1[0]],[ALT[2],ALT[1],D1[-1],D2[-1]]]);m=len(fc);ftl.extend([m-1,m-2,m-3,m-4]);SM.extend([m-1,m-2])
-
-            for i in range(0,len(D1)-1):fc.append([D1[i+1],D1[i],D2[i],D2[i+1]]);ftl.append(len(fc)-1);SM.append(len(fc)-1)
-            #Cam
-            x1=X[x*2+1]+ek+k3*2;x2=X[x*2+2]-ek-k3*2
-            ON=[];AR=[]
-            for i in range(0,RES):
-                A= i*pi/RES;y1=-cos(A)*K
-                if  x1<y1 and y1<x2:
-                    vr.extend([[y1,fr-0.005,sin(A)*K+z],[y1,fr+0.005,sin(A)*K+z]])
-                    n=len(vr);ON.append(n-1);AR.append(n-2)
-            vr.extend([[x1,fr-0.005,sqrt(K**2-x1**2)+z],[x1,fr+0.005,sqrt(K**2-x1**2)+z]])
-            vr.extend([[x1,fr-0.005,Z[-3]+ek+k3*2     ],[x1,fr+0.005,Z[-3]+ek+k3*2     ]])
-            vr.extend([[x2,fr-0.005,Z[-3]+ek+k3*2     ],[x2,fr+0.005,Z[-3]+ek+k3*2     ]])
-            vr.extend([[x2,fr-0.005,sqrt(K**2-x2**2)+z],[x2,fr+0.005,sqrt(K**2-x2**2)+z]])
-            n=len(vr);ON.extend([n-1,n-3,n-5,n-7]);AR.extend([n-2,n-4,n-6,n-8])
-            fc.append(ON);AR.reverse();fc.append(AR)
-            m=len(fc);cam.extend([m-1,m-2])        
-
-    elif self.UST=='3':#Egri
-        if   self.DT3=='1':H=(self.VL1/200)/u
-        elif self.DT3=='2':H=self.VL3/100
-        elif self.DT3=='3':H=sin(self.VL4*pi/180)/cos(self.VL4*pi/180)
-        z=sqrt(k1**2+(k1*H)**2)
-        k=sqrt(k2**2+(k2*H)**2)
-        f=sqrt(k3**2+(k3*H)**2)*2
-        vr[UST[0]][2]=Z[-1]+vr[UST[0]][0]*H
-        vr[UST[1]][2]=Z[-1]+vr[UST[1]][0]*H
-        for i in ALT:
-            vr[i][2] =Z[-1]+vr[i][0]*H-z
-        vr[SON[0]][2]=Z[-1]+vr[SON[0]][0]*H
-        vr[SON[1]][2]=Z[-1]+vr[SON[1]][0]*H
-        fc.append([UST[1],UST[0], SON[0],SON[1] ])
-        for i in range(0,mx*4,4):
-            fc.append([ALT[i],ALT[i+1],ALT[i+3],ALT[i+2]])
-        ON=[UST[0]]
-        AR=[UST[1]]
-        for i in range(0,len(ALT)-1,2):
-            ON.append(ALT[i  ])
-            AR.append(ALT[i+1])
-        ON.append(SON[0])
-        fc.append(ON)
-        AR.append(SON[1])
-        AR.reverse();fc.append(AR)
-        y=my-1
-        for x in range(0,mx):
-            if  kx[x][y]==True:
-                Kapak(vr,fc,X,Z,x*2+1,y*2+1,k2/2,(k1+k2)*0.5-0.01)
-                n=len(vr)
-                vr[n- 5][2]=Z[-1]+vr[n- 5][0]*H-z
-                vr[n- 6][2]=Z[-1]+vr[n- 6][0]*H-z-k
-                vr[n- 7][2]=Z[-1]+vr[n- 7][0]*H-z-k
-                vr[n- 8][2]=Z[-1]+vr[n- 8][0]*H-z
-                vr[n- 9][2]=Z[-1]+vr[n- 9][0]*H-z
-                vr[n-10][2]=Z[-1]+vr[n-10][0]*H-z-k
-                vr[n-11][2]=Z[-1]+vr[n-11][0]*H-z-k
-                vr[n-12][2]=Z[-1]+vr[n-12][0]*H-z
-                Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,(k1+k2)*0.5-0.01,k2)
-                n=len(vr)
-                vr[n- 2][2]=Z[-1]+vr[n- 2][0]*H-z-k-f
-                vr[n- 3][2]=Z[-1]+vr[n- 3][0]*H-z-k-f
-                vr[n- 6][2]=Z[-1]+vr[n- 6][0]*H-z-k-f
-                vr[n- 7][2]=Z[-1]+vr[n- 7][0]*H-z-k-f
-                vr[n-13][2]=Z[-1]+vr[n-13][0]*H-z-k
-                vr[n-14][2]=Z[-1]+vr[n-14][0]*H-z-k-f
-                vr[n-15][2]=Z[-1]+vr[n-15][0]*H-z-k-f
-                vr[n-16][2]=Z[-1]+vr[n-16][0]*H-z-k
-                vr[n-17][2]=Z[-1]+vr[n-17][0]*H-z-k
-                vr[n-18][2]=Z[-1]+vr[n-18][0]*H-z-k-f
-                vr[n-19][2]=Z[-1]+vr[n-19][0]*H-z-k-f
-                vr[n-20][2]=Z[-1]+vr[n-20][0]*H-z-k
-            else:
-                Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,0,0)
-                n=len(vr)
-                vr[n-2][2]=Z[-1]+vr[n-2][0]*H-z-f
-                vr[n-3][2]=Z[-1]+vr[n-3][0]*H-z-f
-                vr[n-6][2]=Z[-1]+vr[n-6][0]*H-z-f
-                vr[n-7][2]=Z[-1]+vr[n-7][0]*H-z-f
-                vr[n-13][2]=Z[-1]+vr[n-13][0]*H-z
-                vr[n-14][2]=Z[-1]+vr[n-14][0]*H-z-f
-                vr[n-15][2]=Z[-1]+vr[n-15][0]*H-z-f
-                vr[n-16][2]=Z[-1]+vr[n-16][0]*H-z
-                vr[n-17][2]=Z[-1]+vr[n-17][0]*H-z
-                vr[n-18][2]=Z[-1]+vr[n-18][0]*H-z-f
-                vr[n-19][2]=Z[-1]+vr[n-19][0]*H-z-f
-                vr[n-20][2]=Z[-1]+vr[n-20][0]*H-z
-            m=len(fc);cam.extend([m-1,m-2])
-            ftl.extend([m-3,m-4,m-5,m-6,m-7,m-8,m-9,m-10,m-11,m-12,m-13,m-14])
-    elif self.UST=='4':#Ucgen
-        if   self.DT3=='1':H=(self.VL1/100)/u
-        elif self.DT3=='2':H=self.VL3/100
-        elif self.DT3=='3':H=sin(self.VL4*pi/180)/cos(self.VL4*pi/180)
-        z=sqrt(k1**2+(k1*H)**2)
-        k=sqrt(k2**2+(k2*H)**2)
-        f=sqrt(k3**2+(k3*H)**2)*2
-        vr[UST[0]][2]=Z[-1]+vr[UST[0]][0]*H
-        vr[UST[1]][2]=Z[-1]+vr[UST[1]][0]*H
-        for i in ALT:
-            vr[i][2] =Z[-1]-abs(vr[i][0])*H-z
-        vr[SON[0]][2]=Z[-1]-vr[SON[0]][0]*H
-        vr[SON[1]][2]=Z[-1]-vr[SON[1]][0]*H
-        vr.extend([[0,-k1/2,Z[-1]],[0, k1/2,Z[-1]]])
-
-        x = 0
-        for j in range(2,len(ALT)-2,4):
-            if vr[ALT[j]][0]<0 and 0<vr[ALT[j+2]][0]:x=1
-
-        n=len(vr)
-        fc.extend([[UST[1],UST[0],n-2,n-1],[n-1,n-2,SON[0],SON[1]]])
-        ON=[SON[0],n-2,UST[0]];AR=[SON[1],n-1,UST[1]]
-
-        if  x==0:vr.extend([[0,-k1/2,Z[-1]-z],[0,k1/2,Z[-1]-z]])
-        for j in range(0,len(ALT)-2,4):
-            if  vr[ALT[j]][0]<0 and vr[ALT[j+2]][0]<0:
-                fc.append([ALT[j],ALT[j+1],ALT[j+3],ALT[j+2]])
-                ON.extend([ALT[j  ],ALT[j+2]])
-                AR.extend([ALT[j+1],ALT[j+3]])
-            elif vr[ALT[j]][0]>0 and vr[ALT[j+2]][0]>0:
-                fc.append([ALT[j],ALT[j+1],ALT[j+3],ALT[j+2]])
-                ON.extend([ALT[j  ],ALT[j+2]])
-                AR.extend([ALT[j+1],ALT[j+3]])
-            else:
-                n=len(vr)
-                fc.extend([[ALT[j],ALT[j+1],n-1,n-2],[n-2,n-1,ALT[j+3],ALT[j+2]]])
-                ON.extend([ALT[j+0],n-2,ALT[j+2]])
-                AR.extend([ALT[j+1],n-1,ALT[j+3]])
-        fc.append(ON);AR.reverse();fc.append(AR)
-        y=my-1
-        for x in range(0,mx):
-            if  vr[ALT[x*4]][0]<0 and vr[ALT[x*4+2]][0]<0:
-                if  kx[x][y]==True:
-                    Kapak(vr,fc,X,Z,x*2+1,y*2+1,k2/2,(k1+k2)*0.5-0.01)
-                    n=len(vr)
-                    vr[n- 5][2]=Z[-1]+vr[n- 5][0]*H-z
-                    vr[n- 6][2]=Z[-1]+vr[n- 6][0]*H-z-k
-                    vr[n- 7][2]=Z[-1]+vr[n- 7][0]*H-z-k
-                    vr[n- 8][2]=Z[-1]+vr[n- 8][0]*H-z
-                    vr[n- 9][2]=Z[-1]+vr[n- 9][0]*H-z
-                    vr[n-10][2]=Z[-1]+vr[n-10][0]*H-z-k
-                    vr[n-11][2]=Z[-1]+vr[n-11][0]*H-z-k
-                    vr[n-12][2]=Z[-1]+vr[n-12][0]*H-z
-                    Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,(k1+k2)*0.5-0.01,k2)
-                    n=len(vr)
-                    vr[n- 2][2]=Z[-1]+vr[n- 2][0]*H-z-k-f
-                    vr[n- 3][2]=Z[-1]+vr[n- 3][0]*H-z-k-f
-                    vr[n- 6][2]=Z[-1]+vr[n- 6][0]*H-z-k-f
-                    vr[n- 7][2]=Z[-1]+vr[n- 7][0]*H-z-k-f
-                    vr[n-13][2]=Z[-1]+vr[n-13][0]*H-z-k
-                    vr[n-14][2]=Z[-1]+vr[n-14][0]*H-z-k-f
-                    vr[n-15][2]=Z[-1]+vr[n-15][0]*H-z-k-f
-                    vr[n-16][2]=Z[-1]+vr[n-16][0]*H-z-k
-                    vr[n-17][2]=Z[-1]+vr[n-17][0]*H-z-k
-                    vr[n-18][2]=Z[-1]+vr[n-18][0]*H-z-k-f
-                    vr[n-19][2]=Z[-1]+vr[n-19][0]*H-z-k-f
-                    vr[n-20][2]=Z[-1]+vr[n-20][0]*H-z-k
-                else:
-                    Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,0,0)
-                    n=len(vr)
-                    vr[n-2][2]=Z[-1]+vr[n-2][0]*H-z-f
-                    vr[n-3][2]=Z[-1]+vr[n-3][0]*H-z-f
-                    vr[n-6][2]=Z[-1]+vr[n-6][0]*H-z-f
-                    vr[n-7][2]=Z[-1]+vr[n-7][0]*H-z-f
-                    vr[n-13][2]=Z[-1]+vr[n-13][0]*H-z
-                    vr[n-14][2]=Z[-1]+vr[n-14][0]*H-z-f
-                    vr[n-15][2]=Z[-1]+vr[n-15][0]*H-z-f
-                    vr[n-16][2]=Z[-1]+vr[n-16][0]*H-z
-                    vr[n-17][2]=Z[-1]+vr[n-17][0]*H-z
-                    vr[n-18][2]=Z[-1]+vr[n-18][0]*H-z-f
-                    vr[n-19][2]=Z[-1]+vr[n-19][0]*H-z-f
-                    vr[n-20][2]=Z[-1]+vr[n-20][0]*H-z
-                m=len(fc);cam.extend([m-1,m-2])
-                ftl.extend([m-3,m-4,m-5,m-6,m-7,m-8,m-9,m-10,m-11,m-12,m-13,m-14])
-            elif vr[ALT[x*4]][0]>0 and vr[ALT[x*4+2]][0]>0:
-                if  kx[x][y]==True:
-                    Kapak(vr,fc,X,Z,x*2+1,y*2+1,k2/2,(k1+k2)*0.5-0.01)
-                    n=len(vr)
-                    vr[n- 5][2]=Z[-1]-vr[n- 5][0]*H-z
-                    vr[n- 6][2]=Z[-1]-vr[n- 6][0]*H-z-k
-                    vr[n- 7][2]=Z[-1]-vr[n- 7][0]*H-z-k
-                    vr[n- 8][2]=Z[-1]-vr[n- 8][0]*H-z
-                    vr[n- 9][2]=Z[-1]-vr[n- 9][0]*H-z
-                    vr[n-10][2]=Z[-1]-vr[n-10][0]*H-z-k
-                    vr[n-11][2]=Z[-1]-vr[n-11][0]*H-z-k
-                    vr[n-12][2]=Z[-1]-vr[n-12][0]*H-z
-                    Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,(k1+k2)*0.5-0.01,k2)
-                    n=len(vr)
-                    vr[n- 2][2]=Z[-1]-vr[n- 2][0]*H-z-k-f
-                    vr[n- 3][2]=Z[-1]-vr[n- 3][0]*H-z-k-f
-                    vr[n- 6][2]=Z[-1]-vr[n- 6][0]*H-z-k-f
-                    vr[n- 7][2]=Z[-1]-vr[n- 7][0]*H-z-k-f
-                    vr[n-13][2]=Z[-1]-vr[n-13][0]*H-z-k
-                    vr[n-14][2]=Z[-1]-vr[n-14][0]*H-z-k-f
-                    vr[n-15][2]=Z[-1]-vr[n-15][0]*H-z-k-f
-                    vr[n-16][2]=Z[-1]-vr[n-16][0]*H-z-k
-                    vr[n-17][2]=Z[-1]-vr[n-17][0]*H-z-k
-                    vr[n-18][2]=Z[-1]-vr[n-18][0]*H-z-k-f
-                    vr[n-19][2]=Z[-1]-vr[n-19][0]*H-z-k-f
-                    vr[n-20][2]=Z[-1]-vr[n-20][0]*H-z-k
-                else:
-                    Fitil(vr,fc,X,Z,x*2+1,y*2+1,k3,0,0)
-                    n=len(vr)
-                    vr[n-2][2]=Z[-1]-vr[n-2][0]*H-z-f
-                    vr[n-3][2]=Z[-1]-vr[n-3][0]*H-z-f
-                    vr[n-6][2]=Z[-1]-vr[n-6][0]*H-z-f
-                    vr[n-7][2]=Z[-1]-vr[n-7][0]*H-z-f
-                    vr[n-13][2]=Z[-1]-vr[n-13][0]*H-z
-                    vr[n-14][2]=Z[-1]-vr[n-14][0]*H-z-f
-                    vr[n-15][2]=Z[-1]-vr[n-15][0]*H-z-f
-                    vr[n-16][2]=Z[-1]-vr[n-16][0]*H-z
-                    vr[n-17][2]=Z[-1]-vr[n-17][0]*H-z
-                    vr[n-18][2]=Z[-1]-vr[n-18][0]*H-z-f
-                    vr[n-19][2]=Z[-1]-vr[n-19][0]*H-z-f
-                    vr[n-20][2]=Z[-1]-vr[n-20][0]*H-z
-                m=len(fc);cam.extend([m-1,m-2])
-                ftl.extend([m-3,m-4,m-5,m-6,m-7,m-8,m-9,m-10,m-11,m-12,m-13,m-14])
-            else:
-                k4=k3*2
-                if  kx[x][y]==True:
-                    zz=(k1+k2)*0.5-0.01
-                    xx=X[x*2+1]
-                    vr.extend([[xx,-k2/2+zz,Z[-3]       ],[xx+k2,-k2/2+zz,Z[-3]    +k2       ],[xx+k2,k2/2+zz,Z[-3]    +k2       ],[xx,k2/2+zz,Z[-3]       ]])
-                    vr.extend([[xx,-k2/2+zz,Z[-1]+xx*H-z],[xx+k2,-k2/2+zz,Z[-1]+(xx+k2)*H-z-k],[xx+k2,k2/2+zz,Z[-1]+(xx+k2)*H-z-k],[xx,k2/2+zz,Z[-1]+xx*H-z]])
-                    vr.extend([[ 0,-k2/2+zz,Z[-1]     -z],[    0,-k2/2+zz,Z[-1]          -z-k],[    0,k2/2+zz,Z[-1]          -z-k],[ 0,k2/2+zz,Z[-1]     -z]])
-                    xx=X[x*2+2]
-                    vr.extend([[xx,-k2/2+zz,Z[-1]-xx*H-z],[xx-k2,-k2/2+zz,Z[-1]-(xx-k2)*H-z-k],[xx-k2,k2/2+zz,Z[-1]-(xx-k2)*H-z-k],[xx,k2/2+zz,Z[-1]-xx*H-z]])
-                    vr.extend([[xx,-k2/2+zz,Z[-3]       ],[xx-k2,-k2/2+zz,Z[-3]    +k2       ],[xx-k2,k2/2+zz,Z[-3]    +k2       ],[xx,k2/2+zz,Z[-3]       ]])
-                    n=len(vr)
-                    fc.extend([[n-20,n-19,n-15,n-16],[n-19,n-18,n-14,n-15],[n-18,n-17,n-13,n-14],[n-17,n-20,n-16,n-13]])
-                    fc.extend([[n-16,n-15,n-11,n-12],[n-15,n-14,n-10,n-11],[n-14,n-13,n- 9,n-10],[n-13,n-16,n-12,n- 9]])
-                    fc.extend([[n-12,n-11,n- 7,n- 8],[n-11,n-10,n- 6,n- 7],[n-10,n- 9,n- 5,n- 6],[n- 9,n-12,n- 8,n- 5]])
-                    fc.extend([[n- 8,n- 7,n- 3,n- 4],[n- 7,n- 6,n- 2,n- 3],[n- 6,n- 5,n- 1,n- 2],[n- 5,n- 8,n- 4,n- 1]])
-                    fc.extend([[n- 4,n- 3,n-19,n-20],[n- 3,n- 2,n-18,n-19],[n- 2,n- 1,n-17,n-18],[n- 1,n- 4,n-20,n-17]])
-                    xx=X[x*2+1]
-                    vr.extend([[xx   +k2,-k3+zz,Z[-3]    +k2            ],[xx+k4+k2,-k3+zz,Z[-3]    +k2+k4         ],[xx+k4+k2, k3+zz,Z[-3]    +k2+k4         ],[xx   +k2, k3+zz,Z[-3]    +k2            ]])
-                    vr.extend([[xx   +k2,-k3+zz,Z[-1]+(xx+k2   )*H-z-k  ],[xx+k4+k2,-k3+zz,Z[-1]+(xx+k2+k4)*H-z-k-f],[xx+k4+k2, k3+zz,Z[-1]+(xx+k2+k4)*H-z-k-f],[xx   +k2, k3+zz,Z[-1]+(xx+k2   )*H-z-k  ]])
-                    vr.extend([[    0,-k3+zz,Z[-1]-k     -z],[       0,-k3+zz,Z[-1]-k             -z-f],[       0,k3+zz,Z[-1]-k          -z-f],[    0,k3+zz,Z[-1]-k     -z]])
-                    xx=X[x*2+2]
-                    vr.extend([[xx   -k2,-k3+zz,Z[-1]-(xx-k2   )*H-z-k  ],[xx-k4-k2,-k3+zz,Z[-1]-(xx-k2-k4)*H-z-k-f],[xx-k4-k2, k3+zz,Z[-1]-(xx-k2-k4)*H-z-k-f],[xx   -k2, k3+zz,Z[-1]-(xx-k2   )*H-z-k  ]])
-                    vr.extend([[xx   -k2,-k3+zz,Z[-3]    +k2            ],[xx-k4-k2,-k3+zz,Z[-3]    +k2+k4         ],[xx-k4-k2, k3+zz,Z[-3]    +k2+k4         ],[xx   -k2, k3+zz,Z[-3]    +k2            ]])
-                    n=len(vr)
-                    fc.extend([[n-20,n-19,n-15,n-16],[n-19,n-18,n-14,n-15],[n-18,n-17,n-13,n-14]])
-                    fc.extend([[n-16,n-15,n-11,n-12],[n-15,n-14,n-10,n-11],[n-14,n-13,n- 9,n-10]])
-                    fc.extend([[n-12,n-11,n- 7,n- 8],[n-11,n-10,n- 6,n- 7],[n-10,n- 9,n- 5,n- 6]])
-                    fc.extend([[n- 8,n- 7,n- 3,n- 4],[n- 7,n- 6,n- 2,n- 3],[n- 6,n- 5,n- 1,n- 2]])
-                    fc.extend([[n- 4,n- 3,n-19,n-20],[n- 3,n- 2,n-18,n-19],[n- 2,n- 1,n-17,n-18]])
-                    xx=X[x*2+1]
-                    vr.extend([[xx+k4+k2,-k3+zz,Z[-3]    +k2+k4         ],[xx+k4+k2, k3+zz,Z[-3]    +k2+k4         ]])
-                    vr.extend([[xx+k4+k2,-k3+zz,Z[-1]+(xx+k2+k4)*H-z-k-f],[xx+k4+k2, k3+zz,Z[-1]+(xx+k2+k4)*H-z-k-f]])
-                    vr.extend([[       0,-k3+zz,Z[-1]-k             -z-f],[       0,k3+zz,Z[-1]-k          -z-f]])
-                    xx=X[x*2+2]
-                    vr.extend([[xx-k4-k2,-k3+zz,Z[-1]-(xx-k2-k4)*H-z-k-f],[xx-k4-k2, k3+zz,Z[-1]-(xx-k2-k4)*H-z-k-f]])
-                    vr.extend([[xx-k4-k2,-k3+zz,Z[-3]    +k2+k4         ],[xx-k4-k2, k3+zz,Z[-3]    +k2+k4         ]])
-                    fc.extend([[n+8,n+6,n+4,n+2,n+0],[n+1,n+3,n+5,n+7,n+9]])
-                else:
-                    xx=X[x*2+1]
-                    vr.extend([[xx,-k3,Z[-3]       ],[xx+k4,-k3,Z[-3]    +k4       ],[xx+k4,k3,Z[-3]    +k4       ],[xx,k3,Z[-3]       ]])
-                    vr.extend([[xx,-k3,Z[-1]+xx*H-z],[xx+k4,-k3,Z[-1]+(xx+k4)*H-z-f],[xx+k4,k3,Z[-1]+(xx+k4)*H-z-f],[xx,k3,Z[-1]+xx*H-z]])
-                    vr.extend([[ 0,-k3,Z[-1]     -z],[    0,-k3,Z[-1]          -z-f],[    0,k3,Z[-1]          -z-f],[ 0,k3,Z[-1]     -z]])
-                    xx=X[x*2+2]
-                    vr.extend([[xx,-k3,Z[-1]-xx*H-z],[xx-k4,-k3,Z[-1]-(xx-k4)*H-z-f],[xx-k4,k3,Z[-1]-(xx-k4)*H-z-f],[xx,k3,Z[-1]-xx*H-z]])
-                    vr.extend([[xx,-k3,Z[-3]       ],[xx-k4,-k3,Z[-3]    +k4       ],[xx-k4,k3,Z[-3]    +k4       ],[xx,k3,Z[-3]       ]])
-                    n=len(vr)
-                    fc.extend([[n-20,n-19,n-15,n-16],[n-19,n-18,n-14,n-15],[n-18,n-17,n-13,n-14]])
-                    fc.extend([[n-16,n-15,n-11,n-12],[n-15,n-14,n-10,n-11],[n-14,n-13,n- 9,n-10]])
-                    fc.extend([[n-12,n-11,n- 7,n- 8],[n-11,n-10,n- 6,n- 7],[n-10,n- 9,n- 5,n- 6]])
-                    fc.extend([[n- 8,n- 7,n- 3,n- 4],[n- 7,n- 6,n- 2,n- 3],[n- 6,n- 5,n- 1,n- 2]])
-                    fc.extend([[n- 4,n- 3,n-19,n-20],[n- 3,n- 2,n-18,n-19],[n- 2,n- 1,n-17,n-18]])
-                    xx=X[x*2+1]
-                    vr.extend([[xx+k4,-0.005,Z[-3]    +k4       ],[xx+k4,0.005,Z[-3]    +k4       ]])
-                    vr.extend([[xx+k4,-0.005,Z[-1]+(xx+k4)*H-z-f],[xx+k4,0.005,Z[-1]+(xx+k4)*H-z-f]])
-                    vr.extend([[    0,-0.005,Z[-1]          -z-f],[    0,0.005,Z[-1]          -z-f]])
-                    xx=X[x*2+2]
-                    vr.extend([[xx-k4,-0.005,Z[-1]-(xx-k4)*H-z-f],[xx-k4,0.005,Z[-1]-(xx-k4)*H-z-f]])
-                    vr.extend([[xx-k4,-0.005,Z[-3]    +k4       ],[xx-k4,0.005,Z[-3]    +k4       ]])
-                    fc.extend([[n+8,n+6,n+4,n+2,n+0],[n+1,n+3,n+5,n+7,n+9]])
-                m=len(fc);cam.extend([m-1,m-2])
-                ftl.extend([m-3,m-4,m-5,m-6,m-7,m-8,m-9,m-10,m-11,m-12,m-13,m-14,m-15,m-16,m-17])
-    #Mermer
-    if  self.mr==True:
-        mrh=-self.mr1/100;mrg= self.mr2/100
-        mdv=(self.mr3/200)+mrg;msv=-(mdv+(self.mr4/100))
-        vr.extend([[-u,mdv,0],[u,mdv,0],[-u,msv,0],[u,msv,0],[-u,mdv,mrh],[u,mdv,mrh],[-u,msv,mrh],[u,msv,mrh]])
-        n=len(vr);fc.extend([[n-1,n-2,n-4,n-3],[n-3,n-4,n-8,n-7],[n-6,n-5,n-7,n-8],[n-2,n-1,n-5,n-6],[n-4,n-2,n-6,n-8],[n-5,n-1,n-3,n-7]])
-        n=len(fc);mer.extend([n-1,n-2,n-3,n-4,n-5,n-6])
-#OBJE -----------------------------------------------------------
-    mesh = bpy.data.meshes.new(name='Window')
-    mesh.from_pydata(vr,[],fc)
-    if   self.mt1=='1':mesh.materials.append(MAT('PVC',    1.0,1.0,1.0))
-    elif self.mt1=='2':mesh.materials.append(MAT('Wood',   0.3,0.2,0.1))
-    elif self.mt1=='3':mesh.materials.append(MAT('Plastic',0.0,0.0,0.0))
-
-    if   self.mt2=='1':mesh.materials.append(MAT('PVC',    1.0,1.0,1.0))
-    elif self.mt2=='2':mesh.materials.append(MAT('Wood',   0.3,0.2,0.1))
-    elif self.mt2=='3':mesh.materials.append(MAT('Plastic',0.0,0.0,0.0))
-
-    mesh.materials.append(MAT('Glass',0.5,0.8,1.0))
-    if self.mr==True:mesh.materials.append(MAT('Marble', 0.9,0.8,0.7))
-
-    for i in ftl:
-        mesh.polygons[i].material_index=1
-    for i in cam:
-        mesh.polygons[i].material_index=2
-    for i in mer:
-        mesh.polygons[i].material_index=3
-    for i in SM:
-        mesh.polygons[i].use_smooth = 1
-    mesh.update(calc_edges=True)
-    from bpy_extras import object_utils
-    return object_utils.object_data_add(context, mesh, operator=None)
-    if  bpy.context.mode!='EDIT_MESH':
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.object.editmode_toggle()
-#----------------------------------------------------------------
-class PENCERE(bpy.types.Operator):
-    bl_idname = "mesh.add_say3d_pencere2"
-    bl_label = "Window"
-    bl_description = "Window Generator"
-    bl_options = {'REGISTER', 'UNDO'}
-    prs = EnumProperty(items = (('1',"WINDOW 250X200",""),
-                                ('2',"WINDOW 200X200",""),
-                                ('3',"WINDOW 180X200",""),
-                                ('4',"WINDOW 180X160",""),
-                                ('5',"WINDOW 160X160",""),
-                                ('6',"WINDOW 50X50",""),
-                                ('7',"DOOR 80X250",""),
-                                ('8',"DOOR 80X230","")),
-                                name="")
-    son=prs
-    gen=IntProperty(name='H Count',     min=1,max= 8, default= 3, description='Horizontal Panes')
-    yuk=IntProperty(name='V Count',     min=1,max= 5, default= 1, description='Vertical Panes')
-    kl1=IntProperty(name='Outer Frame', min=2,max=50, default= 5, description='Outside Frame Thickness')
-    kl2=IntProperty(name='Risers',      min=2,max=50, default= 5, description='Risers Width')
-    fk =IntProperty(name='Inner Frame', min=1,max=20, default= 2, description='Inside Frame Thickness')
-
-    mr=BoolProperty(name='Sill', default=True,description='Window Sill')
-    mr1=IntProperty(name='',min=1, max=20, default= 4, description='Height')
-    mr2=IntProperty(name='',min=0, max=20, default= 4, description='First Depth')
-    mr3=IntProperty(name='',min=1, max=50, default=20, description='Second Depth')
-    mr4=IntProperty(name='',min=0, max=50, default= 0, description='Extrusion for Jamb')
-
-    mt1=EnumProperty(items =(('1',"PVC",""),('2',"WOOD",""),('3',"Plastic","")),name="",default='1')
-    mt2=EnumProperty(items =(('1',"PVC",""),('2',"WOOD",""),('3',"Plastic","")),name="",default='3')
-
-    UST=EnumProperty(items =(('1',"Flat",""),('2',"Arch",  ""),('3',"Inclined", ""),('4',"Triangle","")),name="Top",default='1')
-    DT2=EnumProperty(items =(('1',"Difference",""),('2',"Radius",   "")),                         name="",default='1')
-    DT3=EnumProperty(items =(('1',"Difference",""),('2',"Incline %",""),('3',"Incline Angle","")),name="",default='1')
-
-    VL1=IntProperty( name='',min=-10000,max=10000,default=30)#Fark
-    VL2=IntProperty( name='',min=     1,max=10000,default=30)#Cap
-    VL3=IntProperty( name='',min=  -100,max=  100,default=30)#Egim %
-    VL4=IntProperty( name='',min=   -45,max=   45,default=30)#Egim Aci
-
-    RES=IntProperty(name='Resolution pi/',min=2,max=360,default=36)#Res
-
-    gnx0=IntProperty(name='',min=1,max=300,default= 60,description='1st Window Width')
-    gnx1=IntProperty(name='',min=1,max=300,default=110,description='2nd Window Width')
-    gnx2=IntProperty(name='',min=1,max=300,default= 60,description='3rd Window Width')
-    gnx3=IntProperty(name='',min=1,max=300,default= 60,description='4th Window Width')
-    gnx4=IntProperty(name='',min=1,max=300,default= 60,description='5th Window Width')
-    gnx5=IntProperty(name='',min=1,max=300,default= 60,description='6th Window Width')
-    gnx6=IntProperty(name='',min=1,max=300,default= 60,description='7th Window Width')
-    gnx7=IntProperty(name='',min=1,max=300,default= 60,description='8th Window Width')
-
-    gny0=IntProperty(name='',min=1,max=300,default=190,description='1st Row Height')
-    gny1=IntProperty(name='',min=1,max=300,default= 45,description='2nd Row Height')
-    gny2=IntProperty(name='',min=1,max=300,default= 45,description='3rd Row Height')
-    gny3=IntProperty(name='',min=1,max=300,default= 45,description='4th Row Height')
-    gny4=IntProperty(name='',min=1,max=300,default= 45,description='5th Row Height')
-
-    k00=BoolProperty(name='',default=True); k01=BoolProperty(name='',default=False)
-    k02=BoolProperty(name='',default=True); k03=BoolProperty(name='',default=False)
-    k04=BoolProperty(name='',default=False);k05=BoolProperty(name='',default=False)
-    k06=BoolProperty(name='',default=False);k07=BoolProperty(name='',default=False)
-
-    k10=BoolProperty(name='',default=False);k11=BoolProperty(name='',default=False)
-    k12=BoolProperty(name='',default=False);k13=BoolProperty(name='',default=False)
-    k14=BoolProperty(name='',default=False);k15=BoolProperty(name='',default=False)
-    k16=BoolProperty(name='',default=False);k17=BoolProperty(name='',default=False)
-
-    k20=BoolProperty(name='',default=False);k21=BoolProperty(name='',default=False)
-    k22=BoolProperty(name='',default=False);k23=BoolProperty(name='',default=False)
-    k24=BoolProperty(name='',default=False);k25=BoolProperty(name='',default=False)
-    k26=BoolProperty(name='',default=False);k27=BoolProperty(name='',default=False)
-
-    k30=BoolProperty(name='',default=False);k31=BoolProperty(name='',default=False)
-    k32=BoolProperty(name='',default=False);k33=BoolProperty(name='',default=False)
-    k34=BoolProperty(name='',default=False);k35=BoolProperty(name='',default=False)
-    k36=BoolProperty(name='',default=False);k37=BoolProperty(name='',default=False)
-
-    k40=BoolProperty(name='',default=False);k41=BoolProperty(name='',default=False)
-    k42=BoolProperty(name='',default=False);k43=BoolProperty(name='',default=False)
-    k44=BoolProperty(name='',default=False);k45=BoolProperty(name='',default=False)
-    k46=BoolProperty(name='',default=False);k47=BoolProperty(name='',default=False)
-    #--------------------------------------------------------------
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self,'prs')
-        box=layout.box()
-        box.prop(self,'gen');box.prop(self,'yuk')
-        box.prop(self,'kl1');box.prop(self,'kl2')
-        box.prop(self, 'fk')
-
-        box.prop(self,'mr')
-        if  self.mr==True:
-            row=box.row();row.prop(self,'mr1');row.prop(self,'mr2')
-            row=box.row();row.prop(self,'mr3');row.prop(self,'mr4')
-        row =layout.row();row.label('Frame');row.label('Inner Frame')
-        row =layout.row();row.prop(self,'mt1');row.prop(self,'mt2')
-
-        box.prop(self,'UST')
-        if   self.UST=='2':
-            row= box.row();    row.prop(self,'DT2')
-            if   self.DT2=='1':row.prop(self,'VL1')
-            elif self.DT2=='2':row.prop(self,'VL2')
-            box.prop(self,'RES')
-        elif self.UST=='3':
-            row= box.row();    row.prop(self,'DT3')
-            if   self.DT3=='1':row.prop(self,'VL1')
-            elif self.DT3=='2':row.prop(self,'VL3')
-            elif self.DT3=='3':row.prop(self,'VL4')
-        elif self.UST=='4':
-            row= box.row();    row.prop(self,'DT3')
-            if   self.DT3=='1':row.prop(self,'VL1')
-            elif self.DT3=='2':row.prop(self,'VL3')
-            elif self.DT3=='3':row.prop(self,'VL4')
-        row =layout.row()
-        for i in range(0,self.gen):
-            row.prop(self,'gnx'+str(i))
-        for j in range(0,self.yuk):
-            row=layout.row()
-            row.prop(self,'gny'+str(self.yuk-j-1))
-            for i in range(0,self.gen):
-                row.prop(self,'k'+str(self.yuk-j-1)+str(i))
-    def execute(self, context):
-        if self.son!=self.prs:
-            Prs(self)
-            self.son=self.prs
-        add_object(self,context)
-        return {'FINISHED'}
-# Registration
-def menu_func_pencere(self, context):
-    self.layout.operator(PENCERE.bl_idname,text="Window",icon="MOD_LATTICE")
-def register():
-    bpy.utils.register_class(PENCERE)
-    bpy.types.INFO_MT_mesh_add.append(menu_func_pencere)
-def unregister():
-    bpy.utils.unregister_class(PENCERE)
-    bpy.types.INFO_MT_mesh_add.remove(menu_func_pencere)
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/general.py b/release/scripts/addons_contrib/add_mesh_building_objects/general.py
deleted file mode 100644
index 4012735..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/general.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Stairbuilder - General
-#
-# General is an object for creating meshes given the verts and faces.
-#   Stair Type (typ):
-#       - id1 = Freestanding staircase
-#       - id2 = Housed-open staircase
-#       - id3 = Box staircase
-#       - id4 = Circular staircase
-# 
-# Paul "BrikBot" Marshall
-# Created: September 19, 2011
-# Last Modified: January 29, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-#
-# Coded in IDLE, tested in Blender 2.61.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  Stairbuilder is for quick stair generation.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-from bpy_extras import object_utils
-from math import atan
-from mathutils import Vector
-
-class General:
-    def __init__(self,rise,run,N):
-        self.stop=float(N)*Vector([run,0,rise])
-        self.slope=rise/run
-        self.angle=atan(self.slope)
-        #identical quads for all objects except stringer
-        self.faces=[[0,1,3,2],[0,1,5,4],[0,2,6,4],[4,5,7,6],[2,3,7,6],[1,3,7,5]]
-
-    def Make_mesh(self, verts, faces, name):        
-        # Create new mesh
-        mesh = bpy.data.meshes.new(name)
-
-        # Make a mesh from a list of verts/edges/faces.
-        mesh.from_pydata(verts, [], faces)
-
-        # Set mesh to use auto smoothing:
-        mesh.use_auto_smooth = True
-
-        # Update mesh geometry after adding stuff.
-        mesh.update()
-
-        return object_utils.object_data_add(bpy.context, mesh, operator=None)
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/post.py b/release/scripts/addons_contrib/add_mesh_building_objects/post.py
deleted file mode 100644
index 949e081..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/post.py
+++ /dev/null
@@ -1,87 +0,0 @@
-# Stairbuilder - Post generation
-#
-# Generates posts for stair generation.
-#   Stair Type (typ):
-#       - id1 = Freestanding staircase
-#       - id2 = Housed-open staircase
-#       - id3 = Box staircase
-#       - id4 = Circular staircase
-# 
-# Paul "BrikBot" Marshall
-# Created: September 19, 2011
-# Last Modified: January 29, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-#
-# Coded in IDLE, tested in Blender 2.61.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  Stairbuilder is for quick stair generation.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-from mathutils import Vector
-
-class Posts:
-    def __init__(self,G,rise,run,d,w,wT,nP,hR,tR, rEnable, lEnable):
-        self.G = G #General
-        self.rise = rise #Stair rise
-        self.run = run #Stair run
-        self.x1=Vector([0,0,hR-tR]) #rail start
-        self.x2=G.stop+Vector([0,0,hR-tR]) #rail stop
-        self.d=d #post depth
-        self.w=w #post width
-        self.wT=wT #tread width
-        self.nP=nP #number of posts 
-        self.sp=Vector([(self.x2[0]-self.x1[0])/float(nP+1),0,0]) #spacing between posts
-        self.rEnable = rEnable
-        self.lEnable = lEnable
-        self.Create()
-
-    def Intersect(self,i,d):
-        """find intersection point, x, for rail and post"""
-        x3=self.x1+i*self.sp+Vector([d,d,d])
-        x4=x3+Vector([0,0,self.x2[-1]])
-        a=self.x2-self.x1
-        b=x4-x3
-        c=x3-self.x1
-        cr_ab=a.cross(b)
-        mag_cr_ab=(cr_ab * cr_ab)
-        return self.x1+a*((c.cross(b).dot(cr_ab))/mag_cr_ab)
-
-    def Create(self):
-        for i in range(0,self.nP+2,1):
-            coords = []
-            #intersections with rail
-            coords.append(self.Intersect(i,0.0))
-            coords.append(self.Intersect(i,self.d))
-            #intersections with tread
-            coords.append(Vector([self.x1[0]+i*self.sp[0],0,
-                                  int(coords[0][0]/self.run)*self.rise]))
-            coords.append(coords[2]+Vector([self.d,0,0]))
-            #inner face
-            for j in range(4):
-                coords.append(coords[j]+Vector([0,self.w,0]))
-            if self.rEnable:
-                self.G.Make_mesh(coords, self.G.faces, 'posts')
-            if self.lEnable:
-                #make post on other side of steps as well
-                for j in coords:
-                    j += Vector([0,self.wT-self.w,0])
-                self.G.Make_mesh(coords, self.G.faces, 'posts')
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/rail.py b/release/scripts/addons_contrib/add_mesh_building_objects/rail.py
deleted file mode 100644
index 85c31dd..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/rail.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# Stairbuilder - Retainer generation
-#
-# Generates retainers for stair generation.
-#   Stair Type (typ):
-#       - id1 = Freestanding staircase
-#       - id2 = Housed-open staircase
-#       - id3 = Box staircase
-#       - id4 = Circular staircase
-# 
-# Paul "BrikBot" Marshall
-# Created: September 19, 2011
-# Last Modified: January 29, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-#
-# Coded in IDLE, tested in Blender 2.61.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  Stairbuilder is for quick stair generation.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-from math import tan
-from mathutils import Vector
-
-class Rails:
-    def __init__(self,G,w,t,h,tT,wP,dP,wT, rEnable, lEnable):
-        self.G = G #General
-        self.w=w #rail width
-        self.t=t #rail thickness
-        self.h=h #rail height
-        self.start=Vector([0,0,self.h-self.t]) #rail start
-        self.stop=G.stop+Vector([0,0,self.h-self.t]) #rail stop
-        self.tT=tT #tread toe
-        self.wP=wP #post width
-        self.dP=dP #post depth
-        self.wT=wT #tread width
-        self.rEnable = rEnable
-        self.lEnable = lEnable
-        self.Create()
-
-    def Create(self):
-        #determine offset to include railing toe
-        offset=Vector([self.tT,0,self.tT*tan(self.G.angle)])
-        coords = []
-        coords.append(self.start-offset)
-        coords.append(self.stop+offset+Vector([self.dP,0,
-                                               self.dP*tan(self.G.angle)]))
-        coords.append(self.start-offset+Vector([0,self.w,0]))
-        coords.append(self.stop+offset+Vector([self.dP,self.w,
-                                               self.dP*tan(self.G.angle)]))
-        for j in range(4):
-            coords.append(coords[j]+Vector([0,0,self.t]))
-        #centre over posts
-        for j in coords:
-            j += Vector([0,0.5*(-self.w+self.wP),0])
-        if self.rEnable:
-            self.G.Make_mesh(coords, self.G.faces, 'rails')
-        if self.lEnable:
-            #make rail on other side
-            for j in coords:
-                j += Vector([0,self.wT-self.wP,0])
-            self.G.Make_mesh(coords, self.G.faces, 'rails')
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/retainer.py b/release/scripts/addons_contrib/add_mesh_building_objects/retainer.py
deleted file mode 100644
index 8c8a22c..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/retainer.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# Stairbuilder - Retainer generation
-#
-# Generates retainers for stair generation.
-#   Stair Type (typ):
-#       - id1 = Freestanding staircase
-#       - id2 = Housed-open staircase
-#       - id3 = Box staircase
-#       - id4 = Circular staircase
-# 
-# Paul "BrikBot" Marshall
-# Created: September 19, 2011
-# Last Modified: January 29, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-#
-# Coded in IDLE, tested in Blender 2.61.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  Stairbuilder is for quick stair generation.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-from mathutils import Vector
-
-class Retainers:
-    def __init__(self,G,w,h,wP,wT,hR,n, rEnable, lEnable):
-        self.G = G #General
-        self.w=w #retainer width
-        self.h=h #retainer height
-        self.wP=wP #post width
-        self.wT=wT #tread width
-        self.nR=n #number of retainers
-        self.sp=hR/float(n+1) #retainer spacing
-        self.rEnable = rEnable
-        self.lEnable = lEnable
-        self.Create()
-
-    def Create(self):
-        for i in range(self.nR):
-            coords = []
-            offset=(i+1)*Vector([0,0,self.sp])
-            coords.append(offset)
-            coords.append(self.G.stop + offset)
-            coords.append(offset + Vector([0,self.w,0]))
-            coords.append(self.G.stop + offset + Vector([0,self.w,0]))
-            for j in range(4):
-                coords.append(coords[j] + Vector([0,0,self.h]))
-            #centre in posts
-            for j in coords:
-                j += Vector([0,0.5*(self.wP-self.w),0])
-            if self.rEnable:
-                self.G.Make_mesh(coords, self.G.faces, 'retainers')
-            if self.lEnable:
-                #make retainer on other side
-                for j in coords:
-                    j += Vector([0,self.wT-self.wP,0])
-                self.G.Make_mesh(coords,self.G.faces, 'retainers')
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/stairbuilder.py b/release/scripts/addons_contrib/add_mesh_building_objects/stairbuilder.py
deleted file mode 100644
index 0c2336b..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/stairbuilder.py
+++ /dev/null
@@ -1,561 +0,0 @@
-# Stairs and railing creator script for blender 2.49
-# Author: Nick van Adium
-# Date: 2010 08 09
-# 
-# Creates a straight-run staircase with railings and stringer
-# All components are optional and can be turned on and off by setting e.g. makeTreads=True or makeTreads=False
-# No GUI for the script, all parameters must be defined below
-# Current values assume 1 blender unit = 1 metre
-# 
-# Stringer will rest on lower landing and hang from upper landing
-# Railings start on the lowest step and end on the upper landing
-# 
-# NOTE: You must have numpy installed for this script to work!
-#       numpy is used to easily perform the necessary algebra
-#       numpy can be found at http://www.scipy.org/Download
-# 
-# Note: I'm not sure how to use recalcNormals so not all normals points ouwards.
-#       Perhaps someone else can contribute this.
-#
-#-----------------------------------------------------------
-#
-# Converted to Blender 2.5:
-#   - Still uses NumPy.
-#   - Classes are basically copy-paste from the original code
-#   - New Make_mesh copied from BrikBot's rock generator
-#   - Implemented standard add mesh GUI.
-#   @todo:
-#   - global vs. local needs cleaned up.
-#   - Join separate stringer objects and then clean up the mesh.
-#   - Put all objects into a group.
-#   - Generate left/right posts/railings/retainers separatly with
-#       option to disable just the left/right.
-#   - Add wall railing type as an option for left/right
-#   - Add different rail styles (profiles).  Select with enum.
-#   - Should have a non-NumPy code path for cross-compatability.
-#       - Could be another file with equivalent classes/functions?
-#           Then we would just import from there instead of from
-#           NumPy without having to change the actual code.  It
-#           would instead be a "try-except" block that trys to use
-#           NumPy.
-#   - Would like to add additional staircase types.
-#       - Spiral staircase
-#       - "L" staircase
-#       - "T" staircase
-#
-# Last Modified By: Paul "brikbot" Marshall
-# Last Modification: January 29, 2011
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  Stairbuilder is for quick stair generation.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-#-----------------------------------------------------------
-# BEGIN NEW B2.5/Py3.2 CODE
-import bpy
-from add_mesh_building_objects.general import General
-from add_mesh_building_objects.post import Posts
-from add_mesh_building_objects.rail import Rails
-from add_mesh_building_objects.retainer import Retainers
-from add_mesh_building_objects.stringer import Stringer
-from add_mesh_building_objects.tread import Treads
-from bpy.props import (BoolProperty,
-                       EnumProperty,
-                       IntProperty,
-                       FloatProperty)
-from mathutils import Vector
-
-global G
-global typ
-global typ_s
-global typ_t
-global rise
-global run               
-            
-class stairs(bpy.types.Operator):
-    """Add stair objects"""
-    bl_idname = "mesh.stairs"
-    bl_label = "Add Stairs"
-    bl_options = {'REGISTER', 'UNDO'}
-    bl_description = "Add stairs"
-
-    # Stair types for enum:
-    id1 = ("id1", "Freestanding", "Generate a freestanding staircase.")
-    id2 = ("id2", "Housed-Open", "Generate a housed-open staircase.")
-    id3 = ("id3", "Box", "Generate a box staircase.")
-    id4 = ("id4", "Circular", "Generate a circular or spiral staircase.")
-
-    # Tread types for enum:
-    tId1 = ("tId1", "Classic", "Generate wooden style treads")
-    tId2 = ("tId2", "Basic Steel", "Generate common steel style treads")
-    tId3 = ("tId3", "Bar 1", "Generate bar/slat steel treads")
-    tId4 = ("tId4", "Bar 2", "Generate bar-grating steel treads")
-    tId5 = ("tId5", "Bar 3", "Generate bar-support steel treads")
-
-    # Stringer types for enum:
-    sId1 = ("sId1", "Classic", "Generate a classic style stringer")
-    sId2 = ("sId2", "I-Beam", "Generate a steel I-beam stringer")
-    sId3 = ("sId3", "C-Beam", "Generate a C-channel style stringer")
-    
-    typ = EnumProperty(name = "Type",
-                       description = "Type of staircase to generate",
-                       items = [id1, id2, id3, id4])
-
-    rise = FloatProperty(name = "Rise",
-                         description = "Single tread rise",
-                         min = 0.0, max = 1024.0,
-                         default = 0.20)
-    run = FloatProperty(name = "Run",
-                        description = "Single tread run",
-                        min = 0.0, max = 1024.0,
-                        default = 0.30)
-
-    #for circular
-    rad1 = FloatProperty(name = "Inner Radius",
-                         description = "Inner radius for circular staircase",
-                         min = 0.0, max = 1024.0,
-                         soft_max = 10.0,
-                         default = 0.25)
-    rad2 = FloatProperty(name = "Outer Radius",
-                         description = "Outer radius for circular staircase",
-                         min = 0.0, max = 1024.0,
-                         soft_min = 0.015625, soft_max = 32.0,
-                         default = 1.0)
-    deg = FloatProperty(name = "Degrees",
-                        description = "Number of degrees the stairway rotates",
-                        min = 0.0, max = 92160.0, step = 5.0,
-                        default = 450.0)
-    center = BoolProperty(name = "Center Pillar",
-                          description = "Generate a central pillar",
-                          default = False)
-
-    #for treads
-    make_treads = BoolProperty(name = "Make Treads",
-                              description = "Enable tread generation",
-                              default = True)
-    tread_w = FloatProperty(name = "Tread Width",
-                            description = "Width of each generated tread",
-                            min = 0.0001, max = 1024.0,
-                            default = 1.2)
-    tread_h = FloatProperty(name = "Tread Height",
-                            description = "Height of each generated tread",
-                            min = 0.0001, max = 1024.0,
-                            default = 0.04)
-    tread_t = FloatProperty(name = "Tread Toe",
-                            description = "Toe (aka \"nosing\") of each generated tread",
-                            min = 0.0, max = 10.0,
-                            default = 0.03)
-    tread_o = FloatProperty(name = "Tread Overhang",
-                            description = "How much tread \"overhangs\" the sides",
-                            min = 0.0, max = 1024.0,
-                            default = 0.025)
-    tread_n = IntProperty(name = "Number of Treads",
-                          description = "How many treads to generate",
-                          min = 1, max = 1024,
-                          default = 10)
-    typ_t = EnumProperty(name = "Tread Type",
-                         description = "Type/style of treads to generate",
-                         items = [tId1, tId2, tId3, tId4, tId5])
-    tread_tk = FloatProperty(name = "Thickness",
-                             description = "Thickness of the treads",
-                             min = 0.0001, max = 10.0,
-                             default = 0.02)
-    tread_sec = IntProperty(name = "Sections",
-                            description = "Number of sections to use for tread",
-                            min = 1, max = 1024,
-                            default = 5)
-    tread_sp = IntProperty(name = "Spacing",
-                           description = "Total spacing between tread sections as a percentage of total tread width",
-                           min = 0, max = 80,
-                           default = 5)
-    tread_sn = IntProperty(name = "Crosses",
-                           description = "Number of cross section supports",
-                           min = 2, max = 1024,
-                           default = 4)
-    #special circular tread properties:
-    tread_slc = IntProperty(name = "Slices",
-                            description = "Number of slices each tread is composed of",
-                            min = 1, max = 1024,
-                            soft_max = 16,
-                            default = 4)
-
-    #for posts
-    make_posts = BoolProperty(name = "Make Posts",
-                              description = "Enable post generation",
-                              default = True)
-    post_d = FloatProperty(name = "Post Depth",
-                           description = "Depth of generated posts",
-                           min = 0.0001, max = 10.0,
-                           default = 0.04)
-    post_w = FloatProperty(name = "Post Width",
-                           description = "Width of generated posts",
-                           min = 0.0001, max = 10.0,
-                           default = 0.04)
-    post_n = IntProperty(name = "Number of Posts",
-                         description = "Number of posts to generated",
-                         min = 1, max = 1024,
-                         default = 5)
-
-    #for railings
-    make_railings = BoolProperty(name = "Make Railings",
-                                 description = "Generate railings",
-                                 default = True)
-    rail_w = FloatProperty(name = "Railings Width",
-                           description = "Width of railings to generate",
-                           min = 0.0001, max = 10.0,
-                           default = 0.12)
-    rail_t = FloatProperty(name = "Railings Thickness",
-                           description = "Thickness of railings to generate",
-                           min = 0.0001, max = 10.0,
-                           default = 0.03)
-    rail_h = FloatProperty(name = "Railings Height",
-                           description = "Height of railings to generate",
-                           min = 0.0001, max = 10.0,
-                           default = 0.90)
-
-    #for retainers
-    make_retainers = BoolProperty(name = "Make Retainers",
-                                  description = "Generate retainers",
-                                  default = True)
-    ret_w = FloatProperty(name = "Retainer Width",
-                          description = "Width of generated retainers",
-                          min = 0.0001, max = 10.0,
-                          default = 0.01)
-    ret_h = FloatProperty(name = "Retainer Height",
-                          description = "Height of generated retainers",
-                          min = 0.0001, max = 10.0,
-                          default = 0.01)
-    ret_n = IntProperty(name = "Number of Retainers",
-                        description = "Number of retainers to generated",
-                        min = 1, max = 1024,
-                        default = 3)
-
-    #for stringer
-    make_stringer = BoolProperty(name = "Make Stringer",
-                                 description = "Generate stair stringer",
-                                 default = True)
-    typ_s = EnumProperty(name = "Stringer Type",
-                         description = "Type/style of stringer to generate",
-                         items = [sId1, sId2, sId3])
-    string_n = IntProperty(name = "Number of Stringers",
-                           description = "Number of stringers to generate",
-                           min = 1, max = 10,
-                           default = 1)
-    string_dis = BoolProperty(name = "Distributed",
-                              description = "Use distributed stringers",
-                              default = False)
-    string_w = FloatProperty(name = "Stringer width",
-                             description = "Width of stringer as a percentage of tread width",
-                             min = 0.0001, max = 100.0,
-                             default = 15.0)
-    string_h = FloatProperty(name = "Stringer Height",
-                             description = "Height of the stringer",
-                             min = 0.0001, max = 100.0,
-                             default = 0.3)
-    string_tw = FloatProperty(name = "Web Thickness",
-                              description = "Thickness of the beam's web as a percentage of width",
-                              min = 0.0001, max = 100.0,
-                              default = 25.0)
-    string_tf = FloatProperty(name = "Flange Thickness",
-                              description = "Thickness of the flange",
-                              min = 0.0001, max = 100.0,
-                              default = 0.05)
-    string_tp = FloatProperty(name = "Flange Taper",
-                              description = "Flange thickness taper as a percentage",
-                              min = 0.0, max = 100.0,
-                              default = 0.0)
-    string_g = BoolProperty(name = "Floating",
-                            description = "Cut bottom of strigner to be a \"floating\" section",
-                            default = False)
-
-    use_original = BoolProperty(name = "Use legacy method",
-                                description = "Use the Blender 2.49 legacy method for stair generation",
-                                default = True)
-    rEnable = BoolProperty(name = "Right Details",
-                           description = "Generate right side details (posts/rails/retainers)",
-                           default = True)
-    lEnable = BoolProperty(name = "Left Details",
-                           description = "Generate left side details (posts/rails/retainers)",
-                           default = True)
-
-    # Draw the GUI:
-    def draw(self, context):
-        layout = self.layout
-        box = layout.box()
-        box.prop(self, 'typ')
-        box = layout.box()
-        box.prop(self, 'rise')
-        if self.typ != "id4":
-            box.prop(self, 'run')
-        else:
-            box.prop(self, 'deg')
-            box.prop(self, 'rad1')
-            box.prop(self, 'rad2')
-            box.prop(self, 'center')
-        if self.typ == "id1":
-            box.prop(self, 'use_original')
-            if not self.use_original:
-                box.prop(self, 'rEnable')
-                box.prop(self, 'lEnable')
-        else:
-            self.use_original = False
-            box.prop(self, 'rEnable')
-            box.prop(self, 'lEnable')
-            
-        # Treads
-        box = layout.box()
-        box.prop(self, 'make_treads')
-        if self.make_treads:
-            if not self.use_original and self.typ != "id4":
-                box.prop(self, 'typ_t')
-            else:
-                self.typ_t = "tId1"
-            if self.typ != "id4":
-                box.prop(self, 'tread_w')
-            box.prop(self, 'tread_h')
-            box.prop(self, 'tread_t')
-            if self.typ not in ["id2", "id4"]:
-                box.prop(self, 'tread_o')
-            else:
-                self.tread_o = 0.0
-            box.prop(self, 'tread_n')
-            if self.typ_t != "tId1":
-                box.prop(self, 'tread_tk')
-                box.prop(self, 'tread_sec')
-                if self.tread_sec > 1 and self.typ_t not in ["tId3", "tId4"]:
-                    box.prop(self, 'tread_sp')
-                if self.typ_t in ["tId3", "tId4", "tId5"]:
-                    box.prop(self, 'tread_sn')
-            elif self.typ == "id4":
-                box.prop(self, "tread_slc")
-                    
-        # Posts
-        box = layout.box()
-        box.prop(self, 'make_posts')
-        if self.make_posts:
-            box.prop(self, 'post_d')
-            box.prop(self, 'post_w')
-            box.prop(self, 'post_n')
-            
-        # Railings
-        box = layout.box()
-        box.prop(self, 'make_railings')
-        if self.make_railings:
-            box.prop(self, 'rail_w')
-            box.prop(self, 'rail_t')
-            box.prop(self, 'rail_h')
-            
-        # Retainers
-        box = layout.box()
-        box.prop(self, 'make_retainers')
-        if self.make_retainers:
-            box.prop(self, 'ret_w')
-            box.prop(self, 'ret_h')
-            box.prop(self, 'ret_n')
-            
-        # Stringers
-        box = layout.box()
-        if self.typ != "id2":
-            box.prop(self, 'make_stringer')
-        else:
-            self.make_stringer = True
-        if self.make_stringer:
-            if not self.use_original:
-                box.prop(self, 'typ_s')
-            else:
-                self.typ_s = "sId1"
-            box.prop(self, 'string_w')
-            if self.typ == "id1":
-                if self.typ_s == "sId1" and not self.use_original:
-                    box.prop(self, 'string_n')
-                    box.prop(self, 'string_dis')
-                elif self.typ_s in ["sId2", "sId3"]:
-                    box.prop(self, 'string_n')
-                    box.prop(self, 'string_dis')
-                    box.prop(self, 'string_h')
-                    box.prop(self, 'string_tw')
-                    box.prop(self, 'string_tf')
-                    box.prop(self, 'string_tp')
-                    box.prop(self, 'string_g')
-            elif self.typ == "id2":
-                if self.typ_s in ["sId2", "sId3"]:
-                    box.prop(self, 'string_tw')
-                    box.prop(self, 'string_tf')
-
-        # Tread support:
-##        if self.make_stringer and typ_s in ["sId2", "sId3"]:
-
-    def execute(self, context):
-        global G
-        global typ
-        global typ_s
-        global typ_t
-        global rise
-        global run
-        typ = self.typ
-        typ_s = self.typ_s
-        typ_t = self.typ_t
-        rise = self.rise
-        run = self.run
-        G=General(rise,run,self.tread_n)
-        if self.make_treads:
-            if typ != "id4":
-                Treads(G,
-                       typ,
-                       typ_t,
-                       run,
-                       self.tread_w,
-                       self.tread_h,
-                       self.run,
-                       self.rise,
-                       self.tread_t,
-                       self.tread_o,
-                       self.tread_n,
-                       self.tread_tk,
-                       self.tread_sec,
-                       self.tread_sp,
-                       self.tread_sn)
-            else:
-                Treads(G,
-                       typ,
-                       typ_t,
-                       self.deg,
-                       self.rad2,
-                       self.tread_h,
-                       self.run,
-                       self.rise,
-                       self.tread_t,
-                       self.rad1,
-                       self.tread_n,
-                       self.tread_tk,
-                       self.tread_sec,
-                       self.tread_sp,
-                       self.tread_sn,
-                       self.tread_slc)
-        if self.make_posts and (self.rEnable or self.lEnable):
-            Posts(G,
-                  rise,
-                  run,
-                  self.post_d,
-                  self.post_w,
-                  self.tread_w,
-                  self.post_n,
-                  self.rail_h,
-                  self.rail_t,
-                  self.rEnable,
-                  self.lEnable)
-        if self.make_railings and (self.rEnable or self.lEnable):
-            Rails(G,
-                  self.rail_w,
-                  self.rail_t,
-                  self.rail_h,
-                  self.tread_t,
-                  self.post_w,
-                  self.post_d,
-                  self.tread_w,
-                  self.rEnable,
-                  self.lEnable)
-        if self.make_retainers and (self.rEnable or self.lEnable):
-            Retainers(G,
-                      self.ret_w,
-                      self.ret_h,
-                      self.post_w,
-                      self.tread_w,
-                      self.rail_h,
-                      self.ret_n,
-                      self.rEnable,
-                      self.lEnable)
-        if self.make_stringer:
-            if typ == "id1" and self.use_original:
-                Stringer(G,
-                         typ,
-                         typ_s,
-                         rise,
-                         run,
-                         self.string_w,
-                         self.string_h,
-                         self.tread_n,
-                         self.tread_h,
-                         self.tread_w,
-                         self.tread_t,
-                         self.tread_o,
-                         self.string_tw,
-                         self.string_tf,
-                         self.string_tp,
-                         not self.string_g)
-            elif typ == "id3":
-                Stringer(G,
-                         typ,
-                         typ_s,
-                         rise,
-                         run,
-                         100,
-                         self.string_h,
-                         self.tread_n,
-                         self.tread_h,
-                         self.tread_w,
-                         self.tread_t,
-                         self.tread_o,
-                         self.string_tw,
-                         self.string_tf,
-                         self.string_tp,
-                         not self.string_g,
-                         1, False, False)
-            elif typ == "id4":
-                Stringer(G,
-                         typ,
-                         typ_s,
-                         rise,
-                         self.deg,
-                         self.string_w,
-                         self.string_h,
-                         self.tread_n,
-                         self.tread_h,
-                         self.rad2 - self.rad1,
-                         self.tread_t,
-                         self.rad1,
-                         self.string_tw,
-                         self.string_tf,
-                         self.string_tp,
-                         not self.string_g,
-                         self.string_n,
-                         self.string_dis,
-                         self.use_original,
-                         self.tread_slc)
-            else:
-                Stringer(G,
-                         typ,
-                         typ_s,
-                         rise,
-                         run,
-                         self.string_w,
-                         self.string_h,
-                         self.tread_n,
-                         self.tread_h,
-                         self.tread_w,
-                         self.tread_t,
-                         self.tread_o,
-                         self.string_tw,
-                         self.string_tf,
-                         self.string_tp,
-                         not self.string_g,
-                         self.string_n,
-                         self.string_dis,
-                         self.use_original)
-        return {'FINISHED'}
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/stringer.py b/release/scripts/addons_contrib/add_mesh_building_objects/stringer.py
deleted file mode 100644
index 99af723..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/stringer.py
+++ /dev/null
@@ -1,504 +0,0 @@
-# Stairbuilder - Stringer generation
-#
-# Generates stringer mesh for stair generation.
-#   Stair Type (typ):
-#       - id1 = Freestanding staircase
-#       - id2 = Housed-open staircase
-#       - id3 = Box staircase
-#       - id4 = Circular staircase
-#   Stringer Type (typ_s):
-#       - sId1 = Classic
-#       - sId2 = I-Beam
-#       - sId3 = C-Beam
-# 
-# Paul "BrikBot" Marshall
-# Created: September 19, 2011
-# Last Modified: January 29, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-#
-# Coded in IDLE, tested in Blender 2.61.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  Stairbuilder is for quick stair generation.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-from math import atan, cos, radians, tan
-from mathutils import Matrix, Vector
-from mathutils.geometry import (intersect_line_plane,
-                                intersect_line_line)
-
-class Stringer:
-    def  __init__(self,G,typ,typ_s,rise,run,w,h,nT,hT,wT,tT,tO,tw,tf,tp,g,
-                  nS=1,dis=False,notMulti=True,deg=4):
-        self.G = G #General
-        self.typ = typ # Stair type
-        self.typ_s = typ_s # Stringer type
-        self.rise = rise #Stair rise
-        self.run = run #Stair run. Degrees if self.typ == "id4"
-        if notMulti:
-            self.w = w / 100 #stringer width
-        else:
-            self.w = (wT * (w / 100)) / nS
-        self.h = h #stringer height
-        self.nT = nT #number of treads
-        self.hT = hT #tread height
-        self.wT = wT #tread width
-        self.tT = tT #tread toe
-        self.tO = tO #Tread overhang. Inner radius if self.typ == "id4"
-        self.tw = self.w * (tw / 100) #stringer web thickness
-        self.tf = tf #stringer flange thickness
-        self.tp = 1 - (tp / 100) #stringer flange taper
-        self.g = g #does stringer intersect the ground?
-        self.nS = nS #number of stringers
-        self.dis = dis #Use distributed stringers
-        self.deg = deg #number of sections per "slice". Only applys if self.typ == "id4"
-        # Default stringer object (classic / sId1):
-        self.faces1=[[0,1,3,2],[1,5,3],[3,5,4],[6,7,9,8],[7,11,9],[9,11,10],
-                     [0,2,8,6],[0,1,7,6],[1,5,11,7],[2,3,9,8],[3,4,10,9],[4,5,11,10]]
-        # Box stair type stringer:
-        self.faces2=[[0,1,7,6],[1,3,9,7],[3,4,10,9],[4,10,11,5],[5,11,8,2],
-                     [2,8,6,0],[0,1,2],[1,2,5,3],[3,4,5],[6,7,8],[7,8,11,9],[9,10,11]]
-        # I-beam stringer (id2 / sId2 / Taper < 100%):
-        self.faces3a=[[0,1,17,16],[1,2,18,17],[2,3,19,18],[3,4,20,19],[4,5,21,20],[5,6,22,21],
-                      [6,7,23,22],[7,8,24,23],[8,9,25,24],[9,10,26,25],[10,11,27,26],
-                      [11,12,28,27],[12,13,29,28],[13,14,30,29],[14,15,31,30],[15,0,16,31],
-                      [0,1,2,15],[2,11,14,15],[11,12,13,14],[2,3,10,11],[3,4,5,6],[3,6,7,10],
-                      [7,8,9,10],[16,17,18,31],[18,27,30,31],[27,28,29,30],[18,19,26,27],
-                      [19,20,21,22],[19,22,23,26],[23,24,25,26]]
-        # I-beam stringer (id2 / sId2 / Taper = 100%):
-        self.faces3b=[[0,1,9,8],[1,2,10,9],[2,3,11,10],[3,4,12,11],[4,5,13,12],[5,6,14,13],
-                      [6,7,15,14],[7,0,8,15],[0,1,6,7],[1,2,5,6],[2,3,4,5],[8,9,14,15],
-                      [9,10,13,14],[10,11,12,13]]
-        # I-beam stringer (id3 / sId2 / Taper < 100%):
-        self.faces3c=[[0,1,2,7],[2,3,6,7],[3,4,5,6],[1,2,23,16],[2,3,22,23],
-                      [3,4,21,22],[16,17,18,23],[18,19,22,23],[19,20,21,22],
-                      [17,8,15,18],[18,15,14,19],[19,14,13,20],[8,9,10,15],
-                      [10,11,14,15],[11,12,13,14],[9,10,53,52],[10,11,54,53],
-                      [11,12,55,54],[52,53,61,60],[53,54,62,61],[54,55,63,62],
-                      [60,61,34,33],[61,62,35,34],[62,63,36,35],[32,33,34,39],
-                      [34,35,38,39],[35,36,37,38],[41,32,39,42],[42,39,38,43],
-                      [43,38,37,44],[40,41,42,47],[42,43,46,47],[43,44,45,46],
-                      [25,26,47,40],[26,27,46,47],[27,28,45,46],[24,25,26,31],
-                      [26,27,30,31],[27,28,29,30],[24,31,57,56],[31,30,58,57],
-                      [30,29,59,58],[48,49,57,56],[49,50,58,57],[50,51,59,58],
-                      [0,7,49,48],[7,6,50,49],[6,5,51,50],[0,1,16,48],[16,40,56,48],
-                      [24,25,40,56],[16,17,41,40],[8,9,52,17],[17,52,60,41],
-                      [32,33,60,41],[12,13,20,55],[20,44,63,55],[37,44,63,36],
-                      [20,21,45,44],[28,29,51,21],[21,51,59,45],[28,45,59,29],
-                      [4,5,51,21]]
-        # C-beam stringer (id3 / sId3 / Taper < 100%):
-        self.faces4c=[[0,1,2,7],[2,3,6,7],[3,4,5,6],[1,2,23,16],[2,3,22,23],[3,4,21,22],
-                      [16,17,18,23],[18,19,22,23],[19,20,21,22],[17,8,15,18],[18,15,14,19],
-                      [19,14,13,20],[8,9,10,15],[10,11,14,15],[11,12,13,14],[0,24,25,7],
-                      [7,25,26,6],[6,26,27,5],[9,31,30,10],[10,30,29,11],[11,29,28,12],
-                      [24,25,30,31],[25,26,29,30],[26,27,28,29],[0,1,16,24],[16,24,31,17],
-                      [8,9,31,17],[4,5,27,21],[20,21,27,28],[12,13,20,28]]
-        self.Create()
-
-
-    def Create(self):
-        if self.typ == "id1":
-            if self.typ_s == "sId1":
-                if self.dis or self.nS == 1:
-                    offset = (self.wT / (self.nS + 1)) - (self.w / 2)
-                else:
-                    offset = 0
-                for i in range(self.nS):
-                    for j in range(self.nT):
-                        coords = []
-                        coords.append(Vector([0, offset, -self.rise]))
-                        coords.append(Vector([self.run, offset, -self.rise]))
-                        coords.append(Vector([0, offset, -self.hT]))
-                        coords.append(Vector([self.run, offset, -self.hT]))
-                        coords.append(Vector([self.run, offset, 0]))
-                        coords.append(Vector([self.run * 2, offset, 0]))
-                        for k in range(6):
-                            coords.append(coords[k]+Vector([0, self.w, 0]))
-                        for k in coords:
-                            k += j*Vector([self.run, 0, self.rise])
-                        self.G.Make_mesh(coords,self.faces1,'stringer')
-                    if self.dis or self.nS == 1:
-                        offset += self.wT / (self.nS + 1)
-                    else:
-                        offset += (self.wT - self.w) / (self.nS - 1)
-            elif self.typ_s == "sId2":
-                self.I_beam()
-        elif self.typ == "id2":
-            if self.typ_s == "sId1":
-                coords = []
-                coords.append(Vector([-self.tT, -self.w, -self.rise]))
-                coords.append(Vector([self.hT / self.G.slope, -self.w, -self.rise]))
-                coords.append(Vector([-self.tT, -self.w, 0]))
-                coords.append(Vector([self.nT * self.run, -self.w,
-                                      ((self.nT - 1) * self.rise) - self.hT]))
-                coords.append(Vector([self.nT * self.run, -self.w, self.nT * self.rise]))
-                coords.append(Vector([(self.nT * self.run) - self.tT, -self.w,
-                                      self.nT * self.rise]))
-                for i in range(6):
-                    coords.append(coords[i] + Vector([0, self.w, 0]))
-                self.G.Make_mesh(coords, self.faces2, 'stringer')
-                for i in coords:
-                    i += Vector([0, self.w + self.wT, 0])
-                self.G.Make_mesh(coords, self.faces2, 'stringer')
-            elif self.typ_s == "sId2":
-                self.housed_I_beam()
-            elif self.typ_s == "sId3":
-                self.housed_C_beam()
-        elif self.typ == "id3":
-            h = (self.rise - self.hT) - self.rise #height of top section
-            for i in range(self.nT):
-                coords = []
-                coords.append(Vector([i * self.run,0,-self.rise]))
-                coords.append(Vector([(i + 1) * self.run,0,-self.rise]))
-                coords.append(Vector([i * self.run,0,h + (i * self.rise)]))
-                coords.append(Vector([(i + 1) * self.run,0,h + (i * self.rise)]))
-                for j in range(4):
-                    coords.append(coords[j] + Vector([0,self.wT,0]))
-                self.G.Make_mesh(coords, self.G.faces, 'stringer')
-        elif self.typ == "id4":
-            offset = (self.wT / (self.nS + 1)) - (self.w / 2)
-            for s in range(self.nS):
-                base = self.tO + (offset * (s + 1))
-                start = [Vector([0, -base, -self.hT]),
-                         Vector([0, -base, -self.hT - self.rise]),
-                         Vector([0, -base - self.w, -self.hT]),
-                         Vector([0, -base - self.w, -self.hT - self.rise])]
-                self.d = radians(self.run) / self.nT
-                for i in range(self.nT):
-                    coords = []
-                    # Base faces.  Should be able to append more sections:
-                    tId4_faces = [[0, 1, 3, 2]]
-                    t_inner = Matrix.Rotation(self.d * i, 3, 'Z')
-                    coords.append((t_inner * start[0]) + Vector([0, 0, self.rise * i]))
-                    coords.append((t_inner * start[1]) + Vector([0, 0, self.rise * i]))
-                    t_outer = Matrix.Rotation(self.d * i, 3, 'Z')
-                    coords.append((t_outer * start[2]) + Vector([0, 0, self.rise * i]))
-                    coords.append((t_outer * start[3]) + Vector([0, 0, self.rise * i]))
-                    k = 0
-                    for j in range(self.deg):
-                        k = (j * 4) + 4
-                        tId4_faces.append([k, k - 4, k - 3, k + 1])
-                        tId4_faces.append([k - 2, k - 1, k + 3, k + 2])
-                        tId4_faces.append([k + 1, k - 3, k - 1, k + 3])
-                        tId4_faces.append([k, k - 4, k - 2, k + 2])
-                        rot = Matrix.Rotation(((self.d * (j + 1)) / self.deg) + (self.d * i), 3, 'Z')
-                        for v in start:
-                            coords.append((rot * v) + Vector([0, 0, self.rise * i]))
-                    for j in range(self.deg):
-                        k = ((j + self.deg) * 4) + 4
-                        tId4_faces.append([k, k - 4, k - 3, k + 1])
-                        tId4_faces.append([k - 2, k - 1, k + 3, k + 2])
-                        tId4_faces.append([k + 1, k - 3, k - 1, k + 3])
-                        tId4_faces.append([k, k - 4, k - 2, k + 2])
-                        rot = Matrix.Rotation(((self.d * ((j + self.deg) + 1)) / self.deg) + (self.d * i), 3, 'Z')
-                        for v in range(4):
-                            if v in [1, 3]:
-                                incline = (self.rise * i) + (self.rise / self.deg) * (j + 1)
-                                coords.append((rot * start[v]) + Vector([0, 0, incline]))
-                            else:
-                                coords.append((rot * start[v]) + Vector([0, 0, self.rise * i]))
-                    self.G.Make_mesh(coords, tId4_faces, 'treads')
-
-        return {'FINISHED'}
-
-
-    def I_beam(self):
-        mid = self.w / 2
-        web = self.tw / 2
-        # Bottom of the stringer:
-        baseZ = -self.rise - self.hT - self.h
-        # Top of the strigner:
-        topZ = -self.rise - self.hT
-        # Vertical taper amount:
-        taper = self.tf * self.tp
-
-        if self.dis or self.nS == 1:
-            offset = (self.wT / (self.nS + 1)) - mid
-        else:
-            offset = 0
-
-        # taper < 100%:
-        if self.tp > 0:
-            for i in range(self.nS):
-                coords = []
-                coords.append(Vector([0, offset,                baseZ]))
-                coords.append(Vector([0, offset,                baseZ + taper]))
-                coords.append(Vector([0, offset + (mid - web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + (mid - web),  topZ - self.tf]))
-                coords.append(Vector([0, offset,                topZ - taper]))
-                coords.append(Vector([0, offset,                topZ]))
-                coords.append(Vector([0, offset + (mid - web),  topZ]))
-                coords.append(Vector([0, offset + (mid + web),  topZ]))
-                coords.append(Vector([0, offset + self.w,       topZ]))
-                coords.append(Vector([0, offset + self.w,       topZ - taper]))
-                coords.append(Vector([0, offset + (mid + web),  topZ - self.tf]))
-                coords.append(Vector([0, offset + (mid + web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + self.w,       baseZ + taper]))
-                coords.append(Vector([0, offset + self.w,       baseZ]))
-                coords.append(Vector([0, offset + (mid + web),  baseZ]))
-                coords.append(Vector([0, offset + (mid - web),  baseZ]))
-                for j in range(16):
-                    coords.append(coords[j]+Vector([self.run * self.nT, 0, self.rise * self.nT]))
-                # If the bottom meets the ground:
-                #   Bottom be flat with the xy plane, but shifted down.
-                #   Either project onto the plane along a vector (hard) or use the built in
-                #       interest found in mathutils.geometry (easy).  Using intersect:
-                if self.g:
-                    for j in range(16):
-                        coords[j] = intersect_line_plane(coords[j], coords[j + 16],
-                                                         Vector([0, 0, topZ]),
-                                                         Vector([0, 0, 1]))
-                self.G.Make_mesh(coords, self.faces3a, 'stringer')
-
-                if self.dis or self.nS == 1:
-                    offset += self.wT / (self.nS + 1)
-                else:
-                    offset += (self.wT - self.w) / (self.nS - 1)
-        # taper = 100%:
-        else:
-            for i in range(self.nS):
-                coords = []
-                coords.append(Vector([0, offset,                baseZ]))
-                coords.append(Vector([0, offset + (mid - web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + (mid - web),  topZ - self.tf]))
-                coords.append(Vector([0, offset,                topZ]))
-                coords.append(Vector([0, offset + self.w,       topZ]))
-                coords.append(Vector([0, offset + (mid + web),  topZ - self.tf]))
-                coords.append(Vector([0, offset + (mid + web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + self.w,       baseZ]))
-                for j in range(8):
-                    coords.append(coords[j]+Vector([self.run * self.nT, 0, self.rise * self.nT]))
-                self.G.Make_mesh(coords, self.faces3b, 'stringer')
-                offset += self.wT / (self.nS + 1)
-                
-        return {'FINISHED'}
-
-
-    def housed_I_beam(self):
-        webOrth = Vector([self.rise, 0, -self.run]).normalized()
-        webHeight = Vector([self.run + self.tT, 0, -self.hT]).project(webOrth).length
-        vDelta_1 = self.tf * tan(self.G.angle)
-        vDelta_2 = (self.rise * (self.nT - 1)) - (webHeight + self.tf)
-        flange_y = (self.w - self.tw) / 2
-        front = -self.tT - self.tf
-        outer = -self.tO - self.tw - flange_y
-
-        coords = []
-        if self.tp > 0:
-            # Upper-Outer flange:
-            coords.append(Vector([front, outer, -self.rise]))
-            coords.append(Vector([-self.tT, outer, -self.rise]))
-            coords.append(Vector([-self.tT, outer, 0]))
-            coords.append(Vector([(self.run * (self.nT - 1)) - self.tT, outer,
-                                  self.rise * (self.nT - 1)]))
-            coords.append(Vector([self.run * self.nT, outer,
-                                  self.rise * (self.nT - 1)]))
-            coords.append(Vector([self.run * self.nT, outer,
-                                  (self.rise * (self.nT - 1)) + self.tf]))
-            coords.append(Vector([(self.run * (self.nT - 1)) - self.tT, outer,
-                                  (self.rise * (self.nT - 1)) + self.tf]))
-            coords.append(Vector([front, outer, self.tf - vDelta_1]))
-            # Lower-Outer flange:
-            coords.append(coords[0] + Vector([self.tf + webHeight, 0, 0]))
-            coords.append(coords[1] + Vector([self.tf + webHeight, 0, 0]))
-            coords.append(intersect_line_line(coords[9],
-                                              coords[9] - Vector([0, 0, 1]),
-                                              Vector([self.run, 0, -self.hT - self.tf]),
-                                              Vector([self.run * 2, 0, self.rise - self.hT - self.tf]))[0])
-            coords.append(Vector([(self.run * self.nT) - ((webHeight - self.hT) / tan(self.G.angle)),
-                                  outer, vDelta_2]))
-            coords.append(coords[4] - Vector([0, 0, self.tf + webHeight]))
-            coords.append(coords[5] - Vector([0, 0, self.tf + webHeight]))
-            coords.append(coords[11] + Vector([0, 0, self.tf]))
-            coords.append(intersect_line_line(coords[8],
-                                              coords[8] - Vector([0, 0, 1]),
-                                              Vector([self.run, 0, -self.hT]),
-                                              Vector([self.run * 2, 0, self.rise - self.hT]))[0])
-            # Outer web:
-            coords.append(coords[1] + Vector([0, flange_y, 0]))
-            coords.append(coords[8] + Vector([0, flange_y, 0]))
-            coords.append(coords[15] + Vector([0, flange_y, 0]))
-            coords.append(coords[14] + Vector([0, flange_y, 0]))
-            coords.append(coords[13] + Vector([0, flange_y, 0]))
-            coords.append(coords[4] + Vector([0, flange_y, 0]))
-            coords.append(coords[3] + Vector([0, flange_y, 0]))
-            coords.append(coords[2] + Vector([0, flange_y, 0]))
-            # Upper-Inner flange and lower-inner flange:
-            for i in range(16):
-                coords.append(coords[i] + Vector([0, self.w, 0]))
-            # Inner web:
-            for i in range(8):
-                coords.append(coords[i + 16] + Vector([0, self.tw, 0]))
-            # Mid nodes to so faces will be quads:
-            for i in [0,7,6,5,9,10,11,12]:
-                coords.append(coords[i] + Vector([0, flange_y, 0]))
-            for i in range(8):
-                coords.append(coords[i + 48] + Vector([0, self.tw, 0]))
-
-            self.G.Make_mesh(coords, self.faces3c, 'stringer')
-
-            for i in coords:
-                i += Vector([0, self.wT + self.tw, 0])
-
-            self.G.Make_mesh(coords, self.faces3c, 'stringer')
-
-        # @TODO Taper = 100%
-        
-        return {'FINISHED'}
-
-
-    def C_Beam(self):
-        mid = self.w / 2
-        web = self.tw / 2
-        # Bottom of the stringer:
-        baseZ = -self.rise - self.hT - self.h
-        # Top of the strigner:
-        topZ = -self.rise - self.hT
-        # Vertical taper amount:
-        taper = self.tf * self.tp
-
-        if self.dis or self.nS == 1:
-            offset = (self.wT / (self.nS + 1)) - mid
-        else:
-            offset = 0
-
-        # taper < 100%:
-        if self.tp > 0:
-            for i in range(self.nS):
-                coords = []
-                coords.append(Vector([0, offset,                baseZ]))
-                coords.append(Vector([0, offset,                baseZ + taper]))
-                coords.append(Vector([0, offset + (mid - web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + (mid - web),  topZ - self.tf]))
-                coords.append(Vector([0, offset,                topZ - taper]))
-                coords.append(Vector([0, offset,                topZ]))
-                coords.append(Vector([0, offset + (mid - web),  topZ]))
-                coords.append(Vector([0, offset + (mid + web),  topZ]))
-                coords.append(Vector([0, offset + self.w,       topZ]))
-                coords.append(Vector([0, offset + self.w,       topZ - taper]))
-                coords.append(Vector([0, offset + (mid + web),  topZ - self.tf]))
-                coords.append(Vector([0, offset + (mid + web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + self.w,       baseZ + taper]))
-                coords.append(Vector([0, offset + self.w,       baseZ]))
-                coords.append(Vector([0, offset + (mid + web),  baseZ]))
-                coords.append(Vector([0, offset + (mid - web),  baseZ]))
-                for j in range(16):
-                    coords.append(coords[j]+Vector([self.run * self.nT, 0, self.rise * self.nT]))
-                # If the bottom meets the ground:
-                #   Bottom be flat with the xy plane, but shifted down.
-                #   Either project onto the plane along a vector (hard) or use the built in
-                #       interest found in mathutils.geometry (easy).  Using intersect:
-                if self.g:
-                    for j in range(16):
-                        coords[j] = intersect_line_plane(coords[j], coords[j + 16],
-                                                         Vector([0, 0, topZ]),
-                                                         Vector([0, 0, 1]))
-                self.G.Make_mesh(coords, self.faces3a, 'stringer')
-
-                if self.dis or self.nS == 1:
-                    offset += self.wT / (self.nS + 1)
-                else:
-                    offset += (self.wT - self.w) / (self.nS - 1)
-        # taper = 100%:
-        else:
-            for i in range(self.nS):
-                coords = []
-                coords.append(Vector([0, offset,                baseZ]))
-                coords.append(Vector([0, offset + (mid - web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + (mid - web),  topZ - self.tf]))
-                coords.append(Vector([0, offset,                topZ]))
-                coords.append(Vector([0, offset + self.w,       topZ]))
-                coords.append(Vector([0, offset + (mid + web),  topZ - self.tf]))
-                coords.append(Vector([0, offset + (mid + web),  baseZ + self.tf]))
-                coords.append(Vector([0, offset + self.w,       baseZ]))
-                for j in range(8):
-                    coords.append(coords[j]+Vector([self.run * self.nT, 0, self.rise * self.nT]))
-                self.G.Make_mesh(coords, self.faces3b, 'stringer')
-                offset += self.wT / (self.nS + 1)
-                
-        return {'FINISHED'}
-
-
-    def housed_C_beam(self):
-        webOrth = Vector([self.rise, 0, -self.run]).normalized()
-        webHeight = Vector([self.run + self.tT, 0, -self.hT]).project(webOrth).length
-        vDelta_1 = self.tf * tan(self.G.angle)
-        vDelta_2 = (self.rise * (self.nT - 1)) - (webHeight + self.tf)
-        flange_y = (self.w - self.tw) / 2
-        front = -self.tT - self.tf
-        outer = -self.tO - self.tw - flange_y
-
-        coords = []
-        if self.tp > 0:
-            # Upper-Outer flange:
-            coords.append(Vector([front, outer, -self.rise]))
-            coords.append(Vector([-self.tT, outer, -self.rise]))
-            coords.append(Vector([-self.tT, outer, 0]))
-            coords.append(Vector([(self.run * (self.nT - 1)) - self.tT, outer,
-                                  self.rise * (self.nT - 1)]))
-            coords.append(Vector([self.run * self.nT, outer,
-                                  self.rise * (self.nT - 1)]))
-            coords.append(Vector([self.run * self.nT, outer,
-                                  (self.rise * (self.nT - 1)) + self.tf]))
-            coords.append(Vector([(self.run * (self.nT - 1)) - self.tT, outer,
-                                  (self.rise * (self.nT - 1)) + self.tf]))
-            coords.append(Vector([front, outer, self.tf - vDelta_1]))
-            # Lower-Outer flange:
-            coords.append(coords[0] + Vector([self.tf + webHeight, 0, 0]))
-            coords.append(coords[1] + Vector([self.tf + webHeight, 0, 0]))
-            coords.append(intersect_line_line(coords[9],
-                                              coords[9] - Vector([0, 0, 1]),
-                                              Vector([self.run, 0, -self.hT - self.tf]),
-                                              Vector([self.run * 2, 0, self.rise - self.hT - self.tf]))[0])
-            coords.append(Vector([(self.run * self.nT) - ((webHeight - self.hT) / tan(self.G.angle)),
-                                  outer, vDelta_2]))
-            coords.append(coords[4] - Vector([0, 0, self.tf + webHeight]))
-            coords.append(coords[5] - Vector([0, 0, self.tf + webHeight]))
-            coords.append(coords[11] + Vector([0, 0, self.tf]))
-            coords.append(intersect_line_line(coords[8],
-                                              coords[8] - Vector([0, 0, 1]),
-                                              Vector([self.run, 0, -self.hT]),
-                                              Vector([self.run * 2, 0, self.rise - self.hT]))[0])
-            # Outer web:
-            coords.append(coords[1] + Vector([0, flange_y, 0]))
-            coords.append(coords[8] + Vector([0, flange_y, 0]))
-            coords.append(coords[15] + Vector([0, flange_y, 0]))
-            coords.append(coords[14] + Vector([0, flange_y, 0]))
-            coords.append(coords[13] + Vector([0, flange_y, 0]))
-            coords.append(coords[4] + Vector([0, flange_y, 0]))
-            coords.append(coords[3] + Vector([0, flange_y, 0]))
-            coords.append(coords[2] + Vector([0, flange_y, 0]))
-            # Outer corner nodes:
-            for i in [0, 7, 6, 5, 12, 11, 10, 9]:
-                coords.append(coords[i] + Vector([0, flange_y + self.tw, 0]))
-
-            self.G.Make_mesh(coords, self.faces4c, 'stringer')
-
-            for i in range(16):
-                coords[i] += Vector([0, -outer * 2, 0])
-            for i in range(8):
-                coords[i + 16] += Vector([0, (-outer - flange_y) * 2, 0])
-            for i in coords:
-                i += Vector([0, (self.tO * 2) + self.wT, 0])
-
-            self.G.Make_mesh(coords, self.faces4c, 'stringer')
-        
-        return {'FINISHED'}
diff --git a/release/scripts/addons_contrib/add_mesh_building_objects/tread.py b/release/scripts/addons_contrib/add_mesh_building_objects/tread.py
deleted file mode 100644
index 1a5af0c..0000000
--- a/release/scripts/addons_contrib/add_mesh_building_objects/tread.py
+++ /dev/null
@@ -1,242 +0,0 @@
-# Stairbuilder - Tread generation
-#
-# Generates treads for stair generation.
-#   Stair Type (typ):
-#       - id1 = Freestanding staircase
-#       - id2 = Housed-open staircase
-#       - id3 = Box staircase
-#       - id4 = Circular staircase
-#   Tread Type (typ_t):
-#       - tId1 = Classic
-#       - tId2 = Basic Steel
-#       - tId3 = Bar 1
-#       - tId4 = Bar 2
-#       - tId5 = Bar 3
-# 
-# Paul "BrikBot" Marshall
-# Created: September 19, 2011
-# Last Modified: January 26, 2012
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-#
-# Coded in IDLE, tested in Blender 2.61.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  Stairbuilder is for quick stair generation.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import mathutils
-from copy import copy
-from math import radians, sqrt
-from mathutils import Matrix, Vector
-
-class Treads:
-    def __init__(self,G,typ,typ_t,run,w,h,d,r,toe,o,n,tk,sec,sp,sn,deg=4):
-        self.G = G #General
-        self.typ = typ #Stair type
-        self.typ_t = typ_t #Tread type
-        self.run = run #Stair run.  Degrees if self.typ == "id4"
-        self.w=w #tread width.  Is outer radius if self.typ == "id4"
-        self.h=h #tread height
-        self.d=d #tread run.  Ignore for now if self.typ == "id4"
-        self.r=r #tread rise
-        self.t=toe #tread nosing
-        self.o=o #tread side overhang.  Is inner radius if self.typ == "id4"
-        self.n=n #number of treads
-        self.tk=tk #thickness of tread metal
-        self.sec=sec #metal sections for tread
-        if sec != 1 and typ_t not in ["tId4", "tId5"]:
-            self.sp=((d+toe)*(sp/100))/(sec-1) #spacing between sections (% of depth)
-        elif typ_t in ["tId4", "tId5"]:
-            self.sp=sp/100 #keep % value
-        else:
-            self.sp=0
-        self.sn=sn #number of cross sections
-        self.deg = deg #number of section per "slice".  Only applys if self.typ == "id4"
-        self.tId2_faces = [[0,1,2,3],[0,3,4,5],[4,5,6,7],[6,7,8,9],[8,9,10,11],
-                           [12,13,14,15],[12,15,16,17],[16,17,18,19],
-                           [18,19,20,21],[20,21,22,23],[0,1,13,12],[1,2,14,13],
-                           [2,3,15,14],[3,4,16,15],[4,7,19,16],[7,8,20,19],
-                           [8,11,23,20],[11,10,22,23],[10,9,21,22],[9,6,18,21],
-                           [6,5,17,18],[5,0,12,17]]
-        self.out_faces = [[0,2,3,1],[0,2,10,8],[9,11,3,1],[9,11,10,8],
-                          [2,6,7,3],[2,6,14,10],[11,15,7,3],[11,15,14,10],
-                          [0,4,5,1],[0,4,12,8],[9,13,5,1],[9,13,12,8],
-                          [4,6,7,5],[4,6,14,12],[13,15,14,12],[13,15,7,5]]
-        self.Create()
-
-    def Create(self):
-        # Setup the coordinates:
-        coords = []
-        coords2 = []
-        coords3 = []
-        cross = 0
-        cW = 0
-        depth = 0
-        offset = 0
-        height = 0
-        if self.typ in ["id1", "id2", "id3"]:
-            if self.typ_t == "tId1":
-                coords.append(Vector([-self.t,-self.o,0]))
-                coords.append(Vector([self.d,-self.o,0]))
-                coords.append(Vector([-self.t,self.w + self.o,0]))
-                coords.append(Vector([self.d,self.w + self.o,0]))
-                for i in range(4):
-                    coords.append(coords[i]+Vector([0,0,-self.h]))
-
-            elif self.typ_t == "tId2":
-                depth = (self.d + self.t - (self.sec - 1) * self.sp) / self.sec
-                inset = depth / 4
-                tDepth = depth - self.t
-                coords.append(Vector([-self.t, -self.o, -self.h]))                          #0
-                coords.append(Vector([inset - self.t, -self.o, -self.h]))           #1
-                coords.append(Vector([inset - self.t, -self.o, -self.h + self.tk])) #2
-                coords.append(Vector([self.tk - self.t, -self.o, -self.h + self.tk]))       #3
-                coords.append(Vector([self.tk - self.t, -self.o, -self.tk]))                #4
-                coords.append(Vector([-self.t, -self.o, 0]))                                #5
-                coords.append(Vector([tDepth, -self.o, 0]))                                 #6
-                coords.append(Vector([tDepth - self.tk, -self.o, -self.tk]))                #7
-                coords.append(Vector([tDepth - self.tk, -self.o, self.tk - self.h]))        #8
-                coords.append(Vector([tDepth, -self.o, -self.h]))                           #9
-                coords.append(Vector([tDepth - inset, -self.o, -self.h]))           #10
-                coords.append(Vector([tDepth - inset, -self.o, -self.h + self.tk])) #11
-                for i in range(12):
-                    coords.append(coords[i] + Vector([0, self.w + (2 * self.o), 0]))
-            
-            elif self.typ_t in ["tId3", "tId4", "tId5"]:
-                # Frame:
-                coords.append(Vector([-self.t,-self.o,-self.h]))
-                coords.append(Vector([self.d,-self.o,-self.h]))
-                coords.append(Vector([-self.t,-self.o,0]))
-                coords.append(Vector([self.d,-self.o,0]))
-                for i in range(4):
-                    if (i % 2) == 0:
-                        coords.append(coords[i] + Vector([self.tk,self.tk,0]))
-                    else:
-                        coords.append(coords[i] + Vector([-self.tk,self.tk,0]))
-                for i in range(4):
-                    coords.append(coords[i] + Vector([0,self.w + self.o,0]))
-                for i in range(4):
-                    coords.append(coords[i + 4] + Vector([0,self.w + self.o - (2 * self.tk),0]))
-
-                # Tread sections:
-                if self.typ_t == "tId3":
-                    offset = (self.tk * sqrt(2)) / 2
-                    topset = self.h - offset
-                    self.sp = ((self.d + self.t - (2 * self.tk)) - (offset * (self.sec) + topset)) / (self.sec + 1)
-                    baseX = -self.t + self.sp + self.tk
-                    coords2.append(Vector([baseX, self.tk - self.o, offset - self.h]))
-                    coords2.append(Vector([baseX + offset, self.tk - self.o, -self.h]))
-                    for i in range(2):
-                        coords2.append(coords2[i] + Vector([topset, 0, topset]))
-                    for i in range(4):
-                        coords2.append(coords2[i] + Vector([0, (self.w + self.o) - (2 * self.tk), 0]))
-                elif self.typ_t in ["tId4", "tId5"]:
-                    offset = ((self.run + self.t) * self.sp) / (self.sec + 1)
-                    topset = (((self.run + self.t) * (1 - self.sp)) - (2 * self.tk)) / self.sec
-                    baseX = -self.t + self.tk + offset
-                    baseY = self.w + self.o - 2 * self.tk
-                    coords2.append(Vector([baseX, -self.o + self.tk, -self.h / 2]))
-                    coords2.append(Vector([baseX + topset, -self.o + self.tk, -self.h / 2]))
-                    coords2.append(Vector([baseX, -self.o + self.tk, 0]))
-                    coords2.append(Vector([baseX + topset, -self.o + self.tk, 0]))
-                    for i in range(4):
-                        coords2.append(coords2[i] + Vector([0, baseY, 0]))
-
-                # Tread cross-sections:
-                if self.typ_t in ["tId3", "tId4"]:
-                    cW = self.tk
-                    cross = (self.w + (2 * self.o) - (self.sn + 2) * self.tk) / (self.sn + 1)
-                else: # tId5
-                    spacing = self.sp ** (1 / 4)
-                    cross = ((2*self.o + self.w) * spacing) / (self.sn + 1)
-                    cW = (-2*self.tk + (2*self.o + self.w) * (1 - spacing)) / self.sn
-                    self.sp = topset
-                    height = -self.h / 2
-                baseY = -self.o + self.tk + cross
-                coords3.append(Vector([-self.t + self.tk, baseY, -self.h]))
-                coords3.append(Vector([self.d - self.tk, baseY, -self.h]))
-                coords3.append(Vector([-self.t + self.tk, baseY, height]))
-                coords3.append(Vector([self.d - self.tk, baseY, height]))
-                for i in range(4):
-                    coords3.append(coords3[i] + Vector([0, cW, 0]))
-
-            # Make the treads:
-            for i in range(self.n):
-                if self.typ_t == "tId1":
-                    self.G.Make_mesh(coords,self.G.faces,'treads')
-                elif self.typ_t == "tId2":
-                    temp = []
-                    for j in coords:
-                        temp.append(copy(j))
-                    for j in range(self.sec):
-                        self.G.Make_mesh(temp, self.tId2_faces, 'treads')
-                        for k in temp:
-                            k += Vector([depth + self.sp, 0, 0])
-                elif self.typ_t in ["tId3", "tId4", "tId5"]:
-                    self.G.Make_mesh(coords,self.out_faces,'treads')
-                    temp = []
-                    for j in coords2:
-                        temp.append(copy(j))
-                    for j in range(self.sec):
-                        self.G.Make_mesh(temp,self.G.faces,'bars')
-                        for k in temp:
-                            k += Vector([offset + self.sp, 0, 0])
-                    for j in coords2:
-                        j += Vector([self.d, 0, self.r])
-                    temp = []
-                    for j in coords3:
-                        temp.append(copy(j))
-                    for j in range(self.sn):
-                        self.G.Make_mesh(temp,self.G.faces,'crosses')
-                        for k in temp:
-                            k += Vector([0, cW + cross, 0])
-                    for j in coords3:
-                        j += Vector([self.d, 0, self.r])
-                for j in coords:
-                    j += Vector([self.d,0,self.r])
-        # Circular staircase:
-        elif self.typ in ["id4"]:
-            start = [Vector([0, -self.o, 0]), Vector([0, -self.o, -self.h]),
-                     Vector([0, -self.w, 0]), Vector([0, -self.w, -self.h])]
-            self.d = radians(self.run) / self.n
-            for i in range(self.n):
-                coords = []
-                # Base faces.  Should be able to append more sections:
-                tId4_faces = [[0, 1, 3, 2]]
-                t_inner = Matrix.Rotation((-self.t / self.o) + (self.d * i), 3, 'Z')
-                coords.append((t_inner * start[0]) + Vector([0, 0, self.r * i]))
-                coords.append((t_inner * start[1]) + Vector([0, 0, self.r * i]))
-                t_outer = Matrix.Rotation((-self.t / self.w) + (self.d * i), 3, 'Z')
-                coords.append((t_outer * start[2]) + Vector([0, 0, self.r * i]))
-                coords.append((t_outer * start[3]) + Vector([0, 0, self.r * i]))
-                k = 0
-                for j in range(self.deg + 1):
-                    k = (j * 4) + 4
-                    tId4_faces.append([k, k - 4, k - 3, k + 1])
-                    tId4_faces.append([k - 2, k - 1, k + 3, k + 2])
-                    tId4_faces.append([k + 1, k - 3, k - 1, k + 3])
-                    tId4_faces.append([k, k - 4, k - 2, k + 2])
-                    rot = Matrix.Rotation(((self.d * j) / self.deg) + (self.d * i), 3, 'Z')
-                    for v in start:
-                        coords.append((rot * v) + Vector([0, 0, self.r * i]))
-                tId4_faces.append([k, k + 1, k + 3, k + 2])
-                self.G.Make_mesh(coords, tId4_faces, 'treads')
-        return
diff --git a/release/scripts/addons_contrib/add_mesh_chain_rope/__init__.py b/release/scripts/addons_contrib/add_mesh_chain_rope/__init__.py
deleted file mode 100644
index 9d914bc..0000000
--- a/release/scripts/addons_contrib/add_mesh_chain_rope/__init__.py
+++ /dev/null
@@ -1,38 +0,0 @@
-bl_info = {
-    "name": "Oscurart Chain and Rope Maker",
-    "author": "Oscurart",
-    "version": (1,1),
-    "blender": (2, 63, 0),
-    "location": "Add > Mesh",
-    "description": "Create chains and ropes along armatures/curves",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Add_Mesh/Oscurart_Chain_Rope_Maker",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=28136",
-    "category": "Object"}
-
-
-import bpy
-from .oscurart_rope_maker import * 
-from .oscurart_chain_maker import *
-
-def register():
-    bpy.utils.register_class(OBJECT_OT_add_object)
-    bpy.types.INFO_MT_curve_add.append(oscRopeButton)
-    bpy.utils.register_module(__name__)
-    bpy.types.INFO_MT_mesh_add.append(menu_oscChain)
-
-def unregister():
-    bpy.utils.unregister_class(OBJECT_OT_add_object)
-    bpy.types.INFO_MT_curve_add.remove(oscRopeButton)
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_mesh_add.remove(menu_oscChain)    
-
-if __name__ == "__main__":
-    register()
-
-
-
-
-
diff --git a/release/scripts/addons_contrib/add_mesh_chain_rope/oscurart_chain_maker.py b/release/scripts/addons_contrib/add_mesh_chain_rope/oscurart_chain_maker.py
deleted file mode 100644
index c5b1e68..0000000
--- a/release/scripts/addons_contrib/add_mesh_chain_rope/oscurart_chain_maker.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Oscurart Chain Maker",
-    "author": "Oscurart",
-    "version": (1,1),
-    "blender": (2, 56, 0),
-    "api": 3800,
-    "location": "Add > Mesh > Oscurart Chain",
-    "description": "Create chain links from armatures.",
-    "warning": "",
-    "wiki_url": "oscurart.blogspot.com",
-    "tracker_url": "",
-    "category": "Object"}
-
-
-
-
-
-import bpy
-
-
-def makeChain (self, context, mult, curverig):     
-
-    if bpy.context.active_object.type == 'ARMATURE':                
-        bpy.ops.object.mode_set(mode='OBJECT')      
-        VAR_SWITCH=abs(1)
-        ARMATURE=bpy.context.active_object        
-        def creahuesocero(hueso):
-            ## CREO DATA PARA ESLABON
-            mesh=bpy.data.meshes.new("objectData"+str(hueso.name))
-            object=bpy.data.objects.new("EslabonCero"+str(hueso.name),mesh)
-            mesh.from_pydata(
-            [(-0.04986128956079483,-0.6918092370033264,-0.17846597731113434),(-0.04986128956079483,-0.6918091773986816,0.17846640944480896),(-0.049861326813697815,-0.154555082321167,0.17846627533435822),(-0.049861326813697815,-0.15455523133277893,-0.17846614122390747),(-0.04986133798956871,-0.03475356101989746,0.25805795192718506),(-0.04986133798956871,-0.03475397825241089,-0.25805795192718506),(-0.049861278384923935,-0.8116106986999512,-0.2580576539039612),(-0.049861278384923935,-0.8116104602813721,0.25805822014808655),(-0.04986128211021423,-0.7692053318023682,2.6668965347198537e-07),(-0.04986127093434334,-0.923523485660553,2.7834033744511544e-07),(-0.04986133426427841,-0.0771591067314148,3.5627678585115063e-08),(-0.04986134544014931,0.0771591067314148,-3.5627678585115063e-08),(0.04986133798956871,-0.03475397825241089,-0.25805795192718506),(0.04986133053898811,0.0771591067314148,-3.5627678585115063e-08),(0.04986133798956871,-0.03475356101989746,0.25805795192718506),(0.04986134544014931,-0.15455523133277893,-0.17846614122390747),(0.04986134544014931,-0.0771591067314148,3.5627678585115063e-08),(0.04986134544014931,-0.154555082321167,0.17846627533435822),(0.049861397594213486,-0.8116106986999512,-0.2580576539039612),(0.04986140504479408,-0.923523485660553,2.7834033744511544e-07),(0.049861397594213486,-0.8116104602813721,0.25805822014808655),(0.04986139014363289,-0.6918091773986816,0.17846640944480896),(0.04986139014363289,-0.7692053318023682,2.6668965347198537e-07),(0.04986139014363289,-0.6918092370033264,-0.17846597731113434)],
-        [(1,2),(0,3),(3,5),(2,4),(0,6),(5,6),(1,7),(4,7),(0,8),(1,8),(7,9),(6,9),(8,9),(2,10),(3,10),(4,11),(5,11),(10,11),(5,12),(12,13),(11,13),(13,14),(4,14),(10,16),(15,16),(3,15),(2,17),(16,17),(9,19),(18,19),(6,18),(7,20),(19,20),(8,22),(21,22),(1,21),(0,23),(22,23),(14,20),(12,18),(15,23),(17,21),(12,15),(13,16),(14,17),(20,21),(19,22),(18,23)],
-        [(6,0,3,5),(1,7,4,2),(0,6,9,8),(8,9,7,1),(2,4,11,10),(10,11,5,3),(11,13,12,5),(4,14,13,11),(3,15,16,10),(10,16,17,2),(6,18,19,9),(9,19,20,7),(1,21,22,8),(23,0,8,22),(7,20,14,4),(5,12,18,6),(0,23,15,3),(2,17,21,1),(16,15,12,13),(17,16,13,14),(22,21,20,19),(23,22,19,18),(21,17,14,20),(15,23,18,12)]
-            )
-            bpy.context.scene.objects.link(object)
-            ## ESCALO EL HUESO
-            bpy.data.objects['EslabonCero'+str(hueso.name)].scale= (hueso.length*mult,hueso.length*mult,hueso.length*mult)            
-            ## EMPARENTO
-            bpy.data.objects['EslabonCero'+str(hueso.name)].parent=ARMATURE
-            bpy.data.objects['EslabonCero'+str(hueso.name)].parent_type = 'BONE'
-            bpy.data.objects['EslabonCero'+str(hueso.name)].parent_bone=hueso.name           
-        def creahuesonoventa(hueso):
-            ## CREO DATA PARA ESLABON
-            mesh=bpy.data.meshes.new("objectData"+str(hueso.name))
-            object=bpy.data.objects.new("EslabonNov"+str(hueso.name),mesh)
-            mesh.from_pydata(
-            [(0.1784660965204239,-0.6918091773986816,-0.049861203879117966),(-0.1784662902355194,-0.6918091773986816,-0.04986126348376274),(-0.17846627533435822,-0.1545550525188446,-0.04986134544014931),(0.17846617102622986,-0.15455520153045654,-0.04986128583550453),(-0.25805795192718506,-0.03475359082221985,-0.049861375242471695),(0.25805795192718506,-0.034753888845443726,-0.04986129328608513),(0.2580578327178955,-0.8116105794906616,-0.04986117407679558),(-0.2580580413341522,-0.8116105198860168,-0.049861256033182144),(-9.672299938756623e-08,-0.7692052721977234,-0.04986122250556946),(-8.99775329799013e-08,-0.923523485660553,-0.04986120015382767),(-7.764004550381287e-09,-0.07715904712677002,-0.049861326813697815),(4.509517737005808e-08,0.0771591067314148,-0.049861349165439606),(0.25805795192718506,-0.034753888845443726,0.049861375242471695),(-2.2038317837314025e-08,0.0771591067314148,0.049861326813697815),(-0.25805795192718506,-0.03475359082221985,0.04986129328608513),(0.17846617102622986,-0.15455520153045654,0.04986138269305229),(-1.529285498236277e-08,-0.07715907692909241,0.049861352890729904),(-0.17846627533435822,-0.1545550525188446,0.049861323088407516),(0.2580578029155731,-0.8116105794906616,0.049861494451761246),(-1.5711103173998708e-07,-0.923523485660553,0.04986147582530975),(-0.2580580711364746,-0.8116105198860168,0.04986141249537468),(-0.1784663051366806,-0.6918091773986816,0.049861419945955276),(-1.340541757599567e-07,-0.7692052721977234,0.049861449748277664),(0.1784660816192627,-0.6918091773986816,0.04986146464943886)],
-            [(1,2),(0,3),(3,5),(2,4),(0,6),(5,6),(1,7),(4,7),(0,8),(1,8),(7,9),(6,9),(8,9),(2,10),(3,10),(4,11),(5,11),(10,11),(5,12),(12,13),(11,13),(13,14),(4,14),(10,16),(15,16),(3,15),(2,17),(16,17),(9,19),(18,19),(6,18),(7,20),(19,20),(8,22),(21,22),(1,21),(0,23),(22,23),(14,20),(12,18),(15,23),(17,21),(12,15),(13,16),(14,17),(20,21),(19,22),(18,23)],
-            [(6,0,3,5),(1,7,4,2),(0,6,9,8),(8,9,7,1),(2,4,11,10),(10,11,5,3),(11,13,12,5),(4,14,13,11),(3,15,16,10),(10,16,17,2),(6,18,19,9),(9,19,20,7),(1,21,22,8),(23,0,8,22),(7,20,14,4),(5,12,18,6),(0,23,15,3),(2,17,21,1),(16,15,12,13),(17,16,13,14),(22,21,20,19),(23,22,19,18),(21,17,14,20),(15,23,18,12)]
-            )
-            bpy.context.scene.objects.link(object)            
-            ## ESCALO EL HUESO
-            bpy.data.objects['EslabonNov'+str(hueso.name)].scale= (hueso.length*mult,hueso.length*mult,hueso.length*mult)        
-            ## EMPARENTO
-            bpy.data.objects['EslabonNov'+str(hueso.name)].parent=ARMATURE
-            bpy.data.objects['EslabonNov'+str(hueso.name)].parent_type = 'BONE'
-            bpy.data.objects['EslabonNov'+str(hueso.name)].parent_bone=hueso.name         
-        
-        for hueso in bpy.context.active_object.pose.bones:
-            if VAR_SWITCH == 1:
-                creahuesocero(hueso)
-            else:
-                creahuesonoventa(hueso)    
-            if VAR_SWITCH == 1:
-                VAR_SWITCH = 0
-                print(VAR_SWITCH)
-            else :
-                VAR_SWITCH = 1
-                print(VAR_SWITCH)                      
-        # SI NO TILDAMOS CURVERIG
-        if curverig == True:                           
-            # VARIABLES
-            LISTA_POINTC=[]
-            ACTARM=bpy.context.active_object            
-            # CREO DATA , OBJETO Y LO CONECTO A LA ESCENA
-            crv= bpy.data.curves.new("CurvaCable", "CURVE")
-            obCable=bpy.data.objects.new("Cable",crv)
-            bpy.context.scene.objects.link(obCable)            
-            # SETEO ATRIBUTOS
-            crv.dimensions = "3D"
-            crv.resolution_u = 10
-            crv.resolution_v = 10
-            crv.twist_mode = "MINIMUM"            
-            # CREO LISTA DE COORDENADAS DE TAIL Y HEAD            
-            LISTA_POINTC.append((
-                ACTARM.data.bones[0].head_local[0],
-                ACTARM.data.bones[0].head_local[1],
-                ACTARM.data.bones[0].head_local[2],
-                1
-            ))            
-            print("huesos: "+ str(len(ACTARM.data.bones)))
-            for hueso in ACTARM.data.bones:
-                LISTA_POINTC.append((hueso.tail_local[0],hueso.tail_local[1],hueso.tail_local[2],1))               
-            # CREO EL SPLINE
-            spline=crv.splines.new("NURBS")
-            lencoord= len(LISTA_POINTC)
-            print("lencoord--> :"+str(lencoord))
-            rango=range(lencoord)
-            spline.points.add(lencoord-1)
-            for punto in rango:
-                spline.points[punto].co = LISTA_POINTC[punto]
-                print(LISTA_POINTC[punto])
-            # SETEO ENDPOINT
-            bpy.data.objects['Cable'].data.splines[0].use_endpoint_u= True            
-            # SELECCIONO LA CURVA
-            bpy.ops.object.select_all(action='DESELECT')
-            bpy.data.objects['Cable'].select=1
-            bpy.context.scene.objects.active=bpy.data.objects['Cable']            
-            # PASO A EDIT
-            bpy.ops.object.mode_set(mode='EDIT')            
-            # CREO HOOKS
-            POINTSTEP=0
-            for POINT in bpy.data.objects['Cable'].data.splines[0].points:
-                bpy.ops.curve.select_all(action="DESELECT")
-                bpy.data.objects['Cable'].data.splines[0].points[POINTSTEP].select=1
-                bpy.ops.object.hook_add_newob()
-                POINTSTEP+=1            
-            # PASO A SELECCIONAR LOS OBJETOS
-            bpy.ops.object.mode_set(mode='OBJECT')
-            bpy.ops.object.select_all(action='DESELECT')
-            ACTARM.select=1
-            bpy.context.scene.objects.active=bpy.data.objects['Armature']
-            bpy.ops.object.mode_set(mode='POSE')
-            bpy.ops.pose.select_all(action='DESELECT')
-            ACTARM.data.bones[-1].select=1
-            ACTARM.data.bones.active=ACTARM.data.bones[-1]
-            # SETEO IK SPLINE
-            bpy.ops.pose.constraint_add_with_targets(type='SPLINE_IK')
-            ACTARM.pose.bones[-1].constraints['Spline IK'].target = bpy.data.objects['Cable']
-            ACTARM.pose.bones[-1].constraints['Spline IK'].chain_count=100
-            bpy.context.active_object.pose.bones[-1].constraints['Spline IK'].use_y_stretch= False     
-            # VUELVO A OBJECT MODE
-            bpy.ops.object.mode_set(mode='OBJECT')	
-    else:
-        self.report({'WARNING'}, "Active Object must be an Armature")            	
-                             
-            
-#---------------        
-from bpy.props import *
-
-class MESH_OT_chain_maker(bpy.types.Operator):
-    bl_idname="mesh.primitive_oscurart_chain_add"
-    bl_label="Oscurart Chain"
-    bl_options={'REGISTER','UNDO'}
-    
-    curverig= BoolProperty(name="Curve Rig", default=False)
-    multiplier= FloatProperty (name="Scale", default=1 , min=0.01, max=100.0)
-
-    @classmethod
-    def poll(cls, context):
-        return (context.object is not None)       
-    
-    def execute(self, context):
-        makeChain(self, context, self.multiplier,self.curverig)
-        return {'FINISHED'}
-    
-def menu_oscChain(self, context):
-    self.layout.operator("mesh.primitive_oscurart_chain_add", 
-        text="Oscurart Chain", 
-        icon='LINKED')
-
-def register():
-   bpy.utils.register_module(__name__)
-   bpy.types.INFO_MT_mesh_add.append(menu_oscChain)
- 
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_mesh_add.remove(menu_oscChain)
-    
- 
-if __name__ == "__main__":
-    register()    
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_mesh_chain_rope/oscurart_rope_maker.py b/release/scripts/addons_contrib/add_mesh_chain_rope/oscurart_rope_maker.py
deleted file mode 100644
index e355887..0000000
--- a/release/scripts/addons_contrib/add_mesh_chain_rope/oscurart_rope_maker.py
+++ /dev/null
@@ -1,198 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Oscurart Rope Maker",
-    "author": "Oscurart",
-    "version": (1,1),
-    "blender": (2, 56, 0),
-    "api": 3800,
-    "location": "Add > Curve > Oscurart Rope",
-    "description": "Create ropes",
-    "warning": "",
-    "wiki_url": "oscurart.blogspot.com",
-    "tracker_url": "",
-    "category": "Object"}
-
-
-
-import bpy, math
-
-
-
-
-
-def makeRope (context, DISTPOS, curvaResU, radius, FE, CUERDAS, stResU,DIAMETRO):    
-    
-    # CREO DATA , OBJETO Y LO CONECTO A LA ESCENA
-    crv= bpy.data.curves.new("CurvaCable", "CURVE")
-    obCable=bpy.data.objects.new("Cable",crv)
-    bpy.context.scene.objects.link(obCable)
-    
-    # SETEO ATRIBUTOS
-    crv.dimensions = "3D"
-    crv.resolution_u = 10
-    crv.resolution_v = 10
-    crv.twist_mode = "MINIMUM"
-    
-    # LISTA DE COMPONENTES
-    coordenadas= [
-        (0,radius,0,radius),
-        (radius,0,0,radius),
-        (0,-radius,0,radius),
-        (-radius,0,0,radius)
-    ]
-    
-    
-    
-    # CREO EL SPLINE
-    spline=crv.splines.new("NURBS")
-    lencoord= len(coordenadas)
-    #print("lencoord--> :"+str(lencoord))
-    rango=range(lencoord)
-    spline.points.add(lencoord-1)
-    for punto in rango:
-        spline.points[punto].co = coordenadas[punto]
-        #print(punto)
-        
-        
-    # MODIFICACIONES DE DATA
-    spline.use_cyclic_u = True
-    spline.resolution_u = curvaResU
-    spline.order_u = 3    
-    spline.use_endpoint_u = True
-    
-    
-    ## ==CREO CADENAS==
-    
-    ## DIVIDO EL RADIO POR LA CANTIDAD DE LINEAS Y SETEO UNA LISTA
-    
-    GRADOS=[]
-    VALORPORPARTE=[]
-    DIVISION=360/CUERDAS
-    TAJADA=0
-    
-    for parte in range(0,CUERDAS):
-        GRADOS.append(TAJADA)
-        TAJADA+=DIVISION
-        
-
-    
-    for GRAD in GRADOS:
-
-
-        # VARIABLES
-        FC=0
-        VARLISTVER=[]
-       
-        VARANGLEY=0
-        VARANGLEZ=90
-        VARPOSX=0
-        EDGEINDEX=0
-        # DEFINO EL PESO PARA LAS COORDENADAS
-        WEIGHT = 1
-        
-        while FC < FE:           
-            ## CREA 3 CADENAS EN 0 90 Y 180 GRADOS 
-            VARLISTVER.append((VARPOSX, math.sin(math.radians(GRAD))/(1/DIAMETRO) , math.sin(math.radians(GRAD+90))/(1/DIAMETRO),WEIGHT))
-    
-            GRAD += 30
-            FC += 1
-            VARPOSX += DISTPOS
-     
-        
-        
-        # CREO DATA , OBJETO Y LO CONECTO A LA ESCENA
-        crv= bpy.data.curves.new("curvaData", "CURVE")
-        ob=bpy.data.objects.new("Curva",crv)
-        bpy.context.scene.objects.link(ob)
-        
-        # SETEO ATRIBUTOS
-        crv.dimensions = "3D"
-        crv.resolution_u = 10
-        crv.resolution_v = 10
-        crv.twist_mode = "MINIMUM"
-        
-        # LISTA DE COMPONENTES
-        coordenadas= VARLISTVER
-        
-        
-        
-        # CREO EL SPLINE
-        spline=crv.splines.new("NURBS")
-        lencoord= len(coordenadas)
-        #print("lencoord--> :"+str(lencoord))
-        rango=range(lencoord)
-        spline.points.add(lencoord-1)
-        for punto in rango:
-            spline.points[punto].co = coordenadas[punto]
-            #print(punto)
-            
-            
-        # MODIFICACIONES DE DATA
-        spline.use_cyclic_u = False
-        spline.resolution_u = stResU
-        spline.order_u = 3    
-        spline.use_endpoint_u = True
-        
-        ob.data.bevel_object= bpy.data.objects["Cable"]
-        
-        #print(VARLISTVER)
-        
-#---------------        
-from bpy.props import *
-
-class OBJECT_OT_add_object(bpy.types.Operator):
-    bl_idname="curve.primitive_osc_rope_add"
-    bl_label="Oscurart Rope"
-    bl_options={'REGISTER','UNDO'}
-    
-    strands = IntProperty (name="Strands", default=5 , min=1, max=1000, step=1)
-    diameter = FloatProperty (name="Diameter", default=1 , min=0, max=1000)
-    distPos= FloatProperty (name="Stretch", default=1 , min=0.01, max=100.0)
-    vertices= IntProperty (name="Length", default=10 , min=0, max=1000, step=1)
-    distResU= IntProperty (name="Resolution V", default=5 , min=1, max=1000, step=1)
-    stResU= IntProperty (name="Resolution U", default=5 , min=1, max=1000, step=1)
-    radio= FloatProperty (name="Radius", default=1 , min=0, max=1000)
-
-    def execute(self, context):
-        makeRope(context, 
-            self.distPos,self.distResU,self.radio,self.vertices,self.strands, self.stResU,self.diameter)
-        return {'FINISHED'}
-    
-# Registration
-
-def oscRopeButton(self, context):
-    self.layout.operator(
-        OBJECT_OT_add_object.bl_idname,
-        text="Oscurart Rope",
-        icon="PLUGIN")
-
-
-def register():
-    bpy.utils.register_class(OBJECT_OT_add_object)
-    bpy.types.INFO_MT_curve_add.append(oscRopeButton)
-
-
-def unregister():
-    bpy.utils.unregister_class(OBJECT_OT_add_object)
-    bpy.types.INFO_MT_curve_add.remove(oscRopeButton)
-
-
-if __name__ == '__main__':
-    register()
diff --git a/release/scripts/addons_contrib/add_mesh_clusters/__init__.py b/release/scripts/addons_contrib/add_mesh_clusters/__init__.py
deleted file mode 100644
index 8d8f56d..0000000
--- a/release/scripts/addons_contrib/add_mesh_clusters/__init__.py
+++ /dev/null
@@ -1,524 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-#
-#  Main author       : Clemens Barth (Blendphys at root-1.de)
-#  Authors           : Clemens Barth, Christine Mottet (Icosahedra), ...
-#
-#  Homepage(Wiki)    : http://development.root-1.de/Atomic_Blender.php
-#
-#  Start of project              : 2012-03-25 by Clemens Barth
-#  First publication in Blender  : 2012-05-27 by Clemens Barth
-#  Last modified                 : 2013-01-03
-#
-#
-#
-#  To do:
-#  ======
-#
-#  1. Include other shapes: dodecahedron, ...
-#  2. Skin option for parabolic shaped clusters
-#  3. Skin option for icosahedron
-#  4. Icosahedron: unlimited size ... 
-#
-
-bl_info = {
-    "name": "Atomic Blender - Cluster",
-    "description": "Creating cluster formed by atoms",
-    "author": "Clemens Barth",
-    "version": (0, 5),
-    "blender": (2, 60, 0),
-    "location": "Panel: View 3D - Tools (left side)",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Add_Mesh/Cluster",
-    "tracker_url": "http://projects.blender.org/tracker/"
-                   "index.php?func=detail&aid=31618&group_id=153&atid=468",
-    "category": "Add Mesh"
-}
-
-import os
-import io
-import bpy
-from bpy.types import Operator, Panel
-from bpy_extras.io_utils import ImportHelper, ExportHelper
-from bpy.props import (StringProperty,
-                       BoolProperty,
-                       EnumProperty,
-                       IntProperty,
-                       FloatProperty)
-
-from . import add_mesh_cluster
-
-ATOM_Cluster_PANEL = 0
-
-# -----------------------------------------------------------------------------
-#                                                                           GUI
-
-
-class CLASS_ImportCluster(bpy.types.Operator):
-    bl_idname = "mesh.cluster"
-    bl_label = "Atom cluster"
-    bl_options = {'REGISTER', 'UNDO', 'PRESET'}
-
-    def execute(self, context):
-
-        global ATOM_Cluster_PANEL
-        ATOM_Cluster_PANEL = 1
-
-        return {'FINISHED'}
-
-
-
-class CLASS_atom_cluster_panel(Panel):
-    bl_label       = "Atomic Blender - Cluster"
-    bl_space_type  = "VIEW_3D"
-    bl_region_type = "TOOL_PROPS"
-
-
-    @classmethod
-    def poll(self, context):
-        global ATOM_Cluster_PANEL
-        
-        if ATOM_Cluster_PANEL == 0:
-            return False
-        
-        return True
-
-    def draw(self, context):
-        layout = self.layout
-        
-        scn = context.scene.atom_cluster
-
-        row = layout.row()
-        row.label(text="Cluster properties")
-        box = layout.box()
-        row = box.row()
-        row.prop(scn, "shape")
-
-        if scn.shape in ["parabolid_square","parabolid_ab","parabolid_abc"]:
-            row = box.row()
-            row.prop(scn, "parabol_diameter")
-            row = box.row()
-            row.prop(scn, "parabol_height")
-        elif scn.shape in ["icosahedron"]:
-            row = box.row()
-            row.prop(scn, "icosahedron_size")
-        else:
-            row = box.row()
-            row.prop(scn, "size")
-            row = box.row()
-            row.prop(scn, "skin")
-
-        row = box.row()
-        row.prop(scn, "lattice_parameter")
-        row = box.row()
-        row.prop(scn, "element")
-        row = box.row()
-        row.prop(scn, "radius_type")        
-        row = box.row()
-        row.prop(scn, "scale_radius")
-        row = box.row()
-        row.prop(scn, "scale_distances")
-        
-        row = layout.row()
-        row.label(text="Load cluster")
-        box = layout.box()
-        row = box.row()    
-        row.operator("atom_cluster.load")
-        row = box.row()
-        row.label(text="Number of atoms")
-        row = box.row()
-        row.prop(scn, "atom_number_total")  
-        row = box.row()
-        row.prop(scn, "atom_number_drawn")  
-        
-        row = layout.row()
-        row.label(text="Modify cluster")
-        box = layout.box()
-        row = box.row()
-        row.label(text="All changes concern:")
-        row = box.row()
-        row.prop(scn, "radius_how")
-        row = box.row()
-        row.label(text="1. Change type of radii")
-        row = box.row()
-        row.prop(scn, "radius_type")
-        row = box.row()
-        row.label(text="2. Change atom radii by scale")
-        row = box.row()
-        col = row.column()
-        col.prop(scn, "radius_all")         
-        col = row.column(align=True)
-        col.operator( "atom_cluster.radius_all_bigger" )
-        col.operator( "atom_cluster.radius_all_smaller" )
-
-
-# The properties (gadgets) in the panel. They all go to scene
-# during initialization (see end) 
-class CLASS_atom_cluster_Properties(bpy.types.PropertyGroup):
-
-    def Callback_radius_type(self, context):
-        scn = bpy.context.scene.atom_cluster
-        DEF_atom_cluster_radius_type(scn.radius_type,
-                                     scn.radius_how,)
-
-    size = FloatProperty(
-        name = "Size", default=30.0, min=0.1,
-        description = "Size of cluster in Angstroem")
-    skin = FloatProperty(
-        name = "Skin", default=1.0, min=0.0, max = 1.0,
-        description = "Skin of cluster in % of size (skin=1.0: show all atoms, skin=0.1: show only the outer atoms)")
-    parabol_diameter = FloatProperty(
-        name = "Diameter", default=30.0, min=0.1,
-        description = "Top diameter in Angstroem")
-    parabol_height = FloatProperty(
-        name = "Height", default=30.0, min=0.1, 
-        description = "Height in Angstroem")
-    icosahedron_size = IntProperty(
-        name = "Size", default=1, min=1, max=13, 
-        description = "Size n: 1 (13 atoms), 2 (55 atoms), 3 (147 atoms), 4 (309 atoms), 5 (561 atoms), ..., 13 (8217 atoms)")
-    shape = EnumProperty(
-        name="",
-        description="Choose the shape of the cluster",
-        items=(('sphere_square',  "Sphere - square",   "Sphere with square lattice"),
-               ('sphere_hex_ab',  "Sphere - hex ab",  "Sphere with hexagonal ab-lattice"),
-               ('sphere_hex_abc', "Sphere - hex abc", "Sphere with hexagonal abc-lattice"),
-               ('pyramide_square',  "Pyramide - Square",    "Pyramide: square (abc-lattice)"),
-               ('pyramide_hex_abc', "Pyramide - Tetraeder", "Pyramide: tetraeder (abcabc-lattice)"),
-               ('octahedron',           "Octahedron",           "Octahedron"),
-               ('truncated_octahedron', "Truncated octahedron", "Truncated octahedron"),
-               ('icosahedron', "Icosahedron", "Icosahedron"),
-               ('parabolid_square', "Paraboloid: square",  "Paraboloid with square lattice"),
-               ('parabolid_ab',     "Paraboloid: hex ab",  "Paraboloid with ab-lattice"),
-               ('parabolid_abc',    "Paraboloid: hex abc", "Paraboloid with abc-lattice")),
-               default='sphere_square',)  
-    lattice_parameter = FloatProperty(
-        name = "Lattice", default=4.08, min=1.0,
-        description = "Lattice parameter in Angstroem")
-    element = StringProperty(name="Element",
-        default="Gold", description = "Enter the name of the element")
-    radius_type = EnumProperty(
-        name="Radius",
-        description="Which type of atom radii?",
-        items=(('0',"predefined", "Use pre-defined radii"),
-               ('1',"atomic", "Use atomic radii"),
-               ('2',"van der Waals","Use van der Waals radii")),
-               default='0',)
-    scale_radius = FloatProperty(
-        name = "Scale R", default=1.0, min=0.0,
-        description = "Scale radius of atoms")
-    scale_distances = FloatProperty(
-        name = "Scale d", default=1.0, min=0.0,
-        description = "Scale distances")
-        
-    atom_number_total = StringProperty(name="Total",
-        default="---", description = "Number of all atoms in the cluster")    
-    atom_number_drawn = StringProperty(name="Drawn",
-        default="---", description = "Number of drawn atoms in the cluster")    
-        
-    radius_how = EnumProperty(
-        name="",
-        description="Which objects shall be modified?",
-        items=(('ALL_ACTIVE',"all active objects", "in the current layer"),
-               ('ALL_IN_LAYER',"all"," in active layer(s)")),
-               default='ALL_ACTIVE',)
-    radius_type = EnumProperty(
-        name="Type",
-        description="Which type of atom radii?",
-        items=(('0',"predefined", "Use pre-defined radii"),
-               ('1',"atomic", "Use atomic radii"),
-               ('2',"van der Waals","Use van der Waals radii")),
-               default='0',update=Callback_radius_type)
-    radius_all = FloatProperty(
-        name="Scale", default = 1.05, min=0.0,
-        description="Put in the scale factor")
-        
-
-# The button for reloading the atoms and creating the scene
-class CLASS_atom_cluster_load_button(Operator):
-    bl_idname = "atom_cluster.load"
-    bl_label = "Load"
-    bl_description = "Load the cluster"
-
-    def execute(self, context):
-        scn    = context.scene.atom_cluster
-
-        add_mesh_cluster.DEF_atom_read_atom_data()
-        del add_mesh_cluster.ATOM_CLUSTER_ALL_ATOMS[:]
-
-        if scn.shape in ["parabolid_ab", "parabolid_abc", "parabolid_square"]:
-            parameter1 = scn.parabol_height
-            parameter2 = scn.parabol_diameter
-        elif scn.shape == "pyramide_hex_abc":
-            parameter1 = scn.size * 1.6
-            parameter2 = scn.skin
-        elif scn.shape == "pyramide_square":
-            parameter1 = scn.size * 1.4
-            parameter2 = scn.skin
-        elif scn.shape in ["octahedron", "truncated_octahedron"]:
-            parameter1 = scn.size * 1.4
-            parameter2 = scn.skin
-        elif scn.shape in ["icosahedron"]:
-            parameter1 = scn.icosahedron_size 
-        else:
-            parameter1 = scn.size
-            parameter2 = scn.skin
-
-        if scn.shape in ["octahedron", "truncated_octahedron", "sphere_square", "pyramide_square", "parabolid_square"]:
-            numbers = add_mesh_cluster.create_square_lattice(
-                                scn.shape, 
-                                parameter1, 
-                                parameter2,
-                                (scn.lattice_parameter/2.0))
-
-        if scn.shape in ["sphere_hex_ab", "parabolid_ab"]:
-            numbers = add_mesh_cluster.create_hexagonal_abab_lattice(
-                                scn.shape, 
-                                parameter1,
-                                parameter2, 
-                                scn.lattice_parameter)
-
-        if scn.shape in ["sphere_hex_abc", "pyramide_hex_abc", "parabolid_abc"]:
-            numbers = add_mesh_cluster.create_hexagonal_abcabc_lattice(
-                                scn.shape, 
-                                parameter1,
-                                parameter2, 
-                                scn.lattice_parameter)
-                                
-        if scn.shape in ["icosahedron"]:
-            numbers = add_mesh_cluster.create_icosahedron( 
-                                parameter1, 
-                                scn.lattice_parameter)
-
-        DEF_atom_draw_atoms(scn.element,
-                            scn.radius_type,
-                            scn.scale_radius,
-                            scn.scale_distances)                        
-
-        scn.atom_number_total = str(numbers[0])
-        scn.atom_number_drawn = str(numbers[1])
-        
-        return {'FINISHED'}
-        
-
-def DEF_atom_draw_atoms(prop_element,
-                        prop_radius_type,
-                        prop_scale_radius,
-                        prop_scale_distances):
-
-    current_layers=bpy.context.scene.layers
-                        
-    for element in add_mesh_cluster.ATOM_CLUSTER_ELEMENTS:
-        if prop_element in element.name:
-            number = element.number
-            name = element.name
-            color = element.color
-            radii = element.radii
-            break   
-    
-    material = bpy.data.materials.new(name)
-    material.name = name
-    material.diffuse_color = color
-
-    atom_vertices = []
-    for atom in add_mesh_cluster.ATOM_CLUSTER_ALL_ATOMS:
-        atom_vertices.append( atom.location * prop_scale_distances )
-    
-    # Build the mesh
-    atom_mesh = bpy.data.meshes.new("Mesh_"+name)
-    atom_mesh.from_pydata(atom_vertices, [], [])
-    atom_mesh.update()
-    new_atom_mesh = bpy.data.objects.new(name, atom_mesh)
-    bpy.context.scene.objects.link(new_atom_mesh)
-    
-    bpy.ops.surface.primitive_nurbs_surface_sphere_add(
-                            view_align=False, enter_editmode=False,
-                            location=(0,0,0), rotation=(0.0, 0.0, 0.0),
-                            layers=current_layers)
-
-    ball = bpy.context.scene.objects.active
-    ball.scale  = (radii[int(prop_radius_type)]*prop_scale_radius,) * 3
-
-    ball.active_material = material
-    ball.parent = new_atom_mesh
-    new_atom_mesh.dupli_type = 'VERTS'
-
-    # ------------------------------------------------------------------------
-    # SELECT ALL LOADED OBJECTS
-    bpy.ops.object.select_all(action='DESELECT')
-    new_atom_mesh.select = True
-    bpy.context.scene.objects.active = new_atom_mesh
-
-    return True
-
-
-# Routine to modify the radii via the type: predefined, atomic or van der Waals
-# Explanations here are also valid for the next 3 DEFs.
-def DEF_atom_cluster_radius_type(rtype,how):
-
-    if how == "ALL_IN_LAYER":
-
-        # Note all layers that are active.
-        layers = []
-        for i in range(20):
-            if bpy.context.scene.layers[i] == True:
-                layers.append(i)
-
-        # Put all objects, which are in the layers, into a list.
-        change_objects = []
-        for obj in bpy.context.scene.objects:
-            for layer in layers:
-                if obj.layers[layer] == True:
-                    change_objects.append(obj)
-
-        # Consider all objects, which are in the list 'change_objects'.
-        for obj in change_objects:
-            if len(obj.children) != 0:
-                if obj.children[0].type == "SURFACE" or obj.children[0].type  == "MESH":
-                    for element in add_mesh_cluster.ATOM_CLUSTER_ELEMENTS:
-                        if element.name in obj.name:
-                            obj.children[0].scale = (element.radii[int(rtype)],) * 3
-            else:
-                if obj.type == "SURFACE" or obj.type == "MESH":
-                    for element in add_mesh_cluster.ATOM_CLUSTER_ELEMENTS:
-                        if element.name in obj.name:
-                            obj.scale = (element.radii[int(rtype)],) * 3
-                            
-
-# Routine to scale the radii of all atoms
-def DEF_atom_cluster_radius_all(scale, how):
-
-    if how == "ALL_IN_LAYER":
-
-        layers = []
-        for i in range(20):
-            if bpy.context.scene.layers[i] == True:
-                layers.append(i)
-
-        change_objects = []
-        for obj in bpy.context.scene.objects:
-            for layer in layers:
-                if obj.layers[layer] == True:
-                    change_objects.append(obj)
-
-        for obj in change_objects:
-            if len(obj.children) != 0:
-                if obj.children[0].type == "SURFACE" or obj.children[0].type  == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.children[0].scale *= scale
-            else:
-                if obj.type == "SURFACE" or obj.type == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.scale *= scale
-
-    if how == "ALL_ACTIVE":
-        for obj in bpy.context.selected_objects:
-            if len(obj.children) != 0:
-                if obj.children[0].type == "SURFACE" or obj.children[0].type  == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.children[0].scale *= scale
-            else:
-                if obj.type == "SURFACE" or obj.type == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.scale *= scale
-
-
-# Button for increasing the radii of all atoms
-class CLASS_atom_cluster_radius_all_bigger_button(Operator):
-    bl_idname = "atom_cluster.radius_all_bigger"
-    bl_label = "Bigger ..."
-    bl_description = "Increase the radii of the atoms"
-
-    def execute(self, context):
-        scn = bpy.context.scene.atom_cluster
-        DEF_atom_cluster_radius_all(
-                scn.radius_all,
-                scn.radius_how,)
-        return {'FINISHED'}
-
-
-# Button for decreasing the radii of all atoms
-class CLASS_atom_cluster_radius_all_smaller_button(Operator):
-    bl_idname = "atom_cluster.radius_all_smaller"
-    bl_label = "Smaller ..."
-    bl_description = "Decrease the radii of the atoms"
-
-    def execute(self, context):
-        scn = bpy.context.scene.atom_cluster
-        DEF_atom_cluster_radius_all(
-                1.0/scn.radius_all,
-                scn.radius_how,)
-        return {'FINISHED'}
-
-
-# Routine to scale the radii of all atoms
-def DEF_atom_cluster_radius_all(scale, how):
-
-    if how == "ALL_IN_LAYER":
-
-        layers = []
-        for i in range(20):
-            if bpy.context.scene.layers[i] == True:
-                layers.append(i)
-
-        change_objects = []
-        for obj in bpy.context.scene.objects:
-            for layer in layers:
-                if obj.layers[layer] == True:
-                    change_objects.append(obj)
-
-
-        for obj in change_objects:
-            if len(obj.children) != 0:
-                if obj.children[0].type == "SURFACE" or obj.children[0].type  == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.children[0].scale *= scale
-            else:
-                if obj.type == "SURFACE" or obj.type == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.scale *= scale
-
-    if how == "ALL_ACTIVE":
-        for obj in bpy.context.selected_objects:
-            if len(obj.children) != 0:
-                if obj.children[0].type == "SURFACE" or obj.children[0].type  == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.children[0].scale *= scale
-            else:
-                if obj.type == "SURFACE" or obj.type == "MESH":
-                    if "Stick" not in obj.name:
-                        obj.scale *= scale
-
-
-# The entry into the menu 'file -> import'
-def DEF_menu_func(self, context):
-    self.layout.operator(CLASS_ImportCluster.bl_idname, icon='PLUGIN')
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.Scene.atom_cluster = bpy.props.PointerProperty(type=
-                                                  CLASS_atom_cluster_Properties)    
-    bpy.types.INFO_MT_mesh_add.append(DEF_menu_func)
-    
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_mesh_add.remove(DEF_menu_func)
-
-if __name__ == "__main__":
-
-    register()
diff --git a/release/scripts/addons_contrib/add_mesh_clusters/add_mesh_cluster.py b/release/scripts/addons_contrib/add_mesh_clusters/add_mesh_cluster.py
deleted file mode 100644
index 9e30203..0000000
--- a/release/scripts/addons_contrib/add_mesh_clusters/add_mesh_cluster.py
+++ /dev/null
@@ -1,1321 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-import io
-import math
-import os
-import copy
-from math import pi, cos, sin, tan, sqrt
-from mathutils import Vector, Matrix
-from copy import copy
-
-# -----------------------------------------------------------------------------
-#                                                  Atom, stick and element data
-
-
-# This is a list that contains some data of all possible elements. The structure
-# is as follows:
-#
-# 1, "Hydrogen", "H", [0.0,0.0,1.0], 0.32, 0.32, 0.32 , -1 , 1.54   means
-#
-# No., name, short name, color, radius (used), radius (covalent), radius (atomic),
-#
-# charge state 1, radius (ionic) 1, charge state 2, radius (ionic) 2, ... all
-# charge states for any atom are listed, if existing.
-# The list is fixed and cannot be changed ... (see below)
-
-ATOM_CLUSTER_ELEMENTS_DEFAULT = (
-( 1,      "Hydrogen",        "H", (  1.0,   1.0,   1.0), 0.32, 0.32, 0.79 , -1 , 1.54 ),
-( 2,        "Helium",       "He", ( 0.85,   1.0,   1.0), 0.93, 0.93, 0.49 ),
-( 3,       "Lithium",       "Li", (  0.8,  0.50,   1.0), 1.23, 1.23, 2.05 ,  1 , 0.68 ),
-( 4,     "Beryllium",       "Be", ( 0.76,   1.0,   0.0), 0.90, 0.90, 1.40 ,  1 , 0.44 ,  2 , 0.35 ),
-( 5,         "Boron",        "B", (  1.0,  0.70,  0.70), 0.82, 0.82, 1.17 ,  1 , 0.35 ,  3 , 0.23 ),
-( 6,        "Carbon",        "C", ( 0.56,  0.56,  0.56), 0.77, 0.77, 0.91 , -4 , 2.60 ,  4 , 0.16 ),
-( 7,      "Nitrogen",        "N", ( 0.18,  0.31,  0.97), 0.75, 0.75, 0.75 , -3 , 1.71 ,  1 , 0.25 ,  3 , 0.16 ,  5 , 0.13 ),
-( 8,        "Oxygen",        "O", (  1.0,  0.05,  0.05), 0.73, 0.73, 0.65 , -2 , 1.32 , -1 , 1.76 ,  1 , 0.22 ,  6 , 0.09 ),
-( 9,      "Fluorine",        "F", ( 0.56,  0.87,  0.31), 0.72, 0.72, 0.57 , -1 , 1.33 ,  7 , 0.08 ),
-(10,          "Neon",       "Ne", ( 0.70,  0.89,  0.96), 0.71, 0.71, 0.51 ,  1 , 1.12 ),
-(11,        "Sodium",       "Na", ( 0.67,  0.36,  0.94), 1.54, 1.54, 2.23 ,  1 , 0.97 ),
-(12,     "Magnesium",       "Mg", ( 0.54,   1.0,   0.0), 1.36, 1.36, 1.72 ,  1 , 0.82 ,  2 , 0.66 ),
-(13,     "Aluminium",       "Al", ( 0.74,  0.65,  0.65), 1.18, 1.18, 1.82 ,  3 , 0.51 ),
-(14,       "Silicon",       "Si", ( 0.94,  0.78,  0.62), 1.11, 1.11, 1.46 , -4 , 2.71 , -1 , 3.84 ,  1 , 0.65 ,  4 , 0.42 ),
-(15,    "Phosphorus",        "P", (  1.0,  0.50,   0.0), 1.06, 1.06, 1.23 , -3 , 2.12 ,  3 , 0.44 ,  5 , 0.35 ),
-(16,        "Sulfur",        "S", (  1.0,   1.0,  0.18), 1.02, 1.02, 1.09 , -2 , 1.84 ,  2 , 2.19 ,  4 , 0.37 ,  6 , 0.30 ),
-(17,      "Chlorine",       "Cl", ( 0.12,  0.94,  0.12), 0.99, 0.99, 0.97 , -1 , 1.81 ,  5 , 0.34 ,  7 , 0.27 ),
-(18,         "Argon",       "Ar", ( 0.50,  0.81,  0.89), 0.98, 0.98, 0.88 ,  1 , 1.54 ),
-(19,     "Potassium",        "K", ( 0.56,  0.25,  0.83), 2.03, 2.03, 2.77 ,  1 , 0.81 ),
-(20,       "Calcium",       "Ca", ( 0.23,   1.0,   0.0), 1.74, 1.74, 2.23 ,  1 , 1.18 ,  2 , 0.99 ),
-(21,      "Scandium",       "Sc", ( 0.90,  0.90,  0.90), 1.44, 1.44, 2.09 ,  3 , 0.73 ),
-(22,      "Titanium",       "Ti", ( 0.74,  0.76,  0.78), 1.32, 1.32, 2.00 ,  1 , 0.96 ,  2 , 0.94 ,  3 , 0.76 ,  4 , 0.68 ),
-(23,      "Vanadium",        "V", ( 0.65,  0.65,  0.67), 1.22, 1.22, 1.92 ,  2 , 0.88 ,  3 , 0.74 ,  4 , 0.63 ,  5 , 0.59 ),
-(24,      "Chromium",       "Cr", ( 0.54,   0.6,  0.78), 1.18, 1.18, 1.85 ,  1 , 0.81 ,  2 , 0.89 ,  3 , 0.63 ,  6 , 0.52 ),
-(25,     "Manganese",       "Mn", ( 0.61,  0.47,  0.78), 1.17, 1.17, 1.79 ,  2 , 0.80 ,  3 , 0.66 ,  4 , 0.60 ,  7 , 0.46 ),
-(26,          "Iron",       "Fe", ( 0.87,   0.4,   0.2), 1.17, 1.17, 1.72 ,  2 , 0.74 ,  3 , 0.64 ),
-(27,        "Cobalt",       "Co", ( 0.94,  0.56,  0.62), 1.16, 1.16, 1.67 ,  2 , 0.72 ,  3 , 0.63 ),
-(28,        "Nickel",       "Ni", ( 0.31,  0.81,  0.31), 1.15, 1.15, 1.62 ,  2 , 0.69 ),
-(29,        "Copper",       "Cu", ( 0.78,  0.50,   0.2), 1.17, 1.17, 1.57 ,  1 , 0.96 ,  2 , 0.72 ),
-(30,          "Zinc",       "Zn", ( 0.49,  0.50,  0.69), 1.25, 1.25, 1.53 ,  1 , 0.88 ,  2 , 0.74 ),
-(31,       "Gallium",       "Ga", ( 0.76,  0.56,  0.56), 1.26, 1.26, 1.81 ,  1 , 0.81 ,  3 , 0.62 ),
-(32,     "Germanium",       "Ge", (  0.4,  0.56,  0.56), 1.22, 1.22, 1.52 , -4 , 2.72 ,  2 , 0.73 ,  4 , 0.53 ),
-(33,       "Arsenic",       "As", ( 0.74,  0.50,  0.89), 1.20, 1.20, 1.33 , -3 , 2.22 ,  3 , 0.58 ,  5 , 0.46 ),
-(34,      "Selenium",       "Se", (  1.0,  0.63,   0.0), 1.16, 1.16, 1.22 , -2 , 1.91 , -1 , 2.32 ,  1 , 0.66 ,  4 , 0.50 ,  6 , 0.42 ),
-(35,       "Bromine",       "Br", ( 0.65,  0.16,  0.16), 1.14, 1.14, 1.12 , -1 , 1.96 ,  5 , 0.47 ,  7 , 0.39 ),
-(36,       "Krypton",       "Kr", ( 0.36,  0.72,  0.81), 1.31, 1.31, 1.24 ),
-(37,      "Rubidium",       "Rb", ( 0.43,  0.18,  0.69), 2.16, 2.16, 2.98 ,  1 , 1.47 ),
-(38,     "Strontium",       "Sr", (  0.0,   1.0,   0.0), 1.91, 1.91, 2.45 ,  2 , 1.12 ),
-(39,       "Yttrium",        "Y", ( 0.58,   1.0,   1.0), 1.62, 1.62, 2.27 ,  3 , 0.89 ),
-(40,     "Zirconium",       "Zr", ( 0.58,  0.87,  0.87), 1.45, 1.45, 2.16 ,  1 , 1.09 ,  4 , 0.79 ),
-(41,       "Niobium",       "Nb", ( 0.45,  0.76,  0.78), 1.34, 1.34, 2.08 ,  1 , 1.00 ,  4 , 0.74 ,  5 , 0.69 ),
-(42,    "Molybdenum",       "Mo", ( 0.32,  0.70,  0.70), 1.30, 1.30, 2.01 ,  1 , 0.93 ,  4 , 0.70 ,  6 , 0.62 ),
-(43,    "Technetium",       "Tc", ( 0.23,  0.61,  0.61), 1.27, 1.27, 1.95 ,  7 , 0.97 ),
-(44,     "Ruthenium",       "Ru", ( 0.14,  0.56,  0.56), 1.25, 1.25, 1.89 ,  4 , 0.67 ),
-(45,       "Rhodium",       "Rh", ( 0.03,  0.49,  0.54), 1.25, 1.25, 1.83 ,  3 , 0.68 ),
-(46,     "Palladium",       "Pd", (  0.0,  0.41,  0.52), 1.28, 1.28, 1.79 ,  2 , 0.80 ,  4 , 0.65 ),
-(47,        "Silver",       "Ag", ( 0.75,  0.75,  0.75), 1.34, 1.34, 1.75 ,  1 , 1.26 ,  2 , 0.89 ),
-(48,       "Cadmium",       "Cd", (  1.0,  0.85,  0.56), 1.48, 1.48, 1.71 ,  1 , 1.14 ,  2 , 0.97 ),
-(49,        "Indium",       "In", ( 0.65,  0.45,  0.45), 1.44, 1.44, 2.00 ,  3 , 0.81 ),
-(50,           "Tin",       "Sn", (  0.4,  0.50,  0.50), 1.41, 1.41, 1.72 , -4 , 2.94 , -1 , 3.70 ,  2 , 0.93 ,  4 , 0.71 ),
-(51,      "Antimony",       "Sb", ( 0.61,  0.38,  0.70), 1.40, 1.40, 1.53 , -3 , 2.45 ,  3 , 0.76 ,  5 , 0.62 ),
-(52,     "Tellurium",       "Te", ( 0.83,  0.47,   0.0), 1.36, 1.36, 1.42 , -2 , 2.11 , -1 , 2.50 ,  1 , 0.82 ,  4 , 0.70 ,  6 , 0.56 ),
-(53,        "Iodine",        "I", ( 0.58,   0.0,  0.58), 1.33, 1.33, 1.32 , -1 , 2.20 ,  5 , 0.62 ,  7 , 0.50 ),
-(54,         "Xenon",       "Xe", ( 0.25,  0.61,  0.69), 1.31, 1.31, 1.24 ),
-(55,       "Caesium",       "Cs", ( 0.34,  0.09,  0.56), 2.35, 2.35, 3.35 ,  1 , 1.67 ),
-(56,        "Barium",       "Ba", (  0.0,  0.78,   0.0), 1.98, 1.98, 2.78 ,  1 , 1.53 ,  2 , 1.34 ),
-(57,     "Lanthanum",       "La", ( 0.43,  0.83,   1.0), 1.69, 1.69, 2.74 ,  1 , 1.39 ,  3 , 1.06 ),
-(58,        "Cerium",       "Ce", (  1.0,   1.0,  0.78), 1.65, 1.65, 2.70 ,  1 , 1.27 ,  3 , 1.03 ,  4 , 0.92 ),
-(59,  "Praseodymium",       "Pr", ( 0.85,   1.0,  0.78), 1.65, 1.65, 2.67 ,  3 , 1.01 ,  4 , 0.90 ),
-(60,     "Neodymium",       "Nd", ( 0.78,   1.0,  0.78), 1.64, 1.64, 2.64 ,  3 , 0.99 ),
-(61,    "Promethium",       "Pm", ( 0.63,   1.0,  0.78), 1.63, 1.63, 2.62 ,  3 , 0.97 ),
-(62,      "Samarium",       "Sm", ( 0.56,   1.0,  0.78), 1.62, 1.62, 2.59 ,  3 , 0.96 ),
-(63,      "Europium",       "Eu", ( 0.38,   1.0,  0.78), 1.85, 1.85, 2.56 ,  2 , 1.09 ,  3 , 0.95 ),
-(64,    "Gadolinium",       "Gd", ( 0.27,   1.0,  0.78), 1.61, 1.61, 2.54 ,  3 , 0.93 ),
-(65,       "Terbium",       "Tb", ( 0.18,   1.0,  0.78), 1.59, 1.59, 2.51 ,  3 , 0.92 ,  4 , 0.84 ),
-(66,    "Dysprosium",       "Dy", ( 0.12,   1.0,  0.78), 1.59, 1.59, 2.49 ,  3 , 0.90 ),
-(67,       "Holmium",       "Ho", (  0.0,   1.0,  0.61), 1.58, 1.58, 2.47 ,  3 , 0.89 ),
-(68,        "Erbium",       "Er", (  0.0,  0.90,  0.45), 1.57, 1.57, 2.45 ,  3 , 0.88 ),
-(69,       "Thulium",       "Tm", (  0.0,  0.83,  0.32), 1.56, 1.56, 2.42 ,  3 , 0.87 ),
-(70,     "Ytterbium",       "Yb", (  0.0,  0.74,  0.21), 1.74, 1.74, 2.40 ,  2 , 0.93 ,  3 , 0.85 ),
-(71,      "Lutetium",       "Lu", (  0.0,  0.67,  0.14), 1.56, 1.56, 2.25 ,  3 , 0.85 ),
-(72,       "Hafnium",       "Hf", ( 0.30,  0.76,   1.0), 1.44, 1.44, 2.16 ,  4 , 0.78 ),
-(73,      "Tantalum",       "Ta", ( 0.30,  0.65,   1.0), 1.34, 1.34, 2.09 ,  5 , 0.68 ),
-(74,      "Tungsten",        "W", ( 0.12,  0.58,  0.83), 1.30, 1.30, 2.02 ,  4 , 0.70 ,  6 , 0.62 ),
-(75,       "Rhenium",       "Re", ( 0.14,  0.49,  0.67), 1.28, 1.28, 1.97 ,  4 , 0.72 ,  7 , 0.56 ),
-(76,        "Osmium",       "Os", ( 0.14,   0.4,  0.58), 1.26, 1.26, 1.92 ,  4 , 0.88 ,  6 , 0.69 ),
-(77,       "Iridium",       "Ir", ( 0.09,  0.32,  0.52), 1.27, 1.27, 1.87 ,  4 , 0.68 ),
-(78,     "Platinium",       "Pt", ( 0.81,  0.81,  0.87), 1.30, 1.30, 1.83 ,  2 , 0.80 ,  4 , 0.65 ),
-(79,          "Gold",       "Au", (  1.0,  0.81,  0.13), 1.34, 1.34, 1.79 ,  1 , 1.37 ,  3 , 0.85 ),
-(80,       "Mercury",       "Hg", ( 0.72,  0.72,  0.81), 1.49, 1.49, 1.76 ,  1 , 1.27 ,  2 , 1.10 ),
-(81,      "Thallium",       "Tl", ( 0.65,  0.32,  0.30), 1.48, 1.48, 2.08 ,  1 , 1.47 ,  3 , 0.95 ),
-(82,          "Lead",       "Pb", ( 0.34,  0.34,  0.38), 1.47, 1.47, 1.81 ,  2 , 1.20 ,  4 , 0.84 ),
-(83,       "Bismuth",       "Bi", ( 0.61,  0.30,  0.70), 1.46, 1.46, 1.63 ,  1 , 0.98 ,  3 , 0.96 ,  5 , 0.74 ),
-(84,      "Polonium",       "Po", ( 0.67,  0.36,   0.0), 1.46, 1.46, 1.53 ,  6 , 0.67 ),
-(85,      "Astatine",       "At", ( 0.45,  0.30,  0.27), 1.45, 1.45, 1.43 , -3 , 2.22 ,  3 , 0.85 ,  5 , 0.46 ),
-(86,         "Radon",       "Rn", ( 0.25,  0.50,  0.58), 1.00, 1.00, 1.34 ),
-(87,      "Francium",       "Fr", ( 0.25,   0.0,   0.4), 1.00, 1.00, 1.00 ,  1 , 1.80 ),
-(88,        "Radium",       "Ra", (  0.0,  0.49,   0.0), 1.00, 1.00, 1.00 ,  2 , 1.43 ),
-(89,      "Actinium",       "Ac", ( 0.43,  0.67,  0.98), 1.00, 1.00, 1.00 ,  3 , 1.18 ),
-(90,       "Thorium",       "Th", (  0.0,  0.72,   1.0), 1.65, 1.65, 1.00 ,  4 , 1.02 ),
-(91,  "Protactinium",       "Pa", (  0.0,  0.63,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.13 ,  4 , 0.98 ,  5 , 0.89 ),
-(92,       "Uranium",        "U", (  0.0,  0.56,   1.0), 1.42, 1.42, 1.00 ,  4 , 0.97 ,  6 , 0.80 ),
-(93,     "Neptunium",       "Np", (  0.0,  0.50,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.10 ,  4 , 0.95 ,  7 , 0.71 ),
-(94,     "Plutonium",       "Pu", (  0.0,  0.41,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.08 ,  4 , 0.93 ),
-(95,     "Americium",       "Am", ( 0.32,  0.36,  0.94), 1.00, 1.00, 1.00 ,  3 , 1.07 ,  4 , 0.92 ),
-(96,        "Curium",       "Cm", ( 0.47,  0.36,  0.89), 1.00, 1.00, 1.00 ),
-(97,     "Berkelium",       "Bk", ( 0.54,  0.30,  0.89), 1.00, 1.00, 1.00 ),
-(98,   "Californium",       "Cf", ( 0.63,  0.21,  0.83), 1.00, 1.00, 1.00 ),
-(99,   "Einsteinium",       "Es", ( 0.70,  0.12,  0.83), 1.00, 1.00, 1.00 ),
-(100,       "Fermium",       "Fm", ( 0.70,  0.12,  0.72), 1.00, 1.00, 1.00 ),
-(101,   "Mendelevium",       "Md", ( 0.70,  0.05,  0.65), 1.00, 1.00, 1.00 ),
-(102,      "Nobelium",       "No", ( 0.74,  0.05,  0.52), 1.00, 1.00, 1.00 ),
-(103,    "Lawrencium",       "Lr", ( 0.78,   0.0,   0.4), 1.00, 1.00, 1.00 ),
-(104,       "Vacancy",      "Vac", (  0.5,   0.5,   0.5), 1.00, 1.00, 1.00),
-(105,       "Default",  "Default", (  1.0,   1.0,   1.0), 1.00, 1.00, 1.00),
-(106,         "Stick",    "Stick", (  0.5,   0.5,   0.5), 1.00, 1.00, 1.00),
-)
-
-# This list here contains all data of the elements and will be used during
-# runtime. It is a list of classes.
-# During executing Atomic Blender, the list will be initialized with the fixed
-# data from above via the class structure below (CLASS_atom_pdb_Elements). We
-# have then one fixed list (above), which will never be changed, and a list of
-# classes with same data. The latter can be modified via loading a separate
-# custom data file.
-ATOM_CLUSTER_ELEMENTS = []
-ATOM_CLUSTER_ALL_ATOMS = []
-
-# This is the class, which stores the properties for one element.
-class CLASS_atom_cluster_Elements(object):
-    __slots__ = ('number', 'name', 'short_name', 'color', 'radii', 'radii_ionic')
-    def __init__(self, number, name, short_name, color, radii, radii_ionic):
-        self.number = number
-        self.name = name
-        self.short_name = short_name
-        self.color = color
-        self.radii = radii
-        self.radii_ionic = radii_ionic
-
-# This is the class, which stores the properties of one atom.
-class CLASS_atom_cluster_atom(object):  
-    __slots__ = ('location')
-    def __init__(self, location):
-        self.location = location
-
-# -----------------------------------------------------------------------------
-#                                                                Read atom data
-        
-def DEF_atom_read_atom_data():
-
-    del ATOM_CLUSTER_ELEMENTS[:]
-
-    for item in ATOM_CLUSTER_ELEMENTS_DEFAULT:
-
-        # All three radii into a list
-        radii = [item[4],item[5],item[6]]
-        # The handling of the ionic radii will be done later. So far, it is an
-        # empty list.
-        radii_ionic = []
-
-        li = CLASS_atom_cluster_Elements(item[0],item[1],item[2],item[3],
-                                         radii,radii_ionic)
-        ATOM_CLUSTER_ELEMENTS.append(li)
-
-  
-# -----------------------------------------------------------------------------
-#                                                           Routines for shapes
-
-def vec_in_sphere(atom_pos,size, skin):
-
-    regular = True
-    inner   = True
-
-    if atom_pos.length > size/2.0:
-        regular = False
-
-    if atom_pos.length < (size/2.0)*(1-skin):
-        inner = False
-
-    return (regular, inner)
-
-
-def vec_in_parabole(atom_pos, height, diameter):
-
-    regular = True
-    inner   = True
-      
-    px = atom_pos[0]  
-    py = atom_pos[1]  
-    pz = atom_pos[2] + height/2.0
-    
-    a = diameter / sqrt(4 * height)
-    
-    
-    if pz < 0.0:
-        return (False, False)
-    if px == 0.0 and py == 0.0:
-        return (True, True)
-         
-    if py == 0.0:
-        y = 0.0
-        x = a * a * pz / px
-        z = x * x / (a * a)
-    else:
-        y = pz * py * a * a / (px*px + py*py)
-        x = y * px / py
-        z = (x*x + y*y) / (a * a)
-    
-    if( atom_pos.length > sqrt(x*x+y*y+z*z) ):
-        regular = False
-    
-    return (regular, inner)
-
-
-def vec_in_pyramide_square(atom_pos, size, skin):
-    
-    """
-    Please, if possible leave all this! The code documents the 
-    mathemetical way of cutting a pyramide with square base.
-
-    P1 = Vector((-size/2, 0.0, -size/4))
-    P2 = Vector((0.0, -size/2, -size/4))
-    P4 = Vector((size/2, 0.0,  -size/4))
-    P5 = Vector((0.0, size/2,  -size/4))
-    P6 = Vector((0.0, 0.0,      size/4))
-
-    # First face
-    v11 = P1 - P2
-    v12 = P1 - P6
-    n1 = v11.cross(v12)
-    g1 = -n1 * P1
-    
-    # Second face
-    v21 = P6 - P4
-    v22 = P6 - P5
-    n2 = v21.cross(v22)
-    g2 = -n2 * P6
-
-    # Third face
-    v31 = P1 - P5
-    v32 = P1 - P6
-    n3 = v32.cross(v31)
-    g3 = -n3 * P1
-    
-    # Forth face
-    v41 = P6 - P2
-    v42 = P2 - P4
-    n4 = v41.cross(v42)
-    g4 = -n4 * P2
-    
-    # Fith face, base
-    v51 = P2 - P1
-    v52 = P2 - P4
-    n5 = v51.cross(v52)
-    g5 = -n5 * P2
-    """
- 
-    # A much faster way for calculation:
-    size2 = size  * size
-    size3 = size2 * size
-    n1 = Vector((-1/4, -1/4,  1/4)) * size2
-    g1 = -1/16 * size3
-    n2 = Vector(( 1/4,  1/4,  1/4)) * size2
-    g2 = g1
-    n3 = Vector((-1/4,  1/4,  1/4)) * size2
-    g3 = g1
-    n4 = Vector(( 1/4, -1/4,  1/4)) * size2
-    g4 = g1
-    n5 = Vector(( 0.0,  0.0, -1/2)) * size2
-    g5 = -1/8 * size3  
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-    distance_plane_5 = abs((n5 * atom_pos - g5)/n5.length)
-    on_plane_5 = (atom_pos - n5 * (distance_plane_5/n5.length)).length
-
-    regular = True
-    inner   = True
-    if(atom_pos.length > on_plane_1):
-        regular = False
-    if(atom_pos.length > on_plane_2):
-        regular = False
-    if(atom_pos.length > on_plane_3):
-        regular = False
-    if(atom_pos.length > on_plane_4):
-        regular = False
-    if(atom_pos.length > on_plane_5):
-        regular = False
-
-    if skin == 1.0:
-        return (regular, inner)
-
-    size = size * (1.0 - skin)
-    
-    size2 = size  * size
-    size3 = size2 * size
-    n1 = Vector((-1/4, -1/4,  1/4)) * size2
-    g1 = -1/16 * size3
-    n2 = Vector(( 1/4,  1/4,  1/4)) * size2
-    g2 = g1
-    n3 = Vector((-1/4,  1/4,  1/4)) * size2
-    g3 = g1
-    n4 = Vector(( 1/4, -1/4,  1/4)) * size2
-    g4 = g1
-    n5 = Vector(( 0.0,  0.0, -1/2)) * size2
-    g5 = -1/8 * size3  
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-    distance_plane_5 = abs((n5 * atom_pos - g5)/n5.length)
-    on_plane_5 = (atom_pos - n5 * (distance_plane_5/n5.length)).length
-    
-    inner = False
-    if(atom_pos.length > on_plane_1):
-        inner = True
-    if(atom_pos.length > on_plane_2):
-        inner = True
-    if(atom_pos.length > on_plane_3):
-        inner = True
-    if(atom_pos.length > on_plane_4):
-        inner = True
-    if(atom_pos.length > on_plane_5):
-        inner = True
-
-    return (regular, inner)
-
-
-def vec_in_pyramide_hex_abc(atom_pos, size, skin):
-    
-    a = size/2.0
-    #c = size/2.0*cos((30/360)*2.0*pi)
-    c = size * 0.4330127020
-    #s = size/2.0*sin((30/360)*2.0*pi)  
-    s = size * 0.25   
-    #h = 2.0 * (sqrt(6.0)/3.0) * c
-    h = 1.632993162 * c
-
-    """
-    Please, if possible leave all this! The code documents the 
-    mathemetical way of cutting a tetraeder.
-
-    P1 = Vector((0.0,   a, 0.0))
-    P2 = Vector(( -c,  -s, 0.0))
-    P3 = Vector((  c,  -s, 0.0))    
-    P4 = Vector((0.0, 0.0,  h))
-    C = (P1+P2+P3+P4)/4.0
-    P1 = P1 - C
-    P2 = P2 - C
-    P3 = P3 - C
-    P4 = P4 - C
-
-    # First face
-    v11 = P1 - P2
-    v12 = P1 - P4
-    n1 = v11.cross(v12)
-    g1 = -n1 * P1
-    
-    # Second face
-    v21 = P2 - P3
-    v22 = P2 - P4
-    n2 = v21.cross(v22)
-    g2 = -n2 * P2
-
-    # Third face
-    v31 = P3 - P1
-    v32 = P3 - P4
-    n3 = v31.cross(v32)
-    g3 = -n3 * P3
-    
-    # Forth face
-    v41 = P2 - P1
-    v42 = P2 - P3
-    n4 = v41.cross(v42)
-    g4 = -n4 * P1
-    """
-
-    n1 = Vector(( -h*(a+s),    c*h,    c*a     ))
-    g1 = -1/2*c*(a*h+s*h)
-    n2 = Vector((        0, -2*c*h,  2*c*s     ))
-    g2 = -1/2*c*(a*h+s*h)
-    n3 = Vector((  h*(a+s),    c*h,    a*c     ))
-    g3 = -1/2*c*(a*h+s*h)
-    n4 = Vector((        0,      0, -2*c*(s+a) ))
-    g4 = -1/2*h*c*(s+a)
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-
-    regular = True
-    inner   = True
-    if(atom_pos.length > on_plane_1):
-        regular = False
-    if(atom_pos.length > on_plane_2):
-        regular = False
-    if(atom_pos.length > on_plane_3):
-        regular = False
-    if(atom_pos.length > on_plane_4):
-        regular = False
-
-    if skin == 1.0:
-        return (regular, inner)
-
-    size = size * (1.0 - skin)
-    
-    a = size/2.0
-    #c = size/2.0*cos((30/360)*2.0*pi)
-    c= size * 0.4330127020
-    #s = size/2.0*sin((30/360)*2.0*pi)  
-    s = size * 0.25   
-    #h = 2.0 * (sqrt(6.0)/3.0) * c
-    h = 1.632993162 * c
-
-    n1 = Vector(( -h*(a+s),    c*h,    c*a     ))
-    g1 = -1/2*c*(a*h+s*h)
-    n2 = Vector((        0, -2*c*h,  2*c*s     ))
-    g2 = -1/2*c*(a*h+s*h)
-    n3 = Vector((  h*(a+s),    c*h,    a*c     ))
-    g3 = -1/2*c*(a*h+s*h)
-    n4 = Vector((        0,      0, -2*c*(s+a) ))
-    g4 = -1/2*h*c*(s+a)
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-    
-    inner = False
-    if(atom_pos.length > on_plane_1):
-        inner = True
-    if(atom_pos.length > on_plane_2):
-        inner = True
-    if(atom_pos.length > on_plane_3):
-        inner = True
-    if(atom_pos.length > on_plane_4):
-        inner = True
-
-    return (regular, inner)
-    
-
-
-def vec_in_octahedron(atom_pos,size, skin):
-
-    regular = True
-    inner   = True
-
-    """
-    Please, if possible leave all this! The code documents the 
-    mathemetical way of cutting an octahedron.
-
-    P1 = Vector((-size/2, 0.0, 0.0))
-    P2 = Vector((0.0, -size/2, 0.0))
-    P3 = Vector((0.0, 0.0, -size/2))
-    P4 = Vector((size/2, 0.0, 0.0))
-    P5 = Vector((0.0, size/2, 0.0))
-    P6 = Vector((0.0, 0.0, size/2))
-
-    # First face
-    v11 = P2 - P1
-    v12 = P2 - P3
-    n1 = v11.cross(v12)
-    g1 = -n1 * P2
-    
-    # Second face
-    v21 = P1 - P5
-    v22 = P1 - P3
-    n2 = v21.cross(v22)
-    g2 = -n2 * P1 
-    
-    # Third face
-    v31 = P1 - P2
-    v32 = P1 - P6
-    n3 = v31.cross(v32)
-    g3 = -n3 * P1
-    
-    # Forth face
-    v41 = P6 - P2
-    v42 = P2 - P4
-    n4 = v41.cross(v42)
-    g4 = -n4 * P2
-
-    # Fith face
-    v51 = P2 - P3
-    v52 = P2 - P4
-    n5 = v51.cross(v52)
-    g5 = -n5 * P2
-
-    # Six face
-    v61 = P6 - P4
-    v62 = P6 - P5
-    n6 = v61.cross(v62)
-    g6 = -n6 * P6
-
-    # Seventh face
-    v71 = P5 - P4
-    v72 = P5 - P3
-    n7 = v71.cross(v72)
-    g7 = -n7 * P5
-
-    # Eigth face
-    v81 = P1 - P5
-    v82 = P1 - P6
-    n8 = v82.cross(v81)
-    g8 = -n8 * P1
-    """
- 
-    # A much faster way for calculation:
-    size2 = size  * size
-    size3 = size2 * size
-    n1 = Vector((-1/4, -1/4, -1/4)) * size2
-    g1 = -1/8 * size3
-    n2 = Vector((-1/4,  1/4, -1/4)) * size2
-    g2 = g1
-    n3 = Vector((-1/4, -1/4,  1/4)) * size2
-    g3 = g1
-    n4 = Vector(( 1/4, -1/4,  1/4)) * size2
-    g4 = g1
-    n5 = Vector(( 1/4, -1/4, -1/4)) * size2
-    g5 = g1
-    n6 = Vector(( 1/4,  1/4,  1/4)) * size2
-    g6 = g1
-    n7 = Vector(( 1/4,  1/4, -1/4)) * size2
-    g7 = g1
-    n8 = Vector((-1/4,  1/4,  1/4)) * size2
-    g8 = g1
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-    distance_plane_5 = abs((n5 * atom_pos - g5)/n5.length)
-    on_plane_5 = (atom_pos - n5 * (distance_plane_5/n5.length)).length
-    distance_plane_6 = abs((n6 * atom_pos - g6)/n6.length)
-    on_plane_6 = (atom_pos - n6 * (distance_plane_6/n6.length)).length
-    distance_plane_7 = abs((n7 * atom_pos - g7)/n7.length)
-    on_plane_7 = (atom_pos - n7 * (distance_plane_7/n7.length)).length
-    distance_plane_8 = abs((n8 * atom_pos - g8)/n8.length)
-    on_plane_8 = (atom_pos - n8 * (distance_plane_8/n8.length)).length
-
-    if(atom_pos.length > on_plane_1):
-        regular = False
-    if(atom_pos.length > on_plane_2):
-        regular = False
-    if(atom_pos.length > on_plane_3):
-        regular = False
-    if(atom_pos.length > on_plane_4):
-        regular = False
-    if(atom_pos.length > on_plane_5):
-        regular = False
-    if(atom_pos.length > on_plane_6):
-        regular = False
-    if(atom_pos.length > on_plane_7):
-        regular = False
-    if(atom_pos.length > on_plane_8):
-        regular = False
-
-    if skin == 1.0:
-        return (regular, inner)
-
-    size = size * (1.0 - skin)
-
-    size2 = size  * size
-    size3 = size2 * size
-    n1 = Vector((-1/4, -1/4, -1/4)) * size2
-    g1 = -1/8 * size3
-    n2 = Vector((-1/4,  1/4, -1/4)) * size2
-    g2 = g1
-    n3 = Vector((-1/4, -1/4,  1/4)) * size2
-    g3 = g1
-    n4 = Vector(( 1/4, -1/4,  1/4)) * size2
-    g4 = g1
-    n5 = Vector(( 1/4, -1/4, -1/4)) * size2
-    g5 = g1
-    n6 = Vector(( 1/4,  1/4,  1/4)) * size2
-    g6 = g1
-    n7 = Vector(( 1/4,  1/4, -1/4)) * size2
-    g7 = g1
-    n8 = Vector((-1/4,  1/4,  1/4)) * size2
-    g8 = g1
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-    distance_plane_5 = abs((n5 * atom_pos - g5)/n5.length)
-    on_plane_5 = (atom_pos - n5 * (distance_plane_5/n5.length)).length
-    distance_plane_6 = abs((n6 * atom_pos - g6)/n6.length)
-    on_plane_6 = (atom_pos - n6 * (distance_plane_6/n6.length)).length
-    distance_plane_7 = abs((n7 * atom_pos - g7)/n7.length)
-    on_plane_7 = (atom_pos - n7 * (distance_plane_7/n7.length)).length
-    distance_plane_8 = abs((n8 * atom_pos - g8)/n8.length)
-    on_plane_8 = (atom_pos - n8 * (distance_plane_8/n8.length)).length
-
-    inner = False
-    if(atom_pos.length > on_plane_1):
-        inner = True
-    if(atom_pos.length > on_plane_2):
-        inner = True
-    if(atom_pos.length > on_plane_3):
-        inner = True
-    if(atom_pos.length > on_plane_4):
-        inner = True
-    if(atom_pos.length > on_plane_5):
-        inner = True
-    if(atom_pos.length > on_plane_6):
-        inner = True
-    if(atom_pos.length > on_plane_7):
-        inner = True
-    if(atom_pos.length > on_plane_8):
-        inner = True
-
-    return (regular, inner)
-
-
-def vec_in_truncated_octahedron(atom_pos,size, skin):
-
-    regular = True
-    inner   = True
-
-    # The normal octahedron
-    size2 = size  * size
-    size3 = size2 * size
-    n1 = Vector((-1/4, -1/4, -1/4)) * size2
-    g1 = -1/8 * size3
-    n2 = Vector((-1/4,  1/4, -1/4)) * size2
-    g2 = g1
-    n3 = Vector((-1/4, -1/4,  1/4)) * size2
-    g3 = g1
-    n4 = Vector(( 1/4, -1/4,  1/4)) * size2
-    g4 = g1
-    n5 = Vector(( 1/4, -1/4, -1/4)) * size2
-    g5 = g1
-    n6 = Vector(( 1/4,  1/4,  1/4)) * size2
-    g6 = g1
-    n7 = Vector(( 1/4,  1/4, -1/4)) * size2
-    g7 = g1
-    n8 = Vector((-1/4,  1/4,  1/4)) * size2
-    g8 = g1
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-    distance_plane_5 = abs((n5 * atom_pos - g5)/n5.length)
-    on_plane_5 = (atom_pos - n5 * (distance_plane_5/n5.length)).length
-    distance_plane_6 = abs((n6 * atom_pos - g6)/n6.length)
-    on_plane_6 = (atom_pos - n6 * (distance_plane_6/n6.length)).length
-    distance_plane_7 = abs((n7 * atom_pos - g7)/n7.length)
-    on_plane_7 = (atom_pos - n7 * (distance_plane_7/n7.length)).length
-    distance_plane_8 = abs((n8 * atom_pos - g8)/n8.length)
-    on_plane_8 = (atom_pos - n8 * (distance_plane_8/n8.length)).length
-
-    # Here are the 6 additional faces
-    # pp = (size/2.0) - (sqrt(2.0)/2.0) * ((size/sqrt(2.0))/3.0)
-    pp = size / 3.0
-
-    n_1 = Vector((1.0,0.0,0.0)) 
-    n_2 = Vector((-1.0,0.0,0.0))           
-    n_3 = Vector((0.0,1.0,0.0))    
-    n_4 = Vector((0.0,-1.0,0.0))
-    n_5 = Vector((0.0,0.0,1.0))    
-    n_6 = Vector((0.0,0.0,-1.0))   
-
-    distance_plane_1b = abs((n_1 * atom_pos + pp)/n_1.length)
-    on_plane_1b = (atom_pos - n_1 * (distance_plane_1b/n_1.length)).length
-    distance_plane_2b = abs((n_2 * atom_pos + pp)/n_2.length)
-    on_plane_2b = (atom_pos - n_2 * (distance_plane_2b/n_2.length)).length
-    distance_plane_3b = abs((n_3 * atom_pos + pp)/n_3.length)
-    on_plane_3b = (atom_pos - n_3 * (distance_plane_3b/n_3.length)).length
-    distance_plane_4b = abs((n_4 * atom_pos + pp)/n_4.length)
-    on_plane_4b = (atom_pos - n_4 * (distance_plane_4b/n_4.length)).length
-    distance_plane_5b = abs((n_5 * atom_pos + pp)/n_5.length)
-    on_plane_5b = (atom_pos - n_5 * (distance_plane_5b/n_5.length)).length
-    distance_plane_6b = abs((n_6 * atom_pos + pp)/n_6.length)
-    on_plane_6b = (atom_pos - n_6 * (distance_plane_6b/n_6.length)).length
-
-    if(atom_pos.length > on_plane_1):
-        regular = False
-    if(atom_pos.length > on_plane_2):
-        regular = False
-    if(atom_pos.length > on_plane_3):
-        regular = False
-    if(atom_pos.length > on_plane_4):
-        regular = False
-    if(atom_pos.length > on_plane_5):
-        regular = False
-    if(atom_pos.length > on_plane_6):
-        regular = False
-    if(atom_pos.length > on_plane_7):
-        regular = False
-    if(atom_pos.length > on_plane_8):
-        regular = False
-    if(atom_pos.length > on_plane_1b):
-        regular = False
-    if(atom_pos.length > on_plane_2b):
-        regular = False
-    if(atom_pos.length > on_plane_3b):
-        regular = False
-    if(atom_pos.length > on_plane_4b):
-        regular = False
-    if(atom_pos.length > on_plane_5b):
-        regular = False
-    if(atom_pos.length > on_plane_6b):
-        regular = False
-
-    if skin == 1.0:
-        return (regular, inner)
-
-    size = size * (1.0 - skin)
-    
-    # The normal octahedron
-    size2 = size  * size
-    size3 = size2 * size
-    n1 = Vector((-1/4, -1/4, -1/4)) * size2
-    g1 = -1/8 * size3
-    n2 = Vector((-1/4,  1/4, -1/4)) * size2
-    g2 = g1
-    n3 = Vector((-1/4, -1/4,  1/4)) * size2
-    g3 = g1
-    n4 = Vector(( 1/4, -1/4,  1/4)) * size2
-    g4 = g1
-    n5 = Vector(( 1/4, -1/4, -1/4)) * size2
-    g5 = g1
-    n6 = Vector(( 1/4,  1/4,  1/4)) * size2
-    g6 = g1
-    n7 = Vector(( 1/4,  1/4, -1/4)) * size2
-    g7 = g1
-    n8 = Vector((-1/4,  1/4,  1/4)) * size2
-    g8 = g1
-
-    distance_plane_1 = abs((n1 * atom_pos - g1)/n1.length)
-    on_plane_1 = (atom_pos - n1 * (distance_plane_1/n1.length)).length
-    distance_plane_2 = abs((n2 * atom_pos - g2)/n2.length)
-    on_plane_2 = (atom_pos - n2 * (distance_plane_2/n2.length)).length
-    distance_plane_3 = abs((n3 * atom_pos - g3)/n3.length)
-    on_plane_3 = (atom_pos - n3 * (distance_plane_3/n3.length)).length
-    distance_plane_4 = abs((n4 * atom_pos - g4)/n4.length)
-    on_plane_4 = (atom_pos - n4 * (distance_plane_4/n4.length)).length
-    distance_plane_5 = abs((n5 * atom_pos - g5)/n5.length)
-    on_plane_5 = (atom_pos - n5 * (distance_plane_5/n5.length)).length
-    distance_plane_6 = abs((n6 * atom_pos - g6)/n6.length)
-    on_plane_6 = (atom_pos - n6 * (distance_plane_6/n6.length)).length
-    distance_plane_7 = abs((n7 * atom_pos - g7)/n7.length)
-    on_plane_7 = (atom_pos - n7 * (distance_plane_7/n7.length)).length
-    distance_plane_8 = abs((n8 * atom_pos - g8)/n8.length)
-    on_plane_8 = (atom_pos - n8 * (distance_plane_8/n8.length)).length
-
-    # Here are the 6 additional faces
-    # pp = (size/2.0) - (sqrt(2.0)/2.0) * ((size/sqrt(2.0))/3.0)
-    pp = size / 3.0
-
-    n_1 = Vector((1.0,0.0,0.0)) 
-    n_2 = Vector((-1.0,0.0,0.0))           
-    n_3 = Vector((0.0,1.0,0.0))    
-    n_4 = Vector((0.0,-1.0,0.0))
-    n_5 = Vector((0.0,0.0,1.0))    
-    n_6 = Vector((0.0,0.0,-1.0))   
-    
-    distance_plane_1b = abs((n_1 * atom_pos + pp)/n_1.length)
-    on_plane_1b = (atom_pos - n_1 * (distance_plane_1b/n_1.length)).length
-    distance_plane_2b = abs((n_2 * atom_pos + pp)/n_2.length)
-    on_plane_2b = (atom_pos - n_2 * (distance_plane_2b/n_2.length)).length
-    distance_plane_3b = abs((n_3 * atom_pos + pp)/n_3.length)
-    on_plane_3b = (atom_pos - n_3 * (distance_plane_3b/n_3.length)).length
-    distance_plane_4b = abs((n_4 * atom_pos + pp)/n_4.length)
-    on_plane_4b = (atom_pos - n_4 * (distance_plane_4b/n_4.length)).length
-    distance_plane_5b = abs((n_5 * atom_pos + pp)/n_5.length)
-    on_plane_5b = (atom_pos - n_5 * (distance_plane_5b/n_5.length)).length
-    distance_plane_6b = abs((n_6 * atom_pos + pp)/n_6.length)
-    on_plane_6b = (atom_pos - n_6 * (distance_plane_6b/n_6.length)).length
-
-    inner = False
-
-    if(atom_pos.length > on_plane_1):
-        inner = True
-    if(atom_pos.length > on_plane_2):
-        inner = True
-    if(atom_pos.length > on_plane_3):
-        inner = True
-    if(atom_pos.length > on_plane_4):
-        inner = True
-    if(atom_pos.length > on_plane_5):
-        inner = True
-    if(atom_pos.length > on_plane_6):
-        inner = True
-    if(atom_pos.length > on_plane_7):
-        inner = True
-    if(atom_pos.length > on_plane_8):
-        inner = True
-    if(atom_pos.length > on_plane_1b):
-        inner = True
-    if(atom_pos.length > on_plane_2b):
-        inner = True
-    if(atom_pos.length > on_plane_3b):
-        inner = True
-    if(atom_pos.length > on_plane_4b):
-        inner = True
-    if(atom_pos.length > on_plane_5b):
-        inner = True
-    if(atom_pos.length > on_plane_6b):
-        inner = True
-    
-    return (regular, inner)
-
-# -----------------------------------------------------------------------------
-#                                                         Routines for lattices
-
-def create_hexagonal_abcabc_lattice(ctype, size, skin, lattice):
-
-    atom_number_total = 0
-    atom_number_drawn = 0
-    y_displ = 0
-    z_displ = 0
-
-    """
-    e = (1/sqrt(2.0)) * lattice
-    f = sqrt(3.0/4.0) * e
-    df1 = (e/2.0) * tan((30.0/360.0)*2.0*pi)
-    df2 = (e/2.0) / cos((30.0/360.0)*2.0*pi)
-    g = sqrt(2.0/3.0) * e
-    """
-
-    e = 0.7071067810 * lattice
-    f = 0.8660254038 * e
-    df1 = 0.2886751348 * e
-    df2 = 0.5773502690 * e
-    g = 0.8164965810 * e
-
-    if ctype == "parabolid_abc":
-        # size = height, skin = diameter
-        number_x = int(skin/(2*e))+4
-        number_y = int(skin/(2*f))+4
-        number_z = int(size/(2*g))
-    else:
-        number_x = int(size/(2*e))+4
-        number_y = int(size/(2*f))+4
-        number_z = int(size/(2*g))+1+4
-
-
-    for k in range(-number_z,number_z+1):
-        for j in range(-number_y,number_y+1):
-            for i in range(-number_x,number_x+1):
-                atom = Vector((float(i)*e,float(j)*f,float(k)*g)) 
-
-                if y_displ == 1:
-                    if z_displ == 1:
-                        atom[0] += e/2.0  
-                    else:
-                        atom[0] -= e/2.0
-                if z_displ == 1:
-                    atom[0] -= e/2.0
-                    atom[1] += df1
-                if z_displ == 2:
-                    atom[0] += 0.0
-                    atom[1] += df2
-
-                if ctype == "sphere_hex_abc":
-                    message = vec_in_sphere(atom, size, skin)
-                elif ctype == "pyramide_hex_abc":
-                    # size = height, skin = diameter
-                    message = vec_in_pyramide_hex_abc(atom, size, skin)
-                elif ctype == "parabolid_abc":
-                    message = vec_in_parabole(atom, size, skin)          
-
-                if message[0] == True and message[1] == True:
-                    atom_add = CLASS_atom_cluster_atom(atom)
-                    ATOM_CLUSTER_ALL_ATOMS.append(atom_add)
-                    atom_number_total += 1
-                    atom_number_drawn += 1
-                if message[0] == True and message[1] == False:
-                    atom_number_total += 1                 
-          
-            if y_displ == 1:
-                y_displ = 0
-            else:
-                y_displ = 1
-
-        y_displ = 0
-        if z_displ == 0:
-           z_displ = 1
-        elif z_displ == 1:
-           z_displ = 2
-        else:
-           z_displ = 0
-
-    print("Atom positions calculated")
-
-    return (atom_number_total, atom_number_drawn)
-
-
-def create_hexagonal_abab_lattice(ctype, size, skin, lattice):
-
-    atom_number_total = 0
-    atom_number_drawn = 0
-    y_displ = "even"
-    z_displ = "even"
-
-    """
-    e = (1/sqrt(2.0)) * lattice
-    f = sqrt(3.0/4.0) * e
-    df = (e/2.0) * tan((30.0/360.0)*2*pi)
-    g = sqrt(2.0/3.0) * e
-    """
-
-    e = 0.7071067814 * lattice
-    f = 0.8660254038 * e
-    df = 0.2886751348 * e
-    g = 0.8164965810 * e
-
-
-    if ctype == "parabolid_ab":
-        # size = height, skin = diameter
-        number_x = int(skin/(2*e))+4
-        number_y = int(skin/(2*f))+4
-        number_z = int(size/(2*g))
-    else:
-        number_x = int(size/(2*e))+4
-        number_y = int(size/(2*f))+4
-        number_z = int(size/(2*g))+1+4
-
-
-    for k in range(-number_z,number_z+1):
-        for j in range(-number_y,number_y+1):
-            for i in range(-number_x,number_x+1):
-
-                atom = Vector((float(i)*e,float(j)*f,float(k)*g))
-          
-                if "odd" in y_displ:
-                    if "odd" in z_displ:
-                        atom[0] += e/2.0  
-                    else:
-                        atom[0] -= e/2.0
-                if "odd" in z_displ:
-                    atom[0] -= e/2.0
-                    atom[1] += df
-
-                if ctype == "sphere_hex_ab":
-                    message = vec_in_sphere(atom, size, skin)
-                elif ctype == "parabolid_ab":
-                    # size = height, skin = diameter
-                    message = vec_in_parabole(atom, size, skin)          
-          
-                if message[0] == True and message[1] == True:
-                    atom_add = CLASS_atom_cluster_atom(atom)
-                    ATOM_CLUSTER_ALL_ATOMS.append(atom_add)
-                    atom_number_total += 1
-                    atom_number_drawn += 1
-                if message[0] == True and message[1] == False:
-                    atom_number_total += 1  
-          
-            if "even" in y_displ:
-                y_displ = "odd"
-            else:
-                y_displ = "even"
-
-        y_displ = "even"
-        if "even" in z_displ:
-            z_displ = "odd"
-        else:
-            z_displ = "even"
-
-    print("Atom positions calculated")
-
-    return (atom_number_total, atom_number_drawn)
-
-
-def create_square_lattice(ctype, size, skin, lattice):
-
-    atom_number_total = 0
-    atom_number_drawn = 0
-    
-    if ctype == "parabolid_square":
-        # size = height, skin = diameter
-        number_k = int(size/(2.0*lattice))
-        number_j = int(skin/(2.0*lattice)) + 5
-        number_i = int(skin/(2.0*lattice)) + 5
-    else:
-        number_k = int(size/(2.0*lattice))
-        number_j = int(size/(2.0*lattice))
-        number_i = int(size/(2.0*lattice))       
-
-
-    for k in range(-number_k,number_k+1):
-        for j in range(-number_j,number_j+1):
-            for i in range(-number_i,number_i+1):
-
-                atom = Vector((float(i),float(j),float(k))) * lattice 
-
-                if ctype == "sphere_square":
-                    message = vec_in_sphere(atom, size, skin)
-                elif ctype == "pyramide_square":
-                    message = vec_in_pyramide_square(atom, size, skin)
-                elif ctype == "parabolid_square":
-                    # size = height, skin = diameter
-                    message = vec_in_parabole(atom, size, skin)          
-                elif ctype == "octahedron":
-                    message = vec_in_octahedron(atom, size, skin)            
-                elif ctype == "truncated_octahedron":
-                    message = vec_in_truncated_octahedron(atom,size, skin)
-
-                if message[0] == True and message[1] == True:
-                    atom_add = CLASS_atom_cluster_atom(atom)
-                    ATOM_CLUSTER_ALL_ATOMS.append(atom_add)
-                    atom_number_total += 1
-                    atom_number_drawn += 1
-                if message[0] == True and message[1] == False:
-                    atom_number_total += 1 
-
-    print("Atom positions calculated")
-
-    return (atom_number_total, atom_number_drawn)
-
-
-
-# -----------------------------------------------------------------------------
-#                                                   Routine for the icosahedron
-
-
-# Note that the icosahedron needs a special treatment since it requires a
-# non-common crystal lattice. The faces are (111) facets and the geometry
-# is five-fold. So far, a max size of 8217 atoms can be chosen.
-# More details about icosahedron shaped clusters can be found in:
-#
-# 1. C. Mottet, G. Tréglia, B. Legrand, Surface Science 383 (1997) L719-L727
-# 2. C. R. Henry, Surface Science Reports 31 (1998) 231-325
-
-# The following code is a translation from an existing Fortran code into Python.
-# The Fortran code has been created by Christine Mottet and translated by me
-# (Clemens Barth). 
-
-# Although a couple of code lines are non-typical for Python, it is best to
-# leave the code as is.
-#
-# To do:
-#
-# 1. Unlimited cluster size
-# 2. Skin effect
-
-def create_icosahedron(size, lattice):
-
-    natot = int(1 + (10*size*size+15*size+11)*size/3)
-
-    x = list(range(natot+1))
-    y = list(range(natot+1))
-    z = list(range(natot+1))
-
-    xs = list(range(12+1))
-    ys = list(range(12+1))
-    zs = list(range(12+1))
-
-    xa = [[[ [] for i in range(12+1)] for j in range(12+1)] for k in range(20+1)]
-    ya = [[[ [] for i in range(12+1)] for j in range(12+1)] for k in range(20+1)]
-    za = [[[ [] for i in range(12+1)] for j in range(12+1)] for k in range(20+1)]
-
-    naret  = [[ [] for i in range(12+1)] for j in range(12+1)]
-    nfacet = [[[ [] for i in range(12+1)] for j in range(12+1)] for k in range(12+1)]
-
-    rac2 = sqrt(2.0)
-    rac5 = sqrt(5.0)
-    tdef = (rac5+1.0)/2.0
-
-    rapp  = sqrt(2.0*(1.0-tdef/(tdef*tdef+1.0)))
-    nats  = 2 * (5*size*size+1)
-    nat   = 13
-    epsi  = 0.01
-
-    x[1] = 0.0
-    y[1] = 0.0
-    z[1] = 0.0
-
-    for i in range(2, 5+1):
-        z[i]   = 0.0
-        y[i+4] = 0.0
-        x[i+8] = 0.0
-    
-    for i in range(2, 3+1):
-        x[i]    =  tdef
-        x[i+2]  = -tdef
-        x[i+4]  =  1.0
-        x[i+6]  = -1.0
-        y[i+8]  =  tdef
-        y[i+10] = -tdef
-
-    for i in range(2, 4+1, 2):
-        y[i]   =  1.0
-        y[i+1] = -1.0
-        z[i+4] =  tdef
-        z[i+5] = -tdef
-        z[i+8] =  1.0
-        z[i+9] = -1.0
-
-    xdef = rac2 / sqrt(tdef * tdef + 1)
-
-    for i in range(2, 13+1):
-        x[i] = x[i] * xdef / 2.0
-        y[i] = y[i] * xdef / 2.0
-        z[i] = z[i] * xdef / 2.0
-
-    if size > 1:
-
-        for n in range (2, size+1):
-            ifacet = 0
-            iaret  = 0
-            inatf  = 0
-            for i in range(1, 12+1):
-                for j in range(1, 12+1):
-                    naret[i][j] = 0
-                    for k in range (1, 12+1): 
-                        nfacet[i][j][k] = 0
-
-            nl1 = 6
-            nl2 = 8
-            nl3 = 9
-            k1  = 0
-            k2  = 0
-            k3  = 0
-            k12 = 0
-            for i in range(1, 12+1):
-                nat += 1
-                xs[i] = n * x[i+1]
-                ys[i] = n * y[i+1]
-                zs[i] = n * z[i+1]
-                x[nat] = xs[i]
-                y[nat] = ys[i]
-                z[nat] = zs[i]
-                k1 += 1
-
-            for i in range(1, 12+1):
-                for j in range(2, 12+1):
-                    if j <= i:
-                        continue
-                    
-                    xij = xs[j] - xs[i]
-                    yij = ys[j] - ys[i]
-                    zij = zs[j] - zs[i]
-                    xij2 = xij * xij
-                    yij2 = yij * yij
-                    zij2 = zij * zij
-                    dij2 = xij2 + yij2 + zij2
-                    dssn = n * rapp / rac2
-                    dssn2 = dssn * dssn
-                    diffij = abs(dij2-dssn2)
-                    if diffij >= epsi:
-                        continue
-                    
-                    for k in range(3, 12+1):
-                        if k <= j:
-                            continue
-                        
-                        xjk = xs[k] - xs[j]
-                        yjk = ys[k] - ys[j]
-                        zjk = zs[k] - zs[j]
-                        xjk2 = xjk * xjk
-                        yjk2 = yjk * yjk
-                        zjk2 = zjk * zjk
-                        djk2 = xjk2 + yjk2 + zjk2
-                        diffjk = abs(djk2-dssn2)
-                        if diffjk >= epsi:
-                            continue
-                        
-                        xik = xs[k] - xs[i]
-                        yik = ys[k] - ys[i]
-                        zik = zs[k] - zs[i]
-                        xik2 = xik * xik
-                        yik2 = yik * yik
-                        zik2 = zik * zik
-                        dik2 = xik2 + yik2 + zik2
-                        diffik = abs(dik2-dssn2)
-                        if diffik >= epsi:
-                            continue
-                        
-                        if nfacet[i][j][k] != 0:
-                            continue
-
-                        ifacet += 1
-                        nfacet[i][j][k] = ifacet
-
-                        if naret[i][j] == 0:
-                            iaret += 1
-                            naret[i][j] = iaret
-                            for l in range(1,n-1+1):
-                                nat += 1
-                                xa[i][j][l] = xs[i]+l*(xs[j]-xs[i]) / n
-                                ya[i][j][l] = ys[i]+l*(ys[j]-ys[i]) / n
-                                za[i][j][l] = zs[i]+l*(zs[j]-zs[i]) / n
-                                x[nat] = xa[i][j][l]
-                                y[nat] = ya[i][j][l]
-                                z[nat] = za[i][j][l]
-
-                        if naret[i][k] == 0:
-                            iaret += 1
-                            naret[i][k] = iaret
-                            for l in range(1, n-1+1):
-                                nat += 1
-                                xa[i][k][l] = xs[i]+l*(xs[k]-xs[i]) / n
-                                ya[i][k][l] = ys[i]+l*(ys[k]-ys[i]) / n
-                                za[i][k][l] = zs[i]+l*(zs[k]-zs[i]) / n
-                                x[nat] = xa[i][k][l]
-                                y[nat] = ya[i][k][l]
-                                z[nat] = za[i][k][l]
-
-                        if naret[j][k] == 0:
-                            iaret += 1
-                            naret[j][k] = iaret
-                            for l in range(1, n-1+1):
-                                nat += 1
-                                xa[j][k][l] = xs[j]+l*(xs[k]-xs[j]) / n
-                                ya[j][k][l] = ys[j]+l*(ys[k]-ys[j]) / n
-                                za[j][k][l] = zs[j]+l*(zs[k]-zs[j]) / n
-                                x[nat] = xa[j][k][l]
-                                y[nat] = ya[j][k][l]
-                                z[nat] = za[j][k][l]
-
-                        for l in range(2, n-1+1):
-                            for ll in range(1, l-1+1):
-                                xf = xa[i][j][l]+ll*(xa[i][k][l]-xa[i][j][l]) / l
-                                yf = ya[i][j][l]+ll*(ya[i][k][l]-ya[i][j][l]) / l
-                                zf = za[i][j][l]+ll*(za[i][k][l]-za[i][j][l]) / l
-                                nat += 1
-                                inatf += 1
-                                x[nat] = xf
-                                y[nat] = yf
-                                z[nat] = zf
-                                k3 += 1
-
-    atom_number_total = 0
-    atom_number_drawn = 0
-
-    for i in range (1,natot+1):
-
-        atom = Vector((x[i],y[i],z[i])) * lattice 
-
-        atom_add = CLASS_atom_cluster_atom(atom)
-        ATOM_CLUSTER_ALL_ATOMS.append(atom_add)
-        atom_number_total += 1
-        atom_number_drawn += 1
-
-    return (atom_number_total, atom_number_drawn)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/release/scripts/addons_contrib/add_mesh_rocks/__init__.py b/release/scripts/addons_contrib/add_mesh_rocks/__init__.py
deleted file mode 100644
index c4c9f3e..0000000
--- a/release/scripts/addons_contrib/add_mesh_rocks/__init__.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# Paul "BrikBot" Marshall
-# Created: July 1, 2011
-# Last Modified: November 17, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-# Thanks to Meta-Androco, RickyBlender, Ace Dragon, and PKHG for ideas
-#   and testing.
-#
-# Coded in IDLE, tested in Blender 2.59.  NumPy Recommended.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  The Blender Rock Creation tool is for rapid generation of
-#  mesh rocks in Blender.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Rock Generator",
-    "author": "Paul Marshall (brikbot)",
-    "version": (1, 3),
-    "blender": (2, 61, 0),
-    "location": "View3D > Add > Rock Generator",
-    "description": "Adds a mesh rock to the Add Mesh menu",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6"\
-        "/Py/Scripts/Add_Mesh/Rock_Generator",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=27314",
-    "category": "Add Mesh"}
-
-if "bpy" in locals():
-    import imp
-    imp.reload(rockgen)
-else:
-    from add_mesh_rocks import rockgen
-
-import bpy
-
-
-# Register:
-def menu_func_rocks(self, context):
-    self.layout.operator(rockgen.rocks.bl_idname,
-                         text="Rock Generator",
-                         icon="PLUGIN")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_mesh_add.append(menu_func_rocks)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_mesh_add.remove(menu_func_rocks)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/add_mesh_rocks/add_mesh_rocks.xml b/release/scripts/addons_contrib/add_mesh_rocks/add_mesh_rocks.xml
deleted file mode 100644
index 0202486..0000000
--- a/release/scripts/addons_contrib/add_mesh_rocks/add_mesh_rocks.xml
+++ /dev/null
@@ -1,403 +0,0 @@
-<?xml version="1.0" ?>
-<!DOCTYPE settings [
-<!ELEMENT settings (default,preset*)>
-<!ELEMENT default (title,size,shape,material,random)>
-<!ELEMENT preset (title,size,shape,material,random)>
-<!ELEMENT title (#PCDATA)>
-<!ELEMENT size (scale+,skew+,use_scale_dis,scale_fac)>
-<!ELEMENT scale (axis,lower,upper)>
-<!ELEMENT axis (#PCDATA)>
-<!ELEMENT lower (#PCDATA)>
-<!ELEMENT upper (#PCDATA)>
-<!ELEMENT skew (axis,value)>
-<!ELEMENT value (#PCDATA)>
-<!ELEMENT use_scale_dis (#PCDATA)>
-<!ELEMENT scale_fac (#PCDATA)>
-<!ELEMENT shape (deform,rough,detail,display_detail,smooth_fac,smooth_it)>
-<!ELEMENT deform (#PCDATA)>
-<!ELEMENT rough (#PCDATA)>
-<!ELEMENT detail (#PCDATA)>
-<!ELEMENT display_detail (#PCDATA)>
-<!ELEMENT smooth_fac (#PCDATA)>
-<!ELEMENT smooth_it (#PCDATA)>
-<!ELEMENT material (mat_enable,mat_color,mat_bright,mat_rough,mat_spec,mat_hard,mat_use_trans,mat_alpha,mat_cloudy,mat_IOR,mat_mossy)>
-<!ELEMENT mat_enable (#PCDATA)>
-<!ELEMENT mat_color (#PCDATA)>
-<!ELEMENT mat_bright (#PCDATA)>
-<!ELEMENT mat_rough (#PCDATA)>
-<!ELEMENT mat_spec (#PCDATA)>
-<!ELEMENT mat_hard (#PCDATA)>
-<!ELEMENT mat_use_trans (#PCDATA)>
-<!ELEMENT mat_alpha (#PCDATA)>
-<!ELEMENT mat_cloudy (#PCDATA)>
-<!ELEMENT mat_IOR (#PCDATA)>
-<!ELEMENT mat_mossy (#PCDATA)>
-<!ELEMENT random (use_random_seed,user_seed)>
-<!ELEMENT use_generate (#PCDATA)>
-<!ELEMENT use_random_seed (#PCDATA)>
-<!ELEMENT user_seed (#PCDATA)>
-
-<!ATTLIST preset id ID #REQUIRED>
-]>
-<settings>
-	<default>
-		<title>Default</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>5.0</deform>
-			<rough>2.5</rough>
-			<detail>3</detail>
-			<display_detail>2</display_detail>
-			<smooth_fac>0.0</smooth_fac>
-			<smooth_it>0</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>False</mat_enable>
-			<mat_color>[0.5, 0.5, 0.5]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>1.0</mat_rough>
-			<mat_spec>0.2</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</default>
-	<preset id="1">
-		<title>River Rock</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>0.5</lower>
-				<upper>1.25</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>0.5</lower>
-				<upper>1.25</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>0.5</lower>
-				<upper>1.25</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>-0.5</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>-0.5</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>-0.5</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>3.0</deform>
-			<rough>2.0</rough>
-			<detail>2</detail>
-			<display_detail>2</display_detail>
-			<smooth_fac>2.0</smooth_fac>
-			<smooth_it>2</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.5, 0.5, 0.5]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>0.125</mat_rough>
-			<mat_spec>0.5</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="2">
-		<title>Astroid</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>1.0</lower>
-				<upper>5.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>1.0</lower>
-				<upper>5.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>1.0</lower>
-				<upper>5.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>7.5</deform>
-			<rough>3.0</rough>
-			<detail>4</detail>
-			<display_detail>3</display_detail>
-			<smooth_fac>0.0</smooth_fac>
-			<smooth_it>0</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.3, 0.25, 0.2]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>1.5</mat_rough>
-			<mat_spec>0.25</mat_spec>
-			<mat_hard>30</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="3">
-		<title>Sandstone</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>True</use_scale_dis>
-			<scale_fac>[5.0, 5.0, 0.1]</scale_fac>
-		</size>
-		<shape>
-			<deform>0.5</deform>
-			<rough>1.0</rough>
-			<detail>3</detail>
-			<display_detail>3</display_detail>
-			<smooth_fac>2.0</smooth_fac>
-			<smooth_it>2</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.5, 0.4, 0.35]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>0.1</mat_rough>
-			<mat_spec>0.2</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="4">
-		<title>Ice</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>0.0</lower>
-				<upper>2.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>0.0</lower>
-				<upper>2.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>0.0</lower>
-				<upper>2.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>5.0</deform>
-			<rough>1.0</rough>
-			<detail>3</detail>
-			<display_detail>2</display_detail>
-			<smooth_fac>2.0</smooth_fac>
-			<smooth_it>1</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.9, 0.95, 1.0]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>0.25</mat_rough>
-			<mat_spec>0.2</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>True</mat_use_trans>
-			<mat_alpha>0.9</mat_alpha>
-			<mat_cloudy>0.1</mat_cloudy>
-			<mat_IOR>1.31</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="5">
-		<title>Fake Ocean</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>10.0</lower>
-				<upper>10.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>10.0</lower>
-				<upper>10.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>0.0</lower>
-				<upper>0.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>7.5</deform>
-			<rough>3.0</rough>
-			<detail>4</detail>
-			<display_detail>3</display_detail>
-			<smooth_fac>0.0</smooth_fac>
-			<smooth_it>0</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.1, 0.12, 0.125]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>1.5</mat_rough>
-			<mat_spec>0.25</mat_spec>
-			<mat_hard>30</mat_hard>
-			<mat_use_trans>True</mat_use_trans>
-			<mat_alpha>0.5</mat_alpha>
-			<mat_cloudy>0.5</mat_cloudy>
-			<mat_IOR>1.333</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-</settings>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_mesh_rocks/factory.xml b/release/scripts/addons_contrib/add_mesh_rocks/factory.xml
deleted file mode 100644
index 0202486..0000000
--- a/release/scripts/addons_contrib/add_mesh_rocks/factory.xml
+++ /dev/null
@@ -1,403 +0,0 @@
-<?xml version="1.0" ?>
-<!DOCTYPE settings [
-<!ELEMENT settings (default,preset*)>
-<!ELEMENT default (title,size,shape,material,random)>
-<!ELEMENT preset (title,size,shape,material,random)>
-<!ELEMENT title (#PCDATA)>
-<!ELEMENT size (scale+,skew+,use_scale_dis,scale_fac)>
-<!ELEMENT scale (axis,lower,upper)>
-<!ELEMENT axis (#PCDATA)>
-<!ELEMENT lower (#PCDATA)>
-<!ELEMENT upper (#PCDATA)>
-<!ELEMENT skew (axis,value)>
-<!ELEMENT value (#PCDATA)>
-<!ELEMENT use_scale_dis (#PCDATA)>
-<!ELEMENT scale_fac (#PCDATA)>
-<!ELEMENT shape (deform,rough,detail,display_detail,smooth_fac,smooth_it)>
-<!ELEMENT deform (#PCDATA)>
-<!ELEMENT rough (#PCDATA)>
-<!ELEMENT detail (#PCDATA)>
-<!ELEMENT display_detail (#PCDATA)>
-<!ELEMENT smooth_fac (#PCDATA)>
-<!ELEMENT smooth_it (#PCDATA)>
-<!ELEMENT material (mat_enable,mat_color,mat_bright,mat_rough,mat_spec,mat_hard,mat_use_trans,mat_alpha,mat_cloudy,mat_IOR,mat_mossy)>
-<!ELEMENT mat_enable (#PCDATA)>
-<!ELEMENT mat_color (#PCDATA)>
-<!ELEMENT mat_bright (#PCDATA)>
-<!ELEMENT mat_rough (#PCDATA)>
-<!ELEMENT mat_spec (#PCDATA)>
-<!ELEMENT mat_hard (#PCDATA)>
-<!ELEMENT mat_use_trans (#PCDATA)>
-<!ELEMENT mat_alpha (#PCDATA)>
-<!ELEMENT mat_cloudy (#PCDATA)>
-<!ELEMENT mat_IOR (#PCDATA)>
-<!ELEMENT mat_mossy (#PCDATA)>
-<!ELEMENT random (use_random_seed,user_seed)>
-<!ELEMENT use_generate (#PCDATA)>
-<!ELEMENT use_random_seed (#PCDATA)>
-<!ELEMENT user_seed (#PCDATA)>
-
-<!ATTLIST preset id ID #REQUIRED>
-]>
-<settings>
-	<default>
-		<title>Default</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>5.0</deform>
-			<rough>2.5</rough>
-			<detail>3</detail>
-			<display_detail>2</display_detail>
-			<smooth_fac>0.0</smooth_fac>
-			<smooth_it>0</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>False</mat_enable>
-			<mat_color>[0.5, 0.5, 0.5]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>1.0</mat_rough>
-			<mat_spec>0.2</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</default>
-	<preset id="1">
-		<title>River Rock</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>0.5</lower>
-				<upper>1.25</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>0.5</lower>
-				<upper>1.25</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>0.5</lower>
-				<upper>1.25</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>-0.5</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>-0.5</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>-0.5</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>3.0</deform>
-			<rough>2.0</rough>
-			<detail>2</detail>
-			<display_detail>2</display_detail>
-			<smooth_fac>2.0</smooth_fac>
-			<smooth_it>2</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.5, 0.5, 0.5]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>0.125</mat_rough>
-			<mat_spec>0.5</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="2">
-		<title>Astroid</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>1.0</lower>
-				<upper>5.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>1.0</lower>
-				<upper>5.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>1.0</lower>
-				<upper>5.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>7.5</deform>
-			<rough>3.0</rough>
-			<detail>4</detail>
-			<display_detail>3</display_detail>
-			<smooth_fac>0.0</smooth_fac>
-			<smooth_it>0</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.3, 0.25, 0.2]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>1.5</mat_rough>
-			<mat_spec>0.25</mat_spec>
-			<mat_hard>30</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="3">
-		<title>Sandstone</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>1.0</lower>
-				<upper>1.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>True</use_scale_dis>
-			<scale_fac>[5.0, 5.0, 0.1]</scale_fac>
-		</size>
-		<shape>
-			<deform>0.5</deform>
-			<rough>1.0</rough>
-			<detail>3</detail>
-			<display_detail>3</display_detail>
-			<smooth_fac>2.0</smooth_fac>
-			<smooth_it>2</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.5, 0.4, 0.35]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>0.1</mat_rough>
-			<mat_spec>0.2</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>False</mat_use_trans>
-			<mat_alpha>0.0</mat_alpha>
-			<mat_cloudy>0.0</mat_cloudy>
-			<mat_IOR>1.0</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="4">
-		<title>Ice</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>0.0</lower>
-				<upper>2.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>0.0</lower>
-				<upper>2.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>0.0</lower>
-				<upper>2.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>5.0</deform>
-			<rough>1.0</rough>
-			<detail>3</detail>
-			<display_detail>2</display_detail>
-			<smooth_fac>2.0</smooth_fac>
-			<smooth_it>1</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.9, 0.95, 1.0]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>0.25</mat_rough>
-			<mat_spec>0.2</mat_spec>
-			<mat_hard>50</mat_hard>
-			<mat_use_trans>True</mat_use_trans>
-			<mat_alpha>0.9</mat_alpha>
-			<mat_cloudy>0.1</mat_cloudy>
-			<mat_IOR>1.31</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-	<preset id="5">
-		<title>Fake Ocean</title>
-		<size>
-			<scale>
-				<axis>X</axis>
-				<lower>10.0</lower>
-				<upper>10.0</upper>
-			</scale>
-			<scale>
-				<axis>Y</axis>
-				<lower>10.0</lower>
-				<upper>10.0</upper>
-			</scale>
-			<scale>
-				<axis>Z</axis>
-				<lower>0.0</lower>
-				<upper>0.0</upper>
-			</scale>
-			<skew>
-				<axis>X</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Y</axis>
-				<value>0.0</value>
-			</skew>
-			<skew>
-				<axis>Z</axis>
-				<value>0.0</value>
-			</skew>
-			<use_scale_dis>False</use_scale_dis>
-			<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
-		</size>
-		<shape>
-			<deform>7.5</deform>
-			<rough>3.0</rough>
-			<detail>4</detail>
-			<display_detail>3</display_detail>
-			<smooth_fac>0.0</smooth_fac>
-			<smooth_it>0</smooth_it>
-		</shape>
-		<material>
-			<mat_enable>True</mat_enable>
-			<mat_color>[0.1, 0.12, 0.125]</mat_color>
-			<mat_bright>0.85</mat_bright>
-			<mat_rough>1.5</mat_rough>
-			<mat_spec>0.25</mat_spec>
-			<mat_hard>30</mat_hard>
-			<mat_use_trans>True</mat_use_trans>
-			<mat_alpha>0.5</mat_alpha>
-			<mat_cloudy>0.5</mat_cloudy>
-			<mat_IOR>1.333</mat_IOR>
-			<mat_mossy>0.0</mat_mossy>
-		</material>
-		<random>
-			<use_generate>True</use_generate>
-			<use_random_seed>True</use_random_seed>
-			<user_seed>1</user_seed>
-		</random>
-	</preset>
-</settings>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_mesh_rocks/rockgen.py b/release/scripts/addons_contrib/add_mesh_rocks/rockgen.py
deleted file mode 100644
index 25df19a..0000000
--- a/release/scripts/addons_contrib/add_mesh_rocks/rockgen.py
+++ /dev/null
@@ -1,1602 +0,0 @@
-# Blender rock creation tool
-#
-# Based on BlenderGuru's asteroid tutorial and personal experimentation.
-#   Tutorial: http://www.blenderguru.com/how-to-make-a-realistic-asteroid/
-# Update with another tutorial shared by "rusted" of BlenderArtists:
-#   Tutorial: http://saschahenrichs.blogspot.com/2010/03/3dsmax-environment-modeling-1.html
-#
-# Uses the NumPy Gaussian random number generator to generate a
-# a rock within a given range and give some randomness to the displacement
-# texture values.  NumPy's gaussian generator was chosen as, based on
-# profiling I performed, it runs in about half the time as the built in
-# Python gaussian equivalent.  I would like to shift the script to use the
-# NumPy beta distribution as it ran in about half the time as the NumPy
-# gaussian once the skew calculations are added.
-#
-# Set lower and upper bounds to the same for no randomness.
-#
-# Tasks:
-#   Generate meshes with random scaling between given values.
-#       - Allow for a skewed distribution
-#           *** Completed on 4/17/2011 ***
-#       - Create a set of meshes that can be used
-#   Give the user the ability to set the subsurf level (detail level)
-#       *** Completed on 4/29/2011 ***
-#       - Set subsurf modifiers to default at view:3, render:3.
-#           *** Completed on 4/17/2011 ***
-#       - Set crease values to allow for hard edges on first subsurf.
-#           *** Completed on 4/29/2011 ***
-#   Be able to generate and add a texture to the displacement modifiers.
-#       *** Completed 5/17/2011 ***
-#       - Generate three displacement modifiers.
-#           - The first only uses a Musgrave for initial intentations.
-#           *** Now generating four displacement modifiers ***
-#           *** Completed on 5/17/2011 ***
-#       - Set a randomness for the type and values of the displacement texture.
-#           *** Completed 5/9/2011 ***
-#       - Allow the user to set a value for the range of displacement.
-#           -> Modification: have user set "roughness" and "roughness range".
-#           *** Compleded on 4/23/2011 ***
-#   Set material settings and assign material textures
-#       *** Completed 6/9/2011 ***
-#       - Mossiness of the rocks.
-#           *** Completed 6/9/2011 ***
-#       - Color of the rocks.
-#           *** Completed 5/16/2011 ***
-#       - Wetness/shinyness of the rock.
-#           *** Completed 5/6/2011 ***
-#       - For all the user provides a mean value for a skewed distribution.
-#           *** Removed to lessen usage complexity ***
-#   Add some presets (mesh) to make it easier to use
-#       - Examples: river rock, asteroid, quaried rock, etc
-#           *** Completed 7/12/2011 ***
-#
-# Code Optimization:
-#   Remove all "bpy.ops" operations with "bpy.data" base operations.
-#   Remove material/texture cataloging with building a list of
-#       returned values from bpy.data.*.new() operations.
-#       *** Completed on 9/6/2011 ***
-#   Search for places where list comprehensions can be used.
-#   Look for alternate methods
-#       - Possible alternate and more efficient data structures
-#       - Possible alternate algorithms may realize greater performance
-#       - Look again at multi-processing.  Without bpy.ops is might
-#           be viable.
-#
-# Future tasks:
-#   Multi-thread the script
-#       *** Will not be implemented.  Multi-processing is adding to much
-#           overhead to realize a performance increase ***
-#       - Learn basic multi-threading in Python (multiprocessing)
-#       - Break material generation into separate threads (processes)
-#       - Break mesh generation into separate threads (processes)
-#       - Move name generation, texture ID generation, etc to process first
-#       - Roll version to 2.0 on completion
-#
-# Paul "BrikBot" Marshall
-# Created: April 17, 2011
-# Last Modified: November 17, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-# Thanks to Meta-Androco, RickyBlender, Ace Dragon, and PKHG for ideas
-#   and testing.
-#
-# Coded in IDLE, tested in Blender 2.59.  NumPy Recommended.
-# Search for "@todo" to quickly find sections that need work.
-#
-# Remeber -
-#   Functional code comes before fast code.  Once it works, then worry about
-#   making it faster/more efficient.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  The Blender Rock Creation tool is for rapid generation of mesh rocks.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-import bpy
-import math
-import time
-from add_mesh_rocks import (settings,
-                            utils)
-from bpy_extras import object_utils
-from mathutils import (Color,
-                       Vector)
-from bpy.props import (BoolProperty,
-                       IntProperty,
-                       FloatProperty,
-                       FloatVectorProperty,
-                       EnumProperty)
-
-# This try block allows for the script to psudo-intelligently select the
-# appropriate random to use.  If Numpy's random is present it will use that.
-# If Numpy's random is not present, it will through a "module not found"
-# exception and instead use the slower built-in random that Python has.
-try:
-    from numpy.random import random_integers as randint
-    from numpy.random import normal as gauss
-    from numpy.random import (beta,
-                              uniform,
-                              seed,
-                              weibull)
-    print("Rock Generator: Numpy found.")
-    numpy = True
-except:
-    from random import (randint,
-                        gauss,
-                        uniform,
-                        seed)
-    from random import betavariate as beta
-    from random import weibullvariate as weibull
-    print("Rock Generator: Numpy not found.  Using Python's random.")
-    numpy = False
-
-# Global variables:
-lastRock = 0
-
-
-# Creates a new mesh:
-#
-# param: verts - Vector of vertices for the mesh.
-#        edges - Edges for the mesh.  Can be "[]".
-#        faces - Face tuples corresponding to vertices.
-#        name  - Name of the mesh.
-def createMeshObject(context, verts, edges, faces, name):
-    # Create new mesh
-    mesh = bpy.data.meshes.new(name)
-
-    # Make a mesh from a list of verts/edges/faces.
-    mesh.from_pydata(verts, edges, faces)
-
-    # Set mesh to use auto smoothing:
-    mesh.use_auto_smooth = True
-
-    # Update mesh geometry after adding stuff.
-    mesh.update()
-
-    return object_utils.object_data_add(context, mesh, operator=None)
-
-
-# Set the values for a texture from parameters.
-#
-# param: texture - bpy.data.texture to modify.
-#        level   - designated tweaked settings to use
-#                   -> Below 10 is a displacment texture
-#                   -> Between 10 and 20 is a base material texture
-def randomizeTexture(texture, level=1):
-    noises = ['BLENDER_ORIGINAL', 'ORIGINAL_PERLIN', 'IMPROVED_PERLIN',
-              'VORONOI_F1', 'VORONOI_F2', 'VORONOI_F3', 'VORONOI_F4',
-              'VORONOI_F2_F1', 'VORONOI_CRACKLE']
-    if texture.type == 'CLOUDS':
-        if randint(0, 1) == 0:
-            texture.noise_type = 'SOFT_NOISE'
-        else:
-            texture.noise_type = 'HARD_NOISE'
-        if level != 11:
-            tempInt = randint(0, 6)
-        else:
-            tempInt = randint(0, 8)
-        texture.noise_basis = noises[tempInt]
-        texture.noise_depth = 8
-
-        if level == 0:
-            texture.noise_scale = gauss(0.625, 1 / 24)
-        elif level == 2:
-            texture.noise_scale = 0.15
-        elif level == 11:
-            texture.noise_scale = gauss(0.5, 1 / 24)
-
-            if texture.noise_basis in ['BLENDER_ORIGINAL', 'ORIGINAL_PERLIN',
-                                       'IMPROVED_PERLIN', 'VORONOI_F1']:
-                texture.intensity = gauss(1, 1 / 6)
-                texture.contrast = gauss(4, 1 / 3)
-            elif texture.noise_basis in ['VORONOI_F2', 'VORONOI_F3', 'VORONOI_F4']:
-                texture.intensity = gauss(0.25, 1 / 12)
-                texture.contrast = gauss(2, 1 / 6)
-            elif texture.noise_basis == 'VORONOI_F2_F1':
-                texture.intensity = gauss(0.5, 1 / 6)
-                texture.contrast = gauss(2, 1 / 6)
-            elif texture.noise_basis == 'VORONOI_CRACKLE':
-                texture.intensity = gauss(0.5, 1 / 6)
-                texture.contrast = gauss(2, 1 / 6)
-    elif texture.type == 'MUSGRAVE':
-        musgraveType = ['MULTIFRACTAL', 'RIDGED_MULTIFRACTAL',
-                        'HYBRID_MULTIFRACTAL', 'FBM', 'HETERO_TERRAIN']
-        texture.musgrave_type = 'MULTIFRACTAL'
-        texture.dimension_max = abs(gauss(0, 0.6)) + 0.2
-        texture.lacunarity = beta(3, 8) * 8.2 + 1.8
-
-        if level == 0:
-            texture.noise_scale = gauss(0.625, 1 / 24)
-            texture.noise_intensity = 0.2
-            texture.octaves = 1.0
-        elif level == 2:
-            texture.intensity = gauss(1, 1 / 6)
-            texture.contrast = 0.2
-            texture.noise_scale = 0.15
-            texture.octaves = 8.0
-        elif level == 10:
-            texture.intensity = gauss(0.25, 1 / 12)
-            texture.contrast = gauss(1.5, 1 / 6)
-            texture.noise_scale = 0.5
-            texture.octaves = 8.0
-        elif level == 12:
-            texture.octaves = uniform(1, 3)
-        elif level > 12:
-            texture.octaves = uniform(2, 8)
-        else:
-            texture.intensity = gauss(1, 1 / 6)
-            texture.contrast = 0.2
-            texture.octaves = 8.0
-    elif texture.type == 'DISTORTED_NOISE':
-        tempInt = randint(0, 8)
-        texture.noise_distortion = noises[tempInt]
-        tempInt = randint(0, 8)
-        texture.noise_basis = noises[tempInt]
-        texture.distortion = skewedGauss(2.0, 2.6666, (0.0, 10.0), False)
-
-        if level == 0:
-            texture.noise_scale = gauss(0.625, 1 / 24)
-        elif level == 2:
-            texture.noise_scale = 0.15
-        elif level >= 12:
-            texture.noise_scale = gauss(0.2, 1 / 48)
-    elif texture.type == 'STUCCI':
-        stucciTypes = ['PLASTIC', 'WALL_IN', 'WALL_OUT']
-        if randint(0, 1) == 0:
-            texture.noise_type = 'SOFT_NOISE'
-        else:
-            texture.noise_type = 'HARD_NOISE'
-        tempInt = randint(0, 2)
-        texture.stucci_type = stucciTypes[tempInt]
-
-        if level == 0:
-            tempInt = randint(0, 6)
-            texture.noise_basis = noises[tempInt]
-            texture.noise_scale = gauss(0.625, 1 / 24)
-        elif level == 2:
-            tempInt = randint(0, 6)
-            texture.noise_basis = noises[tempInt]
-            texture.noise_scale = 0.15
-        elif level >= 12:
-            tempInt = randint(0, 6)
-            texture.noise_basis = noises[tempInt]
-            texture.noise_scale = gauss(0.2, 1 / 30)
-        else:
-            tempInt = randint(0, 6)
-            texture.noise_basis = noises[tempInt]
-    elif texture.type == 'VORONOI':
-        metrics = ['DISTANCE', 'DISTANCE_SQUARED', 'MANHATTAN', 'CHEBYCHEV',
-                   'MINKOVSKY_HALF', 'MINKOVSKY_FOUR', 'MINKOVSKY']
-        # Settings for first dispalcement level:
-        if level == 0:
-            tempInt = randint(0, 1)
-            texture.distance_metric = metrics[tempInt]
-            texture.noise_scale = gauss(0.625, 1 / 24)
-            texture.contrast = 0.5
-            texture.intensity = 0.7
-        elif level == 2:
-            texture.noise_scale = 0.15
-            tempInt = randint(0, 6)
-            texture.distance_metric = metrics[tempInt]
-        elif level >= 12:
-            tempInt = randint(0, 1)
-            texture.distance_metric = metrics[tempInt]
-            texture.noise_scale = gauss(0.125, 1 / 48)
-            texture.contrast = 0.5
-            texture.intensity = 0.7
-        else:
-            tempInt = randint(0, 6)
-            texture.distance_metric = metrics[tempInt]
-
-    return
-
-
-# Randomizes the given material given base values.
-#
-# param: Material to randomize
-def randomizeMaterial(material, color, dif_int, rough, spec_int, spec_hard,
-                      use_trans, alpha, cloudy, mat_IOR, mossiness, spec_IOR):
-    skew = False
-    stddev = 0.0
-    lastUsedTex = 1
-    numTex = 6
-    baseColor = []
-
-    # Diffuse settings:
-    material.diffuse_shader = 'OREN_NAYAR'
-    if 0.5 > dif_int:
-        stddev = dif_int / 3
-        skew = False
-    else:
-        stddev = (1 - dif_int) / 3
-        skew = True
-    material.diffuse_intensity = skewedGauss(dif_int, stddev, (0.0, 1.0), skew)
-    if 1.57 > rough:
-        stddev = rough / 3
-        skew = False
-    else:
-        stddev = (3.14 - rough) / 3
-        skew = True
-    material.roughness = skewedGauss(rough, stddev, (0.0, 3.14), skew)
-
-    for i in range(3):
-        if color[i] > 0.9 or color[i] < 0.1:
-            baseColor.append(skewedGauss(color[i], color[i] / 30,
-                                         (0, 1), color[i] > 0.9))
-        else:
-            baseColor.append(gauss(color[i], color[i] / 30))
-    material.diffuse_color = baseColor
-
-    # Specular settings:
-    material.specular_shader = 'BLINN'
-    if 0.5 > spec_int:
-        variance = spec_int / 3
-        skew = False
-    else:
-        variance = (1 - spec_int) / 3
-        skew = True
-    material.specular_intensity = skewedGauss(spec_int, stddev,
-                                              (0.0, 1.0), skew)
-    if 256 > spec_hard:
-        variance = (spec_hard - 1) / 3
-        skew = False
-    else:
-        variance = (511 - spec_hard) / 3
-        skew = True
-    material.specular_hardness = int(round(skewedGauss(spec_hard, stddev,
-                                                       (1.0, 511.0), skew)))
-    if 5.0 > spec_IOR:
-        variance = spec_IOR / 3
-        skew = False
-    else:
-        variance = (10.0 - spec_IOR) / 3
-        skew = True
-    material.specular_ior = skewedGauss(spec_IOR, stddev, (0.0, 10.0), skew)
-
-    # Raytrans settings:
-    #   *** Added on 11/17/2011 ***
-    material.use_transparency = use_trans
-    if use_trans:
-        trans = material.raytrace_transparency
-        # Fixed values:
-        material.transparency_method = 'RAYTRACE'
-        trans.depth = 24
-        trans.gloss_samples = 32
-        trans.falloff = 1.0
-        # Needs randomization:
-        material.alpha = -gauss(alpha, 0.05) + 1;
-        trans.gloss_factor = -gauss(cloudy, 0.05) + 1
-        trans.filter = gauss(cloudy, 0.1)
-        trans.ior = skewedGauss(mat_IOR, 0.01, [0.25, 4.0], mat_IOR > 2.125)
-
-    #Misc. settings:
-    material.use_transparent_shadows = True
-
-    # Rock textures:
-    # Now using slot.texture for texture access instead of
-    #   bpy.data.textures[newTex[<index>]]
-    #   *** Completed on 9/6/2011 ***
-    # Create the four new textures:
-    textureTypes = ['MUSGRAVE', 'CLOUDS', 'DISTORTED_NOISE',
-                    'STUCCI', 'VORONOI']
-
-    for i in range(numTex):
-        texColor = []
-
-        # Set the active material slot:
-        material.active_texture_index = i
-        # Assign a texture to the active material slot:
-        material.active_texture = bpy.data.textures.new(name = 'stone_tex',
-                                                        type = 'NONE')
-        # Store the slot to easy coding access:
-        slot = material.texture_slots[i]
-
-        # If the texture is not a moss texture:
-        if i > 1:
-            slot.texture.type = textureTypes[randint(0, 3)]
-
-            # Set the texture's color (RGB):
-            for j in range(3):
-                if color[j] > 0.9 or color[j] < 0.1:
-                    texColor.append(skewedGauss(color[j], color[j] / 30,
-                                                (0, 1), color[j] > 0.9))
-                else:
-                    texColor.append(gauss(color[j], color[j] / 30))
-            slot.color = texColor
-            # Randomize the value (HSV):
-            v = material.diffuse_color.v
-            if v == 0.5:
-                slot.color.v = gauss(v, v / 3)
-            elif v > 0.5:
-                slot.color.v = skewedGauss(v, v / 3, (0, 1), True)
-            else:
-                slot.color.v = skewedGauss(v, (1 - v) / 3, (0, 1), False)
-
-            # Adjust scale and normal based on texture type:
-            if slot.texture.type == 'VORONOI':
-                slot.scale = (gauss(5, 1), gauss(5, 1), gauss(5, 1))
-                slot.normal_factor = gauss(rough / 10, rough / 30)
-            elif slot.texture.type == 'STUCCI':
-                slot.scale = (gauss(1.5, 0.25), gauss(1.5, 0.25),
-                              gauss(1.5, 0.25))
-                slot.normal_factor = gauss(rough / 10, rough / 30)
-            elif slot.texture.type == 'DISTORTED_NOISE':
-                slot.scale = (gauss(1.5, 0.25), gauss(1.5, 0.25),
-                              gauss(1.5, 0.25))
-                slot.normal_factor = gauss(rough / 10, rough / 30)
-            elif slot.texture.type == 'MUSGRAVE':
-                slot.scale = (gauss(1.5, 0.25), gauss(1.5, 0.25),
-                              gauss(1.5, 0.25))
-                slot.normal_factor = gauss(rough, rough / 3)
-            elif slot.texture.type == 'CLOUDS':
-                slot.scale = (gauss(1.5, 0.25), gauss(1.5, 0.25),
-                              gauss(1.5, 0.25))
-                slot.normal_factor = gauss(rough, rough / 3)
-
-            # Set the color influence to 0.5.
-            # This allows for the moss textures to show:
-            slot.diffuse_color_factor = 0.5
-            # Set additional influence booleans:
-            slot.use_stencil = True
-            slot.use_map_specular = True
-            slot.use_map_color_spec = True
-            slot.use_map_hardness = True
-            slot.use_map_normal = True
-        # The following is for setting up the moss textures:
-        else:
-            slot.texture.type = textureTypes[i]
-
-            # Set the mosses color (RGB):
-            texColor.append(gauss(0.5, 1 / 6))
-            texColor.append(1)
-            texColor.append(0)
-            slot.color = texColor
-            # Randomize the value (HSV):
-            slot.color.v = gauss(0.275, 1 / 24)
-
-            # Scale the texture size:
-            slot.scale = (gauss(1.5, 0.25),
-                          gauss(1.5, 0.25),
-                          gauss(1.5, 0.25))
-
-            # Set the strength of the moss color:
-            slot.diffuse_color_factor = mossiness
-            # Have it influence spec and hardness:
-            slot.use_map_specular = True
-            slot.use_map_color_spec = True
-            slot.use_map_hardness = True
-
-            # If the texutre is a voronoi crackle clouds, use "Negative":
-            if slot.texture.type == 'CLOUDS':
-                if slot.texture.noise_basis == 'VORONOI_CRACKLE':
-                    slot.invert = True
-
-            if mossiness == 0:
-                slot.use = False
-
-        randomizeTexture(slot.texture, 10 + i)
-
-    return
-
-
-# Generates an object based on one of several different mesh types.
-# All meshes have exactly eight vertices, and may be built from either
-# tri's or quads.
-#
-# param: muX        - mean X offset value
-#        sigmaX     - X offset standard deviation
-#        scaleX     - X upper and lower bounds
-#        upperSkewX - Is the distribution upperskewed?
-#        muY        - mean Y offset value
-#        sigmaY     - Y offset standard deviation
-#        scaleY     - Y upper and lower bounds
-#        upperSkewY - Is the distribution upperskewed?
-#        muZ        - mean Z offset value
-#        sigmaZ     - Z offset standard deviation
-#        scaleZ     - Z upper and lower bounds
-#        upperSkewY - Is the distribution upperskewed?
-#        base       - base number on the end of the object name
-#        shift      - Addition to the base number for multiple runs.
-#        scaleDisplace - Scale the displacement maps
-#
-# return: name      - the built name of the object
-def generateObject(context, muX, sigmaX, scaleX, upperSkewX, muY, sigmaY,
-                   scaleY, upperSkewY, muZ, sigmaZ, scaleZ, upperSkewZ, base,
-                   shift, scaleDisplace, scale_fac):
-    x = []
-    y = []
-    z = []
-    shape = randint(0, 11)
-
-    # Cube
-    # Use parameters to re-scale cube:
-    # Reversed if/for nesting.  Should be a little faster.
-    if shape == 0:
-        for j in range(8):
-            if sigmaX == 0:
-                x.append(scaleX[0] / 2)
-            else:
-                x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-            if sigmaY == 0:
-                y.append(scaleY[0] / 2)
-            else:
-                y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-            if sigmaZ == 0:
-                z.append(scaleZ[0] / 2)
-            else:
-                z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 1:
-        for j in range(8):
-            if j in [0, 1, 3, 4]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 2)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j in [2, 5]:
-                if sigmaX == 0:
-                    x.append(0)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 4)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 2)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j in [6, 7]:
-                if sigmaX == 0:
-                    x.append(0)
-                else:
-                    x.append(skewedGauss(0, sigmaX, scaleX, upperSkewX) / 4)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 4)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 2:
-        for j in range(8):
-            if j in [0, 2, 5, 7]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 4)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 4)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 4)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 4)
-            elif j in [1, 3, 4, 6]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 2)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 3:
-        for j in range(8):
-            if j > 0:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 2)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            else:
-                if sigmaX == 0:
-                    x.append(0)
-                else:
-                    x.append(skewedGauss(0, sigmaX, scaleX, upperSkewX) / 8)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 8)
-                if sigmaZ == 0:
-                    z.append(0)
-                else:
-                    z.append(skewedGauss(0, sigmaZ, scaleZ, upperSkewZ) / 8)
-    elif shape == 4:
-        for j in range(10):
-            if j in [0, 9]:
-                if sigmaX == 0:
-                    x.append(0)
-                else:
-                    x.append(skewedGauss(0, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j in [1, 2, 3, 4]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 2)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j in [5, 7]:
-                if sigmaX == 0:
-                    x.append(0)
-                else:
-                    x.append(skewedGauss(0, sigmaX, scaleX, upperSkewX) / 3)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 3)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 3)
-                if sigmaZ == 0:
-                    z.append(0)
-                else:
-                    z.append(skewedGauss(0, sigmaZ, scaleZ, upperSkewZ) / 6)
-            elif j in [6, 8]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 3)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 3)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 3)
-                if sigmaZ == 0:
-                    z.append(0)
-                else:
-                    z.append(skewedGauss(0, sigmaZ, scaleZ, upperSkewZ) / 6)
-    elif shape == 5:
-        for j in range(10):
-            if j == 0:
-                if sigmaX == 0:
-                    x.append(0)
-                else:
-                    x.append(skewedGauss(0, sigmaX, scaleX, upperSkewX) / 8)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 8)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j in [1, 2]:
-                if sigmaX == 0:
-                    x.append(scaleZ[0] * .125)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) * 0.125)
-                if sigmaY == 0:
-                    y.append(scaleZ[0] * 0.2165)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) * 0.2165)
-                if sigmaZ == 0:
-                    z.append(0)
-                else:
-                    z.append(skewedGauss(0, sigmaZ, scaleZ, upperSkewZ) / 4)
-            elif j == 3:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 4)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 4)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 4)
-                if sigmaZ == 0:
-                    z.append(0)
-                else:
-                    z.append(skewedGauss(0, sigmaZ, scaleZ, upperSkewZ) / 4)
-            elif j in [4, 6]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] * 0.25)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) * 0.25)
-                if sigmaY == 0:
-                    y.append(scaleY[0] * 0.433)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) * 0.433)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j == 5:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 4)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 4)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j in [7, 9]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] * 0.10825)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) * 0.10825)
-                if sigmaY == 0:
-                    y.append(scaleY[0] * 0.2165)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) * 0.2165)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            elif j == 8:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 4)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 6:
-        for j in range(7):
-            if j > 0:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 2)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            else:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 7:
-        for j in range(10):
-            if j in [1, 3, 4, 5, 8, 9]:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(scaleY[0] / 2)
-                else:
-                    y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-            else:
-                if sigmaX == 0:
-                    x.append(scaleX[0] / 2)
-                else:
-                    x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-                if sigmaY == 0:
-                    y.append(0)
-                else:
-                    y.append(skewedGauss(0, sigmaY, scaleY, upperSkewY) / 2)
-                if sigmaZ == 0:
-                    z.append(scaleZ[0] / 2)
-                else:
-                    z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 8:
-        for j in range(7):
-            if sigmaX == 0:
-                x.append(scaleX[0] / 2)
-            else:
-                x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-            if sigmaY == 0:
-                y.append(scaleY[0] / 2)
-            else:
-                y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-            if sigmaZ == 0:
-                z.append(scaleZ[0] / 2)
-            else:
-                z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 9:
-        for j in range(8):
-            if sigmaX == 0:
-                x.append(scaleX[0] / 2)
-            else:
-                x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-            if sigmaY == 0:
-                y.append(scaleY[0] / 2)
-            else:
-                y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-            if sigmaZ == 0:
-                z.append(scaleZ[0] / 2)
-            else:
-                z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 10:
-        for j in range(7):
-            if sigmaX == 0:
-                x.append(scaleX[0] / 2)
-            else:
-                x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-            if sigmaY == 0:
-                y.append(scaleY[0] / 2)
-            else:
-                y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-            if sigmaZ == 0:
-                z.append(scaleZ[0] / 2)
-            else:
-                z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-    elif shape == 11:
-        for j in range(7):
-            if sigmaX == 0:
-                x.append(scaleX[0] / 2)
-            else:
-                x.append(skewedGauss(muX, sigmaX, scaleX, upperSkewX) / 2)
-            if sigmaY == 0:
-                y.append(scaleY[0] / 2)
-            else:
-                y.append(skewedGauss(muY, sigmaY, scaleY, upperSkewY) / 2)
-            if sigmaZ == 0:
-                z.append(scaleZ[0] / 2)
-            else:
-                z.append(skewedGauss(muZ, sigmaZ, scaleZ, upperSkewZ) / 2)
-
-    # This is for scaling the displacement textures.
-    # Scale the vertices so that their average is equal to 1 * scale factor.
-    if scaleDisplace:
-        averageX = (sum(x) / len(x)) * scale_fac[0]
-        for i in range(len(x)):
-            x[i] /= averageX
-        averageY = (sum(y) / len(y)) * scale_fac[1]
-        for i in range(len(y)):
-            y[i] /= averageY
-        averageZ = (sum(z) / len(z)) * scale_fac[2]
-        for i in range(len(z)):
-            z[i] /= averageZ
-
-    # Build vertex and face arrays:
-    if shape == 1:
-        verts = [(-x[0],-y[0],-z[0]),(x[1],-y[1],-z[1]),(x[2],-y[2],z[2]),
-             (-x[3],y[3],-z[3]),(x[4],y[4],-z[4]),(x[5],y[5],z[5]),
-             (x[6],y[6],z[6]),(x[7],y[7],-z[7])]
-        faces = [[0,1,2],[0,1,7],[3,0,7],[3,4,7],[1,4,7],[3,4,5],[1,2,6],
-                 [1,4,6],[4,5,6],[0,2,6],[0,3,6],[3,5,6]]
-    elif shape == 2:
-        verts = [(-x[0],y[0],-z[0]),(x[1],-y[1],-z[1]),(x[2],y[2],-z[2]),
-             (-x[3],y[3],-z[3]),(-x[4],-y[4],z[4]),(x[5],y[5],z[5]),
-             (x[6],y[6],z[6]),(-x[7],y[7],z[7])]
-        faces = [[0,1,2],[0,2,3],[0,3,7],[0,7,4],[1,4,5],[0,1,4],[5,1,2],
-                 [5,2,6],[3,2,6],[3,6,7],[5,4,7],[5,6,7]]
-    elif shape == 3:
-        verts = [(x[0],y[0],z[0]),(x[1],-y[1],-z[1]),(x[2],y[2],-z[2]),
-             (-x[3],y[3],-z[3]),(x[4],-y[4],z[4]),(x[5],y[5],z[5]),
-             (-x[6],y[6],z[6]),(-x[7],-y[7],z[7])]
-        faces = [[0,1,2],[0,2,3],[0,3,6],[0,6,7],[0,7,4],[0,4,1],[5,4,1,2],
-                 [5,6,3,2],[5,4,7,6]]
-    elif shape == 4:
-        verts = [(x[0],y[0],z[0]),(x[1],-y[1],-z[1]),(x[2],y[2],-z[2]),
-             (-x[3],y[3],-z[3]),(-x[4],-y[4],-z[4]),(x[5],-y[5],-z[5]),
-             (x[6],y[6],-z[6]),(x[7],y[7],-z[7]),(-x[8],y[8],-z[8]),
-             (x[9],y[9],-z[9])]
-        faces = [[0,1,6],[0,6,2],[0,2,7],[0,7,3],[0,3,8],[0,8,4],[0,4,5],
-                 [0,5,1],[1,9,2],[2,9,3],[3,9,4],[4,9,1],[1,6,2],[2,7,3],
-                 [3,8,4],[4,5,1]]
-    elif shape == 5:
-        verts = [(x[0],y[0],z[0]),(x[1],-y[1],z[1]),(x[2],y[2],z[2]),
-             (-x[3],y[3],z[3]),(x[4],-y[4],-z[4]),(x[5],y[5],-z[5]),
-             (x[6],y[6],-z[6]),(-x[7],y[7],-z[7]),(-x[8],y[8],-z[8]),
-             (-x[9],-y[9],-z[9])]
-        faces = [[0,1,2],[0,2,3],[0,3,1],[1,4,5],[1,5,2],[2,5,6],[2,6,7],
-                 [2,7,3],[3,7,8],[3,8,9],[3,9,1],[1,9,4],[4,5,9],[5,6,7],
-                 [7,8,9],[9,5,7]]
-    elif shape == 6:
-        verts = [(x[0],y[0],z[0]),(x[1],-y[1],-z[1]),(x[2],y[2],-z[2]),
-             (-x[3],y[3],-z[3]),(-x[4],y[4],z[4]),(-x[5],-y[5],z[5]),
-             (-x[6],-y[6],-z[6])]
-        faces = [[0,1,2],[0,2,3,4],[0,1,6,5],[0,4,5],[1,2,3,6],[3,4,5,6]]
-    elif shape == 7:
-        verts = [(x[0],y[0],z[0]),(x[1],-y[1],-z[1]),(x[2],y[2],-z[2]),
-             (x[3],y[3],-z[3]),(-x[4],y[4],-z[4]),(-x[5],y[5],z[5]),
-             (-x[6],y[6],z[6]),(-x[7],y[7],-z[7]),(-x[8],-y[8],-z[8]),
-             (-x[9],-y[9],z[9])]
-        faces = [[0,1,2],[0,2,3],[0,5,6],[0,6,9],[0,1,8,9],[0,3,4,5],
-                 [1,2,7,8],[2,3,4,7],[4,5,6,7],[6,7,8,9]]
-    elif shape == 8:
-        verts = [(x[0],y[0],z[0]),(x[1],-y[1],-z[1]),(x[2],y[2],-z[2]),
-             (-x[3],y[3],-z[3]),(-x[4],-y[4],-z[4]),(-x[5],-y[5],z[5]),
-             (-x[6],y[6],z[6])]
-        faces = [[0,2,1],[0,1,4],[0,4,5],[0,5,6],[0,6,3,2],[2,1,4,3],
-                 [3,6,5,4]]
-    elif shape == 9:
-        verts = [(-x[0],-y[0],-z[0]),(-x[1],y[1],-z[1]),(-x[2],y[2],z[2]),
-             (-x[3],-y[3],z[3]),(x[4],-y[4],-z[4]),(x[5],y[5],-z[5]),
-             (x[6],y[6],z[6]),(x[7],-y[7],z[7])]
-        faces = [[0,1,6,2],[1,5,7,6],[5,4,3,7],[4,0,2,3],[0,1,5,4],[3,2,6,7]]
-    elif shape == 10:
-        verts = [(-x[0],-y[0],-z[0]),(-x[1],y[1],-z[1]),(-x[2],y[2],z[2]),
-             (x[3],-y[3],z[3]),(x[4],y[4],z[4]),(x[5],y[5],-z[5]),
-             (x[6],-y[6],-z[6])]
-        faces = [[0,2,3],[0,3,6],[0,1,5,6],[2,3,4],[0,1,2],[1,2,4,5],[3,4,5,6]]
-    elif shape == 11:
-        verts = [(-x[0],-y[0],-z[0]),(-x[1],y[1],-z[1]),(-x[2],y[2],z[2]),
-             (x[3],-y[3],z[3]),(x[4],y[4],z[4]),(x[5],y[5],-z[5]),
-             (x[6],-y[6],-z[6])]
-        faces = [[0,2,3],[0,3,6],[0,1,5,6],[2,3,4],[5,6,3],[1,5,3,4],[0,1,4,2]]
-    else:
-        verts = [(-x[0],-y[0],-z[0]),(-x[1],y[1],-z[1]),(-x[2],-y[2],z[2]),
-             (-x[3],y[3],z[3]),(x[4],-y[4],-z[4]),(x[5],y[5],-z[5]),
-             (x[6],-y[6],z[6]),(x[7],y[7],z[7])]
-        faces = [[0,1,3,2],[0,1,5,4],[0,4,6,2],[7,5,4,6],[7,3,2,6],[7,5,1,3]]
-
-    name = "Rock." + str(base + shift).zfill(3)
-
-    # Make object:
-    obj = createMeshObject(context, verts, [], faces, name)
-
-    if scaleDisplace:
-        bpy.data.objects[name].scale = Vector((averageX, averageY, averageZ))
-
-    # For a slight speed bump / Readability:
-    mesh = bpy.data.meshes[name]
-
-    # Apply creasing:
-    if shape == 0:
-        for i in range(12):
-            # todo: "0.375 / 3"?  WTF?  That = 0.125. . . .
-            #   *** Completed 7/15/2011: Changed second one ***
-            mesh.edges[i].crease = gauss(0.125, 0.125)
-    elif shape == 1:
-        for i in [0, 2]:
-            mesh.edges[i].crease = gauss(0.5, 0.125)
-        for i in [6, 9, 11, 12]:
-            mesh.edges[i].crease = gauss(0.25, 0.05)
-        for i in [5, 7, 15, 16]:
-            mesh.edges[i].crease = gauss(0.125, 0.025)
-    elif shape == 2:
-        for i in range(18):
-            mesh.edges[i].crease = gauss(0.125, 0.025)
-    elif shape == 3:
-        for i in [0, 1, 6, 10, 13]:
-            mesh.edges[i].crease = gauss(0.25, 0.05)
-        mesh.edges[8].crease = gauss(0.5, 0.125)
-    elif shape == 4:
-        for i in [5, 6, 7, 10, 14, 16, 19, 21]:
-            mesh.edges[i].crease = gauss(0.5, 0.125)
-    elif shape == 7:
-        for i in range(18):
-            if i in [0, 1, 2, 3, 6, 7, 8, 9, 13, 16]:
-                mesh.edges[i].crease = gauss(0.5, 0.125)
-            elif i in [11,17]:
-                mesh.edges[i].crease = gauss(0.25, 0.05)
-            else:
-                mesh.edges[i].crease = gauss(0.125, 0.025)
-    elif shape == 8:
-        for i in range(12):
-            if i in [0, 3, 8, 9, 10]:
-                mesh.edges[i].crease = gauss(0.5, 0.125)
-            elif i == 11:
-                mesh.edges[i].crease = gauss(0.25, 0.05)
-            else:
-                mesh.edges[i].crease = gauss(0.125, 0.025)
-    elif shape == 9:
-        for i in range(12):
-            if i in [0, 3, 4, 11]:
-                mesh.edges[i].crease = gauss(0.5, 0.125)
-            else:
-                mesh.edges[i].crease = gauss(0.25, 0.05)
-    elif shape == 10:
-        for i in range(12):
-            if i in [0, 2, 3, 4, 8, 11]:
-                mesh.edges[i].crease = gauss(0.5, 0.125)
-            elif i in [1, 5, 7]:
-                mesh.edges[i].crease = gauss(0.25, 0.05)
-            else:
-                mesh.edges[i].crease = gauss(0.125, 0.025)
-    elif shape == 11:
-        for i in range(11):
-            if i in [1, 2, 3, 4, 8, 11]:
-                mesh.edges[i].crease = gauss(0.25, 0.05)
-            else:
-                mesh.edges[i].crease = gauss(0.125, 0.025)
-
-    return name
-
-
-# Artifically skews a normal (gaussian) distribution.  This will not create
-# a continuous distribution curve but instead acts as a piecewise finction.
-# This linearly scales the output on one side to fit the bounds.
-#
-# Example output historgrams:
-#
-# Upper skewed:                 Lower skewed:
-#  |                 ▄           |      _
-#  |                 █           |      █
-#  |                 █_          |      █
-#  |                 ██          |     _█
-#  |                _██          |     ██
-#  |              _▄███_         |     ██ _
-#  |             ▄██████         |    ▄██▄█▄_
-#  |          _█▄███████         |    ███████
-#  |         _██████████_        |   ████████▄▄█_ _
-#  |      _▄▄████████████        |   ████████████▄█_
-#  | _▄_ ▄███████████████▄_      | _▄███████████████▄▄_
-#   -------------------------     -----------------------
-#                    |mu               |mu
-#   Historgrams were generated in R (http://www.r-project.org/) based on the
-#   calculations below and manually duplicated here.
-#
-# param:  mu          - mu is the mean of the distribution.
-#         sigma       - sigma is the standard deviation of the distribution.
-#         bounds      - bounds[0] is the lower bound and bounds[1]
-#                       is the upper bound.
-#         upperSkewed - if the distribution is upper skewed.
-# return: out         - Rondomly generated value from the skewed distribution.
-#
-# @todo: Because NumPy's random value generators are faster when called
-#   a bunch of times at once, maybe allow this to generate and return
-#   multiple values at once?
-def skewedGauss(mu, sigma, bounds, upperSkewed=True):
-    raw = gauss(mu, sigma)
-
-    # Quicker to check an extra condition than do unnecessary math. . . .
-    if raw < mu and not upperSkewed:
-        out = ((mu - bounds[0]) / (3 * sigma)) * raw + ((mu * (bounds[0] - (mu - 3 * sigma))) / (3 * sigma))
-    elif raw > mu and upperSkewed:
-        out = ((mu - bounds[1]) / (3 * -sigma)) * raw + ((mu * (bounds[1] - (mu + 3 * sigma))) / (3 * -sigma))
-    else:
-        out = raw
-
-    return out
-
-
-# @todo create a def for generating an alpha and beta for a beta distribution
-#   given a mu, sigma, and an upper and lower bound.  This proved faster in
-#   profiling in addition to providing a much better distribution curve
-#   provided multiple iterations happen within this function; otherwise it was
-#   slower.
-#   This might be a scratch because of the bounds placed on mu and sigma:
-#
-#   For alpha > 1 and beta > 1:
-#   mu^2 - mu^3           mu^3 - mu^2 + mu
-#   ----------- < sigma < ----------------
-#      1 + mu                  2 - mu
-#
-##def generateBeta(mu, sigma, scale, repitions=1):
-##    results = []
-##
-##    return results
-
-# Creates rock objects:
-def generateRocks(context, scaleX, skewX, scaleY, skewY, scaleZ, skewZ,
-                  scale_fac, detail, display_detail, deform, rough,
-                  smooth_fac, smooth_it, mat_enable, color, mat_bright,
-                  mat_rough, mat_spec, mat_hard, mat_use_trans, mat_alpha,
-                  mat_cloudy, mat_IOR, mat_mossy, numOfRocks=1, userSeed=1.0,
-                  scaleDisplace=False, randomSeed=True):
-    global lastRock
-    newMat = []
-    sigmaX = 0
-    sigmaY = 0
-    sigmaZ = 0
-    upperSkewX = False
-    upperSkewY = False
-    upperSkewZ = False
-    shift = 0
-    lastUsedTex = 1
-    vertexScaling = []
-
-    # Seed the random Gaussian value generator:
-    if randomSeed:
-        seed(int(time.time()))
-    else:
-        seed(userSeed)
-
-    if mat_enable:
-        # Calculate the number of materials to use.
-        #   If less than 10 rocks are being generated, generate one material
-        #       per rock.
-        #   If more than 10 rocks are being generated, generate
-        #       ceil[(1/9)n + (80/9)] materials.
-        #       -> 100 rocks will result in 20 materials
-        #       -> 1000 rocks will result in 120 materials.
-        if numOfRocks < 10:
-            numOfMats = numOfRocks
-        else:
-            numOfMats = math.ceil((1/9) * numOfRocks + (80/9))
-
-        # newMat = generateMaterialsList(numOfMats)
-        #   *** No longer needed on 9/6/2011 ***
-
-        # todo Set general material settings:
-        #   *** todo completed 5/25/2011 ***
-        # Material roughness actual max = 3.14.  Needs scaling.
-        mat_rough *= 0.628
-        spec_IOR = 1.875 * (mat_spec ** 2) + 7.125 * mat_spec + 1
-
-        # Changed as material mapping is no longer needed.
-        #   *** Complete 9/6/2011 ***
-        for i in range(numOfMats):
-            newMat.append(bpy.data.materials.new(name = 'stone'))
-            randomizeMaterial(newMat[i], color, mat_bright,
-                              mat_rough, mat_spec, mat_hard, mat_use_trans,
-                              mat_alpha, mat_cloudy, mat_IOR, mat_mossy,
-                              spec_IOR)
-
-    # These values need to be really small to look good.
-    # So the user does not have to use such ridiculously small values:
-    deform /= 10
-    rough /= 100
-
-    # Verify that the min really is the min:
-    if scaleX[1] < scaleX[0]:
-        scaleX[0], scaleX[1] = scaleX[1], scaleX[0]
-    if scaleY[1] < scaleY[0]:
-        scaleY[0], scaleY[1] = scaleY[1], scaleY[0]
-    if scaleZ[1] < scaleZ[0]:
-        scaleZ[0], scaleZ[1] = scaleZ[1], scaleZ[0]
-
-    # todo: edit below to allow for skewing the distribution
-    #   *** todo completed 4/22/2011 ***
-    #   *** Code now generating "int not scriptable error" in Blender ***
-    #
-    # Calculate mu and sigma for a Gaussian distributed random number
-    #   generation:
-    # If the lower and upper bounds are the same, skip the math.
-    #
-    # sigma is the standard deviation of the values.  The 95% interval is three
-    # standard deviations, which is what we want most generated values to fall
-    # in.  Since it might be skewed we are going to use half the difference
-    # betwee the mean and the furthest bound and scale the other side down
-    # post-number generation.
-    if scaleX[0] != scaleX[1]:
-        skewX = (skewX + 1) / 2
-        muX = scaleX[0] + ((scaleX[1] - scaleX[0]) * skewX)
-        if skewX < 0.5:
-            sigmaX = (scaleX[1] - muX) / 3
-        else:
-            sigmaX = (muX - scaleX[0]) / 3
-            upperSkewX = True
-    else:
-        muX = scaleX[0]
-    if scaleY[0] != scaleY[1]:
-        skewY = (skewY + 1) / 2
-        muY = scaleY[0] + ((scaleY[1] - scaleY[0]) * skewY)
-        if skewY < 0.5:
-            sigmaY = (scaleY[1] - muY) / 3
-        else:
-            sigmaY = (muY - scaleY[0]) / 3
-            upperSkewY = True
-    else:
-        muY = scaleY[0]
-    if scaleZ[0] != scaleZ[1]:
-        skewZ = (skewZ + 1) / 2
-        muZ = scaleZ[0] + ((scaleZ[1] - scaleZ[0]) * skewZ)
-        if skewZ < 0.5:
-            sigmaZ = (scaleZ[1] - muZ) / 3
-        else:
-            sigmaZ = (muZ - scaleZ[0]) / 3
-            upperSkewZ = True
-    else:
-        muZ = scaleZ
-
-    for i in range(numOfRocks):
-        # todo: enable different random values for each (x,y,z) corrdinate for
-        # each vertex.  This will add additional randomness to the shape of the
-        # generated rocks.
-        #   *** todo completed 4/19/2011 ***
-        #   *** Code is notably slower at high rock counts ***
-
-        name = generateObject(context, muX, sigmaX, scaleX, upperSkewX, muY,
-                               sigmaY, scaleY, upperSkewY, muZ, sigmaZ, scaleZ,
-                               upperSkewZ, i, lastRock, scaleDisplace, scale_fac)
-
-        rock = bpy.data.objects[name]
-
-        # todo Map what the two new textures will be:
-        # This is not working.  It works on paper so . . . ???
-        #   *** todo completed on 4/23/2011 ***
-        #   *** todo re-added as the first rock is getting
-        #       'Texture.001' twice. ***
-        #   *** todo completed on 4/25/2011 ***
-        #   *** Script no longer needs to map new texture names 9/6/2011 ***
-
-        # Create the four new textures:
-        # todo Set displacement texture parameters:
-        #   *** todo completed on 5/31/2011 ***
-        # Voronoi has been removed from being an option for the fine detail
-        #   texture.
-        texTypes = ['CLOUDS', 'MUSGRAVE', 'DISTORTED_NOISE', 'STUCCI', 'VORONOI']
-        newTex = []
-        # The first texture is to give a more ranodm base shape appearance:
-        newTex.append(bpy.data.textures.new(name = 'rock_displacement',
-                                            type = texTypes[1]))
-        randomizeTexture(newTex[0], 0)
-        newTex.append(bpy.data.textures.new(name = 'rock_displacement',
-                                            type = texTypes[4]))
-        randomizeTexture(newTex[1], 0)
-        if numpy:
-            newTex.append(bpy.data.textures.new(name = 'rock_displacement',
-                                                type = texTypes[int(round(weibull(1, 1)[0] / 2.125))]))
-            randomizeTexture(newTex[2], 1)
-            newTex.append(bpy.data.textures.new(name = 'rock_displacement',
-                                                type = texTypes[int(round(weibull(1, 1)[0] / 2.125))]))
-            randomizeTexture(newTex[3], 2)
-        else:
-            newTex.append(bpy.data.textures.new(name = 'rock_displacement',
-                                                type = texTypes[int(round(weibull(1, 1) / 2.125))]))
-            randomizeTexture(newTex[2], 1)
-            newTex.append(bpy.data.textures.new(name = 'rock_displacement',
-                                                type = texTypes[int(round(weibull(1, 1) / 2.125))]))
-            randomizeTexture(newTex[3], 2)
-
-        # Add modifiers:
-        rock.modifiers.new(name = "Subsurf", type = 'SUBSURF')
-        rock.modifiers.new(name = "Subsurf", type = 'SUBSURF')
-        rock.modifiers.new(name = "Displace", type = 'DISPLACE')
-        rock.modifiers.new(name = "Displace", type = 'DISPLACE')
-        rock.modifiers.new(name = "Displace", type = 'DISPLACE')
-        rock.modifiers.new(name = "Displace", type = 'DISPLACE')
-
-        # If smoothing is enabled, allow a little randomness into the
-        #   smoothing factor. Then add the smoothing modifier.
-        if smooth_fac > 0.0 and smooth_it > 0:
-            rock.modifiers.new(name = "Smooth", type='SMOOTH')
-            rock.modifiers[6].factor = gauss(smooth_fac, (smooth_fac ** 0.5) / 12)
-            rock.modifiers[6].iterations = smooth_it
-        # Make a call to random to keep things consistant:
-        else:
-            gauss(0, 1)
-
-        # Set subsurf modifier parameters:
-        rock.modifiers[0].levels = display_detail
-        rock.modifiers[0].render_levels = detail
-        rock.modifiers[1].levels = display_detail
-        rock.modifiers[1].render_levels = detail
-
-        # todo Set displacement modifier parameters:
-        #   *** todo completed on 4/23/2011 ***
-        #   *** toned down the variance on 4/26/2011 ***
-        #   *** added third modifier on 4/28/2011 ***
-        #   *** texture access changed on 9/6/2011 ***
-        rock.modifiers[2].texture = newTex[0]
-        rock.modifiers[2].strength = gauss(deform / 100, (1 / 300) * deform)
-        rock.modifiers[2].mid_level = 0
-        rock.modifiers[3].texture = newTex[1]
-        rock.modifiers[3].strength = gauss(deform, (1 / 3) * deform)
-        rock.modifiers[3].mid_level = 0
-        rock.modifiers[4].texture = newTex[2]
-        rock.modifiers[4].strength = gauss(rough * 2, (1 / 3) * rough)
-        rock.modifiers[5].texture = newTex[3]
-        rock.modifiers[5].strength = gauss(rough, (1 / 3) * rough)
-
-        # Set mesh to be smooth and fix the normals:
-        utils.smooth(bpy.data.meshes[name])
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.mesh.normals_make_consistent()
-        bpy.ops.object.editmode_toggle()
-
-        if mat_enable:
-            bpy.ops.object.material_slot_add()
-            rock.material_slots[0].material = newMat[randint(0, numOfMats - 1)]
-
-        # Store the last value of i:
-        shift = i
-
-    # Add the shift to lastRock:
-    lastRock += shift + 1
-
-    return
-
-
-# Much of the code below is more-or-less imitation of other addons and as such
-# I have left it undocumented.
-
-class rocks(bpy.types.Operator):
-    """Add rock objects"""
-    bl_idname = "mesh.rocks"
-    bl_label = "Add Rocks"
-    bl_options = {'REGISTER', 'UNDO'}
-    bl_description = "Add rocks"
-
-    # Get the preset values from the XML file.
-    #   -> The script was morphed into a Python module
-    #       to support this.
-    # Tell settings.py to parse the XML file with the settings.
-    # Then get the default values resulting from the parsing.
-    # Make a list containing the default values and append to that
-    # the presets specified in the same XML file.  This list will
-    # be used to load preset values.
-    settings.parse()
-    defaults = settings.getDefault()
-    presetsList = [defaults]
-    presetsList += settings.getPresetLists()
-    presets = []
-    lastPreset = 0
-
-    # Build the presets list for the enum property.
-    # This needs to be a for loop as the user might add presets to
-    # the XML file and those should show here:
-    for i in range(len(presetsList)):
-        value = str(i)
-        name = presetsList[i][0]
-        description = name + " preset values."
-        presets.append((value, name, description))
-
-    preset_values = EnumProperty(items = presets,
-                                 name = "Presets",
-                                 description = "Preset values for some rock types")
-
-    num_of_rocks = IntProperty(name = "Number of rocks",
-                               description = "Number of rocks to generate. WARNING: Slow at high values!",
-                               min = 1, max = 1048576,
-                               soft_max = 20,
-                               default = 1)
-
-    scale_X = FloatVectorProperty(name = "X scale",
-                                  description = "X axis scaling range.",
-                                  min = 0.0, max = 256.0, step = 1,
-                                  default = defaults[1], size = 2)
-    skew_X = FloatProperty(name = "X skew",
-                           description = "X Skew ratio. 0.5 is no skew.",
-                           min = -1.0, max = 1.0, default = defaults[4])
-    scale_Y = FloatVectorProperty(name = "Y scale",
-                                  description = "Y axis scaling range.",
-                                  min = 0.0, max = 256.0, step = 1,
-                                  default = defaults[2], size = 2)
-    skew_Y = FloatProperty(name = "Y skew",
-                           description = "Y Skew ratio. 0.5 is no skew.",
-                           min = -1.0, max = 1.0, default = defaults[5])
-    scale_Z = FloatVectorProperty(name = "Z scale",
-                                  description = "Z axis scaling range.",
-                                  min = 0.0, max = 256.0, step = 1,
-                                  default = defaults[3], size = 2)
-    skew_Z = FloatProperty(name = "Z skew",
-                           description = "Z Skew ratio. 0.5 is no skew.",
-                           min = -1.0, max = 1.0, default = defaults[6])
-    use_scale_dis = BoolProperty(name = "Scale displace textures",
-                                description = "Scale displacement textures with dimensions.  May cause streched textures.",
-                                default = defaults[7])
-    scale_fac = FloatVectorProperty(name = "Scaling Factor",
-                                    description = "XYZ scaling factor.  1 = no scaling.",
-                                    min = 0.0001, max = 256.0, step = 0.1,
-                                    default = defaults[8], size = 3)
-
-    # @todo Possible to title this section "Physical Properties:"?
-    deform = FloatProperty(name = "Deformation",
-                           description = "Rock deformation",
-                           min = 0.0, max = 1024.0, default = defaults[9])
-    rough = FloatProperty(name = "Roughness",
-                          description = "Rock roughness",
-                          min = 0.0, max = 1024.0, default = defaults[10])
-    detail = IntProperty(name = "Detail level",
-                         description = "Detail level.  WARNING: Slow at high values!",
-                         min = 1, max = 1024, default = defaults[11])
-    display_detail = IntProperty(name = "Display Detail",
-                                 description = "Display detail.  Use a lower value for high numbers of rocks.",
-                                 min = 1, max = 128, default = defaults[12])
-    smooth_fac = FloatProperty(name = "Smooth Factor",
-                               description = "Smoothing factor.  A value of 0 disables.",
-                               min = 0.0, max = 128.0, default = defaults[13])
-    smooth_it = IntProperty(name = "Smooth Iterations",
-                            description = "Smoothing iterations.  A value of 0 disables.",
-                            min = 0, max = 128, default = defaults[14])
-
-    # @todo Add material properties
-    mat_enable = BoolProperty(name = "Generate materials",
-                              description = "Generate materials and textures for the rocks",
-                              default = defaults[15])
-    mat_color = FloatVectorProperty(name = "Color",
-                                    description = "Base color settings (RGB)",
-                                    min = 0.0, max = 1.0, default = defaults[16], size = 3, subtype = 'COLOR')
-    mat_bright = FloatProperty(name = "Brightness",
-                               description = "Material brightness",
-                               min = 0.0, max = 1.0, default = defaults[17])
-    mat_rough = FloatProperty(name = "Roughness",
-                              description = "Material roughness",
-                              min = 0.0, max = 5.0, default = defaults[18])
-    mat_spec = FloatProperty(name = "Shine",
-                             description = "Material specularity strength",
-                             min = 0.0, max = 1.0, default = defaults[19])
-    mat_hard = IntProperty(name = "Hardness",
-                           description = "Material hardness",
-                           min = 0, max = 511, default = defaults[20])
-    mat_use_trans = BoolProperty(name = "Use Transparency",
-                                 description = "Enables transparency in rocks (WARNING: SLOW RENDER TIMES)",
-                                 default = defaults[21])
-    mat_alpha = FloatProperty(name = "Alpha",
-                              description = "Transparency of the rocks",
-                              min = 0.0, max = 1.0, default = defaults[22])
-    mat_cloudy = FloatProperty(name = "Cloudy",
-                               description = "How cloudy the transparent rocks look",
-                               min = 0.0, max = 1.0, default = defaults[23])
-    mat_IOR = FloatProperty(name = "IoR",
-                            description = "Index of Refraction",
-                            min = 0.25, max = 4.0, soft_max = 2.5,
-                            default = defaults[24])
-    mat_mossy = FloatProperty(name = "Mossiness",
-                              description = "Amount of mossiness on the rocks",
-                              min = 0.0, max = 1.0, default = defaults[25])
-
-    use_generate = BoolProperty(name = "Generate Rocks",
-                                description = "Enable actual generation.",
-                                default = defaults[26])
-    use_random_seed = BoolProperty(name = "Use a random seed",
-                                  description = "Create a seed based on time. Causes user seed to be ignored.",
-                                  default = defaults[27])
-    user_seed = IntProperty(name = "User seed",
-                            description = "Use a specific seed for the generator.",
-                            min = 0, max = 1048576, default = defaults[28])
-
-
-    def draw(self, context):
-        layout = self.layout
-        box = layout.box()
-        box.prop(self, 'num_of_rocks')
-        box = layout.box()
-        box.prop(self, 'scale_X')
-        box.prop(self, 'skew_X')
-        box.prop(self, 'scale_Y')
-        box.prop(self, 'skew_Y')
-        box.prop(self, 'scale_Z')
-        box.prop(self, 'skew_Z')
-        box.prop(self, 'use_scale_dis')
-        if self.use_scale_dis:
-            box.prop(self, 'scale_fac')
-        else:
-            self.scale_fac = utils.toFloats(self.defaults[8])
-        box = layout.box()
-        box.prop(self, 'deform')
-        box.prop(self, 'rough')
-        box.prop(self, 'detail')
-        box.prop(self, 'display_detail')
-        box.prop(self, 'smooth_fac')
-        box.prop(self, 'smooth_it')
-        box = layout.box()
-        box.prop(self, 'mat_enable')
-        if self.mat_enable:
-            box.prop(self, 'mat_color')
-            box.prop(self, 'mat_bright')
-            box.prop(self, 'mat_rough')
-            box.prop(self, 'mat_spec')
-            box.prop(self, 'mat_hard')
-            box.prop(self, 'mat_use_trans')
-            if self.mat_use_trans:
-                box.prop(self, 'mat_alpha')
-                box.prop(self, 'mat_cloudy')
-                box.prop(self, 'mat_IOR')
-            box.prop(self, 'mat_mossy')
-        box = layout.box()
-        box.prop(self, 'use_generate')
-        box.prop(self, 'use_random_seed')
-        if not self.use_random_seed:
-            box.prop(self, 'user_seed')
-        box.prop(self, 'preset_values')
-
-
-    def execute(self, context):
-        # The following "if" block loads preset values:
-        if self.lastPreset != int(self.preset_values):
-            self.scale_X = utils.toFloats(self.presetsList[int(self.preset_values)][1])
-            self.scale_Y = utils.toFloats(self.presetsList[int(self.preset_values)][2])
-            self.scale_Z = utils.toFloats(self.presetsList[int(self.preset_values)][3])
-            self.skew_X = float(self.presetsList[int(self.preset_values)][4])
-            self.skew_Y = float(self.presetsList[int(self.preset_values)][5])
-            self.skew_Z = float(self.presetsList[int(self.preset_values)][6])
-            self.use_scale_dis = bool(self.presetsList[int(self.preset_values)][7])
-            self.scale_fac = utils.toFloats(self.presetsList[int(self.preset_values)][8])
-            self.deform = float(self.presetsList[int(self.preset_values)][9])
-            self.rough = float(self.presetsList[int(self.preset_values)][10])
-            self.detail = int(self.presetsList[int(self.preset_values)][11])
-            self.display_detail = int(self.presetsList[int(self.preset_values)][12])
-            self.smooth_fac = float(self.presetsList[int(self.preset_values)][13])
-            self.smooth_it = int(self.presetsList[int(self.preset_values)][14])
-            self.mat_enable = bool(self.presetsList[int(self.preset_values)][15])
-            self.mat_color = utils.toFloats(self.presetsList[int(self.preset_values)][16])
-            self.mat_bright = float(self.presetsList[int(self.preset_values)][17])
-            self.mat_rough = float(self.presetsList[int(self.preset_values)][18])
-            self.mat_spec = float(self.presetsList[int(self.preset_values)][19])
-            self.mat_hard = int(self.presetsList[int(self.preset_values)][20])
-            self.mat_use_trans = bool(self.presetsList[int(self.preset_values)][21])
-            self.mat_alpha = float(self.presetsList[int(self.preset_values)][22])
-            self.mat_cloudy = float(self.presetsList[int(self.preset_values)][23])
-            self.mat_IOR = float(self.presetsList[int(self.preset_values)][24])
-            self.mat_mossy = float(self.presetsList[int(self.preset_values)][25])
-            self.use_generate = bool(self.presetsList[int(self.preset_values)][26])
-            self.use_random_seed = bool(self.presetsList[int(self.preset_values)][27])
-            self.user_seed = int(self.presetsList[int(self.preset_values)][28])
-            self.lastPreset = int(self.preset_values)
-
-        # todo Add deform, deform_Var, rough, and rough_Var:
-        #   *** todo completed 4/23/2011 ***
-        #   *** Eliminated "deform_Var" and "rough_Var" so the script is not
-        #       as complex to use.  May add in again as advanced features. ***
-        if self.use_generate:
-            generateRocks(context,
-                          self.scale_X,
-                          self.skew_X,
-                          self.scale_Y,
-                          self.skew_Y,
-                          self.scale_Z,
-                          self.skew_Z,
-                          self.scale_fac,
-                          self.detail,
-                          self.display_detail,
-                          self.deform,
-                          self.rough,
-                          self.smooth_fac,
-                          self.smooth_it,
-                          self.mat_enable,
-                          self.mat_color,
-                          self.mat_bright,
-                          self.mat_rough,
-                          self.mat_spec,
-                          self.mat_hard,
-                          self.mat_use_trans,
-                          self.mat_alpha,
-                          self.mat_cloudy,
-                          self.mat_IOR,
-                          self.mat_mossy,
-                          self.num_of_rocks,
-                          self.user_seed,
-                          self.use_scale_dis,
-                          self.use_random_seed)
-
-        return {'FINISHED'}
diff --git a/release/scripts/addons_contrib/add_mesh_rocks/settings.py b/release/scripts/addons_contrib/add_mesh_rocks/settings.py
deleted file mode 100644
index 647a62d..0000000
--- a/release/scripts/addons_contrib/add_mesh_rocks/settings.py
+++ /dev/null
@@ -1,184 +0,0 @@
-# Paul "BrikBot" Marshall
-# Created: July 1, 2011
-# Last Modified: November 17, 2011
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-# Thanks to Meta-Androco, RickyBlender, Ace Dragon, and PKHG for ideas
-#   and testing.
-#
-# Coded in IDLE, tested in Blender 2.59.  NumPy Recommended.
-# Search for "@todo" to quickly find sections that need work.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  The Blender Rock Creation tool is for rapid generation of
-#  mesh rocks in Blender.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-import inspect
-import shutil
-from add_mesh_rocks import utils
-from xml.dom import minidom
-
-basePath = inspect.getfile(inspect.currentframe())[0:-len("settings.py")]
-path = basePath + "add_mesh_rocks.xml"
-
-try:
-    source = minidom.parse(path)
-    print("Rock generator settings file found:\n" + path)
-except:
-    print("Rock generator settings file not found.  Creating settings file.")
-    shutil.copy(basePath + "factory.xml", path)
-    source = minidom.parse(path)
-
-xmlDefault = source.getElementsByTagName('default')[0]
-xmlPresets = source.getElementsByTagName('preset')
-default = []
-presets = []
-
-#----- Gets and Sets -----#
-
-
-def getDefault():
-    global default
-    return default
-
-
-def getPresetLists():
-    global presets
-    return presets
-
-
-def getPreset(ID=0):
-    global presets
-    return presets[ID]
-
-#---------- Core ----------#
-
-
-def parse():
-    global xmlDefault
-    global xmlPresets
-    global default
-    global presets
-
-    # Parse default values
-    default = parseNode(xmlDefault)
-
-    # Parse preset values
-    for setting in xmlPresets:
-        presets.append(parseNode(setting))
-
-    return '{FINISHED}'
-
-
-# Takes a node and parses it for data.  Relies on that setting.xml has
-#   a valid format as specified by the DTD.
-# For some reason minidom places an empty child node for every other node.
-def parseNode(setting, title=True):
-    loc = 1
-
-    if title:
-        # Preset name (xmlPreset.childNodes[1]):
-        title = setting.childNodes[loc].childNodes[0].data
-        loc += 2
-
-    # Preset size values (xmlPreset.childNodes[3]):
-    scaleX = [float(setting.childNodes[loc].childNodes[1].childNodes[3].childNodes[0].data),
-              float(setting.childNodes[loc].childNodes[1].childNodes[5].childNodes[0].data)]
-    scaleY = [float(setting.childNodes[loc].childNodes[3].childNodes[3].childNodes[0].data),
-              float(setting.childNodes[loc].childNodes[3].childNodes[5].childNodes[0].data)]
-    scaleZ = [float(setting.childNodes[loc].childNodes[5].childNodes[3].childNodes[0].data),
-              float(setting.childNodes[loc].childNodes[5].childNodes[5].childNodes[0].data)]
-    skewX = float(setting.childNodes[loc].childNodes[7].childNodes[3].childNodes[0].data)
-    skewY = float(setting.childNodes[loc].childNodes[9].childNodes[3].childNodes[0].data)
-    skewZ = float(setting.childNodes[loc].childNodes[11].childNodes[3].childNodes[0].data)
-    if setting.childNodes[loc].childNodes[13].childNodes[0].data == 'False':
-        use_scale_dis = False
-    else:
-        use_scale_dis = True
-    scale_fac = utils.toList(setting.childNodes[loc].childNodes[15].childNodes[0].data)
-    loc += 2
-
-    # Presst shape values (xmlPreset.childNodes[5]):
-    deform = float(setting.childNodes[loc].childNodes[1].childNodes[0].data)
-    rough = float(setting.childNodes[loc].childNodes[3].childNodes[0].data)
-    detail = int(setting.childNodes[loc].childNodes[5].childNodes[0].data)
-    display_detail = int(setting.childNodes[loc].childNodes[7].childNodes[0].data)
-    smooth_fac = float(setting.childNodes[loc].childNodes[9].childNodes[0].data)
-    smooth_it = int(setting.childNodes[loc].childNodes[11].childNodes[0].data)
-    loc += 2
-
-    # Preset material values (xmlPreset.childNodes[7]):
-    if setting.childNodes[loc].childNodes[1].childNodes[0].data == 'False':
-        mat_enable = False
-    else:
-        mat_enable = True
-    mat_color = utils.toList(setting.childNodes[loc].childNodes[3].childNodes[0].data)
-    mat_bright = float(setting.childNodes[loc].childNodes[5].childNodes[0].data)
-    mat_rough = float(setting.childNodes[loc].childNodes[7].childNodes[0].data)
-    mat_spec = float(setting.childNodes[loc].childNodes[9].childNodes[0].data)
-    mat_hard = int(setting.childNodes[loc].childNodes[11].childNodes[0].data)
-    mat_use_trans = bool(setting.childNodes[loc].childNodes[13].childNodes[0].data)
-    mat_alpha = float(setting.childNodes[loc].childNodes[15].childNodes[0].data)
-    mat_cloudy = float(setting.childNodes[loc].childNodes[17].childNodes[0].data)
-    mat_IOR = float(setting.childNodes[loc].childNodes[19].childNodes[0].data)
-    #mat_use_mirror = float(setting.childNodes[loc].childNodes[21].childNodes[0].data)
-    #mat_mossy = float(setting.childNodes[loc].childNodes[23].childNodes[0].data)
-    #mat_mossy = float(setting.childNodes[loc].childNodes[25].childNodes[0].data)
-    mat_mossy = float(setting.childNodes[loc].childNodes[21].childNodes[0].data)
-    loc += 2
-
-    # Preset random values (xmlPreset.childNodes[9]):
-    if setting.childNodes[loc].childNodes[1].childNodes[0].data == 'True':
-        use_generate = True
-    else:
-        use_generate = False
-    if setting.childNodes[loc].childNodes[3].childNodes[0].data == 'False':
-        use_random_seed = False
-    else:
-        use_random_seed = True
-    user_seed = int(setting.childNodes[loc].childNodes[5].childNodes[0].data)
-
-    if title:
-        parsed = [title, scaleX, scaleY, scaleZ, skewX, skewY, skewZ,
-                  use_scale_dis, scale_fac, deform, rough, detail,
-                  display_detail, smooth_fac, smooth_it, mat_enable, mat_color,
-                  mat_bright, mat_rough, mat_spec, mat_hard, mat_use_trans,
-                  mat_alpha, mat_cloudy, mat_IOR, mat_mossy, use_generate,
-                  use_random_seed, user_seed]
-    else:
-        parsed = [scaleX, scaleY, scaleZ, skewX, skewY, skewZ, use_scale_dis,
-                  scale_fac, deform, rough, detail, display_detail, smooth_fac,
-                  smooth_it, mat_enable, mat_color, mat_bright, mat_rough,
-                  mat_spec, mat_hard, mat_use_trans, mat_alpha, mat_cloudy,
-                  mat_IOR, mat_mossy, use_generate, use_random_seed, user_seed]
-
-    return parsed
-
-
-def save():
-    return '{FINISHED}'
-
-
-def _print():
-    for i in presets:
-        print(i)
-    return '{FINISHED}'
diff --git a/release/scripts/addons_contrib/add_mesh_rocks/utils.py b/release/scripts/addons_contrib/add_mesh_rocks/utils.py
deleted file mode 100644
index 94acaf7..0000000
--- a/release/scripts/addons_contrib/add_mesh_rocks/utils.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  The Blender Rock Creation tool is for rapid generation of mesh rocks.
-#  Copyright (C) 2011  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-
-# Converts a formated string to a float tuple:
-#   IN - '(0.5, 0.2)' -> CONVERT -> OUT - (0.5, 0.2)
-def toTuple(stringIn):
-    sTemp = str(stringIn)[1:len(str(stringIn)) - 1].split(', ')
-    fTemp = []
-    for i in sTemp:
-        fTemp.append(float(i))
-    return tuple(fTemp)
-
-
-# Converts a formated string to a float tuple:
-#   IN - '[0.5, 0.2]' -> CONVERT -> OUT - [0.5, 0.2]
-def toList(stringIn):
-    sTemp = str(stringIn)[1:len(str(stringIn)) - 1].split(', ')
-    fTemp = []
-    for i in sTemp:
-        fTemp.append(float(i))
-    return fTemp
-
-
-# Converts each item of a list into a float:
-def toFloats(inList):
-    outList = []
-    for i in inList:
-        outList.append(float(i))
-    return outList
-
-
-# Converts each item of a list into an integer:
-def toInts(inList):
-    outList = []
-    for i in inList:
-        outList.append(int(i))
-    return outList
-
-
-# Sets all faces smooth.  Done this way since I can't
-# find a simple way without using bpy.ops:
-def smooth(mesh):
-    import bmesh
-    bm = bmesh.new()
-    bm.from_mesh(mesh)
-    for f in bm.faces:
-        f.smooth = True
-    bm.to_mesh(mesh)
-    return mesh
diff --git a/release/scripts/addons_contrib/add_mesh_symmetrical_empty.py b/release/scripts/addons_contrib/add_mesh_symmetrical_empty.py
deleted file mode 100644
index 697be49..0000000
--- a/release/scripts/addons_contrib/add_mesh_symmetrical_empty.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Add Symmetrical Empty",
-    "author": "Pablo Vazquez",			
-    "version": (1,0,2),
-    "blender": (2, 64, 0),
-    "location": "View3D > Add > Mesh > Symmetrical Empty",
-    "description": "Add an empty mesh with a Mirror Modifier for quick symmetrical modeling",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Add_Mesh/Add_Symmetrical_Empty",
-    "tracker_url": "",
-    "category": "Add Mesh"}
-'''
-Adds an empty mesh with a mirror modifier.
-'''    
-
-import bpy
-from bpy.props import BoolProperty
-
-def Add_Symmetrical_Empty():
-
-    bpy.ops.mesh.primitive_plane_add(enter_editmode = True)
-
-    sempty = bpy.context.object
-    sempty.name = "SymmEmpty"
-
-    # check if we have a mirror modifier, otherwise add
-    if (sempty.modifiers and sempty.modifiers['Mirror']):
-        pass
-    else:
-        bpy.ops.object.modifier_add(type ='MIRROR')
-
-    # Delete all!
-    bpy.ops.mesh.select_all(action='TOGGLE')
-    bpy.ops.mesh.select_all(action='TOGGLE')
-    bpy.ops.mesh.delete(type ='VERT')
-
-
-class AddSymmetricalEmpty(bpy.types.Operator):
-    
-    bl_idname = "mesh.primitive_symmetrical_empty_add"
-    bl_label = "Add Symmetrical Empty Mesh"
-    bl_description = "Add an empty mesh with a Mirror Modifier for quick symmetrical modeling"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    def draw(self, context):
-        layout = self.layout
-        mirror = bpy.context.object.modifiers['Mirror']
-
-        layout.prop(mirror,'use_clip', text="Use Clipping")
-
-        layout.label("Mirror Axis")
-        row = layout.row(align=True)
-        row.prop(mirror, "use_x")
-        row.prop(mirror, "use_y")
-        row.prop(mirror, "use_z")
-
-    def execute(self, context):
-        Add_Symmetrical_Empty()
-        return {'FINISHED'}
-
-## menu option ##
-def menu_item(self, context):
-    # only in object mode
-    if bpy.context.mode == "OBJECT":
-        self.layout.operator("mesh.primitive_symmetrical_empty_add",
-            text="Symmetrical Empty", icon="EMPTY_DATA")
-
-## register and add it on top of the list ##
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.INFO_MT_mesh_add.prepend(menu_item)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_mesh_add.remove(menu_item)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/add_scene_elements/__init__.py b/release/scripts/addons_contrib/add_scene_elements/__init__.py
deleted file mode 100644
index 604b500..0000000
--- a/release/scripts/addons_contrib/add_scene_elements/__init__.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-# by meta-androcto, parts based on work by Erich Toven #
-
-bl_info = {
-    "name": "Scene Elements",
-    "author": "Meta Androcto, ",
-    "version": (0, 2),
-    "blender": (2, 64, 0),
-    "location": "View3D > Add > Scene Elements",
-    "description": "Add Scenes & Lights, Objects.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6"\
-        "/Py/Scripts",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=32682",
-    "category": "Object"}
-
-
-if "bpy" in locals():
-    import imp
-    imp.reload(scene_camera)
-    imp.reload(scene_lighting)
-    imp.reload(scene_materials)
-    imp.reload(scene_objects)
-    imp.reload(scene_objects_cycles)
-
-else:
-    from . import scene_camera
-    from . import scene_lighting
-    from . import scene_materials
-    from . import scene_objects
-    from . import scene_objects_cycles
-	
-import bpy
-
-class INFO_MT_mesh_objects_add(bpy.types.Menu):
-    # Define the "mesh objects" menu
-    bl_idname = "INFO_MT_scene_elements"
-    bl_label = "Scene Elements"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.operator("camera.add_scene",
-            text="Scene_Camera")
-        layout.operator("materials.add_scene",
-            text="Scene_Objects_BI")
-        layout.operator("plane.add_scene",
-            text="Scene_Plane")
-        layout.operator("objects_cycles.add_scene",
-            text="Scene_Objects_Cycles")
-
-class INFO_MT_mesh_lamps_add(bpy.types.Menu):
-    # Define the "mesh objects" menu
-    bl_idname = "INFO_MT_scene_lamps"
-    bl_label = "Lighting Elements"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.operator("object.add_single_spot",
-            text="Add Single Spot")
-        layout.operator("object.add_basic_3point",
-            text="Add 3 Point Spot Setup")
-        layout.operator("object.add_basic_2point",
-            text="Add 2 Point Setup")
-        layout.operator("object.add_area_3point",
-            text="Add 3 Point Setup")
-
-# Register all operators and panels
-# Define "Extras" menu
-def menu_func(self, context):
-    self.layout.menu("INFO_MT_scene_elements", icon="PLUGIN")
-    self.layout.menu("INFO_MT_scene_lamps", icon="PLUGIN")
-def register():
-    bpy.utils.register_module(__name__)
-    # Add "Extras" menu to the "Add Mesh" menu
-    bpy.types.INFO_MT_add.append(menu_func)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    # Remove "Extras" menu from the "Add Mesh" menu.
-    bpy.types.INFO_MT_add.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/add_scene_elements/scene_camera.py b/release/scripts/addons_contrib/add_scene_elements/scene_camera.py
deleted file mode 100644
index 043bcec..0000000
--- a/release/scripts/addons_contrib/add_scene_elements/scene_camera.py
+++ /dev/null
@@ -1,89 +0,0 @@
-'''# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Scene Lighting Presets",
-    "author": "meta-androcto",
-    "version": (0,1),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tool Shelf > Scene Lighting Presets",
-    "description": "Creates Scenes with Lighting presets",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/",
-    "tracker_url": "",
-    "category": "Object"}
-'''	
-import bpy, mathutils, math
-from math import pi
-from bpy.props import *
-from mathutils import Vector
-
-class add_scene_camera(bpy.types.Operator):
-    bl_idname = "camera.add_scene"
-    bl_label = "Camera Only"
-    bl_description = "Empty scene with Camera"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        blend_data = context.blend_data
-        ob = bpy.context.active_object
-	
-# add new scene
-        bpy.ops.scene.new(type="NEW")
-        scene = bpy.context.scene
-        scene.name = "scene_camera"
-# render settings
-        render = scene.render
-        render.resolution_x = 1920
-        render.resolution_y = 1080
-        render.resolution_percentage = 50
-# add new world
-        world = bpy.data.worlds.new("Camera_World")
-        scene.world = world
-        world.use_sky_blend = True
-        world.use_sky_paper = True
-        world.horizon_color = (0.004393,0.02121,0.050)
-        world.zenith_color = (0.03335,0.227,0.359)
-        world.light_settings.use_ambient_occlusion = True
-        world.light_settings.ao_factor = 0.25
-# add camera
-        bpy.ops.object.camera_add(location = (7.48113,-6.50764,5.34367), rotation = (1.109319,0.010817,0.814928),)
-        cam = bpy.context.active_object.data
-        cam.lens = 35
-        cam.draw_size = 0.1
-
-        return {"FINISHED"}
-
-#### REGISTER ####
-def add_object_button(self, context):
-    self.layout.menu("INFO_MT_camera.add_scene", icon="PLUGIN")
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_add.append(add_object_button)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_add.remove(add_object_button)
-
-
-if __name__ == '__main__':
-    register()
diff --git a/release/scripts/addons_contrib/add_scene_elements/scene_lighting.py b/release/scripts/addons_contrib/add_scene_elements/scene_lighting.py
deleted file mode 100644
index 3226477..0000000
--- a/release/scripts/addons_contrib/add_scene_elements/scene_lighting.py
+++ /dev/null
@@ -1,244 +0,0 @@
-'''
-bl_info = {
-    "name": "Add 3 Point Lighting Setup",
-    "author": "Erich Toven" meta-androcto
-    "version": (1, 1),
-    "blender": (2, 56, 0),
-    "api": 34765,
-    "location": "View3D > Add",
-    "description": "Adds a new 3 point lighting setup",
-    "warning": "Very Alpha!",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Object"}
-
-
-'''
-import bpy, mathutils, math
-from math import pi
-from bpy.props import FloatVectorProperty
-#from add_utils import AddObjectHelper, add_object_data
-from mathutils import Vector
-
-
-class functions():
-    def addTrackToConstraint(ob, name, target):
-        cns = ob.constraints.new('TRACK_TO')
-        cns.name = name
-        cns.target = target
-        cns.track_axis = 'TRACK_NEGATIVE_Z'
-        cns.up_axis = 'UP_Y'
-        cns.owner_space = 'LOCAL'
-        cns.target_space = 'LOCAL'
-        return
-
-class AddSingleSpot(bpy.types.Operator):
-
-    bl_idname = "object.add_single_spot"
-    bl_label = "Add Single Spot Setup"
-    bl_options = {'REGISTER', 'UNDO'}
- 
-    def execute(self, context):
-   
-        ### Add basic 3 point lighting setup ###        
-        bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=(0.000000, 0.000000, 0.000000))
-        empty1 = bpy.context.object
-        
-        bpy.ops.object.lamp_add(type='SPOT', view_align=False, location=(0.000000, -10.000000, 10.000000), rotation=(-52.103, 15.548, -169.073))
-        lamp1 = bpy.context.object
-
-        ### Configure Lighting Setup ###        
-        lamp1.name = 'Single_Spot1'
-        
-        lamp1.data.energy = 4.0
-        lamp1.data.distance = 25.0
-        lamp1.data.spot_size = 1.396264
-        lamp1.data.spot_blend = 1
-        lamp1.data.shadow_method = 'BUFFER_SHADOW'
-        lamp1.data.shadow_buffer_type = 'HALFWAY'
-        lamp1.data.shadow_filter_type = 'GAUSS'
-        lamp1.data.shadow_buffer_soft = 10
-        lamp1.data.shadow_buffer_size = 2048
-        lamp1.data.shadow_buffer_bias = 0.100
-        lamp1.data.shadow_buffer_samples = 8
-        lamp1.data.use_auto_clip_start = True
-        lamp1.data.use_auto_clip_end = True
-
-        functions.addTrackToConstraint(lamp1,'AutoTrack',empty1)
-  
-        return {'FINISHED'}
-
-class AddArea3point(bpy.types.Operator):
-    bl_idname = "object.add_area_3point"
-    bl_label = "add 3 Point Area Setup"
-    bl_options = {'REGISTER', 'UNDO'}
-    bl_description = "Add 3 Point lights to Scene"  
-    def execute(self, context):
-        ### Add basic 3 point lighting setup ###      
-
-        bpy.ops.object.lamp_add(type='POINT', view_align=False, location=(-12.848104, 18.574114, 7.496113), rotation=(1.537930, 0.711540, 3.687180))
-        lamp1 = bpy.context.object
-
-        bpy.ops.object.lamp_add(type='POINT', view_align=False, location=(-13.168015, -18.672356, 15.276655), rotation=(0.941318, 0.917498, -1.187617))     
-        lamp2 = bpy.context.object
-
-        bpy.ops.object.lamp_add(type='POINT', view_align=False, location=(19.430519, -20.502472, 7.496113), rotation=(1.614763, 0.709077, 0.853816))   
-        lamp3 = bpy.context.object
-
-
-        ### Configure Lighting Setup ###        
-        lamp1.name = 'Point1'
-        lamp2.name = 'Point2'
-        lamp3.name = 'Point3'
-        
-        lamp1.data.energy = 0.75
-        lamp1.data.distance = 15.0
-        lamp1.data.shadow_method = 'RAY_SHADOW'
-
-       
-        lamp2.data.energy = 0.75
-        lamp2.data.distance = 16.0
-        lamp2.data.shadow_method = 'RAY_SHADOW'
-
-        
-        lamp3.data.energy = 0.6
-        lamp3.data.distance = 8.0
-        lamp3.data.shadow_method = 'RAY_SHADOW'
-
-        return {'FINISHED'}
-
-class AddBasic3Point(bpy.types.Operator):
-
-    bl_idname = "object.add_basic_3point"
-    bl_label = "Add 3 Point Spot Setup"
-    bl_options = {'REGISTER', 'UNDO'}
- 
-    def execute(self, context):
-   
-        ### Add basic 3 point lighting setup ###        
-        bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=(0.000000, -3.817210, 8.279530), rotation=(0, 0, 0))
-        empty1 = bpy.context.object
-        
-        bpy.ops.object.lamp_add(type='SPOT', view_align=False, location=(19.430519, -20.502472, 7.496113), rotation=(1.614763, 0.709077, 0.853816))
-        lamp1 = bpy.context.object
-
-        bpy.ops.object.lamp_add(type='SPOT', view_align=False, location=(-12.848104, 18.574114, 7.496113), rotation=(1.537930, 1.537930, 3.687180))
-        lamp2 = bpy.context.object
-                
-        bpy.ops.object.lamp_add(type='SPOT', view_align=False, location=(-13.168015, -18.672356, 15.276655), rotation=(0.941318, 0.917498, -1.187617))
-        lamp3 = bpy.context.object
-
-        ### Configure Lighting Setup ###        
-        lamp1.name = 'Spot1'
-        lamp2.name = 'Spot2'
-        lamp3.name = 'Key'
-        
-        lamp1.data.energy = 4.0
-        lamp1.data.distance = 25.0
-        lamp1.data.spot_size = 1.396264
-        lamp1.data.spot_blend = 1
-        lamp1.data.shadow_method = 'BUFFER_SHADOW'
-        lamp1.data.shadow_buffer_type = 'HALFWAY'
-        lamp1.data.shadow_filter_type = 'GAUSS'
-        lamp1.data.shadow_buffer_soft = 10
-        lamp1.data.shadow_buffer_size = 2048
-        lamp1.data.shadow_buffer_bias = 0.100
-        lamp1.data.shadow_buffer_samples = 8
-        lamp1.data.use_auto_clip_start = True
-        lamp1.data.use_auto_clip_end = True
-        
-        
-        lamp2.data.energy = 2.0
-        lamp2.data.distance = 25.0
-        lamp2.data.spot_size = 1.047198
-        lamp2.data.spot_blend = 1
-        lamp2.data.shadow_method = 'BUFFER_SHADOW'
-        lamp2.data.shadow_buffer_type = 'HALFWAY'
-        lamp2.data.shadow_filter_type = 'GAUSS'
-        lamp2.data.shadow_buffer_soft = 5
-        lamp2.data.shadow_buffer_size = 2048
-        lamp2.data.shadow_buffer_bias = 0.100
-        lamp2.data.shadow_buffer_samples = 16
-        lamp2.data.use_auto_clip_start = True
-        lamp2.data.use_auto_clip_end = True
-
-        lamp3.data.energy = 2.0
-        lamp3.data.distance = 30.0
-        lamp3.data.spot_size = 1.570797
-        lamp3.data.spot_blend = 1
-        lamp3.data.shadow_method = 'BUFFER_SHADOW'
-        lamp3.data.shadow_buffer_type = 'HALFWAY'
-        lamp3.data.shadow_filter_type = 'GAUSS'
-        lamp3.data.shadow_buffer_soft = 20
-        lamp3.data.shadow_buffer_size = 2048
-        lamp3.data.shadow_buffer_bias = 1
-        lamp3.data.shadow_buffer_samples = 16
-        lamp3.data.use_auto_clip_start = True
-        lamp3.data.use_auto_clip_end = True
-
-        functions.addTrackToConstraint(lamp3,'AutoTrack',empty1)
-  
-        return {'FINISHED'}
-class AddBasic2Point(bpy.types.Operator):
-
-    bl_idname = "object.add_basic_2point"
-    bl_label = "Add 2 Point Setup"
-    bl_options = {'REGISTER', 'UNDO'}
- 
-    def execute(self, context):
-   
-# add point lamp
-        bpy.ops.object.lamp_add(type="POINT", location = (4.07625,1.00545,5.90386), rotation =(0.650328,0.055217,1.866391))
-        lamp1 = bpy.context.active_object.data
-        lamp1.name = "Point_Right"
-        lamp1.energy = 1.0
-        lamp1.distance = 30.0
-        lamp1.shadow_method = "RAY_SHADOW"
-        lamp1.use_sphere = True        
-# add point lamp2
-        bpy.ops.object.lamp_add(type="POINT", location = (-0.57101,-4.24586,5.53674), rotation =(1.571,0,0.785))
-        lamp2 = bpy.context.active_object.data
-        lamp2.name = "Point_Left"
-        lamp2.energy = 1.0
-        lamp2.distance = 30.0
-        lamp2.shadow_method = "RAY_SHADOW"
-  
-        return {'FINISHED'}
-       
-class INFO_MT_add_3pointsetup(bpy.types.Menu):
-    bl_idname = "INFO_MT_lighting.add"
-    bl_label = "Lighting Setups"
-    bl_description = "Add 3 point light sets to Scene"  
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-
-        layout.operator("object.add_single_spot",
-            text="Add Single Spot")
-        layout.operator("object.add_basic_3point",
-            text="Add 3 Point Spot Setup")
-        layout.operator("object.add_basic_2point",
-            text="Add 2 Point Setup")
-        layout.operator("object.add_area_3point",
-            text="Add 3 Point Setup")
-
-#import space_info    
-
-
-#### REGISTER ####
-def menu_func(self, context):
-    self.layout.menu("INFO_MT_lighting.add", icon="PLUGIN")
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_add.append(menu_func)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_add.remove(menu_func)
-
-
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_scene_elements/scene_materials.py b/release/scripts/addons_contrib/add_scene_elements/scene_materials.py
deleted file mode 100644
index 81ac8f8..0000000
--- a/release/scripts/addons_contrib/add_scene_elements/scene_materials.py
+++ /dev/null
@@ -1,250 +0,0 @@
-'''
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Scene Lighting Presets",
-    "author": "meta-androcto",
-    "version": (0,1),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tool Shelf > Scene Lighting Presets",
-    "description": "Creates Scenes with Lighting presets",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/",
-    "tracker_url": "",
-    "category": "Object"}
-'''	
-import bpy, mathutils, math
-from math import pi
-from bpy.props import *
-from mathutils import Vector
-
-class add_scene(bpy.types.Operator):
-    bl_idname = "materials.add_scene"
-    bl_label = "Create test scene"
-    bl_description = "Materials Scene with Objects"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        blend_data = context.blend_data
-        ob = bpy.context.active_object
-	
-# add new scene
-        bpy.ops.scene.new(type="NEW")
-        scene = bpy.context.scene
-        scene.name = "scene_materials"
-# render settings
-        render = scene.render
-        render.resolution_x = 1920
-        render.resolution_y = 1080
-        render.resolution_percentage = 50
-# add new world
-        world = bpy.data.worlds.new("Materials_World")
-        scene.world = world
-        world.use_sky_blend = True
-        world.use_sky_paper = True
-        world.horizon_color = (0.004393,0.02121,0.050)
-        world.zenith_color = (0.03335,0.227,0.359)
-        world.light_settings.use_ambient_occlusion = True
-        world.light_settings.ao_factor = 0.25
-# add camera
-        bpy.ops.object.camera_add(location = (7.48113,-6.50764,5.34367), rotation = (1.109319,0.010817,0.814928))
-        cam = bpy.context.active_object.data
-        cam.lens = 35
-        cam.draw_size = 0.1
-        
-# add point lamp
-        bpy.ops.object.lamp_add(type="POINT", location = (4.07625,1.00545,5.90386), rotation =(0.650328,0.055217,1.866391))
-        lamp1 = bpy.context.active_object.data
-        lamp1.name = "Point_Right"
-        lamp1.energy = 1.0
-        lamp1.distance = 30.0
-        lamp1.shadow_method = "RAY_SHADOW"
-        lamp1.use_sphere = True        
-# add point lamp2
-        bpy.ops.object.lamp_add(type="POINT", location = (-0.57101,-4.24586,5.53674), rotation =(1.571,0,0.785))
-        lamp2 = bpy.context.active_object.data
-        lamp2.name = "Point_Left"
-        lamp2.energy = 1.0
-        lamp2.distance = 30.0
-#       lamp2.shadow_method = "RAY_SHADOW"
-        
-# light Rim
-        """
-        # add spot lamp3
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.191,0.714,0.689), rotation =(0.891,0,2.884))
-        lamp3 = bpy.context.active_object.data
-        lamp3.name = "Rim Light"
-        lamp3.color = (0.194,0.477,1)
-        lamp3.energy = 3
-        lamp3.distance = 1.5
-        lamp3.shadow_buffer_soft = 5
-        lamp3.shadow_buffer_size = 4096
-        lamp3.shadow_buffer_clip_end = 1.5
-        lamp3.spot_blend = 0.5
-        """
-
-# add cube
-        bpy.ops.mesh.primitive_cube_add()
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.mesh.subdivide(number_cuts=2)
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.object.modifier_add(type='BEVEL')
-        bpy.ops.object.modifier_add(type='SUBSURF')
-        bpy.ops.object.shade_smooth()
-
-
-        cube = bpy.context.active_object
-# add new material
-
-        cubeMaterial = blend_data.materials.new("Cube_Material")
-        bpy.ops.object.material_slot_add()
-        cube.material_slots[0].material = cubeMaterial
-
-            
-#Material settings
-# Diffuse
-        cubeMaterial.preview_render_type = "CUBE"
-        cubeMaterial.diffuse_color = (1.000, 0.373, 0.00)
-        cubeMaterial.diffuse_shader  = 'OREN_NAYAR' 
-        cubeMaterial.diffuse_intensity = 1.0
-        cubeMaterial.roughness = 0.09002
-# Specular
-        cubeMaterial.specular_color = (1.000, 0.800, 0.136)
-        cubeMaterial.specular_shader = "PHONG"
-        cubeMaterial.specular_intensity = 1.0
-        cubeMaterial.specular_hardness = 511.0
-# Shading
-        cubeMaterial.ambient = 1.00
-        cubeMaterial.use_cubic = False
-# Transparency
-        cubeMaterial.use_transparency = False
-        cubeMaterial.alpha = 0
-# Mirror
-        cubeMaterial.raytrace_mirror.use = True
-        cubeMaterial.mirror_color = (1.000, 0.793, 0.0)
-        cubeMaterial.raytrace_mirror.reflect_factor = 0.394
-        cubeMaterial.raytrace_mirror.fresnel = 2.0
-        cubeMaterial.raytrace_mirror.fresnel_factor = 1.641
-        cubeMaterial.raytrace_mirror.fade_to = "FADE_TO_SKY"
-        cubeMaterial.raytrace_mirror.gloss_anisotropic = 1.0
-# Shadow
-        cubeMaterial.use_transparent_shadows = True
-		
-# Add a texture
-        cubetex = blend_data.textures.new("CloudTex", type='CLOUDS')
-        cubetex.noise_type = 'SOFT_NOISE'
-        cubetex.noise_scale = 0.25
-        mtex = cubeMaterial.texture_slots.add()
-        mtex.texture = cubetex
-        mtex.texture_coords = 'ORCO'
-        mtex.scale = (0.800, 0.800, 0.800)
-        mtex.use_map_mirror = True
-        mtex.mirror_factor = 0.156
-        mtex.use_map_color_diffuse = True
-        mtex.diffuse_color_factor = 0.156
-        mtex.use_map_normal = True
-        mtex.normal_factor = 0.010
-        mtex.blend_type = "ADD"
-        mtex.use_rgb_to_intensity = True
-        mtex.color = (1.000, 0.207, 0.000)
-#add monkey #
-        bpy.ops.mesh.primitive_monkey_add(location = (-0.32639,0.08901,1.49976))
-        bpy.ops.transform.rotate(value=(1.15019), axis=(0, 0, 1))
-        bpy.ops.transform.rotate(value=(-0.683882), axis=(0, 1, 0))
-        bpy.ops.object.modifier_add(type='SUBSURF')
-        bpy.ops.object.shade_smooth()
-        monkey = bpy.context.active_object
-# add new material
-
-        monkeyMaterial = blend_data.materials.new("Monkey_Material")
-        bpy.ops.object.material_slot_add()
-        monkey.material_slots[0].material = monkeyMaterial
-
-#Material settings
-        monkeyMaterial.preview_render_type = "MONKEY"
-        monkeyMaterial.diffuse_color = (0.239, 0.288, 0.288)
-        monkeyMaterial.specular_color = (0.604, 0.465, 0.136)
-        monkeyMaterial.diffuse_shader    = 'LAMBERT' 
-        monkeyMaterial.diffuse_intensity = 1.0 
-        monkeyMaterial.specular_intensity = 0.3
-        monkeyMaterial.ambient = 0
-        monkeyMaterial.type = 'SURFACE'
-        monkeyMaterial.use_cubic = True
-        monkeyMaterial.use_transparency = False
-        monkeyMaterial.alpha = 0
-        monkeyMaterial.use_transparent_shadows = True
-        monkeyMaterial.raytrace_mirror.use = True
-        monkeyMaterial.raytrace_mirror.reflect_factor = 0.65
-        monkeyMaterial.raytrace_mirror.fade_to = "FADE_TO_MATERIAL"
-# add plane
-
-        bpy.ops.mesh.primitive_plane_add(location = (0.0,0.0,-1.0))
-        bpy.ops.transform.rotate(value=(-0.820305), axis=(0, 0, 1))
-        bpy.ops.transform.resize(value=(22.0, 22.0, 0.0))
-        bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
-
-        plane = bpy.context.active_object
-# add new material
-
-        planeMaterial = blend_data.materials.new("Plane_Material")
-        bpy.ops.object.material_slot_add()
-        plane.material_slots[0].material = planeMaterial
-
-            
-#Material settings
-        planeMaterial.preview_render_type = "CUBE"
-        planeMaterial.diffuse_color = (0.2, 0.2, 0.2)
-        planeMaterial.specular_color = (0.604, 0.465, 0.136)
-        planeMaterial.specular_intensity = 0.3
-        planeMaterial.ambient = 0
-        planeMaterial.use_cubic = True
-        planeMaterial.use_transparency = False
-        planeMaterial.alpha = 0
-        planeMaterial.use_transparent_shadows = True
-        return {"FINISHED"}
-
-class INFO_MT_add_scenesetup(bpy.types.Menu):
-    bl_idname = "INFO_MT_materials.add_scene"
-    bl_label = "Materials Scene"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-
-        layout.operator("materials.add_scene",
-            text="Add scene")
-
-#### REGISTER ####
-def menu_func(self, context):
-    self.layout.menu("INFO_MT_materials.add_scene", icon="PLUGIN")
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_add.append(menu_func)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_add.remove(menu_func)
-
-
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_scene_elements/scene_objects.py b/release/scripts/addons_contrib/add_scene_elements/scene_objects.py
deleted file mode 100644
index d825b84..0000000
--- a/release/scripts/addons_contrib/add_scene_elements/scene_objects.py
+++ /dev/null
@@ -1,157 +0,0 @@
-'''
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Scene Lighting Presets",
-    "author": "meta-androcto",
-    "version": (0,1),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tool Shelf > Scene Lighting Presets",
-    "description": "Creates Scenes with Lighting presets",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/",
-    "tracker_url": "",
-    "category": "Object"}
-'''	
-import bpy, mathutils, math
-from math import pi
-from bpy.props import *
-from mathutils import Vector
-
-class add_scene(bpy.types.Operator):
-    bl_idname = "plane.add_scene"
-    bl_label = "Create test scene"
-    bl_description = "Scene with 'infinite' plane"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        blend_data = context.blend_data
-        ob = bpy.context.active_object
-	
-# add new scene
-        bpy.ops.scene.new(type="NEW")
-        scene = bpy.context.scene
-        scene.name = "scene_plane"
-# render settings
-        render = scene.render
-        render.resolution_x = 1920
-        render.resolution_y = 1080
-        render.resolution_percentage = 50
-# add new world
-        world = bpy.data.worlds.new("Plane_World")
-        scene.world = world
-        world.use_sky_blend = True
-        world.use_sky_paper = True
-        world.horizon_color = (0.004393,0.02121,0.050)
-        world.zenith_color = (0.03335,0.227,0.359)
-        world.light_settings.use_ambient_occlusion = True
-        world.light_settings.ao_factor = 0.25
-# add camera
-        bpy.ops.object.camera_add(location = (7.48113,-6.50764,5.34367), rotation = (1.109319,0.010817,0.814928))
-        cam = bpy.context.active_object.data
-        cam.lens = 35
-        cam.draw_size = 0.1
-        
-# add point lamp
-        bpy.ops.object.lamp_add(type="POINT", location = (4.07625,1.00545,5.90386), rotation =(0.650328,0.055217,1.866391))
-        lamp1 = bpy.context.active_object.data
-        lamp1.name = "Point_Right"
-        lamp1.energy = 1.0
-        lamp1.distance = 30.0
-        lamp1.shadow_method = "RAY_SHADOW"
-        lamp1.use_sphere = True        
-# add point lamp2
-        bpy.ops.object.lamp_add(type="POINT", location = (-0.57101,-4.24586,5.53674), rotation =(1.571,0,0.785))
-        lamp2 = bpy.context.active_object.data
-        lamp2.name = "Point_Left"
-        lamp2.energy = 1.0
-        lamp2.distance = 30.0
-#        lamp2.shadow_method = "RAY_SHADOW"
-        
-# light Rim
-        """
-        # add spot lamp3
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.191,0.714,0.689), rotation =(0.891,0,2.884))
-        lamp3 = bpy.context.active_object.data
-        lamp3.name = "Rim Light"
-        lamp3.color = (0.194,0.477,1)
-        lamp3.energy = 3
-        lamp3.distance = 1.5
-        lamp3.shadow_buffer_soft = 5
-        lamp3.shadow_buffer_size = 4096
-        lamp3.shadow_buffer_clip_end = 1.5
-        lamp3.spot_blend = 0.5
-        """
-
-# add plane
-
-        bpy.ops.mesh.primitive_plane_add(location = (0.0,0.0,-1.0))
-        bpy.ops.transform.rotate(value=(-0.820305), axis=(0, 0, 1))
-        bpy.ops.transform.resize(value=(22.0, 22.0, 0.0))
-        bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
-
-        plane = bpy.context.active_object
-# add new material
-
-        planeMaterial = blend_data.materials.new("Plane_Material")
-        bpy.ops.object.material_slot_add()
-        plane.material_slots[0].material = planeMaterial
-
-            
-#Material settings
-        planeMaterial.preview_render_type = "CUBE"
-        planeMaterial.diffuse_color = (0.2, 0.2, 0.2)
-        planeMaterial.specular_color = (0.604, 0.465, 0.136)
-        planeMaterial.specular_intensity = 0.3
-        planeMaterial.ambient = 0
-        planeMaterial.use_cubic = True
-        planeMaterial.use_transparency = False
-        planeMaterial.alpha = 0
-        planeMaterial.use_transparent_shadows = True
-        return {"FINISHED"}
-
-class INFO_MT_add_scenesetup(bpy.types.Menu):
-    bl_idname = "INFO_MT_plane.add_scene"
-    bl_label = "Lighting Setups"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-
-        layout.operator("planet.add_scene",
-            text="Add scene")
-
-#### REGISTER ####
-def add_object_button(self, context):
-    self.layout.menu("INFO_MT_plane.add_scene", icon="PLUGIN")
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_add.append(add_object_button)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_add.remove(add_object_button)
-
-
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/add_scene_elements/scene_objects_cycles.py b/release/scripts/addons_contrib/add_scene_elements/scene_objects_cycles.py
deleted file mode 100644
index 0f895ad..0000000
--- a/release/scripts/addons_contrib/add_scene_elements/scene_objects_cycles.py
+++ /dev/null
@@ -1,261 +0,0 @@
-'''
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Scene Lighting Presets",
-    "author": "meta-androcto",
-    "version": (0,1),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tool Shelf > Scene Lighting Presets",
-    "description": "Creates Scenes with Lighting presets",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/",
-    "tracker_url": "",
-    "category": "Object"}
-'''	
-import bpy, mathutils, math
-from math import pi
-from bpy.props import *
-from mathutils import Vector
-
-class add_scene(bpy.types.Operator):
-    bl_idname = "objects_cycles.add_scene"
-    bl_label = "Create test scene"
-    bl_description = "Cycles Scene with Objects"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        blend_data = context.blend_data
-        ob = bpy.context.active_object
-	
-# add new scene
-
-        bpy.ops.scene.new(type="NEW")
-        scene = bpy.context.scene
-        bpy.context.scene.render.engine='CYCLES'
-        scene.name = "scene_object_cycles"
-# render settings
-        render = scene.render
-        render.resolution_x = 1920
-        render.resolution_y = 1080
-        render.resolution_percentage = 50
-# add new world
-        world = bpy.data.worlds.new("Cycles_Object_World")
-        scene.world = world
-        world.use_sky_blend = True
-        world.use_sky_paper = True
-        world.horizon_color = (0.004393,0.02121,0.050)
-        world.zenith_color = (0.03335,0.227,0.359)
-        world.light_settings.use_ambient_occlusion = True
-        world.light_settings.ao_factor = 0.25
-# add camera
-        bpy.ops.object.camera_add(location = (7.48113,-6.50764,5.34367), rotation = (1.109319,0.010817,0.814928))
-        cam = bpy.context.active_object.data
-        cam.lens = 35
-        cam.draw_size = 0.1
-        
-# add point lamp
-        bpy.ops.object.lamp_add(type="POINT", location = (4.07625,1.00545,5.90386), rotation =(0.650328,0.055217,1.866391))
-        lamp1 = bpy.context.active_object.data
-        lamp1.name = "Point_Right"
-        lamp1.energy = 1.0
-        lamp1.distance = 30.0
-        lamp1.shadow_method = "RAY_SHADOW"
-        lamp1.use_sphere = True        
-# add point lamp2
-        bpy.ops.object.lamp_add(type="POINT", location = (-0.57101,-4.24586,5.53674), rotation =(1.571,0,0.785))
-        lamp2 = bpy.context.active_object.data
-        lamp2.name = "Point_Left"
-        lamp2.energy = 1.0
-        lamp2.distance = 30.0
-#        lamp2.shadow_method = "RAY_SHADOW"
-        
-# light Rim
-        """
-        # add spot lamp3
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.191,0.714,0.689), rotation =(0.891,0,2.884))
-        lamp3 = bpy.context.active_object.data
-        lamp3.name = "Rim Light"
-        lamp3.color = (0.194,0.477,1)
-        lamp3.energy = 3
-        lamp3.distance = 1.5
-        lamp3.shadow_buffer_soft = 5
-        lamp3.shadow_buffer_size = 4096
-        lamp3.shadow_buffer_clip_end = 1.5
-        lamp3.spot_blend = 0.5
-        """
-
-# add cube
-        bpy.ops.mesh.primitive_cube_add()
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.mesh.subdivide(number_cuts=2)
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.object.modifier_add(type='BEVEL')
-        bpy.ops.object.modifier_add(type='SUBSURF')
-        bpy.ops.object.shade_smooth()
-
-
-        cube = bpy.context.active_object
-# add new material
-
-        cubeMaterial = blend_data.materials.new("Cycles_Cube_Material")
-        bpy.ops.object.material_slot_add()
-        cube.material_slots[0].material = cubeMaterial
-
-            
-#Material settings
-# Diffuse
-        cubeMaterial.preview_render_type = "CUBE"
-        cubeMaterial.diffuse_color = (1.000, 0.373, 0.00)
-        cubeMaterial.diffuse_shader  = 'OREN_NAYAR' 
-        cubeMaterial.diffuse_intensity = 1.0
-        cubeMaterial.roughness = 0.09002
-# Specular
-        cubeMaterial.specular_color = (1.000, 0.800, 0.136)
-        cubeMaterial.specular_shader = "PHONG"
-        cubeMaterial.specular_intensity = 1.0
-        cubeMaterial.specular_hardness = 511.0
-# Shading
-        cubeMaterial.ambient = 1.00
-        cubeMaterial.use_cubic = False
-# Transparency
-        cubeMaterial.use_transparency = False
-        cubeMaterial.alpha = 0
-# Mirror
-        cubeMaterial.raytrace_mirror.use = True
-        cubeMaterial.mirror_color = (1.000, 0.793, 0.0)
-        cubeMaterial.raytrace_mirror.reflect_factor = 0.394
-        cubeMaterial.raytrace_mirror.fresnel = 2.0
-        cubeMaterial.raytrace_mirror.fresnel_factor = 1.641
-        cubeMaterial.raytrace_mirror.fade_to = "FADE_TO_SKY"
-        cubeMaterial.raytrace_mirror.gloss_anisotropic = 1.0
-# Shadow
-        cubeMaterial.use_transparent_shadows = True
-## Cycles ##
-
-        cubeMaterial.use_nodes = True
-
-# Add a texture
-        cubetex = blend_data.textures.new("CloudTex", type='CLOUDS')
-        cubetex.noise_type = 'SOFT_NOISE'
-        cubetex.noise_scale = 0.25
-        mtex = cubeMaterial.texture_slots.add()
-        mtex.texture = cubetex
-        mtex.texture_coords = 'ORCO'
-        mtex.scale = (0.800, 0.800, 0.800)
-        mtex.use_map_mirror = True
-        mtex.mirror_factor = 0.156
-        mtex.use_map_color_diffuse = True
-        mtex.diffuse_color_factor = 0.156
-        mtex.use_map_normal = True
-        mtex.normal_factor = 0.010
-        mtex.blend_type = "ADD"
-        mtex.use_rgb_to_intensity = True
-        mtex.color = (1.000, 0.207, 0.000)
-#add monkey #
-        bpy.ops.mesh.primitive_monkey_add(location = (-0.32639,0.08901,1.49976))
-        bpy.ops.transform.rotate(value=(1.15019), axis=(0, 0, 1))
-        bpy.ops.transform.rotate(value=(-0.683882), axis=(0, 1, 0))
-        bpy.ops.object.modifier_add(type='SUBSURF')
-        bpy.ops.object.shade_smooth()
-        monkey = bpy.context.active_object
-# add new material
-
-        monkeyMaterial = blend_data.materials.new("Cycles_Monkey_Material")
-        bpy.ops.object.material_slot_add()
-        monkey.material_slots[0].material = monkeyMaterial
-
-#Material settings
-        monkeyMaterial.preview_render_type = "MONKEY"
-        monkeyMaterial.diffuse_color = (0.239, 0.288, 0.288)
-        monkeyMaterial.specular_color = (0.604, 0.465, 0.136)
-        monkeyMaterial.diffuse_shader    = 'LAMBERT' 
-        monkeyMaterial.diffuse_intensity = 1.0 
-        monkeyMaterial.specular_intensity = 0.3
-        monkeyMaterial.ambient = 0
-        monkeyMaterial.type = 'SURFACE'
-        monkeyMaterial.use_cubic = True
-        monkeyMaterial.use_transparency = False
-        monkeyMaterial.alpha = 0
-        monkeyMaterial.use_transparent_shadows = True
-        monkeyMaterial.raytrace_mirror.use = True
-        monkeyMaterial.raytrace_mirror.reflect_factor = 0.65
-        monkeyMaterial.raytrace_mirror.fade_to = "FADE_TO_MATERIAL"
-        monkeyMaterial.use_nodes=True
-# add plane
-
-        bpy.ops.mesh.primitive_plane_add(location = (0.0,0.0,-1.0))
-        bpy.ops.transform.rotate(value=(-0.820305), axis=(0, 0, 1))
-        bpy.ops.transform.resize(value=(22.0, 22.0, 0.0))
-        bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
-
-        plane = bpy.context.active_object
-# add new material
-
-        planeMaterial = blend_data.materials.new("Cycles_Plane_Material")
-        bpy.ops.object.material_slot_add()
-        plane.material_slots[0].material = planeMaterial
-
-            
-#Material settings
-        planeMaterial.preview_render_type = "CUBE"
-        planeMaterial.diffuse_color = (0.2, 0.2, 0.2)
-        planeMaterial.specular_color = (0.604, 0.465, 0.136)
-        planeMaterial.specular_intensity = 0.3
-        planeMaterial.ambient = 0
-        planeMaterial.use_cubic = True
-        planeMaterial.use_transparency = False
-        planeMaterial.alpha = 0
-        planeMaterial.use_transparent_shadows = True
-        mats = bpy.data.materials
-        sc = bpy.context.scene
-        planeMaterial.use_nodes=True
-        TreeNodes=planeMaterial.node_tree
-        links = TreeNodes.links
-        shader = TreeNodes.nodes.new('BSDF_GLOSSY') 
-        return {'FINISHED'}
-class INFO_MT_add_scenesetup(bpy.types.Menu):
-    bl_idname = "INFO_MT_objects_cycles.add_scene"
-    bl_label = "Lighting Setups"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-
-        layout.operator("light.add_scene",
-            text="Add scene")
-
-#### REGISTER ####
-def menu_func(self, context):
-    self.layout.menu("INFO_MT_objects_cycles.add_scene", icon="PLUGIN")
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_add.append(menu_func)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_add.remove(menu_func)
-
-
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/anim_selection_sets.py b/release/scripts/addons_contrib/anim_selection_sets.py
deleted file mode 100644
index 5b87add..0000000
--- a/release/scripts/addons_contrib/anim_selection_sets.py
+++ /dev/null
@@ -1,353 +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, see <http://www.gnu.org/licenses/>
- #  and write to the Free Software Foundation, Inc., 51 Franklin Street, 
- #  Fifth Floor, Boston, MA  02110-1301, USA..
- #
- #  The Original Code is Copyright (C) 2012 Blender Foundation ###
- #  All rights reserved.
- #
- #
- #  The Original Code is: all of this file.
- #
- #  Contributor(s): Dan Eicher.
- #
- #  ***** END GPL LICENSE BLOCK *****
-
-# <pep8 compliant>
-
-import string
-import bpy
-
-bl_info = {
-  "name": "Selection Set",
-  "author": "Dan Eicher",
-  "version": (0, 1, 0),
-    "blender": (2, 63, 0),
-  "location": "Properties -> Object Data -> Selection Sets",
-  "description": "Selection Sets to select groups of bones",
-  "warning": "Proxy armatures need to export sets and run generated script on re-opening file",
-  "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Animation/SelectionSets",
-  "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=31492",
-  "category": "Animation"
-}
-
-
-script_template = '''# generated by ANIM_OT_selection_set_export -- abandon all hope, ye who hand edit!
-
-import bpy
-
-def selection_set_import():
-    arm = bpy.data.armatures['${name}']
-
-    set_list = [${set_list}
-               ]
-
-    for name, bones in set_list:
-        if arm.selection_sets.find(name) == -1:
-            sel_set = arm.selection_sets.add()
-            sel_set.name = name
-
-            for bone in bones:
-                set_bone = sel_set.bones.add()
-                set_bone.name = bone
-
-
-if __name__ == "__main__":
-    selection_set_import()
-'''
-
-
-def generic_poll(context):
-    return (context.mode == 'POSE' and context.object and context.object.type == 'ARMATURE')
-
-
-def active_selection_set_update_func(self, context):
-    idx = self.active_selection_set
-    if idx < -1 or idx >= len(self.selection_sets):
-        self.active_selection_set = -1
-        raise IndexError('Armature.active_selection_set: out of range')
-
-
-class SelectionSetBone(bpy.types.PropertyGroup):
-    name = bpy.props.StringProperty()
-
-
-class SelectionSet(bpy.types.PropertyGroup):
-    name = bpy.props.StringProperty(options={'LIBRARY_EDITABLE'})
-    bones = bpy.props.CollectionProperty(type=SelectionSetBone)
-
-
-class ANIM_OT_selection_set_add(bpy.types.Operator):
-    """Add a new selection set"""
-    bl_idname = "anim.selection_set_add"
-    bl_label = "Selection Set Add"
-
-    @classmethod
-    def poll(cls, context):
-        return generic_poll(context)
-
-    def execute(self, context):
-        arm = context.active_object.data
-
-        tmp_name = name = 'Set'
-        name_sub = 1
-        while arm.selection_sets.find(name) != -1:
-            name = tmp_name + ' ' + str(name_sub)
-            name_sub += 1
-
-        sel_set = arm.selection_sets.add()
-        sel_set.name = name
-
-        arm.active_selection_set = arm.selection_sets.find(name)
-
-        return {'FINISHED'}
-
-
-class ANIM_OT_selection_set_remove(bpy.types.Operator):
-    """Remove the active selection set"""
-    bl_idname = "anim.selection_set_remove"
-    bl_label = "Selection Set Remove"
-
-    @classmethod
-    def poll(cls, context):
-        arm = context.active_object.data
-        return (generic_poll(context) and arm.active_selection_set != -1)
-
-    def execute(self, context):
-        arm = context.active_object.data
-        active_index = arm.active_selection_set
-
-        arm.selection_sets.remove(active_index)
-
-        if active_index >= len(arm.selection_sets):
-            arm.active_selection_set = len(arm.selection_sets) - 1
-
-        return {'FINISHED'}
-
-
-class ANIM_OT_selection_set_assign(bpy.types.Operator):
-    """Add selected bones to the active selection set"""
-    bl_idname = "anim.selection_set_assign"
-    bl_label = "Selection Set Assign"
-
-    @classmethod
-    def poll(cls, context):
-        arm = context.active_object.data
-        return (generic_poll(context) and arm.active_selection_set != -1)
-
-    def execute(self, context):
-        arm = context.active_object.data
-        sel_set = arm.selection_sets[arm.active_selection_set]
-        bones = [bone for bone in arm.bones if bone.select]
-
-        for bone in bones:
-            if sel_set.bones.find(bone.name) == -1:
-                set_bone = sel_set.bones.add()
-                set_bone.name = bone.name
-
-        return {'FINISHED'}
-
-
-class ANIM_OT_selection_set_unassign(bpy.types.Operator):
-    """Remove selected bones from the active selection set"""
-    bl_idname = "anim.selection_set_unassign"
-    bl_label = "Selection Set Unassign"
-
-    @classmethod
-    def poll(cls, context):
-        arm = context.active_object.data
-        return (generic_poll(context) and arm.active_selection_set != -1)
-
-    def execute(self, context):
-        arm = context.active_object.data
-        sel_set = arm.selection_sets[arm.active_selection_set]
-        bones = [bone for bone in arm.bones if bone.select]
-
-        for bone in bones:
-            bone_index = sel_set.bones.find(bone.name)
-            if bone_index != -1:
-                sel_set.bones.remove(bone_index)
-
-        return {'FINISHED'}
-
-
-class ANIM_OT_selection_set_select(bpy.types.Operator):
-    """Select bones in selection set"""
-    bl_idname = "anim.selection_set_select"
-    bl_label = "Selection Set Select Bones"
-
-    @classmethod
-    def poll(cls, context):
-        arm = context.active_object.data
-        return (generic_poll(context) and arm.active_selection_set != -1)
-
-    def execute(self, context):
-        arm = context.active_object.data
-        sel_set = arm.selection_sets[arm.active_selection_set]
-
-        for bone in sel_set.bones:
-            try:
-                arm.bones[bone.name].select = True
-            except:
-                bone_index = sel_set.bones.find(bone.name)
-                sel_set.bones.remove(bone_index)
-
-        return {'FINISHED'}
-
-
-class ANIM_OT_selection_set_deselect(bpy.types.Operator):
-    """Deselect bones in selection set"""
-    bl_idname = "anim.selection_set_deselect"
-    bl_label = "Selection Set Deselect Bones"
-
-    @classmethod
-    def poll(cls, context):
-        arm = context.active_object.data
-        return (generic_poll(context) and arm.active_selection_set != -1)
-
-    def execute(self, context):
-        arm = context.active_object.data
-        sel_set = arm.selection_sets[arm.active_selection_set]
-
-        for bone in sel_set.bones:
-            try:
-                arm.bones[bone.name].select = False
-            except:
-                bone_index = sel_set.bones.find(bone.name)
-                sel_set.bones.remove(bone_index)
-
-        return {'FINISHED'}
-
-
-class ANIM_OT_selection_set_export(bpy.types.Operator):
-    """Export selection set data to a python script"""
-    bl_idname = "anim.selection_set_export"
-    bl_label = "Selection Set Export"
-
-    @classmethod
-    def poll(cls, context):
-        return generic_poll(context)
-
-    def execute(self, context):
-        arm = context.active_object.data
-        set_script = string.Template(script_template)
-        set_list = ""
-
-        for sel_set in arm.selection_sets:
-            set_bones = ""
-            for bone in sel_set.bones:
-                set_bones += "'" + bone.name + "',"
-            set_list += "\n                ('{name}', [{bones}]),".format(name=sel_set.name, bones=set_bones)
-
-        try:
-            script_file = bpy.data.texts['{arm.name}SelectionSetImport.py'.format(arm=arm)]
-        except:
-            script_file = bpy.data.texts.new('{arm.name}SelectionSetImport.py'.format(arm=arm))
-
-        script_file.clear()
-        script_file.write(set_script.substitute(name=arm.name, set_list=set_list))
-
-        return {'FINISHED'}
-
-
-class DATA_PT_bone_sets(bpy.types.Panel):
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = "data"
-    bl_label = "Selection Sets"
-
-    @classmethod
-    def poll(cls, context):
-        return (context.object and context.object.type == 'ARMATURE' and context.object.pose)
-
-    def draw(self, context):
-        layout = self.layout
-        ob = context.object
-        arm = ob.data
-        sel_set = None
-
-        if arm.active_selection_set != -1:
-            try:
-                sel_set = arm.selection_sets[arm.active_selection_set]
-            except:
-                pass
-
-        row = layout.row()
-
-        row.template_list(arm, "selection_sets", arm, "active_selection_set",
-                          rows=(5 if len(arm.selection_sets) else 2))
-
-        col = row.column(align=True)
-        col.operator("anim.selection_set_add", icon='ZOOMIN', text="")
-        col.operator("anim.selection_set_remove", icon='ZOOMOUT', text="")
-
-        if sel_set:
-            col = layout.column()
-            col.prop(sel_set, "name", text="Name")
-
-        row = layout.row()
-
-        sub = row.row(align=True)
-        sub.operator("anim.selection_set_assign", text="Assign")
-        sub.operator("anim.selection_set_unassign", text="Remove")
-
-        sub = row.row(align=True)
-        sub.operator("anim.selection_set_select", text="Select")
-        sub.operator("anim.selection_set_deselect", text="Deselect")
-
-        row = layout.row()
-        row.operator("anim.selection_set_export", text="Export Selection Sets")
-
-
-def register():
-    bpy.utils.register_class(SelectionSetBone)
-    bpy.utils.register_class(SelectionSet)
-    bpy.utils.register_class(ANIM_OT_selection_set_add)
-    bpy.utils.register_class(ANIM_OT_selection_set_remove)
-    bpy.utils.register_class(ANIM_OT_selection_set_assign)
-    bpy.utils.register_class(ANIM_OT_selection_set_unassign)
-    bpy.utils.register_class(ANIM_OT_selection_set_select)
-    bpy.utils.register_class(ANIM_OT_selection_set_deselect)
-    bpy.utils.register_class(ANIM_OT_selection_set_export)
-    bpy.utils.register_class(DATA_PT_bone_sets)
-
-    bpy.types.Armature.selection_sets = bpy.props.CollectionProperty(type=SelectionSet,
-                                            name="Selection Sets",
-                                            description="Collection of bones to be selected")
-
-    bpy.types.Armature.active_selection_set = bpy.props.IntProperty(name="Active Selection Set",
-                                                                    default=-1,
-                                                                    options={'LIBRARY_EDITABLE'},
-                                                                    update=active_selection_set_update_func)
-
-
-def unregister():
-    del bpy.types.Armature.selection_sets
-    del bpy.types.Armature.active_selection_set
-
-    bpy.utils.unregister_class(SelectionSet)
-    bpy.utils.unregister_class(SelectionSetBone)
-    bpy.utils.unregister_class(ANIM_OT_selection_set_add)
-    bpy.utils.unregister_class(ANIM_OT_selection_set_remove)
-    bpy.utils.unregister_class(ANIM_OT_selection_set_assign)
-    bpy.utils.unregister_class(ANIM_OT_selection_set_unassign)
-    bpy.utils.unregister_class(ANIM_OT_selection_set_select)
-    bpy.utils.unregister_class(ANIM_OT_selection_set_deselect)
-    bpy.utils.unregister_class(ANIM_OT_selection_set_export)
-    bpy.utils.unregister_class(DATA_PT_bone_sets)
-
-if __name__ == "__main__":
-    register()
-
diff --git a/release/scripts/addons_contrib/animation_motion_trail.py b/release/scripts/addons_contrib/animation_motion_trail.py
deleted file mode 100644
index af38480..0000000
--- a/release/scripts/addons_contrib/animation_motion_trail.py
+++ /dev/null
@@ -1,1740 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-
-bl_info = {
-    "name": "Motion Trail",
-    "author": "Bart Crouch",
-    "version": (3, 1, 1),
-    "blender": (2, 61, 0),
-    "location": "View3D > Toolbar > Motion Trail tab",
-    "warning": "",
-    "description": "Display and edit motion trails in the 3d-view",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/"
-                "Py/Scripts/Animation/Motion_Trail",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"
-                    "func=detail&aid=26374",
-    "category": "Animation"}
-
-
-import bgl
-import blf
-import bpy
-from bpy_extras import view3d_utils
-import math
-import mathutils
-
-
-# fake fcurve class, used if no fcurve is found for a path
-class fake_fcurve():
-    def __init__(self, object, index, rotation=False, scale=False):
-        # location
-        if not rotation and not scale:
-            self.loc = object.location[index]
-        # scale
-        elif scale:
-            self.loc = object.scale[index]
-        # rotation
-        elif rotation == 'QUATERNION':
-            self.loc = object.rotation_quaternion[index]
-        elif rotation == 'AXIS_ANGLE':
-            self.loc = object.rotation_axis_angle[index]
-        else:
-            self.loc = object.rotation_euler[index]
-        self.keyframe_points = []
-    
-    def evaluate(self, frame):
-        return(self.loc)
-    
-    def range(self):
-        return([])
-
-
-# get location curves of the given object
-def get_curves(object, child=False):
-    if object.animation_data and object.animation_data.action:
-        action = object.animation_data.action
-        if child:
-            # posebone
-            curves = [fc for fc in action.fcurves if len(fc.data_path)>=14 \
-            and fc.data_path[-9:]=='.location' and \
-            child.name in fc.data_path.split("\"")]
-        else:
-            # normal object
-            curves = [fc for fc in action.fcurves if \
-            fc.data_path == 'location']
-    elif object.animation_data and object.animation_data.use_nla:
-        curves = []
-        strips = []
-        for track in object.animation_data.nla_tracks:
-            not_handled = [s for s in track.strips]
-            while not_handled:
-                current_strip = not_handled.pop(-1)
-                if current_strip.action:
-                    strips.append(current_strip)
-                if current_strip.strips:
-                    # meta strip
-                    not_handled += [s for s in current_strip.strips]
-        
-        for strip in strips:
-            if child:
-                # posebone
-                curves = [fc for fc in strip.action.fcurves if \
-                len(fc.data_path)>=14 and fc.data_path[-9:]=='.location' \
-                and child.name in fc.data_path.split("\"")]
-            else:
-                # normal object
-                curves = [fc for fc in strip.action.fcurves if \
-                fc.data_path == 'location']
-            if curves:
-                # use first strip with location fcurves
-                break
-    else:
-        # should not happen?
-        curves = []
-    
-    # ensure we have three curves per object
-    fcx = None
-    fcy = None
-    fcz = None
-    for fc in curves:
-        if fc.array_index == 0:
-            fcx = fc
-        elif fc.array_index == 1:
-            fcy = fc
-        elif fc.array_index == 2:
-            fcz = fc
-    if fcx == None:
-        fcx = fake_fcurve(object, 0)
-    if fcy == None:
-        fcy = fake_fcurve(object, 1)
-    if fcz == None:
-        fcz = fake_fcurve(object, 2)
-
-    return([fcx, fcy, fcz])
-
-
-# turn screen coordinates (x,y) into world coordinates vector
-def screen_to_world(context, x, y):
-    depth_vector = view3d_utils.region_2d_to_vector_3d(\
-        context.region, context.region_data, [x,y])
-    vector = view3d_utils.region_2d_to_location_3d(\
-        context.region, context.region_data, [x,y], depth_vector)
-    
-    return(vector)
-
-
-# turn 3d world coordinates vector into screen coordinate integers (x,y)
-def world_to_screen(context, vector):
-    prj = context.region_data.perspective_matrix * \
-        mathutils.Vector((vector[0], vector[1], vector[2], 1.0))
-    width_half = context.region.width / 2.0
-    height_half = context.region.height / 2.0
-
-    x = int(width_half + width_half * (prj.x / prj.w))
-    y = int(height_half + height_half * (prj.y / prj.w))
-    
-    # correction for corner cases in perspective mode
-    if prj.w < 0:
-        if x < 0:
-            x = context.region.width * 2
-        else:
-            x = context.region.width * -2
-        if y < 0:
-            y = context.region.height * 2
-        else:
-            y = context.region.height * -2
-    
-    return(x, y)
-
-
-# calculate location of display_ob in worldspace
-def get_location(frame, display_ob, offset_ob, curves):
-    if offset_ob:
-        bpy.context.scene.frame_set(frame)
-        display_mat = getattr(display_ob, "matrix", False)
-        if not display_mat:
-            # posebones have "matrix", objects have "matrix_world"
-            display_mat = display_ob.matrix_world
-        if offset_ob:
-            loc = display_mat.to_translation() + \
-                offset_ob.matrix_world.to_translation()
-        else:
-            loc = display_mat.to_translation()
-    else:
-        fcx, fcy, fcz = curves
-        locx = fcx.evaluate(frame)
-        locy = fcy.evaluate(frame)
-        locz = fcz.evaluate(frame)
-        loc = mathutils.Vector([locx, locy, locz])
-    
-    return(loc)
-
-
-# get position of keyframes and handles at the start of dragging
-def get_original_animation_data(context, keyframes):
-    keyframes_ori = {}
-    handles_ori = {}
-    
-    if context.active_object and context.active_object.mode == 'POSE':
-        armature_ob = context.active_object
-        objects = [[armature_ob, pb, armature_ob] for pb in \
-            context.selected_pose_bones]
-    else:
-        objects = [[ob, False, False] for ob in context.selected_objects]
-    
-    for action_ob, child, offset_ob in objects:
-        if not action_ob.animation_data:
-            continue
-        curves = get_curves(action_ob, child)
-        if len(curves) == 0:
-            continue
-        fcx, fcy, fcz = curves
-        if child:
-            display_ob = child
-        else:
-            display_ob = action_ob
-        
-        # get keyframe positions
-        frame_old = context.scene.frame_current
-        keyframes_ori[display_ob.name] = {}
-        for frame in keyframes[display_ob.name]:
-            loc = get_location(frame, display_ob, offset_ob, curves)
-            keyframes_ori[display_ob.name][frame] = [frame, loc]
-        
-        # get handle positions
-        handles_ori[display_ob.name] = {}
-        for frame in keyframes[display_ob.name]:
-            handles_ori[display_ob.name][frame] = {}
-            left_x = [frame, fcx.evaluate(frame)]
-            right_x = [frame, fcx.evaluate(frame)]
-            for kf in fcx.keyframe_points:
-                if kf.co[0] == frame:
-                    left_x = kf.handle_left[:]
-                    right_x = kf.handle_right[:]
-                    break
-            left_y = [frame, fcy.evaluate(frame)]
-            right_y = [frame, fcy.evaluate(frame)]
-            for kf in fcy.keyframe_points:
-                if kf.co[0] == frame:
-                    left_y = kf.handle_left[:]
-                    right_y = kf.handle_right[:]
-                    break
-            left_z = [frame, fcz.evaluate(frame)]
-            right_z = [frame, fcz.evaluate(frame)]
-            for kf in fcz.keyframe_points:
-                if kf.co[0] == frame:
-                    left_z = kf.handle_left[:]
-                    right_z = kf.handle_right[:]
-                    break
-            handles_ori[display_ob.name][frame]["left"] = [left_x, left_y,
-                left_z]
-            handles_ori[display_ob.name][frame]["right"] = [right_x, right_y,
-                right_z]
-        
-        if context.scene.frame_current != frame_old:
-            context.scene.frame_set(frame_old)
-    
-    return(keyframes_ori, handles_ori)
-
-
-# callback function that calculates positions of all things that need be drawn
-def calc_callback(self, context):
-    if context.active_object and context.active_object.mode == 'POSE':
-        armature_ob = context.active_object
-        objects = [[armature_ob, pb, armature_ob] for pb in \
-            context.selected_pose_bones]
-    else:
-        objects = [[ob, False, False] for ob in context.selected_objects]
-    if objects == self.displayed:
-        selection_change = False
-    else:
-        selection_change = True
-    
-    if self.lock and not selection_change and \
-    context.region_data.perspective_matrix == self.perspective and not \
-    context.window_manager.motion_trail.force_update:
-        return
-    
-    # dictionaries with key: objectname
-    self.paths = {} # value: list of lists with x, y, color
-    self.keyframes = {} # value: dict with frame as key and [x,y] as value
-    self.handles = {} # value: dict of dicts
-    self.timebeads = {} # value: dict with frame as key and [x,y] as value
-    self.click = {} # value: list of lists with frame, type, loc-vector
-    if selection_change:
-        # value: editbone inverted rotation matrix or None
-        self.edit_bones = {}
-    if selection_change or not self.lock or context.window_manager.\
-    motion_trail.force_update:
-        # contains locations of path, keyframes and timebeads
-        self.cached = {"path":{}, "keyframes":{}, "timebeads_timing":{},
-            "timebeads_speed":{}}
-    if self.cached["path"]:
-        use_cache = True
-    else:
-        use_cache = False
-    self.perspective = context.region_data.perspective_matrix.copy()
-    self.displayed = objects # store, so it can be checked next time
-    context.window_manager.motion_trail.force_update = False
-   
-    global_undo = context.user_preferences.edit.use_global_undo
-    context.user_preferences.edit.use_global_undo = False
-    
-    for action_ob, child, offset_ob in objects:
-        if selection_change:
-            if not child:
-                self.edit_bones[action_ob.name] = None
-            else:
-                bpy.ops.object.mode_set(mode='EDIT')
-                editbones = action_ob.data.edit_bones
-                mat = editbones[child.name].matrix.copy().to_3x3().inverted()
-                bpy.ops.object.mode_set(mode='POSE')
-                self.edit_bones[child.name] = mat
-        
-        if not action_ob.animation_data:
-            continue
-        curves = get_curves(action_ob, child)
-        if len(curves) == 0:
-            continue
-        
-        if context.window_manager.motion_trail.path_before == 0:
-            range_min = context.scene.frame_start
-        else:
-            range_min = max(context.scene.frame_start,
-                context.scene.frame_current - \
-                context.window_manager.motion_trail.path_before)
-        if context.window_manager.motion_trail.path_after == 0:
-            range_max = context.scene.frame_end
-        else:
-            range_max = min(context.scene.frame_end,
-                context.scene.frame_current + \
-                context.window_manager.motion_trail.path_after)
-        fcx, fcy, fcz = curves
-        if child:
-            display_ob = child
-        else:
-            display_ob = action_ob
-        
-        # get location data of motion path
-        path = []
-        speeds = []
-        frame_old = context.scene.frame_current
-        step = 11 - context.window_manager.motion_trail.path_resolution
-        
-        if not use_cache:
-            if display_ob.name not in self.cached["path"]:
-                self.cached["path"][display_ob.name] = {}
-        if use_cache and range_min-1 in self.cached["path"][display_ob.name]:
-            prev_loc = self.cached["path"][display_ob.name][range_min-1]
-        else:
-            prev_loc = get_location(range_min-1, display_ob, offset_ob, curves)
-            self.cached["path"][display_ob.name][range_min-1] = prev_loc
-        
-        for frame in range(range_min, range_max + 1, step):
-            if use_cache and frame in self.cached["path"][display_ob.name]:
-                loc = self.cached["path"][display_ob.name][frame]
-            else:
-                loc = get_location(frame, display_ob, offset_ob, curves)
-                self.cached["path"][display_ob.name][frame] = loc
-            if not context.region or not context.space_data:
-                continue
-            x, y = world_to_screen(context, loc)
-            if context.window_manager.motion_trail.path_style == 'simple':
-                path.append([x, y, [0.0, 0.0, 0.0], frame, action_ob, child])
-            else:
-                dloc = (loc - prev_loc).length
-                path.append([x, y, dloc, frame, action_ob, child])
-                speeds.append(dloc)
-                prev_loc = loc
-        
-        # calculate color of path
-        if context.window_manager.motion_trail.path_style == 'speed':
-            speeds.sort()
-            min_speed = speeds[0]
-            d_speed = speeds[-1] - min_speed
-            for i, [x, y, d_loc, frame, action_ob, child] in enumerate(path):
-                relative_speed = (d_loc - min_speed) / d_speed # 0.0 to 1.0
-                red = min(1.0, 2.0 * relative_speed)
-                blue = min(1.0, 2.0 - (2.0 * relative_speed))
-                path[i][2] = [red, 0.0, blue]
-        elif context.window_manager.motion_trail.path_style == 'acceleration':
-            accelerations = []
-            prev_speed = 0.0
-            for i, [x, y, d_loc, frame, action_ob, child] in enumerate(path):
-                accel = d_loc - prev_speed
-                accelerations.append(accel)
-                path[i][2] = accel
-                prev_speed = d_loc
-            accelerations.sort()
-            min_accel = accelerations[0]
-            max_accel = accelerations[-1]
-            for i, [x, y, accel, frame, action_ob, child] in enumerate(path):
-                if accel < 0:
-                    relative_accel = accel / min_accel # values from 0.0 to 1.0
-                    green = 1.0 - relative_accel
-                    path[i][2] = [1.0, green, 0.0]
-                elif accel > 0:
-                    relative_accel = accel / max_accel # values from 0.0 to 1.0
-                    red = 1.0 - relative_accel
-                    path[i][2] = [red, 1.0, 0.0]
-                else:
-                    path[i][2] = [1.0, 1.0, 0.0]
-        self.paths[display_ob.name] = path
-        
-        # get keyframes and handles
-        keyframes = {}
-        handle_difs = {}
-        kf_time = []
-        click = []
-        if not use_cache:
-            if display_ob.name not in self.cached["keyframes"]:
-                self.cached["keyframes"][display_ob.name] = {}
-        
-        for fc in curves:
-            for kf in fc.keyframe_points:
-                # handles for location mode
-                if context.window_manager.motion_trail.mode == 'location':
-                    if kf.co[0] not in handle_difs:
-                        handle_difs[kf.co[0]] = {"left":mathutils.Vector(),
-                            "right":mathutils.Vector(), "keyframe_loc":None}
-                    handle_difs[kf.co[0]]["left"][fc.array_index] = \
-                        (mathutils.Vector(kf.handle_left[:]) - \
-                        mathutils.Vector(kf.co[:])).normalized()[1]
-                    handle_difs[kf.co[0]]["right"][fc.array_index] = \
-                        (mathutils.Vector(kf.handle_right[:]) - \
-                        mathutils.Vector(kf.co[:])).normalized()[1]
-                # keyframes
-                if kf.co[0] in kf_time:
-                    continue
-                kf_time.append(kf.co[0])
-                co = kf.co[0]
-                
-                if use_cache and co in \
-                self.cached["keyframes"][display_ob.name]:
-                    loc = self.cached["keyframes"][display_ob.name][co]
-                else:
-                    loc = get_location(co, display_ob, offset_ob, curves)
-                    self.cached["keyframes"][display_ob.name][co] = loc
-                if handle_difs:
-                    handle_difs[co]["keyframe_loc"] = loc
-                
-                x, y = world_to_screen(context, loc)
-                keyframes[kf.co[0]] = [x, y]
-                if context.window_manager.motion_trail.mode != 'speed':
-                    # can't select keyframes in speed mode
-                    click.append([kf.co[0], "keyframe",
-                        mathutils.Vector([x,y]), action_ob, child])
-        self.keyframes[display_ob.name] = keyframes
-        
-        # handles are only shown in location-altering mode
-        if context.window_manager.motion_trail.mode == 'location' and \
-        context.window_manager.motion_trail.handle_display:
-            # calculate handle positions
-            handles = {}
-            for frame, vecs in handle_difs.items():
-                if child:
-                    # bone space to world space
-                    mat = self.edit_bones[child.name].copy().inverted()
-                    vec_left = vecs["left"] * mat
-                    vec_right = vecs["right"] * mat
-                else:
-                    vec_left = vecs["left"]
-                    vec_right = vecs["right"]
-                if vecs["keyframe_loc"] != None:
-                    vec_keyframe = vecs["keyframe_loc"]
-                else:
-                    vec_keyframe = get_location(frame, display_ob, offset_ob,
-                        curves)
-                x_left, y_left = world_to_screen(context, vec_left*2 + \
-                    vec_keyframe)
-                x_right, y_right = world_to_screen(context, vec_right*2 + \
-                    vec_keyframe)
-                handles[frame] = {"left":[x_left, y_left],
-                    "right":[x_right, y_right]}
-                click.append([frame, "handle_left",
-                    mathutils.Vector([x_left, y_left]), action_ob, child])
-                click.append([frame, "handle_right",
-                    mathutils.Vector([x_right, y_right]), action_ob, child])
-            self.handles[display_ob.name] = handles
-        
-        # calculate timebeads for timing mode
-        if context.window_manager.motion_trail.mode == 'timing':
-            timebeads = {}
-            n = context.window_manager.motion_trail.timebeads * (len(kf_time) \
-                - 1)
-            dframe = (range_max - range_min) / (n + 1)
-            if not use_cache:
-                if display_ob.name not in self.cached["timebeads_timing"]:
-                    self.cached["timebeads_timing"][display_ob.name] = {}
-            
-            for i in range(1, n+1):
-                frame = range_min + i * dframe
-                if use_cache and frame in \
-                self.cached["timebeads_timing"][display_ob.name]:
-                    loc = self.cached["timebeads_timing"][display_ob.name]\
-                        [frame]
-                else:
-                    loc = get_location(frame, display_ob, offset_ob, curves)
-                    self.cached["timebeads_timing"][display_ob.name][frame] = \
-                        loc
-                x, y = world_to_screen(context, loc)
-                timebeads[frame] = [x, y]
-                click.append([frame, "timebead", mathutils.Vector([x,y]),
-                    action_ob, child])
-            self.timebeads[display_ob.name] = timebeads
-        
-        # calculate timebeads for speed mode
-        if context.window_manager.motion_trail.mode == 'speed':
-            angles = dict([[kf, {"left":[], "right":[]}] for kf in \
-                self.keyframes[display_ob.name]])
-            for fc in curves:
-                for i, kf in enumerate(fc.keyframe_points):
-                    if i != 0:
-                        angle = mathutils.Vector([-1, 0]).angle(mathutils.\
-                            Vector(kf.handle_left) - mathutils.Vector(kf.co),
-                            0)
-                        if angle != 0:
-                            angles[kf.co[0]]["left"].append(angle)
-                    if i != len(fc.keyframe_points) - 1:
-                        angle = mathutils.Vector([1, 0]).angle(mathutils.\
-                            Vector(kf.handle_right) - mathutils.Vector(kf.co),
-                            0)
-                        if angle != 0:
-                            angles[kf.co[0]]["right"].append(angle)
-            timebeads = {}
-            kf_time.sort()
-            if not use_cache:
-                if display_ob.name not in self.cached["timebeads_speed"]:
-                    self.cached["timebeads_speed"][display_ob.name] = {}
-            
-            for frame, sides in angles.items():
-                if sides["left"]:
-                    perc = (sum(sides["left"]) / len(sides["left"])) / \
-                        (math.pi / 2)
-                    perc = max(0.4, min(1, perc * 5))
-                    previous = kf_time[kf_time.index(frame) - 1]
-                    bead_frame = frame - perc * ((frame - previous - 2) / 2)
-                    if use_cache and bead_frame in \
-                    self.cached["timebeads_speed"][display_ob.name]:
-                        loc = self.cached["timebeads_speed"][display_ob.name]\
-                            [bead_frame]
-                    else:
-                        loc = get_location(bead_frame, display_ob, offset_ob,
-                            curves)
-                        self.cached["timebeads_speed"][display_ob.name]\
-                            [bead_frame] = loc
-                    x, y = world_to_screen(context, loc)
-                    timebeads[bead_frame] = [x, y]
-                    click.append([bead_frame, "timebead", mathutils.\
-                        Vector([x,y]), action_ob, child])
-                if sides["right"]:
-                    perc = (sum(sides["right"]) / len(sides["right"])) / \
-                        (math.pi / 2)
-                    perc = max(0.4, min(1, perc * 5))
-                    next = kf_time[kf_time.index(frame) + 1]
-                    bead_frame = frame + perc * ((next - frame - 2) / 2)
-                    if use_cache and bead_frame in \
-                    self.cached["timebeads_speed"][display_ob.name]:
-                        loc = self.cached["timebeads_speed"][display_ob.name]\
-                            [bead_frame]
-                    else:
-                        loc = get_location(bead_frame, display_ob, offset_ob,
-                            curves)
-                        self.cached["timebeads_speed"][display_ob.name]\
-                            [bead_frame] = loc
-                    x, y = world_to_screen(context, loc)
-                    timebeads[bead_frame] = [x, y]
-                    click.append([bead_frame, "timebead", mathutils.\
-                        Vector([x,y]), action_ob, child])
-            self.timebeads[display_ob.name] = timebeads
-        
-        # add frame positions to click-list
-        if context.window_manager.motion_trail.frame_display:
-            path = self.paths[display_ob.name]
-            for x, y, color, frame, action_ob, child in path:
-                click.append([frame, "frame", mathutils.Vector([x,y]),
-                    action_ob, child])
-        
-        self.click[display_ob.name] = click
-        
-        if context.scene.frame_current != frame_old:
-            context.scene.frame_set(frame_old)
-    
-    context.user_preferences.edit.use_global_undo = global_undo
-
-
-# draw in 3d-view
-def draw_callback(self, context):
-    # polling
-    if context.mode not in ['OBJECT', 'POSE'] or \
-    context.window_manager.motion_trail.enabled != 1:
-        return
-    
-    # display limits
-    if context.window_manager.motion_trail.path_before != 0:
-        limit_min = context.scene.frame_current - \
-            context.window_manager.motion_trail.path_before
-    else:
-        limit_min = -1e6
-    if context.window_manager.motion_trail.path_after != 0:
-        limit_max = context.scene.frame_current + \
-            context.window_manager.motion_trail.path_after
-    else:
-        limit_max = 1e6
-    
-    # draw motion path
-    bgl.glEnable(bgl.GL_BLEND)
-    bgl.glLineWidth(context.window_manager.motion_trail.path_width)
-    alpha = 1.0 - (context.window_manager.motion_trail.path_transparency / \
-        100.0)
-    if context.window_manager.motion_trail.path_style == 'simple':
-        bgl.glColor4f(0.0, 0.0, 0.0, alpha)
-        for objectname, path in self.paths.items():
-            bgl.glBegin(bgl.GL_LINE_STRIP)
-            for x, y, color, frame, action_ob, child in path:
-                if frame < limit_min or frame > limit_max:
-                    continue
-                bgl.glVertex2i(x, y)
-            bgl.glEnd()
-    else:
-        for objectname, path in self.paths.items():
-            for i, [x, y, color, frame, action_ob, child] in enumerate(path):
-                if frame < limit_min or frame > limit_max:
-                    continue
-                r, g, b = color
-                if i != 0:
-                    prev_path = path[i-1]
-                    halfway = [(x + prev_path[0])/2, (y + prev_path[1])/2]
-                    bgl.glColor4f(r, g, b, alpha)
-                    bgl.glBegin(bgl.GL_LINE_STRIP)
-                    bgl.glVertex2i(int(halfway[0]), int(halfway[1]))
-                    bgl.glVertex2i(x, y)
-                    bgl.glEnd()
-                if i != len(path) - 1:
-                    next_path = path[i+1]
-                    halfway = [(x + next_path[0])/2, (y + next_path[1])/2]
-                    bgl.glColor4f(r, g, b, alpha)
-                    bgl.glBegin(bgl.GL_LINE_STRIP)
-                    bgl.glVertex2i(x, y)
-                    bgl.glVertex2i(int(halfway[0]), int(halfway[1]))
-                    bgl.glEnd()
-    
-    # draw frames
-    if context.window_manager.motion_trail.frame_display:
-        bgl.glColor4f(1.0, 1.0, 1.0, 1.0)
-        bgl.glPointSize(1)
-        bgl.glBegin(bgl.GL_POINTS)
-        for objectname, path in self.paths.items():
-            for x, y, color, frame, action_ob, child in path:
-                if frame < limit_min or frame > limit_max:
-                    continue
-                if self.active_frame and objectname == self.active_frame[0] \
-                and abs(frame - self.active_frame[1]) < 1e-4:
-                    bgl.glEnd()
-                    bgl.glColor4f(1.0, 0.5, 0.0, 1.0)
-                    bgl.glPointSize(3)
-                    bgl.glBegin(bgl.GL_POINTS)
-                    bgl.glVertex2i(x,y)
-                    bgl.glEnd()
-                    bgl.glColor4f(1.0, 1.0, 1.0, 1.0)
-                    bgl.glPointSize(1)
-                    bgl.glBegin(bgl.GL_POINTS)
-                else:
-                    bgl.glVertex2i(x,y)
-        bgl.glEnd()
-    
-    # time beads are shown in speed and timing modes
-    if context.window_manager.motion_trail.mode in ['speed', 'timing']:
-        bgl.glColor4f(0.0, 1.0, 0.0, 1.0)
-        bgl.glPointSize(4)
-        bgl.glBegin(bgl.GL_POINTS)
-        for objectname, values in self.timebeads.items():
-            for frame, coords in values.items():
-                if frame < limit_min or frame > limit_max:
-                    continue
-                if self.active_timebead and \
-                objectname == self.active_timebead[0] and \
-                abs(frame - self.active_timebead[1]) < 1e-4:
-                    bgl.glEnd()
-                    bgl.glColor4f(1.0, 0.5, 0.0, 1.0)
-                    bgl.glBegin(bgl.GL_POINTS)
-                    bgl.glVertex2i(coords[0], coords[1])
-                    bgl.glEnd()
-                    bgl.glColor4f(0.0, 1.0, 0.0, 1.0)
-                    bgl.glBegin(bgl.GL_POINTS)
-                else:
-                    bgl.glVertex2i(coords[0], coords[1])
-        bgl.glEnd()
-    
-    # handles are only shown in location mode
-    if context.window_manager.motion_trail.mode == 'location':
-        # draw handle-lines
-        bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-        bgl.glLineWidth(1)
-        bgl.glBegin(bgl.GL_LINES)
-        for objectname, values in self.handles.items():
-            for frame, sides in values.items():
-                if frame < limit_min or frame > limit_max:
-                    continue
-                for side, coords in sides.items():
-                    if self.active_handle and \
-                    objectname == self.active_handle[0] and \
-                    side == self.active_handle[2] and \
-                    abs(frame - self.active_handle[1]) < 1e-4:
-                        bgl.glEnd()
-                        bgl.glColor4f(.75, 0.25, 0.0, 1.0)
-                        bgl.glBegin(bgl.GL_LINES)
-                        bgl.glVertex2i(self.keyframes[objectname][frame][0],
-                            self.keyframes[objectname][frame][1])
-                        bgl.glVertex2i(coords[0], coords[1])
-                        bgl.glEnd()
-                        bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-                        bgl.glBegin(bgl.GL_LINES)
-                    else:
-                        bgl.glVertex2i(self.keyframes[objectname][frame][0],
-                            self.keyframes[objectname][frame][1])
-                        bgl.glVertex2i(coords[0], coords[1])
-        bgl.glEnd()
-        
-        # draw handles
-        bgl.glColor4f(1.0, 1.0, 0.0, 1.0)
-        bgl.glPointSize(4)
-        bgl.glBegin(bgl.GL_POINTS)
-        for objectname, values in self.handles.items():
-            for frame, sides in values.items():
-                if frame < limit_min or frame > limit_max:
-                    continue
-                for side, coords in sides.items():
-                    if self.active_handle and \
-                    objectname == self.active_handle[0] and \
-                    side == self.active_handle[2] and \
-                    abs(frame - self.active_handle[1]) < 1e-4:
-                        bgl.glEnd()
-                        bgl.glColor4f(1.0, 0.5, 0.0, 1.0)
-                        bgl.glBegin(bgl.GL_POINTS)
-                        bgl.glVertex2i(coords[0], coords[1])
-                        bgl.glEnd()
-                        bgl.glColor4f(1.0, 1.0, 0.0, 1.0)
-                        bgl.glBegin(bgl.GL_POINTS)
-                    else:
-                        bgl.glVertex2i(coords[0], coords[1])
-        bgl.glEnd()
-        
-    # draw keyframes
-    bgl.glColor4f(1.0, 1.0, 0.0, 1.0)
-    bgl.glPointSize(6)
-    bgl.glBegin(bgl.GL_POINTS)
-    for objectname, values in self.keyframes.items():
-        for frame, coords in values.items():
-            if frame < limit_min or frame > limit_max:
-                continue
-            if self.active_keyframe and \
-            objectname == self.active_keyframe[0] and \
-            abs(frame - self.active_keyframe[1]) < 1e-4:
-                bgl.glEnd()
-                bgl.glColor4f(1.0, 0.5, 0.0, 1.0)
-                bgl.glBegin(bgl.GL_POINTS)
-                bgl.glVertex2i(coords[0], coords[1])
-                bgl.glEnd()
-                bgl.glColor4f(1.0, 1.0, 0.0, 1.0)
-                bgl.glBegin(bgl.GL_POINTS)
-            else:
-                bgl.glVertex2i(coords[0], coords[1])
-    bgl.glEnd()
-    
-    # draw keyframe-numbers
-    if context.window_manager.motion_trail.keyframe_numbers:
-        blf.size(0, 12, 72)
-        bgl.glColor4f(1.0, 1.0, 0.0, 1.0)
-        for objectname, values in self.keyframes.items():
-            for frame, coords in values.items():
-                if frame < limit_min or frame > limit_max:
-                    continue
-                blf.position(0, coords[0] + 3, coords[1] + 3, 0)
-                text = str(frame).split(".")
-                if len(text) == 1:
-                    text = text[0]
-                elif len(text[1]) == 1 and text[1] == "0":
-                    text = text[0]
-                else:
-                    text = text[0] + "." + text[1][0]
-                if self.active_keyframe and \
-                objectname == self.active_keyframe[0] and \
-                abs(frame - self.active_keyframe[1]) < 1e-4:
-                    bgl.glColor4f(1.0, 0.5, 0.0, 1.0)
-                    blf.draw(0, text)
-                    bgl.glColor4f(1.0, 1.0, 0.0, 1.0)
-                else:
-                    blf.draw(0, text)
-    
-    # restore opengl defaults
-    bgl.glLineWidth(1)
-    bgl.glDisable(bgl.GL_BLEND)
-    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-    bgl.glPointSize(1)
-
-
-# change data based on mouse movement
-def drag(context, event, drag_mouse_ori, active_keyframe, active_handle,
-active_timebead, keyframes_ori, handles_ori, edit_bones):
-    # change 3d-location of keyframe
-    if context.window_manager.motion_trail.mode == 'location' and \
-    active_keyframe:
-        objectname, frame, frame_ori, action_ob, child = active_keyframe
-        if child:
-            mat = action_ob.matrix_world.copy().inverted() * \
-                edit_bones[child.name].copy().to_4x4()
-        else:
-            mat = 1
-        
-        mouse_ori_world = screen_to_world(context, drag_mouse_ori[0],
-            drag_mouse_ori[1]) * mat
-        vector = screen_to_world(context, event.mouse_region_x,
-            event.mouse_region_y) * mat
-        d = vector - mouse_ori_world
-        
-        loc_ori_ws = keyframes_ori[objectname][frame][1]
-        loc_ori_bs = loc_ori_ws * mat
-        new_loc = loc_ori_bs + d
-        curves = get_curves(action_ob, child)
-        
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if kf.co[0] == frame:
-                    kf.co[1] = new_loc[i]
-                    kf.handle_left[1] = handles_ori[objectname][frame]\
-                        ["left"][i][1] + d[i]
-                    kf.handle_right[1] = handles_ori[objectname][frame]\
-                        ["right"][i][1] + d[i]
-                    break
-    
-    # change 3d-location of handle
-    elif context.window_manager.motion_trail.mode == 'location' and \
-    active_handle:
-        objectname, frame, side, action_ob, child = active_handle
-        if child:
-            mat = action_ob.matrix_world.copy().inverted() * \
-                edit_bones[child.name].copy().to_4x4()
-        else:
-            mat = 1
-        
-        mouse_ori_world = screen_to_world(context, drag_mouse_ori[0],
-            drag_mouse_ori[1]) * mat
-        vector = screen_to_world(context, event.mouse_region_x,
-            event.mouse_region_y) * mat
-        d = vector - mouse_ori_world
-        curves = get_curves(action_ob, child)
-        
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if kf.co[0] == frame:
-                    if side == "left":
-                        # change handle type, if necessary
-                        if kf.handle_left_type in ['AUTO', 'AUTO_CLAMPED',
-                        'ANIM_CLAMPED']:
-                            kf.handle_left_type = 'ALIGNED'
-                        elif kf.handle_left_type == 'VECTOR':
-                            kf.handle_left_type = 'FREE'
-                        # change handle position(s)
-                        kf.handle_left[1] = handles_ori[objectname][frame]\
-                            ["left"][i][1] + d[i]
-                        if kf.handle_left_type in ['ALIGNED', 'ANIM_CLAMPED',
-                        'AUTO', 'AUTO_CLAMPED']:
-                            dif = (abs(handles_ori[objectname][frame]["right"]\
-                                [i][0] - kf.co[0]) / abs(kf.handle_left[0] - \
-                                kf.co[0])) * d[i]
-                            kf.handle_right[1] = handles_ori[objectname]\
-                                [frame]["right"][i][1] - dif
-                    elif side == "right":
-                        # change handle type, if necessary
-                        if kf.handle_right_type in ['AUTO', 'AUTO_CLAMPED',
-                        'ANIM_CLAMPED']:
-                            kf.handle_left_type = 'ALIGNED'
-                            kf.handle_right_type = 'ALIGNED'
-                        elif kf.handle_right_type == 'VECTOR':
-                            kf.handle_left_type = 'FREE'
-                            kf.handle_right_type = 'FREE'
-                        # change handle position(s)
-                        kf.handle_right[1] = handles_ori[objectname][frame]\
-                            ["right"][i][1] + d[i]
-                        if kf.handle_right_type in ['ALIGNED', 'ANIM_CLAMPED',
-                        'AUTO', 'AUTO_CLAMPED']:
-                            dif = (abs(handles_ori[objectname][frame]["left"]\
-                                [i][0] - kf.co[0]) / abs(kf.handle_right[0] - \
-                                kf.co[0])) * d[i]
-                            kf.handle_left[1] = handles_ori[objectname]\
-                                [frame]["left"][i][1] - dif
-                    break
-    
-    # change position of all keyframes on timeline
-    elif context.window_manager.motion_trail.mode == 'timing' and \
-    active_timebead:
-        objectname, frame, frame_ori, action_ob, child = active_timebead
-        curves = get_curves(action_ob, child)
-        ranges = [val for c in curves for val in c.range()]
-        ranges.sort()
-        range_min = round(ranges[0])
-        range_max = round(ranges[-1])
-        range = range_max - range_min
-        dx_screen = -(mathutils.Vector([event.mouse_region_x,
-            event.mouse_region_y]) - drag_mouse_ori)[0]
-        dx_screen = dx_screen / context.region.width * range
-        new_frame = frame + dx_screen
-        shift_low = max(1e-4, (new_frame - range_min) / (frame - range_min))
-        shift_high = max(1e-4, (range_max - new_frame) / (range_max - frame))
-        
-        new_mapping = {}
-        for i, curve in enumerate(curves):
-            for j, kf in enumerate(curve.keyframe_points):
-                frame_map = kf.co[0]
-                if frame_map < range_min + 1e-4 or \
-                frame_map > range_max - 1e-4:
-                    continue
-                frame_ori = False
-                for f in keyframes_ori[objectname]:
-                    if abs(f - frame_map) < 1e-4:
-                        frame_ori = keyframes_ori[objectname][f][0]
-                        value_ori = keyframes_ori[objectname][f]
-                        break
-                if not frame_ori:
-                    continue
-                if frame_ori <= frame:
-                    frame_new = (frame_ori - range_min) * shift_low + \
-                        range_min
-                else:
-                    frame_new = range_max - (range_max - frame_ori) * \
-                        shift_high
-                frame_new = max(range_min + j, min(frame_new, range_max - \
-                    (len(curve.keyframe_points)-j)+1))
-                d_frame = frame_new - frame_ori
-                if frame_new not in new_mapping:
-                    new_mapping[frame_new] = value_ori
-                kf.co[0] = frame_new
-                kf.handle_left[0] = handles_ori[objectname][frame_ori]\
-                    ["left"][i][0] + d_frame
-                kf.handle_right[0] = handles_ori[objectname][frame_ori]\
-                    ["right"][i][0] + d_frame
-        del keyframes_ori[objectname]
-        keyframes_ori[objectname] = {}
-        for new_frame, value in new_mapping.items():
-            keyframes_ori[objectname][new_frame] = value
-    
-    # change position of active keyframe on the timeline
-    elif context.window_manager.motion_trail.mode == 'timing' and \
-    active_keyframe:
-        objectname, frame, frame_ori, action_ob, child = active_keyframe
-        if child:
-            mat = action_ob.matrix_world.copy().inverted() * \
-                edit_bones[child.name].copy().to_4x4()
-        else:
-            mat = action_ob.matrix_world.copy().inverted()
-        
-        mouse_ori_world = screen_to_world(context, drag_mouse_ori[0],
-            drag_mouse_ori[1]) * mat
-        vector = screen_to_world(context, event.mouse_region_x,
-            event.mouse_region_y) * mat
-        d = vector - mouse_ori_world
-        
-        locs_ori = [[f_ori, coords] for f_mapped, [f_ori, coords] in \
-            keyframes_ori[objectname].items()]
-        locs_ori.sort()
-        direction = 1
-        range = False
-        for i, [f_ori, coords] in enumerate(locs_ori):
-            if abs(frame_ori - f_ori) < 1e-4:
-                if i == 0:
-                    # first keyframe, nothing before it
-                    direction = -1
-                    range = [f_ori, locs_ori[i+1][0]]
-                elif i == len(locs_ori) - 1:
-                    # last keyframe, nothing after it
-                    range = [locs_ori[i-1][0], f_ori]
-                else:
-                    current = mathutils.Vector(coords)
-                    next = mathutils.Vector(locs_ori[i+1][1])
-                    previous = mathutils.Vector(locs_ori[i-1][1])
-                    angle_to_next = d.angle(next - current, 0)
-                    angle_to_previous = d.angle(previous-current, 0)
-                    if angle_to_previous < angle_to_next:
-                        # mouse movement is in direction of previous keyframe
-                        direction = -1
-                    range = [locs_ori[i-1][0], locs_ori[i+1][0]]
-                break
-        direction *= -1 # feels more natural in 3d-view
-        if not range:
-            # keyframe not found, is impossible, but better safe than sorry
-            return(active_keyframe, active_timebead, keyframes_ori)
-        # calculate strength of movement
-        d_screen = mathutils.Vector([event.mouse_region_x,
-            event.mouse_region_y]) - drag_mouse_ori
-        if d_screen.length != 0:
-            d_screen = d_screen.length / (abs(d_screen[0])/d_screen.length*\
-                context.region.width + abs(d_screen[1])/d_screen.length*\
-                context.region.height)
-            d_screen *= direction  # d_screen value ranges from -1.0 to 1.0
-        else:
-            d_screen = 0.0
-        new_frame = d_screen * (range[1] - range[0]) + frame_ori
-        max_frame = range[1]
-        if max_frame == frame_ori:
-            max_frame += 1
-        min_frame = range[0]
-        if min_frame == frame_ori:
-            min_frame -= 1
-        new_frame = min(max_frame - 1, max(min_frame + 1, new_frame))
-        d_frame = new_frame - frame_ori
-        curves = get_curves(action_ob, child)
-        
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if abs(kf.co[0] - frame) < 1e-4:
-                    kf.co[0] = new_frame
-                    kf.handle_left[0] = handles_ori[objectname][frame_ori]\
-                        ["left"][i][0] + d_frame
-                    kf.handle_right[0] = handles_ori[objectname][frame_ori]\
-                        ["right"][i][0] + d_frame
-                    break
-        active_keyframe = [objectname, new_frame, frame_ori, action_ob, child]
-    
-    # change position of active timebead on the timeline, thus altering speed
-    elif context.window_manager.motion_trail.mode == 'speed' and \
-    active_timebead:
-        objectname, frame, frame_ori, action_ob, child = active_timebead
-        if child:
-            mat = action_ob.matrix_world.copy().inverted() * \
-                edit_bones[child.name].copy().to_4x4()
-        else:
-            mat = 1
-        
-        mouse_ori_world = screen_to_world(context, drag_mouse_ori[0],
-            drag_mouse_ori[1]) * mat
-        vector = screen_to_world(context, event.mouse_region_x,
-            event.mouse_region_y) * mat
-        d = vector - mouse_ori_world
-        
-        # determine direction (to next or previous keyframe)
-        curves = get_curves(action_ob, child)
-        fcx, fcy, fcz = curves
-        locx = fcx.evaluate(frame_ori)
-        locy = fcy.evaluate(frame_ori)
-        locz = fcz.evaluate(frame_ori)
-        loc_ori = mathutils.Vector([locx, locy, locz]) # bonespace
-        keyframes = [kf for kf in keyframes_ori[objectname]]
-        keyframes.append(frame_ori)
-        keyframes.sort()
-        frame_index = keyframes.index(frame_ori)
-        kf_prev = keyframes[frame_index - 1]
-        kf_next = keyframes[frame_index + 1]
-        vec_prev = (mathutils.Vector(keyframes_ori[objectname][kf_prev][1]) \
-            * mat - loc_ori).normalized()
-        vec_next = (mathutils.Vector(keyframes_ori[objectname][kf_next][1]) \
-            * mat - loc_ori).normalized()
-        d_normal = d.copy().normalized()
-        dist_to_next = (d_normal - vec_next).length
-        dist_to_prev = (d_normal - vec_prev).length
-        if dist_to_prev < dist_to_next:
-            direction = 1
-        else:
-            direction = -1
-        
-        if (kf_next - frame_ori) < (frame_ori - kf_prev):
-            kf_bead = kf_next
-            side = "left"
-        else:
-            kf_bead = kf_prev
-            side = "right"
-        d_frame = d.length * direction * 2 # *2 to make it more sensitive
-        
-        angles = []
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if abs(kf.co[0] - kf_bead) < 1e-4:
-                    if side == "left":
-                        # left side
-                        kf.handle_left[0] = min(handles_ori[objectname]\
-                            [kf_bead]["left"][i][0] + d_frame, kf_bead - 1)
-                        angle = mathutils.Vector([-1, 0]).angle(mathutils.\
-                            Vector(kf.handle_left) - mathutils.Vector(kf.co),
-                            0)
-                        if angle != 0:
-                            angles.append(angle)
-                    else:
-                        # right side
-                        kf.handle_right[0] = max(handles_ori[objectname]\
-                            [kf_bead]["right"][i][0] + d_frame, kf_bead + 1)
-                        angle = mathutils.Vector([1, 0]).angle(mathutils.\
-                            Vector(kf.handle_right) - mathutils.Vector(kf.co),
-                            0)
-                        if angle != 0:
-                            angles.append(angle)
-                    break
-        
-        # update frame of active_timebead
-        perc = (sum(angles) / len(angles)) / (math.pi / 2)
-        perc = max(0.4, min(1, perc * 5))
-        if side == "left":
-            bead_frame = kf_bead - perc * ((kf_bead - kf_prev - 2) / 2)
-        else:
-            bead_frame = kf_bead + perc * ((kf_next - kf_bead - 2) / 2)
-        active_timebead = [objectname, bead_frame, frame_ori, action_ob, child]
-    
-    return(active_keyframe, active_timebead, keyframes_ori)
-
-
-# revert changes made by dragging
-def cancel_drag(context, active_keyframe, active_handle, active_timebead,
-keyframes_ori, handles_ori, edit_bones):
-    # revert change in 3d-location of active keyframe and its handles
-    if context.window_manager.motion_trail.mode == 'location' and \
-    active_keyframe:
-        objectname, frame, frame_ori, active_ob, child = active_keyframe
-        curves = get_curves(active_ob, child)
-        loc_ori = keyframes_ori[objectname][frame][1]
-        if child:
-            loc_ori = loc_ori * edit_bones[child.name] * \
-                active_ob.matrix_world.copy().inverted()
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if kf.co[0] == frame:
-                    kf.co[1] = loc_ori[i]
-                    kf.handle_left[1] = handles_ori[objectname][frame]\
-                        ["left"][i][1]
-                    kf.handle_right[1] = handles_ori[objectname][frame]\
-                        ["right"][i][1]
-                    break
-    
-    # revert change in 3d-location of active handle
-    elif context.window_manager.motion_trail.mode == 'location' and \
-    active_handle:
-        objectname, frame, side, active_ob, child = active_handle
-        curves = get_curves(active_ob, child)
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if kf.co[0] == frame:
-                    kf.handle_left[1] = handles_ori[objectname][frame]\
-                        ["left"][i][1]
-                    kf.handle_right[1] = handles_ori[objectname][frame]\
-                        ["right"][i][1]
-                    break
-    
-    # revert position of all keyframes and handles on timeline
-    elif context.window_manager.motion_trail.mode == 'timing' and \
-    active_timebead:
-        objectname, frame, frame_ori, active_ob, child = active_timebead
-        curves = get_curves(active_ob, child)
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                for kf_ori, [frame_ori, loc] in keyframes_ori[objectname].\
-                items():
-                    if abs(kf.co[0] - kf_ori) < 1e-4:
-                        kf.co[0] = frame_ori
-                        kf.handle_left[0] = handles_ori[objectname]\
-                            [frame_ori]["left"][i][0]
-                        kf.handle_right[0] = handles_ori[objectname]\
-                            [frame_ori]["right"][i][0]
-                        break
-    
-    # revert position of active keyframe and its handles on the timeline
-    elif context.window_manager.motion_trail.mode == 'timing' and \
-    active_keyframe:
-        objectname, frame, frame_ori, active_ob, child = active_keyframe
-        curves = get_curves(active_ob, child)
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if abs(kf.co[0] - frame) < 1e-4:
-                    kf.co[0] = keyframes_ori[objectname][frame_ori][0]
-                    kf.handle_left[0] = handles_ori[objectname][frame_ori]\
-                        ["left"][i][0]
-                    kf.handle_right[0] = handles_ori[objectname][frame_ori]\
-                        ["right"][i][0]
-                    break
-        active_keyframe = [objectname, frame_ori, frame_ori, active_ob, child]
-    
-    # revert position of handles on the timeline
-    elif context.window_manager.motion_trail.mode == 'speed' and \
-    active_timebead:
-        objectname, frame, frame_ori, active_ob, child = active_timebead
-        curves = get_curves(active_ob, child)
-        keyframes = [kf for kf in keyframes_ori[objectname]]
-        keyframes.append(frame_ori)
-        keyframes.sort()
-        frame_index = keyframes.index(frame_ori)
-        kf_prev = keyframes[frame_index - 1]
-        kf_next = keyframes[frame_index + 1]
-        if (kf_next - frame_ori) < (frame_ori - kf_prev):
-            kf_frame = kf_next
-        else:
-            kf_frame = kf_prev
-        for i, curve in enumerate(curves):
-            for kf in curve.keyframe_points:
-                if kf.co[0] == kf_frame:
-                    kf.handle_left[0] = handles_ori[objectname][kf_frame]\
-                        ["left"][i][0]
-                    kf.handle_right[0] = handles_ori[objectname][kf_frame]\
-                        ["right"][i][0]
-                    break
-        active_timebead = [objectname, frame_ori, frame_ori, active_ob, child]
-    
-    return(active_keyframe, active_timebead)
-
-
-# return the handle type of the active selection
-def get_handle_type(active_keyframe, active_handle):
-    if active_keyframe:
-        objectname, frame, side, action_ob, child = active_keyframe
-        side = "both"
-    elif active_handle:
-        objectname, frame, side, action_ob, child = active_handle
-    else:
-        # no active handle(s)
-        return(False)
-    
-    # properties used when changing handle type
-    bpy.context.window_manager.motion_trail.handle_type_frame = frame
-    bpy.context.window_manager.motion_trail.handle_type_side = side
-    bpy.context.window_manager.motion_trail.handle_type_action_ob = \
-        action_ob.name
-    if child:
-        bpy.context.window_manager.motion_trail.handle_type_child = child.name
-    else:
-        bpy.context.window_manager.motion_trail.handle_type_child = ""
-    
-    curves = get_curves(action_ob, child=child)
-    for c in curves:
-        for kf in c.keyframe_points:
-            if kf.co[0] == frame:
-                if side in ["left", "both"]:
-                    return(kf.handle_left_type)
-                else:
-                    return(kf.handle_right_type)
-    
-    return("AUTO")
-
-
-# turn the given frame into a keyframe
-def insert_keyframe(self, context, frame):
-    objectname, frame, frame, action_ob, child = frame
-    curves = get_curves(action_ob, child)
-    for c in curves:
-        y = c.evaluate(frame)
-        if c.keyframe_points:
-            c.keyframe_points.insert(frame, y)
-    
-    bpy.context.window_manager.motion_trail.force_update = True
-    calc_callback(self, context)
-
-
-# change the handle type of the active selection
-def set_handle_type(self, context):
-    if not context.window_manager.motion_trail.handle_type_enabled:
-        return
-    if context.window_manager.motion_trail.handle_type_old == \
-    context.window_manager.motion_trail.handle_type:
-        # function called because of selection change, not change in type
-        return
-    context.window_manager.motion_trail.handle_type_old = \
-        context.window_manager.motion_trail.handle_type
-    
-    frame = bpy.context.window_manager.motion_trail.handle_type_frame
-    side = bpy.context.window_manager.motion_trail.handle_type_side
-    action_ob = bpy.context.window_manager.motion_trail.handle_type_action_ob
-    action_ob = bpy.data.objects[action_ob]
-    child = bpy.context.window_manager.motion_trail.handle_type_child
-    if child:
-        child = action_ob.pose.bones[child]
-    new_type = context.window_manager.motion_trail.handle_type
-    
-    curves = get_curves(action_ob, child=child)
-    for c in curves:
-        for kf in c.keyframe_points:
-            if kf.co[0] == frame:
-                # align if necessary
-                if side in ["right", "both"] and new_type in \
-                ["AUTO", "AUTO_CLAMPED", "ALIGNED"]:
-                    # change right handle
-                    normal = (kf.co - kf.handle_left).normalized()
-                    size = (kf.handle_right[0] - kf.co[0]) / normal[0]
-                    normal = normal*size + kf.co
-                    kf.handle_right[1] = normal[1]
-                elif side == "left" and new_type in ["AUTO", "AUTO_CLAMPED",
-                "ALIGNED"]:
-                    # change left handle
-                    normal = (kf.co - kf.handle_right).normalized()
-                    size = (kf.handle_left[0] - kf.co[0]) / normal[0]
-                    normal = normal*size + kf.co
-                    kf.handle_left[1] = normal[1]
-                # change type
-                if side in ["left", "both"]:
-                    kf.handle_left_type = new_type
-                if side in ["right", "both"]:
-                    kf.handle_right_type = new_type
-    
-    context.window_manager.motion_trail.force_update = True
-
-
-class MotionTrailOperator(bpy.types.Operator):
-    """Edit motion trails in 3d-view"""
-    bl_idname = "view3d.motion_trail"
-    bl_label = "Motion Trail"
-    
-    _handle1 = None
-    _handle2 = None
-    
-    def modal(self, context, event):
-        if context.window_manager.motion_trail.enabled == -1:
-            context.window_manager.motion_trail.enabled = 0
-            try:
-                context.region.callback_remove(self._handle1)
-            except:
-                pass
-            try:
-                context.region.callback_remove(self._handle2)
-            except:
-                pass
-            context.area.tag_redraw()
-            return {'FINISHED'}
-        
-        if not context.area:
-            return {'PASS_THROUGH'}
-        if not context.region or event.type == 'NONE':
-            context.area.tag_redraw()
-            return {'PASS_THROUGH'}
-        
-        select = context.user_preferences.inputs.select_mouse
-        if not context.active_object or not context.active_object.mode in \
-        ['OBJECT', 'POSE']:
-            if self.drag:
-                self.drag = False
-                self.lock = True
-                context.window_manager.motion_trail.force_update = True
-            # default hotkeys should still work
-            if event.type == self.transform_key and event.value == 'PRESS':
-                if bpy.ops.transform.translate.poll():
-                    bpy.ops.transform.translate('INVOKE_DEFAULT')
-            elif event.type == select + 'MOUSE' and event.value == 'PRESS' \
-            and not self.drag and not event.shift and not event.alt \
-            and not event.ctrl:
-                if bpy.ops.view3d.select.poll():
-                    bpy.ops.view3d.select('INVOKE_DEFAULT')
-            elif event.type == 'LEFTMOUSE' and event.value == 'PRESS' and not\
-            event.alt and not event.ctrl and not event.shift:
-                if eval("bpy.ops."+self.left_action+".poll()"):
-                    eval("bpy.ops."+self.left_action+"('INVOKE_DEFAULT')")
-            return {'PASS_THROUGH'}
-        # check if event was generated within 3d-window, dragging is exception
-        if not self.drag:
-            if not (0 < event.mouse_region_x < context.region.width) or \
-            not (0 < event.mouse_region_y < context.region.height):
-                return {'PASS_THROUGH'}
-        
-        if event.type == self.transform_key and event.value == 'PRESS' and \
-        (self.active_keyframe or self.active_handle or self.active_timebead \
-        or self.active_frame):
-            # override default translate()
-            if not self.drag:
-                # start drag
-                if self.active_frame:
-                    insert_keyframe(self, context, self.active_frame)
-                    self.active_keyframe = self.active_frame
-                    self.active_frame = False
-                self.keyframes_ori, self.handles_ori = \
-                    get_original_animation_data(context, self.keyframes)
-                self.drag_mouse_ori = mathutils.Vector([event.mouse_region_x,
-                    event.mouse_region_y])
-                self.drag = True
-                self.lock = False
-            else:
-                # stop drag
-                self.drag = False
-                self.lock = True
-                context.window_manager.motion_trail.force_update = True
-        elif event.type == self.transform_key and event.value == 'PRESS':
-            # call default translate()
-            if bpy.ops.transform.translate.poll():
-                bpy.ops.transform.translate('INVOKE_DEFAULT')
-        elif (event.type == 'ESC' and self.drag and event.value == 'PRESS') \
-        or (event.type == 'RIGHTMOUSE' and self.drag and event.value == \
-        'PRESS'):
-            # cancel drag
-            self.drag = False
-            self.lock = True
-            context.window_manager.motion_trail.force_update = True
-            self.active_keyframe, self.active_timebead = cancel_drag(context,
-                self.active_keyframe, self.active_handle,
-                self.active_timebead, self.keyframes_ori, self.handles_ori,
-                self.edit_bones)
-        elif event.type == 'MOUSEMOVE' and self.drag:
-            # drag
-            self.active_keyframe, self.active_timebead, self.keyframes_ori = \
-                drag(context, event, self.drag_mouse_ori,
-                self.active_keyframe, self.active_handle,
-                self.active_timebead, self.keyframes_ori, self.handles_ori,
-                self.edit_bones)
-        elif event.type == select + 'MOUSE' and event.value == 'PRESS' and \
-        not self.drag and not event.shift and not event.alt and not \
-        event.ctrl:
-            # select
-            treshold = 10
-            clicked = mathutils.Vector([event.mouse_region_x,
-                event.mouse_region_y])
-            self.active_keyframe = False
-            self.active_handle = False
-            self.active_timebead = False
-            self.active_frame = False
-            context.window_manager.motion_trail.force_update = True
-            context.window_manager.motion_trail.handle_type_enabled = True
-            found = False
-            
-            if context.window_manager.motion_trail.path_before == 0:
-                frame_min = context.scene.frame_start
-            else:
-                frame_min = max(context.scene.frame_start,
-                    context.scene.frame_current - \
-                    context.window_manager.motion_trail.path_before)
-            if context.window_manager.motion_trail.path_after == 0:
-                frame_max = context.scene.frame_end
-            else:
-                frame_max = min(context.scene.frame_end,
-                    context.scene.frame_current + \
-                    context.window_manager.motion_trail.path_after)
-            
-            for objectname, values in self.click.items():
-                if found:
-                    break
-                for frame, type, coord, action_ob, child in values:
-                    if frame < frame_min or frame > frame_max:
-                        continue
-                    if (coord - clicked).length <= treshold:
-                        found = True
-                        if type == "keyframe":
-                            self.active_keyframe = [objectname, frame, frame,
-                                action_ob, child]
-                        elif type == "handle_left":
-                            self.active_handle = [objectname, frame, "left",
-                                action_ob, child]
-                        elif type == "handle_right":
-                            self.active_handle = [objectname, frame, "right",
-                                action_ob, child]
-                        elif type == "timebead":
-                            self.active_timebead = [objectname, frame, frame,
-                                action_ob, child]
-                        elif type == "frame":
-                            self.active_frame = [objectname, frame, frame,
-                                action_ob, child]
-                        break
-            if not found:
-                context.window_manager.motion_trail.handle_type_enabled = False
-                # no motion trail selections, so pass on to normal select()
-                if bpy.ops.view3d.select.poll():
-                    bpy.ops.view3d.select('INVOKE_DEFAULT')
-            else:
-                handle_type = get_handle_type(self.active_keyframe,
-                    self.active_handle)
-                if handle_type:
-                    context.window_manager.motion_trail.handle_type_old = \
-                        handle_type
-                    context.window_manager.motion_trail.handle_type = \
-                        handle_type
-                else:
-                    context.window_manager.motion_trail.handle_type_enabled = \
-                        False
-        elif event.type == 'LEFTMOUSE' and event.value == 'PRESS' and \
-        self.drag:
-            # stop drag
-            self.drag = False
-            self.lock = True
-            context.window_manager.motion_trail.force_update = True
-        elif event.type == 'LEFTMOUSE' and event.value == 'PRESS' and not\
-        event.alt and not event.ctrl and not event.shift:
-            if eval("bpy.ops."+self.left_action+".poll()"):
-                eval("bpy.ops."+self.left_action+"('INVOKE_DEFAULT')")
-        
-        if context.area: # not available if other window-type is fullscreen
-            context.area.tag_redraw()
-        
-        return {'PASS_THROUGH'}
-
-    def invoke(self, context, event):
-        if context.area.type == 'VIEW_3D':
-            # get clashing keymap items
-            select = context.user_preferences.inputs.select_mouse
-            kms = [bpy.context.window_manager.keyconfigs.active.\
-                keymaps['3D View'], bpy.context.window_manager.keyconfigs.\
-                active.keymaps['Object Mode']]
-            kmis = []
-            self.left_action = None
-            self.right_action = None
-            for km in kms:
-                for kmi in km.keymap_items:
-                    if kmi.idname == "transform.translate" and \
-                    kmi.map_type == 'KEYBOARD' and not \
-                    kmi.properties.texture_space:
-                        kmis.append(kmi)
-                        self.transform_key = kmi.type
-                    elif (kmi.type == 'ACTIONMOUSE' and select == 'RIGHT') \
-                    and not kmi.alt and not kmi.any and not kmi.ctrl \
-                    and not kmi.shift:
-                        kmis.append(kmi)
-                        self.left_action = kmi.idname
-                    elif kmi.type == 'SELECTMOUSE' and not kmi.alt and not \
-                    kmi.any and not kmi.ctrl and not kmi.shift:
-                        kmis.append(kmi)
-                        if select == 'RIGHT':
-                            self.right_action = kmi.idname
-                        else:
-                            self.left_action = kmi.idname
-                    elif kmi.type == 'LEFTMOUSE' and not kmi.alt and not \
-                    kmi.any and not kmi.ctrl and not kmi.shift:
-                        kmis.append(kmi)
-                        self.left_action = kmi.idname
-            
-            if context.window_manager.motion_trail.enabled == 0:
-                # enable
-                context.window_manager.motion_trail.enabled = 1
-                self.active_keyframe = False
-                self.active_handle = False
-                self.active_timebead = False
-                self.active_frame = False
-                self.click = {}
-                self.drag = False
-                self.lock = True
-                self.perspective = context.region_data.perspective_matrix
-                self.displayed = []
-                context.window_manager.motion_trail.force_update = True
-                context.window_manager.motion_trail.handle_type_enabled = False
-                self.cached = {"path":{}, "keyframes":{},
-                    "timebeads_timing":{}, "timebeads_speed":{}}
-                
-                for kmi in kmis:
-                    kmi.active = False
-
-                self._handle1 = context.region.callback_add(calc_callback,
-                    (self, context), 'POST_VIEW')
-                self._handle2 = context.region.callback_add(draw_callback,
-                    (self, context), 'POST_PIXEL')
-                if context.area:
-                    context.area.tag_redraw()
-
-                context.window_manager.modal_handler_add(self)
-            else:
-                # disable
-                context.window_manager.motion_trail.enabled = -1
-                for kmi in kmis:
-                    kmi.active = True
-            
-            return {'RUNNING_MODAL'}
-        
-        else:
-            self.report({'WARNING'}, "View3D not found, cannot run operator")
-            return {'CANCELLED'}
-
-
-class MotionTrailPanel(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Motion Trail"
-    bl_options = {'DEFAULT_CLOSED'}
-    @classmethod
-    def poll(cls, context):
-        if not context.active_object:
-            return(False)
-        return(context.active_object.mode in ['OBJECT', 'POSE'])
-    
-    def draw(self, context):
-        col = self.layout.column()
-        if context.window_manager.motion_trail.enabled != 1:
-            col.operator("view3d.motion_trail", text="Enable motion trail")
-        else:
-            col.operator("view3d.motion_trail", text="Disable motion trail")
-        
-        box = self.layout.box()
-        box.prop(context.window_manager.motion_trail, "mode")
-        #box.prop(context.window_manager.motion_trail, "calculate")
-        if context.window_manager.motion_trail.mode in ['timing']:
-            box.prop(context.window_manager.motion_trail, "timebeads")
-        
-        box = self.layout.box()
-        col = box.column()
-        row = col.row()
-        if context.window_manager.motion_trail.path_display:
-            row.prop(context.window_manager.motion_trail, "path_display",
-                icon="DOWNARROW_HLT", text="", emboss=False)
-        else:
-            row.prop(context.window_manager.motion_trail, "path_display",
-                icon="RIGHTARROW", text="", emboss=False)
-        row.label("Path options")
-        if context.window_manager.motion_trail.path_display:
-            col.prop(context.window_manager.motion_trail, "path_style",
-                text="Style")
-            grouped = col.column(align=True)
-            grouped.prop(context.window_manager.motion_trail, "path_width",
-                text="Width")
-            grouped.prop(context.window_manager.motion_trail,
-                "path_transparency", text="Transparency")
-            grouped.prop(context.window_manager.motion_trail,
-                "path_resolution")
-            row = grouped.row(align=True)
-            row.prop(context.window_manager.motion_trail, "path_before")
-            row.prop(context.window_manager.motion_trail, "path_after")
-            col = col.column(align=True)
-            col.prop(context.window_manager.motion_trail, "keyframe_numbers")
-            col.prop(context.window_manager.motion_trail, "frame_display")
-        
-        if context.window_manager.motion_trail.mode in ['location']:
-            box = self.layout.box()
-            col = box.column(align=True)
-            col.prop(context.window_manager.motion_trail, "handle_display",
-                text="Handles")
-            if context.window_manager.motion_trail.handle_display:
-                row = col.row()
-                row.enabled = context.window_manager.motion_trail.\
-                    handle_type_enabled
-                row.prop(context.window_manager.motion_trail, "handle_type")
-
-
-class MotionTrailProps(bpy.types.PropertyGroup):
-    def internal_update(self, context):
-        context.window_manager.motion_trail.force_update = True
-        if context.area:
-            context.area.tag_redraw()
-    
-    # internal use
-    enabled = bpy.props.IntProperty(default=0)
-    force_update = bpy.props.BoolProperty(name="internal use",
-        description="Force calc_callback to fully execute",
-        default=False)
-    handle_type_enabled = bpy.props.BoolProperty(default=False)
-    handle_type_frame = bpy.props.FloatProperty()
-    handle_type_side = bpy.props.StringProperty()
-    handle_type_action_ob = bpy.props.StringProperty()
-    handle_type_child = bpy.props.StringProperty()
-    handle_type_old = bpy.props.EnumProperty(items=(("AUTO", "", ""), 
-        ("AUTO_CLAMPED", "", ""), ("VECTOR", "", ""), ("ALIGNED", "", ""), 
-        ("FREE", "", "")), default='AUTO',)
-    
-    # visible in user interface
-    calculate = bpy.props.EnumProperty(name="Calculate",
-        items=(("fast", "Fast", "Recommended setting, change if the "\
-            "motion path is positioned incorrectly"),
-            ("full", "Full", "Takes parenting and modifiers into account, "\
-            "but can be very slow on complicated scenes")),
-        description="Calculation method for determining locations",
-        default='full',
-        update=internal_update)
-    frame_display = bpy.props.BoolProperty(name="Frames",
-        description="Display frames, \n test",
-        default=True,
-        update=internal_update)
-    handle_display = bpy.props.BoolProperty(name="Display",
-        description="Display handles",
-        default=True,
-        update=internal_update)
-    handle_type = bpy.props.EnumProperty(name="Type",
-        items=(("AUTO", "Automatic", ""),
-            ("AUTO_CLAMPED", "Auto Clamped", ""),
-            ("VECTOR", "Vector", ""),
-            ("ALIGNED", "Aligned", ""),
-            ("FREE", "Free", "")),
-        description="Set handle type for the selected handle",
-        default='AUTO',
-        update=set_handle_type)
-    keyframe_numbers = bpy.props.BoolProperty(name="Keyframe numbers",
-        description="Display keyframe numbers",
-        default=False,
-        update=internal_update)
-    mode = bpy.props.EnumProperty(name="Mode",
-        items=(("location", "Location", "Change path that is followed"),
-            ("speed", "Speed", "Change speed between keyframes"),
-            ("timing", "Timing", "Change position of keyframes on timeline")),
-        description="Enable editing of certain properties in the 3d-view",
-        default='location',
-        update=internal_update)
-    path_after = bpy.props.IntProperty(name="After",
-        description="Number of frames to show after the current frame, "\
-            "0 = display all",
-        default=50,
-        min=0,
-        update=internal_update)
-    path_before = bpy.props.IntProperty(name="Before",
-        description="Number of frames to show before the current frame, "\
-            "0 = display all",
-        default=50,
-        min=0,
-        update=internal_update)
-    path_display = bpy.props.BoolProperty(name="Path options",
-        description="Display path options",
-        default=True)
-    path_resolution = bpy.props.IntProperty(name="Resolution",
-        description="10 is smoothest, but could be "\
-        "slow when adjusting keyframes, handles or timebeads",
-        default=10,
-        min=1,
-        max=10,
-        update=internal_update)
-    path_style = bpy.props.EnumProperty(name="Path style",
-        items=(("acceleration", "Acceleration", "Gradient based on relative "\
-                "acceleration"),
-            ("simple", "Simple", "Black line"),
-            ("speed", "Speed", "Gradient based on relative speed")),
-        description="Information conveyed by path color",
-        default='simple',
-        update=internal_update)
-    path_transparency = bpy.props.IntProperty(name="Path transparency",
-        description="Determines visibility of path",
-        default=0,
-        min=0,
-        max=100,
-        subtype='PERCENTAGE',
-        update=internal_update)
-    path_width = bpy.props.IntProperty(name="Path width",
-        description="Width in pixels",
-        default=1,
-        min=1,
-        soft_max=5,
-        update=internal_update)
-    timebeads = bpy.props.IntProperty(name="Time beads",
-        description="Number of time beads to display per segment",
-        default=5,
-        min=1,
-        soft_max = 10,
-        update=internal_update)
-
-
-classes = [MotionTrailProps,
-    MotionTrailOperator,
-    MotionTrailPanel]
-
-
-def register():
-    for c in classes:
-        bpy.utils.register_class(c)
-    bpy.types.WindowManager.motion_trail = bpy.props.PointerProperty(\
-        type=MotionTrailProps)
-
-
-def unregister():
-    for c in classes:
-        bpy.utils.unregister_class(c)
-    del bpy.types.WindowManager.motion_trail
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/btrace/__init__.py b/release/scripts/addons_contrib/btrace/__init__.py
deleted file mode 100644
index 7aba88d..0000000
--- a/release/scripts/addons_contrib/btrace/__init__.py
+++ /dev/null
@@ -1,68 +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 LICENCE BLOCK
-
-bl_info = {
-    "name": "Btrace",
-    "author": "liero, crazycourier, Atom, Meta-Androcto, MacKracken",
-    "version": (1, 1, ),
-    "blender": (2, 62, 0),
-    "location": "View3D > Tools",
-    "description": "Tools for converting/animating objects/particles into curves",
-    "warning": "Still under development, bug reports appreciated",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Curve/Btrace",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=29563",
-    "category": "Add Curve"
-    }
-
-import bpy
-from .bTrace import *
-import selection_utils
-from bpy.props import FloatProperty, EnumProperty, IntProperty, BoolProperty, FloatVectorProperty
-
-### Define Classes to register
-classes = [
-    TracerProperties,
-    TracerPropertiesMenu,
-    addTracerObjectPanel,
-    OBJECT_OT_convertcurve,
-    OBJECT_OT_objecttrace,
-    OBJECT_OT_objectconnect,
-    OBJECT_OT_writing,
-    OBJECT_OT_particletrace,
-    OBJECT_OT_traceallparticles,
-    OBJECT_OT_curvegrow,
-    OBJECT_OT_reset,
-    OBJECT_OT_fcnoise,
-    OBJECT_OT_meshfollow,
-    OBJECT_OT_materialChango,
-    OBJECT_OT_clearColorblender
-    ]
-
-def register():
-    for c in classes:
-        bpy.utils.register_class(c)
-    bpy.types.WindowManager.curve_tracer = bpy.props.PointerProperty(type=TracerProperties)
-    bpy.types.WindowManager.btrace_menu = bpy.props.PointerProperty(type=TracerPropertiesMenu, update=deselect_others)
-
-def unregister():
-    for c in classes:
-        bpy.utils.unregister_class(c)
-    del bpy.types.WindowManager.curve_tracer
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/btrace/bTrace.py b/release/scripts/addons_contrib/btrace/bTrace.py
deleted file mode 100644
index 8fd7447..0000000
--- a/release/scripts/addons_contrib/btrace/bTrace.py
+++ /dev/null
@@ -1,1565 +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 LICENCE BLOCK
-
-bl_info = {
-    "name": "Btrace",
-    "author": "liero, crazycourier, Atom, Meta-Androcto, MacKracken",
-    "version": (1, 1, ),
-    "blender": (2, 62, 0),
-    "location": "View3D > Tools",
-    "description": "Tools for converting/animating objects/particles into curves",
-    "warning": "Still under development, bug reports appreciated",
-    "wiki_url": "",
-    "tracker_url": "http://projects.blender.org/tracker/?func=detail&atid=468&aid=29563&group_id=153",
-    "category": "Add Curve"
-    }
-
-#### TO DO LIST ####
-### [   ]  Add more options to curve radius/modulation plus cyclic/connect curve option
-
-import bpy
-import selection_utils
-from bpy.props import FloatProperty, EnumProperty, IntProperty, BoolProperty, FloatVectorProperty
-
-
-def deselect_others(ob, context):
-    """For tool menu select, deselects others if one selected"""
-    selected = addTracerObjectPanel.selected
-    ob[selected] = False
-    keys = [key for key in ob.keys() if ob[key]]  # all the True keys
-    if len(keys) <= 0:
-        ob[selected] = True  # reselect
-        return None
-    for key in keys:
-        addTracerObjectPanel.selected = key
-        ob[key] = True
-
-
-# Class for properties panel
-class TracerPropertiesMenu(bpy.types.PropertyGroup):
-    """Toolbar show/hide booleans for tool options"""
-    tool_objectTrace = BoolProperty(name="Object Trace", default=False, description="Trace selected mesh object with a curve", update=deselect_others)
-    tool_objectsConnect = BoolProperty(name="Objects Connect", default=False, description="Connect objects with a curve controlled by hooks", update=deselect_others)
-    tool_particleTrace = BoolProperty(name="Particle Trace", default=False, description="Trace particle path with a  curve", update=deselect_others)
-    tool_meshFollow = BoolProperty(name="Mesh Follow", default=False, description="Follow selection items on animated mesh object", update=deselect_others)
-    tool_particleConnect = BoolProperty(name="Particle Connect", default=False, description="Connect particles with a curves and animated over particle lifetime", update=deselect_others)
-    tool_growCurve = BoolProperty(name="Grow Curve", default=False, description="Animate curve bevel over time by keyframing points radius", update=deselect_others)
-    tool_handwrite = BoolProperty(name="Handwriting", default=False, description="Create and Animate curve using the grease pencil", update=deselect_others)
-    tool_fcurve = BoolProperty(name="F-Curve Noise", default=False, description="Add F-Curve noise to selected objects", update=deselect_others)
-    tool_colorblender = BoolProperty(name="Color Blender", default=False, description="Add F-Curve noise to selected objects", update=deselect_others)
-
-
-# Class to define properties
-class TracerProperties(bpy.types.PropertyGroup):
-    """Options for tools"""
-    curve_spline = EnumProperty(name="Spline", items=(("POLY", "Poly", "Use Poly spline type"),  ("NURBS", "Nurbs", "Use Nurbs spline type"), ("BEZIER", "Bezier", "Use Bezier spline type")), description="Choose which type of spline to use when curve is created", default="BEZIER")
-    curve_handle = EnumProperty(name="Handle", items=(("ALIGNED", "Aligned", "Use Aligned Handle Type"), ("AUTOMATIC", "Automatic", "Use Auto Handle Type"), ("FREE_ALIGN", "Free Align", "Use Free Handle Type"), ("VECTOR", "Vector", "Use Vector Handle Type")), description="Choose which type of handle to use when curve is created",  default="VECTOR")
-    curve_resolution = IntProperty(name="Bevel Resolution", min=1, max=32, default=4, description="Adjust the Bevel resolution")
-    curve_depth = FloatProperty(name="Bevel Depth", min=0.0, max=100.0, default=0.1, description="Adjust the Bevel depth")
-    curve_u = IntProperty(name="Resolution U", min=0, max=64, default=12, description="Adjust the Surface resolution")
-    curve_join = BoolProperty(name="Join Curves", default=False, description="Join all the curves after they have been created")
-    curve_smooth = BoolProperty(name="Smooth", default=True, description="Render curve smooth")
-    # Option to Duplicate Mesh
-    object_duplicate = BoolProperty(name="Apply to Copy", default=False, description="Apply curve to a copy of object")
-    # Distort Mesh options
-    distort_modscale = IntProperty(name="Modulation Scale", min=0, max=50, default=2, description="Add a scale to modulate the curve at random points, set to 0 to disable")
-    distort_noise = FloatProperty(name="Mesh Noise", min=0.0, max=50.0, default=0.00, description="Adjust noise added to mesh before adding curve")
-    # Particle Options
-    particle_step = IntProperty(name="Step Size", min=1, max=50, default=5, description="Sample one every this number of frames")
-    particle_auto = BoolProperty(name='Auto Frame Range', default=True, description='Calculate Frame Range from particles life')
-    particle_f_start = IntProperty(name='Start Frame', min=1, max=5000, default=1, description='Start frame')
-    particle_f_end = IntProperty(name='End Frame', min=1, max=5000, default=250, description='End frame')
-    # F-Curve Modifier Properties
-    fcnoise_rot = BoolProperty(name="Rotation", default=False, description="Affect Rotation")
-    fcnoise_loc = BoolProperty(name="Location", default=True, description="Affect Location")
-    fcnoise_scale = BoolProperty(name="Scale", default=False, description="Affect Scale")
-    fcnoise_amp = IntProperty(name="Amp", min=1, max=500, default=5, description="Adjust the amplitude")
-    fcnoise_timescale = FloatProperty(name="Time Scale", min=1, max=500, default=50, description="Adjust the time scale")
-    fcnoise_key = BoolProperty(name="Add Keyframe", default=True, description="Keyframe is needed for tool, this adds a LocRotScale keyframe")
-    show_curve_settings = BoolProperty(name="Curve Settings", default=False, description="Change the curve settings for the created curve")
-    material_settings = BoolProperty(name="Material Settings", default=False, description="Change the material settings for the created curve")
-    particle_settings = BoolProperty(name="Particle Settings", default=False, description="Show the settings for the created curve")
-    animation_settings = BoolProperty(name="Animation Settings", default=False, description="Show the settings for the Animations")
-    distort_curve = BoolProperty(name="Add Distortion", default=False, description="Set options to distort the final curve")
-    connect_noise = BoolProperty(name="F-Curve Noise", default=False, description="Adds F-Curve Noise Modifier to selected objects")
-    settings_objectTrace = BoolProperty(name="Object Trace Settings", default=False, description="Trace selected mesh object with a curve")
-    settings_objectsConnect = BoolProperty(name="Objects Connect Settings", default=False, description="Connect objects with a curve controlled by hooks")
-    settings_objectTrace = BoolProperty(name="Object Trace Settings", default=False, description="Trace selected mesh object with a curve")
-    respect_order = BoolProperty(name="Order", default=False, description="Remember order objects were selected")
-    settings_particleTrace = BoolProperty(name="Particle Trace Settings", default=False, description="Trace particle path with a  curve")
-    settings_particleConnect = BoolProperty(name="Particle Connect Settings", default=False, description="Connect particles with a curves and animated over particle lifetime")
-    settings_growCurve = BoolProperty(name="Grow Curve Settings", default=False, description="Animate curve bevel over time by keyframing points radius")
-    settings_fcurve = BoolProperty(name="F-Curve Settings", default=False, description="F-Curve Settings")
-    settings_toggle = BoolProperty(name="Settings", default=False, description="Toggle Settings")
-    # Animation Options
-    anim_auto = BoolProperty(name='Auto Frame Range', default=True, description='Automatically calculate Frame Range')
-    anim_f_start = IntProperty(name='Start', min=1, max=2500, default=1, description='Start frame / Hidden object')
-    anim_length = IntProperty(name='Duration', min=1, soft_max=1000, max=2500, default=100, description='Animation Length')
-    anim_f_fade = IntProperty(name='Fade After', min=0, soft_max=250, max=2500, default=10, description='Fade after this frames / Zero means no fade')
-    anim_delay = IntProperty(name='Grow', min=0, max=50, default=5, description='Frames it takes a point to grow')
-    anim_tails = BoolProperty(name='Tails on endpoints', default=True, description='Set radius to zero for open splines endpoints')
-    anim_keepr = BoolProperty(name='Keep Radius', default=True, description='Try to keep radius data from original curve')
-    animate = BoolProperty(name="Animate Result", default=False, description='Animate the final curve objects')
-    # Convert to Curve options
-    convert_conti = BoolProperty(name='Continuous', default=True, description='Create a continuous curve using verts from mesh')
-    convert_everyedge = BoolProperty(name='Every Edge', default=False, description='Create a curve from all verts in a mesh')
-    convert_edgetype = EnumProperty(name="Edge Type for Curves",
-        items=(("CONTI", "Continuous", "Create a continuous curve using verts from mesh"),  ("EDGEALL", "All Edges", "Create a curve from every edge in a mesh")),
-        description="Choose which type of spline to use when curve is created", default="CONTI")
-    convert_joinbefore = BoolProperty(name="Join objects before convert", default=False, description='Join all selected mesh to one object before converting to mesh')
-    # Mesh Follow Options
-    fol_edge_select = BoolProperty(name='Edge', default=False, description='Grow from edges')
-    fol_vert_select = BoolProperty(name='Vertex', default=False, description='Grow from verts')
-    fol_face_select = BoolProperty(name='Face', default=True, description='Grow from faces')
-    fol_mesh_type = EnumProperty(name='Mesh type', default='VERTS', description='Mesh feature to draw cruves from', items=(
-        ("VERTS", "Verts", "Draw from Verts"), ("EDGES", "Edges", "Draw from Edges"), ("FACES", "Faces", "Draw from Faces"), ("OBJECT", "Object", "Draw from Object origin")))
-    fol_start_frame = IntProperty(name="Start Frame", min=1, max=2500, default=1, description="Start frame for range to trace")
-    fol_end_frame = IntProperty(name="End Frame", min=1, max=2500, default=250, description="End frame for range to trace")
-    fol_perc_verts = FloatProperty(name="Reduce selection by", min=0.001, max=1.000, default=0.5, description="percentage of total verts to trace")
-    fol_sel_option = EnumProperty(name="Selection type", description="Choose which objects to follow", default="RANDOM", items=(
-        ("RANDOM", "Random", "Follow Random items"),  ("CUSTOM", "Custom Select", "Follow selected items"), ("ALL", "All", "Follow all items")))
-    trace_mat_color = FloatVectorProperty(name="Material Color", description="Choose material color", min=0, max=1, default=(0.0,0.3,0.6), subtype="COLOR")
-    trace_mat_random = BoolProperty(name="Random Color", default=False, description='Make the material colors random')
-
-    # Material custom Properties properties
-    mat_simple_adv_toggle = EnumProperty(name="Material Options", items=(("SIMPLE", "Simple", "Show Simple Material Options"), ("ADVANCED", "Advanced", "Show Advanced Material Options")), description="Choose which Material Options to show", default="SIMPLE")
-    mat_run_color_blender = BoolProperty(name="Run Color Blender", default=False, description="Generate colors from a color scheme")
-    mmColors = bpy.props.EnumProperty(
-        items=(("RANDOM", "Random", "Use random colors"),
-                ("CUSTOM", "Custom", "Use custom colors"),
-                ("BW", "Black/White", "Use Black and White"),
-                ("BRIGHT", "Bright Colors", "Use Bright colors"),
-                ("EARTH", "Earth", "Use Earth colors"),
-                ("GREENBLUE", "Green to Blue", "Use Green to Blue colors")),
-        description="Choose which type of colors the materials uses",
-        default="BRIGHT",
-        name="Define a color palette")
-    # Custom property for how many keyframes to skip
-    mmSkip = bpy.props.IntProperty(name="frames", min=1, max=500, default=20, description="Number of frames between each keyframes")
-    # Custom property to enable/disable random order for the 
-    mmBoolRandom = bpy.props.BoolProperty(name="Random Order", default=False, description="Randomize the order of the colors")
-    # Custom Color properties
-    mmColor1 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.8, 0.8, 0.8), description="Custom Color 1", subtype="COLOR")
-    mmColor2 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.8, 0.8, 0.3), description="Custom Color 2", subtype="COLOR")
-    mmColor3 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.8, 0.5, 0.6), description="Custom Color 3", subtype="COLOR")
-    mmColor4 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.2, 0.8, 0.289), description="Custom Color 4", subtype="COLOR")
-    mmColor5 = bpy.props.FloatVectorProperty(min=0, max=1, default=(1.0, 0.348, 0.8), description="Custom Color 5", subtype="COLOR")
-    mmColor6 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.4, 0.67, 0.8), description="Custom Color 6", subtype="COLOR")
-    mmColor7 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.66, 0.88, 0.8), description="Custom Color 7", subtype="COLOR")
-    mmColor8 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.8, 0.38, 0.22), description="Custom Color 8", subtype="COLOR")
-    # BW Color properties
-    bwColor1 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.0,0.0,0.0), description="Black/White Color 1", subtype="COLOR")
-    bwColor2 = bpy.props.FloatVectorProperty(min=0, max=1, default=(1.0,1.0,1.0), description="Black/White Color 2", subtype="COLOR")
-    # Bright Color properties
-    brightColor1 = bpy.props.FloatVectorProperty(min=0, max=1, default=(1.0, 0.0, 0.75), description="Bright Color 1", subtype="COLOR")
-    brightColor2 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.0,1.0,1.0), description="Bright Color 2", subtype="COLOR")
-    brightColor3 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.0,1.0,0.0), description="Bright Color 3", subtype="COLOR")
-    brightColor4 = bpy.props.FloatVectorProperty(min=0, max=1, default=(1.0,1.0,0.0), description="Bright Color 4", subtype="COLOR")
-    # Earth Color Properties
-    earthColor1 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.068, 0.019, 0.014), description="Earth Color 1", subtype="COLOR")
-    earthColor2 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.089, 0.060, 0.047), description="Earth Color 2", subtype="COLOR")
-    earthColor3 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.188, 0.168, 0.066), description="Earth Color 3", subtype="COLOR")
-    earthColor4 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.445, 0.296, 0.065), description="Earth Color 4", subtype="COLOR")
-    earthColor5 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.745, 0.332, 0.065), description="Earth Color 5", subtype="COLOR")
-    # Green to Blue Color properties
-    greenblueColor1 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.296, 0.445, 0.074), description="Green/Blue Color 1", subtype="COLOR")
-    greenblueColor2 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.651, 1.0, 0.223), description="Green/Blue Color 2", subtype="COLOR")
-    greenblueColor3 = bpy.props.FloatVectorProperty(min=0, max=1, default=(0.037, 0.047, 0.084), description="Green/Blue Color 3", subtype="COLOR")
-
-
-############################
-## Draw Brush panel in Toolbar
-############################
-class addTracerObjectPanel(bpy.types.Panel):
-    bl_label = "Btrace: Panel"
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_context = 'objectmode'
-    selected = "tool_objectTrace"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        layout = self.layout
-        Btrace = bpy.context.window_manager.curve_tracer
-        btracemenu = props = bpy.context.window_manager.btrace_menu
-        obj = bpy.context.object
-
-
-        ############################
-        ## Color Blender Panel options
-        ############################
-        def color_blender():
-            """Buttons for Color Blender"""
-            row = box.row()
-            row.label("Color palette")
-            row.prop(Btrace, 'mmColors', text="")
-            # Show Custom Colors if selected
-            if Btrace.mmColors == 'CUSTOM':
-                row = box.row(align=True)
-                row.prop(Btrace, 'mmColor1', text="")
-                row.prop(Btrace, 'mmColor2', text="")
-                row.prop(Btrace, 'mmColor3', text="")
-                row.prop(Btrace, 'mmColor4', text="")
-                row.prop(Btrace, 'mmColor5', text="")
-                row.prop(Btrace, 'mmColor6', text="")
-                row.prop(Btrace, 'mmColor7', text="")
-                row.prop(Btrace, 'mmColor8', text="")
-            # Show Earth Colors
-            elif Btrace.mmColors == 'BW':
-                row = box.row(align=True)
-                row.prop(Btrace, 'bwColor1', text="")
-                row.prop(Btrace, 'bwColor2', text="")
-            # Show Earth Colors
-            elif Btrace.mmColors == 'BRIGHT':
-                row = box.row(align=True)
-                row.prop(Btrace, 'brightColor1', text="")
-                row.prop(Btrace, 'brightColor2', text="")
-                row.prop(Btrace, 'brightColor3', text="")
-                row.prop(Btrace, 'brightColor4', text="")
-            # Show Earth Colors
-            elif Btrace.mmColors == 'EARTH':
-                row = box.row(align=True)
-                row.prop(Btrace, 'earthColor1', text="")
-                row.prop(Btrace, 'earthColor2', text="")
-                row.prop(Btrace, 'earthColor3', text="")
-                row.prop(Btrace, 'earthColor4', text="")
-                row.prop(Btrace, 'earthColor5', text="")
-            # Show Earth Colors
-            elif Btrace.mmColors == 'GREENBLUE':
-                row = box.row(align=True)
-                row.prop(Btrace, 'greenblueColor1', text="")
-                row.prop(Btrace, 'greenblueColor2', text="")
-                row.prop(Btrace, 'greenblueColor3', text="")
-            elif Btrace.mmColors == 'RANDOM':
-                row = box.row()
-
-        ############################
-        ## Curve Panel options
-        ############################
-        def curve_settings():
-            """Button for curve options"""
-            row = self.layout.row()
-            row = box.row(align=True)
-
-            row.prop(Btrace, 'show_curve_settings', icon='CURVE_BEZCURVE', text="Curve Settings")
-            row.prop(Btrace, 'material_settings', icon='MATERIAL_DATA', text="Material Settings")
-            if Btrace.material_settings:
-                row = box.row()
-                row.label(text="Material Settings", icon='COLOR')
-                row = box.row()
-                row.prop(Btrace, "trace_mat_random")
-                if not Btrace.trace_mat_random:
-                    row = box.row()
-                    row.prop(Btrace, "trace_mat_color", text="")
-                else:
-                    row.prop(Btrace, "mat_run_color_blender")
-                    if Btrace.mat_run_color_blender:
-                        row = box.row()
-                        row.operator("object.colorblenderclear", text="Reset Material Keyframes", icon="KEY_DEHLT")
-                        row.prop(Btrace, 'mmSkip', text="Keyframe every")
-                      
-                    color_blender()
-                row = box.row()
-            if Btrace.show_curve_settings:
-                #if  or btracemenu.tool_handwrite:
-                if len(bpy.context.selected_objects) > 0 and obj.type == 'CURVE': # selected curve options
-                    col = box.column(align=True)
-                    col.label(text="Edit Curves for", icon='CURVE_BEZCURVE')
-                    col.label(text="Selected Curve Bevel Options")
-                    row = col.row(align=True)
-                    row.prop(obj.data, 'bevel_depth', text="Depth")
-                    row.prop(obj.data, 'bevel_resolution', text="Resolution")
-                    row = col.row(align=True)
-                    row.prop(obj.data, 'resolution_u')
-                else: # For new curve
-                    box.label(text="New Curve Settings", icon='CURVE_BEZCURVE')
-                    box.prop(Btrace, "curve_spline")
-                    box.prop(Btrace, "curve_handle")
-                    box.label(text="Bevel Options")
-                    col = box.column(align=True)
-                    row = col.row(align=True)
-                    row.prop(Btrace, "curve_depth", text="Depth")
-                    row.prop(Btrace, "curve_resolution", text="Resolution")
-                    row = col.row(align=True)
-                    row.prop(Btrace, "curve_u")
-
-        ############################
-        ## Grow Animation Panel options
-        ############################
-        def add_grow():
-            """Button for grow animation option"""
-            row = box.row()
-            row.label(text="Animate Final Curve")
-            row = box.row()
-            row.prop(Btrace, "animate", text="Add Grow Curve Animation", icon="META_BALL")
-            row.label("")
-            if Btrace.animate:
-                box.label(text='Frame Animation Settings:', icon="META_BALL")
-                col = box.column(align=True)
-                col.prop(Btrace, 'anim_auto')
-                if not Btrace.anim_auto:
-                    row = col.row(align=True)
-                    row.prop(Btrace, 'anim_f_start')
-                    row.prop(Btrace, 'anim_length')
-                row = col.row(align=True)
-                row.prop(Btrace, 'anim_delay')
-                row.prop(Btrace, 'anim_f_fade')
-
-                box.label(text='Additional Settings')
-                row = box.row()
-                row.prop(Btrace, 'anim_tails')
-                row.prop(Btrace, 'anim_keepr')
-
-        ##################################################################
-        ## Start Btrace Panel
-        ##################################################################
-        col = self.layout.column(align=True)
-        #col.label(text="Trace Tools")
-        row = col.row()
-        row.prop(btracemenu, "tool_objectTrace", text="Ojbect Trace", icon="FORCE_MAGNETIC")
-        row.prop(btracemenu, "tool_objectsConnect", text="Object Connect", icon="OUTLINER_OB_EMPTY")
-        row = col.row()
-        row.prop(btracemenu, "tool_meshFollow", text="Mesh Follow", icon="DRIVER")
-        row.prop(btracemenu, "tool_handwrite", text="Handwriting", icon='BRUSH_DATA')
-        row = col.row()   
-        row.prop(btracemenu, "tool_particleTrace", icon="PARTICLES", text="Particle Trace")
-        row.prop(btracemenu, "tool_particleConnect", icon="MOD_PARTICLES", text="Particle Connect")
-        row = layout.row()
-        col = layout.column(align=True)
-        row = col.row()
-        row.prop(btracemenu, "tool_growCurve", icon="META_BALL", text="Grow Animation")
-        row.prop(btracemenu, "tool_fcurve", text="Fcurve Noise", icon='RNDCURVE')
-        row = col.row()
-        row.prop(btracemenu, "tool_colorblender", text="Color Blender", icon="COLOR")
-        row.label(text="")
-        row = layout.row()
-
-        ##########################
-        ## Start  Object Tools
-        ##########################
-        sel = bpy.context.selected_objects
-        ############################
-        ### Object Trace
-        ############################
-        if btracemenu.tool_objectTrace:
-            row = layout.row()
-            row.label(text="  Trace Tool:", icon="FORCE_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text="Object Trace", icon="FORCE_MAGNETIC")
-            row.operator("object.btobjecttrace", text="Run!", icon="PLAY")
-            row = box.row()
-            row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings')
-            myselected = "Selected %d" % len(bpy.context.selected_objects)
-            row.label(text=myselected)
-            if Btrace.settings_toggle:
-                row = box.row()
-                row.label(text='Edge Draw Method')
-                row = box.row(align=True)
-                row.prop(Btrace, 'convert_edgetype')
-                box.prop(Btrace, "object_duplicate")
-                if len(sel) > 1:
-                    box.prop(Btrace, 'convert_joinbefore')
-                else:
-                    Btrace.convert_joinbefore = False
-                row = box.row()
-                row.prop(Btrace, "distort_curve")
-                if Btrace.distort_curve:
-                    col = box.column(align=True)
-                    col.prop(Btrace, "distort_modscale")
-                    col.prop(Btrace, "distort_noise")
-                row = box.row()
-                curve_settings()  # Show Curve/material settings
-                add_grow()  # Grow settings here
-
-        ############################
-        ### Objects Connect
-        ############################
-        if btracemenu.tool_objectsConnect:
-            row = layout.row()
-            row.label(text="  Trace Tool:", icon="FORCE_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text="Objects Connect", icon="OUTLINER_OB_EMPTY")
-            row.operator("object.btobjectsconnect", text="Run!", icon="PLAY")
-            row = box.row()
-            row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings')
-            row.label(text="")
-            if Btrace.settings_toggle:
-                row = box.row()
-                row.prop(Btrace, "respect_order", text="Selection Options")
-                if Btrace.respect_order:
-                    box.operator("object.select_order", text="Click to start order selection", icon='UV_SYNC_SELECT')
-                row = box.row()
-                row.prop(Btrace, "connect_noise", text="Add F-Curve Noise")
-                if Btrace.connect_noise:
-                    row = box.row()
-                    row.label(text="F-Curve Noise", icon='RNDCURVE')
-                    row = box.row(align=True)
-                    row.prop(Btrace, "fcnoise_rot")
-                    row.prop(Btrace, "fcnoise_loc")
-                    row.prop(Btrace, "fcnoise_scale")
-                    col = box.column(align=True)
-                    col.prop(Btrace, "fcnoise_amp")
-                    col.prop(Btrace, "fcnoise_timescale")
-                    box.prop(Btrace, "fcnoise_key")
-                curve_settings()  # Show Curve/material settings
-                add_grow()  # Grow settings here
-
-        ############################
-        ### Mesh Follow
-        ############################
-        if btracemenu.tool_meshFollow:
-            row = layout.row()
-            row.label(text="  Trace Tool:", icon="FORCE_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text="Mesh Follow", icon="DRIVER")
-            row.operator("object.btmeshfollow", text="Run!", icon="PLAY")
-            row = box.row()
-            if Btrace.fol_mesh_type == 'OBJECT':
-                a, b = "Trace Object", "SNAP_VOLUME"
-            if Btrace.fol_mesh_type == 'VERTS':
-                a, b = "Trace Verts", "SNAP_VERTEX"
-            if Btrace.fol_mesh_type == 'EDGES':
-                a, b = "Trace Edges", "SNAP_EDGE"
-            if Btrace.fol_mesh_type == 'FACES':
-               a, b = "Trace Faces", "SNAP_FACE"
-            row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings')
-            row.label(text=a, icon=b)
-            if Btrace.settings_toggle:
-                col = box.column(align=True)
-                row = col.row(align=True)
-                row.prop(Btrace, "fol_mesh_type", expand=True)
-                row = col.row(align=True)
-                if Btrace.fol_mesh_type != 'OBJECT':
-                    row.prop(Btrace, "fol_sel_option", expand=True)
-                    row = box.row()
-                    if Btrace.fol_sel_option == 'RANDOM':
-                        row.label("Random Select of Total")
-                        row.prop(Btrace, "fol_perc_verts", text="%")
-                    if Btrace.fol_sel_option == 'CUSTOM':
-                        row.label("Choose selection in Edit Mode")
-                    if Btrace.fol_sel_option == 'ALL':
-                        row.label("Select All items")
-                col = box.column(align=True)
-                col.label("Time Options", icon="TIME")
-                col.prop(Btrace, "particle_step")
-                row = col.row(align=True)
-                row.prop(Btrace, "fol_start_frame")
-                row.prop(Btrace, "fol_end_frame")
-                curve_settings()  # Show Curve/material settings
-                add_grow()  # Grow settings here
-
-         ############################
-        ### Handwriting Tools
-        ############################
-        if btracemenu.tool_handwrite:
-            row = layout.row()
-            row.label(text="  Trace Tool:", icon="FORCE_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text='Handwriting', icon='BRUSH_DATA')
-            row.operator("curve.btwriting", text="Run!", icon='PLAY')
-            row = box.row()
-            row = box.row()
-            row.label(text='Grease Pencil Writing Tools')
-            col = box.column(align=True)
-            row = col.row(align=True)
-            row.operator("gpencil.draw", text="Draw", icon='BRUSH_DATA').mode = 'DRAW'
-            row.operator("gpencil.draw", text="Poly", icon='VPAINT_HLT').mode = 'DRAW_POLY'
-            row = col.row(align=True)
-            row.operator("gpencil.draw", text="Line", icon='ZOOMOUT').mode = 'DRAW_STRAIGHT'
-            row.operator("gpencil.draw", text="Erase", icon='TPAINT_HLT').mode = 'ERASER'
-            row = box.row()
-            row.operator("gpencil.data_unlink", text="Delete Grease Pencil Layer", icon="CANCEL")
-            row = box.row()
-            curve_settings()  # Show Curve/material settings
-            add_grow()  # Grow settings here
-
-        ############################
-        ### Particle Trace
-        ############################
-        if btracemenu.tool_particleTrace:
-            row = layout.row()
-            row.label(text="  Trace Tool:", icon="FORCE_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text="Particle Trace", icon="PARTICLES")
-            row.operator("particles.particletrace", text="Run!", icon="PLAY")
-            row = box.row()
-            row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings')
-            row.label(text="")
-            if Btrace.settings_toggle:
-                box.prop(Btrace, "particle_step")
-                row = box.row()
-                row.prop(Btrace, "curve_join")
-                curve_settings()  # Show Curve/material settings
-                add_grow()  # Grow settings here
-
-        ############################
-        ### Connect Particles
-        ############################
-        if btracemenu.tool_particleConnect:
-            row = layout.row()
-            row.label(text="  Trace Tool:", icon="FORCE_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text='Particle Connect', icon='MOD_PARTICLES')
-            row.operator("particles.connect", icon="PLAY", text='Run!')
-            row = box.row()
-            row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings')
-            row.label(text="")
-            if Btrace.settings_toggle:
-                box.prop(Btrace, "particle_step")
-                row = box.row()
-                row.prop(Btrace, 'particle_auto')
-                if not Btrace.particle_auto:
-                    row = box.row(align=True)
-                    row.prop(Btrace, 'particle_f_start')
-                    row.prop(Btrace, 'particle_f_end')
-                curve_settings()  # Show Curve/material settings
-                add_grow()  # Grow settings here
-
-        #######################
-        #### Grow Animation ####
-        #######################
-        if btracemenu.tool_growCurve:
-            row = layout.row()
-            row.label(text="  Curve Tool:", icon="OUTLINER_OB_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text="Grow Curve", icon="META_BALL")
-            row.operator('curve.btgrow', text='Run!', icon='PLAY')
-            row = box.row()
-            row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings')
-            row.operator('object.btreset',  icon='KEY_DEHLT')
-            if Btrace.settings_toggle:
-                box.label(text='Frame Animation Settings:')
-                col = box.column(align=True)
-                col.prop(Btrace, 'anim_auto')
-                if not Btrace.anim_auto:
-                    row = col.row(align=True)
-                    row.prop(Btrace, 'anim_f_start')
-                    row.prop(Btrace, 'anim_length')
-                row = col.row(align=True)
-                row.prop(Btrace, 'anim_delay')
-                row.prop(Btrace, 'anim_f_fade')
-
-                box.label(text='Additional Settings')
-                row = box.row()
-                row.prop(Btrace, 'anim_tails')
-                row.prop(Btrace, 'anim_keepr')
-
-        #######################
-        #### F-Curve Noise Curve ####
-        #######################
-        if btracemenu.tool_fcurve:
-            row = layout.row()
-            row.label(text="  Curve Tool:", icon="OUTLINER_OB_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text="F-Curve Noise", icon='RNDCURVE')
-            row.operator("object.btfcnoise", icon='PLAY', text="Run!")
-            row = box.row()
-            row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings')
-            row.operator('object.btreset',  icon='KEY_DEHLT')
-            if Btrace.settings_toggle:
-                row = box.row(align=True)
-                row.prop(Btrace, "fcnoise_rot")
-                row.prop(Btrace, "fcnoise_loc")
-                row.prop(Btrace, "fcnoise_scale")
-                col = box.column(align=True)
-                col.prop(Btrace, "fcnoise_amp")
-                col.prop(Btrace, "fcnoise_timescale")
-                box.prop(Btrace, "fcnoise_key")
-
-        #######################
-        #### Color Blender ####
-        #######################
-        if btracemenu.tool_colorblender:
-            row = layout.row()
-            row.label(text="  Curve/Object Tool:", icon="OUTLINER_OB_CURVE")
-            box = self.layout.box()
-            row = box.row()
-            row.label(text="Color Blender", icon="COLOR")
-            row.operator("object.colorblender", icon='PLAY', text="Run!")
-            row = box.row()
-            row.operator("object.colorblenderclear", text="Reset Keyframes", icon="KEY_DEHLT")
-            row.prop(Btrace, 'mmSkip', text="Keyframe every")
-            color_blender()
-
-###### END PANEL ##############
-###############################
-
-
-################## ################## ################## ############
-## Object Trace
-## creates a curve with a modulated radius connecting points of a mesh
-################## ################## ################## ############
-
-class OBJECT_OT_objecttrace(bpy.types.Operator):
-    bl_idname = "object.btobjecttrace"
-    bl_label = "Btrace: Object Trace"
-    bl_description = "Trace selected mesh object with a curve with the option to animate"
-    bl_options = {'REGISTER', 'UNDO'}
-
-
-    @classmethod
-    def poll(cls, context):
-        return (context.object and context.object.type in {'MESH', 'FONT'})
-
-    def invoke(self, context, event):
-        import bpy
-
-        # Run through each selected object and convert to to a curved object
-        brushObj = bpy.context.selected_objects
-        Btrace = bpy.context.window_manager.curve_tracer
-        # Duplicate Mesh
-        if Btrace.object_duplicate:
-            bpy.ops.object.duplicate_move()
-            brushObj = bpy.context.selected_objects
-        # Join Mesh
-        if Btrace.convert_joinbefore:
-            if len(brushObj) > 1:  # Only run if multiple objects selected
-                bpy.ops.object.join()
-                brushObj = bpy.context.selected_objects
-
-        for i in brushObj:
-            bpy.context.scene.objects.active = i
-            if i and i.type != 'CURVE':
-                bpy.ops.object.btconvertcurve()
-                addtracemat(bpy.context.object.data)
-            if Btrace.animate:
-                bpy.ops.curve.btgrow()
-        return {'FINISHED'}
-
-
-################## ################## ################## ############
-## Objects Connect
-## connect selected objects with a curve + hooks to each node
-## possible handle types: 'FREE' 'AUTO' 'VECTOR' 'ALIGNED'
-################## ################## ################## ############
-
-class OBJECT_OT_objectconnect(bpy.types.Operator):
-    bl_idname = "object.btobjectsconnect"
-    bl_label = "Btrace: Objects Connect"
-    bl_description = "Connect selected objects with a curve and add hooks to each node"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        return len(bpy.context.selected_objects) > 1
-
-    def invoke(self, context, event):
-        import bpy, selection_utils
-        list = []
-        Btrace = bpy.context.window_manager.curve_tracer
-        curve_handle = Btrace.curve_handle
-        if curve_handle == 'AUTOMATIC':  # hackish because of naming conflict in api
-            curve_handle = 'AUTO'
-        # Check if Btrace group exists, if not create
-        bgroup = bpy.data.groups.keys()
-        if 'Btrace' not in bgroup:
-            bpy.ops.group.create(name="Btrace")
-        #  check if noise
-        if Btrace.connect_noise:
-            bpy.ops.object.btfcnoise()
-        # check if respect order is checked, create list of objects
-        if Btrace.respect_order == True:
-            selobnames = selection_utils.selected
-            obnames = []
-            for ob in selobnames:
-                obnames.append(bpy.data.objects[ob])
-        else:
-            obnames = bpy.context.selected_objects  # No selection order
-
-        for a in obnames:
-            list.append(a)
-            a.select = False
-
-        # trace the origins
-        tracer = bpy.data.curves.new('tracer', 'CURVE')
-        tracer.dimensions = '3D'
-        spline = tracer.splines.new('BEZIER')
-        spline.bezier_points.add(len(list) - 1)
-        curve = bpy.data.objects.new('curve', tracer)
-        bpy.context.scene.objects.link(curve)
-
-        # render ready curve
-        tracer.resolution_u = Btrace.curve_u
-        tracer.bevel_resolution = Btrace.curve_resolution  # Set bevel resolution from Panel options
-        tracer.fill_mode = 'FULL'
-        tracer.bevel_depth = Btrace.curve_depth  # Set bevel depth from Panel options
-
-        # move nodes to objects
-        for i in range(len(list)):
-            p = spline.bezier_points[i]
-            p.co = list[i].location
-            p.handle_right_type = curve_handle
-            p.handle_left_type = curve_handle
-
-        bpy.context.scene.objects.active = curve
-        bpy.ops.object.mode_set(mode='OBJECT')
-
-        # place hooks
-        for i in range(len(list)):
-            list[i].select = True
-            curve.data.splines[0].bezier_points[i].select_control_point = True
-            bpy.ops.object.mode_set(mode='EDIT')
-            bpy.ops.object.hook_add_selob()
-            bpy.ops.object.mode_set(mode='OBJECT')
-            curve.data.splines[0].bezier_points[i].select_control_point = False
-            list[i].select = False
-
-        bpy.ops.object.select_all(action='DESELECT')
-        curve.select = True # selected curve after it's created
-        addtracemat(bpy.context.object.data) # Add material
-        if Btrace.animate: # Add Curve Grow it?
-            bpy.ops.curve.btgrow()
-        bpy.ops.object.group_link(group="Btrace") # add to Btrace group
-        if Btrace.animate:
-            bpy.ops.curve.btgrow() # Add grow curve
-        return {'FINISHED'}
-
-
-################## ################## ################## ############
-## Particle Trace
-## creates a curve from each particle of a system
-################## ################## ################## ############
-def  curvetracer(curvename, splinename):
-    Btrace = bpy.context.window_manager.curve_tracer
-    tracer = bpy.data.curves.new(splinename, 'CURVE')
-    tracer.dimensions = '3D'
-    curve = bpy.data.objects.new(curvename, tracer)
-    bpy.context.scene.objects.link(curve)
-    try:
-        tracer.fill_mode = 'FULL'
-    except:
-        tracer.use_fill_front = tracer.use_fill_back = False
-    tracer.bevel_resolution = Btrace.curve_resolution
-    tracer.bevel_depth = Btrace.curve_depth
-    tracer.resolution_u = Btrace.curve_u
-    return tracer, curve
-
-
-class OBJECT_OT_particletrace(bpy.types.Operator):
-    bl_idname = "particles.particletrace"
-    bl_label = "Btrace: Particle Trace"
-    bl_description = "Creates a curve from each particle of a system. Keeping particle amount under 250 will make this run faster"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        return (bpy.context.object and bpy.context.object.particle_systems)
-
-    def execute(self, context):
-        Btrace = bpy.context.window_manager.curve_tracer
-        particle_step = Btrace.particle_step    # step size in frames
-        obj = bpy.context.object
-        ps = obj.particle_systems.active
-        curvelist = []
-        curve_handle = Btrace.curve_handle
-        if curve_handle == 'AUTOMATIC':  # hackish naming conflict
-            curve_handle = 'AUTO'
-        if curve_handle == 'FREE_ALIGN':  # hackish naming conflict
-            curve_handle = 'FREE'
-
-        # Check if Btrace group exists, if not create
-        bgroup = bpy.data.groups.keys()
-        if 'Btrace' not in bgroup:
-            bpy.ops.group.create(name="Btrace")
-
-        if Btrace.curve_join:
-            tracer = curvetracer('Tracer', 'Splines')
-        for x in ps.particles:
-            if not Btrace.curve_join:
-                tracer = curvetracer('Tracer.000', 'Spline.000')
-            spline = tracer[0].splines.new('BEZIER')
-            spline.bezier_points.add((x.lifetime - 1) // particle_step)  # add point to spline based on step size
-            for t in list(range(int(x.lifetime))):
-                bpy.context.scene.frame_set(t + x.birth_time)
-                if not t % particle_step:
-                    p = spline.bezier_points[t // particle_step]
-                    p.co = x.location
-                    p.handle_right_type = curve_handle
-                    p.handle_left_type = curve_handle
-            particlecurve = tracer[1]
-            curvelist.append(particlecurve)
-        # add to group
-        bpy.ops.object.select_all(action='DESELECT')
-        for curveobject in curvelist:
-            curveobject.select = True
-            bpy.context.scene.objects.active = curveobject
-            bpy.ops.object.group_link(group="Btrace")
-            addtracemat(curveobject.data)  # Add material
-        
-        if Btrace.animate:
-            bpy.ops.curve.btgrow()  # Add grow curve
-
-        return {'FINISHED'}
-
-
-###########################################################################
-## Particle Connect
-## connect all particles in active system with a continuous animated curve
-###########################################################################
-
-class OBJECT_OT_traceallparticles(bpy.types.Operator):
-    bl_idname = 'particles.connect'
-    bl_label = 'Connect Particles'
-    bl_description = 'Create a continuous animated curve from particles in active system'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        return (bpy.context.object and bpy.context.object.particle_systems)
-
-    def execute(self, context):
-        
-        obj = bpy.context.object
-        ps = obj.particle_systems.active
-        set = ps.settings
-
-        # Grids distribution not supported
-        if set.distribution == 'GRID':
-            self.report({'INFO'},"Grid distribution mode for particles not supported.")
-            return{'FINISHED'}
-        
-        Btrace = bpy.context.window_manager.curve_tracer
-        particle_f_start = Btrace.particle_f_start # Get frame start
-        particle_f_end = Btrace.particle_f_end # Get frame end
-        curve_handle = Btrace.curve_handle
-        if curve_handle == 'AUTOMATIC': # hackish because of naming conflict in api
-            curve_handle = 'AUTO'
-        if curve_handle == 'FREE_ALIGN':
-            curve_handle = 'FREE'        
-        tracer = bpy.data.curves.new('Splines','CURVE') # define what kind of object to create
-        curve = bpy.data.objects.new('Tracer',tracer) # Create new object with settings listed above
-        bpy.context.scene.objects.link(curve) # Link newly created object to the scene
-        spline = tracer.splines.new('BEZIER')  # add a new Bezier point in the new curve
-        spline.bezier_points.add(set.count-1)
-		
-        tracer.dimensions = '3D'
-        tracer.resolution_u = Btrace.curve_u
-        tracer.bevel_resolution = Btrace.curve_resolution
-        tracer.fill_mode = 'FULL'
-        tracer.bevel_depth = Btrace.curve_depth
-
-        if Btrace.particle_auto:
-            f_start = int(set.frame_start)
-            f_end = int(set.frame_end + set.lifetime)
-        else:
-            if particle_f_end <= particle_f_start:
-                 particle_f_end = particle_f_start + 1
-            f_start = particle_f_start
-            f_end = particle_f_end
-
-        for bFrames in range(f_start, f_end):
-            bpy.context.scene.frame_set(bFrames)
-            if not (bFrames-f_start) % Btrace.particle_step:
-                for bFrames in range(set.count):
-                    if ps.particles[bFrames].alive_state != 'UNBORN': 
-                        e = bFrames
-                    bp = spline.bezier_points[bFrames]
-                    pt = ps.particles[e]
-                    bp.co = pt.location
-                    #bp.handle_left = pt.location
-                    #bp.handle_right = pt.location
-                    bp.handle_right_type = curve_handle
-                    bp.handle_left_type = curve_handle 
-                    bp.keyframe_insert('co')
-                    bp.keyframe_insert('handle_left')
-                    bp.keyframe_insert('handle_right')
-        # Select new curve
-        bpy.ops.object.select_all(action='DESELECT')
-        curve.select = True
-        bpy.context.scene.objects.active = curve
-        addtracemat(curve.data) #Add material
-        if Btrace.animate:
-            bpy.ops.curve.btgrow()
-        return{'FINISHED'}
-
-################## ################## ################## ############
-## Writing Tool
-## Writes a curve by animating its point's radii
-## 
-################## ################## ################## ############
-class OBJECT_OT_writing(bpy.types.Operator):
-    bl_idname = 'curve.btwriting'
-    bl_label = 'Write'
-    bl_description = 'Use Grease Pencil to write and convert to curves'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    # @classmethod  ### Removed so panel still draws if nothing is selected
-    # def poll(cls, context):
-    #     return (context.scene.grease_pencil or context.object.grease_pencil != None)
-
-    def execute(self, context):
-        Btrace = bpy.context.window_manager.curve_tracer
-        obj = bpy.context.object
-        gactive = bpy.context.active_object # set selected object before convert
-        bpy.ops.gpencil.convert(type='CURVE')
-        gactiveCurve = bpy.context.active_object # get curve after convert
-        # render ready curve
-        gactiveCurve.data.resolution_u = Btrace.curve_u
-        gactiveCurve.data.bevel_resolution = Btrace.curve_resolution  # Set bevel resolution from Panel options
-        gactiveCurve.data.fill_mode = 'FULL'
-        gactiveCurve.data.bevel_depth = Btrace.curve_depth  # Set bevel depth from Panel options
-
-        writeObj = bpy.context.selected_objects
-        if Btrace.animate:
-            for i in writeObj:
-                bpy.context.scene.objects.active = i
-                bpy.ops.curve.btgrow()
-                addtracemat(bpy.context.object.data) #Add material
-        else:
-            for i in writeObj:
-                bpy.context.scene.objects.active = i
-                addtracemat(bpy.context.object.data) #Add material
-
-        # Delete grease pencil strokes
-        bpy.context.scene.objects.active = gactive
-        bpy.ops.gpencil.data_unlink()
-        bpy.context.scene.objects.active = gactiveCurve
-        # Smooth object
-        bpy.ops.object.shade_smooth()
-        # Return to first frame
-        bpy.context.scene.frame_set(Btrace.anim_f_start)
-        
-        return{'FINISHED'}
-
-################## ################## ################## ############
-## Create Curve
-## Convert mesh to curve using either Continuous, All Edges, or Sharp Edges
-## Option to create noise
-################## ################## ################## ############
-
-class OBJECT_OT_convertcurve(bpy.types.Operator):
-    bl_idname = "object.btconvertcurve"
-    bl_label = "Btrace: Create Curve"
-    bl_description = "Convert mesh to curve using either Continuous, All Edges, or Sharp Edges"
-    bl_options = {'REGISTER', 'UNDO'}
-        
-    def execute(self, context):
-        import bpy, random, mathutils
-        from mathutils import Vector
-
-        Btrace = bpy.context.window_manager.curve_tracer
-        traceobjects = bpy.context.selected_objects # create a list with all the selected objects
-
-        obj = bpy.context.object
-        
-        ### Convert Font
-        if obj.type == 'FONT':
-            bpy.ops.object.mode_set(mode='OBJECT')
-            bpy.ops.object.convert(target='CURVE') # Convert edges to curve
-            bpy.context.object.data.dimensions = '3D'
-            
-        # make a continuous edge through all vertices
-        if obj.type == 'MESH':
-            # Add noise to mesh
-            if Btrace.distort_curve:
-                for v in obj.data.vertices:
-                    for u in range(3):
-                        v.co[u] += Btrace.distort_noise * (random.uniform(-1,1))
-
-            if Btrace.convert_edgetype == 'CONTI':
-                ## Start Continuous edge
-                bpy.ops.object.mode_set(mode='EDIT')
-                bpy.ops.mesh.select_all(action='SELECT')
-                bpy.ops.mesh.delete(type='EDGE_FACE')
-                bpy.ops.mesh.select_all(action='DESELECT')
-                verts = bpy.context.object.data.vertices
-                bpy.ops.object.mode_set(mode='OBJECT')
-                li = []
-                p1 = random.randint(0,len(verts)-1) 
-                
-                for v in verts: 
-                    li.append(v.index)
-                li.remove(p1)
-                for z in range(len(li)):
-                    x = []
-                    for px in li:
-                        d = verts[p1].co - verts[px].co # find distance from first vert
-                        x.append(d.length)
-                    p2 = li[x.index(min(x))] # find the shortest distance list index
-                    verts[p1].select = verts[p2].select = True
-                    bpy.ops.object.mode_set(mode='EDIT')
-                    bpy.context.tool_settings.mesh_select_mode = [True, False, False]
-                    bpy.ops.mesh.edge_face_add()
-                    bpy.ops.mesh.select_all(action='DESELECT')
-                    bpy.ops.object.mode_set(mode='OBJECT')
-                    # verts[p1].select = verts[p2].select = False #Doesn't work after Bmesh merge
-                    li.remove(p2)  # remove item from list.
-                    p1 = p2
-                # Convert edges to curve
-                bpy.ops.object.mode_set(mode='OBJECT')
-                bpy.ops.object.convert(target='CURVE') 
-            
-            if Btrace.convert_edgetype == 'EDGEALL':
-                ## Start All edges
-                bpy.ops.object.mode_set(mode='EDIT')
-                bpy.ops.mesh.select_all(action='SELECT')
-                bpy.ops.mesh.delete(type='ONLY_FACE')
-                bpy.ops.object.mode_set()
-                bpy.ops.object.convert(target='CURVE')
-                for sp in obj.data.splines:
-                    sp.type = Btrace.curve_spline
-
-        obj = bpy.context.object
-        # Set spline type to custom property in panel
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.curve.spline_type_set(type=Btrace.curve_spline) 
-        # Set handle type to custom property in panel
-        bpy.ops.curve.handle_type_set(type=Btrace.curve_handle) 
-        bpy.ops.object.editmode_toggle()
-        obj.data.fill_mode = 'FULL'
-        # Set resolution to custom property in panel
-        obj.data.bevel_resolution = Btrace.curve_resolution 
-        obj.data.resolution_u = Btrace.curve_u 
-        # Set depth to custom property in panel
-        obj.data.bevel_depth = Btrace.curve_depth 
-        # Smooth object
-        bpy.ops.object.shade_smooth()
-        # Modulate curve radius and add distortion
-        if Btrace.distort_curve: 
-            scale = Btrace.distort_modscale
-            if scale == 0:
-                return {'FINISHED'}
-            for u in obj.data.splines:
-                for v in u.bezier_points:
-                    v.radius = scale*round(random.random(),3) 
-        return {'FINISHED'}
-
-
-################## ################## ################## ############
-## Mesh Follow, trace vertex or faces
-## Create curve at center of selection item, extruded along animation
-## Needs to be animated mesh!!!
-################## ################## ################## ############
-
-class OBJECT_OT_meshfollow(bpy.types.Operator):
-    bl_idname = "object.btmeshfollow"
-    bl_label = "Btrace: Vertex Trace"
-    bl_description = "Trace Vertex or Face on an animated mesh"
-    bl_options = {'REGISTER', 'UNDO'}
-        
-    
-    @classmethod
-    def poll(cls, context):
-        return (context.object and context.object.type in {'MESH'})
-
-    def execute(self, context):
-        import bpy, random
-        from mathutils import Vector
-
-        Btrace = bpy.context.window_manager.curve_tracer
-        distort_curve = Btrace.distort_curve    # modulate the resulting curve
-        stepsize = Btrace.particle_step
-        traceobjects = bpy.context.selected_objects  # create a list with all the selected objects
-
-        obj = bpy.context.object
-        scn = bpy.context.scene
-        meshdata = obj.data
-        cursor = bpy.context.scene.cursor_location.copy()  # Store the location to restore at end of script
-        drawmethod = Btrace.fol_mesh_type  # Draw from Edges, Verts, or Faces
-        if drawmethod == 'VERTS':
-            meshobjs = obj.data.vertices
-        if drawmethod == 'FACES':
-            meshobjs = obj.data.polygons  # untested
-        if drawmethod == 'EDGES':
-            meshobjs = obj.data.edges  # untested
-
-        # Frame properties
-        start_frame, end_frame = Btrace.fol_start_frame, Btrace.fol_end_frame
-        if start_frame > end_frame:  # Make sure the math works
-            startframe = end_frame - 5  # if start past end, goto (end - 5)
-        frames = int((end_frame - start_frame) / stepsize)
-
-        def getsel_option():  # Get selection objects.
-            sel = []
-            seloption, fol_mesh_type = Btrace.fol_sel_option, Btrace.fol_mesh_type  # options = 'random', 'custom', 'all'
-            if fol_mesh_type == 'OBJECT':
-                pass
-            else:
-                if seloption == 'CUSTOM':
-                    for i in meshobjs:
-                        if i.select == True:
-                            sel.append(i.index)
-                if seloption == 'RANDOM':
-                    for i in list(meshobjs):
-                        sel.append(i.index)
-                    finalsel = int(len(sel) * Btrace.fol_perc_verts)
-                    remove = len(sel) - finalsel
-                    for i in range(remove):
-                        sel.pop(random.randint(0, len(sel) - 1))
-                if seloption == 'ALL':
-                    for i in list(meshobjs):
-                        sel.append(i.index)
-
-            return sel
-
-        def get_coord(objindex):
-            obj_co = []  # list of vector coordinates to use
-            frame_x = start_frame
-            for i in range(frames):  # create frame numbers list
-                scn.frame_set(frame_x)
-                if drawmethod != 'OBJECT':
-                    followed_item = meshobjs[objindex]
-                    if drawmethod == 'VERTS':
-                        g_co = obj.matrix_local * followed_item.co  # find Vert vector
-
-                    if drawmethod == 'FACES':
-                        g_co = obj.matrix_local * followed_item.normal  # find Face vector
-
-                    if drawmethod == 'EDGES':
-                        v1 = followed_item.vertices[0]
-                        v2 = followed_item.vertices[1]
-                        co1 = bpy.context.object.data.vertices[v1]
-                        co2 = bpy.context.object.data.vertices[v2]
-                        localcenter = co1.co.lerp(co2.co, 0.5)
-                        g_co = obj.matrix_world * localcenter
-
-                if drawmethod == 'OBJECT':
-                    g_co = objindex.location.copy()
-
-                obj_co.append(g_co)
-                frame_x = frame_x + stepsize
-
-            scn.frame_set(start_frame)
-            return obj_co
-
-        def make_curve(co_list):
-            Btrace = bpy.context.window_manager.curve_tracer
-            tracer = bpy.data.curves.new('tracer','CURVE')
-            tracer.dimensions = '3D'
-            spline = tracer.splines.new('BEZIER')
-            spline.bezier_points.add(len(co_list)-  1)
-            curve = bpy.data.objects.new('curve',tracer)
-            scn.objects.link(curve)
-            curvelist.append(curve)
-            # render ready curve
-            tracer.resolution_u = Btrace.curve_u
-            tracer.bevel_resolution = Btrace.curve_resolution  # Set bevel resolution from Panel options
-            tracer.fill_mode = 'FULL'
-            tracer.bevel_depth = Btrace.curve_depth  # Set bevel depth from Panel options
-            curve_handle = Btrace.curve_handle
-            if curve_handle == 'AUTOMATIC': # hackish AUTOMATIC doesn't work here
-                curve_handle = 'AUTO'
-
-            # move bezier points to objects
-            for i in range(len(co_list)):
-                p = spline.bezier_points[i]
-                p.co = co_list[i]
-                p.handle_right_type = curve_handle
-                p.handle_left_type = curve_handle
-            return curve
-
-        # Run methods
-        # Check if Btrace group exists, if not create
-        bgroup = bpy.data.groups.keys()
-        if 'Btrace' not in bgroup:
-            bpy.ops.group.create(name="Btrace") 
-
-        Btrace = bpy.context.window_manager.curve_tracer
-        sel = getsel_option()  # Get selection
-        curvelist = []  # list to use for grow curve
-        
-        if Btrace.fol_mesh_type == 'OBJECT':
-            vector_list = get_coord(obj)
-            curvelist.append(make_curve(vector_list))
-        else:
-            for i in sel:
-                vector_list = get_coord(i)
-                curvelist.append(make_curve(vector_list))
-        # Select new curves and add to group
-        bpy.ops.object.select_all(action='DESELECT')
-        for curveobject in curvelist:
-            if curveobject.type == 'CURVE':
-                curveobject.select = True
-                bpy.context.scene.objects.active = curveobject
-                bpy.ops.object.group_link(group="Btrace")
-                addtracemat(curveobject.data)
-                curveobject.select = False
-
-        if Btrace.animate:  # Add grow curve
-            for curveobject in curvelist:
-                curveobject.select = True
-            bpy.ops.curve.btgrow()
-            for curveobject in curvelist:
-                curveobject.select = False
-
-        obj.select = False  # Deselect original object
-        return {'FINISHED'}
-
-###################################################################
-#### Add Tracer Material
-###################################################################
-
-def addtracemat(matobj):
-    # Need to add cycles or BI render material options
-    # if engine == 'CYCLES':
-        # Add cycles mat
-    # if engine == 'BLENDER_RENDER':
-        # Add blender interal mat
-    matslots = bpy.context.object.data.materials.items()  # Check if a material exists, skip if it does
-    if len(matslots) < 1:  # Make sure there is only one material slot
-        engine = bpy.context.scene.render.engine
-        Btrace = bpy.context.window_manager.curve_tracer
-        if not Btrace.mat_run_color_blender:  # Check if color blender is to be run
-            if Btrace.trace_mat_random:  # Create Random color for each item
-                # Use random color from chosen palette, assign color lists for each palette
-                import random
-                brightColors  = [Btrace.brightColor1, Btrace.brightColor2, Btrace.brightColor3, Btrace.brightColor4]
-                bwColors = [Btrace.bwColor1, Btrace.bwColor2]
-                customColors = [Btrace.mmColor1, Btrace.mmColor2, Btrace.mmColor3, Btrace.mmColor4, Btrace.mmColor5, Btrace.mmColor6, Btrace.mmColor7, Btrace.mmColor8]
-                earthColors = [Btrace.earthColor1, Btrace.earthColor2, Btrace.earthColor3, Btrace.earthColor4, Btrace.earthColor5]
-                greenblueColors = [Btrace.greenblueColor1, Btrace.greenblueColor2, Btrace.greenblueColor3]
-                if Btrace.mmColors == 'BRIGHT':
-                    #print(random.randint(0, len(brightColors) - 1))
-                    mat_color = brightColors[random.randint(0, len(brightColors) - 1)]
-                if Btrace.mmColors == 'BW':
-                    mat_color = bwColors[random.randint(0, len(bwColors) - 1)]
-                if Btrace.mmColors == 'CUSTOM':
-                    mat_color = customColors[random.randint(0, len(customColors) - 1)]
-                if Btrace.mmColors == 'EARTH':
-                    mat_color = earthColors[random.randint(0, len(earthColors) - 1)]
-                if Btrace.mmColors == 'GREENBLUE':
-                    mat_color = greenblueColors[random.randint(0, len(greenblueColors) - 1)]
-                if Btrace.mmColors == 'RANDOM':
-                    mat_color = (random.random(), random.random(), random.random())
-            else:  # Choose Single color
-                mat_color = Btrace.trace_mat_color
-            # mat_color = Btrace.trace_mat_color
-            TraceMat = bpy.data.materials.new('TraceMat')
-            TraceMat.diffuse_color = mat_color
-            TraceMat.specular_intensity = 0.5
-            matobj.materials.append(bpy.data.materials.get(TraceMat.name))
-
-        else:  # Run color blender operator
-            bpy.ops.object.colorblender()
-
-    return {'FINISHED'}
-
-###################################################################
-#### Add Color Blender Material
-###################################################################
-
-# This is the magical material changer!
-class OBJECT_OT_materialChango(bpy.types.Operator):
-    bl_idname = 'object.colorblender'
-    bl_label = 'Color Blender'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    def execute(self, context):
-
-        import bpy, random
-        Btrace = bpy.context.window_manager.curve_tracer  # properties panel
-        colorObjects = bpy.context.selected_objects
-
-        # Set color lists
-        brightColors  = [Btrace.brightColor1, Btrace.brightColor2, Btrace.brightColor3, Btrace.brightColor4]
-        bwColors = [Btrace.bwColor1, Btrace.bwColor2]
-        customColors = [Btrace.mmColor1, Btrace.mmColor2, Btrace.mmColor3, Btrace.mmColor4, Btrace.mmColor5, Btrace.mmColor6, Btrace.mmColor7, Btrace.mmColor8]
-        earthColors = [Btrace.earthColor1, Btrace.earthColor2, Btrace.earthColor3, Btrace.earthColor4, Btrace.earthColor5]
-        greenblueColors = [Btrace.greenblueColor1, Btrace.greenblueColor2, Btrace.greenblueColor3]
-
-        colorList = Btrace.mmColors
-
-        # Go through each selected object and run the operator
-        for i in colorObjects:
-            theObj = i
-            # Check to see if object has materials
-            checkMaterials = len(theObj.data.materials)
-            if checkMaterials == 0:
-                # Add a material
-                materialName = "colorblendMaterial"
-                madMat = bpy.data.materials.new(materialName)
-                theObj.data.materials.append(madMat)
-            else:                
-                pass # pass since we have what we need
-                
-            # assign the first material of the object to "mat"
-            mat = theObj.data.materials[0] 
-
-            # Numbers of frames to skip between keyframes
-            skip = Btrace.mmSkip
-
-            # Random material function
-            def colorblenderRandom():
-                for crazyNumber in range(3):
-                    mat.diffuse_color[crazyNumber] = random.random()
-            
-            def colorblenderCustom():
-                mat.diffuse_color = random.choice(customColors)
-                
-            # Black and white color        
-            def colorblenderBW():
-                mat.diffuse_color = random.choice(bwColors)
-            
-            # Bright colors
-            def colorblenderBright():
-                mat.diffuse_color = random.choice(brightColors)
-                
-            # Earth Tones
-            def colorblenderEarth():
-                mat.diffuse_color = random.choice(earthColors)
-                
-            # Green to Blue Tones
-            def colorblenderGreenBlue():
-                mat.diffuse_color = random.choice(greenblueColors)
-             
-            # define frame start/end variables
-            scn = bpy.context.scene       
-            start = scn.frame_start
-            end = scn.frame_end           
-            # Go to each frame in iteration and add material
-            while start<=(end+(skip-1)):
-               
-                bpy.ops.anim.change_frame(frame=start)
-                
-                # Check what colors setting is checked and run the appropriate function
-                if Btrace.mmColors=='RANDOM':
-                    colorblenderRandom()
-                elif Btrace.mmColors=='CUSTOM':
-                    colorblenderCustom()
-                elif Btrace.mmColors=='BW':
-                    colorblenderBW()
-                elif Btrace.mmColors=='BRIGHT':
-                    colorblenderBright()
-                elif Btrace.mmColors=='EARTH':
-                    colorblenderEarth()
-                elif Btrace.mmColors=='GREENBLUE':
-                    colorblenderGreenBlue()
-                else:
-                    pass
-                
-                # Add keyframe to material
-                mat.keyframe_insert('diffuse_color')
-                
-                # Increase frame number
-                start += skip
-        return{'FINISHED'}
-    
-###### This clears the keyframes ######
-class OBJECT_OT_clearColorblender(bpy.types.Operator):
-    bl_idname = 'object.colorblenderclear'
-    bl_label = 'Clear colorblendness'
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    def invoke(self, context, event):
-        
-        import bpy, random
-        mcolorblend = context.window_manager.colorblender_operator # properties panel
-        colorObjects = bpy.context.selected_objects
-        
-        # Go through each selected object and run the operator
-        for i in colorObjects:
-            theObj = i    
-            # assign the first material of the object to "mat"
-            matCl = theObj.data.materials[0] 
-            
-            # define frame start/end variables
-            scn = bpy.context.scene       
-            start = scn.frame_start
-            end = scn.frame_end
-
-            # Remove all keyframes from diffuse_color, super sloppy need to find better way
-            while start <= (end * 2):
-                bpy.ops.anim.change_frame(frame=start)
-                matCl.keyframe_delete('diffuse_color')
-                start += 1
-            
-        return{'FINISHED'}
-
-
-################## ################## ################## ############
-## F-Curve Noise
-## will add noise modifiers to each selected object f-curves
-## change type to: 'rotation' | 'location' | 'scale' | '' to effect all
-## first record a keyframe for this to work (to generate the f-curves)
-################## ################## ################## ############
-
-class OBJECT_OT_fcnoise(bpy.types.Operator):
-    bl_idname = "object.btfcnoise"
-    bl_label = "Btrace: F-curve Noise"
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    def execute(self, context):
-        import bpy, random
-        
-        Btrace = bpy.context.window_manager.curve_tracer
-        amp = Btrace.fcnoise_amp
-        timescale = Btrace.fcnoise_timescale
-        addkeyframe = Btrace.fcnoise_key
-        
-        # This sets properties for Loc, Rot and Scale if they're checked in the Tools window
-        noise_rot = 'rotation'
-        noise_loc = 'location'
-        noise_scale = 'scale'
-        if not Btrace.fcnoise_rot:
-            noise_rot = 'none'
-        if not Btrace.fcnoise_loc:
-            noise_loc = 'none'
-        if not Btrace.fcnoise_scale:
-            noise_scale = 'none'
-            
-        type = noise_loc, noise_rot, noise_scale # Add settings from panel for type of keyframes
-        amplitude = amp
-        time_scale = timescale
-        
-        for i in bpy.context.selected_objects:
-            # Add keyframes, this is messy and should only add keyframes for what is checked
-            if addkeyframe == True:
-                bpy.ops.anim.keyframe_insert(type="LocRotScale")         
-            for obj in bpy.context.selected_objects:
-                if obj.animation_data:
-                    for c in obj.animation_data.action.fcurves:
-                        if c.data_path.startswith(type):
-                            # clean modifiers
-                            for m in c.modifiers : 
-                                c.modifiers.remove(m)
-                            # add noide modifiers
-                            n = c.modifiers.new('NOISE')
-                            n.strength = amplitude
-                            n.scale = time_scale
-                            n.phase = random.randint(0,999)
-        return {'FINISHED'}
-
-################## ################## ################## ############
-## Curve Grow Animation
-## Animate curve radius over length of time
-################## ################## ################## ############     
-class OBJECT_OT_curvegrow(bpy.types.Operator):
-    bl_idname = 'curve.btgrow'
-    bl_label = 'Run Script'
-    bl_description = 'Keyframe points radius'
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    @classmethod
-    def poll(cls, context):
-        return (context.object and context.object.type in {'CURVE'})
-    
-    def execute(self, context):
-        Btrace = bpy.context.window_manager.curve_tracer
-        anim_f_start, anim_length, anim_auto = Btrace.anim_f_start, Btrace.anim_length, Btrace.anim_auto
-        curve_resolution, curve_depth = Btrace.curve_resolution, Btrace.curve_depth
-        # make the curve visible
-        objs = bpy.context.selected_objects
-        for i in objs: # Execute on multiple selected objects
-            bpy.context.scene.objects.active = i
-            obj = bpy.context.active_object
-            try:
-                obj.data.fill_mode = 'FULL'
-            except:
-                obj.data.dimensions = '3D'
-                obj.data.fill_mode = 'FULL'
-            if not obj.data.bevel_resolution:
-                obj.data.bevel_resolution = curve_resolution
-            if not obj.data.bevel_depth:
-                obj.data.bevel_depth = curve_depth
-            if anim_auto:
-                anim_f_start = bpy.context.scene.frame_start
-                anim_length = bpy.context.scene.frame_end
-            # get points data and beautify
-            actual, total = anim_f_start, 0
-            for sp in obj.data.splines:
-                total += len(sp.points) + len(sp.bezier_points)
-            step = anim_length / total
-            for sp in obj.data.splines:
-                sp.radius_interpolation = 'BSPLINE'
-                po = [p for p in sp.points] + [p for p in sp.bezier_points]
-                if not Btrace.anim_keepr:
-                    for p in po:
-                        p.radius = 1
-                if Btrace.anim_tails and not sp.use_cyclic_u:
-                    po[0].radius = po[-1].radius = 0
-                    po[1].radius = po[-2].radius = .65
-                ra = [p.radius for p in po]
-
-                # record the keyframes
-                for i in range(len(po)):
-                    po[i].radius = 0
-                    po[i].keyframe_insert('radius', frame=actual)
-                    actual += step
-                    po[i].radius = ra[i]
-                    po[i].keyframe_insert('radius', frame=(actual + Btrace.anim_delay))
-
-                    if Btrace.anim_f_fade:
-                        po[i].radius = ra[i]
-                        po[i].keyframe_insert('radius', frame=(actual + Btrace.anim_f_fade - step))
-                        po[i].radius = 0
-                        po[i].keyframe_insert('radius', frame=(actual + Btrace.anim_delay + Btrace.anim_f_fade))
-
-            bpy.context.scene.frame_set(Btrace.anim_f_start)
-        return{'FINISHED'}
-
-################## ################## ################## ############
-## Remove animation and curve radius data
-################## ################## ################## ############
-class OBJECT_OT_reset(bpy.types.Operator):
-    bl_idname = 'object.btreset'
-    bl_label = 'Clear animation'
-    bl_description = 'Remove animation / curve radius data'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    def execute(self, context):
-        objs = bpy.context.selected_objects
-        for i in objs: # Execute on multiple selected objects
-            bpy.context.scene.objects.active = i
-            obj = bpy.context.active_object
-            obj.animation_data_clear()
-            if obj.type == 'CURVE':
-                for sp in obj.data.splines:
-                    po = [p for p in sp.points] + [p for p in sp.bezier_points]
-                    for p in po:
-                        p.radius = 1
-        return{'FINISHED'}
-
-### Define Classes to register
-classes = [
-    TracerProperties,
-    TracerPropertiesMenu,
-    addTracerObjectPanel,
-    OBJECT_OT_convertcurve,
-    OBJECT_OT_objecttrace,
-    OBJECT_OT_objectconnect,
-    OBJECT_OT_writing,
-    OBJECT_OT_particletrace,
-    OBJECT_OT_traceallparticles,
-    OBJECT_OT_curvegrow,
-    OBJECT_OT_reset,
-    OBJECT_OT_fcnoise,
-    OBJECT_OT_meshfollow,
-    OBJECT_OT_materialChango,
-    OBJECT_OT_clearColorblender
-    ]
-
-def register():
-    for c in classes:
-        bpy.utils.register_class(c)
-    bpy.types.WindowManager.curve_tracer = bpy.props.PointerProperty(type=TracerProperties)
-    bpy.types.WindowManager.btrace_menu = bpy.props.PointerProperty(type=TracerPropertiesMenu, update=deselect_others)
-
-def unregister():
-    for c in classes:
-        bpy.utils.unregister_class(c)
-    del bpy.types.WindowManager.curve_tracer
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/cmu_mocap_browser/__init__.py b/release/scripts/addons_contrib/cmu_mocap_browser/__init__.py
deleted file mode 100644
index 771a63c..0000000
--- a/release/scripts/addons_contrib/cmu_mocap_browser/__init__.py
+++ /dev/null
@@ -1,388 +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 3
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8-80 compliant>
-
-# This script was developed with financial support from the Foundation for
-# Science and Technology of Portugal, under the grant SFRH/BD/66452/2009.
-
-
-bl_info = {
-    "name": "Carnegie Mellon University Mocap Library Browser",
-    "author": "Daniel Monteiro Basso <daniel at basso.inf.br>",
-    "version": (2012, 6, 1, 1),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tools",
-    "description": "Assistant for using CMU Motion Capture data",
-    "warning": "Broken",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-                "Scripts/3D_interaction/CMU_Mocap_Library_Browser",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-                   "func=detail&aid=29086",
-    "category": "3D View"}
-
-
-import os
-import bpy
-import bgl
-import blf
-import math
-from . import library
-
-
-def initialize_subjects():
-    """
-        Initializes the main object and the subjects (actors) list
-    """
-    while bpy.data.scenes[0].cmu_mocap_lib.subject_list:
-        bpy.data.scenes[0].cmu_mocap_lib.subject_list.remove(0)
-    for k, v in library.subjects.items():
-        n = bpy.data.scenes[0].cmu_mocap_lib.subject_list.add()
-        n.name = "{:d} - {}".format(k, v['desc'])
-        n.idx = k
-
-
-def update_motions(self, context):
-    """
-        Updates the motions list after a subject is selected
-    """
-    sidx = -1
-    if self.subject_active != -1:
-        sidx = self.subject_list[self.subject_active].idx
-    while self.motion_list:
-        self.motion_list.remove(0)
-    if sidx != -1:
-        for k, v in library.subjects[sidx]["motions"].items():
-            n = self.motion_list.add()
-            n.name = "{:d} - {}".format(k, v["desc"])
-            n.idx = k
-        self.motion_active = -1
-
-
-class ListItem(bpy.types.PropertyGroup):
-    name = bpy.props.StringProperty()
-    idx = bpy.props.IntProperty()
-
-
-class CMUMocapLib(bpy.types.PropertyGroup):
-    local_storage = bpy.props.StringProperty(
-        name="Local Storage",
-        subtype='DIR_PATH',
-        description="Location to store downloaded resources",
-        default="~/cmu_mocap_lib")
-    follow_structure = bpy.props.BoolProperty(
-        name="Follow Library Folder Structure",
-        description="Store resources in subfolders of the local storage",
-        default=True)
-    automatically_import = bpy.props.BoolProperty(
-        name="Automatically Import after Download",
-        description="Import the resource after the download is finished",
-        default=True)
-    subject_list = bpy.props.CollectionProperty(
-        name="subjects", type=ListItem)
-    subject_active = bpy.props.IntProperty(
-        name="subject_idx", default=-1, update=update_motions)
-    subject_import_name = bpy.props.StringProperty(
-        name="Armature Name",
-        description="Identifier of the imported subject's armature",
-        default="Skeleton")
-    motion_list = bpy.props.CollectionProperty(name="motions", type=ListItem)
-    motion_active = bpy.props.IntProperty(name="motion_idx", default=-1)
-    frame_skip = bpy.props.IntProperty(name="Fps Divisor", default=4,
-    # usually the sample rate is 120, so the default 4 gives you 30fps
-                          description="Frame supersampling factor", min=1)
-    cloud_scale = bpy.props.FloatProperty(name="Marker Cloud Scale",
-                          description="Scale the marker cloud by this value",
-                          default=1., min=0.0001, max=1000000.0,
-                          soft_min=0.001, soft_max=100.0)
-
-
-def draw_callback(self, context):
-    mid = int(360 * self.recv / self.fsize)
-    cx = 200
-    cy = 30
-    blf.position(0, 230, 23, 0)
-    blf.size(0, 20, 72)
-    blf.draw(0, "{0:2d}% of {1}".format(
-        100 * self.recv // self.fsize, self.hfsize))
-
-    bgl.glEnable(bgl.GL_BLEND)
-    bgl.glColor4f(.7, .7, .7, 0.8)
-    bgl.glBegin(bgl.GL_TRIANGLE_FAN)
-    bgl.glVertex2i(cx, cy)
-    for i in range(mid):
-        x = cx + 20 * math.sin(math.radians(float(i)))
-        y = cy + 20 * math.cos(math.radians(float(i)))
-        bgl.glVertex2f(x, y)
-    bgl.glEnd()
-
-    bgl.glColor4f(.0, .0, .0, 0.6)
-    bgl.glBegin(bgl.GL_TRIANGLE_FAN)
-    bgl.glVertex2i(cx, cy)
-    for i in range(mid, 360):
-        x = cx + 20 * math.sin(math.radians(float(i)))
-        y = cy + 20 * math.cos(math.radians(float(i)))
-        bgl.glVertex2f(x, y)
-    bgl.glEnd()
-
-    bgl.glDisable(bgl.GL_BLEND)
-    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-
-
-class CMUMocapDownloadImport(bpy.types.Operator):
-    bl_idname = "mocap.download_import"
-    bl_label = "Download and Import a file"
-
-    remote_file = bpy.props.StringProperty(
-        name="Remote File",
-        description="Location from where to download the file data")
-    local_file = bpy.props.StringProperty(
-        name="Local File",
-        description="Destination where to save the file data")
-    do_import = bpy.props.BoolProperty(
-        name="Manual Import",
-        description="Import the resource non-automatically",
-        default=False)
-
-    timer = None
-    fout = None
-    src = None
-    fsize = 0
-    recv = 0
-    cloud_scale = 1
-
-    def modal(self, context, event):
-        context.area.tag_redraw()
-        if event.type == 'ESC':
-            self.fout.close()
-            os.unlink(self.local_file)
-            return self.cancel(context)
-        if event.type == 'TIMER':
-            to_read = min(self.fsize - self.recv, 100 * 2 ** 10)
-            data = self.src.read(to_read)
-            self.fout.write(data)
-            self.recv += to_read
-            if self.fsize == self.recv:
-                self.fout.close()
-                return self.cancel(context)
-        return {'PASS_THROUGH'}
-
-    def cancel(self, context):
-        context.window_manager.event_timer_remove(self.timer)
-        context.region.callback_remove(self.handle)
-        if os.path.exists(self.local_file):
-            self.import_or_open()
-        return {'CANCELLED'}
-
-    def execute(self, context):
-        cml = bpy.data.scenes[0].cmu_mocap_lib
-        if not os.path.exists(self.local_file):
-            try:
-                os.makedirs(os.path.split(self.local_file)[0])
-            except:
-                pass
-            from urllib.request import urlopen
-            self.src = urlopen(self.remote_file)
-            info = self.src.info()
-            self.fsize = int(info["Content-Length"])
-            m = int(math.log10(self.fsize) // 3)
-            self.hfsize = "{:.1f}{}".format(
-                self.fsize * math.pow(10, -m * 3),
-                ['b', 'Kb', 'Mb', 'Gb', 'Tb', 'Eb', 'Pb'][m])  # :-p
-            self.fout = open(self.local_file, 'wb')
-            self.recv = 0
-            self.handle = context.region.\
-                callback_add(draw_callback, (self, context), 'POST_PIXEL')
-            self.timer = context.window_manager.\
-                event_timer_add(0.001, context.window)
-            context.window_manager.modal_handler_add(self)
-            return {'RUNNING_MODAL'}
-        else:
-            self.import_or_open()
-        return {'FINISHED'}
-
-    def import_or_open(self):
-        cml = bpy.data.scenes[0].cmu_mocap_lib
-        if cml.automatically_import or self.do_import:
-            if self.local_file.endswith("mpg"):
-                bpy.ops.wm.path_open(filepath=self.local_file)
-            elif self.local_file.endswith("asf"):
-                try:
-                    bpy.ops.import_anim.asf(
-                        filepath=self.local_file,
-                        from_inches=True,
-                        use_rot_x=True, use_rot_z=True,
-                        armature_name=cml.subject_import_name)
-                except AttributeError:
-                    self.report({'ERROR'}, "To use this feature "
-                        "please enable the Acclaim ASF/AMC Importer addon.")
-            elif self.local_file.endswith("amc"):
-                ob = bpy.context.active_object
-                if not ob or ob.type != 'ARMATURE' or \
-                    'source_file_path' not in ob:
-                    self.report({'ERROR'}, "Please select a CMU Armature.")
-                    return
-                try:
-                    bpy.ops.import_anim.amc(
-                        filepath=self.local_file,
-                        frame_skip=cml.frame_skip)
-                except AttributeError:
-                    self.report({'ERROR'}, "To use this feature please "
-                        "enable the Acclaim ASF/AMC Importer addon.")
-            elif self.local_file.endswith("c3d"):
-                try:
-                    bpy.ops.import_anim.c3d(
-                        filepath=self.local_file,
-                        from_inches=False,
-                        auto_scale=True,
-                        scale=cml.cloud_scale,
-                        show_names=False,
-                        frame_skip=cml.frame_skip)
-                except AttributeError:
-                    self.report({'ERROR'}, "To use this feature "
-                        "please enable the C3D Importer addon.")
-
-
-
-class CMUMocapConfig(bpy.types.Panel):
-    bl_idname = "object.cmu_mocap_config"
-    bl_label = "CMU Mocap Browser Configuration"
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        if not bpy:
-            return
-        cml = bpy.data.scenes[0].cmu_mocap_lib
-        layout = self.layout
-        layout.operator("wm.url_open",
-            text="Carnegie Mellon University Mocap Library",
-            icon='URL').url = 'http://mocap.cs.cmu.edu/'
-        layout.prop(cml, "local_storage")
-        layout.prop(cml, "follow_structure")
-        layout.prop(cml, "automatically_import")
-
-
-class CMUMocapSubjectBrowser(bpy.types.Panel):
-    bl_idname = "object.cmu_mocap_subject_browser"
-    bl_label = "CMU Mocap Subject Browser"
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        if not bpy:
-            return
-        layout = self.layout
-        cml = bpy.data.scenes[0].cmu_mocap_lib
-        # spare space... layout.label("Subjects")
-        layout.template_list(cml, "subject_list", cml, "subject_active")
-        layout.prop(cml, "subject_import_name")
-        if cml.subject_active != -1:
-            sidx = cml.subject_list[cml.subject_active].idx
-            remote_fname = library.skeleton_url.format(sidx)
-            tid = "{0:02d}".format(sidx)
-            local_path = os.path.expanduser(cml.local_storage)
-            if cml.follow_structure:
-                local_path = os.path.join(local_path, tid)
-            local_fname = os.path.join(local_path, tid + ".asf")
-            do_import = False
-            if os.path.exists(local_fname):
-                label = "Import Selected"
-                do_import = True
-            elif cml.automatically_import:
-                label = "Download and Import Selected"
-            else:
-                label = "Download Selected"
-
-            props = layout.operator("mocap.download_import",
-                                    text=label, icon='ARMATURE_DATA')
-            props.remote_file = remote_fname
-            props.local_file = local_fname
-            props.do_import = do_import
-
-
-class CMUMocapMotionBrowser(bpy.types.Panel):
-    bl_idname = "object.cmu_mocap_motion_browser"
-    bl_label = "CMU Mocap Motion Browser"
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        if not bpy:
-            return
-        layout = self.layout
-        cml = bpy.data.scenes[0].cmu_mocap_lib
-        # spare space... layout.label("Motions for selected subject")
-        layout.template_list(cml, "motion_list", cml, "motion_active")
-        if cml.motion_active == -1:
-            return
-        sidx = cml.subject_list[cml.subject_active].idx
-        midx = cml.motion_list[cml.motion_active].idx
-        motion = library.subjects[sidx]['motions'][midx]
-        fps = motion['fps']
-        ifps = fps // cml.frame_skip
-        # layout.label("Original capture frame rate: {0:d} fps.".format(fps))
-        # layout.label("Importing frame rate: {0:d} fps.".format(ifps))
-        row = layout.row()
-        row.column().label("Original: {0:d} fps.".format(fps))
-        row.column().label("Importing: {0:d} fps.".format(ifps))
-        layout.prop(cml, "frame_skip")
-        layout.prop(cml, "cloud_scale")
-        remote_fname = library.motion_url.format(sidx, midx)
-        tid = "{0:02d}".format(sidx)
-        local_path = os.path.expanduser(cml.local_storage)
-        if cml.follow_structure:
-            local_path = os.path.join(local_path, tid)
-        for target, icon, ext in (
-                ('Motion Data', 'POSE_DATA', 'amc'),
-                ('Marker Cloud', 'EMPTY_DATA', 'c3d'),
-                ('Movie', 'FILE_MOVIE', 'mpg')):
-            action = "Import" if ext != 'mpg' else "Open"
-            fname = "{0:02d}_{1:02d}.{2}".format(sidx, midx, ext)
-            local_fname = os.path.join(local_path, fname)
-            do_import = False
-            if os.path.exists(local_fname):
-                label = "{0} {1}".format(action, target)
-                do_import = True
-            elif cml.automatically_import:
-                label = "Download and {0} {1}".format(action, target)
-            else:
-                label = "Download {0}".format(target)
-            row = layout.row()
-            props = row.operator("mocap.download_import", text=label, icon=icon)
-            props.remote_file = remote_fname + ext
-            props.local_file = local_fname
-            props.do_import = do_import
-            row.active = ext in motion['files']
-
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.Scene.cmu_mocap_lib = bpy.props.PointerProperty(type=CMUMocapLib)
-    initialize_subjects()
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/cmu_mocap_browser/library.py b/release/scripts/addons_contrib/cmu_mocap_browser/library.py
deleted file mode 100644
index 68c255a..0000000
--- a/release/scripts/addons_contrib/cmu_mocap_browser/library.py
+++ /dev/null
@@ -1,7487 +0,0 @@
-#!/usr/bin/env python3
-#-*- coding:utf-8 -*-
-
-# ##### 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 3
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-# This script was developed with financial support from the Foundation for
-# Science and Technology of Portugal, under the grant SFRH/BD/66452/2009.
-
-
-skeleton_url = "http://mocap.cs.cmu.edu:8080/subjects/{0:02d}/{0:02d}.asf"
-motion_url = "http://mocap.cs.cmu.edu:8080/subjects/{0:02d}/{0:02d}_{1:02d}."
-search_url = "http://mocap.cs.cmu.edu/search.php?subjectnumber=%&motion=%"
-
-# Carnegie Mellon University Mocap Library - http://mocap.cs.cmu.edu
-
-subjects = {1: {'desc': 'climb, swing, hang on playground equipment',
-     'motions': {1: {'desc': 'playground - forward jumps, turn around',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'playground - climb',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'playground - climb, hang, swing',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'playground - climb',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 5: {'desc': 'playground - climb, go under',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 6: {'desc': 'playground - climb, sit, dangle legs, descend',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 7: {'desc': 'playground - climb, sit, dangle legs, jump down',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 8: {'desc': 'playground - climb, sit, dangle legs, rock back, lower self to ground',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 9: {'desc': 'playground - climb, hang, hold self up with arms straight, swing, drop, sit, dangle legs, go under',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 10: {'desc': 'playground - climb, swing, lean back, drop',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 11: {'desc': 'playground - climb, hang, lean over, jump down',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 12: {'desc': 'playground - climb, pull up, dangle, sit, lower self to ground',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 13: {'desc': 'playground - climb, go under, jump down',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 14: {'desc': 'playground - climb, jump down, dangle, legs push off against',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 2: {'desc': 'various expressions and human behaviors',
-     'motions': {1: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'run/jog',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'jump, balance',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 5: {'desc': 'punch/strike',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 6: {'desc': 'bend over, scoop up, rise, lift arm',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 7: {'desc': 'swordplay',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 8: {'desc': 'swordplay',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 9: {'desc': 'swordplay',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 10: {'desc': 'wash self',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 3: {'desc': 'walk on uneven terrain',
-     'motions': {1: {'desc': 'walk on uneven terrain',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'walk on uneven terrain',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'walk on uneven terrain',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'walk on uneven terrain',
-                     'files': ['c3d', 'amc', 'avi'],
-                     'fps': 120}}},
- 5: {'desc': 'modern dance',
-     'motions': {1: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'dance - expressive arms, pirouette',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'dance - sideways arabesque, turn step, folding arms',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'dance - sideways arabesque, folding arms, bending back',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 5: {'desc': 'dance - quasi-cou-de-pied, raised leg above hip-height, jete en tourant',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 6: {'desc': 'dance - cartwheel-like start, pirouettes, jete',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 7: {'desc': 'dance - small jetes, attitude/arabesque, shifted-axis pirouette, turn',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 8: {'desc': 'dance - rond de jambe in the air, jete, turn',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 9: {'desc': 'dance - glissade devant, glissade derriere, attitude/arabesque',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 10: {'desc': 'dance - glissade devant, glissade derriere, attitude/arabesque',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 11: {'desc': 'dance - sideways steps, pirouette',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 12: {'desc': 'dance - arms held high, pointe tendue a terre, upper body rotation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 13: {'desc': 'dance - small jetes, pirouette',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 14: {'desc': 'dance - retire derriere, attitude/arabesque',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 15: {'desc': 'dance - retire derriere, attitude/arabesque',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 16: {'desc': 'dance - coupe dessous, jete en tourant',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 17: {'desc': 'dance - coupe dessous, grand jete en tourant',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 18: {'desc': 'dance - attitude/arabesque, jete en tourant, bending back',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 19: {'desc': 'dance - attitude/arabesque, jete en tourant, bending back',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 20: {'desc': 'dance - attitude/arabesque, jete en tourant, bending back',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 6: {'desc': 'dribble, shoot basketball',
-     'motions': {1: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'basketball - forward dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'basketball - forward dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'basketball - forward dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 5: {'desc': 'basketball - forward dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 6: {'desc': 'basketball - backward dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 7: {'desc': 'basketball - backward dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 8: {'desc': 'basketball - sideways dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 9: {'desc': 'basketball - sideways dribble',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 10: {'desc': 'basketball - forward dribble, 90-degree left turns',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 11: {'desc': 'basketball - forward dribble, 90-degree right turns',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 12: {'desc': 'basketball - forward dribble, 90-degree right turns, crossover dribble',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 13: {'desc': 'basketball - low, fast free style dribble, dribble through legs',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 14: {'desc': 'basketball - crossover dribble, shoot',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 15: {'desc': 'basketball - dribble, shoot',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 7: {'desc': 'walk',
-     'motions': {1: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'walk',
-                     'files': ['c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'slow walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 5: {'desc': 'slow walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 6: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 7: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 8: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 9: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'avi'],
-                     'fps': 120},
-                 10: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                 11: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                 12: {'desc': 'brisk walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120}}},
- 8: {'desc': 'walk',
-     'motions': {1: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'slow walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 5: {'desc': 'walk/stride',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 6: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 7: {'desc': 'walk, exaggerated stride',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 8: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 9: {'desc': 'walk',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 10: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 11: {'desc': 'slow walk/stride',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 9: {'desc': 'run',
-     'motions': {1: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 2: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 3: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 4: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 5: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 6: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 7: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 8: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 9: {'desc': 'run',
-                     'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                     'fps': 120},
-                 10: {'desc': 'run',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 11: {'desc': 'run',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                 12: {'desc': 'navigate - walk forward, backward, sideways',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 10: {'desc': 'kick soccer ball',
-      'motions': {1: {'desc': 'soccer - kick ball',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'soccer - kick ball',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'soccer - kick ball',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'soccer - kick ball',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'soccer - kick ball',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120}}},
- 11: {'desc': 'kick soccer ball',
-      'motions': {1: {'desc': 'soccer - kick ball',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120}}},
- 12: {'desc': 'tai chi, walk',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'tai chi',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120}}},
- 13: {'desc': 'various everyday behaviors',
-      'motions': {1: {'desc': 'sit on high stool, stand up',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'sit on high stool, stand up',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'sit on high stool, stand up',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'sit on stepstool, chin in hand',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'sit on stepstool, hands against chin, fidget, stand up',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'sit on stepstool, hands against chin, elbow out, stand up',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'unscrew bottlecap, drink soda',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'unscrew bottlecap, drink soda, screw on bottlecap',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'drink soda',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'jump up to grab, reach for, tiptoe',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'forward jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'jump up to grab, reach for, tiptoe',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'forward jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'laugh',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'laugh',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'laugh',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'boxing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'boxing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'forward jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'wash windows',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'wash windows',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'wash windows',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'sweep floor',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'sweep floor',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'sweep floor',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'direct traffic, wave',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'direct traffic, wave, point',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'direct traffic, wave, point',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'jumping jacks, side twists, bend over, squats',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'jumping jacks, side twists, squats, jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'jumping jacks, side twists, bend over, jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'forward jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'climb ladder',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'climb ladder',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'climb 3 steps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'climb 3 steps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  37: {'desc': 'climb 3 steps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  38: {'desc': 'climb 3 steps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  39: {'desc': 'jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  40: {'desc': 'jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  41: {'desc': 'jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  42: {'desc': 'jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 14: {'desc': 'various everyday behaviors',
-      'motions': {1: {'desc': 'boxing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'boxing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'boxing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'drink soda, screw on bottlecap',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'unscrew bottlecap, drink soda',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'jumping jacks, jog, squats, side twists, stretches',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'jump up to grab, reach for, tiptoe',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'jump up to grab, reach for, tiptoe',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'jump up to grab, reach for, tiptoe',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'wash windows',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'wash windows',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'wash windows',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'mop floor',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'jumping jacks, jog, squats, side twists, stretches',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'mop floor',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'sweep floor',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'laugh',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'laugh',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'laugh',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'jumping jacks, side twists, reach up, bend over',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'climb 3 steps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'climb 3 steps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'climb 3 steps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'direct traffic, wave, point',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'direct traffic, wave, point',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'direct traffic, wave, point',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'sit on high stool, stand up',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'sit on high stool, stand up',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'sit on stepstool, stand up, swing legs',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'sit on stepstool, ankle on other knee, hand on chin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'sit on stepstool, stand up',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'sit on stepstool, stand up',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'climb ladder',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'climb ladder',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'climb ladder',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'sit on stepstool, stand up',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  37: {'desc': 'drink soda',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 15: {'desc': 'various everyday behaviors, dance moves',
-      'motions': {1: {'desc': 'walk/wander',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'climb, step over, sit on, stand on stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk/wander',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'wash windows, paint; hand signals; dance - Egyptian walk, the Dive, the Twist, the Cabbage Patch; boxing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'wash windows, paint; hand signals; dance - Egyptian walk, the Dive, the Twist, the Cabbage Patch; boxing',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'lean forward, reach for',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'lean forward, tiptoe, reach for',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'hand signals - horizontally revolve forearms',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'walk/wander',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'sit on high stool, stand up',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'wash windows, paint figure eights; hand signals',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'wash windows; basketball - dribble, lay-up shot, pass; throw ball; dance - Egyptian walk, the Dive, the Twist; strew',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'boxing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'walk/wander',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 16: {'desc': 'run, jump, walk',
-      'motions': {1: {'desc': 'jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'high jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'high jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'forward jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'forward jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'forward jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'run/jog, sudden stop',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'forward jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'forward jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'walk, veer left',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'walk, veer left',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'walk, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'walk, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'walk, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'walk, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'walk, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'walk, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'walk, veer left',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'walk, veer left',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'walk, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'walk, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'walk, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'walk, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'walk, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'walk, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'slow walk, stop',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'slow walk, stop',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  37: {'desc': 'run/jog, veer left',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  38: {'desc': 'run/jog, veer left',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  39: {'desc': 'run/jog, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  40: {'desc': 'run/jog, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  41: {'desc': 'run/jog, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  42: {'desc': 'run/jog, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  43: {'desc': 'run/jog, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  44: {'desc': 'run/jog, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  45: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  46: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  47: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  48: {'desc': 'run, veer left',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  49: {'desc': 'run, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  50: {'desc': 'run, veer right',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  51: {'desc': 'run, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  52: {'desc': 'run, 90-degree left turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  53: {'desc': 'run, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  54: {'desc': 'run, 90-degree right turn',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  55: {'desc': 'run',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  56: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  57: {'desc': 'run/jog, sudden stop',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  58: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 17: {'desc': 'different walking styles',
-      'motions': {1: {'desc': 'walk with anger, frustration',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk with anger, frustration',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk stealthily',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk stealthily',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'walk/hobble',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'whistle, walk jauntily',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'whistle, walk jauntily',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': "muscular, heavyset person's walk",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': "muscular, heavyset person's walk",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'boxing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 18: {'desc': 'human interaction and communication (2 subjects - subject A)',
-      'motions': {1: {'desc': 'walk, shake hands (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk, shake hands (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'A pulls B; B resists (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'A pulls B; B resists (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'A pulls B by the elbow; B resists (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'A pulls B by the elbow; B resists (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'navigate busy sidewalk; A leads the way, takes B by the arm (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'conversation - explain with hand gestures (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'conversation - explain with hand gestures, walk (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'quarrel - angry hand gestures (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'quarrel - angry hand gestures (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'friends meet, hang out; A sits, B joins A (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'run, scramble for last seat (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'run, scramble for last seat (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'chicken dance (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 19: {'desc': 'human interaction and communication (2 subjects - subject B)',
-      'motions': {1: {'desc': 'walk, shake hands (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk, shake hands (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'A pulls B; B resists (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'A pulls B; B resists (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'A pulls B by the elbow; B resists (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'A pulls B by the elbow; B resists (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'navigate busy sidewalk; A leads the way, takes B by the arm (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'conversation - explain with hand gestures (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'conversation - explain with hand gestures, walk (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'quarrel - angry hand gestures (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'quarrel - angry hand gestures (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'friends meet, hang out; A sits, B joins A (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'run, scramble for last seat (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'run, scramble for last seat (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'chicken dance (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 20: {'desc': 'human interaction - at play, formations (2 subjects - subject A)',
-      'motions': {1: {'desc': 'chicken dance (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'link arms, walk (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'link arms, walk (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'synchronized walk (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'synchronized walk (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'soldiers march (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'soldiers march (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'zombie march (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'nursery rhyme - ring around the rosey (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': '360-degree two-person whip (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'high-five, walk (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'low-five, walk (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': "blind man's bluff (blindfold tag) (2 subjects - subject A)",
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 21: {'desc': 'human interaction - at play, formations (2 subjects - subject B)',
-      'motions': {1: {'desc': 'chicken dance (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'link arms, walk (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'link arms, walk (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'synchronized walk (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'synchronized walk (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'soldiers march (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'soldiers march (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'zombie march (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'nursery rhyme - ring around the rosey (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': '360-degree two-person whip (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'high-five, walk (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'low-five, walk (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': "blind man's bluff (blindfold tag) (2 subjects - subject B)",
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 22: {'desc': 'human interaction (2 subjects - subject A)',
-      'motions': {1: {'desc': 'B sits; A pulls up B (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'A sits; B pulls up A (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'A sits, holds face in hands; B kneels, comforts A (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': "B comforts A, puts one hand on A's shoulder (2 subjects - subject A)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': "A comforts B, puts both hands on B's shoulders (2 subjects - subject A)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': "B comforts A, puts both hands on A's shoulders (2 subjects - subject A)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': "A comforts B, puts one hand on B's shoulder (2 subjects - subject A)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'hold hands, swing arms, walk (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'A gives B a shoulder rub; B sits, A stands (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'A shelters B, a younger child, from harm (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'B shelters A, a younger child, from harm (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'A stumbles into B (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'A passes soda to B; both drink (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'alternating squats (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'alternating jumping jacks (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'synchronized jumping jacks (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'rush up, arm wrestle (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'A stares down B, leans with hands on high stool (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'B stares down A, leans with hands on high stool (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'violence - A picks up high stool, threatens to strike B (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'conversation - B pounds high stool, points at A (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'walk; B catches keys thrown by A (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'walk; A catches keys thrown by B (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'walk; B catches wallet thrown by A (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'walk; A catches wallet thrown by B (2 subjects - subject A)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 23: {'desc': 'human interaction (2 subjects - subject B)',
-      'motions': {1: {'desc': 'B sits; A pulls up B (subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'A sits; B pulls up A (subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'A sits, holds face in hands; B kneels, comforts A (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': "B comforts A, puts one hand on A's shoulder (2 subjects - subject B)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': "A comforts B, puts both hands on B's shoulders (2 subjects - subject B)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': "B comforts A, puts both hands on A's shoulders (2 subjects - subject B)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': "A comforts B, puts one hand on B's shoulder (2 subjects - subject B)",
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'hold hands, swing arms, walk (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'A gives B a shoulder rub; B sits, A stands (subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'A shelters B, a younger child, from harm (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'B shelters A, a younger child, from harm (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'A stumbles into B (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'A passes soda to B; both drink (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'alternating squats (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'alternating jumping jacks (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'synchronized jumping jacks (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'rush up, arm wrestle (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'A stares down B, leans with hands on high stool (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'B stares down A, leans with hands on high stool (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'violence - A picks up high stool, threatens to strike B (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'conversation - B pounds high stool, points at A (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'walk; B catches keys thrown by A (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'walk; A catches keys thrown by B (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'walk; B catches wallet thrown by A (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'walk; A catches wallet thrown by B (2 subjects - subject B)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 24: {'desc': 'nursery rhymes',
-      'motions': {1: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 25: {'desc': 'nursery rhymes',
-      'motions': {1: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg'],
-                      'fps': 120}}},
- 26: {'desc': 'nursery rhymes, basketball, bending',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'Alaska vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'Alaska vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'bend, pick up',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'bend, lift',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'bend, lift',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 27: {'desc': 'recreation, nursery rhymes',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'nursery rhyme - Cock Robin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'prairie dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 28: {'desc': 'recreation, nursery rhymes, animal behaviors (pantomime - human subject)',
-      'motions': {1: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'prairie dog (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'whale (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'bear (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'snake (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'mouse (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'cat (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'elephant (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'dinosaur (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 29: {'desc': 'recreation, nursery rhymes, animal behaviors (pantomime - human subject)',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'nursery rhyme - Cock Robin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'prairie dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'whale (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'bear (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'cat (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'fish (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'elephant (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'mouse (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'dinosaur (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'snake (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 30: {'desc': 'recreation, nursery rhymes, animal behaviors (pantomime - human subject)',
-      'motions': {1: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'nursery rhyme - Cock Robin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'prairie dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'whale (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'bear (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'cat (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'elephant (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'mouse (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'snake (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'Tyrannosaurus rex (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 31: {'desc': 'recreation, nursery rhymes, animal behaviors (pantomime - human subject)',
-      'motions': {1: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'prairie dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'whale (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'bear (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'cat (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'elephant (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'Tyrannosaurus rex (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'mouse (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'snake (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 32: {'desc': 'recreation, nursery rhymes, animal behaviors (pantomime - human subject)',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'nursery rhyme - Cock Robin',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'basketball signals',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'nursery rhyme - "I\'m a little teapot..."',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'Alaskan vacation',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'nursery rhyme - Cock Robin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'Alaskan vacation',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'prairie dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'bear (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'cat (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'elephant (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'mouse (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'Tyrannosaurus rex (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'snake (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 33: {'desc': 'throw and catch football (2 subjects - subject A)',
-      'motions': {1: {'desc': 'football - throw, catch (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'football - throw, catch, jump around (2 subjects - subject A)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60}}},
- 34: {'desc': 'throw and catch football (2 subjects - subject B)',
-      'motions': {1: {'desc': 'football - throw, catch (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'football - throw, catch, jump around (2 subjects - subject B)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60}}},
- 35: {'desc': 'walk, run',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'run/jog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'navigate around obstacles',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 36: {'desc': 'walk on uneven terrain',
-      'motions': {1: {'desc': 'walk on uneven terrain',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk forward, turn around, walk back',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk forward, turn around, walk back',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk on uneven terrain',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'walk on uneven terrain',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'walk on uneven terrain',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'walk on uneven terrain',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'walk on uneven terrain',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'walk forward, turn around, walk back',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'walk on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  37: {'desc': 'jump/hop on uneven terrain',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 37: {'desc': 'walk',
-      'motions': {1: {'desc': 'slow walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 38: {'desc': 'walk, run',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'run around in a circle',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk around, frequent turns, cyclic walk along a line',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 39: {'desc': 'climb, swing, hang on playground equipment',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'walk forward, turn around, walk back',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'walk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 40: {'desc': 'navigate from corner to corner, interact with stepstool',
-      'motions': {2: {'desc': 'navigate - walk forward, backward, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'navigate - walk forward, backward, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'navigate - walk forward, backward, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'navigate - walk forward, backward, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'climb, step over, sit on, jump over stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'climb, step over, jump over stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'climb, step over, jump over stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'climb, step over, jump over stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'wait for bus',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'wait for bus',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'basketball signals',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 41: {'desc': 'navigate from corner to corner, interact with stepstool',
-      'motions': {2: {'desc': 'navigate - walk forward, backward, sideways, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'navigate - walk forward, backward, sideways, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'navigate - walk forward, backward, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'navigate - walk forward, backward, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'navigate - walk forward, backward, on a diagonal',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'climb, step over, jump over, navigate around stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'climb, step over, jump over, navigate around stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'climb, step over, jump over, navigate around stepstool',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'basketball signals',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'basketball signals',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 42: {'desc': 'stretch',
-      'motions': {1: {'desc': 'stretch - rotate head, shoulders, arms, legs',
-                      'files': ['tvd', 'c3d', 'amc'],
-                      'fps': 60}}},
- 43: {'desc': 'swing on playground equipment',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'playground - grip bar, swing body',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'playground - grip bar, swing body',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 45: {'desc': 'walk',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 46: {'desc': 'walk',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 47: {'desc': 'walk',
-      'motions': {1: {'desc': 'walk forward, turn around, walk back',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120}}},
- 49: {'desc': 'modern dance, gymnastics',
-      'motions': {1: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'jump up and down, hop on one foot',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'jump up and down, hop on one foot',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'run, leap',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'run, leap',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'cartwheel',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'cartwheel',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'cartwheels',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'dance - arms held high, side arabesque',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'dance - fold in from side arabesque, curl inwards',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'dance - fold in from side arabesque, curl inwards',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'dance - lean forward, bring back leg forward, arching arms',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'dance - fold in from side arabesque, curl inwards',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'dance - lean forward, bring back leg forward, arching arms',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'static dance pose - folded in, head lowered, leg bent',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'dance - fold in from side arabesque, curl inwards',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'dance - lean forward, bring back leg forward, arching arms',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'balance on one leg, outstretched arms',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'balance on one leg, outstretched arms',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'balance on one leg, outstretched arms',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'acrobatics - spin/twirl, hang on ropes',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'dance - lean back on bent leg, balance, bend elbow by ear',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 54: {'desc': 'animal behaviors (pantomime - human subject)',
-      'motions': {1: {'desc': 'monkey (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'bear (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'penguin (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'pterosaur (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'pterosaur (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'pterosaur (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'prairie dog (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'roadrunner (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'insect/praying mantis (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'ghost (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'penguin (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'dragon (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'dragon (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'prairie dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'superhero',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'squirrel (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'squirrel (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'squirrel - robotic like motion (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'follow path, walk around obstacles',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'follow path, walk around obstacles',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'follow path, walk around obstacles',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'hummingbird (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'chicken (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 55: {'desc': 'animal behaviors (pantomime - human subject)',
-      'motions': {1: {'desc': 'dance, whirl',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'lambada dance',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'genie (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'hummingbird (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'chicken (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'chicken (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'monkey (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'monkey (human subject)',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'hummingbird (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'animal (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'dancing bear (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'insect/praying mantis (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'prairie dog (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'roadrunner (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'panda (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'ghost (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'penguin (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'dragon (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'hippo ballerina (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'pterosaur (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'superhero',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'devil',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'various animals (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'dancing animal (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'monkey (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'dancing ant (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'monkey/bear (human subject)',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 56: {'desc': 'vignettes - locomotion, upper-body motions (focus: motion transitions)',
-      'motions': {1: {'desc': 'walk around',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'vignettes - fists up, wipe window, yawn, stretch, angrily grab, smash against wall',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'vignettes - fists up, wipe window, yawn, stretch, angrily grab, smash against wall, lift open window, throw punches, skip',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'vignettes - fists up, wipe window, grab, lift open window, throw punches, yawn, stretch, walk, jump',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'vignettes - walk, drink water, run/jog, jump, wipe window, lift open window, throw punches, yawn, stretch',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'vignettes - throw punches, grab, skip, yawn, stretch, leap, lift open window, walk, jump/bound',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'vignettes - yawn, stretch, walk, run/jog, angrily grab, jump, skip, halt',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'vignettes - lift open window, smash against wall, hop, walk, run/jog, yawn, stretch',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120}}},
- 60: {'desc': 'salsa',
-      'motions': {1: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  9: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60}}},
- 61: {'desc': 'salsa',
-      'motions': {1: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  9: {'desc': 'salsa dance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'salsa dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60}}},
- 62: {'desc': 'construction work, random motions',
-      'motions': {1: {'desc': 'bolt loosening, wrench',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'bolt tightening, wrench',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'sawing, hand saw',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'screwing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'screwing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'unscrewing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'hammering a nail',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'hammering a nail',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  9: {'desc': 'pulling a nail',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'hammering sequence',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'cleaning up',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'hard days drink',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'moving a stool',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'opening umbrella',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'opening umbrella',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  16: {'desc': 'closing umbrella',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  17: {'desc': 'opening and closing umbrella',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  18: {'desc': 'closing a box',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  19: {'desc': 'opening a box',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  20: {'desc': 'closing, moving and opening a box',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  21: {'desc': 'coiling a rope',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  22: {'desc': 'dynamic calibration',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  23: {'desc': 'bolt tightening',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  24: {'desc': 'bolt tightening, with putting bolt in',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  25: {'desc': 'bolt loosening, wrench',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60}}},
- 63: {'desc': 'golf',
-      'motions': {1: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120}}},
- 64: {'desc': 'golf',
-      'motions': {1: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'Swing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'Swing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'Putt',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'Putt',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'Putt',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'Putt',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'Putt',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'Placing Tee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'Placing Tee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'Placing Tee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'Placing Tee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'Placing Tee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'Placing Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'Placing Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'Placing Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'Placing Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'Placing Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'Picking up Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'Picking up Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'Picking up Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'Picking up Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'Picking up Ball',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 120}}},
- 69: {'desc': 'walking',
-      'motions': {1: {'desc': 'walk forward',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk forward',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk forward',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk forward',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'walk forward',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'walk and turn (repeated)',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'walk and turn (repeated)',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'walk and turn (repeated)',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'walk and turn (repeated)',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'walk and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'walk and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'walk and turn both directions (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'walk, turn in place (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'walk, turn in place (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'walk, turn in place (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'turn in place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'turn in place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'turn in place (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'turn in place (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'walk forward 90 degree right turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'walk forward 90 degree right turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'walk forward 90 degree right turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'walk forward 90 degree right turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'walk forward 90 degree left turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'walk forward 90 degree left turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'walk forward 90 degree left turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'walk forward 90 degree left turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'walk forward 90 degree smooth right turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'walk forward 90 degree smooth right turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'walk forward 90 degree smooth right turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'walk forward 90 degree smooth left turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'walk forward 90 degree smooth left turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'walk forward 90 degree smooth left turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  37: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  38: {'desc': 'walk backwards and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  39: {'desc': 'walk backward, turn in place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  40: {'desc': 'walk backward, turn in place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  41: {'desc': 'walk backward, turn in place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  42: {'desc': 'walk sideways and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  43: {'desc': 'walk sideways and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  44: {'desc': 'walk sideways and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  45: {'desc': 'walk sideways and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  46: {'desc': 'walk sideways and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  47: {'desc': 'walk sideways and turn (repeated)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  48: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  49: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  50: {'desc': 'walk sideways and backwards',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  51: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  52: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  53: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  54: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  55: {'desc': 'walk backwards and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  56: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  57: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  58: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  59: {'desc': 'walk sideways and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  60: {'desc': 'walk sideways and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  61: {'desc': 'walk sideways and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  62: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  63: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  64: {'desc': 'walk sideways and turn (opposite direction)',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  65: {'desc': 'walk sideways and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  66: {'desc': 'walk sideways and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  67: {'desc': 'walk sideways and turn',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  68: {'desc': 'walk forward and pick up object, set down object',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  69: {'desc': 'walk forward and pick up object, carry back object',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  70: {'desc': 'walk up to object, squat, pick up object, set down in another place.',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  71: {'desc': 'walk up to object, squat, pick up object, set down in another place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  72: {'desc': 'walk up to object, pick up object, set down in another place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  73: {'desc': 'walk up to object, lean over, pick up object, set down in another place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  74: {'desc': 'walk up to object, lean over, pick up object, set down in another place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  75: {'desc': 'walk up to object, squat, pick up object, set down in another place',
-                       'files': ['amc', 'avi'],
-                       'fps': 120}}},
- 70: {'desc': 'suitcase',
-      'motions': {1: {'desc': 'carry 5.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'carry 5.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'carry 19.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'carry 19.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'carry 19.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'carry 19.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'carry 19.5lb suitcase',
-                      'files': ['amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'carry 19.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'carry 19.5lb suitcase',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'carry 12.5lb suitcase',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'carry 12.5lb suitcase',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'carry 12.5lb suitcase',
-                       'files': ['amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'carry 12.5lb suitcase',
-                       'files': ['amc', 'avi'],
-                       'fps': 120}}},
- 74: {'desc': 'kicks and walking on slopes',
-      'motions': {1: {'desc': 'stiff walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'stiff walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'kick',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'kick',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'kick',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'kick',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'lifting up',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'lifting up',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  9: {'desc': '',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'peeping',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'peeping',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'thinker',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'Range of motion',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'slope 1',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'slope1',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  16: {'desc': 'slope 2',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  17: {'desc': 'slope 2',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  18: {'desc': 'slope 3',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  19: {'desc': 'slope 3',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  20: {'desc': 'stiff walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60}}},
- 75: {'desc': 'jumps; hopscotch; sits',
-      'motions': {1: {'desc': 'run jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'run jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'run jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'wide leg run',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'cross leg run',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  6: {'desc': '180 jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'angle jumps',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  8: {'desc': '360 jumps',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  9: {'desc': '360 jump',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  10: {'desc': '2 jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  11: {'desc': '2 jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'box jump',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'hopscotch',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'hopscotch',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'long jumps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  16: {'desc': 'jump kick',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  17: {'desc': 'medium sit',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  18: {'desc': 'high sit',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  19: {'desc': 'medium sit',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  20: {'desc': 'low sit',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60}}},
- 76: {'desc': 'avoidance',
-      'motions': {1: {'desc': 'walk backwards then attack with a punch',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk backwards, feign a few attacks, then attack',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'avoid attacker',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'defensive guard pose',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'swatting at pesky bug',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'avoid stepping on something',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'careful stepping over things',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'walking backwards',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'turning',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'quick large steps backwards',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 77: {'desc': 'careful actions',
-      'motions': {1: {'desc': 'looking around',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'standing',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'ready stance',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'Looking around',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'look around with flashlight',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'searching ground',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'poking ground',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'investigating thing on ground with two hands',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  9: {'desc': 'duck to avoid flying object',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'careful run',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'careful run',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'careful run in circle',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'careful run in figure eight',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'careful creeping',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'careful creeping',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  16: {'desc': 'laying down, getting up, careful ready pose',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  17: {'desc': 'laying down, getting up, careful ready pose',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  18: {'desc': 'laying down on back, getting up, careful ready pose',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  19: {'desc': 'limping, hurt right leg',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  20: {'desc': 'limping, hurt right leg',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  21: {'desc': 'stretching',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  22: {'desc': 'limping, hurt right leg',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  23: {'desc': 'limping, hurt right leg',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  24: {'desc': 'limping, hurt right leg',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  25: {'desc': 'careful walk and search',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  26: {'desc': 'careful walk and search',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  27: {'desc': 'careful walk and search',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  28: {'desc': 'careful walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  29: {'desc': 'creeping walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  30: {'desc': 'creeping walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  31: {'desc': 'silent walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  32: {'desc': 'creeping walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  33: {'desc': 'creeping with limp',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  34: {'desc': 'creep and pause, repeat',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60}}},
- 78: {'desc': 'walking',
-      'motions': {1: {'desc': 'LeftTightTurn         CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'RightWideTurn            CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'LeftWideTurn     CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'SuperTightLeft        CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'SuperTightRight         CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'RunningStraight       CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'RunningWideRight       CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'RunningWideLeft      CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'RunningTigherLeft      CleanedGRS',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'RunningTighterRight      CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'calibration',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'RunningNoBall     CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'OffensiveMoveSpinLeft            CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'OffensiveMoveSpinLeft      CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'OffensiveMoveGoRight     CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'OffensiveMoveGoLeft         CleanedGRs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'OffensiveMoveSpinRight             CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'WalkEvasiveLeft      CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'WalkEvasiveRight              CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'FeintLeftMoveRight            CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'FeintRightMoveLeft      CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'FakeShotBreakRight     CleanedGRs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'FakeShotBreakLeft            CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'DefensiveStraightNoStop          CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'DefensiveStraightWithStop          CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'DefensiveRightStopToStop           CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'DefensiveLeftStopToStop              CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'DefensiveMoveZigZag           CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'DefensiveMoveSideToSide           CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'DefensiveMoveSideToSide           CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'Pivoting     CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'SraightDriveFromStop          Cleaned GRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'RightDrive (left then right)    Cleaned GRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'LeftDrive (right then left)    Cleaned GRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'RightTightTurn    CleanedGRS',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 79: {'desc': 'actor everyday activities',
-      'motions': {1: {'desc': 'chopping wood',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'swimming',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'swimming',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'digging',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'sewing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'hand shake',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'lost marker',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'boxing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  9: {'desc': 'slicing bread',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'chopping onions',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'Subject calibration',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'eating dinner',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'mixing batter',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'making dough',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'eating a sandwich',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  16: {'desc': 'buying something',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  17: {'desc': 'playing violin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  18: {'desc': 'playing drums',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  19: {'desc': 'playing piano',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  20: {'desc': 'hanging a picture',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  21: {'desc': 'putting on a pull over',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  22: {'desc': 'range of motion',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  23: {'desc': 'putting on a jacket',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  24: {'desc': 'putting on button up sweater',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  25: {'desc': 'moving heavy box',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  26: {'desc': 'planting a tree',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  27: {'desc': 'planting a plant',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  28: {'desc': 'putting on a ball cap',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  29: {'desc': 'putting on a dress',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  30: {'desc': 'pushing a swing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  31: {'desc': 'writing on a chalkboard',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  32: {'desc': 'writing on a chalkboard',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  33: {'desc': 'chug a beer',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  34: {'desc': 'fishing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  35: {'desc': 'fishing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  36: {'desc': 'answering the phone',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  37: {'desc': 'dialing phone',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  38: {'desc': 'drinking water',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  39: {'desc': 'sipping martinee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  40: {'desc': 'drinking a soda',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  41: {'desc': 'sipping coffee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  42: {'desc': 'eating soup',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  43: {'desc': 'painting',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  44: {'desc': 'washing a window',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  45: {'desc': 'bear',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  46: {'desc': 'bear',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  47: {'desc': 'chicken',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  48: {'desc': 'elephant',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  49: {'desc': 'monkey',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  50: {'desc': 'mouse',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  51: {'desc': 'chipmunk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  52: {'desc': 'prairie dog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  53: {'desc': 'dog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  54: {'desc': 'snake',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  55: {'desc': 'sweeping',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  56: {'desc': 'T-rex',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  57: {'desc': 'fish',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  58: {'desc': 'bird',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  59: {'desc': 'cat',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  60: {'desc': 'chicken',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  61: {'desc': 'cow',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  62: {'desc': 'chicken',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  63: {'desc': 'tiger',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  64: {'desc': 'penguin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  65: {'desc': 'horse',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  66: {'desc': 'movie and trial dont match',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  67: {'desc': 'no movie',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 60},
-                  68: {'desc': 'cold',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  69: {'desc': 'very happy',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  70: {'desc': 'laughing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  71: {'desc': 'sad',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  72: {'desc': 'crying',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  73: {'desc': 'scared',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  74: {'desc': 'upset',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  75: {'desc': 'channel surfing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  76: {'desc': 'driving',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  77: {'desc': 'vacuuming',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  78: {'desc': 'taking a movie',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  79: {'desc': 'putting on headphones',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  80: {'desc': 'using a palm pilot',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  81: {'desc': 'brushing teeth',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  82: {'desc': 'putting on deoderant',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  83: {'desc': 'shaving',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  84: {'desc': 'combing hair',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  85: {'desc': 'typing on a laptop',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  86: {'desc': 'shooting bow and arrow',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  87: {'desc': 'raking',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  88: {'desc': 'swatting at a fly',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  89: {'desc': 'holding a baby',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  90: {'desc': 'washing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  91: {'desc': 'football',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  92: {'desc': 'frisbee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  93: {'desc': 'weight lifting',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  94: {'desc': 'flexing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  95: {'desc': 'rowing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  96: {'desc': 'shooting a gun',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60}}},
- 80: {'desc': 'assorted motions',
-      'motions': {1: {'desc': 'shaking hands',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'chopping onions',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'shooting a gun',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'sewing',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'digging a hole',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'paying for something',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'hanging picture',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'picking up something',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  9: {'desc': 'planting a flower',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'boxing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'putting on a sweater',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  12: {'desc': 'fishing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  13: {'desc': 'drumming',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  14: {'desc': 'teaching',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  15: {'desc': 'putting on a coat',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  16: {'desc': 'mixing batter',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  17: {'desc': 'hand mixing dough',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  18: {'desc': 'vacuuming',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  19: {'desc': 'pushing broom',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  20: {'desc': 'planting',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  21: {'desc': 'pushing swing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  22: {'desc': 'putting on a hat',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  23: {'desc': 'putting on a skirt',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  24: {'desc': 'eating',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  25: {'desc': 'answering a phone',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  26: {'desc': 'dialing phone',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  27: {'desc': 'setting glass of water',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  28: {'desc': 'drinking and smoking',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  29: {'desc': 'chugging',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  30: {'desc': 'range of motion',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  31: {'desc': 'making coffee',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  32: {'desc': 'slicing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  33: {'desc': 'eating soup',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  34: {'desc': 'rake leaves',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  35: {'desc': 'putting on headphones',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  36: {'desc': 'violin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  37: {'desc': 'TV',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  38: {'desc': 'driving',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  39: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  40: {'desc': 'drinking from bottle',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  41: {'desc': 'freezing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  42: {'desc': 'freezing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  43: {'desc': 'happy',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  44: {'desc': 'laughing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  45: {'desc': 'crying',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  46: {'desc': 'crying',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  47: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  48: {'desc': 'arguing',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  49: {'desc': 'gorilla',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  50: {'desc': 'cleaning window',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  51: {'desc': 'chicken',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  52: {'desc': 'dog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  53: {'desc': 'elephant',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  54: {'desc': 'monkey',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  55: {'desc': 'mouse',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  56: {'desc': 'chip monk',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  57: {'desc': 'prairie dog',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  58: {'desc': 'snake',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  59: {'desc': 'panther',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  60: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  61: {'desc': 'sweeping',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  62: {'desc': 'bird',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  63: {'desc': 'chicken',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  64: {'desc': 'cat',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  65: {'desc': 'fish',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  66: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  67: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  68: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  69: {'desc': 'painting',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  70: {'desc': 'piano',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  71: {'desc': 'chopping wood',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  72: {'desc': 'swimming',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  73: {'desc': 'shaking hands',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60}}},
- 81: {'desc': 'pushing a box; jumping off a ledge; walks',
-      'motions': {1: {'desc': 'fix hair and walk forward',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk forward',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walk',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walk at a brisk pace',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'push heavy object',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'push heavy box',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'pull heavy object',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'drag heavy object',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'drag heavy object',
-                      'files': ['tvd', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'push object that is high in air',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'push object that is high in air',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'jump backwards off ledge',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'jump backwards off ledge',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'climb backwards off ledge',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'climb backwards off ledge',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'walk forward',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'adjust hair walk forward',
-                       'files': ['tvd', 'amc', 'avi'],
-                       'fps': 120}}},
- 82: {'desc': 'jumping; pushing; emotional walks',
-      'motions': {1: {'desc': 'Static pose',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'Jump off ledge',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'Jump off ledge',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'Jump off ledge',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'sitting on ground relaxing',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'Pushing on heavy object',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'Pushing on heavy object',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'stand still; casual walk forward',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'confident walk forward',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'sad walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'normal walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'happy or fast walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'normal walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'walk forward and slow down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'walk forward and turn sideways',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'bang on high object',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'bang on high object',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'static pose',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 83: {'desc': 'steps',
-      'motions': {1: {'desc': 'large sidestep to right',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'sidestep to the right and up a ledge',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'large step to a short ledge',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'large sidestep to right',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'very large sidestep to right',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'very large sidestep to right and down',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'short sidestep to right and down',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'medium step forward and down',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'short step forward and down',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'medium step forward and down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'static pose',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'medium sidestep to right and down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'large sidestep to right',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'short sidestep to left and down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'short step forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'medium sidestep to left and down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'medium step to left and down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'short step to left and forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'medium sidestep to left',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'medium step forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'large step to left and forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'stretching',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'short sidestep to left and up',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'medium step to left and up',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'short step forward and up',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'medium step to left, forward, and up',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'walk forward stepping up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'walk forward stepping up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'walk forward stepping up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'walk forward stepping up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'walk forward stepping up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'walk forward stepping up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'sidestep to right then back to left',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'walk forward and up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'walk forward and stepping up stairs',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'walk forward turn 90 degrees left walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  37: {'desc': 'walk forward turn 90 degrees right walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  38: {'desc': 'walk forward turn 90 degrees left walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  39: {'desc': 'walk forward turn 90 degrees right walk forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  40: {'desc': 'hop forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  41: {'desc': 'hop forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  42: {'desc': 'long jump forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  43: {'desc': 'long jump forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  44: {'desc': 'medium step forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  45: {'desc': 'hop forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  46: {'desc': 'medium hop forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  47: {'desc': 'long jump forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  48: {'desc': 'short hop forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  49: {'desc': 'medium hop forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  50: {'desc': 'long jump forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  51: {'desc': 'hop turn 90 degrees left in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  52: {'desc': 'hop turn 90 degrees left in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  53: {'desc': 'hop turn 90 degrees left in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  54: {'desc': 'hop turn 180 degrees left in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  55: {'desc': 'medium sidestep to right',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  56: {'desc': 'hop turn left 180 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  57: {'desc': 'hop turn left 180 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  58: {'desc': 'hop turn left 270 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  59: {'desc': 'hop turn left 270 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  60: {'desc': 'hop turn left 270 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  61: {'desc': 'hop turn 360 degrees left in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  62: {'desc': 'hop turn left 360 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  63: {'desc': 'large sidestep to right and forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  64: {'desc': 'hop and turn right 360 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  65: {'desc': 'hop and turn right 360 degrees in air',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  66: {'desc': 'short sidestep to right',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  67: {'desc': 'short sidestep to the right',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  68: {'desc': 'medium sidestep to right',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 85: {'desc': 'jumps; flips; breakdance',
-      'motions': {1: {'desc': 'JumpTwist',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'JumpTwist',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'UpRightSequence',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'FancyFootWork',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'HandStandKicks',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'KickFlip',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'KickFlipStumble',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'Helicopter',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'motorcycle pose',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'EndofBreakDance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'UpRightSequence',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'LongSequenceGood',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'BadStartSequnce',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'BreakSequencewithFlips',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': '90TwistsFall',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 86: {'desc': 'sports and various activities',
-      'motions': {1: {'desc': 'jumps kicks and punches',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'walk, squats, run, stretch, jumps, punches, and drinking',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'walking, running, jumping, kicking, and stretching',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'walking, stretching, punching, chopping, and drinking',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'walking, jumping, jumping jacks,  jumping on one foot, punching, chopping,',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'walking, running, kicking, punching, knee kicking, and stretching',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'walking, swinging arms, stretching, jumping on one leg, and jumping',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'walking, squats, stretching, kicking, and punching',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'walking, sitting, looking, stand up',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'walk around, sit, stand up, and running',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'walking, stretching, walking and turning',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'walking, dragging, sweeping, dustpan, wipe window, and wipe mirror',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'walking around, walk up ladder, step down ladder',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'bouncing basketball, shooting basketball, dribble basketball, two handed dribble',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'walking, sitting, hand motions',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 87: {'desc': 'acrobatics',
-      'motions': {1: {'desc': 'Jump with kick and spin',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'T-Pose',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'Backflip',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'backflip',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'cartwheels',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60}}},
- 88: {'desc': 'acrobatics',
-      'motions': {1: {'desc': 'backflip',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'backflips, jump onto platform, handstands, vertical pushups',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'motorcycle pose',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'stretches, cartwheels, flips, spin kicks, spins, and fall',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'cartwheel into backflip',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'jump and spin kick',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  7: {'desc': 'cartwheel',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  8: {'desc': 'crouch and flip backward on hands',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  9: {'desc': 'stretch and cartwheel',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  10: {'desc': 'stretch and spin',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60},
-                  11: {'desc': 'stretches and jumps',
-                       'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                       'fps': 60}}},
- 89: {'desc': 'acrobatics',
-      'motions': {1: {'desc': 'balance object on forehead',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  2: {'desc': 'motorcycle pose',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  3: {'desc': 'flip and stand on one hand',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  4: {'desc': 'spins, flips, stand on one hand',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  5: {'desc': 'spin upside down, handstand, flips',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60},
-                  6: {'desc': 'balance beam',
-                      'files': ['tvd', 'c3d', 'amc', 'mpg', 'avi'],
-                      'fps': 60}}},
- 90: {'desc': 'cartwheels; acrobatics; dances',
-      'motions': {1: {'desc': 'bkwd summersult',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'cartwheel',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'cartwheel',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'cartwheel',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'jump kick',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'jump kick',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'jump kick',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'side flip',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'Flip forward onto hands and back again',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                  11: {'desc': 'hand spring',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'bck flp twst fall',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'bck flp twst fall',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'front hand flip',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'front hand flip',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'fall on face',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'BannanaPeelSlip',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'RugPullFall',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'monkey backflip',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'monkey sequence',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'monkey sequence',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'straight walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'straight walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'ball mount',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'fwd ball walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'fwd ball walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'bwk ball walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'breakdance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'sequesnce',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'russian dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'russian dance',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'moonwalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'arm up wide leg roll',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'wide leg roll',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'wide leg roll',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'wide leg roll',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 91: {'desc': 'walks and turns',
-      'motions': {1: {'desc': 'Walk digital figure eight',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'WalkStraight',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'Walk figure eight',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'Walking',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'Mummy Walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'Motorcycle Pose',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'mummy8',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'mummyDigital8',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': 'DrunkWalk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': 'SlowWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': 'LavishWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': 'TooCoolWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': 'SadWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': 'DepressedWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': 'ClumsyWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': 'Limp',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  17: {'desc': 'QuickWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  18: {'desc': 'CarefulWalk LookingAround',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  19: {'desc': 'March',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  20: {'desc': 'ShyWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  21: {'desc': 'acheyWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  22: {'desc': 'CasualQuickWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  23: {'desc': 'CoolWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  24: {'desc': 'HurtLegWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  25: {'desc': 'DragBadLegWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  26: {'desc': 'HurtStomachWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  27: {'desc': 'SlowWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  28: {'desc': 'GhettoWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  29: {'desc': 'NormalWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  30: {'desc': 'SexyWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  31: {'desc': 'NormalWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  32: {'desc': 'ScaredWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  33: {'desc': 'MachoWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  34: {'desc': 'NormalWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  35: {'desc': 'TrafficWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  36: {'desc': 'WalkStraight',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  37: {'desc': 'Forward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  38: {'desc': 'SmallForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  39: {'desc': 'JumpForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  40: {'desc': 'JumpForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  41: {'desc': 'JumpForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  42: {'desc': 'JumpForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  43: {'desc': 'JumpSmallForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  44: {'desc': 'JumpSmallForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  45: {'desc': 'JumpForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  46: {'desc': 'Jump Turn',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  47: {'desc': 'Jump Turn',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  48: {'desc': 'JumpTurn',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  49: {'desc': 'Jump Turn',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  50: {'desc': 'JumpTurn',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  51: {'desc': 'FurtherJumpTurn',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  52: {'desc': 'SmallJumpTurn',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  53: {'desc': '180 degree jump',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  54: {'desc': '180',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  55: {'desc': '180',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  56: {'desc': '90',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  57: {'desc': 'WalkForward',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  58: {'desc': '270',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  59: {'desc': '360 smallStumble',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  60: {'desc': '360',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  61: {'desc': '360',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  62: {'desc': 'walkFigure8',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 93: {'desc': 'Charleston Dance',
-      'motions': {1: {'desc': 'Motorcycle Pose',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': 'rangeOfMotion',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': 'charleston_01',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': 'charleston_side_by_side_female',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': 'charleston_side_by_side_male',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': 'lindyHop2',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': 'Casual Walk',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': 'xtra fancY charleston',
-                      'files': ['tvd', 'c3d', 'amc', 'avi'],
-                      'fps': 120}}},
- 94: {'desc': 'indian dance',
-      'motions': {1: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  2: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  3: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  4: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  5: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  6: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  7: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  8: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  9: {'desc': '',
-                      'files': ['c3d', 'amc', 'avi'],
-                      'fps': 120},
-                  10: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  11: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  12: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  13: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  14: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  15: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                  16: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 102: {'desc': 'Basketball',
-       'motions': {1: {'desc': 'RightWideTurn',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   2: {'desc': 'LeftWideTurn',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   3: {'desc': 'SuperTightLeft',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   4: {'desc': 'SuperTightRight',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   5: {'desc': 'RunningStraight',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   6: {'desc': 'RunningWideRight',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   7: {'desc': 'RunningWideLeft',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   8: {'desc': 'RunningTighterRight',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   9: {'desc': 'calibration',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   10: {'desc': 'RunningNoBall',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   11: {'desc': 'OffensiveMoveSpinLeft',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   12: {'desc': 'OffensiveMoveSpinLeft',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   13: {'desc': 'OffensiveMoveGoRight',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   14: {'desc': 'OffensiveMoveGoLeft',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   15: {'desc': 'OffensiveMoveSpinRight',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   16: {'desc': 'WalkEvasiveLeft',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   17: {'desc': 'WalkEvasiveRight',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   18: {'desc': 'FeintLeftMoveRight',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   19: {'desc': 'FeintRightMoveLeft',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   20: {'desc': 'FakeShotBreakRight',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   21: {'desc': 'FakeShotBreakLeft',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   22: {'desc': 'DefensiveStraightNoStop',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   23: {'desc': 'DefensiveStraightWithStop',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   24: {'desc': 'DefensiveRightStopToStop',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   25: {'desc': 'DefensiveLeftStopToStop',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   26: {'desc': 'DefensiveMoveZigZag',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   27: {'desc': 'DefensiveMoveSideToSide',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   28: {'desc': 'DefensiveMoveSideToSide',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   29: {'desc': 'Pivoting',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   30: {'desc': 'SraightDriveFromStop',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   31: {'desc': 'RightDrive (left then right)',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   32: {'desc': 'LeftDrive (right then left)',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   33: {'desc': 'RightTightTurn',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120}}},
- 103: {'desc': 'Charelston Dancing',
-       'motions': {1: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'rangeOfMotion_01',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'charleston_01',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'charleston_side_by_side_female',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'charleston_side_by_side_male',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'lindyHop2',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Casual Walk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'xtra fancY charleston',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 104: {'desc': 'motion',
-       'motions': {1: {'desc': 'JogThrough',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'neutral Male walk, exact footfalls',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Frankenstein male walk, exact footfalls',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'JogThrough',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'StartJog',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'StartJog',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'JogStop',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'JogStop',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'HappyGoLuckWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'ExcitedWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'StumbleWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'HappyStartWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'SpasticWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'SpasticStop',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'SpasticStop',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'CasualWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'RegularWalk8',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'RegularWalkRightAngleTurns',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'SternWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'SternWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'SternWalk8',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'SternWalkRightAngleTurns',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'SlowWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'SlowWalk8',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'RunThrough',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'SlowWalkRightAngleTurns',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'ZombieWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   42: {'desc': 'ZombieWalk8',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   43: {'desc': 'ZombieWalkRightAngleTurns',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   44: {'desc': 'AttitudeWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   45: {'desc': 'AttitudeWalk8',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   46: {'desc': 'AttitudeWalkRightAngleTurns',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   47: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   48: {'desc': 'RunThrough',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   49: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   50: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   51: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   52: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   53: {'desc': 'StartRun',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   54: {'desc': 'StartRun',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   55: {'desc': 'StartRun',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   56: {'desc': 'RunStop',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   57: {'desc': 'RunStop',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 105: {'desc': 'motion',
-       'motions': {1: {'desc': 'WalkDigital8',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'WalkStraight',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Walk8',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Digital8',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'mummyWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'MotorCyclePose',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'mummy8',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'mummyDigital8',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'DrunkWalk',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'SlowWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'LavishWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'TooCoolWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'SadWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'DepressedWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'ClumsyWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Limp',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'QuickWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'CarefulWalk LookingAround',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'March',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'ShyWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'acheyWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'CasualQuickWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'CoolWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'HurtLegWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'DragBadLegWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'HurtStomachWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'SlowWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'GhettoWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'NormalWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'SexyWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'NormalWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'ScaredWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'MachoWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'NormalWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'TrafficWalk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'WalkStraight',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'Forward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'SmallForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'JumpForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': 'JumpForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'JumpForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   42: {'desc': 'JumpForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   43: {'desc': 'JumpSmallForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   44: {'desc': 'JumpSmallForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   45: {'desc': 'JumpForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   46: {'desc': 'Jump Turn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   47: {'desc': 'Jump Turn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   48: {'desc': 'JumpTurn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   49: {'desc': 'Jump Turn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   50: {'desc': 'JumpTurn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   51: {'desc': 'FurtherJumpTurn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   52: {'desc': 'SmallJumpTurn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   53: {'desc': '180',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   54: {'desc': '180',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   55: {'desc': '180',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   56: {'desc': '90',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   57: {'desc': 'WalkForward',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   58: {'desc': '270',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   59: {'desc': '360 smallStumble',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   60: {'desc': '360',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   61: {'desc': '360',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   62: {'desc': 'walkFigure8',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 106: {'desc': 'Female General Subject',
-       'motions': {1: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   2: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   3: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   4: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   5: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   6: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   7: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   8: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   9: {'desc': 'clean',
-                       'files': ['tvd', 'c3d', 'amc'],
-                       'fps': 120},
-                   10: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   11: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   12: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   13: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   14: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   15: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   16: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   17: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   18: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   19: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   20: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   21: {'desc': 'bad AMC',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   22: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   23: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   24: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   25: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   26: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   27: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   28: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   29: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   30: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   31: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   32: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   33: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120},
-                   34: {'desc': 'clean',
-                        'files': ['tvd', 'c3d', 'amc'],
-                        'fps': 120}}},
- 107: {'desc': 'Walking with obstacles 1',
-       'motions': {1: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': '',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': '',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 108: {'desc': 'Walking with obstacles 2',
-       'motions': {1: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': '',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 111: {'desc': 'Pregnant Woman',
-       'motions': {1: {'desc': 'Walk backwards',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Bow',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Crawling',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Curtsey',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Dance',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Get up from floor',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Get up from floor',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Get up from floor',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Get up from chair',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'get up from chair',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'get up from chair',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Lay down',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'March',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Mope',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Peekaboo',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Pick up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Pick up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Punch Kick',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Ring around the rosie',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Roll over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Range of motion',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Shrug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Walk sideways',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Walking up stairs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Standing still',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Stepping over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Stepping over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Stepping up / stepping down',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Stretch and yawn',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Throwing',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'Walk and carry',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'Wave',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'Yoga',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'Yoga',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': 'Yoga',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'Yoga',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 113: {'desc': 'Post pregnant woman',
-       'motions': {1: {'desc': 'Walk backwards',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Bow',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Curtsey',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Dance',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Walk digital 8',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Walk figure 8',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Lay down and get up',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'March',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Walk, mope around',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Peekaboo',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Punch and kick',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Ring around the rosie',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Sit in chair and get up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Shrug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Walk sideway',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Walk sideways',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Walking up and down stairs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Walk up and down stairs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Standing Still',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Step over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Stretch and yawn',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Throw',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Walk and carry',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Wave',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Yoga',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Yoga',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 114: {'desc': 'Pregnant Woman',
-       'motions': {1: {'desc': 'Motorcycle',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Getting up from laying down',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Range of motion',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Getting up from chair',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Sitting in chair',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Getting up from chair',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Walking up and down stairs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Walking up and down stairs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Walking up and down stairs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Stretching',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Laying down and getting up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Stretching',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Sit down and stretch',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 115: {'desc': 'Bending over',
-       'motions': {1: {'desc': 'Pick up box, bend from waist',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Pick box up, bend from waist',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Pick box up, bend from waist',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Pick box up, bend from waist',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Pick box up, bend from waist',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Picking box up, bending knees',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Picking box up, bending knees',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Picking box up, bending knees',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Picking box up, bending knees',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Pick box up, bend from waist',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 118: {'desc': 'Jumping',
-       'motions': {1: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Range of motion',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 120: {'desc': 'Various Style Walks',
-       'motions': {1: {'desc': 'Alien Turn',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Gorilla',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Mickey cast spell',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Mickey Conducting',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Mickey Dance',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Mickey Dance',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Mickey Dance',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Mickey sneaky walk',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Mickey sneaking walk',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Mickey sneaking walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Mickey sneaking walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Mickey sneaking walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Mickey sneaking walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Mickey sneaking walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Mickey Surprised',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Mickey Surprised',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Mickey Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Mickey Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Walk slow',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Robot',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Zombie',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 122: {'desc': 'Varying Height and Length Steps',
-       'motions': {1: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'clean',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': '',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   42: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   43: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   44: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   45: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   46: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   47: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   48: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   49: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   50: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   51: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   52: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   53: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   54: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   55: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   56: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   57: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   58: {'desc': 'cleaned',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   59: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   60: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   61: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   62: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   63: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   64: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   65: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   66: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   67: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   68: {'desc': 'clean',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 123: {'desc': 'Carry Suitcase with Varying Weights',
-       'motions': {1: {'desc': '15.5 lbs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': '15.5 lbs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': '19.5lb',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': '19.5 lbs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': '19.5 lbs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': '19.5 lbs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': '12.5lb',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': '12.5 lbs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': '12.5 lbs',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': '12.5lb',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': '15.5 lbs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': '15.5 lbs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': '15.5 lbs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 124: {'desc': 'Sports Related Motions',
-       'motions': {1: {'desc': 'Baseball Pitch',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Baseball Pitch',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Basketball Shoot',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Basketball Free Throw',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Basketball Jump Shot',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Basketball Lay Up',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Baseball Swing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Baseball Bunt',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Frisbee',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': '2 Foot Jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Underhand Toss',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Underhand Fast Pitch',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 125: {'desc': 'Swimming',
-       'motions': {1: {'desc': 'Breast Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Breast Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Break Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Breast Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Butterfly',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Free Style',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Motorcycle',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 126: {'desc': 'Swimming 2',
-       'motions': {1: {'desc': 'Back Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Back Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Breast Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Breast Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Breast Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Fly Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Fly Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Fly Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Fly Stroke',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Free Style',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Free Style',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Free Style',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Range of Motion',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 127: {'desc': 'Action Adventure Obstacles, running, jumping, ducking, rolling',
-       'motions': {1: {'desc': 'Motorcycle',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Range of Motion',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Walk to Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Run to Quick Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Run Right',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Run Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Run Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Run Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Run Side Step Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Run Side Step Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Run Turn Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Run Turn Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Run Stop Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Run Stop Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Run Quick Stop Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Run Quick Stop Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Run Jump Stop Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Run Jump Stop Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Run Dive Over Roll Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Run Dive Over Roll Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Run Jump Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Run Jump Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Run Jump Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Run Jump Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Run Duck Underneath',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Run Duck Underneath',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Run Duck Underneath',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Run Duck Underneath',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Run Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Run Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'Run Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'Run Over',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'Run Duck Underneath',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'Run Duck Underneath',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 128: {'desc': 'Action Adventure Motions running, ducking, rolling, stopping',
-       'motions': {1: {'desc': 'Motorcycle',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Run Left',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Run Right',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Run Duck Underneath',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Run Stop Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Run Stop Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Run Stop Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Run Stop Run',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Run Roll Underneath',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Run Dive Over Roll Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Run Dive Over Roll Run',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 131: {'desc': 'Michael Jackson Styled Motions',
-       'motions': {1: {'desc': 'Start Walk Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Start Walk Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Start Hop Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Start Hop Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Start Duck Underneath Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Start Duck Underneath Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Jump Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Jump Stop',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Start Walk Left',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Start Walk Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Start Walk Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Start Walk Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Start Walk Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Start Walk Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 132: {'desc': 'Varying Weird Walks',
-       'motions': {1: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Walk With Arms Out,  balancing',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Walk With Arms Out,  balancing',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Walk With Arms Out,  balancing',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Walk With Arms Out,  balancing',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Walk Backwards',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Walk Duck Footed',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Walk With Knees Bent',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Walk Crossover',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Walk Fast',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Walk Fast',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Walk Fast',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Walk Fast',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Walk Fast',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Walk Fast',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Hop on left foot',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Hop on left foot',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Hop on left foot',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Hop on left foot',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Hop on left foot',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Hop on left foot',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Bouncy Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Bouncy Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Bouncy Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Bouncy Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Bouncy Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Bouncy Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'Walk Leaning To The Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'Walk Leaning To The Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'Marching',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'Pigeon Toed Walking',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': 'Walk With Stiff Arms',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'Walk With Stiff Arms',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   42: {'desc': 'Walk Swinging Shoulders',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   43: {'desc': 'Walk Swinging Shoulders',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   44: {'desc': 'Walk Swinging Shoulders',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   45: {'desc': 'Walk Slow',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   46: {'desc': 'Walk Slow',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   47: {'desc': 'Walk Slow',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   48: {'desc': 'Walk Slow',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   49: {'desc': 'Walk Slow',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   50: {'desc': 'Walk Slow',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   51: {'desc': 'Tpose',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   52: {'desc': 'Range of Motion',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   53: {'desc': 'Walk With Legs Apart',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   54: {'desc': 'Walk With Wild Arms',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   55: {'desc': 'Walk With Wild Legs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   56: {'desc': 'Walk With Wild Legs',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 133: {'desc': 'Baby Styled Walk',
-       'motions': {1: {'desc': 'Walk Crawl',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Walk Crawl',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Walk Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Walk Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Walk Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Walk Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Walk Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Stretch Walk',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Stretch Walk',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Stretch Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Walk Stop Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Walk Stop Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Walk Stop Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Walk Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Walk Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Walk Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Walk Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Walk Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Walk Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Walk Right',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Walk ZigZag',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Range of Motion',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 134: {'desc': 'Skateboard Motions',
-       'motions': {1: {'desc': 'Duck Under',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Go Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Lean Turn Right',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Motorcycle',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Pump Jump',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Push Turn Left',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Push Turn Left',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Push Turn Right',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Push Turn Right',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Start',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Start',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Stop and Go',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Stop and Go',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Stop ang Go',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Lean Turn Left',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 135: {'desc': 'Martial Arts Walks',
-       'motions': {1: {'desc': 'Bassai',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Empi',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Empi',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Front Kick',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Gedanbarai',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Heiansyodan',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Mawashigeri',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Motorcycle',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Oiduki',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Syutouuke',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Yokogeri',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 136: {'desc': 'Weird Walks',
-       'motions': {1: {'desc': 'Walk Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Walk Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Walk Backwards Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Walk Backwards Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Walk on Toes Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Walk on Toes Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Walk Backward on Toes Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Walk Backward on Toes Bent Forward',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Walk Crouched',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Walk Crouched',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Walk Backwards Crouched',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Walk Backwards Crouched',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Walk on Toes Crouched',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Walk on Toes Crouched',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Walk Backwards on Toes Crouched',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Walk Backwards on Toes Crouched',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Flamingo, lift legs high',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Flamingo, lift legs high',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Motorcycle',
-                        'files': ['amc', 'avi'],
-                        'fps': 60},
-                   20: {'desc': 'Normal Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Normal Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Normal Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Normal Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Normal Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Normal Walk Backwards',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Normal Walk Backwards',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Walk on Toes',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Walk on Toes',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Walk Backwards on Toes',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Walk Backwards on Toes',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Quail, quick little steps',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Quail, quick little steps',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Range of Motion',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 137: {'desc': 'Stylized Motions',
-       'motions': {1: {'desc': 'Cat Coffee Mug',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Cat Pick Up',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Cat Wait',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Cat Walk',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Chicken Coffee Mug',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Chicken Pick Up',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Chicken Wait',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Chicken Walk',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Dinosaur Coffee Mug',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Dinosaur Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Dinosaur Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Dinosaur Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Drunk Coffee Mug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Drunk Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Drunk Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Drunk Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Gangly Teen Coffee Mug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Gangly Teen Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Gangly Teen Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Gangly Teen Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Graceful Lady Coffee Mug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Graceful Lady Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Graceful Lady Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Graceful Lady Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Motorcycle',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Normal Coffee Mug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Normal Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Normal Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Normal Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Old Man Coffee Mug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Old Man Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Old Man Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Old Man Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Range of Motion',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'Sexy Lady Coffee Mug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'Sexy Lady Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'Sexy Lady Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'Sexy Lady Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'Strong Man Coffee Mug',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': 'Strong Man Pick Up',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'Strong Man Wait',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   42: {'desc': 'Strong Man Walk',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 138: {'desc': 'Marching, Walking and Talking',
-       'motions': {1: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Marching',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Marching',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   42: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   43: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   44: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   45: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   46: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   47: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   48: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   49: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   50: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   51: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   52: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   53: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   54: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   55: {'desc': 'Story',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 139: {'desc': 'Action Walks, sneaking, wounded, looking around',
-       'motions': {1: {'desc': 'Looking Around',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Shifting Weight',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Looking Around',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Looking Around',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Pulling a Gun',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Poking Around On The Ground',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Poking Around On The Ground',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Poking Around On The Ground',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Ducking',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Run',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Run To Sneak',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Run in Circles',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Run in Circles',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Sneak Sideways',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Sneak Sideways',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Get Up From Ground',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Get Up From Ground',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Get Up From Ground Laying on Back',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Walk Wounded Leg',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Walk Wounded Leg',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Range Of Motion',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Walk Wounded Leg',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Walk Wounded Leg',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Walk Wounded Leg',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Giving Directions',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Looking Around',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Looking Around',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Walking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Sneaking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Walking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Sneaking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Sneaking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Sneaking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Sneaking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 140: {'desc': 'Getting Up From Ground',
-       'motions': {1: {'desc': 'Get Up Face Down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Get Up Face Down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Get Up Laying on Side',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Get Up Laying on Side',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Motorcycle',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Idle',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Idle',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Get Up From Ground Laying on Back',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Get Up From Ground Laying on Back',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120}}},
- 141: {'desc': 'General Subject Capture',
-       'motions': {1: {'desc': 'Run',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Run',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Run',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Jump Distances',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Jump Sideways',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Jump Twist',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Walk Up and Over',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Steop On Walk Down',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Step Over',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Toss and Catch',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Throw and Catch',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Dance, Twist',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Stretch and Yawn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Punch and Kick',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Range of Motion',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Wave Hello',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Sit on Stool',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Peek a Boo',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Walk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Waiting',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Shrug',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'High Five',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Shake Hands',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Around the world High Five Low',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Walk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Curtsey',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Mope',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Slap Hands, Throw it Back',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Random Walk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Random Walk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Walk Backwards',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Walk Sideways, Cross Legs',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Walk Sideways, Foot to Foot',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Run',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 142: {'desc': 'Stylized Walks',
-       'motions': {1: {'desc': 'Childish',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Clumsy',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Clumsy',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Cool',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Depressed',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Elated',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Elderlyman',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Happy',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Joy',
-                       'files': ['c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Lavish',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Marching',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Painfulleftknee',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Relaxed',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Rushed',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Sad',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Scared',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Scared',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Sexy',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Shy',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Singing in the rain jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Singing in the rain jump',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Sneaky',
-                        'files': ['c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 143: {'desc': 'General Subject Capture',
-       'motions': {1: {'desc': 'Run',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   2: {'desc': 'Run to Stop',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   3: {'desc': 'Start to Run',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   4: {'desc': 'Run Figure 8',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   5: {'desc': 'Jumping Distances',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   6: {'desc': 'Jumping Heights',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   7: {'desc': 'Jumping Sideways',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   8: {'desc': 'Jumping Twists',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   9: {'desc': 'Jumping Twists',
-                       'files': ['tvd', 'c3d', 'amc', 'avi'],
-                       'fps': 120},
-                   10: {'desc': 'Walk And Pick up Tool Box',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   11: {'desc': 'Walk And Pick up Box',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   12: {'desc': 'Walk And Pick up Toolbox',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   13: {'desc': 'Walk and Pick up Laundry Basket',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   14: {'desc': 'Walk And Step Over',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   15: {'desc': 'Walk And Step Over',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   16: {'desc': 'Walk And Step Over',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   17: {'desc': 'Walk Up Stairs And Over',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   18: {'desc': 'Sit Down And Get Up',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   19: {'desc': 'Sit On Stool And Get Up',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   20: {'desc': 'Catch And Throw',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   21: {'desc': 'Range Of Motion',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   22: {'desc': 'Catch And Throw Football',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   23: {'desc': 'Punching',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   24: {'desc': 'Kicking',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   25: {'desc': 'Waving',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   26: {'desc': 'Washing Window',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   27: {'desc': 'Washing Window',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   28: {'desc': 'Sweeping, Push Broom',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   29: {'desc': 'Pacing',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   30: {'desc': 'Stretch And Yawn',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   31: {'desc': 'Hopscotch',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   32: {'desc': 'Walk',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   33: {'desc': 'Peek A Boo',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   34: {'desc': 'Chicken Dance',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   35: {'desc': 'Macarena Dance',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   36: {'desc': 'Airplane',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   37: {'desc': 'Climb Up And Down Ladder',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   38: {'desc': 'Walk Digital 8',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   39: {'desc': 'Walk Backwards',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   40: {'desc': 'Walk Sideways',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   41: {'desc': 'Sneak',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120},
-                   42: {'desc': 'Run',
-                        'files': ['tvd', 'c3d', 'amc', 'avi'],
-                        'fps': 120}}},
- 144: {'desc': 'punching female',
-       'motions': {1: {'desc': 'Cartwheels',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   2: {'desc': 'Cartwheels001',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   3: {'desc': 'Figure8s',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   4: {'desc': 'Figure8s001',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   5: {'desc': 'Front_Kicking',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   6: {'desc': 'Front_Kicking001',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   7: {'desc': 'Left_Blocks',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   8: {'desc': 'Left_Blocks001',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   9: {'desc': 'Left_Front_Kicking',
-                       'files': ['c3d', 'amc'],
-                       'fps': 120},
-                   10: {'desc': 'Left_Front_Kicking001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   11: {'desc': 'Left_Lunges',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   12: {'desc': 'Left_Lunges001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   13: {'desc': 'Left_Punch_Sequence001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   14: {'desc': 'Left_Punch_Sequence002',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   15: {'desc': 'Left_Spin_reach001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   16: {'desc': 'Left_Spin_reach002',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   17: {'desc': 'Lunges',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   18: {'desc': 'Lunges001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   19: {'desc': 'motorcycle pose',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   20: {'desc': 'Punch_Sequence',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   21: {'desc': 'Punch_Sequence001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   22: {'desc': 'Reach_Left001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   23: {'desc': 'Reach_Left002',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   24: {'desc': 'Reach_Right',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   25: {'desc': 'Reach_Right001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   26: {'desc': 'Right_Blocks',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   27: {'desc': 'Right_Blocks001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   28: {'desc': 'Right_Spin_reach',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   29: {'desc': 'Right_Spin_reach001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   30: {'desc': 'Sun Salutation',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   31: {'desc': 'Sun Salutation001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   32: {'desc': 'Sun Salutation002',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   33: {'desc': 'Walking',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120},
-                   34: {'desc': 'Walking001',
-                        'files': ['c3d', 'amc'],
-                        'fps': 120}}}}
-
-# End of Mocap Library
-
-if __name__ == '__main__':
-    # The following is the code that compiled the data above.
-    # If you execute this file it should output to stdout the exact same code.
-
-    import re
-    import os
-    from pprint import pformat
-    from urllib.request import urlopen
-
-    subjects_re = re.compile(
-        r"(?ms)909090.*?Subject\ \#(?P<subjno>\d+)\s+(?P<desc>[^<]*).*?"
-        r"(?P<subjskel>http.*?asf).*?BGCOLOR(?P<motionBlock>.*?)/TR>\n")
-    motions_re = re.compile(
-        r"(?ms)<TD>(?P<motno>\d+)</TD><TD>(?P<desc>[^<].*?)"
-        r"</TD>(?P<urls>.*?)<TD>(?P<fps>\d+)</TD>")
-    urls_re = re.compile('(http.*?)(...)"')
-    myself_re = re.compile(r"(?ms)(.*# Carnegie.*?\n).*?(# End of.*$)")
-
-    subjects = {}
-    if not os.path.exists("search.html"):
-        src = urlopen(search_url)
-        data = src.read()
-        with open("search.html", 'wb') as out:
-            out.write(data)
-    for match in subjects_re.finditer(open("search.html", 'rt').read()):
-        d = match.groupdict()
-        sub = subjects.setdefault(int(d['subjno']), {})
-        sub['desc'] = d['desc'][1:-2]
-        assert(d['subjskel'] == skeleton_url.format(int(d['subjno'])))
-        sub['motions'] = {}
-        for m2 in motions_re.finditer(d['motionBlock']):
-            d2 = m2.groupdict()
-            mot = sub['motions'].setdefault(int(d2['motno']), {})
-            mot['desc'] = d2['desc'].strip()
-            mot['fps'] = int(d2['fps'])
-            for u in urls_re.finditer(d2['urls']):
-                murl = motion_url.format(int(d['subjno']), int(d2['motno']))
-                assert(u.group(1) == murl)
-                mot.setdefault('files', []).append(u.group(2))
-
-    m = myself_re.match(open(__file__).read())
-    print("{0}\nsubjects={1}\n\n{2}".format(
-            m.group(1), pformat(subjects), m.group(2)), end='')
diff --git a/release/scripts/addons_contrib/cursor_control/__init__.py b/release/scripts/addons_contrib/cursor_control/__init__.py
deleted file mode 100644
index 7da634a..0000000
--- a/release/scripts/addons_contrib/cursor_control/__init__.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-
-# Blender Add-Ons menu registration (in User Prefs)
-bl_info = {
-    "name": "Cursor Control",
-    "author": "Morgan Mörtsell (Seminumerical)",
-    "version": (0, 7, 0),
-    "blender": (2, 59, 0),
-    "location": "View3D > Properties > Cursor",
-    "description": "Control the Cursor",
-    "warning": "buggy, may crash other addons", # used for warning icon and text in addons panel
-    "wiki_url": "http://blenderpythonscripts.wordpress.com/",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-                   "func=detail&aid=27253",
-    "category": "3D View"}
-
-
-
-import bpy
-
-# To support reload properly, try to access a package var, if it's there, reload everything
-if "local_var" in locals():
-    import imp
-    imp.reload(data)
-    imp.reload(ui)
-    imp.reload(operators)
-    imp.reload(history)
-    imp.reload(memory)
-else:
-    from cursor_control import data
-    from cursor_control import ui
-    from cursor_control import operators
-    from cursor_control import history
-    from cursor_control import memory
-
-local_var = True
-
-def register():
-    bpy.utils.register_module(__name__)
-    # Register Cursor Control Structure
-    bpy.types.Scene.cursor_control = bpy.props.PointerProperty(type=data.CursorControlData, name="")
-    bpy.types.Scene.cursor_history = bpy.props.PointerProperty(type=history.CursorHistoryData, name="")
-    bpy.types.Scene.cursor_memory  = bpy.props.PointerProperty(type=memory.CursorMemoryData, name="")
-    # Register menu
-    bpy.types.VIEW3D_MT_snap.append(ui.menu_callback)
-
-def unregister():
-    # Register menu
-    bpy.types.VIEW3D_MT_snap.remove(ui.menu_callback)
-    bpy.utils.unregister_module(__name__)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/cursor_control/data.py b/release/scripts/addons_contrib/cursor_control/data.py
deleted file mode 100644
index fcd82d1..0000000
--- a/release/scripts/addons_contrib/cursor_control/data.py
+++ /dev/null
@@ -1,120 +0,0 @@
-# -*- coding: utf-8 -*-
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-
-"""
-  TODO:
-
-      IDEAS:
-
-      LATER:
-
-      ISSUES:
-          Bugs:
-          Mites:
-
-      QUESTIONS:
-
-
-"""
-
-
-
-import bpy
-import bgl
-import math
-from mathutils import Vector, Matrix
-from mathutils import geometry
-from misc_utils import *
-from constants_utils import *
-from cursor_utils import *
-from ui_utils import *
-from geometry_utils import *
-
-
-PRECISION = 4
-
-
-class CursorControlData(bpy.types.PropertyGroup):
-    # Step length properties
-    stepLengthEnable = bpy.props.BoolProperty(name="Use step length",description="Use step length",default=0)
-    stepLengthMode = bpy.props.EnumProperty(items=[
-        ("Mode", "Mode", "Mode"),
-        ("Absolute", "Absolute", "Absolute"),
-        ("Proportional", "Proportional", "Proportional")],
-        default="Proportional")
-    stepLengthValue = bpy.props.FloatProperty(name="",precision=PRECISION,default=PHI)
-    # Property for linex result select...
-    linexChoice = bpy.props.IntProperty(name="",default=-1)
-    deltaVector = bpy.props.FloatVectorProperty(name="",precision=PRECISION,default=(1,0,0))
-
-    def hideLinexChoice(self):
-        self.linexChoice = -1
-
-    def cycleLinexCoice(self,limit):
-        qc = self.linexChoice + 1
-        if qc<0:
-            qc = 1
-        if qc>=limit:
-            qc = 0
-        self.linexChoice = qc
-  
-    def setCursor(self,v):
-        if self.stepLengthEnable:
-            c = CursorAccess.getCursor()
-            if((Vector(c)-Vector(v)).length>0):
-                if self.stepLengthMode=='Absolute':
-                    v = Vector(v)-Vector(c)
-                    v.normalize()
-                    v = v*self.stepLengthValue + Vector(c)
-                if self.stepLengthMode=='Proportional':
-                    v = (Vector(v)-Vector(c))*self.stepLengthValue + Vector(c)
-        CursorAccess.setCursor(Vector(v))
-        
-    def guiStates(self,context):
-        tvs = 0
-        tes = 0
-        tfs = 0
-        edit_mode = False
-        obj = context.active_object
-        if (context.mode == 'EDIT_MESH'):
-            if (obj and obj.type=='MESH' and obj.data):
-                tvs = obj.data.total_vert_sel
-
-                tes = obj.data.total_edge_sel
-                tfs = obj.data.total_face_sel
-                edit_mode = True
-        return (tvs, tes, tfs, edit_mode)
-
-    def invertDeltaVector(self):
-        self.deltaVector = Vector([0,0,0])-Vector(self.deltaVector)
-
-    def normalizeDeltaVector(self):
-        q = Vector(self.deltaVector)
-        q.normalize()
-        self.deltaVector = q
-
-    def addDeltaVectorToCursor(self):
-        c = CursorAccess.getCursor()
-        CursorAccess.setCursor(Vector(c)+Vector(self.deltaVector))
-
-    def subDeltaVectorToCursor(self):
-        c = CursorAccess.getCursor()
-        CursorAccess.setCursor(Vector(c)-Vector(self.deltaVector))
diff --git a/release/scripts/addons_contrib/cursor_control/history.py b/release/scripts/addons_contrib/cursor_control/history.py
deleted file mode 100644
index 14f354d..0000000
--- a/release/scripts/addons_contrib/cursor_control/history.py
+++ /dev/null
@@ -1,288 +0,0 @@
-# -*- coding: utf-8 -*-
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-
-"""
-  TODO:
-
-      IDEAS:
-
-      LATER:
-
-      ISSUES:
-          Bugs:
-              Seg-faults when unregistering addon...
-          Mites:
-            * History back button does not light up on first cursor move.
-              It does light up on the second, or when mouse enters the tool-area
-            * Switching between local and global view triggers new cursor position in history trace.
-            * Each consecutive click on the linex operator triggers new cursor position in history trace.
-                 (2011-01-16) Was not able to fix this because of some strange script behaviour
-                              while trying to clear linexChoice from addHistoryLocation
-
-      QUESTIONS:
-
-
-
-"""
-
-
-
-import bpy
-import bgl
-import math
-from mathutils import Vector, Matrix
-from mathutils import geometry
-from misc_utils import *
-from constants_utils import *
-from cursor_utils import *
-from ui_utils import *
-
-
-
-class CursorHistoryData(bpy.types.PropertyGroup):
-    # History tracker
-    historyDraw = bpy.props.BoolProperty(description="Draw history trace in 3D view",default=1)
-    historyDepth = 144
-    historyWindow = 12
-    historyPosition = [-1] # Integer must be in a list or else it can not be written to
-    historyLocation = []
-    #historySuppression = [False] # Boolean must be in a list or else it can not be written to
-
-    def addHistoryLocation(self, l):
-        if(self.historyPosition[0]==-1):
-            self.historyLocation.append(l.copy())
-            self.historyPosition[0]=0
-            return
-        if(l==self.historyLocation[self.historyPosition[0]]):
-            return
-        #if self.historySuppression[0]:
-            #self.historyPosition[0] = self.historyPosition[0] - 1
-        #else:
-            #self.hideLinexChoice()
-        while(len(self.historyLocation)>self.historyPosition[0]+1):
-            self.historyLocation.pop(self.historyPosition[0]+1)
-        #self.historySuppression[0] = False
-        self.historyLocation.append(l.copy())
-        if(len(self.historyLocation)>self.historyDepth):
-            self.historyLocation.pop(0)
-        self.historyPosition[0] = len(self.historyLocation)-1
-        #print (self.historyLocation)
-
-    #def enableHistorySuppression(self):
-        #self.historySuppression[0] = True
-
-    def previousLocation(self):
-        if(self.historyPosition[0]<=0):
-            return
-        self.historyPosition[0] = self.historyPosition[0] - 1
-        CursorAccess.setCursor(self.historyLocation[self.historyPosition[0]].copy())
-
-    def nextLocation(self):
-        if(self.historyPosition[0]<0):
-            return
-        if(self.historyPosition[0]+1==len(self.historyLocation)):
-            return
-        self.historyPosition[0] = self.historyPosition[0] + 1
-        CursorAccess.setCursor(self.historyLocation[self.historyPosition[0]].copy())
-
-
-
-class VIEW3D_OT_cursor_previous(bpy.types.Operator):
-    """Previous cursor location"""
-    bl_idname = "view3d.cursor_previous"
-    bl_label = "Previous cursor location"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_history
-        cc.previousLocation()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_next(bpy.types.Operator):
-    """Next cursor location"""
-    bl_idname = "view3d.cursor_next"
-    bl_label = "Next cursor location"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_history
-        cc.nextLocation()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_history_show(bpy.types.Operator):
-    """Show cursor trace"""
-    bl_idname = "view3d.cursor_history_show"
-    bl_label = "Show cursor trace"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_history
-        cc.historyDraw = True
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_history_hide(bpy.types.Operator):
-    """Hide cursor trace"""
-    bl_idname = "view3d.cursor_history_hide"
-    bl_label = "Hide cursor trace"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_history
-        cc.historyDraw = False
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_PT_cursor_history(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Cursor History"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(self, context):
-        # Display in object or edit mode.
-        cc = context.scene.cursor_history
-        cc.addHistoryLocation(CursorAccess.getCursor())
-        if (context.area.type == 'VIEW_3D' and
-            (context.mode == 'EDIT_MESH'
-            or context.mode == 'OBJECT')):
-            return 1
-
-        return 0
-
-    def draw_header(self, context):
-        layout = self.layout
-        cc = context.scene.cursor_history
-        if cc.historyDraw:
-            GUI.drawIconButton(True, layout, 'RESTRICT_VIEW_OFF', "view3d.cursor_history_hide", False)
-        else:
-            GUI.drawIconButton(True, layout, 'RESTRICT_VIEW_ON' , "view3d.cursor_history_show", False)
-
-    def draw(self, context):
-        layout = self.layout
-        sce = context.scene
-        cc = context.scene.cursor_history
-
-        row = layout.row()
-        row.label("Navigation: ")
-        GUI.drawIconButton(cc.historyPosition[0]>0, row, 'PLAY_REVERSE', "view3d.cursor_previous")
-        #if(cc.historyPosition[0]<0):
-            #row.label("  --  ")
-        #else:
-            #row.label("  "+str(cc.historyPosition[0])+"  ")
-        GUI.drawIconButton(cc.historyPosition[0]<len(cc.historyLocation)-1, row, 'PLAY', "view3d.cursor_next")
-
-        row = layout.row()
-        col = row.column()
-        col.prop(CursorAccess.findSpace(), "cursor_location")
-
-  
-                
-
-class VIEW3D_PT_cursor_history_init(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Register callback"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    initDone = False
-
-    @classmethod
-    def poll(cls, context):
-        if VIEW3D_PT_cursor_history_init.initDone:
-            return 0
-        print ("Cursor History draw-callback registration...")
-        sce = context.scene
-        if context.area.type == 'VIEW_3D':
-            for reg in context.area.regions:
-                if reg.type == 'WINDOW':
-                    # Register callback for SL-draw
-                    reg.callback_add(
-                        cursor_history_draw,
-                        (cls,context),
-                        'POST_PIXEL')
-                    VIEW3D_PT_cursor_history_init.initDone = True
-                    print ("Cursor History draw-callback registered")
-                    # Unregister to prevent double registration...
-                    # Started to fail after v2.57
-                    # bpy.types.unregister(VIEW3D_PT_cursor_history_init)
-        else:
-            print("View3D not found, cannot run operator")
-        return 0
-
-    def draw_header(self, context):
-        pass
-
-    def draw(self, context):
-        pass
-
-
-
-def cursor_history_draw(cls,context):
-    cc = context.scene.cursor_history
-
-    draw = 0
-    if hasattr(cc, "historyDraw"):
-        draw = cc.historyDraw
-
-    if(draw):
-        bgl.glEnable(bgl.GL_BLEND)
-        bgl.glShadeModel(bgl.GL_FLAT)
-        alpha = 1-PHI_INV
-        # History Trace
-        if cc.historyPosition[0]<0:
-            return
-        bgl.glBegin(bgl.GL_LINE_STRIP)
-        ccc = 0
-        for iii in range(cc.historyWindow+1):
-            ix_rel = iii - int(cc.historyWindow / 2)
-            ix = cc.historyPosition[0] + ix_rel
-            if(ix<0 or ix>=len(cc.historyLocation)):
-                continue
-            ppp = region3d_get_2d_coordinates(context, cc.historyLocation[ix])
-            if(ix_rel<=0):
-                bgl.glColor4f(0, 0, 0, alpha)
-            else:
-                bgl.glColor4f(1, 0, 0, alpha)
-            bgl.glVertex2f(ppp[0], ppp[1])
-            ccc = ccc + 1
-        bgl.glEnd()
diff --git a/release/scripts/addons_contrib/cursor_control/memory.py b/release/scripts/addons_contrib/cursor_control/memory.py
deleted file mode 100644
index 1d2d9db..0000000
--- a/release/scripts/addons_contrib/cursor_control/memory.py
+++ /dev/null
@@ -1,307 +0,0 @@
-# -*- coding: utf-8 -*-
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-
-"""
-  TODO:
-
-      IDEAS:
-	  Add/Subtract
-	  
-      LATER:
-
-      ISSUES:
-          Bugs:
-          Mites:
-	      CTRL-Z forces memory to world origin (0,0,0)... why??
-		  Happens only if undo reaches 'default world state'
-		  How to Reproduce:
-		      1. File->New
-		      2. Move 3D-cursor
-		      3. Set memory
-		      4. Move cube
-		      5. CTRL-Z
-
-      QUESTIONS:
-  
-  
-"""
-
-
-
-import bpy
-import bgl
-import math
-from mathutils import Vector, Matrix
-from mathutils import geometry
-from misc_utils import *
-from constants_utils import *
-from cursor_utils import *
-from ui_utils import *
-
-
-
-PRECISION = 4
-
-
-
-class CursorMemoryData(bpy.types.PropertyGroup):
-
-    savedLocationDraw = bpy.props.BoolProperty(description="Draw SL cursor in 3D view",default=1)
-    savedLocation = bpy.props.FloatVectorProperty(name="",description="Saved Location",precision=PRECISION)
-
-
-class VIEW3D_OT_cursor_memory_save(bpy.types.Operator):
-    """Save cursor location"""
-    bl_idname = "view3d.cursor_memory_save"
-    bl_label = "Save cursor location"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_memory
-        cc.savedLocation = CursorAccess.getCursor()
-        CursorAccess.setCursor(cc.savedLocation)
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_memory_swap(bpy.types.Operator):
-    """Swap cursor location"""
-    bl_idname = "view3d.cursor_memory_swap"
-    bl_label = "Swap cursor location"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        location = CursorAccess.getCursor().copy()
-        cc = context.scene.cursor_memory
-        CursorAccess.setCursor(cc.savedLocation)
-        cc.savedLocation = location
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_memory_recall(bpy.types.Operator):
-    """Recall cursor location"""
-    bl_idname = "view3d.cursor_memory_recall"
-    bl_label = "Recall cursor location"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_memory
-        CursorAccess.setCursor(cc.savedLocation)
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_memory_show(bpy.types.Operator):
-    """Show cursor memory"""
-    bl_idname = "view3d.cursor_memory_show"
-    bl_label = "Show cursor memory"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_memory
-        cc.savedLocationDraw = True
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_memory_hide(bpy.types.Operator):
-    """Hide cursor memory"""
-    bl_idname = "view3d.cursor_memory_hide"
-    bl_label = "Hide cursor memory"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_memory
-        cc.savedLocationDraw = False
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_PT_cursor_memory(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Cursor Memory"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(self, context):
-        # Display in object or edit mode.
-        if (context.area.type == 'VIEW_3D' and
-            (context.mode == 'EDIT_MESH'
-            or context.mode == 'OBJECT')):
-            return 1
-
-        return 0
-
-    def draw_header(self, context):
-        layout = self.layout
-        cc = context.scene.cursor_memory
-        if cc.savedLocationDraw:
-            GUI.drawIconButton(True, layout, 'RESTRICT_VIEW_OFF', "view3d.cursor_memory_hide", False)
-        else:
-            GUI.drawIconButton(True, layout, 'RESTRICT_VIEW_ON' , "view3d.cursor_memory_show", False)
-        #layout.prop(sce, "cursor_memory.savedLocationDraw")
-
-    def draw(self, context):
-        layout = self.layout
-        sce = context.scene
-        cc = context.scene.cursor_memory
-
-        row = layout.row()
-        col = row.column()
-        row2 = col.row()
-        GUI.drawIconButton(True, row2, 'FORWARD', "view3d.cursor_memory_save")
-        row2 = col.row()
-        GUI.drawIconButton(True, row2, 'FILE_REFRESH', "view3d.cursor_memory_swap")
-        row2 = col.row()
-        GUI.drawIconButton(True, row2, 'BACK'        , "view3d.cursor_memory_recall")
-        col = row.column()
-        col.prop(cc, "savedLocation")
-
-
-
-class VIEW3D_PT_cursor_memory_init(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Register callback"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    initDone = False
-
-    @classmethod
-    def poll(cls, context):
-        if VIEW3D_PT_cursor_memory_init.initDone:
-            return 0
-        print ("Cursor Memory draw-callback registration...")
-        sce = context.scene
-        if context.area.type == 'VIEW_3D':
-            for reg in context.area.regions:
-                if reg.type == 'WINDOW':
-                    # Register callback for SL-draw
-                    reg.callback_add(
-                        cursor_memory_draw,
-                        (cls,context),
-                        'POST_PIXEL')
-                    VIEW3D_PT_cursor_memory_init.initDone = True
-                    print ("Cursor Memory draw-callback registered")
-                    # Unregister to prevent double registration...
-                    # Started to fail after v2.57
-                    # bpy.types.unregister(VIEW3D_PT_cursor_memory_init)
-        else:
-            print("View3D not found, cannot run operator")
-        return 0
-
-    def draw_header(self, context):
-        pass
-
-    def draw(self, context):
-        pass
-
-
-
-def cursor_memory_draw(cls,context):
-    cc = context.scene.cursor_memory
-
-    draw = 0
-    if hasattr(cc, "savedLocationDraw"):
-        draw = cc.savedLocationDraw
-
-    if(draw):
-        bgl.glEnable(bgl.GL_BLEND)
-        bgl.glShadeModel(bgl.GL_FLAT)
-        p1 = Vector(cc.savedLocation)
-        location = region3d_get_2d_coordinates(context, p1)
-        alpha = 1-PHI_INV
-        # Circle
-        color = ([0.33, 0.33, 0.33],
-            [1, 1, 1],
-            [0.33, 0.33, 0.33],
-            [1, 1, 1],
-            [0.33, 0.33, 0.33],
-            [1, 1, 1],
-            [0.33, 0.33, 0.33],
-            [1, 1, 1],
-            [0.33, 0.33, 0.33],
-            [1, 1, 1],
-            [0.33, 0.33, 0.33],
-            [1, 1, 1],
-            [0.33, 0.33, 0.33],
-            [1, 1, 1])
-        offset = ([-4.480736161291701, -8.939966636005579],
-            [-0.158097634992133, -9.998750178787843],
-            [4.195854066857877, -9.077158622037636],
-            [7.718765411993642, -6.357724476147943],
-            [9.71288060283854, -2.379065025383466],
-            [9.783240669628, 2.070797430975971],
-            [7.915909938224691, 6.110513059466902],
-            [4.480736161291671, 8.939966636005593],
-            [0.15809763499209872, 9.998750178787843],
-            [-4.195854066857908, 9.077158622037622],
-            [-7.718765411993573, 6.357724476148025],
-            [-9.712880602838549, 2.379065025383433],
-            [-9.783240669627993, -2.070797430976005],
-            [-7.915909938224757, -6.110513059466818])
-        bgl.glBegin(bgl.GL_LINE_LOOP)
-        for i in range(14):
-            bgl.glColor4f(color[i][0], color[i][1], color[i][2], alpha)
-            bgl.glVertex2f(location[0]+offset[i][0], location[1]+offset[i][1])
-        bgl.glEnd()
-
-        # Crosshair
-        offset2 = 20
-        offset = 5
-        bgl.glColor4f(0, 0, 0, alpha)
-        bgl.glBegin(bgl.GL_LINE_STRIP)
-        bgl.glVertex2f(location[0]-offset2, location[1])
-        bgl.glVertex2f(location[0]- offset, location[1])
-        bgl.glEnd()
-        bgl.glBegin(bgl.GL_LINE_STRIP)
-        bgl.glVertex2f(location[0]+ offset, location[1])
-        bgl.glVertex2f(location[0]+offset2, location[1])
-        bgl.glEnd()
-        bgl.glBegin(bgl.GL_LINE_STRIP)
-        bgl.glVertex2f(location[0], location[1]-offset2)
-        bgl.glVertex2f(location[0], location[1]- offset)
-        bgl.glEnd()
-        bgl.glBegin(bgl.GL_LINE_STRIP)
-        bgl.glVertex2f(location[0], location[1]+ offset)
-        bgl.glVertex2f(location[0], location[1]+offset2)
-        bgl.glEnd()
-        
-       
diff --git a/release/scripts/addons_contrib/cursor_control/operators.py b/release/scripts/addons_contrib/cursor_control/operators.py
deleted file mode 100644
index 3840db5..0000000
--- a/release/scripts/addons_contrib/cursor_control/operators.py
+++ /dev/null
@@ -1,895 +0,0 @@
-# -*- coding: utf-8 -*-
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-
-"""
-  TODO:
-
-      IDEAS:
-
-      LATER:
-
-      ISSUES:
-          Bugs:
-          Mites:
-
-      QUESTIONS:
-
-
-"""
-
-
-
-import bpy
-import bgl
-import math
-from mathutils import Vector, Matrix
-from mathutils import geometry
-from misc_utils import *
-from constants_utils import *
-from cursor_utils import *
-from ui_utils import *
-from geometry_utils import *
-
-
-class VIEW3D_OT_cursor_to_origin(bpy.types.Operator):
-    """Move to world origin"""
-    bl_idname = "view3d.cursor_to_origin"
-    bl_label = "Move to world origin"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        cc.setCursor([0,0,0])
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_to_active_object_center(bpy.types.Operator):
-    """Move to active object origin"""
-    bl_idname = "view3d.cursor_to_active_object_center"
-    bl_label = "Move to active object origin"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        cc.setCursor(context.active_object.location)
-        return {'FINISHED'}
-
-
-
-#class VIEW3D_OT_cursor_to_nearest_object(bpy.types.Operator):
-    #"""Move to center of nearest object"""
-    #bl_idname = "view3d.cursor_to_nearest_object"
-    #bl_label = "Move to center of nearest object"
-    #bl_options = {'REGISTER'}
-
-    #def modal(self, context, event):
-        #return {'FINISHED'}
-
-    #def execute(self, context):
-        #cc.setCursor(context.active_object.location)
-        #return {'FINISHED'}
-
-
-
-#class VIEW3D_OT_cursor_to_selection_midpoint(bpy.types.Operator):
-    #"""Move to active objects median"""
-    #bl_idname = "view3d.cursor_to_selection_midpoint"
-    #bl_label = "Move to active objects median"
-    #bl_options = {'REGISTER'}
-
-    #def modal(self, context, event):
-        #return {'FINISHED'}
-
-    #def execute(self, context):
-        #location = Vector((0,0,0))
-        #n = 0
-        #for obj in context.selected_objects:
-            #location = location + obj.location
-            #n += 1
-        #if (n==0):
-            #return {'CANCELLED'}
-        #location = location / n
-        #cc.setCursor(location)
-        #return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_to_sl(bpy.types.Operator):
-    """Move to saved location"""
-    bl_idname = "view3d.cursor_to_sl"
-    bl_label = "Move to saved location"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        if hasattr(context.scene, "cursor_memory"):
-            cm = context.scene.cursor_memory
-            cc.hideLinexChoice()
-            cc.setCursor(cm.savedLocation)
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_to_sl_mirror(bpy.types.Operator):
-    """Mirror cursor around SL or selection"""
-    bl_idname = "view3d.cursor_to_sl_mirror"
-    bl_label = "Mirror cursor around SL or selection"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def mirror(self, cc, p):
-        v = p - Vector(CursorAccess.getCursor())
-        cc.setCursor(p + v)
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        obj = context.active_object
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        
-        if obj==None or obj.data.total_vert_sel==0:
-            if hasattr(context.scene, "cursor_memory"):
-                cm = context.scene.cursor_memory
-                self.mirror(cc, Vector(cm.savedLocation))
-            return {'FINISHED'}
-
-        mat = obj.matrix_world
-
-        if obj.data.total_vert_sel==1:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            self.mirror(cc, mat*Vector(sf[0].co))
-            return {'FINISHED'}
-
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-
-        if obj.data.total_vert_sel==2:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            p = G3.closestP2L(c, Vector(sf[0].co), Vector(sf[1].co))
-            self.mirror(cc, mat*p)
-            return {'FINISHED'}
-            
-        if obj.data.total_vert_sel==3:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            v2 = Vector(sf[2].co)
-            normal = (v1-v0).cross(v2-v0)
-            normal.normalize();            
-            p = G3.closestP2S(c, v0, normal)
-            self.mirror(cc, mat*p)
-            return {'FINISHED'}
-              
-        if obj.data.total_face_sel==1:
-            sf = [f for f in obj.data.faces if f.select == 1]
-            v0 = Vector(obj.data.vertices[sf[0].vertices[0]].co)
-            v1 = Vector(obj.data.vertices[sf[0].vertices[1]].co)
-            v2 = Vector(obj.data.vertices[sf[0].vertices[2]].co)
-            normal = (v1-v0).cross(v2-v0)
-            normal.normalize();            
-            p = G3.closestP2S(c, v0, normal)
-            self.mirror(cc, mat*p)
-            return {'FINISHED'}
-
-        return {'CANCELLED'}
-
-
-class VIEW3D_OT_cursor_to_vertex(bpy.types.Operator):
-    """Move to closest vertex"""
-    bl_idname = "view3d.cursor_to_vertex"
-    bl_label = "Move to closest vertex"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = context.active_object
-        mat = obj.matrix_world
-        mati = mat.copy()
-        mati.invert()
-        vs = obj.data.vertices
-        c = mati*Vector(CursorAccess.getCursor())
-        v = None
-        d = -1
-        for vv in vs:
-            if not vv.select:
-                continue
-            w = Vector(vv.co)
-            dd = G3.distanceP2P(c, w)
-            if d<0 or dd<d:
-                v = w
-                d = dd
-        if v==None:
-            return
-        cc.setCursor(mat*v)
-        return {'FINISHED'}
-
-
-class VIEW3D_OT_cursor_to_line(bpy.types.Operator):
-    """Move to closest point on line"""
-    bl_idname = "view3d.cursor_to_line"
-    bl_label = "Move to closest point on line"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mat = obj.matrix_world
-        if obj.data.total_vert_sel==2:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            p = CursorAccess.getCursor()
-            v0 = mat*sf[0].co
-            v1 = mat*sf[1].co
-            q = G3.closestP2L(p, v0, v1)
-            cc.setCursor(q)
-            return {'FINISHED'}
-        if obj.data.total_edge_sel<2:
-            return {'CANCELLED'}
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-        q = None
-        d = -1
-        for ee in obj.data.edges:
-            if not ee.select:
-                continue
-            e1 = Vector(obj.data.vertices[ee.vertices[0]].co)
-            e2 = Vector(obj.data.vertices[ee.vertices[1]].co)
-            qq = G3.closestP2L(c, e1, e2)
-            dd = G3.distanceP2P(c, qq)
-            if d<0 or dd<d:
-                q = qq
-                d = dd
-        if q==None:
-            return {'CANCELLED'}
-        cc.setCursor(mat*q)
-        return {'FINISHED'}
-
-
-class VIEW3D_OT_cursor_to_edge(bpy.types.Operator):
-    """Move to closest point on edge"""
-    bl_idname = "view3d.cursor_to_edge"
-    bl_label = "Move to closest point on edge"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mat = obj.matrix_world
-        if obj.data.total_vert_sel==2:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            p = CursorAccess.getCursor()
-            v0 = mat*sf[0].co
-            v1 = mat*sf[1].co
-            q = G3.closestP2E(p, v0, v1)
-            cc.setCursor(q)
-            return {'FINISHED'}
-        if obj.data.total_edge_sel<2:
-            return {'CANCELLED'}
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-        q = None
-        d = -1
-        for ee in obj.data.edges:
-            if not ee.select:
-                continue
-            e1 = Vector(obj.data.vertices[ee.vertices[0]].co)
-            e2 = Vector(obj.data.vertices[ee.vertices[1]].co)
-            qq = G3.closestP2E(c, e1, e2)
-            dd = G3.distanceP2P(c, qq)
-            if d<0 or dd<d:
-                q = qq
-                d = dd
-        if q==None:
-            return {'CANCELLED'}
-        cc.setCursor(mat*q)
-        return {'FINISHED'}
-
-
-class VIEW3D_OT_cursor_to_plane(bpy.types.Operator):
-    """Move to closest point on a plane"""
-    bl_idname = "view3d.cursor_to_plane"
-    bl_label = "Move to closest point on a plane"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mesh = obj.data.vertices
-        mat = obj.matrix_world
-        if obj.data.total_vert_sel==3:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            v2 = Vector(sf[2].co)
-            normal = (v1-v0).cross(v2-v0)
-            normal.normalize();
-            p = CursorAccess.getCursor()
-            n = mat*normal-obj.location
-            v = mat*v0
-            k = - (p-v).dot(n) / n.dot(n)
-            q = p+n*k
-            cc.setCursor(q)
-            return {'FINISHED'}
-
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-        q = None
-        d = -1
-        for ff in obj.data.polygons:
-            if not ff.select:
-                continue
-            qq = G3.closestP2S(c, Vector(obj.data.vertices[ff.vertices[0]].co), ff.normal)
-            dd = G3.distanceP2P(c, qq)
-            if d<0 or dd<d:
-                q = qq
-                d = dd
-        if q==None:
-            return {'CANCELLED'}
-        cc.setCursor(mat*q)
-        return {'FINISHED'}
-
-
-class VIEW3D_OT_cursor_to_face(bpy.types.Operator):
-    """Move to closest point on a face"""
-    bl_idname = "view3d.cursor_to_face"
-    bl_label = "Move to closest point on a face"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mesh = obj.data.vertices
-        mat = obj.matrix_world
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-        if obj.data.total_vert_sel==3:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            v2 = Vector(sf[2].co)
-            fv = [v0, v1, v2]
-            normal = (v1-v0).cross(v2-v0)
-            normal.normalize();
-            q = G3.closestP2F(c, fv, normal)
-            cc.setCursor(mat*q)
-            return {'FINISHED'}
-
-        #visual = True
-
-        qqq = []
-        q = None
-        d = -1
-        for ff in obj.data.polygons:
-            if not ff.select:
-                continue
-            fv=[]
-            for vi in ff.vertices:
-                fv.append(Vector(obj.data.vertices[vi].co))
-            qq = G3.closestP2F(c, fv, ff.normal)
-            #if visual:
-                #qqq.append(qq)
-            dd = G3.distanceP2P(c, qq)
-            if d<0 or dd<d:
-                q = qq
-                d = dd
-        if q==None:
-            return {'CANCELLED'}
-
-        #if visual:
-            #ci = MeshEditor.addVertex(c)
-            #for qq in qqq:
-                #qqi = MeshEditor.addVertex(qq)
-                #MeshEditor.addEdge(ci, qqi)
-
-        cc.setCursor(mat*q)
-        return {'FINISHED'}
-
-
-class VIEW3D_OT_cursor_to_vertex_median(bpy.types.Operator):
-    """Move to median of vertices"""
-    bl_idname = "view3d.cursor_to_vertex_median"
-    bl_label = "Move to median of vertices"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = context.active_object
-        mat = obj.matrix_world
-        vs = obj.data.vertices
-        selv = [v for v in vs if v.select == 1]
-        location = Vector((0,0,0))
-        for v in selv:
-            location = location + v.co
-        n = len(selv)
-        if (n==0):
-            return {'CANCELLED'}
-        location = location / n
-        cc.setCursor(mat*location)
-        return {'FINISHED'}
-
-
-class VIEW3D_OT_cursor_to_linex(bpy.types.Operator):
-    """Alternate between closest encounter points of two lines"""
-    bl_idname = "view3d.cursor_to_linex"
-    bl_label = "Alternate between to closest encounter points of two lines"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        obj = bpy.context.active_object
-        mat = obj.matrix_world
-
-        se = [e for e in obj.data.edges if (e.select == 1)]
-        e1v1 = obj.data.vertices[se[0].vertices[0]].co
-        e1v2 = obj.data.vertices[se[0].vertices[1]].co
-        e2v1 = obj.data.vertices[se[1].vertices[0]].co
-        e2v2 = obj.data.vertices[se[1].vertices[1]].co
-
-        qq = geometry.intersect_line_line (e1v1, e1v2, e2v1, e2v2)
-
-        q = None
-        if len(qq)==0:
-            #print ("lx 0")
-            return {'CANCELLED'}
-
-        if len(qq)==1:
-            #print ("lx 1")
-            q = qq[0]
-        
-        if len(qq)==2:
-            cc = context.scene.cursor_control
-            cc.cycleLinexCoice(2)
-            q = qq[cc.linexChoice]
-
-        #q = geometry.intersect_line_line (e1v1, e1v2, e2v1, e2v2)[qc] * mat
-        #i2 = geometry.intersect_line_line (e2v1, e2v2, e1v1, e1v2)[0] * mat
-        cc.setCursor(mat*q)
-        return {'FINISHED'}
-
-
-class VIEW3D_OT_cursor_to_cylinderaxis(bpy.types.Operator):
-    """Move to closest point on cylinder axis"""
-    bl_idname = "view3d.cursor_to_cylinderaxis"
-    bl_label = "Move to closest point on cylinder axis"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mesh = obj.data.vertices
-        mat = obj.matrix_world
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-
-        sf = [f for f in obj.data.vertices if f.select == 1]
-        v0 = Vector(sf[0].co)
-        v1 = Vector(sf[1].co)
-        v2 = Vector(sf[2].co)
-        fv = [v0, v1, v2]
-        q = G3.closestP2CylinderAxis(c, fv)
-        if(q==None):
-            return {'CANCELLED'}
-        cc.setCursor(mat*q)
-        return {'FINISHED'}     
-
-
-class VIEW3D_OT_cursor_to_spherecenter(bpy.types.Operator):
-    """Move to center of cylinder or sphere"""
-    bl_idname = "view3d.cursor_to_spherecenter"
-    bl_label = "Move to center of cylinder or sphere"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mesh = obj.data.vertices
-        mat = obj.matrix_world
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-
-        if obj.data.total_vert_sel==3:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            v2 = Vector(sf[2].co)
-            fv = [v0, v1, v2]
-            q = G3.closestP2CylinderAxis(c, fv)
-            #q = G3.centerOfSphere(fv)
-            if(q==None):
-                return {'CANCELLED'}
-            cc.setCursor(mat*q)
-            return {'FINISHED'}
-        if obj.data.total_vert_sel==4:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            v2 = Vector(sf[2].co)
-            v3 = Vector(sf[3].co)
-            fv = [v0, v1, v2, v3]
-            q = G3.centerOfSphere(fv)
-            if(q==None):
-                return {'CANCELLED'}
-            cc.setCursor(mat*q)
-            return {'FINISHED'}
-        return {'CANCELLED'}
-
-
-
-class VIEW3D_OT_cursor_to_perimeter(bpy.types.Operator):
-    """Move to perimeter of cylinder or sphere"""
-    bl_idname = "view3d.cursor_to_perimeter"
-    bl_label = "Move to perimeter of cylinder or sphere"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mesh = obj.data.vertices
-        mat = obj.matrix_world
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-
-        if obj.data.total_vert_sel==3:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            v2 = Vector(sf[2].co)
-            fv = [v0, v1, v2]
-            q = G3.closestP2Cylinder(c, fv)
-            if(q==None):
-                return {'CANCELLED'}
-            #q = G3.centerOfSphere(fv)
-            cc.setCursor(mat*q)
-            return {'FINISHED'}
-        if obj.data.total_vert_sel==4:
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            v2 = Vector(sf[2].co)
-            v3 = Vector(sf[3].co)
-            fv = [v0, v1, v2, v3]
-            q = G3.closestP2Sphere(c, fv)
-            if(q==None):
-                return {'CANCELLED'}
-            cc.setCursor(mat*q)
-            return {'FINISHED'}
-        return {'CANCELLED'}
-
-
-
-#class VIEW3D_OT_cursor_offset_from_radius(bpy.types.Operator):
-    #"""Calculate offset from radius"""
-    #bl_idname = "view3d.cursor_offset_from_radius"
-    #bl_label = "Calculate offset from radius"
-    #bl_options = {'REGISTER'}
-
-    #def modal(self, context, event):
-        #return {'FINISHED'}
-
-    #def execute(self, context):
-        #BlenderFake.forceUpdate()
-        #cc = context.scene.cursor_control
-        #cc.hideLinexChoice()
-        #obj = bpy.context.active_object
-        #mesh = obj.data.vertices
-        #mat = obj.matrix_world
-        #mati = mat.copy()
-        #mati.invert()
-        #c = mati*Vector(CursorAccess.getCursor())
-
-        #if obj.data.total_vert_sel==3:
-            #sf = [f for f in obj.data.vertices if f.select == 1]
-            #v0 = Vector(sf[0].co)
-            #v1 = Vector(sf[1].co)
-            #v2 = Vector(sf[2].co)
-            #fv = [v0, v1, v2]
-            #q = G3.centerOfSphere(fv)
-            #d = (v0-q).length
-            #cc.stepLengthValue = d
-            #return {'FINISHED'}
-        #if obj.data.total_vert_sel==4:
-            #sf = [f for f in obj.data.vertices if f.select == 1]
-            #v0 = Vector(sf[0].co)
-            #v1 = Vector(sf[1].co)
-            #v2 = Vector(sf[2].co)
-            #v3 = Vector(sf[3].co)
-            #fv = [v0, v1, v2, v3]
-            #q = G3.centerOfSphere(fv)
-            #d = (v0-q).length
-            #cc.stepLengthValue = d
-            #return {'FINISHED'}
-        #return {'CANCELLED'}
-
-
-
-class VIEW3D_OT_cursor_stepval_phinv(bpy.types.Operator):
-    """Set step value to 1/Phi"""
-    bl_idname = "view3d.cursor_stepval_phinv"
-    bl_label = "Set step value to 1/Phi"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.stepLengthValue = PHI_INV
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_stepval_phi(bpy.types.Operator):
-    """Set step value to Phi"""
-    bl_idname = "view3d.cursor_stepval_phi"
-    bl_label = "Set step value to Phi"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.stepLengthValue = PHI
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_stepval_phi2(bpy.types.Operator):
-    """Set step value to Phi²"""
-    bl_idname = "view3d.cursor_stepval_phi2"
-    bl_label = "Set step value to Phi²"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.stepLengthValue = PHI_SQR
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_cursor_stepval_vvdist(bpy.types.Operator):
-    """Set step value to distance vertex-vertex"""
-    bl_idname = "view3d.cursor_stepval_vvdist"
-    bl_label = "Set step value to distance vertex-vertex"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        cc.hideLinexChoice()
-        obj = bpy.context.active_object
-        mesh = obj.data.vertices
-        mat = obj.matrix_world
-        mati = mat.copy()
-        mati.invert()
-        c = mati*Vector(CursorAccess.getCursor())
-
-        sf = [f for f in obj.data.vertices if f.select == 1]
-        v0 = Vector(sf[0].co)
-        v1 = Vector(sf[1].co)
-        q = (v0-v1).length
-        cc.stepLengthValue = q
-
-        BlenderFake.forceRedraw()
-        return {'FINISHED'}
-
-
-
-
-class VIEW3D_OT_ccdelta_invert(bpy.types.Operator):
-    """Invert delta vector"""
-    bl_idname = "view3d.ccdelta_invert"
-    bl_label = "Invert delta vector"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.invertDeltaVector()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_ccdelta_normalize(bpy.types.Operator):
-    """Normalize delta vector"""
-    bl_idname = "view3d.ccdelta_normalize"
-    bl_label = "Normalize delta vector"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.normalizeDeltaVector()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_ccdelta_add(bpy.types.Operator):
-    """Add delta vector to 3D cursor"""
-    bl_idname = "view3d.ccdelta_add"
-    bl_label = "Add delta vector to 3D cursor"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.addDeltaVectorToCursor()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_ccdelta_sub(bpy.types.Operator):
-    """Subtract delta vector to 3D cursor"""
-    bl_idname = "view3d.ccdelta_sub"
-    bl_label = "Subtract delta vector to 3D cursor"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        cc = context.scene.cursor_control
-        cc.subDeltaVectorToCursor()
-        return {'FINISHED'}
-
-
-
-class VIEW3D_OT_ccdelta_vvdist(bpy.types.Operator):
-    """Set delta vector from selection"""
-    bl_idname = "view3d.ccdelta_vvdist"
-    bl_label = "Set delta vector from selection"
-    bl_options = {'REGISTER'}
-
-    def modal(self, context, event):
-        return {'FINISHED'}
-
-    def execute(self, context):
-        BlenderFake.forceUpdate()
-        cc = context.scene.cursor_control
-        obj = bpy.context.active_object
-        if obj.data.total_vert_sel==0:
-            if hasattr(context.scene, "cursor_memory"):
-                cm = context.scene.cursor_memory
-                
-                mesh = obj.data.vertices
-                mat = obj.matrix_world
-                mati = mat.copy()
-                mati.invert()
-                c = mati*Vector(CursorAccess.getCursor())
-                
-                v0 = Vector(cm.savedLocation)
-                v1 = Vector(c)
-                cc.deltaVector = v0-v1
-                
-                
-        if obj.data.total_vert_sel==1:
-            mesh = obj.data.vertices
-            mat = obj.matrix_world
-            mati = mat.copy()
-            mati.invert()
-            c = mati*Vector(CursorAccess.getCursor())
-
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(c)
-            cc.deltaVector = v0-v1
-
-        if obj.data.total_vert_sel==2:
-            #mesh = obj.data.vertices
-            #mat = obj.matrix_world
-            #mati = mat.copy()
-            #mati.invert()
-            #c = mati*Vector(CursorAccess.getCursor())
-
-            sf = [f for f in obj.data.vertices if f.select == 1]
-            v0 = Vector(sf[0].co)
-            v1 = Vector(sf[1].co)
-            cc.deltaVector = v1-v0
-
-        return {'FINISHED'}
-
-
-
-
diff --git a/release/scripts/addons_contrib/cursor_control/ui.py b/release/scripts/addons_contrib/cursor_control/ui.py
deleted file mode 100644
index 4863836..0000000
--- a/release/scripts/addons_contrib/cursor_control/ui.py
+++ /dev/null
@@ -1,224 +0,0 @@
-# -*- coding: utf-8 -*-
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-
-"""
-  TODO:
-
-      IDEAS:
-
-      LATER:
-
-      ISSUES:
-          Bugs:
-          Mites:
-
-      QUESTIONS:
-
-
-"""
-
-
-
-import bpy
-import bgl
-import math
-from mathutils import Vector, Matrix
-from mathutils import geometry
-from misc_utils import *
-from constants_utils import *
-from cursor_utils import *
-from ui_utils import *
-from geometry_utils import *
-
-
-class VIEW3D_PT_cursor(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Cursor Target"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(self, context):
-        # Display in object or edit mode.
-        if (context.area.type == 'VIEW_3D' and
-            (context.mode == 'EDIT_MESH'
-            or context.mode == 'OBJECT')):
-            return 1
-
-        return 0
-
-    def draw_header(self, context):
-        pass
- 
-    def draw(self, context):
-        layout = self.layout
-        sce = context.scene
-
-        cc = context.scene.cursor_control
-        (tvs,tes,tfs,edit_mode) = cc.guiStates(context)
-
-        # Mesh data elements
-        if(edit_mode):
-            row = layout.row()
-            GUI.drawIconButton(tvs>=1          , row, 'STICKY_UVS_DISABLE', "view3d.cursor_to_vertex")
-            GUI.drawIconButton(tvs==2 or tes>=1, row, 'MESH_DATA'         , "view3d.cursor_to_line")
-            GUI.drawIconButton(tvs==2 or tes>=1, row, 'OUTLINER_OB_MESH'  , "view3d.cursor_to_edge")
-            GUI.drawIconButton(tvs==3 or tfs>=1, row, 'SNAP_FACE'         , "view3d.cursor_to_plane")
-            GUI.drawIconButton(tvs==3 or tfs>=1, row, 'FACESEL'           , "view3d.cursor_to_face")
-
-        # Geometry from mesh
-        if(edit_mode):
-            row = layout.row()
-            GUI.drawIconButton(tvs<=3 or tfs==1 , row, 'MOD_MIRROR'  , "view3d.cursor_to_sl_mirror")
-            GUI.drawIconButton(tes==2, row, 'PARTICLE_TIP', "view3d.cursor_to_linex")
-            GUI.drawIconButton(tvs>1 , row, 'ROTATECENTER', "view3d.cursor_to_vertex_median")  #EDITMODE_HLT
-            GUI.drawIconButton(tvs==3 or tvs==4, row, 'FORCE_FORCE'  , "view3d.cursor_to_spherecenter")
-            GUI.drawIconButton(tvs==3 or tvs==4, row, 'MATERIAL'  , "view3d.cursor_to_perimeter")
-
-        # Objects
-        #row = layout.row()
-
-        #GUI.drawIconButton(context.active_object!=None    , row, 'ROTATE'          , "view3d.cursor_to_active_object_center")
-        #GUI.drawIconButton(len(context.selected_objects)>1, row, 'ROTATECOLLECTION', "view3d.cursor_to_selection_midpoint")
-        #GUI.drawIconButton(len(context.selected_objects)>1, row, 'ROTATECENTER'    , "view3d.cursor_to_selection_midpoint")
-
-        # References World Origin, Object Origin, SL and CL
-        row = layout.row()
-        GUI.drawIconButton(True                       , row, 'WORLD_DATA'    , "view3d.cursor_to_origin")
-        GUI.drawIconButton(context.active_object!=None, row, 'ROTACTIVE'       , "view3d.cursor_to_active_object_center")
-        GUI.drawIconButton(True                       , row, 'CURSOR'        , "view3d.cursor_to_sl")
-        #GUI.drawIconButton(True, row, 'GRID'          , "view3d.cursor_sl_recall")
-        #GUI.drawIconButton(True, row, 'SNAP_INCREMENT', "view3d.cursor_sl_recall")
-        #row.label("("+str(cc.linexChoice)+")")
-        cc = context.scene.cursor_control
-        if cc.linexChoice>=0:
-            col = row.column()
-            col.enabled = False
-            col.prop(cc, "linexChoice")
-
-        # Limit/Clamping Properties
-        row = layout.row()
-        row.prop(cc, "stepLengthEnable")
-        if (cc.stepLengthEnable):
-            row = layout.row()
-            row.prop(cc, "stepLengthMode")
-            row.prop(cc, "stepLengthValue")
-            row = layout.row()
-            GUI.drawTextButton(True, row, '1/Phi'      , "view3d.cursor_stepval_phinv")
-            GUI.drawTextButton(True, row, 'Phi'      , "view3d.cursor_stepval_phi")
-            GUI.drawTextButton(True, row, 'Phi²'      , "view3d.cursor_stepval_phi2")
-            GUI.drawIconButton(tvs==2, row, 'EDGESEL'      , "view3d.cursor_stepval_vvdist")
-
-
-
-class VIEW3D_PT_ccDelta(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Cursor Delta"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(self, context):
-        # Display in object or edit mode.
-        if (context.area.type == 'VIEW_3D' and
-            (context.mode == 'EDIT_MESH'
-            or context.mode == 'OBJECT')):
-            return 1
-
-        return 0
-
-    def draw_header(self, context):
-        pass
- 
-    def draw(self, context):
-        layout = self.layout
-        #sce = context.scene
-
-        cc = context.scene.cursor_control
-        (tvs,tes,tfs,edit_mode) = cc.guiStates(context)
-        
-        row = layout.row()
-        col = row.column();
-        GUI.drawIconButton(True , col, 'FF'  , "view3d.ccdelta_add")
-        GUI.drawIconButton(True , col, 'REW'  , "view3d.ccdelta_sub")
-        GUI.drawIconButton(tvs<=2 , col, 'FORWARD'  , "view3d.ccdelta_vvdist")
-        
-        col = row.column();
-        col.prop(cc, "deltaVector")
-
-        col = row.column();
-        GUI.drawIconButton(True , col, 'MOD_MIRROR'  , "view3d.ccdelta_invert")
-        GUI.drawIconButton(True , col, 'SNAP_NORMAL'  , "view3d.ccdelta_normalize")
-
-
-  
-class CursorControlMenu(bpy.types.Menu):
-    """menu"""
-    bl_idname = "cursor_control_calls"
-    bl_label = "Cursor Control"
-    
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        #layout.operator(VIEW3D_OT_cursor_to_vertex.bl_idname, text = "Vertex")
-        #layout.operator(VIEW3D_OT_cursor_to_line.bl_idname, text = "Line")
-        #obj = context.active_object
-        #if (context.mode == 'EDIT_MESH'):
-            #if (obj and obj.type=='MESH' and obj.data):
-        cc = context.scene.cursor_control
-        (tvs,tes,tfs,edit_mode) = cc.guiStates(context)
-        
-        if(edit_mode):
-            if(tvs>=1):
-                layout.operator(VIEW3D_OT_cursor_to_vertex.bl_idname, text = "Closest Vertex")
-            if(tvs==2 or tes>=1):
-                layout.operator(VIEW3D_OT_cursor_to_line.bl_idname, text = "Closest Line")
-            if(tvs==2 or tes>=1):
-                layout.operator(VIEW3D_OT_cursor_to_edge.bl_idname, text = "Closest Edge")
-            if(tvs==3 or tfs>=1):
-                layout.operator(VIEW3D_OT_cursor_to_plane.bl_idname, text = "Closest Plane")
-            if(tvs==3 or tfs>=1):
-                layout.operator(VIEW3D_OT_cursor_to_face.bl_idname, text = "Closest Face")
-
-        if(edit_mode):
-            if(tvs<=3 or tfs==1):
-                layout.operator(VIEW3D_OT_cursor_to_sl_mirror.bl_idname, text = "Mirror")
-            if(tes==2):
-                layout.operator(VIEW3D_OT_cursor_to_linex.bl_idname, text = "Line Intersection")
-            if(tvs>1):
-                layout.operator(VIEW3D_OT_cursor_to_vertex_median.bl_idname, text = "Vertex Median")
-            if(tvs==3 or tvs==4):
-                layout.operator(VIEW3D_OT_cursor_to_spherecenter.bl_idname, text = "Circle Center")
-            if(tvs==3 or tvs==4):
-                layout.operator(VIEW3D_OT_cursor_to_perimeter.bl_idname, text = "Circle Perimeter")
-        
-        layout.operator(VIEW3D_OT_cursor_to_origin.bl_idname, text = "World Origin")
-        layout.operator(VIEW3D_OT_cursor_to_active_object_center.bl_idname, text = "Active Object")
-        layout.operator(VIEW3D_OT_cursor_to_sl.bl_idname, text = "Cursor Memory")
-
-
-
-def menu_callback(self, context):
-    #obj = context.active_object
-    #if (context.mode == 'EDIT_MESH'):
-        #if (obj and obj.type=='MESH' and obj.data):
-    self.layout.menu(CursorControlMenu.bl_idname, icon="PLUGIN")
-
diff --git a/release/scripts/addons_contrib/curve_tools.py b/release/scripts/addons_contrib/curve_tools.py
deleted file mode 100644
index c1debf4..0000000
--- a/release/scripts/addons_contrib/curve_tools.py
+++ /dev/null
@@ -1,1353 +0,0 @@
-# #####BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# #####END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Curve Tools",
-    "author": "Zak",
-    "version": (0, 1, 5),
-    "blender": (2, 59, 0),
-    "location": "Properties > Object data",
-    "description": "Creates driven Lofts or Birails between curves",
-    "warning": "may be buggy or incomplete",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Curve/Curve_Tools",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=27720",
-    "category": "Add Curve"}
-
-### UPDATES
-#1.5
-
-#-Fixed birail function
-#-Added Curve Snap to W key specials menu.
-#-Removed some functions that arent needed and wrapped into the operators.
-#-nurbs with weights for loft and birail
-#-Panel Moved to view 3d tools
-#-inserted TODO comments
-#-tried to implement live tension and bias for Hermite interpolation by driving the mesh but
-#i dont know why, the code is executed all the time even if you dont change the variables.
-#-snap to curves affects all the curves on the scene
-#-i was able to preserve handle types when split or subdivide
-
-
-#1.4
-#-incorporate curve snap
-#assign a copy transform to helper
-#-nurbs implemented (in progress)
-
-import bpy
-from mathutils import *
-from bpy.props import *
-
-print("----------")
-
-
-### PROPERTIES
-class sprops(bpy.types.PropertyGroup):
-    pass
-
-
-bpy.utils.register_class(sprops)
-
-#bpy.selection will store objects names in the order they were selected
-bpy.selection=[]
-
-
-#dodriver a simple checker to chosse whether  you want a driven mesh or not.
-bpy.types.Scene.dodriver = BoolProperty(name = "dodriver",                                      default=False)
-
-#interpolation types
-myitems = (('0','Linear', ''),('1','Cubic',''),('2','Catmull',''), ('3','Hermite',''))
-bpy.types.Scene.intype = EnumProperty(name="intype", items = myitems, default='3')
-
-#number of steps and spans to be created
-bpy.types.Scene.steps = IntProperty(name="steps", default=12, min=2)
-bpy.types.Scene.spans = IntProperty(name="spans", default=12, min=2)
-
-#parameters for Hermite interpolation
-bpy.types.Scene.tension = FloatProperty(name = "tension", min=0.0, default=0.0)
-bpy.types.Scene.bias = FloatProperty(name = "bias", min=0.0, default = 0.5)
-
-#proportional birail
-bpy.types.Scene.proportional = BoolProperty(name="proportional", default=False)
-
-#this stores the result of calculating the curve length
-bpy.types.Scene.clen = FloatProperty(name="clen", default=0.0, precision=5)
-
-#minimun distance for merge curve tool
-bpy.types.Scene.limit = FloatProperty(name="limit", default=0.1, precision=3)
-
-
-### SELECT BY ORDER BLOCK
-
-#i dont know what to do with this. Im not using it yet.
-def selected_points(curve):
-
-    selp = []
-    for spl in curve.splines:
-        if spl.type=="BEZIER":
-            points = spl.bezier_points
-            for p in points:
-                if p.select_control_point:
-                    selp.append(p)
-
-        elif spl.type=="NURBS":
-            points = spl.points
-            for p in points:
-                if p.select:
-                    selp.append(p)
-    return selp
-
-#writes bpy.selection when a new object is selected or deselected
-#it compares bpy.selection with bpy.context.selected_objects
-
-def select():
-
-    #print(bpy.context.mode)
-    if bpy.context.mode=="OBJECT":
-        obj = bpy.context.object
-        sel = len(bpy.context.selected_objects)
-
-        if sel==0:
-            bpy.selection=[]
-        else:
-            if sel==1:
-                bpy.selection=[]
-                bpy.selection.append(obj)
-            elif sel>len(bpy.selection):
-                for sobj in bpy.context.selected_objects:
-                    if (sobj in bpy.selection)==False:
-                        bpy.selection.append(sobj)
-
-            elif sel<len(bpy.selection):
-                for it in bpy.selection:
-                    if (it in bpy.context.selected_objects)==False:
-                        bpy.selection.remove(it)
-
-    #on edit mode doesnt work well
-
-
-#executes selection by order at 3d view
-class Selection(bpy.types.Header):
-    bl_label = "Selection"
-    bl_space_type = "VIEW_3D"
-
-    def __init__(self):
-        #print("hey")
-        select()
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-        row.label("Sel: "+str(len(bpy.selection)))
-
-### GENERAL CURVE FUNCTIONS
-
-#distance between 2 points
-def dist(p1, p2):
-    return (p2-p1).magnitude
-
-#sets cursors position for debugging porpuses
-def cursor(pos):
-    bpy.context.scene.cursor_location = pos
-
-#cuadratic bezier value
-def quad(p, t):
-    return p[0]*(1.0-t)**2.0 + 2.0*t*p[1]*(1.0-t) + p[2]*t**2.0
-
-#cubic bezier value
-def cubic(p, t):
-    return p[0]*(1.0-t)**3.0 + 3.0*p[1]*t*(1.0-t)**2.0 + 3.0*p[2]*(t**2.0)*(1.0-t) + p[3]*t**3.0
-
-#gets a bezier segment's control points on global coordinates
-def getbezpoints(spl, mt, seg=0):
-    points = spl.bezier_points
-    p0 = mt * points[seg].co
-    p1 = mt * points[seg].handle_right
-    p2 = mt * points[seg+1].handle_left
-    p3 = mt * points[seg+1].co
-    return p0, p1, p2, p3
-
-#gets nurbs polygon control points on global coordinates
-def getnurbspoints(spl, mw):
-    pts = []
-    ws = []
-    for p in spl.points:
-        v = Vector(p.co[0:3])*mw
-        pts.append(v)
-        ws.append(p.weight)
-    return pts , ws
-
-#calcs a nurbs knot vector
-def knots(n, order, type=0):#0 uniform 1 endpoints 2 bezier
-
-    kv = []
-
-    t = n+order
-    if type==0:
-        for i in range(0, t):
-            kv.append(1.0*i)
-
-    elif type==1:
-        k=0.0
-        for i in range(1, t+1):
-            kv.append(k)
-            if i>=order and i<=n:
-                k+=1.0
-    elif type==2:
-        if order==4:
-            k=0.34
-            for a in range(0,t):
-                if a>=order and a<=n: k+=0.5
-                kv.append(floor(k))
-                k+=1.0/3.0
-
-        elif order==3:
-            k=0.6
-            for a in range(0, t):
-                if a >=order and a<=n: k+=0.5
-                kv.append(floor(k))
-
-    ##normalize the knot vector
-    for i in range(0, len(kv)):
-        kv[i]=kv[i]/kv[-1]
-
-    return kv
-
-#nurbs curve evaluation
-def C(t, order, points, weights, knots):
-    #c = Point([0,0,0])
-    c = Vector()
-    rational = 0
-    i = 0
-    while i < len(points):
-        b = B(i, order, t, knots)
-        p = points[i] * (b * weights[i])
-        c = c + p
-        rational = rational + b*weights[i]
-        i = i + 1
-
-    return c * (1.0/rational)
-
-#nurbs basis function
-def B(i,k,t,knots):
-    ret = 0
-    if k>0:
-        n1 = (t-knots[i])*B(i,k-1,t,knots)
-        d1 = knots[i+k] - knots[i]
-        n2 = (knots[i+k+1] - t) * B(i+1,k-1,t,knots)
-        d2 = knots[i+k+1] - knots[i+1]
-        if d1 > 0.0001 or d1 < -0.0001:
-            a = n1 / d1
-        else:
-            a = 0
-        if d2 > 0.0001 or d2 < -0.0001:
-            b = n2 / d2
-        else:
-            b = 0
-        ret = a + b
-        #print "B i = %d, k = %d, ret = %g, a = %g, b = %g\n"%(i,k,ret,a,b)
-    else:
-        if knots[i] <= t and t <= knots[i+1]:
-            ret = 1
-        else:
-            ret = 0
-    return ret
-
-#calculates a global parameter t along all control points
-#t=0 begining of the curve
-#t=1 ending of the curve
-
-def calct(obj, t):
-
-    spl=None
-    mw = obj.matrix_world
-    if obj.data.splines.active==None:
-        if len(obj.data.splines)>0:
-            spl=obj.data.splines[0]
-    else:
-        spl = obj.data.splines.active
-
-    if spl==None:
-        return False
-
-    if spl.type=="BEZIER":
-        points = spl.bezier_points
-        nsegs = len(points)-1
-
-        d = 1.0/nsegs
-        seg = int(t/d)
-        t1 = t/d - int(t/d)
-
-        if t==1:
-            seg-=1
-            t1 = 1.0
-
-        p = getbezpoints(spl,mw, seg)
-
-        coord = cubic(p, t1)
-
-        return coord
-
-    elif spl.type=="NURBS":
-        data = getnurbspoints(spl, mw)
-        pts = data[0]
-        ws = data[1]
-        order = spl.order_u
-        n = len(pts)
-        ctype = spl.use_endpoint_u
-        kv = knots(n, order, ctype)
-
-        coord = C(t, order-1, pts, ws, kv)
-
-        return coord
-
-#length of the curve
-def arclength(objs):
-    length = 0.0
-
-    for obj in objs:
-        if obj.type=="CURVE":
-            prec = 1000 #precision
-            inc = 1/prec #increments
-
-            ### TODO: set a custom precision value depending the number of curve points
-            #that way it can gain on accuracy in less operations.
-
-            #subdivide the curve in 1000 lines and sum its magnitudes
-            for i in range(0, prec):
-                ti = i*inc
-                tf = (i+1)*inc
-                a = calct(obj, ti)
-                b = calct(obj, tf)
-                r = (b-a).magnitude
-                length+=r
-
-    return length
-
-
-class ArcLengthOperator(bpy.types.Operator):
-
-    bl_idname = "curve.arc_length_operator"
-    bl_label = "Measures the length of a curve"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        objs = context.selected_objects
-        context.scene.clen = arclength(objs)
-        return {'FINISHED'}
-
-### LOFT INTERPOLATIONS
-
-#objs = selected objects
-#i = object index
-#t = parameter along u direction
-#tr = parameter along v direction
-
-#linear
-def intl(objs, i, t, tr):
-    p1 = calct(objs[i],t)
-    p2 = calct(objs[i+1], t)
-
-    r = p1 + (p2 - p1)*tr
-
-    return r
-
-#tipo = interpolation type
-#tension and bias are for hermite interpolation
-#they can be changed to obtain different lofts.
-
-#cubic
-def intc(objs, i, t, tr, tipo=3, tension=0.0, bias=0.0):
-
-    ncurves =len(objs)
-
-    #if 2 curves go to linear interpolation regardless the one you choose
-    if ncurves<3:
-        return intl(objs, i, t, tr)
-    else:
-
-        #calculates the points to be interpolated on each curve
-        if i==0:
-            p0 = calct(objs[i], t)
-            p1 = p0
-            p2 = calct(objs[i+1], t)
-            p3 = calct(objs[i+2], t)
-        else:
-            if ncurves-2 == i:
-                p0 = calct(objs[i-1], t)
-                p1 = calct(objs[i], t)
-                p2 = calct(objs[i+1], t)
-                p3 = p2
-            else:
-                p0 = calct(objs[i-1], t)
-                p1 = calct(objs[i], t)
-                p2 = calct(objs[i+1], t)
-                p3 = calct(objs[i+2], t)
-
-
-    #calculates the interpolation between those points
-    #i used methods from this page: http://paulbourke.net/miscellaneous/interpolation/
-
-    if tipo==0:
-        #linear
-        return intl(objs, i, t, tr)
-    elif tipo == 1:
-        #natural cubic
-        t2 = tr*tr
-        a0 = p3-p2-p0+p1
-        a1 = p0-p1-a0
-        a2 = p2-p0
-        a3 = p1
-        return a0*tr*t2 + a1*t2+a2*tr+a3
-    elif tipo == 2:
-        #catmull it seems to be working. ill leave it for now.
-        t2 = tr*tr
-        a0 = -0.5*p0 +1.5*p1 -1.5*p2 +0.5*p3
-        a1 = p0 - 2.5*p1 + 2*p2 -0.5*p3
-        a2 = -0.5*p0 + 0.5 *p2
-        a3 = p1
-        return a0*tr*tr + a1*t2+a2*tr+a3
-
-    elif tipo == 3:
-        #hermite
-        tr2 = tr*tr
-        tr3 = tr2*tr
-        m0 = (p1-p0)*(1+bias)*(1-tension)/2
-        m0+= (p2-p1)*(1-bias)*(1-tension)/2
-        m1 = (p2-p1)*(1+bias)*(1-tension)/2
-        m1+= (p3-p2)*(1-bias)*(1-tension)/2
-        a0 = 2*tr3 - 3*tr2 + 1
-        a1 = tr3 - 2 * tr2+ tr
-        a2 = tr3 - tr2
-        a3 = -2*tr3 + 3*tr2
-
-        return a0*p1+a1*m0+a2*m1+a3*p2
-
-
-#handles loft driver expression
-#example: loftdriver('Loft', 'BezierCurve;BezierCurve.001;BezierCurve.002', 3)
-
-#name: its the name of the mesh to be driven
-#objs: the  names of the curves that drives the mesh
-#3 interpolation type
-
-def loftdriver(name, objs, intype):
-    #print("ejecutando "+name)
-    intype = int(intype)
-
-    tension = 0.0
-    bias = 0.5
-    #if the loft object still exists proceed normal
-    try:
-        resobj = bpy.data.objects[name]
-        spans = resobj["spans"]
-        steps = resobj["steps"]
-        if intype==3: #hermite
-            tension = resobj['tension']
-            bias = resobj['bias']
-
-    #if not delete the driver
-    except:
-        curve = bpy.context.object
-        for it in curve.keys():
-            if it == "driver":
-                curve.driver_remove('["driver"]')
-        return False
-
-    objs = objs.split(";")
-    #objs = objs[0:-1]
-
-
-    #retrieves the curves from the objs string
-    for i, l in enumerate(objs):
-        objs[i] = bpy.data.objects[l]
-
-
-
-    #calcs the new vertices coordinates if we change the curves.
-    vxs = loft(objs, steps, spans, intype, tension, bias)
-
-    #apply the new cordinates to the loft object
-    me = resobj.data
-
-    for i in range(0, len(me.vertices)):
-        me.vertices[i].co = vxs[i]
-    me.update()
-    return spans
-
-#NOTES:
-#loftdriver function will fail or produce weird results if:
-#the user changes resobj["spans"] or resobj["steps"]
-#if we delete any vertex from the loft object
-
-### TODO:check if thats the case to remove the drivers
-
-#creates the drivers expressions for each curve
-def createloftdriver(objs, res, intype):
-
-    line = ""
-    for obj in objs:
-        line+=obj.name+";"
-    line=line[0:-1]
-    name = res.name
-
-    interp = str(intype)
-
-    for obj in objs:
-        obj["driver"] = 1.0
-
-        obj.driver_add('["driver"]')
-        obj.animation_data.drivers[0].driver.expression = "loftdriver('"+ name +"', '" + line + "', "+interp+")"
-
-
-    ### creating this driver will execute loft all the time without reason,
-    #and if i cant drive the mesh i cannot implement live tension and bias
-
-#   res['driver'] = 1.0
-#   if res.animation_data==None:
-#       res.animation_data_create()
-#   res.driver_add('["driver"]')
-#   res.animation_data.drivers[0].driver.expression = "loftdriver('"+ name +"', '" + line + "', "+interp+")"
-
-#calculates the vertices position of the loft object
-def loft(objs, steps, spans, interpolation=1, tension=0.0, bias=0.5):
-    verts=[]
-
-    for i in range(0, len(objs)):
-
-        for j in range(0,steps+1):
-            t = 1.0*j/steps
-            verts.append(calct(objs[i], t))
-
-        temp2=[]
-        if i<len(objs)-1:
-            for l in range(1, spans):
-                tr = 1.0*l/spans
-                for k in range(0, steps+1):
-                    t=1.0*k/steps
-                    if interpolation:
-                        pos = intc(objs, i, t, tr, interpolation, tension, bias)
-                    else:
-                        pos = intl(objs,i, t, tr)
-
-                    temp2.append(pos)
-            verts.extend(temp2)
-    return verts
-
-
-#loft operator
-
-class LoftOperator(bpy.types.Operator):
-    """Tooltip"""
-    bl_idname = "mesh.loft_operator"
-    bl_label = "Loft between bezier curves"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        #retrieves the curves in the order they were selected
-        objs = bpy.selection
-
-        spans = context.scene.spans
-        steps = context.scene.steps
-
-        intype = int(context.scene.intype)
-
-        verts = loft(objs, steps, spans, intype)
-
-        nfaces = steps*spans*(len(objs)-1)
-        faces=[]
-        for i in range(0, nfaces):
-            d = int(i/steps)
-            f = [i+d,i+d+1, i+d+steps+2, i+d+steps+1]
-            #inverts normals
-            #f = [i+d,i+d+steps+1, i+d+steps+2, i+d+1]
-            faces.append(f)
-
-
-        me = bpy.data.meshes.new("Loft")
-        me.from_pydata(verts,[], faces)
-        me.update()
-        newobj = bpy.data.objects.new("Loft", me)
-        #newobj.data = me
-        scn = context.scene
-        scn.objects.link(newobj)
-        scn.objects.active = newobj
-        newobj.select = True
-        bpy.ops.object.shade_smooth()
-
-        #the object stores its own steps and spans
-        #this way the driver will know how to deform the mesh
-        newobj["steps"] = steps
-        newobj["spans"] = spans
-
-        if intype==3:
-            newobj['tension'] = context.scene.tension
-            newobj['bias'] = context.scene.bias
-
-
-        if context.scene.dodriver:
-            createloftdriver(objs, newobj, intype)
-
-        return {'FINISHED'}
-
-class UpdateFix(bpy.types.Operator):
-    """Tooltip"""
-    bl_idname = "mesh.update_fix"
-    bl_label = "Update fix"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        #print("------------")
-#       for it in bpy.app.driver_namespace:
-#           print(it)
-        bpy.app.driver_namespace['loftdriver'] = loftdriver
-        bpy.app.driver_namespace['birail1driver'] = birail1driver
-        for obj in context.scene.objects:
-            if obj.type=="CURVE" and obj.animation_data!=None and len(obj.animation_data.drivers)>0:
-                for drv in obj.animation_data.drivers:
-                    if drv.data_path=='["driver"]':
-                        cad = drv.driver.expression
-                        drv.driver.expression = ""
-                        drv.driver.expression = cad
-
-        return {'FINISHED'}
-
-
-#derives a curve at a given parameter
-def deriv(curve, t, unit=False):
-
-    a = t + 0.001
-    if t==1: a=t-0.001
-
-    pos = calct(curve, t)
-    der = (pos-calct(curve, a))/(t-a)
-    if unit:
-        der = der/der.magnitude
-    return der
-
-### BIRAIL1 BLOCK
-
-
-#see explanation video about the construction
-#http://vimeo.com/25455967
-
-#calculates birail vertices
-
-### TODO: when the 3 curves are coplanar it should fail, cause the cross product. check that
-def birail1(objs, steps, spans, proportional):
-
-    profile=objs[0]
-    ### TODO: identify which path is left or right
-    path1 = objs[1]
-    path2 = objs[2]
-
-    trans = []
-
-    r0 = [calct(path1,0), calct(path2, 0)]
-    r0mag = (r0[1]-r0[0]).magnitude
-
-    for i in range(0, steps):
-        u = i/(steps-1)
-        appr0 = r0[0]+(r0[1]-r0[0])*u
-        trans.append(calct(profile, u)-appr0)
-
-    der10 = deriv(path1, 0)
-    der20 = deriv(path2, 0)
-
-    verts = []
-
-    mult = 1.0
-
-    for i in range(0, spans):
-        v = i/(spans-1)
-        r = [calct(path1, v),calct(path2, v)]
-        rmag = (r[1]-r[0]).magnitude
-
-        der1 = deriv(path1, v)
-        der2 = deriv(path2, v)
-
-        angle1 = der10.angle(der1)
-        angle2 = der20.angle(der2)
-
-        #if angle1!=0.0 and angle2!=0: we can avoid some operations by doing this check but im lazy
-        cr1 = der1.cross(der10)
-        rot1 = Matrix().Rotation(-angle1, 3, cr1)
-
-        cr2 = der2.cross(der20)
-        rot2 = Matrix().Rotation(-angle2, 3, cr2)
-
-        if proportional:
-            mult = rmag/r0mag
-
-        for j in range(0, steps):
-            u = j/(steps-1)
-
-            app = r[0]+(r[1]-r[0])*u
-
-            newtr1 = trans[j].copy()
-            newtr1.rotate(rot1)
-
-            newtr2 = trans[j].copy()
-            newtr2.rotate(rot2)
-
-            r1 = (newtr1-trans[j])*(1-u)
-            r2 = (newtr2-trans[j])*(u)
-
-            res = r1+r2+app+mult*trans[j]
-
-            verts.append(res)
-
-    return verts
-
-
-#same as loft driver
-### TODO check if it is registered
-def birail1driver(name, objs):
-
-    objs = objs.split(";")
-    #objs = objs[0:-1]
-
-    for i, l in enumerate(objs):
-        objs[i] = bpy.data.objects[l]
-
-    try:
-        resobj = bpy.data.objects[name]
-        spans = resobj["spans"]
-        steps = resobj["steps"]
-        prop = resobj["prop"]
-
-    except:
-        curve = bpy.context.object
-        curve.driver_remove('["driver"]')
-        return False
-
-    vxs = birail1(objs, steps, spans, prop)
-
-    me = resobj.data
-
-    for i in range(0, len(me.vertices)):
-        me.vertices[i].co = vxs[i]
-    me.update()
-    return spans
-
-def createbirail1driver(objs, res):
-
-    line = ""
-    for obj in objs:
-        line+=obj.name+";"
-    line=line[0:-1]
-    for obj in objs:
-        obj["driver"] = 1.0
-        obj.driver_add('["driver"]')
-        obj.animation_data.drivers[0].driver.expression = "birail1driver('"+ res.name +"', '" + line + "')"
-
-### TODO: check polls and if initial variables are ok to perform the birail
-class Birail1Operator(bpy.types.Operator):
-
-    bl_idname = "mesh.birail1_operator"
-    bl_label = "Birail between 3 bezier curves"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-
-        objs = bpy.selection
-
-        if len(objs)!=3:
-            self.report({'ERROR'},"Please select 3 curves")
-            return {'FINISHED'}
-
-        scn = context.scene
-        spans = scn.spans
-        steps = scn.steps
-        prop = scn.proportional
-
-        verts = birail1(objs, steps, spans, prop)
-
-        if verts!=[]:
-            faces=[]
-
-            nfaces = (steps-1)*(spans-1)
-
-            for i in range(0, nfaces):
-                d = int(i/(steps-1))
-                f = [i+d+1, i+d, i+d+steps, i+d+steps+1 ]
-                faces.append(f)
-
-            me = bpy.data.meshes.new("Birail")
-            me.from_pydata(verts,[], faces)
-            me.update()
-            newobj = bpy.data.objects.new("Birail", me)
-            newobj.data = me
-
-            scn.objects.link(newobj)
-            scn.objects.active = newobj
-            newobj.select = True
-            bpy.ops.object.shade_smooth()
-            newobj['steps']=steps
-            newobj['spans']=spans
-            newobj['prop']=prop
-
-            if scn.dodriver:
-                createbirail1driver(objs, newobj)
-
-        return {'FINISHED'}
-
-#register the drivers
-bpy.app.driver_namespace['loftdriver'] = loftdriver
-bpy.app.driver_namespace['birail1driver'] = birail1driver
-
-### MERGE SPLINES BLOCK
-
-#reads spline points
-#spl spline to read
-#rev reads the spline forward or backwards
-def readspline(spl, rev=0):
-    res = []
-
-    if spl.type=="BEZIER":
-        points = spl.bezier_points
-        for p in points:
-            if rev:
-                h2 = p.handle_left
-                h1 = p.handle_right
-                h2type = p.handle_left_type
-                h1type = p.handle_right_type
-            else:
-                h1 = p.handle_left
-                h2 = p.handle_right
-                h1type = p.handle_left_type
-                h2type = p.handle_right_type
-
-            co = p.co
-            res.append([h1, co, h2, h1type, h2type])
-    if rev:
-        res.reverse()
-
-    return res
-
-#returns a new merged spline
-#cu curve object
-#pts1 points from the first spline
-#pts2 points from the second spline
-
-def merge(cu, pts1, pts2):
-    newspl = cu.data.splines.new(type="BEZIER")
-    for i, p in enumerate(pts1):
-
-        if i>0: newspl.bezier_points.add()
-        newspl.bezier_points[i].handle_left = p[0]
-        newspl.bezier_points[i].co = p[1]
-        newspl.bezier_points[i].handle_right = p[2]
-        newspl.bezier_points[i].handle_left_type = p[3]
-        newspl.bezier_points[i].handle_right_type = p[4]
-
-    newspl.bezier_points[-1].handle_right_type="FREE"
-    newspl.bezier_points[-1].handle_left_type="FREE"
-
-    newspl.bezier_points[-1].handle_right = pts2[0][2]
-
-
-    for j in range(1, len(pts2)):
-
-        newspl.bezier_points.add()
-        newspl.bezier_points[-1].handle_left = pts2[j][0]
-        newspl.bezier_points[-1].co = pts2[j][1]
-        newspl.bezier_points[-1].handle_right = pts2[j][2]
-        newspl.bezier_points[-1].handle_left_type = pts2[j][3]
-        newspl.bezier_points[-1].handle_right_type = pts2[j][4]
-
-    return newspl
-
-#looks if the splines first and last points are close to another spline
-### TODO: Check if the objects selected are valid
-### if possible implement nurbs
-
-class MergeSplinesOperator(bpy.types.Operator):
-
-    bl_idname = "curve.merge_splines"
-    bl_label = "Merges spline points inside a limit"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        curves = []
-        limit = context.scene.limit
-        print("merguing")
-        for obj in context.selected_objects:
-            if obj.type=="CURVE":
-                curves.append(obj)
-
-        for cu in curves:
-            splines = []
-            for spl in cu.data.splines:
-                splines.append(spl)
-            print(splines)
-            #compares all the splines inside a curve object
-            for spl1 in splines:
-                for spl2 in splines:
-                    print(spl1, spl2)
-                    if spl1!=spl2 and spl1.type==spl2.type=="BEZIER" and spl1.use_cyclic_u==spl2.use_cyclic_u==False:
-                        print("not cyclic")
-                        if len(spl1.bezier_points)>1  and len(spl2.bezier_points)>1:
-
-                            #edges of the 2 splines
-                            p1i = spl1.bezier_points[0].co
-                            p1f = spl1.bezier_points[-1].co
-                            p2i = spl2.bezier_points[0].co
-                            p2f = spl2.bezier_points[-1].co
-
-                            if dist(p1i, p2i)<limit:
-                                print("join p1i p2i")
-
-                                p1 = readspline(spl2, 1)
-                                p2 = readspline(spl1)
-                                res=merge(cu, p1, p2)
-                                cu.data.splines.remove(spl1)
-                                cu.data.splines.remove(spl2)
-                                splines.append(res)
-                                break
-                            elif dist(p1i, p2f)<limit:
-                                print("join p1i p2f")
-                                p1 = readspline(spl2)
-                                p2 = readspline(spl1)
-                                res = merge(cu, p1, p2)
-                                cu.data.splines.remove(spl1)
-                                cu.data.splines.remove(spl2)
-                                splines.append(res)
-                                break
-                            elif dist(p1f, p2i)<limit:
-                                print("join p1f p2i")
-                                p1 = readspline(spl1)
-                                p2 = readspline(spl2)
-                                res = merge(cu, p1, p2)
-                                cu.data.splines.remove(spl1)
-                                cu.data.splines.remove(spl2)
-                                splines.append(res)
-                                break
-                            elif dist(p1f, p2f)<limit:
-                                print("unir p1f p2f")
-                                p1 = readspline(spl1)
-                                p2 = readspline(spl2, 1)
-                                res = merge(cu, p1, p2)
-                                cu.data.splines.remove(spl1)
-                                cu.data.splines.remove(spl2)
-                                splines.append(res)
-                                break
-
-        #splines.remove(spl1)
-        return {'FINISHED'}
-
-### NURBS WEIGHTS
-
-class NurbsWeightsPanel(bpy.types.Panel):
-    bl_label = "Nurbs Weights"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOLS"
-    #bl_context = "data"
-
-    @classmethod
-    def poll(cls, context):
-        if context.active_object != None and context.active_object.type =="CURVE" and context.active_object.data.splines.active!=None and context.active_object.data.splines.active.type=="NURBS":
-            return True
-        else:
-            return False
-
-
-    def draw(self, context):
-        layout = self.layout
-
-        obj = context.object
-
-        for p in obj.data.splines.active.points:
-            if p.select:
-                row = layout.row()
-                row.prop(p,  "weight")
-
-### CUT / SUBDIVIDE CURVE
-#obj curve object
-#t parameter to perform the cut or split
-#method True = subdivide, Flase= Split
-
-def cutcurve(obj, t, method=True):
-
-    #flocal to global transforms or viceversa
-
-
-    #retrieves the active spline or the first spline if there no one active
-
-    spline=None
-    if obj.data.splines.active==None:
-        for sp in obj.data.splines:
-            if sp.type=="BEZIER":
-                spline= sp
-                break
-    else:
-        if obj.data.splines.active.type!="BEZIER":
-            return False
-        else:
-            spline=obj.data.splines.active
-
-    if spline==None: return False
-
-    points = spline.bezier_points
-    nsegs = len(points)-1
-
-    #transform global t into local t1
-    d = 1.0/nsegs
-    seg = int(t/d)
-    t1 = t/d-int(t/d)
-    if t>=1.0:
-        t=1.0
-        seg-=1
-        t1 = 1.0
-
-    #if t1 is not inside a segment dont perform any action
-    if t1>0.0 and t1<1.0:
-        mw = obj.matrix_world
-        mwi = obj.matrix_world.copy().inverted()
-
-        pts = getbezpoints(spline, mw, seg)
-
-        #position on the curve to perform the action
-        pos = calct(obj, t)
-
-        #De Casteljau's algorithm to get the handles
-        #http://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm
-        h1 = pts[0]+(pts[1]-pts[0])*t1
-        h4 = pts[2]+(pts[3]-pts[2])*t1
-        r = pts[1]+(pts[2]-pts[1])*t1
-        h2 = h1+(r-h1)*t1
-        h3 = r+(h4-r)*t1
-
-
-        if method:
-            #SUBDIVIDE
-            splp = []
-            type = "ALIGNED"
-            for i, p in enumerate(points):
-                ph1 = p.handle_left*mw
-                pco = p.co*mw
-                ph2 = p.handle_right*mw
-                ph1type = p.handle_left_type
-                ph2type = p.handle_right_type
-                splp.append([ph1, pco, ph2, ph1type, ph2type])
-                p.handle_left_type = type
-                p.handle_right_type = type
-
-                if i==seg:
-                    splp[-1][2]=h1
-                    splp.append([h2, pos, h3, type, type])
-
-                if i==seg+1:
-                    splp[-1][0]=h4
-                    splp[-1][3]=type
-                    splp[-1][4]=type
-                #if i dont set all the handles to "FREE"
-                #it returns weirds result
-                ### TODO: find out how to preserve handle's types
-
-            points.add()
-            for i, p in enumerate(points):
-                p.handle_left_type = "FREE"
-                p.handle_right_type ="FREE"
-                p.handle_left = splp[i][0]*mwi
-                p.co = splp[i][1]*mwi
-                p.handle_right=splp[i][2]*mwi
-                p.handle_left_type = splp[i][3]
-                p.handle_right_type =splp[i][4]
-        else:
-            #SPLIT CURVE
-            spl1 = []
-            spl2 = []
-            k=0 #changes to 1 when the first spline is processed
-            type = "ALIGNED"
-            for i, p in enumerate(points):
-                ph1 = p.handle_left*mw
-                pco = p.co*mw
-                ph2 = p.handle_right*mw
-                ph1type = p.handle_left_type
-                ph2type = p.handle_right_type
-                if k==0:
-                    spl1.append([ph1, pco, ph2, ph1type, ph2type])
-                else:
-                    spl2.append([ph1, pco, ph2, ph1type, ph2type])
-
-                if i==seg:
-                    spl1[-1][2]=h1
-                    spl1.append([h2, pos, h3, type, type])
-                    spl2.append([h2, pos, h3, type, type])
-                    k=1
-
-                if i==seg+1:
-                    spl2[-1][0]=h4
-                    spl2[-1][3]=type
-                    spl2[-1][4]=type
-
-            sp1 = obj.data.splines.new(type="BEZIER")
-            for i, p in enumerate(spl1):
-                if i>0: sp1.bezier_points.add()
-                sp1.bezier_points[i].handle_left_type = "FREE"
-                sp1.bezier_points[i].handle_right_type ="FREE"
-                sp1.bezier_points[i].handle_left = spl1[i][0]*mwi
-                sp1.bezier_points[i].co = spl1[i][1]*mwi
-                sp1.bezier_points[i].handle_right=spl1[i][2]*mwi
-                #i tried to preserve the handles here but
-                #didnt work well
-
-                sp1.bezier_points[i].handle_left_type = spl1[i][3]
-                sp1.bezier_points[i].handle_right_type =spl1[i][4]
-
-            sp2 = obj.data.splines.new(type="BEZIER")
-            for i, p in enumerate(spl2):
-                if i>0: sp2.bezier_points.add()
-                sp2.bezier_points[i].handle_left_type = "FREE"
-                sp2.bezier_points[i].handle_right_type = "FREE"
-                sp2.bezier_points[i].handle_left = spl2[i][0]*mwi
-                sp2.bezier_points[i].co = spl2[i][1]*mwi
-                sp2.bezier_points[i].handle_right=spl2[i][2]*mwi
-                sp2.bezier_points[i].handle_left_type = spl2[i][3]
-                sp2.bezier_points[i].handle_right_type =spl2[i][4]
-
-            obj.data.splines.remove(spline)
-
-class CutCurveOperator(bpy.types.Operator):
-    """Subdivide / Split a bezier curve"""
-    bl_idname = "curve.cut_operator"
-    bl_label = "Cut curve operator"
-
-    #cut or split
-    method = bpy.props.BoolProperty(default=False)
-    t = 0.0
-
-    @classmethod
-    def poll(self, context):
-        if context.active_object!=None:
-            return context.active_object.type=="CURVE"
-        else:
-            return False
-
-
-    def modal(self, context, event):
-
-        if event.type == 'MOUSEMOVE':
-            #full screen width
-            #not tested for multiple monitors
-            fullw = context.window_manager.windows[0].screen.areas[0].regions[0].width
-
-            self.t = event.mouse_x/fullw
-
-            #limit t to [0,...,1]
-            if self.t<0:
-                self.t=0.0
-            elif self.t>1.0:
-                self.t=1.0
-
-            obj = context.object
-            pos = calct(obj, self.t)
-
-            #if calct() detects a non bezier spline returns false
-            if pos==False:
-                return {'CANCELLED'}
-            cursor(pos)
-
-        elif event.type == 'LEFTMOUSE':
-            #print(self.method, self.t)
-            cutcurve(context.object, self.t, self.method)
-            return {'FINISHED'}
-
-        elif event.type in {'RIGHTMOUSE', 'ESC'}:
-            #print("Cancelled")
-
-            return {'CANCELLED'}
-
-        return {'RUNNING_MODAL'}
-
-    def invoke(self, context, event):
-
-        if context.object:
-            context.window_manager.modal_handler_add(self)
-            return {'RUNNING_MODAL'}
-        else:
-            self.report({'WARNING'}, "No active object, could not finish")
-            return {'CANCELLED'}
-
-### CURVE SNAP BLOCK
-
-class AllowCurveSnap(bpy.types.Operator):
-    bl_idname = "curve.allow_curve_snap"
-    bl_label = "Allow Curve Snap"
-
-    add = bpy.props.BoolProperty()
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object!=None
-
-    def execute(self, context):
-        add = self.add
-
-        scn = context.scene
-
-        if add==False:
-            for helper in context.scene.objects:
-                for key  in helper.keys():
-                    print(key)
-                    if key=="is_snap_helper" and helper[key]==1:
-                        scn.objects.unlink(helper)
-        else:
-            #objs = context.selected_objects
-            objs = context.scene.objects
-            for obj in objs:
-                if obj.type=="CURVE":
-
-                    res = obj.data.resolution_u
-
-                    obj.data.resolution_u = 100
-
-                    me = obj.to_mesh(scene=scn, apply_modifiers=True,settings = "PREVIEW" )
-                    obj.data.resolution_u = res
-                    newobj = bpy.data.objects.new(obj.name+"_snap", me)
-                    scn.objects.link(newobj)
-                    newobj.layers = obj.layers
-                    newobj.matrix_world = obj.matrix_world
-                    newobj["is_snap_helper"]=True
-                    newobj.hide_render=True
-                    newobj.hide_select = True
-                    cons = newobj.constraints.new(type="COPY_TRANSFORMS")
-                    cons.target =obj
-
-        return {'FINISHED'}
-
-def menu_func(self, context):
-    self.layout.operator("curve.allow_curve_snap").add=True
-    self.layout.operator("curve.allow_curve_snap", text = "Delete Snap Helpers").add=False
-
-### PANEL
-class CurvePanel(bpy.types.Panel):
-    bl_label = "Curve Tools"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOLS"
-    #bl_options = {'REGISTER', 'UNDO'}
-    #bl_context = "data"
-    bl_options = {'DEFAULT_CLOSED'}
-    steps = IntProperty(min=2, default = 12)
-
-    @classmethod
-    def poll(cls, context):
-        return (context.active_object != None) and (context.active_object.type=="CURVE")
-    def draw(self, context):
-        layout = self.layout
-
-        obj = context.object
-        scn = context.scene
-
-        align = True
-        row = layout.row(align=align)
-
-        row.prop(context.scene, "intype", text = "")
-        row.prop(context.scene, "dodriver", text = "Driven")
-        if scn.intype=='3': #Hermite interp
-            row = layout.row(align=align)
-            row.prop(scn, "tension")
-            row.prop(scn, "bias")
-
-        row = layout.row(align=align)
-        row.prop(context.scene, "steps")
-        row.prop(context.scene, "spans")
-        row = layout.row(align=align)
-        row.operator("mesh.loft_operator", text = "Loft")
-        row.operator("mesh.update_fix", text = "Update Fix")
-        row = layout.row(align=align)
-        row.operator("mesh.birail1_operator", text = "Birail 1")
-        row.prop(context.scene, "proportional", text = "Proportional")
-        row = layout.row(align=align)
-        row.operator("curve.arc_length_operator", text = "Calc Length")
-        row.prop(context.scene, "clen", text = "")
-        row = layout.row(align=align)
-        row.operator("curve.merge_splines", text = "Merge")
-        row.prop(context.scene,"limit",  text = "Limit")
-        row = layout.row(align=align)
-        row.operator("curve.cut_operator", text="Subdivide").method=True
-        row.operator("curve.cut_operator", text="Split").method=False
-
-#       col1 = row.column()
-#       col1.prop(context.scene, "intype", text = "")
-#       col1.prop(context.scene, "dodriver", text = "Driven")
-#       row = layout.row(align=align)
-#       col2 = row.column(align=align)
-#       col2.prop(context.scene, "steps")
-#       col2.prop(context.scene, "spans")
-#       row = layout.row(align=align)
-#       row.operator("mesh.loft_operator", text = "Loft")
-#       row.operator("mesh.update_fix", text = "Update Fix")
-#       row = layout.row(align=align)
-#       row.operator("mesh.birail1_operator", text = "Birail 1")
-#       row.prop(context.scene, "proportional", text = "Proportional")
-#       row = layout.row(align=align)
-#       row.operator("curve.arc_length_operator", text = "Calc Length")
-#       row.prop(context.scene, "clen", text = "")
-#       row = layout.row(align=align)
-#       row.operator("curve.merge_splines", text = "Merge")
-#       row.prop(context.scene,"limit",  text = "Limit")
-#       row = layout.row(align=align)
-#       row.operator("curve.cut_operator", text="Subdivide").method=True
-#       row.operator("curve.cut_operator", text="Split").method=False
-
-classes = [AllowCurveSnap, Selection, LoftOperator, Birail1Operator,
-            ArcLengthOperator, UpdateFix, MergeSplinesOperator, CutCurveOperator, NurbsWeightsPanel, CurvePanel]
-
-bpy.app.driver_namespace['loftdriver'] = loftdriver
-bpy.app.driver_namespace['birail1driver'] = birail1driver
-
-def register():
-
-    domenu=1
-    for op in dir(bpy.types):
-        if op=="CURVE_OT_allow_curve_snap":
-            domenu=0
-            break
-    if domenu:
-        bpy.types.VIEW3D_MT_object_specials.append(menu_func)
-
-    for c in classes:
-        bpy.utils.register_class(c)
-
-def unregister():
-    for c in classes:
-        bpy.utils.unregister_class(c)
-
-    bpy.types.VIEW3D_MT_object_specials.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/development_class_viewer.py b/release/scripts/addons_contrib/development_class_viewer.py
deleted file mode 100644
index 31a0a5c..0000000
--- a/release/scripts/addons_contrib/development_class_viewer.py
+++ /dev/null
@@ -1,194 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Class Viewer",
-    "author": "Mackraken", "batFinger"
-    "version": (0, 1, 2),
-    "blender": (2, 58, 0),
-    "location": "Text Editor > Toolbar, Text Editor > Right Click",
-    "warning": "",
-    "description": "List classes and definitions of a text block",
-    "wiki_url": "https://sites.google.com/site/aleonserra/home/scripts/class-viewer",
-    "category": "Development"}
-
-import bpy
-
-#lists all defs, comment or classes
-#space = current text editor
-#sort = sort result
-#tipo = kind of struct to look for
-#escape = character right next to the class or def name 
-
-def getfunc(space, sort, tipo="def ", escape= ""):
-    defs = []
-    if space.type=="TEXT_EDITOR":
-        if space.text!=None:
-            txt = space.text
-            
-            for i, l in enumerate(txt.lines):
-                try:
-                    line = l.body
-                except:
-                    line=""
-                
-                if line[0:len(tipo)]==tipo:
-                    end = line.find(escape)
-                    if end==0:
-                        func = line[len(tipo)::]
-                    else:
-                        func = line[len(tipo):end]
-                    defs.append([func, i+1])
-            
-            if sort: defs.sort()
-    
-    return defs
-
-class TEXT_OT_Jumptoline(bpy.types.Operator):
-    bl_label = "Jump"
-    bl_idname = "text.jumptoline"
-    __doc__ = "Jump to line"
-    line = bpy.props.IntProperty(default=-1)
-    
-    @classmethod
-    def poll(cls, context):
-        if context.area.spaces[0].type!="TEXT_EDITOR":
-            return False
-        else: 
-            return context.area.spaces[0].text!=None
-    
-    def execute(self, context):
-        
-        scn = context.scene
-
-        if self.line!=-1:
-            bpy.ops.text.jump(line=self.line)
-
-        return {'FINISHED'}
-
-
-
-class CommentsMenu(bpy.types.Menu):
-    bl_idname = "OBJECT_MT_select_comments"
-    bl_label = "Select"
-    
-    
-    
-    @classmethod
-    def poll(cls, context):
-        if context.area.spaces[0].type!="TEXT_EDITOR":
-            return False
-        else: 
-            return context.area.spaces[0].text!=None
-        
-    def draw(self, context):
-    
-        layout = self.layout
-        space = context.area.spaces[0]
-        
-        items = getfunc(space, 1, "### ", "")
-        
-        for it in items:
-            layout.operator("text.jumptoline",text=it[0]).line = it[1]
-
-class DefsMenu(bpy.types.Menu):
-    bl_idname = "OBJECT_MT_select_defs"
-    bl_label = "Select"
-    
-    tipo = bpy.props.BoolProperty(default=False)
-    
-    @classmethod
-    def poll(cls, context):
-        if context.area.spaces[0].type!="TEXT_EDITOR":
-            return False
-        else: 
-            return context.area.spaces[0].text!=None
-        
-    def draw(self, context):
-        scn = context.scene
-        layout = self.layout
-        space = context.area.spaces[0]
-        tipo = self.tipo
-        
-        
-        items = getfunc(space, 1, "def ", "(")
-        
-        for it in items:
-            layout.operator("text.jumptoline",text=it[0]).line = it[1]
-                
-class ClassesMenu(bpy.types.Menu):
-    bl_idname = "OBJECT_MT_select_classes"
-    bl_label = "Select"
-    
-    
-    
-    @classmethod
-    def poll(cls, context):
-        if context.area.spaces[0].type!="TEXT_EDITOR":
-            return False
-        else: 
-            return context.area.spaces[0].text!=None
-        
-    def draw(self, context):
-    
-        layout = self.layout
-        space = context.area.spaces[0]
-    
-        
-        
-        items = getfunc(space, 1, "class ", "(")
-        
-        for it in items:
-            layout.operator("text.jumptoline",text=it[0]).line = it[1]
-
-
-            
-def GotoComments(self, context): 
-    self.layout.menu("OBJECT_MT_select_comments", text="Comments", icon='PLUGIN')
-    return False
-
-def GotoDefs(self, context): 
-    self.layout.menu("OBJECT_MT_select_defs", text="Defs", icon='PLUGIN')
-    return False
-
-def GotoClasses(self, context): 
-    self.layout.menu("OBJECT_MT_select_classes", text="Classes", icon='PLUGIN')
-    return False
-
-
-classes = [TEXT_OT_Jumptoline, ClassesMenu, DefsMenu, CommentsMenu]
-
-
-def register():
-    for c in classes:
-        bpy.utils.register_class(c)
-        
-    bpy.types.TEXT_MT_toolbox.append(GotoComments)
-    bpy.types.TEXT_MT_toolbox.append(GotoDefs)
-    bpy.types.TEXT_MT_toolbox.append(GotoClasses)
-
-def unregister():
-    for c in classes:
-        bpy.utils.unregister_class(c)
-        
-        bpy.types.TEXT_MT_toolbox.remove(GotoComments)
-    bpy.types.TEXT_MT_toolbox.remove(GotoDefs)
-    bpy.types.TEXT_MT_toolbox.remove(GotoClasses)
-    
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/game_engine_ragdolls_kit/__init__.py b/release/scripts/addons_contrib/game_engine_ragdolls_kit/__init__.py
deleted file mode 100644
index 75ea386..0000000
--- a/release/scripts/addons_contrib/game_engine_ragdolls_kit/__init__.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# Script copyright (C) Marcus Jenkins (Blenderartists user name FunkyWyrm)
-# Modified by Kees Brouwer (Blenderartists user name Wraaah)
-#
-# 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 *****
-# --------------------------------------------------------------------------
-
-bl_info = {
-    "name": "BRIK - Blender Ragdoll Implementation Kit",
-    "author": "FunkyWyrm",
-    "version": (0,2),
-    "blender": (2, 55, 0),
-    "api": 31965,
-    "location": "View 3D > Tool Shelf > BRIK Panel",
-    "description": "Kit for creating ragdoll structures from armatures and implementing them in the game engine.",
-    "warning": "Preliminary release for testing purposes. Use with caution on important files.",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
-        "Scripts/Game_Engine/BRIK_ragdolls",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=24946",
-    "category": "Game Engine"}
-
-
-if "bpy" in locals():
-    import imp
-    imp.reload(brik)
-else:
-    from . import brik
-
-import bpy
-
-################################################################################
-
-##### REGISTER #####
-def register():
-    #Register brik add-on
-    bpy.utils.register_module(__name__)
-
-    #Set-up gui menu properties using the bpy.types.Scene type
-    scnType = bpy.types.Scene
-    
-    FloatProperty = bpy.props.FloatProperty
-    scnType.brik_ragdoll_mass = FloatProperty( name = "Ragdoll mass", 
-                                               default = 80.0, min = 0.05, max= 99999,
-                                               description = "The total mass of the ragdoll rigid body structure created with BRIK",  
-                                               update = brik.calc_ragdoll_mass)
-                                    
-    # triplet setup.... ( return value, name, description )
-    EnumProperty = bpy.props.EnumProperty
-    menu_options = [  ( "All", "All", "Use all armature bones" ) ]
-    #enumProp = EnumProperty( name = "Bone selection", items = menu_options, 
-    enumProp = EnumProperty( name = "Bone selection", items = brik_bone_list, 
-                    description = "Use the bones from the selected bone group" )
-  
-    scnType.brik_bone_groups = enumProp
-    pass
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    pass
-    
-def brik_bone_list(self, context):
-    ob = bpy.context.object
-    group_list = [  ( "All", "All", "Use all armature bones" ) ]
-    if ob.type == 'ARMATURE':
-        #Select bone groups
-        ob_pose = ob.pose
-        bone_groups = ob_pose.bone_groups
-        for item in bone_groups:
-            group_list = group_list + [(item.name, item.name, "Use bones in selected bone group")]
-            
-    return group_list
-
-if __name__ == "__main__":
-    register()
-    
diff --git a/release/scripts/addons_contrib/game_engine_ragdolls_kit/brik.py b/release/scripts/addons_contrib/game_engine_ragdolls_kit/brik.py
deleted file mode 100644
index 6cafaa5..0000000
--- a/release/scripts/addons_contrib/game_engine_ragdolls_kit/brik.py
+++ /dev/null
@@ -1,1243 +0,0 @@
-#brik_0_2.py
-
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# Script copyright (C) Marcus Jenkins (Blenderartists user name FunkyWyrm)
-# Modified by Kees Brouwer (Blenderartists user name Wraaah)
-#
-# 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 *****
-# --------------------------------------------------------------------------
-
-"""
-brik is the Blender Ragdoll Implementation Kit.
-
-It aims to provide a tool kit that enables the easy implementation of ragdolls in Blender.
-
-Acnowledgements:
-    This section comes first because I am grateful to Thomas Eldredge (teldredge on
-www.blenderartists.com). Without his great script to take apart, I would never have got
-around to this even though it's been in my todo list for a while. The link to his thread is
-http://blenderartists.org/forum/showthread.php?t=152150
-    
-Website:
-    Blenderartists script development thread is:
-    http://blenderartists.org/forum/showthread.php?t=199191
-
-Bugs:
-    
-    Editing a text file after hitting the create or destroy button and then
-    changing an option such as writing the hierarchy file will undo the edits
-    to the text. This is a known bug due to the lack of a text editor global
-    undo push. See the bug tracker:
-        https://projects.blender.org/tracker/index.php?func=detail&aid=21043&group_id=9&atid=498
-            
-    Creating rigid body structures based on multiple armatures in the scene that have similarly
-    named bones can cause some rigid body objects to be removed. This can probably be fixed by
-    testing for membership of a group. However, similarly named bones should be renamed to a
-    unique name since bone name and driver object name being similar is essential for correct
-    operation of both the brik script and the brik_Use_doll game engine script.
-    
-    Running Create multiple times on the same armature will recreate the rigid body joints
-    rather than editing existing ones.
-
-Notes:
-    
-    The mass of each object could be calculated using their volume. The
-    armature could be assigned a mass and the bones' mass could be calculated
-    from this using their volume.
-    
-    Non-deforming bones do not have rigid body objects created for them. 
-    Perhaps this would be better given as a toggle option.
-"""
-
-import bpy
-from bpy.props import *
-import mathutils
-from mathutils import Vector
-from game_engine_ragdolls_kit.brik_funcs import *
-
-class VIEW3D_PT_brik_panel(bpy.types.Panel):
-
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_context = 'objectmode'
-    bl_label = 'brik'
-    bl_options = {'DEFAULT_CLOSED'}  
-    
-    #Draws the panel header in the tools pane
-    def draw_header(self, context):
-        layout = self.layout
-        layout.label(text='', icon='CONSTRAINT_BONE')
-        
-    #Draws the brik panel in the tools pane
-    def draw(self, context):
-        ob = bpy.context.object
-        scn = bpy.context.scene
-        layout = self.layout
-
-        col = layout.column()
-        
-        if ob:
-            col.prop(ob, 'name', text = 'Selected', icon = 'OUTLINER_OB_'+str(ob.type))
-    
-            layout.separator()
-    
-            box = layout.box()
-            box.label(text = 'Create or remove?')
-                
-            
-            if ob.type == 'ARMATURE':
-                brik_structure = 'brik_structure_created' in ob.keys() and ob['brik_structure_created']
-                hitboxes = 'brik_hit_boxes_created' in ob.keys() and ob['brik_hit_boxes_created']
-                
-                col.label(text = 'BRIK structure settings')
-                row = col.row()
-                col.prop( scn, "brik_ragdoll_mass" )      
-                col.prop( scn, "brik_bone_groups" )   
-                
-                col = box.column(align=True)
-                row = col.row()
-                row.active = not(brik_structure)
-                row.operator('object.brik_create_structure', text = 'Create structure')
-                
-                row = col.row()
-                row.active = brik_structure
-                row.operator('object.brik_destroy_structure', text = 'Remove structure')
-                
-                row = col.row()
-                row.active = not(hitboxes)
-#                col = box.column(align = True)
-                row.operator('object.brik_create_hit_boxes', text = 'Create hit boxes')
-                
-                row = col.row()
-                row.active = hitboxes
-                row.operator('object.brik_remove_hit_boxes', text = 'Remove hit boxes')
-                
-                row = col.row()
-                row.active = hitboxes and brik_structure
-                row.operator('object.brik_link_structure', text = 'Link objects')
-                
-            else:
-                box.label(text='Select armature')
-                
-            game_options_active = 'brik_structure_created' in ob.keys() and ob['brik_structure_created'] \
-                                    and 'brik_hit_boxes_created' in ob.keys() and ob['brik_hit_boxes_created']
-            col = box.column(align = True)
-            col.active = game_options_active
-            col.label(text='Game options:')
-            col.operator('object.brik_write_game_file', text = 'Write game file')
-            create_logic_active = 'brik_file_written' in ob.keys() and ob['brik_file_written']
-            row = col.row()
-            row.active = create_logic_active
-            row.operator('object.brik_create_game_logic', text = 'Create game logic')
-                
-        else:
-            col.label(text='Select an object')
-            
-        def test_func(operator):
-            print(operator)
-            
-class brik_link_structure(bpy.types.Operator):
-    bl_label = 'brik link structure operator'
-    bl_idname = 'object.brik_link_structure'
-    bl_description = 'Links the object data of the hitboxes and corresponding rigid bodies'
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    def draw(self, context):
-        #No menu options available
-        pass
-    #Create links
-    def execute(self, context):
-        armature = bpy.context.active_object
-        driver_dict = armature['brik_bone_driver_dict']
-        hitbox_dict = armature['brik_bone_hit_box_dict']
-        objects = bpy.data.objects
-        for bone_name in hitbox_dict:
-            hitbox = objects[hitbox_dict[bone_name]]
-#            print(driver_dict, bone_name, objects)
-            driver_box = objects[driver_dict[bone_name]]
-            #select hitbox
-            select_name(name = hitbox_dict[bone_name], extend = False)
-            #select driver_box
-            select_name(name = driver_dict[bone_name], extend = True)
-            #create link
-            bpy.ops.object.make_links_data(type='OBDATA')
-        #return original selection
-        select_name(name = armature.name, extend = False)
-        
-        return{'FINISHED'}
-
-class brik_create_structure(bpy.types.Operator):
-    bl_label = 'brik create structure operator'
-    bl_idname = 'object.brik_create_structure'
-    bl_description = 'Create a rigid body structure based on an amature.'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    #Properties that can be changed by the user
-
-    prefix = StringProperty(name='Prefix', \
-                            description='Prefix to be appended to the bone name that defines the rigid body object.',\
-                            default='RB_')
-    
-    driver_length = FloatProperty(name='Driver length',\
-                              description='Length of rigid body driver objects as proportion of bone length.',\
-                              min=0.05,\
-                              max=1.0,\
-                              step=0.05,\
-                              default=0.8)
-    
-    driver_width = FloatProperty(name = 'Driver width',\
-                                  description='Width of rigid body driver objects as proportion of bone length',\
-                                  min=0.05,\
-                                  max=1.0,\
-                                  step=0.05,\
-                                  default=0.2)
-    
-    add_to_group = BoolProperty(name='Add to group',\
-                                description='Add all created objects to a group',\
-                                default=True)
-                                
-    invisible = BoolProperty(name='Invisible',\
-                                description='Make boxes invisible for rendering',\
-                                default=True)
-
-                                
-    box_type = EnumProperty(name="Box type",
-        description="Shape that rigid body objects are created from.",
-        items=[ \
-          ('BONE', "Bone",
-              "Plain bone dimensions are used."),
-          ('ENVELOPE', "Envelope",
-              "Bone envelope dimensions are used."),
-          ('BBONE', "BBone",
-              "BBone dimensions are used. "\
-              "(BBones can be scaled using Ctrl+Alt+S in armature edit mode.)"),
-          ],
-        default='BBONE')
-    
-    #Create the rigid body boxes
-    def create_boxes(self, armature):
-        bones = bone_group_list(armature)
-        
-        RB_dict = {}            #Dictionary of rigid body objects
-        
-        armature['brik_bone_driver_dict'] = {}
-        armature['brik_armature_locator_name'] = ''
-        
-        #All deforming bones within selected group(s) have boxes created for them
-        for bone in bones:
-
-            box = None
-            #Create boxes that do not exist
-            if self.box_type == 'BONE':
-                box, volume = create_box(self.prefix, self.driver_length, self.driver_width, armature, bone)
-            elif self.box_type == 'BBONE':
-                box, volume = create_box_bbone(self.prefix, armature, bone)
-            elif self.box_type == 'ENVELOPE':
-                box, volume = create_box_envelope(self.prefix, armature, bone)
-            
-            RB_dict[box.name] = box
-            armature['brik_bone_driver_dict'][bone.name] = box.name
-        
-            #Orientate and position the box
-            position_box(armature, bone, box)
-            box['brik_bone_name'] = bone.name
-            
-            #### Contributed by Wraaah #########
-#            box.game.physics_type = 'RIGID_BODY'
-            box.game.mass = volume
-            box.hide_render = self.invisible
-            ##############################
-        return RB_dict
-    
-    def make_bone_constraints(self, armature, RB_dict):
-        bones = bone_group_list(armature)
-        #bones_dict = armature.pose.bones
-        
-        #for bone in bones_dict:
-        for bone in bones:
-            if not 'brik_copy_rot' in bone.constraints:
-                constraint = bone.constraints.new(type='COPY_ROTATION')
-                constraint.name = 'brik_copy_rot'
-                constraint.target = RB_dict[armature['brik_bone_driver_dict'][bone.name]]
-                #Enable posing armature after creating brik structure
-                constraint.influence = 0.0
-            if not 'brik_copy_loc' in bone.constraints:
-            #Check if copy loc is needed
-                use_copy_loc = False
-                #rigid_body_name = rigid_bodies[bone_name]
-                if bone.parent:
-                    if bones.count(bone.parent) == 0:
-                        use_copy_loc = True
-                else:
-                    use_copy_loc = True
-
-                if use_copy_loc:
-                    RB_object = RB_dict[armature['brik_bone_driver_dict'][bone.name]]
-                    loc_targ_name = RB_object.name + "_loc"
-                    #print(bone.head, bone.tail)
-                    if bpy.data.objects.get(loc_targ_name, False):
-                        locator = bpy.data.objects[loc_targ_name]
-                        locator.location = (0.0,-bone.length/2,0.0)
-                        locator.parent = RB_object
-                    else:
-                        bpy.ops.object.add(type='EMPTY')
-                        locator = bpy.context.object
-                        locator.name = loc_targ_name
-                        locator.location = (0.0,-bone.length/2,0.0)
-                        locator.parent = RB_object
-                        #bpy.ops.object.select_all(action='DESELECT')
-                        #armature.select = True
-                        select_name(name=armature.name, extend=False)
-                    constraint = bone.constraints.new(type='COPY_LOCATION')
-                    constraint.name = 'brik_copy_loc'
-                    constraint.target = locator
-                    #Enable posing armature after creating brik structure
-                    constraint.influence = 0.0
-    
-    def reshape_boxes(self, armature):
-        """
-        Reshape an existing box based on parameter changes.
-        I introduced this as an attempt to improve responsiveness. This should
-        eliminate the overhead from creating completely new meshes or objects on
-        each refresh.
-        """
-        objects = bpy.context.scene.objects
-        
-        for bone_name in armature['brik_bone_driver_dict']:
-            bone = armature.bones[bone_name]
-            box = objects[armature['brik_bone_driver_dict'][bone_name]]
-        
-            height = bone.length
-            #gap = height * self.hit_box_length      #The distance between two boxes
-            box_length = bone.length*self.driver_length
-            width = bone.length * self.driver_width
-            
-            x = width/2
-            y = box_length/2
-            z = width/2
-            
-            verts = [[-x,y,-z],[-x,y,z],[x,y,z],[x,y,-z],\
-                     [x,-y,-z],[-x,-y,-z],[-x,-y,z],[x,-y,z]]
-            
-            #This could be a problem if custom object shapes are used...
-            count = 0
-            for vert in box.data.vertices:
-                vert.co = Vector(verts[count])
-                count += 1
-    
-    
-    #Set up the objects for rigid body physics and create rigid body joints.
-    def make_RB_constraints(self, armature, RB_dict):
-        bones_dict = armature.pose.bones
-        
-        for box in RB_dict:
-            bone = bones_dict[RB_dict[box]['brik_bone_name']]
-            
-            boxObj = RB_dict[box]
-            
-            #Make the radius half the length of the longest axis of the box
-            radius_driver_length = (bone.length*self.driver_length)/2
-            radius_driver_width = (bone.length*self.driver_width)/2
-            radius = radius_driver_length
-            if radius_driver_width > radius:
-                radius = radius_driver_width
-            
-            
-            #Set up game physics attributes
-            boxObj.game.use_actor = True
-            boxObj.game.use_ghost = False
-            boxObj.game.physics_type = 'RIGID_BODY'
-            boxObj.game.use_collision_bounds = True
-            boxObj.game.collision_bounds_type = 'BOX'
-            boxObj.game.radius = radius
-                
-            #Make the rigid body joints
-            if bone.parent:
-                #print(bone, bone.parent)
-                boxObj['brik_joint_target'] = armature['brik_bone_driver_dict'][bone.parent.name]
-                RB_joint = boxObj.constraints.new('RIGID_BODY_JOINT')
-                RB_joint.pivot_y = -bone.length/2
-                RB_joint.target = RB_dict[boxObj['brik_joint_target']]
-                RB_joint.use_linked_collision = True
-                RB_joint.pivot_type = ("GENERIC_6_DOF")
-                RB_joint.limit_angle_max_x = bone.ik_max_x
-                RB_joint.limit_angle_max_y = bone.ik_max_y
-                RB_joint.limit_angle_max_z = bone.ik_max_z
-                RB_joint.limit_angle_min_x = bone.ik_min_x
-                RB_joint.limit_angle_min_y = bone.ik_min_y
-                RB_joint.limit_angle_min_z = bone.ik_min_z
-                RB_joint.use_limit_x = True
-                RB_joint.use_limit_y = True
-                RB_joint.use_limit_z = True
-                RB_joint.use_angular_limit_x = True
-                RB_joint.use_angular_limit_y = True
-                RB_joint.use_angular_limit_z = True
-            else:
-                boxObj['brik_joint_target'] = 'None'
-    
-    def add_boxes_to_group(self, armature, RB_dict):
- 
-        #print("Adding boxes to group")
-        group_name = self.prefix+armature.name+"_Group"
-        if not group_name in bpy.data.groups:
-            group = bpy.data.groups.new(group_name)
-        else:
-            group = bpy.data.groups[group_name]
-        #print(group)
-        #print(RB_dict)
-        for box in RB_dict:
-            if not box in group.objects:
-                group.objects.link(bpy.context.scene.objects[box])
-            box_loc = box + "_loc"
-            print(box_loc)
-            if bpy.context.scene.objects.get(box_loc, None):
-                if not box_loc in group.objects:
-                    group.objects.link(bpy.context.scene.objects[box_loc])
-        
-        armature["ragdoll_group"] = group.name
-        return
-    
-    #Armature and mesh need to be set to either no collision or ghost. No collision
-    #is much faster.
-    #=> also affects Hitboxes & armature collision shape, need to be fixed/reconsidered
-    def set_armature_physics(self, armature):
-        armature.game.physics_type = 'NO_COLLISION'
-#        for child in armature.children:
-#            if hasattr(armature, "['brik_hit_boxes_created']"):
-#                if child.name in armature['brik_bone_hit_box_dict'].values():
-#                    continue
-#                else:
-#                    child.game.physics_type = 'NO_COLLISION'
-#            else:
-#                child.game.physics_type = 'NO_COLLISION'
-                
-
-    #The ui of the create operator that appears when the operator is called
-    def draw(self, context):
-        layout = self.layout
-
-        box = layout.box()
-        box.prop(self.properties, 'prefix')
-        box.prop(self.properties, 'add_to_group')
-        box.prop(self.properties, 'invisible')
-        box.prop(self.properties, 'box_type')
-        if self.box_type == 'BONE':
-            box.prop(self.properties, 'driver_length')
-            box.prop(self.properties, 'driver_width')
-            
-    #The main part of the create operator
-    def execute(self, context):
-        #print("\n##########\n")
-        #print("EXECUTING brik_create_structure\n")
-        
-        armature = context.object
-        
-        self.set_armature_physics(armature)
-        
-        
-        if 'brik_structure_created' in armature.keys()\
-                and armature['brik_structure_created'] == True\
-                and self.box_type == 'BONE':
-            
-            self.reshape_boxes(armature)
-            
-        else:
-            RB_dict = self.create_boxes(armature)
-            armature['brik_structure_created'] = True
-            armature['brik_prefix'] = self.prefix
-            
-            self.make_RB_constraints(armature, RB_dict)
-            self.make_bone_constraints(armature, RB_dict)
-            
-            if self.add_to_group:
-                self.add_boxes_to_group(armature, RB_dict)
-
-        calc_ragdoll_mass(self, context)
-        
-        return{'FINISHED'}
-
-class brik_destroy_structure(bpy.types.Operator):
-    bl_label = 'brik destroy structure operator'
-    bl_idname = 'object.brik_destroy_structure'
-    bl_description = 'Destroy a rigid body structure created by this brik.'
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    """
-    For some reason the remove operators give a "cyclic" warning in the console.
-    
-    I have no idea what this means and have not been able to find out what this means.
-    """
-    
-    def execute(self, context):
-        print("\n##########\n")
-        print("EXECUTING brik_remove_structure")
-        armature = context.object
-        scene = context.scene
-        
-        bpy.ops.object.select_all(action='DESELECT')        
-        #Clean up all created objects, their meshes and bone constraints
-        for bone_name in armature['brik_bone_driver_dict']:
-            driver = scene.objects[armature['brik_bone_driver_dict'][bone_name]]
-            #Unlink and remove the mesh
-#            mesh = driver.data
-#            driver.data = None
-#            mesh.user_clear()
-#            bpy.data.meshes.remove(mesh)
-            select_name( name = armature['brik_bone_driver_dict'][bone_name], extend = True)
-            objects = bpy.data.objects
-            driver_loc = objects.get(driver.name + "_loc", None)
-            if driver_loc:
-                select_name( name = driver_loc.name, extend = True)
-            
-            #Unlink and remove the object
-#            scene.objects.unlink(driver)
-#            driver.user_clear()
-#            bpy.data.objects.remove(driver)
-            
-            #Remove bone constraints
-            bone = armature.pose.bones[bone_name]
-            if 'brik_copy_rot' in bone.constraints:
-                const = bone.constraints['brik_copy_rot']
-                bone.constraints.remove(const)
-            if 'brik_copy_loc' in bone.constraints:
-                const = bone.constraints['brik_copy_loc']
-                locator = const.target
-                bone.constraints.remove(const)
-        
-                #Remove armature locator
-                #locator = bpy.data.objects[armature['brik_armature_locator_name']]
-#                scene.objects.unlink(locator)
-#                locator.user_clear()
-#                bpy.data.objects.remove(locator)
-        bpy.ops.object.delete(use_global=False)
-        bpy.ops.object.select_all(action='DESELECT')        
-        scene.objects.active = armature
-        
-        #Remove driver group
-        group_name = armature['brik_prefix']+armature.name+'_Group'
-        if group_name in bpy.data.groups:
-            group = bpy.data.groups[group_name]
-            bpy.data.groups.remove(group)
-        
-        #Remove custom properties
-        #del armature['brik_armature_locator_name']
-        del armature['brik_structure_created']
-        del armature['brik_bone_driver_dict']
-        del armature['brik_prefix']
-    
-        return{'FINISHED'}
-        
-class brik_create_game_logic(bpy.types.Operator):
-    bl_label = 'brik create game logic operator'
-    bl_idname = 'object.brik_create_game_logic'
-    bl_description = 'Create the game logic for the created objects.'
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    template_path = bpy.utils.script_paths()[0]+'\\addons_contrib\\game_engine_ragdolls_kit\\templates\\'
-    
-    game_script_list = ['brik_load.py', \
-                        'brik_init_ragdoll.py', \
-                        'brik_spawn.py']
-                            
-    
-    def set_up_armature_logic(self, armature):
-        
-        if not 'brik_use_ragdoll' in armature.game.properties:
-            
-            bpy.ops.object.game_property_new()
-            prop = armature.game.properties[-1]
-            prop.name = 'brik_use_ragdoll'
-            prop.type = 'BOOL'
-            prop.value = False
-            
-            bpy.ops.object.game_property_new()
-            prop = armature.game.properties[-1]
-            prop.name = 'brik_init_ragdoll'
-            prop.type = 'BOOL'
-            prop.value = True
-            #Add groups if needed
-            hitbox_group = armature["hitbox_group"]
-            if not(bpy.data.objects.get(hitbox_group, None)):
-                bpy.ops.object.group_instance_add(group=hitbox_group)
-            ragdoll_group = armature["ragdoll_group"]
-            if not(bpy.data.objects.get(ragdoll_group, None)):
-                bpy.ops.object.group_instance_add(group=ragdoll_group)
-            
-            #Logic to spawn the rigid body boxes
-            bpy.ops.logic.sensor_add(type='PROPERTY', name='brik_use_changed_sens', object=armature.name)
-            sens = armature.game.sensors[-1]
-            sens.property = 'brik_use_ragdoll'
-            sens.evaluation_type = 'PROPCHANGED'
-            
-            bpy.ops.logic.controller_add(type='PYTHON', name='brik_init_ragdoll_cont', object=armature.name)
-            cont = armature.game.controllers[-1]
-            cont.mode = 'MODULE'
-            cont.module = 'brik_init_ragdoll.main'
-            
-            bpy.ops.logic.actuator_add(type='EDIT_OBJECT', name='brik_spawn_boxes_act', object=armature.name)
-            act = armature.game.actuators[-1]
-            act.mode = 'ADDOBJECT'
-            act.object = (bpy.data.objects.get(ragdoll_group, None))
-            
-            cont.link(sens, act)
-            
-            #Logic to change the value of brik_use_ragdoll property
-            bpy.ops.logic.sensor_add(type='KEYBOARD', name='brik_set_use_ragdoll_sens', object=armature.name)
-            sens = armature.game.sensors[-1]
-            sens.key = 'SPACE'
-            
-            bpy.ops.logic.controller_add(type='LOGIC_AND', name='brik_set_use_ragdoll_cont', object=armature.name)
-            cont = armature.game.controllers[-1]
-            
-            bpy.ops.logic.actuator_add(type='PROPERTY', name='brik_set_use_ragdoll_act', object=armature.name)
-            act = armature.game.actuators[-1]
-            act.mode = 'ASSIGN'
-            act.property = 'brik_use_ragdoll'
-            act.value = "True"
-            
-            cont.link(sens, act)
-            
-            #Logic to use the ragdoll.
-            bpy.ops.logic.sensor_add(type='PROPERTY', name='brik_use_sens', object=armature.name)
-            sens = armature.game.sensors[-1]
-            sens.property = 'brik_use_ragdoll'
-            sens.value = 'True'
-#            sens.use_pulse_true_level = True
-            
-            bpy.ops.logic.controller_add(type='LOGIC_AND', name='brik_use_cont', object=armature.name)
-            cont = armature.game.controllers[-1]
-            
-            bpy.ops.logic.actuator_add(type='ACTION', name='brik_use_act', object=armature.name)
-            act = armature.game.actuators[-1]
-            act.type = 'ARMATURE'
-#            act.mode = 'RUN'
-            
-            cont.link(sens, act)
-    
-    def set_up_spawn_logic(self, armature):
-        print('SETTING UP SPAWN LOGIC')
-        scene = bpy.context.scene
-        
-        spawn_ob_name = armature.name + "_spawn"
-        #Need to use data to avoid naming conflicts
-        if not spawn_ob_name in bpy.data.objects:
-            bpy.ops.object.add()
-            spawn_object = bpy.context.object
-            spawn_object.name = spawn_ob_name
-
-            bpy.ops.object.game_property_new()
-            prop = spawn_object.game.properties[-1]
-            prop.name = "armature_name"
-            prop.type = 'STRING'
-#            prop.value = armature.name
-        else:
-            spawn_object = bpy.data.objects[spawn_ob_name]
-            
-        bpy.ops.object.select_all(action='DESELECT')
-        select_name(name=armature.name, extend=False)
-
-        prop = spawn_object.game.properties["armature_name"]
-        prop.value = armature.name
-
-        spawn_object.game.show_state_panel = False
-        
-        #Add groups if needed
-        hitbox_group = armature["hitbox_group"]
-        if not(bpy.data.objects.get(hitbox_group, None)):
-            bpy.ops.object.group_instance_add(group=hitbox_group)
-        ragdoll_group = armature["ragdoll_group"]
-        if not(bpy.data.objects.get(ragdoll_group, None)):
-            bpy.ops.object.group_instance_add(group=ragdoll_group)
-        
-        #Quick and dirty check to see if the spawn logic is already set up.
-        if not 'brik_spawn_cont' in spawn_object.game.controllers:
-            #The logic to spawn the mob
-            bpy.ops.logic.sensor_add(type='KEYBOARD', name='brik_Tab_sens', object=spawn_object.name)
-            sens = spawn_object.game.sensors[-1]
-            sens.key = 'TAB'
-            
-            bpy.ops.logic.controller_add(type='PYTHON', name='brik_spawn_cont', object=spawn_object.name)
-            cont = spawn_object.game.controllers[-1]
-            cont.mode = 'MODULE'
-            cont.module = 'brik_spawn.main'
-            
-            bpy.ops.logic.actuator_add(type='EDIT_OBJECT', name='brik_spawn_act', object=spawn_object.name)
-            act = spawn_object.game.actuators[-1]
-            act.object = bpy.data.objects.get(hitbox_group, None)
-            
-            cont.link(sens, act)
-            
-            #Logic to load structure information
-            bpy.ops.logic.sensor_add(type='ALWAYS', name='brik_load_sens', object=spawn_object.name)
-            sens = spawn_object.game.sensors[-1]
-            
-            bpy.ops.logic.controller_add(type='PYTHON', name='brik_load_cont', object=spawn_object.name)
-            cont = spawn_object.game.controllers[-1]
-            cont.text = bpy.data.texts['brik_load.py']
-            
-            sens.link(cont)
-            
-            #Logic to initialise the spawn point with object to add, added object list and added object count.
-            bpy.ops.logic.controller_add(type='PYTHON', name='brik_spawn_init_cont', object=spawn_object.name)
-            cont = spawn_object.game.controllers[-1]
-            cont.mode = 'MODULE'
-            cont.module = 'brik_spawn.initialize'
-            
-            sens.link(cont)
-        
-        #Properties and text files to define the mobs that can be spawned.
-        for text in bpy.data.texts:
-            
-            print('CONSIDERING TEXT '+text.name)
-            prefix = armature['brik_prefix']
-            print(text.name[len(prefix):-4])
-            
-            
-            #If there is an armature and text pair.
-            if text.name[len(prefix):-4] == armature.name:
-                #If no mobs have been accounted for yet.
-                if not 'brik_mob_count' in spawn_object.game.properties:
-                    print('CREATING PROPERTY brik_mob_count')
-                    bpy.ops.object.select_all(action='DESELECT')
-                    spawn_object.select = True
-                    scene.objects.active = spawn_object
-                    
-                    bpy.ops.object.game_property_new()
-                    count_prop = spawn_object.game.properties[-1]
-                    count_prop.name = 'brik_mob_count'
-                    count_prop.type = 'INT'
-                    count_prop.value = -1   #Initialised to -1 meaning no data controllers yet created.
-        
-                    bpy.ops.object.select_all(action='DESELECT')
-                    select_name(name=armature.name, extend=False)
-                else:
-                    count_prop = spawn_object.game.properties['brik_mob_count']
-                
-                #Find a list of armature texts currently accounted for in logic.
-                current_texts = []
-                for cont in spawn_object.game.controllers:
-                    if cont.name[:-1] == 'brik_ragdoll_data_':
-                        current_texts.append(cont.text)
-                
-                #Create a new data controller for any text not considered.
-                if not text in current_texts:
-                    count_prop.value += 1
-                    #Controller to store structure information.
-                    print('CREATING DATA CONTROLLER')
-                    bpy.ops.logic.controller_add(type='PYTHON', name='brik_ragdoll_data_'+str(int(count_prop.value)), object=spawn_object.name)
-                    cont = spawn_object.game.controllers[-1]
-                    cont.text = text
-        
-    
-    def set_up_hit_box_logic(self, armature, bone_name):
-        hit_box = bpy.data.objects[armature['brik_bone_hit_box_dict'][bone_name]]
-        scene = bpy.context.scene
-        
-        #Simply create a property for the ray cast to look for.
-        if not 'brik_can_hit' in hit_box.game.properties:
-            hit_box.select = True
-            scene.objects.active = hit_box
-            bpy.ops.object.game_property_new()
-            print(*hit_box.game.properties)
-            prop = hit_box.game.properties[-1]
-            prop.name = 'brik_can_hit'
-            prop.type = 'BOOL'
-            prop.value = True
-            scene.objects.active = armature
-            hit_box.select = False
-            
-        return
-    
-    def load_game_scripts(self):
-        
-        for script_name in self.game_script_list:
-            if not script_name in bpy.data.texts:
-                bpy.data.texts.load(self.template_path+script_name)
-                
-        return
-            
-    
-    def execute(self, context):
-        self.load_game_scripts()
-        
-        armature = context.object
-        
-        self.set_up_armature_logic(armature)
-        #Is ray property required?
-        #bones = bone_group_list(armature)
-        #for bone_name in bones:
-        #    self.set_up_hit_box_logic(armature, bone_name)
-        self.set_up_spawn_logic(armature)
-        
-        
-        
-        return{'FINISHED'}
-
-class brik_write_game_file(bpy.types.Operator):
-    bl_label = 'brik write game file operator'
-    bl_idname = 'object.brik_write_game_file'
-    bl_description = 'Write a file containing a description of the rigid body structure'
-    bl_options = {'REGISTER', 'UNDO'} 
-    
-    #Find the most efficient order to calculate bone rotations in the game engine
-    #Not used
-    def calculate_structure(self, armature):
-        bones = bone_group_list(armature)
-#        boneDict = armature.pose.bones
-        
-        boneChainsDict = {}
-        maxLength = 0       #This is the length of the longest chain of bones
-        
-        #Find the chains of bone parentage in the armature
-        for poseBone in boneDict:
-            bone = poseBone.bone
-            boneChain = []
-            while True:
-                boneChain.append(bone.name)
-                if bone.parent:
-                    bone = bone.parent
-                else:
-                    boneChainsDict[boneChain[0]] = boneChain
-                    if len(boneChain) > maxLength:
-                        maxLength = len(boneChain)
-                    break
-        
-        #Sort the bone chains to find which bone rotations to calculate first
-        optimalBoneOrder = self.find_optimal_bone_order(boneChainsDict, maxLength)
-        
-        return optimalBoneOrder, boneChainsDict
-    
-    #Not used
-    def find_optimal_bone_order(self, boneChainsDict, maxLength):
-        tempBoneChainsOrder = []
-        
-        #Reorder the bone chains so that shorter bone chains are at the start of the list
-        for n in range(1,maxLength+1):
-            for chain in boneChainsDict:
-                if len(boneChainsDict[chain]) == n:
-                    tempBoneChainsOrder.append(boneChainsDict[chain])
-        
-        #Create a final list of bones so that the bones that need to be calculated first are
-        #at the start
-        finalBoneOrder = []
-        for chain in tempBoneChainsOrder:
-            finalBoneOrder.append(chain[0])     
-        return finalBoneOrder
-    
-    """
-    I've found a method of reading from an internal text file in the game
-    engine... Place the text file in a python script controller set to 'script'
-    and it can be accessed as a string through cont.script. To avoid  throwing
-    a script compilation error on startup, all text must be enclosed within
-    triple quotation marks as a block comment.
-    There is no need to mess with different file systems and platforms... It can
-    all be done internally. =D
-    """
-    
-#    def save_structure_data(self, armature, optimalBoneOrder, boneChainsDict):
-    def save_structure_data(self, armature, bones):
-        
-        prefix = armature['brik_prefix']
-        #Create or clear the text file for this armature
-        texts = bpy.data.texts
-        if prefix+armature.name+".txt" not in texts:
-            dataFile = texts.new(prefix+armature.name+".txt")
-        else:
-            dataFile = texts[prefix+armature.name+".txt"]
-            dataFile.clear()
-        
-        #Write to the text file
-        dataFile.write("'''\n")
-        
-        dataFile.write(armature.name+"\n")
-        
-        dataFile.write("'' Bone : Hitbox : Rigid body : Location constraint (optional)\n")
-        #Write bone data to the file
-        rigid_bodies = armature['brik_bone_driver_dict']
-        hitboxes = armature['brik_bone_hit_box_dict']
-        for bone in bones:
-            #How to first bone => also copy locations needs to be activated
-            bone_name = bone.name
-            hitbox_name = hitboxes[bone_name]
-            rigid_body_name = rigid_bodies[bone_name]
-            text_str = " : ".join([bone_name, hitbox_name, rigid_body_name])
-            
-            if bone.parent:
-                if bones.count(bone.parent) == 0:
-                    text_str = text_str + " : " + rigid_bodies[bone_name] + "_loc"
-            else:
-                text_str = text_str + " : " + rigid_bodies[bone_name] + "_loc"
-
-            dataFile.write(text_str +"\n")
-        dataFile.write("'' 6DOF constraints\n")
-        dataFile.write("'' 6DOF parameters are optional, if not defined default values are used\n")
-        id_num = 1
-        for bone in bones:
-            if bone.parent:
-                bone_name = bone.name
-                bone_parent = bone.parent
-                parent_name = bone_parent.name
-                ob = rigid_bodies[bone_name]
-                targ = rigid_bodies[parent_name]
-            
-                #6DOF name
-#                dataFile.write("constraint_name = 6DOF" + str(id_num) + "\n")
-                dataFile.write("constraint_name = 6DOF_" + ob + "_" + targ + "\n")
-                id_num = id_num + 1
-                #ob name
-                dataFile.write("object = " + ob + "\n")
-                #targ name
-                dataFile.write("target = " + targ + "\n")
-                #optional
-                #x,y,z point, default 0.0
-                pivot_y = - bone.length * 0.5
-                dataFile.write("pivot_y = " + str(pivot_y) + "\n")
-                #Rx,Ry,Rz point, default 0.0
-                #min/max x,y,z limit, default 0.0
-                #min/max Rx,Ry,Rz limit, default off & Rx,Ry,Rz spring, default off
-                if bone.use_ik_limit_x == True:
-                    Rx_min = str(bone.ik_min_x)
-                    dataFile.write("Rx_min = " + Rx_min + "\n")
-                    Rx_max = str(bone.ik_max_x)
-                    dataFile.write("Rx_max = " + Rx_max + "\n")
-                    if bone.ik_stiffness_x != 0:
-                        Rx_spring = str(bone.ik_stiffness_x)
-                        dataFile.write("Rx_spring = " + Rx_spring + "\n")
-                if bone.use_ik_limit_y == True:
-                    Ry_min = str(bone.ik_min_y)
-                    dataFile.write("Ry_min = " + Ry_min + "\n")
-                    Ry_max = str(bone.ik_max_y)
-                    dataFile.write("Ry_max = " + Ry_max + "\n")
-                    if bone.ik_stiffness_y != 0:
-                        Ry_spring = str(bone.ik_stiffness_y)
-                        dataFile.write("Ry_spring = " + Ry_spring + "\n")
-                if bone.use_ik_limit_z == True:
-                    Rz_min = str(bone.ik_min_z)
-                    dataFile.write("Rz_min = " + Rz_min + "\n")
-                    Rz_max = str(bone.ik_max_z)
-                    dataFile.write("Rz_max = " + Rz_max + "\n")
-                    if bone.ik_stiffness_z != 0:
-                        Rz_spring = str(bone.ik_stiffness_z)
-                        dataFile.write("Rz_spring = " + Rz_spring + "\n")
-                #x,y,z spring, default off
-                #motors..., default off
-        dataFile.write("'''")
-        
-        return
-    
-    #Not used
-    def store_joint_data(self, armature):
-        """
-        Joint data is stored on the rigid body objects themselves. This will not be
-        necessary when the convertor is properly transferring these values from Blender
-        to the game engine.
-        """
-        for bone_name in armature['brik_optimal_order']:
-            box = bpy.data.objects[armature['brik_bone_driver_dict'][bone_name]]
-            if not box['brik_joint_target'] == 'None':
-                RB_joint = box.constraints[0]
-                bone = armature.pose.bones[box['brik_bone_name']]
-                
-                ###############################
-                #Required for dynamic creation of joint in game
-                box['joint_position_x'] = RB_joint.pivot_x
-                box['joint_position_y'] = RB_joint.pivot_y
-                box['joint_position_z'] = RB_joint.pivot_z
-            
-            
-                """
-                It would be nice to use IK limits to define rigid body joint limits,
-                but the limit arrays have not yet been wrapped in RNA apparently...
-                properties_object_constraint.py in ui directory, line 554 says:
-                Missing: Limit arrays (not wrapped in RNA yet)
-                
-                It is necessary to create the joint when spawning ragdolls anyway.
-                Joints can still be created in the game.
-                """
-            
-                box['rot_max_x'] = bone.ik_max_x
-                box['rot_max_y'] = bone.ik_max_y
-                box['rot_max_z'] = bone.ik_max_z
-                box['rot_min_x'] = bone.ik_min_x
-                box['rot_min_y'] = bone.ik_min_y
-                box['rot_min_z'] = bone.ik_min_z
-    
-    def execute(self, context):
-        armature = context.object
-        
-        bones = bone_group_list(armature)
-#        optimalBoneOrder, boneChainsDict = self.calculate_structure(armature)
-        
-#        armature['brik_optimal_order'] = optimalBoneOrder
-        
-#        self.store_joint_data(armature)
-        
-        self.save_structure_data( armature, bones)
-        
-        armature['brik_file_written'] = True
-        
-        
-        return{'FINISHED'}
-
-class brik_create_hit_boxes(bpy.types.Operator):
-    bl_label = 'brik create hit boxes operator'
-    bl_idname = 'object.brik_create_hit_boxes'
-    bl_description = 'Create hit boxes for each bone in an armature and parent them to the bones.'
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    hit_box_prefix = StringProperty(name='Hit box prefix',\
-                            description='Prefix to be appended to the bone name that defines the hit box',\
-                            default='HIT')
-   
-    hit_box_length = FloatProperty(name='Hit box length',\
-                              description='Length of a hit box as a proportion of bone length.',\
-                              min=0.05,\
-                              max=1.0,\
-                              step=0.05,\
-                              default=0.8)
-    
-    hit_box_width = FloatProperty(name = 'Hit box width',\
-                                  description='Width of a hit box as a proportion of bone length.',\
-                                  min=0.05,\
-                                  max=1.0,\
-                                  step=0.05,\
-                                  default=0.2)
-    
-    add_to_group = BoolProperty(name='Add to group',\
-                                description='Add hit boxes to a group',\
-                                default=True)
-                                
-    invisible = BoolProperty(name='Invisible',\
-                                description='Make boxes invisible for rendering',\
-                                default=True)
-                                
-    box_type = EnumProperty(name="Box type",
-        description="Shape that hitbox objects are created from.",
-        items=[ \
-          ('BONE', "Bone",
-              "Plain bone dimensions are used."),
-          ('ENVELOPE', "Envelope",
-              "Bone envelope dimensions are used."),
-          ('BBONE', "BBone",
-              "BBone dimensions are used. "\
-              "(BBones can be scaled using Ctrl+Alt+S in armature edit mode.)"),
-          ],
-        default='BBONE')
-    
-    #Create the hit boxes
-    def create_hit_boxes(self, armature):
-        bones = bone_group_list(armature)
-        hit_box_dict = {}
-        scn = bpy.context.scene
-        
-        armature['brik_bone_hit_box_dict'] = {}
-#        armature['brik_bone_driver_dict'] = {}
-#        armature['brik_armature_locator_name'] = ''
-        
-        #All deforming bones within selected group(s) have boxes created for them
-        for bone in bones:
-
-            box = None
-            #Create boxes that do not exist
-            if self.box_type == 'BONE':
-                hit_box, volume = create_box(self.hit_box_prefix, self.hit_box_length, self.hit_box_width, armature, bone)
-            elif self.box_type == 'BBONE':
-                hit_box, volume = create_box_bbone(self.hit_box_prefix, armature, bone)
-            elif self.box_type == 'ENVELOPE':
-                hit_box, volume = create_box_envelope(self.hit_box_prefix, armature, bone)
-            
-            hit_box_dict[hit_box.name] = hit_box
- #            RB_dict[box.name] = box
-            armature['brik_bone_hit_box_dict'][bone.name] = hit_box.name
-#            armature['brik_bone_driver_dict'][bone.name] = box.name
-        
-            #Orientate and position the hitbox
-            self.parent_to_bone(armature, hit_box, bone.name)
-#            position_box(armature, bone, hit_box)
-#=> do not set location rotation, they are relative to the parent bone thus need to be zero delta
-
-            hit_box['brik_bone_name'] = bone.name
-            
-            hit_box.game.physics_type = 'STATIC'
-            hit_box.game.use_ghost = True
-            hit_box.hide_render = self.invisible
-
-            hit_box.game.mass = volume
-        return hit_box_dict
-        
-    #Reshape an existing box based on parameter changes.
-    #I introduced this as an attempt to improve responsiveness. This should
-    #eliminate the overhead from creating completely new meshes or objects on
-    #each refresh.
-    #NOT USED
-    def reshape_hit_box(self, armature, bone):
-        #print('RESHAPING BOX')
-        armature_object = bpy.context.object
-        scene = bpy.context.scene
-        hit_box = scene.objects[armature['brik_bone_hit_box_dict'][bone.name]]
-        
-        height = bone.length
-        box_length = bone.length*self.hit_box_length
-        width = bone.length * self.hit_box_width
-        
-        x = width/2
-        y = box_length/2
-        z = width/2
-        
-        verts = [[-x,y,-z],[-x,y,z],[x,y,z],[x,y,-z],\
-                 [x,-y,-z],[-x,-y,-z],[-x,-y,z],[x,-y,z]]
-        
-        #This could be a problem if custom object shapes are used...
-        count = 0
-        for vert in hit_box.data.vertices:
-            vert.co = Vector(verts[count])
-            count += 1
-        
-        return(hit_box)
-
-    def add_hit_boxes_to_group(self, armature):
-        #print("Adding hit boxes to group")
-        group_name = self.hit_box_prefix+armature.name+"_Group"
-        if not group_name in bpy.data.groups:
-            group = bpy.data.groups.new(group_name)
-        else:
-            group = bpy.data.groups[group_name]
-
-        bone_hitbox = armature['brik_bone_hit_box_dict']
-        #Add armature to group
-#        bone_hitbox["brik_armature_group"] = armature.name
-        for bone_name in bone_hitbox:
-            hit_box_name = bone_hitbox[bone_name]
-            if not hit_box_name in group.objects:
-                group.objects.link(bpy.data.objects[hit_box_name])
-        #Add armature to group
-        if not armature.name in group.objects:
-            group.objects.link( armature )
-
-        armature["hitbox_group"] = group.name
-        
-        return
-        
-    def parent_to_bone(self, armature, hit_box, bone_name):
-        #Thanks Uncle Entity. :)
-        hit_box.parent = armature
-        hit_box.parent_bone = bone_name
-        hit_box.parent_type = 'BONE'
-        
-        return
-    
-    #The ui of the create operator that appears when the operator is called
-    def draw(self, context):
-        layout = self.layout
-
-        box = layout.box()
-        box.prop(self.properties, 'hit_box_prefix')
-        box.prop(self.properties, 'add_to_group')
-        box.prop(self.properties, 'invisible')
-        box.prop(self.properties, 'box_type')
-        if self.box_type == 'BONE':
-            box.prop(self.properties, 'hit_box_length')
-            box.prop(self.properties, 'hit_box_width')
-    
-    #The main part of the create operator
-    def execute(self, context):
-        #print("\n##########\n")
-        #print("EXECUTING brik_create_structure\n")
-        
-        armature = context.object
-        
-        hit_box_dict = self.create_hit_boxes(armature)
-        
-        if self.add_to_group:
-            self.add_hit_boxes_to_group(armature)
-        
-        armature['brik_hit_box_prefix'] = self.hit_box_prefix
-        armature['brik_hit_boxes_created'] = True
-        
-        return{'FINISHED'}
-
-class brik_remove_hit_boxes(bpy.types.Operator):
-    bl_label = 'brik remove hit boxes operator'
-    bl_idname = 'object.brik_remove_hit_boxes'
-    bl_description = 'Remove hit boxes crested by this addon'
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    """
-    For some reason the remove operators give a "cyclic" warning in the console.
-    
-    I have no idea what this means and have not been able to find out what this means.
-    """
-    
-    def remove_hit_box(self, scene, bone_name, armature):
-        #Function crashes with linked objects
-        hit_box = scene.objects[armature['brik_bone_hit_box_dict'][bone_name]]
-        #Unlink and remove the mesh
-#        mesh = hit_box.data
-#        hit_box.data = None
-#        mesh.user_clear()
-#        bpy.data.meshes.remove(mesh)
-        #Unlink and remove the object
-#        scene.objects.unlink(hit_box)
-#        hit_box.user_clear()
-#        bpy.data.objects.remove(hit_box)
-    
-    def draw(self, context):
-        pass
-    
-    def execute(self, context):
-        armature = context.object
-        scene = context.scene
- 
-        bpy.ops.object.select_all(action='DESELECT')        
-        for bone_name in armature['brik_bone_hit_box_dict']:
-            #hit_box = scene.objects[armature['brik_bone_hit_box_dict'][bone_name]]
-            select_name( name = armature['brik_bone_hit_box_dict'][bone_name], extend = True)
-#            self.remove_hit_box(scene, bone_name, armature)
-        bpy.ops.object.delete(use_global=False)
-        bpy.ops.object.select_all(action='DESELECT')        
-        scene.objects.active = armature
-        
-        group_name = armature['brik_hit_box_prefix']+armature.name+"_Group"
-        if group_name in bpy.data.groups:
-            group = bpy.data.groups[group_name]
-            bpy.data.groups.remove(group)
-        
-        del armature['brik_bone_hit_box_dict']
-        del armature['brik_hit_boxes_created']
-        del armature['brik_hit_box_prefix']
-        return{'FINISHED'}
-    
-  
-def calc_ragdoll_mass(self, context):
-    armature = context.object
-    set_mass = context.scene.brik_ragdoll_mass
-    brik_structure_created = armature.get('brik_structure_created', False)
-    if brik_structure_created:
-        RB_dict = armature['brik_bone_driver_dict']
-        objects = bpy.data.objects
-        tot_mass = 0
-        for bone in RB_dict:
-            box_name = RB_dict[bone]
-            ob = objects[box_name]
-            tot_mass = tot_mass + ob.game.mass
-        mass_scale = set_mass / tot_mass
-        for bone in RB_dict:
-            box_name = RB_dict[bone]
-            ob = objects[box_name]
-            ob.game.mass = ob.game.mass * mass_scale
-    return None
diff --git a/release/scripts/addons_contrib/game_engine_ragdolls_kit/brik_funcs.py b/release/scripts/addons_contrib/game_engine_ragdolls_kit/brik_funcs.py
deleted file mode 100644
index 633250c..0000000
--- a/release/scripts/addons_contrib/game_engine_ragdolls_kit/brik_funcs.py
+++ /dev/null
@@ -1,173 +0,0 @@
-#brik_funcs.py
-
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# Script copyright (C) Marcus Jenkins (Blenderartists user name FunkyWyrm)
-# Modified by Kees Brouwer (Blenderartists user name Wraaah)
-#
-# 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 *****
-# --------------------------------------------------------------------------
-
-"""
-This will be a collection of useful functions that can be reused across the different operators.
-
-"""
-
-import bpy
-
-#Create a box based on envelope size (easier matching of box to model proportions)
-def create_box_bbone(prefix, armature, poseBone):
-    #Thanks to Wraaah for this function
-    
-    ########################
-    #INSERT SHAPE CODE HERE#
-    
-    #Strange looking code as I am referencing the editbone data from the posebone.
-    h = poseBone.bone.bbone_x
-    w = poseBone.bone.bbone_z
-    l = poseBone.bone.length/2.0
-    #The bone points along it's y axis so head is -y and tail is +y
-    verts = [[h,-l, w],[h,-l,-w],[-h,-l,-w],[-h,-l,w],\
-            [h,l,w],[h,l,-w],[-h,l,-w],[-h,l,w]]
-    edges = [[0,1],[1,2],[2,3],[3,0],\
-            [4,5],[5,6],[6,7],[7,4],\
-            [0,4],[1,5],[2,6],[3,7]]
-    faces = [[3,2,1,0],[4,5,6,7],[0,4,7,3],[1,5,4,0],[2,6,5,1],[3,7,6,2]]
-    
-    ########################
-    
-    #Create the mesh
-    mesh = bpy.data.meshes.new(prefix + poseBone.name)
-    mesh.from_pydata(verts, edges, faces)
-    
-    #Create an object for the mesh and link it to the scene
-    box = bpy.data.objects.new(prefix + poseBone.name, mesh)
-    bpy.context.scene.objects.link(box)
-    
-    #Move the hit box so that when parented the object centre is at the bone centre
-    box.location.y = -poseBone.length/2
-    volume = h * l * w * 8.0 
-    return(box, volume)
-    
-#Create a box based on envelope size (easier matching of box to model proportions)
-def create_box_envelope(prefix, armature, poseBone):
-    ########################
-    #INSERT SHAPE CODE HERE#
-    
-    #Strange looking code as I am referencing the editbone data from the posebone.
-    l = poseBone.bone.length/2
-    h = poseBone.bone.head_radius
-    t = poseBone.bone.tail_radius
-    #The bone points along it's y axis so head is -y and tail is +y
-    verts = [[h,-l, h],[h,-l,-h],[-h,-l,-h],[-h,-l,h],\
-            [t,l,t],[t,l,-t],[-t,l,-t],[-t,l,t]]
-    edges = [[0,1],[1,2],[2,3],[3,0],\
-            [4,5],[5,6],[6,7],[7,4],\
-            [0,4],[1,5],[2,6],[3,7]]
-    faces = [[3,2,1,0],[4,5,6,7],[0,4,7,3],[1,5,4,0],[2,6,5,1],[3,7,6,2]]
-    
-    ########################
-    
-    #Create the mesh
-    mesh = bpy.data.meshes.new(prefix + poseBone.name)
-    mesh.from_pydata(verts, edges, faces)
-    
-    #Create an object for the mesh and link it to the scene
-    box = bpy.data.objects.new(prefix + poseBone.name, mesh)
-    bpy.context.scene.objects.link(box)
-    
-    #Move the hit box so that when parented the object centre is at the bone centre
-    box.location.y = -poseBone.length/2
-    volume = (((2*h)**2 + (2*t)**2)/2) * (2*l)
-    return(box, volume)
-    
-#Create a box based on bone size (manual resizing of bones)
-def create_box(prefix, length, width, armature, bone):
-    scene = bpy.context.scene
-    
-    height = bone.length
-    #gap = height * self.hit_box_length      #The distance between two boxes
-    box_length = bone.length * length
-    box_width = bone.length * width
-    
-    x = box_width/2
-    y = box_length/2
-    z = box_width/2
-    
-    verts = [[x,-y,z],[x,-y,-z],[-x,-y,-z],[-x,-y,z],\
-             [x,y,z],[x,y,-z],[-x,y,-z],[-x,y,z]]
-    edges = [[0,1],[1,2],[2,3],[3,0],\
-            [4,5],[5,6],[6,7],[7,4],\
-            [0,4],[1,5],[2,6],[3,7]]
-    faces = [[3,2,1,0],[4,5,6,7],[0,4,7,3],[1,5,4,0],[2,6,5,1],[3,7,6,2]]
-    
-    #Create the mesh
-    mesh = bpy.data.meshes.new(prefix + bone.name)
-    mesh.from_pydata(verts, edges, faces)
-    
-    #Create an object for the mesh and link it to the scene
-    obj = bpy.data.objects.new(prefix + bone.name, mesh)
-    scene.objects.link(obj)
-    
-    volume = x*y*z
-    
-    return(obj, volume)
-
-#Function to select only the correct bones from an armature
-#so only deform bones in the selected bone group(s)
-def bone_group_list(armature):
-    bones = armature.pose.bones
-    scn = bpy.context.scene
-    bone_groups = scn.brik_bone_groups
-    
-    #Check if bone is part of the selected bone group(s)
-    bone_list = []
-    for bone in bones:
-        use_bone = True
-        #Check bone group membership
-        if bone_groups != "All":
-            if bone.bone_group:
-                if bone.bone_group.name != bone_groups:
-                    use_bone = False
-            else:
-                use_bone = False
-        #Check deform bone
-        if bone.bone.use_deform == False:
-            use_bone = False
-            
-        if use_bone == True:
-            bone_list = bone_list + [bone]
-        
-    #Return list of bones to be used
-    return bone_list
-
-#Orient the box to the bone and set the box object centre to the bone location
-def position_box( armature, bone, box):
-    #scene = bpy.context.scene
-    
-    #Set the box to the bone orientation and location
-    box.matrix_world = bone.matrix
-    box.location = armature.location + ( bone.bone.head_local + bone.bone.tail_local ) / 2
-
-
-        
-def select_name( name = "", extend = True ):
-    if extend == False:
-        bpy.ops.object.select_all(action='DESELECT')
-    ob = bpy.data.objects.get(name)
-    ob.select = True
-    bpy.context.scene.objects.active = ob
diff --git a/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_init_ragdoll.py b/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_init_ragdoll.py
deleted file mode 100644
index e08c8de..0000000
--- a/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_init_ragdoll.py
+++ /dev/null
@@ -1,237 +0,0 @@
-#brik_init_ragdoll.py
-
-# ***** BEGIN MIT LICENSE BLOCK *****
-#
-#Script Copyright (c) 2010 Marcus P. Jenkins (Blenderartists user name FunkyWyrm)
-# Modified by Kees Brouwer (Blenderartists user name Wraaah)
-#
-#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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-#
-# ***** END MIT LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-"""
-This script spawns rigid body objects when ragdoll physics is activated.
-
-It spawns the rigid body objects, turns off the mob collision object's dynamics
-and makes the mob collision object 'Ghost'.
-
-    Objects cannot have 'Ghost' toggled from within the game. :(
-        
-    Mobs can probably be static, ghost anyway. If a mob needs to be dynamic
-    then it can be parented to a physics mesh and then the physics mesh can be
-    removed from the scene by this script to avoid collision conflicts with
-    the rigid bodies.
-
-It then sets the orientation and position to that of the hit boxes and links
-the rigid body objects together with rigid body joints.
-
-Rest orientations can be taken from the rigid body objects that remain on the
-hidden layer. I thought this would be a problem to set. It's so nice when
-something turns out easier than expected for a change. :)
-"""
-debug = False
-
-import bge
-
-scene = bge.logic.getCurrentScene()
-
-objects = scene.objects
-hidden_objects = scene.objectsInactive
-
-"""
-NOTE:
-    If a collision box is used then this will be the main added object
-    that is added and so will have the spawn_point and spawn_id
-    properties.
-    The collision box would need to be removed here.
-    In this case, the spawn_id and spawn_point would need to be copied
-    to the armature in order to properly identify which object is to be
-    ultimately removed from the scene.
-"""
-
-def main():
-
-    """
-    Sensor disabled. Using brik_use_ragdoll 'changed' sensor
-    """
-    #sens = spawn_boxes_cont.sensors['brik_spawn_boxes_sens']
-    #if sens.getKeyStatus(sens.key) == 1:
-    
-    init_ragdoll_controller = bge.logic.getCurrentController()
-    spawn_boxes_act = init_ragdoll_controller.actuators['brik_spawn_boxes_act']
-    
-    armature = init_ragdoll_controller.owner
-    
-    
-    #########################
-#    hidden_armature = hidden_objects[armature.name]
-    #########################
-    
-    
-#    spawn_point = armature['spawn_point']
-#    spawn_id = armature['spawn_id']
-    
-    if armature['brik_use_ragdoll'] and armature['brik_init_ragdoll']:
-
-        print('#########################')
-        print('SPAWNING RIGID BODY OBJECTS')
-        spawn_boxes_act.instantAddObject()
-        scene = bge.logic.getCurrentScene()
-        objects = scene.objects
-        objects.reverse()
-        
-        #Expand existing group
-        group_objects = armature["group"]
-        
-        group = spawn_boxes_act.object
-        for ob in objects:
-            group_objects[ob.name] = ob
-            ob["pivot"] = armature
-            if ob.name == group.name:
-                #Stop for loop once group start point is found
-                break
-                
-#        armature_name = spawn_empty["armature_name"]
-#        armature = group_objects[ armature_name ]
-        armature["group"] = group_objects
-
-        #Set up constraints
-        constraints = armature["constraints"]
-        for constraint in constraints:
-            settings = constraints[constraint]
-            constraint_name = settings.get("constraint_name", None)
-            print("Create 6DOF constraint")
-            print(constraint_name)
-            object = group_objects[ settings.get("object", None) ]
-            object_id = object.getPhysicsId()
-            target = group_objects[ settings.get("target", None) ]
-            target_id = target.getPhysicsId()
-            print(object)
-            print(target)
-            
-            piv_x = float( settings.get("pivot_x", 0.0) )           
-            piv_y = float( settings.get("pivot_y", 0.0) )            
-            piv_z = float( settings.get("pivot_z", 0.0) )           
-
-            piv_Rx = float( settings.get("pivot_Rx", 0.0) )           
-            piv_Ry = float( settings.get("pivot_Ry", 0.0) )           
-            piv_Rz = float( settings.get("pivot_Rz", 0.0) )           
-                
-            constraint_type = 12 #6DoF joint
-            flag = 128 #No collision with joined object.
-            joint = bge.constraints.createConstraint(object_id, target_id, constraint_type, piv_x, piv_y, piv_z, piv_Rx, piv_Ry, piv_Rz, flag)
-            joint.setParam(0, float( settings.get("x_min", 0.0) ), float( settings.get("x_max", 0.0) ) )
-            joint.setParam(1, float( settings.get("y_min", 0.0) ), float( settings.get("y_max", 0.0) ) )
-            joint.setParam(2, float( settings.get("z_min", 0.0) ), float( settings.get("z_max", 0.0) ) )
-            #Parameters 3 = limit x rotation, 4 = limit y rotation, 5 = limit z rotation
-            if settings.get("Rx_min", None):
-                joint.setParam(3, float( settings.get("Rx_min", 0.0) ), float( settings.get("Rx_max", 0.0) ) )
-            if settings.get("Ry_min", None):
-                joint.setParam(4, float( settings.get("Ry_min", 0.0) ), float( settings.get("Ry_max", 0.0) ) )
-            if settings.get("Rz_min", None):
-                joint.setParam(5, float( settings.get("Rz_min", 0.0) ), float( settings.get("Rz_max", 0.0) ) )
-                
-            #Translational motor
-            #setParam(type, vel, maxForce)
-            if settings.get("x_mot", None):
-                joint.setParam(6, float( settings.get("x_mot", 0.0) ), float( settings.get("x_mot_max", 999.0) ) )
-            if settings.get("y_mot", None):
-                joint.setParam(7, float( settings.get("y_mot", 0.0) ), float( settings.get("y_mot_max", 999.0) ) )
-            if settings.get("z_mot", None):
-                joint.setParam(8, float( settings.get("z_mot", 0.0) ), float( settings.get("z_mot_max", 999.0) ) )
-            #Rotational motor
-            #setParam(type, angVel, maxForce)
-            if settings.get("Rx_mot", None):
-                joint.setParam(9, float( settings.get("Rx_mot", 0.0) ), float( settings.get("Rx_mot_max", 999.0) ) )
-            if settings.get("Ry_mot", None):
-                joint.setParam(10, float( settings.get("Ry_mot", 0.0) ), float( settings.get("Ry_mot_max", 999.0) ) )
-            if settings.get("Rz_mot", None):
-                joint.setParam(11, float( settings.get("Rz_mot", 0.0) ), float( settings.get("Rz_mot_max", 999.0) ) )
-
-            #Translational spring
-            #setParam(type, stiffness, reset)
-            if settings.get("x_spring", None):
-                joint.setParam(12, float( settings.get("x_spring", 0.0) ), float( settings.get("x_spring_reset", 0) ) )
-            if settings.get("y_spring", None):
-                joint.setParam(13, float( settings.get("y_spring", 0.0) ), float( settings.get("y_spring_reset", 0) ) )
-            if settings.get("z_spring", None):
-                joint.setParam(14, float( settings.get("z_spring", 0.0) ), float( settings.get("z_spring_reset", 0) ) )
-            #Rotational spring
-            #setParam(type, stiffness, reset)
-            if settings.get("Rx_spring", None):
-                joint.setParam(15, float( settings.get("Rx_spring", 0.0) ), float( settings.get("Rx_spring_reset", 0) ) )
-            if settings.get("Ry_spring", None):
-                joint.setParam(16, float( settings.get("Ry_spring", 0.0) ), float( settings.get("Ry_spring_reset", 0) ) )
-            if settings.get("Rz_spring", None):
-                joint.setParam(17, float( settings.get("Rz_spring", 0.0) ), float( settings.get("Rz_spring_reset", 0) ) )
-            
-            #Store joint in object, can be used to change the parameter settings
-            #For example when a joint is broken you can widen the angle rotations
-            #Also possible to sever the joint completely but CLEAR THE VARIABLE FIRST
-            #BEFORE REMOVING THE JOINT else BGE CRASHES
-            object[constraint_name] = joint
-
-        #Copy hitbox positions + remove hitboxes, activate armature constraints
-        bone_hitbox = armature["bone_hitbox"] 
-        bone_rigidbody = armature["bone_rigidbody"]
-        bone_loc = armature["bone_loc"]
-        
-        for bone_name in bone_hitbox:
-            hitbox = group_objects[ bone_hitbox[ bone_name ] ]
-            rigidbody = group_objects[ bone_rigidbody[ bone_name ] ]
-            
-            rigidbody.worldPosition = hitbox.worldPosition
-            rigidbody.worldOrientation = hitbox.worldOrientation
-            
-            #Set up the copy rotation bone constraint for this driver
-            print('######################')
-            print('SETTING UP ROT BONE CONSTRAINTS FOR '+rigidbody.name)
-            print('BONE NAME ' + bone_name)
-            constraint_rot = armature.constraints[bone_name+":brik_copy_rot"]
-            constraint_rot.target = rigidbody
-            constraint_rot.enforce = 1.0
-            
-            copy_loc_target = bone_loc.get(bone_name, None)
-            if copy_loc_target:
-                #Set up the copy location constraint 
-                constraint_loc = armature.constraints[bone_name+':brik_copy_loc']
-                constraint_loc.target = group_objects[ copy_loc_target ]
-                constraint_loc.enforce = 1.0
-            
-            rigidbody.worldLinearVelocity = hitbox.worldLinearVelocity
-            rigidbody.worldAngularVelocity = hitbox.worldAngularVelocity
-            
-            hitbox.endObject()
-            
-        #for act in armature.actuators:
-            #There appears to be no direct way of checking that an actuator is an action actuator.
-            #act.type would be nice.
-        #    if hasattr(act, 'action'):
-        #        if not act.name == 'brik_use_act':
-        #            init_ragdoll_controller.deactivate(act)
-        #==> Why needed?
-        
-        #Needed to prevent brik_use_changed_sens second pulse from re-triggering the script.
-        armature['brik_init_ragdoll'] = False
-            
-        #if debug == True:
-    
-if __name__ == '__main__':
-    main()
diff --git a/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_load.py b/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_load.py
deleted file mode 100644
index b1ccb38..0000000
--- a/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_load.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#brik_load_0_1.py
-
-# ***** BEGIN MIT LICENSE BLOCK *****
-#
-#Script Copyright (c) 2010 Marcus P. Jenkins (Blenderartists user name FunkyWyrm)
-# Modified by Kees Brouwer (Blenderartists user name Wraaah)
-#
-#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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-#
-# ***** END MIT LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-"""
-This script loads the necessary data from a text file and stores it in the
-appropriate locations.
-
-It should run once at the very start of the game/level to avoid issues with
-frame rate later on.
-
-This is a load better than my first attempt at parsing a text file, but could
-probably still be optimised more.
-
-FOR MULTIPLE RAGDOLLS IN THE SAME SCENE:
-
-The correct armature data fileS need to be loaded at the start of the game.
-To do this, the name of the text file in the brik_ragdoll_data controller needs
-to be changed so it corresponds with the correct armature.
-
-This needs to be done when brik creates the logic.
-A separate spawn point should be created for each new ragdoll structure that is
-added to the scene. Each spawn point would load the data for it's corresponding
-ragdoll.
-    Alternatively, the brik_load.py script should iterate through all ragdoll
-    structures and load them in turn.
-    
-    The spawn point would need a new property that is a list of all ragdoll armatures
-    in the scene.
-    
-    For each ragdoll:
-        Set the data controller to use the correct data file.
-        Load the data.
-    
-    This would allow for a single spawn point to load all structure data.
-"""
-print('###########################')
-print('RUNNING brik_load_0_1.py')
-
-import bge
-import mathutils
-from mathutils import Vector, Quaternion
-    
-scene = bge.logic.getCurrentScene()
-cont = bge.logic.getCurrentController()
-
-objects = scene.objectsInactive
-
-spawn_point = cont.owner
-
-def load_data(data_cont):
-
-    data_file = data_cont.script
-    #remove whitespaces
-    data_file = data_file.replace(" ", "")
-    lines = data_file.splitlines(False)
-    
-    bone_hitbox = {}
-    bone_rigidbody = {}
-    bone_loc = {}
-    constraint_settings = {}
-    constraint_settings["constraint_name"] = ""
-    constraints = {}
-    
-    for line in lines:
-        
-        if (len(line) == 0) or (line.count("''") != 0):
-            #ignore short lines or lines (starting) with ''
-            pass
-        elif line.count(":") != 0:
-            #bone, hitbox, rigidbody link
-            items = line.split(":")
-            bone_name = items[0]
-            bone_hitbox[bone_name] = items[1]
-            bone_rigidbody[bone_name] = items[2]
-            if len(items) == 4:
-                bone_loc[bone_name] = items[3]
-            
-        elif line.count("=") == 1:
-            #Constraint settings
-            par, value = line.split("=")
-            if par == "constraint_name":
-                prev_name = constraint_settings["constraint_name"]
-                if prev_name != "":
-                    #save previous constraint
-                    constraints[prev_name] = constraint_settings
-                    
-                    constraint_settings = {}
-            constraint_settings[par] = value
-            
-        else:
-            #main settings
-            armature_name = line
-    #save last constraint
-    constraints[constraint_settings["constraint_name"]] = constraint_settings
-
-    return bone_hitbox, bone_rigidbody, bone_loc, constraints, armature_name
-#    spawn_point['mob_object'] = armature.name
-    
-def main():
-#    mob_total = spawn_point['brik_mob_count']
-            
-#    for count in range(0, mob_total+1):
-    
-    for cont in spawn_point.controllers:
-#       #if cont.name[:-8] == 'brik_ragdoll_data_'+str(count):
-        if cont.name[:] == 'brik_ragdoll_data_0':#removed -8,Wraaah
-            data_cont = cont
-                
-            bone_hitbox, bone_rigidbody, bone_loc, constraints, armature_name = load_data(data_cont)
-            armature = objects[armature_name]
-            armature["bone_hitbox"] = bone_hitbox
-            armature["bone_rigidbody"] = bone_rigidbody
-            armature["bone_loc"] = bone_loc
-            armature["constraints"] = constraints
-        
-if __name__ == '__main__':
-    main()
diff --git a/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_spawn.py b/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_spawn.py
deleted file mode 100644
index 6789fef..0000000
--- a/release/scripts/addons_contrib/game_engine_ragdolls_kit/templates/brik_spawn.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#brik_spawn_init.py
-
-# ***** BEGIN MIT LICENSE BLOCK *****
-#
-#Script Copyright (c) 2010 Marcus P. Jenkins (Blenderartists user name FunkyWyrm)
-# Modified by Kees Brouwer (Blenderartists user name Wraaah)
-#
-#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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
-#THE SOFTWARE.
-#
-# ***** END MIT LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import bge
-
-def initialize():
-    spawn_point = bge.logic.getCurrentController().owner
-    
-    #This is a list of all objects added by this spawn point.
-    spawn_point['added_objects'] = []
-    
-    #This is the total number of objects added by this spawn point.
-    #It is used to supply a unique Id to each added object.
-    spawn_point['add_count'] = 0
-    
-def main():
-
-    cont = bge.logic.getCurrentController()
-    #Best replace sensor with message?
-    sens = cont.sensors['brik_Tab_sens']
-    
-    if sens.getKeyStatus(sens.key) == 1:
-        print('#########################')
-        print('SPAWNING MOB AND HIT BOXES')
-        
-        spawn_act = cont.actuators['brik_spawn_act']
-        
-        #scene = bge.logic.getCurrentScene()
-        #objects = scene.objects
-        #hidden_objects = scene.objectsInactive
-        
-        spawn_empty = cont.owner
-        
-        #mob_object = hidden_objects[spawn_empty['mob_object']]
-        #mob_object = hidden_objects['Armature.001']
-        
-        #spawn_act.object = mob_object.name
-        spawn_act.instantAddObject()
-        scene = bge.logic.getCurrentScene()
-        objects = scene.objects
-        objects.reverse()
-
-        group_objects = {}
-        group = spawn_act.object
-        for ob in objects:
-            group_objects[ob.name] = ob
-#            ob["pivot"] = "test_pivot"
-            if ob.name == group.name:
-                #Stop for loop once group start point is found
-                break
-                
-        armature_name = spawn_empty["armature_name"]
-        armature = group_objects[ armature_name ]
-        armature["group"] = group_objects
-        
-        for ob_name in group_objects:
-            ob = group_objects[ob_name]
-            ob["pivot"] = armature
-            
-#        last_spawned = spawn_act.objectLastCreated
-        #print(dir(last_spawned))
-#        spawn_empty['added_objects'].append(last_spawned)
-#        spawn_empty['add_count'] += 1
-        
-        #This is used to identify which spawn point the spawned object was added by.
-#        last_spawned['spawn_point'] = spawn_empty.name
-        #This is a unique Id used to identify the added object.
-#        last_spawned['spawn_id'] = spawn_empty['add_count']
-        #This is the dictionary of drivers that are unique to the added object.
-        """
-        Originally this dictionary was defined in the brik_load.py script, but since
-        dictionaries are stored as a reference, and the added objects are copies of the
-        hidden object, the added objects had a copy of the reference to the dictionary
-        and all used the same dictionary.
-        Defining the dictionary after the objects are added to the scene ensures that
-        they each have a unique dictionary.
-        """
-#        last_spawned['driver_dict'] = {}
diff --git a/release/scripts/addons_contrib/geodesic_domes/__init__.py b/release/scripts/addons_contrib/geodesic_domes/__init__.py
deleted file mode 100644
index eebad0c..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/__init__.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Geodesic Domes",
-    "author": "PKHG , Meta Androcto, Kilon original for 2.49 from Andy Houston",
-    "version": (0,2,3),
-    "blender": (2, 61, 0),
-    "location": "View3D > UI > Geodesic...",
-    "description": "Choice for objects",
-    "warning": "not yet finished",
-    "wiki_url": "http://wiki.blender.org/index.php?title=Extensions:2.6/Py/Scripts/Modeling/Geodesic_Domes",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=29609",
-    "category": "Object"}
-
-"""
-Added save and load of parameters 14-12-2011 PKHG
-Added one possible *.bak for GD_0.GD (one time) 17-12-2011
-"""
-if "bpy" in locals():
-    import imp
-    imp.reload(third_domes_panel)
-    
-else:
-    from geodesic_domes import third_domes_panel
-   
-import bpy
-from bpy.props import *
-
-def register():
-    bpy.utils.register_module(__name__)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-if __name__ == "__main__":
-    register()
-
-
-
diff --git a/release/scripts/addons_contrib/geodesic_domes/add_shape_geodesic.py b/release/scripts/addons_contrib/geodesic_domes/add_shape_geodesic.py
deleted file mode 100644
index 1fe3183..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/add_shape_geodesic.py
+++ /dev/null
@@ -1,100 +0,0 @@
-import bpy
-import mathutils
-
-def reset_transform(ob):
-    m = mathutils.Matrix()
-    ob.matrix_local = m     
-
-def func_add_corrective_pose_shape_fast(source, target):
-    result = ""
-    reset_transform(target)
-    # If target object doesn't have Basis shape key, create it.
-    try:
-        num_keys = len( target.data.shape_keys.key_blocks )
-    except:
-        basis = target.shape_key_add()
-        basis.name = "Basis"
-        target.data.update()
-    key_index = target.active_shape_key_index
-    if key_index == 0:
-        # Insert new shape key
-        new_shapekey = target.shape_key_add()
-        new_shapekey.name = "Shape_" + source.name
-        new_shapekey_name = new_shapekey.name
-        key_index = len(target.data.shape_keys.key_blocks)-1
-        target.active_shape_key_index = key_index
-    # else, the active shape will be used (updated)
-    target.show_only_shape_key = True
-    shape_key_verts = target.data.shape_keys.key_blocks[ key_index ].data
-    try:
-        vgroup = target.active_shape_key.vertex_group
-        target.active_shape_key.vertex_group = ''
-    except:
-        print("blub")
-        result = "***ERROR*** blub"
-        pass
-    # copy the local vertex positions to the new shape
-    verts = source.data.vertices
-    try:
-        for n in range( len(verts)):
-            shape_key_verts[n].co = verts[n].co
-    # go to all armature modifies and unpose the shape
-    except:
-        message = "***ERROR***, meshes have different number of vertices"
-        result =  message
-    for n in target.modifiers:
-        if n.type == 'ARMATURE' and n.show_viewport:
-            #~ print("got one")
-            n.use_bone_envelopes = False
-            n.use_deform_preserve_volume = False
-            n.use_vertex_groups = True
-            armature = n.object
-            unposeMesh( shape_key_verts, target, armature)
-            break
-    
-    # set the new shape key value to 1.0, so we see the result instantly
-    target.data.shape_keys.key_blocks[ target.active_shape_key_index].value = 1.0
-    try:
-        target.active_shape_key.vertex_group = vgroup
-    except:
-        print("bluba")
-        result  = result + "bluba"
-        pass
-    target.show_only_shape_key = False
-    target.data.update()
-    return result
-    
-class add_corrective_pose_shape_fast(bpy.types.Operator):   
-    """Add 1st object as shape to 2nd object as pose shape (only 1 armature)"""
-    bl_idname = "object.add_corrective_pose_shape_fast"
-    bl_label = "Add object as corrective shape faster"
-    
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-    
-        if len(context.selected_objects) > 2:
-            print("Select source and target objects please")
-            return {'FINISHED'}
-
-        selection = context.selected_objects
-        target = context.active_object
-        if context.active_object == selection[0]:
-            source = selection[1]
-        else:
-            source = selection[0]
-        print(source)
-        print(target)
-        func_add_corrective_pose_shape_fast( source, target)
-        return {'FINISHED'}
-
-def register():
-    bpy.utils.register_module(__name__)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/geodesic_domes/forms_259.py b/release/scripts/addons_contrib/geodesic_domes/forms_259.py
deleted file mode 100644
index 4e451a5..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/forms_259.py
+++ /dev/null
@@ -1,222 +0,0 @@
-import math
-from math import pi,sin,cos,atan,tan,fabs
-from geodesic_domes.vefm_259 import *
-class form(mesh):
-    def __init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform):
-        mesh.__init__(self)
-        #PKHG alredey in vefm259 mesh: self.a360 = pi * 2.0
-        self.PKHG_parameters = [uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform]
-        self.ures = uresolution
-        self.vres = vresolution
-        
-        self.uscale = uscale
-        self.vscale = vscale
-        self.upart = upart
-        self.vpart = vpart
-        self.uphase = uphase * self.a360
-        self.vphase = vphase * self.a360
-        self.utwist = utwist
-        self.vtwist = vtwist
-        
-        self.xscale = xscale
-        self.yscale = yscale
-        self.sform = sform
-                
-        if self.upart != 1.0:    ## there is a gap in the major radius
-            self.uflag = 1
-        else:
-            self.uflag = 0
-        if self.vpart != 1.0:    ## there is a gap in the minor radius
-            self.vflag = 1
-        else:
-            self.vflag = 0
-        if self.uflag:
-            self.ufinish = self.ures + 1
-        else:
-            self.ufinish = self.ures
-        if self.vflag:
-            self.vfinish = self.vres + 1
-        else:
-            self.vfinish = self.vres
-        self.ustep = (self.a360 / self.ures) * self.upart
-        self.vstep = (self.a360 / self.vres) * self.vpart
-        if self.xscale != 1.0:
-            self.xscaleflag = 1
-        else:            
-            self.xscaleflag = 0        
-        if self.yscale != 1.0:            
-            self.yscaleflag = 1            
-        else:            
-            self.yscaleflag = 0                            
-        self.rowlist=[]
-
-    def generatepoints(self):
-        for i in range(self.ufinish):
-            row=[]
-            for j in range(self.vfinish):
-                u = self.ustep * i + self.uphase
-                v = self.vstep * j + self.vphase
-            #    if self.xscaleflag:
-            #        u = self.ellipsecomp(self.xscale,u) 
-            #    if self.yscaleflag:
-            #        v = self.ellipsecomp(self.yscale,v)            
-                if self.sform[12]:
-                    r1 = self.superform(self.sform[0],self.sform[1],self.sform[2],self.sform[3],self.sform[14] + u,self.sform[4],self.sform[5],self.sform[16] * v)
-                else:
-                    r1 = 1.0
-                if self.sform[13]:
-                    r2 = self.superform(self.sform[6],self.sform[7],self.sform[8],self.sform[9],self.sform[15] + v,self.sform[10],self.sform[11],self.sform[17] * v)
-                else:
-                    r2 = 1.0
-                x,y,z = self.formula(u,v,r1,r2)
-                point = vertex((x,y,z))
-                row.append(point)
-                self.verts.append(point)
-            self.rowlist.append(row)
-        if self.vflag:
-            pass
-        else:
-            for i in range(len(self.rowlist)):
-                self.rowlist[i].append(self.rowlist[i][0])
-        if  self.uflag:
-            pass
-        else:
-            self.rowlist.append(self.rowlist[0])
-
-#    def formula(self,u,v,r1,r2):
-#        pass
-
-    def generatefaces(self):
-        ufin = len(self.rowlist) - 1
-        vfin = len(self.rowlist[0]) - 1
-        for i in range(ufin):
-            for j in range(vfin):
-                top = i
-                bottom = i + 1
-                left = j
-                right = j + 1
-                a = self.rowlist[top][left]
-                b = self.rowlist[top][right]
-                c = self.rowlist[bottom][right]
-                d = self.rowlist[bottom][left]
-                face1 = face([a,b,c,d])
-                self.faces.append(face1)
-                edge1 = edge(a,b)
-                edge2 = edge(a,d)
-                self.edges.append(edge1)
-                self.edges.append(edge2)
-                if i + 1 == ufin:
-                    edge3 = edge(d,c)
-                    self.edges.append(edge3)
-                if j + 1 == vfin:
-                    edge4 = edge(b,c)
-                    self.edges.append(edge4)
-    
-class grid(form):
-    def __init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform):
-        form.__init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform)
-        unit = 1.0 / self.a360
-        if self.ures == 1 :            
-            print("\n***ERRORin forms_259.grid L121***, ures is  1, changed into 2\n\n")
-            self.ures = 2
-        if self.vres == 1 :            
-            print("\n***ERROR in grid forms_259.grid L124***, vres is 1, changed into 2\n\n")
-            self.vres = 2            
-        self.ustep = self.a360 / (self.ures - 1)
-        self.vstep = self.a360 / (self.vres - 1)
-        
-        self.uflag = 1
-        self.vflag = 1
-            
-        self.xscaleflag = 0        
-        self.yscaleflag = 0
-        self.uexpand = unit * self.uscale
-        self.vexpand = unit * self.vscale
-        self.ushift = self.uscale * 0.5
-        self.vshift = self.vscale * 0.5
-        
-        self.generatepoints()
-        self.generatefaces()
-        for i in range(len(self.verts)):
-            self.verts[i].index = i
-        self.connectivity()
-                
-    def formula(self,u,v,r1,r2):     
-        x = u * self.uexpand - self.ushift
-        y = v * self.vexpand - self.vshift
-        z = r1 * r2 - 1.0         
-        return x,y,z
-    
-    
-class cylinder(form):
-    def __init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform):
-        form.__init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform)
-        unit = 1.0 / self.a360
-        self.vshift = self.vscale * 0.5
-        self.vexpand = unit * self.vscale
-        self.vflag = 1    
-        self.generatepoints()
-        self.generatefaces()
-        for i in range(len(self.verts)):
-            self.verts[i].index = i
-        self.connectivity()    
-
-    def formula(self,u,v,r1,r2):
-        x = sin(u) * self.uscale * r1 * r2 * self.xscale
-        y = cos(u) * self.uscale * r1 * r2
-        z = v * self.vexpand - self.vshift
-        return x,y,z
-
-class parabola(form):
-    def __init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform):
-        form.__init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform)
-        unit = 1.0 / self.a360
-        self.vshift = self.vscale * 0.5
-        self.vexpand = unit * self.vscale
-        self.vflag = 1
-        self.generatepoints()
-        self.generatefaces()
-        for i in range(len(self.verts)):
-            self.verts[i].index = i
-        self.connectivity()        
-    
-    def formula(self,u,v,r1,r2):
-        factor = sqrt(v) + 0.001
-        x = sin(u) * factor * self.uscale * r1 * r2 * self.xscale
-        y = cos(u) * factor * self.uscale * r1 * r2
-        z = - v * self.vexpand + self.vshift
-        return x,y,z
-        
-class torus(form):    
-    def __init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform):
-        form.__init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform)
-        self.generatepoints()
-        self.generatefaces()
-        for i in range(len(self.verts)):
-            self.verts[i].index = i
-        self.connectivity()        
-                    
-    def formula(self,u,v,r1,r2):
-        z = sin(v) * self.uscale * r2 * self.yscale
-        y = (self.vscale + self.uscale * cos(v)) * cos(u) * r1 * r2
-        x = (self.vscale + self.uscale * cos(v)) * sin(u) * r1 * r2 * self.xscale
-        return x,y,z
-
-class sphere(form):
-    
-    def __init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform):
-        form.__init__(self,uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform)
-        self.vstep = (self.a360 / (self.vres - 1)) * self.vpart
-        self.vflag = 1
-        self.generatepoints()
-        self.generatefaces()
-        for i in range(len(self.verts)):
-            self.verts[i].index = i
-        self.connectivity()        
-        
-    def formula(self,u,v,r1,r2):
-        v = (v * 0.5) - (self.a360 * 0.25)
-        x = r1 * cos(u) * r2 * cos(v) * self.uscale * self.xscale
-        y = r1 * sin(u) * r2 * cos(v) * self.uscale
-        z = r2 * sin(v) * self.uscale * self.yscale
-        return x,y,z
diff --git a/release/scripts/addons_contrib/geodesic_domes/geodesic_classes_259.py b/release/scripts/addons_contrib/geodesic_domes/geodesic_classes_259.py
deleted file mode 100644
index 15378ce..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/geodesic_classes_259.py
+++ /dev/null
@@ -1,754 +0,0 @@
-#werkt from geodesic_domes.vefm_259 import *
-from geodesic_domes.vefm_259 import mesh, vertex, edge, face
-
-import math
-from math import pi,acos,sin,cos,atan,tan,fabs, sqrt
-
-def check_contains(cl,name , print_value = False):
-    dir_class = dir(cl)
-    for el in dir_class:
-        if el.startswith("_"):
-            pass
-        else:
-            if print_value:
-                tmp = getattr(cl,el)
-                print(name , " contains ==>",el," value = ", tmp)
-            else:
-                print(name , " contains ==>",el)
-    print("\ncheck_contains finished\n\n")
-
-class geodesic(mesh):
-    def __init__(self):
-        mesh.__init__(self)
-        self.PKHG_parameters = None
-#        print("\n------ geodesic L11 PKHG_parameters",PKHG_parameters)
-        self.panels = []
-        self.vertsdone = []
-        self.skeleton = []                ## List of verts in the full skeleton edges.
-        self.vertskeleton = [] # config needs this member
-        self.edgeskeleton = [] # config needs this member
-        self.sphericalverts = []
-        self.a45 = pi * 0.25
-        self.a90 = pi * 0.5
-        self.a180 = pi
-        self.a270 = pi * 1.5
-        self.a360 = pi * 2
-        #define members here
-        #setparams  needs:
-        self.frequency = None
-        self.eccentricity = None
-        self.squish = None
-        self.radius = None
-        self.square = None
-        self.squarez = None
-        self.cart = None
-        self.shape = None
-        self.baselevel = None
-        self.faceshape = None
-        self.dualflag = None
-        self.rotxy = None
-        self.rotz = None
-        self.klass = None
-        self.sform = None
-        self.super = None
-        self.odd = None
-        #config needs
-        self.panelpoints = None
-        self.paneledges = None
-        self.reversepanel = None
-        self.edgelength = None
-        self.vertsdone = None
-        self.panels = []
-    
-#PKHG because of unittest approach for a while the following three lines commentd
-#PKHG do not understand the problems with the next three lines
-#no does not work        self.setparameters()
-#        self.makegeodesic()
-#        self.connectivity()
-
-    def setparameters(self,params):
-        parameters = self.PKHG_parameters = params
-        self.frequency = parameters[0]    ## How many subdivisions - up to 20.
-        self.eccentricity = parameters[1]    ## Elliptical if >1.0.
-        self.squish = parameters[2]        ## Flattened if < 1.0.
-        self.radius = parameters[3]        ## Exactly what it says.
-        self.square = parameters[4]        ## Controls amount of superellipse in X/Y plane.
-        self.squarez = parameters[5]        ## Controls amount of superellipse in Z dimension.
-        self.cart = parameters[6]            ## Cuts out sphericalisation step.
-        self.shape = parameters[7]        ## Full sphere, dome, flatbase.
-        self.baselevel = parameters[8]        ## Where the base is cut on a flatbase dome.
-        self.faceshape = parameters[9]    ## Triangular, hexagonal, tri-hex.
-        self.dualflag = parameters[10]
-        self.rotxy = parameters[11]
-        self.rotz = parameters[12]
-        self.klass = parameters[13]
-        self.sform = parameters[14]
-        self.super = 0                    ## Toggles superellipse.
-        if self.square != 2.0 or self.squarez != 2.0:
-            self.super = 1
-        self.odd = 0                    ## Is the frequency odd. It matters for dome building.
-        if self.frequency % 2 != 0:
-            self.odd = 1
-
-    def makegeodesic(self):
-        self.vertedgefacedata() #PKHG only a pass 13okt11
-        self.config()                    ## Generate all the configuration information.
-        if self.klass:            
-            self.class2()
-        if self.faceshape == 1:
-            self.hexify()                ## Hexagonal faces
-        elif self.faceshape == 2:
-            self.starify()                ## Hex and Triangle faces
-        if self.dualflag:
-            self.dual()
-        if not self.cart:
-            self.sphericalize()    ##   Convert x,y,z positions into spherical u,v.
-        self.sphere2cartesian()    ##   Convert spherical uv back into cartesian x,y,z for final shape.
-        for i in range(len( self.verts)):
-            self.verts[i].index = i
-        for edg in self.edges:
-            edg.findvect()
-
-    def vertedgefacedata(self):
-        pass
-
-#PKHG 23.1    def config(self, frequency = 1): #???PKHG frequency problem  20 oct.
-    def config(self): #???PKHG frequency problem  20 oct.
-#PKHG_OK        print("\n20-11 >>>>>>>>>DBG geodesic_classes_259 config L117 called")
-        for i in range(len(self.vertskeleton)):
-            self.vertskeleton[i].index = i
-        for edges in self.edgeskeleton:
-#???PKHG TODO            s = skeletonrow(self.frequency, edges, 0, self) #self a geodesic
-            s = skeletonrow(self.frequency, edges, 0, self) #self a geodesic
-            self.skeleton.append(s)
-        for i in range(len( self.verts)):
-            self.verts[i].index = i
-        for i in range(len(self.panelpoints)):
-            a = self.vertsdone[self.panelpoints[i][0]][1]
-            b = self.vertsdone[self.panelpoints[i][1]][1]
-            c = self.vertsdone[self.panelpoints[i][2]][1]
-            panpoints = [    self.verts[a],
-                        self.verts[b],
-                        self.verts[c]]
-            panedges = [    self.skeleton[self.paneledges[i][0]],
-                        self.skeleton[self.paneledges[i][1]],
-                        self.skeleton[self.paneledges[i][2]]    ]
-            reverseflag = 0
-            for flag in self.reversepanel:
-                if flag == i:
-                    reverseflag = 1                     
-            p = panel(panpoints, panedges, reverseflag, self)
-#PKHG_panels not used?!            self.panels.append(p)
-        
-    def sphericalize(self):
-        if self.shape == 2:
-            self.cutbasecomp()
-        for vert in(self.verts):
-#PKHG test 20111030        
-#            x = vert.x
-#            y = vert.y
-#            z = vert.z
-            x = vert.vector.x
-            y = vert.vector.y
-            z = vert.vector.z
-
-            u = self.usphericalise(x,y,z)
-            v = self.vsphericalise(x,y,z)
-            self.sphericalverts.append([u,v])
-
-    def sphere2cartesian(self):
-#PKHG_TODOnot_now        check_contains(self,"sphereto self",True)
-        for i in range(len(self.verts)):
-            if self.cart:
-#PKHG test 20111030                        
-#                x = self.verts[i].x * self.radius * self.eccentricity
-#                y = self.verts[i].y * self.radius
-#                z = self.verts[i].z * self.radius * self.squish
-                x = self.verts[i].vector.x * self.radius * self.eccentricity
-                y = self.verts[i].vector.y * self.radius
-                z = self.verts[i].vector.z * self.radius * self.squish
-            else:
-                u = self.sphericalverts[i][0]
-                v = self.sphericalverts[i][1]
-                if self.squish != 1.0 or self.eccentricity>1.0:
-                    scalez = 1 / self.squish
-                    v = self.ellipsecomp(scalez,v)
-                    u = self.ellipsecomp(self.eccentricity,u)
-                if self.super:
-                    r1 = self.superell(self.square,u,self.rotxy)
-                    r2 = self.superell(self.squarez,v,self.rotz)
-                else:
-                    r1 = 1.0
-                    r2 = 1.0
-                
-            #    print "sform",self.sform,"  u",u,"  v",v
-                if self.sform[12]:
-                    
-                    r1 = r1 * self.superform(self.sform[0],self.sform[1],self.sform[2],self.sform[3],self.sform[14] + u,self.sform[4],self.sform[5],self.sform[16] * v)
-                if self.sform[13]:
-                
-                    r2 = r2 * self.superform(self.sform[6],self.sform[7],self.sform[8],self.sform[9],self.sform[15] + v,self.sform[10],self.sform[11],self.sform[17] * v)
-                x,y,z = self.cartesian(u,v,r1,r2)
-#PKHG test 20111030                        
-#            self.verts[i].x = x
-#            self.verts[i].y = y
-#            self.verts[i].z = z
-            self.verts[i] = vertex((x,y,z))
-        
-    def usphericalise(self,x,y,z):
-        if y == 0.0:
-            if x>0:
-                theta = 0.0
-            else:
-                theta = self.a180
-        elif x == 0.0:
-            if y>0:
-                theta = self.a90
-            else:
-                theta = self.a270
-                
-        else:
-            theta = atan(y / x)
-        if x < 0.0 and y < 0.0:
-            theta = theta + self.a180
-        elif x < 0.0 and y>0.0:
-            theta = theta + self.a180
-        u = theta
-        return u
-    
-    def vsphericalise(self,x,y,z) :
-        if z == 0.0:
-            phi = self.a90
-        else:
-            rho = sqrt(x ** 2 + y**2 + z**2)
-            phi = acos(z / rho)
-        v = phi
-        return v
-    def ellipsecomp(self,efactor,theta):
-        if theta == self.a90:
-            result = self.a90
-        elif theta == self.a270:
-            result = self.a270
-        else:
-            result = atan(tan(theta) / efactor**0.5)
-            if result>=0.0:
-                x = result
-                y = self.a180 + result
-                if fabs(x - theta) <= fabs(y - theta):
-                    result = x
-                else:
-                    result = y
-            else:
-                x = self.a180 + result
-                y = result
-            
-                if fabs(x - theta) <= fabs(y - theta):
-                    result = x
-                else:
-                    result = y
-        return result
-    def cutbasecomp(self):
-        pass
-
-    def cartesian(self,u,v,r1,r2):
-        x = r1 * cos(u) * r2 * sin(v) * self.radius * self.eccentricity
-        y = r1 * sin(u) * r2 * sin(v) * self.radius
-        z = r2 * cos(v) * self.radius * self.squish
-        return x,y,z
-#     def connectivity(self):
-# 
-#         self.dovertedge()
-#         self.dovertface()
-#         self.dofaceedge()
-
-class edgerow:
-    def __init__(self, count, anchor, leftindex, rightindex, stepvector, endflag, parentgeo):
-        self.points = []
-        self.edges = []
-        ## Make a row of evenly spaced points.
-        for i in range(count + 1):
-            if i == 0:
-                self.points.append(leftindex)
-            elif i == count and not endflag:
-                self.points.append(rightindex)
-            else: #PKHG Vectors added!
-                newpoint = anchor + (stepvector * i)
-                vertcount = len(parentgeo.verts)
-                self.points.append(vertcount)
-                newpoint.index = vertcount
-                parentgeo.verts.append(newpoint)
-        for i in range(count):
-            a = parentgeo.verts[self.points[i]]
-            b = parentgeo.verts[self.points[i + 1]]
-            line = edge(a,b)
-            self.edges.append(len(parentgeo.edges))
-            parentgeo.edges.append(line)
-
-class skeletonrow:
-    def __init__(self, count, skeletonedge, shortflag, parentgeo):
-        self.points = []
-        self.edges = []
-        self.vect = skeletonedge.vect
-        self.step = skeletonedge.vect / float(count)
-        ## Make a row of evenly spaced points.
-        for i in range(count + 1):
-            vert1 = skeletonedge.a
-            vert2 = skeletonedge.b
-            if i == 0:
-                if parentgeo.vertsdone[vert1.index][0]:
-                    self.points.append(parentgeo.vertsdone[vert1.index][1])
-                else:
-#PKHG test 20111030
-#                    newpoint = vertex((vert1.x, vert1.y, vert1.z))
-                    newpoint = vertex(vert1.vector)
-                    vertcount = len(parentgeo.verts)
-                    self.points.append(vertcount)
-                    newpoint.index = vertcount
-                    parentgeo.vertsdone[vert1.index] = [1,vertcount]
-                    parentgeo.verts.append(newpoint)                    
-                    
-            elif i == count:
-                if parentgeo.vertsdone[vert2.index][0]:
-                    self.points.append(parentgeo.vertsdone[vert2.index][1])
-                else:
-#PKHG test 20111030                    
-#                    newpoint = vertex((vert2.x, vert2.y, vert2.z))
-                    newpoint = vertex(vert2.vector)
-                    vertcount = len(parentgeo.verts)
-                    self.points.append(vertcount)
-                    newpoint.index = vertcount
-                    parentgeo.vertsdone[vert2.index] = [1,vertcount]
-                    parentgeo.verts.append(newpoint)                    
-            else:
-                newpoint = vertex(vert1.vector + (self.step * i)) #must be a vertex!
-                vertcount = len(parentgeo.verts)
-                self.points.append(vertcount)
-                newpoint.index = vertcount
-                parentgeo.verts.append(newpoint)
-        for i in range(count):
-            a = parentgeo.verts[self.points[i]]
-            b = parentgeo.verts[self.points[i + 1]]
-            line = edge(a,b)
-            self.edges.append(len(parentgeo.edges))
-            parentgeo.edges.append(line)
-
-class facefill:
-    def __init__(self, upper, lower, reverseflag, parentgeo, finish):
-        for i in range(finish):
-            a,b,c = upper.points[i],lower.points[i + 1],lower.points[i]
-            if reverseflag:
-                upface = face([parentgeo.verts[a],parentgeo.verts[c],parentgeo.verts[b]])
-            else:
-                upface = face([parentgeo.verts[a],parentgeo.verts[b],parentgeo.verts[c]])
-            parentgeo.faces.append(upface)
-            if i == finish - 1:
-                pass
-            else:
-                d = upper.points[i + 1]
-                if reverseflag:
-                    downface = face([parentgeo.verts[b],parentgeo.verts[d],parentgeo.verts[a]])
-                else:
-                    downface = face([parentgeo.verts[b],parentgeo.verts[a],parentgeo.verts[d]])
-                line = edge(parentgeo.verts[a],parentgeo.verts[b])
-                line2 = edge(parentgeo.verts[d],parentgeo.verts[b])
-                parentgeo.faces.append(downface)
-                parentgeo.edges.append(line)
-                parentgeo.edges.append(line2)
-class panel:
-    def __init__(self, points, edges, reverseflag, parentgeo):
-        self.cardinal = points[0]
-        self.leftv = points[1]
-        self.rightv = points[2]
-        self.leftedge = edges[0]
-        self.rightedge = edges[1]
-        self.baseedge = edges[2]
-        self.rows=[]
-        self.orient(parentgeo,edges)
-        self.createrows(parentgeo)
-        self.createfaces(parentgeo,reverseflag)
-
-    def orient(self,parentgeo,edges):
-        if self.leftedge.points[0] != self.cardinal.index:
-            self.leftedge.points.reverse()
-            self.leftedge.vect.negative()
-        
-        if self.rightedge.points[0] != self.cardinal.index:
-            self.rightedge.points.reverse()
-            self.rightedge.vect.negative()
-        
-        if self.baseedge.points[0] != self.leftv.index:
-        
-            self.baseedge.points.reverse()
-            self.baseedge.vect.negative()
-
-    def createrows(self, parentgeo):
-        for i in range(len(self.leftedge.points)):
-            if i == parentgeo.frequency:
-                newrow = self.baseedge
-            else:
-                newrow = edgerow(i, parentgeo.verts[self.leftedge.points[i]], self.leftedge.points[i], self.rightedge.points[i], self.baseedge.step, 0, parentgeo )
-            self.rows.append(newrow)
-    def createfaces(self, parentgeo,reverseflag):
-        for i in range(len(self.leftedge.points) - 1):
-            facefill(self.rows[i], self.rows[i + 1], reverseflag, parentgeo, len(self.rows[i].points))
-#############################
-#############################
-
-#for point on top?  YES!          
-class tetrahedron(geodesic,mesh):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-        
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( 0.0 , 0.0 , 1.73205080757 )),
-                            vertex(( 0.0 , -1.63299316185 , -0.577350269185 )),
-                            vertex(( 1.41421356237 , 0.816496580927 , -0.57735026919 )),
-                            vertex(( -1.41421356237 , 0.816496580927 , -0.57735026919 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[0],self.vertskeleton[2]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[1],self.vertskeleton[2]),
-                            edge(self.vertskeleton[2],self.vertskeleton[3]),
-                            edge(self.vertskeleton[1],self.vertskeleton[3])    ]
-        
-### probably to be removed, other gui! : "#??? delete PKHG"
-        self.panelpoints=[[0,1,2],[0,2,3],[0,1,3],[1,2,3]]
-        self.paneledges=[[0,1,3],[1,2,4],[0,2,5],[3,5,4]]
-        self.reversepanel=[2,3]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-
-#for edge on top? YES
-class tetraedge(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( 0.0 , -1.41421356237 , 1.0 )),
-                            vertex(( 0.0 , 1.41421356237 , 1.0 )),
-                            vertex(( 1.41421356237 , 0.0 , -1.0 )),
-                            vertex(( -1.41421356237 , 0.0 , -1.0 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[0],self.vertskeleton[2]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[1],self.vertskeleton[3]),
-                            edge(self.vertskeleton[1],self.vertskeleton[2]),
-                            edge(self.vertskeleton[2],self.vertskeleton[3])    ]
-        for i in range(len(self.vertskeleton)):
-            self.vertskeleton[i].index = i
-        self.panelpoints=[[0,1,2],[1,2,3],[0,1,3],[0,2,3]]
-        self.paneledges=[[0,1,4],[4,3,5],[0,2,3],[1,2,5]]
-        self.reversepanel=[0,3]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-
-#for face on top? YES
-class tetraface(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( -1.41421356237 , -0.816496580927 , 0.57735026919 )),
-                            vertex(( 1.41421356237 , -0.816496580927 , 0.57735026919 )),
-                            vertex(( 0.0 , 1.63299316185 , 0.577350269185 )),
-                            vertex(( 0.0 , 0.0 , -1.73205080757 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[2],self.vertskeleton[1]),
-                            edge(self.vertskeleton[2],self.vertskeleton[0]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[1],self.vertskeleton[3]),
-                            edge(self.vertskeleton[2],self.vertskeleton[3])    ]
-        self.panelpoints=[[2,0,1],[0,1,3],[2,1,3],[2,0,3]]
-        self.paneledges=[[2,1,0],[0,3,4],[1,5,4],[2,5,3]]
-        self.reversepanel=[1,3]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-
-class octahedron(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex((0.0,0.0,1.0)),
-                            vertex((0.0,1.0,0.0)),
-                            vertex((-1.0,0.0,0.0)),
-                            vertex((0.0,-1.0,0.0)),
-                            vertex((1.0,0.0,0.0)),
-                            vertex((0.0,0.0,-1.0))    ]
-        for i in range(len(self.vertskeleton)):
-            self.vertskeleton[i].index = i
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[0],self.vertskeleton[2]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[0],self.vertskeleton[4]),
-                            edge(self.vertskeleton[1],self.vertskeleton[2]),
-                            edge(self.vertskeleton[2],self.vertskeleton[3]),
-                            edge(self.vertskeleton[3],self.vertskeleton[4]),
-                            edge(self.vertskeleton[4],self.vertskeleton[1]),
-                            edge(self.vertskeleton[1],self.vertskeleton[5]),
-                            edge(self.vertskeleton[2],self.vertskeleton[5]),
-                            edge(self.vertskeleton[3],self.vertskeleton[5]),
-                            edge(self.vertskeleton[4],self.vertskeleton[5])    ]
-        self.panelpoints=[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,2,5],[2,3,5],[3,4,5],[4,1,5]]
-        self.paneledges=[[0,1,4],[1,2,5],[2,3,6],[3,0,7],[4,8,9],[5,9,10],[6,10,11],[7,11,8]]
-        self.reversepanel=[4,5,6,7]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-class octaedge(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( 0.0 , -0.707106781187 , 0.707106781187 )),
-                            vertex(( 0.0 , 0.707106781187 , 0.707106781187 )),
-                            vertex(( 1.0 , 0.0 , 0.0 )),
-                            vertex(( -1.0 , 0.0 , 0.0 )),
-                            vertex(( 0.0 , -0.707106781187 , -0.707106781187 )),
-                            vertex(( 0.0 , 0.707106781187 , -0.707106781187 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[0],self.vertskeleton[4]),
-                            edge(self.vertskeleton[0],self.vertskeleton[2]),
-                            edge(self.vertskeleton[1],self.vertskeleton[2]),
-                               edge(self.vertskeleton[1],self.vertskeleton[5]),
-                            edge(self.vertskeleton[1],self.vertskeleton[3]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[2],self.vertskeleton[4]),
-                               edge(self.vertskeleton[2],self.vertskeleton[5]),
-                            edge(self.vertskeleton[3],self.vertskeleton[5]),
-                            edge(self.vertskeleton[3],self.vertskeleton[4]),
-                            edge(self.vertskeleton[4],self.vertskeleton[5])    ]
-        self.panelpoints=[[0,1,2],[0,1,3],[0,2,4],[1,2,5],[1,3,5],[0,3,4],[2,4,5],[3,4,5]]
-        self.paneledges=[[0,2,3],[0,6,5],[2,1,7],[3,4,8],[5,4,9],[6,1,10],[7,8,11],[10,9,11]]
-        self.reversepanel=[0,2,4,7]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-class octaface(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( 0.408248458663 , -0.707106781187 , 0.577350150255 )),
-                            vertex(( 0.408248458663 , 0.707106781187 , 0.577350150255 )),
-                            vertex(( -0.816496412728 , 0.0 , 0.577350507059 )),
-                            vertex(( -0.408248458663 , -0.707106781187 , -0.577350150255 )),
-                            vertex(( 0.816496412728 , 0.0 , -0.577350507059 )),
-                            vertex(( -0.408248458663 , 0.707106781187 , -0.577350150255 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[2],self.vertskeleton[1]),
-                            edge(self.vertskeleton[2],self.vertskeleton[0]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                             edge(self.vertskeleton[0],self.vertskeleton[4]),
-                            edge(self.vertskeleton[1],self.vertskeleton[4]),
-                            edge(self.vertskeleton[1],self.vertskeleton[5]),
-                            edge(self.vertskeleton[2],self.vertskeleton[5]),
-                            edge(self.vertskeleton[2],self.vertskeleton[3]),
-                            edge(self.vertskeleton[3],self.vertskeleton[4]),
-                            edge(self.vertskeleton[4],self.vertskeleton[5]),
-                            edge(self.vertskeleton[3],self.vertskeleton[5])    ]
-        self.panelpoints=[[2,0,1],[0,3,4],[0,1,4],[1,4,5],[2,1,5],[2,3,5],[2,0,3],[3,4,5]]
-        self.paneledges=[[2,1,0],[3,4,9],[0,4,5],[5,6,10],[1,7,6],[8,7,11],[2,8,3],[9,11,10]]
-        self.reversepanel=[2,5,6,7]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-class icosahedron(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( 0.0 , 0.0 , 0.587785252292 )),
-                            vertex(( 0.0 , -0.525731096637 , 0.262865587024 )),
-                            vertex(( 0.5 , -0.162459832634 , 0.262865565628 )),
-                            vertex(( 0.309016994375 , 0.425325419658 , 0.262865531009 )),
-                            vertex(( -0.309016994375 , 0.425325419658 , 0.262865531009 )),
-                            vertex(( -0.5 , -0.162459832634 , 0.262865565628 )),
-                            vertex(( 0.309016994375 , -0.425325419658 , -0.262865531009 )),
-                            vertex(( 0.5 , 0.162459832634 , -0.262865565628 )),
-                            vertex(( 0.0 , 0.525731096637 , -0.262865587024 )),
-                            vertex(( -0.5 , 0.162459832634 , -0.262865565628 )),
-                            vertex(( -0.309016994375 , -0.425325419658 , -0.262865531009 )),
-                            vertex(( 0.0 , 0.0 , -0.587785252292 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[0],self.vertskeleton[2]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[0],self.vertskeleton[4]),
-                            edge(self.vertskeleton[0],self.vertskeleton[5]),
-                            edge(self.vertskeleton[1],self.vertskeleton[2]),
-                            edge(self.vertskeleton[2],self.vertskeleton[3]),
-                            edge(self.vertskeleton[3],self.vertskeleton[4]),
-                            edge(self.vertskeleton[4],self.vertskeleton[5]),
-                            edge(self.vertskeleton[5],self.vertskeleton[1]),
-                            edge(self.vertskeleton[1],self.vertskeleton[6]),
-                            edge(self.vertskeleton[2],self.vertskeleton[6]),
-                            edge(self.vertskeleton[2],self.vertskeleton[7]),
-                            edge(self.vertskeleton[3],self.vertskeleton[7]),
-                            edge(self.vertskeleton[3],self.vertskeleton[8]),
-                            edge(self.vertskeleton[4],self.vertskeleton[8]),
-                            edge(self.vertskeleton[4],self.vertskeleton[9]),
-                            edge(self.vertskeleton[5],self.vertskeleton[9]),
-                            edge(self.vertskeleton[5],self.vertskeleton[10]),
-                            edge(self.vertskeleton[1],self.vertskeleton[10]),
-                            edge(self.vertskeleton[6],self.vertskeleton[7]),
-                            edge(self.vertskeleton[7],self.vertskeleton[8]),
-                            edge(self.vertskeleton[8],self.vertskeleton[9]),
-                            edge(self.vertskeleton[9],self.vertskeleton[10]),
-                            edge(self.vertskeleton[10],self.vertskeleton[6]),
-                            edge(self.vertskeleton[6],self.vertskeleton[11]),
-                            edge(self.vertskeleton[7],self.vertskeleton[11]),
-                            edge(self.vertskeleton[8],self.vertskeleton[11]),
-                            edge(self.vertskeleton[9],self.vertskeleton[11]),
-                            edge(self.vertskeleton[10],self.vertskeleton[11])    ]
-        self.panelpoints=[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,2,6],[2,6,7],[2,3,7],[3,7,8],[3,4,8],[4,8,9],[4,5,9],[5,9,10],[5,1,10],[1,10,6],[6,7,11],[7,8,11],[8,9,11],[9,10,11],[10,6,11]]
-        self.paneledges=[[0,1,5],[1,2,6],[2,3,7],[3,4,8],[4,0,9],[5,10,11],[11,12,20],[6,12,13],[13,14,21],[7,14,15],[15,16,22],[8,16,17],[17,18,23],[9,18,19],[19,10,24],[20,25,26],[21,26,27],[22,27,28],[23,28,29],[24,29,25]]
-        self.reversepanel=[5,7,9,11,13,15,16,17,18,19]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-class icoedge(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( 0 , 0.309016994375 , 0.5 )),
-                            vertex(( 0 , -0.309016994375 , 0.5 )),
-                            vertex(( -0.5 , 0 , 0.309016994375 )),
-                            vertex(( 0.5 , 0 , 0.309016994375 )),
-                            vertex(( -0.309016994375 , -0.5 , 0 )),
-                            vertex(( 0.309016994375 , -0.5 , 0 )),
-                            vertex(( 0.309016994375 , 0.5 , 0 )),
-                            vertex(( -0.309016994375 , 0.5 , 0 )),
-                            vertex(( -0.5 , 0 , -0.309016994375 )),
-                            vertex(( 0.5 , 0 , -0.309016994375 )),
-                            vertex(( 0 , 0.309016994375 , -0.5 )),
-                            vertex(( 0 , -0.309016994375 , -0.5 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[0],self.vertskeleton[7]),
-                            edge(self.vertskeleton[0],self.vertskeleton[2]),
-                            edge(self.vertskeleton[1],self.vertskeleton[2]),
-                            edge(self.vertskeleton[1],self.vertskeleton[4]),
-                            edge(self.vertskeleton[1],self.vertskeleton[5]),
-                            edge(self.vertskeleton[1],self.vertskeleton[3]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[0],self.vertskeleton[6]),
-                            edge(self.vertskeleton[2],self.vertskeleton[7]),
-                            edge(self.vertskeleton[2],self.vertskeleton[8]),
-                            edge(self.vertskeleton[2],self.vertskeleton[4]),
-                            edge(self.vertskeleton[4],self.vertskeleton[5]),
-                            edge(self.vertskeleton[3],self.vertskeleton[5]),
-                            edge(self.vertskeleton[3],self.vertskeleton[9]),
-                            edge(self.vertskeleton[3],self.vertskeleton[6]),
-                            edge(self.vertskeleton[6],self.vertskeleton[7]),
-                            edge(self.vertskeleton[7],self.vertskeleton[10]),
-                            edge(self.vertskeleton[7],self.vertskeleton[8]),
-                            edge(self.vertskeleton[4],self.vertskeleton[8]),
-                            edge(self.vertskeleton[4],self.vertskeleton[11]),
-                            edge(self.vertskeleton[5],self.vertskeleton[11]),
-                            edge(self.vertskeleton[5],self.vertskeleton[9]),
-                            edge(self.vertskeleton[6],self.vertskeleton[9]),
-                            edge(self.vertskeleton[6],self.vertskeleton[10]),
-                            edge(self.vertskeleton[8],self.vertskeleton[10]),
-                            edge(self.vertskeleton[8],self.vertskeleton[11]),
-                            edge(self.vertskeleton[9],self.vertskeleton[11]),
-                            edge(self.vertskeleton[9],self.vertskeleton[10]),
-                            edge(self.vertskeleton[10],self.vertskeleton[11])    ]
-        self.panelpoints=[    [0,1,2],[0,1,3],[0,2,7],[1,2,4],[1,4,5],[1,3,5],[0,3,6],[0,6,7],[2,7,8],[2,4,8],
-                        [3,5,9],[3,6,9],[7,8,10],[4,8,11],[4,5,11],[5,9,11],[6,9,10],[6,7,10],[8,10,11],[9,10,11]]
-        self.paneledges=[[0,2,3],[0,7,6],[2,1,9],[3,4,11],[4,5,12],[6,5,13],[7,8,15],[8,1,16],[9,10,18],[11,10,19],
-                    [13,14,22],[15,14,23],[18,17,25],[19,20,26],[12,20,21],[22,21,27],[23,24,28],[16,24,17],[25,26,29],[28,27,29]]
-        self.reversepanel=[0,2,5,9,11,12,14,15,17,19]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-class icoface(geodesic):
-    def __init__(self,parameter):
-        geodesic.__init__(mesh)
-        geodesic.setparameters(self,parameter)
-        self.set_vert_edge_skeleons()
-    def set_vert_edge_skeleons(self):
-        self.vertskeleton=[        vertex(( -0.17841104489 , 0.309016994375 , 0.46708617948 )),
-                            vertex(( -0.17841104489 , -0.309016994375 , 0.46708617948 )),
-                            vertex(( 0.35682208977 , 0.0 , 0.467086179484 )),
-                            vertex(( -0.57735026919 , 0.0 , 0.110264089705 )),
-                            vertex(( -0.288675134594 , -0.5 , -0.11026408971 )),
-                            vertex(( 0.288675134594 , -0.5 , 0.11026408971 )),
-                            vertex(( 0.57735026919 , 0.0 , -0.110264089705 )),
-                            vertex(( 0.288675134594 , 0.5 , 0.11026408971 )),
-                            vertex(( -0.288675134594 , 0.5 , -0.11026408971 )),
-                            vertex(( -0.35682208977 , 0.0 , -0.467086179484 )),
-                            vertex(( 0.17841104489 , -0.309016994375 , -0.46708617948 )),
-                            vertex(( 0.17841104489 , 0.309016994375 , -0.46708617948 ))    ]
-        self.edgeskeleton=[    edge(self.vertskeleton[0],self.vertskeleton[1]),
-                            edge(self.vertskeleton[2],self.vertskeleton[1]),
-                            edge(self.vertskeleton[2],self.vertskeleton[0]),
-                            edge(self.vertskeleton[0],self.vertskeleton[3]),
-                            edge(self.vertskeleton[1],self.vertskeleton[3]),
-                            edge(self.vertskeleton[1],self.vertskeleton[4]),
-                            edge(self.vertskeleton[1],self.vertskeleton[5]),
-                            edge(self.vertskeleton[2],self.vertskeleton[5]),
-                            edge(self.vertskeleton[2],self.vertskeleton[6]),
-                            edge(self.vertskeleton[2],self.vertskeleton[7]),
-                            edge(self.vertskeleton[0],self.vertskeleton[7]),
-                            edge(self.vertskeleton[0],self.vertskeleton[8]),
-                            edge(self.vertskeleton[3],self.vertskeleton[9]),
-                            edge(self.vertskeleton[3],self.vertskeleton[4]),
-                            edge(self.vertskeleton[5],self.vertskeleton[4]),
-                            edge(self.vertskeleton[5],self.vertskeleton[10]),
-                            edge(self.vertskeleton[5],self.vertskeleton[6]),
-                            edge(self.vertskeleton[7],self.vertskeleton[6]),
-                            edge(self.vertskeleton[7],self.vertskeleton[11]),
-                            edge(self.vertskeleton[7],self.vertskeleton[8]),
-                            edge(self.vertskeleton[3],self.vertskeleton[8]),
-                            edge(self.vertskeleton[4],self.vertskeleton[9]),
-                            edge(self.vertskeleton[4],self.vertskeleton[10]),
-                            edge(self.vertskeleton[6],self.vertskeleton[10]),
-                            edge(self.vertskeleton[6],self.vertskeleton[11]),
-                            edge(self.vertskeleton[8],self.vertskeleton[11]),
-                            edge(self.vertskeleton[8],self.vertskeleton[9]),
-                            edge(self.vertskeleton[9],self.vertskeleton[10]),
-                            edge(self.vertskeleton[11],self.vertskeleton[10]),
-                            edge(self.vertskeleton[11],self.vertskeleton[9])    ]
-        self.panelpoints=[[2,0,1],[0,1,3],[2,1,5],[2,0,7],[1,3,4],[1,5,4],[2,5,6],[2,7,6],[0,7,8],[0,3,8],[3,4,9],[5,4,10],[5,6,10],[7,6,11],[7,8,11],[3,8,9],[4,9,10],[6,11,10],[8,11,9],[11,9,10]]
-        self.paneledges=[[2,1,0],[0,3,4],[1,7,6],[2,9,10],[4,5,13],[6,5,14],[7,8,16],[9,8,17],[10,11,19],[3,11,20],
-                    [13,12,21],[14,15,22],[16,15,23],[17,18,24],[19,18,25],[20,12,26],[21,22,27],[24,23,28],[25,26,29],[29,28,27]]
-        self.reversepanel=[1,3,5,7,9,10,12,14,17,19]
-        self.edgelength=[]
-        self.vertsdone=[[0,0]] * len(self.vertskeleton)
-
-##???PKHG TODO this does not work yet ...
-def creategeo(geo,polytype,orientation,parameters):
-    
-    if polytype == 'Tetrahedron':
-        if orientation == 'PointUp':
-            #return
-            #geo(parameters)
-#            geo.setparameters()
-            my_tetrahedron = tetrahedron(geodesic)
-            my_tetrahedron.set_vert_edge_skeleons()
-            my_tetrahedron.config()            
-            check_contains(my_tetrahedron,"my_tetra",True)
-            vefm_add_object(geo)
-        elif orientation == 'EdgeUp':
-            geo = tetraedge(parameters)
-        else: # orientation==2:
-            geo=tetraface(parameters)
-    elif polytype == 'Octahedron':        # octahedron
-        if orientation == 'PointUp':
-            geo = octahedron(parameters)
-        elif orientation == 'EdgeUp':
-            geo = octaedge(parameters)
-        else: #if orientation==2:
-            geo = octaface(parameters)
-    elif polytype == 'Icosahedron':    # icosahedron
-        if orientation == 'PointUp':
-            geo = icosahedron(parameters)
-        elif orientation == 'EdgeUp':
-            geo = icoedge(parameters)
-        else: #if orientation==2:
-            geo = icoface(parameters)
-    return geo
diff --git a/release/scripts/addons_contrib/geodesic_domes/read_me.txt b/release/scripts/addons_contrib/geodesic_domes/read_me.txt
deleted file mode 100644
index ad20376..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/read_me.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Geodesic_Domes
-Based on a script by Andy Houston (serendipiti) for Blender 2.49
-Original Script Documentation:
-http://wiki.blender.org/index.php/Extensions:2.4/Py/Scripts/Wizards/Geodesic_dome
-Licence:
-GPL
-
-PKHG (did the conversion)
-BIG change after revision 2551 GUI adjusted ...
-You should download anew if older then 24-november-2011
-
-In principle all parts work:
-the *hedrons with superformparameters
-Grid ... Sphere with superformparameters
-Faces  **
-Hubs   **
-Struts **
-
-** means will be adjusted ... at the moment you  have to name objects and
-execute eventually again ;-( ...
-
-but PKHG is content with a this nearly 95% converted version.
-
-TODO, ranges of parameters could be chosen differently. Inform PKHG!
-
-Uplaod will be done today (25-11 at about 19.30... GMT -+1)
-
-_259 in the names is not important ... but let it be so (now) ;-)
diff --git a/release/scripts/addons_contrib/geodesic_domes/third_domes_panel.py b/release/scripts/addons_contrib/geodesic_domes/third_domes_panel.py
deleted file mode 100644
index 171a96a..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/third_domes_panel.py
+++ /dev/null
@@ -1,1062 +0,0 @@
-import bpy
-import os
-from geodesic_domes import vefm_259 
-from geodesic_domes import forms_259
-from geodesic_domes import geodesic_classes_259
-from geodesic_domes import add_shape_geodesic
-
-from bpy.props import EnumProperty, IntProperty, FloatProperty, StringProperty, BoolProperty
-import math
-from math import pi
-from mathutils import Vector #needed to check vertex.vector values
-try:
-    breakpoint = bpy.types.bp.bp
-except:
-    print("add breakpoint addon!")
-        
-
-########global######
-last_generated_object = None
-last_imported_mesh = None
-basegeodesic = None
-imported_hubmesh_to_use = None
-########global end######
-
-########EIND FOR SHAPEKEYS######
-### error messages?!
-bpy.types.Scene.error_message = StringProperty(name="actual error", default = "")    
-
-
-bpy.types.Scene.geodesic_not_yet_called = BoolProperty(name="geodesic_not_called",default = True)
-
-bpy.types.Scene.gd_help_text_width = IntProperty(name = "Text Width" , description = "The width above which the text wraps" , default = 60 , max = 180 , min = 20)
-
-class Geodesic_Domes_Operator_Panel(bpy.types.Panel):
-    """start a GD object here"""
-    bl_label = "Geodesic Domes"
-    bl_region_type = "TOOLS" #UI possible too
-    bl_space_type = "VIEW_3D"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self,context):
-        sce = context.scene
-        layout = self.layout
-        col = layout.column()
-        col.label("To start an GD object: ")
-        col.operator(GenerateGeodesicDome.bl_idname,"execute me!")
-            
-class GenerateGeodesicDome(bpy.types.Operator):
-    bl_label = "Modify Geodesic Objects"
-    bl_idname = "mesh.generate_geodesic_dome"
-    bl_description = "Create object dependent on selection"
-    bl_options = {'REGISTER','UNDO'}
-
-#PKHG_NEW saving and loading parameters
-    save_parameters = BoolProperty(name = "save params",\
-           description = "activation save */tmp/GD_0.GD", default = False)
-    load_parameters  = BoolProperty(name = "load params",\
-           description = "read */tmp/GD_0.GD", default = False)
-
-    gd_help_text_width = IntProperty(name = "Text Width" , description = "The width above which the text wraps" , default = 60 , max = 180 , min = 20)
-
-    
-    mainpages = EnumProperty(
-    name="Menu",
-    description="Create Faces, Struts & Hubs",
-    items=[("Main","Main","Geodesic objects"),
-           ("Faces","Faces","Generate Faces"),
-           ("Struts","Struts","Generate Struts"),
-           ("Hubs","Hubs","Generate Hubs"),
-           ("Help","Help","Not implemented"),
-          ],
-    default='Main')
-
-#for Faces!
-    facetype_menu = EnumProperty(
-    name="Faces",
-    description="choose a facetype",
-    items=[("0","strip","strip"),
-           ("1","open vertical","vertical"),
-           ("2","opwn slanted","slanted"),
-           ("3","closed point","closed point"),
-           ("4","pillow","pillow"),
-           ("5","closed vertical","closed vertical"),
-           ("6","stepped","stepped"),
-           ("7","spikes","spikes"),
-           ("8","boxed","boxed"),
-           ("9","diamond","diamond"),
-           ("10","bar","bar"),
-          ],
-    default='0')
-
-    facetoggle = BoolProperty(name="Activate: Face Object", description = "Activate Faces for Geodesic object", default = False )
-#    faceimporttoggle = BoolProperty(name="faceimporttoggle", default = False )
-    face_use_imported_object = BoolProperty(name="Use: Imported Object",\
-                description = "Activate faces on your Imported object",	default = False)
-    facewidth = FloatProperty(name="facewidth", min = -8,   max = 8, default = .50)
-    fwtog = BoolProperty(name="fwtog", default = False )
-    faceheight = FloatProperty(name="faceheight", min = -8, max = 8, default = 1 )
-    fhtog = BoolProperty(name="fhtog", default = False )
-    face_detach = BoolProperty(name="face_detach", default = False )
-    fmeshname = StringProperty(name="fmeshname", default = "defaultface")
-
-
-    geodesic_types = EnumProperty(
-    name="Objects",
-    description="Choose Geodesic, Grid, Cylinder,Parabola, Torus, Sphere, Import your mesh or Superparameters",
-    items=[("Geodesic","Geodesic","Generate Geodesic"),
-           ("Grid","Grid","Generate Grid"),
-           ("Cylinder","Cylinder","Generate Cylinder"),
-           ("Parabola","Parabola","Generate Parabola"),
-           ("Torus","Torus","Generate Torus"),
-           ("Sphere","Sphere","Generate Sphere"),
-           ("Import your mesh","Import your mesh","Import Your Mesh"),
-          ],
-    default='Geodesic')
-
-    import_mesh_name = StringProperty(name = "mesh to import",\
-            description = "the name has to be the name of a meshobject", default = "None") 
-
-    base_type = EnumProperty(
-    name="Hedron",
-    description="Choose between Tetrahedron, Octahedron, Icosahedron ",
-    items=[("Tetrahedron","Tetrahedron","Generate Tetrahedron"),
-           ("Octahedron","Octahedron","Generate Octahedron"),
-           ("Icosahedron","Icosahedron","Generate Icosahedron"),
-          ],
-    default='Tetrahedron')
-
-    orientation = EnumProperty(
-    name="Point^",
-    description="Point (Vert), Edge or Face pointing upwards",
-    items=[("PointUp","PointUp","Point up"),
-           ("EdgeUp","EdgeUp","Edge up"),
-           ("FaceUp","FaceUp","Face up"),
-           ],
-    default='PointUp')
-
-    geodesic_class = EnumProperty(
-    name="Class",
-    description="Subdivide Basic/Triacon",
-    items=[("Class 1","Class 1","class one"),
-           ("Class 2","Class 2","class two"),
-           ],
-    default='Class 1')
-
-    tri_hex_star = EnumProperty(
-    name="Shape",
-    description="Choose between tri hex star face types",
-    items=[("tri","tri","tri faces"),
-           ("hex","hex","hex faces(by tri)"),
-           ("star","star","star faces(by tri)"),
-              ],
-    default='tri')
-
-    spherical_flat = EnumProperty(
-    name="Round",
-    description="Choose between spherical or flat ",
-    items=[("spherical","spherical","Generate spherical"),
-           ("flat","flat","Generate flat"),
-              ],
-    default='spherical')
-
-    use_imported_mesh = BoolProperty(name="use import",\
-                    description = "Use an imported mesh", default = False)
-
-#Cylinder
-    cyxres= IntProperty(name="Resolution x/y", min = 3, max = 32,\
-              description = "number of faces around x/y", default = 5 )
-    cyyres= IntProperty(name="Resolution z", min = 3, max = 32,\
-              description = "number of faces in z direction", default = 5 )
-    cyxsz= FloatProperty(name="Scale x/y", min = 0.01, max = 10,\
-	          description = "scale in x/y direction", default = 1 )
-    cyysz= FloatProperty(name="Scale z", min = 0.01, max = 10,\
-              description = "scale in z direction", default = 1 )    
-    cyxell= FloatProperty(name="Stretch x",  min = 0.001, max = 4,\
-              description = "stretch in x direction", default = 1 )
-    cygap= FloatProperty(name="Gap",  min = -2, max = 2, precision = 4,\
-              description = "shrink in % around radius", default = 1 )
-    cygphase= FloatProperty(name="Phase", min = -4, max = 4,\
-              description = "rotate around pivot x/y", default = 0 )
-#Parabola
-    paxres= IntProperty(name="Resolution x/y",  min = 3, max = 32,\
-           description = "number of faces around x/y", default = 5 )
-    payres= IntProperty(name="Resolution z",  min = 3, max = 32,\
-           description = "number of faces in z direction", default = 5 )
-    paxsz= FloatProperty(name="Scale x/y", min = 0.001, max = 10,\
-           description = "scale in x/y direction", default = 0.30)
-    paysz= FloatProperty(name="Scale z", min = 0.001, max = 10,\
-           description = "scale in z direction",	default = 1 )
-    paxell= FloatProperty(name="Stretch x", min = 0.001, max = 4,\
-           description = "stretch in x direction",	default = 1 )
-    pagap= FloatProperty(name="Gap", min = -2, max = 2,\
-           description = "shrink in % around radius", precision = 4, default = 1 )
-    pagphase= FloatProperty(name="Phase", min = -4, max = 4,\
-           description = "rotate around pivot x/y",	default = 0 )
-#Torus            
-    ures= IntProperty(name="Resolution x/y",min = 3, max = 32,\
-           description = "number of faces around x/y", default = 8 )
-    vres= IntProperty(name="Resolution z", min = 3, max = 32,\
-            description = "number of faces in z direction", default = 8 )
-    urad= FloatProperty(name="Radius x/y", min = 0.001, max = 10,\
-            description = "radius in x/y plane",	default = 1 )
-    vrad= FloatProperty(name="Radius z", min = 0.001, max = 10,\
-            description = "radius in z plane",	default = 0.250)
-    uellipse= FloatProperty(name="Stretch x", min = 0.001, max = 10,\
-            description = "number of faces in z direction",	default = 1 )
-    vellipse= FloatProperty(name="Stretch z", min = 0.001, max = 10,\
-            description = "number of faces in z direction",	default = 1 )
-    upart= FloatProperty(name="Gap x/y", min = -4, max = 4, precision = 4,\
-            description = "shrink faces around x/y",	default = 1 )
-    vpart= FloatProperty(name="Gap z", min = -4, max = 4,  precision = 4,\
-            description = "shrink faces in z direction",	default = 1 )
-    ugap= FloatProperty(name="Phase x/y",  min = -4, max = 4, precision = 4,\
-           description = "rotate around pivot x/y", default = 0 )
-    vgap= FloatProperty(name="Phase z",  min = -4, max = 4, precision = 4,\
-           description = "rotate around pivot z", default = 0 )
-    uphase= FloatProperty(name="uphase", min = -4, max = 4,\
-            description = "number of faces in z direction",	default = 0 )
-    vphase= FloatProperty(name="vphase",  min = -4, max = 4,\
-            description = "number of faces in z direction",	default = 0 )
-    uexp= FloatProperty(name="uexp",  min = -4, max = 4,\
-            description = "number of faces in z direction",	default = 0 )
-    vexp= FloatProperty(name="vexp",  min = -4, max = 4,\
-            description = "number of faces in z direction",	default = 0 )
-    usuper= FloatProperty(name="usuper", min = -4, max = 4,\
-           description = "first set of superform parameters",  default = 2 )
-    vsuper= FloatProperty(name="vsuper",  min = -4, max = 4,\
-            description = "second set of superform parameters", default = 2 )
-    utwist= FloatProperty(name="Twist x/y", min = -4, max = 4,\
-            description = " use with superformular u",	default = 0 )
-    vtwist= FloatProperty(name="Twist z", min = -4, max = 4,\
-            description = "use with superformular v",	default = 0 )
-
-#Sphere 
-    bures= IntProperty(name="Resolution x/y", min = 3, max = 32,\
-            description = "number of faces around x/y",	default = 8 )
-    bvres= IntProperty(name="Resolution z", min = 3, max = 32,\
-            description = "number of faces in z direction",	default = 8 )
-    burad= FloatProperty(name="Radius",  min = -4, max = 4,\
-            description = "overall radius",	default = 1 )
-    bupart= FloatProperty(name="Gap x/y", min = -4, max = 4, precision = 4,\
-            description = "shrink faces around x/y",	default = 1 )
-    bvpart= FloatProperty(name="Gap z", min = -4, max = 4, precision = 4,\
-            description = "shrink faces in z direction",	default = 1 )
-    buphase= FloatProperty(name="Phase x/y",  min = -4, max = 4,
-            description = "rotate around pivot x/y",	default = 0 )
-    bvphase= FloatProperty(name="Phase z", min = -4, max = 4,\
-            description = "rotate around pivot z",	default = 0 )
-    buellipse= FloatProperty(name="Stretch x", min = 0.001, max = 4,\
-            description = "stretch in the x direction",	default = 1 )
-    bvellipse= FloatProperty(name="Stretch z", min = 0.001, max = 4,\
-            description = "stretch in the z direction",	default = 1 )
-#Grid    
-    grxres = IntProperty(name="Resolution x", min = 2, soft_max = 10, max = 20,\
-                         description = "number of faces in x direction", default = 5 )
-    gryres = IntProperty(name="Resolution z",min = 2, soft_min = 2, soft_max=10, max = 20,\
-                         description = "number of faces in x direction", default = 2)
-    grxsz = FloatProperty(name = "X size", min = 1, soft_min=0.01, soft_max=5, max = 10,\
-                         description = "x size", default = 2.0)
-    grysz = FloatProperty(name="Y size",min = 1, soft_min=0.01, soft_max=5, max = 10,\
-                         description = "y size", default = 1.0)
-
-#PKHG_TODO_??? what means cart
-    cart = IntProperty(name = "cart",min = 0, max = 2,  default = 0)
-                         
-    frequency = IntProperty(name="Frequency", min = 1, max = 8,\
-                           description ="subdivide base triangles", default = 1 )
-    eccentricity = FloatProperty(name = "Eccentricity",  min = 0.01 , max = 4,\
-                 description = "scaling in x/y dimension", default = 1 )
-    squish = FloatProperty(name = "Squish",min = 0.01, soft_max = 4, max = 10,\
-                 description = "scaling in z dimension",  default = 1 )
-    radius = FloatProperty(name = "Radius",min = 0.01, soft_max = 4, max = 10,\
-                 description = "overall radius",  default = 1 )
-    squareness = FloatProperty(name="Square x/y", min = 0.1, max = 5,\
-                 description = "superelipse action in x/y", default = 2 )
-    squarez = FloatProperty(name="Square z", min = 0.1, soft_max = 5, max = 10,\
-                 description = "superelipse action in z", default = 2 )
-    baselevel = IntProperty(name="baselevel", default = 5 )
-    dual = BoolProperty(name="Dual", description = "faces become verts, verts become faces, edges flip", default = False)
-    rotxy = FloatProperty(name="Rotate x/y", min= -4, max = 4,\
-                 description = "rotate superelipse action in x/y", default = 0 )
-    rotz = FloatProperty(name="Rotate z",  min= -4, max = 4,\
-                 description = "rotate superelipse action in z", default = 0 )
-
-#for choice of superformula
-    uact = BoolProperty(name = 'superformula u (x/y)', description = "activate superformula u parameters", default = False)
-    vact = BoolProperty(name = 'superformula v (z)', description = "activate superformula v parameters", default = False)
-    um = FloatProperty(name = 'um', min = 0, soft_min=0.1, soft_max = 10, max = 20,\
-                 description = "to do",	default =  3)
-    un1 = FloatProperty(name = 'un1', min = 0, soft_min=0.1, soft_max = 10,max = 20,\
-                 description = "to do",	default =  1)
-    un2 = FloatProperty(name = 'un2', min = 0, soft_min=0.1, soft_max = 10,max = 20,\
-                 description = "to do",	default =  1)
-    un3 = FloatProperty(name = 'un3', min = 0,   soft_min=0.1, soft_max = 10, max = 20,\
-                 description = "to do",	default =  1)
-    ua = FloatProperty(name = 'ua', min = 0.01, soft_min=0.1, soft_max = 8, max = 16,\
-                 description = "semi-diameter (has both soft pars!)", default =  1.0)
-    ub = FloatProperty(name = 'ub', min = 0.01, soft_min = 0.1, soft_max = 8, max = 16,\
-                 description = "semi-diameter  (has both soft pars!)", default =  1.0)
-    vm = FloatProperty(name = 'vm', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  1)
-    vn1 = FloatProperty(name = 'vn1', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  1)
-    vn2 = FloatProperty(name = 'vn2', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  1)
-    vn3 = FloatProperty(name = 'vn3', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  1)
-    va = FloatProperty(name = 'va', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  1)
-    vb = FloatProperty(name = 'vb', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  1)
-
-    uturn = FloatProperty(name = 'uturn', min = -5, soft_min=0, soft_max=5,max = 10,\
-                 description = "to do",	default =  0)
-    vturn = FloatProperty(name = 'vturn', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  0)
-    utwist = FloatProperty(name = 'utwist', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  0)
-    vtwist = FloatProperty(name = 'vtwist', min = 0, soft_min=0.1, soft_max=5,max = 10,\
-                 description = "to do",	default =  0)
-
-#Strut
-    struttype= IntProperty(name="struttype", default= 0)
-    struttoggle = BoolProperty(name="struttoggle", default = False )
-    strutimporttoggle= BoolProperty(name="strutimporttoggle", default = False )
-    strutimpmesh= StringProperty(name="strutimpmesh", default = "None")
-    strutwidth= FloatProperty(name="strutwidth", min = -10, soft_min = 5, soft_max = 5, max = 10, default = 1 )
-    swtog= BoolProperty(name="swtog", default = False )
-    strutheight= FloatProperty(name="strutheight", min = -5, soft_min = -1, soft_max = 5, max = 10, default = 1 )
-    shtog= BoolProperty(name="shtog", default = False )
-    strutshrink= FloatProperty(name="strutshrink", min = 0.001, max = 4, default = 1 )
-    sstog= BoolProperty(name="sstog", default = False )
-    stretch= FloatProperty(name="stretch",  min= -4, max = 4, default = 1.0 )
-    lift= FloatProperty(name="lift", min = 0.001, max = 10, default = 0 )
-    smeshname= StringProperty(name="smeshname", default = "defaultstrut")
-
-#Hubs
-    hubtype = BoolProperty(name ="hubtype", description = "not used", default = True )
-    hubtoggle = BoolProperty(name ="hubtoggle", default = False )
-    hubimporttoggle = BoolProperty(name="new import", description = "import a mesh", default = False )
-    hubimpmesh = StringProperty(name="hubimpmesh",\
-                 description = "name of mesh to import",  default = "None")
-    hubwidth = FloatProperty(name="hubwidth", min = 0.01, max = 10,\
-                 default = 1 )
-    hwtog = BoolProperty(name="hwtog", default = False )
-    hubheight = FloatProperty(name="hubheight", min = 0.01, max = 10,\
-                 default = 1 )
-    hhtog = BoolProperty(name="hhtog", default = False )
-    hublength = FloatProperty(name ="hublength", min  = 0.1, max  = 10,\
-                 default  = 1 )
-    hstog= BoolProperty(name="hstog", default = False )
-    hmeshname= StringProperty(name="hmeshname", description = "Name of an existing mesh needed!", default = "None")
-
-    name_list = ['facetype_menu','facetoggle','face_use_imported_object',
-'facewidth','fwtog','faceheight','fhtog',
-'face_detach','fmeshname','geodesic_types','import_mesh_name',
-'base_type','orientation','geodesic_class','tri_hex_star',
-'spherical_flat','use_imported_mesh','cyxres','cyyres',
-'cyxsz','cyysz','cyxell','cygap',
-'cygphase','paxres','payres','paxsz',
-'paysz','paxell','pagap','pagphase',
-'ures','vres','urad','vrad',
-'uellipse','vellipse','upart','vpart',
-'ugap','vgap','uphase','vphase',
-'uexp','vexp','usuper','vsuper',
-'utwist','vtwist','bures','bvres',
-'burad','bupart','bvpart','buphase',
-'bvphase','buellipse','bvellipse','grxres',
-'gryres','grxsz','grysz',
-'cart','frequency','eccentricity','squish',
-'radius','squareness','squarez','baselevel',
-'dual','rotxy','rotz',
-'uact','vact','um','un1',
-'un2','un3','ua','ub',
-'vm','vn1','vn2','vn3',
-'va','vb','uturn','vturn',
-'utwist','vtwist','struttype','struttoggle',
-'strutimporttoggle','strutimpmesh','strutwidth','swtog',
-'strutheight','shtog','strutshrink','sstog',
-'stretch','lift','smeshname','hubtype',
-'hubtoggle','hubimporttoggle','hubimpmesh','hubwidth',
-'hwtog','hubheight','hhtog','hublength',
-'hstog','hmeshname']    
-
-    def write_params(self,filename):
-        file = open(filename, "w", encoding="utf8", newline="\n")
-        fw = file.write
-    #for Faces!
-        for el in self.name_list:
-            fw(el + ",")
-            fw(repr(getattr(self,el)))
-            fw(",\n")
-        file.close()
-
-    def read_file(self,filename):
-        file = open(filename, "r", newline="\n")
-        result = []
-        line = file.readline()
-        while(line):
-            tmp = line.split(",")
-            result.append(eval(tmp[1]))
-            line = file.readline()
-        return result
-    
-
-    def draw(self,context):
-        sce = context.scene
-        layout = self.layout
-        row = layout.row()
-        row.prop(self,"save_parameters")
-        row.prop(self,"load_parameters")
-        col = layout.column()
-        col.label(" ")
-        col.prop(self,"mainpages")
-        which_mainpages = self.mainpages
-        if which_mainpages == 'Main':
-            col = layout.column()
-            col.prop(self,"geodesic_types")
-            tmp = self.geodesic_types
-            if tmp == "Geodesic":
-                col.label(text="Geodesic Object Types:")
-                col.prop(self, "geodesic_class")                
-                col.prop(self, "base_type")
-                col.prop(self, "orientation")
-                col.prop(self, "tri_hex_star")
-                col.prop(self, "spherical_flat")
-                col.label("Geodesic Object Parameters:")
-                row = layout.row()
-                row.prop(self,"frequency")
-                row = layout.row()
-                row.prop(self,"radius")
-                row = layout.row()
-                row.prop(self,"eccentricity")
-                row = layout.row()
-                row.prop(self,"squish")
-                row = layout.row()
-                row.prop(self,"squareness")
-                row = layout.row()
-                row.prop(self,"squarez")
-                row = layout.row()
-                row.prop(self,"rotxy")
-                row = layout.row()
-                row.prop(self,"rotz")
-                row = layout.row()
-                row.prop(self,"dual")
-            elif tmp == 'Torus':
-                col.label("Torus Parameters")
-                row = layout.row()
-                row.prop(self, "ures")
-                row = layout.row()
-                row.prop(self, "vres")
-                row = layout.row()
-                row.prop(self, "urad")
-                row = layout.row()
-                row.prop(self, "vrad")
-                row = layout.row()
-                row.prop(self, "uellipse")
-                row = layout.row()
-                row.prop(self, "vellipse")
-                row = layout.row()
-                row.prop(self, "upart")
-                row = layout.row()
-                row.prop(self, "vpart")
-                row = layout.row()
-                row.prop(self, "ugap")
-                row.prop(self, "vgap")
-                row = layout.row()
-                row.prop(self, "uphase")
-                row.prop(self, "vphase")
-                row = layout.row()
-                row.prop(self, "uexp")
-                row.prop(self, "vexp")
-                row = layout.row()
-                row.prop(self, "usuper")
-                row.prop(self, "vsuper")
-                row = layout.row()
-                row.prop(self, "vgap")
-                row = layout.row()
-            elif tmp == 'Sphere':
-                col.label("Sphere Parameters")
-                row = layout.row()
-                row.prop(self,"bures")
-                row = layout.row()
-                row.prop(self,"bvres")
-                row = layout.row()
-                row.prop(self,"burad")
-                row = layout.row()                
-                row.prop(self,"bupart")
-                row = layout.row()
-                row.prop(self,"buphase")
-                row = layout.row()
-                row.prop(self,"bvpart")
-                row = layout.row()
-                row.prop(self,"bvphase")
-                row = layout.row()
-                row.prop(self,"buellipse")
-                row = layout.row()
-                row.prop(self,"bvellipse")
-            elif tmp == 'Parabola':
-                col.label("Parabola Parameters")
-                row = layout.row()
-                row.prop(self, "paxres")
-                row = layout.row()
-                row.prop(self, "payres")
-                row = layout.row()
-                row.prop(self, "paxsz")
-                row = layout.row()
-                row.prop(self, "paysz")
-                row = layout.row()
-                row.prop(self, "paxell")
-                row = layout.row()
-                row.prop(self, "pagap")
-                row = layout.row()
-                row.prop(self, "pagphase")
-            elif tmp == 'Cylinder':
-                col.label("Cylinder Parameters")
-                col.prop(self, "cyxres")
-                col.prop(self, "cyyres")
-                col.prop(self, "cyxsz")
-                col.prop(self, "cyysz")
-                col.prop(self, "cyxell")
-                col.prop(self, "cygap")
-                col.prop(self, "cygphase")
-            elif tmp == 'Grid':
-                col.label("Grid Parameters")
-                row = layout.row()
-                row.prop(self, "grxres")
-                row = layout.row()
-                row.prop(self, "gryres")
-                row = layout.row()
-                row.prop(self, "grxsz")
-                row = layout.row()
-                row.prop(self, "grysz")
-            elif tmp == 'Import your mesh':
-                col.prop(self,"use_imported_mesh")
-                col.prop(self, "import_mesh_name")
-#######superform parameters only where possible
-            row = layout.row()
-            row.prop(self,"uact")
-            row = layout.row()
-            row.prop(self,"vact")                
-            row = layout.row()
-            if not(tmp == 'Import your mesh'):
-                if (self.uact == False) and (self.vact == False):
-                    row.label("no checkbox active!")
-                else:
-                    row.label("Superform Parameters")
-                if self.uact:
-                    row = layout.row()
-                    row.prop(self,"um")
-                    row = layout.row()
-                    row.prop(self,"un1")
-                    row = layout.row()
-                    row.prop(self,"un2")
-                    row = layout.row()
-                    row.prop(self,"un3")
-                    row = layout.row()
-                    row.prop(self,"ua")
-                    row = layout.row()
-                    row.prop(self,"ub")
-                    row = layout.row()
-                    row.prop(self,"uturn")
-                    row = layout.row()
-                    row.prop(self,"utwist")
-                if self.vact:
-                    row = layout.row()
-                    row.prop(self,"vm")
-                    row = layout.row()
-                    row.prop(self,"vn1")
-                    row = layout.row()
-                    row.prop(self,"vn2")
-                    row = layout.row()
-                    row.prop(self,"vn3")
-                    row = layout.row()
-                    row.prop(self,"va")
-                    row = layout.row()
-                    row.prop(self,"vb")
-                    row = layout.row()
-                    row.prop(self,"vturn")
-                    row = layout.row()
-                    row.prop(self,"vtwist")                
-########einde superfo
-        elif  which_mainpages == "Hubs":
-            row = layout.row()
-            row.prop(self, "hubtoggle")
-#PKHG_NOT_USDED_YET_24-11            row.prop(self, "hubtype")
-            row = layout.row()            
-#25-11 not needed            row.prop(self, "hubimporttoggle")
-            row = layout.row()
-            if self.hubimpmesh == "None":
-                row = layout.row()
-                row.label("name of a hub to use")
-                row = layout.row()
-            row.prop(self, "hubimpmesh")
-            row = layout.row()
-            if self.hmeshname == "None":
-                row = layout.row()
-                row.label("name of mesh to be filled in!")
-                row = layout.row()
-            row.prop(self,"hmeshname")
-            row = layout.row()
-            row.prop(self, "hwtog")
-            if self.hwtog:
-                row.prop(self, "hubwidth")
-            row = layout.row()
-            row.prop(self, "hhtog")
-            if self.hhtog:
-                row.prop(self, "hubheight")
-            row = layout.row()
-            row.prop(self, "hublength")                
-        elif which_mainpages == "Struts":
-            row = layout.row()
-#            row.prop(self, "struttype")
-            row.prop(self, "struttoggle")
-#            row = layout.row()            
-#            row.prop(self, "strutimporttoggle")
-            row = layout.row()            
-            row.prop(self, "strutimpmesh")
-            row = layout.row()
-            row.prop(self, "swtog")
-            if self.swtog:
-                row.prop(self, "strutwidth")
-            row = layout.row()
-            row.prop(self, "shtog")
-            if self.shtog:
-                row.prop(self, "strutheight")
-            row = layout.row()
-            row.prop(self, "sstog")
-            if self.sstog:
-               row.prop(self, "strutshrink")
-            row = layout.row()               
-            row.prop(self, "stretch")
-            row = layout.row()            
-            row.prop(self, "lift")
-            row = layout.row()            
-            row.prop(self, "smeshname")
-        elif which_mainpages == "Faces":
-            row = layout.row()
-            row.prop(self,"facetoggle")
-            row = layout.row()
-            row.prop(self,"face_use_imported_object")
-            row = layout.row()
-            row.prop(self,"facetype_menu")
-            row = layout.row()
-            row.prop(self,"fwtog")
-            if self.fwtog:
-                row.prop(self,"facewidth")
-            row = layout.row()
-            row.prop(self,"fhtog")
-            if self.fhtog:
-                row.prop(self,"faceheight")
-            row = layout.row()
-            row.prop(self,"face_detach")
-            row = layout.row()
-            row.prop(self,"fmeshname")
-            row = layout.row()
-        
-        #help menu GUI
-        elif which_mainpages == "Help":
-            import textwrap
-
-            # a function that allows for multiple labels with text that wraps
-            # you can allow the user to set where the text wraps with the 
-            # text_width parameter
-            # other parameters are ui : here you usually pass layout
-            # text: is a list with each index representing a line of text
-            
-            def multi_label(text, ui,text_width=120):
-                for x in range(0,len(text)):
-                    el = textwrap.wrap(text[x], width = text_width )
-            
-                    for y in range(0,len(el)):
-                        ui.label(text=el[y])
-
-            box = layout.box() 
-            help_text = ["NEW! ", 
-                "New facility: save or load (nearly all) parameters ",
-                 "A file GD_0.GD will be used, living in: ",
-                 "geodesic_domes/tmp ",
-                 "and if possible two backups "
-                 "--------",
-                 "After loading you have to change a ",
-                 "parameter back and forth "
-                 "to see it"]
-            text_width = self.gd_help_text_width
-            box.prop(self,"gd_help_text_width",slider=True)
-            multi_label(help_text,box, text_width)
-
-    def execute(self, context):
-        global last_generated_object, last_imported_mesh, basegeodesic, imported_hubmesh_to_use 
-        #default superformparam = [3, 10, 10, 10, 1, 1, 4, 10, 10, 10, 1, 1, 0, 0, 0.0, 0.0, 0, 0]]
-        superformparam = [self.um, self.un1, self.un2, self.un3, self.ua,\
-                          self.ub, self.vm, self.vn1, self.vn2, self.vn3,\
-                          self.va, self.vb, self.uact, self.vact,\
-                          self.uturn*pi, self.vturn*pi, \
-                          self.utwist, self.vtwist]
-        context.scene.error_message = "" 
-        if self.mainpages == 'Main':
-            if self.geodesic_types == "Geodesic":
-                tmp_fs = self.tri_hex_star
-                faceshape = 0 # tri!
-                if tmp_fs == "hex":
-                    faceshape = 1
-                elif tmp_fs == "star":
-                    faceshape = 2
-                tmp_cl = self.geodesic_class
-                klass = 0
-                if tmp_cl == "Class 2":
-                    klass = 1
-                shape = 0 
-                parameters = [self.frequency, self.eccentricity, self.squish,\
-                          self.radius, self.squareness, self.squarez, 0,\
-                          shape, self.baselevel, faceshape, self.dual,\
-                          self.rotxy, self.rotz, klass, superformparam]               
-                basegeodesic =  creategeo(self.base_type,self.orientation,parameters)
-                basegeodesic.makegeodesic()
-                basegeodesic.connectivity()
-                mesh = vefm_259.mesh()                
-                vefm_259.finalfill(basegeodesic,mesh) #always! for hexifiy etc. necessarry!!!                     
-                vefm_259.vefm_add_object(mesh)
-                last_generated_object = context.active_object
-                last_generated_object.location  = (0,0,0)
-                context.scene.objects.active = last_generated_object            
-            elif self.geodesic_types == 'Grid':
-                basegeodesic = forms_259.grid(self.grxres,self.gryres,\
-                       self.grxsz,self.grysz,1.0,1.0,0,0,0,\
-                                      0,1.0,1.0,superformparam)
-                vefm_259.vefm_add_object(basegeodesic)
-                bpy.data.objects[-1].location = (0,0,0)
-            elif self.geodesic_types == "Cylinder":
-                basegeodesic = forms_259.cylinder(self.cyxres, self.cyyres, \
-                                   self.cyxsz, self.cyysz, self.cygap, \
-                                   1.0, self.cygphase, 0, 0, 0, self.cyxell,\
-                                   1.0, superformparam)
-                vefm_259.vefm_add_object(basegeodesic)
-                bpy.data.objects[-1].location = (0,0,0)                
-                
-            elif self.geodesic_types == "Parabola":
-                basegeodesic=forms_259.parabola(self.paxres, self.payres,\
-                    self.paxsz, self.paysz, self.pagap,1.0, self.pagphase,\
-                    0,0,0, self.paxell,1.0,superformparam)
-                vefm_259.vefm_add_object(basegeodesic)
-                bpy.data.objects[-1].location = (0,0,0)                
-            elif self.geodesic_types == "Torus":
-                basegeodesic = forms_259.torus(self.ures, self.vres,\
-                       self.vrad, self.urad, self.upart, self.vpart,\
-                       self.ugap, self.vgap,0,0, self.uellipse,\
-                       self.vellipse, superformparam)
-                vefm_259.vefm_add_object(basegeodesic)
-                bpy.data.objects[-1].location = (0,0,0)
-            elif self.geodesic_types == "Sphere":
-                basegeodesic=forms_259.sphere(self.bures, self.bvres,\
-                        self.burad,1.0, self.bupart, self.bvpart,\
-                        self.buphase, self.bvphase,0,0, self.buellipse,\
-                        self.bvellipse,superformparam)	
-
-                vefm_259.vefm_add_object(basegeodesic)
-                bpy.data.objects[-1].location = (0,0,0)                
-            elif self.geodesic_types == "Import your mesh":
-                obj_name = self.import_mesh_name
-                if obj_name == "None":
-                    message = "fill in a name \nof an existing mesh\nto be imported"
-                    context.scene.error_message = message
-                    self.report({'INFO'}, message)
-                    print("***INFO*** you have to fill in the name of an existing mesh")
-                else:
-#                    obj_in_scene = context.objects
-                    names = [el.name for el in context.scene.objects]
-                    if obj_name in names and context.scene.objects[obj_name].type == "MESH":
-                        obj = context.scene.objects[obj_name]
-#                        if obj.type == "MESH":                        
-                        your_obj = vefm_259.importmesh(obj.name,False)
-                        last_imported_mesh = your_obj
-                        vefm_259.vefm_add_object(your_obj)
-                        last_generated_object = bpy.context.active_object
-                        last_generated_object.name ="Imported mesh"
-                        bpy.context.active_object.location = (0,0,0)
-                    else:
-                        message = obj_name +" does not exist \nor is not a MESH"
-                        context.scene.error_message = message                
-                        bpy.ops.object.dialog_operator('INVOKE_DEFAULT')
-                        self.report({'ERROR'}, message)
-                        print("***ERROR***" + obj_name +" does not exist or is not a MESH")
-        elif self.mainpages == "Hubs":
-            hubtype = self.hubtype
-            hubtoggle =  self.hubtoggle
-            hubimporttoggle = self.hubimporttoggle
-            hubimpmesh = self.hubimpmesh
-            hubwidth = self.hubwidth
-            hwtog = self.hwtog
-            hubheight = self.hubheight
-            hhtog = self.hhtog
-            hublength = self.hublength
-            hstog =  self.hstog
-            hmeshname=  self.hmeshname
-#PKHG_TODO_27-11 better info!??
-            if not (hmeshname == "None") and not (hubimpmesh == "None") and  hubtoggle:                
-                try:                    
-                    hub_obj = vefm_259.importmesh(hmeshname,0)
-                    hub = vefm_259.hub(hub_obj, True,\
-                            hubwidth, hubheight, hublength,\
-                              hwtog, hhtog, hstog, hubimpmesh)
-                    mesh = vefm_259.mesh("test")
-                    vefm_259.finalfill(hub,mesh)
-                    vefm_259.vefm_add_object(mesh)
-                    bpy.data.objects[-1].location = (0,0,0)
-                except:
-                    message = "***ERROR*** \neither no mesh for hub\nor " + hmeshname +  " available"                    
-                    context.scene.error_message = message
-                    bpy.ops.object.dialog_operator('INVOKE_DEFAULT')
-                    print(message)                
-            else:
-                message = "***INFO***\nuse the hub toggle!"
-                context.scene.error_message = message
-                print("\n***INFO*** use the hub toggle!")
-        elif self.mainpages == "Struts":
-            struttype = self.struttype
-            struttoggle = self.struttoggle
-            strutimporttoggle = self.strutimporttoggle
-            strutimpmesh = self.strutimpmesh
-            strutwidth = self.strutwidth
-            swtog = self.swtog
-            strutheight = self.strutheight
-            shtog = self.shtog
-            strutshrink = self.strutshrink
-            sstog = self.sstog
-            stretch = self.stretch
-            lift = self.lift
-            smeshname = self.smeshname
-            if not (strutimpmesh == "None") and struttoggle:
-                names = [el.name for el in context.scene.objects]
-                if strutimpmesh in names and context.scene.objects[strutimpmesh].type == "MESH":
-                    strut = vefm_259.strut(basegeodesic, struttype,strutwidth,strutheight,stretch,swtog,shtog,swtog,strutimpmesh,sstog,lift)
-                    strutmesh = vefm_259.mesh()
-                    vefm_259.finalfill(strut,strutmesh)
-                    vefm_259.vefm_add_object(strutmesh)
-                    last_generated_object = context.active_object
-                    last_generated_object.name = smeshname
-                    last_generated_object.location  = (0,0,0)
-                else:
-                    message = "***ERROR***\n" + strutimpmesh + "\nis not a MESH"
-                    context.scene.error_message = message
-                    bpy.ops.object.dialog_operator('INVOKE_DEFAULT')
-                    print("***ERROR*** strut obj is not a MESH")
-            else:
-                vefm_259.vefm_add_object(basegeodesic)
-        elif self.mainpages == "Faces":
-            if self.facetoggle:
-                faceparams=[[self.face_detach,0,[[0.5,0.0]]], #0 strip
-                            [self.face_detach,0,[[0.0,0.5]]], #1 vertical
-                            [self.face_detach,0,[[0.5,0.5]]], #2 slanted
-                            [self.face_detach,1,[[0.25,0.25],[0.5,0.5]]], #3 closed point
-                            [self.face_detach,1,[[0.1,0.03],[0.33,0.06],[0.0,0.1]]], #4 pillow
-                            [self.face_detach,2,[[0.0,0.5]]], #5 closed vertical
-                            [self.face_detach,2,[[0.0,0.25],[0.25,0.25],[0.25,0.5]]], #6 stepped
-                            [self.face_detach,1,[[0.2,0.1],[0.4,0.2],[0.0,1.0]]], #7 spikes
-                            [self.face_detach,3,[[0.25,0.0],[0.25,0.5],[0.0,0.5]]], #8 boxed 
-                            [self.face_detach,3,[[0.25,0.5],[0.5,0.0],[0.25,-0.5]]], #9 diamond
-                            [self.face_detach,4,[[0.5,0.0],[0.5,0.5],[0.0,0.5]]],] #10 bar
-                facedata = faceparams[int(self.facetype_menu)]
-                if not self.face_use_imported_object:
-                    faceobject = vefm_259.facetype(basegeodesic,facedata,self.facewidth,self.faceheight,self.fwtog)
-                else:
-                    if last_imported_mesh: 
-                        faceobject = vefm_259.facetype(last_imported_mesh, facedata,self.facewidth,self.faceheight,self.fwtog)
-                    else:
-                        message = "***ERROR***\nno imported message available\n" + "last geodesic used"
-                        self.face_use_imported_object = False
-                        context.scene.error_message = message
-                        bpy.ops.object.dialog_operator('INVOKE_DEFAULT')
-                        print("\n***ERROR*** no imported mesh available")
-                        print("last geodesic used!")
-                        faceobject = vefm_259.facetype(basegeodesic,facedata,\
-                                     self.facewidth,self.faceheight,self.fwtog)
-                facemesh = vefm_259.mesh()
-                finalfill(faceobject,facemesh)
-
-                vefm_259.vefm_add_object(facemesh)
-                obj = bpy.data.objects[-1]
-                obj.name = self.fmeshname
-                obj.location = (0,0,0)
-#PKHG save or load (nearly) all parameters                
-        if self.save_parameters:
-            self.save_parameters = False
-            try:
-                print("DBG L884")
-                message = ""
-                scriptpath = bpy.utils.script_paths()[0]
-                sep = os.path.sep
-                tmpdir = os.path.join(scriptpath,"addons", "geodesic_domes" , "tmp")
-#scriptpath + sep + "addons" + sep + "geodesic_domes" + sep + "tmp"
-                print("tmpdirL890 = ",tmpdir)
-                if not os.path.isdir(tmpdir):
-                    message += "***ERROR***\n" + tmpdir + "\nnot (yet) available\n"
-                    print(message)
-                else:
-                    filename = tmpdir + sep + "GD_0.GD"
-                    filename_ren = tmpdir + sep + "GD_0.GD.bak"
-                    filename_ren2 = tmpdir + sep + "GD_0.GD.2bak"
-                    if os.path.isfile(filename_ren2):
-                        try:
-                            os.remove(filename_ren2)
-                            message = "***Info***\nGD_0.GD.2bak removed\n"
-                        except:
-                            message = "***ERROR***\n,GD_0.GD.2bak could not be removed\n"
-                        print(message)
-                    if os.path.isfile(filename_ren):
-                        try:
-                            os.rename(filename_ren,filename_ren2)
-                            message += "***INFO***\nGD_0.GD.bak renamed into GD_0.GD.2bak\n"
-                        except:
-                            message += "***Info***\nrenaming GD_0.GD.bak not possible\n"
-                    if os.path.isfile(filename):
-                        try:
-                            os.rename(filename,filename_ren)
-                            message += "***INFO***\nGD_0.GD renamed into GD_0.GD.bak\n"
-                        except:
-                            message += "***ERROR***\ncreation of GD_0.GD.bak not possible\n"
-                    try:
-                        print("DBG L921")
-                        self.write_params(filename)
-                        message += "***OK***\nparameters saved in\n" + filename
-                        print(message)
-                    except:
-                        message = "***ERRROR***\n" + "writing " + filename + "\nnot possible"
-                        print(message)                 
-            except:
-                
-                message += "***ERROR***\n Contakt PKHG, something wrong happened"
-                print(message)
-                
-            context.scene.error_message = message
-            bpy.ops.object.dialog_operator('INVOKE_DEFAULT')
-
-        if self.load_parameters:
-            self.load_parameters = False
-            try:
-                scriptpath = bpy.utils.script_paths()[0]
-                sep = os.path.sep
-                tmpdir = os.path.join(scriptpath,"addons", "geodesic_domes" , "tmp")
-#scriptpath + sep + "addons" + sep + "geodesic_domes" + sep + "tmp"                              
-                if not os.path.isdir(tmpdir):
-                    message = "***ERROR***\n" + tmpdir + "\nnot available"  
-                    print(message)
-                filename = tmpdir + sep + "GD_0.GD"
-#        self.read_file(filename)
-                try:
-                    res = self.read_file(filename)
-                    for i,el in enumerate(self.name_list):
-                        setattr(self,el,res[i])
-                        
-                    message = "***OK***\nparameters read from\n" + filename
-                    print(message)
-                    
-                except:
-                    message = "***ERRROR***\n" + "writing " + filename + "\nnot possible"
-                #bpy.context.scene.instant_filenames = filenames
-                
-            except:
-                message = "***ERROR***\n Contakt PKHG,\nsomething went wrong reading params happened"
-            context.scene.error_message = message
-            bpy.ops.object.dialog_operator('INVOKE_DEFAULT')
-        return {'FINISHED'}
-    
-    def invoke(self, context, event):
-        global basegeodesic
-        bpy.ops.view3d.snap_cursor_to_center()
-        tmp = context.scene.geodesic_not_yet_called
-        if tmp:            
-            context.scene.geodesic_not_yet_called = False
-        self.execute(context)
-        return {'FINISHED'}
-
-def creategeo(polytype,orientation,parameters):
-    geo = None
-    if polytype == "Tetrahedron":
-        if orientation == "PointUp":
-            geo = geodesic_classes_259.tetrahedron(parameters)
-        elif orientation == "EdgeUp":
-            geo=geodesic_classes_259.tetraedge(parameters)
-        elif orientation == "FaceUp":
-            geo=geodesic_classes_259.tetraface(parameters)
-    elif polytype == "Octahedron": 
-        if orientation == "PointUp":
-            geo=geodesic_classes_259.octahedron(parameters)
-        elif orientation == "EdgeUp":
-            geo=geodesic_classes_259.octaedge(parameters)
-        elif orientation == "FaceUp":
-            geo=geodesic_classes_259.octaface(parameters)
-    elif polytype == "Icosahedron":
-        if orientation == "PointUp":
-            geo=geodesic_classes_259.icosahedron(parameters)
-        elif orientation == "EdgeUp":
-            geo=geodesic_classes_259.icoedge(parameters)
-        elif orientation == "FaceUp":
-            geo=geodesic_classes_259.icoface(parameters)
-    return geo
-    
-basegeodesic,fmeshname,smeshname,hmeshname,outputmeshname,strutimpmesh,hubimpmesh = [None]*7
-
-def finalfill(source,target):
-    count=0
-    for point in source.verts:
-        newvert = vefm_259.vertex(point.vector)
-        target.verts.append(newvert)
-        point.index = count
-        count  += 1 
-    for facey in source.faces:
-        row=len(facey.vertices)
-        if row >= 5:
-            newvert = vefm_259.average(facey.vertices).centroid()
-            centre = vefm_259.vertex(newvert.vector)
-            target.verts.append(centre)
-            for i in range(row):
-                if i == row - 1:
-                    a = target.verts[facey.vertices[-1].index]
-                    b = target.verts[facey.vertices[0].index]
-                else:
-                    a = target.verts[facey.vertices[i].index]
-                    b = target.verts[facey.vertices[i+1].index]
-                c = centre
-                f = [a,b,c]
-                target.faces.append(f)
-        else:
-            f = []
-            for j in range(len(facey.vertices)):
-
-                a = facey.vertices[j]
-                f.append(target.verts[a.index])
-            target.faces.append(f)
-        
-###for error messages         
-class DialogOperator(bpy.types.Operator):
-    bl_idname = "object.dialog_operator"
-    bl_label = "INFO"
-
-    def draw(self,context):
-        layout = self.layout
-        message = context.scene.error_message
-        col = layout.column()
-        tmp = message.split("\n")
-        for el in tmp:
-            col.label(el)
-        
-    def execute(self, context):
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.window_manager
-        return wm.invoke_props_dialog(self)
-            
-
-######### register all
-def register():
-    bpy.utils.register_module(__name__)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-if __name__ == "__main__":
-    register()
-
diff --git a/release/scripts/addons_contrib/geodesic_domes/tmp/GD_0.GD b/release/scripts/addons_contrib/geodesic_domes/tmp/GD_0.GD
deleted file mode 100644
index cdf5422..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/tmp/GD_0.GD
+++ /dev/null
@@ -1,115 +0,0 @@
-facetype_menu,'3',
-facetoggle,True,
-face_use_imported_object,False,
-facewidth,0.26006004214286804,
-fwtog,True,
-faceheight,1.0,
-fhtog,False,
-face_detach,False,
-fmeshname,'defaultface',
-geodesic_types,'Geodesic',
-import_mesh_name,'None',
-base_type,'Octahedron',
-orientation,'EdgeUp',
-geodesic_class,'Class 1',
-tri_hex_star,'tri',
-spherical_flat,'spherical',
-use_imported_mesh,False,
-cyxres,5,
-cyyres,5,
-cyxsz,1.0,
-cyysz,1.0,
-cyxell,1.0,
-cygap,1.0,
-cygphase,0.0,
-paxres,5,
-payres,5,
-paxsz,0.30000001192092896,
-paysz,1.0,
-paxell,1.0,
-pagap,1.0,
-pagphase,0.0,
-ures,8,
-vres,8,
-urad,1.0,
-vrad,0.25,
-uellipse,1.0,
-vellipse,1.0,
-upart,1.0,
-vpart,1.0,
-ugap,0.0,
-vgap,0.0,
-uphase,0.0,
-vphase,0.0,
-uexp,0.0,
-vexp,0.0,
-usuper,2.0,
-vsuper,2.0,
-utwist,0.0,
-vtwist,0.0,
-bures,8,
-bvres,8,
-burad,1.0,
-bupart,1.0,
-bvpart,1.0,
-buphase,0.0,
-bvphase,0.0,
-buellipse,1.0,
-bvellipse,1.0,
-grxres,5,
-gryres,2,
-grxsz,2.0,
-grysz,1.0,
-cart,0,
-frequency,2,
-eccentricity,1.0,
-squish,1.0,
-radius,2.8912599086761475,
-squareness,2.0,
-squarez,2.0,
-baselevel,5,
-dual,False,
-rotxy,0.0,
-rotz,0.0,
-uact,False,
-vact,False,
-um,3.0,
-un1,1.0,
-un2,1.0,
-un3,1.0,
-ua,1.0,
-ub,4.0,
-vm,1.0,
-vn1,1.0,
-vn2,1.0,
-vn3,1.0,
-va,1.0,
-vb,1.0,
-uturn,0.0,
-vturn,0.0,
-utwist,0.0,
-vtwist,0.0,
-struttype,0,
-struttoggle,True,
-strutimporttoggle,False,
-strutimpmesh,'GD_mesh',
-strutwidth,1.0,
-swtog,False,
-strutheight,1.0,
-shtog,False,
-strutshrink,1.0,
-sstog,False,
-stretch,1.0,
-lift,0.0010000000474974513,
-smeshname,'defaultstrut',
-hubtype,True,
-hubtoggle,False,
-hubimporttoggle,False,
-hubimpmesh,'None',
-hubwidth,1.0,
-hwtog,False,
-hubheight,1.0,
-hhtog,False,
-hublength,1.0,
-hstog,False,
-hmeshname,'None',
diff --git a/release/scripts/addons_contrib/geodesic_domes/tmp/GD_start.GD b/release/scripts/addons_contrib/geodesic_domes/tmp/GD_start.GD
deleted file mode 100644
index a75eafb..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/tmp/GD_start.GD
+++ /dev/null
@@ -1,115 +0,0 @@
-facetype_menu,'0',
-facetoggle,False,
-face_use_imported_object,False,
-facewidth,0.5,
-fwtog,False,
-faceheight,1.0,
-fhtog,False,
-face_detach,False,
-fmeshname,'defaultface',
-geodesic_types,'Geodesic',
-import_mesh_name,'None',
-base_type,'Tetrahedron',
-orientation,'PointUp',
-geodesic_class,'Class 1',
-tri_hex_star,'tri',
-spherical_flat,'spherical',
-use_imported_mesh,False,
-cyxres,5,
-cyyres,5,
-cyxsz,1.0,
-cyysz,1.0,
-cyxell,1.0,
-cygap,1.0,
-cygphase,0.0,
-paxres,5,
-payres,5,
-paxsz,0.30000001192092896,
-paysz,1.0,
-paxell,1.0,
-pagap,1.0,
-pagphase,0.0,
-ures,8,
-vres,8,
-urad,1.0,
-vrad,0.25,
-uellipse,1.0,
-vellipse,1.0,
-upart,1.0,
-vpart,1.0,
-ugap,0.0,
-vgap,0.0,
-uphase,0.0,
-vphase,0.0,
-uexp,0.0,
-vexp,0.0,
-usuper,2.0,
-vsuper,2.0,
-utwist,0.0,
-vtwist,0.0,
-bures,8,
-bvres,8,
-burad,1.0,
-bupart,1.0,
-bvpart,1.0,
-buphase,0.0,
-bvphase,0.0,
-buellipse,1.0,
-bvellipse,1.0,
-grxres,5,
-gryres,2,
-grxsz,2.0,
-grysz,1.0,
-cart,0,
-frequency,1,
-eccentricity,1.0,
-squish,1.0,
-radius,1.0,
-squareness,2.0,
-squarez,2.0,
-baselevel,5,
-dual,False,
-rotxy,0.0,
-rotz,0.0,
-uact,False,
-vact,False,
-um,3.0,
-un1,1.0,
-un2,1.0,
-un3,1.0,
-ua,1.0,
-ub,4.0,
-vm,1.0,
-vn1,1.0,
-vn2,1.0,
-vn3,1.0,
-va,1.0,
-vb,1.0,
-uturn,0.0,
-vturn,0.0,
-utwist,0.0,
-vtwist,0.0,
-struttype,0,
-struttoggle,False,
-strutimporttoggle,False,
-strutimpmesh,'None',
-strutwidth,1.0,
-swtog,False,
-strutheight,1.0,
-shtog,False,
-strutshrink,1.0,
-sstog,False,
-stretch,1.0,
-lift,0.0,
-smeshname,'defaultstrut',
-hubtype,True,
-hubtoggle,False,
-hubimporttoggle,False,
-hubimpmesh,'None',
-hubwidth,1.0,
-hwtog,False,
-hubheight,1.0,
-hhtog,False,
-hublength,1.0,
-hstog,False,
-hmeshname,'None',
diff --git a/release/scripts/addons_contrib/geodesic_domes/vefm_259.py b/release/scripts/addons_contrib/geodesic_domes/vefm_259.py
deleted file mode 100644
index 986f97b..0000000
--- a/release/scripts/addons_contrib/geodesic_domes/vefm_259.py
+++ /dev/null
@@ -1,1218 +0,0 @@
-# vert class and overloading experiments
-import bpy
-import math
-from math import sqrt,acos,pi,sin,cos,atan,tan,fabs
-from mathutils import Vector
-
-#dbg = True
-sgn = lambda x : (x>0) - (x<0) #missing signum functin in Python
-try:
-    breakpoint = bpy.types.bp.bp
-except:
-    pass    
-
-from bpy_extras.object_utils import AddObjectHelper, object_data_add
-
-from collections import Counter
-
-'''PKHG not needed?
-def find_twice_vert(l1,l2):
-    tmp = [el for el in l1]
-    tmp.extend(l2)
-    tt = Counter(tmp)
-    result = max(tt.keys(),key = lambda k:tt[k])
-    print("twice give", result)
-    return result
-'''
-
-def vefm_add_object(selfobj):
-    for i in range(len(selfobj.verts)):
-        selfobj.verts[i].index = i
-    v = [el.vector for el in selfobj.verts]    
-#    e = [[edge.a.index,edge.b.index] for edge in selfobj.edges]
-    e = []
-    if type(selfobj.faces[0]) == type([]):
-#    print("\n=========== selfobj.faces[0]", selfobj.faces[0],type(selfobj.faces[0]))
-#PKHG should be a list of vertices, which have an index
-        f =  [[v.index for v in  face] for face in selfobj.faces]
-    else:
-        f =  [[v.index for v in  face.vertices] for face in selfobj.faces]
-#PKHG_DBG_25-11    print("dbg 25-11 f list =",f)
-#PKHG_DBG_25-11    print("dgb 25-11 v list +",v)
-    m = bpy.data.meshes.new(name= selfobj.name)
-    m.from_pydata(v, e, f )
-    # useful for development when the mesh may be invalid.
-#PKHG not needed, as ideasman_42 says    m.validate(verbose = False)
-    object_data_add(bpy.context, m, operator = None)
-#???ERROR PKHG in AddSelf    setMaterial(bpy.context.active_object,pkhg_red_color)
-
-#extra test phase
-
-
-
-
-class vertex:
-
-    def __init__(self,vec=(0,0,0)): #default x = 0,y = 0,z = 0):        
-        self.vector  = Vector(vec)
-        self.length = self.vector.length
-        self.index = 0
-        self.normal = 0
-        self.edges = []
-        self.faces = []
-        self.boundary = 0
-
-    def findlength(self):
-         self.length = self.vector.length
-
-    def normalize(self):
-        self.findlength()
-        if self.length > 0:
-            tmp = 1.0/self.length
-            self.vector  =  tmp * self.vector 
-#            self.x = self.vector[0] #(1.0/self.length)
-#            self.y = self.vector[1] #(1.0/self.length)
-#            self.z = self.vector[2] #(1.0/self.length)
-            self.length = 1.0
-
-    def findnormal(self):
-        target = []
-        if self.faces[:] == []:
-            print("vefm vertex L81 pkhg:*****ERROR**** findnormal has no faces")
-            return
-        for currentface in self.faces:
-            target.append(currentface.normal)
-        self.normal = average(target).centroid()
-        self.normal.findlength()
-        if self.length == 0:
-            print("******ERROR*** length zero in findnormal, j = (0,1,0) replcaced")
-            self.normal = vertex((0,1,0))
-        self.normal.normalize()
-
-    def clockwise(self): #PKHG self is a vertex
-        if self.boundary:
-            start = self.boundarystart() #???PKHG TODO error
-        else:
-            start = self.faces[0]
-#PKHG TODO do understand 21-11 solves starify of a normal tetrahedron
-#        start = self.faces[0]     #PKHG TODO see error above!
-#        start.docorners() #PKHG???? 
-        self.tempedges = []
-        self.tempfaces = []
-        for i in range(len(self.edges)):
-            #print("\n----------------------voor breakpunt pkhg in clockwise")
-            #breakpoint(locals(), self.index == 0)
-            self.tempfaces.append(start)
-            for corner in start.corners:
-                if corner[0] is not self:
-                    pass
-                elif corner[0] is self:
-                    self.tempedges.append(corner[1])
-                    nextedge = corner[2]
-            for facey in nextedge.faces:
-                if facey is not start:
-                    start = facey
-                    break
-        self.edges = self.tempedges
-        self.faces = self.tempfaces
-
-    def boundarystart(self):
-        #PKHG not implemented, needed?
-        pass
-
-#???PKHG TODO why are add and sub different? Solved check the two cases used 
-    def __add__(self,other):
-        if isinstance(other, Vector):
-            tmp = self.vector + other
-        else:
-            tmp = self.vector + other.vector
-        return vertex(tmp)
-
-    def __sub__(self,other):
-        if isinstance(other, Vector):
-            tmp = self.vector -  other
-        else:
-            tmp = self.vector - other.vector
-#        tmp = self.vector - other.vector
-        return vertex(tmp)
-
-    def __mul__(self,other):
-        tmp = self.vector * other
-        return vertex(tmp)
-
-    def __truediv__(self,other):
-        denom = 1.0/other
-        tmp = self.vector * denom
-        return (tmp)
-
-    def negative(self):
-        return vertex(-self.vector)
-
-class crossp:
-    ##   Takes in two vertices(vectors), returns the cross product.
-    def __init__(self,v1,v2):
-        self.v1 = v1
-        self.v2 = v2
-#
-    def docrossproduct(self):
-        tmp = self.v1.vector.cross(self.v2.vector)
-        return vertex(tmp)
-
-class average:
-    ##   Takes a list of vertices and returns the average. If two verts are passed, returns midpoint.
-    def __init__(self,vertlist):
-        self.vertlist = vertlist
- 
-    def centroid(self):
-        tmp  =  Vector()
-#PKHG avoid emptylist problems        
-        divisor = 1.0
-        nr_vertices = len(self.vertlist)
-        if nr_vertices > 1:
-            divisor = 1.0 / len(self.vertlist)
-        elif nr_vertices == 0:
-            print("\n***WARNING*** empty list in vefm_259.centroid! L180")
-        for vert in self.vertlist:
-            tmp = tmp + vert.vector
-        tmp = tmp * divisor
-        return vertex(tmp)
-
-class edge:
-    def __init__(self,a = 0,b = 0):
-        self.a = a
-        self.b = b
-        self.index = 0
-        self.normal = 0
-        self.cross = 0
-        self.unit = 0
-        self.faces = []
-        self.vect = 0  #PKHG becomes  b - a
-        self.vectb = 0 #PKHG becomes  a - b
-#        self.length = 0
-        self.boundary = 0
-        self.findvect()
-#        print("vect len before",self.vect.length)
-        self.findlength()
-#        print("vect after",self.vect.length)
-
-    def findvect(self):
-        self.vect = self.b - self.a
-        self.vectb = self.a - self.b
-
-    def findlength(self):
-        self.vect.findlength()
-        self.vectb.length = self.vect.length
-
-    def findnormal(self):
-                
-        if self.boundary:
-            self.normal = self.faces[0].normal    #average([self.a,self.b]).centroid()
-        else:
-            self.normal = average([self.faces[0].normal,self.faces[1].normal]).centroid()
-        self.normal.normalize()
-#     def findother(self,vertindex):
-#
-#         if vertindex==self.a:
-#
-#             return self.b
-#
-#         else:
-#             return self.a
-##        different classes for 3,4,> sides??
-
-class face:
-    def __init__(self,vertices=[]):
-#PKHG ok good for tri's at least        print("\n ========= vefm L226======dbg face vertices = ",vertices)
-        self.vertices = vertices    ##   List of vertex instances.
-        self.edges=[]            ##   Will be filled with the sides of the face.
-        self.boundary = 0        ##   When set will have bool and id of edge concerned.
-        self.normal = 0            ##   Face normal found through cross product.
-        self.corners=[]
-        self.spokes=[]            ##   Vectors of the bisecting angles from each corner to the centre + dotproduct.
-        self.index = 0
- 
- #dotproduct is misleading name, it is the hook between two vectors!
-    def dotproduct(self,v1,v2):
-        v1.findlength()
-        v2.findlength()
-        if v1.length == 0 or v2.length == 0:
-            print("\nPKHG warning, =====vefm_259 dotproduct L245====== at least one zero vector 0 used")         
-            return 0 # pi * 0.25 #PKHT_TEST04nov pi * 0.25  #45 degrees??? #PKHG???TODO
-        dot = v1.vector.dot(v2.vector)
-        costheta = dot / (v1.length * v2.length)
-        tmp = acos(costheta)
-        return tmp
-    
-    def orderedges(self):
-        temp=[]
-        finish = len(self.vertices)
-        for i in range(finish):
-            current = self.vertices[i]
-            if i==finish-1:
-                next = self.vertices[0]
-            else:
-                next = self.vertices[i+1]
-            for edge in face.edges:
-                if edge.a==current and edge.b==next:
-                    face.clockw.append(edge.vect)
-                    face.aclockw.append(edge.vectb)
-                    temp.append(edge)
-                if edge.b==current and edge.a==next:
-                    face.clockw.append(edge.vectb)
-                    face.aclockw.append(edge.vect)
-                    temp.append(edge)
-            for edge in face.edges:
-                if edge.a==current and edge.b==next:
-                    face.clockw.append(edge.vect)
-                    face.aclockw.append(edge.vectb)
-                    temp.append(edge)
-                if edge.b==current and edge.a==next:
-                    face.clockw.append(edge.vectb)
-                    face.aclockw.append(edge.vect)
-                    temp.append(edge)
-            face.vertices = temp
-    
-    
-    def docorners(self):
-        ##   This function identifies and stores the vectors coming from each vertex
-        ##   allowing easier calculation of cross and dot products.
-        finish = len(self.vertices)
-        '''
-        which = None
-        occur1 = None
-        occur2 = None
-        if finish == 3 and len(self.edges) == 2 :    
-            print("\n***ERROR*** only two edges should be three")
-      #      return        
-            occur1 = [self.vertices.index(self.edges[0].a),self.vertices.index(self.edges[0].b)]
-            occur2 = [self.vertices.index(self.edges[1].a),self.vertices.index(self.edges[1].b)]
-            #occur2 = [self.edges[1].a.index, self.edges[1].b.index]
-            twice = find_twice_vert(occur1,occur2)
-            occur1.remove(twice)
-            occur2.remove(twice)
-            #new_edge = edge(self.vertices[occur1[0]],self.vertices[occur2[0]])
-            #self.edges.append(new_edge)
-        '''
-        for i in range(finish):
-            current = self.vertices[i]
-            if i==finish-1:
-                next = self.vertices[0]
-            else:
-                next = self.vertices[i+1]
-            if i==0:
-                previous = self.vertices[-1]
-            else:
-                previous = self.vertices[i-1]
-            corner=[current] #PKHG new for each vertex = current
-            #corner = current
-            rightedge = None
-            leftedge = None
-            teller = -1
-            for edge in self.edges:
-        #        if finish == 3 and len(self.edges) == 2  and i == 2:
-        #            return    
-                teller += 1                                                        
-                currentinfo = (current, edge.a, edge.b, edge.a is current, edge.b is current)
-                #next and previous are vertex with respect to ith vertex
-                if edge.a is current or edge.b is current:    ##  does this edge contain our current vert
-                    if edge.a is current:
-                        if edge.b is next:
-                            rightedge = edge
-                            rightvect = edge.vect
-                        if edge.b is previous:
-                            leftedge = edge
-                            leftvect = edge.vect
-                    elif edge.b is current:
-                        if edge.a is next:
-                            rightedge = edge
-                            rightvect = edge.vectb
-                        if edge.a is previous:
-                            leftedge = edge
-                            leftvect = edge.vectb
-            corner.append(rightedge)
-            corner.append(leftedge)
-            if rightedge and leftedge:
-                '''
-                if rightedge:
-                    print("rightedge",rightedge.index)
-                if leftedge:
-                    print( "leftedge",leftedge.index)
-                print("corner",corner)
-                #'''
-                dotty = self.dotproduct(rightvect,leftvect)
-                corner.append(dotty)
-            self.corners.append(corner)
-     
-     
-    def findnormal(self):
-        one = self.corners[1][2]
-        two = self.corners[1][1]
-        if one.a is self.corners[1][0]:
-            one = one.vect
-        elif one.b is self.corners[1][0]:
-            one = one.vectb
-        if two.a is self.corners[1][0]:
-            two = two.vect
-        elif two.b is self.corners[1][0]:
-            two = two.vectb
-        self.normal = crossp(one,two).docrossproduct()
-        self.normal.findlength()
-        self.normal.normalize()
-
-    def dospokes(self):
-#PKHG_OK_24-11        print("\n============vefm L375==============dbg, dospokes called corners =", self.corners[:])
-        for corner in self.corners:
-            vert = corner[0]
-            right = corner[1]
-            left = corner[2]
-            if right.a is vert:
-                one = vertex(right.vect.vector)
-            elif right.b is vert:
-                one = vertex(right.vectb.vector)
-            if left.a is vert:
-                two = vertex(left.vect.vector)
-            elif left.b is vert:
-                two = vertex(left.vectb.vector)
-            
-            one.normalize()
-            two.normalize()
-            spoke = one+two
-            spoke.normalize()
-            self.spokes.append(spoke)
-
-    def artspokes(self):
-        centre = average(self.vertices).centroid()
-        for point in self.vertices:
-            newedge = edge(point,centre)
-            spokes.append(newedge)
-            
-class mesh:
-    def __init__(self , name="GD_mesh"):
-        self.name = name #pkhg test phase at least ;-)
-        self.verts=[]
-        self.edges=[]
-        self.faces=[]
-        self.edgeflag = 0
-        self.faceflag = 0
-        self.vertexflag = 0
-        self.vertedgeflag = 0
-        self.vertfaceflag = 0
-        self.faceedgeflag = 0
-        self.boundaryflag = 0
-        self.vertnormalflag = 0
-        self.edgenormalflag = 0
-        self.facenormalflag = 0
-        #found in geodesic.py ??? needed for test here!
-        self.a45 = pi * 0.25
-        self.a90 = pi * 0.5
-        self.a180 = pi
-        self.a270 = pi * 1.5
-        self.a360 = pi * 2        
-
-        
-    def power(self,a,b):         ## Returns a power, including negative numbers
-        result = sgn(a)*(abs(a)**b)
-        return result
-
-    def sign(self,d):    ## Works out the sign of a number.
-        return sgn(d)
-
-    def ellipsecomp(self,efactor,theta):
-        if theta==self.a90:
-            result = self.a90
-        elif theta==self.a180:
-            result = self.a180
-        elif theta==self.a270:
-            result = self.a270
-        elif theta==self.a360:
-            result = 0.0
-        else:                        
-            result = atan(tan(theta)/efactor**0.5)
-            if result<0.0:
-                if theta>self.a180:
-                    result = result+self.a180
-                elif theta<self.a180:
-                    result = result+self.a180
-    ##  Fishy - check this.
-            if result>0.0:
-                if theta>self.a180:
-                    result = result+self.a180
-                elif theta<self.a180:
-                    result = result
-        return result
-        
-    def connectivity(self):
-        self.dovertedge()
-        self.dovertface()
-        self.dofaceedge()
-        self.boundary()
-
-    def superell(self,n1,uv,turn):
-        t1 = sin(uv+turn)
-        t1 = abs(t1)
-        t1 = t1**n1
-        t2 = cos(uv+turn)
-        t2 = abs(t2)
-        t2 = t2**n1
-        r = self.power(1.0/(t1+t2),(1.0/n1))
-        return r
-
-#PKHG changed according to http://de.wikipedia.org/wiki/Superformel
-#a and b a semi-diameter
-    def superform(self,m,n1,n2,n3,uv,a,b,twist):
-        t1 = cos(m*(uv+twist)*.25) / a
-        t1 = abs(t1)
-        t1 = t1**n2
-        t2 = sin(m*(uv+twist)*.25) / b
-        t2 = abs(t2)
-        t2 = t2**n3
-        r = self.power(1.0/(t1+t2),n1)        
-        return r
-        
-    def dovertedge(self):
-        if not self.vertedgeflag:
-            for vert in self.verts:
-                vert.edges = []
-            for currentedge in self.edges:
-                currentedge.a.edges.append(currentedge)
-                currentedge.b.edges.append(currentedge)
-        self.vertedgeflag = 1
-        
-    def dovertface(self):
-        if not self.vertfaceflag:
-            for vert in self.verts:
-                vert.faces = []
-            for face in self.faces:
-                for vert in face.vertices:
-                    vert.faces.append(face)
-        self.vertfaceflag = 1
-        
-    def dofaceedge(self):
-        self.dovertedge()    ## just in case they haven't been done
-        self.dovertface()    ##
-        if not self.faceedgeflag:
-            for edge in self.edges:
-                edge.faces=[]
-            for face in self.faces:
-                face.edges = []
-            for face in self.faces:
-                finish = len(face.vertices)
-                for i in range(finish):
-                    current = face.vertices[i]
-                    if i == finish-1:
-                        next = face.vertices[0]
-                    else:
-                        next = face.vertices[i+1]
-                    for edge in current.edges:
-                        if edge.a is current or edge.b is current:
-                            if edge.b is next or edge.a is next:
-                                edge.faces.append(face)
-                                face.edges.append(edge)
-        self.faceedgeflag = 1
- 
-    def boundary(self):
-        if not self.boundaryflag:
-            for edge in self.edges:
-                if len(edge.faces) < 2:
-                    edge.boundary = 1
-                    edge.faces[0].boundary = 1
-                    edge.a.boundary = 1
-                    edge.b.boundary = 1
-                    
-##   The functions below turn the basic triangular faces into
-##   hexagonal faces, creating the buckyball effect.
-#PKHG seems to work only for meshes with tri's ;-) ??!!
-    def hexify(self):
-        self.hexverts=[]
-        self.hexedges=[]
-        self.hexfaces=[]
-        #PKHG renumbering the index of the verts
-        for i in range(len(self.verts)):
-            self.verts[i].index = i
-        #PKHG renumbering the index of the edges
-        for i in range(len(self.edges)):
-            self.edges[i].index = i
-        #PKHG  self=> dovertedge, dovertface, dofaceedge, boundary()
-        self.connectivity()
-        hexvert_counter = 0
-        for edge in self.edges:
-#            print("21-11 >>>>>>>>>>>>>>dbg hexify L552")
-#            breakpoint(locals(),True)
-            self.hexshorten(edge,hexvert_counter)
-            hexvert_counter += 2 #PKHG two new vertices done
-#PKHG 21-11            print("21-11 <<<<<<<<<<<<<<< na hexshorten L557", hexvert_counter)
-#PKHG 21-11            breakpoint(locals(),True)
-
-        for face in self.faces:
-            self.makehexfaces(face)
-        
-        for vert in self.verts:
-            vert.clockwise()
-            self.hexvertface(vert)
-        self.verts = self.hexverts
-        self.edges = self.hexedges
-        self.faces = self.hexfaces
-        self.vertedgeflag = 0
-        self.vertfaceflag = 0
-        self.faceedgeflag = 0
-#PKHG_DBG        print("\n ==========================self hexified I hope")
-        #breakpoint(locals(),True)
- 
-    def hexshorten(self,currentedge, hexvert_counter):
-        third = vertex(currentedge.vect/3.0)
-        newvert1 = vertex(currentedge.a.vector)
-        newvert2 = vertex(currentedge.b.vector)
-        newvert1 = newvert1 + third
-        newvert1.index = hexvert_counter
-        newvert2 = newvert2 - third
-        newvert2.index = hexvert_counter + 1 #PKHG caller adjusts +=2 
-        newedge = edge(newvert1,newvert2)
-        newedge.index = currentedge.index
-        self.hexverts.append(newvert1)
-        self.hexverts.append(newvert2)
-        self.hexedges.append(newedge)
- 
-    def makehexfaces(self,currentface):
-        vertices=[]
-        currentface.docorners()
-        for corner in currentface.corners:
-            vert = corner[0]
-            rightedge = corner[1]
-            leftedge = corner[2]
-            lid = leftedge.index
-            rid = rightedge.index
-            
-            if leftedge.a is vert:
-                vertices.append(self.hexedges[lid].a)
-            elif leftedge.b is vert:
-                vertices.append(self.hexedges[lid].b)
-                
-            if rightedge.a is vert:
-                vertices.append(self.hexedges[rid].a)
-            elif rightedge.b is vert:
-                vertices.append(self.hexedges[rid].b)
-                
-        newface = face(vertices)
-        newedge1 = edge(vertices[0],vertices[1])
-        newedge2 = edge(vertices[2],vertices[3])
-        newedge3 = edge(vertices[4],vertices[5])
-        self.hexfaces.append(newface)
-        self.hexedges.append(newedge1)
-        self.hexedges.append(newedge2)
-        self.hexedges.append(newedge3)
-
-    def hexvertface(self,vert):
-        vertices=[]
-        for edge in vert.edges:
-            eid = edge.index
-            if edge.a is vert:
-                vertices.append(self.hexedges[eid].a)
-            elif edge.b is vert:
-                vertices.append(self.hexedges[eid].b)
-        newface = face(vertices)
-        self.hexfaces.append(newface)
- 
-    def starify(self):
-        self.starverts=[]
-        self.staredges=[]
-        self.starfaces=[]
-        for i in range(len(self.verts)):
-            self.verts[i].index = i
-        for i in range(len(self.edges)):
-            self.edges[i].index = i
-        self.connectivity()
-        star_vert_counter = 0
-        for currentedge in self.edges:
-            newvert = average([currentedge.a,currentedge.b]).centroid()
-            newvert.index = star_vert_counter
-            star_vert_counter += 1
-            self.starverts.append(newvert)
-        star_face_counter = 0
-        star_edge_counter = 0
-        for currentface in self.faces:
-            currentface.docorners()
-            vertices=[]
-            for corner in currentface.corners:
-                vert = self.starverts[corner[1].index]
-#                vert.index = star_vert_counter
-#                star_vert_counter += 1
-                vertices.append(vert)
-            newface = face(vertices)
-            newface.index = star_face_counter
-            star_face_counter += 1
-            newedge1 = edge(vertices[0],vertices[1])
-            newedge1.index = star_edge_counter
-            newedge2 = edge(vertices[1],vertices[2])
-            newedge2.index = star_edge_counter + 1
-            newedge3 = edge(vertices[2],vertices[0])
-            newedge3.index = star_edge_counter + 2
-            star_edge_counter += 3
-            self.starfaces.append(newface)
-            self.staredges.append(newedge1)
-            self.staredges.append(newedge2)
-            self.staredges.append(newedge3)
-        for vert in self.verts:
-            vertices=[]
-            vert.clockwise()
-            for currentedge in vert.edges:
-                eid = currentedge.index
-                vertices.append(self.starverts[eid])
-            newface = face(vertices)
-            newface.index = star_face_counter
-            star_face_counter += 1
-            self.starfaces.append(newface)
-        self.verts = self.starverts
-        self.edges = self.staredges
-        self.faces = self.starfaces
-        self.vertedgeflag = 0
-        self.vertfaceflag = 0
-        self.faceedgeflag = 0
-
-    def class2(self):
-        self.class2verts=[] #PKHG_??? used?
-        self.class2edges=[] #PKHG_??? used?
-        self.class2faces=[]
-        
-        newvertstart = len(self.verts)
-        newedgestart = len(self.edges)
-        counter_verts = len(self.verts) #PKHG
-#        for i in range(len(self.verts)):
-        for i in range(counter_verts):
-            self.verts[i].index = i
-        for i in range(len(self.edges)):
-            self.edges[i].index = i
-        for i in range(len(self.faces)):
-            self.faces[i].index = i
-        self.connectivity()
-        for currentface in self.faces:
-            currentface.docorners()
-            newvert = average(currentface.vertices).centroid()
-            newvert.index = counter_verts
-#PKHG_??? 20-11
-            counter_verts += 1
-            self.verts.append(newvert)
-            newedge1 = edge(currentface.vertices[0],newvert)
-            newedge2 = edge(currentface.vertices[1],newvert)
-            newedge3 = edge(currentface.vertices[2],newvert)
-            self.edges.append(newedge1)
-            self.edges.append(newedge2)
-            self.edges.append(newedge3)
-        for currentedge in range(newedgestart):
-            self.edges[currentedge].a = self.verts[self.edges[currentedge].faces[0].index+newvertstart]
-            self.edges[currentedge].b = self.verts[self.edges[currentedge].faces[1].index+newvertstart]
-            self.edges[currentedge].findvect()
-        #breakpoint(locals(),True)                
-        for currentvert in range(newvertstart):
-            vert = self.verts[currentvert]
-            vertices=[]
-            vert.clockwise()
-            for currentface in vert.faces:
-                eid = currentface.index
-#PKHG_OK                print(">>>>eid = ", eid,newvertstart + eid)
-                vertices.append(self.verts[newvertstart + eid])
-            #print("21-11 L710  currentvert is=", currentvert)
-            #breakpoint(locals(),True)    
-            for i in range(len(vertices)):
-                if i == len(vertices) - 1:
-                    next = vertices[0]
-                else:
-                    next = vertices[i+1]
-                #print("21-11 L710  i is=", i)
-                #breakpoint(locals(),True)    
-                newface = face([vert,vertices[i],next])
-                self.class2faces.append(newface)
-        #self.verts = self.class2verts
-        #self.edges = self.class2edges
-        self.faces = self.class2faces
-        self.vertedgeflag = 0
-        self.vertfaceflag = 0
-        self.faceedgeflag = 0    
-        
-    def dual(self):
-        self.dualverts=[]
-#        self.dualedges=[]
-        self.dualfaces=[]
-#PKHG 21-11 dual problem?!        
-        counter_verts = len(self.verts)
-        for i in range(counter_verts):
-            self.verts[i].index = i
-        for i in range(len(self.edges)):
-            self.edges[i].index = i
-        for i in range(len(self.faces)):
-            self.faces[i].index = i
-        self.connectivity()
-        counter_verts = 0
-        for currentface in self.faces:
-            currentface.docorners()
-            newvert = average(currentface.vertices).centroid()
-            newvert.index = counter_verts #PKHG needed in >= 2.59 
-            counter_verts += 1            
-            self.dualverts.append(newvert)
-        for vert in self.verts:
-            vertices=[]
-            vert.clockwise()
-            for currentface in vert.faces:
-                eid = currentface.index
-                vertices.append(self.dualverts[eid])
-            newface = face(vertices)
-            self.dualfaces.append(newface)
-        for currentedge in self.edges:
-            currentedge.a = self.dualverts[currentedge.faces[0].index]
-            currentedge.b = self.dualverts[currentedge.faces[1].index]
-        self.verts = self.dualverts
-#        self.edges = self.staredges
-        self.faces = self.dualfaces
-        self.vertedgeflag = 0
-        self.vertfaceflag = 0
-        self.faceedgeflag = 0
- 
-class facetype(mesh):
-    def __init__(self,basegeodesic,parameters,width,height,relative):
-        mesh.__init__(self)
-        self.detatch = parameters[0]
-        self.endtype = parameters[1]
-        self.coords = parameters[2]
-        self.base = basegeodesic
-        self.relative = relative
-        self.width = width
-    
-        if not self.relative:
-            newwidth = self.findrelative()
-            self.width = width*newwidth
-        self.height = height
-        self.base.connectivity()
-        for coord in self.coords:
-            coord[0]=coord[0]*self.width
-            coord[1]=coord[1]*self.height
-        if not self.base.facenormalflag:
-            for currentface in self.base.faces:
-            #    print("face normal ",currentface.normal)
-                currentface.docorners()
-                currentface.findnormal()
-            #    print("face normal ",currentface.normal.x,currentface.normal.y,currentface.normal.z)
-            self.base.facenormalflag = 1
-        if self.endtype==4 and not self.base.vertnormalflag:
-            for currentvert in self.base.verts:
-                currentvert.findnormal()
-            self.base.vertnormalflag = 1
-        self.createfaces()
- 
-    def findrelative(self):
-        centre = average(self.base.faces[0].vertices).centroid()
-        edgelist=[]
-        for point in self.base.faces[0].vertices:
-            newedge = edge(centre,point)
-            edgelist.append(newedge)
-        length = 0
-        for edg in edgelist:
-            extra = edg.vect.length
-            length = length+extra
-        #    print("length",length,"extra",extra)
-        length = length/len(edgelist)
-    #    print("find relative",length)
-        return length
- 
-    def createfaces(self):
-        if not self.detatch:
-            for point in self.base.verts:
-                self.verts.append(point)
-        if self.endtype==4:
-            self.createghostverts()
-        for currentface in self.base.faces:
-            self.doface(currentface)
-
-    def createghostverts(self):
-        self.ghoststart = len(self.verts)
-        for vert in self.base.verts:
-            newvert = vert + (vert.normal * self.coords[-1][1])
-            self.verts.append(newvert)
-        
-    def doface(self,candidate):
-        grid=[]
-        candidate.dospokes()
-    #    print("Candidate normal",candidate.normal.x,candidate.normal.y,candidate.normal.z)
-        if not self.detatch:
-            line=[]
-            for vert in candidate.vertices:
-                line.append(vert)
-            grid.append(line)
-        else:
-            line=[]
-            for point in candidate.vertices:
-                newvert = vertex(point.vector)
-                self.verts.append(newvert)
-                line.append(newvert)
-            grid.append(line)
-        finish = len(self.coords)
-        if self.endtype==1 or self.endtype==4:
-            finish = finish-1
-        for i in range(finish):
-            up = candidate.normal*self.coords[i][1]
-            line=[]
-            for j in range(len(candidate.vertices)):
-                dotfac = candidate.corners[j][3]*0.5
-                vec=(candidate.spokes[j]*(self.coords[i][0]/sin(dotfac)))        #self.coords[i][0])#(self.coords[i][0]/sin(dotfac)))#+up
-                newvert = candidate.vertices[j]+vec+up
-                line.append(newvert)
-                self.verts.append(newvert)
-            grid.append(line)
-        if self.endtype==4:
-            line=[]
-            for i in range(len(candidate.vertices)):
-                vert = self.verts[candidate.vertices[i].index+self.ghoststart]
-                line.append(vert)
-            #    self.verts.append(vert)
-            grid.append(line)
-        for line in grid:
-            line.append(line[0])
-        if self.endtype==3:
-            grid.append(grid[0])
-        for i in range(len(grid)-1):
-            for j in range(len(grid[i])-1):
-                one = grid[i][j]
-                two = grid[i][j+1]
-                three = grid[i+1][j+1]
-                four = grid[i+1][j]
-                newface = face([one, two, three, four])
-                self.faces.append(newface)
-        if self.endtype==2:
-            finalfaceverts = grid[-1]
-            newface = face(finalfaceverts[:-1])
-            self.faces.append(newface)
-        if self.endtype==1:
-            lastvert = average(candidate.vertices).centroid()
-            up = candidate.normal*self.coords[-1][1]
-            newvert = lastvert+up
-            self.verts.append(newvert)
-            ring = grid[-1]
-            for i in range(len(ring)-1):
-                newface = face([newvert,ring[i],ring[i+1]])
-                self.faces.append(newface)
-
-class importmesh(mesh):
-    def __init__(self,meshname,breakquadflag):    
-        mesh.__init__(self)
-#        print("mesh and breakquad",meshname,breakquadflag)
-#        impmesh = NMesh.GetRawFromObject(meshname)
-        impmesh = bpy.data.objects[meshname]
-        copied_mesh = None
-        if breakquadflag:
-            name = impmesh.name
-#PKHG???needed???NO 3-11-2011            impmesh.name = "Original_" + name
-            impmesh.name =  name
-#PKHG TODO use a copy?   no not necessary         bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(0, 0,0}))
-#PKHG TODO use a copy?            copied_mesh = bpy.context.active_object
-            bpy.ops.object.mode_set(mode='EDIT')
-            bpy.ops.mesh.quads_convert_to_tris()
-            bpy.ops.object.mode_set(mode='OBJECT')
-
-        for v in impmesh.data.vertices:
-            vert = vertex(v.co)
-            vert.index = v.index
-            self.verts.append(vert)
-#PKHG verts is now a list of vertex, so to say a copy of the Vectors
-
-#PKHG edges
-        for e in impmesh.data.edges:
-            tmp = []
-            for vert in e.vertices:
-                a = self.verts[vert]
-                tmp.append(a)
-            newedge = edge(tmp[0],tmp[1])
-            newedge.index = e.index
-            self.edges.append(newedge)            
-#PKHG faces with out bmesh replace next line polygons by faces
-        for f in impmesh.data.polygons:
-            temp=[]
-            for vert in f.vertices:  #PKHG a list! of indices 
-                a = self.verts[vert] #PKHG verts contains already vertex objects
-                temp.append(a)
-            newface = face(temp)
-            newface.index = f.index #indexcount
-            self.faces.append(newface)
-        self.dovertedge()
-        self.dovertface()
-        self.temp=[]    
-
-        for i in range(len(self.verts)):
-            self.temp.append([])
-            self.verts[i].index = i
-        for i in range(len(self.verts)):
-            target = self.surroundingverts(self.verts[i])    
-            for j in range(len(target)):                ## go through those verts
-                temptarg = self.temp[target[j].index]        
-                flag = 0                    ## set a flag up
-        
-                for k in range(len(temptarg)):        ## go through temp list for each of those verts
-                    
-                    if temptarg[k]==i:            ## if we find a match to the current vert...
-                        flag = 1            ## raise the flag
-            
-                if flag==0:                ## if there is no flag after all that...
-                    self.temp[target[j].index].append(i)    ## add current vert to temp list of this surrounding vert
-                    self.temp[i].append(target[j].index)    ## add this surrounding vert to the current temp list
-                    newedge = edge(self.verts[i],self.verts[target[j].index])
-                    self.edges.append(newedge)    ## add the newly found edge to the edges list
-        
-        for edg in self.edges:
-            edg.findvect()
-        self.vertedgeflag = 0    
-        self.vertedgeflag = 0    
-        self.connectivity()
-#PKHG_DBG_OK        print("\n======= mesh imported")
-                                                    
-    def surroundingverts(self,vert):
-        """ Find the verts surrounding vert"""        
-        surround=[]                    ## list to be filled and returned        
-        for faces in vert.faces:        ## loop through faces attached to vert
-            finish = len(faces.vertices)
-            for i in range(finish):            
-                if i==finish-1:
-                    next = faces.vertices[0]
-                else:
-                    next = faces.vertices[i+1]
-                if vert == faces.vertices[i]:
-                    surround.append(next)                                    
-        return surround
-
-    def breakquad(self,quad_face):
-        """ turn quads into triangles"""
-        distance1 = quad_face.vertices[0]-quad_face.vertices[2]
-        distance2 = quad_face.vertices[1]-quad_face.vertices[3]        
-        distance1.findlength()
-        distance2.findlength()        
-        if abs(distance1.length)<abs(distance2.length):
-            self.faces[quad_face.index]=face([quad_face.vertices[0],quad_face.vertices[1],quad_face.vertices[2]])
-            self.faces.append(face([quad_face.vertices[0],quad_face.vertices[2],quad_face.vertices[3]]))
-        else:
-            self.faces[quad_face.index]=face([quad_face.vertices[0],quad_face.vertices[1],quad_face.vertices[3]])
-            self.faces.append(face([quad_face.vertices[1],quad_face.vertices[2],quad_face.vertices[3]]))            
-        
-                        
-class strut(mesh):
-    def __init__(self,base,struttype,width,height,length,widthtog,heighttog,lengthtog,meshname,stretchflag,lift):
-        mesh.__init__(self)
-        ## put in strut prep stuff here
-        if struttype==None:
-            return
-        total = 0
-        divvy = len(base.faces[0].edges)
-        for lengf in base.faces[0].edges:
-            lengf.vect.findlength()
-            total = total+lengf.vect.length
-        yardstick = total/divvy
-        if widthtog:
-            self.width = width
-        else:
-            self.width = width * yardstick
-        if heighttog:
-            self.height = height
-        else:
-            self.height = height*yardstick
-        if lengthtog:
-            self.shrink = length
-        else:
-            self.shrink = length * yardstick        
-        if not base.facenormalflag:
-            for currentface in base.faces:
-                currentface.docorners()
-                currentface.findnormal()
-            base.facenormalflag = 1
-        for edj in base.edges:
-            edj.findnormal()
-            side = edge(edj.a,edj.b)
-            edj.unit = side.vect
-            edj.unit.normalize()    
-            edj.cross = crossp(edj.normal,edj.unit).docrossproduct()
-        template = importmesh(meshname,0)
-        maxx = 0
-        minx = 0
-        for vert in template.verts:
-#            if vert.x>maxx:
-            if vert.vector.x > maxx:
-#                maxx = vert.x
-                maxx = vert.vector.x
-#            if vert.x<minx:
-            if vert.vector.x < minx:
-#                minx = vert.x
-                minx = vert.vector.x
-        for edj in base.edges:
-            start = len(self.verts)
-            centre = average([edj.a,edj.b]).centroid()
-            split = edj.vect.length/2
-            #PKHG no division by zero!!
-            tmp = 1.0
-            if maxx != minx:
-                tmp = 1.0/(maxx - minx)
-#            dubbl = edj.vect.length/(maxx-minx)
-            dubbl = edj.vect.length * tmp
-            #PKHG end no division by zero!!
-            diffplus = split-maxx
-            diffminus=-split-minx
-            for point in template.verts:
-#                ay=(edj.normal*point.z*self.height)+(edj.normal*lift)
-                ay=(edj.normal * point.vector.z * self.height) + (edj.normal * lift)
-#                ce = edj.cross * point.y * self.width
-                ce = edj.cross * point.vector.y * self.width
-                if stretchflag:
-#                    be = edj.unit*self.shrink*dubbl*point.x
-                    be = edj.unit * self.shrink * dubbl * point.vector.x
-                else:
-#                    if point.x > 0.0:
-                    if point.vector.x > 0.0:    
-#                        be = edj.unit * self.shrink * (point.x + diffplus)
-                        be = edj.unit * self.shrink * (point.vector.x + diffplus)
-#                    elif point.x < 0.0:
-                    elif point.vector.x < 0.0:    
-#                        be = edj.unit * self.shrink * (point.x + diffminus)
-                        be = edj.unit * self.shrink * (point.vector.x + diffminus)
-#                    elif point.x == 0.0:
-                    elif point.vector.x == 0.0:
-#                        be = edj.unit * self.shrink * point.x
-                        be = edj.unit * self.shrink * point.vector.x
-                de = ay + be + ce
-                newvert = centre + de
-                self.verts.append(newvert)
-            for edjy in template.edges:
-                one = edjy.a.index+start
-                two = edjy.b.index+start
-                newedge = edge(self.verts[one],self.verts[two])
-                self.edges.append(newedge)
-            for facey in template.faces:
-                faceverts=[]
-                for verty in facey.vertices:
-                    index = verty.index+start
-                    faceverts.append(self.verts[index])
-                newface = face(faceverts)
-                self.faces.append(newface)
-        self.vertedgeflag = 0    
-        self.vertedgeflag = 0                        
-        self.connectivity()    
-        
-class hub(mesh):
-    def __init__(self,base,hubtype,width,height,length,widthtog,heighttog,lengthtog,meshname):
-        mesh.__init__(self)
-        self.width = 1.0
-        self.height = 1.0
-        self.shrink = 1.0
-        ## put in strut prep stuff here
-        if hubtype==None:
-            return
-        total = 0
-        divvy = len(base.faces[0].edges)
-        for lengf in base.verts[0].edges:
-            lengf.vect.findlength()
-            total = total+lengf.vect.length
-        yardstick = total / divvy
-        if widthtog:
-            self.width = width
-        else:
-            self.width = width * yardstick
-        if heighttog:
-            self.height = height
-        else:
-            self.height = height * yardstick
-        if lengthtog:
-            self.shrink = length
-        else:
-            self.shrink = length * yardstick
-            
-        if not base.facenormalflag:
-            for currentface in base.faces:
-                currentface.docorners()
-                currentface.findnormal()
-            base.facenormalflag = 1
-#PKHG_2411        breakpoint(locals(),True) #PKHG_DBG 24-11 reason ERROR**** findnormal has no faces
-
-            
-        for apex in base.verts:
-            apex.findnormal()
-            side = edge(apex.edges[0].a,apex.edges[0].b)
-            apex.unit = side.vect #PKHG is Vector: b -a
-            apex.unit.normalize()    
-            apex.cross = crossp(apex.normal,apex.unit).docrossproduct()
-            apex.unit = crossp(apex.cross,apex.normal).docrossproduct()
-            
-        template = importmesh(meshname,0)
-        for apex in base.verts:
-            start = len(self.verts)
-            centre = apex    
-            for point in template.verts:
-                ay = apex.normal * point.vector.z * self.height
-                ce = apex.cross * point.vector.y * self.width
-                be = apex.unit * point.vector.x * self.shrink
-                de = ay+be+ce
-                newvert = centre+de
-                self.verts.append(newvert)
-            for edjy in template.edges:
-                one = edjy.a.index+start
-                two = edjy.b.index+start
-                newedge = edge(self.verts[one],self.verts[two])
-                self.edges.append(newedge)
-            for facey in template.faces:
-                faceverts=[]
-                for verty in facey.vertices:
-                    index = verty.index+start
-                    faceverts.append(self.verts[index])
-                newface = face(faceverts)
-                self.faces.append(newface)
-        self.vertedgeflag = 0    
-        self.vertedgeflag = 0                        
-        self.connectivity()
-
-#???PKHG TODO Nmesh used yet wrong!            
-def finalfill(source,target):
-    if source == target: #PKHG: otherewise >infinite< loop
-        print("\n***WARNING*** vefm_259.finalfill L1148 source == target empty mesh used")
-        target = mesh() #
-#PKHG_??? maybe renumverting and checkkin faces wiht >=4 5 vertices?        
-    count = 0
-#PKHG_OK    print("\n>>>>>>>>20-11 DBG vefm_259 in finalfill L1152, len(source.verts) =",len(source.verts))
-    for point in source.verts:
-#        newvert = NMesh.Vert(point.x,point.y,point.z)
-        newvert = vertex(point.vector)
-#PKHG_??? needed???
-        newvert.index = count 
-        target.verts.append(newvert)
-        point.index = count  #PKHG_INFO source renumbered too!
-#PKHG_OK        print("test gelijk",newvert.vector == point.vector)
-        count += 1 #count+1
-    
-    #PKHG indices of the vertex in faceyvertices are renumbered!
-#PKHG_OK    print("\n>>>>>>>>20-11 DBG vefm_259 in finalfill L1163, len(source.faces) =",len(source.faces))    
-    for facey in source.faces:
-        row = len(facey.vertices)
-        if row >= 5:
-#PKHG does not take the good vectors???            newvert = average(facey.vertices).centroid()
-            tmp = Vector()
-            for el in facey.vertices:
-                tmp = tmp +  target.verts[el.index].vector
-            tmp = tmp / row
-            centre = vertex(tmp) #does not work here!==>  average(facey.vertices).centroid()
-            centre.index = count #PKHG_??? give it a good index
-            count += 1
-#PKHG_DBG 21-11
-            #breakpoint(locals(),True)
-            
-            target.verts.append(centre)
-            for i in range(row):
-                if i == row - 1:
-                    a = target.verts[facey.vertices[-1].index]
-                    b = target.verts[facey.vertices[0].index]
-                else:
-                    a = target.verts[facey.vertices[i].index]
-                    b = target.verts[facey.vertices[i+1].index]
-                target.faces.append([a,b,centre])
-        else:
-            f = []
-#PKHG_DBG 21-11
-#            print("\n-----++++ L1217 dbg final dual", facey )
-#PKHG_DBG 21-11
-#            breakpoint(locals(),True)
-
-            for j in range(len(facey.vertices)):
-                a = facey.vertices[j]
-#PKHG_NOTNEEDED                tmp = a.index
-                f.append(target.verts[a.index])
-            target.faces.append(f)
-
diff --git a/release/scripts/addons_contrib/gpencil_retopo/__init__.py b/release/scripts/addons_contrib/gpencil_retopo/__init__.py
deleted file mode 100644
index 6a26782..0000000
--- a/release/scripts/addons_contrib/gpencil_retopo/__init__.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-
-bl_info = {
-    "name": "Grease Pencil Retopology",
-    "author": "Campbell Barton, Bart Crouch",
-    "version": (1, 0, 0),
-    "blender": (2, 57, 0),
-    "location": "View3D > Properties > Grease Pencil",
-    "warning": "",
-    "description": "Use Grease Pencil to retopologise a mesh.",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-
-import bpy
-
-
-# retopo operator
-class Retopo(bpy.types.Operator):
-    bl_idname = "mesh.gp_retopo"
-    bl_label = "Retopo"
-    bl_description = "Convert Grease Pencil drawings to a mesh"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    precision = bpy.props.IntProperty(name="Precision",
-        description="Lower values result in more removed doubles and "
-                    "smoother less precise results",
-        default=40,
-        min=2,
-        soft_max=100)
-
-    @classmethod
-    def poll(cls, context):
-        return context.object
-
-    def execute(self, context):
-        from . import retopo
-        scene, gp = retopo.initialise(context)
-        if not gp:
-            self.report({'WARNING'}, "No grease pencil data found")
-            return {'CANCELLED'}
-
-        obj_new = retopo.calculate(gp, self.precision)
-
-        bpy.ops.object.select_all(action='DESELECT')
-        scene.objects.active = obj_new
-        obj_new.select = True
-
-        # nasty, recalc normals
-        bpy.ops.object.mode_set(mode='EDIT', toggle=False)
-        bpy.ops.mesh.normals_make_consistent(inside=False)
-        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-
-        return {'FINISHED'}
-
-
-# draw function for integration in panels
-def panel_func(self, context):
-    self.layout.operator("mesh.gp_retopo")
-
-
-# define classes and panels for registration
-classes = [Retopo]
-panels = [bpy.types.VIEW3D_PT_tools_objectmode,
-    bpy.types.VIEW3D_PT_tools_meshedit,
-    bpy.types.VIEW3D_PT_tools_curveedit,
-    bpy.types.VIEW3D_PT_tools_surfaceedit,
-    bpy.types.VIEW3D_PT_tools_armatureedit,
-    bpy.types.VIEW3D_PT_tools_mballedit,
-    bpy.types.VIEW3D_PT_tools_latticeedit,
-    bpy.types.VIEW3D_PT_tools_posemode]
-
-
-# registering and menu integration
-def register():
-    for c in classes:
-        bpy.utils.register_class(c)
-    for panel in panels:
-        panel.append(panel_func)
-
-
-# unregistering and removing menus
-def unregister():
-    for c in classes:
-        bpy.utils.unregister_class(c)
-    for panel in panels:
-        panel.remove(panel_func)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/gpencil_retopo/retopo.py b/release/scripts/addons_contrib/gpencil_retopo/retopo.py
deleted file mode 100644
index b164bf4..0000000
--- a/release/scripts/addons_contrib/gpencil_retopo/retopo.py
+++ /dev/null
@@ -1,522 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-import bpy
-from math import radians
-from mathutils.geometry import intersect_point_line, intersect_line_line
-
-
-# gather initial data and prepare for retopologising
-def initialise(context):
-    scene = context.scene
-    obj = context.object
-
-    gp = None
-    if obj:
-        gp = obj.grease_pencil
-    if not gp:
-        gp = scene.grease_pencil
-
-    if gp:
-        bpy.ops.object.mode_set(mode='OBJECT')
-
-    return(scene, gp)
-
-
-def get_hub(co, _hubs, EPS_SPLINE):
-
-    if 1:
-        for hub in _hubs.values():
-            if (hub.co - co).length < EPS_SPLINE:
-                return hub
-
-        key = co.to_tuple(3)
-        hub = _hubs[key] = Hub(co, key, len(_hubs))
-        return hub
-    else:
-        pass
-
-        '''
-        key = co.to_tuple(3)
-        try:
-            return _hubs[key]
-        except:
-            hub = _hubs[key] = Hub(co, key, len(_hubs))
-            return hub
-        '''
-
-
-class Hub(object):
-    __slots__ = "co", "key", "index", "links"
-
-    def __init__(self, co, key, index):
-        self.co = co.copy()
-        self.key = key
-        self.index = index
-        self.links = []
-
-    def get_weight(self):
-        f = 0.0
-
-        for hub_other in self.links:
-            f += (self.co - hub_other.co).length
-
-    def replace(self, other):
-        for hub in self.links:
-            try:
-                hub.links.remove(self)
-            except:
-                pass
-            if other not in hub.links:
-                hub.links.append(other)
-
-    def dist(self, other):
-        return (self.co - other.co).length
-
-    def calc_faces(self, hub_ls):
-        faces = []
-        # first tris
-        for l_a in self.links:
-            for l_b in l_a.links:
-                if l_b is not self and l_b in self.links:
-                    # will give duplicates
-                    faces.append((self.index, l_a.index, l_b.index))
-
-        # now quads, check which links share 2 different verts directly
-        def validate_quad(face):
-            if len(set(face)) != len(face):
-                return False
-            if hub_ls[face[0]] in hub_ls[face[2]].links:
-                return False
-            if hub_ls[face[2]] in hub_ls[face[0]].links:
-                return False
-
-            if hub_ls[face[1]] in hub_ls[face[3]].links:
-                return False
-            if hub_ls[face[3]] in hub_ls[face[1]].links:
-                return False
-
-            return True
-
-        for i, l_a in enumerate(self.links):
-            links_a = {l.index for l in l_a.links}
-            for j in range(i):
-                l_b = self.links[j]
-
-                links_b = {l.index for l in l_b.links}
-
-                isect = links_a.intersection(links_b)
-                if len(isect) == 2:
-                    isect = list(isect)
-
-                    # check there are no diagonal lines
-                    face = (isect[0], l_a.index, isect[1], l_b.index)
-                    if validate_quad(face):
-
-                        faces.append(face)
-
-        return faces
-
-
-class BBox(object):
-    __slots__ = "xmin", "ymin", "zmin", "xmax", "ymax", "zmax"
-
-    def __init__(self):
-        self.xmin = self.ymin = self.zmin = 100000000.0
-        self.xmax = self.ymax = self.zmax = -100000000.0
-
-    @property
-    def xdim(self):
-        return self.xmax - self.xmin
-
-    @property
-    def ydim(self):
-        return self.ymax - self.ymin
-
-    @property
-    def zdim(self):
-        return self.zmax - self.zmin
-
-    def calc(self, points):
-        xmin = ymin = zmin = 100000000.0
-        xmax = ymax = zmax = -100000000.0
-
-        for pt in points:
-            x, y, z = pt
-            if x < xmin:
-                xmin = x
-            if y < ymin:
-                ymin = y
-            if z < zmin:
-                zmin = z
-
-            if x > xmax:
-                xmax = x
-            if y > ymax:
-                ymax = y
-            if z > zmax:
-                zmax = z
-
-        self.xmin, self.ymin, self.zmin = xmin, ymin, zmin
-        self.xmax, self.ymax, self.zmax = xmax, ymax, zmax
-
-    def xsect(self, other, margin=0.0):
-        if margin == 0.0:
-            if self.xmax < other.xmin:
-                return False
-            if self.ymax < other.ymin:
-                return False
-            if self.zmax < other.zmin:
-                return False
-
-            if self.xmin > other.xmax:
-                return False
-            if self.ymin > other.ymax:
-                return False
-            if self.zmin > other.zmax:
-                return False
-
-        else:
-            xmargin = ((self.xdim + other.xdim) / 2.0) * margin
-            ymargin = ((self.ydim + other.ydim) / 2.0) * margin
-            zmargin = ((self.zdim + other.zdim) / 2.0) * margin
-
-            if self.xmax < other.xmin - xmargin:
-                return False
-            if self.ymax < other.ymin - ymargin:
-                return False
-            if self.zmax < other.zmin - zmargin:
-                return False
-
-            if self.xmin > other.xmax + xmargin:
-                return False
-            if self.ymin > other.ymax + ymargin:
-                return False
-            if self.zmin > other.zmax + zmargin:
-                return False
-        return True
-
-    def __iadd__(self, other):
-        self.xmin = min(self.xmin, other.xmin)
-        self.ymin = min(self.ymin, other.ymin)
-        self.zmin = min(self.zmin, other.zmin)
-
-        self.xmax = max(self.xmax, other.xmax)
-        self.ymax = max(self.ymax, other.ymax)
-        self.zmax = max(self.zmax, other.zmax)
-        return self
-
-
-class Spline(object):
-    __slots__ = "points", "hubs", "closed", "length", "bb"
-
-    def __init__(self, points, precision):
-        self.points = points
-        self.hubs = []
-        self.calc_length()
-        self.closed = self.calc_closed(precision)
-        self.bb = BBox()
-        self.bb.calc(points)
-
-    def calc_length(self):
-        # calc length
-        f = 0.0
-        co_prev = self.points[0]
-        for co in self.points[1:]:
-            f += (co - co_prev).length
-            co_prev = co
-        self.length = f
-
-    def calc_closed(self, precision):
-        return (self.points[0] - self.points[-1]).length < (self.length / precision)
-
-    def link(self):
-        if len(self.hubs) < 2:
-            return
-
-        edges = list(set([i for i, hub in self.hubs]))
-        edges.sort()
-
-        edges_order = {}
-        for i in edges:
-            edges_order[i] = []
-
-        # self.hubs.sort()
-        for i, hub in self.hubs:
-            edges_order[i].append(hub)
-
-        hubs_order = []
-        for i in edges:
-            ls = edges_order[i]
-            edge_start = self.points[i]
-            ls.sort(key=lambda hub: (hub.co - edge_start).length)
-            hubs_order.extend(ls)
-
-        # Now we have the order, connect the hubs
-        hub_prev = hubs_order[0]
-
-        for hub in hubs_order[1:]:
-            hub.links.append(hub_prev)
-            hub_prev.links.append(hub)
-            hub_prev = hub
-
-        if self.closed:
-            hubs_order[0].links.append(hubs_order[-1])
-            hubs_order[-1].links.append(hubs_order[0])
-
-
-def get_points(stroke):
-    return [point.co.copy() for point in stroke.points]
-
-
-def get_splines(gp, precision):
-    l = gp.layers.active
-    if l:
-        frame = l.active_frame
-        return [Spline(get_points(stroke), precision) for stroke in frame.strokes if len(stroke.points) > 1]
-    else:
-        return []
-
-
-def xsect_spline(sp_a, sp_b, _hubs, precision):
-    pt_a_prev = pt_b_prev = None
-    EPS_SPLINE = min(sp_a.length, sp_b.length) / precision
-    pt_a_prev = sp_a.points[0]
-    for a, pt_a in enumerate(sp_a.points[1:]):
-        pt_b_prev = sp_b.points[0]
-        for b, pt_b in enumerate(sp_b.points[1:]):
-
-            # Now we have 2 edges
-            # print(pt_a, pt_a_prev, pt_b, pt_b_prev)
-            xsect = intersect_line_line(pt_a, pt_a_prev, pt_b, pt_b_prev)
-            if xsect is not None:
-                if (xsect[0] - xsect[1]).length <= EPS_SPLINE:
-                    f = intersect_point_line(xsect[1], pt_a, pt_a_prev)[1]
-                    # if f >= 0.0-EPS_SPLINE and f <= 1.0+EPS_SPLINE:
-                        # for some reason doesnt work so well, same below
-                    if f >= 0.0 and f <= 1.0:
-                        f = intersect_point_line(xsect[0], pt_b, pt_b_prev)[1]
-                        # if f >= 0.0-EPS_SPLINE and f <= 1.0+EPS_SPLINE:
-                        if f >= 0.0 and f <= 1.0:
-                            # This wont happen often
-                            co = xsect[0].lerp(xsect[1], 0.5)
-                            hub = get_hub(co, _hubs, EPS_SPLINE)
-
-                            sp_a.hubs.append((a, hub))
-                            sp_b.hubs.append((b, hub))
-
-            pt_b_prev = pt_b
-
-        pt_a_prev = pt_a
-
-
-def connect_splines(splines, precision):
-    HASH_PREC = 8
-    ANG_LIMIT = radians(25.0)  # limit for joining splines into 1
-
-    def sort_pair(a, b):
-        if a < b:
-            return a, b
-        else:
-            return b, a
-
-    #def test_join(p1a, p1b, p2a, p2b, length_average):
-    def test_join(s1, s2, dir1, dir2, length_average):
-        if dir1 is False:
-            p1a = s1.points[0]
-            p1b = s1.points[1]
-        else:
-            p1a = s1.points[-1]
-            p1b = s1.points[-2]
-
-        if dir2 is False:
-            p2a = s2.points[0]
-            p2b = s2.points[1]
-        else:
-            p2a = s2.points[-1]
-            p2b = s2.points[-2]
-
-        v1 = p1a - p1b
-        v2 = p2b - p2a
-
-        if v1.angle(v2, ANG_LIMIT) >= ANG_LIMIT:
-            return False
-
-        # trim s2, allow overlapping line.
-        v2_test_1 = p2b - p2a
-        if dir2 is False:
-            i = 2
-            while (p2b - p1a).length < (p2a - p1a).length and i < len(s2.points):
-                p2a = p2b
-                p2b = s2.points[i]
-                i += 1
-        else:
-            i = -3
-            while (p2b - p1a).length < (p2a - p1a).length and -i <= len(s2.points):
-                p2a = p2b
-                p2b = s2.points[i]
-                i -= 1
-
-        # when trimming did we we turn a corner?
-        v2_test_2 = p2b - p2a
-        if v2_test_1.angle(v2_test_2, ANG_LIMIT) >= ANG_LIMIT:
-            return False
-        del v2_test_1
-        del v2_test_2
-        # end trimming
-
-        # compare length between tips
-        if (p1a - p2a).length > (length_average / precision):
-            return False
-
-        # print("joining!")
-        return True
-
-    # lazy, hash the points that have been compared.
-    comparisons = set()
-
-    do_join = True
-    while do_join:
-        do_join = False
-        for i, s1 in enumerate(splines):
-            key1a = s1.points[0].to_tuple(HASH_PREC)
-            key1b = s1.points[-1].to_tuple(HASH_PREC)
-
-            for j, s2 in enumerate(splines):
-                if s1 is s2:
-                    continue
-
-                length_average = min(s1.length, s2.length)
-
-                key2a = s2.points[0].to_tuple(HASH_PREC)
-                key2b = s2.points[-1].to_tuple(HASH_PREC)
-
-                # there are 4 ways this may be joined
-                key_pair = sort_pair(key1a, key2a)
-                if key_pair not in comparisons:
-                    comparisons.add(key_pair)
-                    if test_join(s1, s2, False, False, length_average):
-                        s1.points[:0] = reversed(s2.points)
-                        s1.bb += s2.bb
-                        s1.calc_length()
-                        del splines[j]
-                        do_join = True
-                        break
-
-                key_pair = sort_pair(key1a, key2b)
-                if key_pair not in comparisons:
-                    comparisons.add(key_pair)
-                    if test_join(s1, s2, False, True, length_average):
-                        s1.points[:0] = s2.points
-                        s1.bb += s2.bb
-                        s1.calc_length()
-                        del splines[j]
-                        do_join = True
-                        break
-
-                key_pair = sort_pair(key1b, key2b)
-                if key_pair not in comparisons:
-                    comparisons.add(key_pair)
-                    if test_join(s1, s2, True, True, length_average):
-                        s1.points += list(reversed(s2.points))
-                        s1.bb += s2.bb
-                        s1.calc_length()
-                        del splines[j]
-                        do_join = True
-                        break
-
-                key_pair = sort_pair(key1b, key2a)
-                if key_pair not in comparisons:
-                    comparisons.add(key_pair)
-                    if test_join(s1, s2, True, False, length_average):
-                        s1.points += s2.points
-                        s1.bb += s2.bb
-                        s1.calc_length()
-                        del splines[j]
-                        do_join = True
-                        break
-
-            if do_join:
-                break
-
-
-def calculate(gp, precision):
-    # note, this precision is for closed lines, it could be a different arg.
-    splines = get_splines(gp, precision)
-
-    # spline endpoints may be co-linear, join these into single splines
-    connect_splines(splines, precision)
-
-    _hubs = {}
-
-    for i, sp in enumerate(splines):
-        for j, sp_other in enumerate(splines):
-            if j <= i:
-                continue
-
-            if sp.bb.xsect(sp_other.bb, margin=0.1):
-                xsect_spline(sp, sp_other, _hubs, precision)
-
-    for sp in splines:
-        sp.link()
-
-    # remove these
-    hubs_ls = [hub for hub in _hubs.values() if hub.index != -1]
-
-    _hubs.clear()
-    _hubs = None
-
-    for i, hub in enumerate(hubs_ls):
-        hub.index = i
-
-    # Now we have connected hubs, write all edges!
-    def order(i1, i2):
-        if i1 > i2:
-            return i2, i1
-        return i1, i2
-
-    edges = {}
-
-    for hub in hubs_ls:
-        i1 = hub.index
-        for hub_other in hub.links:
-            i2 = hub_other.index
-            edges[order(i1, i2)] = None
-
-    verts = []
-    edges = edges.keys()
-    faces = []
-
-    for hub in hubs_ls:
-        verts.append(hub.co)
-        faces.extend(hub.calc_faces(hubs_ls))
-
-    # remove double faces
-    faces = dict([(tuple(sorted(f)), f) for f in faces]).values()
-
-    mesh = bpy.data.meshes.new("Retopo")
-    mesh.from_pydata(verts, [], faces)
-
-    scene = bpy.context.scene
-    mesh.update()
-    obj_new = bpy.data.objects.new(name="Retopo", object_data=mesh)
-    scene.objects.link(obj_new)
-
-    return obj_new
diff --git a/release/scripts/addons_contrib/io_atomblend_utilities/__init__.py b/release/scripts/addons_contrib/io_atomblend_utilities/__init__.py
deleted file mode 100644
index 49a7fac..0000000
--- a/release/scripts/addons_contrib/io_atomblend_utilities/__init__.py
+++ /dev/null
@@ -1,286 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-#
-#
-#  Authors           : Clemens Barth (Blendphys at root-1.de), ...
-#
-#  Homepage(Wiki)    : http://development.root-1.de/Atomic_Blender.php
-#
-#  Start of project              : 2011-12-01 by Clemens Barth
-#  First publication in Blender  : 2012-11-03
-#  Last modified                 : 2013-01-08
-#
-#  Acknowledgements 
-#  ================
-#
-#  Blender: ideasman, meta_androcto, truman, kilon, CoDEmanX, dairin0d, PKHG, 
-#           Valter, ...
-#  Other: Frank Palmino
-#
-
-bl_info = {
-    "name": "Atomic Blender - Utilities",
-    "description": "Utilities for manipulating atom structures",
-    "author": "Clemens Barth",
-    "version": (0, 6),
-    "blender": (2, 60, 0),
-    "location": "Panel: View 3D - Tools",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/"
-                "Py/Scripts/Import-Export/PDB",
-    "tracker_url": "http://projects.blender.org/tracker/"
-                   "index.php?func=detail&aid=33071&group_id=153&atid=467",
-    "category": "Import-Export"
-}
-
-import bpy
-from bpy.types import Operator, Panel
-from bpy.props import (StringProperty,
-                       EnumProperty,
-                       FloatProperty)
-
-from . import io_atomblend_utilities
-
-# -----------------------------------------------------------------------------
-#                                                                           GUI
-
-# The panel.
-class PreparePanel(Panel):
-    bl_label       = "Atomic Blender Utilities"
-    bl_space_type  = "VIEW_3D"
-    bl_region_type = "TOOL_PROPS"
-
-    def draw(self, context):
-        layout = self.layout
-        scn    = context.scene.atom_blend
-
-        row = layout.row()
-        box = layout.box()
-        row = box.row()
-        row.label(text="Custom data file")
-        row = box.row()
-        col = row.column()
-        col.prop(scn, "datafile")
-        col.operator("atom_blend.datafile_apply")
-        row = box.row()
-        row.operator("atom_blend.button_distance")
-        row.prop(scn, "distance")
-        row = layout.row()
-        row.label(text="Choice of atom radii")
-        box = layout.box()
-        row = box.row()
-        row.label(text="All changes concern:")
-        row = box.row()
-        row.prop(scn, "radius_how")
-        row = box.row()
-        row.label(text="1. Change type of radii")
-        row = box.row()
-        row.prop(scn, "radius_type")
-        row = box.row()
-        row.active = (scn.radius_type == '3')
-        row.prop(scn, "radius_type_ionic")
-        row = box.row()
-        row.label(text="2. Change atom radii in pm")
-        row = box.row()
-        row.prop(scn, "radius_pm_name")
-        row = box.row()
-        row.prop(scn, "radius_pm")
-        row = box.row()
-        row.label(text="3. Change atom radii by scale")
-        row = box.row()
-        col = row.column()
-        col.prop(scn, "radius_all")
-        col = row.column(align=True)
-        col.operator( "atom_blend.radius_all_bigger" )
-        col.operator( "atom_blend.radius_all_smaller" )
-
-        layout.separator()
-        row = box.row()
-        row.active = (bpy.context.mode == 'EDIT_MESH')
-        row.operator( "atom_blend.separate_atom" )
-
-
-# The properties of buttons etc. in the panel.
-class PanelProperties(bpy.types.PropertyGroup):
-
-    def Callback_radius_type(self, context):
-        scn = bpy.context.scene.atom_blend
-        io_atomblend_utilities.choose_objects("radius_type", 
-                                              scn.radius_how, 
-                                              None,
-                                              None,
-                                              scn.radius_type,
-                                              scn.radius_type_ionic) 
-    def Callback_radius_pm(self, context):
-        scn = bpy.context.scene.atom_blend
-        io_atomblend_utilities.choose_objects("radius_pm", 
-                                              scn.radius_how, 
-                                              None,
-                                              [scn.radius_pm_name,
-                                              scn.radius_pm],
-                                              None,
-                                              None) 
-        
-    datafile = StringProperty(
-        name = "", description="Path to your custom data file",
-        maxlen = 256, default = "", subtype='FILE_PATH')
-    XYZ_file = StringProperty(
-        name = "Path to file", default="",
-        description = "Path of the XYZ file")
-    number_atoms = StringProperty(name="",
-        default="Number", description = "This output shows "
-        "the number of atoms which have been loaded")
-    distance = StringProperty(
-        name="", default="Distance (A)",
-        description="Distance of 2 objects in Angstrom")
-    radius_how = EnumProperty(
-        name="",
-        description="Which objects shall be modified?",
-        items=(('ALL_ACTIVE',"all active objects", "in the current layer"),
-               ('ALL_IN_LAYER',"all"," in active layer(s)")),
-               default='ALL_ACTIVE',)
-    radius_type = EnumProperty(
-        name="Type of radius",
-        description="Which type of atom radii?",
-        items=(('0',"predefined", "Use pre-defined radii"),
-               ('1',"atomic", "Use atomic radii"),
-               ('2',"van der Waals","Use van der Waals radii"),
-               ('3',"ionic radii", "Use ionic radii")),
-               default='0',update=Callback_radius_type)
-    radius_type_ionic = EnumProperty(
-        name="Charge state",
-        description="Charge state of the ions if existing.",
-        items=(('0',"-4", "Charge state -4"),
-               ('1',"-3", "Charge state -3"),
-               ('2',"-2", "Charge state -2"),
-               ('3',"-1", "Charge state -1"),
-               ('5',"+1", "Charge state +1"),
-               ('6',"+2", "Charge state +2"),
-               ('7',"+3", "Charge state +3"),
-               ('8',"+4", "Charge state +4"),
-               ('9',"+5", "Charge state +5"),
-               ('10',"+6", "Charge state +6"),
-               ('11',"+7", "Charge state +7")),
-               default='3',update=Callback_radius_type)           
-    radius_pm_name = StringProperty(
-        name="", default="Atom name",
-        description="Put in the name of the atom (e.g. Hydrogen)")
-    radius_pm = FloatProperty(
-        name="", default=100.0, min=0.0,
-        description="Put in the radius of the atom (in pm)",
-        update=Callback_radius_pm)
-    radius_all = FloatProperty(
-        name="Scale", default = 1.05, min=1.0, max=5.0,
-        description="Put in the scale factor")
-
-
-
-# Button loading a custom data file
-class DatafileApply(Operator):
-    bl_idname = "atom_blend.datafile_apply"
-    bl_label = "Apply"
-    bl_description = "Use color and radii values stored in the custom file"
-
-    def execute(self, context):
-        scn = bpy.context.scene.atom_blend
-
-        if scn.datafile == "":
-            return {'FINISHED'}
-
-        io_atomblend_utilities.custom_datafile(scn.datafile)
-        io_atomblend_utilities.custom_datafile_change_atom_props()
-
-        return {'FINISHED'}
-
-
-# Button for separating a single atom from a structure
-class SeparateAtom(Operator):
-    bl_idname = "atom_blend.separate_atom"
-    bl_label = "Separate atoms"
-    bl_description = ("Separate atoms you have selected. "
-                      "You have to be in the 'Edit Mode'")
-
-    def execute(self, context):
-        scn = bpy.context.scene.atom_blend
-
-        io_atomblend_utilities.separate_atoms(scn)
-
-        return {'FINISHED'}
-
-
-# Button for measuring the distance of the active objects
-class DistanceButton(Operator):
-    bl_idname = "atom_blend.button_distance"
-    bl_label = "Measure ..."
-    bl_description = "Measure the distance between two objects"
-
-    def execute(self, context):
-        scn  = bpy.context.scene.atom_blend
-        dist = io_atomblend_utilities.distance()
-
-        # Put the distance into the string of the output field.
-        scn.distance = dist
-        return {'FINISHED'}
-
-
-# Button for increasing the radii of all atoms
-class RadiusAllBiggerButton(Operator):
-    bl_idname = "atom_blend.radius_all_bigger"
-    bl_label = "Bigger ..."
-    bl_description = "Increase the radii of the atoms"
-
-    def execute(self, context):
-        scn = bpy.context.scene.atom_blend     
-        io_atomblend_utilities.choose_objects("radius_all", 
-                                              scn.radius_how, 
-                                              scn.radius_all, 
-                                              None,
-                                              None)        
-        return {'FINISHED'}
-
-
-# Button for decreasing the radii of all atoms
-class RadiusAllSmallerButton(Operator):
-    bl_idname = "atom_blend.radius_all_smaller"
-    bl_label = "Smaller ..."
-    bl_description = "Decrease the radii of the atoms"
-
-    def execute(self, context):
-        scn = bpy.context.scene.atom_blend
-        io_atomblend_utilities.choose_objects("radius_all", 
-                                              scn.radius_how, 
-                                              1.0/scn.radius_all, 
-                                              None,
-                                              None)                                     
-        return {'FINISHED'}
-
-
-def register():
-    io_atomblend_utilities.read_elements()  
-    bpy.utils.register_module(__name__)
-    bpy.types.Scene.atom_blend = bpy.props.PointerProperty(type=
-                                                   PanelProperties)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-
-if __name__ == "__main__":
-
-    register()
diff --git a/release/scripts/addons_contrib/io_atomblend_utilities/io_atomblend_utilities.py b/release/scripts/addons_contrib/io_atomblend_utilities/io_atomblend_utilities.py
deleted file mode 100644
index 277338e..0000000
--- a/release/scripts/addons_contrib/io_atomblend_utilities/io_atomblend_utilities.py
+++ /dev/null
@@ -1,487 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import os
-import bpy
-import bmesh
-
-# -----------------------------------------------------------------------------
-#                                                         Atom and element data
-
-
-# This is a list that contains some data of all possible elements. The structure
-# is as follows:
-#
-# 1, "Hydrogen", "H", [0.0,0.0,1.0], 0.32, 0.32, 0.32 , -1 , 1.54   means
-#
-# No., name, short name, color, radius (used), radius (covalent), radius (atomic),
-#
-# charge state 1, radius (ionic) 1, charge state 2, radius (ionic) 2, ... all
-# charge states for any atom are listed, if existing.
-# The list is fixed and cannot be changed ... (see below)
-
-ELEMENTS_DEFAULT = (
-( 1,      "Hydrogen",        "H", (  1.0,   1.0,   1.0), 0.32, 0.32, 0.79 , -1 , 1.54 ),
-( 2,        "Helium",       "He", ( 0.85,   1.0,   1.0), 0.93, 0.93, 0.49 ),
-( 3,       "Lithium",       "Li", (  0.8,  0.50,   1.0), 1.23, 1.23, 2.05 ,  1 , 0.68 ),
-( 4,     "Beryllium",       "Be", ( 0.76,   1.0,   0.0), 0.90, 0.90, 1.40 ,  1 , 0.44 ,  2 , 0.35 ),
-( 5,         "Boron",        "B", (  1.0,  0.70,  0.70), 0.82, 0.82, 1.17 ,  1 , 0.35 ,  3 , 0.23 ),
-( 6,        "Carbon",        "C", ( 0.56,  0.56,  0.56), 0.77, 0.77, 0.91 , -4 , 2.60 ,  4 , 0.16 ),
-( 7,      "Nitrogen",        "N", ( 0.18,  0.31,  0.97), 0.75, 0.75, 0.75 , -3 , 1.71 ,  1 , 0.25 ,  3 , 0.16 ,  5 , 0.13 ),
-( 8,        "Oxygen",        "O", (  1.0,  0.05,  0.05), 0.73, 0.73, 0.65 , -2 , 1.32 , -1 , 1.76 ,  1 , 0.22 ,  6 , 0.09 ),
-( 9,      "Fluorine",        "F", ( 0.56,  0.87,  0.31), 0.72, 0.72, 0.57 , -1 , 1.33 ,  7 , 0.08 ),
-(10,          "Neon",       "Ne", ( 0.70,  0.89,  0.96), 0.71, 0.71, 0.51 ,  1 , 1.12 ),
-(11,        "Sodium",       "Na", ( 0.67,  0.36,  0.94), 1.54, 1.54, 2.23 ,  1 , 0.97 ),
-(12,     "Magnesium",       "Mg", ( 0.54,   1.0,   0.0), 1.36, 1.36, 1.72 ,  1 , 0.82 ,  2 , 0.66 ),
-(13,     "Aluminium",       "Al", ( 0.74,  0.65,  0.65), 1.18, 1.18, 1.82 ,  3 , 0.51 ),
-(14,       "Silicon",       "Si", ( 0.94,  0.78,  0.62), 1.11, 1.11, 1.46 , -4 , 2.71 , -1 , 3.84 ,  1 , 0.65 ,  4 , 0.42 ),
-(15,    "Phosphorus",        "P", (  1.0,  0.50,   0.0), 1.06, 1.06, 1.23 , -3 , 2.12 ,  3 , 0.44 ,  5 , 0.35 ),
-(16,        "Sulfur",        "S", (  1.0,   1.0,  0.18), 1.02, 1.02, 1.09 , -2 , 1.84 ,  2 , 2.19 ,  4 , 0.37 ,  6 , 0.30 ),
-(17,      "Chlorine",       "Cl", ( 0.12,  0.94,  0.12), 0.99, 0.99, 0.97 , -1 , 1.81 ,  5 , 0.34 ,  7 , 0.27 ),
-(18,         "Argon",       "Ar", ( 0.50,  0.81,  0.89), 0.98, 0.98, 0.88 ,  1 , 1.54 ),
-(19,     "Potassium",        "K", ( 0.56,  0.25,  0.83), 2.03, 2.03, 2.77 ,  1 , 0.81 ),
-(20,       "Calcium",       "Ca", ( 0.23,   1.0,   0.0), 1.74, 1.74, 2.23 ,  1 , 1.18 ,  2 , 0.99 ),
-(21,      "Scandium",       "Sc", ( 0.90,  0.90,  0.90), 1.44, 1.44, 2.09 ,  3 , 0.73 ),
-(22,      "Titanium",       "Ti", ( 0.74,  0.76,  0.78), 1.32, 1.32, 2.00 ,  1 , 0.96 ,  2 , 0.94 ,  3 , 0.76 ,  4 , 0.68 ),
-(23,      "Vanadium",        "V", ( 0.65,  0.65,  0.67), 1.22, 1.22, 1.92 ,  2 , 0.88 ,  3 , 0.74 ,  4 , 0.63 ,  5 , 0.59 ),
-(24,      "Chromium",       "Cr", ( 0.54,   0.6,  0.78), 1.18, 1.18, 1.85 ,  1 , 0.81 ,  2 , 0.89 ,  3 , 0.63 ,  6 , 0.52 ),
-(25,     "Manganese",       "Mn", ( 0.61,  0.47,  0.78), 1.17, 1.17, 1.79 ,  2 , 0.80 ,  3 , 0.66 ,  4 , 0.60 ,  7 , 0.46 ),
-(26,          "Iron",       "Fe", ( 0.87,   0.4,   0.2), 1.17, 1.17, 1.72 ,  2 , 0.74 ,  3 , 0.64 ),
-(27,        "Cobalt",       "Co", ( 0.94,  0.56,  0.62), 1.16, 1.16, 1.67 ,  2 , 0.72 ,  3 , 0.63 ),
-(28,        "Nickel",       "Ni", ( 0.31,  0.81,  0.31), 1.15, 1.15, 1.62 ,  2 , 0.69 ),
-(29,        "Copper",       "Cu", ( 0.78,  0.50,   0.2), 1.17, 1.17, 1.57 ,  1 , 0.96 ,  2 , 0.72 ),
-(30,          "Zinc",       "Zn", ( 0.49,  0.50,  0.69), 1.25, 1.25, 1.53 ,  1 , 0.88 ,  2 , 0.74 ),
-(31,       "Gallium",       "Ga", ( 0.76,  0.56,  0.56), 1.26, 1.26, 1.81 ,  1 , 0.81 ,  3 , 0.62 ),
-(32,     "Germanium",       "Ge", (  0.4,  0.56,  0.56), 1.22, 1.22, 1.52 , -4 , 2.72 ,  2 , 0.73 ,  4 , 0.53 ),
-(33,       "Arsenic",       "As", ( 0.74,  0.50,  0.89), 1.20, 1.20, 1.33 , -3 , 2.22 ,  3 , 0.58 ,  5 , 0.46 ),
-(34,      "Selenium",       "Se", (  1.0,  0.63,   0.0), 1.16, 1.16, 1.22 , -2 , 1.91 , -1 , 2.32 ,  1 , 0.66 ,  4 , 0.50 ,  6 , 0.42 ),
-(35,       "Bromine",       "Br", ( 0.65,  0.16,  0.16), 1.14, 1.14, 1.12 , -1 , 1.96 ,  5 , 0.47 ,  7 , 0.39 ),
-(36,       "Krypton",       "Kr", ( 0.36,  0.72,  0.81), 1.31, 1.31, 1.24 ),
-(37,      "Rubidium",       "Rb", ( 0.43,  0.18,  0.69), 2.16, 2.16, 2.98 ,  1 , 1.47 ),
-(38,     "Strontium",       "Sr", (  0.0,   1.0,   0.0), 1.91, 1.91, 2.45 ,  2 , 1.12 ),
-(39,       "Yttrium",        "Y", ( 0.58,   1.0,   1.0), 1.62, 1.62, 2.27 ,  3 , 0.89 ),
-(40,     "Zirconium",       "Zr", ( 0.58,  0.87,  0.87), 1.45, 1.45, 2.16 ,  1 , 1.09 ,  4 , 0.79 ),
-(41,       "Niobium",       "Nb", ( 0.45,  0.76,  0.78), 1.34, 1.34, 2.08 ,  1 , 1.00 ,  4 , 0.74 ,  5 , 0.69 ),
-(42,    "Molybdenum",       "Mo", ( 0.32,  0.70,  0.70), 1.30, 1.30, 2.01 ,  1 , 0.93 ,  4 , 0.70 ,  6 , 0.62 ),
-(43,    "Technetium",       "Tc", ( 0.23,  0.61,  0.61), 1.27, 1.27, 1.95 ,  7 , 0.97 ),
-(44,     "Ruthenium",       "Ru", ( 0.14,  0.56,  0.56), 1.25, 1.25, 1.89 ,  4 , 0.67 ),
-(45,       "Rhodium",       "Rh", ( 0.03,  0.49,  0.54), 1.25, 1.25, 1.83 ,  3 , 0.68 ),
-(46,     "Palladium",       "Pd", (  0.0,  0.41,  0.52), 1.28, 1.28, 1.79 ,  2 , 0.80 ,  4 , 0.65 ),
-(47,        "Silver",       "Ag", ( 0.75,  0.75,  0.75), 1.34, 1.34, 1.75 ,  1 , 1.26 ,  2 , 0.89 ),
-(48,       "Cadmium",       "Cd", (  1.0,  0.85,  0.56), 1.48, 1.48, 1.71 ,  1 , 1.14 ,  2 , 0.97 ),
-(49,        "Indium",       "In", ( 0.65,  0.45,  0.45), 1.44, 1.44, 2.00 ,  3 , 0.81 ),
-(50,           "Tin",       "Sn", (  0.4,  0.50,  0.50), 1.41, 1.41, 1.72 , -4 , 2.94 , -1 , 3.70 ,  2 , 0.93 ,  4 , 0.71 ),
-(51,      "Antimony",       "Sb", ( 0.61,  0.38,  0.70), 1.40, 1.40, 1.53 , -3 , 2.45 ,  3 , 0.76 ,  5 , 0.62 ),
-(52,     "Tellurium",       "Te", ( 0.83,  0.47,   0.0), 1.36, 1.36, 1.42 , -2 , 2.11 , -1 , 2.50 ,  1 , 0.82 ,  4 , 0.70 ,  6 , 0.56 ),
-(53,        "Iodine",        "I", ( 0.58,   0.0,  0.58), 1.33, 1.33, 1.32 , -1 , 2.20 ,  5 , 0.62 ,  7 , 0.50 ),
-(54,         "Xenon",       "Xe", ( 0.25,  0.61,  0.69), 1.31, 1.31, 1.24 ),
-(55,       "Caesium",       "Cs", ( 0.34,  0.09,  0.56), 2.35, 2.35, 3.35 ,  1 , 1.67 ),
-(56,        "Barium",       "Ba", (  0.0,  0.78,   0.0), 1.98, 1.98, 2.78 ,  1 , 1.53 ,  2 , 1.34 ),
-(57,     "Lanthanum",       "La", ( 0.43,  0.83,   1.0), 1.69, 1.69, 2.74 ,  1 , 1.39 ,  3 , 1.06 ),
-(58,        "Cerium",       "Ce", (  1.0,   1.0,  0.78), 1.65, 1.65, 2.70 ,  1 , 1.27 ,  3 , 1.03 ,  4 , 0.92 ),
-(59,  "Praseodymium",       "Pr", ( 0.85,   1.0,  0.78), 1.65, 1.65, 2.67 ,  3 , 1.01 ,  4 , 0.90 ),
-(60,     "Neodymium",       "Nd", ( 0.78,   1.0,  0.78), 1.64, 1.64, 2.64 ,  3 , 0.99 ),
-(61,    "Promethium",       "Pm", ( 0.63,   1.0,  0.78), 1.63, 1.63, 2.62 ,  3 , 0.97 ),
-(62,      "Samarium",       "Sm", ( 0.56,   1.0,  0.78), 1.62, 1.62, 2.59 ,  3 , 0.96 ),
-(63,      "Europium",       "Eu", ( 0.38,   1.0,  0.78), 1.85, 1.85, 2.56 ,  2 , 1.09 ,  3 , 0.95 ),
-(64,    "Gadolinium",       "Gd", ( 0.27,   1.0,  0.78), 1.61, 1.61, 2.54 ,  3 , 0.93 ),
-(65,       "Terbium",       "Tb", ( 0.18,   1.0,  0.78), 1.59, 1.59, 2.51 ,  3 , 0.92 ,  4 , 0.84 ),
-(66,    "Dysprosium",       "Dy", ( 0.12,   1.0,  0.78), 1.59, 1.59, 2.49 ,  3 , 0.90 ),
-(67,       "Holmium",       "Ho", (  0.0,   1.0,  0.61), 1.58, 1.58, 2.47 ,  3 , 0.89 ),
-(68,        "Erbium",       "Er", (  0.0,  0.90,  0.45), 1.57, 1.57, 2.45 ,  3 , 0.88 ),
-(69,       "Thulium",       "Tm", (  0.0,  0.83,  0.32), 1.56, 1.56, 2.42 ,  3 , 0.87 ),
-(70,     "Ytterbium",       "Yb", (  0.0,  0.74,  0.21), 1.74, 1.74, 2.40 ,  2 , 0.93 ,  3 , 0.85 ),
-(71,      "Lutetium",       "Lu", (  0.0,  0.67,  0.14), 1.56, 1.56, 2.25 ,  3 , 0.85 ),
-(72,       "Hafnium",       "Hf", ( 0.30,  0.76,   1.0), 1.44, 1.44, 2.16 ,  4 , 0.78 ),
-(73,      "Tantalum",       "Ta", ( 0.30,  0.65,   1.0), 1.34, 1.34, 2.09 ,  5 , 0.68 ),
-(74,      "Tungsten",        "W", ( 0.12,  0.58,  0.83), 1.30, 1.30, 2.02 ,  4 , 0.70 ,  6 , 0.62 ),
-(75,       "Rhenium",       "Re", ( 0.14,  0.49,  0.67), 1.28, 1.28, 1.97 ,  4 , 0.72 ,  7 , 0.56 ),
-(76,        "Osmium",       "Os", ( 0.14,   0.4,  0.58), 1.26, 1.26, 1.92 ,  4 , 0.88 ,  6 , 0.69 ),
-(77,       "Iridium",       "Ir", ( 0.09,  0.32,  0.52), 1.27, 1.27, 1.87 ,  4 , 0.68 ),
-(78,     "Platinium",       "Pt", ( 0.81,  0.81,  0.87), 1.30, 1.30, 1.83 ,  2 , 0.80 ,  4 , 0.65 ),
-(79,          "Gold",       "Au", (  1.0,  0.81,  0.13), 1.34, 1.34, 1.79 ,  1 , 1.37 ,  3 , 0.85 ),
-(80,       "Mercury",       "Hg", ( 0.72,  0.72,  0.81), 1.49, 1.49, 1.76 ,  1 , 1.27 ,  2 , 1.10 ),
-(81,      "Thallium",       "Tl", ( 0.65,  0.32,  0.30), 1.48, 1.48, 2.08 ,  1 , 1.47 ,  3 , 0.95 ),
-(82,          "Lead",       "Pb", ( 0.34,  0.34,  0.38), 1.47, 1.47, 1.81 ,  2 , 1.20 ,  4 , 0.84 ),
-(83,       "Bismuth",       "Bi", ( 0.61,  0.30,  0.70), 1.46, 1.46, 1.63 ,  1 , 0.98 ,  3 , 0.96 ,  5 , 0.74 ),
-(84,      "Polonium",       "Po", ( 0.67,  0.36,   0.0), 1.46, 1.46, 1.53 ,  6 , 0.67 ),
-(85,      "Astatine",       "At", ( 0.45,  0.30,  0.27), 1.45, 1.45, 1.43 , -3 , 2.22 ,  3 , 0.85 ,  5 , 0.46 ),
-(86,         "Radon",       "Rn", ( 0.25,  0.50,  0.58), 1.00, 1.00, 1.34 ),
-(87,      "Francium",       "Fr", ( 0.25,   0.0,   0.4), 1.00, 1.00, 1.00 ,  1 , 1.80 ),
-(88,        "Radium",       "Ra", (  0.0,  0.49,   0.0), 1.00, 1.00, 1.00 ,  2 , 1.43 ),
-(89,      "Actinium",       "Ac", ( 0.43,  0.67,  0.98), 1.00, 1.00, 1.00 ,  3 , 1.18 ),
-(90,       "Thorium",       "Th", (  0.0,  0.72,   1.0), 1.65, 1.65, 1.00 ,  4 , 1.02 ),
-(91,  "Protactinium",       "Pa", (  0.0,  0.63,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.13 ,  4 , 0.98 ,  5 , 0.89 ),
-(92,       "Uranium",        "U", (  0.0,  0.56,   1.0), 1.42, 1.42, 1.00 ,  4 , 0.97 ,  6 , 0.80 ),
-(93,     "Neptunium",       "Np", (  0.0,  0.50,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.10 ,  4 , 0.95 ,  7 , 0.71 ),
-(94,     "Plutonium",       "Pu", (  0.0,  0.41,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.08 ,  4 , 0.93 ),
-(95,     "Americium",       "Am", ( 0.32,  0.36,  0.94), 1.00, 1.00, 1.00 ,  3 , 1.07 ,  4 , 0.92 ),
-(96,        "Curium",       "Cm", ( 0.47,  0.36,  0.89), 1.00, 1.00, 1.00 ),
-(97,     "Berkelium",       "Bk", ( 0.54,  0.30,  0.89), 1.00, 1.00, 1.00 ),
-(98,   "Californium",       "Cf", ( 0.63,  0.21,  0.83), 1.00, 1.00, 1.00 ),
-(99,   "Einsteinium",       "Es", ( 0.70,  0.12,  0.83), 1.00, 1.00, 1.00 ),
-(100,       "Fermium",       "Fm", ( 0.70,  0.12,  0.72), 1.00, 1.00, 1.00 ),
-(101,   "Mendelevium",       "Md", ( 0.70,  0.05,  0.65), 1.00, 1.00, 1.00 ),
-(102,      "Nobelium",       "No", ( 0.74,  0.05,  0.52), 1.00, 1.00, 1.00 ),
-(103,    "Lawrencium",       "Lr", ( 0.78,   0.0,   0.4), 1.00, 1.00, 1.00 ),
-(104,       "Vacancy",      "Vac", (  0.5,   0.5,   0.5), 1.00, 1.00, 1.00),
-(105,       "Default",  "Default", (  1.0,   1.0,   1.0), 1.00, 1.00, 1.00),
-(106,         "Stick",    "Stick", (  0.5,   0.5,   0.5), 1.00, 1.00, 1.00),
-)
-
-# The list 'ELEMENTS' contains all data of the elements and will be used during
-# runtime. The list will be initialized with the fixed
-# data from above via the class below (ElementProp). One fixed list (above), 
-# which cannot be changed, and a list of classes with same data (ELEMENTS) exist.
-# The list 'ELEMENTS' can be modified by e.g. loading a separate custom
-# data file.
-ELEMENTS = []
-
-# This is the class, which stores the properties for one element.
-class ElementProp(object):
-    __slots__ = ('number', 'name', 'short_name', 'color', 'radii', 'radii_ionic')
-    def __init__(self, number, name, short_name, color, radii, radii_ionic):
-        self.number = number
-        self.name = name
-        self.short_name = short_name
-        self.color = color
-        self.radii = radii
-        self.radii_ionic = radii_ionic
-
-
-# This function measures the distance between two objects (atoms),
-# which are active.
-def distance():
-
-    # In the 'Edit mode'
-    if bpy.context.mode == 'EDIT_MESH':
-
-        obj = bpy.context.edit_object
-        bm = bmesh.from_edit_mesh(obj.data)
-        locations = []
-
-        for v in bm.verts:
-            if v.select:
-                locations.append(obj.matrix_world * v.co)
-                
-        if len(locations) > 1:
-            location1 = locations[0]
-            location2 = locations[1]        
-        else:
-            return "N.A"
-    # In the object mode
-    else:
-
-        if len(bpy.context.selected_bases) > 1:
-            location1 = bpy.context.selected_objects[0].location
-            location2 = bpy.context.selected_objects[1].location
-        else:
-            return "N.A."
-
-    dv = location2 - location1
-    dist = str(dv.length)
-    pos = str.find(dist, ".")
-    dist = dist[:pos+4]
-    dist = dist + " A"
-  
-    return dist
-
-
-def choose_objects(how, 
-                   who, 
-                   radius_all, 
-                   radius_pm, 
-                   radius_type, 
-                   radius_type_ionic):
-
-    if who == "ALL_IN_LAYER":
-
-        # Determine all selected layers.
-        layers = []
-        for i, layer in enumerate(bpy.context.scene.layers):
-            if layer == True:
-                layers.append(i)
-                
-        # Put all objects, which are in the layers, into a list.
-        change_objects = []
-        for obj in bpy.context.scene.objects:
-            for layer in layers:
-                if obj.layers[layer] == True:
-                    change_objects.append(obj)
-                    
-        # Consider all objects, which are in the list 'change_objects'.
-        for obj in change_objects:
-            if len(obj.children) != 0:
-                if obj.children[0].type in {'SURFACE', 'MESH', 'META'}:
-                    modify_objects(how, 
-                                   obj.children[0],
-                                   radius_all, 
-                                   radius_pm, 
-                                   radius_type,
-                                   radius_type_ionic)
-            else:
-                if obj.type in {'SURFACE', 'MESH', 'META'}:
-                    modify_objects(how, 
-                                   obj,  
-                                   radius_all, 
-                                   radius_pm, 
-                                   radius_type,
-                                   radius_type_ionic)
-    if who == "ALL_ACTIVE":
-        for obj in bpy.context.selected_objects:
-            if len(obj.children) != 0:
-                if obj.children[0].type in {'SURFACE', 'MESH', 'META'}:
-                    modify_objects(how, 
-                                   obj.children[0],
-                                   radius_all, 
-                                   radius_pm, 
-                                   radius_type,
-                                   radius_type_ionic)
-            else:
-                if obj.type in {'SURFACE', 'MESH', 'META'}:
-                    modify_objects(how, 
-                                   obj,
-                                   radius_all, 
-                                   radius_pm, 
-                                   radius_type,
-                                   radius_type_ionic)
-
-
-
-# Modifying the radii in picometer of a specific type of atom
-def modify_objects(how, 
-                   obj, 
-                   radius_all, 
-                   radius_pm, 
-                   radius_type, 
-                   radius_type_ionic):
-
-    # Radius pm 
-    if how == "radius_pm":
-        if radius_pm[0] in obj.name:
-            obj.scale = (radius_pm[1]/100,) * 3
-            
-    # Radius all 
-    if how == "radius_all":
-        obj.scale *= radius_all      
-              
-    # Radius type 
-    if how == "radius_type":
-        for element in ELEMENTS:                
-            if element.name in obj.name:
-                # For ionic radii
-                if radius_type == '3':
-                    charge_states = element.radii_ionic[::2]
-                    charge_radii =  element.radii_ionic[1::2]
-                    charge_state_chosen = int(radius_type_ionic) - 4
-                    
-                    find = (lambda searchList, elem: 
-                            [[i for i, x in enumerate(searchList) if x == e] 
-                            for e in elem])
-                    index = find(charge_states,[charge_state_chosen])[0]
-
-                    # Is there a charge state?                    
-                    if index != []:
-                        #print(element.name, index[0], charge_radii[index[0]])
-                        obj.scale = (charge_radii[index[0]],) * 3
-                                            
-                # For atomic and van der Waals radii.
-                else:        
-                    obj.scale = (element.radii[int(radius_type)],) * 3
-
-
-# Initialization of the list 'ELEMENTS'.
-def read_elements():
-
-    del ELEMENTS[:]
-
-    for item in ELEMENTS_DEFAULT:
-
-        # All three radii into a list
-        radii = [item[4],item[5],item[6]]
-        # The handling of the ionic radii will be done later. So far, it is an
-        # empty list.
-        radii_ionic = item[7:]
-        
-        li = ElementProp(item[0],item[1],item[2],item[3],
-                                     radii,radii_ionic)
-        ELEMENTS.append(li)
-
-
-# Changing color and radii by using the list of elements.
-def custom_datafile_change_atom_props():
-
-    for obj in bpy.context.selected_objects:
-        if len(obj.children) != 0:
-            child = obj.children[0]
-            if child.type in {'SURFACE', 'MESH', 'META'}:
-                for element in ELEMENTS:
-                    if element.name in obj.name:
-                        child.scale = (element.radii[0],) * 3
-                        child.active_material.diffuse_color = element.color
-        else:
-            if obj.type in {'SURFACE', 'MESH', 'META'}:
-                for element in ELEMENTS:
-                    if element.name in obj.name:
-                        obj.scale = (element.radii[0],) * 3
-                        obj.active_material.diffuse_color = element.color
-
-
-# Reading a custom data file.
-def custom_datafile(path_datafile):
-
-    if path_datafile == "":
-        return False
-
-    path_datafile = bpy.path.abspath(path_datafile)
-
-    if os.path.isfile(path_datafile) == False:
-        return False
-
-    # The whole list gets deleted! We build it new.
-    del ELEMENTS[:]
-
-    # Read the data file, which contains all data
-    # (atom name, radii, colors, etc.)
-    data_file_p = open(path_datafile, "r")
-
-    for line in data_file_p:
-
-        if "Atom" in line:
-
-            line = data_file_p.readline()
-            # Number
-            line = data_file_p.readline()
-            number = line[19:-1]
-            # Name
-            line = data_file_p.readline()
-            name = line[19:-1]
-            # Short name
-            line = data_file_p.readline()
-            short_name = line[19:-1]
-            # Color
-            line = data_file_p.readline()
-            color_value = line[19:-1].split(',')
-            color = [float(color_value[0]),
-                     float(color_value[1]),
-                     float(color_value[2])]
-            # Used radius
-            line = data_file_p.readline()
-            radius_used = float(line[19:-1])
-            # Atomic radius
-            line = data_file_p.readline()
-            radius_atomic = float(line[19:-1])
-            # Van der Waals radius
-            line = data_file_p.readline()
-            radius_vdW = float(line[19:-1])
-            radii = [radius_used,radius_atomic,radius_vdW]
-            radii_ionic = []
-
-            element = ElementProp(number,name,short_name,color,
-                                              radii, radii_ionic)
-
-            ELEMENTS.append(element)
-
-    data_file_p.close()
-
-    return True
-
-
-# Separating atoms from a dupliverts strucutre.
-def separate_atoms(scn):
-
-    # Get first all important properties from the atoms, which the user
-    # has chosen: location, color, scale
-    obj = bpy.context.edit_object
-        
-    # Do nothing if it is not a dupliverts structure.
-    if not obj.dupli_type == "VERTS":
-       return {'FINISHED'}
-        
-    bm = bmesh.from_edit_mesh(obj.data)
-
-    locations = []
-
-    for v in bm.verts:
-        if v.select:
-            locations.append(obj.matrix_world * v.co)
-
-    bm.free()
-    del(bm)
-
-    name  = obj.name
-    scale = obj.children[0].scale
-    material = obj.children[0].active_material
-
-    # Separate the vertex from the main mesh and create a new mesh.
-    bpy.ops.mesh.separate()
-    new_object = bpy.context.scene.objects[0]
-    # And now, switch to the OBJECT mode such that we can ...
-    bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-    # ... delete the new mesh including the separated vertex
-    bpy.ops.object.select_all(action='DESELECT')
-    new_object.select = True
-    bpy.ops.object.delete()  
-
-    # Create new atoms/vacancies at the position of the old atoms
-    current_layers=bpy.context.scene.layers
-
-    # For all selected positions do:
-    for location in locations:
-        # For any ball do ...
-        if "Vacancy" not in name:
-            # NURBS ball
-            if obj.children[0].type == "SURFACE":
-                bpy.ops.surface.primitive_nurbs_surface_sphere_add(
-                                    view_align=False, enter_editmode=False,
-                                    location=location,
-                                    rotation=(0.0, 0.0, 0.0),
-                                    layers=current_layers)
-                # Mesh ball                    
-            elif obj.children[0].type == "MESH":
-                bpy.ops.mesh.primitive_uv_sphere_add(
-                                segments=32,
-                                ring_count=32,                    
-                                #segments=scn.mesh_azimuth,
-                                #ring_count=scn.mesh_zenith,
-                                size=1, view_align=False, enter_editmode=False,
-                                location=location,
-                                rotation=(0, 0, 0),
-                                layers=current_layers)
-                # Metaball
-            elif obj.children[0].type == "META":
-                bpy.ops.object.metaball_add(type='BALL', view_align=False, 
-                            enter_editmode=False, location=location, 
-                            rotation=(0, 0, 0), layers=current_layers)
-        # If it is a vacancy create a cube ...                    
-        else:
-            bpy.ops.mesh.primitive_cube_add(
-                           view_align=False, enter_editmode=False,
-                           location=location,
-                           rotation=(0.0, 0.0, 0.0),
-                           layers=current_layers)
-                               
-        new_atom = bpy.context.scene.objects.active
-        # Scale, material and name it.
-        new_atom.scale = scale
-        new_atom.active_material = material
-        new_atom.name = name + "_sep"
-        new_atom.select = True
-
-    bpy.context.scene.objects.active = obj
-    #bpy.ops.object.select_all(action='DESELECT')
diff --git a/release/scripts/addons_contrib/io_directx_bel/README b/release/scripts/addons_contrib/io_directx_bel/README
deleted file mode 100644
index 2867827..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/README
+++ /dev/null
@@ -1,266 +0,0 @@
-a DirectX importer addon for Blender 2.6
-
-first goals :
-
-. to import anything from an .x file.
-  obviously verts, faces but uv, armatures, weights, normals...
-. import .x in binary format too
-
-horizon :
-. export to .x or mod/co-maintain the existing x exporter.
-. this project is also a prototype for a 'Blender Exchange Layer' project.
-  BEL would be a common layer logically located between an importer/exporter
-  addon and the blender data format, that would allow :
-    . to provide a common set of methods to retrieve/inject objects in Blender
-    . to provide a common set of transformation and selection tools between an
-      import/export script and Blender datas (rotate, rescale, filters...)
-    . to provide a common set of parsing helpers for new io addons
-
-PLY won't be used unfortunately (it's way too slow as far as I tested)
-
-
-TO TEST THE SCRIPT :
-  . copy the 'io_directx_bel' in /scripts/addons or addons_contrib
-  . start blender
-  . enable then addon in  user prefs > addons
-  . run the script with file > import > directX
- 
-25/01/12 0.18
-  . code rewrite according to api bmesh changes (me.polygon and uv layers essentially)
-  . implemented foreachset() call for uv import (faster)
-  
-25/01/12 0.17
-  . faster, 60% faster in some case : various loops improvements, infile templates parsing disabled by default
-    saw another bottleneck about data chunks as string but will wait for binary support for better point of view.
-  . interface cosmetics
-    
-23/01/12 rc 0.16
-. committed to svn (and littleneo git as usual)
-. corrected a bug about referenced token parenting
-. corrected a bug about non parented meshes
-. armatures/empties importation enabled by default
-. last run importer options are saved in a 'last_run' preset,
-  so it can be replayed or saved under another name once a
-  particular .x profile has been defined
-. tagged script for 2.6.1
-
-12/01/12 rc 0.15 :)
-. name conversion changed from 5 to 4 digits
-. matname, imagename and texturename fixes :
-. a path test is made at image import time with any existing data images, 
-  so a same file cant be loaded twice wathever the naming method, / or \, rel or abs etc 
-  (bel.material.new() and after line 835)
-. image and texture names should be ok now (tested with : incrediblylongname.x)
-. materials are replaced accordingly in existing objs when using the 'replace' naming method
-. fyi, the Dx exporter has the following inconveniences :
-    . split linked faces into individual faces
-    . inversed uvmapping (y axis) ?
-    -> see testfiles/blender_x_export/incrediblylongname.x
-   
-29 and 31/12/11
-. Cosmetics, code cleaning and optimizations
-. bpy.ops.object.select_name methods replaced with
-    ob.select = True
-    bpy.context.scene.objects.active = ob
-. corrected a big bug about tokens info appending in dXtree()
-. new bpyname() method in bel module. removed bel.common
-
-26/12/11
-. armature import and bone max. length option
-
-23/11/11
-. contrib candidate :)
-. solved some naming cases, added bel methods.
-. added experimental option about parenting (no armature yet just empties, when needed)
-. a bit faster
-. added some test files (empty parenting, armature etc)
-
-22/11/11
-campbell feedback (cont):
-. added naming methods as options (default is blender name inc. if name exists)
-  me and ob remove() should be ok with special cases (empties, mesh with multi-users)
-. improved ui
-
-
-21/11/11
-campbell feedback :
-. converted immutables to tuples : templates_x.py and some other vars.
-  http://stackoverflow.com/questions/3340539/why-tuple-is-faster-than-list
-. dprint() (console debug) removed, replaced by a inloop tests (a bit faster)
-  I'd like to keep it for now for easier debug (eg user feedbacks with 'processing' option)
-  
-19/11/11
-. object parenting support. parsing the x tree from roots using import_dxtree()
-  actually faster than before
-  
-16/11/11
-. weight group import
-. improved ui a bit and console logs
-. x matrices to blender ones conversion
-
-14/11/11
-. global matrix options
-. added messy code about binary (not working)
-
-11/11/11
-. import materials and textures (basics) : uv and image mapped (multitex mode)
-  and material created with tex slot if any. alpha should be ok.. ?
-. added a smooth options
-. better tolerance with faulty .x (upper/lower case of template names)
-. token names length from x to blender conversion should be ok also (long name cases)
-. corrected a parser pointer error after one array parsing case.
-. added more templates (for mat and tex support)
-. removed texture files from repo in testfile (tex does not match meshes )
-  added some other x files for further tests in binary and compressed format
-  ( http://assimp.svn.sourceforge.net/viewvc/assimp/trunk/test/models/X/ )
-  
-08/11/11
-. turned into an addon (fork from obj import so unused functions atm)
-  enable it in addon, then file > import > directx
-. splitted directx parser (io_directx_bel folder) and bel draft 
-  the bel folder is intended to be located in /scripts/modules (shared components)
-  but it's ok in scripts/addons too (tbd)
-  bel folder (will) includes anything related to blender data helper (read/write)
-. corrected duplicated quotes for x string type
-
-07/11/11
-. uv import
-. generic directx token parser. templates items are used to read datas of any token type
-  a bit slower but cool since it should support non strict standard directx files
-  virtually it can retrieve everything from now supposing the template is know
-  by default or given in the file. calls are now like :
-		nbslots, mats = readToken('MeshMaterialList001') or
-		uv = readToken('uv001') or
-		nVerts, verts, nFaces, faces = readToken('Hydralisk_backbone1') etc
-. removed the specific mesh parser the 'rigid' file is the last before mutation to
-  generic parser. a bit faster but harder to make evolve or adapt. keep it as a faster
-  strict 'branch'
-. added some default templates
-  goals / wip :
-  . to compare template declaration in file and default one.
-    so either use the default one (strict) or the .x one (could differ)
-  . use by the generic data parser to avoid a parser for each kind of token
-. cleaner code (grouping methods, function names, docs etc) 
-  functions separated from calls
-  renamed token dict as tokens etc
-. added tweaks at the beginning of the file :
-	chunksize = 1024     # size of file streams red in a row
-	quickmode = False    # this to only find meshes (no parenting, no other tokens than Mesh ones)
-	showtree = False     # display the entire token tree in the console
-	showtemplate = True  # display template datas found in file
-. added a patch for malformed datas of vertices (meshFaces) :
-	# patch for malformed datas not completely clear yet ( I guess
-	# there's bunch of us when looking at meshface syntax in .x files) :
-	# when array members are like 3;v0,v1,v2;,
-	# and not like 3;v0;v1;v2;, depending on template declarations.
-	# http://paulbourke.net/dataformats/directx/#xfilefrm_Use_of_commas
-. the script now generates linked faces (was not my fault !)
-  > it seems Dx always separate each face :
-  so it defines (vert * linked faces) verts for one needed vert
-  the readvertices loop now remove duplicates at source
-  it uses a verts lookup list to redirect vert id defined in faces
-
-06/11/11
-. vertices and faces imported from each test files
-. added some info to test yourself in README 
-. switched to binary for .x as text to retrieve eol (pointer bugs). should be ok whatever it's win, mac or unix text format,
-  also works with mixed eol.
-  it seems python 3.1 can't return a 'line' when data.realine() when read mode is 'rb' (U default and universal ? really ? ;) ) 
-  when file has mac eol (\r)
-  -> read(1024) in binary, decode, and replace any \r with \n. yes, it doubles lines for windows and lines value is wrong for now
-  -> but the used pointer value is always ok now whatever the file format and still way faster than a data.tell()
-  see CRCF folder to compare output wispwind.x by format.
-. files are still splitted into chunks (1024 B) and readable as lines
-. references : added 'user' fields when token is used. users store a reference with their childs but with a '*' tag at chr0.
-  the tree reflects the changes
-. now read anything and add it to the 'tree'. this includes unknow tokens.
-. references are recognized. by reference I mean fields like { cube0 } rather than an inline frame cube0 {
-  declaration.
-  I don't know if one item can be referenced several time or referenced before declaration
-  should be.. waiting for a case. for now only one 'parent' token, messages will show up
-  multi references to one token if cases arise. 
-. more permissive syntax : 'frame spam{', 'frame     spam   egg{', 'frame spam egg  {'..
-. comments are recognized (inlines ones not done yet, since still no useful data red :) )
-. header is red
-. found other .x test files here :
-  http://www.xbdev.net/3dformats/x/xfileformat.php
-  created from 3ds max
-. added .x files in repo. line 70 and following to switch.
-. some token comes with no names, add a noname<00000> to them
-. console gives line number (more useful than char position I guess)
-
-
-05/11/11	day 0 :
-
-. made some disapointing test with ply (from a speed point of view, else it looks really cool)
-. made my own parser
-. nothing imported for now, it's more about self-eduction to .x and concept
-. but it reads the .x structure and can gather some info
-
-resource gathered :
-
-http://paulbourke.net/dataformats/directx/
-http://www.informikon.com/various/the-simplest-skeletal-animation-possible.html
-http://msdn.microsoft.com/en-us/library/windows/desktop/bb173011%28v=VS.85%29.aspx
-http://www.toymaker.info/Games/index.html
-
-
-
-step 1 : read main structure :
-
-    read main token names (any 'template', any 'frame', any 'mesh')
-    stores names in a token directory :
-        token['template'] for templates :
-            token['template'][templatename]
-            token['template'][templatename]['pointer']          (int) chr position in .x file (tell() like*)
-            token['template'][templatename]['line']             (int) line number in .x file
-        token['frame'] for frame and mesh type :
-            token['template'][frame or mesh name]
-            token['template'][frame or mesh name]['pointer']    (int) chr position in .x file (tell() like*)
-            token['template'][frame or mesh name]['line']       (int) line number in .x file
-            token['template'][frame or mesh name]['type']       (str) 'ob/bone' or 'mesh'
-            token['template'][frame or mesh name]['parent']     (str) frame parent of current item
-            token['template'][frame or mesh name]['childs']     (str list) list of child frame or mesh names
-            token['template'][frame or mesh name]['matrix']     (int) for now chr position of FrameTransformMatrix
-
-at the end of step 1 the script prints a tree of these datas
-
-step 2 : read template definitions :
-
-    for each template in dict, populate definitions in it.
-    it creates new fields in each token['template'][templatename]
-    according to values found in .x :
-        token['template'][templatename]['uuid']                 (str) <universally unique identifier>
-        token['template'][templatename]['members']['name']      (str) member name
-        token['template'][templatename]['members']['type']      (str) DWORD,FLOAT etc keywords or template name
-        token['template'][templatename]['restriction']          (str) 'open' , 'closed' , or the specidied (restricted) value
-
-that's all for now.
-
-idea would be to allow 2 steps importation and random access to file :
-
-    . first the file is quickly parsed. we only retrieve main info, nothing about verts, faces etc
-    info like number of mats, textures, objects/mesh/bone trees
-    for now : 150000 lines in 5 secs for step 1
-    . then user select what to import
-    . then the script retrieve selected datas according to selection, using the 'pointer' value
-      to seek() to the needed data, then grab/parse/translate in something usable.
-    . template are used at this point to know how to parse a specific part (adaptive parser)
-	  
-    so far this looks fast.
-	
-tested on windows. can be important because of eol and the code I wrote to compute pointer value.
-(data.tell() is slow)
-only one .x file tested, header is : xof 0303txt 0032 (windows \r\n eol)
-
-don't know a lot about .x format :
-
-uuid : 
-  are the member/restriction always the same for a same uuid/template ?
-  template name can vary for a same uuid ?
-syntax :
-  blank lines IN a stream of a {} section, after ; ?
-  comments // and # IN a stream of data ?
-  '{' and '<something>' and '}' on the same line or '{' '}' are always unique ?
-  
- 
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/io_directx_bel/__init__.py b/release/scripts/addons_contrib/io_directx_bel/__init__.py
deleted file mode 100644
index a2b5687..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/__init__.py
+++ /dev/null
@@ -1,296 +0,0 @@
-# Blender directX importer
-bl_info = {
-    "name": "DirectX Importer",
-    "description": "Import directX Model Format (.x)",
-    "author": "Littleneo (Jerome Mahieux)",
-    "version": (0, 18),
-    "blender": (2, 63, 0),
-    "api": 42615,
-    "location": "File > Import > DirectX (.x)",
-    "warning": "",
-    "wiki_url": "https://github.com/littleneo/directX_blender/wiki",
-    "tracker_url": "https://github.com/littleneo/directX_blender/issues",
-    "category": "Import-Export",
-    "dependencies": ""
-}
-
-if "bpy" in locals():
-    import imp
-    if "import_x" in locals():
-        imp.reload(import_x)
-    #if "export_x" in locals():
-    #    imp.reload(export_x)
-
-
-import bpy
-from bpy.props import (BoolProperty,
-                       FloatProperty,
-                       StringProperty,
-                       EnumProperty,
-                       )
-from bpy_extras.io_utils import (ExportHelper,
-                                 ImportHelper,
-                                 path_reference_mode,
-                                 axis_conversion,
-                                 )
-try : import bel
-except : import io_directx_bel.bel
-    
-class ImportX(bpy.types.Operator, ImportHelper):
-    '''Load a Direct x File'''
-    bl_idname = "import_scene.x"
-    bl_label = "Import X"
-    bl_options = {'PRESET', 'UNDO'}
-
-    filename_ext = ".x"
-    filter_glob = StringProperty(
-            default="*.x",
-            options={'HIDDEN'},
-            )
-    show_tree = BoolProperty(
-            name="Show x tokens tree",
-            description="display relationships between x items in the console",
-            default=False,
-            )
-    show_templates = BoolProperty(
-            name="Show x templates",
-            description="display templates defined in the .x file",
-            default=False,
-            )
-    show_geninfo = BoolProperty(
-            name="Show processing",
-            description="display details for each imported thing",
-            default=False,
-            )
-    
-    quickmode = BoolProperty(
-            name="Quick mode",
-            description="only retrieve mesh basics",
-            default=False,
-            )
-    
-    parented = BoolProperty(
-            name="Object Relationships",
-            description="import armatures, empties, rebuild parent-childs relations",
-            default=True,
-            )
-    
-    bone_maxlength = FloatProperty(
-            name="Bone length",
-            description="Bones max length",
-            min=0.1, max=10.0,
-            soft_min=0.1, soft_max=10.0,
-            default=1.0,
-            )
-    
-    chunksize = EnumProperty(
-            name="Chunksize",
-            items=(('0', "all", ""),
-                   ('4096', "4KB", ""),
-                   ('2048', "2KB", ""),
-                   ('1024', "1KB", ""),
-                   ),
-            default='2048',
-            description="number of bytes red in a row",
-            )
-    naming_method = EnumProperty(
-            name="Naming method",
-            items=(('0', "increment name if exists", "blender default"),
-                   ('1', "use existing", "this only append new elements"),
-                   ('2', "rename existing", "names are forced"),
-                   ('3', "replace existing", ""),
-                   ),
-            default='0',
-            description="behaviour when a name already exists in Blender Data",
-            )
-    use_ngons = BoolProperty(
-            name="NGons",
-            description="Import faces with more then 4 verts as fgons",
-            default=True,
-            )
-    use_edges = BoolProperty(
-            name="Lines",
-            description="Import lines and faces with 2 verts as edge",
-            default=True,
-            )
-    use_smooth_groups = BoolProperty(
-            name="Smooth Groups",
-            description="Surround smooth groups by sharp edges",
-            default=True,
-            )
-
-    use_split_objects = BoolProperty(
-            name="Object",
-            description="Import OBJ Objects into Blender Objects",
-            default=True,
-            )
-    use_split_groups = BoolProperty(
-            name="Group",
-            description="Import OBJ Groups into Blender Objects",
-            default=True,
-            )
-
-    use_groups_as_vgroups = BoolProperty(
-            name="Poly Groups",
-            description="Import OBJ groups as vertex groups",
-            default=False,
-            )
-
-    use_image_search = BoolProperty(
-            name="Image Search",
-            description="Search subdirs for any assosiated images " \
-                        "(Warning, may be slow)",
-            default=True,
-            )
-
-    split_mode = EnumProperty(
-            name="Split",
-            items=(('ON', "Split", "Split geometry, omits unused verts"),
-                   ('OFF', "Keep Vert Order", "Keep vertex order from file"),
-                   ),
-            )
-
-    global_clamp_size = FloatProperty(
-            name="Clamp Scale",
-            description="Clamp the size to this maximum (Zero to Disable)",
-            min=0.0, max=1000.0,
-            soft_min=0.0, soft_max=1000.0,
-            default=0.0,
-            )
-    
-    axis_forward = EnumProperty(
-            name="Forward",
-            items=(('X', "Left (x)", ""),
-                   ('Y', "Same (y)", ""),
-                   ('Z', "Bottom (z)", ""),
-                   ('-X', "Right (-x)", ""),
-                   ('-Y', "Back (-y)", ""),
-                   ('-Z', "Up (-z)", ""),
-                   ),
-            default='-Z',
-            )
-
-    axis_up = EnumProperty(
-            name="Up",
-            items=(('X', "Right (x)", ""),
-                   ('Y', "Back (y)", ""),
-                   ('Z', "Same (z)", ""),
-                   ('-X', "Left (-x)", ""),
-                   ('-Y', "Front (-y)", ""),
-                   ('-Z', "Bottom (-z)", ""),
-                   ),
-            default='Y',
-            )
-
-    def execute(self, context):
-        from . import import_x
-        if self.split_mode == 'OFF':
-            self.use_split_objects = False
-            self.use_split_groups = False
-        else:
-            self.use_groups_as_vgroups = False
-            
-        keywords = self.as_keywords(ignore=("axis_forward",
-                                            "axis_up",
-                                            "filter_glob",
-                                            "split_mode",
-                                            ))
-
-        keywords["naming_method"] = int(self.naming_method)
-        
-        global_matrix = axis_conversion(from_forward=self.axis_forward,
-                                        from_up=self.axis_up,
-                                        ).to_4x4()
-        keywords["global_matrix"] = global_matrix
-
-    
-        bel.fs.saveOptions(self,'import_scene.x', self.as_keywords(ignore=(
-                                            "filter_glob",
-                                            "filepath",
-                                            )))
-        return import_x.load(self, context, **keywords)
-
-    def draw(self, context):
-        layout = self.layout
-        
-        # import box
-        box = layout.box()
-        col = box.column(align=True)
-        col.label('Import Options :')  
-        col.prop(self, "chunksize")
-        col.prop(self, "use_smooth_groups")
-        actif = not(self.quickmode)
-        row = col.row()
-        row.enabled = actif
-        row.prop(self, "parented")
-        if self.parented :
-            row = col.row()
-            row.enabled = actif
-            row.prop(self, "bone_maxlength")      
-        col.prop(self, "quickmode")
-        
-        # source orientation box
-        box = layout.box()
-        col = box.column(align=True)
-        col.label('Source Orientation :')      
-        col.prop(self, "axis_forward")
-        col.prop(self, "axis_up")
-
-        # naming methods box
-        box = layout.box()
-        col = box.column(align=True)
-        col.label('Naming Method :')
-        col.props_enum(self,"naming_method")
-
-        # info/debug box
-        box = layout.box()
-        col = box.column(align=True)
-        col.label('Info / Debug :')
-        col.prop(self, "show_tree")
-        col.prop(self, "show_templates")
-        col.prop(self, "show_geninfo")
-        
-        #row = layout.row(align=True)
-        #row.prop(self, "use_ngons")
-        #row.prop(self, "use_edges")
-        
-        '''
-        box = layout.box()
-        row = box.row()
-        row.prop(self, "split_mode", expand=True)
-
-        row = box.row()
-        if self.split_mode == 'ON':
-            row.label(text="Split by:")
-            row.prop(self, "use_split_objects")
-            row.prop(self, "use_split_groups")
-        else:
-            row.prop(self, "use_groups_as_vgroups")
-
-        row = layout.split(percentage=0.67)
-        row.prop(self, "global_clamp_size")
-
-        layout.prop(self, "use_image_search")
-        '''
-
-def menu_func_import(self, context):
-    self.layout.operator(ImportX.bl_idname, text="DirectX (.x)")
-
-#def menu_func_export(self, context):
-#    self.layout.operator(ExportX.bl_idname, text="DirectX (.x)")
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_file_import.append(menu_func_import)
-    #bpy.types.INFO_MT_file_export.append(menu_func_export)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_file_import.remove(menu_func_import)
-    #bpy.types.INFO_MT_file_export.remove(menu_func_export)
-
-if __name__ == "__main__":
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/io_directx_bel/bel/__init__.py b/release/scripts/addons_contrib/io_directx_bel/bel/__init__.py
deleted file mode 100644
index fcc6a5c..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/bel/__init__.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# set a given name to a unique
-# blender data name in its collection
-def bpyname(name,collection,limit=63,suffix=4) :
-    name = name[:limit-suffix]
-    tpl = '%s.%.'+str(suffix)+'d'
-    bname = name
-    id = 0
-    while bname in collection :
-        id += 1
-        bname = tpl%(name,id)
-    return bname
-
-## check if there's nested lists in a list. used by functions that need
-# list(s) of vertices/faces/edges etc as input
-# @param lst a list of vector or a list of list of vectors
-# @returns always nested list(s)
-# a boolean True if was nested, False if was not
-def nested(lst) :
-    try :
-        t = lst[0][0][0]
-        return lst, True
-    except :
-        return [lst], False
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/io_directx_bel/bel/fs.py b/release/scripts/addons_contrib/io_directx_bel/bel/fs.py
deleted file mode 100644
index 18e2b2c..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/bel/fs.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# v0.1
-import bpy
-from os import path as os_path, listdir as os_listdir
-from bpy import path as bpy_path
-
-# cross platform paths (since ms conform to / path ;) )
-# maybe add utf8 replace to old ascii blender builtin
-# // can be omitted for relative
-def clean(path) :
-    path = path.strip().replace('\\','/')
-    if ('/') not in path : path = '//'+path
-    return path
-    
-## test for existence of a file or a dir
-def exist(path) :
-    if isfile(path) or isdir(path) : return True
-    return False
-
-## test for existence of a file
-def isfile(path) :
-    if os_path.isfile(path) : return True
-    # could be blender relative
-    path = bpy_path.abspath(path)
-    if os_path.isfile(path) : return True
-    return False
-
-## test for existence of a dir
-def isdir(path) :
-    if os_path.isdir(path) : return True
-    # could be blender relative
-    path = bpy_path.abspath(path)
-    if os_path.isdir(path) : return True
-    return False
-
-## returns a list of every absolute filepath
-# to each file within the 'ext' extensions
-# from a folder and its subfolders
-def scanDir(path,ext='all') :
-    files = []
-    fields = os_listdir(path)
-    if ext != 'all' and type(ext) != list : ext = [ext]
-    for item in fields :
-        if os_path.isfile(path + '/' + item) and (ext == 'all' or item.split('.')[-1] in ext) :
-            #print('  file %s'%item)
-            files.append(path + '/' + item)
-        elif os_path.isdir(path + '/' + item) :
-            print('folder %s/%s :'%(path,item))
-            files.extend(scanDir(path + '/' + item))
-    return files
-
-def saveOptions(op,operator_name, tokens, filename='last_run'):
-    #print(op.as_keywords())
-    #print(dir(op))
-    target_path = os_path.join("operator", operator_name)
-    target_path = os_path.join("presets", target_path)
-    target_path = bpy.utils.user_resource('SCRIPTS',target_path,create=True)
-    if target_path:
-        filepath = os_path.join(target_path, filename) + ".py"
-        file_preset = open(filepath, 'w')
-        file_preset.write("import bpy\nop = bpy.context.active_operator\n\n")
-        properties_blacklist = bpy.types.Operator.bl_rna.properties.keys()
-        for key, value in tokens.items() :
-            if key not in properties_blacklist :
-                # convert thin wrapped sequences to simple lists to repr()
-                try:
-                    value = value[:]
-                except:
-                    pass
-    
-                file_preset.write("op.%s = %r\n" % (key, value))
-
-        file_preset.close()
-    
diff --git a/release/scripts/addons_contrib/io_directx_bel/bel/image.py b/release/scripts/addons_contrib/io_directx_bel/bel/image.py
deleted file mode 100644
index 74f45b2..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/bel/image.py
+++ /dev/null
@@ -1,259 +0,0 @@
-import bpy
-import bpy.path
-
-from . import __init__ as bel
-from . import fs
-
-debuglevel = 0
-
-def dprint(str,l=2) :
-    if l <= debuglevel :
-        print(str)
-
-# create or retrieve a bdata image
-# given its path 
-def new(path, name=False, relative = True) :
-    path = fs.clean(path)
-    # check file
-    if fs.isfile(path) == False :
-        dprint('Texture image not found')
-        return False
-
-    if relative :
-        try :
-            path = bpy.path.relpath(path)
-            path = fs.clean(path)
-        except : 
-            print('cant turn path into relative one (.blend and img path drive letters ?) ')
-        
-    # retrieve paths to image file from existing image slot
-    # returns img if paths match
-    for img in bpy.data.images :
-        if img.filepath != '' :
-            if bpy.path.abspath(path) == bpy.path.abspath(fs.clean(img.filepath)) :
-                return img
-
-    # create a unique name in image slot
-    if name == False : 
-        name = bpy.path.basename(path)
-    name = bel.bpyname(name,bpy.data.images.keys())
-
-    # finally :
-    img = bpy.data.images.load(filepath=path)
-    img.name = name
-    return img
-
-
-def applyShader(mat,config) :
-
-    # matslot.link = 'DATA'
-    #mat = bpy.data.materials['Female_Body']
-
-    texslot = mat.texture_slots[0]
-    tex = texslot.texture
-    img = tex.image
-    
-    #config = shaders[shadername]
-    alpha = True if 'alpha' in config else False
-
-    ## MAT
-
-    mat.type = 'SURFACE'
-    # diffuse
-    mat.diffuse_color = Color((0.6, 0.6, 0.6))
-    mat.diffuse_intensity = 0.8
-    mat.diffuse_shader = 'LAMBERT'
-    mat.use_diffuse_ramp = False
-
-    # specular
-    mat.specular_color = Color((1.0, 1.0, 1.0))
-    mat.specular_intensity = 0.25
-    mat.specular_shader = 'COOKTORR'
-    mat.use_specular_ramp = False
-    mat.specular_hardness = 1.0
-
-    # shading
-    mat.emit = 0.0
-    mat.ambient = 0.5
-    mat.translucency = 0.0
-    mat.use_shadeless = False
-    mat.use_tangent_shading = False
-    mat.use_cubic = False
-
-    # transparency
-    mat.use_transparency = alpha
-    mat.transparency_method = 'Z_TRANSPARENCY'
-    mat.alpha = not(alpha)
-    mat.specular_alpha = not(alpha)
-    mat.raytrace_transparency.fresnel = 0.0
-    mat.raytrace_transparency.fresnel_factor = 1.25
-
-    # mirror
-    mat.raytrace_mirror.use = False
-
-    # subsurface_scattering
-    mat.subsurface_scattering.use
-
-    # strand
-    # options
-    # shadow
-    mat.use_shadows = True
-    mat.use_transparent_shadows = True
-    mat.use_cast_shadows_only = False
-    mat.shadow_cast_alpha = 1.0
-    mat.use_only_shadow = False
-    mat.shadow_only_type = 'SHADOW_ONLY_OLD'
-    mat.use_cast_buffer_shadows = True
-    mat.shadow_buffer_bias = 0.0
-    mat.use_ray_shadow_bias = True
-    mat.shadow_ray_bias = 0.0
-    mat.use_cast_approximate = True
-
-    # TEXTURE SLOT 0
-
-    # diffuse
-    texslot.diffuse_factor = 1.0
-    texslot.use_map_diffuse = True
-    texslot.diffuse_color_factor = 1.0
-    texslot.use_map_color_diffuse = True
-    texslot.alpha_factor = 1.0
-    texslot.use_map_alpha = alpha
-    texslot.translucency_factor = 0.0
-    texslot.use_map_translucency = False
-
-    # specular
-    texslot.specular_factor = 0.3
-    texslot.use_map_specular = True
-    texslot.specular_color_factor = 1.0
-    texslot.use_map_color_spec = True
-    texslot.hardness_factor = 0.1
-    texslot.use_map_hardness = True
-
-    # shading
-    texslot.ambient_factor = 0.0
-    texslot.use_map_ambient = False
-    texslot.emit_factor = 0.1
-    texslot.use_map_emit = True
-    texslot.mirror_factor = 0.0
-    texslot.use_map_mirror = False
-    texslot.raymir_factor = 0.0
-    texslot.use_map_raymir = False
-
-    # geometry
-    texslot.normal_factor = 0.0
-    texslot.use_map_normal = False
-    texslot.warp_factor = 0.1
-    texslot.use_map_warp = False
-    texslot.displacement_factor = 0.0
-    texslot.use_map_displacement = False
-
-    texslot.blend_type = 'MIX'
-    texslot.invert = False
-    texslot.use_rgb_to_intensity = False
-    texslot.color = Color((1.0, 0.0, 1.0)) # default
-    texslot.use_stencil = False
-    texslot.default_value = 1.0
-
-    # TEXTURE
-    tex.use_alpha = alpha
-    tex.use_preview_alpha = alpha
-
-def BSshader(nodes,pointer) :
-    tkm = bpy.context.scene.tkm
-    typ, nodename = pointer.split(' ')
-    RenderShader = nodes[typ][nodename]
-    name = BSname(nodename,RenderShader['Object.Name'])
-    if name in bpy.data.materials :
-        mat = bpy.data.materials[name]
-    else :
-        mat = bpy.data.materials.new(name=name)
-        # Unused
-        DepthWriteEnable = RenderShader['DepthWriteEnable'] if 'DepthWriteEnable' in RenderShader else False # an integer
-        ShaderTransparency = RenderShader['MultiDrawLayer'] if 'MultiDrawLayer' in RenderShader else False # an integer
-        LightEnable = RenderShader['LightEnable'] if 'LightEnable' in RenderShader else False # an integer
-
-        ShaderPhong = BSnode(nodes,RenderShader['Surface'])
-        #print('mat : %s'%ShaderPhong['Material'])
-        RenderMaterial = BSnode(nodes,ShaderPhong['Material'])
-        DiffuseColor = RenderMaterial['DiffuseColor'] if 'DiffuseColor' in RenderMaterial else False
-        SpecularColor = RenderMaterial['SpecularColor'] if 'SpecularColor' in RenderMaterial else False
-        AmbientColor = RenderMaterial['AmbientColor'] if 'AmbientColor' in RenderMaterial else False
-        EmissionColor = RenderMaterial['Shininess'] if 'EmissionColor' in RenderMaterial else False
-        Shininess = RenderMaterial['Shininess'] if 'Shininess' in RenderMaterial else False
-        Transparency = RenderMaterial['Transparency'] if 'Transparency' in RenderMaterial else False
-        for key in RenderMaterial.keys() :
-            if key not in ['DiffuseColor','SpecularColor','AmbientColor','EmissionColor','Shininess','Transparency'] :
-                print('NEW RENDERMATERIAL PROP ! : %s'%key)
-        
-        #print(AmbientColor)
-        if DiffuseColor : mat.diffuse_color = Color(DiffuseColor) #[0][0],DiffuseColor[0][1],DiffuseColor[0][2])
-        if SpecularColor : mat.specular_color = Color(SpecularColor)#[0][0],SpecularColor[0][1],SpecularColor[0][2])
-        if AmbientColor : mat.ambient = AmbientColor[0] # source value is a vector3f with x=y=z 
-        if EmissionColor : mat.emit = EmissionColor[0] # source value is a vector3f with x=y=z 
-        #if Shininess : mat.
-        #alpha is a boolean, whereas Transparency is a float or False
-        if Transparency :
-            mat.use_transparency = True
-            mat.transparency_method = 'Z_TRANSPARENCY'
-            mat.alpha = Transparency
-            mat.specular_alpha = 0
-            alpha = True
-        else : alpha = False
-        texinfluence = False
-        if 'Color' in ShaderPhong :
-            ShaderTexture = BSnode(nodes,ShaderPhong['Color'])
-            texinfluence = 'Color'
-        if 'Reflection' in ShaderPhong :
-            ShaderTexture = BSnode(nodes,ShaderPhong['Reflection'])
-            texinfluence = 'Reflection'
-        if texinfluence == False :
-            print('neither color nor refl. in ShaderPhong %s'%RenderShader['Surface'])
-            print('other props are : %s'%ShaderPhong.keys())
-            return mat
-
-        ShaderTextureName = ShaderTexture['Object.Name']
-
-        Texture2D = BSnode(nodes,ShaderTexture['Texture'])
-        Texture2DName = Texture2D['Object.Name']
-
-        FileObject = BSnode(nodes,Texture2D['Texture.FileObject'])
-        imgpath = FileObject['FileName']
-        imgname = imgpath.split('/')[-1]
-        imgpath = tkm.path_archives+'/Images/Q=Tex032M/'+imgpath
-
-        if imgname not in bpy.data.images :        
-            if os.path.isfile(imgpath+'.png') : ext = '.png'
-            elif os.path.isfile(imgpath+'.jp2') : ext = '.jp2'
-            else :
-                print('Texture image not found ! %s'%Texture2D['Texture.FileObject'])
-                print('path : %s.png or .jp2 '%imgpath)
-                return mat
-            img = bpy.data.images.load(filepath=imgpath+ext)
-            img.name = imgname
-        else : img = bpy.data.images[imgname]
-        
-        '''
-        texslot = mat.texture_slots[0]
-        mat.texture_slots[0]
-        tex = texslot.texture
-        tex.type = 'IMAGE'
-        img = tex.image        
-        img.name
-        '''
-        #img = bpy.data.images.new(name='imgname',width=640, height=512)
-
-        if ShaderTextureName not in bpy.data.textures :
-            tex = bpy.data.textures.new(name=ShaderTextureName,type='IMAGE')
-            tex.image = img
-            tex.use_alpha = alpha
-            tex.use_preview_alpha = alpha
-        else : tex = bpy.data.textures[ShaderTextureName]
-
-        texslot = mat.texture_slots.create(index=0)
-        texslot.texture = tex
-        texslot.texture_coords = 'UV'
-        texslot.uv_layer = 'UV0'
-        texslot.use_map_alpha = alpha
-        texslot.alpha_factor = 1.0
-
-    return mat
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/io_directx_bel/bel/material.py b/release/scripts/addons_contrib/io_directx_bel/bel/material.py
deleted file mode 100644
index d39f32c..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/bel/material.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import bpy
-
-'''
-given name < 21
-if material name exists :
-naming_method = 0   blender default (increment name)
-naming_method = 1   do nothing, abort creation and use existing
-naming_method = 2   create new, rename existing, 
-naming_method = 3   create new, replace existing
-'''
-
-def new(name, naming_method=0) :
-    if name not in bpy.data.materials or naming_method == 0:
-        return bpy.data.materials.new(name=name)
-    
-    elif naming_method == 1 :
-        return bpy.data.materials[name]
-    
-    mat = bpy.data.materials.new(name=name)
-    
-    if naming_method == 2 :
-        mat.name = name
-        return mat
-    
-    # naming_method = 3 : replace 
-    prevmat = bpy.data.materials[name]
-    for ob in bpy.data.objects :
-        for matslot in ob.material_slots :
-            if matslot.material == prevmat :
-                matslot.material = mat
-    bpy.data.materials.remove(prevmat)
-    return mat
diff --git a/release/scripts/addons_contrib/io_directx_bel/bel/mesh.py b/release/scripts/addons_contrib/io_directx_bel/bel/mesh.py
deleted file mode 100644
index eee416c..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/bel/mesh.py
+++ /dev/null
@@ -1,208 +0,0 @@
-##\file
-# raw extract quick cleaning from blended cities2.6 project. thanks to myself for cooperation, but what a messy code we have here.
-import bpy
-import mathutils
-from mathutils import *
-
-from . import uv as buv
-from . import ob as bob
-
-debuglevel = 0
-'''
-wip.. naming behaviour previous to any data
-name exist ?
-no : create
-yes :
-    naming_method = 0   blender default (increment name)
-    naming_method = 1   do nothing, abort creation and use existing
-    naming_method = 2   create new, rename existing, 
-    naming_method = 3   create new, remove existing
-    
-for now, and mesh data, 0 2 or 3
-'''
-
-## material listed in matslots must exist before creation of material slots
-
-def write(obname,name, 
-          verts=[], edges=[], faces=[], 
-          matslots=[], mats=[], uvs=[], 
-          groupnames=[], vindices=[], vweights=[],
-          smooth=False,
-          naming_method = 0,
-          ) :
-
-    
-    obj = bpy.data.objects[obname] if obname in bpy.data.objects else False
-    me = bpy.data.meshes[name] if name in bpy.data.meshes else False
-
-    #print(naming_method,type(obj),type(me))
-    #print(obj,me)
-    #print()
-    if naming_method == 1 and me and obj and obj.data == me :
-        #print('%s and %s exist, reuse'%(obj.name,me.name))
-        return obj
-       
-    if naming_method == 3 :
-        if obj : 
-            #print('remove ob %s'%obj.name)
-            bob.remove(obj,False)
-        if me :
-            #print('remove me %s'%me.name)
-            bob.removeData(me)
-    
-
-    me = bpy.data.meshes.new(name)
-    if naming_method == 2 : me.name = name
-    
-    me.from_pydata(verts, edges, faces)
-    me.update()
-
-    if smooth : shadesmooth(me)
-
-    # material slots
-    matimage=[]
-    if len(matslots) > 0 :
-        for matname in matslots :
-            '''
-            if matname not in bpy.data.materials :
-                mat = bpy.data.materials.new(name=matname)
-                mat.diffuse_color=( random.uniform(0.0,1.0),random.uniform(0.0,1.0),random.uniform(0.0,1.0))
-                mat.use_fake_user = True
-                warn.append('Created missing material : %s'%matname)
-            else :
-            '''
-            mat = bpy.data.materials[matname]
-            me.materials.append(mat)
-            texslot_nb = len(mat.texture_slots)
-            if texslot_nb :
-                texslot = mat.texture_slots[0]
-                if type(texslot) != type(None) :
-                    tex = texslot.texture
-                    if tex.type == 'IMAGE' :
-                        img = tex.image
-                        if type(img) != type(None) :
-                            matimage.append(img)
-                            continue
-            matimage.append(False)
-
-    # uvs
-    if len(uvs) > 0 :
-        #buv.write(me, uvs, matimage)
-        buv.flatwrite(me, uvs)
-
-    # map a material to each face
-    if len(mats) > 0 :
-        for fi,f in enumerate(me.polygons) :
-            f.material_index = mats[fi]
-
-    obj = bpy.data.objects.new(name=obname, object_data=me)
-    if naming_method != 0 :
-        obj.name = obname
-            
-    '''
-    else :
-        ob = bpy.data.objects[name]
-        ob.data = me
-        if naming_method == 2 : ob.name = 
-        ob.parent = None
-        ob.matrix_local = Matrix()
-        print('  reuse object %s'%ob.name)
-    '''
-            
-    # vertexgroups
-    if len(groupnames) > 0 :
-        for gpi, groupname in enumerate(groupnames) :
-            weightsadd(obj, groupname, vindices[gpi], vweights[gpi])
-    
-    # scene link check
-    if obj.name not in bpy.context.scene.objects.keys() :
-        bpy.context.scene.objects.link(obj)
-        
-    return obj
-
-def shadesmooth(me,lst=True) :
-    if type(lst) == list :
-        for fi in lst :
-            me.polygons[fi].use_smooth = True
-    else :
-        for fi,face in enumerate(me.polygons) :
-            face.use_smooth = True
- 
-def shadeflat(me,lst=True) :
-    if type(lst) == list :
-        for fi in lst :
-            me.polygons[fi].use_smooth = False
-    else :
-        for fi,face in enumerate(me.polygons) :
-            face.use_smooth = False
-
-def weightsadd(ob, groupname, vindices, vweights=False) :
-    if vweights == False : vweights = [1.0 for i in range(len(vindices))]
-    elif type(vweights) == float : vweights = [vweights for i in range(len(vindices))]
-    group = ob.vertex_groups.new(groupname)
-    for vi,v in enumerate(vindices) :
-        group.add([v], vweights[vi], 'REPLACE')
-
-def matToString(mat) :
-    #print('*** %s %s'%(mat,type(mat)))
-    return str(mat).replace('\n       ','')[6:]
-
-def stringToMat(string) :
-    return Matrix(eval(string))
-
-
-def objectBuild(elm, verts, edges=[], faces=[], matslots=[], mats=[], uvs=[] ) :
-    #print('build element %s (%s)'%(elm,elm.className()))
-    dprint('object build',2)
-    city = bpy.context.scene.city
-    # apply current scale
-    verts = metersToBu(verts)
-    
-    if type(elm) != str :
-        obname = elm.objectName()
-        if obname == 'not built' :
-            obname = elm.name
-    else : obname= elm
-
-    obnew = createMeshObject(obname, True, verts, edges, faces, matslots, mats, uvs)
-    #elm.asElement().pointer = str(ob.as_pointer())
-    if type(elm) != str :
-        if elm.className() == 'outlines' :
-            obnew.lock_scale[2] = True
-            if elm.parent :
-                obnew.parent = elm.Parent().object()
-        else :
-            #otl = elm.asOutline()
-            #ob.parent = otl.object()
-            objectLock(obnew,True)
-        #ob.matrix_local = Matrix() # not used
-        #ob.matrix_world = Matrix() # world
-    return obnew
-
-def dprint(str,l=2) :
-    if l <= debuglevel :
-        print(str)
-
-
-def materialsCheck(bld) :
-    if hasattr(bld,'materialslots') == False :
-        #print(bld.__class__.__name__)
-        builderclass = eval('bpy.types.%s'%(bld.__class__.__name__))
-        builderclass.materialslots=[bld.className()]
-
-    matslots = bld.materialslots
-    if len(matslots) > 0 :
-        for matname in matslots :
-            if matname not in bpy.data.materials :
-                mat = bpy.data.materials.new(name=matname)
-                mat.use_fake_user = True
-                if hasattr(bld,'mat_%s'%(matname)) :
-                    method = 'defined by builder'
-                    matdef = eval('bld.mat_%s'%(matname))
-                    mat.diffuse_color = matdef['diffuse_color']
-                else :
-                    method = 'random'
-                    mat.diffuse_color=( random.uniform(0.0,1.0),random.uniform(0.0,1.0),random.uniform(0.0,1.0))
-                dprint('Created missing material %s (%s)'%(matname,method),2)
-
-
diff --git a/release/scripts/addons_contrib/io_directx_bel/bel/ob.py b/release/scripts/addons_contrib/io_directx_bel/bel/ob.py
deleted file mode 100644
index 486bced..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/bel/ob.py
+++ /dev/null
@@ -1,116 +0,0 @@
-import bpy
-from bpy.types import Mesh, PointLamp, SpotLamp, HemiLamp, AreaLamp, SunLamp, Camera, TextCurve, MetaBall, Lattice, Armature
-
-
-def new(name,datatype,naming_method):
-    if name in bpy.data.objects and naming_method :
-        ob = bpy.data.objects[name]
-        if naming_method == 1 :
-            ob.parent = None
-            ob.user_clear()
-        elif naming_method == 2 :
-            ob = bpy.data.objects.new(name,datatype)
-            ob.name = name
-        elif naming_method == 3 :
-            bpy.context.scene.objects.unlink(ob)
-            ob.user_clear()
-            bpy.data.objects.remove(ob)
-            ob = bpy.data.objects.new(name,datatype)
-    else :
-        ob = bpy.data.objects.new(name,datatype)
-    if ob.name not in bpy.context.scene.objects.keys() :
-        bpy.context.scene.objects.link(ob)
-    return ob
-
-## returns an object or a list of objects
-# @param ob 'all', 'active', 'selected', <object>, 'objectname'
-# @return a list of objects or an empty list
-def get(ob) :
-    if type(ob) == str :
-        if ob == 'all' : return bpy.context.scene.objects
-        elif ob == 'active' : return [bpy.context.active_object] if bpy.context.active_object != None else []
-        elif ob == 'selected' : return bpy.context.selected_objects
-        else :
-            try : return [bpy.data.objects[ob]]
-            except : return []
-    return [ob]
-
-
-## remove an object from blender internal
-def remove(ob,with_data=True) :
-    objs = get(ob)
-    #if objs :
-    #    if type(objs) == bpy.types.Object : objs = [objs]
-    for ob in objs :
-            data = ob.data
-            #and_data=False
-            # never wipe data before unlink the ex-user object of the scene else crash (2.58 3 770 2)
-            # if there's more than one user for this data, never wipeOutData. will be done with the last user
-            # if in the list
-            and_data = with_data
-            try :
-                if data.users > 1 :
-                    and_data=False
-            except :
-                and_data=False # empties
-                
-            # odd (pre 2.60) :
-            # ob=bpy.data.objects[ob.name]
-            # if the ob (board) argument comes from bpy.data.groups['aGroup'].objects,
-            #  bpy.data.groups['board'].objects['board'].users_scene
-            ob.name = '_dead'
-            for sc in ob.users_scene :
-                sc.objects.unlink(ob)
-
-            #try :
-                #print('  removing object %s...'%(ob.name)),
-            bpy.data.objects.remove(ob)
-                #print('  done.')
-            #except :
-            #    print('removing failed, but renamed %s and unlinked'%ob.name)
-
-            # never wipe data before unlink the ex-user object of the scene else crash (2.58 3 770 2)
-            if and_data :
-                wipeOutData(data)
-
-
-## remove an object data from blender internal
-## or rename it _dead if there's still users
-def removeData(data) :
-    #print('%s has %s user(s) !'%(data.name,data.users))
-    
-    if data.users <= 0 :
-
-            #data.user_clear()
-            data_type = type(data)
-            
-            # mesh
-            if data_type == Mesh :
-                bpy.data.meshes.remove(data)
-            # lamp
-            elif data_type in [ PointLamp, SpotLamp, HemiLamp, AreaLamp, SunLamp ] :
-                bpy.data.lamps.remove(data)
-            # camera
-            elif data_type == Camera :
-                bpy.data.cameras.remove(data)
-            # Text, Curve
-            elif data_type in [ Curve, TextCurve ] :
-                bpy.data.curves.remove(data)
-            # metaball
-            elif data_type == MetaBall :
-                bpy.data.metaballs.remove(data)
-            # lattice
-            elif data_type == Lattice :
-                bpy.data.lattices.remove(data)
-            # armature
-            elif data_type == Armature :
-                bpy.data.armatures.remove(data)
-            else :
-                print('  data still here : forgot %s type'%type(data))
-        #except :
-            # empty, field
-        #    print('%s has no user_clear attribute ? (%s).'%(data.name,type(data)))
-    else :
-        #print('  not done, %s has %s user'%(data.name,data.users))
-        data.name = '_dead'
-        
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/io_directx_bel/bel/uv.py b/release/scripts/addons_contrib/io_directx_bel/bel/uv.py
deleted file mode 100644
index 2827819..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/bel/uv.py
+++ /dev/null
@@ -1,109 +0,0 @@
-from mathutils import Vector
-from .__init__ import *
-from time import clock
-
-# uvs :
-# 
-def write(me, uvs, matimage = False) :
-    t = clock()
-    uvs, nest = nested(uvs)
-    newuvs = []
-    # uvi : uvlayer id  uvlist : uv coordinates list
-    for uvi, uvlist in enumerate(uvs) :
-
-        uv = me.uv_textures.new()
-        uv.name = 'UV%s'%uvi
-        
-        uvlayer = me.uv_layers[-1].data
-        
-        for uvfi, uvface in enumerate(uvlist) :
-            #uv.data[uvfi].use_twoside = True # 2.60 changes mat ways
-            mslotid = me.polygons[uvfi].material_index
-            #mat = mesh.materials[mslotid]
-            if matimage :
-                if matimage[mslotid] :
-                    img = matimage[mslotid]
-                    uv.data[uvfi].image=img
-            
-            vi = 0
-            for fi in me.polygons[uvfi].loop_indices :
-                uvlayer[fi].uv = Vector((uvface[vi],uvface[vi+1]))
-                vi += 2
-                
-        newuvs.append(uv)
-    print('uvs in ',clock() - t)
-    if nest : return newuvs
-    return newuvs[0]
-    
-## WAY faster
-def flatwrite(me, uvs, matimage = False) :
-    #t = clock()
-    newuvs = []
-    #print('uv funcinput : %s'%(len(uvs)))
-    # uvi : uvlayer id  uvlist : uv coordinates list
-    for uvi, uvlist in enumerate(uvs) :
-        #print('uvlist input : %s'%(len(uvlist)))
-        #print(uvlist[0:5])
-        uv = me.uv_textures.new()
-        uv.name = 'UV%s'%uvi
-        uvlayer = me.uv_layers[-1].data
-        # flatuv = awaited uvlist length
-        #flatuv = list( range(len(uvlayer) * 2) )
-        #print('uvlist need : %s'%(len(flatuv)))
-        uvlayer.foreach_set('uv',uvlist)
-
-        newuvs.append(uv)
-    #print('uvs in ',clock() - t)
-    return newuvs
-
-# face are squared or rectangular, 
-# any orientation
-# vert order width then height 01 and 23 = x 12 and 03 = y
-# normal default when face has been built
-def row(vertices,faces,normals=True) :
-    uvs = []
-    for face in faces :
-        v0 = vertices[face[0]]
-        v1 = vertices[face[1]]
-        v2 = vertices[face[-1]]
-        print(v0,v1)
-        lx = (v1 - v0).length
-        ly = (v2 - v0).length
-        # init uv
-        if len(uvs) == 0 :
-            x = 0
-            y = 0
-        elif normals :
-            x = uvs[-1][2]
-            y = uvs[-1][3]
-        else :
-            x = uvs[-1][0]
-            y = uvs[-1][1]
-        if normals : uvs.append([x,y,x+lx,y,x+lx,y+ly,x,y+ly])
-        else : uvs.append([x+lx,y,x,y,x,y+ly,x+lx,y+ly])
-    return uvs
-
-## convert UV given as verts location to blender format
-# eg : [ [v0x,v0y] , [vnx , vny] ... ] -> [ [ v1x,v1y,v0x,v0y,v4x,v4y] ... ]
-# found in directx
-def asVertsLocation(verts2d, faces) :
-    t = clock()
-    uv = []
-    for f in faces :
-        uvface = []
-        for vi in f :
-            uvface.extend(verts2d[vi])
-        uv.append(uvface)
-    print('uvs convert in ',clock() - t)
-    return uv
-
-## Dx to flat
-#eg : [ [v0x,v0y] ,[v1x,v1y] , [vnx , vny] ] -> [ v0x,v0y,v1x,v1y,vnx,vny ]
-def asFlatList(uvlist,faces) :
-    #t = clock()
-    uv = []
-    for f in faces :
-        for vi in f :
-            uv.extend(uvlist[vi])
-    #print('uvs convert in %s len : %s'%(str(clock() - t),len(uv)))
-    return uv
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/io_directx_bel/import_x.py b/release/scripts/addons_contrib/io_directx_bel/import_x.py
deleted file mode 100644
index f96dc7e..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/import_x.py
+++ /dev/null
@@ -1,971 +0,0 @@
-# Blender directX importer
-# version baby
-
-# litterature explaining the parser directions :
-
-# I don't want to load the whole file as it can be huge : go chunks
-# also I want random access to 3d datas to import pieces, not always everything
-# so step1 is a whole file fast parsing, retrieving tokens name and building en empty internal dict
-# with only pointers and no 3d datas.
-# step 2 is to call any token by their names and retrieve the 3d datas thanks to pointers stored in dicts
-# between step 1 and step 2 a script ui should be provided to select, transform etc before import.
-# > I need to know the pointer position of tokens but data.tell() is slow
-# a += pointer computed from line length is way faster. so I need eol -> rb mode
-# and readline() is ok in binary mode 'rb' with \r\n (win) \n (unix) but not \r mac..
-# 2chrs for windows, 1 for mac and lunix > win eol \r\n becomes \n\n (add a line)
-# mac eol \r becomes \n so win lines info are wrong
-# this also allows support for wrong files format (mixed \r and \r\n)
-# for now it only works for text format, but the used methods will be independant of the container type.
-
-# TEST FILES
-# http://assimp.svn.sourceforge.net/viewvc/assimp/trunk/test/models/X/
-
-
-import os
-import re
-import struct, binascii
-import time
-
-import bpy
-import mathutils as bmat
-from mathutils import Vector, Matrix
-
-try :
-	import bel
-	import bel.mesh
-	import bel.image
-	import bel.uv
-	import bel.material
-	import bel.ob
-	import bel.fs
-except :
-	import io_directx_bel.bel as bel
-	from .bel import mesh,image,uv,material,ob,fs
-
-from .templates_x import *
-
-'''
-# just a temp hack to reload bel everytime
-import imp
-imp.reload(bel)
-imp.reload(bel.fs)
-imp.reload(bel.image)
-imp.reload(bel.material)
-imp.reload(bel.mesh)
-imp.reload(bel.ob)
-imp.reload(bel.uv)
-'''
-
-###################################################
-
-def load(operator, context, filepath,
-         global_clamp_size=0.0,
-         show_tree=False,
-         show_templates=False,
-         show_geninfo=False,
-         quickmode=False,
-         parented=False,
-         bone_maxlength=1.0,
-         chunksize=False,
-         naming_method=0,
-         use_ngons=True,
-         use_edges=True,
-         use_smooth_groups=True,
-         use_split_objects=True,
-         use_split_groups=True,
-         use_groups_as_vgroups=False,
-         use_image_search=True,
-         global_matrix=None,
-         ):
-    
-    
-    if quickmode :
-        parented = False
-    
-    bone_minlength = bone_maxlength / 100.0
-    
-    #global templates, tokens
-    rootTokens = []
-    namelookup = {}
-    imgnamelookup = {}
-    chunksize = int(chunksize)
-    reserved_type = (
-        'dword',
-        'float',
-        'string'
-    )
-
-    '''
-        'array',
-        'Matrix4x4',
-        'Vector',
-    '''
-    '''
-    with * : defined in dXdata
-    
-    WORD     16 bits
-    * DWORD     32 bits
-    * FLOAT     IEEE float
-    DOUBLE     64 bits
-    CHAR     8 bits
-    UCHAR     8 bits
-    BYTE     8 bits
-    * STRING     NULL-terminated string
-    CSTRING     Formatted C-string (currently unsupported)
-    UNICODE     UNICODE string (currently unsupported)
-
-BINARY FORMAT
-# TOKENS in little-endian WORDs
-#define TOKEN_NAME         1
-#define TOKEN_STRING       2
-#define TOKEN_INTEGER      3
-#define TOKEN_GUID         5
-#define TOKEN_INTEGER_LIST 6
-#define TOKEN_FLOAT_LIST   7
-#define TOKEN_OBRACE      10
-#define TOKEN_CBRACE      11
-#define TOKEN_OPAREN      12
-#define TOKEN_CPAREN      13
-#define TOKEN_OBRACKET    14
-#define TOKEN_CBRACKET    15
-#define TOKEN_OANGLE      16
-#define TOKEN_CANGLE      17
-#define TOKEN_DOT         18
-#define TOKEN_COMMA       19
-#define TOKEN_SEMICOLON   20
-#define TOKEN_TEMPLATE    31
-#define TOKEN_WORD        40
-#define TOKEN_DWORD       41
-#define TOKEN_FLOAT       42
-#define TOKEN_DOUBLE      43
-#define TOKEN_CHAR        44
-#define TOKEN_UCHAR       45
-#define TOKEN_SWORD       46
-#define TOKEN_SDWORD      47
-#define TOKEN_VOID        48
-#define TOKEN_LPSTR       49
-#define TOKEN_UNICODE     50
-#define TOKEN_CSTRING     51
-#define TOKEN_ARRAY       52
-    
-    '''
-    
-    # COMMON REGEX
-    space = '[\ \t]{1,}' # at least one space / tab
-    space0 = '[\ \t]{0,}' # zero or more space / tab
-    
-    # DIRECTX REGEX TOKENS
-    r_template = r'template' + space + '[\w]*' + space0 + '\{'
-    if quickmode :
-        r_sectionname = r'Mesh' + space + '[\W-]*'
-    else :
-        r_sectionname = r'[\w]*' + space + '[\w-]*' + space0 + '\{'
-    r_refsectionname = r'\{' + space0 + '[\w-]*' + space0 + '\}'
-    r_endsection = r'\{|\}'
-    
-    # dX comments
-    r_ignore = r'#|//'
-    
-    #r_frame = r'Frame' + space + '[\w]*'
-    #r_matrix = r'FrameTransformMatrix' + space + '\{[\s\d.,-]*'
-    #r_mesh = r'Mesh' + space + '[\W]*'
-
-    ###################
-    ## STEP 1 FUNCTIONS
-    ###################
-    
-    ## HEADER
-    # returns header values or False if directx reco tag is missing
-    # assuming there's never comment header and that xof if the 1st
-    # string of the file
-    '''
-     they look like xof 0303txt 0032
-     4       Magic Number (required) "xof "
-     2       Minor Version 03
-     2       Major Version 02
-     4       Format Type (required) 
-        "txt " Text File
-        "bin " Binary File  
-        "tzip" MSZip Compressed Text File
-        "bzip" MSZip Compressed Binary File
-     4       Float Accuracy "0032" 32 bit or "0064" 64 bit
-    '''
-    def dXheader(data) :
-        l = data.read(4)
-        if l != b'xof ' :
-            print ('no header found !')
-            data.seek(0)
-            return False
-        minor = data.read(2).decode()
-        major = data.read(2).decode()
-        format = data.read(4).decode().strip()
-        accuracy = int(data.read(4).decode())
-        data.seek(0)
-        return ( minor, major, format, accuracy )
-        
-    
-    ##
-    def dXtree(data,quickmode = False) :
-        tokens = {}
-        templates = {}
-        tokentypes = {}
-        c = 0
-        lvl = 0
-        tree = ['']
-        ptr = 0
-        eol = 0
-        trunkated = False
-        previouslvl = False
-        while True :
-        #for l in data.readlines() :
-            lines, trunkated = nextFileChunk(data,trunkated)
-            if lines == None : break
-            for l in lines :
-                
-                # compute pointer position
-                ptr += eol
-                c += 1
-                eol = len(l) + 1
-                #print(c,data.tell(),ptr+eol)
-                #if l != '' : print('***',l)
-                #if l == ''  : break
-                l = l.strip()
-                
-                # remove blank and comment lines
-                if l == '' or re.match(r_ignore,l) :
-                    continue
-                
-                # one line token cases level switch
-                if previouslvl :
-                    lvl -= 1
-                    previouslvl = False
-                
-                #print('%s lines in %.2f\''%(c,time.clock()-t),end='\r')
-                #print(c,len(l)+1,ptr,data.tell())
-                if '{' in l :
-                    lvl += 1
-                    if '}' in l : previouslvl = True #; print('got one line token : \n%s'%l)
-                elif '}' in l :
-                    lvl -= 1
-                #print(c,lvl,tree)
-                
-                if quickmode == False :
-                    ## look for templates
-                    if re.match(r_template,l) :
-                        tname = l.split(' ')[1]
-                        templates[tname] = {'pointer' : ptr, 'line' : c}
-                        continue
-    
-                    ## look for {references}
-                    if re.match(r_refsectionname,l) :
-                        refname = namelookup[ l[1:-1].strip() ]
-                        #print('FOUND reference to %s in %s at line %s (level %s)'%(refname,tree[lvl-1],c,lvl))
-                        #tree = tree[0:lvl]
-                        parent = tree[lvl-1]
-                        # tag it as a reference, since it's not exactly a child.
-                        # put it in childs since order can matter in sub tokens declaration
-                        tokens[parent]['childs'].append('*'+refname)
-                        if refname not in tokens :
-                            print('reference to %s done before its declaration (line %s)\ncreated dummy'%(refname,c))
-                            tokens[refname] = {}
-                        if 'user' not in tokens[refname] : tokens[refname]['users'] = [parent]
-                        else : tokens[refname]['users'].append(parent)
-                        continue
-    
-                ## look for any token or only Mesh token in quickmode
-                if re.match(r_sectionname,l) :
-                    tokenname = getName(l,tokens)
-                    #print('FOUND %s %s %s %s'%(tokenname,c,lvl,tree))
-                    #print('pointer %s %s'%(data.tell(),ptr))
-                    if lvl == 1 : rootTokens.append(tokenname)
-                    typ = l.split(' ')[0].strip().lower()
-                    tree = tree[0:lvl]
-                    if typ not in tokentypes : tokentypes[typ] = [tokenname]
-                    else : tokentypes[typ].append(tokenname)
-                    parent = tree[-1]
-                    if tokenname in tokens :
-                        tokens[tokenname]['pointer'] = ptr
-                        tokens[tokenname]['line'] = c
-                        tokens[tokenname]['parent'] = parent
-                        tokens[tokenname]['childs'] = []
-                        tokens[tokenname]['type'] = typ
-                        
-                    else : tokens[tokenname] = {'pointer': ptr,
-                                                'line'   : c,
-                                                'parent' : parent,
-                                                'childs' : [],
-                                                'users'  : [],
-                                                'type'   : typ
-                                                }
-                    tree.append(tokenname)
-                    if lvl > 1 and quickmode == False :
-                        tokens[parent]['childs'].append(tokenname)
-                    
-        return tokens, templates, tokentypes
-        
-    ## returns file binary chunks
-    def nextFileChunk(data,trunkated=False,chunksize=1024) :
-        if chunksize == 0 : chunk = data.read()
-        else : chunk = data.read(chunksize)
-        if format == 'txt' :
-            lines = chunk.decode('utf-8', errors='ignore')
-            #if stream : return lines.replace('\r','').replace('\n','')
-            lines = lines.replace('\r','\n').split('\n')
-            if trunkated : lines[0] = trunkated + lines[0]
-            if len(lines) == 1 : 
-                if lines[0] == '' : return None, None
-                return lines, False
-            return lines, lines.pop()
-        # wip, todo for binaries
-        else :
-            print(chunk)
-            for word in range(0,len(chunk)) :
-                w = chunk[word:word+4]
-                print(word,w,struct.unpack("<l", w),binascii.unhexlify(w))
-
-    
-    # name unnamed tokens, watchout for x duplicate
-    # for blender, referenced token in x should be named and unique..
-    def getName(l,tokens) :
-        xnam = l.split(' ')[1].strip()
-        
-        #if xnam[0] == '{' : xnam = ''
-        if xnam and xnam[-1] == '{' : xnam = xnam[:-1]
-        
-        name = xnam
-        if len(name) == 0 : name = l.split(' ')[0].strip()
-        
-        namelookup[xnam] = bel.bpyname(name,tokens,4)
-
-        return namelookup[xnam]
-    
-    
-    ###################
-    ## STEP 2 FUNCTIONS
-    ###################
-    # once the internal dict is populated the functions below can be used
-    
-    ## from a list of tokens, displays every child, users and references
-    '''
-      walk_dxtree( [ 'Mesh01', 'Mesh02' ] ) # for particular pieces
-      walk_dxtree(tokens.keys()) for the whole tree
-    '''
-    def walk_dXtree(field,lvl=0,tab='') :
-        for fi, tokenname in enumerate(field) :
-            if lvl > 0 or tokens[tokenname]['parent'] == '' :
-                if tokenname not in tokens :
-                    tokenname = tokenname[1:]
-                    ref = 'ref: '
-                else : ref = False
-                
-                frame_type = tokens[tokenname]['type']
-                line = ('{:7}'.format(tokens[tokenname]['line']))
-                log = ' %s%s (%s)'%( ref if ref else '', tokenname, frame_type )
-                print('%s.%s%s'%(line, tab, log))
-                if fi == len(field) - 1 : tab = tab[:-3] + '   '
-    
-                if ref == False :
-                    for user in tokens[tokenname]['users'] :
-                         print('%s.%s |__ user: %s'%(line, tab.replace('_',' '), user))
-                    walk_dXtree(tokens[tokenname]['childs'],lvl+1,tab.replace('_',' ')+' |__')
-                
-                if fi == len(field) - 1 and len(tokens[tokenname]['childs']) == 0 :
-                    print('%s.%s'%(line,tab))
-    
-    ## remove eol, comments, spaces from a raw block of datas
-    def cleanBlock(block) :
-        while '//' in block :
-            s = block.index('//')
-            e = block.index('\n',s+1)
-            block = block[0:s] + block[e:]
-        while '#' in block :
-            s = block.index('#')
-            e = block.index('\n',s+1)
-            block = block[0:s] + block[e:]
-        block = block.replace('\n','').replace(' ','').replace('\t ','')
-        return block
-        
-    def readToken(tokenname) :
-        token = tokens[tokenname]
-        datatype = token['type'].lower()
-        if datatype in templates : tpl = templates[datatype]
-        elif datatype in defaultTemplates : tpl = defaultTemplates[datatype]
-        else :
-            print("can't find any template to read %s (type : %s)"%(tokenname,datatype))
-            return False
-        #print('> use template %s'%datatype)
-        block = readBlock(data,token)
-        ptr = 0
-        #return dXtemplateData(tpl,block)
-        fields, ptr = dXtemplateData(tpl,block)
-        if datatype in templatesConvert :
-            fields = eval( templatesConvert[datatype] )
-        return fields
-    
-    def dXtemplateData(tpl,block,ptr=0) :
-        #print('dxTPL',block[ptr])
-        pack = []
-        for member in tpl['members'] :
-            #print(member)
-            dataname = member[-1]
-            datatype = member[0].lower()
-            if datatype ==  'array' :
-                datatype = member[1].lower()
-                s = dataname.index('[') + 1
-                e = dataname.index(']')
-                #print(dataname[s:e])
-                length = eval(dataname[s:e])
-                #print("array %s type %s length defined by '%s' : %s"%(dataname[:s-1],datatype,dataname[s:e],length))
-                dataname = dataname[:s-1]
-                datavalue, ptr = dXarray(block, datatype, length, ptr)
-                #print('back to %s'%(dataname))
-            else :
-                length = 1
-                datavalue, ptr = dXdata(block, datatype, length, ptr)
-    
-            #if len(str(datavalue)) > 50 : dispvalue = str(datavalue[0:25]) + ' [...] ' + str(datavalue[-25:])
-            #else : dispvalue = str(datavalue)
-            #print('%s :  %s %s'%(dataname,dispvalue,type(datavalue)))
-            exec('%s = datavalue'%(dataname))
-            pack.append( datavalue )
-        return pack, ptr + 1
-    
-    def dXdata(block,datatype,length,s=0,eof=';') :
-        #print('dxDTA',block[s])
-        # at last, the data we need
-        # should be a ';' but one meet ',' often, like in meshface
-        if datatype == 'dword' :
-            e = block.index(';',s+1)
-            try : field = int(block[s:e])
-            except :
-                e = block.index(',',s+1)
-                field = int(block[s:e])
-            return field, e+1
-        elif datatype == 'float' :
-            e = block.index(eof,s+1)
-            return float(block[s:e]), e+1
-        elif datatype == 'string' :
-            e = block.index(eof,s+1)
-            return str(block[s+1:e-1]) , e+1
-        else :
-            if datatype in templates : tpl = templates[datatype]
-            elif datatype in defaultTemplates : tpl = defaultTemplates[datatype]
-            else :
-                print("can't find any template for type : %s"%(datatype))
-                return False
-            #print('> use template %s'%datatype)
-            fields, ptr = dXtemplateData(tpl,block,s)
-            if datatype in templatesConvert :
-                fields = eval( templatesConvert[datatype] )
-            return fields, ptr
-    
-    def dXarray(block, datatype, length, s=0) :
-        #print('dxARR',block[s])
-        lst = []
-        if datatype in reserved_type :
-            eoi=','
-            for i in range(length) :
-                if i+1 == length : eoi = ';'
-                datavalue, s = dXdata(block,datatype,1,s,eoi)
-                lst.append( datavalue )
-            
-        else :
-            eoi = ';,'
-            for i in range(length) :
-                if i+1 == length : eoi = ';;'
-                #print(eoi)
-                e = block.index(eoi,s)
-                #except : print(block,s) ; popo()
-                datavalue, na = dXdata(block[s:e+1],datatype,1)
-                lst.append( datavalue )
-                s = e + 2
-        return lst, s
-    
-    ###################################################
-
-    ## populate a template with its datas
-    # this make them available in the internal dict. should be used in step 2 for unknown data type at least
-    def readTemplate(data,tpl_name,display=False) :
-        ptr = templates[tpl_name]['pointer']
-        line = templates[tpl_name]['line']
-        #print('> %s at line %s (chr %s)'%(tpl_name,line,ptr))
-        data.seek(ptr)
-        block = ''
-        trunkated = False
-        go = True
-        while go :
-            lines, trunkated = nextFileChunk(data,trunkated,chunksize) # stream ?
-            if lines == None : 
-                break
-            for l in lines :
-                #l = data.readline().decode().strip()
-                block += l.strip()
-                if '}' in l :
-                    go = False
-                    break
-        
-        uuid = re.search(r'<.+>',block).group()
-        templates[tpl_name]['uuid'] = uuid.lower()
-        templates[tpl_name]['members'] = []
-        templates[tpl_name]['restriction'] = 'closed'
-        
-        members = re.search(r'>.+',block).group()[1:-1].split(';')
-        for member in members :
-            if member == '' : continue
-            if member[0] == '[' :
-                templates[tpl_name]['restriction'] = member
-                continue  
-            templates[tpl_name]['members'].append( member.split(' ') )
-    
-        if display : 
-            print('\ntemplate %s :'%tpl_name)
-            for k,v in templates[tpl_name].items() :
-                if k != 'members' :
-                    print('  %s : %s'%(k,v))
-                else :
-                    for member in v :
-                        print('  %s'%str(member)[1:-1].replace(',',' ').replace("'",''))
-                
-            if tpl_name in defaultTemplates :
-                defaultTemplates[tpl_name]['line'] = templates[tpl_name]['line']
-                defaultTemplates[tpl_name]['pointer'] = templates[tpl_name]['pointer']
-                if defaultTemplates[tpl_name] != templates[tpl_name] :
-                    print('! DIFFERS FROM BUILTIN TEMPLATE :')
-                    print('raw template %s :'%tpl_name)
-                    print(templates[tpl_name])
-                    print('raw default template %s :'%tpl_name)
-                    print(defaultTemplates[tpl_name])
-                    #for k,v in defaultTemplates[tpl_name].items() :
-                    #    if k != 'members' :
-                    #        print('  %s : %s'%(k,v))
-                    #    else :
-                    #        for member in v :
-                    #            print('  %s'%str(member)[1:-1].replace(',',' ').replace("'",''))
-                else :
-                    print('MATCHES BUILTIN TEMPLATE')
-    
-            
-    ##  read any kind of token data block
-    # by default the block is cleaned from inline comment space etc to allow data parsing
-    # useclean = False (retrieve all bytes) if you need to compute a file byte pointer
-    # to mimic the file.tell() function and use it with file.seek()
-    def readBlock(data,token, clean=True) :
-        ptr = token['pointer']
-        data.seek(ptr)
-        block = ''
-        #lvl = 0
-        trunkated = False
-        go = True
-        while go :
-            lines, trunkated = nextFileChunk(data,trunkated,chunksize)
-            if lines == None : break
-            for l in lines :
-                #eol = len(l) + 1
-                l = l.strip()
-                #c += 1
-                block += l+'\n'
-                if re.match(r_endsection,l) :
-                    go = False
-                    break
-        s = block.index('{') + 1
-        e = block.index('}')
-        block = block[s:e]
-        if clean : block = cleanBlock(block)
-        return block
-    
-    def getChilds(tokenname) :
-        childs = []
-        # '*' in childname means it's a reference. always perform this test
-        # when using the childs field
-        for childname in tokens[tokenname]['childs'] :
-            if childname[0] == '*' : childname = childname[1:]
-            childs.append( childname )
-        return childs
-    
-    # the input nested list of [bonename, matrix, [child0,child1..]] is given by import_dXtree()
-    def buildArm(armdata, child,lvl=0,parent_matrix=False) :
-        
-        bonename, bonemat, bonechilds = child
-        
-        if lvl == 0 :
-            armname = armdata
-            armdata = bpy.data.armatures.new(name=armname)
-            arm = bpy.data.objects.new(armname,armdata)
-            bpy.context.scene.objects.link(arm)
-            arm.select = True
-            bpy.context.scene.objects.active = arm
-            bpy.ops.object.mode_set(mode='EDIT')
-            parent_matrix = Matrix()
-        
-        bone = armdata.edit_bones.new(name=bonename)
-        bonematW = parent_matrix * bonemat
-        bone.head = bonematW.to_translation()
-        #bone.roll.. ?
-        bone_length = bone_maxlength
-        for bonechild in bonechilds :
-            bonechild = buildArm(armdata,bonechild,lvl+1,bonematW)
-            bonechild.parent = bone
-            bone_length = min((bonechild.head - bone.head).length, bone_length)
-        bone.tail = bonematW * Vector((0,bone_length,0))
-        if lvl == 0 :
-            bpy.ops.object.mode_set(mode='OBJECT')
-            return arm
-        return bone
-    
-    def import_dXtree(field,lvl=0) :
-        tab = ' '*lvl*2
-        if field == [] : 
-            if show_geninfo : print('%s>> no childs, return False'%(tab))
-            return False
-        ob = False
-        mat = False
-        is_root = False
-        frames = []
-        obs = []
-        
-        parentname = tokens[field[0]]['parent']
-        if show_geninfo : print('%s>>childs in frame %s :'%(tab,parentname))
-        
-        for tokenname in field :
-
-            tokentype = tokens[tokenname]['type']
-            
-            # frames can contain more than one mesh
-            if tokentype  == 'mesh' :
-                # object and mesh naming :
-                # if parent frame has several meshes : obname = meshname = mesh token name,
-                # if parent frame has only one mesh  : obname = parent frame name, meshname =  mesh token name.
-                if parentname :
-                    meshcount = 0
-                    for child in getChilds(parentname) :
-                        if tokens[child]['type'] == 'mesh' : 
-                            meshcount += 1
-                            if meshcount == 2 :
-                                parentname = tokenname
-                                break
-                else : parentname = tokenname
-                
-                ob = getMesh(parentname,tokenname)
-                obs.append(ob)
-
-                if show_geninfo : print('%smesh : %s'%(tab,tokenname))
-            
-            # frames contain one matrix (empty or bone)
-            elif tokentype  == 'frametransformmatrix' :
-                [mat] = readToken(tokenname)
-                if show_geninfo : print('%smatrix : %s'%(tab,tokenname))
-            
-            # frames can contain 0 or more frames
-            elif tokentype  == 'frame' :
-                frames.append(tokenname)
-                if show_geninfo : print('%sframe : %s'%(tab,tokenname))
-        
-        # matrix is used for mesh transform if some mesh(es) exist(s)      
-        if ob :
-            is_root = True
-            if mat == False :
-                mat = Matrix()
-                if show_geninfo : print('%smesh token without matrix, set it to default\n%splease report in bug tracker if you read this !'%(tab,tab))
-            if parentname == '' : 
-                mat = mat * global_matrix
-            if len(obs) == 1 :
-                ob.matrix_world = mat
-            else :
-                ob = bel.ob.new(parentname, None, naming_method)
-                ob.matrix_world = mat
-                for child in obs :
-                    child.parent = ob
-        
-        # matrix only, store it as a list as we don't know if
-        # it's a bone or an empty yet
-        elif mat :
-            ob = [parentname, mat,[]]
-
-        # nothing case ?
-        else :
-            ob = [parentname, Matrix() * global_matrix,[]]
-            if show_geninfo : print('%snothing here'%(tab))
-
-        childs = []
-        
-        for tokenname in frames :
-            if show_geninfo : print('%s<Begin %s :'%(tab,tokenname))
-            
-            # child is either False, empty, object, or a list or undefined name matrices hierarchy
-            child = import_dXtree(getChilds(tokenname),lvl+1)
-            if child and type(child) != list :
-                is_root = True
-            childs.append( [tokenname, child] )
-            if show_geninfo : print('%sEnd %s>'%(tab,tokenname))
-        
-        if is_root and parentname != '' :
-            
-            if show_geninfo : print('%send of tree a this point'%(tab))
-            if type(ob) == list :
-                mat = ob[1]
-                ob = bel.ob.new(parentname, None, naming_method)
-            ob.matrix_world = mat
-            
-        for tokenname, child in childs :
-            if show_geninfo : print('%sbegin2 %s>'%(tab,tokenname))
-            # returned a list of object(s) or matrice(s)
-            if child :
-
-                # current frame is an object or an empty, we parent this frame to it
-                #if eot or (ob and ( type(ob.data) == type(None) or type(ob.data) == bpy.types.Mesh ) ) :
-                if is_root :
-                    # this branch is an armature, convert it
-                    if type(child) == list :
-                        if show_geninfo : print('%sconvert to armature %s'%(tab,tokenname))
-                        child = buildArm(tokenname, child)
-                        
-                    # parent the obj/empty/arm to current
-                    # or apply the global user defined matrix to the object root
-                    if parentname != '' :
-                        child.parent = ob
-                    else :
-                        child.matrix_world = global_matrix
-                        
-                # returned a list of parented matrices. append it in childs list
-                elif type(child[0]) == str :
-                    ob[2].append(child)
-
-                # child is an empty or a mesh, so current frame is an empty, not an armature
-                elif ob and ( type(child.data) == type(None) or type(child.data) == bpy.types.Mesh ) :
-                    #print('  child data type: %s'%type(child.data))
-                    child.parent = ob
-                    #print('%s parented to %s'%(child.name,ob.name))
-                
-            # returned False
-            else :
-                 if show_geninfo : print('%sreturned %s, nothing'%(tab,child))
-
-        #print('>> %s return %s'%(field,ob))
-        return ob# if ob else False
-
-    # build from mesh token type
-    def getMesh(obname,tokenname,debug = False):
-    
-        if debug : print('\nmesh name : %s'%tokenname)
-        
-        verts = []
-        edges = []
-        faces = []
-        matslots = []
-        facemats = []
-        uvs = []
-        groupnames = []
-        groupindices = []
-        groupweights = []
-
-        nVerts, verts, nFaces, faces = readToken(tokenname) 
-
-        if debug :
-            print('verts    : %s %s\nfaces    : %s %s'%(nVerts, len(verts),nFaces, len(faces)))
-        
-        #for childname in token['childs'] :
-        for childname in getChilds(tokenname) :
-            
-            tokentype = tokens[childname]['type']
-            
-            # UV
-            if tokentype == 'meshtexturecoords' :
-                uv = readToken(childname)
-                #uv = bel.uv.asVertsLocation(uv, faces)
-                uv = bel.uv.asFlatList(uv, faces)
-                uvs.append(uv)
-                
-                if debug : print('uv       : %s'%(len(uv)))
-            
-            # MATERIALS
-            elif tokentype == 'meshmateriallist' :
-                nbslots, facemats = readToken(childname)
-                
-                if debug : print('facemats : %s'%(len(facemats)))
-                
-                # mat can exist but with no datas so we prepare the mat slot
-                # with dummy ones
-                for slot in range(nbslots) :
-                    matslots.append('dXnoname%s'%slot )
-        
-                # length does not match (could be tuned more, need more cases)
-                if len(facemats) != len(faces) :
-                    facemats = [ facemats[0] for i in faces ]
-
-                # seek for materials then textures if any mapped in this mesh.
-                # no type test, only one option type in token meshmateriallist : 'Material'
-                for slotid, matname in enumerate(getChilds(childname)) :
-                    
-                    # rename dummy mats with the right name
-                    matslots[slotid] = matname
-
-                    # blender material creation (need tuning)
-                    mat = bel.material.new(matname,naming_method)
-                    matslots[slotid] = mat.name
-                    
-                    if naming_method != 1 :
-                        #print('matname : %s'%matname)
-                        (diffuse_color,alpha), power, specCol, emitCol = readToken(matname)
-                        #if debug : print(diffuse_color,alpha, power, specCol, emitCol)
-                        mat.diffuse_color = diffuse_color
-                        mat.diffuse_intensity = power
-                        mat.specular_color = specCol
-                        # dX emit don't use diffuse color but is a color itself
-                        # convert it to a kind of intensity 
-                        mat.emit = (emitCol[0] + emitCol[1] + emitCol[2] ) / 3
-                        
-                        if alpha != 1.0 :
-                            mat.use_transparency = True
-                            mat.transparency_method = 'Z_TRANSPARENCY'
-                            mat.alpha = alpha
-                            mat.specular_alpha = 0
-                            transp = True
-                        else : transp = False
-            
-                        # texture
-                        # only 'TextureFilename' can be here, no type test
-                        # textures have no name in .x so we build 
-                        # image and texture names from the image file name
-                        # bdata texture slot name = bdata image name
-                        btexnames = []
-                        for texname in getChilds(matname) :
-                            
-                            # create/rename/reuse etc corresponding data image
-                            # (returns False if not found)
-                            [filename] = readToken(texname)
-                            img = bel.image.new(path+'/'+filename)
-                            
-                            if img == False :
-                                imgname = 'not_found'
-                            else :
-                                imgname = img.name
-                                
-                            #print('texname : %s'%texname)
-                            #print('filename : %s'%filename)
-                            #print('btex/img name : %s'%imgname)
-                            
-                            # associated texture (no naming check.. maybe tune more)
-                            # tex and texslot are created even if img not found
-                            if imgname in bpy.data.textures and ( img == False or bpy.data.textures[imgname].image == img ) :
-                                tex = bpy.data.textures[imgname]
-                            else :
-                                tex = bpy.data.textures.new(name=imgname,type='IMAGE')
-                                if img : tex.image = img
-                                
-                            tex.use_alpha = transp
-                            tex.use_preview_alpha = transp
-                                
-                            # then create texture slot
-                            texslot = mat.texture_slots.create(index=0)
-                            texslot.texture = tex
-                            texslot.texture_coords = 'UV'
-                            texslot.uv_layer = 'UV0'
-                            texslot.use_map_alpha = transp
-                            texslot.alpha_factor = alpha
-
-                # create remaining dummy mat
-                for slotid, matname in enumerate(matslots) :
-                    if matname not in bpy.data.materials :
-                        mat = bel.material.new(matname,naming_method)
-                        matslots[slotid] = mat.name
-                        
-                if debug : print('matslots : %s'%matslots)
-                
-            # VERTICES GROUPS/WEIGHTS
-            elif tokentype == 'skinweights' :
-                groupname, nverts, vindices, vweights, mat = readToken(childname)
-                groupname = namelookup[groupname]
-                if debug : 
-                    print('vgroup    : %s (%s/%s verts) %s'%(groupname,len(vindices),len(vweights),'bone' if groupname in tokens else ''))
-
-                #if debug : print('matrix : %s\n%s'%(type(mat),mat))
-                
-                groupnames.append(groupname)
-                groupindices.append(vindices)
-                groupweights.append(vweights)
-                
-        ob = bel.mesh.write(obname,tokenname, 
-                            verts, edges, faces, 
-                            matslots, facemats, uvs, 
-                            groupnames, groupindices, groupweights,
-                            use_smooth_groups,
-                            naming_method)
-        
-        return ob
-                           
-    ## here we go
-     
-    file = os.path.basename(filepath)
-    
-    print('\nimporting %s...'%file)
-    start = time.clock()
-    path = os.path.dirname(filepath)
-    filepath = os.fsencode(filepath)
-    data = open(filepath,'rb')
-    header = dXheader(data)
-
-    if global_matrix is None:
-        global_matrix = mathutils.Matrix()
-
-    if header :
-        minor, major, format, accuracy = header
-        
-        if show_geninfo :
-            print('\n%s directX header'%file)
-            print('  minor  : %s'%(minor))
-            print('  major  : %s'%(major))
-            print('  format : %s'%(format))
-            print('  floats are %s bits'%(accuracy))
-
-        if format in [ 'txt' ] : #, 'bin' ] :
-
-            ## FILE READ : STEP 1 : STRUCTURE
-            if show_geninfo : print('\nBuilding internal .x tree')
-            t = time.clock()
-            tokens, templates, tokentypes = dXtree(data,quickmode)
-            readstruct_time = time.clock()-t
-            if show_geninfo : print('builded tree in %.2f\''%(readstruct_time)) # ,end='\r')
-
-            ## populate templates with datas
-            for tplname in templates :
-                readTemplate(data,tplname,show_templates)
-
-            ## DATA TREE CHECK
-            if show_tree :
-                print('\nDirectX Data Tree :\n')
-                walk_dXtree(tokens.keys())
-            
-            ## DATA IMPORTATION
-            if show_geninfo : 
-                #print(tokens)
-                print('Root frames :\n %s'%rootTokens)
-            if parented :
-                import_dXtree(rootTokens)
-            else :
-                for tokenname in tokentypes['mesh'] :
-                    obname = tokens[tokenname]['parent']
-                    # object and mesh naming :
-                    # if parent frame has several meshes : obname = meshname = mesh token name,
-                    # if parent frame has only one mesh  : obname = parent frame name, meshname =  mesh token name.
-                    if obname :
-                        meshcount = 0
-                        for child in getChilds(obname) :
-                            if tokens[child]['type'] == 'mesh' : 
-                                meshcount += 1
-                                if meshcount == 2 :
-                                    obname = tokenname
-                                    break
-                    else : obname = tokenname
-
-                    ob = getMesh(obname,tokenname,show_geninfo)
-                    ob.matrix_world = global_matrix
-                    
-            print('done in %.2f\''%(time.clock()-start)) # ,end='\r')
-            
-        else :
-            print('only .x files in text format are currently supported')
-            print('please share your file to make the importer evolve')
-
-
-        return {'FINISHED'}
-        
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/io_directx_bel/templates_x.py b/release/scripts/addons_contrib/io_directx_bel/templates_x.py
deleted file mode 100644
index 7b51e0c..0000000
--- a/release/scripts/addons_contrib/io_directx_bel/templates_x.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# dx 'strict' templates
-# lower() since some apps does not respect it,
-# and to keep the 'as it should be' syntax
-
-defaultTemplates={}
-templatesConvert={}
-
-# mesh template
-defaultTemplates['Mesh'.lower()] = {
-    'uuid' : '<3d82ab44-62da-11cf-ab39-0020af71e433>',
-    'restriction' : '[...]',
-    'members' : (
-        ('dword', 'nVertices'),
-        ('array', 'vector', 'vertices[nVertices]'),
-        ('dword', 'nFaces'),
-        ('array', 'MeshFace', 'faces[nFaces]'),
-    )
-}
-
-defaultTemplates['FrameTransformMatrix'.lower()] = {
-    'uuid' : '<f6f23f41-7686-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('matrix4x4', 'frameMatrix'),
-    )
-}
-
-templatesConvert['matrix4x4'] = 'Matrix( [fields[0][0:4], fields[0][4:8] , fields[0][8:12] , fields[0][12:16]] )'
-defaultTemplates['matrix4x4'.lower()] = {
-    'uuid' : '<f6f23f45-7686-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('array', 'float', 'matrix[16]'),
-    )
-}
-
-#returns [ [vid0,vid1,vid2], [vid1,vid2,vid3,vid4] .. ]
-templatesConvert['meshface'] = 'fields[1]'
-defaultTemplates['MeshFace'.lower()] = {
-    'uuid' : '<3d82ab5f-62da-11cf-ab39-0020af71e433>',
-    'restriction' : 'closed',
-    'members' : (
-        ('dword', 'nFaceVertexIndices'),
-        ('array', 'dword', 'faceVertexIndices[nFaceVertexIndices]')
-    )
-}
-
-defaultTemplates['vector'.lower()] = {
-    'uuid' : '<3d82ab5e-62da-11cf-ab39-0020af71e433>',
-    'restriction' : 'closed',
-    'members' : (
-        ('float', 'x'),
-        ('float', 'y'),
-        ('float', 'z')
-    )
-}
-
-defaultTemplates['Coords2d'.lower()] = {
-    'uuid' : '<f6f23f44-7686-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('float', 'u'),
-        ('float', 'v')
-    )
-}
-
-# returns [ uvAsVertsLocation ]
-templatesConvert['meshtexturecoords'] = 'fields[1]'
-defaultTemplates['MeshTextureCoords'.lower()] = {
-    'uuid' : '<f6f23f40-7686-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('dword', 'nTextureCoords'),
-        ('array', 'Coords2d', 'textureCoords[nTextureCoords]')
-    )
-}
-
-defaultTemplates['meshnormals'.lower()] = {
-    'uuid' : '<f6f23f43-7686-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('dword', 'nNormals'),
-        ('array', 'vector', 'normals[nNormals]'),
-        ('dword', 'nFaceNormals'),
-        ('array', 'MeshFace', 'faceNormals[nFaceNormals]')
-    )
-}
-
-# returns [ nMaterials, [ materialindex of each face ] ]
-templatesConvert['meshmateriallist'] = '[fields[0],fields[2]]'
-defaultTemplates['MeshMaterialList'.lower()] = {
-    'uuid' : '<f6f23f42-7686-11cf-8f52-0040333594a3>',
-    'restriction' : '[Material]',
-    'members' : (
-        ('dword', 'nMaterials'),
-        ('dword', 'nFaceIndexes'),
-        ('array', 'dword', 'faceIndexes[nFaceIndexes]')
-    )
-}
-
-defaultTemplates['Material'.lower()] = {
-    'uuid' : '<3d82ab4d-62da-11cf-ab39-0020af71e433>',
-    'restriction' : '[...]',
-    'members' : (
-        ('colorrgba', 'faceColor'),
-        ('float', 'power'),
-        ('colorrgb', 'specularColor'),
-        ('colorrgb', 'emissiveColor')
-    )
-}
-
-templatesConvert['colorrgba'] = 'fields[:3],fields[3]'
-defaultTemplates['colorrgba'.lower()] = {
-    'uuid' : '<35ff44e0-6c7c-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('float', 'red'),
-        ('float', 'green'),
-        ('float', 'blue'),
-        ('float', 'alpha')
-    )
-}
-
-defaultTemplates['colorrgb'.lower()] = {
-    'uuid' : '<d3e16e81-7835-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('float', 'red'),
-        ('float', 'green'),
-        ('float', 'blue')
-    )
-}
-
-defaultTemplates['TextureFilename'.lower()] = {
-    'uuid' : '<a42790e1-7810-11cf-8f52-0040333594a3>',
-    'restriction' : 'closed',
-    'members' : (
-        ('string', 'filename'),
-    )
-}
-
-defaultTemplates['SkinWeights'.lower()] = {
-    'uuid' : '<6f0d123b-bad2-4167-a0d0-80224f25fabb>',
-    'restriction' : 'closed',
-    'members' : (
-        ('string', 'transformNodeName'),
-        ('dword', 'nWeights'),
-        ('array', 'dword', 'vertexIndices[nWeights]'),
-        ('array', 'float', 'weights[nWeights]'),
-        ('matrix4x4', 'matrixOffset')
-    )
-}
-
-defaultTemplates['XSkinMeshHeader'.lower()] = {
-    'uuid' : '3cf169ce-ff7c-44ab-93c0-f78f62d172e2',
-    'restriction' : 'closed',
-    'members' : (
-        ('word', 'nMaxSkinWeightsPerVertex'),
-        ('word', 'nMaxSkinWeightsPerFace'),
-        ('word', 'nBones')
-    )
-}
diff --git a/release/scripts/addons_contrib/io_export_marmalade.py b/release/scripts/addons_contrib/io_export_marmalade.py
deleted file mode 100644
index 401efe7..0000000
--- a/release/scripts/addons_contrib/io_export_marmalade.py
+++ /dev/null
@@ -1,1474 +0,0 @@
-# ***** 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 3 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, see <http://www.gnu.org/licenses/>.
-# All rights reserved.
-# ***** GPL LICENSE BLOCK *****
-
-# Marmalade SDK is not responsible in any case of the following code.
-# This Blender add-on is freely shared for the Blender and Marmalade user communities.
-
-
-bl_info = {
-    "name": "Marmalade Cross-platform Apps (.group)",
-    "author": "Benoit Muller",
-    "version": (0, 6, 2),
-    "blender": (2, 63, 0),
-    "location": "File > Export > Marmalade cross-platform Apps (.group)",
-    "description": "Export Marmalade Format files (.group)",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Import-Export/Marmalade_Exporter",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "",
-    "category": "Import-Export"}
-
-import os
-import shutil
-from math import radians
-
-import bpy
-from mathutils import Matrix
-
-import mathutils
-import math
-
-import datetime
-
-import subprocess
-
-
-#Container for the exporter settings
-class MarmaladeExporterSettings:
-
-    def __init__(self,
-                 context,
-                 FilePath,
-                 CoordinateSystem=1,
-                 FlipNormals=False,
-                 ApplyModifiers=False,
-                 Scale=100,
-                 AnimFPS=30,
-                 ExportVertexColors=True,
-                 ExportMaterialColors=True,
-                 ExportTextures=True,
-                 CopyTextureFiles=True,
-                 ExportArmatures=False,
-                 ExportAnimationFrames=0,
-                 ExportAnimationActions=0,
-                 ExportMode=1,
-                 MergeModes=0,
-                 Verbose=False):
-        self.context = context
-        self.FilePath = FilePath
-        self.CoordinateSystem = int(CoordinateSystem)
-        self.FlipNormals = FlipNormals
-        self.ApplyModifiers = ApplyModifiers
-        self.Scale = Scale
-        self.AnimFPS = AnimFPS
-        self.ExportVertexColors = ExportVertexColors
-        self.ExportMaterialColors = ExportMaterialColors
-        self.ExportTextures = ExportTextures
-        self.CopyTextureFiles = CopyTextureFiles
-        self.ExportArmatures = ExportArmatures
-        self.ExportAnimationFrames = int(ExportAnimationFrames)
-        self.ExportAnimationActions = int(ExportAnimationActions)
-        self.ExportMode = int(ExportMode)
-        self.MergeModes = int(MergeModes)
-        self.Verbose = Verbose
-        self.WarningList = []
-
-
-def ExportMadeWithMarmaladeGroup(Config):
-    print("----------\nExporting to {}".format(Config.FilePath))
-    if Config.Verbose:
-        print("Opening File...")
-    Config.File = open(Config.FilePath, "w")
-
-    if Config.Verbose:
-        print("Done")
-
-    if Config.Verbose:
-        print("writing group header")
-
-    Config.File.write('// Marmalade group file exported from : %s\n' % bpy.data.filepath)
-    Config.File.write('// Exported %s\n' % str(datetime.datetime.now()))
-    Config.File.write("CIwResGroup\n{\n\tname \"%s\"\n" % bpy.path.display_name_from_filepath(Config.FilePath))
-
-    if Config.Verbose:
-        print("Generating Object list for export... (Root parents only)")
-    if Config.ExportMode == 1:
-        Config.ExportList = [Object for Object in Config.context.scene.objects
-                             if Object.type in {'ARMATURE', 'EMPTY', 'MESH'}
-                             and Object.parent is None]
-    else:
-        ExportList = [Object for Object in Config.context.selected_objects
-                      if Object.type in {'ARMATURE', 'EMPTY', 'MESH'}]
-        Config.ExportList = [Object for Object in ExportList
-                             if Object.parent not in ExportList]
-    if Config.Verbose:
-        print("  List: {}\nDone".format(Config.ExportList))
-
-    if Config.Verbose:
-        print("Setting up...")
-
-    if Config.ExportAnimationFrames:
-        if Config.Verbose:
-            print(bpy.context.scene)
-            print(bpy.context.scene.frame_current)
-        CurrentFrame = bpy.context.scene.frame_current
-    if Config.Verbose:
-        print("Done")
-    
-    Config.ObjectList = []
-    if Config.Verbose:
-        print("Writing Objects...")
-    WriteObjects(Config, Config.ExportList)
-    if Config.Verbose:
-        print("Done")
-
-    if Config.Verbose:
-        print("Objects Exported: {}".format(Config.ExportList))
-
-    if Config.ExportAnimationFrames:
-        if Config.Verbose:
-            print("Writing Animation...")
-        WriteKeyedAnimationSet(Config, bpy.context.scene)
-        bpy.context.scene.frame_current = CurrentFrame
-        if Config.Verbose:
-            print("Done")
-    Config.File.write("}\n")
-    CloseFile(Config)
-    print("Finished")
-
-
-def GetObjectChildren(Parent):
-    return [Object for Object in Parent.children
-            if Object.type in {'ARMATURE', 'EMPTY', 'MESH'}]
-
-
-#Returns the file path of first image texture from Material.
-def GetMaterialTextureFullPath(Config, Material):
-    if Material:
-        #Create a list of Textures that have type "IMAGE"
-        ImageTextures = [Material.texture_slots[TextureSlot].texture for TextureSlot in Material.texture_slots.keys() if Material.texture_slots[TextureSlot].texture.type == "IMAGE"]
-        #Refine a new list with only image textures that have a file source
-        TexImages = [Texture.image for Texture in ImageTextures if getattr(Texture.image, "source", "") == "FILE"]
-        ImageFiles = [Texture.image.filepath for Texture in ImageTextures if getattr(Texture.image, "source", "") == "FILE"]
-        if TexImages:
-            filepath = TexImages[0].filepath
-            if TexImages[0].packed_file:
-                TexImages[0].unpack()
-            if not os.path.exists(filepath):
-                #try relative path to the blend file
-                filepath = os.path.dirname(bpy.data.filepath) + filepath
-            #Marmalade doesn't like jpeg/tif so try to convert in png on the fly
-            if (TexImages[0].file_format == 'JPEG' or TexImages[0].file_format == 'TIFF') and os.path.exists(filepath):
-                marmaladeConvert = os.path.expandvars("%S3E_DIR%\\..\\tools\\ImageMagick\\win32\\convert.exe")
-                if (os.path.exists(marmaladeConvert)):
-                    srcImagefilepath = filepath
-                    filepath = os.path.splitext(filepath)[0] + '.png'
-                    if Config.Verbose:
-                        print("  /!\\ Converting Texture %s in PNG: %s{}..." % (TexImages[0].file_format, filepath))
-                        print('"%s" "%s" "%s"' % (marmaladeConvert, srcImagefilepath, filepath))
-                    subprocess.call([marmaladeConvert, srcImagefilepath, filepath])
-            return filepath
-    return None
-
-
-def WriteObjects(Config, ObjectList, geoFile=None, mtlFile=None, GeoModel=None,  bChildObjects=False):
-    Config.ObjectList += ObjectList
-
-    if bChildObjects == False and Config.MergeModes > 0:
-        if geoFile == None:
-            #we merge objects, so use name of group file for the name of Geo
-            geoFile, mtlFile = CreateGeoMtlFiles(Config, bpy.path.display_name_from_filepath(Config.FilePath))
-            GeoModel = CGeoModel(bpy.path.display_name_from_filepath(Config.FilePath))
-
-    for Object in ObjectList:
-        if Config.Verbose:
-            print("  Writing Object: {}...".format(Object.name))
-        
-        if Config.ExportArmatures and Object.type == "ARMATURE":           
-            Armature = Object.data
-            ParentList = [Bone for Bone in Armature.bones if Bone.parent is None]
-            if Config.Verbose:
-                print("    Writing Armature Bones...")
-            #Create the skel file
-            skelfullname = os.path.dirname(Config.FilePath) + os.sep + "models" + os.sep + "%s.skel" % (StripName(Object.name))
-            ensure_dir(skelfullname)
-            if Config.Verbose:
-                print("      Creating skel file %s" % (skelfullname))
-
-            skelFile = open(skelfullname, "w")
-            skelFile.write('// skel file exported from : %r\n' % os.path.basename(bpy.data.filepath))   
-            skelFile.write("CIwAnimSkel\n")
-            skelFile.write("{\n")
-            skelFile.write("\tnumBones %d\n" % (len(Armature.bones)))
-            Config.File.write("\t\".\models\%s.skel\"\n" % (StripName(Object.name)))
-
-            WriteArmatureParentRootBones(Config, Object, ParentList, skelFile)
-
-            skelFile.write("}\n")
-            skelFile.close()
-            if Config.Verbose:
-                print("    Done")
-
-        ChildList = GetObjectChildren(Object)
-        if Config.ExportMode == 2:  # Selected Objects Only
-            ChildList = [Child for Child in ChildList
-                         if Child in Config.context.selected_objects]
-        if Config.Verbose:
-            print("    Writing Children...")
-        WriteObjects(Config, ChildList, geoFile, mtlFile, GeoModel, True)
-        if Config.Verbose:
-            print("    Done Writing Children")
-
-        if Object.type == "MESH":
-            if Config.Verbose:
-                print("    Generating Mesh...")
-            if Config.ApplyModifiers:
-                if Config.ExportArmatures:
-                    #Create a copy of the object and remove all armature modifiers so an unshaped
-                    #mesh can be created from it.
-                    Object2 = Object.copy()
-                    for Modifier in [Modifier for Modifier in Object2.modifiers if Modifier.type == "ARMATURE"]:
-                        Object2.modifiers.remove(Modifier)
-                    Mesh = Object2.to_mesh(bpy.context.scene, True, "PREVIEW")
-                else:
-                    Mesh = Object.to_mesh(bpy.context.scene, True, "PREVIEW")
-            else:
-                Mesh = Object.to_mesh(bpy.context.scene, False, "PREVIEW")
-            if Config.Verbose:
-                print("    Done")
-                print("    Writing Mesh...")
-
-            # Flip ZY axis (Blender Z up: Marmalade: Y up) ans Scale appropriately
-            X_ROT = mathutils.Matrix.Rotation(-math.pi / 2, 4, 'X')
-
-            if Config.MergeModes == 0:
-                # No merge, so all objects are exported in MODEL SPACE and not in world space
-                # Calculate Scale of the Export
-                meshScale = Object.matrix_world.to_scale()  # Export is working, even if user doesn't have use apply scale in Edit mode.
-
-                scalematrix = Matrix()
-                scalematrix[0][0] = meshScale.x * Config.Scale
-                scalematrix[1][1] = meshScale.y * Config.Scale
-                scalematrix[2][2] = meshScale.z * Config.Scale
-
-                meshRot = Object.matrix_world.to_quaternion()  # Export is working, even if user doesn't have use apply Rotation in Edit mode.
-                Mesh.transform(X_ROT * meshRot.to_matrix().to_4x4() * scalematrix)
-            else:
-                # In Merge mode, we need to keep relative postion of each objects, so we export in WORLD SPACE
-                SCALE_MAT = mathutils.Matrix.Scale(Config.Scale, 4)
-                Mesh.transform(SCALE_MAT * X_ROT * Object.matrix_world)
-
-             # manage merge options
-   
-            if Config.MergeModes == 0:
-                #one geo per Object, so use name of Object for the Geo file
-                geoFile, mtlFile = CreateGeoMtlFiles(Config, StripName(Object.name))
-                GeoModel = CGeoModel(StripName(Object.name))  
-                
-            # Write the Mesh in the Geo file   
-            WriteMesh(Config, Object, Mesh, geoFile, mtlFile, GeoModel)
-
-            if Config.MergeModes == 0:
-                # no merge so finalize the file, and discard the file and geo class
-                FinalizeGeoMtlFiles(Config, geoFile, mtlFile)
-                geoFile = None
-                mtlFile = None
-                GeoModel = None
-            elif Config.MergeModes == 1:
-                # merge in one Mesh, so keep the Geo class and prepare to change object
-                GeoModel.NewObject() 
-            elif Config.MergeModes == 2:
-                # merge several Meshes in one file: so clear the mesh data that we just written in the file,
-                # but keep Materials info that need to be merged across objects
-                GeoModel.ClearAllExceptMaterials()
-
-            if Config.Verbose:
-                print("    Done")
-
-            if Config.ApplyModifiers and Config.ExportArmatures:
-                bpy.data.objects.remove(Object2)
-            bpy.data.meshes.remove(Mesh)
-
-        if Config.Verbose:
-            print("  Done Writing Object: {}".format(Object.name))
-
-    if bChildObjects == False:
-        # we have finish to do all objects
-        if GeoModel:
-            if Config.MergeModes == 1:
-                # we have Merges all objects in one Mesh, so time to write this big mesh in the file
-                GeoModel.PrintGeoMesh(geoFile)
-                # time to write skinfile if any
-                if len(GeoModel.useBonesDict) > 0:
-                    # some mesh was not modified by the armature. so we must skinned the merged mesh.
-                    # So unskinned vertices from unarmatured meshes, are assigned to the root bone of the armature
-                    for i in range(0, len(GeoModel.vList)):
-                        if not i in GeoModel.skinnedVertices:
-                            GeoModel.skinnedVertices.append(i)
-                            useBonesKey = pow(2, GeoModel.armatureRootBoneIndex)
-                            vertexGroupIndices = list((GeoModel.armatureRootBoneIndex,))
-                            if useBonesKey not in GeoModel.useBonesDict:                          
-                                GeoModel.mapVertexGroupNames[GeoModel.armatureRootBoneIndex] = StripBoneName(GeoModel.armatureRootBone.name)
-                                VertexList = []
-                                VertexList.append("\t\tvertWeights { %d, 1.0}" % i)
-                                GeoModel.useBonesDict[useBonesKey] = (vertexGroupIndices, VertexList)
-                            else:
-                                pair_ListGroupIndices_ListAssignedVertices = GeoModel.useBonesDict[useBonesKey]
-                                pair_ListGroupIndices_ListAssignedVertices[1].append("\t\tvertWeights { %d, 1.0}" % i)
-                                GeoModel.useBonesDict[useBonesKey] = pair_ListGroupIndices_ListAssignedVertices
-                    # now generates the skin file
-                    PrintSkinWeights(Config, GeoModel.armatureObjectName, GeoModel.useBonesDict, GeoModel.mapVertexGroupNames, GeoModel.name)
-            if Config.MergeModes > 0:
-                WriteMeshMaterialsForGeoModel(Config, mtlFile, GeoModel)
-                FinalizeGeoMtlFiles(Config, geoFile, mtlFile)
-        geoFile = None
-        mtlFile = None
-        GeoModel = None
-
-
-def CreateGeoMtlFiles(Config, Name):
-    #Create the geo file
-    geofullname = os.path.dirname(Config.FilePath) + os.sep + "models" + os.sep + "%s.geo" % Name
-    ensure_dir(geofullname)
-    if Config.Verbose:
-        print("      Creating geo file %s" % (geofullname))  
-    geoFile = open(geofullname, "w")
-    geoFile.write('// geo file exported from : %r\n' % os.path.basename(bpy.data.filepath))
-    geoFile.write("CIwModel\n")
-    geoFile.write("{\n")
-    geoFile.write("\tname \"%s\"\n" % Name)
-    # add it to the group
-    Config.File.write("\t\".\models\%s.geo\"\n" % Name)
-
-    # Create the mtl file
-    mtlfullname = os.path.dirname(Config.FilePath) + os.sep + "models" + os.sep + "%s.mtl" % Name
-    ensure_dir(mtlfullname)
-    if Config.Verbose:
-        print("      Creating mtl file %s" % (mtlfullname))
-    mtlFile = open(mtlfullname, "w")
-    mtlFile.write('// mtl file exported from : %r\n' % os.path.basename(bpy.data.filepath))   
-    return geoFile, mtlFile
-
-
-def FinalizeGeoMtlFiles(Config, geoFile, mtlFile):
-    if Config.Verbose:
-        print("      Closing geo file")  
-    geoFile.write("}\n")
-    geoFile.close()
-    if Config.Verbose:
-        print("      Closing mtl file")  
-    mtlFile.close()
-
-
-def WriteMesh(Config, Object, Mesh,  geoFile=None, mtlFile=None, GeoModel=None):
-    if geoFile == None or mtlFile == None:
-        print (" ERROR not geo file arguments in WriteMesh method")
-        return
-
-    if GeoModel == None:
-        print (" ERROR not GeoModel arguments in WriteMesh method")
-        return
-
-    BuildOptimizedGeo(Config, Object, Mesh, GeoModel)
-    if Config.MergeModes == 0 or Config.MergeModes == 2:
-        #if we don't merge, or if we write several meshes into one file ... write the mesh everytime we do an object
-        GeoModel.PrintGeoMesh(geoFile)
- 
-    if Config.Verbose:
-        print("      Done\n      Writing Mesh Materials...")
-
-    if Config.MergeModes == 0:
-        #No merge, so we can diretly write the Mtl file associated to this object
-        WriteMeshMaterialsForGeoModel(Config, mtlFile, GeoModel)
-
-    if Config.Verbose:
-        print("      Done")
-  
-    if Config.ExportArmatures:
-        if Config.Verbose:
-            print("      Writing Mesh Weights...")
-        WriteMeshSkinWeightsForGeoModel(Config, Object, Mesh, GeoModel)
-        if Config.Verbose:
-            print("      Done")
-
-
-###### optimized version fo Export, can be used also to merge several object in one single geo File ######
-
-# CGeoModel
-#  -> List Vertices
-#  -> List Normales
-#  -> List uv 0
-#  -> List uv 1
-#  -> List Vertex Colors
-#  -> List Materials
-#       -> Material name
-#       -> Blender Material Object
-#       -> List Tris -> Stream Indices v,vn,uv0,uv1,vc
-#       -> List Quads -> Stream Indices v,vn,uv0,uv1,vc
-
-
-#############
-#Store one Point of a Quad or Tri in marmalade geo format: //index-list is: { <int> <int> <int> <int> <int> }   //v,vn,uv0,uv1,vc
-#############                           
-class CGeoIndexList:
-    __slots__ = "v", "vn", "uv0", "uv1", "vc"
-    
-    def __init__(self, v, vn, uv0, uv1, vc):
-        self.v = v
-        self.vn = vn
-        self.uv0 = uv0
-        self.uv1 = uv1
-        self.vc = vc
-
-        
-#############
-#Store a Quad or a Tri in marmalade geo format : 3 or 4 CIndexList depending it is a Tri or a Quad
-#############                        
-class CGeoPoly:
-    __slots__ = "pointsList",
-    
-    def __init__(self):
-        self.pointsList = []
-
-    def AddPoint(self, v, vn, uv0, uv1, vc):
-        self.pointsList.append( CGeoIndexList(v, vn, uv0, uv1, vc))
-
-    def PointsCount(self):
-        return len(self.pointsList)
-
-    def PrintPoly(self, geoFile):
-        if len(self.pointsList) == 3:
-            geoFile.write("\t\t\t\tt ")
-        if len(self.pointsList) == 4:
-            geoFile.write("\t\t\t\tq ")
-        for point in self.pointsList:
-            geoFile.write(" {%d, %d, %d, %d, %d}" % (point.v, point.vn, point.uv0, point.uv1, point.vc))
-        geoFile.write("\n")
-
-
-#############
-#Store all the poly (tri or quad) assigned to a Material in marmalade geo format
-#############                        
-class CGeoMaterialPolys:
-    __slots__ = "name", "material", "quadList", "triList", "currentPoly"
-    
-    def __init__(self, name, material=None):
-        self.name = name
-        self.material = material
-        self.quadList = []
-        self.triList = []
-        self.currentPoly = None
-
-    def BeginPoly(self):
-        self.currentPoly = CGeoPoly()
-
-    def AddPoint(self, v, vn, uv0, uv1, vc):
-        self.currentPoly.AddPoint(v, vn, uv0, uv1, vc)       
-             
-    def EndPoly(self):
-        if (self.currentPoly.PointsCount() == 3):
-            self.triList.append(self.currentPoly)
-        if (self.currentPoly.PointsCount() == 4):
-            self.quadList.append(self.currentPoly)
-        self.currentPoly = None
-
-    def ClearPolys(self):
-        self.quadList = []
-        self.triList = []
-        self.currentPoly = None
-
-    def PrintMaterialPolys(self, geoFile):
-        geoFile.write("\t\tCSurface\n")
-        geoFile.write("\t\t{\n")
-        geoFile.write("\t\t\tmaterial \"%s\"\n" % self.name)
-        if self.triList:
-            geoFile.write("\t\t\tCTris\n")
-            geoFile.write("\t\t\t{\n")
-            geoFile.write("\t\t\t\tnumTris %d\n" % (len(self.triList)))
-            for poly in self.triList:
-                poly.PrintPoly(geoFile)
-            geoFile.write("\t\t\t}\n")
-
-        if self.quadList:
-            geoFile.write("\t\t\tCQuads\n")
-            geoFile.write("\t\t\t{\n")
-            geoFile.write("\t\t\t\tnumQuads %d\n" % (len(self.quadList)))
-            for poly in self.quadList:
-                poly.PrintPoly(geoFile)
-            geoFile.write("\t\t\t}\n")
-        geoFile.write("\t\t}\n")
-
-
-#############
-#Store all the information on a Model/Mesh (vertices, normal, certcies color, uv0, uv1, TRI, QUAD) in marmalade geo format
-#############  
-class CGeoModel:
-    __slots__ = ("name", "MaterialsDict", "vList", "vnList", "vcList", "uv0List", "uv1List",
-                "currentMaterialPolys", "vbaseIndex","vnbaseIndex", "uv0baseIndex", "uv1baseIndex",
-                "armatureObjectName", "useBonesDict", "mapVertexGroupNames", "armatureRootBone", "armatureRootBoneIndex", "skinnedVertices")
-                
-    def __init__(self, name):
-        self.name = name
-        self.MaterialsDict = {}
-        self.vList = []
-        self.vnList = []
-        self.vcList = []
-        self.uv0List = []
-        self.uv1List = []
-        self.currentMaterialPolys = None
-        #used xx baseIndex are used when merging several blender objects into one Mesh in the geo file (internal offset)
-        self.vbaseIndex = 0
-        self.vnbaseIndex = 0
-        self.uv0baseIndex = 0
-        self.uv1baseIndex = 0
-
-        # Store some information for skin management , when we merge several object in one big mesh (MergeModes 1)
-        # can only work if in the object list only one is rigged with an armature... and if it is located in 0,0,0
-        self.armatureObjectName = ""
-        #useBonesKey : bit field, where each bit is a VertexGroup.Index): Sum(2^VertGroupIndex).
-        #useBonesDict[useBonesKey] = tuple(VertexGroups.group, list(Vertex))
-        self.useBonesDict = {}
-        self.mapVertexGroupNames = {}
-        self.armatureRootBone = None
-        self.armatureRootBoneIndex = 0
-        self.skinnedVertices = []
-
-
-
-    def AddVertex(self, vertex):
-        self.vList.append(vertex.copy())
-
-    def AddVertexNormal(self, vertexN):
-        self.vnList.append(vertexN.copy())
-
-    # add a uv coordiantes and return the current Index in the stream (index is local to the object, when we merge several object into a one Mesh)
-    def AddVertexUV0(self, u, v):
-        self.uv0List.append((u, v))
-        return len(self.uv0List) - 1 - self.uv0baseIndex 
-
-    def AddVertexUV1(self, u, v):
-        self.uv1List.append((u, v))
-        return len(self.uv1List) - 1 - self.uv1baseIndex 
-
-    # add a vertexcolor if it doesn't already exist and return the current Index in the stream (index is global to all objects, when we merge several object into a one Mesh)
-    def AddVertexColor(self, r, g, b, a):
-        for i in range(0, len(self.vcList)):
-            col = self.vcList[i]
-            if col[0] == r and col[1] == g and col[2] == b and col[3] == a:
-                return i
-
-        self.vcList.append((r, g, b, a))
-        return len(self.vcList)-1
-
-    def BeginPoly(self, MaterialName, material=None):
-        if MaterialName not in self.MaterialsDict:
-            self.currentMaterialPolys = CGeoMaterialPolys(MaterialName, material)
-        else:
-            self.currentMaterialPolys = self.MaterialsDict[MaterialName]
-        self.currentMaterialPolys.BeginPoly()
-
-    def AddPoint(self, v, vn, uv0, uv1, vc):
-        if v != -1:
-            v += self.vbaseIndex
-        if vn != -1:
-            vn += self.vnbaseIndex
-        if uv0 != -1:
-            uv0 += self.uv0baseIndex
-        if uv1 != -1:
-            uv1 += self.uv1baseIndex
-                
-        self.currentMaterialPolys.AddPoint(v, vn, uv0, uv1, vc)       
-                              
-    def EndPoly(self):
-        self.currentMaterialPolys.EndPoly()
-        self.MaterialsDict[self.currentMaterialPolys.name] = self.currentMaterialPolys
-        self.currentMaterialPolys = None
-
-    def NewObject(self):
-        #used in Merge mode 1: allows to merge several blender objects into one Mesh.
-        self.vbaseIndex = len(self.vList)
-        self.vnbaseIndex = len(self.vnList)
-        self.uv0baseIndex = len(self.uv0List)
-        self.uv1baseIndex = len(self.uv1List)
-
-    def ClearAllExceptMaterials(self):
-        #used in Merge mode 2: one geo with several mesh
-        self.vList = []
-        self.vnList = []
-        self.vcList = []
-        self.uv0List = []
-        self.uv1List = []
-        self.currentMaterialPolys = None
-        self.vbaseIndex = 0
-        self.vnbaseIndex = 0
-        self.uv0baseIndex = 0
-        self.uv1baseIndex = 0
-        for GeoMaterialPolys in self.MaterialsDict.values():
-            GeoMaterialPolys.ClearPolys()
-        self.useBonesDict = {}
-        self.mapVertexGroupNames = {}
-        self.armatureObjectName = ""
-        self.armatureRootBone = None
-        self.armatureRootBoneIndex = 0
-        self.skinnedVertices = []
-
-    def PrintGeoMesh(self, geoFile):
-        geoFile.write("\tCMesh\n")
-        geoFile.write("\t{\n")
-        geoFile.write("\t\tname \"%s\"\n" % (StripName(self.name)))
-
-        if self.vList:
-            geoFile.write("\t\tCVerts\n")
-            geoFile.write("\t\t{\n")
-            geoFile.write("\t\t\tnumVerts %d\n" % len(self.vList))
-            for vertex in self.vList:
-                geoFile.write("\t\t\tv { %.9f, %.9f, %.9f }\n" % (vertex[0], vertex[1], vertex[2]))                      
-            geoFile.write("\t\t}\n")
-
-        if self.vnList:
-            geoFile.write("\t\tCVertNorms\n")
-            geoFile.write("\t\t{\n")
-            geoFile.write("\t\t\tnumVertNorms  %d\n" % len(self.vnList))
-            for vertexn in self.vnList:
-                geoFile.write("\t\t\tvn { %.9f, %.9f, %.9f }\n" % (vertexn[0], vertexn[1], vertexn[2]))                      
-            geoFile.write("\t\t}\n")
-
-        if self.vcList:
-            geoFile.write("\t\tCVertCols\n")
-            geoFile.write("\t\t{\n")
-            geoFile.write("\t\t\tnumVertCols %d\n" % len(self.vcList))
-            for color in self.vcList:
-                geoFile.write("\t\t\tcol { %.6f, %.6f, %.6f, %.6f }\n" % (color[0], color[1], color[2], color[3])) #alpha is not supported on blender for vertex colors           
-            geoFile.write("\t\t}\n")
-
-        if self.uv0List:
-            geoFile.write("\t\tCUVs\n")
-            geoFile.write("\t\t{\n")
-            geoFile.write("\t\t\tsetID 0\n")
-            geoFile.write("\t\t\tnumUVs %d\n" % len(self.uv0List))
-            for uv in self.uv0List:
-                 geoFile.write("\t\t\tuv { %.9f, %.9f }\n" % (uv[0], uv[1]))                       
-            geoFile.write("\t\t}\n")
-
-        if self.uv1List:
-            geoFile.write("\t\tCUVs\n")
-            geoFile.write("\t\t{\n")
-            geoFile.write("\t\t\tsetID 1\n")
-            geoFile.write("\t\t\tnumUVs %d\n" % len(self.uv1List))
-            for uv in self.uv1List:
-                 geoFile.write("\t\t\tuv { %.9f, %.9f }\n" % (uv[0], uv[1]))                       
-            geoFile.write("\t\t}\n")
-
-        for GeoMaterialPolys in self.MaterialsDict.values():
-            GeoMaterialPolys.PrintMaterialPolys(geoFile)
-        geoFile.write("\t}\n")
-
-    def GetMaterialList(self):
-        return list(self.MaterialsDict.keys())
-
-    def GetMaterialByName(self, name):
-        if name in self.MaterialsDict:
-            return self.MaterialsDict[name].material
-        else:
-            return None       
-
-
-
-#############
-# iterates faces, vertices ... and store the information in the GeoModel container
-def BuildOptimizedGeo(Config, Object, Mesh, GeoModel):
-    if GeoModel == None:
-        GeoModel = CGeoModel(filename, Object.name)
-
-    #Ensure tessfaces data are here
-    Mesh.update (calc_tessface=True)
-    
-    #Store Vertex stream, and Normal stream (use directly the order from blender collection
-    for Vertex in Mesh.vertices:
-        GeoModel.AddVertex(Vertex.co)
-        Normal = Vertex.normal
-        if Config.FlipNormals:
-            Normal = -Normal
-        GeoModel.AddVertexNormal(Normal)
-    #Check if some colors have been defined
-    vertexColors = None
-    if Config.ExportVertexColors and (len(Mesh.vertex_colors) > 0):
-        vertexColors = Mesh.tessface_vertex_colors[0].data
-
-    #Check if some uv coordinates have been defined
-    UVCoordinates = None
-    if Config.ExportTextures and (len(Mesh.uv_textures) > 0):
-        for UV in Mesh.tessface_uv_textures:
-            if UV.active_render:
-                UVCoordinates = UV.data
-                break
-
-    #Iterate on Faces and Store the poly (quad or tri) and the associate colors,UVs
-    for Face in Mesh.tessfaces:
-        # stream for vertex (we use the same for normal)
-        Vertices = list(Face.vertices)
-        if Config.CoordinateSystem == 1:
-            Vertices = Vertices[::-1]
-        # stream for vertex colors
-        if vertexColors:
-            MeshColor = vertexColors[Face.index]
-            if len(Vertices) == 3:
-                FaceColors = list((MeshColor.color1, MeshColor.color2, MeshColor.color3))
-            else:
-                FaceColors = list((MeshColor.color1, MeshColor.color2, MeshColor.color3, MeshColor.color4))
-            if Config.CoordinateSystem == 1:
-                FaceColors = FaceColors[::-1]
-            colorIndex = []
-            for color in FaceColors:
-                index = GeoModel.AddVertexColor(color[0], color[1], color[2], 1)  #rgba => no alpha on vertex color in Blender so use 1
-                colorIndex.append(index)
-        else:
-            colorIndex = list((-1,-1,-1,-1))
-
-        # stream for UV0 coordinates
-        if UVCoordinates:
-            uvFace = UVCoordinates[Face.index]
-            uvVertices = []
-            for uvVertex in uvFace.uv:
-                uvVertices.append(tuple(uvVertex))
-            if Config.CoordinateSystem == 1:
-                uvVertices = uvVertices[::-1]
-            uv0Index = []
-            for uvVertex in uvVertices:
-                index = GeoModel.AddVertexUV0(uvVertex[0], 1 - uvVertex[1]) 
-                uv0Index.append(index)
-        else:
-            uv0Index = list((-1, -1, -1, -1))
-
-        # stream for UV1 coordinates
-        uv1Index = list((-1, -1, -1, -1))
-
-        mat = None
-        # find the associated material
-        if Face.material_index < len(Mesh.materials):
-            mat = Mesh.materials[Face.material_index]
-        if mat:
-            matName =  mat.name
-        else:
-            matName = "NoMaterialAssigned"  # There is no material assigned in blender !!!, exporter have generated a default one          
-            
-        # now on the material, generates the tri/quad in v,vn,uv0,uv1,vc stream index
-        GeoModel.BeginPoly(matName, mat)
-
-        for i in range(0, len(Vertices)):
-            GeoModel.AddPoint(Vertices[i], Vertices[i], uv0Index[i], uv1Index[i], colorIndex[i])
-
-        GeoModel.EndPoly()
-
-
-                              
-#############
-# Get the list of Material in use by the CGeoModel
-def WriteMeshMaterialsForGeoModel(Config, mtlFile, GeoModel):
-    for matName in GeoModel.GetMaterialList():
-        Material = GeoModel.GetMaterialByName(matName)
-        WriteMaterial(Config, mtlFile, Material)
-
-
-def WriteMaterial(Config, mtlFile, Material=None):
-    mtlFile.write("CIwMaterial\n")
-    mtlFile.write("{\n")
-    if Material:
-        mtlFile.write("\tname \"%s\"\n" % Material.name)
-
-        if Config.ExportMaterialColors:
-            #if bpy.context.scene.world:
-            #    MatAmbientColor = Material.ambient * bpy.context.scene.world.ambient_color
-            MatAmbientColor = Material.ambient * Material.diffuse_color
-            mtlFile.write("\tcolAmbient {%.2f,%.2f,%.2f,%.2f} \n" % (min(255, MatAmbientColor[0] * 255), min(255, MatAmbientColor[1] * 255), min(255, MatAmbientColor[2] * 255), min(255, Material.alpha * 255)))
-            MatDiffuseColor = 255 * Material.diffuse_intensity * Material.diffuse_color
-            MatDiffuseColor = min((255, 255, 255)[:],MatDiffuseColor[:])
-            mtlFile.write("\tcolDiffuse  {%.2f,%.2f,%.2f} \n" % (MatDiffuseColor[:]))
-            MatSpecularColor = 255 * Material.specular_intensity * Material.specular_color
-            MatSpecularColor = min((255, 255, 255)[:],MatSpecularColor[:])
-            mtlFile.write("\tcolSpecular  {%.2f,%.2f,%.2f} \n" % (MatSpecularColor[:]))
-            # EmitColor = Material.emit * Material.diffuse_color
-            # mtlFile.write("\tcolEmissive {%.2f,%.2f,%.2f} \n" % (EmitColor* 255)[:])    
-    else:
-        mtlFile.write("\tname \"NoMaterialAssigned\" // There is no material assigned in blender !!!, exporter have generated a default one\n")
-
-    #Copy texture
-    if Config.ExportTextures:
-        Texture = GetMaterialTextureFullPath(Config, Material)
-        if Texture:
-            mtlFile.write("\ttexture0 .\\textures\\%s\n" % (bpy.path.basename(Texture)))
-            
-            if Config.CopyTextureFiles:
-                if not os.path.exists(Texture):
-                    #try relative path to the blend file
-                    Texture = os.path.dirname(bpy.data.filepath) + Texture
-                if os.path.exists(Texture):
-                    textureDest = os.path.dirname(Config.FilePath) + os.sep + "models" + os.sep + "textures" + os.sep + ("%s" % bpy.path.basename(Texture))
-                    ensure_dir(textureDest)
-                    if Config.Verbose:
-                        print("      Copying the texture file %s ---> %s" % (Texture, textureDest))
-                    shutil.copy(Texture, textureDest)
-                else:
-                    if Config.Verbose:
-                        print("      CANNOT Copy texture file (not found) %s" % (Texture))
-    mtlFile.write("}\n")
-
-def GetFirstRootBone(ArmatureObject):
-    ArmatureBones = ArmatureObject.data.bones
-    ParentBoneList = [Bone for Bone in ArmatureBones if Bone.parent is None]
-    if ParentBoneList:
-        return ParentBoneList[0]
-    return None
-
-
-def GetVertexGroupFromBone(Object, Bone):
-    if Bone:
-        vertexGroupList = [VertexGroup for VertexGroup in Object.vertex_groups  if VertexGroup.name == Bone.name]
-        if vertexGroupList:
-            return vertexGroupList[0]
-    return None
-
-
-def GetBoneListNames(Bones):
-    boneList = []
-    for Bone in Bones:
-        boneList.append(Bone.name)
-        boneList += GetBoneListNames(Bone.children)
-    return boneList
-
-
-def FindUniqueIndexForRootBone(Object, RootVertexGroup):
-    if RootVertexGroup:
-        return RootVertexGroup.index
-    else:
-        #If there is not VertexGroup associated to the root bone name, we don't have a vertex index.
-        #so use the next available free index
-        return len(Object.vertex_groups)
-
-         
-def WriteMeshSkinWeightsForGeoModel(Config, Object, Mesh, GeoModel):
-    ArmatureList = [Modifier for Modifier in Object.modifiers if Modifier.type == "ARMATURE"]
-    if ArmatureList:
-        ArmatureObject = ArmatureList[0].object
-        if ArmatureObject is None:
-            return
-        RootBone = GetFirstRootBone(ArmatureObject)
-        RootVertexGroup = GetVertexGroupFromBone(Object, RootBone)
-        BoneNames = GetBoneListNames(ArmatureObject.data.bones)
-
-        GeoModel.armatureObjectName = StripName(ArmatureObject.name)
-        if RootBone:
-            GeoModel.armatureRootBone = RootBone
-            GeoModel.armatureRootBoneIndex = FindUniqueIndexForRootBone(Object, RootVertexGroup)
-
-        # Marmalade need to declare a vertex per list of affected bones
-        # so first we have to get all the combinations of affected bones that exist in the mesh
-        # to build thoses groups, we build a unique key (like a bit field, where each bit is a VertexGroup.Index): Sum(2^VertGroupIndex)... so we have a unique Number per combinations
-        
-        for Vertex in Mesh.vertices:
-            VertexIndex = Vertex.index + GeoModel.vbaseIndex
-            AddVertexToDicionarySkinWeights(Config, Object, Mesh, Vertex, GeoModel.useBonesDict, GeoModel.mapVertexGroupNames, VertexIndex, RootBone, RootVertexGroup, BoneNames)
-            GeoModel.skinnedVertices.append(VertexIndex)
-
-        if Config.MergeModes != 1:
-            # write skin file directly
-            PrintSkinWeights(Config, GeoModel.armatureObjectName, GeoModel.useBonesDict, GeoModel.mapVertexGroupNames, StripName(Object.name))
-
-
-def PrintSkinWeights(Config, ArmatureObjectName, useBonesDict, mapVertexGroupNames, GeoName):        
-        #Create the skin file
-        skinfullname = os.path.dirname(Config.FilePath) + os.sep + "models" + os.sep + "%s.skin" % GeoName
-        ensure_dir(skinfullname)
-        if Config.Verbose:
-            print("      Creating skin file %s" % (skinfullname))
-        skinFile = open(skinfullname, "w")
-        skinFile.write('// skin file exported from : %r\n' % os.path.basename(bpy.data.filepath))   
-        skinFile.write("CIwAnimSkin\n")
-        skinFile.write("{\n")
-        skinFile.write("\tskeleton \"%s\"\n" % ArmatureObjectName)
-        skinFile.write("\tmodel \"%s\"\n" % GeoName)
-
-        # now we have Bones grouped in the dictionary , along with the associated influenced vertex weighting
-        # So simply iterate the dictionary
-        Config.File.write("\t\".\models\%s.skin\"\n" % GeoName)
-        for pair_ListGroupIndices_ListAssignedVertices in useBonesDict.values():
-            skinFile.write("\tCIwAnimSkinSet\n")
-            skinFile.write("\t{\n")
-            skinFile.write("\t\tuseBones {")
-            for vertexGroupIndex in pair_ListGroupIndices_ListAssignedVertices[0]:
-                skinFile.write(" %s" % mapVertexGroupNames[vertexGroupIndex])
-            skinFile.write(" }\n")
-            skinFile.write("\t\tnumVerts %d\n" % len(pair_ListGroupIndices_ListAssignedVertices[1]))
-            for VertexWeightString in pair_ListGroupIndices_ListAssignedVertices[1]:
-                skinFile.write(VertexWeightString)
-            skinFile.write("\t}\n")
-
-        skinFile.write("}\n")
-        skinFile.close()
-
-
-def AddVertexToDicionarySkinWeights(Config, Object, Mesh, Vertex, useBonesDict, mapVertexGroupNames, VertexIndex, RootBone, RootVertexGroup, BoneNames):
-    #build useBones
-    useBonesKey = 0
-    vertexGroupIndices = []
-    weightTotal = 0.0
-    if (len(Vertex.groups)) > 4:
-        print ("ERROR Vertex %d is influenced by more than 4 bones\n" % (VertexIndex))
-    for VertexGroup in Vertex.groups:
-        if (VertexGroup.weight > 0):
-            groupName = Object.vertex_groups[VertexGroup.group].name
-            if groupName in BoneNames:
-                mapVertexGroupNames[VertexGroup.group] = StripBoneName(groupName)
-                if (len(vertexGroupIndices))<4:  #ignore if more 4 bones are influencing the vertex
-                    useBonesKey = useBonesKey + pow(2, VertexGroup.group)
-                    vertexGroupIndices.append(VertexGroup.group)
-                    weightTotal = weightTotal + VertexGroup.weight
-    if (weightTotal == 0):
-        bWeightTotZero = True  #avoid divide by zero later on
-        if (RootBone):
-            if Config.Verbose:
-                print(" Warning Weight is ZERO for vertex %d => Add it to the root bone" % (VertexIndex))
-            RootBoneGroupIndex = FindUniqueIndexForRootBone(Object, RootVertexGroup)
-            mapVertexGroupNames[RootBoneGroupIndex] = StripBoneName(RootBone.name)
-            useBonesKey = pow(2, RootBoneGroupIndex)
-            vertexGroupIndices = list((RootBoneGroupIndex,))
-
-            weightTotal = 1
-    else:
-        bWeightTotZero = False
-    
-    if len(vertexGroupIndices) > 0:
-        vertexGroupIndices.sort();
-           
-        #build the vertex weight string: vertex indices, followed by influence weight for each bone
-        VertexWeightString = "\t\tvertWeights { %d" % (VertexIndex)
-        for vertexGroupIndex in vertexGroupIndices:
-            #get the weight of this specific VertexGroup (aka bone)
-            boneWeight = 1
-            for VertexGroup in Vertex.groups:
-                if VertexGroup.group == vertexGroupIndex:
-                    boneWeight = VertexGroup.weight
-            #calculate the influence of this bone compared to the total of weighting applied to this Vertex
-            if not bWeightTotZero:
-                VertexWeightString += ", %.7f" % (boneWeight / weightTotal)
-            else:
-                VertexWeightString += ", %.7f" % (1.0 / len(vertexGroupIndices))
-        VertexWeightString += "}"
-        if bWeightTotZero:
-            VertexWeightString += " // total weight was zero in blender , export assign it to the RootBone with weight 1." 
-        if (len(Vertex.groups)) > 4:
-            VertexWeightString += " // vertex is associated to more than 4 bones in blender !! skip some bone association (was associated to %d bones)." % (len(Vertex.groups))
-        VertexWeightString += "\n"
-           
-        #store in dictionnary information
-        if useBonesKey not in useBonesDict:
-            VertexList = []
-            VertexList.append(VertexWeightString)
-            useBonesDict[useBonesKey] = (vertexGroupIndices, VertexList)
-        else:
-            pair_ListGroupIndices_ListAssignedVertices = useBonesDict[useBonesKey]
-            pair_ListGroupIndices_ListAssignedVertices[1].append(VertexWeightString)
-            useBonesDict[useBonesKey] = pair_ListGroupIndices_ListAssignedVertices
-    else:
-        print ("ERROR Vertex %d is not skinned (it doesn't belong to any vertex group\n" % (VertexIndex)) 
-
-
-
-############# ARMATURE: Bone export, and Bone animation export 
-
-         
-def WriteArmatureParentRootBones(Config, Object, RootBonesList, skelFile):
-
-    if len(RootBonesList) > 1:
-        print(" /!\\  WARNING ,Marmelade need only one ROOT bone per armature, there is %d root bones " % len(RootBonesList))
-        print(RootBonesList)
-        
-    PoseBones = Object.pose.bones
-    for Bone in RootBonesList:
-        if Config.Verbose:
-            print("      Writing Root Bone: {}...".format(Bone.name))
-
-        PoseBone = PoseBones[Bone.name]
-        WriteBonePosition(Config, Object, Bone, PoseBones, PoseBone, skelFile, True)
-        if Config.Verbose:
-            print("      Done")
-        WriteArmatureChildBones(Config, Object, Bone.children, skelFile)
-
-            
-def WriteArmatureChildBones(Config, Object, BonesList, skelFile):
-    PoseBones = Object.pose.bones
-    for Bone in BonesList:
-        if Config.Verbose:
-            print("      Writing Child Bone: {}...".format(Bone.name))
-        PoseBone = PoseBones[Bone.name]
-        WriteBonePosition(Config, Object, Bone, PoseBones, PoseBone, skelFile, True)
-        if Config.Verbose:
-            print("      Done")
-            
-        WriteArmatureChildBones(Config, Object, Bone.children, skelFile)
-
-
-def WriteBonePosition(Config, Object, Bone, PoseBones, PoseBone, File, isRestPoseNotAnimPose):
-    # Compute armature scale : 
-    # Many others exporter require sthe user to do Apply Scale in Object Mode to have 1,1,1 scale and so that anim data are correctly scaled
-    # Here we retreive the Scale of the Armture Object.matrix_world.to_scale() and we use it to scale the bones :-)
-    # So new Blender user should not complain about bad animation export if they forgot to apply the Scale to 1,1,1
-    
-    armScale = Object.matrix_world.to_scale()
-    armRot = Object.matrix_world.to_quaternion()
-    if isRestPoseNotAnimPose:
-        #skel file, bone header
-        File.write("\tCIwAnimBone\n")
-        File.write("\t{\n")
-        File.write("\t\tname \"%s\"\n" % StripBoneName(Bone.name))
-        #get bone local matrix for rest pose
-        if Bone.parent:
-            File.write("\t\tparent \"%s\"\n" % StripBoneName(Bone.parent.name))
-            localmat = Bone.parent.matrix_local.inverted() * Bone.matrix_local
-        else:
-            localmat = Bone.matrix_local
-    else:
-        #anim file, bone header
-        File.write("\t\t\n")
-        File.write("\t\tbone \"%s\" \n" % StripBoneName(Bone.name))
-        localmat = PoseBone.matrix
-        #get bone local matrix for current anim pose
-        if Bone.parent:
-            ParentPoseBone = PoseBones[Bone.parent.name]
-            localmat = ParentPoseBone.matrix.inverted() * PoseBone.matrix
-        else:
-            localmat = PoseBone.matrix
-
-    if not Bone.parent:
-        #Flip Y Z axes (only on root bone, other bones are local to root bones, so no need to rotate)
-        X_ROT = mathutils.Matrix.Rotation(-math.pi / 2, 4, 'X')
-        if Config.MergeModes > 0:
-            # Merge mode is in world coordinates and not in model coordinates: so apply the world coordinate on the rootbone
-            localmat = X_ROT * Object.matrix_world * localmat
-            armScale.x =  armScale.y = armScale.z = 1
-        else:
-            localmat= X_ROT * armRot.to_matrix().to_4x4() * localmat #apply the armature rotation on the root bone
-
-    
-    loc = localmat.to_translation()
-    quat = localmat.to_quaternion()
-
-    #Scale the bone
-    loc.x *= (armScale.x * Config.Scale)
-    loc.y *= (armScale.y * Config.Scale)
-    loc.z *= (armScale.z * Config.Scale)
-    
-    File.write("\t\tpos { %.9f, %.9f, %.9f }\n" % (loc[0], loc[1], loc[2]))
-    File.write("\t\trot { %.9f, %.9f, %.9f, %.9f }\n" % (quat.w, quat.x, quat.y, quat.z))
-
-    if isRestPoseNotAnimPose:
-        File.write("\t}\n")
-
-      
-def WriteKeyedAnimationSet(Config, Scene):  
-    for Object in [Object for Object in Config.ObjectList if Object.animation_data]:
-        if Config.Verbose:
-            print("  Writing Animation Data for Object: {}".format(Object.name))
-        actions = []
-        if Config.ExportAnimationActions == 0 and Object.animation_data.action:
-            actions.append(Object.animation_data.action)
-        else:
-            actions = bpy.data.actions[:]   
-            DefaultAction = Object.animation_data.action
-        
-        for Action in actions:
-            if Config.ExportAnimationActions == 0:
-                animFileName = StripName(Object.name)
-            else:
-                Object.animation_data.action = Action
-                animFileName = "%s_%s" % (StripName(Object.name),StripName(Action.name))
-                          
-            #Object animated (aka single bone object)
-            #build key frame time list
-
-            keyframeTimes = set()
-            if Config.ExportAnimationFrames == 1:
-                # Exports only key frames
-                for FCurve in Action.fcurves:
-                    for Keyframe in FCurve.keyframe_points:
-                        if Keyframe.co[0] < Scene.frame_start:
-                            keyframeTimes.add(Scene.frame_start)
-                        elif Keyframe.co[0] > Scene.frame_end:
-                            keyframeTimes.add(Scene.frame_end)
-                        else:
-                            keyframeTimes.add(int(Keyframe.co[0]))
-            else:
-                # Exports all frames
-                keyframeTimes.update(range(Scene.frame_start, Scene.frame_end + 1, 1))
-            keyframeTimes = list(keyframeTimes)
-            keyframeTimes.sort()
-            if len(keyframeTimes):
-                #Create the anim file for offset animation (or single bone animation
-                animfullname = os.path.dirname(Config.FilePath) + os.sep + "anims" + os.sep + "%s_offset.anim" % animFileName
-                #not yet supported
-                """
-                ##    ensure_dir(animfullname)
-                ##    if Config.Verbose:
-                ##        print("      Creating anim file (single bone animation) %s" % (animfullname))
-                ##    animFile = open(animfullname, "w")
-                ##    animFile.write('// anim file exported from : %r\n' % os.path.basename(bpy.data.filepath))   
-                ##    animFile.write("CIwAnim\n")
-                ##    animFile.write("{\n")
-                ##    animFile.write("\tent \"%s\"\n" % (StripName(Object.name)))
-                ##    animFile.write("\tskeleton \"SingleBone\"\n")
-                ##    animFile.write("\t\t\n")
-                ##
-                ##    Config.File.write("\t\".\\anims\\%s_offset.anim\"\n" % animFileName))
-                ##
-                ##    for KeyframeTime in keyframeTimes:
-                ##        #Scene.frame_set(KeyframeTime)    
-                ##        animFile.write("\tCIwAnimKeyFrame\n")
-                ##        animFile.write("\t{\n")
-                ##        animFile.write("\t\ttime %.2f // frame num %d \n" % (KeyframeTime/Config.AnimFPS, KeyframeTime))
-                ##        animFile.write("\t\t\n")
-                ##        animFile.write("\t\tbone \"SingleBone\" \n")
-                ##        #postion
-                ##        posx = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "location" and FCurve.array_index == 0: posx = FCurve.evaluate(KeyframeTime)
-                ##        posy = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "location" and FCurve.array_index == 1: posy = FCurve.evaluate(KeyframeTime)
-                ##        posz = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "location" and FCurve.array_index == 2: posz = FCurve.evaluate(KeyframeTime)
-                ##        animFile.write("\t\tpos {%.9f,%.9f,%.9f}\n" % (posx, posy, posz))
-                ##        #rotation
-                ##        rot = Euler()
-                ##        rot[0] = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "rotation_euler" and FCurve.array_index == 1: rot[0] = FCurve.evaluate(KeyframeTime)
-                ##        rot[1] = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "rotation_euler" and FCurve.array_index == 2: rot[1] = FCurve.evaluate(KeyframeTime)
-                ##        rot[2] = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "rotation_euler" and FCurve.array_index == 3: rot[2] = FCurve.evaluate(KeyframeTime)
-                ##        rot = rot.to_quaternion()
-                ##        animFile.write("\t\trot {%.9f,%.9f,%.9f,%.9f}\n" % (rot[0], rot[1], rot[2], rot[3]))
-                ##        #scale
-                ##        scalex = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "scale" and FCurve.array_index == 0: scalex = FCurve.evaluate(KeyframeTime)
-                ##        scaley = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "scale" and FCurve.array_index == 1: scaley = FCurve.evaluate(KeyframeTime)
-                ##        scalez = 0
-                ##        for FCurve in Action.fcurves:
-                ##            if FCurve.data_path == "scale" and FCurve.array_index == 2: scalez = FCurve.evaluate(KeyframeTime)
-                ##        animFile.write("\t\t//scale {%.9f,%.9f,%.9f}\n" % (scalex, scaley, scalez))
-                ##        #keyframe done
-                ##        animFile.write("\t}\n")
-                ##    animFile.write("}\n")
-                ##    animFile.close()
-                """
-            else:
-                if Config.Verbose:
-                    print("    Object %s has no useable animation data." % (StripName(Object.name)))
-
-            if Config.ExportArmatures and Object.type == "ARMATURE":
-                if Config.Verbose:
-                    print("    Writing Armature Bone Animation Data...\n")
-                PoseBones = Object.pose.bones
-                Bones = Object.data.bones
-                #riged bones animated 
-                #build key frame time list
-                keyframeTimes = set()
-                if Config.ExportAnimationFrames == 1:
-                    # Exports only key frames
-                    for FCurve in Action.fcurves:
-                        for Keyframe in FCurve.keyframe_points:
-                            if Keyframe.co[0] < Scene.frame_start:
-                                keyframeTimes.add(Scene.frame_start)
-                            elif Keyframe.co[0] > Scene.frame_end:
-                                keyframeTimes.add(Scene.frame_end)
-                            else:
-                                keyframeTimes.add(int(Keyframe.co[0]))
-                else:
-                    # Exports all frame
-                    keyframeTimes.update(range(Scene.frame_start, Scene.frame_end + 1, 1))
-                   
-                keyframeTimes = list(keyframeTimes)
-                keyframeTimes.sort()
-                if Config.Verbose:
-                    print("Exporting frames: ")
-                    print(keyframeTimes)
-                    if (Scene.frame_preview_end > Scene.frame_end):
-                        print(" WARNING: END Frame of animation in UI preview is Higher than the Scene Frame end:\n Scene.frame_end %d versus Scene.frame_preview_end %d.\n"
-                              % (Scene.frame_end, Scene.frame_preview_end))
-                        print(" => You might need to change the Scene End Frame, to match the current UI preview frame end...\n=> if you don't want to miss end of animation.\n")
-
-                if len(keyframeTimes):
-                    #Create the anim file
-                    animfullname = os.path.dirname(Config.FilePath) + os.sep + "anims" + os.sep + "%s.anim" % animFileName
-                    ensure_dir(animfullname)
-                    if Config.Verbose:
-                        print("      Creating anim file (bones animation) %s\n" % (animfullname))
-                        print("      Frame count %d \n" % (len(keyframeTimes)))
-                    animFile = open(animfullname, "w")
-                    animFile.write('// anim file exported from : %r\n' % os.path.basename(bpy.data.filepath))   
-                    animFile.write("CIwAnim\n")
-                    animFile.write("{\n")
-                    animFile.write("\tskeleton \"%s\"\n" % (StripName(Object.name)))
-                    animFile.write("\t\t\n")
-
-                    Config.File.write("\t\".\\anims\\%s.anim\"\n" % animFileName)
-
-                    for KeyframeTime in keyframeTimes:
-                        if Config.Verbose:
-                            print("     Writing Frame %d:" % KeyframeTime)
-                        animFile.write("\tCIwAnimKeyFrame\n")
-                        animFile.write("\t{\n")
-                        animFile.write("\t\ttime %.2f // frame num %d \n" % (KeyframeTime / Config.AnimFPS, KeyframeTime))
-                        #for every frame write bones positions
-                        Scene.frame_set(KeyframeTime)
-                        for PoseBone in PoseBones:
-                            if Config.Verbose:
-                                print("      Writing Bone: {}...".format(PoseBone.name))
-                            animFile.write("\t\t\n")
-
-                            Bone = Bones[PoseBone.name]
-                            WriteBonePosition(Config, Object, Bone, PoseBones, PoseBone, animFile, False)
-                        #keyframe done
-                        animFile.write("\t}\n")
-                    animFile.write("}\n")
-                    animFile.close()
-            else:
-                if Config.Verbose:
-                    print("    Object %s has no useable animation data." % (StripName(Object.name)))
-        if Config.ExportAnimationActions == 1:
-            #set back the original default animation
-            Object.animation_data.action = DefaultAction
-        if Config.Verbose:
-            print("  Done") #Done with Object
- 
-
-                                
- 
-################## Utilities
-            
-def StripBoneName(name):
-    return name.replace(" ", "")
-
-
-def StripName(Name):
-    
-    def ReplaceSet(String, OldSet, NewChar):
-        for OldChar in OldSet:
-            String = String.replace(OldChar, NewChar)
-        return String
-    
-    import string
-    
-    NewName = ReplaceSet(Name, string.punctuation + " ", "_")
-    return NewName
-
-
-def ensure_dir(f):
-    d = os.path.dirname(f)
-    if not os.path.exists(d):
-        os.makedirs(d)
-        
-
-def CloseFile(Config):
-    if Config.Verbose:
-        print("Closing File...")
-    Config.File.close()
-    if Config.Verbose:
-        print("Done")
-
-
-CoordinateSystems = (
-    ("1", "Left-Handed", ""),
-    ("2", "Right-Handed", ""),
-    )
-
-
-AnimationFrameModes = (
-    ("0", "None", ""),
-    ("1", "Keyframes Only", ""),
-    ("2", "Full Animation", ""),
-    )
-
-AnimationActions = (
-    ("0", "Default Animation", ""),
-    ("1", "All Animations", ""),
-    )
-
-ExportModes = (
-    ("1", "All Objects", ""),
-    ("2", "Selected Objects", ""),
-    )
-
-MergeModes = (
-    ("0", "None", ""),
-    ("1", "Merge in one big Mesh", ""),
-    ("2", "Merge in unique Geo File containing several meshes", ""),
-    )
-
-
-from bpy.props import StringProperty, EnumProperty, BoolProperty, IntProperty
-
-
-class MarmaladeExporter(bpy.types.Operator):
-    """Export to the Marmalade model format (.group)"""
-
-    bl_idname = "export.marmalade"
-    bl_label = "Export Marmalade"
-
-    filepath = StringProperty(subtype='FILE_PATH')
-     #Export Mode
-    ExportMode = EnumProperty(
-        name="Export",
-        description="Select which objects to export. Only Mesh, Empty, " \
-                    "and Armature objects will be exported",
-        items=ExportModes,
-        default="1")
-
-    MergeModes = EnumProperty(
-        name="Merge",
-        description="Select if objects should be merged in one Geo File (it can be usefull if a scene is done by several cube/forms)." \
-                    "Do not merge rigged character that have an armature.",
-        items=MergeModes,
-        default="0")
-    
-    #General Options
-    Scale = IntProperty(
-        name="Scale Percent",
-        description="Scale percentage applied for export",
-        default=100, min=1, max=1000)
-    
-    FlipNormals = BoolProperty(
-        name="Flip Normals",
-        description="",
-        default=False)
-    ApplyModifiers = BoolProperty(
-        name="Apply Modifiers",
-        description="Apply object modifiers before export",
-        default=False)
-    ExportVertexColors = BoolProperty(
-        name="Export Vertices Colors",
-        description="Export colors set on vertices, if any",
-        default=True)
-    ExportMaterialColors = BoolProperty(
-        name="Export Material Colors",
-        description="Ambient color is exported on the Material",
-        default=True)
-    ExportTextures = BoolProperty(
-        name="Export Textures and UVs",
-        description="Exports UVs and Reference external image files to be used by the model",
-        default=True)
-    CopyTextureFiles = BoolProperty(
-        name="Copy Textures Files",
-        description="Copy referenced Textures files in the models\\textures directory",
-        default=True)
-    ExportArmatures = BoolProperty(
-        name="Export Armatures",
-        description="Export the bones of any armatures to deform meshes",
-        default=True)
-    ExportAnimationFrames = EnumProperty(
-        name="Animations Frames",
-        description="Select the type of animations to export. Only object " \
-                    "and armature bone animations can be exported. Keyframes exports only the keyed frames" \
-                    "Full Animation exports every frames, None disables animationq export. ",
-        items=AnimationFrameModes,
-        default="1")
-    ExportAnimationActions = EnumProperty(
-        name="Animations Actions",
-        description="By default only the Default Animation Action assoiated to an armature is exported." \
-                    "However if you have defined several animations on the same armature,"\
-                    "you can select to export all animations. You can see the list of animation actions in the DopeSheet window.",
-        items=AnimationActions,
-        default="0")           
-    AnimFPS = IntProperty(
-        name="Animation FPS",
-        description="Frame rate used to export animation in seconds (can be used to artficially slow down the exported animation, or to speed up it",
-        default=30, min=1, max=300)
-
-    #Advance Options
-    CoordinateSystem = EnumProperty(
-        name="System",
-        description="Select a coordinate system to export to",
-        items=CoordinateSystems,
-        default="1")
-    
-    Verbose = BoolProperty(
-        name="Verbose",
-        description="Run the exporter in debug mode. Check the console for output",
-        default=True)
-
-    def execute(self, context):
-        #Append .group
-        FilePath = bpy.path.ensure_ext(self.filepath, ".group")
-
-        Config = MarmaladeExporterSettings(context,
-                                         FilePath,
-                                         CoordinateSystem=self.CoordinateSystem,
-                                         FlipNormals=self.FlipNormals,
-                                         ApplyModifiers=self.ApplyModifiers,
-                                         Scale=self.Scale,
-                                         AnimFPS=self.AnimFPS,
-                                         ExportVertexColors=self.ExportVertexColors,
-                                         ExportMaterialColors=self.ExportMaterialColors,
-                                         ExportTextures=self.ExportTextures,
-                                         CopyTextureFiles=self.CopyTextureFiles,
-                                         ExportArmatures=self.ExportArmatures,
-                                         ExportAnimationFrames=self.ExportAnimationFrames,
-                                         ExportAnimationActions=self.ExportAnimationActions,
-                                         ExportMode=self.ExportMode,
-                                         MergeModes=self.MergeModes,
-                                         Verbose=self.Verbose)
-
-        # Exit edit mode before exporting, so current object states are exported properly.
-        if bpy.ops.object.mode_set.poll():
-            bpy.ops.object.mode_set(mode='OBJECT')
-
-        ExportMadeWithMarmaladeGroup(Config)
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        if not self.filepath:
-            self.filepath = bpy.path.ensure_ext(bpy.data.filepath, ".group")
-        WindowManager = context.window_manager
-        WindowManager.fileselect_add(self)
-        return {'RUNNING_MODAL'}
-
-
-def menu_func(self, context):
-    self.layout.operator(MarmaladeExporter.bl_idname, text="Marmalade cross-platform Apps (.group)")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_file_export.append(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_file_export.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/io_export_md3.py b/release/scripts/addons_contrib/io_export_md3.py
deleted file mode 100644
index 328cbc9..0000000
--- a/release/scripts/addons_contrib/io_export_md3.py
+++ /dev/null
@@ -1,694 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Quake Model 3 (.md3)",
-    "author": "Xembie",
-    "version": (0, 7),
-    "blender": (2, 53, 0),
-    "location": "File > Export",
-    "description": "Save a Quake Model 3 File)",
-    "warning": "", # used for warning icon and text in addons panel
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=23160",
-    "category": "Import-Export"}
-
-
-import bpy,struct,math,os
-
-MAX_QPATH = 64
-
-MD3_IDENT = "IDP3"
-MD3_VERSION = 15
-MD3_MAX_TAGS = 16
-MD3_MAX_SURFACES = 32
-MD3_MAX_FRAMES = 1024
-MD3_MAX_SHADERS = 256
-MD3_MAX_VERTICES = 4096
-MD3_MAX_TRIANGLES = 8192
-MD3_XYZ_SCALE = 64.0
-
-class md3Vert:
-    xyz = []
-    normal = 0
-    binaryFormat = "<3hH"
-    
-    def __init__(self):
-        self.xyz = [0.0, 0.0, 0.0]
-        self.normal = 0
-        
-    def GetSize(self):
-        return struct.calcsize(self.binaryFormat)
-    
-    # copied from PhaethonH <phaethon at linux.ucla.edu> md3.py
-    def Decode(self, latlng):
-        lat = (latlng >> 8) & 0xFF;
-        lng = (latlng) & 0xFF;
-        lat *= math.pi / 128;
-        lng *= math.pi / 128;
-        x = math.cos(lat) * math.sin(lng)
-        y = math.sin(lat) * math.sin(lng)
-        z =                 math.cos(lng)
-        retval = [ x, y, z ]
-        return retval
-    
-    # copied from PhaethonH <phaethon at linux.ucla.edu> md3.py
-    def Encode(self, normal):
-        x = normal[0]
-        y = normal[1]
-        z = normal[2]
-        # normalize
-        l = math.sqrt((x*x) + (y*y) + (z*z))
-        if l == 0:
-            return 0
-        x = x/l
-        y = y/l
-        z = z/l
-        
-        if (x == 0.0) & (y == 0.0) :
-            if z > 0.0:
-                return 0
-            else:
-                return (128 << 8)
-        
-        lng = math.acos(z) * 255 / (2 * math.pi)
-        lat = math.atan2(y, x) * 255 / (2 * math.pi)
-        retval = ((int(lat) & 0xFF) << 8) | (int(lng) & 0xFF)
-        return retval
-        
-    def Save(self, file):
-        tmpData = [0] * 4
-        tmpData[0] = int(self.xyz[0] * MD3_XYZ_SCALE)
-        tmpData[1] = int(self.xyz[1] * MD3_XYZ_SCALE)
-        tmpData[2] = int(self.xyz[2] * MD3_XYZ_SCALE)
-        tmpData[3] = self.normal
-        data = struct.pack(self.binaryFormat, tmpData[0], tmpData[1], tmpData[2], tmpData[3])
-        file.write(data)
-        
-class md3TexCoord:
-    u = 0.0
-    v = 0.0
-
-    binaryFormat = "<2f"
-
-    def __init__(self):
-        self.u = 0.0
-        self.v = 0.0
-        
-    def GetSize(self):
-        return struct.calcsize(self.binaryFormat)
-
-    def Save(self, file):
-        tmpData = [0] * 2
-        tmpData[0] = self.u
-        tmpData[1] = 1.0 - self.v
-        data = struct.pack(self.binaryFormat, tmpData[0], tmpData[1])
-        file.write(data)
-
-class md3Triangle:
-    indexes = []
-
-    binaryFormat = "<3i"
-
-    def __init__(self):
-        self.indexes = [ 0, 0, 0 ]
-        
-    def GetSize(self):
-        return struct.calcsize(self.binaryFormat)
-
-    def Save(self, file):
-        tmpData = [0] * 3
-        tmpData[0] = self.indexes[0]
-        tmpData[1] = self.indexes[2] # reverse
-        tmpData[2] = self.indexes[1] # reverse
-        data = struct.pack(self.binaryFormat,tmpData[0], tmpData[1], tmpData[2])
-        file.write(data)
-
-class md3Shader:
-    name = ""
-    index = 0
-    
-    binaryFormat = "<%dsi" % MAX_QPATH
-
-    def __init__(self):
-        self.name = ""
-        self.index = 0
-        
-    def GetSize(self):
-        return struct.calcsize(self.binaryFormat)
-
-    def Save(self, file):
-        tmpData = [0] * 2
-        tmpData[0] = self.name
-        tmpData[1] = self.index
-        data = struct.pack(self.binaryFormat, tmpData[0], tmpData[1])
-        file.write(data)
-
-class md3Surface:
-    ident = ""
-    name = ""
-    flags = 0
-    numFrames = 0
-    numShaders = 0
-    numVerts = 0
-    numTriangles = 0
-    ofsTriangles = 0
-    ofsShaders = 0
-    ofsUV = 0
-    ofsVerts = 0
-    ofsEnd = 0
-    shaders = []
-    triangles = []
-    uv = []
-    verts = []
-    
-    binaryFormat = "<4s%ds10i" % MAX_QPATH  # 1 int, name, then 10 ints
-    
-    def __init__(self):
-        self.ident = ""
-        self.name = ""
-        self.flags = 0
-        self.numFrames = 0
-        self.numShaders = 0
-        self.numVerts = 0
-        self.numTriangles = 0
-        self.ofsTriangles = 0
-        self.ofsShaders = 0
-        self.ofsUV = 0
-        self.ofsVerts = 0
-        self.ofsEnd
-        self.shaders = []
-        self.triangles = []
-        self.uv = []
-        self.verts = []
-        
-    def GetSize(self):
-        sz = struct.calcsize(self.binaryFormat)
-        self.ofsTriangles = sz
-        for t in self.triangles:
-            sz += t.GetSize()
-        self.ofsShaders = sz
-        for s in self.shaders:
-            sz += s.GetSize()
-        self.ofsUV = sz
-        for u in self.uv:
-            sz += u.GetSize()
-        self.ofsVerts = sz
-        for v in self.verts:
-            sz += v.GetSize()
-        self.ofsEnd = sz
-        return self.ofsEnd
-    
-    def Save(self, file):
-        self.GetSize()
-        tmpData = [0] * 12
-        tmpData[0] = self.ident
-        tmpData[1] = self.name
-        tmpData[2] = self.flags
-        tmpData[3] = self.numFrames
-        tmpData[4] = self.numShaders
-        tmpData[5] = self.numVerts
-        tmpData[6] = self.numTriangles
-        tmpData[7] = self.ofsTriangles
-        tmpData[8] = self.ofsShaders
-        tmpData[9] = self.ofsUV
-        tmpData[10] = self.ofsVerts
-        tmpData[11] = self.ofsEnd
-        data = struct.pack(self.binaryFormat, tmpData[0],tmpData[1],tmpData[2],tmpData[3],tmpData[4],tmpData[5],tmpData[6],tmpData[7],tmpData[8],tmpData[9],tmpData[10],tmpData[11])
-        file.write(data)
-
-        # write the tri data
-        for t in self.triangles:
-            t.Save(file)
-
-        # save the shader coordinates
-        for s in self.shaders:
-            s.Save(file)
-
-        # save the uv info
-        for u in self.uv:
-            u.Save(file)
-
-        # save the verts
-        for v in self.verts:
-            v.Save(file)
-
-class md3Tag:
-    name = ""
-    origin = []
-    axis = []
-    
-    binaryFormat="<%ds3f9f" % MAX_QPATH
-    
-    def __init__(self):
-        self.name = ""
-        self.origin = [0, 0, 0]
-        self.axis = [0, 0, 0, 0, 0, 0, 0, 0, 0]
-        
-    def GetSize(self):
-        return struct.calcsize(self.binaryFormat)
-        
-    def Save(self, file):
-        tmpData = [0] * 13
-        tmpData[0] = self.name
-        tmpData[1] = float(self.origin[0])
-        tmpData[2] = float(self.origin[1])
-        tmpData[3] = float(self.origin[2])
-        tmpData[4] = float(self.axis[0])
-        tmpData[5] = float(self.axis[1])
-        tmpData[6] = float(self.axis[2])
-        tmpData[7] = float(self.axis[3])
-        tmpData[8] = float(self.axis[4])
-        tmpData[9] = float(self.axis[5])
-        tmpData[10] = float(self.axis[6])
-        tmpData[11] = float(self.axis[7])
-        tmpData[12] = float(self.axis[8])
-        data = struct.pack(self.binaryFormat, tmpData[0],tmpData[1],tmpData[2],tmpData[3],tmpData[4],tmpData[5],tmpData[6], tmpData[7], tmpData[8], tmpData[9], tmpData[10], tmpData[11], tmpData[12])
-        file.write(data)
-    
-class md3Frame:
-    mins = 0
-    maxs = 0
-    localOrigin = 0
-    radius = 0.0
-    name = ""
-    
-    binaryFormat="<3f3f3ff16s"
-    
-    def __init__(self):
-        self.mins = [0, 0, 0]
-        self.maxs = [0, 0, 0]
-        self.localOrigin = [0, 0, 0]
-        self.radius = 0.0
-        self.name = ""
-        
-    def GetSize(self):
-        return struct.calcsize(self.binaryFormat)
-
-    def Save(self, file):
-        tmpData = [0] * 11
-        tmpData[0] = self.mins[0]
-        tmpData[1] = self.mins[1]
-        tmpData[2] = self.mins[2]
-        tmpData[3] = self.maxs[0]
-        tmpData[4] = self.maxs[1]
-        tmpData[5] = self.maxs[2]
-        tmpData[6] = self.localOrigin[0]
-        tmpData[7] = self.localOrigin[1]
-        tmpData[8] = self.localOrigin[2]
-        tmpData[9] = self.radius
-        tmpData[10] = self.name
-        data = struct.pack(self.binaryFormat, tmpData[0],tmpData[1],tmpData[2],tmpData[3],tmpData[4],tmpData[5],tmpData[6],tmpData[7], tmpData[8], tmpData[9], tmpData[10])
-        file.write(data)
-
-class md3Object:
-    # header structure
-    ident = ""            # this is used to identify the file (must be IDP3)
-    version = 0            # the version number of the file (Must be 15)
-    name = ""
-    flags = 0
-    numFrames = 0
-    numTags = 0
-    numSurfaces = 0
-    numSkins = 0
-    ofsFrames = 0
-    ofsTags = 0
-    ofsSurfaces = 0
-    ofsEnd = 0
-    frames = []
-    tags = []
-    surfaces = []
-
-    binaryFormat="<4si%ds9i" % MAX_QPATH  # little-endian (<), 17 integers (17i)
-
-    def __init__(self):
-        self.ident = 0
-        self.version = 0
-        self.name = ""
-        self.flags = 0
-        self.numFrames = 0
-        self.numTags = 0
-        self.numSurfaces = 0
-        self.numSkins = 0
-        self.ofsFrames = 0
-        self.ofsTags = 0
-        self.ofsSurfaces = 0
-        self.ofsEnd = 0
-        self.frames = []
-        self.tags = []
-        self.surfaces = []
-
-    def GetSize(self):
-        self.ofsFrames = struct.calcsize(self.binaryFormat)
-        self.ofsTags = self.ofsFrames
-        for f in self.frames:
-            self.ofsTags += f.GetSize()
-        self.ofsSurfaces += self.ofsTags
-        for t in self.tags:
-            self.ofsSurfaces += t.GetSize()
-        self.ofsEnd = self.ofsSurfaces
-        for s in self.surfaces:
-            self.ofsEnd += s.GetSize()
-        return self.ofsEnd
-        
-    def Save(self, file):
-        self.GetSize()
-        tmpData = [0] * 12
-        tmpData[0] = self.ident
-        tmpData[1] = self.version
-        tmpData[2] = self.name
-        tmpData[3] = self.flags
-        tmpData[4] = self.numFrames
-        tmpData[5] = self.numTags
-        tmpData[6] = self.numSurfaces
-        tmpData[7] = self.numSkins
-        tmpData[8] = self.ofsFrames
-        tmpData[9] = self.ofsTags
-        tmpData[10] = self.ofsSurfaces
-        tmpData[11] = self.ofsEnd
-
-        data = struct.pack(self.binaryFormat, tmpData[0],tmpData[1],tmpData[2],tmpData[3],tmpData[4],tmpData[5],tmpData[6],tmpData[7], tmpData[8], tmpData[9], tmpData[10], tmpData[11])
-        file.write(data)
-
-        for f in self.frames:
-            f.Save(file)
-            
-        for t in self.tags:
-            t.Save(file)
-            
-        for s in self.surfaces:
-            s.Save(file)
-
-
-def message(log,msg):
-  if log:
-    log.write(msg + "\n")
-  else:
-    print(msg)
-
-class md3Settings:
-  def __init__(self,
-               savepath,
-               name,
-               logpath,
-               overwrite=True,
-               dumpall=False,
-               ignoreuvs=False,
-               scale=1.0,
-               offsetx=0.0,
-               offsety=0.0,
-               offsetz=0.0):
-    self.savepath = savepath
-    self.name = name
-    self.logpath = logpath
-    self.overwrite = overwrite
-    self.dumpall = dumpall
-    self.ignoreuvs = ignoreuvs
-    self.scale = scale
-    self.offsetx = offsetx
-    self.offsety = offsety
-    self.offsetz = offsetz
-
-def print_md3(log,md3,dumpall):
-  message(log,"Header Information")
-  message(log,"Ident: " + str(md3.ident))
-  message(log,"Version: " + str(md3.version))
-  message(log,"Name: " + md3.name)
-  message(log,"Flags: " + str(md3.flags))
-  message(log,"Number of Frames: " + str(md3.numFrames))
-  message(log,"Number of Tags: " + str(md3.numTags))
-  message(log,"Number of Surfaces: " + str(md3.numSurfaces))
-  message(log,"Number of Skins: " + str(md3.numSkins))
-  message(log,"Offset Frames: " + str(md3.ofsFrames))
-  message(log,"Offset Tags: " + str(md3.ofsTags))
-  message(log,"Offset Surfaces: " + str(md3.ofsSurfaces))
-  message(log,"Offset end: " + str(md3.ofsEnd))
-  if dumpall:
-    message(log,"Frames:")
-    for f in md3.frames:
-      message(log," Mins: " + str(f.mins[0]) + " " + str(f.mins[1]) + " " + str(f.mins[2]))
-      message(log," Maxs: " + str(f.maxs[0]) + " " + str(f.maxs[1]) + " " + str(f.maxs[2]))
-      message(log," Origin(local): " + str(f.localOrigin[0]) + " " + str(f.localOrigin[1]) + " " + str(f.localOrigin[2]))
-      message(log," Radius: " + str(f.radius))
-      message(log," Name: " + f.name)
-
-    message(log,"Tags:")
-    for t in md3.tags:
-      message(log," Name: " + t.name)
-      message(log," Origin: " + str(t.origin[0]) + " " + str(t.origin[1]) + " " + str(t.origin[2]))
-      message(log," Axis[0]: " + str(t.axis[0]) + " " + str(t.axis[1]) + " " + str(t.axis[2]))
-      message(log," Axis[1]: " + str(t.axis[3]) + " " + str(t.axis[4]) + " " + str(t.axis[5]))
-      message(log," Axis[2]: " + str(t.axis[6]) + " " + str(t.axis[7]) + " " + str(t.axis[8]))
-
-    message(log,"Surfaces:")
-    for s in md3.surfaces:
-      message(log," Ident: " + s.ident)
-      message(log," Name: " + s.name)
-      message(log," Flags: " + str(s.flags))
-      message(log," # of Frames: " + str(s.numFrames))
-      message(log," # of Shaders: " + str(s.numShaders))
-      message(log," # of Verts: " + str(s.numVerts))
-      message(log," # of Triangles: " + str(s.numTriangles))
-      message(log," Offset Triangles: " + str(s.ofsTriangles))
-      message(log," Offset UVs: " + str(s.ofsUV))
-      message(log," Offset Verts: " + str(s.ofsVerts))
-      message(log," Offset End: " + str(s.ofsEnd))
-      message(log," Shaders:")
-      for shader in s.shaders:
-        message(log,"  Name: " + shader.name)
-        message(log,"  Index: " + str(shader.index))
-      message(log," Triangles:")
-      for tri in s.triangles:
-        message(log,"  Indexes: " + str(tri.indexes[0]) + " " + str(tri.indexes[1]) + " " + str(tri.indexes[2]))
-      message(log," UVs:")
-      for uv in s.uv:
-        message(log,"  U: " + str(uv.u))
-        message(log,"  V: " + str(uv.v)) 
-      message(log," Verts:")
-      for vert in s.verts:
-        message(log,"  XYZ: " + str(vert.xyz[0]) + " " + str(vert.xyz[1]) + " " + str(vert.xyz[2]))
-        message(log,"  Normal: " + str(vert.normal))
-
-  shader_count = 0
-  vert_count = 0
-  tri_count = 0
-  for surface in md3.surfaces:
-    shader_count += surface.numShaders
-    tri_count += surface.numTriangles
-    vert_count += surface.numVerts
-
-  if md3.numTags >= MD3_MAX_TAGS:
-    message(log,"!Warning: Tag limit reached! " + str(md3.numTags))
-  if md3.numSurfaces >= MD3_MAX_SURFACES:
-    message(log,"!Warning: Surface limit reached! " + str(md3.numSurfaces))
-  if md3.numFrames >= MD3_MAX_FRAMES:
-    message(log,"!Warning: Frame limit reached! " + str(md3.numFrames))
-  if shader_count >= MD3_MAX_SHADERS:
-    message(log,"!Warning: Shader limit reached! " + str(shader_count))
-  if vert_count >= MD3_MAX_VERTICES:
-    message(log,"!Warning: Vertex limit reached! " + str(vert_count))
-  if tri_count >= MD3_MAX_TRIANGLES:
-    message(log,"!Warning: Triangle limit reached! " + str(tri_count))
-
-def save_md3(settings):
-  if settings.logpath:
-    if settings.overwrite:
-      log = open(settings.logpath,"w")
-    else:
-      log = open(settings.logpath,"a")
-  else:
-    log = 0
-  message(log,"##########Exporting MD3##########")
-  bpy.ops.object.mode_set(mode='OBJECT')
-  md3 = md3Object()
-  md3.ident = MD3_IDENT
-  md3.version = MD3_VERSION
-  md3.name = settings.name
-  md3.numFrames = (bpy.context.scene.frame_end + 1) - bpy.context.scene.frame_start
-
-  for obj in bpy.context.selected_objects:
-    if obj.type == 'MESH':
-      nsurface = md3Surface()
-      nsurface.name = obj.name
-      nsurface.ident = MD3_IDENT
- 
-      vertlist = []
-
-      for f,face in enumerate(obj.data.faces):
-        ntri = md3Triangle()
-        if len(face.verts) != 3:
-          message(log,"Found a nontriangle face in object " + obj.name)
-          continue
-
-        for v,vert_index in enumerate(face.verts):
-          uv_u = round(obj.data.active_uv_texture.data[f].uv[v][0],5)
-          uv_v = round(obj.data.active_uv_texture.data[f].uv[v][1],5)
-
-          match = 0
-          match_index = 0
-          for i,vi in enumerate(vertlist):
-            if vi == vert_index:
-              if settings.ignoreuvs:
-                match = 1#there is a uv match for all
-                match_index = i
-              else:
-                if nsurface.uv[i].u == uv_u and nsurface.uv[i].v == uv_v:
-                  match = 1
-                  match_index = i
-
-          if match == 0:
-            vertlist.append(vert_index)
-            ntri.indexes[v] = nsurface.numVerts
-            ntex = md3TexCoord()
-            ntex.u = uv_u
-            ntex.v = uv_v
-            nsurface.uv.append(ntex)
-            nsurface.numVerts += 1
-          else:
-            ntri.indexes[v] = match_index
-        nsurface.triangles.append(ntri)
-        nsurface.numTriangles += 1
-
-      if obj.data.active_uv_texture:
-        nshader = md3Shader()
-        nshader.name = obj.data.active_uv_texture.name
-        nshader.index = nsurface.numShaders
-        nsurface.shaders.append(nshader)
-        nsurface.numShaders += 1
-      if nsurface.numShaders < 1: #we should add a blank as a placeholder
-        nshader = md3Shader()
-        nshader.name = "NULL"
-        nsurface.shaders.append(nshader)
-        nsurface.numShaders += 1
-
-      for frame in range(bpy.context.scene.frame_start,bpy.context.scene.frame_end + 1):
-        bpy.context.scene.set_frame(frame)
-        fobj = obj.create_mesh(bpy.context.scene,True,'PREVIEW')
-        fobj.calc_normals()
-        nframe = md3Frame()
-        nframe.name = str(frame)
-        for vi in vertlist:
-            vert = fobj.verts[vi]
-            nvert = md3Vert()
-            nvert.xyz = vert.co * obj.matrix_world
-            nvert.xyz[0] = (round(nvert.xyz[0] + obj.matrix_world[3][0],5) * settings.scale) + settings.offsetx
-            nvert.xyz[1] = (round(nvert.xyz[1] + obj.matrix_world[3][1],5) * settings.scale) + settings.offsety
-            nvert.xyz[2] = (round(nvert.xyz[2] + obj.matrix_world[3][2],5) * settings.scale) + settings.offsetz
-            nvert.normal = nvert.Encode(vert.normal)
-            for i in range(0,3):
-              nframe.mins[i] = min(nframe.mins[i],nvert.xyz[i])
-              nframe.maxs[i] = max(nframe.maxs[i],nvert.xyz[i])
-            minlength = math.sqrt(math.pow(nframe.mins[0],2) + math.pow(nframe.mins[1],2) + math.pow(nframe.mins[2],2))
-            maxlength = math.sqrt(math.pow(nframe.maxs[0],2) + math.pow(nframe.maxs[1],2) + math.pow(nframe.maxs[2],2))
-            nframe.radius = round(max(minlength,maxlength),5)
-            nsurface.verts.append(nvert) 
-        md3.frames.append(nframe)
-        nsurface.numFrames += 1
-        bpy.data.meshes.remove(fobj)
-      md3.surfaces.append(nsurface)
-      md3.numSurfaces += 1
-
-    elif obj.type == 'EMPTY':
-      md3.numTags += 1
-      for frame in range(bpy.context.scene.frame_start,bpy.context.scene.frame_end + 1):
-        bpy.context.scene.set_frame(frame)
-        ntag = md3Tag()
-        ntag.origin[0] = (round(obj.matrix_world[3][0] * settings.scale,5)) + settings.offsetx
-        ntag.origin[1] = (round(obj.matrix_world[3][1] * settings.scale,5)) + settings.offsety
-        ntag.origin[2] = (round(obj.matrix_world[3][2] * settings.scale,5)) + settings.offsetz
-        ntag.axis[0] = obj.matrix_world[0][0]
-        ntag.axis[1] = obj.matrix_world[0][1]
-        ntag.axis[2] = obj.matrix_world[0][2]
-        ntag.axis[3] = obj.matrix_world[1][0]
-        ntag.axis[4] = obj.matrix_world[1][1]
-        ntag.axis[5] = obj.matrix_world[1][2]
-        ntag.axis[6] = obj.matrix_world[2][0]
-        ntag.axis[7] = obj.matrix_world[2][1]
-        ntag.axis[8] = obj.matrix_world[2][2]
-        md3.tags.append(ntag)
-  
-  if md3.numSurfaces < 1:
-    message(log,"Select a mesh to export!")
-    if log:
-      log.close()
-    return
-
-  file = open(settings.savepath, "wb")
-  md3.Save(file)
-  print_md3(log,md3,settings.dumpall)
-  file.close()
-
-  message(log,"MD3: " + settings.name + " saved to " + settings.savepath)
-  if log:
-    print("Logged to",settings.logpath)
-    log.close()
-
-from bpy.props import *
-class ExportMD3(bpy.types.Operator):
-  """Export to Quake Model 3 (.md3)"""
-  bl_idname = "export.md3"
-  bl_label = 'Export MD3'
-
-  filepath = StringProperty(subtype = 'FILE_PATH',name="File Path", description="Filepath for exporting", maxlen= 1024, default= "")
-  md3name = StringProperty(name="MD3 Name", description="MD3 header name / skin path (64 bytes)",maxlen=64,default="")
-  md3log = StringProperty(name="MD3 Log", description="MD3 log file path",maxlen=1024,default="export_md3.log")
-  md3overwritelog = BoolProperty(name="Overwrite log", description="Overwrite log (off == append)", default=True)
-  md3dumpall = BoolProperty(name="Dump all", description="Dump all data for md3 to log",default=False)
-  md3ignoreuvs = BoolProperty(name="Ignore UVs", description="Ignores uv influence on mesh generation. Use if uv map not made.",default=False)
-  md3scale = FloatProperty(name="Scale", description="Scale all objects from world origin (0,0,0)",default=1.0,precision=5)
-  md3offsetx = FloatProperty(name="Offset X", description="Transition scene along x axis",default=0.0,precision=5)
-  md3offsety = FloatProperty(name="Offset Y", description="Transition scene along y axis",default=0.0,precision=5)
-  md3offsetz = FloatProperty(name="Offset Z", description="Transition scene along z axis",default=0.0,precision=5)
-
-  def execute(self, context):
-   settings = md3Settings(savepath = self.properties.filepath,
-                          name = self.properties.md3name,
-                          logpath = self.properties.md3log,
-                          overwrite = self.properties.md3overwritelog,
-                          dumpall = self.properties.md3dumpall,
-                          ignoreuvs = self.properties.md3ignoreuvs,
-                          scale = self.properties.md3scale,
-                          offsetx = self.properties.md3offsetx,
-                          offsety = self.properties.md3offsety,
-                          offsetz = self.properties.md3offsetz)
-   save_md3(settings)
-   return {'FINISHED'}
-
-  def invoke(self, context, event):
-    wm = context.window_manager
-    wm.fileselect_add(self)
-    return {'RUNNING_MODAL'}
-
-  @classmethod
-  def poll(cls, context):
-    return context.active_object is not None
-
-def menu_func(self, context):
-  newpath = os.path.splitext(bpy.context.blend_data.filepath)[0] + ".md3"
-  self.layout.operator(ExportMD3.bl_idname, text="Quake Model 3 (.md3)").filepath = newpath 
-
-def register():
-  bpy.types.INFO_MT_file_export.append(menu_func)
-
-def unregister():
-  bpy.types.INFO_MT_file_export.remove(menu_func)
-
-if __name__ == "__main__":
-  register()
diff --git a/release/scripts/addons_contrib/io_import_BrushSet.py b/release/scripts/addons_contrib/io_import_BrushSet.py
deleted file mode 100644
index f73ecc8..0000000
--- a/release/scripts/addons_contrib/io_import_BrushSet.py
+++ /dev/null
@@ -1,144 +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 LICENCE BLOCK *****
-
-# ----------------------------------------------------------------------------#    
-
-"""
-todo:
-- add file selection for single and multiple files
-
-changelog:
-    "version": (1,1,4),
-        filename will be used as texture name (still limited by stringlength)
-
-
-    "version": (1,1,3),
-    fixed operator and registration
-    added tracker and wiki url\
-    
-version": (1,1,2)
-    replaced image.new() with image.load()
-    changed addon category
-    removed some unused/old code    
-    
-version":1.11:
-    added type arg to texture.new() [L48]
-    cleared default filename
-""" 
-
-# ----------------------------------------------------------------------------#    
-
-import bpy
-import os
-from bpy.props import *
-
-#addon description
-bl_info = {
-    "name": "import BrushSet",
-    "author": "Daniel Grauer",
-    "version": (1, 1, 5),
-    "blender": (2, 56, 0),
-    "category": "Import-Export",
-    "location": "File > Import > BrushSet",
-    "description": "imports all image files from a folder",
-    "warning": '', # used for warning icon and text in addons panel
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/BrushSet",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=25702&group_id=153&atid=467",
-    }
-
-print(" ")
-print("*------------------------------------------------------------------------------*")
-print("*                          initializing BrushSet import                        *")
-print("*------------------------------------------------------------------------------*")
-print(" ")
-
-#extension filter (alternative use mimetypes)
-ext_list = ['jpg',
-            'bmp',
-            'iris',
-            'png',
-            'jpeg',
-            'targa',
-            'tga'];
-
-def LoadBrushSet(filepath, filename):
-    for file in os.listdir(filepath):
-        path = (filepath + file)
-        #get folder name
-        (f1, f2) = os.path.split(filepath)
-        (f3, foldername) = os.path.split(f1)
-        
-        texturename = foldername         # file        "texture"    foldername
-        
-        #filter ext_list
-        if file.split('.')[-1].lower() in ext_list: 
-            #create new texture
-            texture = bpy.data.textures.new(texturename, 'IMAGE')    #watch it, string limit 21 ?!
-
-            #create new image
-            image = bpy.data.images.load(path)
-            image.source = "FILE"
-            image.filepath = path
-            bpy.data.textures[texture.name].image = image
-            
-            print("imported: " + file)
-    print("Brush Set imported!")  
-
-# ----------------------------------------------------------------------------#    
-
-class BrushSetImporter(bpy.types.Operator):
-    """Load Brush Set"""
-    bl_idname = "import_image.brushset"
-    bl_label = "Import BrushSet"
-
-    filename = StringProperty(name="File Name", description="filepath", default="", maxlen=1024, options={'ANIMATABLE'}, subtype='NONE')
-    filepath = StringProperty(name="File Name", description="filepath", default="", maxlen=1024, options={'ANIMATABLE'}, subtype='NONE')
-    
-    def execute(self, context):
-        LoadBrushSet(self.properties.filepath, self.properties.filename)
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.window_manager
-        wm.fileselect_add(self)
-        return {'RUNNING_MODAL'}
-
-# ----------------------------------------------------------------------------#    
-
-def menu_func(self, context):
-    #clear the default name for import
-    default_name = "" 
-
-    self.layout.operator(BrushSetImporter.bl_idname, text="Brush Set").filename = default_name
-
-# ----------------------------------------------------------------------------#    
-
-def register():    
-    bpy.utils.register_module(__name__)
-    bpy.types.INFO_MT_file_import.append(menu_func)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_file_import.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
-
-print(" ")
-print("*------------------------------------------------------------------------------*")
-print(" ")
diff --git a/release/scripts/addons_contrib/io_import_LRO_Lola_MGS_Mola_img.py b/release/scripts/addons_contrib/io_import_LRO_Lola_MGS_Mola_img.py
deleted file mode 100644
index 98c5d1b..0000000
--- a/release/scripts/addons_contrib/io_import_LRO_Lola_MGS_Mola_img.py
+++ /dev/null
@@ -1,640 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "LRO Lola & MGS Mola img Importer",
-    "author": "Valter Battioli (ValterVB)",
-    "version": (1, 1, 8),
-    "blender": (2, 58, 0),
-    "location": "3D window > Tool Shelf",
-    "description": "Import DTM from LRO Lola and MGS Mola",
-    "warning": "May consume a lot of memory",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Import-Export/NASA_IMG_Importer",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=25462",
-    "category": "Import-Export"}
-
-
-#***********************************************************************
-#ver. 0.0.1: -First version
-#ver. 0.0.2: -Add check on path and file
-#            -Check on selected coordinates more complete
-#ver. 1.1.0: -Optimized for less memory
-#ver. 1.1.1: -Correct bug for real value of the High (bad error).
-#             now it's less artistic, bat more real Always possible use
-#             the old formula. check Magnify (x4)
-#            -Correct the bug for directory with dot in the name
-#            -Add some warning and more information
-#            -Add slider for the scale and info on it
-#ver. 1.1.2: -Word correction
-#            -Correct the problem for Unix (Upper lower case)
-#              If the Ext of the file selected from user is upper
-#              than the second file is Upper and Viceversa.
-#              (I can't verify because i have Win)
-#ver. 1.1.3: -Little fix for previous fix on upper/lower case
-#ver. 1.1.4: -Fix for recent API changes. Thanks to Filiciss.
-#            -Some code cleaning (PEP8)
-#ver. 1.1.5: -Fix for recent API changes. Thanks to Filiciss.
-#ver. 1.1.6: -Fix for API changes, and restore Scale factor
-#ver. 1.1.7: -Fix for API changes. Move some code out of draw
-#ver. 1.1.8: -Add a reset button
-#************************************************************************
-
-import bpy
-import os.path
-import math
-import array
-import mathutils
-from mathutils import *
-
-TO_RAD = math.pi / 180  # From degrees to radians
-
-# turning off relative path - it causes an error if it was true
-if bpy.context.user_preferences.filepaths.use_relative_paths == True:
-    bpy.context.user_preferences.filepaths.use_relative_paths = False
-
-
-# A very simple "bridge" tool.
-# Connects two equally long vertex rows with faces.
-# Returns a list of the new faces (list of  lists)
-#
-# vertIdx1 ... First vertex list (list of vertex indices).
-# vertIdx2 ... Second vertex list (list of vertex indices).
-# closed ... Creates a loop (first & last are closed).
-# flipped ... Invert the normal of the face(s).
-#
-# Note: You can set vertIdx1 to a single vertex index to create a fan/star
-#       of faces.
-# Note: If both vertex idx list are the same length they have to have at
-#       least 2 vertices.
-def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False):
-    faces = []
-
-    if not vertIdx1 or not vertIdx2:
-        return None
-
-    if len(vertIdx1) < 2 and len(vertIdx2) < 2:
-        return None
-
-    fan = False
-    if (len(vertIdx1) != len(vertIdx2)):
-        if (len(vertIdx1) == 1 and len(vertIdx2) > 1):
-            fan = True
-        else:
-            return None
-
-    total = len(vertIdx2)
-
-    if closed:
-        # Bridge the start with the end.
-        if flipped:
-            face = [
-                vertIdx1[0],
-                vertIdx2[0],
-                vertIdx2[total - 1]]
-            if not fan:
-                face.append(vertIdx1[total - 1])
-            faces.append(face)
-
-        else:
-            face = [vertIdx2[0], vertIdx1[0]]
-            if not fan:
-                face.append(vertIdx1[total - 1])
-            face.append(vertIdx2[total - 1])
-            faces.append(face)
-
-    # Bridge the rest of the faces.
-    for num in range(total - 1):
-        if flipped:
-            if fan:
-                face = [vertIdx2[num], vertIdx1[0], vertIdx2[num + 1]]
-            else:
-                face = [vertIdx2[num], vertIdx1[num],
-                    vertIdx1[num + 1], vertIdx2[num + 1]]
-            faces.append(face)
-        else:
-            if fan:
-                face = [vertIdx1[0], vertIdx2[num], vertIdx2[num + 1]]
-            else:
-                face = [vertIdx1[num], vertIdx2[num],
-                    vertIdx2[num + 1], vertIdx1[num + 1]]
-            faces.append(face)
-    return faces
-
-
-#Utility Function ********************************************************
-#
-#Input: Latitude Output: Number of the line (1 to n)
-def LatToLine(Latitude):
-    tmpLines = round((MAXIMUM_LATITUDE - Latitude) * MAP_RESOLUTION + 1.0)
-    if tmpLines > LINES:
-        tmpLines = LINES
-    return tmpLines
-
-
-#Input: Number of the line (1 to n) Output: Latitude
-def LineToLat(Line):
-    if MAP_RESOLUTION == 0:
-        return 0
-    else:
-        return float(MAXIMUM_LATITUDE - (Line - 1) / MAP_RESOLUTION)
-
-
-#Input: Longitude Output: Number of the point (1 to n)
-def LongToPoint(Longitude):
-    tmpPoints = round((Longitude - WESTERNMOST_LONGITUDE) *
-                       MAP_RESOLUTION + 1.0)
-    if tmpPoints > LINE_SAMPLES:
-        tmpPoints = LINE_SAMPLES
-    return tmpPoints
-
-
-#Input: Number of the Point (1 to n) Output: Longitude
-def PointToLong(Point):
-    if MAP_RESOLUTION == 0:
-        return 0
-    else:
-        return float(WESTERNMOST_LONGITUDE + (Point - 1) / MAP_RESOLUTION)
-
-
-#Input: Latitude Output: Neareast real Latitude on grid
-def RealLat(Latitude):
-    return float(LineToLat(LatToLine(Latitude)))
-
-
-#Input: Longitude Output: Neareast real Longitude on grid
-def RealLong(Longitude):
-    return float(PointToLong(LongToPoint(Longitude)))
-#**************************************************************************
-
-
-def MakeMaterialMars(obj):
-    #Copied from io_convert_image_to_mesh_img
-    mat = bpy.data.materials.new("Mars")
-    mat.diffuse_shader = 'MINNAERT'
-    mat.diffuse_color = (0.426, 0.213, 0.136)
-    mat.darkness = 0.8
-
-    mat.specular_shader = 'WARDISO'
-    mat.specular_color = (1.000, 0.242, 0.010)
-    mat.specular_intensity = 0.010
-    mat.specular_slope = 0.100
-    obj.data.materials.append(mat)
-
-
-def MakeMaterialMoon(obj):
-    #Same as Mars Material, but i have canged the color
-    mat = bpy.data.materials.new("Moon")
-    mat.diffuse_shader = 'MINNAERT'
-    mat.diffuse_color = (0.426, 0.426, 0.426)
-    mat.darkness = 0.8
-
-    mat.specular_shader = 'WARDISO'
-    mat.specular_color = (0.6, 0.6, 0.6)
-    mat.specular_intensity = 0.010
-    mat.specular_slope = 0.100
-    obj.data.materials.append(mat)
-
-
-#Read the LBL file
-def ReadLabel(FileName):
-    global FileAndPath
-    global LINES, LINE_SAMPLES, SAMPLE_TYPE, SAMPLE_BITS, UNIT, MAP_RESOLUTION
-    global MAXIMUM_LATITUDE, MINIMUM_LATITUDE, WESTERNMOST_LONGITUDE
-    global EASTERNMOST_LONGITUDE, SCALING_FACTOR, OFFSET, RadiusUM, TARGET_NAME
-    global Message
-
-    if FileName == '':
-        return
-    LINES = LINE_SAMPLES = SAMPLE_BITS = MAP_RESOLUTION = 0
-    MAXIMUM_LATITUDE = MINIMUM_LATITUDE = 0.0
-    WESTERNMOST_LONGITUDE = EASTERNMOST_LONGITUDE = 0.0
-    OFFSET = SCALING_FACTOR = 0.0
-    SAMPLE_TYPE = UNIT = TARGET_NAME = RadiusUM = Message = ""
-
-    FileAndPath = FileName
-    FileAndExt = os.path.splitext(FileAndPath)
-    try:
-        #Check for UNIX that is case sensitive
-        #If the Ext of the file selected from user is Upper, than the second
-        #file is Upper and Viceversa
-        if FileAndExt[1].isupper():
-            f = open(FileAndExt[0] + ".LBL", 'r')  # Open the label file
-        else:
-            f = open(FileAndExt[0] + ".lbl", 'r')  # Open the label file
-        Message = ""
-    except:
-        Message = "FILE LBL NOT AVAILABLE OR YOU HAVEN'T SELECTED A FILE"
-        return
-
-    block = ""
-    OFFSET = 0
-    for line in f:
-        tmp = line.split("=")
-        if tmp[0].strip() == "OBJECT" and tmp[1].strip() == "IMAGE":
-            block = "IMAGE"
-        elif tmp[0].strip() == "OBJECT" and tmp[1].strip() == "IMAGE_MAP_PROJECTION":
-            block = "IMAGE_MAP_PROJECTION"
-        elif tmp[0].strip() == "END_OBJECT" and tmp[1].strip() == "IMAGE":
-            block = ""
-        elif tmp[0].strip() == "END_OBJECT" and tmp[1].strip() == "IMAGE_MAP_PROJECTION":
-            block = ""
-        elif tmp[0].strip() == "TARGET_NAME":
-            block = ""
-            TARGET_NAME = tmp[1].strip()
-        if block == "IMAGE":
-            if line.find("LINES") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                LINES = int(tmp[1].strip())
-            elif line.find("LINE_SAMPLES") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                LINE_SAMPLES = int(tmp[1].strip())
-            elif line.find("UNIT") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                UNIT = tmp[1].strip()
-            elif line.find("SAMPLE_TYPE") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                SAMPLE_TYPE = tmp[1].strip()
-            elif line.find("SAMPLE_BITS") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                SAMPLE_BITS = int(tmp[1].strip())
-            elif line.find("SCALING_FACTOR") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                SCALING_FACTOR = float(tmp[0].replace(" ", ""))
-            elif line.find("OFFSET") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                if tmp[0].find("OFFSET") != -1 and len(tmp) > 1:
-                    tmp = tmp[1].split("<")
-                    tmp[0] = tmp[0].replace(".", "")
-                    OFFSET = float(tmp[0].replace(" ", ""))
-        elif block == "IMAGE_MAP_PROJECTION":
-            if line.find("A_AXIS_RADIUS") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                A_AXIS_RADIUS = float(tmp[0].replace(" ", ""))
-                RadiusUM = tmp[1].rstrip().replace(">", "")
-            elif line.find("B_AXIS_RADIUS") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                B_AXIS_RADIUS = float(tmp[0].replace(" ", ""))
-            elif line.find("C_AXIS_RADIUS") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                C_AXIS_RADIUS = float(tmp[0].replace(" ", ""))
-            elif line.find("MAXIMUM_LATITUDE") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                MAXIMUM_LATITUDE = float(tmp[0].replace(" ", ""))
-            elif line.find("MINIMUM_LATITUDE") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                MINIMUM_LATITUDE = float(tmp[0].replace(" ", ""))
-            elif line.find("WESTERNMOST_LONGITUDE") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                WESTERNMOST_LONGITUDE = float(tmp[0].replace(" ", ""))
-            elif line.find("EASTERNMOST_LONGITUDE") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                EASTERNMOST_LONGITUDE = float(tmp[0].replace(" ", ""))
-            elif line.find("MAP_RESOLUTION") != -1 and not(line.startswith("/*")):
-                tmp = line.split("=")
-                tmp = tmp[1].split("<")
-                MAP_RESOLUTION = float(tmp[0].replace(" ", ""))
-    f.close
-    MAXIMUM_LATITUDE = MAXIMUM_LATITUDE - 1 / MAP_RESOLUTION / 2
-    MINIMUM_LATITUDE = MINIMUM_LATITUDE + 1 / MAP_RESOLUTION / 2
-    WESTERNMOST_LONGITUDE = WESTERNMOST_LONGITUDE + 1 / MAP_RESOLUTION / 2
-    EASTERNMOST_LONGITUDE = EASTERNMOST_LONGITUDE - 1 / MAP_RESOLUTION / 2
-    if OFFSET == 0:  # When OFFSET isn't available I use the medium of the radius
-        OFFSET = (A_AXIS_RADIUS + B_AXIS_RADIUS + C_AXIS_RADIUS) / 3
-    else:
-        OFFSET = OFFSET / 1000  # Convert m to Km
-    if SCALING_FACTOR == 0:
-        SCALING_FACTOR = 1.0  # When isn'tavailable I set it to 1
-
-
-def update_fpath(self, context):
-    global start_up
-    start_up=False
-    ReadLabel(bpy.context.scene.fpath)
-    if Message != "":
-        start_up=True
-    else:
-        typ = bpy.types.Scene
-        var = bpy.props
-        typ.FromLat = var.FloatProperty(description="From Latitude", min=float(MINIMUM_LATITUDE), max=float(MAXIMUM_LATITUDE), precision=3, default=0.0)
-        typ.ToLat = var.FloatProperty(description="To Latitude", min=float(MINIMUM_LATITUDE), max=float(MAXIMUM_LATITUDE), precision=3)
-        typ.FromLong = var.FloatProperty(description="From Longitude", min=float(WESTERNMOST_LONGITUDE), max=float(EASTERNMOST_LONGITUDE), precision=3)
-        typ.ToLong = var.FloatProperty(description="To Longitude", min=float(WESTERNMOST_LONGITUDE), max=float(EASTERNMOST_LONGITUDE), precision=3)
-        typ.Scale = var.IntProperty(description="Scale", min=1, max=100, default=1)
-        typ.Magnify = var.BoolProperty(description="Magnify", default=False)
-
-
-#Import the data and draw the planet
-class Import(bpy.types.Operator):
-    bl_idname = 'import.lro_and_mgs'
-    bl_label = 'Start Import'
-    bl_description = 'Import the data'
-
-    def execute(self, context):
-        From_Lat = RealLat(bpy.context.scene.FromLat)
-        To_Lat = RealLat(bpy.context.scene.ToLat)
-        From_Long = RealLong(bpy.context.scene.FromLong)
-        To_Long = RealLong(bpy.context.scene.ToLong)
-        BlenderScale = bpy.context.scene.Scale
-        Exag = bpy.context.scene.Magnify
-        Vertex = []  # Vertex array
-        Faces = []  # Faces arrays
-        FirstRow = []
-        SecondRow = []
-        print('*** Start create vertex ***')
-        FileAndPath = bpy.context.scene.fpath
-        FileAndExt = os.path.splitext(FileAndPath)
-        #Check for UNIX that is case sensitive
-        #If the Ext of the file selected from user is Upper, than the second file is Upper and Viceversa
-        if FileAndExt[1].isupper():
-            FileName = FileAndExt[0] + ".IMG"
-        else:
-            FileName = FileAndExt[0] + ".img"
-        f = open(FileName, 'rb')
-        f.seek(int((int(LatToLine(From_Lat)) - 1) * (LINE_SAMPLES * (SAMPLE_BITS / 8))), 1)  # Skip the first n line of point
-        SkipFirstPoint = int((LongToPoint(From_Long) - 1) * (SAMPLE_BITS / 8))  # Nunmber of points to skip
-        PointsToRead = (LongToPoint(To_Long) - LongToPoint(From_Long) + 1) * (int(SAMPLE_BITS) / 8)  # Number of points to be read
-        SkipLastPoint = (LINE_SAMPLES * (SAMPLE_BITS / 8)) - PointsToRead - SkipFirstPoint  # Nunmber of points to skip
-        LatToRead = From_Lat
-        while (LatToRead >= To_Lat):
-            f.seek(SkipFirstPoint, 1)  # Skip the first n point
-            Altitudes = f.read(int(PointsToRead))  # Read all the point
-            Altitudes = array.array("h", Altitudes)  # Change to Array of signed short
-            if SAMPLE_TYPE == "MSB_INTEGER":
-                Altitudes.byteswap()  # Change from MSB (big endian) to LSB (little endian)
-            LongToRead = From_Long
-            PointToRead = 0
-            while (LongToRead <= To_Long):
-                if Exag:
-                    tmpRadius = (Altitudes[PointToRead] / SCALING_FACTOR / 1000 + OFFSET) / BlenderScale  # Old formula (High*4)
-                else:
-                    tmpRadius = ((Altitudes[PointToRead] * SCALING_FACTOR) / 1000 + OFFSET) / BlenderScale  # Correct scale
-                CurrentRadius = tmpRadius * (math.cos(LatToRead * TO_RAD))
-                X = CurrentRadius * (math.sin(LongToRead * TO_RAD))
-                Y = tmpRadius * math.sin(LatToRead * TO_RAD)
-                Z = CurrentRadius * math.cos(LongToRead * TO_RAD)
-                Vertex.append(Vector((float(X), float(Y), float(Z))))
-                LongToRead += (1 / MAP_RESOLUTION)
-                PointToRead += 1
-            f.seek(int(SkipLastPoint), 1)
-            LatToRead -= (1 / MAP_RESOLUTION)
-        f.close
-        del Altitudes
-        print('*** End create Vertex   ***')
-
-        print('*** Start create faces ***')
-        LinesToRead = int(LatToLine(To_Lat) - LatToLine(From_Lat) + 1)   # Number of the lines to read
-        PointsToRead = int(LongToPoint(To_Long) - LongToPoint(From_Long) + 1)  # Number of the points to read
-        for Point in range(0, PointsToRead):
-            FirstRow.append(Point)
-            SecondRow.append(Point + PointsToRead)
-        if int(PointsToRead) == LINE_SAMPLES:
-            FaceTemp = createFaces(FirstRow, SecondRow, closed=True, flipped=True)
-        else:
-            FaceTemp = createFaces(FirstRow, SecondRow, closed=False, flipped=True)
-        Faces.extend(FaceTemp)
-
-        FaceTemp = []
-        for Line in range(1, (LinesToRead - 1)):
-            FirstRow = SecondRow
-            SecondRow = []
-            FacesTemp = []
-            for Point in range(0, PointsToRead):
-                SecondRow.append(Point + (Line + 1) * PointsToRead)
-            if int(PointsToRead) == LINE_SAMPLES:
-                FaceTemp = createFaces(FirstRow, SecondRow, closed=True, flipped=True)
-            else:
-                FaceTemp = createFaces(FirstRow, SecondRow, closed=False, flipped=True)
-            Faces.extend(FaceTemp)
-        del FaceTemp
-        print('*** End create faces   ***')
-
-        print ('*** Start draw ***')
-        mesh = bpy.data.meshes.new(TARGET_NAME)
-        mesh.from_pydata(Vertex, [], Faces)
-        del Faces
-        del Vertex
-        mesh.update()
-        ob_new = bpy.data.objects.new(TARGET_NAME, mesh)
-        ob_new.data = mesh
-        scene = bpy.context.scene
-        scene.objects.link(ob_new)
-        scene.objects.active = ob_new
-        ob_new.select = True
-        print ('*** End draw   ***')
-        print('*** Start Smooth ***')
-        bpy.ops.object.shade_smooth()
-        print('*** End Smooth   ***')
-        if TARGET_NAME == "MOON":
-            MakeMaterialMoon(ob_new)
-        elif TARGET_NAME == "MARS":
-            MakeMaterialMars(ob_new)
-        print('*** FINISHED ***')
-        return {'FINISHED'}
-
-
-# User inteface
-class Img_Importer(bpy.types.Panel):
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOL_PROPS"
-    bl_label = "LRO Lola & MGS Mola IMG Importer"
-    
-    def __init__(self):
-        typ = bpy.types.Scene
-        var = bpy.props
-
-    def draw(self, context):
-        layout = self.layout
-        if start_up:
-            layout.prop(context.scene, "fpath")
-            col = layout.column()
-            split = col.split(align=True)
-            if Message != "":
-                split.label("Message: " + Message)
-        else:
-            col = layout.column()
-            split = col.split(align=True)
-            split.label("Minimum Latitude: " + str(MINIMUM_LATITUDE) + " deg")
-            split.label("Maximum Latitude: " + str(MAXIMUM_LATITUDE) + " deg")
-
-            split = col.split(align=True)
-            split.label("Westernmost Longitude: " + str(WESTERNMOST_LONGITUDE) + " deg")
-            split.label("Easternmost Longitude: " + str(EASTERNMOST_LONGITUDE) + " deg")
-
-            split = col.split(align=True)
-            split.label("Lines: " + str(LINES))
-            split.label("Line samples: " + str(LINE_SAMPLES))
-
-            split = col.split(align=True)
-            split.label("Sample type: " + str(SAMPLE_TYPE))
-            split.label("Sample bits: " + str(SAMPLE_BITS))
-
-            split = col.split(align=True)
-            split.label("Unit: " + UNIT)
-            split.label("Map resolution: " + str(MAP_RESOLUTION) + " pix/deg")
-
-            split = col.split(align=True)
-            split.label("Radius: " + str(OFFSET) + " " + RadiusUM)
-            split.label("Scale: " + str(SCALING_FACTOR))
-
-            split = col.split(align=True)
-            split.label("Target: ")
-            split.label(TARGET_NAME)
-
-            col = layout.column()
-            split = col.split(align=True)
-            split.prop(context.scene, "FromLat", "Northernmost Lat.")
-            split.prop(context.scene, "ToLat", "Southernmost Lat.")
-            if bpy.context.scene.FromLat < bpy.context.scene.ToLat:
-                col = layout.column()
-                split = col.split(align=True)
-                split.label("Warning: Northernmost must be greater than Southernmost")
-
-            col = layout.column()
-            split = col.split(align=True)
-            split.prop(context.scene, "FromLong", "Westernmost Long.")
-            split.prop(context.scene, "ToLong", "Easternmost Long.")
-            if bpy.context.scene.FromLong > bpy.context.scene.ToLong:
-                col = layout.column()
-                split = col.split(align=True)
-                split.label("Warning: Easternmost must be greater than Westernmost")
-
-            col = layout.column()
-            split = col.split(align=True)
-            split.prop(context.scene, "Scale", "Scale")
-            split.prop(context.scene, "Magnify", "Magnify (x4)")
-            if bpy.context.scene.fpath != "":
-                col = layout.column()
-                split = col.split(align=True)
-                split.label("1 Blender unit = " + str(bpy.context.scene.Scale) + RadiusUM)
-
-            if Message != "":
-                col = layout.column()
-                split = col.split(align=True)
-                split.label("Message: " + Message)
-
-            if bpy.context.scene.fpath.upper().endswith(("IMG", "LBL")):  # Check if is selected the correct file
-                VertNumbers = (((RealLat(bpy.context.scene.FromLat) - RealLat(bpy.context.scene.ToLat)) * MAP_RESOLUTION) + 1) * ((RealLong(bpy.context.scene.ToLong) - RealLong(bpy.context.scene.FromLong)) * MAP_RESOLUTION + 1)
-            else:
-                VertNumbers = 0
-            #If I have 4 or plus vertex and at least 2 row and at least 2 point, I can import
-            if VertNumbers > 3 and (RealLat(bpy.context.scene.FromLat) > RealLat(bpy.context.scene.ToLat)) and (RealLong(bpy.context.scene.FromLong) < RealLong(bpy.context.scene.ToLong)):  # If I have 4 or plus vertex I can import
-                split = col.split(align=True)
-                split.label("Map resolution on the equator: ")
-                split.label(str(2 * math.pi * OFFSET / 360 / MAP_RESOLUTION) + " " + RadiusUM + "/pix")
-                col = layout.column()
-                split = col.split(align=True)
-                split.label("Real Northernmost Lat.: " + str(RealLat(bpy.context.scene.FromLat)) + " deg")
-                split.label("Real Southernmost Long.: " + str(RealLat(bpy.context.scene.ToLat)) + " deg")
-                split = col.split(align=True)
-                split.label("Real Westernmost Long.: " + str(RealLong(bpy.context.scene.FromLong)) + " deg")
-                split.label("Real Easternmost Long.: " + str(RealLong(bpy.context.scene.ToLong)) + "deg")
-                split = col.split(align=True)
-                split.label("Numbers of vertex to be imported: " + str(int(VertNumbers)))
-                col.separator()
-                col.operator('import.lro_and_mgs', text='Import')
-                col.separator()
-                col.operator('import.reset', text='Reset')
-
-
-#Reset the UI
-class Reset(bpy.types.Operator):
-    bl_idname = 'import.reset'
-    bl_label = 'Start Import'
-
-    def execute(self, context):
-        clear_properties()
-        return {'FINISHED'}
-
-
-def initialize():
-    global MAXIMUM_LATITUDE, MINIMUM_LATITUDE
-    global WESTERNMOST_LONGITUDE, EASTERNMOST_LONGITUDE
-    global LINES, LINE_SAMPLES, SAMPLE_BITS, MAP_RESOLUTION
-    global OFFSET, SCALING_FACTOR
-    global SAMPLE_TYPE, UNIT, TARGET_NAME, RadiusUM, Message
-    global start_up
-
-    LINES = LINE_SAMPLES = SAMPLE_BITS = MAP_RESOLUTION = 0
-    MAXIMUM_LATITUDE = MINIMUM_LATITUDE = 0.0
-    WESTERNMOST_LONGITUDE = EASTERNMOST_LONGITUDE = 0.0
-    OFFSET = SCALING_FACTOR = 0.0
-    SAMPLE_TYPE = UNIT = TARGET_NAME = RadiusUM = Message = ""
-    start_up=True
-            
-    bpy.types.Scene.fpath = bpy.props.StringProperty(
-        name="Import File ", 
-        description="Select your img file", 
-        subtype="FILE_PATH", 
-        default="", 
-        update=update_fpath)
-
-def clear_properties():
-    # can happen on reload
-    if bpy.context.scene is None:
-        return
-    global MAXIMUM_LATITUDE, MINIMUM_LATITUDE
-    global WESTERNMOST_LONGITUDE, EASTERNMOST_LONGITUDE
-    global LINES, LINE_SAMPLES, SAMPLE_BITS, MAP_RESOLUTION
-    global OFFSET, SCALING_FACTOR
-    global SAMPLE_TYPE, UNIT, TARGET_NAME, RadiusUM, Message
-    global start_up
-
-    LINES = LINE_SAMPLES = SAMPLE_BITS = MAP_RESOLUTION = 0
-    MAXIMUM_LATITUDE = MINIMUM_LATITUDE = 0.0
-    WESTERNMOST_LONGITUDE = EASTERNMOST_LONGITUDE = 0.0
-    OFFSET = SCALING_FACTOR = 0.0
-    SAMPLE_TYPE = UNIT = TARGET_NAME = RadiusUM = Message = ""
-    start_up=True
-
-    props = ["FromLat", "ToLat", "FromLong", "ToLong", "Scale", "Magnify", "fpath"]
-    for p in props:
-        if p in bpy.types.Scene.bl_rna.properties:
-            exec("del bpy.types.Scene." + p)
-        if p in bpy.context.scene:
-            del bpy.context.scene[p]
-    bpy.types.Scene.fpath = bpy.props.StringProperty(
-        name="Import File ", 
-        description="Select your img file", 
-        subtype="FILE_PATH", 
-        default="", 
-        update=update_fpath)
-
-
-# registering the script
-def register():
-    initialize()
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    clear_properties()
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/io_import_fbx.py b/release/scripts/addons_contrib/io_import_fbx.py
deleted file mode 100644
index e2c5dfb..0000000
--- a/release/scripts/addons_contrib/io_import_fbx.py
+++ /dev/null
@@ -1,510 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Import: Autodesk FBX",
-    "author": "Campbell Barton",
-    "version": (0, 0, 1),
-    "blender": (2, 56, 0),
-    "location": "File > Import ",
-    "description": "This script is WIP and not intended for general use yet!",
-    "warning": "Work in progress",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Import-Export"}
-
-
-def parse_fbx(path, fbx_data):
-    DEBUG = False
-
-    f = open(path, "rU", encoding="utf-8")
-    lines = f.readlines()
-
-    # remove comments and \n
-    lines = [l[:-1].rstrip() for l in lines if not l.lstrip().startswith(";")]
-
-    # remove whitespace
-    lines = [l for l in lines if l]
-
-    # remove multiline float lists
-    def unmultiline(i):
-        lines[i - 1] = lines[i - 1] + lines.pop(i).lstrip()
-
-    # Multiline floats, used for verts and matricies, this is harderto read so detect and make into 1 line.
-    i = 0
-    while i < len(lines):
-        l = lines[i].strip()
-        if l.startswith(","):
-            unmultiline(i)
-            i -= 1
-        try:
-            float(l.split(",", 1)[0])
-            unmultiline(i)
-            i -= 1
-        except:
-            pass
-
-        i += 1
-
-    CONTAINER = [None]
-
-    def is_int(val):
-        try:
-            CONTAINER[0] = int(val)
-            return True
-        except:
-            return False
-
-    def is_int_array(val):
-        try:
-            CONTAINER[0] = tuple([int(v) for v in val.split(",")])
-            return True
-        except:
-            return False
-
-    def is_float(val):
-        try:
-            CONTAINER[0] = float(val)
-            return True
-        except:
-            return False
-
-    def is_float_array(val):
-        try:
-            CONTAINER[0] = tuple([float(v) for v in val.split(",")])
-            return True
-        except:
-            return False
-
-    def read_fbx(i, ls):
-        if DEBUG:
-            print("LINE:", lines[i])
-
-        tag, val = lines[i].split(":", 1)
-        tag = tag.lstrip()
-        val = val.strip()
-
-        if val == "":
-            ls.append((tag, None, None))
-        if val.endswith("{"):
-            name = val[:-1].strip()  # remove the trailing {
-            if name == "":
-                name = None
-
-            sub_ls = []
-            ls.append((tag, name, sub_ls))
-
-            i += 1
-            while lines[i].strip() != "}":
-                i = read_fbx(i, sub_ls)
-
-        elif val.startswith('"') and val.endswith('"'):
-            ls.append((tag, None, val[1:-1]))  # remove quotes
-        elif is_int(val):
-            ls.append((tag, None, CONTAINER[0]))
-        elif is_float(val):
-            ls.append((tag, None, CONTAINER[0]))
-        elif is_int_array(val):
-            ls.append((tag, None, CONTAINER[0]))
-        elif is_float_array(val):
-            ls.append((tag, None, CONTAINER[0]))
-        elif tag == 'Property':
-            ptag, ptype, punknown, pval = val.split(",", 3)
-            ptag = ptag.strip().strip("\"")
-            ptype = ptype.strip().strip("\"")
-            punknown = punknown.strip().strip("\"")
-            pval = pval.strip()
-
-            if val.startswith('"') and val.endswith('"'):
-                pval = pval[1:-1]
-            elif is_int(pval):
-                pval = CONTAINER[0]
-            elif is_float(pval):
-                pval = CONTAINER[0]
-            elif is_int_array(pval):
-                pval = CONTAINER[0]
-            elif is_float_array(pval):
-                pval = CONTAINER[0]
-
-            ls.append((tag, None, (ptag, ptype, punknown, pval)))
-        else:
-            # IGNORING ('Property', None, '"Lcl Scaling", "Lcl Scaling", "A+",1.000000000000000,1.000000000000000,1.000000000000000')
-            print("\tParser Skipping:", (tag, None, val))
-
-        # name = .lstrip()[0]
-        if DEBUG:
-            print("TAG:", tag)
-            print("VAL:", val)
-        return i + 1
-
-    i = 0
-    while i < len(lines):
-        i = read_fbx(i, fbx_data)
-
-
-def parse_connections(fbx_data):
-    c = {}
-    for tag, name, value in fbx_data:
-        type, child, parent = [i.strip() for i in value.replace('"', '').split(',')]
-        if type == "OO":
-            parent = parent.replace('Model::', '').replace('Material::', '')
-            child = child.replace('Model::', '').replace('Material::', '')
-
-            c[child] = parent
-
-    return c
-
-# Blender code starts here:
-import bpy
-
-
-def import_fbx(path):
-    import math
-    import mathutils
-
-    mtx_x90 = mathutils.Matrix.Rotation(math.pi / 2.0, 3, 'X')
-
-    fbx_data = []
-    objects = {}
-    materials = {}
-    parse_fbx(path, fbx_data)
-    # Now lets get in the mesh data for fun.
-
-    def tag_get_iter(data, tag):
-        for tag_iter, name, value in data:
-            if tag_iter == tag:
-                yield (name, value)
-
-    def tag_get_single(data, tag):
-        for tag_iter, name, value in data:
-            if tag_iter == tag:
-                return (name, value)
-        return (None, None)
-
-    def tag_get_prop(data, prop):
-        for tag_iter, name, value in data:
-            if tag_iter == "Property":
-                if value[0] == prop:
-                    return value[3]
-        return None
-
-    scene = bpy.context.scene
-
-    connections = parse_connections(tag_get_single(fbx_data, "Connections")[1])
-
-    for tag1, name1, value1 in fbx_data:
-        if tag1 == "Objects":
-            for tag2, name2, value2 in value1:
-                if tag2 == "Model":
-                    '''
-                    print("")
-                    print(tag2)
-                    print(name2)
-                    print(value2)
-                    '''
-
-                    # check we import an object
-                    obj = None
-
-                    # "Model::MyCamera", "Camera"  -->  MyCamera
-                    fbx_name = name2.split(',')[0].strip()[1:-1].split("::", 1)[-1]
-                    # we dont parse this part properly
-                    # the name2 can be somtrhing like
-                    # Model "Model::kimiko", "Mesh"
-                    if name2.endswith(" \"Mesh\""):
-
-                        verts = tag_get_single(value2, "Vertices")[1]
-                        faces = tag_get_single(value2, "PolygonVertexIndex")[1]
-                        edges = tag_get_single(value2, "Edges")[1]
-
-                        # convert odd fbx verts and faces to a blender mesh.
-                        if verts and faces:
-                            me = bpy.data.meshes.new(name=fbx_name)
-                            # get a list of floats as triples
-                            blen_verts = [verts[i - 3:i] for i in range(3, len(verts) + 3, 3)]
-
-                            # get weirdo face indices and proper edge indexs
-                            # edge_points Collects faces index, first and last verts.
-
-                            face = []
-                            edge_points = {}
-                            blen_faces = [face]
-                            blen_faces_edges = []  # faces that have a length of 2
-                            blen_poly_mapping = {}
-                            poly_idx = 0
-
-                            for idx, f in enumerate(faces):
-
-                                if f < 0:
-                                    face.append(f ^ -1)
-                                    edge_points[idx] = [face[-1], face[0]]
-                                    face = []
-
-                                    if len(blen_faces[-1]) == 2:
-                                        blen_faces_edges.append(blen_faces.pop())
-                                    else:
-                                        blen_poly_mapping[poly_idx] = len(blen_faces) - 1
-
-                                    blen_faces.append(face)
-                                    poly_idx += 1
-                                else:
-                                    face.append(f)
-
-                            edge_final = []
-
-                            if len(faces) == 2:  # Special case if there is only one edge in scene.
-                                edge1 = faces[0]
-                                if edge1 < 0:
-                                    edge1 ^= -1
-                                edge2 = faces[1]
-                                if edge2 < 0:
-                                    edge2 ^= -1
-                                edge_final.append((edge1, edge2))
-
-                            else:  # More than one edges
-                                for idx, e in enumerate(edges):
-
-                                    if faces[e] < 0:  # If this is the faces last point, use edge_points to create edge between last and first points of face
-                                        edge1 = edge_points[e][0]
-                                        edge2 = edge_points[e][1]
-                                    else:
-                                        edge1 = faces[e]
-                                        edge2 = faces[e + 1]
-                                        if edge2 < 0:
-                                            edge2 ^= -1
-
-                                    edge_final.append((edge1, edge2))
-
-                            if not blen_faces[-1]:
-                                del blen_faces[-1]
-
-                            me.from_pydata(blen_verts, edge_final, blen_faces)
-                            me.update()
-
-                            # Handle smoothing
-                            for i in tag_get_iter(value2, "LayerElementSmoothing"):
-                                i = i[1]
-                                type = tag_get_single(i, "MappingInformationType")[1]
-
-                                if type == "ByPolygon":
-                                    smooth_faces = tag_get_single(i, "Smoothing")[1]
-
-                                    for idx, val in enumerate(smooth_faces):
-                                        new_idx = blen_poly_mapping.get(idx)
-                                        if new_idx is not None:
-                                            me.faces[new_idx].use_smooth = val
-                                elif type == "ByEdge":
-                                    smooth_edges = tag_get_single(i, "Smoothing")[1]
-
-                                    for idx, ed in enumerate(me.edges):
-                                        ed.use_edge_sharp = smooth_edges[idx]
-                                else:
-                                    print("WARNING: %s, unsupported smoothing type: %s" % (fbx_name, type))
-
-                            # Handle edge weighting
-                            for i in tag_get_iter(value2, "LayerElementEdgeCrease"):
-                                i = i[1]
-                                type = tag_get_single(i, "MappingInformationType")[1]
-
-                                if type == "ByPolygon":
-                                    crease_faces = tag_get_single(i, "Smoothing")[1]
-
-                                    for idx, f in enumerate(me.faces):
-                                        poly_idx = blen_poly_mapping.get(idx)
-                                        if poly_idx is not None:
-                                            f.use_smooth = crease_faces[idx]
-                                elif type == "ByEdge":
-                                    crease_edges = tag_get_single(i, "EdgeCrease")[1]
-
-                                    for idx, ed in enumerate(me.edges):
-                                        ed.crease = crease_edges[idx]
-                                else:
-                                    print("WARNING: %s, unsupported smoothing type: %s" % (fbx_name, type))
-
-                            # Create the Uv-sets
-                            for i in tag_get_iter(value2, "LayerElementUV"):
-                                i = i[1]
-                                uv_in = 0
-                                uv_face = []
-                                uv_name = tag_get_single(i, "Name")[1]
-                                print(uv_name)
-                                uv_verts = tag_get_single(i, "UV")[1]
-                                uv_index = tag_get_single(i, "UVIndex")[1]
-
-                                if(uv_verts):
-                                    blen_uv_verts = [uv_verts[i - 2:i] for i in range(2, len(uv_verts) + 2, 2)]
-
-                                    for ind, uv_i in enumerate(uv_index):
-                                        if(uv_i == -1):
-                                            uv_face.append([-0.1, -0.1])
-                                        else:
-                                            uv_face.append(blen_uv_verts[uv_i])
-                                            uv_in += 1
-
-                                    me.uv_textures.new(uv_name)
-                                    uv_layer = me.uv_textures[-1].data
-                                    uv_counter = 0
-                                    if uv_layer:
-                                        for fi, uv in enumerate(uv_layer):
-                                            if(len(me.faces[fi].vertices) == 4):
-                                                uv.uv1 = uv_face[uv_counter]
-                                                uv.uv2 = uv_face[uv_counter + 1]
-                                                uv.uv3 = uv_face[uv_counter + 2]
-                                                uv.uv4 = uv_face[uv_counter + 3]
-                                                uv_counter += 4
-                                            else:
-                                                uv.uv1 = uv_face[uv_counter]
-                                                uv.uv2 = uv_face[uv_counter + 1]
-                                                uv.uv3 = uv_face[uv_counter + 2]
-                                                uv_counter += 3
-
-                            obj = bpy.data.objects.new(fbx_name, me)
-                            base = scene.objects.link(obj)
-
-                    elif name2.endswith(" \"Camera\""):
-
-                        camera = bpy.data.cameras.new(name=fbx_name)
-
-                        props = tag_get_single(value2, "Properties60")[1]
-                        camera.angle = math.radians(tag_get_prop(props, "FieldOfView"))
-
-                        obj = bpy.data.objects.new(fbx_name, camera)
-                        base = scene.objects.link(obj)
-
-                    elif name2.endswith(" \"Light\""):
-
-                        light = bpy.data.lamps.new(name=fbx_name)
-
-                        props = tag_get_single(value2, "Properties60")[1]
-
-                        # Lamp types
-                        light_types = {0: 'POINT', 1: 'SUN', 2: 'SPOT'}
-
-                        light.type = light_types[tag_get_prop(props, "LightType")]
-                        light.energy = max(tag_get_prop(props, "Intensity") / 100.0, 0)
-                        light.color = tag_get_prop(props, "Color")
-                        light.distance = tag_get_prop(props, "DecayStart")
-
-                        if light.type == 'SPOT':
-                            light.spot_size = math.rad(tag_get_prop(props, "Cone angle"))
-
-                        # Todo: shadows
-
-                        obj = bpy.data.objects.new(fbx_name, light)
-                        base = scene.objects.link(obj)
-
-                    if obj:
-                        # Update our object dict
-                        objects[fbx_name] = obj
-
-                        # Take care of parenting (we assume the parent has already been processed)
-                        parent = connections.get(fbx_name)
-                        if parent and parent != "Scene" and not parent.startswith("DisplayLayer"):
-                            obj.parent = objects[parent]
-                            parent = obj.parent
-                        else:
-                            parent = None
-
-                        # apply transformation
-                        props = tag_get_single(value2, "Properties60")[1]
-
-                        loc = tag_get_prop(props, "Lcl Translation")
-                        rot = tag_get_prop(props, "Lcl Rotation")
-                        sca = tag_get_prop(props, "Lcl Scaling")
-
-                        # Convert rotation
-                        rot_mat = mathutils.Euler([math.radians(i) for i in rot]).to_matrix()
-                        if parent:
-                            rot_mat = parent.matrix_world.to_3x3().inverted() * rot_mat
-
-                        obj.location = loc
-                        obj.rotation_euler = rot_mat.to_euler()[:]
-                        obj.scale = sca
-
-                elif tag2 == "Material":
-
-                    # "Material::MyMaterial", ""  -->  MyMaterial
-                    fbx_name = name2.split(',')[0].strip()[1:-1].split("::", 1)[-1]
-
-                    mat = bpy.data.materials.new(name=fbx_name)
-
-                    props = tag_get_single(value2, "Properties60")[1]
-
-                    # We always use Lambert diffuse shader for now
-                    mat.diffuse_shader = 'LAMBERT'
-
-                    mat.diffuse_color = tag_get_prop(props, "DiffuseColor")
-                    mat.diffuse_intensity = tag_get_prop(props, "DiffuseFactor")
-                    mat.alpha = 1 - tag_get_prop(props, "TransparencyFactor")
-                    mat.specular_color = tag_get_prop(props, "SpecularColor")
-                    mat.specular_intensity = tag_get_prop(props, "SpecularFactor") * 2.0
-                    mat.specular_hardness = (tag_get_prop(props, "Shininess") * 5.10) + 1
-                    mat.ambient = tag_get_prop(props, "AmbientFactor")
-
-                    # Update material dict
-                    materials[fbx_name] = mat
-
-                    # Map to an object (we assume models are done before materials)
-                    obj = connections.get(fbx_name)
-                    if obj:
-                        obj = objects[obj]
-                        obj.data.materials.append(mat)
-
-    return {'FINISHED'}
-
-
-# Operator
-from bpy.props import StringProperty
-from bpy_extras.io_utils import ImportHelper
-
-
-class ImportFBX(bpy.types.Operator, ImportHelper):
-    """"""
-    bl_idname = "import_scene.fbx"
-    bl_label = "Import FBX"
-
-    filename_ext = ".fbx"
-    filter_glob = StringProperty(default="*.fbx", options={'HIDDEN'})
-
-    def execute(self, context):
-        return import_fbx(self.filepath)
-
-
-# Registering / Unregister
-def menu_func(self, context):
-    self.layout.operator(ImportFBX.bl_idname, icon='PLUGIN')
-
-
-def register():
-    bpy.utils.register_class(ImportFBX)
-    bpy.types.INFO_MT_file_import.append(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_class(ImportFBX)
-    bpy.types.INFO_MT_file_import.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
-
-
-if __name__ == "__main__":
-    import_fbx("/test.fbx")
diff --git a/release/scripts/addons_contrib/io_import_lipSync_Importer.py b/release/scripts/addons_contrib/io_import_lipSync_Importer.py
deleted file mode 100644
index 9626790..0000000
--- a/release/scripts/addons_contrib/io_import_lipSync_Importer.py
+++ /dev/null
@@ -1,478 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "LipSync Importer & Blinker",
-    "author": "Yousef Harfoush - bat3a ;)",
-    "version": (0, 5, 1),
-    "blender": (2, 65, 0),
-    "location": "3D window > Tool Shelf",
-    "description": "Plot Moho (Papagayo, Jlipsync, Yolo) file to frames and adds automatic blinking",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php?title=Extensions:2.6/Py/Scripts/Import-Export/Lipsync Importer",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=24080&group_id=153&atid=468",
-    "category": "Import-Export"}
-
-
-import bpy, re
-from random import random
-from bpy.props import *
-from bpy.props import IntProperty, FloatProperty, StringProperty
-
-global lastPhoneme
-lastPhoneme="nothing"
-
-# add blinking
-def blinker():
-    
-    scn = bpy.context.scene
-    obj = bpy.context.object
-
-    if scn.regMenuTypes.enumBlinkTypes == '0':
-        modifier = 0
-    elif scn.regMenuTypes.enumBlinkTypes == '1':
-        modifier = scn.blinkMod
-    
-    #creating keys with blinkNm count
-    for y in range(scn.blinkNm):
-        frame = y * scn.blinkSp + int(random()*modifier)
-        createShapekey('blink', frame)
-
-# -----------code contributed by dalai felinto adds armature support modified by me-------------------
-
-bone_keys = {
-"AI":   ('location', 0),
-"E":    ('location', 1),
-"FV":   ('location', 2),
-"L":    ('rotation_euler', 0),
-"MBP":  ('rotation_euler', 1),
-"O":    ('rotation_euler', 2),
-"U":    ('scale', 0),
-"WQ":   ('scale', 1),
-"etc":  ('scale', 2),
-"rest": ('ik_stretch', -1)
-}
-
-def lipsyncerBone():
-    # reading imported file & creating keys
-    object = bpy.context.object
-    scene = bpy.context.scene
-    bone = bpy.context.active_pose_bone
-    
-    resetBoneScale(bone)
-    
-    f=open(scene.fpath) # importing file
-    f.readline() # reading the 1st line that we don"t need
-    
-    for line in f:
-        # removing new lines
-        lsta = re.split("\n+", line)
-
-        # building a list of frames & shapes indexes
-        lst = re.split(":? ", lsta[0])# making a list of a frame & number 
-        frame = int(lst[0])
-        
-        for key,attribute in bone_keys.items():
-            if lst[1] == key:
-                createBoneKeys(key, bone, attribute, frame)
-
-def resetBoneScale(bone):
-    # set the attributes used by papagayo to 0.0
-    for attribute,index in bone_keys.values():
-        if index != -1:
-            #bone.location[0] = 0.0
-            exec("bone.%s[%d] = %f" % (attribute, index, 0.0))
-        else:
-            exec("bone.%s = %f" % (attribute, 0.0))
-
-def addBoneKey(bone, data_path, index=-1, value=None, frame=0, group=""):
-    # set a value and keyframe for the bone
-    # it assumes the 'bone' variable was defined before
-    # and it's the current selected bone
-    frame=bpy.context.scene.frame_current
-    if value != None:
-        if index != -1:
-            # bone.location[0] = 0.0
-            exec("bone.%s[%d] = %f" % (data_path, index, value))
-        else:
-            exec("bone.%s = %f" % (data_path, value))
-
-    # bone.keyframe_insert("location", 0, 10.0, "Lipsync")
-    exec('bone.keyframe_insert("%s", %d, %f, "%s")' % (data_path, index, frame, group))
-
-# creating keys with offset and eases for a phonem @ the Skframe
-def createBoneKeys(phoneme, bone, attribute, frame):
-    global lastPhoneme
-    
-    scene = bpy.context.scene
-    object = bpy.context.object
-    
-    offst = scene.offset     # offset value
-    skVlu = scene.skscale    # shape key value
-    
-    #in case of Papagayo format
-    if scene.regMenuTypes.enumFileTypes == '0' :
-        frmIn = scene.easeIn     # ease in value
-        frmOut = scene.easeOut   # ease out value
-        hldIn = scene.holdGap    # holding time value
-        
-    #in case of Jlipsync format or Yolo
-    elif scene.regMenuTypes.enumFileTypes == '1' :
-        frmIn = 1
-        frmOut = 1
-        hldIn = 0
-
-    # inserting the In key only when phonem change or when blinking
-    if lastPhoneme!=phoneme or eval(scene.regMenuTypes.enumModeTypes) == 1:
-        addBoneKey(bone, attribute[0], attribute[1], 0.0, offst+frame-frmIn, "Lipsync")
-
-    addBoneKey(bone, attribute[0], attribute[1], skVlu, offst+frame, "Lipsync")
-    addBoneKey(bone, attribute[0], attribute[1], skVlu, offst+frame+hldIn, "Lipsync")
-    addBoneKey(bone, attribute[0], attribute[1], 0.0, offst+frame+hldIn+frmOut, "Lipsync")
-    
-    lastPhoneme=phoneme
-
-# -------------------------------------------------------------------------------
-
-# reading imported file & creating keys
-def lipsyncer():
-    
-    obj = bpy.context.object
-    scn = bpy.context.scene
-    
-    f=open(scn.fpath) # importing file
-    f.readline() # reading the 1st line that we don"t need
-    
-    for line in f:
-
-        # removing new lines
-        lsta = re.split("\n+", line)
-
-        # building a list of frames & shapes indexes
-        lst = re.split(":? ", lsta[0])# making a list of a frame & number 
-        frame = int(lst[0])
-        
-        for key in obj.data.shape_keys.key_blocks:
-            if lst[1] == key.name:
-                createShapekey(key.name, frame)
-
-# creating keys with offset and eases for a phonem @ the frame
-def createShapekey(phoneme, frame):
-    
-    global lastPhoneme
-    
-    scn = bpy.context.scene
-    obj = bpy.context.object
-    objSK = obj.data.shape_keys
-    
-    offst = scn.offset     # offset value
-    skVlu = scn.skscale    # shape key value
-    
-    #in case of Papagayo format
-    if scn.regMenuTypes.enumFileTypes == '0' :
-        frmIn = scn.easeIn     # ease in value
-        frmOut = scn.easeOut   # ease out value
-        hldIn = scn.holdGap    # holding time value
-        
-    #in case of Jlipsync format or Yolo
-    elif scn.regMenuTypes.enumFileTypes == '1' :
-        frmIn = 1
-        frmOut = 1
-        hldIn = 0
-
-    # inserting the In key only when phonem change or when blinking
-    if lastPhoneme!=phoneme or eval(scn.regMenuTypes.enumModeTypes) == 1:
-        objSK.key_blocks[phoneme].value=0.0
-        objSK.key_blocks[phoneme].keyframe_insert("value",
-            -1, offst+frame-frmIn, "Lipsync")
-            
-    objSK.key_blocks[phoneme].value=skVlu
-    objSK.key_blocks[phoneme].keyframe_insert("value", 
-        -1, offst+frame, "Lipsync")
-    
-    objSK.key_blocks[phoneme].value=skVlu
-    objSK.key_blocks[phoneme].keyframe_insert("value", 
-        -1, offst+frame+hldIn, "Lipsync")
-            
-    objSK.key_blocks[phoneme].value=0.0
-    objSK.key_blocks[phoneme].keyframe_insert("value", 
-    -1, offst+frame+hldIn+frmOut, "Lipsync")
-    
-    lastPhoneme = phoneme
-
-# lipsyncer operation start
-class btn_lipsyncer(bpy.types.Operator):
-    bl_idname = 'lipsync.go'
-    bl_label = 'Start Processing'
-    bl_description = 'Plots the voice file keys to timeline'
-
-    def execute(self, context):
-
-        scn = context.scene
-        obj = context.active_object
-
-        # testing if object is valid
-        if obj!=None:
-            if obj.type=="MESH":
-                if obj.data.shape_keys!=None:
-                    if scn.fpath!='': lipsyncer()
-                    else: print ("select a Moho file")
-                else: print("No shape keys")
-    
-            elif obj.type=="ARMATURE":
-                if 1:#XXX add prop test
-                    if scn.fpath!='': lipsyncerBone()
-                    else: print ("select a Moho file")
-                else: print("Create Pose properties")
-                
-            else: print ("Object is not a mesh ot bone")
-        else: print ("Select object")
-        return {'FINISHED'}
-
-# blinker operation start
-class btn_blinker(bpy.types.Operator):
-    bl_idname = 'blink.go'
-    bl_label = 'Start Processing'
-    bl_description = 'Add blinks at random or specifice frames'
-
-    def execute(self, context):
-        
-        scn = context.scene
-        obj = context.object
-
-         # testing if object is valid
-        if obj!=None:
-            if obj.type=="MESH":
-                if obj.data.shape_keys!=None:
-                    for key in obj.data.shape_keys.key_blocks:
-                        if key.name=='blink':
-                            blinker()
-                            #return
-                else: print("No shape keys")
-            else: print ("Object is not a mesh ot bone")
-        else: print ("Select object")
-        return {'FINISHED'}
-
-
-#defining custom enumeratos
-class menuTypes(bpy.types.PropertyGroup):
-
-    enumFileTypes = EnumProperty(items =(('0', 'Papagayo', ''), 
-                                         ('1', 'Jlipsync Or Yolo', '')
-                                       #,('2', 'Retarget', '')
-                                         ),
-                                 name = 'Choose FileType',
-                                 default = '0')
-
-    enumBlinkTypes = EnumProperty(items =(('0', 'Specific', ''),
-                                          ('1', 'Random','')),
-                                  name = 'Choose BlinkType',
-                                  default = '0')
-
-    enumModeTypes = EnumProperty(items =(('0', 'Lipsyncer',''),
-                                         ('1', 'Blinker','')),
-                                 name = 'Choose Mode',
-                                 default = '0')
-                                 
-# drawing the user interface
-class LipSyncBoneUI(bpy.types.Panel):
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "UI"
-    bl_label = "Phonemes"
-    
-    def draw(self, context):
-        layout = self.layout
-        col = layout.column()
-
-        bone = bpy.context.active_pose_bone
-        
-        #showing the current object type
-        if bone: #and if scn.regMenuTypes.enumModeTypes == '0':
-            col.prop(bone, "location", index=0, text="AI")
-            col.prop(bone, "location", index=1, text="E")
-            col.prop(bone, "location", index=2, text="FV")
-            if bpy.context.scene.unit_settings.system_rotation == 'RADIANS':
-                col.prop(bone, "rotation_euler", index=0, text="L")
-                col.prop(bone, "rotation_euler", index=1, text="MBP")
-                col.prop(bone, "rotation_euler", index=2, text="O")
-            else:
-                row=col.row()
-                row.prop(bone, "rotation_euler", index=0, text="L")
-                row.label(text=str("%4.2f" % (bone.rotation_euler.x)))
-                row=col.row()
-                row.prop(bone, "rotation_euler", index=1, text="MBP")
-                row.label(text=str("%4.2f" % (bone.rotation_euler.y)))
-                row=col.row()
-                row.prop(bone, "rotation_euler", index=2, text="O")
-                row.label(text=str("%4.2f" % (bone.rotation_euler.z)))
-            col.prop(bone, "scale", index=0, text="U")
-            col.prop(bone, "scale", index=1, text="WQ")
-            col.prop(bone, "scale", index=2, text="etc")
-        else:
-            layout.label(text="No good bone is selected")
-            
-# drawing the user interface
-class LipSyncUI(bpy.types.Panel):
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOL_PROPS"
-    bl_label = "LipSync Importer & Blinker"
-    
-    newType= bpy.types.Scene
-    
-    newType.fpath = StringProperty(name="Import File ", description="Select your voice file", subtype="FILE_PATH")
-    newType.skscale = FloatProperty(description="Smoothing shape key values", min=0.1, max=1.0, default=0.8)
-    newType.offset = IntProperty(description="Offset your frames", default=0)
-
-    newType.easeIn = IntProperty(description="Smoothing In curve", min=1, default=3)
-    newType.easeOut = IntProperty(description="Smoothing Out curve", min=1, default=3)
-    newType.holdGap = IntProperty(description="Holding for slow keys", min=0, default=0)
-
-    newType.blinkSp = IntProperty(description="Space between blinks", min=1, default=100)
-    newType.blinkNm = IntProperty(description="Number of blinks", min=1, default=10)
-    
-    newType.blinkMod = IntProperty(description="Randomzing keyframe placment", min=1, default=10)
-    
-    def draw(self, context):
-        
-        obj = bpy.context.active_object
-        scn = bpy.context.scene
-        
-        layout = self.layout
-        col = layout.column()
-
-        # showing the current object type
-        if obj != None:
-            if obj.type == "MESH":
-                split = col.split(align=True)
-                split.label(text="The active object is: ", icon="OBJECT_DATA")
-                split.label(obj.name, icon="EDITMODE_HLT")
-            elif obj.type == "ARMATURE": # bone needs to be selected
-                if obj.mode == "POSE": # mode needs to be pose
-                    split = col.split(align=True)
-                    split.label(text="The active object is: ", icon="ARMATURE_DATA")
-                    split.label(obj.name, icon="EDITMODE_HLT")
-                else:
-                    col.label(text="You need to select Pose mode!", icon="OBJECT_DATA")
-            else:
-                col.label(text="The active object is not a Mesh or Armature!", icon="OBJECT_DATA")
-        else:
-            layout.label(text="No object is selected", icon="OBJECT_DATA")
-            
-        col.row().prop(scn.regMenuTypes, 'enumModeTypes')
-        col.separator()
-        
-        # the lipsyncer panel 
-        if scn.regMenuTypes.enumModeTypes == '0':
-            # choose the file format
-            col.row().prop(scn.regMenuTypes, 'enumFileTypes', text = ' ', expand = True)
-                
-            # Papagayo panel
-            if scn.regMenuTypes.enumFileTypes == '0':
-                col.prop(context.scene, "fpath")
-                split = col.split(align=True)
-                split.label("Key Value :")
-                split.prop(context.scene, "skscale")
-                split = col.split(align=True)
-                split.label("Frame Offset :")
-                split.prop(context.scene, "offset")
-                split = col.split(align=True)
-                split.prop(context.scene, "easeIn", "Ease In")
-                split.prop(context.scene, "holdGap", "Hold Gap")
-                split.prop(context.scene, "easeOut", "Ease Out")
-                
-                col.operator('lipsync.go', text='Plot Keys to the Timeline')
-
-            # Jlipsync & Yolo panel
-            elif scn.regMenuTypes.enumFileTypes == '1':
-                col.prop(context.scene, "fpath")
-                split = col.split(align=True)
-                split.label("Key Value :")
-                split.prop(context.scene, "skscale")
-                split = col.split(align=True)
-                split.label("Frame Offset :")
-                split.prop(context.scene, "offset")
-                
-                col.operator('lipsync.go', text='Plot Keys to the Timeline')
-        
-        # the blinker panel
-        elif scn.regMenuTypes.enumModeTypes == '1':
-            # choose blink type
-            col.row().prop(scn.regMenuTypes, 'enumBlinkTypes', text = ' ', expand = True)
-            
-            # specific panel
-            if scn.regMenuTypes.enumBlinkTypes == '0':
-                split = col.split(align=True)
-                split.label("Key Value :")
-                split.prop(context.scene, "skscale")
-                split = col.split(align=True)
-                split.label("Frame Offset :")
-                split.prop(context.scene, "offset")
-                split = col.split(align=True)
-                split.prop(context.scene, "easeIn", "Ease In")
-                split.prop(context.scene, "holdGap", "Hold Gap")
-                split.prop(context.scene, "easeOut", "Ease Out")
-                col.prop(context.scene, "blinkSp", "Spacing")
-                col.prop(context.scene, "blinkNm", "Times")
-                col.operator('blink.go', text='Add Keys to the Timeline')
-            
-            # Random panel
-            elif scn.regMenuTypes.enumBlinkTypes == '1':
-                split = col.split(align=True)
-                split.label("Key Value :")
-                split.prop(context.scene, "skscale")
-                split = col.split(align=True)
-                split.label("Frame Start :")
-                split.prop(context.scene, "offset")
-                split = col.split(align=True)
-                split.prop(context.scene, "easeIn", "Ease In")
-                split.prop(context.scene, "holdGap", "Hold Gap")
-                split.prop(context.scene, "easeOut", "Ease Out")
-                split = col.split(align=True)
-                split.prop(context.scene, "blinkSp", "Spacing")
-                split.prop(context.scene, "blinkMod", "Random Modifier")
-                col.prop(context.scene, "blinkNm", "Times")
-                col.operator('blink.go', text='Add Keys to the Timeline')
-        
-        
-# clearing vars
-def clear_properties():
-
-    # can happen on reload
-    if bpy.context.scene is None:
-        return
-     
-    props = ["fpath", "skscale", "offset", "easeIn", "easeOut", "holdGap", "blinkSp", "blinkNm", "blinkMod"]
-    for p in props:
-        if p in bpy.types.Scene.bl_rna.properties:
-            exec("del bpy.types.Scene."+p)
-        if p in bpy.context.scene:
-            del bpy.context.scene[p]
-
-# registering the script
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.Scene.regMenuTypes = PointerProperty(type = menuTypes)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    del bpy.context.scene.regMenuTypes
-
-    clear_properties()
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/io_import_sound_to_anim.py b/release/scripts/addons_contrib/io_import_sound_to_anim.py
deleted file mode 100644
index 4a05656..0000000
--- a/release/scripts/addons_contrib/io_import_sound_to_anim.py
+++ /dev/null
@@ -1,1930 +0,0 @@
-#!/usr/bin/python3
-# To change this template, choose Tools | Templates
-# and open the template in the editor.
-#  ***** 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 3 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, see <http://www.gnu.org/licenses/>.
-#  All rights reserved.
-#  ***** GPL LICENSE BLOCK *****
-
-bl_info = {
-    "name": "Import: Sound to Animation",
-    "author": "Vlassius",
-    "version": (0, 70),
-    "blender": (2, 64, 0),
-    "api": 52100,
-    "location": "Select a object -> go to the Object tab ->  Import Movement From Wav File",
-    "description": "Extract movement from sound file. See the Object Panel at the end.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Import_Movement_From_Audio_File",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=23565&group_id=153&atid=467",
-    "category": "Import-Export"}
-
-"""
--- Extract movement from sound file, to help in animation - import script --<br>
-
-- NOTES:
-- This script takes a wav file and get sound "movement" to help you in sync the movement to words in the wave file. <br>
-- Supported Audio: .wav (wave) 8 bits and 16 bits - mono and multichanel file<br>
-- At least Blender 2.64.9 is necessary to run this program.
-- Curitiba - Brasil
-
-
--v 0.70Beta-
-    Included: SmartRender - Render just the frames that has changes
-    Included: Options to check SmartRender for Blender Internal Render Engine:LocRotScale, Material, Transp, Mirror
-    Included: User can Cancel all functions with CANCEL button- Extensive Code and flux change (bugs expected)
-    Included: User can Cancel all functions with ESC
-    Inclused: User friendly messages into UI while running (its no more necessary to look at terminal window to most users)
-    Cleanup:  Non Stardard Chars in coments
-    To Do:    Decrease overhead of timer loops
-    To Do:    Try to implement Smart Render for Cycles
-
--v 0.60Beta-
-    Included: Option to use just the beat from the audio sound
-    Included: Option to exclude the beat from the audio sound
-    Included: More or less sensibility options when using the beat
-    Included: Audio Channel Select option
-
--v 0.50Beta-
-    Included: Auto Adjust Audio Sensity option
-    Included: 8 bits .wav file support
-    Recalibrated: Manual audio sense 1
-    Cosmetic: Many changes in panel and terminal window info
-    Corrected: Tracker_url
-    Corrected: a few bytes in Memory Leaks
-    work around: memory leak in function: bpy.ops.transform.rotate
-    work around: memory leak in function: bpy.ops.anim.keyframe_insert
-
--v 0.22Beta-
-    Included:
-    Camera Rotation
-    Empty Location-Rotation-Scale
-
--v 0.21Beta-
-    Changed just the meta informations like version and wiki page.
-
--v 0.20 Beta-
-    New Panel
-
--v 0.1.5 Beta-
-    Change in API-> Properties
-    Included the button "Get FPS from Scene" due to a problem to get it in the start
-    Return to Frame 1 after import
-    Filter .wav type file (by batFINGER)
-
--v 0.1.4 Beta-
-    If choose negative in rotation, auto check the rotation negative to Bones
-    change in register()  unregister():
-
--v 0.1.3 Beta-
-    File Cleanup
-    Change to bl_info.
-    Cosmetic Changes.
-    Minor change in API in how to define buttons.
-    Adjust in otimization.
-
--v 0.1.2 Beta
-change in API- Update function bpy.ops.anim.keyframe_insert_menu
-
--v 0.1.1 Beta
-change in API- Update property of  window_manager.fileselect_add
-
--v 0.1.0 Beta
-new - Added support to LAMP object
-new - improved flow to import
-new - check the type of object before show options
-bug - option max. and min. values
-change- Updated scene properties for changes in property API.
-        See http://lists.blender.org/pipermail/bf-committers/2010-September/028654.html
-new flow: 1) Process the sound file    2) Show Button to import key frames
-
-- v0.0.4 ALPHA
-new - Added destructive optimizer option - LostLestSignificativeDigit lost/total -> 10/255 default
-new - Visual Graph to samples
-new - Option to just process audio file and do not import - this is to help adjust the audio values
-new - Get and show automatically the FPS (in proper field) information taking the information from scene
-bug- Display sensitivity +1
-bug - Corrected location of the script in description
-
-- v0.0.3
-Main change: Corrected to work INSIDE dir /install/linux2/2.53/scripts/addons
-Corrected position of label "Rotation Negative"
-Added correct way to deal with paths in Python os.path.join - os.path.normpath
-
-- v0.0.2
-Corrected initial error (Register() function)
-Corrected some labels R. S. L.
-Turned off "object field" for now
-Changed target default to Z location
-
-- v0.0.1
-Initial version
-
-Credit to:
-Vlassius
-
-- http://vlassius.com.br
-- vlassius at vlassius.com.br
-- Curitiba - Brasil
-
-"""
-
-import bpy
-from bpy.props import *
-#from io_utils import ImportHelper
-import wave
-
-#para deixar global
-def _Interna_Globals(BytesDadosTotProcess, context):
-    global array
-    global arrayAutoSense
-
-    array= bytearray(BytesDadosTotProcess)  # cria array
-    arrayAutoSense= bytearray((BytesDadosTotProcess)*2)  # cria array para AutoAudioSense
-    context.scene.imp_sound_to_anim.bArrayCriado=True
-
-#
-#==================================================================================================
-# BLENDER UI Panel
-#==================================================================================================
-#
-class VIEW3D_PT_CustomMenuPanel(bpy.types.Panel):
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "object"
-    bl_label = "Import Movement From Wav File"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        layout = self.layout
-
-        b=bpy.context.active_object.type=='EMPTY' or bpy.context.active_object.type=='ARMATURE' or \
-                                                            bpy.context.active_object.type=='MESH' or \
-                                                            bpy.context.active_object.type=='CAMERA' or \
-                                                            bpy.context.active_object.type=='LAMP'
-        if not b:
-            row=layout.row()
-            row.label(text="The Selected Object is: type \"" + bpy.context.active_object.type + \
-                                                                    "\", and it is not supported.")
-            row=layout.row()
-            row.label(text="Supported Object are Type: Armature, Mesh, Camera and Lamp")
-            row=layout.row()
-        else:
-            #print(context.scene.imp_sound_to_anim.bTypeImport)
-            if context.scene.imp_sound_to_anim.bTypeImport == 0:
-                #mount panel to Direct animation
-                row=layout.row()
-                layout.operator("import.sound_animation_botao_udirect")
-
-            # monta as telas quando está rodando
-            elif context.scene.imp_sound_to_anim.Working!="":   #its running
-                row=layout.row()
-                row=layout.row()
-
-                if context.scene.imp_sound_to_anim.Working== "CheckSmartRender":
-                    #context.scene.imp_sound_to_anim.Info_check_smartrender=
-                    row=layout.row()
-                    row.label(text="Checking for Smart Render...")
-                    row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_check_smartrender)
-                    row=layout.row()
-
-                elif context.scene.imp_sound_to_anim.Working== "SmartRender":
-                    #context.scene.imp_sound_to_anim.Info_check_smartrender=
-                    row=layout.row()
-                    row.label(text="Processing Smart Render...")
-                    row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_check_smartrender)
-                    row=layout.row()
-
-                elif context.scene.imp_sound_to_anim.Working== "ProcessaSom":
-                    #context.scene.imp_sound_to_anim.Info_Import=
-                    row=layout.row()
-                    row.label(text="Processing Sound File...")
-                    row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_Import)
-
-                elif context.scene.imp_sound_to_anim.Working== "wavimport":
-                    #context.scene.imp_sound_to_anim.Info_Import=
-                    row=layout.row()
-                    row.label(text="Importing Keys...")
-                    row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_Import)
-                    row=layout.row()
-
-                # botao cancel
-                layout.operator(OBJECT_OT_Botao_Cancel.bl_idname)
-                row=layout.row()
-
-            elif context.scene.imp_sound_to_anim.bTypeImport == 1:
-                row=layout.row()
-                row.label(text="1)Click button \"Process Wav\",")
-                row=layout.row()
-                row.label(text="2)Click Button \"Import Key Frames\",")
-                row=layout.row()
-                row.label(text="Run the animation (alt A) and Enjoy!")
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"action_auto_audio_sense")
-                row=layout.row()
-                if context.scene.imp_sound_to_anim.action_auto_audio_sense == 0:   # se auto audio sense desligado
-                    row.prop(context.scene.imp_sound_to_anim,"audio_sense")
-                    row=layout.row()
-
-                else: #somente se autosense ligado
-                    if context.scene.imp_sound_to_anim.remove_beat == 0 :
-                        row.prop(context.scene.imp_sound_to_anim,"use_just_beat")
-
-                    if context.scene.imp_sound_to_anim.use_just_beat == 0:
-                        row.prop(context.scene.imp_sound_to_anim,"remove_beat")
-
-                    if context.scene.imp_sound_to_anim.use_just_beat or context.scene.imp_sound_to_anim.remove_beat:
-                        if not context.scene.imp_sound_to_anim.beat_less_sensible and not context.scene.imp_sound_to_anim.beat_more_sensible:
-                            row=layout.row()
-                        if context.scene.imp_sound_to_anim.beat_less_sensible ==0:
-                            row.prop(context.scene.imp_sound_to_anim,"beat_more_sensible")
-
-                        if context.scene.imp_sound_to_anim.beat_more_sensible ==0:
-                            row.prop(context.scene.imp_sound_to_anim,"beat_less_sensible")
-
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"action_per_second")
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"action_escale")
-
-                #row=layout.row()
-                row.label(text="Result from 0 to " + str(round(255/context.scene.imp_sound_to_anim.action_escale,4)) + "")
-
-                row=layout.row()
-                row.label(text="Property to Change:")
-                row.prop(context.scene.imp_sound_to_anim,"import_type")
-
-                #coluna
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"import_where1")
-                row.prop(context.scene.imp_sound_to_anim,"import_where2")
-                row.prop(context.scene.imp_sound_to_anim,"import_where3")
-
-                row=layout.row()
-                row.label(text='Optional Configurations:')
-                row=layout.row()
-
-                row.prop(context.scene.imp_sound_to_anim,"frames_per_second")
-                row=layout.row()
-                #coluna
-                column= layout.column()
-                split=column.split(percentage=0.5)
-                col=split.column()
-
-                row=col.row()
-                row.prop(context.scene.imp_sound_to_anim,"frames_initial")
-
-                row=col.row()
-                row.prop(context.scene.imp_sound_to_anim,"action_min_value")
-
-                col=split.column()
-
-                row=col.row()
-                row.prop(context.scene.imp_sound_to_anim,"optimization_destructive")
-
-                row=col.row()
-                row.prop(context.scene.imp_sound_to_anim,"action_max_value")
-
-                row=layout.row()
-
-                row.prop(context.scene.imp_sound_to_anim,"action_offset_x")
-                row.prop(context.scene.imp_sound_to_anim,"action_offset_y")
-                row.prop(context.scene.imp_sound_to_anim,"action_offset_z")
-
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"audio_channel_select")
-                row.prop(context.scene.imp_sound_to_anim,"action_valor_igual")
-
-                #operator button
-                #OBJECT_OT_Botao_Go => Botao_GO
-                row=layout.row()
-                layout.operator(OBJECT_OT_Botao_Go.bl_idname)
-
-                row=layout.row()
-                row.label(text=context.scene.imp_sound_to_anim.Info_Import)
-
-                # preciso garantir a existencia do array porque o Blender salva no arquivo como existente sem o array existir
-                try:
-                    array
-                except NameError:
-                    nada=0 #dummy
-                else:
-                    if context.scene.imp_sound_to_anim.bArrayCriado:
-                        layout.operator(OBJECT_OT_Botao_Import.bl_idname)
-                        row=layout.row()
-
-                #Layout SmartRender, somente para Blender_render
-                if bpy.context.scene.render.engine == "BLENDER_RENDER":
-                    row=layout.row()
-                    row.label(text="----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
-                    row=layout.row()
-                    if context.scene.imp_sound_to_anim.Info_check_smartrender!= "":
-                        row=layout.row()
-                        row.label(text=context.scene.imp_sound_to_anim.Info_check_smartrender)
-
-                    row=layout.row()
-                    row.operator(OBJECT_OT_Botao_Check_SmartRender.bl_idname)
-                    if context.scene.imp_sound_to_anim.Info_check_smartrender!= "":
-                        row.operator(OBJECT_OT_Botao_SmartRender.bl_idname)
-
-                    row=layout.row()
-                    row.prop(context.scene.imp_sound_to_anim,"check_smartrender_loc_rot_sc")
-                    row.prop(context.scene.imp_sound_to_anim,"check_smartrender_material_basic")
-                    row=layout.row()
-                    row.prop(context.scene.imp_sound_to_anim,"check_smartrender_material_transparence")
-                    row.prop(context.scene.imp_sound_to_anim,"check_smartrender_material_mirror")
-
-            #-----------------------------
-            #Use Driver
-            #-----------------------------
-            if context.scene.imp_sound_to_anim.bTypeImport == 2:
-
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"audio_sense")
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"frames_per_second")
-                row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"action_per_second")
-                row=layout.row()
-                layout.operator(ImportWavFile.bl_idname)
-
-
-#
-#==================================================================================================
-# BLENDER UI PropertyGroup
-#==================================================================================================
-#
-class ImpSoundtoAnim(bpy.types.PropertyGroup):
-
-        #Array created
-        bArrayCriado = IntProperty(name="",
-            description="Avisa que rodou process de som",
-            default=0)
-
-        #Script Running
-        Working = StringProperty(name="",
-            description="Script esta trabalhando",
-            maxlen= 1024,
-            default="")
-
-        #Nome do objeto
-        Info_Import = StringProperty(name="",
-            description="Info about Import",
-            maxlen= 1024,
-            default= "")#this set the initial text
-
-        #Mensagem Smart Render
-        Info_check_smartrender = StringProperty(name="",
-            description="Smart Render Message",
-            maxlen= 1024,
-            default= "")#this set the initial text
-
-        #iAudioSensib=0    #sensibilidade volume do audio 0 a 5. Quanto maior, mais sensibilidade
-        audio_sense = IntProperty(name="Audio Sens",
-            description="Audio Sensibility.",
-            min=1,
-            max=6,
-            step=1,
-            default= 1)
-
-        #iFramesPorSeg=15  #Frames por segundo para key frame
-        #fps= (bpy.types.Scene) bpy.context.scene.render.fps
-        frames_per_second = IntProperty(name="#Frames/s",
-            description="Frames you want per second. Better match your set up in Blender scene.",
-            min=1,
-            max=120,
-            step=1)
-
-        #iMovPorSeg=1      #Sensibilidade de movimento. 3= 3 movimentos por segundo
-        action_per_second = IntProperty(name="Act/s",
-            description="Actions per second. From 1 to #Frames/s",
-            min=1,
-            max=120,
-            step=1,
-            default= 4)#this set the initial text
-
-        #iDivScala=200
-        #scala do valor do movimento. [se =1 - 0 a 255 ] [se=255 - 0,00000 a 1,00000] [se=1000 - 0 a 0.255]
-        action_escale = IntProperty(name="Scale",
-            description="Scale the result values. See the text at right side of the field",
-            min=1,
-            max=99999,
-            step=100,
-            default= 100)#this set the initial text
-
-        #iMaxValue=255
-        action_max_value = IntProperty(name="Clip Max",
-            description="Set the max value (clip higher values).",
-            min=1,
-            max=255,
-            step=1,
-            default= 255)#this set the initial text
-
-        #iMinValue=0
-        action_min_value = IntProperty(name="Clip Min",
-            description="Set the min value. (clip lower values)",
-            min=0,
-            max=255,
-            step=1,
-            default= 0)#this set the initial text
-
-        #iStartFrame=0#
-        frames_initial = IntProperty(name="Frame Ini",
-            description="Where to start to put the computed values.",
-            min=0,
-            max=999999999,
-            step=1,
-            default= 0)
-
-        audio_channel_select = IntProperty(name="Audio Channel",
-            description="Choose the audio channel to use",
-            min=1,
-            max=10,
-            step=1,
-            default= 1)
-
-        action_offset_x = FloatProperty(name="XOffset",
-            description="Offset X Values",
-            min=-999999,
-            max=999999,
-            step=1,
-            default= 0)
-
-        action_offset_y = FloatProperty(name="YOffset",
-            description="Offset Y Values",
-            min=-999999,
-            max=999999,
-            step=1,
-            default= 0)
-
-        action_offset_z = FloatProperty(name="ZOffset",
-            description="Offset Z Values",
-            min=-999999,
-            max=999999,
-            step=1,
-            default= 0)
-
-        import_type= EnumProperty(items=(('imp_t_Scale', "Scale", "Apply to Scale"),
-                                         ('imp_t_Rotation', "Rotation", "Apply to Rotation"),
-                                         ('imp_t_Location', "Location", "Apply to Location")
-                                        ),
-                                 name="",
-                                 description= "Property to Import Values",
-                                 default='imp_t_Location')
-
-        import_where1= EnumProperty(items=(('imp_w_-z', "-z", "Apply to -z"),
-                                          ('imp_w_-y', "-y", "Apply to -y"),
-                                          ('imp_w_-x', "-x", "Apply to -x"),
-                                          ('imp_w_z', "z", "Apply to z"),
-                                          ('imp_w_y', "y", "Apply to y"),
-                                          ('imp_w_x', "x", "Apply to x")
-                                        ),
-                                 name="",
-                                 description= "Where to Import",
-                                 default='imp_w_z')
-
-        import_where2= EnumProperty(items=(('imp_w_none', "None", ""),
-                                          ('imp_w_-z', "-z", "Apply to -z"),
-                                          ('imp_w_-y', "-y", "Apply to -y"),
-                                          ('imp_w_-x', "-x", "Apply to -x"),
-                                          ('imp_w_z', "z", "Apply to z"),
-                                          ('imp_w_y', "y", "Apply to y"),
-                                          ('imp_w_x', "x", "Apply to x")
-                                        ),
-                                 name="",
-                                 description= "Where to Import",
-                                 default='imp_w_none')
-
-        import_where3= EnumProperty(items=(('imp_w_none', "None", ""),
-                                          ('imp_w_-z', "-z", "Apply to -z"),
-                                          ('imp_w_-y', "-y", "Apply to -y"),
-                                          ('imp_w_-x', "-x", "Apply to -x"),
-                                          ('imp_w_z', "z", "Apply to z"),
-                                          ('imp_w_y', "y", "Apply to y"),
-                                          ('imp_w_x', "x", "Apply to x")
-                                        ),
-                                 name="",
-                                 description= "Where to Import",
-                                 default='imp_w_none')
-
-
-        #========== Propriedades boolean  =============#
-
-        #  INVERTIDO!!!  bNaoValorIgual=True    # nao deixa repetir valores     INVERTIDO!!!
-        action_valor_igual = BoolProperty(name="Hard Transition",
-            description="Use to movements like a mouth, to a arm movement, maybe you will not use this.",
-            default=1)
-
-        action_auto_audio_sense = BoolProperty(name="Auto Audio Sensitivity",
-            description="Try to discover best audio scale. ",
-            default=1)
-
-        use_just_beat=BoolProperty(name="Just Use The Beat",
-            description="Try to use just the beat to extract movement.",
-            default=0)
-
-        remove_beat=BoolProperty(name="Remove The Beat",
-            description="Try to remove the beat to extract movement.",
-            default=0)
-
-        beat_more_sensible=BoolProperty(name="More Sensible",
-            description="Try To be more sensible about the beat.",
-            default=0)
-
-        beat_less_sensible=BoolProperty(name="Less Sensible",
-            description="Try to be less sensible about the beat.",
-            default=0)
-
-        check_smartrender_loc_rot_sc=BoolProperty(name="Loc Rot Scale",
-            description="Find changes in Location, Rotation and Scale Frame by Frame.",
-            default=1)
-
-        check_smartrender_material_basic=BoolProperty(name="Basic Material",
-            description="Find changes in basic material settings Frame by Frame.",
-            default=1)
-
-        check_smartrender_material_transparence=BoolProperty(name="Material Transparence",
-            description="Find changes in material transparence settings Frame by Frame.",
-            default=0)
-
-        check_smartrender_material_mirror=BoolProperty(name="Material Mirror",
-            description="Find changes in material mirror settings Frame by Frame.",
-            default=0)
-
-        timer_reset_func=BoolProperty(name="Reset Counters",
-            description="Reset Counters after stop",
-            default=0)
-
-        cancel_button_hit=BoolProperty(name="Cancel Hit",
-            description="Cancel Hit",
-            default=0)
-
-        #  Optimization
-        optimization_destructive = IntProperty(name="Optimization",
-            description="Hi value = Hi optimization -> Hi loss of information.",
-            min=0,
-            max=254,
-            step=10,
-            default= 10)
-
-        # import as driver or direct   NOT IN USE!!
-        # not defined
-        # Direct=1
-        # Driver=2
-        bTypeImport = IntProperty(name="",
-            description="Import Direct or Driver",
-            default=0)
-
-        # globais do dialog open wave
-        filter_glob = StringProperty(default="*.wav", options={'HIDDEN'})
-        path =        StringProperty(name="File Path", description="Filepath used for importing the WAV file", \
-                                                                                        maxlen= 1024, default= "")
-        filename =    StringProperty(name="File Name", description="Name of the file")
-        directory =   StringProperty(name="Directory", description="Directory of the file")
-
-from bpy.props import *
-
-def WavFileImport(self, context):
-    self.layout.operator(ImportWavFile.bl_idname, text="Import a wav file", icon='PLUGIN')
-
-
-#
-#==================================================================================================
-# Use Direct
-#==================================================================================================
-#
-class OBJECT_OT_Botao_uDirect(bpy.types.Operator):
-    '''Import as Direct Animation'''
-    bl_idname = "import.sound_animation_botao_udirect"
-    bl_label = "Direct to a Property"
-
-    def execute(self, context):
-        context.scene.imp_sound_to_anim.bTypeImport= 1
-        if context.scene.imp_sound_to_anim.frames_per_second == 0:
-             context.scene.imp_sound_to_anim.frames_per_second= bpy.context.scene.render.fps
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        self.execute(context)
-        return {'FINISHED'}
-
-#
-#==================================================================================================
-# Button - Import
-#==================================================================================================
-#
-class OBJECT_OT_Botao_Import(bpy.types.Operator):
-    '''Import Key Frames to Blender'''
-    bl_idname = "import.sound_animation_botao_import"
-    bl_label = "Import Key Frames"
-
-    RunFrom=0
-    iSumImportFrames=0
-    iSumOptimizerP1=0
-    iSumOptimizerP2=0
-    iSumOptimizerP3=0
-
-    def wavimport(context, loop):
-        obi=OBJECT_OT_Botao_Import
-
-        # para de entrar no timer
-        context.scene.imp_sound_to_anim.Working=""
-        #reseta contadores caso seja pedido
-        if context.scene.imp_sound_to_anim.timer_reset_func:
-            obi.RunFrom=0
-            obi.iSumOptimizerP1=0
-            obi.iSumOptimizerP2=0
-            obi.iSumOptimizerP3=0
-            obi.iSumImportFrames=0
-            context.scene.imp_sound_to_anim.timer_reset_func=False
-
-        #limita o loop se estiver no fim
-        tot=len(array)-1
-        if obi.RunFrom+loop > tot:
-            loop= tot - obi.RunFrom
-
-        #scala do valor do movimento. [se =1 - 0 a 255 ] [se=255 - 0,00000 a 1,00000] [se=1000 - 0 a 0.255]
-        iDivScala= int(context.scene.imp_sound_to_anim.action_escale)
-
-        # nao deixa repetir valores
-        bNaoValorIgual=True
-        if context.scene.imp_sound_to_anim.action_valor_igual: bNaoValorIgual= False
-
-        # inicia no inicio pedido pelo usuario mais ponteiro RunFrom
-        iStartFrame= int(context.scene.imp_sound_to_anim.frames_initial) + obi.RunFrom
-
-        iMaxValue= context.scene.imp_sound_to_anim.action_max_value
-        iMinValue= context.scene.imp_sound_to_anim.action_min_value
-
-        bEscala=bRotacao=bEixo=False
-        if context.scene.imp_sound_to_anim.import_type=='imp_t_Scale':
-            bEscala=True;
-
-        if context.scene.imp_sound_to_anim.import_type=='imp_t_Rotation':
-            bRotacao=True;
-
-        if context.scene.imp_sound_to_anim.import_type=='imp_t_Location':
-            bEixo=True;
-
-        # atencao, nao eh boolean
-        iEixoXneg= iEixoYneg= iEixoZneg=1
-        # atencao, nao eh boolean
-        iRotationNeg=1
-        # atencao, nao eh boolean
-        iEscalaYneg= iEscalaZneg= iEscalaXneg=1
-        bEixoX=bEixoY=bEixoZ=bEscalaX=bEscalaY=bEscalaZ=bRotationX=bRotationY=bRotationZ=False
-
-        # LOCAL 1
-        if context.scene.imp_sound_to_anim.import_where1== 'imp_w_x':
-            bEixoX=True
-            bEscalaX=True
-            bRotationX=True
-
-        if context.scene.imp_sound_to_anim.import_where1== 'imp_w_y':
-            bEixoY=True
-            bEscalaY=True
-            bRotationY=True
-
-        if context.scene.imp_sound_to_anim.import_where1== 'imp_w_z':
-            bEixoZ=True
-            bEscalaZ=True
-            bRotationZ=True
-
-        if context.scene.imp_sound_to_anim.import_where1== 'imp_w_-x':
-            bEixoX=True
-            bEscalaX=True
-            bRotationX=True
-            iEixoXneg=-1
-            iEscalaXneg=-1
-            iRotationNeg=-1
-
-        if context.scene.imp_sound_to_anim.import_where1== 'imp_w_-y':
-            bEixoY=True
-            bEscalaY=True
-            bRotationY=True
-            iEixoYneg=-1
-            iRotationNeg=-1
-            iEscalaYneg=-1
-
-        if context.scene.imp_sound_to_anim.import_where1== 'imp_w_-z':
-            bEixoZ=True
-            bEscalaZ=True
-            bRotationZ=True
-            iEixoZneg=-1
-            iRotationNeg=-1
-            iEscalaZneg=-1
-
-
-        # LOCAL 2
-        if context.scene.imp_sound_to_anim.import_where2== 'imp_w_x':
-            bEixoX=True
-            bEscalaX=True
-            bRotationX=True
-
-        if context.scene.imp_sound_to_anim.import_where2== 'imp_w_y':
-            bEixoY=True
-            bEscalaY=True
-            bRotationY=True
-
-        if context.scene.imp_sound_to_anim.import_where2== 'imp_w_z':
-            bEixoZ=True
-            bEscalaZ=True
-            bRotationZ=True
-
-        if context.scene.imp_sound_to_anim.import_where2== 'imp_w_-x':
-            bEixoX=True
-            bEscalaX=True
-            bRotationX=True
-            iEixoXneg=-1
-            iEscalaXneg=-1
-            iRotationNeg=-1
-
-        if context.scene.imp_sound_to_anim.import_where2== 'imp_w_-y':
-            bEixoY=True
-            bEscalaY=True
-            bRotationY=True
-            iEixoYneg=-1
-            iRotationNeg=-1
-            iEscalaYneg=-1
-
-        if context.scene.imp_sound_to_anim.import_where2== 'imp_w_-z':
-            bEixoZ=True
-            bEscalaZ=True
-            bRotationZ=True
-            iEixoZneg=-1
-            iRotationNeg=-1
-            iEscalaZneg=-1
-
-
-        # LOCAL 3
-        if context.scene.imp_sound_to_anim.import_where3== 'imp_w_x':
-            bEixoX=True
-            bEscalaX=True
-            bRotationX=True
-
-        if context.scene.imp_sound_to_anim.import_where3== 'imp_w_y':
-            bEixoY=True
-            bEscalaY=True
-            bRotationY=True
-
-        if context.scene.imp_sound_to_anim.import_where3== 'imp_w_z':
-            bEixoZ=True
-            bEscalaZ=True
-            bRotationZ=True
-
-        if context.scene.imp_sound_to_anim.import_where3== 'imp_w_-x':
-            bEixoX=True
-            bEscalaX=True
-            bRotationX=True
-            iEixoXneg=-1
-            iEscalaXneg=-1
-            iRotationNeg=-1
-
-        if context.scene.imp_sound_to_anim.import_where3== 'imp_w_-y':
-            bEixoY=True
-            bEscalaY=True
-            bRotationY=True
-            iEixoYneg=-1
-            iRotationNeg=-1
-            iEscalaYneg=-1
-
-        if context.scene.imp_sound_to_anim.import_where3== 'imp_w_-z':
-            bEixoZ=True
-            bEscalaZ=True
-            bRotationZ=True
-            iEixoZneg=-1
-            iRotationNeg=-1
-            iEscalaZneg=-1
-
-        iMinBaseX=iMinScaleBaseX=context.scene.imp_sound_to_anim.action_offset_x
-        iMinBaseY=iMinScaleBaseY=context.scene.imp_sound_to_anim.action_offset_y
-        iMinBaseZ=iMinScaleBaseZ=context.scene.imp_sound_to_anim.action_offset_z
-
-        #escala inicia com 1 e nao com zero
-        iRotationAxisBaseX=context.scene.imp_sound_to_anim.action_offset_x  +1
-        iRotationAxisBaseY=context.scene.imp_sound_to_anim.action_offset_y  +1
-        iRotationAxisBaseZ=context.scene.imp_sound_to_anim.action_offset_z  +1
-
-        #Added destructive optimizer option - LostLestSignificativeDigit lost/total
-        iDestructiveOptimizer=context.scene.imp_sound_to_anim.optimization_destructive
-
-        #limita ou nao o valor - velocidade
-        bLimitValue=False
-
-        if iMinValue<0: iMinValue=0
-        if iMaxValue>255: iMaxValue=255
-        if iMinValue>255: iMinValue=255
-        if iMaxValue<0: iMaxValue=0
-        if iMinValue!= 0: bLimitValue= True
-        if iMaxValue!= 255: bLimitValue= True
-
-        if obi.RunFrom==0:
-            print('')
-            print("================================================================")
-            from time import strftime
-            print(strftime("Start Import:  %H:%M:%S"))
-            print("================================================================")
-            print('')
-
-        ilocationXAnt=0
-        ilocationYAnt=0
-        ilocationZAnt=0
-        iscaleXAnt=0
-        iscaleYAnt=0
-        iscaleZAnt=0
-        iRotateValAnt=0
-
-        # variavel global _Interna_Globals
-        if context.scene.imp_sound_to_anim.bArrayCriado:
-            for i in range(loop):
-                ival=array[i+obi.RunFrom]/iDivScala
-                #valor pequeno demais, vai dar zero na hora de aplicar
-                if ival < 0.001:
-                     array[i+obi.RunFrom]=0
-                     ival=0
-
-                # to increase performance and legibility
-                arrayI= array[i+obi.RunFrom]
-                arrayIP1= array[i+1+obi.RunFrom]
-                arrayIL1= array[i-1+obi.RunFrom]
-
-                # opcao de NAO colocar valores iguais sequenciais
-                if i>0 and bNaoValorIgual and arrayIL1== arrayI:
-                    print("Importing Blender Frame: "+str(i+obi.RunFrom+1)+"\tof "+str(len(array)-1) + \
-                                                                            "\t(skipped by optimizer)")
-                    obi.iSumOptimizerP3+=1
-                else:
-                    # otimizacao - nao preciso mais que 2 valores iguais.
-                    # pular key frame intermediario - Ex b, a, -, -, -, a
-                    # tambem otimiza pelo otimizador com perda
-                    # valor atual == anterior e posterior -> pula
-                    if i>0 and i< len(array)-1 and abs(arrayI - arrayIL1)<=iDestructiveOptimizer and \
-                                                        abs(arrayI - arrayIP1)<=iDestructiveOptimizer:
-                            print("Importing Blender Frame: "+str(i+obi.RunFrom+1)+"\tof "+str(len(array)-1) + \
-                                                                                    "\t(skipped by optimizer)")
-                            if iDestructiveOptimizer>0 and arrayI != arrayIL1 or arrayI != arrayIP1:
-                                obi.iSumOptimizerP1+=1
-                            else: obi.iSumOptimizerP2+=1
-                    else:
-                            if bLimitValue:
-                                if arrayI > iMaxValue: array[i+obi.RunFrom]=iMaxValue
-                                if arrayI < iMinValue: array[i+obi.RunFrom]=iMinValue
-
-                            ival=array[i+obi.RunFrom]/iDivScala
-                            #passa para float com somente 3 digitos caso seja float
-                            m_ival=ival*1000
-                            if int(m_ival) != m_ival:
-                                ival= int(m_ival)
-                                ival = ival /1000
-
-                            bpy.context.scene.frame_current = i+iStartFrame
-
-                            #precisa fazer objeto ativo
-                            if bpy.context.active_object.type=='MESH' or bpy.context.active_object.type=='CAMERA' or \
-                                                                            bpy.context.active_object.type=='EMPTY':
-                                if bEixo:
-                                    if bEixoX: bpy.context.active_object.location.x = ival*iEixoXneg+iMinBaseX
-                                    if bEixoY: bpy.context.active_object.location.y = ival*iEixoYneg+iMinBaseY
-                                    if bEixoZ: bpy.context.active_object.location.z = ival*iEixoZneg+iMinBaseZ
-
-                                if bEscala:
-                                    if bEscalaX: bpy.context.active_object.scale.x = ival*iEscalaXneg+iMinScaleBaseX
-                                    if bEscalaY: bpy.context.active_object.scale.y = ival*iEscalaYneg+iMinScaleBaseY
-                                    if bEscalaZ: bpy.context.active_object.scale.z = ival*iEscalaZneg+iMinScaleBaseZ
-
-                            # 'ARMATURE' or ('MESH' and bRotacao) or ('CAMERA' and bRotacao) or 'LAMP' or 'EMPTY' and bRotacao)
-                            if bpy.context.active_object.type=='ARMATURE' or (bpy.context.active_object.type=='MESH' and bRotacao) or \
-                                                                            (bpy.context.active_object.type=='CAMERA' and bRotacao) or \
-                                                                            bpy.context.active_object.type=='LAMP' or \
-                                                                            (bpy.context.active_object.type=='EMPTY' and bRotacao):
-
-                                    #===========  BONE ===========#
-                                    if bpy.context.active_object.type=='ARMATURE':   #precisa ser objeto ativo. Nao achei como passar para editmode
-                                        if bpy.context.mode!= 'POSE':    #posemode
-                                            bpy.ops.object.posemode_toggle()
-
-                                    #============= ALL ===========#
-                                    if bEixo:
-                                        if ilocationXAnt!=0 or ilocationYAnt!=0 or ilocationZAnt!=0:
-
-                                            bpy.ops.transform.translate(value=(ilocationXAnt*-1,                ilocationYAnt*-1, \
-                                                                                ilocationZAnt*-1),               constraint_axis=(bEixoX, bEixoY,bEixoZ), \
-                                                                                constraint_orientation='GLOBAL', mirror=False, \
-                                                                                proportional='DISABLED',         proportional_edit_falloff='SMOOTH', \
-                                                                                proportional_size=1,             snap=False, \
-                                                                                snap_target='CLOSEST',           snap_point=(0, 0, 0), \
-                                                                                snap_align=False,               snap_normal=(0, 0, 0), \
-                                                                                release_confirm=False)
-
-                                        ilocationX=ilocationY=ilocationZ=0
-                                        if bEixoX: ilocationX = ival*iEixoXneg+iMinBaseX
-                                        if bEixoY: ilocationY = ival*iEixoYneg+iMinBaseY
-                                        if bEixoZ: ilocationZ = ival*iEixoZneg+iMinBaseZ
-
-                                        bpy.ops.transform.translate(value=(ilocationX,                       ilocationY, \
-                                                                            ilocationZ),                      constraint_axis=(bEixoX, bEixoY,bEixoZ), \
-                                                                            constraint_orientation='GLOBAL',  mirror=False, \
-                                                                            proportional='DISABLED',          proportional_edit_falloff='SMOOTH', \
-                                                                            proportional_size=1,              snap=False, \
-                                                                            snap_target='CLOSEST',            snap_point=(0, 0, 0), snap_align=False, \
-                                                                            snap_normal=(0, 0, 0),           release_confirm=False)
-                                        ilocationXAnt= ilocationX
-                                        ilocationYAnt= ilocationY
-                                        ilocationZAnt= ilocationZ
-
-                                    if bEscala:
-                                        if iscaleXAnt!=0 or iscaleYAnt!=0 or iscaleZAnt!=0:
-                                            tmpscaleXAnt=0
-                                            tmpscaleYAnt=0
-                                            tmpscaleZAnt=0
-                                            if iscaleXAnt: tmpscaleXAnt=1/iscaleXAnt
-                                            if iscaleYAnt: tmpscaleYAnt=1/iscaleYAnt
-                                            if iscaleZAnt: tmpscaleZAnt=1/iscaleZAnt
-
-                                            bpy.ops.transform.resize(value=(tmpscaleXAnt,                    tmpscaleYAnt, \
-                                                                            tmpscaleZAnt ),                   constraint_axis=(False, False, False), \
-                                                                            constraint_orientation='GLOBAL',  mirror=False, \
-                                                                            proportional='DISABLED',          proportional_edit_falloff='SMOOTH', \
-                                                                            proportional_size=1, snap=False, snap_target='CLOSEST', \
-                                                                            snap_point=(0, 0, 0),             snap_align=False, \
-                                                                            snap_normal=(0, 0, 0),            release_confirm=False)
-
-                                        iscaleX=iscaleY=iscaleZ=0
-                                        if bEscalaX: iscaleX = ival*iEscalaXneg+iMinScaleBaseX
-                                        if bEscalaY: iscaleY = ival*iEscalaYneg+iMinScaleBaseY
-                                        if bEscalaZ: iscaleZ = ival*iEscalaZneg+iMinScaleBaseZ
-
-                                        bpy.ops.transform.resize(value=(iscaleX,                        iscaleY, \
-                                                                        iscaleZ),                        constraint_axis=(False, False, False), \
-                                                                        constraint_orientation='GLOBAL', mirror=False, \
-                                                                        proportional='DISABLED',         proportional_edit_falloff='SMOOTH', \
-                                                                        proportional_size=1,             snap=False, \
-                                                                        snap_target='CLOSEST',           snap_point=(0, 0, 0), \
-                                                                        snap_align=False,               snap_normal=(0, 0, 0), \
-                                                                        release_confirm=False)
-                                        iscaleXAnt= iscaleX
-                                        iscaleYAnt= iscaleY
-                                        iscaleZAnt= iscaleZ
-
-                                    if bRotacao:
-                                        if iRotateValAnt!=0:
-                                            bpy.context.active_object.rotation_euler= ((iRotateValAnt*-1)+    iRotationAxisBaseX) *bRotationX , \
-                                                                                        ((iRotateValAnt*-1)+  iRotationAxisBaseY) *bRotationY , \
-                                                                                        ((iRotateValAnt*-1)+  iRotationAxisBaseZ) *bRotationZ
-
-                                        bpy.context.active_object.rotation_euler= ((ival*iRotationNeg)+   iRotationAxisBaseX) * bRotationX, \
-                                                                                    ((ival*iRotationNeg)+ iRotationAxisBaseY)  * bRotationY, \
-                                                                                    ((ival*iRotationNeg)+ iRotationAxisBaseZ)  * bRotationZ
-                                        iRotateValAnt= ival*iRotationNeg
-
-                            ob = bpy.context.active_object
-
-                            if bEixo:
-                                ob.keyframe_insert(data_path="location")
-
-                            if bRotacao:
-                                ob.keyframe_insert(data_path="rotation_euler")
-
-                            if bEscala:
-                                ob.keyframe_insert(data_path="scale")
-
-                            print("Importing Blender Frame: "+str(i+obi.RunFrom+1)+"\tof "+str(len(array)-1) + "\tValue: "+ str(ival))
-
-                            obi.iSumImportFrames+=1
-                    # Fim do ELSE otimizador
-                # Fim bNaoValorIgual
-
-            if obi.RunFrom>= tot:
-                bpy.context.scene.frame_current = 1
-                context.scene.imp_sound_to_anim.Info_Import="Done. Imported " + str(obi.iSumImportFrames) + " Frames"
-                from time import strftime
-                print('')
-                print("================================================================")
-                print("Imported: " +str(obi.iSumImportFrames) + " Key Frames")
-                print("Optimizer Pass 1 prepared to optimize: " +str(obi.iSumOptimizerP1) + " blocks of Frames")
-                print("Optimizer Pass 2 has optimized: " +str(obi.iSumOptimizerP2) + " Frames")
-                print("Optimizer Pass 3 has optimized: " +str(obi.iSumOptimizerP3) + " Frames")
-                print("Optimizer has optimized: " +str(obi.iSumOptimizerP1 + obi.iSumOptimizerP2 + obi.iSumOptimizerP3) + " Frames")
-                print(strftime("End Import:  %H:%M:%S - by Vlassius"))
-                print("================================================================")
-                print('')
-                obi.RunFrom=0
-                obi.iSumImportFrames=0
-                obi.iSumOptimizerP1=0
-                obi.iSumOptimizerP2=0
-                obi.iSumOptimizerP3=0
-                return obi.RunFrom
-            else:
-                obi.RunFrom+= loop
-                context.scene.imp_sound_to_anim.Info_Import="Processing Frame " + str(obi.RunFrom+loop) + \
-                                                                            " of " + str(tot-1) + " Frames"
-                return obi.RunFrom
-
-
-    def execute(self, context):
-        #wavimport(context)
-        #return{'FINISHED'}
-        context.scene.imp_sound_to_anim.Working= "wavimport"
-        bpy.ops.wm.modal_timer_operator()
-
-    def invoke(self, context, event):
-        self.execute(context)
-        return {'FINISHED'}
-
-
-
-#
-#==================================================================================================
-# Button - Sound Process
-#==================================================================================================
-#
-class OBJECT_OT_Botao_Go(bpy.types.Operator):
-    ''''''
-    bl_idname = "import.sound_animation_botao_go"
-    # change in API
-    bl_description = "Process a .wav file, take movement from the sound and import to the scene as Key"
-    bl_label = "Process Wav"
-
-    filter_glob = StringProperty(default="*.wav", options={'HIDDEN'})
-    path = StringProperty(name="File Path", description="Filepath used for importing the WAV file", \
-                                                                            maxlen= 1024, default= "")
-    filename = StringProperty(name="File Name", description="Name of the file")
-    directory = StringProperty(name="Directory", description="Directory of the file")
-
-    RunFrom=0
-    Wave_read=0
-    MaxAudio=0
-
-
-    def SoundConv(File, DivSens, Sensibil, Resol, context, bAutoSense, bRemoveBeat, bUseBeat, bMoreSensible, \
-                                                                            bLessSensible, AudioChannel, loop):
-        obg= OBJECT_OT_Botao_Go
-        #reseta contadores caso seja pedido
-        if context.scene.imp_sound_to_anim.timer_reset_func:
-            obc.RunFrom=0
-            Wave_read=0
-            MaxAudio=0
-            context.scene.imp_sound_to_anim.timer_reset_func=False
-
-        #abre arquivo se primeira rodada
-        if obg.RunFrom==0:
-            try:
-                obg.Wave_read= wave.open(File, 'rb')
-            except IOError as e:
-                print("File Open Error: ", e)
-                return False
-
-        NumCh=      obg.Wave_read.getnchannels()
-        SampW=      obg.Wave_read.getsampwidth() # 8, 16, 24 32 bits
-        FrameR=     obg.Wave_read.getframerate()
-        NumFr=      obg.Wave_read.getnframes()
-        ChkCompr=   obg.Wave_read.getcomptype()
-
-        if ChkCompr != "NONE":
-            print('Sorry, this compressed Format is NOT Supported ', ChkCompr)
-            context.scene.imp_sound_to_anim.Info_Import= "Sorry, this compressed Format is NOT Supported "
-            return False
-
-        if SampW > 2:
-            context.scene.imp_sound_to_anim.Info_Import= "Sorry, supported .wav files 8 and 16 bits only"
-            print('Sorry, supported .wav files 8 and 16 bits only')
-            return False
-
-        context.scene.imp_sound_to_anim.Info_Import=""
-
-        # controla numero do canal
-        if AudioChannel > NumCh:
-            if obg.RunFrom==0:
-                print("Channel number " + str(AudioChannel) + " is selected but this audio file has just " + \
-                                                            str(NumCh) + " channels, so selecting channel " \
-                                                                                            + str(NumCh) + "!")
-            AudioChannel = NumCh
-
-        # apenas para por na tela
-        tmpAudioChannel= AudioChannel
-
-        #used in index sum to find the channe, adjust to first byte sample index
-        AudioChannel -= 1
-
-        # se dois canais, AudioChannel=4 porque sao 4 bytes
-        if SampW ==2:  AudioChannel*=2
-
-        # usado para achar contorno da onda - achando picos
-        # numero de audio frames para cada video frame
-        BytesResol= int(FrameR/Resol)
-
-        # com 8 bits/S - razao Sample/s por resolucao
-        # tamanho do array
-        BytesDadosTotProcess= NumFr // BytesResol
-
-        if obg.RunFrom==0:   # primeira rodada
-            # inicia array
-            _Interna_Globals(BytesDadosTotProcess, context)
-            print('')
-            print("================================================================")
-            from time import strftime
-            print(strftime("Go!  %H:%M:%S"))
-            print("================================================================")
-            print('')
-            print('Total Audio Time: \t ' + str(NumFr//FrameR) + 's (' + str(NumFr//FrameR//60) + 'min)')
-            print('Total # Interactions: \t', BytesDadosTotProcess)
-            print('Total Audio Frames: \t', NumFr)
-            print('Frames/s: \t\t ' + str(FrameR))
-            print('# Chanels in File: \t', NumCh)
-            print('Channel to use:\t\t', tmpAudioChannel)
-            print('Bit/Sample/Chanel: \t ' + str(SampW*8))
-            print('# Frames/Act: \t\t', DivSens)
-
-            if bAutoSense==0:
-                print('Audio Sensitivity: \t', Sensibil+1)
-            else:
-                print('Using Auto Audio Sentivity. This is pass 1 of 2.')
-
-            print('')
-            print ("Sample->[value]\tAudio Frame #   \t\t[Graph Value]")
-
-        if obg.RunFrom==0 and bAutoSense!=0:
-            Sensibil=0  # if auto sense, Sensibil must be zero here
-            obg.MaxAudio=0  # valor maximo de audio encontrado
-
-        # verifica limite total do audio
-        looptot= int(BytesDadosTotProcess // DivSens)
-        if obg.RunFrom+loop > looptot:
-            loop= looptot-obg.RunFrom
-
-        j=0  # usado de indice
-        # laco total leitura bytes
-        # armazena dado de pico
-        for jj in range(loop):
-            # caso de 2 canais (esterio)
-            # uso apenas 2 bytes em 16 bits, ie, apenas canal esquerdo
-            # [0] e [1] para CH L
-            # [2] e [3] para CH R   and so on
-            # mono:1 byte to 8 bits, 2 bytes to 16 bits
-            # sterio: 2 byte to 8 bits, 4 bytes to 16 bits
-            ValorPico=0
-            # leio o numero de frames de audio para cada frame de video, valor em torno de 1000
-            for i in range(BytesResol):
-                #loop exterior copia DivSens frames a cada frame calculado
-                frame = obg.Wave_read.readframes(DivSens)
-
-                if len(frame)==0: break
-
-                if bAutoSense==0:    # AutoAudioSense Desligado
-                    if SampW ==1:
-                        if Sensibil ==5:
-                            frame0= frame[AudioChannel] << 6 & 255
-
-                        elif Sensibil ==4:
-                            frame0= frame[AudioChannel] << 5 & 255
-
-                        elif Sensibil ==3:
-                            frame0= frame[AudioChannel] << 4 & 255
-
-                        elif Sensibil ==2:
-                            frame0= frame[AudioChannel] << 3 & 255
-
-                        elif Sensibil ==1:
-                            frame0= frame[AudioChannel] << 2 & 255
-
-                        elif Sensibil ==0:
-                            frame0= frame[AudioChannel]
-
-                        if frame0> ValorPico:
-                            ValorPico= frame0
-
-                    if SampW ==2:   # frame[0] baixa       frame[1] ALTA BIT 1 TEM SINAL!
-                        if frame[1+AudioChannel] <127:    # se bit1 =0, usa o valor - se bit1=1 quer dizer numero negativo
-                            if Sensibil ==0:
-                                frame0= frame[1+AudioChannel]
-
-                            elif Sensibil ==4:
-                                frame0= ((frame[AudioChannel] & 0b11111100) >> 2) | ((frame[1+AudioChannel] & 0b00000011) << 6)
-
-                            elif Sensibil ==3:
-                                frame0= ((frame[AudioChannel] & 0b11110000) >> 4) | ((frame[1+AudioChannel] & 0b00001111) << 4)
-
-                            elif Sensibil ==2:
-                                frame0= ((frame[AudioChannel] & 0b11100000) >> 5) | ((frame[1+AudioChannel] & 0b00011111) << 3)
-
-                            elif Sensibil ==1:
-                                frame0= ((frame[AudioChannel] & 0b11000000) >> 6) | ((frame[1+AudioChannel] & 0b00111111) << 2)
-
-                            elif Sensibil ==5:
-                                frame0=frame[AudioChannel]
-
-                            if frame0 > ValorPico:
-                                ValorPico= frame0
-
-                else:   # AutoAudioSense Ligado
-                    if SampW ==1:
-                        if frame[AudioChannel]> obg.MaxAudio:
-                            obg.MaxAudio = frame[AudioChannel]
-
-                        if frame[AudioChannel]> ValorPico:
-                            ValorPico=frame[AudioChannel]
-
-                    if SampW ==2:
-                        if frame[1+AudioChannel] < 127:
-                            tmpValorPico= frame[1+AudioChannel] << 8
-                            tmpValorPico+=  frame[AudioChannel]
-
-                            if tmpValorPico > obg.MaxAudio:
-                                obg.MaxAudio = tmpValorPico
-
-                            if tmpValorPico > ValorPico:
-                                ValorPico= tmpValorPico
-
-            if bAutoSense==0:    #autoaudiosense desligado
-                # repito o valor de frames por actions (OTIMIZAR)
-                for ii in range(DivSens):
-                    array[j+obg.RunFrom]=ValorPico  # valor de pico encontrado
-                    j +=1           # incrementa indice prox local
-            else:
-                idx=obg.RunFrom*2 # porque sao dois bytes
-                arrayAutoSense[j+idx]= (ValorPico & 0b0000000011111111) #copia valores baixos
-                arrayAutoSense[j+1+idx]= (ValorPico & 0b1111111100000000) >> 8   #copia valores altos
-                j+=2
-
-            if bAutoSense==0:    #autoaudiosense desligado
-                igraph= ValorPico//10
-            else:
-                if SampW ==2:
-                    igraph= ValorPico//1261
-
-                else:
-                    igraph= ValorPico//10
-
-            stgraph="["
-            for iii in range(igraph):
-                stgraph+="+"
-
-            for iiii in range(26-igraph):
-                stgraph+=" "
-            stgraph+="]"
-
-            print ("Sample-> " + str(ValorPico) + "\tAudio Frame #  " + str(jj+obg.RunFrom) + " of " + str(looptot-1) + "\t"+ stgraph)
-
-        # acabou primeira fase roda toda de uma vez
-        if obg.RunFrom+loop == looptot:
-            if bAutoSense==1:
-                print("")
-                print("================================================================")
-                print('Calculating Auto Audio Sentivity, pass 2 of 2.')
-                print("================================================================")
-
-                # caso usar batida, procurar por valores proximos do maximo e zerar restante.
-                # caso retirar batida, zerar valores proximos do maximo
-                UseMinim=0
-                UseMax=0
-
-                if bUseBeat==1:
-                    print("Trying to use just the beat.")
-                    UseMinim= obg.MaxAudio*0.8
-                    if bMoreSensible:
-                        UseMinim= obg.MaxAudio*0.7
-                    elif bLessSensible:
-                        UseMinim= obg.MaxAudio*0.9
-
-                if bRemoveBeat==1:
-                    print("Trying to exclude the beat.")
-                    UseMax= obg.MaxAudio*0.7
-                    if bMoreSensible:
-                        UseMax= obg.MaxAudio*0.8
-                    elif bLessSensible:
-                        UseMax= obg.MaxAudio*0.7
-
-                print("")
-                # para transformar 15 bits em 8 calibrando valor maximo -> fazer regra de 3
-                # obg.MaxAudio -> 255
-                # outros valores => valor calibrado= (255 * Valor) / obg.MaxAudio
-                scale= 255/obg.MaxAudio
-
-                j=0
-                jj=0
-                print ("Sample->[value]\tAudio Frame #    \t\t[Graph Value]")
-
-                for i in range(BytesDadosTotProcess // DivSens):
-
-                    ValorOriginal= arrayAutoSense[j+1] << 8
-                    ValorOriginal+= arrayAutoSense[j]
-
-                    if bUseBeat==1:
-                        if ValorOriginal < UseMinim:
-                            ValorOriginal = 0
-
-                    elif bRemoveBeat==1:
-                        if ValorOriginal > UseMax:
-                            ValorOriginal = 0
-
-                    ValorOriginal= ((round(ValorOriginal * scale)) & 0b11111111)    #aplica a escala
-
-                    for ii in range(DivSens):
-                        array[jj] = ValorOriginal
-                        jj += 1   # se autoaudiosense, o array tem dois bytes para cada valor
-
-                    j+=2
-                    igraph= round(array[jj-1]/10)
-                    stgraph="["
-                    for iii in range(igraph):
-                        stgraph+="+"
-
-                    for iiii in range(26-igraph):
-                        stgraph+=" "
-                    stgraph+="]"
-                    print ("Sample-> " + str(array[jj-1]) + "\tAudio Frame #  " + str(i) + " of " + str(looptot-1) + "\t"+ stgraph)
-
-                #limpa array tmp
-                del arrayAutoSense[:]
-
-            # mensagens finais
-            context.scene.imp_sound_to_anim.Info_Import= "Click \"Import Key frames\" to begin import" #this set the initial text
-
-            print("================================================================")
-            from time import strftime
-            print(strftime("End Process:  %H:%M:%S"))
-            print("================================================================")
-
-            try:
-                obg.Wave_read.close()
-            except:
-                print('File Close Error')
-
-            obg.RunFrom=0
-            return obg.RunFrom   # acabou tudo
-
-        else:#ainda nao acabou o arquivo todo if RunFrom+loop = looptot:
-            context.scene.imp_sound_to_anim.Info_Import="Processing " + str(obg.RunFrom) + " of " + str(looptot) +" Audio Frames"
-            # force update info text in UI
-            bpy.context.scene.frame_current= bpy.context.scene.frame_current
-            obg.RunFrom+=loop
-            return obg.RunFrom
-
-
-
-
-    def ProcessaSom(context, loop):
-        obg= OBJECT_OT_Botao_Go
-        # para de entrar o timer
-        context.scene.imp_sound_to_anim.Working=""
-        #reseta contadores caso seja pedido
-        if context.scene.imp_sound_to_anim.timer_reset_func:
-            obg.RunFrom=0
-            context.scene.imp_sound_to_anim.timer_reset_func=False
-
-        import os
-        f= os.path.join(context.scene.imp_sound_to_anim.directory, context.scene.imp_sound_to_anim.filename)
-        f= os.path.normpath(f)
-
-        if obg.RunFrom==0:
-            print ("")
-            print ("")
-            print ("Selected file = ",f)
-        checktype = f.split('\\')[-1].split('.')[1]
-        if checktype.upper() != 'WAV':
-            print ("ERROR!! Selected file = ", f)
-            print ("ERROR!! Its not a .wav file")
-            return
-
-        #sensibilidade volume do audio 0 a 5. Quanto maior, mais sensibilidade
-        iAudioSensib= int(context.scene.imp_sound_to_anim.audio_sense)-1
-        if iAudioSensib <0: iAudioSensib=0
-        elif iAudioSensib>5: iAudioSensib=5
-
-        #act/s nao pode se maior que frames/s
-        if context.scene.imp_sound_to_anim.action_per_second > context.scene.imp_sound_to_anim.frames_per_second:
-            context.scene.imp_sound_to_anim.action_per_second = context.scene.imp_sound_to_anim.frames_per_second
-
-        #Frames por segundo para key frame
-        iFramesPorSeg= int(context.scene.imp_sound_to_anim.frames_per_second)
-
-        #Sensibilidade de movimento. 3= 3 movimentos por segundo
-        iMovPorSeg= int(context.scene.imp_sound_to_anim.action_per_second)
-
-        #iDivMovPorSeg Padrao - taxa 4/s ou a cada 0,25s  => iFramesPorSeg/iDivMovPorSeg= ~0.25
-        for i in range(iFramesPorSeg):
-            iDivMovPorSeg=iFramesPorSeg/(i+1)
-            if iFramesPorSeg/iDivMovPorSeg >=iMovPorSeg:
-                break
-
-        bRemoveBeat=    context.scene.imp_sound_to_anim.remove_beat
-        bUseBeat=       context.scene.imp_sound_to_anim.use_just_beat
-        bLessSensible=  context.scene.imp_sound_to_anim.beat_less_sensible
-        bMoreSensible=  context.scene.imp_sound_to_anim.beat_more_sensible
-        AudioChannel=   context.scene.imp_sound_to_anim.audio_channel_select
-
-        # chama funcao de converter som, retorna preenchendo _Interna_Globals.array
-        index= OBJECT_OT_Botao_Go.SoundConv(f, int(iDivMovPorSeg), iAudioSensib, iFramesPorSeg, context, \
-                                    context.scene.imp_sound_to_anim.action_auto_audio_sense, bRemoveBeat, \
-                                    bUseBeat, bMoreSensible, bLessSensible, AudioChannel, loop)
-        return index
-
-
-    def execute(self, context):
-
-        # copia dados dialof open wave
-        context.scene.imp_sound_to_anim.filter_glob= self.filter_glob
-        context.scene.imp_sound_to_anim.path = self.path
-        context.scene.imp_sound_to_anim.filename = self.filename
-        context.scene.imp_sound_to_anim.directory = self.directory
-
-        context.scene.imp_sound_to_anim.Working= "ProcessaSom"
-        bpy.ops.wm.modal_timer_operator()
-        #ProcessaSom(context)
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        #need to set a path so so we can get the file name and path
-        wm = context.window_manager
-        wm.fileselect_add(self)
-
-        return {'RUNNING_MODAL'}
-
-
-#
-#==================================================================================================
-# Button - Check Smart Render
-#==================================================================================================
-#
-class OBJECT_OT_Botao_Check_SmartRender(bpy.types.Operator):
-    '''Check for Reduction'''
-    bl_idname = "import.sound_animation_botao_check_smartrender"
-    bl_label = "Check Smart Render"
-
-    RunFrom=0
-    Frames_Renderizar=0
-    Frames_Pular=0
-
-    def CheckSmartRender(context, loop):
-        obc= OBJECT_OT_Botao_Check_SmartRender
-
-        #reseta contadores caso seja pedido
-        if context.scene.imp_sound_to_anim.timer_reset_func:
-            obc.RunFrom=0
-            obc.Frames_Pular=0
-            obc.Frames_Renderizar=0
-            context.scene.imp_sound_to_anim.timer_reset_func=False
-
-        if obc.RunFrom==0:
-            if loop !=1: # loop==1 quando estou chamando de dentro da funcao render
-                print("")
-                print("================================================================")
-                print('Running Check Smart Render...')
-
-        #garante ao menos locrotscale ligado
-        if context.scene.imp_sound_to_anim.check_smartrender_loc_rot_sc==False and \
-                        context.scene.imp_sound_to_anim.check_smartrender_material_basic==False and \
-                        context.scene.imp_sound_to_anim.check_smartrender_material_transparence==False and \
-                        context.scene.imp_sound_to_anim.check_smartrender_material_mirror==False:
-            context.scene.imp_sound_to_anim.check_smartrender_loc_rot_sc=True
-
-        chkLocRotSc=  context.scene.imp_sound_to_anim.check_smartrender_loc_rot_sc
-        chkMatBas=    context.scene.imp_sound_to_anim.check_smartrender_material_basic
-        chkMatTransp= context.scene.imp_sound_to_anim.check_smartrender_material_transparence
-        chkMatMirror= context.scene.imp_sound_to_anim.check_smartrender_material_mirror
-
-        ToRender=[]
-        origloop=loop
-        from copy import copy
-        RunMax= bpy.context.scene.frame_end - bpy.context.scene.frame_start+1
-        if obc.RunFrom+loop > RunMax:
-            loop= RunMax-obc.RunFrom
-            if loop<=0:   #acabou
-                if origloop !=1: # loop==1 quando estou chamando de dentro da funcao render
-                    print("")
-                    print("Frames to copy: " + str(obc.Frames_Pular) + " Frames to really render= " + str(obc.Frames_Renderizar))
-                    print("================================================================")
-                    print("")
-                obc.RunFrom=0
-                obc.Frames_Pular=0
-                obc.Frames_Renderizar=0
-                return (ToRender, obc.RunFrom)
-
-        #move para o primeiro frame a renderizar
-        #RunFrom inicia em zero - frames inicia em 1
-        bpy.context.scene.frame_current = obc.RunFrom+bpy.context.scene.frame_start
-
-        for k in range(loop):
-            if obc.RunFrom==0 and k==0: #primeiro sempre renderiza
-                ToRender.append(bpy.context.scene.frame_current)
-                obc.Frames_Renderizar+=1
-                bpy.context.scene.frame_set(bpy.context.scene.frame_current + 1)
-            else:
-                if origloop !=1: # loop==1 quando estou chamando de dentro da funcao render
-                    import sys
-                    sys.stdout.write("\rChecking Frame "+str(bpy.context.scene.frame_current) + "  ")
-                    sys.stdout.flush()
-                #buffer de todos os objetos
-                a=[]
-                for obj in bpy.data.objects:
-                    if chkLocRotSc:
-                        # loc rot scale
-                        a.append(copy(obj.location))
-                        a.append(copy(obj.rotation_euler))
-                        a.append(copy(obj.scale))
-                    if hasattr(obj.data, 'materials') and obj.data.materials.keys()!=[] :
-                        if bpy.context.scene.render.engine == "BLENDER_RENDER":
-                            #pega somente primeiro material sempre
-                            if chkMatBas:
-                                # cores
-                                a.append(copy(obj.data.materials[0].type))
-                                a.append(copy(obj.data.materials[0].emit))
-                                a.append(copy(obj.data.materials[0].diffuse_color))
-                                a.append(copy(obj.data.materials[0].diffuse_intensity))
-                                a.append(copy(obj.data.materials[0].specular_intensity))
-                                a.append(copy(obj.data.materials[0].specular_color))
-                                a.append(copy(obj.data.materials[0].alpha))
-                                a.append(copy(obj.data.materials[0].diffuse_shader))
-                                a.append(copy(obj.data.materials[0].specular_shader))
-                                a.append(copy(obj.data.materials[0].specular_hardness))
-
-                            if chkMatTransp:
-                                # transp
-                                a.append(copy(obj.data.materials[0].transparency_method))
-                                a.append(copy(obj.data.materials[0].specular_alpha))
-                                a.append(copy(obj.data.materials[0].raytrace_transparency.fresnel))
-                                a.append(copy(obj.data.materials[0].raytrace_transparency.ior))
-                                a.append(copy(obj.data.materials[0].raytrace_transparency.filter))
-                                a.append(copy(obj.data.materials[0].raytrace_transparency.depth))
-                                a.append(copy(obj.data.materials[0].translucency))
-                                a.append(copy(obj.data.materials[0].specular_alpha))
-
-                            if chkMatMirror:
-                                #mirror
-                                a.append(copy(obj.data.materials[0].raytrace_mirror.reflect_factor))
-                                a.append(copy(obj.data.materials[0].raytrace_mirror.fresnel))
-                                a.append(copy(obj.data.materials[0].raytrace_mirror.fresnel_factor))
-                                a.append(copy(obj.data.materials[0].mirror_color))
-                                a.append(copy(obj.data.materials[0].raytrace_mirror.depth))
-                                a.append(copy(obj.data.materials[0].raytrace_mirror.gloss_factor))
-
-                # tenho todos os objetos em a[]
-                # incrementar um frame e checar se eh igual
-                bpy.context.scene.frame_set(bpy.context.scene.frame_current + 1)
-
-                j=0
-                dif=0
-                for obj in bpy.data.objects:
-                    if chkLocRotSc:
-                        if a[j]!= obj.location or a[j+1]!= obj.rotation_euler or a[j+2]!= obj.scale:
-                            dif=1
-                            #break
-                        j+=3
-
-                    if hasattr(obj.data, 'materials') and obj.data.materials.keys()!=[] :
-                        if bpy.context.scene.render.engine == "BLENDER_RENDER":
-                            if chkMatBas:
-                                # cores
-                                if a[j]!= obj.data.materials[0].type or   a[j+1]!= obj.data.materials[0].emit or \
-                                                                            a[j+2]!= obj.data.materials[0].diffuse_color or \
-                                                                            a[j+3]!= obj.data.materials[0].diffuse_intensity or \
-                                                                            a[j+4]!= obj.data.materials[0].specular_intensity or \
-                                                                            a[j+5]!= obj.data.materials[0].specular_color or \
-                                                                            a[j+6]!= obj.data.materials[0].alpha or \
-                                                                            a[j+7]!= obj.data.materials[0].diffuse_shader or \
-                                                                            a[j+8]!= obj.data.materials[0].specular_shader or \
-                                                                            a[j+9]!= obj.data.materials[0].specular_hardness:
-                                    dif=1
-                                    print("mat")
-                                    j+= 10  # ajusta ponteiro j
-                                    if chkMatTransp: j+=8
-                                    if chkMatMirror: j+=6
-                                    break
-                                j+=10
-
-                            if chkMatTransp:
-                                #transp
-                                if a[j]!= obj.data.materials[0].transparency_method or    a[j+1]!= obj.data.materials[0].specular_alpha or \
-                                                                                            a[j+2]!= obj.data.materials[0].raytrace_transparency.fresnel or \
-                                                                                            a[j+3]!= obj.data.materials[0].raytrace_transparency.ior or \
-                                                                                            a[j+4]!= obj.data.materials[0].raytrace_transparency.filter or \
-                                                                                            a[j+5]!= obj.data.materials[0].raytrace_transparency.depth or \
-                                                                                            a[j+6]!= obj.data.materials[0].translucency or \
-                                                                                            a[j+7]!= obj.data.materials[0].specular_alpha:
-                                    dif=1
-                                    j+= 8     # ajusta ponteiro j
-                                    if chkMatMirror: j+=6
-
-                                    break
-                                j+=8
-
-                            if chkMatMirror:
-                                #mirror
-                                if a[j]!= obj.data.materials[0].raytrace_mirror.reflect_factor or a[j+1]!= obj.data.materials[0].raytrace_mirror.fresnel or \
-                                                                                                    a[j+2]!= obj.data.materials[0].raytrace_mirror.fresnel_factor or \
-                                                                                                    a[j+3]!= obj.data.materials[0].mirror_color or \
-                                                                                                    a[j+4]!= obj.data.materials[0].raytrace_mirror.depth or \
-                                                                                                    a[j+5]!= obj.data.materials[0].raytrace_mirror.gloss_factor:
-                                    dif=1
-                                    j+= 6     # ajusta ponteiro j
-                                    break
-                                j+=6
-                # finaliza
-                if dif==0:
-                    obc.Frames_Pular+=1
-                else:
-                    obc.Frames_Renderizar+=1
-                    ToRender.append(bpy.context.scene.frame_current)
-
-                del a
-        # para nao sair do index - nunca chega nesse frame
-        ToRender.append(bpy.context.scene.frame_end+1)
-
-        if obc.RunFrom+loop < RunMax:
-            context.scene.imp_sound_to_anim.Info_check_smartrender= "["+str(obc.RunFrom+loop) + "/" + \
-                                        str(RunMax) + "] Frames to Render= " + str(obc.Frames_Renderizar) + \
-                                        " -> Reduction " + str(round((obc.Frames_Pular/RunMax)*100,1)) + "%"
-        else:
-            context.scene.imp_sound_to_anim.Info_check_smartrender= "Frames to Render= " + str(obc.Frames_Renderizar) + \
-                                                    " -> Reduction " + str(round((obc.Frames_Pular/RunMax)*100,1)) + "%"
-
-        #incrementa indice
-        obc.RunFrom+= loop
-        return (ToRender, obc.RunFrom)
-
-    def execute(self, context):
-        context.scene.imp_sound_to_anim.Working= "CheckSmartRender"
-        #context.scene.imp_sound_to_anim.timer_reset_func=True
-        bpy.ops.wm.modal_timer_operator()
-        #CheckSmartRender(context)
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        self.execute(context)
-        return {'FINISHED'}
-
-
-#
-#==================================================================================================
-# Button - Smart Render
-#==================================================================================================
-#
-class OBJECT_OT_Botao_SmartRender(bpy.types.Operator):
-    '''Render Only Modified Frames and Copy the Others'''
-    bl_idname = "import.sound_animation_smart_render"
-    bl_label = "Smart Render"
-
-    BaseRenderToCopy=0
-
-    def SmartRender(context):
-        obs=OBJECT_OT_Botao_SmartRender
-
-        index=0
-        pad=4
-        #calcula zero pad
-        if bpy.context.scene.frame_end //1000000 > 0:  #default 999999 1000000//1000000=1
-            pad=7
-        elif bpy.context.scene.frame_end //100000 > 0:  #default 99999 100000//100000=1
-            pad=6
-        elif bpy.context.scene.frame_end //10000 > 0:  #default 9999 10000//10000=1
-            pad=5
-
-        #bpy.data.images['Render Result'].file_format ='PNG'
-        bpy.context.scene.render.image_settings.file_format = 'PNG'
-
-        #info dos arquivos
-        path= bpy.context.scene.render.filepath
-
-        import shutil
-
-        tot=bpy.context.scene.frame_end - bpy.context.scene.frame_start+1
-        i=0
-        # checa apenas 1 frame    o indice é interno em ChackSmartRender
-        r= OBJECT_OT_Botao_Check_SmartRender.CheckSmartRender(context, 1)
-        ToRender= r[0] # tem numero do frame se for para renderizar
-        index= r[1]
-
-        #copia frame atual  #se o frame ja não foi renderizado
-        if (obs.BaseRenderToCopy!=(index+bpy.context.scene.frame_start-1)) and index > 1:   #index!=1 and index !=0:
-            print("Copying: " + str(obs.BaseRenderToCopy) + "-> " + str(index+bpy.context.scene.frame_start-1) + \
-                                "  To " + path + str(index+bpy.context.scene.frame_start-1).zfill(pad)  + ".png")
-            shutil.copy2(path + str(obs.BaseRenderToCopy).zfill(pad)  + ".png", path + \
-                        str(index+bpy.context.scene.frame_start-1).zfill(pad)  + ".png")
-
-        if ToRender.__len__()>1:   #renderizar 1 item em ToRender nao renderiza, (sempre vem com no minimo 1)
-            if index==1:
-                print("================================================================")
-                from time import strftime
-                print(strftime("Running Smart Render:  %H:%M:%S"))
-                print("================================================================")
-                BaseRenderToCopy=0
-
-            if ToRender[0] <= bpy.context.scene.frame_end:
-                #renderiza proximo frame
-                print("Rendering-> " + str(ToRender[0]))
-                obs.BaseRenderToCopy= ToRender[0]
-                bpy.ops.render.render(animation=False, write_still=False)
-                bpy.data.images['Render Result'].save_render(filepath=path + str(ToRender[0]).zfill(pad)  + ".png")
-                i+=1
-
-        if index==tot:
-            print("================================================================")
-            from time import strftime
-            print(strftime("Finish Render:  %H:%M:%S"))
-            print("================================================================")
-            print(".")
-
-        if index==tot+1:
-            obs.BaseRenderToCopy=0
-            return 0
-
-        return index
-
-
-    def execute(self, context):
-        # se for CYCLES, nao funciona com timer, preciso rodar direto
-        context.scene.imp_sound_to_anim.Working= "SmartRender"
-        bpy.ops.wm.modal_timer_operator()
-        #SmartRender(context)
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        self.execute(context)
-        return {'FINISHED'}
-
-
-
-#
-#==================================================================================================
-# Button - Cancel
-#==================================================================================================
-#
-class OBJECT_OT_Botao_Cancel(bpy.types.Operator):
-    '''Cancel Actual Operation'''
-    bl_idname = "import.sound_animation_botao_cancel"
-    bl_label = "CANCEL"
-
-    def execute(self, context):
-        context.scene.imp_sound_to_anim.cancel_button_hit=True
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        self.execute(context)
-        return {'FINISHED'}
-
-
-#
-#==================================================================================================
-#     TIMER - controla a execucao das funcoes
-#           Responsavel por rodar em partes usando o timer e possibilitando
-#           o cancelamento e textos informativos
-#==================================================================================================
-#
-class ModalTimerOperator(bpy.types.Operator):
-    """Internal Script Control"""
-    bl_idname = "wm.modal_timer_operator"
-    bl_label = "Internal Script Control"
-
-    _timer = None
-    Running= False
-
-    def CheckRunStop(self, context, func, index):
-        # forca update do UI
-        bpy.context.scene.frame_set(bpy.context.scene.frame_current)
-        if index!=0:
-            #configura timer para a funcao
-            context.scene.imp_sound_to_anim.Working= func
-            self.Running=True
-            return {'PASS_THROUGH'}
-        else: # posso desligar o timer e modal
-            if self._timer!= None:
-                context.window_manager.event_timer_remove(self._timer)
-                self._timer= None
-            return {'FINISHED'}
-
-
-    def modal(self, context, event):
-        if event.type == 'ESC'and self.Running:
-            print("-- ESC Pressed --")
-            self.cancel(context)
-            context.scene.imp_sound_to_anim.Working=""
-            self.Running=False
-            #reseta contadores
-            context.scene.imp_sound_to_anim.timer_reset_func=True
-            # forca update do UI
-            bpy.context.scene.frame_set(bpy.context.scene.frame_current)
-            return {'CANCELLED'}
-
-        if event.type == 'TIMER':
-            #print("timer")
-            #CheckSmartRender
-            if context.scene.imp_sound_to_anim.Working== "CheckSmartRender":
-                self.parar(context)
-                #5= frames para rodar antes de voltar    [1]= indice de posicao atual
-                index= OBJECT_OT_Botao_Check_SmartRender.CheckSmartRender(context, 5)[1]
-                return self.CheckRunStop(context, "CheckSmartRender", index)
-
-            #SmartRender
-            elif context.scene.imp_sound_to_anim.Working== "SmartRender":
-                self.parar(context)
-                #render/copia 1 e volta     index>=0 indice posicao atual
-                index= OBJECT_OT_Botao_SmartRender.SmartRender(context)
-                return self.CheckRunStop(context, "SmartRender", index)
-
-            #ProcessaSom
-            elif context.scene.imp_sound_to_anim.Working== "ProcessaSom":
-                self.parar(context)
-                # loop = numero de frames de audio    index=0 se terminou ou >0 se não acabou
-                index= OBJECT_OT_Botao_Go.ProcessaSom(context, 50)
-                return self.CheckRunStop(context, "ProcessaSom", index)
-
-            #wavimport(context)
-            elif context.scene.imp_sound_to_anim.Working== "wavimport":
-                self.parar(context)
-                # 5= numero de frames to import por timer
-                index=OBJECT_OT_Botao_Import.wavimport(context, 50)
-                return self.CheckRunStop(context, "wavimport", index)
-
-            #passa por aqui quando as funcoes estao sendo executadas mas
-            #configuradas para nao entrar porque  context.scene.imp_sound_to_anim.Working== ""
-            return {'PASS_THROUGH'}
-
-        # reseta e para tudo botao CANCEL pressionado
-        if context.scene.imp_sound_to_anim.cancel_button_hit==True:
-            context.scene.imp_sound_to_anim.Working=""
-            #pede reset contadores
-            context.scene.imp_sound_to_anim.timer_reset_func=True
-            if self._timer!= None:
-                context.window_manager.event_timer_remove(self._timer)
-                self._timer= None
-            print("-- Cancel Pressed --")
-            context.scene.imp_sound_to_anim.cancel_button_hit=False
-            return {'FINISHED'}
-
-        #print("modal")
-
-        # se o timer esta ativado, continua, (senao termina).
-        # desligar a chamada ao modal se caso chegar aqui (nao deveria)
-        if self._timer!= None:
-            return{'PASS_THROUGH'}
-        else:
-            return {'FINISHED'}
-
-    def execute(self, context):
-        if self._timer==None:
-            self._timer = context.window_manager.event_timer_add(0.2, context.window)
-            context.window_manager.modal_handler_add(self)
-        #para deixar rodar sem deligar o timer
-        context.scene.imp_sound_to_anim.timer_desligar=False
-        self.Running=True
-        return {'RUNNING_MODAL'}
-
-    def cancel(self, context):
-        if self._timer!= None:
-            context.window_manager.event_timer_remove(self._timer)
-        self._timer= None
-        return {'CANCELLED'}
-
-    def parar(self, context):
-        if self.Running:
-            context.scene.imp_sound_to_anim.Working=""
-            self.Running=False
-
-
-
-#
-#==================================================================================================
-#     Register - Unregister - MAIN
-#==================================================================================================
-#
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.Scene.imp_sound_to_anim = PointerProperty(type=ImpSoundtoAnim, name="Import: Sound to Animation", description="Extract movement from sound file. See the Object Panel at the end.")
-    bpy.types.INFO_MT_file_import.append(WavFileImport)
-
-def unregister():
-
-    try:
-        bpy.utils.unregister_module(__name__)
-    except:
-        pass
-
-    try:
-        bpy.types.INFO_MT_file_import.remove(WavFileImport)
-    except:
-        pass
-
-
-
-if __name__ == "__main__":
-    register()
-
-
-
-
diff --git a/release/scripts/addons_contrib/io_import_voodoo_camera.py b/release/scripts/addons_contrib/io_import_voodoo_camera.py
deleted file mode 100644
index 3a45982..0000000
--- a/release/scripts/addons_contrib/io_import_voodoo_camera.py
+++ /dev/null
@@ -1,331 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Import Voodoo camera",
-    "author": "Fazekas Laszlo",
-    "version": (0, 8),
-    "blender": (2, 63, 0),
-    "location": "File > Import > Voodoo camera",
-    "description": "Imports a Blender (2.4x or 2.5x) Python script from the Voodoo (version 1.1 or 1.2) camera tracker software.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Import-Export/Voodoo_camera",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=22510",
-    "category": "Import-Export"}
-
-"""
-This script loads a Blender Python script from the Voodoo camera
-tracker program into Blender 2.5x+.
-
-It processes the script as a text file and not as a Python executable
-because of the incompatible Python APIs of Blender 2.4x/2.5x/2.6x.
-"""
-
-import bpy
-from bpy.props import *
-import mathutils
-import os
-import string
-import math
-
-def voodoo_import(infile,ld_cam,ld_points):
-
-    checktype = os.path.splitext(infile)[1]
-
-    if checktype.upper() != '.PY':
-        print ("Selected file: ",infile)
-        raise IOError("The selected input file is not a *.py file")
-        return
-
-    print ("--------------------------------------------------")
-    print ("Importing Voodoo file: ", infile)
-
-    file = open(infile,'rU')
-    scene = bpy.context.scene
-    initfr = scene.frame_current
-    b24= True
-    voodoo_import.frwas= False
-
-    dummy = bpy.data.objects.new('voodoo_scene', None)
-    dummy.location = (0.0, 0.0, 0.0)
-    dummy.rotation_euler = ( -3.141593/2, 0.0, 0.0)
-    dummy.scale = (0.2, 0.2, 0.2)
-    scene.objects.link(dummy)
-
-    if ld_cam:
-        data = bpy.data.cameras.new('voodoo_render_cam')
-        data.lens_unit= 'DEGREES'
-        vcam = bpy.data.objects.new('voodoo_render_cam', data)
-        vcam.location = (0.0, 0.0, 0.0)
-        vcam.rotation_euler = (0.0, 0.0, 0.0)
-        vcam.scale = (1.0, 1.0, 1.0)
-        data.lens = 35.0
-        data.shift_x = 0.0
-        data.shift_y = 0.0
-        data.dof_distance = 0.0
-        data.clip_start = 0.1
-        data.clip_end = 1000.0
-        data.draw_size = 0.5
-        scene.objects.link(vcam)
-        vcam.parent = dummy
-
-    if ld_points:
-        data = bpy.data.meshes.new('voodoo_FP3D_cloud')
-        mesh = bpy.data.objects.new('voodoo_FP3D_cloud', data)
-        mesh.location = (0.0, 0.0, 0.0)
-        # before 6.3
-        # mesh.rotation_euler = (3.141593/2, 0.0, 0.0)
-        # mesh.scale = (5.0, 5.0, 5.0)
-        mesh.rotation_euler = (0.0, 0.0, 0.0)
-        mesh.scale = (1.0, 1.0, 1.0)
-        scene.objects.link(mesh)
-        mesh.parent = dummy
-
-    verts = []
-
-    def stri(s):
-        try:
-            ret= int(s,10)
-
-        except ValueError :
-            ret= -1
-
-        return ret
-
-    def process_line(line):
-        lineSplit = line.split()
-
-        if (len(lineSplit) < 1): return
-
-        if (line[0] == '#'): return
-
-        if b24:
-
-            # Blender 2.4x mode
-            # process camera commands
-
-            if ld_cam:
-                if (line[0] == 'c' and line[1] != 'r'):
-                    pos= line.find('.lens')
-
-                    if (pos != -1):
-                        fr = stri(lineSplit[0][1:pos])
-
-                        if (fr >= 0):
-                            scene.frame_current = fr
-                            vcam.data.lens= float(lineSplit[2])
-                            vcam.data.keyframe_insert('lens')
-                            return
-
-                if (line[0] == 'o'):
-                    pos= line.find('.setMatrix')
-
-                    if (pos != -1):
-                        fr = stri(lineSplit[0][1:pos])
-
-                        if (fr >= 0):
-                            scene.frame_current = fr
-                            # for up to 2.55
-                            # vcam.matrix_world = eval('mathutils.' + line.rstrip()[pos+21:-1])
-                            # for 2.56, from Michael (Meikel) Oetjen 
-                            # vcam.matrix_world = eval('mathutils.Matrix(' + line.rstrip()[pos+28:-2].replace('[','(',4).replace(']',')',4) + ')')
-                            # for 2.57
-                            # vcam.matrix_world = eval('mathutils.Matrix([' + line.rstrip()[pos+28:-2] + '])')
-                            # for 2.63
-                            vcam.matrix_world = eval('(' + line.rstrip()[pos+27:-1] + ')')
-                            vcam.keyframe_insert('location')
-                            vcam.keyframe_insert('scale')
-                            vcam.keyframe_insert('rotation_euler')
-                            return
-
-            # process mesh commands
-
-            if ld_points:
-                if (line[0] == 'v'):
-                    pos= line.find('NMesh.Vert')
-
-                    if (pos != -1):
-                        verts.append(eval(line[pos+10:]))
-
-            return
-
-        # Blender 2.5x mode
-        # process camera commands
-
-        if ld_cam:
-            pos= line.find('set_frame')
-
-            if (pos == -1):
-                pos= line.find('frame_set')
-
-                if (pos == -1):
-                    pos= lineSplit[0].find('frame_current')
-
-                    if (pos != -1):
-                        fr= stri(lineSplit[2])
-
-                        if (fr >= 0):
-                            scene.frame_current = fr
-                            voodoo_import.frwas= True
-
-                        return
-
-            if (pos != -1):
-                fr= stri(line[pos+10:-2])
-
-                if (fr >= 0):
-                    scene.frame_current = fr
-                    voodoo_import.frwas= True
-                    return
-
-            if voodoo_import.frwas:
-
-                pos= line.find('data.lens')
-
-                if (pos != -1):
-                    vcam.data.lens= float(lineSplit[2])
-                    vcam.data.keyframe_insert('lens')
-                    return
-
-                pos= line.find('.Matrix')
-
-                if (pos != -1):
-
-                    # for up to 2.55
-                    # vcam.matrix_world = eval('mathutils' + line[pos:])
-
-                    # for 2.56
-                    # if (line[pos+8] == '['):
-                    # # from Michael (Meikel) Oetjen
-                    #     vcam.matrix_world = eval('mathutils.Matrix((' + line.rstrip()[pos+9:-1].replace('[','(',3).replace(']',')',4) + ')')
-                    # else:
-                    #   vcam.matrix_world = eval('mathutils' + line[pos:])
-
-                    # for 2.57
-                    # vcam.matrix_world = eval('mathutils.Matrix([' + line.rstrip()[pos+8:-1] + '])')
-
-                    # for 2.63
-                    vcam.matrix_world = eval('(' + line.rstrip()[pos+7:] + ')')
-                    return
-
-                pos= line.find('.matrix_world')
-
-                if (pos != -1):
-                    vcam.matrix_world = eval(line.rstrip()[line.find('=')+1:])
-                    return
-
-                pos= line.find('.location')
-
-                if (pos != -1):
-                    vcam.location = eval(line[line.find('=')+1:])
-                    return
-
-                pos= line.find('.rotation_euler')
-
-                if (pos != -1):
-                    vcam.rotation_euler = eval(line[line.find('=')+1:])
-                    return
-
-                pos= line.find('.data.keyframe_insert')
-
-                if (pos != -1):
-                    vcam.data.keyframe_insert(eval(line[pos+22:-2]))
-                    return
-
-                pos= line.find('.keyframe_insert')
-
-                if (pos != -1):
-                    vcam.keyframe_insert(eval(line[pos+17:-2]))
-                    return
-
-        # process mesh commands
-
-        if ld_points:
-            pos= line.find('.append')
-
-            if (pos != -1):
-                verts.append(eval(line[pos+8:-2]))
-
-    #read lines
-
-    for line in file.readlines():
-
-        if (b24 and (line.find('import') != -1) and (line.find('bpy') != -1)):
-            b24= False
-
-        process_line(line)
-
-    scene.frame_set(initfr)
-
-    if ld_points:
-        mesh.data.from_pydata(verts, [], [])
-
-    mesh.data.update()
-
-
-# Operator
-class ImportVoodooCamera(bpy.types.Operator):
-    """"""
-    bl_idname = "import.voodoo_camera"
-    bl_label = "Import Voodoo camera"
-    bl_description = "Load a Blender export script from the Voodoo motion tracker"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    filepath = StringProperty(name="File Path",
-        description="Filepath used for processing the script",
-        maxlen= 1024,default= "")
-
-    # filter_python = BoolProperty(name="Filter python",
-    # description="",default=True,options={'HIDDEN'})
-
-    load_camera = BoolProperty(name="Load camera",
-        description="Load the camera",
-        default=True)
-    load_points = BoolProperty(name="Load points",
-        description="Load the FP3D point cloud",
-        default=True)
-
-    def execute(self, context):
-        voodoo_import(self.filepath,self.load_camera,self.load_points)
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.window_manager
-        wm.fileselect_add(self)
-        return {'RUNNING_MODAL'}
-
-
-# Registering / Unregister
-def menu_func(self, context):
-    self.layout.operator(ImportVoodooCamera.bl_idname, text="Voodoo camera", icon='PLUGIN')
-
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.INFO_MT_file_import.append(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_file_import.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/io_mesh_gwyddion/__init__.py b/release/scripts/addons_contrib/io_mesh_gwyddion/__init__.py
deleted file mode 100644
index 1cb6fa9..0000000
--- a/release/scripts/addons_contrib/io_mesh_gwyddion/__init__.py
+++ /dev/null
@@ -1,184 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-#
-#
-#  Authors           : Clemens Barth (Blendphys at root-1.de), ...
-#
-#  Homepage          : http://development.root-1.de/Atomic_Blender.php
-#
-#  Start of project              : 2012-11-12 by Clemens Barth
-#  First publication in Blender  : 2012-11-19
-#  Last modified                 : 2012-11-19
-#
-#  Acknowledgements 
-#  ================
-#
-#  Other: Frank Palmino
-#
-
-bl_info = {
-    "name": "Atomic Blender - Gwyddion",
-    "description": "Loading Gwyddion Atomic Force Microscopy images",
-    "author": "Clemens Barth",
-    "version": (0, 1),
-    "blender": (2, 60, 0),
-    "location": "File -> Import -> Gwyddion (.gwy)",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/Import-Export/Gwyddion",
-    "tracker_url": "http://projects.blender.org/tracker/"
-                   "index.php?func=detail&aid=33236&group_id=153&atid=469",
-    "category": "Import-Export"
-}
-
-import bpy
-from bpy.types import Operator
-from bpy_extras.io_utils import ImportHelper
-from bpy.props import (BoolProperty, 
-                       StringProperty, 
-                       EnumProperty,
-                       FloatProperty)
-
-from . import import_gwyddion
-
-# -----------------------------------------------------------------------------
-#                                                                           GUI
-
-# This is the class for the file dialog of the importer.
-class ImportGwyddion(Operator, ImportHelper):
-    bl_idname = "import_mesh.gwy"
-    bl_label  = "Import Gwyddion (*.gwy)"
-    bl_options = {'PRESET', 'UNDO'}
-
-    filename_ext = ".gwy"
-    filter_glob  = StringProperty(default="*.gwy", options={'HIDDEN'},)
-
-    use_camera = BoolProperty(
-        name="Camera", default=False,
-        description="Do you need a camera?")
-    use_lamp = BoolProperty(
-        name="Lamp", default=False,
-        description = "Do you need a lamp?")             
-    use_smooth = BoolProperty(
-        name="Smooth image data", default=False,
-        description = "Smooth the images")
-    scale_size = FloatProperty (
-        name = "Scale xy", default=0.5,
-        description = "Scale the lateral size")    
-    scale_height = FloatProperty (
-        name = "Scale h", default=3.0,
-        description = "Scale the height")    
-    use_all_channels = BoolProperty(
-        name="All channels", default=False,
-        description = "Load all images")        
-    use_c1 = BoolProperty(
-        name="1", default=True,
-        description = "Channel 1")
-    use_c2 = BoolProperty(
-        name="2", default=False,
-        description = "Channel 2")        
-    use_c3 = BoolProperty(
-        name="3", default=False,
-        description = "Channel 3")
-    use_c4 = BoolProperty(
-        name="4", default=False,
-        description = "Channel 4")       
-    use_c5 = BoolProperty(
-        name="5", default=False,
-        description = "Channel 5")
-    use_c6 = BoolProperty(
-        name="6", default=False,
-        description = "Channel 6")        
-    use_c7 = BoolProperty(
-        name="7", default=False,
-        description = "Channel 7")
-    use_c8 = BoolProperty(
-        name="8", default=False,
-        description = "Channel 8")       
- 
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-        row.prop(self, "use_camera")
-        row.prop(self, "use_lamp")   
-        row = layout.row()
-        row.prop(self, "use_smooth")
-        row = layout.row()
-        row.prop(self, "scale_size")
-        row.prop(self, "scale_height")
-        row = layout.row()
-        row.label(text="Channels")
-        row.prop(self, "use_all_channels")
-        row = layout.row()
-        row.prop(self, "use_c1")
-        row.prop(self, "use_c2")
-        row.prop(self, "use_c3")
-        row.prop(self, "use_c4")
-        row = layout.row()
-        row.prop(self, "use_c5")
-        row.prop(self, "use_c6")
-        row.prop(self, "use_c7")
-        row.prop(self, "use_c8")
-        
-        if self.use_all_channels:
-            self.use_c1, self.use_c2, self.use_c3, self.use_c4, \
-            self.use_c5, self.use_c6, self.use_c7, self.use_c8  \
-            = True, True, True, True, True, True, True, True
-        
-    def execute(self, context):
-        # This is in order to solve this strange 'relative path' thing.
-        filepath_par = bpy.path.abspath(self.filepath)
-
-        channels = [self.use_c1, self.use_c2, self.use_c3, self.use_c4,
-                    self.use_c5, self.use_c6, self.use_c7, self.use_c8]
-
-        # Execute main routine   
-        #print("passed - 1")
-        images, AFMdata = import_gwyddion.load_gwyddion_images(filepath_par, 
-                                                               channels) 
-
-        #print("passed - 3")
-        import_gwyddion.create_mesh(images, 
-                                 AFMdata,
-                                 self.use_smooth,
-                                 self.scale_size,
-                                 self.scale_height,
-                                 self.use_camera,
-                                 self.use_lamp)  
-        #print("passed - 4")
-        
-        return {'FINISHED'}
-
-
-# The entry into the menu 'file -> import'
-def menu_func_import(self, context):
-    self.layout.operator(ImportGwyddion.bl_idname, text="Gwyddion (.gwy)")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.INFO_MT_file_import.append(menu_func_import)
-    
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_file_import.remove(menu_func_import)
-
-if __name__ == "__main__":
-
-    register()
diff --git a/release/scripts/addons_contrib/io_mesh_gwyddion/import_gwyddion.py b/release/scripts/addons_contrib/io_mesh_gwyddion/import_gwyddion.py
deleted file mode 100644
index 896a3f3..0000000
--- a/release/scripts/addons_contrib/io_mesh_gwyddion/import_gwyddion.py
+++ /dev/null
@@ -1,309 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-import os
-import re
-from math import pi, sqrt
-from mathutils import Vector, Matrix
-import struct
-
-# All data for the images. Basically, each variable is a list with a length,
-# which equals the number of images.
-# Some of the variables are still not used. However, I keep them for purposes
-# in future.  
-class AFMData(object):
-    def __init__(self, date, x_size, y_size, x_pixel, y_pixel, x_off, y_off, 
-                 voltage, feedback, gain, speed, amplitude, angle, datfile, 
-                 channel, unit, z_factor, spec_x_unit, spec_x_label, spec_y_unit, 
-                 spec_y_label, spec_y_factor, spec_points, spec_feedback, 
-                 spec_acquisition, spec_delay):
-        self.date = date
-        self.x_size = x_size
-        self.y_size = y_size
-        self.x_pixel = x_pixel
-        self.y_pixel = y_pixel
-        self.x_off = x_off
-        self.y_off = y_off
-        self.voltage = voltage
-        self.feedback = feedback
-        self.gain = gain
-        self.speed = speed
-        self.amplitude = amplitude
-        self.angle = angle
-        self.datfile = datfile
-        self.channel = channel
-        self.unit = unit
-        self.z_factor = z_factor
-        self.spec_x_unit = spec_x_unit    
-        self.spec_x_label = spec_x_label     
-        self.spec_y_unit = spec_y_unit
-        self.spec_y_label = spec_y_label
-        self.spec_y_factor = spec_y_factor      
-        self.spec_points = spec_points
-        self.spec_feedback = spec_feedback
-        self.spec_acquisition = spec_acquisition
-        self.spec_delay = spec_delay     
-      
-
-# For loading the Gwyddion images. I basically have followed rules described 
-# here: http://gwyddion.net/documentation/user-guide-en/gwyfile-format.html
-def load_gwyddion_images(data_file, channels):
-   
-    if not os.path.isfile(data_file):
-        return False  
-
-    AFMdata = AFMData([],[],[],[],[],[],[],
-                      [],[],[],[],[],[],[],
-                      [],[],[],[],[],[],[],
-                      [],[],[],[],[])
-    AFMdata.datfile = data_file
-    
-    datafile = open(data_file, 'rb')
-    data = datafile.read()
-    datafile.close()   
-    
-    # Search the title of each image
-    for a in list(re.finditer(b"data/title\x00", data)):    
-            
-        pos = a.start()
-        channel_number = int(data[pos-2:pos-1])
-        
-        if channels[channel_number] == False:
-            continue
-                
-        pos1 = data[pos:].find(b"\x00") + pos + len("\x00") + 1
-        pos2 = data[pos1:].find(b"\x00") + pos1
-
-        channel_name = data[pos1:pos2].decode("utf-8")
-        
-        AFMdata.channel.append([channel_number, channel_name])    
-        
-    # Search important parameters and finally the image data.    
-    images = []    
-    for a in list(re.finditer(b"/data\x00", data)):
-    
-        pos = a.start()    
-
-        channel_number = int(data[pos-1:pos])
-        
-        if channels[channel_number] == False:
-            continue
-
-        # Find the image size in pixel (x direction)
-        pos1 = data[pos:].find(b"xres") + pos+len("xres")
-        size_x_pixel = struct.unpack("i",data[pos1+2:pos1+4+2])[0]
-
-        # ... the image size in pixel (y direction)
-        pos1 = data[pos:].find(b"yres") + pos+len("yres")
-        size_y_pixel = struct.unpack("i",data[pos1+2:pos1+4+2])[0]
-
-        # ... the real image size (x direction)
-        pos1 = data[pos:].find(b"xreal") + pos+len("xreal")
-        size_x_real = struct.unpack("d",data[pos1+2:pos1+8+2])[0]
-
-        # ... the real image size (y direction)
-        pos1 = data[pos:].find(b"yreal") + pos+len("yreal")
-        size_y_real = struct.unpack("d",data[pos1+2:pos1+8+2])[0]
-
-        # If it is a z image, multiply with 10^9 nm
-        factor = 1.0        
-        pos1 = data[pos:].find(b"si_unit_z") + pos
-        unit = data[pos1+34:pos1+36].decode("utf-8")
-        if "m" in unit:
-            factor = 1000000000.0
-        
-        # Now, find the image data and store it
-        pos1 = data[pos:].find(b"\x00data\x00") + pos + len("\x00data\x00") + 5
-
-        image = []        
-        for i in range(size_y_pixel):
-            line = []
-            for j in range(size_x_pixel):
-                # The '8' is for the double values
-                k = pos1 + (i*size_x_pixel+j)   * 8
-                l = pos1 + (i*size_x_pixel+j+1) * 8
-                line.append(struct.unpack("d",data[k:l])[0]*factor)
-            image.append(line)     
-            
-        images.append(image)
-   
-        # Note all parameters of the image.
-        AFMdata.x_pixel.append(int(size_x_pixel))
-        AFMdata.y_pixel.append(int(size_y_pixel))
-        AFMdata.x_size.append(size_x_real * 1000000000.0)
-        AFMdata.y_size.append(size_y_real * 1000000000.0)
-    
-    return (images, AFMdata)
-
-# Routine to create the mesh and finally the image
-def create_mesh(data_list, 
-                AFMdata, 
-                use_smooth, 
-                scale_size,
-                scale_height,
-                use_camera,
-                use_lamp):
-    # This is for the image name.       
-    path_list = AFMdata.datfile.strip('/').split('/') 
-
-    number_img = len(data_list)
-    image_x_offset_gap = 10.0 * scale_size
-    image_x_all = sum(AFMdata.x_size)*scale_size 
-    image_x_offset = -(image_x_all+image_x_offset_gap*(number_img-1)) / 2.0
-                                
-    # For each image do:
-    for k, data in enumerate(data_list):
-      
-        size_x = AFMdata.x_pixel[k]
-        size_y = AFMdata.y_pixel[k]
-        
-        image_scale = AFMdata.x_size[k] / float(AFMdata.x_pixel[k])    
-        image_scale = image_scale * scale_size    
-        image_x_size = AFMdata.x_size[k] * scale_size        
-        image_x_offset += image_x_size / 2.0
-      
-        image_name = path_list[-1] + "_" + AFMdata.channel[k][1]
-        
-        data_mesh = []
-        data_faces = []
-
-        #print("passed - create_mesh ---- 1")
-
-        for i, line in enumerate(data):
-            for j, pixel in enumerate(line):
-            
-               # The vertices
-               data_mesh.append(Vector((float(i) * image_scale, 
-                                        float(j) * image_scale, 
-                                        float(pixel)*scale_height)))
-               
-               # The faces
-               if i < size_y-1 and j < size_x-1:
-                   data_faces.append( [size_x*i+j      , size_x*(i+1)+j, 
-                                       size_x*(i+1)+j+1, size_x*i+j+1    ]) 
-
-        #print("passed - create_mesh ---- 2")
-               
-        # Build the mesh
-        surface_mesh = bpy.data.meshes.new("Mesh")
-        surface_mesh.from_pydata(data_mesh, [], data_faces)
-        surface_mesh.update()
-        surface = bpy.data.objects.new(image_name, surface_mesh)
-        bpy.context.scene.objects.link(surface)
-        bpy.ops.object.select_all(action='DESELECT')        
-        surface.select = True 
-
-        bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
-        # sum((v.co for v in mesh.vertices), Vector()) / len(mesh.vertices)
-
-        if use_smooth:
-            for polygon in surface.data.polygons:
-                polygon.use_smooth = True
-
-        surface.location = Vector((0.0, image_x_offset, 0.0)) 
-        image_x_offset += image_x_size / 2.0 + image_x_offset_gap
-
-        #print("passed - create_mesh ---- 3")
-
-
-        
-    object_center_vec = Vector((0.0,0.0,0.0))
-    object_size = (sum(AFMdata.x_size) * scale_size 
-                   +image_x_offset_gap * (len(data_list)-1))
-
-    # ------------------------------------------------------------------------
-    # CAMERA AND LAMP
-    camera_factor = 20.0
-    
-    # If chosen a camera is put into the scene.
-    if use_camera == True:
-
-        # Assume that the object is put into the global origin. Then, the
-        # camera is moved in x and z direction, not in y. The object has its
-        # size at distance sqrt(object_size) from the origin. So, move the
-        # camera by this distance times a factor of camera_factor in x and z.
-        # Then add x, y and z of the origin of the object.
-        object_camera_vec = Vector((sqrt(object_size) * camera_factor,
-                                    0.0,
-                                    sqrt(object_size) * camera_factor))
-        camera_xyz_vec = object_center_vec + object_camera_vec
-
-        # Create the camera
-        current_layers=bpy.context.scene.layers 
-        camera_data = bpy.data.cameras.new("A_camera")
-        camera_data.lens = 45
-        camera_data.clip_end = 50000.0
-        camera = bpy.data.objects.new("A_camera", camera_data)
-        camera.location = camera_xyz_vec
-        camera.layers = current_layers
-        bpy.context.scene.objects.link(camera) 
-
-        # Here the camera is rotated such it looks towards the center of
-        # the object. The [0.0, 0.0, 1.0] vector along the z axis
-        z_axis_vec             = Vector((0.0, 0.0, 1.0))
-        # The angle between the last two vectors
-        angle                  = object_camera_vec.angle(z_axis_vec, 0)
-        # The cross-product of z_axis_vec and object_camera_vec
-        axis_vec               = z_axis_vec.cross(object_camera_vec)
-        # Rotate 'axis_vec' by 'angle' and convert this to euler parameters.
-        # 4 is the size of the matrix.
-        camera.rotation_euler  = Matrix.Rotation(angle, 4, axis_vec).to_euler()
-
-        # Rotate the camera around its axis by 90° such that we have a nice
-        # camera position and view onto the object.
-        bpy.ops.object.select_all(action='DESELECT')        
-        camera.select = True         
-        bpy.ops.transform.rotate(value=(90.0*2*pi/360.0),
-                                 axis=object_camera_vec,
-                                 constraint_axis=(False, False, False),
-                                 constraint_orientation='GLOBAL',
-                                 mirror=False, proportional='DISABLED',
-                                 proportional_edit_falloff='SMOOTH',
-                                 proportional_size=1, snap=False,
-                                 snap_target='CLOSEST', snap_point=(0, 0, 0),
-                                 snap_align=False, snap_normal=(0, 0, 0),
-                                 release_confirm=False)
-
-    # Here a lamp is put into the scene, if chosen.
-    if use_lamp == True:
-
-        # This is the distance from the object measured in terms of %
-        # of the camera distance. It is set onto 50% (1/2) distance.
-        lamp_dl = sqrt(object_size) * 15 * 0.5
-        # This is a factor to which extend the lamp shall go to the right
-        # (from the camera  point of view).
-        lamp_dy_right = lamp_dl * (3.0/4.0)
-
-        # Create x, y and z for the lamp.
-        object_lamp_vec = Vector((lamp_dl,lamp_dy_right,lamp_dl))
-        lamp_xyz_vec = object_center_vec + object_lamp_vec
-
-        # Create the lamp
-        current_layers=bpy.context.scene.layers
-        lamp_data = bpy.data.lamps.new(name="A_lamp", type="POINT")
-        lamp_data.distance = 5000.0
-        lamp_data.energy = 3.0
-        lamp_data.shadow_method = 'RAY_SHADOW'        
-        lamp = bpy.data.objects.new("A_lamp", lamp_data)
-        lamp.location = lamp_xyz_vec
-        lamp.layers = current_layers
-        bpy.context.scene.objects.link(lamp)         
-
-        bpy.context.scene.world.light_settings.use_ambient_occlusion = True
-        bpy.context.scene.world.light_settings.ao_factor = 0.1      
diff --git a/release/scripts/addons_contrib/io_mesh_xyz/__init__.py b/release/scripts/addons_contrib/io_mesh_xyz/__init__.py
deleted file mode 100644
index e425d89..0000000
--- a/release/scripts/addons_contrib/io_mesh_xyz/__init__.py
+++ /dev/null
@@ -1,250 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-#
-#
-#  Authors           : Clemens Barth (Blendphys at root-1.de), ...
-#
-#  Homepage(Wiki)    : http://development.root-1.de/Atomic_Blender.php
-#
-#  Start of project              : 2011-12-01 by Clemens Barth
-#  First publication in Blender  : 2011-12-18
-#  Last modified                 : 2012-11-10
-#
-#  Acknowledgements 
-#  ================
-#
-#  Blender: ideasman, meta_androcto, truman, kilon, CoDEmanX, dairin0d, PKHG, 
-#           Valter, ...
-#  Other: Frank Palmino
-#
-
-bl_info = {
-    "name": "Atomic Blender - XYZ",
-    "description": "Import/export of atoms described in .xyz files",
-    "author": "Clemens Barth",
-    "version": (1, 0),
-    "blender": (2, 60, 0),
-    "location": "File -> Import -> XYZ (.xyz)",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/"
-                "Import-Export/XYZ",
-    "tracker_url": "http://projects.blender.org/tracker/"
-                   "index.php?func=detail&aid=29646&group_id=153&atid=468",
-    "category": "Import-Export"
-}
-
-import bpy
-from bpy.types import Operator
-from bpy_extras.io_utils import ImportHelper, ExportHelper
-from bpy.props import (StringProperty,
-                       BoolProperty,
-                       EnumProperty,
-                       IntProperty,
-                       FloatProperty)
-
-from . import import_xyz
-from . import export_xyz
-
-# -----------------------------------------------------------------------------
-#                                                                           GUI
-
-
-# This is the class for the file dialog.
-class ImportXYZ(Operator, ImportHelper):
-    bl_idname = "import_mesh.xyz"
-    bl_label  = "Import XYZ (*.xyz)"
-    bl_options = {'PRESET', 'UNDO'}
-    
-    filename_ext = ".xyz"
-    filter_glob  = StringProperty(default="*.xyz", options={'HIDDEN'},)
-
-    use_camera = BoolProperty(
-        name="Camera", default=False,
-        description="Do you need a camera?")
-    use_lamp = BoolProperty(
-        name="Lamp", default=False,
-        description = "Do you need a lamp?")
-    ball = EnumProperty(
-        name="Type of ball",
-        description="Choose ball",
-        items=(('0', "NURBS", "NURBS balls"),
-               ('1', "Mesh" , "Mesh balls"),
-               ('2', "Meta" , "Metaballs")),
-               default='0',) 
-    mesh_azimuth = IntProperty(
-        name = "Azimuth", default=32, min=1,
-        description = "Number of sectors (azimuth)")
-    mesh_zenith = IntProperty(
-        name = "Zenith", default=32, min=1,
-        description = "Number of sectors (zenith)")
-    scale_ballradius = FloatProperty(
-        name = "Balls", default=1.0, min=0.0001,
-        description = "Scale factor for all atom radii")
-    scale_distances = FloatProperty (
-        name = "Distances", default=1.0, min=0.0001,
-        description = "Scale factor for all distances")
-    atomradius = EnumProperty(
-        name="Type of radius",
-        description="Choose type of atom radius",
-        items=(('0', "Pre-defined", "Use pre-defined radius"),
-               ('1', "Atomic", "Use atomic radius"),
-               ('2', "van der Waals", "Use van der Waals radius")),
-               default='0',)            
-    use_center = BoolProperty(
-        name = "Object to origin (first frames)", default=False,
-        description = "Put the object into the global origin, the first frame only")           
-    use_center_all = BoolProperty(
-        name = "Object to origin (all frames)", default=True,
-        description = "Put the object into the global origin, all frames") 
-    datafile = StringProperty(
-        name = "", description="Path to your custom data file",
-        maxlen = 256, default = "", subtype='FILE_PATH')    
-    use_frames = BoolProperty(
-        name = "Load all frames?", default=False,
-        description = "Do you want to load all frames?") 
-    skip_frames = IntProperty(
-        name="", default=0, min=0,
-        description="Number of frames you want to skip.")
-    images_per_key = IntProperty(
-        name="", default=1, min=1,
-        description="Choose the number of images between 2 keys.")
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-        row.prop(self, "use_camera")
-        row.prop(self, "use_lamp")
-        row = layout.row()
-        col = row.column()
-        col.prop(self, "ball")
-        row = layout.row()
-        row.active = (self.ball == "1")
-        col = row.column(align=True)        
-        col.prop(self, "mesh_azimuth")
-        col.prop(self, "mesh_zenith")
-        row = layout.row()
-        col = row.column()
-        col.label(text="Scaling factors")
-        col = row.column(align=True)
-        col.prop(self, "scale_ballradius")
-        col.prop(self, "scale_distances")
-        row = layout.row()
-        row.prop(self, "use_center")
-        row = layout.row()
-        row.prop(self, "use_center_all")
-        row = layout.row()
-        row.prop(self, "atomradius")
-        
-        row = layout.row()
-        row.prop(self, "use_frames")        
-        row = layout.row()        
-        row.active = self.use_frames        
-        col = row.column()
-        col.label(text="Skip frames")
-        col = row.column()
-        col.prop(self, "skip_frames")
-        row = layout.row()
-        row.active = self.use_frames
-        col = row.column()
-        col.label(text="Frames/key")
-        col = row.column()
-        col.prop(self, "images_per_key")            
-        
-    def execute(self, context):
-
-        del import_xyz.ALL_FRAMES[:]
-        del import_xyz.ELEMENTS[:]
-        del import_xyz.STRUCTURE[:]
-
-        # This is to determine the path.
-        filepath_xyz = bpy.path.abspath(self.filepath)
-
-        # Execute main routine
-        import_xyz.import_xyz(
-                      self.ball,
-                      self.mesh_azimuth,
-                      self.mesh_zenith,
-                      self.scale_ballradius,
-                      self.atomradius,
-                      self.scale_distances,
-                      self.use_center,
-                      self.use_center_all,
-                      self.use_camera,
-                      self.use_lamp,
-                      filepath_xyz)   
-
-        # Load frames                  
-        if len(import_xyz.ALL_FRAMES) > 1 and self.use_frames:  
-                  
-            import_xyz.build_frames(self.images_per_key, 
-                                    self.skip_frames)
-        
-        return {'FINISHED'}
-        
-
-# This is the class for the file dialog of the exporter.
-class ExportXYZ(Operator, ExportHelper):
-    bl_idname = "export_mesh.xyz"
-    bl_label  = "Export XYZ (*.xyz)"
-    filename_ext = ".xyz"
-
-    filter_glob  = StringProperty(
-        default="*.xyz", options={'HIDDEN'},)
-
-    atom_xyz_export_type = EnumProperty(
-        name="Type of Objects",
-        description="Choose type of objects",
-        items=(('0', "All", "Export all active objects"),
-               ('1', "Elements", "Export only those active objects which have"
-                                 " a proper element name")),
-               default='1',) 
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-        row.prop(self, "atom_xyz_export_type")
-
-    def execute(self, context):
-        export_xyz.export_xyz(self.atom_xyz_export_type, 
-                              bpy.path.abspath(self.filepath))
-
-        return {'FINISHED'}
-
-
-# The entry into the menu 'file -> import'
-def menu_func(self, context):
-    self.layout.operator(ImportXYZ.bl_idname, text="XYZ (.xyz)")
-
-# The entry into the menu 'file -> export'
-def menu_func_export(self, context):
-    self.layout.operator(ExportXYZ.bl_idname, text="XYZ (.xyz)")
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.INFO_MT_file_import.append(menu_func)
-    bpy.types.INFO_MT_file_export.append(menu_func_export) 
-    
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_file_import.remove(menu_func)
-    bpy.types.INFO_MT_file_export.remove(menu_func_export)
-
-if __name__ == "__main__":
-
-    register()
diff --git a/release/scripts/addons_contrib/io_mesh_xyz/atom_info.dat b/release/scripts/addons_contrib/io_mesh_xyz/atom_info.dat
deleted file mode 100644
index 5e00a5f..0000000
--- a/release/scripts/addons_contrib/io_mesh_xyz/atom_info.dat
+++ /dev/null
@@ -1,1536 +0,0 @@
-Atom
-====
-Number           : 1
-Name             : Hydrogen
-Short name       : H
-Color            : 0.99,0.99,0.99
-Radius used      : 0.320000
-Radius, covalent : 0.320000
-Radius, atomic   : 0.790000
-Charge state     : -1
-Radius, ionic    : 1.540000
-
-
-Atom
-====
-Number           : 2
-Name             : Helium
-Short name       : He
-Color            : 0.84,0.99,0.99
-Radius used      : 0.930000
-Radius, covalent : 0.930000
-Radius, atomic   : 0.490000
-
-
-Atom
-====
-Number           : 3
-Name             : Lithium
-Short name       : Li
-Color            : 0.79,0.5,0.99
-Radius used      : 1.230000
-Radius, covalent : 1.230000
-Radius, atomic   : 2.050000
-Charge state     : 1
-Radius, ionic    : 0.680000
-
-
-Atom
-====
-Number           : 4
-Name             : Beryllium
-Short name       : Be
-Color            : 0.75,0.99,0.0
-Radius used      : 0.900000
-Radius, covalent : 0.900000
-Radius, atomic   : 1.400000
-Charge state     : 1
-Radius, ionic    : 0.440000
-Charge state     : 2
-Radius, ionic    : 0.350000
-
-
-Atom
-====
-Number           : 5
-Name             : Boron
-Short name       : B
-Color            : 0.99,0.70,0.70
-Radius used      : 0.820000
-Radius, covalent : 0.820000
-Radius, atomic   : 1.170000
-Charge state     : 1
-Radius, ionic    : 0.350000
-Charge state     : 3
-Radius, ionic    : 0.230000
-
-
-Atom
-====
-Number           : 6
-Name             : Carbon
-Short name       : C
-Color            : 0.3,0.3,0.3
-Radius used      : 0.910000
-Radius, covalent : 0.770000
-Radius, atomic   : 0.910000
-Charge state     : -4
-Radius, ionic    : 2.600000
-Charge state     : 4
-Radius, ionic    : 0.160000
-
-
-Atom
-====
-Number           : 7
-Name             : Nitrogen
-Short name       : N
-Color            : 0.18,0.31,0.96
-Radius used      : 0.750000
-Radius, covalent : 0.750000
-Radius, atomic   : 0.750000
-Charge state     : -3
-Radius, ionic    : 1.710000
-Charge state     : 1
-Radius, ionic    : 0.250000
-Charge state     : 3
-Radius, ionic    : 0.160000
-Charge state     : 5
-Radius, ionic    : 0.130000
-
-
-Atom
-====
-Number           : 8
-Name             : Oxygen
-Short name       : O
-Color            : 0.99,0.05,0.05
-Radius used      : 0.730000
-Radius, covalent : 0.730000
-Radius, atomic   : 0.650000
-Charge state     : -2
-Radius, ionic    : 1.320000
-Charge state     : -1
-Radius, ionic    : 1.760000
-Charge state     : 1
-Radius, ionic    : 0.220000
-Charge state     : 6
-Radius, ionic    : 0.090000
-
-
-Atom
-====
-Number           : 9
-Name             : Fluorine
-Short name       : F
-Color            : 0.0,1.0,0.0
-Radius used      : 1.330000
-Radius, covalent : 0.720000
-Radius, atomic   : 0.570000
-Charge state     : -1
-Radius, ionic    : 1.330000
-Charge state     : 7
-Radius, ionic    : 0.080000
-
-
-Atom
-====
-Number           : 10
-Name             : Neon
-Short name       : Ne
-Color            : 0.69,0.88,0.95
-Radius used      : 0.710000
-Radius, covalent : 0.710000
-Radius, atomic   : 0.510000
-Charge state     : 1
-Radius, ionic    : 1.120000
-
-
-Atom
-====
-Number           : 11
-Name             : Sodium
-Short name       : Na
-Color            : 0.5,0.5,0.5
-Radius used      : 0.970000
-Radius, covalent : 1.540000
-Radius, atomic   : 2.230000
-Charge state     : 1
-Radius, ionic    : 0.970000
-
-
-Atom
-====
-Number           : 12
-Name             : Magnesium
-Short name       : Mg
-Color            : 0.38,0.066,1.0
-Radius used      : 0.660000
-Radius, covalent : 1.360000
-Radius, atomic   : 1.720000
-Charge state     : 1
-Radius, ionic    : 0.820000
-Charge state     : 2
-Radius, ionic    : 0.660000
-
-
-Atom
-====
-Number           : 13
-Name             : Aluminium
-Short name       : Al
-Color            : 0.74,0.64,0.64
-Radius used      : 1.180000
-Radius, covalent : 1.180000
-Radius, atomic   : 1.820000
-Charge state     : 3
-Radius, ionic    : 0.510000
-
-
-Atom
-====
-Number           : 14
-Name             : Silicon
-Short name       : Si
-Color            : 0.93,0.78,0.62
-Radius used      : 1.110000
-Radius, covalent : 1.110000
-Radius, atomic   : 1.460000
-Charge state     : -4
-Radius, ionic    : 2.710000
-Charge state     : -1
-Radius, ionic    : 3.840000
-Charge state     : 1
-Radius, ionic    : 0.650000
-Charge state     : 4
-Radius, ionic    : 0.420000
-
-
-Atom
-====
-Number           : 15
-Name             : Phosphorus
-Short name       : P
-Color            : 0.99,0.5,0.0
-Radius used      : 1.060000
-Radius, covalent : 1.060000
-Radius, atomic   : 1.230000
-Charge state     : -3
-Radius, ionic    : 2.120000
-Charge state     : 3
-Radius, ionic    : 0.440000
-Charge state     : 5
-Radius, ionic    : 0.350000
-
-
-Atom
-====
-Number           : 16
-Name             : Sulfur
-Short name       : S
-Color            : 0.99,0.99,0.18
-Radius used      : 1.020000
-Radius, covalent : 1.020000
-Radius, atomic   : 1.090000
-Charge state     : -2
-Radius, ionic    : 1.840000
-Charge state     : 2
-Radius, ionic    : 2.190000
-Charge state     : 4
-Radius, ionic    : 0.370000
-Charge state     : 6
-Radius, ionic    : 0.300000
-
-
-Atom
-====
-Number           : 17
-Name             : Chlorine
-Short name       : Cl
-Color            : 0.095,0.411,1.0
-Radius used      : 1.810000
-Radius, covalent : 0.990000
-Radius, atomic   : 0.970000
-Charge state     : -1
-Radius, ionic    : 1.810000
-Charge state     : 5
-Radius, ionic    : 0.340000
-Charge state     : 7
-Radius, ionic    : 0.270000
-
-
-Atom
-====
-Number           : 18
-Name             : Argon
-Short name       : Ar
-Color            : 0.5,0.81,0.88
-Radius used      : 0.980000
-Radius, covalent : 0.980000
-Radius, atomic   : 0.880000
-Charge state     : 1
-Radius, ionic    : 1.540000
-
-
-Atom
-====
-Number           : 19
-Name             : Potassium
-Short name       : K
-Color            : 0.55,0.25,0.82
-Radius used      : 2.030000
-Radius, covalent : 2.030000
-Radius, atomic   : 2.770000
-Charge state     : 1
-Radius, ionic    : 0.810000
-
-
-Atom
-====
-Number           : 20
-Name             : Calcium
-Short name       : Ca
-Color            : 0.23,0.99,0.0
-Radius used      : 1.740000
-Radius, covalent : 1.740000
-Radius, atomic   : 2.230000
-Charge state     : 1
-Radius, ionic    : 1.180000
-Charge state     : 2
-Radius, ionic    : 0.990000
-
-
-Atom
-====
-Number           : 21
-Name             : Scandium
-Short name       : Sc
-Color            : 0.89,0.89,0.89
-Radius used      : 1.440000
-Radius, covalent : 1.440000
-Radius, atomic   : 2.090000
-Charge state     : 3
-Radius, ionic    : 0.732000
-
-
-Atom
-====
-Number           : 22
-Name             : Titanium
-Short name       : Ti
-Color            : 0.74,0.75,0.77
-Radius used      : 1.320000
-Radius, covalent : 1.320000
-Radius, atomic   : 2.000000
-Charge state     : 1
-Radius, ionic    : 0.960000
-Charge state     : 2
-Radius, ionic    : 0.940000
-Charge state     : 3
-Radius, ionic    : 0.760000
-Charge state     : 4
-Radius, ionic    : 0.680000
-
-
-Atom
-====
-Number           : 23
-Name             : Vanadium
-Short name       : V
-Color            : 0.64,0.64,0.66
-Radius used      : 1.220000
-Radius, covalent : 1.220000
-Radius, atomic   : 1.920000
-Charge state     : 2
-Radius, ionic    : 0.880000
-Charge state     : 3
-Radius, ionic    : 0.740000
-Charge state     : 4
-Radius, ionic    : 0.630000
-Charge state     : 5
-Radius, ionic    : 0.590000
-
-
-Atom
-====
-Number           : 24
-Name             : Chromium
-Short name       : Cr
-Color            : 0.53,0.59,0.77
-Radius used      : 1.180000
-Radius, covalent : 1.180000
-Radius, atomic   : 1.850000
-Charge state     : 1
-Radius, ionic    : 0.810000
-Charge state     : 2
-Radius, ionic    : 0.890000
-Charge state     : 3
-Radius, ionic    : 0.630000
-Charge state     : 6
-Radius, ionic    : 0.520000
-
-
-Atom
-====
-Number           : 25
-Name             : Manganese
-Short name       : Mn
-Color            : 0.60,0.47,0.77
-Radius used      : 1.170000
-Radius, covalent : 1.170000
-Radius, atomic   : 1.790000
-Charge state     : 2
-Radius, ionic    : 0.800000
-Charge state     : 3
-Radius, ionic    : 0.660000
-Charge state     : 4
-Radius, ionic    : 0.600000
-Charge state     : 7
-Radius, ionic    : 0.460000
-
-
-Atom
-====
-Number           : 26
-Name             : Iron
-Short name       : Fe
-Color            : 0.87,0.39,0.19
-Radius used      : 1.170000
-Radius, covalent : 1.170000
-Radius, atomic   : 1.720000
-Charge state     : 2
-Radius, ionic    : 0.740000
-Charge state     : 3
-Radius, ionic    : 0.640000
-
-
-Atom
-====
-Number           : 27
-Name             : Cobalt
-Short name       : Co
-Color            : 0.93,0.56,0.62
-Radius used      : 1.160000
-Radius, covalent : 1.160000
-Radius, atomic   : 1.670000
-Charge state     : 2
-Radius, ionic    : 0.720000
-Charge state     : 3
-Radius, ionic    : 0.630000
-
-
-Atom
-====
-Number           : 28
-Name             : Nickel
-Short name       : Ni
-Color            : 0.31,0.81,0.31
-Radius used      : 1.150000
-Radius, covalent : 1.150000
-Radius, atomic   : 1.620000
-Charge state     : 2
-Radius, ionic    : 0.690000
-
-
-Atom
-====
-Number           : 29
-Name             : Copper
-Short name       : Cu
-Color            : 0.78,0.5,0.19
-Radius used      : 1.170000
-Radius, covalent : 1.170000
-Radius, atomic   : 1.570000
-Charge state     : 1
-Radius, ionic    : 0.960000
-Charge state     : 2
-Radius, ionic    : 0.720000
-
-
-Atom
-====
-Number           : 30
-Name             : Zinc
-Short name       : Zn
-Color            : 0.48,0.5,0.68
-Radius used      : 1.250000
-Radius, covalent : 1.250000
-Radius, atomic   : 1.530000
-Charge state     : 1
-Radius, ionic    : 0.880000
-Charge state     : 2
-Radius, ionic    : 0.740000
-
-
-Atom
-====
-Number           : 31
-Name             : Gallium
-Short name       : Ga
-Color            : 0.75,0.55,0.55
-Radius used      : 1.260000
-Radius, covalent : 1.260000
-Radius, atomic   : 1.810000
-Charge state     : 1
-Radius, ionic    : 0.810000
-Charge state     : 3
-Radius, ionic    : 0.620000
-
-
-Atom
-====
-Number           : 32
-Name             : Germanium
-Short name       : Ge
-Color            : 0.39,0.55,0.55
-Radius used      : 1.220000
-Radius, covalent : 1.220000
-Radius, atomic   : 1.520000
-Charge state     : -4
-Radius, ionic    : 2.720000
-Charge state     : 2
-Radius, ionic    : 0.730000
-Charge state     : 4
-Radius, ionic    : 0.530000
-
-
-Atom
-====
-Number           : 33
-Name             : Arsenic
-Short name       : As
-Color            : 0.73,0.5,0.88
-Radius used      : 1.200000
-Radius, covalent : 1.200000
-Radius, atomic   : 1.330000
-Charge state     : -3
-Radius, ionic    : 2.220000
-Charge state     : 3
-Radius, ionic    : 0.580000
-Charge state     : 5
-Radius, ionic    : 0.460000
-
-
-Atom
-====
-Number           : 34
-Name             : Selenium
-Short name       : Se
-Color            : 0.99,0.62,0.0
-Radius used      : 1.160000
-Radius, covalent : 1.160000
-Radius, atomic   : 1.220000
-Charge state     : -2
-Radius, ionic    : 1.910000
-Charge state     : -1
-Radius, ionic    : 2.320000
-Charge state     : 1
-Radius, ionic    : 0.660000
-Charge state     : 4
-Radius, ionic    : 0.500000
-Charge state     : 6
-Radius, ionic    : 0.420000
-
-
-Atom
-====
-Number           : 35
-Name             : Bromine
-Short name       : Br
-Color            : 0.64,0.16,0.16
-Radius used      : 1.140000
-Radius, covalent : 1.140000
-Radius, atomic   : 1.120000
-Charge state     : -1
-Radius, ionic    : 1.960000
-Charge state     : 5
-Radius, ionic    : 0.470000
-Charge state     : 7
-Radius, ionic    : 0.390000
-
-
-Atom
-====
-Number           : 36
-Name             : Krypton
-Short name       : Kr
-Color            : 0.35,0.71,0.81
-Radius used      : 1.310000
-Radius, covalent : 1.310000
-Radius, atomic   : 1.240000
-
-
-Atom
-====
-Number           : 37
-Name             : Rubidium
-Short name       : Rb
-Color            : 0.43,0.17,0.68
-Radius used      : 2.160000
-Radius, covalent : 2.160000
-Radius, atomic   : 2.980000
-Charge state     : 1
-Radius, ionic    : 1.470000
-
-
-Atom
-====
-Number           : 38
-Name             : Strontium
-Short name       : Sr
-Color            : 0.0,0.99,0.0
-Radius used      : 1.910000
-Radius, covalent : 1.910000
-Radius, atomic   : 2.450000
-Charge state     : 2
-Radius, ionic    : 1.120000
-
-
-Atom
-====
-Number           : 39
-Name             : Yttrium
-Short name       : Y
-Color            : 0.57,0.99,0.99
-Radius used      : 1.620000
-Radius, covalent : 1.620000
-Radius, atomic   : 2.270000
-Charge state     : 3
-Radius, ionic    : 0.893000
-
-
-Atom
-====
-Number           : 40
-Name             : Zirconium
-Short name       : Zr
-Color            : 0.57,0.87,0.87
-Radius used      : 1.450000
-Radius, covalent : 1.450000
-Radius, atomic   : 2.160000
-Charge state     : 1
-Radius, ionic    : 1.090000
-Charge state     : 4
-Radius, ionic    : 0.790000
-
-
-Atom
-====
-Number           : 41
-Name             : Niobium
-Short name       : Nb
-Color            : 0.44,0.75,0.78
-Radius used      : 1.340000
-Radius, covalent : 1.340000
-Radius, atomic   : 2.080000
-Charge state     : 1
-Radius, ionic    : 1.000000
-Charge state     : 4
-Radius, ionic    : 0.740000
-Charge state     : 5
-Radius, ionic    : 0.690000
-
-
-Atom
-====
-Number           : 42
-Name             : Molybdenum
-Short name       : Mo
-Color            : 0.32,0.70,0.70
-Radius used      : 1.300000
-Radius, covalent : 1.300000
-Radius, atomic   : 2.010000
-Charge state     : 1
-Radius, ionic    : 0.930000
-Charge state     : 4
-Radius, ionic    : 0.700000
-Charge state     : 6
-Radius, ionic    : 0.620000
-
-
-Atom
-====
-Number           : 43
-Name             : Technetium
-Short name       : Tc
-Color            : 0.23,0.61,0.61
-Radius used      : 1.270000
-Radius, covalent : 1.270000
-Radius, atomic   : 1.950000
-Charge state     : 7
-Radius, ionic    : 0.979000
-
-
-Atom
-====
-Number           : 44
-Name             : Ruthenium
-Short name       : Ru
-Color            : 0.14,0.55,0.55
-Radius used      : 1.250000
-Radius, covalent : 1.250000
-Radius, atomic   : 1.890000
-Charge state     : 4
-Radius, ionic    : 0.670000
-
-
-Atom
-====
-Number           : 45
-Name             : Rhodium
-Short name       : Rh
-Color            : 0.03,0.48,0.54
-Radius used      : 1.250000
-Radius, covalent : 1.250000
-Radius, atomic   : 1.830000
-Charge state     : 3
-Radius, ionic    : 0.680000
-
-
-Atom
-====
-Number           : 46
-Name             : Palladium
-Short name       : Pd
-Color            : 0.0,0.41,0.51
-Radius used      : 1.280000
-Radius, covalent : 1.280000
-Radius, atomic   : 1.790000
-Charge state     : 2
-Radius, ionic    : 0.800000
-Charge state     : 4
-Radius, ionic    : 0.650000
-
-
-Atom
-====
-Number           : 47
-Name             : Silver
-Short name       : Ag
-Color            : 0.75,0.75,0.75
-Radius used      : 1.340000
-Radius, covalent : 1.340000
-Radius, atomic   : 1.750000
-Charge state     : 1
-Radius, ionic    : 1.260000
-Charge state     : 2
-Radius, ionic    : 0.890000
-
-
-Atom
-====
-Number           : 48
-Name             : Cadmium
-Short name       : Cd
-Color            : 0.99,0.84,0.55
-Radius used      : 1.480000
-Radius, covalent : 1.480000
-Radius, atomic   : 1.710000
-Charge state     : 1
-Radius, ionic    : 1.140000
-Charge state     : 2
-Radius, ionic    : 0.970000
-
-
-Atom
-====
-Number           : 49
-Name             : Indium
-Short name       : In
-Color            : 0.64,0.45,0.44
-Radius used      : 1.440000
-Radius, covalent : 1.440000
-Radius, atomic   : 2.000000
-Charge state     : 3
-Radius, ionic    : 0.810000
-
-
-Atom
-====
-Number           : 50
-Name             : Tin
-Short name       : Sn
-Color            : 0.39,0.5,0.5
-Radius used      : 1.410000
-Radius, covalent : 1.410000
-Radius, atomic   : 1.720000
-Charge state     : -4
-Radius, ionic    : 2.940000
-Charge state     : -1
-Radius, ionic    : 3.700000
-Charge state     : 2
-Radius, ionic    : 0.930000
-Charge state     : 4
-Radius, ionic    : 0.710000
-
-
-Atom
-====
-Number           : 51
-Name             : Antimony
-Short name       : Sb
-Color            : 0.61,0.38,0.70
-Radius used      : 1.400000
-Radius, covalent : 1.400000
-Radius, atomic   : 1.530000
-Charge state     : -3
-Radius, ionic    : 2.450000
-Charge state     : 3
-Radius, ionic    : 0.760000
-Charge state     : 5
-Radius, ionic    : 0.620000
-
-
-Atom
-====
-Number           : 52
-Name             : Tellurium
-Short name       : Te
-Color            : 0.82,0.47,0.0
-Radius used      : 1.360000
-Radius, covalent : 1.360000
-Radius, atomic   : 1.420000
-Charge state     : -2
-Radius, ionic    : 2.110000
-Charge state     : -1
-Radius, ionic    : 2.500000
-Charge state     : 1
-Radius, ionic    : 0.820000
-Charge state     : 4
-Radius, ionic    : 0.700000
-Charge state     : 6
-Radius, ionic    : 0.560000
-
-
-Atom
-====
-Number           : 53
-Name             : Iodine
-Short name       : I
-Color            : 0.57,0.0,0.57
-Radius used      : 1.330000
-Radius, covalent : 1.330000
-Radius, atomic   : 1.320000
-Charge state     : -1
-Radius, ionic    : 2.200000
-Charge state     : 5
-Radius, ionic    : 0.620000
-Charge state     : 7
-Radius, ionic    : 0.500000
-
-
-Atom
-====
-Number           : 54
-Name             : Xenon
-Short name       : Xe
-Color            : 0.25,0.61,0.68
-Radius used      : 1.310000
-Radius, covalent : 1.310000
-Radius, atomic   : 1.240000
-
-
-Atom
-====
-Number           : 55
-Name             : Caesium
-Short name       : Cs
-Color            : 0.33,0.08,0.55
-Radius used      : 2.350000
-Radius, covalent : 2.350000
-Radius, atomic   : 3.350000
-Charge state     : 1
-Radius, ionic    : 1.670000
-
-
-Atom
-====
-Number           : 56
-Name             : Barium
-Short name       : Ba
-Color            : 0.0,0.78,0.0
-Radius used      : 1.980000
-Radius, covalent : 1.980000
-Radius, atomic   : 2.780000
-Charge state     : 1
-Radius, ionic    : 1.530000
-Charge state     : 2
-Radius, ionic    : 1.340000
-
-
-Atom
-====
-Number           : 57
-Name             : Lanthanum
-Short name       : La
-Color            : 0.43,0.82,0.99
-Radius used      : 1.690000
-Radius, covalent : 1.690000
-Radius, atomic   : 2.740000
-Charge state     : 1
-Radius, ionic    : 1.390000
-Charge state     : 3
-Radius, ionic    : 1.061000
-
-
-Atom
-====
-Number           : 58
-Name             : Cerium
-Short name       : Ce
-Color            : 0.99,0.99,0.77
-Radius used      : 1.650000
-Radius, covalent : 1.650000
-Radius, atomic   : 2.700000
-Charge state     : 1
-Radius, ionic    : 1.270000
-Charge state     : 3
-Radius, ionic    : 1.034000
-Charge state     : 4
-Radius, ionic    : 0.920000
-
-
-Atom
-====
-Number           : 59
-Name             : Praseodymium
-Short name       : Pr
-Color            : 0.84,0.99,0.77
-Radius used      : 1.650000
-Radius, covalent : 1.650000
-Radius, atomic   : 2.670000
-Charge state     : 3
-Radius, ionic    : 1.013000
-Charge state     : 4
-Radius, ionic    : 0.900000
-
-
-Atom
-====
-Number           : 60
-Name             : Neodymium
-Short name       : Nd
-Color            : 0.77,0.99,0.77
-Radius used      : 1.640000
-Radius, covalent : 1.640000
-Radius, atomic   : 2.640000
-Charge state     : 3
-Radius, ionic    : 0.995000
-
-
-Atom
-====
-Number           : 61
-Name             : Promethium
-Short name       : Pm
-Color            : 0.63,0.99,0.77
-Radius used      : 1.630000
-Radius, covalent : 1.630000
-Radius, atomic   : 2.620000
-Charge state     : 3
-Radius, ionic    : 0.979000
-
-
-Atom
-====
-Number           : 62
-Name             : Samarium
-Short name       : Sm
-Color            : 0.55,0.99,0.77
-Radius used      : 1.620000
-Radius, covalent : 1.620000
-Radius, atomic   : 2.590000
-Charge state     : 3
-Radius, ionic    : 0.964000
-
-
-Atom
-====
-Number           : 63
-Name             : Europium
-Short name       : Eu
-Color            : 0.37,0.99,0.77
-Radius used      : 1.850000
-Radius, covalent : 1.850000
-Radius, atomic   : 2.560000
-Charge state     : 2
-Radius, ionic    : 1.090000
-Charge state     : 3
-Radius, ionic    : 0.950000
-
-
-Atom
-====
-Number           : 64
-Name             : Gadolinium
-Short name       : Gd
-Color            : 0.26,0.99,0.77
-Radius used      : 1.610000
-Radius, covalent : 1.610000
-Radius, atomic   : 2.540000
-Charge state     : 3
-Radius, ionic    : 0.938000
-
-
-Atom
-====
-Number           : 65
-Name             : Terbium
-Short name       : Tb
-Color            : 0.18,0.99,0.77
-Radius used      : 1.590000
-Radius, covalent : 1.590000
-Radius, atomic   : 2.510000
-Charge state     : 3
-Radius, ionic    : 0.923000
-Charge state     : 4
-Radius, ionic    : 0.840000
-
-
-Atom
-====
-Number           : 66
-Name             : Dysprosium
-Short name       : Dy
-Color            : 0.12,0.99,0.77
-Radius used      : 1.590000
-Radius, covalent : 1.590000
-Radius, atomic   : 2.490000
-Charge state     : 3
-Radius, ionic    : 0.908000
-
-
-Atom
-====
-Number           : 67
-Name             : Holmium
-Short name       : Ho
-Color            : 0.0,0.99,0.60
-Radius used      : 1.580000
-Radius, covalent : 1.580000
-Radius, atomic   : 2.470000
-Charge state     : 3
-Radius, ionic    : 0.894000
-
-
-Atom
-====
-Number           : 68
-Name             : Erbium
-Short name       : Er
-Color            : 0.0,0.89,0.45
-Radius used      : 1.570000
-Radius, covalent : 1.570000
-Radius, atomic   : 2.450000
-Charge state     : 3
-Radius, ionic    : 0.881000
-
-
-Atom
-====
-Number           : 69
-Name             : Thulium
-Short name       : Tm
-Color            : 0.0,0.82,0.32
-Radius used      : 1.560000
-Radius, covalent : 1.560000
-Radius, atomic   : 2.420000
-Charge state     : 3
-Radius, ionic    : 0.870000
-
-
-Atom
-====
-Number           : 70
-Name             : Ytterbium
-Short name       : Yb
-Color            : 0.0,0.74,0.21
-Radius used      : 1.740000
-Radius, covalent : 1.740000
-Radius, atomic   : 2.400000
-Charge state     : 2
-Radius, ionic    : 0.930000
-Charge state     : 3
-Radius, ionic    : 0.858000
-
-
-Atom
-====
-Number           : 71
-Name             : Lutetium
-Short name       : Lu
-Color            : 0.0,0.66,0.14
-Radius used      : 1.560000
-Radius, covalent : 1.560000
-Radius, atomic   : 2.250000
-Charge state     : 3
-Radius, ionic    : 0.850000
-
-
-Atom
-====
-Number           : 72
-Name             : Hafnium
-Short name       : Hf
-Color            : 0.30,0.75,0.99
-Radius used      : 1.440000
-Radius, covalent : 1.440000
-Radius, atomic   : 2.160000
-Charge state     : 4
-Radius, ionic    : 0.780000
-
-
-Atom
-====
-Number           : 73
-Name             : Tantalum
-Short name       : Ta
-Color            : 0.30,0.64,0.99
-Radius used      : 1.340000
-Radius, covalent : 1.340000
-Radius, atomic   : 2.090000
-Charge state     : 5
-Radius, ionic    : 0.680000
-
-
-Atom
-====
-Number           : 74
-Name             : Tungsten
-Short name       : W
-Color            : 0.12,0.57,0.83
-Radius used      : 1.300000
-Radius, covalent : 1.300000
-Radius, atomic   : 2.020000
-Charge state     : 4
-Radius, ionic    : 0.700000
-Charge state     : 6
-Radius, ionic    : 0.620000
-
-
-Atom
-====
-Number           : 75
-Name             : Rhenium
-Short name       : Re
-Color            : 0.14,0.48,0.66
-Radius used      : 1.280000
-Radius, covalent : 1.280000
-Radius, atomic   : 1.970000
-Charge state     : 4
-Radius, ionic    : 0.720000
-Charge state     : 7
-Radius, ionic    : 0.560000
-
-
-Atom
-====
-Number           : 76
-Name             : Osmium
-Short name       : Os
-Color            : 0.14,0.39,0.58
-Radius used      : 1.260000
-Radius, covalent : 1.260000
-Radius, atomic   : 1.920000
-Charge state     : 4
-Radius, ionic    : 0.880000
-Charge state     : 6
-Radius, ionic    : 0.690000
-
-
-Atom
-====
-Number           : 77
-Name             : Iridium
-Short name       : Ir
-Color            : 0.08,0.32,0.52
-Radius used      : 1.270000
-Radius, covalent : 1.270000
-Radius, atomic   : 1.870000
-Charge state     : 4
-Radius, ionic    : 0.680000
-
-
-Atom
-====
-Number           : 78
-Name             : Platinium
-Short name       : Pt
-Color            : 0.81,0.81,0.87
-Radius used      : 1.300000
-Radius, covalent : 1.300000
-Radius, atomic   : 1.830000
-Charge state     : 2
-Radius, ionic    : 0.800000
-Charge state     : 4
-Radius, ionic    : 0.650000
-
-
-Atom
-====
-Number           : 79
-Name             : Gold
-Short name       : Au
-Color            : 0.99,0.81,0.13
-Radius used      : 1.340000
-Radius, covalent : 1.340000
-Radius, atomic   : 1.790000
-Charge state     : 1
-Radius, ionic    : 1.370000
-Charge state     : 3
-Radius, ionic    : 0.850000
-
-
-Atom
-====
-Number           : 80
-Name             : Mercury
-Short name       : Hg
-Color            : 0.71,0.71,0.81
-Radius used      : 1.490000
-Radius, covalent : 1.490000
-Radius, atomic   : 1.760000
-Charge state     : 1
-Radius, ionic    : 1.270000
-Charge state     : 2
-Radius, ionic    : 1.100000
-
-
-Atom
-====
-Number           : 81
-Name             : Thallium
-Short name       : Tl
-Color            : 0.64,0.32,0.30
-Radius used      : 1.480000
-Radius, covalent : 1.480000
-Radius, atomic   : 2.080000
-Charge state     : 1
-Radius, ionic    : 1.470000
-Charge state     : 3
-Radius, ionic    : 0.950000
-
-
-Atom
-====
-Number           : 82
-Name             : Lead
-Short name       : Pb
-Color            : 0.33,0.34,0.37
-Radius used      : 1.470000
-Radius, covalent : 1.470000
-Radius, atomic   : 1.810000
-Charge state     : 2
-Radius, ionic    : 1.200000
-Charge state     : 4
-Radius, ionic    : 0.840000
-
-
-Atom
-====
-Number           : 83
-Name             : Bismuth
-Short name       : Bi
-Color            : 0.61,0.30,0.70
-Radius used      : 1.460000
-Radius, covalent : 1.460000
-Radius, atomic   : 1.630000
-Charge state     : 1
-Radius, ionic    : 0.980000
-Charge state     : 3
-Radius, ionic    : 0.960000
-Charge state     : 5
-Radius, ionic    : 0.740000
-
-
-Atom
-====
-Number           : 84
-Name             : Polonium
-Short name       : Po
-Color            : 0.66,0.35,0.0
-Radius used      : 1.460000
-Radius, covalent : 1.460000
-Radius, atomic   : 1.530000
-Charge state     : 6
-Radius, ionic    : 0.670000
-
-
-Atom
-====
-Number           : 85
-Name             : Astatine
-Short name       : At
-Color            : 0.45,0.30,0.26
-Radius used      : 1.450000
-Radius, covalent : 1.450000
-Radius, atomic   : 1.430000
-Charge state     : -3
-Radius, ionic    : 2.220000
-Charge state     : 3
-Radius, ionic    : 0.850000
-Charge state     : 5
-Radius, ionic    : 0.460000
-
-
-Atom
-====
-Number           : 86
-Name             : Radon
-Short name       : Rn
-Color            : 0.25,0.50,0.58
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.340000
-
-
-Atom
-====
-Number           : 87
-Name             : Francium
-Short name       : Fr
-Color            : 0.25,0.0,0.39
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-Charge state     : 1
-Radius, ionic    : 1.800000
-
-
-Atom
-====
-Number           : 88
-Name             : Radium
-Short name       : Ra
-Color            : 0.0,0.48,0.0
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-Charge state     : 2
-Radius, ionic    : 1.430000
-
-
-Atom
-====
-Number           : 89
-Name             : Actinium
-Short name       : Ac
-Color            : 0.43,0.66,0.97
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-Charge state     : 3
-Radius, ionic    : 1.180000
-
-
-Atom
-====
-Number           : 90
-Name             : Thorium
-Short name       : Th
-Color            : 0.0,0.72,0.99
-Radius used      : 1.650000
-Radius, covalent : 1.650000
-Radius, atomic   : 1.000000
-Charge state     : 4
-Radius, ionic    : 1.020000
-
-
-Atom
-====
-Number           : 91
-Name             : Protactinium
-Short name       : Pa
-Color            : 0.0,0.62,0.99
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-Charge state     : 3
-Radius, ionic    : 1.130000
-Charge state     : 4
-Radius, ionic    : 0.980000
-Charge state     : 5
-Radius, ionic    : 0.890000
-
-
-Atom
-====
-Number           : 92
-Name             : Uranium
-Short name       : U
-Color            : 0.0,0.55,0.99
-Radius used      : 1.420000
-Radius, covalent : 1.420000
-Radius, atomic   : 1.000000
-Charge state     : 4
-Radius, ionic    : 0.970000
-Charge state     : 6
-Radius, ionic    : 0.800000
-
-
-Atom
-====
-Number           : 93
-Name             : Neptunium
-Short name       : Np
-Color            : 0.0,0.5,0.99
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-Charge state     : 3
-Radius, ionic    : 1.100000
-Charge state     : 4
-Radius, ionic    : 0.950000
-Charge state     : 7
-Radius, ionic    : 0.710000
-
-
-Atom
-====
-Number           : 94
-Name             : Plutonium
-Short name       : Pu
-Color            : 0.0,0.41,0.99
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-Charge state     : 3
-Radius, ionic    : 1.080000
-Charge state     : 4
-Radius, ionic    : 0.930000
-
-
-Atom
-====
-Number           : 95
-Name             : Americium
-Short name       : Am
-Color            : 0.32,0.35,0.94
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-Charge state     : 3
-Radius, ionic    : 1.070000
-Charge state     : 4
-Radius, ionic    : 0.920000
-
-
-Atom
-====
-Number           : 96
-Name             : Curium
-Short name       : Cm
-Color            : 0.46,0.35,0.88
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 97
-Name             : Berkelium
-Short name       : Bk
-Color            : 0.53,0.30,0.88
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 98
-Name             : Californium
-Short name       : Cf
-Color            : 0.62,0.21,0.82
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 99
-Name             : Einsteinium
-Short name       : Es
-Color            : 0.69,0.12,0.82
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 100
-Name             : Fermium
-Short name       : Fm
-Color            : 0.69,0.12,0.72
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 101
-Name             : Mendelevium
-Short name       : Md
-Color            : 0.69,0.05,0.64
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 102
-Name             : Nobelium
-Short name       : No
-Color            : 0.73,0.05,0.52
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 103
-Name             : Lawrencium
-Short name       : Lr
-Color            : 0.77,0.0,0.39
-Radius used      : 1.000000
-Radius, covalent : 1.000000
-Radius, atomic   : 1.000000
-
-
-Atom
-====
-Number           : 104
-Name             : Vacancy
-Short name       : Vac
-Color            : 0.5,0.5,0.5
-Radius used      : 1.2
-Radius, covalent : 1.0
-Radius, atomic   : 1.0
-
-
-Atom
-====
-Number           : 105
-Name             : Default
-Short name       : Default
-Color            : 0.5,0.5,0.5
-Radius used      : 1.0
-Radius, covalent : 1.0
-Radius, atomic   : 1.0
-
-
-Atom
-====
-Number           : 106
-Name             : Stick
-Short name       : Stick
-Color            : 0.5,0.5,0.5
-Radius used      : 1.0
-Radius, covalent : 1.0
-Radius, atomic   : 1.0
diff --git a/release/scripts/addons_contrib/io_mesh_xyz/export_xyz.py b/release/scripts/addons_contrib/io_mesh_xyz/export_xyz.py
deleted file mode 100644
index 093d6e9..0000000
--- a/release/scripts/addons_contrib/io_mesh_xyz/export_xyz.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-from . import import_xyz
-
-
-class AtomsExport(object):  
-    __slots__ = ('element', 'location')
-    def __init__(self, element, location):
-        self.element  = element
-        self.location = location
-
-
-def export_xyz(obj_type, filepath_xyz):
-
-    list_atoms = []
-    counter = 0
-    for obj in bpy.context.selected_objects:
-    
-        if "Stick" in obj.name:
-            continue
-            
-        if obj.type not in {'MESH', 'SURFACE', 'META'}:
-            continue 
-       
-        name = ""
-        for element in import_xyz.ELEMENTS_DEFAULT:
-            if element[1] in obj.name:
-                if element[2] == "Vac":
-                    name = "X"
-                else:
-                    name = element[2]
-        
-        if name == "":
-            if obj_type == "0":
-                name = "?"
-            else:
-                continue
-
-        if len(obj.children) != 0:
-            for vertex in obj.data.vertices:
-                location = obj.matrix_world*vertex.co
-                list_atoms.append(AtomsExport(name, location))
-                counter += 1                                       
-        else:
-            if not obj.parent:
-                location = obj.location
-                list_atoms.append(AtomsExport(name, location))                                   
-                counter += 1                                               
-
-    xyz_file_p = open(filepath_xyz, "w")
-    xyz_file_p.write("%d\n" % counter)
-    xyz_file_p.write("This XYZ file has been created with Blender "
-                     "and the addon Atomic Blender - XYZ. "
-                     "For more details see: wiki.blender.org/index.php/"
-                     "Extensions:2.6/Py/Scripts/Import-Export/XYZ\n")
-
-    for i, atom in enumerate(list_atoms):
-        string = "%3s%15.5f%15.5f%15.5f\n" % (
-                                      atom.element,
-                                      atom.location[0],
-                                      atom.location[1],
-                                      atom.location[2])
-        xyz_file_p.write(string)
-
-    xyz_file_p.close()
-
-    return True
-
diff --git a/release/scripts/addons_contrib/io_mesh_xyz/import_xyz.py b/release/scripts/addons_contrib/io_mesh_xyz/import_xyz.py
deleted file mode 100644
index 9a575f2..0000000
--- a/release/scripts/addons_contrib/io_mesh_xyz/import_xyz.py
+++ /dev/null
@@ -1,739 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-from math import pi, sqrt
-from mathutils import Vector, Matrix
-
-# -----------------------------------------------------------------------------
-#                                                  Atom and element data
-
-
-# This is a list that contains some data of all possible elements. The structure
-# is as follows:
-#
-# 1, "Hydrogen", "H", [0.0,0.0,1.0], 0.32, 0.32, 0.32 , -1 , 1.54   means
-#
-# No., name, short name, color, radius (used), radius (covalent), radius (atomic),
-#
-# charge state 1, radius (ionic) 1, charge state 2, radius (ionic) 2, ... all
-# charge states for any atom are listed, if existing.
-# The list is fixed and cannot be changed ... (see below)
-
-ELEMENTS_DEFAULT = (
-( 1,      "Hydrogen",        "H", (  1.0,   1.0,   1.0), 0.32, 0.32, 0.79 , -1 , 1.54 ),
-( 2,        "Helium",       "He", ( 0.85,   1.0,   1.0), 0.93, 0.93, 0.49 ),
-( 3,       "Lithium",       "Li", (  0.8,  0.50,   1.0), 1.23, 1.23, 2.05 ,  1 , 0.68 ),
-( 4,     "Beryllium",       "Be", ( 0.76,   1.0,   0.0), 0.90, 0.90, 1.40 ,  1 , 0.44 ,  2 , 0.35 ),
-( 5,         "Boron",        "B", (  1.0,  0.70,  0.70), 0.82, 0.82, 1.17 ,  1 , 0.35 ,  3 , 0.23 ),
-( 6,        "Carbon",        "C", ( 0.56,  0.56,  0.56), 0.77, 0.77, 0.91 , -4 , 2.60 ,  4 , 0.16 ),
-( 7,      "Nitrogen",        "N", ( 0.18,  0.31,  0.97), 0.75, 0.75, 0.75 , -3 , 1.71 ,  1 , 0.25 ,  3 , 0.16 ,  5 , 0.13 ),
-( 8,        "Oxygen",        "O", (  1.0,  0.05,  0.05), 0.73, 0.73, 0.65 , -2 , 1.32 , -1 , 1.76 ,  1 , 0.22 ,  6 , 0.09 ),
-( 9,      "Fluorine",        "F", ( 0.56,  0.87,  0.31), 0.72, 0.72, 0.57 , -1 , 1.33 ,  7 , 0.08 ),
-(10,          "Neon",       "Ne", ( 0.70,  0.89,  0.96), 0.71, 0.71, 0.51 ,  1 , 1.12 ),
-(11,        "Sodium",       "Na", ( 0.67,  0.36,  0.94), 1.54, 1.54, 2.23 ,  1 , 0.97 ),
-(12,     "Magnesium",       "Mg", ( 0.54,   1.0,   0.0), 1.36, 1.36, 1.72 ,  1 , 0.82 ,  2 , 0.66 ),
-(13,     "Aluminium",       "Al", ( 0.74,  0.65,  0.65), 1.18, 1.18, 1.82 ,  3 , 0.51 ),
-(14,       "Silicon",       "Si", ( 0.94,  0.78,  0.62), 1.11, 1.11, 1.46 , -4 , 2.71 , -1 , 3.84 ,  1 , 0.65 ,  4 , 0.42 ),
-(15,    "Phosphorus",        "P", (  1.0,  0.50,   0.0), 1.06, 1.06, 1.23 , -3 , 2.12 ,  3 , 0.44 ,  5 , 0.35 ),
-(16,        "Sulfur",        "S", (  1.0,   1.0,  0.18), 1.02, 1.02, 1.09 , -2 , 1.84 ,  2 , 2.19 ,  4 , 0.37 ,  6 , 0.30 ),
-(17,      "Chlorine",       "Cl", ( 0.12,  0.94,  0.12), 0.99, 0.99, 0.97 , -1 , 1.81 ,  5 , 0.34 ,  7 , 0.27 ),
-(18,         "Argon",       "Ar", ( 0.50,  0.81,  0.89), 0.98, 0.98, 0.88 ,  1 , 1.54 ),
-(19,     "Potassium",        "K", ( 0.56,  0.25,  0.83), 2.03, 2.03, 2.77 ,  1 , 0.81 ),
-(20,       "Calcium",       "Ca", ( 0.23,   1.0,   0.0), 1.74, 1.74, 2.23 ,  1 , 1.18 ,  2 , 0.99 ),
-(21,      "Scandium",       "Sc", ( 0.90,  0.90,  0.90), 1.44, 1.44, 2.09 ,  3 , 0.73 ),
-(22,      "Titanium",       "Ti", ( 0.74,  0.76,  0.78), 1.32, 1.32, 2.00 ,  1 , 0.96 ,  2 , 0.94 ,  3 , 0.76 ,  4 , 0.68 ),
-(23,      "Vanadium",        "V", ( 0.65,  0.65,  0.67), 1.22, 1.22, 1.92 ,  2 , 0.88 ,  3 , 0.74 ,  4 , 0.63 ,  5 , 0.59 ),
-(24,      "Chromium",       "Cr", ( 0.54,   0.6,  0.78), 1.18, 1.18, 1.85 ,  1 , 0.81 ,  2 , 0.89 ,  3 , 0.63 ,  6 , 0.52 ),
-(25,     "Manganese",       "Mn", ( 0.61,  0.47,  0.78), 1.17, 1.17, 1.79 ,  2 , 0.80 ,  3 , 0.66 ,  4 , 0.60 ,  7 , 0.46 ),
-(26,          "Iron",       "Fe", ( 0.87,   0.4,   0.2), 1.17, 1.17, 1.72 ,  2 , 0.74 ,  3 , 0.64 ),
-(27,        "Cobalt",       "Co", ( 0.94,  0.56,  0.62), 1.16, 1.16, 1.67 ,  2 , 0.72 ,  3 , 0.63 ),
-(28,        "Nickel",       "Ni", ( 0.31,  0.81,  0.31), 1.15, 1.15, 1.62 ,  2 , 0.69 ),
-(29,        "Copper",       "Cu", ( 0.78,  0.50,   0.2), 1.17, 1.17, 1.57 ,  1 , 0.96 ,  2 , 0.72 ),
-(30,          "Zinc",       "Zn", ( 0.49,  0.50,  0.69), 1.25, 1.25, 1.53 ,  1 , 0.88 ,  2 , 0.74 ),
-(31,       "Gallium",       "Ga", ( 0.76,  0.56,  0.56), 1.26, 1.26, 1.81 ,  1 , 0.81 ,  3 , 0.62 ),
-(32,     "Germanium",       "Ge", (  0.4,  0.56,  0.56), 1.22, 1.22, 1.52 , -4 , 2.72 ,  2 , 0.73 ,  4 , 0.53 ),
-(33,       "Arsenic",       "As", ( 0.74,  0.50,  0.89), 1.20, 1.20, 1.33 , -3 , 2.22 ,  3 , 0.58 ,  5 , 0.46 ),
-(34,      "Selenium",       "Se", (  1.0,  0.63,   0.0), 1.16, 1.16, 1.22 , -2 , 1.91 , -1 , 2.32 ,  1 , 0.66 ,  4 , 0.50 ,  6 , 0.42 ),
-(35,       "Bromine",       "Br", ( 0.65,  0.16,  0.16), 1.14, 1.14, 1.12 , -1 , 1.96 ,  5 , 0.47 ,  7 , 0.39 ),
-(36,       "Krypton",       "Kr", ( 0.36,  0.72,  0.81), 1.31, 1.31, 1.24 ),
-(37,      "Rubidium",       "Rb", ( 0.43,  0.18,  0.69), 2.16, 2.16, 2.98 ,  1 , 1.47 ),
-(38,     "Strontium",       "Sr", (  0.0,   1.0,   0.0), 1.91, 1.91, 2.45 ,  2 , 1.12 ),
-(39,       "Yttrium",        "Y", ( 0.58,   1.0,   1.0), 1.62, 1.62, 2.27 ,  3 , 0.89 ),
-(40,     "Zirconium",       "Zr", ( 0.58,  0.87,  0.87), 1.45, 1.45, 2.16 ,  1 , 1.09 ,  4 , 0.79 ),
-(41,       "Niobium",       "Nb", ( 0.45,  0.76,  0.78), 1.34, 1.34, 2.08 ,  1 , 1.00 ,  4 , 0.74 ,  5 , 0.69 ),
-(42,    "Molybdenum",       "Mo", ( 0.32,  0.70,  0.70), 1.30, 1.30, 2.01 ,  1 , 0.93 ,  4 , 0.70 ,  6 , 0.62 ),
-(43,    "Technetium",       "Tc", ( 0.23,  0.61,  0.61), 1.27, 1.27, 1.95 ,  7 , 0.97 ),
-(44,     "Ruthenium",       "Ru", ( 0.14,  0.56,  0.56), 1.25, 1.25, 1.89 ,  4 , 0.67 ),
-(45,       "Rhodium",       "Rh", ( 0.03,  0.49,  0.54), 1.25, 1.25, 1.83 ,  3 , 0.68 ),
-(46,     "Palladium",       "Pd", (  0.0,  0.41,  0.52), 1.28, 1.28, 1.79 ,  2 , 0.80 ,  4 , 0.65 ),
-(47,        "Silver",       "Ag", ( 0.75,  0.75,  0.75), 1.34, 1.34, 1.75 ,  1 , 1.26 ,  2 , 0.89 ),
-(48,       "Cadmium",       "Cd", (  1.0,  0.85,  0.56), 1.48, 1.48, 1.71 ,  1 , 1.14 ,  2 , 0.97 ),
-(49,        "Indium",       "In", ( 0.65,  0.45,  0.45), 1.44, 1.44, 2.00 ,  3 , 0.81 ),
-(50,           "Tin",       "Sn", (  0.4,  0.50,  0.50), 1.41, 1.41, 1.72 , -4 , 2.94 , -1 , 3.70 ,  2 , 0.93 ,  4 , 0.71 ),
-(51,      "Antimony",       "Sb", ( 0.61,  0.38,  0.70), 1.40, 1.40, 1.53 , -3 , 2.45 ,  3 , 0.76 ,  5 , 0.62 ),
-(52,     "Tellurium",       "Te", ( 0.83,  0.47,   0.0), 1.36, 1.36, 1.42 , -2 , 2.11 , -1 , 2.50 ,  1 , 0.82 ,  4 , 0.70 ,  6 , 0.56 ),
-(53,        "Iodine",        "I", ( 0.58,   0.0,  0.58), 1.33, 1.33, 1.32 , -1 , 2.20 ,  5 , 0.62 ,  7 , 0.50 ),
-(54,         "Xenon",       "Xe", ( 0.25,  0.61,  0.69), 1.31, 1.31, 1.24 ),
-(55,       "Caesium",       "Cs", ( 0.34,  0.09,  0.56), 2.35, 2.35, 3.35 ,  1 , 1.67 ),
-(56,        "Barium",       "Ba", (  0.0,  0.78,   0.0), 1.98, 1.98, 2.78 ,  1 , 1.53 ,  2 , 1.34 ),
-(57,     "Lanthanum",       "La", ( 0.43,  0.83,   1.0), 1.69, 1.69, 2.74 ,  1 , 1.39 ,  3 , 1.06 ),
-(58,        "Cerium",       "Ce", (  1.0,   1.0,  0.78), 1.65, 1.65, 2.70 ,  1 , 1.27 ,  3 , 1.03 ,  4 , 0.92 ),
-(59,  "Praseodymium",       "Pr", ( 0.85,   1.0,  0.78), 1.65, 1.65, 2.67 ,  3 , 1.01 ,  4 , 0.90 ),
-(60,     "Neodymium",       "Nd", ( 0.78,   1.0,  0.78), 1.64, 1.64, 2.64 ,  3 , 0.99 ),
-(61,    "Promethium",       "Pm", ( 0.63,   1.0,  0.78), 1.63, 1.63, 2.62 ,  3 , 0.97 ),
-(62,      "Samarium",       "Sm", ( 0.56,   1.0,  0.78), 1.62, 1.62, 2.59 ,  3 , 0.96 ),
-(63,      "Europium",       "Eu", ( 0.38,   1.0,  0.78), 1.85, 1.85, 2.56 ,  2 , 1.09 ,  3 , 0.95 ),
-(64,    "Gadolinium",       "Gd", ( 0.27,   1.0,  0.78), 1.61, 1.61, 2.54 ,  3 , 0.93 ),
-(65,       "Terbium",       "Tb", ( 0.18,   1.0,  0.78), 1.59, 1.59, 2.51 ,  3 , 0.92 ,  4 , 0.84 ),
-(66,    "Dysprosium",       "Dy", ( 0.12,   1.0,  0.78), 1.59, 1.59, 2.49 ,  3 , 0.90 ),
-(67,       "Holmium",       "Ho", (  0.0,   1.0,  0.61), 1.58, 1.58, 2.47 ,  3 , 0.89 ),
-(68,        "Erbium",       "Er", (  0.0,  0.90,  0.45), 1.57, 1.57, 2.45 ,  3 , 0.88 ),
-(69,       "Thulium",       "Tm", (  0.0,  0.83,  0.32), 1.56, 1.56, 2.42 ,  3 , 0.87 ),
-(70,     "Ytterbium",       "Yb", (  0.0,  0.74,  0.21), 1.74, 1.74, 2.40 ,  2 , 0.93 ,  3 , 0.85 ),
-(71,      "Lutetium",       "Lu", (  0.0,  0.67,  0.14), 1.56, 1.56, 2.25 ,  3 , 0.85 ),
-(72,       "Hafnium",       "Hf", ( 0.30,  0.76,   1.0), 1.44, 1.44, 2.16 ,  4 , 0.78 ),
-(73,      "Tantalum",       "Ta", ( 0.30,  0.65,   1.0), 1.34, 1.34, 2.09 ,  5 , 0.68 ),
-(74,      "Tungsten",        "W", ( 0.12,  0.58,  0.83), 1.30, 1.30, 2.02 ,  4 , 0.70 ,  6 , 0.62 ),
-(75,       "Rhenium",       "Re", ( 0.14,  0.49,  0.67), 1.28, 1.28, 1.97 ,  4 , 0.72 ,  7 , 0.56 ),
-(76,        "Osmium",       "Os", ( 0.14,   0.4,  0.58), 1.26, 1.26, 1.92 ,  4 , 0.88 ,  6 , 0.69 ),
-(77,       "Iridium",       "Ir", ( 0.09,  0.32,  0.52), 1.27, 1.27, 1.87 ,  4 , 0.68 ),
-(78,     "Platinium",       "Pt", ( 0.81,  0.81,  0.87), 1.30, 1.30, 1.83 ,  2 , 0.80 ,  4 , 0.65 ),
-(79,          "Gold",       "Au", (  1.0,  0.81,  0.13), 1.34, 1.34, 1.79 ,  1 , 1.37 ,  3 , 0.85 ),
-(80,       "Mercury",       "Hg", ( 0.72,  0.72,  0.81), 1.49, 1.49, 1.76 ,  1 , 1.27 ,  2 , 1.10 ),
-(81,      "Thallium",       "Tl", ( 0.65,  0.32,  0.30), 1.48, 1.48, 2.08 ,  1 , 1.47 ,  3 , 0.95 ),
-(82,          "Lead",       "Pb", ( 0.34,  0.34,  0.38), 1.47, 1.47, 1.81 ,  2 , 1.20 ,  4 , 0.84 ),
-(83,       "Bismuth",       "Bi", ( 0.61,  0.30,  0.70), 1.46, 1.46, 1.63 ,  1 , 0.98 ,  3 , 0.96 ,  5 , 0.74 ),
-(84,      "Polonium",       "Po", ( 0.67,  0.36,   0.0), 1.46, 1.46, 1.53 ,  6 , 0.67 ),
-(85,      "Astatine",       "At", ( 0.45,  0.30,  0.27), 1.45, 1.45, 1.43 , -3 , 2.22 ,  3 , 0.85 ,  5 , 0.46 ),
-(86,         "Radon",       "Rn", ( 0.25,  0.50,  0.58), 1.00, 1.00, 1.34 ),
-(87,      "Francium",       "Fr", ( 0.25,   0.0,   0.4), 1.00, 1.00, 1.00 ,  1 , 1.80 ),
-(88,        "Radium",       "Ra", (  0.0,  0.49,   0.0), 1.00, 1.00, 1.00 ,  2 , 1.43 ),
-(89,      "Actinium",       "Ac", ( 0.43,  0.67,  0.98), 1.00, 1.00, 1.00 ,  3 , 1.18 ),
-(90,       "Thorium",       "Th", (  0.0,  0.72,   1.0), 1.65, 1.65, 1.00 ,  4 , 1.02 ),
-(91,  "Protactinium",       "Pa", (  0.0,  0.63,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.13 ,  4 , 0.98 ,  5 , 0.89 ),
-(92,       "Uranium",        "U", (  0.0,  0.56,   1.0), 1.42, 1.42, 1.00 ,  4 , 0.97 ,  6 , 0.80 ),
-(93,     "Neptunium",       "Np", (  0.0,  0.50,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.10 ,  4 , 0.95 ,  7 , 0.71 ),
-(94,     "Plutonium",       "Pu", (  0.0,  0.41,   1.0), 1.00, 1.00, 1.00 ,  3 , 1.08 ,  4 , 0.93 ),
-(95,     "Americium",       "Am", ( 0.32,  0.36,  0.94), 1.00, 1.00, 1.00 ,  3 , 1.07 ,  4 , 0.92 ),
-(96,        "Curium",       "Cm", ( 0.47,  0.36,  0.89), 1.00, 1.00, 1.00 ),
-(97,     "Berkelium",       "Bk", ( 0.54,  0.30,  0.89), 1.00, 1.00, 1.00 ),
-(98,   "Californium",       "Cf", ( 0.63,  0.21,  0.83), 1.00, 1.00, 1.00 ),
-(99,   "Einsteinium",       "Es", ( 0.70,  0.12,  0.83), 1.00, 1.00, 1.00 ),
-(100,       "Fermium",       "Fm", ( 0.70,  0.12,  0.72), 1.00, 1.00, 1.00 ),
-(101,   "Mendelevium",       "Md", ( 0.70,  0.05,  0.65), 1.00, 1.00, 1.00 ),
-(102,      "Nobelium",       "No", ( 0.74,  0.05,  0.52), 1.00, 1.00, 1.00 ),
-(103,    "Lawrencium",       "Lr", ( 0.78,   0.0,   0.4), 1.00, 1.00, 1.00 ),
-(104,       "Vacancy",      "Vac", (  0.5,   0.5,   0.5), 1.00, 1.00, 1.00),
-(105,       "Default",  "Default", (  1.0,   1.0,   1.0), 1.00, 1.00, 1.00),
-(106,         "Stick",    "Stick", (  0.5,   0.5,   0.5), 1.00, 1.00, 1.00),
-)
-
-# This list here contains all data of the elements and will be used during
-# runtime. It is a list of classes.
-# During executing Atomic Blender, the list will be initialized with the fixed
-# data from above via the class structure below (ElementProp). We
-# have then one fixed list (above), which will never be changed, and a list of
-# classes with same data. The latter can be modified via loading a separate
-# custom data file for instance.
-ELEMENTS = []
-
-# This is the list, which contains all atoms of all frames! Each item is a 
-# list which contains the atoms of a single frame. It is a list of  
-# 'AtomProp'.
-ALL_FRAMES = []
-
-# A list of ALL balls which are put into the scene
-STRUCTURE = []
-
-
-# This is the class, which stores the properties for one element.
-class ElementProp(object):
-    __slots__ = ('number', 'name', 'short_name', 'color', 'radii', 'radii_ionic')
-    def __init__(self, number, name, short_name, color, radii, radii_ionic):
-        self.number = number
-        self.name = name
-        self.short_name = short_name
-        self.color = color
-        self.radii = radii
-        self.radii_ionic = radii_ionic
-
-# This is the class, which stores the properties of one atom.
-class AtomProp(object):  
-    __slots__ = ('element', 'name', 'location', 'radius', 'color', 'material')
-    def __init__(self, element, name, location, radius, color, material):
-        self.element = element
-        self.name = name
-        self.location = location
-        self.radius = radius
-        self.color = color
-        self.material = material
-
-
-# -----------------------------------------------------------------------------
-#                                                           Some basic routines        
-
-def read_elements():
-
-    del ELEMENTS[:]
-
-    for item in ELEMENTS_DEFAULT:
-
-        # All three radii into a list
-        radii = [item[4],item[5],item[6]]
-        # The handling of the ionic radii will be done later. So far, it is an
-        # empty list.
-        radii_ionic = []
-
-        li = ElementProp(item[0],item[1],item[2],item[3],
-                                     radii,radii_ionic)
-        ELEMENTS.append(li)
-
-
-# filepath_pdb: path to pdb file
-# radiustype  : '0' default
-#               '1' atomic radii
-#               '2' van der Waals
-def read_xyz_file(filepath_xyz,radiustype):
-
-    number_frames = 0
-    total_number_atoms = 0
-
-    # Open the file ...
-    filepath_xyz_p = open(filepath_xyz, "r")
-
-    #Go through the whole file.
-    FLAG = False
-    for line in filepath_xyz_p:
-
-        # ... the loop is broken here (EOF) ...
-        if line == "":
-            continue
-
-        split_list = line.rsplit()
-
-        if len(split_list) == 1:
-            number_atoms = int(split_list[0])
-            FLAG = True
-            
-        if FLAG == True:
-        
-            line = filepath_xyz_p.readline()
-            line = line.rstrip()
-            
-            all_atoms= []
-            for i in range(number_atoms):
-
-
-                # This is a guarantee that only the total number of atoms of the
-                # first frame is used. Condition is, so far, that the number of
-                # atoms in a xyz file is constant. However, sometimes the number
-                # may increase (or decrease). If it decreases, the addon crashes.
-                # If it increases, only the tot number of atoms of the first frame
-                # is used.
-                # By time, I will allow varying atom numbers ... but this takes 
-                # some time ...            
-                if number_frames != 0:
-                    if i >= total_number_atoms:
-                        break
-                        
-       
-                line = filepath_xyz_p.readline()
-                line = line.rstrip()
-                split_list = line.rsplit()
-                short_name = str(split_list[0])
-                     
-                # Go through all elements and find the element of the current atom.
-                FLAG_FOUND = False
-                for element in ELEMENTS:
-                    if str.upper(short_name) == str.upper(element.short_name):
-                        # Give the atom its proper name, color and radius:
-                        name = element.name
-                        # int(radiustype) => type of radius:
-                        # pre-defined (0), atomic (1) or van der Waals (2)
-                        radius = float(element.radii[int(radiustype)])
-                        color = element.color
-                        FLAG_FOUND = True
-                        break
-                
-                # Is it a vacancy or an 'unknown atom' ?
-                if FLAG_FOUND == False:
-                    # Give this atom also a name. If it is an 'X' then it is a
-                    # vacancy. Otherwise ...
-                    if "X" in short_name:
-                        short_name = "VAC"
-                        name = "Vacancy"
-                        radius = float(ELEMENTS[-3].radii[int(radiustype)])
-                        color = ELEMENTS[-3].color
-                    # ... take what is written in the xyz file. These are somewhat
-                    # unknown atoms. This should never happen, the element list is
-                    # almost complete. However, we do this due to security reasons.
-                    else:
-                        name = str.upper(short_name)
-                        radius = float(ELEMENTS[-2].radii[int(radiustype)])
-                        color = ELEMENTS[-2].color
-              
-                x = float(split_list[1])
-                y = float(split_list[2])
-                z = float(split_list[3])
-                
-                location = Vector((x,y,z))
-            
-                all_atoms.append([short_name, name, location, radius, color])
-            
-            # We note here all elements. This needs to be done only once. 
-            if number_frames == 0:
-            
-                # This is a guarantee that only the total number of atoms of the
-                # first frame is used. Condition is, so far, that the number of
-                # atoms in a xyz file is constant. However, sometimes the number
-                # may increase (or decrease). If it decreases, the addon crashes.
-                # If it increases, only the tot number of atoms of the first frame
-                # is used.
-                # By time, I will allow varying atom numbers ... but this takes 
-                # some time ...
-                total_number_atoms = number_atoms
-                
-                
-                elements = []
-                for atom in all_atoms:
-                    FLAG_FOUND = False
-                    for element in elements:
-                        # If the atom name is already in the list, 
-                        # FLAG on 'True'.
-                        if element == atom[1]:
-                            FLAG_FOUND = True
-                            break
-                    # No name in the current list has been found? => New entry.
-                    if FLAG_FOUND == False:
-                        # Stored are: Atom label (e.g. 'Na'), the corresponding 
-                        # atom name (e.g. 'Sodium') and its color.
-                        elements.append(atom[1])
-            
-            # Sort the atoms: create lists of atoms of one type
-            structure = []
-            for element in elements:
-                atoms_one_type = []
-                for atom in all_atoms:
-                    if atom[1] == element:
-                        atoms_one_type.append(AtomProp(atom[0],
-                                                       atom[1],
-                                                       atom[2],
-                                                       atom[3],
-                                                       atom[4],[]))
-                structure.append(atoms_one_type)
-
-            ALL_FRAMES.append(structure)
-            number_frames += 1
-            FLAG = False
-
-    filepath_xyz_p.close()
-    
-    return total_number_atoms
-
-
-# -----------------------------------------------------------------------------
-#                                                            The main routine
-
-def import_xyz(Ball_type,
-               Ball_azimuth,
-               Ball_zenith,
-               Ball_radius_factor,
-               radiustype,
-               Ball_distance_factor,
-               put_to_center, 
-               put_to_center_all,
-               use_camera,
-               use_lamp,
-               filepath_xyz):
-
-    # List of materials
-    atom_material_list = []
-
-    # ------------------------------------------------------------------------
-    # INITIALIZE THE ELEMENT LIST
-
-    read_elements()
-
-    # ------------------------------------------------------------------------
-    # READING DATA OF ATOMS
-
-    Number_of_total_atoms = read_xyz_file(filepath_xyz, 
-                                                       radiustype)
-                                               
-    # We show the atoms of the first frame.
-    first_frame = ALL_FRAMES[0]
-
-    # ------------------------------------------------------------------------
-    # MATERIAL PROPERTIES FOR ATOMS
-
-    # Create first a new list of materials for each type of atom
-    # (e.g. hydrogen)
-    for atoms_of_one_type in first_frame:
-        # Take the first atom
-        atom = atoms_of_one_type[0]
-        material = bpy.data.materials.new(atom.name)
-        material.name = atom.name
-        material.diffuse_color = atom.color
-        atom_material_list.append(material)
-
-    # Now, we go through all atoms and give them a material. For all atoms ...
-    for atoms_of_one_type in first_frame:
-        for atom in atoms_of_one_type:
-            # ... and all materials ...
-            for material in atom_material_list:
-                # ... select the correct material for the current atom via
-                # comparison of names ...
-                if atom.name in material.name:
-                    # ... and give the atom its material properties.
-                    # However, before we check if it is a vacancy
-                    # The vacancy is represented by a transparent cube.
-                    if atom.name == "Vacancy":
-                        material.transparency_method = 'Z_TRANSPARENCY'
-                        material.alpha = 1.3
-                        material.raytrace_transparency.fresnel = 1.6
-                        material.raytrace_transparency.fresnel_factor = 1.6
-                        material.use_transparency = True
-                    # The atom gets its properties.
-                    atom.material = material
-
-    # ------------------------------------------------------------------------
-    # TRANSLATION OF THE STRUCTURE TO THE ORIGIN
-
-    # It may happen that the structure in a XYZ file already has an offset
-
-
-    # If chosen, the structure is put into the center of the scene
-    # (only the first frame).
-    if put_to_center == True and put_to_center_all == False:
-
-        sum_vec = Vector((0.0,0.0,0.0))
-
-        # Sum of all atom coordinates
-        for atoms_of_one_type in first_frame:
-            sum_vec = sum([atom.location for atom in atoms_of_one_type], sum_vec)
-
-        # Then the average is taken
-        sum_vec = sum_vec / Number_of_total_atoms
-
-        # After, for each atom the center of gravity is substracted
-        for atoms_of_one_type in first_frame:
-            for atom in atoms_of_one_type:
-                atom.location -= sum_vec
-
-    # If chosen, the structure is put into the center of the scene
-    # (all frames).
-    if put_to_center_all == True:
-
-        # For all frames
-        for frame in ALL_FRAMES: 
-
-            sum_vec = Vector((0.0,0.0,0.0))
-
-            # Sum of all atom coordinates
-            for (i, atoms_of_one_type) in enumerate(frame):
-
-                # This is a guarantee that only the total number of atoms of the
-                # first frame is used. Condition is, so far, that the number of
-                # atoms in a xyz file is constant. However, sometimes the number
-                # may increase (or decrease). If it decreases, the addon crashes.
-                # If it increases, only the tot number of atoms of the first frame
-                # is used.
-                # By time, I will allow varying atom numbers ... but this takes 
-                # some time ...
-                if i >= Number_of_total_atoms:
-                    break
-
-                sum_vec = sum([atom.location for atom in atoms_of_one_type], sum_vec)
-
-            # Then the average is taken
-            sum_vec = sum_vec / Number_of_total_atoms
-
-            # After, for each atom the center of gravity is substracted
-            for atoms_of_one_type in frame:
-                for atom in atoms_of_one_type:
-                    atom.location -= sum_vec
-
-   
-    # ------------------------------------------------------------------------
-    # SCALING
-
-    # Take all atoms and adjust their radii and scale the distances.
-    for atoms_of_one_type in first_frame:
-        for atom in atoms_of_one_type:
-            atom.location *= Ball_distance_factor
-    
-    # ------------------------------------------------------------------------
-    # DETERMINATION OF SOME GEOMETRIC PROPERTIES
-
-    # In the following, some geometric properties of the whole object are
-    # determined: center, size, etc.
-    sum_vec = Vector((0.0,0.0,0.0))
-
-    # First the center is determined. All coordinates are summed up ...
-    for atoms_of_one_type in first_frame:
-        sum_vec = sum([atom.location for atom in atoms_of_one_type], sum_vec)
-
-    # ... and the average is taken. This gives the center of the object.
-    object_center_vec = sum_vec / Number_of_total_atoms
-
-    # Now, we determine the size.The farthest atom from the object center is
-    # taken as a measure. The size is used to place well the camera and light
-    # into the scene.
-
-    object_size_vec = []
-    for atoms_of_one_type in first_frame:
-        object_size_vec += [atom.location - object_center_vec for atom in atoms_of_one_type]
-
-    object_size = 0.0
-    object_size = max(object_size_vec).length
-
-    # ------------------------------------------------------------------------
-    # CAMERA AND LAMP
-    camera_factor = 20.0
-
-    # If chosen a camera is put into the scene.
-    if use_camera == True:
-
-        # Assume that the object is put into the global origin. Then, the
-        # camera is moved in x and z direction, not in y. The object has its
-        # size at distance sqrt(object_size) from the origin. So, move the
-        # camera by this distance times a factor of camera_factor in x and z.
-        # Then add x, y and z of the origin of the object.
-        object_camera_vec = Vector((sqrt(object_size) * camera_factor,
-                                    0.0,
-                                    sqrt(object_size) * camera_factor))
-        camera_xyz_vec = object_center_vec + object_camera_vec
-
-        # Create the camera
-        current_layers=bpy.context.scene.layers 
-        camera_data = bpy.data.cameras.new("A_camera")
-        camera_data.lens = 45
-        camera_data.clip_end = 500.0
-        camera = bpy.data.objects.new("A_camera", camera_data)
-        camera.location = camera_xyz_vec
-        camera.layers = current_layers
-        bpy.context.scene.objects.link(camera) 
-
-        # Here the camera is rotated such it looks towards the center of
-        # the object. The [0.0, 0.0, 1.0] vector along the z axis
-        z_axis_vec             = Vector((0.0, 0.0, 1.0))
-        # The angle between the last two vectors
-        angle                  = object_camera_vec.angle(z_axis_vec, 0)
-        # The cross-product of z_axis_vec and object_camera_vec
-        axis_vec               = z_axis_vec.cross(object_camera_vec)
-        # Rotate 'axis_vec' by 'angle' and convert this to euler parameters.
-        # 4 is the size of the matrix.
-        camera.rotation_euler  = Matrix.Rotation(angle, 4, axis_vec).to_euler()
-
-        # Rotate the camera around its axis by 90° such that we have a nice
-        # camera position and view onto the object.
-        bpy.ops.object.select_all(action='DESELECT')        
-        camera.select = True         
-        bpy.ops.transform.rotate(value=(90.0*2*pi/360.0),
-                                 axis=object_camera_vec,
-                                 constraint_axis=(False, False, False),
-                                 constraint_orientation='GLOBAL',
-                                 mirror=False, proportional='DISABLED',
-                                 proportional_edit_falloff='SMOOTH',
-                                 proportional_size=1, snap=False,
-                                 snap_target='CLOSEST', snap_point=(0, 0, 0),
-                                 snap_align=False, snap_normal=(0, 0, 0),
-                                 release_confirm=False)
-
-    # Here a lamp is put into the scene, if chosen.
-    if use_lamp == True:
-
-        # This is the distance from the object measured in terms of %
-        # of the camera distance. It is set onto 50% (1/2) distance.
-        lamp_dl = sqrt(object_size) * 15 * 0.5
-        # This is a factor to which extend the lamp shall go to the right
-        # (from the camera  point of view).
-        lamp_dy_right = lamp_dl * (3.0/4.0)
-
-        # Create x, y and z for the lamp.
-        object_lamp_vec = Vector((lamp_dl,lamp_dy_right,lamp_dl))
-        lamp_xyz_vec = object_center_vec + object_lamp_vec
-
-        # Create the lamp
-        current_layers=bpy.context.scene.layers
-        lamp_data = bpy.data.lamps.new(name="A_lamp", type="POINT")
-        lamp_data.distance = 500.0
-        lamp_data.energy = 3.0
-        lamp_data.shadow_method = 'RAY_SHADOW'        
-        lamp = bpy.data.objects.new("A_lamp", lamp_data)
-        lamp.location = lamp_xyz_vec
-        lamp.layers = current_layers
-        bpy.context.scene.objects.link(lamp)         
-
-        bpy.context.scene.world.light_settings.use_ambient_occlusion = True
-        bpy.context.scene.world.light_settings.ao_factor = 0.2
-        
-
-    # ------------------------------------------------------------------------
-    # DRAWING THE ATOMS
-
-    bpy.ops.object.select_all(action='DESELECT')
-
-    # For each list of atoms of ONE type (e.g. Hydrogen)
-    for atoms_of_one_type in first_frame:
-
-        # Create first the vertices composed of the coordinates of all
-        # atoms of one type
-        atom_vertices = []
-        for atom in atoms_of_one_type:
-            # In fact, the object is created in the World's origin.
-            # This is why 'object_center_vec' is substracted. At the end
-            # the whole object is translated back to 'object_center_vec'.
-            atom_vertices.append( atom.location - object_center_vec )
-
-        # Build the mesh
-        atom_mesh = bpy.data.meshes.new("Mesh_"+atom.name)
-        atom_mesh.from_pydata(atom_vertices, [], [])
-        atom_mesh.update()
-        new_atom_mesh = bpy.data.objects.new(atom.name, atom_mesh)
-        bpy.context.scene.objects.link(new_atom_mesh)
-
-        # Now, build a representative sphere (atom)
-        current_layers=bpy.context.scene.layers
-
-        if atom.name == "Vacancy":
-            bpy.ops.mesh.primitive_cube_add(
-                            view_align=False, enter_editmode=False,
-                            location=(0.0, 0.0, 0.0),
-                            rotation=(0.0, 0.0, 0.0),
-                            layers=current_layers)
-        else:
-            # NURBS balls
-            if Ball_type == "0":
-                bpy.ops.surface.primitive_nurbs_surface_sphere_add(
-                            view_align=False, enter_editmode=False,
-                            location=(0,0,0), rotation=(0.0, 0.0, 0.0),
-                            layers=current_layers)
-            # UV balls
-            elif Ball_type == "1":
-                bpy.ops.mesh.primitive_uv_sphere_add(
-                            segments=Ball_azimuth, ring_count=Ball_zenith,
-                            size=1, view_align=False, enter_editmode=False,
-                            location=(0,0,0), rotation=(0, 0, 0),
-                            layers=current_layers)
-            # Meta balls
-            elif Ball_type == "2":
-                bpy.ops.object.metaball_add(type='BALL', view_align=False, 
-                            enter_editmode=False, location=(0, 0, 0), 
-                            rotation=(0, 0, 0), layers=current_layers)
-
-        ball = bpy.context.scene.objects.active
-        ball.scale  = (atom.radius*Ball_radius_factor,) * 3
-
-        if atom.name == "Vacancy":
-            ball.name = "Cube_"+atom.name
-        else:
-            ball.name = "Ball (NURBS)_"+atom.name
-        ball.active_material = atom.material
-        ball.parent = new_atom_mesh
-        new_atom_mesh.dupli_type = 'VERTS'
-        # The object is back translated to 'object_center_vec'.
-        new_atom_mesh.location = object_center_vec
-        STRUCTURE.append(new_atom_mesh)
-
-    # ------------------------------------------------------------------------
-    # SELECT ALL LOADED OBJECTS
-    
-    bpy.ops.object.select_all(action='DESELECT')
-    obj = None
-    for obj in STRUCTURE:
-        obj.select = True
-    # activate the last selected object (perhaps another should be active?)
-    if obj:
-        bpy.context.scene.objects.active = obj
-
-
-
-def build_frames(frame_delta, frame_skip):
-
-    scn = bpy.context.scene
-
-    # Introduce the basis for all elements that appear in the structure.     
-    for element in STRUCTURE:
-     
-        bpy.ops.object.select_all(action='DESELECT')   
-        bpy.context.scene.objects.active = element
-        element.select = True
-        bpy.ops.object.shape_key_add(True)
-        
-    frame_skip += 1    
-
-    # Introduce the keys and reference the atom positions for each key.     
-    i = 0
-    for j, frame in enumerate(ALL_FRAMES):        
-           
-        if j % frame_skip == 0:
-           
-            for elements_frame, elements_structure in zip(frame,STRUCTURE):
-             
-                key = elements_structure.shape_key_add()
-    
-                for atom_frame, atom_structure in zip(elements_frame, key.data):
-    
-                    atom_structure.co = (atom_frame.location 
-                                       - elements_structure.location)
-    
-                key.name = atom_frame.name + "_frame_" + str(i) 
-
-            i += 1
-
-    num_frames = i
-        
-    scn.frame_start = 0
-    scn.frame_end = frame_delta * num_frames
-
-    # Manage the values of the keys
-    for element in STRUCTURE:
- 
-        scn.frame_current = 0 
-
-        element.data.shape_keys.key_blocks[1].value = 1.0
-        element.data.shape_keys.key_blocks[2].value = 0.0
-        element.data.shape_keys.key_blocks[1].keyframe_insert("value")     
-        element.data.shape_keys.key_blocks[2].keyframe_insert("value")         
-
-        scn.frame_current += frame_delta
-
-        number = 0
-    
-        for number in range(num_frames)[2:]:#-1]:
-    
-            element.data.shape_keys.key_blocks[number-1].value = 0.0
-            element.data.shape_keys.key_blocks[number].value = 1.0
-            element.data.shape_keys.key_blocks[number+1].value = 0.0
-            element.data.shape_keys.key_blocks[number-1].keyframe_insert("value")     
-            element.data.shape_keys.key_blocks[number].keyframe_insert("value")     
-            element.data.shape_keys.key_blocks[number+1].keyframe_insert("value")         
-                
-            scn.frame_current += frame_delta
-            
-        number += 1    
-            
-        element.data.shape_keys.key_blocks[number].value = 1.0
-        element.data.shape_keys.key_blocks[number-1].value = 0.0
-        element.data.shape_keys.key_blocks[number].keyframe_insert("value")     
-        element.data.shape_keys.key_blocks[number-1].keyframe_insert("value")    
-        
-
-
diff --git a/release/scripts/addons_contrib/io_points_pcd/__init__.py b/release/scripts/addons_contrib/io_points_pcd/__init__.py
deleted file mode 100644
index 30736c5..0000000
--- a/release/scripts/addons_contrib/io_points_pcd/__init__.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "PCD",
-    "author": "Aurel Wildfellner",
-    "version": (0, 1),
-    "blender": (2, 57, 0),
-    "location": "File > Import-Export > Point Cloud Data",
-    "description": "Imports and Exports PCD (Point Cloud Data) files. PCD files are the default format used by  pcl (Point Cloud Library).",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-#    "support": 'OFFICAL',
-    "category": "Import-Export"}
-
-
-if "bpy" in locals():
-    import imp
-    imp.reload(pcd_utils)
-else:
-    from . import pcd_utils
-
-import itertools
-import os
-
-
-import bpy
-from bpy.props import *
-from bpy_extras.io_utils import ExportHelper, ImportHelper
-
-
-class ImportPCD(bpy.types.Operator, ImportHelper):
-    """Load PCD (Point Cloud Data) files"""
-    bl_idname = "import_points.stl"
-    bl_label = "Import PCD"
-
-    filename_ext = ".pcd"
-
-    filter_glob = StringProperty(default="*.pcd", options={'HIDDEN'})
-
-    files = CollectionProperty(name="File Path",
-                          description="File path used for importing "
-                                      "the PCD file",
-                          type=bpy.types.OperatorFileListElement)
-
-    directory = StringProperty(subtype='DIR_PATH')
-
-    def execute(self, context):
-        paths = [os.path.join(self.directory, name.name) for name in self.files]
-        if not paths:
-            paths.append(self.filepath)
-
-        for path in paths:
-            pcd_utils.import_pcd(path)
-
-        return {'FINISHED'}
-
-
-
-
-def menu_func_import(self, context):
-    self.layout.operator(ImportPCD.bl_idname, text="Point Cloud Data (.pcd)").filepath = "*.pcd"
-
-
-def menu_func_export(self, context):
-    #self.layout.operator(ExportPLY.bl_idname, text="Point Cloud Data (.pcd)")
-    pass
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_file_import.append(menu_func_import)
-    bpy.types.INFO_MT_file_export.append(menu_func_export)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_file_import.remove(menu_func_import)
-    bpy.types.INFO_MT_file_export.remove(menu_func_export)
-
-
-if __name__ == "__main__":
-    register()
-
diff --git a/release/scripts/addons_contrib/io_points_pcd/pcd_utils.py b/release/scripts/addons_contrib/io_points_pcd/pcd_utils.py
deleted file mode 100644
index 9f2a79e..0000000
--- a/release/scripts/addons_contrib/io_points_pcd/pcd_utils.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-
-from . import pcdparser
-
-
-def create_and_link_mesh(name, points):
-    """
-    Create a blender mesh and object called name from a list of
-    *points* and link it in the current scene.
-    """
-
-    mesh = bpy.data.meshes.new(name)
-    mesh.from_pydata(points, [], [])
-
-    # update mesh to allow proper display
-    mesh.validate()
-    mesh.update()
-
-    scene = bpy.context.scene
-
-    obj = bpy.data.objects.new(name, mesh)
-    scene.objects.link(obj)
-    obj.select = True
-
-
-def import_pcd(filepath, name="new_pointcloud"):
-    parser = pcdparser.PCDParser.factory(filepath, pcdparser.PointXYZ)
-    parser.parseFile()
-    points = parser.getPoints()
-
-    blender_points = []
-    for point in points:
-        blender_points.append((point.x, point.y, point.z))
-
-    create_and_link_mesh(name, blender_points)
-  
-
diff --git a/release/scripts/addons_contrib/io_points_pcd/pcdparser.py b/release/scripts/addons_contrib/io_points_pcd/pcdparser.py
deleted file mode 100644
index 8c543c4..0000000
--- a/release/scripts/addons_contrib/io_points_pcd/pcdparser.py
+++ /dev/null
@@ -1,338 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#   
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-import struct
-
-
-def encodeASCIILine(line):
-    return line.decode(encoding='ASCII')
-
-
-
-class Point:
-
-    def __init__(self):
-        pass
-
-
-    def setField(self, fieldname, values):
-        pass
-
-
-
-
-class PointXYZ(Point):
-
-    x = 0
-    y = 0
-    z = 0
-
-    def __init__(self):
-        super().__init__()
-
-
-    def setField(self, fieldname, values):
-        value = values[0]
-        if fieldname == 'x':
-            self.x = value
-        elif fieldname == 'y':
-            self.y = value
-        elif fieldname == 'z':
-            self.z = value
-
-
-
-
-class PCDParser:
-
-    filepath = ''
-    file = None
-
-    points = []
-    PointClass = None
-
-    headerEnd = False
-
-
-    @staticmethod
-    def factory(filepath, PointClass):
-        version = 'NO_VERSION_NUMBER'
-        with open(filepath, 'rb') as f:
-            for b in f:
-                line = encodeASCIILine(b)
-                line_split = line.split()
-                if line_split[0] == 'VERSION' and len(line_split) > 1:
-                    version = line_split[1]
-                    break
-      
-        if version == ".7" or version == "0.7": 
-            return PCDParser_v0_7(filepath, PointClass)
-        else:
-            return None
-
-
-    def __init__(self, filepath, PointClass):
-        self.filepath = filepath
-        self.PointClass = PointClass
-
-        self.file = None
-        self.headerEnd = False
-        self.points = []
-
-
-    def parserWarning(self, msg):
-        print("[WARNING] ", msg)
-    
-
-    def rmComment(self, line):
-        return line[:line.find('#')] 
-
-
-    def parseFile(self):
-        with open(self.filepath, 'rb') as self.file:
-            self.parseHeader()
-            self.parsePoints()
-
-
-    def parseHeader(self):
-        for b in self.file:
-            line = encodeASCIILine(b)
-            line = self.rmComment(line)
-
-            split = line.split()
-            if len(split) > 0:
-                self.parseHeaderLine(split)
-
-            if self.headerEnd:
-                self.finalizeHeader()
-                break
-
-
-    def parseHeaderLine(self, split):
-        keyword = split[0]
-        self.parserWarning("Uknown header Keyword '" + keyword + "' gets ignored")
-
-    
-    def finalizeHeader(self):
-        pass
-
-
-    def parsePoints(self):
-        pass
-
-
-    def getPoints(self):
-        return self.points
-
-
-    def version(self):
-        return 'NO_VERSION_NUMBER'
-
-
-
-
-class PCDParser_v0_7(PCDParser):
-
-    fields = []
-
-    def __init__(self, filepath, PointClass):
-        super().__init__(filepath, PointClass)
-        self.fields = []
-
-
-    def version(self):
-        return '.7'
-
-
-    def parseHeaderLine(self, split):
-        keyword = split[0]
-        if keyword == 'VERSION':
-            self.parseVERSION(split[1:])
-        elif keyword == 'FIELDS':
-            self.parseFIELDS(split[1:])
-        elif keyword == 'SIZE':
-            self.parseSIZE(split[1:])
-        elif keyword == 'TYPE':
-            self.parseTYPE(split[1:])
-        elif keyword == 'COUNT':
-            self.parseCOUNT(split[1:])
-        elif keyword == 'WIDTH':
-            self.parseWIDTH(split[1:])
-        elif keyword == 'HEIGHT':
-            self.parseHEIGHT(split[1:])
-        elif keyword == 'POINTS':
-            self.parsePOINTS(split[1:])
-        elif keyword == 'DATA':
-            self.parseDATA(split[1:])
-        else:
-            super().parseHeaderLine(split)
-
-
-    def parseVERSION(self, split):
-        pass
-
-
-    def parseFIELDS(self, split):
-        print("SPLIT FIELDS:", split)
-        for field in split:
-            self.fields.append([field, None, None, None])
-        print("FIELDS, after parsing:", self.fields)
-
-
-    def parseSIZE(self, split):
-        for i, size in enumerate(split):
-            self.fields[i][1] = int(size)
-
-
-    def parseTYPE(self, split):
-        for i, type in enumerate(split):
-            self.fields[i][2] = type
-
-
-    def parseCOUNT(self, split):
-        for i, count in enumerate(split):
-            self.fields[i][3] = int(count)
-
-
-    def parseWIDTH(self, split):
-        self.width = int(split[0])
-
-
-    def parseHEIGHT(self, split):
-        self.height = int(split[0])
-
-
-    def parsePOINTS(self, split):
-        pass
-
-
-    def parseDATA(self, split):
-        if split[0] == "ascii":
-            self.datatype = 'ASCII'
-        elif split[0] == "binary":
-            self.datatype = 'BINARY'
-        self.headerEnd = True
-
-
-    def finalizeHeader(self):
-        self.numPoints = self.width * self.height
-        print("FIELDS - finalized", self.fields)
-
-
-    def parsePoints(self):
-        if self.datatype == 'ASCII':
-            self.parseASCII()
-        elif self.datatype == 'BINARY':
-            self.parseBINARY()
-
-
-    def parseASCII(self):
-        parsedPoints = 0
-        while parsedPoints < self.numPoints:
-           
-            try: 
-                b = self.file.readline()
-                line = encodeASCIILine(b)
-            except:
-                self.parserError("Unexpected end of data")
-                return
-            line = self.rmComment(line)
-            split = line.split()
-
-            if (len(split) == 0):
-                continue
-            else:
-                parsedPoints += 1
-
-            point = self.PointClass()
-
-            for field in self.fields:
-                fieldname = field[0]
-                fieldtype = field[2]
-                fieldcount = field[3]
-
-                values = []
-                for i in range(fieldcount):
-                    vs = split.pop(0)
-                    if fieldtype == 'F':
-                        values.append(float(vs))
-                    elif fieldtype in ['U', 'I']:
-                        values.append(int(vs))
-
-                point.setField(fieldname, values)
-
-            self.points.append(point)
-
-
-    def parseBINARY(self):
-        for pointi in range(self.numPoints):
-            point = self.PointClass()
-
-            for field in self.fields:
-                fieldname = field[0]
-                fieldsize = field[1]
-                fieldtype = field[2]
-                fieldcount = field[3]
-
-                values = []
-                for i in range(fieldcount):
-
-                    fs = None
-                    if fieldtype == 'F':
-                        if fieldsize == 4: #float
-                            fs = '<f'
-                        elif fieldsize == 8: #double
-                            fs = '<d'
-                    elif fieldtype == 'U':
-                        if fieldsize == 1: #unsinged char
-                            fs = '<B'
-                        elif fieldsize == 2: #unsinged short
-                            fs = '<H'
-                        elif fieldsize == 4: #unsinged int
-                            fs =  '<I'
-                    elif fieldtype == 'I':
-                        if fieldsize == 1: #char
-                            fs = '<c'
-                        elif fieldsize == 2: #short
-                            fs = '<h'
-                        elif fieldsize == 4: #signed int
-                            fs =  '<i'
-
-                    raw = self.file.read(fieldsize)
-                    if (fs):
-                        data = struct.unpack(fs, raw)
-                        values.append(data[0])
-
-                point.setField(fieldname, values)
-
-            self.points.append(point)
-
-
-
-
-def test():
-    parser = PCDParser.factory('test.pcd', PointXYZ)
-    if parser:
-        parser.parseFile()
-        points = parser.getPoints()
-        for point in points:
-            print(point.x, point.y, point.z)
-    else:
-        print("Can't create parser for this file")
-
diff --git a/release/scripts/addons_contrib/io_points_pcd/test.pcd b/release/scripts/addons_contrib/io_points_pcd/test.pcd
deleted file mode 100644
index 79ec41d..0000000
--- a/release/scripts/addons_contrib/io_points_pcd/test.pcd
+++ /dev/null
@@ -1,224 +0,0 @@
-# .PCD v.7 - Point Cloud Data file format
-VERSION .7
-FIELDS x y z rgb
-SIZE 4 4 4 4
-TYPE F F F F
-COUNT 1 1 1 1
-WIDTH 213
-HEIGHT 1
-VIEWPOINT 0 0 0 1 0 0 0
-POINTS 213
-DATA ascii
-0.93773 0.33763 0 4.2108e+06
-0.90805 0.35641 0 4.2108e+06
-0.81915 0.32 0 4.2108e+06
-0.97192 0.278 0 4.2108e+06
-0.944 0.29474 0 4.2108e+06
-0.98111 0.24247 0 4.2108e+06
-0.93655 0.26143 0 4.2108e+06
-0.91631 0.27442 0 4.2108e+06
-0.81921 0.29315 0 4.2108e+06
-0.90701 0.24109 0 4.2108e+06
-0.83239 0.23398 0 4.2108e+06
-0.99185 0.2116 0 4.2108e+06
-0.89264 0.21174 0 4.2108e+06
-0.85082 0.21212 0 4.2108e+06
-0.81044 0.32222 0 4.2108e+06
-0.74459 0.32192 0 4.2108e+06
-0.69927 0.32278 0 4.2108e+06
-0.8102 0.29315 0 4.2108e+06
-0.75504 0.29765 0 4.2108e+06
-0.8102 0.24399 0 4.2108e+06
-0.74995 0.24723 0 4.2108e+06
-0.68049 0.29768 0 4.2108e+06
-0.66509 0.29002 0 4.2108e+06
-0.69441 0.2526 0 4.2108e+06
-0.62807 0.22187 0 4.2108e+06
-0.58706 0.32199 0 4.2108e+06
-0.52125 0.31955 0 4.2108e+06
-0.49351 0.32282 0 4.2108e+06
-0.44313 0.32169 0 4.2108e+06
-0.58678 0.2929 0 4.2108e+06
-0.53436 0.29164 0 4.2108e+06
-0.59308 0.24134 0 4.2108e+06
-0.5357 0.2444 0 4.2108e+06
-0.50043 0.31235 0 4.2108e+06
-0.44107 0.29711 0 4.2108e+06
-0.50727 0.22193 0 4.2108e+06
-0.43957 0.23976 0 4.2108e+06
-0.8105 0.21112 0 4.2108e+06
-0.73555 0.2114 0 4.2108e+06
-0.69907 0.21082 0 4.2108e+06
-0.63327 0.21154 0 4.2108e+06
-0.59165 0.21201 0 4.2108e+06
-0.52477 0.21491 0 4.2108e+06
-0.49375 0.21006 0 4.2108e+06
-0.4384 0.19632 0 4.2108e+06
-0.43425 0.16052 0 4.2108e+06
-0.3787 0.32173 0 4.2108e+06
-0.33444 0.3216 0 4.2108e+06
-0.23815 0.32199 0 4.808e+06
-0.3788 0.29315 0 4.2108e+06
-0.33058 0.31073 0 4.2108e+06
-0.3788 0.24399 0 4.2108e+06
-0.30249 0.29189 0 4.2108e+06
-0.23492 0.29446 0 4.808e+06
-0.29465 0.24399 0 4.2108e+06
-0.23514 0.24172 0 4.808e+06
-0.18836 0.32277 0 4.808e+06
-0.15992 0.32176 0 4.808e+06
-0.08642 0.32181 0 4.808e+06
-0.039994 0.32283 0 4.808e+06
-0.20039 0.31211 0 4.808e+06
-0.1417 0.29506 0 4.808e+06
-0.20921 0.22332 0 4.808e+06
-0.13884 0.24227 0 4.808e+06
-0.085123 0.29441 0 4.808e+06
-0.048446 0.31279 0 4.808e+06
-0.086957 0.24399 0 4.808e+06
-0.3788 0.21189 0 4.2108e+06
-0.29465 0.19323 0 4.2108e+06
-0.23755 0.19348 0 4.808e+06
-0.29463 0.16054 0 4.2108e+06
-0.23776 0.16054 0 4.808e+06
-0.19016 0.21038 0 4.808e+06
-0.15704 0.21245 0 4.808e+06
-0.08678 0.21169 0 4.808e+06
-0.012746 0.32168 0 4.808e+06
--0.075715 0.32095 0 4.808e+06
--0.10622 0.32304 0 4.808e+06
--0.16391 0.32118 0 4.808e+06
-0.00088411 0.29487 0 4.808e+06
--0.057568 0.29457 0 4.808e+06
--0.0034333 0.24399 0 4.808e+06
--0.055185 0.24185 0 4.808e+06
--0.10983 0.31352 0 4.808e+06
--0.15082 0.29453 0 4.808e+06
--0.11534 0.22049 0 4.808e+06
--0.15155 0.24381 0 4.808e+06
--0.1912 0.32173 0 4.808e+06
--0.281 0.3185 0 4.808e+06
--0.30791 0.32307 0 4.808e+06
--0.33854 0.32148 0 4.808e+06
--0.21248 0.29805 0 4.808e+06
--0.26372 0.29905 0 4.808e+06
--0.22562 0.24399 0 4.808e+06
--0.25035 0.2371 0 4.808e+06
--0.29941 0.31191 0 4.808e+06
--0.35845 0.2954 0 4.808e+06
--0.29231 0.22236 0 4.808e+06
--0.36101 0.24172 0 4.808e+06
--0.0034393 0.21129 0 4.808e+06
--0.07306 0.21304 0 4.808e+06
--0.10579 0.2099 0 4.808e+06
--0.13642 0.21411 0 4.808e+06
--0.22562 0.19323 0 4.808e+06
--0.24439 0.19799 0 4.808e+06
--0.22591 0.16041 0 4.808e+06
--0.23466 0.16082 0 4.808e+06
--0.3077 0.20998 0 4.808e+06
--0.3413 0.21239 0 4.808e+06
--0.40551 0.32178 0 4.2108e+06
--0.50568 0.3218 0 4.2108e+06
--0.41732 0.30844 0 4.2108e+06
--0.44237 0.28859 0 4.2108e+06
--0.41591 0.22004 0 4.2108e+06
--0.44803 0.24236 0 4.2108e+06
--0.50623 0.29315 0 4.2108e+06
--0.50916 0.24296 0 4.2108e+06
--0.57019 0.22334 0 4.2108e+06
--0.59611 0.32199 0 4.2108e+06
--0.65104 0.32199 0 4.2108e+06
--0.72566 0.32129 0 4.2108e+06
--0.75538 0.32301 0 4.2108e+06
--0.59653 0.29315 0 4.2108e+06
--0.65063 0.29315 0 4.2108e+06
--0.59478 0.24245 0 4.2108e+06
--0.65063 0.24399 0 4.2108e+06
--0.70618 0.29525 0 4.2108e+06
--0.76203 0.31284 0 4.2108e+06
--0.70302 0.24183 0 4.2108e+06
--0.77062 0.22133 0 4.2108e+06
--0.41545 0.21099 0 4.2108e+06
--0.45004 0.19812 0 4.2108e+06
--0.4475 0.1673 0 4.2108e+06
--0.52031 0.21236 0 4.2108e+06
--0.55182 0.21045 0 4.2108e+06
--0.5965 0.21131 0 4.2108e+06
--0.65064 0.2113 0 4.2108e+06
--0.72216 0.21286 0 4.2108e+06
--0.7556 0.20987 0 4.2108e+06
--0.78343 0.31973 0 4.2108e+06
--0.87572 0.32111 0 4.2108e+06
--0.90519 0.32263 0 4.2108e+06
--0.95526 0.34127 0 4.2108e+06
--0.79774 0.29271 0 4.2108e+06
--0.85618 0.29497 0 4.2108e+06
--0.79975 0.24326 0 4.2108e+06
--0.8521 0.24246 0 4.2108e+06
--0.91157 0.31224 0 4.2108e+06
--0.95031 0.29572 0 4.2108e+06
--0.92223 0.2213 0 4.2108e+06
--0.94979 0.24354 0 4.2108e+06
--0.78641 0.21505 0 4.2108e+06
--0.87094 0.21237 0 4.2108e+06
--0.90637 0.20934 0 4.2108e+06
--0.93777 0.21481 0 4.2108e+06
-0.22244 -0.0296 0 4.808e+06
-0.2704 -0.078167 0 4.808e+06
-0.24416 -0.056883 0 4.808e+06
-0.27311 -0.10653 0 4.808e+06
-0.26172 -0.10653 0 4.808e+06
-0.2704 -0.1349 0 4.808e+06
-0.24428 -0.15599 0 4.808e+06
-0.19017 -0.025297 0 4.808e+06
-0.14248 -0.02428 0 4.808e+06
-0.19815 -0.037432 0 4.808e+06
-0.14248 -0.03515 0 4.808e+06
-0.093313 -0.02428 0 4.808e+06
-0.044144 -0.02428 0 4.808e+06
-0.093313 -0.03515 0 4.808e+06
-0.044144 -0.03515 0 4.808e+06
-0.21156 -0.17357 0 4.808e+06
-0.029114 -0.12594 0 4.2108e+06
-0.036583 -0.15619 0 4.2108e+06
-0.22446 -0.20514 0 4.808e+06
-0.2208 -0.2369 0 4.808e+06
-0.2129 -0.208 0 4.808e+06
-0.19316 -0.25672 0 4.808e+06
-0.14497 -0.27484 0 4.808e+06
-0.030167 -0.18748 0 4.2108e+06
-0.1021 -0.27453 0 4.808e+06
-0.1689 -0.2831 0 4.808e+06
-0.13875 -0.28647 0 4.808e+06
-0.086993 -0.29568 0 4.808e+06
-0.044924 -0.3154 0 4.808e+06
--0.0066125 -0.02428 0 4.808e+06
--0.057362 -0.02428 0 4.808e+06
--0.0066125 -0.03515 0 4.808e+06
--0.057362 -0.03515 0 4.808e+06
--0.10653 -0.02428 0 4.808e+06
--0.15266 -0.025282 0 4.808e+06
--0.10653 -0.03515 0 4.808e+06
--0.16036 -0.037257 0 4.808e+06
-0.0083286 -0.1259 0 4.2108e+06
-0.0007442 -0.15603 0 4.2108e+06
--0.1741 -0.17381 0 4.808e+06
--0.18502 -0.02954 0 4.808e+06
--0.20707 -0.056403 0 4.808e+06
--0.23348 -0.07764 0 4.808e+06
--0.2244 -0.10653 0 4.808e+06
--0.23604 -0.10652 0 4.808e+06
--0.20734 -0.15641 0 4.808e+06
--0.23348 -0.13542 0 4.808e+06
-0.0061083 -0.18729 0 4.2108e+06
--0.066235 -0.27472 0 4.808e+06
--0.17577 -0.20789 0 4.808e+06
--0.10861 -0.27494 0 4.808e+06
--0.15584 -0.25716 0 4.808e+06
--0.0075775 -0.31546 0 4.808e+06
--0.050817 -0.29595 0 4.808e+06
--0.10306 -0.28653 0 4.808e+06
--0.1319 -0.2831 0 4.808e+06
--0.18716 -0.20571 0 4.808e+06
--0.18369 -0.23729 0 4.808e+06
diff --git a/release/scripts/addons_contrib/io_scene_cod/__init__.py b/release/scripts/addons_contrib/io_scene_cod/__init__.py
deleted file mode 100644
index 1cab6f0..0000000
--- a/release/scripts/addons_contrib/io_scene_cod/__init__.py
+++ /dev/null
@@ -1,475 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-"""
-Blender-CoD: Blender Add-On for Call of Duty modding
-Version: alpha 3
-
-Copyright (c) 2011 CoDEmanX, Flybynyt -- blender-cod at online.de
-
-http://code.google.com/p/blender-cod/
-
-TODO
-- UI for xmodel and xanim import (planned for alpha 4/5)
-
-"""
-
-bl_info = {
-    "name": "Blender-CoD - Add-On for Call of Duty modding (alpha 3)",
-    "author": "CoDEmanX, Flybynyt",
-    "version": (0, 3, 5),
-    "blender": (2, 62, 0),
-    "location": "File > Import  |  File > Export",
-    "description": "Export models to *.XMODEL_EXPORT and animations to *.XANIM_EXPORT",
-    "warning": "Alpha version, please report any bugs!",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Call_of_Duty_IO",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=30482",
-    "support": "TESTING",
-    "category": "Import-Export"
-}
-
-# To support reload properly, try to access a package var, if it's there, reload everything
-if "bpy" in locals():
-    import imp
-    if "import_xmodel" in locals():
-        imp.reload(import_xmodel)
-    if "export_xmodel" in locals():
-        imp.reload(export_xmodel)
-    if "import_xanim" in locals():
-        imp.reload(import_xanim)
-    if "export_xanim" in locals():
-        imp.reload(export_xanim)
-
-import bpy
-from bpy.props import BoolProperty, IntProperty, FloatProperty, StringProperty, EnumProperty
-import bpy_extras.io_utils
-from bpy_extras.io_utils import ExportHelper, ImportHelper
-import time
-
-# Planned for alpha 4/5
-class ImportXmodel(bpy.types.Operator, ImportHelper):
-    """Load a CoD XMODEL_EXPORT File"""
-    bl_idname = "import_scene.xmodel"
-    bl_label = "Import XMODEL_EXPORT"
-    bl_options = {'PRESET'}
-
-    filename_ext = ".XMODEL_EXPORT"
-    filter_glob = StringProperty(default="*.XMODEL_EXPORT", options={'HIDDEN'})
-
-    #use_meshes = BoolProperty(name="Meshes", description="Import meshes", default=True)
-    #use_armature = BoolProperty(name="Armature", description="Import Armature", default=True)
-    #use_bind_armature = BoolProperty(name="Bind Meshes to Armature", description="Parent imported meshes to armature", default=True)
-
-    #use_split_objects = BoolProperty(name="Object", description="Import OBJ Objects into Blender Objects", default=True)
-    #use_split_groups = BoolProperty(name="Group", description="Import OBJ Groups into Blender Objects", default=True)
-
-    #use_image_search = BoolProperty(name="Image Search", description="Search subdirs for any associated images (Warning, may be slow)", default=True)
-
-    def execute(self, context):
-        from . import import_xmodel
-        start_time = time.clock()
-        result = import_xmodel.load(self, context, **self.as_keywords(ignore=("filter_glob", "check_existing")))
-
-        if not result:
-            self.report({'INFO'}, "Import finished in %.4f sec." % (time.clock() - start_time))
-            return {'FINISHED'}
-        else:
-            self.report({'ERROR'}, result)
-            return {'CANCELLED'}
-
-    """
-    def draw(self, context):
-        layout = self.layout
-
-        col = layout.column()
-        col.prop(self, "use_meshes")
-        col.prop(self, "use_armature")
-
-        row = layout.row()
-        row.active = self.use_meshes and self.use_armature
-        row.prop(self, "use_bind_armature")
-    """
-
-    @classmethod
-    def poll(self, context):
-        return (context.scene is not None)
-
-class ImportXanim(bpy.types.Operator, ImportHelper):
-    """Load a CoD XANIM_EXPORT File"""
-    bl_idname = "import_scene.xanim"
-    bl_label = "Import XANIM_EXPORT"
-    bl_options = {'PRESET'}
-
-    filename_ext = ".XANIM_EXPORT"
-    filter_glob = StringProperty(default="*.XANIM_EXPORT;*.NT_EXPORT", options={'HIDDEN'})
-
-    def execute(self, context):
-        # print("Selected: " + context.active_object.name)
-        from . import import_xanim
-
-        return import_xanim.load(self, context, **self.as_keywords(ignore=("filter_glob",)))
-
-class ExportXmodel(bpy.types.Operator, ExportHelper):
-    """Save a CoD XMODEL_EXPORT File"""
-
-    bl_idname = "export_scene.xmodel"
-    bl_label = 'Export XMODEL_EXPORT'
-    bl_options = {'PRESET'}
-
-    filename_ext = ".XMODEL_EXPORT"
-    filter_glob = StringProperty(default="*.XMODEL_EXPORT", options={'HIDDEN'})
-
-    # List of operator properties, the attributes will be assigned
-    # to the class instance from the operator settings before calling.
-
-    use_version = EnumProperty(
-        name="Format Version",
-        description="XMODEL_EXPORT format version for export",
-        items=(('5', "Version 5", "vCoD, CoD:UO"),
-               ('6', "Version 6", "CoD2, CoD4, CoD5, CoD7")),
-        default='6',
-        )
-
-    use_selection = BoolProperty(
-        name="Selection only",
-        description="Export selected meshes only (object or weight paint mode)",
-        default=False
-        )
-
-    use_vertex_colors = BoolProperty(
-        name="Vertex colors",
-        description="Export vertex colors (if disabled, white color will be used)",
-        default=True
-        )
-
-    use_vertex_colors_alpha = BoolProperty(
-        name="As alpha",
-        description="Turn RGB vertex colors into grayscale (average value) and use it as alpha transparency. White is 1 (opaque), black 0 (invisible)",
-        default=False
-        )
-
-    use_apply_modifiers = BoolProperty(
-        name="Apply Modifiers",
-        description="Apply all mesh modifiers except Armature (preview resolution)",
-        default=True
-        )
-
-    use_armature = BoolProperty(
-        name="Armature",
-        description="Export bones (if disabled, only a 'tag_origin' bone will be written)",
-        default=True
-        )
-
-    use_vertex_cleanup = BoolProperty(
-        name="Clean up vertices",
-        description="Try this if you have problems converting to xmodel. Skips vertices which aren't used by any face and updates references.",
-        default=False
-        )
-
-    use_armature_pose = BoolProperty(
-        name="Pose animation to models",
-        description="Export meshes with Armature modifier applied as a series of XMODEL_EXPORT files",
-        default=False
-        )
-
-    use_frame_start = IntProperty(
-        name="Start",
-        description="First frame to export",
-        default=1,
-        min=0
-        )
-
-    use_frame_end = IntProperty(
-        name="End",
-        description="Last frame to export",
-        default=250,
-        min=0
-        )
-
-    use_weight_min = BoolProperty(
-        name="Minimum bone weight",
-        description="Try this if you get 'too small weight' errors when converting",
-        default=False,
-        )
-
-    use_weight_min_threshold = FloatProperty(
-        name="Threshold",
-        description="Smallest allowed weight (minimum value)",
-        default=0.010097,
-        min=0.0,
-        max=1.0,
-        precision=6
-        )
-
-    def execute(self, context):
-        from . import export_xmodel
-        start_time = time.clock()
-        result = export_xmodel.save(self, context, **self.as_keywords(ignore=("filter_glob", "check_existing")))
-
-        if not result:
-            self.report({'INFO'}, "Export finished in %.4f sec." % (time.clock() - start_time))
-            return {'FINISHED'}
-        else:
-            self.report({'ERROR'}, result)
-            return {'CANCELLED'}
-
-    # Extend ExportHelper invoke function to support dynamic default values
-    def invoke(self, context, event):
-
-        #self.use_frame_start = context.scene.frame_start
-        self.use_frame_start = context.scene.frame_current
-
-        #self.use_frame_end = context.scene.frame_end
-        self.use_frame_end = context.scene.frame_current
-
-        return super().invoke(context, event)
-
-    def draw(self, context):
-        layout = self.layout
-
-        row = layout.row(align=True)
-        row.prop(self, "use_version", expand=True)
-
-        # Calculate number of selected mesh objects
-        if context.mode in {'OBJECT', 'PAINT_WEIGHT'}:
-            meshes_selected = len([m for m in bpy.data.objects if m.type == 'MESH' and m.select])
-        else:
-            meshes_selected = 0
-
-        col = layout.column(align=True)
-        col.prop(self, "use_selection", "Selection only (%i meshes)" % meshes_selected)
-        col.enabled = bool(meshes_selected)
-
-        col = layout.column(align=True)
-        col.prop(self, "use_apply_modifiers")
-
-        col = layout.column(align=True)
-        col.enabled = not self.use_armature_pose
-        if self.use_armature and self.use_armature_pose:
-            col.prop(self, "use_armature", "Armature  (disabled)")
-        else:
-            col.prop(self, "use_armature")
-
-        if self.use_version == '6':
-
-            row = layout.row(align=True)
-            row.prop(self, "use_vertex_colors")
-
-            sub = row.split()
-            sub.active = self.use_vertex_colors
-            sub.prop(self, "use_vertex_colors_alpha")
-
-        col = layout.column(align=True)
-        col.label("Advanced:")
-
-        col = layout.column(align=True)
-        col.prop(self, "use_vertex_cleanup")
-
-        box = layout.box()
-
-        col = box.column(align=True)
-        col.prop(self, "use_armature_pose")
-
-        sub = box.column()
-        sub.active = self.use_armature_pose
-        sub.label(text="Frame range: (%i frames)" % (abs(self.use_frame_end - self.use_frame_start) + 1))
-
-        row = sub.row(align=True)
-        row.prop(self, "use_frame_start")
-        row.prop(self, "use_frame_end")
-
-        box = layout.box()
-
-        col = box.column(align=True)
-        col.prop(self, "use_weight_min")
-
-        sub = box.column()
-        sub.enabled = self.use_weight_min
-        sub.prop(self, "use_weight_min_threshold")
-
-    @classmethod
-    def poll(self, context):
-        return (context.scene is not None)
-
-class ExportXanim(bpy.types.Operator, ExportHelper):
-    """Save a XMODEL_XANIM File"""
-
-    bl_idname = "export_scene.xanim"
-    bl_label = 'Export XANIM_EXPORT'
-    bl_options = {'PRESET'}
-
-    filename_ext = ".XANIM_EXPORT"
-    filter_glob = StringProperty(default="*.XANIM_EXPORT", options={'HIDDEN'})
-
-    # List of operator properties, the attributes will be assigned
-    # to the class instance from the operator settings before calling.
-
-    use_selection = BoolProperty(
-        name="Selection only",
-        description="Export selected bones only (pose mode)",
-        default=False
-        )
-
-    use_framerate = IntProperty(
-        name="Framerate",
-        description="Set frames per second for export, 30 fps is commonly used.",
-        default=24,
-        min=1,
-        max=100
-        )
-
-    use_frame_start = IntProperty(
-        name="Start",
-        description="First frame to export",
-        default=1,
-        min=0
-        )
-
-    use_frame_end = IntProperty(
-        name="End",
-        description="Last frame to export",
-        default=250,
-        min=0
-        )
-
-    use_notetrack = BoolProperty(
-        name="Notetrack",
-        description="Export timeline markers as notetrack nodes",
-        default=True
-        )
-
-    use_notetrack_format = EnumProperty(
-        name="Notetrack format",
-        description="Notetrack format to use. Always set 'CoD 7' for Black Ops, even if not using notetrack!",
-        items=(('5', "CoD 5", "Separate NT_EXPORT notetrack file for 'World at War'"),
-               ('7', "CoD 7", "Separate NT_EXPORT notetrack file for 'Black Ops'"),
-               ('1', "all other", "Inline notetrack data for all CoD versions except WaW and BO")),
-        default='1',
-        )
-
-    def execute(self, context):
-        from . import export_xanim
-        start_time = time.clock()
-        result = export_xanim.save(self, context, **self.as_keywords(ignore=("filter_glob", "check_existing")))
-
-        if not result:
-            self.report({'INFO'}, "Export finished in %.4f sec." % (time.clock() - start_time))
-            return {'FINISHED'}
-        else:
-            self.report({'ERROR'}, result)
-            return {'CANCELLED'}
-
-    # Extend ExportHelper invoke function to support dynamic default values
-    def invoke(self, context, event):
-
-        self.use_frame_start = context.scene.frame_start
-        self.use_frame_end = context.scene.frame_end
-        self.use_framerate = round(context.scene.render.fps / context.scene.render.fps_base)
-
-        return super().invoke(context, event)
-
-    def draw(self, context):
-
-        layout = self.layout
-
-        bones_selected = 0
-        armature = None
-
-        # Take the first armature
-        for ob in bpy.data.objects:
-            if ob.type == 'ARMATURE' and len(ob.data.bones) > 0:
-                armature = ob.data
-
-                # Calculate number of selected bones if in pose-mode
-                if context.mode == 'POSE':
-                    bones_selected = len([b for b in armature.bones if b.select])
-
-                # Prepare info string
-                armature_info = "%s (%i bones)" % (ob.name, len(armature.bones))
-                break
-        else:
-            armature_info = "Not found!"
-
-        if armature:
-            icon = 'NONE'
-        else:
-            icon = 'ERROR'
-
-        col = layout.column(align=True)
-        col.label("Armature: %s" % armature_info, icon)
-
-        col = layout.column(align=True)
-        col.prop(self, "use_selection", "Selection only (%i bones)" % bones_selected)
-        col.enabled = bool(bones_selected)
-
-        layout.label(text="Frame range: (%i frames)" % (abs(self.use_frame_end - self.use_frame_start) + 1))
-
-        row = layout.row(align=True)
-        row.prop(self, "use_frame_start")
-        row.prop(self, "use_frame_end")
-
-        col = layout.column(align=True)
-        col.prop(self, "use_framerate")
-
-        # Calculate number of markers in export range
-        frame_min = min(self.use_frame_start, self.use_frame_end)
-        frame_max = max(self.use_frame_start, self.use_frame_end)
-        num_markers = len([m for m in context.scene.timeline_markers if frame_max >= m.frame >= frame_min])
-
-        col = layout.column(align=True)
-        col.prop(self, "use_notetrack", text="Notetrack (%i nodes)" % num_markers)
-
-        col = layout.column(align=True)
-        col.prop(self, "use_notetrack_format", expand=True)
-
-    @classmethod
-    def poll(self, context):
-        return (context.scene is not None)
-
-def menu_func_xmodel_import(self, context):
-    self.layout.operator(ImportXmodel.bl_idname, text="CoD Xmodel (.XMODEL_EXPORT)")
-"""
-def menu_func_xanim_import(self, context):
-    self.layout.operator(ImportXanim.bl_idname, text="CoD Xanim (.XANIM_EXPORT)")
-"""
-def menu_func_xmodel_export(self, context):
-    self.layout.operator(ExportXmodel.bl_idname, text="CoD Xmodel (.XMODEL_EXPORT)")
-
-def menu_func_xanim_export(self, context):
-    self.layout.operator(ExportXanim.bl_idname, text="CoD Xanim (.XANIM_EXPORT)")
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_file_import.append(menu_func_xmodel_import)
-    #bpy.types.INFO_MT_file_import.append(menu_func_xanim_import)
-    bpy.types.INFO_MT_file_export.append(menu_func_xmodel_export)
-    bpy.types.INFO_MT_file_export.append(menu_func_xanim_export)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_file_import.remove(menu_func_xmodel_import)
-    #bpy.types.INFO_MT_file_import.remove(menu_func_xanim_import)
-    bpy.types.INFO_MT_file_export.remove(menu_func_xmodel_export)
-    bpy.types.INFO_MT_file_export.remove(menu_func_xanim_export)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/io_scene_cod/export_xanim.py b/release/scripts/addons_contrib/io_scene_cod/export_xanim.py
deleted file mode 100644
index c3d00fc..0000000
--- a/release/scripts/addons_contrib/io_scene_cod/export_xanim.py
+++ /dev/null
@@ -1,231 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-"""
-Blender-CoD: Blender Add-On for Call of Duty modding
-Version: alpha 3
-
-Copyright (c) 2011 CoDEmanX, Flybynyt -- blender-cod at online.de
-
-http://code.google.com/p/blender-cod/
-
-TODO
-- Test pose matrix exports, global or local?
-
-"""
-
-import bpy
-from datetime import datetime
-
-def save(self, context, filepath="",
-         use_selection=False,
-         use_framerate=24,
-         use_frame_start=1,
-         use_frame_end=250,
-         use_notetrack=True,
-         use_notetrack_format='1'):
-
-    armature = None
-    last_frame_current = context.scene.frame_current
-
-    # There's no context object right after object deletion, need to set one
-    if context.object:
-        last_mode = context.object.mode
-    else:
-        last_mode = 'OBJECT'
-
-        if bpy.data.objects:
-            context.scene.objects.active = bpy.data.objects[0]
-        else:
-            return "Nothing to export."
-
-    # HACK: Force an update, so that bone tree is properly sorted for hierarchy table export
-    bpy.ops.object.mode_set(mode='EDIT', toggle=False)
-    bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-
-    # Check input objects, don't move this above hack!
-    for ob in bpy.data.objects:
-
-        # Take the first armature
-        if ob.type == 'ARMATURE' and len(ob.data.bones) > 0:
-            armature = ob
-            break
-    else:
-        return "No armature to export."
-
-    # Get the wanted bones
-    if use_selection:
-        bones = [b for b in armature.data.bones if b.select]
-    else:
-        bones = armature.data.bones
-
-    # Get armature matrix once for later global coords/matrices calculation per frame
-    a_matrix = armature.matrix_world
-
-    # There's valid data for export, create output file
-    try:
-        file = open(filepath, "w")
-    except IOError:
-        return "Could not open file for writing:\n%s" % filepath
-
-     # write the header
-    file.write("// XANIM_EXPORT file in CoD animation v3 format created with Blender v%s\n" \
-               % bpy.app.version_string)
-    file.write("// Source file: %s\n" % filepath)
-    file.write("// Export time: %s\n\n" % datetime.now().strftime("%d-%b-%Y %H:%M:%S"))
-    file.write("ANIMATION\n")
-    file.write("VERSION 3\n\n")
-
-    file.write("NUMPARTS %i\n" % len(bones))
-
-    # Write bone table
-    for i_bone, bone in enumerate(bones):
-        file.write("PART %i \"%s\"\n" % (i_bone, bone.name))
-
-    # Exporter shall use Blender's framerate (render settings, used as playback speed)
-    # Note: Time remapping not taken into account
-    file.write("\nFRAMERATE %i\n" % use_framerate)
-
-    file.write("NUMFRAMES %i\n\n" % (abs(use_frame_start - use_frame_end) + 1))
-
-    # If start frame greater than end frame, export animation reversed
-    if use_frame_start < use_frame_end:
-        frame_order = 1
-        frame_min = use_frame_start
-        frame_max = use_frame_end
-    else:
-        frame_order = -1
-        frame_min = use_frame_end
-        frame_max = use_frame_start
-
-    for i_frame, frame in enumerate(range(use_frame_start,
-                                          use_frame_end + frame_order,
-                                          frame_order),
-                                    frame_min):
-
-        file.write("FRAME %i\n" % i_frame)
-
-        # Set frame directly
-        context.scene.frame_set(frame)
-
-        # Get PoseBones for that frame
-        if use_selection:
-            bones = [b for b in armature.pose.bones if b.bone.select]
-        else:
-            bones = armature.pose.bones
-
-        # Write bone orientations
-        for i_bone, bone in enumerate(bones):
-
-            # Skip bone if 'Selection only' is enabled and bone not selected
-            if use_selection and not bone.bone.select: # It's actually posebone.bone!
-                continue
-
-            file.write("PART %i\n" % i_bone)
-
-
-            """ Doesn't seem to be right... or maybe it is? root can't have rotation, it rather sets the global orientation
-            if bone.parent is None:
-                file.write("OFFSET 0.000000 0.000000 0.000000\n")
-                file.write("SCALE 1.000000 1.000000 1.000000\n")
-                file.write("X 1.000000, 0.000000, 0.000000\n")
-                file.write("Y 0.000000, 1.000000, 0.000000\n")
-                file.write("Z 0.000000, 0.000000, 1.000000\n\n")
-            else:
-            """
-
-            b_tail = a_matrix * bone.tail
-            file.write("OFFSET %.6f %.6f %.6f\n" % (b_tail[0], b_tail[1], b_tail[2]))
-            file.write("SCALE 1.000000 1.000000 1.000000\n") # Is this even supported by CoD?
-            
-            file.write("X %.6f %.6f %.6f\n" % (bone.matrix[0][0], bone.matrix[1][0], bone.matrix[2][0]))
-            file.write("Y %.6f %.6f %.6f\n" % (bone.matrix[0][1], bone.matrix[1][1], bone.matrix[2][1]))
-            file.write("Z %.6f %.6f %.6f\n\n" % (bone.matrix[0][2], bone.matrix[1][2], bone.matrix[2][2]))
-
-            """
-            # Is a local matrix used (above) or a global?
-            # Rest pose bone roll shouldn't matter if local is used... o_O
-            # Note: Converting to xanim delta doesn't allow bone moves (only root?)
-            b_matrix = a_matrix * bone.matrix
-            file.write("X %.6f %.6f %.6f\n" % (b_matrix[0][0], b_matrix[1][0], b_matrix[2][0]))
-            file.write("Y %.6f %.6f %.6f\n" % (b_matrix[0][1], b_matrix[1][1], b_matrix[2][1]))
-            file.write("Z %.6f %.6f %.6f\n" % (b_matrix[0][2], b_matrix[1][2], b_matrix[2][2]))
-            """
-
-    # Blender timeline markers to notetrack nodes
-    markers = []
-    for m in context.scene.timeline_markers:
-        if frame_max >= m.frame >= frame_min:
-            markers.append([m.frame, m.name])
-    markers = sorted(markers)
-
-    # Cache marker string
-    marker_string = "NUMKEYS %i\n" % len(markers)
-
-    for m in markers:
-        marker_string += "FRAME %i \"%s\"\n" % (m[0], m[1])
-
-    # Write notetrack data
-    if use_notetrack_format == '7':
-        # Always 0 for CoD7, no matter if there are markers or not!
-        file.write("NUMKEYS 0\n")
-    else:
-        file.write("NOTETRACKS\n\n")
-
-        for i_bone, bone in enumerate(bones):
-
-            file.write("PART %i\n" % (i_bone))
-
-            if i_bone == 0 and use_notetrack and use_notetrack_format == '1' and len(markers) > 0:
-
-                file.write("NUMTRACKS 1\n\n")
-                file.write("NOTETRACK 0\n")
-                file.write(marker_string)
-                file.write("\n")
-
-            else:
-                file.write("NUMTRACKS 0\n\n")
-
-    # Close to flush buffers!
-    file.close()
-
-    if use_notetrack and use_notetrack_format in {'5', '7'}:
-
-        import os.path
-        filepath = os.path.splitext(filepath)[0] + ".NT_EXPORT"
-
-        try:
-            file = open(filepath, "w")
-        except IOError:
-            return "Could not open file for writing:\n%s" % filepath
-
-        if use_notetrack_format == '7':
-            file.write("FIRSTFRAME %i\n" % use_frame_start)
-            file.write("NUMFRAMES %i\n" % (abs(use_frame_end - use_frame_start) + 1))
-        file.write(marker_string)
-
-        file.close()
-
-    # Set frame_current and mode back
-    context.scene.frame_set(last_frame_current)
-    bpy.ops.object.mode_set(mode=last_mode, toggle=False)
-
-    # Quit with no errors
-    return
diff --git a/release/scripts/addons_contrib/io_scene_cod/export_xmodel.py b/release/scripts/addons_contrib/io_scene_cod/export_xmodel.py
deleted file mode 100644
index 72874c2..0000000
--- a/release/scripts/addons_contrib/io_scene_cod/export_xmodel.py
+++ /dev/null
@@ -1,732 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-"""
-Blender-CoD: Blender Add-On for Call of Duty modding
-Version: alpha 3
-
-Copyright (c) 2011 CoDEmanX, Flybynyt -- blender-cod at online.de
-
-http://code.google.com/p/blender-cod/
-
-"""
-
-import bpy
-import os
-from datetime import datetime
-
-def save(self, context, filepath="",
-         use_version='6',
-         use_selection=False,
-         use_apply_modifiers=True,
-         use_armature=True,
-         use_vertex_colors=True,
-         use_vertex_colors_alpha=False,
-         use_vertex_cleanup=False,
-         use_armature_pose=False,
-         use_frame_start=1,
-         use_frame_end=250,
-         use_weight_min=False,
-         use_weight_min_threshold=0.010097):
-
-    # There's no context object right after object deletion, need to set one
-    if context.object:
-        last_mode = context.object.mode
-    else:
-        last_mode = 'OBJECT'
-
-        for ob in bpy.data.objects:
-            if ob.type == 'MESH':
-                context.scene.objects.active = ob
-                break
-        else:
-            return "No mesh to export."
-
-    # HACK: Force an update, so that bone tree is properly sorted for hierarchy table export
-    bpy.ops.object.mode_set(mode='EDIT', toggle=False)
-    bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-
-    # Remember frame to set it back after export
-    last_frame_current = context.scene.frame_current
-
-    # Disable Armature for Pose animation export, bone.tail_local not available for PoseBones
-    if use_armature and use_armature_pose:
-        use_armature = False
-
-    # Don't iterate for a single frame
-    if not use_armature_pose or (use_armature_pose and use_frame_start == use_frame_end):
-        context.scene.frame_set(use_frame_start)
-
-        result = _write(self, context, filepath,
-                        use_version,
-                        use_selection,
-                        use_apply_modifiers,
-                        use_armature,
-                        use_vertex_colors,
-                        use_vertex_colors_alpha,
-                        use_vertex_cleanup,
-                        use_armature_pose,
-                        use_weight_min,
-                        use_weight_min_threshold)
-    else:
-
-        if use_frame_start < use_frame_end:
-            frame_order = 1
-            frame_min = use_frame_start
-            frame_max = use_frame_end
-        else:
-            frame_order = -1
-            frame_min = use_frame_end
-            frame_max = use_frame_start
-
-        # String length of highest frame number for filename padding
-        frame_strlen = len(str(frame_max))
-
-        filepath_split = os.path.splitext(filepath)
-
-        for i_frame, frame in enumerate(range(use_frame_start,
-                                              use_frame_end + frame_order,
-                                              frame_order
-                                              ),
-                                        frame_min):
-
-            # Set frame for export
-            # Don't do it directly to frame_current, as to_mesh() won't use updated frame!
-            context.scene.frame_set(frame)
-
-            # Generate filename including padded frame number
-            filepath_frame = "%s_%.*i%s" % (filepath_split[0], frame_strlen, i_frame, filepath_split[1])
-
-            result = _write(self, context, filepath_frame,
-                            use_version,
-                            use_selection,
-                            use_apply_modifiers,
-                            use_armature,
-                            use_vertex_colors,
-                            use_vertex_colors_alpha,
-                            use_vertex_cleanup,
-                            use_armature_pose,
-                            use_weight_min,
-                            use_weight_min_threshold
-                            )
-
-            # Quit iteration on error
-            if result:
-                context.scene.frame_set(last_frame_current)
-                return result
-
-    # Set frame back
-    context.scene.frame_set(last_frame_current)
-
-    # Set mode back
-    bpy.ops.object.mode_set(mode=last_mode, toggle=False)
-
-    # Handle possible error result of single frame export
-    return result
-
-def _write(self, context, filepath,
-           use_version,
-           use_selection,
-           use_apply_modifiers,
-           use_armature,
-           use_vertex_colors,
-           use_vertex_colors_alpha,
-           use_vertex_cleanup,
-           use_armature_pose,
-           use_weight_min,
-           use_weight_min_threshold):
-
-    num_verts = 0
-    num_verts_unique = 0
-    verts_unique = []
-    num_faces = 0
-    meshes = []
-    meshes_matrix = []
-    meshes_vgroup = []
-    objects = []
-    armature = None
-    bone_mapping = {}
-    materials = []
-
-    ob_count = 0
-    v_count = 0
-
-    # Check input objects, count them and convert mesh objects
-    for ob in bpy.data.objects:
-
-        # Take the first armature
-        if ob.type == 'ARMATURE' and use_armature and armature is None and len(ob.data.bones) > 0:
-            armature = ob
-            continue
-
-        if ob.type != 'MESH':
-            continue
-
-        # Skip meshes, which are unselected
-        if use_selection and not ob.select:
-            continue
-
-        # Set up modifiers whether to apply deformation or not
-        mod_states = []
-        for mod in ob.modifiers:
-            mod_states.append(mod.show_viewport)
-            if mod.type == 'ARMATURE':
-                mod.show_viewport = mod.show_viewport and use_armature_pose
-            else:
-                mod.show_viewport = mod.show_viewport and use_apply_modifiers
-
-        # to_mesh() applies enabled modifiers only
-        mesh = ob.to_mesh(scene=context.scene, apply_modifiers=True, settings='PREVIEW')
-
-        # Restore modifier settings
-        for i, mod in enumerate(ob.modifiers):
-            mod.show_viewport = mod_states[i]
-
-        # Skip invalid meshes
-        if len(mesh.vertices) < 3:
-            _skip_notice(ob.name, mesh.name, "Less than 3 vertices")
-            continue
-        if len(mesh.tessfaces) < 1:
-            _skip_notice(ob.name, mesh.name, "No faces")
-            continue
-        if len(ob.material_slots) < 1:
-            _skip_notice(ob.name, mesh.name, "No material")
-            continue
-        if not mesh.tessface_uv_textures:
-            _skip_notice(ob.name, mesh.name, "No UV texture, not unwrapped?")
-            continue
-
-        meshes.append(mesh)
-        meshes_matrix.append(ob.matrix_world)
-
-        if ob.vertex_groups:
-            meshes_vgroup.append(ob.vertex_groups)
-        else:
-            meshes_vgroup.append(None)
-
-        if use_vertex_cleanup:
-
-            # Retrieve verts which belong to a face
-            verts = []
-            for f in mesh.tessfaces:
-                for v in f.vertices:
-                    verts.append(v)
-
-            # Uniquify & sort
-            keys = {}
-            for e in verts:
-                keys[e] = 1
-            verts = list(keys.keys())
-
-        else:
-            verts = [v.index for v in mesh.vertices]
-
-        # Store vert sets, aligned to mesh objects
-        verts_unique.append(verts)
-
-        # As len(mesh.vertices) doesn't take unused verts into account, already count here
-        num_verts_unique += len(verts)
-
-        # Take quads into account!
-        for f in mesh.tessfaces:
-            if len(f.vertices) == 3:
-                num_faces += 1
-            else:
-                num_faces += 2
-
-        objects.append(ob.name)
-
-    if (num_verts or num_faces or len(objects)) == 0:
-        return "Nothing to export.\n" \
-               "Meshes must have at least:\n" \
-               "    3 vertices\n" \
-               "    1 face\n" \
-               "    1 material\n" \
-               "    UV mapping"
-
-    # There's valid data for export, create output file
-    try:
-        file = open(filepath, "w")
-    except IOError:
-        return "Could not open file for writing:\n%s" % filepath
-
-    # Write header
-    file.write("// XMODEL_EXPORT file in CoD model v%i format created with Blender v%s\n" \
-               % (int(use_version), bpy.app.version_string))
-
-    file.write("// Source file: %s\n" % bpy.data.filepath)
-    file.write("// Export time: %s\n\n" % datetime.now().strftime("%d-%b-%Y %H:%M:%S"))
-
-    if use_armature_pose:
-        file.write("// Posed model of frame %i\n\n" % bpy.context.scene.frame_current)
-
-    if use_weight_min:
-        file.write("// Minimum bone weight: %f\n\n" % use_weight_min_threshold)
-
-    file.write("MODEL\n")
-    file.write("VERSION %i\n" % int(use_version))
-
-    # Write armature data
-    if armature is None:
-
-        # Default rig
-        file.write("\nNUMBONES 1\n")
-        file.write("BONE 0 -1 \"tag_origin\"\n")
-
-        file.write("\nBONE 0\n")
-
-        if use_version == '5':
-            file.write("OFFSET 0.000000 0.000000 0.000000\n")
-            file.write("SCALE 1.000000 1.000000 1.000000\n")
-            file.write("X 1.000000 0.000000 0.000000\n")
-            file.write("Y 0.000000 1.000000 0.000000\n")
-            file.write("Z 0.000000 0.000000 1.000000\n")
-        else:
-            # Model format v6 has commas
-            file.write("OFFSET 0.000000, 0.000000, 0.000000\n")
-            file.write("SCALE 1.000000, 1.000000, 1.000000\n")
-            file.write("X 1.000000, 0.000000, 0.000000\n")
-            file.write("Y 0.000000, 1.000000, 0.000000\n")
-            file.write("Z 0.000000, 0.000000, 1.000000\n")
-
-    else:
-
-        # Either use posed armature bones for animation to model sequence export
-        if use_armature_pose:
-            bones = armature.pose.bones
-        # Or armature bones in rest pose for regular rigged models
-        else:
-            bones = armature.data.bones
-
-        file.write("\nNUMBONES %i\n" % len(bones))
-
-        # Get the armature object's orientation
-        a_matrix = armature.matrix_world
-
-        # Check for multiple roots, armature should have exactly one
-        roots = 0
-        for bone in bones:
-            if not bone.parent:
-                roots += 1
-        if roots != 1:
-            warning_string = "Warning: %i root bones found in armature object '%s'\n" \
-                             % (roots, armature.name)
-            print(warning_string)
-            file.write("// %s" % warning_string)
-
-        # Look up table for bone indices
-        bone_table = [b.name for b in bones]
-
-        # Write bone hierarchy table and create bone_mapping array for later use (vertex weights)
-        for i, bone in enumerate(bones):
-
-            if bone.parent:
-                try:
-                    bone_parent_index = bone_table.index(bone.parent.name)
-                except (ValueError):
-                    bone_parent_index = 0
-                    file.write("// Warning: \"%s\" not found in bone table, binding to root...\n"
-                               % bone.parent.name)
-            else:
-                bone_parent_index = -1
-
-            file.write("BONE %i %i \"%s\"\n" % (i, bone_parent_index, bone.name))
-            bone_mapping[bone.name] = i
-
-        # Write bone orientations
-        for i, bone in enumerate(bones):
-            file.write("\nBONE %i\n" % i)
-
-            # Using local tail for proper coordinates
-            b_tail = a_matrix * bone.tail_local
-
-            # TODO: Fix calculation/error: pose animation will use posebones, but they don't have tail_local!
-
-            # TODO: Fix rotation matrix calculation, calculation seems to be wrong...
-            #b_matrix = bone.matrix_local * a_matrix
-            #b_matrix = bone.matrix * a_matrix * bones[0].matrix.inverted()
-            #from mathutils import Matrix
-
-            # Is this the way to go? Or will it fix the root only, but mess up all other roll angles?
-            if i == 0:
-                b_matrix = ((1,0,0),(0,1,0),(0,0,1))
-            else:
-                b_matrix = a_matrix * bone.matrix_local
-                #from mathutils import Matrix
-                #b_matrix = bone.matrix_local * a_matrix * Matrix(((1,-0,0),(0,0,-1),(-0,1,0)))
-                
-            if use_version == '5':
-                file.write("OFFSET %.6f %.6f %.6f\n" % (b_tail[0], b_tail[1], b_tail[2]))
-                file.write("SCALE 1.000000 1.000000 1.000000\n") # Is this even supported by CoD?
-                file.write("X %.6f %.6f %.6f\n" % (b_matrix[0][0], b_matrix[1][0], b_matrix[2][0]))
-                file.write("Y %.6f %.6f %.6f\n" % (b_matrix[0][1], b_matrix[1][1], b_matrix[2][1]))
-                file.write("Z %.6f %.6f %.6f\n" % (b_matrix[0][2], b_matrix[1][2], b_matrix[2][2]))
-            else:
-                file.write("OFFSET %.6f, %.6f, %.6f\n" % (b_tail[0], b_tail[1], b_tail[2]))
-                file.write("SCALE 1.000000, 1.000000, 1.000000\n")
-                file.write("X %.6f, %.6f, %.6f\n" % (b_matrix[0][0], b_matrix[1][0], b_matrix[2][0]))
-                file.write("Y %.6f, %.6f, %.6f\n" % (b_matrix[0][1], b_matrix[1][1], b_matrix[2][1]))
-                file.write("Z %.6f, %.6f, %.6f\n" % (b_matrix[0][2], b_matrix[1][2], b_matrix[2][2]))
-
-    # Write vertex data
-    file.write("\nNUMVERTS %i\n" % num_verts_unique)
-
-    for i, me in enumerate(meshes):
-
-        # Get the right object matrix for mesh
-        mesh_matrix = meshes_matrix[i]
-
-        # Get bone influences per vertex
-        if armature is not None and meshes_vgroup[i] is not None:
-
-            groupNames, vWeightList = meshNormalizedWeights(meshes_vgroup[i],
-                                                            me,
-                                                            use_weight_min,
-                                                            use_weight_min_threshold
-                                                            )
-            # Get bones by vertex_group names, bind to root if can't find one 
-            groupIndices = [bone_mapping.get(g, -1) for g in groupNames]
-
-            weight_group_list = []
-            for weights in vWeightList:
-                weight_group_list.append(sorted(zip(weights, groupIndices), reverse=True))
-
-        # Use uniquified vert sets and count the verts
-        for i_vert, vert in enumerate(verts_unique[i]):
-            v = me.vertices[vert]
-
-            # Calculate global coords
-            x = mesh_matrix[0][0] * v.co[0] + \
-                mesh_matrix[0][1] * v.co[1] + \
-                mesh_matrix[0][2] * v.co[2] + \
-                mesh_matrix[0][3]
-
-            y = mesh_matrix[1][0] * v.co[0] + \
-                mesh_matrix[1][1] * v.co[1] + \
-                mesh_matrix[1][2] * v.co[2] + \
-                mesh_matrix[1][3]
-
-            z = mesh_matrix[2][0] * v.co[0] + \
-                mesh_matrix[2][1] * v.co[1] + \
-                mesh_matrix[2][2] * v.co[2] + \
-                mesh_matrix[2][3]
-                
-            #print("%.6f %.6f %.6f single calced xyz\n%.6f %.6f %.6f mat mult" % (x, y, z, ))
-
-            file.write("VERT %i\n" % (i_vert + v_count))
-
-            if use_version == '5':
-                file.write("OFFSET %.6f %.6f %.6f\n" % (x, y, z))
-            else:
-                file.write("OFFSET %.6f, %.6f, %.6f\n" % (x, y, z))
-
-            # Write bone influences
-            if armature is None or meshes_vgroup[i] is None:
-                file.write("BONES 1\n")
-                file.write("BONE 0 1.000000\n\n")
-            else:
-                cache = ""
-                c_bones = 0
-
-                for weight, bone_index in weight_group_list[v.index]:
-                    if (use_weight_min and round(weight, 6) < use_weight_min_threshold) or \
-                       (not use_weight_min and round(weight, 6) == 0):
-                        # No (more) bones with enough weight, totalweight of 0 would lead to error
-                        break
-                    cache += "BONE %i %.6f\n" % (bone_index, weight)
-                    c_bones += 1
-
-                if c_bones == 0:
-                    warning_string = "Warning: No bone influence found for vertex %i, binding to bone %i\n" \
-                                     % (v.index, bone_index)
-                    print(warning_string)
-                    file.write("// %s" % warning_string)
-                    file.write("BONES 1\n")
-                    file.write("BONE %i 0.000001\n\n" % bone_index) # HACK: Is a minimum weight a good idea?
-                else:
-                    file.write("BONES %i\n%s\n" % (c_bones, cache))
-
-        v_count += len(verts_unique[i]);
-
-    # TODO: Find a better way to keep track of the vertex index?
-    v_count = 0
-
-    # Prepare material array
-    for me in meshes:
-        for f in me.tessfaces:
-            try:
-                mat = me.materials[f.material_index]
-            except (IndexError):
-                # Mesh has no material with this index
-                # Note: material_index is never None (will be 0 instead)
-                continue
-            else:
-                if mat not in materials:
-                    materials.append(mat)
-
-    # Write face data
-    file.write("\nNUMFACES %i\n" % num_faces)
-
-    for i_me, me in enumerate(meshes):
-
-        #file.write("// Verts:\n%s\n" % list(enumerate(verts_unique[i_me])))
-
-        for f in me.tessfaces:
-
-            try:
-                mat = me.materials[f.material_index]
-
-            except (IndexError):
-                mat_index = 0
-
-                warning_string = "Warning: Assigned material with index %i not found, falling back to first\n" \
-                                  % f.material_index
-                print(warning_string)
-                file.write("// %s" % warning_string)
-
-            else:
-                try:
-                    mat_index = materials.index(mat)
-
-                except (ValueError):
-                    mat_index = 0
-
-                    warning_string = "Warning: Material \"%s\" not mapped, falling back to first\n" \
-                                      % mat.name
-                    print(warning_string)
-                    file.write("// %s" % warning_string)
-
-            # Support for vertex colors
-            if me.tessface_vertex_colors:
-                col = me.tessface_vertex_colors.active.data[f.index]
-
-            # Automatic triangulation support
-            f_v_orig = [v for v in enumerate(f.vertices)]
-
-            if len(f_v_orig) == 3:
-                f_v_iter = (f_v_orig[2], f_v_orig[1], f_v_orig[0]), # HACK: trailing comma to force a tuple
-            else:
-                f_v_iter = (f_v_orig[2], f_v_orig[1], f_v_orig[0]), (f_v_orig[3], f_v_orig[2], f_v_orig[0])
-
-            for iter in f_v_iter:
-
-                # TODO: Test material# export (v5 correct?)
-                if use_version == '5':
-                    file.write("TRI %i %i 0 1\n" % (ob_count, mat_index))
-                else:
-                    file.write("TRI %i %i 0 0\n" % (ob_count, mat_index))
-
-                for vi, v in iter:
-
-                    no = me.vertices[v].normal # Invert? Orientation seems to have no effect...
-
-                    uv = me.tessface_uv_textures.active
-                    uv1 = uv.data[f.index].uv[vi][0]
-                    uv2 = 1 - uv.data[f.index].uv[vi][1] # Flip!
-
-                    #if 0 > uv1 > 1 
-                    # TODO: Warn if accidentally tiling ( uv <0 or >1 )
-
-                    # Remap vert indices used by face
-                    if use_vertex_cleanup:
-                        vert_new = verts_unique[i_me].index(v) + v_count
-                        #file.write("// %i (%i) --> %i\n" % (v+v_count, v, vert_new))
-                    else:
-                        vert_new = v + v_count
-
-                    if use_version == '5':
-                        file.write("VERT %i %.6f %.6f %.6f %.6f %.6f\n" \
-                                   % (vert_new, uv1, uv2, no[0], no[1], no[2]))
-                    else:
-                        file.write("VERT %i\n" % vert_new)
-                        file.write("NORMAL %.6f %.6f %.6f\n" % (no[0], no[1], no[2]))
-
-                        if me.tessface_vertex_colors and use_vertex_colors:
-
-                            if vi == 0:
-                                c = col.color1
-                            elif vi == 1:
-                                c = col.color2
-                            elif vi == 2:
-                                c = col.color3
-                            else:
-                                c = col.color4
-
-                            if use_vertex_colors_alpha:
-
-                                # Turn RGB into grayscale (luminance conversion)
-                                c_lum = c[0] * 0.3 + c[1] * 0.59 + c[2] * 0.11
-                                file.write("COLOR 1.000000 1.000000 1.000000 %.6f\n" % c_lum)
-                            else:
-                                file.write("COLOR %.6f %.6f %.6f 1.000000\n" % (c[0], c[1], c[2]))
-
-                        else:
-                            file.write("COLOR 1.000000 1.000000 1.000000 1.000000\n")
-
-                        file.write("UV 1 %.6f %.6f\n" % (uv1, uv2))
-
-        # Note: Face types (tris/quads) have nothing to do with vert indices!
-        if use_vertex_cleanup:
-            v_count += len(verts_unique[i_me])
-        else:
-            v_count += len(me.vertices)
-
-        ob_count += 1
-
-    # Write object data
-    file.write("\nNUMOBJECTS %i\n" % len(objects))
-
-    for i_ob, ob in enumerate(objects):
-        file.write("OBJECT %i \"%s\"\n" % (i_ob, ob))
-
-    # Static material string
-    material_string = ("COLOR 0.000000 0.000000 0.000000 1.000000\n"
-                       "TRANSPARENCY 0.000000 0.000000 0.000000 1.000000\n"
-                       "AMBIENTCOLOR 0.000000 0.000000 0.000000 1.000000\n"
-                       "INCANDESCENCE 0.000000 0.000000 0.000000 1.000000\n"
-                       "COEFFS 0.800000 0.000000\n"
-                       "GLOW 0.000000 0\n"
-                       "REFRACTIVE 6 1.000000\n"
-                       "SPECULARCOLOR -1.000000 -1.000000 -1.000000 1.000000\n"
-                       "REFLECTIVECOLOR -1.000000 -1.000000 -1.000000 1.000000\n"
-                       "REFLECTIVE -1 -1.000000\n"
-                       "BLINN -1.000000 -1.000000\n"
-                       "PHONG -1.000000\n\n"
-                       )
-
-    if len(materials) > 0:
-        file.write("\nNUMMATERIALS %i\n" % len(materials))
-
-        for i_mat, mat in enumerate(materials):
-
-            try:
-                for i_ts, ts in enumerate(mat.texture_slots):
-
-                    # Skip empty slots and disabled textures
-                    if not ts or not mat.use_textures[i_ts]:
-                        continue
-
-                    # Image type and Color map? If yes, add to material array and index
-                    if ts.texture.type == 'IMAGE' and ts.use_map_color_diffuse:
-
-                        # Pick filename of the first color map
-                        imagepath = ts.texture.image.filepath
-                        imagename = os.path.split(imagepath)[1]
-                        if len(imagename) == 0:
-                            imagename = "untitled"
-                        break
-                else:
-                    raise(ValueError)
-
-            except:
-                imagename = "no color diffuse map found"
-
-            # Material can be assigned and None
-            if mat:
-                mat_name = mat.name
-                mat_shader = mat.diffuse_shader.capitalize()
-            else:
-                mat_name = "None"
-                mat_shader = "Lambert"
-
-            if use_version == '5':
-                file.write("MATERIAL %i \"%s\"\n" % (i_mat, imagename))
-                # or is it mat.name at filename?
-            else:
-                file.write("MATERIAL %i \"%s\" \"%s\" \"%s\"\n" % (
-                           i_mat,
-                           mat_name,
-                           mat_shader,
-                           imagename
-                           ))
-                file.write(material_string)
-    else:
-        # Write a default material
-        # Should never happen, nothing to export / mesh without material exceptions already caught
-        file.write("\nNUMMATERIALS 1\n")
-        if use_version == '5':
-            file.write("MATERIAL 0 \"default.tga\"\n")
-        else:
-            file.write("MATERIAL 0 \"$default\" \"Lambert\" \"untitled\"\n")
-            file.write(material_string)
-
-    # Close to flush buffers!
-    file.close()
-
-    # Remove meshes, which were made by to_mesh()
-    for mesh in meshes:
-        mesh.user_clear()
-        bpy.data.meshes.remove(mesh)    
-
-    # Quit with no errors
-    return
-
-# Taken from export_fbx.py by Campbell Barton
-# Modified to accept vertex_groups directly instead of mesh object
-def BPyMesh_meshWeight2List(vgroup, me):
-
-    """ Takes a mesh and return its group names and a list of lists, one list per vertex.
-    aligning the each vert list with the group names, each list contains float value for the weight.
-    These 2 lists can be modified and then used with list2MeshWeight to apply the changes.
-    """
-
-    # Clear the vert group.
-    groupNames = [g.name for g in vgroup]
-    len_groupNames = len(groupNames)
-
-    if not len_groupNames:
-        # no verts? return a vert aligned empty list
-        #return [[] for i in range(len(me.vertices))], []
-        return [], []
-
-    else:
-        vWeightList = [[0.0] * len_groupNames for i in range(len(me.vertices))]
-
-    for i, v in enumerate(me.vertices):
-        for g in v.groups:
-            # possible weights are out of range
-            index = g.group
-            if index < len_groupNames:
-                vWeightList[i][index] = g.weight
-
-    return groupNames, vWeightList
-
-def meshNormalizedWeights(vgroup, me, weight_min, weight_min_threshold):
-
-    groupNames, vWeightList = BPyMesh_meshWeight2List(vgroup, me)
-
-    if not groupNames:
-        return [], []
-
-    for vWeights in vWeightList:
-        tot = 0.0
-        for w in vWeights:
-            if weight_min and w < weight_min_threshold:
-                w = 0.0
-            tot += w
-
-        if tot:
-            for j, w in enumerate(vWeights):
-                vWeights[j] = w / tot
-
-    return groupNames, vWeightList
-
-def _skip_notice(ob_name, mesh_name, notice):
-    print("\nSkipped object \"%s\" (mesh \"%s\"): %s" % (ob_name, mesh_name, notice))
diff --git a/release/scripts/addons_contrib/io_scene_cod/import_xanim.py b/release/scripts/addons_contrib/io_scene_cod/import_xanim.py
deleted file mode 100644
index 4d79034..0000000
--- a/release/scripts/addons_contrib/io_scene_cod/import_xanim.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-"""
-Blender-CoD: Blender Add-On for Call of Duty modding
-Version: alpha 3
-
-Copyright (c) 2011 CoDEmanX, Flybynyt -- blender-cod at online.de
-
-http://code.google.com/p/blender-cod/
-
-TODO
-- Implement xanim import (apply anim data to the armature of a loaded model)
-
-"""
-
-def load(self, context, **keywords):
-
-    #filepath = os.fsencode(filepath)
-
-    return {'FINISHED'}
diff --git a/release/scripts/addons_contrib/io_scene_cod/import_xmodel.py b/release/scripts/addons_contrib/io_scene_cod/import_xmodel.py
deleted file mode 100644
index 6f862e0..0000000
--- a/release/scripts/addons_contrib/io_scene_cod/import_xmodel.py
+++ /dev/null
@@ -1,392 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-"""
-Blender-CoD: Blender Add-On for Call of Duty modding
-Version: alpha 3
-
-Copyright (c) 2011 CoDEmanX, Flybynyt -- blender-cod at online.de
-
-http://code.google.com/p/blender-cod/
-
-NOTES
-- Code is in early state of development and work in progress!
-- Importing rigs from XMODEL_EXPORT v6 works, but the code is really messy.
-
-TODO
-- Implement full xmodel import
-
-"""
-
-import os
-import bpy
-from mathutils import *
-import math
-#from mathutils.geometry import tesselate_polygon
-#from io_utils import load_image, unpack_list, unpack_face_list
-
-def round_matrix_3x3(mat, precision=6):
-    return Matrix(((round(mat[0][0],precision), round(mat[0][1],precision), round(mat[0][2],precision)),
-                (round(mat[1][0],precision), round(mat[1][1],precision), round(mat[1][2],precision)),
-                (round(mat[2][0],precision), round(mat[2][1],precision), round(mat[2][2],precision))))
-
-def load(self, context, filepath=""):
-
-    filepath = os.fsencode(filepath)
-
-    test_0 = []
-    test_1 = []
-    test_2 = []
-    test_3 = []
-
-    state = 0
-
-    # placeholders
-    vec0 = Vector((0.0, 0.0, 0.0))
-    mat0 = Matrix(((0.0, 0.0, 0.0),(0.0, 0.0, 0.0),(0.0, 0.0, 0.0)))
-
-    numbones = 0
-    numbones_i = 0
-    bone_i = 0
-    bone_table = []
-    numverts = 0
-    vert_i = 0
-    vert_table = [] # allocate table? [0]*numverts
-    face_i = 0
-    face_tmp = []
-    face_table = []
-    bones_influencing_num = 0
-    bones_influencing_i = 0
-    numfaces = 0
-
-    print("\nImporting %s" % filepath)
-
-    try:
-        file = open(filepath, "r")
-    except IOError:
-        return "Could not open file for reading:\n%s" % filepath
-
-    for line in file:
-        line = line.strip()
-        line_split = line.split()
-
-        # Skip empty and comment lines
-        if not line or line[0] == "/":
-            continue
-
-        elif state == 0 and line_split[0] == "MODEL":
-            state = 1
-
-        elif state == 1 and line_split[0] == "VERSION":
-            if line_split[1] != "6":
-                error_string = "Unsupported version: %s" % line_split[1]
-                print("\n%s" % error_string)
-                return error_string
-            state = 2
-
-        elif state == 2 and line_split[0] == "NUMBONES":
-            numbones = int(line_split[1])
-            state = 3
-
-        elif state == 3 and line_split[0] == "BONE":
-            if numbones_i != int(line_split[1]):
-                error_string = "Unexpected bone number: %s (expected %i)" % (line_split[1], numbones_i)
-                print("\n%s" % error_string)
-                return error_string
-            bone_table.append((line_split[3][1:-1], int(line_split[2]), vec0, mat0))
-            test_0.append(line_split[3][1:-1])
-            test_1.append(int(line_split[2]))
-            if numbones_i >= numbones-1:
-                state = 4
-            else:
-                numbones_i += 1
-
-        elif state == 4 and line_split[0] == "BONE":
-            bone_num = int(line_split[1])
-            if bone_i != bone_num:
-                error_string = "Unexpected bone number: %s (expected %i)" % (line_split[1], bone_i)
-                print("\n%s" % error_string)
-                return error_string
-            state = 5
-
-        elif state == 5 and line_split[0] == "OFFSET":
-            # remove commas - line_split[#][:-1] would also work, but isn't as save
-            line_split = line.replace(",", "").split()
-
-            # should we check for len(line_split) to ensure we got enough elements?
-            # Note: we can't assign a new vector to tuple object, we need to change each value
-
-            bone_table[bone_i][2].xyz = Vector((float(line_split[1]), float(line_split[2]), float(line_split[3])))
-            #print("\nPROBLEMATIC: %s" % bone_table[bone_i][2])
-            #NO ERROR HERE, but for some reason the whole table will contain the same vectors
-            #bone_table[bone_i][2][0] = float(line_split[1])
-            #bone_table[bone_i][2][1] = float(line_split[2])
-            #bone_table[bone_i][2][2] = float(line_split[3])
-            test_2.append(Vector((float(line_split[1]),float(line_split[2]),float(line_split[3]))))
-
-            state = 6
-
-        elif state == 6 and line_split[0] == "SCALE":
-            # always 1.000000?! no processing so far...
-            state = 7
-
-        elif state == 7 and line_split[0] == "X":
-            line_split = line.replace(",", "").split()
-            bone_table[bone_i][3][0] = Vector((float(line_split[1]), float(line_split[2]), float(line_split[3])))
-
-            """ Use something like this:
-            bone.align_roll(targetmatrix[2])
-            roll = roll%360 #nicer to have it 0-359.99...
-            """
-            m_col = []
-            m_col.append((float(line_split[1]), float(line_split[2]), float(line_split[3])))
-            
-            state = 8
-
-        elif state == 8 and line_split[0] == "Y":
-            line_split = line.replace(",", "").split()
-            bone_table[bone_i][3][1] = Vector((float(line_split[1]), float(line_split[2]), float(line_split[3])))
-            
-            m_col.append((float(line_split[1]), float(line_split[2]), float(line_split[3])))
-
-            state = 9
-
-        elif state == 9 and line_split[0] == "Z":
-            line_split = line.replace(",", "").split()
-            vec_roll = Vector((float(line_split[1]), float(line_split[2]), float(line_split[3])))
-            ##bone_table[bone_i][3][2] = vec_roll
-            #print("bone_table: %s" % bone_table[bone_i][3][2])
-            
-            m_col.append((float(line_split[1]), float(line_split[2]), float(line_split[3])))
-
-            #test_3.append(Vector(vec_roll))
-            
-            test_3.append(m_col)
-            #print("test_3: %s\n\n" % test_3[:])
-
-            if bone_i >= numbones-1:
-                state = 10
-            else:
-                #print("\n---> Increasing bone: %3i" % bone_i)
-                #print("\t" + str(bone_table[bone_i][3]))
-                #print("\t" + str(bone_table[bone_i][0]))
-                bone_i += 1
-                state = 4
-
-        elif state == 10 and line_split[0] == "NUMVERTS":
-            numverts = int(line_split[1])
-            state = 11
-
-        elif state == 11 and line_split[0] == "VERT":
-            vert_num = int(line_split[1])
-            if vert_i != vert_num:
-                error_string = "Unexpected vertex number: %s (expected %i)" % (line_split[1], vert_i)
-                print("\n%s" % error_string)
-                return error_string
-            vert_i += 1
-            state = 12
-
-        elif state == 12 and line_split[0] == "OFFSET":
-            line_split = line.replace(",", "").split()
-            vert_table.append(Vector((float(line_split[1]), float(line_split[2]), float(line_split[3]))))
-            state = 13
-
-        elif state == 13 and line_split[0] == "BONES":
-            # TODO: process
-            bones_influencing_num = int(line_split[1])
-            state= 14
-
-        elif state == 14 and line_split[0] == "BONE":
-            # TODO: add bones to vert_table
-            if bones_influencing_i >= bones_influencing_num-1:
-                if vert_i >= numverts:
-                    state = 15
-                else:
-                    state = 11
-            else:
-                bones_influencing_i += 1
-                #state = 14
-
-        elif state == 15 and line_split[0] == "NUMFACES":
-            numfaces = int(line_split[1])
-            state = 16
-            
-        elif state == 16: #and line_split[0] == "TRI":
-            #face_i += 1
-            face_tmp = []
-            state = 17
-            
-        elif (state == 17 or state == 21 or state == 25) and line_split[0] == "VERT":
-            #print("face_tmp length: %i" % len(face_tmp))
-            face_tmp.append(int(line_split[1]))
-            state += 1
-        
-        elif (state == 18 or state == 22 or state == 26) and line_split[0] == "NORMAL":
-            state += 1
-            
-        elif (state == 19 or state == 23 or state == 27) and line_split[0] == "COLOR":
-            state += 1
-            
-        elif (state == 20 or state == 24 or state == 28) and line_split[0] == "UV":
-            state += 1
-        
-        elif state == 29:
-
-            #print("Adding face: %s\n%i faces so far (of %i)\n" % (str(face_tmp), face_i, numfaces))
-            face_table.append(face_tmp)
-            if (face_i >= numfaces - 1):
-                state = 30
-            else:
-                face_i += 1
-                face_tmp = []
-                state = 17
-                
-        elif state > 15 and state < 30 and line_split[0] == "NUMOBJECTS":
-            print("Bad numfaces, terminated loop\n")
-            state = 30
-            
-        elif state == 30:
-            print("Adding mesh!")
-            me = bpy.data.meshes.new("pymesh")
-            me.from_pydata(vert_table, [], face_table)
-            me.update()
-            ob = bpy.data.objects.new("Py-Mesh", me)
-            bpy.context.scene.objects.link(ob)
-            
-            state = 31
-
-        else: #elif state == 16:
-            #UNDONE
-            print("eh? state is %i line: %s" % (state, line))
-            pass
-
-        #print("\nCurrent state=" + str(state) + "\nLine:" + line)
-
-    #print("\n" + str(list(bone_table)) + "\n\n" + str(list(vert_table)))
-
-    #createRig(context, "Armature", Vector((0,0,0)), bone_table)
-
-    name = "Armature"
-    origin = Vector((0,0,0))
-    boneTable = bone_table
-
-    # If no context object, an object was deleted and mode is 'OBJECT' for sure
-    if context.object: #and context.mode is not 'OBJECT':
-
-        # Change mode, 'cause modes like POSE will lead to incorrect context poll
-        bpy.ops.object.mode_set(mode='OBJECT')
-
-    # Create armature and object
-    bpy.ops.object.add(
-        type='ARMATURE', 
-        enter_editmode=True,
-        location=origin)
-    ob = bpy.context.object
-    ob.show_x_ray = True
-    ob.name = name
-    amt = ob.data
-    amt.name = name + "Amt"
-    #amt.show_axes = True
-
-    # Create bones
-    bpy.ops.object.mode_set(mode='EDIT')
-    #for (bname, pname, vector, matrix) in boneTable:
-    #i = 0
-    for (t0, t1, t2, t3) in zip(test_0, test_1, test_2, test_3):
-
-        t3 = Matrix(t3)
-
-        bone = amt.edit_bones.new(t0)
-        if t1 != -1:
-            parent = amt.edit_bones[t1]
-            bone.parent = parent
-            bone.head = parent.tail
-
-            bone.align_roll((parent.matrix.to_3x3()*t3)[2])
-            #local_mat = parent.matrix.to_3x3() * t3()
-            #bone.align_roll(local_mat[2])
-            from math import degrees
-            print("t3[2]: %s\nroll: %f\n---------" % (t3.col[2], degrees(bone.roll)))
-            #bone.roll = math.radians(180 - math.degrees(bone.roll))
-            #print("###\nalign_roll: %s\nroll: %.2f\ntest_3:%s" % (t3, math.degrees(bone.roll), list(test_3)))
-            bone.use_connect = True
-        else:
-            bone.head = (0,0,0)
-            rot = Matrix.Translation((0,0,0))	# identity matrix
-            bone.align_roll(t3[2])
-            bone.use_connect = False
-        bone.tail = t2
-
-    file.close()
-
-"""
-def createRig(context, name, origin, boneTable):
-
-    # If no context object, an object was deleted and mode is 'OBJECT' for sure
-    if context.object: #and context.mode is not 'OBJECT':
-
-        # Change mode, 'cause modes like POSE will lead to incorrect context poll
-        bpy.ops.object.mode_set(mode='OBJECT')
-
-    # Create armature and object
-    bpy.ops.object.add(
-        type='ARMATURE', 
-        enter_editmode=True,
-        location=origin)
-    ob = bpy.context.object
-    ob.show_x_ray = True
-    ob.name = name
-    amt = ob.data
-    amt.name = name + "Amt"
-    #amt.show_axes = True
-
-    # Create bones
-    bpy.ops.object.mode_set(mode='EDIT')
-    #for (bname, pname, vector, matrix) in boneTable:
-    #i = 0
-    for i in range(len(test_0)):
-        t0 = test_0[i]
-        t1 = test_1[i]
-        t2 = test_2[i]
-        t3 = test_3[i]
-
-        bone = amt.edit_bones.new(t0)
-        if t1 != -1:
-            parent = amt.edit_bones[t1]
-            bone.parent = parent
-            bone.head = parent.tail
-            bone.use_connect = True
-            bone.align_roll(t3)
-            #print("align_roll: %s\nroll: %.2f" % (t3, math.degrees(bone.roll)))
-            #(trans, rot, scale) = parent.matrix.decompose()
-        else:
-            bone.head = (0,0,0)
-            rot = Matrix.Translation((0,0,0))	# identity matrix
-            bone.use_connect = False
-        #bone.tail = Vector(vector) * rot + bone.head
-        bone.tail = t2
-        #bone.tail = boneTable[i][2] #passing boneTable as parameter seems to break it :(
-        #i += 1
-
-    #outfile.write("\n%s" % str(boneTable))
-
-    bpy.ops.object.mode_set(mode='OBJECT')
-    return ob
-"""
diff --git a/release/scripts/addons_contrib/io_scene_m3/__init__.py b/release/scripts/addons_contrib/io_scene_m3/__init__.py
deleted file mode 100644
index 1d2785b..0000000
--- a/release/scripts/addons_contrib/io_scene_m3/__init__.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    'name': 'Import Blizzard M3 format (.m3)',
-    'author': 'Cory Perry',
-    'version': (0, 2, 1),
-    "blender": (2, 57, 0),
-    'location': 'File > Import > Blizzard M3 (.m3)',
-    'description': 'Imports the Blizzard M3 format (.m3)',
-    'warning': 'Broken',
-    'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/'\
-        'Import-Export/M3_Import',
-    'tracker_url': 'http://projects.blender.org/tracker/index.php?'\
-        'func=detail&aid=24017',
-    'category': 'Import-Export'}
-
-
-# To support reload properly, try to access a package var, if it's there,
-# reload everything
-if "bpy" in locals():
-    import imp
-    if 'import_m3' in locals():
-        imp.reload(import_m3)
-#   if 'export_m3' in locals():
-#       imp.reload(export_m3)
-
-import time
-import datetime
-import bpy
-from bpy.props import StringProperty, BoolProperty
-from bpy_extras.io_utils import ImportHelper
-
-
-class ImportM3(bpy.types.Operator, ImportHelper):
-    """Import from M3 file format (.m3)"""
-    bl_idname = 'import_scene.blizzard_m3'
-    bl_label = 'Import M3'
-    bl_options = {'UNDO'}
-
-    filename_ext = '.m3'
-    filter_glob = StringProperty(default='*.m3', options={'HIDDEN'})
-
-    use_image_search = BoolProperty(name='Image Search',
-                        description='Search subdirectories for any associated'\
-                                    'images', default=True)
-
-    def execute(self, context):
-        from . import import_m3
-        print('Importing file', self.filepath)
-        t = time.mktime(datetime.datetime.now().timetuple())
-        with open(self.filepath, 'rb') as file:
-            import_m3.read(file, context, self)
-        t = time.mktime(datetime.datetime.now().timetuple()) - t
-        print('Finished importing in', t, 'seconds')
-        return {'FINISHED'}
-
-
-def menu_func_import(self, context):
-    self.layout.operator(ImportM3.bl_idname, text='Blizzard M3 (.m3)')
-
-
-#def menu_func_export(self, context):
-#   self.layout.operator(ExportM3.bl_idname, text='Blizzard M3 (.m3)')
-
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.INFO_MT_file_import.append(menu_func_import)
-#   bpy.types.INFO_MT_file_export.append(menu_func_export)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.INFO_MT_file_import.remove(menu_func_import)
-#   bpy.types.INFO_MT_file_export.remove(menu_func_export)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/io_scene_m3/import_m3.py b/release/scripts/addons_contrib/io_scene_m3/import_m3.py
deleted file mode 100644
index f22a089..0000000
--- a/release/scripts/addons_contrib/io_scene_m3/import_m3.py
+++ /dev/null
@@ -1,365 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-__author__ = "Cory Perry (muraj)"
-__version__ = "0.2.1"
-__bpydoc__ = """\
-This script imports m3 format files to Blender.
-
-The m3 file format, used by Blizzard in several games, is based around the
-mdx and m2 file format.  Thanks to the efforts of Volcore, madyavic and the
-people working on libm3, the file format has been reversed engineered
-enough to make this script possible (Thanks guys!).
-
-This script currently imports the following:<br>
- - Geometry data (vertices, faces, submeshes [in vertex groups])
- - Model Textures (currently only the first material is supported)
-
-   Blender supports the DDS file format and needs the image in the same
-   directory.  This script will notify you of any missing textures.
-
-TODO:<br>
- - Documentation & clean up
- - Full MD34 and MD33 testing (possibly batch importing for a testing suite)
- - Import *ALL* materials and bind accordingly (currently supports diffuse,
-    specular, and normal.
- - Adjust vertices to bind pose (import IREF matrices)
- - Import Bone data
- - Import Animation data
-
-Usage:<br>
-    Execute this script from the "File->Import" menu and choose a m3 file to
-open.
-
-Notes:<br>
-    Known issue with Thor.m3, seems to add a lot of unecessary verts.
-    Generates the standard verts and faces lists.
-"""
-
-import bpy
-import struct
-import os.path
-from bpy.props import *
-from bpy_extras.image_utils import load_image
-
-##################
-## Struct setup ##
-##################
-verFlag = False        # Version flag (MD34 == True, MD33 == False)
-
-
-class ref:
-    fmt = 'LL'
-
-    def __init__(self, file):
-        global verFlag
-        if verFlag:
-            self.fmt += 'L'    # Extra unknown...
-        _s = file.read(struct.calcsize(self.fmt))
-        self.entries, self.refid = struct.unpack(self.fmt, _s)[:2]
-
-    @classmethod
-    def size(cls):
-        global verFlag
-        return struct.calcsize(cls.fmt + ('L' if verFlag else ''))
-
-
-class animref:
-    fmt = 'HHL'
-
-    def __init__(self, file):
-        _s = file.read(struct.calcsize(self.fmt))
-        self.flags, self.animflags, self.animid = struct.unpack(self.fmt, _s)
-
-
-class Tag:
-    fmt = '4sLLL'
-
-    def __init__(self, file):
-        _s = file.read(struct.calcsize(self.fmt))
-        self.name, self.ofs, self.nTag, self.version = \
-            struct.unpack(self.fmt, _s)
-
-
-class matrix:
-    fmt = 'f' * 16
-
-    def __init__(self, file):
-        _s = file.read(struct.calcsize(self.fmt))
-        self.mat = struct.unpack(self.fmt, _s)
-
-
-class vect:
-    fmt = 'fff'
-
-    def __init__(self, file):
-        _s = file.read(struct.calcsize(self.fmt))
-        self.v = struct.unpack(self.fmt, _s)
-
-
-class vertex:
-    fmt = "4B4b4B%dH4B"
-    ver = {0x020000: 2, 0x060000: 4, 0x0A0000: 6, 0x120000: 8}
-
-    def __init__(self, file, flag):
-        self.pos = vect(file)
-        _fmt = self.fmt % (self.ver[flag])
-        _s = file.read(struct.calcsize(_fmt))
-        _s = struct.unpack(_fmt, _s)
-        self.boneWeight = _s[0:4]
-        self.boneIndex = _s[4:8]
-        self.normal = _s[8:12]
-        self.uv = _s[12:14]
-        self.tan = _s[-4:]    # Skipping the middle ukn value if needed
-        self.boneWeight = [b / 255.0 for b in self.boneWeight]
-        self.normal = [x * 2.0 / 255.0 - 1.0 for x in self.normal]
-        self.tan = [x * 2.0 / 255.0 - 1.0 for x in self.tan]
-        self.uv = [x / 2046.0 for x in self.uv]
-        self.uv[1] = 1.0 - self.uv[1]
-
-    @classmethod
-    def size(cls, flag=0x020000):
-        return struct.calcsize('fff' + cls.fmt % (cls.ver[flag]))
-
-
-class quat:
-    fmt = 'ffff'
-
-    def __init__(self, file):
-        _s = file.read(struct.calcsize(self.fmt))
-        self.v = struct.unpack(self.fmt, _s)
-        #Quats are stored x,y,z,w - this fixes it
-        self.v = [self.v[-1], self.v[0], self.v[1], self.v[2]]
-
-
-class bone:
-
-    def __init__(self, file):
-        file.read(4)    # ukn1
-        self.name = ref(file)
-        self.flag, self.parent, _ = struct.unpack('LhH', file.read(8))
-        self.posid = animref(file)
-        self.pos = vect(file)
-        file.read(4 * 4)    # ukn
-        self.rotid = animref(file)
-        self.rot = quat(file)
-        file.read(4 * 5)    # ukn
-        self.scaleid = animref(file)
-        self.scale = vect(file)
-        vect(file)          # ukn
-        file.read(4 * 6)    # ukn
-
-
-class div:
-
-    def __init__(self, file):
-        self.faces = ref(file)
-        self.regn = ref(file)
-        self.bat = ref(file)
-        self.msec = ref(file)
-        file.read(4)    # ukn
-
-
-class regn:
-    fmt = 'L2H2L6H'
-
-    def __init__(self, file):
-        _s = file.read(struct.calcsize(self.fmt))
-        _ukn1, self.ofsVert, self.nVerts, self.ofsIndex, self.nIndex, \
-            self.boneCount, self.indBone, self.nBone = \
-            struct.unpack(self.fmt, _s)[:8]
-
-
-class mat:
-
-    def __init__(self, file):
-        self.name = ref(file)
-        file.read(4 * 10)    # ukn
-        self.layers = [ref(file) for _ in range(13)]
-        file.read(4 * 15)    # ukn
-
-
-class layr:
-
-    def __init__(self, file):
-        file.read(4)
-        self.name = ref(file)
-        #Rest not implemented.
-
-
-class hdr:
-    fmt = '4sLL'
-
-    def __init__(self, file):
-        _s = file.read(struct.calcsize(self.fmt))
-        self.magic, self.ofsTag, self.nTag = struct.unpack(self.fmt, _s)
-        self.MODLref = ref(file)
-
-
-class MODL:
-
-    def __init__(self, file, flag=20):
-        global verFlag
-        self.name = ref(file)
-        self.ver = struct.unpack('L', file.read(4))[0]
-        self.seqHdr = ref(file)
-        self.seqData = ref(file)
-        self.seqLookup = ref(file)
-        file.read(0x1C if verFlag else 0x14)            # ukn1
-        self.bones = ref(file)
-        file.read(4)            # ukn2
-        self.flags = struct.unpack('L', file.read(4))[0]
-        self.vert = ref(file)
-        self.views = ref(file)
-        self.boneLookup = ref(file)
-        self.extents = [vect(file), vect(file)]
-        self.radius = struct.unpack('f', file.read(4))[0]
-        if verFlag:
-            file.read(4)            # ukn MD34 addition
-        if not verFlag:
-            if flag == 20:
-                file.read(0x2C)
-            else:
-                file.read(0x34)
-        else:
-            if flag == 20:
-                file.read(0x30)
-            else:
-                file.read(0x3C)
-        self.attach = ref(file)
-        file.read(5 * ref.size())
-        self.materialsLookup = ref(file)
-        self.materials = ref(file)
-        file.read(ref.size())
-        if not verFlag:
-            file.read(0x90)
-        else:
-            file.read(0xD8)
-        self.iref = ref(file)
-
-
-def read(file, context, op):
-    """Imports as an m3 file"""
-    global verFlag
-    h = hdr(file)
-    if h.magic[::-1] == b'MD34':
-        print('m3_import: !WARNING! MD34 files not full tested...')
-        verFlag = True
-    elif h.magic[::-1] == b'MD33':
-        verFlag = False
-    else:
-        raise Exception('m3_import: !ERROR! Not a valid or supported m3 file')
-    file.seek(h.ofsTag)    # Jump to the Tag table
-    print('m3_import: !INFO! Reading TagTable...')
-    tagTable = [Tag(file) for _ in range(h.nTag)]
-    file.seek(tagTable[h.MODLref.refid].ofs)
-    m = MODL(file, tagTable[h.MODLref.refid].version)
-    if not m.flags & 0x20000:
-        raise Exception('m3_import: !ERROR! Model doesn\'t have any vertices')
-    print('m3_import: !INFO! Reading Vertices...')
-    vert_flags = m.flags & 0x1E0000        # Mask out the vertex version
-    file.seek(tagTable[m.views.refid].ofs)
-    d = div(file)
-    file.seek(tagTable[m.vert.refid].ofs)
-    verts = [vertex(file, vert_flags) \
-       for _ in range(tagTable[m.vert.refid].nTag // vertex.size(vert_flags))]
-    file.seek(tagTable[d.faces.refid].ofs)
-    print('m3_import: !INFO! Reading Faces...')
-    rawfaceTable = struct.unpack('H' * (tagTable[d.faces.refid].nTag), \
-                    file.read(tagTable[d.faces.refid].nTag * 2))
-    faceTable = []
-    for i in range(1, len(rawfaceTable) + 1):
-        faceTable.append(rawfaceTable[i - 1])
-        if i % 3 == 0:    # Add a zero for the fourth index to the face.
-            faceTable.append(0)
-    print("m3_import: !INFO! Read %d vertices and %d faces" \
-            % (len(verts), len(faceTable)))
-    print('m3_import: !INFO! Adding Geometry...')
-    mesh = bpy.data.meshes.new(os.path.basename(op.properties.filepath))
-    mobj = bpy.data.objects.new(os.path.basename(op.properties.filepath), mesh)
-    context.scene.objects.link(mobj)
-    v, n = [], []
-    for vert in verts:        # "Flatten" the vertex array...
-        v.extend(vert.pos.v)
-        n.extend(vert.normal)
-    mesh.vertices.add(len(verts))
-    mesh.faces.add(len(rawfaceTable) // 3)
-    mesh.vertices.foreach_set('co', v)
-    mesh.vertices.foreach_set('normal', n)
-    mesh.faces.foreach_set('vertices_raw', faceTable)
-    uvtex = mesh.uv_textures.new()
-    for i, face in enumerate(mesh.faces):
-        uf = uvtex.data[i]
-        uf.uv1 = verts[faceTable[i * 4 + 0]].uv
-        uf.uv2 = verts[faceTable[i * 4 + 1]].uv
-        uf.uv3 = verts[faceTable[i * 4 + 2]].uv
-        uf.uv4 = (0, 0)
-    print('m3_import: !INFO! Importing materials...')
-    material = bpy.data.materials.new('Mat00')
-    mesh.materials.append(material)
-    file.seek(tagTable[m.materials.refid].ofs)
-    mm = mat(file)
-    tex_map = [('use_map_color_diffuse', 0), ('use_map_specular', 2),\
-                ('use_map_normal', 9)]
-    for map, i in tex_map:
-        file.seek(tagTable[mm.layers[i].refid].ofs)
-        nref = layr(file).name
-        file.seek(tagTable[nref.refid].ofs)
-        name = bytes.decode(file.read(nref.entries - 1))
-        name = os.path.basename(str(name))
-        tex = bpy.data.textures.new(name=name, type='IMAGE')
-        tex.image = load_image(name, os.path.dirname(op.filepath))
-        if tex.image != None:
-            print("m3_import: !INFO! Loaded %s" % (name))
-        else:
-            print("m3_import: !WARNING! Cannot find texture \"%s\"" % (name))
-        mtex = material.texture_slots.add()
-        mtex.texture = tex
-        mtex.texture_coords = 'UV'
-        if i == 9:
-            mtex.normal_factor = 0.1    # Just a guess, seems to look nice
-        mtex.use_map_color_diffuse = (i == 0)
-        setattr(mtex, map, True)
-
-
-class M3Importer(bpy.types.Operator):
-    """Import from M3 file format (.m3)"""
-    bl_idname = "import_mesh.blizzard_m3"
-    bl_label = 'Import M3'
-    bl_options = {'UNDO'}
-
-    # List of operator properties, the attributes will be assigned
-    # to the class instance from the operator settings before calling.
-
-    filepath = StringProperty(
-                subtype='FILE_PATH',
-                )
-
-    def execute(self, context):
-        t = time.mktime(datetime.datetime.now().timetuple())
-        with open(self.properties.filepath, 'rb') as file:
-            print('Importing file', self.properties.filepath)
-            read(file, context, self)
-        t = time.mktime(datetime.datetime.now().timetuple()) - t
-        print('Finished importing in', t, 'seconds')
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.window_manager
-        wm.add_fileselect(self)
-        return {'RUNNING_MODAL'}
diff --git a/release/scripts/addons_contrib/io_scene_ms3d/__init__.py b/release/scripts/addons_contrib/io_scene_ms3d/__init__.py
deleted file mode 100644
index 0519b97..0000000
--- a/release/scripts/addons_contrib/io_scene_ms3d/__init__.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    'name': "MilkShape3D MS3D format (.ms3d)",
-    'description': "Import / Export MilkShape3D MS3D files"\
-            " (conform with v1.8.4)",
-    'author': "Alexander Nussbaumer",
-    'version': (0, 91, 0),
-    'blender': (2, 65, 0),
-    'location': "File > Import & File > Export",
-    'warning': "",
-    'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-            "Scripts/Import-Export/MilkShape3D_MS3D",
-    'tracker_url': "http://projects.blender.org/tracker/index.php"\
-            "?func=detail&aid=29404",
-    'category': "Import-Export",
-    }
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-
-
-# ##### BEGIN COPYRIGHT BLOCK #####
-#
-# initial script copyright (c)2011,2012 Alexander Nussbaumer
-#
-# ##### END COPYRIGHT BLOCK #####
-
-
-# To support reload properly, try to access a package var,
-# if it's there, reload everything
-if 'bpy' in locals():
-    import imp
-    if 'io_scene_ms3d.ms3d_ui' in locals():
-        imp.reload(io_scene_ms3d.ms3d_ui)
-else:
-    from io_scene_ms3d.ms3d_ui import (
-            Ms3dImportOperator,
-            Ms3dExportOperator,
-            )
-
-
-#import blender stuff
-from bpy.utils import (
-        register_module,
-        unregister_module,
-        )
-from bpy.types import (
-        INFO_MT_file_export,
-        INFO_MT_file_import,
-        )
-
-
-###############################################################################
-# registration
-def register():
-    ####################
-    # F8 - key
-    import imp
-    imp.reload(ms3d_ui)
-    # F8 - key
-    ####################
-
-    ms3d_ui.register()
-
-    register_module(__name__)
-    INFO_MT_file_export.append(Ms3dExportOperator.menu_func)
-    INFO_MT_file_import.append(Ms3dImportOperator.menu_func)
-
-
-def unregister():
-    ms3d_ui.unregister()
-
-    unregister_module(__name__)
-    INFO_MT_file_export.remove(Ms3dExportOperator.menu_func)
-    INFO_MT_file_import.remove(Ms3dImportOperator.menu_func)
-
-
-###############################################################################
-# global entry point
-if (__name__ == "__main__"):
-    register()
-
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-# ##### END OF FILE #####
diff --git a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_export.py b/release/scripts/addons_contrib/io_scene_ms3d/ms3d_export.py
deleted file mode 100644
index 5e82303..0000000
--- a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_export.py
+++ /dev/null
@@ -1,862 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-
-
-# ##### BEGIN COPYRIGHT BLOCK #####
-#
-# initial script copyright (c)2011,2012 Alexander Nussbaumer
-#
-# ##### END COPYRIGHT BLOCK #####
-
-
-#import python stuff
-import io
-from math import (
-        pi,
-        )
-from mathutils import (
-        Matrix,
-        )
-from os import (
-        path,
-        )
-from sys import (
-        exc_info,
-        )
-from time import (
-        time,
-        )
-
-
-# import io_scene_ms3d stuff
-from io_scene_ms3d.ms3d_strings import (
-        ms3d_str,
-        )
-from io_scene_ms3d.ms3d_spec import (
-        Ms3dSpec,
-        Ms3dModel,
-        Ms3dVertex,
-        Ms3dTriangle,
-        Ms3dGroup,
-        Ms3dMaterial,
-        Ms3dJoint,
-        Ms3dRotationKeyframe,
-        Ms3dTranslationKeyframe,
-        Ms3dCommentEx,
-        )
-from io_scene_ms3d.ms3d_utils import (
-        select_all,
-        enable_edit_mode,
-        pre_setup_environment,
-        post_setup_environment,
-        matrix_difference,
-        )
-from io_scene_ms3d.ms3d_ui import (
-        Ms3dUi,
-        Ms3dMaterialProperties,
-        Ms3dMaterialHelper,
-        )
-
-
-#import blender stuff
-from bpy import (
-        ops,
-        )
-import bmesh
-
-
-###############################################################################
-class Ms3dExporter():
-    """ Load a MilkShape3D MS3D File """
-
-    def __init__(self, options):
-        self.options = options
-        pass
-
-    # create a empty ms3d ms3d_model
-    # fill ms3d_model with blender content
-    # writer ms3d file
-    def write(self, blender_context):
-        """convert bender content to ms3d content and write it to file"""
-
-        t1 = time()
-        t2 = None
-
-        try:
-            # setup environment
-            pre_setup_environment(self, blender_context)
-
-            # create an empty ms3d template
-            ms3d_model = Ms3dModel()
-
-            # inject blender data to ms3d file
-            self.from_blender(blender_context, ms3d_model)
-
-            t2 = time()
-
-            #self.file = None
-            try:
-                # write ms3d file to disk
-                #self.file = io.FileIO(self.options.filepath, "wb")
-                with io.FileIO(self.options.filepath, "wb") as self.file:
-                    ms3d_model.write(self.file)
-                    self.file.flush()
-                    self.file.close()
-            finally:
-                # close ms3d file
-                #if self.file is not None:
-                #    self.file.close()
-                pass
-
-            # if option is set, this time will enlargs the io time
-            if self.options.verbose:
-                ms3d_model.print_internal()
-
-            post_setup_environment(self, blender_context)
-            # restore active object
-            blender_context.scene.objects.active = self.active_object
-
-            if ((not blender_context.scene.objects.active)
-                    and (blender_context.selected_objects)):
-                blender_context.scene.objects.active \
-                        = blender_context.selected_objects[0]
-
-            # restore pre operator undo state
-            blender_context.user_preferences.edit.use_global_undo = self.undo
-
-            is_valid, statistics = ms3d_model.is_valid()
-            print()
-            print("##########################################################")
-            print("Export from Blender to MS3D")
-            print(statistics)
-            print("##########################################################")
-
-        except Exception:
-            type, value, traceback = exc_info()
-            print("write - exception in try block\n  type: '{0}'\n"
-                    "  value: '{1}'".format(type, value, traceback))
-
-            if t2 is None:
-                t2 = time()
-
-            raise
-
-        else:
-            pass
-
-        t3 = time()
-        print(ms3d_str['SUMMARY_EXPORT'].format(
-                (t3 - t1), (t2 - t1), (t3 - t2)))
-
-        return {"FINISHED"}
-
-
-    ###########################################################################
-    def from_blender(self, blender_context, ms3d_model):
-        blender_mesh_objects = []
-
-        source = (blender_context.active_object, )
-
-        for blender_object in source:
-            if blender_object and blender_object.type == 'MESH' \
-                    and blender_object.is_visible(blender_context.scene):
-                blender_mesh_objects.append(blender_object)
-
-        blender_to_ms3d_bones = {}
-
-        self.create_animation(blender_context, ms3d_model, blender_mesh_objects, blender_to_ms3d_bones)
-        self.create_geometry(blender_context, ms3d_model, blender_mesh_objects,
-                blender_to_ms3d_bones)
-
-
-    ###########################################################################
-    def create_geometry(self, blender_context, ms3d_model, blender_mesh_objects, blender_to_ms3d_bones):
-        blender_scene = blender_context.scene
-
-        blender_to_ms3d_vertices = {}
-        blender_to_ms3d_triangles = {}
-        blender_to_ms3d_groups = {}
-        blender_to_ms3d_materials = {}
-
-        for blender_mesh_object in blender_mesh_objects:
-            blender_mesh = blender_mesh_object.data
-
-            ms3d_model._model_ex_object.joint_size = \
-                    blender_mesh.ms3d.joint_size
-            ms3d_model._model_ex_object.alpha_ref = blender_mesh.ms3d.alpha_ref
-            ms3d_model._model_ex_object.transparency_mode = \
-                    Ms3dUi.transparency_mode_to_ms3d(
-                    blender_mesh.ms3d.transparency_mode)
-
-            ##########################
-            # prepare ms3d groups if available
-            # works only for exporting active object
-            ##EXPORT_ACTIVE_ONLY:
-            for ms3d_local_group_index, blender_ms3d_group in enumerate(
-                    blender_mesh.ms3d.groups):
-                ms3d_group = Ms3dGroup()
-                ms3d_group.__index = len(ms3d_model._groups)
-                ms3d_group.name = blender_ms3d_group.name
-                ms3d_group.flags = Ms3dUi.flags_to_ms3d(blender_ms3d_group.flags)
-                if blender_ms3d_group.comment:
-                    ms3d_group._comment_object = Ms3dCommentEx()
-                    ms3d_group._comment_object.comment = \
-                            blender_ms3d_group.comment
-                    ms3d_group._comment_object.index = len(ms3d_model._groups)
-                ms3d_group.material_index = None # to mark as not setted
-                ms3d_model._groups.append(ms3d_group)
-                blender_to_ms3d_groups[blender_ms3d_group.id] = ms3d_group
-
-            ##########################
-            # i have to use BMesh, because there are several custom data stored.
-            # BMesh doesn't support quads_convert_to_tris()
-            # so, i use that very ugly way:
-            # create a complete copy of mesh and bend object data
-            # to be able to apply operations to it.
-
-            # temporary, create a full heavy copy of the model
-            # (object, mesh, modifiers)
-            blender_mesh_temp = blender_mesh_object.data.copy()
-            blender_mesh_object_temp = blender_mesh_object.copy()
-            blender_mesh_object_temp.data = blender_mesh_temp
-            blender_scene.objects.link(blender_mesh_object_temp)
-            blender_scene.objects.active = blender_mesh_object_temp
-
-            # apply transform
-            if self.options.apply_transform:
-                matrix_transform = blender_mesh_object_temp.matrix_local
-            else:
-                matrix_transform = Matrix()
-
-            # apply modifiers
-            for modifier in blender_mesh_object_temp.modifiers:
-                if self.options.apply_modifiers:
-                    # disable only armature modifiers and only,
-                    # when use_animation is enabled
-                    if  self.options.use_animation \
-                            and modifier.type in {'ARMATURE', }:
-                        modifier.show_viewport = False
-                        modifier.show_render = False
-                else:
-                    # disable all modifiers,
-                    # to be able to add and apply triangulate modifier later
-                    modifier.show_viewport = False
-                    modifier.show_render = False
-
-            # convert to tris by using the triangulate modifier
-            blender_mesh_object_temp.modifiers.new("temp", 'TRIANGULATE')
-            blender_mesh_temp = blender_mesh_object_temp.to_mesh(
-                    blender_scene,
-                    True,
-                    self.options.apply_modifiers_mode)
-
-            enable_edit_mode(True, blender_context)
-            bm = bmesh.new()
-            bm.from_mesh(blender_mesh_temp)
-
-            layer_texture = bm.faces.layers.tex.get(
-                    ms3d_str['OBJECT_LAYER_TEXTURE'])
-            if layer_texture is None:
-                layer_texture = bm.faces.layers.tex.new(
-                        ms3d_str['OBJECT_LAYER_TEXTURE'])
-
-            layer_smoothing_group = bm.faces.layers.int.get(
-                    ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
-            if layer_smoothing_group is None:
-                layer_smoothing_group = bm.faces.layers.int.new(
-                        ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
-
-            layer_group = bm.faces.layers.int.get(
-                    ms3d_str['OBJECT_LAYER_GROUP'])
-            if layer_group is None:
-                layer_group = bm.faces.layers.int.new(
-                        ms3d_str['OBJECT_LAYER_GROUP'])
-
-            layer_uv = bm.loops.layers.uv.get(ms3d_str['OBJECT_LAYER_UV'])
-            if layer_uv is None:
-                if bm.loops.layers.uv:
-                    layer_uv = bm.loops.layers.uv[0]
-                else:
-                    layer_uv = bm.loops.layers.uv.new(
-                            ms3d_str['OBJECT_LAYER_UV'])
-
-            layer_deform = bm.verts.layers.deform.active
-
-            layer_extra = bm.verts.layers.int.get(ms3d_str['OBJECT_LAYER_EXTRA'])
-            if layer_extra is None:
-                layer_extra = bm.verts.layers.int.new(
-                        ms3d_str['OBJECT_LAYER_EXTRA'])
-
-
-            ##########################
-            # handle vertices
-            for bmv in bm.verts:
-                item = blender_to_ms3d_vertices.get(bmv)
-                if item is None:
-                    index = len(ms3d_model._vertices)
-                    ms3d_vertex = Ms3dVertex()
-                    ms3d_vertex.__index = index
-
-                    ms3d_vertex._vertex = self.geometry_correction(
-                            matrix_transform * bmv.co)
-
-                    if self.options.use_animation and layer_deform:
-                        blender_vertex_group_ids = bmv[layer_deform]
-                        if blender_vertex_group_ids:
-                            count = 0
-                            bone_ids = []
-                            weights = []
-                            for blender_index, blender_weight \
-                                    in blender_vertex_group_ids.items():
-                                ms3d_joint = blender_to_ms3d_bones.get(
-                                        blender_mesh_object_temp.vertex_groups[\
-                                                blender_index].name)
-                                if ms3d_joint:
-                                    if count == 0:
-                                        ms3d_vertex.bone_id = ms3d_joint.__index
-                                        weights.append(
-                                                int(blender_weight * 100.0))
-                                    elif count == 1:
-                                        bone_ids.append(ms3d_joint.__index)
-                                        weights.append(
-                                                int(blender_weight * 100.0))
-                                    elif count == 2:
-                                        bone_ids.append(ms3d_joint.__index)
-                                        weights.append(
-                                                int(blender_weight * 100.0))
-                                    elif count == 3:
-                                        bone_ids.append(ms3d_joint.__index)
-                                        self.options.report(
-                                                {'WARNING', 'INFO'},
-                                                ms3d_str['WARNING_EXPORT_SKIP_WEIGHT'])
-                                    else:
-                                        # only first three weights will be supported / four bones
-                                        self.options.report(
-                                                {'WARNING', 'INFO'},
-                                                ms3d_str['WARNING_EXPORT_SKIP_WEIGHT_EX'])
-                                        break
-                                count+= 1
-
-                            while len(bone_ids) < 3:
-                                bone_ids.append(Ms3dSpec.DEFAULT_VERTEX_BONE_ID)
-                            while len(weights) < 3:
-                                weights.append(0)
-
-                            # normalize weights to 100
-                            if self.options.normalize_weights:
-                                weight_sum = 0
-                                for weight in weights:
-                                    weight_sum += weight
-
-                                if weight_sum > 100:
-                                    weight_normalize = 100 / weight_sum
-                                else:
-                                    weight_normalize = 1
-
-                                weight_sum = 100
-                                for index, weight in enumerate(weights):
-                                    if index >= count-1:
-                                        weights[index] = weight_sum
-                                        break
-                                    normalized_weight = int(
-                                            weight * weight_normalize)
-                                    weight_sum -= normalized_weight
-                                    weights[index] = normalized_weight
-
-                            ms3d_vertex._vertex_ex_object._bone_ids = \
-                                    tuple(bone_ids)
-                            ms3d_vertex._vertex_ex_object._weights = \
-                                    tuple(weights)
-
-                    if layer_extra:
-                        #ms3d_vertex._vertex_ex_object.extra = bmv[layer_extra]
-                        # bm.verts.layers.int does only support signed int32
-                        # convert signed int32 to unsigned int32 (little-endian)
-                        signed_int32 = bmv[layer_extra]
-                        bytes_int32 = signed_int32.to_bytes(
-                                4, byteorder='little', signed=True)
-                        unsigned_int32 = int.from_bytes(
-                                bytes_int32, byteorder='little', signed=False)
-                        ms3d_vertex._vertex_ex_object.extra = unsigned_int32
-
-                    ms3d_model._vertices.append(ms3d_vertex)
-                    blender_to_ms3d_vertices[bmv] = ms3d_vertex
-
-            ##########################
-            # handle faces / tris
-            for bmf in bm.faces:
-                item = blender_to_ms3d_triangles.get(bmf)
-                if item is None:
-                    index = len(ms3d_model._triangles)
-                    ms3d_triangle = Ms3dTriangle()
-                    ms3d_triangle.__index = index
-                    bmv0 = bmf.verts[0]
-                    bmv1 = bmf.verts[1]
-                    bmv2 = bmf.verts[2]
-                    ms3d_vertex0 = blender_to_ms3d_vertices[bmv0]
-                    ms3d_vertex1 = blender_to_ms3d_vertices[bmv1]
-                    ms3d_vertex2 = blender_to_ms3d_vertices[bmv2]
-                    ms3d_vertex0.reference_count += 1
-                    ms3d_vertex1.reference_count += 1
-                    ms3d_vertex2.reference_count += 1
-                    ms3d_triangle._vertex_indices = (
-                            ms3d_vertex0.__index,
-                            ms3d_vertex1.__index,
-                            ms3d_vertex2.__index,
-                            )
-                    ms3d_triangle._vertex_normals = (
-                            self.geometry_correction(bmv0.normal),
-                            self.geometry_correction(bmv1.normal),
-                            self.geometry_correction(bmv2.normal),
-                            )
-                    ms3d_triangle._s = (
-                            bmf.loops[0][layer_uv].uv.x,
-                            bmf.loops[1][layer_uv].uv.x,
-                            bmf.loops[2][layer_uv].uv.x,
-                            )
-                    ms3d_triangle._t = (
-                            1.0 - bmf.loops[0][layer_uv].uv.y,
-                            1.0 - bmf.loops[1][layer_uv].uv.y,
-                            1.0 - bmf.loops[2][layer_uv].uv.y,
-                            )
-
-                    ms3d_triangle.smoothing_group = bmf[layer_smoothing_group]
-                    ms3d_model._triangles.append(ms3d_triangle)
-
-                    ms3d_material = self.get_ms3d_material_add_if(
-                            blender_mesh, ms3d_model,
-                            blender_to_ms3d_materials, bmf.material_index)
-                    ms3d_group = blender_to_ms3d_groups.get(bmf[layer_group])
-
-                    ##EXPORT_ACTIVE_ONLY:
-                    if ms3d_group is not None:
-                        if ms3d_material is None:
-                            ms3d_group.material_index = \
-                                    Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX
-                        else:
-                            if ms3d_group.material_index is None:
-                                ms3d_group.material_index = \
-                                        ms3d_material.__index
-                            else:
-                                if ms3d_group.material_index != \
-                                        ms3d_material.__index:
-                                    ms3d_group = \
-                                            self.get_ms3d_group_by_material_add_if(
-                                            ms3d_model, ms3d_material)
-                    else:
-                        if ms3d_material is not None:
-                            ms3d_group = self.get_ms3d_group_by_material_add_if(
-                                    ms3d_model, ms3d_material)
-                        else:
-                            ms3d_group = self.get_ms3d_group_default_material_add_if(
-                                    ms3d_model)
-
-                    if ms3d_group is not None:
-                        ms3d_group._triangle_indices.append(
-                                ms3d_triangle.__index)
-                        ms3d_triangle.group_index = ms3d_group.__index
-
-                    blender_to_ms3d_triangles[bmf] = ms3d_triangle
-
-            if bm is not None:
-                bm.free()
-
-            enable_edit_mode(False, blender_context)
-
-            ##########################
-            # remove the temporary data
-            blender_scene.objects.unlink(blender_mesh_object_temp)
-            if blender_mesh_temp is not None:
-                blender_mesh_temp.user_clear()
-                blender_context.blend_data.meshes.remove(blender_mesh_temp)
-            blender_mesh_temp = None
-            if blender_mesh_object_temp is not None:
-                blender_mesh_temp = blender_mesh_object_temp.data.user_clear()
-                blender_mesh_object_temp.user_clear()
-                blender_context.blend_data.objects.remove(
-                        blender_mesh_object_temp)
-            if blender_mesh_temp is not None:
-                blender_mesh_temp.user_clear()
-                blender_context.blend_data.meshes.remove(blender_mesh_temp)
-
-
-    ###########################################################################
-    def create_animation(self, blender_context, ms3d_model,
-            blender_mesh_objects, blender_to_ms3d_bones):
-        ##########################
-        # setup scene
-        blender_scene = blender_context.scene
-
-        if not self.options.use_animation:
-            ms3d_model.animation_fps = 24
-            ms3d_model.number_total_frames = 1
-            ms3d_model.current_time = 0
-            return
-
-        frame_start = blender_scene.frame_start
-        frame_end = blender_scene.frame_end
-        frame_total = (frame_end - frame_start) + 1
-        frame_step = blender_scene.frame_step
-        frame_offset = 0
-
-        fps = blender_scene.render.fps * blender_scene.render.fps_base
-        time_base = 1.0 / fps
-
-        base_bone_correction = Matrix.Rotation(pi / 2, 4, 'Z')
-
-        for blender_mesh_object in blender_mesh_objects:
-            blender_bones = None
-            blender_action = None
-            blender_nla_tracks = None
-            for blender_modifier in blender_mesh_object.modifiers:
-                if blender_modifier.type == 'ARMATURE' \
-                        and blender_modifier.object.pose:
-                    blender_bones = blender_modifier.object.data.bones
-                    blender_pose_bones = blender_modifier.object.pose.bones
-                    if blender_modifier.object.animation_data:
-                        blender_action = \
-                                blender_modifier.object.animation_data.action
-                        blender_nla_tracks = \
-                                blender_modifier.object.animation_data.nla_tracks
-                    break
-
-            if blender_bones is None \
-                    and (blender_action is None and blender_nla_tracks is None):
-                continue
-
-            ##########################
-            # bones
-            blender_bones_ordered = []
-            self.build_blender_bone_dependency_order(
-                    blender_bones, blender_bones_ordered)
-            for blender_bone_name in blender_bones_ordered:
-                blender_bone_oject = blender_bones[blender_bone_name]
-                ms3d_joint = Ms3dJoint()
-                ms3d_joint.__index = len(ms3d_model._joints)
-
-                blender_bone_ms3d = blender_bone_oject.ms3d
-                blender_bone = blender_bone_oject
-
-                ms3d_joint.flags = Ms3dUi.flags_to_ms3d(blender_bone_ms3d.flags)
-                if blender_bone_ms3d.comment:
-                    ms3d_joint._comment_object = Ms3dCommentEx()
-                    ms3d_joint._comment_object.comment = \
-                            blender_bone_ms3d.comment
-                    ms3d_joint._comment_object.index = ms3d_joint.__index
-
-                ms3d_joint.joint_ex_object._color = blender_bone_ms3d.color[:]
-
-                ms3d_joint.name = blender_bone.name
-
-                if blender_bone.parent:
-                    ms3d_joint.parent_name = blender_bone.parent.name
-                    ms3d_joint.__matrix = matrix_difference(
-                            blender_bone.matrix_local,
-                            blender_bone.parent.matrix_local)
-                else:
-                    ms3d_joint.__matrix = base_bone_correction \
-                            * blender_bone.matrix_local
-
-                mat = ms3d_joint.__matrix
-                loc = mat.to_translation()
-                rot = mat.to_euler('XZY')
-                ms3d_joint._position = self.joint_correction(loc)
-                ms3d_joint._rotation = self.joint_correction(rot)
-
-                ms3d_model._joints.append(ms3d_joint)
-                blender_to_ms3d_bones[blender_bone.name] = ms3d_joint
-
-            ##########################
-            # animation
-            frames = None
-            frames_location = set()
-            frames_rotation = set()
-            frames_scale = set()
-
-            if blender_action:
-                self.fill_keyframe_sets(
-                        blender_action.fcurves,
-                        frames_location, frames_rotation, frames_scale,
-                        0)
-
-            if blender_nla_tracks:
-                for nla_track in blender_nla_tracks:
-                    if nla_track.mute:
-                        continue
-                    for strip in nla_track.strips:
-                        if strip.mute:
-                            continue
-                        frame_correction = strip.frame_start \
-                                - strip.action_frame_start
-                        self.fill_keyframe_sets(
-                                strip.action.fcurves,
-                                frames_location, frames_rotation, frames_scale,
-                                frame_correction)
-
-            frames = set(frames_location)
-            frames = frames.union(frames_rotation)
-            frames = frames.union(frames_scale)
-
-            if not self.options.shrink_to_keys:
-                frames = frames.intersection(range(
-                        blender_scene.frame_start, blender_scene.frame_end + 1))
-
-            frames_sorted = list(frames)
-            frames_sorted.sort()
-
-            if self.options.shrink_to_keys and len(frames_sorted) >= 2:
-                frame_start = frames_sorted[0]
-                frame_end = frames_sorted[len(frames_sorted)-1]
-                frame_total = (frame_end - frame_start) + 1
-                frame_offset = frame_start - 1
-
-            if self.options.bake_each_frame:
-                frames_sorted = range(int(frame_start), int(frame_end + 1),
-                        int(frame_step))
-
-            frame_temp = blender_scene.frame_current
-
-            for current_frame in frames_sorted:
-                blender_scene.frame_set(current_frame)
-
-                current_time = (current_frame - frame_offset) * time_base
-                for blender_bone_name in blender_bones_ordered:
-                    blender_bone = blender_bones[blender_bone_name]
-                    blender_pose_bone = blender_pose_bones[blender_bone_name]
-                    ms3d_joint = blender_to_ms3d_bones[blender_bone_name]
-
-                    m1 = blender_bone.matrix_local.inverted()
-                    if blender_pose_bone.parent:
-                        m2 = blender_pose_bone.parent.matrix_channel.inverted()
-                    else:
-                        m2 = Matrix()
-                    m3 = blender_pose_bone.matrix.copy()
-                    m = ((m1 * m2) * m3)
-                    loc = m.to_translation()
-                    rot = m.to_euler('XZY')
-
-                    ms3d_joint.translation_key_frames.append(
-                            Ms3dTranslationKeyframe(
-                                    current_time, self.joint_correction(loc)
-                                    )
-                            )
-                    ms3d_joint.rotation_key_frames.append(
-                            Ms3dRotationKeyframe(
-                                    current_time, self.joint_correction(rot)
-                                    )
-                            )
-
-            blender_scene.frame_set(frame_temp)
-
-        ms3d_model.animation_fps = fps
-        if ms3d_model.number_joints > 0:
-            ms3d_model.number_total_frames = int(frame_total)
-            ms3d_model.current_time = ((blender_scene.frame_current \
-                    - blender_scene.frame_start) + 1) * time_base
-        else:
-            ms3d_model.number_total_frames = 1
-            ms3d_model.current_time = 0
-
-
-    ###########################################################################
-    def get_ms3d_group_default_material_add_if(self, ms3d_model):
-        markerName = "MaterialGroupDefault"
-        markerComment = "group without material"
-
-        for ms3d_group in ms3d_model._groups:
-            if ms3d_group.material_index == \
-                    Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX \
-                    and ms3d_group.name == markerName \
-                    and ms3d_group._comment_object \
-                    and ms3d_group._comment_object.comment == markerComment:
-                return ms3d_group
-
-        ms3d_group = Ms3dGroup()
-        ms3d_group.__index = len(ms3d_model._groups)
-        ms3d_group.name = markerName
-        ms3d_group._comment_object = Ms3dCommentEx()
-        ms3d_group._comment_object.comment = markerComment
-        ms3d_group._comment_object.index = len(ms3d_model._groups)
-        ms3d_group.material_index = Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX
-
-        ms3d_model._groups.append(ms3d_group)
-
-        return ms3d_group
-
-
-    ###########################################################################
-    def get_ms3d_group_by_material_add_if(self, ms3d_model, ms3d_material):
-        if ms3d_material.__index < 0 \
-                or ms3d_material.__index >= len(ms3d_model.materials):
-            return None
-
-        markerName = "MaterialGroup.{}".format(ms3d_material.__index)
-        markerComment = "MaterialGroup({})".format(ms3d_material.name)
-
-        for ms3d_group in ms3d_model._groups:
-            if ms3d_group.name == markerName \
-                    and ms3d_group._comment_object \
-                    and ms3d_group._comment_object.comment == markerComment:
-                return ms3d_group
-
-        ms3d_group = Ms3dGroup()
-        ms3d_group.__index = len(ms3d_model._groups)
-        ms3d_group.name = markerName
-        ms3d_group._comment_object = Ms3dCommentEx()
-        ms3d_group._comment_object.comment = markerComment
-        ms3d_group._comment_object.index = len(ms3d_model._groups)
-        ms3d_group.material_index = ms3d_material.__index
-
-        ms3d_model._groups.append(ms3d_group)
-
-        return ms3d_group
-
-
-    ###########################################################################
-    def get_ms3d_material_add_if(self, blender_mesh, ms3d_model,
-            blender_to_ms3d_materials, blender_index):
-        if blender_index < 0 or blender_index >= len(blender_mesh.materials):
-            return None
-
-        blender_material = blender_mesh.materials[blender_index]
-        ms3d_material = blender_to_ms3d_materials.get(blender_material)
-        if ms3d_material is None:
-            ms3d_material = Ms3dMaterial()
-            ms3d_material.__index = len(ms3d_model.materials)
-
-            blender_ms3d_material = blender_material.ms3d
-
-            if not self.options.use_blender_names \
-                    and not self.options.use_blender_materials \
-                    and blender_ms3d_material.name:
-                ms3d_material.name = blender_ms3d_material.name
-            else:
-                ms3d_material.name = blender_material.name
-
-            temp_material = None
-            if self.options.use_blender_materials:
-                temp_material = Ms3dMaterial()
-                Ms3dMaterialHelper.copy_from_blender(
-                        None, None, temp_material, blender_material)
-            else:
-                temp_material = blender_ms3d_material
-
-            ms3d_material._ambient = temp_material.ambient[:]
-            ms3d_material._diffuse = temp_material.diffuse[:]
-            ms3d_material._specular = temp_material.specular[:]
-            ms3d_material._emissive = temp_material.emissive[:]
-            ms3d_material.shininess = temp_material.shininess
-            ms3d_material.transparency = temp_material.transparency
-            ms3d_material.texture = temp_material.texture
-            ms3d_material.alphamap = temp_material.alphamap
-
-            ms3d_material.mode = Ms3dUi.texture_mode_to_ms3d(
-                    blender_ms3d_material.mode)
-            if blender_ms3d_material.comment:
-                ms3d_material._comment_object = Ms3dCommentEx()
-                ms3d_material._comment_object.comment = \
-                        blender_ms3d_material.comment
-                ms3d_material._comment_object.index = ms3d_material.__index
-
-            ms3d_model.materials.append(ms3d_material)
-
-            blender_to_ms3d_materials[blender_material] = ms3d_material
-
-        return ms3d_material
-
-
-    ###########################################################################
-    def geometry_correction(self, value):
-        return (value[1], value[2], value[0])
-
-
-    ###########################################################################
-    def joint_correction(self, value):
-        return (-value[0], value[2], value[1])
-
-
-    ###########################################################################
-    def build_blender_bone_dependency_order(self, blender_bones,
-            blender_bones_ordered):
-        if not blender_bones:
-            return blender_bones_ordered
-
-        blender_bones_children = {None: []}
-        for blender_bone in blender_bones:
-            if blender_bone.parent:
-                blender_bone_children = blender_bones_children.get(
-                        blender_bone.parent.name)
-                if blender_bone_children is None:
-                    blender_bone_children = blender_bones_children[
-                            blender_bone.parent.name] = []
-            else:
-                blender_bone_children = blender_bones_children[None]
-
-            blender_bone_children.append(blender_bone.name)
-
-        self.traverse_dependencies(
-                blender_bones_ordered,
-                blender_bones_children,
-                None)
-
-        return blender_bones_ordered
-
-
-    ###########################################################################
-    def traverse_dependencies(self, blender_bones_ordered,
-            blender_bones_children, key):
-        blender_bone_children = blender_bones_children.get(key)
-        if blender_bone_children:
-            for blender_bone_name in blender_bone_children:
-                blender_bones_ordered.append(blender_bone_name)
-                self.traverse_dependencies(
-                        blender_bones_ordered,
-                        blender_bones_children,
-                        blender_bone_name)
-
-    ###########################################################################
-    def fill_keyframe_sets(self,
-            fcurves,
-            frames_location, frames_rotation, frames_scale,
-            frame_correction):
-        for fcurve in fcurves:
-            if fcurve.data_path.endswith(".location"):
-                frames = frames_location
-            elif fcurve.data_path.endswith(".rotation_euler"):
-                frames = frames_rotation
-            elif fcurve.data_path.endswith(".rotation_quaternion"):
-                frames = frames_rotation
-            elif fcurve.data_path.endswith(".scale"):
-                frames = frames_scale
-            else:
-                pass
-
-            for keyframe_point in fcurve.keyframe_points:
-                frames.add(int(keyframe_point.co[0] + frame_correction))
-
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-# ##### END OF FILE #####
diff --git a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_import.py b/release/scripts/addons_contrib/io_scene_ms3d/ms3d_import.py
deleted file mode 100644
index 3c01085..0000000
--- a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_import.py
+++ /dev/null
@@ -1,945 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-
-
-# ##### BEGIN COPYRIGHT BLOCK #####
-#
-# initial script copyright (c)2011,2012 Alexander Nussbaumer
-#
-# ##### END COPYRIGHT BLOCK #####
-
-
-#import python stuff
-import io
-from mathutils import (
-        Vector,
-        Matrix,
-        )
-from os import (
-        path,
-        )
-from sys import (
-        exc_info,
-        )
-from time import (
-        time,
-        )
-
-
-# import io_scene_ms3d stuff
-from io_scene_ms3d.ms3d_strings import (
-        ms3d_str,
-        )
-from io_scene_ms3d.ms3d_spec import (
-        Ms3dSpec,
-        Ms3dModel,
-        Ms3dVertexEx2,
-        Ms3dVertexEx3,
-        )
-from io_scene_ms3d.ms3d_utils import (
-        select_all,
-        enable_pose_mode,
-        enable_edit_mode,
-        pre_setup_environment,
-        post_setup_environment,
-        get_edge_split_modifier_add_if,
-        )
-from io_scene_ms3d.ms3d_ui import (
-        Ms3dUi,
-        )
-
-
-#import blender stuff
-from bpy import (
-        ops,
-        )
-import bmesh
-from bpy_extras.image_utils import (
-        load_image,
-        )
-
-
-###############################################################################
-class Ms3dImporter():
-    """ Load a MilkShape3D MS3D File """
-    def __init__(self, options):
-        self.options = options
-        pass
-
-    ###########################################################################
-    # create empty blender ms3d_model
-    # read ms3d file
-    # fill blender with ms3d_model content
-    def read(self, blender_context):
-        """ read ms3d file and convert ms3d content to bender content """
-
-        t1 = time()
-        t2 = None
-        self.has_textures = False
-
-        try:
-            # setup environment
-            pre_setup_environment(self, blender_context)
-
-            # create an empty ms3d template
-            ms3d_model = Ms3dModel(self.filepath_splitted[1])
-
-            #self.file = None
-            try:
-                # open ms3d file
-                #self.file = io.FileIO(self.options.filepath, 'rb')
-                with io.FileIO(self.options.filepath, 'rb') as self.file:
-                    # read and inject ms3d data from disk to internal structure
-                    ms3d_model.read(self.file)
-                    self.file.close()
-            finally:
-                # close ms3d file
-                #if self.file is not None:
-                #    self.file.close()
-                pass
-
-            # if option is set, this time will enlargs the io time
-            if self.options.verbose:
-                ms3d_model.print_internal()
-
-            t2 = time()
-
-            is_valid, statistics = ms3d_model.is_valid()
-
-            if is_valid:
-                # inject ms3d data to blender
-                self.to_blender(blender_context, ms3d_model)
-
-                blender_scene = blender_context.scene
-
-                # finalize/restore environment
-                blender_scene.update()
-
-                post_setup_environment(self, blender_context)
-
-            print()
-            print("##########################################################")
-            print("Import from MS3D to Blender")
-            print(statistics)
-            print("##########################################################")
-
-        except Exception:
-            type, value, traceback = exc_info()
-            print("read - exception in try block\n  type: '{0}'\n"
-                    "  value: '{1}'".format(type, value, traceback))
-
-            if t2 is None:
-                t2 = time()
-
-            raise
-
-        else:
-            pass
-
-        t3 = time()
-        print(ms3d_str['SUMMARY_IMPORT'].format(
-                (t3 - t1), (t2 - t1), (t3 - t2)))
-
-        return {"FINISHED"}
-
-
-    ###########################################################################
-    def to_blender(self, blender_context, ms3d_model):
-        blender_mesh_object = self.create_geometry(blender_context, ms3d_model)
-        blender_armature_object = self.create_animation(
-                blender_context, ms3d_model, blender_mesh_object)
-
-        self.organize_objects(
-                blender_context, ms3d_model,
-                [blender_mesh_object, blender_armature_object])
-
-
-    ###########################################################################
-    def organize_objects(self, blender_context, ms3d_model, blender_objects):
-        ##########################
-        # blender_armature_object to blender_mesh_object
-        # that has bad side effects to the armature
-        # and causes cyclic dependecies
-        ###blender_armature_object.parent = blender_mesh_object
-        ###blender_mesh_object.parent = blender_armature_object
-
-        blender_scene = blender_context.scene
-
-        blender_group = blender_context.blend_data.groups.new(
-                "{}.g".format(ms3d_model.name))
-        blender_empty_object = blender_context.blend_data.objects.new(
-                "{}.e".format(ms3d_model.name), None)
-        blender_empty_object.location = blender_scene.cursor_location
-        blender_scene.objects.link(blender_empty_object)
-        blender_group.objects.link(blender_empty_object)
-
-        for blender_object in blender_objects:
-            if blender_object is not None:
-                blender_group.objects.link(blender_object)
-                blender_object.parent = blender_empty_object
-
-
-    ###########################################################################
-    def create_geometry(self, blender_context, ms3d_model):
-        ##########################
-        # blender stuff:
-        # create a blender Mesh
-        blender_mesh = blender_context.blend_data.meshes.new(
-                "{}.m".format(ms3d_model.name))
-        blender_mesh.ms3d.name = ms3d_model.name
-
-        ms3d_comment = ms3d_model.comment_object
-        if ms3d_comment is not None:
-            blender_mesh.ms3d.comment = ms3d_comment.comment
-        ms3d_model_ex = ms3d_model.model_ex_object
-        if ms3d_model_ex is not None:
-            blender_mesh.ms3d.joint_size = ms3d_model_ex.joint_size
-            blender_mesh.ms3d.alpha_ref = ms3d_model_ex.alpha_ref
-            blender_mesh.ms3d.transparency_mode \
-                    = Ms3dUi.transparency_mode_from_ms3d(
-                            ms3d_model_ex.transparency_mode)
-
-        ##########################
-        # blender stuff:
-        # link to blender object
-        blender_mesh_object = blender_context.blend_data.objects.new(
-                "{}.m".format(ms3d_model.name), blender_mesh)
-
-        ##########################
-        # blender stuff:
-        # create edge split modifire, to make sharp edges visible
-        blender_modifier = get_edge_split_modifier_add_if(blender_mesh_object)
-
-        ##########################
-        # blender stuff:
-        # link to blender scene
-        blender_scene = blender_context.scene
-        blender_scene.objects.link(blender_mesh_object)
-        #blender_mesh_object.location = blender_scene.cursor_location
-        enable_edit_mode(False, blender_context)
-        select_all(False)
-        blender_mesh_object.select = True
-        blender_scene.objects.active = blender_mesh_object
-
-        ##########################
-        # take this as active object after import
-        self.active_object = blender_mesh_object
-
-        ##########################
-        # blender stuff:
-        # create all (ms3d) groups
-        ms3d_to_blender_group_index = {}
-        blender_group_manager = blender_mesh.ms3d
-        for ms3d_group_index, ms3d_group in enumerate(ms3d_model.groups):
-            blender_group = blender_group_manager.create_group()
-            blender_group.name = ms3d_group.name
-            blender_group.flags = Ms3dUi.flags_from_ms3d(ms3d_group.flags)
-            blender_group.material_index = ms3d_group.material_index
-
-            ms3d_comment = ms3d_group.comment_object
-            if ms3d_comment is not None:
-                blender_group.comment = ms3d_comment.comment
-
-            # translation dictionary
-            ms3d_to_blender_group_index[ms3d_group_index] = blender_group.id
-
-        ####################################################
-        # begin BMesh stuff
-        #
-
-        ##########################
-        # BMesh stuff:
-        # create an empty BMesh
-        bm = bmesh.new()
-
-        ##########################
-        # BMesh stuff:
-        # create new Layers for custom data per "mesh face"
-        layer_texture = bm.faces.layers.tex.get(
-                ms3d_str['OBJECT_LAYER_TEXTURE'])
-        if layer_texture is None:
-            layer_texture = bm.faces.layers.tex.new(
-                    ms3d_str['OBJECT_LAYER_TEXTURE'])
-
-        layer_smoothing_group = bm.faces.layers.int.get(
-                ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
-        if layer_smoothing_group is None:
-            layer_smoothing_group = bm.faces.layers.int.new(
-                    ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
-
-        layer_group = bm.faces.layers.int.get(
-                ms3d_str['OBJECT_LAYER_GROUP'])
-        if layer_group is None:
-            layer_group = bm.faces.layers.int.new(
-                    ms3d_str['OBJECT_LAYER_GROUP'])
-
-        ##########################
-        # BMesh stuff:
-        # create new Layers for custom data per "face vertex"
-        layer_uv = bm.loops.layers.uv.get(ms3d_str['OBJECT_LAYER_UV'])
-        if layer_uv is None:
-            layer_uv = bm.loops.layers.uv.new(ms3d_str['OBJECT_LAYER_UV'])
-
-        ##########################
-        # BMesh stuff:
-        # create new Layers for custom data per "vertex"
-        layer_extra = bm.verts.layers.int.get(ms3d_str['OBJECT_LAYER_EXTRA'])
-        if layer_extra is None:
-            layer_extra = bm.verts.layers.int.new(ms3d_str['OBJECT_LAYER_EXTRA'])
-
-        ##########################
-        # BMesh stuff:
-        # create all vertices
-        for ms3d_vertex_index, ms3d_vertex in enumerate(ms3d_model.vertices):
-            bmv = bm.verts.new(self.geometry_correction(ms3d_vertex.vertex))
-
-            if layer_extra and ms3d_vertex.vertex_ex_object and \
-                    (isinstance(ms3d_vertex.vertex_ex_object, Ms3dVertexEx2) \
-                    or isinstance(ms3d_vertex.vertex_ex_object, Ms3dVertexEx3)):
-
-                #bmv[layer_extra] = ms3d_vertex.vertex_ex_object.extra
-                # bm.verts.layers.int does only support signed int32
-                # convert unsigned int32 to signed int32 (little-endian)
-                unsigned_int32 = ms3d_vertex.vertex_ex_object.extra
-                bytes_int32 = unsigned_int32.to_bytes(
-                        4, byteorder='little', signed=False)
-                signed_int32 = int.from_bytes(
-                        bytes_int32, byteorder='little', signed=True)
-                bmv[layer_extra] = signed_int32
-
-        ##########################
-        # blender stuff (uses BMesh stuff):
-        # create all materials / image textures
-        ms3d_to_blender_material = {}
-        for ms3d_material_index, ms3d_material in enumerate(
-                ms3d_model.materials):
-            blender_material = blender_context.blend_data.materials.new(
-                    ms3d_material.name)
-
-            # custom datas
-            blender_material.ms3d.name = ms3d_material.name
-            blender_material.ms3d.ambient = ms3d_material.ambient
-            blender_material.ms3d.diffuse = ms3d_material.diffuse
-            blender_material.ms3d.specular = ms3d_material.specular
-            blender_material.ms3d.emissive = ms3d_material.emissive
-            blender_material.ms3d.shininess = ms3d_material.shininess
-            blender_material.ms3d.transparency = ms3d_material.transparency
-            blender_material.ms3d.mode = Ms3dUi.texture_mode_from_ms3d(
-                    ms3d_material.mode)
-
-            if ms3d_material.texture:
-                blender_material.ms3d.texture = ms3d_material.texture
-
-            if ms3d_material.alphamap:
-                blender_material.ms3d.alphamap = ms3d_material.alphamap
-
-            ms3d_comment = ms3d_material.comment_object
-            if ms3d_comment is not None:
-                blender_material.ms3d.comment = ms3d_comment.comment
-
-            # blender datas
-            blender_material.ambient = (
-                    (ms3d_material.ambient[0]
-                    + ms3d_material.ambient[1]
-                    + ms3d_material.ambient[2]) / 3.0)
-
-            blender_material.diffuse_color[0] = ms3d_material.diffuse[0]
-            blender_material.diffuse_color[1] = ms3d_material.diffuse[1]
-            blender_material.diffuse_color[2] = ms3d_material.diffuse[2]
-
-            blender_material.specular_color[0] = ms3d_material.specular[0]
-            blender_material.specular_color[1] = ms3d_material.specular[1]
-            blender_material.specular_color[2] = ms3d_material.specular[2]
-
-            blender_material.emit = (
-                    (ms3d_material.emissive[0]
-                    + ms3d_material.emissive[1]
-                    + ms3d_material.emissive[2]) / 3.0)
-
-            blender_material.specular_hardness = ms3d_material.shininess * 4.0
-            blender_material.alpha = 1.0 - ms3d_material.transparency
-
-            # diffuse texture
-            if ms3d_material.texture:
-                dir_name_diffuse = self.filepath_splitted[0]
-                file_name_diffuse = path.split(ms3d_material.texture)[1]
-                blender_image_diffuse = load_image(
-                        file_name_diffuse, dir_name_diffuse)
-                blender_texture_diffuse = \
-                        blender_context.blend_data.textures.new(
-                        name=file_name_diffuse, type='IMAGE')
-                blender_texture_diffuse.image = blender_image_diffuse
-                blender_texture_slot_diffuse \
-                        = blender_material.texture_slots.add()
-                blender_texture_slot_diffuse.texture = blender_texture_diffuse
-                blender_texture_slot_diffuse.texture_coords = 'UV'
-                blender_texture_slot_diffuse.uv_layer = layer_uv.name
-                blender_texture_slot_diffuse.use_map_color_diffuse = True
-                blender_texture_slot_diffuse.use_map_alpha = False
-                if blender_image_diffuse is not None:
-                    self.has_textures = True
-            else:
-                blender_image_diffuse = None
-
-            # alpha texture
-            if ms3d_material.alphamap:
-                dir_name_alpha = self.filepath_splitted[0]
-                file_name_alpha = path.split(ms3d_material.alphamap)[1]
-                blender_image_alpha = load_image(
-                        file_name_alpha, dir_name_alpha)
-                blender_texture_alpha = blender_context.blend_data.textures.new(
-                        name=file_name_alpha, type='IMAGE')
-                blender_texture_alpha.image = blender_image_alpha
-                blender_texture_slot_alpha \
-                        = blender_material.texture_slots.add()
-                blender_texture_slot_alpha.texture = blender_texture_alpha
-                blender_texture_slot_alpha.texture_coords = 'UV'
-                blender_texture_slot_alpha.uv_layer = layer_uv.name
-                blender_texture_slot_alpha.use_map_color_diffuse = False
-                blender_texture_slot_alpha.use_map_alpha = True
-                blender_texture_slot_alpha.use_rgb_to_intensity = True
-                blender_material.alpha = 0
-                blender_material.specular_alpha = 0
-
-            # append blender material to blender mesh, to be linked to
-            blender_mesh.materials.append(blender_material)
-
-            # translation dictionary
-            ms3d_to_blender_material[ms3d_material_index] \
-                    = blender_image_diffuse
-
-        ##########################
-        # BMesh stuff:
-        # create all triangles
-        length_verts = len(bm.verts)
-        vertex_extra_index = length_verts
-        blender_invalide_normal = Vector()
-        smoothing_group_blender_faces = {}
-        for ms3d_triangle_index, ms3d_triangle in enumerate(
-                ms3d_model.triangles):
-            bmv_list = []
-            bmf_normal = Vector()
-
-            for index, vert_index in enumerate(ms3d_triangle.vertex_indices):
-                if vert_index < 0 or vert_index >= length_verts:
-                    continue
-                bmv = bm.verts[vert_index]
-
-                blender_normal = self.geometry_correction(
-                        ms3d_triangle.vertex_normals[index])
-                if bmv.normal == blender_invalide_normal:
-                    bmv.normal = blender_normal
-                elif bmv.normal != blender_normal \
-                        and self.options.extended_normal_handling:
-                    ## search for an already created extra vertex
-                    bmv_new = None
-                    for vert_index_candidat in range(
-                            vertex_extra_index, length_verts):
-                        bmv_candidat = bm.verts[vert_index_candidat]
-                        if bmv_candidat.co == bmv.co \
-                                and bmv_candidat.normal == blender_normal:
-                            bmv_new = bmv_candidat
-                            vert_index = vert_index_candidat
-                            break
-
-                    ## if not exists, create one in blender and ms3d as well
-                    if bmv_new is None:
-                        ms3d_model.vertices.append(
-                                ms3d_model.vertices[vert_index])
-                        bmv_new = bm.verts.new(bmv.co)
-                        bmv_new.normal = blender_normal
-                        bmv_new[layer_extra] = bmv[layer_extra]
-                        vert_index = length_verts
-                        length_verts += 1
-                        self.options.report({'WARNING', 'INFO'},
-                                ms3d_str['WARNING_IMPORT_EXTRA_VERTEX_NORMAL'].format(
-                                bmv.normal, blender_normal))
-                    bmv = bmv_new
-
-                if [[x] for x in bmv_list if x == bmv]:
-                    self.options.report(
-                            {'WARNING', 'INFO'},
-                            ms3d_str['WARNING_IMPORT_SKIP_VERTEX_DOUBLE'].format(
-                                    ms3d_triangle_index))
-                    continue
-                bmv_list.append(bmv)
-                bmf_normal += bmv.normal
-
-            if len(bmv_list) < 3:
-                self.options.report(
-                        {'WARNING', 'INFO'},
-                        ms3d_str['WARNING_IMPORT_SKIP_LESS_VERTICES'].format(
-                                ms3d_triangle_index))
-                continue
-
-            bmf_normal.normalize()
-
-            bmf = bm.faces.get(bmv_list)
-            if bmf is not None:
-                self.options.report(
-                        {'WARNING', 'INFO'},
-                        ms3d_str['WARNING_IMPORT_SKIP_FACE_DOUBLE'].format(
-                                ms3d_triangle_index))
-                continue
-
-            bmf = bm.faces.new(bmv_list)
-            bmf.normal = bmf_normal
-
-            # blender uv custom data per "face vertex"
-            bmf.loops[0][layer_uv].uv = Vector(
-                    (ms3d_triangle.s[0], 1.0 - ms3d_triangle.t[0]))
-            bmf.loops[1][layer_uv].uv = Vector(
-                    (ms3d_triangle.s[1], 1.0 - ms3d_triangle.t[1]))
-            bmf.loops[2][layer_uv].uv = Vector(
-                    (ms3d_triangle.s[2], 1.0 - ms3d_triangle.t[2]))
-
-            # ms3d custom data per "mesh face"
-            bmf[layer_smoothing_group] = ms3d_triangle.smoothing_group
-
-            blender_group_id = ms3d_to_blender_group_index.get(
-                    ms3d_triangle.group_index)
-            if blender_group_id is not None:
-                bmf[layer_group] = blender_group_id
-
-            if ms3d_triangle.group_index >= 0 \
-                    and ms3d_triangle.group_index < len(ms3d_model.groups):
-                ms3d_material_index \
-                        = ms3d_model.groups[ms3d_triangle.group_index].material_index
-                if ms3d_material_index != Ms3dSpec.NONE_GROUP_MATERIAL_INDEX:
-                    bmf.material_index = ms3d_material_index
-                    # apply diffuse texture image to face, to be visible in 3d view
-                    bmf[layer_texture].image = ms3d_to_blender_material.get(
-                            ms3d_material_index)
-
-            # helper dictionary for post-processing smoothing_groups
-            smoothing_group_blender_face = smoothing_group_blender_faces.get(
-                    ms3d_triangle.smoothing_group)
-            if smoothing_group_blender_face is None:
-                smoothing_group_blender_face = []
-                smoothing_group_blender_faces[ms3d_triangle.smoothing_group] \
-                        = smoothing_group_blender_face
-            smoothing_group_blender_face.append(bmf)
-
-        ##########################
-        # BMesh stuff:
-        # create all sharp edges for blender to make smoothing_groups visible
-        for ms3d_smoothing_group_index, blender_face_list \
-                in smoothing_group_blender_faces.items():
-            edge_dict = {}
-            for bmf in blender_face_list:
-                bmf.smooth = True
-                for bme in bmf.edges:
-                    if edge_dict.get(bme) is None:
-                        edge_dict[bme] = 0
-                    else:
-                        edge_dict[bme] += 1
-                    bme.seam = (edge_dict[bme] == 0)
-                    bme.smooth = (edge_dict[bme] != 0)
-
-        ##########################
-        # BMesh stuff:
-        # finally tranfer BMesh to Mesh
-        bm.to_mesh(blender_mesh)
-        bm.free()
-
-
-        #
-        # end BMesh stuff
-        ####################################################
-
-        blender_mesh.validate(self.options.verbose)
-
-        return blender_mesh_object
-
-
-    ###########################################################################
-    def create_animation(self, blender_context, ms3d_model, blender_mesh_object):
-        ##########################
-        # setup scene
-        blender_scene = blender_context.scene
-        blender_scene.render.fps = ms3d_model.animation_fps
-        if ms3d_model.animation_fps:
-            blender_scene.render.fps_base = (blender_scene.render.fps /
-                    ms3d_model.animation_fps)
-
-        blender_scene.frame_start = 1
-        blender_scene.frame_end = (ms3d_model.number_total_frames
-                + blender_scene.frame_start) - 1
-        blender_scene.frame_current = (ms3d_model.current_time
-                * ms3d_model.animation_fps)
-
-        ##########################
-        if not ms3d_model.joints:
-            return
-
-        ##########################
-        ms3d_armature_name = "{}.a".format(ms3d_model.name)
-        ms3d_action_name = "{}.act".format(ms3d_model.name)
-
-        ##########################
-        # create new blender_armature_object
-        blender_armature = blender_context.blend_data.armatures.new(
-                ms3d_armature_name)
-        blender_armature.ms3d.name = ms3d_model.name
-        blender_armature.draw_type = 'STICK'
-        blender_armature.show_axes = True
-        blender_armature.use_auto_ik = True
-        blender_armature_object = blender_context.blend_data.objects.new(
-                ms3d_armature_name, blender_armature)
-        blender_scene.objects.link(blender_armature_object)
-        #blender_armature_object.location = blender_scene.cursor_location
-        blender_armature_object.show_x_ray = True
-
-        ##########################
-        # create new modifier
-        blender_modifier = blender_mesh_object.modifiers.new(
-                ms3d_armature_name, type='ARMATURE')
-        blender_modifier.show_expanded = False
-        blender_modifier.use_vertex_groups = True
-        blender_modifier.use_bone_envelopes = False
-        blender_modifier.object = blender_armature_object
-
-        ##########################
-        # prepare for vertex groups
-        ms3d_to_blender_vertex_groups = {}
-        for ms3d_vertex_index, ms3d_vertex in enumerate(ms3d_model.vertices):
-            # prepare for later use for blender vertex group
-            if ms3d_vertex.bone_id != Ms3dSpec.NONE_VERTEX_BONE_ID:
-                if ms3d_vertex.vertex_ex_object \
-                        and ( \
-                        ms3d_vertex.vertex_ex_object.bone_ids[0] != \
-                                Ms3dSpec.NONE_VERTEX_BONE_ID \
-                        or ms3d_vertex.vertex_ex_object.bone_ids[1] != \
-                                Ms3dSpec.NONE_VERTEX_BONE_ID \
-                        or ms3d_vertex.vertex_ex_object.bone_ids[2] != \
-                                Ms3dSpec.NONE_VERTEX_BONE_ID \
-                        ):
-                    ms3d_vertex_group_ids_weights = []
-                    ms3d_vertex_group_ids_weights.append(
-                            (ms3d_vertex.bone_id,
-                            float(ms3d_vertex.vertex_ex_object.weights[0] % 101) / 100.0,
-                            ))
-                    if ms3d_vertex.vertex_ex_object.bone_ids[0] != \
-                            Ms3dSpec.NONE_VERTEX_BONE_ID:
-                        ms3d_vertex_group_ids_weights.append(
-                                (ms3d_vertex.vertex_ex_object.bone_ids[0],
-                                float(ms3d_vertex.vertex_ex_object.weights[1] % 101) / 100.0
-                                ))
-                    if ms3d_vertex.vertex_ex_object.bone_ids[1] != \
-                            Ms3dSpec.NONE_VERTEX_BONE_ID:
-                        ms3d_vertex_group_ids_weights.append(
-                                (ms3d_vertex.vertex_ex_object.bone_ids[1],
-                                float(ms3d_vertex.vertex_ex_object.weights[2] % 101) / 100.0
-                                ))
-                    if ms3d_vertex.vertex_ex_object.bone_ids[2] != \
-                            Ms3dSpec.NONE_VERTEX_BONE_ID:
-                        ms3d_vertex_group_ids_weights.append(
-                                (ms3d_vertex.vertex_ex_object.bone_ids[2],
-                                1.0 -
-                                float((ms3d_vertex.vertex_ex_object.weights[0] % 101)
-                                + (ms3d_vertex.vertex_ex_object.weights[1] % 101)
-                                + (ms3d_vertex.vertex_ex_object.weights[2] % 101)) / 100.0
-                                ))
-
-                else:
-                    ms3d_vertex_group_ids_weights = [(ms3d_vertex.bone_id, 1.0), ]
-
-                for ms3d_vertex_group_id_weight in ms3d_vertex_group_ids_weights:
-                    ms3d_vertex_group_id = ms3d_vertex_group_id_weight[0]
-                    blender_vertex_weight = ms3d_vertex_group_id_weight[1]
-                    blender_vertex_group = ms3d_to_blender_vertex_groups.get(
-                            ms3d_vertex_group_id)
-                    if blender_vertex_group is None:
-                        ms3d_to_blender_vertex_groups[ms3d_vertex_group_id] \
-                                = blender_vertex_group = []
-                    blender_vertex_group.append((ms3d_vertex_index,
-                            blender_vertex_weight))
-
-        ##########################
-        # blender stuff:
-        # create all vertex groups to be used for bones
-        for ms3d_bone_id, blender_vertex_index_weight_list \
-                in ms3d_to_blender_vertex_groups.items():
-            ms3d_name = ms3d_model.joints[ms3d_bone_id].name
-            blender_vertex_group = blender_mesh_object.vertex_groups.new(
-                    ms3d_name)
-            for blender_vertex_id_weight in blender_vertex_index_weight_list:
-                blender_vertex_index = blender_vertex_id_weight[0]
-                blender_vertex_weight = blender_vertex_id_weight[1]
-                blender_vertex_group.add((blender_vertex_index, ),
-                        blender_vertex_weight, 'ADD')
-
-        ##########################
-        # bring joints in the correct order
-        ms3d_joints_ordered = []
-        self.build_ms3d_joint_dependency_order(ms3d_model.joints,
-                ms3d_joints_ordered)
-
-        ##########################
-        # prepare joint data for later use
-        ms3d_joint_by_name = {}
-        for ms3d_joint in ms3d_joints_ordered:
-            item = ms3d_joint_by_name.get(ms3d_joint.name)
-            if item is None:
-                ms3d_joint.__children = []
-                ms3d_joint_by_name[ms3d_joint.name] = ms3d_joint
-
-            matrix_local_rot = (Matrix.Rotation(ms3d_joint.rotation[2], 4, 'Z')
-                    * Matrix.Rotation(ms3d_joint.rotation[1], 4, 'Y')
-                    ) * Matrix.Rotation(ms3d_joint.rotation[0], 4, 'X')
-            matrix_local = Matrix.Translation(Vector(ms3d_joint.position)
-                    ) * matrix_local_rot
-
-            ms3d_joint.__matrix_local_rot = matrix_local_rot
-            ms3d_joint.__matrix_global_rot = matrix_local_rot
-            ms3d_joint.__matrix_local = matrix_local
-            ms3d_joint.__matrix_global = matrix_local
-
-            if ms3d_joint.parent_name:
-                ms3d_joint_parent = ms3d_joint_by_name.get(
-                        ms3d_joint.parent_name)
-                if ms3d_joint_parent is not None:
-                    ms3d_joint_parent.__children.append(ms3d_joint)
-
-                    matrix_global = ms3d_joint_parent.__matrix_global \
-                            * matrix_local
-                    ms3d_joint.__matrix_global = matrix_global
-
-                    matrix_global_rot = ms3d_joint_parent.__matrix_global_rot \
-                            * matrix_local_rot
-                    ms3d_joint.__matrix_global_rot = matrix_global_rot
-
-        ##########################
-        # ms3d_joint to blender_edit_bone
-        if ms3d_model.model_ex_object and not self.options.use_joint_size:
-            joint_length = ms3d_model.model_ex_object.joint_size
-        else:
-            joint_length = self.options.joint_size
-        if joint_length < 0.01:
-            joint_length = 0.01
-
-        blender_scene.objects.active = blender_armature_object
-        enable_edit_mode(True, blender_context)
-        for ms3d_joint in ms3d_joints_ordered:
-            blender_edit_bone = blender_armature.edit_bones.new(ms3d_joint.name)
-            blender_edit_bone.use_connect = False
-            blender_edit_bone.use_inherit_rotation = True
-            blender_edit_bone.use_inherit_scale = True
-            blender_edit_bone.use_local_location = True
-            blender_armature.edit_bones.active = blender_edit_bone
-
-            ms3d_joint = ms3d_joint_by_name[ms3d_joint.name]
-            ms3d_joint_vector = ms3d_joint.__matrix_global * Vector()
-
-            blender_edit_bone.head \
-                    = self.geometry_correction(ms3d_joint_vector)
-
-            vector_tail_end_up = ms3d_joint.__matrix_global_rot * Vector((0,1,0))
-            vector_tail_end_dir = ms3d_joint.__matrix_global_rot * Vector((0,0,1))
-            vector_tail_end_up.normalize()
-            vector_tail_end_dir.normalize()
-            blender_edit_bone.tail = blender_edit_bone.head \
-                    + self.geometry_correction(
-                    vector_tail_end_dir * joint_length)
-            blender_edit_bone.align_roll(self.geometry_correction(
-                    vector_tail_end_up))
-
-            if ms3d_joint.parent_name:
-                ms3d_joint_parent = ms3d_joint_by_name[ms3d_joint.parent_name]
-                blender_edit_bone_parent = ms3d_joint_parent.blender_edit_bone
-                blender_edit_bone.parent = blender_edit_bone_parent
-
-            ms3d_joint.blender_bone_name = blender_edit_bone.name
-            ms3d_joint.blender_edit_bone = blender_edit_bone
-        enable_edit_mode(False, blender_context)
-
-        if self.options.joint_to_bones:
-            enable_edit_mode(True, blender_context)
-            for ms3d_joint in ms3d_joints_ordered:
-                blender_edit_bone = blender_armature.edit_bones[ms3d_joint.name]
-                if blender_edit_bone.children:
-                    new_length = 0.0
-                    for child_bone in blender_edit_bone.children:
-                        length = (child_bone.head - blender_edit_bone.head).length
-                        if new_length <= 0 or length < new_length:
-                            new_length = length
-                    if new_length >= 0.01:
-                        direction = blender_edit_bone.tail - blender_edit_bone.head
-                        direction.normalize()
-                        blender_edit_bone.tail = blender_edit_bone.head + (direction * new_length)
-            enable_edit_mode(False, blender_context)
-
-        ##########################
-        # post process bones
-        enable_edit_mode(False, blender_context)
-        for ms3d_joint_name, ms3d_joint in ms3d_joint_by_name.items():
-            blender_bone = blender_armature.bones.get(
-                    ms3d_joint.blender_bone_name)
-            if blender_bone is None:
-                continue
-
-            blender_bone.ms3d.name = ms3d_joint.name
-            blender_bone.ms3d.flags = Ms3dUi.flags_from_ms3d(ms3d_joint.flags)
-
-            ms3d_joint_ex = ms3d_joint.joint_ex_object
-            if ms3d_joint_ex is not None:
-                blender_bone.ms3d.color = ms3d_joint_ex.color
-
-            ms3d_comment = ms3d_joint.comment_object
-            if ms3d_comment is not None:
-                blender_bone.ms3d.comment = ms3d_comment.comment
-
-        ##########################
-        if not self.options.use_animation:
-            return blender_armature_object
-
-
-        ##########################
-        # process pose bones
-        enable_pose_mode(True, blender_context)
-
-        blender_action = blender_context.blend_data.actions.new(ms3d_action_name)
-        if blender_armature_object.animation_data is None:
-            blender_armature_object.animation_data_create()
-        blender_armature_object.animation_data.action = blender_action
-
-        ##########################
-        # transition between keys may be incorrect
-        # because of the gimbal-lock problem!
-        # http://www.youtube.com/watch?v=zc8b2Jo7mno
-        # http://www.youtube.com/watch?v=rrUCBOlJdt4
-        # you can fix it manually by selecting the affected keyframes
-        # and allpy the following option to it:
-        # "Graph Editor -> Key -> Discontinuity (Euler) Filter"
-        # ==> "bpy.ops.graph.euler_filter()"
-        # but this option is only available for Euler rotation f-curves!
-        #
-        for ms3d_joint_name, ms3d_joint in ms3d_joint_by_name.items():
-            blender_pose_bone = blender_armature_object.pose.bones.get(
-                    ms3d_joint.blender_bone_name)
-            if blender_pose_bone is None:
-                continue
-
-            data_path = blender_pose_bone.path_from_id('location')
-            fcurve_location_x = blender_action.fcurves.new(data_path, index=0)
-            fcurve_location_y = blender_action.fcurves.new(data_path, index=1)
-            fcurve_location_z = blender_action.fcurves.new(data_path, index=2)
-            for translation_key_frames in ms3d_joint.translation_key_frames:
-                frame = (translation_key_frames.time * ms3d_model.animation_fps)
-                matrix_local = Matrix.Translation(
-                        Vector(translation_key_frames.position))
-                v = (matrix_local) * Vector()
-                fcurve_location_x.keyframe_points.insert(frame, -v[0])
-                fcurve_location_y.keyframe_points.insert(frame, v[2])
-                fcurve_location_z.keyframe_points.insert(frame, v[1])
-
-            if self.options.is_rotation_mode_quaternion:
-                blender_pose_bone.rotation_mode = 'QUATERNION'
-                data_path = blender_pose_bone.path_from_id("rotation_quaternion")
-                fcurve_rotation_w = blender_action.fcurves.new(data_path, index=0)
-                fcurve_rotation_x = blender_action.fcurves.new(data_path, index=1)
-                fcurve_rotation_y = blender_action.fcurves.new(data_path, index=2)
-                fcurve_rotation_z = blender_action.fcurves.new(data_path, index=3)
-                for rotation_key_frames in ms3d_joint.rotation_key_frames:
-                    frame = (rotation_key_frames.time * ms3d_model.animation_fps)
-                    matrix_local_rot = (
-                            Matrix.Rotation(
-                                    rotation_key_frames.rotation[2], 4, 'Y')
-                            * Matrix.Rotation(
-                                    rotation_key_frames.rotation[1], 4, 'Z')
-                            ) * Matrix.Rotation(
-                                    -rotation_key_frames.rotation[0], 4, 'X')
-                    q = (matrix_local_rot).to_quaternion()
-                    fcurve_rotation_w.keyframe_points.insert(frame, q.w)
-                    fcurve_rotation_x.keyframe_points.insert(frame, q.x)
-                    fcurve_rotation_y.keyframe_points.insert(frame, q.y)
-                    fcurve_rotation_z.keyframe_points.insert(frame, q.z)
-            else:
-                blender_pose_bone.rotation_mode = 'XZY'
-                data_path = blender_pose_bone.path_from_id("rotation_euler")
-                fcurve_rotation_x = blender_action.fcurves.new(data_path, index=0)
-                fcurve_rotation_y = blender_action.fcurves.new(data_path, index=1)
-                fcurve_rotation_z = blender_action.fcurves.new(data_path, index=2)
-                for rotation_key_frames in ms3d_joint.rotation_key_frames:
-                    frame = (rotation_key_frames.time * ms3d_model.animation_fps)
-                    fcurve_rotation_x.keyframe_points.insert(
-                            frame, -rotation_key_frames.rotation[0])
-                    fcurve_rotation_y.keyframe_points.insert(
-                            frame, rotation_key_frames.rotation[2])
-                    fcurve_rotation_z.keyframe_points.insert(
-                            frame, rotation_key_frames.rotation[1])
-
-        enable_pose_mode(False, blender_context)
-
-        return blender_armature_object
-
-
-    ###########################################################################
-    def geometry_correction(self, value):
-        return Vector((value[2], value[0], value[1]))
-
-
-    ###########################################################################
-    def build_ms3d_joint_dependency_order(self, ms3d_joints, ms3d_joints_ordered):
-        ms3d_joints_children = {"": {}}
-        for ms3d_joint in ms3d_joints:
-            if ms3d_joint.parent_name:
-                ms3d_joint_children = ms3d_joints_children.get(
-                        ms3d_joint.parent_name)
-                if ms3d_joint_children is None:
-                    ms3d_joint_children = ms3d_joints_children[
-                            ms3d_joint.parent_name] = {}
-            else:
-                ms3d_joint_children = ms3d_joints_children[""]
-
-            ms3d_joint_children[ms3d_joint.name] = ms3d_joint
-
-        self.traverse_dependencies(
-                ms3d_joints_ordered,
-                ms3d_joints_children,
-                "")
-
-
-        return ms3d_joints_ordered
-
-
-    ###########################################################################
-    def traverse_dependencies(self, ms3d_joints_ordered, ms3d_joints_children,
-            key):
-        ms3d_joint_children = ms3d_joints_children.get(key)
-        if ms3d_joint_children:
-            for item in ms3d_joint_children.items():
-                ms3d_joint_name = item[0]
-                ms3d_joint = item[1]
-                ms3d_joints_ordered.append(ms3d_joint)
-                self.traverse_dependencies(
-                        ms3d_joints_ordered,
-                        ms3d_joints_children,
-                        ms3d_joint_name)
-
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-# ##### END OF FILE #####
diff --git a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_spec.py b/release/scripts/addons_contrib/io_scene_ms3d/ms3d_spec.py
deleted file mode 100644
index 177fd4f..0000000
--- a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_spec.py
+++ /dev/null
@@ -1,2075 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-
-
-# ##### BEGIN COPYRIGHT BLOCK #####
-#
-# initial script copyright (c)2011,2012 Alexander Nussbaumer
-#
-# ##### END COPYRIGHT BLOCK #####
-
-
-from struct import (
-        pack,
-        unpack,
-        )
-from sys import (
-        exc_info,
-        )
-from os import (
-        fstat,
-        )
-
-###############################################################################
-#
-# MilkShape 3D 1.8.5 File Format Specification
-#
-# all specifications were taken from SDK 1.8.5
-#
-# some additional specifications were taken from
-# MilkShape 3D Viewer v2.0 (Nov 06 2007) - msMesh.h
-#
-
-
-###############################################################################
-#
-# sizes
-#
-
-class Ms3dSpec:
-    ###########################################################################
-    #
-    # max values
-    #
-    MAX_VERTICES = 65534 # 0..65533; note: (65534???, 65535???)
-    MAX_TRIANGLES = 65534 # 0..65533; note: (65534???, 65535???)
-    MAX_GROUPS = 255 # 1..255; note: (0 default group)
-    MAX_MATERIALS = 128 # 0..127; note: (-1 no material)
-    MAX_JOINTS = 128 # 0..127; note: (-1 no joint)
-    MAX_SMOOTH_GROUP = 32 # 0..32; note: (0 no smoothing group)
-    MAX_TEXTURE_FILENAME_SIZE = 128
-
-    ###########################################################################
-    #
-    # flags
-    #
-    FLAG_NONE = 0
-    FLAG_SELECTED = 1
-    FLAG_HIDDEN = 2
-    FLAG_SELECTED2 = 4
-    FLAG_DIRTY = 8
-    FLAG_ISKEY = 16 # additional spec from [2]
-    FLAG_NEWLYCREATED = 32 # additional spec from [2]
-    FLAG_MARKED = 64 # additional spec from [2]
-
-    FLAG_TEXTURE_NONE = 0x00
-    FLAG_TEXTURE_COMBINE_ALPHA = 0x20
-    FLAG_TEXTURE_HAS_ALPHA = 0x40
-    FLAG_TEXTURE_SPHERE_MAP = 0x80
-
-    MODE_TRANSPARENCY_SIMPLE = 0
-    MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF = 1
-    MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES = 2
-
-
-    ###########################################################################
-    #
-    # values
-    #
-    HEADER = "MS3D000000"
-
-
-    ###########################################################################
-    #
-    # min, max, default values
-    #
-    NONE_VERTEX_BONE_ID = -1
-    NONE_GROUP_MATERIAL_INDEX = -1
-
-    DEFAULT_HEADER = HEADER
-    DEFAULT_HEADER_VERSION = 4
-    DEFAULT_VERTEX_BONE_ID = NONE_VERTEX_BONE_ID
-    DEFAULT_TRIANGLE_SMOOTHING_GROUP = 0
-    DEFAULT_TRIANGLE_GROUP = 0
-    DEFAULT_MATERIAL_MODE = FLAG_TEXTURE_NONE
-    DEFAULT_GROUP_MATERIAL_INDEX = NONE_GROUP_MATERIAL_INDEX
-    DEFAULT_MODEL_JOINT_SIZE = 1.0
-    DEFAULT_MODEL_TRANSPARENCY_MODE = MODE_TRANSPARENCY_SIMPLE
-    DEFAULT_MODEL_ANIMATION_FPS = 25.0
-    DEFAULT_MODEL_SUB_VERSION_COMMENTS = 1
-    DEFAULT_MODEL_SUB_VERSION_VERTEX_EXTRA = 2
-    DEFAULT_MODEL_SUB_VERSION_JOINT_EXTRA = 1
-    DEFAULT_MODEL_SUB_VERSION_MODEL_EXTRA = 1
-    DEFAULT_FLAGS = FLAG_NONE
-    MAX_MATERIAL_SHININESS = 128
-
-    # blender default / OpenGL default
-    DEFAULT_MATERIAL_AMBIENT = (0.2, 0.2, 0.2, 1.0)
-    DEFAULT_MATERIAL_DIFFUSE = (0.8, 0.8, 0.8, 1.0)
-    DEFAULT_MATERIAL_SPECULAR = (1.0, 1.0, 1.0, 1.0)
-    DEFAULT_MATERIAL_EMISSIVE = (0.0, 0.0, 0.0, 1.0)
-    DEFAULT_MATERIAL_SHININESS = 12.5
-
-    DEFAULT_JOINT_COLOR = (0.8, 0.8, 0.8)
-
-###############################################################################
-#
-# helper class for basic raw io
-#
-class EOF(BaseException):
-    pass
-
-class Ms3dIo:
-    # sizes for IO
-    SIZE_BYTE = 1
-    SIZE_SBYTE = 1
-    SIZE_WORD = 2
-    SIZE_DWORD = 4
-    SIZE_FLOAT = 4
-    LENGTH_ID = 10
-    LENGTH_NAME = 32
-    LENGTH_FILENAME = 128
-
-    PRECISION = 4
-
-    @staticmethod
-    def raise_on_eof(file):
-        """ pseudo end of file detection """
-        fd = file.fileno()
-        stat = fstat(fd)
-        if file.tell() >= stat.st_size:
-            raise EOF()
-
-    @staticmethod
-    def read_byte(file):
-        """ read a single byte from file """
-        value = unpack('<B', file.read(Ms3dIo.SIZE_BYTE))[0]
-        return value
-
-    @staticmethod
-    def write_byte(file, value):
-        """ write a single byte to file """
-        file.write(pack('<B', value))
-
-    @staticmethod
-    def read_sbyte(file):
-        """ read a single signed byte from file """
-        value = unpack('<b', file.read(Ms3dIo.SIZE_SBYTE))[0]
-        return value
-
-    @staticmethod
-    def write_sbyte(file, value):
-        """ write a single signed byte to file """
-        file.write(pack('<b', value))
-
-    @staticmethod
-    def read_word(file):
-        """ read a word from file """
-        value = unpack('<H', file.read(Ms3dIo.SIZE_WORD))[0]
-        return value
-
-    @staticmethod
-    def write_word(file, value):
-        """ write a word to file """
-        file.write(pack('<H', value))
-
-    @staticmethod
-    def read_dword(file):
-        """ read a double word from file """
-        value = unpack('<I', file.read(Ms3dIo.SIZE_DWORD))[0]
-        return value
-
-    @staticmethod
-    def write_dword(file, value):
-        """ write a double word to file """
-        file.write(pack('<I', value))
-
-    @staticmethod
-    def read_float(file):
-        """ read a float from file """
-        value = unpack('<f', file.read(Ms3dIo.SIZE_FLOAT))[0]
-        return value
-
-    @staticmethod
-    def write_float(file, value):
-        """ write a float to file """
-        file.write(pack('<f', value))
-
-    @staticmethod
-    def read_array(file, itemReader, count):
-        """ read an array[count] of objects from file, by using a itemReader """
-        value = []
-        for i in range(count):
-            itemValue = itemReader(file)
-            value.append(itemValue)
-        return tuple(value)
-
-    @staticmethod
-    def write_array(file, itemWriter, count, value):
-        """ write an array[count] of objects to file, by using a itemWriter """
-        for i in range(count):
-            itemValue = value[i]
-            itemWriter(file, itemValue)
-
-    @staticmethod
-    def read_array2(file, itemReader, count, count2):
-        """ read an array[count][count2] of objects from file,
-            by using a itemReader """
-        value = []
-        for i in range(count):
-            itemValue = Ms3dIo.read_array(file, itemReader, count2)
-            value.append(tuple(itemValue))
-        return value
-
-    @staticmethod
-    def write_array2(file, itemWriter, count, count2, value):
-        """ write an array[count][count2] of objects to file,
-            by using a itemWriter """
-        for i in range(count):
-            itemValue = value[i]
-            Ms3dIo.write_array(file, itemWriter, count2, itemValue)
-
-    @staticmethod
-    def read_string(file, length):
-        """ read a string of a specific length from file """
-        value = []
-        skip = False
-        for i in range(length):
-            raw = unpack('<b', file.read(Ms3dIo.SIZE_SBYTE))[0]
-            if (raw >= 32) & (raw <= 255):
-                pass
-            else:
-                if (raw == 0):
-                    raw = 0
-                    skip = True
-                else:
-                    raw = 32
-
-            c = chr(raw)
-
-            if (not skip):
-                value.append(c)
-
-        finalValue = "".join(value)
-        return finalValue
-
-    @staticmethod
-    def write_string(file, length, value):
-        """ write a string of a specific length to file """
-        l = len(value)
-        for i in range(length):
-            if(i < l):
-                c = value[i]
-
-                if (isinstance(c, str)):
-                    c = c[0]
-                    raw = ord(c)
-                elif (isinstance(c, int)):
-                    raw = c
-                else:
-                    pass
-            else:
-                raw = 0
-
-            file.write(pack('<b', raw % 256))
-
-
-###############################################################################
-#
-# multi complex types
-#
-
-###############################################################################
-class Ms3dHeader:
-    """ Ms3dHeader """
-    __slots__ = (
-            'id',
-            'version',
-            )
-
-    def __init__(
-            self,
-            default_id=Ms3dSpec.DEFAULT_HEADER,
-            default_version=Ms3dSpec.DEFAULT_HEADER_VERSION
-            ):
-        self.id = default_id
-        self.version = default_version
-
-    def __repr__(self):
-        return "\n<id='{}', version={}>".format(
-            self.id,
-            self.version
-            )
-
-    def __hash__(self):
-        return hash(self.id) ^ hash(self.version)
-
-    def __eq__(self, other):
-        return ((self is not None) and (other is not None)
-                and (self.id == other.id)
-                and (self.version == other.version))
-
-    def read(self, file):
-        self.id = Ms3dIo.read_string(file, Ms3dIo.LENGTH_ID)
-        self.version = Ms3dIo.read_dword(file)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_string(file, Ms3dIo.LENGTH_ID, self.id)
-        Ms3dIo.write_dword(file, self.version)
-
-
-###############################################################################
-class Ms3dVertex:
-    """ Ms3dVertex """
-    """
-    __slots__ was taking out,
-    to be able to inject additional attributes during runtime
-    __slots__ = (
-            'flags',
-            'bone_id',
-            'reference_count',
-            '_vertex',
-            '_vertex_ex_object', # Ms3dVertexEx
-            )
-    """
-
-    def __init__(
-            self,
-            default_flags=Ms3dSpec.DEFAULT_FLAGS,
-            default_vertex=(0.0, 0.0, 0.0),
-            default_bone_id=Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
-            default_reference_count=0,
-            default_vertex_ex_object=None, # Ms3dVertexEx
-            ):
-        self.flags = default_flags
-        self._vertex = default_vertex
-        self.bone_id = default_bone_id
-        self.reference_count = default_reference_count
-
-        if default_vertex_ex_object is None:
-            default_vertex_ex_object = Ms3dVertexEx2()
-            # Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_VERTEX_EXTRA = 2
-        self._vertex_ex_object = default_vertex_ex_object
-        # Ms3dVertexEx
-
-    def __repr__(self):
-        return "\n<flags={}, vertex=({:.{p}f}, {:.{p}f}, {:.{p}f}), bone_id={},"\
-                " reference_count={}>".format(
-                self.flags,
-                self._vertex[0],
-                self._vertex[1],
-                self._vertex[2],
-                self.bone_id,
-                self.reference_count,
-                p=Ms3dIo.PRECISION
-                )
-
-    def __hash__(self):
-        return (hash(self.vertex)
-                #^ hash(self.flags)
-                #^ hash(self.bone_id)
-                #^ hash(self.reference_count)
-                )
-
-    def __eq__(self, other):
-        return ((self.vertex == other.vertex)
-                #and (self.flags == other.flags)
-                #and (self.bone_id == other.bone_id)
-                #and (self.reference_count == other.reference_count)
-                )
-
-
-    @property
-    def vertex(self):
-        return self._vertex
-
-    @property
-    def vertex_ex_object(self):
-        return self._vertex_ex_object
-
-
-    def read(self, file):
-        self.flags = Ms3dIo.read_byte(file)
-        self._vertex = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        self.bone_id = Ms3dIo.read_sbyte(file)
-        self.reference_count = Ms3dIo.read_byte(file)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_byte(file, self.flags)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.vertex)
-        Ms3dIo.write_sbyte(file, self.bone_id)
-        Ms3dIo.write_byte(file, self.reference_count)
-
-
-###############################################################################
-class Ms3dTriangle:
-    """ Ms3dTriangle """
-    """
-    __slots__ was taking out,
-    to be able to inject additional attributes during runtime
-    __slots__ = (
-            'flags',
-            'smoothing_group',
-            'group_index',
-            '_vertex_indices',
-            '_vertex_normals',
-            '_s',
-            '_t',
-            )
-    """
-
-    def __init__(
-            self,
-            default_flags=Ms3dSpec.DEFAULT_FLAGS,
-            default_vertex_indices=(0, 0, 0),
-            default_vertex_normals=(
-                    (0.0, 0.0, 0.0),
-                    (0.0, 0.0, 0.0),
-                    (0.0, 0.0, 0.0)),
-            default_s=(0.0, 0.0, 0.0),
-            default_t=(0.0, 0.0, 0.0),
-            default_smoothing_group=Ms3dSpec.DEFAULT_TRIANGLE_SMOOTHING_GROUP,
-            default_group_index=Ms3dSpec.DEFAULT_TRIANGLE_GROUP
-            ):
-        self.flags = default_flags
-        self._vertex_indices = default_vertex_indices
-        self._vertex_normals = default_vertex_normals
-        self._s = default_s
-        self._t = default_t
-        self.smoothing_group = default_smoothing_group
-        self.group_index = default_group_index
-
-    def __repr__(self):
-        return "\n<flags={}, vertex_indices={}, vertex_normals=(({:.{p}f}, "\
-                "{:.{p}f}, {:.{p}f}), ({:.{p}f}, {:.{p}f}, {:.{p}f}), ({:.{p}f}, "\
-                "{:.{p}f}, {:.{p}f})), s=({:.{p}f}, {:.{p}f}, {:.{p}f}), "\
-                "t=({:.{p}f}, {:.{p}f}, {:.{p}f}), smoothing_group={}, "\
-                "group_index={}>".format(
-                self.flags,
-                self.vertex_indices,
-                self.vertex_normals[0][0],
-                self.vertex_normals[0][1],
-                self.vertex_normals[0][2],
-                self.vertex_normals[1][0],
-                self.vertex_normals[1][1],
-                self.vertex_normals[1][2],
-                self.vertex_normals[2][0],
-                self.vertex_normals[2][1],
-                self.vertex_normals[2][2],
-                self.s[0],
-                self.s[1],
-                self.s[2],
-                self.t[0],
-                self.t[1],
-                self.t[2],
-                self.smoothing_group,
-                self.group_index,
-                p=Ms3dIo.PRECISION
-                )
-
-
-    @property
-    def vertex_indices(self):
-        return self._vertex_indices
-
-    @property
-    def vertex_normals(self):
-        return self._vertex_normals
-
-    @property
-    def s(self):
-        return self._s
-
-    @property
-    def t(self):
-        return self._t
-
-
-    def read(self, file):
-        self.flags = Ms3dIo.read_word(file)
-        self._vertex_indices = Ms3dIo.read_array(file, Ms3dIo.read_word, 3)
-        self._vertex_normals = Ms3dIo.read_array2(file, Ms3dIo.read_float, 3, 3)
-        self._s = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        self._t = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        self.smoothing_group = Ms3dIo.read_byte(file)
-        self.group_index = Ms3dIo.read_byte(file)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_word(file, self.flags)
-        Ms3dIo.write_array(file, Ms3dIo.write_word, 3, self.vertex_indices)
-        Ms3dIo.write_array2(file, Ms3dIo.write_float, 3, 3, self.vertex_normals)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.s)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.t)
-        Ms3dIo.write_byte(file, self.smoothing_group)
-        Ms3dIo.write_byte(file, self.group_index)
-
-
-###############################################################################
-class Ms3dGroup:
-    """ Ms3dGroup """
-    """
-    __slots__ was taking out,
-    to be able to inject additional attributes during runtime
-    __slots__ = (
-            'flags',
-            'name',
-            'material_index',
-            '_triangle_indices',
-            '_comment_object', # Ms3dComment
-            )
-    """
-
-    def __init__(
-            self,
-            default_flags=Ms3dSpec.DEFAULT_FLAGS,
-            default_name="",
-            default_triangle_indices=None,
-            default_material_index=Ms3dSpec.DEFAULT_GROUP_MATERIAL_INDEX,
-            default_comment_object=None, # Ms3dComment
-            ):
-        if (default_name is None):
-            default_name = ""
-
-        if (default_triangle_indices is None):
-            default_triangle_indices = []
-
-        self.flags = default_flags
-        self.name = default_name
-        self._triangle_indices = default_triangle_indices
-        self.material_index = default_material_index
-
-        if default_comment_object is None:
-            default_comment_object = Ms3dCommentEx()
-        self._comment_object = default_comment_object # Ms3dComment
-
-    def __repr__(self):
-        return "\n<flags={}, name='{}', number_triangles={},"\
-                " triangle_indices={}, material_index={}>".format(
-                self.flags,
-                self.name,
-                self.number_triangles,
-                self.triangle_indices,
-                self.material_index
-                )
-
-
-    @property
-    def number_triangles(self):
-        if self.triangle_indices is None:
-            return 0
-        return len(self.triangle_indices)
-
-    @property
-    def triangle_indices(self):
-        return self._triangle_indices
-
-    @property
-    def comment_object(self):
-        return self._comment_object
-
-
-    def read(self, file):
-        self.flags = Ms3dIo.read_byte(file)
-        self.name = Ms3dIo.read_string(file, Ms3dIo.LENGTH_NAME)
-        _number_triangles = Ms3dIo.read_word(file)
-        self._triangle_indices = Ms3dIo.read_array(
-                file, Ms3dIo.read_word, _number_triangles)
-        self.material_index = Ms3dIo.read_sbyte(file)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_byte(file, self.flags)
-        Ms3dIo.write_string(file, Ms3dIo.LENGTH_NAME, self.name)
-        Ms3dIo.write_word(file, self.number_triangles)
-        Ms3dIo.write_array(
-                file, Ms3dIo.write_word, self.number_triangles,
-                self.triangle_indices)
-        Ms3dIo.write_sbyte(file, self.material_index)
-
-
-###############################################################################
-class Ms3dMaterial:
-    """ Ms3dMaterial """
-    """
-    __slots__ was taking out,
-    to be able to inject additional attributes during runtime
-    __slots__ = (
-            'name',
-            'shininess',
-            'transparency',
-            'mode',
-            'texture',
-            'alphamap',
-            '_ambient',
-            '_diffuse',
-            '_specular',
-            '_emissive',
-            '_comment_object', # Ms3dComment
-            )
-    """
-
-    def __init__(
-            self,
-            default_name="",
-            default_ambient=list(Ms3dSpec.DEFAULT_MATERIAL_AMBIENT),
-            default_diffuse=list(Ms3dSpec.DEFAULT_MATERIAL_DIFFUSE),
-            default_specular=list(Ms3dSpec.DEFAULT_MATERIAL_SPECULAR),
-            default_emissive=list(Ms3dSpec.DEFAULT_MATERIAL_EMISSIVE),
-            default_shininess=Ms3dSpec.DEFAULT_MATERIAL_SHININESS,
-            default_transparency=0.0,
-            default_mode=Ms3dSpec.DEFAULT_MATERIAL_MODE,
-            default_texture="",
-            default_alphamap="",
-            default_comment_object=None, # Ms3dComment
-            ):
-        if (default_name is None):
-            default_name = ""
-
-        if (default_texture is None):
-            default_texture = ""
-
-        if (default_alphamap is None):
-            default_alphamap = ""
-
-        self.name = default_name
-        self._ambient = default_ambient
-        self._diffuse = default_diffuse
-        self._specular = default_specular
-        self._emissive = default_emissive
-        self.shininess = default_shininess
-        self.transparency = default_transparency
-        self.mode = default_mode
-        self.texture = default_texture
-        self.alphamap = default_alphamap
-
-        if default_comment_object is None:
-            default_comment_object = Ms3dCommentEx()
-        self._comment_object = default_comment_object # Ms3dComment
-
-    def __repr__(self):
-        return "\n<name='{}', ambient=({:.{p}f}, {:.{p}f}, {:.{p}f}, {:.{p}f}), "\
-                "diffuse=({:.{p}f}, {:.{p}f}, {:.{p}f}, {:.{p}f}), specular=("\
-                "{:.{p}f}, {:.{p}f}, {:.{p}f}, {:.{p}f}), emissive=({:.{p}f}, "\
-                "{:.{p}f}, {:.{p}f}, {:.{p}f}), shininess={:.{p}f}, transparency="\
-                "{:.{p}f}, mode={}, texture='{}', alphamap='{}'>".format(
-                self.name,
-                self.ambient[0],
-                self.ambient[1],
-                self.ambient[2],
-                self.ambient[3],
-                self.diffuse[0],
-                self.diffuse[1],
-                self.diffuse[2],
-                self.diffuse[3],
-                self.specular[0],
-                self.specular[1],
-                self.specular[2],
-                self.specular[3],
-                self.emissive[0],
-                self.emissive[1],
-                self.emissive[2],
-                self.emissive[3],
-                self.shininess,
-                self.transparency,
-                self.mode,
-                self.texture,
-                self.alphamap,
-                p=Ms3dIo.PRECISION
-                )
-
-    def __hash__(self):
-        return (hash(self.name)
-
-                ^ hash(self.ambient)
-                ^ hash(self.diffuse)
-                ^ hash(self.specular)
-                ^ hash(self.emissive)
-
-                ^ hash(self.shininess)
-                ^ hash(self.transparency)
-                ^ hash(self.mode)
-
-                ^ hash(self.texture)
-                ^ hash(self.alphamap)
-                )
-
-    def __eq__(self, other):
-        return ((self.name == other.name)
-
-                and (self.ambient == other.ambient)
-                and (self.diffuse == other.diffuse)
-                and (self.specular == other.specular)
-                and (self.emissive == other.emissive)
-
-                and (self.shininess == other.shininess)
-                and (self.transparency == other.transparency)
-                and (self.mode == other.mode)
-
-                #and (self.texture == other.texture)
-                #and (self.alphamap == other.alphamap)
-                )
-
-
-    @property
-    def ambient(self):
-        return self._ambient
-
-    @property
-    def diffuse(self):
-        return self._diffuse
-
-    @property
-    def specular(self):
-        return self._specular
-
-    @property
-    def emissive(self):
-        return self._emissive
-
-    @property
-    def comment_object(self):
-        return self._comment_object
-
-
-    def read(self, file):
-        self.name = Ms3dIo.read_string(file, Ms3dIo.LENGTH_NAME)
-        self._ambient = Ms3dIo.read_array(file, Ms3dIo.read_float, 4)
-        self._diffuse = Ms3dIo.read_array(file, Ms3dIo.read_float, 4)
-        self._specular = Ms3dIo.read_array(file, Ms3dIo.read_float, 4)
-        self._emissive = Ms3dIo.read_array(file, Ms3dIo.read_float, 4)
-        self.shininess = Ms3dIo.read_float(file)
-        self.transparency = Ms3dIo.read_float(file)
-        self.mode = Ms3dIo.read_sbyte(file)
-        self.texture = Ms3dIo.read_string(file, Ms3dIo.LENGTH_FILENAME)
-        self.alphamap = Ms3dIo.read_string(file, Ms3dIo.LENGTH_FILENAME)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_string(file, Ms3dIo.LENGTH_NAME, self.name)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 4, self.ambient)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 4, self.diffuse)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 4, self.specular)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 4, self.emissive)
-        Ms3dIo.write_float(file, self.shininess)
-        Ms3dIo.write_float(file, self.transparency)
-        Ms3dIo.write_sbyte(file, self.mode)
-        Ms3dIo.write_string(file, Ms3dIo.LENGTH_FILENAME, self.texture)
-        Ms3dIo.write_string(file, Ms3dIo.LENGTH_FILENAME, self.alphamap)
-
-
-###############################################################################
-class Ms3dRotationKeyframe:
-    """ Ms3dRotationKeyframe """
-    __slots__ = (
-            'time',
-            '_rotation',
-            )
-
-    def __init__(
-            self,
-            default_time=0.0,
-            default_rotation=(0.0, 0.0, 0.0)
-            ):
-        self.time = default_time
-        self._rotation = default_rotation
-
-    def __repr__(self):
-        return "\n<time={:.{p}f}, rotation=({:.{p}f}, {:.{p}f}, {:.{p}f})>".format(
-                self.time,
-                self.rotation[0],
-                self.rotation[1],
-                self.rotation[2],
-                p=Ms3dIo.PRECISION
-                )
-
-
-    @property
-    def rotation(self):
-        return self._rotation
-
-
-    def read(self, file):
-        self.time = Ms3dIo.read_float(file)
-        self._rotation = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_float(file, self.time)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.rotation)
-
-
-###############################################################################
-class Ms3dTranslationKeyframe:
-    """ Ms3dTranslationKeyframe """
-    __slots__ = (
-            'time',
-            '_position',
-            )
-
-    def __init__(
-            self,
-            default_time=0.0,
-            default_position=(0.0, 0.0, 0.0)
-            ):
-        self.time = default_time
-        self._position = default_position
-
-    def __repr__(self):
-        return "\n<time={:.{p}f}, position=({:.{p}f}, {:.{p}f}, {:.{p}f})>".format(
-                self.time,
-                self.position[0],
-                self.position[1],
-                self.position[2],
-                p=Ms3dIo.PRECISION
-                )
-
-
-    @property
-    def position(self):
-        return self._position
-
-
-    def read(self, file):
-        self.time = Ms3dIo.read_float(file)
-        self._position = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_float(file, self.time)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.position)
-
-
-###############################################################################
-class Ms3dJoint:
-    """ Ms3dJoint """
-    """
-    __slots__ was taking out,
-    to be able to inject additional attributes during runtime
-    __slots__ = (
-            'flags',
-            'name',
-            'parent_name',
-            '_rotation',
-            '_position',
-            '_rotation_keyframes',
-            '_translation_keyframes',
-            '_joint_ex_object', # Ms3dJointEx
-            '_comment_object', # Ms3dComment
-            )
-    """
-
-    def __init__(
-            self,
-            default_flags=Ms3dSpec.DEFAULT_FLAGS,
-            default_name="",
-            default_parent_name="",
-            default_rotation=(0.0, 0.0, 0.0),
-            default_position=(0.0, 0.0, 0.0),
-            default_rotation_keyframes=None,
-            default_translation_keyframes=None,
-            default_joint_ex_object=None, # Ms3dJointEx
-            default_comment_object=None, # Ms3dComment
-            ):
-        if (default_name is None):
-            default_name = ""
-
-        if (default_parent_name is None):
-            default_parent_name = ""
-
-        if (default_rotation_keyframes is None):
-            default_rotation_keyframes = [] #Ms3dRotationKeyframe()
-
-        if (default_translation_keyframes is None):
-            default_translation_keyframes = [] #Ms3dTranslationKeyframe()
-
-        self.flags = default_flags
-        self.name = default_name
-        self.parent_name = default_parent_name
-        self._rotation = default_rotation
-        self._position = default_position
-        self._rotation_keyframes = default_rotation_keyframes
-        self._translation_keyframes = default_translation_keyframes
-
-        if default_comment_object is None:
-            default_comment_object = Ms3dCommentEx()
-        self._comment_object = default_comment_object # Ms3dComment
-
-        if default_joint_ex_object is None:
-            default_joint_ex_object = Ms3dJointEx()
-        self._joint_ex_object = default_joint_ex_object # Ms3dJointEx
-
-    def __repr__(self):
-        return "\n<flags={}, name='{}', parent_name='{}', rotation=({:.{p}f}, "\
-                "{:.{p}f}, {:.{p}f}), position=({:.{p}f}, {:.{p}f}, {:.{p}f}), "\
-                "number_rotation_keyframes={}, number_translation_keyframes={},"\
-                " rotation_key_frames={}, translation_key_frames={}>".format(
-                self.flags,
-                self.name,
-                self.parent_name,
-                self.rotation[0],
-                self.rotation[1],
-                self.rotation[2],
-                self.position[0],
-                self.position[1],
-                self.position[2],
-                self.number_rotation_keyframes,
-                self.number_translation_keyframes,
-                self.rotation_key_frames,
-                self.translation_key_frames,
-                p=Ms3dIo.PRECISION
-                )
-
-
-    @property
-    def rotation(self):
-        return self._rotation
-
-    @property
-    def position(self):
-        return self._position
-
-    @property
-    def number_rotation_keyframes(self):
-        if self.rotation_key_frames is None:
-            return 0
-        return len(self.rotation_key_frames)
-
-    @property
-    def number_translation_keyframes(self):
-        if self.translation_key_frames is None:
-            return 0
-        return len(self.translation_key_frames)
-
-    @property
-    def rotation_key_frames(self):
-        return self._rotation_keyframes
-
-    @property
-    def translation_key_frames(self):
-        return self._translation_keyframes
-
-
-    @property
-    def joint_ex_object(self):
-        return self._joint_ex_object
-
-
-    @property
-    def comment_object(self):
-        return self._comment_object
-
-
-    def read(self, file):
-        self.flags = Ms3dIo.read_byte(file)
-        self.name = Ms3dIo.read_string(file, Ms3dIo.LENGTH_NAME)
-        self.parent_name = Ms3dIo.read_string(file, Ms3dIo.LENGTH_NAME)
-        self._rotation = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        self._position = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        _number_rotation_keyframes = Ms3dIo.read_word(file)
-        _number_translation_keyframes = Ms3dIo.read_word(file)
-        self._rotation_keyframes = []
-        for i in range(_number_rotation_keyframes):
-            self.rotation_key_frames.append(Ms3dRotationKeyframe().read(file))
-        self._translation_keyframes = []
-        for i in range(_number_translation_keyframes):
-            self.translation_key_frames.append(
-                    Ms3dTranslationKeyframe().read(file))
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_byte(file, self.flags)
-        Ms3dIo.write_string(file, Ms3dIo.LENGTH_NAME, self.name)
-        Ms3dIo.write_string(file, Ms3dIo.LENGTH_NAME, self.parent_name)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.rotation)
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.position)
-        Ms3dIo.write_word(file, self.number_rotation_keyframes)
-        Ms3dIo.write_word(file, self.number_translation_keyframes)
-        for i in range(self.number_rotation_keyframes):
-            self.rotation_key_frames[i].write(file)
-        for i in range(self.number_translation_keyframes):
-            self.translation_key_frames[i].write(file)
-
-
-###############################################################################
-class Ms3dCommentEx:
-    """ Ms3dCommentEx """
-    __slots__ = (
-            'index',
-            'comment',
-            )
-
-    def __init__(
-            self,
-            default_index=0,
-            default_comment=""
-            ):
-        if (default_comment is None):
-            default_comment = ""
-
-        self.index = default_index
-        self.comment = default_comment
-
-    def __repr__(self):
-        return "\n<index={}, comment_length={}, comment='{}'>".format(
-                self.index,
-                self.comment_length,
-                self.comment
-                )
-
-
-    @property
-    def comment_length(self):
-        if self.comment is None:
-            return 0
-        return len(self.comment)
-
-
-    def read(self, file):
-        self.index = Ms3dIo.read_dword(file)
-        _comment_length = Ms3dIo.read_dword(file)
-        self.comment = Ms3dIo.read_string(file, _comment_length)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_dword(file, self.index)
-        Ms3dIo.write_dword(file, self.comment_length)
-        Ms3dIo.write_string(file, self.comment_length, self.comment)
-
-
-###############################################################################
-class Ms3dComment:
-    """ Ms3dComment """
-    __slots__ = (
-            'comment',
-            )
-
-    def __init__(
-            self,
-            default_comment=""
-            ):
-        if (default_comment is None):
-            default_comment = ""
-
-        self.comment = default_comment
-
-    def __repr__(self):
-        return "\n<comment_length={}, comment='{}'>".format(
-                self.comment_length,
-                self.comment
-                )
-
-
-    @property
-    def comment_length(self):
-        if self.comment is None:
-            return 0
-        return len(self.comment)
-
-
-    def read(self, file):
-        _comment_length = Ms3dIo.read_dword(file)
-        self.comment = Ms3dIo.read_string(file, _comment_length)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_dword(file, self.comment_length)
-        Ms3dIo.write_string(file, self.comment_length, self.comment)
-
-
-###############################################################################
-class Ms3dVertexEx1:
-    """ Ms3dVertexEx1 """
-    __slots__ = (
-            '_bone_ids',
-            '_weights',
-            )
-
-    def __init__(
-            self,
-            default_bone_ids=(
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID),
-            default_weights=(100, 0, 0)
-            ):
-        self._bone_ids = default_bone_ids
-        self._weights = default_weights
-
-    def __repr__(self):
-        return "\n<bone_ids={}, weights={}>".format(
-                self.bone_ids,
-                self.weights
-                )
-
-
-    @property
-    def bone_ids(self):
-        return self._bone_ids
-
-    @property
-    def weights(self):
-        return self._weights
-
-
-    @property
-    def weight_bone_id(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights
-        return 100
-
-    @property
-    def weight_bone_id0(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights[0]
-        return 0
-
-    @property
-    def weight_bone_id1(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights[1]
-        return 0
-
-    @property
-    def weight_bone_id2(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return 100 - (self._weights[0] + self._weights[1] \
-                    + self._weights[2])
-        return 0
-
-
-    def read(self, file):
-        self._bone_ids = Ms3dIo.read_array(file, Ms3dIo.read_sbyte, 3)
-        self._weights = Ms3dIo.read_array(file, Ms3dIo.read_byte, 3)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_array(file, Ms3dIo.write_sbyte, 3, self.bone_ids)
-        Ms3dIo.write_array(file, Ms3dIo.write_byte, 3, self.weights)
-
-
-###############################################################################
-class Ms3dVertexEx2:
-    """ Ms3dVertexEx2 """
-    __slots__ = (
-            'extra',
-            '_bone_ids',
-            '_weights',
-            )
-
-    def __init__(
-            self,
-            default_bone_ids=(
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID),
-            default_weights=(100, 0, 0),
-            default_extra=0
-            ):
-        self._bone_ids = default_bone_ids
-        self._weights = default_weights
-        self.extra = default_extra
-
-    def __repr__(self):
-        return "\n<bone_ids={}, weights={}, extra={}>".format(
-                self.bone_ids,
-                self.weights,
-                self.extra
-                )
-
-
-    @property
-    def bone_ids(self):
-        return self._bone_ids
-
-    @property
-    def weights(self):
-        return self._weights
-
-
-    @property
-    def weight_bone_id(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights
-        return 100
-
-    @property
-    def weight_bone_id0(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights[0]
-        return 0
-
-    @property
-    def weight_bone_id1(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights[1]
-        return 0
-
-    @property
-    def weight_bone_id2(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return 100 - (self._weights[0] + self._weights[1] \
-                    + self._weights[2])
-        return 0
-
-
-    def read(self, file):
-        self._bone_ids = Ms3dIo.read_array(file, Ms3dIo.read_sbyte, 3)
-        self._weights = Ms3dIo.read_array(file, Ms3dIo.read_byte, 3)
-        self.extra = Ms3dIo.read_dword(file)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_array(file, Ms3dIo.write_sbyte, 3, self.bone_ids)
-        Ms3dIo.write_array(file, Ms3dIo.write_byte, 3, self.weights)
-        Ms3dIo.write_dword(file, self.extra)
-
-
-###############################################################################
-class Ms3dVertexEx3:
-    """ Ms3dVertexEx3 """
-    #char bone_ids[3]; // index of joint or -1, if -1, then that weight is
-    #    ignored, since subVersion 1
-    #byte weights[3]; // vertex weight ranging from 0 - 100, last weight is
-    #    computed by 1.0 - sum(all weights), since subVersion 1
-    #// weight[0] is the weight for bone_id in Ms3dVertex
-    #// weight[1] is the weight for bone_ids[0]
-    #// weight[2] is the weight for bone_ids[1]
-    #// 1.0f - weight[0] - weight[1] - weight[2] is the weight for bone_ids[2]
-    #unsigned int extra; // vertex extra, which can be used as color or
-    #    anything else, since subVersion 2
-    __slots__ = (
-            'extra',
-            '_bone_ids',
-            '_weights',
-            )
-
-    def __init__(
-            self,
-            default_bone_ids=(
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID,
-                    Ms3dSpec.DEFAULT_VERTEX_BONE_ID),
-            default_weights=(100, 0, 0),
-            default_extra=0
-            ):
-        self._bone_ids = default_bone_ids
-        self._weights = default_weights
-        self.extra = default_extra
-
-    def __repr__(self):
-        return "\n<bone_ids={}, weights={}, extra={}>".format(
-                self.bone_ids,
-                self.weights,
-                self.extra
-                )
-
-
-    @property
-    def bone_ids(self):
-        return self._bone_ids
-
-    @property
-    def weights(self):
-        return self._weights
-
-
-    @property
-    def weight_bone_id(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights
-        return 100
-
-    @property
-    def weight_bone_id0(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights[0]
-        return 0
-
-    @property
-    def weight_bone_id1(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return self._weights[1]
-        return 0
-
-    @property
-    def weight_bone_id2(self):
-        if self._weights[0] or self._weights[1] or self._weights[2]:
-            return 100 - (self._weights[0] + self._weights[1] \
-                    + self._weights[2])
-        return 0
-
-
-    def read(self, file):
-        self._bone_ids = Ms3dIo.read_array(file, Ms3dIo.read_sbyte, 3)
-        self._weights = Ms3dIo.read_array(file, Ms3dIo.read_byte, 3)
-        self.extra = Ms3dIo.read_dword(file)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_array(file, Ms3dIo.write_sbyte, 3, self.bone_ids)
-        Ms3dIo.write_array(file, Ms3dIo.write_byte, 3, self.weights)
-        Ms3dIo.write_dword(file, self.extra)
-
-
-###############################################################################
-class Ms3dJointEx:
-    """ Ms3dJointEx """
-    __slots__ = (
-            '_color',
-            )
-
-    def __init__(
-            self,
-            default_color=Ms3dSpec.DEFAULT_JOINT_COLOR
-            ):
-        self._color = default_color
-
-    def __repr__(self):
-        return "\n<color=({:.{p}f}, {:.{p}f}, {:.{p}f})>".format(
-                self.color[0],
-                self.color[1],
-                self.color[2],
-                p=Ms3dIo.PRECISION
-                )
-
-
-    @property
-    def color(self):
-        return self._color
-
-
-    def read(self, file):
-        self._color = Ms3dIo.read_array(file, Ms3dIo.read_float, 3)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_array(file, Ms3dIo.write_float, 3, self.color)
-
-
-###############################################################################
-class Ms3dModelEx:
-    """ Ms3dModelEx """
-    __slots__ = (
-            'joint_size',
-            'transparency_mode',
-            'alpha_ref',
-            )
-
-    def __init__(
-            self,
-            default_joint_size=Ms3dSpec.DEFAULT_MODEL_JOINT_SIZE,
-            default_transparency_mode\
-                    =Ms3dSpec.DEFAULT_MODEL_TRANSPARENCY_MODE,
-            default_alpha_ref=0.0
-            ):
-        self.joint_size = default_joint_size
-        self.transparency_mode = default_transparency_mode
-        self.alpha_ref = default_alpha_ref
-
-    def __repr__(self):
-        return "\n<joint_size={:.{p}f}, transparency_mode={}, alpha_ref={:.{p}f}>".format(
-                self.joint_size,
-                self.transparency_mode,
-                self.alpha_ref,
-                p=Ms3dIo.PRECISION
-                )
-
-    def read(self, file):
-        self.joint_size = Ms3dIo.read_float(file)
-        self.transparency_mode = Ms3dIo.read_dword(file)
-        self.alpha_ref = Ms3dIo.read_float(file)
-        return self
-
-    def write(self, file):
-        Ms3dIo.write_float(file, self.joint_size)
-        Ms3dIo.write_dword(file, self.transparency_mode)
-        Ms3dIo.write_float(file, self.alpha_ref)
-
-
-###############################################################################
-#
-# file format
-#
-###############################################################################
-class Ms3dModel:
-    """ Ms3dModel """
-    __slot__ = (
-            'header',
-            'animation_fps',
-            'current_time',
-            'number_total_frames',
-            'sub_version_comments',
-            'sub_version_vertex_extra',
-            'sub_version_joint_extra',
-            'sub_version_model_extra',
-            'name',
-            '_vertices',
-            '_triangles',
-            '_groups',
-            '_materials',
-            '_joints',
-            '_has_model_comment',
-            '_comment_object', # Ms3dComment
-            '_model_ex_object', # Ms3dModelEx
-            )
-
-    def __init__(
-            self,
-            default_name=""
-            ):
-        if (default_name is None):
-            default_name = ""
-
-        self.name = default_name
-
-        self.animation_fps = Ms3dSpec.DEFAULT_MODEL_ANIMATION_FPS
-        self.current_time = 0.0
-        self.number_total_frames = 0
-        self.sub_version_comments \
-                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_COMMENTS
-        self.sub_version_vertex_extra \
-                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_VERTEX_EXTRA
-        self.sub_version_joint_extra \
-                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_JOINT_EXTRA
-        self.sub_version_model_extra \
-                = Ms3dSpec.DEFAULT_MODEL_SUB_VERSION_MODEL_EXTRA
-
-        self._vertices = [] #Ms3dVertex()
-        self._triangles = [] #Ms3dTriangle()
-        self._groups = [] #Ms3dGroup()
-        self._materials = [] #Ms3dMaterial()
-        self._joints = [] #Ms3dJoint()
-
-        self.header = Ms3dHeader()
-        self._model_ex_object = Ms3dModelEx()
-        self._comment_object = None #Ms3dComment()
-
-
-    @property
-    def number_vertices(self):
-        if self.vertices is None:
-            return 0
-        return len(self.vertices)
-
-    @property
-    def vertices(self):
-        return self._vertices
-
-
-    @property
-    def number_triangles(self):
-        if self.triangles is None:
-            return 0
-        return len(self.triangles)
-
-    @property
-    def triangles(self):
-        return self._triangles
-
-
-    @property
-    def number_groups(self):
-        if self.groups is None:
-            return 0
-        return len(self.groups)
-
-    @property
-    def groups(self):
-        return self._groups
-
-
-    @property
-    def number_materials(self):
-        if self.materials is None:
-            return 0
-        return len(self.materials)
-
-    @property
-    def materials(self):
-        return self._materials
-
-
-    @property
-    def number_joints(self):
-        if self.joints is None:
-            return 0
-        return len(self.joints)
-
-    @property
-    def joints(self):
-        return self._joints
-
-
-    @property
-    def number_group_comments(self):
-        if self.groups is None:
-            return 0
-        number = 0
-        for item in self.groups:
-            if item.comment_object is not None and item.comment_object.comment:
-                number += 1
-        return number
-
-    @property
-    def group_comments(self):
-        if self.groups is None:
-            return None
-        items = []
-        for item in self.groups:
-            if item.comment_object is not None and item.comment_object.comment:
-                items.append(item)
-        return items
-
-
-    @property
-    def number_material_comments(self):
-        if self.materials is None:
-            return 0
-        number = 0
-        for item in self.materials:
-            if item.comment_object is not None and item.comment_object.comment:
-                number += 1
-        return number
-
-    @property
-    def material_comments(self):
-        if self.materials is None:
-            return None
-        items = []
-        for item in self.materials:
-            if item.comment_object is not None and item.comment_object.comment:
-                items.append(item)
-        return items
-
-
-    @property
-    def number_joint_comments(self):
-        if self.joints is None:
-            return 0
-        number = 0
-        for item in self.joints:
-            if item.comment_object is not None and item.comment_object.comment:
-                number += 1
-        return number
-
-    @property
-    def joint_comments(self):
-        if self.joints is None:
-            return None
-        items = []
-        for item in self.joints:
-            if item.comment_object is not None and item.comment_object.comment:
-                items.append(item)
-        return items
-
-
-    @property
-    def has_model_comment(self):
-        if self.comment_object is not None and self.comment_object.comment:
-            return 1
-        return 0
-
-    @property
-    def comment_object(self):
-        return self._comment_object
-
-
-    @property
-    def vertex_ex(self):
-        if not self.sub_version_vertex_extra:
-            return None
-        return [item.vertex_ex_object for item in self.vertices]
-
-    @property
-    def joint_ex(self):
-        if not self.sub_version_joint_extra:
-            return None
-        return [item.joint_ex_object for item in self.joints]
-
-    @property
-    def model_ex_object(self):
-        if not self.sub_version_model_extra:
-            return None
-        return self._model_ex_object
-
-
-    def print_internal(self):
-        print()
-        print("##############################################################")
-        print("## the internal data of Ms3dModel object...")
-        print("##")
-
-        print("header={}".format(self.header))
-
-        print("number_vertices={}".format(self.number_vertices))
-        print("vertices=[", end="")
-        if self.vertices:
-            for obj in self.vertices:
-                print("{}".format(obj), end="")
-        print("]")
-
-        print("number_triangles={}".format(self.number_triangles))
-        print("triangles=[", end="")
-        if self.triangles:
-            for obj in self.triangles:
-                print("{}".format(obj), end="")
-        print("]")
-
-        print("number_groups={}".format(self.number_groups))
-        print("groups=[", end="")
-        if self.groups:
-            for obj in self.groups:
-                print("{}".format(obj), end="")
-        print("]")
-
-        print("number_materials={}".format(self.number_materials))
-        print("materials=[", end="")
-        if self.materials:
-            for obj in self.materials:
-                print("{}".format(obj), end="")
-        print("]")
-
-        print("animation_fps={}".format(self.animation_fps))
-        print("current_time={}".format(self.current_time))
-        print("number_total_frames={}".format(self.number_total_frames))
-
-        print("number_joints={}".format(self.number_joints))
-        print("joints=[", end="")
-        if self.joints:
-            for obj in self.joints:
-                print("{}".format(obj), end="")
-        print("]")
-
-        print("sub_version_comments={}".format(self.sub_version_comments))
-
-        print("number_group_comments={}".format(self.number_group_comments))
-        print("group_comments=[", end="")
-        if self.group_comments:
-            for obj in self.group_comments:
-                print("{}".format(obj.comment_object), end="")
-        print("]")
-
-        print("number_material_comments={}".format(
-                self.number_material_comments))
-        print("material_comments=[", end="")
-        if self.material_comments:
-            for obj in self.material_comments:
-                print("{}".format(obj.comment_object), end="")
-        print("]")
-
-        print("number_joint_comments={}".format(self.number_joint_comments))
-        print("joint_comments=[", end="")
-        if self.joint_comments:
-            for obj in self.joint_comments:
-                print("{}".format(obj.comment_object), end="")
-        print("]")
-
-        print("has_model_comment={}".format(self.has_model_comment))
-        print("model_comment={}".format(self.comment_object))
-
-        print("sub_version_vertex_extra={}".format(
-                self.sub_version_vertex_extra))
-        print("vertex_ex=[", end="")
-        if self.vertex_ex:
-            for obj in self.vertex_ex:
-                print("{}".format(obj), end="")
-        print("]")
-
-        print("sub_version_joint_extra={}".format(
-                self.sub_version_joint_extra))
-        print("joint_ex=[", end="")
-        if self.joint_ex:
-            for obj in self.joint_ex:
-                print("{}".format(obj), end="")
-        print("]")
-
-        print("sub_version_model_extra={}".format(
-                self.sub_version_model_extra))
-        print("model_ex={}".format(self.model_ex_object))
-
-        print("##")
-        print("## ...end")
-        print("##############################################################")
-        print()
-
-
-    def read(self, file):
-        """
-        opens, reads and pars MS3D file.
-        add content to blender scene
-        """
-
-        self.header.read(file)
-        if (self.header != Ms3dHeader()):
-            print("\nwarning, invalid file header")
-
-        _number_vertices = Ms3dIo.read_word(file)
-        if (_number_vertices > Ms3dSpec.MAX_VERTICES):
-            print("\nwarning, invalid count: number_vertices: {}".format(
-                    _number_vertices))
-        self._vertices = []
-        for i in range(_number_vertices):
-            self.vertices.append(Ms3dVertex().read(file))
-
-        _number_triangles = Ms3dIo.read_word(file)
-        if (_number_triangles > Ms3dSpec.MAX_TRIANGLES):
-            print("\nwarning, invalid count: number_triangles: {}".format(
-                    _number_triangles))
-        self._triangles = []
-        for i in range(_number_triangles):
-            self.triangles.append(Ms3dTriangle().read(file))
-
-        _number_groups = Ms3dIo.read_word(file)
-        if (_number_groups > Ms3dSpec.MAX_GROUPS):
-            print("\nwarning, invalid count: number_groups: {}".format(
-                    _number_groups))
-        self._groups = []
-        for i in range(_number_groups):
-            self.groups.append(Ms3dGroup().read(file))
-
-        _number_materials = Ms3dIo.read_word(file)
-        if (_number_materials > Ms3dSpec.MAX_MATERIALS):
-            print("\nwarning, invalid count: number_materials: {}".format(
-                    _number_materials))
-        self._materials = []
-        for i in range(_number_materials):
-            self.materials.append(Ms3dMaterial().read(file))
-
-        self.animation_fps = Ms3dIo.read_float(file)
-        self.current_time = Ms3dIo.read_float(file)
-        self.number_total_frames = Ms3dIo.read_dword(file)
-
-        _progress = set()
-
-        try:
-            # optional data
-            # doesn't matter if doesn't existing.
-
-            Ms3dIo.raise_on_eof(file)
-
-            _number_joints = Ms3dIo.read_word(file)
-            _progress.add('NUMBER_JOINTS')
-            if (_number_joints > Ms3dSpec.MAX_JOINTS):
-                print("\nwarning, invalid count: number_joints: {}".format(
-                        _number_joints))
-            self._joints = []
-            for i in range(_number_joints):
-                self.joints.append(Ms3dJoint().read(file))
-            _progress.add('JOINTS')
-
-            Ms3dIo.raise_on_eof(file)
-
-            self.sub_version_comments = Ms3dIo.read_dword(file)
-            _progress.add('SUB_VERSION_COMMENTS')
-            _number_group_comments = Ms3dIo.read_dword(file)
-            _progress.add('NUMBER_GROUP_COMMENTS')
-            if (_number_group_comments > Ms3dSpec.MAX_GROUPS):
-                print("\nwarning, invalid count:"\
-                        " number_group_comments: {}".format(
-                        _number_group_comments))
-            if _number_group_comments > _number_groups:
-                print("\nwarning, invalid count:"\
-                        " number_group_comments: {}, number_groups: {}".format(
-                        _number_group_comments, _number_groups))
-            for i in range(_number_group_comments):
-                item = Ms3dCommentEx().read(file)
-                if item.index >= 0 and item.index < _number_groups:
-                    self.groups[item.index]._comment_object = item
-                else:
-                    print("\nwarning, invalid index:"\
-                            " group_index: {}, number_groups: {}".format(
-                            item.index, _number_groups))
-            _progress.add('GROUP_COMMENTS')
-
-            _number_material_comments = Ms3dIo.read_dword(file)
-            _progress.add('NUMBER_MATERIAL_COMMENTS')
-            if (_number_material_comments > Ms3dSpec.MAX_MATERIALS):
-                print("\nwarning, invalid count:"\
-                        " number_material_comments: {}".format(
-                        _number_material_comments))
-            if _number_material_comments > _number_materials:
-                print("\nwarning, invalid count:"\
-                        " number_material_comments:"\
-                        " {}, number_materials: {}".format(
-                        _number_material_comments, _number_materials))
-            for i in range(_number_material_comments):
-                item = Ms3dCommentEx().read(file)
-                if item.index >= 0 and item.index < _number_materials:
-                    self.materials[item.index]._comment_object = item
-                else:
-                    print("\nwarning, invalid index:"\
-                            " material_index: {}, number_materials:"\
-                            " {}".format(item.index, _number_materials))
-            _progress.add('MATERIAL_COMMENTS')
-
-            _number_joint_comments = Ms3dIo.read_dword(file)
-            _progress.add('NUMBER_JOINT_COMMENTS')
-            if (_number_joint_comments > Ms3dSpec.MAX_JOINTS):
-                print("\nwarning, invalid count:"\
-                        " number_joint_comments: {}".format(
-                        _number_joint_comments))
-            if _number_joint_comments > _number_joints:
-                print("\nwarning, invalid count:"\
-                        " number_joint_comments: {}, number_joints: {}".format(
-                        _number_joint_comments, _number_joints))
-            for i in range(_number_joint_comments):
-                item = Ms3dCommentEx().read(file)
-                if item.index >= 0 and item.index < _number_joints:
-                    self.joints[item.index]._comment_object = item
-                else:
-                    print("\nwarning, invalid index:"\
-                            " joint_index: {}, number_joints: {}".format(
-                            item.index, _number_joints))
-            _progress.add('JOINT_COMMENTS')
-
-            _has_model_comment = Ms3dIo.read_dword(file)
-            _progress.add('HAS_MODEL_COMMENTS')
-            if (_has_model_comment != 0):
-                self._comment_object = Ms3dComment().read(file)
-            else:
-                self._comment_object = None
-            _progress.add('MODEL_COMMENTS')
-
-            Ms3dIo.raise_on_eof(file)
-
-            self.sub_version_vertex_extra = Ms3dIo.read_dword(file)
-            _progress.add('SUB_VERSION_VERTEX_EXTRA')
-            if self.sub_version_vertex_extra > 0:
-                length = len(self.joints)
-                for i in range(_number_vertices):
-                    if self.sub_version_vertex_extra == 1:
-                        item = Ms3dVertexEx1()
-                    elif self.sub_version_vertex_extra == 2:
-                        item = Ms3dVertexEx2()
-                    elif self.sub_version_vertex_extra == 3:
-                        item = Ms3dVertexEx3()
-                    else:
-                        print("\nwarning, invalid version:"\
-                                " sub_version_vertex_extra: {}".format(
-                                sub_version_vertex_extra))
-                        continue
-                    self.vertices[i]._vertex_ex_object = item.read(file)
-            _progress.add('VERTEX_EXTRA')
-
-            Ms3dIo.raise_on_eof(file)
-
-            self.sub_version_joint_extra = Ms3dIo.read_dword(file)
-            _progress.add('SUB_VERSION_JOINT_EXTRA')
-            if self.sub_version_joint_extra > 0:
-                for i in range(_number_joints):
-                    self.joints[i]._joint_ex_object = Ms3dJointEx().read(file)
-            _progress.add('JOINT_EXTRA')
-
-            Ms3dIo.raise_on_eof(file)
-
-            self.sub_version_model_extra = Ms3dIo.read_dword(file)
-            _progress.add('SUB_VERSION_MODEL_EXTRA')
-            if self.sub_version_model_extra > 0:
-                self._model_ex_object.read(file)
-            _progress.add('MODEL_EXTRA')
-
-        except EOF:
-            # reached end of optional data.
-            print("Ms3dModel.read - optional data read: {}".format(_progress))
-            pass
-
-        except Exception:
-            type, value, traceback = exc_info()
-            print("Ms3dModel.read - exception in optional try block,"
-                    " _progress={0}\n  type: '{1}'\n  value: '{2}'".format(
-                    _progress, type, value, traceback))
-
-        else:
-            pass
-
-        # try best to continue far as possible
-        if not 'JOINTS' in _progress:
-            _number_joints = 0
-            self._joints = []
-
-        if not 'GROUP_COMMENTS' in _progress:
-            self.sub_version_comments = 0
-            _number_group_comments = 0
-
-        if not 'MATERIAL_COMMENTS' in _progress:
-            _number_material_comments = 0
-
-        if not 'JOINT_COMMENTS' in _progress:
-            _number_joint_comments = 0
-
-        if not 'MODEL_COMMENTS' in _progress:
-            _has_model_comment = 0
-            self._comment_object = None # Ms3dComment()
-
-        if not 'VERTEX_EXTRA' in _progress:
-            self.sub_version_vertex_extra = 0
-
-        if not 'JOINT_EXTRA' in _progress:
-            self.sub_version_joint_extra = 0
-
-        if not 'MODEL_EXTRA' in _progress:
-            self.sub_version_model_extra = 0
-            self._model_ex_object = Ms3dModelEx()
-
-        return
-
-
-    def write(self, file):
-        """
-        add blender scene content to MS3D
-        creates, writes MS3D file.
-        """
-
-        self.header.write(file)
-
-        Ms3dIo.write_word(file, self.number_vertices)
-        for i in range(self.number_vertices):
-            self.vertices[i].write(file)
-
-        Ms3dIo.write_word(file, self.number_triangles)
-        for i in range(self.number_triangles):
-            self.triangles[i].write(file)
-
-        Ms3dIo.write_word(file, self.number_groups)
-        for i in range(self.number_groups):
-            self.groups[i].write(file)
-
-        Ms3dIo.write_word(file, self.number_materials)
-        for i in range(self.number_materials):
-            self.materials[i].write(file)
-
-        Ms3dIo.write_float(file, self.animation_fps)
-        Ms3dIo.write_float(file, self.current_time)
-        Ms3dIo.write_dword(file, self.number_total_frames)
-
-        try:
-            # optional part
-            # doesn't matter if it doesn't complete.
-            Ms3dIo.write_word(file, self.number_joints)
-            for i in range(self.number_joints):
-                self.joints[i].write(file)
-
-            Ms3dIo.write_dword(file, self.sub_version_comments)
-
-            Ms3dIo.write_dword(file, self.number_group_comments)
-            for i in range(self.number_group_comments):
-                self.group_comments[i].comment_object.write(file)
-
-            Ms3dIo.write_dword(file, self.number_material_comments)
-            for i in range(self.number_material_comments):
-                self.material_comments[i].comment_object.write(file)
-
-            Ms3dIo.write_dword(file, self.number_joint_comments)
-            for i in range(self.number_joint_comments):
-                self.joint_comments[i].comment_object.write(file)
-
-            Ms3dIo.write_dword(file, self.has_model_comment)
-            if (self.has_model_comment != 0):
-                self.comment_object.write(file)
-
-            Ms3dIo.write_dword(file, self.sub_version_vertex_extra)
-            if (self.sub_version_vertex_extra in {1, 2, 3}):
-                for i in range(self.number_vertices):
-                    self.vertex_ex[i].write(file)
-
-            Ms3dIo.write_dword(file, self.sub_version_joint_extra)
-            for i in range(self.number_joints):
-                self.joint_ex[i].write(file)
-
-            Ms3dIo.write_dword(file, self.sub_version_model_extra)
-            self.model_ex_object.write(file)
-
-        except Exception:
-            type, value, traceback = exc_info()
-            print("Ms3dModel.write - exception in optional try block"
-                    "\n  type: '{0}'\n  value: '{1}'".format(
-                    type, value, traceback))
-            pass
-
-        else:
-            pass
-
-        return
-
-
-    def is_valid(self):
-        valid = True
-        result = []
-
-        format1 = "\n  number of {0}: {1}"
-        format2 = " limit exceeded! (limit is {0})"
-
-        result.append("MS3D statistics:")
-        result.append(format1.format("vertices ........",
-                self.number_vertices))
-        if (self.number_vertices > Ms3dSpec.MAX_VERTICES):
-            result.append(format2.format(Ms3dSpec.MAX_VERTICES))
-            valid &= False
-
-        result.append(format1.format("triangles .......",
-                self.number_triangles))
-        if (self.number_triangles > Ms3dSpec.MAX_TRIANGLES):
-            result.append(format2.format(Ms3dSpec.MAX_TRIANGLES))
-            valid &= False
-
-        result.append(format1.format("groups ..........",
-                self.number_groups))
-        if (self.number_groups > Ms3dSpec.MAX_GROUPS):
-            result.append(format2.format(Ms3dSpec.MAX_GROUPS))
-            valid &= False
-
-        result.append(format1.format("materials .......",
-                self.number_materials))
-        if (self.number_materials > Ms3dSpec.MAX_MATERIALS):
-            result.append(format2.format(Ms3dSpec.MAX_MATERIALS))
-            valid &= False
-
-        result.append(format1.format("joints ..........",
-                self.number_joints))
-        if (self.number_joints > Ms3dSpec.MAX_JOINTS):
-            result.append(format2.format(Ms3dSpec.MAX_JOINTS))
-            valid &= False
-
-        result.append(format1.format("model comments ..",
-                self.has_model_comment))
-        result.append(format1.format("group comments ..",
-                self.number_group_comments))
-        result.append(format1.format("material comments",
-                self.number_material_comments))
-        result.append(format1.format("joint comments ..",
-                self.number_joint_comments))
-
-        #if (not valid):
-        #    result.append("\n\nthe data may be corrupted.")
-
-        return (valid, ("".join(result)))
-
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-# ##### END OF FILE #####
diff --git a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_strings.py b/release/scripts/addons_contrib/io_scene_ms3d/ms3d_strings.py
deleted file mode 100644
index 84a5a56..0000000
--- a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_strings.py
+++ /dev/null
@@ -1,263 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-
-
-# ##### BEGIN COPYRIGHT BLOCK #####
-#
-# initial script copyright (c)2011,2012 Alexander Nussbaumer
-#
-# ##### END COPYRIGHT BLOCK #####
-SEE_MS3D_DOC = "see MilkShape 3D documentation"
-
-ms3d_str = {
-        'lang': "en-US",
-        'RUNTIME_KEY': "Human friendly presentation",
-
-        ###############################
-        # blender key names
-        'OBJECT_LAYER_EXTRA': "ms3d_extra_layer",
-        'OBJECT_LAYER_GROUP': "ms3d_group_layer",
-        'OBJECT_LAYER_SMOOTHING_GROUP': "ms3d_smoothing_group_layer",
-        'OBJECT_MODIFIER_SMOOTHING_GROUP': "ms3d_smoothing_groups",
-        # for some reason after bm.to_mesh(..)
-        # the names of 'bm.loops.layers.uv' becomes to 'bm.faces.layers.tex'
-        # to bypass this issue, i give both the same name.
-        # 'OBJECT_LAYER_TEXTURE': "ms3d_texture_layer",
-        'OBJECT_LAYER_TEXTURE': "ms3d_uv_layer",
-        'OBJECT_LAYER_UV': "ms3d_uv_layer",
-
-        ###############################
-        # strings to be used with 'str().format()'
-        'STRING_FORMAT_GROUP': "Group.{:03d}",
-        'WARNING_IMPORT_SKIP_FACE_DOUBLE': "skipped face #{}:"\
-                " contains double faces with same vertices!",
-        'WARNING_IMPORT_SKIP_LESS_VERTICES': "skipped face #{}:"\
-                " contains faces too less vertices!",
-        'WARNING_IMPORT_SKIP_VERTEX_DOUBLE': "skipped face #{}:"\
-                " contains faces with double vertices!",
-        'WARNING_IMPORT_EXTRA_VERTEX_NORMAL': "created extra vertex"\
-                " because of different normals #{} -> {}.",
-        'SUMMARY_IMPORT': "elapsed time: {0:.4}s (media io:"\
-                " ~{1:.4}s, converter: ~{2:.4}s)",
-        'SUMMARY_EXPORT': "elapsed time: {0:.4}s (converter:"\
-                " ~{1:.4}s, media io: ~{2:.4}s)",
-        'WARNING_EXPORT_SKIP_WEIGHT' : "skipped weight",
-        'WARNING_EXPORT_SKIP_WEIGHT_EX' : "skipped weight:"\
-                " limit exceeded",
-
-        ###############################
-        'TEXT_OPERATOR': "MilkShape 3D (.ms3d)",
-        'FILE_EXT': ".ms3d",
-        'FILE_FILTER': "*.ms3d",
-        'BL_DESCRIPTION_EXPORTER': "Export to a MilkShape 3D file format (.ms3d)",
-        'BL_DESCRIPTION_IMPORTER': "Import from a MilkShape 3D file format (.ms3d)",
-        'BL_LABEL_EXPORTER': "Export MS3D",
-        'BL_LABEL_GROUP_OPERATOR': "MS3D - Group Collection Operator",
-        'BL_LABEL_IMPORTER': "Import MS3D",
-        'BL_LABEL_PANEL_SMOOTHING_GROUP': "MS3D - Smoothing Group",
-        'BL_LABEL_SMOOTHING_GROUP_OPERATOR': "MS3D Set Smoothing Group"\
-                " Operator",
-        'BL_LABEL_MATERIAL_OPERATOR' : "MS3D - Copy Material Operator",
-        'ENUM_ADD_GROUP_1': "Add",
-        'ENUM_ADD_GROUP_2': "adds an item",
-        'ENUM_ASSIGN_1': "Assign",
-        'ENUM_ASSIGN_2_GROUP': "assign selected faces to selected group",
-        'ENUM_ASSIGN_2_SMOOTHING_GROUP': "assign all selected faces to"\
-                " selected smoothing group",
-        'ENUM_DESELECT_1': "Deselect",
-        'ENUM_DESELECT_2_GROUP': "deselects faces of selected group",
-        'ENUM_DESELECT_2_SMOOTHING_GROUP': "deselects all faces of selected"\
-                " smoothing group",
-        'ENUM_FLAG_DIRTY_1': "Dirty",
-        'ENUM_FLAG_DIRTY_2': SEE_MS3D_DOC,
-        'ENUM_FLAG_HIDDEN_1': "Hidden",
-        'ENUM_FLAG_HIDDEN_2': SEE_MS3D_DOC,
-        'ENUM_FLAG_ISKEY_1': "Is Key",
-        'ENUM_FLAG_ISKEY_2': SEE_MS3D_DOC,
-        'ENUM_FLAG_MARKED_1': "Marked",
-        'ENUM_FLAG_MARKED_2': SEE_MS3D_DOC,
-        'ENUM_FLAG_NEWLYCREATED_1': "Newly Created",
-        'ENUM_FLAG_NEWLYCREATED_2': SEE_MS3D_DOC,
-        'ENUM_FLAG_NONE_1': "None",
-        'ENUM_FLAG_NONE_2': SEE_MS3D_DOC,
-        'ENUM_FLAG_SELECTED_1': "Selected",
-        'ENUM_FLAG_SELECTED_2': SEE_MS3D_DOC,
-        'ENUM_FLAG_SELECTED2_1': "Selected Ex.",
-        'ENUM_FLAG_SELECTED2_2': SEE_MS3D_DOC,
-        'ENUM_REMOVE_1': "Remove",
-        'ENUM_REMOVE_2_GROUP': "remove selected faces from selected group",
-        'ENUM_REMOVE_GROUP_1': "Remove",
-        'ENUM_REMOVE_GROUP_2': "removes an item",
-        'ENUM_SELECT_1': "Select",
-        'ENUM_SELECT_2_GROUP': "selects faces of selected group",
-        'ENUM_SELECT_2_SMOOTHING_GROUP': "selects all faces of selected"\
-                " smoothing group",
-        'LABEL_NAME_ANIMATION': "Animation Processing:",
-        'LABEL_NAME_OBJECT': "World Processing:",
-        'LABEL_NAME_OPTIONS': "Advanced Options:",
-        'LABEL_NAME_PROCESSING': "Object Processing:",
-        'LABEL_NAME_MODIFIER': "Modifier Processing:",
-        'LABEL_PANEL_BUTTON_NONE': "None",
-        'LABEL_PANEL_GROUPS': "MS3D - Groups",
-        'LABEL_PANEL_JOINTS': "MS3D - Joint",
-        'LABEL_PANEL_MATERIALS': "MS3D - Material",
-        'LABEL_PANEL_MODEL': "MS3D - Model",
-        'PROP_DESC_ALPHA_REF': "ms3d internal raw 'alpha_ref' of Model",
-        'PROP_DESC_ALPHAMAP': "ms3d internal raw 'alphamap' file name of"\
-                " Material",
-        'PROP_DESC_AMBIENT': "ms3d internal raw 'ambient' of Material",
-        'PROP_DESC_USE_ANIMATION': "keyframes (rotations, positions)",
-        'PROP_DESC_COLOR_JOINT': "ms3d internal raw 'color' of Joint",
-        'PROP_DESC_COMMENT_GROUP': "ms3d internal raw 'comment' of Group",
-        'PROP_DESC_COMMENT_JOINT': "ms3d internal raw 'comment' of Joint",
-        'PROP_DESC_COMMENT_MATERIAL': "ms3d internal raw 'comment' of Material",
-        'PROP_DESC_COMMENT_MODEL': "ms3d internal raw 'comment' of Model",
-        'PROP_DESC_DIFFUSE': "ms3d internal raw 'diffuse' of Material",
-        'PROP_DESC_EMISSIVE': "ms3d internal raw 'emissive' of Material",
-        'PROP_DESC_FLAGS_GROUP': "ms3d internal raw 'flags' of Group",
-        'PROP_DESC_FLAGS_JOINT': "ms3d internal raw 'flags' of Joint",
-        'PROP_DESC_GROUP_NAME': "ms3d internal raw 'name' of Group",
-        'PROP_DESC_JOINT_SIZE': "ms3d internal raw 'joint_size' of Model",
-        'PROP_DESC_MODE_TEXTURE': "ms3d internal raw 'mode' of Material",
-        'PROP_DESC_NAME_ARMATURE': "ms3d internal raw 'name' of Model (not used"\
-                " for export)",
-        'PROP_DESC_NAME_JOINT': "ms3d internal raw 'name' of Joint",
-        'PROP_DESC_NAME_MATERIAL': "ms3d internal raw 'name' of Material",
-        'PROP_DESC_NAME_MODEL': "ms3d internal raw 'name' of Model (not used for export)",
-        'PROP_DESC_SHININESS': "ms3d internal raw 'shininess' of Material",
-        'PROP_DESC_SPECULAR': "ms3d internal raw 'specular' of Material",
-        'PROP_DESC_TEXTURE': "ms3d internal raw 'texture' file name of"\
-                " Material",
-        'PROP_DESC_TRANSPARENCY': "ms3d internal raw 'transparency' of"\
-                " Material",
-        'PROP_DESC_TRANSPARENCY_MODE': "ms3d internal raw 'transparency_mode'"\
-                " of Model",
-        'PROP_DESC_VERBOSE': "Run the converter in debug mode."\
-                " Check the console for output (Warning, may be very slow)",
-        'PROP_FLAG_TEXTURE_COMBINE_ALPHA_1': "Combine Alpha",
-        'PROP_FLAG_TEXTURE_COMBINE_ALPHA_2': SEE_MS3D_DOC,
-        'PROP_FLAG_TEXTURE_HAS_ALPHA_1': "Has Alpha",
-        'PROP_FLAG_TEXTURE_HAS_ALPHA_2': SEE_MS3D_DOC,
-        'PROP_FLAG_TEXTURE_SPHERE_MAP_1': "Sphere Map",
-        'PROP_FLAG_TEXTURE_SPHERE_MAP_2': SEE_MS3D_DOC,
-        'PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_1': "Depth"\
-                " Buffered with Alpha Ref",
-        'PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_2': SEE_MS3D_DOC,
-        'PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_1': "Depth Sorted"\
-                " Triangles",
-        'PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_2': SEE_MS3D_DOC,
-        'PROP_MODE_TRANSPARENCY_SIMPLE_1': "Simple",
-        'PROP_MODE_TRANSPARENCY_SIMPLE_2': SEE_MS3D_DOC,
-        'PROP_NAME_ALPHA_REF': "Alpha Ref.",
-        'PROP_NAME_ALPHAMAP': "Alphamap",
-        'PROP_NAME_AMBIENT': "Ambient",
-        'PROP_NAME_USE_ANIMATION': "Animation",
-        'PROP_NAME_COLOR': "Color",
-        'PROP_NAME_COMMENT': "Comment",
-        'PROP_NAME_DIFFUSE': "Diffuse",
-        'PROP_NAME_EMISSIVE': "Emissive",
-        'PROP_NAME_FLAGS': "Flags",
-        'PROP_NAME_JOINT_SIZE': "Joint Size",
-        'PROP_NAME_MODE': "Mode",
-        'PROP_NAME_NAME': "Name",
-        'PROP_NAME_ACTIVE': "Active Mesh:",
-        'PROP_NAME_SHININESS': "Shininess",
-        'PROP_NAME_SPECULAR': "Specular",
-        'PROP_NAME_TEXTURE': "Texture",
-        'PROP_NAME_TRANSPARENCY': "Transparency",
-        'PROP_NAME_TRANSPARENCY_MODE': "Transp. Mode",
-        'PROP_NAME_VERBOSE': "Verbose",
-        'PROP_SMOOTHING_GROUP_INDEX': "Smoothing group id",
-        'PROP_NAME_ROTATION_MODE' : "Bone Rotation Mode",
-        'PROP_DESC_ROTATION_MODE' : "set the preferred rotation mode of bones",
-        'PROP_ITEM_ROTATION_MODE_EULER_1' : "Euler",
-        'PROP_ITEM_ROTATION_MODE_EULER_2' : "use euler bone rotation"\
-                " (gimbal-lock can be fixed by using "\
-                "'Graph Editor -> Key -> Discontinuity (Euler) Filter')",
-        'PROP_ITEM_ROTATION_MODE_QUATERNION_1' : "Quaternion",
-        'PROP_ITEM_ROTATION_MODE_QUATERNION_2' : "use quaternion bone rotation"\
-                " (no gimbal-lock filter available!)",
-        'PROP_NAME_USE_JOINT_SIZE': "Override Joint Size",
-        'PROP_DESC_USE_JOINT_SIZE': "use value of 'Joint Size', the value of the"\
-                " ms3d file is ignored for representation.",
-        'PROP_NAME_IMPORT_JOINT_SIZE': "Joint Size",
-        'PROP_DESC_IMPORT_JOINT_SIZE': "size of the joint representation in"\
-                " blender",
-        'BL_LABEL_SET_SCENE_TO_METRIC' : "Set Scene to 'Metric' [1 mm]",
-        'BL_DESC_SET_SCENE_TO_METRIC' : "set Scene | Units to Metric"\
-                " (1 Unit = 1 mm),"\
-                " Display | Textured Solid,"\
-                " View | Clip (0.001 mm ... 1 km)",
-        'PROP_NAME_NORMALIZE_WEIGHTS' : "Normalize Weights",
-        'PROP_DESC_NORMALIZE_WEIGHTS' : "normalize weights to 100%,"\
-                " when its sum of weights is greater than 100%",
-        'PROP_NAME_SHRINK_TO_KEYS' : "Shrink To Keys",
-        'PROP_DESC_SHRINK_TO_KEYS' : "shrinks the animation to region from"\
-                " first keyframe to last keyframe",
-        'PROP_NAME_BAKE_EACH_FRAME' : "Bake Each Frame As Key",
-        'PROP_DESC_BAKE_EACH_FRAME' : "if enabled, to each frame there will be"\
-                " a key baked",
-        'LABEL_NAME_JOINT_TO_BONES' : "works only with some models!",
-        'PROP_NAME_JOINT_TO_BONES' : "Joints To Bones",
-        'PROP_DESC_JOINT_TO_BONES' : "changes the length of the bones",
-        'PROP_NAME_USE_BLENDER_NAMES' : "Use Blender Names Only",
-        'PROP_DESC_USE_BLENDER_NAMES' : "use only blender names, ignores ms3d"\
-                " names (bone names will always be taken from blender)",
-        'PROP_NAME_USE_BLENDER_MATERIALS' : "Use Blender Materials",
-        'PROP_DESC_USE_BLENDER_MATERIALS' : "ignores ms3d material definition"\
-                " (you loose some information by choosing this option)",
-        'ENUM_FROM_BLENDER_1' : "Copy From Blender",
-        'ENUM_FROM_BLENDER_2' : "takes and copies all available values from"\
-                " blender",
-        'ENUM_TO_BLENDER_1' : "Copy To Blender",
-        'ENUM_TO_BLENDER_2' : "copies and puts all available values to blender",
-        'PROP_NAME_EXTENDED_NORMAL_HANDLING': "Extended Normal Handling",
-        'PROP_DESC_EXTENDED_NORMAL_HANDLING': "adds extra vertices if normals"\
-                " are different",
-        'PROP_NAME_APPLY_TRANSFORM': "Apply Transform",
-        'PROP_DESC_APPLY_TRANSFORM': "applies location, rotation and scale on"\
-                " export",
-        'PROP_NAME_APPLY_MODIFIERS': "Apply Modifiers",
-        'PROP_DESC_APPLY_MODIFIERS': "applies modifiers on export that are"\
-                " enabled (except of armature modifiers)",
-        'PROP_NAME_APPLY_MODIFIERS_MODE': "Apply Mode",
-        'PROP_DESC_APPLY_MODIFIERS_MODE': "apply modifier, if enabled in its"\
-                " mode",
-        'PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_1': "View",
-        'PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_2': "apply modifiers that are"\
-                " enabled in viewport",
-        'PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_1': "Render",
-        'PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_2': "apply modifiers that are"\
-                " enabled in renderer",
-
-        'PROP_NAME_': "Name",
-        'PROP_DESC_': "Description",
-        # ms3d_str['']
-        }
-
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-# ##### END OF FILE #####
diff --git a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_ui.py b/release/scripts/addons_contrib/io_scene_ms3d/ms3d_ui.py
deleted file mode 100644
index b3ed9db..0000000
--- a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_ui.py
+++ /dev/null
@@ -1,1678 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-
-
-# ##### BEGIN COPYRIGHT BLOCK #####
-#
-# initial script copyright (c)2011,2012 Alexander Nussbaumer
-#
-# ##### END COPYRIGHT BLOCK #####
-
-
-#import python stuff
-from random import (
-        randrange,
-        )
-
-
-# import io_scene_ms3d stuff
-from io_scene_ms3d.ms3d_strings import (
-        ms3d_str,
-        )
-from io_scene_ms3d.ms3d_spec import (
-        Ms3dSpec,
-        )
-from io_scene_ms3d.ms3d_utils import (
-        enable_edit_mode,
-        get_edge_split_modifier_add_if,
-        set_sence_to_metric,
-        )
-
-
-#import blender stuff
-from bmesh import (
-        from_edit_mesh,
-        )
-from bpy.utils import (
-        register_class,
-        unregister_class,
-        )
-from bpy_extras.io_utils import (
-        ExportHelper,
-        ImportHelper,
-        )
-from bpy.props import (
-        BoolProperty,
-        CollectionProperty,
-        EnumProperty,
-        FloatProperty,
-        FloatVectorProperty,
-        IntProperty,
-        StringProperty,
-        PointerProperty,
-        )
-from bpy.types import (
-        Operator,
-        PropertyGroup,
-        Panel,
-        Armature,
-        Bone,
-        Mesh,
-        Material,
-        Action,
-        Group,
-        )
-from bpy.app import (
-        debug,
-        )
-
-
-class Ms3dUi:
-    DEFAULT_VERBOSE = debug
-
-    ###########################################################################
-    FLAG_TEXTURE_COMBINE_ALPHA = 'COMBINE_ALPHA'
-    FLAG_TEXTURE_HAS_ALPHA = 'HAS_ALPHA'
-    FLAG_TEXTURE_SPHERE_MAP = 'SPHERE_MAP'
-
-    @staticmethod
-    def texture_mode_from_ms3d(ms3d_value):
-        ui_value = set()
-        if (ms3d_value & Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA) \
-                == Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA:
-            ui_value.add(Ms3dUi.FLAG_TEXTURE_COMBINE_ALPHA)
-        if (ms3d_value & Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA) \
-                == Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA:
-            ui_value.add(Ms3dUi.FLAG_TEXTURE_HAS_ALPHA)
-        if (ms3d_value & Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP) \
-                == Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP:
-            ui_value.add(Ms3dUi.FLAG_TEXTURE_SPHERE_MAP)
-        return ui_value
-
-    @staticmethod
-    def texture_mode_to_ms3d(ui_value):
-        ms3d_value = Ms3dSpec.FLAG_TEXTURE_NONE
-
-        if Ms3dUi.FLAG_TEXTURE_COMBINE_ALPHA in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA
-        if Ms3dUi.FLAG_TEXTURE_HAS_ALPHA in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA
-        if Ms3dUi.FLAG_TEXTURE_SPHERE_MAP in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP
-        return ms3d_value
-
-
-    MODE_TRANSPARENCY_SIMPLE = 'SIMPLE'
-    MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF \
-            = 'DEPTH_BUFFERED_WITH_ALPHA_REF'
-    MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES = 'DEPTH_SORTED_TRIANGLES'
-
-    @staticmethod
-    def transparency_mode_from_ms3d(ms3d_value):
-        if(ms3d_value == Ms3dSpec.MODE_TRANSPARENCY_SIMPLE):
-            return Ms3dUi.MODE_TRANSPARENCY_SIMPLE
-        elif(ms3d_value == \
-                Ms3dSpec.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF):
-            return Ms3dUi.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF
-        elif(ms3d_value == Ms3dSpec.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES):
-            return Ms3dUi.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES
-        return None
-
-    @staticmethod
-    def transparency_mode_to_ms3d(ui_value):
-        if(ui_value == Ms3dUi.MODE_TRANSPARENCY_SIMPLE):
-            return Ms3dSpec.MODE_TRANSPARENCY_SIMPLE
-        elif(ui_value == Ms3dUi.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF):
-            return Ms3dSpec.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF
-        elif(ui_value == Ms3dUi.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES):
-            return Ms3dSpec.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES
-        return None
-
-
-    FLAG_NONE = 'NONE'
-    FLAG_SELECTED = 'SELECTED'
-    FLAG_HIDDEN = 'HIDDEN'
-    FLAG_SELECTED2 = 'SELECTED2'
-    FLAG_DIRTY = 'DIRTY'
-    FLAG_ISKEY = 'ISKEY'
-    FLAG_NEWLYCREATED = 'NEWLYCREATED'
-    FLAG_MARKED = 'MARKED'
-
-    @staticmethod
-    def flags_from_ms3d(ms3d_value):
-        ui_value = set()
-        if (ms3d_value & Ms3dSpec.FLAG_SELECTED) == Ms3dSpec.FLAG_SELECTED:
-            ui_value.add(Ms3dUi.FLAG_SELECTED)
-        if (ms3d_value & Ms3dSpec.FLAG_HIDDEN) == Ms3dSpec.FLAG_HIDDEN:
-            ui_value.add(Ms3dUi.FLAG_HIDDEN)
-        if (ms3d_value & Ms3dSpec.FLAG_SELECTED2) == Ms3dSpec.FLAG_SELECTED2:
-            ui_value.add(Ms3dUi.FLAG_SELECTED2)
-        if (ms3d_value & Ms3dSpec.FLAG_DIRTY) == Ms3dSpec.FLAG_DIRTY:
-            ui_value.add(Ms3dUi.FLAG_DIRTY)
-        if (ms3d_value & Ms3dSpec.FLAG_ISKEY) == Ms3dSpec.FLAG_ISKEY:
-            ui_value.add(Ms3dUi.FLAG_ISKEY)
-        if (ms3d_value & Ms3dSpec.FLAG_NEWLYCREATED) == \
-                Ms3dSpec.FLAG_NEWLYCREATED:
-            ui_value.add(Ms3dUi.FLAG_NEWLYCREATED)
-        if (ms3d_value & Ms3dSpec.FLAG_MARKED) == Ms3dSpec.FLAG_MARKED:
-            ui_value.add(Ms3dUi.FLAG_MARKED)
-        return ui_value
-
-    @staticmethod
-    def flags_to_ms3d(ui_value):
-        ms3d_value = Ms3dSpec.FLAG_NONE
-        if Ms3dUi.FLAG_SELECTED in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_SELECTED
-        if Ms3dUi.FLAG_HIDDEN in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_HIDDEN
-        if Ms3dUi.FLAG_SELECTED2 in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_SELECTED2
-        if Ms3dUi.FLAG_DIRTY in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_DIRTY
-        if Ms3dUi.FLAG_ISKEY in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_ISKEY
-        if Ms3dUi.FLAG_NEWLYCREATED in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_NEWLYCREATED
-        if Ms3dUi.FLAG_MARKED in ui_value:
-            ms3d_value |= Ms3dSpec.FLAG_MARKED
-        return ms3d_value
-
-    ###########################################################################
-    ICON_OPTIONS = 'LAMP'
-    ICON_OBJECT = 'WORLD'
-    ICON_PROCESSING = 'OBJECT_DATAMODE'
-    ICON_MODIFIER = 'MODIFIER'
-    ICON_ANIMATION = 'RENDER_ANIMATION'
-    ICON_ROTATION_MODE = 'BONE_DATA'
-    ICON_ERROR = 'ERROR'
-
-    ###########################################################################
-    PROP_DEFAULT_VERBOSE = DEFAULT_VERBOSE
-
-    ###########################################################################
-    PROP_DEFAULT_USE_JOINT_SIZE = False
-    PROP_DEFAULT_JOINT_SIZE = 0.01
-    PROP_JOINT_SIZE_MIN = 0.01
-    PROP_JOINT_SIZE_MAX = 10.0
-    PROP_JOINT_SIZE_STEP = 0.1
-    PROP_JOINT_SIZE_PRECISION = 2
-
-    ###########################################################################
-    PROP_DEFAULT_USE_ANIMATION = True
-    PROP_DEFAULT_NORMALIZE_WEIGHTS = True
-    PROP_DEFAULT_SHRINK_TO_KEYS = False
-    PROP_DEFAULT_BAKE_EACH_FRAME = True
-    PROP_DEFAULT_JOINT_TO_BONES = False
-    PROP_DEFAULT_USE_BLENDER_NAMES = True
-    PROP_DEFAULT_USE_BLENDER_MATERIALS = False
-    PROP_DEFAULT_EXTENDED_NORMAL_HANDLING = False
-    PROP_DEFAULT_APPLY_TRANSFORM = True
-    PROP_DEFAULT_APPLY_MODIFIERS = True
-
-    ###########################################################################
-    PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW = 'PREVIEW'
-    PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER = 'RENDER'
-    PROP_DEFAULT_APPLY_MODIFIERS_MODE = PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW
-
-    ###########################################################################
-    PROP_ITEM_ROTATION_MODE_EULER = 'EULER'
-    PROP_ITEM_ROTATION_MODE_QUATERNION = 'QUATERNION'
-    PROP_DEFAULT_ANIMATION_ROTATION = PROP_ITEM_ROTATION_MODE_EULER
-
-    ###########################################################################
-    OPT_SMOOTHING_GROUP_APPLY = 'io_scene_ms3d.apply_smoothing_group'
-    OPT_GROUP_APPLY = 'io_scene_ms3d.apply_group'
-    OPT_MATERIAL_APPLY = 'io_scene_ms3d.apply_material'
-
-
-###############################################################################
-class Ms3dImportOperator(Operator, ImportHelper):
-    """ Load a MilkShape3D MS3D File """
-    bl_idname = 'import_scene.ms3d'
-    bl_label = ms3d_str['BL_LABEL_IMPORTER']
-    bl_description = ms3d_str['BL_DESCRIPTION_IMPORTER']
-    bl_options = {'PRESET', }
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-
-    filename_ext = ms3d_str['FILE_EXT']
-
-    filter_glob = StringProperty(
-            default=ms3d_str['FILE_FILTER'],
-            options={'HIDDEN', }
-            )
-
-    filepath = StringProperty(
-            subtype='FILE_PATH',
-            options={'HIDDEN', }
-            )
-
-    verbose = BoolProperty(
-            name=ms3d_str['PROP_NAME_VERBOSE'],
-            description=ms3d_str['PROP_DESC_VERBOSE'],
-            default=Ms3dUi.PROP_DEFAULT_VERBOSE,
-            )
-
-    use_animation = BoolProperty(
-            name=ms3d_str['PROP_NAME_USE_ANIMATION'],
-            description=ms3d_str['PROP_DESC_USE_ANIMATION'],
-            default=Ms3dUi.PROP_DEFAULT_USE_ANIMATION,
-            )
-
-    rotation_mode = EnumProperty(
-            name=ms3d_str['PROP_NAME_ROTATION_MODE'],
-            description=ms3d_str['PROP_DESC_ROTATION_MODE'],
-            items=( (Ms3dUi.PROP_ITEM_ROTATION_MODE_EULER,
-                            ms3d_str['PROP_ITEM_ROTATION_MODE_EULER_1'],
-                            ms3d_str['PROP_ITEM_ROTATION_MODE_EULER_2']),
-                    (Ms3dUi.PROP_ITEM_ROTATION_MODE_QUATERNION,
-                            ms3d_str['PROP_ITEM_ROTATION_MODE_QUATERNION_1'],
-                            ms3d_str['PROP_ITEM_ROTATION_MODE_QUATERNION_2']),
-                    ),
-            default=Ms3dUi.PROP_DEFAULT_ANIMATION_ROTATION,
-            )
-
-    use_joint_size = BoolProperty(
-            name=ms3d_str['PROP_NAME_USE_JOINT_SIZE'],
-            description=ms3d_str['PROP_DESC_USE_JOINT_SIZE'],
-            default=Ms3dUi.PROP_DEFAULT_USE_JOINT_SIZE,
-            )
-
-    joint_size = FloatProperty(
-            name=ms3d_str['PROP_NAME_IMPORT_JOINT_SIZE'],
-            description=ms3d_str['PROP_DESC_IMPORT_JOINT_SIZE'],
-            min=Ms3dUi.PROP_JOINT_SIZE_MIN, max=Ms3dUi.PROP_JOINT_SIZE_MAX,
-            precision=Ms3dUi.PROP_JOINT_SIZE_PRECISION, \
-                    step=Ms3dUi.PROP_JOINT_SIZE_STEP,
-            default=Ms3dUi.PROP_DEFAULT_JOINT_SIZE,
-            subtype='FACTOR',
-            #options={'HIDDEN', },
-            )
-
-    joint_to_bones = BoolProperty(
-            name=ms3d_str['PROP_NAME_JOINT_TO_BONES'],
-            description=ms3d_str['PROP_DESC_JOINT_TO_BONES'],
-            default=Ms3dUi.PROP_DEFAULT_JOINT_TO_BONES,
-            )
-
-    extended_normal_handling = BoolProperty(
-            name=ms3d_str['PROP_NAME_EXTENDED_NORMAL_HANDLING'],
-            description=ms3d_str['PROP_DESC_EXTENDED_NORMAL_HANDLING'],
-            default=Ms3dUi.PROP_DEFAULT_EXTENDED_NORMAL_HANDLING,
-            )
-
-
-    @property
-    def is_rotation_mode_euler(self):
-        return (Ms3dUi.PROP_ITEM_ROTATION_MODE_EULER \
-                in self.rotation_mode)
-
-    @property
-    def is_rotation_mode_quaternion(self):
-        return (Ms3dUi.PROP_ITEM_ROTATION_MODE_QUATERNION \
-                in self.rotation_mode)
-
-
-    # draw the option panel
-    def draw(self, blender_context):
-        layout = self.layout
-
-        box = layout.box()
-        box.label(ms3d_str['LABEL_NAME_OPTIONS'], icon=Ms3dUi.ICON_OPTIONS)
-        box.prop(self, 'verbose', icon='SPEAKER')
-
-        box = layout.box()
-        box.label(ms3d_str['LABEL_NAME_PROCESSING'],
-                icon=Ms3dUi.ICON_PROCESSING)
-        box.prop(self, 'extended_normal_handling')
-
-        box = layout.box()
-        box.label(ms3d_str['LABEL_NAME_ANIMATION'], icon=Ms3dUi.ICON_ANIMATION)
-        box.prop(self, 'use_animation')
-        if (self.use_animation):
-            box.prop(self, 'rotation_mode', icon=Ms3dUi.ICON_ROTATION_MODE,
-                    expand=False)
-            box.prop(self, 'use_joint_size')
-            if (self.use_joint_size):
-                col = box.column()
-                row = col.row()
-                row.prop(self, 'joint_size')
-            box.prop(self, 'joint_to_bones')
-            if (self.joint_to_bones):
-                box.box().label(ms3d_str['LABEL_NAME_JOINT_TO_BONES'],
-                        icon=Ms3dUi.ICON_ERROR)
-
-    # entrypoint for MS3D -> blender
-    def execute(self, blender_context):
-        """ start executing """
-        from io_scene_ms3d.ms3d_import import (Ms3dImporter, )
-        return Ms3dImporter(self).read(blender_context)
-
-    def invoke(self, blender_context, event):
-        blender_context.window_manager.fileselect_add(self)
-        return {'RUNNING_MODAL', }
-
-    @staticmethod
-    def menu_func(cls, blender_context):
-        cls.layout.operator(
-                Ms3dImportOperator.bl_idname,
-                text=ms3d_str['TEXT_OPERATOR'],
-                )
-
-
-class Ms3dExportOperator(Operator, ExportHelper):
-    """Save a MilkShape3D MS3D File"""
-    bl_idname = 'export_scene.ms3d'
-    bl_label = ms3d_str['BL_LABEL_EXPORTER']
-    bl_description = ms3d_str['BL_DESCRIPTION_EXPORTER']
-    bl_options = {'PRESET', }
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-
-    filename_ext = ms3d_str['FILE_EXT']
-
-    filter_glob = StringProperty(
-            default=ms3d_str['FILE_FILTER'],
-            options={'HIDDEN', }
-            )
-
-    filepath = StringProperty(
-            subtype='FILE_PATH',
-            options={'HIDDEN', }
-            )
-
-    verbose = BoolProperty(
-            name=ms3d_str['PROP_NAME_VERBOSE'],
-            description=ms3d_str['PROP_DESC_VERBOSE'],
-            default=Ms3dUi.PROP_DEFAULT_VERBOSE,
-            )
-
-    use_blender_names = BoolProperty(
-            name=ms3d_str['PROP_NAME_USE_BLENDER_NAMES'],
-            description=ms3d_str['PROP_DESC_USE_BLENDER_NAMES'],
-            default=Ms3dUi.PROP_DEFAULT_USE_BLENDER_NAMES,
-            )
-
-    use_blender_materials = BoolProperty(
-            name=ms3d_str['PROP_NAME_USE_BLENDER_MATERIALS'],
-            description=ms3d_str['PROP_DESC_USE_BLENDER_MATERIALS'],
-            default=Ms3dUi.PROP_DEFAULT_USE_BLENDER_MATERIALS,
-            )
-
-    apply_transform = BoolProperty(
-            name=ms3d_str['PROP_NAME_APPLY_TRANSFORM'],
-            description=ms3d_str['PROP_DESC_APPLY_TRANSFORM'],
-            default=Ms3dUi.PROP_DEFAULT_APPLY_TRANSFORM,
-            )
-
-    apply_modifiers = BoolProperty(
-            name=ms3d_str['PROP_NAME_APPLY_MODIFIERS'],
-            description=ms3d_str['PROP_DESC_APPLY_MODIFIERS'],
-            default=Ms3dUi.PROP_DEFAULT_APPLY_MODIFIERS,
-            )
-
-    apply_modifiers_mode =  EnumProperty(
-            name=ms3d_str['PROP_NAME_APPLY_MODIFIERS_MODE'],
-            description=ms3d_str['PROP_DESC_APPLY_MODIFIERS_MODE'],
-            items=( (Ms3dUi.PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW,
-                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_1'],
-                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_VIEW_2']),
-                    (Ms3dUi.PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER,
-                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_1'],
-                            ms3d_str['PROP_ITEM_APPLY_MODIFIERS_MODE_RENDER_2']),
-                    ),
-            default=Ms3dUi.PROP_DEFAULT_APPLY_MODIFIERS_MODE,
-            )
-
-    use_animation = BoolProperty(
-            name=ms3d_str['PROP_NAME_USE_ANIMATION'],
-            description=ms3d_str['PROP_DESC_USE_ANIMATION'],
-            default=Ms3dUi.PROP_DEFAULT_USE_ANIMATION,
-            )
-
-    normalize_weights = BoolProperty(
-            name=ms3d_str['PROP_NAME_NORMALIZE_WEIGHTS'],
-            description=ms3d_str['PROP_DESC_NORMALIZE_WEIGHTS'],
-            default=Ms3dUi.PROP_DEFAULT_NORMALIZE_WEIGHTS,
-            )
-
-    shrink_to_keys = BoolProperty(
-            name=ms3d_str['PROP_NAME_SHRINK_TO_KEYS'],
-            description=ms3d_str['PROP_DESC_SHRINK_TO_KEYS'],
-            default=Ms3dUi.PROP_DEFAULT_SHRINK_TO_KEYS,
-            )
-
-    bake_each_frame = BoolProperty(
-            name=ms3d_str['PROP_NAME_BAKE_EACH_FRAME'],
-            description=ms3d_str['PROP_DESC_BAKE_EACH_FRAME'],
-            default=Ms3dUi.PROP_DEFAULT_BAKE_EACH_FRAME,
-            )
-
-
-    ##EXPORT_ACTIVE_ONLY:
-    ##limit availability to only active mesh object
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.active_object
-                and blender_context.active_object.type in {'MESH', }
-                and blender_context.active_object.data
-                and blender_context.active_object.data.ms3d is not None
-                )
-
-    # draw the option panel
-    def draw(self, blender_context):
-        layout = self.layout
-
-        box = layout.box()
-        box.label(ms3d_str['LABEL_NAME_OPTIONS'], icon=Ms3dUi.ICON_OPTIONS)
-        box.prop(self, 'verbose', icon='SPEAKER')
-
-        box = layout.box()
-        box.label(ms3d_str['LABEL_NAME_PROCESSING'],
-                icon=Ms3dUi.ICON_PROCESSING)
-        row = box.row()
-        row.label(ms3d_str['PROP_NAME_ACTIVE'], icon='ROTACTIVE')
-        row.label(blender_context.active_object.name)
-        #box.prop(self, 'use_blender_names', icon='LINK_BLEND')
-        box.prop(self, 'use_blender_names')
-        box.prop(self, 'use_blender_materials')
-
-        box = layout.box()
-        box.label(ms3d_str['LABEL_NAME_MODIFIER'],
-                icon=Ms3dUi.ICON_MODIFIER)
-        box.prop(self, 'apply_transform')
-        row = box.row()
-        row.prop(self, 'apply_modifiers')
-        sub = row.row()
-        sub.active = self.apply_modifiers
-        sub.prop(self, 'apply_modifiers_mode', text="")
-
-        box = layout.box()
-        box.label(ms3d_str['LABEL_NAME_ANIMATION'],
-                icon=Ms3dUi.ICON_ANIMATION)
-        box.prop(self, 'use_animation')
-        if (self.use_animation):
-            box.prop(self, 'normalize_weights')
-            box.prop(self, 'shrink_to_keys')
-            box.prop(self, 'bake_each_frame')
-
-    # entrypoint for blender -> MS3D
-    def execute(self, blender_context):
-        """start executing"""
-        from io_scene_ms3d.ms3d_export import (Ms3dExporter, )
-        return Ms3dExporter(self).write(blender_context)
-
-    #
-    def invoke(self, blender_context, event):
-        blender_context.window_manager.fileselect_add(self)
-        return {"RUNNING_MODAL", }
-
-    @staticmethod
-    def menu_func(cls, blender_context):
-        cls.layout.operator(
-                Ms3dExportOperator.bl_idname,
-                text=ms3d_str['TEXT_OPERATOR']
-                )
-
-
-###############################################################################
-##
-###############################################################################
-
-
-###############################################################################
-class Ms3dSetSmoothingGroupOperator(Operator):
-    bl_idname = Ms3dUi.OPT_SMOOTHING_GROUP_APPLY
-    bl_label = ms3d_str['BL_LABEL_SMOOTHING_GROUP_OPERATOR']
-    bl_options = {'INTERNAL', }
-
-    smoothing_group_index = IntProperty(
-            name=ms3d_str['PROP_SMOOTHING_GROUP_INDEX'],
-            options={'HIDDEN', 'SKIP_SAVE', },
-            )
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object
-                and blender_context.object.type in {'MESH', }
-                and blender_context.object.data
-                and blender_context.object.data.ms3d is not None
-                and blender_context.mode == 'EDIT_MESH'
-                and blender_context.tool_settings.mesh_select_mode[2]
-                )
-
-    def execute(self, blender_context):
-        custom_data = blender_context.object.data.ms3d
-        blender_mesh = blender_context.object.data
-        bm = from_edit_mesh(blender_mesh)
-        layer_smoothing_group = bm.faces.layers.int.get(
-                ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
-        if custom_data.apply_mode in {'SELECT', 'DESELECT', }:
-            if layer_smoothing_group is not None:
-                is_select = (custom_data.apply_mode == 'SELECT')
-                for bmf in bm.faces:
-                    if (bmf[layer_smoothing_group] \
-                            == self.smoothing_group_index):
-                        bmf.select_set(is_select)
-        elif custom_data.apply_mode == 'ASSIGN':
-            if layer_smoothing_group is None:
-                layer_smoothing_group = bm.faces.layers.int.new(
-                        ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
-                blender_mesh_object = blender_context.object
-                get_edge_split_modifier_add_if(blender_mesh_object)
-            blender_face_list = []
-            for bmf in bm.faces:
-                if not bmf.smooth:
-                    bmf.smooth = True
-                if bmf.select:
-                    bmf[layer_smoothing_group] = self.smoothing_group_index
-                    blender_face_list.append(bmf)
-            edge_dict = {}
-            for bmf in blender_face_list:
-                bmf.smooth = True
-                for bme in bmf.edges:
-                    if edge_dict.get(bme) is None:
-                        edge_dict[bme] = 0
-                    else:
-                        edge_dict[bme] += 1
-                    is_border = (edge_dict[bme] == 0)
-                    if is_border:
-                        surround_face_smoothing_group_index \
-                                = self.smoothing_group_index
-                        for bmf in bme.link_faces:
-                            if bmf[layer_smoothing_group] \
-                                    != surround_face_smoothing_group_index:
-                                surround_face_smoothing_group_index \
-                                        = bmf[layer_smoothing_group]
-                                break;
-                        if surround_face_smoothing_group_index \
-                                == self.smoothing_group_index:
-                            is_border = False
-                    bme.seam = is_border
-                    bme.smooth = not is_border
-        bm.free()
-        enable_edit_mode(False, blender_context)
-        enable_edit_mode(True, blender_context)
-        return {'FINISHED', }
-
-
-class Ms3dGroupOperator(Operator):
-    bl_idname = Ms3dUi.OPT_GROUP_APPLY
-    bl_label = ms3d_str['BL_LABEL_GROUP_OPERATOR']
-    bl_options = {'INTERNAL', }
-
-    mode = EnumProperty(
-            items=( ('', "", ""),
-                    ('ADD_GROUP',
-                            ms3d_str['ENUM_ADD_GROUP_1'],
-                            ms3d_str['ENUM_ADD_GROUP_2']),
-                    ('REMOVE_GROUP',
-                            ms3d_str['ENUM_REMOVE_GROUP_1'],
-                            ms3d_str['ENUM_REMOVE_GROUP_2']),
-                    ('ASSIGN',
-                            ms3d_str['ENUM_ASSIGN_1'],
-                            ms3d_str['ENUM_ASSIGN_2_GROUP']),
-                    ('REMOVE',
-                            ms3d_str['ENUM_REMOVE_1'],
-                            ms3d_str['ENUM_REMOVE_2_GROUP']),
-                    ('SELECT',
-                            ms3d_str['ENUM_SELECT_1'],
-                            ms3d_str['ENUM_SELECT_2_GROUP']),
-                    ('DESELECT',
-                            ms3d_str['ENUM_DESELECT_1'],
-                            ms3d_str['ENUM_DESELECT_2_GROUP']),
-                    ),
-            options={'HIDDEN', 'SKIP_SAVE', },
-            )
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object
-                and blender_context.object.type in {'MESH', }
-                and blender_context.object.data
-                and blender_context.object.data.ms3d is not None
-                and blender_context.mode == 'EDIT_MESH'
-                #and blender_context.object.data.ms3d.selected_group_index != -1
-                )
-
-    def execute(self, blender_context):
-        custom_data = blender_context.object.data.ms3d
-        blender_mesh = blender_context.object.data
-        bm = None
-        bm = from_edit_mesh(blender_mesh)
-
-        if self.mode == 'ADD_GROUP':
-            item = custom_data.create_group()
-            layer_group = bm.faces.layers.int.get(
-                    ms3d_str['OBJECT_LAYER_GROUP'])
-            if layer_group is None:
-                bm.faces.layers.int.new(ms3d_str['OBJECT_LAYER_GROUP'])
-
-        elif self.mode == 'REMOVE_GROUP':
-            custom_data.remove_group()
-
-        elif (custom_data.selected_group_index >= 0) and (
-                custom_data.selected_group_index < len(custom_data.groups)):
-            if self.mode in {'SELECT', 'DESELECT', }:
-                layer_group = bm.faces.layers.int.get(
-                        ms3d_str['OBJECT_LAYER_GROUP'])
-                if layer_group is not None:
-                    is_select = (self.mode == 'SELECT')
-                    id = custom_data.groups[
-                            custom_data.selected_group_index].id
-                    for bmf in bm.faces:
-                        if bmf[layer_group] == id:
-                            bmf.select_set(is_select)
-
-            elif self.mode in {'ASSIGN', 'REMOVE', }:
-                layer_group = bm.faces.layers.int.get(
-                        ms3d_str['OBJECT_LAYER_GROUP'])
-                if layer_group is None:
-                    layer_group = bm.faces.layers.int.new(
-                            ms3d_str['OBJECT_LAYER_GROUP'])
-
-                is_assign = (self.mode == 'ASSIGN')
-                id = custom_data.groups[custom_data.selected_group_index].id
-                for bmf in bm.faces:
-                    if bmf.select:
-                        if is_assign:
-                            bmf[layer_group] = id
-                        else:
-                            bmf[layer_group] = -1
-        if bm is not None:
-            bm.free()
-        enable_edit_mode(False, blender_context)
-        enable_edit_mode(True, blender_context)
-        return {'FINISHED', }
-
-
-class Ms3dMaterialOperator(Operator):
-    bl_idname = Ms3dUi.OPT_MATERIAL_APPLY
-    bl_label = ms3d_str['BL_LABEL_MATERIAL_OPERATOR']
-    bl_options = {'INTERNAL', }
-
-    mode = EnumProperty(
-            items=( ('', "", ""),
-                    ('FROM_BLENDER',
-                            ms3d_str['ENUM_FROM_BLENDER_1'],
-                            ms3d_str['ENUM_FROM_BLENDER_2']),
-                    ('TO_BLENDER',
-                            ms3d_str['ENUM_TO_BLENDER_1'],
-                            ms3d_str['ENUM_TO_BLENDER_2']),
-                    ),
-            options={'HIDDEN', 'SKIP_SAVE', },
-            )
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object
-                and blender_context.object.type in {'MESH', }
-                and blender_context.object.data
-                and blender_context.object.data.ms3d is not None
-                and blender_context.material
-                and blender_context.material.ms3d is not None
-                )
-
-    def execute(self, blender_context):
-        blender_material = blender_context.active_object.active_material
-        ms3d_material = blender_material.ms3d
-
-        if self.mode == 'FROM_BLENDER':
-            Ms3dMaterialHelper.copy_from_blender(self, blender_context,
-                    ms3d_material, blender_material)
-            pass
-
-        elif self.mode == 'TO_BLENDER':
-            # not implemented
-            pass
-
-        return {'FINISHED', }
-
-    # entrypoint for option via UI
-    def invoke(self, blender_context, event):
-        return blender_context.window_manager.invoke_props_dialog(self)
-
-
-###############################################################################
-class Ms3dGroupProperties(PropertyGroup):
-    name = StringProperty(
-            name=ms3d_str['PROP_NAME_NAME'],
-            description=ms3d_str['PROP_DESC_GROUP_NAME'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-    flags = EnumProperty(
-            name=ms3d_str['PROP_NAME_FLAGS'],
-            description=ms3d_str['PROP_DESC_FLAGS_GROUP'],
-            items=(#(Ms3dUi.FLAG_NONE, ms3d_str['ENUM_FLAG_NONE_1'],
-                   #         ms3d_str['ENUM_FLAG_NONE_2'],
-                   #         Ms3dSpec.FLAG_NONE),
-                    (Ms3dUi.FLAG_SELECTED,
-                            ms3d_str['ENUM_FLAG_SELECTED_1'],
-                            ms3d_str['ENUM_FLAG_SELECTED_2'],
-                            Ms3dSpec.FLAG_SELECTED),
-                    (Ms3dUi.FLAG_HIDDEN,
-                            ms3d_str['ENUM_FLAG_HIDDEN_1'],
-                            ms3d_str['ENUM_FLAG_HIDDEN_2'],
-                            Ms3dSpec.FLAG_HIDDEN),
-                    (Ms3dUi.FLAG_SELECTED2,
-                            ms3d_str['ENUM_FLAG_SELECTED2_1'],
-                            ms3d_str['ENUM_FLAG_SELECTED2_2'],
-                            Ms3dSpec.FLAG_SELECTED2),
-                    (Ms3dUi.FLAG_DIRTY,
-                            ms3d_str['ENUM_FLAG_DIRTY_1'],
-                            ms3d_str['ENUM_FLAG_DIRTY_2'],
-                            Ms3dSpec.FLAG_DIRTY),
-                    (Ms3dUi.FLAG_ISKEY,
-                            ms3d_str['ENUM_FLAG_ISKEY_1'],
-                            ms3d_str['ENUM_FLAG_ISKEY_2'],
-                            Ms3dSpec.FLAG_ISKEY),
-                    (Ms3dUi.FLAG_NEWLYCREATED,
-                            ms3d_str['ENUM_FLAG_NEWLYCREATED_1'],
-                            ms3d_str['ENUM_FLAG_NEWLYCREATED_2'],
-                            Ms3dSpec.FLAG_NEWLYCREATED),
-                    (Ms3dUi.FLAG_MARKED,
-                            ms3d_str['ENUM_FLAG_MARKED_1'],
-                            ms3d_str['ENUM_FLAG_MARKED_2'],
-                            Ms3dSpec.FLAG_MARKED),
-                    ),
-            default=Ms3dUi.flags_from_ms3d(Ms3dSpec.DEFAULT_FLAGS),
-            options={'ENUM_FLAG', 'ANIMATABLE', },
-            )
-
-    comment = StringProperty(
-            name=ms3d_str['PROP_NAME_COMMENT'],
-            description=ms3d_str['PROP_DESC_COMMENT_GROUP'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-    template_list_controls = StringProperty(
-            default="",
-            options={'HIDDEN', 'SKIP_SAVE', },
-            )
-
-    id = IntProperty(options={'HIDDEN', },)
-
-
-class Ms3dModelProperties(PropertyGroup):
-    name = StringProperty(
-            name=ms3d_str['PROP_NAME_NAME'],
-            description=ms3d_str['PROP_DESC_NAME_MODEL'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-    joint_size = FloatProperty(
-            name=ms3d_str['PROP_NAME_JOINT_SIZE'],
-            description=ms3d_str['PROP_DESC_JOINT_SIZE'],
-            min=Ms3dUi.PROP_JOINT_SIZE_MIN, max=Ms3dUi.PROP_JOINT_SIZE_MAX,
-            precision=Ms3dUi.PROP_JOINT_SIZE_PRECISION, \
-                    step=Ms3dUi.PROP_JOINT_SIZE_STEP,
-            default=Ms3dUi.PROP_DEFAULT_JOINT_SIZE,
-            subtype='FACTOR',
-            #options={'HIDDEN', },
-            )
-
-    transparency_mode = EnumProperty(
-            name=ms3d_str['PROP_NAME_TRANSPARENCY_MODE'],
-            description=ms3d_str['PROP_DESC_TRANSPARENCY_MODE'],
-            items=( (Ms3dUi.MODE_TRANSPARENCY_SIMPLE,
-                            ms3d_str['PROP_MODE_TRANSPARENCY_SIMPLE_1'],
-                            ms3d_str['PROP_MODE_TRANSPARENCY_SIMPLE_2'],
-                            Ms3dSpec.MODE_TRANSPARENCY_SIMPLE),
-                    (Ms3dUi.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES,
-                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_1'],
-                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES_2'],
-                            Ms3dSpec.MODE_TRANSPARENCY_DEPTH_SORTED_TRIANGLES),
-                    (Ms3dUi.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF,
-                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_1'],
-                            ms3d_str['PROP_MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF_2'],
-                            Ms3dSpec.MODE_TRANSPARENCY_DEPTH_BUFFERED_WITH_ALPHA_REF),
-                    ),
-            default=Ms3dUi.transparency_mode_from_ms3d(
-                    Ms3dSpec.DEFAULT_MODEL_TRANSPARENCY_MODE),
-            #options={'HIDDEN', },
-            )
-
-    alpha_ref = FloatProperty(
-            name=ms3d_str['PROP_NAME_ALPHA_REF'],
-            description=ms3d_str['PROP_DESC_ALPHA_REF'],
-            min=0, max=1, precision=3, step=0.1,
-            default=0.5,
-            subtype='FACTOR',
-            #options={'HIDDEN', },
-            )
-
-    comment = StringProperty(
-            name=ms3d_str['PROP_NAME_COMMENT'],
-            description=ms3d_str['PROP_DESC_COMMENT_MODEL'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-    ##########################
-    # ms3d group handling
-    #
-    apply_mode = EnumProperty(
-            items=( ('ASSIGN',
-                            ms3d_str['ENUM_ASSIGN_1'],
-                            ms3d_str['ENUM_ASSIGN_2_SMOOTHING_GROUP']),
-                    ('SELECT',
-                            ms3d_str['ENUM_SELECT_1'],
-                            ms3d_str['ENUM_SELECT_2_SMOOTHING_GROUP']),
-                    ('DESELECT',
-                            ms3d_str['ENUM_DESELECT_1'],
-                            ms3d_str['ENUM_DESELECT_2_SMOOTHING_GROUP']),
-                    ),
-            default='SELECT',
-            options={'HIDDEN', 'SKIP_SAVE', },
-            )
-
-    selected_group_index = IntProperty(
-            default=-1,
-            min=-1,
-            options={'HIDDEN', 'SKIP_SAVE', },
-            )
-    #
-    # ms3d group handling
-    ##########################
-
-    groups = CollectionProperty(
-            type=Ms3dGroupProperties,
-            #options={'HIDDEN', },
-            )
-
-
-    def generate_unique_id(self):
-        return randrange(1, 0x7FFFFFFF) # pseudo unique id
-
-    def create_group(self):
-        item = self.groups.add()
-        item.id = self.generate_unique_id()
-        length = len(self.groups)
-        self.selected_group_index = length - 1
-
-        item.name = ms3d_str['STRING_FORMAT_GROUP'].format(length)
-        return item
-
-    def remove_group(self):
-        index = self.selected_group_index
-        length = len(self.groups)
-        if (index >= 0) and (index < length):
-            if index > 0 or length == 1:
-                self.selected_group_index = index - 1
-            self.groups.remove(index)
-
-
-class Ms3dArmatureProperties(PropertyGroup):
-    name = StringProperty(
-            name=ms3d_str['PROP_NAME_NAME'],
-            description=ms3d_str['PROP_DESC_NAME_ARMATURE'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-
-class Ms3dJointProperties(PropertyGroup):
-    name = StringProperty(
-            name=ms3d_str['PROP_NAME_NAME'],
-            description=ms3d_str['PROP_DESC_NAME_JOINT'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-    flags = EnumProperty(
-            name=ms3d_str['PROP_NAME_FLAGS'],
-            description=ms3d_str['PROP_DESC_FLAGS_JOINT'],
-            items=(#(Ms3dUi.FLAG_NONE,
-                   #         ms3d_str['ENUM_FLAG_NONE_1'],
-                   #         ms3d_str['ENUM_FLAG_NONE_2'],
-                   #         Ms3dSpec.FLAG_NONE),
-                    (Ms3dUi.FLAG_SELECTED,
-                            ms3d_str['ENUM_FLAG_SELECTED_1'],
-                            ms3d_str['ENUM_FLAG_SELECTED_2'],
-                            Ms3dSpec.FLAG_SELECTED),
-                    (Ms3dUi.FLAG_HIDDEN,
-                            ms3d_str['ENUM_FLAG_HIDDEN_1'],
-                            ms3d_str['ENUM_FLAG_HIDDEN_2'],
-                            Ms3dSpec.FLAG_HIDDEN),
-                    (Ms3dUi.FLAG_SELECTED2,
-                            ms3d_str['ENUM_FLAG_SELECTED2_1'],
-                            ms3d_str['ENUM_FLAG_SELECTED2_2'],
-                            Ms3dSpec.FLAG_SELECTED2),
-                    (Ms3dUi.FLAG_DIRTY,
-                            ms3d_str['ENUM_FLAG_DIRTY_1'],
-                            ms3d_str['ENUM_FLAG_DIRTY_2'],
-                            Ms3dSpec.FLAG_DIRTY),
-                    (Ms3dUi.FLAG_ISKEY,
-                            ms3d_str['ENUM_FLAG_ISKEY_1'],
-                            ms3d_str['ENUM_FLAG_ISKEY_2'],
-                            Ms3dSpec.FLAG_ISKEY),
-                    (Ms3dUi.FLAG_NEWLYCREATED,
-                            ms3d_str['ENUM_FLAG_NEWLYCREATED_1'],
-                            ms3d_str['ENUM_FLAG_NEWLYCREATED_2'],
-                            Ms3dSpec.FLAG_NEWLYCREATED),
-                    (Ms3dUi.FLAG_MARKED,
-                            ms3d_str['ENUM_FLAG_MARKED_1'],
-                            ms3d_str['ENUM_FLAG_MARKED_2'],
-                            Ms3dSpec.FLAG_MARKED),
-                    ),
-            default=Ms3dUi.flags_from_ms3d(Ms3dSpec.DEFAULT_FLAGS),
-            options={'ENUM_FLAG', 'ANIMATABLE', },
-            )
-
-    color = FloatVectorProperty(
-            name=ms3d_str['PROP_NAME_COLOR'],
-            description=ms3d_str['PROP_DESC_COLOR_JOINT'],
-            subtype='COLOR', size=3, min=0, max=1, precision=3, step=0.1,
-            default=Ms3dSpec.DEFAULT_JOINT_COLOR,
-            #options={'HIDDEN', },
-            )
-
-    comment = StringProperty(
-            name=ms3d_str['PROP_NAME_COMMENT'],
-            description=ms3d_str['PROP_DESC_COMMENT_JOINT'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-
-class Ms3dMaterialHelper:
-    @staticmethod
-    def copy_to_blender_ambient(cls, blender_context):
-        pass
-
-    @staticmethod
-    def copy_to_blender_diffuse(cls, blender_context):
-        cls.id_data.diffuse_color = cls.diffuse[0:3]
-        #cls.id_data.diffuse_intensity = cls.diffuse[3]
-        pass
-
-    @staticmethod
-    def copy_to_blender_specular(cls, blender_context):
-        cls.id_data.specular_color = cls.specular[0:3]
-        #cls.id_data.specular_intensity = cls.specular[3]
-        pass
-
-    @staticmethod
-    def copy_to_blender_emissive(cls, blender_context):
-        cls.id_data.emit = (cls.emissive[0] + cls.emissive[1] \
-                + cls.emissive[2]) / 3.0
-        pass
-
-    @staticmethod
-    def copy_to_blender_shininess(cls, blender_context):
-        cls.id_data.specular_hardness = cls.shininess * 4.0
-        pass
-
-    @staticmethod
-    def copy_to_blender_transparency(cls, blender_context):
-        cls.id_data.alpha = 1.0 - cls.transparency
-        pass
-
-
-    @staticmethod
-    def copy_from_blender(cls, blender_context, ms3d_material, blender_material):
-        # copy, bacause of auto update, it would distord original values
-        blender_material_diffuse_color = blender_material.diffuse_color.copy()
-        blender_material_diffuse_intensity = blender_material.diffuse_intensity
-        blender_material_specular_color = blender_material.specular_color.copy()
-        blender_material_specular_intensity = \
-                blender_material.specular_intensity
-        blender_material_emit = blender_material.emit
-        blender_material_specular_hardness = \
-                blender_material.specular_hardness
-        blender_material_alpha = blender_material.alpha
-
-        blender_material_texture = None
-        for slot in blender_material.texture_slots:
-            if slot and slot.use_map_color_diffuse \
-                    and slot.texture.type == 'IMAGE':
-                blender_material_texture = slot.texture.image.filepath
-                break
-
-        blender_material_alphamap = None
-        for slot in blender_material.texture_slots:
-            if slot and not slot.use_map_color_diffuse \
-                    and slot.use_map_alpha and slot.texture.type == 'IMAGE':
-                blender_material_alphamap = slot.texture.image.filepath
-                break
-
-        ms3d_material.diffuse[0] = blender_material_diffuse_color[0]
-        ms3d_material.diffuse[1] = blender_material_diffuse_color[1]
-        ms3d_material.diffuse[2] = blender_material_diffuse_color[2]
-        ms3d_material.diffuse[3] = 1.0
-        ms3d_material.specular[0] = blender_material_specular_color[0]
-        ms3d_material.specular[1] = blender_material_specular_color[1]
-        ms3d_material.specular[2] = blender_material_specular_color[2]
-        ms3d_material.specular[3] = 1.0
-        ms3d_material.emissive[0] = blender_material_emit
-        ms3d_material.emissive[1] = blender_material_emit
-        ms3d_material.emissive[2] = blender_material_emit
-        ms3d_material.emissive[3] = 1.0
-        ms3d_material.shininess = blender_material_specular_hardness / 4.0
-        ms3d_material.transparency = 1.0 - blender_material_alpha
-
-        if blender_material_texture:
-            ms3d_material.texture = blender_material_texture
-        else:
-            ms3d_material.texture = ""
-
-        if blender_material_alphamap:
-            ms3d_material.alphamap = blender_material_alphamap
-        else:
-            ms3d_material.alphamap = ""
-
-
-class Ms3dMaterialProperties(PropertyGroup):
-    name = StringProperty(
-            name=ms3d_str['PROP_NAME_NAME'],
-            description=ms3d_str['PROP_DESC_NAME_MATERIAL'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-    ambient = FloatVectorProperty(
-            name=ms3d_str['PROP_NAME_AMBIENT'],
-            description=ms3d_str['PROP_DESC_AMBIENT'],
-            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
-            default=Ms3dSpec.DEFAULT_MATERIAL_AMBIENT,
-            update=Ms3dMaterialHelper.copy_to_blender_ambient,
-            #options={'HIDDEN', },
-            )
-
-    diffuse = FloatVectorProperty(
-            name=ms3d_str['PROP_NAME_DIFFUSE'],
-            description=ms3d_str['PROP_DESC_DIFFUSE'],
-            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
-            default=Ms3dSpec.DEFAULT_MATERIAL_DIFFUSE,
-            update=Ms3dMaterialHelper.copy_to_blender_diffuse,
-            #options={'HIDDEN', },
-            )
-
-    specular = FloatVectorProperty(
-            name=ms3d_str['PROP_NAME_SPECULAR'],
-            description=ms3d_str['PROP_DESC_SPECULAR'],
-            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
-            default=Ms3dSpec.DEFAULT_MATERIAL_SPECULAR,
-            update=Ms3dMaterialHelper.copy_to_blender_specular,
-            #options={'HIDDEN', },
-            )
-
-    emissive = FloatVectorProperty(
-            name=ms3d_str['PROP_NAME_EMISSIVE'],
-            description=ms3d_str['PROP_DESC_EMISSIVE'],
-            subtype='COLOR', size=4, min=0, max=1, precision=3, step=0.1,
-            default=Ms3dSpec.DEFAULT_MATERIAL_EMISSIVE,
-            update=Ms3dMaterialHelper.copy_to_blender_emissive,
-            #options={'HIDDEN', },
-            )
-
-    shininess = FloatProperty(
-            name=ms3d_str['PROP_NAME_SHININESS'],
-            description=ms3d_str['PROP_DESC_SHININESS'],
-            min=0, max=Ms3dSpec.MAX_MATERIAL_SHININESS, precision=3, step=0.1,
-            default=Ms3dSpec.DEFAULT_MATERIAL_SHININESS,
-            subtype='FACTOR',
-            update=Ms3dMaterialHelper.copy_to_blender_shininess,
-            #options={'HIDDEN', },
-            )
-
-    transparency = FloatProperty(
-            name=ms3d_str['PROP_NAME_TRANSPARENCY'],
-            description=ms3d_str['PROP_DESC_TRANSPARENCY'],
-            min=0, max=1, precision=3, step=0.1,
-            default=0,
-            subtype='FACTOR',
-            update=Ms3dMaterialHelper.copy_to_blender_transparency,
-            #options={'HIDDEN', },
-            )
-
-    mode = EnumProperty(
-            name=ms3d_str['PROP_NAME_MODE'],
-            description=ms3d_str['PROP_DESC_MODE_TEXTURE'],
-            items=( (Ms3dUi.FLAG_TEXTURE_COMBINE_ALPHA,
-                            ms3d_str['PROP_FLAG_TEXTURE_COMBINE_ALPHA_1'],
-                            ms3d_str['PROP_FLAG_TEXTURE_COMBINE_ALPHA_2'],
-                            Ms3dSpec.FLAG_TEXTURE_COMBINE_ALPHA),
-                    (Ms3dUi.FLAG_TEXTURE_HAS_ALPHA,
-                            ms3d_str['PROP_FLAG_TEXTURE_HAS_ALPHA_1'],
-                            ms3d_str['PROP_FLAG_TEXTURE_HAS_ALPHA_2'],
-                            Ms3dSpec.FLAG_TEXTURE_HAS_ALPHA),
-                    (Ms3dUi.FLAG_TEXTURE_SPHERE_MAP,
-                            ms3d_str['PROP_FLAG_TEXTURE_SPHERE_MAP_1'],
-                            ms3d_str['PROP_FLAG_TEXTURE_SPHERE_MAP_2'],
-                            Ms3dSpec.FLAG_TEXTURE_SPHERE_MAP),
-                    ),
-            default=Ms3dUi.texture_mode_from_ms3d(
-                    Ms3dSpec.DEFAULT_MATERIAL_MODE),
-            options={'ANIMATABLE', 'ENUM_FLAG', },
-            )
-
-    texture = StringProperty(
-            name=ms3d_str['PROP_NAME_TEXTURE'],
-            description=ms3d_str['PROP_DESC_TEXTURE'],
-            default="",
-            subtype = 'FILE_PATH'
-            #options={'HIDDEN', },
-            )
-
-    alphamap = StringProperty(
-            name=ms3d_str['PROP_NAME_ALPHAMAP'],
-            description=ms3d_str['PROP_DESC_ALPHAMAP'],
-            default="",
-            subtype = 'FILE_PATH'
-            #options={'HIDDEN', },
-            )
-
-    comment = StringProperty(
-            name=ms3d_str['PROP_NAME_COMMENT'],
-            description=ms3d_str['PROP_DESC_COMMENT_MATERIAL'],
-            default="",
-            #options={'HIDDEN', },
-            )
-
-
-###############################################################################
-class Ms3dMeshPanel(Panel):
-    bl_label = ms3d_str['LABEL_PANEL_MODEL']
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'object'
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object
-                and blender_context.object.type in {'MESH', }
-                and blender_context.object.data
-                and blender_context.object.data.ms3d is not None
-                )
-
-    def draw_header(self, blender_context):
-        layout = self.layout
-        layout.label(icon='PLUGIN')
-
-    def draw(self, blender_context):
-        layout = self.layout
-        custom_data = blender_context.object.data.ms3d
-
-        row = layout.row()
-        row.prop(custom_data, 'name')
-
-        col = layout.column()
-        row = col.row()
-        row.prop(custom_data, 'joint_size')
-        row = col.row()
-        row.prop(custom_data, 'transparency_mode')
-        row = col.row()
-        row.prop(custom_data, 'alpha_ref', )
-
-        row = layout.row()
-        row.prop(custom_data, 'comment')
-
-
-class Ms3dMaterialPanel(Panel):
-    bl_label = ms3d_str['LABEL_PANEL_MATERIALS']
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'material'
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object
-                and blender_context.object.type in {'MESH', }
-                and blender_context.object.data
-                and blender_context.object.data.ms3d is not None
-                and blender_context.material
-                and blender_context.material.ms3d is not None
-                )
-
-    def draw_header(self, blender_context):
-        layout = self.layout
-        layout.label(icon='PLUGIN')
-
-    def draw(self, blender_context):
-        layout = self.layout
-        custom_data = blender_context.material.ms3d
-
-        row = layout.row()
-        row.prop(custom_data, 'name')
-
-        col = layout.column()
-        row = col.row()
-        row.prop(custom_data, 'diffuse')
-        row.prop(custom_data, 'ambient')
-        row = col.row()
-        row.prop(custom_data, 'specular')
-        row.prop(custom_data, 'emissive')
-        row = col.row()
-        row.prop(custom_data, 'shininess')
-        row.prop(custom_data, 'transparency')
-
-        col = layout.column()
-        row = col.row()
-        row.prop(custom_data, 'texture')
-        row = col.row()
-        row.prop(custom_data, 'alphamap')
-        row = col.row()
-        row.prop(custom_data, 'mode', expand=True)
-
-        row = layout.row()
-        row.prop(custom_data, 'comment')
-
-        layout.row().operator(
-                Ms3dUi.OPT_MATERIAL_APPLY,
-                text=ms3d_str['ENUM_FROM_BLENDER_1'],
-                icon='APPEND_BLEND').mode = 'FROM_BLENDER'
-        pass
-
-
-class Ms3dBonePanel(Panel):
-    bl_label = ms3d_str['LABEL_PANEL_JOINTS']
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'bone'
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object.type in {'ARMATURE', }
-                and blender_context.active_bone
-                and isinstance(blender_context.active_bone, Bone)
-                and blender_context.active_bone.ms3d is not None
-                )
-
-    def draw_header(self, blender_context):
-        layout = self.layout
-        layout.label(icon='PLUGIN')
-
-    def draw(self, blender_context):
-        import bpy
-        layout = self.layout
-        custom_data = blender_context.active_bone.ms3d
-
-        row = layout.row()
-        row.prop(custom_data, 'name')
-        row = layout.row()
-        row.prop(custom_data, 'flags', expand=True)
-        row = layout.row()
-        row.prop(custom_data, 'color')
-        row = layout.row()
-        row.prop(custom_data, 'comment')
-
-
-class Ms3dGroupPanel(Panel):
-    bl_label = ms3d_str['LABEL_PANEL_GROUPS']
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'data'
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object
-                and blender_context.object.type in {'MESH', }
-                and blender_context.object.data
-                and blender_context.object.data.ms3d is not None
-                )
-
-    def draw_header(self, blender_context):
-        layout = self.layout
-        layout.label(icon='PLUGIN')
-
-    def draw(self, blender_context):
-        layout = self.layout
-        custom_data = blender_context.object.data.ms3d
-        layout.enabled = (blender_context.mode == 'EDIT_MESH') and (
-                blender_context.tool_settings.mesh_select_mode[2])
-
-        row = layout.row()
-        row.template_list(
-                custom_data, 'groups',
-                custom_data, 'selected_group_index',
-                prop_list='template_list_controls',
-                rows=2,
-                type='DEFAULT',
-                )
-
-        col = row.column(align=True)
-        col.operator(
-                Ms3dUi.OPT_GROUP_APPLY,
-                text="", icon='ZOOMIN').mode = 'ADD_GROUP'
-        col.operator(
-                Ms3dUi.OPT_GROUP_APPLY,
-                text="", icon='ZOOMOUT').mode = 'REMOVE_GROUP'
-
-        index = custom_data.selected_group_index
-        collection = custom_data.groups
-        if (index >= 0 and index < len(collection)):
-            row = layout.row()
-            row.prop(collection[index], 'name')
-
-            row = layout.row()
-            subrow = row.row(align=True)
-            subrow.operator(
-                    Ms3dUi.OPT_GROUP_APPLY,
-                    text=ms3d_str['ENUM_ASSIGN_1']).mode = 'ASSIGN'
-            subrow.operator(
-                    Ms3dUi.OPT_GROUP_APPLY,
-                    text=ms3d_str['ENUM_REMOVE_1']).mode = 'REMOVE'
-            subrow = row.row(align=True)
-            subrow.operator(
-                    Ms3dUi.OPT_GROUP_APPLY,
-                    text=ms3d_str['ENUM_SELECT_1']).mode = 'SELECT'
-            subrow.operator(
-                    Ms3dUi.OPT_GROUP_APPLY,
-                    text=ms3d_str['ENUM_DESELECT_1']).mode = 'DESELECT'
-
-            row = layout.row()
-            row.prop(collection[index], 'flags', expand=True)
-
-            row = layout.row()
-            row.prop(collection[index], 'comment')
-
-
-class Ms3dSmoothingGroupPanel(Panel):
-    bl_label = ms3d_str['BL_LABEL_PANEL_SMOOTHING_GROUP']
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'data'
-
-    def preview(self, dict, id, text):
-        item = dict.get(id)
-        if item is None:
-            return "{}".format(text)
-        elif item:
-            return "{}:".format(text)
-
-        return "{}.".format(text)
-
-    def build_preview(self, blender_context):
-        dict = {}
-        if (blender_context.mode != 'EDIT_MESH') or (
-                not blender_context.tool_settings.mesh_select_mode[2]):
-            return dict
-
-        custom_data = blender_context.object.data.ms3d
-        blender_mesh = blender_context.object.data
-        bm = from_edit_mesh(blender_mesh)
-        layer_smoothing_group = bm.faces.layers.int.get(
-                ms3d_str['OBJECT_LAYER_SMOOTHING_GROUP'])
-        if layer_smoothing_group is not None:
-            for bmf in bm.faces:
-                item = dict.get(bmf[layer_smoothing_group])
-                if item is None:
-                    dict[bmf[layer_smoothing_group]] = bmf.select
-                else:
-                    if not item:
-                        dict[bmf[layer_smoothing_group]] = bmf.select
-        return dict
-
-    @classmethod
-    def poll(cls, blender_context):
-        return (blender_context
-                and blender_context.object
-                and blender_context.object.type in {'MESH', }
-                and blender_context.object.data
-                and blender_context.object.data.ms3d is not None
-                )
-
-    def draw_header(self, blender_context):
-        layout = self.layout
-        layout.label(icon='PLUGIN')
-
-    def draw(self, blender_context):
-        dict = self.build_preview(blender_context)
-
-        custom_data = blender_context.object.data.ms3d
-        layout = self.layout
-        layout.enabled = (blender_context.mode == 'EDIT_MESH') and (
-                blender_context.tool_settings.mesh_select_mode[2])
-
-        row = layout.row()
-        subrow = row.row()
-        subrow.prop(custom_data, 'apply_mode', expand=True)
-
-        col = layout.column(align=True)
-        subrow = col.row(align=True)
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 1, "1")
-                ).smoothing_group_index = 1
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 2, "2")
-                ).smoothing_group_index = 2
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 3, "3")
-                ).smoothing_group_index = 3
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 4, "4")
-                ).smoothing_group_index = 4
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 5, "5")
-                ).smoothing_group_index = 5
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 6, "6")
-                ).smoothing_group_index = 6
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 7, "7")
-                ).smoothing_group_index = 7
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 8, "8")
-                ).smoothing_group_index = 8
-        subrow = col.row(align=True)
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 9, "9")
-                ).smoothing_group_index = 9
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 10, "10")
-                ).smoothing_group_index = 10
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 11, "11")
-                ).smoothing_group_index = 11
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 12, "12")
-                ).smoothing_group_index = 12
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 13, "13")
-                ).smoothing_group_index = 13
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 14, "14")
-                ).smoothing_group_index = 14
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 15, "15")
-                ).smoothing_group_index = 15
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 16, "16")
-                ).smoothing_group_index = 16
-        subrow = col.row(align=True)
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 17, "17")
-                ).smoothing_group_index = 17
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 18, "18")
-                ).smoothing_group_index = 18
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 19, "19")
-                ).smoothing_group_index = 19
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 20, "20")
-                ).smoothing_group_index = 20
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 21, "21")
-                ).smoothing_group_index = 21
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 22, "22")
-                ).smoothing_group_index = 22
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 23, "23")
-                ).smoothing_group_index = 23
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 24, "24")
-                ).smoothing_group_index = 24
-        subrow = col.row(align=True)
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 25, "25")
-                ).smoothing_group_index = 25
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 26, "26")
-                ).smoothing_group_index = 26
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 27, "27")
-                ).smoothing_group_index = 27
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 28, "28")
-                ).smoothing_group_index = 28
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 29, "29")
-                ).smoothing_group_index = 29
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 30, "30")
-                ).smoothing_group_index = 30
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 31, "31")
-                ).smoothing_group_index = 31
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 32, "32")
-                ).smoothing_group_index = 32
-        subrow = col.row()
-        subrow.operator(
-                Ms3dUi.OPT_SMOOTHING_GROUP_APPLY,
-                text=self.preview(dict, 0, ms3d_str['LABEL_PANEL_BUTTON_NONE'])
-                ).smoothing_group_index = 0
-
-
-###############################################################################
-class Ms3dSetSceneToMetricOperator(Operator):
-    """ . """
-    bl_idname = 'io_scene_ms3d.set_sence_to_metric'
-    bl_label = ms3d_str['BL_LABEL_SET_SCENE_TO_METRIC']
-    bl_description = ms3d_str['BL_DESC_SET_SCENE_TO_METRIC']
-
-
-    #
-    @classmethod
-    def poll(cls, blender_context):
-        return True
-
-    # entrypoint for option
-    def execute(self, blender_context):
-        return self.set_sence_to_metric(blender_context)
-
-    # entrypoint for option via UI
-    def invoke(self, blender_context, event):
-        return blender_context.window_manager.invoke_props_dialog(self)
-
-
-    ###########################################################################
-    def set_sence_to_metric(self, blender_context):
-        set_sence_to_metric(blender_context)
-        return {"FINISHED"}
-
-
-###############################################################################
-def register():
-    register_class(Ms3dSetSceneToMetricOperator)
-    register_class(Ms3dGroupProperties)
-    register_class(Ms3dModelProperties)
-    register_class(Ms3dArmatureProperties)
-    register_class(Ms3dJointProperties)
-    register_class(Ms3dMaterialProperties)
-    inject_properties()
-    register_class(Ms3dSetSmoothingGroupOperator)
-    register_class(Ms3dGroupOperator)
-
-def unregister():
-    unregister_class(Ms3dGroupOperator)
-    unregister_class(Ms3dSetSmoothingGroupOperator)
-    delete_properties()
-    unregister_class(Ms3dMaterialProperties)
-    unregister_class(Ms3dJointProperties)
-    unregister_class(Ms3dArmatureProperties)
-    unregister_class(Ms3dModelProperties)
-    unregister_class(Ms3dGroupProperties)
-    unregister_class(Ms3dSetSceneToMetricOperator)
-
-def inject_properties():
-    Mesh.ms3d = PointerProperty(type=Ms3dModelProperties)
-    Armature.ms3d = PointerProperty(type=Ms3dArmatureProperties)
-    Bone.ms3d = PointerProperty(type=Ms3dJointProperties)
-    Material.ms3d = PointerProperty(type=Ms3dMaterialProperties)
-    Action.ms3d = PointerProperty(type=Ms3dArmatureProperties)
-    Group.ms3d = PointerProperty(type=Ms3dGroupProperties)
-
-def delete_properties():
-    del Mesh.ms3d
-    del Armature.ms3d
-    del Bone.ms3d
-    del Material.ms3d
-    del Action.ms3d
-    del Group.ms3d
-
-###############################################################################
-
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-# ##### END OF FILE #####
diff --git a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_utils.py b/release/scripts/addons_contrib/io_scene_ms3d/ms3d_utils.py
deleted file mode 100644
index c6a885e..0000000
--- a/release/scripts/addons_contrib/io_scene_ms3d/ms3d_utils.py
+++ /dev/null
@@ -1,225 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-
-
-# ##### BEGIN COPYRIGHT BLOCK #####
-#
-# initial script copyright (c)2011,2012 Alexander Nussbaumer
-#
-# ##### END COPYRIGHT BLOCK #####
-
-
-#import python stuff
-from os import (
-        path
-        )
-
-
-# import io_scene_ms3d stuff
-from io_scene_ms3d.ms3d_strings import (
-        ms3d_str,
-        )
-
-
-#import blender stuff
-from bpy import (
-        ops,
-        )
-
-
-###############################################################################
-def enable_edit_mode(enable, blender_context):
-    if blender_context.active_object is None \
-            or not blender_context.active_object.type in {'MESH', 'ARMATURE', }:
-        return
-
-    if enable:
-        modeString = 'EDIT'
-    else:
-        modeString = 'OBJECT'
-
-    if ops.object.mode_set.poll():
-        ops.object.mode_set(mode=modeString)
-
-
-###############################################################################
-def enable_pose_mode(enable, blender_context):
-    if blender_context.active_object is None \
-            or not blender_context.active_object.type in {'ARMATURE', }:
-        return
-
-    if enable:
-        modeString = 'POSE'
-    else:
-        modeString = 'OBJECT'
-
-    if ops.object.mode_set.poll():
-        ops.object.mode_set(mode=modeString)
-
-
-###############################################################################
-def select_all(select):
-    if select:
-        actionString = 'SELECT'
-    else:
-        actionString = 'DESELECT'
-
-    if ops.object.select_all.poll():
-        ops.object.select_all(action=actionString)
-
-    if ops.mesh.select_all.poll():
-        ops.mesh.select_all(action=actionString)
-
-    if ops.pose.select_all.poll():
-        ops.pose.select_all(action=actionString)
-
-
-###############################################################################
-def pre_setup_environment(porter, blender_context):
-    # inject undo to porter
-    # and turn off undo
-    porter.undo = blender_context.user_preferences.edit.use_global_undo
-    blender_context.user_preferences.edit.use_global_undo = False
-
-    # inject active_object to self
-    porter.active_object = blender_context.scene.objects.active
-
-    # change to a well defined mode
-    enable_edit_mode(True, blender_context)
-
-    # enable face-selection-mode
-    blender_context.tool_settings.mesh_select_mode = (False, False, True)
-
-    # change back to object mode
-    enable_edit_mode(False, blender_context)
-
-    blender_context.scene.update()
-
-    # inject splitted filepath
-    porter.filepath_splitted = path.split(porter.options.filepath)
-
-
-###############################################################################
-def post_setup_environment(porter, blender_context):
-    # restore active object
-    blender_context.scene.objects.active = porter.active_object
-
-    if not blender_context.scene.objects.active \
-            and blender_context.selected_objects:
-        blender_context.scene.objects.active \
-                = blender_context.selected_objects[0]
-
-    # restore pre operator undo state
-    blender_context.user_preferences.edit.use_global_undo = porter.undo
-
-
-###############################################################################
-def get_edge_split_modifier_add_if(blender_mesh_object):
-    blender_modifier = blender_mesh_object.modifiers.get(
-            ms3d_str['OBJECT_MODIFIER_SMOOTHING_GROUP'])
-
-    if blender_modifier is None:
-        blender_modifier = blender_mesh_object.modifiers.new(
-                ms3d_str['OBJECT_MODIFIER_SMOOTHING_GROUP'],
-                type='EDGE_SPLIT')
-        blender_modifier.show_expanded = False
-        blender_modifier.use_edge_angle = False
-        blender_modifier.use_edge_sharp = True
-
-        blender_mesh_object.data.show_edge_seams = True
-        blender_mesh_object.data.show_edge_sharp = True
-
-    return blender_modifier
-
-
-###########################################################################
-def rotation_matrix(v_track, v_up):
-    ## rotation matrix from two vectors
-    ## http://gamedev.stackexchange.com/questions/20097/how-to-calculate-a-3x3-rotation-matrix-from-2-direction-vectors
-    ## http://www.fastgraph.com/makegames/3drotation/
-    matrix = Matrix().to_3x3()
-
-    c1 = v_track
-    c1.normalize()
-
-    c0 = c1.cross(v_up)
-    c0.normalize()
-
-    c2 = c0.cross(c1)
-    c2.normalize()
-
-    matrix.col[0] = c0
-    matrix.col[1] = c1
-    matrix.col[2] = c2
-
-    return matrix
-
-
-###############################################################################
-def matrix_difference(mat_src, mat_dst):
-    mat_dst_inv = mat_dst.copy()
-    mat_dst_inv.invert()
-    return mat_dst_inv * mat_src
-
-
-###############################################################################
-def set_sence_to_metric(blender_context):
-    try:
-        # set metrics
-        blender_context.scene.unit_settings.system = 'METRIC'
-        blender_context.scene.unit_settings.system_rotation = 'DEGREES'
-        blender_context.scene.unit_settings.scale_length = 0.001 # 1.0mm
-        blender_context.scene.unit_settings.use_separate = False
-        blender_context.tool_settings.normal_size = 1.0 # 1.0mm
-
-        # set all 3D views to texture shaded
-        # and set up the clipping
-        for screen in blender_context.blend_data.screens:
-            for area in screen.areas:
-                if (area.type != 'VIEW_3D'):
-                    continue
-
-                for space in area.spaces:
-                    if (space.type != 'VIEW_3D'):
-                        continue
-
-                    #space.viewport_shade = 'SOLID'
-                    space.show_textured_solid = True
-                    space.clip_start = 0.1 # 0.1mm
-                    space.clip_end = 1000000.0 # 1km
-            #screen.scene.game_settings.material_mode = 'MULTITEXTURE'
-
-    except Exception:
-        raise
-
-    else:
-        pass
-
-
-###############################################################################
-
-###############################################################################
-#234567890123456789012345678901234567890123456789012345678901234567890123456789
-#--------1---------2---------3---------4---------5---------6---------7---------
-# ##### END OF FILE #####
diff --git a/release/scripts/addons_contrib/io_scene_open_street_map.py b/release/scripts/addons_contrib/io_scene_open_street_map.py
deleted file mode 100644
index d3f2866..0000000
--- a/release/scripts/addons_contrib/io_scene_open_street_map.py
+++ /dev/null
@@ -1,370 +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 LICENCE BLOCK *****
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Open Street Map (.osm)",
-    "author": "Michael Anthrax Schlachter, ideasman42, littleneo",
-    "version": (0, 2),
-    "blender": (2, 63, 0),
-    "location": "File > Import",
-    "description": "Load Open Street Map File",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Import-Export"}
-
-# originally written for blender 2.4x by (manthrax _at_ hotmail.com),
-# updated for blender 2.6x by ideasman42
-# If you use it for something cool, send me an email and let me know!
-
-# littleneo (v0.2 - september 2012) :
-
-## added a lat/lon to UTM conversion option geoToUTM() :
-# the generated mesh now almost match the exported osm image of the same area, just play with scale and rotate a bit.
-
-## added ability to retrieve openstreet tags as vertex groups :
-# add every way id as a vgroup if the tag exists in osmkeys.
-# add nodes id as vgroup  if the tag value pair exists in osmvals.
-# any elligible is added in the corresponding osmkeys or value ('_V_...'  vgroup
-
-## added bpy access to addon : 
-# bpy.ops.import_mesh.osm(filepath="....", scale=100, utm=False, tag=False)
-
-## added custom properties to generated object so it can be used as source for other osm related scripts :
-# osmfile   path to osm xml file
-# tagged   bool. osm tags included
-# utm       bool. default True
-
-# modified the matrix approximation for utm = False
-# ! corrected lat/lon x/y mismatch
-
-import bpy
-from mathutils import Vector, Matrix
-import math
-from math import radians, sin, cos, tan, sqrt
-
-## add more osm tags here.
-# http://wiki.openstreetmap.org/wiki/Map_Features
-osmkeys = [
-    'highway',
-    'barrier',
-    'wall',
-    'cycleway',
-    'bicycle',
-    'waterway',
-    'railway',
-    'aeroway',
-    'aerialway',
-    'power',
-    'man_made',
-    'building',
-    'leisure',
-    'amenity',
-    'office',
-    'shop',
-    'craft',
-    'emergency',
-    'tourism',
-    'historic',
-    'landuse',
-    'military',
-    'natural',
-]
-
-# just a try for nodes, for retrieving v tag values.
-# keyname must exists in osmkeys
-osmvals = {'highway':['traffic_signals']}
-
-# vertex group name -> vertex group index lookup
-grouplookup = {}
-
-def parseBranch(nodes, bm, nmap, obj, scale=100.0, tag=False, UTM=False):
-    vgroups = bm.verts.layers.deform.verify()
-    tidx = 0
-    inNode = 0
-    dlat = dlong = clat = clong = minlat = maxlat = minlong = maxlong = 0.0
-    for node in nodes:
-        if node.localName == "bounds":
-            if node.hasAttributes():
-                for i in range(node.attributes.length):
-                    at = node.attributes.item(i)
-                    if at.name == "minlat":
-                        minlat = float(at.nodeValue)
-                    elif at.name == "minlon":
-                        minlong = float(at.nodeValue)
-                    elif at.name == "maxlat":
-                        maxlat = float(at.nodeValue)
-                    elif at.name == "maxlon":
-                        maxlong = float(at.nodeValue)
-                dlat = maxlat - minlat
-                dlong = maxlong - minlong
-                clat = (maxlat + minlat) * 0.5
-                clong = (maxlong + minlong) * 0.5
-                
-                if UTM : 
-                    dlong, dlat = geoToUTM(dlong, dlat)
-                    clong, clat = geoToUTM(clong, clat)
-
-                print(dlat, dlong, clat, clong)
-
-        if node.localName == "way":
-            
-            wayid = node.getAttribute('id')
-            nid = None
-            refs = []
-            if tag :
-                group = obj.vertex_groups.new('way_%s'%wayid)
-                gid = len(obj.vertex_groups) -1
-            '''
-            if node.hasAttributes():
-                for i in range(node.attributes.length):
-                    at=node.attributes.item(i)
-                    print(at.name)
-            '''
-
-            if tag :
-                metagid = []
-                for ch in node.childNodes:
-                    if ch.localName == "tag":
-                        key = ch.getAttribute('k')
-                        if key in osmkeys :
-                            metagid.append(grouplookup[key])
-
-            for ch in node.childNodes:
-                if ch.localName == "nd":
-                    for i in range(ch.attributes.length):
-                        at = ch.attributes.item(i)
-                        if at.name == "ref":
-                            vid = int(at.nodeValue)
-                            refs.append(vid)
-                            if tag :
-                                vert = nmap[vid]
-                                weigths = vert[vgroups]
-                                weigths[gid] = 1.0
-                                for mid in metagid : weigths[mid] = 1.0
-                
-            first = 1
-            for r in refs:
-                if first == 0:
-                    edge = bm.edges.get((nmap[pr], nmap[r]))
-                    if edge is None:
-                        edge = bm.edges.new((nmap[pr], nmap[r]))
-                    del edge  # don't actually use it
-                else:
-                    first = 0
-                pr = r
-
-        if node.localName == "node":
-            if node.hasAttributes():
-                nid = node.getAttribute('id')
-                nlong = node.getAttribute('lon')
-                nlat = node.getAttribute('lat')
-
-                # is this test necessary ? maybe for faulty .osm files
-                if (nid != '') and (nlat != '') and (nlong != '') :
-
-                    if UTM : 
-                        nlong, nlat = geoToUTM(float(nlong),float(nlat))
-                    else :
-                        nlat = float(nlat)
-                        nlong = float(nlong)
-                    
-                    x = (nlong - clong) * scale / dlat
-                    y = (nlat - clat) * scale / dlat
-                    vert = bm.verts.new((x, y, 0.0))
-                    nmap[int(nid)] = vert
-                    if tag :
-                        metagid = []
-                        for ch in node.childNodes:
-                            if ch.localName == "tag":
-                                key = ch.getAttribute('k')
-                                val = ch.getAttribute('v')
-                                if key in osmvals and val in osmvals[key] :
-                                    metagid.append(grouplookup[key])
-                                    metagid.append(grouplookup['_V_'+val])
-                                    weigths = vert[vgroups]
-                                    group = obj.vertex_groups.new('node_%s'%nid)
-                                    gid = len(obj.vertex_groups) -1
-                                    weigths[gid] = 1.0
-                                    for mid in metagid : weigths[mid] = 1.0
-
-                else : print('node is missing some elements : %s %s %s'%(nid,nlat,nlong))
-
-        tidx += 1
-        #if tidx > 1000:
-        #    break
-        tidx += parseBranch(node.childNodes, bm, nmap, obj,scale,tag,UTM)
-
-    return tidx
-
-def read(context, filepath, scale=100.0, tag=False, utm=False) :
-    import bmesh
-    from xml.dom import minidom
-
-    # create mesh
-    bm = bmesh.new()
-    name = bpy.path.display_name_from_filepath(filepath)
-    me = bpy.data.meshes.new(name)    
-    obj = bpy.data.objects.new(name, me)
-
-    # osm tags option
-    if tag :
-        tvid = 0
-        for gid, grname in enumerate(osmkeys) :
-            obj.vertex_groups.new('_'+grname)
-            grouplookup[grname] = gid + tvid
-            if grname in osmvals :
-                for val in osmvals[grname] :
-                    tvid += 1
-                    obj.vertex_groups.new('_V_'+val)
-                    grouplookup['_V_'+val] = gid + tvid
-
-    # get xml then feed bmesh
-    print("Reading xml...")
-    xmldoc = minidom.parse(filepath)
-    
-    print("Starting parse: %r..." % filepath)
-    nmap = {}
-    tidx = parseBranch(xmldoc.childNodes, bm, nmap, obj,scale,tag,utm)
-
-    bm.to_mesh(me)
-
-    # fast approximation of utm for not too big area
-    if utm is False :
-        global_matrix = Matrix(((0.65, 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)))
-        me.transform(global_matrix)
-
-    # create the object in the scene
-    scene = context.scene
-    scene.objects.link(obj)
-    scene.objects.active = obj
-    obj.select = True
-
-    # entry points for other addons
-    obj['osmfile'] = filepath
-    obj['tagged'] = tag
-    obj['utm'] = utm
-
-    print("Parse done... %d" % tidx)
-
-    return {'FINISHED'}
-
-# given lat and longitude in degrees, returns x and y in UTM kilometers.
-# accuracy : supposed to be centimeter :)
-# http://fr.wikipedia.org/wiki/Projection_UTM
-# http://fr.wikipedia.org/wiki/WGS_84
-# http://earth-info.nga.mil/GandG/publications/tr8350.2/wgs84fin.pdf
-# http://geodesie.ign.fr/contenu/fichiers/documentation/algorithmes/alg0071.pdf
-def geoToUTM(lon, lat) :
-
-    # if abs(lat) > 80 : lat = 80 #wrong coords.
-    
-    # UTM zone, longitude origin, then lat lon in radians
-    z = int( (lon + 180)  / 6 ) + 1
-    lon0 = radians(6*z - 183)
-    lat = radians(lat)
-    lon = radians(lon)
-
-    # CONSTANTS (see refs.)
-    # rayon de la terre à l'équateur
-    a = 6378.137
-    K0 = 0.9996
-    # flattening consts
-    f  = 0.0033528106647474805  # 1 / 298.257223563
-    e2 = 0.0066943799901413165  # 2*f - f**2
-    e4 = 4.481472345240445e-05  # e2**2
-    e6 = 3.0000678794349315e-07 # e2**3
-
-    # lat0. 10000 for South, 0 for North
-    N0 = 10000 if lat < 0 else 0
-
-    # wiki is your friend (don't ask me Im just a writing monkey.)
-    A = (lon - lon0) * cos(lat)
-    C = (e2 / (1 - e2)) * cos(lat)**2
-    T = tan(lat)**2
-    vlat = 1 / sqrt( 1 - e2 * sin(lat)**2 )
-    slat = (1-(e2/4)-((3*e4)/64)-((5*e6)/256))*lat - (((3*e2)/8)+((3*e4)/32)+((45*e6)/1024))*sin(lat*2) + (((15*e4)/256) + ((45*e6)/1024) )*sin(lat*4) - ((35*e6)/3072)*sin(lat*6)
-    E = 500 + (K0 * a * vlat) * (A + (1-T+C)*((A**3)/6) + (5 - 18 * T + T**2) * ((A**5)/120) )
-    N = N0 + (K0 * a) * ( slat+vlat*tan(lat)* (A**2/2 + (5-T+9*C+4*C**2) * (A**4/24) + (61-58*T+T**2) * A**6/720) )
-    return E,N
-
-## for testing
-#if __name__ == "__main__":
-#    read("/data/downloads/osm_parser/map.osm", bpy.context)
-
-
-# ----------------------------------------------------------------------------
-# blender integration
-
-from bpy.types import Operator
-from bpy_extras.io_utils import ImportHelper
-
-from bpy.props import StringProperty, FloatProperty, BoolProperty
-
-class ImportOSM(Operator, ImportHelper):
-    """Import OSM"""
-    #bl_idname = "import.open_street_map"
-    bl_idname = "import_mesh.osm"
-    bl_label = "Import OpenStreetMap (.osm)"
-
-    # ExportHelper mixin class uses this
-    filename_ext = ".osm"
-
-    filter_glob = StringProperty(
-            default="*.osm",
-            options={'HIDDEN'},
-            )
-
-    # List of operator properties, the attributes will be assigned
-    # to the class instance from the operator settings before calling.
-    scale = FloatProperty(
-            name="Scale",
-            default=100.0,
-            )
-
-    utm = BoolProperty(
-            name="in UTM coordinates",
-            default=True,
-            )
-
-    tag = BoolProperty(
-            name="retrieve .osm tags as vertex groups",
-            default=False,
-            )
-
-    def execute(self, context) :
-        return read(context, self.filepath, self.scale, self.tag, self.utm)
-
-
-# Only needed if you want to add into a dynamic menu
-def menu_func_export(self, context):
-    self.layout.operator(ImportOSM.bl_idname)
-
-
-def register():
-    bpy.utils.register_class(ImportOSM)
-    bpy.types.INFO_MT_file_import.append(menu_func_export)
-
-
-def unregister():
-    bpy.utils.unregister_class(ImportOSM)
-    bpy.types.INFO_MT_file_import.remove(menu_func_export)
diff --git a/release/scripts/addons_contrib/io_scene_x/__init__.py b/release/scripts/addons_contrib/io_scene_x/__init__.py
deleted file mode 100644
index 4ee29e0..0000000
--- a/release/scripts/addons_contrib/io_scene_x/__init__.py
+++ /dev/null
@@ -1,165 +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 3
-#  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, see <http://www.gnu.org/licenses/>.
-#  All rights reserved.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "DirectX X Format",
-    "author": "Chris Foster",
-    "version": (3, 0, 0),
-    "blender": (2, 63, 0),
-    "location": "File > Export > DirectX (.x)",
-    "description": "Export mesh vertices, UV's, materials, textures, "\
-        "vertex colors, armatures, empties, and actions.",
-    "warning": "This script is a WIP!",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Import-Export/DirectX_Exporter",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=22795",
-    "category": "Import-Export"}
-
-import bpy
-from bpy.props import BoolProperty
-from bpy.props import EnumProperty
-from bpy.props import StringProperty
-
-
-class ExportDirectX(bpy.types.Operator):
-    """Export selection to DirectX"""
-
-    bl_idname = "export_scene.x"
-    bl_label = "Export DirectX"
-
-    filepath = StringProperty(subtype='FILE_PATH')
-
-    SelectedOnly = BoolProperty(
-        name="Export Selected Objects Only",
-        description="Export only selected objects",
-        default=True)
-
-    ApplyModifiers = BoolProperty(
-        name="Apply Modifiers",
-        description="Apply object modifiers before export",
-        default=False)
-        
-    # XXX Change this stuff to property groups if possible
-    ExportMeshes = BoolProperty(
-        name="Export Meshes",
-        description="Export mesh objects",
-        default=True)
-        
-    ExportNormals = BoolProperty(
-        name="    Export Normals",
-        description="Export mesh normals",
-        default=True)
-    
-    ExportUVCoordinates = BoolProperty(
-        name="    Export UV Coordinates",
-        description="Export mesh UV coordinates, if any",
-        default=True)
-
-    ExportMaterials = BoolProperty(
-        name="    Export Materials",
-        description="Export material properties and reference image textures",
-        default=True)
-
-    #ExportVertexColors = BoolProperty(
-    #    name="    Export Vertex Colors",
-    #    description="Export mesh vertex colors, if any",
-    #    default=False)
-    
-    ExportSkinWeights = BoolProperty(
-        name="    Export Skin Weights",
-        description="Bind mesh vertices to armature bones",
-        default=False)
-    
-    ExportArmatureBones = BoolProperty(
-        name="Export Armature Bones",
-        description="Export armatures bones",
-        default=False)
-    
-    ExportRestBone = BoolProperty(
-        name="    Export Rest Position",
-        description="Export bones in their rest position (recommended for "\
-            "animation)",
-        default=False)
-
-    ExportAnimation = EnumProperty(
-        name="Animations",
-        description="Select the type of animations to export. Only object "\
-            "and armature bone animations can be exported. Full Animation "\
-            "exports every frame",
-        items=(
-            ('NONE', "None", ""),
-            ('KEYS', "Keyframes Only", ""),
-            ('FULL', "Full Animation", "")),
-        default='NONE')
-    
-    IncludeFrameRate = BoolProperty(
-        name="Include Frame Rate",
-        description="Include the AnimTicksPerSecond template which is "\
-            "used by some engines to control animation speed",
-        default=False)
-
-    #ExportActionsAsSets = BoolProperty(
-    #    name="Export Actions as AnimationSets",
-    #    description="Export each action of each object as a separate "\
-    #        "AnimationSet. Otherwise all current actions are lumped "\
-    #        "together into a single set",
-    #    default=False)
-
-    Verbose = BoolProperty(
-        name="Verbose",
-        description="Run the exporter in debug mode. Check the console for "\
-            "output",
-        default=False)
-
-    def execute(self, context):
-        self.filepath = bpy.path.ensure_ext(self.filepath, ".x")
-
-        import export_x
-        Exporter = export_x.DirectXExporter(self, context)
-        Exporter.Export() # XXX Rename this
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        if not self.filepath:
-            self.filepath = bpy.path.ensure_ext(bpy.data.filepath, ".x")
-        context.window_manager.fileselect_add(self)
-        return {'RUNNING_MODAL'}
-
-
-def menu_func(self, context):
-    self.layout.operator(ExportDirectX.bl_idname, text="DirectX (.x)")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_file_export.append(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_file_export.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
-
diff --git a/release/scripts/addons_contrib/io_scene_x/export_x.py b/release/scripts/addons_contrib/io_scene_x/export_x.py
deleted file mode 100644
index 1abb650..0000000
--- a/release/scripts/addons_contrib/io_scene_x/export_x.py
+++ /dev/null
@@ -1,606 +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 3
-#  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, see <http://www.gnu.org/licenses/>.
-#  All rights reserved.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-from math import radians
-
-import bpy
-from mathutils import *
-
-
-class DirectXExporter:
-    def __init__(self, Config, context):
-        self.Config = Config
-        self.context = context
-
-        self.File = File(self.Config.filepath)
-
-        self.Log("Setting up coordinate system...")
-        # SystemMatrix converts from right-handed, z-up to left-handed, y-up
-        self.SystemMatrix = (Matrix.Scale(-1, 4, Vector((0, 0, 1))) *
-            Matrix.Rotation(radians(-90), 4, 'X'))
-        self.Log("Done")
-
-        self.Log("Generating object lists for export...")
-        if self.Config.SelectedOnly:
-            ExportList = list(self.context.selected_objects)
-        else:
-            ExportList = list(self.context.scene.objects)
-
-        # ExportMap maps Blender objects to ExportObjects
-        self.ExportMap = {} # XXX Do we keep ExportMap around in self?  Or should it be local?
-        for Object in ExportList:
-            if Object.type == 'EMPTY':
-                self.ExportMap[Object] = ExportObject(self.Config, self, Object)
-            elif Object.type == 'MESH':
-                self.ExportMap[Object] = MeshExportObject(self.Config, self,
-                    Object)
-            elif Object.type == 'ARMATURE':
-                self.ExportMap[Object] = ArmatureExportObject(self.Config, self,
-                    Object)
-
-        # Find the objects who do not have a parent or whose parent we are
-        # not exporting
-        self.RootExportList = [Object for Object in self.ExportMap.values()
-            if Object.BlenderObject.parent not in ExportList]
-        self.RootExportList = Util.SortByNameField(self.RootExportList)
-
-        # Determine each object's children from the pool of ExportObjects
-        for Object in self.ExportMap.values():
-            Children = Object.BlenderObject.children
-            Object.Children = []
-            for Child in Children:
-                if Child in self.ExportMap:
-                    Object.Children.append(self.ExportMap[Child])
-        self.Log("Done")
-
-    # "Public" Interface
-
-    def Export(self):
-        self.Log("Exporting to {}".format(self.File.FilePath),
-            MessageVerbose=False)
-
-        self.Log("Opening file...")
-        self.File.Open()
-        self.Log("Done")
-
-        self.Log("Writing header...")
-        self.__WriteHeader()
-        self.Log("Done")
-
-        self.Log("Opening Root frame...")
-        self.__OpenRootFrame()
-        self.Log("Done")
-
-        self.Log("Writing objects...")
-        for Object in self.RootExportList:
-            Object.Write()
-        self.Log("Done")
-
-        self.Log("Closing Root frame...")
-        self.__CloseRootFrame()
-        self.Log("Done")
-
-        self.File.Close()
-
-    def Log(self, String, MessageVerbose=True):
-        if self.Config.Verbose is True or MessageVerbose == False:
-            print(String)
-
-    # "Private" Methods
-
-    def __WriteHeader(self):
-        self.File.Write("xof 0303txt 0032\n\n")
-
-        if self.Config.IncludeFrameRate:
-            self.File.Write("template AnimTicksPerSecond {\n\
-  <9E415A43-7BA6-4a73-8743-B73D47E88476>\n\
-  DWORD AnimTicksPerSecond;\n\
-}\n\n")
-        if self.Config.ExportSkinWeights:
-            self.File.Write("template XSkinMeshHeader {\n\
-  <3cf169ce-ff7c-44ab-93c0-f78f62d172e2>\n\
-  WORD nMaxSkinWeightsPerVertex;\n\
-  WORD nMaxSkinWeightsPerFace;\n\
-  WORD nBones;\n\
-}\n\n\
-template SkinWeights {\n\
-  <6f0d123b-bad2-4167-a0d0-80224f25fabb>\n\
-  STRING transformNodeName;\n\
-  DWORD nWeights;\n\
-  array DWORD vertexIndices[nWeights];\n\
-  array float weights[nWeights];\n\
-  Matrix4x4 matrixOffset;\n\
-}\n\n")
-
-    # Start the Root frame and write its transform matrix
-    def __OpenRootFrame(self):
-        self.File.Write("Frame Root {\n")
-        self.File.Indent()
-
-        self.File.Write("FrameTransformMatrix {\n")
-        self.File.Indent()
-        Util.WriteMatrix(self.File, self.SystemMatrix)
-        self.File.Unindent()
-        self.File.Write("}\n")
-
-    def __CloseRootFrame(self):
-        self.File.Unindent()
-        self.File.Write("} // End of Root\n")
-
-
-class ExportObject:
-    def __init__(self, Config, Exporter, BlenderObject):
-        self.Config = Config
-        self.Exporter = Exporter
-        self.BlenderObject = BlenderObject
-
-        self.name = self.BlenderObject.name # Simple alias
-        self.SafeName = Util.SafeName(self.BlenderObject.name)
-        self.Children = []
-
-    def __repr__(self):
-        return "[ExportObject: {}]".format(self.BlenderObject.name)
-
-    # "Public" Interface
-
-    def Write(self):
-        self._OpenFrame()
-
-        self._WriteChildren()
-
-        self._CloseFrame()
-
-    # "Protected" Interface
-
-    def _OpenFrame(self):
-        self.Exporter.File.Write("Frame {} {{\n".format(self.SafeName))
-        self.Exporter.File.Indent()
-
-        self.Exporter.File.Write("FrameTransformMatrix {\n")
-        self.Exporter.File.Indent()
-        Util.WriteMatrix(self.Exporter.File, self.BlenderObject.matrix_local)
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}\n")
-
-    def _CloseFrame(self):
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}} // End of {}\n".format(self.SafeName))
-
-    def _WriteChildren(self):
-        for Child in Util.SortByNameField(self.Children):
-            Child.Write()
-
-
-class MeshExportObject(ExportObject):
-    def __init__(self, Config, Exporter, BlenderObject):
-        ExportObject.__init__(self, Config, Exporter, BlenderObject)
-
-    def __repr__(self):
-        return "[MeshExportObject: {}]".format(self.BlenderObject.name)
-
-    # "Public" Interface
-
-    def Write(self):
-        self._OpenFrame()
-
-        if self.Exporter.Config.ExportMeshes:
-            # Generate the export mesh
-            Mesh = None
-            if self.Config.ApplyModifiers:
-                Mesh = self.BlenderObject.to_mesh(self.Exporter.context.scene,
-                    True, 'PREVIEW')
-            else:
-                Mesh = self.BlenderObject.to_mesh(self.Exporter.context.scene,
-                    False, 'PREVIEW')
-                    
-            self.__WriteMesh(Mesh)
-
-        self._WriteChildren()
-
-        self._CloseFrame()
-
-    # "Private" Methods
-
-    def __WriteMesh(self, Mesh):
-        self.Exporter.File.Write("Mesh {{ // {} mesh\n".format(self.SafeName))
-        self.Exporter.File.Indent()
-
-        if (self.Exporter.Config.ExportUVCoordinates and Mesh.uv_textures):# or \
-           #self.Exporter.Config.ExportVertexColors: XXX
-            VertexCount = 0
-            for Polygon in Mesh.polygons:
-                VertexCount += len(Polygon.vertices)
-            
-            # Write vertex positions
-            Index = 0
-            self.Exporter.File.Write("{};\n".format(VertexCount))
-            for Polygon in Mesh.polygons:
-                Vertices = list(Polygon.vertices)[::-1]
-                
-                for Vertex in [Mesh.vertices[Vertex] for Vertex in Vertices]:
-                    Position = Vertex.co
-                    self.Exporter.File.Write("{:9f};{:9f};{:9f};".format(
-                        Position[0], Position[1], Position[2]))
-                    Index += 1
-                    if Index == VertexCount:
-                        self.Exporter.File.Write(";\n", Indent=False)
-                    else:
-                        self.Exporter.File.Write(",\n", Indent=False)
-            
-            # Write face definitions
-            Index = 0
-            self.Exporter.File.Write("{};\n".format(len(Mesh.polygons)))
-            for Polygon in Mesh.polygons:
-                self.Exporter.File.Write("{};".format(len(Polygon.vertices)))
-                for Vertex in Polygon.vertices:
-                    self.Exporter.File.Write("{};".format(Index), Indent=False)
-                    Index += 1
-                if Index == VertexCount:
-                    self.Exporter.File.Write(";\n", Indent=False)
-                else:
-                    self.Exporter.File.Write(",\n", Indent=False)
-        else:
-            # Write vertex positions
-            self.Exporter.File.Write("{};\n".format(len(Mesh.vertices)))
-            for Index, Vertex in enumerate(Mesh.vertices):
-                Position = Vertex.co
-                self.Exporter.File.Write("{:9f};{:9f};{:9f};".format(
-                    Position[0], Position[1], Position[2]))
-                if Index == len(Mesh.vertices) - 1:
-                    self.Exporter.File.Write(";\n", Indent=False)
-                else:
-                    self.Exporter.File.Write(",\n", Indent=False)
-    
-            # Write face definitions
-            self.Exporter.File.Write("{};\n".format(len(Mesh.polygons)))
-            for Index, Polygon in enumerate(Mesh.polygons):
-                # Change the winding order of the face
-                Vertices = list(Polygon.vertices)[::-1]
-    
-                self.Exporter.File.Write("{};".format(len(Vertices)))
-                for Vertex in Vertices:
-                    self.Exporter.File.Write("{};".format(Vertex), Indent=False)
-                if Index == len(Mesh.polygons) - 1:
-                    self.Exporter.File.Write(";\n", Indent=False)
-                else:
-                    self.Exporter.File.Write(",\n", Indent=False)
-
-        if self.Exporter.Config.ExportNormals:
-            self.__WriteMeshNormals(Mesh)
-            
-        if self.Exporter.Config.ExportUVCoordinates:
-            self.__WriteMeshUVCoordinates(Mesh)
-
-        if self.Exporter.Config.ExportMaterials:
-            self.__WriteMeshMaterials(Mesh)
-        
-        #if self.Exporter.Config.ExportVertexColor:
-        #    self.__WriteMeshVertexColors(Mesh)
-
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}} // End of {} mesh\n".format(self.SafeName))
-
-    def __WriteMeshNormals(self, Mesh):
-        self.Exporter.File.Write("MeshNormals {{ // {} normals\n".format(
-            self.SafeName))
-        self.Exporter.File.Indent()
-
-        # Determine the number of normals to write
-        NormalCount = 0
-        for Polygon in Mesh.polygons:
-            if Polygon.use_smooth:
-                NormalCount += len(Polygon.vertices)
-            else:
-                NormalCount += 1
-
-        # Write mesh normals
-        self.Exporter.File.Write("{};\n".format(NormalCount))
-        NormalIndex = 0
-        for Polygon in Mesh.polygons:
-            # If the face is faceted, write the face normal only once
-            if not Polygon.use_smooth:
-                Normal = Polygon.normal
-                self.Exporter.File.Write("{:9f};{:9f};{:9f};".format(Normal[0],
-                    Normal[1], Normal[2]))
-                NormalIndex += 1
-                if NormalIndex < NormalCount:
-                    self.Exporter.File.Write(",\n", Indent=False)
-            # Otherwise, write each vertex normal
-            else:
-                # Change the winding order of the face
-                VertexNormals = [Mesh.vertices[Vertex].normal for Vertex in
-                    Polygon.vertices][::-1]
-                for Normal in VertexNormals:
-                    self.Exporter.File.Write("{:9f};{:9f};{:9f};".format(
-                        Normal[0], Normal[1], Normal[2]))
-                    NormalIndex += 1
-                    if NormalIndex < NormalCount:
-                        self.Exporter.File.Write(",\n", Indent=False)
-        self.Exporter.File.Write(";\n", Indent=False)
-
-        # Write face definitions
-        self.Exporter.File.Write("{};\n".format(len(Mesh.polygons)))
-        NormalIndex = 0
-        for Polygon in Mesh.polygons:
-            VertexCount = len(Polygon.vertices)
-            self.Exporter.File.Write("{};".format(VertexCount))
-            # If the face is faceted, use the normal at Index for each vertex
-            if not Polygon.use_smooth:
-                VertexIndices = [NormalIndex] * VertexCount
-                NormalIndex += 1
-            # Otherwise, use the next couple normals for the face
-            else:
-                VertexIndices = list(range(NormalIndex,
-                    NormalIndex + VertexCount))
-                NormalIndex += VertexCount
-            # Write the indices for the face
-            for VertexIndex in VertexIndices:
-                self.Exporter.File.Write("{};".format(VertexIndex),
-                    Indent=False)
-            if NormalIndex == NormalCount:
-                self.Exporter.File.Write(";\n", Indent=False)
-            else:
-                self.Exporter.File.Write(",\n", Indent=False)
-
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}} // End of {} normals\n".format(
-            self.SafeName))
-     
-    def __WriteMeshUVCoordinates(self, Mesh):
-        if not Mesh.uv_textures:
-            return
-        
-        self.Exporter.File.Write("MeshTextureCoords {{ // {} UV coordinates\n".
-            format(self.SafeName))
-        self.Exporter.File.Indent()
-        
-        UVCoordinates = Mesh.uv_layers.active.data
-        
-        VertexCount = 0
-        for Polygon in Mesh.polygons:
-            VertexCount += len(Polygon.vertices)
-        
-        Index = 0
-        self.Exporter.File.Write("{};\n".format(VertexCount))
-        for Polygon in Mesh.polygons:
-            Vertices = []
-            for Vertex in [UVCoordinates[Vertex] for Vertex in
-                Polygon.loop_indices]:
-                Vertices.append(tuple(Vertex.uv))
-            for Vertex in Vertices:
-                self.Exporter.File.Write("{:9f};{:9f};".format(Vertex[0],
-                    Vertex[1]))
-                Index += 1
-                if Index == VertexCount:
-                    self.Exporter.File.Write(";\n", Indent=False)
-                else:
-                    self.Exporter.File.Write(",\n", Indent=False)
-                    
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}} // End of {} UV coordinates\n".format(
-            self.SafeName))
-
-    def __WriteMeshMaterials(self, Mesh):
-        def WriteMaterial(Exporter, Material):
-            def GetMaterialTextureFileName(Material):
-                if Material:
-                    # Create a list of Textures that have type 'IMAGE'
-                    ImageTextures = [Material.texture_slots[TextureSlot].texture
-                        for TextureSlot in Material.texture_slots.keys()
-                        if Material.texture_slots[TextureSlot].texture.type ==
-                        'IMAGE']
-                    # Refine to only image file names if applicable
-                    ImageFiles = [bpy.path.basename(Texture.image.filepath)
-                        for Texture in ImageTextures
-                        if getattr(Texture.image, "source", "") == 'FILE']
-                    if ImageFiles:
-                        return ImageFiles[0]
-                return None
-            
-            Exporter.File.Write("Material {} {{\n".format(
-                Util.SafeName(Material.name)))
-            Exporter.File.Indent()
-            
-            Diffuse = list(Vector(Material.diffuse_color) *
-                Material.diffuse_intensity)
-            Diffuse.append(Material.alpha)
-            # Map Blender's range of 1 - 511 to 0 - 1000
-            Specularity = 1000 * (Material.specular_hardness - 1.0) / 510.0
-            Specular = list(Vector(Material.specular_color) *
-                Material.specular_intensity)
-            
-            Exporter.File.Write("{:9f};{:9f};{:9f};{:9f};;\n".format(Diffuse[0],
-                Diffuse[1], Diffuse[2], Diffuse[3]))
-            Exporter.File.Write(" {:9f};\n".format(Specularity))
-            Exporter.File.Write("{:9f};{:9f};{:9f};;\n".format(Specular[0],
-                Specular[1], Specular[2]))
-            Exporter.File.Write(" 0.000000; 0.000000; 0.000000;;\n")
-            
-            TextureFileName = GetMaterialTextureFileName(Material)
-            if TextureFileName:
-                Exporter.File.Write("TextureFilename {{\"{}\";}}\n".format(
-                    TextureFileName))
-            
-            Exporter.File.Unindent()
-            Exporter.File.Write("}\n");
-        
-        Materials = Mesh.materials
-        # Do not write materials if there are none
-        if not Materials.keys():
-            return
-        
-        self.Exporter.File.Write("MeshMaterialList {{ // {} material list\n".
-            format(self.SafeName))
-        self.Exporter.File.Indent()
-        
-        self.Exporter.File.Write("{};\n".format(len(Materials)))
-        self.Exporter.File.Write("{};\n".format(len(Mesh.polygons)))
-        for Index, Polygon in enumerate(Mesh.polygons):
-            self.Exporter.File.Write("{}".format(Polygon.material_index))
-            if Index == len(Mesh.polygons) - 1:
-                self.Exporter.File.Write(";;\n", Indent=False)
-            else:
-                self.Exporter.File.Write(",\n", Indent=False)
-        
-        for Material in Materials:
-            WriteMaterial(self.Exporter, Material)
-        
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}} // End of {} material list\n".format(
-            self.SafeName))
-    
-    def __WriteMeshVertexColors(self, Mesh):
-        pass
-    
-    def __WriteMeshSkinWeights(self, Mesh):
-        ArmatureModifierList = [Modifier for Modifier in Object.modifiers
-            if Modifier.type == 'ARMATURE']
-        
-        if not ArmatureModifierList:
-            return
-        
-        pass
-
-
-class ArmatureExportObject(ExportObject):
-    def __init__(self, Config, Exporter, BlenderObject):
-        ExportObject.__init__(self, Config, Exporter, BlenderObject)
-
-    def __repr__(self):
-        return "[ArmatureExportObject: {}]".format(self.BlenderObject.name)
-    
-    # "Public" Interface
-
-    def Write(self):
-        self._OpenFrame()
-        
-        if self.Config.ExportArmatureBones:
-            Armature = self.BlenderObject.data
-            RootBones = [Bone for Bone in Armature.bones if Bone.parent is None]
-            self.__WriteBones(RootBones)
-
-        self._WriteChildren()
-
-        self._CloseFrame()
-    
-    # "Private" Methods
-    
-    def __WriteBones(self, Bones):
-        for Bone in Bones:
-            BoneMatrix = Matrix()
-            
-            PoseBone = self.BlenderObject.pose.bones[Bone.name]
-            if Bone.parent:
-                BoneMatrix = PoseBone.parent.matrix.inverted()
-            BoneMatrix *= PoseBone.matrix
-            
-            BoneSafeName = Util.SafeName(Bone.name)
-            self.__OpenBoneFrame(BoneSafeName, BoneMatrix)
-            
-            self.__WriteBoneChildren(Bone)
-            
-            self.__CloseBoneFrame(BoneSafeName)
-            
-    
-    def __OpenBoneFrame(self, BoneSafeName, BoneMatrix):
-        self.Exporter.File.Write("Frame {} {{\n".format(BoneSafeName))
-        self.Exporter.File.Indent()
-
-        self.Exporter.File.Write("FrameTransformMatrix {\n")
-        self.Exporter.File.Indent()
-        Util.WriteMatrix(self.Exporter.File, BoneMatrix)
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}\n")
-    
-    def __CloseBoneFrame(self, BoneSafeName):
-        self.Exporter.File.Unindent()
-        self.Exporter.File.Write("}} // End of {}\n".format(BoneSafeName))
-    
-    def __WriteBoneChildren(self, Bone):
-        self.__WriteBones(Util.SortByNameField(Bone.children))
-
-
-class File:
-    def __init__(self, FilePath):
-        self.FilePath = FilePath
-        self.File = None
-        self.__Whitespace = 0
-
-    def Open(self):
-        if not self.File:
-            self.File = open(self.FilePath, 'w')
-
-    def Close(self):
-        self.File.close()
-        self.File = None
-
-    def Write(self, String, Indent=True):
-        if Indent:
-            # Escape any formatting braces
-            String = String.replace("{", "{{")
-            String = String.replace("}", "}}")
-            self.File.write(("{}" + String).format("  " * self.__Whitespace))
-        else:
-            self.File.write(String)
-
-    def Indent(self, Levels=1):
-        self.__Whitespace += Levels
-
-    def Unindent(self, Levels=1):
-        self.__Whitespace -= Levels
-        if self.__Whitespace < 0:
-            self.__Whitespace = 0
-
-
-class Util:
-    @staticmethod
-    def SafeName(Name):
-        # Replaces each character in OldSet with NewChar
-        def ReplaceSet(String, OldSet, NewChar):
-            for OldChar in OldSet:
-                String = String.replace(OldChar, NewChar)
-            return String
-
-        import string
-
-        NewName = ReplaceSet(Name, string.punctuation + " ", "_")
-        if NewName[0].isdigit() or NewName in ["ARRAY", "DWORD", "UCHAR",
-            "FLOAT", "ULONGLONG", "BINARY_RESOURCE", "SDWORD", "UNICODE",
-            "CHAR", "STRING", "WORD", "CSTRING", "SWORD", "DOUBLE", "TEMPLATE"]:
-            NewName = "_" + NewName
-        return NewName
-
-    @staticmethod
-    def WriteMatrix(File, Matrix):
-        File.Write("{:9f},{:9f},{:9f},{:9f},\n".format(Matrix[0][0],
-            Matrix[1][0], Matrix[2][0], Matrix[3][0]))
-        File.Write("{:9f},{:9f},{:9f},{:9f},\n".format(Matrix[0][1],
-            Matrix[1][1], Matrix[2][1], Matrix[3][1]))
-        File.Write("{:9f},{:9f},{:9f},{:9f},\n".format(Matrix[0][2],
-            Matrix[1][2], Matrix[2][2], Matrix[3][2]))
-        File.Write("{:9f},{:9f},{:9f},{:9f};;\n".format(Matrix[0][3],
-            Matrix[1][3], Matrix[2][3], Matrix[3][3]))
-    
-    @staticmethod
-    def SortByNameField(List):
-        def SortKey(x):
-            return x.name
-        
-        return sorted(List, key=SortKey)
diff --git a/release/scripts/addons_contrib/lamp_geographical_sun.py b/release/scripts/addons_contrib/lamp_geographical_sun.py
deleted file mode 100644
index 36a3cb8..0000000
--- a/release/scripts/addons_contrib/lamp_geographical_sun.py
+++ /dev/null
@@ -1,581 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# --------------------------------------------------------------------------
-# Blender 2.5 Geographical Sun Add-On
-# --------------------------------------------------------------------------
-#
-# Authors:
-# Doug Hammond
-#
-# 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, see <http://www.gnu.org/licenses/>.
-#
-# ***** END GPL LICENCE BLOCK *****
-#
-
-# System imports
-#-----------------------------------------------------------------------------
-import datetime, math, time
-today = datetime.datetime.now()
-
-# Blender imports
-#----------------------------------------------------------------------------- 
-import bpy
-from extensions_framework import Addon, declarative_property_group
-from extensions_framework.ui import property_group_renderer
-
-# Addon setup
-#----------------------------------------------------------------------------- 
-bl_info = {
-    "name": "Geographical Sun",
-    "author": "Doug Hammond (dougal2)",
-    "version": (0, 0, 1),
-    "blender": (2, 56, 0),
-    "category": "Object",
-    "location": "Lamp data > Geographical Sun",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "description": "Set SUN Lamp rotation according to geographical time and location."
-}
-GeoSunAddon = Addon(bl_info)
-
-# Sun rotation calculator implementation
-#----------------------------------------------------------------------------- 
-class sun_calculator(object):
-    """
-    Based on SunLight v1.0 by Miguel Kabantsov (miguelkab at gmail.com)
-    Replaces the faulty sun position calculation algorythm with a precise calculation (Source for algorythm: http://de.wikipedia.org/wiki/Sonnenstand),
-    Co-Ordinates: http://www.bcca.org/misc/qiblih/latlong.html
-    Author: Nils-Peter Fischer (Nils-Peter.Fischer at web.de)
-    """
-    
-    location_list = [
-        ("EUROPE",[
-            ("Antwerp, Belgium",            67),
-            ("Berlin, Germany",             1),
-            ("Bratislava, Slovak Republic", 70),
-            ("Brno, Czech Republic",        72),
-            ("Brussles, Belgium",           68),
-            ("Geneva, Switzerland",         65),
-            ("Helsinki, Finland",           7),
-            ("Innsbruck, Austria",          62),
-            ("Kyiv, Ukraine",               64),
-            ("London, England",             10),
-            ("Lyon, France",                66),
-            ("Nitra, Slovak Republic",      69),
-            ("Oslo, Norway",                58),
-            ("Paris, France",               15),
-            ("Praha, Czech Republic",       71),
-            ("Rome, Italy",                 18),
-            ("Telfs, Austria",              63),
-            ("Warsaw, Poland",              74),
-            ("Wroclaw, Poland",             73),
-            ("Zurich, Switzerland",         21),
-        ]),
-        
-        ("WORLD CITIES", [
-            ("Beijing, China",              0),
-            ("Bombay, India",               2),
-            ("Buenos Aires, Argentina",     3),
-            ("Cairo, Egypt",                4),
-            ("Cape Town, South Africa",     5),
-            ("Caracas, Venezuela",          6),
-            ("Curitiba, Brazil",            60),
-            ("Hong Kong, China",            8),
-            ("Jerusalem, Israel",           9),
-            ("Joinville, Brazil",           61),
-            ("Mexico City, Mexico",         11),
-            ("Moscow, Russia",              12),
-            ("New Delhi, India",            13),
-            ("Ottawa, Canada",              14),
-            ("Rio de Janeiro, Brazil",      16),
-            ("Riyadh, Saudi Arabia",        17),
-            ("Sao Paulo, Brazil",           59),
-            ("Sydney, Australia",           19),
-            ("Tokyo, Japan",                20),
-        ]),
-        
-        ("US CITIES", [
-            ("Albuquerque, NM",             22),
-            ("Anchorage, AK",               23),
-            ("Atlanta, GA",                 24),
-            ("Austin, TX",                  25),
-            ("Birmingham, AL",              26),
-            ("Bismarck, ND",                27),
-            ("Boston, MA",                  28),
-            ("Boulder, CO",                 29),
-            ("Chicago, IL",                 30),
-            ("Dallas, TX",                  31),
-            ("Denver, CO",                  32),
-            ("Detroit, MI",                 33),
-            ("Honolulu, HI",                34),
-            ("Houston, TX",                 35),
-            ("Indianapolis, IN",            36),
-            ("Jackson, MS",                 37),
-            ("Kansas City, MO",             38),
-            ("Los Angeles, CA",             39),
-            ("Menomonee Falls, WI",         40),
-            ("Miami, FL",                   41),
-            ("Minneapolis, MN",             42),
-            ("New Orleans, LA",             43),
-            ("New York City, NY",           44),
-            ("Oklahoma City, OK",           45),
-            ("Philadelphia, PA",            46),
-            ("Phoenix, AZ",                 47),
-            ("Pittsburgh, PA",              48),
-            ("Portland, ME",                49),
-            ("Portland, OR",                50),
-            ("Raleigh, NC",                 51),
-            ("Richmond, VA",                52),
-            ("Saint Louis, MO",             53),
-            ("San Diego, CA",               54),
-            ("San Francisco, CA",           55),
-            ("Seattle, WA",                 56),
-            ("Washington DC",               57),
-        ])
-    ]
-    
-    location_data = {
-        # Europe
-        67: ( 51.2167, -4.4, 1),
-        1:  ( 52.33, -13.30, 1),
-        70: ( 48.17, -17.17, 1),
-        72: ( 49.2, -16.63, 1),
-        68: ( 58.8467, -4.3525, 1),
-        65: ( 46.217, -6.150, 1),
-        7:  ( 60.1667, -24.9667,2),
-        62: ( 47.2672, -11.3928, 1),
-        64: ( 50.75, -30.0833, 2),
-        10: ( 51.50, 0.0, 0),
-        66: ( 45.767, -4.833, 1),
-        69: ( 48.32, -18.07, 1),
-        58: ( 59.56, -10.41, 1),
-        15: ( 48.8667, -2.667, 1),
-        71: ( 50.08, -14.46, 1),
-        18: ( 41.90, -12.4833, 1),
-        63: ( 47.3, -11.0667, 1),
-        74: ( 52.232, -21.008, 1),
-        73: ( 51.108, -17.038, 1),
-        21: ( 47.3833, -8.5333, 1),
-        
-        # World Cities
-        0:  ( 39.9167, -116.4167, 8),
-        2:  ( 18.9333, -72.8333, 5.5),
-        3:  (-34.60, 58.45, -3),
-        4:  ( 30.10, -31.3667, 2),
-        5:  (-33.9167, -18.3667, 2),
-        6:  ( 10.50, 66.9333, -4),
-        60: (-25.4278, 49.2731, -3),
-        8:  ( 22.25, -114.1667, 8),
-        9:  ( 31.7833, -35.2333, 2),
-        61: (-29.3044, 48.8456, -3),
-        11: ( 19.4, 99.15, -6),
-        12: ( 55.75, -37.5833, 3),
-        13: ( 28.6, -77.2, 5.5),
-        14: ( 45.41667, 75.7, -5),
-        16: (-22.90, 43.2333, -3),
-        17: ( 24.633, -46.71667, 3),
-        59: ( -23.5475, 46.6361, -3),
-        19: (-33.8667, -151.2167,10),
-        20: ( 35.70, -139.7667, 9), 
-        
-        # US Cities
-        22: ( 35.0833, 106.65, -7),
-        23: ( 61.217, 149.90, -9),
-        24: ( 33.733, 84.383, -5),
-        25: ( 30.283, 97.733, -6),
-        26: ( 33.521, 86.8025, -6),
-        27: ( 46.817, 100.783, -6),
-        28: ( 42.35, 71.05, -5),
-        29: ( 40.125, 105.237, -7),
-        30: ( 41.85, 87.65, -6),
-        31: ( 32.46, 96.47, -6),
-        32: ( 39.733, 104.983, -7),
-        33: ( 42.333, 83.05, -5),
-        34: ( 21.30, 157.85, -10),
-        35: ( 29.75, 95.35, -6),
-        36: ( 39.767, 86.15, -5),
-        37: ( 32.283, 90.183, -6),
-        38: ( 39.083, 94.567, -6),
-        39: ( 34.05, 118.233, -8),
-        40: ( 43.11, 88.10, -6),
-        41: ( 25.767, 80.183, -5),
-        42: ( 44.967, 93.25, -6),
-        43: ( 29.95, 90.067, -6),
-        44: ( 40.7167, 74.0167, -5),
-        45: ( 35.483, 97.533, -6),
-        46: ( 39.95, 75.15, -5),
-        47: ( 33.433, 112.067,-7),
-        48: ( 40.433, 79.9833, -5),
-        49: ( 43.666, 70.283, -5),
-        50: ( 45.517, 122.65, -8),
-        51: ( 35.783, 78.65, -5),
-        52: ( 37.5667, 77.450, -5),
-        53: ( 38.6167, 90.1833, -6),
-        54: ( 32.7667, 117.2167, -8),
-        55: ( 37.7667, 122.4167, -8),
-        56: ( 47.60, 122.3167, -8),
-        57: ( 38.8833, 77.0333, -5),
-    }
-    
-    # mathematical helpers
-    @staticmethod
-    def sind(deg):
-        return math.sin(math.radians(deg))
-    
-    @staticmethod
-    def cosd(deg):
-        return math.cos(math.radians(deg))
-    
-    @staticmethod
-    def tand(deg):
-        return math.tan(math.radians(deg))
-    
-    @staticmethod
-    def asind(deg):
-        return math.degrees(math.asin(deg))
-    
-    @staticmethod
-    def atand(deg):
-        return math.degrees(math.atan(deg))
-    
-    @staticmethod
-    def geo_sun_astronomicJulianDate(Year, Month, Day, LocalTime, Timezone):
-        if Month > 2.0:
-            Y = Year
-            M = Month
-        else:
-            Y = Year - 1.0
-            M = Month + 12.0
-            
-        UT = LocalTime - Timezone
-        hour = UT / 24.0
-        A = int(Y/100.0)
-        
-        JD = math.floor(365.25*(Y+4716.0)) + math.floor(30.6001*(M+1.0)) + Day + hour - 1524.4
-        
-        # The following section is adopted from netCDF4 netcdftime implementation.
-        # Copyright: 2008 by Jeffrey Whitaker
-        # License: http://www.opensource.org/licenses/mit-license.php
-        if JD >= 2299170.5:
-            # 1582 October 15 (Gregorian Calendar)
-            B = 2.0 - A + int(A/4.0)
-        elif JD < 2299160.5:
-            # 1582 October 5 (Julian Calendar)
-            B = 0
-        else:
-            raise Exception('ERROR: Date falls in the gap between Julian and Gregorian calendars.')
-            B = 0
-        
-        return JD+B
-    
-    @staticmethod
-    def geoSunData(Latitude, Longitude, Year, Month, Day, LocalTime, Timezone):
-        JD = sun_calculator.geo_sun_astronomicJulianDate(Year, Month, Day, LocalTime, Timezone)
-        
-        phi = Latitude
-        llambda = Longitude
-                
-        n = JD - 2451545.0
-        LDeg = (280.460 + 0.9856474*n) - (math.floor((280.460 + 0.9856474*n)/360.0) * 360.0)
-        gDeg = (357.528 + 0.9856003*n) - (math.floor((357.528 + 0.9856003*n)/360.0) * 360.0)
-        LambdaDeg = LDeg + 1.915 * sun_calculator.sind(gDeg) + 0.02 * sun_calculator.sind(2.0*gDeg)
-        
-        epsilonDeg = 23.439 - 0.0000004*n
-        
-        alphaDeg = sun_calculator.atand( (sun_calculator.cosd(epsilonDeg) * sun_calculator.sind(LambdaDeg)) / sun_calculator.cosd(LambdaDeg) )
-        if sun_calculator.cosd(LambdaDeg) < 0.0:
-            alphaDeg += 180.0
-            
-        deltaDeg = sun_calculator.asind( sun_calculator.sind(epsilonDeg) * sun_calculator.sind(LambdaDeg) )
-        
-        JDNull = sun_calculator.geo_sun_astronomicJulianDate(Year, Month, Day, 0.0, 0.0)
-        
-        TNull = (JDNull - 2451545.0) / 36525.0
-        T = LocalTime - Timezone
-        
-        thetaGh = 6.697376 + 2400.05134*TNull + 1.002738*T
-        thetaGh -= math.floor(thetaGh/24.0) * 24.0
-        
-        thetaG = thetaGh * 15.0
-        theta = thetaG + llambda
-        
-        tau = theta - alphaDeg
-        
-        a = sun_calculator.atand( sun_calculator.sind(tau) / ( sun_calculator.cosd(tau)*sun_calculator.sind(phi) - sun_calculator.tand(deltaDeg)*sun_calculator.cosd(phi)) )
-        if sun_calculator.cosd(tau)*sun_calculator.sind(phi) - sun_calculator.tand(deltaDeg)*sun_calculator.cosd(phi) < 0.0:
-            a += 180.0
-        
-        h = sun_calculator.asind( sun_calculator.cosd(deltaDeg)*sun_calculator.cosd(tau)*sun_calculator.cosd(phi) + sun_calculator.sind(deltaDeg)*sun_calculator.sind(phi) )
-        
-        R = 1.02 / (sun_calculator.tand (h+(10.3/(h+5.11))))
-        hR = h + R/60.0
-        
-        azimuth = a
-        elevation = hR
-        
-        return azimuth, elevation
-
-# Addon classes
-#----------------------------------------------------------------------------- 
- at GeoSunAddon.addon_register_class
-class OBJECT_OT_set_geographical_sun_now(bpy.types.Operator):
-    bl_idname = 'object.set_geographical_sun_now'
-    bl_label = 'Set time to NOW'
-    
-    @classmethod
-    def poll(cls, context):
-        cl = context.lamp
-        return cl and cl.type == 'SUN'
-    
-    def execute(self, context):
-        GSP = context.lamp.GeoSunProperties
-        
-        now = datetime.datetime.now()
-        for p in ("hour", "minute", "day", "month", "year"):
-            setattr(
-                GSP,
-                p,
-                getattr(now, p)
-            )
-        GSP.tz = time.timezone
-        GSP.dst = False
-        
-        return {'FINISHED'}
-
- at GeoSunAddon.addon_register_class
-class OBJECT_OT_set_geographical_sun_pos(bpy.types.Operator):
-    bl_idname = 'object.set_geographical_sun_pos'
-    bl_label = 'Set SUN position'
-    
-    @classmethod
-    def poll(cls, context):
-        cl = context.lamp
-        return cl and cl.type == 'SUN'
-    
-    def execute(self, context):
-        try:
-            GSP = context.lamp.GeoSunProperties
-            
-            dst = 1 if GSP.dst else 0
-            
-            az,el = sun_calculator.geoSunData(
-                GSP.lat,
-                GSP.long,
-                GSP.year,
-                GSP.month,
-                GSP.day,
-                GSP.hour + GSP.minute/60.0,
-                -GSP.tz + dst
-            )
-            
-            context.object.rotation_euler = ( math.radians(90-el), 0, math.radians(-az) )
-            return {'FINISHED'}
-        except Exception as err:
-            self.report({'ERROR'}, str(err))
-            return {'CANCELLED'}
-
- at GeoSunAddon.addon_register_class
-class OBJECT_OT_set_geographical_location_preset(bpy.types.Operator):
-    bl_idname = 'object.set_geographical_location_preset'
-    bl_label = 'Apply location preset'
-    
-    index = bpy.props.IntProperty()
-    
-    @classmethod
-    def poll(cls, context):
-        cl = context.lamp
-        return cl and cl.type == 'SUN'
-    
-    def execute(self, context):
-        GSP = context.lamp.GeoSunProperties
-        GSP.lat, GSP.long, GSP.tz = sun_calculator.location_data[self.properties.index]
-        return {'FINISHED'}
-
-# Dynamic submenu magic !
-
-def draw_generator(locations):
-    def draw(self, context):
-        sl = self.layout
-        for location in locations:
-            location_name, location_index = location
-            sl.operator('OBJECT_OT_set_geographical_location_preset', text=location_name).index = location_index
-    return draw
-
-submenus = []
-for label, locations in sun_calculator.location_list:
-    submenu_idname = 'OBJECT_MT_geo_sun_location_cat%d'%len(submenus)
-    submenu = type(
-        submenu_idname,
-        (bpy.types.Menu,),
-        {
-            'bl_idname': submenu_idname,
-            'bl_label': label,
-            'draw': draw_generator(locations)
-        }
-    )
-    GeoSunAddon.addon_register_class(submenu)
-    submenus.append(submenu)
-
- at GeoSunAddon.addon_register_class
-class OBJECT_MT_geo_sun_location(bpy.types.Menu):
-    bl_label = 'Location preset'
-    
-    def draw(self, context):
-        sl = self.layout
-        for sm in submenus:
-            sl.menu(sm.bl_idname)
-
- at GeoSunAddon.addon_register_class
-class GeoSunProperties(declarative_property_group):
-    ef_attach_to = ['Lamp']
-    
-    controls = [
-        ['hour', 'minute'],
-        ['day', 'month', 'year'],
-        ['tz', 'dst'],
-        'location_menu',
-        ['lat', 'long'],
-        ['set_time', 'set_posn'],
-    ]
-    
-    properties = [
-        {
-            'type': 'int',
-            'attr': 'minute',
-            'name': 'Minute',
-            'min': 0,
-            'soft_min': 0,
-            'max': 59,
-            'soft_max': 59,
-            'default': today.minute
-        },
-        {
-            'type': 'int',
-            'attr': 'hour',
-            'name': 'Hour',
-            'min': 0,
-            'soft_min': 0,
-            'max': 24,
-            'soft_max': 24,
-            'default': today.hour
-        },
-        {
-            'type': 'int',
-            'attr': 'day',
-            'name': 'Day',
-            'min': 1,
-            'soft_min': 1,
-            'max': 31,
-            'soft_max': 31,
-            'default': today.day
-        },
-        {
-            'type': 'int',
-            'attr': 'month',
-            'name': 'Month',
-            'min': 1,
-            'soft_min': 1,
-            'max': 12,
-            'soft_max': 12,
-            'default': today.month
-        },
-        {
-            'type': 'int',
-            'attr': 'year',
-            'name': 'Year',
-            'min': datetime.MINYEAR,
-            'soft_min': datetime.MINYEAR,
-            'max': datetime.MAXYEAR,
-            'soft_max': datetime.MAXYEAR,
-            'default': today.year
-        },
-        {
-            'type': 'int',
-            'attr': 'tz',
-            'name': 'Time zone',
-            'min': -13,
-            'soft_min': -13,
-            'max': 13,
-            'soft_max': 13,
-            'default': time.timezone
-        },
-        {
-            'type': 'bool',
-            'attr': 'dst',
-            'name': 'DST',
-            'default': False
-        },
-        {
-            'type': 'float',
-            'attr': 'lat',
-            'name': 'Lat.',
-            'min': -180.0,
-            'soft_min': -180.0,
-            'max': 180.0,
-            'soft_max': 180.0,
-            'default': 0.0
-        },
-        {
-            'type': 'float',
-            'attr': 'long',
-            'name': 'Long.',
-            'min': -90.0,
-            'soft_min': -90.0,
-            'max': 90.0,
-            'soft_max': 90.0,
-            'default': 0.0
-        },
-        
-        # draw operators and menus
-        {
-            'attr': 'location_menu',
-            'type': 'menu',
-            'menu': 'OBJECT_MT_geo_sun_location'
-        },
-        {
-            'attr': 'set_time',
-            'type': 'operator',
-            'operator': 'object.set_geographical_sun_now',
-            'icon': 'PREVIEW_RANGE'
-        },
-        {
-            'attr': 'set_posn',
-            'type': 'operator',
-            'operator': 'object.set_geographical_sun_pos',
-            'icon': 'WORLD_DATA'
-        },
-    ]
-
- at GeoSunAddon.addon_register_class
-class GeoSunPanel(property_group_renderer):
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'data'
-    bl_label = 'Geographical Sun'
-    
-    display_property_groups = [
-        ( ('lamp',), 'GeoSunProperties' )
-    ]
-    
-    @classmethod
-    def poll(cls, context):
-        cl = context.lamp
-        return cl and cl.type == 'SUN'
-
-# Bootstrap the Addon
-#----------------------------------------------------------------------------- 
-register, unregister = GeoSunAddon.init_functions()
diff --git a/release/scripts/addons_contrib/mesh_copy_uvs_from_joined.py b/release/scripts/addons_contrib/mesh_copy_uvs_from_joined.py
deleted file mode 100644
index b883e30..0000000
--- a/release/scripts/addons_contrib/mesh_copy_uvs_from_joined.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Copy UV's from Joined",
-    "description": "Copy UV coordinates from the active joined mesh",
-    "author": "Sergey Sharybin",
-    "version": (0, 1),
-    "blender": (2, 63, 0),
-    "location": "Object mode 'Make Links' menu",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Object"}
-
-
-import bpy
-from bpy.types import Operator
-from mathutils import Vector
-
-FLT_MAX = 30000.0
-KEY_PRECISION = 1
-
-
-def MINMAX_INIT():
-    return (Vector((+FLT_MAX, +FLT_MAX, +FLT_MAX)),
-            Vector((-FLT_MAX, -FLT_MAX, -FLT_MAX)))
-
-
-def MINMAX_DO(min, max, vec):
-    for x in range(3):
-        if vec[x] < min[x]:
-            min[x] = vec[x]
-
-        if vec[x] > max[x]:
-            max[x] = vec[x]
-
-
-def getObjectAABB(obj):
-    min, max = MINMAX_INIT()
-
-    matrix = obj.matrix_world.copy()
-    for vec in obj.bound_box:
-        v = matrix * Vector(vec)
-        MINMAX_DO(min, max, v)
-
-    return min, max
-
-
-class  OBJECT_OT_copy_uv_from_joined(Operator):
-    """
-    Copy UVs from joined objects into originals
-    """
-
-    bl_idname = "object.copy_uv_from_joined"
-    bl_label = "Copy UVs from Joined"
-
-    def _findTranslation(self, obact, objects):
-        """
-        Find a translation from original objects to joined
-        """
-
-        bb_joined = getObjectAABB(obact)
-        bb_orig = MINMAX_INIT()
-
-        for ob in objects:
-            if ob != obact:
-                bb = getObjectAABB(ob)
-                MINMAX_DO(bb_orig[0], bb_orig[1], bb[0])
-                MINMAX_DO(bb_orig[0], bb_orig[1], bb[1])
-
-        return bb_joined[0] - bb_orig[0]
-
-    def _getPolygonMedian(self, me, poly):
-        median = Vector()
-        verts = me.vertices
-
-        for vert_index in poly.vertices:
-            median += verts[vert_index].co
-
-        median /= len(poly.vertices)
-
-        return median
-
-    def _getVertexLookupMap(self, obact, objects):
-        """
-        Create a vertex lookup map from joined object space to original object
-        """
-
-        uv_map = {}
-
-        T = self._findTranslation(obact, objects)
-
-        for obj in objects:
-            if obj != obact:
-                me = obj.data
-                mat = obj.matrix_world.copy()
-                uv_layer = me.uv_layers.active
-
-                for poly in me.polygons:
-                    center = mat * self._getPolygonMedian(me, poly) + T
-                    center_key = center.to_tuple(KEY_PRECISION)
-
-                    for loop_index in poly.loop_indices:
-                        loop = me.loops[loop_index]
-                        vert = me.vertices[loop.vertex_index]
-                        vec = mat * vert.co + T
-
-                        key = (center_key, vec.to_tuple(KEY_PRECISION))
-
-                        uv_map.setdefault(key, []).append((center, vec, (uv_layer, loop_index)))
-
-        return uv_map
-
-    def execute(self, context):
-        obact = context.object
-
-        # Check wether we're working with meshes
-        # other object types are not supported
-        if obact.type != 'MESH':
-            self.report({'ERROR'}, "Only meshes are supported")
-            return {'CANCELLED'}
-
-        objects = context.selected_objects
-
-        for obj in context.selected_objects:
-            if obj.type != 'MESH':
-                self.report({'ERROR'}, "Only meshes are supported")
-                return {'CANCELLED'}
-
-        uv_map = self._getVertexLookupMap(obact, objects)
-
-        me = obact.data
-        mat = obact.matrix_world.copy()
-        uv_layer = me.uv_layers.active
-
-        for poly in me.polygons:
-            center = mat * self._getPolygonMedian(me, poly)
-            center_key = center.to_tuple(KEY_PRECISION)
-
-            for loop_index in poly.loop_indices:
-                loop = me.loops[loop_index]
-                vert = me.vertices[loop.vertex_index]
-                vec = mat * vert.co
-
-                key = (center_key, vec.to_tuple(KEY_PRECISION))
-                check_list = uv_map.get(key)
-
-                if check_list is not None:
-                    new_uv = None
-                    closest_data = None
-
-                    dist = FLT_MAX
-                    for x in check_list:
-                        cur_center, cur_vec, data = x
-
-                        d1 = Vector(cur_center) - Vector(center)
-                        d2 = Vector(cur_vec) - Vector(vec)
-
-                        d = d1.length_squared + d2.length_squared
-
-                        if d < dist:
-                            closest_data = data
-                            dist = d
-
-                    if closest_data is not None:
-                        orig_uv_layer, orig_loop_index = closest_data
-                        new_uv = uv_layer.data[loop_index].uv
-                        orig_uv_layer.data[orig_loop_index].uv = new_uv
-                else:
-                    print("Failed to lookup %r" % key)
-
-        return {'FINISHED'}
-
-
-def menu_func(self, context):
-    self.layout.operator("OBJECT_OT_copy_uv_from_joined",
-                         text="Join as UVs (active to other selected)",
-                         icon="PLUGIN")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-    
-    bpy.types.VIEW3D_MT_make_links.append(menu_func)
-    
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.VIEW3D_MT_make_links.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_discombobulator.py b/release/scripts/addons_contrib/mesh_discombobulator.py
deleted file mode 100644
index ea50729..0000000
--- a/release/scripts/addons_contrib/mesh_discombobulator.py
+++ /dev/null
@@ -1,685 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
- 
-bl_info = {
-    "name": "Discombobulator",
-    "description": "Its job is to easily add scifi details to a surface to create nice-looking space-ships or futuristic cities.",
-    "author": "Evan J. Rosky (syrux), Chichiri, Jace Priester",
-    "version": (0,2),
-    "blender": (2, 64, 0),
-    "location": "Spacebar > Discombobulate",
-    "warning": 'Beta',
-    'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts',
-    'tracker_url': 'https://projects.blender.org/tracker/index.php?'\
-                   'func=detail&aid=31390',
-    "category": "Mesh"}
- 
-import bpy
-import random
-import mathutils
-import math
-from mathutils import *
-
-doprots = True
- 
-# Datas in which we will build the new discombobulated mesh
-nPolygons = []
-nVerts = []
-Verts = []
-Polygons = []
-dVerts = []
-dPolygons = []
-i_prots = [] # index of the top polygons on whow we will generate the doodads
-i_dood_type = [] # type of doodad (given by index of the doodad obj)
- 
-bpy.types.Scene.DISC_doodads = []
- 
-def randnum(a, b):
-    return random.random()*(b-a)+a
- 
-def randVertex(a, b, c, d, Verts):
-    """Return a vector of a random vertex on a quad-polygon"""
-    i = random.randint(1,2)
-    A, B, C, D = 0, 0, 0, 0
-    if(a==1):
-        A, B, C, D = a, b, c, d
-    else:
-        A, B, C, D = a, d, c, b
-   
-    i = randnum(0.1, 0.9)
-   
-
-    vecAB=Verts[B]-Verts[A]
-    E=Verts[A]+vecAB*i
-   
-    vecDC=Verts[C]-Verts[D]
-    F=Verts[D]+vecDC*i
-   
-    i = randnum(0.1, 0.9)
-    vecEF=F-E
-    
-    O=E+vecEF*i
-    return O
- 
-################################ Protusions ###################################
- 
-def fill_older_datas(verts, polygon):
-    """ Specifically coded to be called by the function addProtusionToPolygon, its sets up a tuple which contains the vertices from the base and the top of the protusions. """
-    temp_vertices = []  
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    return temp_vertices
-   
-def extrude_top(temp_vertices, normal, height):
-    """ This function extrude the polygon composed of the four first members of the tuple temp_vertices along the normal multiplied by the height of the extrusion."""
-    j = 0
-    while j < 3:  
-        temp_vertices[0][j]+=normal[j]*height
-        temp_vertices[1][j]+=normal[j]*height
-        temp_vertices[2][j]+=normal[j]*height
-        temp_vertices[3][j]+=normal[j]*height
-        j+=1
- 
-def scale_top(temp_vertices, center, normal, height, scale_ratio):
-    """ This function scale the polygon composed of the four first members of the tuple temp_vertices. """
-    vec1 = [0, 0, 0]
-    vec2 = [0, 0, 0]
-    vec3 = [0, 0, 0]
-    vec4 = [0, 0, 0]
-   
-    j = 0
-    while j < 3:
-        center[j]+=normal[j]*height
-        vec1[j] = temp_vertices[0][j] - center[j]
-        vec2[j] = temp_vertices[1][j] - center[j]
-        vec3[j] = temp_vertices[2][j] - center[j]
-        vec4[j] = temp_vertices[3][j] - center[j]
-        temp_vertices[0][j] = center[j] + vec1[j]*(1-scale_ratio)
-        temp_vertices[1][j] = center[j] + vec2[j]*(1-scale_ratio)
-        temp_vertices[2][j] = center[j] + vec3[j]*(1-scale_ratio)
-        temp_vertices[3][j] = center[j] + vec4[j]*(1-scale_ratio)
-        j+=1
- 
-def add_prot_polygons(temp_vertices):
-    """ Specifically coded to be called by addProtusionToPolygon, this function put the data from the generated protusion at the end the tuples Verts and Polygons, which will later used to generate the final mesh. """
-    global Verts
-    global Polygons
-    global i_prots
-   
-    findex = len(Verts)
-    Verts+=temp_vertices
-   
-    polygontop = [findex+0, findex+1, findex+2, findex+3]
-    polygon1 = [findex+0, findex+1, findex+5, findex+4]
-    polygon2 = [findex+1, findex+2, findex+6, findex+5]
-    polygon3 = [findex+2, findex+3, findex+7, findex+6]
-    polygon4 = [findex+3, findex+0, findex+4, findex+7]
-   
-    Polygons.append(polygontop)
-    i_prots.append(len(Polygons)-1)
-    Polygons.append(polygon1)
-    Polygons.append(polygon2)
-    Polygons.append(polygon3)
-    Polygons.append(polygon4)
-       
-def addProtusionToPolygon(obpolygon, verts, minHeight, maxHeight, minTaper, maxTaper):
-    """Create a protusion from the polygon "obpolygon" of the original object and use several values sent by the user. It calls in this order the following functions:
-       - fill_older_data;
-       - extrude_top;
-       - scale_top;
-       - add_prot_polygons;
-   """
-    # some useful variables
-    polygon = obpolygon.vertices
-    polygontop = polygon
-    polygon1 = []
-    polygon2 = []
-    polygon3 = []
-    polygon4 = []
-    vertices = []
-    tVerts = list(fill_older_datas(verts, polygon)) # list of temp vertices
-    height = randnum(minHeight, maxHeight) # height of generated protusion
-    scale_ratio = randnum(minTaper, maxTaper)
-   
-    # extrude the top polygon
-    extrude_top(tVerts, obpolygon.normal, height)
-    # Now, we scale, the top polygon along its normal
-    scale_top(tVerts, GetPolyCentroid(obpolygon,verts), obpolygon.normal, height, scale_ratio)
-    # Finally, we add the protusions to the list of polygons
-    add_prot_polygons(tVerts)
- 
-################################## Divide a polygon ##################################
- 
-def divide_one(list_polygons, list_vertices, verts, polygon, findex):
-    """ called by divide_polygon, to generate a polygon from one polygon, maybe I could simplify this process """
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-   
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+1, findex+2, findex+3])
- 
-def divide_two(list_polygons, list_vertices, verts, polygon, findex):
-    """ called by divide_polygon, to generate two polygons from one polygon and add them to the list of polygons and vertices which form the discombobulated mesh"""
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[1]])/2)
-    temp_vertices.append((verts[polygon[2]]+verts[polygon[3]])/2)
-       
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+4, findex+5, findex+3])
-    list_polygons.append([findex+1, findex+2, findex+5, findex+4])
-
-def divide_three(list_polygons, list_vertices, verts, polygon, findex, center):
-    """ called by divide_polygon, to generate three polygons from one polygon and add them to the list of polygons and vertices which form the discombobulated mesh"""
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[1]])/2)
-    temp_vertices.append((verts[polygon[2]]+verts[polygon[3]])/2)
-    temp_vertices.append((verts[polygon[1]]+verts[polygon[2]])/2)
-    temp_vertices.append(center.copy())
-       
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+4, findex+5, findex+3])
-    list_polygons.append([findex+1, findex+6, findex+7, findex+4])
-    list_polygons.append([findex+6, findex+2, findex+5, findex+7])
-  
-def divide_four(list_polygons, list_vertices, verts, polygon, findex, center):
-    """ called by divide_polygon, to generate four polygons from one polygon and add them to the list of polygons and vertices which form the discombobulated mesh"""
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[1]])/2)
-    temp_vertices.append((verts[polygon[2]]+verts[polygon[3]])/2)
-    temp_vertices.append((verts[polygon[1]]+verts[polygon[2]])/2)
-    temp_vertices.append(center.copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[3]])/2)
-    temp_vertices.append(center.copy())
-   
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+4, findex+7, findex+8])
-    list_polygons.append([findex+1, findex+6, findex+7, findex+4])
-    list_polygons.append([findex+6, findex+2, findex+5, findex+7])
-    list_polygons.append([findex+8, findex+7, findex+5, findex+3])
-   
-def dividepolygon(obpolygon, verts, number):
-    """Divide the poly into the wanted number of polygons"""
-    global nPolygons
-    global nVerts
-   
-    poly = obpolygon.vertices
-    tVerts = []
-   
-    if(number==1):
-        divide_one(nPolygons, nVerts, verts, poly, len(nVerts))
-    elif(number==2):
-        divide_two(nPolygons, nVerts, verts, poly, len(nVerts))
-    elif(number==3):
-        divide_three(nPolygons, nVerts, verts, poly, len(nVerts), GetPolyCentroid(obpolygon,verts))
-    elif(number==4):
-        divide_four(nPolygons, nVerts, verts, poly, len(nVerts), GetPolyCentroid(obpolygon,verts))
-   
-############################### Discombobulate ################################
-
-def GetPolyCentroid(obpolygon,allvertcoords):
-    centroid=mathutils.Vector((0,0,0))
-    for vindex in obpolygon.vertices:
-        centroid+=mathutils.Vector(allvertcoords[vindex])
-    centroid/=len(obpolygon.vertices)
-    return centroid
- 
-def division(obpolygons, verts, sf1, sf2, sf3, sf4):
-    """Function to divide each of the selected polygons"""
-    divide = []
-    if(sf1): divide.append(1)
-    if(sf2): divide.append(2)
-    if(sf3): divide.append(3)
-    if(sf4): divide.append(4)
-    for poly in obpolygons:
-        if(poly.select == True and len(poly.vertices)==4):
-            a = random.randint(0, len(divide)-1)
-            dividepolygon(poly, verts, divide[a])
- 
-def protusion(obverts, obpolygons, minHeight, maxHeight, minTaper, maxTaper):
-    """function to generate the protusions"""
-    verts = []
-    for vertex in obverts:
-        verts.append(vertex.co)
-           
-    for polygon in obpolygons:
-        if(polygon.select == True):
-            if(len(polygon.vertices) == 4):
-                addProtusionToPolygon(polygon, verts, minHeight, maxHeight, minTaper, maxTaper)
- 
-def test_v2_near_v1(v1, v2):
-    if(v1.x - 0.1 <= v2.x <= v1.x + 0.1
-        and v1.y - 0.1 <= v2.y <= v1.y + 0.1
-        and v1.z - 0.1 <= v2.z <= v1.z + 0.1):
-        return True
-   
-    return False
- 
-def angle_between_nor(nor_orig, nor_result):
-    angle = math.acos(nor_orig.dot(nor_result))
-    axis = nor_orig.cross(nor_result).normalized()
-   
-    q = mathutils.Quaternion()
-    q.x = axis.x*math.sin(angle/2)
-    q.y = axis.y*math.sin(angle/2)
-    q.z = axis.z*math.sin(angle/2)
-    q.w = math.cos(angle/2)
-   
-    return q
- 
-def doodads(object1, mesh1, dmin, dmax):
-    """function to generate the doodads"""
-    global dVerts
-    global dPolygons
-    i = 0
-    # on parcoure cette boucle pour ajouter des doodads a toutes les polygons
-    # english translation: this loops adds doodads to all polygons
-    while(i<len(object1.data.polygons)):
-        if object1.data.polygons[i].select==False:
-            continue
-        doods_nbr = random.randint(dmin, dmax)
-        j = 0
-        while(j<=doods_nbr):
-            origin_dood = randVertex(object1.data.polygons[i].vertices[0], object1.data.polygons[i].vertices[1], object1.data.polygons[i].vertices[2], object1.data.polygons[i].vertices[3], Verts)
-            type_dood = random.randint(0, len(bpy.context.scene.DISC_doodads)-1)
-            polygons_add = []
-            verts_add = []
-           
-            # First we have to apply scaling and rotation to the mesh
-            bpy.ops.object.select_pattern(pattern=bpy.context.scene.DISC_doodads[type_dood],extend=False)
-            bpy.context.scene.objects.active=bpy.data.objects[bpy.context.scene.DISC_doodads[type_dood]]
-            bpy.ops.object.transform_apply(rotation=True, scale=True)
-           
-            for polygon in bpy.data.objects[bpy.context.scene.DISC_doodads[type_dood]].data.polygons:
-                polygons_add.append(polygon.vertices)
-            for vertex in bpy.data.objects[bpy.context.scene.DISC_doodads[type_dood]].data.vertices:
-                verts_add.append(vertex.co.copy())
-            normal_original_polygon = object1.data.polygons[i].normal
-           
-            nor_def = mathutils.Vector((0.0, 0.0, 1.0))
-            qr = nor_def.rotation_difference(normal_original_polygon.normalized())
-           
-            case_z = False
-            if(test_v2_near_v1(nor_def, -normal_original_polygon)):
-                case_z = True
-                qr = mathutils.Quaternion((0.0, 0.0, 0.0, 0.0))
-            #qr = angle_between_nor(nor_def, normal_original_polygon)
-            for vertex in verts_add:
-                vertex.rotate(qr)
-                vertex+=origin_dood
-            findex = len(dVerts)
-            for polygon in polygons_add:
-                dPolygons.append([polygon[0]+findex, polygon[1]+findex, polygon[2]+findex, polygon[3]+findex])
-                i_dood_type.append(bpy.data.objects[bpy.context.scene.DISC_doodads[type_dood]].name)
-            for vertex in verts_add:
-                dVerts.append(vertex)
-            j+=1
-        i+=5
-       
-def protusions_repeat(object1, mesh1, r_prot):
-
-        for j in i_prots:
-            if j<len(object1.data.polygons):
-                object1.data.polygons[j].select=True
-            else:
-                print("Warning: hit end of polygons in object1")
- 
-# add material to discombobulated mesh
-def setMatProt(discObj, origObj, sideProtMat, topProtMat):
-    # First we put the materials in their slots
-    bpy.ops.object.select_pattern(pattern = discObj.name,extend=False)
-    bpy.context.scene.objects.active=bpy.data.objects[discObj.name]
-    try:
-        origObj.material_slots[topProtMat]
-        origObj.material_slots[sideProtMat]
-    except:
-        return
-        
-    bpy.ops.object.material_slot_add()
-    bpy.ops.object.material_slot_add()
-    discObj.material_slots[0].material = origObj.material_slots[topProtMat].material
-    discObj.material_slots[1].material = origObj.material_slots[sideProtMat].material
-   
-    # Then we assign materials to protusions
-    for polygon in discObj.data.polygons:
-        if polygon.index in i_prots:
-            polygon.material_index = 0
-        else:
-            polygon.material_index = 1
- 
-def setMatDood(doodObj):
-    # First we add the materials slots
-    bpy.ops.object.select_pattern(pattern = doodObj.name,extend=False)
-    bpy.context.scene.objects.active=doodObj
-    for name in bpy.context.scene.DISC_doodads:
-        try:
-            bpy.ops.object.material_slot_add()
-            doodObj.material_slots[-1].material = bpy.data.objects[name].material_slots[0].material
-            for polygon in doodObj.data.polygons:
-                if i_dood_type[polygon.index] == name:
-                    polygon.material_index = len(doodObj.material_slots)-1
-        except:
-            print()
-           
-           
-def clean_doodads():
-    current_doodads=list(bpy.context.scene.DISC_doodads)
-    
-    for name in current_doodads:
-        if name not in bpy.data.objects:
-            bpy.context.scene.DISC_doodads.remove(name)
-            
-
-def discombobulate(minHeight, maxHeight, minTaper, maxTaper, sf1, sf2, sf3, sf4, dmin, dmax, r_prot, sideProtMat, topProtMat, isLast):
-    global doprots
-    global nVerts
-    global nPolygons
-    global Verts
-    global Polygons
-    global dVerts
-    global dPolygons
-    global i_prots
-    
-   
-    bpy.ops.object.mode_set(mode="OBJECT")
-    
-    
-    #start by cleaning up doodads that don't exist anymore
-    clean_doodads()
-    
-    
-    # Create the discombobulated mesh
-    mesh = bpy.data.meshes.new("tmp")
-    object = bpy.data.objects.new("tmp", mesh)
-    bpy.context.scene.objects.link(object)
-   
-    # init final verts and polygons tuple
-    nPolygons = []
-    nVerts = []
-    Polygons = []
-    Verts = []
-    dPolygons = []
-    dVerts = []
-   
-    origObj = bpy.context.active_object
-   
-    # There we collect the rotation, translation and scaling datas from the original mesh
-    to_translate = bpy.context.active_object.location
-    to_scale     = bpy.context.active_object.scale
-    to_rotate    = bpy.context.active_object.rotation_euler
-   
-    # First, we collect all the informations we will need from the previous mesh        
-    obverts = bpy.context.active_object.data.vertices
-    obpolygons = bpy.context.active_object.data.polygons
-    verts = []
-    for vertex in obverts:
-        verts.append(vertex.co)
-   
-    division(obpolygons, verts, sf1, sf2, sf3, sf4)
-       
-    # Fill in the discombobulated mesh with the new polygons
-    mesh.from_pydata(nVerts, [], nPolygons)
-    mesh.update(calc_edges = True)
-   
-    # Reload the datas
-    bpy.ops.object.select_all(action="DESELECT")
-    bpy.ops.object.select_pattern(pattern = object.name,extend=False)
-    bpy.context.scene.objects.active=bpy.data.objects[object.name]
-    obverts = bpy.context.active_object.data.vertices
-    obpolygons = bpy.context.active_object.data.polygons
-   
-    protusion(obverts, obpolygons, minHeight, maxHeight, minTaper, maxTaper)
-   
-    # Fill in the discombobulated mesh with the new polygons
-    mesh1 = bpy.data.meshes.new("discombobulated_object")
-    object1 = bpy.data.objects.new("discombobulated_mesh", mesh1)
-    bpy.context.scene.objects.link(object1)
-    mesh1.from_pydata(Verts, [], Polygons)
-    mesh1.update(calc_edges = True)
-   
-   
-    # Set the material's of discombobulated object
-    setMatProt(object1, origObj, sideProtMat, topProtMat)
-   
-    bpy.ops.object.select_pattern(pattern = object1.name,extend=False)
-    bpy.context.scene.objects.active=bpy.data.objects[object1.name]
-    bpy.ops.object.mode_set(mode='EDIT')
-    bpy.ops.mesh.normals_make_consistent(inside=False)
-    bpy.ops.mesh.select_all(action='DESELECT')
-    bpy.ops.object.mode_set(mode='OBJECT')
-   
-    #if(bpy.context.scene.repeatprot):
-    protusions_repeat(object1, mesh1, r_prot)
-   
-    if(len(bpy.context.scene.DISC_doodads) != 0 and bpy.context.scene.dodoodads and isLast):
-        doodads(object1, mesh1, dmin, dmax)
-        mesh2 = bpy.data.meshes.new("dood_mesh")
-        object2 = bpy.data.objects.new("dood_obj", mesh2)
-        bpy.context.scene.objects.link(object2)
-        mesh2.from_pydata(dVerts, [], dPolygons)
-        mesh2.update(calc_edges = True)
-        setMatDood(object2)
-        object2.location        = to_translate
-        object2.rotation_euler  = to_rotate
-        object2.scale           = to_scale
- 
-    bpy.ops.object.select_pattern(pattern = object.name,extend=False)
-    bpy.context.scene.objects.active=bpy.data.objects[object.name]
-    bpy.ops.object.delete()
-    
-    bpy.ops.object.select_pattern(pattern=object1.name,extend=False)
-    bpy.context.scene.objects.active=bpy.data.objects[object1.name]
-    bpy.context.scene.update()
-   
-    # translate, scale and rotate discombobulated results
-    object1.location        = to_translate
-    object1.rotation_euler  = to_rotate
-    object1.scale           = to_scale
-    
-    #set all polys to selected. this allows recursive discombobulating.
-    for poly in mesh1.polygons:
-        poly.select=True
- 
-############ Operator to select and deslect an object as a doodad ###############
- 
-class chooseDoodad(bpy.types.Operator):
-    bl_idname = "object.discombobulate_set_doodad"
-    bl_label = "Discombobulate set doodad object"
-   
-    def execute(self, context):
-        bpy.context.scene.DISC_doodads.append(bpy.context.active_object.name)
-       
-    def invoke(self, context, event):
-        self.execute(context)
-        return {'FINISHED'}
- 
-class unchooseDoodad(bpy.types.Operator):
-    bl_idname = "object.discombobulate_unset_doodad"
-    bl_label = "Discombobulate unset doodad object"
-   
-    def execute(self, context):
-        for name in bpy.context.scene.DISC_doodads:
-            if name == bpy.context.active_object.name:
-                bpy.context.scene.DISC_doodads.remove(name)
-               
-    def invoke(self, context, event):
-        self.execute(context)
-        return {'FINISHED'}
- 
-################################## Interpolygon ####################################
- 
-class discombobulator(bpy.types.Operator):
-    bl_idname = "object.discombobulate"
-    bl_label = "Discombobulate"
-    bl_options = {'REGISTER', 'UNDO'}  
-   
-    def execute(self, context):
-        scn = context.scene
-        i=0
-        while i<scn.repeatprot:
-            isLast=False
-            if i==scn.repeatprot-1:
-                isLast=True
-            discombobulate(scn.minHeight, scn.maxHeight, scn.minTaper, scn.maxTaper, scn.subpolygon1, scn.subpolygon2, scn.subpolygon3, scn.subpolygon4, scn.mindoodads, scn.maxdoodads, scn.repeatprot, scn.sideProtMat, scn.topProtMat, isLast)
-            i+=1
-        return {'FINISHED'}
-
-class discombob_help(bpy.types.Operator):
-	bl_idname = 'help.discombobulator'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Works with Quads only not Ngons.')
-		layout.label('Select a face or faces')
-		layout.label('Press Discombobulate to create greebles')
-
-
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 300)
-		
-class VIEW3D_PT_tools_discombobulate(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Discombobulator"
-    bl_context = "objectmode"
-    bl_options = {'DEFAULT_CLOSED'}
-	
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-        row = layout.split(0.80)
-        row.operator('object.discombobulate', text = 'Discombobulate', icon = 'PLUGIN')
-        row.operator('help.discombobulator', icon = 'INFO')
-        box = layout.box()
-        box.label("Protusions settings")
-        row = box.row()
-        row.prop(context.scene, 'doprots')
-        row = box.row()
-        row.prop(context.scene, 'minHeight')
-        row = box.row()
-        row.prop(context.scene, 'maxHeight')
-        row = box.row()
-        row.prop(context.scene, 'minTaper')
-        row = box.row()
-        row.prop(context.scene, 'maxTaper')
-        row = box.row()
-        col1 = row.column(align = True)
-        col1.prop(context.scene, "subpolygon1")
-        col2 = row.column(align = True)
-        col2.prop(context.scene, "subpolygon2")
-        col3 = row.column(align = True)
-        col3.prop(context.scene, "subpolygon3")
-        col4 = row.column(align = True)
-        col4.prop(context.scene, "subpolygon4")
-        row = box.row()
-        row.prop(context.scene, "repeatprot")
-        box = layout.box()
-        box.label("Doodads settings")
-        row = box.row()
-        row.prop(context.scene, 'dodoodads')
-        row = box.row()
-        row.prop(context.scene, "mindoodads")
-        row = box.row()
-        row.prop(context.scene, "maxdoodads")
-        row = box.row()
-        row.operator("object.discombobulate_set_doodad", text = "Pick doodad")
-        row = box.row()
-        row.operator("object.discombobulate_unset_doodad", text = "Remove doodad")
-        col = box.column(align = True)
-        for name in bpy.context.scene.DISC_doodads:
-            col.label(text = name)
-        box = layout.box()
-        box.label("Materials settings")
-        row = box.row()
-        row.prop(context.scene, 'topProtMat')
-        row = box.row()
-        row.prop(context.scene, "sideProtMat")
-        row = box.row()
-           
-# registering and menu integration
-def register():
-    # Protusions Buttons:
-    bpy.types.Scene.repeatprot = bpy.props.IntProperty(name="Repeat protusions", description="make several layers of protusion", default = 1, min = 1, max = 10)
-    bpy.types.Scene.doprots = bpy.props.BoolProperty(name="Make protusions", description = "Check if we want to add protusions to the mesh", default = True)
-    bpy.types.Scene.polygonschangedpercent = bpy.props.FloatProperty(name="Polygon %", description = "Percentage of changed polygons", default = 1.0)
-    bpy.types.Scene.minHeight = bpy.props.FloatProperty(name="Min height", description="Minimal height of the protusions", default=0.2)
-    bpy.types.Scene.maxHeight = bpy.props.FloatProperty(name="Max height", description="Maximal height of the protusions", default = 0.4)
-    bpy.types.Scene.minTaper = bpy.props.FloatProperty(name="Min taper", description="Minimal height of the protusions", default=0.15, min = 0.0, max = 1.0, subtype = 'PERCENTAGE')
-    bpy.types.Scene.maxTaper = bpy.props.FloatProperty(name="Max taper", description="Maximal height of the protusions", default = 0.35, min = 0.0, max = 1.0, subtype = 'PERCENTAGE')
-    bpy.types.Scene.subpolygon1 = bpy.props.BoolProperty(name="1", default = True)
-    bpy.types.Scene.subpolygon2 = bpy.props.BoolProperty(name="2", default = True)
-    bpy.types.Scene.subpolygon3 = bpy.props.BoolProperty(name="3", default = True)
-    bpy.types.Scene.subpolygon4 = bpy.props.BoolProperty(name="4", default = True)
-   
-    # Doodads buttons:
-    bpy.types.Scene.dodoodads = bpy.props.BoolProperty(name="Make doodads", description = "Check if we want to generate doodads", default = True)
-    bpy.types.Scene.mindoodads = bpy.props.IntProperty(name="Minimum doodads number", description = "Ask for the minimum number of doodads to generate per polygon", default = 1, min = 0, max = 50)
-    bpy.types.Scene.maxdoodads = bpy.props.IntProperty(name="Maximum doodads number", description = "Ask for the maximum number of doodads to generate per polygon", default = 6, min = 1, max = 50)
-    bpy.types.Scene.doodMinScale = bpy.props.FloatProperty(name="Scale min", description="Minimum scaling of doodad", default = 0.5, min = 0.0, max = 1.0, subtype = 'PERCENTAGE')
-    bpy.types.Scene.doodMaxScale = bpy.props.FloatProperty(name="Scale max", description="Maximum scaling of doodad", default = 1.0, min = 0.0, max = 1.0, subtype = 'PERCENTAGE')
-   
-    # Materials buttons:
-    bpy.types.Scene.sideProtMat = bpy.props.IntProperty(name="Side's prot mat", description = "Material of protusion's sides", default = 0, min = 0)
-    bpy.types.Scene.topProtMat = bpy.props.IntProperty(name = "Prot's top mat", description = "Material of protusion's top", default = 0, min = 0)
-   
-    bpy.utils.register_class(discombobulator)
-    bpy.utils.register_class(chooseDoodad)
-    bpy.utils.register_class(unchooseDoodad)
-    bpy.utils.register_class(VIEW3D_PT_tools_discombobulate)
-    bpy.utils.register_class(discombob_help)
- 
-# unregistering and removing menus
-def unregister():
-    bpy.utils.unregister_class(discombobulator)
-    bpy.utils.unregister_class(chooseDoodad)
-    bpy.utils.unregister_class(unchooseDoodad)
-    bpy.utils.unregister_class(VIEW3D_PT_tools_discombobulate)
-    bpy.utils.unregister_class(discombob_help)
- 
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_edge_intersection_tools.py b/release/scripts/addons_contrib/mesh_edge_intersection_tools.py
deleted file mode 100644
index 389bfdb..0000000
--- a/release/scripts/addons_contrib/mesh_edge_intersection_tools.py
+++ /dev/null
@@ -1,332 +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 LICENCE BLOCK
-'''
-
-bl_info = {
-    "name": "Edge tools : tinyCAD VTX",
-    "author": "zeffii",
-    "version": (0, 5, 1),
-    "blender": (2, 56, 0),
-    "category": "Mesh",
-    "location": "View3D > EditMode > (w) Specials",
-    "warning": "Still under development",
-    "wiki_url": "http://wiki.blender.org/index.php/"\
-        "Extensions:2.6/Py/Scripts/Modeling/Edge_Slice",
-    "tracker_url": "http://projects.blender.org/tracker/"\
-        "?func=detail&aid=25227"
-   }
-
-"""
-parts based on Keith (Wahooney) Boshoff, cursor to intersection script and
-Paul Bourke's Shortest Line Between 2 lines, and thanks to PKHG from BA.org
-for attempting to explain things to me that i'm not familiar with.
-TODO: [ ] allow multi selection ( > 2 ) for Slice/Weld intersection mode
-TODO: [ ] streamline this code !
-
-1) Edge Extend To Edge ( T )
-2) Edge Slice Intersecting ( X )
-3) Edge Project Converging  ( V )
-
-"""
-
-import bpy
-import sys
-from mathutils import Vector, geometry
-from mathutils.geometry import intersect_line_line as LineIntersect
-
-VTX_PRECISION = 1.0e-5 # or 1.0e-6 ..if you need
-
-#   returns distance between two given points
-def mDist(A, B): return (A-B).length
-
-
-#   returns True / False if a point happens to lie on an edge
-def isPointOnEdge(point, A, B):
-    eps = ((mDist(A, B) - mDist(point,B)) - mDist(A,point))
-    if abs(eps) < VTX_PRECISION: return True
-    else:
-        print('distance is ' + str(eps))
-        return False
-
-
-#   returns the number of edges that a point lies on.
-def CountPointOnEdges(point, outer_points):
-    count = 0
-    if(isPointOnEdge(point, outer_points[0][0], outer_points[0][1])): count+=1
-    if(isPointOnEdge(point, outer_points[1][0], outer_points[1][1])): count+=1
-    return count
-
-
-#   takes Vector List and returns tuple of points in expected order. 
-def edges_to_points(edges):
-    (vp1, vp2) = (Vector((edges[0][0])), Vector((edges[0][1])))
-    (vp3, vp4) = (Vector((edges[1][0])), Vector((edges[1][1])))
-    return (vp1,vp2,vp3,vp4)
-
-
-#   takes a list of 4 vectors and returns True or False depending on checks
-def checkIsMatrixCoplanar(verti):
-    (v1, v2, v3, v4) = edges_to_points(verti)   #unpack
-    shortest_line = LineIntersect(v1, v2, v3, v4)
-    if mDist(shortest_line[1], shortest_line[0]) > VTX_PRECISION: return False
-    else: return True
-
-
-#   point = the halfway mark on the shortlest line between two lines
-def checkEdges(Edge, obj):
-    (p1, p2, p3, p4) = edges_to_points(Edge)
-    line = LineIntersect(p1, p2, p3, p4)
-    point = ((line[0] + line[1]) / 2) # or point = line[0]
-    return point
-
-#   returns (object, number of verts, number of edges) && object mode == True
-def GetActiveObject():
-    bpy.ops.object.mode_set(mode='EDIT')
-    bpy.ops.mesh.delete(type='EDGE') # removes edges + verts
-    (vert_count, edge_count) = getVertEdgeCount()
-    (vert_num, edge_num) = (len(vert_count),len(edge_count))
-
-    bpy.ops.object.mode_set(mode='OBJECT') # to be sure.
-    o = bpy.context.active_object
-    return (o, vert_num, edge_num)
-
-
-def AddVertsToObject(vert_count, o, mvX, mvA, mvB, mvC, mvD):
-    o.data.vertices.add(5)
-    pointlist = [mvX, mvA, mvB, mvC, mvD]
-    for vpoint in range(len(pointlist)):
-        o.data.vertices[vert_count+vpoint].co = pointlist[vpoint]
-
-
-#   Used when the user chooses to slice/Weld, vX is intersection point
-def makeGeometryWeld(vX,outer_points):
-    (o, vert_count, edge_count) =  GetActiveObject()
-    (vA, vB, vC, vD) =  edges_to_points(outer_points)
-    AddVertsToObject(vert_count, o, vA, vX, vB, vC, vD) # o is the object
-
-    oe = o.data.edges
-    oe.add(4)
-    oe[edge_count].vertices = [vert_count,vert_count+1]
-    oe[edge_count+1].vertices = [vert_count+2,vert_count+1]
-    oe[edge_count+2].vertices = [vert_count+3,vert_count+1]
-    oe[edge_count+3].vertices = [vert_count+4,vert_count+1]
-
-
-#   Used for extending an edge to a point on another edge.
-def ExtendEdge(vX, outer_points, count):
-    (o, vert_count, edge_count) =  GetActiveObject()
-    (vA, vB, vC, vD) =  edges_to_points(outer_points)
-    AddVertsToObject(vert_count, o, vX, vA, vB, vC, vD)
-
-    oe = o.data.edges
-    oe.add(4)
-    # Candidate for serious optimization.
-    if isPointOnEdge(vX, vA, vB):
-        oe[edge_count].vertices = [vert_count, vert_count+1]
-        oe[edge_count+1].vertices = [vert_count, vert_count+2]
-        # find which of C and D is farthest away from X
-        if mDist(vD, vX) > mDist(vC, vX):
-            oe[edge_count+2].vertices = [vert_count, vert_count+3]
-            oe[edge_count+3].vertices = [vert_count+3, vert_count+4]
-        if mDist(vC, vX) > mDist(vD, vX):
-            oe[edge_count+2].vertices = [vert_count, vert_count+4]
-            oe[edge_count+3].vertices = [vert_count+3, vert_count+4]
-
-    if isPointOnEdge(vX, vC, vD):
-        oe[edge_count].vertices = [vert_count, vert_count+3]
-        oe[edge_count+1].vertices = [vert_count, vert_count+4]
-        # find which of A and B is farthest away from X 
-        if mDist(vB, vX) > mDist(vA, vX):
-            oe[edge_count+2].vertices = [vert_count, vert_count+1]
-            oe[edge_count+3].vertices = [vert_count+1, vert_count+2]
-        if mDist(vA, vX) > mDist(vB, vX):
-            oe[edge_count+2].vertices = [vert_count, vert_count+2]
-            oe[edge_count+3].vertices = [vert_count+1, vert_count+2]
-
-
-#   ProjectGeometry is used to extend two edges to their intersection point.
-def ProjectGeometry(vX, opoint):
-
-    def return_distance_checked(X, A, B):
-        dist1 = mDist(X, A)
-        dist2 = mDist(X, B)
-        point_choice = min(dist1, dist2)
-        if point_choice == dist1: return A, B
-        else: return B, A
-
-    (o, vert_count, edge_count) =  GetActiveObject()
-    vA, vB = return_distance_checked(vX, Vector((opoint[0][0])), Vector((opoint[0][1])))
-    vC, vD = return_distance_checked(vX, Vector((opoint[1][0])), Vector((opoint[1][1])))
-    AddVertsToObject(vert_count, o, vX, vA, vB, vC, vD)
-
-    oe = o.data.edges
-    oe.add(4)
-    oe[edge_count].vertices = [vert_count, vert_count+1]
-    oe[edge_count+1].vertices = [vert_count, vert_count+3]
-    oe[edge_count+2].vertices = [vert_count+1, vert_count+2]
-    oe[edge_count+3].vertices = [vert_count+3, vert_count+4]
-
-
-def getMeshMatrix(obj):
-    is_editmode = (obj.mode == 'EDIT')
-    if is_editmode:
-        bpy.ops.object.mode_set(mode='OBJECT')
-
-    (edges, meshMatrix) = ([],[])
-    mesh = obj.data
-    verts = mesh.vertices
-    for e in mesh.edges:
-        if e.select:
-            edges.append(e)
-
-    edgenum = 0
-    for edge_to_test in edges:
-        p1 = verts[edge_to_test.vertices[0]].co
-        p2 = verts[edge_to_test.vertices[1]].co
-        meshMatrix.append([Vector(p1),Vector(p2)])
-        edgenum += 1
-
-    return meshMatrix
-
-
-def getVertEdgeCount():
-    bpy.ops.object.mode_set(mode='OBJECT')
-    vert_count = bpy.context.active_object.data.vertices
-    edge_count = bpy.context.active_object.data.edges
-    return (vert_count, edge_count)
-
-
-def runCleanUp():
-    bpy.ops.object.mode_set(mode='EDIT')
-    bpy.ops.mesh.select_all(action='TOGGLE')
-    bpy.ops.mesh.select_all(action='TOGGLE')
-    bpy.ops.mesh.remove_doubles(threshold=VTX_PRECISION)
-    bpy.ops.mesh.select_all(action='TOGGLE') #unselect all
-
-
-def initScriptV(context, self):
-    obj = bpy.context.active_object
-    meshMatrix = getMeshMatrix(obj)
-    (vert_count, edge_count) = getVertEdgeCount()
-
-    #need 2 edges to be of any use.
-    if len(meshMatrix) < 2: 
-        print(str(len(meshMatrix)) +" select, make sure (only) 2 are selected")
-        return
-
-    #dont go any further if the verts are not coplanar
-    if checkIsMatrixCoplanar(meshMatrix): print("seems within tolerance, proceed")
-    else: 
-        print("check your geometry, or decrease tolerance value")
-        return
-
-    # if we reach this point, the edges are coplanar
-    # force edit mode
-    bpy.ops.object.mode_set(mode='EDIT')
-    vSel = bpy.context.active_object.data.total_vert_sel
-
-    if checkEdges(meshMatrix, obj) == None: print("lines dont intersect")
-    else:
-        count = CountPointOnEdges(checkEdges(meshMatrix, obj), meshMatrix)
-        if count == 0:
-            ProjectGeometry(checkEdges(meshMatrix, obj), meshMatrix)
-            runCleanUp()
-        else:
-            print("The intersection seems to lie on 1 or 2 edges already")
-
-
-def initScriptT(context, self):
-    obj = bpy.context.active_object
-    meshMatrix = getMeshMatrix(obj)
-    ## force edit mode
-    bpy.ops.object.mode_set(mode='EDIT')
-    vSel = bpy.context.active_object.data.total_vert_sel
-
-    if len(meshMatrix) != 2:
-        print(str(len(meshMatrix)) +" select 2 edges")
-    else:
-        count = CountPointOnEdges(checkEdges(meshMatrix, obj), meshMatrix)
-        if count == 1:
-            print("Good, Intersection point lies on one of the two edges!")
-            ExtendEdge(checkEdges(meshMatrix, obj), meshMatrix, count)
-            runCleanUp()    #neutral function, for removing potential doubles
-        else:
-            print("Intersection point not on chosen edges")
-
-
-def initScriptX(context, self):
-    obj = bpy.context.active_object
-    meshMatrix = getMeshMatrix(obj)
-    ## force edit mode
-    bpy.ops.object.mode_set(mode='EDIT')
-
-    if len(meshMatrix) != 2:
-        print(str(len(meshMatrix)) +" select, make sure (only) 2 are selected")
-    else:
-        if checkEdges(meshMatrix, obj) == None:
-            print("lines dont intersect")
-        else: 
-            count = CountPointOnEdges(checkEdges(meshMatrix, obj), meshMatrix)
-            if count == 2:
-                makeGeometryWeld(checkEdges(meshMatrix, obj), meshMatrix)
-                runCleanUp()
-
-
-class EdgeIntersections(bpy.types.Operator):
-    """Makes a weld/slice/extend to intersecting edges/lines"""
-    bl_idname = 'mesh.intersections'
-    bl_label = 'Edge tools : tinyCAD VTX'
-    # bl_options = {'REGISTER', 'UNDO'}
-
-    mode = bpy.props.IntProperty(name = "Mode",
-                    description = "switch between intersection modes",
-                    default = 2)
-
-    @classmethod
-    def poll(self, context):
-        obj = context.active_object
-        return obj != None and obj.type == 'MESH'
-
-    def execute(self, context):
-        if self.mode == -1:
-            initScriptV(context, self)
-        if self.mode == 0:
-            initScriptT(context, self)
-        if self.mode == 1:
-            initScriptX(context, self)
-        if self.mode == 2:
-            print("something undefined happened, send me a test case!")
-        return {'FINISHED'}
-
-
-def menu_func(self, context):
-    self.layout.operator(EdgeIntersections.bl_idname, text="Edges V Intersection").mode = -1
-    self.layout.operator(EdgeIntersections.bl_idname, text="Edges T Intersection").mode = 0
-    self.layout.operator(EdgeIntersections.bl_idname, text="Edges X Intersection").mode = 1
-
-def register():
-    bpy.utils.register_class(EdgeIntersections)
-    bpy.types.VIEW3D_MT_edit_mesh_specials.append(menu_func)
-
-def unregister():
-    bpy.utils.unregister_class(EdgeIntersections)
-    bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_edgetools.py b/release/scripts/addons_contrib/mesh_edgetools.py
deleted file mode 100644
index e208ff9..0000000
--- a/release/scripts/addons_contrib/mesh_edgetools.py
+++ /dev/null
@@ -1,1979 +0,0 @@
-# Blender EdgeTools
-#
-# This is a toolkit for edge manipulation based on several of mesh manipulation
-# abilities of several CAD/CAE packages, notably CATIA's Geometric Workbench
-# from which most of these tools have a functional basis based on the paradims
-# that platform enables.  These tools are a collection of scripts that I needed
-# at some point, and so I will probably add and improve these as I continue to
-# use and model with them.
-#
-# It might be good to eventually merge the tinyCAD VTX tools for unification
-# purposes, and as these are edge-based tools, it would make sense.  Or maybe
-# merge this with tinyCAD instead?
-#
-# The GUI and Blender add-on structure shamelessly coded in imitation of the
-# LoopTools addon.
-#
-# Examples:
-#   - "Ortho" inspired from CATIA's line creation tool which creates a line of a
-#       user specified length at a user specified angle to a curve at a chosen
-#       point.  The user then selects the plane the line is to be created in.
-#   - "Shaft" is inspired from CATIA's tool of the same name.  However, instead
-#       of a curve around an axis, this will instead shaft a line, a point, or
-#       a fixed radius about the selected axis.
-#   - "Slice" is from CATIA's ability to split a curve on a plane.  When
-#       completed this be a Python equivalent with all the same basic
-#       functionality, though it will sadly be a little clumsier to use due
-#       to Blender's selection limitations.
-#
-# Notes:
-#   - Buggy parts have been hidden behind bpy.app.debug.  Run Blender in debug
-#       to expose those.  Example: Shaft with more than two edges selected.
-#   - Some functions have started to crash, despite working correctly before.
-#       What could be causing that?  Blender bug?  Or coding bug?
-#
-# Paul "BrikBot" Marshall
-# Created: January 28, 2012
-# Last Modified: October 6, 2012
-# Homepage (blog): http://post.darkarsenic.com/
-#                       //blog.darkarsenic.com/
-#
-# Coded in IDLE, tested in Blender 2.6.
-# Search for "@todo" to quickly find sections that need work.
-#
-# Remeber -
-#   Functional code comes before fast code.  Once it works, then worry about
-#   making it faster/more efficient.
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  The Blender Edgetools is to bring CAD tools to Blender.
-#  Copyright (C) 2012  Paul Marshall
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-# ^^ Maybe. . . . :P
-
-bl_info = {
-    "name": "EdgeTools",
-    "author": "Paul Marshall",
-    "version": (0, 8),
-    "blender": (2, 64, 0),
-    "location": "View3D > Toolbar and View3D > Specials (W-key)",
-    "warning": "",
-    "description": "CAD style edge manipulation tools",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Modeling/EdgeTools",
-    "tracker_url": "https://blenderpython.svn.sourceforge.net/svnroot/blenderpython/scripts_library/scripts/addons_extern/mesh_edgetools.py",
-    "category": "Mesh"}
-
-import bpy, bmesh, mathutils
-from math import acos, pi, radians, sqrt, tan
-from mathutils import Matrix, Vector
-from mathutils.geometry import (distance_point_to_plane,
-                                interpolate_bezier,
-                                intersect_point_line,
-                                intersect_line_line,
-                                intersect_line_plane)
-from bpy.props import (BoolProperty,
-                       BoolVectorProperty,
-                       IntProperty,
-                       FloatProperty,
-                       EnumProperty)
-
-integrated = False
-
-# Quick an dirty method for getting the sign of a number:
-def sign(number):
-    return (number > 0) - (number < 0)
-
-
-# is_parallel
-#
-# Checks to see if two lines are parallel
-def is_parallel(v1, v2, v3, v4):
-    result = intersect_line_line(v1, v2, v3, v4) 
-    return result == None
-
-
-# is_axial
-#
-# This is for the special case where the edge is parallel to an axis.  In this
-# the projection onto the XY plane will fail so it will have to be handled
-# differently.  This tells us if and how:
-def is_axial(v1, v2, error = 0.000002):
-    vector = v2 - v1
-    # Don't need to store, but is easier to read:
-    vec0 = vector[0] > -error and vector[0] < error
-    vec1 = vector[1] > -error and vector[1] < error
-    vec2 = vector[2] > -error and vector[2] < error
-    if (vec0 or vec1) and vec2:
-        return 'Z'
-    elif vec0 and vec1:
-        return 'Y'
-    return None
-
-
-# is_same_co
-#
-# For some reason "Vector = Vector" does not seem to look at the actual
-# coordinates.  This provides a way to do so.
-def is_same_co(v1, v2):
-    if len(v1) != len(v2):
-        return False
-    else:
-        for co1, co2 in zip(v1, v2):
-            if co1 != co2:
-                return False
-    return True
-
-
-# is_face_planar
-#
-# Tests a face to see if it is planar.
-def is_face_planar(face, error = 0.0005):
-    for v in face.verts:
-        d = distance_point_to_plane(v.co, face.verts[0].co, face.normal)
-        if bpy.app.debug:
-            print("Distance: " + str(d))
-        if d < -error or d > error:
-            return False
-    return True
-
-
-# other_joined_edges
-#
-# Starts with an edge.  Then scans for linked, selected edges and builds a
-# list with them in "order", starting at one end and moving towards the other.
-def order_joined_edges(edge, edges = [], direction = 1):
-    if len(edges) == 0:
-        edges.append(edge)
-        edges[0] = edge
-
-    if bpy.app.debug:
-        print(edge, end = ", ")
-        print(edges, end = ", ")
-        print(direction, end = "; ")
-
-    # Robustness check: direction cannot be zero
-    if direction == 0:
-        direction = 1
-
-    newList = []
-    for e in edge.verts[0].link_edges:
-        if e.select and edges.count(e) == 0:
-            if direction > 0:
-                edges.insert(0, e)
-                newList.extend(order_joined_edges(e, edges, direction + 1))
-                newList.extend(edges)
-            else:
-                edges.append(e)
-                newList.extend(edges)
-                newList.extend(order_joined_edges(e, edges, direction - 1))
-
-    # This will only matter at the first level:
-    direction = direction * -1
-
-    for e in edge.verts[1].link_edges:
-        if e.select and edges.count(e) == 0:
-            if direction > 0:
-                edges.insert(0, e)
-                newList.extend(order_joined_edges(e, edges, direction + 2))
-                newList.extend(edges)
-            else:
-                edges.append(e)
-                newList.extend(edges)
-                newList.extend(order_joined_edges(e, edges, direction))
-
-    if bpy.app.debug:
-        print(newList, end = ", ")
-        print(direction)
-
-    return newList
-
-
-# --------------- GEOMETRY CALCULATION METHODS --------------
-
-# distance_point_line
-#
-# I don't know why the mathutils.geometry API does not already have this, but
-# it is trivial to code using the structures already in place.  Instead of
-# returning a float, I also want to know the direction vector defining the
-# distance.  Distance can be found with "Vector.length".
-def distance_point_line(pt, line_p1, line_p2):
-    int_co = intersect_point_line(pt, line_p1, line_p2)
-    distance_vector = int_co[0] - pt
-    return distance_vector
-
-
-# interpolate_line_line
-#
-# This is an experiment into a cubic Hermite spline (c-spline) for connecting
-# two edges with edges that obey the general equation.
-# This will return a set of point coordinates (Vectors).
-#
-# A good, easy to read background on the mathematics can be found at:
-# http://cubic.org/docs/hermite.htm
-#
-# Right now this is . . . less than functional :P
-# @todo
-#   - C-Spline and Bezier curves do not end on p2_co as they are supposed to.
-#   - B-Spline just fails.  Epically.
-#   - Add more methods as I come across them.  Who said flexibility was bad?
-def interpolate_line_line(p1_co, p1_dir, p2_co, p2_dir, segments, tension = 1,
-                          typ = 'BEZIER', include_ends = False):
-    pieces = []
-    fraction = 1 / segments
-    # Form: p1, tangent 1, p2, tangent 2
-    if typ == 'HERMITE':
-        poly = [[2, -3, 0, 1], [1, -2, 1, 0],
-                [-2, 3, 0, 0], [1, -1, 0, 0]]
-    elif typ == 'BEZIER':
-        poly = [[-1, 3, -3, 1], [3, -6, 3, 0],
-                [1, 0, 0, 0], [-3, 3, 0, 0]]
-        p1_dir = p1_dir + p1_co
-        p2_dir = -p2_dir + p2_co
-    elif typ == 'BSPLINE':
-##        Supposed poly matrix for a cubic b-spline:
-##        poly = [[-1, 3, -3, 1], [3, -6, 3, 0],
-##                [-3, 0, 3, 0], [1, 4, 1, 0]]
-        # My own invention to try to get something that somewhat acts right.
-        # This is semi-quadratic rather than fully cubic:
-        poly = [[0, -1, 0, 1], [1, -2, 1, 0],
-                [0, -1, 2, 0], [1, -1, 0, 0]]
-    if include_ends:
-        pieces.append(p1_co)
-    # Generate each point:
-    for i in range(segments - 1):
-        t = fraction * (i + 1)
-        if bpy.app.debug:
-            print(t)
-        s = [t ** 3, t ** 2, t, 1]
-        h00 = (poly[0][0] * s[0]) + (poly[0][1] * s[1]) + (poly[0][2] * s[2]) + (poly[0][3] * s[3])
-        h01 = (poly[1][0] * s[0]) + (poly[1][1] * s[1]) + (poly[1][2] * s[2]) + (poly[1][3] * s[3])
-        h10 = (poly[2][0] * s[0]) + (poly[2][1] * s[1]) + (poly[2][2] * s[2]) + (poly[2][3] * s[3])
-        h11 = (poly[3][0] * s[0]) + (poly[3][1] * s[1]) + (poly[3][2] * s[2]) + (poly[3][3] * s[3])
-        pieces.append((h00 * p1_co) + (h01 * p1_dir) + (h10 * p2_co) + (h11 * p2_dir))
-    if include_ends:
-        pieces.append(p2_co)
-    # Return:
-    if len(pieces) == 0:
-        return None
-    else:
-        if bpy.app.debug:
-            print(pieces)
-        return pieces
-
-
-# intersect_line_face
-#
-# Calculates the coordinate of intersection of a line with a face.  It returns
-# the coordinate if one exists, otherwise None.  It can only deal with tris or
-# quads for a face.  A quad does NOT have to be planar. Thus the following.
-#
-# Quad math and theory:
-# A quad may not be planar.  Therefore the treated definition of the surface is
-# that the surface is composed of all lines bridging two other lines defined by
-# the given four points.  The lines do not "cross".
-# 
-# The two lines in 3-space can defined as:
-#   ┌  ┐         ┌   ┐     ┌   ┐  ┌  ┐         ┌   ┐     ┌   ┐
-#   │x1│         │a11│     │b11│  │x2│         │a21│     │b21│
-#   │y1│ = (1-t1)│a12│ + t1│b12│, │y2│ = (1-t2)│a22│ + t2│b22│
-#   │z1│         │a13│     │b13│  │z2│         │a23│     │b23│
-#   └  ┘         └   ┘     └   ┘  └  ┘         └   ┘     └   ┘
-# Therefore, the surface is the lines defined by every point alone the two
-# lines with a same "t" value (t1 = t2).  This is basically R = V1 + tQ, where
-# Q = V2 - V1 therefore R = V1 + t(V2 - V1) -> R = (1 - t)V1 + tV2:
-#   ┌   ┐            ┌                  ┐      ┌                  ┐
-#   │x12│            │(1-t)a11 + t * b11│      │(1-t)a21 + t * b21│
-#   │y12│ = (1 - t12)│(1-t)a12 + t * b12│ + t12│(1-t)a22 + t * b22│
-#   │z12│            │(1-t)a13 + t * b13│      │(1-t)a23 + t * b23│
-#   └   ┘            └                  ┘      └                  ┘
-# Now, the equation of our line can be likewise defined:
-#   ┌  ┐   ┌   ┐     ┌   ┐
-#   │x3│   │a31│     │b31│
-#   │y3│ = │a32│ + t3│b32│
-#   │z3│   │a33│     │b33│
-#   └  ┘   └   ┘     └   ┘
-# Now we just have to find a valid solution for the two equations.  This should
-# be our point of intersection.  Therefore, x12 = x3 -> x, y12 = y3 -> y,
-# z12 = z3 -> z.  Thus, to find that point we set the equation defining the
-# surface as equal to the equation for the line:
-#            ┌                  ┐      ┌                  ┐   ┌   ┐     ┌   ┐
-#            │(1-t)a11 + t * b11│      │(1-t)a21 + t * b21│   │a31│     │b31│
-#   (1 - t12)│(1-t)a12 + t * b12│ + t12│(1-t)a22 + t * b22│ = │a32│ + t3│b32│
-#            │(1-t)a13 + t * b13│      │(1-t)a23 + t * b23│   │a33│     │b33│
-#            └                  ┘      └                  ┘   └   ┘     └   ┘
-# This leaves us with three equations, three unknowns.  Solving the system by
-# hand is practically impossible, but using Mathematica we are given an insane
-# series of three equations (not reproduced here for the sake of space: see
-# http://www.mediafire.com/file/cc6m6ba3sz2b96m/intersect_line_surface.nb and
-# http://www.mediafire.com/file/0egbr5ahg14talm/intersect_line_surface2.nb for
-# Mathematica computation).
-#
-# Additionally, the resulting series of equations may result in a div by zero
-# exception if the line in question if parallel to one of the axis or if the
-# quad is planar and parallel to either the XY, XZ, or YZ planes.  However, the
-# system is still solvable but must be dealt with a little differently to avaid
-# these special cases.  Because the resulting equations are a little different,
-# we have to code them differently.  Hence the special cases.
-#
-# Tri math and theory:
-# A triangle must be planar (three points define a plane).  Therefore we just
-# have to make sure that the line intersects inside the triangle.
-#
-# If the point is within the triangle, then the angle between the lines that
-# connect the point to the each individual point of the triangle will be
-# equal to 2 * PI.  Otherwise, if the point is outside the triangle, then the
-# sum of the angles will be less.
-#
-# @todo
-#   - Figure out how to deal with n-gons.  How the heck is a face with 8 verts
-#       definied mathematically?  How do I then find the intersection point of
-#       a line with said vert?  How do I know if that point is "inside" all the
-#       verts?  I have no clue, and haven't been able to find anything on it so
-#       far.  Maybe if someone (actually reads this and) who knows could note?
-def intersect_line_face(edge, face, is_infinite = False, error = 0.000002):
-    int_co = None
-
-    # If we are dealing with a non-planar quad:
-    if len(face.verts) == 4 and not is_face_planar(face):
-        edgeA = face.edges[0]
-        edgeB = None
-        flipB = False
-
-        for i in range(len(face.edges)):
-            if face.edges[i].verts[0] not in edgeA.verts and face.edges[i].verts[1] not in edgeA.verts:
-                edgeB = face.edges[i]
-                break
-
-        # I haven't figured out a way to mix this in with the above.  Doing so might remove a
-        # few extra instructions from having to be executed saving a few clock cycles:
-        for i in range(len(face.edges)):
-            if face.edges[i] == edgeA or face.edges[i] == edgeB:
-                continue
-            if (edgeA.verts[0] in face.edges[i].verts and edgeB.verts[1] in face.edges[i].verts) or (edgeA.verts[1] in face.edges[i].verts and edgeB.verts[0] in face.edges[i].verts):
-                flipB = True
-                break
-
-        # Define calculation coefficient constants:
-        # "xx1" is the x coordinate, "xx2" is the y coordinate, and "xx3" is the z
-        # coordinate.
-        a11, a12, a13 = edgeA.verts[0].co[0], edgeA.verts[0].co[1], edgeA.verts[0].co[2]
-        b11, b12, b13 = edgeA.verts[1].co[0], edgeA.verts[1].co[1], edgeA.verts[1].co[2]
-        if flipB:
-            a21, a22, a23 = edgeB.verts[1].co[0], edgeB.verts[1].co[1], edgeB.verts[1].co[2]
-            b21, b22, b23 = edgeB.verts[0].co[0], edgeB.verts[0].co[1], edgeB.verts[0].co[2]
-        else:
-            a21, a22, a23 = edgeB.verts[0].co[0], edgeB.verts[0].co[1], edgeB.verts[0].co[2]
-            b21, b22, b23 = edgeB.verts[1].co[0], edgeB.verts[1].co[1], edgeB.verts[1].co[2]
-        a31, a32, a33 = edge.verts[0].co[0], edge.verts[0].co[1], edge.verts[0].co[2]
-        b31, b32, b33 = edge.verts[1].co[0], edge.verts[1].co[1], edge.verts[1].co[2]
-
-        # There are a bunch of duplicate "sub-calculations" inside the resulting
-        # equations for t, t12, and t3.  Calculate them once and store them to
-        # reduce computational time:
-        m01 = a13 * a22 * a31
-        m02 = a12 * a23 * a31
-        m03 = a13 * a21 * a32
-        m04 = a11 * a23 * a32
-        m05 = a12 * a21 * a33
-        m06 = a11 * a22 * a33
-        m07 = a23 * a32 * b11
-        m08 = a22 * a33 * b11
-        m09 = a23 * a31 * b12
-        m10 = a21 * a33 * b12
-        m11 = a22 * a31 * b13
-        m12 = a21 * a32 * b13
-        m13 = a13 * a32 * b21
-        m14 = a12 * a33 * b21
-        m15 = a13 * a31 * b22
-        m16 = a11 * a33 * b22
-        m17 = a12 * a31 * b23
-        m18 = a11 * a32 * b23
-        m19 = a13 * a22 * b31
-        m20 = a12 * a23 * b31
-        m21 = a13 * a32 * b31
-        m22 = a23 * a32 * b31
-        m23 = a12 * a33 * b31
-        m24 = a22 * a33 * b31
-        m25 = a23 * b12 * b31
-        m26 = a33 * b12 * b31
-        m27 = a22 * b13 * b31
-        m28 = a32 * b13 * b31
-        m29 = a13 * b22 * b31
-        m30 = a33 * b22 * b31
-        m31 = a12 * b23 * b31
-        m32 = a32 * b23 * b31
-        m33 = a13 * a21 * b32
-        m34 = a11 * a23 * b32
-        m35 = a13 * a31 * b32
-        m36 = a23 * a31 * b32
-        m37 = a11 * a33 * b32
-        m38 = a21 * a33 * b32
-        m39 = a23 * b11 * b32
-        m40 = a33 * b11 * b32
-        m41 = a21 * b13 * b32
-        m42 = a31 * b13 * b32
-        m43 = a13 * b21 * b32
-        m44 = a33 * b21 * b32
-        m45 = a11 * b23 * b32
-        m46 = a31 * b23 * b32
-        m47 = a12 * a21 * b33
-        m48 = a11 * a22 * b33
-        m49 = a12 * a31 * b33
-        m50 = a22 * a31 * b33
-        m51 = a11 * a32 * b33
-        m52 = a21 * a32 * b33
-        m53 = a22 * b11 * b33
-        m54 = a32 * b11 * b33
-        m55 = a21 * b12 * b33
-        m56 = a31 * b12 * b33
-        m57 = a12 * b21 * b33
-        m58 = a32 * b21 * b33
-        m59 = a11 * b22 * b33
-        m60 = a31 * b22 * b33
-        m61 = a33 * b12 * b21
-        m62 = a32 * b13 * b21
-        m63 = a33 * b11 * b22
-        m64 = a31 * b13 * b22
-        m65 = a32 * b11 * b23
-        m66 = a31 * b12 * b23
-        m67 = b13 * b22 * b31
-        m68 = b12 * b23 * b31
-        m69 = b13 * b21 * b32
-        m70 = b11 * b23 * b32
-        m71 = b12 * b21 * b33
-        m72 = b11 * b22 * b33
-        n01 = m01 - m02 - m03 + m04 + m05 - m06
-        n02 = -m07 + m08 + m09 - m10 - m11 + m12 + m13 - m14 - m15 + m16 + m17 - m18 - m25 + m27 + m29 - m31 + m39 - m41 - m43 + m45 - m53 + m55 + m57 - m59
-        n03 = -m19 + m20 + m33 - m34 - m47 + m48
-        n04 = m21 - m22 - m23 + m24 - m35 + m36 + m37 - m38 + m49 - m50 - m51 + m52
-        n05 = m26 - m28 - m30 + m32 - m40 + m42 + m44 - m46 + m54 - m56 - m58 + m60
-        n06 = m61 - m62 - m63 + m64 + m65 - m66 - m67 + m68 + m69 - m70 - m71 + m72
-        n07 = 2 * n01 + n02 + 2 * n03 + n04 + n05
-        n08 = n01 + n02 + n03 + n06
-
-        # Calculate t, t12, and t3:
-        t = (n07 - sqrt(pow(-n07, 2) - 4 * (n01 + n03 + n04) * n08)) / (2 * n08)
-
-        # t12 can be greatly simplified by defining it with t in it:
-        # If block used to help prevent any div by zero error.
-        t12 = 0
-
-        if a31 == b31:
-            # The line is parallel to the z-axis:
-            if a32 == b32:
-                t12 = ((a11 - a31) + (b11 - a11) * t) / ((a21 - a11) + (a11 - a21 - b11 + b21) * t)
-            # The line is parallel to the y-axis:
-            elif a33 == b33:
-                t12 = ((a11 - a31) + (b11 - a11) * t) / ((a21 - a11) + (a11 - a21 - b11 + b21) * t)
-            # The line is along the y/z-axis but is not parallel to either:
-            else:
-                t12 = -(-(a33 - b33) * (-a32 + a12 * (1 - t) + b12 * t) + (a32 - b32) * (-a33 + a13 * (1 - t) + b13 * t)) / (-(a33 - b33) * ((a22 - a12) * (1 - t) + (b22 - b12) * t) + (a32 - b32) * ((a23 - a13) * (1 - t) + (b23 - b13) * t))
-        elif a32 == b32:
-            # The line is parallel to the x-axis:
-            if a33 == b33:
-                t12 = ((a12 - a32) + (b12 - a12) * t) / ((a22 - a12) + (a12 - a22 - b12 + b22) * t)
-            # The line is along the x/z-axis but is not parallel to either:
-            else:
-                t12 = -(-(a33 - b33) * (-a31 + a11 * (1 - t) + b11 * t) + (a31 - b31) * (-a33 + a13 * (1 - t) + b13 * t)) / (-(a33 - b33) * ((a21 - a11) * (1 - t) + (b21 - b11) * t) + (a31 - b31) * ((a23 - a13) * (1 - t) + (b23 - b13) * t))
-        # The line is along the x/y-axis but is not parallel to either:
-        else:
-            t12 = -(-(a32 - b32) * (-a31 + a11 * (1 - t) + b11 * t) + (a31 - b31) * (-a32 + a12 * (1 - t) + b12 * t)) / (-(a32 - b32) * ((a21 - a11) * (1 - t) + (b21 - b11) * t) + (a31 - b31) * ((a22 - a21) * (1 - t) + (b22 - b12) * t))
-
-        # Likewise, t3 is greatly simplified by defining it in terms of t and t12:
-        # If block used to prevent a div by zero error.
-        t3 = 0
-        if a31 != b31:
-            t3 = (-a11 + a31 + (a11 - b11) * t + (a11 - a21) * t12 + (a21 - a11 + b11 - b21) * t * t12) / (a31 - b31)
-        elif a32 != b32:
-            t3 = (-a12 + a32 + (a12 - b12) * t + (a12 - a22) * t12 + (a22 - a12 + b12 - b22) * t * t12) / (a32 - b32)
-        elif a33 != b33:
-            t3 = (-a13 + a33 + (a13 - b13) * t + (a13 - a23) * t12 + (a23 - a13 + b13 - b23) * t * t12) / (a33 - b33)
-        else:
-            print("The second edge is a zero-length edge")
-            return None
-
-        # Calculate the point of intersection:
-        x = (1 - t3) * a31 + t3 * b31
-        y = (1 - t3) * a32 + t3 * b32
-        z = (1 - t3) * a33 + t3 * b33
-        int_co = Vector((x, y, z))
-        
-        if bpy.app.debug:
-            print(int_co)
-
-        # If the line does not intersect the quad, we return "None":
-        if (t < -1 or t > 1 or t12 < -1 or t12 > 1) and not is_infinite:
-            int_co = None
-
-    elif len(face.verts) == 3:
-        p1, p2, p3 = face.verts[0].co, face.verts[1].co, face.verts[2].co
-        int_co = intersect_line_plane(edge.verts[0].co, edge.verts[1].co, p1, face.normal)
-
-        # Only check if the triangle is not being treated as an infinite plane:
-        # Math based from http://paulbourke.net/geometry/linefacet/
-        if int_co != None and not is_infinite:
-            pA = p1 - int_co
-            pB = p2 - int_co
-            pC = p3 - int_co
-            # These must be unit vectors, else we risk a domain error:
-            pA.length = 1
-            pB.length = 1
-            pC.length = 1
-            aAB = acos(pA.dot(pB))
-            aBC = acos(pB.dot(pC))
-            aCA = acos(pC.dot(pA))
-            sumA = aAB + aBC + aCA
-
-            # If the point is outside the triangle:
-            if (sumA > (pi + error) and sumA < (pi - error)):
-                int_co = None
-
-    # This is the default case where we either have a planar quad or an n-gon.
-    else:
-        int_co = intersect_line_plane(edge.verts[0].co, edge.verts[1].co,
-                                      face.verts[0].co, face.normal)
-
-    return int_co
-
-
-# project_point_plane
-#
-# Projects a point onto a plane.  Returns a tuple of the projection vector
-# and the projected coordinate.
-def project_point_plane(pt, plane_co, plane_no):
-    proj_co = intersect_line_plane(pt, pt + plane_no, plane_co, plane_no)
-    proj_ve = proj_co - pt
-    return (proj_ve, proj_co)
-    
-
-# ------------ FILLET/CHAMPHER HELPER METHODS -------------
-
-# get_next_edge
-#
-# The following is used to return edges that might be possible edges for
-# propagation.  If an edge is connected to the end vert, but is also a part
-# of the on of the faces that the current edge composes, then it is a
-# "corner edge" and is not valid as a propagation edge.  If the edge is
-# part of two faces that a in the same plane, then we cannot fillet/chamfer
-# it because there is no angle between them.
-def get_next_edge(edge, vert):
-    invalidEdges = [e for f in edge.link_faces for e in f.edges if e != edge]
-    invalidEdges.append(edge)
-    if bpy.app.debug:
-        print(invalidEdges)
-    newEdge = [e for e in vert.link_edges if e not in invalidEdges and not is_planar_edge(e)]
-    if len(newEdge) == 0:
-        return None
-    elif len(newEdge) == 1:
-        return newEdge[0]
-    else:
-        return newEdge
-
-
-def is_planar_edge(edge, error = 0.000002):
-    angle = edge.calc_face_angle()
-    return (angle < error and angle > -error) or (angle < (180 + error) and angle > (180 - error))
-
-
-# fillet_axis
-#
-# Calculates the base geometry data for the fillet. This assumes that the faces
-# are planar:
-#
-# @todo
-#   - Redesign so that the faces do not have to be planar
-#
-# There seems to be issues some of the vector math right now.  Will need to be
-# debuged.
-def fillet_axis(edge, radius):
-    vectors = [None, None, None, None]
-    
-    origin = Vector((0, 0, 0))
-    axis = edge.verts[1].co - edge.verts[0].co
-
-    # Get the "adjacency" base vectors for face 0:
-    for e in edge.link_faces[0].edges:
-        if e == edge:
-            continue
-        if e.verts[0] == edge.verts[0]:
-            vectors[0] = e.verts[1].co - e.verts[0].co
-        elif e.verts[1] == edge.verts[0]:
-            vectors[0] = e.verts[0].co - e.verts[1].co
-        elif e.verts[0] == edge.verts[1]:
-            vectors[1] = e.verts[1].co - e.verts[0].co
-        elif e.verts[1] == edge.verts[1]:
-            vectors[1] = e.verts[0].co - e.verts[1].co
-
-    # Get the "adjacency" base vectors for face 1:
-    for e in edge.link_faces[1].edges:
-        if e == edge:
-            continue
-        if e.verts[0] == edge.verts[0]:
-            vectors[2] = e.verts[1].co - e.verts[0].co
-        elif e.verts[1] == edge.verts[0]:
-            vectors[2] = e.verts[0].co - e.verts[1].co
-        elif e.verts[0] == edge.verts[1]:
-            vectors[3] = e.verts[1].co - e.verts[0].co
-        elif e.verts[1] == edge.verts[1]:
-            vectors[3] = e.verts[0].co - e.verts[1].co
-
-    # Get the normal for face 0 and face 1:
-    norm1 = edge.link_faces[0].normal
-    norm2 = edge.link_faces[1].normal
-    
-    # We need to find the angle between the two faces, then bisect it:
-    theda = (pi - edge.calc_face_angle()) / 2
-    
-    # We are dealing with a triangle here, and we will need the length
-    # of its adjacent side.  The opposite is the radius:
-    adj_len = radius / tan(theda)
-
-    # Vectors can be thought of as being at the origin, and we need to make sure
-    # that the base vectors are planar with the "normal" definied by the edge to
-    # be filleted.  Then we set the length of the vector and shift it into a
-    # coordinate:
-    for i in range(len(vectors)):
-        vectors[i] = project_point_plane(vectors[i], origin, axis)[1]
-        vectors[i].length = adj_len
-        vectors[i] = vectors[i] + edge.verts[i % 2].co
-    
-    # Compute fillet axis end points:
-    v1 = intersect_line_line(vectors[0], vectors[0] + norm1, vectors[2], vectors[2] + norm2)[0]
-    v2 = intersect_line_line(vectors[1], vectors[1] + norm1, vectors[3], vectors[3] + norm2)[0]
-    return [v1, v2]
-
-
-def fillet_point(t, face1, face2):
-    return
-
-
-# ------------------- EDGE TOOL METHODS -------------------
-
-# Extends an "edge" in two directions:
-#   - Requires two vertices to be selected.  They do not have to form an edge.
-#   - Extends "length" in both directions
-class Extend(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_extend"
-    bl_label = "Extend"
-    bl_description = "Extend the selected edges of vertice pair."
-    bl_options = {'REGISTER', 'UNDO'}
-
-    di1 = BoolProperty(name = "Forwards",
-                       description = "Extend the edge forwards",
-                       default = True)
-    di2 = BoolProperty(name = "Backwards",
-                       description = "Extend the edge backwards",
-                       default = False)
-    length = FloatProperty(name = "Length",
-                           description = "Length to extend the edge",
-                           min = 0.0, max = 1024.0,
-                           default = 1.0)
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, "di1")
-        layout.prop(self, "di2")
-        layout.prop(self, "length")
-    
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-    
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(bpy.context.active_object.data)
-        bm.normal_update()
-
-        bEdges = bm.edges
-        bVerts = bm.verts
-
-        edges = [e for e in bEdges if e.select]
-        verts = [v for v in bVerts if v.select]
-
-        if len(edges) > 0:
-            for e in edges:
-                vector = e.verts[0].co - e.verts[1].co
-                vector.length = self.length
-                
-                if self.di1:
-                    v = bVerts.new()
-                    if (vector[0] + vector[1] + vector[2]) < 0:
-                        v.co = e.verts[1].co - vector
-                        newE = bEdges.new((e.verts[1], v))
-                    else:
-                        v.co = e.verts[0].co + vector
-                        newE = bEdges.new((e.verts[0], v))
-                if self.di2:
-                    v = bVerts.new()
-                    if (vector[0] + vector[1] + vector[2]) < 0:
-                        v.co = e.verts[0].co + vector
-                        newE = bEdges.new((e.verts[0], v))
-                    else:
-                        v.co = e.verts[1].co - vector
-                        newE = bEdges.new((e.verts[1], v))
-        else:
-            vector = verts[0].co - verts[1].co
-            vector.length = self.length
-
-            if self.di1:
-                v = bVerts.new()
-                if (vector[0] + vector[1] + vector[2]) < 0:
-                    v.co = verts[1].co - vector
-                    e = bEdges.new((verts[1], v))
-                else:
-                    v.co = verts[0].co + vector
-                    e = bEdges.new((verts[0], v))
-            if self.di2:
-                v = bVerts.new()
-                if (vector[0] + vector[1] + vector[2]) < 0:
-                    v.co = verts[0].co + vector
-                    e = bEdges.new((verts[0], v))
-                else:
-                    v.co = verts[1].co - vector
-                    e = bEdges.new((verts[1], v))
-
-        bm.to_mesh(bpy.context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# Creates a series of edges between two edges using spline interpolation.
-# This basically just exposes existing functionality in addition to some
-# other common methods: Hermite (c-spline), Bezier, and b-spline.  These
-# alternates I coded myself after some extensive research into spline
-# theory.
-#
-# @todo Figure out what's wrong with the Blender bezier interpolation.
-class Spline(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_spline"
-    bl_label = "Spline"
-    bl_description = "Create a spline interplopation between two edges"
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    alg = EnumProperty(name = "Spline Algorithm",
-                       items = [('Blender', 'Blender', 'Interpolation provided through \"mathutils.geometry\"'),
-                                ('Hermite', 'C-Spline', 'C-spline interpolation'),
-                                ('Bezier', 'Bézier', 'Bézier interpolation'),
-                                ('B-Spline', 'B-Spline', 'B-Spline interpolation')],
-                       default = 'Bezier')
-    segments = IntProperty(name = "Segments",
-                           description = "Number of segments to use in the interpolation",
-                           min = 2, max = 4096,
-                           soft_max = 1024,
-                           default = 32)
-    flip1 = BoolProperty(name = "Flip Edge",
-                         description = "Flip the direction of the spline on edge 1",
-                         default = False)
-    flip2 = BoolProperty(name = "Flip Edge",
-                         description = "Flip the direction of the spline on edge 2",
-                         default = False)
-    ten1 = FloatProperty(name = "Tension",
-                         description = "Tension on edge 1",
-                         min = -4096.0, max = 4096.0,
-                         soft_min = -8.0, soft_max = 8.0,
-                         default = 1.0)
-    ten2 = FloatProperty(name = "Tension",
-                         description = "Tension on edge 2",
-                         min = -4096.0, max = 4096.0,
-                         soft_min = -8.0, soft_max = 8.0,
-                         default = 1.0)
-
-    def draw(self, context):
-        layout = self.layout
-
-        layout.prop(self, "alg")
-        layout.prop(self, "segments")
-        layout.label("Edge 1:")
-        layout.prop(self, "ten1")
-        layout.prop(self, "flip1")
-        layout.label("Edge 2:")
-        layout.prop(self, "ten2")
-        layout.prop(self, "flip2")
-
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-    
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(bpy.context.active_object.data)
-        bm.normal_update()
-
-        bEdges = bm.edges
-        bVerts = bm.verts
-        
-        seg = self.segments
-        edges = [e for e in bEdges if e.select]
-        verts = [edges[v // 2].verts[v % 2] for v in range(4)]
-
-        if self.flip1:
-            v1 = verts[1]
-            p1_co = verts[1].co
-            p1_dir = verts[1].co - verts[0].co
-        else:
-            v1 = verts[0]
-            p1_co = verts[0].co
-            p1_dir = verts[0].co - verts[1].co
-        if self.ten1 < 0:
-            p1_dir = -1 * p1_dir
-            p1_dir.length = -self.ten1
-        else:
-            p1_dir.length = self.ten1
-
-        if self.flip2:
-            v2 = verts[3]
-            p2_co = verts[3].co
-            p2_dir = verts[2].co - verts[3].co
-        else:
-            v2 = verts[2]
-            p2_co = verts[2].co
-            p2_dir = verts[3].co - verts[2].co 
-        if self.ten2 < 0:
-            p2_dir = -1 * p2_dir
-            p2_dir.length = -self.ten2
-        else:
-            p2_dir.length = self.ten2
-
-        # Get the interploted coordinates:
-        if self.alg == 'Blender':
-            pieces = interpolate_bezier(p1_co, p1_dir, p2_dir, p2_co, self.segments)
-        elif self.alg == 'Hermite':
-            pieces = interpolate_line_line(p1_co, p1_dir, p2_co, p2_dir, self.segments, 1, 'HERMITE')
-        elif self.alg == 'Bezier':
-            pieces = interpolate_line_line(p1_co, p1_dir, p2_co, p2_dir, self.segments, 1, 'BEZIER')
-        elif self.alg == 'B-Spline':
-            pieces = interpolate_line_line(p1_co, p1_dir, p2_co, p2_dir, self.segments, 1, 'BSPLINE')
-
-        verts = []
-        verts.append(v1)
-        # Add vertices and set the points:
-        for i in range(seg - 1):
-            v = bVerts.new()
-            v.co = pieces[i]
-            verts.append(v)
-        verts.append(v2)
-        # Connect vertices:
-        for i in range(seg):
-            e = bEdges.new((verts[i], verts[i + 1]))
-
-        bm.to_mesh(bpy.context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# Creates edges normal to planes defined between each of two edges and the
-# normal or the plane defined by those two edges.
-#   - Select two edges.  The must form a plane.
-#   - On running the script, eight edges will be created.  Delete the
-#     extras that you don't need.
-#   - The length of those edges is defined by the variable "length"
-#
-# @todo Change method from a cross product to a rotation matrix to make the
-#   angle part work.
-#   --- todo completed 2/4/2012, but still needs work ---
-# @todo Figure out a way to make +/- predictable
-#   - Maybe use angel between edges and vector direction definition?
-#   --- TODO COMPLETED ON 2/9/2012 ---
-class Ortho(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_ortho"
-    bl_label = "Angle Off Edge"
-    bl_description = ""
-    bl_options = {'REGISTER', 'UNDO'}
-
-    vert1 = BoolProperty(name = "Vertice 1",
-                         description = "Enable edge creation for vertice 1.",
-                         default = True)
-    vert2 = BoolProperty(name = "Vertice 2",
-                         description = "Enable edge creation for vertice 2.",
-                         default = True)
-    vert3 = BoolProperty(name = "Vertice 3",
-                         description = "Enable edge creation for vertice 3.",
-                         default = True)
-    vert4 = BoolProperty(name = "Vertice 4",
-                         description = "Enable edge creation for vertice 4.",
-                         default = True)
-    pos = BoolProperty(name = "+",
-                       description = "Enable positive direction edges.",
-                       default = True)
-    neg = BoolProperty(name = "-",
-                       description = "Enable negitive direction edges.",
-                       default = True)
-    angle = FloatProperty(name = "Angle",
-                          description = "Angle off of the originating edge",
-                          min = 0.0, max = 180.0,
-                          default = 90.0)
-    length = FloatProperty(name = "Length",
-                           description = "Length of created edges.",
-                           min = 0.0, max = 1024.0,
-                           default = 1.0)
-
-    # For when only one edge is selected (Possible feature to be testd):
-    plane = EnumProperty(name = "Plane",
-                         items = [("XY", "X-Y Plane", "Use the X-Y plane as the plane of creation"),
-                                  ("XZ", "X-Z Plane", "Use the X-Z plane as the plane of creation"),
-                                  ("YZ", "Y-Z Plane", "Use the Y-Z plane as the plane of creation")],
-                         default = "XY")
-
-    def draw(self, context):
-        layout = self.layout
-
-        layout.prop(self, "vert1")
-        layout.prop(self, "vert2")
-        layout.prop(self, "vert3")
-        layout.prop(self, "vert4")
-        row = layout.row(align = False)
-        row.alignment = 'EXPAND'
-        row.prop(self, "pos")
-        row.prop(self, "neg")
-        layout.prop(self, "angle")
-        layout.prop(self, "length")
-    
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-    
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(bpy.context.active_object.data)
-        bm.normal_update()
-
-        bVerts = bm.verts
-        bEdges = bm.edges
-        edges = [e for e in bEdges if e.select]
-        vectors = []
-
-        # Until I can figure out a better way of handeling it:
-        if len(edges) < 2:
-            bpy.ops.object.editmode_toggle()
-            self.report({'ERROR_INVALID_INPUT'},
-                        "You must select two edges.")
-            return {'CANCELLED'}
-
-        verts = [edges[0].verts[0],
-                 edges[0].verts[1],
-                 edges[1].verts[0],
-                 edges[1].verts[1]]
-
-        cos = intersect_line_line(verts[0].co, verts[1].co, verts[2].co, verts[3].co)
-
-        # If the two edges are parallel:
-        if cos == None:
-            self.report({'WARNING'},
-                        "Selected lines are parallel: results may be unpredictable.")
-            vectors.append(verts[0].co - verts[1].co)
-            vectors.append(verts[0].co - verts[2].co)
-            vectors.append(vectors[0].cross(vectors[1]))
-            vectors.append(vectors[2].cross(vectors[0]))
-            vectors.append(-vectors[3])
-        else:
-            # Warn the user if they have not chosen two planar edges:
-            if not is_same_co(cos[0], cos[1]):
-                self.report({'WARNING'},
-                            "Selected lines are not planar: results may be unpredictable.")
-
-            # This makes the +/- behavior predictable:
-            if (verts[0].co - cos[0]).length < (verts[1].co - cos[0]).length:
-                verts[0], verts[1] = verts[1], verts[0]
-            if (verts[2].co - cos[0]).length < (verts[3].co - cos[0]).length:
-                verts[2], verts[3] = verts[3], verts[2]
-
-            vectors.append(verts[0].co - verts[1].co)
-            vectors.append(verts[2].co - verts[3].co)
-            
-            # Normal of the plane formed by vector1 and vector2:
-            vectors.append(vectors[0].cross(vectors[1]))
-
-            # Possible directions:
-            vectors.append(vectors[2].cross(vectors[0]))
-            vectors.append(vectors[1].cross(vectors[2]))
-
-        # Set the length:
-        vectors[3].length = self.length
-        vectors[4].length = self.length
-
-        # Perform any additional rotations:
-        matrix = Matrix.Rotation(radians(90 + self.angle), 3, vectors[2])
-        vectors.append(matrix * -vectors[3]) # vectors[5]
-        matrix = Matrix.Rotation(radians(90 - self.angle), 3, vectors[2])
-        vectors.append(matrix * vectors[4]) # vectors[6]
-        vectors.append(matrix * vectors[3]) # vectors[7]
-        matrix = Matrix.Rotation(radians(90 + self.angle), 3, vectors[2])
-        vectors.append(matrix * -vectors[4]) # vectors[8]
-
-        # Perform extrusions and displacements:
-        # There will be a total of 8 extrusions.  One for each vert of each edge.
-        # It looks like an extrusion will add the new vert to the end of the verts
-        # list and leave the rest in the same location.
-        # ----------- EDIT -----------
-        # It looks like I might be able to do this within "bpy.data" with the ".add"
-        # function.
-        # ------- BMESH UPDATE -------
-        # BMesh uses ".new()"
-
-        for v in range(len(verts)):
-            vert = verts[v]
-            if (v == 0 and self.vert1) or (v == 1 and self.vert2) or (v == 2 and self.vert3) or (v == 3 and self.vert4):
-                if self.pos:
-                    new = bVerts.new()
-                    new.co = vert.co - vectors[5 + (v // 2) + ((v % 2) * 2)]
-                    bEdges.new((vert, new))
-                if self.neg:
-                    new = bVerts.new()
-                    new.co = vert.co + vectors[5 + (v // 2) + ((v % 2) * 2)]
-                    bEdges.new((vert, new))
-
-        bm.to_mesh(bpy.context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# Usage:
-# Select an edge and a point or an edge and specify the radius (default is 1 BU)
-# You can select two edges but it might be unpredicatble which edge it revolves
-# around so you might have to play with the switch.
-class Shaft(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_shaft"
-    bl_label = "Shaft"
-    bl_description = "Create a shaft mesh around an axis"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    # Selection defaults:
-    shaftType = 0
-
-    # For tracking if the user has changed selection:
-    last_edge = IntProperty(name = "Last Edge",
-                            description = "Tracks if user has changed selected edge",
-                            min = 0, max = 1,
-                            default = 0)
-    last_flip = False
-    
-    edge = IntProperty(name = "Edge",
-                       description = "Edge to shaft around.",
-                       min = 0, max = 1,
-                       default = 0)
-    flip = BoolProperty(name = "Flip Second Edge",
-                        description = "Flip the percieved direction of the second edge.",
-                        default = False)
-    radius = FloatProperty(name = "Radius",
-                           description = "Shaft Radius",
-                           min = 0.0, max = 1024.0,
-                           default = 1.0)
-    start = FloatProperty(name = "Starting Angle",
-                          description = "Angle to start the shaft at.",
-                          min = -360.0, max = 360.0,
-                          default = 0.0)
-    finish = FloatProperty(name = "Ending Angle",
-                           description = "Angle to end the shaft at.",
-                           min = -360.0, max = 360.0,
-                           default = 360.0)
-    segments = IntProperty(name = "Shaft Segments",
-                           description = "Number of sgements to use in the shaft.",
-                           min = 1, max = 4096,
-                           soft_max = 512,
-                           default = 32)
-
-
-    def draw(self, context):
-        layout = self.layout
-
-        if self.shaftType == 0:
-            layout.prop(self, "edge")
-            layout.prop(self, "flip")
-        elif self.shaftType == 3:
-            layout.prop(self, "radius")
-        layout.prop(self, "segments")
-        layout.prop(self, "start")
-        layout.prop(self, "finish")
-
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        # Make sure these get reset each time we run:
-        self.last_edge = 0
-        self.edge = 0
-
-        return self.execute(context)
-
-    
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(bpy.context.active_object.data)
-        bm.normal_update()
-
-        bFaces = bm.faces
-        bEdges = bm.edges
-        bVerts = bm.verts
-
-        active = None
-        edges = []
-        verts = []
-
-        # Pre-caclulated values:
-
-        rotRange = [radians(self.start), radians(self.finish)]
-        rads = radians((self.finish - self.start) / self.segments)
-
-        numV = self.segments + 1
-        numE = self.segments
-
-        edges = [e for e in bEdges if e.select]
-
-        # Robustness check: there should at least be one edge selected
-        if len(edges) < 1:
-            bpy.ops.object.editmode_toggle()
-            self.report({'ERROR_INVALID_INPUT'},
-                        "At least one edge must be selected.")
-            return {'CANCELLED'}
-
-        # If two edges are selected:
-        if len(edges) == 2:
-            # default:
-            edge = [0, 1]
-            vert = [0, 1]
-
-            # Edge selection:
-            #
-            # By default, we want to shaft around the last selected edge (it
-            # will be the active edge).  We know we are using the default if
-            # the user has not changed which edge is being shafted around (as
-            # is tracked by self.last_edge).  When they are not the same, then
-            # the user has changed selection.
-            #
-            # We then need to make sure that the active object really is an edge
-            # (robustness check).
-            #
-            # Finally, if the active edge is not the inital one, we flip them
-            # and have the GUI reflect that.
-            if self.last_edge == self.edge:
-                if isinstance(bm.select_history.active, bmesh.types.BMEdge):
-                    if bm.select_history.active != edges[edge[0]]:
-                        self.last_edge, self.edge = edge[1], edge[1]
-                        edge = [edge[1], edge[0]]
-                else:
-                    bpy.ops.object.editmode_toggle()
-                    self.report({'ERROR_INVALID_INPUT'},
-                                "Active geometry is not an edge.")
-                    return {'CANCELLED'}
-            elif self.edge == 1:
-                edge = [1, 0]
-                    
-            verts.append(edges[edge[0]].verts[0])
-            verts.append(edges[edge[0]].verts[1])
-
-            if self.flip:
-                verts = [1, 0]
-
-            verts.append(edges[edge[1]].verts[vert[0]])
-            verts.append(edges[edge[1]].verts[vert[1]])
-
-            self.shaftType = 0
-        # If there is more than one edge selected:
-        # There are some issues with it ATM, so don't expose is it to normal users
-        # @todo Fix edge connection ordering issue
-        elif len(edges) > 2 and bpy.app.debug:
-            if isinstance(bm.select_history.active, bmesh.types.BMEdge):
-                active = bm.select_history.active
-                edges.remove(active)
-                # Get all the verts:
-                edges = order_joined_edges(edges[0])
-                verts = []
-                for e in edges:
-                    if verts.count(e.verts[0]) == 0:
-                        verts.append(e.verts[0])
-                    if verts.count(e.verts[1]) == 0:
-                        verts.append(e.verts[1])
-            else:
-                bpy.ops.object.editmode_toggle()
-                self.report({'ERROR_INVALID_INPUT'},
-                            "Active geometry is not an edge.")
-                return {'CANCELLED'}
-            self.shaftType = 1
-        else:
-            verts.append(edges[0].verts[0])
-            verts.append(edges[0].verts[1])
-
-            for v in bVerts:
-                if v.select and verts.count(v) == 0:
-                    verts.append(v)
-                v.select = False
-            if len(verts) == 2:
-                self.shaftType = 3
-            else:
-                self.shaftType = 2
-
-        # The vector denoting the axis of rotation:
-        if self.shaftType == 1:
-            axis = active.verts[1].co - active.verts[0].co
-        else:
-            axis = verts[1].co - verts[0].co
-
-        # We will need a series of rotation matrices.  We could use one which
-        # would be faster but also might cause propagation of error.
-##        matrices = []
-##        for i in range(numV):
-##            matrices.append(Matrix.Rotation((rads * i) + rotRange[0], 3, axis))
-        matrices = [Matrix.Rotation((rads * i) + rotRange[0], 3, axis) for i in range(numV)]
-
-        # New vertice coordinates:
-        verts_out = []
-
-        # If two edges were selected:
-        #   - If the lines are not parallel, then it will create a cone-like shaft
-        if self.shaftType == 0:
-            for i in range(len(verts) - 2):
-                init_vec = distance_point_line(verts[i + 2].co, verts[0].co, verts[1].co)
-                co = init_vec + verts[i + 2].co
-                # These will be rotated about the orgin so will need to be shifted:
-                for j in range(numV):
-                    verts_out.append(co - (matrices[j] * init_vec))
-        elif self.shaftType == 1:
-            for i in verts:
-                init_vec = distance_point_line(i.co, active.verts[0].co, active.verts[1].co)
-                co = init_vec + i.co
-                # These will be rotated about the orgin so will need to be shifted:
-                for j in range(numV):
-                    verts_out.append(co - (matrices[j] * init_vec))
-        # Else if a line and a point was selected:    
-        elif self.shaftType == 2:
-            init_vec = distance_point_line(verts[2].co, verts[0].co, verts[1].co)
-            # These will be rotated about the orgin so will need to be shifted:
-            verts_out = [(verts[i].co - (matrices[j] * init_vec)) for i in range(2) for j in range(numV)]
-        # Else the above are not possible, so we will just use the edge:
-        #   - The vector defined by the edge is the normal of the plane for the shaft
-        #   - The shaft will have radius "radius".
-        else:
-            if is_axial(verts[0].co, verts[1].co) == None:
-                proj = (verts[1].co - verts[0].co)
-                proj[2] = 0
-                norm = proj.cross(verts[1].co - verts[0].co)
-                vec = norm.cross(verts[1].co - verts[0].co)
-                vec.length = self.radius
-            elif is_axial(verts[0].co, verts[1].co) == 'Z':
-                vec = verts[0].co + Vector((0, 0, self.radius))
-            else:
-                vec = verts[0].co + Vector((0, self.radius, 0))
-            init_vec = distance_point_line(vec, verts[0].co, verts[1].co)
-            # These will be rotated about the orgin so will need to be shifted:
-            verts_out = [(verts[i].co - (matrices[j] * init_vec)) for i in range(2) for j in range(numV)]
-
-        # We should have the coordinates for a bunch of new verts.  Now add the verts
-        # and build the edges and then the faces.
-
-        newVerts = []
-
-        if self.shaftType == 1:
-            # Vertices:
-            for i in range(numV * len(verts)):
-                new = bVerts.new()
-                new.co = verts_out[i]
-                new.select = True
-                newVerts.append(new)
-
-            # Edges:
-            for i in range(numE):
-                for j in range(len(verts)):
-                    e = bEdges.new((newVerts[i + (numV * j)], newVerts[i + (numV * j) + 1]))
-                    e.select = True
-            for i in range(numV):
-                for j in range(len(verts) - 1):
-                    e = bEdges.new((newVerts[i + (numV * j)], newVerts[i + (numV * (j + 1))]))
-                    e.select = True
-
-            # Faces:
-            # There is a problem with this right now
-            for i in range(len(edges)):
-                for j in range(numE):
-                    f = bFaces.new((newVerts[i], newVerts[i + 1],
-                                    newVerts[i + (numV * j) + 1], newVerts[i + (numV * j)]))
-                    f.normal_update()
-        else:
-            # Vertices:
-            for i in range(numV * 2):
-                new = bVerts.new()
-                new.co = verts_out[i]
-                new.select = True
-                newVerts.append(new)
-
-            # Edges:
-            for i in range(numE):
-                e = bEdges.new((newVerts[i], newVerts[i + 1]))
-                e.select = True
-                e = bEdges.new((newVerts[i + numV], newVerts[i + numV + 1]))
-                e.select = True
-            for i in range(numV):
-                e = bEdges.new((newVerts[i], newVerts[i + numV]))
-                e.select = True
-
-            # Faces:
-            for i in range(numE):
-                f = bFaces.new((newVerts[i], newVerts[i + 1],
-                                newVerts[i + numV + 1], newVerts[i + numV]))
-                f.normal_update()
-
-        bm.to_mesh(bpy.context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# "Slices" edges crossing a plane defined by a face.
-# @todo Selecting a face as the cutting plane will cause Blender to crash when
-#   using "Rip".
-class Slice(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_slice"
-    bl_label = "Slice"
-    bl_description = "Cuts edges at the plane defined by a selected face."
-    bl_options = {'REGISTER', 'UNDO'}
-
-    make_copy = BoolProperty(name = "Make Copy",
-                             description = "Make new vertices at intersection points instead of spliting the edge",
-                             default = False)
-    rip = BoolProperty(name = "Rip",
-                       description = "Split into two edges that DO NOT share an intersection vertice.",
-                       default = False)
-    pos = BoolProperty(name = "Positive",
-                       description = "Remove the portion on the side of the face normal",
-                       default = False)
-    neg = BoolProperty(name = "Negative",
-                       description = "Remove the portion on the side opposite of the face normal",
-                       default = False)
-
-    def draw(self, context):
-        layout = self.layout
-
-        layout.prop(self, "make_copy")
-        if not self.make_copy:
-            layout.prop(self, "rip")
-            layout.label("Remove Side:")
-            layout.prop(self, "pos")
-            layout.prop(self, "neg")
-
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-    
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(context.active_object.data)
-        bm.normal_update()
-
-        # For easy access to verts, edges, and faces:
-        bVerts = bm.verts
-        bEdges = bm.edges
-        bFaces = bm.faces
-
-        face = None
-        normal = None
-
-        # Find the selected face.  This will provide the plane to project onto:
-        #   - First check to use the active face.  This allows users to just
-        #       select a bunch of faces with the last being the cutting plane.
-        #       This is try and make the tool act more like a built-in Blender
-        #       function.
-        #   - If that fails, then use the first found selected face in the BMesh
-        #       face list.
-        if isinstance(bm.select_history.active, bmesh.types.BMFace):
-            face = bm.select_history.active
-            normal = bm.select_history.active.normal
-            bm.select_history.active.select = False
-        else:
-            for f in bFaces:
-                if f.select:
-                    face = f
-                    normal = f.normal
-                    f.select = False
-                    break
-
-        # If we don't find a selected face, we have problem.  Exit:
-        if face == None:
-            bpy.ops.object.editmode_toggle()
-            self.report({'ERROR_INVALID_INPUT'},
-                        "You must select a face as the cutting plane.")
-            return {'CANCELLED'}
-        # Warn the user if they are using an n-gon.  We can work with it, but it
-        # might lead to some odd results.
-        elif len(face.verts) > 4 and not is_face_planar(face):
-            self.report({'WARNING'},
-                        "Selected face is an n-gon.  Results may be unpredictable.")
-
-        # @todo DEBUG TRACKER - DELETE WHEN FINISHED:
-        dbg = 0
-        if bpy.app.debug:
-            print(len(bEdges))
-
-        # Iterate over the edges:
-        for e in bEdges:
-            # @todo DEBUG TRACKER - DELETE WHEN FINISHED:
-            if bpy.app.debug:
-                print(dbg)
-                dbg = dbg + 1
-
-            # Get the end verts on the edge:
-            v1 = e.verts[0]
-            v2 = e.verts[1]
-            
-            # Make sure that verts are not a part of the cutting plane:
-            if e.select and (v1 not in face.verts and v2 not in face.verts):
-                if len(face.verts) < 5:  # Not an n-gon
-                    intersection = intersect_line_face(e, face, True)
-                else:
-                    intersection = intersect_line_plane(v1.co, v2.co, face.verts[0].co, normal)
-
-                # More debug info - I think this can stay.
-                if bpy.app.debug:
-                    print("Intersection", end = ': ')
-                    print(intersection)
-
-                # If an intersection exists find the distance of each of the end
-                # points from the plane, with "positive" being in the direction
-                # of the cutting plane's normal.  If the points are on opposite
-                # side of the plane, then it intersects and we need to cut it.
-                if intersection != None:
-                    d1 = distance_point_to_plane(v1.co, face.verts[0].co, normal)
-                    d2 = distance_point_to_plane(v2.co, face.verts[0].co, normal)
-                    # If they have different signs, then the edge crosses the
-                    # cutting plane:
-                    if abs(d1 + d2) < abs(d1 - d2):
-                        # Make the first vertice the positive vertice:
-                        if d1 < d2:
-                            v2, v1 = v1, v2
-                        if self.make_copy:
-                            new = bVerts.new()
-                            new.co = intersection
-                            new.select = True
-                        elif self.rip:
-                            newV1 = bVerts.new()
-                            newV1.co = intersection
-
-                            if bpy.app.debug:
-                                print("newV1 created", end = '; ')
-
-                            newV2 = bVerts.new()
-                            newV2.co = intersection
-
-                            if bpy.app.debug:
-                                print("newV2 created", end = '; ')
-
-                            newE1 = bEdges.new((v1, newV1))
-                            newE2 = bEdges.new((v2, newV2))
-
-                            if bpy.app.debug:
-                                print("new edges created", end = '; ')
-
-                            bEdges.remove(e)
-
-                            if bpy.app.debug:
-                                print("old edge removed.")
-                                print("We're done with this edge.")
-                        else:
-                            new = list(bmesh.utils.edge_split(e, v1, 0.5))
-                            new[1].co = intersection
-                            e.select = False
-                            new[0].select = False
-                            if self.pos:
-                                bEdges.remove(new[0])
-                            if self.neg:
-                                bEdges.remove(e)
-
-        bm.to_mesh(context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# This projects the selected edges onto the selected plane.  This projects both
-# points on the selected edge.
-class Project(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_project"
-    bl_label = "Project"
-    bl_description = "Projects the selected vertices/edges onto the selected plane."
-    bl_options = {'REGISTER', 'UNDO'}
-
-    make_copy = BoolProperty(name = "Make Copy",
-                             description = "Make a duplicate of the vertices instead of moving it",
-                             default = False)
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, "make_copy")
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(context.active_object.data)
-        bm.normal_update()
-
-        bFaces = bm.faces
-        bEdges = bm.edges
-        bVerts = bm.verts
-
-        fVerts = []
-
-        # Find the selected face.  This will provide the plane to project onto:
-        # @todo Check first for an active face
-        for f in bFaces:
-            if f.select:
-                for v in f.verts:
-                    fVerts.append(v)
-                normal = f.normal
-                f.select = False
-                break
-
-        for v in bVerts:
-            if v.select:
-                if v in fVerts:
-                    v.select = False
-                    continue
-                d = distance_point_to_plane(v.co, fVerts[0].co, normal)
-                if self.make_copy:
-                    temp = v
-                    v = bVerts.new()
-                    v.co = temp.co
-                vector = normal
-                vector.length = abs(d)
-                v.co = v.co - (vector * sign(d))
-                v.select = False
-
-        bm.to_mesh(context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# Project_End is for projecting/extending an edge to meet a plane.
-# This is used be selecting a face to define the plane then all the edges.
-# The add-on will then move the vertices in the edge that is closest to the
-# plane to the coordinates of the intersection of the edge and the plane.
-class Project_End(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_project_end"
-    bl_label = "Project (End Point)"
-    bl_description = "Projects the vertice of the selected edges closest to a plane onto that plane."
-    bl_options = {'REGISTER', 'UNDO'}
-
-    make_copy = BoolProperty(name = "Make Copy",
-                             description = "Make a duplicate of the vertice instead of moving it",
-                             default = False)
-    keep_length = BoolProperty(name = "Keep Edge Length",
-                               description = "Maintain edge lengths",
-                               default = False)
-    use_force = BoolProperty(name = "Use opposite vertices",
-                             description = "Force the usage of the vertices at the other end of the edge",
-                             default = False)
-    use_normal = BoolProperty(name = "Project along normal",
-                              description = "Use the plane's normal as the projection direction",
-                              default = False)
-
-    def draw(self, context):
-        layout = self.layout
-##        layout.prop(self, "keep_length")
-        if not self.keep_length:
-            layout.prop(self, "use_normal")
-##        else:
-##            self.report({'ERROR_INVALID_INPUT'}, "Maintaining edge length not yet supported")
-##            self.report({'WARNING'}, "Projection may result in unexpected geometry")
-        layout.prop(self, "make_copy")
-        layout.prop(self, "use_force")
-
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(context.active_object.data)
-        bm.normal_update()
-
-        bFaces = bm.faces
-        bEdges = bm.edges
-        bVerts = bm.verts
-
-        fVerts = []
-
-        # Find the selected face.  This will provide the plane to project onto:
-        for f in bFaces:
-            if f.select:
-                for v in f.verts:
-                    fVerts.append(v)
-                normal = f.normal
-                f.select = False
-                break
-
-        for e in bEdges:
-            if e.select:
-                v1 = e.verts[0]
-                v2 = e.verts[1]
-                if v1 in fVerts or v2 in fVerts:
-                    e.select = False
-                    continue
-                intersection = intersect_line_plane(v1.co, v2.co, fVerts[0].co, normal)
-                if intersection != None:
-                    # Use abs because we don't care what side of plane we're on:
-                    d1 = distance_point_to_plane(v1.co, fVerts[0].co, normal)
-                    d2 = distance_point_to_plane(v2.co, fVerts[0].co, normal)
-                    # If d1 is closer than we use v1 as our vertice:
-                    # "xor" with 'use_force':
-                    if (abs(d1) < abs(d2)) is not self.use_force:
-                        if self.make_copy:
-                            v1 = bVerts.new()
-                            v1.co = e.verts[0].co
-                        if self.keep_length:
-                            v1.co = intersection
-                        elif self.use_normal:
-                            vector = normal
-                            vector.length = abs(d1)
-                            v1.co = v1.co - (vector * sign(d1))
-                        else:
-                            v1.co = intersection
-                    else:
-                        if self.make_copy:
-                            v2 = bVerts.new()
-                            v2.co = e.verts[1].co
-                        if self.keep_length:
-                            v2.co = intersection
-                        elif self.use_normal:
-                            vector = normal
-                            vector.length = abs(d2)
-                            v2.co = v2.co - (vector * sign(d2))
-                        else:
-                            v2.co = intersection
-                e.select = False
-
-        bm.to_mesh(context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# Edge Fillet
-#
-# Blender currently does not have a CAD-style edge-based fillet function. This
-# is my atempt to create one.  It should take advantage of BMesh and the ngon
-# capabilities for non-destructive modeling, if possible.  This very well may
-# not result in nice quads and it will be up to the artist to clean up the mesh
-# back into quads if necessary.
-#
-# Assumptions:
-#   - Faces are planar. This should, however, do a check an warn otherwise.
-#
-# Developement Process:
-# Because this will eventaully prove to be a great big jumble of code and
-# various functionality, this is to provide an outline for the developement
-# and functionality wanted at each milestone.
-#   1) intersect_line_face: function to find the intersection point, if it
-#       exists, at which a line intersects a face.  The face does not have to
-#       be planar, and can be an ngon.  This will allow for a point to be placed
-#       on the actual mesh-face for non-planar faces.
-#   2) Minimal propagation, single edge: Filleting of a single edge without
-#       propagation of the fillet along "tangent" edges.
-#   3) Minimal propagation, multiple edges: Perform said fillet along/on
-#       multiple edges.
-#   4) "Tangency" detection code: because we have a mesh based geometry, this
-#       have to make an educated guess at what is actually supposed to be
-#       treated as tangent and what constitutes a sharp edge.  This should
-#       respect edges marked as sharp (does not propagate passed an
-#       intersecting edge that is marked as sharp).
-#   5) Tangent propagation, single edge: Filleting of a single edge using the
-#       above tangency detection code to continue the fillet to adjacent
-#       "tangent" edges.
-#   6) Tangent propagation, multiple edges: Same as above, but with multiple
-#       edges selected.  If multiple edges were selected along the same
-#       tangency path, only one edge will be filleted.  The others must be
-#       ignored/discarded.
-class Fillet(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_fillet"
-    bl_label = "Edge Fillet"
-    bl_description = "Fillet the selected edges."
-    bl_options = {'REGISTER', 'UNDO'}
-
-    radius = FloatProperty(name = "Radius",
-                           description = "Radius of the edge fillet",
-                           min = 0.00001, max = 1024.0,
-                           default = 0.5)
-    prop = EnumProperty(name = "Propagation",
-                        items = [("m", "Minimal", "Minimal edge propagation"),
-                                 ("t", "Tangential", "Tangential edge propagation")],
-                        default = "m")
-    prop_fac = FloatProperty(name = "Propagation Factor",
-                             description = "Corner detection sensitivity factor for tangential propagation",
-                             min = 0.0, max = 100.0,
-                             default = 25.0)
-    deg_seg = FloatProperty(name = "Degrees/Section",
-                            description = "Approximate degrees per section",
-                            min = 0.00001, max = 180.0,
-                            default = 10.0)
-    res = IntProperty(name = "Resolution",
-                      description = "Resolution of the fillet",
-                      min = 1, max = 1024,
-                      default = 8)
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, "radius")
-        layout.prop(self, "prop")
-        if self.prop == "t":
-            layout.prop(self, "prop_fac")
-        layout.prop(self, "deg_seg")
-        layout.prop(self, "res")
-
-    
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-
-    def execute(self, context):
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(bpy.context.active_object.data)
-        bm.normal_update()
-
-        bFaces = bm.faces
-        bEdges = bm.edges
-        bVerts = bm.verts
-
-        # Robustness check: this does not support n-gons (at least for now)
-        # because I have no idea how to handle them righ now.  If there is
-        # an n-gon in the mesh, warn the user that results may be nuts because
-        # of it.
-        #
-        # I'm not going to cause it to exit if there are n-gons, as they may
-        # not be encountered.
-        # @todo I would like this to be a confirmation dialoge of some sort
-        # @todo I would REALLY like this to just handle n-gons. . . .
-        for f in bFaces:
-            if len(face.verts) > 4:
-                self.report({'WARNING'},
-                            "Mesh contains n-gons which are not supported. Operation may fail.")
-                break
-
-        # Get the selected edges:
-        # Robustness check: boundary and wire edges are not fillet-able.
-        edges = [e for e in bEdges if e.select and not e.is_boundary and not e.is_wire]
-
-        for e in edges:
-            axis_points = fillet_axis(e, self.radius)
-            
-
-        bm.to_mesh(bpy.context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-# For testing the mess that is "intersect_line_face" for possible math errors.
-# This will NOT be directly exposed to end users: it will always require running
-# Blender in debug mode.
-# So far no errors have been found. Thanks to anyone who tests and reports bugs!
-class Intersect_Line_Face(bpy.types.Operator):
-    bl_idname = "mesh.edgetools_ilf"
-    bl_label = "ILF TEST"
-    bl_description = "TEST ONLY: INTERSECT_LINE_FACE"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return(ob and ob.type == 'MESH' and context.mode == 'EDIT_MESH')
-
-
-    def invoke(self, context, event):
-        return self.execute(context)
-
-
-    def execute(self, context):
-        # Make sure we really are in debug mode:
-        if not bpy.app.debug:
-            self.report({'ERROR_INVALID_INPUT'},
-                        "This is for debugging only: you should not be able to run this!")
-            return {'CANCELLED'}
-        
-        bpy.ops.object.editmode_toggle()
-        bm = bmesh.new()
-        bm.from_mesh(bpy.context.active_object.data)
-        bm.normal_update()
-
-        bFaces = bm.faces
-        bEdges = bm.edges
-        bVerts = bm.verts
-
-        face = None
-        for f in bFaces:
-            if f.select:
-                face = f
-                break
-
-        edge = None
-        for e in bEdges:
-            if e.select and not e in face.edges:
-                edge = e
-                break
-
-        point = intersect_line_face(edge, face, True)
-
-        if point != None:
-            new = bVerts.new()
-            new.co = point
-        else:
-            bpy.ops.object.editmode_toggle()
-            self.report({'ERROR_INVALID_INPUT'}, "point was \"None\"")
-            return {'CANCELLED'}
-
-        bm.to_mesh(bpy.context.active_object.data)
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-class VIEW3D_MT_edit_mesh_edgetools(bpy.types.Menu):
-    bl_label = "EdgeTools"
-    
-    def draw(self, context):
-        global integrated
-        layout = self.layout
-        
-        layout.operator("mesh.edgetools_extend")
-        layout.operator("mesh.edgetools_spline")
-        layout.operator("mesh.edgetools_ortho")
-        layout.operator("mesh.edgetools_shaft")
-        layout.operator("mesh.edgetools_slice")
-        layout.operator("mesh.edgetools_project")
-        layout.operator("mesh.edgetools_project_end")
-        if bpy.app.debug:
-            ## Not ready for prime-time yet:
-            layout.operator("mesh.edgetools_fillet")
-            ## For internal testing ONLY:
-            layout.operator("mesh.edgetools_ilf")
-        # If TinyCAD VTX exists, add it to the menu.
-        # @todo This does not work.
-        if integrated and bpy.app.debug:
-            layout.operator(EdgeIntersections.bl_idname, text="Edges V Intersection").mode = -1
-            layout.operator(EdgeIntersections.bl_idname, text="Edges T Intersection").mode = 0
-            layout.operator(EdgeIntersections.bl_idname, text="Edges X Intersection").mode = 1
-
-
-def menu_func(self, context):
-    self.layout.menu("VIEW3D_MT_edit_mesh_edgetools")
-    self.layout.separator()
-
-
-# define classes for registration
-classes = [VIEW3D_MT_edit_mesh_edgetools,
-    Extend,
-    Spline,
-    Ortho,
-    Shaft,
-    Slice,
-    Project,
-    Project_End,
-    Fillet,
-    Intersect_Line_Face]
-
-
-# registering and menu integration
-def register():
-    global integrated
-    if int(bpy.app.build_revision[0:5]) < 44800:
-        print("Error in Edgetools:")
-        print("This version of Blender does not support the necessary BMesh API.")
-        print("Please download Blender 2.63 or newer.")
-        return {'ERROR'}
-        
-    for c in classes:
-        bpy.utils.register_class(c)
-
-    # I would like this script to integrate the TinyCAD VTX menu options into
-    # the edge tools menu if it exists.  This should make the UI a little nicer
-    # for users.
-    # @todo Remove TinyCAD VTX menu entries and add them too EdgeTool's menu
-    import inspect, os.path
-
-    path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
-    if os.path.isfile(path + "\mesh_edge_intersection_tools.py"):
-        print("EdgeTools UI integration test - TinyCAD VTX Found")
-        integrated = True
-    
-    bpy.types.VIEW3D_MT_edit_mesh_specials.prepend(menu_func)
-
-
-# unregistering and removing menus
-def unregister():
-    for c in classes:
-        bpy.utils.unregister_class(c)
-
-    bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
-    
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/__init__.py b/release/scripts/addons_contrib/mesh_extra_tools/__init__.py
deleted file mode 100644
index b2fb9c2..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/__init__.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-# Contributed to by
-# meta-androcto #
-
-bl_info = {
-    "name": "Extra Tools",
-    "author": "various",
-    "version": (0, 1),
-    "blender": (2, 64, 0),
-    "location": "View3D > Toolbar and View3D > Specials (W-key)",
-    "description": "Add extra mesh edit tools",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=32711",
-    "category": "Mesh"}
-
-
-if "bpy" in locals():
-    import imp
-    imp.reload(mesh_bump)
-    imp.reload(face_inset_fillet)
-    imp.reload(mesh_bevel_witold)
-    imp.reload(mesh_filletplus)
-    imp.reload(mesh_normal_smooth)
-    imp.reload(mesh_polyredux)
-    imp.reload(mesh_vertex_chamfer)
-    imp.reload(mesh_mextrude_plus)
-
-else:
-    from . import mesh_bump
-    from . import face_inset_fillet
-    from . import mesh_bevel_witold
-    from . import mesh_filletplus
-    from . import mesh_normal_smooth
-    from . import mesh_polyredux
-    from . import mesh_vertex_chamfer
-    from . import mesh_mextrude_plus
-
-import bpy
-
-class VIEW3D_MT_edit_mesh_extras(bpy.types.Menu):
-    # Define the "Extras" menu
-    bl_idname = "VIEW3D_MT_edit_mesh_extras"
-    bl_label = "Extra Tools"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.operator("faceinfillet.op0_id",
-            text="Face Inset Fillet")
-        layout.operator("fillet.op0_id",
-            text="Edge Fillet Plus")
-        layout.operator("object.mextrude",
-            text="Multi Extrude")
-        layout.operator("mesh.bump",
-            text="Inset Extrude Bump")
-        layout.operator("mesh.mbevel",
-            text="Bevel Selected")
-        layout.operator("mesh.vertex_chamfer",
-            text="Vertex Chamfer")
-        layout.operator("mesh.polyredux",
-            text="Poly Redux")
-        layout.operator("normal.smooth",
-            text="Normal Smooth")
-
-
-class ExtrasPanel(bpy.types.Panel):
-    bl_label = 'Mesh Extra Tools'
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_context = 'mesh_edit'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.split(0.80)
-        row.operator('faceinfillet.op0_id', text = 'Face Inset Fillet', icon = 'PLUGIN')
-        row.operator('help.face_inset', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('fillet.op0_id', text = 'Edge Fillet plus', icon = 'PLUGIN')
-        row.operator('help.edge_fillet', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('object.mextrude', text = 'Multi Face Extrude', icon = 'PLUGIN')
-        row.operator('help.mextrude', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('mesh.bump', text = 'Inset Bump', icon = 'PLUGIN')
-        row.operator('help.bump', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('mesh.mbevel', text = 'Bevel Selected', icon = 'PLUGIN')
-        row.operator('help.edge_bevel', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('mesh.vertex_chamfer', text = 'Vertex Chamfer' , icon = 'PLUGIN')
-        row.operator('help.vertexchamfer', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('mesh.polyredux', text = 'Poly Redux', icon = 'PLUGIN')
-        row.operator('help.polyredux', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('normal.smooth', text = 'Normal Smooth', icon = 'PLUGIN')
-        row.operator('help.normal_smooth', text = '', icon = 'INFO')
-        row = layout.split(0.50)
-        row.operator('mesh.flip_normals', text = 'Normals Flip')
-        row.operator('mesh.remove_doubles', text = 'Remove Doubles')
-
-
-# Multi Extrude Panel
-
-class ExtrudePanel(bpy.types.Panel):
-    bl_label = 'Multi Extrude Plus'
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.split(0.80)
-        row.operator('object.mextrude', text = 'Multi Face Extrude', icon = 'PLUGIN')
-        row.operator('help.mextrude', text = '', icon = 'INFO')
-        row = layout.split(0.80)
-        row.operator('object.mesh2bones', text = 'Add Armature', icon = 'PLUGIN')
-        row.operator('help.addarm', text = '', icon = 'INFO')
-
-# Define "Extras" menu
-def menu_func(self, context):
-    self.layout.menu('VIEW3D_MT_edit_mesh_extras', icon='PLUGIN')
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    # Add "Extras" menu to the "Add Mesh" menu
-    bpy.types.VIEW3D_MT_edit_mesh_specials.prepend(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    # Remove "Extras" menu from the "Add Mesh" menu.
-    bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/face_inset_fillet.py b/release/scripts/addons_contrib/mesh_extra_tools/face_inset_fillet.py
deleted file mode 100644
index bc4824e..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/face_inset_fillet.py
+++ /dev/null
@@ -1,226 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# based completely on addon by zmj100
-# ------ ------
-import bpy
-import bmesh
-from bpy.props import FloatProperty, IntProperty, BoolProperty, EnumProperty
-from math import tan, cos, degrees, radians, sin
-from mathutils import Matrix
-
-# ------ ------
-def edit_mode_out():
-    bpy.ops.object.mode_set(mode = 'OBJECT')
-
-def edit_mode_in():
-    bpy.ops.object.mode_set(mode = 'EDIT')
-
-def a_rot(ang, rp, axis, q):
-    return (Matrix.Rotation(ang, 3, axis) * (q - rp)) + rp
-
-# ------ ------
-def f_(bme, list_0, opp, adj1, n_, out, radius, en0, kp):
-
-    list_del = []
-    for fi in list_0:
-        f = bme.faces[fi]
-        f.select_set(0)
-        list_del.append(f)
-        f.normal_update()
-        list_2 = [v.index for v in f.verts]
-        dict_0 = {}
-        list_1 = []
-        n = len(list_2)
-        for i in range(n):
-            dict_0[i] = []
-            p = (bme.verts[ list_2[i] ].co).copy()
-            p1 = (bme.verts[ list_2[(i - 1) % n] ].co).copy()
-            p2 = (bme.verts[ list_2[(i + 1) % n] ].co).copy()
-            dict_0[i].append(bme.verts[list_2[i]])
-            vec1 = p - p1
-            vec2 = p - p2
-            ang = vec1.angle(vec2)
-            adj = opp / tan(ang * 0.5)
-            h = (adj ** 2 + opp ** 2) ** 0.5
-            if round(degrees(ang)) == 180 or round(degrees(ang)) == 0.0:
-                p6 = a_rot(radians(90), p, vec1, p + ((f.normal).normalized() * opp) if out == True else p - ((f.normal).normalized() * opp))
-                list_1.append(p6)
-            else:
-                p6 = a_rot(-radians(90), p, ((p - (vec1.normalized() * adj)) - (p - (vec2.normalized() * adj))), p + ((f.normal).normalized() * h) if out == True else p - ((f.normal).normalized() * h))
-                list_1.append(p6)
-
-        list_2 = []
-        n1_ = len(list_1)
-        for j in range(n1_):
-            q = list_1[j]
-            q1 = list_1[(j - 1) % n1_]
-            q2 = list_1[(j + 1) % n1_]
-            vec1_ = q - q1
-            vec2_ = q - q2
-            ang_ = vec1_.angle(vec2_)
-            if round(degrees(ang_)) == 180 or round(degrees(ang_)) == 0.0:
-                bme.verts.new(q)
-                bme.verts.index_update()
-                list_2.append(bme.verts[-1])
-                dict_0[j].append(bme.verts[-1])
-            else:
-                opp_ = adj1
-                if radius == False:
-                    h_ = adj1 * (1 / cos(ang_ * 0.5))
-                    d = adj1
-                elif radius == True:
-                    h_ = opp_ / sin(ang_ * 0.5)
-                    d = opp_ / tan(ang_ * 0.5)
-
-                q3 = q - (vec1_.normalized() * d)
-                q4 = q - (vec2_.normalized() * d)
-                rp_ = q - ((q - ((q3 + q4) * 0.5)).normalized() * h_)
-                axis_ = vec1_.cross(vec2_)
-                vec3_ = rp_ - q3
-                vec4_ = rp_ - q4
-                rot_ang = vec3_.angle(vec4_)
-                list_3 = []
-                
-                for o in range(n_ + 1):
-                    q5 = a_rot((rot_ang * o / n_), rp_, axis_, q4)
-                    bme.verts.new(q5)
-                    bme.verts.index_update()
-                    dict_0[j].append(bme.verts[-1])
-                    list_3.append(bme.verts[-1])
-                list_3.reverse()
-                list_2.extend(list_3)
-
-        if out == False:
-            bme.faces.new(list_2)
-            bme.faces.index_update()
-            bme.faces[-1].select_set(1)
-        elif out == True and kp == True:
-            bme.faces.new(list_2)
-            bme.faces.index_update()
-            bme.faces[-1].select_set(1)
-
-        n2_ = len(dict_0)
-        for o in range(n2_):
-            list_a = dict_0[o]
-            list_b = dict_0[(o + 1) % n2_]
-            bme.faces.new( [ list_a[0], list_b[0], list_b[-1], list_a[1] ] )
-            bme.faces.index_update()
-
-        if en0 == 'opt0':
-            for k in dict_0:
-                if len(dict_0[k]) > 2:
-                    bme.faces.new(dict_0[k])
-                    bme.faces.index_update()
-        if en0 == 'opt1':
-            for k_ in dict_0:
-                q_ = dict_0[k_][0]
-                dict_0[k_].pop(0)
-                n3_ = len(dict_0[k_])
-                for kk in range(n3_ - 1):
-                    bme.faces.new( [ dict_0[k_][kk], dict_0[k_][(kk + 1) % n3_], q_ ] )
-                    bme.faces.index_update()
-
-
-    del_ = [bme.faces.remove(f) for f in list_del]
-    del del_
-
-# ------ operator 0 ------
-class faceinfillet_op0(bpy.types.Operator):
-    bl_idname = 'faceinfillet.op0_id'
-    bl_label = 'Face Inset Fillet'
-    bl_description = 'inset selected faces'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    opp = FloatProperty( name = '', default = 0.04, min = 0, max = 100.0, step = 1, precision = 3 )      # inset amount
-    n_ = IntProperty( name = '', default = 4, min = 1, max = 100, step = 1 )      # number of sides
-    adj1 = FloatProperty( name = '', default = 0.04, min = 0.00001, max = 100.0, step = 1, precision = 3 )
-    out = BoolProperty( name = 'Out', default = False )
-    radius = BoolProperty( name = 'Radius', default = False )
-    en0 = EnumProperty( items =( ('opt0', 'Type 1', ''), ('opt1', 'Type 2', '') ), name = '', default = 'opt0' )
-    kp = BoolProperty( name = 'Keep face', default = False )
-    
-    def draw(self, context):
-        layout = self.layout
-        box = layout.box()
-        box.prop(self, 'en0', text = 'Corner type')
-        row0 = box.row(align = True)
-        row0.prop(self, 'out')
-        if self.out == True:
-            row0.prop(self, 'kp')
-        row = box.split(0.40, align = True)
-        row.label('Inset amount:')
-        row.prop(self, 'opp')
-        row1 = box.split(0.60, align = True)
-        row1.label('Number of sides:')
-        row1.prop(self, 'n_', slider = True)
-        box.prop(self, 'radius')
-        row2 = box.split(0.40, align = True)
-        if self.radius == True:
-            row2.label('Radius:')
-        else:
-            row2.label('Distance:')
-        row2.prop(self, 'adj1')
-
-    def execute(self, context):
-        opp = self.opp
-        n_ = self.n_
-        adj1 = self.adj1
-        out = self.out
-        radius = self.radius
-        en0 = self.en0
-        kp = self.kp
-
-        edit_mode_out()
-        ob_act = context.active_object
-        bme = bmesh.new()
-        bme.from_mesh(ob_act.data)
-        
-        list_0 = [ f.index for f in bme.faces if f.select and f.is_valid ]
-
-        if len(list_0) == 0:
-            self.report({'INFO'}, 'No faces selected unable to continue.')
-            edit_mode_in()
-            return {'CANCELLED'}
-        elif len(list_0) != 0:
-            f_(bme, list_0, opp, adj1, n_, out, radius, en0, kp)
-
-        bme.to_mesh(ob_act.data)
-        edit_mode_in()
-        return {'FINISHED'}
-
-class inset_help(bpy.types.Operator):
-	bl_idname = 'help.face_inset'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Select a face or faces & inset.')
-		layout.label('Inset square, circle or outside.')
-		layout.label('To Help:')
-		layout.label('Circle: use remove doubles to tidy joins.')
-		layout.label('Outset: select & use normals flip before extruding.')
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 350)
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_bevel_witold.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_bevel_witold.py
deleted file mode 100644
index 01b0f95..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_bevel_witold.py
+++ /dev/null
@@ -1,198 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-'''
-Bevel add-on
-'''
-#--- ### Header
-bl_info = {
-    "name": "Bevel witold",
-    "author": "Witold Jaworski",
-    "version": (1, 2, 0),
-    "blender": (2, 57, 0),
-    "api": 36147,
-    "location": "View3D >Specials (W-key)",
-    "category": "Mesh",
-    "description": "Bevels selected edges",
-    "warning": "",
-    "wiki_url": "http://airplanes3d.net/scripts-252_e.xml",
-    "tracker_url": "http://airplanes3d.net/track-252_e.xml"
-    }
-#--- ### Change log
-#2011-08-08 Witold Jaworski: added "Vertex only" feature
-#--- ### Imports
-import bpy
-from bpy.utils import register_module, unregister_module
-from bpy.props import FloatProperty, IntProperty, BoolProperty
-from math import log10, floor, pow
-#--- ### Constants
-DEBUG = 0 #Debug flag - just some text printed on the console...
-#--- ### Core operation
-def bevel(obj, width, use_vertices):
-    """Bevels selected edges of the mesh
-       Arguments:
-            @obj (Object):         an object with a mesh. 
-                                   It should have some edges selected
-            @width (float):        width of the bevel
-            @use_vertices (bool):  True, when bevel only vertices. False otherwise
-       This function should be called in the Edit Mode, only!
-    """    
-    #
-    #edge = bpy.types.MeshEdge
-    #obj = bpy.types.Object
-    #bevel = bpy.types.BevelModifier
-
-    bpy.ops.object.editmode_toggle() #switch into OBJECT mode
-    #adding the Bevel modifier
-    bpy.ops.object.modifier_add(type = 'BEVEL')  
-    bevel = obj.modifiers[-1] #the new modifier is always added at the end
-    bevel.limit_method = 'WEIGHT'
-    bevel.edge_weight_method = 'LARGEST'
-    bevel.width = width
-    bevel.use_only_vertices = use_vertices
-    #moving it up, to the first position on the modifier stack:
-    while obj.modifiers[0] != bevel:
-        bpy.ops.object.modifier_move_up(modifier = bevel.name)
-        
-    for elm in (obj.data.vertices if use_vertices else obj.data.edges):
-        if elm.select:
-            elm.bevel_weight = 1.0 
-    
-    bpy.ops.object.modifier_apply(apply_as = 'DATA', modifier = bevel.name)
-    
-    #clean up after applying our modifier: remove bevel weights:
-    for elm in (obj.data.vertices if use_vertices else obj.data.edges):
-        if elm.select:
-            elm.bevel_weight = 0.0 
-            
-    bpy.ops.object.editmode_toggle() #switch back into EDIT_MESH mode
-
-class bevel_help(bpy.types.Operator):
-	bl_idname = 'help.edge_bevel'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Select A edge or edges & bevel.')
-		layout.label('or Select 2 or more verices & bevel.')
-		layout.label('To Help:')
-		layout.label('best used on flat edges & simple edgeflow')
-		layout.label('may error if vert joins multiple edges/complex edge selection')
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 350)
-#--- ### Operator
-class Bevel(bpy.types.Operator):
-    ''' Bevels selected edges of the mesh'''
-    bl_idname = "mesh.mbevel" #it is not named mesh.bevel, to not confuse with the standard bevel in the future...
-    bl_label = "Bevel Selected"
-    bl_description = "Bevels selected edges"
-    bl_options = {'REGISTER', 'UNDO'} #Set this options, if you want to update  
-    #                                  parameters of this operator interactively 
-    #                                  (in the Tools pane) 
-    #--- parameters
-    use_vertices = BoolProperty(name="Only Vertices", description="Bevel vertices (corners), not edges", default = False)
-    
-    width = FloatProperty(name="Width", description="Bevel width value (it is multiplied by 10^Exponent)", 
-                          subtype = 'DISTANCE', default = 0.1, min = 0.0, 
-                                                    step = 1, precision = 2)
-#    exponent = IntProperty(name="Exponent", description="Order of magnitude of the bevel width (the power of 10)", default = 0)
-    
-    use_scale = BoolProperty(name="Use object scale", description="Multiply bevel width by the scale of this object", default = False)
-
-    #--- other fields
-    LAST_VERT_NAME = "mesh.mbevel.last_vert" #the name of the custom scene property 
-    LAST_WIDTH_NAME = "mesh.mbevel.last_width" #the name of the custom scene property 
-    LAST_EXP_NAME = "mesh.mbevel.last_exponent" #the name of the custom scene property 
-    LAST_SCALE_NAME = "mesh.mbevel.last_scale" #scale Bevel width by the object scale 
-    #--- Blender interface methods
-    @classmethod
-    def poll(cls,context):
-        return (context.mode == 'EDIT_MESH')
-
-    def invoke(self, context, event):
-        #input validation: 
-        # 1. Require single-user mesh (modifiers cannot be applied to the multi-user ones):
-        obj = context.object
-        if obj.data.users > 1:
-            self.report(type='ERROR', message="Make this mesh single-user, first")
-            return {'CANCELLED'}
-        # 2. is there anything selected?
-        self.use_vertices = context.scene.get(self.LAST_VERT_NAME, self.use_vertices)
-
-        bpy.ops.object.editmode_toggle()
-        
-        if self.use_vertices :
-            selected = list(filter(lambda e: e.select, context.object.data.vertices))
-        else:
-            selected = list(filter(lambda e: e.select, context.object.data.edges))
-            
-        bpy.ops.object.editmode_toggle()
-            
-        if len(selected) > 0:
-            self.use_scale = context.object.get(self.LAST_SCALE_NAME, self.use_scale)
-            
-            #setup the default width, to avoid user surprises :)
-            def_exp = floor(log10(obj.dimensions.length)) #heuristic: default width exponent is derived from the object size...
-            self.exponent = context.scene.get(self.LAST_EXP_NAME, def_exp) #Let's read the last used value, stored in the scene...
-            larger = def_exp - self.exponent #How larger/smaller is actual object, comparing to the last used value?
-            if larger <= 1 and larger >= 0: #OK, this object has similar size to the previous one...
-                self.width = context.scene.get(self.LAST_WIDTH_NAME, self.width)
-            else: #the previous bevel size would be too small or too large - revert to defaults:
-                self.width = 0.1 #10% of the object order of magnitude
-                self.exponent = def_exp #the order of magnitude
-            #parameters adjusted, run the command!    
-            return self.execute(context)
-        else:
-            self.report(type='ERROR', message="Nothing is selected")
-            return {'CANCELLED'}
-        
-    def execute(self,context):
-        #calculate the bevel width, for this object size and scale
-        width = self.width*pow(10,self.exponent)
-        if not self.use_scale : width /= max(context.object.scale)
-        #call the main function:
-        bevel(context.object,width, self.use_vertices)
-        #save the last used parameters:
-        context.scene[self.LAST_VERT_NAME] = self.use_vertices
-        context.scene[self.LAST_WIDTH_NAME] = self.width
-        context.scene[self.LAST_EXP_NAME] = self.exponent
-        context.object[self.LAST_SCALE_NAME] = self.use_scale
-        return {'FINISHED'}
-
-def menu_draw(self, context):
-    self.layout.operator_context = 'INVOKE_REGION_WIN'
-    self.layout.operator(Bevel.bl_idname, "Bevel_Witold")
-    
-#--- ### Register
-def register():
-    register_module(__name__)
-    bpy.types.VIEW3D_MT_edit_mesh_specials.prepend(menu_draw)
-    
-def unregister():
-    bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_draw)
-    unregister_module(__name__)
-    
-#--- ### Main code    
-if __name__ == '__main__':
-    register()
-    
-if DEBUG > 0: print("mesh_bevel.py loaded!")
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_bump.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_bump.py
deleted file mode 100644
index 94f12cb..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_bump.py
+++ /dev/null
@@ -1,213 +0,0 @@
-# mesh_bump.py Copyright (C) 2011, Dolf Veenvliet
-#
-# Extrude a selection from a mesh multiple times
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Bump",
-    "author": "Dolf Veenvliet",
-    "version": 1,
-    "blender": (2, 56, 0),
-    "api": 31847,
-    "location": "View3D > Specials > Bump",
-    "description": "Extrude and translate/rotate/scale multiple times",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-"""
-Usage:
-
-Launch from "W-menu"
-
-Additional links:
-	Author Site: http://www.macouno.com
-	e-mail: dolf {at} macouno {dot} com
-"""
-
-import bpy
-from bpy.props import EnumProperty, FloatVectorProperty, FloatProperty, BoolProperty
-from . import mesh_extras
-
-# Bump stuff!
-class Bump():
-
-	# Initialise the class
-	def __init__(self, context, type, scale, steps):
-	
-		self.ob = context.active_object
-		bpy.ops.object.mode_set(mode='OBJECT')
-		
-		translate = mesh_extras.get_average_outer_edge_length()
-		#inset = mesh_extras.get_shortest_outer_edge_length() * 0.25
-		
-		translate *= scale
-		
-		bpy.ops.object.mode_set(mode='EDIT')
-		
-		stepped = 0
-	
-		# Simple... we just do a bunch of steps... set in stone... easy!
-		if type == 'BUM':
-		
-			self.extrude()
-			
-			bpy.ops.object.mode_set(mode='OBJECT')
-			bpy.ops.object.mode_set(mode='EDIT')
-			
-			self.shrink(-translate)
-			self.shrink(translate*0.3)
-			
-			stepped += 1
-		
-		# Spike!
-		elif type == 'SPI':
-		
-			for i in range(3):
-		
-				self.extrude()
-				
-				bpy.ops.object.mode_set(mode='OBJECT')
-				bpy.ops.object.mode_set(mode='EDIT')
-				
-				if not i:
-					f = 0.5
-				elif i == 1:
-					f = 0.3
-				elif i == 2:
-					f = 0.2
-				
-				t = translate * f
-				
-				self.shrink(-t)
-				self.shrink(t * (2 * f))
-				
-				stepped += 1
-				
-		# Dimple!
-		elif type == 'DIM' or type == 'PIM':
-		
-			self.extrude()
-			bpy.ops.object.mode_set(mode='OBJECT')
-			bpy.ops.object.mode_set(mode='EDIT')
-			
-			self.shrink(-translate * 0.2)
-			
-			self.extrude()
-			bpy.ops.object.mode_set(mode='OBJECT')
-			bpy.ops.object.mode_set(mode='EDIT')
-			
-			self.shrink(translate * 0.2)
-			self.shrink(-translate * 0.2)
-			
-			if type == 'PIM':
-				self.extrude()
-				bpy.ops.object.mode_set(mode='OBJECT')
-				bpy.ops.object.mode_set(mode='EDIT')
-			
-				self.shrink(-translate * 0.2)
-				stepped = 3
-			else:
-				stepped = 2
-			
-			
-			
-
-		if steps:
-			self.ob['growsteps'] = stepped
-		
-	
-		
-	# Extrude the selection (do not move it)
-	def extrude(self):
-		bpy.ops.mesh.extrude_faces_move()
-		
-	# SHrink!
-	def shrink(self,v):
-		bpy.ops.transform.shrink_fatten(value=v, mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
-		
-	
-
-class Bump_init(bpy.types.Operator):
-	'''Bump by extruding and moving/rotating/scaling multiple times'''
-	bl_idname = 'mesh.bump'
-	bl_label = 'Inset Extrude Bump'
-	bl_options = {'REGISTER', 'UNDO'}
-	
-	# The falloffs we use
-	types=(
-		('BUM', 'Bump',''),
-		('SPI', 'Spike',''),
-		('DIM', 'Dimple',''),
-		('PIM', 'Pimple',''),
-		)
-	
-	type = EnumProperty(items=types, name='Type', description='The type of bump', default='BUM')
-	
-	# Scale
-	scale = FloatProperty(name='Scale factor', description='Translation in Blender units', default=1.0, min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, step=10, precision=2)
-	
-	steps = BoolProperty(name='Retain steps', description='Keep the step count in a property', default=False)
-
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH' and bpy.context.tool_settings.mesh_select_mode[0] == False and bpy.context.tool_settings.mesh_select_mode[1] == False and bpy.context.tool_settings.mesh_select_mode[2] == True)
-
-	def execute(self, context):
-		BUMP = Bump(context, self.type, self.scale, self.steps) 
-		return {'FINISHED'}
-
-class bump_help(bpy.types.Operator):
-	bl_idname = 'help.bump'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Make a selection or selection of Faces ')
-		layout.label('Choose from the bump types in the menu')
-		layout.label('To Help:')
-		layout.label('Keep extrusions small to prevent overlapping')
-		layout.label('Do not select all faces')
-		layout.label('if using with create armature, enter object mode first')
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 350)		
-'''
-def menu_func(self, context):
-	self.layout.operator(Bump_init.bl_idname, text="Bump")
-
-def register():
-	bpy.utils.register_module(__name__)
-	bpy.types.VIEW3D_MT_edit_mesh_specials.append(menu_func)
-
-def unregister():
-	bpy.utils.unregister_module(__name__)
-	bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_func)
-
-if __name__ == "__main__":
-	register()
-'''
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_extras.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_extras.py
deleted file mode 100644
index 49ddd44..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_extras.py
+++ /dev/null
@@ -1,274 +0,0 @@
-import bpy, mathutils, math
-from mathutils import geometry
-
-# Get a matrix for the selected faces that you can use to do local transforms
-def get_selection_matrix(faces=False):
-	
-	me = bpy.context.active_object.data
-	
-	if not faces:
-		faces = get_selected_faces()
-	
-	yVec = mathutils.Vector()
-	zVec = mathutils.Vector()
-	
-	# Ok so we have a basic matrix, but lets base it more on the mesh!
-	for f in faces:
-			
-		v1 = me.vertices[f.vertices[0]].co
-		v2 = me.vertices[f.vertices[1]].co
-		edge = v2-v1
-		
-		yVec += edge
-		
-		if len(f.vertices) == 4:
-			v1 = me.vertices[f.vertices[2]].co
-			v2 = me.vertices[f.vertices[3]].co
-			edge = v1-v2
-			
-			yVec += edge
-		
-		zVec += mathutils.Vector(f.normal)
-					
-	if not yVec.length:
-		quat = zVec.to_track_quat('-Z', 'Y')
-		tMat = quat.to_matrix()
-		yVec = tMat[1]
-		yVec = yVec.normalized()
-	else:
-		yVec = yVec.normalized()
-	zVec = zVec.normalized()
-	
-	# Rotate yVec so it's 90 degrees to zVec
-	cross =yVec.cross(zVec)
-	vec = float(yVec.angle(zVec) - math.radians(90))
-	mat = mathutils.Matrix.Rotation(vec, 3, cross)
-	yVec =  (mat * yVec)
-	
-	xVec = yVec.cross(zVec)
-	
-	xVec = xVec.normalized()
-	
-	nMat = mathutils.Matrix((xVec, yVec, zVec))
-	
-	return nMat
-
-
-
-# Get the selection radius (minimum distance of an outer edge to the centre)
-def get_selection_radius():
-
-	ob = bpy.context.active_object
-
-	radius = 0.0
-	
-	# no use continueing if nothing is selected
-	if contains_selected_item(ob.data.polygons):
-	
-		# Find the center of the selection
-		cent = mathutils.Vector()
-		nr = 0
-		nonVerts = []
-		selVerts = []
-		for f in ob.data.polygons:
-			if f.select:
-				nr += 1
-				cent += f.center
-			else:
-				nonVerts.extend(f.vertices)
-				
-		cent /= nr
-		
-		chk = 0
-		
-		# Now that we know the center.. we can figure out how close the nearest point on an outer edge is
-		for e in get_selected_edges():
-		
-			nonSection = [v for v in e.vertices if v in nonVerts]
-			if len(nonSection):
-			
-				v0 = ob.data.vertices[e.vertices[0]].co
-				v1 = ob.data.vertices[e.vertices[1]].co
-				
-				# If there's more than 1 vert of this edge on the outside... we need the edge length to be long enough too!
-				if len(nonSection) > 1:
-					edge = v0 - v1
-					edgeRad = edge.length * 0.5
-					
-					if edgeRad < radius or not chk:
-						radius = edgeRad
-						chk += 1
-				
-				int = geometry.intersect_point_line(cent, v0, v1)
-				
-				rad = cent - int[0]
-				l = rad.length
-				
-				if l < radius or not chk:
-					radius = l
-					chk += 1
-					
-	return radius
-	
-	
-	
-# Get the average length of the outer edges of the current selection
-def get_shortest_outer_edge_length():
-
-	ob = bpy.context.active_object
-
-	min = False
-	me = ob.data
-	
-	delVerts = []
-	for f in me.faces:
-		if not f.select:
-			delVerts.extend(f.vertices)
-	selEdges = [e.vertices for e in me.edges if e.select]
-
-	if len(selEdges) and len(delVerts):
-		
-		for eVerts in selEdges:
-			
-			v0 = eVerts[0]
-			v1 = eVerts[1]
-			
-			if v0 in delVerts and v1 in delVerts:
-				ln = (me.vertices[v0].co - me.vertices[v1].co).length
-				if min is False or (ln > 0.0 and ln < min):
-					min = ln
-						
-	return min
-
-
-# Get the average length of the outer edges of the current selection
-def get_average_outer_edge_length():
-
-	ob = bpy.context.active_object
-
-	ave = 0.0
-	me = ob.data
-	
-	delFaces = [f.vertices for f  in me.polygons if not f.select]
-	selEdges = [e.vertices for e in me.edges if e.select]
-
-	if len(selEdges) and len(delFaces):
-	
-		number = 0
-		
-		for eVerts in selEdges:
-			
-			v0 = eVerts[0]
-			v1 = eVerts[1]
-			
-			for fVerts in delFaces:
-				if v0 in fVerts and v1 in fVerts:
-					number += 1
-					ave += (me.vertices[v0].co - me.vertices[v1].co).length
-					break
-						
-		if number:
-			ave /= number
-			
-	return ave
-
-
-	
-# Get the selected (or deselected items)
-def get_selected(type='vertices',invert=False):
-	
-	mesh = bpy.context.active_object.data
-	
-	if type == 'vertices':
-		items = mesh.vertices
-	elif type == 'edges':
-		items = mesh.edges
-	else:
-		items = mesh.polygons
-		
-	if invert:
-		L = [i for i in items if not i.select]
-	else:
-		L = [i for i in items if i.select]
-	return L
-	
-	
-	
-# See if the mesh has something selected
-def has_selected(type='vertices',invert=False):
-	
-	mesh = bpy.context.active_object.data
-	
-	if type == 'vertices':
-		items = mesh.vertices
-	elif type == 'edges':
-		items = mesh.edges
-	else:
-		items = mesh.polygons
-		
-	for i in items:
-		if not invert and i.select:
-			return True
-		elif invert and not i.select:
-			return True
-			
-	return False
-		
-		
-
-# Get all the selected vertices (mode is selected or deselected)
-def get_selected_vertices(mode='selected'):
-
-	vertices = bpy.context.active_object.data.vertices
-
-	if mode == 'deselected':
-		L = [v for v in vertices if not v.select]
-	else:
-		L = [v for v in vertices if v.select]
-	return L
-	
-	
-	
-# Get all the selected edges (mode is selected or deselected)
-def get_selected_edges(mode='selected'):
-
-	edges = bpy.context.active_object.data.edges
-
-	if mode == 'deselected':
-		L = [e for e in edges if not e.select]
-	else:
-		L = [e for e in edges if e.select]
-	return L
-
-
-	
-# Get all the selected faces (mode is selected or deselected)
-def get_selected_faces(mode='selected'):
-	
-	polygons = bpy.context.active_object.data.polygons
-	
-	if mode == 'deselected':
-		L = [f for f in polygons if not f.select]
-	else:
-		L = [f for f in polygons if f.select]
-	return L
-	
-	
-	
-# See if there is at least one selected item in 'items'
-def contains_selected_item(items):
-
-	for item in items:
-		if item.select:
-			return True
-				
-	return False
-	
-
-
-
-
-
-	
-	
-		
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_filletplus.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_filletplus.py
deleted file mode 100644
index c390d17..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_filletplus.py
+++ /dev/null
@@ -1,382 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-# ------ ------
-bl_info = {
-    "name": "FilletPlus",
-    "author": "Gert De Roost - original by zmj100",
-    "version": (0, 4, 2),
-    "blender": (2, 61, 0),
-    "api": 43085,
-    "location": "View3D > Tool Shelf",
-    "description": "",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-# ------ ------
-import bpy
-from bpy.props import FloatProperty, IntProperty, BoolProperty
-import bmesh
-from mathutils import Matrix
-from math import cos, pi, degrees, sin, tan
-
-
-def list_clear_(l):
-	del l[:]
-	return l
-
-def get_adj_v_(list_):
-		tmp = {}
-		for i in list_:
-				try:			 tmp[i[0]].append(i[1])
-				except KeyError: tmp[i[0]] = [i[1]]
-				try:			 tmp[i[1]].append(i[0])
-				except KeyError: tmp[i[1]] = [i[0]]
-		return tmp
-
-# ------ ------
-class f_buf():
-	an = 0
-
-# ------ ------
-def f_(list_0, startv, vertlist, face, adj, n, out, flip, radius):
-
-	dict_0 = get_adj_v_(list_0)
-	list_1 = [[dict_0[i][0], i, dict_0[i][1]] for i in dict_0 if (len(dict_0[i]) == 2)][0]
-	list_3 = []
-	for elem in list_1:
-		list_3.append(bm.verts[elem])
-	list_2 = []
-
-	p_ = list_3[1]
-	p = (list_3[1].co).copy()
-	p1 = (list_3[0].co).copy()
-	p2 = (list_3[2].co).copy()
-
-	vec1 = p - p1
-	vec2 = p - p2
-
-	ang = vec1.angle(vec2, any)
-	f_buf.an = round(degrees(ang))
-
-	# -- -- -- --
-	if f_buf.an == 180 or f_buf.an == 0.0:
-		return
-
-	# -- -- -- --
-	opp = adj
-
-	if radius == False:
-		h = adj * (1 / cos(ang * 0.5))
-		adj_ = adj
-	elif radius == True:
-		h = opp / sin(ang * 0.5)
-		adj_ = opp / tan(ang * 0.5)
-
-	p3 = p - (vec1.normalized() * adj_)
-	p4 = p - (vec2.normalized() * adj_)
-	rp = p - ((p - ((p3 + p4) * 0.5)).normalized() * h)
-
-	vec3 = rp - p3
-	vec4 = rp - p4
-
-	axis = vec1.cross(vec2)
-
-	if out == False:
-		if flip == False:
-			rot_ang = vec3.angle(vec4)
-		elif flip == True:
-			rot_ang = vec1.angle(vec2)
-	elif out == True:
-		rot_ang = (2 * pi) - vec1.angle(vec2)
-
-	for j in range(n + 1):
-		new_angle = rot_ang * j / n
-		mtrx = Matrix.Rotation(new_angle, 3, axis)
-		if out == False:
-			if flip == False:
-				tmp = p4 - rp
-				tmp1 = mtrx * tmp
-				tmp2 = tmp1 + rp
-			elif flip == True:
-				p3 = p - (vec1.normalized() * opp)
-				tmp = p3 - p
-				tmp1 = mtrx * tmp
-				tmp2 = tmp1 + p
-		elif out == True:
-			p4 = p - (vec2.normalized() * opp)
-			tmp = p4 - p
-			tmp1 = mtrx * tmp
-			tmp2 = tmp1 + p
-
-		v = bm.verts.new(tmp2)
-		list_2.append(v)
-		
-	if flip == True:
-		list_3[1:2] = list_2
-	else:
-		list_2.reverse()
-		list_3[1:2] = list_2
-
-	list_clear_(list_2)
-
-	n1 = len(list_3)
-	for t in range(n1 - 1):
-		bm.edges.new([list_3[t], list_3[(t + 1) % n1]])
-
-		v = bm.verts.new(p)
-		bm.edges.new([v, p_])
-	
-	if face != None:
-		for l in face.loops:
-			if l.vert == list_3[0]:
-				startl = l
-				break
-		vertlist2 = []
-		if startl.link_loop_next.vert == startv:
-			l = startl.link_loop_prev
-			while len(vertlist) > 0:
-				vertlist2.insert(0, l.vert)
-				vertlist.pop(vertlist.index(l.vert))
-				l = l.link_loop_prev
-		else:
-			l = startl.link_loop_next
-			while len(vertlist) > 0:
-				vertlist2.insert(0, l.vert)
-				vertlist.pop(vertlist.index(l.vert))
-				l = l.link_loop_next
-		for v in list_3:
-			vertlist2.append(v)
-		bm.faces.new(vertlist2)
-		
-	bm.verts.remove(startv)
-	list_3[1].select = 1
-	list_3[-2].select = 1
-	bm.edges.get([list_3[0], list_3[1]]).select = 1
-	bm.edges.get([list_3[-1], list_3[-2]]).select = 1
-	bm.verts.index_update()
-	bm.edges.index_update()
-	bm.faces.index_update()
-	
-	me.update(calc_edges = True, calc_tessface=True)
-	
-	
-
-def do_filletplus(pair):
-	
-	global inaction
-	global flip
-	
-	
-	list_0 = [list([e.verts[0].index, e.verts[1].index]) for e in pair]
-
-	vertset = set([])
-	vertset.add(bm.verts[list_0[0][0]])
-	vertset.add(bm.verts[list_0[0][1]])
-	vertset.add(bm.verts[list_0[1][0]])
-	vertset.add(bm.verts[list_0[1][1]])
-	
-	v1, v2, v3 = vertset
-
-	if len(list_0) != 2:
-		self.report({'INFO'}, 'Two adjacent edges must be selected.')
-		return
-	else:
-		inaction = 1
-		vertlist = []
-		found = 0
-		for f in v1.link_faces:
-			if v2 in f.verts and v3 in f.verts:
-				found = 1
-		if not(found):
-			for v in [v1, v2, v3]:
-				if v.index in list_0[0] and v.index in list_0[1]:
-					startv = v
-			face = None
-		else:
-			for f in v1.link_faces:
-				if v2 in f.verts and v3 in f.verts:
-					for v in f.verts:
-						if not(v in vertset):
-							vertlist.append(v)
-						if v in vertset and v.link_loops[0].link_loop_prev.vert in vertset and v.link_loops[0].link_loop_next.vert in vertset:
-							startv = v
-					face = f
-		if out == True:
-			flip = False
-		f_(list_0, startv, vertlist, face, adj, n, out, flip, radius)
-		
-
-'''
-
-# ------ panel 0 ------
-class f_p0(bpy.types.Panel):
-	bl_space_type = 'VIEW_3D'
-	bl_region_type = 'TOOLS'
-	#bl_idname = 'f_p0_id'												  
-	bl_label = 'Fillet'
-	bl_context = 'mesh_edit'
-
-	def draw(self, context):
-		layout = self.layout
-		
-		row = layout.split(0.80)
-		row.operator('f.op0_id', text = 'Fillet plus')
-		row.operator('f.op1_id', text = '?')
-'''
-# ------ operator 0 ------
-class fillet_op0(bpy.types.Operator):
-	bl_idname = 'fillet.op0_id'
-	bl_label = 'Fillet'
-	bl_description = 'Fillet ajoining edges'
-	bl_options = {'REGISTER', 'UNDO'}
-
-	adj = FloatProperty( name = '', default = 0.1, min = 0.00001, max = 100.0, step = 1, precision = 3 )
-	n = IntProperty( name = '', default = 3, min = 1, max = 100, step = 1 )
-	out = BoolProperty( name = 'Outside', default = False )
-	flip = BoolProperty( name = 'Flip', default = False )
-	radius = BoolProperty( name = 'Radius', default = False )
-	
-	
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
-	
-	def draw(self, context):
-		layout = self.layout
-
-		if f_buf.an == 180 or f_buf.an == 0.0:
-			layout.label('Info:')
-			layout.label('Angle equal to 0 or 180,')
-			layout.label('can not fillet.')
-		else:
-			layout.prop(self, 'radius')
-			if self.radius == True:
-				layout.label('Radius:')
-			elif self.radius == False:
-				layout.label('Distance:')
-			layout.prop(self, 'adj')
-			layout.label('Number of sides:')
-			layout.prop(self, 'n', slider = True)
-			if self.n > 1:
-				row = layout.row(align = False)
-				row.prop(self, 'out')
-				if self.out == False:
-					row.prop(self, 'flip')
-
-	def execute(self, context):
-
-		global inaction
-		global bm, me, adj, n, out, flip, radius
-
-		adj = self.adj
-		n = self.n
-		out = self.out
-		flip = self.flip
-		radius = self.radius
-		
-		inaction = 0
-
-		ob_act = context.active_object
-		me = ob_act.data
-		bm = bmesh.from_edit_mesh(me)
-#		e_mode = bpy.context.tool_settings.mesh_select_mode
-		
-		done = 1
-		while done:
-			tempset = set([])
-			for v in bm.verts:
-				if v.select:
-					tempset.add(v)
-			done = 0		
-			for v in tempset:
-				cnt = 0
-				edgeset = set([])
-				for e in v.link_edges:
-					if e.select:
-						edgeset.add(e)
-						cnt += 1
-				if cnt == 2:
-					do_filletplus(edgeset)
-					done = 1
-					break
-					#return {'FINISHED'}
-				if done:
-					break
-					
-		if inaction == 1:
-			bpy.ops.mesh.select_all(action="DESELECT")
-			for v in bm.verts:
-				if len(v.link_edges) == 0:
-					bm.verts.remove(v)
-			bpy.ops.object.editmode_toggle()
-			bpy.ops.object.editmode_toggle()
-			return {'FINISHED'}
-		else:
-			return {'CANCELLED'}
-
-# ------ operator 1 ------
-class filletedgehelp(bpy.types.Operator):
-	bl_idname = 'help.edge_fillet'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Select two adjacent edges and press Fillet button.')
-		layout.label('To Help:')
-		layout.label('best used on flat plane.')
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 350)
-
-# ------ operator 2 ------
-class fillet_op2(bpy.types.Operator):
-	bl_idname = 'fillet.op2_id'
-	bl_label = ''
-
-	def execute(self, context):
-		bpy.ops.f.op1_id('INVOKE_DEFAULT')
-		return {'FINISHED'}
-'''
-# ------ ------
-class_list = [ f_op0, f_op1, f_op2, f_p0]
-
-# ------ register ------
-def register():
-	for c in class_list:
-		bpy.utils.register_class(c)
-
-# ------ unregister ------
-def unregister():
-	for c in class_list:
-		bpy.utils.unregister_class(c)
-
-# ------ ------
-if __name__ == "__main__":
-	register()
-'''
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_mextrude_plus.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_mextrude_plus.py
deleted file mode 100644
index 2dba166..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_mextrude_plus.py
+++ /dev/null
@@ -1,385 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-################################################################################
-# Repeats extrusion + rotation + scale for one or more faces                   #
-
-################################################################################
-
-bl_info = {
-    "name": "MExtrude Plus",
-    "author": "liero",
-    "version": (1, 2, 8),
-    "blender": (2, 62, 0),
-    "location": "View3D > Tool Shelf",
-    "description": "Repeat extrusions from faces to create organic shapes",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=28570",
-    "category": "Mesh"}
-
-import  bpy, bmesh, mathutils, random
-from random import gauss
-from math import radians
-from mathutils import Euler, Vector
-from bpy.props import BoolProperty, FloatProperty, IntProperty, StringProperty
-
-def vloc(self, r):
-    random.seed(self.ran + r)
-    return self.off * (1 + random.gauss(0, self.var1 / 3))
-
-def vrot(self,r):
-    random.seed(self.ran + r)
-    return Euler((radians(self.rotx) + random.gauss(0, self.var2 / 3), \
-        radians(self.roty) + random.gauss(0, self.var2 / 3), \
-        radians(self.rotz) + random.gauss(0,self.var2 / 3)), 'XYZ')
-
-def vsca(self, r):
-    random.seed(self.ran + r)
-    return self.sca * (1 + random.gauss(0, self.var3 / 3))
-
-# centroide de una seleccion de vertices
-def centro(ver):
-    vvv = [v for v in ver if v.select]
-    if not vvv or len(vvv) == len(ver): return ('error')
-    x = sum([round(v.co[0],4) for v in vvv]) / len(vvv)
-    y = sum([round(v.co[1],4) for v in vvv]) / len(vvv)
-    z = sum([round(v.co[2],4) for v in vvv]) / len(vvv)
-    return (x,y,z)
-
-# recuperar el estado original del objeto
-def volver(obj, copia, om, msm, msv):
-    for i in copia: obj.data.vertices[i].select = True
-    bpy.context.tool_settings.mesh_select_mode = msm
-    for i in range(len(msv)):
-        obj.modifiers[i].show_viewport = msv[i]
-
-class MExtrude(bpy.types.Operator):
-    bl_idname = 'object.mextrude'
-    bl_label = 'MExtrude'
-    bl_description = 'Multi Extrude'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    off = FloatProperty(name='Offset', min=-2, soft_min=0.001, \
-        soft_max=2, max=5, default=.5, description='Translation')
-    rotx = FloatProperty(name='Rot X', min=-85, soft_min=-30, \
-        soft_max=30, max=85, default=0, description='X rotation')
-    roty = FloatProperty(name='Rot Y', min=-85, soft_min=-30, \
-        soft_max=30, max=85, default=0, description='Y rotation')
-    rotz = FloatProperty(name='Rot Z', min=-85, soft_min=-30, \
-        soft_max=30, max=85, default=-0, description='Z rotation')
-    sca = FloatProperty(name='Scale', min=0.1, soft_min=0.5, \
-        soft_max=1.2, max =2, default=1.0, description='Scaling')
-    var1 = FloatProperty(name='Offset Var', min=-5, soft_min=-1, \
-        soft_max=1, max=5, default=0, description='Offset variation')
-    var2 = FloatProperty(name='Rotation Var', min=-5, soft_min=-1, \
-        soft_max=1, max=5, default=0, description='Rotation variation')
-    var3 = FloatProperty(name='Scale Noise', min=-5, soft_min=-1, \
-        soft_max=1, max=5, default=0, description='Scaling noise')
-    num = IntProperty(name='Repeat', min=1, max=50, soft_max=100, \
-        default=5, description='Repetitions')
-    ran = IntProperty(name='Seed', min=-9999, max=9999, default=0, \
-        description='Seed to feed random values')
-
-    @classmethod
-    def poll(cls, context):
-        obj = context.object
-        return (obj and obj.type == 'MESH')
-
-    def draw(self, context):
-        layout = self.layout
-        column = layout.column(align=True)
-        column.label(text='Transformations:')
-        column.prop(self, 'off', slider=True)
-        column.prop(self, 'rotx', slider=True)
-        column.prop(self, 'roty', slider=True)
-        column.prop(self, 'rotz', slider=True)
-        column.prop(self, 'sca', slider=True)
-        column = layout.column(align=True)
-        column.label(text='Variation settings:')
-        column.prop(self, 'var1', slider=True)
-        column.prop(self, 'var2', slider=True)
-        column.prop(self, 'var3', slider=True)
-        column.prop(self, 'ran')
-        column = layout.column(align=False)
-        column.prop(self, 'num')
-
-    def execute(self, context):
-        obj = bpy.context.object
-        data, om =  obj.data, obj.mode
-        bpy.context.tool_settings.mesh_select_mode = [False, False, True]
-
-        # bmesh operations
-        bpy.ops.object.mode_set()
-        bm = bmesh.new()
-        bm.from_mesh(obj.data)
-        sel = [f for f in bm.faces if f.select]
-
-        # faces loop
-        for i, of in enumerate(sel):
-            rot = vrot(self, i)
-            off = vloc(self, i)
-            of.normal_update()
-
-            # extrusion loop
-            for r in range(self.num):
-                nf = of.copy()
-                nf.normal_update()
-                no = nf.normal.copy()
-                ce = nf.calc_center_bounds()
-                s = vsca(self, i + r)
-
-                for v in nf.verts:
-                    v.co -= ce
-                    v.co.rotate(rot)
-                    v.co += ce + no * off
-                    v.co = v.co.lerp(ce, 1 - s)
-
-                # extrude code from TrumanBlending
-                for a, b in zip(of.loops, nf.loops):
-                    sf = bm.faces.new((a.vert, a.link_loop_next.vert, \
-                        b.link_loop_next.vert, b.vert))
-                    sf.normal_update()
-
-                bm.faces.remove(of)
-                of = nf
-
-        for v in bm.verts: v.select = False
-        for e in bm.edges: e.select = False
-        bm.to_mesh(obj.data)
-        obj.data.update()
-
-        # restore user settings
-        bpy.ops.object.mode_set(mode=om)
-
-        if not len(sel):
-            self.report({'INFO'}, 'Select one or more faces...')
-        return{'FINISHED'}
-
-class mextrude_help(bpy.types.Operator):
-	bl_idname = 'help.mextrude'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Make a selection or selection of Faces.')
-		layout.label('Extrude, rotate extrusions & more.')
-		layout.label('For rigging capabilities, see Multi Extrude Plus panel.')
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 300)
-
-class addarm_help(bpy.types.Operator):
-	bl_idname = 'help.addarm'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('With Multi extrude to rig extrusions.')
-		layout.label('Adds Empty to control rig.')
-		layout.label('Based on selected face/s & object center.')
-
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 300)
-
-class BB(bpy.types.Operator):
-    bl_idname = 'object.mesh2bones'
-    bl_label = 'Create Armature'
-    bl_description = 'Create an armature rig based on mesh selection'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    numb = IntProperty(name='Max Bones', min=1, max=1000, soft_max=100, default=5, description='Max number of bones')
-    skip = IntProperty(name='Skip Loops', min=0, max=5, default=0, description='Skip some edges to get longer bones')
-    long = FloatProperty(name='Min Length', min=0.01, max=5, default=0.15, description='Discard bones shorter than this value')
-    ika = BoolProperty(name='IK constraints', default=True, description='Add IK constraint and Empty as target')
-    rotk = BoolProperty(name='IK Rotation', default=False, description='IK constraint follows target rotation')
-    auto = BoolProperty(name='Auto weight', default=True, description='Auto weight and assign vertices')
-    env = BoolProperty(name='Envelopes', default=False, description='Use envelopes instead of weights')
-    rad = FloatProperty(name='Radius', min=0.01, max=5, default=0.25, description='Envelope deform radius')
-    nam = StringProperty(name='', default='hueso', description='Default name for bones / groups')
-
-    @classmethod
-    def poll(cls, context):
-        obj = bpy.context.object
-        return (obj and obj.type == 'MESH')
-
-    def draw(self, context):
-        layout = self.layout
-        column = layout.column(align=True)
-        column.prop(self,'numb')
-        column.prop(self,'skip')
-        column.prop(self,'long')
-        column = layout.column(align=True)
-        column.prop(self,'auto')
-        if self.auto:
-            column.prop(self,'env')
-            if self.env: column.prop(self,'rad')
-        column.prop(self,'ika')
-        if self.ika: column.prop(self,'rotk')
-        layout.prop(self,'nam')
-
-    def execute(self, context):
-        scn = bpy.context.scene
-        obj = bpy.context.object
-        fac = obj.data.polygons
-        # guardar estado y seleccion
-        ver, om = obj.data.vertices, obj.mode
-        msm, msv = list(bpy.context.tool_settings.mesh_select_mode), []
-        for i in range(len(obj.modifiers)):
-            msv.append(obj.modifiers[i].show_viewport)
-            obj.modifiers[i].show_viewport = False
-        bpy.ops.object.mode_set(mode='OBJECT')
-        copia = [v.index for v in ver if v.select]
-        sel = [f.index for f in fac if f.select]
-        bpy.ops.object.mode_set(mode='EDIT')
-        bpy.context.tool_settings.mesh_select_mode = [True, False, False]
-        bpy.ops.mesh.select_all(action='DESELECT')
-        txt = 'Select a face or a vertex where the chain should end...'
-        bpy.ops.object.mode_set(mode='OBJECT')
-
-        # crear rig unico -desde vertice/s y no desde caras-
-        if sel == []:
-            sel = ['simple']
-            for i in copia:
-                obj.data.vertices[i].select = True
-
-        # reciclar el rig en cada refresco...
-        try: scn.objects.unlink(rig)
-        except: pass
-
-        # loop de caras
-        for i in sel:
-            if sel[0] != 'simple':
-                for v in ver: v.select = False
-                for v in fac[i].vertices: ver[v].select = True
-            lista = [centro(ver)]
-            if lista[0] == 'error':
-                self.report({'INFO'}, txt)
-                volver(obj, copia, om, msm, msv)
-                return{'FINISHED'}
-
-            # crear lista de coordenadas para los huesos
-            scn.objects.active = obj
-            for t in range(self.numb):
-                bpy.ops.object.mode_set(mode='EDIT')
-                bpy.ops.object.vertex_group_assign(new=True)
-                for m in range(self.skip+1):
-                    bpy.ops.mesh.select_more()
-                bpy.ops.object.vertex_group_deselect()
-                bpy.ops.object.mode_set(mode='OBJECT')
-                lista.append(centro(ver))
-                bpy.ops.object.mode_set(mode='EDIT')
-                bpy.ops.object.vertex_group_select()
-                bpy.ops.object.vertex_group_remove()
-                if lista[-1] == 'error':
-                    self.numb = t
-                    lista.pop()
-                    break
-                if len(lista) > 1:
-                    delta = Vector(lista[-2]) - Vector(lista[-1])
-                    if delta.length < self.long:
-                        lista.pop()
-
-            bpy.ops.mesh.select_all(action='DESELECT')
-            bpy.ops.object.mode_set(mode='OBJECT')
-
-            # crear armature y copiar transformaciones del objeto
-            lista.reverse()
-            if len(lista) < 2:
-                self.report({'INFO'}, txt)
-                volver(obj, copia, om, msm, msv)
-                return{'FINISHED'}
-            try: arm
-            except:
-                arm = bpy.data.armatures.new('arm')
-                if self.env: arm.draw_type = 'ENVELOPE'
-                else: arm.draw_type = 'STICK'
-                rig = bpy.data.objects.new(obj.name+'_rig', arm)
-                rig.matrix_world = obj.matrix_world
-                if self.env: rig.draw_type = 'WIRE'
-                rig.show_x_ray = True
-                scn.objects.link(rig)
-            scn.objects.active = rig
-            bpy.ops.object.mode_set(mode='EDIT')
-
-            # crear la cadena de huesos desde la lista
-            for i in range(len(lista)-1):
-                bon = arm.edit_bones.new(self.nam+'.000')
-                bon.use_connect = True
-                bon.tail = lista[i+1]
-                bon.head = lista[i]
-                if self.auto and self.env:
-                    bon.tail_radius = self.rad
-                    bon.head_radius = self.rad
-                if i: bon.parent = padre
-                padre = bon
-            bpy.ops.object.mode_set(mode='OBJECT')
-
-            # crear IK constraint y un Empty como target
-            if self.ika:
-                ik = rig.data.bones[-1].name
-                loc = rig.matrix_world * Vector(lista[-1])
-                rot = rig.matrix_world * rig.data.bones[-1].matrix_local
-                bpy.ops.object.add(type='EMPTY', location=loc, rotation=rot.to_euler())
-                tgt = bpy.context.object
-                tgt.name = obj.name+'_target.000'
-                if len(sel) > 1:
-                    try: mega
-                    except:
-                        bpy.ops.object.add(type='EMPTY', location = obj.location)
-                        mega = bpy.context.object
-                        mega.name = obj.name+'_Controls'
-                        tgt.select = True
-                    scn.objects.active = mega
-                    bpy.ops.object.parent_set(type='OBJECT')
-
-                scn.objects.active = rig
-                bpy.ops.object.mode_set(mode='POSE')
-                con = rig.pose.bones[ik].constraints.new('IK')
-                con.target = tgt
-                if self.rotk: con.use_rotation = True
-                tgt.select = False
-                bpy.ops.object.mode_set(mode='OBJECT')
-
-        obj.select = True
-        if self.auto:
-            if self.env: bpy.ops.object.parent_set(type='ARMATURE_ENVELOPE')
-            else: bpy.ops.object.parent_set(type='ARMATURE_AUTO')
-        scn.objects.active = obj
-        volver(obj, copia, om, msm, msv)
-        return{'FINISHED'}
-'''
-def register():
-    bpy.utils.register_class(MExtrude)
-
-    bpy.utils.register_class(BB)
-
-def unregister():
-    bpy.utils.unregister_class(MExtrude)
-
-    bpy.utils.unregister_class(BB)
-
-
-if __name__ == '__main__':
-    register()
-'''
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_normal_smooth.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_normal_smooth.py
deleted file mode 100644
index 32d36b9..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_normal_smooth.py
+++ /dev/null
@@ -1,215 +0,0 @@
-# mesh_normalsmooth_7.py Copyright (C) 2010, Dolf Veenvliet
-#
-# Relaxes selected vertices while retaining the shape as much as possible
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Normal Smooth",
-    "author": "Dolf Veenvliet",
-    "version": (7,),
-    "blender": (2, 63, 0),
-    "location": "View3D > Specials > Normal Smooth ",
-    "description": "Smooth the vertex position based on the normals",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=32587",
-    "category": "Mesh"}
-    
-"""
-Usage:
-
-Launch from "W-menu" or from "Mesh -> Vertices -> Normal Smooth"
-
-Additional links:
-    Author Site: http://www.macouno.com
-    e-mail: dolf {at} macouno {dot} com
-"""
-
-import bpy, mathutils, math
-from bpy.props import IntProperty
-
-## Rotate one vector (vec1) towards another (vec2)
-## (rad = ammount of degrees to rotate in radians)
-def RotVtoV(vec1, vec2, rad):
-    cross = vec1.cross(vec2)
-    mat = mathutils.Matrix.Rotation(rad, 3, cross)
-    return (mat * vec1)
-
-
-# Find the new coordinate for this verticle
-def smoothVert(v1, v1in, me):
-    
-    v1co = v1.co
-    v1no = v1.normal
-    
-    # List of verts not to check (don't check against yourself)
-    chk = [v1in]
-    newCo = []
-    
-    # Make sure there's faces, otherwise we do nothing
-    if len(me.polygons):
-        
-        # Check every face
-        for f in me.polygons:
-            
-            # Only check faces that this vert is in
-            if v1in in f.vertices:
-                
-                # Loop through all the verts in the face
-                for v2in in f.vertices:
-                    
-                    # Make sure you check every vert only once
-                    if not v2in in chk:
-                        
-                        chk.append(v2in)
-                        
-                        v2 = me.vertices[v2in]
-                        
-                        v2co = v2.co
-                        
-                        # Get the vector from one vert to the other
-                        vTov = v2co - v1co
-                        
-                        vLen = vTov.length
-                        
-                        # Use half the distance (actually 0.514 seems to be the specific nr to multiply by... just by experience)
-                        vLen *= 0.514
-                        
-                        # Get the normal rotated 90 degrees (pi * 0.5 = 90 degrees in radians) towards the original vert
-                        vNor = RotVtoV(v2.normal, vTov.normalized(), (math.pi * 0.5))
-                        
-                        # Make the vector the correct length
-                        vNor = vNor.normalized() * vLen
-                        
-                        # Add the vector to the vert position to get the correct coord
-                        vNor = v2co + vNor
-                        
-                        newCo.append(vNor)
-                        
-    # Calculate the new coord only if there's a result
-    if len(newCo):
-        
-        nC = mathutils.Vector()
-        
-        # Add all the new coordinates together
-        for c in newCo:
-            nC = nC + c
-            
-        # Divide the resulting vector by the total to get the average
-        nC = nC / len(newCo)
-        
-    # If there's no result, just return the original coord
-    else:
-        nC = v1co
-                    
-    return nC
-                    
-
-# Base function
-def normal_smooth(context):
-
-    ob = context.active_object
-
-    bpy.ops.object.mode_set(mode='OBJECT')
-    
-    vNew = {}
-    me = ob.data
-    
-    # loop through all verts
-    for v1 in me.vertices:
-        
-        # only smooth selected verts
-        if v1.select:
-            
-            v1in = v1.index
-            
-            # Get the new coords for this vert
-            vNew[v1in] = smoothVert(v1, v1in, me)
-            
-    # Only if they're anything new, can we apply anything
-    if len(vNew):
-        
-        # Get the indexes for all verts to adapt
-        for k in vNew.keys():
-            
-            # Set the vert's new coords
-            me.vertices[k].co = vNew[k]
-            
-    bpy.ops.object.mode_set(mode='EDIT')
-
-class nsmooth_help(bpy.types.Operator):
-	bl_idname = 'help.normal_smooth'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Select A vertex or group of verts.')
-		layout.label('Smooth the vertex position based on the normals')
-
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 300)
-    
-class NormalSmooth(bpy.types.Operator):
-    """Smoothes verticle position based on vertex normals"""
-    bl_idname = 'normal.smooth'
-    bl_label = 'Normal Smooth'
-    bl_options = {'REGISTER', 'UNDO'}
-
-
-    iterations = IntProperty(name="Smoothing iterations",
-                default=1, min=0, max=100, soft_min=0, soft_max=10)
-    
-    @classmethod
-    def poll(cls, context):
-        obj = context.active_object
-        return (obj and obj.type == 'MESH')
-
-    def execute(self, context):
-        for i in range(0,self.iterations):
-            normal_smooth(context)
-        return {'FINISHED'}
-
-
-def menu_func(self, context):
-    self.layout.operator(NormalSmooth.bl_idname, text="Normal Smooth")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.VIEW3D_MT_edit_mesh_specials.append(menu_func)
-    bpy.types.VIEW3D_MT_edit_mesh_vertices.append(menu_func)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_func)
-    bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_polyredux.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_polyredux.py
deleted file mode 100644
index ca7a29e..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_polyredux.py
+++ /dev/null
@@ -1,387 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# Script copyright (C) Campbell J Barton
-#
-# 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 *****
-# --------------------------------------------------------------------------
-bl_info = {
-    "name": "PolyRedux",
-    "author": "Campbell J Barton - updated by Gert De Roost",
-    "version": (2, 0, 4),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tools",
-    "description": "predictable mesh simplifaction maintaining face loops",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-
-if "bpy" in locals():
-    import imp
-
-import bpy
-import bmesh
-import time
-
-
-class PolyRedux(bpy.types.Operator):
-	bl_idname = "mesh.polyredux"
-	bl_label = "PolyRedux"
-	bl_description = "predictable mesh simplifaction maintaining face loops"
-	bl_options = {"REGISTER", "UNDO"}
-	
-
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH')
-
-	def invoke(self, context, event):
-		
-		scn = bpy.context.scene
-		
-		self.save_global_undo = bpy.context.user_preferences.edit.use_global_undo
-		bpy.context.user_preferences.edit.use_global_undo = False
-		
-		do_polyredux(self)
-		
-		return {'FINISHED'}
-
-class redux_help(bpy.types.Operator):
-	bl_idname = 'help.polyredux'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Make a selection of verts or polygons to reduce.')
-		layout.label('works on whole mesh or selected')
-		layout.label('To Help:')
-		layout.label('Single operation, no parameters.')
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 300)
-'''
-def panel_func(self, context):
-	
-	scn = bpy.context.scene
-	self.layout.label(text="PolyRedux:")
-	self.layout.operator("mesh.polyredux", text="Poly Redux")
-
-
-def register():
-	bpy.utils.register_module(__name__)
-	bpy.types.VIEW3D_PT_tools_meshedit.append(panel_func)
-
-
-def unregister():
-	bpy.utils.unregister_module(__name__)
-	bpy.types.VIEW3D_PT_tools_meshedit.remove(panel_func)
-
-
-if __name__ == "__main__":
-	register()
-
-
-'''
-
-def my_mesh_util():
-	bm_verts = bm.verts
-	
-	vert_faces = [ [] for v in bm_verts]
-	vert_faces_corner = [ [] for v in bm_verts]
-	
-	
-	# Ignore topology where there are not 2 faces connected to an edge.
-	edge_count = {}
-	for f in bm.faces:
-		for edge in f.edges:
-			edkey = (edge.verts[0].index, edge.verts[1].index)
-			try:
-				edge_count[edkey] += 1
-			except:
-				edge_count[edkey]  = 1
-				
-	for edkey, count in edge_count.items():
-		
-		# Ignore verts that connect to edges with more than 2 faces.
-		if count != 2:
-			vert_faces[edkey[0]] = None
-			vert_faces[edkey[1]] = None
-	# Done
-	
-	
-	
-	def faces_set_verts(face_ls):
-		unique_verts = set()
-		for f in face_ls:
-			for v in f.verts:
-				unique_verts.add(v.index)
-		return unique_verts
-	
-	for f in bm.faces:
-		for corner, v in enumerate(f.verts):
-			i = v.index
-			if vert_faces[i] != None:
-				vert_faces[i].append(f)
-				vert_faces_corner[i].append(corner)
-	
-	grid_data_ls = []
-	
-	for vi, face_ls in enumerate(vert_faces):
-		if face_ls != None:
-			if len(face_ls) == 4:
-				if face_ls[0].select and face_ls[1].select and face_ls[2].select and face_ls[3].select:					
-					# Support triangles also
-					unique_vert_count = len(faces_set_verts(face_ls))
-					quads = 0
-					for f in face_ls:
-						if len(f.verts) ==4:
-							quads += 1
-					if unique_vert_count==5+quads: # yay we have a grid
-						grid_data_ls.append( (vi, face_ls) )
-			
-			elif len(face_ls) == 3:
-				if face_ls[0].select and face_ls[1].select and face_ls[2].select:
-					unique_vert_count = len(faces_set_verts(face_ls))
-					if unique_vert_count==4: # yay we have 3 triangles to make into a bigger triangle
-						grid_data_ls.append( (vi, face_ls) )
-				
-	
-	
-	# Now sort out which grid faces to use
-	
-	
-	# This list will be used for items we can convert, vertex is key, faces are values
-	grid_data_dict = {}
-	
-	if not grid_data_ls:
-		print ("doing nothing")
-		return
-	
-	# quick lookup for the opposing corner of a qiad
-	quad_diag_mapping = 2,3,0,1
-	
-	verts_used = [0] * len(bm_verts) # 0 == untouched, 1==should touch, 2==touched
-	verts_used[grid_data_ls[0][0]] = 1 # start touching 1!
-	
-	# From the corner vert, get the 2 edges that are not the corner or its opposing vert, this edge will make a new face
-	quad_edge_mapping = (1,3), (2,0), (1,3), (0,2) # hi-low, low-hi order is intended
-	tri_edge_mapping = (1,2), (0,2), (0,1)
-	
-	done_somthing = True
-	while done_somthing:
-		done_somthing = False
-		grid_data_ls_index = -1
-		
-		for vi, face_ls in grid_data_ls:
-			grid_data_ls_index += 1
-			if len(face_ls) == 3:
-				grid_data_dict[bm.verts[vi]] = face_ls
-				grid_data_ls.pop( grid_data_ls_index )
-				break
-			elif len(face_ls) == 4:
-				# print vi
-				if verts_used[vi] == 1:
-					verts_used[vi] = 2 # dont look at this again.
-					done_somthing = True
-					
-					grid_data_dict[bm.verts[vi]] = face_ls
-					
-					# Tag all faces verts as used
-					
-					for i, f in enumerate(face_ls):
-						# i == face index on vert, needed to recall which corner were on.
-						v_corner = vert_faces_corner[vi][i]
-						fv =f.verts
-						
-						if len(f.verts) == 4:
-							v_other = quad_diag_mapping[v_corner]
-							# get the 2 other corners
-							corner1, corner2 = quad_edge_mapping[v_corner]
-							if verts_used[fv[v_other].index] == 0:
-								verts_used[fv[v_other].index] = 1 # TAG for touching!
-						else:
-							corner1, corner2 = tri_edge_mapping[v_corner]
-						
-						verts_used[fv[corner1].index] = 2 # Dont use these, they are 
-						verts_used[fv[corner2].index] = 2
-						
-						
-					# remove this since we have used it.
-					grid_data_ls.pop( grid_data_ls_index )
-					
-					break
-		
-		if done_somthing == False:
-			# See if there are any that have not even been tagged, (probably on a different island), then tag them.
-			
-			for vi, face_ls in grid_data_ls:
-				if verts_used[vi] == 0:
-					verts_used[vi] = 1
-					done_somthing = True
-					break
-	
-	
-	# Now we have all the areas we will fill, calculate corner triangles we need to fill in.
-	new_faces = []
-	quad_del_vt_map = (1,2,3), (0,2,3), (0,1,3), (0,1,2)
-	for v, face_ls in grid_data_dict.items():
-		for i, f in enumerate(face_ls):
-			if len(f.verts) == 4:
-				# i == face index on vert, needed to recall which corner were on.
-				v_corner = vert_faces_corner[v.index][i]
-				v_other = quad_diag_mapping[v_corner]
-				fv =f.verts
-				
-				#print verts_used[fv[v_other].index]
-				#if verts_used[fv[v_other].index] != 2: # DOSNT WORK ALWAYS
-				
-				if 1: # THIS IS LAzY - some of these faces will be removed after adding.
-					# Ok we are removing half of this face, add the other half
-					
-					# This is probably slower
-					# new_faces.append( [fv[ii].index for ii in (0,1,2,3) if ii != v_corner ] )
-					
-					# do this instead
-					new_faces.append( (fv[quad_del_vt_map[v_corner][0]].index, fv[quad_del_vt_map[v_corner][1]].index, fv[quad_del_vt_map[v_corner][2]].index) )
-	
-	del grid_data_ls
-	
-	
-	# me.sel = 0
-	def faceCombine4(vi, face_ls):
-		edges = []
-		
-		for i, f in enumerate(face_ls):
-			fv = f.verts
-			v_corner = vert_faces_corner[vi][i]
-			if len(f.verts)==4:	ed = quad_edge_mapping[v_corner]
-			else:			ed = tri_edge_mapping[v_corner]
-			
-			edges.append( [fv[ed[0]].index, fv[ed[1]].index] )
-		
-		# get the face from the edges 
-		face = edges.pop()
-		while len(face) != 4:
-			# print len(edges), edges, face
-			for ed_idx, ed in enumerate(edges):
-				if face[-1] == ed[0] and (ed[1] != face[0]):
-					face.append(ed[1])
-				elif face[-1] == ed[1] and (ed[0] != face[0]):
-					face.append(ed[0])
-				else:
-					continue
-				
-				edges.pop(ed_idx) # we used the edge alredy
-				break
-		
-		return face	
-	
-	for v, face_ls in grid_data_dict.items():
-		vi = v.index
-		if len(face_ls) == 4:
-			new_faces.append( faceCombine4(vi, face_ls) )
-			#pass
-		if len(face_ls) == 3: # 3 triangles
-			face = list(faces_set_verts(face_ls))
-			face.remove(vi)
-			new_faces.append( face )
-			
-	
-	# Now remove verts surounded by 3 triangles
-	
-
-		
-	# print new_edges
-	# me.faces.extend(new_faces, ignoreDups=True)
-	
-	'''
-	faces_remove = []
-	for vi, face_ls in grid_data_dict.items():
-		faces_remove.extend(face_ls)
-	'''
-	
-	orig_facelen = len(bm.faces)
-	
-	orig_faces = list(bm.faces)
-	made_faces = []
-	bpy.ops.mesh.select_all(action="DESELECT")
-	for vertidxs in new_faces:
-		verts = []
-		for idx in vertidxs:
-			verts.append(bm.verts[idx])
-		verts.append(verts[0])
-		for idx in range(len(verts) - 1):
-			verts.append(verts[0])
-			v1 = verts[idx]
-			v2 = verts[idx + 1]
-			if bm.edges.get((v1, v2)) == None:
-				for f in v1.link_faces:
-					if f in v2.link_faces:
-						bmesh.utils.face_split(f, v1, v2)
-						break
-
-	for vert in grid_data_dict.keys():
-		bmesh.utils.face_join(vert.link_faces[:])
-	
-	# me.faces.delete(1, faces_remove)
-	
-	bm.normal_update()
-
-def do_polyredux(self):
-	
-	global bm, me
-	
-	# Gets the current scene, there can be many scenes in 1 blend file.
-	sce = bpy.context.scene
-	
-	# Get the active object, there can only ever be 1
-	# and the active object is always the editmode object.
-	mode = "EDIT"
-	if bpy.context.mode == "OBJECT":
-		mode = "OBJECT"
-		bpy.ops.object.editmode_toggle()
-	ob_act = bpy.context.active_object
-	if not ob_act or ob_act.type != 'MESH':
-		return 
-	me = ob_act.data
-	bm = bmesh.from_edit_mesh(me)
-	
-	t = time.time()
-	
-	# Run the mesh editing function
-	my_mesh_util()
-	me.update(calc_edges=True, calc_tessface=True)
-	bm.free()
-	
-	# Restore editmode if it was enabled
-	if mode == "OBJECT":
-		bpy.ops.object.editmode_toggle()
-	else:
-		bpy.ops.object.editmode_toggle()
-		bpy.ops.object.editmode_toggle()
-	
-	# Timing the script is a good way to be aware on any speed hits when scripting
-	print ('My Script finished in %.2f seconds' % (time.time()-t))
-	
-	
-
diff --git a/release/scripts/addons_contrib/mesh_extra_tools/mesh_vertex_chamfer.py b/release/scripts/addons_contrib/mesh_extra_tools/mesh_vertex_chamfer.py
deleted file mode 100644
index 96a695a..0000000
--- a/release/scripts/addons_contrib/mesh_extra_tools/mesh_vertex_chamfer.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Vertex Chamfer",
-    "author": "Andrew Hale (TrumanBlending)",
-    "version": (0, 1),
-    "blender": (2, 63, 0),
-    "location": "Spacebar Menu",
-    "description": "Chamfer vertex",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-
-import bpy
-import bmesh
-
-
-class VertexChamfer(bpy.types.Operator):
-    bl_idname = "mesh.vertex_chamfer"
-    bl_label = "Chamfer Vertex"
-    bl_description = "Tri chamfer selected vertices"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    factor = bpy.props.FloatProperty(name="Factor",
-                                     default=0.1,
-                                     min=0.0,
-                                     soft_max=1.0)
-    relative = bpy.props.BoolProperty(name="Relative", default=True)
-    dissolve = bpy.props.BoolProperty(name="Remove", default=True)
-    displace = bpy.props.FloatProperty(name="Displace",
-                                       soft_min=-5.0,
-                                       soft_max=5.0)
-
-    @classmethod
-    def poll(self, context):
-        return (context.active_object.type == 'MESH' and
-                context.mode == 'EDIT_MESH')
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, "factor", text="Fac" if self.relative else "Dist")
-        sub = layout.row()
-        sub.prop(self, "relative")
-        sub.prop(self, "dissolve")
-        if not self.dissolve:
-            layout.prop(self, "displace")
-
-    def execute(self, context):
-        ob = context.active_object
-        me = ob.data
-        bm = bmesh.from_edit_mesh(me)
-
-        bm.select_flush(True)
-
-        fac = self.factor
-        rel = self.relative
-        dissolve = self.dissolve
-        displace = self.displace
-
-        for v in bm.verts:
-            v.tag = False
-
-        # Loop over edges to find those with both verts selected
-        for e in bm.edges[:]:
-            e.tag = e.select
-            if not e.select:
-                continue
-            elen = e.calc_length()
-            val = fac if rel else fac / elen
-            val = min(val, 0.5)
-            # Loop over the verts of the edge to split
-            for v in e.verts:
-                #if val == 0.5 and e.other_vert(v).tag:
-                #    continue
-                en, vn = bmesh.utils.edge_split(e, v, val)
-                en.tag = vn.tag = True
-                val = 1.0 if val == 1.0 else val / (1.0 - val)
-
-        # Get all verts which are selected but not created previously
-        verts = [v for v in bm.verts if v.select and not v.tag]
-
-        # Loop over all verts to split their linked edges
-        for v in verts:
-            for e in v.link_edges[:]:
-                if e.tag:
-                    continue
-                elen = e.calc_length()
-                val = fac if rel else fac / elen
-                bmesh.utils.edge_split(e, v, val)
-
-            # Loop over all the loops of the vert
-            for l in v.link_loops:
-                # Split the face
-                bmesh.utils.face_split(l.face,
-                                       l.link_loop_next.vert,
-                                       l.link_loop_prev.vert)
-
-            # Remove the vert or displace otherwise
-            if dissolve:
-                bmesh.utils.vert_dissolve(v)
-            else:
-                v.co += displace * v.normal
-
-        me.calc_tessface()
-
-        return {'FINISHED'}
-
-class chamfer_help(bpy.types.Operator):
-	bl_idname = 'help.vertexchamfer'
-	bl_label = ''
-
-	def draw(self, context):
-		layout = self.layout
-		layout.label('To use:')
-		layout.label('Make a selection or selection of verts ')
-		layout.label('Result is triangle chamfer, works on single vert.')
-		layout.label('To Help:')
-		layout.label('In some cases may need to press F to fill result.')
-	
-	def execute(self, context):
-		return {'FINISHED'}
-
-	def invoke(self, context, event):
-		return context.window_manager.invoke_popup(self, width = 300)
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_extrude_along_curve.py b/release/scripts/addons_contrib/mesh_extrude_along_curve.py
deleted file mode 100644
index dc548f3..0000000
--- a/release/scripts/addons_contrib/mesh_extrude_along_curve.py
+++ /dev/null
@@ -1,212 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-
-bl_info = {
-    "name": "Extrude Along Curve",
-    "author": "Andrew Hale (TrumanBlending)",
-    "version": (0, 1),
-    "blender": (2, 63, 0),
-    "location": "",
-    "description": "Extrude a face along a Bezier Curve",
-    "warning": "",
-    'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts",
-    'tracker_url': 'https://projects.blender.org/tracker/index.php?'\
-                   'func=detail&aid=32585',
-    "category": "Mesh"}
-
-
-import bpy
-import bmesh
-from mathutils import Vector, Quaternion
-from math import ceil, floor, pi
-
-
-def eval_bez_tan(mat, points, t):
-    num = len(points)
-    t *= num - 1
-    upper = ceil(t)
-    lower = floor(t)
-    if upper == lower:
-        if upper == 0:
-            return (mat * (points[upper].handle_right - points[upper].co)).normalized()
-        elif upper == num - 1:
-            return (mat * (points[upper].co - points[upper].handle_left)).normalized()
-        else:
-            return (mat * (points[upper].co - points[upper].handle_left)).normalized()
-    else:
-        t -= lower
-        pupper = points[upper]
-        plower = points[lower]
-        tangent = -3 * (1 - t) ** 2 * plower.co + (-6 * (1 - t) * t + 3 * (1 - t) ** 2) * plower.handle_right + (-3 * t ** 2 + 3 * (1 - t) * 2 * t) * pupper.handle_left + 3 * t ** 2 * pupper.co
-        tangent = mat * tangent
-        tangent.normalize()
-        return tangent
-
-
-def eval_bez(mat, points, t):
-    num = len(points)
-    t *= num - 1
-    upper = ceil(t)
-    lower = floor(t)
-    if upper == lower:
-        return mat * points[upper].co
-    else:
-        t -= lower
-        pupper = points[upper]
-        plower = points[lower]
-        pos = (1 - t) ** 3 * plower.co + 3 * (1 - t) ** 2 * t * plower.handle_right + 3 * (1 - t) * t ** 2 * pupper.handle_left + t ** 3 * pupper.co
-        return mat * pos
-
-
-def curve_ob_enum(self, context):
-    obs = context.scene.objects
-    cuobs = [(str(i), ob.name, ob.name) for i, ob in enumerate(obs) if ob.type == 'CURVE']
-    curve_ob_enum.temp = cuobs
-    return cuobs
-
-
-class ExtrudeAlongCurve(bpy.types.Operator):
-    bl_idname = "mesh.extrude_along_curve"
-    bl_label = "Extrude Along Curve"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    resolution = bpy.props.IntProperty(name="Resolution", default=1, min=1, soft_max=100)
-    scale = bpy.props.FloatProperty(name="Scale", default=1.0, soft_min=0.0, soft_max=5.0)
-    rotation = bpy.props.FloatProperty(name="Rotation", default=0.0, soft_min=-2 * pi, soft_max=2 * pi, subtype='ANGLE')
-    splineidx = bpy.props.IntProperty(name="Spline Index", default=0, min=0)
-    snapto = bpy.props.BoolProperty(name="Snap To Face", default=True)
-    curveob = bpy.props.EnumProperty(name="Curve", items=curve_ob_enum)
-
-    @classmethod
-    def poll(self, context):
-        ob = context.active_object
-        for cuob in context.scene.objects:
-            if cuob.type == 'CURVE':
-                break
-        else:
-            return False
-
-        return (ob is not None) and (ob.type == 'MESH') and (context.mode == 'EDIT_MESH')
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, "curveob", text="", icon='CURVE_DATA')
-        layout.prop(self, "resolution")
-        layout.prop(self, "scale")
-        layout.prop(self, "rotation")
-        layout.prop(self, "splineidx")
-        layout.prop(self, "snapto")
-
-    def execute(self, context):
-        ob = bpy.context.active_object
-        me = ob.data
-        bm = bmesh.from_edit_mesh(me)
-
-        # Get the selected curve object and the required spline
-        cuob = context.scene.objects[int(self.curveob)]
-        cu = cuob.data
-
-        self.splineidx = min(self.splineidx, len(cu.splines) - 1)
-        p = cu.splines[self.splineidx].bezier_points
-
-        # Get the property values
-        res = self.resolution
-        scale = self.scale
-        rotation = self.rotation
-        dscale = (1 - scale) / res
-        drot = rotation / res
-
-        # Get the matrices to convert between spaces
-        cmat = ob.matrix_world.inverted() * cuob.matrix_world
-        ctanmat = cmat.to_3x3().inverted().transposed()
-
-        # The list of parameter values to evaluate the bezier curve at
-        tvals = [t / res for t in range(res + 1)]
-
-        # Get the first selected face, if none, cancel
-        for f in bm.faces:
-            if f.select:
-                break
-        else:
-            return {'CANCELLED'}
-
-        # Get the position vecs on the curve and tangent values
-        bezval = [eval_bez(cmat, p, t) for t in tvals]
-        beztan = [eval_bez_tan(ctanmat, p, t) for t in tvals]
-        bezquat = [0] * len(tvals)
-
-        # Using curve only
-        bezquat[0] = beztan[0].to_track_quat('Z', 'Y')
-        fquat = bezquat[0].inverted()
-
-        # Calculate the min twist orientations
-        for i in range(1, res + 1):
-            ang = beztan[i - 1].angle(beztan[i], 0.0)
-            if ang > 0.0:
-                axis = beztan[i - 1].cross(beztan[i])
-                q = Quaternion(axis, ang)
-                bezquat[i] = q * bezquat[i - 1]
-            else:
-                bezquat[i] = bezquat[i - 1].copy()
-
-        # Get the faces to be modified
-        fprev = f
-        # no = f.normal.copy()
-        faces = [f.copy() for i in range(res)]
-
-        # Offset if we need to snap to the face
-        offset = Vector() if not self.snapto else (f.calc_center_median() - bezval[0])
-
-        # For each of the faces created, set their vert positions and create side faces
-        for i, data in enumerate(zip(faces, bezval[1:], bezquat[1:])):
-
-            fn, pos, quat = data
-            cen = fn.calc_center_median()
-
-            rotquat = Quaternion((0, 0, 1), i * drot)
-
-            for v in fn.verts:
-                v.co = quat * rotquat * fquat * (v.co - cen) * (1 - (i + 1) * dscale) + pos + offset
-
-            for ll, ul in zip(fprev.loops, fn.loops):
-                ff = bm.faces.new((ll.vert, ll.link_loop_next.vert, ul.link_loop_next.vert, ul.vert))
-                ff.normal_update()
-
-            bm.faces.remove(fprev)
-            fprev = fn
-
-        me.calc_tessface()
-        me.calc_normals()
-        me.update()
-
-        return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_face_info_select.py b/release/scripts/addons_contrib/mesh_face_info_select.py
deleted file mode 100644
index ecf79d0..0000000
--- a/release/scripts/addons_contrib/mesh_face_info_select.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Face info / select by type",
-    "author": "CoDEmanX",
-    "version": (0, 0, 3),
-    "blender": (2, 62, 0),
-    "location": "Properties > Object data > Face info / select",
-    "description": "Displays triangle, quad and ngon count of the active object. Allows to select faces by these types.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Mesh/Face_Info_Select",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=31926",
-    "support": 'TESTING',
-    "category": "Mesh"
-}
-
-# Written by CoDEmanX for frivus
-
-
-import bpy
-from bpy.props import EnumProperty
-
-class DATA_OP_facetype_select(bpy.types.Operator):
-    """Select all faces of a certain type"""
-    bl_idname = "data.facetype_select"
-    bl_label = "Select by face type"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    face_type = EnumProperty(name="Select faces:",
-                             items = (("3","Triangles","Faces made up of 3 vertices"),
-                                      ("4","Quads","Faces made up of 4 vertices"),
-                                      ("5","Ngons","Faces made up of 5 and more vertices")),
-                             default = "5")
-    @classmethod
-    def poll(cls, context):
-        return context.active_object is not None and context.active_object.type == 'MESH'
-
-    def execute(self, context):
-
-        bpy.ops.object.mode_set(mode='EDIT')
-        bpy.ops.mesh.select_all(action='DESELECT')
-        context.tool_settings.mesh_select_mode=(False, False, True)
-
-        if self.face_type == "3":
-            bpy.ops.mesh.select_face_by_sides(number=3, type='EQUAL')
-        elif self.face_type == "4":
-            bpy.ops.mesh.select_face_by_sides(number=4, type='EQUAL')
-        else:
-            bpy.ops.mesh.select_face_by_sides(number=4, type='GREATER')
-
-        return {'FINISHED'}
-        
-
-class DATA_PT_info_panel(bpy.types.Panel):
-    """Creates a face info / select panel in the Object properties window"""
-    bl_label = "Face info / select"
-    bl_idname = "DATA_PT_face_info"
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "data"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(self, context):
-        return context.active_object is not None and context.active_object.type == 'MESH'
-
-    def draw(self, context):
-        layout = self.layout
-
-        ob = context.active_object
-        
-        info_str = ""
-        tris = quads = ngons = 0
-
-        for p in ob.data.polygons:
-            count = p.loop_total
-            if count == 3:
-                tris += 1
-            elif count == 4:
-                quads += 1
-            else:
-                ngons += 1
-
-        info_str = "  Ngons: %i  Quads: %i  Tris: %i" % (ngons, quads, tris)
-        
-        col = layout.column()
-        col.label(info_str, icon='MESH_DATA')
-
-        col = layout.column()
-        col.label("Select faces by type:")
-
-        row = layout.row()
-        row.operator("data.facetype_select", text="Ngons").face_type = "5"
-        row.operator("data.facetype_select", text="Quads").face_type = "4"
-        row.operator("data.facetype_select", text="Tris").face_type = "3"
-
-
-def register():
-    bpy.utils.register_class(DATA_PT_info_panel)
-    bpy.utils.register_class(DATA_OP_facetype_select)
-
-
-def unregister():
-    bpy.utils.unregister_class(DATA_PT_info_panel)
-    bpy.utils.unregister_class(DATA_OP_facetype_select)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_insert_edge_ring.py b/release/scripts/addons_contrib/mesh_insert_edge_ring.py
deleted file mode 100644
index 5d8440e..0000000
--- a/release/scripts/addons_contrib/mesh_insert_edge_ring.py
+++ /dev/null
@@ -1,374 +0,0 @@
-#Simplified BSD License
-#
-#Copyright (c) 2012, Florian Meyer
-#tstscr at web.de
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions are met: 
-#
-#1. Redistributions of source code must retain the above copyright notice, this
-#   list of conditions and the following disclaimer. 
-#2. Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution. 
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-#ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#################################################################
-bl_info = {
-    "name": "Insert Edge Ring",
-    "author": "tstscr (tstscr at web.de)",
-    "version": (1, 0),
-    "blender": (2, 64, 0),
-    "location": "View3D > Edge Specials > Insert edge ring (Ctrl Alt R)",
-    "description": "Insert an edge ring along the selected edge loop",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Mesh/Insert_Edge_Ring",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=32424",
-    "category": "Mesh"}
-###########################################################################
-import bpy, bmesh, math
-from bpy.types import Operator
-from bpy.props import FloatProperty, BoolProperty, EnumProperty
-from mathutils import Vector
-from collections import deque
-from bmesh.utils import vert_separate
-###########################################################################
-def update(bme):
-    bme.verts.index_update()
-    bme.edges.index_update()
-
-def selected_edges(component, invert=False):
-    def is_vert(vert):
-        if invert:
-            return [e for e in component.link_edges if not e.select]
-        return [e for e in component.link_edges if e.select]
-    if type(component) == bmesh.types.BMVert:
-        return is_vert(component)
-    if type(component) == bmesh.types.BMEdge:
-        edges = []
-        for vert in component.verts:
-            edges.extend(is_vert(vert))
-        if component in edges:
-            edges.remove(component)
-        return edges
-
-def edge_loop_from(v_start):
-    
-    def walk(vert, vert_loop=deque()):
-        #print('from', vert.index)
-        edges_select = selected_edges(vert)
-        #print('length edges_select', len(edges_select))
-        if not vert_loop:
-            #print('inserting %d into vert_loop' %vert.index)
-            vert_loop.append(vert)
-        
-        for edge in edges_select:
-            other_vert = edge.other_vert(vert)
-            #print('other_vert %d' %other_vert.index)
-            
-            edge_is_valid = True
-            if edge.is_boundary \
-            or other_vert in vert_loop \
-            or len(edges_select) > 2 \
-            or len(selected_edges(other_vert)) > 2:
-                #print('is not valid')
-                edge_is_valid = False
-            
-            if edge_is_valid:
-                if vert == vert_loop[-1]:
-                    #print('appending %d' %other_vert.index)
-                    vert_loop.append(other_vert)
-                else:
-                    #print('prepending %d' %other_vert.index)
-                    vert_loop.appendleft(other_vert)
-                    
-                walk(other_vert, vert_loop)
-        
-        return vert_loop
-    #####################################
-    v_loop = walk(v_start)
-    #print('returning', [v.index for v in v_loop])
-    return v_loop
-
-
-def collect_edge_loops(bme):
-    edge_loops = []
-    verts_to_consider = [v for v in bme.verts if v.select]
-    
-    while verts_to_consider:
-        
-        v_start = verts_to_consider[-1]
-        #print('\nverts_to_consider', [v.index for v in verts_to_consider])
-        edge_loop = edge_loop_from(v_start)
-        #update(bme)
-        #print('edge_loop', [v.index for v in edge_loop])
-        for v in edge_loop:
-            try:
-                verts_to_consider.remove(v)
-            except:
-                print('tried to remove vert %d from verts_to_consider. \
-                       Failed somehow' %v.index)
-        
-        if len(edge_loop) >= 3:
-            edge_loops.append(edge_loop)
-        else:
-            for v in edge_loop:
-                v.select = False
-    
-    if not verts_to_consider:
-        #print('no more verts_to_consider')
-        pass
-    
-    return edge_loops
-
-
-def insert_edge_ring(self, context):
-    def split_edge_loop(vert_loop):
-        other_loop = deque()
-        new_loop = deque()
-        for vert in vert_loop:
-            #print('OPERATING ON VERT', vert.index)
-            edges = selected_edges(vert)
-            v_new = bmesh.utils.vert_separate(vert, edges)
-            #print('RIPPING vert %d into' %vert.index, [v.index for v in v_new][:], \
-            #       'along edges', [e.index for e in edges])
-            if not closed:
-                if len(v_new) == 2:
-                    other_loop.append([v for v in v_new if v != vert][0])
-                else:
-                    other_loop.append(vert)
-            
-            if closed:
-                if not new_loop:
-                    #print('start_new_loop')
-                    new_loop.append(v_new[0])
-                    other_loop.append(v_new[1])
-                else:
-                    neighbours = [e.other_vert(v_new[0]) for e in v_new[0].link_edges]
-                    #print('neighbours', [n.index for n in neighbours])
-                    for n in neighbours:
-                        if n in new_loop and v_new[0] not in new_loop:
-                            #print('v_detect')
-                            new_loop.append(v_new[0])
-                            other_loop.append(v_new[1])
-                        if n in other_loop and v_new[0] not in other_loop:
-                            #print('v_not_detect')
-                            new_loop.append(v_new[1])
-                            other_loop.append(v_new[0])
-                
-        return other_loop, new_loop
-    
-    def move_verts(vert_loop, other_vert_loop):
-        
-        ### Offsets ###
-        def calc_offsets():
-            #print('\nCALCULATING OFFSETS')
-            offset = {}
-            for i, vert in enumerate(vert_loop):
-                edges_select = selected_edges(vert)
-                edges_unselect = selected_edges(vert, invert=True)
-                
-                vert_opposite = other_vert_loop[i]
-                edges_select_opposite = selected_edges(vert_opposite)
-                edges_unselect_opposite = selected_edges(vert_opposite, invert=True)
-                
-                ### MESH END VERT
-                if vert == other_vert_loop[0] or vert == other_vert_loop[-1]:
-                    #print('vert %d is start-end in middle of mesh, \
-                    #       does not need moving\n' %vert.index)
-                    continue
-                
-                ### BOUNDARY VERT
-                if len(edges_select) == 1:
-                    #print('verts %d  %d are on boundary' \
-                    #%(vert.index, other_vert_loop[i].index))
-                    border_edge = [e for e in edges_unselect if e.is_boundary][0]
-                    off = (border_edge.other_vert(vert).co - vert.co).normalized()
-                    if self.direction == 'LEFT':
-                        off *= 0
-                    offset[vert] = off
-                    #opposite vert
-                    border_edge_opposite = [e for e in edges_unselect_opposite \
-                                            if e.is_boundary][0]
-                    off = (border_edge_opposite.other_vert(vert_opposite).co \
-                           - vert_opposite.co).normalized()
-                    if self.direction == 'RIGHT':
-                        off *= 0
-                    offset[vert_opposite] = off
-                    continue
-                
-                ### MIDDLE VERT
-                if len(edges_select) == 2:
-                    #print('\nverts %d  %d are in middle of loop' \
-                    #%(vert.index, other_vert_loop[i].index))
-                    tangents = [e.calc_tangent(e.link_loops[0]) for e in edges_select]
-                    off = (tangents[0] + tangents[1]).normalized()
-                    angle = tangents[0].angle(tangents[1])
-                    if self.even:
-                        off += off * angle * 0.263910
-                    if self.direction == 'LEFT':
-                        off *= 0
-                    offset[vert] = off
-                    #opposite vert
-                    tangents = [e.calc_tangent(e.link_loops[0]) \
-                                for e in edges_select_opposite]
-                    off = (tangents[0] + tangents[1]).normalized()
-                    #angle= tangents[0].angle(tangents[1])
-                    if self.even:
-                        off += off * angle * 0.263910
-                    if self.direction == 'RIGHT':
-                        off *= 0
-                    offset[vert_opposite] = off
-                    continue
-            
-            return offset
-        
-        ### Moving ###
-        def move(offsets):
-            #print('\nMOVING VERTS')
-            for vert in offsets:
-                vert.co += offsets[vert] * self.distance
-        
-        offsets = calc_offsets()
-        move(offsets)
-    
-    def generate_new_geo(vert_loop, other_vert_loop):
-        #print('\nGENERATING NEW GEOMETRY')
-        
-        for i, vert in enumerate(vert_loop):
-            if vert == other_vert_loop[i]:
-                continue
-            edge_new = bme.edges.new([vert, other_vert_loop[i]])
-            edge_new.select = True
-        
-        bpy.ops.mesh.edge_face_add()
-
-    #####################################################################################
-    #####################################################################################
-    #####################################################################################
-    
-    bme = bmesh.from_edit_mesh(context.object.data)
-
-    ### COLLECT EDGE LOOPS ###
-    e_loops = collect_edge_loops(bme)
-    
-    for e_loop in e_loops:
-        
-        #check for closed loop - douple vert at start-end
-        closed = False
-        edges_select = selected_edges(e_loop[0])
-        for e in edges_select:
-            if e_loop[-1] in e.verts:
-                closed = True
-        
-        ### SPLITTING OF EDGES
-        other_vert_loop, new_loop = split_edge_loop(e_loop)
-        if closed:
-            e_loop = new_loop
-    
-        ### MOVE RIPPED VERTS ###
-        move_verts(e_loop, other_vert_loop)
-        
-        ### GENERATE NEW GEOMETRY ###
-        if self.generate_geo:
-            generate_new_geo(e_loop, other_vert_loop)
-    
-    update(bme)
-    
-###########################################################################
-# OPERATOR
-class MESH_OT_Insert_Edge_Ring(Operator):
-    """insert_edge_ring"""
-    bl_idname = "mesh.insert_edge_ring"
-    bl_label = "Insert edge ring"
-    bl_description = "Insert an edge ring along the selected edge loop"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    distance = FloatProperty(
-            name="distance",
-            default=0.01,
-            min=0, soft_min=0,
-            precision=4,
-            description="distance to move verts from original location")
-    
-    even = BoolProperty(
-            name='even',
-            default=True,
-            description='keep 90 degrees angles straight')
-    
-    generate_geo = BoolProperty(
-            name='Generate Geo',
-            default=True,
-            description='Fill edgering with faces')
-    
-    direction = EnumProperty(
-            name='direction',
-            description='Direction in which to expand the edge_ring',
-            items={
-            ('LEFT', '<|', 'only move verts left of loop (arbitrary)'),
-            ('CENTER', '<|>', 'move verts on both sides of loop'),
-            ('RIGHT', '|>', 'only move verts right of loop (arbitrary)'),
-            },
-            default='CENTER')
-    
-    def draw(self, context):
-        layout = self.layout
-        col = layout.column(align=True)
-        
-        col.prop(self, 'distance', slider=False)
-        col.prop(self, 'even', toggle=True)
-        col.prop(self, 'generate_geo', toggle=True)
-        col.separator()
-        col.label(text='Direction')
-        row = layout.row(align=True)
-        row.prop(self, 'direction', expand=True)
-        
-    @classmethod
-    def poll(cls, context):
-        return context.mode == 'EDIT_MESH'
-
-    def execute(self, context):
-        #print('\nInserting edge ring')
-        insert_edge_ring(self, context)
-        return {'FINISHED'}
-
-def insert_edge_ring_button(self, context):
-    self.layout.operator(MESH_OT_Insert_Edge_Ring.bl_idname,
-                         text="Insert edge ring")
-###########################################################################
-# REGISTRATION
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.VIEW3D_MT_edit_mesh_edges.append(insert_edge_ring_button)
-
-    kc = bpy.context.window_manager.keyconfigs.addon
-    if kc:
-        km = kc.keymaps.new(name="3D View", space_type="VIEW_3D")
-        kmi = km.keymap_items.new('mesh.insert_edge_ring', \
-                                  'R', 'PRESS', ctrl=True, alt=True)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.VIEW3D_MT_edit_mesh_edges.remove(insert_edge_ring_button)
-
-    kc = bpy.context.window_manager.keyconfigs.addon
-    if kc:
-        km = kc.keymaps["3D View"]
-        for kmi in km.keymap_items:
-            if kmi.idname == 'mesh.insert_edge_ring':
-                km.keymap_items.remove(kmi)
-                break
-
-if __name__ == "__main__":
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/mesh_select_tools/__init__.py b/release/scripts/addons_contrib/mesh_select_tools/__init__.py
deleted file mode 100644
index 3db805a..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/__init__.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-#
-# ##### END GPL LICENSE BLOCK #####
-# menu & updates by meta-androcto #
-# contributed to by Macouno, dustractor, liero, CoDEmanX, meta-androcto #
-
-bl_info = {
-    "name": "Select Tools",
-    "author": "Multiple Authors",
-    "version": (0, 3),
-    "blender": (2, 64, 0),
-    "location": "Editmode select menu",
-    "description": "Adds More vert/face/edge select modes.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
-        "Scripts/",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=32877",
-    "category": "Mesh"}
-
-
-if "bpy" in locals():
-    import imp
-    imp.reload(mesh_select_by_direction)
-    imp.reload(mesh_select_by_edge_length)
-    imp.reload(mesh_select_by_pi)
-    imp.reload(mesh_select_by_type)
-    imp.reload(mesh_select_connected_faces)
-    imp.reload(mesh_select_innermost)
-    imp.reload(mesh_index_select)
-    imp.reload(mesh_selection_topokit)
-    imp.reload(mesh_info_select)
-else:
-    from . import mesh_select_by_direction
-    from . import mesh_select_by_edge_length
-    from . import mesh_select_by_pi
-    from . import mesh_select_by_type
-    from . import mesh_select_connected_faces
-    from . import mesh_select_innermost
-    from . import mesh_index_select
-    from . import mesh_selection_topokit
-    from . import mesh_info_select
-
-import bpy, bmesh
-
-class VIEW3D_MT_selectface_edit_mesh_add(bpy.types.Menu):
-    # Define the "Mesh_Select_Tools" menu
-    bl_idname = "mesh.face_select_tools"
-    bl_label = "Select by Face"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.label(text = 'Face Select')
-        layout.separator()
-        layout.operator("data.facetype_select", 
-            text="Triangles").face_type = "3"
-        layout.operator("data.facetype_select", 
-            text="Quads").face_type = "4"
-        layout.operator("data.facetype_select", 
-            text="Ngons").face_type = "5"
-        layout.separator()
-        layout.operator("mesh.select_vert_index",
-            text="By Face Index")
-        layout.operator("mesh.select_by_direction",
-            text="By Direction")
-        layout.operator("mesh.select_by_pi",
-            text="By Pi")
-        layout.operator("mesh.select_connected_faces",
-            text="By Connected Faces")
-        layout.operator("mesh.e2e_efe",
-            text="Neighbors by Face")
-        layout.operator("mesh.f2f_fvnef",
-            text="Neighbors by Vert not Edge")
-        layout.operator("mesh.conway",
-            text="Conway")
-
-class VIEW3D_MT_selectedge_edit_mesh_add(bpy.types.Menu):
-    # Define the "Mesh_Select_Tools" menu
-    bl_idname = "mesh.edge_select_tools"
-    bl_label = "Select by Edge"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.label(text = 'Edge Select')
-        layout.separator()
-        layout.operator("mesh.select_vert_index",
-            text="By Edge Index")
-        layout.operator("mesh.select_by_direction",
-            text="By Direction")
-        layout.operator("mesh.select_by_pi",
-            text="By Pi")
-        layout.operator("mesh.select_by_edge_length",
-            text="By Edge Length")
-        layout.separator()
-        layout.operator("mesh.e2e_eve",
-            text="Neighbors by Vert")
-        layout.operator("mesh.e2e_evfe",
-            text="Neighbors by Vert + Face")
-        layout.operator("mesh.e2e_efnve",
-            text="Lateral Neighbors")
-        layout.operator("mesh.e2e_evnfe",
-            text="Longitudinal Edges")
-#        layout.operator("mesh.je",
-#            text="only_edge_selection")
-			
-class VIEW3D_MT_selectvert_edit_mesh_add(bpy.types.Menu):
-    # Define the "Mesh_Select_Tools" menu
-    bl_idname = "mesh.vert_select_tools"
-    bl_label = "Select by Vert"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.label(text = 'Vert Select')
-        layout.separator()
-        layout.operator("mesh.select_vert_index",
-            text="By Vert Index")
-        layout.operator("mesh.select_by_direction",
-            text="By Direction")
-        layout.operator("mesh.select_by_pi",
-            text="By Pi")
-#        layout.operator("mesh.select_innermost",
-#            text="innermost")
-        layout.separator()
-        layout.operator("mesh.v2v_by_edge",
-            text="Neighbors by Edge")
-        layout.operator("mesh.e2e_eve",
-            text="Neighbors by Vert")
-        layout.operator("mesh.e2e_efe",
-            text="Neighbors by Face")
-        layout.operator("mesh.v2v_facewise",
-            text="Neighbors by Face - Edge")
-#        layout.operator("mesh.ie",
-#            text="inner_edge_selection")
-
-# Register all operators and panels
-
-# Define "Extras" menu
-def menu_func(self, context):
-    if context.tool_settings.mesh_select_mode[2]:
-        self.layout.menu("mesh.face_select_tools", icon="PLUGIN")
-    if context.tool_settings.mesh_select_mode[1]:
-        self.layout.menu("mesh.edge_select_tools", icon="PLUGIN")
-    if context.tool_settings.mesh_select_mode[0]:
-        self.layout.menu("mesh.vert_select_tools", icon="PLUGIN")
-
-
-def register():
-	bpy.utils.register_module(__name__)
-	bpy.types.VIEW3D_MT_select_edit_mesh.append(menu_func)
-
-def unregister():
-	bpy.utils.unregister_module(__name__)
-	bpy.types.VIEW3D_MT_select_edit_mesh.remove(menu_func)
-
-if __name__ == "__main__":
-	register()
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_extras.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_extras.py
deleted file mode 100644
index 9b317b8..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_extras.py
+++ /dev/null
@@ -1,274 +0,0 @@
-import bpy, mathutils, math
-from mathutils import geometry
-
-# Get a matrix for the selected faces that you can use to do local transforms
-def get_selection_matrix(faces=False):
-	
-	me = bpy.context.active_object.data
-	
-	if not faces:
-		faces = get_selected_faces()
-	
-	yVec = mathutils.Vector()
-	zVec = mathutils.Vector()
-	
-	# Ok so we have a basic matrix, but lets base it more on the mesh!
-	for f in faces:
-			
-		v1 = me.vertices[f.vertices[0]].co
-		v2 = me.vertices[f.vertices[1]].co
-		edge = v2-v1
-		
-		yVec += edge
-		
-		if len(f.vertices) == 4:
-			v1 = me.vertices[f.vertices[2]].co
-			v2 = me.vertices[f.vertices[3]].co
-			edge = v1-v2
-			
-			yVec += edge
-		
-		zVec += mathutils.Vector(f.normal)
-					
-	if not yVec.length:
-		quat = zVec.to_track_quat('-Z', 'Y')
-		tMat = quat.to_matrix()
-		yVec = tMat[1]
-		yVec = yVec.normalized()
-	else:
-		yVec = yVec.normalized()
-	zVec = zVec.normalized()
-	
-	# Rotate yVec so it's 90 degrees to zVec
-	cross =yVec.cross(zVec)
-	vec = float(yVec.angle(zVec) - math.radians(90))
-	mat = mathutils.Matrix.Rotation(vec, 3, cross)
-	yVec =  (mat * yVec)
-	
-	xVec = yVec.cross(zVec)
-	
-	xVec = xVec.normalized()
-	
-	nMat = mathutils.Matrix((xVec, yVec, zVec))
-	
-	return nMat
-
-
-
-# Get the selection radius (minimum distance of an outer edge to the centre)
-def get_selection_radius():
-
-	ob = bpy.context.active_object
-
-	radius = 0.0
-	
-	# no use continueing if nothing is selected
-	if contains_selected_item(ob.data.polygons):
-	
-		# Find the center of the selection
-		cent = mathutils.Vector()
-		nr = 0
-		nonVerts = []
-		selVerts = []
-		for f in ob.data.polygons:
-			if f.select:
-				nr += 1
-				cent += f.center
-			else:
-				nonVerts.extend(f.vertices)
-				
-		cent /= nr
-		
-		chk = 0
-		
-		# Now that we know the center.. we can figure out how close the nearest point on an outer edge is
-		for e in get_selected_edges():
-		
-			nonSection = [v for v in e.vertices if v in nonVerts]
-			if len(nonSection):
-			
-				v0 = ob.data.vertices[e.vertices[0]].co
-				v1 = ob.data.vertices[e.vertices[1]].co
-				
-				# If there's more than 1 vert of this edge on the outside... we need the edge length to be long enough too!
-				if len(nonSection) > 1:
-					edge = v0 - v1
-					edgeRad = edge.length * 0.5
-					
-					if edgeRad < radius or not chk:
-						radius = edgeRad
-						chk += 1
-				
-				int = geometry.intersect_point_line(cent, v0, v1)
-				
-				rad = cent - int[0]
-				l = rad.length
-				
-				if l < radius or not chk:
-					radius = l
-					chk += 1
-					
-	return radius
-	
-	
-	
-# Get the average length of the outer edges of the current selection
-def get_shortest_outer_edge_length():
-
-	ob = bpy.context.active_object
-
-	min = False
-	me = ob.data
-	
-	delVerts = []
-	for f in me.faces:
-		if not f.select:
-			delVerts.extend(f.vertices)
-	selEdges = [e.vertices for e in me.edges if e.select]
-
-	if len(selEdges) and len(delVerts):
-		
-		for eVerts in selEdges:
-			
-			v0 = eVerts[0]
-			v1 = eVerts[1]
-			
-			if v0 in delVerts and v1 in delVerts:
-				ln = (me.vertices[v0].co - me.vertices[v1].co).length
-				if min is False or (ln > 0.0 and ln < min):
-					min = ln
-						
-	return min
-
-
-# Get the average length of the outer edges of the current selection
-def get_average_outer_edge_length():
-
-	ob = bpy.context.active_object
-
-	ave = 0.0
-	me = ob.data
-	
-	delFaces = [f.vertices for f  in me.faces if not f.select]
-	selEdges = [e.vertices for e in me.edges if e.select]
-
-	if len(selEdges) and len(delFaces):
-	
-		number = 0
-		
-		for eVerts in selEdges:
-			
-			v0 = eVerts[0]
-			v1 = eVerts[1]
-			
-			for fVerts in delFaces:
-				if v0 in fVerts and v1 in fVerts:
-					number += 1
-					ave += (me.vertices[v0].co - me.vertices[v1].co).length
-					break
-						
-		if number:
-			ave /= number
-			
-	return ave
-
-
-	
-# Get the selected (or deselected items)
-def get_selected(type='vertices',invert=False):
-	
-	mesh = bpy.context.active_object.data
-	
-	if type == 'vertices':
-		items = mesh.vertices
-	elif type == 'edges':
-		items = mesh.edges
-	else:
-		items = mesh.polygons
-		
-	if invert:
-		L = [i for i in items if not i.select]
-	else:
-		L = [i for i in items if i.select]
-	return L
-	
-	
-	
-# See if the mesh has something selected
-def has_selected(type='vertices',invert=False):
-	
-	mesh = bpy.context.active_object.data
-	
-	if type == 'vertices':
-		items = mesh.vertices
-	elif type == 'edges':
-		items = mesh.edges
-	else:
-		items = mesh.polygons
-		
-	for i in items:
-		if not invert and i.select:
-			return True
-		elif invert and not i.select:
-			return True
-			
-	return False
-		
-		
-
-# Get all the selected vertices (mode is selected or deselected)
-def get_selected_vertices(mode='selected'):
-
-	vertices = bpy.context.active_object.data.vertices
-
-	if mode == 'deselected':
-		L = [v for v in vertices if not v.select]
-	else:
-		L = [v for v in vertices if v.select]
-	return L
-	
-	
-	
-# Get all the selected edges (mode is selected or deselected)
-def get_selected_edges(mode='selected'):
-
-	edges = bpy.context.active_object.data.edges
-
-	if mode == 'deselected':
-		L = [e for e in edges if not e.select]
-	else:
-		L = [e for e in edges if e.select]
-	return L
-
-
-	
-# Get all the selected faces (mode is selected or deselected)
-def get_selected_faces(mode='selected'):
-	
-	polygons = bpy.context.active_object.data.polygons
-	
-	if mode == 'deselected':
-		L = [f for f in polygons if not f.select]
-	else:
-		L = [f for f in polygons if f.select]
-	return L
-	
-	
-	
-# See if there is at least one selected item in 'items'
-def contains_selected_item(items):
-
-	for item in items:
-		if item.select:
-			return True
-				
-	return False
-	
-
-
-
-
-
-	
-	
-		
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_index_select.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_index_select.py
deleted file mode 100644
index 4965cb7..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_index_select.py
+++ /dev/null
@@ -1,182 +0,0 @@
-bl_info = {
-    "name": "Select by index",
-    "author": "liero",
-    "version": (0, 2),
-    "blender": (2, 55, 0),
-    "api": 33333,
-    "location": "View3D > Tool Shelf",
-    "description": "Select mesh data by index / area / length / cursor",
-    "category": "Mesh"}
-
-import bpy, mathutils
-from mathutils import Vector
-
-class SelVert(bpy.types.Operator):
-    bl_idname = 'mesh.select_vert_index'
-    bl_label = 'Verts'
-    bl_description = 'Select vertices by index'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    indice = bpy.props.FloatProperty(name='Selected', default=0, min=0, max=100, description='Percentage of selected edges', precision = 2, subtype = 'PERCENTAGE')
-    delta = bpy.props.BoolProperty(name='Use Cursor', default=False, description='Select by Index / Distance to Cursor')
-    flip = bpy.props.BoolProperty(name='Reverse Order', default=False, description='Reverse selecting order')
-
-    @classmethod
-    def poll(cls, context):
-        return (context.object and context.object.type == 'MESH')
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self,'indice', slider=True)
-        layout.prop(self,'delta')
-        layout.prop(self,'flip')
-
-    def execute(self, context):
-        obj = bpy.context.object
-        mode = [a for a in bpy.context.tool_settings.mesh_select_mode]
-        if mode != [True, False, False]:
-            bpy.context.tool_settings.mesh_select_mode = [True, False, False]
-        ver = obj.data.vertices
-        loc = context.scene.cursor_location
-        sel = []
-        for v in ver:
-            d = v.co - loc
-            sel.append((d.length, v.index))
-        sel.sort()
-        if self.flip:
-            sel.reverse()
-        bpy.ops.object.mode_set()
-        valor = round(len(sel) / 100 * self.indice)
-        if self.delta:
-            for i in range(len(sel[:valor])):
-                ver[sel[i][1]].select = True
-        else:
-            for i in range(len(sel[:valor])):
-                if self.flip:
-                    ver[len(sel)-i-1].select = True
-                else:
-                    ver[i].select = True
-        bpy.ops.object.mode_set(mode='EDIT')
-        return {'FINISHED'}
-
-class SelEdge(bpy.types.Operator):
-    bl_idname = 'mesh.select_edge_index'
-    bl_label = 'Edges'
-    bl_description = 'Select edges by index'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    indice = bpy.props.FloatProperty(name='Selected', default=0, min=0, max=100, description='Percentage of selected edges', precision = 2, subtype = 'PERCENTAGE')
-    delta = bpy.props.BoolProperty(name='Use Edges Length', default=False, description='Select Edges by Index / Length')
-    flip = bpy.props.BoolProperty(name='Reverse Order', default=False, description='Reverse selecting order')
-
-    @classmethod
-    def poll(cls, context):
-        return (context.object and context.object.type == 'MESH')
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self,'indice', slider=True)
-        layout.prop(self,'delta')
-        layout.prop(self,'flip')
-
-    def execute(self, context):
-        obj = bpy.context.object
-        mode = [a for a in bpy.context.tool_settings.mesh_select_mode]
-        if mode != [False, True, False]:
-            bpy.context.tool_settings.mesh_select_mode = [False, True, False]
-        ver = obj.data.vertices
-        edg = obj.data.edges
-        sel = []
-        for e in edg:
-            d = ver[e.vertices[0]].co - ver[e.vertices[1]].co
-            sel.append((d.length, e.index))
-        sel.sort()
-        if self.flip:
-            sel.reverse()
-        bpy.ops.object.mode_set()
-        valor = round(len(sel) / 100 * self.indice)
-        if self.delta:
-            for i in range(len(sel[:valor])):
-                edg[sel[i][1]].select = True
-        else:
-            for i in range(len(sel[:valor])):
-                if self.flip:
-                    edg[len(sel)-i-1].select = True
-                else:
-                    edg[i].select = True
-        bpy.ops.object.mode_set(mode='EDIT')
-        return {'FINISHED'}
-
-class SelFace(bpy.types.Operator):
-    bl_idname = 'mesh.select_face_index'
-    bl_label = 'Faces'
-    bl_description = 'Select faces by index'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    indice = bpy.props.FloatProperty(name='Selected', default=0, min=0, max=100, description='Percentage of selected faces', precision = 2, subtype = 'PERCENTAGE')
-    delta = bpy.props.BoolProperty(name='Use Faces Area', default=False, description='Select Faces by Index / Area')
-    flip = bpy.props.BoolProperty(name='Reverse Order', default=False, description='Reverse selecting order')
-
-    @classmethod
-    def poll(cls, context):
-        return (context.object and context.object.type == 'MESH')
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self,'indice', slider=True)
-        layout.prop(self,'delta')
-        layout.prop(self,'flip')
-
-    def execute(self, context):
-        obj = bpy.context.object
-        mode = [a for a in bpy.context.tool_settings.mesh_select_mode]
-        if mode != [False, False, True]:
-            bpy.context.tool_settings.mesh_select_mode = [False, False, True]
-        fac = obj.data.polygons
-        sel = []
-        for f in fac:
-            sel.append((f.area, f.index))
-        sel.sort()
-        if self.flip:
-            sel.reverse()
-        print (sel)
-        bpy.ops.object.mode_set()
-        valor = round(len(sel) / 100 * self.indice)
-        if self.delta:
-            for i in range(len(sel[:valor])):
-                fac[sel[i][1]].select = True
-        else:
-            for i in range(len(sel[:valor])):
-                if self.flip:
-                    fac[len(sel)-i-1].select = True
-                else:
-                    fac[i].select = True
-        bpy.ops.object.mode_set(mode='EDIT')
-        return {'FINISHED'}
-
-class GUI(bpy.types.Panel):
-    bl_label = 'Select mesh data'
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row(align=True)
-        row.operator('mesh.select_vert_index')
-        row.operator('mesh.select_edge_index')
-        row.operator('mesh.select_face_index')
-
-def register():
-    bpy.utils.register_class(SelVert)
-    bpy.utils.register_class(SelEdge)
-    bpy.utils.register_class(SelFace)
-    bpy.utils.register_class(GUI)
-
-def unregister():
-    bpy.utils.unregister_class(SelVert)
-    bpy.utils.unregister_class(SelEdge)
-    bpy.utils.unregister_class(SelFace)
-    bpy.utils.unregister_class(GUI)
-
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_info_select.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_info_select.py
deleted file mode 100644
index c97381e..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_info_select.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# By CoDEmanX
-
-import bpy
-
-class DATA_PT_info_panel(bpy.types.Panel):
-    """Creates a face info / select panel in the Object properties window"""
-    bl_label = "Face info / select"
-    bl_idname = "DATA_PT_face_info"
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "data"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(self, context):
-        return context.active_object is not None and context.active_object.type == 'MESH'
-
-    def draw(self, context):
-        layout = self.layout
-
-        ob = context.active_object
-        
-        info_str = ""
-        tris = quads = ngons = 0
-
-        for p in ob.data.polygons:
-            count = p.loop_total
-            if count == 3:
-                tris += 1
-            elif count == 4:
-                quads += 1
-            else:
-                ngons += 1
-
-        info_str = "  Ngons: %i  Quads: %i  Tris: %i" % (ngons, quads, tris)
-        
-        col = layout.column()
-        col.label(info_str, icon='MESH_DATA')
-
-        col = layout.column()
-        col.label("Select faces by type:")
-
-        row = layout.row()
-        row.operator("data.facetype_select", text="Ngons").face_type = "5"
-        row.operator("data.facetype_select", text="Quads").face_type = "4"
-        row.operator("data.facetype_select", text="Tris").face_type = "3"
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_direction.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_direction.py
deleted file mode 100644
index cb2cca2..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_direction.py
+++ /dev/null
@@ -1,214 +0,0 @@
-# mesh_select_by_direction.py Copyright (C) 2011, Dolf Veenvliet
-#
-# Extrude a selection from a mesh multiple times
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-'''
-bl_info = {
-    "name": "Select by direction",
-    "author": "Dolf Veenvliet",
-    "version": 1,
-    "blender": (2, 56, 0),
-    "api": 31847,
-    "location": "View3D > Select",
-    "description": "Select all items whose normals face a certain direction",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-"""
-Usage:
-
-Launch from from "Select -> By direction"
-
-Additional links:
-	Author Site: http://www.macouno.com
-	e-mail: dolf {at} macouno {dot} com
-"""
-'''
-import bpy, mathutils, math
-from bpy.props import FloatVectorProperty, FloatProperty, BoolProperty, EnumProperty
-
-
-class Select_by_direction():
-
-	# Initialise the class
-	def __init__(self, context, direction, divergence, extend, space):
-	
-		self.ob = context.active_object
-		bpy.ops.object.mode_set(mode='OBJECT')
-		
-		self.space = space
-		
-		# if we do stuff in global space we need to object matrix
-		if self.space == 'GLO':
-			direction = mathutils.Vector(direction) * mathutils.Matrix(self.ob.matrix_world.rotation_part()).invert()
-		else:
-			direction = mathutils.Vector(direction)
-			
-		direction = direction.normalized()
-		
-		vertSelect = bpy.context.tool_settings.mesh_select_mode[0]
-		edgeSelect = bpy.context.tool_settings.mesh_select_mode[1]
-		faceSelect = bpy.context.tool_settings.mesh_select_mode[2]
-		
-		if mathutils.Vector(direction).length:
-		
-			# Vert select
-			if vertSelect:
-			
-				hasSelected = self.hasSelected(self.ob.data.vertices)
-				
-				for v in self.ob.data.vertices:
-				
-					normal = v.normal
-				
-					s = self.selectCheck(v.select, hasSelected, extend)
-					d = self.deselectCheck(v.select, hasSelected, extend)
-					
-					if s or d:
-						angle = direction.angle(normal)
-				
-					# Check if the verts match any of the directions
-					if s and angle <= divergence:
-						v.select = True
-							
-					if d and angle > divergence:
-						v.select = False
-						
-			# Edge select
-			if edgeSelect:
-			
-				hasSelected = self.hasSelected(self.ob.data.edges)
-				
-				for e in self.ob.data.edges:
-				
-					s = self.selectCheck(e.select, hasSelected, extend)
-					d = self.deselectCheck(e.select, hasSelected, extend)
-						
-						
-					# Check if the edges match any of the directions
-					if s or d:
-						normal = self.ob.data.vertices[e.vertices[0]].normal
-						normal += self.ob.data.vertices[e.vertices[1]].normal
-						
-						angle =direction.angle(normal) 
-								
-								
-					if s and angle <= divergence:
-						e.select = True
-							
-					if d and angle > divergence:
-						e.select = False
-		
-			# Face select
-			if faceSelect:
-			
-				hasSelected = self.hasSelected(self.ob.data.polygons)
-			
-				# Loop through all the given faces
-				for f in self.ob.data.polygons:
-						
-					s = self.selectCheck(f.select, hasSelected, extend)
-					d = self.deselectCheck(f.select, hasSelected, extend)
-					
-					if s or d:
-						angle = direction.angle(f.normal) 
-					
-					# Check if the faces match any of the directions
-					if s and angle <= divergence:
-						f.select = True
-						
-					if d and angle > divergence:
-						f.select = False
-		
-		bpy.ops.object.mode_set(mode='EDIT')
-		
-		
-		
-	# See if the current item should be selected or not
-	def selectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is not selected we may want to select
-		if not isSelected:
-			
-			# If we are extending or nothing is selected we want to select
-			if extend or not hasSelected:
-				return True
-				
-		return False
-	
-	
-	
-	# See if the current item should be deselected or not
-	def deselectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is selected we may want to deselect
-		if isSelected:
-		
-			# If something is selected and we're not extending we want to deselect
-			if hasSelected and not extend:
-				return True
-
-		return False
-				
-		
-		
-	# See if there is at least one selected item
-	def hasSelected(self, items):
-	
-		for item in items:
-			if item.select:
-				return True
-					
-		return False
-		
-		
-		
-class Select_init(bpy.types.Operator):
-	'''Select all items with normals facing a certain direction'''
-	bl_idname = 'mesh.select_by_direction'
-	bl_label = 'Select by direction'
-	bl_options = {'REGISTER', 'UNDO'}
-	
-	direction = FloatVectorProperty(name="Direction", description="Direction as a vector", default=(0.0, 0.0, 1.0), min=-100.0, max=100.0, soft_min=-10.0, soft_max=10.0, step=100, precision=2)
-	
-	divergence = FloatProperty(name='Divergence', description='The nr of degrees the selection may differ from the vector', default=math.radians(30.0), min=0.0, max=math.radians(360.0), soft_min=0.0, soft_max=math.radians(360.0), step=math.radians(5000), precision=2, subtype='ANGLE')
-	
-	extend = BoolProperty(name='Extend', description='Extend the current selection', default=False)
-	
-	# The spaces we use
-	spaces=(('LOC', 'Local', ''),('GLO', 'Global', ''))
-	
-	space = EnumProperty(items=spaces, name='Space', description='The space to interpret the directions in', default='LOC')
-
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH')
-
-	def execute(self, context):
-		SELECT_DIRECTION = Select_by_direction(context, self.direction, self.divergence, self.extend, self.space) 
-		return {'FINISHED'}
-
-
-
-
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_edge_length.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_edge_length.py
deleted file mode 100644
index 9b4d025..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_edge_length.py
+++ /dev/null
@@ -1,219 +0,0 @@
-# mesh_select_by_edge_length.py Copyright (C) 2011, Dolf Veenvliet
-#
-# Extrude a selection from a mesh multiple times
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-'''
-bl_info = {
-    "name": "Select by edge length",
-    "author": "Dolf Veenvliet",
-    "version": 1,
-    "blender": (2, 56, 0),
-    "api": 31847,
-    "location": "View3D > Select",
-    "description": "Select all items whose scale/length/surface matches a certain edge length",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-"""
-Usage:
-
-Launch from from "Select -> By edge length"
-
-Additional links:
-	Author Site: http://www.macouno.com
-	e-mail: dolf {at} macouno {dot} com
-"""
-'''
-import bpy, mathutils, math
-from bpy.props import FloatProperty, BoolProperty, EnumProperty
-
-
-class Select_by_edge_length():
-
-	# Initialise the class
-	def __init__(self, context, edgeLength, bigger, smaller, extend, space):
-	
-		self.ob = context.active_object
-		bpy.ops.object.mode_set(mode='OBJECT')
-		
-		self.space = space
-		self.obMat = self.ob.matrix_world
-		
-		# We ignore vert selections completely
-		#vertSelect = bpy.context.tool_settings.mesh_select_mode[0]
-		edgeSelect = bpy.context.tool_settings.mesh_select_mode[1]
-		faceSelect = bpy.context.tool_settings.mesh_select_mode[2]
-			
-					
-		# Edge select
-		if edgeSelect:
-		
-			hasSelected = self.hasSelected(self.ob.data.edges)
-			
-			for e in self.ob.data.edges:
-						
-				if  self.selectCheck(e.select, hasSelected, extend):
-				
-					len = self.getEdgeLength(e.vertices)
-					
-					if len == edgeLength or (bigger and len >= edgeLength) or (smaller and len <= edgeLength):
-						e.select = True
-					
-				if self.deselectCheck(e.select, hasSelected, extend):
-					len = self.getEdgeLength(e.vertices)
-					
-					if len != edgeLength and not (bigger and len >= edgeLength) and not (smaller and len <= edgeLength):
-						e.select = False
-	
-		# Face select
-		if faceSelect:
-		
-			hasSelected = self.hasSelected(self.ob.data.polygons)
-		
-			# Loop through all the given faces
-			for f in self.ob.data.polygons:
-					
-				# Check if the faces match any of the directions
-				if self.selectCheck(f.select, hasSelected, extend):
-				
-					min = 0.0
-					max = 0.0
-					
-					for i, e in enumerate(f.edge_keys):
-						len = self.getEdgeLength(e)
-						if not i:
-							min = len
-							max = len
-						elif len < min:
-							min = len
-						elif len > max:
-							max = len
-							
-					if (min == edgeLength and max == edgeLength) or (bigger and min >= edgeLength) or (smaller and max <= edgeLength):
-						f.select = True
-					
-				if self.deselectCheck(f.select, hasSelected, extend):
-				
-					min = 0.0
-					max = 0.0
-					
-					for i, e in enumerate(f.edge_keys):
-						len = self.getEdgeLength(e)
-						if not i:
-							min = len
-							max = len
-						elif len < min:
-							min = len
-						elif len > max:
-							max = len
-							
-					if (min != edgeLength and max != edgeLength) and not (bigger and  min >= edgeLength) and not (smaller and max <= edgeLength):
-						f.select = False
-		
-		
-		bpy.ops.object.mode_set(mode='EDIT')
-		
-		
-		
-	# Get the lenght of an edge, by giving this function all verts (2) in the edge
-	def getEdgeLength(self, verts):
-	
-		vec1 = self.ob.data.vertices[verts[0]].co
-		vec2 = self.ob.data.vertices[verts[1]].co
-				
-		vec = vec1 - vec2
-		
-		if self.space == 'GLO':
-			vec *= self.obMat
-		
-		return round(vec.length, 5)
-		
-		
-		
-	# See if the current item should be selected or not
-	def selectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is not selected we may want to select
-		if not isSelected:
-			
-			# If we are extending or nothing is selected we want to select
-			if extend or not hasSelected:
-				return True
-				
-		return False
-	
-	
-	
-	# See if the current item should be deselected or not
-	def deselectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is selected we may want to deselect
-		if isSelected:
-		
-			# If something is selected and we're not extending we want to deselect
-			if hasSelected and not extend:
-				return True
-
-		return False
-		
-		
-		
-	# See if there is at least one selected item
-	def hasSelected(self, items):
-	
-		for item in items:
-			if item.select:
-				return True
-					
-		return False
-		
-		
-		
-class Select_init(bpy.types.Operator):
-	'''Select all items with normals facing a certain direction'''
-	bl_idname = 'mesh.select_by_edge_length'
-	bl_label = 'Select by edge length'
-	bl_options = {'REGISTER', 'UNDO'}
-	
-	edgeLength = FloatProperty(name='Edge length', description='The scale in Blender units', default=1.0, min=0.0, max=1000.0, soft_min=0.0, soft_max=100.0, step=100, precision=2)
-	
-	bigger = BoolProperty(name='Bigger', description='Select items bigger than the size setting', default=False)
-	
-	smaller = BoolProperty(name='Smaller', description='Select items smaller than the size setting', default=False)
-	
-	extend = BoolProperty(name='Extend', description='Extend the current selection', default=False)
-	
-	# The spaces we use
-	spaces=(('LOC', 'Local', ''),('GLO', 'Global', ''))
-	
-	space = EnumProperty(items=spaces, name='Space', description='The space to interpret the directions in', default='LOC')
-
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH' and not bpy.context.tool_settings.mesh_select_mode[0])
-
-	def execute(self, context):
-		SELECT_EDGES = Select_by_edge_length(context, self.edgeLength, self.bigger, self.smaller, self.extend, self.space) 
-		return {'FINISHED'}
-
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_pi.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_pi.py
deleted file mode 100644
index c3a6108..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_pi.py
+++ /dev/null
@@ -1,214 +0,0 @@
-# mesh_select_by_pi.py Copyright (C) 2011, Dolf Veenvliet
-#
-# Extrude a selection from a mesh multiple times
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-'''
-bl_info = {
-    "name": "Select by pi",
-    "author": "Dolf Veenvliet",
-    "version": 1,
-    "blender": (2, 56, 0),
-    "api": 31847,
-    "location": "View3D > Select",
-    "description": "Select fake random based on pi",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-"""
-Usage:
-
-Launch from from "Select -> By pi"
-
-Additional links:
-	Author Site: http://www.macouno.com
-	e-mail: dolf {at} macouno {dot} com
-"""
-'''
-import bpy
-from bpy.props import BoolProperty
-
-
-class Select_by_pi():
-
-	# Initialise the class
-	def __init__(self, context, e, invert, extend):
-	
-		self.ob = context.active_object
-		bpy.ops.object.mode_set(mode='OBJECT')
-		
-		self.invert = invert
-		
-		# Make pi as a list of integers
-		if e:
-			self.pi = list('27182818284590452353602874713526624977572470936999')
-		else:
-			self.pi = list('31415926535897932384626433832795028841971693993751')
-		
-		self.piLen = len(self.pi)
-		self.piPos = 0
-		
-		vertSelect = bpy.context.tool_settings.mesh_select_mode[0]
-		edgeSelect = bpy.context.tool_settings.mesh_select_mode[1]
-		faceSelect = bpy.context.tool_settings.mesh_select_mode[2]
-		
-		# Vert select
-		if vertSelect:
-		
-			hasSelected = self.hasSelected(self.ob.data.vertices)
-			
-			for v in self.ob.data.vertices:
-			
-				s = self.selectCheck(v.select, hasSelected, extend)
-				d = self.deselectCheck(v.select, hasSelected, extend)
-			
-				# Check if the verts match any of the directions
-				if s and self.choose():
-					v.select = True
-						
-				if d and not self.choose():
-					v.select = False
-					
-		# Edge select
-		if edgeSelect:
-		
-			hasSelected = self.hasSelected(self.ob.data.edges)
-			
-			for e in self.ob.data.edges:
-			
-				s = self.selectCheck(e.select, hasSelected, extend)
-				d = self.deselectCheck(e.select, hasSelected, extend)
-					
-				if s and self.choose():
-					e.select = True
-						
-				if d and not self.choose():
-					e.select = False
-	
-		# Face select
-		if faceSelect:
-		
-			hasSelected = self.hasSelected(self.ob.data.polygons)
-		
-			# Loop through all the given faces
-			for f in self.ob.data.polygons:
-					
-				s = self.selectCheck(f.select, hasSelected, extend)
-				d = self.deselectCheck(f.select, hasSelected, extend)
-				
-				# Check if the faces match any of the directions
-				if s and self.choose():
-					f.select = True
-					
-				if d and not self.choose():
-					f.select = False
-	
-		bpy.ops.object.mode_set(mode='EDIT')
-	
-	
-	
-	# Choose by pi
-	def choose(self):
-		choice = True
-		
-		# We just choose the odd numbers
-		if int(self.pi[self.piPos]) % 2:
-			choice = False
-			
-		if self.invert:
-			if choice:
-				choice = False
-			else:
-				choice = True
-			
-		self.incrementPiPos()
-		return choice
-	
-	
-	
-	# Increment the pi position
-	def incrementPiPos(self):
-		self.piPos += 1
-		if self.piPos == self.piLen:
-			self.piPos = 0
-	
-	
-	
-	# See if the current item should be selected or not
-	def selectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is not selected we may want to select
-		if not isSelected:
-			
-			# If we are extending or nothing is selected we want to select
-			if extend or not hasSelected:
-				return True
-				
-		return False
-	
-	
-	
-	# See if the current item should be deselected or not
-	def deselectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is selected we may want to deselect
-		if isSelected:
-		
-			# If something is selected and we're not extending we want to deselect
-			if hasSelected and not extend:
-				return True
-
-		return False
-				
-		
-		
-	# See if there is at least one selected item
-	def hasSelected(self, items):
-	
-		for item in items:
-			if item.select:
-				return True
-					
-		return False
-		
-		
-		
-class Select_init(bpy.types.Operator):
-	'''Select faces based on pi'''
-	bl_idname = 'mesh.select_by_pi'
-	bl_label = 'Select by pi'
-	bl_options = {'REGISTER', 'UNDO'}
-	
-	e = BoolProperty(name='Use e', description='use e in stead of pi', default=False)
-	
-	invert = BoolProperty(name='Invert', description='Invert the selection result', default=False)
-	
-	extend = BoolProperty(name='Extend', description='Extend the current selection', default=False)
-
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH')
-
-	def execute(self, context):
-		SELECT_DIRECTION = Select_by_pi(context, self.e, self.invert, self.extend) 
-		return {'FINISHED'}
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_type.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_type.py
deleted file mode 100644
index c75d6b5..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_by_type.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# By CoDEmanX
-
-import bpy
-from bpy.props import EnumProperty, BoolProperty
-
-class DATA_OP_facetype_select(bpy.types.Operator):
-    """Select all faces of a certain type"""
-    bl_idname = "data.facetype_select"
-    bl_label = "Select by face type"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    face_type = EnumProperty(name="Select faces:",
-                             items = (("3","Triangles","Faces made up of 3 vertices"),
-                                      ("4","Quads","Faces made up of 4 vertices"),
-                                      ("5","Ngons","Faces made up of 5 and more vertices")),
-                             default = "5")
-
-    extend = BoolProperty(name="Extend", description="Extend Selection", default=False)
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object is not None and context.active_object.type == 'MESH'
-
-    def execute(self, context):
-
-        bpy.ops.object.mode_set(mode='EDIT')
-
-        if not self.extend:
-            bpy.ops.mesh.select_all(action='DESELECT')
-
-        context.tool_settings.mesh_select_mode=(False, False, True)
-
-        if self.face_type == "3":
-            bpy.ops.mesh.select_face_by_sides(number=3, type='EQUAL')
-        elif self.face_type == "4":
-            bpy.ops.mesh.select_face_by_sides(number=4, type='EQUAL')
-        else:
-            bpy.ops.mesh.select_face_by_sides(number=4, type='GREATER')
-
-        return {'FINISHED'}
-
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_checkered.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_select_checkered.py
deleted file mode 100644
index e027632..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_checkered.py
+++ /dev/null
@@ -1,185 +0,0 @@
-# mesh_select_checkered.py Copyright (C) 2011, Dolf Veenvliet
-#
-# Extrude a selection from a mesh multiple times
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Select checkered",
-    "author": "Dolf Veenvliet",
-    "version": 1,
-    "blender": (2, 56, 0),
-    "api": 31847,
-    "location": "View3D > Select",
-    "description": "Select checkered",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-"""
-Usage:
-
-Launch from from "Select -> checkered"
-
-Additional links:
-	Author Site: http://www.macouno.com
-	e-mail: dolf {at} macouno {dot} com
-"""
-
-import bpy
-from bpy.props import BoolProperty
-
-
-class Select_checkered():
-
-	# Initialise the class
-	def __init__(self, context, invert, extend):
-	
-		self.ob = context.active_object
-		bpy.ops.object.mode_set(mode='OBJECT')
-		
-		self.invert = invert
-		
-		self.selectedVerts = []
-		self.selectedFaces = []
-		self.deselectedFaces = []
-		
-		hasSelected = self.hasSelected(self.ob.data.polygons)
-	
-	
-		working = True
-		while working:
-		
-			working = False
-	
-			# Loop through all the given faces
-			for f in self.ob.data.polygons:
-			
-				if not f.index in self.selectedFaces and not f.index in self.deselectedFaces:
-					
-					choice = self.Choose(f)
-					
-					if choice != 'skip':
-					
-						s = self.selectCheck(f.select, hasSelected, extend)
-						d = self.deselectCheck(f.select, hasSelected, extend)
-					
-						# Check if the faces match any of the directions
-						if s and choice:
-							f.select = True
-							working = True
-							
-						if d and not choice:
-							f.select = False
-							working = True
-	
-		bpy.ops.object.mode_set(mode='EDIT')
-		
-	
-	
-	# Choose whether or not to select
-	def Choose(self, f):
-	
-		choice = 'skip'
-	
-		if not len(self.selectedFaces):
-			choice = True
-			self.selectedFaces.append(f.index)
-			self.selectedVerts.extend(f.vertices)
-		
-		else:
-			intersection = [v for v in f.vertices if v in self.selectedVerts]
-			
-			if len(intersection) == 1:
-				choice = True
-				self.selectedFaces.append(f.index)
-				self.selectedVerts.extend(f.vertices)
-				
-			elif len(intersection) == 2:
-				choice = False
-				self.deselectedFaces.append(f.index)
-	
-		if self.invert:
-			if choice:
-				choice = False
-			else:
-				choice = True
-		return choice
-	
-	
-	# See if the current item should be selected or not
-	def selectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is not selected we may want to select
-		if not isSelected:
-			
-			# If we are extending or nothing is selected we want to select
-			if extend or not hasSelected:
-				return True
-				
-		return False
-	
-	
-	
-	# See if the current item should be deselected or not
-	def deselectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is selected we may want to deselect
-		if isSelected:
-		
-			# If something is selected and we're not extending we want to deselect
-			if hasSelected and not extend:
-				return True
-
-		return False
-				
-		
-		
-	# See if there is at least one selected item
-	def hasSelected(self, items):
-	
-		for item in items:
-			if item.select:
-				return True
-					
-		return False
-		
-		
-		
-class Select_init(bpy.types.Operator):
-	'''Select faces based on pi'''
-	bl_idname = 'mesh.select_checkered'
-	bl_label = 'Select checkered'
-	bl_options = {'REGISTER', 'UNDO'}
-	
-	invert = BoolProperty(name='Invert', description='Invert the selection result', default=False)
-	
-	extend = BoolProperty(name='Extend', description='Extend the current selection', default=False)
-
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH')
-
-	def execute(self, context):
-		SELECT_DIRECTION = Select_checkered(context, self.invert, self.extend) 
-		return {'FINISHED'}
-
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_connected_faces.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_select_connected_faces.py
deleted file mode 100644
index 06ebac8..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_connected_faces.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# mesh_select_connected_faces.py Copyright (C) 2011, Dolf Veenvliet
-#
-# Extrude a selection from a mesh multiple times
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-'''
-    bl_info = {
-    "name": "Select connected faces",
-    "author": "Dolf Veenvliet",
-    "version": 1,
-    "blender": (2, 56, 0),
-    "api": 31847,
-    "location": "View3D > Select",
-    "description": "Select all faces connected to the current selection",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-"""
-Usage:
-
-Launch from from "Select -> Connected faces"
-
-Additional links:
-	Author Site: http://www.macouno.com
-	e-mail: dolf {at} macouno {dot} com
-"""
-'''
-import bpy, mathutils, math
-from bpy.props import IntProperty, BoolProperty
-
-
-class Select_connected_faces():
-
-	# Initialise the class
-	def __init__(self, context, iterations, extend):
-	
-		self.ob = context.active_object
-		bpy.ops.object.mode_set(mode='OBJECT')
-		
-		# Make a list of all selected vertices
-		selVerts = [v.index for v in self.ob.data.vertices if v.select]
-		
-		hasSelected = self.hasSelected(self.ob.data.polygons)
-		
-		for i in range(iterations):
-		
-			nextVerts = []
-		
-			for f in self.ob.data.polygons:
-			
-				if self.selectCheck(f.select, hasSelected, extend):
-				
-					for v in f.vertices:
-						if v in selVerts:
-							f.select = True
-
-					if f.select:
-						for v in f.vertices:
-							if v not in selVerts:
-								nextVerts.append(v)
-							
-				elif self.deselectCheck(f.select, hasSelected, extend):
-				
-					for v in f.vertices:
-						if v in selVerts:
-							f.select = False
-						
-							
-			selVerts = nextVerts
-		
-		bpy.ops.object.mode_set(mode='EDIT')
-		
-
-		
-	# See if the current item should be selected or not
-	def selectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is not selected we may want to select
-		if not isSelected:
-			return True
-				
-		return False
-	
-	
-	
-	# See if the current item should be deselected or not
-	def deselectCheck(self, isSelected, hasSelected, extend):
-	
-		# If the current item is selected we may want to deselect
-		if isSelected:
-		
-			# If something is selected and we're not extending we want to deselect
-			if hasSelected and not extend:
-				return True
-
-		return False
-		
-		
-		
-	# See if there is at least one selected item
-	def hasSelected(self, items):
-	
-		for item in items:
-			if item.select:
-				return True
-					
-		return False
-		
-		
-		
-class Select_init(bpy.types.Operator):
-	'''Select all faces connected to the current selection'''
-	bl_idname = 'mesh.select_connected_faces'
-	bl_label = 'Select connected faces'
-	bl_options = {'REGISTER', 'UNDO'}
-	
-	# Iterations
-	iterations = IntProperty(name='Iterations', default=1, min=0, max=1000, soft_min=0, soft_max=100)
-	
-	extend = BoolProperty(name='Extend', description='Extend the current selection', default=False)
-	
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH' and bpy.context.tool_settings.mesh_select_mode[0] == False and bpy.context.tool_settings.mesh_select_mode[1] == False and bpy.context.tool_settings.mesh_select_mode[2] == True)
-
-	def execute(self, context):
-		SELECT_CONNECTED = Select_connected_faces(context, self.iterations, self.extend) 
-		return {'FINISHED'}
-
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_innermost.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_select_innermost.py
deleted file mode 100644
index 00f61fd..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_select_innermost.py
+++ /dev/null
@@ -1,139 +0,0 @@
-# mesh_Select_innermost.py Copyright (C) 2011, Dolf Veenvliet
-#
-# Relaxes selected vertices while retaining the shape as much as possible
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-'''
-bl_info = {
-    "name": "Select innermost",
-    "author": "Dolf Veenvliet",
-    "version": (0,3),
-    "blender": (2, 57, 0),
-    "api": 35851,
-    "location": "Select > Innermost",
-    "description": "Select the innermost faces",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-"""
-Usage:
-
-Launch from "Select -> Innermost"
-
-
-Additional links:
-	Author Site: http://www.macouno.com
-	e-mail: dolf {at} macouno {dot} com
-"""
-'''
-import bpy
-from bpy.props import BoolProperty
-from . import mesh_extras
-
-# Grow stuff!
-class Select_innermost():
-
-	# Initialise the class
-	def __init__(self, context, invert):
-	
-		me = context.active_object.data
-		bpy.ops.object.mode_set(mode='OBJECT')
-		
-		oList = [f.index for f in mesh_extras.get_selected_faces()]
-		oLen = len(oList)
-		
-		# If no faces are selected, we just return
-		if not oLen:
-			bpy.ops.object.mode_set(mode='EDIT')
-			return
-		
-		# If all faces are selected, select nothing and return
-		if oLen == len(me.polygons):
-			bpy.ops.object.mode_set(mode='EDIT')
-			bpy.ops.mesh.select_all(action='DESELECT')
-			return
-		
-		fList = False
-		
-		# If we invert, we just want to select less once, and then we're done
-		if invert:
-			
-			bpy.ops.object.mode_set(mode='EDIT')
-			bpy.ops.mesh.select_less()
-			bpy.ops.object.mode_set(mode='OBJECT')
-			
-			fList = [f.index for f in mesh_extras.get_selected_faces()]
-			
-			# Only if there's now less selected do we change anything
-			if len(fList) < oLen:
-			
-				for f in me.polygons:
-					fIn = f.index
-					if fIn in oList and not fIn in fList:
-						f.select = True
-					else:
-						f.select = False
-						
-			bpy.ops.object.mode_set(mode='EDIT')
-			return
-			
-
-		# So now we can start and see what's up
-		while mesh_extras.contains_selected_item(me.polygons):
-				
-			if fList is False:
-				fList = oList
-			else:
-				fList = [f.index for f in mesh_extras.get_selected_faces()]
-			
-			bpy.ops.object.mode_set(mode='EDIT')
-			bpy.ops.mesh.select_less()
-			bpy.ops.object.mode_set(mode='OBJECT')
-			
-		if len(fList) < oLen:
-			for f in me.faces:
-				if f.index in fList:
-					f.select = True
-				else:
-					f.select = False
-		
-		bpy.ops.object.mode_set(mode='EDIT')
-		
-				
-
-class Select_innermost_init(bpy.types.Operator):
-	'''Select the innermost faces of the current selection'''
-	bl_idname = 'mesh.select_innermost'
-	bl_label = 'Select innermost'
-	bl_options = {'REGISTER', 'UNDO'}
-	
-	invert = BoolProperty(name='Invert', description='Invert the selection result (select outermost)', default=False)
-
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH')
-
-	def execute(self, context):
-		innermost = Select_innermost(context, self.invert)
-		return {'FINISHED'}
-
diff --git a/release/scripts/addons_contrib/mesh_select_tools/mesh_selection_topokit.py b/release/scripts/addons_contrib/mesh_select_tools/mesh_selection_topokit.py
deleted file mode 100644
index 9ebc253..0000000
--- a/release/scripts/addons_contrib/mesh_select_tools/mesh_selection_topokit.py
+++ /dev/null
@@ -1,567 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Topokit 2",
-    "author": "dustractor",
-    "version": (2, 0),
-    "blender": (2, 60, 0),
-    "api": 41935,
-    "location": "edit mesh vertices/edges/faces menus",
-    "description": "",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Mesh"}
-
-
-import bpy
-# In between calls, this stores any data that is expensive or static,
-# matched to the size of the mesh and the id of the operator that created it
-cachedata = dict()
-# and the object keeps the key to the cachedata
-bpy.types.Object.tkkey = bpy.props.IntVectorProperty(size=4)
-
-# just a mix-in for the operators...
-class meshpoller:
-    @classmethod
-    def poll(self,context):
-        try:
-            assert context.active_object.type == "MESH"
-        except:
-            return False
-        finally:
-            return True
-
-#BEGIN VERTICES SECTION
-
-# This one works similarly to normal 'grow' (ctrl + NUMPAD_PLUS),
-# except the original selection is not part of the result,
-#
-#   0--0--0         0--1--0
-#   |  |  |         |  |  |
-#   0--1--0  -->    1--0--1
-#   |  |  |         |  |  |
-#   0--0--0         0--1--0
-#
-class MESH_OT_vneighbors_edgewise(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.v2v_by_edge"
-    bl_label = "Neighbors by Edge"
-    bl_options = {"REGISTER","UNDO"}
-    
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        next_state = bytearray(meshkey[0])
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            vert_to_vert_map,prev_state = cachedata[meshkey]
-        else:
-            vert_to_vert_map = {i:{} for i in range(meshkey[0])}
-            for a,b in mesh.edge_keys:
-                vert_to_vert_map[a][b] = 1
-                vert_to_vert_map[b][a] = 1
-            obj.tkkey = meshkey
-            prev_state = None
-        if not prev_state:
-            selected_vert_indices = filter(lambda _:mesh.vertices[_].select,range(len(mesh.vertices)))
-        else:
-            selected_vert_indices = filter(lambda _:mesh.vertices[_].select and not prev_state[_],range(len(mesh.vertices)))
-        for v in selected_vert_indices:
-            for neighbor_index in vert_to_vert_map[v]:
-                next_state[neighbor_index] = True
-        mesh.vertices.foreach_set("select",next_state)
-        cachedata[meshkey] = (vert_to_vert_map,next_state)
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-# This one is an alternate / counterpart to the previous.
-# Think: diagonal opposite corners of a quad
-# NOTE: does not apply to a triangle, since verts have no 'opposite'
-#
-#   0--0--0     1--0--1
-#   |  |  |     |  |  |
-#   0--1--0 --> 0--0--0
-#   |  |  |     |  |  |
-#   0--0--0     1--0--1
-#
-class MESH_OT_vneighbors_facewise(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.v2v_facewise"
-    bl_label = "Neighbors by Face - Edge"
-    bl_options = {"REGISTER","UNDO"}
-    
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        next_state = bytearray(meshkey[0])
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            vert_to_vert_map = cachedata[meshkey]
-        else:
-            vert_to_vert_map = {i:{} for i in range(meshkey[0])}
-            for a,b in mesh.edge_keys:
-                vert_to_vert_map[a][b] = 1
-                vert_to_vert_map[b][a] = 1
-            obj.tkkey = meshkey
-        faces = filter(lambda face:(len(face.vertices)==4) and (face.select == False),mesh.polygons)
-        for f in faces:
-            has = False
-            t = set()
-            for v in f.vertices:
-                if mesh.vertices[v].select:
-                    has = True
-                    t.update(vert_to_vert_map[v])
-            if has:
-                for v in f.vertices:
-                    if not mesh.vertices[v].select:
-                        if v not in t:
-                            next_state[v]=1 
-        mesh.vertices.foreach_set("select",next_state)
-        cachedata[meshkey] = vert_to_vert_map
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-def vvmenuitem(self,context):
-    self.layout.operator(MESH_OT_vneighbors_edgewise.bl_idname)
-    self.layout.operator(MESH_OT_vneighbors_facewise.bl_idname)
-    #for the sake of completeness, yes there is one alg missing - one for both...
-
-#END VERTICES SECTION
-#BEGIN EDGES SECTION
-
-#   +--0--+--0--+--0--+          +--0--+--0--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     1     1     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--1--+--0--+   --->   +--0--+--0--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     1     1     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--0--+--0--+          +--0--+--0--+--0--+
-class MESH_OT_eneighbors_shared_v_f(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.e2e_evfe"
-    bl_label = "Neighbors by Vert+Face"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        state_mask = bytearray(meshkey[1])
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            edge_to_edges_dict = cachedata
-        else:
-            edge_key_to_index = {k:i for i,k in enumerate(mesh.edge_keys)}
-            edge_to_edges_dict = {i:set() for i in range(len(mesh.edges))}
-            for f in mesh.polygons:
-                fed=[edge_key_to_index[k] for k in f.edge_keys]
-                for k in f.edge_keys:
-                    edge_to_edges_dict[edge_key_to_index[k]].update(fed)
-            obj.tkkey = meshkey
-        for e in filter(lambda _:mesh.edges[_].select,edge_to_edges_dict):
-            k1 = set(mesh.edges[e].key)
-            for n in edge_to_edges_dict[e]:
-                k2 = set(mesh.edges[n].key)
-                if not k1.isdisjoint(k2):
-                    state_mask[n] = True
-        for e in mesh.edges:
-            e.select ^= state_mask[e.index]
-        cachedata[meshkey] = edge_key_to_index
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-
-#   +--0--+--0--+--0--+          +--0--+--0--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     1     1     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--1--+--0--+   --->   +--1--+--0--+--1--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     1     1     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--0--+--0--+          +--0--+--0--+--0--+
-class MESH_OT_eneighbors_shared_v(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.e2e_eve"
-    bl_label = "Neighbors by Vert"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        bpy.ops.object.mode_set(mode="OBJECT")
-        mesh = context.active_object.data
-        state_mask = bytearray(len(mesh.edges))
-        for e in mesh.edges:
-            state_mask[e.index] = mesh.vertices[e.vertices[0]].select ^ mesh.vertices[e.vertices[1]].select
-        mesh.edges.foreach_set('select',state_mask)
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-
-#   +--0--+--0--+--0--+          +--0--+--1--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     1     1     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--1--+--0--+   --->   +--0--+--0--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     1     1     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--0--+--0--+          +--0--+--1--+--0--+
-class MESH_OT_eneighbors_shared_f(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.e2e_efe"
-    bl_label = "Neighbors by Face"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            edge_to_edges_dict = cachedata
-        else:
-            edge_key_to_index = {k:i for i,k in enumerate(mesh.edge_keys)}
-            edge_to_edges_dict = {i:set() for i in range(len(mesh.edges))}
-            for f in mesh.polygons:
-                fed=[edge_key_to_index[k] for k in f.edge_keys]
-                for k in f.edge_keys:
-                    edge_to_edges_dict[edge_key_to_index[k]].update(fed)
-            obj.tkkey = meshkey
-        state_mask,esel = (bytearray(meshkey[1]),bytearray(meshkey[1]))
-        mesh.edges.foreach_get('select',esel) 
-        for e in filter(lambda _:mesh.edges[_].select,range(meshkey[1])):
-            for n in edge_to_edges_dict[e]:
-                state_mask[n] = 1
-        for e in range(meshkey[1]):
-            esel[e] ^= state_mask[e]
-        mesh.edges.foreach_set('select',esel)
-        cachedata[meshkey] = edge_to_edges_dict
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-# notice that on these next two, the original selection stays
-#   +--0--+--0--+--0--+          +--0--+--1--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     0     0     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--1--+--0--+   --->   +--0--+--1--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     0     0     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--0--+--0--+          +--0--+--1--+--0--+
-class MESH_OT_eneighbors_shared_f_notv(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.e2e_efnve"
-    bl_label = "Lateral Neighbors"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        state_mask = bytearray(meshkey[1])
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            edge_to_face_map,edge_key_to_index = cachedata[meshkey]
-        else:   
-            edge_key_to_index = {}
-            edge_to_face_map = {i:set() for i in range(meshkey[1])}
-            for i,k in enumerate(mesh.edge_keys):
-                edge_key_to_index[k] = i
-            for f in mesh.polygons:
-                for k in f.edge_keys:
-                    edge_to_face_map[edge_key_to_index[k]].add(f.index)
-            obj.tkkey = meshkey
-        selected_edge_indices = filter(lambda _:mesh.edges[_].select,range(meshkey[1]))
-        for e in selected_edge_indices:
-            for f in edge_to_face_map[e]:
-                for k in mesh.polygons[f].edge_keys:
-                    hasv_in = False
-                    for v in mesh.edges[e].key:
-                        if v in k:
-                            hasv_in = True
-                    if hasv_in:
-                        continue
-                    else:
-                        state_mask[edge_key_to_index[k]] = True
-        for e in filter(lambda _:state_mask[_],range(meshkey[1])):
-            mesh.edges[e].select |= state_mask[e]
-        cachedata[meshkey] = (edge_to_face_map,edge_key_to_index)
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-
-
-#   +--0--+--0--+--0--+          +--0--+--0--+--0--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     0     0     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--1--+--0--+   --->   +--1--+--1--+--1--+
-#   |     |     |     |          |     |     |     |
-#   0     0     0     0          0     0     0     0
-#   |     |     |     |          |     |     |     |
-#   +--0--+--0--+--0--+          +--0--+--0--+--0--+
-class MESH_OT_eneighbors_shared_v_notf(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.e2e_evnfe"
-    bl_label = "Longitudinal Edges"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        state_mask = bytearray(meshkey[1])
-        vstate = bytearray(meshkey[0])
-        mesh.vertices.foreach_get('select',vstate)
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            edge_to_face_map,vert_to_vert_map,edge_key_to_index = cachedata[meshkey]
-        else:
-            edge_key_to_index = {}
-            vert_to_vert_map = {i:set() for i in range(meshkey[0])}
-            edge_to_face_map = {i:set() for i in range(meshkey[1])}
-            for i,k in enumerate(mesh.edge_keys):
-                edge_key_to_index[k] = i
-                vert_to_vert_map[k[0]].add(k[1])
-                vert_to_vert_map[k[1]].add(k[0])
-            for f in mesh.polygons:
-                for k in f.edge_keys:
-                    edge_to_face_map[edge_key_to_index[k]].add(f.index)
-            obj.tkkey = meshkey
-        selected_edge_indices = filter(lambda _:mesh.edges[_].select,range(meshkey[1]))
-        for e in selected_edge_indices:
-            for v in mesh.edges[e].key:
-                state_mask[v] ^=1
-            for f in edge_to_face_map[e]:
-                for v in mesh.polygons[f].vertices:
-                    vstate[v] = 1
-        for v in filter(lambda _:state_mask[_],range(meshkey[1])):
-            for n in vert_to_vert_map[v]:
-                if not vstate[n] and (n != v):
-                    mesh.edges[edge_key_to_index[(min(v,n),max(v,n))]].select = True
-        cachedata[meshkey] = (edge_to_face_map,vert_to_vert_map,edge_key_to_index)
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
- 
-#deselects faces, leaving only edges selected
-class MESH_OT_just_the_edges(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.je"
-    bl_label = "Just the Edge Selection"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        state_mask = bytearray(meshkey[1])
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            edge_key_to_index = cachedata[meshkey]
-        else:
-            edge_key_to_index = {k:i for i,k in enumerate(mesh.edge_keys)}
-            obj.tkkey = meshkey
-        for f in filter(lambda _:mesh.polygons[_].select,range(meshkey[2])):
-            for k in mesh.polygons[f].edge_keys:
-                state_mask[edge_key_to_index[k]] = 1
-        for e in range(meshkey[1]):
-            mesh.edges[e].select ^= state_mask[e]
-        cachedata[meshkey] = edge_key_to_index
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-# deselects edges which are at the edge of a face-selection,
-# causing selection to 'shrink in'
-class MESH_OT_inner_edges(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.ie"
-    bl_label = "Inner Edge Selection"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        state_mask = bytearray(meshkey[1])
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            edge_to_face_map = cachedata[meshkey]
-        else:
-            edge_key_to_index = {k:i for i,k in enumerate(mesh.edge_keys)}
-            edge_to_face_map = {i:set() for i in range(meshkey[1])}
-            for f in mesh.polygons:
-                for k in f.edge_keys:
-                    edge_to_face_map[edge_key_to_index[k]].add(f.index)
-            obj.tkkey = meshkey
-        for e in filter(lambda _:mesh.edges[_].select,range(meshkey[1])):
-            for f in edge_to_face_map[e]:
-                if mesh.polygons[f].select:
-                    state_mask[e] ^=1
-        for e in range(meshkey[1]):
-            mesh.edges[e].select ^= state_mask[e]
-        cachedata[meshkey] = edge_to_face_map
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-
-def eemenuitem(self,context):
-    self.layout.operator(MESH_OT_eneighbors_shared_v_f.bl_idname)
-    self.layout.operator(MESH_OT_eneighbors_shared_v.bl_idname)
-    self.layout.operator(MESH_OT_eneighbors_shared_f.bl_idname)
-    self.layout.operator(MESH_OT_eneighbors_shared_f_notv.bl_idname)
-    self.layout.operator(MESH_OT_eneighbors_shared_v_notf.bl_idname)
-    self.layout.operator(MESH_OT_just_the_edges.bl_idname)
-    self.layout.operator(MESH_OT_inner_edges.bl_idname)
-
-#END EDGES SECTION
-#BEGIN FACES SECTION
-
-# here is another one which functions very similarly to the ctrl+NUMPAD_PLUS 'growth'
-# but it deselects the original selection, of course.
-# This would be your checkerboard-type growth.
-#   [0][0][0]          [0][1][0] 
-#   [0][1][0]   --->   [1][0][1]
-#   [0][0][0]          [0][1][0]
-class MESH_OT_fneighbors_shared_e(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.f2f_fef"
-    bl_label = "Neighbors by Edge"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            face_to_face_map = cachedata[meshkey]
-        else:
-            edge_key_to_index = {k:i for i,k in enumerate(mesh.edge_keys)}
-            edge_to_face_map = {i:set() for i in range(meshkey[1])}
-            for f in mesh.polygons:
-                for k in f.edge_keys:
-                    edge_to_face_map[edge_key_to_index[k]].add(f.index)
-            face_to_face_map = {i:set() for i in range(meshkey[2])}
-            for f in mesh.polygons:
-                for k in f.edge_keys:
-                    face_to_face_map[f.index].update(edge_to_face_map[edge_key_to_index[k]])
-            obj.tkkey = meshkey
-        mask_state = bytearray(meshkey[2])
-        for f in filter(lambda _:mesh.polygons[_].select,range(meshkey[2])):
-            for n in face_to_face_map[f]:
-                mask_state[n] = True
-        for f in range(meshkey[2]):
-            mesh.polygons[f].select ^= mask_state[f]
-        cachedata[meshkey] = face_to_face_map
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-
-#   [0][0][0]          [1][0][1] 
-#   [0][1][0]   --->   [0][0][0]
-#   [0][0][0]          [1][0][1]
-class MESH_OT_fneighbors_shared_v_note(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.f2f_fvnef"
-    bl_label = "Neighbors by Vert not Edge"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            edge_key_to_index = cachedata[meshkey]
-        else:
-            edge_key_to_index = {k:i for i,k in enumerate(mesh.edge_keys)}
-            obj.tkkey = meshkey
-        state_mask = bytearray(meshkey[2])
-        face_verts = set()
-        for f in filter(lambda _:mesh.polygons[_].select,range(meshkey[2])):
-            face_verts.update(mesh.polygons[f].vertices)
-        for f in filter(lambda _:not mesh.polygons[_].select,range(meshkey[2])):
-            ct = 0
-            for v in mesh.polygons[f].vertices:
-                ct += (v in face_verts)
-            if ct == 1:
-                state_mask[f] = 1
-        mesh.polygons.foreach_set('select',state_mask)
-        cachedata[meshkey] = edge_key_to_index
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-
-# http://en.wikipedia.org/wiki/Conway's_Game_of_Life
-class MESH_OT_conway(meshpoller,bpy.types.Operator):
-    bl_idname = "mesh.conway"
-    bl_label = "Conway"
-    bl_options = {"REGISTER","UNDO"}
-    def execute(self,context):
-        global cachedata
-        bpy.ops.object.mode_set(mode="OBJECT")
-        obj = context.active_object
-        mesh = obj.data
-        meshkey = (len(mesh.vertices),len(mesh.edges),len(mesh.polygons),id(self))
-        if (meshkey == obj.tkkey) and (meshkey in cachedata):
-            vert_to_face_map = cachedata[meshkey]
-        else:
-            vert_to_face_map = {i:set() for i in range(meshkey[0])}
-            for f in mesh.polygons:
-                for v in f.vertices:
-                    vert_to_face_map[v].add(f.index)
-            obj.tkkey = meshkey
-        sel = set()
-        uns = set()
-        F = {i:set() for i in range(meshkey[2])}
-        for f in range(meshkey[2]):
-            for v in mesh.polygons[f].vertices:
-                for n in filter(lambda _: mesh.polygons[_].select and (_ != f),vert_to_face_map[v]):
-                    F[f].add(n)
-        for f in F:
-            if len(F[f]) == 3:
-                sel.add(f)
-            elif len(F[f]) != 2:
-                uns.add(f)
-        for f in range(meshkey[2]):
-            if f in sel:
-                mesh.polygons[f].select = True
-            if f in uns:
-                mesh.polygons[f].select = False
-        cachedata[meshkey] = vert_to_face_map
-        bpy.ops.object.mode_set(mode="EDIT")
-        return {"FINISHED"}
-
-        
-
-def ffmenuitem(self,context):
-    self.layout.operator(MESH_OT_fneighbors_shared_e.bl_idname)
-    self.layout.operator(MESH_OT_fneighbors_shared_v_note.bl_idname)
-    self.layout.operator(MESH_OT_conway.bl_idname)
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.VIEW3D_MT_edit_mesh_vertices.append(vvmenuitem)
-    bpy.types.VIEW3D_MT_edit_mesh_edges.append(eemenuitem)
-    bpy.types.VIEW3D_MT_edit_mesh_faces.append(ffmenuitem)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(vvmenuitem)
-    bpy.types.VIEW3D_MT_edit_mesh_edges.remove(eemenuitem)
-    bpy.types.VIEW3D_MT_edit_mesh_faces.remove(ffmenuitem)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_select_vertex_groups.py b/release/scripts/addons_contrib/mesh_select_vertex_groups.py
deleted file mode 100644
index e4f6ee2..0000000
--- a/release/scripts/addons_contrib/mesh_select_vertex_groups.py
+++ /dev/null
@@ -1,234 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Select Vertex Groups",
-    "author": "Martin Ellison",
-    "version": (1, 0),
-    "blender": (2, 59, 0),
-    "location": "Toolbox",
-    "description": "Finds all the vertex groups that chosen verts are in, & any verts that are not in any group",
-    "warning": "Buggy", # used for warning icon and text in addons panel
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/Modeling/Select_Vertex_Groups",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"
-                   "func=detail&aid=22025",
-    "category": "Mesh"}
-
-"""
-This script finds all the vertex groups that chosen vertexes are in, and any vertexes that are not in any vertex group.
-
-This is useful for cleaning up a mesh if vertex groups under animation go off to the wrong place (because they are in a vertex group that they should not be in, or not in the vertex group that they should be in).
-
-How to use:
-1. select a mesh and get into edit mode.
-2. by default it will use all vertexes; alternatively, select vertexes of interest and click on 'use selected vertexes'. Note that subsequent selections and deselections of vertexes will not change the set of vertexes to be used, you need to click on these buttons again to do that.
-3. click on 'select' and 'deselect' buttons for listed vertex groups, and for no vertex group, to select and deselect vertexes.
-
-This only lists vertex groups that have used vertexes.
-
-You may want to use the mesh select/deselect all (keyboard A) operator to start.
-
-Once you have the right vertexes selected, you can use the standard vertex groups property editor to add them to or remove them from the desired vertex groups.
-"""
-
-
-import bpy
-from bpy.props import *
-
-global use_selected_only, used_vertexes, the_mesh, vertex_usage
-use_selected_only = False
-used_vertexes = set()
-the_mesh = None
-vertex_usage = ''
-
-class UseAll(bpy.types.Operator):
-    bl_idname = "mesh.primitive_fvg_useall"
-    bl_label = "Use all Vertexes"
-    bl_register = True
-    bl_undo = True
-    #limit = FloatProperty(name="limit", description="Ignore weights under this limit.", default= 0.01, min = 0.0, max = 1.0, soft_min=0.0, soft_max=1.0)
-
-    def execute(self, context):
-        global use_selected_only
-        use_selected_only = False
-        bpy.ops.object.editmode_toggle()
-        set_used()
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-class UseSelected(bpy.types.Operator):
-    bl_idname = "mesh.primitive_fvg_useselected"
-    bl_label = "Use Selected Vertexes"
-    bl_register = True
-    bl_undo = True
-
-    def execute(self, context):
-        global use_selected_only
-        use_selected_only = True
-        bpy.ops.object.editmode_toggle()
-        set_used()
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-class SelectFound(bpy.types.Operator):
-    bl_idname = "mesh.primitive_fvg_selfound"
-    bl_label = "Select"
-    bl_register = True
-    bl_undo = True
-    vertexgroup = bpy.props.StringProperty(name = 'vertexgroup', description = 'vertexgroup', default = '', options = set())
-
-    def execute(self, context):
-        global the_mesh
-        bpy.ops.object.editmode_toggle()
-        vertexgroup = self.properties.vertexgroup
-        fv = found_verts(vertexgroup)
-        for v in fv: v.select = True
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-class DeselectFound(bpy.types.Operator):
-    bl_idname = "mesh.primitive_fvg_deselfound"
-    bl_label = "Deselect"
-    bl_register = True
-    bl_undo = True
-    vertexgroup = bpy.props.StringProperty(name = 'vertexgroup', description = 'vertexgroup', default = '', options = set())
-
-    def execute(self, context):
-        global the_mesh
-        bpy.ops.object.editmode_toggle()
-        vertexgroup = self.properties.vertexgroup
-        fv = found_verts(vertexgroup)
-        for v in fv: v.select = False
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-def set_used():
-    global use_selected_only, used_vertexes, the_mesh, vertex_usage
-    obj = bpy.context.active_object
-    used_vertexes = set()
-    if use_selected_only:
-        for v in obj.data.vertices:
-            if v.select: used_vertexes.add(v.index)
-    else:
-        for v in obj.data.vertices: used_vertexes.add(v.index)
-    the_mesh = obj
-    vertex_usage = '%d vertexes used' % (len(used_vertexes))
-
-
-def make_groups(limit):
-    global used_vertexes
-    vgp = []
-    vgdict = {}
-    vgused = {}
-    obj = bpy.context.active_object
-    all_in_group = True
-    for vg in obj.vertex_groups:
-        vgdict[vg.index] = vg.name
-    for v in obj.data.vertices:
-        in_group = False
-        if v.index in used_vertexes:
-            for g in v.groups:
-                gr = g.group
-                w = g.weight
-                if w > limit:
-                    if not gr in vgused: vgused[gr] = 0
-                    vgused[gr] += 1
-                    in_group = True
-        if not in_group: all_in_group = False
-    if not all_in_group:
-        vgp.append(("no group", "(No group)"))
-    for gn in vgused.keys():
-        name = vgdict[gn]
-        vgp.append((name, '%s has %d vertexes' % (name, vgused[gn]) ))
-    print("%d groups found\n" % len(vgp))
-    return vgp
-
-def found_verts(vertex_group):
-    global used_vertexes
-    vgfound = []
-    obj = bpy.context.active_object
-    if vertex_group == 'no group':
-        for v in obj.data.vertices:
-            if v.index in used_vertexes and (not v.groups):
-                vgfound.append(v)
-    else:
-        vgnum = obj.vertex_groups.find(vertex_group)
-        for v in obj.data.vertices:
-            if v.index in used_vertexes:
-                for g in v.groups:
-                    if g.group == vgnum:
-                        vgfound.append(v)
-                        break
-
-    print('%d vertexes found for %s' % (len(vgfound), vertex_group))
-    return vgfound
-
-
-class VIEW3D_PT_FixVertexGroups(bpy.types.Panel):
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOLS"
-    bl_label = "Select Vertex Groups"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(self, context):
-        if bpy.context.active_object:
-            obj = bpy.context.active_object
-            if obj.type == 'MESH' and obj.mode == 'EDIT': return True
-        return False
-
-    def draw(self, context):
-        global use_selected_only, used_vertexes, the_mesh, vertex_usage
-
-        if bpy.context.active_object:
-            obj = bpy.context.active_object
-            if obj.type == 'MESH' and obj.mode == 'EDIT':
-                layout = self.layout
-                use_all = layout.operator("mesh.primitive_fvg_useall", "Use all vertexes")
-                layout.operator("mesh.primitive_fvg_useselected", "Use selected vertexes")
-                if use_selected_only:
-                    layout.label(text = 'Using selected vertexes.')
-                else:
-                    layout.label(text = 'Using all vertexes.')
-                layout.label(vertex_usage)
-                if len(used_vertexes) == 0 or obj is not the_mesh: set_used()
-                #layout.prop(use_all, 'limit', slider = True)
-                #groups = make_groups(use_all.limitval)
-                groups = make_groups(0.01)
-                for gp in groups:
-                    layout.label(text = gp[1])
-                    row = layout.row()
-                    sel_op = row.operator("mesh.primitive_fvg_selfound", "Select")
-                    sel_op.vertexgroup = gp[0]
-                    desel_op = row.operator("mesh.primitive_fvg_deselfound", "Deselect")
-                    desel_op.vertexgroup = gp[0]
-
-classes = [UseAll, UseSelected, SelectFound, DeselectFound]
-
-def register():
-    bpy.utils.register_module(__name__)
-    pass
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    pass
-
-if __name__ == "__main__":
-    print('------ executing --------')
-    register()
diff --git a/release/scripts/addons_contrib/mesh_show_vgroup_weights.py b/release/scripts/addons_contrib/mesh_show_vgroup_weights.py
deleted file mode 100644
index fe2ce03..0000000
--- a/release/scripts/addons_contrib/mesh_show_vgroup_weights.py
+++ /dev/null
@@ -1,458 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-# <pep8 compliant> (Thanks to CodemanX on IRC)
-
-bl_info = {
-    "name": "Show Vertex Groups/Weights",
-    "author": "Jason van Gumster (Fweeb), Bartius Crouch",
-    "version": (0, 7, 1),
-    "blender": (2, 62, 0),
-    "location": "3D View > Properties Region > Show Weights",
-    "description": "Finds the vertex groups of a selected vertex and displays the corresponding weights",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Modeling/Show_Vertex_Group_Weights",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=30609",
-    "category": "Mesh"}
-
-#TODO - Add button for selecting vertices with no groups
-
-
-import bpy, bmesh, bgl, blf, mathutils
-
-
-# Borrowed/Modified from Bart Crouch's old Index Visualizer add-on
-def calc_callback(self, context):
-    #polling
-    if context.mode != "EDIT_MESH" or len(context.active_object.vertex_groups) == 0:
-        return
-
-    # get color info from theme
-    acol = context.user_preferences.themes[0].view_3d.editmesh_active
-    tcol = (acol[0] * 0.85, acol[1] * 0.85, acol[2] * 0.85)
-    
-    # get screen information
-    mid_x = context.region.width / 2.0
-    mid_y = context.region.height / 2.0
-    width = context.region.width
-    height = context.region.height
-    
-    # get matrices
-    view_mat = context.space_data.region_3d.perspective_matrix
-    ob_mat = context.active_object.matrix_world
-    total_mat = view_mat * ob_mat
-    
-    # calculate location info
-    texts = []
-    locs = []
-    weights  = []
-    me = context.active_object.data
-    bm = bmesh.from_edit_mesh(me)
-    dvert_lay = bm.verts.layers.deform.active
-
-    for v in bm.verts:
-        if v.select: #XXX Should check v.hide here, but it doesn't work
-            if bm.select_mode == {'VERT'} and bm.select_history.active is not None and bm.select_history.active.index == v.index:
-                locs.append([acol[0], acol[1], acol[2], v.index, v.co.to_4d()])
-            else:
-                locs.append([tcol[0], tcol[1], tcol[2], v.index, v.co.to_4d()])
-            dvert = v[dvert_lay]
-            for vgroup in context.active_object.vertex_groups:
-                if vgroup.index in dvert.keys():
-                    weights += [v.index, vgroup.index, dvert[vgroup.index]]
-
-    for loc in locs:
-        vec = total_mat * loc[4] # order is important
-        # dehomogenise
-        vec = mathutils.Vector((vec[0] / vec[3], vec[1] / vec[3], vec[2] / vec[3]))
-        x = int(mid_x + vec[0] * width / 2.0)
-        y = int(mid_y + vec[1] * height / 2.0)
-        texts += [loc[0], loc[1], loc[2], loc[3], x, y, 0]
-
-    # store as ID property in mesh
-    context.active_object.data["show_vgroup_verts"] = texts
-    context.active_object.data["show_vgroup_weights"] = weights
-
-
-# draw in 3d-view
-def draw_callback(self, context):
-    # polling
-    if context.mode != "EDIT_MESH" or len(context.active_object.vertex_groups) == 0:
-        return
-    # retrieving ID property data
-    try:
-        texts = context.active_object.data["show_vgroup_verts"]
-        weights = context.active_object.data["show_vgroup_weights"]
-    except:
-        return
-    if not texts:
-        return
-
-    bm = bmesh.from_edit_mesh(context.active_object.data)
-
-    if bm.select_mode == {'VERT'} and bm.select_history.active is not None:
-        active_vert = bm.select_history.active
-    else:
-        active_vert = None
-
-    # draw
-    blf.size(0, 13, 72)
-    blf.enable(0, blf.SHADOW)
-    blf.shadow(0, 3, 0.0, 0.0, 0.0, 1.0)
-    blf.shadow_offset(0, 2, -2)
-    for i in range(0, len(texts), 7):
-        bgl.glColor3f(texts[i], texts[i+1], texts[i+2])
-        blf.position(0, texts[i+4], texts[i+5], texts[i+6])
-        blf.draw(0, "Vertex " + str(int(texts[i+3])) + ":")
-        font_y = texts[i+5]
-        group_name = ""
-        for j in range(0, len(weights), 3):
-            if int(weights[j]) == int(texts[i+3]):
-                font_y -= 13
-                blf.position(0, texts[i+4] + 10, font_y, texts[i+6])
-                for group in context.active_object.vertex_groups:
-                    if group.index == int(weights[j+1]):
-                        group_name = group.name
-                        break
-                blf.draw(0, group_name + ": %.3f" % weights[j+2])
-        if group_name == "":
-            font_y -= 13
-            blf.position(0, texts[i+4] + 10, font_y, texts[i+6])
-            blf.draw(0, "No Groups")
-
-    # restore defaults
-    blf.disable(0, blf.SHADOW)
-
-
-# operator
-class ShowVGroupWeights(bpy.types.Operator):
-    bl_idname = "view3d.show_vgroup_weights"
-    bl_label = "Show Vertex Group Weights"
-    bl_description = "Toggle the display of the vertex groups and weights for selected vertices"
-    
-    @classmethod
-    def poll(cls, context):
-        return context.mode == 'EDIT_MESH'
-    
-    def __del__(self):
-        bpy.context.scene.display_indices = -1
-        clear_properties(full=False)
-    
-    def modal(self, context, event):
-        if context.area:
-            context.area.tag_redraw()
-
-        # removal of callbacks when operator is called again
-        if context.scene.display_indices == -1:
-            context.region.callback_remove(self.handle1)
-            context.region.callback_remove(self.handle2)
-            context.scene.display_indices = 0
-            return {'CANCELLED'}
-        
-        return {'PASS_THROUGH'}
-    
-    def invoke(self, context, event):
-        if context.area.type == 'VIEW_3D':
-            if context.scene.display_indices < 1:
-                # operator is called for the first time, start everything
-                context.scene.display_indices = 1
-                self.handle1 = context.region.callback_add(calc_callback,
-                    (self, context), 'POST_VIEW')
-                self.handle2 = context.region.callback_add(draw_callback,
-                    (self, context), 'POST_PIXEL')
-                context.window_manager.modal_handler_add(self)
-                return {'RUNNING_MODAL'}
-            else:
-                # operator is called again, stop displaying
-                context.scene.display_indices = -1
-                clear_properties(full=False)
-                return {'RUNNING_MODAL'}
-        else:
-            self.report({'WARNING'}, "View3D not found, can't run operator")
-            return {'CANCELLED'}
-
-
-# removal of ID-properties when script is disabled
-def clear_properties(full=True):
-    # can happen on reload
-    if bpy.context.scene is None:
-        return
-    
-    if "show_vgroup_verts" in bpy.context.active_object.data.keys():
-        del bpy.context.active_object.data["show_vgroup_verts"]
-    if "show_vgroup_weights" in bpy.context.active_object.data.keys():
-        del bpy.context.active_object.data["show_vgroup_weights"]
-    if full:
-        props = ["display_indices"]
-        for p in props:
-            if p in bpy.types.Scene.bl_rna.properties:
-                exec("del bpy.types.Scene." + p)
-            if p in bpy.context.scene.keys():
-                del bpy.context.scene[p]
-
-
-class AssignVertexWeight(bpy.types.Operator):
-    bl_idname = "mesh.vertex_group_assign"
-    bl_label = "Assign Weights"
-    bl_description = "Assign weights for all of the groups on a specific vertex"
-
-    vgroup_weights = bpy.props.StringProperty(name = "Vertex Group Weights")
-
-    @classmethod
-    def poll(cls, context):
-        return context.mode == 'EDIT_MESH'
-
-    def execute(self, context):
-        me = context.active_object.data
-        bm = bmesh.from_edit_mesh(me)
-        dvert_lay = bm.verts.layers.deform.active
-        weights = eval(self.vgroup_weights) #XXX Would be nice if I didn't have to use an eval
-
-        for v in bm.verts:
-            if v.index == weights["__index__"]:
-                del weights["__index__"]
-                dvert = v[dvert_lay]
-                for vgroup in dvert.keys():
-                    dvert[vgroup] = weights[vgroup]
-                break
-
-        return {'FINISHED'}
-
-
-class RemoveFromVertexGroup(bpy.types.Operator):
-    bl_idname = "mesh.vertex_group_remove"
-    bl_label = "Remove Vertex from Group"
-    bl_description = "Remove a specific vertex from a specific vertex group"
-
-    #XXX abusing vector props here a bit; the first element is the vert index and the second is the group index
-    vert_and_group = bpy.props.IntVectorProperty(name = "Vertex and Group to remove", size = 2)
-
-    @classmethod
-    def poll(cls, context):
-        return context.mode == 'EDIT_MESH'
-
-    def execute(self, context):
-        ob = context.active_object
-        me = ob.data
-        bm = bmesh.from_edit_mesh(me)
-
-        # Save current selection
-        selected_verts = []
-        for v in bm.verts:
-            if v.select is True:
-                selected_verts.append(v.index)
-                if v.index != self.vert_and_group[0]:
-                    v.select = False
-
-        ob.vertex_groups.active_index = self.vert_and_group[1]
-        bpy.ops.object.vertex_group_remove_from()
-
-        # Re-select vertices
-        for v in bm.verts:
-            if v.index in selected_verts:
-                v.select = True
-
-        #XXX Hacky, but there's no other way to update the UI panels
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-class AddToVertexGroup(bpy.types.Operator):
-    bl_idname = "mesh.vertex_group_add"
-    bl_label = "Add Vertex to Group"
-    bl_description = "Add a specific vertex to a specific vertex group"
-
-    def avail_vgroups(self, context):
-        ob = context.active_object
-        bm = bmesh.from_edit_mesh(ob.data)
-        dvert_lay = bm.verts.layers.deform.active
-        items = []
-        self.vertex = bm.select_history.active.index
-
-        dvert = bm.select_history.active[dvert_lay]
-
-        items.append(("-1", "New Vertex Group", "-1", -1))
-
-        for i in ob.vertex_groups:
-            if i.index not in dvert.keys():
-                items.append((i.name, i.name, str(i.index), i.index))
-
-        return items
-
-    vertex = bpy.props.IntProperty()
-    available_vgroups = bpy.props.EnumProperty(items = avail_vgroups, name = "Available Groups")
-
-    @classmethod
-    def poll(cls, context):
-        return context.mode == 'EDIT_MESH'
-
-    def execute(self, context):
-        ob = context.active_object
-        me = ob.data
-        bm = bmesh.from_edit_mesh(me)
-        #print(self.available_vgroups)
-
-        # Save current selection
-        selected_verts = []
-        for v in bm.verts:
-            if v.select is True:
-                selected_verts.append(v.index)
-                if v.index != self.vertex:
-                    v.select = False
-
-        weight = context.tool_settings.vertex_group_weight
-        context.tool_settings.vertex_group_weight = 1.0
-        if self.available_vgroups == "-1":
-            bpy.ops.object.vertex_group_assign(new = True) #XXX Assumes self.vertex is the active vertex
-        else:
-            bpy.ops.object.vertex_group_set_active(group = self.available_vgroups)
-            bpy.ops.object.vertex_group_assign() #XXX Assumes self.vertex is the active vertex
-        context.tool_settings.vertex_group_weight = weight
-
-        # Re-select vertices
-        for v in bm.verts:
-            if v.index in selected_verts:
-                v.select = True
-
-        #XXX Hacky, but there's no other way to update the UI panels
-        bpy.ops.object.editmode_toggle()
-        bpy.ops.object.editmode_toggle()
-        return {'FINISHED'}
-
-
-class PanelShowWeights(bpy.types.Panel):
-    bl_label = "Show Weights"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "UI"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(cls, context):
-        return context.mode == 'EDIT_MESH'
-
-    def draw(self, context):
-        layout = self.layout
-        ob = context.active_object
-        me = ob.data
-        bm = bmesh.from_edit_mesh(me)
-        dvert_lay = bm.verts.layers.deform.active
-
-        if context.scene.display_indices < 1:
-            layout.operator(ShowVGroupWeights.bl_idname, text = "Show Weights Overlay")
-        else:
-            layout.operator(ShowVGroupWeights.bl_idname, text = "Hide Weights Overlay")
-
-        if len(ob.vertex_groups) > 0:
-            # Active vertex
-            active_vert = bm.select_history.active
-            sub = layout.box()
-            col = sub.column(align = True)
-            if bm.select_mode == {'VERT'} and active_vert is not None:
-                col.label(text = "Active Vertex")
-                row = col.row()
-                row.label(text = "Vertex " + str(active_vert.index) + ":")
-                row.operator_menu_enum("mesh.vertex_group_add", "available_vgroups", text = "Add Group", icon = 'GROUP_VERTEX')
-                has_groups = False
-                vgroup_weights = {}
-
-                for i in me.vertices:
-                    if i.index == active_vert.index:
-                        vgroup_weights["__index__"] = i.index
-                        for j in range(len(i.groups)):
-                            for k in ob.vertex_groups:
-                                if k.index == i.groups[j].group:
-                                    has_groups = True
-                                    split = col.split(percentage = 0.90, align = True)
-                                    vgroup_weights[k.index] = i.groups[j].weight
-                                    row = split.row(align = True)
-                                    row.prop(i.groups[j], "weight", text = k.name, slider = True, emboss = not k.lock_weight)
-                                    row = split.row(align = True)
-                                    row.operator("mesh.vertex_group_remove", text = "R").vert_and_group = (i.index, k.index)
-                
-                if not has_groups:
-                    col.label(text = "    No Groups")
-                else:
-                    col.operator("mesh.vertex_group_assign").vgroup_weights = str(vgroup_weights)
-                layout.separator()
-            else:
-                col.label(text = "No Active Vertex")
-            layout.prop(context.window_manager, "show_vgroups_show_all", toggle = True)
-            # All selected vertices (except for the active vertex)
-            if context.window_manager.show_vgroups_show_all:
-                for v in bm.verts:
-                    if v.select:
-                        if active_vert is not None and v.index == active_vert.index:
-                            continue
-                        sub = layout.box()
-                        col = sub.column(align = True)
-                        col.label(text = "Vertex " + str(v.index) + ":")
-                        has_groups = False
-                        vgroup_weights = {}
-                        for i in me.vertices:
-                            if i.index == v.index:
-                                vgroup_weights["__index__"] = i.index
-                                for j in range(len(i.groups)):
-                                    for k in ob.vertex_groups:
-                                        if k.index == i.groups[j].group:
-                                            has_groups = True
-                                            split = col.split(percentage = 0.90, align = True)
-                                            vgroup_weights[k.index] = i.groups[j].weight
-                                            row = split.row(align = True)
-                                            row.prop(i.groups[j], "weight", text = k.name, slider = True, emboss = not k.lock_weight)
-                                            row = split.row(align = True)
-                                            row.operator("mesh.vertex_group_remove", text = "R").vert_and_group = (i.index, k.index)
-                        if not has_groups:
-                            col.label(text = "    No Groups")
-                        else:
-                            col.operator("mesh.vertex_group_assign").vgroup_weights = str(vgroup_weights)
-        else:
-            layout.label(text = "No Groups")
-
-
-def register():
-    bpy.types.WindowManager.show_vgroups_show_all = bpy.props.BoolProperty(
-        name = "Show All Selected Vertices",
-        description = "Show all vertices with vertex groups assigned to them",
-        default = False)
-    bpy.types.Mesh.assign_vgroup = bpy.props.StringProperty()
-    bpy.utils.register_class(ShowVGroupWeights)
-    bpy.types.Scene.display_indices = bpy.props.IntProperty(
-        name="Display indices",
-        default=0)
-    bpy.utils.register_class(AssignVertexWeight)
-    bpy.utils.register_class(RemoveFromVertexGroup)
-    bpy.utils.register_class(AddToVertexGroup)
-    bpy.utils.register_class(PanelShowWeights)
-    
-
-def unregister():
-    bpy.utils.unregister_class(ShowVGroupWeights)
-    clear_properties()
-    bpy.utils.unregister_class(AssignVertexWeight)
-    bpy.utils.unregister_class(RemoveFromVertexGroup)
-    bpy.utils.unregister_class(AddToVertexGroup)
-    bpy.utils.unregister_class(PanelShowWeights)
-    del bpy.types.WindowManager.show_vgroups_show_all
-    del bpy.types.Mesh.assign_vgroup
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/mesh_vertex_slide.py b/release/scripts/addons_contrib/mesh_vertex_slide.py
deleted file mode 100644
index 5fc14a0..0000000
--- a/release/scripts/addons_contrib/mesh_vertex_slide.py
+++ /dev/null
@@ -1,473 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Vertex slide for Bmesh",
-    "author": "Valter Battioli (ValterVB) and PKHG",
-    "version": (2, 0, 0),
-    "blender": (2, 62, 0),
-    "location": "View3D > Mesh > Vertices (CTRL V-key)",
-    "description": "Slide a vertex along an edge or a line",
-    "warning": "Work only with Blender 2.62 or higher",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Modeling/Vertex_Slide2",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=27561",
-    "category": "Mesh"}
-
-#***********************************************************************
-#ver. 1.0.0: -First version
-#ver. 1.0.1: -Now the mouse wheel select in continuos mode the next vertex
-#            -Add a marker for the vertex to move
-#ver. 1.0.2: -Add check for vertices not selected
-#            -Some cleanup
-#ver. 1.0.3: -Now the movement is proportional to the mouse movement
-#             1/10 of the distance between 2 points for every pixel
-#             mouse movement (1/100 with SHIFT)
-#ver. 1.0.4: all coordinate as far as possible replaced by vectors
-#            view3d_utils are used to define length of an edge on screen!
-#            partial simplified logic by PKHG
-#ver. 1.0.6: Restore continuous slide, code cleanup
-#            Correct the crash with not linked vertex
-#ver. 1.0.7: Restore shift, and some code cleanup
-#ver. 1.0.8: Restore 2 type of sliding with 2 vertex selected
-#ver. 1.0.9: Fix for reverse vector multiplication
-#ver. 1.1.0: Delete debug info, some cleanup and add some comments
-#ver. 1.1.1: Now UNDO work properly
-#ver. 1.1.2: Refactory and some clean of the code.
-#            Add edge drawing (from chromoly vertex slide)
-#            Add help on screen (from chromooly vertex slide)
-#ver. 1.1.3: Now work also with Continuos Grab, some clean on code
-#ver. 1.1.4: Remove a lot of mode switching in Invoke. It was too slow 
-#            with big mesh.
-#ver. 1.1.5: Changed Lay out of the Help and the Key for reverse the 
-#            movement. Left/Right arrow rather than Pus/Minus numpad
-#ver. 1.1.6: Now the vertex movement is always coherent with Mouse movement
-#ver. 2.0.0: Update to Bmesh and remove all mode switching
-#ver. 2.0.1: Replaced Conv3DtoScreen2D function with location_3d_to_region_2d
-#ver. 2.0.2: Fix crash if there are some duplicate vertices
-#***********************************************************************
-
-import bpy
-import bmesh
-import bgl
-import blf
-from mathutils import Vector
-from bpy_extras.view3d_utils import location_3d_to_region_2d as loc3d2d
-
-# Equation of the line
-# Changing t we have a new point coordinate on the line along v0 v1
-# With t from 0 to 1  I move from v0 to v1
-def NewCoordinate(v0, v1, t):
-    return v0 + t * (v1 - v0)
-    
-#  This class store Vertex data
-class Point():
-    def __init__(self):
-        self.original = self.Vertex()  # Original position
-        self.new = self.Vertex()  # New position
-        self.t = 0  # Used for move the vertex
-        self.x2D = 0  # Screen 2D cooord of the point
-        self.y2D = 0  # Screen 2D cooord of the point
-        self.selected = False
-
-    class Vertex():
-        def __init__(self):
-            self.co = None
-            self.idx = None
-            
-class BVertexSlideOperator(bpy.types.Operator):
-    bl_idname = "vertex.slide"
-    bl_label = "Vertex Slide"
-    bl_options = {'REGISTER', 'UNDO', 'GRAB_POINTER', 'BLOCKING', 'INTERNAL'}
-
-    Vertex1 = Point()  # First selected vertex data
-    LinkedVertices1 = []  # List of index of linked verts of Vertex1
-    Vertex2 = Point()  # Second selected vertex data
-    LinkedVertices2 = []  # List of index of linked verts of Vertex2
-    ActiveVertex = None  # Index of vertex to be moved
-    tmpMouse_x = 0
-    tmpMouse = Vector((0, 0))
-    Direction = 1.0  # Used for direction and precision of the movement
-    FirstVertexMove = True  # If true move the first vertex
-    VertLinkedIdx = 0  # Index of LinkedVertices1. Used only for 1 vertex select case
-    LeftAltPress = False  # Flag to know if ALT is hold on
-    LeftShiftPress = False  # Flag to know if SHIFT is hold on
-    obj = None  # Object
-    mesh = None  # Mesh
-    bm = None  # BMesh
-
-    # OpenGL Function to draw on the screen help and pointer *
-    def draw_callback_px(self, context):
-        x, y = loc3d2d(context.region, context.space_data.region_3d, self.bm.verts[self.ActiveVertex].co)
-
-        # Draw an * at the active vertex
-        blf.position(0, x, y, 0)
-        blf.size(0, 26, 72)
-        blf.draw(0, "*")
-
-        #Draw Help
-        yPos=30
-        blf.size(0, 11, context.user_preferences.system.dpi)
-        txtHelp1 = "{SHIFT}:Precision"
-        txtHelp2 = "{WHEEL}:Change the vertex/edge"
-        txtHelp3 = "{ALT}:Continuos slide"
-        txtHelp4 = "{LEFT ARROW}:Reverse the movement"
-        txtHelp5 = "{RIGHT ARROW}:Restore the movement"
-        blf.position(0, 70, yPos, 0)
-        blf.draw(0, txtHelp5)
-        yPos += (int(blf.dimensions(0, txtHelp4)[1]*2))
-        blf.position(0 , 70, yPos, 0)
-        blf.draw(0, txtHelp4)
-        yPos += (int(blf.dimensions(0, txtHelp3)[1]*2))
-        blf.position(0 , 70, yPos, 0)
-        blf.draw(0, txtHelp3)
-        yPos += (int(blf.dimensions(0, txtHelp2)[1]*2))
-        blf.position(0 , 70, yPos, 0)
-        blf.draw(0, txtHelp2)
-        yPos += (int(blf.dimensions(0, txtHelp1)[1]*2))
-        blf.position(0 , 70, yPos, 0)
-        blf.draw(0, txtHelp1)
-
-        # Draw edge
-        bgl.glEnable(bgl.GL_BLEND)
-        bgl.glColor4f(1.0, 0.1, 0.8, 1.0)
-        bgl.glBegin(bgl.GL_LINES)
-        for p in self.LinkedVertices1:
-            bgl.glVertex2f(self.Vertex1.x2D, self.Vertex1.y2D)
-            bgl.glVertex2f(p.x2D, p.y2D)
-        for p in self.LinkedVertices2:
-            bgl.glVertex2f(self.Vertex2.x2D, self.Vertex2.y2D)
-            bgl.glVertex2f(p.x2D, p.y2D)
-        bgl.glEnd()
-
-    # Compute the screen distance of two vertices
-    def ScreenDistance(self, vertex_zero_co, vertex_one_co):
-        matw = bpy.context.active_object.matrix_world
-        V0 = matw * vertex_zero_co
-        res0 = loc3d2d(bpy.context.region, bpy.context.space_data.region_3d, V0)
-        V1 = matw * vertex_one_co
-        res1 = loc3d2d(bpy.context.region, bpy.context.space_data.region_3d, V1)
-        result = (res0 - res1).length
-        return result
-
-    def modal(self, context, event):
-        if event.type == 'MOUSEMOVE':
-            Vertices = self.bm.verts
-            # Calculate the temp t value. Stored in td
-            tmpMouse = Vector((event.mouse_x, event.mouse_y))
-            t_diff = (tmpMouse - self.tmpMouse).length
-            self.tmpMouse = tmpMouse
-            if self.Vertex2.original.idx is not None: # 2 vertex selected
-                td = t_diff * self.Direction / self.ScreenDistance(self.Vertex1.original.co,
-                                                                   self.Vertex2.original.co)
-            else:  # 1 vertex selected
-                td = t_diff * self.Direction / self.ScreenDistance(self.Vertex1.original.co,
-                                                                   self.LinkedVertices1[self.VertLinkedIdx].original.co)
-            if event.mouse_x < self.tmpMouse_x:
-                td = -td
-
-            if self.Vertex2.original.idx is not None: # 2 vertex selected
-                # Calculate the t valuse
-                if self.FirstVertexMove:
-                    self.Vertex1.t = self.Vertex1.t + td
-                else:
-                    self.Vertex2.t = self.Vertex2.t + td
-                # Move the vertex
-                Vertices[self.Vertex1.original.idx].co = NewCoordinate(self.Vertex1.original.co,
-                                                                       self.Vertex2.original.co,
-                                                                       self.Vertex1.t)
-                Vertices[self.Vertex2.original.idx].co = NewCoordinate(self.Vertex2.original.co,
-                                                                       self.Vertex1.original.co,
-                                                                       self.Vertex2.t)
-            else:  # 1 vertex selected
-                if self.LeftAltPress:  # Continuous slide
-                    # Calculate the t valuse
-                    self.Vertex2.t = self.Vertex2.t + td
-                    # Move the vertex
-                    Vertices[self.Vertex1.original.idx].co = NewCoordinate(self.Vertex2.original.co,
-                                                                           self.LinkedVertices1[self.VertLinkedIdx].original.co,
-                                                                           self.Vertex2.t)
-                else:
-                    # Calculate the t valuse
-                    self.LinkedVertices1[self.VertLinkedIdx].t = self.LinkedVertices1[self.VertLinkedIdx].t + td
-                    # Move the vertex
-                    Vertices[self.Vertex1.original.idx].co = NewCoordinate(self.Vertex1.original.co,
-                                                                           self.LinkedVertices1[self.VertLinkedIdx].original.co,
-                                                                           self.LinkedVertices1[self.VertLinkedIdx].t)
-                self.ActiveVertex = self.Vertex1.original.idx
-            self.tmpMouse_x = event.mouse_x
-            context.area.tag_redraw()
-
-        elif event.type == 'LEFT_SHIFT':  # Hold left SHIFT for precision
-            self.LeftShiftPress = not self.LeftShiftPress
-            if self.LeftShiftPress:
-                self.Direction *= 0.1
-            else:
-                if self.Direction < 0:
-                    self.Direction = -1
-                else:
-                    self.Direction = 1
-
-        elif event.type == 'LEFT_ALT':  # Hold ALT to use continuous slide
-            self.LeftAltPress = not self.LeftAltPress
-            if self.LeftAltPress and self.Vertex2.original.idx is None:
-                vert = self.bm.verts[self.Vertex1.original.idx]
-                self.Vertex2.original.co = Vector((vert.co.x, vert.co.y, vert.co.z))
-                self.Vertex2.t = 0
-
-        elif event.type == 'LEFT_ARROW':  # Reverse direction
-            if self.Direction < 0.0:
-                self.Direction = - self.Direction
-
-        elif event.type == 'RIGHT_ARROW':  # Restore direction
-            if self.Direction > 0.0:
-                self.Direction = - self.Direction
-
-        elif event.type == 'WHEELDOWNMOUSE':  # Change the vertex to be moved
-            if self.Vertex2.original.idx is None:
-                if self.LeftAltPress:
-                    vert=self.bm.verts[self.Vertex1.original.idx]
-                    self.Vertex2.original.co = Vector((vert.co.x, vert.co.y, vert.co.z))
-                    self.Vertex2.t = 0
-                self.VertLinkedIdx = self.VertLinkedIdx + 1
-                if self.VertLinkedIdx > len(self.LinkedVertices1) - 1:
-                    self.VertLinkedIdx = 0
-                bpy.ops.mesh.select_all(action='DESELECT')
-                self.bm.verts[self.Vertex1.original.idx].select = True
-                self.bm.verts[self.LinkedVertices1[self.VertLinkedIdx].original.idx].select = True
-            else:
-                self.FirstVertexMove = not self.FirstVertexMove
-                if self.LeftAltPress == False:
-                    self.Vertex1.t = 0
-                    self.Vertex2.t = 0
-                if self.FirstVertexMove:
-                    self.ActiveVertex = self.Vertex1.original.idx
-                else:
-                    self.ActiveVertex = self.Vertex2.original.idx
-            # Keep Vertex movement coherent with Mouse movement
-            if self.Vertex2.original.idx is not None:
-                if self.FirstVertexMove: 
-                    tmpX1, tmpY1 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex1.original.co)
-                    tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex2.original.co)
-                    if ((tmpX1 > tmpX2 and self.Direction >= 0) or (tmpX2 > tmpX1 and self.Direction >= 0)):
-                        self.Direction = -self.Direction
-                else:
-                    tmpX1, tmpY1 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex2.original.co)
-                    tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex1.original.co)
-                    if (tmpX1 < tmpX2 and self.Direction < 0) or (tmpX2 < tmpX1 and self.Direction >= 0):
-                        self.Direction = -self.Direction
-            else:
-                tmpX1, tmpY1 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex1.original.co)
-                tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.LinkedVertices1[self.VertLinkedIdx].original.co)
-                if ((tmpX1 > tmpX2 and self.Direction >= 0) or (tmpX2 > tmpX1 and self.Direction < 0)):
-                    self.Direction = -self.Direction
-            context.area.tag_redraw()
-
-        elif event.type == 'WHEELUPMOUSE':  # Change the vertex to be moved
-            if self.Vertex2.original.idx is None:
-                if self.LeftAltPress:
-                    vert = self.bm.verts[self.Vertex1.original.idx]
-                    self.Vertex2.original.co = Vector((vert.co.x, vert.co.y, vert.co.z))
-                    self.Vertex2.t = 0
-                self.VertLinkedIdx = self.VertLinkedIdx - 1
-                if self.VertLinkedIdx < 0:
-                    self.VertLinkedIdx = len(self.LinkedVertices1) - 1
-                bpy.ops.mesh.select_all(action='DESELECT')
-                self.bm.verts[self.Vertex1.original.idx].select = True
-                self.bm.verts[self.LinkedVertices1[self.VertLinkedIdx].original.idx].select = True
-            else:
-                self.FirstVertexMove = not self.FirstVertexMove
-                if self.LeftAltPress == False:
-                    self.Vertex1.t = 0
-                    self.Vertex2.t = 0
-                if self.FirstVertexMove:
-                    self.ActiveVertex = self.Vertex1.original.idx
-                else:
-                    self.ActiveVertex = self.Vertex2.original.idx
-            # Keep Vertex movement coherent with Mouse movement
-            if self.Vertex2.original.idx is not None:
-                if self.FirstVertexMove: 
-                    tmpX1, tmpY1 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex1.original.co)
-                    tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex2.original.co)
-                    if ((tmpX1 > tmpX2 and self.Direction >= 0) or (tmpX2 > tmpX1 and self.Direction >= 0)):
-                        self.Direction = -self.Direction
-                else:
-                    tmpX1, tmpY1 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex2.original.co)
-                    tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex1.original.co)
-                    if (tmpX1 < tmpX2 and self.Direction < 0) or (tmpX2 < tmpX1 and self.Direction >= 0):
-                        self.Direction = -self.Direction
-            else:
-                tmpX1, tmpY1 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex1.original.co)
-                tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.LinkedVertices1[self.VertLinkedIdx].original.co)
-                if ((tmpX1 > tmpX2 and self.Direction >= 0) or (tmpX2 > tmpX1 and self.Direction < 0)):
-                    self.Direction = -self.Direction
-            context.area.tag_redraw()
-
-        elif event.type == 'LEFTMOUSE':  # Confirm and exit
-            Vertices = self.bm.verts
-            bpy.ops.mesh.select_all(action='DESELECT')
-            Vertices[self.Vertex1.original.idx].select = True
-            if self.Vertex2.original.idx is not None:
-                Vertices[self.Vertex2.original.idx].select = True
-            context.region.callback_remove(self._handle)
-            context.area.tag_redraw()
-            return {'FINISHED'}
-
-        elif event.type in {'RIGHTMOUSE', 'ESC'}:  # Restore and exit
-            Vertices = self.bm.verts
-            bpy.ops.mesh.select_all(action='DESELECT')
-            Vertices[self.Vertex1.original.idx].co = self.Vertex1.original.co
-            Vertices[self.Vertex1.original.idx].select = True
-            if self.Vertex2.original.idx is not None:
-                Vertices[self.Vertex2.original.idx].co = self.Vertex2.original.co
-                Vertices[self.Vertex2.original.idx].select = True
-            context.region.callback_remove(self._handle)
-            context.area.tag_redraw()
-            return {'CANCELLED'}
-
-        return {'RUNNING_MODAL'}
-
-    def invoke(self, context, event):
-        if context.active_object == None or context.active_object.type != "MESH":
-            self.report({'WARNING'}, "Not any active object or not an mesh object:")
-            return {'CANCELLED'}
-
-        if context.active_object.mode != 'EDIT':
-            self.report({'WARNING'}, "Mesh isn't in Edit Mode")
-            return {'CANCELLED'}
-        
-        self.obj = bpy.context.object
-        self.mesh = self.obj.data
-        self.bm = bmesh.from_edit_mesh(self.mesh)
-
-        Count=0
-        Selected=False
-        SelectedVertices = []  # Index of selected vertices
-        for i, v in enumerate(self.bm.verts):
-            if v.select and v.is_valid:
-                SelectedVertices.append(v.index)
-                Selected = True
-                Count += 1 
-                if (Count > 2):  # More than 2 vertices selected
-                    Selected = False
-                    break
-
-        if Selected == False:
-            self.report({'WARNING'}, "0 or more then 2 vertices selected, could not start")
-            return {'CANCELLED'}
-
-        self.tmpMouse[0], self.tmpMouse[1] = (event.mouse_x, event.mouse_y)
-        self.tmpMouse_x = self.tmpMouse[0]
-
-        self.Vertex1 = Point()
-        self.Vertex2 = Point()
-        self.LinkedVertices1 = []
-        self.LinkedVertices2 = []
-
-        # Store selected vertices data. To move in the first Loop
-        self.Vertex1.original.idx = SelectedVertices[0]
-        self.Vertex1.original.co = self.bm.verts[SelectedVertices[0]].co.copy()
-        self.Vertex1.new = self.Vertex1.original
-        x, y = loc3d2d(context.region, context.space_data.region_3d, self.bm.verts[SelectedVertices[0]].co)  # For draw edge
-        self.Vertex1.x2D = x
-        self.Vertex1.y2D = y
-        if len(SelectedVertices) == 2:
-            self.Vertex2.original.idx = SelectedVertices[1]
-            self.Vertex2.original.co = self.bm.verts[SelectedVertices[1]].co.copy()
-            self.Vertex2.new = self.Vertex2.original
-            x, y = loc3d2d(context.region, context.space_data.region_3d, self.bm.verts[SelectedVertices[1]].co)  # For draw edge
-            self.Vertex2.x2D = x
-            self.Vertex2.y2D = y
-
-        if len(SelectedVertices) == 2:
-            self.bm.verts[self.Vertex2.original.idx].select = False  # Unselect the second selected vertex
-
-        # Store linked vertices data, except the selected vertices
-        for i, vert in enumerate(self.bm.verts[self.Vertex1.original.idx].link_edges):
-            self.LinkedVertices1.append(Point())
-            self.LinkedVertices1[-1].original.idx = vert.other_vert(self.bm.verts[self.Vertex1.original.idx]).index   #e_0.other_vert(v_0).index
-            self.LinkedVertices1[-1].original.co = vert.other_vert(self.bm.verts[self.Vertex1.original.idx]).co.copy()
-            self.LinkedVertices1[-1].new = self.LinkedVertices1[-1].original
-            x, y = loc3d2d(context.region, context.space_data.region_3d, vert.other_vert(self.bm.verts[self.Vertex1.original.idx]).co)  # For draw edge
-            self.LinkedVertices1[-1].x2D = x
-            self.LinkedVertices1[-1].y2D = y
-        if len(SelectedVertices) == 2:
-            for i, vert in enumerate(self.bm.verts[self.Vertex2.original.idx].link_edges):
-                self.LinkedVertices2.append(Point())
-                self.LinkedVertices2[-1].original.idx = vert.other_vert(self.bm.verts[self.Vertex2.original.idx]).index
-                self.LinkedVertices2[-1].original.co = vert.other_vert(self.bm.verts[self.Vertex2.original.idx]).co.copy()
-                self.LinkedVertices2[-1].new = self.LinkedVertices1[-1].original
-                x, y = loc3d2d(context.region, context.space_data.region_3d, vert.other_vert(self.bm.verts[self.Vertex2.original.idx]).co)  # For draw edge
-                self.LinkedVertices2[-1].x2D = x
-                self.LinkedVertices2[-1].y2D = y
-
-        # Check for no linked vertex. Can be happen also with a mix of Select Mode
-        # Need only with 1 vertex selected
-        if len(SelectedVertices) == 1 and len(self.LinkedVertices1) == 0:
-            self.report({'WARNING'}, "Isolated vertex or mixed Select Mode!")
-            return {'CANCELLED'}
-        # Check for duplicate vertices. If some linked vertice have the same coords of selected vertice
-        # we have the error "division by 0
-        if self.Vertex1.original.co == self.Vertex2.original.co:
-            self.report({'WARNING'}, "At least one duplicate vertex")
-            return {'CANCELLED'}
-            
-        self.bm.verts[self.Vertex1.original.idx].select = True  # Select the first selected vertex
-        if len(SelectedVertices) == 2:
-            self.bm.verts[self.Vertex2.original.idx].select = True  # Select the second selected vertex
-        else:
-            self.bm.verts[self.LinkedVertices1[0].original.idx].select = True  # Select the first linked vertex
-        self.ActiveVertex = self.Vertex1.original.idx
-
-        # Keep Vertex movement coherent with Mouse movement
-        tmpX1, tmpY1 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex1.original.co)
-        if len(SelectedVertices) == 2:
-            tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.Vertex2.original.co)
-        else:
-            tmpX2, tmpY2 = loc3d2d(context.region, context.space_data.region_3d, self.LinkedVertices1[0].original.co)
-        if tmpX2 - tmpX1 < 0:
-            self.Direction = -self.Direction
-
-        context.area.tag_redraw()  # Force the redraw of the 3D View
-
-        # Add the region OpenGL drawing callback
-        # draw in view space with 'POST_VIEW' and 'PRE_VIEW'
-        self._handle = context.region.callback_add(self.__class__.draw_callback_px, (self, context), 'POST_PIXEL')
-        context.window_manager.modal_handler_add(self)
-        return {'RUNNING_MODAL'}
-
-def menu_func(self, context):
-    self.layout.operator_context = "INVOKE_DEFAULT"
-    self.layout.operator(BVertexSlideOperator.bl_idname, text="Vertex Slide Bmesh")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.VIEW3D_MT_edit_mesh_vertices.prepend(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(menu_func)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/node_categories/__init__.py b/release/scripts/addons_contrib/node_categories/__init__.py
deleted file mode 100644
index 815bdd4..0000000
--- a/release/scripts/addons_contrib/node_categories/__init__.py
+++ /dev/null
@@ -1,505 +0,0 @@
-#
-# Copyright 2011, Blender Foundation.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Node Categories",
-    "author": "Lukas Toenne",
-    "blender": (2, 64, 0),
-    "location": "Node editor toolbar",
-    "description": "Panels for adding nodes, sorted by category",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Node_Categories",
-    "tracker_url": "",
-    "support": "TESTING",
-    "category": "Nodes"}
-
-import bpy
-from bpy.types import PropertyGroup, Panel, Operator, Menu
-from bpy.props import CollectionProperty, PointerProperty, StringProperty, BoolProperty, EnumProperty, IntProperty
-from bl_operators.node import NodeAddOperator
-
-
-# Types
-
-# Get an iterator over all actual node classes
-def gen_node_subclasses(base):
-    for nodeclass in base.__subclasses__():
-        # get_node_type used to distinguish base classes from actual node type classes
-        if hasattr(nodeclass, 'get_node_type'):
-            yield nodeclass
-        # call recursively for subclasses
-        for subclass in gen_node_subclasses(nodeclass):
-            yield subclass
-
-
-# Enum items callback to get a list of possible node types from context.
-# Used for both the node item and operator properties.
-# self argument is unused, can be None
-def node_type_items(self, context):
-    node_tree = context.space_data.edit_tree
-
-    # XXX In customnodes branch, node will use a poll function to determine possible types in the context tree.
-    # For now just use a poll function based on node subclass base
-    if node_tree.type == 'SHADER':
-        poll = lambda nodeclass: issubclass(nodeclass, bpy.types.ShaderNode) or issubclass(nodeclass, bpy.types.SpecialNode)
-    elif node_tree.type == 'COMPOSITING':
-        poll = lambda nodeclass: issubclass(nodeclass, bpy.types.CompositorNode) or issubclass(nodeclass, bpy.types.SpecialNode)
-    elif node_tree.type == 'TEXTURE':
-        poll = lambda nodeclass: issubclass(nodeclass, bpy.types.TextureNode) or issubclass(nodeclass, bpy.types.SpecialNode)
-
-    return [(nc.get_node_type(), nc.bl_rna.name, nc.bl_rna.description) for nc in gen_node_subclasses(bpy.types.Node) if (poll is None) or poll(nc)]
-
-
-node_class_dict = { nc.get_node_type() : nc for nc in set(gen_node_subclasses(bpy.types.Node)) }
-
-
-class NodeCategoryItemSetting(PropertyGroup):
-    value = StringProperty(name="Value", description="Initial value to assign to the node property")
-
-bpy.utils.register_class(NodeCategoryItemSetting)
-
-
-class NodeCategoryItem(PropertyGroup):
-    def node_type_update(self, context):
-        # convenience feature: reset to default label when changing the node type
-        # XXX might be better to check if the label has actually been modified?
-        self.label = node_class_dict[self.node_type].bl_rna.name
-
-    node_type = EnumProperty(name="Node Type", description="Node type identifier", items=node_type_items, update=node_type_update)
-    label = StringProperty(name="Label")
-
-    settings = CollectionProperty(name="Settings", description="Initial settings of the node", type=NodeCategoryItemSetting)
-
-    # internal edit values
-    edit = BoolProperty(name="Edit", description="Toggle edit mode of this item", default=False) # only used when general category edit is on
-
-bpy.utils.register_class(NodeCategoryItem)
-
-
-def node_category_update_name(self, context):
-    wm = context.window_manager
-    if self.panel_type:
-        unregister_node_panel(self)
-        register_node_panel(self)
-
-class NodeCategory(PropertyGroup):
-    type_items = [
-        ("SHADER", "Shader", "Shader node category"),
-        ("TEXTURE", "Texture", "Texture node category"),
-        ("COMPOSITING", "Compositing", "Compositing node category"),
-        ]
-
-    name = StringProperty(name="Name", update=node_category_update_name)
-    type = EnumProperty(name="Type", description="Category type used to check visibility", items=type_items)
-    items = CollectionProperty(name="Items", description="Node items in this category", type=NodeCategoryItem)
-
-    panel_type = StringProperty(name="Panel Type", description="Identifier of the associated panel type")
-
-bpy.utils.register_class(NodeCategory)
-
-
-# XXX window manager properties don't seem to be saved and reloaded, using Scene for now ...
-#bpy.types.WindowManager.node_categories = CollectionProperty(type=NodeCategory)
-#bpy.types.WindowManager.node_categories_edit = BoolProperty(name="Edit Node Categories", default=False)
-bpy.types.Scene.node_categories = CollectionProperty(type=NodeCategory)
-bpy.types.Scene.node_categories_edit = BoolProperty(name="Edit Node Categories", default=False)
-
-
-
-# Panels & Menus
-
-class NodePanel():
-    bl_space_type = 'NODE_EDITOR'
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        space = context.space_data
-        return space.edit_tree
-
-
-class NODE_MT_category_add_node_type(Menu):
-    '''Select a node type'''
-    bl_label = "Node Type"
-
-    def draw(self, context):
-        layout = self.layout
-        node_tree = context.space_data.edit_tree
-        node_types = node_type_items(None, context)
-
-        for nt in node_types:
-            identifier = nt[0]
-            name = nt[1]
-
-            op = layout.operator("node.category_add_item", text=name)
-            op.node_type = identifier
-            op.label = name
-
-
-class NODE_MT_category_add_setting(Menu):
-    '''Select a node setting'''
-    bl_label = "Node Setting"
-
-    def draw(self, context):
-        layout = self.layout
-
-        for prop in bpy.types.Node.bl_rna.properties:
-            if prop.is_hidden or prop.is_readonly:
-                continue
-
-            op = layout.operator("node.category_add_setting", text=prop.name)
-            op.setting = prop.identifier
-
-        layout.separator()
-
-        layout.operator("node.category_add_setting", text="Custom ...")
-        # op.setting is undefined, so the operator opens a popup to get it
-
-
-def gen_valid_identifier(seq):
-    # get an iterator
-    itr = iter(seq)
-    # pull characters until we get a legal one for first in identifer
-    for ch in itr:
-        if ch == '_' or ch.isalpha():
-            yield ch
-            break
-    # pull remaining characters and yield legal ones for identifier
-    for ch in itr:
-        if ch == '_' or ch.isalpha() or ch.isdigit():
-            yield ch
-
-
-def get_unique_identifier(prefix, name):
-    base = prefix + ''.join(gen_valid_identifier(name))
-
-    identifier = base
-    index = 1
-    while hasattr(bpy.types, identifier):
-        identifier = base + str(index)
-        index += 1
-
-    return identifier
-
-
-def register_node_panel(_category):
-    identifier = get_unique_identifier("NODE_PT_category_", _category.name)
-
-    @classmethod
-    def panel_poll(cls, context):
-        space = context.space_data
-        category = context.scene.node_categories[cls.category]
-        return space.tree_type == category.type
-
-    def panel_draw_header(self, context):
-        layout = self.layout
-        category = context.scene.node_categories[self.category]
-        edit = context.scene.node_categories_edit
-
-        if edit:
-            row = layout.row()
-            row.prop(category, "name", text="")
-            op = row.operator("node.remove_category", text="", icon='X')
-            op.category_name = self.category
-
-    def panel_draw(self, context):
-        layout = self.layout
-        category = context.scene.node_categories[self.category]
-        edit = context.scene.node_categories_edit
-
-        layout.context_pointer_set("node_category", category)
-
-        if edit:
-            for index, item in enumerate(category.items):
-                layout.context_pointer_set("node_category_item", item)
-
-                if item.edit:
-                    row = layout.row(align=True)
-                    row.prop(item, "edit", icon='TRIA_DOWN', text="", icon_only=True, toggle=True)
-
-                    box = row.box()
-
-                    sub = box.row(align=True)
-                    sub.prop(item, "label", text="")
-                    op = sub.operator("node.category_remove_item", text="", icon='X')
-                    op.index = index
-
-                    box.prop_menu_enum(item, "node_type", text="Node: "+node_class_dict[item.node_type].bl_rna.name, icon='NODE')
-
-                    for setting_index, setting in enumerate(item.settings):
-                        row = box.row(align=True)
-                        row.label(text=setting.name + " = ")
-                        row.prop(setting, "value", text="")
-
-                        op = row.operator("node.category_remove_setting", text="", icon='X')
-                        op.index = setting_index
-
-                    box.menu("NODE_MT_category_add_setting", text="Add Setting", icon='ZOOMIN')
-                else:
-                    row = layout.row(align=True)
-                    row.prop(item, "edit", icon='TRIA_RIGHT', text="", icon_only=True, toggle=True)
-                    row.label(text=item.label)
-
-            layout.menu("NODE_MT_category_add_node_type", text="Add Node", icon='ZOOMIN')
-        else:
-            for item in category.items:
-                layout.context_pointer_set("node_category_item", item)
-
-                row = layout.row(align=True)
-                row.operator("node.category_add_node", text=item.label)
-
-    panel_class_dict = {
-        'category' : ''.join(_category.name), # careful here! category can be removed, needs a deep string copy!
-        'bl_idname' : identifier,
-        'bl_label' : ''.join(_category.name),
-        'poll' : panel_poll,
-        'draw_header' : panel_draw_header,
-        'draw' : panel_draw,
-        }
-    panel_class = type(identifier, (NodePanel, Panel), panel_class_dict)
-
-    _category.panel_type = identifier
-    bpy.utils.register_class(panel_class)
-
-def register_all_node_panels(context):
-    categories = context.scene.node_categories
-    for cat in categories:
-        register_node_panel(cat)
-
-
-def unregister_node_panel(category):
-    panel_type_identifier = getattr(category, "panel_type", None)
-    if panel_type_identifier:
-        panel_type = getattr(bpy.types, panel_type_identifier, None)
-        if panel_type:
-            bpy.utils.unregister_class(panel_type)
-        category.panel_type = ""
-
-def unregister_all_node_panels(context):
-    categories = context.scene.node_categories
-    for cat in categories:
-        unregister_node_panel(cat)
-
-
-class NODE_PT_categories(NodePanel, Panel):
-    bl_label = "Categories"
-    bl_options = {'HIDE_HEADER'}
-
-    def draw(self, context):
-        layout = self.layout
-        scene = context.scene
-        edit = scene.node_categories_edit
-
-        layout.prop(scene, "node_categories_edit", text="Edit", toggle=True)
-        if edit:
-            layout.operator("node.add_category", text="Add Category")
-
-
-# Operators
-
-class NodeOperator():
-    @classmethod
-    def poll(cls, context):
-        space = context.space_data
-        # needs active node editor and a tree
-        return (space.type == 'NODE_EDITOR' and space.edit_tree)
-
-
-class NODE_OT_add_category(NodeOperator, Operator):
-    '''Create a new node category'''
-    bl_idname = "node.add_category"
-    bl_label = "Add Node Category"
-    bl_options = {'UNDO'}
-
-    category_name = StringProperty(name="Category Name", description="Name of the new node category")
-
-    def execute(self, context):
-        categories = context.scene.node_categories
-
-        # cancel if name is already registered
-        if self.category_name in categories.keys():
-            self.report({'ERROR'}, "Node category "+self.category_name+" is already registered")
-            return {'CANCELLED'}
-
-        cat = categories.add()
-        cat.name = self.category_name
-        cat.type = context.space_data.tree_type
-        register_node_panel(cat)
-
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.window_manager
-        return wm.invoke_props_dialog(self)
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, "category_name", text="Name")
-
-
-class NODE_OT_remove_category(NodeOperator, Operator):
-    '''Remove a node category'''
-    bl_idname = "node.remove_category"
-    bl_label = "Remove Node Category"
-    bl_options = {'UNDO'}
-
-    category_name = StringProperty(name="Category Name", description="Name of the node category")
-
-    def execute(self, context):
-        categories = context.scene.node_categories
-
-        # cancel if name is not registered
-        if not self.category_name in categories.keys():
-            self.report({'ERROR'}, "Node category "+self.category_name+" is not registered")
-            return {'CANCELLED'}
-
-        cat = categories[self.category_name]
-        
-        unregister_node_panel(cat)
-        categories.remove(categories.values().index(cat))
-
-        return {'FINISHED'}
-
-
-class NODE_OT_category_add_item(NodeOperator, Operator):
-    '''Add a node item in a category'''
-    bl_idname = "node.category_add_item"
-    bl_label = "Add Item"
-    bl_options = {'UNDO'}
-
-    node_type = EnumProperty(name="Node Type", description="Node type identifier", items=node_type_items)
-    label = StringProperty(name="Label")
-
-    def execute(self, context):
-        category = context.node_category
-
-        item = category.items.add()
-        item.node_type = self.node_type
-        item.label = self.label
-
-        return {'FINISHED'}
-
-
-class NODE_OT_category_remove_item(NodeOperator, Operator):
-    '''Remove a node item from a category'''
-    bl_idname = "node.category_remove_item"
-    bl_label = "Remove Item"
-    bl_options = {'UNDO'}
-
-    index = IntProperty(name="Index", description="Index of the category item to remove")
-
-    def execute(self, context):
-        category = context.node_category
-        category.items.remove(self.index)
-        return {'FINISHED'}
-
-
-class NODE_OT_category_add_setting(NodeOperator, Operator):
-    '''Define an initial node setting'''
-    bl_idname = "node.category_add_setting"
-    bl_label = "Add Setting"
-    bl_options = {'UNDO', 'REGISTER'}
-
-    setting = StringProperty(name="Setting", description="Name of the node setting")
-
-    def execute(self, context):
-        # set in the invoke function below as a workaround
-        item = self.item
-
-        if self.setting in [setting.name for setting in item.settings]:
-            self.report({'ERROR'}, "Node setting "+self.setting+" already defined")
-            return {'CANCELLED'}
-
-        setting = item.settings.add()
-        setting.name = self.setting
-
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        # XXX workaround for popup invoke: context loses the item pointer during popup,
-        # setting this as a py object in the invoke function is a workaround
-        self.item = context.node_category_item
-
-        if self.properties.is_property_set("setting"):
-            return self.execute(context)
-        else:
-            wm = context.window_manager
-            return wm.invoke_props_popup(self, event)
-
-    def draw(self, context):
-        layout = self.layout
-        layout.prop(self, "setting", text="Name")
-
-
-class NODE_OT_category_remove_setting(NodeOperator, Operator):
-    '''Remove a node setting'''
-    bl_idname = "node.category_remove_setting"
-    bl_label = "Remove Setting"
-    bl_options = {'UNDO'}
-
-    index = IntProperty(name="Index", description="Index of the category item setting to remove")
-
-    def execute(self, context):
-        item = context.node_category_item
-        item.settings.remove(self.index)
-        return {'FINISHED'}
-
-
-# Node Add operator that uses category item settings for additional initialization
-class NODE_OT_category_add_node(NodeAddOperator, Operator):
-    '''Add a node to the active tree and initialize from settings'''
-    bl_idname = "node.category_add_node"
-    bl_label = "Add Node"
-
-    def execute(self, context):
-        item = context.node_category_item
-
-        node = self.create_node(context, item.node_type)
-
-        for setting in item.settings:
-            print("SETTING: ", setting.name, " = ", setting.value)
-
-            # XXX catch exceptions here?
-            value = eval(setting.value)
-                
-            try:
-                setattr(node, setting.name, value)
-            except AttributeError as e:
-                self.report({'ERROR_INVALID_INPUT'}, "Node has no attribute "+setting.name)
-                print (str(e))
-                # Continue despite invalid attribute
-
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        self.store_mouse_cursor(context, event)
-        self.execute(context)
-        return bpy.ops.transform.translate('INVOKE_DEFAULT')
-
-
-def register():
-    register_all_node_panels(bpy.context)
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    unregister_all_node_panels(bpy.context)
-    bpy.utils.unregister_module(__name__)
-
diff --git a/release/scripts/addons_contrib/object_batch_rename_datablocks.py b/release/scripts/addons_contrib/object_batch_rename_datablocks.py
deleted file mode 100644
index 0fde09e..0000000
--- a/release/scripts/addons_contrib/object_batch_rename_datablocks.py
+++ /dev/null
@@ -1,187 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Batch Rename Datablocks",
-    "author": "tstscr",
-    "version": (1, 0),
-    "blender": (2, 59, 0),
-    "location": "Search > (rename)",
-    "description": "Batch renaming of datablocks (e.g. rename materials after objectnames)",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Object/Batch_Rename_Datablocks",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=25242",
-    "category": "Object"}
-
-
-import bpy
-from bpy.props import *
-
-def get_first_material_name(ob):
-    for m_slot in ob.material_slots:
-        if m_slot.material:
-            material_name = m_slot.material.name
-            return material_name
-
-def get_name(self, ob):
-    if self.naming_base == 'Object':
-        return ob.name
-    
-    if self.naming_base == 'Mesh':
-        if ob.data: return ob.data.name
-        else: return ob.name
-    
-    if self.naming_base == 'Material':
-        material_name = get_first_material_name(ob)
-        if not material_name: return ob.name
-        else: return material_name
-
-    if self.naming_base == 'Custom':
-        return self.rename_custom
-    
-    
-def rename_datablocks_main(self, context):
-    obs = context.selected_editable_objects
-    for ob in obs:
-        name = get_name(self, ob)
-        
-        if self.rename_object:
-            if (self.rename_use_prefix
-            and self.prefix_object):
-                ob.name = self.rename_prefix + name
-            else:
-                ob.name = name
-        
-        if self.rename_data:
-            if (ob.data
-            and ob.data.users == 1):
-                if (self.rename_use_prefix
-                and self.prefix_data):
-                    ob.data.name = self.rename_prefix + name
-                else:
-                    ob.data.name = name
-        
-        if self.rename_material:
-            if ob.material_slots:
-                for m_slot in ob.material_slots:
-                    if m_slot.material:
-                        if m_slot.material.users == 1:
-                            if (self.rename_use_prefix
-                            and self.prefix_material):
-                                m_slot.material.name = self.rename_prefix + name
-                            else:
-                                m_slot.material.name = name
-
-class OBJECT_OT_batch_rename_datablocks(bpy.types.Operator):
-    """Batch rename Datablocks"""
-    bl_idname = "object.batch_rename_datablocks"
-    bl_label = "Batch Rename Datablocks"
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    name_origins = [
-                    ('Object', 'Object', 'Object'),
-                    ('Mesh', 'Mesh', 'Mesh'),
-                    ('Material', 'Material', 'Material'),
-                    ('Custom', 'Custom', 'Custom')
-                    ]
-    naming_base = EnumProperty(name='Name after:',
-                                items=name_origins)
-    rename_custom = StringProperty(name='Custom Name',
-                                default='New Name',
-                                description='Rename all with this String')
-    rename_object = BoolProperty(name='Rename Objects',
-                                default=False,
-                                description='Rename Objects')
-    rename_data = BoolProperty(name='Rename Data',
-                                default=True,
-                                description='Rename Object\'s Data')
-    rename_material = BoolProperty(name='Rename Materials',
-                                default=True,
-                                description='Rename Objects\' Materials')
-    rename_use_prefix = BoolProperty(name='Add Prefix',
-                                default=False,
-                                description='Prefix Objectnames with first Groups name')
-    rename_prefix = StringProperty(name='Prefix',
-                                default='',
-                                description='Prefix name with this string')
-    prefix_object = BoolProperty(name='Object',
-                                default=True,
-                                description='Prefix Object Names')
-    prefix_data = BoolProperty(name='Data',
-                                default=True,
-                                description='Prefix Data Names')
-    prefix_material = BoolProperty(name='Material',
-                                default=True,
-                                description='Prefix Material Names')
-
-    dialog_width = 260
-
-    def draw(self, context):
-        layout = self.layout
-        col = layout.column()
-        col.label(text='Rename after:')
-        
-        row = layout.row()
-        row.prop(self.properties, 'naming_base', expand=True)
-        
-        col = layout.column()
-        col.prop(self.properties, 'rename_custom')
-
-        col.separator()
-        col.label('Datablocks to rename:')
-        col.prop(self.properties, 'rename_object')
-        col.prop(self.properties, 'rename_data')
-        col.prop(self.properties, 'rename_material')
-        
-        col.separator()
-        col.prop(self.properties, 'rename_use_prefix')
-        col.prop(self.properties, 'rename_prefix')
-        
-        row = layout.row()
-        row.prop(self.properties, 'prefix_object')
-        row.prop(self.properties, 'prefix_data')
-        row.prop(self.properties, 'prefix_material')
-        
-        col = layout.column()
-        
-    @classmethod
-    def poll(cls, context):
-        return context.selected_objects != None
-
-    def execute(self, context):
-
-        rename_datablocks_main(self, context)
-        
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.window_manager
-        wm.invoke_props_dialog(self, self.dialog_width)
-        return {'RUNNING_MODAL'}
-        
-        
-def register():
-    bpy.utils.register_module(__name__)
-    pass
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    pass
-if __name__ == '__main__':
-    register()
diff --git a/release/scripts/addons_contrib/object_creaprim.py b/release/scripts/addons_contrib/object_creaprim.py
deleted file mode 100644
index bb0c8b1..0000000
--- a/release/scripts/addons_contrib/object_creaprim.py
+++ /dev/null
@@ -1,442 +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.
-#
-# If you have Internet access, you can find the license text at
-# http://www.gnu.org/licenses/gpl.txt,
-# if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-__bpydoc__ = """\
-CreaPrim does what it says. I takes the active object and turns it into an Add Mesh addon.	When you
-enable this, your custom object will be added to the Add->Mesh menu.
-
-
-Documentation
-
-Go to User Preferences->Addons and enable the CreaPrim addon in the Object section.
-First select your object or objects.  The addon will show up in the 3dview properties panel.	
-The name (in panel) will be set to the active object name.	Select "Apply transform" if you
-want transforms to be applied to the selected objects.	Modifiers will taken into account.
-You can always change this. Just hit the button and the selected
-objects will be saved in your addons folder as an Add Mesh addon with the name 
-"add_mesh_XXXX.py" with XXXX being your object name.  The addon will show up in User
-Preferences->Addons in the Add Mesh section.  
-Enable this addon et voila, your new custom primitive will now show up in the Add Mesh menu.
-
-REMARK - dont need to be admin anymore - saves to user scripts dir
-			
-ALSO - dont forget to Apply rotation and scale to have your object show up correctly
-"""
-
-bl_info = {
-    "name": "CreaPrim",
-    "author": "Gert De Roost",
-    "version": (0, 3, 9),
-    "blender": (2, 64, 0),
-    "location": "View3D > Object Tools",
-    "description": "Create primitive addon",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=32801",
-    "category": "Object"}
-
-if "bpy" in locals():
-	import imp
-
-
-import bpy
-import bmesh
-import os
-
-
-started = 0
-oldname = ""
-
-bpy.types.Scene.Name = bpy.props.StringProperty(
-			name="Name",
-			description="name for primitive",
-			maxlen= 1024)
-
-bpy.types.Scene.Apply = bpy.props.BoolProperty(
-		name = "Apply transform", 
-		description = "apply transform to selected objects",
-		default = False)
-
-
-class CreaPrim(bpy.types.Operator):
-	bl_idname = "object.creaprim"
-	bl_label = "CreaPrim"
-	bl_description = "Create primitive addon."
-	bl_options = {"REGISTER"}
-	
-	
-	@classmethod
-	def poll(cls, context):
-		obj = context.active_object
-		return (obj and obj.type == 'MESH' and context.mode == 'OBJECT')
-
-	def invoke(self, context, event):
-		
-		global oldname, groupname, message
-		
-		scn = bpy.context.scene
-				
-		objlist = []
-		for selobj in bpy.context.scene.objects:
-			if selobj.select:
-				objlist.append(selobj)
-				
-		try:
-			direc = bpy.utils.script_paths()[1]
-			scriptdir = 1
-		except:
-			direc = bpy.utils.script_paths()[0]
-			scriptdir = 0
-		if len(objlist) > 1:
-			groupname = scn.Name
-			groupname = groupname.replace(".", "")
-			addondir = direc + os.sep + "addons" + os.sep + "add_mesh_" + groupname + os.sep
-			if not os.path.exists(addondir):
-				os.makedirs(addondir)
-		else:
-			groupname = scn.Name
-			print (bpy.utils.script_paths())
-			addondir = direc + os.sep + "addons" + os.sep
-			print (addondir)
-			if not os.path.exists(addondir):
-				os.makedirs(addondir)
-			
-		actobj = bpy.context.active_object
-		txtlist = []
-		namelist = []
-		for selobj in objlist:
-			if len(objlist) == 1:
-				objname = scn.Name
-			else:
-				objname = selobj.name
-				objname = objname.replace(".", "")
-				namelist.append(objname)
-			mesh = selobj.to_mesh(scn, True, "PREVIEW")
-			oldname = selobj.name
-			scn.objects.active = selobj
-			if scn.Apply:
-				bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
-			txt = do_creaprim(self, mesh, objname, addondir)
-			if txt == 0:
-				return {'CANCELLED'}
-			txtlist.append(txt)
-		oldname = actobj.name
-		scn.objects.active = actobj
-			
-		if len(txtlist) > 1:
-			makeinit(txtlist, namelist, groupname, addondir)
-			bpy.ops.wm.addon_enable(module="add_mesh_" + groupname)
-		else:
-			bpy.ops.wm.addon_enable(module="add_mesh_" + str.lower(objname))
-			
-		if scriptdir == 1:
-			message = "Add Mesh addon " + groupname + " saved to user scripts directory."
-		else:
-			message = "Add Mesh addon " + groupname + " saved to main scripts directory."
-		bpy.ops.creaprim.message('INVOKE_DEFAULT')
-		
-		return {'FINISHED'}
-
-
-class MessageOperator(bpy.types.Operator):
-	bl_idname = "creaprim.message"
-	bl_label = "Saved"
-	 
-	def invoke(self, context, event):
-		wm = context.window_manager
-		return wm.invoke_popup(self, width=500, height=20)
-		return {'FINISHED'}
- 
-	def draw(self, context):
-		
-		global groupname
-		
-		layout = self.layout
-		row = layout.row()
-		row.label(text = '', icon = "PLUGIN")
-		row.label(message)
-		
-def panel_func(self, context):
-	
-	global started
-	
-	scn = bpy.context.scene
-		
-	self.layout.label(text="CreaPrim:")
-	self.layout.operator("object.creaprim", text="Create primitive", icon = 'PLUGIN')
-	self.layout.prop(scn, "Name")
-	self.layout.prop(scn, "Apply")
-
-def register():
-	bpy.utils.register_module(__name__)
-	bpy.types.VIEW3D_PT_tools_objectmode.append(panel_func)
-	bpy.app.handlers.scene_update_post.append(setname)
-	
-def unregister():
-	bpy.utils.unregister_module(__name__)
-	bpy.types.VIEW3D_PT_tools_objectmode.remove(panel_func)
-	bpy.app.handlers.scene_update_post.remove(setname)
-
-if __name__ == "__main__":
-	register()
-
-
-
-
-def do_creaprim(self, mesh, objname, addondir):
-	
-	global message
-	
-	objname = objname.replace(".", "")
-	bm = bmesh.new()
-	bm.from_mesh(mesh)	
-	
-	
-	try:
-		txt = bpy.data.texts[str.lower("add_mesh_" + objname) + ".py"]
-		txt.clear()
-	except:
-		txt = bpy.data.texts.new("add_mesh_" + str.lower(objname) + ".py")
-	
-	strlist = []
-	strlist.append("bl_info = {\n")
-	strlist.append("\"name\": \"" + objname + "\", \n")
-	strlist.append("\"author\": \"Gert De Roost\",\n")
-	strlist.append("\"version\": (1, 0, 0),\n")
-	strlist.append("\"blender\": (2, 65, 0),\n")
-	strlist.append("\"location\": \"Add > Mesh\",\n")
-	strlist.append("\"description\": \"Create " + objname + " primitive.\",\n")
-	strlist.append("\"warning\": \"\",\n")
-	strlist.append("\"wiki_url\": \"\",\n")
-	strlist.append("\"tracker_url\": \"\",\n")
-	strlist.append("\"category\": \"Add Mesh\"}\n")
-	strlist.append("\n")
-	strlist.append("\n") 
-	strlist.append("if \"bpy\" in locals():\n")
-	strlist.append("	   import imp\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("import bpy\n")
-	strlist.append("import bmesh\n")
-	strlist.append("import math\n")
-	strlist.append("from mathutils import *\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("class " + objname + "(bpy.types.Operator):\n")
-	strlist.append("	bl_idname = \"mesh." + str.lower(objname) + "\"\n")
-	strlist.append("	bl_label = \"" + objname + "\"\n")
-	strlist.append("	bl_options = {\'REGISTER\', \'UNDO\'}\n")
-	strlist.append("	bl_description = \"add " + objname + " primitive\"\n")
-	strlist.append("\n")
-	strlist.append("	def invoke(self, context, event):\n")
-	strlist.append("\n")
-	strlist.append("		mesh = bpy.data.meshes.new(name=\"" + objname + "\")\n")
-	strlist.append("		obj = bpy.data.objects.new(name=\"" + objname + "\", object_data=mesh)\n")
-	strlist.append("		scene = bpy.context.scene\n")
-	strlist.append("		scene.objects.link(obj)\n")
-	strlist.append("		obj.location = scene.cursor_location\n")
-	strlist.append("		bm = bmesh.new()\n")
-	strlist.append("		bm.from_mesh(mesh)\n")
-	strlist.append("\n")
-	strlist.append("		idxlist = []\n")
-	posn = 0
-	strlist.append("		vertlist = [")
-	for v in bm.verts:
-		if posn > 0:
-			strlist.append(", ")
-		posn += 1
-		strlist.append(str(v.co[:]))
-	strlist.append("]\n")	
-	strlist.append("		for co in vertlist:\n")
-	strlist.append("			v = bm.verts.new(co)\n")
-	strlist.append("			bm.verts.index_update()\n")
-	strlist.append("			idxlist.append(v.index)\n")
-	posn = 0
-	strlist.append("		edgelist = [")
-	for e in bm.edges:
-		if posn > 0:
-			strlist.append(", ")
-		posn += 1
-		strlist.append("[" + str(e.verts[0].index) + ", " + str(e.verts[1].index) + "]")
-	strlist.append("]\n")	
-	strlist.append("		for verts in edgelist:\n")
-	strlist.append("			bm.edges.new((bm.verts[verts[0]], bm.verts[verts[1]]))\n")
-	posn1 = 0
-	strlist.append("		facelist = [(")
-	for f in bm.faces:
-		if posn1 > 0:
-			strlist.append(", (")
-		posn1 += 1
-		posn2 = 0
-		for v in f.verts:
-			if posn2 > 0:
-				strlist.append(", ")
-			strlist.append(str(v.index))
-			posn2 += 1
-		strlist.append(")")
-	strlist.append("]\n")	
-	strlist.append("		for verts in facelist:\n")
-	strlist.append("			vlist = []\n")	
-	strlist.append("			for idx in verts:\n")	
-	strlist.append("				vlist.append(bm.verts[idxlist[idx]])\n")	
-	strlist.append("			bm.faces.new(vlist)\n")
-	strlist.append("\n")
-	strlist.append("		bm.to_mesh(mesh)\n")
-	strlist.append("		mesh.update()\n")
-	strlist.append("		bm.free()\n")	
-	strlist.append("		obj.rotation_quaternion = (Matrix.Rotation(math.radians(90), 3, \'X\').to_quaternion())\n")
-	strlist.append("\n")
-	strlist.append("		return {\'FINISHED\'}\n")
-		
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n") 
-	strlist.append("def menu_item(self, context):\n")	
-	strlist.append("	   self.layout.operator(" + objname + ".bl_idname, text=\"" + objname + "\", icon=\"PLUGIN\")\n")
-	strlist.append("\n") 
-	strlist.append("def register():\n")
-	strlist.append("	   bpy.utils.register_module(__name__)\n")
-	strlist.append("	   bpy.types.INFO_MT_mesh_add.append(menu_item)\n")
-	strlist.append("\n") 
-	strlist.append("def unregister():\n")
-	strlist.append("	   bpy.utils.unregister_module(__name__)\n")
-	strlist.append("	   bpy.types.INFO_MT_mesh_add.remove(menu_item)\n")
-	strlist.append("\n") 
-	strlist.append("if __name__ == \"__main__\":\n") 
-	strlist.append("	   register()\n")	
-	endstring = ''.join(strlist)
-	txt.write(endstring)
-	
-	try:
-		fileobj = open(addondir + "add_mesh_" + str.lower(objname) + ".py", "w")
-	except:
-		message = "Permission problem - cant write file - run Blender as Administrator!"
-		bpy.ops.creaprim.message('INVOKE_DEFAULT')
-		return 0
-
-	fileobj.write(endstring)
-	fileobj.close()
-	
-	bm.free()
-	
-	return txt
-	
-	
-def makeinit(txtlist, namelist, groupname, addondir):
-	
-	global message
-	
-	try:
-		txt = bpy.data.texts["__init__.py"]
-		txt.clear()
-	except:
-		txt = bpy.data.texts.new("__init__.py")
-	
-	strlist = []
-	strlist.append("bl_info = {\n")
-	strlist.append("\"name\": \"" + groupname + "\", \n")
-	strlist.append("\"author\": \"Gert De Roost\",\n")
-	strlist.append("\"version\": (1, 0, 0),\n")
-	strlist.append("\"blender\": (2, 65, 0),\n")
-	strlist.append("\"location\": \"Add > Mesh\",\n")
-	strlist.append("\"description\": \"Create " + groupname + " primitive group.\",\n")
-	strlist.append("\"warning\": \"\",\n")
-	strlist.append("\"wiki_url\": \"\",\n")
-	strlist.append("\"tracker_url\": \"\",\n")
-	strlist.append("\"category\": \"Add Mesh\"}\n")
-	strlist.append("\n")
-	strlist.append("\n") 
-	strlist.append("if \"bpy\" in locals():\n")
-	strlist.append("	import imp\n")
-	addonlist = []
-	for txt in txtlist:
-		name = txt.name.replace(".py", "")
-		addonlist.append(name)
-	for name in addonlist:
-		strlist.append("	imp.reload(" + name + ")\n")	
-	strlist.append("else:\n")
-	for name in addonlist:
-		strlist.append("	from . import " + name + "\n")	
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("import bpy\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("class INFO_MT_mesh_" + str.lower(groupname) + "_add(bpy.types.Menu):\n")
-	strlist.append("	bl_idname = \"INFO_MT_mesh_" + str.lower(groupname) + "_add\"\n")
-	strlist.append("	bl_label = \"" + groupname + "\"\n")
-	strlist.append("\n")
-	strlist.append("	def draw(self, context):\n")
-	strlist.append("		layout = self.layout\n")
-#		 layout.operator_context = 'INVOKE_REGION_WIN'
-	for name in namelist:
-		strlist.append("		layout.operator(\"mesh." + str.lower(name) + "\", text=\"" + name + "\")\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n")
-	strlist.append("\n") 
-	strlist.append("def menu_item(self, context):\n")	
-	strlist.append("	   self.layout.menu(\"INFO_MT_mesh_" + str.lower(groupname) + "_add\", icon=\"PLUGIN\")\n")
-	strlist.append("\n") 
-	strlist.append("def register():\n")
-	strlist.append("	   bpy.utils.register_module(__name__)\n")
-	strlist.append("	   bpy.types.INFO_MT_mesh_add.append(menu_item)\n")
-	strlist.append("\n") 
-	strlist.append("def unregister():\n")
-	strlist.append("	   bpy.utils.unregister_module(__name__)\n")
-	strlist.append("	   bpy.types.INFO_MT_mesh_add.remove(menu_item)\n")
-	strlist.append("\n") 
-	strlist.append("if __name__ == \"__main__\":\n") 
-	strlist.append("	   register()\n")	
-	endstring = ''.join(strlist)
-	txt.write(endstring)
-	
-	try:
-		fileobj = open(addondir + "__init__.py", "w")
-	except:
-		message = "Permission problem - cant write file - run Blender as Administrator!"
-		bpy.ops.creaprim.message('INVOKE_DEFAULT')
-		return 0
-	fileobj.write(endstring)
-	fileobj.close()
-
-
-
-def setname(dummy):
-	
-	global oldname
-	
-	scn = bpy.context.scene
-	
-	if bpy.context.active_object.name != oldname:
-		scn.Name = bpy.context.active_object.name
-		oldname = scn.Name
-	
-	
-	
-
diff --git a/release/scripts/addons_contrib/object_drop_to_ground.py b/release/scripts/addons_contrib/object_drop_to_ground.py
deleted file mode 100644
index 12333c6..0000000
--- a/release/scripts/addons_contrib/object_drop_to_ground.py
+++ /dev/null
@@ -1,181 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-bl_info = {
-    'name': 'Drop to Ground',
-    'author': 'Unnikrishnan(kodemax), Florian Meyer(testscreenings)',
-    'version': (1,2),
-    "blender": (2, 63, 0),
-    'location': '3D View -> Tool Shelf -> Object Tools Panel (at the bottom)',
-    'description': 'Drop selected objects on active object',
-    'warning': '',
-    'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/Drop_to_ground',
-    "tracker_url": "http://projects.blender.org/tracker/?func=detail&atid=25349",
-    'category': 'Object'}
-#################################################################
-import bpy, bmesh
-from mathutils import *
-from bpy.types import Operator
-from bpy.props import *
-#################################################################
-def get_align_matrix(location, normal):
-    up = Vector((0,0,1))                      
-    angle = normal.angle(up)
-    axis = up.cross(normal)                            
-    mat_rot = Matrix.Rotation(angle, 4, axis) 
-    mat_loc = Matrix.Translation(location)
-    mat_align = mat_rot * mat_loc                      
-    return mat_align
-
-def transform_ground_to_world(sc, ground):
-    tmpMesh = ground.to_mesh(sc, True, 'PREVIEW')
-    tmpMesh.transform(ground.matrix_world)
-    tmp_ground = bpy.data.objects.new('tmpGround', tmpMesh)
-    sc.objects.link(tmp_ground)
-    sc.update()
-    return tmp_ground
-
-def get_lowest_world_co_from_mesh(ob, mat_parent=None):
-    bme = bmesh.new()
-    bme.from_mesh(ob.data)
-    mat_to_world = ob.matrix_world.copy()
-    if mat_parent:
-        mat_to_world = mat_parent * mat_to_world
-    lowest=None
-    #bme.verts.index_update() #probably not needed
-    for v in bme.verts:
-        if not lowest:
-            lowest = v
-        if (mat_to_world * v.co).z < (mat_to_world * lowest.co).z:
-            lowest = v
-    lowest_co = mat_to_world * lowest.co
-    bme.free()
-    return lowest_co
-
-def get_lowest_world_co(context, ob, mat_parent=None):
-    if ob.type == 'MESH':
-        return get_lowest_world_co_from_mesh(ob)
-    
-    elif ob.type == 'EMPTY' and ob.dupli_type == 'GROUP':
-        if not ob.dupli_group:
-            return None
-        
-        else:
-            lowest_co = None
-            for ob_l in ob.dupli_group.objects:
-                if ob_l.type == 'MESH':
-                    lowest_ob_l = get_lowest_world_co_from_mesh(ob_l, ob.matrix_world)
-                    if not lowest_co:
-                        lowest_co = lowest_ob_l
-                    if lowest_ob_l.z < lowest_co.z:
-                        lowest_co = lowest_ob_l
-                        
-            return lowest_co
-
-def drop_objects(self, context):
-    ground = context.object
-    obs = context.selected_objects
-    obs.remove(ground)
-    tmp_ground = transform_ground_to_world(context.scene, ground)
-    down = Vector((0, 0, -10000))
-    
-    for ob in obs:
-        if self.use_origin:
-            lowest_world_co = ob.location
-        else:
-            lowest_world_co = get_lowest_world_co(context, ob)
-        if not lowest_world_co:
-            print(ob.type, 'is not supported. Failed to drop', ob.name)
-            continue
-        hit_location, hit_normal, hit_index = tmp_ground.ray_cast(lowest_world_co,
-                                                                  lowest_world_co + down)
-        if hit_index == -1:
-            print(ob.name, 'didn\'t hit the ground')
-            continue
-        
-        # simple drop down
-        to_ground_vec =  hit_location - lowest_world_co
-        ob.location += to_ground_vec
-        
-        # drop with align to hit normal
-        if self.align:
-            to_center_vec = ob.location - hit_location #vec: hit_loc to origin
-            # rotate object to align with face normal
-            mat_normal = get_align_matrix(hit_location, hit_normal)
-            rot_euler = mat_normal.to_euler()
-            mat_ob_tmp = ob.matrix_world.copy().to_3x3()
-            mat_ob_tmp.rotate(rot_euler)
-            mat_ob_tmp = mat_ob_tmp.to_4x4()
-            ob.matrix_world = mat_ob_tmp
-            # move_object to hit_location
-            ob.location = hit_location
-            # move object above surface again
-            to_center_vec.rotate(rot_euler)
-            ob.location += to_center_vec
-        
-
-    #cleanup
-    bpy.ops.object.select_all(action='DESELECT')
-    tmp_ground.select = True
-    bpy.ops.object.delete('EXEC_DEFAULT')
-    for ob in obs:
-        ob.select = True
-    ground.select = True
-    
-#################################################################
-class OBJECT_OT_drop_to_ground(Operator):
-    """Drop selected objects on active object"""
-    bl_idname = "object.drop_on_active"
-    bl_label = "Drop to Ground"
-    bl_options = {'REGISTER', 'UNDO'}
-    bl_description = "Drop selected objects on active object"
-
-    align = BoolProperty(
-            name="Align to ground",
-            description="Aligns the object to the ground",
-            default=True)
-    use_origin = BoolProperty(
-            name="Use Center",
-            description="Drop to objects origins",
-            default=False)
-
-    ##### POLL #####
-    @classmethod
-    def poll(cls, context):
-        return len(context.selected_objects) >= 2
-    
-    ##### EXECUTE #####
-    def execute(self, context):
-        print('\nDropping Objects')
-        drop_objects(self, context)
-        return {'FINISHED'}
-
-#################################################################
-def drop_to_ground_button(self, context):
-    self.layout.operator(OBJECT_OT_drop_to_ground.bl_idname,
-                         text="Drop to Ground")
-    
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.VIEW3D_PT_tools_objectmode.append(drop_to_ground_button)
-    
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.VIEW3D_PT_tools_objectmode.remove(drop_to_ground_button)
-
-if __name__ == '__main__':
-    register()
diff --git a/release/scripts/addons_contrib/object_edit_linked.py b/release/scripts/addons_contrib/object_edit_linked.py
deleted file mode 100644
index f79bc1a..0000000
--- a/release/scripts/addons_contrib/object_edit_linked.py
+++ /dev/null
@@ -1,185 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Edit Linked Library",
-    "author": "Jason van Gumster (Fweeb)",
-    "version": (0, 7, 1),
-    "blender": (2, 60, 0),
-    "location": "View3D > Toolshelf > Edit Linked Library",
-    "description": "Allows editing of objects linked from a .blend library.",
-    "wiki_url": "http://wiki.blender.org/index.php?title=Extensions:2.6/Py/Scripts/Object/Edit_Linked_Library",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=29630",
-    "category": "Object"}
-    
-
-import bpy
-from bpy.app.handlers import persistent
-
-settings = {
-    "original_file": "",
-    "linked_file": "",
-    "linked_objects": [],
-    }
-
- at persistent
-def linked_file_check(context):
-    if settings["linked_file"] != "":
-        if settings["linked_file"] in {bpy.data.filepath, bpy.path.abspath(bpy.data.filepath)}:
-            print("Editing a linked library.")
-            bpy.ops.object.select_all(action = 'DESELECT')
-            for ob_name in settings["linked_objects"]:
-                bpy.data.objects[ob_name].select = True
-            if len(settings["linked_objects"]) == 1:
-                bpy.context.scene.objects.active = bpy.data.objects[settings["linked_objects"][0]]
-        else:
-            # For some reason, the linked editing session ended (failed to find a file or opened a different file before returning to the originating .blend)
-            settings["original_file"] = ""
-            settings["linked_file"] = ""
-
-
-
-class EditLinked(bpy.types.Operator):
-    """Edit Linked Library"""
-    bl_idname = "object.edit_linked"
-    bl_label = "Edit Linked Library"
-
-    autosave = bpy.props.BoolProperty(name = "Autosave", description = "Automatically save the current file before opening the linked library", default = True)
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object is not None
-
-    def execute(self, context):
-        #print(bpy.context.active_object.library)
-        target = context.active_object
-
-        if target.dupli_group and target.dupli_group.library:
-            targetpath = target.dupli_group.library.filepath
-            settings["linked_objects"].extend([ob.name for ob in target.dupli_group.objects])
-        elif target.library:
-            targetpath = target.library.filepath
-            settings["linked_objects"].append(target.name)
-
-        if targetpath:
-            print(target.name + " is linked to " + targetpath)
-
-            if self.properties.autosave == True:
-                bpy.ops.wm.save_mainfile()
-
-            settings["original_file"] = bpy.data.filepath
-
-            # XXX: need to test for proxied rigs
-            settings["linked_file"] = bpy.path.abspath(targetpath)
-
-            bpy.ops.wm.open_mainfile(filepath=settings["linked_file"])
-            print("Opened linked file!")
-        else:
-            self.report({'WARNING'}, target.name + " is not linked")
-            print(target.name + " is not linked")
-
-        return {'FINISHED'}
-
-
-class ReturnToOriginal(bpy.types.Operator):
-    """Return to the original file after editing the linked library .blend"""
-    bl_idname = "wm.return_to_original"
-    bl_label = "Return to Original File"
-
-    autosave = bpy.props.BoolProperty(name = "Autosave", description = "Automatically save the current file before opening original file", default = True)
-
-    @classmethod
-    def poll(cls, context):
-        # Probably the wrong context to check for here...
-        return context.active_object is not None
-    
-    def execute(self, context):
-        if self.properties.autosave == True:
-            bpy.ops.wm.save_mainfile()
-        bpy.ops.wm.open_mainfile(filepath=settings["original_file"])
-        settings["original_file"] = ""
-        settings["linked_objects"] = []
-        print("Back to the original!")
-        return {'FINISHED'}
-
-
-# UI
-# TODO: Add operators to the File menu? Hide the entire panel for non-linked objects?
-class PanelLinkedEdit(bpy.types.Panel):
-    bl_label = "Edit Linked Library"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOLS"
-
-
-    def draw(self, context):
-        kc = bpy.context.window_manager.keyconfigs.addon
-        km = kc.keymaps["3D View"]
-        kmi_edit = km.keymap_items["object.edit_linked"]
-        kmi_return = km.keymap_items["wm.return_to_original"]
-
-        if settings["original_file"] == "" and ((context.active_object.dupli_group and context.active_object.dupli_group.library is not None) or context.active_object.library is not None):
-            kmi_edit.active = True
-            kmi_return.active = False
-            self.layout.operator("object.edit_linked").autosave = context.scene.edit_linked_autosave
-            self.layout.prop(context.scene, "edit_linked_autosave")
-        elif settings["original_file"] != "":
-            kmi_edit.active = False
-            kmi_return.active = True
-            self.layout.operator("wm.return_to_original").autosave = context.scene.edit_linked_autosave
-            self.layout.prop(context.scene, "edit_linked_autosave")
-        else:
-            kmi_edit.active = False
-            kmi_return.active = False
-            self.layout.label(text = "Active object is not linked")
-
-
-def register():
-    bpy.app.handlers.load_post.append(linked_file_check)
-    bpy.utils.register_class(EditLinked)
-    bpy.utils.register_class(ReturnToOriginal)
-    bpy.utils.register_class(PanelLinkedEdit)
-
-    # Is there a better place to store this property?
-    bpy.types.Scene.edit_linked_autosave = bpy.props.BoolProperty(name = "Autosave", description = "Automatically save the current file before opening a linked file", default = True)
-
-    # Keymapping (deactivated by default; activated when a library object is selected)
-    kc = bpy.context.window_manager.keyconfigs.addon
-    km = kc.keymaps.new(name = "3D View", space_type='VIEW_3D')
-    kmi = km.keymap_items.new("object.edit_linked", 'NUMPAD_SLASH', 'PRESS', shift = True)
-    kmi.active = False
-    kmi = km.keymap_items.new("wm.return_to_original", 'NUMPAD_SLASH', 'PRESS', shift = True)
-    kmi.active = False
-
-
-def unregister():
-    bpy.utils.unregister_class(EditLinked)
-    bpy.utils.unregister_class(ReturnToOriginal)
-    bpy.utils.unregister_class(PanelLinkedEdit)
-    bpy.app.handlers.load_post.remove(linked_file_check)
-
-    del bpy.types.Scene.edit_linked_autosave
-
-    kc = bpy.context.window_manager.keyconfigs.addon
-    km = kc.keymaps["3D View"]
-    km.keymap_items.remove(km.keymap_items["object.edit_linked"])
-    km.keymap_items.remove(km.keymap_items["wm.return_to_original"])
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/object_laplace_lightning.py b/release/scripts/addons_contrib/object_laplace_lightning.py
deleted file mode 100644
index 85665e4..0000000
--- a/release/scripts/addons_contrib/object_laplace_lightning.py
+++ /dev/null
@@ -1,1244 +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 LICENCE BLOCK *****
-bl_info = {
-    "name": "Laplacian Lightning",
-    "author": "teldredge",
-    "version": (0, 2, 6),
-    "blender": (2, 61, 0),
-    "location": "View3D > ToolShelf > Laplacian Lightning",
-    "description": "Lightning mesh generator using laplacian growth algorithm",
-    "warning": "Beta/Buggy.",
-    "wiki_url": "http://www.funkboxing.com/wordpress/?p=301",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"
-                   "func=detail&aid=27189",
-    "category": "Object"}
-        
-######################################################################
-######################################################################
-##################### BLENDER LAPLACIAN LIGHTNING ####################
-############################ teldredge ###############################
-######################## www.funkboxing.com ##########################
-######################################################################
-######################## using algorithm from ########################
-######################################################################
-############## FAST SIMULATION OF LAPLACIAN GROWTH (FSLG) ############
-#################### http://gamma.cs.unc.edu/FRAC/ ###################
-######################################################################
-###################### and a few ideas ideas from ####################
-######################################################################
-##### FAST ANIMATION OF LIGHTNING USING AN ADAPTIVE MESH (FALUAM) ####
-################ http://gamma.cs.unc.edu/FAST_LIGHTNING/ #############
-######################################################################
-######################################################################
-"""           -----RELEASE LOG/NOTES/PONTIFICATIONS-----
-v0.1.0 - 04.11.11
-    basic generate functions and UI
-    object creation report (Custom Properties: FSLG_REPORT)
-v0.2.0 - 04.15.11
-    started spelling laplacian right.
-    add curve function (not in UI) ...twisting problem
-    classify stroke by MAIN path, h-ORDER paths, TIP paths
-    jitter cells for mesh creation
-    add materials if present
-v0.2.1 - 04.16.11
-    mesh classification speedup
-v0.2.2 - 04.21.11
-    fxns to write/read array to file 
-    restrict growth to insulator cells (object bounding box)
-    origin/ground defineable by object
-    gridunit more like 'resolution'
-v0.2.3 - 04.24.11
-    cloud attractor object (termintates loop if hit)
-    secondary path orders (hOrder) disabled in UI (set to 1)
-v0.2.4 - 04.26.11
-    fixed object selection in UI
-    will not run if required object not selected   
-    moved to view 3d > toolbox
-v0.2.5 - 05.08.11
-    testing for 2.57b
-    single mesh output (for build modifier)
-    speedups (dist fxn)
-v0.2.6 - 06.20.11
-    scale/pos on 'write to cubes' works now
-    if origin obj is mesh, uses all verts as initial charges
-    semi-helpful tooltips
-    speedups, faster dedupe fxn, faster classification
-    use any shape mesh obj as insulator mesh
-        must have rot=0, scale=1, origin set to geometry
-        often fails to block bolt with curved/complex shapes
-    separate single and multi mesh creation
-
-v0.x -
-    -fix vis fxn to only buildCPGraph once for VM or VS
-    -improve list fxns (rid of ((x,y,z),w) and use (x,y,z,w)), use 'sets'
-    -create python cmodule for a few of most costly fxns
-        i have pretty much no idea how to do this yet
-    -cloud and insulator can be groups of MESH objs
-    -?text output, possibly to save on interrupt, allow continue from text
-    -?hook modifiers from tips->sides->main, weight w/ vert groups
-    -user defined 'attractor' path
-    -fix add curve function
-    -animated arcs via. ionization path    
-    -environment map boundary conditions - requires Eqn. 15 from FSLG...
-    -?assign wattage at each segment for HDRI
-    -?default settings for -lightning, -teslacoil, -spark/arc
-    -fix hOrder functionality
-    -multiple 'MAIN' brances for non-lightning discharges
-    -n-symmetry option, create mirror images, snowflakes, etc...
-"""
-
-######################################################################
-######################################################################
-######################################################################
-import bpy
-import time
-import random
-from math import sqrt
-from mathutils import Vector
-import struct
-import bisect
-import os.path
-notZero = 0.0000000001
-scn = bpy.context.scene
-
-######################################################################
-########################### UTILITY FXNS #############################
-######################################################################
-def within(x,y,d):
-###---CHECK IF x-d <= y <= x+d
-    if x-d <= y and x + d >= y:
-        return True
-    else: return False
-
-def dist(ax, ay, az ,bx, by, bz):
-    dv = Vector((ax,ay,az)) - Vector((bx,by,bz))
-    d = dv.length
-    return d
-
-def splitList(aList, idx):
-    ll = []
-    for x in aList:
-        ll.append(x[idx])
-    return ll
-
-def splitListCo(aList):
-    ll = []
-    for p in aList:
-        ll.append((p[0], p[1], p[2]))
-    return ll
-
-def getLowHigh(aList):
-    tLow = aList[0]; tHigh = aList[0]
-    for a in aList:
-        if a < tLow: tLow = a
-        if a > tHigh: tHigh = a
-    return tLow, tHigh
-
-def weightedRandomChoice(aList):
-    tL = []
-    tweight = 0
-    for a in range(len(aList)):
-        idex = a; weight = aList[a]
-        if weight > 0.0:
-            tweight += weight
-            tL.append((tweight, idex))
-    i = bisect.bisect(tL, (random.uniform(0, tweight), None))    
-    r = tL[i][1]
-    return r
-
-def getStencil3D_26(x,y,z):
-    nL = []
-    for xT in range(x-1, x+2):
-        for yT in range(y-1, y+2):
-            for zT in range(z-1, z+2):
-                nL.append((xT, yT, zT))
-    nL.remove((x,y,z))
-    return nL
-
-def jitterCells(aList, jit):
-    j = jit/2
-    bList = []
-    for a in aList:
-        ax = a[0] + random.uniform(-j, j)
-        ay = a[1] + random.uniform(-j, j)
-        az = a[2] + random.uniform(-j, j)
-        bList.append((ax, ay, az))
-    return bList
-
-def deDupe(seq, idfun=None): 
-###---THANKS TO THIS GUY - http://www.peterbe.com/plog/uniqifiers-benchmark
-    if idfun is None:
-        def idfun(x): return x
-    seen = {}
-    result = []
-    for item in seq:
-        marker = idfun(item)
-        if marker in seen: continue
-        seen[marker] = 1
-        result.append(item)
-    return result
-
-######################################################################
-######################## VISUALIZATION FXNS ##########################
-######################################################################
-def writeArrayToVoxel(arr, filename):
-    gridS = 64
-    half = int(gridS/2)
-    bitOn = 255
-    aGrid = [[[0 for z in range(gridS)] for y in range(gridS)] for x in range(gridS)]
-    for a in arr:
-        try:
-            aGrid[a[0]+half][a[1]+half][a[2]+half] = bitOn
-        except:
-            print('Particle beyond voxel domain')
-    file = open(filename, "wb")
-    for z in range(gridS):
-        for y in range(gridS):
-            for x in range(gridS):
-                file.write(struct.pack('B', aGrid[x][y][z]))
-    file.flush()
-    file.close()
-        
-def writeArrayToFile(arr, filename):
-    file = open(filename, "w")
-    for a in arr:
-        tstr = str(a[0]) + ',' + str(a[1]) + ',' + str(a[2]) + '\n'
-        file.write(tstr)
-    file.close
-
-def readArrayFromFile(filename):
-    file = open(filename, "r")
-    arr = []
-    for f in file:
-        pt = f[0:-1].split(',')
-        arr.append((int(pt[0]), int(pt[1]), int(pt[2])))
-    return arr
-
-def makeMeshCube(msize):
-    msize = msize/2
-    mmesh = bpy.data.meshes.new('q')
-    mmesh.vertices.add(8)
-    mmesh.vertices[0].co = [-msize, -msize, -msize]
-    mmesh.vertices[1].co = [-msize,  msize, -msize]
-    mmesh.vertices[2].co = [ msize,  msize, -msize]
-    mmesh.vertices[3].co = [ msize, -msize, -msize]
-    mmesh.vertices[4].co = [-msize, -msize,  msize]
-    mmesh.vertices[5].co = [-msize,  msize,  msize]
-    mmesh.vertices[6].co = [ msize,  msize,  msize]
-    mmesh.vertices[7].co = [ msize, -msize,  msize]
-    mmesh.faces.add(6)
-    mmesh.faces[0].vertices_raw = [0,1,2,3]
-    mmesh.faces[1].vertices_raw = [0,4,5,1]
-    mmesh.faces[2].vertices_raw = [2,1,5,6]
-    mmesh.faces[3].vertices_raw = [3,2,6,7]
-    mmesh.faces[4].vertices_raw = [0,3,7,4]
-    mmesh.faces[5].vertices_raw = [5,4,7,6]
-    mmesh.update(calc_edges=True)
-    return(mmesh)
-
-def writeArrayToCubes(arr, gridBU, orig, cBOOL = False, jBOOL = True):
-    for a in arr:
-        x = a[0]; y = a[1]; z = a[2]
-        me = makeMeshCube(gridBU)
-        ob = bpy.data.objects.new('xCUBE', me)
-        ob.location.x = (x*gridBU) + orig[0]
-        ob.location.y = (y*gridBU) + orig[1]
-        ob.location.z = (z*gridBU) + orig[2]
-        if cBOOL: ###---!!!MOSTLY UNUSED
-            ###   POS+BLUE, NEG-RED, ZERO:BLACK
-            col = (1.0, 1.0, 1.0, 1.0)
-            if a[3] == 0: col = (0.0, 0.0, 0.0, 1.0)
-            if a[3] < 0: col = (-a[3], 0.0, 0.0, 1.0)
-            if a[3] > 0: col = (0.0, 0.0, a[3], 1.0)                
-            ob.color = col
-        bpy.context.scene.objects.link(ob)
-        bpy.context.scene.update()
-    if jBOOL:
-        ###---SELECTS ALL CUBES w/ ?bpy.ops.object.join() b/c
-        ###   CAN'T JOIN ALL CUBES TO A SINGLE MESH RIGHT... ARGH...
-        for q in bpy.context.scene.objects:
-            q.select = False
-            if q.name[0:5] == 'xCUBE':
-                q.select = True
-                bpy.context.scene.objects.active = q
-
-def addVert(ob, pt, conni = -1):
-    mmesh = ob.data
-    mmesh.vertices.add(1)
-    vcounti = len(mmesh.vertices)-1
-    mmesh.vertices[vcounti].co = [pt[0], pt[1], pt[2]]
-    if conni > -1:
-        mmesh.edges.add(1)
-        ecounti = len(mmesh.edges)-1
-        mmesh.edges[ecounti].vertices = [conni, vcounti]
-        mmesh.update()
-
-def addEdge(ob, va, vb):
-    mmesh = ob.data
-    mmesh.edges.add(1)
-    ecounti = len(mmesh.edges)-1
-    mmesh.edges[ecounti].vertices = [va, vb]
-    mmesh.update()    
-
-def newMesh(mname):
-    mmesh = bpy.data.meshes.new(mname)
-    omesh = bpy.data.objects.new(mname, mmesh)
-    bpy.context.scene.objects.link(omesh)
-    return omesh      
-
-def writeArrayToMesh(mname, arr, gridBU, rpt = None):
-    mob = newMesh(mname)
-    mob.scale = (gridBU, gridBU, gridBU)
-    if rpt: addReportProp(mob, rpt)
-    addVert(mob, arr[0], -1)
-    for ai in range(1, len(arr)):
-        a = arr[ai]
-        addVert(mob, a, ai-1)
-    return mob        
-
-###---!!!OUT OF ORDER - SOME PROBLEM WITH IT ADDING (0,0,0)
-def writeArrayToCurves(cname, arr, gridBU, bd = .05, rpt = None):
-    cur = bpy.data.curves.new('fslg_curve', 'CURVE')
-    cur.use_fill_front = False
-    cur.use_fill_back = False    
-    cur.bevel_depth = bd
-    cur.bevel_resolution = 2    
-    cob = bpy.data.objects.new(cname, cur)
-    cob.scale = (gridBU, gridBU, gridBU)
-    if rpt: addReportProp(cob, rpt)
-    bpy.context.scene.objects.link(cob)
-    cur.splines.new('BEZIER')
-    cspline = cur.splines[0]
-    div = 1 ###   SPACING FOR HANDLES (2 - 1/2 WAY, 1 - NEXT BEZIER)
-    for a in range(len(arr)):
-        cspline.bezier_points.add(1)
-        bp = cspline.bezier_points[len(cspline.bezier_points)-1]
-        if a-1 < 0: hL = arr[a]
-        else:
-            hx = arr[a][0] - ((arr[a][0]-arr[a-1][0]) / div)
-            hy = arr[a][1] - ((arr[a][1]-arr[a-1][1]) / div)
-            hz = arr[a][2] - ((arr[a][2]-arr[a-1][2]) / div)
-            hL = (hx,hy,hz)
-        
-        if a+1 > len(arr)-1: hR = arr[a]
-        else:
-            hx = arr[a][0] + ((arr[a+1][0]-arr[a][0]) / div)
-            hy = arr[a][1] + ((arr[a+1][1]-arr[a][1]) / div)
-            hz = arr[a][2] + ((arr[a+1][2]-arr[a][2]) / div)
-            hR = (hx,hy,hz)
-        bp.co = arr[a]
-        bp.handle_left = hL
-        bp.handle_right = hR
-
-def addArrayToMesh(mob, arr):
-    addVert(mob, arr[0], -1)
-    mmesh = mob.data
-    vcounti = len(mmesh.vertices)-1
-    for ai in range(1, len(arr)):
-        a = arr[ai]
-        addVert(mob, a, len(mmesh.vertices)-1)
-
-def addMaterial(ob, matname):
-    mat = bpy.data.materials[matname]
-    ob.active_material = mat
-
-def writeStokeToMesh(arr, jarr, MAINi, HORDERi, TIPSi, orig, gs, rpt=None):
-    ###---MAIN BRANCH
-    print('   WRITING MAIN BRANCH')
-    llmain = []
-    for x in MAINi:
-        llmain.append(jarr[x])
-    mob = writeArrayToMesh('la0MAIN', llmain, gs)
-    mob.location = orig       
-
-    ###---hORDER BRANCHES
-    for hOi in range(len(HORDERi)):
-        print('   WRITING ORDER', hOi)        
-        hO = HORDERi[hOi]
-        hob = newMesh('la1H'+str(hOi))
-
-        for y in hO:
-            llHO = []
-            for x in y:
-                llHO.append(jarr[x])
-            addArrayToMesh(hob, llHO)
-        hob.scale = (gs, gs, gs)
-        hob.location = orig
-
-    ###---TIPS
-    print('   WRITING TIP PATHS')    
-    tob = newMesh('la2TIPS')
-    for y in  TIPSi:
-        llt = []        
-        for x in y:
-            llt.append(jarr[x])
-        addArrayToMesh(tob, llt)
-    tob.scale = (gs, gs, gs)
-    tob.location = orig
-
-    ###---ADD MATERIALS TO OBJECTS (IF THEY EXIST)    
-    try:
-        addMaterial(mob, 'edgeMAT-h0')
-        addMaterial(hob, 'edgeMAT-h1')
-        addMaterial(tob, 'edgeMAT-h2')
-        print('   ADDED MATERIALS')
-    except: print('   MATERIALS NOT FOUND')
-    ###---ADD GENERATION REPORT TO ALL MESHES
-    if rpt:
-        addReportProp(mob, rpt)
-        addReportProp(hob, rpt)
-        addReportProp(tob, rpt)                
-
-def writeStokeToSingleMesh(arr, jarr, orig, gs, mct, rpt=None): 
-    sgarr = buildCPGraph(arr, mct)
-    llALL = []
-
-    Aob = newMesh('laALL')
-    for pt in jarr:
-        addVert(Aob, pt)
-    for cpi in range(len(sgarr)):
-        ci = sgarr[cpi][0]
-        pi = sgarr[cpi][1]
-        addEdge(Aob, pi, ci)
-    Aob.location = orig
-    Aob.scale = ((gs,gs,gs))
-
-    if rpt:
-        addReportProp(Aob, rpt)
-
-def visualizeArray(cg, oob, gs, vm, vs, vc, vv, rst):
-###---IN: (cellgrid, origin, gridscale,
-###   mulimesh, single mesh, cubes, voxels, report sting)
-    origin = oob.location
-
-    ###---DEAL WITH VERT MULTI-ORIGINS
-    oct = 2
-    if oob.type == 'MESH': oct = len(oob.data.vertices)
-
-    ###---JITTER CELLS
-    if vm or vs: cjarr = jitterCells(cg, 1)
-
-
-    if vm:  ###---WRITE ARRAY TO MULTI MESH
-        
-        aMi, aHi, aTi = classifyStroke(cg, oct, scn.HORDER)
-        print(':::WRITING TO MULTI-MESH')        
-        writeStokeToMesh(cg, cjarr, aMi, aHi, aTi, origin, gs, rst)
-        print(':::MULTI-MESH WRITTEN')
-
-    if vs:  ###---WRITE TO SINGLE MESH
-        print(':::WRITING TO SINGLE MESH')         
-        writeStokeToSingleMesh(cg, cjarr, origin, gs, oct, rst)
-        print(':::SINGLE MESH WRITTEN')
-        
-    if vc:  ###---WRITE ARRAY TO CUBE OBJECTS
-        print(':::WRITING TO CUBES')
-        writeArrayToCubes(cg, gs, origin)
-        print(':::CUBES WRITTEN')
-
-    if vv:  ###---WRITE ARRAY TO VOXEL DATA FILE
-        print(':::WRITING TO VOXELS')
-        fname = "FSLGvoxels.raw"
-        path = os.path.dirname(bpy.data.filepath)
-        writeArrayToVoxel(cg, path + "\\" + fname)
-        print(':::VOXEL DATA WRITTEN TO - ', path + "\\" + fname)
-
-    ###---READ/WRITE ARRAY TO FILE (MIGHT NOT BE NECESSARY)
-    #tfile = 'c:\\testarr.txt'
-    #writeArrayToFile(cg, tfile)
-    #cg = readArrayFromFile(tfile)
-
-    ###---READ/WRITE ARRAY TO CURVES (OUT OF ORDER)
-    #writeArrayToCurves('laMAIN', llmain, .10, .25)        
-
-######################################################################
-########################### ALGORITHM FXNS ###########################
-########################## FROM FALUAM PAPER #########################
-###################### PLUS SOME STUFF I MADE UP #####################
-######################################################################
-def buildCPGraph(arr, sti = 2):
-###---IN -XYZ ARRAY AS BUILT BY GENERATOR
-###---OUT -[(CHILDindex, PARENTindex)]
-###   sti - start index, 2 for Empty, len(me.vertices) for Mesh
-    sgarr = []
-    sgarr.append((1, 0)) #
-    for ai in range(sti, len(arr)):
-        cs = arr[ai]
-        cpts = arr[0:ai]
-        cslap = getStencil3D_26(cs[0], cs[1], cs[2])
-
-        for nc in cslap:
-            ct = cpts.count(nc)
-            if ct>0:
-                cti = cpts.index(nc)
-        sgarr.append((ai, cti))
-    return sgarr
-
-def buildCPGraph_WORKINPROGRESS(arr, sti = 2):
-###---IN -XYZ ARRAY AS BUILT BY GENERATOR
-###---OUT -[(CHILDindex, PARENTindex)]
-###   sti - start index, 2 for Empty, len(me.vertices) for Mesh
-    sgarr = []
-    sgarr.append((1, 0)) #
-    ctix = 0
-    for ai in range(sti, len(arr)):		
-        cs = arr[ai]
-        #cpts = arr[0:ai]
-        cpts = arr[ctix:ai]
-        cslap = getStencil3D_26(cs[0], cs[1], cs[2])
-        for nc in cslap:
-            ct = cpts.count(nc)
-            if ct>0:
-                #cti = cpts.index(nc)
-                cti = ctix + cpts.index(nc)
-                ctix = cpts.index(nc)
-				
-        sgarr.append((ai, cti))
-    return sgarr
-
-def findChargePath(oc, fc, ngraph, restrict = [], partial = True):
-    ###---oc -ORIGIN CHARGE INDEX, fc -FINAL CHARGE INDEX
-    ###---ngraph -NODE GRAPH, restrict- INDEX OF SITES CANNOT TRAVERSE
-    ###---partial -RETURN PARTIAL PATH IF RESTRICTION ENCOUNTERD
-    cList = splitList(ngraph, 0)
-    pList = splitList(ngraph, 1)
-    aRi = []
-    cNODE = fc
-    for x in range(len(ngraph)):
-        pNODE = pList[cList.index(cNODE)]
-        aRi.append(cNODE)
-        cNODE = pNODE
-        npNODECOUNT = cList.count(pNODE)
-        if cNODE == oc:             ###   STOP IF ORIGIN FOUND
-            aRi.append(cNODE)       ###   RETURN PATH
-            return aRi
-        if npNODECOUNT == 0:        ###   STOP IF NO PARENTS
-            return []               ###   RETURN []
-        if pNODE in restrict:       ###   STOP IF PARENT IS IN RESTRICTION
-            if partial:             ###   RETURN PARTIAL OR []
-                aRi.append(cNODE)
-                return aRi
-            else: return []
-
-def findTips(arr):
-    lt = []
-    for ai in arr[0:len(arr)-1]:
-        a = ai[0]
-        cCOUNT = 0
-        for bi in arr:
-            b = bi[1]
-            if a == b:
-                cCOUNT += 1
-        if cCOUNT == 0:
-            lt.append(a)
-    return lt
-
-def findChannelRoots(path, ngraph, restrict = []):
-    roots = []
-    for ai in range(len(ngraph)):
-        chi = ngraph[ai][0]
-        par = ngraph[ai][1]
-        if par in path and not chi in path and \
-            not chi in restrict:        
-            roots.append(par)
-    droots = deDupe(roots)
-    return droots
-
-def findChannels(roots, tips, ngraph, restrict):
-    cPATHS = []
-    for ri in range(len(roots)):
-        r = roots[ri]
-        sL = 1
-        sPATHi = []
-        for ti in range(len(tips)):
-            t = tips[ti]
-            if t < r: continue
-            tPATHi = findChargePath(r, t, ngraph, restrict, False)
-            tL = len(tPATHi)
-            if tL > sL:
-                if countChildrenOnPath(tPATHi, ngraph) > 1:
-                    sL = tL
-                    sPATHi = tPATHi
-                    tTEMP = t; tiTEMP = ti
-        if len(sPATHi) > 0:
-            print('   found path/idex from', ri, 'of', 
-                  len(roots), 'possible | tips:', tTEMP, tiTEMP)
-            cPATHS.append(sPATHi)
-            tips.remove(tTEMP)
-    return cPATHS
-
-def findChannels_WORKINPROGRESS(roots, ttips, ngraph, restrict):
-    cPATHS = []
-    tips = list(ttips)
-    for ri in range(len(roots)):
-        r = roots[ri]
-        sL = 1
-        sPATHi = []
-        tipREMOVE = [] ###---CHECKED TIP INDEXES, TO BE REMOVED FOR NEXT LOOP
-        for ti in range(len(tips)):
-            t = tips[ti]            
-            #print('-CHECKING RT/IDEX:', r, ri, 'AGAINST TIP', t, ti)
-            #if t < r: continue
-            if ti < ri: continue
-            tPATHi = findChargePath(r, t, ngraph, restrict, False)
-            tL = len(tPATHi)
-            if tL > sL:
-                if countChildrenOnPath(tPATHi, ngraph) > 1:
-                    sL = tL
-                    sPATHi = tPATHi
-                    tTEMP = t; tiTEMP = ti
-            if tL > 0:
-                tipREMOVE.append(t)                    
-        if len(sPATHi) > 0:
-            print('   found path from root idex', ri, 'of', 
-                   len(roots), 'possible roots | #oftips=', len(tips))
-            cPATHS.append(sPATHi)
-        for q in tipREMOVE:  tips.remove(q)
-
-    return cPATHS
-
-def countChildrenOnPath(aPath, ngraph, quick = True):
-    ###---RETURN HOW MANY BRANCHES 
-    ###   COUNT WHEN NODE IS A PARENT >1 TIMES
-    ###   quick -STOP AND RETURN AFTER FIRST
-    cCOUNT = 0
-    pList = splitList(ngraph,1)
-    for ai in range(len(aPath)-1):
-        ap = aPath[ai]
-        pc = pList.count(ap)
-        if quick and pc > 1: 
-            return pc
-    return cCOUNT
-
-###---CLASSIFY CHANNELS INTO 'MAIN', 'hORDER/SECONDARY' and 'SIDE'
-def classifyStroke(sarr, mct, hORDER = 1):
-    print(':::CLASSIFYING STROKE')
-    ###---BUILD CHILD/PARENT GRAPH (INDEXES OF sarr)  
-    sgarr = buildCPGraph(sarr, mct)
-
-    ###---FIND MAIN CHANNEL 
-    print('   finding MAIN')
-    oCharge = sgarr[0][1]
-    fCharge = sgarr[len(sgarr)-1][0]
-    aMAINi = findChargePath(oCharge, fCharge, sgarr)
-    
-    ###---FIND TIPS
-    print('   finding TIPS')
-    aTIPSi = findTips(sgarr)
-
-    ###---FIND hORDER CHANNEL ROOTS
-    ###   hCOUNT = ORDERS BEWTEEN MAIN and SIDE/TIPS
-    ###   !!!STILL BUGGY!!!
-    hRESTRICT = list(aMAINi)    ### ADD TO THIS AFTER EACH TIME
-    allHPATHSi = []             ### ALL hO PATHS: [[h0], [h1]...]
-    curPATHSi = [aMAINi]        ### LIST OF PATHS FIND ROOTS ON
-    for h in range(hORDER):
-        allHPATHSi.append([])
-        for pi in range(len(curPATHSi)):     ###   LOOP THROUGH ALL PATHS IN THIS ORDER
-            p = curPATHSi[pi]
-            ###   GET ROOTS FOR THIS PATH
-            aHROOTSi = findChannelRoots(p, sgarr, hRESTRICT)
-            print('   found', len(aHROOTSi), 'roots in ORDER', h, ':#paths:', len(curPATHSi))
-            ### GET CHANNELS FOR THESE ROOTS
-            if len(aHROOTSi) == 0:
-                print('NO ROOTS FOR FOUND FOR CHANNEL')
-                aHPATHSi = []
-                continue
-            else:
-                aHPATHSiD = findChannels(aHROOTSi, aTIPSi, sgarr, hRESTRICT)
-                aHPATHSi = aHPATHSiD
-                allHPATHSi[h] += aHPATHSi
-                ###   SET THESE CHANNELS AS RESTRICTIONS FOR NEXT ITERATIONS
-                for hri in aHPATHSi:
-                    hRESTRICT += hri
-        curPATHSi = aHPATHSi
-    
-    ###---SIDE BRANCHES, FINAL ORDER OF HEIRARCHY
-    ###   FROM TIPS THAT ARE NOT IN AN EXISTING PATH
-    ###   BACK TO ANY OTHER POINT THAT IS ALREADY ON A PATH
-    aDRAWNi = []
-    aDRAWNi += aMAINi
-    for oH in allHPATHSi:
-        for o in oH:
-            aDRAWNi += o
-    aTPATHSi = []
-    for a in aTIPSi:
-        if not a in aDRAWNi:
-            aPATHi = findChargePath(oCharge, a, sgarr, aDRAWNi)
-            aDRAWNi += aPATHi
-            aTPATHSi.append(aPATHi)
-            
-    return aMAINi, allHPATHSi, aTPATHSi
-
-def voxelByVertex(ob, gs):
-###---'VOXELIZES' VERTS IN A MESH TO LIST [(x,y,z),(x,y,z)]
-###   W/ RESPECT GSCALE AND OB ORIGIN (B/C SHOULD BE ORIGIN OBJ)
-    orig = ob.location
-    ll = []
-    for v in ob.data.vertices:
-        x = int( v.co.x / gs )
-        y = int( v.co.y / gs )
-        z = int( v.co.z / gs )      
-        ll.append((x,y,z))
-    return ll
-    
-def voxelByRays(ob, orig, gs):
-###--- MESH INTO A 3DGRID W/ RESPECT GSCALE AND BOLT ORIGIN
-###   -DOES NOT TAKE OBJECT ROTATION/SCALE INTO ACCOUNT
-###   -THIS IS A HORRIBLE, INEFFICIENT FUNCTION
-###    MAYBE THE RAYCAST/GRID THING ARE A BAD IDEA. BUT I 
-###    HAVE TO 'VOXELIZE THE OBJECT W/ RESCT TO GSCALE/ORIGIN
-    bbox = ob.bound_box
-    bbxL = bbox[0][0]; bbxR = bbox[4][0]
-    bbyL = bbox[0][1]; bbyR = bbox[2][1]
-    bbzL = bbox[0][2]; bbzR = bbox[1][2]
-    xct = int((bbxR - bbxL) / gs)
-    yct = int((bbyR - bbyL) / gs)
-    zct = int((bbzR - bbzL) / gs)
-    xs = int(xct/2); ys = int(yct/2); zs = int(zct/2)
-    print('  CASTING', xct, '/', yct, '/', zct, 'cells, total:', xct*yct*zct, 'in obj-', ob.name)    
-    ll = []
-    rc = 100    ###---DISTANCE TO CAST FROM
-    ###---RAYCAST TOP/BOTTOM
-    print('  RAYCASTING TOP/BOTTOM')
-    for x in range(xct):
-        for y in range(yct):
-            xco = bbxL + (x*gs);  yco = bbyL + (y*gs)
-            v1 = ((xco, yco,  rc));    v2 = ((xco, yco, -rc))            
-            vz1 = ob.ray_cast(v1,v2);   vz2 = ob.ray_cast(v2,v1)            
-            if vz1[2] != -1: ll.append((x-xs, y-ys, int(vz1[0][2] * (1/gs)) ))
-            if vz2[2] != -1: ll.append((x-xs, y-ys, int(vz2[0][2] * (1/gs)) ))
-    ###---RAYCAST FRONT/BACK
-    print('  RAYCASTING FRONT/BACK')    
-    for x in range(xct):
-        for z in range(zct):
-            xco = bbxL + (x*gs);  zco = bbzL + (z*gs)
-            v1 = ((xco, rc,  zco));    v2 = ((xco, -rc, zco))            
-            vy1 = ob.ray_cast(v1,v2);   vy2 = ob.ray_cast(v2,v1)            
-            if vy1[2] != -1: ll.append((x-xs, int(vy1[0][1] * (1/gs)), z-zs))
-            if vy2[2] != -1: ll.append((x-xs, int(vy2[0][1] * (1/gs)), z-zs))
-    ###---RAYCAST LEFT/RIGHT
-    print('  RAYCASTING LEFT/RIGHT')
-    for y in range(yct):
-        for z in range(zct):
-            yco = bbyL + (y*gs);  zco = bbzL + (z*gs)
-            v1 = ((rc, yco,  zco));    v2 = ((-rc, yco, zco))            
-            vx1 = ob.ray_cast(v1,v2);   vx2 = ob.ray_cast(v2,v1)            
-            if vx1[2] != -1: ll.append((int(vx1[0][0] * (1/gs)), y-ys, z-zs))            
-            if vx2[2] != -1: ll.append((int(vx2[0][0] * (1/gs)), y-ys, z-zs))
-
-    ###---ADD IN NEIGHBORS SO BOLT WONT GO THRU
-    nlist = []
-    for l in ll:
-        nl = getStencil3D_26(l[0], l[1], l[2])
-        nlist += nl
-
-    ###---DEDUPE
-    print('  ADDED NEIGHBORS, DEDUPING...')    
-    rlist = deDupe(ll+nlist)
-    qlist = []
-    
-    ###---RELOCATE GRID W/ RESPECT GSCALE AND BOLT ORIGIN
-    ###   !!!NEED TO ADD IN OBJ ROT/SCALE HERE SOMEHOW...
-    od = Vector(( (ob.location[0] - orig[0]) / gs,
-                  (ob.location[1] - orig[1]) / gs,
-                  (ob.location[2] - orig[2]) / gs ))
-    for r in rlist:
-        qlist.append((r[0]+int(od[0]), r[1]+int(od[1]), r[2]+int(od[2]) ))
-
-    return qlist
-
-def fakeGroundChargePlane(z, charge):
-    eCL = []
-    xy = abs(z)/2
-    eCL += [(0, 0, z, charge)]    
-    eCL += [(xy, 0, z, charge)]
-    eCL += [(0, xy, z, charge)]
-    eCL += [(-xy, 0, z, charge)]
-    eCL += [(0, -xy, z, charge)]
-    return eCL
-
-def addCharges(ll, charge):
-###---IN: ll - [(x,y,z), (x,y,z)], charge - w
-###   OUT clist - [(x,y,z,w), (x,y,z,w)]
-    clist = []
-    for l in ll:
-        clist.append((l[0], l[1], l[2], charge))
-    return clist
-        
-######################################################################
-########################### ALGORITHM FXNS ###########################
-############################## FROM FSLG #############################
-######################################################################
-def getGrowthProbability_KEEPFORREFERENCE(uN, aList):
-    ###---IN: uN -USER TERM, cList -CANDIDATE SITES, oList -CANDIDATE SITE CHARGES
-    ###   OUT: LIST OF [(XYZ), POT, PROB]
-    cList = splitList(aList, 0)
-    oList = splitList(aList, 1)
-    Omin, Omax = getLowHigh(oList)
-    if Omin == Omax: Omax += notZero; Omin -= notZero
-    PdL = []
-    E = 0
-    E = notZero   ###===DIVISOR FOR (FSLG - Eqn. 12)
-    for o in oList:
-        Uj = (o - Omin) / (Omax - Omin) ###===(FSLG - Eqn. 13)
-        E += pow(Uj, uN)
-    for oi in range(len(oList)):
-        o = oList[oi]
-        Ui = (o - Omin) / (Omax - Omin)
-        Pd = (pow(Ui, uN)) / E ###===(FSLG - Eqn. 12)
-        PdINT = Pd * 100
-        PdL.append(Pd)
-    return PdL 
-
-###---WORK IN PROGRESS, TRYING TO SPEED THESE UP
-def fslg_e13(x, min, max, u): return pow((x - min) / (max - min), u)
-def addit(x,y):return x+y
-def fslg_e12(x, min, max, u, e): return (fslg_e13(x, min, max, u) / e) * 100
-
-def getGrowthProbability(uN, aList):
-    ###---IN: uN -USER TERM, cList -CANDIDATE SITES, oList -CANDIDATE SITE CHARGES
-    ###   OUT: LIST OF PROB
-    cList = splitList(aList, 0)
-    oList = splitList(aList, 1)
-    Omin, Omax = getLowHigh(oList)
-    if Omin == Omax: Omax += notZero; Omin -= notZero
-    PdL = []
-    E = notZero
-    minL = [Omin for q in range(len(oList))]
-    maxL = [Omax for q in range(len(oList))]
-    uNL =  [uN   for q in range(len(oList))]
-    E = sum(map(fslg_e13, oList, minL, maxL, uNL))
-    EL = [E for q in range(len(oList))]
-    mp = map(fslg_e12, oList, minL, maxL, uNL, EL)
-    for m in mp: PdL.append(m)
-    return PdL 
-
-def updatePointCharges(p, cList, eList = []):
-    ###---IN: pNew -NEW GROWTH CELL
-    ###       cList -OLD CANDIDATE SITES, eList -SAME
-    ###   OUT: LIST OF NEW CHARGE AT CANDIDATE SITES
-    r1 = 1/2        ###===(FSLG - Eqn. 10)
-    nOiL = []    
-    for oi in range(len(cList)):
-        o = cList[oi][1]
-        c = cList[oi][0]
-        iOe = 0
-        rit = dist(c[0], c[1], c[2], p[0], p[1], p[2])        
-        iOe += (1 - (r1/rit))
-        Oit =  o + iOe            
-        nOiL.append((c, Oit))
-    return nOiL
-
-def initialPointCharges(pList, cList, eList = []):
-    ###---IN: p -CHARGED CELL (XYZ), cList -CANDIDATE SITES (XYZ, POT, PROB)
-    ###   OUT: cList -WITH POTENTIAL CALCULATED 
-    r1 = 1/2        ###===(FSLG - Eqn. 10)
-    npList = []
-    for p in pList:
-        npList.append(((p[0], p[1], p[2]), 1.0))
-    for e in eList:
-        npList.append(((e[0], e[1], e[2]), e[3]))
-    OiL = []
-    for i in cList:
-        Oi = 0
-        for j in npList:
-            if i != j[0]:
-                rij = dist(i[0], i[1], i[2], j[0][0], j[0][1], j[0][2])
-                Oi += (1 - (r1 / rij)) * j[1] ### CHARGE INFLUENCE
-        OiL.append(((i[0], i[1], i[2]), Oi))
-    return OiL
-
-def getCandidateSites(aList, iList = []):
-    ###---IN: aList -(X,Y,Z) OF CHARGED CELL SITES, iList -insulator sites
-    ###   OUT: CANDIDATE LIST OF GROWTH SITES [(X,Y,Z)]
-    tt1 = time.clock()    
-    cList = []
-    for c in aList:
-        tempList = getStencil3D_26(c[0], c[1], c[2])
-        for t in tempList:
-            if not t in aList and not t in iList:
-                cList.append(t)
-    ncList = deDupe(cList)
-    tt2 = time.clock()	
-    #print('FXNTIMER:getCandidateSites:', tt2-tt1, 'check 26 against:', len(aList)+len(iList))    
-    return ncList
-
-######################################################################
-############################# SETUP FXNS #############################
-######################################################################
-def setupObjects():
-    oOB = bpy.data.objects.new('ELorigin', None)
-    oOB.location = ((0,0,10))
-    bpy.context.scene.objects.link(oOB)
-
-    gOB = bpy.data.objects.new('ELground', None)
-    gOB.empty_draw_type = 'ARROWS'
-    bpy.context.scene.objects.link(gOB)
-    
-    cME = makeMeshCube(1)
-    cOB = bpy.data.objects.new('ELcloud', cME)
-    cOB.location = ((-2,8,12))
-    cOB.hide_render = True    
-    bpy.context.scene.objects.link(cOB)
-    
-    iME = makeMeshCube(1)
-    for v in iME.vertices: 
-        xyl = 6.5; zl = .5
-        v.co[0] = v.co[0] * xyl
-        v.co[1] = v.co[1] * xyl
-        v.co[2] = v.co[2] * zl
-    iOB = bpy.data.objects.new('ELinsulator', iME)    
-    iOB.location = ((0,0,5))
-    iOB.hide_render = True
-    bpy.context.scene.objects.link(iOB)
-
-    try:
-        scn.OOB = 'ELorigin'
-        scn.GOB = 'ELground'
-        scn.COB = 'ELcloud'
-        scn.IOB = 'ELinsulator'
-    except: pass
-
-def checkSettings():
-    check = True
-    if scn.OOB == "": 
-        print('ERROR: NO ORIGIN OBJECT SELECTED')
-        check = False
-    if scn.GROUNDBOOL and scn.GOB == "":
-        print('ERROR: NO GROUND OBJECT SELECTED')
-        check = False
-    if scn.CLOUDBOOL and scn.COB == "":
-        print('ERROR: NO CLOUD OBJECT SELECTED')        
-        check = False
-    if scn.IBOOL and scn.IOB == "":
-        print('ERROR: NO INSULATOR OBJECT SELECTED')        
-        check = False
-    #should make a popup here
-    return check
-
-
-######################################################################
-############################### MAIN #################################
-######################################################################
-def FSLG():
-###======FAST SIMULATION OF LAPLACIAN GROWTH======###
-    print('\n<<<<<<------GO GO GADGET: FAST SIMULATION OF LAPLACIAN GROWTH!')
-    tc1 = time.clock()
-    TSTEPS = scn.TSTEPS
-
-    obORIGIN = scn.objects[scn.OOB]
-    obGROUND = scn.objects[scn.GOB]    
-    scn.ORIGIN = obORIGIN.location
-    scn.GROUNDZ = int((obGROUND.location[2] - scn.ORIGIN[2]) / scn.GSCALE)
-    
-    ###====== 1) INSERT INTIAL CHARGE(S) POINT (USES VERTS IF MESH)
-    cgrid = [(0, 0, 0)]
-    if obORIGIN.type == 'MESH':
-        print("<<<<<<------ORIGIN OBJECT IS MESH, 'VOXELIZING' INTIAL CHARGES FROM VERTS")
-        cgrid = voxelByVertex(obORIGIN, scn.GSCALE)
-        if scn.VMMESH:
-            print("<<<<<<------CANNOT CLASSIFY STROKE FROM VERT ORIGINS YET, NO MULTI-MESH OUTPUT")
-            scn.VMMESH = False; scn.VSMESH = True
-
-    ###---GROUND CHARGE CELL / INSULATOR LISTS (eChargeList/icList)
-    eChargeList = []; icList = []
-    if scn.GROUNDBOOL:
-        eChargeList = fakeGroundChargePlane(scn.GROUNDZ, scn.GROUNDC)
-    if scn.CLOUDBOOL:
-        print("<<<<<<------'VOXELIZING' CLOUD OBJECT (COULD TAKE SOME TIME)")
-        obCLOUD = scn.objects[scn.COB]
-        eChargeListQ = voxelByRays(obCLOUD, scn.ORIGIN, scn.GSCALE)
-        eChargeList = addCharges(eChargeListQ, scn.CLOUDC)
-        print('<<<<<<------CLOUD OBJECT CELL COUNT = ', len(eChargeList) )        
-    if scn.IBOOL:
-        print("<<<<<<------'VOXELIZING' INSULATOR OBJECT (COULD TAKE SOME TIME)")
-        obINSULATOR = scn.objects[scn.IOB]
-        icList = voxelByRays(obINSULATOR, scn.ORIGIN, scn.GSCALE)
-        print('<<<<<<------INSULATOR OBJECT CELL COUNT = ', len(icList) )
-        #writeArrayToCubes(icList, scn.GSCALE, scn.ORIGIN)
-        #return 'THEEND'
-        
-    ###====== 2) LOCATE CANDIDATE SITES AROUND CHARGE
-    cSites = getCandidateSites(cgrid, icList)
-    
-    ###====== 3) CALC POTENTIAL AT EACH SITE (Eqn. 10)
-    cSites = initialPointCharges(cgrid, cSites, eChargeList)
-    
-    ts = 1
-    while ts <= TSTEPS:
-        ###====== 1) SELECT NEW GROWTH SITE (Eqn. 12)
-        ###===GET PROBABILITIES AT CANDIDATE SITES
-        gProbs = getGrowthProbability(scn.BIGVAR, cSites)
-        ###===CHOOSE NEW GROWTH SITE BASED ON PROBABILITIES
-        gSitei = weightedRandomChoice(gProbs)
-        gsite  = cSites[gSitei][0]
-
-        ###====== 2) ADD NEW POINT CHARGE AT GROWTH SITE
-        ###===ADD NEW GROWTH CELL TO GRID
-        cgrid.append(gsite)
-        ###===REMOVE NEW GROWTH CELL FROM CANDIDATE SITES
-        cSites.remove(cSites[gSitei])
-
-        ###====== 3) UPDATE POTENTIAL AT CANDIDATE SITES (Eqn. 11)
-        cSites = updatePointCharges(gsite, cSites, eChargeList)        
-
-        ###====== 4) ADD NEW CANDIDATES SURROUNDING GROWTH SITE
-        ###===GET CANDIDATE 'STENCIL'
-        ncSitesT = getCandidateSites([gsite], icList)
-        ###===REMOVE CANDIDATES ALREADY IN CANDIDATE LIST OR CHARGE GRID
-        ncSites = []
-        cSplit = splitList(cSites, 0)
-        for cn in ncSitesT:
-            if not cn in cSplit and \
-            not cn in cgrid:
-                ncSites.append((cn, 0))
-
-        ###====== 5) CALC POTENTIAL AT NEW CANDIDATE SITES (Eqn. 10)
-        ncSplit = splitList(ncSites, 0)        
-        ncSites = initialPointCharges(cgrid, ncSplit, eChargeList)
-
-        ###===ADD NEW CANDIDATE SITES TO CANDIDATE LIST
-        for ncs in ncSites:
-            cSites.append(ncs)
-
-        ###===ITERATION COMPLETE
-        istr1 = ':::T-STEP: ' + str(ts) + '/' + str(TSTEPS) 
-        istr12 = ' | GROUNDZ: ' + str(scn.GROUNDZ) + ' | '
-        istr2 = 'CANDS: ' + str(len(cSites)) + ' | '
-        istr3 = 'GSITE: ' + str(gsite)
-        print(istr1 + istr12 + istr2 + istr3)        
-        ts += 1
-        
-        ###---EARLY TERMINATION FOR GROUND/CLOUD STRIKE
-        if scn.GROUNDBOOL:
-            if gsite[2] == scn.GROUNDZ:
-                ts = TSTEPS+1
-                print('<<<<<<------EARLY TERMINATION DUE TO GROUNDSTRIKE')
-                continue
-        if scn.CLOUDBOOL:
-            #if gsite in cloudList:
-            if gsite in splitListCo(eChargeList):
-                ts = TSTEPS+1
-                print('<<<<<<------EARLY TERMINATION DUE TO CLOUDSTRIKE')
-                continue            
-
-    tc2 = time.clock()
-    tcRUN = tc2 - tc1
-    print('<<<<<<------LAPLACIAN GROWTH LOOP COMPLETED: ' + str(len(cgrid)) + ' / ' + str(tcRUN)[0:5] + ' SECONDS')
-    print('<<<<<<------VISUALIZING DATA')
-
-    reportSTRING = getReportString(tcRUN)    
-    ###---VISUALIZE ARRAY
-    visualizeArray(cgrid, obORIGIN, scn.GSCALE, scn.VMMESH, scn.VSMESH, scn.VCUBE, scn.VVOX, reportSTRING)
-    print('<<<<<<------COMPLETE')
-
-######################################################################
-################################ GUI #################################
-######################################################################
-###---NOT IN UI
-bpy.types.Scene.ORIGIN = bpy.props.FloatVectorProperty(name = "origin charge")
-bpy.types.Scene.GROUNDZ = bpy.props.IntProperty(name = "ground Z coordinate")
-bpy.types.Scene.HORDER = bpy.props.IntProperty(name = "secondary paths orders")
-###---IN UI
-bpy.types.Scene.TSTEPS = bpy.props.IntProperty(
-    name = "iterations", description = "number of cells to create, will end early if hits ground plane or cloud")
-bpy.types.Scene.GSCALE = bpy.props.FloatProperty(
-    name = "grid unit size", description = "scale of cells, .25 = 4 cells per blenderUnit")
-bpy.types.Scene.BIGVAR = bpy.props.FloatProperty(
-    name = "straightness", description = "straightness/branchiness of bolt, <2 is mush, >12 is staight line, 6.3 is good")
-bpy.types.Scene.GROUNDBOOL = bpy.props.BoolProperty(
-    name = "use ground object", description = "use ground plane or not")
-bpy.types.Scene.GROUNDC = bpy.props.IntProperty(
-    name = "ground charge", description = "charge of ground plane")
-bpy.types.Scene.CLOUDBOOL = bpy.props.BoolProperty(
-    name = "use cloud object", description = "use cloud obj, attracts and terminates like ground but any obj instead of z plane, can slow down loop if obj is large, overrides ground")
-bpy.types.Scene.CLOUDC = bpy.props.IntProperty(
-    name = "cloud charge", description = "charge of a cell in cloud object (so total charge also depends on obj size)")
-
-bpy.types.Scene.VMMESH = bpy.props.BoolProperty(
-    name = "multi mesh", description = "output to multi-meshes for different materials on main/sec/side branches")
-bpy.types.Scene.VSMESH = bpy.props.BoolProperty(
-    name = "single mesh", description = "output to single mesh for using build modifier and particles for effects")
-bpy.types.Scene.VCUBE = bpy.props.BoolProperty(
-    name = "cubes", description = "CTRL-J after run to JOIN, outputs a bunch of cube objest, mostly for testing")
-bpy.types.Scene.VVOX = bpy.props.BoolProperty(        
-    name = "voxel (experimental)", description = "output to a voxel file to bpy.data.filepath\FSLGvoxels.raw - doesn't work well right now")
-bpy.types.Scene.IBOOL = bpy.props.BoolProperty(
-    name = "use insulator object", description = "use insulator mesh object to prevent growth of bolt in areas")
-bpy.types.Scene.OOB = bpy.props.StringProperty(description = "origin of bolt, can be an Empty, if obj is mesh will use all verts as charges")
-bpy.types.Scene.GOB = bpy.props.StringProperty(description = "object to use as ground plane, uses z coord only")
-bpy.types.Scene.COB = bpy.props.StringProperty(description = "object to use as cloud, best to use a cube")
-bpy.types.Scene.IOB = bpy.props.StringProperty(description = "object to use as insulator, 'voxelized' before generating bolt, can be slow")
-
-###---DEFAULT USER SETTINGS
-scn.TSTEPS = 350
-scn.HORDER = 1
-scn.GSCALE = 0.12
-scn.BIGVAR = 6.3
-scn.GROUNDBOOL = True
-scn.GROUNDC = -250
-scn.CLOUDBOOL = False
-scn.CLOUDC = -1
-scn.VMMESH = True
-scn.VSMESH = False
-scn.VCUBE = False
-scn.VVOX = False
-scn.IBOOL = False
-try:
-    scn.OOB = "ELorigin"
-    scn.GOB = "ELground"
-    scn.COB = "ELcloud"
-    scn.IOB = "ELinsulator"    
-except: pass
-### TESTING
-if False:
-#if True:
-    #scn.BIGVAR = 6.3
-    #scn.VSMESH = True
-    #scn.VMMESH = False
-    #scn.VCUBE = True
-    #scn.TSTEPS = 7500
-    scn.TSTEPS = 100
-    #scn.GROUNDC = -500
-    #scn.CLOUDC = -5
-    #scn.GROUNDBOOL = False
-    #scn.CLOUDBOOL = True
-    
-    #scn.IBOOL = True
-
-class runFSLGLoopOperator(bpy.types.Operator):
-    """By The Mighty Hammer Of Thor!!!"""
-    bl_idname = "object.runfslg_operator"
-    bl_label = "run FSLG Loop Operator"
-
-    def execute(self, context):
-        if checkSettings():
-            FSLG()
-        else: pass
-        return {'FINISHED'}
-    
-class setupObjectsOperator(bpy.types.Operator):
-    """Create origin/ground/cloud/insulator objects"""
-    bl_idname = "object.setup_objects_operator"
-    bl_label = "Setup Objects Operator"
-
-    def execute(self, context):
-        setupObjects()        
-        return {'FINISHED'}    
-
-class OBJECT_PT_fslg(bpy.types.Panel):
-    bl_label = "Laplacian Lightning - v0.2.6"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOLS"
-    bl_context = "objectmode"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        scn = context.scene
-        layout = self.layout
-        colR = layout.column()        
-        #row1 = layout.row()
-        #colL = row1.column()
-        #colR = row1.column()
-        colR.label('-for progress open console-')
-        colR.label('Help > Toggle System Console')        
-        colR.prop(scn, 'TSTEPS')
-        colR.prop(scn, 'GSCALE')        
-        colR.prop(scn, 'BIGVAR')
-        colR.operator('object.setup_objects_operator', text = 'create setup objects')        
-        colR.label('origin object')
-        colR.prop_search(scn, "OOB",  context.scene, "objects")        
-        colR.prop(scn, 'GROUNDBOOL')
-        colR.prop_search(scn, "GOB",  context.scene, "objects")        
-        colR.prop(scn, 'GROUNDC') 
-        colR.prop(scn, 'CLOUDBOOL')
-        colR.prop_search(scn, "COB",  context.scene, "objects")        
-        colR.prop(scn, 'CLOUDC')
-        colR.prop(scn, 'IBOOL')
-        colR.prop_search(scn, "IOB",  context.scene, "objects")
-        colR.operator('object.runfslg_operator', text = 'generate lightning')
-        #col.prop(scn, 'HORDER')
-        colR.prop(scn, 'VMMESH')
-        colR.prop(scn, 'VSMESH')        
-        colR.prop(scn, 'VCUBE')
-        colR.prop(scn, 'VVOX')
-
-def getReportString(rtime):
-    rSTRING1 = 't:' + str(scn.TSTEPS) + ',sc:' + str(scn.GSCALE)[0:4] + ',uv:' + str(scn.BIGVAR)[0:4] + ',' 
-    rSTRING2 = 'ori:' + str(scn. ORIGIN[0]) + '/' + str(scn. ORIGIN[1]) + '/' + str(scn. ORIGIN[2]) + ','
-    rSTRING3 = 'gz:' + str(scn.GROUNDZ) + ',gc:' + str(scn.GROUNDC) + ',rtime:' + str(int(rtime))
-    return rSTRING1 + rSTRING2 + rSTRING3
-
-def addReportProp(ob, str):
-    bpy.types.Object.FSLG_REPORT = bpy.props.StringProperty(
-	   name = 'fslg_report', default = '')
-    ob.FSLG_REPORT = str
-        
-def register():
-    bpy.utils.register_class(runFSLGLoopOperator)    
-    bpy.utils.register_class(setupObjectsOperator)
-    bpy.utils.register_class(OBJECT_PT_fslg)
-
-def unregister():
-    bpy.utils.unregister_class(runFSLGLoopOperator)    
-    bpy.utils.unregister_class(setupObjectsOperator)    
-    bpy.utils.unregister_class(OBJECT_PT_fslg)
-
-if __name__ == "__main__":
-    ### RUN FOR TESTING
-    #FSLG()
-    
-    ### UI
-    register()
-    pass
-
-###########################
-##### FXN BENCHMARKS ######
-###########################
-def BENCH():
-    print('\n\n\n--->BEGIN BENCHMARK')
-    bt0 = time.clock()
-    ###---MAKE A BIG LIST
-    tsize = 25
-    tlist = []
-    for x in range(tsize):
-        for y in range(tsize):
-            for z in range(tsize):
-                tlist.append((x,y,z))
-                tlist.append((x,y,z))
-
-    ###---FUNCTION TO TEST
-    bt1 = time.clock()
-
-    #ll = deDupe(tlist)
-    #ll = f5(tlist)
-    print('LENS - ', len(tlist), len(ll) )
-
-    bt2 = time.clock()
-    btRUNb = bt2 - bt1
-    btRUNa = bt1 - bt0
-    print('--->SETUP TIME    : ', btRUNa)
-    print('--->BENCHMARK TIME: ', btRUNb)
-    print('--->GRIDSIZE: ', tsize, ' - ', tsize*tsize*tsize)
-    
-#BENCH()    
-
-
-##################################
-################################
diff --git a/release/scripts/addons_contrib/object_mangle_tools.py b/release/scripts/addons_contrib/object_mangle_tools.py
deleted file mode 100644
index 3102623..0000000
--- a/release/scripts/addons_contrib/object_mangle_tools.py
+++ /dev/null
@@ -1,206 +0,0 @@
-# mangle_tools.py (c) 2011 Phil Cote (cotejrp1)
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-bl_info = {
-    "name": "Mangle Tools",
-    "author": "Phil Cote",
-    "version": (0, 2),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tools",
-    "description": "Set of tools to mangle curves, meshes, and shape keys",
-    "warning": "", # used for warning icon and text in addons panel
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=29071",
-    "category": "Object"}
-
-import bpy
-import random
-import time
-from math import pi
-import bmesh
-
-def move_coordinate(context, co, is_curve=False):
-    xyz_const = context.scene.constraint_vector
-    random.seed(time.time())
-    multiplier = 1
-
-    # For curves, we base the multiplier on the circumference formula.
-    # This helps make curve changes more noticable.
-    if is_curve:
-        multiplier = 2 * pi
-    random_mag = context.scene.random_magnitude
-    if xyz_const[0]:    
-        co.x += .01 * random.randrange( -random_mag, random_mag ) * multiplier
-    if xyz_const[1]:
-        co.y += .01 * random.randrange( -random_mag, random_mag )  * multiplier
-    if xyz_const[2]:
-        co.z += .01 * random.randrange( -random_mag, random_mag ) * multiplier
-
-
-class MeshManglerOperator(bpy.types.Operator):
-    """Push vertices on the selected object around in random """ \
-    """directions to create a crumpled look"""
-    bl_idname = "ba.mesh_mangler"
-    bl_label = "Mangle Mesh"
-    bl_options = { "REGISTER", "UNDO" }
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return ob != None and ob.type == 'MESH'
-
-    def execute(self, context):
-        mesh = context.active_object.data
-        bm = bmesh.new()
-        bm.from_mesh(mesh)
-        verts, faces = bm.verts, bm.faces
-        randomMag = context.scene.random_magnitude
-        random.seed( time.time() )
-
-        if mesh.shape_keys != None:
-            self.report({'INFO'}, "Cannot mangle mesh: Shape keys present")
-            return {'CANCELLED'}
-        
-        for vert in verts:
-            xVal = .01 * random.randrange( -randomMag, randomMag )
-            yVal = .01 * random.randrange( -randomMag, randomMag)
-            zVal = .01 * random.randrange( -randomMag, randomMag )
-            vert.co.x = vert.co.x + xVal
-            vert.co.y = vert.co.y + yVal
-            vert.co.z = vert.co.z + zVal
-                
-        bm.to_mesh(mesh)   
-        mesh.update()
-        return {'FINISHED'}
-
-
-class AnimanglerOperator(bpy.types.Operator):
-    """Make a shape key and pushes the verts around on it """ \
-    """to set up for random pulsating animation"""
-    bl_idname = "ba.ani_mangler"
-    bl_label = "Mangle Shape Key"
-
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return ob != None and ob.type in [ 'MESH', 'CURVE' ]
-
-    def execute(self, context):
-        scn = context.scene
-        mangleName = scn.mangle_name
-        ob = context.object
-        shapeKey = ob.shape_key_add( name=mangleName )
-        verts = shapeKey.data
-        
-        for vert in verts:
-            move_coordinate(context, vert.co, is_curve=ob.type=='CURVE')
-            
-        return {'FINISHED'}
-
-
-class CurveManglerOp(bpy.types.Operator):
-    """Mangle a curve to the degree the user specifies"""
-    bl_idname = "ba.curve_mangler"
-    bl_label = "Mangle Curve"
-    bl_options = { 'REGISTER', 'UNDO' }
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return ob != None and ob.type == "CURVE"
-
-
-    def execute(self, context):
-
-        ob = context.active_object
-        if ob.data.shape_keys != None:
-            self.report({'INFO'}, "Cannot mangle curve.  Shape keys present")
-            return {'CANCELLED'}
-        splines = context.object.data.splines
-        
-        for spline in splines:
-            if spline.type == 'BEZIER':
-                points = spline.bezier_points
-            elif spline.type in {'POLY', 'NURBS'}:
-                points = spline.points
-
-            for point in points:
-                move_coordinate(context, point.co, is_curve=True)
-
-        return {'FINISHED'}
-
-
-class MangleToolsPanel(bpy.types.Panel):
-    bl_label = "Mangle Tools"
-    bl_space_type = "VIEW_3D"
-    bl_region_type="TOOLS"
-    bl_context = "objectmode"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        scn = context.scene
-        layout = self.layout
-        col = layout.column()
-        col.prop(scn, "constraint_vector")
-        col.prop(scn, "random_magnitude")
-
-        col.operator("ba.curve_mangler")
-        col.operator("ba.mesh_mangler")
-        col.separator()
-        col.prop(scn, "mangle_name")
-        col.operator("ba.ani_mangler")
-
-
-IntProperty = bpy.props.IntProperty
-StringProperty = bpy.props.StringProperty
-BoolVectorProperty = bpy.props.BoolVectorProperty
-
-def register():
-    bpy.utils.register_class(AnimanglerOperator)
-    bpy.utils.register_class(MeshManglerOperator)
-    bpy.utils.register_class(CurveManglerOp)
-    bpy.utils.register_class(MangleToolsPanel)
-    scnType = bpy.types.Scene
-    
-                                    
-    scnType.constraint_vector = BoolVectorProperty(name="Mangle Constraint", 
-                                default=(True,True,True),
-                                subtype='XYZ',
-                                description="Constrains Mangle Direction")
-                                
-    scnType.random_magnitude = IntProperty( name = "Mangle Severity", 
-                              default = 10, min = 1, max = 30, 
-                              description = "Severity of mangling")
-    
-    scnType.mangle_name = StringProperty(name="Shape Key Name",
-                             default="mangle",
-                             description="Name given for mangled shape keys")
-def unregister():
-    bpy.utils.unregister_class(AnimanglerOperator)
-    bpy.utils.unregister_class(MeshManglerOperator)
-    bpy.utils.unregister_class(MangleToolsPanel)
-    bpy.utils.unregister_class(CurveManglerOp)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/object_powerlib.py b/release/scripts/addons_contrib/object_powerlib.py
deleted file mode 100644
index 8c5f336..0000000
--- a/release/scripts/addons_contrib/object_powerlib.py
+++ /dev/null
@@ -1,329 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Powerlib",
-    "description": "Control panel for managing "
-    "groups contained in linked libraries",
-    "author": "Olivier Amrein, Francesco Siddi",
-    "version": (0, 5),
-    "blender": (2, 53, 0),
-    "location": "Properties Panel",
-    "warning": "",  # used for warning icon and text in addons panel
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/PowerLib",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=31475&group_id=153&atid=467",
-    "category": "3D View"}
-
-import bpy
-from bpy.props import (FloatProperty, BoolProperty, 
-FloatVectorProperty, StringProperty, EnumProperty)
-
-#  Generic function to toggle across 3 different model resolutions
-def SetProxyResolution(elem,target_resolution):
-
-    obj = bpy.data.objects[elem.name]
-
-    try: 
-       dupgroup_name = obj.dupli_group.name
-    except: 
-        return
-    
-    root = dupgroup_name[:-3]
-    ext = dupgroup_name[-3:]
-    new_group = root + target_resolution
-
-    if ext in {'_hi', '_lo', '_me'}:
-        try: 
-            obj.dupli_group = bpy.data.groups[new_group]
-            #print("PowerLib: CHANGE " + str(elem) + " to " + new_group)
-        except:
-            print ("Group %s not found" % new_group.upper())
-            
-            
-class PowerlibPanel(bpy.types.Panel):
-    bl_label = "Powerlib"
-    bl_idname = "SCENE_PT_powerlib"
-    bl_context = "scene"
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-
-    def draw(self, context):
-        layout = self.layout
-        object = bpy.context.active_object
-        scene = context.scene
-        active_subgroup = scene.ActiveSubgroup
-        
-        if len(active_subgroup) > 0:
-            ob = bpy.data.objects[active_subgroup]
-        else:
-            ob = bpy.context.active_object
-
-        if ob.dupli_type == 'GROUP':
-            group = ob.dupli_group
-            group_name = group.name  # set variable for group toggle
-            group_objs = bpy.data.groups[group.name].objects
-            total_groups = 0
-
-            row = layout.row()
-            row.label(" GROUP: " + group.name, icon = 'GROUP')
-            active_subgroup = scene.ActiveSubgroup
-            if len(active_subgroup) > 0:
-                subgroup = row.operator("powerlib.display_subgroup_content",
-                text="Back to subgroup", icon='BACK')
-                subgroup.item_name = ''
-            
-            box = layout.box()         
-
-            for elem in group_objs:
-
-                if elem.dupli_group != None:
-                    row = box.row()   
-                    col=row.row()
-                                     
-                    total_groups += 1
-                    
-                    if (elem.dupli_type == 'GROUP'):
-                        subgroup = col.operator("powerlib.toggle_subgroup",
-                        text="", icon='RESTRICT_VIEW_OFF', emboss=False)
-                        subgroup.display = "NONE"
-                        subgroup.item_name = elem.name
-                        subgroup.group_name = group.name
-                        col.label(elem.name)
-                    else:
-                        subgroup = col.operator("powerlib.toggle_subgroup",
-                        text="", icon='RESTRICT_VIEW_ON', emboss=False)
-                        subgroup.display = "GROUP"
-                        subgroup.item_name = elem.name
-                        subgroup.group_name = group.name
-                        col.label(elem.name)
-                        
-                    if len(bpy.data.groups[elem.dupli_group.name].objects.items()) > 1:
-                        subgroup = col.operator("powerlib.display_subgroup_content",
-                        text="Explore", icon='GROUP')
-                        subgroup.item_name = elem.name
-                    else:
-                        col.label(text="")
-                       
-                    resolution = str(elem.dupli_group.name)[-3:]
-                    if resolution in {'_hi', '_lo', '_me'}:
-                        res = resolution[-2:].upper()
-
-                        subgroup = col.operator("powerlib.toggle_subgroup_res",
-                        text=res, icon='FILE_REFRESH')
-                        subgroup.item_name = elem.name
-                        subgroup.group_name = group.name
-                    else:
-                        col.label(text="")
-                else:
-                    pass   
-        
-            if total_groups == 0 :
-                box.label(" No subgroups found in this group",icon="LAYER_USED")
-                resolution = str(object.dupli_group.name)[-3:]
-                if resolution in {'_hi', '_lo', '_me'}:
-
-                    res = resolution[-2:].upper()
-
-                    subgroup = box.operator("powerlib.toggle_subgroup_res",
-                    text=res, icon='FILE_REFRESH')
-                    subgroup.item_name = bpy.context.active_object.name
-                    subgroup.group_name = group.name
-            else:
-                row = layout.row(align=True)
-                row.label("Total groups: " + str(total_groups))
-                box = layout.box()
-                row = box.row(align=True)
-                group = row.operator("powerlib.toggle_group",
-                text="Show All", icon='RESTRICT_VIEW_OFF')
-                group.display = "showall"
-                group.group_name = group_name
-    
-                group = row.operator("powerlib.toggle_group",
-                text="Hide All", icon='RESTRICT_VIEW_ON')
-                group.display = "hideall"
-                group.group_name = group_name
-
-                row = box.row()
-                
-                row.label(text="Set all subgroups to: ")
-
-                row = box.row(align=True)
-
-                group = row.operator("powerlib.toggle_group",
-                text="Low", icon='MESH_CIRCLE')
-                group.display = "low"
-                group.group_name = group_name
-                
-                group = row.operator("powerlib.toggle_group",
-                text="Medium", icon='MESH_UVSPHERE')
-                group.display = "medium"
-                group.group_name = group_name
-                
-                group = row.operator("powerlib.toggle_group",
-                text="High", icon='MESH_ICOSPHERE')
-                group.display = "high"
-                group.group_name = group_name
-                        
-        else:
-            layout.label(" Select a group")            
-
-
-class ToggleSubgroupResolution(bpy.types.Operator):
-    bl_idname = "powerlib.toggle_subgroup_res"
-    bl_label = "Powerlib Toggle Soubgroup Res"
-    bl_description = "Change the resolution of a subgroup"
-    item_name = bpy.props.StringProperty()
-    group_name = bpy.props.StringProperty()
-
-    def execute(self, context):
-
-        group_name = self.group_name
-        item_name = self.item_name
-
-        obj = bpy.data.objects[item_name]
-
-        dupgroup = obj.dupli_group
-        dupgroup_name = obj.dupli_group.name
-
-        root = dupgroup_name[:-2]
-        ext = dupgroup_name[-2:]
-        
-        if (root + 'me') in bpy.data.groups:
-            if ext == 'hi':
-                new_group = root + "me"
-            elif ext == 'me':
-                new_group = root + "lo"
-            elif ext == 'lo':
-                new_group = root + "hi"
-            else:
-                new_group = dupgroup  # if error, do not change dupligroup
-        else:
-            if ext == 'hi':
-                new_group = root + "lo"
-            elif ext == 'lo':
-                new_group = root + "hi"
-            else:
-                new_group = dupgroup  # if error, do not change dupligroup
-
-        if bpy.data.groups[dupgroup_name].library:
-            # link needed object
-            filepath = bpy.data.groups[dupgroup_name].library.filepath
-
-            print(filepath)
-            with bpy.data.libraries.load(filepath, 
-            link=True) as (data_from, data_to):
-                data_to.groups.append(new_group)
-
-        try: 
-            obj.dupli_group = bpy.data.groups[new_group]
-            print("PowerLib: CHANGE " + str(item_name) + " to " + new_group)
-        except:
-            self.report({'WARNING'}, "Group %s not found" % new_group.upper())
-
-        return {'FINISHED'}
-
-
-class ToggleAllSubgroups(bpy.types.Operator):
-    bl_idname = "powerlib.toggle_group"
-    bl_label = "Powerlib Toggle Group"
-    bl_description = "Toggle a property for all subgroups"
-    display = bpy.props.StringProperty()
-    group_name = bpy.props.StringProperty()
-
-    def execute(self, context):
-
-        display = self.display
-        grp_name = self.group_name
-        group_objs = bpy.data.groups[grp_name].objects
-
-        for elem in group_objs:
-            if display == 'showall':
-                elem.dupli_type = "GROUP"
-                #print("Powerlib: SHOW " + elem.name)
-            elif display == 'hideall':
-                elem.dupli_type = "NONE"
-                #print("Powerlib: HIDE " + elem.name)
-            if display == 'low':
-                #print("Powerlib: ALL LOW " + elem.name)
-                SetProxyResolution(elem,'_lo')
-            elif display == 'medium':
-                #print("Powerlib: ALL MEDIUM " + elem.name)
-                SetProxyResolution(elem,'_me')
-            elif display == 'high':
-                #print("Powerlib: ALL HIGH " + elem.name)
-                SetProxyResolution(elem,'_hi')
-            else:
-                print("nothing")
-
-        return {'FINISHED'}
-    
-    
-class ToggleSubgroupDisplay(bpy.types.Operator):
-    bl_idname = "powerlib.toggle_subgroup"
-    bl_label = "Powelib Toggle Subgroup"
-    bl_description = "Toggle the display of a subgroup"
-    display = bpy.props.StringProperty()
-    item_name = bpy.props.StringProperty()
-    group_name = bpy.props.StringProperty()
-    
-    def execute(self, context):
-
-        display = self.display
-        obj_name = self.item_name
-        grp_name = self.group_name
-
-        print("Powerlib: " + obj_name + " is being set to " + display)
-
-        bpy.data.groups[grp_name].objects[obj_name].dupli_type = display
-        return {'FINISHED'}
-    
-    
-class DisplaySubgroupContent(bpy.types.Operator):
-    bl_idname = "powerlib.display_subgroup_content"
-    bl_label = "Powerlib Display Subgroup Content"
-    bl_description = "Display the content of a subgroup"
-
-    item_name = bpy.props.StringProperty()
-    
-    def execute(self, context):
-        scene = context.scene
-        scene.ActiveSubgroup = self.item_name
-        return {'FINISHED'}
-    
-
-def register():
-    bpy.types.Scene.ActiveSubgroup = StringProperty(
-            name="Commit untracked",
-            default="",
-            description="Add untracked files into svn and commit all of them")
-    bpy.utils.register_class(DisplaySubgroupContent)
-    bpy.utils.register_class(ToggleSubgroupResolution)
-    bpy.utils.register_class(ToggleAllSubgroups)
-    bpy.utils.register_class(ToggleSubgroupDisplay)
-    bpy.utils.register_class(PowerlibPanel)
-    
-def unregister():
-    del bpy.types.Scene.ActiveSubgroup
-    bpy.utils.unregister_class(DisplaySubgroupContent)
-    bpy.utils.unregister_class(ToggleSubgroupResolution)
-    bpy.utils.unregister_class(ToggleAllSubgroups)
-    bpy.utils.unregister_class(ToggleSubgroupDisplay)
-    bpy.utils.unregister_class(PowerlibPanel)
-    
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/object_render_wire.py b/release/scripts/addons_contrib/object_render_wire.py
deleted file mode 100644
index 4ffb03f..0000000
--- a/release/scripts/addons_contrib/object_render_wire.py
+++ /dev/null
@@ -1,421 +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 th
-# 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.
-#
-# object_render_wire.py liero, meta-androcto,
-# Yorik van Havre, Alejandro Sierra, Howard Trickey
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Render Wireframe",
-    "author": "Community",
-    "description": " WireRender & WireSoild modes",
-    "version": (2, 3),
-    "blender": (2, 63, 0),
-    "location": "Object > Render Wireframe",
-    "warning": '',
-    'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts',
-    'tracker_url': 'https://projects.blender.org/tracker/index.php?'\
-                   'func=detail&aid=26997',
-    'category': 'Object'}
-
-import bpy, mathutils
-
-cube_faces = [ [0,3,2,1], [5,6,7,4], [0,1,5,4],
-               [7,6,2,3], [2,6,5,1], [0,4,7,3] ]
-cube_normals = [ mathutils.Vector((0,0,-1)),
-                 mathutils.Vector((0,0,1)),
-                 mathutils.Vector((0,-1,0)),
-                 mathutils.Vector((0,1,0)),
-                 mathutils.Vector((1,0,0)),
-                 mathutils.Vector((-1,0,0)) ]
-
-def create_cube(me, v, d):
-    x = v.co.x
-    y = v.co.y
-    z = v.co.z
-    coords=[ [x-d,y-d,z-d], [x+d,y-d,z-d], [x+d,y+d,z-d], [x-d,y+d,z-d],
-         [x-d,y-d,z+d], [x+d,y-d,z+d], [x+d,y+d,z+d], [x-d,y+d,z+d] ]
-    for coord in coords:
-        me.vertices.add(1)
-        me.vertices[-1].co = mathutils.Vector(coord)
-
-def norm_dot(e, k, fnorm, me):
-    v = me.vertices[e[1]].co - me.vertices[e[0]].co
-    if k == 1:
-        v = -v
-    v.normalize()
-    return v * fnorm
-
-def fill_cube_face(me, index, f):
-    return [index + cube_faces[f][i] for i in range(4)]
-
-# Coords of jth point of face f in cube instance i
-def cube_face_v(me, f, i, j):
-    return me.vertices[i + cube_faces[f][j]].co
-
-def cube_face_center(me, f, i):
-    return 0.5 * (cube_face_v(me, f, i, 0) + \
-                  cube_face_v(me, f, i, 2))
-
-# Return distance between points on two faces when
-# each point is projected onto the plane that goes through
-# the face center and is perpendicular to the line
-# through the face centers.
-def projected_dist(me, i1, i2, f1, f2, j1, j2):
-    f1center = cube_face_center(me, f1, i1)
-    f2center = cube_face_center(me, f2, i2)
-    axis_norm = (f2center - f1center).normalized()
-    v1 = cube_face_v(me, f1, i1, j1)
-    v2 = cube_face_v(me, f2, i2, j2)
-    v1proj = v1 - (axis_norm * (v1 - f1center)) * axis_norm
-    v2proj = v2 - (axis_norm * (v2 - f2center)) * axis_norm
-    return (v2proj - v1proj).length
-
-def skin_edges(me, i1, i2, f1, f2):
-    # Connect verts starting at i1 forming cube face f1
-    # to those starting at i2 forming cube face f2.
-    # Need to find best alignment to avoid a twist.
-    shortest_length = 1e6
-    f2_start_index = 0
-    for i in range(4):
-        x = projected_dist(me, i1, i2, f1, f2, 0, i)
-        if x < shortest_length:
-            shortest_length = x
-            f2_start_index = i
-    ans = []
-    j = f2_start_index
-    for i in range(4):
-        fdata = [i1 + cube_faces[f1][i],
-                 i2 + cube_faces[f2][j],
-                 i2 + cube_faces[f2][(j + 1) % 4],
-                 i1 + cube_faces[f1][(i - 1) % 4]]
-        if fdata[3] == 0:
-            fdata = [fdata[3]] + fdata[0:3]
-        ans.extend(fdata)
-        j = (j - 1) % 4
-    return ans
-            
-
-# Return map: v -> list of length len(node_normals) where
-# each element of the list is either None (no assignment)
-# or ((v0, v1), 0 or 1) giving an edge and direction that face is assigned to.
-def find_assignment(me, edges, vert_edges, node_normals):
-    nf = len(node_normals)
-    feasible = {}
-    for e in edges:
-        for k in (0, 1):
-            fds = [(f, norm_dot(e, k, node_normals[f], me)) for f in range(nf)]
-            feasible[(e, k)] = [fd for fd in fds if fd[1] > 0.01]
-    assignment = {}
-    for v, ves in vert_edges.items():
-        assignment[v] = best_assignment(ves, feasible, nf)
-    return assignment
-
-def best_assignment(ves, feasible, nf):
-    apartial = [ None ] * nf
-    return best_assign_help(ves, feasible, apartial, 0.0)[0]
-
-def best_assign_help(ves, feasible, apartial, sumpartial):
-    if len(ves) == 0:
-        return (apartial, sumpartial)
-    else:
-        ek0 = ves[0]
-        vesrest = ves[1:]
-        feas = feasible[ek0]
-        bestsum = 0
-        besta = None
-        for (f, d) in feas:
-            if apartial[f] is None:
-                ap = apartial[:]
-                ap[f] = ek0
-                # sum up d**2 to penalize smaller d's more
-                sp = sumpartial + d*d
-                (a, s) = best_assign_help(vesrest, feasible, ap, sp)
-                if s > bestsum:
-                    bestsum = s
-                    besta = a
-        if besta:
-            return (besta, bestsum)
-        else:
-            # not feasible to assign e0, k0; try to assign rest
-            return best_assign_help(vesrest, feasible, apartial, sumpartial)
-
-def assigned_face(e, assignment):
-    (v0, v1), dir = e
-    a = assignment[v1]
-    for j, ee in enumerate(a):
-        if e == ee:
-            return j
-    return -1
-
-def create_wired_mesh(me2, me, thick):
-    edges = []
-    vert_edges = {}
-    for be in me.edges:
-        if be.select and not be.hide:
-            e = (be.key[0], be.key[1])
-            edges.append(e)
-            for k in (0, 1):
-                if e[k] not in vert_edges:
-                    vert_edges[e[k]] = []
-                vert_edges[e[k]].append((e, k))
-
-    assignment = find_assignment(me, edges, vert_edges, cube_normals)
-
-    # Create the geometry
-    n_idx = {}   
-    for v in assignment:
-        vpos = me.vertices[v]
-        index = len(me2.vertices)
-        # We need to associate each node with the new geometry
-        n_idx[v] = index   
-        # Geometry for the nodes, each one a cube
-        create_cube(me2, vpos, thick)
-
-    # Skin using the new geometry 
-    cfaces = []  
-    for k, f in assignment.items():
-        # Skin the nodes
-        for i in range(len(cube_faces)):
-            if f[i] is None:
-                cfaces.extend(fill_cube_face(me2, n_idx[k], i))
-            else:
-                (v0, v1), dir = f[i]
-                # only skin between edges in forward direction
-                # to avoid making doubles
-                if dir == 1:
-                    # but first make sure other end actually assigned
-                    i2 = assigned_face(((v0, v1), 0), assignment)
-                    if i2 == -1:
-                        cfaces.extend(fill_cube_face(me2, n_idx[k], i))
-                    continue
-                i2 = assigned_face(((v0, v1), 1), assignment)
-                if i2 != -1:
-                    cfaces.extend(skin_edges(me2, n_idx[v0], n_idx[v1], i, i2))
-                else:
-                    # assignment failed for this edge
-                    cfaces.extend(fill_cube_face(me2, n_idx[k], i))
-
-    # adding faces to the mesh
-    me2.tessfaces.add(len(cfaces) // 4)
-    me2.tessfaces.foreach_set("vertices_raw", cfaces)
-    me2.update(calc_edges=True)
-
-# Add built in wireframe
-def wire_add(mallas):
-    if mallas:
-        bpy.ops.object.select_all(action='DESELECT')
-        bpy.context.scene.objects.active = mallas[0]
-        for o in mallas: o.select = True
-        bpy.ops.object.duplicate()
-        obj, sce = bpy.context.object, bpy.context.scene
-        for mod in obj.modifiers: obj.modifiers.remove(mod)
-        bpy.ops.object.join()
-        bpy.ops.object.mode_set(mode='EDIT')
-        bpy.ops.mesh.wireframe(thickness=0.005)
-        bpy.ops.object.mode_set()
-        for mat in obj.material_slots: bpy.ops.object.material_slot_remove()
-        if 'wire_object' in sce.objects.keys():
-            sce.objects.get('wire_object').data = obj.data
-            sce.objects.get('wire_object').matrix_world = mallas[0].matrix_world
-            sce.objects.unlink(obj)
-        else:
-            obj.name = 'wire_object'
-        obj.data.materials.append(bpy.data.materials.get('mat_wireobj'))
-
-    return{'FINISHED'}
-'''
-class VIEW3D_PT_tools_SolidifyWireframe(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_context = "mesh_edit"
-    bl_label = "Solidify Wireframe"
-
-    def draw(self, context):
-        active_obj = context.active_object
-        layout = self.layout
-        col = layout.column(align=True)
-        col.operator("mesh.solidify_wireframe", text="Solidify")
-        col.prop(context.scene, "swThickness")
-        col.prop(context.scene, "swSelectNew")
-'''
-# a class for your operator
-class SolidifyWireframe(bpy.types.Operator):
-    """Turns the selected edges of a mesh into solid objects"""
-    bl_idname = "mesh.solidify_wireframe"
-    bl_label = "Solidify Wireframe"
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    def invoke(self, context, event):
-        return self.execute(context)
-
-    @classmethod
-    def poll(cls, context):
-        ob = context.active_object
-        return ob and ob.type == 'MESH'
-
-    def execute(self, context):
-        # Get the active object
-        ob_act = context.active_object
-        # getting current edit mode
-        currMode = ob_act.mode
-        # switching to object mode
-        bpy.ops.object.mode_set(mode='OBJECT')
-        bpy.ops.object.select_all(action='DESELECT')
-        # getting mesh data
-        mymesh = ob_act.data
-        #getting new mesh
-        newmesh = bpy.data.meshes.new(mymesh.name + " wire")
-        obj = bpy.data.objects.new(newmesh.name,newmesh)
-        obj.location = ob_act.location
-        obj.rotation_euler = ob_act.rotation_euler
-        obj.scale = ob_act.scale
-        context.scene.objects.link(obj)
-        create_wired_mesh(newmesh, mymesh, context.scene.swThickness)
-
-        # restoring original editmode if needed
-        if context.scene.swSelectNew:
-            obj.select = True
-            context.scene.objects.active = obj
-        else:
-            bpy.ops.object.mode_set(mode=currMode)
-
-        # returning after everything is done
-        return {'FINISHED'}
-		
-class WireMaterials(bpy.types.Operator):
-    bl_idname = 'scene.wire_render'
-    bl_label = 'Apply Materials'
-    bl_description = 'Set Up Materials for a Wire Render'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    def execute(self, context):
-        wm = bpy.context.window_manager
-        sce = bpy.context.scene
-
-        if 'mat_clay' not in bpy.data.materials:
-            mat = bpy.data.materials.new('mat_clay')
-            mat.specular_intensity = 0
-        else: mat = bpy.data.materials.get('mat_clay')
-        mat.diffuse_color = wm.col_clay
-        mat.use_shadeless = wm.shadeless_mat
-
-        if 'mat_wire' not in bpy.data.materials:
-            mat = bpy.data.materials.new('mat_wire')
-            mat.specular_intensity = 0
-            mat.use_transparency = True
-            mat.type = 'WIRE'
-            mat.offset_z = 0.05
-        else: mat = bpy.data.materials.get('mat_wire')
-        mat.diffuse_color = wm.col_wire
-        mat.use_shadeless = wm.shadeless_mat
-
-        try: bpy.ops.object.mode_set()
-        except: pass
-
-        if wm.selected_meshes: objetos = bpy.context.selected_objects
-        else: objetos = sce.objects
-
-        mallas = [o for o in objetos if o.type == 'MESH' and o.is_visible(sce) and o.name != 'wire_object']
-
-        for obj in mallas:
-            sce.objects.active = obj
-            print ('procesando >', obj.name)
-            obj.show_wire = wm.wire_view
-            for mat in obj.material_slots:
-                bpy.ops.object.material_slot_remove()
-            obj.data.materials.append(bpy.data.materials.get('mat_wire'))
-            obj.data.materials.append(bpy.data.materials.get('mat_clay'))
-            obj.material_slots.data.active_material_index = 1
-            bpy.ops.object.editmode_toggle()
-            bpy.ops.mesh.select_all(action='SELECT')
-            bpy.ops.object.material_slot_assign()
-            bpy.ops.object.mode_set()
-
-        if wm.wire_object:
-            if 'mat_wireobj' not in bpy.data.materials:
-                mat = bpy.data.materials.new('mat_wireobj')
-                mat.specular_intensity = 0
-            else: mat = bpy.data.materials.get('mat_wireobj')
-            mat.diffuse_color = wm.col_wire
-            mat.use_shadeless = wm.shadeless_mat
-            wire_add(mallas)
-
-        return{'FINISHED'}
-
-class PanelWMat(bpy.types.Panel):
-    bl_label = 'Setup Wire Render'
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        wm = bpy.context.window_manager
-        active_obj = context.active_object
-        layout = self.layout
-
-        column = layout.column(align=True)
-        column.prop(wm, 'col_clay')
-        column.prop(wm, 'col_wire')
-        column = layout.column(align=True)
-        column.prop(wm, 'selected_meshes')
-        column.prop(wm, 'shadeless_mat')
-        column.prop(wm, 'wire_view')
-        column.prop(wm, 'wire_object')
-        column.separator()
-        column.operator('scene.wire_render')
-        column.label(text='- - - - - - - - - - - - - - - - - - - - - -')
-        col = layout.column(align=True)
-        column.label(text='Solid WireFrame')
-        layout.operator("mesh.solidify_wireframe", text="Create Mesh Object")
-        col.prop(context.scene, "swThickness")
-        col.prop(context.scene, "swSelectNew")
-bpy.types.WindowManager.selected_meshes = bpy.props.BoolProperty(name='Selected Meshes', default=False, description='Apply materials to Selected Meshes / All Visible Meshes')
-bpy.types.WindowManager.shadeless_mat = bpy.props.BoolProperty(name='Shadeless', default=False, description='Generate Shadeless Materials')
-bpy.types.WindowManager.col_clay = bpy.props.FloatVectorProperty(name='', description='Clay Color', default=(1.0, 0.9, 0.8), min=0, max=1, step=1, precision=3, subtype='COLOR_GAMMA', size=3)
-bpy.types.WindowManager.col_wire = bpy.props.FloatVectorProperty(name='', description='Wire Color', default=(0.1 ,0.0 ,0.0), min=0, max=1, step=1, precision=3, subtype='COLOR_GAMMA', size=3)
-bpy.types.WindowManager.wire_view = bpy.props.BoolProperty(name='Viewport Wires', default=False, description='Overlay wires display over solid in Viewports')
-bpy.types.WindowManager.wire_object = bpy.props.BoolProperty(name='Create Mesh Object', default=False, description='Add a Wire Object to scene to be able to render wires in Cycles')
-bpy.types.Scene.swThickness = bpy.props.FloatProperty(name="Thickness", description="Thickness of the skinned edges", default=0.01)
-bpy.types.Scene.swSelectNew = bpy.props.BoolProperty(name="Select wire", description="If checked, the wire object will be selected after creation", default=True)
-
-# Register the operator
-def solidifyWireframe_menu_func(self, context):
-        self.layout.operator(SolidifyWireframe.bl_idname, text="Solidify Wireframe", icon='PLUGIN')
-
-# Add "Solidify Wireframe" menu to the "Mesh" menu.
-def register():
-        bpy.utils.register_class(WireMaterials)
-        bpy.utils.register_class(PanelWMat)
-        bpy.utils.register_module(__name__)
-        bpy.types.Scene.swThickness = bpy.props.FloatProperty(name="Thickness",
-                                                              description="Thickness of the skinned edges",
-                                                              default=0.01)
-        bpy.types.Scene.swSelectNew = bpy.props.BoolProperty(name="Select wire",
-                                                             description="If checked, the wire object will be selected after creation",
-                                                             default=True)
-        bpy.types.VIEW3D_MT_edit_mesh_edges.append(solidifyWireframe_menu_func)
-
-# Remove "Solidify Wireframe" menu entry from the "Mesh" menu.
-def unregister():
-        bpy.utils.unregister_class(WireMaterials)
-        bpy.utils.unregister_class(PanelWMat)
-        bpy.utils.unregister_module(__name__)
-        del bpy.types.Scene.swThickness
-        bpy.types.VIEW3D_MT_edit_mesh_edges.remove(solidifyWireframe_menu_func)
-
-if __name__ == "__main__":
-        register()
diff --git a/release/scripts/addons_contrib/online_mat_lib/__init__.py b/release/scripts/addons_contrib/online_mat_lib/__init__.py
deleted file mode 100644
index 3a78fff..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/__init__.py
+++ /dev/null
@@ -1,3782 +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 3 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, see http://www.gnu.org/licenses/
-#  or write to the Free Software Foundation, Inc., 51 Franklin Street,
-#  Fifth Floor, Boston, MA 02110-1301, USA.
-#
-#  The Original Code is Copyright (C) 2012 by Peter Cassetta    ###
-#  All rights reserved.
-#
-#  Contact:                        matlib at peter.cassetta.info   ###
-#  Information:  http://peter.cassetta.info/material-library/   ###
-#
-#  The Original Code is: all of this file.
-#
-#  Contributor(s): Peter Cassetta.
-#
-#  ***** END GPL LICENSE BLOCK *****
-
-bl_info = {
-    "name": "Online Material Library",
-    "author": "Peter Cassetta",
-    "version": (0, 5),
-    "blender": (2, 63, 0),
-    "location": "Properties > Material > Online Material Library",
-    "description": "Browse and download materials from online CC0 libraries.",
-    "warning": "Beta version",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Material/Online_Material_Library",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=31802",
-    "category": "Material"}
-
-import bpy
-from bpy_extras.io_utils import ExportHelper
-import os.path
-import http.client
-import xml.dom.minidom
-
-library = ""
-library_data = []
-update_data = ["Up-to-date.", ""]
-
-library_enum_items = [("peter.cassetta.info/material-library/release/", "Peter's Library - Release", "Stable library hosted on peter.cassetta.info (Default)"),
-                      ("peter.cassetta.info/material-library/testing/", "Peter's Library - Testing", "Continually updated library hosted on peter.cassetta.info (Online only)"),
-                      ("bundled", "Bundled Library", "The library bundled with this add-on (Offline only)")]
-bpy.types.Scene.mat_lib_library = bpy.props.EnumProperty(name = "Select library:", items = library_enum_items, description = "Choose a library", options = {'SKIP_SAVE'})
-
-working_mode = "none"
-mat_lib_host = ""
-mat_lib_location = ""
-mat_lib_cached_files = -1
-
-mat_lib_folder = ""
-
-def findLibrary():
-    global mat_lib_folder
-    
-    if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.64:
-        if len(bpy.utils.script_paths()) > 2 and os.path.exists(os.path.join(str(bpy.utils.script_paths()[2]), "addons", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(str(bpy.utils.script_paths()[2]), "addons", "online_mat_lib", "material-library")
-        elif len(bpy.utils.script_paths()) > 1 and os.path.exists(os.path.join(bpy.utils.script_paths()[1], "addons", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(bpy.utils.script_paths()[1], "addons", "online_mat_lib", "material-library")
-        elif os.path.exists(os.path.join(bpy.utils.script_paths()[0], "addons", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(bpy.utils.script_paths()[0], "addons", "online_mat_lib", "material-library")
-        elif os.path.exists(os.path.join(bpy.utils.script_paths()[0], "addons_contrib", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(bpy.utils.script_paths()[0], "addons_contrib", "online_mat_lib", "material-library")
-        else:
-            print("ONLINE MATERIAL LIBRARY -- MAJOR PROBLEM:"\
-            "COULD NOT LOCATE ADD-ON INSTALLATION PATH.")
-            mat_lib_folder = "error"
-    else:
-        if os.path.exists(os.path.join(str(bpy.utils.script_path_pref()), "addons", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(str(bpy.utils.script_path_pref()), "addons", "online_mat_lib", "material-library")
-        elif os.path.exists(os.path.join(bpy.utils.script_path_user(), "addons", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(bpy.utils.script_path_user(), "addons", "online_mat_lib", "material-library")
-        elif os.path.exists(os.path.join(bpy.utils.script_paths()[0], "addons", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(bpy.utils.script_paths()[0], "addons", "online_mat_lib", "material-library")
-        elif os.path.exists(os.path.join(bpy.utils.script_paths()[0], "addons_contrib", "online_mat_lib", "material-library")):
-            mat_lib_folder = os.path.join(bpy.utils.script_paths()[0], "addons_contrib", "online_mat_lib", "material-library")
-        else:
-            print("ONLINE MATERIAL LIBRARY -- MAJOR PROBLEM:"\
-            "COULD NOT LOCATE ADD-ON INSTALLATION PATH.")
-            mat_lib_folder = "error"
-
-findLibrary()
-
-mat_lib_contents = "Please refresh."
-mat_lib_category_filenames = []
-mat_lib_category_types = []
-mat_lib_category_names = []
-mat_lib_categories = 0
-
-category_contents = "None"
-category_name = ""
-category_filename = ""
-category_materials = 0
-
-category_type = "none"
-
-sub_category_contents = "None"
-sub_category_name = ""
-sub_category_filename = ""
-sub_category_categories = 0
-sub_category_names = []
-sub_category_filenames = []
-
-material_names = []
-material_filenames = []
-material_contributors = []
-material_ratings = []
-material_fireflies = []
-material_speeds = []
-material_complexities = []
-material_scripts = []
-material_images = []
-
-material_file_contents = ""
-
-current_material_number = -1
-current_material_cached = False
-current_material_previewed = False
-material_detail_view = "RENDER"
-preview_message = []
-node_message = []
-save_filename = ""
-script_stack = []
-osl_scripts = []
-
-bpy.types.Scene.mat_lib_auto_preview = bpy.props.BoolProperty(name = "Auto-download previews", description = "Automatically download material previews in online mode", default = True, options = {'SKIP_SAVE'})
-bpy.types.Scene.mat_lib_show_osl_materials = bpy.props.BoolProperty(name = "Show OSL materials", description = "Enable to show materials with OSL shading scripts", default = False, options = {'SKIP_SAVE'})
-bpy.types.Scene.mat_lib_show_textured_materials = bpy.props.BoolProperty(name = "Show textured materials", description = "Enable to show materials with image textures", default = True, options = {'SKIP_SAVE'})
-bpy.types.Scene.mat_lib_osl_only_trusted = bpy.props.BoolProperty(name = "Use OSL scripts from trusted sources only", description = "Disable to allow downloading OSL scripts from anywhere on the web (Not recommended)", default = True, options = {'SKIP_SAVE'})
-bpy.types.Scene.mat_lib_images_only_trusted = bpy.props.BoolProperty(name = "Use image textures from trusted sources only", description = "Disable to allow downloading image textures from anywhere on the web (Not recommended)", default = True, options = {'SKIP_SAVE'})
-
-bpy.types.Scene.mat_lib_bcm_write = bpy.props.StringProperty(name = "Text Datablock", description = "Name of text datablock to write .bcm data to", default="bcm_file", options = {'SKIP_SAVE'})
-bpy.types.Scene.mat_lib_bcm_read = bpy.props.StringProperty(name = "Text Datablock", description = "Name of text datablock to read .bcm data from", default="bcm_file", options = {'SKIP_SAVE'})
-bpy.types.Scene.mat_lib_bcm_name = bpy.props.StringProperty(name = "Material Name", description = "Specify a name for the new material", default="Untitled", options = {'SKIP_SAVE'})
-
-bpy.types.Scene.mat_lib_bcm_save_location = bpy.props.StringProperty(name = "Save location", description = "Directory to save .bcm files in", default=mat_lib_folder + os.sep + "my-materials" + os.sep, options = {'SKIP_SAVE'}, subtype="DIR_PATH")
-bpy.types.Scene.mat_lib_bcm_open_location = bpy.props.StringProperty(name = "Open location", description = "Location of .bcm file to open", default=mat_lib_folder + os.sep + "my-materials" + os.sep + "untitled.bcm", options = {'SKIP_SAVE'})
-
-category_enum_items = [("None0", "None", "No category selected")]
-bpy.types.Scene.mat_lib_material_category = bpy.props.EnumProperty(name = "", items = category_enum_items, description = "Choose a category", options = {'SKIP_SAVE'})
-prev_category = "None0"
-
-subcategory_enum_items = [("None0", "None", "No Subcategory Selected")]
-bpy.types.Scene.mat_lib_material_subcategory = bpy.props.EnumProperty(name = "", items = subcategory_enum_items, description = "Choose a subcategory", options = {'SKIP_SAVE'})
-
-class OnlineMaterialLibraryPanel(bpy.types.Panel):
-    """Creates a Panel in the Object properties window"""
-    bl_label = "Online Material Library"
-    bl_idname = "OnlineMaterialLibraryPanel"
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "material"
-    
-    def draw(self, context):
-        global show_success_message
-        global show_success_message_timeout
-        global current_material_number
-        global mat_lib_contents
-        global prev_category
-        global save_filename
-        
-        layout = self.layout
-        
-        if context.scene.render.engine == "CYCLES":
-            #Cycles is enabled!
-            row = layout.row()
-            
-            if category_type is not "info" and category_type is not "settings" and category_type is not "tools":
-                if mat_lib_contents == "" or mat_lib_contents == "Please refresh.":
-                    if mat_lib_folder == "error":
-                        row.label(text="ERROR: Could not find installation path!", icon='ERROR')
-                    else:
-                        #Material Library Contents variable is empty -- show welcome message
-                        row.label(text="Online Material Library Add-on -- Version 0.5", icon='SMOOTH')
-                        
-                        row = layout.row()
-                        rowcol = row.column(align=True)
-                        rowcol.alignment = 'EXPAND'
-                        rowcol.prop(context.scene, "mat_lib_library", text="")
-                        
-                        rowcolrow = rowcol.row(align=True)
-                        rowcolrow.alignment = 'EXPAND'
-                        if "bundled" not in context.scene.mat_lib_library:
-                            rowcolrow.operator("material.libraryconnect", text="Connect", icon='WORLD').mode = "online"
-                        if "testing" not in context.scene.mat_lib_library:
-                            rowcolrow.operator("material.libraryconnect", text="Work Offline", icon='DISK_DRIVE').mode = "offline"
-                    
-                elif working_mode is not "none":
-                    #We have a valid material library
-                    row = layout.row(align=True)
-                    row.alignment = 'EXPAND'
-                    row.prop(bpy.context.scene, "mat_lib_material_category")
-                else:
-                    #Could not retrive a valid material library
-                    row.label(text="Could not retrieve material library.", icon='CANCEL')
-                    row = layout.row()
-                    row.label(text=str(mat_lib_contents))
-                    row = layout.row()
-                    row.label(text="..." + str(mat_lib_contents)[-50:])
-                    
-                    row = layout.row()
-                    rowcol = row.column(align=True)
-                    rowcol.alignment = 'EXPAND'
-                    rowcol.prop(context.scene, "mat_lib_library", text="")
-                    
-                    rowcolrow = rowcol.row(align=True)
-                    rowcolrow.alignment = 'EXPAND'
-                    if "bundled" not in context.scene.mat_lib_library:
-                        rowcolrow.operator("material.libraryconnect", text="Attempt Reconnect", icon='WORLD').mode = "online"
-                    if "testing" not in context.scene.mat_lib_library:
-                        rowcolrow.operator("material.libraryconnect", text="Work Offline", icon='DISK_DRIVE').mode = "offline"
-            
-            #Here we check if the user has changed the category, if so, update.
-            if prev_category != bpy.context.scene.mat_lib_material_category:
-                prev_category = bpy.context.scene.mat_lib_material_category
-                libraryCategoryUpdate()
-            
-            if category_type == "none":
-                #Not browsing category
-                if working_mode is not "none":
-                    row = layout.row()
-                    rowcol = row.column(align=True)
-                    rowcol.alignment = 'EXPAND'
-                    rowcol.prop(context.scene, "mat_lib_library", text="")
-                    
-                    rowcolrow = rowcol.row(align=True)
-                    rowcolrow.alignment = 'EXPAND'
-                    if "bundled" not in context.scene.mat_lib_library:
-                        if working_mode == "online":
-                            rowcolrow.operator("material.libraryconnect", text="Reconnect", icon='WORLD').mode = "online"
-                        else:
-                            rowcolrow.operator("material.libraryconnect", text="Connect", icon='WORLD').mode = "online"
-                    if "testing" not in context.scene.mat_lib_library:
-                        if working_mode == "offline":
-                            rowcolrow.operator("material.libraryconnect", text="Reload Library", icon='DISK_DRIVE').mode = "offline"
-                        else:
-                            rowcolrow.operator("material.libraryconnect", text="Work Offline", icon='DISK_DRIVE').mode = "offline"
-                
-                row = layout.row(align=True)
-                row.alignment = 'EXPAND'
-                row.operator("material.libraryinfo", text="Info", icon='INFO')
-                row.operator("material.librarytools", text="Tools", icon='MODIFIER')
-                row.operator("material.librarysettings", text="Settings", icon='SETTINGS')
-                
-                if "Up-to-date." not in update_data[0]:
-                    row = layout.row()
-                    row.label(text=update_data[0])
-                    row.operator("wm.url_open", text="Get latest version", icon='WORLD').url = update_data[1]
-                    
-            elif category_type == "info":
-                row.label(text="Add-on Info", icon='INFO')
-                row.operator("material.libraryhome", text="", icon='LOOP_BACK')
-                
-                row = layout.row()
-                row.operator("wm.url_open", text="All materials are CC0 - learn more.", emboss=False).url = "http://creativecommons.org/publicdomain/zero/1.0/"
-                
-                row = layout.row()
-                row.operator("wm.url_open", text="Material previews generated with B.M.P.S.", emboss=False).url = "https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests/rendering/cycles/blend_files/bmps.blend"
-                row = layout.row()
-                row.operator("wm.url_open", text="B.M.P.S. created by Robin \"tuqueque\" Marín", emboss=False).url = "http://blenderartists.org/forum/showthread.php?151903-b.m.p.s.-1.5!"
-            
-            elif category_type == "settings":
-                row.label(text="Library Settings", icon='SETTINGS')
-                row.operator("material.libraryhome", text="", icon='LOOP_BACK')
-                
-                row = layout.row()
-                row.prop(bpy.context.scene, "mat_lib_auto_preview")
-                row = layout.row()
-                row.prop(bpy.context.scene, "mat_lib_osl_only_trusted")
-                row = layout.row()
-                row.prop(bpy.context.scene, "mat_lib_images_only_trusted")
-                
-                row = layout.row()
-                row.label(text="Cached data for active library:")
-                
-                row = layout.row()
-                if mat_lib_cached_files == 0:
-                    row.label(text="No cached files.")
-                elif mat_lib_cached_files == -2:
-                    row.label(text="The Bundled library contains no cached files.")
-                elif mat_lib_cached_files == 1:
-                    row.label(text="1 cached file.")
-                    row.operator("material.libraryclearcache", text="Clear Cache", icon='CANCEL')
-                elif mat_lib_cached_files != -1:
-                    row.label(text=str(mat_lib_cached_files) + " cached files.")
-                    row.operator("material.libraryclearcache", text="Clear Cache", icon='CANCEL')
-                else:
-                    row.label(text="Please select a library first.", icon="ERROR")
-            
-            elif category_type == "tools":
-                row.label(text="Material Tools", icon='MODIFIER')
-                row.operator("material.libraryhome", text="", icon='LOOP_BACK')
-                
-                row = layout.row()
-                row.label(text="Write material data to text as .bcm:")
-                
-                row = layout.row(align=True)
-                row.alignment = 'EXPAND'
-                row.prop(bpy.context.scene, "mat_lib_bcm_write", text="", icon="TEXT")
-                row.operator("material.libraryconvert", text="Write to text", icon='MATERIAL_DATA')
-                
-                row = layout.row()
-                row.label(text="Save material(s) as .bcm files:")
-                
-                row = layout.row()
-                col = row.column(align=True)
-                col.alignment = 'EXPAND'
-                colrow = col.row()
-                colrow.prop(context.scene, "mat_lib_bcm_save_location", text="")
-                colrow = col.row(align=True)
-                colrow.alignment = 'EXPAND'
-                colrow.operator("material.libraryconvert", text="Save active", icon='DISK_DRIVE').save_location = context.scene.mat_lib_bcm_save_location
-                save_button = colrow.operator("material.libraryconvert", text="Save all materials", icon='DISK_DRIVE')
-                save_button.save_location = context.scene.mat_lib_bcm_save_location
-                save_button.all_materials = True
-                
-                row = layout.row()
-                row.label(text="Open a local .bcm file:")
-                 
-                row = layout.row()
-                col = row.column(align=True)
-                col.alignment = 'EXPAND'
-                colrow = col.row()
-                colrow.prop(context.scene, "mat_lib_bcm_open_location", text="")
-                colrow.operator("buttons.file_browse", text="", icon='FILESEL').relative_path = False
-                colrow = col.row(align=True)
-                colrow.alignment = 'EXPAND'
-                colrow.operator("material.libraryadd", text="Add to materials", icon='ZOOMIN').open_location = context.scene.mat_lib_bcm_open_location
-                colrow.operator("material.libraryapply", text="Apply to active", icon='PASTEDOWN').open_location = context.scene.mat_lib_bcm_open_location
-                
-                row = layout.row()
-                row.label(text="Read .bcm data in a text block to a material:")
-                 
-                row = layout.row()
-                col = row.column(align=True)
-                col.alignment = 'EXPAND'
-                colrow = col.row()
-                colrow.prop(context.scene, "mat_lib_bcm_read", text="", icon='TEXT')
-                colrow = col.row()
-                colrow.prop(context.scene, "mat_lib_bcm_name", text="", icon='MATERIAL')
-                colrow = col.row(align=True)
-                colrow.alignment = 'EXPAND'
-                colrow.operator("material.libraryadd", text="Add to materials", icon='ZOOMIN').text_block = context.scene.mat_lib_bcm_read
-                colrow.operator("material.libraryapply", text="Apply to active", icon='PASTEDOWN').text_block = context.scene.mat_lib_bcm_read
-                
-            elif category_type == "category":
-                #Browsing category - show materials
-                row = layout.row()
-                matwrap = row.box()
-                i = 0
-                while i < category_materials:
-                    if i == current_material_number:
-                        matwraprow = matwrap.row()
-                        matwrapbox = matwraprow.box()
-                        matwrapboxrow = matwrapbox.row()
-                        matwrapboxrow.operator("material.libraryviewmaterial", text=material_names[i], icon='MATERIAL', emboss=False).material = i
-                        matwrapboxrowcol = matwrapboxrow.column()
-                        matwrapboxrowcolrow = matwrapboxrowcol.row()
-                        matwrapboxrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapboxrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapboxrowcol = matwrapboxrow.column()
-                        matwrapboxrowcolrow = matwrapboxrowcol.row()
-                        matwrapboxrowcolrowsplit = matwrapboxrowcolrow.split(percentage=0.8)
-                        matwrapboxrowcolrowsplitrow = matwrapboxrowcolrowsplit.row()
-                        
-                        #Ratings
-                        if material_ratings[i] == 0:
-                            matwrapboxrowcolrowsplitrow.operator("material.libraryviewmaterial", text="Unrated", emboss=False).material = i
-                        else:
-                            e = 0
-                            while e < material_ratings[i]:
-                                matwrapboxrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_ON', emboss=False).material = i
-                                e = e + 1
-                            
-                            if material_ratings[i] is not 5:    
-                                e = 0
-                                while e < (5 - material_ratings[i]):
-                                    matwrapboxrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_OFF', emboss=False).material = i
-                                    e = e + 1
-                    else:
-                        matwraprow = matwrap.row()
-                        matwrapcol = matwraprow.column()
-                        matwrapcolrow = matwrapcol.row()
-                        matwrapcolrow.operator("material.libraryviewmaterial", text=material_names[i], icon='MATERIAL', emboss=False).material = i
-                        matwrapcolrowcol = matwrapcolrow.column()
-                        matwrapcolrowcolrow = matwrapcolrowcol.row()
-                        matwrapcolrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapcolrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapcolrowcol = matwrapcolrow.column()
-                        matwrapcolrowcolrow = matwrapcolrowcol.row()
-                        matwrapcolrowcolrowsplit = matwrapcolrowcolrow.split(percentage=0.8)
-                        matwrapcolrowcolrowsplitrow = matwrapcolrowcolrowsplit.row()
-                        
-                        #Ratings
-                        if material_ratings[i] == 0:
-                            matwrapcolrowcolrowsplitrow.operator("material.libraryviewmaterial", text="Unrated", emboss=False).material = i
-                        else:
-                            e = 0
-                            while e < material_ratings[i]:
-                                matwrapcolrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_ON', emboss=False).material = i
-                                e = e + 1
-                            
-                            if material_ratings[i] is not 5:    
-                                e = 0
-                                while e < (5 - material_ratings[i]):
-                                    matwrapcolrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_OFF', emboss=False).material = i
-                                    e = e + 1
-                    i = i + 1
-                
-                if current_material_number is not -1:
-                    #Display selected material's info
-                    row = layout.row()
-                    infobox = row.box()
-                    inforow = infobox.row()
-                    
-                    #Material name
-                    inforow.label(text=(material_names[current_material_number]))
-                    
-                    #Preview download button
-                    if current_material_previewed == False:
-                        preview_button = inforow.operator("material.librarypreview", text="", icon='COLOR', emboss=False)
-                        preview_button.name = material_names[current_material_number]
-                        preview_button.filename = material_filenames[current_material_number]
-                    
-                    if library == "release":
-                        #Cache indicator/button
-                        if current_material_cached:
-                            inforow.label(text="", icon="SAVE_COPY")
-                        else:
-                            inforow.operator("material.librarycache", text="", icon="LONGDISPLAY", emboss=False).filename = material_filenames[current_material_number]
-                    
-                    #Close button
-                    inforow.operator("material.libraryviewmaterial", text="", icon='PANEL_CLOSE').material = -1
-                    
-                    #inforow = infobox.row()
-                    inforowsplit = infobox.split(percentage=0.5)
-                    
-                    #Display a preview
-                    if bpy.data.textures.find("mat_lib_preview_texture") == -1:
-                        bpy.data.textures.new("mat_lib_preview_texture", "IMAGE")
-                        preview_texture = bpy.data.textures["mat_lib_preview_texture"]
-                        inforowcol = inforowsplit.column()
-                        
-                        if material_contributors[current_material_number] != "Unknown" and material_contributors[current_material_number] != "Anonymous":
-                            inforowcolrow = inforowcol.row()
-                            inforowcolrow.label(text="By %s." % material_contributors[current_material_number])
-                        else:
-                            inforowcolrow = inforowcol.row()
-                            inforowcolrow.label(text="Author unknown.")
-                        inforowcolrow = inforowcol.row()
-                        inforowcolrow.template_preview(preview_texture)
-                    else:
-                        preview_texture = bpy.data.textures['mat_lib_preview_texture']
-                        inforowcol = inforowsplit.column()
-                        if material_contributors[current_material_number] != "Unknown" and material_contributors[current_material_number] != "Anonymous":
-                            inforowcolrow = inforowcol.row()
-                            inforowcolrow.label(text="By %s." % material_contributors[current_material_number])
-                        else:
-                            inforowcolrow = inforowcol.row()
-                            inforowcolrow.label(text="Author unknown.")
-                        inforowcolrow = inforowcol.row()
-                        inforowcolrow.template_preview(preview_texture)
-                    
-                    inforowcol = inforowsplit.column()
-                    inforowcolrow = inforowcol.row()
-                    inforowcolcol = inforowcol.column(align=True)
-                    inforowcolcol.alignment = 'EXPAND'
-                    inforowcolcolrow = inforowcolcol.row()
-                    if material_detail_view == 'RENDER':
-                        if material_fireflies[current_material_number] == "high":
-                            inforowcolcolrow.label(text="Firefly Level: High")
-                            inforowcolcolrow.label(text="", icon='PARTICLES')
-                        elif material_fireflies[current_material_number] == "medium":
-                            inforowcolcolrow.label(text="Firefly Level: Medium")
-                            inforowcolcolrow.label(text="", icon='MOD_PARTICLES')
-                        else:
-                            inforowcolcolrow.label(text="Firefly Level: Low")
-                        inforowcolcolrow = inforowcolcol.row()
-                            
-                        if material_complexities[current_material_number] == "simple":
-                            inforowcolcolrow.label(text="Complexity: Simple")
-                        elif material_complexities[current_material_number] == "intermediate":
-                            inforowcolcolrow.label(text="Complexity: Intermediate")
-                        elif material_complexities[current_material_number] == "complex":
-                            inforowcolcolrow.label(text="Complexity: Complex")
-                        inforowcolcolrow = inforowcolcol.row()
-                        
-                        if material_speeds[current_material_number] == "slow":
-                            inforowcolcolrow.label(text="Render Speed: Slow")
-                            inforowcolcolrow.label(text="", icon='PREVIEW_RANGE')
-                        elif material_speeds[current_material_number] == "fair":
-                            inforowcolcolrow.label(text="Render Speed: Fair")
-                            inforowcolcolrow.label(text="", icon='TIME')
-                        else:
-                            inforowcolcolrow.label(text="Render Speed: Good")
-                        inforowcolcolrow = inforowcolcol.row()
-                        details = inforowcolcolrow.row(align=True)
-                        details.alignment = 'RIGHT'
-                        detailshidden = details.row()
-                        detailshidden.enabled = False
-                        detailshidden.operator("material.librarydetailview", text="", icon='PLAY_REVERSE').mode = "PREVIOUS"
-                        details.operator("material.librarydetailview", text="", icon='PLAY').mode = "NEXT"
-                    elif material_detail_view == "DATA":
-                        if material_scripts[current_material_number] == "0":
-                            inforowcolcolrow.label(text="OSL Scripts: 0")
-                        else:
-                            inforowcolcolrow.label(text="OSL Scripts: %s" % material_scripts[current_material_number])
-                            inforowcolcolrow.label(text="", icon='TEXT')
-                        inforowcolcolrow = inforowcolcol.row()
-                    
-                        if material_images[current_material_number] == "0":
-                            inforowcolcolrow.label(text="Images: 0")
-                        else:
-                            inforowcolcolrow.label(text="Images: %s" % material_images[current_material_number])
-                            inforowcolcolrow.label(text="", icon='IMAGE_RGB')
-                            
-                        inforowcolcolrow = inforowcolcol.row()
-                        inforowcolcolrow.label(text=" ")
-                        
-                        inforowcolcolrow = inforowcolcol.row()
-                        details = inforowcolcolrow.row(align=True)
-                        details.alignment = 'RIGHT'
-                        details.operator("material.librarydetailview", text="", icon='PLAY_REVERSE').mode = "PREVIOUS"
-                        detailshidden = details.row()
-                        detailshidden.enabled = False
-                        detailshidden.operator("material.librarydetailview", text="", icon='PLAY').mode = "NEXT"
-                        
-                    inforowcolcolcol = inforowcolcol.column(align=True)
-                    inforowcolcolcol.alignment = 'EXPAND'
-                    functions = inforowcolcolcol.row()
-                    #Display "Add" button
-                    mat_button = functions.operator("material.libraryadd", text="Add to materials", icon='ZOOMIN')
-                    mat_button.mat_name = material_names[current_material_number]
-                    mat_button.filename = material_filenames[current_material_number]
-                    functions = inforowcolcolcol.row()
-                    
-                    #Display "Apply" button
-                    mat_button = functions.operator("material.libraryapply", text="Apply to active", icon='PASTEDOWN')
-                    mat_button.mat_name = material_names[current_material_number]
-                    mat_button.filename = material_filenames[current_material_number]
-                    functions = inforowcolcolcol.row()
-                    
-                    #Display "Save" button
-                    mat_button = functions.operator("material.librarysave", text="Save as...", icon='DISK_DRIVE')
-                    mat_button.filepath = mat_lib_folder + os.sep + "my-materials" + os.sep + material_filenames[current_material_number] + ".bcm"
-                    mat_button.filename = material_filenames[current_material_number]
-                    save_filename = material_filenames[current_material_number]
-                
-            elif category_type == "subcategory":
-                #Browsing subcategory - show materials
-                row = layout.row()
-                matwrap = row.box()
-                i = 0
-                while i < category_materials:
-                    if (i == current_material_number):
-                        matwraprow = matwrap.row()
-                        matwrapbox = matwraprow.box()
-                        matwrapboxrow = matwrapbox.row()
-                        matwrapboxrow.operator("material.libraryviewmaterial", text=material_names[i], icon='MATERIAL', emboss=False).material = i
-                        matwrapboxrowcol = matwrapboxrow.column()
-                        matwrapboxrowcolrow = matwrapboxrowcol.row()
-                        matwrapboxrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapboxrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapboxrowcol = matwrapboxrow.column()
-                        matwrapboxrowcolrow = matwrapboxrowcol.row()
-                        matwrapboxrowcolrowsplit = matwrapboxrowcolrow.split(percentage=0.8)
-                        matwrapboxrowcolrowsplitrow = matwrapboxrowcolrowsplit.row()
-                        
-                        #Ratings
-                        e = 0
-                        while e < material_ratings[i]:
-                            matwrapboxrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_ON', emboss=False).material = i
-                            e = e + 1
-                        
-                        if material_ratings[i] is not 5:    
-                            e = 0
-                            while e < (5 - material_ratings[i]):
-                                matwrapboxrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_OFF', emboss=False).material = i
-                                e = e + 1
-                    else:
-                        matwraprow = matwrap.row()
-                        matwrapcol = matwraprow.column()
-                        matwrapcolrow = matwrapcol.row()
-                        matwrapcolrow.operator("material.libraryviewmaterial", text=material_names[i], icon='MATERIAL', emboss=False).material = i
-                        matwrapcolrowcol = matwrapcolrow.column()
-                        matwrapcolrowcolrow = matwrapcolrowcol.row()
-                        matwrapcolrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapcolrowcolrow.operator("material.libraryviewmaterial", text="", icon='BLANK1', emboss=False).material = i
-                        matwrapcolrowcol = matwrapcolrow.column()
-                        matwrapcolrowcolrow = matwrapcolrowcol.row()
-                        matwrapcolrowcolrowsplit = matwrapcolrowcolrow.split(percentage=0.8)
-                        matwrapcolrowcolrowsplitrow = matwrapcolrowcolrowsplit.row()
-                        
-                        #Ratings
-                        e = 0
-                        while e < material_ratings[i]:
-                            matwrapcolrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_ON', emboss=False).material = i
-                            e = e + 1
-                        
-                        if material_ratings[i] is not 5:    
-                            e = 0
-                            while e < (5 - material_ratings[i]):
-                                matwrapcolrowcolrowsplitrow.operator("material.libraryviewmaterial", text="", icon='SOLO_OFF', emboss=False).material = i
-                                e = e + 1
-                    i = i + 1
-                    
-                if current_material_number is not -1:
-                    #Display selected material's info
-                    row = layout.row()
-                    infobox = row.box()
-                    inforow = infobox.row()
-                   
-                    inforow.label(text=material_names[current_material_number])
-                    if bpy.context.scene.mat_lib_auto_preview == False:
-                        mat_button = inforow.operator("material.librarypreview", text="", icon='IMAGE_COL')
-                        mat_button.name = material_names[current_material_number]
-                        mat_button.filename = material_filenames[current_material_number]
-                    inforow.operator("material.viewmaterial", text="", icon='PANEL_CLOSE').material = -1
-                    
-                    inforow = infobox.row()
-                    
-                    #Display a preview
-                    if bpy.data.textures.find("mat_lib_preview_texture") == -1:
-                        bpy.data.textures.new("mat_lib_preview_texture", "IMAGE")
-                        preview_texture = bpy.data.textures["mat_lib_preview_texture"]
-                        inforowcol = inforow.column(align=True)
-                        inforowcol.alignment = 'EXPAND'
-                        inforowcolrow = inforowcol.row()
-                        inforowcolrow.operator("material.librarypreview", text="Preview Material", icon='IMAGE_COL')
-                        inforowcolrow = inforowcol.row()
-                        inforowcolrow.template_preview(preview_texture)
-                    else:
-                        preview_texture = bpy.data.textures['mat_lib_preview_texture']
-                        inforowcol = inforow.column(align=True)
-                        inforowcol.alignment = 'EXPAND'
-                        inforowcolrow = inforowcol.row()
-                        inforowcolrow.operator("material.librarypreview", text="Preview Material", icon='IMAGE_COL')
-                        inforowcolrow = inforowcol.row()
-                        inforowcolrow.template_preview(preview_texture)
-                    
-                    inforowcol = inforow.column()
-                    inforowcolrow = inforowcol.row()
-                    if bpy.data.materials.find(material_names[current_material_number]) is not -1:
-                        inforowcolrow.label(text="Material exists", icon='ERROR')
-                    if material_contributors[current_material_number] == "Unknown" or material_contributors[current_material_number] == "Anonymous":
-                        inforowcolrow = inforowcol.row()
-                    else:
-                        inforowcolrow = inforowcol.row()
-                        inforowcolrow.label(text="By %s." % material_contributors[current_material_number])
-                        inforowcolrow = inforowcol.row()
-                    
-                    if bpy.data.materials.find(material_names[current_material_number]) is not -1:
-                        inforowcolrow.label(text="\"Add\" will overwrite.")
-                    inforowcolcol = inforowcol.column(align=True)
-                    inforowcolcol.alignment = 'EXPAND'
-                    
-                    
-                    #Display "Add" or "Overwrite" button
-                    mat_button = inforowcolcol.operator("material.libraryadd", text="Add to materials", icon='ZOOMIN')
-                    mat_button.name = material_names[current_material_number]
-                    mat_button.filename = material_filenames[current_material_number]
-                    
-                    #Display "Paste" button
-                    mat_button = inforowcolcol.operator("material.libraryapply", text="Apply to active", icon='PASTEDOWN')
-                    mat_button.name = bpy.context.object.active_material.name
-                    mat_button.filename = material_filenames[current_material_number]
-                    
-                    #Display "Save" button
-                    mat_button = inforowcolcol.operator("material.librarysave", text="Save to disk", icon='DISK_DRIVE')
-                    mat_button.name = bpy.context.object.active_material.name
-                    mat_button.filename = material_filenames[current_material_number]
-                    save_filename = material_filenames[current_material_number]
-        else:
-            #Dude, you gotta switch to Cycles to use this.
-            row = layout.row()
-            row.label(text="Sorry, Cycles only at the moment.",icon='ERROR')
-
-class libraryCategory:
-    def __init__(self, title, folder):
-        self.title = title
-        self.folder = folder
-        self.materials = []
-
-class libraryMaterial:
-    def __init__(self, name, href, contrib, stars, fireflies, speed, complexity, scripts, images):
-        self.name = name
-        self.href = href
-        self.contrib = contrib
-        self.stars = stars
-        self.fireflies = fireflies
-        self.speed = speed
-        self.complexity = complexity
-        self.scripts = scripts
-        self.images = images
-
-def handleCategories(categories):
-    for index, category in enumerate(categories):
-        handleCategory(category, index)
-
-def handleCategory(category, index):
-    if 'addon' in category.attributes:
-        needed_version = float(category.attributes['addon'].value)
-        this_version = bl_info["version"][0] + (bl_info["version"][1] / 10.0)
-        
-        #Check this addon's compatibility with this category
-        if needed_version > this_version:
-            print('\n\n-Category "' + category.attributes['title'].value + '" not used; its materials are for a newer version of this add-on.')
-            return
-    
-    if 'bl' in category.attributes:
-        bl_version = bpy.app.version[0] + (bpy.app.version[1] / 100)
-        
-        #Check Blender's compatibility with this category
-        if category.attributes['bl'].value[-1] == "-":
-            #This option is for if Blender's compatiblity
-            #with a category started only with a specific
-            #version, but has not yet ended; this will
-            #look like the following: bl="2.64-"
-            bl_lower = float(category.attributes['bl'].value[:-1])
-            if bl_lower > bl_version:
-                print('\n\n-Category "' + category.attributes['title'].value + '" was not used; its materials are not compatible with this version of Blender.')
-                return
-            
-        elif category.attributes['bl'].value[0] == "-":
-            #This option is for if Blender's compatiblity
-            #with a category ended at some point, and will
-            #look like the following: bl="-2.73"
-            bl_upper = float(category.attributes['bl'].value[1:])
-            if bl_upper < bl_version:
-                print('\n\n-Category "' + category.attributes['title'].value + '" was not used; its materials are not compatible with this version of Blender.')
-                return
-            
-        else:
-            #This option is for if Blender's compatiblity
-            #with a category started with a certain version,
-            #then ended with another; it will look
-            #like the following: bl="2.64-2.73"
-            bl_lower = float(category.attributes['bl'].value.split('-')[0])
-            bl_upper = float(category.attributes['bl'].value.split('-')[1])
-            if bl_upper < bl_version:
-                print('\n\n-Category "' + category.attributes['title'].value + '" was not used; its materials are not compatible with this version of Blender.')
-                return
-            elif bl_lower > bl_version:
-                print('\n\n-Category "' + category.attributes['title'].value + '" was not used; its materials are not compatible with this version of Blender.')
-                return
-    
-    if library is not "bundled":
-        if not os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category.attributes['folder'].value):
-            print("Folder \"/" + category.attributes['folder'].value + "/\" does not exist; creating now.")
-            if library == "composite":
-                os.mkdir(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category.attributes['folder'].value)
-            else:
-                os.mkdir(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category.attributes['folder'].value)
-        
-        if 'remove' in category.attributes:
-            if library == "composite":
-                if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category.attributes['folder'].value):
-                    for the_file in os.listdir(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category.attributes['folder'].value):
-                        file_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category.attributes['folder'].value + os.sep + the_file
-                        if os.path.isfile(file_path):
-                            os.remove(file_path)
-                        elif os.path.isdir(file_path):
-                            for sub_file in os.listdir(file_path):
-                                if os.path.isfile(file_path + sub_file):
-                                    os.remove(file_path + sub_file)
-                            os.rmdir(file_path)
-                    os.rmdir(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category.attributes['folder'].value)
-            else:
-                if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category.attributes['folder'].value):
-                    for the_file in os.listdir(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category.attributes['folder'].value):
-                        file_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category.attributes['folder'].value + os.sep + the_file
-                        if os.path.isfile(file_path):
-                            os.remove(file_path)
-                        elif os.path.isdir(file_path):
-                            for sub_file in os.listdir(file_path):
-                                if os.path.isfile(file_path + sub_file):
-                                    os.remove(file_path + sub_file)
-                            os.rmdir(file_path)
-                    os.rmdir(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category.attributes['folder'].value)
-                return
-    
-    print ('\n\n-Category "' + category.attributes['title'].value + '"; located in folder "/' + category.attributes['folder'].value + '/".')
-    library_data.append(libraryCategory(category.attributes['title'].value, category.attributes['folder'].value))
-    handleMaterials(category.getElementsByTagName("material"), index)
-
-def handleMaterials(materials, index):
-    for material in materials:
-        handleMaterial(material, index)
-
-def handleMaterial(material, index):
-    if 'addon' in material.attributes:
-        needed_version = float(material.attributes['addon'].value)
-        this_version = bl_info["version"][0] + (bl_info["version"][1] / 10.0)
-        
-        #Check this addon's compatibility with this material
-        if needed_version > this_version:
-            print('\n  -Material "' + material.attributes['name'].value + '" was not used, and is for a newer version of this add-on.')
-            return
-    
-    if 'bl' in material.attributes:
-        bl_version = bpy.app.version[0] + (bpy.app.version[1] / 100)
-        
-        #Check Blender's compatibility with this material
-        if material.attributes['bl'].value[-1] == "-":
-            #This option is for if Blender's compatiblity
-            #with a material started only with a specific
-            #version, but has not yet ended; this will
-            #look like the following: bl="2.64-"
-            bl_lower = float(material.attributes['bl'].value[:-1])
-            if bl_lower > bl_version:
-                print('\n  -Material "' + material.attributes['name'].value + '" was not used, and is not compatible with this version of Blender.')
-                return
-            
-        elif material.attributes['bl'].value[0] == "-":
-            #This option is for if Blender's compatiblity
-            #with a material ended at some point, and will
-            #look like the following: bl="-2.73"
-            bl_upper = float(material.attributes['bl'].value[1:])
-            if bl_upper < bl_version:
-                print('\n  -Material "' + material.attributes['name'].value + '" was not used, and is not compatible with this version of Blender.')
-                return
-            
-        else:
-            #This option is for if Blender's compatiblity
-            #with a material started with a certain version,
-            #then ended with another; it will
-            #look like the following: bl="2.64-2.73"
-            bl_lower = float(material.attributes['bl'].value.split('-')[0])
-            bl_upper = float(material.attributes['bl'].value.split('-')[1])
-            if bl_upper < bl_version:
-                print('\n  -Material "' + material.attributes['name'].value + '" was not used, and is not compatible with this version of Blender.')
-                return
-            elif bl_lower > bl_version:
-                print('\n  -Material "' + material.attributes['name'].value + '" was not used, and is not compatible with this version of Blender.')
-                return
-    
-    if 'by' in material.attributes:
-        contributor = material.attributes['by'].value
-    else:
-        contributor = "Unknown"
-    
-    if 'stars' in material.attributes:
-        stars = material.attributes['stars'].value
-    else:
-        stars = '0'
-    
-    if 'fireflies' in material.attributes:
-        fireflies = material.attributes['fireflies'].value
-    else:
-        fireflies = 'low'
-    
-    if 'speed' in material.attributes:
-        speed = material.attributes['speed'].value
-    else:
-        speed = 'good'
-    
-    if 'complexity' in material.attributes:
-        complexity = material.attributes['complexity'].value
-    else:
-        complexity = 'simple'
-    
-    if 'scripts' in material.attributes:
-        scripts = material.attributes['scripts'].value
-    else:
-        scripts = '0'
-    
-    if 'images' in material.attributes:
-        images = material.attributes['images'].value
-    else:
-        images = '0'
-    
-    library_data[index].materials.append(
-        libraryMaterial(
-        material.attributes['name'].value,
-        material.attributes['href'].value,
-        contributor,
-        int(stars),
-        fireflies,
-        speed,
-        complexity,
-        scripts,
-        images))
-    print ('\n  -Material "' + 
-        material.attributes['name'].value + 
-        '"\n    -Filename: "' + 
-        material.attributes['href'].value + 
-        '.bcm"\n    -Rating: ' + stars + 
-        ' stars\n    -Contributed by "' + 
-        contributor + '"')
-
-class LibraryConnect(bpy.types.Operator):
-    '''Connect to the material library'''
-    bl_idname = "material.libraryconnect"
-    bl_label = "Connect to the material library"
-    mode = bpy.props.StringProperty()
-
-    def execute(self, context):
-        global library_data
-        global library
-        global update_data
-        
-        global mat_lib_contents
-        global mat_lib_categories
-        global mat_lib_category_names
-        global mat_lib_category_types
-        global mat_lib_category_filenames
-        
-        global category_enum_items
-        global subcategory_enum_items
-        
-        global show_success_message
-        global show_success_message_timeout
-        
-        global prev_category
-        global mat_lib_host
-        global mat_lib_location
-        global working_mode
-        
-        findLibrary()
-        
-        if self.mode == "online":
-            mat_lib_host = context.scene.mat_lib_library[:context.scene.mat_lib_library.index("/")]
-            mat_lib_location = context.scene.mat_lib_library[(context.scene.mat_lib_library.index(mat_lib_host) + len(mat_lib_host)):]
-            print(mat_lib_host)
-            print(mat_lib_location)
-        elif "bundled" not in context.scene.mat_lib_library:
-            mat_lib_host = context.scene.mat_lib_library[:context.scene.mat_lib_library.index("/")]
-        
-        #Pre-create preview image
-        if not os.path.exists(mat_lib_folder + os.sep + "mat_lib_preview_image.jpg"):
-            f = open(mat_lib_folder + os.sep + "mat_lib_preview_image.jpg", 'w+b')
-            f.close()
-        
-        if self.mode == "online":
-            #Connect and download
-            connection = http.client.HTTPConnection(mat_lib_host)
-            connection.request("GET", mat_lib_location + "cycles/index.xml")
-            
-            if "release" in context.scene.mat_lib_library:
-                response = connection.getresponse().read()
-                
-                #Cache the index.xml file for offline use
-                library_file = open(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "index.xml"), mode="w+b")
-                library_file.write(response)
-                library_file.close()
-                
-                #Create /textures/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "textures")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "textures"))
-                
-                #Create /scripts/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "scripts")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "scripts"))
-                library = "release"
-            elif "testing" in context.scene.mat_lib_library:
-                response = connection.getresponse().read()
-                
-                #Create /textures/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "testing", "cycles", "textures")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "testing", "cycles", "textures"))
-                
-                #Create /scripts/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "testing", "cycles", "scripts")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "testing", "cycles", "scripts"))
-                library = "testing"
-            else:
-                response = connection.getresponse().read()
-                
-                #Cache the index.xml file for offline use
-                library_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + "index.xml", mode="w+b")
-                library_file.write(response)
-                library_file.close()
-                
-                #Create /textures/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures"))
-                
-                #Create /scripts/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts"))
-                library = "composite"
-                
-            #Convert the response to a string
-            mat_lib_contents = str(response)
-            
-            #Check for connection errors
-            if "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" not in mat_lib_contents:
-                self.report({'ERROR'}, "Error connecting; see console for details.")
-                print("Received following response from server:\n" + mat_lib_contents)
-                return {'CANCELLED'}
-            
-            #Format nicely
-            mat_lib_contents = mat_lib_contents.replace("b'<?xml version=\"1.0\" encoding=\"UTF-8\"?>",'')
-            mat_lib_contents = mat_lib_contents.replace("\\r\\n",'')
-            mat_lib_contents = mat_lib_contents.replace("\\t",'')[:-1]
-            mat_lib_contents = mat_lib_contents.replace("\\",'')
-            
-        else:
-            if "release" in context.scene.mat_lib_library:
-                #Check for cached index.xml file
-                if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "release" + os.sep + "cycles" + os.sep + "index.xml"):
-                    library_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "release" + os.sep + "cycles" + os.sep + "index.xml", mode="r", encoding="UTF-8")
-                    mat_lib_contents = library_file.read()
-                    library_file.close()
-                else:
-                    self.report({'ERROR'}, "No cached library exists!")
-                    return {'CANCELLED'}
-                
-                #Create /textures/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "textures")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "textures"))
-                
-                #Create /scripts/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "scripts")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "release", "cycles", "scripts"))
-                library = "release"
-            elif context.scene.mat_lib_library == "bundled":
-                #Check for index.xml file
-                if os.path.exists(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + "index.xml"):
-                    library_file = open(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + "index.xml", mode="r", encoding="UTF-8")
-                    mat_lib_contents = library_file.read()
-                    library_file.close()
-                else:
-                    self.report({'ERROR'}, "Bundled library does not exist!")
-                    return {'CANCELLED'}
-                library = "bundled"
-            else:
-                #Check for cached index.xml file
-                if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + "index.xml"):
-                    library_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + "index.xml", mode="r", encoding="UTF-8")
-                    mat_lib_contents = library_file.read()
-                    library_file.close()
-                else:
-                    self.report({'ERROR'}, "No cached library exists!")
-                    return {'CANCELLED'}
-                
-                #Create /textures/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures"))
-                
-                #Create /scripts/ folder
-                if not os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts")):
-                    os.mkdir(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts"))
-                library = "composite"
-            
-            if '<?xml version="1.0" encoding="UTF-8"?>' not in mat_lib_contents:
-                self.report({'ERROR'}, "Cached XML file is invalid!")
-                return {'CANCELLED'}
-            
-            #Format nicely
-            mat_lib_contents = mat_lib_contents.replace('<?xml version="1.0" encoding="UTF-8"?>', '')
-            mat_lib_contents = mat_lib_contents.replace("\r\n",'')
-            mat_lib_contents = mat_lib_contents.replace("\n",'')
-            mat_lib_contents = mat_lib_contents.replace("\t",'')
-            mat_lib_contents = mat_lib_contents.replace("\\",'')
-        
-        #Clear important lists
-        library_data = []
-        mat_lib_category_names = []
-        mat_lib_category_types = []
-        mat_lib_category_filenames = []
-            
-        dom = xml.dom.minidom.parseString(mat_lib_contents)
-        
-        if self.mode == "online":
-            if library == "composite":
-                rev_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + "revision_data.ini", mode="r", encoding="UTF-8")
-                rev_data = rev_file.read()
-                rev_file.close()
-            else:
-                rev_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + "revision_data.ini", mode="r", encoding="UTF-8")
-                rev_data = rev_file.read()
-                rev_file.close()
-            
-            if "revision=" in rev_data:
-                revision = int(rev_data[9:])
-            else:
-                revision = -1
-                print("The revision_data.ini file is invalid; clearing cache and re-creating.")
-            
-            if revision is not int(dom.getElementsByTagName("library")[0].attributes['rev'].value):
-                bpy.ops.material.libraryclearcache()
-            
-            if library == "composite":
-                rev_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + "revision_data.ini", mode="w", encoding="UTF-8")
-            else:
-                rev_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + "revision_data.ini", mode="w", encoding="UTF-8")
-            rev_file.write("revision=" + dom.getElementsByTagName("library")[0].attributes['rev'].value)
-            rev_file.close()
-            
-            if 'addon' in dom.getElementsByTagName("library")[0].attributes:
-                current_version = float(dom.getElementsByTagName("library")[0].attributes['addon'].value)
-                this_version = bl_info["version"][0] + (bl_info["version"][1] / 10.0)
-                if current_version > this_version:
-                    update_data = ["Add-on is outdated.", dom.getElementsByTagName("library")[0].attributes['download'].value]
-        
-        print ("\n\n---Material Library---")
-        categories = dom.getElementsByTagName("category")
-        handleCategories(categories)
-        
-        for cat in library_data:
-            #Find category names
-            mat_lib_category_names.append(cat.title)
-            #Find category types
-            #NOTE: Will have to redo this.
-            #mat_lib_category_types = safeEval(mat_lib_contents[(mat_lib_contents.index('[types]') + 7):mat_lib_contents.index('[/types]')])
-            #Get category filenames
-            mat_lib_category_filenames.append(cat.folder)
-            
-        #Find amount of categories
-        mat_lib_categories = len(mat_lib_category_names)
-        
-        #Set enum items for category dropdown
-        category_enum_items = [("None0", "None", "No category selected")]
-        
-        i = 0
-        while i < mat_lib_categories:
-            print ("Adding category #%d" % (i + 1))
-            category_enum_items.append(((mat_lib_category_names[i] + str(i + 1)), mat_lib_category_names[i], (mat_lib_category_names[i] + " category")))
-            i = i + 1
-        bpy.types.Scene.mat_lib_material_category = bpy.props.EnumProperty(name = "", items = category_enum_items, description = "Choose a category")
-        bpy.context.scene.mat_lib_material_category = "None0";
-        
-        #No errors - set working mode
-        working_mode = self.mode
-        
-        self.report({'INFO'}, "Retrieved library!")
-        
-        return {'FINISHED'}
-
-class LibraryInfo(bpy.types.Operator):
-    '''Display add-on info'''
-    bl_idname = "material.libraryinfo"
-    bl_label = "Display add-on info"
-
-    def execute(self, context):
-        global category_type
-        
-        category_type = "info"
-        
-        return {'FINISHED'}
-
-class LibraryTools(bpy.types.Operator):
-    '''Display material tools'''
-    bl_idname = "material.librarytools"
-    bl_label = "Display material tools"
-
-    def execute(self, context):
-        global category_type
-        
-        category_type = "tools"
-        
-        return {'FINISHED'}
-
-class LibrarySettings(bpy.types.Operator):
-    '''Display add-on settings'''
-    bl_idname = "material.librarysettings"
-    bl_label = "Display add-on settings"
-
-    def execute(self, context):
-        global category_type
-        global mat_lib_cached_files
-        
-        category_type = "settings"
-        if library == "":
-            return {'FINISHED'}
-        elif library == "bundled":
-            mat_lib_cached_files = -2
-            return {'FINISHED'}
-        elif library == "composite":
-            cached_data_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep
-        else:
-            cached_data_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep
-        mat_lib_cached_files = 0
-        for root, dirs, files in os.walk(cached_data_path):
-            for name in files:
-                if ".jpg" in name.lower():
-                    mat_lib_cached_files += 1
-                elif ".png" in name.lower():
-                    mat_lib_cached_files += 1
-                elif ".osl" in name.lower():
-                    mat_lib_cached_files += 1
-                elif ".osl" in name.lower():
-                    mat_lib_cached_files += 1
-                elif ".bcm" in name:
-                    mat_lib_cached_files += 1
-        
-        return {'FINISHED'}
-
-class LibraryHome(bpy.types.Operator):
-    '''Go back'''
-    bl_idname = "material.libraryhome"
-    bl_label = "Go back"
-
-    def execute(self, context):
-        global category_type
-        
-        category_type = "none"
-        
-        return {'FINISHED'}
-
-def libraryCategoryUpdate():
-    print("Updating Material Category.")
-    #Check if the category is None
-    if bpy.context.scene.mat_lib_material_category != "None0":
-        #Selected category is not None; select category.        
-        
-        global category_contents
-        global category_name
-        global category_filename
-        global category_materials
-                
-        global material_names
-        global material_filenames
-        global material_contributors
-        global material_ratings
-        global material_fireflies
-        global material_speeds
-        global material_complexities
-        global material_scripts
-        global material_images
-        
-        global current_material_number
-                
-        global category_type
-        
-        findLibrary()
-    
-        i = 0
-        while i < len(category_enum_items):
-            if category_enum_items[i][0] == bpy.context.scene.mat_lib_material_category:
-                #Set category filename for refresh button
-                category_filename = mat_lib_category_filenames[i - 1]
-                #Set category name for header
-                category_name = mat_lib_category_names[i - 1]
-                category_index = i - 1
-            i = i + 1
-        
-        if True:
-            current_material_number = -1
-            
-            material_names = []
-            material_filenames = []
-            material_contributors = []
-            material_ratings = []
-            material_fireflies = []
-            material_speeds = []
-            material_complexities = []
-            material_scripts = []
-            material_images = []
-            
-            for mat in library_data[category_index].materials:
-                #Get material names
-                material_names.append(mat.name)
-                #Get material filenames
-                material_filenames.append(mat.href)
-                #Get material contributors
-                material_contributors.append(mat.contrib)
-                #Get material ratings
-                material_ratings.append(mat.stars)
-                #Get material firefly levels
-                material_fireflies.append(mat.fireflies)
-                #Get material render speeds
-                material_speeds.append(mat.speed)
-                #Get material complexities
-                material_complexities.append(mat.complexity)
-                #Get material image textures
-                material_images.append(mat.images)
-                #Get material OSL scripts
-                material_scripts.append(mat.scripts)
-            
-            #Set amount of materials in selected category
-            category_materials = len(material_names)
-        
-            category_type = "category"
-        
-        elif "parent" == "parent":
-            current_material_number = -1
-            #REWRITE, REWRITE...
-            #Find category names
-            #parent_category_names = safeEval(parent_category_contents[(parent_category_contents.index('[names]') + 7):parent_category_contents.index('[/names]')])
-            #
-            #Get category filenames
-            #parent_category_filenames = safeEval(parent_category_contents[(parent_category_contents.index('[filenames]') + 11):parent_category_contents.index('[/filenames]')])
-            #
-            #Set parent category name for header
-            #parent_category_name = self.name
-            #
-            #Set parent category filename
-            #parent_category_filename = self.filename
-            #
-            #Set amount of categories in parent category
-            #parent_category_categories = len(parent_category_names)
-            
-            category_type = "parent"
-        
-        elif "subcategory" == "subcategory":
-            current_material_number = -1
-            #ANOTHER REWRITE.
-            #Get material names
-            #material_names = safeEval(category_contents[(category_contents.index("[names]") + 7):category_contents.index("[/names]")])
-            #
-            #Get material filenames
-            #material_filenames = safeEval(category_contents[(category_contents.index("[filenames]") + 11):category_contents.index("[/filenames]")])
-            #
-            #Get material contributors
-            #material_contributors = safeEval(category_contents[(category_contents.index("[contributors]") + 14):category_contents.index("[/contributors]")])
-            #
-            #Get material ratings
-            #material_ratings = safeEval(category_contents[(category_contents.index("[ratings]") + 9):category_contents.index("[/ratings]")])
-            #
-            #Set category name for header
-            #category_name = self.name
-            #
-            #Set category filename for refresh button
-            #category_filename = self.filename
-            
-            #Set amount of materials in selected category
-            #category_materials = len(material_names)
-            
-            category_type = "subcategory"
-        
-        else:
-            self.report({'ERROR'}, "Invalid category! See console for details.")
-            print ("Invalid category!")
-            print (category_contents)
-    else:
-        #Selected category is None
-        parent_category_contents = "None"
-        category_contents = "None"
-        current_material_number = -1
-        category_type = "none"
-
-class ViewMaterial(bpy.types.Operator):
-    '''View material details'''
-    bl_idname = "material.libraryviewmaterial"
-    bl_label = "view material details"
-    material = bpy.props.IntProperty()
-    
-    def execute(self, context):
-        global current_material_number
-        global current_material_cached
-        global current_material_previewed
-        
-        findLibrary()
-        
-        if current_material_number == self.material:
-            if current_material_previewed:
-                current_material_previewed = True
-            else:
-                current_material_previewed = False
-        else:
-            current_material_previewed = False
-        
-        current_material_number = self.material
-        current_material_cached = False
-        
-        if self.material == -1:
-            return {'FINISHED'}
-        
-        if library == "composite":
-            if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + material_filenames[self.material] + ".bcm"):
-                current_material_cached = True
-        elif library != "bundled":
-            if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + material_filenames[self.material] + ".bcm"):
-                current_material_cached = True
-        
-        if context.scene.mat_lib_auto_preview == True:
-            print("Auto-download previews on.")
-            bpy.ops.material.librarypreview(name=material_names[self.material], filename=material_filenames[self.material])
-            self.report({preview_message[0]}, preview_message[1])
-        elif working_mode == "offline":
-            bpy.ops.material.librarypreview(name=material_names[self.material], filename=material_filenames[self.material])
-            self.report({preview_message[0]}, preview_message[1])
-        elif library == "composite":
-            if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep  + category_filename + os.sep + material_filenames[self.material] + ".jpg"):
-                bpy.ops.material.librarypreview(name=material_names[self.material], filename=material_filenames[self.material])
-                self.report({preview_message[0]}, preview_message[1])
-        else:
-            if os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep  + category_filename + os.sep + material_filenames[self.material] + ".jpg"):
-                bpy.ops.material.librarypreview(name=material_names[self.material], filename=material_filenames[self.material])
-                self.report({preview_message[0]}, preview_message[1])
-        return {'FINISHED'}
-
-class MaterialDetailView(bpy.types.Operator):
-    '''Change detail view'''
-    bl_idname = "material.librarydetailview"
-    bl_label = "change detail view"
-    mode = bpy.props.StringProperty()
-
-    def execute(self, context):
-        global material_detail_view
-        
-        if self.mode == "NEXT":
-            if material_detail_view == "RENDER":
-                material_detail_view = "DATA"
-        else:
-            if material_detail_view == "DATA":
-                material_detail_view = "RENDER"
-        return {'FINISHED'}
-            
-
-class LibraryClearCache(bpy.types.Operator):
-    '''Delete active library's cached previews and/or materials'''
-    bl_idname = "material.libraryclearcache"
-    bl_label = "delete cached previews and materials"
-    
-    def execute(self, context):
-        global mat_lib_cached_files
-        findLibrary()
-        
-        if library == "bundled":
-            self.report({'ERROR'}, "The bundled library is local only and contains no cached online data.")
-            return {'CANCELLED'}
-        if library == "composite":
-            for root, dirs, files in os.walk(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep):
-                for name in files:
-                    if name[-4:].lower() == ".jpg":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".png":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".osl":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".oso":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".bcm":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-        else:
-            for root, dirs, files in os.walk(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep):
-                for name in files:
-                    if name[-4:].lower() == ".jpg":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".png":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".osl":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".oso":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-                    elif name[-4:].lower() == ".bcm":
-                        print("Deleting \"" + os.path.join(root, name) + "\".")
-                        os.remove(os.path.join(root, name))
-        
-        if library == "":
-            return {'FINISHED'}
-        elif library == "bundled":
-            return {'FINISHED'}
-        elif library == "composite":
-            cached_data_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep
-        else:
-            cached_data_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep
-        mat_lib_cached_files = 0
-        for root, dirs, files in os.walk(cached_data_path):
-            for name in files:
-                if ".jpg" in name:
-                    mat_lib_cached_files += 1
-                elif ".bcm" in name:
-                    mat_lib_cached_files += 1
-        
-        self.report({'INFO'}, "Preview cache cleared.")
-        return {'FINISHED'}
-    
-class LibraryPreview(bpy.types.Operator):
-    '''Download preview'''
-    bl_idname = "material.librarypreview"
-    bl_label = "preview material"
-    name = bpy.props.StringProperty()
-    filename = bpy.props.StringProperty()
-        
-    def execute(self, context):
-        global parent_category_filename
-        global category_filename
-        global preview_message
-        global library
-        global current_material_previewed
-        
-        findLibrary()
-        
-        #Check for a cached preview
-        if library == "bundled":
-            image_path = mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep  + category_filename + os.sep + self.filename + ".jpg"
-        elif library == "composite":
-            image_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep  + category_filename + os.sep + self.filename + ".jpg"
-        else:
-            image_path = mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep  + category_filename + os.sep + self.filename + ".jpg"
-        
-        if os.path.exists(image_path):
-            #Cached preview exists
-            cached_image = open(image_path, 'r+b')
-            response = cached_image.read()
-            cached_image.close()
-            f = open(mat_lib_folder + os.sep + "mat_lib_preview_image.jpg", 'w+b')
-            f.write(response)
-            f.close()
-            
-        elif working_mode == "online":
-            #This preview doesn't exist yet; let's download it.
-            connection = http.client.HTTPConnection(mat_lib_host)
-            connection.request("GET", mat_lib_location + "cycles/" + category_filename + "/" + self.filename + ".jpg")
-            response = connection.getresponse().read()
-            f = open(mat_lib_folder + os.sep + "mat_lib_preview_image.jpg", 'w+b')
-            f.write(response)
-            f.close()
-            
-            #Cache this preview
-            f = open(image_path, 'w+b')
-            f.write(response)
-            f.close()
-            
-        else:
-            self.report({'WARNING'}, "Preview does not exist; cannot download in offline mode.")
-            preview_message = ['WARNING', "Preview does not exist; cannot download in offline mode."]
-            return {'CANCELLED'}
-        
-        #Check if has texture
-        if bpy.data.images.find("mat_lib_preview_image.jpg") == -1:
-            bpy.ops.image.open(filepath=os.path.join(mat_lib_folder, "mat_lib_preview_image.jpg"))
-        
-        if "mat_lib_preview_texture" not in bpy.data.textures:
-             bpy.data.textures.new("mat_lib_preview_texture", "IMAGE")
-        
-        if bpy.data.textures["mat_lib_preview_texture"].image != bpy.data.images["mat_lib_preview_image.jpg"]:
-            bpy.data.textures["mat_lib_preview_texture"].image = bpy.data.images["mat_lib_preview_image.jpg"]
-        
-        if bpy.data.images["mat_lib_preview_image.jpg"].filepath != os.path.join(mat_lib_folder, "mat_lib_preview_image.jpg"):
-            bpy.data.images["mat_lib_preview_image.jpg"].filepath != os.path.join(mat_lib_folder, "mat_lib_preview_image.jpg")
-            
-        #Do everything possible to get Blender to reload the preview.
-        bpy.data.images["mat_lib_preview_image.jpg"].reload()
-        bpy.ops.wm.redraw_timer()
-        bpy.data.scenes[bpy.context.scene.name].update()
-        bpy.data.scenes[bpy.context.scene.name].frame_set(bpy.data.scenes[bpy.context.scene.name].frame_current)
-        
-        self.report({'INFO'}, "Preview applied.")
-        preview_message = ['INFO', "Preview applied."]
-        current_material_previewed = True
-        
-        return {'FINISHED'}
-
-class AddLibraryMaterial(bpy.types.Operator):
-    '''Add material to scene'''
-    bl_idname = "material.libraryadd"
-    bl_label = "add material to scene"
-    mat_name = bpy.props.StringProperty()
-    filename = bpy.props.StringProperty()
-    open_location = bpy.props.StringProperty()
-    text_block = bpy.props.StringProperty()
-    
-    def execute(self, context):
-        global material_file_contents
-        global library
-        global node_message
-        global current_material_cached
-        
-        findLibrary()
-        
-        if not bpy.context.active_object:
-            self.report({'ERROR'}, "No object selected!")
-        if self.open_location == "" and self.text_block == "":
-            if library == "composite" and os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm"):
-                bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="r", encoding="UTF-8")
-                material_file_contents = ""
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-            elif library != "bundled" and os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm"):
-                bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="r", encoding="UTF-8")
-                material_file_contents = ""
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-            elif library == "bundled" and os.path.exists(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm"):
-                bcm_file = open(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="r", encoding="UTF-8")
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-            elif working_mode == "online":
-                connection = http.client.HTTPConnection(mat_lib_host)
-                connection.request("GET", mat_lib_location + "cycles/" + category_filename + "/" + self.filename + ".bcm")
-                response = connection.getresponse().read()
-                
-                #Check file for validitity
-                if '<?xml version="1.0" encoding="UTF-8"?>' not in str(response)[2:40]:
-                    self.report({'ERROR'}, "Material file is either outdated or invalid.")
-                    self.filename = ""
-                    return {'CANCELLED'}
-                
-                #Cache material
-                if library == "composite":
-                    bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="w+b")
-                    bcm_file.write(response)
-                    bcm_file.close()
-                else:
-                    bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="w+b")
-                    bcm_file.write(response)
-                    bcm_file.close()
-                
-                material_file_contents = str(response)
-            else:
-                self.report({'ERROR'}, "Material is not cached; cannot download in offline mode!")
-                return {'CANCELLED'}
-            print (material_file_contents)
-            mat_name = self.mat_name
-        elif self.open_location is not "":
-            if ".bcm" in self.open_location:
-                bcm_file = open(self.open_location, mode="r", encoding="UTF-8")
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-                
-                #Check file for validitity
-                if '<?xml version="1.0" encoding="UTF-8"?>' not in material_file_contents:
-                    self.open_location = ""
-                    self.report({'ERROR'}, "Material file is either outdated or invalid.")
-                    return {'CANCELLED'}
-                mat_name = ""
-                for word in self.open_location.split(os.sep)[-1][:-4].split("_"):
-                    if mat_name is not "":
-                        mat_name += " "
-                    mat_name += word.capitalize()
-            else:
-                self.report({'ERROR'}, "Not a .bcm file.")
-                self.open_location = ""
-                return {'CANCELLED'}
-        else:
-            if self.text_block in bpy.data.texts:
-                #Read from a text datablock
-                material_file_contents = bpy.data.texts[self.text_block].as_string()
-            else:
-                self.report({'ERROR'}, "Requested text block does not exist.")
-                self.text_block = ""
-                return {'CANCELLED'}
-                
-            #Check file for validitity
-            if '<?xml version="1.0" encoding="UTF-8"?>' not in material_file_contents[0:38]:
-                self.report({'ERROR'}, "Material data is either outdated or invalid.")
-                self.text_block = ""
-                return {'CANCELLED'}
-            mat_name = ""
-            
-            separator = ""
-            if context.scene.mat_lib_bcm_name is "":
-                separator = ""
-                if "_" in self.text_block:
-                    separator = "_"
-                elif "-" in self.text_block:
-                    separator = "-"
-                elif " " in self.text_block:
-                    separator = " "
-                    
-                if separator is not "":
-                    for word in self.text_block.split(separator):
-                        if mat_name is not "":
-                            mat_name += " "
-                        mat_name += word.capitalize()
-                else:
-                    mat_name = self.text_block
-            else:
-                mat_name = context.scene.mat_lib_bcm_name
-        
-        if '<?xml version="1.0" encoding="UTF-8"?>' in material_file_contents[0:40]:
-            material_file_contents = material_file_contents[material_file_contents.index("<material"):(material_file_contents.rindex("</material>") + 11)]
-        else:
-            self.mat_name = ""
-            self.filename = ""
-            self.text_block = ""
-            self.open_location = ""
-            self.report({'ERROR'}, "Material file is either invalid or outdated.")
-            print(material_file_contents)
-            return {'CANCELLED'}
-        
-        #Create new material
-        new_mat = bpy.data.materials.new(mat_name)
-        new_mat.use_nodes = True
-        new_mat.node_tree.nodes.clear()
-        
-        #Parse file
-        dom = xml.dom.minidom.parseString(material_file_contents)
-        
-        #Create internal OSL scripts
-        scripts = dom.getElementsByTagName("script")
-        osl_scripts = []
-        for s in scripts:
-            osl_datablock = bpy.data.texts.new(name=s.attributes['name'].value)
-            osl_text = s.toxml()[s.toxml().index(">"):s.toxml().rindex("<")]
-            osl_text = osl_text[1:].replace("<br/>","\n").replace("<", "<").replace(">", ">").replace(""", "\"").replace("&", "&")
-            osl_datablock.write(osl_text)
-            osl_scripts.append(osl_datablock)
-        
-        #Add nodes
-        nodes = dom.getElementsByTagName("node")
-        addNodes(nodes, new_mat)
-        if node_message:
-            self.report({node_message[0]}, node_message[1])
-            node_message = []
-            self.mat_name = ""
-            self.filename = ""
-            self.open_location = ""
-            self.text_block = ""
-            return {'CANCELLED'}
-            
-        #Create links
-        links = dom.getElementsByTagName("link")
-        createLinks(links, new_mat)
-        
-        m = dom.getElementsByTagName("material")[0]
-        
-        #Set viewport color
-        new_mat.diffuse_color = color(m.attributes["view_color"].value)
-            
-        #Set sample-as-lamp-ness
-        if m.attributes["sample_lamp"].value == "True":
-            sample_lamp = True
-        else:
-            sample_lamp = False
-        new_mat.cycles.sample_as_light = sample_lamp
-        
-        self.mat_name = ""
-        self.filename = ""
-        self.open_location = ""
-        self.text_block = ""
-        self.report({'INFO'}, "Material added.")
-        current_material_cached = True
-        
-        return {'FINISHED'}
-
-class ApplyLibraryMaterial(bpy.types.Operator):
-    '''Apply to active material'''
-    bl_idname = "material.libraryapply"
-    bl_label = "Apply to active material"
-    mat_name = bpy.props.StringProperty()
-    filename = bpy.props.StringProperty()
-    open_location = bpy.props.StringProperty()
-    text_block = bpy.props.StringProperty()
-    
-    def execute(self, context):
-        global material_file_contents
-        global library
-        global node_message
-        global current_material_cached
-        global osl_scripts
-        
-        findLibrary()
-        
-        mat_name = ""
-        material_file_contents = ""
-        if not bpy.context.active_object:
-            self.report({'ERROR'}, "No object selected!")
-            return {'CANCELLED'}
-        if self.filename is not "":
-            if library == "composite" and os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm"):
-                bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="r", encoding="UTF-8")
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-            elif library != "bundled" and os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm"):
-                bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="r", encoding="UTF-8")
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-            elif library == "bundled" and os.path.exists(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm"):
-                bcm_file = open(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="r", encoding="UTF-8")
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-            elif working_mode == "online":
-                connection = http.client.HTTPConnection(mat_lib_host)
-                connection.request("GET", mat_lib_location + "cycles/" + category_filename + "/" + self.filename + ".bcm")
-                response = connection.getresponse().read()
-                
-                #Check file for validitity
-                if '<?xml version="1.0" encoding="UTF-8"?>' not in str(response)[2:40]:
-                    self.report({'ERROR'}, "Material file is either outdated or invalid.")
-                    self.mat_name = ""
-                    self.filename = ""
-                    return {'CANCELLED'}
-                
-                #Cache material
-                if library == "composite":
-                    bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="w+b")
-                    bcm_file.write(response)
-                    bcm_file.close()
-                else:
-                    bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="w+b")
-                    bcm_file.write(response)
-                    bcm_file.close()
-                
-                material_file_contents = str(response)
-            else:
-                self.report({'ERROR'}, "Material is not cached; cannot download in offline mode!")
-                self.mat_name = ""
-                self.filename = ""
-                return {'CANCELLED'}
-            mat_name = self.mat_name
-        elif self.open_location is not "":
-            if ".bcm" in self.open_location:
-                material_file_contents = ""
-                bcm_file = open(self.open_location, mode="r", encoding="UTF-8")
-                material_file_contents = bcm_file.read()
-                bcm_file.close()
-                
-                mat_name = ""
-                for word in self.open_location.split(os.sep)[-1][:-4].split("_"):
-                    if mat_name is not "":
-                        mat_name += " "
-                    mat_name += word.capitalize()
-            else:
-                self.open_location = ""
-                self.report({'ERROR'}, "Not a .bcm file.")
-                return {'CANCELLED'}
-        else:
-            if self.text_block in bpy.data.texts:
-                #Read from a text datablock
-                material_file_contents = ""
-                material_file_contents = bpy.data.texts[self.text_block].as_string()
-            else:
-                self.report({'ERROR'}, "Requested text block does not exist.")
-                self.text_block = "";
-                return {'CANCELLED'}
-            
-            if context.scene.mat_lib_bcm_name is "":
-                separator = ""
-                if "_" in self.text_block:
-                    separator = "_"
-                elif "-" in self.text_block:
-                    separator = "-"
-                elif " " in self.text_block:
-                    separator = " "
-                    
-                if separator is not "":
-                    for word in self.text_block.split(separator):
-                        if mat_name is not "":
-                            mat_name += " "
-                        mat_name += word.capitalize()
-                else:
-                    mat_name = self.text_block
-            else:
-                mat_name = context.scene.mat_lib_bcm_name
-        
-        
-        if context.active_object.active_material:
-            context.active_object.active_material.name = mat_name
-        else:
-            new_material = bpy.data.materials.new(mat_name)
-            if len(context.active_object.material_slots.keys()) is 0:
-                bpy.ops.object.material_slot_add()
-            context.active_object.material_slots[context.active_object.active_material_index].material = new_material
-        
-        #Prepare material for new nodes
-        context.active_object.active_material.use_nodes = True
-        context.active_object.active_material.node_tree.nodes.clear()
-        
-        if '<?xml version="1.0" encoding="UTF-8"?>' in material_file_contents[0:40]:
-            material_file_contents = material_file_contents[material_file_contents.index("<material"):(material_file_contents.rindex("</material>") + 11)]
-        else:
-            self.mat_name = ""
-            self.filename = ""
-            self.text_block = ""
-            self.open_location = ""
-            self.report({'ERROR'}, "Material file is either invalid or outdated.")
-            print(material_file_contents)
-            return {'CANCELLED'}
-        
-        #Parse file
-        dom = xml.dom.minidom.parseString(material_file_contents)
-        
-        #Create internal OSL scripts
-        scripts = dom.getElementsByTagName("script")
-        osl_scripts = []
-        for s in scripts:
-            osl_datablock = bpy.data.texts.new(name=s.attributes['name'].value)
-            osl_text = s.toxml()[s.toxml().index(">"):s.toxml().rindex("<")]
-            osl_text = osl_text[1:].replace("<br/>","\n").replace("<", "<").replace(">", ">").replace(""", "\"").replace("&", "&")
-            osl_datablock.write(osl_text)
-            osl_scripts.append(osl_datablock)
-        
-        #Add nodes
-        nodes = dom.getElementsByTagName("node")
-        addNodes(nodes, context.active_object.active_material)
-        if node_message:
-            self.report({node_message[0]}, node_message[1])
-            node_message = []
-            self.mat_name = ""
-            self.filename = ""
-            self.open_location = ""
-            self.text_block = ""
-            return {'CANCELLED'}
-            
-        #Create links
-        links = dom.getElementsByTagName("link")
-        createLinks(links, context.active_object.active_material)
-        
-        m = dom.getElementsByTagName("material")[0]
-        
-        #Set viewport color
-        context.active_object.active_material.diffuse_color = color(m.attributes["view_color"].value)
-            
-        #Set sample-as-lamp-ness
-        if boolean(m.attributes["sample_lamp"].value):
-            sample_lamp = True
-        else:
-            sample_lamp = False
-        context.active_object.active_material.cycles.sample_as_light = sample_lamp
-        
-        self.mat_name = ""
-        self.filename = ""
-        self.open_location = ""
-        self.text_block = ""
-        self.report({'INFO'}, "Material applied.")
-        current_material_cached = True
-        
-        return {'FINISHED'}
-
-class CacheLibraryMaterial(bpy.types.Operator):
-    '''Cache material to disk'''
-    bl_idname = "material.librarycache"
-    bl_label = "cache material to disk"
-    filename = bpy.props.StringProperty()
-    
-    def execute(self, context):
-        global material_file_contents
-        global current_material_cached
-        
-        findLibrary()
-        
-        if working_mode == "online":
-            connection = http.client.HTTPConnection(mat_lib_host)
-            connection.request("GET", mat_lib_location + "cycles/" + category_filename + "/" + self.filename + ".bcm")
-            response = connection.getresponse().read()
-        else:
-            self.report({'ERROR'}, "Cannot cache material in offline mode.")
-            return {'CANCELLED'}
-        
-        material_file_contents = str(response)
-        if '<?xml version="1.0" encoding="UTF-8"?>' in material_file_contents[2:40]:
-            material_file_contents = material_file_contents[material_file_contents.index("<material"):(material_file_contents.rindex("</material>") + 11)]
-        else:
-            self.report({'ERROR'}, "Invalid material file.")
-            print(material_file_contents)
-            return {'CANCELLED'}
-        
-        #Parse file
-        dom = xml.dom.minidom.parseString(material_file_contents)
-        
-        #Create external OSL scripts and cache image textures
-        nodes = dom.getElementsByTagName("node")
-        for node in nodes:
-            node_data = node.attributes
-            if node_data['type'].value == "TEX_IMAGE":
-                if node_data['image'].value:
-                    if "file://" in node_data['image'].value:
-                        self.report({'ERROR'}, "Cannot cache image texture located at %s." % node_data['image'].value)
-                    elif "http://" in node_data['image'].value:
-                        self.report({'ERROR'}, "Cannot cache image texture hosted at %s." % node_data['image'].value)
-                    else:
-                        ext = "." + node_data['image'].value.split(".")[-1]
-                        image_name = node_data['image'].value[:-4]
-                        
-                        if ext.lower() != ".jpg" and ext.lower() != ".png":
-                            node_message = ['ERROR', "The image file referenced by this image texture node is not .jpg or .png; not downloading."]
-                            return
-                            
-                        if library == "composite" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)):
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                        elif library != "bundled" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)):
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                        elif library == "bundled" and os.path.exists(os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)):
-                            image_filepath = os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)
-                        elif working_mode == "online":
-                            connection = http.client.HTTPConnection(mat_lib_host)
-                            connection.request("GET", mat_lib_location + "cycles/textures/" + image_name + ext)
-                            response = connection.getresponse().read()
-                            
-                            #Cache image texture
-                            if library == "composite":
-                                image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                                image_file = open(image_filepath, mode="w+b")
-                                image_file.write(response)
-                                image_file.close()
-                            else:
-                                image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                                image_file = open(image_filepath, mode="w+b")
-                                image_file.write(response)
-                                image_file.close()
-                        else:
-                            node_message = ['ERROR', "The image texture, \"%s\", is not cached; cannot download in offline mode." % (image_name + ext)]
-                            image_filepath = ""
-            elif node_data['type'].value == "SCRIPT":
-                if node_data['script'].value:
-                    if "file://" in node_data['script'].value:
-                        self.report({'ERROR'}, "Cannot cache OSL script located at %s." % node_data['script'].value)
-                    elif "http://" in node_data['script'].value:
-                        self.report({'ERROR'}, "Cannot cache OSL script hosted at %s." % node_data['script'].value)
-                    else:
-                        ext = "." + node_data['script'].value.split(".")[-1]
-                        script_name = node_data['script'].value[:-4]
-                        
-                        if ext.lower() != ".osl" and ext.lower() != ".oso":
-                            node_message = ['ERROR', "The OSL script file referenced by this script node is not .osl or .oso; not downloading."]
-                            return
-                            
-                        if library == "composite" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)):
-                            script_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)
-                        elif library != "bundled" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)):
-                            script_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)
-                        elif library == "bundled" and os.path.exists(os.path.join(mat_lib_folder, "bundled", "cycles", "scripts", script_name + ext)):
-                            script_filepath = os.path.join(mat_lib_folder, "bundled", "cycles", "scripts", script_name + ext)
-                        elif working_mode == "online":
-                            connection = http.client.HTTPConnection(mat_lib_host)
-                            connection.request("GET", mat_lib_location + "cycles/scripts/" + script_name + ext)
-                            response = connection.getresponse().read()
-                            
-                            #Cache image texture
-                            if library == "composite":
-                                script_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)
-                                script_file = open(script_filepath, mode="w+b")
-                                script_file.write(response)
-                                script_file.close()
-                            else:
-                                script_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)
-                                script_file = open(script_filepath, mode="w+b")
-                                script_file.write(response)
-                                script_file.close()
-                        else:
-                            node_message = ['ERROR', "The OSL script, \"%s\", is not cached; cannot download in offline mode." % (script_name + ext)]
-                            script_filepath = ""
-                    
-        
-        if library == "composite":
-            bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="w+b")
-            bcm_file.write(response)
-            bcm_file.close()
-        elif library != "bundled":
-            bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename + ".bcm", mode="w+b")
-            bcm_file.write(response)
-            bcm_file.close()
-        else:
-            self.report({'ERROR'}, "Cannot cache materials from this library.")
-            return {'CANCELLED'}
-            
-        current_material_cached = True
-        self.report({'INFO'}, "Material cached.")
-        return {'FINISHED'}
-
-class SaveLibraryMaterial(bpy.types.Operator, ExportHelper):
-    '''Save material to disk'''
-    bl_idname = "material.librarysave"
-    bl_label = "Save material to disk"
-    filepath = bpy.props.StringProperty()
-    filename = bpy.props.StringProperty()
-    
-    #ExportHelper uses this
-    filename_ext = ".bcm"
-
-    filter_glob = bpy.props.StringProperty(
-            default="*.bcm",
-            options={'HIDDEN'},
-            )
-    
-    def execute(self, context):
-        global material_file_contents
-        global save_filename
-        global current_material_cached
-        
-        findLibrary()
-        
-        if library == "composite" and os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + save_filename):
-            bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename, mode="r+b")
-            response = bcm_file.read()
-            bcm_file.close()
-        elif library != "bundled" and os.path.exists(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + save_filename):
-            bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename, mode="r+b")
-            response = bcm_file.read()
-            bcm_file.close()
-        elif library == "bundled" and os.path.exists(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + category_filename + os.sep + save_filename):
-            bcm_file = open(mat_lib_folder + os.sep + "bundled" + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename, mode="r+b")
-            response = bcm_file.read()
-            bcm_file.close()
-        elif working_mode == "online":
-            connection = http.client.HTTPConnection(mat_lib_host)
-            connection.request("GET", mat_lib_location + "cycles/" + category_filename + "/" + self.filename)
-            response = connection.getresponse().read()
-            
-            #Cache material
-            if library == "composite":
-                bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename, mode="w+b")
-                bcm_file.write(response)
-                bcm_file.close()
-            else:
-                bcm_file = open(mat_lib_folder + os.sep + mat_lib_host + os.sep + library + os.sep + "cycles" + os.sep + category_filename + os.sep + self.filename, mode="w+b")
-                bcm_file.write(response)
-                bcm_file.close()
-        else:
-            self.report({'ERROR'}, "Material is not cached; cannot download in offline mode.")
-            return {'FINISHED'}
-        
-        material_file_contents = str(response)
-        
-        bcm_file = open(self.filepath, mode="w+b")
-        bcm_file.write(response)
-        bcm_file.close()
-        
-        if '<?xml version="1.0" encoding="UTF-8"?>' in material_file_contents[0:40]:
-            material_file_contents = material_file_contents[material_file_contents.index("<material"):(material_file_contents.rindex("</material>") + 11)]
-        else:
-            self.report({'ERROR'}, "Invalid material file.")
-            print(material_file_contents)
-            return {'CANCELLED'}
-        
-        #Parse file
-        dom = xml.dom.minidom.parseString(material_file_contents)
-        
-        bcm_file = open(self.filepath, mode="r", encoding="UTF-8")
-        material_file_contents = bcm_file.read()
-        bcm_file.close()
-        
-        #Create external OSL scripts and cache image textures
-        nodes = dom.getElementsByTagName("node")
-        for node in nodes:
-            node_data = node.attributes
-            if node_data['type'].value == "TEX_IMAGE":
-                if node_data['image'].value:
-                    node_attributes = (
-                        node_data['image'].value,
-                        node_data['source'].value,
-                        node_data['color_space'].value,
-                        node_data['projection'].value,
-                        node_data['loc'].value)
-                    original_xml = ("<node type=\"TEX_IMAGE\" image=\"%s\" source=\"%s\" color_space=\"%s\" projection=\"%s\" loc=\"%s\" />" % node_attributes)
-                    if "file://" in node_data['image'].value:
-                        if os.path.exists(node_data['image'].value[7:]):
-                            image_file = open(node_data['image'].value[7:], mode="r+b")
-                            image_data = image_file.read()
-                            image_file.close()
-                            copied_image = open(self.filepath[:-len(self.filename)] + node_data['image'].value.split(os.sep)[-1], mode="w+b")
-                            copied_image.write(image_data)
-                            copied_image.close()
-                            image_location = ("file://" + self.filepath[:-len(self.filename)] + node_data['image'].value.split(os.sep)[-1])
-                        else:
-                            image_location = ""
-                    elif "http://" in node_data['image'].value:
-                        self.report({'ERROR'}, "Cannot save image texture hosted at %s." % node_data['image'].value)
-                        image_location = ""
-                    else:
-                        ext = "." + node_data['image'].value.split(".")[-1]
-                        image_name = node_data['image'].value[:-4]
-                        
-                        if ext.lower() != ".jpg" and ext.lower() != ".png":
-                            node_message = ['ERROR', "The image file referenced by this image texture node is not .jpg or .png; not downloading."]
-                            return
-                            
-                        if library == "composite" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)):
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                        elif library != "bundled" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)):
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                        elif library == "bundled" and os.path.exists(os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)):
-                            image_filepath = os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)
-                        elif working_mode == "online":
-                            connection = http.client.HTTPConnection(mat_lib_host)
-                            connection.request("GET", mat_lib_location + "cycles/textures/" + image_name + ext)
-                            response = connection.getresponse().read()
-                            
-                            #Cache image texture
-                            if library == "composite":
-                                image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                                image_file = open(image_filepath, mode="w+b")
-                                image_file.write(response)
-                                image_file.close()
-                            else:
-                                image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                                image_file = open(image_filepath, mode="w+b")
-                                image_file.write(response)
-                                image_file.close()
-                        else:
-                            node_message = ['ERROR', "The image texture, \"%s\", is not cached; cannot download in offline mode." % (image_name + ext)]
-                            image_filepath = ""
-                        image_location = ("file://" + self.filepath[:-len(self.filename)] + node_data['image'].value)
-                        
-                        if image_filepath:
-                            print(image_filepath)
-                            image_file = open(image_filepath, mode="r+b")
-                            image_data = image_file.read()
-                            image_file.close()
-                            saved_image = open(self.filepath[:-len(self.filename)] + node_data['image'].value, mode="w+b")
-                            saved_image.write(image_data)
-                            saved_image.close()
-                
-                    updated_xml = original_xml.replace(node_data['image'].value, image_location)
-                    material_file_contents = material_file_contents.replace(original_xml, updated_xml)
-            elif node_data['type'].value == "SCRIPT":
-                if node_data['script'].value:
-                    node_attributes = (
-                        node_data['mode'].value,
-                        node_data['script'].value,
-                        node_data['loc'].value)
-                    original_xml = ("<node type=\"SCRIPT\" mode=\"%s\" script=\"%s\" loc=\"%s\" />" % node_attributes)
-                    if "file://" in node_data['script'].value:
-                        if os.path.exists(node_data['script'].value[7:]):
-                            script_file = open(node_data['script'].value[7:], mode="r+b")
-                            script_data = script_file.read()
-                            script_file.close()
-                            copied_script = open(self.filepath[:-len(self.filename)] + node_data['script'].value.split(os.sep)[-1], mode="w+b")
-                            copied_script.write(script_data)
-                            copied_script.close()
-                            script_location = ("file://" + self.filepath[:-len(self.filename)] + node_data['script'].value.split(os.sep)[-1])
-                        else:
-                            script_location = ""
-                    elif "http://" in node_data['script'].value:
-                        self.report({'ERROR'}, "Cannot save OSL script hosted at %s." % node_data['script'].value)
-                        script_location = ""
-                    else:
-                        ext = "." + node_data['script'].value.split(".")[-1]
-                        script_name = node_data['script'].value[:-4]
-                        
-                        if ext.lower() != ".osl" and ext.lower() != ".oso":
-                            node_message = ['ERROR', "The OSL script file referenced by this script node is not .osl or .oso; not downloading."]
-                            return
-                            
-                        if library == "composite" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)):
-                            script_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)
-                        elif library != "bundled" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)):
-                            script_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)
-                        elif library == "bundled" and os.path.exists(os.path.join(mat_lib_folder, "bundled", "cycles", "scripts", script_name + ext)):
-                            script_filepath = os.path.join(mat_lib_folder, "bundled", "cycles", "scripts", script_name + ext)
-                        elif working_mode == "online":
-                            connection = http.client.HTTPConnection(mat_lib_host)
-                            connection.request("GET", mat_lib_location + "cycles/scripts/" + script_name + ext)
-                            response = connection.getresponse().read()
-                            
-                            #Cache OSL script
-                            if library == "composite":
-                                script_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)
-                                script_file = open(script_filepath, mode="w+b")
-                                script_file.write(response)
-                                script_file.close()
-                            else:
-                                script_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)
-                                script_file = open(script_filepath, mode="w+b")
-                                script_file.write(response)
-                                script_file.close()
-                        else:
-                            node_message = ['ERROR', "The OSL script, \"%s\", is not cached; cannot download in offline mode." % (script_name + ext)]
-                            script_filepath = ""
-                        
-                        if script_filepath:
-                            print(script_filepath)
-                            script_file = open(script_filepath, mode="r+b")
-                            script_data = script_file.read()
-                            script_file.close()
-                            saved_script = open(self.filepath[:-len(self.filename)] + node_data['script'].value, mode="w+b")
-                            saved_script.write(script_data)
-                            saved_script.close()
-                    
-                    updated_xml = original_xml.replace(node_data['script'].value, script_location)
-                    material_file_contents = material_file_contents.replace(original_xml, updated_xml)
-        
-        bcm_file = open(self.filepath, mode="w", encoding="UTF-8")
-        bcm_file.write(material_file_contents)
-        bcm_file.close()
-        
-        self.report({'INFO'}, "Material saved.")
-        current_material_cached = True
-        
-        return {'FINISHED'}
-
-def createLinks(links, mat):
-    node_tree = mat.node_tree
-    for dom_link in links:
-        link = {
-    "to": int(dom_link.attributes['to'].value),
-    "input": int(dom_link.attributes['input'].value),
-    "from": int(dom_link.attributes['from'].value),
-    "output": int(dom_link.attributes['output'].value)}
-        node_tree.links.new(
-    node_tree.nodes[link["to"]].inputs[link["input"]],
-    node_tree.nodes[link["from"]].outputs[link["output"]])
-
-def addNodes(nodes, mat):
-    global node_message
-    global osl_scripts
-    
-    for dom_node in nodes:
-        node_type = dom_node.attributes['type'].value
-        loc = dom_node.attributes['loc'].value
-        node_location = [int(loc[:loc.index(",")]), int(loc[(loc.index(",") + 1):])]
-        node_tree = mat.node_tree
-        node_data = dom_node.attributes
-        
-        #Below here checks the type of the node and adds the correct type
-        
-        #INPUT TYPES
-        #This is totally crafty, but some of these nodes actually
-        # store their values as their output's default value!
-        if node_type == "ATTRIBUTE":
-            print ("ATTRIBUTE")
-            node = node_tree.nodes.new(node_type)
-            node.attribute_name = node_data['attribute'].value
-        
-        elif node_type == "CAMERA":
-            print ("CAMERA")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "FRESNEL":
-            print ("FRESNEL")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['IOR'].default_value = float(node_data['ior'].value)
-                
-        elif node_type == "LAYER_WEIGHT":
-            print ("LAYER_WEIGHT")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Blend'].default_value = float(node_data['blend'].value)
-                
-        elif node_type == "LIGHT_PATH":
-            print ("LIGHT_PATH")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "NEW_GEOMETRY":
-            print ("NEW_GEOMETRY")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "OBJECT_INFO":
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.64:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            print ("OBJECT_INFO")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "PARTICLE_INFO":
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.64:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            print ("PARTICLE_INFO")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "RGB":
-            print ("RGB")
-            node = node_tree.nodes.new(node_type)
-            node.outputs['Color'].default_value = color(node_data['color'].value)
-        
-        elif node_type == "TANGENT":
-            print ("TANGENT")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.65:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.direction_type = node_data['direction'].value
-            node.axis = node_data['axis'].value
-        
-        elif node_type == "TEX_COORD":
-            print ("TEX_COORD")
-            node = node_tree.nodes.new(node_type)
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.64 and "dupli" in node_data:
-                node.from_dupli = boolean(node_data['dupli'].value)
-        
-        elif node_type == "VALUE":
-            print ("VALUE")
-            node = node_tree.nodes.new(node_type)
-            node.outputs['Value'].default_value = float(node_data['value'].value)
-            
-            #OUTPUT TYPES
-        elif node_type == "OUTPUT_LAMP":
-            print ("OUTPUT_LAMP")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "OUTPUT_MATERIAL":
-            print ("OUTPUT_MATERIAL")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "OUTPUT_WORLD":
-            print ("OUTPUT_WORLD")
-            node = node_tree.nodes.new(node_type)
-        
-            #SHADER TYPES
-        elif node_type == "ADD_SHADER":
-            print ("ADD_SHADER")
-            node = node_tree.nodes.new(node_type)
-            
-        elif node_type == "AMBIENT_OCCLUSION":
-            print ("AMBIENT_OCCLUSION")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.65:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-        
-        elif node_type == "BACKGROUND":
-            print ("BACKGROUND")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Strength'].default_value = float(node_data['strength'].value)
-            
-        elif node_type == "BSDF_ANISOTROPIC":
-            print ("BSDF_ANISOTROPIC")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.65:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Roughness'].default_value = float(node_data['roughness'].value)
-            node.inputs['Anisotropy'].default_value = float(node_data['anisotropy'].value)
-            node.inputs['Rotation'].default_value = float(node_data['rotation'].value)
-            
-        elif node_type == "BSDF_DIFFUSE":
-            print ("BSDF_DIFFUSE")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Roughness'].default_value = float(node_data['roughness'].value)
-        
-        elif node_type == "BSDF_GLASS":
-            print ("BSDF_GLASS")
-            node = node_tree.nodes.new(node_type)
-            node.distribution = node_data['distribution'].value
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Roughness'].default_value = float(node_data['roughness'].value)
-            node.inputs['IOR'].default_value = float(node_data['ior'].value)
-            
-        elif node_type == "BSDF_GLOSSY":
-            print ("BSDF_GLOSSY")
-            node = node_tree.nodes.new(node_type)
-            node.distribution = node_data['distribution'].value
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Roughness'].default_value = float(node_data['roughness'].value)
-        
-        elif node_type == "BSDF_REFRACTION":
-            print ("BSDF_REFRACTION")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.65:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.distribution = node_data['distribution'].value
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Roughness'].default_value = float(node_data['roughness'].value)
-            node.inputs['IOR'].default_value = float(node_data['ior'].value)
-        
-        elif node_type == "BSDF_TRANSLUCENT":
-            print ("BSDF_TRANSLUCENT")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-        
-        elif node_type == "BSDF_TRANSPARENT":
-            print ("BSDF_TRANSPARENT")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-        
-        elif node_type == "BSDF_VELVET":
-            print ("BSDF_VELVET")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Sigma'].default_value = float(node_data['sigma'].value)
-        
-        elif node_type == "EMISSION":
-            print ("EMISSION")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Strength'].default_value = float(node_data['strength'].value)
-        
-        elif node_type == "HOLDOUT":
-            print ("HOLDOUT")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "MIX_SHADER":
-            print ("MIX_SHADER")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Fac'].default_value = float(node_data['fac'].value)
-        
-            #TEXTURE TYPES
-        elif node_type == "TEX_BRICK":
-            print ("TEX_BRICK")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.64:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.offset = float(node_data['offset'].value)
-            node.offset_frequency = float(node_data['offset_freq'].value)
-            node.squash = float(node_data['squash'].value)
-            node.squash_frequency = float(node_data['squash_freq'].value)
-            node.inputs['Color1'].default_value = color(node_data['color1'].value)
-            node.inputs['Color2'].default_value = color(node_data['color2'].value)
-            node.inputs['Mortar'].default_value = color(node_data['mortar'].value)
-            node.inputs['Scale'].default_value = float(node_data['scale'].value)
-            node.inputs['Mortar Size'].default_value = float(node_data['mortar_size'].value)
-            node.inputs['Bias'].default_value = float(node_data['bias'].value)
-            node.inputs['Brick Width'].default_value = float(node_data['width'].value)
-            node.inputs['Row Height'].default_value = float(node_data['height'].value)
-            
-        elif node_type == "TEX_CHECKER":
-            print ("TEX_CHECKER")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color1'].default_value = color(node_data['color1'].value)
-            node.inputs['Color2'].default_value = color(node_data['color2'].value)
-            node.inputs['Scale'].default_value = float(node_data['scale'].value)
-            
-        elif node_type == "TEX_ENVIRONMENT":
-            print ("TEX_ENVIRONMENT")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.64:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.color_space = node_data['color_space'].value
-            node.projection = node_data['projection'].value
-            if 'image' in node_data:
-                if "file://" in node_data['image'].value:
-                    image_filepath = node_data['image'].value[7:]
-                    image_name = node_data['image'].value.split(os.sep)[-1]
-                    image_datablock = bpy.data.images.new(name=image_name, width=4, height=4)
-                    image_datablock.source = node_data['source'].value
-                    image_datablock.filepath = image_filepath
-                    node.image = image_datablock
-                    if node_data['source'].value == 'MOVIE' or node_data['source'].value == 'SEQUENCE':
-                        node.image_user.frame_duration = int(node_data['frame_duration'].value)
-                        node.image_user.frame_start = int(node_data['frame_start'].value)
-                        node.image_user.frame_offset = int(node_data['frame_offset'].value)
-                        node.image_user.use_cyclic = boolean(node_data['cyclic'].value)
-                        node.image_user.use_auto_refresh = boolean(node_data['auto_refresh'].value)
-                elif "http://" in node_data['image'].value and bpy.context.scene.mat_lib_images_only_trusted == False:
-                    ext = "." + node_data['image'].value.split(".")[-1]
-                    image_name = node_data['image'].value.split("/")[-1][:-4]
-                    image_host = node_data['image'].value[7:].split("/")[0]
-                    image_location = node_data['image'].value[(7 + len(image_host)):]
-                    
-                    if ext.lower() != ".jpg" and ext.lower() != ".png":
-                        node_message = ['ERROR', "The image file referenced by this image texture node is not .jpg or .png; not downloading."]
-                        return
-                    
-                    connection = http.client.HTTPConnection(image_host)
-                    connection.request("GET", image_location)
-                    response = connection.getresponse().read()
-                    #Save image texture
-                    image_filepath = os.path.join(mat_lib_folder, "my-materials", image_name + ext)
-                    image_file = open(image_filepath, mode="w+b")
-                    image_file.write(response)
-                    image_file.close()
-                    image_datablock = bpy.data.images.new(name=(image_name + ext), width=4, height=4)
-                    image_datablock.source = node_data['source'].value
-                    image_datablock.filepath = image_filepath
-                    node.image = image_datablock
-                    if node_data['source'].value == 'MOVIE' or node_data['source'].value == 'SEQUENCE':
-                        node.image_user.frame_duration = int(node_data['frame_duration'].value)
-                        node.image_user.frame_start = int(node_data['frame_start'].value)
-                        node.image_user.frame_offset = int(node_data['frame_offset'].value)
-                        node.image_user.use_cyclic = boolean(node_data['cyclic'].value)
-                        node.image_user.use_auto_refresh = boolean(node_data['auto_refresh'].value)
-                else:
-                    ext = "." + node_data['image'].value.split(".")[-1]
-                    image_name = node_data['image'].value[:-4]
-                    
-                    if ext.lower() != ".jpg" and ext.lower() != ".png":
-                        node_message = ['ERROR', "The image file referenced by this image texture node is not .jpg or .png; not downloading."]
-                        return
-                        
-                    if library == "composite" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)):
-                        image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                    elif library != "bundled" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)):
-                        image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                    elif library == "bundled" and os.path.exists(os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)):
-                        image_filepath = os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)
-                    elif working_mode == "online":
-                        connection = http.client.HTTPConnection(mat_lib_host)
-                        connection.request("GET", mat_lib_location + "cycles/textures/" + image_name + ext)
-                        response = connection.getresponse().read()
-                        
-                        #Cache image texture
-                        if library == "composite":
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                            image_file = open(image_filepath, mode="w+b")
-                            image_file.write(response)
-                            image_file.close()
-                        else:
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                            image_file = open(image_filepath, mode="w+b")
-                            image_file.write(response)
-                            image_file.close()
-                    else:
-                        node_message = ['ERROR', "The image texture, \"%s\", is not cached; cannot download in offline mode." % (image_name + ext)]
-                        image_filepath = ""
-                    if image_filepath != "":
-                        image_datablock = bpy.data.images.new(name=(image_name + ext), width=4, height=4)
-                        image_datablock.source = node_data['source'].value
-                        image_datablock.filepath = image_filepath
-                        node.image = image_datablock
-                        if node_data['source'].value == 'MOVIE' or node_data['source'].value == 'SEQUENCE':
-                            node.image_user.frame_duration = int(node_data['frame_duration'].value)
-                            node.image_user.frame_start = int(node_data['frame_start'].value)
-                            node.image_user.frame_offset = int(node_data['frame_offset'].value)
-                            node.image_user.use_cyclic = boolean(node_data['cyclic'].value)
-                            node.image_user.use_auto_refresh = boolean(node_data['auto_refresh'].value)
-            
-        elif node_type == "TEX_GRADIENT":
-            print ("TEX_GRADIENT")
-            node = node_tree.nodes.new(node_type)
-            node.gradient_type = node_data['gradient'].value
-        
-        elif node_type == "TEX_IMAGE":
-            print ("TEX_IMAGE")
-            node = node_tree.nodes.new(node_type)
-            node.color_space = node_data['color_space'].value
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63 and "projection" in node_data:
-                node.projection = node_data['projection'].value
-            if 'image' in node_data:
-                if "file://" in node_data['image'].value:
-                    image_filepath = node_data['image'].value[7:]
-                    image_name = node_data['image'].value.split(os.sep)[-1]
-                    image_datablock = bpy.data.images.new(name=image_name, width=4, height=4)
-                    image_datablock.source = node_data['source'].value
-                    image_datablock.filepath = image_filepath
-                    node.image = image_datablock
-                    if node_data['source'].value == 'MOVIE' or node_data['source'].value == 'SEQUENCE':
-                        node.image_user.frame_duration = int(node_data['frame_duration'].value)
-                        node.image_user.frame_start = int(node_data['frame_start'].value)
-                        node.image_user.frame_offset = int(node_data['frame_offset'].value)
-                        node.image_user.use_cyclic = boolean(node_data['cyclic'].value)
-                        node.image_user.use_auto_refresh = boolean(node_data['auto_refresh'].value)
-                elif "http://" in node_data['image'].value and bpy.context.scene.mat_lib_images_only_trusted == False:
-                    ext = "." + node_data['image'].value.split(".")[-1]
-                    image_name = node_data['image'].value.split("/")[-1][:-4]
-                    image_host = node_data['image'].value[7:].split("/")[0]
-                    image_location = node_data['image'].value[(7 + len(image_host)):]
-                    
-                    if ext.lower() != ".jpg" and ext.lower() != ".png":
-                        node_message = ['ERROR', "The image file referenced by this image texture node is not .jpg or .png; not downloading."]
-                        return
-                    
-                    connection = http.client.HTTPConnection(image_host)
-                    connection.request("GET", image_location)
-                    response = connection.getresponse().read()
-                    #Save image texture
-                    image_filepath = os.path.join(mat_lib_folder, "my-materials", image_name + ext)
-                    image_file = open(image_filepath, mode="w+b")
-                    image_file.write(response)
-                    image_file.close()
-                    image_datablock = bpy.data.images.new(name=(image_name + ext), width=4, height=4)
-                    image_datablock.source = node_data['source'].value
-                    image_datablock.filepath = image_filepath
-                    node.image = image_datablock
-                    if node_data['source'].value == 'MOVIE' or node_data['source'].value == 'SEQUENCE':
-                        node.image_user.frame_duration = int(node_data['frame_duration'].value)
-                        node.image_user.frame_start = int(node_data['frame_start'].value)
-                        node.image_user.frame_offset = int(node_data['frame_offset'].value)
-                        node.image_user.use_cyclic = boolean(node_data['cyclic'].value)
-                        node.image_user.use_auto_refresh = boolean(node_data['auto_refresh'].value)
-                else:
-                    ext = "." + node_data['image'].value.split(".")[-1]
-                    image_name = node_data['image'].value[:-4]
-                    
-                    if ext.lower() != ".jpg" and ext.lower() != ".png":
-                        node_message = ['ERROR', "The image file referenced by this image texture node is not .jpg or .png; not downloading."]
-                        return
-                        
-                    if library == "composite" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)):
-                        image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                    elif library != "bundled" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)):
-                        image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                    elif library == "bundled" and os.path.exists(os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)):
-                        image_filepath = os.path.join(mat_lib_folder, "bundled", "cycles", "textures", image_name + ext)
-                    elif working_mode == "online":
-                        connection = http.client.HTTPConnection(mat_lib_host)
-                        connection.request("GET", mat_lib_location + "cycles/textures/" + image_name + ext)
-                        response = connection.getresponse().read()
-                        
-                        #Cache image texture
-                        if library == "composite":
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "textures", image_name + ext)
-                            image_file = open(image_filepath, mode="w+b")
-                            image_file.write(response)
-                            image_file.close()
-                        else:
-                            image_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "textures", image_name + ext)
-                            image_file = open(image_filepath, mode="w+b")
-                            image_file.write(response)
-                            image_file.close()
-                    else:
-                        node_message = ['ERROR', "The image texture, \"%s\", is not cached; cannot download in offline mode." % (image_name + ext)]
-                        image_filepath = ""
-                    if image_filepath != "":
-                        image_datablock = bpy.data.images.new(name=(image_name + ext), width=4, height=4)
-                        image_datablock.source = node_data['source'].value
-                        image_datablock.filepath = image_filepath
-                        node.image = image_datablock
-                        if node_data['source'].value == 'MOVIE' or node_data['source'].value == 'SEQUENCE':
-                            node.image_user.frame_duration = int(node_data['frame_duration'].value)
-                            node.image_user.frame_start = int(node_data['frame_start'].value)
-                            node.image_user.frame_offset = int(node_data['frame_offset'].value)
-                            node.image_user.use_cyclic = boolean(node_data['cyclic'].value)
-                            node.image_user.use_auto_refresh = boolean(node_data['auto_refresh'].value)
-                
-        elif node_type == "TEX_MAGIC":
-            print ("TEX_MAGIC")
-            node = node_tree.nodes.new(node_type)
-            node.turbulence_depth = int(node_data['depth'].value)
-            node.inputs['Scale'].default_value = float(node_data['scale'].value)
-            node.inputs['Distortion'].default_value = float(node_data['distortion'].value)
-        
-        elif node_type == "TEX_MUSGRAVE":
-            print ("TEX_MUSGRAVE")
-            node = node_tree.nodes.new(node_type)
-            node.musgrave_type = node_data['musgrave'].value
-            node.inputs['Scale'].default_value = float(node_data['scale'].value)
-            node.inputs['Detail'].default_value = float(node_data['detail'].value)
-            node.inputs['Dimension'].default_value = float(node_data['dimension'].value)
-            node.inputs['Lacunarity'].default_value = float(node_data['lacunarity'].value)
-            node.inputs['Offset'].default_value = float(node_data['offset'].value)
-            node.inputs['Gain'].default_value = float(node_data['gain'].value)
-        
-        elif node_type == "TEX_NOISE":
-            print ("TEX_NOISE")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Scale'].default_value = float(node_data['scale'].value)
-            node.inputs['Detail'].default_value = float(node_data['detail'].value)
-            node.inputs['Distortion'].default_value = float(node_data['distortion'].value)
-                        
-        elif node_type == "TEX_SKY":
-            print ("TEX_SKY")
-            node = node_tree.nodes.new(node_type)
-            node.sun_direction = vector(node_data['sun_direction'].value)
-            node.turbidity = float(node_data['turbidity'].value)
-        
-        elif node_type == "TEX_VORONOI":
-            print ("TEX_VORONOI")
-            node = node_tree.nodes.new(node_type)
-            node.coloring = node_data['coloring'].value
-            node.inputs['Scale'].default_value = float(node_data['scale'].value)
-        
-        elif node_type == "TEX_WAVE":
-            print ("TEX_WAVE")
-            node = node_tree.nodes.new(node_type)
-            node.wave_type = node_data['wave'].value
-            node.inputs['Scale'].default_value = float(node_data['scale'].value)
-            node.inputs['Distortion'].default_value = float(node_data['distortion'].value)
-            node.inputs['Detail'].default_value = float(node_data['detail'].value)
-            node.inputs['Detail Scale'].default_value = float(node_data['detail_scale'].value)
-        
-            #COLOR TYPES
-        elif node_type == "BRIGHTCONTRAST":
-            print ("BRIGHTCONTRAST")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Bright'].default_value = float(node_data['bright'].value)
-            node.inputs['Contrast'].default_value = float(node_data['contrast'].value)
-        
-        elif node_type == "GAMMA":
-            print ("GAMMA")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            node.inputs['Gamma'].default_value = float(node_data['gamma'].value)
-        
-        elif node_type == "HUE_SAT":
-            print ("HUE_SAT")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Hue'].default_value = float(node_data['hue'].value)
-            node.inputs['Saturation'].default_value = float(node_data['saturation'].value)
-            node.inputs['Value'].default_value = float(node_data['value'].value)
-            node.inputs['Fac'].default_value = float(node_data['fac'].value)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            
-        elif node_type == "INVERT":
-            print ("INVERT")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Fac'].default_value = float(node_data['fac'].value)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-        
-        elif node_type == "LIGHT_FALLOFF":
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.64:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            print ("LIGHT_FALLOFF")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Strength'].default_value = float(node_data['strength'].value)
-            node.inputs['Smooth'].default_value = float(node_data['smooth'].value)
-        
-        elif node_type == "MIX_RGB":
-            print ("MIX_RGB")
-            node = node_tree.nodes.new(node_type)
-            node.blend_type = node_data['blend_type'].value
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63 and "clamp" in node_data:
-                node.use_clamp = boolean(node_data['clamp'].value)
-            node.inputs['Fac'].default_value = float(node_data['fac'].value)
-            node.inputs['Color1'].default_value = color(node_data['color1'].value)
-            node.inputs['Color2'].default_value = color(node_data['color2'].value)
-        
-            #VECTOR TYPES
-        elif node_type == "BUMP":
-            print ("BUMP")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.65:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.inputs["Strength"].default_value = float(node_data['strength'].value)
-            
-        elif node_type == "MAPPING":
-            print ("MAPPING")
-            node = node_tree.nodes.new(node_type)
-            node.translation = vector(node_data['translation'].value)
-            node.rotation = vector(node_data['rotation'].value)
-            node.scale = vector(node_data['scale'].value)
-            if boolean(node_data['use_min'].value):
-                node.use_min = True
-                node.min = vector(node_data['min'].value)
-            if boolean(node_data['use_max'].value):
-                node.use_max = True
-                node.max = vector(node_data['max'].value)
-            node.inputs['Vector'].default_value = vector(node_data['vector'].value)
-        
-        elif node_type == "NORMAL":
-            print ("NORMAL")
-            node = node_tree.nodes.new(node_type)
-            node.outputs['Normal'].default_value = vector(node_data['vector_output'].value)
-            node.inputs['Normal'].default_value = vector(node_data['vector_input'].value)
-            
-        elif node_type == "NORMAL_MAP":
-            print ("NORMAL_MAP")
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.65:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            node = node_tree.nodes.new(node_type)
-            node.space = node_data['space'].value
-            node.uv_map = node_data['uv_map'].value
-            node.inputs["Strength"].default_value = float(node_data['strength'].value)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-            
-            #CONVERTOR TYPES
-        elif node_type == "COMBRGB":
-            print ("COMBRGB")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['R'].default_value = float(node_data['red'].value)
-            node.inputs['G'].default_value = float(node_data['green'].value)
-            node.inputs['B'].default_value = float(node_data['blue'].value)
-        
-        elif node_type == "MATH":
-            print ("MATH")
-            node = node_tree.nodes.new(node_type)
-            node.operation = node_data['operation'].value
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63 and "clamp" in node_data:
-                node.use_clamp = boolean(node_data['clamp'].value)
-            node.inputs[0].default_value = float(node_data['value1'].value)
-            node.inputs[1].default_value = float(node_data['value2'].value)
-        
-        elif node_type == "RGBTOBW":
-            print ("RGBTOBW")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Color'].default_value = color(node_data['color'].value)
-        
-        elif node_type == "SEPRGB":
-            print ("SEPRGB")
-            node = node_tree.nodes.new(node_type)
-            node.inputs['Image'].default_value = color(node_data['image'].value)
-        
-        elif node_type == "VALTORGB":
-            print ("VALTORGB")
-            node = node_tree.nodes.new(node_type)
-            node.color_ramp.interpolation = node_data['interpolation'].value
-            node.inputs['Fac'].default_value = float(node_data['fac'].value)
-            
-            #Delete the first stop which comes with the ramp by default
-            node.color_ramp.elements.remove(node.color_ramp.elements[0])
-            
-            # The first stop will be "stop1", so set i to 1
-            i = 1
-            while i <= int(node_data['stops'].value):
-                #Each color stop element is formatted like this:
-                #            stop1="0.35|rgba(1, 0.5, 0.8, 0.5)"
-                #The "|" separates the stop's position and color.
-                element_data = node_data[("stop" + str(i))].value.split('|')
-                if i == 1:
-                    element = node.color_ramp.elements[0]
-                    element.position = float(element_data[0])
-                else:
-                    element = node.color_ramp.elements.new(float(element_data[0]))
-                element.color = color(element_data[1])
-                i = i + 1
-            
-        elif node_type == "VECT_MATH":
-            print ("VECT_MATH")
-            node = node_tree.nodes.new(node_type)
-            node.operation = node_data['operation'].value
-            node.inputs[0].default_value = vector(node_data['vector1'].value)
-            node.inputs[1].default_value = vector(node_data['vector2'].value)
-            
-            #MISCELLANEOUS NODE TYPES
-        elif node_type == "FRAME":
-            #Don't attempt to add frame nodes in builds previous
-            #to rev51926, as Blender's nodes.new() operator was
-            #unable to add FRAME nodes. Was fixed with rev51926.
-            if int(bpy.app.build_revision.decode()) > 51925:
-                print("FRAME")
-                node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "REROUTE":
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.64:
-                node_message = ['ERROR', """The material file contains the node \"%s\".
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly.""" % node_type]
-                return
-            print ("REROUTE")
-            node = node_tree.nodes.new(node_type)
-        
-        elif node_type == "SCRIPT":
-            if bpy.app.version[0] + (bpy.app.version[1] / 100.0) < 2.65:
-                node_message = ['ERROR', """The material file contains an OSL script node.
-This node is not available in the Blender version you are currently using.
-You may need a newer version of Blender for this material to work properly."""]
-                return
-            print ("SCRIPT")
-            node = node_tree.nodes.new(node_type)
-            node.mode = node_data['mode'].value
-            if node_data['mode'].value == 'EXTERNAL':
-                if 'script' in node_data:
-                    if "file://" in node_data['script'].value:
-                        node.filepath = node_data['script'].value[7:]
-                    elif "http://" in node_data['script'].value and bpy.context.scene.mat_lib_osl_only_trusted == False:
-                        ext = "." + node_data['script'].value.split(".")[-1]
-                        script_name = node_data['script'].value.split("/")[-1][:-4]
-                        osl_host = node_data['script'].value[7:].split("/")[0]
-                        script_location = node_data['script'].value[(7 + len(osl_host)):]
-                        
-                        if ext.lower() != ".osl" and ext.lower() != ".oso":
-                            node_message = ['ERROR', "The OSL script file referenced by this script node is not .osl or .oso; not downloading."]
-                            return
-                        
-                        connection = http.client.HTTPConnection(osl_host)
-                        connection.request("GET", script_location + script_name + ext)
-                        response = connection.getresponse().read()
-                        #Save OSL script
-                        osl_filepath = os.path.join(mat_lib_folder, "my-materials", script_name + ext)
-                        osl_file = open(osl_filepath, mode="w+b")
-                        osl_file.write(response)
-                        osl_file.close()
-                        node.filepath = osl_filepath
-                        
-                    else:
-                        ext = "." + node_data['script'].value.split(".")[-1]
-                        script_name = node_data['script'].value[:-4]
-                        
-                        if ext.lower() != ".osl" and ext.lower() != ".oso":
-                            node_message = ['ERROR', "The OSL script file referenced by this script node is not .osl or .oso; not downloading."]
-                            return
-                        
-                        if library == "composite" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)):
-                            osl_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)
-                        elif library != "bundled" and os.path.exists(os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)):
-                            osl_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)
-                        elif library == "bundled" and os.path.exists(os.path.join(mat_lib_folder, "bundled", "cycles", "scripts", script_name + ext)):
-                            osl_filepath = os.path.join(mat_lib_folder, "bundled", "cycles", "scripts", script_name + ext)
-                        elif working_mode == "online":
-                            connection = http.client.HTTPConnection(mat_lib_host)
-                            connection.request("GET", mat_lib_location + "cycles/scripts/" + script_name + ext)
-                            response = connection.getresponse().read()
-                            
-                            #Cache OSL script
-                            if library == "composite":
-                                osl_filepath = os.path.join(mat_lib_folder, mat_lib_host, "cycles", "scripts", script_name + ext)
-                                osl_file = open(osl_filepath, mode="w+b")
-                                osl_file.write(response)
-                                osl_file.close()
-                            else:
-                                osl_filepath = os.path.join(mat_lib_folder, mat_lib_host, library, "cycles", "scripts", script_name + ext)
-                                osl_file = open(osl_filepath, mode="w+b")
-                                osl_file.write(response)
-                                osl_file.close()
-                        else:
-                            node_message = ['ERROR', "The OSL script, \"%s\", is not cached; cannot download in offline mode." % (script_name + ext)]
-                            osl_filepath = ""
-                        node.filepath = osl_filepath
-            else:
-                if 'script' in node_data:
-                    node.script = osl_scripts[int(node_data['script'].value)]
-            if node.inputs:
-                for input in node.inputs:
-                    if input.name.lower() in node_data:
-                        if input.type == 'RGBA':
-                            input.default_value = color(node_data[input.name.lower()].value)
-                        elif input.type == 'VECTOR':
-                            input.default_value = vector(node_data[input.name.lower()].value)
-                        elif input.type == 'VALUE':
-                            input.default_value = float(node_data[input.name.lower()].value)
-                        elif input.type == 'INT':
-                            input.default_value = int(node_data[input.name.lower()].value)
-                        elif input.type == 'BOOL':
-                            input.default_value = boolean(node_data[input.name.lower()].value)
-                        else:
-                            input.default_value = str(node_data[input.name.lower()].value)
-                    else:
-                        node_message = ['WARNING', "There was no value specified for input \"%s\", leaving at default." % input.name]
-                
-        else:
-            node_message = ['ERROR', """The material file contains the node name \"%s\", which is not known.
-The material file may contain an error, or you may need to check for updates to this add-on.""" % node_type]
-            return
-        node.location = node_location
-        
-        #Give the node a custom label
-        if 'label' in node_data:
-            node.label = node_data['label'].value
-        
-        #Give the node a custom color
-        if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63:
-            if 'custom_color' in node_data:
-                node.use_custom_color = True
-                node.color = color(node_data['custom_color'].value)
-        
-        #Collapse node if needed
-        if 'hide' in node_data:
-            node.hide = boolean(node_data['hide'].value)
-
-def boolean(string):
-    if string == "True":
-        boolean = True
-    elif string == "False":
-        boolean = False
-    elif string == "true":
-        boolean = True
-    elif string == "false":
-        boolean = False
-    else:
-        print('Error converting string to a boolean')
-        return
-    return boolean
-
-def color(string):
-    if "rgba" in string:
-        colors = string[5:-1].replace(" ", "").split(",")
-        r = float(colors[0])
-        g = float(colors[1])
-        b = float(colors[2])
-        a = float(colors[3])
-        color = [r,g,b,a]
-    elif "rgb" in string:
-        colors = string[4:-1].replace(" ", "").split(",")
-        r = float(colors[0])
-        g = float(colors[1])
-        b = float(colors[2])
-        color = [r,g,b]
-    else:
-        print('Error converting string to a color')
-        return
-    return color
-
-def vector(string):
-    import mathutils
-    if "Vector" in string:
-        vectors = string[7:-1].replace(" ", "").split(",")
-        x = float(vectors[0])
-        y = float(vectors[1])
-        z = float(vectors[2])
-        vector = mathutils.Vector((x, y, z))
-    else:
-        print('Error converting string to a vector')
-        return
-    return vector
-
-class MaterialConvert(bpy.types.Operator):
-    '''Convert material(s) to the .bcm format'''
-    bl_idname = "material.libraryconvert"
-    bl_label = "Convert Cycles Material to .bcm"
-    save_location = bpy.props.StringProperty()
-    all_materials = bpy.props.BoolProperty()
-
-    def execute(self, context):
-        global material_file_contents
-        global script_stack
-        
-        if self.all_materials:
-            #For all_materials, access the materials with an index
-            mat = 0
-            loop_length = len(bpy.data.materials)
-        else:
-            if not context.active_object:
-                if not context.active_object.get("active_material"):
-                    self.save_location = ""
-                    self.all_materials = False
-                    self.report({'ERROR'}, "No material selected!")
-                    return {'CANCELLED'}
-                self.save_location = ""
-                self.all_materials = False
-                self.report({'ERROR'}, "No object selected!")
-                return {'CANCELLED'}
-            #For single materials, access the materials with a name
-            mat = context.active_object.active_material.name
-            loop_length = 1
-        
-        if self.save_location is "":
-            if context.scene.mat_lib_bcm_write is not "":
-                txt = context.scene.mat_lib_bcm_write
-            else:
-                txt = "bcm_file"
-            
-            if txt not in bpy.data.texts:
-                bpy.data.texts.new(txt)
-        
-        j = 0
-        while j < loop_length:
-            if self.save_location is not "":
-                if self.all_materials:
-                    filename = bpy.data.materials[mat].name.replace("(", "")
-                else:
-                    filename = mat.replace("(", "")
-                filename = filename.replace(")", "")
-                filename = filename.replace("!", "")
-                filename = filename.replace("@", "")
-                filename = filename.replace("#", "")
-                filename = filename.replace("$", "")
-                filename = filename.replace("%", "")
-                filename = filename.replace("&", "")
-                filename = filename.replace("*", "")
-                filename = filename.replace("/", "")
-                filename = filename.replace("|", "")
-                filename = filename.replace("\\", "")
-                filename = filename.replace("'", "")
-                filename = filename.replace("\"", "")
-                filename = filename.replace("?", "")
-                filename = filename.replace(";", "")
-                filename = filename.replace(":", "")
-                filename = filename.replace("[", "")
-                filename = filename.replace("]", "")
-                filename = filename.replace("{", "")
-                filename = filename.replace("}", "")
-                filename = filename.replace("`", "")
-                filename = filename.replace("~", "")
-                filename = filename.replace("+", "")
-                filename = filename.replace("=", "")
-                filename = filename.replace(".", "")
-                filename = filename.replace(",", "")
-                filename = filename.replace("<", "")
-                filename = filename.replace(">", "")
-                filename = filename.replace(" ", "_")
-                filename = filename.replace("-", "_")
-                filename = filename.lower()
-        
-            material_file_contents = ""
-            write('<?xml version="1.0" encoding="UTF-8"?>')
-            
-            red = smallFloat(bpy.data.materials[mat].diffuse_color.r)
-            green = smallFloat(bpy.data.materials[mat].diffuse_color.g)
-            blue = smallFloat(bpy.data.materials[mat].diffuse_color.b)
-            write("\n<material view_color=\"%s\"" % ("rgb(" + red + ", " + green + ", " + blue + ")"))
-            
-            write(" sample_lamp=\"" + str(bpy.data.materials[mat].cycles.sample_as_light) + "\">")
-            write("\n\t<nodes>")
-            
-            group_warning = False
-            frame_warning = False
-            for node in bpy.data.materials[mat].node_tree.nodes:
-                if "NodeGroup" in str(node.items):
-                    node_type = "GROUP"
-                    group_warning = True
-                    
-                elif node.type == 'FRAME' and int(bpy.app.build_revision.decode()) < 51926:
-                    #Don't attempt to write frame nodes in builds previous
-                    #to rev51926, as Blender's nodes.new() operator was
-                    #unable to add FRAME nodes. Was fixed with rev51926.
-                    frame_warning = True
-                    print("Skipping frame node; this Blender version will not support adding it back."\
-                        "\nFrame nodes are not supported on builds prior to rev51926.")
-                else:
-                    node_type = node.type
-                    #Write node opening bracket
-                    write("\n\t\t<node ")
-                    
-                    #Write node type
-                    write("type=\"%s\"" % node_type)
-                
-                    #Write node custom color
-                    if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63:
-                        if node.use_custom_color:
-                            r = smallFloat(node.color.r)
-                            g = smallFloat(node.color.g)
-                            b = smallFloat(node.color.b)
-                            write(" custom_color=\"%s\"" % ("rgb(" + r + ", " + g + ", " + b + ")"))
-                    
-                    #Write node label
-                    if node.label:
-                        write(" label=\"%s\"" % node.label)
-                    
-                    #Write node hidden-ness
-                    if node.hide:
-                        write(" hide=\"True\"")
-                        
-                    #Write node data
-                    writeNodeData(node)
-                    
-                    #Write node closing bracket
-                    write(" />")
-            
-            write("\n\t</nodes>")
-            
-            write("\n\t<links>")
-            writeNodeLinks(bpy.data.materials[mat].node_tree)
-            write("\n\t</links>")
-            if script_stack:
-                write("\n\t<scripts>")
-                i = 0
-                while i < len(script_stack):
-                    write("\n\t\t<script name=\"%s\" id=\"%s\">\n" % (script_stack[i], str(i)))
-                    first_line = True
-                    for l in bpy.data.texts[script_stack[i]].lines:
-                        if first_line == True:
-                            write(l.body.replace("<", "lt;").replace(">", "gt;"))
-                            first_line = False
-                        else:
-                            write("<br />" + l.body.replace("&", "&").replace("<", "<").replace(">", ">").replace("\"", """))
-                    write("\n\t\t</script>")
-                    i += 1
-                write("\n\t</scripts>")
-                script_stack = []
-            write("\n</material>")
-            
-            if self.save_location == "":
-                if group_warning:
-                    self.report({'ERROR'}, "Material \"" + mat + "\" contains a group node (not supported). Please un-group the nodes and try again.")
-                else:
-                    bpy.data.texts[txt].clear()
-                    bpy.data.texts[txt].write(material_file_contents)
-                    if not self.all_materials:
-                        if frame_warning:
-                            self.report({'WARNING'}, "Material \"" + mat + "\" contains a frame node, which was skipped; see console for details.")
-                        else:
-                            self.report({'INFO'}, "Material \"" + mat + "\" written to Text \"" + txt + "\" as .bcm")
-            else:
-                if group_warning:
-                    self.report({'ERROR'}, "Material \"" + mat + "\" contains a group node (not supported). Please un-group the nodes and try again.")
-                else:
-                    print(context.scene.mat_lib_bcm_save_location + filename + ".bcm")
-                    bcm_file = open(context.scene.mat_lib_bcm_save_location + filename + ".bcm", mode="w", encoding="UTF-8")
-                    bcm_file.write(material_file_contents)
-                    bcm_file.close()
-                    if not self.all_materials:
-                        if frame_warning:
-                            self.report({'WARNING'}, "Material \"" + mat + "\" contains a frame node which was skipped; see console for details.")
-                            self.report({'WARNING'}, "Material \"" + mat + "\" contains a frame node which was skipped; see console for details.")
-                        else:
-                            self.report({'INFO'}, "Material \"" + mat + "\" saved to \"" + filename + ".bcm\"")
-            j += 1
-            if self.all_materials:
-                mat += 1
-        if self.all_materials and not group_warning and not frame_warning:
-            self.report({'INFO'}, "All materials successfully saved!")
-        
-        self.save_location = ""
-        self.all_materials = False
-        return {'FINISHED'}
-
-def writeNodeData(node):
-    global material_file_contents
-    global script_stack
-    
-    I = node.inputs
-    O = node.outputs
-    
-    if "NodeGroup" in str(node.items):
-        node_type = "GROUP"
-    else:
-        node_type = node.type
-        
-    if node_type == "GROUP":
-        print("GROUP NODE!")
-        write("ERROR: GROUP NODES NOT YET SUPPORTED.")
-        
-        #INPUT TYPES
-    elif node_type == "ATTRIBUTE":
-        print("ATTRIBUTE")
-        write(" attribute=\"%s\"" % node.attribute_name)
-    
-    elif node_type == "CAMERA":
-        print("CAMERA")
-        
-    elif node_type == "FRESNEL":
-        print("FRESNEL")
-        write(" ior=\"%s\"" % smallFloat(I['IOR'].default_value))
-    
-    elif node_type == "LAYER_WEIGHT":
-        print("LAYER_WEIGHT")
-        write(" blend=\"%s\"" % smallFloat(I['Blend'].default_value))
-    
-    elif node_type == "LIGHT_PATH":
-        print("LIGHT_PATH")
-    
-    elif node_type == "NEW_GEOMETRY":
-        print("NEW_GEOMETRY")
-    
-    elif node_type == "OBJECT_INFO":
-        print("OBJECT_INFO")
-    
-    elif node_type == "PARTICLE_INFO":
-        print("PARTICLE_INFO")
-    
-    elif node_type == "RGB":
-        print("RGB")
-        write(" color=\"%s\"" % rgba(O['Color'].default_value))
-    
-    elif node_type == "TANGENT":
-        print("TANGENT")
-        write(" direction=\"%s\"" % node.direction_type)
-        write(" axis=\"%s\"" % node.axis)
-    
-    elif node_type == "TEX_COORD":
-        print("TEX_COORD")
-        if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.64:
-            write(" dupli=\"%s\"" % node.from_dupli)
-        else:
-            write(" dupli=\"False\"")
-    
-    elif node_type == "VALUE":
-        print("VALUE")
-        write(" value=\"%s\"" % smallFloat(O['Value'].default_value))
-        
-        #OUTPUT TYPES
-    elif node_type == "OUTPUT_LAMP":
-        print("OUTPUT_LAMP")
-    
-    elif node_type == "OUTPUT_MATERIAL":
-        print("OUTPUT_MATERIAL")
-    
-    elif node_type == "OUTPUT_WORLD":
-        print("OUTPUT_WORLD")
-    
-        #SHADER TYPES
-    elif node_type == "ADD_SHADER":
-        print("ADD_SHADER")
-    
-    elif node_type == "AMBIENT_OCCLUSION":
-        print("AMBIENT_OCCLUSION")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-    
-    elif node_type == "BACKGROUND":
-        print("BACKGROUND")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" strength=\"%s\"" % smallFloat(I['Strength'].default_value))
-    
-    elif node_type == "BSDF_ANISOTROPIC":
-        print("BSDF_ANISOTROPIC")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" roughness=\"%s\"" % smallFloat(I['Roughness'].default_value))
-        write(" anisotropy=\"%s\"" % smallFloat(I['Anisotropy'].default_value))
-        write(" rotation=\"%s\"" % smallFloat(I['Rotation'].default_value))
-    
-    elif node_type == "BSDF_DIFFUSE":
-        print("BSDF_DIFFUSE")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" roughness=\"%s\"" % smallFloat(I['Roughness'].default_value))
-    
-    elif node_type == "BSDF_GLASS":
-        print("BSDF_GLASS")
-        write(" distribution=\"%s\"" % node.distribution)
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" roughness=\"%s\"" % smallFloat(I['Roughness'].default_value))
-        write(" ior=\"%s\"" % smallFloat(I['IOR'].default_value))
-    
-    elif node_type == "BSDF_GLOSSY":
-        print("BSDF_GLOSSY")
-        write(" distribution=\"%s\"" % node.distribution)
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" roughness=\"%s\"" % smallFloat(I['Roughness'].default_value))
-    
-    elif node_type == "BSDF_REFRACTION":
-        print("BSDF_REFRACTION")
-        write(" distribution=\"%s\"" % node.distribution)
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" roughness=\"%s\"" % smallFloat(I['Roughness'].default_value))
-        write(" ior=\"%s\"" % smallFloat(I['IOR'].default_value))
-    
-    elif node_type == "BSDF_TRANSLUCENT":
-        print("BSDF_TRANSLUCENT")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-    
-    elif node_type == "BSDF_TRANSPARENT":
-        print("BSDF_TRANSPARENT")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-    
-    elif node_type == "BSDF_VELVET":
-        print("BSDF_VELVET")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" sigma=\"%s\"" % smallFloat(I['Sigma'].default_value))
-    
-    elif node_type == "EMISSION":
-        print("EMISSION")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" strength=\"%s\"" % smallFloat(I['Strength'].default_value))
-    
-    elif node_type == "HOLDOUT":
-        print("HOLDOUT")
-    
-    elif node_type == "MIX_SHADER":
-        print("MIX_SHADER")
-        write(" fac=\"%s\"" % smallFloat(I['Fac'].default_value))
-        
-        #TEXTURE TYPES
-    elif node_type == "TEX_BRICK":
-        print ("TEX_BRICK")
-        write(" offset=\"%s\"" % smallFloat(node.offset))
-        write(" offset_freq=\"%s\"" % str(node.offset_frequency))
-        write(" squash=\"%s\"" % smallFloat(node.squash))
-        write(" squash_freq=\"%s\"" % str(node.squash_frequency))
-        write(" color1=\"%s\"" % rgba(I['Color1'].default_value))
-        write(" color2=\"%s\"" % rgba(I['Color2'].default_value))
-        write(" mortar=\"%s\"" % rgba(I['Mortar'].default_value))
-        write(" scale=\"%s\"" % smallFloat(I['Scale'].default_value))
-        write(" mortar_size=\"%s\"" % smallFloat(I['Mortar Size'].default_value))
-        write(" bias=\"%s\"" % smallFloat(I['Bias'].default_value))
-        write(" width=\"%s\"" % smallFloat(I['Brick Width'].default_value))
-        write(" height=\"%s\"" % smallFloat(I['Row Height'].default_value))
-            
-    elif node_type == "TEX_CHECKER":
-        print("TEX_CHECKER")
-        write(" color1=\"%s\"" % rgba(I['Color1'].default_value))
-        write(" color2=\"%s\"" % rgba(I['Color2'].default_value))
-        write(" scale=\"%s\"" % smallFloat(I['Scale'].default_value))
-    
-    elif node_type == "TEX_ENVIRONMENT":
-        print("TEX_ENVIRONMENT")
-        if node.image:
-            write(" image=\"file://%s\"" % os.path.realpath(bpy.path.abspath(node.image.filepath)))
-            write(" source=\"%s\"" % node.image.source)
-            if node.image.source == "SEQUENCE" or node.image.source == "MOVIE":
-                write(" frame_duration=\"%s\"" % str(node.image_user.frame_duration))
-                write(" frame_start=\"%s\"" % str(node.image_user.frame_start))
-                write(" frame_offset=\"%s\"" % str(node.image_user.frame_offset))
-                write(" cyclic=\"%s\"" % str(node.image_user.use_cyclic))
-                write(" auto_refresh=\"%s\"" % str(node.image_user.use_auto_refresh))
-        else:
-            write(" image=\"\"")
-        write(" color_space=\"%s\"" % node.color_space)
-        write(" projection=\"%s\"" % node.projection)
-    
-    elif node_type == "TEX_GRADIENT":
-        print("TEX_GRADIENT")
-        write(" gradient=\"%s\"" % node.gradient_type)
-    
-    elif node_type == "TEX_IMAGE":
-        print("TEX_IMAGE")
-        if node.image:
-            write(" image=\"file://%s\"" % os.path.realpath(bpy.path.abspath(node.image.filepath)))
-            write(" source=\"%s\"" % node.image.source)
-            if node.image.source == "SEQUENCE" or node.image.source == "MOVIE":
-                write(" frame_duration=\"%s\"" % str(node.image_user.frame_duration))
-                write(" frame_start=\"%s\"" % str(node.image_user.frame_start))
-                write(" frame_offset=\"%s\"" % str(node.image_user.frame_offset))
-                write(" cyclic=\"%s\"" % str(node.image_user.use_cyclic))
-                write(" auto_refresh=\"%s\"" % str(node.image_user.use_auto_refresh))
-        else:
-            write(" image=\"\"")
-        write(" color_space=\"%s\"" % node.color_space)
-        if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63:
-            write(" projection=\"%s\"" % node.projection)
-            if node.projection == "BOX":
-                write(" blend=\"%s\"" % smallFloat(node.projection_blend))
-        else:
-            write(" projection=\"FLAT\"")
-    
-    elif node_type == "TEX_MAGIC":
-        print("TEX_MAGIC")
-        write(" depth=\"%s\"" % str(node.turbulence_depth))
-        write(" scale=\"%s\"" % smallFloat(I['Scale'].default_value))
-        write(" distortion=\"%s\"" % smallFloat(I['Distortion'].default_value))
-    
-    elif node_type == "TEX_MUSGRAVE":
-        print("TEX_MUSGRAVE")
-        write(" musgrave=\"%s\"" % node.musgrave_type)
-        write(" scale=\"%s\"" % smallFloat(I['Scale'].default_value))
-        write(" detail=\"%s\"" % smallFloat(I['Detail'].default_value))
-        write(" dimension=\"%s\"" % smallFloat(I['Dimension'].default_value))
-        write(" lacunarity=\"%s\"" % smallFloat(I['Lacunarity'].default_value))
-        write(" offset=\"%s\"" % smallFloat(I['Offset'].default_value))
-        write(" gain=\"%s\"" % smallFloat(I['Gain'].default_value))
-    
-    elif node_type == "TEX_NOISE":
-        print("TEX_NOISE")
-        write(" scale=\"%s\"" % smallFloat(I['Scale'].default_value))
-        write(" detail=\"%s\"" % smallFloat(I['Detail'].default_value))
-        write(" distortion=\"%s\"" % smallFloat(I['Distortion'].default_value))
-    
-    elif node_type == "TEX_SKY":
-        print("TEX_SKY")
-        write(" sun_direction=\"%s\"" % smallVector(node.sun_direction))
-        write(" turbidity=\"%s\"" % smallFloat(node.turbidity))
-    
-    elif node_type == "TEX_VORONOI":
-        print("TEX_VORONOI")
-        write(" coloring=\"%s\"" % node.coloring)
-        write(" scale=\"%s\"" % smallFloat(I['Scale'].default_value))
-    
-    elif node_type == "TEX_WAVE":
-        print("TEX_WAVE")
-        write(" wave=\"%s\"" % node.wave_type)
-        write(" scale=\"%s\"" % smallFloat(I['Scale'].default_value))
-        write(" distortion=\"%s\"" % smallFloat(I['Distortion'].default_value))
-        write(" detail=\"%s\"" % smallFloat(I['Detail'].default_value))
-        write(" detail_scale=\"%s\"" % smallFloat(I['Detail Scale'].default_value))
-    
-        #COLOR TYPES
-    elif node_type == "BRIGHTCONTRAST":
-        print("BRIGHTCONTRAST")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" bright=\"%s\"" % smallFloat(I['Bright'].default_value))
-        write(" contrast=\"%s\"" % smallFloat(I['Contrast'].default_value))
-    
-    elif node_type == "GAMMA":
-        print("GAMMA")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        write(" gamma=\"%s\"" % smallFloat(I['Gamma'].default_value))
-    
-    elif node_type == "HUE_SAT":
-        print("HUE_SAT")
-        write(" hue=\"%s\"" % smallFloat(I['Hue'].default_value))
-        write(" saturation=\"%s\"" % smallFloat(I['Saturation'].default_value))
-        write(" value=\"%s\"" % smallFloat(I['Value'].default_value))
-        write(" fac=\"%s\"" % smallFloat(I['Fac'].default_value))
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-    
-    elif node_type == "LIGHT_FALLOFF":
-        print("LIGHT_FALLOFF")
-        write(" strength=\"%s\"" % smallFloat(I['Strength'].default_value))
-        write(" smooth=\"%s\"" % smallFloat(I['Smooth'].default_value))
-    
-    elif node_type == "MIX_RGB":
-        print("MIX_RGB")
-        write(" blend_type=\"%s\"" % node.blend_type)
-        if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63:
-            write(" use_clamp=\"%s\"" % str(node.use_clamp))
-        write(" fac=\"%s\"" % smallFloat(I['Fac'].default_value))
-        write(" color1=\"%s\"" % rgba(I[1].default_value))
-        write(" color2=\"%s\"" % rgba(I[2].default_value))
-    
-    elif node_type == "INVERT":
-        print("INVERT")
-        write(" fac=\"%s\"" % smallFloat(I['Fac'].default_value))
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        
-        #VECTOR TYPES
-    elif node_type == "BUMP":
-        print("BUMP")
-        write(" strength=\"%s\"" % smallFloat(I['Strength'].default_value))
-        
-    elif node_type == "MAPPING":
-        print("MAPPING")
-        write(" translation=\"%s\"" % smallVector(node.translation))
-        write(" rotation=\"%s\"" % smallVector(node.rotation))
-        write(" scale=\"%s\"" % smallVector(node.scale))
-        
-        write(" use_min=\"%s\"" % str(node.use_min))
-        if node.use_min:
-            write(" min=\"%s\"" % smallVector(node.min))
-        
-        write(" use_max=\"%s\"" % str(node.use_max))
-        if node.use_max:
-            write(" max=\"%s\"" % smallVector(node.max))
-        
-        vec = I[0].default_value
-        write(" vector=\"%s\"" % smallVector(I['Vector'].default_value))
-    
-    elif node_type == "NORMAL":
-        print("NORMAL")
-        write(" vector_output=\"%s\"" % smallVector(O['Normal'].default_value))
-        write(" vector_input=\"%s\"" % smallVector(I['Normal'].default_value))
-        
-    elif node_type == "NORMAL_MAP":
-        print("NORMAL_MAP")
-        write(" space=\"%s\"" % node.space)
-        write(" uv_map=\"%s\"" % node.uv_map)
-        write(" strength=\"%s\"" % smallFloat(I['Strength'].default_value))
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-        
-        #CONVERTER TYPES
-    elif node_type == "COMBRGB":
-        print("COMBRGB")
-        write(" red=\"%s\"" % smallFloat(I['R'].default_value))
-        write(" green=\"%s\"" % smallFloat(I['G'].default_value))
-        write(" blue=\"%s\"" % smallFloat(I['B'].default_value))
-    
-    elif node_type == "MATH":
-        print("MATH")
-        write(" operation=\"%s\"" % node.operation)
-        if bpy.app.version[0] + (bpy.app.version[1] / 100.0) > 2.63:
-            write(" use_clamp=\"%s\"" % str(node.use_clamp))
-        write(" value1=\"%s\"" % smallFloat(I[0].default_value))
-        write(" value2=\"%s\"" % smallFloat(I[1].default_value))
-        
-    elif node_type == "RGBTOBW":
-        print ("RGBTOBW")
-        write(" color=\"%s\"" % rgba(I['Color'].default_value))
-    
-    elif node_type == "SEPRGB":
-        print("SEPRGB")
-        write(" image=\"%s\"" % rgba(I['Image'].default_value))
-    
-    elif node_type == "VALTORGB":
-        print("VALTORGB")
-        write(" interpolation=\"%s\"" % str(node.color_ramp.interpolation))
-        write(" fac=\"%s\"" % smallFloat(I['Fac'].default_value))
-        write(" stops=\"%s\"" % str(len(node.color_ramp.elements)))
-        
-        k = 1
-        while k <= len(node.color_ramp.elements):
-            write(" stop%s=\"%s\"" % 
-            (str(k), 
-             (smallFloat(node.color_ramp.elements[k-1].position) +
-             "|" + 
-             rgba(node.color_ramp.elements[k-1].color))
-            ))
-            k += 1
-    
-    elif node_type == "VECT_MATH":
-        print("VECT_MATH")
-        write(" operation=\"%s\"" % node.operation)
-        write(" vector1=\"%s\"" % smallVector(I[0].default_value))
-        write(" vector2=\"%s\"" % smallVector(I[1].default_value))
-        
-        #MISCELLANEOUS NODE TYPES
-    elif node_type == "FRAME":
-        print("FRAME")
-    
-    elif node_type == "REROUTE":
-        print("REROUTE")
-    
-    elif node_type == "SCRIPT":
-        print("SCRIPT")
-        write(" mode=\"%s\"" % node.mode)
-        if node.mode == 'EXTERNAL':
-            if node.filepath:
-                write(" script=\"file://%s\"" % os.path.realpath(bpy.path.abspath(node.filepath)))
-        else:
-            if node.script:
-                write(" script=\"%s\"" % len(script_stack))
-                script_stack.append(node.script.name)
-        if node.inputs:
-            for input in node.inputs:
-                if input.type == 'RGBA':
-                    input_value = rgba(input.default_value)
-                elif input.type == 'VECTOR':
-                    input_value = smallVector(input.default_value)
-                elif input.type == 'VALUE':
-                    input_value = smallFloat(input.default_value)
-                elif input.type == 'INT':
-                    input_value = str(input.default_value)
-                elif input.type == 'BOOL':
-                    input_value = str(input.default_value)
-                else:
-                    input_value = str(input.default_value)
-                
-                write(" %s=\"%s\"" % (input.name.lower(), input_value))
-    else:
-        write(" ERROR: UNKNOWN NODE TYPE. ")
-        return
-    writeLocation(node)
-    
-def rgba(color):
-    red = smallFloat(color[0])
-    green = smallFloat(color[1])
-    blue = smallFloat(color[2])
-    alpha = smallFloat(color[3])
-    return ("rgba(" + red + ", " + green + ", " + blue + ", " + alpha + ")")
-
-def smallFloat(float):
-    if len(str(float)) < (6 + str(float).index(".")):
-        return str(float)
-    else:
-        return str(float)[:(6 + str(float).index("."))]
-
-def smallVector(vector):
-    return "Vector(" + smallFloat(vector[0]) + ", " + smallFloat(vector[1]) + ", " + smallFloat(vector[2]) + ")"
-
-def write (string):
-    global material_file_contents
-    material_file_contents += string
-
-def writeLocation(node):
-    global material_file_contents
-    #X location
-    x = str(int(node.location.x))
-    #Y location
-    y = str(int(node.location.y))
-    
-    material_file_contents += (" loc=\"" + x + ", " + y + "\"")
-    
-def writeNodeLinks(node_tree):
-    global material_file_contents
-    
-    #Loop through the links
-    i = 0
-    while i < len(node_tree.links):
-        material_file_contents += ("\n\t\t<link ")
-        
-        to_node_name = node_tree.links[i].to_node.name
-        #Loop through nodes to check name
-        e = 0
-        while e < len(node_tree.nodes):
-            #Write the index if name matches
-            if to_node_name == node_tree.nodes[e].name:
-                material_file_contents += "to=\"%d\"" % e
-                #Set input socket's name
-                to_socket = node_tree.links[i].to_socket.path_from_id()
-                material_file_contents += (" input=\"%s\"" % to_socket[(to_socket.index("inputs[") + 7):-1])
-                e = len(node_tree.nodes)
-            e = e + 1
-            
-        
-        from_node_name = node_tree.links[i].from_node.name
-        #Loop through nodes to check name
-        e = 0
-        while e < len(node_tree.nodes):
-            #Write the index if name matches
-            if from_node_name == node_tree.nodes[e].name:
-                material_file_contents += " from=\"%d\"" % e
-                #Set input socket's name
-                from_socket = node_tree.links[i].from_socket.path_from_id()
-                material_file_contents += (" output=\"%s\"" % from_socket[(from_socket.index("outputs[") + 8):-1])
-                e = len(node_tree.nodes)
-            e = e + 1
-        material_file_contents += (" />")
-        i = i + 1
-
-
-def register():
-    bpy.utils.register_class(OnlineMaterialLibraryPanel)
-    bpy.utils.register_class(LibraryConnect)
-    bpy.utils.register_class(LibraryInfo)
-    bpy.utils.register_class(LibrarySettings)
-    bpy.utils.register_class(LibraryTools)
-    bpy.utils.register_class(LibraryHome)
-    bpy.utils.register_class(ViewMaterial)
-    bpy.utils.register_class(MaterialDetailView)
-    bpy.utils.register_class(LibraryClearCache)
-    bpy.utils.register_class(LibraryPreview)
-    bpy.utils.register_class(AddLibraryMaterial)
-    bpy.utils.register_class(ApplyLibraryMaterial)
-    bpy.utils.register_class(CacheLibraryMaterial)
-    bpy.utils.register_class(SaveLibraryMaterial)
-    bpy.utils.register_class(MaterialConvert)
-
-
-def unregister():
-    bpy.utils.unregister_class(OnlineMaterialLibraryPanel)
-    bpy.utils.unregister_class(LibraryConnect)
-    bpy.utils.unregister_class(LibraryInfo)
-    bpy.utils.unregister_class(LibrarySettings)
-    bpy.utils.unregister_class(LibraryTools)
-    bpy.utils.unregister_class(LibraryHome)
-    bpy.utils.unregister_class(ViewMaterial)
-    bpy.utils.unregister_class(MaterialDetailView)
-    bpy.utils.unregister_class(LibraryClearCache)
-    bpy.utils.unregister_class(LibraryPreview)
-    bpy.utils.unregister_class(AddLibraryMaterial)
-    bpy.utils.unregister_class(ApplyLibraryMaterial)
-    bpy.utils.unregister_class(CacheLibraryMaterial)
-    bpy.utils.unregister_class(SaveLibraryMaterial)
-    bpy.utils.unregister_class(MaterialConvert)
-
-if __name__ == "__main__":
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_coral.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_coral.bcm
deleted file mode 100644
index 5c13bd8..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_coral.bcm
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(1.0, 0.37373, 0.16895)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="1000, 250" />
-		<node type="MIX_SHADER" fac="0.05000" loc="750, 300" />
-		<node type="MIX_SHADER" fac="0.5" loc="500, 340" />
-		<node type="MATH" operation="LESS_THAN" use_clamp="False" value1="0.5" value2="0.25" loc="250, 500" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="10000.0" loc="0, 500" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="1.0" loc="250, 350" />
-		<node type="BRIGHTCONTRAST" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" bright="-0.89999" contrast="0.0" loc="-250, 350" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.15000" color1="rgba(0.80000, 0.80000, 0.80000, 1.0)" color2="rgba(0.80000, 0.80000, 0.80000, 1.0)" loc="0, 100" />
-		<node type="RGB" color="rgba(1.0, 0.13917, 0.0, 0.0)" loc="-464, -12" />
-		<node type="RGB" color="rgba(0.95332, 0.38194, 0.17285, 1.0)" loc="-469, 202" />
-		<node type="BSDF_GLOSSY" distribution="SHARP" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="493, 103" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.15000" loc="227, 106" />
-		<node type="BRIGHTCONTRAST" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" bright="-0.89999" contrast="0.0" loc="-220, -50" />
-		<node type="LAYER_WEIGHT" blend="0.89999" loc="-250, 149" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.15000" color1="rgba(0.80000, 0.80000, 0.80000, 1.0)" color2="rgba(0.80000, 0.80000, 0.80000, 1.0)" loc="39, 323" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="1" output="0" />
-		<link to="1" input="1" from="2" output="0" />
-		<link to="2" input="0" from="3" output="0" />
-		<link to="3" input="0" from="4" output="1" />
-		<link to="2" input="1" from="5" output="0" />
-		<link to="5" input="0" from="14" output="0" />
-		<link to="14" input="0" from="13" output="1" />
-		<link to="14" input="1" from="9" output="0" />
-		<link to="14" input="2" from="6" output="0" />
-		<link to="6" input="0" from="9" output="0" />
-		<link to="2" input="2" from="11" output="0" />
-		<link to="11" input="0" from="7" output="0" />
-		<link to="7" input="0" from="13" output="1" />
-		<link to="7" input="1" from="8" output="0" />
-		<link to="7" input="2" from="12" output="0" />
-		<link to="12" input="0" from="8" output="0" />
-		<link to="1" input="2" from="10" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_coral.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_coral.jpg
deleted file mode 100644
index 9f01f19..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_coral.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_olive.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_olive.bcm
deleted file mode 100644
index 8ae311c..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_olive.bcm
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.48630, 0.39677, 0.10075)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="759, 69" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.00999" loc="300, 12" />
-		<node type="MIX_SHADER" fac="0.02500" loc="504, 130" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.09999" loc="95, 13" />
-		<node type="MIX_SHADER" fac="0.05000" loc="300, 131" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.19999" loc="-115, 70" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.39999" loc="-209, -61" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-345, 69" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="0.0" contrast="0.0" loc="-523, -58" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="-0.39999" contrast="0.0" loc="-526, 71" />
-		<node type="FRESNEL" ior="8.0" loc="-884, 228" />
-		<node type="RGB" color="rgba(0.5, 0.15069, 0.0, 1.0)" loc="-785, 95" />
-		<node type="RGB" color="rgba(0.5, 0.43265, 0.09540, 1.0)" loc="-785, -95" />
-		<node type="MIX_SHADER" fac="0.09999" loc="89, 188" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="1.0" value2="0.5" loc="-509, 236" />
-		<node type="LAYER_WEIGHT" blend="0.80000" loc="-704, 229" />
-	</nodes>
-	<links>
-		<link to="7" input="1" from="9" output="0" />
-		<link to="7" input="2" from="8" output="0" />
-		<link to="15" input="0" from="10" output="0" />
-		<link to="7" input="0" from="14" output="0" />
-		<link to="14" input="1" from="15" output="1" />
-		<link to="6" input="0" from="7" output="0" />
-		<link to="0" input="0" from="2" output="0" />
-		<link to="9" input="0" from="11" output="0" />
-		<link to="8" input="0" from="12" output="0" />
-		<link to="2" input="2" from="1" output="0" />
-		<link to="2" input="1" from="4" output="0" />
-		<link to="4" input="2" from="3" output="0" />
-		<link to="4" input="1" from="13" output="0" />
-		<link to="13" input="2" from="5" output="0" />
-		<link to="13" input="1" from="6" output="0" />
-		<link to="5" input="0" from="9" output="0" />
-	</links>
-</material>
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_olive.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_olive.jpg
deleted file mode 100644
index c014eb3..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/dull_olive.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_green.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_green.bcm
deleted file mode 100644
index 985e11e..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_green.bcm
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.04379, 0.60201, 0.04091)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="250, 128" />
-		<node type="LAYER_WEIGHT" blend="0.15000" loc="-248, 328" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.00999" loc="-233, -65" />
-		<node type="MIX_SHADER" fac="0.02999" loc="43, 125" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="5.0" loc="-489, 280" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.39999" loc="-501, 175" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.29999" loc="-503, 40" />
-		<node type="MIX_SHADER" fac="0.5" loc="-314, 177" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="500.0" loc="-673, 291" />
-		<node type="BRIGHTCONTRAST" hide="True" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="-0.20000" contrast="0.0" loc="-668, 35" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Scale" value="500.0" loc="-997, 303" />
-		<node type="RGB" custom_color="rgb(0.89999, 0.89999, 0.89999)" color="rgba(0.10972, 0.5, 0.09735, 1.0)" loc="-1151, 127" />
-		<node type="HUE_SAT" label="Color Repeater" hue="0.5" saturation="1.0" value="1.0" fac="1.0" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" loc="-877, 134" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="3" output="0" />
-		<link to="3" input="2" from="2" output="0" />
-		<link to="3" input="1" from="7" output="0" />
-		<link to="3" input="0" from="1" output="1" />
-		<link to="7" input="1" from="6" output="0" />
-		<link to="6" input="0" from="9" output="0" />
-		<link to="4" input="0" from="8" output="0" />
-		<link to="7" input="0" from="4" output="0" />
-		<link to="7" input="2" from="5" output="0" />
-		<link to="12" input="4" from="11" output="0" />
-		<link to="5" input="0" from="12" output="0" />
-		<link to="9" input="0" from="12" output="0" />
-		<link to="8" input="1" from="10" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_green.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_green.jpg
deleted file mode 100644
index 096753f..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_green.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_purple.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_purple.bcm
deleted file mode 100644
index 9580307..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_purple.bcm
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.57112, 0.02518, 0.37123)" sample_lamp="True">
-	<nodes>
-		<node type="LAYER_WEIGHT" blend="0.32499" loc="170, 224" />
-		<node type="MIX_SHADER" fac="0.5" loc="172, 110" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.29998" loc="-250, -24" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.29998" loc="-248, 118" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="5.0" loc="-199, 237" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="500.0" loc="-380, 289" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="-0.20000" contrast="0.0" loc="-405, 111" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="-0.20000" contrast="0.0" loc="-409, -25" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.20000" loc="-697, -19" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="1.0" value2="0.5" loc="-832, -18" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.07500" loc="-832, 161" />
-		<node type="HOLDOUT" loc="-811, 220" />
-		<node type="FRESNEL" ior="1.95000" loc="-813, 302" />
-		<node type="MIX_SHADER" fac="0.5" loc="-617, 238" />
-		<node type="LAYER_WEIGHT" blend="0.89999" loc="-1001, -43" />
-		<node type="MIX_SHADER" fac="0.5" loc="-13, 76" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.00999" loc="153, -19" />
-		<node type="MIX_SHADER" fac="0.03999" loc="346, 113" />
-		<node type="OUTPUT_MATERIAL" loc="513, 107" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="1.0" value2="-0.19999" loc="-559, -18" />
-		<node type="RGB" color="rgba(0.86887, 0.22238, 0.61303, 1.0)" loc="-777, -164" />
-		<node type="RGB" color="rgba(0.5, 0.13597, 0.45640, 1.0)" loc="-592, -162" />
-	</nodes>
-	<links>
-		<link to="15" input="1" from="3" output="0" />
-		<link to="3" input="0" from="6" output="0" />
-		<link to="4" input="0" from="5" output="0" />
-		<link to="15" input="0" from="4" output="0" />
-		<link to="15" input="2" from="2" output="0" />
-		<link to="17" input="2" from="16" output="0" />
-		<link to="17" input="0" from="0" output="0" />
-		<link to="13" input="1" from="11" output="0" />
-		<link to="13" input="2" from="10" output="0" />
-		<link to="13" input="0" from="12" output="0" />
-		<link to="1" input="1" from="15" output="0" />
-		<link to="1" input="2" from="13" output="0" />
-		<link to="1" input="0" from="4" output="0" />
-		<link to="17" input="1" from="1" output="0" />
-		<link to="2" input="0" from="7" output="0" />
-		<link to="9" input="1" from="14" output="1" />
-		<link to="8" input="0" from="9" output="0" />
-		<link to="19" input="0" from="8" output="0" />
-		<link to="7" input="1" from="19" output="0" />
-		<link to="18" input="0" from="17" output="0" />
-		<link to="7" input="0" from="21" output="0" />
-		<link to="6" input="0" from="20" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_purple.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_purple.jpg
deleted file mode 100644
index 3842f8d..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_purple.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_tangelo.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_tangelo.bcm
deleted file mode 100644
index dd8ac29..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_tangelo.bcm
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(1.0, 0.12743, 0.02028)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.03999" loc="403, 181" />
-		<node type="MIX_SHADER" fac="0.5" loc="235, 205" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.00999" loc="213, 75" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="5.0" loc="13, 318" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.29999" loc="12, 215" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.29999" loc="14, 82" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="500.0" loc="-172, 334" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-114, 177" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="-0.20000" contrast="0.0" loc="-329, 113" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="0.5" contrast="0.0" loc="-329, -14" />
-		<node type="OUTPUT_MATERIAL" loc="573, 175" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-111, 5" />
-		<node type="FRESNEL" ior="2.0" loc="-887, 225" />
-		<node type="RGB" color="rgba(1.0, 0.18256, 0.0, 1.0)" loc="-893, 103" />
-		<node type="RGB" color="rgba(0.5, 0.24046, 0.0, 1.0)" loc="-839, -105" />
-		<node type="RGB" color="rgba(0.75750, 0.50051, 0.0, 1.0)" loc="-655, -201" />
-		<node type="MATH" hide="True" operation="ADD" use_clamp="False" value1="0.10000" value2="0.5" loc="-501, -8" />
-		<node type="MATH" hide="True" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.20000" loc="-633, -7" />
-	</nodes>
-	<links>
-		<link to="1" input="1" from="4" output="0" />
-		<link to="7" input="1" from="8" output="0" />
-		<link to="0" input="1" from="1" output="0" />
-		<link to="3" input="0" from="6" output="0" />
-		<link to="1" input="0" from="3" output="0" />
-		<link to="1" input="2" from="5" output="0" />
-		<link to="10" input="0" from="0" output="0" />
-		<link to="0" input="2" from="2" output="0" />
-		<link to="4" input="0" from="7" output="0" />
-		<link to="5" input="0" from="11" output="0" />
-		<link to="11" input="2" from="9" output="0" />
-		<link to="11" input="1" from="8" output="0" />
-		<link to="16" input="1" from="17" output="0" />
-		<link to="5" input="1" from="16" output="0" />
-		<link to="7" input="0" from="12" output="0" />
-		<link to="11" input="0" from="12" output="0" />
-		<link to="17" input="0" from="12" output="0" />
-		<link to="7" input="2" from="15" output="0" />
-		<link to="9" input="0" from="14" output="0" />
-		<link to="8" input="0" from="13" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_tangelo.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_tangelo.jpg
deleted file mode 100644
index 0e42930..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/flaky_tangelo.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/glossy_yellow.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/glossy_yellow.bcm
deleted file mode 100644
index f62e838..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/glossy_yellow.bcm
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(1.0, 0.46594, 0.03595)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.5" loc="92, 119" />
-		<node type="MIX_SHADER" fac="0.5" loc="427, 123" />
-		<node type="MIX_SHADER" fac="0.5" loc="756, 116" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="65, 385" />
-		<node type="MATH" operation="DIVIDE" use_clamp="False" value1="0.5" value2="2.0" loc="246, 351" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="1000.0" loc="-732, 197" />
-		<node type="INVERT" fac="1.0" color="rgba(0.0, 0.0, 0.0, 1.0)" loc="-548, 149" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="7.0" loc="-426, 136" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.5" loc="-230, 141" />
-		<node type="FRESNEL" ior="1.20000" loc="-197, 436" />
-		<node type="LAYER_WEIGHT" blend="0.01999" loc="-194, 325" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.0" loc="91, -33" />
-		<node type="LAYER_WEIGHT" blend="0.5" loc="-447, 242" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.10000" loc="-433, -164" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.20000" loc="446, -70" />
-		<node type="FRESNEL" ior="1.10000" loc="465, 245" />
-		<node type="BSDF_DIFFUSE" color="rgba(1.0, 0.03999, 0.0, 1.0)" roughness="0.0" loc="-423, -11" />
-		<node type="RGB" custom_color="rgb(1.0, 0.80000, 0.5)" label="Gloss Color" color="rgba(1.0, 0.73231, 0.0, 1.0)" loc="-1138, 470" />
-		<node type="RGB" custom_color="rgb(1.0, 0.80000, 0.5)" label="Paint Color" color="rgba(1.0, 0.44275, 0.0, 1.0)" loc="-1127, 657" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Roughness" value="0.0" loc="-1142, 265" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Fresnel" value="1.29999" loc="-1142, 176" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Flake Size" value="1000.0" loc="-1142, -165" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Flake Spread" value="0.10000" loc="-1142, -342" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Flake Intensity" value="0.60000" loc="-1142, -254" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Blend" value="0.01999" loc="-1142, 94" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="1000.0" loc="-736, -4" />
-		<node type="OUTPUT_MATERIAL" loc="957, 98" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Gloss Roughness" value="0.0" loc="-1142, 8" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Gloss Spread" value="2.0" loc="-1142, -78" />
-	</nodes>
-	<links>
-		<link to="26" input="0" from="2" output="0" />
-		<link to="0" input="2" from="13" output="0" />
-		<link to="1" input="1" from="0" output="0" />
-		<link to="0" input="1" from="16" output="0" />
-		<link to="1" input="2" from="11" output="0" />
-		<link to="13" input="0" from="25" output="0" />
-		<link to="0" input="0" from="8" output="0" />
-		<link to="8" input="1" from="7" output="0" />
-		<link to="8" input="0" from="12" output="0" />
-		<link to="6" input="1" from="5" output="1" />
-		<link to="7" input="0" from="6" output="0" />
-		<link to="2" input="2" from="14" output="0" />
-		<link to="2" input="1" from="1" output="0" />
-		<link to="2" input="0" from="15" output="0" />
-		<link to="3" input="1" from="10" output="1" />
-		<link to="4" input="0" from="3" output="0" />
-		<link to="3" input="0" from="9" output="0" />
-		<link to="1" input="0" from="4" output="0" />
-		<link to="16" input="0" from="18" output="0" />
-		<link to="11" input="0" from="17" output="0" />
-		<link to="11" input="1" from="19" output="0" />
-		<link to="9" input="0" from="20" output="0" />
-		<link to="10" input="0" from="24" output="0" />
-		<link to="5" input="1" from="21" output="0" />
-		<link to="25" input="1" from="21" output="0" />
-		<link to="12" input="0" from="23" output="0" />
-		<link to="13" input="1" from="22" output="0" />
-		<link to="14" input="1" from="27" output="0" />
-		<link to="15" input="0" from="28" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/glossy_yellow.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/glossy_yellow.jpg
deleted file mode 100644
index 2b3c35d..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/glossy_yellow.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/metallic_blue.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/metallic_blue.bcm
deleted file mode 100644
index 331a94e..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/metallic_blue.bcm
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.20428, 0.26886, 0.36288)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.85000" loc="455, 102" />
-		<node type="OUTPUT_MATERIAL" loc="660, 96" />
-		<node type="LAYER_WEIGHT" blend="0.89999" loc="-615, 152" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Spread" value="0.70000" loc="-883, 468" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Flake Size" value="600.0" loc="-921, 351" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.00499" loc="44, 203" />
-		<node type="RGB" custom_color="rgb(0.89999, 0.89999, 0.89999)" color="rgba(0.0, 0.04970, 0.50288, 1.0)" loc="-987, 248" />
-		<node type="RGB" custom_color="rgb(0.89999, 0.89999, 0.89999)" color="rgba(0.0, 0.0, 0.09989, 1.0)" loc="-987, 46" />
-		<node type="RGB" custom_color="rgb(0.89999, 0.89999, 0.89999)" color="rgba(0.0, 1.0, 1.0, 1.0)" loc="-906, -174" />
-		<node type="GAMMA" hide="True" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="3.5" loc="-392, 240" />
-		<node type="MIX_SHADER" fac="0.75" loc="-415, 155" />
-		<node type="MIX_SHADER" fac="0.75" loc="-200, 157" />
-		<node type="LAYER_WEIGHT" blend="0.69999" loc="260, 317" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="600.0" loc="-615, 310" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.0, 0.04970, 0.50288, 1.0)" roughness="1.0" loc="-615, 47" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.0, 0.0, 0.09989, 1.0)" roughness="1.0" loc="-615, -70" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(0.0, 1.0, 1.0, 1.0)" roughness="0.30000" loc="-418, -74" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(0.0, 0.0, 0.00972, 1.0)" roughness="0.64999" loc="-211, -73" />
-		<node type="MIX_SHADER" fac="0.25" loc="44, 43" />
-		<node type="MIX_SHADER" fac="0.49999" loc="260, 105" />
-	</nodes>
-	<links>
-		<link to="9" input="0" from="13" output="1" />
-		<link to="1" input="0" from="0" output="0" />
-		<link to="0" input="0" from="12" output="1" />
-		<link to="19" input="2" from="18" output="0" />
-		<link to="0" input="1" from="19" output="0" />
-		<link to="0" input="2" from="17" output="0" />
-		<link to="10" input="2" from="15" output="0" />
-		<link to="10" input="1" from="14" output="0" />
-		<link to="10" input="0" from="2" output="1" />
-		<link to="11" input="2" from="16" output="0" />
-		<link to="11" input="1" from="10" output="0" />
-		<link to="11" input="0" from="9" output="0" />
-		<link to="19" input="1" from="5" output="0" />
-		<link to="14" input="0" from="6" output="0" />
-		<link to="12" input="0" from="3" output="0" />
-		<link to="13" input="1" from="4" output="0" />
-		<link to="16" input="0" from="8" output="0" />
-		<link to="15" input="0" from="7" output="0" />
-		<link to="18" input="1" from="11" output="0" />
-		<link to="18" input="2" from="17" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/metallic_blue.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/metallic_blue.jpg
deleted file mode 100644
index d44a563..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/car-paint/metallic_blue.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/blaster_bolt_red.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/blaster_bolt_red.bcm
deleted file mode 100644
index d6c8f55..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/blaster_bolt_red.bcm
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(1.0, 0.0, 0.0)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="300, 300" />
-		<node type="EMISSION" color="rgba(1.0, 0.0, 0.0, 1.0)" strength="30.0" loc="-189, 219" />
-		<node type="MIX_SHADER" fac="0.5" loc="70, 302" />
-		<node type="LAYER_WEIGHT" blend="0.89999" loc="-195, 431" />
-		<node type="EMISSION" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" strength="30.0" loc="-190, 326" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="2" output="0" />
-		<link to="2" input="0" from="3" output="1" />
-		<link to="2" input="1" from="4" output="0" />
-		<link to="2" input="2" from="1" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/blaster_bolt_red.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/blaster_bolt_red.jpg
deleted file mode 100644
index b5f7178..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/blaster_bolt_red.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fake_shading.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fake_shading.bcm
deleted file mode 100644
index 5199153..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fake_shading.bcm
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.84148, 0.74040, 0.00749)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="545, 173" />
-		<node type="NEW_GEOMETRY" loc="-759, 221" />
-		<node type="LIGHT_PATH" loc="-464, -35" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="1.0" loc="103, 86" />
-		<node type="EMISSION" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" strength="10.13210" loc="290, 179" />
-		<node type="MATH" operation="MAXIMUM" use_clamp="False" value1="0.5" value2="0.5" loc="-130, 30" />
-		<node type="VECT_MATH" operation="ADD" vector1="Vector(0.5, 0.5, 0.5)" vector2="Vector(0.5, 0.5, 0.5)" loc="-386, 202" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.47510, 0.01064, 0.00834, 1.0)" color2="rgba(0.88760, 0.81437, 0.00747, 1.0)" loc="-13, 254" />
-		<node type="TEX_COORD" loc="-776, 30" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="4" output="0" />
-		<link to="5" input="1" from="2" output="3" />
-		<link to="4" input="1" from="3" output="0" />
-		<link to="3" input="0" from="5" output="0" />
-		<link to="5" input="0" from="2" output="0" />
-		<link to="6" input="0" from="1" output="4" />
-		<link to="7" input="0" from="6" output="1" />
-		<link to="4" input="0" from="7" output="0" />
-		<link to="6" input="1" from="8" output="6" />
-	</links>
-</material>
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fake_shading.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fake_shading.jpg
deleted file mode 100644
index dd72be2..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fake_shading.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fingerprint_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fingerprint_osl.bcm
deleted file mode 100644
index 20a014d..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fingerprint_osl.bcm
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="VALTORGB" interpolation="LINEAR" fac="0.5" stops="2" stop1="0.0|rgba(0.0, 0.0, 0.0, 1.0)" stop2="1.0|rgba(1.0, 1.0, 1.0, 1.0)" loc="8, 456" />
-		<node type="TEX_NOISE" scale="5.0" detail="2.0" distortion="0.0" loc="-195, 467" />
-		<node type="MATH" operation="GREATER_THAN" use_clamp="False" value1="0.5" value2="0.0" loc="-129, -8" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.5" loc="20, 118" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.5" loc="163, 242" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.5" loc="303, 403" />
-		<node type="MATH" operation="LESS_THAN" use_clamp="False" value1="0.5" value2="0.20000" loc="451, 326" />
-		<node type="BSDF_DIFFUSE" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.0" loc="180, 83" />
-		<node type="MIX_SHADER" fac="0.79999" loc="373, 95" />
-		<node type="MIX_SHADER" fac="0.5" loc="606, 201" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.10000" loc="178, -39" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="376, -48" />
-		<node type="MATH" operation="SINE" use_clamp="False" value1="0.5" value2="1.0" loc="-272, 138" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="24.0" loc="-419, 137" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" vector="Vector(0.0, 0.0, 0.0)" scale="1.0" ridges="50" seed="42" loc="-588, 137" />
-		<node type="SCRIPT" mode="INTERNAL" script="1" vector="Vector(0.0, 0.0, 0.0)" center="Vector(0.5, 0.5, 0.5)" radius="0.15000" ellipse="0.90000" rotation="10.0" blur="1.0" loc="-593, 388" />
-		<node type="TEX_COORD" dupli="False" loc="-1050, 186" />
-		<node type="MAPPING" translation="Vector(-0.49999, 0.09999, 0.0)" rotation="Vector(0.08726, 0.10471, 0.03490)" scale="Vector(1.89999, 1.89999, 1.89999)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-865, 265" />
-		<node type="OUTPUT_MATERIAL" loc="811, 307" />
-	</nodes>
-	<links>
-		<link to="18" input="0" from="9" output="0" />
-		<link to="0" input="0" from="1" output="1" />
-		<link to="5" input="0" from="0" output="0" />
-		<link to="6" input="0" from="5" output="0" />
-		<link to="5" input="1" from="4" output="0" />
-		<link to="4" input="0" from="15" output="0" />
-		<link to="13" input="0" from="14" output="0" />
-		<link to="12" input="0" from="13" output="0" />
-		<link to="3" input="0" from="12" output="0" />
-		<link to="2" input="0" from="12" output="0" />
-		<link to="3" input="1" from="2" output="0" />
-		<link to="4" input="1" from="3" output="0" />
-		<link to="9" input="2" from="11" output="0" />
-		<link to="9" input="1" from="8" output="0" />
-		<link to="8" input="2" from="10" output="0" />
-		<link to="8" input="1" from="7" output="0" />
-		<link to="18" input="2" from="5" output="0" />
-		<link to="17" input="0" from="16" output="2" />
-		<link to="9" input="0" from="6" output="0" />
-		<link to="14" input="0" from="17" output="0" />
-		<link to="15" input="0" from="17" output="0" />
-	</links>
-	<scripts>
-		<script name="MAFingerprint.osl" id="0">
-/*<br />    fingerprint pattern by Michel J. Anders (c)2012<br />    license: cc-by-sa<br />    http://blenderthings.blogspot.com.au/2012/12/a-fingerprint-osl-shader-for-blender.html<br />*/<br /><br />#include "stdosl.h"<br />#include "node_texture.h"<br /><br />shader MAFingerprint(<br />        point Vector = P,<br />        float Scale = 1.0,<br />        int Ridges = 5,<br />        int Seed = 42,<br />        output float Fac = 0.0 )<br />{<br />    float da;<br />    point pa;<br />    float d;<br /><br />    vector up   = vector(0,0,1);<br />    vector tdir = 0;<br /><br />    int pi;<br /><br />    for(pi=0; pi< Ridges; pi++){<br />        pa = Scale * point(<br />        cellnoise(point(pi,pi,pi)),<br />        cellnoise(point(pi,pi+Seed,pi)),<br />        cellnoise(point(pi,pi,pi+Seed)));<br />        da = pa[2];<br />        vector v = pa - Vector;<br />        float d = length(v);<br />        v[2]=0;<br />        v = normalize(v);<br />        tdir += cross(v,up)*da*d;<br />    }<br />    Fac = sqrt(dot(tdir,tdir));<br />}<br /><br />
-		</script>
-		<script name="MAEllipseMask.osl" id="1">
-/*<br />    ellipse mask by Michel J. Anders (c)2012<br />    license: cc-by-sa<br />    http://blenderthings.blogspot.com.au/2012/12/a-fingerprint-osl-shader-for-blender.html<br />*/<br /><br />#include "stdosl.h"<br /><br />shader MAEllipseMask(<br />        point Vector = P,<br />        point Center = 0.5,<br />        float Radius = 0.5,<br />        float Ellipse = 1.0,<br />        float Rotation = 0.0,<br />        float Blur = 0.0,<br />        output float Fac = 0.0 )<br />{<br />    point p = rotate(Vector,radians(Rotation),Center,Center+vector(0,0,1));<br />    vector d = p - Center;<br />    d[0] *= Ellipse;<br />    float r2 = d[0]*d[0]+d[1]*d[1];<br />    if (r2 <= Radius*Radius) {<br />        Fac = 1-Blur*sqrt(r2/(Radius*Radius));<br />    }<br />}<br /><br />
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fingerprint_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fingerprint_osl.jpg
deleted file mode 100644
index 4dad5c6..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/fingerprint_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/invisible_light.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/invisible_light.bcm
deleted file mode 100644
index ee4ec58..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/invisible_light.bcm
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.37983, 0.37828, 0.79909)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="300, 300" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="-180, 225" />
-		<node type="LIGHT_PATH" loc="-742, 566" />
-		<node type="EMISSION" color="rgba(0.11494, 0.11202, 0.80000, 1.0)" strength="2.35998" loc="-351, 321" />
-		<node type="MIX_SHADER" fac="0.5" loc="40, 322" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="1.0" loc="-271, 490" />
-	</nodes>
-	<links>
-		<link to="4" input="1" from="3" output="0" />
-		<link to="0" input="0" from="4" output="0" />
-		<link to="4" input="2" from="1" output="0" />
-		<link to="5" input="1" from="2" output="1" />
-		<link to="5" input="0" from="2" output="0" />
-		<link to="4" input="0" from="5" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/invisible_light.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/invisible_light.jpg
deleted file mode 100644
index 7d96e82..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/invisible_light.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/simulated_sss.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/simulated_sss.bcm
deleted file mode 100644
index 6a244e4..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/simulated_sss.bcm
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80220, 0.34073, 0.11822)" sample_lamp="False">
-	<nodes>
-		<node type="MATH" hide="True" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="345, 357" />
-		<node type="MATH" hide="True" operation="MINIMUM" use_clamp="False" value1="0.5" value2="1.0" loc="531, 370" />
-		<node type="MATH" hide="True" operation="SUBTRACT" use_clamp="False" value1="1.0" value2="0.5" loc="-61, 201" />
-		<node type="NEW_GEOMETRY" hide="True" loc="-247, 217" />
-		<node type="MIX_SHADER" hide="True" fac="0.5" loc="617, 462" />
-		<node type="BSDF_DIFFUSE" hide="True" color="rgba(0.80000, 0.21108, 0.0, 1.0)" roughness="0.0" loc="321, 442" />
-		<node type="BSDF_GLOSSY" hide="True" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.20000" loc="166, 480" />
-		<node type="BSDF_TRANSLUCENT" hide="True" color="rgba(0.80000, 0.50765, 0.23623, 1.0)" loc="599, 243" />
-		<node type="MIX_SHADER" hide="True" fac="0.5" loc="806, 329" />
-		<node type="OUTPUT_MATERIAL" hide="True" loc="996, 315" />
-		<node type="RGB" label="Subdermal Color" color="rgba(0.80000, 0.21108, 0.0, 1.0)" loc="-680, 555" />
-		<node type="VALUE" label="Specularity" value="0.5" loc="-670, 678" />
-		<node type="RGB" label="Epidermal Color" color="rgba(0.80000, 0.50765, 0.23623, 1.0)" loc="-680, 244" />
-		<node type="LIGHT_PATH" loc="-488, 505" />
-		<node type="MATH" hide="True" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="-0.75199" loc="-258, 307" />
-		<node type="MATH" hide="True" operation="POWER" use_clamp="False" value1="2.71798" value2="0.5" loc="-104, 327" />
-		<node type="MATH" hide="True" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="68, 368" />
-		<node type="VALUE" label="Absorption Value" value="-0.75199" loc="-670, 351" />
-	</nodes>
-	<links>
-		<link to="14" input="0" from="13" output="7" />
-		<link to="15" input="1" from="14" output="0" />
-		<link to="2" input="1" from="3" output="6" />
-		<link to="16" input="0" from="13" output="0" />
-		<link to="0" input="0" from="16" output="0" />
-		<link to="0" input="1" from="2" output="0" />
-		<link to="1" input="0" from="0" output="0" />
-		<link to="8" input="0" from="1" output="0" />
-		<link to="9" input="0" from="8" output="0" />
-		<link to="4" input="2" from="5" output="0" />
-		<link to="4" input="1" from="6" output="0" />
-		<link to="8" input="2" from="7" output="0" />
-		<link to="8" input="1" from="4" output="0" />
-		<link to="5" input="0" from="10" output="0" />
-		<link to="4" input="0" from="11" output="0" />
-		<link to="14" input="1" from="17" output="0" />
-		<link to="7" input="0" from="12" output="0" />
-		<link to="16" input="1" from="15" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/simulated_sss.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/simulated_sss.jpg
deleted file mode 100644
index eab220e..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/simulated_sss.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/volumetric_light.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/volumetric_light.bcm
deleted file mode 100644
index 1dca858..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/volumetric_light.bcm
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.68979, 1.25306, 1.30810)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="1037, 349" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="-0.03200" loc="-263, 445" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="303, 580" />
-		<node type="LIGHT_PATH" loc="-451, 602" />
-		<node type="MATH" operation="POWER" use_clamp="False" value1="25.0" value2="0.5" loc="-78, 443" />
-		<node type="NEW_GEOMETRY" loc="-265, 273" />
-		<node type="BSDF_GLASS" distribution="SHARP" color="rgba(1.0, 1.0, 1.0, 0.98518)" roughness="0.0" ior="1.0" loc="305, 256" />
-		<node type="EMISSION" color="rgba(0.09172, 0.17486, 0.80000, 1.0)" strength="52.49996" loc="308, 375" />
-		<node type="MATH" operation="MINIMUM" use_clamp="False" value1="0.5" value2="1.0" loc="526, 569" />
-		<node type="RGB" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Emission Color" color="rgba(0.09172, 0.17486, 0.80000, 1.0)" loc="-533, 413" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="1.0" value2="0.5" loc="-79, 257" />
-		<node type="MIX_SHADER" fac="0.5" loc="855, 373" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="88, 580" />
-		<node type="VALUE" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Brightness" value="40.0" loc="-527, 227" />
-	</nodes>
-	<links>
-		<link to="1" input="0" from="3" output="7" />
-		<link to="4" input="1" from="1" output="0" />
-		<link to="10" input="1" from="5" output="6" />
-		<link to="12" input="0" from="3" output="0" />
-		<link to="2" input="0" from="12" output="0" />
-		<link to="2" input="1" from="10" output="0" />
-		<link to="8" input="0" from="2" output="0" />
-		<link to="11" input="0" from="8" output="0" />
-		<link to="0" input="0" from="11" output="0" />
-		<link to="11" input="1" from="7" output="0" />
-		<link to="12" input="1" from="4" output="0" />
-		<link to="7" input="1" from="13" output="0" />
-		<link to="7" input="0" from="9" output="0" />
-		<link to="11" input="2" from="6" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/volumetric_light.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/volumetric_light.jpg
deleted file mode 100644
index 9f62bbd..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/volumetric_light.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/wireframe_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/wireframe_osl.bcm
deleted file mode 100644
index f2a3108..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/wireframe_osl.bcm
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="300, 300" />
-		<node type="MIX_SHADER" fac="0.5" loc="75, 304" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.0, 0.0, 0.0, 1.0)" roughness="0.0" loc="-149, 133" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.14667, 0.26590, 0.39998, 0.0)" roughness="0.0" loc="-299, 265" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" line_width="0.99998" raster="1" loc="-142, 435" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="-115, 257" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="1" output="0" />
-		<link to="1" input="0" from="4" output="0" />
-		<link to="1" input="2" from="2" output="0" />
-		<link to="5" input="0" from="3" output="0" />
-		<link to="1" input="1" from="5" output="0" />
-	</links>
-	<scripts>
-		<script name="TDwireframe.osl.001" id="0">
-<br />/*<br />    Wireframe texture by Thomas Dinges (c)2012<br />    http://www.openshading.com/osl/example-shaders/<br />*/<br /><br />#include "stdosl.h"<br />#include "oslutil.h"<br /><br />shader TDwireframe(<br />    float Line_Width = 2.0,<br />    int Raster = 1,<br />    output float Factor = 0.0)<br />{<br />    //Factor = wireframe("triangles", Line_Width, Raster);<br />    /*  currently blender always provides triangles at this point in the render <br />        as in fully triangulated mesh that the render engine works with<br />        at some stage the polygons option will provide original poly edges instead */<br />    Factor = wireframe("polygons", Line_Width, Raster);<br />}<br /><br /><br />		
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/wireframe_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/wireframe_osl.jpg
deleted file mode 100644
index a70fda5..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/effects/wireframe_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/gummy_worm.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/gummy_worm.bcm
deleted file mode 100644
index 08ee650..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/gummy_worm.bcm
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.28012, 0.08883, 0.07812)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.86000" loc="250, 356" />
-		<node type="OUTPUT_MATERIAL" loc="517, 356" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.80000, 0.45208, 0.0, 1.0)" loc="25, 220" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.69998, 0.03863, 0.13707, 1.0)" roughness="0.0" loc="25, 356" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.24683, 0.5, 0.10869, 1.0)" color2="rgba(0.5, 0.42882, 0.0, 1.0)" loc="-158, 292" />
-		<node type="FRESNEL" ior="1.66733" loc="-412, 292" />
-	</nodes>
-	<links>
-		<link to="0" input="1" from="3" output="0" />
-		<link to="1" input="0" from="0" output="0" />
-		<link to="0" input="2" from="2" output="0" />
-		<link to="4" input="0" from="5" output="0" />
-		<link to="2" input="0" from="4" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/gummy_worm.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/gummy_worm.jpg
deleted file mode 100644
index 0da81b2..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/gummy_worm.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/milk_chocolate.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/milk_chocolate.bcm
deleted file mode 100644
index 4abaeca..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/milk_chocolate.bcm
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.30000, 0.10498, 0.04715)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="237, 123" />
-		<node type="MIX_SHADER" fac="0.85000" loc="37, 123" />
-		<node type="MIX_SHADER" fac="0.10000" loc="-165, 38" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.15053, 0.08335, 0.04656, 1.0)" roughness="0.31999" loc="-171, 186" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.14248, 0.04986, 0.02239, 1.0)" roughness="0.0" loc="-381, 106" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.19999, 0.11313, 0.08168, 1.0)" loc="-391, -4" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="1" output="0" />
-		<link to="1" input="1" from="3" output="0" />
-		<link to="1" input="2" from="2" output="0" />
-		<link to="2" input="1" from="4" output="0" />
-		<link to="2" input="2" from="5" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/milk_chocolate.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/milk_chocolate.jpg
deleted file mode 100644
index cdc2138..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/milk_chocolate.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/raspberry.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/raspberry.bcm
deleted file mode 100644
index d539d4a..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/raspberry.bcm
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.68075, 0.03067, 0.04267)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="1000, 250" />
-		<node type="MIX_SHADER" fac="0.5" loc="700, 250" />
-		<node type="LAYER_WEIGHT" blend="0.15000" loc="400, 400" />
-		<node type="MIX_SHADER" fac="0.5" loc="400, 250" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 0.62673, 0.94107, 1.0)" roughness="0.10000" loc="400, 100" />
-		<node type="LAYER_WEIGHT" blend="0.10000" loc="100, 400" />
-		<node type="MIX_SHADER" fac="0.80000" loc="100, 250" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.54095, 0.72606, 1.0)" roughness="0.60000" loc="100, 100" />
-		<node type="BSDF_GLASS" distribution="SHARP" color="rgba(0.83876, 0.35837, 0.31907, 1.0)" roughness="0.0" ior="1.0" loc="-200, 325" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.96478, 0.21441, 0.25363, 1.0)" loc="-200, 175" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="1" output="0" />
-		<link to="1" input="0" from="2" output="0" />
-		<link to="1" input="1" from="3" output="0" />
-		<link to="1" input="2" from="4" output="0" />
-		<link to="3" input="0" from="5" output="0" />
-		<link to="3" input="1" from="6" output="0" />
-		<link to="3" input="2" from="7" output="0" />
-		<link to="6" input="1" from="8" output="0" />
-		<link to="6" input="2" from="9" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/raspberry.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/raspberry.jpg
deleted file mode 100644
index 1c5e323..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/food/raspberry.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/absorption.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/absorption.bcm
deleted file mode 100644
index 71c325e..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/absorption.bcm
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.10572, 0.13248, 0.47976)" sample_lamp="True">
-	<nodes>
-		<node type="NEW_GEOMETRY" loc="-247, 217" />
-		<node type="LIGHT_PATH" loc="-451, 561" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="-0.68007" loc="-263, 461" />
-		<node type="MATH" operation="POWER" use_clamp="False" value1="2.71798" value2="0.5" loc="-78, 429" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="128, 489" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="345, 357" />
-		<node type="MATH" operation="MINIMUM" use_clamp="False" value1="0.5" value2="1.0" loc="528, 370" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" ior="1.45000" loc="834, 341" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.0, 0.08540, 1.0, 1.0)" color2="rgba(0.97188, 1.0, 0.97017, 1.0)" loc="692, 378" />
-		<node type="OUTPUT_MATERIAL" loc="1037, 349" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="1.0" value2="0.5" loc="-61, 201" />
-	</nodes>
-	<links>
-		<link to="3" input="1" from="2" output="0" />
-		<link to="10" input="1" from="0" output="6" />
-		<link to="4" input="0" from="3" output="0" />
-		<link to="4" input="1" from="1" output="0" />
-		<link to="9" input="0" from="7" output="0" />
-		<link to="5" input="0" from="4" output="0" />
-		<link to="5" input="1" from="10" output="0" />
-		<link to="6" input="0" from="5" output="0" />
-		<link to="8" input="0" from="6" output="0" />
-		<link to="7" input="0" from="8" output="0" />
-		<link to="2" input="0" from="1" output="7" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/absorption.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/absorption.jpg
deleted file mode 100644
index da3e159..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/absorption.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/iridescent.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/iridescent.bcm
deleted file mode 100644
index 27f18e2..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/iridescent.bcm
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.41442, 0.41442, 0.39642)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.5" loc="-99, 306" />
-		<node type="MIX_SHADER" fac="0.5" loc="-90, 7" />
-		<node type="LAYER_WEIGHT" blend="0.30000" loc="-522, 495" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.0, 0.12627, 0.80000, 1.0)" roughness="0.00999" loc="-318, 306" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.00999" ior="1.45000" loc="-318, -206" />
-		<node type="OUTPUT_MATERIAL" loc="390, 154" />
-		<node type="MIX_SHADER" fac="0.25" loc="120, 154" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.00999" ior="1.45000" loc="-318, 154" />
-		<node type="TEX_NOISE" scale="10.0" detail="2.0" distortion="0.0" loc="-675, 154" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.00999" loc="-318, -32" />
-		<node type="INVERT" fac="1.0" color="rgba(0.0, 0.0, 0.0, 1.0)" loc="-285, 467" />
-	</nodes>
-	<links>
-		<link to="5" input="0" from="6" output="0" />
-		<link to="0" input="1" from="3" output="0" />
-		<link to="0" input="0" from="10" output="0" />
-		<link to="9" input="0" from="8" output="0" />
-		<link to="0" input="2" from="7" output="0" />
-		<link to="6" input="1" from="0" output="0" />
-		<link to="1" input="1" from="9" output="0" />
-		<link to="1" input="2" from="4" output="0" />
-		<link to="6" input="2" from="1" output="0" />
-		<link to="3" input="0" from="8" output="0" />
-		<link to="10" input="1" from="2" output="1" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/iridescent.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/iridescent.jpg
deleted file mode 100644
index b217b1c..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/iridescent.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/lalique.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/lalique.bcm
deleted file mode 100644
index b358716..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/lalique.bcm
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.60382, 0.60382, 0.77582)" sample_lamp="True">
-	<nodes>
-		<node type="FRESNEL" ior="1.79999" loc="-676, 464" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.05000" ior="1.45000" loc="-123, 104" />
-		<node type="MIX_SHADER" fac="0.34999" loc="104, 214" />
-		<node type="ADD_SHADER" loc="-1113, 55" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.77942, 0.86935, 1.0, 1.0)" loc="-636, 364" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(1.0, 0.90754, 0.99431, 1.0)" loc="-626, 274" />
-		<node type="MIX_SHADER" fac="0.5" loc="-384, 439" />
-		<node type="ADD_SHADER" loc="-121, 453" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.31400, 0.31400, 0.31400, 1.0)" loc="-784, 87" />
-		<node type="OUTPUT_MATERIAL" loc="386, 181" />
-	</nodes>
-	<links>
-		<link to="9" input="0" from="2" output="0" />
-		<link to="6" input="0" from="0" output="0" />
-		<link to="2" input="2" from="1" output="0" />
-		<link to="6" input="1" from="4" output="0" />
-		<link to="6" input="2" from="5" output="0" />
-		<link to="7" input="0" from="6" output="0" />
-		<link to="2" input="1" from="7" output="0" />
-		<link to="7" input="1" from="8" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/lalique.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/lalique.jpg
deleted file mode 100644
index 2fdec98..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/lalique.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/soda_lime_common.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/soda_lime_common.bcm
deleted file mode 100644
index efd2d0f..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/soda_lime_common.bcm
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.85013, 1.0, 0.80923)" sample_lamp="True">
-	<nodes>
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(0.96069, 1.0, 0.94998, 1.0)" roughness="0.00999" ior="1.51800" loc="62, 412" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="95, 230" />
-		<node type="OUTPUT_MATERIAL" loc="520, 292" />
-		<node type="MIX_SHADER" fac="0.0" loc="317, 296" />
-		<node type="LIGHT_PATH" loc="-189, 325" />
-	</nodes>
-	<links>
-		<link to="3" input="2" from="1" output="0" />
-		<link to="3" input="0" from="4" output="1" />
-		<link to="3" input="1" from="0" output="0" />
-		<link to="2" input="0" from="3" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/soda_lime_common.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/soda_lime_common.jpg
deleted file mode 100644
index 4064ca9..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/glass/soda_lime_common.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/index.xml b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/index.xml
deleted file mode 100644
index 9e6fd6c..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/index.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<library>
-	<category title="Car Paint" folder="car-paint" addon="0.4">
-		<material name="Dull Coral" href="dull_coral" by="monsterdog" stars="4" addon="0.4" />
-		<material name="Dull Olive" href="dull_olive" stars="5" addon="0.4" />
-		<material name="Flaky Green" href="flaky_green" stars="5" fireflies="medium" addon="0.4" />
-		<material name="Flaky Purple" href="flaky_purple" stars="4" fireflies="medium" addon="0.4" />
-		<material name="Flaky Tangelo" href="flaky_tangelo" stars="5" fireflies="medium" addon="0.4" />
-		<material name="Glossy Yellow" href="glossy_yellow" stars="4" fireflies="medium" addon="0.4" />
-		<material name="Metallic Blue" href="metallic_blue" stars="5" addon="0.4" />
-	</category>
-	<category title="Effects" folder="effects" addon="0.4">
-		<material name="Blaster Bolt (Red)" href="blaster_bolt_red" stars="3" addon="0.4" />
-		<material name="Invisible Light" href="invisible_light" stars="4" addon="0.4" />
-		<material name="Fake Shading" href="fake_shading" by="Ace Dragon" stars="3" addon="0.4" />
-		<material name="Fingerprint OSL" href="fingerprint_osl" by="varkenvarken" stars="4" complexity="intermediate" addon="0.4" bl="2.65-" />
-		<material name="Simulated SSS" href="simulated_sss" by="ZetShandow" stars="4" complexity="intermediate" addon="0.4" bl="2.64-" />
-		<material name="Volumetric Light" href="volumetric_light" by="ZetShandow" stars="4" complexity="intermediate" fireflies="medium" addon="0.4" bl="2.64-" />
-		<material name="Wireframe OSL" href="wireframe_osl" by="DingTo" stars="4" complexity="intermediate" fireflies="medium" addon="0.4" />
-	</category>
-	<category title="Food" folder="food" addon="0.4">
-		<material name="Gummy Worm" href="gummy_worm" by="Jimmy Gunawan" stars="4" addon="0.4" />
-		<material name="Milk Chocolate" href="milk_chocolate" by="Peter Cassetta" stars="3" addon="0.4" />
-		<material name="Raspberry" href="raspberry" stars="4" addon="0.4" />
-	</category>
-	<category title="Glass" folder="glass" addon="0.4">
-		<material name="Absorption" href="absorption" by="ZetShandow" stars="4" fireflies="medium" addon="0.4" bl="2.64-" />
-		<material name="Iridescent" href="iridescent" by="moony" stars="5" fireflies="medium" speed="fair" addon="0.4" />
-		<material name="Lalique" href="lalique" by="moony" stars="4" addon="0.4" speed="medium" />
-		<material name="Soda-Lime (Common)" href="soda_lime_common" by="Peter Cassetta" stars="3" addon="0.4" />
-	</category>
-	<category title="Liquids" folder="liquids" addon="0.4">
-		<material name="Cranberry Juice" href="cranberry_juice" by="Peter Cassetta" stars="4" addon="0.4" />
-		<material name="Slime" href="slime" stars="3" addon="0.4" bl="2.64-" />
-		<material name="Soap Bubble" href="soap_bubble" by="moony" stars="4" fireflies="medium" speed="fair" addon="0.4" />
-	</category>
-	<category title="Metals" folder="metals" addon="0.4">
-		<material name="Bronze (Ancient)" href="bronze_ancient" stars="4" addon="0.4" />
-		<material name="Fool's Gold" href="fools_gold" stars="4" complexity="complex" addon="0.4" />
-		<material name="Galvanized Steel" href="galvanized_steel" by="moony" stars="4" fireflies="medium" addon="0.4" />
-	</category>
-	<category title="Nature" folder="nature" addon="0.4">
-		<material name="Pearl" href="pearl" by="moony" stars="4" addon="0.4" />
-		<material name="Forest" href="forest" by="Jonathan L" stars="4" complexity="complex" addon="0.4" />
-	</category>
-	<category title="Patterns" folder="patterns" addon="0.4">
-		<material name="Barb Wire OSL" href="barbwire_osl" by="varkenvarken" stars="4" complexity="complex" addon="0.4" />
-		<material name="Chain Link OSL" href="chain_link_osl" by="varkenvarken" stars="4" complexity="complex" addon="0.4" />
-		<material name="Hex Tile OSL" href="hex_tile_osl" by="varkenvarken" stars="4" addon="0.4" />
-
-		<material name="Sierpinski Squares OSL" href="sierpinski_squares_osl" by="elbrujodelatribu" stars="4" complexity="complex" addon="0.4" />
-	</category>
-	<category title="Plastics" folder="plastics" addon="0.4">
-		<material name="Toy Brick (Red)" href="toy_brick_red" by="Peter Cassetta" stars="4" addon="0.4" />
-	</category>
-	<category title="Skin" folder="skin" addon="0.4">
-		<material name="Pox" href="pox" by="moony" stars="4" addon="0.4" />
-		<material name="Dragon Scales OSL" href="dragon_scales_osl" by="varken/androcto" stars="4" complexity="complex" addon="0.4" />
-	</category>
-	<category title="Stones" folder="stones" addon="0.4">
-		<material name="Diamond" href="diamond" stars="3" fireflies="high" speed="slow" addon="0.4" />
-		<material name="Malachite" href="malachite" by="moony" stars="3" addon="0.4" />
-		<material name="Polished Haematite" href="polished_haematite" by="moony" stars="5" complexity="intermediate" addon="0.4" />
-		<material name="Veined Marble OSL" href="veined_marble_osl" by="sambler" stars="4" complexity="intermediate" addon="0.4" />
-	</category>
-	<category title="Synthetic" folder="synthetic" addon="0.4">
-		<material name="Carbon Fiber" href="carbon_fiber" stars="5" complexity="complex" addon="0.4" />
-		<material name="Carbon Fiber (Glossy)" href="carbon_fiber_glossy" stars="3" complexity="complex" addon="0.4" />
-		<material name="Polystyrene Foam" href="polystyrene_foam" by="Peter Cassetta" stars="4" complexity="intermediate" addon="0.4" />
-		<material name="Rubber" href="rubber" stars="3" addon="0.4" />
-	</category>
-	<category title="Textiles" folder="textiles" addon="0.4">
-		<material name="Denim" href="denim" by="Peter Cassetta" stars="4" complexity="complex" addon="0.4" />
-		<material name="Hessian OSL" href="hessian_osl" by="varkenvarken" stars="4" complexity="complex" addon="0.4" />
-		<material name="Velvet (Edged)" href="velvet_edged" stars="4" addon="0.4" />
-		<material name="Weave OSL" href="weave_osl" by="varkenvarken" stars="4" complexity="complex" addon="0.4" />
-		<material name="Weave Test" href="weave_test" by="niabot" stars="4" complexity="complex" addon="0.4" />
-	</category>
-	<category title="Wood" folder="wood" addon="0.4">
-		<material name="Parquete Tile OSL" href="parquete_tile_osl" by="sambler" stars="4" complexity="intermediate" addon="0.4" />
-		<material name="Polished Walnut" href="polished_walnut" by="Peter Cassetta" stars="4" complexity="intermediate" addon="0.4" />
-		<material name="Rough Pine" href="rough_pine" by="Peter Cassetta" stars="4" complexity="intermediate" addon="0.4" />
-		<material name="Rough Walnut" href="rough_walnut" by="Peter Cassetta" stars="3" complexity="intermediate" addon="0.4" />
-	</category>
-</library>
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/cranberry_juice.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/cranberry_juice.bcm
deleted file mode 100644
index 1e9c634..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/cranberry_juice.bcm
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.87406, 0.02816, 0.03187)" sample_lamp="True">
-	<nodes>
-		<node type="LIGHT_PATH" loc="-236, 318" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 0.37799, 0.37799, 1.0)" loc="95, 230" />
-		<node type="BSDF_GLASS" distribution="SHARP" color="rgba(1.0, 0.41999, 0.41999, 1.0)" roughness="0.00999" ior="1.35099" loc="62, 412" />
-		<node type="MIX_SHADER" fac="0.0" loc="294, 303" />
-		<node type="OUTPUT_MATERIAL" loc="520, 292" />
-	</nodes>
-	<links>
-		<link to="3" input="2" from="1" output="0" />
-		<link to="4" input="0" from="3" output="0" />
-		<link to="3" input="1" from="2" output="0" />
-		<link to="3" input="0" from="0" output="1" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/cranberry_juice.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/cranberry_juice.jpg
deleted file mode 100644
index bc96ab6..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/cranberry_juice.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/slime.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/slime.bcm
deleted file mode 100644
index c66af61..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/slime.bcm
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.17464, 0.52099, 0.03071)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="286, 432" />
-		<node type="MIX_SHADER" fac="0.5" loc="67, 330" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.17583, 0.52207, 0.03054, 1.0)" roughness="0.0" loc="-151, 303" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.88750, 0.66609, 0.19976, 1.0)" roughness="0.5" loc="-157, 195" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="True" value1="0.5" value2="1.0" loc="-135, 463" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="-326, 470" />
-		<node type="TEX_MUSGRAVE" musgrave="FBM" scale="-5.10382" detail="2.0" dimension="2.0" lacunarity="1.0" offset="0.0" gain="1.0" loc="-584, 508" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="1.99999" loc="-590, 669" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.78539, 0.78539, 0.0)" scale="Vector(3.0, 3.0, 3.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-898, 505" />
-		<node type="TEX_COORD" loc="-1129, 475" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="1" output="0" />
-		<link to="1" input="2" from="3" output="0" />
-		<link to="0" input="2" from="4" output="0" />
-		<link to="1" input="0" from="4" output="0" />
-		<link to="8" input="0" from="9" output="0" />
-		<link to="5" input="0" from="7" output="1" />
-		<link to="4" input="0" from="5" output="0" />
-		<link to="5" input="1" from="6" output="1" />
-		<link to="6" input="0" from="8" output="0" />
-		<link to="1" input="1" from="2" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/slime.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/slime.jpg
deleted file mode 100644
index 39891cc..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/slime.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/soap_bubble.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/soap_bubble.bcm
deleted file mode 100644
index 5952423..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/soap_bubble.bcm
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.75489, 0.68663, 0.79909)" sample_lamp="True">
-	<nodes>
-		<node type="LAYER_WEIGHT" blend="0.89999" loc="-651, 778" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 0.0, 0.0, 1.0)" roughness="0.0" loc="-655, 631" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.0, 1.0, 0.0, 1.0)" roughness="0.0" loc="-651, 471" />
-		<node type="LAYER_WEIGHT" blend="0.30000" loc="-201, 737" />
-		<node type="MIX_SHADER" fac="0.5" loc="-184, 520" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.0, 0.0, 1.0, 1.0)" roughness="0.0" loc="-188, 341" />
-		<node type="LAYER_WEIGHT" blend="0.39998" loc="123, 733" />
-		<node type="MIX_SHADER" fac="0.5" loc="123, 516" />
-		<node type="MIX_SHADER" fac="0.5" loc="469, 321" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="486, 76" />
-		<node type="MIX_SHADER" fac="0.5" loc="797, 265" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.0" ior="1.45000" loc="808, 486" />
-		<node type="FRESNEL" ior="1.45000" loc="864, 676" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.48350, 0.0, 0.80000, 1.0)" roughness="0.0" loc="131, 217" />
-		<node type="OUTPUT_MATERIAL" loc="1790, 301" />
-		<node type="MIX_SHADER" fac="0.89999" loc="1232, 271" />
-		<node type="MIX_SHADER" fac="0.89999" loc="1570, 333" />
-		<node type="LIGHT_PATH" loc="1364, 592" />
-		<node type="BSDF_TRANSPARENT" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" loc="1254, 128" />
-	</nodes>
-	<links>
-		<link to="16" input="1" from="15" output="0" />
-		<link to="4" input="0" from="0" output="1" />
-		<link to="7" input="1" from="4" output="0" />
-		<link to="7" input="0" from="3" output="1" />
-		<link to="8" input="1" from="7" output="0" />
-		<link to="4" input="1" from="1" output="0" />
-		<link to="4" input="2" from="2" output="0" />
-		<link to="7" input="2" from="5" output="0" />
-		<link to="8" input="2" from="13" output="0" />
-		<link to="8" input="0" from="6" output="0" />
-		<link to="10" input="1" from="8" output="0" />
-		<link to="10" input="2" from="9" output="0" />
-		<link to="15" input="1" from="11" output="0" />
-		<link to="15" input="2" from="10" output="0" />
-		<link to="15" input="0" from="12" output="0" />
-		<link to="14" input="0" from="16" output="0" />
-		<link to="16" input="0" from="17" output="1" />
-		<link to="16" input="2" from="18" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/soap_bubble.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/soap_bubble.jpg
deleted file mode 100644
index 35b1d9e..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/liquids/soap_bubble.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/bronze_ancient.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/bronze_ancient.bcm
deleted file mode 100644
index f9d75b4..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/bronze_ancient.bcm
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.30153, 0.11162, 0.05403)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="633, 386" />
-		<node type="NEW_GEOMETRY" loc="-202, 555" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.10000" loc="182, 374" />
-		<node type="LAYER_WEIGHT" blend="0.46500" loc="-12, 235" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.04357, 0.04357, 0.04357, 1.0)" roughness="0.03999" loc="-33, 129" />
-		<node type="MIX_SHADER" fac="0.5" loc="214, 171" />
-		<node type="MIX_SHADER" fac="0.5" loc="429, 338" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.06498" loc="-33, -2" />
-		<node type="RGB" color="rgba(0.85499, 0.28891, 0.15745, 1.0)" loc="-414, 435" />
-		<node type="RGB" color="rgba(0.79909, 0.43415, 0.07225, 1.0)" loc="-414, 228" />
-		<node type="RGB" color="rgba(0.09000, 0.04159, 0.01396, 1.0)" loc="-414, 39" />
-		<node type="VECT_MATH" operation="DOT_PRODUCT" vector1="Vector(0.5, 0.5, 0.5)" vector2="Vector(0.5, 0.5, 0.5)" loc="-39, 565" />
-		<node type="MATH" operation="POWER" use_clamp="False" value1="0.5" value2="4.0" loc="159, 548" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="6" output="0" />
-		<link to="11" input="0" from="1" output="1" />
-		<link to="11" input="1" from="1" output="4" />
-		<link to="12" input="0" from="11" output="1" />
-		<link to="6" input="0" from="12" output="0" />
-		<link to="6" input="1" from="2" output="0" />
-		<link to="5" input="1" from="4" output="0" />
-		<link to="5" input="2" from="7" output="0" />
-		<link to="6" input="2" from="5" output="0" />
-		<link to="5" input="0" from="3" output="1" />
-		<link to="4" input="0" from="8" output="0" />
-		<link to="7" input="0" from="9" output="0" />
-		<link to="2" input="0" from="10" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/bronze_ancient.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/bronze_ancient.jpg
deleted file mode 100644
index a04b47a..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/bronze_ancient.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/fools_gold.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/fools_gold.bcm
deleted file mode 100644
index 7bfa065..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/fools_gold.bcm
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.94870, 0.50081, 0.05448)" sample_lamp="True">
-	<nodes>
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 0.68531, 0.15028, 1.0)" roughness="0.15000" loc="48, 300" />
-		<node type="TEX_NOISE" scale="68.99987" detail="2.40684" distortion="12.65606" loc="52, 156" />
-		<node type="MATH" operation="GREATER_THAN" use_clamp="False" value1="0.5" value2="0.81199" loc="253, 125" />
-		<node type="TEX_MUSGRAVE" musgrave="FBM" scale="860.48791" detail="2.37062" dimension="2.0" lacunarity="44.37200" offset="0.0" gain="1.0" loc="51, -35" />
-		<node type="TEX_MAGIC" depth="2" scale="519.49645" distortion="28.07604" loc="41, -279" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.26600" loc="621, -107" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="593, 125" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="774, 118" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="-0.00400" loc="1052, -477" />
-		<node type="MATH" operation="SINE" use_clamp="False" value1="0.5" value2="2.43676" loc="762, -469" />
-		<node type="MATH" operation="TANGENT" use_clamp="False" value1="0.5" value2="0.52956" loc="909, -456" />
-		<node type="TEX_WAVE" wave="RINGS" scale="39.22412" distortion="21.16782" detail="2.31078" detail_scale="1.94421" loc="571, -411" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="954, 75" />
-		<node type="MATH" operation="SINE" use_clamp="False" value1="1.0" value2="0.5" loc="1603, -158" />
-		<node type="TEX_WAVE" wave="RINGS" scale="9.16790" distortion="9.56811" detail="2.04166" detail_scale="28.49596" loc="1318, -223" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.37356" value2="0.5" loc="1781, -163" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.05601" value2="0.5" loc="1959, -166" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="275.35241" loc="43, -465" />
-		<node type="VALUE" value="9.16800" loc="1210, -304" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.5" loc="-89, 96" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.5" loc="-100, -121" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.5" loc="-90, -298" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.5" loc="-97, -482" />
-		<node type="VALUE" value="39.22399" loc="421, -459" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.5" loc="424, -548" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.5" loc="1232, -456" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.00300" loc="1118, -164" />
-		<node type="TEX_MUSGRAVE" musgrave="MULTIFRACTAL" scale="504.95214" detail="2.26371" dimension="2.0" lacunarity="1.16760" offset="0.0" gain="1.0" loc="948, -170" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="1.0" value2="0.5" loc="806, -135" />
-		<node type="VALUE" value="504.95199" loc="831, -280" />
-		<node type="VALUE" value="0.5" loc="-532, 234" />
-		<node type="MATH" operation="GREATER_THAN" use_clamp="False" value1="0.5" value2="0.5" loc="442, -316" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.5" loc="442, -108" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.30959" loc="282, -291" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="-0.20536" loc="605, -259" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.01236" loc="395, 131" />
-		<node type="VALUE" value="314.93222" loc="-339, -542" />
-		<node type="VALUE" value="296.85839" loc="-364, -375" />
-		<node type="VALUE" value="860.48797" loc="-356, -205" />
-		<node type="VALUE" value="69.0" loc="-368, 0" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.5" loc="2184, -23" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.84039" loc="2485, 56" />
-		<node type="OUTPUT_MATERIAL" loc="2715, 178" />
-	</nodes>
-	<links>
-		<link to="42" input="0" from="0" output="0" />
-		<link to="35" input="0" from="2" output="0" />
-		<link to="2" input="1" from="1" output="1" />
-		<link to="6" input="0" from="35" output="0" />
-		<link to="32" input="1" from="4" output="1" />
-		<link to="32" input="0" from="3" output="1" />
-		<link to="6" input="1" from="5" output="0" />
-		<link to="31" input="0" from="17" output="1" />
-		<link to="34" input="0" from="31" output="0" />
-		<link to="5" input="0" from="34" output="0" />
-		<link to="7" input="0" from="6" output="0" />
-		<link to="26" input="0" from="27" output="1" />
-		<link to="7" input="1" from="26" output="0" />
-		<link to="9" input="0" from="11" output="1" />
-		<link to="12" input="0" from="7" output="0" />
-		<link to="10" input="0" from="9" output="0" />
-		<link to="12" input="1" from="8" output="0" />
-		<link to="8" input="0" from="10" output="0" />
-		<link to="40" input="1" from="12" output="0" />
-		<link to="41" input="0" from="40" output="0" />
-		<link to="13" input="1" from="14" output="1" />
-		<link to="15" input="1" from="13" output="0" />
-		<link to="16" input="1" from="15" output="0" />
-		<link to="40" input="0" from="16" output="0" />
-		<link to="19" input="1" from="39" output="0" />
-		<link to="1" input="1" from="19" output="0" />
-		<link to="20" input="1" from="38" output="0" />
-		<link to="3" input="1" from="20" output="0" />
-		<link to="21" input="1" from="37" output="0" />
-		<link to="4" input="1" from="21" output="0" />
-		<link to="22" input="1" from="36" output="0" />
-		<link to="17" input="1" from="22" output="0" />
-		<link to="24" input="1" from="23" output="0" />
-		<link to="11" input="1" from="24" output="0" />
-		<link to="25" input="1" from="18" output="0" />
-		<link to="14" input="1" from="25" output="0" />
-		<link to="28" input="1" from="29" output="0" />
-		<link to="27" input="1" from="28" output="0" />
-		<link to="19" input="0" from="30" output="0" />
-		<link to="20" input="0" from="30" output="0" />
-		<link to="21" input="0" from="30" output="0" />
-		<link to="22" input="0" from="30" output="0" />
-		<link to="28" input="0" from="30" output="0" />
-		<link to="25" input="0" from="30" output="0" />
-		<link to="24" input="0" from="30" output="0" />
-		<link to="42" input="2" from="41" output="0" />
-		<link to="33" input="0" from="32" output="0" />
-		<link to="31" input="1" from="33" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/fools_gold.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/fools_gold.jpg
deleted file mode 100644
index b76bdf5..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/fools_gold.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/galvanized_steel.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/galvanized_steel.bcm
deleted file mode 100644
index 5838eb9..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/galvanized_steel.bcm
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="878, 186" />
-		<node type="MIX_SHADER" fac="0.5" loc="592, 198" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.86666, 1.0, 1.0, 1.0)" roughness="0.20000" loc="390, 315" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.20000" loc="396, 109" />
-		<node type="MATH" operation="DIVIDE" use_clamp="False" value1="0.5" value2="5.0" loc="182, 188" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="15.0" loc="-702, -28" />
-		<node type="RGBTOBW" color="rgba(0.5, 0.5, 0.5, 1.0)" loc="-221, -66" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="0.5" loc="-19, -32" />
-		<node type="TEX_NOISE" scale="10.0" detail="2.0" distortion="0.0" loc="-687, 259" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="15.0" value2="4.0" loc="-893, 268" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.75" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-479, -20" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="-64, 307" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="1.0" loc="-271, 56" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Scale" value="15.0" loc="-1242, 75" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="1" output="0" />
-		<link to="3" input="1" from="4" output="0" />
-		<link to="11" input="0" from="12" output="0" />
-		<link to="4" input="0" from="11" output="0" />
-		<link to="1" input="1" from="2" output="0" />
-		<link to="1" input="2" from="3" output="0" />
-		<link to="2" input="1" from="4" output="0" />
-		<link to="3" input="0" from="7" output="0" />
-		<link to="7" input="0" from="6" output="0" />
-		<link to="10" input="1" from="8" output="0" />
-		<link to="10" input="2" from="5" output="0" />
-		<link to="12" input="0" from="10" output="0" />
-		<link to="6" input="0" from="10" output="0" />
-		<link to="8" input="1" from="9" output="0" />
-		<link to="9" input="0" from="13" output="0" />
-		<link to="5" input="1" from="13" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/galvanized_steel.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/galvanized_steel.jpg
deleted file mode 100644
index ad8ff45..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/metals/galvanized_steel.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/forest.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/forest.bcm
deleted file mode 100644
index 683282d..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/forest.bcm
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="BSDF_DIFFUSE" color="rgba(0.07457, 0.07457, 0.07457, 1.0)" roughness="0.0" loc="653, 127" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="300.0" loc="655, 6" />
-		<node type="OUTPUT_MATERIAL" loc="3169, 115" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.0, 0.15665, 0.0, 1.0)" roughness="1.0" loc="-358, 276" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.01193, 0.02232, 0.0, 1.0)" roughness="0.0" loc="-364, 166" />
-		<node type="MIX_SHADER" fac="0.5" loc="76, 296" />
-		<node type="MIX_SHADER" fac="0.5" loc="142, -51" />
-		<node type="MIX_SHADER" fac="0.5" loc="362, 387" />
-		<node type="TEX_NOISE" scale="75.0" detail="2.0" distortion="0.0" loc="-366, 464" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.01066, 0.02866, 0.00134, 1.0)" roughness="1.0" loc="-282, -179" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(1.0, 1.0, 1.0, 1.0)" color2="rgba(0.0, 0.0, 0.0, 1.0)" loc="952, 303" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="0.19999" contrast="1.0" loc="769, 417" />
-		<node type="TEX_NOISE" scale="10.0" detail="5.0" distortion="1.0" loc="530, 545" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="250.0" loc="1103, -226" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.08599, 0.19126, 0.00800, 1.0)" roughness="1.0" loc="-285, -301" />
-		<node type="MIX_SHADER" fac="0.5" loc="1355, 217" />
-		<node type="TEX_NOISE" scale="15.0" detail="5.0" distortion="0.0" loc="1386, 54" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="0.0" contrast="1.0" loc="1574, -19" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.0, 0.0, 0.0, 1.0)" color2="rgba(1.0, 1.0, 1.0, 1.0)" loc="1735, 547" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="1765, -133" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.0, 0.0, 0.0, 1.0)" color2="rgba(1.0, 1.0, 1.0, 1.0)" loc="2217, 3" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.01405, 0.03752, 0.01255, 1.0)" roughness="1.0" loc="64, 137" />
-		<node type="TEX_NOISE" scale="100.0" detail="2.0" distortion="5.0" loc="74, 532" />
-		<node type="MIX_SHADER" fac="0.5" loc="1956, 336" />
-		<node type="TEX_NOISE" scale="10.0" detail="5.0" distortion="0.5" loc="1296, 683" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="2.0" contrast="20.0" loc="1523, 638" />
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="2.0" contrast="20.0" loc="2054, 46" />
-		<node type="TEX_NOISE" scale="10.0" detail="5.0" distortion="0.5" loc="1880, 138" />
-		<node type="HUE_SAT" hue="0.5" saturation="1.0" value="500.0" fac="1.0" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" loc="1961, -95" />
-		<node type="TEX_NOISE" scale="300.0" detail="5.0" distortion="0.0" loc="1092, -25" />
-		<node type="INVERT" fac="1.0" color="rgba(0.0, 0.0, 0.0, 1.0)" loc="2494, -41" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.0, 0.0, 0.0, 1.0)" color2="rgba(1.0, 1.0, 1.0, 1.0)" loc="2370, -135" />
-		<node type="TEX_NOISE" scale="50.0" detail="5.0" distortion="0.0" loc="-355, 15" />
-	</nodes>
-	<links>
-		<link to="2" input="0" from="23" output="0" />
-		<link to="2" input="2" from="30" output="0" />
-		<link to="5" input="1" from="3" output="0" />
-		<link to="5" input="2" from="4" output="0" />
-		<link to="7" input="1" from="5" output="0" />
-		<link to="7" input="2" from="21" output="0" />
-		<link to="6" input="1" from="9" output="0" />
-		<link to="6" input="2" from="14" output="0" />
-		<link to="15" input="1" from="7" output="0" />
-		<link to="15" input="2" from="6" output="0" />
-		<link to="11" input="0" from="12" output="1" />
-		<link to="15" input="0" from="10" output="0" />
-		<link to="10" input="0" from="11" output="0" />
-		<link to="5" input="0" from="8" output="1" />
-		<link to="7" input="0" from="22" output="1" />
-		<link to="6" input="0" from="32" output="1" />
-		<link to="19" input="1" from="29" output="1" />
-		<link to="19" input="2" from="13" output="1" />
-		<link to="28" input="4" from="19" output="0" />
-		<link to="17" input="0" from="16" output="1" />
-		<link to="19" input="0" from="17" output="0" />
-		<link to="23" input="2" from="15" output="0" />
-		<link to="25" input="0" from="24" output="1" />
-		<link to="23" input="0" from="18" output="0" />
-		<link to="18" input="0" from="25" output="0" />
-		<link to="26" input="0" from="27" output="1" />
-		<link to="20" input="0" from="26" output="0" />
-		<link to="31" input="0" from="20" output="0" />
-		<link to="30" input="1" from="31" output="0" />
-		<link to="31" input="2" from="28" output="0" />
-		<link to="23" input="1" from="0" output="0" />
-		<link to="31" input="1" from="1" output="1" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/forest.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/forest.jpg
deleted file mode 100644
index 81b2db0..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/forest.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/lava.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/lava.bcm
deleted file mode 100644
index cf89843..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/lava.bcm
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.5" loc="87, 374" />
-		<node type="EMISSION" color="rgba(0.54981, 0.25838, 0.0, 1.0)" strength="1.0" loc="-100, 422" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="3.0" loc="-315, 423" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.25" loc="-321, 208" />
-		<node type="MIX_SHADER" fac="0.25" loc="-98, 291" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.75" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-317, 68" />
-		<node type="INVERT" fac="1.0" color="rgba(0.0, 0.0, 0.0, 1.0)" loc="-511, 26" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="5.0" loc="-709, 153" />
-		<node type="TEX_COORD" loc="-941, 183" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="50.0" loc="-709, 316" />
-		<node type="OUTPUT_MATERIAL" loc="285, 296" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.10000, 0.10000, 0.10000, 1.0)" roughness="0.0" loc="-317, 319" />
-	</nodes>
-	<links>
-		<link to="2" input="0" from="7" output="1" />
-		<link to="4" input="1" from="11" output="0" />
-		<link to="0" input="1" from="1" output="0" />
-		<link to="1" input="1" from="2" output="0" />
-		<link to="0" input="2" from="4" output="0" />
-		<link to="4" input="2" from="3" output="0" />
-		<link to="7" input="0" from="8" output="3" />
-		<link to="9" input="0" from="8" output="3" />
-		<link to="6" input="1" from="7" output="1" />
-		<link to="5" input="2" from="6" output="0" />
-		<link to="5" input="1" from="9" output="1" />
-		<link to="10" input="2" from="5" output="0" />
-		<link to="10" input="0" from="0" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/lava.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/lava.jpg
deleted file mode 100644
index 3836ed3..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/lava.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/pearl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/pearl.bcm
deleted file mode 100644
index 759721a..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/pearl.bcm
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.76051, 0.76051, 0.56025)" sample_lamp="True">
-	<nodes>
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 0.99220, 0.81102, 1.0)" roughness="0.05000" loc="-556, 423" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.5" loc="-572, 29" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="-572, -148" />
-		<node type="MIX_SHADER" fac="0.5" loc="-41, 177" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" loc="-34, -3" />
-		<node type="MIX_SHADER" fac="0.5" loc="-291, 33" />
-		<node type="MIX_SHADER" fac="0.5" loc="-289, 253" />
-		<node type="BSDF_DIFFUSE" color="rgba(1.0, 0.99220, 0.81102, 1.0)" roughness="0.0" loc="-569, 231" />
-		<node type="MIX_SHADER" fac="0.10000" loc="191, 130" />
-		<node type="OUTPUT_MATERIAL" loc="451, 150" />
-	</nodes>
-	<links>
-		<link to="9" input="0" from="8" output="0" />
-		<link to="3" input="1" from="6" output="0" />
-		<link to="6" input="1" from="0" output="0" />
-		<link to="8" input="1" from="3" output="0" />
-		<link to="6" input="2" from="7" output="0" />
-		<link to="5" input="1" from="1" output="0" />
-		<link to="5" input="2" from="2" output="0" />
-		<link to="3" input="2" from="5" output="0" />
-		<link to="8" input="2" from="4" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/pearl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/pearl.jpg
deleted file mode 100644
index 162b98f..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/nature/pearl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/barbwire_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/barbwire_osl.bcm
deleted file mode 100644
index 071aa86..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/barbwire_osl.bcm
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="SCRIPT" mode="INTERNAL" script="0" width="0.05000" turns="2" spiketurns="2" xscale="1.0" pos="Vector(0.0, 0.0, 0.0)" loc="-219, 356" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="-224, 120" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.48658, 0.48658, 0.48658, 1.0)" roughness="0.20000" loc="-222, 41" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(15.0, 15.0, 15.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-503, 315" />
-		<node type="TEX_COORD" dupli="False" loc="-702, 259" />
-		<node type="MIX_SHADER" fac="0.5" loc="-31, 231" />
-		<node type="OUTPUT_MATERIAL" loc="165, 323" />
-	</nodes>
-	<links>
-		<link to="6" input="0" from="5" output="0" />
-		<link to="6" input="2" from="0" output="1" />
-		<link to="5" input="0" from="0" output="0" />
-		<link to="0" input="4" from="3" output="0" />
-		<link to="3" input="0" from="4" output="2" />
-		<link to="5" input="1" from="1" output="0" />
-		<link to="5" input="2" from="2" output="0" />
-	</links>
-	<scripts>
-		<script name="MABarbWire.osl" id="0">
-/*<br />    Barbwire shader by Michel J. Anders (c)2012<br />    license: cc-by-sa<br />    http://blenderthings.blogspot.com.au/2012/12/a-barbwire-osl-shader-for-blender-cycles.html<br />*/<br /><br />#include "stdosl.h"<br /><br />float arc(float r){ return sqrt(0.25-(r-0.5)*(r-0.5)); }<br /><br />shader barbwire(<br />        float Width = 0.05,<br />        int Turns = 2,<br />        int Spiketurns = 2,<br />        float Xscale = 1,<br />        point Pos = P,<br />        output float Fac = 0,<br />        output float Displ = 0 )<br />{<br />    float x = mod(Pos[0],1);<br />    float y = mod(Pos[1],1);<br /><br />    if ( x > 0.5 ) {<br />        x = 1 - x;<br />        y = 1 - y;<br />    }<br /><br />    float w = Width/2;<br />    float t = M_2PI*x*Turns;<br /><br />    float c = cos(t);<br />    float h = c*w+w;<br />    float l = c*w-w;<br /><br />    y -= 0.5;<br />    // the barb part<br />    float BWidth = Width*Xscale;<br />    float Lw = BWidth*(Spiketurns-1);<br />    float Hw = BWidth*Spiketurns;<br />    if ( x > Lw && x < Hw && y > 1.5*Width && y<4*Width ) { // the spikey part<br />        if( y<3*Width || y-3*Width < x-Width){<br />            Fac = 1;<br />            Displ = arc(mod(x,BWidth)/BWidth);<br />        }<br />    } else if ( x < Hw && abs(y) < 2*Width ){<br />        if ( abs(y) > 1.5*Width) { // the rounded top and bottom parts<br />            if ( abs(y) - 1.5*Width < w*arc(mod(x,BWidth)/BWidth) ){<br />                Fac = 1;<br />                Displ = arc(mod(x,BWidth)/BWidth);<br />            }<br />        } else { // the main part<br />            Fac = 1;<br />            Displ = arc(mod(x,BWidth)/BWidth);<br />        }<br />    }<br />    // the wire part<br />    else {<br />        // alternating top/bottom checks to get correct crossings<br />        if ( (int)(t/M_PI) % 2 == 1 ){<br /><br />            if ( y > l && y < h ) {<br />                Fac = 1;<br />                Displ = arc((y-l)/Width);<br />            } else if ( -y > l && -y < h ) {<br />                Fac = 1;<br />                Displ = arc((-y-l)/Width);<br />            }<br /><br />        } else {<br /><br />            if ( -y > l && -y < h ) {<br />                Fac = 1;<br />                Displ = arc((-y-l)/Width);<br />            } else if ( y > l && y < h ) {<br />                Fac = 1;<br />                Displ = arc((y-l)/Width);<br />            }<br />        }<br />    }<br />}<br /><br />
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/barbwire_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/barbwire_osl.jpg
deleted file mode 100644
index 7ac7dfd..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/barbwire_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/chain_link_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/chain_link_osl.bcm
deleted file mode 100644
index c174784..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/chain_link_osl.bcm
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(30.0, 30.0, 30.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-718, 291" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" vector="Vector(0.0, 0.0, 0.0)" width="0.05000" loc="-417, 331" />
-		<node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="-415, 151" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(0.47248, 0.47248, 0.47248, 1.0)" roughness="0.30000" loc="-423, 64" />
-		<node type="TEX_COORD" dupli="False" loc="-942, 196" />
-		<node type="OUTPUT_MATERIAL" loc="-58, 331" />
-		<node type="MIX_SHADER" fac="0.5" loc="-233, 233" />
-	</nodes>
-	<links>
-		<link to="5" input="2" from="1" output="1" />
-		<link to="5" input="0" from="6" output="0" />
-		<link to="6" input="0" from="1" output="0" />
-		<link to="6" input="1" from="2" output="0" />
-		<link to="1" input="0" from="0" output="0" />
-		<link to="0" input="0" from="4" output="2" />
-		<link to="6" input="2" from="3" output="0" />
-	</links>
-	<scripts>
-		<script name="MAChainLink.osl" id="0">
-/*<br />    Chainlink shader by Michel J. Anders (c)2012<br />    license: cc-by-sa<br />    http://blenderthings.blogspot.com.au/2012/12/a-chainlink-fence-osl-shader-for.html<br />*/<br /><br />#include "stdosl.h"<br /><br />float arc(float x){ return sqrt(1-(x-0.5)*(x-0.5)/0.25); }<br /><br />shader chainlink(<br />        point Vector = P,<br />        float Width = 0.05,<br />        output float Fac = 0,<br />        output float Displ = 0<br />){<br />    float x = mod(Vector[0],1);<br />    float y = mod(Vector[1],1);<br />    float ox = x ;<br />    float oy = y ;<br />    x += Width * (0.5 - oy );<br />    y -= Width * (ox - 0.5 );<br /><br />    if ( y > 0.5 ){<br />        y = 1 - y;<br />        x = 1 - x;<br />    }<br />    if ( x > 0.5 ){<br />        if ( y > 0.5 - Width ){<br />            Fac = 1;<br />            Displ = arc((y-(0.5-Width))/Width);<br />        }else if (x < 0.5 + Width) {<br />            Fac = 1;<br />            Displ = arc((x-0.5)/Width);<br />        }else{<br />            float r = hypot(x-0.5,y-0.5);<br />            if (r < Width) {<br />                Fac = 1;<br />                Displ = arc(r/Width);<br />            }<br />        }<br />    }<br />}<br /><br />
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/chain_link_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/chain_link_osl.jpg
deleted file mode 100644
index e2a35de..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/chain_link_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/hex_tile_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/hex_tile_osl.bcm
deleted file mode 100644
index c14444e..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/hex_tile_osl.bcm
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="17, 420" />
-		<node type="TEX_COORD" dupli="False" loc="-885, 347" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" vector="Vector(0.0, 0.0, 0.0)" diffuseamt="0.70000" specularamt="0.10000" roughness="0.19999" specularcolor="rgba(1.0, 1.0, 1.0, 1.0)" tilecolor="rgba(0.55000, 0.04777, 0.06694, 1.0)" mortarcolor="rgba(0.12053, 0.13075, 0.39999, 1.0)" tileradius="0.20000" mortarwidth="0.01999" tilevary="1.0" scuffing="0.70000" scufffrequency="4.0" scuffcolor="rgba(0.05000, 0.05000, 0.05000, 1.0)" stains="0.60000" stainfrequency="2.0" loc="-269, 467" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(10.0, 10.0, 10.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-626, 392" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="2" output="0" />
-		<link to="2" input="0" from="3" output="0" />
-		<link to="3" input="0" from="1" output="2" />
-	</links>
-	<scripts>
-		<script name="LGHexTile.osl" id="0">
-/*<br /> * hextile.sl -- surface shader for hexagonal tiles in st space<br /> *<br /> * DESCRIPTION<br /> *       This surface shader operates in s-t space and gives a pattern of<br /> *    hexagonal tiles, similar to that found as floor patterns in public<br /> *    places and such.<br /> *       The basic pattern is a hexagonal tiling, with a little bit of<br /> *    color variation from tile to tile.  On top of that is some staining<br /> *    (presumably due to water or something), which darkens the tile or<br /> *    mortar underneath it.  Finally, there is Scuffing due to people's<br /> *    shoes, which really only affects the tile part not the mortar part.<br /> *<br /> *<br /> * PARAMTERS<br /> *    DiffuseAmt, SpecularAmt, Roughness, SpecularColor - work just like plastic<br /> *    TileColor - the color of the tiles<br /> *    MortarColor - the color of the mortar (space between the tiles)<br /> *    TileRadius - the "radius" (in s-t units) of a single tile<br /> *    MortarWidth - the width of the mortar (in s-t units)<br /> *    TileVary - the color variance from tile to tile<br /> *<br /> * ANTIALIASING<br /> *    Some rudimentary antialiasing is performed on the borders between<br /> *    tile and mortar.<br /> *<br /> * HINTS & APPLICATIONS<br /> *    If all of the default parameters are used, the tiles look just like<br /> *    the floors in the public areas of the Washington DC subway system.<br /> *<br /> * AUTHOR: written by Larry Gritz, 1994<br /> *<br /> * HISTORY:<br /> *    15 Feb 1994 -- written by lg<br /> *       Dec 2012 -- converted/hacked to OSL by varkenvarken<br /> *    17 Dec 2012 -- rename inputs by SAmbler<br /> *<br /> * last modified 15 Feb 94 by Larry Gritz<br /> */<br /><br />shader<br />LGHexTile (<br />    point Vector = P,<br />    float DiffuseAmt = .5,<br />    float SpecularAmt = .2,<br />    float Roughness = .1,<br />    color SpecularColor = 1,<br />    color TileColor = color(.55,0,0),<br />    color MortarColor = color(.5,.5,.5),<br />    float TileRadius = 0.2,<br />    float MortarWidth = 0.02,<br />    float TileVary = 0.15,<br />    float Scuffing = 0.5,<br />    float ScuffFrequency = 4,<br />    color ScuffColor = color (.05,.05,.05),<br />    float Stains = 0.4,<br />    float StainFrequency = 2,<br />    output closure color BSDF = diffuse(N)<br />)<br />{<br />    #define snoise(x) (2*noise(x)-1)<br />    #define snoise2(x,y) (2*noise((x),(y))-1)<br />    #define MINFILTERWIDTH 1.0e-7<br />    #define M_SQRT3 1.7320508 /* sqrt(3) */<br />    <br />    point Nf;<br />    color Ct, Ctile;<br />    float tilewidth;<br />    float ss, tt;<br />    float ttile, stile;<br />    float x, y;<br />    float mortar;<br />    float swidth, twidth, sfuzz, tfuzz, fuzzmax;<br />    float mw2, mw2srt3;<br />    float tileindex;<br />    float stain, scuff;<br />    float ks;<br /><br />    float s = Vector[0];<br />    float t = Vector[1];<br /><br />    swidth = abs(Dx(s)) + abs(Dy(s));<br />    twidth = abs(Dx(t)) + abs(Dy(t));<br />    sfuzz = 0.5 * swidth;<br />    tfuzz = 0.5 * twidth;<br />    fuzzmax = max(sfuzz, tfuzz);<br />    Nf = N;<br /><br />    tilewidth = TileRadius * M_SQRT3;<br />    tt = mod (t, 1.5*TileRadius);<br />    ttile = floor(t/(1.5*TileRadius));<br />    if (mod(ttile/2, 1) == 0.5)<br />       ss = s + tilewidth/2;<br />    else ss = s;<br />    stile = floor(ss / tilewidth);<br />    ss = mod(ss, tilewidth);<br />    mortar = 0;<br />    mw2 = MortarWidth/2;<br />    if (tt < TileRadius) {<br />      mortar =  1 - (smoothstep(mw2,mw2+sfuzz,ss) *<br />             (1 - smoothstep(tilewidth-mw2-sfuzz,tilewidth-mw2,ss)));<br />    }<br />    else {<br />      x = tilewidth/2 - abs(ss - tilewidth/2);<br />      y = M_SQRT3 * (tt - TileRadius);<br />      if (y > x) {<br />      if (mod (ttile/2, 1) == 0.5)<br />          stile -= 1;<br />      ttile += 1;<br />      if (ss > tilewidth/2)<br />          stile += 1;<br />    }<br /><br />        mw2srt3 = M_SQRT3*mw2;<br />        mortar = (smoothstep(x-mw2srt3-tfuzz, x-mw2srt3, y) *<br />            (1 - smoothstep(x+mw2srt3, x+mw2srt3+tfuzz, y)));<br />    }<br /><br />    tileindex = stile+41*ttile;<br />    Ctile = TileColor * (1 + TileVary * snoise(tileindex+0.5));<br /><br />    stain = Stains * smoothstep (.5,1, noise(s*StainFrequency,t*StainFrequency));<br /><br />    scuff = Scuffing * smoothstep (.6,1, noise(t*ScuffFrequency-90.26,s*ScuffFrequency+123.82));<br /><br />    ks = SpecularAmt * (1-scuff/2);<br />    Ct = (1-stain) * mix(mix(Ctile, ScuffColor, scuff), MortarColor, mortar);<br /><br />    Nf = normalize(N);<br />    BSDF = Ct*DiffuseAmt*diffuse(Nf);<br />    BSDF += SpecularColor*ks*microfacet_beckmann(Nf,Roughness);<br />}<br /><br />
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/hex_tile_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/hex_tile_osl.jpg
deleted file mode 100644
index 80519d6..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/hex_tile_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/sierpinski_squares_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/sierpinski_squares_osl.bcm
deleted file mode 100644
index 5743419..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/sierpinski_squares_osl.bcm
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="BRIGHTCONTRAST" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="-0.05000" contrast="0.30000" loc="223, 395" />
-		<node type="TANGENT" direction="RADIAL" axis="Y" loc="199, 258" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(1.0, 0.89999, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-659, 401" />
-		<node type="TEX_COORD" dupli="False" loc="-889, 332" />
-		<node type="VALTORGB" interpolation="LINEAR" fac="0.5" stops="8" stop1="0.0|rgba(0.42573, 0.38247, 0.05731, 1.0)" stop2="0.25|rgba(0.25, 0.20410, 0.0, 1.0)" stop3="0.5|rgba(0.5, 0.0, 0.05438, 1.0)" stop4="0.625|rgba(0.0, 0.17271, 0.02292, 1.0)" stop5="0.75|rgba(0.50702, 0.0, 0.52719, 1.0)" stop6="0.875|rgba(0.17083, 0.14998, 0.16761, 1.0)" stop7="0.9375|rgba(0.08121, 0.42573, 0.0, 1.0)" stop8="1.0|rgba(0.14220, 0.14909, 0.44060, 1.0)" loc="-67, 357" />
-		<node type="OUTPUT_MATERIAL" loc="733, 388" />
-		<node type="BSDF_ANISOTROPIC" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.09999" anisotropy="0.80000" rotation="0.49999" loc="411, 402" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" zoom="0.05000" vector="Vector(0.0, 0.0, 0.0)" maxiterations="6.0" loc="-379, 400" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="4" output="0" />
-		<link to="4" input="0" from="7" output="1" />
-		<link to="6" input="0" from="0" output="0" />
-		<link to="7" input="1" from="2" output="0" />
-		<link to="2" input="0" from="3" output="2" />
-		<link to="5" input="0" from="6" output="0" />
-		<link to="6" input="5" from="1" output="0" />
-	</links>
-	<scripts>
-		<script name="sierpinski squares.osl" id="0">
-#include "stdosl.h"<br /><br />float genCheck(vector p, float res)<br />{<br />    return (mod(res * p[0], 1.0) < 0.5 ^ mod(res * p[1], 1.0) < 0.5) ?<br />        0.0 : 1.0;<br />}<br /><br />shader sierpinski_squares(<br />    float Zoom = 1.0,<br />    vector Vector = P,<br />    float MaxIterations = 10.0,<br />    output float Fac = 1.0,<br />    output color ColorOut = 0.8)    <br />{<br />    vector p = Vector/(2.0*Zoom);<br />    float diExp = 1.0;<br />    float result = genCheck(p,1.0);<br /><br />    for(float i = 0.7; i <= MaxIterations; i++)<br />    {<br />        result += genCheck(p,diExp) / i;<br /><br />        diExp *= 2.0;<br />    }<br />    result /= MaxIterations / 2.0;<br /><br />    Fac = result;<br />    ColorOut = color(result,result,result);<br />}<br />
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/sierpinski_squares_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/sierpinski_squares_osl.jpg
deleted file mode 100644
index 835c296..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/patterns/sierpinski_squares_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/plastics/toy_brick_red.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/plastics/toy_brick_red.bcm
deleted file mode 100644
index 41f0350..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/plastics/toy_brick_red.bcm
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.99730, 0.01052, 0.01052)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="520, 292" />
-		<node type="MIX_SHADER" fac="0.87999" loc="320, 292" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.67269, 0.19188, 0.19725, 1.0)" roughness="0.11998" loc="120, 292" />
-		<node type="MIX_SHADER" fac="0.05000" loc="116, 157" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.74998, 0.22974, 0.23562, 1.0)" loc="-83, 13" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.91029, 0.00455, 0.00455, 1.0)" roughness="0.11999" loc="-80, 148" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="1" output="0" />
-		<link to="1" input="1" from="2" output="0" />
-		<link to="1" input="2" from="3" output="0" />
-		<link to="3" input="1" from="5" output="0" />
-		<link to="3" input="2" from="4" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/plastics/toy_brick_red.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/plastics/toy_brick_red.jpg
deleted file mode 100644
index 796fcbe..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/plastics/toy_brick_red.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/dragon_scales_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/dragon_scales_osl.bcm
deleted file mode 100644
index 48f6e44..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/dragon_scales_osl.bcm
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="VALTORGB" interpolation="EASE" fac="0.5" stops="4" stop1="0.00454|rgba(0.00891, 0.04817, 0.00561, 1.0)" stop2="0.11817|rgba(1.0, 1.0, 1.0, 1.0)" stop3="0.81362|rgba(0.79909, 0.43964, 0.13562, 1.0)" stop4="1.0|rgba(0.00903, 0.06681, 0.0, 1.0)" loc="424, 643" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.20000" loc="727, 475" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="729, 610" />
-		<node type="MIX_SHADER" fac="0.11998" loc="927, 553" />
-		<node type="OUTPUT_MATERIAL" loc="1102, 446" />
-		<node type="TEX_MAGIC" depth="2" scale="0.5" distortion="1.0" loc="472, 427" />
-		<node type="TEX_MUSGRAVE" musgrave="FBM" scale="0.48800" detail="4.80000" dimension="2.0" lacunarity="1.0" offset="0.0" gain="1.0" loc="233, 619" />
-		<node type="INVERT" fac="1.0" color="rgba(0.0, 0.0, 0.0, 1.0)" loc="133, 359" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" diffuse_color1="rgba(0.20000, 0.80000, 0.20000, 1.0)" diffuse_color2="rgba(0.80000, 0.20000, 0.20000, 1.0)" coordinates="Vector(0.0, 0.0, 0.0)" n="0.09999" loc="-67, 618" />
-		<node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(60.0, 60.0, 60.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-234, 567" />
-		<node type="TEX_COORD" dupli="False" loc="-468, 574" />
-	</nodes>
-	<links>
-		<link to="8" input="2" from="9" output="0" />
-		<link to="6" input="0" from="8" output="3" />
-		<link to="4" input="0" from="3" output="0" />
-		<link to="3" input="1" from="2" output="0" />
-		<link to="3" input="2" from="1" output="0" />
-		<link to="2" input="0" from="0" output="0" />
-		<link to="0" input="0" from="6" output="1" />
-		<link to="4" input="2" from="7" output="0" />
-		<link to="6" input="1" from="8" output="1" />
-		<link to="7" input="1" from="8" output="2" />
-		<link to="1" input="0" from="5" output="0" />
-		<link to="9" input="0" from="10" output="0" />
-	</links>
-	<scripts>
-		<script name="MAscales.osl" id="0">
-<br />/*<br />    scales shader by Michel J. Anders (c)2012<br />    license: cc-by-sa<br />    http://blenderthings.blogspot.co.uk/2012/11/a-scales-osl-shader-for-blender.html<br />*/<br /><br />#include "stdosl.h"<br /><br />shader MAscales(<br />    color Diffuse_Color1 = color(0.2, 0.8, 0.2),<br />    color Diffuse_Color2 = color(0.8, 0.2, 0.2),<br />    vector Coordinates = 0,<br />    float n = 0,<br />    output color Color = 0,<br />    output int Index = 1,<br />    output float Distance = 0,<br />    output vector Vindex = 0)<br />{<br />    float sx = mod(Coordinates[0],1);<br />    float sy = mod(Coordinates[1],1);<br />    <br />    vector p  = vector(sx,sy,0);<br />    vector p0 = vector(0.5,0,0);<br />    vector p1 = vector(0.5,1,0);<br />    vector p2 = vector(0,0.5,0);<br />    vector p3 = vector(1,0.5,0);<br />    <br />    vector cell = vector(floor(Coordinates[0]),floor(Coordinates[1]),0);<br />    int oddx = int(cell[0])%2;<br />    int oddy = int(cell[1])%2;<br />    <br />    float dist(vector a, vector b, float n){<br />        float x = b[0]-a[0];<br />     float y = b[1]-a[1];<br />     float r2 = x*x+y*y;<br />     if ( n != 0.0 ) {<br />            float theta = atan2(y,x);<br />         float cost, sint;<br />            sincos(theta, sint, cost);<br />         float cost2= cos(theta*2);<br />         float Y = pow(abs(sint),1+n*(1-cost2*cost2));<br />         r2 /= cost*cost+Y*Y;<br />        }<br />        return sqrt(r2);<br />    }<br />    <br />    float d1 = dist(p,p0,n);<br />    if ( d1<=0.5 ){<br />        Color = Diffuse_Color1;<br />        Index = 0 ;<br />        Distance = d1;<br />        Vindex = cell + p0;<br />    } else {<br />        float d2 = dist(p,p2,n);<br />        float d3 = dist(p,p3,n);<br />        if ( d2 <= 0.5 ) {<br />            Color = Diffuse_Color2;<br />            Index = 1;<br />            Distance = d2;<br />            Vindex = cell + p2;<br />        } else if ( d3 <= 0.5 ) {<br />            Color = Diffuse_Color2;<br />            Index = 1;<br />            Distance = d3;<br />            Vindex = cell + p3;<br />        } else {<br />            Color = Diffuse_Color1;<br />            Index = 0;<br />            Distance = dist(p,p1,n);<br />            Vindex = cell + p1;<br />       }<br />    }<br />}<br /><br /><br />		
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/dragon_scales_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/dragon_scales_osl.jpg
deleted file mode 100644
index 5a23a0a..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/dragon_scales_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/pox.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/pox.bcm
deleted file mode 100644
index a2e2e5c..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/pox.bcm
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="572, 314" />
-		<node type="VALTORGB" interpolation="B_SPLINE" fac="0.5" stops="3" stop1="0.0|rgba(1.0, 1.0, 1.0, 1.0)" stop2="0.09772|rgba(0.0, 0.0, 0.0, 1.0)" stop3="0.15454|rgba(0.0, 0.0, 0.0, 1.0)" loc="-1016, 194" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.86315, 0.73791, 0.65140, 1.0)" roughness="0.0" loc="-817, 539" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.13812, 0.12151, 1.0)" roughness="0.30000" loc="-474, 186" />
-		<node type="RGBTOBW" color="rgba(0.5, 0.5, 0.5, 1.0)" loc="-119, 17" />
-		<node type="MIX_SHADER" fac="0.20000" loc="-212, 252" />
-		<node type="MIX_SHADER" fac="0.5" loc="-14, 419" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.30000" loc="34, 69" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="10.0" loc="-1255, 93" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.86315, 0.73791, 0.65140, 1.0)" roughness="0.30000" loc="-864, 409" />
-		<node type="MIX_SHADER" fac="0.10000" loc="-397, 491" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.13812, 0.12151, 1.0)" roughness="0.10000" loc="-598, 23" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="6" output="0" />
-		<link to="0" input="2" from="7" output="0" />
-		<link to="1" input="0" from="8" output="0" />
-		<link to="4" input="0" from="1" output="0" />
-		<link to="6" input="0" from="1" output="0" />
-		<link to="10" input="1" from="2" output="0" />
-		<link to="6" input="1" from="10" output="0" />
-		<link to="10" input="2" from="9" output="0" />
-		<link to="7" input="0" from="4" output="0" />
-		<link to="5" input="1" from="3" output="0" />
-		<link to="6" input="2" from="5" output="0" />
-		<link to="5" input="2" from="11" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/pox.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/pox.jpg
deleted file mode 100644
index 93e7340..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/skin/pox.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/diamond.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/diamond.bcm
deleted file mode 100644
index ef2d70c..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/diamond.bcm
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.85058, 0.84081, 0.85058)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="1.0" color1="rgba(0.0, 0.0, 1.0, 1.0)" color2="rgba(0.0, 0.0, 1.0, 1.0)" loc="-199, -49" />
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="1.0" color1="rgba(1.0, 0.0, 0.0, 1.0)" color2="rgba(0.0, 0.0, 1.0, 1.0)" loc="-199, 290" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(0.0, 0.0, 1.0, 1.0)" roughness="0.0" ior="1.44000" loc="-51, -51" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(1.0, 0.0, 0.0, 1.0)" roughness="0.0" ior="1.39999" loc="-51, 286" />
-		<node type="ADD_SHADER" loc="128, 236" />
-		<node type="ADD_SHADER" loc="297, 173" />
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="1.0" color1="rgba(0.0, 1.0, 0.0, 1.0)" color2="rgba(0.0, 0.0, 1.0, 1.0)" loc="-199, 119" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.10000" value2="0.10000" loc="-687, 119" />
-		<node type="SEPRGB" image="rgba(1.0, 1.0, 1.0, 1.0)" loc="-334, 119" />
-		<node type="BSDF_GLASS" distribution="BECKMANN" color="rgba(0.0, 1.0, 0.0, 1.0)" roughness="0.0" ior="2.46000" loc="-51, 119" />
-		<node type="ADD_SHADER" loc="466, 119" />
-		<node type="OUTPUT_MATERIAL" loc="642, 119" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="2.46000" value2="0.5" loc="-493, -67" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="2.46000" value2="0.5" loc="-493, 287" />
-	</nodes>
-	<links>
-		<link to="11" input="0" from="10" output="0" />
-		<link to="5" input="0" from="4" output="0" />
-		<link to="10" input="0" from="5" output="0" />
-		<link to="4" input="0" from="3" output="0" />
-		<link to="5" input="1" from="9" output="0" />
-		<link to="10" input="1" from="2" output="0" />
-		<link to="6" input="2" from="8" output="1" />
-		<link to="3" input="0" from="1" output="0" />
-		<link to="9" input="0" from="6" output="0" />
-		<link to="2" input="0" from="0" output="0" />
-		<link to="2" input="2" from="12" output="0" />
-		<link to="3" input="2" from="13" output="0" />
-		<link to="12" input="1" from="7" output="0" />
-		<link to="13" input="1" from="7" output="0" />
-		<link to="0" input="2" from="8" output="2" />
-		<link to="1" input="2" from="8" output="0" />
-	</links>
-</material>
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/diamond.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/diamond.jpg
deleted file mode 100644
index a16a4ff..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/diamond.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/malachite.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/malachite.bcm
deleted file mode 100644
index 340a5ef..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/malachite.bcm
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.08228, 0.33245, 0.09529)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.05000" loc="382, 116" />
-		<node type="MIX_SHADER" fac="0.5" loc="105, 116" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="105, -14" />
-		<node type="LAYER_WEIGHT" blend="0.10000" loc="105, 258" />
-		<node type="GAMMA" color="rgba(1.0, 1.0, 1.0, 1.0)" gamma="0.5" loc="-105, 301" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.08229, 0.33015, 0.09638, 1.0)" roughness="0.0" loc="-324, 116" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.0, 0.0, 0.0, 1.0)" roughness="0.25" loc="-324, -14" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="5.0" loc="-324, 301" />
-		<node type="MATH" operation="DIVIDE" use_clamp="False" value1="200.0" value2="4.0" loc="-613, 116" />
-		<node type="OUTPUT_MATERIAL" loc="590, 116" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="200.0" loc="-613, 301" />
-		<node type="VALUE" value="1.79999" loc="-791, 101" />
-		<node type="TEX_COORD" loc="-988, 301" />
-	</nodes>
-	<links>
-		<link to="9" input="0" from="0" output="0" />
-		<link to="1" input="1" from="5" output="0" />
-		<link to="0" input="1" from="1" output="0" />
-		<link to="1" input="2" from="6" output="0" />
-		<link to="4" input="0" from="7" output="0" />
-		<link to="1" input="0" from="4" output="0" />
-		<link to="0" input="2" from="2" output="0" />
-		<link to="0" input="0" from="3" output="0" />
-		<link to="7" input="0" from="10" output="1" />
-		<link to="7" input="1" from="8" output="0" />
-		<link to="10" input="1" from="11" output="0" />
-		<link to="8" input="0" from="11" output="0" />
-		<link to="10" input="0" from="12" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/malachite.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/malachite.jpg
deleted file mode 100644
index 98f79b6..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/malachite.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/polished_haematite.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/polished_haematite.bcm
deleted file mode 100644
index a9e5699..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/polished_haematite.bcm
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.16230, 0.15524, 0.16953)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="1054, 111" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.02451, 0.02451, 0.02451, 1.0)" roughness="0.0" loc="-197, 192" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.0, 0.0, 0.0, 1.0)" roughness="0.0" loc="-198, 48" />
-		<node type="MIX_SHADER" fac="0.75" loc="115, 181" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.07092, 0.16557, 0.28448, 1.0)" color2="rgba(0.31448, 0.09621, 0.09221, 1.0)" loc="-454, 211" />
-		<node type="TEX_VORONOI" coloring="CELLS" scale="50.0" loc="-736, 301" />
-		<node type="MIX_SHADER" fac="0.10000" loc="814, 122" />
-		<node type="LAYER_WEIGHT" blend="0.5" loc="519, 339" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.57559, 0.57559, 0.57559, 1.0)" roughness="0.0" loc="519, -99" />
-		<node type="MIX_SHADER" fac="0.30000" loc="519, 159" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.22966, 0.22966, 0.22966, 1.0)" roughness="0.10000" loc="115, -17" />
-		<node type="RGB" custom_color="rgb(0.24929, 0.58200, 1.0)" label="Fleck Color" color="rgba(0.07092, 0.16557, 0.28448, 1.0)" loc="-1162, 583" />
-		<node type="VALUE" label="Fleck Scale" value="50.0" loc="-1156, 98" />
-		<node type="RGB" custom_color="rgb(1.0, 0.30594, 0.29320)" label="Fleck Color" color="rgba(0.31448, 0.09621, 0.09221, 1.0)" loc="-1167, 388" />
-		<node type="VALUE" label="Bloom Size" value="0.10000" loc="-738, -90" />
-		<node type="RGB" label="Bloom Color" color="rgba(0.22966, 0.22966, 0.22966, 1.0)" loc="-982, 21" />
-		<node type="VALUE" label="Fresnel" value="0.5" loc="-872, 638" />
-		<node type="VALUE" label="Roughness" value="0.01999" loc="-652, -178" />
-		<node type="VALUE" label="Fleck Amount" value="0.75" loc="-1158, 192" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="6" output="0" />
-		<link to="3" input="1" from="1" output="0" />
-		<link to="4" input="0" from="5" output="1" />
-		<link to="1" input="0" from="4" output="0" />
-		<link to="9" input="1" from="3" output="0" />
-		<link to="3" input="2" from="2" output="0" />
-		<link to="6" input="1" from="9" output="0" />
-		<link to="6" input="2" from="8" output="0" />
-		<link to="6" input="0" from="7" output="0" />
-		<link to="9" input="2" from="10" output="0" />
-		<link to="3" input="0" from="18" output="0" />
-		<link to="4" input="1" from="11" output="0" />
-		<link to="4" input="2" from="13" output="0" />
-		<link to="5" input="1" from="12" output="0" />
-		<link to="10" input="0" from="15" output="0" />
-		<link to="7" input="0" from="16" output="0" />
-		<link to="10" input="1" from="14" output="0" />
-		<link to="8" input="1" from="17" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/polished_haematite.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/polished_haematite.jpg
deleted file mode 100644
index 8ac973c..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/polished_haematite.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/veined_marble_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/veined_marble_osl.bcm
deleted file mode 100644
index d5b7976..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/veined_marble_osl.bcm
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="191, 353" />
-		<node type="MIX_SHADER" fac="0.5" loc="-40, 356" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" vector="Vector(0.0, 0.0, 0.0)" diffuseamt="0.80000" diffusecolor="rgba(1.0, 1.0, 1.0, 1.0)" specularamt="0.20000" roughness="0.00499" specularcolor="rgba(1.0, 1.0, 1.0, 1.0)" veinfreq="1.0" veinlevels="2.0" veincolor="rgba(0.20000, 0.15000, 0.07999, 1.0)" warpfreq="1.0" warping="0.5" sharpness="8.0" loc="-1048, 442" />
-		<node type="TEX_NOISE" scale="20.0" detail="2.0" distortion="50.0" loc="-552, 240" />
-		<node type="MAPPING" translation="Vector(1.0, 0.0, 1.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(1.0, 1.0, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-1157, 30" />
-		<node type="TEX_COORD" dupli="False" loc="-1406, -1" />
-		<node type="TEX_WAVE" wave="RINGS" scale="0.5" distortion="0.10000" detail="2.0" detail_scale="1.0" loc="-752, -30" />
-		<node type="TEX_MUSGRAVE" musgrave="FBM" scale="1.0" detail="2.0" dimension="2.0" lacunarity="1.0" offset="0.0" gain="1.0" loc="-531, -23" />
-		<node type="SCRIPT" mode="INTERNAL" script="1" vector="Vector(0.0, 0.0, 0.0)" diffuseamt="0.89999" diffusecolor="rgba(0.0, 0.0, 0.0, 1.0)" specularamt="0.20000" roughness="0.10000" specularcolor="rgba(0.56471, 0.56471, 0.56471, 1.0)" veinfreq="0.69998" veinlevels="1.60000" veincolor="rgba(0.65837, 0.61720, 0.0, 1.0)" warpfreq="0.60000" warping="0.69998" sharpness="6.0" loc="-255, 252" />
-	</nodes>
-	<links>
-		<link to="1" input="1" from="2" output="0" />
-		<link to="0" input="0" from="1" output="0" />
-		<link to="1" input="2" from="8" output="0" />
-		<link to="7" input="0" from="6" output="0" />
-		<link to="3" input="0" from="6" output="0" />
-		<link to="8" input="2" from="3" output="1" />
-		<link to="8" input="1" from="3" output="0" />
-		<link to="6" input="0" from="4" output="0" />
-		<link to="8" input="0" from="4" output="0" />
-		<link to="4" input="0" from="5" output="3" />
-		<link to="2" input="0" from="5" output="3" />
-		<link to="8" input="8" from="7" output="0" />
-	</links>
-	<scripts>
-		<script name="LGVeinedMarble.osl" id="0">
-<br />/*<br /> * veinedmarble.sl -- surface shader for a nice veined marble.<br /> *<br /> * DESCRIPTION:<br /> *   Makes solid marble texture with strong veins.  The "veincolor" parameter<br /> *   controls the color of the veins.  The background color is given by the<br /> *   surface color (Cs).<br /> * <br /> * PARAMETERS:<br /> *   Ka, Kd, Ks, roughness, specularcolor - same as plastic<br /> *   veinfreq - controls fhe lowest frequency of the color veins<br /> *   veinlevels - how many "levels" of vein tendrills it has<br /> *   warpfreq - lowest frequency of the turbulent warping in the marble<br /> *   warping - controls how much turbulent warping there will be<br /> *   veincolor - the color of the veins<br /> *   sharpness - controls how sharp or fuzzy the veins are (higher = sharper)<br /> *<br /> *<br /> * AUTHOR: Larry Gritz, the George Washington University<br /> *         email: gritz AT seas DOT gwu DOT edu <br /> *<br /> * HISTORY:<br /> *<br /> * last modified  29 Jun 1994 by Larry Gritz<br /> * 2012-12-19 converted to blender osl shader by Shane Ambler<br /> *<br /> */<br /><br /><br />#include "stdosl.h"<br /><br /><br />shader LGVeinedMarble (<br />        point Vector = P,<br />        float DiffuseAmt = 0.8,<br />        color DiffuseColor = color(1.0),<br />        float SpecularAmt = 0.2,<br />        float Roughness = 0.005,<br />        color SpecularColor = color(1.0),<br />        float VeinFreq = 1.0,<br />        float VeinLevels = 2.0,<br />        color VeinColor = color(0.2, 0.15, 0.08),<br />        float WarpFreq = 1.0,<br />        float Warping = 0.5,<br />        float Sharpness = 8.0,<br />        output closure color BSDF = diffuse(N) )<br />{<br />#define snoise(x) (2*noise(x)-1)<br />    color Ct;<br />    point Nf;<br />    point PP, offset;<br />    float i, turb, freq, j;<br />    float turbsum;<br /><br />    PP = transform ("shader", Vector);<br /><br />    /* perturb the lookup */<br />    freq = 1;<br />    offset = 0;<br />    for (i = 0;  i < 6;  i += 1) {<br />        offset += 2 * Warping * ( noise (WarpFreq * freq * PP) - 0.5)  / freq;<br />        freq *= 2;<br />    }<br />    PP += offset;<br /><br />    /* Now calculate the veining function for the lookup area */<br />    turbsum = 0;  freq = 1;<br />    PP *= VeinFreq;<br />    for (i = 0;  i < VeinLevels;  i += 1) {<br />        turb = abs (snoise (PP));<br />        turb = pow (smoothstep (0.8, 1, 1 - turb), Sharpness) / freq;<br />        turbsum += (1-turbsum) * turb;<br />        freq *= 3;<br />        PP *= 3;<br />    }<br /><br />    Ct = mix (DiffuseColor, VeinColor, turbsum);<br /><br />    Nf = normalize(N);<br />    BSDF = Ct * DiffuseAmt * diffuse(Nf);<br />    BSDF += SpecularColor * SpecularAmt * microfacet_beckmann(Nf,Roughness);<br />}<br /><br /><br />		
-		</script>
-		<script name="LGVeinedMarble.osl.002" id="1">
-<br />/*<br /> * veinedmarble.sl -- surface shader for a nice veined marble.<br /> *<br /> * DESCRIPTION:<br /> *   Makes solid marble texture with strong veins.  The "veincolor" parameter<br /> *   controls the color of the veins.  The background color is given by the<br /> *   surface color (Cs).<br /> * <br /> * PARAMETERS:<br /> *   Ka, Kd, Ks, roughness, specularcolor - same as plastic<br /> *   veinfreq - controls fhe lowest frequency of the color veins<br /> *   veinlevels - how many "levels" of vein tendrills it has<br /> *   warpfreq - lowest frequency of the turbulent warping in the marble<br /> *   warping - controls how much turbulent warping there will be<br /> *   veincolor - the color of the veins<br /> *   sharpness - controls how sharp or fuzzy the veins are (higher = sharper)<br /> *<br /> *<br /> * AUTHOR: Larry Gritz, the George Washington University<br /> *         email: gritz AT seas DOT gwu DOT edu <br /> *<br /> * HISTORY:<br /> *<br /> * last modified  29 Jun 1994 by Larry Gritz<br /> * 2012-12-19 converted to blender osl shader by Shane Ambler<br /> *<br /> */<br /><br /><br />#include "stdosl.h"<br /><br /><br />shader LGVeinedMarble (<br />        point Vector = P,<br />        float DiffuseAmt = 0.8,<br />        color DiffuseColor = color(1.0),<br />        float SpecularAmt = 0.2,<br />        float Roughness = 0.005,<br />        color SpecularColor = color(1.0),<br />        float VeinFreq = 1.0,<br />        float VeinLevels = 2.0,<br />        color VeinColor = color(0.2, 0.15, 0.08),<br />        float WarpFreq = 1.0,<br />        float Warping = 0.5,<br />        float Sharpness = 8.0,<br />        output closure color BSDF = diffuse(N) )<br />{<br />#define snoise(x) (2*noise(x)-1)<br />    color Ct;<br />    point Nf;<br />    point PP, offset;<br />    float i, turb, freq, j;<br />    float turbsum;<br /><br />    PP = transform ("shader", Vector);<br /><br />    /* perturb the lookup */<br />    freq = 1;<br />    offset = 0;<br />    for (i = 0;  i < 6;  i += 1) {<br />        offset += 2 * Warping * ( noise (WarpFreq * freq * PP) - 0.5)  / freq;<br />        freq *= 2;<br />    }<br />    PP += offset;<br /><br />    /* Now calculate the veining function for the lookup area */<br />    turbsum = 0;  freq = 1;<br />    PP *= VeinFreq;<br />    for (i = 0;  i < VeinLevels;  i += 1) {<br />        turb = abs (snoise (PP));<br />        turb = pow (smoothstep (0.8, 1, 1 - turb), Sharpness) / freq;<br />        turbsum += (1-turbsum) * turb;<br />        freq *= 3;<br />        PP *= 3;<br />    }<br /><br />    Ct = mix (DiffuseColor, VeinColor, turbsum);<br /><br />    Nf = normalize(N);<br />    BSDF = Ct * DiffuseAmt * diffuse(Nf);<br />    BSDF += SpecularColor * SpecularAmt * microfacet_beckmann(Nf,Roughness);<br />}<br /><br /><br />		
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/veined_marble_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/veined_marble_osl.jpg
deleted file mode 100644
index 2bbf03b..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/stones/veined_marble_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber.bcm
deleted file mode 100644
index 53e8e0d..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber.bcm
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.19176, 0.19176, 0.19176)" sample_lamp="True">
-	<nodes>
-		<node type="TEX_WAVE" wave="BANDS" scale="80.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-482, 181" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-108, 105" />
-		<node type="TEX_COORD" loc="-1132, -8" />
-		<node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(3.0, 1.5, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-711, 160" />
-		<node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 1.57079)" scale="Vector(1.0, 2.0, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-747, -45" />
-		<node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(4.0, 1.0, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-751, -228" />
-		<node type="TEX_WAVE" wave="BANDS" scale="30.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-462, -29" />
-		<node type="BSDF_GLOSSY" distribution="GGX" color="rgba(0.69505, 0.69505, 0.69505, 1.0)" roughness="0.20000" loc="-101, 252" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.04176, 0.04176, 0.04176, 1.0)" color2="rgba(0.00326, 0.00326, 0.00326, 1.0)" loc="-244, 330" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="-103, 351" />
-		<node type="FRESNEL" ior="1.45000" loc="-101, 437" />
-		<node type="MIX_SHADER" fac="0.5" loc="101, 382" />
-		<node type="ADD_SHADER" loc="291, 346" />
-		<node type="OUTPUT_MATERIAL" loc="514, 280" />
-		<node type="BSDF_VELVET" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" sigma="0.20000" loc="95, 256" />
-		<node type="LAYER_WEIGHT" blend="0.5" loc="-426, 298" />
-		<node type="TEX_WAVE" wave="BANDS" scale="80.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-531, -248" />
-		<node type="TEX_CHECKER" color1="rgba(0.80000, 0.80000, 0.80000, 1.0)" color2="rgba(0.20000, 0.20000, 0.20000, 1.0)" scale="100.0" loc="289, 148" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-3, -147" />
-		<node type="TEX_WAVE" wave="BANDS" scale="30.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-264, -66" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Checker Scale" value="100.0" loc="-1003, 385" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.5, 0.5)" label="Large Scale" value="25.0" loc="-1080, 295" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.80000, 0.80000)" label="Small Scale" value="200.0" loc="-1090, 198" />
-	</nodes>
-	<links>
-		<link to="11" input="1" from="9" output="0" />
-		<link to="8" input="0" from="15" output="1" />
-		<link to="9" input="0" from="8" output="0" />
-		<link to="12" input="0" from="11" output="0" />
-		<link to="11" input="0" from="10" output="0" />
-		<link to="13" input="0" from="12" output="0" />
-		<link to="11" input="2" from="7" output="0" />
-		<link to="12" input="1" from="14" output="0" />
-		<link to="13" input="2" from="17" output="0" />
-		<link to="0" input="0" from="4" output="0" />
-		<link to="4" input="0" from="2" output="2" />
-		<link to="3" input="0" from="2" output="2" />
-		<link to="16" input="0" from="5" output="0" />
-		<link to="5" input="0" from="2" output="2" />
-		<link to="6" input="0" from="5" output="0" />
-		<link to="19" input="0" from="4" output="0" />
-		<link to="1" input="1" from="0" output="0" />
-		<link to="1" input="2" from="6" output="0" />
-		<link to="18" input="1" from="19" output="0" />
-		<link to="18" input="2" from="16" output="0" />
-		<link to="17" input="2" from="18" output="0" />
-		<link to="17" input="0" from="3" output="0" />
-		<link to="17" input="1" from="1" output="0" />
-		<link to="6" input="1" from="21" output="0" />
-		<link to="19" input="1" from="21" output="0" />
-		<link to="0" input="1" from="22" output="0" />
-		<link to="16" input="1" from="22" output="0" />
-		<link to="17" input="3" from="20" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber.jpg
deleted file mode 100644
index 013709e..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber_glossy.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber_glossy.bcm
deleted file mode 100644
index ba15bda..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber_glossy.bcm
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.19999, 0.19999, 0.19999)" sample_lamp="True">
-	<nodes>
-		<node type="LAYER_WEIGHT" blend="0.5" loc="-356, 72" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.21049, 0.21049, 0.21049, 1.0)" color2="rgba(0.00326, 0.00326, 0.00326, 1.0)" loc="-186, 88" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="-58, 96" />
-		<node type="BSDF_VELVET" color="rgba(0.53048, 0.53048, 0.53048, 1.0)" sigma="0.10000" loc="-65, 0" />
-		<node type="MIX_SHADER" fac="0.5" loc="113, 161" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.15031, 0.15031, 0.15031, 1.0)" roughness="0.05000" loc="117, 26" />
-		<node type="MIX_SHADER" fac="0.5" loc="293, 86" />
-		<node type="OUTPUT_MATERIAL" loc="476, 82" />
-		<node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(3.0, 1.5, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-1471, 150" />
-		<node type="TEX_WAVE" wave="BANDS" scale="80.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-1242, 171" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-868, 95" />
-		<node type="TEX_COORD" loc="-1892, -18" />
-		<node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 1.57079)" scale="Vector(1.0, 2.0, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-1507, -55" />
-		<node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(4.0, 1.0, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-1511, -238" />
-		<node type="TEX_WAVE" wave="BANDS" scale="30.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-1222, -39" />
-		<node type="TEX_WAVE" wave="BANDS" scale="80.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-1291, -258" />
-		<node type="TEX_WAVE" wave="BANDS" scale="30.0" distortion="0.0" detail="2.0" detail_scale="1.0" loc="-1024, -76" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Checker Scale" value="100.0" loc="-1763, 375" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.5, 0.5)" label="Large Scale" value="25.0" loc="-1840, 285" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.80000, 0.80000)" label="Small Scale" value="200.0" loc="-1850, 188" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-816, -98" />
-		<node type="TEX_CHECKER" color1="rgba(0.80000, 0.80000, 0.80000, 1.0)" color2="rgba(0.20000, 0.20000, 0.20000, 1.0)" scale="100.0" loc="-577, 152" />
-	</nodes>
-	<links>
-		<link to="1" input="0" from="0" output="1" />
-		<link to="2" input="0" from="1" output="0" />
-		<link to="4" input="1" from="2" output="0" />
-		<link to="6" input="1" from="4" output="0" />
-		<link to="7" input="0" from="6" output="0" />
-		<link to="6" input="2" from="5" output="0" />
-		<link to="4" input="2" from="3" output="0" />
-		<link to="9" input="0" from="12" output="0" />
-		<link to="12" input="0" from="11" output="2" />
-		<link to="8" input="0" from="11" output="2" />
-		<link to="15" input="0" from="13" output="0" />
-		<link to="13" input="0" from="11" output="2" />
-		<link to="14" input="0" from="13" output="0" />
-		<link to="16" input="0" from="12" output="0" />
-		<link to="10" input="1" from="9" output="0" />
-		<link to="10" input="2" from="14" output="0" />
-		<link to="20" input="1" from="16" output="0" />
-		<link to="20" input="2" from="15" output="0" />
-		<link to="21" input="2" from="20" output="0" />
-		<link to="21" input="0" from="8" output="0" />
-		<link to="21" input="1" from="10" output="0" />
-		<link to="14" input="1" from="18" output="0" />
-		<link to="16" input="1" from="18" output="0" />
-		<link to="9" input="1" from="19" output="0" />
-		<link to="15" input="1" from="19" output="0" />
-		<link to="21" input="3" from="17" output="0" />
-		<link to="0" input="0" from="21" output="0" />
-		<link to="4" input="0" from="21" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber_glossy.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber_glossy.jpg
deleted file mode 100644
index 2d2d243..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/carbon_fiber_glossy.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/polystyrene_foam.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/polystyrene_foam.bcm
deleted file mode 100644
index 94a6f79..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/polystyrene_foam.bcm
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.94999, 0.97200, 1.0)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="717, 99" />
-		<node type="FRESNEL" ior="1.15999" loc="-90, 264" />
-		<node type="MIX_SHADER" fac="0.0" loc="-93, 175" />
-		<node type="BSDF_TRANSLUCENT" color="rgba(0.85499, 0.87512, 0.89999, 1.0)" loc="-332, 92" />
-		<node type="MATH" hide="True" operation="MULTIPLY" use_clamp="False" value1="16.0" value2="0.03999" loc="543, -7" />
-		<node type="TEX_VORONOI" coloring="INTENSITY" scale="20.0" loc="-329, -135" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.85499, 0.87512, 0.89999, 1.0)" roughness="0.0" loc="-333, 198" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.85499, 0.87512, 0.89999, 1.0)" roughness="0.77999" loc="-90, 47" />
-		<node type="RGB" custom_color="rgb(0.89999, 0.89999, 0.89999)" label="Color" color="rgba(0.85500, 0.87512, 0.89999, 1.0)" loc="-935, 174" />
-		<node type="TEX_NOISE" scale="20.0" detail="0.0" distortion="0.0" loc="-714, 73" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Scale" value="20.0" loc="-899, -71" />
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="0.20000" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.85000, 0.85000, 0.85000, 1.0)" loc="-497, 283" />
-		<node type="MATH" hide="True" operation="DIVIDE" use_clamp="False" value1="-16.0" value2="0.03999" loc="81, -76" />
-		<node type="VALTORGB" interpolation="LINEAR" fac="0.5" stops="2" stop1="0.00909|rgba(1.0, 1.0, 1.0, 1.0)" stop2="0.24545|rgba(1.0, 1.0, 1.0, 0.60000)" loc="88, -132" />
-		<node type="MIX_SHADER" fac="0.20000" loc="399, 152" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="14" output="0" />
-		<link to="14" input="2" from="7" output="0" />
-		<link to="14" input="0" from="1" output="0" />
-		<link to="14" input="1" from="2" output="0" />
-		<link to="2" input="2" from="3" output="0" />
-		<link to="2" input="1" from="6" output="0" />
-		<link to="13" input="0" from="5" output="1" />
-		<link to="5" input="1" from="10" output="0" />
-		<link to="3" input="0" from="8" output="0" />
-		<link to="12" input="1" from="10" output="0" />
-		<link to="4" input="1" from="13" output="1" />
-		<link to="4" input="0" from="12" output="0" />
-		<link to="0" input="2" from="4" output="0" />
-		<link to="9" input="1" from="10" output="0" />
-		<link to="7" input="0" from="8" output="0" />
-		<link to="11" input="1" from="8" output="0" />
-		<link to="6" input="0" from="11" output="0" />
-		<link to="11" input="0" from="9" output="1" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/polystyrene_foam.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/polystyrene_foam.jpg
deleted file mode 100644
index 45b1d1e..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/polystyrene_foam.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/rubber.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/rubber.bcm
deleted file mode 100644
index 1c08cfa..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/rubber.bcm
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.02120, 0.02120, 0.02120)" sample_lamp="True">
-	<nodes>
-		<node type="BSDF_TRANSLUCENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="-178, 225" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.06305, 0.06305, 0.06305, 1.0)" roughness="0.0" loc="-186, 341" />
-		<node type="RGB" color="rgba(0.01164, 0.01164, 0.01164, 1.0)" loc="-551, 376" />
-		<node type="OUTPUT_MATERIAL" loc="300, 300" />
-		<node type="ADD_SHADER" loc="43, 316" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.20000" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(1.0, 1.0, 1.0, 1.0)" loc="-354, 254" />
-	</nodes>
-	<links>
-		<link to="4" input="0" from="1" output="0" />
-		<link to="4" input="1" from="0" output="0" />
-		<link to="1" input="0" from="2" output="0" />
-		<link to="5" input="1" from="2" output="0" />
-		<link to="3" input="0" from="4" output="0" />
-		<link to="0" input="0" from="5" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/rubber.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/rubber.jpg
deleted file mode 100644
index 737661e..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/synthetic/rubber.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/denim.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/denim.bcm
deleted file mode 100644
index d912f5f..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/denim.bcm
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.27171, 0.51361, 0.98764)" sample_lamp="True">
-	<nodes>
-		<node type="RGB" custom_color="rgb(0.66071, 0.73312, 1.0)" label="Denim Color" color="rgba(0.03543, 0.15026, 0.37318, 1.0)" loc="-732, 193" />
-		<node type="TEX_COORD" hide="True" loc="-528, 124" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.30000, 0.30000)" label="Denim Scale" value="40.0" loc="-710, -60" />
-		<node type="TEX_WAVE" hide="True" wave="BANDS" scale="100.0" distortion="0.0" detail="0.0" detail_scale="1.0" loc="-129, -52" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="447, 60" />
-		<node type="OUTPUT_MATERIAL" loc="738, 0" />
-		<node type="BRIGHTCONTRAST" hide="True" color="rgba(1.0, 1.0, 1.0, 1.0)" bright="0.40000" contrast="-0.40000" loc="-202, 146" />
-		<node type="TEX_NOISE" hide="True" scale="100.0" detail="2.0" distortion="0.0" loc="-246, 90" />
-		<node type="MIX_RGB" hide="True" blend_type="MIX" use_clamp="False" fac="0.80000" color1="rgba(0.82981, 0.86596, 1.0, 1.0)" color2="rgba(0.06378, 0.15115, 0.47318, 1.0)" loc="36, 135" />
-		<node type="MIX_RGB" hide="True" blend_type="MIX" use_clamp="False" fac="0.80000" color1="rgba(0.52075, 0.62256, 1.0, 1.0)" color2="rgba(0.06378, 0.15115, 0.47318, 1.0)" loc="259, 92" />
-		<node type="MATH" hide="True" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="2.0" loc="-398, 18" />
-	</nodes>
-	<links>
-		<link to="3" input="0" from="1" output="2" />
-		<link to="5" input="0" from="4" output="0" />
-		<link to="7" input="0" from="1" output="2" />
-		<link to="8" input="2" from="0" output="0" />
-		<link to="6" input="0" from="0" output="0" />
-		<link to="10" input="0" from="2" output="0" />
-		<link to="3" input="1" from="2" output="0" />
-		<link to="7" input="1" from="10" output="0" />
-		<link to="4" input="0" from="9" output="0" />
-		<link to="5" input="2" from="3" output="1" />
-		<link to="9" input="2" from="8" output="0" />
-		<link to="8" input="1" from="6" output="0" />
-		<link to="9" input="1" from="0" output="0" />
-		<link to="9" input="0" from="7" output="1" />
-		<link to="8" input="0" from="3" output="1" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/denim.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/denim.jpg
deleted file mode 100644
index 3e1136d..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/denim.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/hessian_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/hessian_osl.bcm
deleted file mode 100644
index 56b2d6c..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/hessian_osl.bcm
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="546, 298" />
-		<node type="MIX_SHADER" fac="0.20000" loc="326, 327" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="122, 305" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="127, 154" />
-		<node type="TEX_MAGIC" depth="3" scale="10.0" distortion="1.0" loc="-649, -209" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" warpcolor="rgba(0.80000, 0.0, 0.0, 1.0)" weftcolor="rgba(0.0, 0.80000, 0.0, 1.0)" skip="3" underrun="2" overrun="2" warpwidth="0.89999" weftwidth="0.59999" coordinates="Vector(0.0, 0.0, 0.0)" loc="-106, 239" />
-		<node type="VALTORGB" interpolation="LINEAR" fac="0.5" stops="3" stop1="0.0|rgba(0.45888, 0.27226, 0.26589, 1.0)" stop2="0.5|rgba(0.5, 0.22469, 0.15275, 1.0)" stop3="1.0|rgba(1.0, 1.0, 1.0, 1.0)" loc="-418, -82" />
-		<node type="TEX_MUSGRAVE" musgrave="FBM" scale="1.0" detail="2.0" dimension="2.0" lacunarity="1.0" offset="0.0" gain="1.0" loc="-1061, -50" />
-		<node type="VALTORGB" interpolation="LINEAR" fac="0.5" stops="3" stop1="0.0|rgba(0.69454, 0.56581, 0.30919, 1.0)" stop2="0.5|rgba(0.5, 0.41093, 0.17475, 1.0)" stop3="1.0|rgba(1.0, 1.0, 1.0, 1.0)" loc="-850, -3" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(50.0, 50.0, 50.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-591, 277" />
-		<node type="TEX_COORD" dupli="False" loc="-1268, 50" />
-	</nodes>
-	<links>
-		<link to="1" input="1" from="2" output="0" />
-		<link to="0" input="0" from="1" output="0" />
-		<link to="0" input="2" from="5" output="2" />
-		<link to="2" input="0" from="5" output="0" />
-		<link to="3" input="0" from="8" output="0" />
-		<link to="3" input="2" from="5" output="1" />
-		<link to="1" input="2" from="3" output="0" />
-		<link to="6" input="0" from="4" output="1" />
-		<link to="8" input="0" from="7" output="1" />
-		<link to="5" input="1" from="8" output="0" />
-		<link to="5" input="7" from="9" output="0" />
-		<link to="5" input="0" from="6" output="0" />
-		<link to="9" input="0" from="10" output="2" />
-		<link to="7" input="0" from="10" output="2" />
-	</links>
-	<scripts>
-		<script name="fabric.osl.000" id="0">
-<br /><br /><br /><br />// greatest common divisor<br />int gcd(int A, int B){<br />    int a=A, b=B;<br />    if (a == 0) { return b; }<br />    while (b != 0) {<br />        if (a > b) {<br />            a = a - b;<br />        } else {<br />            b = b - a;<br />        }<br />    }<br /> return a;<br />}<br /><br />// smallest common multiple (assumes a, b > 0 )<br />int scm(int a, int b){ return a*b/gcd(a,b); }<br /><br />shader weave(<br /> color WarpColor = color(0.8,0,0),<br /> color WeftColor = color(0,0.8,0),<br /> int skip = 1,<br /> int underrun = 1,<br /> int overrun = 1,<br />        float WarpWidth = 0.8,<br />        float WeftWidth = 0.8,<br /> vector Coordinates = 0,<br /> output color Color = 0,<br /> output int Index = 0,<br />        output float Dist = 0<br />)<br />{<br /> int ny = underrun + overrun;<br /> int nx = scm(skip,ny);<br /> <br /> float x = mod(Coordinates[0],1.0);<br /> float y = mod(Coordinates[1],1.0);<br /> <br /> int ix = int(floor(x*nx));<br /> int iy = int(floor(y*ny));<br /><br />        float cx = mod(x*nx,1.0);<br />        float cy = mod(y*ny,1.0);<br />     <br /> int top;<br /> top = ((iy+skip*ix)%ny) < overrun;<br /><br />        float lx = (1-WarpWidth)/2;<br />        float hx = 1-lx;<br />    float ly = (1-WeftWidth)/2;<br />    float hy = 1-lx;<br /><br />    if (top) {<br />        if ( cx > lx && cx < hx ){<br />            Index = 1;<br />            Color = WarpColor;<br />            Dist = abs(0.5-cx);<br />        } else if (cy > ly && cy < hy ){<br />            Index = 2;<br />            Color = WeftColor;<br />            Dist = abs(0.5-cy);<br />        }<br />    } else {<br />        if (cy > ly && cy < hy ){<br />            Index = 2;<br />            Color = WeftColor;<br />            Dist = abs(0.5-cy);<br />        } else if ( cx > lx && cx < hx ){<br />            Index = 1;<br />            Color = WarpColor;<br />            Dist = abs(0.5-cx);<br />        }<br />    }    <br />}<br /><br />		<br />		<br />		<br />		
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/hessian_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/hessian_osl.jpg
deleted file mode 100644
index ff904f9..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/hessian_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/velvet_edged.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/velvet_edged.bcm
deleted file mode 100644
index 00c1064..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/velvet_edged.bcm
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.07842, 0.72156)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="242, 136" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.5" loc="-253, 254" />
-		<node type="LAYER_WEIGHT" blend="0.80000" loc="-448, 227" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.01166, 0.0, 0.80000, 1.0)" roughness="0.0" loc="-444, 17" />
-		<node type="MIX_SHADER" fac="0.5" loc="-20, 136" />
-		<node type="BSDF_VELVET" color="rgba(0.80000, 0.07875, 0.71977, 1.0)" sigma="1.0" loc="-475, 114" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="4" output="0" />
-		<link to="4" input="0" from="1" output="0" />
-		<link to="1" input="0" from="2" output="0" />
-		<link to="4" input="1" from="5" output="0" />
-		<link to="4" input="2" from="3" output="0" />
-		<link to="1" input="1" from="2" output="1" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/velvet_edged.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/velvet_edged.jpg
deleted file mode 100644
index b3d5cc0..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/velvet_edged.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_osl.bcm
deleted file mode 100644
index 44f467e..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_osl.bcm
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_RGB" blend_type="SCREEN" use_clamp="False" fac="0.15000" color1="rgba(0.29999, 0.11030, 0.09969, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-245, 168" />
-		<node type="MIX_RGB" blend_type="SCREEN" use_clamp="False" fac="0.15000" color1="rgba(0.5, 0.39131, 0.19054, 1.0)" color2="rgba(0.5, 0.5, 0.5, 1.0)" loc="-244, 364" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(50.0, 50.0, 50.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-541, 439" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="232, 423" />
-		<node type="OUTPUT_MATERIAL" loc="843, 297" />
-		<node type="MIX_SHADER" fac="0.5" loc="634, 332" />
-		<node type="MIX_SHADER" fac="0.15999" loc="424, 408" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.61282, 0.55566, 1.0)" roughness="0.20000" loc="396, 264" />
-		<node type="MATH" operation="POWER" use_clamp="False" value1="0.5" value2="0.5" loc="475, 107" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="0.5" value2="0.5" loc="311, 102" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="650, 142" />
-		<node type="TEX_COORD" dupli="False" loc="-764, 427" />
-		<node type="TEX_NOISE" scale="545.0" detail="2.0" distortion="5.0" loc="-477, 122" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" warpcolor="rgba(0.80000, 0.0, 0.0, 1.0)" weftcolor="rgba(0.0, 0.80000, 0.0, 1.0)" skip="1" underrun="2" overrun="1" warpwidth="0.80000" weftwidth="0.79999" coordinates="Vector(0.0, 0.0, 0.0)" loc="-37, 410" />
-	</nodes>
-	<links>
-		<link to="2" input="0" from="11" output="2" />
-		<link to="0" input="2" from="12" output="1" />
-		<link to="1" input="2" from="12" output="1" />
-		<link to="13" input="1" from="0" output="0" />
-		<link to="13" input="0" from="1" output="0" />
-		<link to="13" input="7" from="2" output="0" />
-		<link to="4" input="0" from="5" output="0" />
-		<link to="5" input="1" from="6" output="0" />
-		<link to="6" input="1" from="3" output="0" />
-		<link to="3" input="0" from="13" output="0" />
-		<link to="5" input="2" from="7" output="0" />
-		<link to="4" input="2" from="10" output="0" />
-		<link to="10" input="0" from="8" output="0" />
-		<link to="8" input="0" from="9" output="0" />
-		<link to="10" input="1" from="12" output="1" />
-		<link to="9" input="1" from="13" output="2" />
-	</links>
-	<scripts>
-		<script name="MAweave.osl" id="0">
-/*<br />    weave shader by Michel J. Anders (c)2012<br />    license: cc-by-sa<br />    http://blenderthings.blogspot.com.au/2012/12/a-fabric-osl-shader-for-blender-cycles.html<br />*/<br /><br />#include "stdosl.h"<br /><br />// greatest common divisor<br />int gcd(int A, int B){<br />    int a=A, b=B;<br />    if (a == 0) { return b; }<br />    while (b != 0) {<br />        if (a > b) {<br />            a = a - b;<br />        } else {<br />            b = b - a;<br />        }<br />    }<br />    return a;<br />}<br /><br />// smallest common multiple (assumes a, b > 0 )<br />int scm(int a, int b){ return a*b/gcd(a,b); }<br /><br />shader MAweave(<br />        color WarpColor = color(0.8,0,0),<br />        color WeftColor = color(0,0.8,0),<br />        int skip = 1,<br />        int underrun = 1,<br />        int overrun = 1,<br />        float WarpWidth = 0.8,<br />        float WeftWidth = 0.8,<br />        vector Coordinates = 0,<br />        output color Color = 0,<br />        output int Index = 0,<br />        output float Dist = 0)<br />{<br />    int ny = underrun + overrun;<br />    int nx = scm(skip,ny);<br />    <br />    float x = mod(Coordinates[0],1.0);<br />    float y = mod(Coordinates[1],1.0);<br />    <br />    int ix = int(floor(x*nx));<br />    int iy = int(floor(y*ny));<br />    <br />    float cx = mod(x*nx,1.0);<br />    float cy = mod(y*ny,1.0);<br />    <br />    int top;<br />    top = ((iy+skip*ix)%ny) < overrun;<br />    <br />    float lx = (1-WarpWidth)/2;<br />    float hx = 1-lx;<br />    float ly = (1-WeftWidth)/2;<br />    float hy = 1-lx;<br />    <br />    if (top) {<br />        if ( cx > lx && cx < hx ){<br />            Index = 1;<br />            Color = WarpColor;<br />            Dist = abs(0.5-cx);<br />        } else if (cy > ly && cy < hy ){<br />            Index = 2;<br />            Color = WeftColor;<br />            Dist = abs(0.5-cy);<br />        }<br />    } else {<br />        if (cy > ly && cy < hy ){<br />            Index = 2;<br />            Color = WeftColor;<br />            Dist = abs(0.5-cy); <br />        } else if ( cx > lx && cx < hx ){<br />            Index = 1;<br />            Color = WarpColor;<br />            Dist = abs(0.5-cx); <br />        }<br />    }<br />}<br /><br />
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_osl.jpg
deleted file mode 100644
index 2e2c27e..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_test.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_test.bcm
deleted file mode 100644
index 81930e1..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_test.bcm
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_SHADER" fac="0.02999" loc="1649, 550" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.79909, 0.67243, 0.60382, 1.0)" roughness="0.40000" loc="1451, 489" />
-		<node type="MIX_SHADER" fac="0.69999" loc="1452, 608" />
-		<node type="BSDF_VELVET" color="rgba(0.79909, 0.67243, 0.60382, 1.0)" sigma="0.89999" loc="1243, 532" />
-		<node type="BSDF_DIFFUSE" color="rgba(0.79909, 0.67058, 0.60566, 1.0)" roughness="0.69998" loc="1239, 630" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.79909, 0.51714, 0.32036, 1.0)" color2="rgba(0.0, 0.0, 0.0, 1.0)" loc="1011, 555" />
-		<node type="MATH" operation="MINIMUM" use_clamp="False" value1="0.5" value2="0.5" loc="434, 428" />
-		<node type="VALTORGB" interpolation="EASE" fac="0.5" stops="12" stop1="0.0|rgba(1.0, 1.0, 1.0, 0.0)" stop2="0.11362|rgba(1.0, 1.0, 1.0, 0.50182)" stop3="0.18181|rgba(1.0, 1.0, 1.0, 0.00234)" stop4="0.21363|rgba(1.0, 1.0, 1.0, 0.02219)" stop5="0.27272|rgba(1.0, 1.0, 1.0, 0.0)" stop6="0.34545|rgba(1.0, 1.0, 1.0, 0.58626)" stop7="0.41817|rgba(1.0, 1.0, 1.0, 0.02921)" stop8="0.51362|rgba(1.0, 1.0, 1.0, 0.0)" stop9="0.64090|rgba(1.0, 1.0, 1.0, 0.03826)" stop10="0.74545|rgba(1.0, 1.0, 1.0, 1.0)" stop11="0.85453|rgba(1.0, 1.0, 1.0, 0.02249)" stop12="1.0|rgba(1.0, 1.0, 1.0, 0.0)" loc="-140, 400" />
-		<node type="VALTORGB" interpolation="EASE" fac="0.5" stops="10" stop1="0.0|rgba(1.0, 1.0, 1.0, 0.0)" stop2="0.17272|rgba(1.0, 1.0, 1.0, 0.73825)" stop3="0.29998|rgba(1.0, 1.0, 1.0, 0.0)" stop4="0.34999|rgba(1.0, 1.0, 1.0, 0.02642)" stop5="0.43180|rgba(1.0, 1.0, 1.0, 0.05547)" stop6="0.57271|rgba(1.0, 1.0, 1.0, 0.72980)" stop7="0.72272|rgba(1.0, 1.0, 1.0, 0.03361)" stop8="0.81818|rgba(1.0, 1.0, 1.0, 0.0)" stop9="0.91817|rgba(1.0, 1.0, 1.0, 0.32451)" stop10="1.0|rgba(1.0, 1.0, 1.0, 0.0)" loc="-140, 196" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="-2.0" loc="150, 222" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="291, 322" />
-		<node type="MATH" operation="DIVIDE" use_clamp="False" value1="0.5" value2="3.0" loc="838, 562" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="2.0" loc="645, 522" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.20000" loc="1049, 184" />
-		<node type="OUTPUT_MATERIAL" loc="1966, 237" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="0.5" value2="0.5" loc="-236, 531" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="30.09999" loc="-913, 464" />
-		<node type="TEX_NOISE" scale="5.0" detail="0.99998" distortion="0.0" loc="-1531, 185" />
-		<node type="TEX_COORD" loc="-1720, 315" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="30.09999" value2="10.0" loc="-1712, 109" />
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="0.99000" color1="rgba(0.5, 0.5, 0.5, 1.0)" color2="rgba(0.0, 0.0, 0.0, 1.0)" loc="-1350, 220" />
-		<node type="SEPRGB" image="rgba(0.80000, 0.80000, 0.80000, 1.0)" loc="-1068, 269" />
-		<node type="VECT_MATH" operation="ADD" vector1="Vector(0.5, 0.5, 0.5)" vector2="Vector(0.5, 0.5, 0.5)" loc="-1212, 292" />
-		<node type="MATH" operation="ROUND" use_clamp="False" value1="0.5" value2="0.0" loc="-641, 604" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="-787, 602" />
-		<node type="MATH" operation="SUBTRACT" use_clamp="False" value1="0.5" value2="0.5" loc="-279, 176" />
-		<node type="MATH" operation="ROUND" use_clamp="False" value1="0.5" value2="0.0" loc="-433, 323" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="-600, 341" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="30.09999" loc="-753, 159" />
-		<node type="MATH" operation="ADD" use_clamp="False" value1="0.5" value2="0.5" loc="-902, 159" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Scale" value="10.0" loc="-1945, 425" />
-	</nodes>
-	<links>
-		<link to="14" input="0" from="0" output="0" />
-		<link to="14" input="2" from="13" output="0" />
-		<link to="9" input="0" from="8" output="1" />
-		<link to="2" input="2" from="3" output="0" />
-		<link to="2" input="1" from="4" output="0" />
-		<link to="10" input="0" from="7" output="1" />
-		<link to="10" input="1" from="9" output="0" />
-		<link to="13" input="0" from="6" output="0" />
-		<link to="6" input="1" from="10" output="0" />
-		<link to="6" input="0" from="7" output="1" />
-		<link to="0" input="2" from="1" output="0" />
-		<link to="17" input="0" from="18" output="2" />
-		<link to="20" input="1" from="17" output="0" />
-		<link to="22" input="0" from="18" output="2" />
-		<link to="22" input="1" from="20" output="0" />
-		<link to="21" input="0" from="22" output="0" />
-		<link to="17" input="1" from="19" output="0" />
-		<link to="0" input="1" from="2" output="0" />
-		<link to="7" input="0" from="15" output="0" />
-		<link to="8" input="0" from="25" output="0" />
-		<link to="29" input="1" from="21" output="1" />
-		<link to="4" input="0" from="5" output="0" />
-		<link to="3" input="0" from="5" output="0" />
-		<link to="1" input="0" from="5" output="0" />
-		<link to="11" input="0" from="12" output="0" />
-		<link to="5" input="0" from="11" output="0" />
-		<link to="12" input="0" from="6" output="0" />
-		<link to="16" input="0" from="21" output="0" />
-		<link to="15" input="0" from="23" output="0" />
-		<link to="15" input="1" from="16" output="0" />
-		<link to="23" input="0" from="24" output="0" />
-		<link to="24" input="0" from="16" output="0" />
-		<link to="28" input="0" from="29" output="0" />
-		<link to="25" input="0" from="26" output="0" />
-		<link to="25" input="1" from="28" output="0" />
-		<link to="26" input="0" from="27" output="0" />
-		<link to="27" input="0" from="28" output="0" />
-		<link to="19" input="0" from="30" output="0" />
-		<link to="16" input="1" from="30" output="0" />
-		<link to="29" input="0" from="21" output="0" />
-	</links>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_test.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_test.jpg
deleted file mode 100644
index bbda283..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/textiles/weave_test.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/parquete_tile_osl.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/parquete_tile_osl.bcm
deleted file mode 100644
index 2a4ebdc..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/parquete_tile_osl.bcm
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
-	<nodes>
-		<node type="OUTPUT_MATERIAL" loc="-75, 344" />
-		<node type="TEX_COORD" dupli="False" loc="-524, 318" />
-		<node type="SCRIPT" mode="INTERNAL" script="0" vector="Vector(0.0, 0.0, 0.0)" diffuseamt="0.75" specularamt="0.25" roughness="0.125" specularcolor="rgba(1.0, 1.0, 1.0, 1.0)" ringscale="25.0" grainscale="55.0" grainy="1.0" wavy="0.07999" texturescale="15.0" lightwood="rgba(0.56999, 0.29199, 0.125, 1.0)" darkwood="rgba(0.27500, 0.15000, 0.05999, 1.0)" groovecolor="rgba(0.05000, 0.03999, 0.01499, 1.0)" plankspertile="4" plankwidth="0.20000" plankvary="0.60000" groovewidth="0.10000" loc="-333, 353" />
-	</nodes>
-	<links>
-		<link to="0" input="0" from="2" output="0" />
-		<link to="2" input="0" from="1" output="2" />
-	</links>
-	<scripts>
-		<script name="DWParqueteTile.osl" id="0">
-/*<br /> * DWParquetTile.sl -- yet another surface shader for wood<br /> *-was:<br /> * parquet_plank.sl -- another surface shader for wood.<br /> *<br /> * DESCRIPTION:<br /> *   Makes texture of wooden planks in s-t space.  This wood looks rather<br /> *   like oak plank parquet floor tiles.  The actual wood and plank pattern<br /> *   is based on my "planks" shader.  This shader works best if "s" and "t"<br /> *   units are both the same size in world space.<br /> *<br /> * PARAMETERS:<br /> *   Ka, Kd, Ks, specular, roughness - work just like the plastic shader<br /> *   txtscale - overall scaling factor for the texture<br /> *   plankwidth - width of each plank (in terms of s/t)<br /> *   plankspertile - number of planks in each parquet tile<br /> *   ringscale - scaling for the ring spacing<br /> *   grainscale - scaling for the fine grain<br /> *   groovewidth - width of the grooves between the planks (in terms of s/t)<br /> *   lightwood, darkwood - surface colors for the wood itself<br /> *   groovecolor - the color of the "grooves" between the planks<br /> *   plankvary - controls how much wood color varies from plank to plank<br /> *   grainy - relative graininess (0 = no fine grain)<br /> *   wavy - relative wavyness of the ring pattern<br /> *<br /> * ANTIALIASING: this shader does a pretty good job of antialiasing itself,<br /> *   even with low sampling densities.<br /> *<br /> * AUTHOR: written by Larry Gritz, the George Washington University<br /> *         email: gritz AT seas DOT gwu DOT edu <br /> *         snail: Dept. of EE & CS<br /> *                801  22nd St. NW, Rm. T-624-G<br /> *                Washington, DC 20052<br /> *<br /> * HISTORY:<br /> *    10 Feb 1995 - written by Larry Gritz, based on my "plank" shader.<br /> *    10 Feb 1995 - modified by wave to change the name<br /> *    18 Dec 2012 - converted to blender osl shader by Shane Ambler<br /> *<br /> * last modified 10 Feb 1995 by wave<br /> * <br /> *<br /> * modified again by Dan Weeks <dan AT mango DOT sfasu DOT edu > on 08 Dec 1996<br /> *   - made one plank per tile like the flooring in our lab<br /> *   - comments appear where changes are made<br /> *   - many thanks to Larry Gritz and wave for creating the original<br /> *<br /> * modified by Shane Ambler 18 Dec 2012<br /> *  - convert to work as blender osl shader<br /> *  - capitalise various user visible variable names<br /> *  - remove Ka - no ambient interaction calculated within shader<br /> *  - rename Kd to DiffuseAmt<br /> *  - rename Ks to SpecularAmt<br /> *  - rename txtscale to TextureScale<br /> *  - change PlanksPerTile to an int<br /> */<br /><br /><br /><br />/*<br /> * changed:<br /> *   - name from LGParquetPlank to DWParquetTile<br /> *   - ringscale from 15 to 25<br /> *   - grainscale from 60 to 55<br /> *   - plankspertile from 4 to 1<br /> *   - plankwidth from .05 to .2<br /> */<br /> <br />#include "stdosl.h"<br /><br />shader DWParquetTile (<br />        point Vector = P,<br />        float DiffuseAmt = 0.75 ,<br />        float SpecularAmt = 0.15,<br />        float Roughness = 0.025,<br />        color SpecularColor = color(1.0),<br />        float RingScale = 25.0,<br />        float GrainScale = 55.0,<br />        float Grainy = 1.0,<br />        float Wavy = 0.08,<br />        float TextureScale = 5.0,<br />        color LightWood = color (0.57, 0.292, 0.125),<br />        color DarkWood  = color (0.275, 0.15, 0.06),<br />        color GrooveColor  = color (0.05, 0.04, 0.015),<br />        int PlanksPerTile = 1,<br />        float PlankWidth = 0.2,<br />        float PlankVary = 0.6,<br />        float GrooveWidth = 0.1,<br />        output closure color BSDF = diffuse(N) )<br />{<br />#define snoise(x) (2 * noise((x)) - 1)<br />#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))<br />#define MINFILTERWIDTH 1.0e-7<br /><br />    float su = Vector[0];<br />    float tv = Vector[1];<br />    float r, r2;<br />    point Nf;<br />    float whichrow, whichplank;<br />    float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;<br />    color Ct, woodcolor;<br />    float groovy;<br />    float PGWIDTH, PGHEIGHT, GWF, GHF;<br />    float tilewidth, whichtile, tmp, planklength;<br /><br />    PGWIDTH = PlankWidth+GrooveWidth;<br />    planklength = PGWIDTH * PlanksPerTile - GrooveWidth;<br />    PGHEIGHT = planklength+GrooveWidth;<br />    GWF = GrooveWidth*0.05/PGWIDTH;<br />    GHF = GrooveWidth*0.05/PGHEIGHT;<br /><br />    /* Determine how wide in s-t space one pixel projects to */<br />    swidth = (max (abs(Dx(su)*su) + abs(Dy(su)*tv), MINFILTERWIDTH) / PGWIDTH) * TextureScale;<br />    twidth = (max (abs(Dx(tv)*su) + abs(Dy(tv)*tv), MINFILTERWIDTH) / PGHEIGHT) * TextureScale;<br />    fwidth = max(swidth,twidth);<br /><br />    ss = (TextureScale * su) / PGWIDTH;<br />    whichrow = floor (ss);<br />    tt = (TextureScale * tv) / PGHEIGHT;<br />    whichplank = floor(tt);<br />    if (mod (whichrow/PlanksPerTile + whichplank, 2) >= 1) {<br />        ss = TextureScale * tv / PGWIDTH;<br />        whichrow = floor (ss);<br />        tt = TextureScale * su / PGHEIGHT;<br />        whichplank = floor(tt);<br />        tmp = swidth;  swidth = twidth;  twidth = tmp;<br />    } <br />    ss -= whichrow;<br />    tt -= whichplank;<br />    whichplank += 20*(whichrow+10);<br /><br />    /*<br />     * Figure out where the grooves are.  The value groovy is 0 where there<br />     * are grooves, 1 where the wood grain is visible.  Do some simple<br />     * antialiasing.<br />     */<br />    if (swidth >= 1)<br />        w = 1 - 2*GWF;<br />    else {<br />        w = clamp (boxstep(GWF-swidth,GWF,ss), max(1-GWF/swidth,0), 1)<br />        - clamp (boxstep(1-GWF-swidth,1-GWF,ss), 0, 2*GWF/swidth);<br />    }<br />    if (twidth >= 1)<br />        h = 1 - 2*GHF;<br />    else {<br />        h = clamp (boxstep(GHF-twidth,GHF,tt), max(1-GHF/twidth,0),1)<br />        - clamp (boxstep(1-GHF-twidth,1-GHF,tt), 0, 2*GHF/twidth);<br />    }<br />    /* This would be the non-antialiased version:<br />     * w = step (GWF,ss) - step(1-GWF,ss);<br />     * h = step (GHF,tt) - step(1-GHF,tt);<br />     */<br />    groovy = w*h;<br /><br /><br />    /*<br />     * Add the ring patterns<br />     */<br />    fade = smoothstep (1/RingScale, 8/RingScale, fwidth);<br />    if (fade < 0.999) {<br />        ttt = tt/4+whichplank/28.38 + Wavy * noise (8*ss, tt/4);<br />        r = RingScale * noise (ss-whichplank, ttt);<br />        r -= floor (r);<br />        r = 0.3 + 0.7 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, r));<br />        r = (1-fade)*r + 0.65*fade;<br /><br />        /*<br />         * Multiply the ring pattern by the fine grain<br />         */<br />        fade = smoothstep (2/GrainScale, 8/GrainScale, fwidth);<br />        if (fade < 0.999) {<br />            r2 = 1.3 - noise (ss*GrainScale, (tt*GrainScale/4));<br />            r2 = Grainy * r2*r2 + (1-Grainy);<br />            r *= (1-fade)*r2 + (0.75*fade);<br />        }<br />        else<br />            r *= 0.75;<br />    }<br />    else<br />        r = 0.4875;<br />  <br /><br />    /* Mix the light and dark wood according to the grain pattern */<br />    woodcolor = mix (LightWood, DarkWood, r);<br /><br />    /* Add plank-to-plank variation in overall color */<br />    woodcolor *= (1-PlankVary/2 + PlankVary * noise (whichplank+0.5));<br /><br />    Ct = mix (GrooveColor, woodcolor, groovy);<br />    Nf = normalize(N);<br />    BSDF = Ct * DiffuseAmt * diffuse(Nf);<br /><br />    BSDF += SpecularColor * SpecularAmt * microfacet_beckmann(Nf,Roughness);<br />}<br /><br />
-		</script>
-	</scripts>
-</material>
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/parquete_tile_osl.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/parquete_tile_osl.jpg
deleted file mode 100644
index 82169a5..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/parquete_tile_osl.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/polished_walnut.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/polished_walnut.bcm
deleted file mode 100644
index 60d5be2..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/polished_walnut.bcm
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.14084, 0.05520, 0.03290)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="1.0" color1="rgba(1.0, 1.0, 1.0, 1.0)" color2="rgba(0.0, 0.0, 0.0, 1.0)" loc="-131, 606" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(1.0, 1.0, 1.0, 1.0)" color2="rgba(0.23573, 0.23573, 0.23573, 1.0)" loc="-266, 606" />
-		<node type="LAYER_WEIGHT" blend="0.02999" loc="7, 606" />
-		<node type="MIX_SHADER" fac="0.64398" loc="263, 447" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.75" loc="7, 447" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.13197, 0.04244, 0.02085, 1.0)" color2="rgba(0.04010, 0.01503, 0.00737, 1.0)" loc="-266, 447" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 0.88691, 0.84328, 1.0)" roughness="0.34999" loc="7, 298" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.00200" loc="7, 162" />
-		<node type="TEX_WAVE" wave="RINGS" scale="0.69998" distortion="700.0" detail="4.0" detail_scale="0.25" loc="-474, 672" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.25" loc="-635, 505" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.69998" loc="-771, 557" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="5.0" loc="-809, 281" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Scale" value="1.0" loc="-1140, 300" />
-		<node type="TEX_COORD" loc="-1490, 554" />
-		<node type="OUTPUT_MATERIAL" loc="460, 390" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 1.74532)" scale="Vector(2.0, 0.40000, 10.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-1266, 611" />
-		<node type="TEX_WAVE" wave="BANDS" scale="5.0" distortion="30.0" detail="4.42378" detail_scale="5.0" loc="-563, 348" />
-	</nodes>
-	<links>
-		<link to="5" input="0" from="16" output="1" />
-		<link to="7" input="0" from="16" output="1" />
-		<link to="16" input="0" from="15" output="0" />
-		<link to="15" input="0" from="13" output="0" />
-		<link to="3" input="2" from="6" output="0" />
-		<link to="14" input="0" from="3" output="0" />
-		<link to="3" input="1" from="4" output="0" />
-		<link to="3" input="0" from="2" output="1" />
-		<link to="14" input="2" from="7" output="0" />
-		<link to="8" input="0" from="15" output="0" />
-		<link to="1" input="0" from="8" output="1" />
-		<link to="4" input="0" from="0" output="0" />
-		<link to="0" input="2" from="5" output="0" />
-		<link to="9" input="0" from="12" output="0" />
-		<link to="8" input="4" from="9" output="0" />
-		<link to="10" input="0" from="12" output="0" />
-		<link to="8" input="1" from="10" output="0" />
-		<link to="11" input="0" from="12" output="0" />
-		<link to="16" input="4" from="11" output="0" />
-		<link to="16" input="1" from="11" output="0" />
-		<link to="0" input="1" from="1" output="0" />
-	</links>
-</material>
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/polished_walnut.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/polished_walnut.jpg
deleted file mode 100644
index e4bcae1..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/polished_walnut.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_pine.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_pine.bcm
deleted file mode 100644
index 853b7f6..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_pine.bcm
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.59719, 0.43964, 0.25415)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(1.0, 1.0, 1.0, 1.0)" color2="rgba(0.71174, 0.58495, 0.47878, 1.0)" loc="-266, 606" />
-		<node type="LAYER_WEIGHT" blend="0.00498" loc="7, 606" />
-		<node type="MIX_SHADER" fac="0.64398" loc="263, 447" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.80000" loc="7, 447" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.83196, 0.60834, 0.35504, 1.0)" color2="rgba(0.61368, 0.48484, 0.29545, 1.0)" loc="-266, 447" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 0.88691, 0.84328, 1.0)" roughness="0.89999" loc="7, 298" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.02999" loc="7, 162" />
-		<node type="TEX_WAVE" wave="RINGS" scale="0.69998" distortion="750.0" detail="4.0" detail_scale="0.25" loc="-474, 672" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.27000" loc="-635, 505" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.69998" loc="-771, 557" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="5.09997" loc="-809, 281" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Scale" value="1.0" loc="-1140, 300" />
-		<node type="TEX_COORD" loc="-1490, 554" />
-		<node type="OUTPUT_MATERIAL" loc="460, 390" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 1.74532)" scale="Vector(2.0, 0.40000, 10.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-1266, 611" />
-		<node type="TEX_WAVE" wave="BANDS" scale="5.0" distortion="30.0" detail="4.42378" detail_scale="5.0" loc="-563, 348" />
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="0.80000" color1="rgba(1.0, 1.0, 1.0, 1.0)" color2="rgba(0.0, 0.0, 0.0, 1.0)" loc="-131, 606" />
-	</nodes>
-	<links>
-		<link to="4" input="0" from="15" output="1" />
-		<link to="6" input="0" from="15" output="1" />
-		<link to="15" input="0" from="14" output="0" />
-		<link to="14" input="0" from="12" output="0" />
-		<link to="2" input="2" from="5" output="0" />
-		<link to="13" input="0" from="2" output="0" />
-		<link to="2" input="1" from="3" output="0" />
-		<link to="2" input="0" from="1" output="1" />
-		<link to="13" input="2" from="6" output="0" />
-		<link to="7" input="0" from="14" output="0" />
-		<link to="0" input="0" from="7" output="1" />
-		<link to="3" input="0" from="16" output="0" />
-		<link to="8" input="0" from="11" output="0" />
-		<link to="7" input="4" from="8" output="0" />
-		<link to="9" input="0" from="11" output="0" />
-		<link to="7" input="1" from="9" output="0" />
-		<link to="10" input="0" from="11" output="0" />
-		<link to="15" input="4" from="10" output="0" />
-		<link to="15" input="1" from="10" output="0" />
-		<link to="16" input="2" from="0" output="0" />
-		<link to="16" input="1" from="4" output="0" />
-	</links>
-</material>
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_pine.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_pine.jpg
deleted file mode 100644
index 991bcf8..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_pine.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_walnut.bcm b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_walnut.bcm
deleted file mode 100644
index 207a053..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_walnut.bcm
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<material view_color="rgb(0.06847, 0.02518, 0.01520)" sample_lamp="True">
-	<nodes>
-		<node type="MIX_RGB" blend_type="MULTIPLY" use_clamp="False" fac="1.0" color1="rgba(1.0, 1.0, 1.0, 1.0)" color2="rgba(0.0, 0.0, 0.0, 1.0)" loc="-131, 606" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(1.0, 1.0, 1.0, 1.0)" color2="rgba(0.23573, 0.23573, 0.23573, 1.0)" loc="-266, 606" />
-		<node type="LAYER_WEIGHT" blend="0.00999" loc="7, 606" />
-		<node type="MIX_SHADER" fac="0.64398" loc="263, 447" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 1.0, 1.0, 1.0)" roughness="0.80000" loc="7, 447" />
-		<node type="MIX_RGB" blend_type="MIX" use_clamp="False" fac="0.5" color1="rgba(0.13197, 0.04244, 0.02085, 1.0)" color2="rgba(0.04010, 0.01503, 0.00737, 1.0)" loc="-266, 447" />
-		<node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(1.0, 0.88691, 0.84328, 1.0)" roughness="0.69998" loc="7, 298" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.02999" loc="7, 162" />
-		<node type="TEX_WAVE" wave="RINGS" scale="0.69998" distortion="700.0" detail="4.0" detail_scale="0.25" loc="-474, 672" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.25" loc="-635, 505" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="0.69998" loc="-771, 557" />
-		<node type="MATH" operation="MULTIPLY" use_clamp="False" value1="0.5" value2="5.0" loc="-809, 281" />
-		<node type="VALUE" custom_color="rgb(1.0, 0.10000, 0.10000)" label="Scale" value="1.0" loc="-1140, 300" />
-		<node type="TEX_COORD" loc="-1490, 554" />
-		<node type="OUTPUT_MATERIAL" loc="460, 390" />
-		<node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 1.74532)" scale="Vector(2.0, 0.40000, 10.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-1266, 611" />
-		<node type="TEX_WAVE" wave="BANDS" scale="5.0" distortion="30.0" detail="4.42378" detail_scale="5.0" loc="-563, 348" />
-	</nodes>
-	<links>
-		<link to="5" input="0" from="16" output="1" />
-		<link to="7" input="0" from="16" output="1" />
-		<link to="16" input="0" from="15" output="0" />
-		<link to="15" input="0" from="13" output="0" />
-		<link to="3" input="2" from="6" output="0" />
-		<link to="14" input="0" from="3" output="0" />
-		<link to="3" input="1" from="4" output="0" />
-		<link to="3" input="0" from="2" output="1" />
-		<link to="14" input="2" from="7" output="0" />
-		<link to="8" input="0" from="15" output="0" />
-		<link to="1" input="0" from="8" output="1" />
-		<link to="4" input="0" from="0" output="0" />
-		<link to="0" input="2" from="5" output="0" />
-		<link to="9" input="0" from="12" output="0" />
-		<link to="8" input="4" from="9" output="0" />
-		<link to="10" input="0" from="12" output="0" />
-		<link to="8" input="1" from="10" output="0" />
-		<link to="11" input="0" from="12" output="0" />
-		<link to="16" input="4" from="11" output="0" />
-		<link to="16" input="1" from="11" output="0" />
-		<link to="0" input="1" from="1" output="0" />
-	</links>
-</material>
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_walnut.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_walnut.jpg
deleted file mode 100644
index 98c2699..0000000
Binary files a/release/scripts/addons_contrib/online_mat_lib/material-library/bundled/cycles/wood/rough_walnut.jpg and /dev/null differ
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/mat_lib_preview_image.jpg b/release/scripts/addons_contrib/online_mat_lib/material-library/mat_lib_preview_image.jpg
deleted file mode 100644
index e69de29..0000000
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/my-materials/read-me.txt b/release/scripts/addons_contrib/online_mat_lib/material-library/my-materials/read-me.txt
deleted file mode 100644
index 33b816b..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/my-materials/read-me.txt
+++ /dev/null
@@ -1 +0,0 @@
-This is the folder location for your personal saved materials.
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/peter.cassetta.info/release/cycles/revision_data.ini b/release/scripts/addons_contrib/online_mat_lib/material-library/peter.cassetta.info/release/cycles/revision_data.ini
deleted file mode 100644
index cac98a4..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/peter.cassetta.info/release/cycles/revision_data.ini
+++ /dev/null
@@ -1 +0,0 @@
-revision=001
diff --git a/release/scripts/addons_contrib/online_mat_lib/material-library/peter.cassetta.info/testing/cycles/revision_data.ini b/release/scripts/addons_contrib/online_mat_lib/material-library/peter.cassetta.info/testing/cycles/revision_data.ini
deleted file mode 100644
index cac98a4..0000000
--- a/release/scripts/addons_contrib/online_mat_lib/material-library/peter.cassetta.info/testing/cycles/revision_data.ini
+++ /dev/null
@@ -1 +0,0 @@
-revision=001
diff --git a/release/scripts/addons_contrib/oscurart_futurism.py b/release/scripts/addons_contrib/oscurart_futurism.py
deleted file mode 100644
index 0b06cd8..0000000
--- a/release/scripts/addons_contrib/oscurart_futurism.py
+++ /dev/null
@@ -1,150 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Futurism",
-    "author": "Oscurart",
-    "version": (1, 2),
-    "blender": (2, 63, 0),
-    "location": "Object > Futurism",
-    "description": "Adds a new Mesh Object",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Object/Oscurart_Futurism",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-                   "unc=detail&aid=31911",
-    "category": "Add Mesh"}
-
-
-import bpy
-
-def object_osc_futurism (self, context,STEP, HOLD):
-    ACTOBJ=bpy.context.active_object # OBJETO ACTIVO
-    FS=bpy.context.scene.frame_start # FRAME START
-    FE=bpy.context.scene.frame_end # FRAME END
-    OBJLIST=[] # LISTA PARA OBJETOS ????
-    FC=FS # FRAME CURRENT
-    OBJNUMBER=1 # SUFIJO DE NUMERO PARA OBJETOS
-    STEPINC=0 # NUMERO PARA EVALUAR LOS PASOS        
-    bpy.context.scene.frame_set(FS)  # SETEO EL FRAME CURRENT    
-    OBACT = bpy.context.active_object # SETEO EL OBJETO ACTIVO
-    
-    ## CREO EMPTY
-    bpy.ops.object.add()
-    bpy.context.active_object.name = "FuturismContainer"
-    EMPTY = bpy.context.active_object   
-    
-    # SUMO PARAMETERS AL EMPTY
-    EMPTY["FUTURISM_HOLDIN"] = 0
-    EMPTY["FUTURISM_HOLDOUT"] = 0    
-    
-    bpy.context.scene.objects.active = OBACT  # RECUPERO OBJETO ACTIVO 
-    
-    for OBJETO in range((FE+1)-FS):
-        if STEPINC == STEP:
-            # CREO UN MESH A PARTIR DE OBJETO
-            MESH=ACTOBJ.to_mesh(bpy.context.scene, True, 'PREVIEW')
-            # CREO OBJETO
-            OBJECT=bpy.data.objects.new(ACTOBJ.name[:3]+str(FC), MESH)
-            # CONECTO A LA ESCENA
-            bpy.context.scene.objects.link(OBJECT)
-            # SETEO FRAME CURRENT
-            bpy.context.scene.frame_set(FC)
-            # MARCO EXPRESIONES PARA VIEW
-            OBJECT.driver_add("hide")
-            OBJECT.animation_data.drivers[0].driver.variables.new()
-            OBJECT.animation_data.drivers[0].driver.variables.new()
-            OBJECT.animation_data.drivers[0].driver.variables.new()
-            OBJECT.animation_data.drivers[0].driver.expression= "False if frame >= %s+var_001 and frame <= %s+var_002 else True" % (str(FC),str(FC+HOLD))
-            OBJECT.animation_data.drivers[0].driver.variables[0].targets[0].id_type = 'SCENE'
-            OBJECT.animation_data.drivers[0].driver.variables[0].targets[0].id= bpy.context.scene
-            OBJECT.animation_data.drivers[0].driver.variables[0].targets[0].data_path = "current_frame"
-            OBJECT.animation_data.drivers[0].driver.variables[1].targets[0].id_type = 'OBJECT'
-            OBJECT.animation_data.drivers[0].driver.variables[1].targets[0].id= EMPTY
-            OBJECT.animation_data.drivers[0].driver.variables[1].targets[0].data_path = '["FUTURISM_HOLDIN"]'  
-            OBJECT.animation_data.drivers[0].driver.variables[2].targets[0].id_type = 'OBJECT'
-            OBJECT.animation_data.drivers[0].driver.variables[2].targets[0].id= EMPTY
-            OBJECT.animation_data.drivers[0].driver.variables[2].targets[0].data_path = '["FUTURISM_HOLDOUT"]'     
-            
-            # MARCO EXPRESIONES PARA RENDER           
-            OBJECT.driver_add("hide_render")
-            OBJECT.animation_data.drivers[1].driver.variables.new()
-            OBJECT.animation_data.drivers[1].driver.variables.new()
-            OBJECT.animation_data.drivers[1].driver.variables.new()         
-            OBJECT.animation_data.drivers[1].driver.expression= "False if frame >= %s+5 and frame <= %s else True" % (str(FC),str(FC+HOLD))
-            OBJECT.animation_data.drivers[1].driver.variables[0].targets[0].id_type = 'SCENE'
-            OBJECT.animation_data.drivers[1].driver.variables[0].targets[0].id= bpy.context.scene
-            OBJECT.animation_data.drivers[1].driver.variables[0].targets[0].data_path = "current_frame"   
-            OBJECT.animation_data.drivers[1].driver.variables[1].targets[0].id_type = 'OBJECT'
-            OBJECT.animation_data.drivers[1].driver.variables[1].targets[0].id= EMPTY
-            OBJECT.animation_data.drivers[1].driver.variables[1].targets[0].data_path = '["FUTURISM_HOLDIN"]'  
-            OBJECT.animation_data.drivers[1].driver.variables[2].targets[0].id_type = 'OBJECT'
-            OBJECT.animation_data.drivers[1].driver.variables[2].targets[0].id= EMPTY
-            OBJECT.animation_data.drivers[1].driver.variables[2].targets[0].data_path = '["FUTURISM_HOLDOUT"]'                       
-            # RESETEO STEPINC
-            STEPINC=0
-            # COPIAMOS S R T
-            OBJECT.matrix_world=ACTOBJ.matrix_world
-            #EMPARENTO
-            OBJECT.parent=EMPTY
-        # AVANZO STEP Y FRAME
-        FC+=1
-        STEPINC+=1    
-
-# CLASE PARA OPERADOR
-class Oscurart_futurism (bpy.types.Operator):
-    bl_idname = "object.duplicate_futurism"
-    bl_label = "Duplicate Futurism"
-    bl_description = "Duplicate object per frame"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    scale = bpy.props.IntProperty(name='Step',default=1, min=1, max=1000)
-    
-    hold = bpy.props.IntProperty(name='Hold', default=0, min=0)
-
-    @classmethod
-    def poll(cls, context):
-        return(bpy.context.active_object.type == "MESH" ) 
-
-    def execute(self, context):
-        object_osc_futurism(self, context, self.scale, self.hold)
-
-        return {'FINISHED'}
-
-
-# Registration
-
-def add_osc_futurism_button(self, context):
-    self.layout.operator(
-        Oscurart_futurism.bl_idname,
-        text="Futurism",
-        icon="PLUGIN")
-
-
-def register():
-    bpy.utils.register_class(Oscurart_futurism)
-    bpy.types.VIEW3D_MT_object.append(add_osc_futurism_button)
-
-
-def unregister():
-    bpy.utils.unregister_class(Oscurart_futurism)
-    bpy.types.VIEW3D_MT_object.remove(add_osc_futurism_button)
-
-
-if __name__ == '__main__':
-    register()
diff --git a/release/scripts/addons_contrib/oscurart_mesh_thread.py b/release/scripts/addons_contrib/oscurart_mesh_thread.py
deleted file mode 100644
index 99c116e..0000000
--- a/release/scripts/addons_contrib/oscurart_mesh_thread.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Make Thread Mesh",
-    "author": "Oscurart",
-    "version": (1,0),
-    "blender": (2, 59, 0),
-    "api": 4000,
-    "location": "Add > Mesh > Thread",
-    "description": "Make a thread.",
-    "warning": "",
-    "wiki_url": "oscurart.blogspot.com",
-    "tracker_url": "",
-    "category": "Object"}
-
-
-
-import math
-import bpy
-
-
-def func_osc_screw(self, STRETCH,TURNS,DIAMETER,RESOLUTION):
-    # DATA PARA EL MESH
-    me = bpy.data.meshes.new("threadData")
-    obj = bpy.data.objects.new("Thread", me)     
-    bpy.context.scene.objects.link(obj)  
-      
-    # VARIABLES
-    vertexlist=[]
-    facelist=[]
-    facereset=0     
-    CANTDIV=360/RESOLUTION
-    ESPACIODIV=STRETCH/(TURNS+2+RESOLUTION)
-
-    # PARA CADA VERTICE EN EL RANGO DESDE CERO A LENGTH 
-    for vertice in range(0,TURNS+2+RESOLUTION):        
-        # SUMA EN LA LISTA UN VERTICE       
-        vertexlist.append((math.sin(math.radians(vertice*CANTDIV))*DIAMETER,vertice*ESPACIODIV,math.cos(math.radians(vertice*CANTDIV))*DIAMETER))
-        if vertice > RESOLUTION:
-            facelist.append((vertice-(RESOLUTION),vertice-((RESOLUTION)+1),vertice-1,vertice))    
-
-    # CONECTO OBJETO    
-    me.from_pydata(vertexlist,[],facelist)
-    me.update()
-    
-
-
-class oscMakeScrew (bpy.types.Operator):
-
-    bl_idname = "mesh.primitive_thread_oscurart"
-    bl_label = "Add Mesh Thread"
-    bl_description = "Create a Thread"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    resolution = bpy.props.IntProperty (name="Resolution",default=10,min=3,max=1000)
-    stretch = bpy.props.FloatProperty (name="Stretch",default=1,min=0.000001,max=1000)
-    turns = bpy.props.IntProperty (name="Turns Steps",default=19,min=0)
-    diameter = bpy.props.FloatProperty (name="Diameter",default=1,min=0,max=1000)
-  
-    
-    
-    def execute(self, context):
-        func_osc_screw(self, self.stretch,self.turns,self.diameter,self.resolution)
-        return {'FINISHED'}
-
-
-# Registration
-
-def add_screw_list(self, context):
-    self.layout.operator(
-        "mesh.primitive_thread_oscurart",
-        text="Thread",
-        icon="PLUGIN")
-
-def register():
-    bpy.types.INFO_MT_mesh_add.append(add_screw_list)
-    bpy.utils.register_class(oscMakeScrew)
-
-
-def unregister():
-    bpy.types.INFO_MT_mesh_add.remove(add_screw_list)
-    bpy.utils.unregister_class(oscMakeScrew)
-
-
-if __name__ == '__main__':
-    register()
-
diff --git a/release/scripts/addons_contrib/oscurart_tools.py b/release/scripts/addons_contrib/oscurart_tools.py
deleted file mode 100644
index e1413f9..0000000
--- a/release/scripts/addons_contrib/oscurart_tools.py
+++ /dev/null
@@ -1,2397 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Oscurart Tools",
-    "author": "Oscurart, CodemanX",
-    "version": (3,0),
-    "blender": (2, 63, 0),
-    "location": "View3D > Tools > Oscurart Tools",
-    "description": "Tools for objects, render, shapes, and files.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/Oscurart_Tools",
-    "tracker_url": "",
-    "category": "Object"}
-
-import bpy
-import math
-import sys
-import os
-import stat
-import bmesh
-import time
-import random
-
-#r07
-
-## CREA PANELES EN TOOLS
-
-# VARIABLES DE ENTORNO
-bpy.types.Scene.osc_object_tools = bpy.props.BoolProperty(default=False)
-bpy.types.Scene.osc_mesh_tools = bpy.props.BoolProperty(default=False)
-bpy.types.Scene.osc_shapes_tools = bpy.props.BoolProperty(default=False)
-bpy.types.Scene.osc_render_tools = bpy.props.BoolProperty(default=False)
-bpy.types.Scene.osc_files_tools = bpy.props.BoolProperty(default=False)
-bpy.types.Scene.osc_overrides_tools = bpy.props.BoolProperty(default=False)
-
-# PANEL DE CONTROL
-class OscPanelControl(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Oscurart Tools"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self,context):
-        active_obj = context.active_object
-        layout = self.layout
-
-        col = layout.column(align=1)
-        col.prop(bpy.context.scene, "osc_object_tools", text="Object", icon="OBJECT_DATAMODE")
-        col.prop(bpy.context.scene, "osc_mesh_tools", text="Mesh", icon="EDITMODE_HLT")
-        col.prop(bpy.context.scene, "osc_shapes_tools", text="Shapes", icon="SHAPEKEY_DATA")
-        col.prop(bpy.context.scene, "osc_render_tools", text="Render", icon="SCENE")
-        col.prop(bpy.context.scene, "osc_files_tools", text="Files", icon="IMASEL")
-        col.prop(bpy.context.scene, "osc_overrides_tools", text="Overrides", icon="GREASEPENCIL")
-
-
-# POLLS
-class OscPollObject():
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene.osc_object_tools
-
-
-class OscPollMesh():
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene.osc_mesh_tools
-
-
-class OscPollShapes():
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene.osc_shapes_tools
-
-class OscPollRender():
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene.osc_render_tools
-
-class OscPollFiles():
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene.osc_files_tools
-
-class OscPollOverrides():
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene.osc_overrides_tools
-
-
-## PANELES
-class OscPanelObject(OscPollObject, bpy.types.Panel):
-    bl_idname = "Oscurart Object Tools"
-    bl_label = "Object Tools"
-
-    def draw(self, context):
-        active_obj = context.active_object
-        layout = self.layout
-        col = layout.column(align=1)
-        row = col.row()
-
-        colrow = col.row(align=1)
-        colrow.operator("objects.relink_objects_between_scenes", icon="LINKED")
-        colrow.operator("objects.copy_objects_groups_layers", icon="LINKED")
-        colrow = col.row(align=1)
-        colrow.prop(bpy.context.scene, "SearchAndSelectOt", text="")
-        colrow.operator("object.search_and_select_osc", icon="ZOOM_SELECTED")
-        colrow = col.row(align=1)
-        colrow.prop(bpy.context.scene, "RenameObjectOt", text="")
-        colrow.operator("object.rename_objects_osc", icon="SHORTDISPLAY")
-        col.operator("object.duplicate_object_symmetry_osc", icon="OBJECT_DATAMODE", text="Duplicate Symmetry")
-        col.operator("object.distribute_osc", icon="OBJECT_DATAMODE", text="Distribute")
-        colrow = col.row(align=1)
-        colrow.operator("object.modifiers_remove_osc", icon="MODIFIER", text="Remove Modifiers")
-        colrow.operator("object.modifiers_apply_osc", icon="MODIFIER", text="Apply Modifiers")
-
-
-class OscPanelMesh(OscPollMesh, bpy.types.Panel):
-    bl_idname = "Oscurart Mesh Tools"
-    bl_label = "Mesh Tools"
-
-    def draw(self, context):
-        active_obj = context.active_object
-        layout = self.layout
-        col = layout.column(align=1)
-        row = col.row()
-
-        col.operator("mesh.select_side_osc", icon="VERTEXSEL")
-        colrow=col.row(align=1)
-        colrow.operator("mesh.resym_save_map", icon="UV_SYNC_SELECT")
-        colrow=col.row(align=1)
-        colrow.operator("mesh.resym_mesh", icon="UV_SYNC_SELECT", text="Resym Mesh") 
-        colrow.operator("mesh.resym_vertex_weights_osc", icon="UV_SYNC_SELECT")     
-        colrow=col.row(align=1)
-        colrow.operator("mesh.reconst_osc", icon="UV_SYNC_SELECT")        
-        colrow=col.row(align=1)
-        colrow.operator("file.export_groups_osc", icon='GROUP_VCOL')
-        colrow.operator("file.import_groups_osc", icon='GROUP_VCOL')
-
-
-class OscPanelShapes(OscPollShapes, bpy.types.Panel):
-    bl_idname = "Oscurart Shapes Tools"
-    bl_label = "Shapes Tools"
-
-    def draw(self, context):
-        active_obj = context.active_object
-        layout = self.layout
-        col = layout.column(align=1)
-        row = col.row()
-
-        col.operator("object.shape_key_to_objects_osc", icon="OBJECT_DATAMODE")
-        col.operator("mesh.create_lmr_groups_osc", icon="GROUP_VERTEX")
-        col.operator("mesh.split_lr_shapes_osc", icon="SHAPEKEY_DATA")
-        colrow=col.row()
-        colrow.operator("mesh.create_symmetrical_layout_osc", icon="SETTINGS")
-        colrow.operator("mesh.create_asymmetrical_layout_osc", icon="SETTINGS")
-
-class OscPanelRender(OscPollRender, bpy.types.Panel):
-    bl_idname = "Oscurart Render Tools"
-    bl_label = "Render Tools"
-
-    def draw(self, context):
-        active_obj = context.active_object
-        layout = self.layout
-        col = layout.column(align=1)
-        row = col.row()
-
-        col.operator("file.create_batch_maker_osc", icon="LINENUMBERS_ON", text="Make Render Batch")
-        colrow = col.row()
-        col.operator("file.create_batch_python", icon="LINENUMBERS_ON", text="Make Python Batch")
-        colrow = col.row()
-        colrow.operator("render.render_all_scenes_osc", icon="RENDER_STILL", text="All Scenes").frametype=False
-        colrow.operator("render.render_all_scenes_osc", icon="RENDER_STILL", text="> Frame").frametype=True
-        colrow = col.row()
-        colrow.operator("render.render_current_scene_osc", icon="RENDER_STILL", text="Active Scene").frametype=False
-        colrow.operator("render.render_current_scene_osc", icon="RENDER_STILL", text="> Frame").frametype=True
-
-
-        colrow = col.row(align=1)
-        colrow.prop(bpy.context.scene, "rcPARTS", text="Render Crop Parts")
-        colrow.operator("render.render_crop_osc", icon="RENDER_REGION")
-        
-        col = layout.column(align=1)
-        colrow = col.row(align=1)
-        colrow.prop(bpy.context.scene, "use_render_scene", text="")  
-        colrow.operator("render.render_selected_scenes_osc", icon="RENDER_STILL", text="Selected Scenes").frametype=False
-        colrow.operator("render.render_selected_scenes_osc", icon="RENDER_STILL", text="> Fame").frametype=True   
-   
-
-
-class OscPanelFiles(OscPollFiles, bpy.types.Panel):
-    bl_idname = "Oscurart Files Tools"
-    bl_label = "Files Tools"
-
-    def draw(self, context):
-        active_obj = context.active_object
-        layout = self.layout
-        col = layout.column(align=1)
-
-        colrow = col.row()
-        colrow.operator("file.save_incremental_osc", icon="NEW")
-        colrow.operator("image.reload_images_osc", icon="IMAGE_COL")
-        col = layout.column(align=1)
-        colrow = col.row(align=1)
-        colrow.prop(bpy.context.scene, "oscSearchText", text="")
-        colrow.prop(bpy.context.scene, "oscReplaceText", text="")
-        col.operator("file.replace_file_path_osc", icon="SHORTDISPLAY")
-
-
-class OscPanelOverrides(OscPollOverrides, bpy.types.Panel):
-    bl_idname = "Oscurart Overrides"
-    bl_label = "Overrides Tools"
-
-    def draw(self, context):
-        layout = self.layout
-
-        obj = context.object
-
-        col = layout.box().column(align=1)
-
-        colrow = col.row()
-        col.operator("render.overrides_set_list", text="Create Override List", icon="GREASEPENCIL")
-        col.label(text="Active Scene: " + bpy.context.scene.name)
-        col.label(text="Example: [[Group,Material]]")
-        col.prop(bpy.context.scene, '["OVERRIDE"]', text="")
-        col.operator("render.check_overrides", text="Check List", icon="ZOOM_ALL")
-        col.operator("render.overrides_on", text="On / Off", icon="QUIT")                
-
-        boxcol=layout.box().column(align=1)
-        boxcol.label(text="Danger Zone")
-        boxcolrow=boxcol.row()
-        boxcolrow.operator("render.apply_overrides", text="Apply Overrides", icon="ERROR")
-        boxcolrow.operator("render.restore_overrides", text="Restore Overrides", icon="ERROR")
-
-
-    
-
-
-##---------------------------RELOAD IMAGES------------------
-
-class reloadImages (bpy.types.Operator):
-    bl_idname = "image.reload_images_osc"
-    bl_label = "Reload Images"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-        for imgs in bpy.data.images:
-            imgs.reload()
-        return {'FINISHED'}
-
-##-----------------------------RECONST---------------------------
-
-def defReconst(self, OFFSET):
-
-    ##EDIT
-    bpy.ops.object.mode_set(mode='EDIT', toggle=False)
-
-    ##SETEO VERTEX MODE
-    bpy.context.tool_settings.mesh_select_mode = (True, False, False)
-
-    OBJETO = bpy.context.active_object
-    OBDATA = bmesh.from_edit_mesh(OBJETO.data)
-    OBDATA.select_flush(False)
-
-    ## IGUALO VERTICES CERCANOS A CERO
-    for vertice in OBDATA.verts[:]:
-        if abs(vertice.co[0]) < OFFSET:
-            vertice.co[0] = 0
-
-    ##BORRA IZQUIERDA
-    bpy.ops.mesh.select_all(action="DESELECT")
-
-    for vertices in OBDATA.verts[:]:
-      if vertices.co[0] < 0:
-        vertices.select = 1
-
-    ## BORRA COMPONENTES
-    bpy.ops.mesh.delete()
-    ## SUMA MIRROR
-    bpy.ops.object.modifier_add(type='MIRROR')
-    ## SELECCIONO TODOS LOS COMPONENTES
-    bpy.ops.mesh.select_all(action="SELECT")
-    ## CREO UV TEXTURE DEL SIMETRICO
-    bpy.ops.mesh.uv_texture_add()
-    ## SETEO VARIABLE CON LA CANTIDAD DE UVS, RESTO UNO Y LE DOY UN NOMBRE
-    LENUVLISTSIM = len(bpy.data.objects[OBJETO.name].data.uv_textures)
-    LENUVLISTSIM = LENUVLISTSIM - 1
-    OBJETO.data.uv_textures[LENUVLISTSIM:][0].name = "SYMMETRICAL"
-    ## UNWRAP
-    bpy.ops.uv.unwrap(method='ANGLE_BASED', fill_holes=True, correct_aspect=False, use_subsurf_data=0)
-    ## MODO OBJETO
-    bpy.ops.object.mode_set(mode="OBJECT", toggle= False)
-    ## APLICO MIRROR
-    bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Mirror")
-    ## VUELVO A EDIT MODE
-    bpy.ops.object.mode_set(mode="EDIT", toggle= False)
-    OBDATA = bmesh.from_edit_mesh(OBJETO.data)
-    OBDATA.select_flush(0)
-    ## CREO UV TEXTURE DEL ASIMETRICO
-    bpy.ops.mesh.uv_texture_add()
-    ## SETEO VARIABLE CON LA CANTIDAD DE UVS, RESTO UNO Y LE DOY UN NOMBRE
-    LENUVLISTASIM = len(OBJETO.data.uv_textures)
-    LENUVLISTASIM = LENUVLISTASIM  - 1
-    OBJETO.data.uv_textures[LENUVLISTASIM:][0].name = "ASYMMETRICAL"
-    ## SETEO UV ACTIVO
-    OBJETO.data.uv_textures.active = OBJETO.data.uv_textures["ASYMMETRICAL"]
-    ## UNWRAP
-    bpy.ops.uv.unwrap(method='ANGLE_BASED', fill_holes=True, correct_aspect=False, use_subsurf_data=0)
-
-
-class reConst (bpy.types.Operator):
-    bl_idname = "mesh.reconst_osc"
-    bl_label = "ReConst Mesh"
-    bl_options = {"REGISTER", "UNDO"}
-    OFFSET=bpy.props.FloatProperty(name="Offset", default=0.001, min=-0, max=0.1)
-
-    def execute(self,context):
-        defReconst(self, self.OFFSET)
-        return {'FINISHED'}
-
-## -----------------------------------SELECT LEFT---------------------
-def side (self, nombre, offset):
-
-    bpy.ops.object.mode_set(mode="EDIT", toggle=0)
-
-    OBJECT = bpy.context.active_object
-    ODATA = bmesh.from_edit_mesh(OBJECT.data)
-    MODE = bpy.context.mode
-
-
-    ##SETEO VERTEX MODE
-
-    bpy.context.tool_settings.mesh_select_mode = (True, False, False)
-
-    ## DESELECCIONA TODO
-    for VERTICE in ODATA.verts[:]:
-        VERTICE.select = False
-
-    if nombre == False:
-        ## CONDICION QUE SI EL VERTICE ES MENOR A 0 LO SELECCIONA
-        for VERTICES in ODATA.verts[:]:
-            if VERTICES.co[0] < (offset):
-                VERTICES.select = 1
-    else:
-        ## CONDICION QUE SI EL VERTICE ES MENOR A 0 LO SELECCIONA
-        for VERTICES in ODATA.verts[:]:
-            if VERTICES.co[0] > (offset):
-                VERTICES.select = 1
-
-    ODATA.select_flush(False)
-
-    bpy.ops.object.mode_set(mode="EDIT", toggle=0)
-
-
-class SelectMenor (bpy.types.Operator):
-    bl_idname = "mesh.select_side_osc"
-    bl_label = "Select Side"
-    bl_options = {"REGISTER", "UNDO"}
-
-    side = bpy.props.BoolProperty(name="Greater than zero", default=False)
-    offset = bpy.props.FloatProperty(name="Offset", default=0)
-    def execute(self,context):
-
-        side(self, self.side, self.offset)
-
-        return {'FINISHED'}
-
-
-##-----------------------------------CREATE SHAPES----------------
-
-def DefSplitShapes(self,ACTIVESHAPE,LAYOUTCOMPAT):
-    #PASO A OBJECT MODE
-    bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-    
-    ## VARIABLES
-    ACTOBJ=bpy.context.active_object
-    LENKB=len(ACTOBJ.data.shape_keys.key_blocks)
-    INDEX=ACTOBJ.active_shape_key_index    
-    
-    ## RECORTO NOMBRES
-    if not LAYOUTCOMPAT:
-        for SHAPE in ACTOBJ.data.shape_keys.key_blocks:
-            if len(SHAPE.name) > 7:
-                SHAPE.name=SHAPE.name[:8]
- 
-    if ACTIVESHAPE:  
-        print(INDEX)
-        ACTOBJ.active_shape_key_index=INDEX          
-        AS=ACTOBJ.active_shape_key
-        AS.value=1
-        bpy.ops.object.shape_key_add(from_mix=True)
-        ACTOBJ.data.shape_keys.key_blocks[-1].name=AS.name[:8]+"_L"
-        ACTOBJ.data.shape_keys.key_blocks[-1].vertex_group="_L"
-        bpy.ops.object.shape_key_add(from_mix=True)
-        ACTOBJ.data.shape_keys.key_blocks[-1].name=AS.name[:8]+"_R"
-        ACTOBJ.data.shape_keys.key_blocks[-1].vertex_group="_R"
-        bpy.ops.object.shape_key_clear()
-           
-    else:     
-        ## DUPLICO SHAPES Y CONECTO GRUPO
-        for SHAPE in ACTOBJ.data.shape_keys.key_blocks[1:]:
-            SHAPE.value=1
-            bpy.ops.object.shape_key_add(from_mix=True)
-            ACTOBJ.data.shape_keys.key_blocks[-1].name=SHAPE.name[:8]+"_L"
-            ACTOBJ.data.shape_keys.key_blocks[-1].vertex_group="_L"
-            bpy.ops.object.shape_key_add(from_mix=True)
-            ACTOBJ.data.shape_keys.key_blocks[-1].name=SHAPE.name[:8]+"_R"
-            ACTOBJ.data.shape_keys.key_blocks[-1].vertex_group="_R"
-            bpy.ops.object.shape_key_clear()
-        ACTOBJ.active_shape_key_index=INDEX 
-
-
-class CreaShapes(bpy.types.Operator):
-    bl_idname = "mesh.split_lr_shapes_osc"
-    bl_label = "Split LR Shapes"
-    bl_options = {"REGISTER", "UNDO"}
-
-    @classmethod
-    def poll(cls, context):
-        return context.object is not None
-
-    activeshape=bpy.props.BoolProperty(name="Only Active Shape", default=False)  
-    layoutcompat=bpy.props.BoolProperty(name="Layout Compatible", default=False)
-
-    def execute(self, context):
-
-        DefSplitShapes(self,self.activeshape,self.layoutcompat)
-
-        return {'FINISHED'}
-
-##----------------------------SHAPES LAYOUT-----------------------
-
-class CreaShapesLayout(bpy.types.Operator):
-    bl_idname = "mesh.create_symmetrical_layout_osc"
-    bl_label = "Symmetrical Layout"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self, context):
-
-        SEL_OBJ= bpy.context.active_object
-        LISTA_KEYS = bpy.context.active_object.data.shape_keys.key_blocks[1:]
-        
-        
-        ##MODOS
-        EDITMODE = "bpy.ops.object.mode_set(mode='EDIT')"
-        OBJECTMODE = "bpy.ops.object.mode_set(mode='OBJECT')"
-        POSEMODE = "bpy.ops.object.mode_set(mode='POSE')"
-        
-        ##INDICE DE DRIVERS
-        varindex = 0
-        
-        ##CREA NOMBRES A LA ARMATURE
-        amt = bpy.data.armatures.new("ArmatureData")
-        ob = bpy.data.objects.new("RIG_LAYOUT_"+SEL_OBJ.name, amt)
-        
-        ##LINK A LA ESCENA
-        scn = bpy.context.scene
-        scn.objects.link(ob)
-        scn.objects.active = ob
-        ob.select = True
-        
-        ## CREO DATA PARA SLIDERS        
-        ## creo data para los contenedores
-        verticess = [(-1,1,0),(1,1,0),(1,-1,0),(-1,-1,0)]
-        edgess = [(0,1),(1,2),(2,3),(3,0)]        
-        mesh = bpy.data.meshes.new("%s_data_container" % (SEL_OBJ))
-        object = bpy.data.objects.new("GRAPHIC_CONTAINER", mesh)
-        bpy.context.scene.objects.link(object)
-        mesh.from_pydata(verticess,edgess,[])          
-        
-        gx = 0
-        gy = 0
-        
-        
-        for keyblock in LISTA_KEYS:    
-            if keyblock.name[-2:] != "_L":
-                if keyblock.name[-2:] != "_R":                     
-                    
-                    ## OBJETO ACTIVO
-                    scn.objects.active = ob
-                    eval(EDITMODE)
-                      
-                    ##CREA HUESOS
-                    bone = amt.edit_bones.new(keyblock.name)
-                    bone.head = (gx,0,0)
-                    bone.tail = (gx,0,1)
-                    
-                    bonectrl = amt.edit_bones.new(keyblock.name+"_CTRL")
-                    bonectrl.head = (gy,0,0)
-                    bonectrl.tail = (gy,0,0.2)        
-            
-                    ##EMPARENTA HUESOS             
-                    ## EMPARENTO
-                    ob.data.edit_bones[bonectrl.name].parent = ob.data.edit_bones[bone.name]                         
-                    bpy.context.scene.objects.active = ob
-                    
-                    for SIDE in ["L","R"]:
-                        ##LE HAGO UNA VARIABLE
-                        DR = SEL_OBJ.data.shape_keys.key_blocks[keyblock.name+"_"+SIDE].driver_add("value")
-                        if SIDE == "L":
-                            DR.driver.expression = "var+var_001"
-                        else:
-                            DR.driver.expression = "-var+var_001"    
-                        VAR1 = DR.driver.variables.new()
-                        VAR2 = DR.driver.variables.new()
-            
-                        VAR1.targets[0].id = ob
-                        VAR1.type = 'TRANSFORMS'
-                        VAR1.targets[0].bone_target = bonectrl.name      
-                        VAR1.targets[0].transform_space = "LOCAL_SPACE"
-                        VAR1.targets[0].transform_type = "LOC_X"
-                        VAR2.targets[0].id = ob
-                        VAR2.type = 'TRANSFORMS'                    
-                        VAR2.targets[0].bone_target = bonectrl.name
-                        VAR2.targets[0].transform_space = "LOCAL_SPACE"
-                        VAR2.targets[0].transform_type = "LOC_Y"         
-                    
-                    eval(POSEMODE)
-                    
-                    ## SETEO ICONOS
-                    ob.pose.bones[keyblock.name].custom_shape = object            
-                    ob.pose.bones[keyblock.name+"_CTRL"].custom_shape = object
-                    CNS = ob.pose.bones[keyblock.name+"_CTRL"].constraints.new(type='LIMIT_LOCATION')               
-                    CNS.min_x = -1
-                    CNS.use_min_x = 1
-                    CNS.min_z = 0
-                    CNS.use_min_z = 1
-                    CNS.min_y = -1
-                    CNS.use_min_y = 1    
-                    CNS.max_x =  1
-                    CNS.use_max_x = 1
-                    CNS.max_z =  0
-                    CNS.use_max_z = 1
-                    CNS.max_y =  1
-                    CNS.use_max_y = 1    
-                    CNS.owner_space  = "LOCAL"
-                    CNS.use_transform_limit = True
-                    
-                    eval(OBJECTMODE)
-                    ## creo tipografias
-                    bpy.ops.object.text_add(location=(gx,0,0))
-                    gx = gx+2.2
-                    gy = gy+2.2            
-                    texto = bpy.context.object
-        
-                    texto.data.body = keyblock.name
-                    texto.name = "TEXTO_"+keyblock.name
-        
-                    texto.rotation_euler[0] = math.pi/2
-                    texto.location.x = -1
-                    texto.location.z = -1
-                    texto.data.size = .2
-        
-                    CNS = texto.constraints.new(type="COPY_LOCATION")
-                    CNS.target = ob
-                    CNS.subtarget = ob.pose.bones[keyblock.name].name
-                    CNS.use_offset = True
-    
-
-
-        return {'FINISHED'}
-
-##----------------------------CREATE LMR GROUPS-------------------
-def createLMRGroups(self, FACTORVG, ADDVG):
-    ## SETEO VERTEX MODE EDIT
-    bpy.context.window.screen.scene.tool_settings.mesh_select_mode = (True, False, False)
-
-    ## VARIABLES
-    ACTOBJ=bpy.context.active_object
-    bpy.ops.object.mode_set(mode="EDIT", toggle=False)
-    bpy.ops.mesh.select_all(action='DESELECT')
-    bpy.ops.object.mode_set(mode="OBJECT")
-    GRUPOS=["_L","_R"]
-    MIRRORINDEX=0
-
-    for LADO in GRUPOS:
-        if MIRRORINDEX == 0:
-            ## SUMO DOS VG
-            bpy.ops.object.vertex_group_add()
-            ## ASIGNO TODOS LOS VERTICES AL GRUPO
-            bpy.ops.object.mode_set(mode='EDIT', toggle=False)
-            bpy.ops.mesh.select_all(action='SELECT')
-            bpy.ops.object.vertex_group_assign(new=False)
-            bpy.ops.mesh.select_all(action='DESELECT')
-            bpy.ops.object.mode_set(mode='WEIGHT_PAINT', toggle=False)
-            ## SETEO VALORES
-            for VERTICE in ACTOBJ.data.vertices:
-                VERTICE.groups[-1].weight=(VERTICE.co[0]*FACTORVG)+ADDVG
-            ## RENOMBRO
-            ACTOBJ.vertex_groups[-1].name=LADO
-
-        else:
-            ## SUMO DOS VG
-            bpy.ops.object.vertex_group_add()
-            ## ASIGNO TODOS LOS VERTICES AL GRUPO
-            bpy.ops.object.mode_set(mode='EDIT', toggle=False)
-            bpy.ops.mesh.select_all(action='SELECT')
-            bpy.ops.object.vertex_group_assign(new=False)
-            bpy.ops.mesh.select_all(action='DESELECT')
-            bpy.ops.object.mode_set(mode='WEIGHT_PAINT', toggle=False)
-            ## SETEO VALORES
-            for VERTICE in ACTOBJ.data.vertices:
-                VERTICE.groups[-1].weight=(-VERTICE.co[0]*FACTORVG)+ADDVG
-            ## RENOMBRO
-            ACTOBJ.vertex_groups[-1].name=LADO
-        ## CAMBIO MIRROR INDEX
-        MIRRORINDEX+=1
-
-    ## SETEO GRUPO ACTIVO
-    ACTOBJ.vertex_groups.active_index=len(ACTOBJ.vertex_groups)
-
-
-class CreaGrupos(bpy.types.Operator):
-    bl_idname = "mesh.create_lmr_groups_osc"
-    bl_label = "Create Mix groups"
-    bl_description = "Create Mix groups"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    FACTORVG= bpy.props.FloatProperty(name="Factor", default=1, min=0, max=1000)
-    ADDVG= bpy.props.FloatProperty(name="Addition", default=.5, min=0, max=1000)
-
-    def execute(self, context):
-
-        createLMRGroups(self, self.FACTORVG, self.ADDVG)
-
-        return {'FINISHED'}
-
-
-
-##-------------------------------- RENDER ALL SCENES ----------------------------
-
-
-def defRenderAll (frametype):
-    LISTMAT=[]
-    SCENES=bpy.data.scenes[:]
-    ACTSCENE=bpy.context.scene
-    FC=bpy.context.scene.frame_current
-    FS=bpy.context.scene.frame_start
-    FE=bpy.context.scene.frame_end
-    print("---------------------")
-    ## GUARDO MATERIALES DE OBJETOS EN GRUPOS
-    for OBJECT in bpy.data.objects[:]:
-        SLOTLIST=[]
-        try:
-            if OBJECT.type=="MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE":
-                for SLOT in OBJECT.material_slots[:]:
-                    SLOTLIST.append(SLOT.material)
-
-                LISTMAT.append((OBJECT,SLOTLIST))
-
-        except:
-            pass
-    for SCENE in SCENES:
-        PROPTOLIST=list(eval(SCENE['OVERRIDE']))
-        CURSC= SCENE.name
-        PATH = SCENE.render.filepath
-        ENDPATH = PATH
-        FILEPATH=bpy.data.filepath
-        # CAMBIO SCENE
-        bpy.context.window.screen.scene=SCENE
-        if frametype == True:
-            bpy.context.scene.frame_start=FC
-            bpy.context.scene.frame_end=FC
-            bpy.context.scene.frame_end=FC
-            bpy.context.scene.frame_start=FC
-        ## SETEO MATERIALES  DE OVERRIDES
-        try:
-            for OVERRIDE in PROPTOLIST:
-                for OBJECT in bpy.data.groups[OVERRIDE[0]].objects[:]:
-                    if OBJECT.type == "MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE":
-                        for SLOT in OBJECT.material_slots[:]:
-                            SLOT.material=bpy.data.materials[OVERRIDE[1]]
-        except:
-            pass
-        SCENENAME=os.path.basename(FILEPATH.rpartition(".")[0])
-        LAYERLIST=[]
-        for layer in SCENE.render.layers:
-            if layer.use == 1:
-                LAYERLIST.append(layer)
-        for layers in LAYERLIST:
-            for rl in LAYERLIST:
-                rl.use= 0
-            print("SCENE: "+CURSC)
-            print("LAYER: "+layers.name)
-            print("OVERRIDE: "+str(PROPTOLIST))
-            SCENE.render.filepath = "%s/%s/%s/%s/%s_%s_%s_" % (PATH,SCENENAME,CURSC,layers.name,SCENENAME,SCENE.name,layers.name)
-            SCENE.render.layers[layers.name].use = 1
-            bpy.ops.render.render(animation=True, write_still=True, layer=layers.name, scene= SCENE.name)
-            print("DONE")
-            print("---------------------")
-
-        ## REESTABLECE LOS LAYERS
-        for layer in LAYERLIST:
-            layer.use = 1
-        ## RESTAURA EL PATH FINAL
-        SCENE.render.filepath = ENDPATH
-        #RESTAURO MATERIALES  DE OVERRIDES
-        for OBJECT in LISTMAT:
-            SLOTIND=0
-            try:
-                for SLOT in OBJECT[1]:
-                    OBJECT[0].material_slots[SLOTIND].material=SLOT
-                    SLOTIND+=1
-            except:
-                print("OUT OF RANGE")
-        # RESTAURO FRAMES
-        if frametype == True:
-            SCENE.frame_start=FS
-            SCENE.frame_end=FE
-            SCENE.frame_end=FE
-            SCENE.frame_start=FS
-    # RESTAURO SCENE
-    bpy.context.window.screen.scene=ACTSCENE
-
-
-class renderAll (bpy.types.Operator):
-    bl_idname="render.render_all_scenes_osc"
-    bl_label="Render All Scenes"
-
-    frametype=bpy.props.BoolProperty(default=False)
-
-
-    def execute(self,context):
-        defRenderAll(self.frametype)
-        return {'FINISHED'}
-
-
-
-##--------------------------------RENDER SELECTED SCENES----------------------------
-
-
-bpy.types.Scene.use_render_scene = bpy.props.BoolProperty()
-
-
-def defRenderSelected(frametype):
-    ACTSCENE = bpy.context.scene
-    LISTMAT = []
-    SCENES = bpy.data.scenes[:]
-    FC = bpy.context.scene.frame_current
-    FS = bpy.context.scene.frame_start
-    FE = bpy.context.scene.frame_end
-    ## GUARDO MATERIALES DE OBJETOS EN GRUPOS
-    for OBJECT in bpy.data.objects[:]:
-        SLOTLIST=[]
-        try:
-            if OBJECT.type == "MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE":
-                for SLOT in OBJECT.material_slots[:]:
-                    SLOTLIST.append(SLOT.material)
-
-                LISTMAT.append((OBJECT,SLOTLIST))
-        except:
-            pass
-    for SCENE in SCENES:
-        if SCENE.use_render_scene:
-            PROPTOLIST = list(eval(SCENE['OVERRIDE']))
-            CURSC = SCENE.name
-            PATH = SCENE.render.filepath
-            ENDPATH = PATH
-            FILEPATH = bpy.data.filepath
-            print("---------------------")
-            # CAMBIO SCENE
-            bpy.context.window.screen.scene = SCENE
-            if frametype  ==  True:
-                bpy.context.scene.frame_start = FC
-                bpy.context.scene.frame_end = FC
-                bpy.context.scene.frame_end = FC
-                bpy.context.scene.frame_start = FC
-            ## SETEO MATERIALES  DE OVERRIDES
-            try:
-                for OVERRIDE in PROPTOLIST:
-                    for OBJECT in bpy.data.groups[OVERRIDE[0]].objects[:]:
-                        if OBJECT.type == "MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE":
-                            for SLOT in OBJECT.material_slots[:]:
-                                SLOT.material=bpy.data.materials[OVERRIDE[1]]
-            except:
-                pass
-            SCENENAME=os.path.basename(FILEPATH.rpartition(".")[0])
-            LAYERLIST=[]
-            for layer in SCENE.render.layers:
-                if layer.use == 1:
-                    LAYERLIST.append(layer)
-            for layers in LAYERLIST:
-                for rl in LAYERLIST:
-                    rl.use= 0
-                print("SCENE: "+CURSC)
-                print("LAYER: "+layers.name)
-                print("OVERRIDE: "+str(PROPTOLIST))
-                SCENE.render.filepath = "%s/%s/%s/%s/%s_%s_%s_" % (PATH,SCENENAME,CURSC,layers.name,SCENENAME,SCENE.name,layers.name)
-                SCENE.render.layers[layers.name].use = 1
-                bpy.ops.render.render(animation=True, layer=layers.name, write_still=True, scene= SCENE.name)
-                print("DONE")
-                print("---------------------")
-            ## REESTABLECE LOS LAYERS
-            for layer in LAYERLIST:
-                layer.use = 1
-            ## RESTAURA EL PATH FINAL
-            SCENE.render.filepath = ENDPATH
-            #RESTAURO MATERIALES  DE OVERRIDES
-            for OBJECT in LISTMAT:
-                SLOTIND = 0
-                try:
-                    for SLOT in OBJECT[1]:
-                        OBJECT[0].material_slots[SLOTIND].material = SLOT
-                        SLOTIND += 1
-                except:
-                    print("OUT OF RANGE")
-            # RESTAURO FRAMES
-            if frametype == True:
-                SCENE.frame_start = FS
-                SCENE.frame_end = FE
-                SCENE.frame_end = FE
-                SCENE.frame_start = FS
-    # RESTAURO SCENE
-    bpy.context.window.screen.scene = ACTSCENE
-
-
-class renderSelected (bpy.types.Operator):
-    bl_idname="render.render_selected_scenes_osc"
-    bl_label="Render Selected Scenes"
-
-    frametype=bpy.props.BoolProperty(default=False)
-
-    def execute(self,context):
-        defRenderSelected(self.frametype)
-        return {'FINISHED'}
-
-
-
-
-##--------------------------------RENDER CURRENT SCENE----------------------------
-
-
-def defRenderCurrent (frametype):
-    LISTMAT = []
-    SCENE = bpy.context.scene
-    FC = bpy.context.scene.frame_current
-    FS = bpy.context.scene.frame_start
-    FE = bpy.context.scene.frame_end
-
-    print("---------------------")
-    ## GUARDO MATERIALES DE OBJETOS EN GRUPOS
-    for OBJECT in bpy.data.objects[:]:
-        SLOTLIST = []
-        try:
-            if OBJECT.type == "MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE":
-                for SLOT in OBJECT.material_slots[:]:
-                    SLOTLIST.append(SLOT.material)
-                LISTMAT.append((OBJECT,SLOTLIST))
-        except:
-            pass
-    PROPTOLIST = list(eval(SCENE['OVERRIDE']))
-    CURSC = SCENE.name
-    PATH = SCENE.render.filepath
-    ENDPATH = PATH
-    FILEPATH = bpy.data.filepath
-    if frametype == True:
-        bpy.context.scene.frame_start = FC
-        bpy.context.scene.frame_end = FC
-        bpy.context.scene.frame_end = FC
-        bpy.context.scene.frame_start = FC
-    ## SETEO MATERIALES  DE OVERRIDES
-    try:
-        for OVERRIDE in PROPTOLIST:
-            for OBJECT in bpy.data.groups[OVERRIDE[0]].objects[:]:
-                if OBJECT.type == "MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE":
-                    for SLOT in OBJECT.material_slots[:]:
-                        SLOT.material = bpy.data.materials[OVERRIDE[1]]
-    except:
-        pass
-    SCENENAME=os.path.basename(FILEPATH.rpartition(".")[0])
-    LAYERLIST=[]
-    for layer in SCENE.render.layers:
-        if layer.use == 1:
-            LAYERLIST.append(layer)
-    for layers in LAYERLIST:
-        for rl in LAYERLIST:
-            rl.use= 0
-        print("SCENE: "+CURSC)
-        print("LAYER: "+layers.name)
-        print("OVERRIDE: "+str(PROPTOLIST))
-        SCENE.render.filepath = "%s/%s/%s/%s/%s_%s_%s_" % (PATH,SCENENAME,CURSC,layers.name,SCENENAME,SCENE.name,layers.name)
-        SCENE.render.layers[layers.name].use = 1
-        bpy.ops.render.render(animation=True, layer=layers.name, write_still=1, scene= SCENE.name)
-        print("DONE")
-        print("---------------------")
-    ## REESTABLECE LOS LAYERS
-    for layer in LAYERLIST:
-        layer.use = 1
-    ## RESTAURA EL PATH FINAL
-    SCENE.render.filepath = ENDPATH
-    #RESTAURO MATERIALES  DE OVERRIDES
-    for OBJECT in LISTMAT:
-        SLOTIND = 0
-        try:
-            for SLOT in OBJECT[1]:
-                OBJECT[0].material_slots[SLOTIND].material=SLOT
-                SLOTIND += 1
-        except:
-            print("FUERA DE RANGO")
-    # RESTAURO FRAMES
-    if frametype == True:
-        SCENE.frame_start = FS
-        SCENE.frame_end = FE
-        SCENE.frame_end = FE
-        SCENE.frame_start = FS
-
-
-class renderCurrent (bpy.types.Operator):
-    bl_idname="render.render_current_scene_osc"
-    bl_label="Render Current Scene"
-
-    frametype=bpy.props.BoolProperty(default=False)
-
-    def execute(self,context):
-
-        defRenderCurrent(self.frametype)
-
-        return {'FINISHED'}
-
-
-##--------------------------RENDER CROP----------------------
-## CREO DATA PARA EL SLIDER
-bpy.types.Scene.rcPARTS = bpy.props.IntProperty(default=0, min=2, max=50, step=1)
-
-def OscRenderCropFunc():
-    SCENENAME = os.path.split(bpy.data.filepath)[-1].partition(".")[0]
-    PARTS = bpy.context.scene.rcPARTS
-    CHUNKYSIZE = 1/PARTS
-    FILEPATH = bpy.context.scene.render.filepath
-    bpy.context.scene.render.use_border = True
-    bpy.context.scene.render.use_crop_to_border = True
-    for PART in range(PARTS):
-        bpy.context.scene.render.border_min_y = PART*CHUNKYSIZE
-        bpy.context.scene.render.border_max_y = (PART*CHUNKYSIZE)+CHUNKYSIZE
-        bpy.context.scene.render.filepath = "%s_part%s" % (os.path.join(FILEPATH,SCENENAME,bpy.context.scene.name,SCENENAME),PART)
-        bpy.ops.render.render(animation=False, write_still=True)
-        
-    #RESTORE
-    bpy.context.scene.render.filepath = FILEPATH    
-        
-class renderCrop (bpy.types.Operator):
-    bl_idname="render.render_crop_osc"
-    bl_label="Render Crop: Render!"
-    def execute(self,context):
-        OscRenderCropFunc()
-        return {'FINISHED'}
-
-
-##------------------------ SEARCH AND SELECT ------------------------
-
-## SETEO VARIABLE DE ENTORNO
-bpy.types.Scene.SearchAndSelectOt = bpy.props.StringProperty(default="Object name initials")
-
-
-class SearchAndSelectOt(bpy.types.Operator):
-    bl_idname = "object.search_and_select_osc"
-    bl_label = "Search And Select"
-    bl_options = {"REGISTER", "UNDO"}
-    
-    start = bpy.props.BoolProperty(name="Start With", default=True)
-    count = bpy.props.BoolProperty(name="Contain", default=True)
-    end = bpy.props.BoolProperty(name="End", default=True)
-    
-    def execute(self, context):
-        for objeto in bpy.context.scene.objects:
-            variableNombre = bpy.context.scene.SearchAndSelectOt
-            if self.start:
-                if objeto.name.startswith(variableNombre):
-                    objeto.select = True
-            if self.count:
-                if objeto.name.count(variableNombre):
-                    objeto.select = True        
-            if self.end:
-                if objeto.name.count(variableNombre):
-                    objeto.select = True                          
-        return {'FINISHED'}
-
-##-------------------------RENAME OBJECTS----------------------------------
-
-## CREO VARIABLE
-bpy.types.Scene.RenameObjectOt = bpy.props.StringProperty(default="Type here")
-
-class renameObjectsOt (bpy.types.Operator):
-    bl_idname = "object.rename_objects_osc"
-    bl_label = "Rename Objects"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-        ## LISTA
-        listaObj = bpy.context.selected_objects[:]
-        for objeto in listaObj:
-            objeto.name = bpy.context.scene.RenameObjectOt
-        return {'FINISHED'}
-
-
-##-------------------------RESYM VG----------------------------------
-
-
-
-class resymVertexGroups (bpy.types.Operator):
-    bl_idname = "mesh.resym_vertex_weights_osc"
-    bl_label = "Resym Vertex Weights"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-
-        OBACTIVO = bpy.context.active_object
-        VGACTIVO = OBACTIVO.vertex_groups.active.index
-        
-        bpy.ops.object.mode_set(mode='EDIT')
-        BM = bmesh.from_edit_mesh(bpy.context.object.data)  
-        bpy.ops.mesh.select_all(action='DESELECT')
-        bpy.ops.object.vertex_group_select()
-        SELVER=[VERT.index for VERT in BM.verts[:] if VERT.select]
-        
-        if sys.platform.startswith("w"):
-            SYSBAR = "\\"
-        else:
-             SYSBAR = "/" 
-         
-        FILEPATH=bpy.data.filepath
-        ACTIVEFOLDER=FILEPATH.rpartition(SYSBAR)[0]
-        ENTFILEPATH= "%s%s%s_%s_SYM_TEMPLATE.xml" %  (ACTIVEFOLDER, SYSBAR, bpy.context.scene.name, bpy.context.object.name)
-        XML=open(ENTFILEPATH ,mode="r")
-        
-        SYMAP = eval(XML.readlines()[0])
-        
-
-        # SUMO LOS VERTICES QUE NO EXISTEN EN EL VG        
-        INL = [VERT for VERT in SYMAP if SYMAP[VERT] in SELVER if VERT!= SYMAP[VERT]] 
-        bpy.ops.mesh.select_all(action='DESELECT')
-
-        for VERT in INL:
-            BM.verts[VERT].select = True
-        bpy.ops.object.vertex_group_assign(new=False)    
-     
-
-        # PASO A WEIGHT Y SETEO LOS VALORES
-        bpy.ops.object.mode_set(mode='WEIGHT_PAINT')        
-        for VERT in INL:
-            print(VERT)
-            i = 0
-            for GRA in OBACTIVO.data.vertices[SYMAP[VERT]].groups[:]:
-                if GRA.group == VGACTIVO:
-                    print (i)
-                    EM = i                    
-                i+=1  
-            a = 0
-            for GRA in OBACTIVO.data.vertices[VERT].groups[:]:     
-                if GRA.group == VGACTIVO:
-                    print (a)
-                    REC = a
-                a+=1
-                    
-            OBACTIVO.data.vertices[VERT].groups[REC].weight = OBACTIVO.data.vertices[SYMAP[VERT]].groups[EM].weight  
-                
-
-        XML.close()
-        SYMAP.clear()  
-      
-
-        print("===============(JOB DONE)=============")
-        return {'FINISHED'}
-
-
-##------------------------ SHAPES LAYOUT SYMMETRICA ------------------------
-
-
-class CreateLayoutAsymmetrical(bpy.types.Operator):
-    bl_idname = "mesh.create_asymmetrical_layout_osc"
-    bl_label = "Asymmetrical Layout"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self, context):
-
-        SEL_OBJ= bpy.context.active_object
-        LISTA_KEYS = bpy.context.active_object.data.shape_keys.key_blocks[1:]
-        
-        ##MODOS
-        EDITMODE = "bpy.ops.object.mode_set(mode='EDIT')"
-        OBJECTMODE = "bpy.ops.object.mode_set(mode='OBJECT')"
-        POSEMODE = "bpy.ops.object.mode_set(mode='POSE')"
-        
-        ##CREA NOMBRES A LA ARMATURE
-        amtas = bpy.data.armatures.new("ArmatureData")
-        obas = bpy.data.objects.new("RIG_LAYOUT_"+SEL_OBJ.name, amtas)
-        
-        ##LINK A LA ESCENA
-        scn = bpy.context.scene
-        scn.objects.link(obas)
-        scn.objects.active = obas
-        obas.select = True
-        
-        ## CREO DATA PARA SLIDERS            
-        ## creo data para los contenedores
-        verticess = [(-.1,1,0),(.1,1,0),(.1,0,0),(-.1,0,0)]
-        edgess = [(0,1),(1,2),(2,3),(3,0)]            
-        mesh = bpy.data.meshes.new("%s_data_container" % (SEL_OBJ))
-        object = bpy.data.objects.new("GRAPHIC_CONTAINER_AS", mesh)
-        bpy.context.scene.objects.link(object)
-        mesh.from_pydata(verticess,edgess,[])
-        
-        eval(EDITMODE)
-        gx = 0
-        gy = 0        
-        
-        for keyblock in LISTA_KEYS:        
-            if keyblock.name[-2:] != "_L":
-                if keyblock.name[-2:] != "_R":
-                    ## OBJETO ACTIVO
-                    scn.objects.active = obas
-                    eval(EDITMODE)
-        
-                    ##CREA HUESOS        
-                    bone = amtas.edit_bones.new(keyblock.name)
-                    bone.head = (gx,0,0)
-                    bone.tail = (gx,0,1)
-                    
-                    bonectrl = amtas.edit_bones.new(keyblock.name+"_CTRL")
-                    bonectrl.head = (gy,0,0)
-                    bonectrl.tail = (gy,0,0.2)
-        
-                    ##EMPARENTA HUESOS
-                    ## EMPARENTO
-                    obas.data.edit_bones[bonectrl.name].parent = obas.data.edit_bones[bone.name]                         
-                    bpy.context.scene.objects.active = obas
-                    
-                    ##DESELECCIONA (modo edit)
-                    bpy.ops.armature.select_all(action="DESELECT")
-        
-                    ##CREA DRIVERS Y LOS CONECTA
-                    DR1 = keyblock.driver_add("value")
-                    DR1.driver.expression = "var"
-                    VAR2 = DR1.driver.variables.new()     
-                    VAR2.targets[0].id = obas
-                    VAR2.targets[0].bone_target = bonectrl.name
-                    VAR2.type = 'TRANSFORMS'
-                    VAR2.targets[0].transform_space = "LOCAL_SPACE"
-                    VAR2.targets[0].transform_type = "LOC_Y"       
-                    
-                    eval(POSEMODE)
-                    
-                    ## SETEO ICONOS
-                    obas.pose.bones[keyblock.name].custom_shape = object
-                    obas.pose.bones[keyblock.name+"_CTRL"].custom_shape = object
-                    
-                    ## SETEO CONSTRAINTS
-        
-                    bpy.data.objects["RIG_LAYOUT_"+SEL_OBJ.name].data.bones.active = bpy.data.objects["RIG_LAYOUT_"+SEL_OBJ.name].data.bones[keyblock.name+"_CTRL"]
-                    ## SUMO CONSTRAINT
-                    eval(POSEMODE)
-                    CNS = obas.pose.bones[keyblock.name+"_CTRL"].constraints.new(type='LIMIT_LOCATION')                        
-                    CNS.min_x = 0
-                    CNS.use_min_x = 1
-                    CNS.min_z = 0
-                    CNS.use_min_z = 1
-                    CNS.min_y = 0
-                    CNS.use_min_y = 1
-                    
-                    CNS.max_x =  0
-                    CNS.use_max_x = 1
-                    CNS.max_z =  0
-                    CNS.use_max_z = 1
-                    CNS.max_y =  1
-                    CNS.use_max_y = 1
-                    
-                    CNS.owner_space  = "LOCAL"
-                    CNS.use_transform_limit = True        
-        
-                    ## PARA QUE EL TEXTO FUNCIONE PASAMOS A OBJECT MODE
-                    eval(OBJECTMODE)
-        
-                    ## TEXTOS
-                    ## creo tipografias
-                    bpy.ops.object.text_add(location=(0,0,0))
-                    gx = gx+2.2
-                    gy = gy+2.2
-                    texto = bpy.context.object
-                    texto.data.body = keyblock.name
-                    texto.name = "TEXTO_"+keyblock.name
-        
-                    texto.rotation_euler[0] = math.pi/2
-                    texto.location.x = -.15
-                    texto.location.z = -.15
-                    texto.data.size = .2
-                    
-                    CNS = texto.constraints.new(type="COPY_LOCATION")
-                    CNS.target = obas
-                    CNS.subtarget = obas.pose.bones[keyblock.name].name
-                    CNS.use_offset = True  
-                              
-        
-
-        return {'FINISHED'}
-
-
-##------------------------ SAVE INCREMENTAL ------------------------
-
-class saveIncremental(bpy.types.Operator):
-    bl_idname = "file.save_incremental_osc"
-    bl_label = "Save Incremental File"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self, context):
-
-        # SI POSEE _V        
-        filepath = bpy.data.filepath
-        
-        if filepath.count("_v"):
-            strnum = filepath.rpartition("_v")[-1].rpartition(".blend")[0]
-            intnum = int(strnum)
-            modnum = strnum.replace(str(intnum),str(intnum+1))    
-            output = filepath.replace(strnum,modnum)
-            bpy.ops.wm.save_as_mainfile(filepath=output)   
-             
-        else:
-            output = filepath.rpartition(".blend")[0]+"_v01"
-            bpy.ops.wm.save_as_mainfile(filepath=output)         
-        
-        return {'FINISHED'}
-
-##------------------------ REPLACE FILE PATHS ------------------------
-
-bpy.types.Scene.oscSearchText = bpy.props.StringProperty(default="Search Text")
-bpy.types.Scene.oscReplaceText = bpy.props.StringProperty(default="Replace Text")
-
-class replaceFilePath(bpy.types.Operator):
-    bl_idname = "file.replace_file_path_osc"
-    bl_label = "Replace File Path"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self, context):
-        TEXTSEARCH = bpy.context.scene.oscSearchText
-        TEXTREPLACE = bpy.context.scene.oscReplaceText
-
-        for image in bpy.data.images:
-            image.filepath = image.filepath.replace(TEXTSEARCH,TEXTREPLACE)
-
-        return {'FINISHED'}
-
-
-##------------------------ DUPLICATE OBJECTS SYMMETRY ------------------------
-
-def duplicateSymmetrical (self, disconect):
-    for objeto in bpy.context.selected_objects:
-
-        OBSEL = objeto
-
-        #DESELECT AND SELECT OBJETO
-        bpy.ops.object.select_all(action='DESELECT')
-        objeto.select = 1
-        bpy.context.scene.objects.active = objeto
-
-        #DUPLICA
-        bpy.ops.object.duplicate(linked=1)
-
-        #OBJETO ACTIVO
-        OBDUP=bpy.context.active_object
-
-        print(OBDUP)
-
-        #SUMA DRIVER
-        OBDUP.driver_add("location")
-
-        ## LOCATIONS
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[0].driver.expression = "-var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[0].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[0].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[0].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[0].driver.variables[0].targets[0].transform_type = 'LOC_X'
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[1].driver.expression = "var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[1].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[1].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[1].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[1].driver.variables[0].targets[0].transform_type = 'LOC_Y'
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[2].driver.expression = "var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[2].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[2].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[2].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[2].driver.variables[0].targets[0].transform_type = 'LOC_Z'
-
-        ## SCALE
-        OBDUP.driver_add("scale")
-
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[3].driver.expression = "-var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[3].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[3].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[3].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[3].driver.variables[0].targets[0].transform_type = 'SCALE_X'
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[4].driver.expression = "var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[4].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[4].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[4].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[4].driver.variables[0].targets[0].transform_type = 'SCALE_Y'
-
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[5].driver.expression = "var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[5].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[5].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[5].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[5].driver.variables[0].targets[0].transform_type = 'SCALE_Z'
-
-
-        ## ROTATION
-        OBDUP.driver_add("rotation_euler")
-
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[6].driver.expression = "var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[6].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[6].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[6].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[6].driver.variables[0].targets[0].transform_type = 'ROT_X'
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[7].driver.expression = "-var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[7].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[7].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[7].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[7].driver.variables[0].targets[0].transform_type = 'ROT_Y'
-
-
-        #EXPRESION
-        OBDUP.animation_data.drivers[8].driver.expression = "-var"
-        #CREA VARIABLE
-        OBDUP.animation_data.drivers[8].driver.variables.new()
-        #MODIFICO VARIABLE
-        OBDUP.animation_data.drivers[8].driver.variables[0].type = "TRANSFORMS"
-        OBDUP.animation_data.drivers[8].driver.variables[0].targets[0].id = objeto
-        OBDUP.animation_data.drivers[8].driver.variables[0].targets[0].transform_type = 'ROT_Z'
-
-        if disconect != True:
-            bpy.ops.object.make_single_user(obdata=True, object=True)
-            bpy.context.active_object.driver_remove("location")
-            bpy.context.active_object.driver_remove("rotation_euler")
-            bpy.context.active_object.driver_remove("scale")
-
-
-class oscDuplicateSymmetricalOp (bpy.types.Operator):
-    bl_idname = "object.duplicate_object_symmetry_osc"
-    bl_label = "Oscurart Duplicate Symmetrical"
-    bl_options = {"REGISTER", "UNDO"}
-
-    desconecta = bpy.props.BoolProperty(name="Keep Connection", default=True)
-
-    def execute(self,context):
-
-        duplicateSymmetrical(self, self.desconecta)
-
-        return {'FINISHED'}
-
-
-##---------------------------BATCH MAKER------------------
-
-
-def defoscBatchMaker(TYPE):
-    # REVISO SISTEMA
-    if sys.platform.startswith("w"):
-        print("PLATFORM: WINDOWS")
-        SYSBAR = "\\"
-        EXTSYS = ".bat"
-        QUOTES = '"'
-    else:
-        print("PLATFORM:LINUX")
-        SYSBAR = "/"
-        EXTSYS = ".sh"
-        QUOTES = ''
-
-    # CREO VARIABLES
-    FILENAME = bpy.data.filepath.rpartition(SYSBAR)[-1].rpartition(".")[0]
-    BINDIR = bpy.app[4]
-    SHFILE = bpy.data.filepath.rpartition(SYSBAR)[0] + SYSBAR + FILENAME + EXTSYS
-    FILEBATCH = open(SHFILE,"w")
-
-    # SI ES LINUX LE DOY PERMISOS CHMOD
-    if EXTSYS == ".sh":
-        try:
-            os.chmod(SHFILE, stat.S_IRWXU)
-        except:
-            print("** Oscurart Batch maker can not modify the permissions.")    
-
-    # DEFINO ARCHIVO DE BATCH
-    FILEBATCH.writelines("%s%s%s -b %s -x 1 -o %s -P %s%s.py  -s %s -e %s -a" % (QUOTES,BINDIR,QUOTES,bpy.data.filepath,bpy.context.scene.render.filepath,bpy.data.filepath.rpartition(SYSBAR)[0]+SYSBAR,TYPE,str(bpy.context.scene.frame_start),str(bpy.context.scene.frame_end)) )
-    FILEBATCH.close()  
-
-
-    # DEFINO LOS ARCHIVOS DE SCRIPT
-    
-    RLATFILE =  "%s%sosRlat.py" % (bpy.data.filepath.rpartition(SYSBAR)[0] , SYSBAR )
-    if not os.path.isfile(RLATFILE):
-        FILESC = open(RLATFILE,"w")        
-        if EXTSYS == ".sh":
-            try:
-                os.chmod(RLATFILE, stat.S_IRWXU)  
-            except:
-                print("** Oscurart Batch maker can not modify the permissions.")                             
-        FILESC.writelines("import bpy \nbpy.ops.render.render_all_scenes_osc()\nbpy.ops.wm.quit_blender()")
-        FILESC.close()
-    else:
-        print("The All Python files Skips: Already exist!")   
-         
-    RSLATFILE = "%s%sosRSlat.py" % (bpy.data.filepath.rpartition(SYSBAR)[0] , SYSBAR)    
-    if not os.path.isfile(RSLATFILE):          
-        FILESSC = open(RSLATFILE,"w")          
-        if EXTSYS == ".sh":
-            try:
-                os.chmod(RSLATFILE, stat.S_IRWXU)   
-            except:
-                print("** Oscurart Batch maker can not modify the permissions.")                            
-        FILESSC.writelines("import bpy \nbpy.ops.render.render_selected_scenes_osc()\nbpy.ops.wm.quit_blender()")
-        FILESSC.close()
-    else:
-        print("The Selected Python files Skips: Already exist!")          
-
-class oscBatchMaker (bpy.types.Operator):
-    bl_idname = "file.create_batch_maker_osc"
-    bl_label = "Make render batch"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    type = bpy.props.EnumProperty(
-            name="Render Mode",
-            description="Select Render Mode.",
-            items=(('osRlat', "All Scenes", "Render All Layers At Time"),
-                   ('osRSlat', "Selected Scenes", "Render Only The Selected Scenes")),
-            default='osRlat',
-            )
-
-
-    def execute(self,context):
-        defoscBatchMaker(self.type)
-        return {'FINISHED'}
-
-
-##---------------------------REMOVE MODIFIERS Y APPLY MODIFIERS------------------
-
-class oscRemModifiers (bpy.types.Operator):
-    bl_idname = "object.modifiers_remove_osc"
-    bl_label = "Remove modifiers"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-        for objeto in bpy.context.selected_objects:
-            for modificador in objeto.modifiers:
-                print(modificador.type)
-                bpy.context.scene.objects.active=objeto
-                bpy.ops.object.modifier_remove(modifier=modificador.name)
-        return {'FINISHED'}
-
-class oscApplyModifiers (bpy.types.Operator):
-    bl_idname = "object.modifiers_apply_osc"
-    bl_label = "Apply modifiers"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-        for objeto in bpy.context.selected_objects:
-            bpy.ops.object.select_all(action='DESELECT')
-            bpy.context.scene.objects.active=objeto
-            objeto.select = True
-            if objeto.data.users >= 2:
-                bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True, material=False, texture=False, animation=False)
-            for modificador in objeto.modifiers:
-                try:
-                    bpy.ops.object.modifier_apply(apply_as="DATA", modifier=modificador.name)
-                except:
-                    bpy.ops.object.modifier_remove(modifier=modificador.name) 
-                    print("* Modifier %s skipping apply" % (modificador.name))   
-
-        return {'FINISHED'}
-
-
-##---------------------------SHAPES TO OBJECTS------------------
-
-class ShapeToObjects (bpy.types.Operator):
-    bl_idname = "object.shape_key_to_objects_osc"
-    bl_label = "Shapes To Objects"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-        OBJACT=bpy.context.active_object
-        for SHAPE in OBJACT.data.shape_keys.key_blocks[:]:
-            print(SHAPE.name)
-            bpy.ops.object.shape_key_clear()
-            SHAPE.value=1
-            mesh=OBJACT.to_mesh(bpy.context.scene, True, 'PREVIEW')
-            object=bpy.data.objects.new(SHAPE.name, mesh)
-            bpy.context.scene.objects.link(object)
-        return {'FINISHED'}
-
-
-##--------------------------OVERRIDES-----------------------------
-
-## PARA ESCENAS NUEVAS
-
-class OverridesOp (bpy.types.Operator):
-    bl_idname = "render.overrides_set_list"
-    bl_label = "Overrides set list"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-        for scene in bpy.data.scenes[:]:
-            try:
-                scene['OVERRIDE']
-            except:
-                scene['OVERRIDE']="[]"
-        return {'FINISHED'}
-
-
-###------------------------IMPORT EXPORT GROUPS--------------------
-
-class OscExportVG (bpy.types.Operator):
-    bl_idname = "file.export_groups_osc"
-    bl_label = "Export Groups"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-
-        OBSEL=bpy.context.active_object
-
-        if os.sys.platform.count("win"):
-            print("WINDOWS")
-            BAR = "\\"
-        else:
-            print("LINUX")
-            BAR = "/"
-        # VARIABLES
-        FILEPATH = bpy.data.filepath
-        FILE = open(FILEPATH.rpartition(BAR)[0] + BAR+OBSEL.name + ".xml", mode = "w")
-        VERTLIST = []
-
-        LENVER = len(OBSEL.data.vertices)
-
-        for VG in OBSEL.vertex_groups:
-            BONELIST = []
-            for VERTICE in range(0,LENVER):
-                try:
-                    BONELIST.append((VERTICE,VG.weight(VERTICE),VG.name,))
-                except:
-                    pass
-            VERTLIST.append(BONELIST)
-
-        ## CREO LA LISTA CON LOS NOMBRES DE LOS GRUPOS
-        NAMEGROUPLIST=[]
-        for VG in OBSEL.vertex_groups:
-            NAMEGROUPLIST.append(VG.name)
-
-        ## AGREGO LOS NOMBRES A LA LISTA
-        VERTLIST.append(NAMEGROUPLIST)
-
-        ## GUARDO Y CIERRO
-        FILE.writelines(str(VERTLIST))
-        FILE.close()
-
-        ## ---- CREO OTRO ARCHIVO PARA LA DATA ----
-        # VARIABLES
-        FILEPATH = bpy.data.filepath
-        FILE = open(FILEPATH.rpartition(BAR)[0] + BAR + OBSEL.name + "_DATA.xml", mode = "w")
-
-        DATAVER = []
-
-        for VERT in OBSEL.data.vertices[:]:
-            TEMP = 0
-            VGTEMP = 0
-            LISTVGTEMP = []
-
-            for GROUP in VERT.groups[:]:
-                LISTVGTEMP.append((GROUP.group,VGTEMP))
-                VGTEMP += 1
-
-            LISTVGTEMP=sorted(LISTVGTEMP)
-            for GROUP in VERT.groups[:]:
-                DATAVER.append((VERT.index,TEMP,VERT.groups[LISTVGTEMP[TEMP][1]].weight))
-                TEMP += 1
-
-
-        ## GUARDO Y CIERRO
-        FILE.writelines(str(DATAVER))
-        FILE.close()
-
-        return {'FINISHED'}
-
-class OscImportVG (bpy.types.Operator):
-    bl_idname = "file.import_groups_osc"
-    bl_label = "Import Groups"
-    bl_options = {"REGISTER", "UNDO"}
-    def execute(self,context):
-
-        OBSEL = bpy.context.active_object
-        # AVERIGUO EL SISTEMA
-        if os.sys.platform.count("win"):
-            print("WINDOWS")
-            BAR = "\\"
-        else:
-            print("LINUX")
-            BAR = "/"
-        # VARIABLES
-        FILEPATH = bpy.data.filepath
-        FILE = open(FILEPATH.rpartition(BAR)[0] + BAR + OBSEL.name + ".xml", mode="r")
-        VERTLIST = FILE.readlines(0)
-        VERTLIST = eval(VERTLIST[0])
-        VERTLISTR = VERTLIST[:-1]
-        GROUPLIST = VERTLIST[-1:]
-        VGINDEX = 0
-
-        ## MODO OBJECT
-        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-
-        for GROUP in GROUPLIST[0]:
-            #CREO GRUPO
-            bpy.ops.object.vertex_group_add()
-            #CAMBIO NOMBRE
-            OBSEL.vertex_groups[-1].name=GROUP
-
-
-
-        for VG in OBSEL.vertex_groups[:]:
-            # SETEO VG
-            bpy.ops.object.vertex_group_set_active(group=VG.name)
-            # EDIT
-            bpy.ops.object.mode_set(mode='EDIT')
-            # DESELECT
-            bpy.ops.mesh.select_all(action='DESELECT')
-            # OBJECT
-            bpy.ops.object.mode_set(mode='OBJECT')
-            # SELECCIONO LOS VERTICES
-            for VERTI in VERTLISTR[VG.index]:
-                OBSEL.data.vertices[VERTI[0]].select=1
-            ## SETEO EL VALOR DEL PESO
-            bpy.context.tool_settings.vertex_group_weight=1
-            # EDIT
-            bpy.ops.object.mode_set(mode='EDIT')
-            ## ASIGNO
-            bpy.ops.object.vertex_group_assign(new=False)
-
-        # CIERRO
-        FILE.close()
-
-
-        ## ----------- LEVANTO DATA ----
-        # VARIABLES
-        FILEPATH = bpy.data.filepath
-        FILE = open(FILEPATH.rpartition(BAR)[0]+BAR+OBSEL.name+"_DATA.xml", mode="r")
-        DATAPVER = FILE.readlines(0)
-        DATAPVER = eval(DATAPVER[0])
-
-        # PASO A MODO OBJECT
-        bpy.ops.object.mode_set(mode='OBJECT')
-
-        #for VERT in DATAPVER:
-        for VERT in DATAPVER:
-            OBSEL.data.vertices[VERT[0]].groups[VERT[1]].weight = VERT[2]
-
-        # CIERRO
-        FILE.close()
-
-
-        # PASO A MODO PINTURA DE PESO
-        bpy.ops.object.mode_set(mode='WEIGHT_PAINT')
-        return {'FINISHED'}
-
-
-## ------------------------------------ RELINK OBJECTS--------------------------------------
-
-
-def relinkObjects (self):
-
-    LISTSCENE=[]
-
-    for SCENE in bpy.data.scenes[:]:
-        if bpy.selection_osc[-1] in SCENE.objects[:]:
-            LISTSCENE.append(SCENE)
-
-    OBJECTS = bpy.selection_osc[:-1]
-    ACTOBJ = bpy.selection_osc[-1] 
-    OBJSEL = bpy.selection_osc[:]
-
-    ## REMUEVO ESCENA ACTIVA
-    LISTSCENE.remove(bpy.context.scene)
-
-    ## DESELECT
-    bpy.ops.object.select_all(action='DESELECT')
-
-    ## SELECT
-    for OBJETO in OBJECTS:
-        if OBJETO.users != len(bpy.data.scenes):
-            print(OBJETO.name)
-            OBJETO.select = True
-
-    ## LINK
-    for SCENE in LISTSCENE:
-        bpy.ops.object.make_links_scene(scene=SCENE.name)
-    
-    # REESTABLEZCO SELECCION
-    bpy.context.scene.objects.active=ACTOBJ
-    for OBJ in OBJSEL:
-        OBJ.select=True
-
-class OscRelinkObjectsBetween (bpy.types.Operator):
-    bl_idname = "objects.relink_objects_between_scenes"
-    bl_label = "Relink Objects Between Scenes"
-    bl_options = {"REGISTER", "UNDO"}
-
-
-    def execute (self, context):
-        relinkObjects(self)
-        return {'FINISHED'}
-
-
-## ------------------------------------ COPY GROUPS AND LAYERS--------------------------------------
-
-
-def CopyObjectGroupsAndLayers (self):
-
-    OBSEL=bpy.selection_osc[:]
-    GLOBALLAYERS=list(OBSEL[-1].layers[:])
-    ACTSCENE=bpy.context.scene
-    GROUPS=OBSEL[-1].users_group
-    ACTOBJ=OBSEL[-1]
-    
-    for OBJECT in OBSEL[:-1]:
-        for scene in bpy.data.scenes[:]:
-
-            # SI EL OBJETO ACTIVO ESTA EN LA ESCENA
-            if ACTOBJ in scene.objects[:] and OBJECT in scene.objects[:]:
-                scene.object_bases[OBJECT.name].layers[:] = scene.object_bases[ACTOBJ.name].layers[:] 
-            elif ACTOBJ not in scene.objects[:] and OBJECT in scene.objects[:]: 
-                scene.object_bases[OBJECT.name].layers[:] = list(GLOBALLAYERS)                  
-                
-        # REMUEVO DE TODO GRUPO
-        for GROUP in bpy.data.groups[:]:
-            if GROUP in OBJECT.users_group[:]:
-                GROUP.objects.unlink(OBJECT)
-                
-        # INCLUYO OBJETO EN GRUPOS    
-        for GROUP in GROUPS:
-            GROUP.objects.link(OBJECT)            
- 
-    bpy.context.window.screen.scene = ACTSCENE
-    bpy.context.scene.objects.active=ACTOBJ
-    
-class OscCopyObjectGAL (bpy.types.Operator):
-    bl_idname = "objects.copy_objects_groups_layers"
-    bl_label = "Copy Groups And Layers"
-    bl_options = {"REGISTER", "UNDO"}
-
-
-    def execute (self, context):
-        CopyObjectGroupsAndLayers (self)
-        return {'FINISHED'}
-
-
-## ------------------------------------ APPLY AND RESTORE OVERRIDES --------------------------------------
-
-def DefOscApplyOverrides(self):
-    LISTMAT = []
-    PROPTOLIST = list(eval(bpy.context.scene['OVERRIDE']))
-    # REVISO SISTEMA
-    if sys.platform.startswith("w"):
-        print("PLATFORM: WINDOWS")
-        SYSBAR = "\\"
-    else:
-        print("PLATFORM:LINUX")
-        SYSBAR = "/"
-    FILEPATH=bpy.data.filepath
-    ACTIVEFOLDER=FILEPATH.rpartition(SYSBAR)[0]
-    ENTFILEPATH= "%s%s%s_OVERRIDE.xml" %  (ACTIVEFOLDER, SYSBAR, bpy.context.scene.name)
-    XML=open(ENTFILEPATH ,mode="w")
-    ## GUARDO MATERIALES DE OBJETOS EN GRUPOS
-    
-    LISTMAT = { OBJ : [SLOT.material for SLOT in OBJ.material_slots[:]] for OBJ in bpy.data.objects[:] if OBJ.type == "MESH" or OBJ.type == "META" or OBJ.type == "CURVE" }
-    
-    
-    for OVERRIDE in PROPTOLIST:
-        for OBJECT in bpy.data.groups[OVERRIDE[0]].objects[:]:
-            if OBJECT.type == "MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE": 
-                if len(OBJECT.material_slots) > 0:                   
-                    for SLOT in OBJECT.material_slots[:]:
-                        SLOT.material = bpy.data.materials[OVERRIDE[1]]                    
-                else:
-                    print ("* %s have not Material Slots" % (OBJECT.name))         
-    
-
-    XML.writelines(str(LISTMAT))
-    XML.close()    
-    
-    
-def DefOscRestoreOverrides(self):    
-    # REVISO SISTEMA
-    if sys.platform.startswith("w"):
-        #print("PLATFORM: WINDOWS")
-        SYSBAR="\\"
-    else:
-        #print("PLATFORM:LINUX")
-        SYSBAR="/"
-
-    FILEPATH = bpy.data.filepath
-    ACTIVEFOLDER = FILEPATH.rpartition(SYSBAR)[0]
-    ENTFILEPATH = "%s%s%s_OVERRIDE.xml" %  (ACTIVEFOLDER, SYSBAR, bpy.context.scene.name)
-    XML = open(ENTFILEPATH, mode="r")
-    RXML = XML.readlines(0)
-
-    LISTMAT = dict(eval(RXML[0]))
-
-    # RESTAURO MATERIALES  DE OVERRIDES
-    
-    for OBJ in LISTMAT:            
-        if OBJ.type == "MESH" or OBJ.type == "META" or OBJ.type == "CURVE":
-            SLOTIND = 0
-            for SLOT in LISTMAT[OBJ]:
-                OBJ.material_slots[SLOTIND].material = SLOT  
-                SLOTIND += 1     
-        
-    # CIERRO
-    XML.close()
-
-    
-## HAND OPERATOR    
-class OscApplyOverrides(bpy.types.Operator):
-    bl_idname = "render.apply_overrides"
-    bl_label = "Apply Overrides in this Scene"
-    bl_options = {"REGISTER", "UNDO"}
-
-
-    def execute (self, context):
-        DefOscApplyOverrides(self)
-        return {'FINISHED'}
-
-class OscRestoreOverrides(bpy.types.Operator):
-    bl_idname = "render.restore_overrides"
-    bl_label = "Restore Overrides in this Scene"
-    bl_options = {"REGISTER", "UNDO"}
-
-
-    def execute (self, context):
-        DefOscRestoreOverrides(self)        
-        return {'FINISHED'}
-
-
-OVERRIDESSTATUS = False
-
-    
-class OscOverridesOn(bpy.types.Operator):
-    bl_idname = "render.overrides_on"
-    bl_label = "Turn On Overrides"
-    bl_options = {"REGISTER", "UNDO"}
-
-    def execute (self, context):
-        
-        global OVERRIDESSTATUS
-        
-        if OVERRIDESSTATUS == False:
-            bpy.app.handlers.render_pre.append(DefOscApplyOverrides)
-            bpy.app.handlers.render_post.append(DefOscRestoreOverrides)  
-            OVERRIDESSTATUS = True
-            print("Overrides on!")
-        else:    
-            bpy.app.handlers.render_pre.remove(DefOscApplyOverrides)
-            bpy.app.handlers.render_post.remove(DefOscRestoreOverrides)    
-            OVERRIDESSTATUS = False
-            print("Overrides off!")           
-        return {'FINISHED'}  
-
-
-
-## ------------------------------------ CHECK OVERRIDES --------------------------------------
-
-class OscCheckOverrides (bpy.types.Operator):
-    bl_idname = "render.check_overrides"
-    bl_label = "Check Overrides"
-    bl_options = {"REGISTER", "UNDO"}
-
-
-    def execute (self, context):
-        GROUPI = False
-        GLOBAL = 0
-        GLOBALERROR = 0
-
-        print("==== STARTING CHECKING ====")
-        print("")
-
-        for SCENE in bpy.data.scenes[:]:
-            MATLIST = []
-            MATI = False
-
-            for MATERIAL in bpy.data.materials[:]:
-                MATLIST.append(MATERIAL.name)
-
-            GROUPLIST=[]
-            for GROUP in bpy.data.groups[:]:
-                if GROUP.users > 0:
-                    GROUPLIST.append(GROUP.name)
-
-            print("   %s Scene is checking" % (SCENE.name))
-
-            for OVERRIDE in list(eval(SCENE['OVERRIDE'])):
-                # REVISO OVERRIDES EN GRUPOS
-                if OVERRIDE[0] in GROUPLIST:
-                    pass
-                else:
-                    print("** %s group are in conflict." % (OVERRIDE[0]))
-                    GROUPI = True
-                    GLOBALERROR += 1
-                # REVISO OVERRIDES EN GRUPOS
-                if OVERRIDE[1] in MATLIST:
-                    pass
-                else:
-                    print("** %s material are in conflict." % (OVERRIDE[1]))
-                    MATI = True
-                    GLOBALERROR += 1
-
-            if MATI is False:
-                print("-- Materials are ok.")
-            else:
-                GLOBAL+=1
-            if GROUPI is False:
-                print("-- Groups are ok.")
-            else:
-                GLOBAL+=1
-
-        if GLOBAL < 1:
-            self.report({'INFO'}, "Materials And Groups are Ok")
-        if GLOBALERROR > 0:
-            self.report({'WARNING'}, "Override Error: Look in the Console")
-        print("")
-
-        return {'FINISHED'}
-
-
-## ------------------------------------ SELECTION --------------------------------------
-bpy.selection_osc=[]
-
-def select_osc():
-    if bpy.context.mode == "OBJECT":
-        obj = bpy.context.object
-        sel = len(bpy.context.selected_objects)
-
-        if sel == 0:
-            bpy.selection_osc=[]
-        else:
-            if sel == 1:
-                bpy.selection_osc=[]
-                bpy.selection_osc.append(obj)
-            elif sel > len(bpy.selection_osc):
-                for sobj in bpy.context.selected_objects:
-                    if (sobj in bpy.selection_osc) == False:
-                        bpy.selection_osc.append(sobj)
-
-            elif sel < len(bpy.selection_osc):
-                for it in bpy.selection_osc:
-                    if (it in bpy.context.selected_objects) == False:
-                        bpy.selection_osc.remove(it)
-
-class OscSelection(bpy.types.Header):
-    bl_label = "Selection Osc"
-    bl_space_type = "VIEW_3D"
-
-    def __init__(self):
-        select_osc()
-
-    def draw(self, context):
-        """
-        layout = self.layout
-        row = layout.row()
-        row.label("Sels: "+str(len(bpy.selection_osc)))
-        """
-
-
-## ------------------------------------ RESYM MESH--------------------------------------
-
-
-def reSymSave (self):
-    
-    bpy.ops.object.mode_set(mode='EDIT')
-    
-    BM = bmesh.from_edit_mesh(bpy.context.object.data)   
-     
-    L = {VERT.index : [VERT.co[0],VERT.co[1],VERT.co[2]] for VERT in BM.verts[:] if VERT.co[0] < 0.0001}
-    R = {VERT.index : [-VERT.co[0],VERT.co[1],VERT.co[2]]  for VERT in BM.verts[:] if VERT.co[0] > -0.0001}
-    
-    SYMAP = {VERTL : VERTR for VERTR in R for VERTL in L if R[VERTR] == L[VERTL] }            
-    
-    if sys.platform.startswith("w"):
-        SYSBAR = "\\"
-    else:
-         SYSBAR = "/"   
-    
-    FILEPATH=bpy.data.filepath
-    ACTIVEFOLDER=FILEPATH.rpartition(SYSBAR)[0]
-    ENTFILEPATH= "%s%s%s_%s_SYM_TEMPLATE.xml" %  (ACTIVEFOLDER, SYSBAR, bpy.context.scene.name, bpy.context.object.name)
-    XML=open(ENTFILEPATH ,mode="w")
-    
-    XML.writelines(str(SYMAP))
-    XML.close()
-    SYMAP.clear()
-
-def reSymMesh (self, SELECTED, SIDE):
-    
-    bpy.ops.object.mode_set(mode='EDIT')
-    
-    BM = bmesh.from_edit_mesh(bpy.context.object.data)
-    
-    if sys.platform.startswith("w"):
-        SYSBAR = "\\"
-    else:
-         SYSBAR = "/" 
-    
-    FILEPATH=bpy.data.filepath
-    ACTIVEFOLDER=FILEPATH.rpartition(SYSBAR)[0]
-    ENTFILEPATH= "%s%s%s_%s_SYM_TEMPLATE.xml" %  (ACTIVEFOLDER, SYSBAR, bpy.context.scene.name, bpy.context.object.name)
-    XML=open(ENTFILEPATH ,mode="r")
-    
-    SYMAP = eval(XML.readlines()[0])    
-    
-    if SIDE == "+-":
-        if SELECTED:
-            for VERT in SYMAP:
-                if BM.verts[SYMAP[VERT]].select:
-                    if VERT == SYMAP[VERT]:
-                        BM.verts[VERT].co[0] = 0
-                        BM.verts[VERT].co[1] = BM.verts[SYMAP[VERT]].co[1]
-                        BM.verts[VERT].co[2] = BM.verts[SYMAP[VERT]].co[2]            
-                    else:    
-                        BM.verts[VERT].co[0] = -BM.verts[SYMAP[VERT]].co[0]
-                        BM.verts[VERT].co[1] = BM.verts[SYMAP[VERT]].co[1]
-                        BM.verts[VERT].co[2] = BM.verts[SYMAP[VERT]].co[2]        
-        else:    
-            for VERT in SYMAP:
-                if VERT == SYMAP[VERT]:
-                    BM.verts[VERT].co[0] = 0
-                    BM.verts[VERT].co[1] = BM.verts[SYMAP[VERT]].co[1]
-                    BM.verts[VERT].co[2] = BM.verts[SYMAP[VERT]].co[2]            
-                else:    
-                    BM.verts[VERT].co[0] = -BM.verts[SYMAP[VERT]].co[0]
-                    BM.verts[VERT].co[1] = BM.verts[SYMAP[VERT]].co[1]
-                    BM.verts[VERT].co[2] = BM.verts[SYMAP[VERT]].co[2]
-    else:
-        if SELECTED:
-            for VERT in SYMAP:
-                if BM.verts[VERT].select:
-                    if VERT == SYMAP[VERT]:
-                        BM.verts[SYMAP[VERT]].co[0] = 0
-                        BM.verts[SYMAP[VERT]].co[1] = BM.verts[VERT].co[1]
-                        BM.verts[SYMAP[VERT]].co[2] = BM.verts[VERT].co[2]            
-                    else:    
-                        BM.verts[SYMAP[VERT]].co[0] = -BM.verts[VERT].co[0]
-                        BM.verts[SYMAP[VERT]].co[1] = BM.verts[VERT].co[1]
-                        BM.verts[SYMAP[VERT]].co[2] = BM.verts[VERT].co[2]        
-        else:    
-            for VERT in SYMAP:
-                if VERT == SYMAP[VERT]:
-                    BM.verts[SYMAP[VERT]].co[0] = 0
-                    BM.verts[SYMAP[VERT]].co[1] = BM.verts[VERT].co[1]
-                    BM.verts[SYMAP[VERT]].co[2] = BM.verts[VERT].co[2]            
-                else:    
-                    BM.verts[SYMAP[VERT]].co[0] = -BM.verts[VERT].co[0]
-                    BM.verts[SYMAP[VERT]].co[1] = BM.verts[VERT].co[1]
-                    BM.verts[SYMAP[VERT]].co[2] = BM.verts[VERT].co[2]                        
-    
-    bpy.ops.object.mode_set(mode='OBJECT')
-    bpy.ops.object.mode_set(mode='EDIT')
-    
-    XML.close()
-    SYMAP.clear()
-
-
-class OscResymSave (bpy.types.Operator):
-    bl_idname = "mesh.resym_save_map"
-    bl_label = "Resym save XML Map"
-    bl_options = {"REGISTER", "UNDO"}
-
-
-    def execute (self, context):
-        reSymSave(self)
-        return {'FINISHED'}
-
-class OscResymMesh (bpy.types.Operator):
-    bl_idname = "mesh.resym_mesh"
-    bl_label = "Resym save Apply XML"
-    bl_options = {"REGISTER", "UNDO"}
-
-    selected=bpy.props.BoolProperty(default=False, name="Only Selected")
-    
-    side = bpy.props.EnumProperty(
-            name="Side_",
-            description="Select Side.",
-            items=(('+-', "+X to -X", "+X to -X"),
-                   ('-+', "-X to +X", "-X to +X")),
-            default='+-',
-            )    
-    
-    def execute (self, context):
-        reSymMesh(self, self.selected,self.side)
-        return {'FINISHED'}
-    
-##=============== DISTRIBUTE ======================    
-
-
-def ObjectDistributeOscurart (self, X, Y, Z):
-    if len(bpy.selection_osc[:]) > 1:
-        # VARIABLES
-        dif = bpy.selection_osc[-1].location-bpy.selection_osc[0].location
-        chunkglobal = dif/(len(bpy.selection_osc[:])-1)
-        chunkx = 0
-        chunky = 0
-        chunkz = 0
-        deltafst = bpy.selection_osc[0].location
-        
-        #ORDENA
-        for OBJECT in bpy.selection_osc[:]:          
-            if X:  OBJECT.location.x=deltafst[0]+chunkx
-            if Y:  OBJECT.location[1]=deltafst[1]+chunky
-            if Z:  OBJECT.location.z=deltafst[2]+chunkz
-            chunkx+=chunkglobal[0]
-            chunky+=chunkglobal[1]
-            chunkz+=chunkglobal[2]
-    else:  
-        self.report({'ERROR'}, "Selection is only 1!")      
-    
-class DialogDistributeOsc(bpy.types.Operator):
-    bl_idname = "object.distribute_osc"
-    bl_label = "Distribute Objects"       
-    Boolx = bpy.props.BoolProperty(name="X")
-    Booly = bpy.props.BoolProperty(name="Y")
-    Boolz = bpy.props.BoolProperty(name="Z")
-    
-    def execute(self, context):
-        ObjectDistributeOscurart(self, self.Boolx,self.Booly,self.Boolz)
-        return {'FINISHED'}
-    def invoke(self, context, event):
-        self.Boolx = True
-        self.Booly = True
-        self.Boolz = True        
-        return context.window_manager.invoke_props_dialog(self)
-    
-##--------------------------------- OVERRIDES PANEL ---------------------------------- 
-   
-class OscOverridesGUI(bpy.types.Panel):
-    bl_label = "Oscurart Material Overrides"
-    bl_idname = "Oscurart Overrides List"
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "render"
-    def draw(self,context):
-        
-        layout = self.layout
-        col = layout.column(align=1)
-        colrow = col.row(align=1)
-        colrow.operator("render.overrides_add_slot", icon = "ZOOMIN") 
-        colrow.operator("render.overrides_remove_slot", icon = "ZOOMOUT")         
-        col.operator("render.overrides_transfer", icon = "SHORTDISPLAY") 
-        i = 0
-        for m in bpy.context.scene.ovlist:
-            colrow = col.row(align=1)
-            colrow.prop_search(m, "grooverride", bpy.data, "groups", text= "")  
-            colrow.prop_search(m, "matoverride", bpy.data, "materials", text= "")
-            if i != len(bpy.context.scene.ovlist)-1:
-                pa = colrow.operator("ovlist.move_down", text="", icon="TRIA_DOWN")
-                pa.index = i                
-            if i > 0:
-                p = colrow.operator("ovlist.move_up", text="", icon="TRIA_UP")
-                p.index = i
-            pb = colrow.operator("ovlist.kill", text="", icon="X")            
-            pb.index = i
-            i+=1
- 
-class OscOverridesUp (bpy.types.Operator): 
-    bl_idname = 'ovlist.move_up'
-    bl_label = 'Move Override up'
-    bl_options = {'INTERNAL'}
-   
-    index = bpy.props.IntProperty(min=0)
-   
-    @classmethod
-    def poll(self,context):
-        return len(context.scene.ovlist) 
-    def execute(self,context):
-        ovlist = context.scene.ovlist
-        ovlist.move(self.index,self.index-1) 
-
-        return {'FINISHED'}   
-
-class OscOverridesDown (bpy.types.Operator): 
-    bl_idname = 'ovlist.move_down'
-    bl_label = 'Move Override down'
-    bl_options = {'INTERNAL'}
-   
-    index = bpy.props.IntProperty(min=0)
-   
-    @classmethod
-    def poll(self,context):
-        return len(context.scene.ovlist) 
-    def execute(self,context):
-        ovlist = context.scene.ovlist
-        ovlist.move(self.index,self.index+1) 
-        return {'FINISHED'}              
-
-class OscOverridesKill (bpy.types.Operator): 
-    bl_idname = 'ovlist.kill'
-    bl_label = 'Kill Override'
-    bl_options = {'INTERNAL'}
-   
-    index = bpy.props.IntProperty(min=0)
-   
-    @classmethod
-    def poll(self,context):
-        return len(context.scene.ovlist) 
-    def execute(self,context):
-        ovlist = context.scene.ovlist  
-        ovlist.remove(self.index)  
-        return {'FINISHED'}              
-
-
-class OscOverridesProp(bpy.types.PropertyGroup):
-    matoverride = bpy.props.StringProperty() 
-    grooverride = bpy.props.StringProperty()        
-        
-bpy.utils.register_class(OscOverridesGUI)
-bpy.utils.register_class(OscOverridesProp)
-bpy.types.Scene.ovlist = bpy.props.CollectionProperty(type=OscOverridesProp)        
-
-
-class OscTransferOverrides (bpy.types.Operator):    
-    """Tooltip"""
-    bl_idname = "render.overrides_transfer"
-    bl_label = "Transfer Overrides"
-
-    def execute(self, context):
-        # CREO LISTA
-        OSCOV = [[OVERRIDE.grooverride,OVERRIDE.matoverride]for OVERRIDE in bpy.context.scene.ovlist[:] if OVERRIDE.matoverride != "" if OVERRIDE.grooverride != ""]
-
-        bpy.context.scene["OVERRIDE"] = str(OSCOV)
-        return {'FINISHED'}   
-    
-class OscAddOverridesSlot (bpy.types.Operator):    
-    """Tooltip"""
-    bl_idname = "render.overrides_add_slot"
-    bl_label = "Add Override Slot"
-
-    def execute(self, context):
-        prop = bpy.context.scene.ovlist.add()
-        prop.matoverride = ""
-        prop.grooverride = ""
-        return {'FINISHED'}      
-
-class OscRemoveOverridesSlot (bpy.types.Operator):    
-    """Tooltip"""
-    bl_idname = "render.overrides_remove_slot"
-    bl_label = "Remove Override Slot"
-
-    def execute(self, context):
-        bpy.context.scene.ovlist.remove(len(bpy.context.scene.ovlist)-1)
-        return {'FINISHED'} 
-    
-bpy.utils.register_class(OscTransferOverrides)
-bpy.utils.register_class(OscAddOverridesSlot)
-bpy.utils.register_class(OscRemoveOverridesSlot)
-
-## --------------------------------------PYTHON BATCH--------------------------------------------------------
-def defoscPythonBatchMaker(BATCHTYPE,SIZE):
-    # REVISO SISTEMA
-    if sys.platform.startswith("w"):
-        print("PLATFORM: WINDOWS")
-        SYSBAR = "\\"
-        EXTSYS = ".bat"
-        QUOTES = '"'
-    else:
-        print("PLATFORM:LINUX")
-        SYSBAR = "/"
-        EXTSYS = ".sh"    
-        QUOTES = ''
-    
-    # CREO VARIABLES
-    FILENAME = bpy.data.filepath.rpartition(SYSBAR)[-1].rpartition(".")[0]
-    SHFILE = "%s%s%s_PythonSecureBatch.py"   % (bpy.data.filepath.rpartition(SYSBAR)[0],SYSBAR,FILENAME)
-    BATCHLOCATION = "%s%s%s%s"   % (bpy.data.filepath.rpartition(SYSBAR)[0],SYSBAR,FILENAME,EXTSYS)
-
-    FILEBATCH = open(SHFILE,"w")
-    
-    if EXTSYS == ".bat":
-        BATCHLOCATION=BATCHLOCATION.replace("\\","/")    
-    
-    # SI EL OUTPUT TIENE DOBLE BARRA LA REEMPLAZO
-    FRO=bpy.context.scene.render.filepath        
-    if bpy.context.scene.render.filepath.count("//"):
-        FRO=bpy.context.scene.render.filepath.replace("//", bpy.data.filepath.rpartition(SYSBAR)[0]+SYSBAR)         
-    if EXTSYS == ".bat":
-        FRO=FRO.replace("\\","/")        
-          
-        
-                 
-    #CREO BATCH
-    bpy.ops.file.create_batch_maker_osc(type=BATCHTYPE)
-    
-    SCRIPT = "import os \nREPITE= True \nBAT= '%s'\nSCENENAME ='%s' \nDIR='%s%s' \ndef RENDER():\n    os.system(BAT) \ndef CLEAN():\n    global REPITE\n    FILES  = [root+'/'+FILE for root, dirs, files in os.walk(os.getcwd()) if len(files) > 0 for FILE in files if FILE.count('~') == False]\n    RESPUESTA=False\n    for FILE in FILES:\n        if os.path.getsize(FILE) < %s:\n            os.remove(FILE)\n            RESPUESTA= True\n    if RESPUESTA:\n        REPITE=True\n    else:\n        REPITE=False\nREPITE=True\nwhile REPITE:\n    global REPITE\n    REPITE=False\n    RENDER()\n    os.chdir(DIR)\n    CLEAN()" % (BATCHLOCATION,FILENAME,FRO,FILENAME,SIZE)
-    
-    
-    # DEFINO ARCHIVO DE BATCH
-    FILEBATCH.writelines(SCRIPT)
-    FILEBATCH.close()  
-    
-    
-    # ARCHIVO CALL
-    CALLFILENAME = bpy.data.filepath.rpartition(SYSBAR)[-1].rpartition(".")[0]
-    CALLFILE = "%s%s%s_CallPythonSecureBatch%s"   % (bpy.data.filepath.rpartition(SYSBAR)[0],SYSBAR,CALLFILENAME,EXTSYS)  
-    CALLFILEBATCH = open(CALLFILE,"w")  
-    
-    SCRIPT = "python %s" % (SHFILE)
-    CALLFILEBATCH.writelines(SCRIPT)
-    CALLFILEBATCH.close()
-    
-    if EXTSYS == ".sh":
-        try:
-            os.chmod(CALLFILE, stat.S_IRWXU)  
-            os.chmod(SHFILE, stat.S_IRWXU) 
-        except:
-            print("** Oscurart Batch maker can not modify the permissions.")      
-    
-    
-    
-class oscPythonBatchMaker (bpy.types.Operator):
-    bl_idname = "file.create_batch_python"
-    bl_label = "Make Batch Python"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    size = bpy.props.IntProperty(name="Size in Bytes", default=10, min=0)
-    
-    type = bpy.props.EnumProperty(
-            name="Render Mode",
-            description="Select Render Mode.",
-            items=(('osRlat', "All Scenes", "Render All Layers At Time"),
-                   ('osRSlat', "Selected Scenes", "Render Only The Selected Scenes")),
-            default='osRlat',
-            )
-
-    def execute(self,context):
-        defoscPythonBatchMaker(self.type, self.size)
-        return {'FINISHED'}
- 
-##======================================================================================FIN DE SCRIPTS
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/particle_hair_lab.py b/release/scripts/addons_contrib/particle_hair_lab.py
deleted file mode 100644
index 100db79..0000000
--- a/release/scripts/addons_contrib/particle_hair_lab.py
+++ /dev/null
@@ -1,1503 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Grass Lab",
-    "author": "Ondrej Raha(lokhorn), meta-androcto",
-    "version": (0,5),
-    "blender": (2, 60, 0),
-    "location": "View3D > Tool Shelf > Grass Preset Panel",
-    "description": "Creates particle grass with material",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/Hair_Lab",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=30238",
-    "category": "Object"}
-
-
-import bpy
-from bpy.props import *
-
-# Returns the action we want to take
-def getActionToDo(obj):
-    if not obj or obj.type != 'MESH':
-        return 'NOT_OBJ_DO_NOTHING'
-    elif obj.type == 'MESH':
-        return 'GENERATE'
-    else:
-        return "DO_NOTHING"
-
-# TO DO
-"""
-class saveSelectionPanel(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-
-    bl_label = "Selection Save"
-    bl_options = {'DEFAULT_CLOSED'}
-    bl_context = "particlemode"
-    
-
-    def draw(self, context):
-        layout = self.layout
-        col = layout.column(align=True)
-        
-        col.operator("save.selection", text="Save Selection 1")
-"""
-######GRASS########################
-class grassLabPanel(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Grass Lab"
-    bl_context = "objectmode"
-    bl_options = {'DEFAULT_CLOSED'}  
-
-    def draw(self, context):
-        active_obj = bpy.context.active_object
-        active_scn = bpy.context.scene.name
-        layout = self.layout
-        col = layout.column(align=True)
-        
-        WhatToDo = getActionToDo(active_obj)
-      
-        
-        if WhatToDo == "GENERATE":
-            col.operator("grass.generate_grass", text="Create grass")
-
-            col.prop(context.scene, "grass_type")
-        else:
-            col.label(text="Select mesh object")
-        
-        if active_scn == "TestgrassScene":
-            col.operator("grass.switch_back", text="Switch back to scene")
-        else:
-            col.operator("grass.test_scene", text="Create Test Scene")
-
-# TO DO
-"""
-class saveSelection(bpy.types.Operator):
-    bl_idname = "save.selection"
-    bl_label = "Save Selection"
-    bl_description = "Save selected particles"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        
-        return {'FINISHED'}
-"""
-class testScene1(bpy.types.Operator):
-    bl_idname = "grass.switch_back"
-    bl_label = "Switch back to scene"
-    bl_description = "If you want keep this scene, switch scene in info window"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        scene = bpy.context.scene
-        bpy.data.scenes.remove(scene)
-        
-        return {'FINISHED'}
-        
-        
-class testScene2(bpy.types.Operator):
-    bl_idname = "grass.test_scene"
-    bl_label = "Create test scene"
-    bl_description = "You can switch scene in info panel"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-# add new scene
-        bpy.ops.scene.new(type="NEW")
-        scene = bpy.context.scene
-        scene.name = "TestgrassScene"
-# render settings
-        render = scene.render
-        render.resolution_x = 1920
-        render.resolution_y = 1080
-        render.resolution_percentage = 50
-# add new world
-        world = bpy.data.worlds.new("grassWorld")
-        scene.world = world
-        world.use_sky_blend = True
-        world.use_sky_paper = True
-        world.horizon_color = (0.004393,0.02121,0.050)
-        world.zenith_color = (0.03335,0.227,0.359)
-       
-# add text
-        bpy.ops.object.text_add(location=(-0.292,0,-0.152), rotation =(1.571,0,0))
-        text = bpy.context.active_object
-        text.scale = (0.05,0.05,0.05)
-        text.data.body = "Grass Lab"
-        
-# add material to text
-        textMaterial = bpy.data.materials.new('textMaterial')
-        text.data.materials.append(textMaterial)
-        textMaterial.use_shadeless = True
-        
-# add camera
-        bpy.ops.object.camera_add(location = (0,-1,0),rotation = (1.571,0,0))
-        cam = bpy.context.active_object.data
-        cam.lens = 50
-        cam.draw_size = 0.1
-        
-# add spot lamp
-        bpy.ops.object.lamp_add(type="SPOT", location = (-0.7,-0.5,0.3), rotation =(1.223,0,-0.960))
-        lamp1 = bpy.context.active_object.data
-        lamp1.name = "Key Light"
-        lamp1.energy = 1.5
-        lamp1.distance = 1.5
-        lamp1.shadow_buffer_soft = 5
-        lamp1.shadow_buffer_size = 8192
-        lamp1.shadow_buffer_clip_end = 1.5
-        lamp1.spot_blend = 0.5
-        
-# add spot lamp2
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.7,-0.6,0.1), rotation =(1.571,0,0.785))
-        lamp2 = bpy.context.active_object.data
-        lamp2.name = "Fill Light"
-        lamp2.color = (0.874,0.874,1)
-        lamp2.energy = 0.5
-        lamp2.distance = 1.5
-        lamp2.shadow_buffer_soft = 5
-        lamp2.shadow_buffer_size = 4096
-        lamp2.shadow_buffer_clip_end = 1.5
-        lamp2.spot_blend = 0.5
-        
-# light Rim
-        """
-        # add spot lamp3
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.191,0.714,0.689), rotation =(0.891,0,2.884))
-        lamp3 = bpy.context.active_object.data
-        lamp3.name = "Rim Light"
-        lamp3.color = (0.194,0.477,1)
-        lamp3.energy = 3
-        lamp3.distance = 1.5
-        lamp3.shadow_buffer_soft = 5
-        lamp3.shadow_buffer_size = 4096
-        lamp3.shadow_buffer_clip_end = 1.5
-        lamp3.spot_blend = 0.5
-        """
-# add sphere
-# add sphere
-        bpy.ops.mesh.primitive_uv_sphere_add(size=0.1)
-        bpy.ops.object.shade_smooth()
-		
-        return {'FINISHED'}
-
-
-class Generategrass(bpy.types.Operator):
-    bl_idname = "grass.generate_grass"
-    bl_label = "Generate grass"
-    bl_description = "Create a grass"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-# Make variable that is the current .blend file main data blocks
-        blend_data = context.blend_data
-        ob = bpy.context.active_object
-        scene = context.scene
-
-######################################################################
-########################Test screen grass########################
-        if scene.grass_type == '0':              
-            
-###############Create New Material##################
-# add new material
-            grassMaterial = bpy.data.materials.new('greengrassMat')
-            ob.data.materials.append(grassMaterial)
-            
-#Material settings
-            grassMaterial.preview_render_type = "HAIR"
-            grassMaterial.diffuse_color = (0.09710, 0.288, 0.01687)
-            grassMaterial.specular_color = (0.604, 0.465, 0.136)
-            grassMaterial.specular_intensity = 0.3
-            grassMaterial.ambient = 0
-            grassMaterial.use_cubic = True
-            grassMaterial.use_transparency = True
-            grassMaterial.alpha = 0
-            grassMaterial.use_transparent_shadows = True
-            #strand
-            grassMaterial.strand.use_blender_units = True
-            grassMaterial.strand.root_size = 0.00030
-            grassMaterial.strand.tip_size = 0.00010
-            grassMaterial.strand.size_min = 0.7
-            grassMaterial.strand.width_fade = 0.1
-            grassMaterial.strand.shape = 0.061
-            grassMaterial.strand.blend_distance = 0.001
-            
-            
-# add texture
-            grassTex = bpy.data.textures.new("greengrassTex", type='BLEND')
-            grassTex.use_preview_alpha = True
-            grassTex.use_color_ramp = True
-            ramp = grassTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.114,0.375,0.004025,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.267,0.155,0.02687,0]
-            rampElement1 = rampElements.new(0.111)
-            rampElement1.color = [0.281,0.598,0.03157,0.65]
-            rampElement2 = rampElements.new(0.366)
-            rampElement2.color = [0.119,0.528,0.136,0.87]
-            rampElement3 = rampElements.new(0.608)
-            rampElement3.color = [0.247,0.713,0.006472,0.8]
-            rampElement4 = rampElements.new(0.828)
-            rampElement4.color = [0.01943,0.163,0.01242,0.64]
-    
-# add texture to material
-            MTex = grassMaterial.texture_slots.add()
-            MTex.texture = grassTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-            
-            
-            
-###############  Create Particles  ##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            grassParticles = bpy.context.object.particle_systems.active
-            grassParticles.name = "greengrassPar"
-            grassParticles.settings.type = "HAIR"
-            grassParticles.settings.use_advanced_hair = True
-            grassParticles.settings.count = 500
-            grassParticles.settings.normal_factor = 0.05
-            grassParticles.settings.factor_random = 0.001
-            grassParticles.settings.use_dynamic_rotation = True
-            
-            grassParticles.settings.material = NumberOfMaterials
-            
-            grassParticles.settings.use_strand_primitive = True
-            grassParticles.settings.use_hair_bspline = True
-            grassParticles.settings.render_step = 5
-            grassParticles.settings.length_random = 0.5
-            grassParticles.settings.draw_step = 5
-# children
-            grassParticles.settings.rendered_child_count = 50
-            grassParticles.settings.child_type = "INTERPOLATED"
-            grassParticles.settings.child_length = 0.250
-            grassParticles.settings.create_long_hair_children = True
-            grassParticles.settings.clump_shape = 0.074
-            grassParticles.settings.clump_factor = 0.55
-            grassParticles.settings.roughness_endpoint = 0.080
-            grassParticles.settings.roughness_end_shape = 0.80
-            grassParticles.settings.roughness_2 = 0.043
-            grassParticles.settings.roughness_2_size = 0.230
-        
-        
-######################################################################
-######################  Field Grass  ########################
-        if scene.grass_type == '1':
-###############Create New Material##################
-# add new material
-            grassMaterial = bpy.data.materials.new('fieldgrassMat')
-            ob.data.materials.append(grassMaterial)
-            
-#Material settings
-            grassMaterial.preview_render_type = "HAIR"
-            grassMaterial.diffuse_color = (0.229, 0.800, 0.010)
-            grassMaterial.specular_color = (0.010, 0.06072, 0.000825)
-            grassMaterial.specular_intensity = 0.3
-            grassMaterial.specular_hardness = 100
-            grassMaterial.use_specular_ramp = True
-            
-            ramp = grassMaterial.specular_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.0356,0.0652,0.009134,0]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.352,0.750,0.231,1]
-            rampElement1 = rampElements.new(0.255)
-            rampElement1.color = [0.214,0.342,0.0578,0.31]
-            rampElement2 = rampElements.new(0.594)
-            rampElement2.color = [0.096,0.643,0.0861,0.72]
-            
-            grassMaterial.ambient = 0
-            grassMaterial.use_cubic = True
-            grassMaterial.use_transparency = True
-            grassMaterial.alpha = 0
-            grassMaterial.use_transparent_shadows = True
-            #strand
-            grassMaterial.strand.use_blender_units = True
-            grassMaterial.strand.root_size = 0.00030
-            grassMaterial.strand.tip_size = 0.00015
-            grassMaterial.strand.size_min = 0.450
-            grassMaterial.strand.width_fade = 0.1
-            grassMaterial.strand.shape = 0.02
-            grassMaterial.strand.blend_distance = 0.001
-            
-            
-# add texture
-            grassTex = bpy.data.textures.new("feildgrassTex", type='BLEND')
-            grassTex.name = "feildgrassTex"
-            grassTex.use_preview_alpha = True
-            grassTex.use_color_ramp = True
-            ramp = grassTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.009721,0.006049,0.003677,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.04231,0.02029,0.01444,0.16]
-            rampElement1 = rampElements.new(0.111)
-            rampElement1.color = [0.01467,0.005307,0.00316,0.65]
-            rampElement2 = rampElements.new(0.366)
-            rampElement2.color = [0.0272,0.01364,0.01013,0.87]
-            rampElement3 = rampElements.new(0.608)
-            rampElement3.color = [0.04445,0.02294,0.01729,0.8]
-            rampElement4 = rampElements.new(0.828)
-            rampElement4.color = [0.04092,0.0185,0.01161,0.64]
-            
-# add texture to material
-            MTex = grassMaterial.texture_slots.add()
-            MTex.texture = grassTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-            
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            grassParticles = bpy.context.object.particle_systems.active
-            grassParticles.name = "fieldgrassPar"
-            grassParticles.settings.type = "HAIR"
-            grassParticles.settings.use_emit_random = True
-            grassParticles.settings.use_even_distribution = True
-            grassParticles.settings.use_advanced_hair = True
-            grassParticles.settings.count = 2000
-#Particle settings Velocity
-            grassParticles.settings.normal_factor = 0.060
-            grassParticles.settings.factor_random = 0.045
-            grassParticles.settings.use_dynamic_rotation = False
-            grassParticles.settings.brownian_factor = 0.070
-            grassParticles.settings.damping = 0.160
-            grassParticles.settings.material = NumberOfMaterials
- # strands           
-            grassParticles.settings.use_strand_primitive = True
-            grassParticles.settings.use_hair_bspline = True
-            grassParticles.settings.render_step = 7
-            grassParticles.settings.length_random = 1.0
-            grassParticles.settings.draw_step = 2
-# children
-            grassParticles.settings.child_type = "INTERPOLATED"
-            grassParticles.settings.child_length = 0.160
-            grassParticles.settings.create_long_hair_children = False
-            grassParticles.settings.clump_factor = 0.000
-            grassParticles.settings.clump_shape = 0.000
-            grassParticles.settings.roughness_endpoint = 0.000
-            grassParticles.settings.roughness_end_shape = 1
-            grassParticles.settings.roughness_2 = 0.200
-            grassParticles.settings.roughness_2_size = 0.230
-        
-        
-######################################################################
-########################Short Clumpped grass##########################
-        elif scene.grass_type == '2':
-###############Create New Material##################
-# add new material
-            grassMaterial = bpy.data.materials.new('clumpygrassMat')
-            ob.data.materials.append(grassMaterial)
-            
-#Material settings
-            grassMaterial.preview_render_type = "HAIR"
-            grassMaterial.diffuse_color = (0.01504, 0.05222, 0.007724)
-            grassMaterial.specular_color = (0.02610, 0.196, 0.04444)
-            grassMaterial.specular_intensity = 0.5
-            grassMaterial.specular_hardness = 100
-            grassMaterial.ambient = 0
-            grassMaterial.use_cubic = True
-            grassMaterial.use_transparency = True
-            grassMaterial.alpha = 0
-            grassMaterial.use_transparent_shadows = True
-#strand
-            grassMaterial.strand.use_blender_units = True
-            grassMaterial.strand.root_size = 0.000315
-            grassMaterial.strand.tip_size = 0.00020
-            grassMaterial.strand.size_min = 0.2
-            grassMaterial.strand.width_fade = 0.1
-            grassMaterial.strand.shape = -0.900
-            grassMaterial.strand.blend_distance = 0.001
-            
-# add texture
-            grassTex = bpy.data.textures.new("clumpygrasstex", type='BLEND')
-            grassTex.use_preview_alpha = True
-            grassTex.use_color_ramp = True
-            ramp = grassTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.004025,0.002732,0.002428,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.141,0.622,0.107,0.2]
-            rampElement1 = rampElements.new(0.202)
-            rampElement1.color = [0.01885,0.2177,0.01827,0.65]
-            rampElement2 = rampElements.new(0.499)
-            rampElement2.color = [0.114,0.309,0.09822,0.87]
-            rampElement3 = rampElements.new(0.828)
-            rampElement3.color = [0.141,0.427,0.117,0.64]
-            
-# add texture to material
-            MTex = grassMaterial.texture_slots.add()
-            MTex.texture = grassTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-            
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            grassParticles = bpy.context.object.particle_systems.active
-            grassParticles.name = "clumpygrass"
-            grassParticles.settings.type = "HAIR"
-            grassParticles.settings.use_advanced_hair = True
-            grassParticles.settings.hair_step = 2
-            grassParticles.settings.count = 250
-            grassParticles.settings.normal_factor = 0.0082
-            grassParticles.settings.tangent_factor = 0.001
-            grassParticles.settings.tangent_phase = 0.250
-            grassParticles.settings.factor_random = 0.001
-            grassParticles.settings.use_dynamic_rotation = True
-            
-            grassParticles.settings.material = NumberOfMaterials
-            
-            grassParticles.settings.use_strand_primitive = True
-            grassParticles.settings.use_hair_bspline = True
-            grassParticles.settings.render_step = 3
-            grassParticles.settings.length_random = 0.3
-            grassParticles.settings.draw_step = 3
-# children
-            grassParticles.settings.child_type = "INTERPOLATED"
-            grassParticles.settings.child_length = 0.667
-            grassParticles.settings.child_length_threshold = 0.111
-            grassParticles.settings.rendered_child_count = 200
-            grassParticles.settings.virtual_parents = 1
-            grassParticles.settings.clump_factor = 0.425
-            grassParticles.settings.clump_shape = -0.999
-            grassParticles.settings.roughness_endpoint = 0.003
-            grassParticles.settings.roughness_end_shape = 5
-            
-            
-        
-        return {'FINISHED'}
-		
-####
-######### HAIR LAB ##########
-####
-class HairLabPanel(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Hair Lab"
-    bl_context = "objectmode"
-    bl_options = {'DEFAULT_CLOSED'}    
-
-    def draw(self, context):
-        active_obj = bpy.context.active_object
-        active_scn = bpy.context.scene.name
-        layout = self.layout
-        col = layout.column(align=True)
-        
-        WhatToDo = getActionToDo(active_obj)
-      
-        
-        if WhatToDo == "GENERATE":
-            col.operator("hair.generate_hair", text="Create Hair")
-
-            col.prop(context.scene, "hair_type")
-        else:
-            col.label(text="Select mesh object")
-        
-        if active_scn == "TestHairScene":
-            col.operator("hair.switch_back", text="Switch back to scene")
-        else:
-            col.operator("hair.test_scene", text="Create Test Scene")
-
-# TO DO
-"""
-class saveSelection(bpy.types.Operator):
-    bl_idname = "save.selection"
-    bl_label = "Save Selection"
-    bl_description = "Save selected particles"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        
-        return {'FINISHED'}
-"""
-class testScene3(bpy.types.Operator):
-    bl_idname = "hair.switch_back"
-    bl_label = "Switch back to scene"
-    bl_description = "If you want keep this scene, switch scene in info window"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        scene = bpy.context.scene
-        bpy.data.scenes.remove(scene)
-        
-        return {'FINISHED'}
-        
-        
-class testScene4(bpy.types.Operator):
-    bl_idname = "hair.test_scene"
-    bl_label = "Create test scene"
-    bl_description = "You can switch scene in info panel"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-# add new scene
-        bpy.ops.scene.new(type="NEW")
-        scene = bpy.context.scene
-        scene.name = "TestHairScene"
-# render settings
-        render = scene.render
-        render.resolution_x = 1920
-        render.resolution_y = 1080
-        render.resolution_percentage = 50
-# add new world
-        world = bpy.data.worlds.new("HairWorld")
-        scene.world = world
-        world.use_sky_blend = True
-        world.use_sky_paper = True
-        world.horizon_color = (0.004393,0.02121,0.050)
-        world.zenith_color = (0.03335,0.227,0.359)
-        
-# add text
-        bpy.ops.object.text_add(location=(-0.292,0,-0.152), rotation =(1.571,0,0))
-        text = bpy.context.active_object
-        text.scale = (0.05,0.05,0.05)
-        text.data.body = "Hair Lab"
-        
-# add material to text
-        textMaterial = bpy.data.materials.new('textMaterial')
-        text.data.materials.append(textMaterial)
-        textMaterial.use_shadeless = True
-        
-# add camera
-        bpy.ops.object.camera_add(location = (0,-1,0),rotation = (1.571,0,0))
-        cam = bpy.context.active_object.data
-        cam.lens = 50
-        cam.draw_size = 0.1
-        
-# add spot lamp
-        bpy.ops.object.lamp_add(type="SPOT", location = (-0.7,-0.5,0.3), rotation =(1.223,0,-0.960))
-        lamp1 = bpy.context.active_object.data
-        lamp1.name = "Key Light"
-        lamp1.energy = 1.5
-        lamp1.distance = 1.5
-        lamp1.shadow_buffer_soft = 5
-        lamp1.shadow_buffer_size = 8192
-        lamp1.shadow_buffer_clip_end = 1.5
-        lamp1.spot_blend = 0.5
-        
-# add spot lamp2
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.7,-0.6,0.1), rotation =(1.571,0,0.785))
-        lamp2 = bpy.context.active_object.data
-        lamp2.name = "Fill Light"
-        lamp2.color = (0.874,0.874,1)
-        lamp2.energy = 0.5
-        lamp2.distance = 1.5
-        lamp2.shadow_buffer_soft = 5
-        lamp2.shadow_buffer_size = 4096
-        lamp2.shadow_buffer_clip_end = 1.5
-        lamp2.spot_blend = 0.5
-        
-# light Rim
-        """
-        # add spot lamp3
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.191,0.714,0.689), rotation =(0.891,0,2.884))
-        lamp3 = bpy.context.active_object.data
-        lamp3.name = "Rim Light"
-        lamp3.color = (0.194,0.477,1)
-        lamp3.energy = 3
-        lamp3.distance = 1.5
-        lamp3.shadow_buffer_soft = 5
-        lamp3.shadow_buffer_size = 4096
-        lamp3.shadow_buffer_clip_end = 1.5
-        lamp3.spot_blend = 0.5
-        """
-# add sphere
-        bpy.ops.mesh.primitive_uv_sphere_add(size=0.1)
-        bpy.ops.object.shade_smooth()       
-        return {'FINISHED'}
-
-
-class GenerateHair(bpy.types.Operator):
-    bl_idname = "hair.generate_hair"
-    bl_label = "Generate Hair"
-    bl_description = "Create a Hair"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-# Make variable that is the current .blend file main data blocks
-        blend_data = context.blend_data
-        ob = bpy.context.active_object
-        scene = context.scene
-
-######################################################################
-########################Long Red Straight Hair########################
-        if scene.hair_type == '0':              
-            
-###############Create New Material##################
-# add new material
-            hairMaterial = bpy.data.materials.new('LongRedStraightHairMat')
-            ob.data.materials.append(hairMaterial)
-            
-#Material settings
-            hairMaterial.preview_render_type = "HAIR"
-            hairMaterial.diffuse_color = (0.287, 0.216, 0.04667)
-            hairMaterial.specular_color = (0.604, 0.465, 0.136)
-            hairMaterial.specular_intensity = 0.3
-            hairMaterial.ambient = 0
-            hairMaterial.use_cubic = True
-            hairMaterial.use_transparency = True
-            hairMaterial.alpha = 0
-            hairMaterial.use_transparent_shadows = True
-#strand
-            hairMaterial.strand.use_blender_units = True
-            hairMaterial.strand.root_size = 0.00030
-            hairMaterial.strand.tip_size = 0.00010
-            hairMaterial.strand.size_min = 0.7
-            hairMaterial.strand.width_fade = 0.1
-            hairMaterial.strand.shape = 0.061
-            hairMaterial.strand.blend_distance = 0.001
-            
-            
-# add texture
-            hairTex = bpy.data.textures.new("LongRedStraightHairTex", type='BLEND')
-            hairTex.use_preview_alpha = True
-            hairTex.use_color_ramp = True
-            ramp = hairTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.114,0.05613,0.004025,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.267,0.155,0.02687,0]
-            rampElement1 = rampElements.new(0.111)
-            rampElement1.color = [0.281,0.168,0.03157,0.65]
-            rampElement2 = rampElements.new(0.366)
-            rampElement2.color = [0.288,0.135,0.006242,0.87]
-            rampElement3 = rampElements.new(0.608)
-            rampElement3.color = [0.247,0.113,0.006472,0.8]
-            rampElement4 = rampElements.new(0.828)
-            rampElement4.color = [0.253,0.09919,0.01242,0.64]
-    
-# add texture to material
-            MTex = hairMaterial.texture_slots.add()
-            MTex.texture = hairTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-            
-            
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            hairParticles = bpy.context.object.particle_systems.active
-            hairParticles.name = "LongRedStraightHairPar"
-            hairParticles.settings.type = "HAIR"
-            hairParticles.settings.use_advanced_hair = True
-            hairParticles.settings.count = 500
-            hairParticles.settings.normal_factor = 0.05
-            hairParticles.settings.factor_random = 0.001
-            hairParticles.settings.use_dynamic_rotation = True
-            
-            hairParticles.settings.material = NumberOfMaterials
-            
-            hairParticles.settings.use_strand_primitive = True
-            hairParticles.settings.use_hair_bspline = True
-            hairParticles.settings.render_step = 5
-            hairParticles.settings.length_random = 0.5
-            hairParticles.settings.draw_step = 5
-# children
-            hairParticles.settings.child_type = "INTERPOLATED"
-            hairParticles.settings.create_long_hair_children = True
-            hairParticles.settings.clump_factor = 0.55
-            hairParticles.settings.roughness_endpoint = 0.005
-            hairParticles.settings.roughness_end_shape = 5
-            hairParticles.settings.roughness_2 = 0.003
-            hairParticles.settings.roughness_2_size = 0.230
-        
-        
-######################################################################
-########################Long Brown Curl Hair##########################
-        if scene.hair_type == '1':
-###############Create New Material##################
-# add new material
-            hairMaterial = bpy.data.materials.new('LongBrownCurlHairMat')
-            ob.data.materials.append(hairMaterial)
-            
-#Material settings
-            hairMaterial.preview_render_type = "HAIR"
-            hairMaterial.diffuse_color = (0.662, 0.518, 0.458)
-            hairMaterial.specular_color = (0.351, 0.249, 0.230)
-            hairMaterial.specular_intensity = 0.3
-            hairMaterial.specular_hardness = 100
-            hairMaterial.use_specular_ramp = True
-            
-            ramp = hairMaterial.specular_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.0356,0.0152,0.009134,0]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.352,0.250,0.231,1]
-            rampElement1 = rampElements.new(0.255)
-            rampElement1.color = [0.214,0.08244,0.0578,0.31]
-            rampElement2 = rampElements.new(0.594)
-            rampElement2.color = [0.296,0.143,0.0861,0.72]
-            
-            hairMaterial.ambient = 0
-            hairMaterial.use_cubic = True
-            hairMaterial.use_transparency = True
-            hairMaterial.alpha = 0
-            hairMaterial.use_transparent_shadows = True
-#strand
-            hairMaterial.strand.use_blender_units = True
-            hairMaterial.strand.root_size = 0.00030
-            hairMaterial.strand.tip_size = 0.00015
-            hairMaterial.strand.size_min = 0.450
-            hairMaterial.strand.width_fade = 0.1
-            hairMaterial.strand.shape = 0.02
-            hairMaterial.strand.blend_distance = 0.001
-            
-            
-# add texture
-            hairTex = bpy.data.textures.new("HairTex", type='BLEND')
-            hairTex.name = "LongBrownCurlHairTex"
-            hairTex.use_preview_alpha = True
-            hairTex.use_color_ramp = True
-            ramp = hairTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.009721,0.006049,0.003677,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.04231,0.02029,0.01444,0.16]
-            rampElement1 = rampElements.new(0.111)
-            rampElement1.color = [0.01467,0.005307,0.00316,0.65]
-            rampElement2 = rampElements.new(0.366)
-            rampElement2.color = [0.0272,0.01364,0.01013,0.87]
-            rampElement3 = rampElements.new(0.608)
-            rampElement3.color = [0.04445,0.02294,0.01729,0.8]
-            rampElement4 = rampElements.new(0.828)
-            rampElement4.color = [0.04092,0.0185,0.01161,0.64]
-            
-# add texture to material
-            MTex = hairMaterial.texture_slots.add()
-            MTex.texture = hairTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-            
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            hairParticles = bpy.context.object.particle_systems.active
-            hairParticles.name = "LongBrownCurlHairPar"
-            hairParticles.settings.type = "HAIR"
-            hairParticles.settings.use_advanced_hair = True
-            hairParticles.settings.count = 500
-            hairParticles.settings.normal_factor = 0.05
-            hairParticles.settings.factor_random = 0.001
-            hairParticles.settings.use_dynamic_rotation = True
-            
-            hairParticles.settings.material = NumberOfMaterials
-            
-            hairParticles.settings.use_strand_primitive = True
-            hairParticles.settings.use_hair_bspline = True
-            hairParticles.settings.render_step = 7
-            hairParticles.settings.length_random = 0.5
-            hairParticles.settings.draw_step = 5
-# children
-            hairParticles.settings.child_type = "INTERPOLATED"
-            hairParticles.settings.create_long_hair_children = True
-            hairParticles.settings.clump_factor = 0.523
-            hairParticles.settings.clump_shape = 0.383
-            hairParticles.settings.roughness_endpoint = 0.002
-            hairParticles.settings.roughness_end_shape = 5
-            hairParticles.settings.roughness_2 = 0.003
-            hairParticles.settings.roughness_2_size = 2
-            
-            hairParticles.settings.kink = "CURL"
-            hairParticles.settings.kink_amplitude = 0.007597
-            hairParticles.settings.kink_frequency = 6
-            hairParticles.settings.kink_shape = 0.4
-            hairParticles.settings.kink_flat = 0.8
-        
-        
-######################################################################
-########################Short Dark Hair##########################
-        elif scene.hair_type == '2':
-###############Create New Material##################
-# add new material
-            hairMaterial = bpy.data.materials.new('ShortDarkHairMat')
-            ob.data.materials.append(hairMaterial)
-            
-#Material settings
-            hairMaterial.preview_render_type = "HAIR"
-            hairMaterial.diffuse_color = (0.560, 0.536, 0.506)
-            hairMaterial.specular_color = (0.196, 0.177, 0.162)
-            hairMaterial.specular_intensity = 0.5
-            hairMaterial.specular_hardness = 100
-            hairMaterial.ambient = 0
-            hairMaterial.use_cubic = True
-            hairMaterial.use_transparency = True
-            hairMaterial.alpha = 0
-            hairMaterial.use_transparent_shadows = True
-#strand
-            hairMaterial.strand.use_blender_units = True
-            hairMaterial.strand.root_size = 0.0002
-            hairMaterial.strand.tip_size = 0.0001
-            hairMaterial.strand.size_min = 0.3
-            hairMaterial.strand.width_fade = 0.1
-            hairMaterial.strand.shape = 0
-            hairMaterial.strand.blend_distance = 0.001
-            
-# add texture
-            hairTex = bpy.data.textures.new("ShortDarkHair", type='BLEND')
-            hairTex.use_preview_alpha = True
-            hairTex.use_color_ramp = True
-            ramp = hairTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.004025,0.002732,0.002428,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.141,0.122,0.107,0.2]
-            rampElement1 = rampElements.new(0.202)
-            rampElement1.color = [0.01885,0.0177,0.01827,0.65]
-            rampElement2 = rampElements.new(0.499)
-            rampElement2.color = [0.114,0.109,0.09822,0.87]
-            rampElement3 = rampElements.new(0.828)
-            rampElement3.color = [0.141,0.127,0.117,0.64]
-            
-# add texture to material
-            MTex = hairMaterial.texture_slots.add()
-            MTex.texture = hairTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-            
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            hairParticles = bpy.context.object.particle_systems.active
-            hairParticles.name = "ShortDarkHair"
-            hairParticles.settings.type = "HAIR"
-            hairParticles.settings.use_advanced_hair = True
-            hairParticles.settings.hair_step = 2
-            hairParticles.settings.count = 450
-            hairParticles.settings.normal_factor = 0.007
-            hairParticles.settings.factor_random = 0.001
-            hairParticles.settings.use_dynamic_rotation = True
-            
-            hairParticles.settings.material = NumberOfMaterials
-            
-            hairParticles.settings.use_strand_primitive = True
-            hairParticles.settings.use_hair_bspline = True
-            hairParticles.settings.render_step = 3
-            hairParticles.settings.length_random = 0.3
-            hairParticles.settings.draw_step = 3
-# children
-            hairParticles.settings.child_type = "INTERPOLATED"
-            hairParticles.settings.rendered_child_count = 200
-            hairParticles.settings.virtual_parents = 1
-            hairParticles.settings.clump_factor = 0.425
-            hairParticles.settings.clump_shape = 0.1
-            hairParticles.settings.roughness_endpoint = 0.003
-            hairParticles.settings.roughness_end_shape = 5
-            
-            
-        
-        return {'FINISHED'}
-####
-######## FUR LAB ########
-####
-
-class FurLabPanel(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Fur Lab"
-    bl_context = "objectmode"
-    bl_options = {'DEFAULT_CLOSED'}    
-
-    def draw(self, context):
-        active_obj = bpy.context.active_object
-        active_scn = bpy.context.scene.name
-        layout = self.layout
-        col = layout.column(align=True)
-        
-        WhatToDo = getActionToDo(active_obj)
-      
-        
-        if WhatToDo == "GENERATE":
-            col.operator("fur.generate_fur", text="Create Fur")
-
-            col.prop(context.scene, "fur_type")
-        else:
-            col.label(text="Select mesh object")
-        
-        if active_scn == "TestFurScene":
-            col.operator("hair.switch_back", text="Switch back to scene")
-        else:
-            col.operator("fur.test_scene", text="Create Test Scene")
-
-# TO DO
-"""
-class saveSelection(bpy.types.Operator):
-    bl_idname = "save.selection"
-    bl_label = "Save Selection"
-    bl_description = "Save selected particles"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        
-        return {'FINISHED'}
-"""
-class testScene5(bpy.types.Operator):
-    bl_idname = "fur.switch_back"
-    bl_label = "Switch back to scene"
-    bl_description = "If you want keep this scene, switch scene in info window"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-        scene = bpy.context.scene
-        bpy.data.scenes.remove(scene)
-        
-        return {'FINISHED'}
-        
-        
-class testScene6(bpy.types.Operator):
-    bl_idname = "fur.test_scene"
-    bl_label = "Create test scene"
-    bl_description = "You can switch scene in info panel"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-# add new scene
-        bpy.ops.scene.new(type="NEW")
-        scene = bpy.context.scene
-        scene.name = "TestFurScene"
-# render settings
-        render = scene.render
-        render.resolution_x = 1920
-        render.resolution_y = 1080
-        render.resolution_percentage = 50
-# add new world
-        world = bpy.data.worlds.new("FurWorld")
-        scene.world = world
-        world.use_sky_blend = True
-        world.use_sky_paper = True
-        world.horizon_color = (0.004393,0.02121,0.050)
-        world.zenith_color = (0.03335,0.227,0.359)
-        
-# add text
-        bpy.ops.object.text_add(location=(-0.292,0,-0.152), rotation =(1.571,0,0))
-        text = bpy.context.active_object
-        text.scale = (0.05,0.05,0.05)
-        text.data.body = "Fur Lab"
-        
-# add material to text
-        textMaterial = bpy.data.materials.new('textMaterial')
-        text.data.materials.append(textMaterial)
-        textMaterial.use_shadeless = True
-        
-# add camera
-        bpy.ops.object.camera_add(location = (0,-1,0),rotation = (1.571,0,0))
-        cam = bpy.context.active_object.data
-        cam.lens = 50
-        cam.draw_size = 0.1
-        
-# add spot lamp
-        bpy.ops.object.lamp_add(type="SPOT", location = (-0.7,-0.5,0.3), rotation =(1.223,0,-0.960))
-        lamp1 = bpy.context.active_object.data
-        lamp1.name = "Key Light"
-        lamp1.energy = 1.5
-        lamp1.distance = 1.5
-        lamp1.shadow_buffer_soft = 5
-        lamp1.shadow_buffer_size = 8192
-        lamp1.shadow_buffer_clip_end = 1.5
-        lamp1.spot_blend = 0.5
-        
-# add spot lamp2
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.7,-0.6,0.1), rotation =(1.571,0,0.785))
-        lamp2 = bpy.context.active_object.data
-        lamp2.name = "Fill Light"
-        lamp2.color = (0.874,0.874,1)
-        lamp2.energy = 0.5
-        lamp2.distance = 1.5
-        lamp2.shadow_buffer_soft = 5
-        lamp2.shadow_buffer_size = 4096
-        lamp2.shadow_buffer_clip_end = 1.5
-        lamp2.spot_blend = 0.5
-        
-# light Rim
-        """
-        # add spot lamp3
-        bpy.ops.object.lamp_add(type="SPOT", location = (0.191,0.714,0.689), rotation =(0.891,0,2.884))
-        lamp3 = bpy.context.active_object.data
-        lamp3.name = "Rim Light"
-        lamp3.color = (0.194,0.477,1)
-        lamp3.energy = 3
-        lamp3.distance = 1.5
-        lamp3.shadow_buffer_soft = 5
-        lamp3.shadow_buffer_size = 4096
-        lamp3.shadow_buffer_clip_end = 1.5
-        lamp3.spot_blend = 0.5
-        """
-# add sphere
-        bpy.ops.mesh.primitive_uv_sphere_add(size=0.1)
-        bpy.ops.object.shade_smooth()       
-        return {'FINISHED'}
-
-
-class GenerateFur(bpy.types.Operator):
-    bl_idname = "fur.generate_fur"
-    bl_label = "Generate Fur"
-    bl_description = "Create a Fur"
-    bl_register = True
-    bl_undo = True
-    
-    def execute(self, context):
-# Make variable that is the current .blend file main data blocks
-        blend_data = context.blend_data
-        ob = bpy.context.active_object
-        scene = context.scene
-
-######################################################################
-########################Short Fur########################
-        if scene.fur_type == '0':              
-            
-###############Create New Material##################
-# add new material
-            furMaterial = bpy.data.materials.new('Fur 1')
-            ob.data.materials.append(furMaterial)
-            
-#Material settings
-            furMaterial.preview_render_type = "HAIR"
-            furMaterial.diffuse_color = (0.287, 0.216, 0.04667)
-            furMaterial.specular_color = (0.604, 0.465, 0.136)
-            furMaterial.specular_intensity = 0.3
-            furMaterial.ambient = 0
-            furMaterial.use_cubic = True
-            furMaterial.use_transparency = True
-            furMaterial.alpha = 0
-            furMaterial.use_transparent_shadows = True
-#strand
-            furMaterial.strand.use_blender_units = True
-            furMaterial.strand.root_size = 0.00030
-            furMaterial.strand.tip_size = 0.00010
-            furMaterial.strand.size_min = 0.7
-            furMaterial.strand.width_fade = 0.1
-            furMaterial.strand.shape = 0.061
-            furMaterial.strand.blend_distance = 0.001
-            
-            
-# add texture
-            furTex = bpy.data.textures.new("Fur1Tex", type='BLEND')
-            furTex.use_preview_alpha = True
-            furTex.use_color_ramp = True
-            ramp = furTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.114,0.05613,0.004025,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.267,0.155,0.02687,0]
-            rampElement1 = rampElements.new(0.111)
-            rampElement1.color = [0.281,0.168,0.03157,0.65]
-            rampElement2 = rampElements.new(0.366)
-            rampElement2.color = [0.288,0.135,0.006242,0.87]
-            rampElement3 = rampElements.new(0.608)
-            rampElement3.color = [0.247,0.113,0.006472,0.8]
-            rampElement4 = rampElements.new(0.828)
-            rampElement4.color = [0.253,0.09919,0.01242,0.64]
-    
-# add texture to material
-            MTex = furMaterial.texture_slots.add()
-            MTex.texture = furTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True  
-            
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            furParticles = bpy.context.object.particle_systems.active
-            furParticles.name = "Fur1Par"
-            furParticles.settings.type = "HAIR"
-            furParticles.settings.use_advanced_hair = True
-            furParticles.settings.count = 500
-            furParticles.settings.normal_factor = 0.05
-            furParticles.settings.factor_random = 0.001
-            furParticles.settings.use_dynamic_rotation = True
-            
-            furParticles.settings.material = NumberOfMaterials
-            
-            furParticles.settings.use_strand_primitive = True
-            furParticles.settings.use_hair_bspline = True
-            furParticles.settings.render_step = 5
-            furParticles.settings.length_random = 0.5
-            furParticles.settings.draw_step = 5
-# children
-            furParticles.settings.child_type = "INTERPOLATED"
-            furParticles.settings.child_length = 0.134
-            furParticles.settings.create_long_hair_children = True
-            furParticles.settings.clump_factor = 0.55
-            furParticles.settings.roughness_endpoint = 0.005
-            furParticles.settings.roughness_end_shape = 5
-            furParticles.settings.roughness_2 = 0.003
-            furParticles.settings.roughness_2_size = 0.230
-        
-        
-######################################################################
-########################Dalmation Fur##########################
-        if scene.fur_type == '1':
-###############Create New Material##################
-# add new material
-            furMaterial = bpy.data.materials.new('Fur2Mat')
-            ob.data.materials.append(furMaterial)
-            
-#Material settings
-            furMaterial.preview_render_type = "HAIR"
-            furMaterial.diffuse_color = (0.300, 0.280, 0.280)
-            furMaterial.specular_color = (1.0, 1.0, 1.0)
-            furMaterial.specular_intensity = 0.500
-            furMaterial.specular_hardness = 50
-            
-            furMaterial.ambient = 0
-            furMaterial.use_cubic = True
-            furMaterial.use_transparency = True
-            furMaterial.alpha = 0
-            furMaterial.use_transparent_shadows = True
-#strand
-            furMaterial.strand.use_blender_units = True
-            furMaterial.strand.root_size = 0.00030
-            furMaterial.strand.tip_size = 0.00010
-            furMaterial.strand.size_min = 0.7
-            furMaterial.strand.width_fade = 0.1
-            furMaterial.strand.shape = 0.061
-            furMaterial.strand.blend_distance = 0.001
-            
-            
-# add texture
-            furTex = bpy.data.textures.new("Fur2Tex", type='BLEND')
-            furTex.name = "Fur2"
-            furTex.use_preview_alpha = True
-            furTex.use_color_ramp = True
-            ramp = furTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [1.0,1.0,1.0,1.0]
-            rampElements[1].position = 1
-            rampElements[1].color = [1.0,1.0,1.0,0.0]
-            rampElement1 = rampElements.new(0.116)
-            rampElement1.color = [1.0,1.0,1.0,1.0]
-       
-            
-# add texture to material
-            MTex = furMaterial.texture_slots.add()
-            MTex.texture = furTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-			
-# add texture 2
-            furTex = bpy.data.textures.new("Fur2bTex", type='CLOUDS')
-            furTex.name = "Fur2b"
-            furTex.use_preview_alpha = False
-            furTex.cloud_type = "COLOR"
-            furTex.noise_type = "HARD_NOISE"
-            furTex.noise_scale = 0.06410
-            furTex.use_color_ramp = True
-            ramp = furTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [1.0,1.0,1.0, 1.0]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.0,0.0,0.0,1.0]
-            rampElement1 = rampElements.new(0.317)
-            rampElement1.color = [1.0,1.0,1.0,1.0]
-            rampElement2 = rampElements.new(0.347)
-            rampElement2.color = [0.0,0.0,0.0,1.0]
-            
-# add texture 2 to material
-            MTex = furMaterial.texture_slots.add()
-            MTex.texture = furTex
-            MTex.texture_coords = "GLOBAL"
-            MTex.use_map_alpha = True      
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            furParticles = bpy.context.object.particle_systems.active
-            furParticles.name = "Fur2Par"
-            furParticles.settings.type = "HAIR"
-            furParticles.settings.use_advanced_hair = True
-            furParticles.settings.count = 500
-            furParticles.settings.normal_factor = 0.05
-            furParticles.settings.factor_random = 0.001
-            furParticles.settings.use_dynamic_rotation = True
-            
-            furParticles.settings.material = NumberOfMaterials
-            
-            furParticles.settings.use_strand_primitive = True
-            furParticles.settings.use_hair_bspline = True
-            furParticles.settings.render_step = 5
-            furParticles.settings.length_random = 0.5
-            furParticles.settings.draw_step = 5
-# children
-            furParticles.settings.child_type = "INTERPOLATED"
-            furParticles.settings.child_length = 0.07227
-            furParticles.settings.create_long_hair_children = True
-            furParticles.settings.clump_factor = 0.55
-            furParticles.settings.roughness_endpoint = 0.005
-            furParticles.settings.roughness_end_shape = 5
-            furParticles.settings.roughness_2 = 0.003
-            furParticles.settings.roughness_2_size = 0.230
-        
-######################################################################
-########################Spotted_fur##########################
-        elif scene.fur_type == '2':
-
-###############Create New Material##################
-# add new material
-            furMaterial = bpy.data.materials.new('Fur3Mat')
-            ob.data.materials.append(furMaterial)
-            
-#Material settings
-            furMaterial.preview_render_type = "HAIR"
-            furMaterial.diffuse_color = (0.300, 0.280, 0.280)
-            furMaterial.specular_color = (1.0, 1.0, 1.0)
-            furMaterial.specular_intensity = 0.500
-            furMaterial.specular_hardness = 50
-            furMaterial.use_specular_ramp = True
-            
-            ramp = furMaterial.specular_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.0356,0.0152,0.009134,0]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.352,0.250,0.231,1]
-            rampElement1 = rampElements.new(0.255)
-            rampElement1.color = [0.214,0.08244,0.0578,0.31]
-            rampElement2 = rampElements.new(0.594)
-            rampElement2.color = [0.296,0.143,0.0861,0.72]
-            
-            furMaterial.ambient = 0
-            furMaterial.use_cubic = True
-            furMaterial.use_transparency = True
-            furMaterial.alpha = 0
-            furMaterial.use_transparent_shadows = True
-#strand
-            furMaterial.strand.use_blender_units = True
-            furMaterial.strand.root_size = 0.00030
-            furMaterial.strand.tip_size = 0.00015
-            furMaterial.strand.size_min = 0.450
-            furMaterial.strand.width_fade = 0.1
-            furMaterial.strand.shape = 0.02
-            furMaterial.strand.blend_distance = 0.001
-            
-            
-# add texture
-            furTex = bpy.data.textures.new("Fur3Tex", type='BLEND')
-            furTex.name = "Fur3"
-            furTex.use_preview_alpha = True
-            furTex.use_color_ramp = True
-            ramp = furTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.009721,0.006049,0.003677,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.04231,0.02029,0.01444,0.16]
-            rampElement1 = rampElements.new(0.111)
-            rampElement1.color = [0.01467,0.005307,0.00316,0.65]
-            rampElement2 = rampElements.new(0.366)
-            rampElement2.color = [0.0272,0.01364,0.01013,0.87]
-            rampElement3 = rampElements.new(0.608)
-            rampElement3.color = [0.04445,0.02294,0.01729,0.8]
-            rampElement4 = rampElements.new(0.828)
-            rampElement4.color = [0.04092,0.0185,0.01161,0.64]
-            
-# add texture to material
-            MTex = furMaterial.texture_slots.add()
-            MTex.texture = furTex
-            MTex.texture_coords = "STRAND"
-            MTex.use_map_alpha = True
-			
-# add texture 2
-            furTex = bpy.data.textures.new("Fur3bTex", type='CLOUDS')
-            furTex.name = "Fur3b"
-            furTex.use_preview_alpha = True
-            furTex.cloud_type = "COLOR"
-            furTex.use_color_ramp = True
-            ramp = furTex.color_ramp
-            rampElements = ramp.elements
-            rampElements[0].position = 0
-            rampElements[0].color = [0.009721,0.006049,0.003677,0.38]
-            rampElements[1].position = 1
-            rampElements[1].color = [0.04231,0.02029,0.01444,0.16]
-            rampElement1 = rampElements.new(0.111)
-            rampElement1.color = [0.01467,0.005307,0.00316,0.65]
-            rampElement2 = rampElements.new(0.366)
-            rampElement2.color = [0.0272,0.01364,0.01013,0.87]
-            rampElement3 = rampElements.new(0.608)
-            rampElement3.color = [0.04445,0.02294,0.01729,0.8]
-            rampElement4 = rampElements.new(0.828)
-            rampElement4.color = [0.04092,0.0185,0.01161,0.64]
-            
-# add texture 2 to material
-            MTex = furMaterial.texture_slots.add()
-            MTex.texture = furTex
-            MTex.texture_coords = "GLOBAL"
-            MTex.use_map_alpha = False      
-            
-###############Create Particles##################
-# Add new particle system
-            
-            NumberOfMaterials = 0
-            for i in ob.data.materials:
-                NumberOfMaterials +=1
-            
-            
-            bpy.ops.object.particle_system_add()
-#Particle settings setting it up!
-            furParticles = bpy.context.object.particle_systems.active
-            furParticles.name = "Fur3Par"
-            furParticles.settings.type = "HAIR"
-            furParticles.settings.use_advanced_hair = True
-            furParticles.settings.count = 500
-            furParticles.settings.normal_factor = 0.05
-            furParticles.settings.factor_random = 0.001
-            furParticles.settings.use_dynamic_rotation = True
-            
-            furParticles.settings.material = NumberOfMaterials
-            
-            furParticles.settings.use_strand_primitive = True
-            furParticles.settings.use_hair_bspline = True
-            furParticles.settings.render_step = 5
-            furParticles.settings.length_random = 0.5
-            furParticles.settings.draw_step = 5
-# children
-            furParticles.settings.child_type = "INTERPOLATED"
-            furParticles.settings.child_length = 0.134
-            furParticles.settings.create_long_hair_children = True
-            furParticles.settings.clump_factor = 0.55
-            furParticles.settings.roughness_endpoint = 0.005
-            furParticles.settings.roughness_end_shape = 5
-            furParticles.settings.roughness_2 = 0.003
-            furParticles.settings.roughness_2_size = 0.230
-        
-        return {'FINISHED'}
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.Scene.grass_type = EnumProperty(
-        name="Type",
-        description="Select the type of grass",
-        items=[("0","Green Grass","Generate particle grass"),
-               ("1","Grassy Field","Generate particle grass"),
-               ("2","Clumpy Grass","Generate particle grass"),
-        
-              ],
-        default='0')
-    bpy.types.Scene.hair_type = EnumProperty(
-        name="Type",
-        description="Select the type of hair",
-        items=[("0","Long Red Straight Hair","Generate particle Hair"),
-               ("1","Long Brown Curl Hair","Generate particle Hair"),
-               ("2","Short Dark Hair","Generate particle Hair"),
-        
-              ],
-        default='0')
-    bpy.types.Scene.fur_type = EnumProperty(
-        name="Type",
-        description="Select the type of fur",
-        items=[("0","Short Fur","Generate particle Fur"),
-               ("1","Dalmation","Generate particle Fur"),
-               ("2","Fur3","Generate particle Fur"),
-        
-              ],
-        default='0')
-        
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    del bpy.types.Scene.hair_type
-    
-if __name__ == "__main__":
-    register()
-    
-    
-
diff --git a/release/scripts/addons_contrib/presets/interface_theme/3ds_max.xml b/release/scripts/addons_contrib/presets/interface_theme/3ds_max.xml
deleted file mode 100644
index 041c942..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/3ds_max.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#708faa"
-                             inner="#c4c4c4ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-10"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#708faa"
-                             inner="#c3c3c3ff"
-                             inner_sel="#ddae64ff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="10"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#535353"
-                             inner="#d1d1d1ff"
-                             inner_sel="#999999ff"
-                             item="#5a5a5aff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="25">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#747474"
-                             inner="#a2a2a2ff"
-                             inner_sel="#bbb8a3ff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="10"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#708faa"
-                             inner="#d0d0d0ff"
-                             inner_sel="#64717dff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="10"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#708faa"
-                             inner="#c4c4c4ff"
-                             inner_sel="#999999ff"
-                             item="#708faaff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-10"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#747474"
-                             inner="#b4b4b4ff"
-                             inner_sel="#999999ff"
-                             item="#c9c9c9ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#d1d1d1ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#464646"
-                             inner="#aeaeaeff"
-                             inner_sel="#464646ff"
-                             item="#6d8da6ff"
-                             text="#000000"
-                             text_sel="#cccccc"
-                             show_shaded="TRUE"
-                             shadetop="15"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#3f3f3fff"
-                             inner_sel="#536a7e26"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#424242"
-                             inner="#b4b4b4ff"
-                             inner_sel="#2d2d2dff"
-                             item="#646464ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="30">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#8897a4ff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#708faa"
-                             inner="#708faa26"
-                             inner_sel="#646464b4"
-                             item="#a9a9a9ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#bebebeff"
-                             inner_sel="#646464b4"
-                             item="#444444ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#d8c555aa"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#73be4c"
-                                  inner_anim_sel="#5aa633"
-                                  inner_key="#f0eb64"
-                                  inner_key_sel="#d7d34b"
-                                  inner_driven="#b400ff"
-                                  inner_driven_sel="#9900e6"
-                                  blend="0.5">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#505050"
-                   wire="#000000"
-                   lamp="#00000028"
-                   speaker="#000000"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#fa3f00"
-                   object_active="#ffffff"
-                   object_grouped="#104010"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#5454f0"
-                   vertex_select="#ae6060"
-                   vertex_size="3"
-                   edge_select="#ff3d3d"
-                   edge_seam="#e69632"
-                   edge_sharp="#ff2020"
-                   edge_crease="#cc0099"
-                   edge_facesel="#4b4b4b"
-                   face="#a8a8a84d"
-                   face_select="#ae606066"
-                   face_dot="#883737"
-                   facedot_size="2"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#000000"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#000000"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#000080"
-                   extra_face_area="#002000"
-                   editmesh_active="#fcf8ff80"
-                   normal="#22dddd"
-                   vertex_normal="#2361dd"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#000000"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#737373"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b457"
-                             button_title="#494949"
-                             button_text="#494949"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#505050"
-                        window_sliders="#969696"
-                        channels_region="#707070"
-                        vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        handle_free="#000000"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#000000"
-                        handle_sel_auto="#f0ff40"
-                        handle_sel_vect="#40c030"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#000000"
-                        handle_sel_auto_clamped="#000000"
-                        lastsel_point="#ffffff"
-                        frame_current="#60c040"
-                        handle_vertex="#000000"
-                        handle_vertex_select="#ff8500"
-                        handle_vertex_size="3"
-                        channel_group="#4f6549"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#52606e"
-                        dopesheet_subchannel="#7c8996">
-        <space>
-          <ThemeSpaceGeneric back="#737373"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#b4b4b4"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#d7ae6d"
-                        scrollbar="#a0a0a0"
-                        scroll_handle="#7f7070"
-                        active_file="#828282"
-                        active_file_text="#fafafa">
-        <space>
-          <ThemeSpaceGeneric back="#b4b4b4"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#0f0f0f"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#b4b4b4"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#5e5e5e"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#0c0a0a"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#757575"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#b4b4b4"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#505050"
-                      value_sliders="#000000"
-                      view_sliders="#969696"
-                      channels="#707070"
-                      channels_selected="#60c040"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff8c00"
-                      frame_current="#60c040"
-                      dopesheet_channel="#52606e"
-                      dopesheet_subchannel="#7c8996"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#737373"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#b4b4b4"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#5454f0"
-                        vertex_select="#d00000"
-                        vertex_size="3"
-                        face="#ffffff0a"
-                        face_select="#7c00003c"
-                        face_dot="#ff0000"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#b4b4b4ff"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#757575"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#404040"
-                           window_sliders="#a0a0a0"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#6d5881"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#a9547c"
-                           transition_strip="#a25f6f"
-                           meta_strip="#6d9183"
-                           frame_current="#60c040"
-                           keyframe="#ff8500"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#949494"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b442"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#b4b4b4"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#404040"
-                       selected_text="#c67777"
-                       cursor="#ff0000"
-                       syntax_builtin="#800050"
-                       syntax_special="#5f5f00"
-                       syntax_comment="#006432"
-                       syntax_string="#640000"
-                       syntax_numbers="#0000c8">
-        <space>
-          <ThemeSpaceGeneric back="#d1d1d1"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#505050"
-                     frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#999999"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#000000"
-                       wire_select="#ffffff"
-                       selected_text="#7f7070"
-                       node_backdrop="#9b9b9ba0"
-                       in_out_node="#faa044"
-                       converter_node="#deaf66"
-                       operator_node="#9e733e"
-                       group_node="#3c753c"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#737373"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b42f"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#a5a5a5"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#b4b4b4"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#337f33"
-                     selected_highlight="#82878c">
-        <space>
-          <ThemeSpaceGeneric back="#b4b4b4"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#fff1e1"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#b4b4b4"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#b4b4b4"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#000000"
-                    line_input="#ffffff"
-                    line_info="#00aa00"
-                    line_error="#dc6060"
-                    cursor="#dc6060">
-        <space>
-          <ThemeSpaceGeneric back="#b4b4b4"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#000000"
-                       marker="#7f7f00"
-                       active_marker="#ffffff"
-                       selected_marker="#ffff00"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0000"
-                       path_after="#0000ff"
-                       grid="#5e5e5e"
-                       frame_current="#60c040"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#737373"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b4ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/default.xml b/release/scripts/addons_contrib/presets/interface_theme/default.xml
deleted file mode 100644
index aeacd7f..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/default.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#464646ff"
-                             inner_sel="#5680c2ff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#999999ff"
-                             item="#5a5a5aff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="25">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#464646ff"
-                             inner_sel="#464646ff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#b4b4b4ff"
-                             inner_sel="#999999ff"
-                             item="#5a5a5aff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#b4b4b4ff"
-                             inner_sel="#999999ff"
-                             item="#808080ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#808080ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#464646ff"
-                             inner_sel="#464646ff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#cccccc"
-                             show_shaded="TRUE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#3f3f3fff"
-                             inner_sel="#5680c2ff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#a0a0a0"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#5680c2ff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="38"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#323232"
-                             inner="#505050b4"
-                             inner_sel="#646464b4"
-                             item="#808080ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#bebebeff"
-                             inner_sel="#646464b4"
-                             item="#444444ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#5680c2ff"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#73be4c"
-                                  inner_anim_sel="#5aa633"
-                                  inner_key="#f0eb64"
-                                  inner_key_sel="#d7d34b"
-                                  inner_driven="#b400ff"
-                                  inner_driven_sel="#9900e6"
-                                  blend="0.5">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#404040"
-                   wire="#000000"
-                   lamp="#00000028"
-                   speaker="#000000"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#f15800"
-                   object_active="#ffaa40"
-                   object_grouped="#083008"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#000000"
-                   vertex_select="#ff8500"
-                   vertex_size="3"
-                   edge_select="#ffa000"
-                   edge_seam="#db2512"
-                   edge_sharp="#00ffff"
-                   edge_crease="#cc0099"
-                   edge_facesel="#4b4b4b"
-                   face="#00000012"
-                   face_select="#ff85003c"
-                   face_dot="#ff8500"
-                   facedot_size="4"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#000000"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#000000"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#000080"
-                   extra_face_area="#002000"
-                   editmesh_active="#ffffff80"
-                   normal="#22dddd"
-                   vertex_normal="#2361dd"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#000000"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#393939"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#72727257"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#5e5e5e"
-                        window_sliders="#969696"
-                        channels_region="#707070"
-                        vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        handle_free="#000000"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#000000"
-                        handle_sel_auto="#f0ff40"
-                        handle_sel_vect="#40c030"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#994030"
-                        handle_sel_auto_clamped="#f0af90"
-                        lastsel_point="#ffffff"
-                        frame_current="#60c040"
-                        handle_vertex="#000000"
-                        handle_vertex_select="#ff8500"
-                        handle_vertex_size="4"
-                        channel_group="#4f6549"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#52606e"
-                        dopesheet_subchannel="#7c8996">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#ff8c19"
-                        scrollbar="#a0a0a0"
-                        scroll_handle="#7f7070"
-                        active_file="#828282"
-                        active_file_text="#fafafa">
-        <space>
-          <ThemeSpaceGeneric back="#4c4c4c"
-                             title="#000000"
-                             text="#fafafa"
-                             text_hi="#0f0f0f"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#5e5e5e"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#0c0a0a"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#5e5e5e"
-                      value_sliders="#000000"
-                      view_sliders="#969696"
-                      channels="#707070"
-                      channels_selected="#60c040"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff8c00"
-                      frame_current="#60c040"
-                      dopesheet_channel="#52606e"
-                      dopesheet_subchannel="#7c8996"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        face="#ffffff0a"
-                        face_select="#ff85003c"
-                        face_dot="#ff8500"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#727272ff"
-                        preview_stitch_face="#7f7f0033"
-                        preview_stitch_edge="#ff00ff33"
-                        preview_stitch_vert="#0000ff33"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#353535"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#404040"
-                           window_sliders="#a0a0a0"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#6d5881"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#a9547c"
-                           transition_strip="#a25f6f"
-                           meta_strip="#6d9183"
-                           frame_current="#60c040"
-                           keyframe="#ff8500"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#747474"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#72727242"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#404040"
-                       selected_text="#c67777"
-                       cursor="#ff0000"
-                       syntax_builtin="#800050"
-                       syntax_special="#5f5f00"
-                       syntax_comment="#006432"
-                       syntax_string="#640000"
-                       syntax_numbers="#0000c8">
-        <space>
-          <ThemeSpaceGeneric back="#999999"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#5b5b5b"
-                     frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#000000"
-                       wire_select="#ffffff"
-                       selected_text="#7f7070"
-                       node_backdrop="#9b9b9ba0"
-                       in_out_node="#646464"
-                       converter_node="#686a75"
-                       operator_node="#6c696f"
-                       group_node="#69756e"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#393939"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#7272722f"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#a5a5a5"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#646464"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#337f33"
-                     selected_highlight="#82878c">
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#6080ff"
-                    line_input="#ffffff"
-                    line_info="#00aa00"
-                    line_error="#dc6060"
-                    cursor="#dc6060">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#000000"
-                       marker="#7f7f00"
-                       active_marker="#ffffff"
-                       selected_marker="#ffff00"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0000"
-                       path_after="#0000ff"
-                       grid="#5e5e5e"
-                       frame_current="#60c040"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#393939"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/maya.xml b/release/scripts/addons_contrib/presets/interface_theme/maya.xml
deleted file mode 100644
index 283fe1c..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/maya.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#2c2c2cff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#8f8f8f"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#292929ff"
-                             inner_sel="#678db2ff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#131313ff"
-                             inner_sel="#333230ff"
-                             item="#678db2ff"
-                             text="#dddddd"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="25">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#2b2b2bff"
-                             inner_sel="#464646ff"
-                             item="#ffffffff"
-                             text="#888284"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#525252"
-                             inner="#222222ff"
-                             inner_sel="#999999ff"
-                             item="#5a5a5aff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#535353ff"
-                             inner_sel="#999999ff"
-                             item="#808080ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#696969ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#777777ff"
-                             inner_sel="#464646ff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#cccccc"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#3f3f3fff"
-                             inner_sel="#656969ff"
-                             item="#ffffffff"
-                             text="#dddddd"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#444444ff"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#a0a0a0"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#658aaeff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="38"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#323232"
-                             inner="#505050b4"
-                             inner_sel="#646464b4"
-                             item="#808080ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#bebebeff"
-                             inner_sel="#646464b4"
-                             item="#444444ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#5680c2ff"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#73be4c"
-                                  inner_anim_sel="#5aa633"
-                                  inner_key="#f0eb64"
-                                  inner_key_sel="#d7d34b"
-                                  inner_driven="#b400ff"
-                                  inner_driven_sel="#9900e6"
-                                  blend="0.5">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#7f7f7f"
-                   wire="#64dcff"
-                   lamp="#00000028"
-                   speaker="#000000"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#f15800"
-                   object_active="#43ffa3"
-                   object_grouped="#083008"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#cc1b23"
-                   vertex_select="#ff8500"
-                   vertex_size="3"
-                   edge_select="#ffa000"
-                   edge_seam="#db2512"
-                   edge_sharp="#ff2020"
-                   edge_crease="#cc0099"
-                   edge_facesel="#4b4b4b"
-                   face="#00000012"
-                   face_select="#ff85003c"
-                   face_dot="#ff8500"
-                   facedot_size="4"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#000000"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#000000"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#000080"
-                   extra_face_area="#002000"
-                   editmesh_active="#ffffff80"
-                   normal="#22dddd"
-                   vertex_normal="#2361dd"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#000000"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#576471"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#444444"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#44444457"
-                             button_title="#ffffff"
-                             button_text="#ffffff"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#5e5e5e"
-                        window_sliders="#969696"
-                        channels_region="#707070"
-                        vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        handle_free="#000000"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#000000"
-                        handle_sel_auto="#f0ff40"
-                        handle_sel_vect="#40c030"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#994030"
-                        handle_sel_auto_clamped="#f0af90"
-                        lastsel_point="#ffffff"
-                        frame_current="#60c040"
-                        handle_vertex="#000000"
-                        handle_vertex_select="#ff8500"
-                        handle_vertex_size="3"
-                        channel_group="#4f6549"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#52606e"
-                        dopesheet_subchannel="#7c8996">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#ff8c19"
-                        scrollbar="#a0a0a0"
-                        scroll_handle="#7f7070"
-                        active_file="#828282"
-                        active_file_text="#fafafa">
-        <space>
-          <ThemeSpaceGeneric back="#4c4c4c"
-                             title="#000000"
-                             text="#fafafa"
-                             text_hi="#0f0f0f"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#5e5e5e"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#0c0a0a"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#5e5e5e"
-                      value_sliders="#000000"
-                      view_sliders="#969696"
-                      channels="#707070"
-                      channels_selected="#60c040"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff8c00"
-                      frame_current="#60c040"
-                      dopesheet_channel="#52606e"
-                      dopesheet_subchannel="#7c8996"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        face="#ffffff0a"
-                        face_select="#ff85003c"
-                        face_dot="#ff8500"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#727272ff"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#353535"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#404040"
-                           window_sliders="#a0a0a0"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#6d5881"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#a9547c"
-                           transition_strip="#a25f6f"
-                           meta_strip="#6d9183"
-                           frame_current="#60c040"
-                           keyframe="#ff8500"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#747474"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#72727242"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#444444"
-                             title="#dddddd"
-                             text="#dddddd"
-                             text_hi="#ffffff"
-                             header="#444444"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#404040"
-                       selected_text="#c67777"
-                       cursor="#ff0000"
-                       syntax_builtin="#800050"
-                       syntax_special="#5f5f00"
-                       syntax_comment="#006432"
-                       syntax_string="#640000"
-                       syntax_numbers="#0000c8">
-        <space>
-          <ThemeSpaceGeneric back="#999999"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#000000"
-                     frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#737373"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#444444"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#000000"
-                       wire_select="#ffffff"
-                       selected_text="#7f7070"
-                       node_backdrop="#9b9b9ba0"
-                       in_out_node="#646464"
-                       converter_node="#686a75"
-                       operator_node="#6c696f"
-                       group_node="#69756e"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#393939"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#7272722f"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#a5a5a5"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#646464"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#356c1a"
-                     selected_highlight="#446e1c">
-        <space>
-          <ThemeSpaceGeneric back="#444444"
-                             title="#000000"
-                             text="#dddddd"
-                             text_hi="#ffffff"
-                             header="#444444"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#444444"
-                             header_text="#dddddd"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#444444"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#6080ff"
-                    line_input="#ffffff"
-                    line_info="#00aa00"
-                    line_error="#dc6060"
-                    cursor="#dc6060">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#000000"
-                       marker="#7f7f00"
-                       active_marker="#ffffff"
-                       selected_marker="#ffff00"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0000"
-                       path_after="#0000ff"
-                       grid="#5e5e5e"
-                       frame_current="#60c040"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#576471"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#3a3a3a"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#444444ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/modo.xml b/release/scripts/addons_contrib/presets/interface_theme/modo.xml
deleted file mode 100644
index 9eccbff..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/modo.xml
+++ /dev/null
@@ -1,974 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface menu_shadow_fac="0.5"
-                          menu_shadow_width="12"
-                          icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#979999ff"
-                             inner_sel="#646464ff"
-                             item="#000000ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#606060ff"
-                             inner_sel="#f49c1cff"
-                             item="#000000ff"
-                             text="#f1f1f1"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#464646ff"
-                             inner_sel="#f49c1cff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#93a56f"
-                             inner="#999999ff"
-                             inner_sel="#999999ff"
-                             item="#5a5a5aff"
-                             text="#fdfdfd"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="25">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#686868ff"
-                             inner_sel="#f49c1cff"
-                             item="#000000ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#302e2e"
-                             inner="#999999ff"
-                             inner_sel="#f49c1cff"
-                             item="#5a5a5aff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#9098a0ff"
-                             inner_sel="#f49c1cff"
-                             item="#5a5a5aff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#b4b4b4ff"
-                             inner_sel="#999999ff"
-                             item="#9098a0ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#464646ff"
-                             inner_sel="#646464ff"
-                             item="#000000ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#606060ff"
-                             inner_sel="#f49c1cff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="15"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#606060ff"
-                             inner_sel="#f49c1cff"
-                             item="#ffffffff"
-                             text="#888888"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#606060e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#a0a0a0"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#f49c1cff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="38"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#323232"
-                             inner="#505050b4"
-                             inner_sel="#646464b4"
-                             item="#606060ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#bebebeff"
-                             inner_sel="#646464b4"
-                             item="#444444ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#f49c1cff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#73be4c"
-                                  inner_anim_sel="#5aa633"
-                                  inner_key="#c9ce20"
-                                  inner_key_sel="#d7d34b"
-                                  inner_driven="#b400ff"
-                                  inner_driven_sel="#9900e6"
-                                  blend="0.5">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#5b6672"
-                   wire="#000000"
-                   lamp="#00000028"
-                   speaker="#000000"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#f15800"
-                   object_active="#ff8c19"
-                   object_grouped="#083008"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#000000"
-                   vertex_select="#ff8500"
-                   vertex_size="3"
-                   edge_select="#ffa000"
-                   edge_seam="#db2512"
-                   edge_sharp="#ff2020"
-                   edge_crease="#cc0099"
-                   edge_facesel="#4b4b4b"
-                   face="#00000012"
-                   face_select="#ff85003c"
-                   face_dot="#ff8500"
-                   facedot_size="4"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#000000"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#000000"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#002000"
-                   extra_face_area="#000080"
-                   editmesh_active="#ffffff80"
-                   normal="#22dddd"
-                   vertex_normal="#2361dd"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#000000"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGradient title="#000000"
-                              text="#000000"
-                              text_hi="#ffffff"
-                              header="#202020"
-                              header_text="#000000"
-                              header_text_hi="#ffffff"
-                              button="#48484857"
-                              button_title="#000000"
-                              button_text="#000000"
-                              button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-            <gradients>
-              <ThemeGradientColors show_grad="TRUE"
-                                   gradient="#3a3e47"
-                                   high_gradient="#838790">
-              </ThemeGradientColors>
-            </gradients>
-          </ThemeSpaceGradient>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#5b6672"
-                        window_sliders="#969696"
-                        channels_region="#707070"
-                        vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        handle_free="#000000"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#000000"
-                        handle_sel_auto="#f0ff40"
-                        handle_sel_vect="#40c030"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#994030"
-                        handle_sel_auto_clamped="#f0af90"
-                        lastsel_point="#000000"
-                        frame_current="#60c040"
-                        handle_vertex="#000000"
-                        handle_vertex_select="#ff8500"
-                        handle_vertex_size="3"
-                        channel_group="#4f6549"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#52606e"
-                        dopesheet_subchannel="#7c8996">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#484848"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#ff8c19"
-                        scrollbar="#a0a0a0"
-                        scroll_handle="#7f7070"
-                        active_file="#828282"
-                        active_file_text="#fafafa">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#fafafa"
-                             text_hi="#0f0f0f"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#726f6dff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#484848"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#5b6672"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#0c0a0a"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#484848"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#5b6672"
-                      value_sliders="#000000"
-                      view_sliders="#969696"
-                      channels="#707070"
-                      channels_selected="#60c040"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff8c00"
-                      frame_current="#60c040"
-                      dopesheet_channel="#52606e"
-                      dopesheet_subchannel="#7c8996"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#484848"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        face="#ffffff0a"
-                        face_select="#ff85003c"
-                        face_dot="#ff8500"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#727272ff"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#484848ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#5b6672"
-                           window_sliders="#a0a0a0"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#6d5881"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#a9547c"
-                           transition_strip="#a25f6f"
-                           meta_strip="#6d9183"
-                           frame_current="#60c040"
-                           keyframe="#ff8500"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#72727242"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#484848"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#000000"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#dff5ff"
-                             button="#727272ff"
-                             button_title="#3f3a2f"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#404040"
-                       selected_text="#c67777"
-                       cursor="#ff0000"
-                       syntax_builtin="#800050"
-                       syntax_symbols="#4c4c4c"
-                       syntax_special="#5f5f00"
-                       syntax_preprocessor="#32008c"
-                       syntax_reserved="#8c3c00"
-                       syntax_comment="#006432"
-                       syntax_string="#640000"
-                       syntax_numbers="#0000c8">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#5b6672"
-                     frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#000000"
-                       wire_select="#ffffff"
-                       selected_text="#7f7070"
-                       node_backdrop="#9b9b9ba0"
-                       in_out_node="#646464"
-                       converter_node="#686a75"
-                       operator_node="#6c696f"
-                       group_node="#69756e"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#7272722f"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#484848"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#337f33"
-                     selected_highlight="#82878c">
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#0e0e0e"
-                             text="#000000"
-                             text_hi="#f49c1c"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#070707"
-                             button_text="#000000"
-                             button_text_hi="#fdfcff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#9098a0"
-                             title="#c8c6c9"
-                             text="#888884"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#888888"
-                             header_text_hi="#ffffff"
-                             button="#725864ff"
-                             button_title="#f1c2d8"
-                             button_text="#f0f0f0"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#484848"
-                             title="#000000"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#fdffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#6080ff"
-                    line_input="#ffffff"
-                    line_info="#00aa00"
-                    line_error="#dc6060"
-                    cursor="#dc6060">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#000000"
-                       marker="#7f7f00"
-                       active_marker="#ffffff"
-                       selected_marker="#ffff00"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0000"
-                       path_after="#0000ff"
-                       grid="#5e5e5e"
-                       frame_current="#60c040"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#40464e"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#202020"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#484848ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/pinkified.xml b/release/scripts/addons_contrib/presets/interface_theme/pinkified.xml
deleted file mode 100644
index 7179ed2..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/pinkified.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#0c0c0cff"
-                             inner_sel="#ff1d4aff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#676767"
-                             inner="#4d4d4dff"
-                             inner_sel="#ff1d4aff"
-                             item="#ffffffff"
-                             text="#d8d8d8"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-5"
-                             shadedown="-15">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#343434"
-                             inner="#0c0c0cff"
-                             inner_sel="#ff1d4aff"
-                             item="#ffffffff"
-                             text="#b1b1b1"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="6"
-                             shadedown="2">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#1a1a1a"
-                             inner="#0d0d0dff"
-                             inner_sel="#ff1d4aff"
-                             item="#414141ff"
-                             text="#686868"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-59"
-                             shadedown="3">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#1b1b1bff"
-                             inner_sel="#000000ff"
-                             item="#ff002eff"
-                             text="#808080"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-14"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#343434"
-                             inner="#3e3e3eff"
-                             inner_sel="#ff1d4aff"
-                             item="#1a1a1aff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="27"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#343434"
-                             inner="#0c0c0cff"
-                             inner_sel="#ff1d4aff"
-                             item="#5a5a5aff"
-                             text="#757575"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="9"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#343434"
-                             inner="#33141bff"
-                             inner_sel="#ff1d4aff"
-                             item="#800f26ff"
-                             text="#f7f7f7"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-16"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#343434"
-                             inner="#00000066"
-                             inner_sel="#ff1d4aff"
-                             item="#ffffffff"
-                             text="#999999"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#343434"
-                             inner="#2a2a2aff"
-                             inner_sel="#ff1d4aff"
-                             item="#000000ff"
-                             text="#dddddd"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="12"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#0c0c0cff"
-                             inner_sel="#ff1d4aff"
-                             item="#ffffffff"
-                             text="#b6b6b6"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#3f3e3e"
-                             inner="#0c0c0cd0"
-                             inner_sel="#414141ff"
-                             item="#232323ff"
-                             text="#a0a0a0"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="4"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#222222"
-                             inner="#0c0c0c4e"
-                             inner_sel="#ff1d4aff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="8"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#111111"
-                             inner="#00000080"
-                             inner_sel="#000000ff"
-                             item="#4d4d4d33"
-                             text="#bababa"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="12"
-                             shadedown="12">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#5d001a"
-                             inner="#000000ff"
-                             inner_sel="#686868ff"
-                             item="#be0037ff"
-                             text="#ffffff"
-                             text_sel="#ff1d4a"
-                             show_shaded="FALSE"
-                             shadetop="100"
-                             shadedown="-88">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#4e4e4e"
-                             inner="#c69e9e00"
-                             inner_sel="#4d262eff"
-                             item="#ffffffff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-12"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#194a00"
-                                  inner_anim_sel="#287700"
-                                  inner_key="#ffdf44"
-                                  inner_key_sel="#b39400"
-                                  inner_driven="#b566ff"
-                                  inner_driven_sel="#ce99ff"
-                                  blend="1">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#181818"
-                   wire="#505050"
-                   lamp="#977f491e"
-                   speaker="#a63904"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#d1687d"
-                   object_active="#ff0034"
-                   object_grouped="#127112"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#9a001f"
-                   vertex_select="#ff0034"
-                   vertex_size="4"
-                   edge_select="#b30025"
-                   edge_seam="#ff0000"
-                   edge_sharp="#7bff00"
-                   edge_crease="#cc0099"
-                   edge_facesel="#4b4b4b"
-                   face="#ffffff0c"
-                   face_select="#e8142f2c"
-                   face_dot="#ac0023"
-                   facedot_size="4"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#000000"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#000000"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#f0ff40"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#008200"
-                   extra_face_area="#0000ff"
-                   editmesh_active="#ff5edece"
-                   normal="#27ffff"
-                   vertex_normal="#2361dd"
-                   bone_solid="#424242"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#a0a0a0"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#111111"
-                             title="#c7c7c7"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#1a1a1a"
-                             header_text="#757575"
-                             header_text_hi="#ffffff"
-                             button="#16161657"
-                             button_title="#cccccc"
-                             button_text="#6a6a6a"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#1d1d1d"
-                        window_sliders="#3b3b3b"
-                        channels_region="#707070"
-                        vertex="#000000"
-                        vertex_select="#ff004b"
-                        vertex_size="3"
-                        handle_free="#000000"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#000000"
-                        handle_sel_auto="#f0ff40"
-                        handle_sel_vect="#40c030"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#994030"
-                        handle_sel_auto_clamped="#f0af90"
-                        lastsel_point="#000000"
-                        frame_current="#99112c"
-                        handle_vertex="#000000"
-                        handle_vertex_select="#ff004b"
-                        handle_vertex_size="3"
-                        channel_group="#4f6549"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#4c5966"
-                        dopesheet_subchannel="#7c8996">
-        <space>
-          <ThemeSpaceGeneric back="#232323"
-                             title="#ffffff"
-                             text="#828282"
-                             text_hi="#ffffff"
-                             header="#232323"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#232323ff"
-                             button_title="#ffffff"
-                             button_text="#757575"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#232323"
-                                 list_title="#8d7878"
-                                 list_text="#cccccc"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#88172d"
-                        scrollbar="#242424"
-                        scroll_handle="#373737"
-                        active_file="#ff004b"
-                        active_file_text="#ffffff">
-        <space>
-          <ThemeSpaceGeneric back="#161616"
-                             title="#ffffff"
-                             text="#fafafa"
-                             text_hi="#ffffff"
-                             header="#161616"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#161616ff"
-                             button_title="#eaeaea"
-                             button_text="#dddddd"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#181818"
-                                 list_title="#9b9b9b"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#5e5e5e"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#0c0a0a"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#99112c">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#1a1a1a"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#0b0b0b"
-                      value_sliders="#000000"
-                      view_sliders="#898989"
-                      channels="#676767"
-                      channels_selected="#ff8099"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff7500"
-                      frame_current="#99112c"
-                      dopesheet_channel="#39434d"
-                      dopesheet_subchannel="#15171a"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#2a2a2a"
-                             title="#ffffff"
-                             text="#828282"
-                             text_hi="#ffffff"
-                             header="#2a2a2a"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#2a2a2aff"
-                             button_title="#ffffff"
-                             button_text="#636363"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#2a2a2a"
-                                 list_title="#ffffff"
-                                 list_text="#b3b3b3"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#f73c00"
-                        vertex_select="#df0041"
-                        vertex_size="3"
-                        face="#ffffff0a"
-                        face_select="#ff1d4a1a"
-                        face_dot="#ff3d1d"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#0707075e"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#1a1a1a"
-                             title="#ffffff"
-                             text="#9c9c9c"
-                             text_hi="#ffffff"
-                             header="#1a1a1a"
-                             header_text="#272727"
-                             header_text_hi="#ffffff"
-                             button="#070707ff"
-                             button_title="#ffffff"
-                             button_text="#bebebe"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#414141"
-                           window_sliders="#6d6d6d"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#675379"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#e270a6"
-                           transition_strip="#b33d59"
-                           meta_strip="#6d9183"
-                           frame_current="#99112c"
-                           keyframe="#ff9f00"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#171717"
-                             title="#ffffff"
-                             text="#757575"
-                             text_hi="#ffffff"
-                             header="#171717"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#17171742"
-                             button_title="#ffffff"
-                             button_text="#979797"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#1a1a1a"
-                             title="#aeaeae"
-                             text="#999999"
-                             text_hi="#ffffff"
-                             header="#1a1a1a"
-                             header_text="#757575"
-                             header_text_hi="#ffffff"
-                             button="#1e1e1eff"
-                             button_title="#414141"
-                             button_text="#4e4e4e"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#0a0a0a"
-                       selected_text="#561423"
-                       cursor="#ffffff"
-                       syntax_builtin="#ff009a"
-                       syntax_special="#ffff00"
-                       syntax_comment="#00ff7a"
-                       syntax_string="#f20000"
-                       syntax_numbers="#0088ff">
-        <space>
-          <ThemeSpaceGeneric back="#050505"
-                             title="#ffffff"
-                             text="#a9a9a9"
-                             text_hi="#ffffff"
-                             header="#1a1a1a"
-                             header_text="#f2f2f2"
-                             header_text_hi="#ffffff"
-                             button="#1a1a1aff"
-                             button_title="#d0d0d0"
-                             button_text="#ffffff"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#343434"
-                     frame_current="#ff1d4a">
-        <space>
-          <ThemeSpaceGeneric back="#232323"
-                             title="#757575"
-                             text="#757575"
-                             text_hi="#ffffff"
-                             header="#232323"
-                             header_text="#828282"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#0d0d0d"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#ff0000"
-                       wire_select="#ffe500"
-                       selected_text="#ffdddd"
-                       node_backdrop="#454545ae"
-                       in_out_node="#d9003a"
-                       converter_node="#00465d"
-                       operator_node="#d87200"
-                       group_node="#26960e"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#111111"
-                             title="#ffffff"
-                             text="#ffffff"
-                             text_hi="#565656"
-                             header="#111111"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#0c0c0c2f"
-                             button_title="#ffffff"
-                             button_text="#bebebe"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#a5a5a5"
-                                 list_title="#ffffff"
-                                 list_text="#343434"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#272727"
-                             title="#ffffff"
-                             text="#9d9d9d"
-                             text_hi="#ffffff"
-                             header="#272727"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#111111ff"
-                             button_title="#ffffff"
-                             button_text="#ffffff"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#337f33"
-                     selected_highlight="#870027">
-        <space>
-          <ThemeSpaceGeneric back="#232323"
-                             title="#ffffff"
-                             text="#939393"
-                             text_hi="#ffffff"
-                             header="#232323"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#585858ff"
-                             button_title="#ffffff"
-                             button_text="#8f8f8f"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#090909"
-                             title="#ffffff"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#222222"
-                             header_text="#999999"
-                             header_text_hi="#cbcbcb"
-                             button="#161616ff"
-                             button_title="#0d0d0d"
-                             button_text="#0d0d0d"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#1a1a1a"
-                             title="#f2f2f2"
-                             text="#686868"
-                             text_hi="#ffffff"
-                             header="#1a1a1a"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#414141"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#ff336e"
-                    line_input="#a4a4a4"
-                    line_info="#ffd600"
-                    line_error="#00df62"
-                    cursor="#dc6060">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#828282"
-                             text="#828282"
-                             text_hi="#ffffff"
-                             header="#1a1a1a"
-                             header_text="#ffffff"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#ffffff"
-                             button_text="#343434"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#3c3c3c"
-                       marker="#f68026"
-                       active_marker="#ffe6ea"
-                       selected_marker="#ff2550"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0b22"
-                       path_after="#007dff"
-                       grid="#5e5e5e"
-                       frame_current="#60c040"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="6"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#232323"
-                             title="#6b6b6b"
-                             text="#888888"
-                             text_hi="#ffffff"
-                             header="#232323"
-                             header_text="#aaaaaa"
-                             header_text_hi="#ffffff"
-                             button="#0b0b0bff"
-                             button_title="#adadad"
-                             button_text="#888888"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/softblend.xml b/release/scripts/addons_contrib/presets/interface_theme/softblend.xml
deleted file mode 100644
index 58c96b0..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/softblend.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#5f5e5c"
-                             inner="#7b7978ff"
-                             inner_sel="#95adc1ff"
-                             item="#979594ff"
-                             text="#1a1a1a"
-                             text_sel="#1a1a1a"
-                             show_shaded="TRUE"
-                             shadetop="-2"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#a6a4a2"
-                             inner="#aaa8a6ff"
-                             inner_sel="#a19f9dff"
-                             item="#a19f9dff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="-6">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#aaa8a6"
-                             inner="#a8a6a4ff"
-                             inner_sel="#95adc1ff"
-                             item="#aaa8a6ff"
-                             text="#1a1a1a"
-                             text_sel="#1a1a1a"
-                             show_shaded="TRUE"
-                             shadetop="-2"
-                             shadedown="1">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#aaa8a6"
-                             inner="#a6a4a2ff"
-                             inner_sel="#f1e593ff"
-                             item="#c2b876ff"
-                             text="#242424"
-                             text_sel="#242424"
-                             show_shaded="TRUE"
-                             shadetop="-2"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#acaaa8"
-                             inner="#a5a3a1ff"
-                             inner_sel="#ccc9c7ff"
-                             item="#000000ff"
-                             text="#676767"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="-2"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#aaa8a6"
-                             inner="#a8a6a4ff"
-                             inner_sel="#95adc1ff"
-                             item="#aaa8a6ff"
-                             text="#1c1c1c"
-                             text_sel="#1a1a1a"
-                             show_shaded="TRUE"
-                             shadetop="-3"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#050505"
-                             inner="#353432ff"
-                             inner_sel="#353432ff"
-                             item="#222222ff"
-                             text="#efefef"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#050505"
-                             inner="#353432ff"
-                             inner_sel="#353432ff"
-                             item="#1f1f1fff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#9f9d9b"
-                             inner="#aaa8a6ff"
-                             inner_sel="#aaa8a6ff"
-                             item="#ccccccff"
-                             text="#474747"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="6">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#aaa8a6"
-                             inner="#aaa8a6ff"
-                             inner_sel="#b0aeacff"
-                             item="#8e8c8bff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="-4"
-                             shadedown="3">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#474747"
-                             inner="#aaa8a6ff"
-                             inner_sel="#aaa8a6ff"
-                             item="#ccccccff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#474747"
-                             inner="#aaa8a6ff"
-                             inner_sel="#aaa8a6ff"
-                             item="#ccccccff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#474747"
-                             inner="#00000000"
-                             inner_sel="#aaa8a6ff"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-10"
-                             shadedown="10">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#82807f"
-                             inner="#a4a2a0ff"
-                             inner_sel="#aaa8a6ff"
-                             item="#a2a19fff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="4"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#474747"
-                             inner="#aaa8a6ff"
-                             inner_sel="#aaa8a6ff"
-                             item="#96c78eff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="3"
-                             shadedown="-3">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#8c8a88"
-                             inner="#f1e59333"
-                             inner_sel="#fff29c9a"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#adb4c7"
-                                  inner_anim_sel="#c4cee0"
-                                  inner_key="#c0bb83"
-                                  inner_key_sel="#dad37d"
-                                  inner_driven="#c69cb1"
-                                  inner_driven_sel="#ecaacd"
-                                  blend="1">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#6e6e6e"
-                   wire="#242424"
-                   lamp="#ffe56666"
-                   speaker="#000000"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#88fca7"
-                   object_active="#ffffff"
-                   object_grouped="#63bd87"
-                   object_grouped_active="#ffffff"
-                   transform="#ffffff"
-                   vertex="#343434"
-                   vertex_select="#ff2f7a"
-                   vertex_size="4"
-                   edge_select="#f3f3f3"
-                   edge_seam="#f0703b"
-                   edge_sharp="#49a1ec"
-                   edge_crease="#eb3bdd"
-                   edge_facesel="#272727"
-                   face="#838383ff"
-                   face_select="#949494ff"
-                   face_dot="#52f27e"
-                   facedot_size="3"
-                   nurb_uline="#a3a3a3"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#ffffff"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#c36c8c"
-                   handle_free="#cccccc"
-                   handle_auto="#30b6e5"
-                   handle_vect="#afafaf"
-                   handle_align="#e277b1"
-                   handle_sel_free="#ffffff"
-                   handle_sel_auto="#ffffff"
-                   handle_sel_vect="#ffffff"
-                   handle_sel_align="#ffffff"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#cccccc"
-                   extra_face_area="#cccccc"
-                   editmesh_active="#ffffff00"
-                   normal="#9cfcc8"
-                   vertex_normal="#68a1db"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#53c03b"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#000000"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#918f8d"
-                             title="#ffffff"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a657"
-                             button_title="#313131"
-                             button_text="#222222"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#8f8f8f"
-                        window_sliders="#4d4d4d"
-                        channels_region="#4d4d4d"
-                        vertex="#575757"
-                        vertex_select="#ffffff"
-                        vertex_size="3"
-                        handle_free="#252525"
-                        handle_auto="#696969"
-                        handle_vect="#191919"
-                        handle_align="#1d1d1d"
-                        handle_sel_free="#ececec"
-                        handle_sel_auto="#d4d4d4"
-                        handle_sel_vect="#ffffff"
-                        handle_sel_align="#f3f3f3"
-                        handle_auto_clamped="#000000"
-                        handle_sel_auto_clamped="#000000"
-                        lastsel_point="#000000"
-                        frame_current="#a1ff8c"
-                        handle_vertex="#525252"
-                        handle_vertex_select="#f1f1f1"
-                        handle_vertex_size="6"
-                        channel_group="#8a9dac"
-                        active_channels_group="#95adc1"
-                        dopesheet_channel="#aaa8a6"
-                        dopesheet_subchannel="#aaa8a6">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#000000"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#333333"
-                             button_text="#222222"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#aaa8a6"
-                                 list_title="#676767"
-                                 list_text="#222222"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#f1e593"
-                        scrollbar="#4d4b4d"
-                        scroll_handle="#8c8a88"
-                        active_file="#f1e593"
-                        active_file_text="#ffffff">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#ffffff"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#afafaf"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#222222"
-                             button_text="#cccccc"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#aaa8a6"
-                                 list_title="#3a3a3a"
-                                 list_text="#7f7f7f"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#a39f9c"
-                      view_sliders="#4d4d4d"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#000000"
-                      strips_selected="#60c040"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#a3ff96">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#000000"
-                             text="#333333"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#a3a3a3"
-                             header_text_hi="#cccccc"
-                             button="#aaa8a6ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#aaa8a6"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#7f7f7f"
-                      value_sliders="#000000"
-                      view_sliders="#333333"
-                      channels="#9baeb9"
-                      channels_selected="#91ccb3"
-                      channel_group="#8a9dac"
-                      active_channels_group="#95adc1"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ecfc37"
-                      frame_current="#a3ff96"
-                      dopesheet_channel="#9baeb9"
-                      dopesheet_subchannel="#aaa8a6"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#ffffff"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#111111"
-                             button_text="#111111"
-                             button_text_hi="#a3a3a3">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#aaa8a6"
-                                 list_title="#cccccc"
-                                 list_text="#222222"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#000000"
-                        vertex_select="#ffffff"
-                        vertex_size="3"
-                        face="#00000032"
-                        face_select="#ffffff3c"
-                        face_dot="#ffffff"
-                        facedot_size="2"
-                        editmesh_active="#ffffff80"
-                        scope_back="#aaa8a6ff"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#2d2d2d"
-                             title="#000000"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#383838"
-                             button_text="#222222"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#afafaf"
-                           window_sliders="#777777"
-                           movie_strip="#87a4c3"
-                           movieclip_strip="#20208f"
-                           image_strip="#c99ac0"
-                           scene_strip="#91b1a0"
-                           audio_strip="#e0d2a0"
-                           effect_strip="#be8c76"
-                           transition_strip="#d9777a"
-                           meta_strip="#91918d"
-                           frame_current="#a3ff96"
-                           keyframe="#ffeb89"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#000000"
-                             text="#333333"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#a3a3a3"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a642"
-                             button_title="#111111"
-                             button_text="#111111"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#222222"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#222222"
-                             header_text_hi="#000000"
-                             button="#aaa8a6ff"
-                             button_title="#222222"
-                             button_text="#222222"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#a3a3a3"
-                       selected_text="#f1e593"
-                       cursor="#54da70"
-                       syntax_builtin="#3162b2"
-                       syntax_special="#ca0c97"
-                       syntax_comment="#535353"
-                       syntax_string="#c31736"
-                       syntax_numbers="#b62440">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#000000"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#222222"
-                             button_text="#333333"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#838383"
-                     frame_current="#a3ff96">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#cccccc"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#a3a3a3"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#aeacaa"
-                             button_text="#222222"
-                             button_text_hi="#a3a3a3">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#222222"
-                       wire_select="#ffffff"
-                       selected_text="#ffffff"
-                       node_backdrop="#d4d4d4ff"
-                       in_out_node="#b1d9ff"
-                       converter_node="#fffa90"
-                       operator_node="#beffcb"
-                       group_node="#ffc173"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#a3a3a3"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#333333"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a62f"
-                             button_title="#222222"
-                             button_text="#222222"
-                             button_text_hi="#c5c5c5">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#4d4d4d"
-                                 list_title="#383838"
-                                 list_text="#676767"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#202020"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#111111"
-                             button_text="#222222"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#337f33"
-                     selected_highlight="#870027">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#ffffff"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#0f0f0f"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#222222"
-                             text="#222222"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#6080ff"
-                    line_input="#ffffff"
-                    line_info="#00aa00"
-                    line_error="#dc3a77"
-                    cursor="#9cfcc8">
-        <space>
-          <ThemeSpaceGeneric back="#0c0c0c"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#4d4d4dff"
-                             button_title="#131313"
-                             button_text="#131313"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#000000"
-                       marker="#71cd7f"
-                       active_marker="#ffffff"
-                       selected_marker="#ff2f7a"
-                       disabled_marker="#b54636"
-                       locked_marker="#7f7f7f"
-                       path_before="#22d8d1"
-                       path_after="#5a7575"
-                       grid="#5e5e5e"
-                       frame_current="#a3ff96"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ff2f7a"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#aaa8a6"
-                             title="#1a1a1a"
-                             text="#1a1a1a"
-                             text_hi="#ffffff"
-                             header="#aaa8a6"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaa8a6ff"
-                             button_title="#222222"
-                             button_text="#222222"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000004"
-                                back="#72727280"
-                                show_header="TRUE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/softdefault.xml b/release/scripts/addons_contrib/presets/interface_theme/softdefault.xml
deleted file mode 100644
index 74c5b25..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/softdefault.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#646464"
-                             inner="#727272ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#646464"
-                             inner="#6c6c6cff"
-                             inner_sel="#6b8cafff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#646464"
-                             inner="#727272ff"
-                             inner_sel="#dbcc6fff"
-                             item="#91874aff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#646464"
-                             inner="#727272ff"
-                             inner_sel="#838383ff"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#646464"
-                             inner="#727272ff"
-                             inner_sel="#6b8cafff"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#606060"
-                             inner="#595959ff"
-                             inner_sel="#444444ff"
-                             item="#3b3b3bff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#606060"
-                             inner="#595959ff"
-                             inner_sel="#595959ff"
-                             item="#494949ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="-20"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#646464"
-                             inner="#6c6c6cff"
-                             inner_sel="#6c6c6cff"
-                             item="#4a4a4aff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#606060"
-                             inner="#727272ff"
-                             inner_sel="#6c6c6cff"
-                             item="#464646ff"
-                             text="#000000"
-                             text_sel="#f5f5f5"
-                             show_shaded="TRUE"
-                             shadetop="-5"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#606060"
-                             inner="#3f3f3fff"
-                             inner_sel="#727272ff"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#505050"
-                             inner="#727272ff"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#000000"
-                             text_sel="#ececec"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#727272"
-                             inner="#00000000"
-                             inner_sel="#727272ff"
-                             item="#ffffffff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-8"
-                             shadedown="5">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#6a6a6a"
-                             inner="#727272ff"
-                             inner_sel="#646464ff"
-                             item="#626262ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#727272"
-                             inner="#758b69ff"
-                             inner_sel="#93af84ff"
-                             item="#93af84ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#6b8cafff"
-                             item="#000000ff"
-                             text="#000000"
-                             text_sel="#000000"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#98cc7e"
-                                  inner_anim_sel="#5aa633"
-                                  inner_key="#f0ec75"
-                                  inner_key_sel="#d7d34b"
-                                  inner_driven="#cf5bff"
-                                  inner_driven_sel="#ac45d7"
-                                  blend="0.5">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#555555"
-                   wire="#000000"
-                   lamp="#e3d45966"
-                   speaker="#5c6db2"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#ffffff"
-                   object_active="#ffffff"
-                   object_grouped="#083008"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#000000"
-                   vertex_select="#ff6424"
-                   vertex_size="3"
-                   edge_select="#e3e3e3"
-                   edge_seam="#db5c3d"
-                   edge_sharp="#3a9fff"
-                   edge_crease="#cc57b4"
-                   edge_facesel="#4b4b4b"
-                   face="#00000058"
-                   face_select="#0000003c"
-                   face_dot="#9bff61"
-                   facedot_size="3"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#000000"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#000000"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#002000"
-                   extra_face_area="#000080"
-                   editmesh_active="#ffffff72"
-                   normal="#22dddd"
-                   vertex_normal="#2361dd"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#000000"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#404040"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#72727257"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#5e5e5e"
-                        window_sliders="#969696"
-                        channels_region="#707070"
-                        vertex="#000000"
-                        vertex_select="#ffffff"
-                        vertex_size="5"
-                        handle_free="#ffffff"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#000000"
-                        handle_sel_auto="#ffffff"
-                        handle_sel_vect="#6ee854"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#994030"
-                        handle_sel_auto_clamped="#f0af90"
-                        lastsel_point="#000000"
-                        frame_current="#7ec068"
-                        handle_vertex="#000000"
-                        handle_vertex_select="#ffffff"
-                        handle_vertex_size="8"
-                        channel_group="#8686b0"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#76879c"
-                        dopesheet_subchannel="#8699b0">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#1e1e1e"
-                        scrollbar="#a0a0a0"
-                        scroll_handle="#7f7979"
-                        active_file="#727272"
-                        active_file_text="#fafafa">
-        <space>
-          <ThemeSpaceGeneric back="#4c4c4c"
-                             title="#000000"
-                             text="#fafafa"
-                             text_hi="#0f0f0f"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#5e5e5e"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#0c0a0a"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#7ec068">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#5e5e5e"
-                      value_sliders="#000000"
-                      view_sliders="#969696"
-                      channels="#707070"
-                      channels_selected="#60c040"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff8c00"
-                      frame_current="#60c040"
-                      dopesheet_channel="#52606e"
-                      dopesheet_subchannel="#7c8996"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#6b6b6b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        face="#ffffff0a"
-                        face_select="#ff85003c"
-                        face_dot="#ff8500"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#727272ff"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#353535"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#404040"
-                           window_sliders="#a0a0a0"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#6d5881"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#a9547c"
-                           transition_strip="#a25f6f"
-                           meta_strip="#6d9183"
-                           frame_current="#60c040"
-                           keyframe="#ff8500"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#747474"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#72727242"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#7c7c7c"
-                       selected_text="#bdbd8d"
-                       cursor="#afff80"
-                       syntax_builtin="#ff5353"
-                       syntax_special="#92da66"
-                       syntax_comment="#ffffff"
-                       syntax_string="#f7f185"
-                       syntax_numbers="#7dc8c8">
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#565656"
-                     frame_current="#7ec068">
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#000000"
-                       wire_select="#ffffff"
-                       selected_text="#ffffff"
-                       node_backdrop="#858585ff"
-                       in_out_node="#b0cae0"
-                       converter_node="#b5b1ea"
-                       operator_node="#ffa46c"
-                       group_node="#d5ffa2"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#7272722f"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#a5a5a5"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#646464"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#337f33"
-                     selected_highlight="#82878c">
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#6080ff"
-                    line_input="#ffffff"
-                    line_info="#e4e585"
-                    line_error="#dc6060"
-                    cursor="#8bdc66">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#000000"
-                       marker="#7f7f00"
-                       active_marker="#ffffff"
-                       selected_marker="#ffff00"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0000"
-                       path_after="#0000ff"
-                       grid="#5e5e5e"
-                       frame_current="#60c040"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#393939"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#727272"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/toxic.xml b/release/scripts/addons_contrib/presets/interface_theme/toxic.xml
deleted file mode 100644
index 8aa87a5..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/toxic.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#0a0a0aff"
-                             inner_sel="#84b600ff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#79b224ff"
-                             inner_sel="#80b200ff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#7eb000ff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#7cae00ff"
-                             item="#191919ff"
-                             text="#e4e4e4"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#7aac00ff"
-                             item="#ffffffff"
-                             text="#c7c7c7"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#78aa00ff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#76a800ff"
-                             item="#2a2a2aff"
-                             text="#929292"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#111111ff"
-                             item="#74a600ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#72a400ff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#70a200ff"
-                             item="#2a2a2aff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#6ea000ff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#6c9e00ff"
-                             item="#191919ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#6a9c00ff"
-                             item="#191919ff"
-                             text="#fdfdfd"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#171717ff"
-                             inner_sel="#689a00ff"
-                             item="#689a00ff"
-                             text="#fdfdfd"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#669800ff"
-                             item="#191919ff"
-                             text="#fdfdfd"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#111111ff"
-                             inner_sel="#649600ff"
-                             item="#191919ff"
-                             text="#fdfdfd"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-100"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#56ff00"
-                                  inner_anim_sel="#56ff00"
-                                  inner_key="#fff400"
-                                  inner_key_sel="#fff400"
-                                  inner_driven="#629400"
-                                  inner_driven_sel="#609200"
-                                  blend="0.1">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#3f3f3f"
-                   wire="#888888"
-                   lamp="#c1d40028"
-                   speaker="#535353"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#3ebe2e"
-                   object_active="#97ff22"
-                   object_grouped="#083008"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#72cfdd"
-                   vertex_select="#3cbc2c"
-                   vertex_size="3"
-                   edge_select="#3cbc2c"
-                   edge_seam="#db2512"
-                   edge_sharp="#ff2020"
-                   edge_crease="#cc0099"
-                   edge_facesel="#6b6b6b"
-                   face="#73828f12"
-                   face_select="#3aba2a3c"
-                   face_dot="#95fd20"
-                   facedot_size="4"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#7f7f7f"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#3b3b3b"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#ffedf8"
-                   extra_face_angle="#00c900"
-                   extra_face_area="#fff000"
-                   editmesh_active="#ffffff80"
-                   normal="#22dddd"
-                   vertex_normal="#2361dd"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#5a5a5a"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#0f0f0f"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#00000057"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#262626"
-                        window_sliders="#969696"
-                        channels_region="#6d6d6d"
-                        vertex="#ffffff"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        handle_free="#808080"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#808080"
-                        handle_sel_auto="#f0ff40"
-                        handle_sel_vect="#40c030"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#994030"
-                        handle_sel_auto_clamped="#f0af90"
-                        lastsel_point="#808080"
-                        frame_current="#336622"
-                        handle_vertex="#808080"
-                        handle_vertex_select="#ff8500"
-                        handle_vertex_size="3"
-                        channel_group="#4f6549"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#52606e"
-                        dopesheet_subchannel="#7c8996">
-        <space>
-          <ThemeSpaceGeneric back="#0d0d0d"
-                             title="#5d5d5d"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#1a1a1a"
-                                 list_title="#000000"
-                                 list_text="#bbbbbb"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#2f6629"
-                        scrollbar="#a0a0a0"
-                        scroll_handle="#7f7070"
-                        active_file="#b1b1b1"
-                        active_file_text="#ffffff">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#181818"
-                                 list_title="#9e9e9e"
-                                 list_text="#5d5d5d"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#5e5e5e"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#aa8d8d"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#2f6421">
-        <space>
-          <ThemeSpaceGeneric back="#0d0d0d"
-                             title="#585858"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c3c3c3"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#0c0c0c"
-                                 list_title="#383838"
-                                 list_text="#d8d8d8"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#212121"
-                      value_sliders="#000000"
-                      view_sliders="#969696"
-                      channels="#707070"
-                      channels_selected="#60c040"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff8c00"
-                      frame_current="#2a5c1c"
-                      dopesheet_channel="#52606e"
-                      dopesheet_subchannel="#7c8996"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#080808"
-                             title="#5d5d5d"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#020202"
-                                 list_title="#2c2c2c"
-                                 list_text="#ebebeb"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#0f13bb"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        face="#ffffff0a"
-                        face_select="#ff85003c"
-                        face_dot="#ff8500"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#050505ff"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#282828"
-                           window_sliders="#a0a0a0"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#6d5881"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#a9547c"
-                           transition_strip="#a25f6f"
-                           meta_strip="#6d9183"
-                           frame_current="#2f5f23"
-                           keyframe="#ff8500"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#202020"
-                             title="#5d5d5d"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#f3f3f3"
-                             header_text_hi="#ffffff"
-                             button="#02020242"
-                             button_title="#bdbdbd"
-                             button_text="#dddddd"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#0e0e0eff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#191919"
-                       selected_text="#ffffff"
-                       cursor="#ff0000"
-                       syntax_builtin="#cf3d99"
-                       syntax_special="#969629"
-                       syntax_comment="#249d60"
-                       syntax_string="#cc3535"
-                       syntax_numbers="#3c68ff">
-        <space>
-          <ThemeSpaceGeneric back="#050505"
-                             title="#9e9e9e"
-                             text="#ebebeb"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#b9b9b9"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#d8d8d8"
-                             button_text="#cccccc"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#707070"
-                     frame_current="#3fff00">
-        <space>
-          <ThemeSpaceGeneric back="#162c0c"
-                             title="#5d5d5d"
-                             text="#c7c7c7"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#161616ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#6eafff"
-                       wire_select="#0019ff"
-                       selected_text="#7f7070"
-                       node_backdrop="#202030bc"
-                       in_out_node="#273053"
-                       converter_node="#113941"
-                       operator_node="#0e3157"
-                       group_node="#091a07"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#c7c7c7"
-                             header_text_hi="#ffffff"
-                             button="#0000002f"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#a5a5a5"
-                                 list_title="#ffffff"
-                                 list_text="#ffffff"
-                                 list_text_hi="#b8ffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#070707"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#356c1a"
-                     selected_highlight="#446e1c">
-        <space>
-          <ThemeSpaceGeneric back="#070707"
-                             title="#9b9b9b"
-                             text="#cccccc"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#5d5d5d"
-                             text="#9b9b9b"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#adadad"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#000000"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#6080ff"
-                    line_input="#cecece"
-                    line_info="#00aa00"
-                    line_error="#dc6060"
-                    cursor="#dc6060">
-        <space>
-          <ThemeSpaceGeneric back="#0f0f0f"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#000000ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#0094af"
-                       marker="#7f7f00"
-                       active_marker="#ffffff"
-                       selected_marker="#ffff00"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0000"
-                       path_after="#0000ff"
-                       grid="#5e5e5e"
-                       frame_current="#1b501b"
-                       handle_vertex="#e2e2e2"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#0d0d0d"
-                             title="#5d5d5d"
-                             text="#ffffff"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#070707ff"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#000000ff"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/interface_theme/zbrush.xml b/release/scripts/addons_contrib/presets/interface_theme/zbrush.xml
deleted file mode 100644
index ee8a839..0000000
--- a/release/scripts/addons_contrib/presets/interface_theme/zbrush.xml
+++ /dev/null
@@ -1,964 +0,0 @@
-<bpy>
-  <Theme>
-    <user_interface>
-      <ThemeUserInterface icon_file=""
-                          icon_alpha="1"
-                          axis_x="#dc0000"
-                          axis_y="#00dc00"
-                          axis_z="#0000dc">
-        <wcol_regular>
-          <ThemeWidgetColors outline="#191919"
-                             inner="#999999ff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_regular>
-        <wcol_tool>
-          <ThemeWidgetColors outline="#1f1f1f"
-                             inner="#333333ff"
-                             inner_sel="#c28d45ff"
-                             item="#191919ff"
-                             text="#b8b8b8"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="10"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_tool>
-        <wcol_radio>
-          <ThemeWidgetColors outline="#1f1f1f"
-                             inner="#333333ff"
-                             inner_sel="#c28d45ff"
-                             item="#ffffffff"
-                             text="#b8b8b8"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_radio>
-        <wcol_text>
-          <ThemeWidgetColors outline="#303030"
-                             inner="#7a8287ff"
-                             inner_sel="#999999ff"
-                             item="#5a5a5aff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_text>
-        <wcol_option>
-          <ThemeWidgetColors outline="#1f1f1f"
-                             inner="#3b3b3bff"
-                             inner_sel="#c28d45ff"
-                             item="#ffffffff"
-                             text="#b8b8b8"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_option>
-        <wcol_toggle>
-          <ThemeWidgetColors outline="#1f1f1f"
-                             inner="#333333ff"
-                             inner_sel="#c28d45ff"
-                             item="#191919ff"
-                             text="#b8b8b8"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_toggle>
-        <wcol_num>
-          <ThemeWidgetColors outline="#1f1f1f"
-                             inner="#333333ff"
-                             inner_sel="#999999ff"
-                             item="#727272ff"
-                             text="#b8b8b8"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="10"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_num>
-        <wcol_numslider>
-          <ThemeWidgetColors outline="#303030"
-                             inner="#606068ff"
-                             inner_sel="#91919dff"
-                             item="#3a3a3aff"
-                             text="#dfdfdf"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="-10"
-                             shadedown="10">
-          </ThemeWidgetColors>
-        </wcol_numslider>
-        <wcol_box>
-          <ThemeWidgetColors outline="#2a2a2a"
-                             inner="#3e3e3eff"
-                             inner_sel="#646464ff"
-                             item="#191919ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="-7">
-          </ThemeWidgetColors>
-        </wcol_box>
-        <wcol_menu>
-          <ThemeWidgetColors outline="#151515"
-                             inner="#2f2f2fff"
-                             inner_sel="#464646ff"
-                             item="#777777ff"
-                             text="#b8b8b8"
-                             text_sel="#cccccc"
-                             show_shaded="TRUE"
-                             shadetop="5"
-                             shadedown="-5">
-          </ThemeWidgetColors>
-        </wcol_menu>
-        <wcol_pulldown>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#3f3f3fff"
-                             inner_sel="#c28d45ff"
-                             item="#ffffffff"
-                             text="#b8b8b8"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="25"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_pulldown>
-        <wcol_menu_back>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#3b3b3bff"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#b8b8b8"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_menu_back>
-        <wcol_tooltip>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#191919e6"
-                             inner_sel="#2d2d2de6"
-                             item="#646464ff"
-                             text="#ffffff"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="25"
-                             shadedown="-20">
-          </ThemeWidgetColors>
-        </wcol_tooltip>
-        <wcol_menu_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#c28d45ff"
-                             item="#ffffffff"
-                             text="#b8b8b8"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="20">
-          </ThemeWidgetColors>
-        </wcol_menu_item>
-        <wcol_scroll>
-          <ThemeWidgetColors outline="#1c1c1c"
-                             inner="#07070719"
-                             inner_sel="#646464b4"
-                             item="#2e2e2eff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_scroll>
-        <wcol_progress>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#bebebeff"
-                             inner_sel="#646464b4"
-                             item="#444444ff"
-                             text="#000000"
-                             text_sel="#ffffff"
-                             show_shaded="FALSE"
-                             shadetop="0"
-                             shadedown="0">
-          </ThemeWidgetColors>
-        </wcol_progress>
-        <wcol_list_item>
-          <ThemeWidgetColors outline="#000000"
-                             inner="#00000000"
-                             inner_sel="#75582aae"
-                             item="#000000ff"
-                             text="#e0e0e0"
-                             text_sel="#000000"
-                             show_shaded="TRUE"
-                             shadetop="0"
-                             shadedown="-10">
-          </ThemeWidgetColors>
-        </wcol_list_item>
-        <wcol_state>
-          <ThemeWidgetStateColors inner_anim="#73be4c"
-                                  inner_anim_sel="#5aa633"
-                                  inner_key="#f0eb64"
-                                  inner_key_sel="#d7d34b"
-                                  inner_driven="#b400ff"
-                                  inner_driven_sel="#9900e6"
-                                  blend="0.5">
-          </ThemeWidgetStateColors>
-        </wcol_state>
-      </ThemeUserInterface>
-    </user_interface>
-    <view_3d>
-      <ThemeView3D grid="#353535"
-                   wire="#000000"
-                   lamp="#00000028"
-                   speaker="#000000"
-                   camera="#000000"
-                   empty="#000000"
-                   object_selected="#f1f1f1"
-                   object_active="#c28d45"
-                   object_grouped="#083008"
-                   object_grouped_active="#55bb55"
-                   transform="#ffffff"
-                   vertex="#a8a8a8"
-                   vertex_select="#c28d45"
-                   vertex_size="3"
-                   edge_select="#c28d45"
-                   edge_seam="#db2512"
-                   edge_sharp="#00ffff"
-                   edge_crease="#cc0099"
-                   edge_facesel="#4b4b4b"
-                   face="#00000054"
-                   face_select="#81602e73"
-                   face_dot="#c28d45"
-                   facedot_size="2"
-                   nurb_uline="#909000"
-                   nurb_vline="#803060"
-                   nurb_sel_uline="#f0ff40"
-                   nurb_sel_vline="#f090a0"
-                   act_spline="#db2512"
-                   handle_free="#000000"
-                   handle_auto="#909000"
-                   handle_vect="#409030"
-                   handle_align="#803060"
-                   handle_sel_free="#000000"
-                   handle_sel_auto="#f0ff40"
-                   handle_sel_vect="#40c030"
-                   handle_sel_align="#f090a0"
-                   lastsel_point="#ffffff"
-                   extra_edge_len="#200000"
-                   extra_face_angle="#000080"
-                   extra_face_area="#002000"
-                   editmesh_active="#ffffff80"
-                   normal="#22dddd"
-                   vertex_normal="#2361dd"
-                   bone_solid="#c8c8c8"
-                   bone_pose="#50c8ff"
-                   bone_pose_active="#8cffff"
-                   frame_current="#60c040"
-                   outline_width="1"
-                   bundle_solid="#c8c8c8"
-                   camera_path="#000000"
-                   skin_root="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#2c2e30"
-                             title="#000000"
-                             text="#b8b8b8"
-                             text_hi="#e9e9e9"
-                             header="#3b3b3b"
-                             header_text="#b9b9b9"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3b57"
-                             button_title="#949494"
-                             button_text="#878787"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeView3D>
-    </view_3d>
-    <graph_editor>
-      <ThemeGraphEditor grid="#4b4b4b"
-                        window_sliders="#969696"
-                        channels_region="#707070"
-                        vertex="#000000"
-                        vertex_select="#ff8500"
-                        vertex_size="3"
-                        handle_free="#000000"
-                        handle_auto="#909000"
-                        handle_vect="#409030"
-                        handle_align="#803060"
-                        handle_sel_free="#000000"
-                        handle_sel_auto="#f0ff40"
-                        handle_sel_vect="#40c030"
-                        handle_sel_align="#f090a0"
-                        handle_auto_clamped="#994030"
-                        handle_sel_auto_clamped="#f0af90"
-                        lastsel_point="#ffffff"
-                        frame_current="#60c040"
-                        handle_vertex="#000000"
-                        handle_vertex_select="#ff8500"
-                        handle_vertex_size="4"
-                        channel_group="#4f6549"
-                        active_channels_group="#87b17d"
-                        dopesheet_channel="#52606e"
-                        dopesheet_subchannel="#7c8996">
-        <space>
-          <ThemeSpaceGeneric back="#3b3b3b"
-                             title="#8b8b8b"
-                             text="#848484"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3bff"
-                             button_title="#8b8b8b"
-                             button_text="#8b8b8b"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#3b3b3b"
-                                 list_title="#8b8b8b"
-                                 list_text="#8b8b8b"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeGraphEditor>
-    </graph_editor>
-    <file_browser>
-      <ThemeFileBrowser selected_file="#755729"
-                        scrollbar="#a0a0a0"
-                        scroll_handle="#7f7070"
-                        active_file="#828282"
-                        active_file_text="#fafafa">
-        <space>
-          <ThemeSpaceGeneric back="#3a3a3a"
-                             title="#8b8b8b"
-                             text="#cacaca"
-                             text_hi="#0f0f0f"
-                             header="#3b3b3b"
-                             header_text="#8b8b8b"
-                             header_text_hi="#ffffff"
-                             button="#303030ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#3b3b3b"
-                                 list_title="#8b8b8b"
-                                 list_text="#8b8b8b"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeFileBrowser>
-    </file_browser>
-    <nla_editor>
-      <ThemeNLAEditor grid="#585858"
-                      view_sliders="#969696"
-                      active_action="#00000000"
-                      active_action_unset="#00000000"
-                      strips="#0c0a0a"
-                      strips_selected="#ff8c00"
-                      transition_strips="#000000"
-                      transition_strips_selected="#000000"
-                      meta_strips="#000000"
-                      meta_strips_selected="#000000"
-                      sound_strips="#000000"
-                      sound_strips_selected="#000000"
-                      tweak="#000000"
-                      tweak_duplicate="#000000"
-                      frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#4b4b4b"
-                             title="#8b8b8b"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3bff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#3b3b3b"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNLAEditor>
-    </nla_editor>
-    <dopesheet_editor>
-      <ThemeDopeSheet grid="#4b4b4b"
-                      value_sliders="#000000"
-                      view_sliders="#969696"
-                      channels="#707070"
-                      channels_selected="#60c040"
-                      channel_group="#4f6549"
-                      active_channels_group="#87b17d"
-                      long_key="#0c0a0a"
-                      long_key_selected="#ff8c00"
-                      frame_current="#60c040"
-                      dopesheet_channel="#52606e"
-                      dopesheet_subchannel="#7c8996"
-                      summary="#00000000">
-        <space>
-          <ThemeSpaceGeneric back="#3b3b3b"
-                             title="#000000"
-                             text="#848484"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#aaaaaaff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#3b3b3b"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeDopeSheet>
-    </dopesheet_editor>
-    <image_editor>
-      <ThemeImageEditor vertex="#a8a8a8"
-                        vertex_select="#c28d45"
-                        vertex_size="3"
-                        face="#7c7c7c0a"
-                        face_select="#c28d453c"
-                        face_dot="#c28d45"
-                        facedot_size="3"
-                        editmesh_active="#ffffff80"
-                        scope_back="#3b3b3bff"
-                        preview_stitch_face="#1242b026"
-                        preview_stitch_edge="#ff8500b2"
-                        preview_stitch_vert="#ff85007f"
-                        preview_stitch_stitchable="#00ff00ff"
-                        preview_stitch_unstitchable="#ff0000ff"
-                        preview_stitch_active="#e1d2c323">
-        <space>
-          <ThemeSpaceGeneric back="#303030"
-                             title="#8b8b8b"
-                             text="#8b8b8b"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3bff"
-                             button_title="#8b8b8b"
-                             button_text="#8b8b8b"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeImageEditor>
-    </image_editor>
-    <sequence_editor>
-      <ThemeSequenceEditor grid="#818181"
-                           window_sliders="#a0a0a0"
-                           movie_strip="#516987"
-                           movieclip_strip="#20208f"
-                           image_strip="#6d5881"
-                           scene_strip="#4e983e"
-                           audio_strip="#2e8f8f"
-                           effect_strip="#a9547c"
-                           transition_strip="#a25f6f"
-                           meta_strip="#6d9183"
-                           frame_current="#60c040"
-                           keyframe="#ff8500"
-                           draw_action="#50c8ff"
-                           preview_back="#000000">
-        <space>
-          <ThemeSpaceGeneric back="#3b3b3b"
-                             title="#8b8b8b"
-                             text="#848484"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3b42"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeSequenceEditor>
-    </sequence_editor>
-    <properties>
-      <ThemeProperties>
-        <space>
-          <ThemeSpaceGeneric back="#3b3b3b"
-                             title="#6d6d6d"
-                             text="#b8b8b8"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#b8b8b8"
-                             button_text="#b8b8b8"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeProperties>
-    </properties>
-    <text_editor>
-      <ThemeTextEditor line_numbers_background="#404040"
-                       selected_text="#c67777"
-                       cursor="#ff0000"
-                       syntax_builtin="#800050"
-                       syntax_special="#5f5f00"
-                       syntax_comment="#006432"
-                       syntax_string="#640000"
-                       syntax_numbers="#0000c8">
-        <space>
-          <ThemeSpaceGeneric back="#4b4b4b"
-                             title="#8b8b8b"
-                             text="#b8b8b8"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3bff"
-                             button_title="#8b8b8b"
-                             button_text="#8b8b8b"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTextEditor>
-    </text_editor>
-    <timeline>
-      <ThemeTimeline grid="#464646"
-                     frame_current="#60c040">
-        <space>
-          <ThemeSpaceGeneric back="#303030"
-                             title="#000000"
-                             text="#848484"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeTimeline>
-    </timeline>
-    <node_editor>
-      <ThemeNodeEditor node_selected="#ffffff"
-                       node_active="#ffffff"
-                       wire="#000000"
-                       wire_select="#ffffff"
-                       selected_text="#7f7070"
-                       node_backdrop="#9b9b9ba0"
-                       in_out_node="#646464"
-                       converter_node="#686a75"
-                       operator_node="#6c696f"
-                       group_node="#69756e"
-                       frame_node="#9a9b9ba0"
-                       noodle_curving="5">
-        <space>
-          <ThemeSpaceGeneric back="#3b3b3b"
-                             title="#8b8b8b"
-                             text="#8b8b8b"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3b2f"
-                             button_title="#8b8b8b"
-                             button_text="#8b8b8b"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#a5a5a5"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeNodeEditor>
-    </node_editor>
-    <logic_editor>
-      <ThemeLogicEditor>
-        <space>
-          <ThemeSpaceGeneric back="#3b3b3b"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3bff"
-                             button_title="#8b8b8b"
-                             button_text="#8b8b8b"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeLogicEditor>
-    </logic_editor>
-    <outliner>
-      <ThemeOutliner match="#245824"
-                     selected_highlight="#212844">
-        <space>
-          <ThemeSpaceGeneric back="#3a3a3a"
-                             title="#000000"
-                             text="#cacaca"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeOutliner>
-    </outliner>
-    <info>
-      <ThemeInfo>
-        <space>
-          <ThemeSpaceGeneric back="#727272"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#000000"
-                             header="#3b3b3b"
-                             header_text="#8b8b8b"
-                             header_text_hi="#000000"
-                             button="#3b3b3bff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#000000">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeInfo>
-    </info>
-    <user_preferences>
-      <ThemeUserPreferences>
-        <space>
-          <ThemeSpaceGeneric back="#3b3b3b"
-                             title="#000000"
-                             text="#b8b8b8"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#727272ff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeUserPreferences>
-    </user_preferences>
-    <console>
-      <ThemeConsole line_output="#b8b8b8"
-                    line_input="#ffffff"
-                    line_info="#00aa00"
-                    line_error="#dc6060"
-                    cursor="#dc6060">
-        <space>
-          <ThemeSpaceGeneric back="#202020"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#303030"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3bff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-      </ThemeConsole>
-    </console>
-    <clip_editor>
-      <ThemeClipEditor marker_outline="#000000"
-                       marker="#7f7f00"
-                       active_marker="#ffffff"
-                       selected_marker="#ffff00"
-                       disabled_marker="#7f0000"
-                       locked_marker="#7f7f7f"
-                       path_before="#ff0000"
-                       path_after="#0000ff"
-                       grid="#5e5e5e"
-                       frame_current="#60c040"
-                       handle_vertex="#000000"
-                       handle_vertex_select="#ffff00"
-                       handle_vertex_size="4"
-                       strips="#0c0a0a"
-                       strips_selected="#ff8c00">
-        <space>
-          <ThemeSpaceGeneric back="#2c2e30"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#3b3b3b"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3bff"
-                             button_title="#000000"
-                             button_text="#000000"
-                             button_text_hi="#ffffff">
-            <panelcolors>
-              <ThemePanelColors header="#00000019"
-                                back="#72727280"
-                                show_header="FALSE"
-                                show_back="FALSE">
-              </ThemePanelColors>
-            </panelcolors>
-          </ThemeSpaceGeneric>
-        </space>
-        <space_list>
-          <ThemeSpaceListGeneric list="#666666"
-                                 list_title="#000000"
-                                 list_text="#000000"
-                                 list_text_hi="#ffffff">
-          </ThemeSpaceListGeneric>
-        </space_list>
-      </ThemeClipEditor>
-    </clip_editor>
-    <bone_color_sets>
-      <ThemeBoneColorSet normal="#9a0000"
-                         select="#bd1111"
-                         active="#f70a0a"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f74018"
-                         select="#f66913"
-                         active="#fa9900"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e9109"
-                         select="#59b70b"
-                         active="#83ef1d"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#0a3694"
-                         select="#3667df"
-                         active="#5ec1ef"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#a9294e"
-                         select="#c1416a"
-                         active="#f05d91"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#430c78"
-                         select="#543aa3"
-                         active="#8764d5"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#24785a"
-                         select="#3c9579"
-                         active="#6fb6ab"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#4b707c"
-                         select="#6a8691"
-                         active="#9bc2cd"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#f4c90c"
-                         select="#eec236"
-                         active="#f3ff00"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#1e2024"
-                         select="#484c56"
-                         active="#ffffff"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6f2f6a"
-                         select="#9845be"
-                         active="#d330d6"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#6c8e22"
-                         select="#7fb022"
-                         active="#bbef5b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#8d8d8d"
-                         select="#b0b0b0"
-                         active="#dedede"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#834326"
-                         select="#8b5811"
-                         active="#bd6a11"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#08310e"
-                         select="#1c430b"
-                         active="#34622b"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-      <ThemeBoneColorSet normal="#000000"
-                         select="#000000"
-                         active="#000000"
-                         show_colored_constraints="FALSE">
-      </ThemeBoneColorSet>
-    </bone_color_sets>
-  </Theme>
-</bpy>
diff --git a/release/scripts/addons_contrib/presets/keyconfig/blender_2012_experimental.py b/release/scripts/addons_contrib/presets/keyconfig/blender_2012_experimental.py
deleted file mode 100644
index 068a2ef..0000000
--- a/release/scripts/addons_contrib/presets/keyconfig/blender_2012_experimental.py
+++ /dev/null
@@ -1,1487 +0,0 @@
-""" An experimental new keymap for Blender.
-    Work in progress!
-"""
-import bpy
-
-######################
-# Misc configuration
-######################
-DEVELOPER_HOTKEYS = False  # Weird hotkeys that only developers use
-MAYA_STYLE_MANIPULATORS = False  # Maya-style "QWER" hotkeys for manipulators
-SUBSURF_RELATIVE = True  # Make subsurf hotkeys work by relative
-                         # shifting instead of absolute setting
-# Left mouse-button select
-bpy.context.user_preferences.inputs.select_mouse = 'LEFT'
-
-# Basic transform keys
-TRANSLATE_KEY = 'F'
-ROTATE_KEY = 'D'
-SCALE_KEY = 'S'
-
-# Specials Menu Key
-SPECIALS_MENU_KEY = 'Q'
-
-
-################################
-# Helper functions and classes
-################################
-class SetManipulator(bpy.types.Operator):
-    """Set's the manipulator mode"""
-    bl_idname = "view3d.manipulator_set"
-    bl_label = "Set Manipulator"
-    mode = bpy.props.EnumProperty(items=[("NONE", "None", ""),
-                                         ("TRANSLATE", "Translate", ""),
-                                         ("ROTATE", "Rotate", ""),
-                                         ("SCALE", "Scale", "")],
-                                         default="NONE")
-
-    def execute(self, context):
-        if self.mode == "NONE":
-            context.space_data.show_manipulator = False
-        elif self.mode == "TRANSLATE":
-            context.space_data.show_manipulator = True
-            context.space_data.use_manipulator_translate = True
-            context.space_data.use_manipulator_rotate = False
-            context.space_data.use_manipulator_scale = False
-        elif self.mode == "ROTATE":
-            context.space_data.show_manipulator = True
-            context.space_data.use_manipulator_translate = False
-            context.space_data.use_manipulator_rotate = True
-            context.space_data.use_manipulator_scale = False
-        elif self.mode == "SCALE":
-            context.space_data.show_manipulator = True
-            context.space_data.use_manipulator_translate = False
-            context.space_data.use_manipulator_rotate = False
-            context.space_data.use_manipulator_scale = True
-
-        return {'FINISHED'}
-bpy.utils.register_class(SetManipulator)
-
-
-class ModeSwitchMenu(bpy.types.Menu):
-    """ A menu for switching between object modes.
-    """
-    bl_idname = "OBJECT_MT_mode_switch_menu"
-    bl_label = "Switch Mode"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_enum("object.mode_set", "mode")
-bpy.utils.register_class(ModeSwitchMenu)
-
-
-# Temporary work around: Blender does not properly limit the mode switch menu
-# items until the first mode switch (e.g. mesh objects will show pose mode as
-# an option).
-# TODO: file a bug report for this behavior.
-bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
-
-
-class ObjectDeleteNoConfirm(bpy.types.Operator):
-    """Delete selected objects without the confirmation popup"""
-    bl_idname = "object.delete_no_confirm"
-    bl_label = "Delete Objects No Confirm"
-    bl_options = {'UNDO'}
-    
-    @classmethod
-    def poll(cls, context):
-        return context.active_object is not None
-
-    def execute(self, context):
-        bpy.ops.object.delete()
-
-        return {'FINISHED'}
-bpy.utils.register_class(ObjectDeleteNoConfirm)
-
-
-class ShiftSubsurfLevel(bpy.types.Operator):
-    """Shift the subsurf level of the selected objects up or """ \
-    """down by the given amount (has maximum limit, to avoid """ \
-    """going crazy and running out of RAM)"""
-    bl_idname = "object.shift_subsurf_level"
-    bl_label = "Shift Subsurf Level"
-
-    delta = bpy.props.IntProperty(name="Delta", description="Amount to increase/decrease the subsurf level.", default=1)
-    min = bpy.props.IntProperty(name="Minimum", description="The lowest subsurf level to shift to.", default=0)
-    max = bpy.props.IntProperty(name="Maximum", description="The highest subsurf level to shift to.", default=4)
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object is not None
-
-    def execute(self, context):
-        for obj in context.selected_objects:
-            # Find the last subsurf modifier in the stack
-            m = None
-            for mod in obj.modifiers:
-                if mod.type == "SUBSURF":
-                    m = mod
-
-            # Add a subsurf modifier if necessary
-            if not m and self.delta > 0:
-                m = obj.modifiers.new(name="Subsurf", type='SUBSURF')
-                m.levels = 0
-
-            # Adjust it's subsurf level
-            if m:
-                if self.delta > 0:
-                    if (m.levels + self.delta) <= self.max:
-                        m.levels += self.delta
-                elif self.delta < 0:
-                    if (m.levels + self.delta) >= self.min:
-                        m.levels += self.delta
-        return {'FINISHED'}
-bpy.utils.register_class(ShiftSubsurfLevel)
-
-
-class SetEditMeshSelectMode(bpy.types.Operator):
-    """Set edit mesh select mode (vert, edge, face)"""
-    bl_idname = "view3d.set_edit_mesh_select_mode"
-    bl_label = "Set Edit Mesh Select Mode"
-    mode = bpy.props.EnumProperty(items=[("VERT", "Vertex", ""),
-                                         ("EDGE", "Edge", ""),
-                                         ("FACE", "Face", "")],
-                                         default="VERT")
-    toggle = bpy.props.BoolProperty(name="Toggle", default=False)
-    
-    @classmethod
-    def poll(cls, context):
-        return context.active_object is not None
-    
-    def execute(self, context):
-        if self.mode == "VERT":
-            mode = 0
-        elif self.mode == "EDGE":
-            mode = 1
-        else:  # self.mode == "FACE"
-            mode = 2
-        
-        select_mode = context.tool_settings.mesh_select_mode
-        if self.toggle:
-            select_mode[mode] = [True, False][select_mode[mode]]
-        else:
-            select_mode[mode] = True
-            for i in range(0,3):
-                if i != mode:
-                    select_mode[i] = False
-            
-        return {'FINISHED'}
-bpy.utils.register_class(SetEditMeshSelectMode)
-
-
-class MeshDeleteContextual(bpy.types.Operator):
-    """ Deletes mesh elements based on context instead
-        of forcing the user to select from a menu what
-        it should delete.
-    """
-    bl_idname = "mesh.delete_contextual"
-    bl_label = "Mesh Delete Contextual"
-    bl_options = {'UNDO'}
-    
-    @classmethod
-    def poll(cls, context):
-        return (context.active_object is not None) and (context.mode == "EDIT_MESH")
-    
-    def execute(self, context):
-        select_mode = context.tool_settings.mesh_select_mode
-        
-        if select_mode[0]:
-            bpy.ops.mesh.delete(type='VERT')
-        elif select_mode[1] and not select_mode[2]:
-            bpy.ops.mesh.delete(type='EDGE')
-        elif select_mode[2] and not select_mode[1]:
-            bpy.ops.mesh.delete(type='FACE')
-        else:
-            bpy.ops.mesh.delete(type='VERT')
-            
-        return {'FINISHED'}
-bpy.utils.register_class(MeshDeleteContextual)
-
-###########
-# Keymaps
-###########
-
-def clear_keymap(kc):
-    """ Clears all the keymaps, so we can start from scratch, building
-        things back up again one-by-one.
-    """
-    # Map Window
-    km = kc.keymaps.new('Window', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Screen
-    km = kc.keymaps.new('Screen', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Editing this part of the keymap seems
-    # to cause problems, so leaving alone.
-    # Map Screen Editing
-    #km = kc.keymaps.new('Screen Editing', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map View2D
-    km = kc.keymaps.new('View2D', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Frames
-    km = kc.keymaps.new('Frames', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Header
-    km = kc.keymaps.new('Header', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map View2D Buttons List
-    km = kc.keymaps.new('View2D Buttons List', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Property Editor
-    km = kc.keymaps.new('Property Editor', space_type='PROPERTIES', region_type='WINDOW', modal=False)
-
-    # Map Markers
-    km = kc.keymaps.new('Markers', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Animation
-    km = kc.keymaps.new('Animation', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Timeline
-    km = kc.keymaps.new('Timeline', space_type='TIMELINE', region_type='WINDOW', modal=False)
-
-    # Map Outliner
-    km = kc.keymaps.new('Outliner', space_type='OUTLINER', region_type='WINDOW', modal=False)
-
-    # Map 3D View Generic
-    km = kc.keymaps.new('3D View Generic', space_type='VIEW_3D', region_type='WINDOW', modal=False)
-
-    # Map Grease Pencil
-    km = kc.keymaps.new('Grease Pencil', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Face Mask
-    km = kc.keymaps.new('Face Mask', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Pose
-    km = kc.keymaps.new('Pose', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Object Mode
-    km = kc.keymaps.new('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Image Paint
-    km = kc.keymaps.new('Image Paint', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Vertex Paint
-    km = kc.keymaps.new('Vertex Paint', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Weight Paint
-    km = kc.keymaps.new('Weight Paint', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Sculpt
-    km = kc.keymaps.new('Sculpt', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Mesh
-    km = kc.keymaps.new('Mesh', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Curve
-    km = kc.keymaps.new('Curve', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Armature
-    km = kc.keymaps.new('Armature', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Metaball
-    km = kc.keymaps.new('Metaball', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Lattice
-    km = kc.keymaps.new('Lattice', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Particle
-    km = kc.keymaps.new('Particle', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Font
-    km = kc.keymaps.new('Font', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Object Non-modal
-    km = kc.keymaps.new('Object Non-modal', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map 3D View
-    km = kc.keymaps.new('3D View', space_type='VIEW_3D', region_type='WINDOW', modal=False)
-
-    # Map View3D Gesture Circle
-    km = kc.keymaps.new('View3D Gesture Circle', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map Gesture Border
-    km = kc.keymaps.new('Gesture Border', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map Standard Modal Map
-    km = kc.keymaps.new('Standard Modal Map', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map Animation Channels
-    km = kc.keymaps.new('Animation Channels', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map UV Editor
-    km = kc.keymaps.new('UV Editor', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map Transform Modal Map
-    km = kc.keymaps.new('Transform Modal Map', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map UV Sculpt
-    km = kc.keymaps.new('UV Sculpt', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Map View3D Fly Modal
-    km = kc.keymaps.new('View3D Fly Modal', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map View3D Rotate Modal
-    km = kc.keymaps.new('View3D Rotate Modal', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map View3D Move Modal
-    km = kc.keymaps.new('View3D Move Modal', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map View3D Zoom Modal
-    km = kc.keymaps.new('View3D Zoom Modal', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Map Graph Editor Generic
-    km = kc.keymaps.new('Graph Editor Generic', space_type='GRAPH_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Graph Editor
-    km = kc.keymaps.new('Graph Editor', space_type='GRAPH_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Image Generic
-    km = kc.keymaps.new('Image Generic', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Image
-    km = kc.keymaps.new('Image', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Node Generic
-    km = kc.keymaps.new('Node Generic', space_type='NODE_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Node Editor
-    km = kc.keymaps.new('Node Editor', space_type='NODE_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map File Browser
-    km = kc.keymaps.new('File Browser', space_type='FILE_BROWSER', region_type='WINDOW', modal=False)
-
-    # Map File Browser Main
-    km = kc.keymaps.new('File Browser Main', space_type='FILE_BROWSER', region_type='WINDOW', modal=False)
-
-    # Map File Browser Buttons
-    km = kc.keymaps.new('File Browser Buttons', space_type='FILE_BROWSER', region_type='WINDOW', modal=False)
-
-    # Map Dopesheet
-    km = kc.keymaps.new('Dopesheet', space_type='DOPESHEET_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map NLA Generic
-    km = kc.keymaps.new('NLA Generic', space_type='NLA_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map NLA Channels
-    km = kc.keymaps.new('NLA Channels', space_type='NLA_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map NLA Editor
-    km = kc.keymaps.new('NLA Editor', space_type='NLA_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Text
-    km = kc.keymaps.new('Text', space_type='TEXT_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Sequencer
-    km = kc.keymaps.new('Sequencer', space_type='SEQUENCE_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Logic Editor
-    km = kc.keymaps.new('Logic Editor', space_type='LOGIC_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Console
-    km = kc.keymaps.new('Console', space_type='CONSOLE', region_type='WINDOW', modal=False)
-
-    # Map Clip
-    km = kc.keymaps.new('Clip', space_type='CLIP_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Clip Editor
-    km = kc.keymaps.new('Clip Editor', space_type='CLIP_EDITOR', region_type='WINDOW', modal=False)
-
-    # Map Clip Graph Editor
-    km = kc.keymaps.new('Clip Graph Editor', space_type='CLIP_EDITOR', region_type='WINDOW', modal=False)
-
-
-
-
-
-def MapAdd_Window(kc):
-    """ Window Map
-    """
-    km = kc.keymaps.new('Window', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Quit
-    kmi = km.keymap_items.new('wm.quit_blender', 'Q', 'PRESS', ctrl=True)
-
-    # Operator search menu
-    kmi = km.keymap_items.new('wm.search_menu', 'TAB', 'CLICK')
-
-    # Open
-    kmi = km.keymap_items.new('wm.open_mainfile', 'O', 'CLICK', ctrl=True)
-    kmi = km.keymap_items.new('wm.link_append', 'O', 'CLICK', ctrl=True, alt=True)
-    kmi = km.keymap_items.new('wm.link_append', 'O', 'CLICK', ctrl=True, shift=True)
-    kmi.properties.link = False
-    kmi = km.keymap_items.new('wm.read_homefile', 'N', 'CLICK', ctrl=True)
-
-    # Save
-    kmi = km.keymap_items.new('wm.save_mainfile', 'S', 'CLICK', ctrl=True)
-    kmi = km.keymap_items.new('wm.save_as_mainfile', 'S', 'CLICK', shift=True, ctrl=True)
-    kmi = km.keymap_items.new('wm.save_homefile', 'U', 'CLICK', ctrl=True)
-
-    # NDof Device
-    kmi = km.keymap_items.new('wm.call_menu', 'NDOF_BUTTON_MENU', 'PRESS')
-    kmi.properties.name = 'USERPREF_MT_ndof_settings'
-    kmi = km.keymap_items.new('wm.ndof_sensitivity_change', 'NDOF_BUTTON_PLUS', 'PRESS')
-    kmi.properties.decrease = False
-    kmi.properties.fast = False
-    kmi = km.keymap_items.new('wm.ndof_sensitivity_change', 'NDOF_BUTTON_MINUS', 'PRESS')
-    kmi.properties.decrease = True
-    kmi.properties.fast = False
-    kmi = km.keymap_items.new('wm.ndof_sensitivity_change', 'NDOF_BUTTON_PLUS', 'PRESS', shift=True)
-    kmi.properties.decrease = False
-    kmi.properties.fast = True
-    kmi = km.keymap_items.new('wm.ndof_sensitivity_change', 'NDOF_BUTTON_MINUS', 'PRESS', shift=True)
-    kmi.properties.decrease = True
-    kmi.properties.fast = True
-
-    # Misc
-    kmi = km.keymap_items.new('wm.window_fullscreen_toggle', 'F11', 'CLICK', alt=True)
-
-    # Development/debugging
-    if DEVELOPER_HOTKEYS:
-        kmi = km.keymap_items.new('wm.redraw_timer', 'T', 'CLICK', ctrl=True, alt=True)
-        kmi = km.keymap_items.new('wm.debug_menu', 'D', 'CLICK', ctrl=True, alt=True)
-
-    # ???
-    kmi = km.keymap_items.new('info.reports_display_update', 'TIMER', 'ANY', any=True)
-
-
-def MapAdd_Screen(kc):
-    """ Screen Map
-    """
-    km = kc.keymaps.new('Screen', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    kmi = km.keymap_items.new('screen.animation_step', 'TIMER0', 'ANY', any=True)
-    kmi = km.keymap_items.new('screen.screen_set', 'RIGHT_ARROW', 'PRESS', ctrl=True)
-    kmi.properties.delta = 1
-    kmi = km.keymap_items.new('screen.screen_set', 'LEFT_ARROW', 'PRESS', ctrl=True)
-    kmi.properties.delta = -1
-    kmi = km.keymap_items.new('screen.screen_full_area', 'UP_ARROW', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('screen.screen_full_area', 'DOWN_ARROW', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('screen.screen_full_area', 'SPACE', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('screen.screenshot', 'F3', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('screen.screencast', 'F3', 'PRESS', alt=True)
-    kmi = km.keymap_items.new('screen.region_quadview', 'Q', 'PRESS', ctrl=True, alt=True)
-    kmi = km.keymap_items.new('screen.repeat_history', 'F3', 'PRESS')
-    kmi = km.keymap_items.new('screen.repeat_last', 'R', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('screen.region_flip', 'F5', 'PRESS')
-    kmi = km.keymap_items.new('screen.redo_last', 'F6', 'PRESS')
-    kmi = km.keymap_items.new('script.reload', 'F8', 'PRESS')
-    kmi = km.keymap_items.new('file.execute', 'RET', 'PRESS')
-    kmi = km.keymap_items.new('file.execute', 'NUMPAD_ENTER', 'PRESS')
-    kmi = km.keymap_items.new('file.cancel', 'ESC', 'PRESS')
-    kmi = km.keymap_items.new('ed.undo', 'Z', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('ed.redo', 'Z', 'PRESS', shift=True, ctrl=True)
-    kmi = km.keymap_items.new('ed.undo_history', 'Z', 'PRESS', ctrl=True, alt=True)
-    kmi = km.keymap_items.new('render.render', 'F12', 'PRESS')
-    kmi = km.keymap_items.new('render.render', 'F12', 'PRESS', ctrl=True)
-    kmi.properties.animation = True
-    kmi = km.keymap_items.new('render.view_cancel', 'ESC', 'PRESS')
-    kmi = km.keymap_items.new('render.view_show', 'F11', 'PRESS')
-    kmi = km.keymap_items.new('render.play_rendered_anim', 'F11', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('screen.userpref_show', 'U', 'PRESS', ctrl=True, alt=True)
-
-    # Editing this seems to cause problems.
-    # TODO: file bug report
-    # Screen Editing
-    #km = kc.keymaps.new('Screen Editing', space_type='EMPTY', region_type='WINDOW', modal=False)
-    #
-    #kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS')
-    #kmi.properties.modifier = 0
-    #kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS', shift=True)
-    #kmi.properties.modifier = 1
-    #kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS', ctrl=True)
-    #kmi.properties.modifier = 2
-    #kmi = km.keymap_items.new('screen.area_split', 'NONE', 'ANY')
-    #kmi = km.keymap_items.new('screen.area_join', 'NONE', 'ANY')
-    #kmi = km.keymap_items.new('screen.area_dupli', 'NONE', 'ANY', shift=True)
-    #kmi = km.keymap_items.new('screen.area_swap', 'NONE', 'ANY', ctrl=True)
-    #kmi = km.keymap_items.new('screen.region_scale', 'NONE', 'ANY')
-    #kmi = km.keymap_items.new('screen.area_move', 'LEFTMOUSE', 'PRESS')
-    #kmi = km.keymap_items.new('screen.area_options', 'RIGHTMOUSE', 'PRESS')
-
-
-def MapAdd_View2D(kc):
-    """ View 2D Map
-    """
-    km = kc.keymaps.new('View2D', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroller_activate', 'MIDDLEMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('view2d.pan', 'TRACKPADPAN', 'ANY')
-    kmi = km.keymap_items.new('view2d.scroll_right', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('view2d.scroll_left', 'WHEELUPMOUSE', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('view2d.zoom_out', 'WHEELOUTMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.zoom_in', 'WHEELINMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.zoom_out', 'NUMPAD_MINUS', 'PRESS')
-    kmi = km.keymap_items.new('view2d.zoom_in', 'NUMPAD_PLUS', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroll_right', 'WHEELDOWNMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroll_left', 'WHEELUPMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('view2d.zoom', 'TRACKPADZOOM', 'ANY')
-    kmi = km.keymap_items.new('view2d.zoom_border', 'B', 'PRESS', shift=True)
-
-    # View2D Buttons List
-    km = kc.keymaps.new('View2D Buttons List', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroller_activate', 'MIDDLEMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.pan', 'TRACKPADPAN', 'ANY')
-    kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view2d.scroll_down', 'PAGE_DOWN', 'PRESS')
-    kmi.properties.page = True
-    kmi = km.keymap_items.new('view2d.scroll_up', 'PAGE_UP', 'PRESS')
-    kmi.properties.page = True
-    kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('view2d.zoom', 'TRACKPADZOOM', 'ANY')
-    kmi = km.keymap_items.new('view2d.zoom_out', 'NUMPAD_MINUS', 'PRESS')
-    kmi = km.keymap_items.new('view2d.zoom_in', 'NUMPAD_PLUS', 'PRESS')
-    kmi = km.keymap_items.new('view2d.reset', 'HOME', 'PRESS')
-
-
-def MapAdd_View3D_Global(kc):
-    """ View 3D Global Map
-    """
-    km = kc.keymaps.new('3D View', space_type='VIEW_3D', region_type='WINDOW', modal=False)
-
-    #-----------------
-    # View navigation
-    #-----------------
-
-    # ???
-    kmi = km.keymap_items.new('view3d.rotate', 'MOUSEROTATE', 'ANY')
-    kmi = km.keymap_items.new('view3d.smoothview', 'TIMER1', 'ANY', any=True)
-
-    
-
-    # Basics with mouse
-    kmi = km.keymap_items.new('view3d.rotate', 'MIDDLEMOUSE', 'PRESS')
-    kmi = km.keymap_items.new('view3d.move', 'MIDDLEMOUSE', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('view3d.zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True)
-    #kmi = km.keymap_items.new('view3d.dolly', 'MIDDLEMOUSE', 'PRESS', shift=True, ctrl=True)
-
-    # Basics with mouse wheel
-    kmi = km.keymap_items.new('view3d.zoom', 'WHEELINMOUSE', 'PRESS')
-    kmi.properties.delta = 1
-    kmi = km.keymap_items.new('view3d.zoom', 'WHEELOUTMOUSE', 'PRESS')
-    kmi.properties.delta = -1
-    kmi = km.keymap_items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', ctrl=True)
-    kmi.properties.type = 'PANRIGHT'
-    kmi = km.keymap_items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True)
-    kmi.properties.type = 'PANLEFT'
-    kmi = km.keymap_items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', shift=True)
-    kmi.properties.type = 'PANUP'
-    kmi = km.keymap_items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', shift=True)
-    kmi.properties.type = 'PANDOWN'
-    kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', ctrl=True, alt=True)
-    kmi.properties.type = 'ORBITLEFT'
-    kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True, alt=True)
-    kmi.properties.type = 'ORBITRIGHT'
-    kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', shift=True, alt=True)
-    kmi.properties.type = 'ORBITUP'
-    kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', shift=True, alt=True)
-    kmi.properties.type = 'ORBITDOWN'
-
-    # Basics with trackpad
-    kmi = km.keymap_items.new('view3d.rotate', 'TRACKPADPAN', 'ANY', alt=True)
-    kmi = km.keymap_items.new('view3d.move', 'TRACKPADPAN', 'ANY')
-    kmi = km.keymap_items.new('view3d.zoom', 'TRACKPADZOOM', 'ANY')
-    
-    # Perspective/ortho
-    kmi = km.keymap_items.new('view3d.view_persportho', 'NUMPAD_5', 'CLICK')
-
-    # Camera view
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_0', 'CLICK')
-    kmi.properties.type = 'CAMERA'
-    
-    # Basics with numpad
-    kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_8', 'CLICK')
-    kmi.properties.type = 'ORBITUP'
-    kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_2', 'CLICK')
-    kmi.properties.type = 'ORBITDOWN'
-    kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_4', 'CLICK')
-    kmi.properties.type = 'ORBITLEFT'
-    kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_6', 'CLICK')
-    kmi.properties.type = 'ORBITRIGHT'
-    kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_8', 'CLICK', ctrl=True)
-    kmi.properties.type = 'PANUP'
-    kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_2', 'CLICK', ctrl=True)
-    kmi.properties.type = 'PANDOWN'
-    kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_4', 'CLICK', ctrl=True)
-    kmi.properties.type = 'PANLEFT'
-    kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_6', 'CLICK', ctrl=True)
-    kmi.properties.type = 'PANRIGHT'
-    kmi = km.keymap_items.new('view3d.zoom', 'NUMPAD_PLUS', 'CLICK')
-    kmi.properties.delta = 1
-    kmi = km.keymap_items.new('view3d.zoom', 'NUMPAD_MINUS', 'CLICK')
-    kmi.properties.delta = -1
-
-    # Zoom in/out alternatives
-    kmi = km.keymap_items.new('view3d.zoom', 'EQUAL', 'CLICK', ctrl=True)
-    kmi.properties.delta = 1
-    kmi = km.keymap_items.new('view3d.zoom', 'MINUS', 'CLICK', ctrl=True)
-    kmi.properties.delta = -1
-
-    # Front/Right/Top/Back/Left/Bottom
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_1', 'CLICK')
-    kmi.properties.type = 'FRONT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_3', 'CLICK')
-    kmi.properties.type = 'RIGHT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_7', 'CLICK')
-    kmi.properties.type = 'TOP'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_1', 'CLICK', ctrl=True)
-    kmi.properties.type = 'BACK'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_3', 'CLICK', ctrl=True)
-    kmi.properties.type = 'LEFT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_7', 'CLICK', ctrl=True)
-    kmi.properties.type = 'BOTTOM'
-
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'MIDDLEMOUSE', 'CLICK', alt=True)
-    kmi.properties.type = 'FRONT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'EVT_TWEAK_M', 'EAST', alt=True)
-    kmi.properties.type = 'RIGHT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'EVT_TWEAK_M', 'NORTH', alt=True)
-    kmi.properties.type = 'TOP'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'MIDDLEMOUSE', 'DOUBLE_CLICK', alt=True)
-    kmi.properties.type = 'BACK'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'EVT_TWEAK_M', 'WEST', alt=True)
-    kmi.properties.type = 'LEFT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'EVT_TWEAK_M', 'SOUTH', alt=True)
-    kmi.properties.type = 'BOTTOM'
-
-    # Selection-aligned Front/Right/Top/Back/Left/Bottom
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_1', 'CLICK', shift=True)
-    kmi.properties.type = 'FRONT'
-    kmi.properties.align_active = True
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_3', 'CLICK', shift=True)
-    kmi.properties.type = 'RIGHT'
-    kmi.properties.align_active = True
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_7', 'CLICK', shift=True)
-    kmi.properties.type = 'TOP'
-    kmi.properties.align_active = True
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_1', 'CLICK', shift=True, ctrl=True)
-    kmi.properties.type = 'BACK'
-    kmi.properties.align_active = True
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_3', 'CLICK', shift=True, ctrl=True)
-    kmi.properties.type = 'LEFT'
-    kmi.properties.align_active = True
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_7', 'CLICK', shift=True, ctrl=True)
-    kmi.properties.type = 'BOTTOM'
-    kmi.properties.align_active = True
-
-    # NDOF Device
-    kmi = km.keymap_items.new('view3d.ndof_orbit', 'NDOF_BUTTON_MENU', 'ANY')
-    kmi = km.keymap_items.new('view3d.ndof_pan', 'NDOF_BUTTON_MENU', 'ANY', shift=True)
-    kmi = km.keymap_items.new('view3d.view_selected', 'NDOF_BUTTON_FIT', 'PRESS')
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_FRONT', 'PRESS')
-    kmi.properties.type = 'FRONT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_BACK', 'PRESS')
-    kmi.properties.type = 'BACK'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_LEFT', 'PRESS')
-    kmi.properties.type = 'LEFT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_RIGHT', 'PRESS')
-    kmi.properties.type = 'RIGHT'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_TOP', 'PRESS')
-    kmi.properties.type = 'TOP'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_BOTTOM', 'PRESS')
-    kmi.properties.type = 'BOTTOM'
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_FRONT', 'PRESS', shift=True)
-    kmi.properties.type = 'FRONT'
-    kmi.properties.align_active = True
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_RIGHT', 'PRESS', shift=True)
-    kmi.properties.type = 'RIGHT'
-    kmi.properties.align_active = True
-    kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_TOP', 'PRESS', shift=True)
-    kmi.properties.type = 'TOP'
-    kmi.properties.align_active = True
-
-    # Fly mode
-    #kmi = km.keymap_items.new('view3d.fly', 'F', 'CLICK', shift=True)
-
-    # Misc
-    kmi = km.keymap_items.new('view3d.view_selected', 'NUMPAD_PERIOD', 'CLICK')
-    kmi = km.keymap_items.new('view3d.view_center_cursor', 'NUMPAD_PERIOD', 'CLICK', ctrl=True)
-    kmi = km.keymap_items.new('view3d.zoom_camera_1_to_1', 'NUMPAD_ENTER', 'CLICK', shift=True)
-    kmi = km.keymap_items.new('view3d.view_center_camera', 'HOME', 'CLICK')
-    kmi = km.keymap_items.new('view3d.view_all', 'HOME', 'CLICK')
-    kmi.properties.center = False
-    kmi = km.keymap_items.new('view3d.view_all', 'C', 'CLICK', shift=True)
-    kmi.properties.center = True
-
-    #-------------
-    # Manipulator
-    #-------------
-    
-    kmi = km.keymap_items.new('view3d.manipulator', 'EVT_TWEAK_L', 'ANY', any=True)
-    kmi.properties.release_confirm = True
-
-    if MAYA_STYLE_MANIPULATORS:
-        kmi = km.keymap_items.new('view3d.manipulator_set', 'Q', 'CLICK')
-        kmi.properties.mode = 'NONE'
-        kmi = km.keymap_items.new('view3d.manipulator_set', TRANSLATE_KEY, 'CLICK')
-        kmi.properties.mode = 'TRANSLATE'
-        kmi = km.keymap_items.new('view3d.manipulator_set', ROTATE_KEY, 'CLICK')
-        kmi.properties.mode = 'ROTATE'
-        kmi = km.keymap_items.new('view3d.manipulator_set', SCALE_KEY, 'CLICK')
-        kmi.properties.mode = 'SCALE'
-    else:
-        kmi = km.keymap_items.new('wm.context_toggle', 'SPACE', 'CLICK', ctrl=True)
-        kmi.properties.data_path = 'space_data.show_manipulator'
-
-    #-----------
-    # Selection
-    #-----------
-    
-    # Click select
-    kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'CLICK') # Replace
-    kmi.properties.extend = False
-    kmi.properties.deselect = False
-    kmi.properties.toggle = False
-    kmi.properties.center = False
-    kmi.properties.enumerate = False
-    kmi.properties.object = False
-    kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'CLICK', shift=True) # Extend
-    kmi.properties.extend = True
-    kmi.properties.deselect = False
-    kmi.properties.toggle = False
-    kmi.properties.center = False
-    kmi.properties.enumerate = False
-    kmi.properties.object = False
-    kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'CLICK', ctrl=True) # Deselect
-    kmi.properties.extend = False
-    kmi.properties.deselect = True
-    kmi.properties.toggle = False
-    kmi.properties.center = False
-    kmi.properties.enumerate = False
-    kmi.properties.object = False
-    
-    # Enumerate select
-    kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'CLICK', alt=True) # Replace
-    kmi.properties.extend = False
-    kmi.properties.center = False
-    kmi.properties.enumerate = True
-    kmi.properties.object = False
-    kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'CLICK', shift=True, alt=True) # Extend
-    kmi.properties.extend = True
-    kmi.properties.center = False
-    kmi.properties.enumerate = True
-    kmi.properties.object = False
-    kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'CLICK', ctrl=True, alt=True) # Center (TODO: deselect)
-    kmi.properties.extend = False
-    kmi.properties.center = True
-    kmi.properties.enumerate = True
-    kmi.properties.object = False
-
-    # Border select
-    kmi = km.keymap_items.new('view3d.select_border', 'EVT_TWEAK_L', 'ANY') # Replace
-    kmi.properties.extend = False
-    kmi = km.keymap_items.new('view3d.select_border', 'EVT_TWEAK_L', 'ANY', shift=True) # Extend
-    kmi.properties.extend = True
-    kmi = km.keymap_items.new('view3d.select_border', 'EVT_TWEAK_L', 'ANY', ctrl=True) # Deselect (handled in modal)
-    kmi.properties.extend = False
-
-    # Lasso select
-    kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_L', 'ANY', alt=True) # Replace
-    kmi.properties.extend = False
-    kmi.properties.deselect = False
-    kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_L', 'ANY', alt=True, shift=True) # Extend
-    kmi.properties.extend = True
-    kmi.properties.deselect = False
-    kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_L', 'ANY', alt=True, ctrl=True) # Deselect
-    kmi.properties.extend = False
-    kmi.properties.deselect = True
-
-    # Paint select
-    #kmi = km.keymap_items.new('view3d.select_circle', 'C', 'CLICK')
-
-    #-----------------------
-    # Transforms via hotkey
-    #-----------------------
-    
-    # Grab, rotate scale
-    kmi = km.keymap_items.new('transform.translate', TRANSLATE_KEY, 'PRESS')
-    #kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY')
-    kmi = km.keymap_items.new('transform.rotate', ROTATE_KEY, 'PRESS')
-    kmi = km.keymap_items.new('transform.resize', SCALE_KEY, 'PRESS')
-
-    # Mirror, shear, warp, to-sphere
-    #kmi = km.keymap_items.new('transform.mirror', 'M', 'CLICK', ctrl=True)
-    #kmi = km.keymap_items.new('transform.shear', 'S', 'CLICK', shift=True, ctrl=True, alt=True)
-    #kmi = km.keymap_items.new('transform.warp', 'W', 'CLICK', shift=True)
-    #kmi = km.keymap_items.new('transform.tosphere', 'S', 'CLICK', shift=True, alt=True)
-
-    #-------------------------
-    # Transform texture space
-    #-------------------------
-    kmi = km.keymap_items.new('transform.translate', 'T', 'CLICK', shift=True)
-    kmi.properties.texture_space = True
-    kmi = km.keymap_items.new('transform.resize', 'T', 'CLICK', shift=True, alt=True)
-    kmi.properties.texture_space = True
-
-    #------------------
-    # Transform spaces
-    #------------------
-    kmi = km.keymap_items.new('transform.select_orientation', 'SPACE', 'CLICK', alt=True)
-    kmi = km.keymap_items.new('transform.create_orientation', 'SPACE', 'CLICK', ctrl=True, alt=True)
-    kmi.properties.use = True
-
-    #----------
-    # Snapping
-    #----------
-    kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'CLICK', shift=True)
-    kmi.properties.data_path = 'tool_settings.use_snap'
-    kmi = km.keymap_items.new('transform.snap_type', 'TAB', 'CLICK', shift=True, ctrl=True)
-
-    #---------------
-    # Snapping Menu
-    #---------------
-    kmi = km.keymap_items.new('wm.call_menu', 'S', 'CLICK', shift=True)
-    kmi.properties.name = 'VIEW3D_MT_snap'
-
-    #-----------
-    # 3d cursor
-    #-----------
-    kmi = km.keymap_items.new('view3d.cursor3d', 'ACTIONMOUSE', 'CLICK')
-
-    #-------------------
-    # Toggle local view
-    #-------------------
-    kmi = km.keymap_items.new('view3d.localview', 'NUMPAD_SLASH', 'CLICK')
-
-    #--------
-    # Layers
-    #--------
-    """
-    kmi = km.keymap_items.new('view3d.layers', 'ACCENT_GRAVE', 'CLICK')
-    kmi.properties.nr = 0
-    kmi = km.keymap_items.new('view3d.layers', 'ONE', 'CLICK', any=True)
-    kmi.properties.nr = 1
-    kmi = km.keymap_items.new('view3d.layers', 'TWO', 'CLICK', any=True)
-    kmi.properties.nr = 2
-    kmi = km.keymap_items.new('view3d.layers', 'THREE', 'CLICK', any=True)
-    kmi.properties.nr = 3
-    kmi = km.keymap_items.new('view3d.layers', 'FOUR', 'CLICK', any=True)
-    kmi.properties.nr = 4
-    kmi = km.keymap_items.new('view3d.layers', 'FIVE', 'CLICK', any=True)
-    kmi.properties.nr = 5
-    kmi = km.keymap_items.new('view3d.layers', 'SIX', 'CLICK', any=True)
-    kmi.properties.nr = 6
-    kmi = km.keymap_items.new('view3d.layers', 'SEVEN', 'CLICK', any=True)
-    kmi.properties.nr = 7
-    kmi = km.keymap_items.new('view3d.layers', 'EIGHT', 'CLICK', any=True)
-    kmi.properties.nr = 8
-    kmi = km.keymap_items.new('view3d.layers', 'NINE', 'CLICK', any=True)
-    kmi.properties.nr = 9
-    kmi = km.keymap_items.new('view3d.layers', 'ZERO', 'CLICK', any=True)
-    kmi.properties.nr = 10
-    """
-
-    #------------------
-    # Viewport drawing
-    #------------------
-    kmi = km.keymap_items.new('wm.context_toggle_enum', 'Z', 'PRESS')
-    kmi.properties.data_path = 'space_data.viewport_shade'
-    kmi.properties.value_1 = 'SOLID'
-    kmi.properties.value_2 = 'WIREFRAME'
-    
-    kmi = km.keymap_items.new('wm.context_menu_enum', 'Z', 'PRESS', alt=True)
-    kmi.properties.data_path = 'space_data.viewport_shade'
-    
-    #-------------
-    # Pivot point
-    #-------------
-    kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'CLICK')
-    kmi.properties.data_path = 'space_data.pivot_point'
-    kmi.properties.value = 'BOUNDING_BOX_CENTER'
-    kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'CLICK', ctrl=True)
-    kmi.properties.data_path = 'space_data.pivot_point'
-    kmi.properties.value = 'MEDIAN_POINT'
-    kmi = km.keymap_items.new('wm.context_toggle', 'COMMA', 'CLICK', alt=True)
-    kmi.properties.data_path = 'space_data.use_pivot_point_align'
-    kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'CLICK')
-    kmi.properties.data_path = 'space_data.pivot_point'
-    kmi.properties.value = 'CURSOR'
-    kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'CLICK', ctrl=True)
-    kmi.properties.data_path = 'space_data.pivot_point'
-    kmi.properties.value = 'INDIVIDUAL_ORIGINS'
-    kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'CLICK', alt=True)
-    kmi.properties.data_path = 'space_data.pivot_point'
-    kmi.properties.value = 'ACTIVE_ELEMENT'
-
-    #------
-    # Misc
-    #------
-    kmi = km.keymap_items.new('view3d.clip_border', 'B', 'CLICK', alt=True)
-    kmi = km.keymap_items.new('view3d.zoom_border', 'B', 'CLICK', shift=True)
-    kmi = km.keymap_items.new('view3d.render_border', 'B', 'CLICK', shift=True)
-    kmi = km.keymap_items.new('view3d.camera_to_view', 'NUMPAD_0', 'CLICK', ctrl=True, alt=True)
-    kmi = km.keymap_items.new('view3d.object_as_camera', 'NUMPAD_0', 'CLICK', ctrl=True)
-    
-
-def MapAdd_View3D_Object_Nonmodal(kc):
-    """ Object Non-modal Map
-        This essentially applies globally within the 3d view.  But technically
-        only when objects are involved (but when are they not...?).
-    """
-    km = kc.keymaps.new('Object Non-modal', space_type='EMPTY', region_type='WINDOW', modal=False)
-    
-    # Mode switching
-    kmi = km.keymap_items.new('wm.call_menu', 'SPACE', 'PRESS')
-    kmi.properties.name = 'OBJECT_MT_mode_switch_menu'
-
-
-def MapAdd_View3D_ObjectMode(kc):
-    """ Object Mode Map
-    """
-    km = kc.keymaps.new('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    # Delete
-    kmi = km.keymap_items.new('object.delete_no_confirm', 'X', 'CLICK')
-    kmi = km.keymap_items.new('object.delete_no_confirm', 'DEL', 'CLICK')
-
-    # Proportional editing
-    kmi = km.keymap_items.new('wm.context_toggle', 'O', 'PRESS')
-    kmi.properties.data_path = 'tool_settings.use_proportional_edit_objects'
-    kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True)
-    kmi.properties.data_path = 'tool_settings.proportional_edit_falloff'
-    
-    # Game engine start
-    kmi = km.keymap_items.new('view3d.game_start', 'P', 'PRESS')
-    
-    # Selection
-    kmi = km.keymap_items.new('object.select_all', 'A', 'PRESS')
-    kmi.properties.action = 'TOGGLE'
-    kmi = km.keymap_items.new('object.select_all', 'I', 'PRESS', ctrl=True)
-    kmi.properties.action = 'INVERT'
-    kmi = km.keymap_items.new('object.select_linked', 'L', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('object.select_grouped', 'G', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True)
-    kmi = km.keymap_items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS')
-    kmi.properties.direction = 'PARENT'
-    kmi.properties.extend = False
-    kmi = km.keymap_items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True)
-    kmi.properties.direction = 'PARENT'
-    kmi.properties.extend = True
-    kmi = km.keymap_items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS')
-    kmi.properties.direction = 'CHILD'
-    kmi.properties.extend = False
-    kmi = km.keymap_items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True)
-    kmi.properties.direction = 'CHILD'
-    kmi.properties.extend = True
-    
-    # Parenting
-    kmi = km.keymap_items.new('object.parent_set', 'P', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('object.parent_no_inverse_set', 'P', 'PRESS', shift=True, ctrl=True)
-    kmi = km.keymap_items.new('object.parent_clear', 'P', 'PRESS', alt=True)
-
-    # Constraints
-    kmi = km.keymap_items.new('object.constraint_add_with_targets', 'C', 'PRESS', shift=True, ctrl=True)
-    kmi = km.keymap_items.new('object.constraints_clear', 'C', 'PRESS', ctrl=True, alt=True)
-    
-    # Transforms
-    kmi = km.keymap_items.new('object.location_clear', TRANSLATE_KEY, 'PRESS', alt=True)
-    kmi = km.keymap_items.new('object.rotation_clear', ROTATE_KEY, 'PRESS', alt=True)
-    kmi = km.keymap_items.new('object.scale_clear', SCALE_KEY, 'PRESS', alt=True)
-    kmi = km.keymap_items.new('object.origin_clear', 'O', 'PRESS', alt=True)
-    
-    # Hiding
-    kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS') # Hide selected
-    kmi.properties.unselected = False
-    kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', shift=True) # Hide unselected
-    kmi.properties.unselected = True
-    kmi = km.keymap_items.new('object.hide_view_clear', 'H', 'PRESS', alt=True) # Unhide
-    
-    #kmi = km.keymap_items.new('object.hide_render_set', 'H', 'PRESS', ctrl=True)
-    #kmi = km.keymap_items.new('object.hide_render_clear', 'H', 'PRESS', ctrl=True, alt=True)
-    
-    
-    # Layer management
-    kmi = km.keymap_items.new('object.move_to_layer', 'M', 'PRESS')
-
-    # Add menus
-    kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-    kmi.properties.name = 'INFO_MT_add'
-    kmi = km.keymap_items.new('wm.call_menu', 'L', 'PRESS', ctrl=True)
-    kmi.properties.name = 'VIEW3D_MT_make_links'
-    
-    # Duplication
-    kmi = km.keymap_items.new('object.duplicate_move', 'D', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('object.duplicate_move_linked', 'D', 'PRESS', alt=True)
-    kmi = km.keymap_items.new('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True)
-    kmi = km.keymap_items.new('wm.call_menu', 'U', 'PRESS')
-    kmi.properties.name = 'VIEW3D_MT_make_single_user'
-    
-    # Apply menu
-    kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', ctrl=True)
-    kmi.properties.name = 'VIEW3D_MT_object_apply'
-    
-    # Groups
-    kmi = km.keymap_items.new('group.create', 'G', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('group.objects_remove', 'G', 'PRESS', ctrl=True, alt=True)
-    kmi = km.keymap_items.new('group.objects_add_active', 'G', 'PRESS', shift=True, ctrl=True)
-    kmi = km.keymap_items.new('group.objects_remove_active', 'G', 'PRESS', shift=True, alt=True)
-
-    # Make proxy
-    kmi = km.keymap_items.new('object.proxy_make', 'P', 'PRESS', ctrl=True, alt=True)
-    
-    # Keyframe insertion
-    kmi = km.keymap_items.new('anim.keyframe_insert_menu', 'I', 'PRESS')
-    kmi = km.keymap_items.new('anim.keyframe_delete_v3d', 'I', 'PRESS', alt=True)
-    kmi = km.keymap_items.new('anim.keying_set_active_set', 'I', 'PRESS', shift=True, ctrl=True, alt=True)
-    
-    # Misc
-    kmi = km.keymap_items.new('object.join', 'J', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('object.convert', 'C', 'PRESS', alt=True)
-    kmi = km.keymap_items.new('object.make_local', 'L', 'PRESS')
-    kmi = km.keymap_items.new('wm.call_menu', SPECIALS_MENU_KEY, 'PRESS')
-    kmi.properties.name = 'VIEW3D_MT_object_specials'
-    
-    # Subdivision surface shortcuts
-    #kmi = km.keymap_items.new('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True)
-    #kmi.properties.level = 0
-    #kmi = km.keymap_items.new('object.subdivision_set', 'ONE', 'PRESS', ctrl=True)
-    #kmi.properties.level = 1
-    #kmi = km.keymap_items.new('object.subdivision_set', 'TWO', 'PRESS', ctrl=True)
-    #kmi.properties.level = 2
-    #kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True)
-    #kmi.properties.level = 3
-    #kmi = km.keymap_items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True)
-    #kmi.properties.level = 4
-    #kmi = km.keymap_items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True)
-    #kmi.properties.level = 5
-
-
-def MapAdd_View3D_MeshEditMode(kc):
-    """ Mesh Edit Mode Map
-    """
-    km = kc.keymaps.new('Mesh', space_type='EMPTY', region_type='WINDOW', modal=False)
-
-    #---------------------------------
-    # Vertex/Edge/Face mode switching
-    #---------------------------------
-    kmi = km.keymap_items.new('view3d.set_edit_mesh_select_mode', 'ONE', 'PRESS')
-    kmi.properties.mode = 'VERT'
-    kmi.properties.toggle = False
-    kmi = km.keymap_items.new('view3d.set_edit_mesh_select_mode', 'TWO', 'PRESS')
-    kmi.properties.mode = 'EDGE'
-    kmi.properties.toggle = False
-    kmi = km.keymap_items.new('view3d.set_edit_mesh_select_mode', 'THREE', 'PRESS')
-    kmi.properties.mode = 'FACE'
-    kmi.properties.toggle = False
-
-    kmi = km.keymap_items.new('view3d.set_edit_mesh_select_mode', 'ONE', 'PRESS', shift=True)
-    kmi.properties.mode = 'VERT'
-    kmi.properties.toggle = True
-    kmi = km.keymap_items.new('view3d.set_edit_mesh_select_mode', 'TWO', 'PRESS', shift=True)
-    kmi.properties.mode = 'EDGE'
-    kmi.properties.toggle = True
-    kmi = km.keymap_items.new('view3d.set_edit_mesh_select_mode', 'THREE', 'PRESS', shift=True)
-    kmi.properties.mode = 'FACE'
-    kmi.properties.toggle = True
-
-    #-----------
-    # Selection
-    #-----------
-    
-    # Shortest path
-    kmi = km.keymap_items.new('mesh.select_shortest_path', 'LEFTMOUSE', 'CLICK', alt=True) # Replace
-    # TODO: add, remove
-    
-    # Edge loop
-    kmi = km.keymap_items.new('mesh.loop_select', 'LEFTMOUSE', 'DOUBLE_CLICK') # Replace
-    kmi.properties.extend = False
-    kmi.properties.deselect = False
-    kmi = km.keymap_items.new('mesh.loop_select', 'LEFTMOUSE', 'DOUBLE_CLICK', shift=True) # Add
-    kmi.properties.extend = True
-    kmi.properties.deselect = False
-    kmi = km.keymap_items.new('mesh.loop_select', 'LEFTMOUSE', 'DOUBLE_CLICK', ctrl=True) # Remove
-    kmi.properties.extend = False
-    kmi.properties.deselect = True
-    
-    # Edge ring
-    kmi = km.keymap_items.new('mesh.edgering_select', 'LEFTMOUSE', 'DOUBLE_CLICK', alt=True) # Replace
-    kmi.properties.extend = False
-    kmi.properties.deselect = False
-    kmi = km.keymap_items.new('mesh.edgering_select', 'LEFTMOUSE', 'DOUBLE_CLICK', alt=True, shift=True) # Add
-    kmi.properties.extend = True
-    kmi.properties.deselect = False
-    kmi = km.keymap_items.new('mesh.edgering_select', 'LEFTMOUSE', 'DOUBLE_CLICK', alt=True, ctrl=True) # Remove
-    kmi.properties.extend = False
-    kmi.properties.deselect = True
-    
-    kmi = km.keymap_items.new('mesh.select_all', 'A', 'PRESS')
-    kmi.properties.action = 'TOGGLE'
-    kmi = km.keymap_items.new('mesh.select_all', 'I', 'CLICK', ctrl=True)
-    kmi.properties.action = 'INVERT'
-    kmi = km.keymap_items.new('mesh.select_more', 'NUMPAD_PLUS', 'CLICK', ctrl=True)
-    kmi = km.keymap_items.new('mesh.select_less', 'NUMPAD_MINUS', 'CLICK', ctrl=True)
-    kmi = km.keymap_items.new('mesh.select_non_manifold', 'M', 'CLICK', shift=True, ctrl=True, alt=True)
-    kmi = km.keymap_items.new('mesh.select_linked', 'L', 'CLICK', ctrl=True)
-    kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'CLICK')
-    kmi.properties.deselect = False
-    kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'CLICK', shift=True)
-    kmi.properties.deselect = True
-    kmi = km.keymap_items.new('mesh.faces_select_linked_flat', 'F', 'CLICK', shift=True, ctrl=True, alt=True)
-    kmi = km.keymap_items.new('mesh.select_similar', 'G', 'CLICK', shift=True)
-
-    # Proportional editing
-    kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'CLICK')
-    kmi.properties.data_path = 'tool_settings.proportional_edit'
-    kmi.properties.value_1 = 'DISABLED'
-    kmi.properties.value_2 = 'ENABLED'
-    kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'CLICK', shift=True)
-    kmi.properties.data_path = 'tool_settings.proportional_edit_falloff'
-    kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'CLICK', alt=True)
-    kmi.properties.data_path = 'tool_settings.proportional_edit'
-    kmi.properties.value_1 = 'DISABLED'
-    kmi.properties.value_2 = 'CONNECTED'
-
-    # Hiding
-    kmi = km.keymap_items.new('mesh.hide', 'H', 'CLICK')
-    kmi.properties.unselected = False
-    kmi = km.keymap_items.new('mesh.hide', 'H', 'CLICK', shift=True)
-    kmi.properties.unselected = True
-    kmi = km.keymap_items.new('mesh.reveal', 'H', 'CLICK', alt=True)
-
-    #-----------------
-    # Create Geometry
-    #-----------------
-    
-    # Add Primitive
-    kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-    kmi.properties.name = 'INFO_MT_mesh_add'
-    
-    # Add edge and face / vertex connect
-    kmi = km.keymap_items.new('mesh.edge_face_add', 'C', 'CLICK')
-    kmi = kmi = km.keymap_items.new('mesh.vert_connect', 'C', 'CLICK', shift=True)
-    
-    kmi = km.keymap_items.new('mesh.fill', 'C', 'CLICK', alt=True)
-    kmi = km.keymap_items.new('mesh.beautify_fill', 'C', 'CLICK', alt=True, shift=True)
-    
-    # Subdivide
-    kmi = km.keymap_items.new('mesh.subdivide', 'W', 'CLICK')
-    
-    # Loop cut
-    kmi = km.keymap_items.new('mesh.loopcut_slide', 'T', 'CLICK')
-    
-    # Knife
-    kmi = km.keymap_items.new('mesh.knife_tool', 'K', 'CLICK')
-    
-    # Extrude
-    kmi = km.keymap_items.new('view3d.edit_mesh_extrude_move_normal', 'E', 'CLICK')
-    kmi = km.keymap_items.new('wm.call_menu', 'E', 'CLICK', alt=True)
-    kmi.properties.name = 'VIEW3D_MT_edit_mesh_extrude'
-    
-    kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', ctrl=True)
-    kmi.properties.rotate_source = True
-    kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', shift=True, ctrl=True)
-    kmi.properties.rotate_source = False
-    
-    # Inset/Outset
-    kmi = km.keymap_items.new('mesh.inset', 'I', 'CLICK')
-    kmi.properties.use_outset = False
-    kmi = km.keymap_items.new('mesh.inset', 'I', 'CLICK', shift=True)
-    kmi.properties.use_outset = True
-    
-    # Bevel
-    kmi = km.keymap_items.new('mesh.bevel', 'B', 'CLICK')
-
-    # Duplicate
-    kmi = km.keymap_items.new('mesh.duplicate_move', 'D', 'CLICK', shift=True)
-    
-    # Rip
-    kmi = km.keymap_items.new('mesh.rip_move', 'R', 'CLICK')
-    
-    # Split / Separate
-    kmi = km.keymap_items.new('mesh.split', 'Y', 'CLICK')
-    kmi = km.keymap_items.new('mesh.separate', 'Y', 'CLICK', shift=True)
-    
-
-    #-----------------
-    # Remove Geometry
-    #-----------------
-
-    # Delete/Dissolve
-    kmi = km.keymap_items.new('mesh.delete_contextual', 'X', 'CLICK')
-    kmi = km.keymap_items.new('mesh.delete_contextual', 'DEL', 'CLICK')
-    
-    kmi = km.keymap_items.new('mesh.dissolve', 'X', 'CLICK', shift=True)
-    kmi.properties.use_verts = True
-    kmi = km.keymap_items.new('mesh.dissolve', 'DEL', 'CLICK', shift=True)
-    kmi.properties.use_verts = True
-    
-    kmi = km.keymap_items.new('wm.call_menu', 'X', 'CLICK', alt=True)
-    kmi.properties.name = 'VIEW3D_MT_edit_mesh_delete'
-    kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'CLICK', alt=True)
-    kmi.properties.name = 'VIEW3D_MT_edit_mesh_delete'
-
-    # Merge/collapse
-    kmi = km.keymap_items.new('mesh.edge_collapse', 'M', 'CLICK')
-    kmi = km.keymap_items.new('mesh.merge', 'M', 'CLICK', alt=True)
-    
-    #-----------------
-    # Deform Geometry
-    #-----------------
-    
-    # Smooth
-    kmi = km.keymap_items.new('mesh.vertices_smooth', 'W', 'PRESS', shift=True)
-    
-    # Shrink / Fatten
-    kmi = km.keymap_items.new('transform.shrink_fatten', 'S', 'CLICK', alt=True)
-    
-    #------
-    # Misc
-    #------
-    
-    # Vert/edge properties
-    #kmi = km.keymap_items.new('transform.edge_crease', 'E', 'CLICK', shift=True)
-    
-    # Tri/quad conversion
-    #kmi = km.keymap_items.new('mesh.quads_convert_to_tris', 'T', 'CLICK', ctrl=True)
-    #kmi = km.keymap_items.new('mesh.quads_convert_to_tris', 'T', 'CLICK', shift=True, ctrl=True)
-    #kmi.properties.use_beauty = False
-    #kmi = km.keymap_items.new('mesh.tris_convert_to_quads', 'J', 'CLICK', alt=True)
-
-    # Tool Menus
-    kmi = km.keymap_items.new('wm.call_menu', SPECIALS_MENU_KEY, 'CLICK')
-    kmi.properties.name = 'VIEW3D_MT_edit_mesh_specials'
-    kmi = km.keymap_items.new('wm.call_menu', 'ONE', 'CLICK', alt=True)
-    kmi.properties.name = 'VIEW3D_MT_edit_mesh_vertices'
-    kmi = km.keymap_items.new('wm.call_menu', 'TWO', 'CLICK', alt=True)
-    kmi.properties.name = 'VIEW3D_MT_edit_mesh_edges'
-    kmi = km.keymap_items.new('wm.call_menu', 'THREE', 'CLICK', alt=True)
-    kmi.properties.name = 'VIEW3D_MT_edit_mesh_faces'
-
-    # UV's
-    kmi = km.keymap_items.new('wm.call_menu', 'U', 'CLICK')
-    kmi.properties.name = 'VIEW3D_MT_uv_map'
-
-    # Calculate normals
-    kmi = km.keymap_items.new('mesh.normals_make_consistent', 'N', 'CLICK', ctrl=True)
-    kmi.properties.inside = False
-    kmi = km.keymap_items.new('mesh.normals_make_consistent', 'N', 'CLICK', shift=True, ctrl=True)
-    kmi.properties.inside = True
-
-    # Subsurf shortcuts
-    if SUBSURF_RELATIVE:
-        kmi = km.keymap_items.new('object.shift_subsurf_level', 'EQUAL', 'PRESS')
-        kmi.properties.delta = 1
-        kmi.properties.max = 4
-        kmi = km.keymap_items.new('object.shift_subsurf_level', 'MINUS', 'PRESS')
-        kmi.properties.delta = -1
-        kmi.properties.min = 0
-    else:
-        kmi = km.keymap_items.new('object.subdivision_set', 'ZERO', 'CLICK', ctrl=True)
-        kmi.properties.level = 0
-        kmi = km.keymap_items.new('object.subdivision_set', 'ONE', 'CLICK', ctrl=True)
-        kmi.properties.level = 1
-        kmi = km.keymap_items.new('object.subdivision_set', 'TWO', 'CLICK', ctrl=True)
-        kmi.properties.level = 2
-        kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'CLICK', ctrl=True)
-        kmi.properties.level = 3
-        kmi = km.keymap_items.new('object.subdivision_set', 'FOUR', 'CLICK', ctrl=True)
-        kmi.properties.level = 4
-        kmi = km.keymap_items.new('object.subdivision_set', 'FIVE', 'CLICK', ctrl=True)
-        kmi.properties.level = 5
-
-    # Rigging
-    kmi = km.keymap_items.new('object.vertex_parent_set', 'P', 'CLICK', ctrl=True)
-    kmi = km.keymap_items.new('wm.call_menu', 'H', 'CLICK', ctrl=True)
-    kmi.properties.name = 'VIEW3D_MT_hook'
-    kmi = km.keymap_items.new('wm.call_menu', 'G', 'CLICK', ctrl=True)
-    kmi.properties.name = 'VIEW3D_MT_vertex_group'
-
-
-def MapAdd_ModalStandard(kc):
-    """ Standard Modal Map
-        Super basic modal stuff that applies globally in Blender.
-    """
-    km = kc.keymaps.new('Standard Modal Map', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    kmi = km.keymap_items.new_modal('CANCEL', 'ESC', 'PRESS', any=True)
-    kmi = km.keymap_items.new_modal('APPLY', 'LEFTMOUSE', 'ANY', any=True)
-    kmi = km.keymap_items.new_modal('APPLY', 'RET', 'PRESS', any=True)
-    kmi = km.keymap_items.new_modal('APPLY', 'NUMPAD_ENTER', 'PRESS', any=True)
-    kmi = km.keymap_items.new_modal('STEP10', 'LEFT_CTRL', 'PRESS', any=True)
-    kmi = km.keymap_items.new_modal('STEP10_OFF', 'LEFT_CTRL', 'RELEASE', any=True)
-
-
-def MapAdd_ModalTransform(kc):
-    """ Transform Modal Map
-        Keys for when the user is in a transform mode, such as grab/rotate/scale.
-    """
-    km = kc.keymaps.new('Transform Modal Map', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    # Cancel
-    kmi = km.keymap_items.new_modal('CANCEL', 'ESC', 'PRESS', any=True)
-
-    # Confirm
-    kmi = km.keymap_items.new_modal('CONFIRM', 'LEFTMOUSE', 'PRESS', any=True)
-    kmi = km.keymap_items.new_modal('CONFIRM', 'RET', 'CLICK', any=True)
-    kmi = km.keymap_items.new_modal('CONFIRM', 'NUMPAD_ENTER', 'CLICK', any=True)
-
-    # Snapping
-    kmi = km.keymap_items.new_modal('SNAP_TOGGLE', 'TAB', 'PRESS', shift=True)
-    kmi = km.keymap_items.new_modal('SNAP_INV_ON', 'LEFT_CTRL', 'PRESS', any=True)
-    kmi = km.keymap_items.new_modal('SNAP_INV_OFF', 'LEFT_CTRL', 'RELEASE', any=True)
-    kmi = km.keymap_items.new_modal('SNAP_INV_ON', 'RIGHT_CTRL', 'PRESS', any=True)
-    kmi = km.keymap_items.new_modal('SNAP_INV_OFF', 'RIGHT_CTRL', 'RELEASE', any=True)
-    kmi = km.keymap_items.new_modal('ADD_SNAP', 'A', 'CLICK')
-    kmi = km.keymap_items.new_modal('REMOVE_SNAP', 'A', 'CLICK', alt=True)
-
-    # Proportional edit adjusting
-    kmi = km.keymap_items.new_modal('PROPORTIONAL_SIZE_UP', 'PAGE_UP', 'PRESS')
-    kmi = km.keymap_items.new_modal('PROPORTIONAL_SIZE_DOWN', 'PAGE_DOWN', 'PRESS')
-    kmi = km.keymap_items.new_modal('PROPORTIONAL_SIZE_UP', 'WHEELDOWNMOUSE', 'PRESS')
-    kmi = km.keymap_items.new_modal('PROPORTIONAL_SIZE_DOWN', 'WHEELUPMOUSE', 'PRESS')
-
-    # Auto-ik adjusting
-    kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_UP', 'PAGE_UP', 'PRESS', shift=True)
-    kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_DOWN', 'PAGE_DOWN', 'PRESS', shift=True)
-    kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_UP', 'WHEELDOWNMOUSE', 'PRESS', shift=True)
-    kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_DOWN', 'WHEELUPMOUSE', 'PRESS', shift=True)
-
-    # Constraining to axes
-    kmi = km.keymap_items.new_modal('AXIS_X', 'X', 'CLICK')
-    kmi = km.keymap_items.new_modal('AXIS_Y', 'Y', 'CLICK')
-    kmi = km.keymap_items.new_modal('AXIS_Z', 'Z', 'CLICK')
-    kmi = km.keymap_items.new_modal('PLANE_X', 'X', 'CLICK', shift=True)
-    kmi = km.keymap_items.new_modal('PLANE_Y', 'Y', 'CLICK', shift=True)
-    kmi = km.keymap_items.new_modal('PLANE_Z', 'Z', 'CLICK', shift=True)
-
-    # Overrides ("No, really, actually translate") and trackball rotate
-    kmi = km.keymap_items.new_modal('TRANSLATE', TRANSLATE_KEY, 'PRESS')
-    kmi = km.keymap_items.new_modal('ROTATE', ROTATE_KEY, 'PRESS')
-    kmi = km.keymap_items.new_modal('RESIZE', SCALE_KEY, 'PRESS')
-
-
-def MapAdd_ModalBorderSelect(kc):
-    """ Border Select Modal Map
-        Determines behavior when in border select tool.
-    """
-    km = kc.keymaps.new('Gesture Border', space_type='EMPTY', region_type='WINDOW', modal=True)
-
-    kmi = km.keymap_items.new_modal('CANCEL', 'ESC', 'PRESS', any=True)
-
-    kmi = km.keymap_items.new_modal('BEGIN', 'LEFTMOUSE', 'PRESS')
-    kmi = km.keymap_items.new_modal('SELECT', 'LEFTMOUSE', 'RELEASE')
-    kmi = km.keymap_items.new_modal('SELECT', 'LEFTMOUSE', 'RELEASE', shift=True)
-    kmi = km.keymap_items.new_modal('DESELECT', 'LEFTMOUSE', 'RELEASE', ctrl=True)
-
-
-
-
-
-
-
-def MapAdd_FileBrowserGlobal(kc):
-    # Map File Browser
-    km = kc.keymaps.new('File Browser', space_type='FILE_BROWSER', region_type='WINDOW', modal=False)
-
-    kmi = km.keymap_items.new('file.bookmark_toggle', 'N', 'PRESS')
-    kmi = km.keymap_items.new('file.parent', 'P', 'PRESS')
-    kmi = km.keymap_items.new('file.bookmark_add', 'B', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('file.hidedot', 'H', 'PRESS')
-    kmi = km.keymap_items.new('file.previous', 'BACK_SPACE', 'PRESS')
-    kmi = km.keymap_items.new('file.next', 'BACK_SPACE', 'PRESS', shift=True)
-    kmi = km.keymap_items.new('file.directory_new', 'I', 'PRESS')
-    kmi = km.keymap_items.new('file.delete', 'X', 'PRESS')
-    kmi = km.keymap_items.new('file.delete', 'DEL', 'PRESS')
-    kmi = km.keymap_items.new('file.smoothscroll', 'TIMER1', 'ANY', any=True)
-
-def MapAdd_FileBrowserMain(kc):
-    # Map File Browser Main
-    km = kc.keymaps.new('File Browser Main', space_type='FILE_BROWSER', region_type='WINDOW', modal=False)
-
-    kmi = km.keymap_items.new('file.execute', 'LEFTMOUSE', 'DOUBLE_CLICK')
-    kmi.properties.need_active = True
-    kmi = km.keymap_items.new('file.select', 'LEFTMOUSE', 'CLICK')
-    kmi = km.keymap_items.new('file.select', 'LEFTMOUSE', 'CLICK', shift=True)
-    kmi.properties.extend = True
-    kmi = km.keymap_items.new('file.select', 'LEFTMOUSE', 'CLICK', alt=True)
-    kmi.properties.extend = True
-    kmi.properties.fill = True
-    kmi = km.keymap_items.new('file.select_all_toggle', 'A', 'PRESS')
-    kmi = km.keymap_items.new('file.refresh', 'NUMPAD_PERIOD', 'PRESS')
-    kmi = km.keymap_items.new('file.select_border', 'B', 'PRESS')
-    kmi = km.keymap_items.new('file.select_border', 'EVT_TWEAK_L', 'ANY')
-    kmi = km.keymap_items.new('file.rename', 'LEFTMOUSE', 'PRESS', ctrl=True)
-    kmi = km.keymap_items.new('file.highlight', 'MOUSEMOVE', 'ANY', any=True)
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS')
-    kmi.properties.increment = 1
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', shift=True)
-    kmi.properties.increment = 10
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
-    kmi.properties.increment = 100
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS')
-    kmi.properties.increment = -1
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', shift=True)
-    kmi.properties.increment = -10
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
-    kmi.properties.increment = -100
-
-def MapAdd_FileBrowserButtons(kc):
-    # Map File Browser Buttons
-    km = kc.keymaps.new('File Browser Buttons', space_type='FILE_BROWSER', region_type='WINDOW', modal=False)
-
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS')
-    kmi.properties.increment = 1
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', shift=True)
-    kmi.properties.increment = 10
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
-    kmi.properties.increment = 100
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS')
-    kmi.properties.increment = -1
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', shift=True)
-    kmi.properties.increment = -10
-    kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
-    kmi.properties.increment = -100
-
-
-
-
-
-
-
-
-
-wm = bpy.context.window_manager
-kc = wm.keyconfigs.new('Blender 2012 (experimental!)')
-
-clear_keymap(kc)
-
-MapAdd_Window(kc)
-MapAdd_Screen(kc)
-
-MapAdd_View2D(kc)
-
-MapAdd_View3D_Global(kc)
-MapAdd_View3D_Object_Nonmodal(kc)
-MapAdd_View3D_ObjectMode(kc)
-MapAdd_View3D_MeshEditMode(kc)
-
-MapAdd_ModalStandard(kc)
-MapAdd_ModalTransform(kc)
-MapAdd_ModalBorderSelect(kc)
-
-MapAdd_FileBrowserGlobal(kc)
-MapAdd_FileBrowserMain(kc)
-MapAdd_FileBrowserButtons(kc)
-
-
-
-
-
-
-
-
-
-
-
diff --git a/release/scripts/addons_contrib/render_auto_save.py b/release/scripts/addons_contrib/render_auto_save.py
deleted file mode 100644
index 438fb04..0000000
--- a/release/scripts/addons_contrib/render_auto_save.py
+++ /dev/null
@@ -1,137 +0,0 @@
-#Simplified BSD License
-#
-#Copyright (c) 2012, Florian Meyer
-#tstscr at web.de
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions are met: 
-#
-#1. Redistributions of source code must retain the above copyright notice, this
-#   list of conditions and the following disclaimer. 
-#2. Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution. 
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-#ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#################################################################
-bl_info = {
-    "name": "Auto Save Render",
-    "author": "tstscr",
-    "version": (1, 0),
-    "blender": (2, 63, 0),
-    "location": "Rendertab -> Render Panel",
-    "description": "Automatically save the image after rendering",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Auto_Save",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=32491",
-    "category": "Render"}
-###########################################################################
-import bpy
-from bpy.props import BoolProperty, EnumProperty
-from bpy.app.handlers import persistent
-from os.path import dirname, exists, join
-from bpy.path import basename
-from os import mkdir, listdir
-from re import findall
-
-
- at persistent
-def auto_save_render(scene):
-    if not scene.save_after_render or not bpy.data.filepath:
-        return
-    rndr = scene.render
-    original_format = rndr.image_settings.file_format
-
-    format = rndr.image_settings.file_format = scene.auto_save_format
-    if format == 'OPEN_EXR_MULTILAYER': extension = '.exr'
-    if format == 'JPEG': extension = '.jpg'
-    if format == 'PNG': extension = '.png'
-    
-    blendname = basename(bpy.data.filepath).rpartition('.')[0]
-    filepath = dirname(bpy.data.filepath) + '/auto_saves'
-    
-    if not exists(filepath):
-        mkdir(filepath)
-        
-    if scene.auto_save_subfolders:
-        filepath = join(filepath, blendname)
-        if not exists(filepath):
-            mkdir(filepath)
-
-    #imagefiles starting with the blendname
-    files = [f for f in listdir(filepath) \
-            if f.startswith(blendname) \
-            and f.lower().endswith(('.png', '.jpg', '.jpeg', '.exr'))]
-    
-    highest = 0
-    if files:
-        for f in files:
-            #find last numbers in the filename after the blendname
-            suffix = findall('\d+', f.split(blendname)[-1])
-            if suffix:
-                if int(suffix[-1]) > highest:
-                    highest = int(suffix[-1])
-    
-    save_name = join(filepath, blendname) + '_' + str(highest+1).zfill(3) + extension
-
-    image = bpy.data.images['Render Result']
-    if not image:
-        print('Auto Save: Render Result not found. Image not saved')
-        return
-    
-    print('Auto_Save:', save_name)
-    image.save_render(save_name, scene=None)
-
-    rndr.image_settings.file_format = original_format
-
-###########################################################################
-def auto_save_UI(self, context):
-    layout = self.layout
-    
-    split=layout.split(percentage=0.66, align=True)
-    row = split.row()
-    row.prop(context.scene, 'save_after_render', text='Auto Save', toggle=False)
-    row.prop(context.scene, 'auto_save_subfolders', toggle=False)
-    #split=layout.split()
-    row=split.row()
-    row.prop(context.scene, 'auto_save_format', text='as', expand=False)
-    
-def register():
-    bpy.types.Scene.save_after_render = BoolProperty(
-                    name='Save after render',
-                    default=True,
-                    description='Automatically save rendered images into: //auto_save/')
-    bpy.types.Scene.auto_save_format = EnumProperty(
-                    name='Auto Save File Format',
-                    description='File Format for the auto saves.',
-                    items={
-                    ('PNG', 'png', 'Save as png'),
-                    ('JPEG', 'jpg', 'Save as jpg'),
-                    ('OPEN_EXR_MULTILAYER', 'exr', 'Save as multilayer exr')},
-                    default='PNG')
-    bpy.types.Scene.auto_save_subfolders = BoolProperty(
-                    name='subfolder',
-                    default=False,
-                    description='Save into individual subfolders per blend name')
-    bpy.app.handlers.render_post.append(auto_save_render)
-    bpy.types.RENDER_PT_render.append(auto_save_UI)
-    
-def unregister():
-    del(bpy.types.Scene.save_after_render)
-    del(bpy.types.Scene.auto_save_format)
-    del(bpy.types.Scene.auto_save_subfolders)
-    bpy.app.handlers.render_post.remove(auto_save_render)
-    bpy.types.RENDER_PT_render.remove(auto_save_UI)
-
-if __name__ == "__main__":
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/render_clay.py b/release/scripts/addons_contrib/render_clay.py
deleted file mode 100644
index 2a3f098..0000000
--- a/release/scripts/addons_contrib/render_clay.py
+++ /dev/null
@@ -1,226 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Clay Render",
-    "author": "Fabio Russo <ruesp83 at libero.it>",
-    "version": (1, 2),
-    "blender": (2, 56, 0),
-    "location": "Render > Clay Render",
-    "description": "This script, applies a temporary material to all objects"\
-        " of the scene.",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Clay_Render",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=22971",
-    "category": "Render"}
-
-import bpy
-from bpy.props import BoolProperty
-
-
-def Create_Mat():
-    id = bpy.data.materials.new("Clay_Render")
-    #diffuse
-    id.diffuse_shader = "OREN_NAYAR"
-    id.diffuse_color = 0.800, 0.741, 0.536
-    id.diffuse_intensity = 1
-    id.roughness = 0.909
-    #specular
-    id.specular_shader = "COOKTORR"
-    id.specular_color = 1, 1, 1
-    id.specular_hardness = 10
-    id.specular_intensity = 0.115
-
-
-def Alternative_Clay(self, msg):
-    Find = False
-    AM = None
-    i = 0
-    for mat in bpy.data.materials:
-        if (mat.Mat_Clay) and (not Find):
-            Find = True
-            AM = mat
-            i += 1
-
-        else:
-            if (mat.Mat_Clay):
-                i += 1
-
-    if msg is True:
-        if (i == 1):
-            self.report({'INFO'}, "The material \"" + AM.name + "\" is set "\
-                "as Clay!")
-        else:
-            if (i > 1):
-                self.report({'WARNING'}, "Two or more materials are set as "\
-                    "Clay. \"" + AM.name + "\" will be used!")
-
-    return AM
-
-
-def Get_Mat():
-    Mat = bpy.data.materials["Clay_Render"]
-    return Mat
-
-
-def Exist_Mat():
-    if bpy.data.materials.get("Clay_Render"):
-        return True
-
-    else:
-        return False
-
-
-class ClayPinned(bpy.types.Operator):
-    bl_idname = "render.clay_pinned"
-    bl_label = "Clay Pinned"
-    bl_description = "Clay Material Stores"
-
-    def execute(self, context):
-        if bpy.types.Scene.Clay_Pinned:
-            bpy.types.Scene.Clay_Pinned = False
-        else:
-            if bpy.types.Scene.Clay:
-                if bpy.data.materials[0].users == 0:
-                    bpy.data.materials.remove(Get_Mat())
-                    bpy.types.Scene.Clay_Pinned = True
-
-            else:
-                bpy.types.Scene.Clay_Pinned = True
-
-        return {'FINISHED'}
-
-
-class CheckClay(bpy.types.Operator):
-    bl_idname = "render.clay"
-    bl_label = "Clay Render"
-    bl_description = "Use Clay Render"
-
-    def execute(self, context):
-        if bpy.types.Scene.Clay:
-            #Clay Attivato
-            ac = Alternative_Clay(self, True)
-            if ac is None:
-                if not Exist_Mat():
-                    Create_Mat()
-                rl = context.scene.render.layers
-                rl.active.material_override = Get_Mat()
-
-            else:
-                context.scene.render.layers.active.material_override = ac
-
-            bpy.types.Scene.Clay = False
-
-        else:
-            context.scene.render.layers.active.material_override = None
-            if bpy.types.Scene.Clay_Pinned:
-                if bpy.data.materials[0].users == 0:
-                    bpy.data.materials.remove(Get_Mat())
-            bpy.types.Scene.Clay = True
-
-        return {'FINISHED'}
-
-
-def draw_clay_render(self, context):
-    ok_clay = not bpy.types.Scene.Clay
-    pin = not bpy.types.Scene.Clay_Pinned
-
-    rnl = context.scene.render.layers.active
-    split = self.layout.split()
-    col = split.column()
-
-    col.operator(CheckClay.bl_idname, emboss=False, icon='CHECKBOX_HLT'\
-        if ok_clay else 'CHECKBOX_DEHLT')
-    col = split.column()
-    if Alternative_Clay(self, False) is None:
-        if Exist_Mat():
-            if (bpy.data.materials[0].users == 0) or (ok_clay):
-                row = col.row(align=True)
-                im = Get_Mat()
-                row.prop(im, "diffuse_color", text="")
-                row.operator(ClayPinned.bl_idname, text="", icon='PINNED'\
-                    if pin else 'UNPINNED')
-
-                if ok_clay:
-                    row.active = True
-
-                else:
-                    row.active = False
-
-            else:
-                col.label('Clay Material applied to an object')
-
-    else:
-        col.label('Custom Material Clay')
-
-    self.layout.separator()
-
-
-def draw_clay_options(self, context):
-    cm = context.material
-    layout = self.layout
-    layout.prop(cm, "Mat_Clay", text="Clay")
-
-
-def draw_clay_warning(self, context):
-    if not bpy.types.Scene.Clay:
-        self.layout.label("Render Clay Enabled", "ERROR")
-
-
-def register():
-    bpy.types.Scene.Clay = BoolProperty(
-    name='Clay Render',
-    description='Use Clay Render',
-    default=False)
-
-    bpy.types.Scene.Clay_Pinned = BoolProperty(
-    name='Clay Pinned',
-    description='Clay Material Stores',
-    default=False)
-
-    bpy.types.Material.Mat_Clay = bpy.props.BoolProperty(
-        name='Use as Clay',
-        description='Use as Clay',
-        default=False)
-
-    bpy.utils.register_class(ClayPinned)
-    bpy.utils.register_class(CheckClay)
-    bpy.types.RENDER_PT_render.prepend(draw_clay_render)
-    bpy.types.MATERIAL_PT_options.append(draw_clay_options)
-    bpy.types.INFO_HT_header.append(draw_clay_warning)
-
-
-def unregister():
-    bpy.context.scene.render.layers.active.material_override = None
-    if (Exist_Mat()) and (bpy.data.materials[0].users == 0):
-        bpy.data.materials.remove(Get_Mat())
-    del bpy.types.Scene.Clay
-    del bpy.types.Scene.Clay_Pinned
-    del bpy.types.Material.Mat_Clay
-    bpy.utils.unregister_class(ClayPinned)
-    bpy.utils.unregister_class(CheckClay)
-    bpy.types.RENDER_PT_render.remove(draw_clay_render)
-    bpy.types.MATERIAL_PT_options.remove(draw_clay_options)
-    bpy.types.INFO_HT_header.remove(draw_clay_warning)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/render_time.py b/release/scripts/addons_contrib/render_time.py
deleted file mode 100644
index d368e54..0000000
--- a/release/scripts/addons_contrib/render_time.py
+++ /dev/null
@@ -1,172 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-
-bl_info = {
-    "name": "Render Time Estimation",
-    "author": "Jason van Gumster (Fweeb)",
-    "version": (0, 5, 1),
-    "blender": (2, 62, 0),
-    "location": "UV/Image Editor > Properties > Image",
-    "description": "Estimates the time to complete rendering on animations",
-    "warning": "Does not work on OpenGL renders",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Render_Time_Estimation",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=30452&group_id=153&atid=467",
-    "category": "Render"}
-
-
-import bpy, time
-from bpy.app.handlers import persistent
-from datetime import timedelta
-import blf
-
-
-timer = {"average": 0.0, "total": 0.0, "time_start": 0.0, "is_rendering": False, "hud": False}
-
-def set_rendering(scene):
-    timer["is_rendering"] = True
-
- at persistent
-def unset_rendering(scene):
-    timer["is_rendering"] = False
-
- at persistent
-def start_timer(scene):
-    set_rendering(scene)
-
-    if scene.frame_current == scene.frame_start:
-        timer["average"] = 0.0
-        timer["total"] = 0.0
-
-    timer["time_start"] = time.time()
-
- at persistent
-def end_timer(scene):
-    render_time = time.time() - timer["time_start"]
-    timer["total"] += render_time
-    if scene.frame_current == scene.frame_start:
-        timer["average"] = render_time
-    else:
-        timer["average"] = (timer["average"] + render_time) / 2
-
-    print("Total render time: " + str(timedelta(seconds = timer["total"])))
-    print("Estimated completion: " + str(timedelta(seconds = (timer["average"] * (scene.frame_end - scene.frame_current)))))
-
-
-# UI
-
-def image_panel_rendertime(self, context):
-    scene = context.scene
-    layout = self.layout
-
-    if context.space_data.image is not None and context.space_data.image.type == 'RENDER_RESULT':
-        layout.label(text = "Total render time: " + str(timedelta(seconds = timer["total"])))
-
-        if timer["is_rendering"] and scene.frame_current != scene.frame_start:
-            layout.label(text = "Estimated completion: " + str(timedelta(seconds = (timer["average"] * (scene.frame_end - scene.frame_current)))))
-
-def draw_callback_px(self, context):
-    scene = context.scene
-
-    font_id = 0  # XXX, need to find out how best to get this.
-
-    # draw some text
-    blf.position(font_id, 15, 30, 0)
-    blf.size(font_id, 18, 72)
-    blf.enable(font_id, blf.SHADOW)
-    blf.shadow(font_id, 5, 0.0, 0.0, 0.0, 1.0)
-
-    blf.draw(font_id, "Total render time " + str(timedelta(seconds = timer["total"])))
-    if timer["is_rendering"] and scene.frame_current != scene.frame_start:
-        blf.position(font_id, 15, 12, 0)
-        blf.draw(font_id, "Estimated completion: " + str(timedelta(seconds = (timer["average"] * (scene.frame_end - scene.frame_current)))))
-
-    # restore defaults
-    blf.disable(font_id, blf.SHADOW)
-
-class RenderTimeHUD(bpy.types.Operator):
-    bl_idname = "view2d.rendertime_hud"
-    bl_label = "Display Render Times"
-    last_activity = 'NONE'
-
-    def modal(self, context, event):
-        if context.area:
-            context.area.tag_redraw()
-
-        #if event.type in {'ESC'}:
-        if timer["hud"] == False:
-            context.region.callback_remove(self._handle)
-            return {'CANCELLED'}
-
-        return {'PASS_THROUGH'}
-
-    def invoke(self, context, event):
-        if context.area.type == 'IMAGE_EDITOR':
-            if timer["hud"] == False:
-                # Add the region OpenGL drawing callback
-                self._handle = context.region.callback_add(draw_callback_px, (self, context), 'POST_PIXEL')
-                timer["hud"] = True
-
-                context.window_manager.modal_handler_add(self)
-                return {'RUNNING_MODAL'}
-            else:
-                timer["hud"] = False
-                return {'CANCELLED'}
-        else:
-            self.report({'WARNING'}, "UV/Image Editor not found, cannot run operator")
-            return {'CANCELLED'}
-
-def display_hud(self, context):
-    scene = context.scene
-    layout = self.layout
-    layout.operator("view2d.rendertime_hud")
-
-
-# Registration
-
-def register():
-    bpy.app.handlers.render_complete.append(unset_rendering)
-    bpy.app.handlers.render_cancel.append(unset_rendering)
-    bpy.app.handlers.render_pre.append(start_timer)
-    bpy.app.handlers.render_post.append(end_timer)
-    bpy.types.IMAGE_PT_image_properties.append(image_panel_rendertime)
-    bpy.utils.register_class(RenderTimeHUD)
-    bpy.types.IMAGE_HT_header.append(display_hud)
-
-    # Keymapping      XXX TODO - This doesn't work for some reason
-    #kc = bpy.context.window_manager.keyconfigs.addon
-    #km = kc.keymaps.new(name = "View 2D", space_type = 'IMAGE_EDITOR')
-    #kmi = km.keymap_items.new("view2d.rendertime_hud", 'E', 'PRESS')
-    #kmi.active = True
-
-def unregister():
-    #kc = bpy.context.window_manager.keyconfigs.addon
-    #km = kc.keymaps["View 2D"]
-    #km.keymap_items.remove(km.keymap_items["view2d.rendertime_hud"])
-
-    bpy.types.IMAGE_HT_header.remove(display_hud)
-    bpy.utils.unregister_class(RenderTimeHUD)
-    bpy.app.handlers.render_pre.remove(start_timer)
-    bpy.app.handlers.render_post.remove(end_timer)
-    bpy.app.handlers.render_cancel.remove(unset_rendering)
-    bpy.app.handlers.render_complete.remove(unset_rendering)
-    bpy.types.IMAGE_PT_image_properties.remove(image_panel_rendertime)
-
-if __name__ == '__main__':
-    register()
diff --git a/release/scripts/addons_contrib/render_to_print.py b/release/scripts/addons_contrib/render_to_print.py
deleted file mode 100644
index 2a58c41..0000000
--- a/release/scripts/addons_contrib/render_to_print.py
+++ /dev/null
@@ -1,346 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Render to Print",
-    "author": "Marco Crippa <thekrypt77 at tiscali.it>, Dealga McArdle",
-    "version": (0, 2),
-    "blender": (2, 58, 0),
-    "location": "Render > Render to Print",
-    "description": "Set the size of the render for a print",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/Render/Render to Print",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"
-                   "func=detail&aid=24219",
-    "category": "Render"}
-
-
-import math
-import bpy
-from bpy.types import Panel, Operator, Scene, PropertyGroup
-from bpy.props import (IntProperty,
-                       FloatProperty,
-                       StringProperty,
-                       EnumProperty,
-                       PointerProperty,
-                       )
-
-
-paper_presets = (
-    ("custom_1_1", "custom", ""),
-    ("A0_84.1_118.9", "A0 (84.1x118.9 cm)", ""),
-    ("A1_59.4_84.1", "A1 (59.4x84.1 cm)", ""),
-    ("A2_42.0_59.4", "A2 (42.0x59.4 cm)", ""),
-    ("A3_29.7_42.0", "A3 (29.7 42.0 cm)", ""),
-    ("A4_21.0_29.7", "A4 (21.0x29.7 cm)", ""),
-    ("A5_14.8_21.0", "A5 (14.8x21.0 cm)", ""),
-    ("A6_10.5_14.8", "A6 (10.5x14.8 cm)", ""),
-    ("A7_7.4_10.5", "A7 (7.4x10.5 cm)", ""),
-    ("A8_5.2_7.4", "A8 (5.2x7.4 cm)", ""),
-    ("A9_3.7_5.2", "A9 (3.7x5.2 cm)", ""),
-    ("A10_2.6_3.7", "A10 (2.6x3.7 cm)", ""),
-
-    ("B0_100.0_141.4", "B0 (100.0x141.4 cm)", ""),
-    ("B1_70.7_100.0", "B1 (70.7x100.0 cm)", ""),
-    ("B2_50.0_70.7", "B2 (50.0x70.7 cm)", ""),
-    ("B3_35.3_50.0", "B3 (35.3x50.0 cm)", ""),
-    ("B4_25.0_35.3", "B4 (25.0x35.3 cm)", ""),
-    ("B5_17.6_25.0", "B5 (17.6x25.0 cm)", ""),
-    ("B6_12.5_17.6", "B6 (12.5x17.6 cm)", ""),
-    ("B7_8.8_12.5", "B7 (8.8x12.5 cm)", ""),
-    ("B8_6.2_8.8", "B8 (6.2x8.8 cm)", ""),
-    ("B9_4.4_6.2", "B9 (4.4x6.2 cm)", ""),
-    ("B10_3.1_4.4", "B10 (3.1x4.4 cm)", ""),
-
-    ("C0_91.7_129.7", "C0 (91.7x129.7 cm)", ""),
-    ("C1_64.8_91.7", "C1 (64.8x91.7 cm)", ""),
-    ("C2_45.8_64.8", "C2 (45.8x64.8 cm)", ""),
-    ("C3_32.4_45.8", "C3 (32.4x45.8 cm)", ""),
-    ("C4_22.9_32.4", "C4 (22.9x32.4 cm)", ""),
-    ("C5_16.2_22.9", "C5 (16.2x22.9 cm)", ""),
-    ("C6_11.4_16.2", "C6 (11.4x16.2 cm)", ""),
-    ("C7_8.1_11.4", "C7 (8.1x11.4 cm)", ""),
-    ("C8_5.7_8.1", "C8 (5.7x8.1 cm)", ""),
-    ("C9_4.0_5.7", "C9 (4.0x5.7 cm)", ""),
-    ("C10_2.8_4.0", "C10 (2.8x4.0 cm)", ""),
-
-    ("Letter_21.6_27.9", "Letter (21.6x27.9 cm)", ""),
-    ("Legal_21.6_35.6", "Legal (21.6x35.6 cm)", ""),
-    ("Legal junior_20.3_12.7", "Legal junior (20.3x12.7 cm)", ""),
-    ("Ledger_43.2_27.9", "Ledger (43.2x27.9 cm)", ""),
-    ("Tabloid_27.9_43.2", "Tabloid (27.9x43.2 cm)", ""),
-
-    ("ANSI C_43.2_55.9", "ANSI C (43.2x55.9 cm)", ""),
-    ("ANSI D_55.9_86.4", "ANSI D (55.9x86.4 cm)", ""),
-    ("ANSI E_86.4_111.8", "ANSI E (86.4x111.8 cm)", ""),
-
-    ("Arch A_22.9_30.5", "Arch A (22.9x30.5 cm)", ""),
-    ("Arch B_30.5_45.7", "Arch B (30.5x45.7 cm)", ""),
-    ("Arch C_45.7_61.0", "Arch C (45.7x61.0 cm)", ""),
-    ("Arch D_61.0_91.4", "Arch D (61.0x91.4 cm)", ""),
-    ("Arch E_91.4_121.9", "Arch E (91.4x121.9 cm)", ""),
-    ("Arch E1_76.2_106.7", "Arch E1 (76.2x106.7 cm)", ""),
-    ("Arch E2_66.0_96.5", "Arch E2 (66.0x96.5 cm)", ""),
-    ("Arch E3_68.6_99.1", "Arch E3 (68.6x99.1 cm)", ""),
-    )
-
-
-def paper_enum_parse(idname):
-    tipo, dim_w, dim_h = idname.split("_")
-    return tipo, float(dim_w), float(dim_h)
-
-
-paper_presets_data = {idname: paper_enum_parse(idname)
-                      for idname, name, descr in paper_presets}
-
-
-def update_settings_cb(self, context):
-    # annoying workaround for recursive call
-    if update_settings_cb.level is False:
-        update_settings_cb.level = True
-        pixels_from_print(self)
-        update_settings_cb.level = False
-
-update_settings_cb.level = False
-
-
-class RenderPrintSertings(PropertyGroup):
-    unit_from = EnumProperty(
-            name="Set from",
-            description="Set from",
-            items=(
-                ("CM_TO_PIXELS", "CM -> Pixel", "Centermeters to Pixels"),
-                ("PIXELS_TO_CM", "Pixel -> CM", "Pixels to Centermeters")
-                ),
-            default="CM_TO_PIXELS",
-            )
-    orientation = EnumProperty(
-            name="Page Orientation",
-            description="Set orientation",
-            items=(
-                ("Portrait", "Portrait", "Portrait"),
-                ("Landscape", "Landscape", "Landscape")
-            ),
-            default="Portrait",
-            update=update_settings_cb,
-            )
-    preset = EnumProperty(
-            name="Select Preset",
-            description="Select from preset",
-            items=paper_presets,
-            default="custom_1_1",
-            update=update_settings_cb,
-            )
-    dpi = IntProperty(
-            name="DPI",
-            description="Dots per Inch",
-            default=300,
-            min=72, max=1800,
-            update=update_settings_cb,
-            )
-    width_cm = FloatProperty(
-            name="Width",
-            description="Width in CM",
-            default=5.0,
-            min=1.0, max=100000.0,
-            update=update_settings_cb,
-            )
-    height_cm = FloatProperty(
-            name="Height",
-            description="Height in CM",
-            default=3.0,
-            min=1.0, max=100000.0,
-            update=update_settings_cb,
-            )
-    width_px = IntProperty(
-            name="Pixel Width",
-            description="Pixel Width",
-            default=900,
-            min=4, max=10000,
-            update=update_settings_cb,
-            )
-    height_px = IntProperty(
-            name="Pixel Height",
-            description="Pixel Height",
-            default=600,
-            min=4, max=10000,
-            update=update_settings_cb,
-            )
-
-
-def pixels_from_print(ps):
-    tipo, dim_w, dim_h = paper_presets_data[ps.preset]
-
-    if ps.unit_from == "CM_TO_PIXELS":
-        if tipo == "custom":
-            dim_w = ps.width_cm
-            dim_h = ps.height_cm
-            ps.width_cm = dim_w
-            ps.height_cm = dim_h
-        elif tipo != "custom" and ps.orientation == "Landscape":
-            ps.width_cm = dim_h
-            ps.height_cm = dim_w
-        elif tipo != "custom" and ps.orientation == "Portrait":
-            ps.width_cm = dim_w
-            ps.height_cm = dim_h
-
-        ps.width_px = math.ceil((ps.width_cm * ps.dpi) / 2.54)
-        ps.height_px = math.ceil((ps.height_cm * ps.dpi) / 2.54)
-    else:
-        if tipo != "custom" and ps.orientation == "Landscape":
-            ps.width_cm = dim_h
-            ps.height_cm = dim_w
-            ps.width_px = math.ceil((ps.width_cm * ps.dpi) / 2.54)
-            ps.height_px = math.ceil((ps.height_cm * ps.dpi) / 2.54)
-        elif tipo != "custom" and ps.orientation == "Portrait":
-            ps.width_cm = dim_w
-            ps.height_cm = dim_h
-            ps.width_px = math.ceil((ps.width_cm * ps.dpi) / 2.54)
-            ps.height_px = math.ceil((ps.height_cm * ps.dpi) / 2.54)
-
-        ps.width_cm = (ps.width_px / ps.dpi) * 2.54
-        ps.height_cm = (ps.height_px / ps.dpi) * 2.54
-
-
-class RENDER_PT_print(Panel):
-    bl_label = "Render to Print"
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'render'
-
-    def draw(self, context):
-
-        layout = self.layout
-        scene = context.scene
-        ps = scene.print_settings
-
-        row = layout.row(align=True)
-        row1 = layout.row(align=True)
-        row2 = layout.row(align=True)
-        row3 = layout.row(align=True)
-        row4 = layout.row(align=True)
-        row5 = layout.row(align=True)
-        row6 = layout.row(align=True)
-        row7 = layout.row(align=True)
-        col = layout.column(align=True)
-
-        row.prop(ps, "unit_from")
-        row1.prop(ps, "orientation")
-        row2.prop(ps, "preset")
-
-        col.separator()
-        row3.prop(ps, "width_cm")
-        row3.separator()
-        row3.prop(ps, "height_cm")
-        col.separator()
-        row4.prop(ps, "dpi")
-        col.separator()
-        row5.prop(ps, "width_px")
-        row5.separator()
-        row5.prop(ps, "height_px")
-
-        col.separator()
-        row6.label("Inch Width: %.2f" % (ps.width_cm / 2.54))
-        row6.label("Inch Height: %.2f" % (ps.height_cm / 2.54))
-        col.separator()
-
-        row7.operator("render.apply_size", icon="RENDER_STILL")
-
-        #  this if else deals with hiding UI elements when logic demands it.
-        tipo = paper_presets_data[ps.preset][0]
-
-        if tipo != "custom":
-            row.active = False
-            row.enabled = False
-
-        if ps.unit_from == "CM_TO_PIXELS":
-            row5.active = False
-            row5.enabled = False
-
-            if tipo == "custom":
-                row3.active = True
-                row3.enabled = True
-                row1.active = False
-                row1.enabled = False
-            elif tipo != "custom" and ps.orientation == "Landscape":
-                row3.active = False
-                row3.enabled = False
-                row1.active = True
-                row1.enabled = True
-            elif tipo != "custom" and ps.orientation == "Portrait":
-                row3.active = False
-                row3.enabled = False
-                row1.active = True
-                row1.enabled = True
-        else:
-            row3.active = False
-            row3.enabled = False
-
-            if tipo == "custom":
-                row1.active = False
-                row1.enabled = False
-            elif tipo != "custom" and ps.orientation == "Landscape":
-                row1.active = True
-                row1.enabled = True
-                row5.active = False
-                row5.enabled = False
-            elif tipo != "custom" and ps.orientation == "Portrait":
-                row1.active = True
-                row1.enabled = True
-                row5.active = False
-                row5.enabled = False
-
-
-class RENDER_OT_apply_size(Operator):
-    bl_idname = "render.apply_size"
-    bl_label = "Apply Print to Render"
-    bl_description = "Set the render dimension"
-
-    def execute(self, context):
-
-        scene = context.scene
-        ps = scene.print_settings
-
-        pixels_from_print(ps)
-
-        render = scene.render
-        render.resolution_x = ps.width_px
-        render.resolution_y = ps.height_px
-
-        return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_class(RENDER_OT_apply_size)
-    bpy.utils.register_class(RENDER_PT_print)
-    bpy.utils.register_class(RenderPrintSertings)
-
-    Scene.print_settings = PointerProperty(type=RenderPrintSertings)
-
-
-def unregister():
-    bpy.utils.unregister_class(RENDER_OT_apply_size)
-    bpy.utils.unregister_class(RENDER_PT_print)
-    bpy.utils.unregister_class(RenderPrintSertings)
-    del Scene.print_settings
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/sequencer_extra_actions/__init__.py b/release/scripts/addons_contrib/sequencer_extra_actions/__init__.py
deleted file mode 100644
index 7e6383f..0000000
--- a/release/scripts/addons_contrib/sequencer_extra_actions/__init__.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Extra Sequencer Actions",
-    "author": "Turi Scandurra, Carlos Padial",
-    "version": (3, 6),
-    "blender": (2, 65, 0),
-    "api": 53177,
-    "category": "Sequencer",
-    "location": "Sequencer",
-    "description": "Collection of extra operators to manipulate VSE strips",
-    "wiki_url": "http://wiki.blender.org/index.php/"
-    "Extensions:2.6/Py/Scripts/Sequencer/Extra_Sequencer_Actions",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail"
-                   "&aid=30474",
-    "support": "COMMUNITY"}
-
-if "bpy" in locals():
-    import imp
-    imp.reload(operators_extra_actions)
-    imp.reload(ui)
-else:
-    from . import operators_extra_actions
-    from . import ui
-
-import bpy
-import os.path
-from bpy.types import Menu
-from bpy.types import Header
-
-
-# Registration
-def register():
-    bpy.utils.register_module(__name__)
-
-    # Append menu entries
-    bpy.types.SEQUENCER_MT_add.prepend(ui.sequencer_add_menu_func)
-    bpy.types.SEQUENCER_MT_select.prepend(ui.sequencer_select_menu_func)
-    bpy.types.SEQUENCER_MT_strip.prepend(ui.sequencer_strip_menu_func)
-    bpy.types.SEQUENCER_HT_header.append(ui.sequencer_header_func)
-    bpy.types.CLIP_HT_header.append(ui.clip_header_func)
-    bpy.types.CLIP_MT_clip.prepend(ui.clip_clip_menu_func)
-    bpy.types.TIME_MT_frame.prepend(ui.time_frame_menu_func)
-    bpy.types.TIME_HT_header.append(ui.time_header_func)
-
-    # Add keyboard shortcut configuration
-    kc = bpy.context.window_manager.keyconfigs.addon
-    km = kc.keymaps.new(name='Frames')
-    kmi = km.keymap_items.new('screenextra.frame_skip',
-    'RIGHT_ARROW', 'PRESS', ctrl=True, shift=True)
-    kmi.properties.back = False
-    kmi = km.keymap_items.new('screenextra.frame_skip',
-    'LEFT_ARROW', 'PRESS', ctrl=True, shift=True)
-    kmi.properties.back = True
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    #  Remove menu entries
-    bpy.types.SEQUENCER_MT_add.remove(ui.sequencer_add_menu_func)
-    bpy.types.SEQUENCER_MT_select.remove(ui.sequencer_select_menu_func)
-    bpy.types.SEQUENCER_MT_strip.remove(ui.sequencer_strip_menu_func)
-    bpy.types.SEQUENCER_HT_header.remove(ui.sequencer_header_func)
-    bpy.types.CLIP_HT_header.remove(ui.clip_header_func)
-    bpy.types.CLIP_MT_clip.remove(ui.clip_clip_menu_func)
-    bpy.types.TIME_MT_frame.remove(ui.time_frame_menu_func)
-    bpy.types.TIME_HT_header.remove(ui.time_header_func)
-
-    #  Remove keyboard shortcut configuration
-    kc = bpy.context.window_manager.keyconfigs.addon
-    km = kc.keymaps['Frames']
-    km.keymap_items.remove(km.keymap_items['screenextra.frame_skip'])
-    km.keymap_items.remove(km.keymap_items['screenextra.frame_skip'])
-
-
-if __name__ == '__main__':
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/sequencer_extra_actions/exiftool.py b/release/scripts/addons_contrib/sequencer_extra_actions/exiftool.py
deleted file mode 100644
index f42e3f3..0000000
--- a/release/scripts/addons_contrib/sequencer_extra_actions/exiftool.py
+++ /dev/null
@@ -1,330 +0,0 @@
-# -*- coding: utf-8 -*-
-# PyExifTool <http://github.com/smarnach/pyexiftool>
-# Copyright 2012 Sven Marnach
-
-# This file is part of PyExifTool.
-#
-# PyExifTool 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 3 of the License, or
-# (at your option) any later version.
-#
-# PyExifTool 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 PyExifTool.  If not, see <http://www.gnu.org/licenses/>.
-
-"""
-PyExifTool is a Python library to communicate with an instance of Phil
-Harvey's excellent ExifTool_ command-line application.  The library
-provides the class :py:class:`ExifTool` that runs the command-line
-tool in batch mode and features methods to send commands to that
-program, including methods to extract meta-information from one or
-more image files.  Since ``exiftool`` is run in batch mode, only a
-single instance needs to be launched and can be reused for many
-queries.  This is much more efficient than launching a separate
-process for every single query.
-
-.. _ExifTool: http://www.sno.phy.queensu.ca/~phil/exiftool/
-
-The source code can be checked out from the github repository with
-
-::
-
-    git clone git://github.com/smarnach/pyexiftool.git
-
-Alternatively, you can download a tarball_.  There haven't been any
-releases yet.
-
-.. _tarball: https://github.com/smarnach/pyexiftool/tarball/master
-
-PyExifTool is licenced under GNU GPL version 3 or later.
-
-Example usage::
-
-    import exiftool
-
-    files = ["a.jpg", "b.png", "c.tif"]
-    with exiftool.ExifTool() as et:
-        metadata = et.get_metadata_batch(files)
-    for d in metadata:
-        print("{:20.20} {:20.20}".format(d["SourceFile"],
-                                         d["EXIF:DateTimeOriginal"]))
-"""
-
-from __future__ import unicode_literals
-
-import sys
-import subprocess
-import os
-import json
-import warnings
-import codecs
-
-try:        # Py3k compatibility
-    basestring
-except NameError:
-    basestring = (bytes, str)
-
-executable = "exiftool"
-"""The name of the executable to run.
-
-If the executable is not located in one of the paths listed in the
-``PATH`` environment variable, the full path should be given here.
-"""
-
-# Sentinel indicating the end of the output of a sequence of commands.
-# The standard value should be fine.
-sentinel = b"{ready}"
-
-# The block size when reading from exiftool.  The standard value
-# should be fine, though other values might give better performance in
-# some cases.
-block_size = 4096
-
-# This code has been adapted from Lib/os.py in the Python source tree
-# (sha1 265e36e277f3)
-
-
-def _fscodec():
-    encoding = sys.getfilesystemencoding()
-    errors = "strict"
-    if encoding != "mbcs":
-        try:
-            codecs.lookup_error("surrogateescape")
-        except LookupError:
-            pass
-        else:
-            errors = "surrogateescape"
-
-    def fsencode(filename):
-        """
-        Encode filename to the filesystem encoding with 'surrogateescape' error
-        handler, return bytes unchanged. On Windows, use 'strict' error handler
-        if the file system encoding is 'mbcs' (which is the default encoding).
-        """
-        if isinstance(filename, bytes):
-            return filename
-        else:
-            return filename.encode(encoding, errors)
-
-    return fsencode
-
-fsencode = _fscodec()
-del _fscodec
-
-
-class ExifTool(object):
-    """Run the `exiftool` command-line tool and communicate to it.
-
-    You can pass the file name of the ``exiftool`` executable as an
-    argument to the constructor.  The default value ``exiftool`` will
-    only work if the executable is in your ``PATH``.
-
-    Most methods of this class are only available after calling
-    :py:meth:`start()`, which will actually launch the subprocess.  To
-    avoid leaving the subprocess running, make sure to call
-    :py:meth:`terminate()` method when finished using the instance.
-    This method will also be implicitly called when the instance is
-    garbage collected, but there are circumstance when this won't ever
-    happen, so you should not rely on the implicit process
-    termination.  Subprocesses won't be automatically terminated if
-    the parent process exits, so a leaked subprocess will stay around
-    until manually killed.
-
-    A convenient way to make sure that the subprocess is terminated is
-    to use the :py:class:`ExifTool` instance as a context manager::
-
-        with ExifTool() as et:
-            ...
-
-    .. warning:: Note that there is no error handling.  Nonsensical
-       options will be silently ignored by exiftool, so there's not
-       much that can be done in that regard.  You should avoid passing
-       non-existent files to any of the methods, since this will lead
-       to undefied behaviour.
-
-    .. py:attribute:: running
-
-       A Boolean value indicating whether this instance is currently
-       associated with a running subprocess.
-    """
-
-    def __init__(self, executable_=None):
-        if executable_ is None:
-            self.executable = executable
-        else:
-            self.executable = executable_
-        self.running = False
-
-    def start(self):
-        """Start an ``exiftool`` process in batch mode for this instance.
-
-        This method will issue a ``UserWarning`` if the subprocess is
-        already running.  The process is started with the ``-G`` and
-        ``-n`` as common arguments, which are automatically included
-        in every command you run with :py:meth:`execute()`.
-        """
-        if self.running:
-            warnings.warn("ExifTool already running; doing nothing.")
-            return
-        with open(os.devnull, "w") as devnull:
-            self._process = subprocess.Popen(
-                [self.executable, "-stay_open", "True",  "-@", "-",
-                 "-common_args", "-G", "-u", "-a", "-n"],
-                stdin=subprocess.PIPE, stdout=subprocess.PIPE,
-                stderr=devnull)
-        self.running = True
-
-    def terminate(self):
-        """Terminate the ``exiftool`` process of this instance.
-
-        If the subprocess isn't running, this method will do nothing.
-        """
-        if not self.running:
-            return
-        self._process.stdin.write(b"-stay_open\nFalse\n")
-        self._process.stdin.flush()
-        self._process.communicate()
-        del self._process
-        self.running = False
-
-    def __enter__(self):
-        self.start()
-        return self
-
-    def __exit__(self, exc_type, exc_val, exc_tb):
-        self.terminate()
-
-    def __del__(self):
-        self.terminate()
-
-    def execute(self, *params):
-        """Execute the given batch of parameters with ``exiftool``.
-
-        This method accepts any number of parameters and sends them to
-        the attached ``exiftool`` process.  The process must be
-        running, otherwise ``ValueError`` is raised.  The final
-        ``-execute`` necessary to actually run the batch is appended
-        automatically; see the documentation of :py:meth:`start()` for
-        the common options.  The ``exiftool`` output is read up to the
-        end-of-output sentinel and returned as a raw ``bytes`` object,
-        excluding the sentinel.
-
-        The parameters must also be raw ``bytes``, in whatever
-        encoding exiftool accepts.  For filenames, this should be the
-        system's filesystem encoding.
-
-        .. note:: This is considered a low-level method, and should
-           rarely be needed by application developers.
-        """
-        if not self.running:
-            raise ValueError("ExifTool instance not running.")
-        self._process.stdin.write(b"\n".join(params + (b"-execute\n",)))
-        self._process.stdin.flush()
-        output = b""
-        fd = self._process.stdout.fileno()
-        while not output[-32:].strip().endswith(sentinel):
-            output += os.read(fd, block_size)
-        return output.strip()[:-len(sentinel)]
-
-    def execute_json(self, *params):
-        """Execute the given batch of parameters and parse the JSON output.
-
-        This method is similar to :py:meth:`execute()`.  It
-        automatically adds the parameter ``-j`` to request JSON output
-        from ``exiftool`` and parses the output.  The return value is
-        a list of dictionaries, mapping tag names to the corresponding
-        values.  All keys are Unicode strings with the tag names
-        including the ExifTool group name in the format <group>:<tag>.
-        The values can have multiple types.  All strings occurring as
-        values will be Unicode strings.  Each dictionary contains the
-        name of the file it corresponds to in the key ``"SourceFile"``.
-
-        The parameters to this function must be either raw strings
-        (type ``str`` in Python 2.x, type ``bytes`` in Python 3.x) or
-        Unicode strings (type ``unicode`` in Python 2.x, type ``str``
-        in Python 3.x).  Unicode strings will be encoded using
-        system's filesystem encoding.  This behaviour means you can
-        pass in filenames according to the convention of the
-        respective Python version – as raw strings in Python 2.x and
-        as Unicode strings in Python 3.x.
-        """
-        params = map(fsencode, params)
-        return json.loads(self.execute(b"-j", *params).decode("utf-8"))
-
-    def get_metadata_batch(self, filenames):
-        """Return all meta-data for the given files.
-
-        The return value will have the format described in the
-        documentation of :py:meth:`execute_json()`.
-        """
-        return self.execute_json(*filenames)
-
-    def get_metadata(self, filename):
-        """Return meta-data for a single file.
-
-        The returned dictionary has the format described in the
-        documentation of :py:meth:`execute_json()`.
-        """
-        return self.execute_json(filename)[0]
-
-    def get_tags_batch(self, tags, filenames):
-        """Return only specified tags for the given files.
-
-        The first argument is an iterable of tags.  The tag names may
-        include group names, as usual in the format <group>:<tag>.
-
-        The second argument is an iterable of file names.
-
-        The format of the return value is the same as for
-        :py:meth:`execute_json()`.
-        """
-        # Explicitly ruling out strings here because passing in a
-        # string would lead to strange and hard-to-find errors
-        if isinstance(tags, basestring):
-            raise TypeError("The argument 'tags' must be "
-                            "an iterable of strings")
-        if isinstance(filenames, basestring):
-            raise TypeError("The argument 'filenames' must be "
-                            "an iterable of strings")
-        params = ["-" + t for t in tags]
-        params.extend(filenames)
-        return self.execute_json(*params)
-
-    def get_tags(self, tags, filename):
-        """Return only specified tags for a single file.
-
-        The returned dictionary has the format described in the
-        documentation of :py:meth:`execute_json()`.
-        """
-        return self.get_tags_batch(tags, [filename])[0]
-
-    def get_tag_batch(self, tag, filenames):
-        """Extract a single tag from the given files.
-
-        The first argument is a single tag name, as usual in the
-        format <group>:<tag>.
-
-        The second argument is an iterable of file names.
-
-        The return value is a list of tag values or ``None`` for
-        non-existent tags, in the same order as ``filenames``.
-        """
-        data = self.get_tags_batch([tag], filenames)
-        result = []
-        for d in data:
-            d.pop("SourceFile")
-            result.append(next(iter(d.values()), None))
-        return result
-
-    def get_tag(self, tag, filename):
-        """Extract a single tag from a single file.
-
-        The return value is the value of the specified tag, or
-        ``None`` if this tag was not found in the file.
-        """
-        return self.get_tag_batch(tag, [filename])[0]
diff --git a/release/scripts/addons_contrib/sequencer_extra_actions/functions.py b/release/scripts/addons_contrib/sequencer_extra_actions/functions.py
deleted file mode 100644
index f52376e..0000000
--- a/release/scripts/addons_contrib/sequencer_extra_actions/functions.py
+++ /dev/null
@@ -1,274 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-import os.path
-import operator
-
-from bpy.props import IntProperty
-from bpy.props import FloatProperty
-from bpy.props import EnumProperty
-from bpy.props import BoolProperty
-from bpy.props import StringProperty
-
-
-imb_ext_image = [
-    # IMG
-    ".png", ".tga", ".bmp", ".jpg", ".jpeg", ".sgi", ".rgb",
-    ".rgba", ".tif", ".tiff", ".tx", ".jp2", ".hdr", ".dds",
-    ".dpx", ".cin", ".exr", ".rw2",
-    # IMG QT
-    ".gif", ".psd", ".pct", ".pict", ".pntg", ".qtif"]
-
-
-imb_ext_movie = [
-    ".avi", ".flc", ".mov", ".movie", ".mp4", ".m4v", ".m2v",
-    ".m2t", ".m2ts", ".mts", ".mv", ".avs", ".wmv", ".ogv",
-    ".dv", ".mpeg", ".mpg", ".mpg2", ".vob", ".mkv", ".flv",
-    ".divx", ".xvid", ".mxf"]
-    
-movieextdict = [("1", ".avi", ""),
-            ("2", ".flc", ""),
-            ("3", ".mov", ""),
-            ("4", ".movie", ""),
-            ("5", ".mp4", ""),
-            ("6", ".m4v", ""),
-            ("7", ".m2v", ""),
-            ("8", ".m2t", ""),
-            ("9", ".m2ts", ""),
-            ("10", ".mts", ""),
-            ("11", ".mv", ""),
-            ("12", ".avs", ""),
-            ("13", ".wmv", ""),
-            ("14", ".ogv", ""),
-            ("15", ".dv", ""),
-            ("16", ".mpeg", ""),
-            ("17", ".mpg", ""),
-            ("18", ".mpg2", ""),
-            ("19", ".vob", ""),
-            ("20", ".mkv", ""),
-            ("21", ".flv", ""),
-            ("22", ".divx", ""),
-            ("23", ".xvid", ""),
-            ("24", ".mxf", "")]
-
-
-# Functions
-
-def add_marker(context, text):
-    scene = context.scene
-    markers = scene.timeline_markers
-    mark = markers.new(name=text)
-    mark.frame = scene.frame_current
-
-
-def act_strip(context):
-    try:
-        return context.scene.sequence_editor.active_strip
-    except AttributeError:
-        return None
-
-
-def detect_strip_type(filepath):
-    imb_ext_image = [
-    # IMG
-    ".png", ".tga", ".bmp", ".jpg", ".jpeg", ".sgi", ".rgb",
-    ".rgba", ".tif", ".tiff", ".tx", ".jp2", ".hdr", ".dds",
-    ".dpx", ".cin", ".exr",
-    # IMG QT
-    ".gif", ".psd", ".pct", ".pict", ".pntg", ".qtif"]
-
-    imb_ext_movie = [
-    ".avi", ".flc", ".mov", ".movie", ".mp4", ".m4v", ".m2v",
-    ".m2t", ".m2ts", ".mts", ".mv", ".avs", ".wmv", ".ogv", ".ogg",
-    ".dv", ".mpeg", ".mpg", ".mpg2", ".vob", ".mkv", ".flv",
-    ".divx", ".xvid", ".mxf"]
-
-    imb_ext_audio = [
-    ".wav", ".ogg", ".oga", ".mp3", ".mp2", ".ac3", ".aac",
-    ".flac", ".wma", ".eac3", ".aif", ".aiff", ".m4a"]
-
-    extension = os.path.splitext(filepath)[1]
-    extension = extension.lower()
-    if extension in imb_ext_image:
-        type = 'IMAGE'
-    elif extension in imb_ext_movie:
-        type = 'MOVIE'
-    elif extension in imb_ext_audio:
-        type = 'SOUND'
-    else:
-        type = None
-
-    return type
-
-
-def getpathfrombrowser():
-    '''
-    returns path from filebrowser
-    '''
-    scn = bpy.context.scene
-    for a in bpy.context.window.screen.areas:
-        if a.type == 'FILE_BROWSER':
-            params = a.spaces[0].params
-            break
-    try:
-        params
-    except UnboundLocalError:
-        #print("no browser")
-        self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
-        return {'CANCELLED'}
-    path = params.directory
-    return path
-
-
-def getfilepathfrombrowser():
-    '''
-    returns path and file from filebrowser
-    '''
-    scn = bpy.context.scene
-    for a in bpy.context.window.screen.areas:
-        if a.type == 'FILE_BROWSER':
-            params = a.spaces[0].params
-            break
-    try:
-        params
-    except UnboundLocalError:
-        #print("no browser")
-        #self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
-        return {'CANCELLED'}
-
-    if params.filename == '':
-        #print("no file selected")
-        #self.report({'ERROR_INVALID_INPUT'}, 'No file selected')
-        return {'CANCELLED'}
-    path = params.directory
-    filename = params.filename
-    return path, filename
-
-
-def setpathinbrowser(path, file):
-    '''
-    set path and file in the filebrowser
-    '''
-    scn = bpy.context.scene
-    for a in bpy.context.window.screen.areas:
-        if a.type == 'FILE_BROWSER':
-            params = a.spaces[0].params
-            break
-    try:
-        params
-    except UnboundLocalError:
-        #print("no browser")
-        self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
-        return {'CANCELLED'}
-
-    params.directory = path
-    params.filename = file
-    return path, params
-
-
-def sortlist(filelist):
-    '''
-    given a list of tuplas (path, filename) returns a list sorted by filename
-    '''
-    filelist_sorted = sorted(filelist, key=operator.itemgetter(1))
-    return filelist_sorted
-    
-# recursive load functions 
-
-def onefolder(context, default_recursive_ext):
-    '''
-    returns a list of MOVIE type files from folder selected in file browser
-    '''
-    filelist = []
-    path, filename = getfilepathfrombrowser()
-    extension = filename.rpartition(".")[2]
-    scn = context.scene
-
-    if detect_strip_type(path + filename) == 'MOVIE':
-        if default_recursive_ext == True:
-            for file in os.listdir(path):
-                if file.rpartition(".")[2] == extension:
-                    filelist.append((path, file))
-        else:
-            for file in os.listdir(path):
-                filelist.append((path, file))
-    return (filelist)
-
-def recursive(context, default_recursive_ext):
-    '''
-    returns a list of MOVIE type files recursively from file browser
-    '''
-    filelist = []
-    path = getpathfrombrowser()
-    scn = context.scene
-    for i in movieextlist:
-        if i[0] == scn.default_ext:
-            extension = i[1].rpartition(".")[2]
-    #pythonic way to magic:
-    for root, dirs, files in os.walk(path):
-        for f in files:
-            if default_recursive_ext == True:
-                if f.rpartition(".")[2] == extension:
-                    filelist.append((root, f))
-            else:
-                filelist.append((root, f))
-    return filelist   
-
-
-
-# jump to cut functions
-def triminout(strip, sin, sout):
-    start = strip.frame_start + strip.frame_offset_start
-    end = start + strip.frame_final_duration
-    if end > sin:
-        if start < sin:
-            strip.select_right_handle = False
-            strip.select_left_handle = True
-            bpy.ops.sequencer.snap(frame=sin)
-            strip.select_left_handle = False
-    if start < sout:
-        if end > sout:
-            strip.select_left_handle = False
-            strip.select_right_handle = True
-            bpy.ops.sequencer.snap(frame=sout)
-            strip.select_right_handle = False
-    return {'FINISHED'}
-
-
-#------------ random edit functions...
-
-def randompartition(lst,n,rand):
-    division = len(lst) / float(n)
-    lista = []
-    for i in range(n):	lista.append(division)
-    var=0
-    for i in range(n-1):
-        lista[i]+= random.randint(-int(rand*division),int(rand*division))
-        var+=lista[i]
-    if lista[n-1] != len(lst)-var:
-        lista[n-1] = len(lst)-var
-    random.shuffle(lista)
-    division = len(lst) / float(n)
-    count = 0
-    newlist=[]
-    for i in range(n):
-        print(lst[count : int(lista[i]-1)+count])
-        newlist.append([lst[count : int(lista[i]-1)+count]])
-        count += int(lista[i]) 
-    return newlist
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/sequencer_extra_actions/operators_extra_actions.py b/release/scripts/addons_contrib/sequencer_extra_actions/operators_extra_actions.py
deleted file mode 100644
index 9ca54c5..0000000
--- a/release/scripts/addons_contrib/sequencer_extra_actions/operators_extra_actions.py
+++ /dev/null
@@ -1,1906 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-'''
-TODO
-align strip to the left (shift-s + -lenght)
-
-'''
-
-import bpy
-
-import random
-import math
-import os, sys
-
-from bpy.props import IntProperty
-from bpy.props import FloatProperty
-from bpy.props import EnumProperty
-from bpy.props import BoolProperty
-from bpy.props import StringProperty
-
-from . import functions
-from . import exiftool
-
-
-# Initialization
-
-
-def initSceneProperties(context, scn):
-    try:
-        if context.scene.scene_initialized == True:
-            return False
-    except AttributeError:
-        pass
-
-    bpy.types.Scene.default_slide_offset = IntProperty(
-        name='Offset',
-        description='Number of frames to slide',
-        min=-250, max=250,
-        default=0)
-    scn.default_slide_offset = 0
-
-    bpy.types.Scene.default_fade_duration = IntProperty(
-        name='Duration',
-        description='Number of frames to fade',
-        min=1, max=250,
-        default=scn.render.fps)
-    scn.default_fade_duration = scn.render.fps
-
-    bpy.types.Scene.default_fade_amount = FloatProperty(
-        name='Amount',
-        description='Maximum value of fade',
-        min=0.0,
-        max=100.0,
-        default=1.0)
-    scn.default_fade_amount = 1.0
-
-    bpy.types.Scene.default_distribute_offset = IntProperty(
-        name='Offset',
-        description='Number of frames between strip start frames',
-        min=1,
-        max=250,
-        default=2)
-    scn.default_distribute_offset = 2
-
-    bpy.types.Scene.default_distribute_reverse = BoolProperty(
-        name='Reverse Order',
-        description='Reverse the order of selected strips',
-        default=False)
-    scn.default_distribute_reverse = False
-
-    bpy.types.Scene.default_proxy_suffix = StringProperty(
-        name='default proxy suffix',
-        description='default proxy filename suffix',
-        default="-25")
-    scn.default_proxy_suffix = "-25"
-
-    bpy.types.Scene.default_proxy_extension = StringProperty(
-        name='default proxy extension',
-        description='default proxy file extension',
-        default=".mkv")
-    scn.default_proxy_extension = ".mkv"
-
-    bpy.types.Scene.default_proxy_path = StringProperty(
-        name='default proxy path',
-        description='default proxy file path (relative to original file)',
-        default="")
-    scn.default_proxy_path = ""
-
-    bpy.types.Scene.default_build_25 = BoolProperty(
-        name='default_build_25',
-        description='default build_25',
-        default=True)
-    scn.default_build_25 = True
-
-    bpy.types.Scene.default_build_50 = BoolProperty(
-        name='default_build_50',
-        description='default build_50',
-        default=False)
-    scn.default_build_50 = False
-
-    bpy.types.Scene.default_build_75 = BoolProperty(
-        name='default_build_75',
-        description='default build_75',
-        default=False)
-    scn.default_build_75 = False
-
-    bpy.types.Scene.default_build_100 = BoolProperty(
-        name='default_build_100',
-        description='default build_100',
-        default=False)
-    scn.default_build_100 = False
-    
-    bpy.types.Scene.default_recursive = BoolProperty(
-        name='Recursive',
-        description='Load in recursive folders',
-        default=False)
-    scn.default_recursive = False
-    
-    bpy.types.Scene.default_recursive_ext = BoolProperty(
-        name='Recursive ext',
-        description='Load only clips with selected extension',
-        default=False)
-    scn.default_recursive_ext = False
-    
-    bpy.types.Scene.default_recursive_proxies = BoolProperty(
-        name='Recursive proxies',
-        description='Load in recursive folders + proxies',
-        default=False)
-    scn.default_recursive_proxies = False
-    
-    bpy.types.Scene.default_ext = EnumProperty(
-        items=functions.movieextdict,
-        name="ext enum",
-        default="3")
-    scn.default_ext = "3"
-    
-    bpy.types.Scene.scene_initialized = BoolProperty(
-        name='Init',
-        default=False)
-    scn.scene_initialized = True
-
-    return True
-
-   
-# TRIM TIMELINE
-class Sequencer_Extra_TrimTimeline(bpy.types.Operator):
-    bl_label = 'Trim to Timeline Content'
-    bl_idname = 'timeextra.trimtimeline'
-    bl_description = 'Automatically set start and end frames'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        scn = context.scene
-        if scn and scn.sequence_editor:
-            return scn.sequence_editor.sequences
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-
-        frame_start = 300000
-        frame_end = -300000
-        for i in seq.sequences:
-            try:
-                if i.frame_final_start < frame_start:
-                    frame_start = i.frame_final_start
-                if i.frame_final_end > frame_end:
-                    frame_end = i.frame_final_end - 1
-            except AttributeError:
-                    pass
-
-        if frame_start != 300000:
-            scn.frame_start = frame_start
-        if frame_end != -300000:
-            scn.frame_end = frame_end
-        return {'FINISHED'}
-
-
-# TRIM TIMELINE TO SELECTION
-class Sequencer_Extra_TrimTimelineToSelection(bpy.types.Operator):
-    bl_label = 'Trim to Selection'
-    bl_idname = 'timeextra.trimtimelinetoselection'
-    bl_description = 'Set start and end frames to selection'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        scn = context.scene
-        if scn and scn.sequence_editor:
-            return scn.sequence_editor.sequences
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-
-        frame_start = 300000
-        frame_end = -300000
-        for i in seq.sequences:
-            try:
-                if i.frame_final_start < frame_start and i.select == True:
-                    frame_start = i.frame_final_start
-                if i.frame_final_end > frame_end and i.select == True:
-                    frame_end = i.frame_final_end - 1
-            except AttributeError:
-                    pass
-
-        if frame_start != 300000:
-            scn.frame_start = frame_start
-        if frame_end != -300000:
-            scn.frame_end = frame_end
-        return {'FINISHED'}
-
-
-# SLIDE STRIP
-class Sequencer_Extra_SlideStrip(bpy.types.Operator):
-    bl_label = 'Slide'
-    bl_idname = 'sequencerextra.slide'
-    bl_description = 'Alter in and out points but not duration of a strip'
-    mode = EnumProperty(
-        name='Mode',
-        items=(
-        ('TOSTART', 'Current Frame to Strip Start', ''),
-        ('TOEND', 'Current Frame to Strip End', ''),
-        ('INPUT', 'Input...', '')),
-        default='INPUT',
-        options={'HIDDEN'})
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    slide_offset = IntProperty(
-        name='Offset',
-        description='Number of frames to slide',
-        min=-250, max=250,
-        default=0)
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return strip.type in ('MOVIE', 'IMAGE', 'META', 'SCENE')
-        else:
-            return False
-
-    def execute(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        cf = scn.frame_current
-
-        if self.mode == 'TOSTART':
-            sx = strip.frame_final_start - cf
-        elif self.mode == 'TOEND':
-            sx = strip.frame_final_end - cf
-        else:
-            sx = self.slide_offset
-
-        frame_end = strip.frame_start + strip.frame_duration
-        pad_left = strip.frame_final_start - strip.frame_start
-        pad_right = (frame_end - strip.frame_final_end) * -1
-
-        if sx > pad_left:
-            sx = pad_left
-        elif sx < pad_right:
-            sx = pad_right
-
-        strip.frame_start += sx
-        strip.frame_final_start -= sx
-        strip.frame_final_end -= sx
-
-        self.report({'INFO'}, 'Strip slid %d frame(s)' % (sx))
-        scn.default_slide_offset = sx
-        bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        scn = context.scene
-        initSceneProperties(context,scn)
-        self.slide_offset = scn.default_slide_offset
-        if self.mode == 'INPUT':
-            return context.window_manager.invoke_props_dialog(self)
-        else:
-            return self.execute(context)
-
-
-# SLIDE GRAB
-class Sequencer_Extra_SlideGrab(bpy.types.Operator):
-    bl_label = 'Slide Grab'
-    bl_idname = 'sequencerextra.slidegrab'
-    bl_description = 'Alter in and out points but not duration of a strip'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return strip.type in ('MOVIE', 'IMAGE', 'META', 'SCENE')
-        else:
-            return False
-
-    def execute(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-
-        diff = self.prev_x - self.x
-        self.prev_x = self.x
-        sx = int(diff / 2)
-
-        frame_end = strip.frame_start + strip.frame_duration
-        pad_left = strip.frame_final_start - strip.frame_start
-        pad_right = (frame_end - strip.frame_final_end) * -1
-
-        if sx > pad_left:
-            sx = pad_left
-        elif sx < pad_right:
-            sx = pad_right
-
-        strip.frame_start += sx
-        strip.frame_final_start -= sx
-        strip.frame_final_end -= sx
-
-    def modal(self, context, event):
-        if event.type == 'MOUSEMOVE':
-            self.x = event.mouse_x
-            self.execute(context)
-        elif event.type == 'LEFTMOUSE':
-            return {'FINISHED'}
-        elif event.type in ('RIGHTMOUSE', 'ESC'):
-            return {'CANCELLED'}
-
-        return {'RUNNING_MODAL'}
-
-    def invoke(self, context, event):
-        scn = context.scene
-        self.x = event.mouse_x
-        self.prev_x = event.mouse_x
-        self.execute(context)
-        context.window_manager.modal_handler_add(self)
-        return {'RUNNING_MODAL'}
-
-
-# FILE NAME TO STRIP NAME
-class Sequencer_Extra_FileNameToStripName(bpy.types.Operator):
-    bl_label = 'File Name to Selected Strips Name'
-    bl_idname = 'sequencerextra.striprename'
-    bl_description = 'Set strip name to input file name'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        scn = context.scene
-        if scn and scn.sequence_editor:
-            return scn.sequence_editor.sequences
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        selection = False
-        for i in seq.sequences:
-            if i.select == True:
-                if i.type == 'IMAGE' and not i.mute:
-                    selection = True
-                    i.name = i.elements[0].filename
-                if (i.type == 'SOUND' or i.type == 'MOVIE') and not i.mute:
-                    selection = True
-                    i.name = bpy.path.display_name_from_filepath(i.filepath)
-        if selection == False:
-            self.report({'ERROR_INVALID_INPUT'},
-            'No image or movie strip selected')
-            return {'CANCELLED'}
-        return {'FINISHED'}
-
-
-# NAVIGATE UP
-class Sequencer_Extra_NavigateUp(bpy.types.Operator):
-    bl_label = 'Navigate Up'
-    bl_idname = 'sequencerextra.navigateup'
-    bl_description = 'Move to Parent Timeline'
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        try:
-            if context.scene.sequence_editor.meta_stack:
-                return True
-            else:
-                return False
-        except:
-            return False
-
-    def execute(self, context):
-        if (functions.act_strip(context)):
-            strip = functions.act_strip(context)
-            seq_type = strip.type
-            if seq_type == 'META':
-                context.scene.sequence_editor.active_strip = None
-
-        bpy.ops.sequencer.meta_toggle()
-        return {'FINISHED'}
-
-
-# RIPPLE DELETE
-class Sequencer_Extra_RippleDelete(bpy.types.Operator):
-    bl_label = 'Ripple Delete'
-    bl_idname = 'sequencerextra.rippledelete'
-    bl_description = 'Delete a strip and shift back following ones'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return True
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        #strip = functions.act_strip(context)
-        for strip in context.selected_editable_sequences:
-            cut_frame = strip.frame_final_start
-            next_edit = 300000
-            bpy.ops.sequencer.select_all(action='DESELECT')
-            strip.select = True
-            bpy.ops.sequencer.delete()
-            striplist = []
-            for i in seq.sequences:
-                try:
-                    if (i.frame_final_start > cut_frame
-                    and not i.mute):
-                        if i.frame_final_start < next_edit:
-                            next_edit = i.frame_final_start
-                    if not i.mute:
-                        striplist.append(i)
-                except AttributeError:
-                        pass
-
-            if next_edit == 300000:
-                return {'FINISHED'}
-            ripple_length = next_edit - cut_frame
-            for i in range(len(striplist)):
-                str = striplist[i]
-                try:
-                    if str.frame_final_start > cut_frame:
-                        str.frame_start = str.frame_start - ripple_length
-                except AttributeError:
-                        pass
-            bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-
-# RIPPLE CUT
-class Sequencer_Extra_RippleCut(bpy.types.Operator):
-    bl_label = 'Ripple Cut'
-    bl_idname = 'sequencerextra.ripplecut'
-    bl_description = 'Move a strip to buffer and shift back following ones'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return True
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        strip = functions.act_strip(context)
-        bpy.ops.sequencer.select_all(action='DESELECT')
-        strip.select = True
-        temp_cf = scn.frame_current
-        scn.frame_current = strip.frame_final_start
-        bpy.ops.sequencer.copy()
-        scn.frame_current = temp_cf
-
-        bpy.ops.sequencerextra.rippledelete()
-        return {'FINISHED'}
-
-
-# INSERT
-class Sequencer_Extra_Insert(bpy.types.Operator):
-    bl_label = 'Insert'
-    bl_idname = 'sequencerextra.insert'
-    bl_description = 'Move active strip to current frame and shift '\
-    'forward following ones'
-    singlechannel = BoolProperty(
-    name='Single Channel',
-    default=False)
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return True
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        strip = functions.act_strip(context)
-        gap = strip.frame_final_duration
-        bpy.ops.sequencer.select_all(action='DESELECT')
-        current_frame = scn.frame_current
-
-        striplist = []
-        for i in seq.sequences:
-            try:
-                if (i.frame_final_start >= current_frame
-                and not i.mute):
-                    if self.singlechannel == True:
-                        if i.channel == strip.channel:
-                            striplist.append(i)
-                    else:
-                        striplist.append(i)
-            except AttributeError:
-                    pass
-        try:
-            bpy.ops.sequencerextra.selectcurrentframe('EXEC_DEFAULT',
-            mode='AFTER')
-        except:
-            self.report({'ERROR_INVALID_INPUT'}, 'Execution Error, '\
-            'check your Blender version')
-            return {'CANCELLED'}
-
-        for i in range(len(striplist)):
-            str = striplist[i]
-            try:
-                if str.select == True:
-                    str.frame_start += gap
-            except AttributeError:
-                    pass
-        try:
-            diff = current_frame - strip.frame_final_start
-            strip.frame_start += diff
-        except AttributeError:
-                pass
-
-        strip = functions.act_strip(context)
-        scn.frame_current += strip.frame_final_duration
-        bpy.ops.sequencer.reload()
-
-        return {'FINISHED'}
-
-
-# PLACE FROM FILE BROWSER
-class Sequencer_Extra_PlaceFromFileBrowser(bpy.types.Operator):
-    bl_label = 'Place'
-    bl_idname = 'sequencerextra.placefromfilebrowser'
-    bl_description = 'Place or insert active file from File Browser'
-    insert = BoolProperty(
-    name='Insert',
-    default=False)
-    bl_options = {'REGISTER', 'UNDO'}
-
-    def execute(self, context):
-        scn = context.scene
-        for a in context.window.screen.areas:
-            if a.type == 'FILE_BROWSER':
-                params = a.spaces[0].params
-                break
-        try:
-            params
-        except UnboundLocalError:
-            self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
-            return {'CANCELLED'}
-
-        if params.filename == '':
-            self.report({'ERROR_INVALID_INPUT'}, 'No file selected')
-            return {'CANCELLED'}
-
-        path = os.path.join(params.directory, params.filename)
-        frame = context.scene.frame_current
-        strip_type = functions.detect_strip_type(params.filename)
-
-        try:
-            if strip_type == 'IMAGE':
-                image_file = []
-                filename = {"name": params.filename}
-                image_file.append(filename)
-                f_in = scn.frame_current
-                f_out = f_in + scn.render.fps - 1
-                bpy.ops.sequencer.image_strip_add(files=image_file,
-                directory=params.directory, frame_start=f_in,
-                frame_end=f_out, relative_path=False)
-            elif strip_type == 'MOVIE':
-                bpy.ops.sequencer.movie_strip_add(filepath=path,
-                frame_start=frame, relative_path=False)
-            elif strip_type == 'SOUND':
-                bpy.ops.sequencer.sound_strip_add(filepath=path,
-                frame_start=frame, relative_path=False)
-            else:
-                self.report({'ERROR_INVALID_INPUT'}, 'Invalid file format')
-                return {'CANCELLED'}
-        except:
-            self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-            return {'CANCELLED'}
-
-        if self.insert == True:
-            try:
-                striplist = []
-                for i in bpy.context.selected_editable_sequences:
-                    if (i.select == True and i.type == "SOUND"):
-                        striplist.append(i)
-                bpy.ops.sequencerextra.insert()
-                if striplist[0]:
-                    striplist[0].frame_start = frame
-            except:
-                self.report({'ERROR_INVALID_INPUT'}, 'Execution Error, '\
-                'check your Blender version')
-                return {'CANCELLED'}
-        else:
-            strip = functions.act_strip(context)
-            scn.frame_current += strip.frame_final_duration
-            bpy.ops.sequencer.reload()
-
-        return {'FINISHED'}
-
-
-# SELECT BY TYPE
-class Sequencer_Extra_SelectAllByType(bpy.types.Operator):
-    bl_label = 'All by Type'
-    bl_idname = 'sequencerextra.select_all_by_type'
-    bl_description = 'Select all the strips of the same type'
-    type = EnumProperty(
-            name='Strip Type',
-            items=(
-            ('ACTIVE', 'Same as Active Strip', ''),
-            ('IMAGE', 'Image', ''),
-            ('META', 'Meta', ''),
-            ('SCENE', 'Scene', ''),
-            ('MOVIE', 'Movie', ''),
-            ('SOUND', 'Sound', ''),
-            ('TRANSFORM', 'Transform', ''),
-            ('COLOR', 'Color', '')),
-            default='ACTIVE',
-            )
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        scn = context.scene
-        if scn and scn.sequence_editor:
-            return scn.sequence_editor.sequences
-        else:
-            return False
-
-    def execute(self, context):
-        strip_type = self.type
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        active_strip = functions.act_strip(context)
-        if strip_type == 'ACTIVE':
-            if active_strip == None:
-                self.report({'ERROR_INVALID_INPUT'},
-                'No active strip')
-                return {'CANCELLED'}
-            strip_type = active_strip.type
-
-        striplist = []
-        for i in seq.sequences:
-            try:
-                if (i.type == strip_type
-                and not i.mute):
-                    striplist.append(i)
-            except AttributeError:
-                    pass
-        for i in range(len(striplist)):
-            str = striplist[i]
-            try:
-                str.select = True
-            except AttributeError:
-                    pass
-
-        return {'FINISHED'}
-
-
-# CURRENT-FRAME-AWARE SELECT
-class Sequencer_Extra_SelectCurrentFrame(bpy.types.Operator):
-    bl_label = 'Current-Frame-Aware Select'
-    bl_idname = 'sequencerextra.selectcurrentframe'
-    bl_description = 'Select strips according to current frame'
-    mode = EnumProperty(
-            name='Mode',
-            items=(
-            ('BEFORE', 'Before Current Frame', ''),
-            ('AFTER', 'After Current Frame', ''),
-            ('ON', 'On Current Frame', '')),
-            default='BEFORE',
-            )
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        scn = context.scene
-        if scn and scn.sequence_editor:
-            return scn.sequence_editor.sequences
-        else:
-            return False
-
-    def execute(self, context):
-        mode = self.mode
-        scn = context.scene
-        seq = scn.sequence_editor
-        cf = scn.frame_current
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-
-        if mode == 'AFTER':
-            for i in seq.sequences:
-                try:
-                    if (i.frame_final_start >= cf
-                    and not i.mute):
-                        i.select = True
-                except AttributeError:
-                        pass
-        elif mode == 'ON':
-            for i in seq.sequences:
-                try:
-                    if (i.frame_final_start <= cf
-                    and i.frame_final_end > cf
-                    and not i.mute):
-                        i.select = True
-                except AttributeError:
-                        pass
-        else:
-            for i in seq.sequences:
-                try:
-                    if (i.frame_final_end < cf
-                    and not i.mute):
-                        i.select = True
-                except AttributeError:
-                        pass
-
-        return {'FINISHED'}
-
-
-# SELECT STRIPS ON SAME CHANNEL
-class Sequencer_Extra_SelectSameChannel(bpy.types.Operator):
-    bl_label = 'Select Strips on the Same Channel'
-    bl_idname = 'sequencerextra.selectsamechannel'
-    bl_description = 'Select strips on the same channel as active one'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return True
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        bpy.ops.sequencer.select_active_side(side="LEFT")
-        bpy.ops.sequencer.select_active_side(side="RIGHT")
-
-        return {'FINISHED'}
-
-
-# OPEN IMAGE WITH EXTERNAL EDITOR
-class Sequencer_Extra_EditExternally(bpy.types.Operator):
-    bl_label = 'Open with External Editor'
-    bl_idname = 'sequencerextra.editexternally'
-    bl_description = 'Open with the default external image editor'
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return strip.type == 'IMAGE'
-        else:
-            return False
-
-    def execute(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        base_dir = bpy.path.abspath(strip.directory)
-        strip_elem = strip.strip_elem_from_frame(scn.frame_current)
-        path = base_dir + strip_elem.filename
-
-        try:
-            bpy.ops.image.external_edit(filepath=path)
-        except:
-            self.report({'ERROR_INVALID_INPUT'},
-            'Please specify an Image Editor in Preferences > File')
-            return {'CANCELLED'}
-
-        return {'FINISHED'}
-
-
-# OPEN IMAGE WITH EDITOR
-class Sequencer_Extra_Edit(bpy.types.Operator):
-    bl_label = 'Open with Editor'
-    bl_idname = 'sequencerextra.edit'
-    bl_description = 'Open with Movie Clip or Image Editor'
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return strip.type in ('MOVIE', 'IMAGE')
-        else:
-            return False
-
-    def execute(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        data_exists = False
-
-        if strip.type == 'MOVIE':
-            path = strip.filepath
-
-            for i in bpy.data.movieclips:
-                if i.filepath == path:
-                    data_exists = True
-                    data = i
-
-            if data_exists == False:
-                try:
-                    data = bpy.data.movieclips.load(filepath=path)
-                except:
-                    self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                    return {'CANCELLED'}
-
-        elif strip.type == 'IMAGE':
-            base_dir = bpy.path.abspath(strip.directory)
-            strip_elem = strip.strip_elem_from_frame(scn.frame_current)
-            elem_name = strip_elem.filename
-            path = base_dir + elem_name
-
-            for i in bpy.data.images:
-                if i.filepath == path:
-                    data_exists = True
-                    data = i
-
-            if data_exists == False:
-                try:
-                    data = bpy.data.images.load(filepath=path)
-                except:
-                    self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                    return {'CANCELLED'}
-
-        if strip.type == 'MOVIE':
-            for a in context.window.screen.areas:
-                if a.type == 'CLIP_EDITOR':
-                    a.spaces[0].clip = data
-        elif strip.type == 'IMAGE':
-            for a in context.window.screen.areas:
-                if a.type == 'IMAGE_EDITOR':
-                    a.spaces[0].image = data
-
-        return {'FINISHED'}
-
-
-# COPY STRIP PROPERTIES
-class Sequencer_Extra_CopyProperties(bpy.types.Operator):
-    bl_label = 'Copy Properties'
-    bl_idname = 'sequencerextra.copyproperties'
-    bl_description = 'Copy properties of active strip to selected strips'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    prop = EnumProperty(
-    name='Property',
-    items=[
-    # COMMON
-    ('name', 'Name', ''),
-    ('blend_alpha', 'Opacity', ''),
-    ('blend_type', 'Blend Mode', ''),
-    ('animation_offset', 'Input - Trim Duration', ''),
-    # NON-SOUND
-    ('use_translation', 'Input - Image Offset', ''),
-    ('crop', 'Input - Image Crop', ''),
-    ('proxy', 'Proxy / Timecode', ''),
-    ('strobe', 'Filter - Strobe', ''),
-    ('color_multiply', 'Filter - Multiply', ''),
-    ('color_saturation', 'Filter - Saturation', ''),
-    ('deinterlace', 'Filter - De-Interlace', ''),
-    ('flip', 'Filter - Flip', ''),
-    ('float', 'Filter - Convert Float', ''),
-    ('alpha_mode', 'Filter - Alpha Mode', ''),
-    ('reverse', 'Filter - Backwards', ''),
-    # SOUND
-    ('pan', 'Sound - Pan', ''),
-    ('pitch', 'Sound - Pitch', ''),
-    ('volume', 'Sound - Volume', ''),
-    ('cache', 'Sound - Caching', ''),
-    # IMAGE
-    ('directory', 'Image - Directory', ''),
-    # MOVIE
-    ('mpeg_preseek', 'Movie - MPEG Preseek', ''),
-    ('stream_index', 'Movie - Stream Index', ''),
-    # WIPE
-    ('wipe', 'Effect - Wipe', ''),
-    # TRANSFORM
-    ('transform', 'Effect - Transform', ''),
-    # COLOR
-    ('color', 'Effect - Color', ''),
-    # SPEED
-    ('speed', 'Effect - Speed', ''),
-    # MULTICAM
-    ('multicam_source', 'Effect - Multicam Source', ''),
-    # EFFECT
-    ('effect_fader', 'Effect - Effect Fader', ''),
-    ],
-    default='blend_alpha')
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return True
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        strip = functions.act_strip(context)
-
-        for i in seq.sequences:
-            if (i.select == True and not i.mute):
-                try:
-                    if self.prop == 'name':
-                        i.name = strip.name
-                    elif self.prop == 'blend_alpha':
-                        i.blend_alpha = strip.blend_alpha
-                    elif self.prop == 'blend_type':
-                        i.blend_type = strip.blend_type
-                    elif self.prop == 'animation_offset':
-                        i.animation_offset_start = strip.animation_offset_start
-                        i.animation_offset_end = strip.animation_offset_end
-                    elif self.prop == 'use_translation':
-                        i.use_translation = strip.use_translation
-                        i.transform.offset_x = strip.transform.offset_x
-                        i.transform.offset_y = strip.transform.offset_y
-                    elif self.prop == 'crop':
-                        i.use_crop = strip.use_crop
-                        i.crop.min_x = strip.crop.min_x
-                        i.crop.min_y = strip.crop.min_y
-                        i.crop.max_x = strip.crop.max_x
-                        i.crop.max_y = strip.crop.max_y
-                    elif self.prop == 'proxy':
-                        i.use_proxy = strip.use_proxy
-                        i.use_proxy_custom_file = strip.use_proxy_custom_file
-                        p = strip.use_proxy_custom_directory  # pep80
-                        i.use_proxy_custom_directory = p
-                        i.proxy.filepath = strip.proxy.filepath
-                        i.proxy.directory = strip.proxy.directory
-                        i.proxy.build_25 = strip.proxy.build_25
-                        i.proxy.build_50 = strip.proxy.build_50
-                        i.proxy.build_75 = strip.proxy.build_75
-                        i.proxy.build_100 = strip.proxy.build_100
-                        i.proxy.quality = strip.proxy.quality
-                        i.proxy.timecode = strip.proxy.timecode
-                    elif self.prop == 'strobe':
-                        i.strobe = strip.strobe
-                    elif self.prop == 'color_multiply':
-                        i.color_multiply = strip.color_multiply
-                    elif self.prop == 'color_saturation':
-                        i.color_saturation = strip.color_saturation
-                    elif self.prop == 'deinterlace':
-                        i.use_deinterlace = strip.use_deinterlace
-                    elif self.prop == 'flip':
-                        i.use_flip_x = strip.use_flip_x
-                        i.use_flip_y = strip.use_flip_y
-                    elif self.prop == 'float':
-                        i.use_float = strip.use_float
-                    elif self.prop == 'alpha_mode':
-                        i.alpha_mode = strip.alpha_mode
-                    elif self.prop == 'reverse':
-                        i.use_reverse_frames = strip.use_reverse_frames
-                    elif self.prop == 'pan':
-                        i.pan = strip.pan
-                    elif self.prop == 'pitch':
-                        i.pitch = strip.pitch
-                    elif self.prop == 'volume':
-                        i.volume = strip.volume
-                    elif self.prop == 'cache':
-                        i.use_memory_cache = strip.use_memory_cache
-                    elif self.prop == 'directory':
-                        i.directory = strip.directory
-                    elif self.prop == 'mpeg_preseek':
-                        i.mpeg_preseek = strip.mpeg_preseek
-                    elif self.prop == 'stream_index':
-                        i.stream_index = strip.stream_index
-                    elif self.prop == 'wipe':
-                        i.angle = strip.angle
-                        i.blur_width = strip.blur_width
-                        i.direction = strip.direction
-                        i.transition_type = strip.transition_type
-                    elif self.prop == 'transform':
-                        i.interpolation = strip.interpolation
-                        i.rotation_start = strip.rotation_start
-                        i.use_uniform_scale = strip.use_uniform_scale
-                        i.scale_start_x = strip.scale_start_x
-                        i.scale_start_y = strip.scale_start_y
-                        i.translation_unit = strip.translation_unit
-                        i.translate_start_x = strip.translate_start_x
-                        i.translate_start_y = strip.translate_start_y
-                    elif self.prop == 'color':
-                        i.color = strip.color
-                    elif self.prop == 'speed':
-                        i.use_default_fade = strip.use_default_fade
-                        i.speed_factor = strip.speed_factor
-                        i.use_as_speed = strip.use_as_speed
-                        i.scale_to_length = strip.scale_to_length
-                        i.multiply_speed = strip.multiply_speed
-                        i.use_frame_blend = strip.use_frame_blend
-                    elif self.prop == 'multicam_source':
-                        i.multicam_source = strip.multicam_source
-                    elif self.prop == 'effect_fader':
-                        i.use_default_fade = strip.use_default_fade
-                        i.effect_fader = strip.effect_fader
-                except:
-                    pass
-
-        bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-
-# FADE IN AND OUT
-class Sequencer_Extra_FadeInOut(bpy.types.Operator):
-    bl_idname = 'sequencerextra.fadeinout'
-    bl_label = 'Fade...'
-    bl_description = 'Fade volume or opacity of active strip'
-    mode = EnumProperty(
-            name='Direction',
-            items=(
-            ('IN', 'Fade In...', ''),
-            ('OUT', 'Fade Out...', ''),
-            ('INOUT', 'Fade In and Out...', '')),
-            default='IN',
-            )
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    fade_duration = IntProperty(
-        name='Duration',
-        description='Number of frames to fade',
-        min=1, max=250,
-        default=25)
-    fade_amount = FloatProperty(
-        name='Amount',
-        description='Maximum value of fade',
-        min=0.0,
-        max=100.0,
-        default=1.0)
-
-    @classmethod
-    def poll(cls, context):
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return True
-        else:
-            return False
-
-    def execute(self, context):
-        seq = context.scene.sequence_editor
-        scn = context.scene
-        strip = seq.active_strip
-        tmp_current_frame = context.scene.frame_current
-
-        if strip.type == 'SOUND':
-            if(self.mode) == 'OUT':
-                scn.frame_current = strip.frame_final_end - self.fade_duration
-                strip.volume = self.fade_amount
-                strip.keyframe_insert('volume')
-                scn.frame_current = strip.frame_final_end
-                strip.volume = 0
-                strip.keyframe_insert('volume')
-            elif(self.mode) == 'INOUT':
-                scn.frame_current = strip.frame_final_start
-                strip.volume = 0
-                strip.keyframe_insert('volume')
-                scn.frame_current += self.fade_duration
-                strip.volume = self.fade_amount
-                strip.keyframe_insert('volume')
-                scn.frame_current = strip.frame_final_end - self.fade_duration
-                strip.volume = self.fade_amount
-                strip.keyframe_insert('volume')
-                scn.frame_current = strip.frame_final_end
-                strip.volume = 0
-                strip.keyframe_insert('volume')
-            else:
-                scn.frame_current = strip.frame_final_start
-                strip.volume = 0
-                strip.keyframe_insert('volume')
-                scn.frame_current += self.fade_duration
-                strip.volume = self.fade_amount
-                strip.keyframe_insert('volume')
-
-        else:
-            if(self.mode) == 'OUT':
-                scn.frame_current = strip.frame_final_end - self.fade_duration
-                strip.blend_alpha = self.fade_amount
-                strip.keyframe_insert('blend_alpha')
-                scn.frame_current = strip.frame_final_end
-                strip.blend_alpha = 0
-                strip.keyframe_insert('blend_alpha')
-            elif(self.mode) == 'INOUT':
-                scn.frame_current = strip.frame_final_start
-                strip.blend_alpha = 0
-                strip.keyframe_insert('blend_alpha')
-                scn.frame_current += self.fade_duration
-                strip.blend_alpha = self.fade_amount
-                strip.keyframe_insert('blend_alpha')
-                scn.frame_current = strip.frame_final_end - self.fade_duration
-                strip.blend_alpha = self.fade_amount
-                strip.keyframe_insert('blend_alpha')
-                scn.frame_current = strip.frame_final_end
-                strip.blend_alpha = 0
-                strip.keyframe_insert('blend_alpha')
-            else:
-                scn.frame_current = strip.frame_final_start
-                strip.blend_alpha = 0
-                strip.keyframe_insert('blend_alpha')
-                scn.frame_current += self.fade_duration
-                strip.blend_alpha = self.fade_amount
-                strip.keyframe_insert('blend_alpha')
-
-        scn.frame_current = tmp_current_frame
-
-        scn.default_fade_duration = self.fade_duration
-        scn.default_fade_amount = self.fade_amount
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        scn = context.scene
-        initSceneProperties(context, scn)
-        self.fade_duration = scn.default_fade_duration
-        self.fade_amount = scn.default_fade_amount
-        return context.window_manager.invoke_props_dialog(self)
-
-
-# EXTEND TO FILL
-class Sequencer_Extra_ExtendToFill(bpy.types.Operator):
-    bl_idname = 'sequencerextra.extendtofill'
-    bl_label = 'Extend to Fill'
-    bl_description = 'Extend active strip forward to fill adjacent space'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return True
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        strip = functions.act_strip(context)
-        chn = strip.channel
-        stf = strip.frame_final_end
-        enf = 300000
-
-        for i in seq.sequences:
-            ffs = i.frame_final_start
-            if (i.channel == chn and ffs > stf):
-                if ffs < enf:
-                    enf = ffs
-        if enf == 300000 and stf < scn.frame_end:
-            enf = scn.frame_end
-
-        if enf == 300000 or enf == stf:
-            self.report({'ERROR_INVALID_INPUT'}, 'Unable to extend')
-            return {'CANCELLED'}
-        else:
-            strip.frame_final_end = enf
-
-        bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-
-# DISTRIBUTE
-class Sequencer_Extra_Distribute(bpy.types.Operator):
-    bl_idname = 'sequencerextra.distribute'
-    bl_label = 'Distribute...'
-    bl_description = 'Evenly distribute selected strips'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        scn = context.scene
-        if scn and scn.sequence_editor:
-            return scn.sequence_editor.sequences
-        else:
-            return False
-
-    def execute(self, context):
-        scn = context.scene
-        seq = scn.sequence_editor
-        seq_all = scn.sequence_editor
-        meta_level = len(seq.meta_stack)
-        if meta_level > 0:
-            seq = seq.meta_stack[meta_level - 1]
-        seq_list = {}
-        first_start = 300000
-        item_num = 0
-        for i in seq.sequences:
-            if i.select == True:
-                seq_list[i.frame_start] = i.name
-                item_num += 1
-                if i.frame_start < first_start:
-                    first_start = i.frame_start
-        n = item_num - 1
-        if(self.distribute_reverse):
-            for key in sorted(seq_list.keys()):
-                dest = first_start + (n * self.distribute_offset)
-                seq_all.sequences_all[str(seq_list[key])].frame_start = dest
-                n -= 1
-        else:
-            for key in sorted(seq_list.keys(), reverse=True):
-                dest = first_start + (n * self.distribute_offset)
-                seq_all.sequences_all[str(seq_list[key])].frame_start = dest
-                n -= 1
-
-        scn.default_distribute_offset = self.distribute_offset
-        scn.default_distribute_reverse = self.distribute_reverse
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        scn = context.scene
-        initSceneProperties(context, scn)
-        self.distribute_offset = scn.default_distribute_offset
-        self.distribute_reverse = scn.default_distribute_reverse
-        return context.window_manager.invoke_props_dialog(self)
-
-
-# SKIP ONE SECOND
-class Sequencer_Extra_FrameSkip(bpy.types.Operator):
-    bl_label = 'Skip One Second'
-    bl_idname = 'screenextra.frame_skip'
-    bl_description = 'Skip through the Timeline by one-second increments'
-    bl_options = {'REGISTER', 'UNDO'}
-    back = BoolProperty(
-        name='Back',
-        default=False)
-
-    def execute(self, context):
-        one_second = bpy.context.scene.render.fps
-        if self.back == True:
-            one_second *= -1
-        bpy.ops.screen.frame_offset(delta=one_second)
-        return {'FINISHED'}
-
-
-# JOG/SHUTTLE
-class Sequencer_Extra_JogShuttle(bpy.types.Operator):
-    bl_label = 'Jog/Shuttle'
-    bl_idname = 'sequencerextra.jogshuttle'
-    bl_description = 'Jog through current sequence'
-
-    def execute(self, context):
-        scn = context.scene
-        start_frame = scn.frame_start
-        end_frame = scn.frame_end
-        duration = end_frame - start_frame
-        diff = self.x - self.init_x
-        diff /= 5
-        diff = int(diff)
-        extended_frame = diff + (self.init_current_frame - start_frame)
-        looped_frame = extended_frame % (duration + 1)
-        target_frame = start_frame + looped_frame
-        context.scene.frame_current = target_frame
-
-    def modal(self, context, event):
-        if event.type == 'MOUSEMOVE':
-            self.x = event.mouse_x
-            self.execute(context)
-        elif event.type == 'LEFTMOUSE':
-            return {'FINISHED'}
-        elif event.type in ('RIGHTMOUSE', 'ESC'):
-            return {'CANCELLED'}
-
-        return {'RUNNING_MODAL'}
-
-    def invoke(self, context, event):
-        scn = context.scene
-        self.x = event.mouse_x
-        self.init_x = self.x
-        self.init_current_frame = scn.frame_current
-        self.execute(context)
-        context.window_manager.modal_handler_add(self)
-        return {'RUNNING_MODAL'}
-
-
-# OPEN IN MOVIE CLIP EDITOR FROM FILE BROWSER
-class Clip_Extra_OpenFromFileBrowser(bpy.types.Operator):
-    bl_label = 'Open from File Browser'
-    bl_idname = 'clipextra.openfromfilebrowser'
-    bl_description = 'Load a Movie or Image Sequence from File Browser'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    def execute(self, context):
-        for a in context.window.screen.areas:
-            if a.type == 'FILE_BROWSER':
-                params = a.spaces[0].params
-                break
-        try:
-            params
-        except:
-            self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
-            return {'CANCELLED'}
-
-        if params.filename == '':
-            self.report({'ERROR_INVALID_INPUT'}, 'No file selected')
-            return {'CANCELLED'}
-
-        strip = functions.act_strip(context)
-        path = params.directory + params.filename
-        strip_type = functions.detect_strip_type(params.filename)
-        data_exists = False
-
-        if strip_type in ('MOVIE', 'IMAGE'):
-            for i in bpy.data.movieclips:
-                if i.filepath == path:
-                    data_exists = True
-                    data = i
-
-            if data_exists == False:
-                try:
-                    data = bpy.data.movieclips.load(filepath=path)
-                except:
-                    self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                    return {'CANCELLED'}
-        else:
-            self.report({'ERROR_INVALID_INPUT'}, 'Invalid file format')
-            return {'CANCELLED'}
-
-        for a in context.window.screen.areas:
-            if a.type == 'CLIP_EDITOR':
-                a.spaces[0].clip = data
-
-        return {'FINISHED'}
-
-
-# OPEN IN MOVIE CLIP EDITOR FROM SEQUENCER
-class Clip_Extra_OpenActiveStrip(bpy.types.Operator):
-    bl_label = 'Open Active Strip'
-    bl_idname = 'clipextra.openactivestrip'
-    bl_description = 'Load a Movie or Image Sequence from Sequence Editor'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        scn = context.scene
-        strip = functions.act_strip(context)
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return strip.type in ('MOVIE', 'IMAGE')
-        else:
-            return False
-
-    def execute(self, context):
-        strip = functions.act_strip(context)
-        data_exists = False
-
-        if strip.type == 'MOVIE':
-            path = strip.filepath
-        elif strip.type == 'IMAGE':
-            base_dir = bpy.path.relpath(strip.directory)
-            filename = strip.elements[0].filename
-            path = base_dir + '/' + filename
-        else:
-            self.report({'ERROR_INVALID_INPUT'}, 'Invalid file format')
-            return {'CANCELLED'}
-
-        for i in bpy.data.movieclips:
-            if i.filepath == path:
-                data_exists = True
-                data = i
-        if data_exists == False:
-            try:
-                data = bpy.data.movieclips.load(filepath=path)
-            except:
-                self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                return {'CANCELLED'}
-
-        for a in context.window.screen.areas:
-            if a.type == 'CLIP_EDITOR':
-                a.spaces[0].clip = data
-
-        return {'FINISHED'}
-
-
-# PLACE FROM FILE BROWSER WITH PROXY
-class Sequencer_Extra_PlaceFromFileBrowserProxy(bpy.types.Operator):
-    bl_label = 'Place'
-    bl_idname = 'sequencerextra.placefromfilebrowserproxy'
-    bl_description = 'Place or insert active file from File Browser, '\
-    'and add proxy file with according suffix and extension'
-    insert = BoolProperty(name='Insert', default=False)
-    build_25 = BoolProperty(name='default_build_25',
-        description='default build_25',
-        default=True)
-    build_50 = BoolProperty(name='default_build_50',
-        description='default build_50',
-        default=True)
-    build_75 = BoolProperty(name='default_build_75',
-        description='default build_75',
-        default=True)
-    build_100 = BoolProperty(name='default_build_100',
-        description='default build_100',
-        default=True)
-    proxy_suffix = StringProperty(
-        name='default proxy suffix',
-        description='default proxy filename suffix',
-        default="-25")
-    proxy_extension = StringProperty(
-        name='default proxy extension',
-        description='default proxy extension',
-        default=".mkv")
-    proxy_path = StringProperty(
-        name='default proxy path',
-        description='default proxy path',
-        default="")
-
-    bl_options = {'REGISTER', 'UNDO'}
-
-    def invoke(self, context, event):
-        scn = context.scene
-        initSceneProperties(context, scn)
-        self.build_25 = scn.default_build_25
-        self.build_50 = scn.default_build_50
-        self.build_75 = scn.default_build_75
-        self.build_100 = scn.default_build_100
-        self.proxy_suffix = scn.default_proxy_suffix
-        self.proxy_extension = scn.default_proxy_extension
-        self.proxy_path = scn.default_proxy_path
-
-        return context.window_manager.invoke_props_dialog(self)
-
-    def execute(self, context):
-        scn = context.scene
-        for a in context.window.screen.areas:
-            if a.type == 'FILE_BROWSER':
-                params = a.spaces[0].params
-                break
-        try:
-            params
-        except UnboundLocalError:
-            self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
-            return {'CANCELLED'}
-
-        if params.filename == '':
-            self.report({'ERROR_INVALID_INPUT'}, 'No file selected (proxy)')
-            return {'CANCELLED'}
-        path = os.path.join(params.directory, params.filename)
-        frame = context.scene.frame_current
-        strip_type = functions.detect_strip_type(params.filename)
-
-        try:
-            if strip_type == 'IMAGE':
-                image_file = []
-                filename = {"name": params.filename}
-                image_file.append(filename)
-                f_in = scn.frame_current
-                f_out = f_in + scn.render.fps - 1
-                bpy.ops.sequencer.image_strip_add(files=image_file,
-                directory=params.directory, frame_start=f_in,
-                frame_end=f_out, relative_path=False)
-            elif strip_type == 'MOVIE':
-                bpy.ops.sequencer.movie_strip_add(filepath=path,
-                frame_start=frame, relative_path=False)
-
-                strip = functions.act_strip(context)
-                strip.use_proxy = True
-
-                # check if proxy exists, otherwise, uncheck proxy custom file
-                proxy_filepath = params.directory + self.proxy_path
-                proxy_filename = params.filename.rpartition(".")[0] + \
-                self.proxy_suffix + self.proxy_extension
-                proxypath = os.path.join(proxy_filepath, proxy_filename)
-                strip.proxy.build_25 = self.build_25
-                strip.proxy.build_50 = self.build_50
-                strip.proxy.build_75 = self.build_75
-                strip.proxy.build_100 = self.build_100
-                #print("----------------", proxypath)
-                if os.path.isfile(proxypath):
-                    strip.use_proxy_custom_file = True
-                    strip.proxy.filepath = proxypath
-
-            elif strip_type == 'SOUND':
-                bpy.ops.sequencer.sound_strip_add(filepath=path,
-                frame_start=frame, relative_path=False)
-            else:
-                self.report({'ERROR_INVALID_INPUT'}, 'Invalid file format')
-                return {'CANCELLED'}
-
-        except:
-            self.report({'ERROR_INVALID_INPUT'}, 'Error loading file (proxy)')
-            return {'CANCELLED'}
-
-        scn.default_proxy_suffix = self.proxy_suffix
-        scn.default_proxy_extension = self.proxy_extension
-        scn.default_proxy_path = self.proxy_path
-        scn.default_build_25 = self.build_25
-        scn.default_build_50 = self.build_50
-        scn.default_build_75 = self.build_75
-        scn.default_build_100 = self.build_100
-
-        if self.insert == True:
-            try:
-                bpy.ops.sequencerextra.insert()
-            except:
-                self.report({'ERROR_INVALID_INPUT'}, 'Execution Error, '\
-                'check your Blender version')
-                return {'CANCELLED'}
-        else:
-            strip = functions.act_strip(context)
-            scn.frame_current += strip.frame_final_duration
-            bpy.ops.sequencer.reload()
-
-        return {'FINISHED'}
-
-
-# OPEN IMAGE WITH EDITOR AND create movie clip strip
-class Sequencer_Extra_CreateMovieclip(bpy.types.Operator):
-    bl_label = 'Create a Movieclip from selected strip'
-    bl_idname = 'sequencerextra.createmovieclip'
-    bl_description = 'Create a Movieclip strip from a MOVIE or IMAGE strip'
-
-    """
-    When a movie or image strip is selected, this operator creates a movieclip
-    or find the correspondent movieclip that already exists for this footage,
-    and add a VSE clip strip with same cuts the original strip has.
-    It can convert movie strips and image sequences, both with hard cuts or
-    soft cuts.
-    """
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return strip.type in ('MOVIE', 'IMAGE')
-        else:
-            return False
-
-    def execute(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-
-        if strip.type == 'MOVIE':
-            #print("movie", strip.frame_start)
-            path = strip.filepath
-            #print(path)
-            data_exists = False
-            for i in bpy.data.movieclips:
-                if i.filepath == path:
-                    data_exists = True
-                    data = i
-            newstrip = None
-            if data_exists == False:
-                try:
-                    data = bpy.data.movieclips.load(filepath=path)
-                    newstrip = bpy.ops.sequencer.movieclip_strip_add(\
-                        replace_sel=True, overlap=False, clip=data.name)
-                    newstrip = functions.act_strip(context)
-                    newstrip.frame_start = strip.frame_start\
-                        - strip.animation_offset_start
-                    tin = strip.frame_offset_start + strip.frame_start
-                    tout = tin + strip.frame_final_duration
-                    #print(newstrip.frame_start, strip.frame_start, tin, tout)
-                    functions.triminout(newstrip, tin, tout)
-                except:
-                    self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                    return {'CANCELLED'}
-
-            else:
-                try:
-                    newstrip = bpy.ops.sequencer.movieclip_strip_add(\
-                        replace_sel=True, overlap=False, clip=data.name)
-                    newstrip = functions.act_strip(context)
-                    newstrip.frame_start = strip.frame_start\
-                        - strip.animation_offset_start
-                    # i need to declare the strip this way in order
-                    # to get triminout() working
-                    clip = bpy.context.scene.sequence_editor.sequences[\
-                        newstrip.name]
-                    # i cannot change these movie clip attributes via scripts
-                    # but it works in the python console...
-                    #clip.animation_offset_start = strip.animation.offset_start
-                    #clip.animation_offset_end = strip.animation.offset_end
-                    #clip.frame_final_duration = strip.frame_final_duration
-                    tin = strip.frame_offset_start + strip.frame_start
-                    tout = tin + strip.frame_final_duration
-                    #print(newstrip.frame_start, strip.frame_start, tin, tout)
-                    functions.triminout(clip, tin, tout)
-                except:
-                    self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                    return {'CANCELLED'}
-
-        elif strip.type == 'IMAGE':
-            #print("image")
-            base_dir = bpy.path.abspath(strip.directory)
-            scn.frame_current = strip.frame_start -\
-                strip.animation_offset_start
-            # searching for the first frame of the sequencer. This is mandatory
-            # for hard cutted sequence strips to be correctly converted,
-            # avoiding to create a new movie clip if not needed
-            filename = sorted(os.listdir(base_dir))[0]
-            path = os.path.join(base_dir, filename)
-            #print(path)
-            data_exists = False
-            for i in bpy.data.movieclips:
-                #print(i.filepath, path)
-                if i.filepath == path:
-                    data_exists = True
-                    data = i
-            #print(data_exists)
-            if data_exists == False:
-                try:
-                    data = bpy.data.movieclips.load(filepath=path)
-                    newstrip = bpy.ops.sequencer.movieclip_strip_add(\
-                        replace_sel=True, overlap=False,\
-                        clip=data.name)
-                    newstrip = functions.act_strip(context)
-                    newstrip.frame_start = strip.frame_start\
-                        - strip.animation_offset_start
-                    clip = bpy.context.scene.sequence_editor.sequences[\
-                    newstrip.name]
-                    tin = strip.frame_offset_start + strip.frame_start
-                    tout = tin + strip.frame_final_duration
-                    #print(newstrip.frame_start, strip.frame_start, tin, tout)
-                    functions.triminout(clip, tin, tout)
-                except:
-                    self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                    return {'CANCELLED'}
-
-            else:
-                try:
-                    newstrip = bpy.ops.sequencer.movieclip_strip_add(\
-                        replace_sel=True, overlap=False, clip=data.name)
-                    newstrip = functions.act_strip(context)
-                    newstrip.frame_start = strip.frame_start\
-                        - strip.animation_offset_start
-                    # need to declare the strip this way in order
-                    # to get triminout() working
-                    clip = bpy.context.scene.sequence_editor.sequences[\
-                    newstrip.name]
-                    # cannot change this atributes via scripts...
-                    # but it works in the python console...
-                    #clip.animation_offset_start = strip.animation.offset_start
-                    #clip.animation_offset_end = strip.animation.offset_end
-                    #clip.frame_final_duration = strip.frame_final_duration
-                    tin = strip.frame_offset_start + strip.frame_start
-                    tout = tin + strip.frame_final_duration
-                    #print(newstrip.frame_start, strip.frame_start, tin, tout)
-                    functions.triminout(clip, tin, tout)
-                except:
-                    self.report({'ERROR_INVALID_INPUT'}, 'Error loading file')
-                    return {'CANCELLED'}
-
-        # show the new clip in a movie clip editor, if available.
-        if strip.type == 'MOVIE' or 'IMAGE':
-            for a in context.window.screen.areas:
-                if a.type == 'CLIP_EDITOR':
-                    a.spaces[0].clip = data
-
-        return {'FINISHED'}
-        
-        
-# RECURSIVE LOADER
-
-class Sequencer_Extra_RecursiveLoader(bpy.types.Operator):
-    bl_idname = "sequencerextra.recursiveload"
-    bl_label = "recursive load"
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    default_recursive = BoolProperty(
-        name='recursive',
-        description='Load in recursive folders',
-        default=False)
-        
-    default_recursive_ext = BoolProperty(
-        name='select by extension',
-        description='Load by extension',
-        default=False)
-        
-    default_ext = EnumProperty(
-        items=functions.movieextdict,
-        name="extension",
-        default="3")
-        
-    default_recursive_proxies = BoolProperty(
-        name='use proxies',
-        description='Load in recursive folders',
-        default=False)
-    build_25 = BoolProperty(name='default_build_25',
-        description='default build_25',
-        default=True)
-    build_50 = BoolProperty(name='default_build_50',
-        description='default build_50',
-        default=True)
-    build_75 = BoolProperty(name='default_build_75',
-        description='default build_75',
-        default=True)
-    build_100 = BoolProperty(name='default_build_100',
-        description='default build_100',
-        default=True)
-    proxy_suffix = StringProperty(
-        name='default proxy suffix',
-        description='default proxy filename suffix',
-        default="-25")
-    proxy_extension = StringProperty(
-        name='default proxy extension',
-        description='default proxy extension',
-        default=".mkv")
-    proxy_path = StringProperty(
-        name='default proxy path',
-        description='default proxy path',
-        default="")
-    
-       
-    
-    @classmethod
-    def poll(self, context):
-        scn = context.scene
-        if scn and scn.sequence_editor:
-            return (scn.sequence_editor)
-        else:
-            return False
-        
-    def invoke(self, context, event):
-        scn = context.scene
-        initSceneProperties(context, scn)
-        self.build_25 = scn.default_build_25
-        self.build_50 = scn.default_build_50
-        self.build_75 = scn.default_build_75
-        self.build_100 = scn.default_build_100
-        self.proxy_suffix = scn.default_proxy_suffix
-        self.proxy_extension = scn.default_proxy_extension
-        self.proxy_path = scn.default_proxy_path
-        self.recursive = scn.default_recursive
-        self.recursive_ext = scn.default_recursive_ext
-        self.recursive_proxies = scn.default_recursive_proxies
-        self.ext = scn.default_ext 
-        
-        return context.window_manager.invoke_props_dialog(self)  
-        
-    def loader(self, context, filelist):
-        scn = context.scene
-        if filelist:
-            for i in filelist:
-                functions.setpathinbrowser(i[0], i[1])
-                try:
-                    if self.default_recursive_proxies:
-                        bpy.ops.sequencerextra.placefromfilebrowserproxy(
-                            proxy_suffix=self.proxy_suffix,
-                            proxy_extension=self.proxy_extension,
-                            proxy_path=self.proxy_path,
-                            build_25=self.build_25,
-                            build_50=self.build_50,
-                            build_75=self.build_75,
-                            build_100=self.build_100)
-                    else:
-                        bpy.ops.sequencerextra.placefromfilebrowser()
-                except:
-                    print("Error loading file (recursive loader error): ", i[1])
-                    functions.add_marker(context, i[1])
-                    #self.report({'ERROR_INVALID_INPUT'}, 'Error loading file ')
-                    pass
-
-
-    def execute(self, context):
-        scn = context.scene
-        initSceneProperties(context, scn)
-        if scn["default_recursive"] == True:
-            self.loader(context, functions.sortlist(\
-            functions.recursive(context, self.default_recursive_ext)))
-        else:
-            self.loader(context, functions.sortlist(functions.onefolder(\
-            context, self.default_recursive_ext)))
-        return {'FINISHED'}
-
-
-# READ EXIF DATA
-class Sequencer_Extra_ReadExifData(bpy.types.Operator):
-    # load exifdata from strip to scene['metadata'] property
-    bl_label = 'Read EXIF Data'
-    bl_idname = 'sequencerextra.read_exif'
-    bl_description = 'Load exifdata from strip to metadata property in scene'
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(self, context):
-        strip = functions.act_strip(context)
-        scn = context.scene
-        if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return (strip.type == 'IMAGE' or 'MOVIE')
-        else:
-            return False
-
-    def execute(self, context):
-        try:
-            exiftool.ExifTool().start()
-        except:
-            self.report({'ERROR_INVALID_INPUT'},
-            'exiftool not found in PATH')
-            return {'CANCELLED'}
-
-        def getexifdata(strip):
-            def getlist(lista):
-                for root, dirs, files in os.walk(path):
-                    for f in files:
-                        if "." + f.rpartition(".")[2].lower() \
-                            in functions.imb_ext_image:
-                            lista.append(f)
-                        #if "."+f.rpartition(".")[2] in imb_ext_movie:
-                        #    lista.append(f)
-                strip.elements
-                lista.sort()
-                return lista
-
-            def getexifvalues(lista):
-                metadata = []
-                with exiftool.ExifTool() as et:
-                    try:
-                        metadata = et.get_metadata_batch(lista)
-                    except UnicodeDecodeError as Err:
-                        print(Err)
-                return metadata
-            if strip.type == "IMAGE":
-                path = bpy.path.abspath(strip.directory)
-            if strip.type == "MOVIE":
-                path = bpy.path.abspath(strip.filepath.rpartition("/")[0])
-            os.chdir(path)
-            #get a list of files
-            lista = []
-            for i in strip.elements:
-                lista.append(i.filename)
-            return getexifvalues(lista)
-
-        sce = bpy.context.scene
-        frame = sce.frame_current
-        text = bpy.context.active_object
-        strip = context.scene.sequence_editor.active_strip
-        sce['metadata'] = getexifdata(strip)
-        return {'FINISHED'}
diff --git a/release/scripts/addons_contrib/sequencer_extra_actions/ui.py b/release/scripts/addons_contrib/sequencer_extra_actions/ui.py
deleted file mode 100644
index 15d9fa1..0000000
--- a/release/scripts/addons_contrib/sequencer_extra_actions/ui.py
+++ /dev/null
@@ -1,189 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-
-
-# UI
-class SEQUENCER_EXTRA_MT_input(bpy.types.Menu):
-    bl_label = "Input"
-
-    def draw(self, context):
-        self.layout.operator_context = 'INVOKE_REGION_WIN'
-        self.layout.operator('sequencerextra.striprename',
-        text='File Name to Strip Name', icon='PLUGIN')
-        self.layout.operator('sequencerextra.editexternally',
-        text='Open with External Editor', icon='PLUGIN')
-        self.layout.operator('sequencerextra.edit',
-        text='Open with Editor', icon='PLUGIN')
-        self.layout.operator('sequencerextra.createmovieclip',
-        text='Create Movieclip strip', icon='PLUGIN')
-
-
-def sequencer_add_menu_func(self, context):
-    self.layout.operator('sequencerextra.recursiveload', 
-    text='recursive load from browser', icon='PLUGIN')
-    self.layout.separator()
-
-
-def sequencer_select_menu_func(self, context):
-    self.layout.operator_menu_enum('sequencerextra.select_all_by_type',
-    'type', text='All by Type', icon='PLUGIN')
-    self.layout.separator()
-    self.layout.operator('sequencerextra.selectcurrentframe',
-    text='Before Current Frame', icon='PLUGIN').mode = 'BEFORE'
-    self.layout.operator('sequencerextra.selectcurrentframe',
-    text='After Current Frame', icon='PLUGIN').mode = 'AFTER'
-    self.layout.operator('sequencerextra.selectcurrentframe',
-    text='On Current Frame', icon='PLUGIN').mode = 'ON'
-    self.layout.separator()
-    self.layout.operator('sequencerextra.selectsamechannel',
-    text='Same Channel', icon='PLUGIN')
-
-
-def sequencer_strip_menu_func(self, context):
-    self.layout.operator('sequencerextra.extendtofill',
-    text='Extend to Fill', icon='PLUGIN')
-    self.layout.operator('sequencerextra.distribute',
-    text='Distribute', icon='PLUGIN')
-    self.layout.operator_menu_enum('sequencerextra.fadeinout',
-    'mode', text='Fade', icon='PLUGIN')
-    self.layout.operator_menu_enum('sequencerextra.copyproperties',
-    'prop', icon='PLUGIN')
-    self.layout.operator('sequencerextra.slidegrab',
-    text='Slide Grab', icon='PLUGIN')
-    self.layout.operator_menu_enum('sequencerextra.slide',
-    'mode', icon='PLUGIN')
-    self.layout.operator('sequencerextra.insert',
-    text='Insert (Single Channel)', icon='PLUGIN').singlechannel = True
-    self.layout.operator('sequencerextra.insert',
-    text='Insert', icon='PLUGIN').singlechannel = False
-    self.layout.operator('sequencerextra.ripplecut',
-    text='Ripple Cut', icon='PLUGIN')
-    self.layout.operator('sequencerextra.rippledelete',
-    text='Ripple Delete', icon='PLUGIN')
-    self.layout.separator()
-
-
-def sequencer_header_func(self, context):
-    self.layout.menu("SEQUENCER_EXTRA_MT_input")
-    if context.space_data.view_type in ('PREVIEW', 'SEQUENCER_PREVIEW'):
-        self.layout.operator('sequencerextra.jogshuttle',
-        text='Jog/Shuttle', icon='NDOF_TURN')
-    if context.space_data.view_type in ('SEQUENCER', 'SEQUENCER_PREVIEW'):
-        self.layout.operator('sequencerextra.navigateup',
-        text='Navigate Up', icon='FILE_PARENT')
-    if context.space_data.view_type in ('SEQUENCER', 'SEQUENCER_PREVIEW'):
-        self.layout.operator('sequencerextra.placefromfilebrowser',
-        text='File Place', icon='TRIA_DOWN').insert = False
-    if context.space_data.view_type in ('SEQUENCER', 'SEQUENCER_PREVIEW'):
-        self.layout.operator('sequencerextra.placefromfilebrowser',
-        text='File Insert', icon='TRIA_RIGHT').insert = True
-    if context.space_data.view_type in ('SEQUENCER', 'SEQUENCER_PREVIEW'):
-        self.layout.operator('sequencerextra.placefromfilebrowserproxy',
-        text='Proxy Place', icon='TRIA_DOWN')
-    if context.space_data.view_type in ('SEQUENCER', 'SEQUENCER_PREVIEW'):
-        self.layout.operator('sequencerextra.placefromfilebrowserproxy',
-        text='Proxy Insert', icon='TRIA_RIGHT').insert = True
-
-
-def time_frame_menu_func(self, context):
-    self.layout.operator('timeextra.trimtimelinetoselection',
-    text='Trim to Selection', icon='PLUGIN')
-    self.layout.operator('timeextra.trimtimeline',
-    text='Trim to Timeline Content', icon='PLUGIN')
-    self.layout.separator()
-    self.layout.operator('screenextra.frame_skip',
-    text='Skip Forward One Second', icon='PLUGIN').back = False
-    self.layout.operator('screenextra.frame_skip',
-    text='Skip Back One Second', icon='PLUGIN').back = True
-    self.layout.separator()
-
-
-def time_header_func(self, context):
-    self.layout.operator('sequencerextra.jogshuttle',
-    text='Jog/Shuttle', icon='NDOF_TURN')
-
-
-def clip_header_func(self, context):
-    self.layout.operator('sequencerextra.jogshuttle',
-    text='Jog/Shuttle', icon='NDOF_TURN')
-
-
-def clip_clip_menu_func(self, context):
-    self.layout.operator('clipextra.openactivestrip',
-    text='Open Active Strip', icon='PLUGIN')
-    self.layout.operator('clipextra.openfromfilebrowser',
-    text='Open from File Browser', icon='PLUGIN')
-    self.layout.separator()
-
-
-class ExifInfoPanel(bpy.types.Panel):
-    """Creates a Panel in the Object properties window"""
-    bl_label = "EXIF Info Panel"
-    bl_space_type = 'SEQUENCE_EDITOR'
-    bl_region_type = 'UI'
-
-    @staticmethod
-    def has_sequencer(context):
-        return (context.space_data.view_type\
-        in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
-
-    @classmethod
-    def poll(cls, context):
-        return cls.has_sequencer(context)
-
-    def draw_header(self, context):
-        layout = self.layout
-        layout.label(text="", icon="NLA")
-
-    def draw(self, context):
-        layout = self.layout
-        sce = context.scene
-        row = layout.row()
-        row.operator("sequencerextra.read_exif")
-        row = layout.row()
-        row.label(text="Exif Data", icon='RENDER_REGION')
-        row = layout.row()
-
-        try:
-            strip = context.scene.sequence_editor.active_strip
-
-            f = strip.frame_start
-            frame = sce.frame_current
-            try:
-                if len(sce['metadata']) == 1:
-                    for d in sce['metadata'][0]:
-                        split = layout.split(percentage=0.5)
-                        col = split.column()
-                        row = col.row()
-                        col.label(text=d)
-                        col = split.column()
-                        col.label(str(sce['metadata'][0][d]))
-                else:
-                    for d in sce['metadata'][frame - f]:
-                        split = layout.split(percentage=0.5)
-                        col = split.column()
-                        row = col.row()
-                        col.label(text=d)
-                        col = split.column()
-                        col.label(str(sce['metadata'][frame - f][d]))
-            except KeyError:
-                pass
-        except AttributeError:
-            pass
diff --git a/release/scripts/addons_contrib/sequencer_jumptocut.py b/release/scripts/addons_contrib/sequencer_jumptocut.py
deleted file mode 100644
index 1e78935..0000000
--- a/release/scripts/addons_contrib/sequencer_jumptocut.py
+++ /dev/null
@@ -1,439 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-bl_info = {
-    "name": "Jump to Cut",
-    "author": "Carlos Padial",
-    "version": (5, 0, 2),
-    "blender": (2, 63, 0),
-    "api": 44539,
-    "category": "Sequencer",
-    "location": "Sequencer > UI > Jump to Cut",
-    "description": "Tool collection to help speed up editting and grade videos with blender",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Sequencer/Jump_to_cut",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?func=detail&aid=24279",}
-
-#
-# 
-#
-#-----------------------------------------------------------------------------------------------------
-import bpy
-
-class Jumptocut(bpy.types.Panel):
-    bl_space_type = "SEQUENCE_EDITOR"
-    bl_region_type = "UI"
-    bl_label = "Jump to Cut"  
-
-    def draw_header(self, context):
-        layout = self.layout
-        layout.label(text="", icon="NLA")
-    
-    def draw(self, context):
-        layout = self.layout
-       
-        row=layout.row()
-        split=row.split(percentage=0.5)
-        colL = split.column()
-        colR = split.column()
-        colL.operator("sequencer.jumpprev", icon="PLAY_REVERSE")
-        colR.operator("sequencer.jumpnext", icon='PLAY')
-
-        row=layout.row()
-        split=row.split()
-        colL = split.column()
-        colR = split.column()
-        colL.operator("sequencer.markprev", icon="MARKER_HLT")
-        colR.operator("sequencer.marknext", icon='MARKER_HLT')
-        
-        row=layout.row()
-        split=row.split()
-        colL1 = split.column()
-        colL2 = split.column()
-        colL1.operator("sequencer.sourcein", icon="REW")
-        colL2.operator("sequencer.sourceout", icon='FF')
- 
-        
-        row=layout.row()
-        split=row.split()
-        colR1 = split.column()
-        colR1.operator("sequencer.setinout", icon="ARROW_LEFTRIGHT")
-        row=layout.row()
-        split=row.split(percentage=0.5)
-        colR1 = split.column()
-        colR1.operator("sequencer.triminout", icon="FULLSCREEN_EXIT") 
-        colR2 = split.column()
-        colR2.operator("sequencer.setstartend", icon="SETTINGS")
-
-        row=layout.row()
-        split=row.split()
-        colR1 = split.column()
-        colR2 = split.column()
-        colR1.operator("sequencer.metacopy", icon="COPYDOWN")
-        colR2.operator("sequencer.metapaste", icon='PASTEDOWN')
-        
-#-----------------------------------------------------------------------------------------------------
-
-class OBJECT_OT_Setinout(bpy.types.Operator):  
-    bl_label = "Mark in & out to active strip"
-    bl_idname = "sequencer.setinout"
-    bl_description = "set IN and OUT markers to the active strip limits"
-        
-    def invoke(self, context, event):
-        scene=bpy.context.scene
-        markers=scene.timeline_markers
-        seq=scene.sequence_editor
-        if seq:
-            strip= seq.active_strip
-            if strip != None:
-                sin = strip.frame_start + strip.frame_offset_start
-                sout = sin + strip.frame_final_duration 
-                if "IN" not in markers:
-                    mark=markers.new(name="IN")
-                    mark.frame=sin
-                else:
-                    mark=markers["IN"]
-                    mark.frame=sin
-                if "OUT" not in markers:
-                    mark= markers.new(name="OUT")
-                    mark.frame=sout
-                else:
-                    mark=markers["OUT"]
-                    mark.frame=sout 
-        return {'FINISHED'}
-    
-
-def triminout(strip,sin,sout):
-    start = strip.frame_start+strip.frame_offset_start 
-    end = start+strip.frame_final_duration
-    if end > sin:
-        if start < sin:
-            strip.select_right_handle = False            
-            strip.select_left_handle = True
-            bpy.ops.sequencer.snap(frame=sin)
-            strip.select_left_handle = False
-    if start < sout:
-        if end > sout:
-            strip.select_left_handle = False            
-            strip.select_right_handle = True
-            bpy.ops.sequencer.snap(frame=sout)
-            strip.select_right_handle = False    
-    return {'FINISHED'}
-
-
-class OBJECT_OT_Triminout(bpy.types.Operator):  
-    bl_label = "Trim to in & out"
-    bl_idname = "sequencer.triminout"
-    bl_description = "trim the selected strip to IN and OUT markers (if exists)"
-        
-    def invoke(self, context, event):
-        scene=bpy.context.scene
-        markers=scene.timeline_markers
-        seq=scene.sequence_editor
-        if seq:
-            strip= seq.active_strip
-            if strip != None:
-                if "IN" and "OUT" in markers:
-                    sin=markers["IN"].frame
-                    sout=markers["OUT"].frame
-                    triminout(strip,sin,sout)
-                else:
-                    self.report({'WARNING'}, "there is no IN and OUT")
-            bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-def searchprev(j, list):
-    list.sort()
-    list.reverse()
-    for i in list:
-        if i < j:
-            result = i
-            break 
-    else: result = j
-    return result
-
-def searchnext(j, list): 
-    list.sort()
-    for i in list:
-        if i > j:
-            result = i
-            break
-    else: result = j
-    return result  
-
-def geteditpoints(seq):
-    #this create a list of editpoints including strips from
-    # inside metastrips. It reads only 1 level into the metastrip
-    editpoints = []
-    cliplist = []
-    metalist = []
-    if seq:
-        for i in seq.sequences:
-            if i.type == 'META':
-                metalist.append(i)
-                start = i.frame_start + i.frame_offset_start
-                end = start + i.frame_final_duration
-                editpoints.append(start)
-                editpoints.append(end)
-            else:
-                cliplist.append(i)
-        for i in metalist:
-            for j in i.sequences:
-                cliplist.append(j)  
-        for i in cliplist:
-            start = i.frame_start + i.frame_offset_start
-            end = start + i.frame_final_duration
-            editpoints.append(start)
-            editpoints.append(end)
-            #print(start," ",end)
-    return editpoints
-
-#JUMP    
-class OBJECT_OT_Jumpprev(bpy.types.Operator):  #Operator jump previous edit point
-    bl_label = "Cut previous"
-    bl_idname = "sequencer.jumpprev"
-    bl_description = "jump to previous edit point"
-    
-    editpoints = []
-        
-    def invoke(self, context, event):
-        scene=bpy.context.scene
-        seq=scene.sequence_editor
-        editpoints = geteditpoints(seq)
-        bpy.context.scene.frame_current = searchprev(scene.frame_current, editpoints) 
-        return {'FINISHED'}   
-           
-class OBJECT_OT_Jumpnext(bpy.types.Operator):  #Operator jump next edit point
-    bl_label = "Cut next"
-    bl_idname = "sequencer.jumpnext"
-    bl_description = "jump to next edit point"
-    
-    def invoke(self, context, event):
-        scene=bpy.context.scene
-        seq=scene.sequence_editor
-        editpoints = geteditpoints(seq)
-        bpy.context.scene.frame_current = searchnext(scene.frame_current, editpoints)
-        last = 0
-        for i in editpoints:
-            if i > last: last = i
-        if bpy.context.scene.frame_current == last:
-            bpy.context.scene.frame_current = last-1
-            self.report({'INFO'},'Last Frame')
-        return {'FINISHED'}
- 
-# MARKER 
-class OBJECT_OT_Markerprev(bpy.types.Operator): 
-    bl_label = "Marker previous"
-    bl_idname = "sequencer.markprev"
-    bl_description = "jump to previous marker"
-        
-    def invoke(self, context, event):
-        markerlist = []
-        scene= bpy.context.scene
-        markers = scene.timeline_markers
-        for i in markers: markerlist.append(i.frame)
-        bpy.context.scene.frame_current = searchprev(scene.frame_current, markerlist)
-        return {'FINISHED'}
-    
-class OBJECT_OT_Markernext(bpy.types.Operator):  
-    bl_label = "Marker next"
-    bl_idname = "sequencer.marknext"
-    bl_description = "jump to next marker"
-        
-    def invoke(self, context, event):
-        markerlist = []
-        scene= bpy.context.scene
-        markers = scene.timeline_markers
-        for i in markers: markerlist.append(i.frame)
-        bpy.context.scene.frame_current = searchnext(scene.frame_current, markerlist)
-        return {'FINISHED'}
-
-# SOURCE IN OUT
-              
-class OBJECT_OT_Sourcein(bpy.types.Operator):  #Operator source in
-    bl_label = "Source IN"
-    bl_idname = "sequencer.sourcein"
-    bl_description = "add a marker named IN"
-    
-    def invoke(self, context, event):
-        scene=bpy.context.scene
-        seq = scene.sequence_editor
-        markers=scene.timeline_markers
-        if "OUT" in markers:
-            sout=markers["OUT"]
-            if scene.frame_current <= sout.frame:
-                if "IN" not in markers:
-                    sin=markers.new(name="IN")
-                    sin.frame=scene.frame_current
-                else:
-                    sin=markers["IN"]
-                    sin.frame=scene.frame_current
-            #trying to set in after out
-            else:  
-                if "IN" not in markers:
-                    sin=markers.new(name="IN")
-                    sin.frame=sout.frame
-                else:
-                    sin=markers["IN"]
-                    sin.frame=sout.frame
-                self.report({'WARNING'},'IN after OUT')
-        else:
-            if "IN" not in markers:
-                sin=markers.new(name="IN")
-                sin.frame=scene.frame_current
-            else:
-                sin=markers["IN"]
-                sin.frame=scene.frame_current
-        if seq:
-            bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-class OBJECT_OT_Sourceout(bpy.types.Operator):  #Operator source out
-    bl_label = "Source OUT"
-    bl_idname = "sequencer.sourceout"
-    bl_description = "add a marker named OUT"
-    
-    def invoke(self, context, event):
-        scene=bpy.context.scene
-        seq = scene.sequence_editor
-        markers=scene.timeline_markers
-        if "IN" in markers:
-            sin=markers["IN"]
-            if scene.frame_current >= sin.frame:
-                if "OUT" not in markers:
-                    sout= markers.new(name="OUT")
-                    sout.frame=scene.frame_current
-                else:
-                    sout=markers["OUT"]
-                    sout.frame=scene.frame_current 
-            #trying to set out before in 
-            else:
-                if "OUT" not in markers:
-                    sout= markers.new(name="OUT")
-                    sout.frame = sin.frame
-                else:
-                    sout=markers["OUT"]
-                    sout.frame = sin.frame 
-                self.report({'WARNING'}, "OUT before IN")
-        else:
-            sout= markers.new(name="OUT")
-            sout.frame=scene.frame_current
-        if seq:
-            bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-
-
-class OBJECT_OT_Setstartend(bpy.types.Operator):  #Operator set start & end
-    bl_label = "set Start & End"
-    bl_idname = "sequencer.setstartend"
-    bl_description = "set Start = In and End = Out"
-    
-    def invoke(self, context, event):
-        scene=bpy.context.scene
-        seq = scene.sequence_editor
-        markers=scene.timeline_markers
-        if seq:
-            if "IN" and "OUT" in markers:
-                sin=markers["IN"]
-                sout=markers["OUT"]
-                scene.frame_start = sin.frame
-                scene.frame_end = sout.frame
-                print("change")
-            else:
-                self.report({'WARNING'}, "there is no IN and OUT")
-            bpy.ops.sequencer.reload()
-        return {'FINISHED'}
-
-    
-# COPY PASTE
-
-class OBJECT_OT_Metacopy(bpy.types.Operator):  #Operator copy source in/out
-    bl_label = "Trim & Meta-Copy"
-    bl_idname = "sequencer.metacopy"
-    bl_description = "make meta from selected strips, trim it to in/out (if available) and copy it to clipboard"
-    
-    def invoke(self, context, event):
-        # rehacer
-        scene=bpy.context.scene
-        seq = scene.sequence_editor
-        markers=scene.timeline_markers
-        strip1= seq.active_strip
-        if strip1 != None:
-            if "IN" and "OUT" in markers:
-                sin=markers["IN"].frame
-                sout=markers["OUT"].frame
-                bpy.ops.sequencer.meta_make()
-                strip2= seq.active_strip
-                triminout(strip2,sin,sout)
-                bpy.ops.sequencer.copy()
-                bpy.ops.sequencer.meta_separate()
-                self.report({'INFO'}, "META has been trimed and copied")              
-            else:
-                bpy.ops.sequencer.meta_make()
-                bpy.ops.sequencer.copy()
-                bpy.ops.sequencer.meta_separate()
-                self.report({'WARNING'}, "No In & Out!! META has been copied")
-        else:
-            self.report({'ERROR'}, "No strip selected")
-        return {'FINISHED'}
-        
-class OBJECT_OT_Metapaste(bpy.types.Operator):  #Operator paste source in/out
-    bl_label = "Paste in current Frame"
-    bl_idname = "sequencer.metapaste"
-    bl_description = "paste source from clipboard to current frame"
-    
-    def invoke(self, context, event):
-        # rehacer
-        scene=bpy.context.scene
-        bpy.ops.sequencer.paste()
-        bpy.ops.sequencer.snap(frame=scene.frame_current)
-        return {'FINISHED'}
-
-# Registering / Unregister
- 
-def register():
-    bpy.utils.register_class(Jumptocut)
-    bpy.utils.register_class(OBJECT_OT_Jumpprev)
-    bpy.utils.register_class(OBJECT_OT_Jumpnext)
-    bpy.utils.register_class(OBJECT_OT_Markerprev)
-    bpy.utils.register_class(OBJECT_OT_Markernext)    
-    bpy.utils.register_class(OBJECT_OT_Sourcein)
-    bpy.utils.register_class(OBJECT_OT_Sourceout)
-    bpy.utils.register_class(OBJECT_OT_Metacopy)
-    bpy.utils.register_class(OBJECT_OT_Metapaste)
-    bpy.utils.register_class(OBJECT_OT_Triminout)
-    bpy.utils.register_class(OBJECT_OT_Setinout)
-    bpy.utils.register_class(OBJECT_OT_Setstartend)
-    
-def unregister():
-    bpy.utils.unregister_class(Jumptocut)
-    bpy.utils.unregister_class(OBJECT_OT_Jumpprev)
-    bpy.utils.unregister_class(OBJECT_OT_Jumpnext)
-    bpy.utils.unregister_class(OBJECT_OT_Markerprev)
-    bpy.utils.unregister_class(OBJECT_OT_Markernext)      
-    bpy.utils.unregister_class(OBJECT_OT_Sourcein)
-    bpy.utils.unregister_class(OBJECT_OT_Sourceout)
-    bpy.utils.unregister_class(OBJECT_OT_Metacopy)
-    bpy.utils.unregister_class(OBJECT_OT_Metapaste)
-    bpy.utils.unregister_class(OBJECT_OT_Triminout)
-    bpy.utils.unregister_class(OBJECT_OT_Setinout)
-    bpy.utils.unregister_class(OBJECT_OT_Setstartend)
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/sequencer_tools/__init__.py b/release/scripts/addons_contrib/sequencer_tools/__init__.py
deleted file mode 100644
index ef43f0a..0000000
--- a/release/scripts/addons_contrib/sequencer_tools/__init__.py
+++ /dev/null
@@ -1,120 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Sequencer Tools",
-    "author": "mont29",
-    "version": (0, 0, 1),
-    "blender": (2, 63, 0),
-    "location": "Sequencer menus/UI",
-    "description": "Various Sequencer tools.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Sequencer/Tools",
-    "tracker_url": "projects.blender.org/tracker/index.php?func=detail&aid=31549",
-    "support": 'TESTING',
-    "category": "Sequencer"
-}
-
-
-import bpy
-
-from sequencer_tools.export_strips import SEQExportStrip
-
-
-KEYMAPS = (
-    # First, keymap identifiers (last bool is True for modal km).
-    (("Sequencer", "WINDOW", "SEQUENCE_EDITOR", False), (
-    # Then a tuple of keymap items, defined by a dict of kwargs for
-    # the km new func, and a tuple of tuples (name, val) for ops properties,
-    # if needing non-default values.
-        ({"idname": SEQExportStrip.bl_idname, "type": "P", "value": "PRESS",
-                                              "shift": True, "ctrl": True},
-         ()),
-    )),
-)
-
-
-def menu_func(self, context):
-    self.layout.operator(SEQExportStrip.bl_idname, text="Export Selected")
-
-
-def find_keymap_items(km, idname):
-    return (i for i in km.keymap_items if i.idname == idname)
-
-
-def update_keymap(activate):
-    # Add.
-    if activate:
-        kconf = bpy.context.window_manager.keyconfigs.addon
-        for km_info, km_items in KEYMAPS:
-            km_name, km_regtype, km_sptype, km_ismodal = km_info
-            kmap = [k for k in kconf.keymaps
-                    if k.name == km_name and k.region_type == km_regtype and
-                       k.space_type == km_sptype and k.is_modal == km_ismodal]
-            if kmap:
-                kmap = kmap[0]
-            else:
-                kmap = kconf.keymaps.new(km_name, region_type=km_regtype,
-                                         space_type=km_sptype,
-                                         modal=km_ismodal)
-            for kmi_kwargs, props in km_items:
-                kmi = kmap.keymap_items.new(**kmi_kwargs)
-                kmi.active = True
-                for prop, val in props:
-                    setattr(kmi.properties, prop, val)
-
-    # Remove.
-    else:
-        # XXX We must also clean up user keyconfig, else, if user has
-        #     customized one of our shortcut, this customization
-        #     remains in memory, and comes back when re-enabling the addon,
-        #     causing a sigsev... :/
-        kconfs = bpy.context.window_manager.keyconfigs
-        for kconf in (kconfs.user, kconfs.addon):
-            for km_info, km_items in KEYMAPS:
-                km_name, km_regtype, km_sptype, km_ismodal = km_info
-                kmaps = (k for k in kconf.keymaps
-                         if k.name == km_name and
-                            k.region_type == km_regtype and
-                            k.space_type == km_sptype and
-                            k.is_modal == km_ismodal)
-                for kmap in kmaps:
-                    for kmi_kwargs, props in km_items:
-                        for kmi in find_keymap_items(kmap,
-                                                     kmi_kwargs["idname"]):
-                            kmap.keymap_items.remove(kmi)
-                # XXX We won’t remove addons keymaps themselves,
-                #     other addons might also use them!
-
-
-def register():
-    bpy.utils.register_module(__name__)
-    bpy.types.SEQUENCER_MT_strip.append(menu_func)
-
-    update_keymap(True)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-    bpy.types.SEQUENCER_MT_strip.remove(menu_func)
-
-    update_keymap(False)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/sequencer_tools/export_strips.py b/release/scripts/addons_contrib/sequencer_tools/export_strips.py
deleted file mode 100644
index 5857eb3..0000000
--- a/release/scripts/addons_contrib/sequencer_tools/export_strips.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-from bpy.props import StringProperty
-
-class SEQExportStrip(bpy.types.Operator):
-    """
-    Export (render) selected strips in sequencer
-    """
-    bl_idname = "sequencer.export_strips"
-    bl_label = "Export Strips"
-    filepath = StringProperty(subtype='FILE_PATH')
-
-    def execute(self, context):
-        sce = bpy.context.scene
-        back_filepath = sce.render.filepath
-        back_seq = sce.render.use_sequencer
-        back_start = sce.frame_start
-        back_end = sce.frame_end
-        hidden_seq = []
-
-        sce.render.use_sequencer = True
-        sce.render.filepath = self.filepath
-        seq = sce.sequence_editor
-        start = end = None
-        for strip in seq.sequences_all:
-            if not strip.select:
-                if not strip.mute:
-                    strip.mute = True
-                    hidden_seq.append(strip)
-                continue
-            if start is None or strip.frame_final_start < start:
-                start = strip.frame_final_start
-            if end is None or strip.frame_final_end < end:
-                end = strip.frame_final_end
-        sce.frame_start = start
-        sce.frame_end = end
-
-        # Non-blocking render!
-        bpy.ops.render.render("INVOKE_DEFAULT", animation=True)
-
-        for strip in hidden_seq:
-            strip.mute = False
-        sce.render.use_sequencer = back_seq
-        sce.render.filepath = back_filepath
-        sce.frame_start = back_start
-        sce.frame_end = back_end
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        if not self.filepath:
-            self.filepath = bpy.context.scene.render.filepath
-        winman = context.window_manager
-        winman.fileselect_add(self)
-        return {'RUNNING_MODAL'}
-
diff --git a/release/scripts/addons_contrib/space_view3d_add_surround_cameras.py b/release/scripts/addons_contrib/space_view3d_add_surround_cameras.py
deleted file mode 100644
index 88b19cd..0000000
--- a/release/scripts/addons_contrib/space_view3d_add_surround_cameras.py
+++ /dev/null
@@ -1,247 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Surround Projection Tools",
-    "author": "Cole Ingraham",
-    "location": "View3D > Tool Shelf > Surround Projection panel",
-    "description": "Setup cameras and create rendering scenes for n-screen surround projection.",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/Surround_Projection_Tools",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"
-                   "func=detail&aid=29266",
-    "version": (0, 1, 2),
-    "blender": (2, 60, 0),
-    "category": "3D View"
-}
-
-import bpy
-from bpy.props import IntProperty
-from bpy.props import BoolProperty
-from math import pi
-import re
-
-CAMERA_ORIGIN_NAME = "CameraOrigin"
-
-# property for how many screens to add
-bpy.types.WindowManager.num_surround_screens = IntProperty(
-    name="Number of screens",
-    description="How many screens to add",
-    default=4,
-    min=3)
-
-# safeguard for removing previous cameras/scenes
-bpy.types.WindowManager.previous_num_surround_screens = IntProperty(
-    name="Previous number of screens",
-    description="used for removing cameras/scenes",
-    default=-1)
-
-# used to enable/disable make/remove scenes and cameras
-bpy.types.WindowManager.surround_screens_init = BoolProperty(
-    name="SurroundScenesInit",
-    default=False)
-
-# GUI panel
-class AddSurroundCamerasPanel(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Surround Projection"
-    bl_options = {'DEFAULT_CLOSED'}
-    def draw(self, context):
-        layout = self.layout
-        col = layout.column(align=True)
-
-        row = col.row()
-        row.prop(context.window_manager, "num_surround_screens")
-        row = col.row()
-        
-        if context.window_manager.previous_num_surround_screens is not -1:
-             row.operator('objects.remove_surround_cameras', icon='X')
-        else:
-             row.operator('objects.add_surround_cameras', icon='CAMERA_DATA')
-        
-        row = col.row()
-        
-        if context.window_manager.surround_screens_init is True:
-             row.operator('objects.remove_linked_scenes_for_surround_cameras', icon='X')
-        else:
-             row.operator('scene.add_linked_scenes_for_surround_cameras', icon='SCENE_DATA')
-
-        #col = layout.column(align=True)
-        #row = col.row()
-        #row.operator('objects.remove_surround_cameras', icon='X')
-        #row = col.row()
-        #row.operator('objects.remove_linked_scenes_for_surround_cameras', icon='X')
-
-
-# operator for adding cameras
-class AddSurroundCamerasOperator(bpy.types.Operator):
-    bl_idname = 'objects.add_surround_cameras'
-    bl_label = "Add Cameras"
-    bl_description = "Add n cameras"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        return context.window_manager.previous_num_surround_screens is -1
-
-    def execute(self, context):
-
-        scene = context.scene
-        numScreens = context.window_manager.num_surround_screens
-
-        # add an empty for the camera origin if not already present
-        obj_origin = scene.objects.get(CAMERA_ORIGIN_NAME)
-        if not obj_origin:
-            bpy.ops.object.add()
-            obj_origin = context.active_object
-            obj_origin.name = CAMERA_ORIGIN_NAME
-            obj_origin.location = scene.cursor_location
-
-        for i in range(0,numScreens):
-
-            # add a new camer
-            bpy.ops.object.camera_add()
-
-            # get the current camera
-            cam = context.active_object
-
-            # name the camera
-            cameraName = "Camera" + str(i)
-            cam.name = cameraName
-            cam.data.name = cameraName
-
-            # position camera
-            cam.location = 0,0,0
-            cam.rotation_euler = (pi/2), 0, ((-2*pi)/numScreens) * i
-
-            # set the field of view angle
-            cam.data.angle = (2*pi)/numScreens
-
-            # make the parent of the camera the origin
-            cam.parent = obj_origin
-
-        # sel/activate origin
-        bpy.ops.object.select_all(action='DESELECT')
-        obj_origin.select = True
-        scene.objects.active = obj_origin
-
-        context.window_manager.previous_num_surround_screens = numScreens
-        return {'FINISHED'}
-
-
-# operator for creating new linked scenes for each camera
-class AddSurroundScenesOperator(bpy.types.Operator):
-    bl_idname = 'scene.add_linked_scenes_for_surround_cameras'
-    bl_label = "Make Scenes"
-    bl_description = "Creates new scenes with linked object data for each camera"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        if context.window_manager.previous_num_surround_screens is not -1 and context.window_manager.surround_screens_init is False:
-            return True
-        return False
-
-    def execute(self, context):
-        scene_base = context.scene
-        numScreens = context.window_manager.previous_num_surround_screens
-        sceneName = scene_base.name
-        renderpath = scene_base.render.filepath
-
-        for i in range(0, numScreens):
-
-            thisScene = sceneName + "-Camera" + str(i)
-
-            bpy.ops.scene.new(type='EMPTY')
-            scene_new = context.scene
-            scene_new.name = thisScene
-
-            camera_object = bpy.data.objects["Camera" + str(i)]
-            scene_new.camera = camera_object
-            scene_new.background_set = scene_base
-            
-            # not essential but nice to have the camera in the scene
-            scene_new.objects.link(camera_object)
-
-            scene_new.render.filepath = renderpath + thisScene
-
-        context.screen.scene = scene_base
-        context.window_manager.surround_screens_init = True
-        return {'FINISHED'}
-
-
-# operator for removing the surround scenes
-class RemoveSurroundScenesOperator(bpy.types.Operator):
-    bl_idname = 'objects.remove_linked_scenes_for_surround_cameras'
-    bl_label = "Remove Scenes"
-    bl_description = "Removes all surround scenes"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        return context.window_manager.surround_screens_init is True
-
-    def execute(self, context):
-        numScreens = context.window_manager.previous_num_surround_screens
-
-        for scene in list(bpy.data.scenes):
-            if re.search("-Camera",scene.name):
-                bpy.data.scenes.remove(scene)
-
-        context.window_manager.surround_screens_init = False
-        return {'FINISHED'}
-
-
-# operator for removing the surround cameras/scenes
-class RemoveSurroundCamerasOperator(bpy.types.Operator):
-    bl_idname = 'objects.remove_surround_cameras'
-    bl_label = "Remove Cameras"
-    bl_description = "Removes all surround cameras"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        if context.window_manager.previous_num_surround_screens is not -1 and context.window_manager.surround_screens_init is False:
-            return True
-        return False
-
-    def execute(self, context):
-
-        scene = context.scene
-
-        # XXX. shouldnt there be some less general way to do this?
-        # like check if they are the child of origin? - campbell
-        for obj in scene.objects[:]:
-            if obj.type == 'CAMERA':
-                scene.objects.unlink(obj)
-
-        context.window_manager.previous_num_surround_screens = -1
-        return {'FINISHED'}
-
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/space_view3d_enhanced_3d_cursor.py b/release/scripts/addons_contrib/space_view3d_enhanced_3d_cursor.py
deleted file mode 100644
index c6a882f..0000000
--- a/release/scripts/addons_contrib/space_view3d_enhanced_3d_cursor.py
+++ /dev/null
@@ -1,5562 +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 3 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, see <http://www.gnu.org/licenses/>.
-#
-#  ***** END GPL LICENSE BLOCK *****
-
-# <pep8-80 compliant>
-
-bl_info = {
-    "name": "Enhanced 3D Cursor",
-    "description": "Cursor history and bookmarks; drag/snap cursor.",
-    "author": "dairin0d",
-    "version": (2, 8, 7),
-    "blender": (2, 63, 0),
-    "location": "View3D > Action mouse; F10; Properties panel",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/3D_interaction/Enhanced_3D_Cursor",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=28451",
-    "category": "3D View"}
-#============================================================================#
-
-"""
-ATTENTION:
-somewhere around 45447 revision object.ray_cast() starts conflicting with
-mesh.update(calc_tessface=True) -- at least when invoked within one
-operator cycle, object.ray_cast() crashes if object's tessfaces were
-update()d earlier in the code. However, not update()ing the meshes
-seems to work fine -- ray_cast() does its job, and it's possible to
-access tessfaces afterwards.
-mesh.calc_tessface() -- ? crashes too
-
-Seems like now axes are stored in columns instead of rows.
-Perhaps it's better to write utility functions to create/decompose
-matrices from/to 3D-vector axes and a translation component
-
-Breakdown:
-    Addon registration
-    Keymap utils
-    Various utils (e.g. find_region)
-    OpenGL; drawing utils
-    Non-undoable data storage
-    Cursor utils
-    Stick-object
-    Cursor monitor
-    Addon's GUI
-    Addon's properties
-    Addon's operators
-    ID Block emulator
-    Mesh cache
-    Snap utils
-    View3D utils
-    Transform orientation / coordinate system utils
-    Generic transform utils
-    Main operator
-    ...
-.
-
-First step is to re-make the cursor addon (make something usable first).
-CAD tools should be done without the hassle.
-
-TODO:
-    strip trailing space? (one of campbellbarton's commits did that)
-    
-    IDEAS:
-        - implement 'GIMBAL' orientation (euler axes)
-        - mini-Z-buffer in the vicinity of mouse coords (using raycasts)
-        - an orientation that points towards cursor
-          (from current selection to cursor)
-        - user coordinate systems (using e.g. empties to store different
-          systems; when user switches to such UCS, origin will be set to
-          "cursor", cursor will be sticked to the empty, and a custom
-          transform orientation will be aligned with the empty)
-          - "Stick" transform orientation that is always aligned with the
-            object cursor is "sticked" to?
-        - make 'NORMAL' system also work for bones?
-        - user preferences? (stored in a file)
-        - create spline/edge_mesh from history?
-        - API to access history/bookmarks/operators from other scripts?
-        - Snap selection to bookmark?
-        - Optimize
-        - Clean up code, move to several files?
-    LATER:
-    ISSUES:
-        Limitations:
-            - I need to emulate in Python some things that Blender doesn't
-              currently expose through API:
-              - obtaining matrix of predefined transform orientation
-              - obtaining position of pivot
-              For some kinds of information (e.g. active vertex/edge,
-              selected meta-elements), there is simply no workaround.
-            - Snapping to vertices/edges works differently than in Blender.
-              First of all, iteration over all vertices/edges of all
-              objects along the ray is likely to be very slow.
-              Second, it's more human-friendly to snap to visible
-              elements (or at least with approximately known position).
-            - In editmode I have to exit-and-enter it to get relevant
-              information about current selection. Thus any operator
-              would automatically get applied when you click on 3D View.
-        Mites:
-    QUESTIONS:
-==============================================================================
-Borrowed code/logic:
-- space_view3d_panel_measure.py (Buerbaum Martin "Pontiac"):
-  - OpenGL state storing/restoring; working with projection matrices.
-"""
-
-import bpy
-import bgl
-import blf
-import bmesh
-
-from mathutils import Vector, Matrix, Quaternion, Euler
-
-from mathutils.geometry import (intersect_line_sphere,
-                                intersect_ray_tri,
-                                barycentric_transform,
-                                tessellate_polygon,
-                                intersect_line_line,
-                                intersect_line_plane,
-                                )
-
-from bpy_extras.view3d_utils import (region_2d_to_location_3d,
-                                     location_3d_to_region_2d,
-                                     )
-
-import math
-import time
-
-# ====== MODULE GLOBALS / CONSTANTS ====== #
-tmp_name = chr(0x10ffff) # maximal Unicode value
-epsilon = 0.000001
-
-# ====== SET CURSOR OPERATOR ====== #
-class EnhancedSetCursor(bpy.types.Operator):
-    """Cursor history and bookmarks; drag/snap cursor."""
-    bl_idname = "view3d.cursor3d_enhanced"
-    bl_label = "Enhanced Set Cursor"
-    
-    key_char_map = {
-        'PERIOD':".", 'NUMPAD_PERIOD':".",
-        'MINUS':"-", 'NUMPAD_MINUS':"-",
-        'EQUAL':"+", 'NUMPAD_PLUS':"+",
-        #'E':"e", # such big/small numbers aren't useful
-        'ONE':"1", 'NUMPAD_1':"1",
-        'TWO':"2", 'NUMPAD_2':"2",
-        'THREE':"3", 'NUMPAD_3':"3",
-        'FOUR':"4", 'NUMPAD_4':"4",
-        'FIVE':"5", 'NUMPAD_5':"5",
-        'SIX':"6", 'NUMPAD_6':"6",
-        'SEVEN':"7", 'NUMPAD_7':"7",
-        'EIGHT':"8", 'NUMPAD_8':"8",
-        'NINE':"9", 'NUMPAD_9':"9",
-        'ZERO':"0", 'NUMPAD_0':"0",
-        'SPACE':" ",
-        'SLASH':"/", 'NUMPAD_SLASH':"/",
-        'NUMPAD_ASTERIX':"*",
-    }
-    
-    key_coordsys_map = {
-        'LEFT_BRACKET':-1,
-        'RIGHT_BRACKET':1,
-        'J':'VIEW',
-        'K':"Surface",
-        'L':'LOCAL',
-        'B':'GLOBAL',
-        'N':'NORMAL',
-        'M':"Scaled",
-    }
-    
-    key_pivot_map = {
-        'H':'ACTIVE',
-        'U':'CURSOR',
-        'I':'INDIVIDUAL',
-        'O':'CENTER',
-        'P':'MEDIAN',
-    }
-    
-    key_snap_map = {
-        'C':'INCREMENT',
-        'V':'VERTEX',
-        'E':'EDGE',
-        'F':'FACE',
-    }
-    
-    key_tfm_mode_map = {
-        'G':'MOVE',
-        'R':'ROTATE',
-        'S':'SCALE',
-    }
-    
-    key_map = {
-        "confirm":{'ACTIONMOUSE'}, # also 'RET' ?
-        "cancel":{'SELECTMOUSE', 'ESC'},
-        "free_mouse":{'F10'},
-        "make_normal_snapshot":{'W'},
-        "make_tangential_snapshot":{'Q'},
-        "use_absolute_coords":{'A'},
-        "snap_to_raw_mesh":{'D'},
-        "use_object_centers":{'T'},
-        "precision_up":{'PAGE_UP'},
-        "precision_down":{'PAGE_DOWN'},
-        "move_caret_prev":{'LEFT_ARROW'},
-        "move_caret_next":{'RIGHT_ARROW'},
-        "move_caret_home":{'HOME'},
-        "move_caret_end":{'END'},
-        "change_current_axis":{'TAB', 'RET', 'NUMPAD_ENTER'},
-        "prev_axis":{'UP_ARROW'},
-        "next_axis":{'DOWN_ARROW'},
-        "remove_next_character":{'DEL'},
-        "remove_last_character":{'BACK_SPACE'},
-        "copy_axes":{'C'},
-        "paste_axes":{'V'},
-        "cut_axes":{'X'},
-    }
-    
-    gizmo_factor = 0.15
-    click_period = 0.25
-    
-    angle_grid_steps = {True:1.0, False:5.0}
-    scale_grid_steps = {True:0.01, False:0.1}
-    
-    # ====== OPERATOR METHOD OVERLOADS ====== #
-    @classmethod
-    def poll(cls, context):
-        area_types = {'VIEW_3D',} # also: IMAGE_EDITOR ?
-        return (context.area.type in area_types) and \
-               (context.region.type == "WINDOW")
-    
-    def modal(self, context, event):
-        context.area.tag_redraw()
-        return self.try_process_input(context, event)
-    
-    def invoke(self, context, event):
-        # Attempt to launch the monitor
-        if bpy.ops.view3d.cursor3d_monitor.poll():
-            bpy.ops.view3d.cursor3d_monitor()
-        
-        # Don't interfere with these modes when only mouse is pressed
-        if ('SCULPT' in context.mode) or ('PAINT' in context.mode):
-            if "MOUSE" in event.type:
-                return {'CANCELLED'}
-        
-        CursorDynamicSettings.active_transform_operator = self
-        
-        tool_settings = context.tool_settings
-        
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        settings_scene = context.scene.cursor_3d_tools_settings
-        
-        self.setup_keymaps(context, event)
-        
-        # Coordinate System Utility
-        self.particles, self.csu = gather_particles(context=context)
-        self.particles = [View3D_Cursor(context)]
-        
-        self.csu.source_pos = self.particles[0].get_location()
-        self.csu.source_rot = self.particles[0].get_rotation()
-        self.csu.source_scale = self.particles[0].get_scale()
-        
-        # View3D Utility
-        self.vu = ViewUtility(context.region, context.space_data,
-            context.region_data)
-        
-        # Snap Utility
-        self.su = SnapUtility(context)
-        
-        # turn off view locking for the duration of the operator
-        self.view_pos = self.vu.get_position(True)
-        self.vu.set_position(self.vu.get_position(), True)
-        self.view_locks = self.vu.get_locks()
-        self.vu.set_locks({})
-        
-        # Initialize runtime states
-        self.initiated_by_mouse = ("MOUSE" in event.type)
-        self.free_mouse = not self.initiated_by_mouse
-        self.use_object_centers = False
-        self.axes_values = ["", "", ""]
-        self.axes_coords = [None, None, None]
-        self.axes_eval_success = [True, True, True]
-        self.allowed_axes = [True, True, True]
-        self.current_axis = 0
-        self.caret_pos = 0
-        self.coord_format = "{:." + str(settings.free_coord_precision) + "f}"
-        self.transform_mode = 'MOVE'
-        self.init_xy_angle_distance(context, event)
-        
-        self.click_start = time.time()
-        if not self.initiated_by_mouse:
-            self.click_start -= self.click_period
-        
-        self.stick_obj_name = settings_scene.stick_obj_name
-        self.stick_obj_pos = settings_scene.stick_obj_pos
-        
-        # Initial run
-        self.try_process_input(context, event, True)
-
-        context.window_manager.modal_handler_add(self)
-        return {'RUNNING_MODAL'}
-    
-    def cancel(self, context):
-        for particle in self.particles:
-            particle.revert()
-        
-        set_stick_obj(context.scene, self.stick_obj_name, self.stick_obj_pos)
-        
-        self.finalize(context)
-        return {'CANCELLED'}
-    
-    # ====== CLEANUP/FINALIZE ====== #
-    def finalize(self, context):
-        # restore view locking
-        self.vu.set_locks(self.view_locks)
-        self.vu.set_position(self.view_pos, True)
-        
-        self.cleanup(context)
-        
-        # This is to avoid "blinking" of
-        # between-history-positions line
-        settings = find_settings()
-        history = settings.history
-        # make sure the most recent history entry is displayed
-        history.curr_id = 0
-        history.last_id = 0
-        
-        # Ensure there are no leftovers from draw_callback
-        context.area.tag_redraw()
-        
-        return {'FINISHED'}
-    
-    def cleanup(self, context):
-        self.particles = None
-        self.csu = None
-        self.vu = None
-        if self.su is not None:
-            self.su.dispose()
-        self.su = None
-        
-        CursorDynamicSettings.active_transform_operator = None
-    
-    # ====== USER INPUT PROCESSING ====== #
-    def setup_keymaps(self, context, event=None):
-        self.key_map = self.key_map.copy()
-        
-        # There is no such event as 'ACTIONMOUSE',
-        # it's always 'LEFTMOUSE' or 'RIGHTMOUSE'
-        if event:
-            if event.type == 'LEFTMOUSE':
-                self.key_map["confirm"] = {'LEFTMOUSE'}
-                self.key_map["cancel"] = {'RIGHTMOUSE', 'ESC'}
-            elif event.type == 'RIGHTMOUSE':
-                self.key_map["confirm"] = {'RIGHTMOUSE'}
-                self.key_map["cancel"] = {'LEFTMOUSE', 'ESC'}
-            else:
-                event = None
-        if event is None:
-            select_mouse = context.user_preferences.inputs.select_mouse
-            if select_mouse == 'RIGHT':
-                self.key_map["confirm"] = {'LEFTMOUSE'}
-                self.key_map["cancel"] = {'RIGHTMOUSE', 'ESC'}
-            else:
-                self.key_map["confirm"] = {'RIGHTMOUSE'}
-                self.key_map["cancel"] = {'LEFTMOUSE', 'ESC'}
-        
-        # Use user-defined "free mouse" key, if it exists
-        wm = context.window_manager
-        if '3D View' in wm.keyconfigs.user.keymaps:
-            km = wm.keyconfigs.user.keymaps['3D View']
-            for kmi in km.keymap_items:
-                if kmi.idname == 'view3d.cursor3d_enhanced':
-                    if kmi.map_type == 'KEYBOARD':
-                        self.key_map["free_mouse"] = {kmi.type,}
-                        break
-    
-    def try_process_input(self, context, event, initial_run=False):
-        try:
-            return self.process_input(context, event, initial_run)
-        except:
-            # If anything fails, at least dispose the resources
-            self.cleanup(context)
-            raise
-    
-    def process_input(self, context, event, initial_run=False):
-        wm = context.window_manager
-        v3d = context.space_data
-        
-        if event.type in self.key_map["confirm"]:
-            if self.free_mouse:
-                finished = (event.value == 'PRESS')
-            else:
-                finished = (event.value == 'RELEASE')
-            
-            if finished:
-                return self.finalize(context)
-        
-        if event.type in self.key_map["cancel"]:
-            return self.cancel(context)
-        
-        tool_settings = context.tool_settings
-        
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        make_snapshot = False
-        tangential_snapshot = False
-        
-        if event.value == 'PRESS':
-            if event.type in self.key_map["free_mouse"]:
-                if self.free_mouse and (not initial_run):
-                    # confirm if pressed second time
-                    return self.finalize(context)
-                else:
-                    self.free_mouse = True
-            
-            if event.type in self.key_tfm_mode_map:
-                new_mode = self.key_tfm_mode_map[event.type]
-                
-                if self.transform_mode != new_mode:
-                    # snap cursor to its initial state
-                    if new_mode != 'MOVE':
-                        for particle in self.particles:
-                            initial_matrix = particle.get_initial_matrix()
-                            particle.set_matrix(initial_matrix)
-                    # reset intial mouse position
-                    self.init_xy_angle_distance(context, event)
-                
-                self.transform_mode = new_mode
-            
-            if event.type in self.key_map["make_normal_snapshot"]:
-                make_snapshot = True
-                tangential_snapshot = False
-            
-            if event.type in self.key_map["make_tangential_snapshot"]:
-                make_snapshot = True
-                tangential_snapshot = True
-            
-            if event.type in self.key_map["snap_to_raw_mesh"]:
-                tool_settings.use_snap_self = \
-                    not tool_settings.use_snap_self
-            
-            if (not event.alt) and (event.type in {'X', 'Y', 'Z'}):
-                axis_lock = [(event.type == 'X') != event.shift,
-                             (event.type == 'Y') != event.shift,
-                             (event.type == 'Z') != event.shift]
-                
-                if self.allowed_axes != axis_lock:
-                    self.allowed_axes = axis_lock
-                else:
-                    self.allowed_axes = [True, True, True]
-            
-            if event.type in self.key_map["use_absolute_coords"]:
-                tfm_opts.use_relative_coords = \
-                    not tfm_opts.use_relative_coords
-                
-                self.update_origin_projection(context)
-            
-            incr = 0
-            if event.type in self.key_map["change_current_axis"]:
-                incr = (-1 if event.shift else 1)
-            elif event.type in self.key_map["next_axis"]:
-                incr = 1
-            elif event.type in self.key_map["prev_axis"]:
-                incr = -1
-            
-            if incr != 0:
-                self.current_axis = (self.current_axis + incr) % 3
-                self.caret_pos = len(self.axes_values[self.current_axis])
-            
-            incr = 0
-            if event.type in self.key_map["precision_up"]:
-                incr = 1
-            elif event.type in self.key_map["precision_down"]:
-                incr = -1
-            
-            if incr != 0:
-                settings.free_coord_precision += incr
-                self.coord_format = "{:." + \
-                    str(settings.free_coord_precision) + "f}"
-            
-            if (event.type == 'ZERO') and event.ctrl:
-                self.snap_to_system_origin()
-            else:
-                self.process_axis_input(event)
-            
-            if event.alt:
-                jc = (", " if tfm_opts.use_comma_separator else "\t")
-                if event.type in self.key_map["copy_axes"]:
-                    wm.clipboard = jc.join(self.get_axes_text(True))
-                elif event.type in self.key_map["cut_axes"]:
-                    wm.clipboard = jc.join(self.get_axes_text(True))
-                    self.set_axes_text("\t\t\t")
-                elif event.type in self.key_map["paste_axes"]:
-                    if jc == "\t":
-                        self.set_axes_text(wm.clipboard, True)
-                    else:
-                        jc = jc.strip()
-                        ttext = ""
-                        brackets = 0
-                        for c in wm.clipboard:
-                            if c in "[{(":
-                                brackets += 1
-                            elif c in "]})":
-                                brackets -= 1
-                            if (brackets == 0) and (c == jc):
-                                c = "\t"
-                            ttext += c
-                        self.set_axes_text(ttext, True)
-            
-            if event.type in self.key_coordsys_map:
-                new_orientation = self.key_coordsys_map[event.type]
-                self.csu.set_orientation(new_orientation)
-                
-                self.update_origin_projection(context)
-                
-                if event.ctrl:
-                    self.snap_to_system_origin()
-            
-            if event.type in self.key_map["use_object_centers"]:
-                v3d.use_pivot_point_align = not v3d.use_pivot_point_align
-            
-            if event.type in self.key_pivot_map:
-                self.csu.set_pivot(self.key_pivot_map[event.type])
-                
-                self.update_origin_projection(context)
-                
-                if event.ctrl:
-                    self.snap_to_system_origin(force_pivot=True)
-            
-            if (not event.alt) and (event.type in self.key_snap_map):
-                snap_element = self.key_snap_map[event.type]
-                if tool_settings.snap_element == snap_element:
-                    if snap_element == 'VERTEX':
-                        snap_element = 'VOLUME'
-                    elif snap_element == 'VOLUME':
-                        snap_element = 'VERTEX'
-                tool_settings.snap_element = snap_element
-        # end if
-        
-        if initial_run or (('MOVE' not in event.type) and \
-                ('TIMER' not in event.type)):
-            use_snap = (tool_settings.use_snap != event.ctrl)
-            if use_snap:
-                snap_type = tool_settings.snap_element
-            else:
-                snap_type = None
-            
-            axes_coords = [None, None, None]
-            if self.transform_mode == 'MOVE':
-                for i in range(3):
-                    if self.axes_coords[i] is not None:
-                        axes_coords[i] = self.axes_coords[i]
-                    elif not self.allowed_axes[i]:
-                        axes_coords[i] = 0.0
-            
-            self.su.set_modes(
-                interpolation=tfm_opts.snap_interpolate_normals_mode,
-                use_relative_coords=tfm_opts.use_relative_coords,
-                editmode=tool_settings.use_snap_self,
-                snap_type=snap_type,
-                snap_align=tool_settings.use_snap_align_rotation,
-                axes_coords=axes_coords,
-                )
-        
-        self.do_raycast = ("MOUSE" in event.type)
-        self.grid_substep = event.shift
-        self.modify_surface_orientation = (len(self.particles) == 1)
-        self.xy = Vector((event.mouse_region_x, event.mouse_region_y))
-        
-        self.use_object_centers = v3d.use_pivot_point_align
-        
-        if event.type == 'MOUSEMOVE':
-            self.update_transform_mousemove()
-        
-        if self.transform_mode == 'MOVE':
-            transform_func = self.transform_move
-        elif self.transform_mode == 'ROTATE':
-            transform_func = self.transform_rotate
-        elif self.transform_mode == 'SCALE':
-            transform_func = self.transform_scale
-        
-        for particle in self.particles:
-            transform_func(particle)
-        
-        if make_snapshot:
-            self.make_normal_snapshot(context.scene, tangential_snapshot)
-        
-        return {'RUNNING_MODAL'}
-    
-    def update_origin_projection(self, context):
-        r = context.region
-        rv3d = context.region_data
-        
-        origin = self.csu.get_origin()
-        # prehaps not projection, but intersection with plane?
-        self.origin_xy = location_3d_to_region_2d(r, rv3d, origin)
-        if self.origin_xy is None:
-            self.origin_xy = Vector((r.width / 2, r.height / 2))
-        
-        self.delta_xy = (self.start_xy - self.origin_xy).to_3d()
-        self.prev_delta_xy = self.delta_xy
-    
-    def init_xy_angle_distance(self, context, event):
-        self.start_xy = Vector((event.mouse_region_x, event.mouse_region_y))
-        
-        self.update_origin_projection(context)
-        
-        # Distinction between angles has to be made because
-        # angles can go beyond 360 degrees (we cannot snap
-        # to increment the original ones).
-        self.raw_angles = [0.0, 0.0, 0.0]
-        self.angles = [0.0, 0.0, 0.0]
-        self.scales = [1.0, 1.0, 1.0]
-    
-    def update_transform_mousemove(self):
-        delta_xy = (self.xy - self.origin_xy).to_3d()
-        
-        n_axes = sum(int(v) for v in self.allowed_axes)
-        if n_axes == 1:
-            # rotate using angle as value
-            rd = self.prev_delta_xy.rotation_difference(delta_xy)
-            offset = -rd.angle * round(rd.axis[2])
-            
-            sys_matrix = self.csu.get_matrix()
-            
-            i_allowed = 0
-            for i in range(3):
-                if self.allowed_axes[i]:
-                    i_allowed = i
-            
-            view_dir = self.vu.get_direction()
-            if view_dir.dot(sys_matrix[i_allowed][:3]) < 0:
-                offset = -offset
-            
-            for i in range(3):
-                if self.allowed_axes[i]:
-                    self.raw_angles[i] += offset
-        elif n_axes == 2:
-            # rotate using XY coords as two values
-            offset = (delta_xy - self.prev_delta_xy) * (math.pi / 180.0)
-            
-            if self.grid_substep:
-                offset *= 0.1
-            else:
-                offset *= 0.5
-            
-            j = 0
-            for i in range(3):
-                if self.allowed_axes[i]:
-                    self.raw_angles[i] += offset[1 - j]
-                    j += 1
-        elif n_axes == 3:
-            # rotate around view direction
-            rd = self.prev_delta_xy.rotation_difference(delta_xy)
-            offset = -rd.angle * round(rd.axis[2])
-            
-            view_dir = self.vu.get_direction()
-            
-            sys_matrix = self.csu.get_matrix()
-            
-            try:
-                view_dir = sys_matrix.inverted().to_3x3() * view_dir
-            except:
-                # this is some degenerate system
-                pass
-            view_dir.normalize()
-            
-            rot = Matrix.Rotation(offset, 3, view_dir)
-            
-            matrix = Euler(self.raw_angles, 'XYZ').to_matrix()
-            matrix.rotate(rot)
-            
-            euler = matrix.to_euler('XYZ')
-            self.raw_angles[0] += clamp_angle(euler.x - self.raw_angles[0])
-            self.raw_angles[1] += clamp_angle(euler.y - self.raw_angles[1])
-            self.raw_angles[2] += clamp_angle(euler.z - self.raw_angles[2])
-        
-        scale = delta_xy.length / self.delta_xy.length
-        if self.delta_xy.dot(delta_xy) < 0:
-            scale *= -1
-        for i in range(3):
-            if self.allowed_axes[i]:
-                self.scales[i] = scale
-        
-        self.prev_delta_xy = delta_xy
-    
-    def transform_move(self, particle):
-        src_matrix = particle.get_matrix()
-        initial_matrix = particle.get_initial_matrix()
-        
-        matrix = self.su.snap(
-            self.xy, src_matrix, initial_matrix,
-            self.do_raycast, self.grid_substep,
-            self.vu, self.csu,
-            self.modify_surface_orientation,
-            self.use_object_centers)
-        
-        particle.set_matrix(matrix)
-    
-    def rotate_matrix(self, matrix):
-        sys_matrix = self.csu.get_matrix()
-        
-        try:
-            matrix = sys_matrix.inverted() * matrix
-        except:
-            # this is some degenerate system
-            pass
-        
-        # Blender's order of rotation [in local axes]
-        rotation_order = [2, 1, 0]
-        
-        # Seems that 4x4 matrix cannot be rotated using rotate() ?
-        sys_matrix3 = sys_matrix.to_3x3()
-        
-        for i in range(3):
-            j = rotation_order[i]
-            axis = sys_matrix3[j]
-            angle = self.angles[j]
-            
-            rot = angle_axis_to_quat(angle, axis)
-            # this seems to be buggy too
-            #rot = Matrix.Rotation(angle, 3, axis)
-            
-            sys_matrix3 = rot.to_matrix() * sys_matrix3
-            # sys_matrix3.rotate has a bug? or I don't understand how it works?
-            #sys_matrix3.rotate(rot)
-        
-        for i in range(3):
-            sys_matrix[i][:3] = sys_matrix3[i]
-        
-        matrix = sys_matrix * matrix
-        
-        return matrix
-    
-    def transform_rotate(self, particle):
-        grid_step = self.angle_grid_steps[self.grid_substep]
-        grid_step *= (math.pi / 180.0)
-        
-        for i in range(3):
-            if self.axes_values[i] and self.axes_eval_success[i]:
-                self.raw_angles[i] = self.axes_coords[i] * (math.pi / 180.0)
-            
-            self.angles[i] = self.raw_angles[i]
-        
-        if self.su.implementation.snap_type == 'INCREMENT':
-            for i in range(3):
-                self.angles[i] = round_step(self.angles[i], grid_step)
-        
-        initial_matrix = particle.get_initial_matrix()
-        matrix = self.rotate_matrix(initial_matrix)
-        
-        particle.set_matrix(matrix)
-    
-    def scale_matrix(self, matrix):
-        sys_matrix = self.csu.get_matrix()
-        
-        try:
-            matrix = sys_matrix.inverted() * matrix
-        except:
-            # this is some degenerate system
-            pass
-        
-        for i in range(3):
-            sys_matrix[i] *= self.scales[i]
-        
-        matrix = sys_matrix * matrix
-        
-        return matrix
-    
-    def transform_scale(self, particle):
-        grid_step = self.scale_grid_steps[self.grid_substep]
-        
-        for i in range(3):
-            if self.axes_values[i] and self.axes_eval_success[i]:
-                self.scales[i] = self.axes_coords[i]
-        
-        if self.su.implementation.snap_type == 'INCREMENT':
-            for i in range(3):
-                self.scales[i] = round_step(self.scales[i], grid_step)
-        
-        initial_matrix = particle.get_initial_matrix()
-        matrix = self.scale_matrix(initial_matrix)
-        
-        particle.set_matrix(matrix)
-    
-    def set_axis_input(self, axis_id, axis_val):
-        if axis_val == self.axes_values[axis_id]:
-            return
-        
-        self.axes_values[axis_id] = axis_val
-        
-        if len(axis_val) == 0:
-            self.axes_coords[axis_id] = None
-            self.axes_eval_success[axis_id] = True
-        else:
-            try:
-                #self.axes_coords[axis_id] = float(eval(axis_val, {}, {}))
-                self.axes_coords[axis_id] = \
-                    float(eval(axis_val, math.__dict__))
-                self.axes_eval_success[axis_id] = True
-            except:
-                self.axes_eval_success[axis_id] = False
-    
-    def snap_to_system_origin(self, force_pivot=False):
-        if self.transform_mode == 'MOVE':
-            pivot = self.csu.get_pivot_name(raw=force_pivot)
-            p = self.csu.get_origin(relative=False, pivot=pivot)
-            m = self.csu.get_matrix()
-            try:
-                p = m.inverted() * p
-            except:
-                # this is some degenerate system
-                pass
-            for i in range(3):
-                self.set_axis_input(i, str(p[i]))
-        elif self.transform_mode == 'ROTATE':
-            for i in range(3):
-                self.set_axis_input(i, "0")
-        elif self.transform_mode == 'SCALE':
-            for i in range(3):
-                self.set_axis_input(i, "1")
-    
-    def get_axes_values(self, as_string=False):
-        if self.transform_mode == 'MOVE':
-            localmat = CursorDynamicSettings.local_matrix
-            raw_axes = localmat.translation
-        elif self.transform_mode == 'ROTATE':
-            raw_axes = Vector(self.angles) * (180.0 / math.pi)
-        elif self.transform_mode == 'SCALE':
-            raw_axes = Vector(self.scales)
-        
-        axes_values = []
-        for i in range(3):
-            if as_string and self.axes_values[i]:
-                value = self.axes_values[i]
-            elif self.axes_eval_success[i] and \
-                    (self.axes_coords[i] is not None):
-                value = self.axes_coords[i]
-            else:
-                value = raw_axes[i]
-                if as_string:
-                    value = self.coord_format.format(value)
-            axes_values.append(value)
-        
-        return axes_values
-    
-    def get_axes_text(self, offset=False):
-        axes_values = self.get_axes_values(as_string=True)
-        
-        axes_text = []
-        for i in range(3):
-            j = i
-            if offset:
-                j = (i + self.current_axis) % 3
-            
-            axes_text.append(axes_values[j])
-        
-        return axes_text
-    
-    def set_axes_text(self, text, offset=False):
-        if "\n" in text:
-            text = text.replace("\r", "")
-        else:
-            text = text.replace("\r", "\n")
-        text = text.replace("\n", "\t")
-        #text = text.replace(",", ".") # ???
-        
-        axes_text = text.split("\t")
-        for i in range(min(len(axes_text), 3)):
-            j = i
-            if offset:
-                j = (i + self.current_axis) % 3
-            self.set_axis_input(j, axes_text[i])
-    
-    def process_axis_input(self, event):
-        axis_id = self.current_axis
-        axis_val = self.axes_values[axis_id]
-        
-        if event.type in self.key_map["remove_next_character"]:
-            if event.ctrl:
-                # clear all
-                for i in range(3):
-                    self.set_axis_input(i, "")
-                self.caret_pos = 0
-                return
-            else:
-                axis_val = axis_val[0:self.caret_pos] + \
-                           axis_val[self.caret_pos + 1:len(axis_val)]
-        elif event.type in self.key_map["remove_last_character"]:
-            if event.ctrl:
-                # clear current
-                axis_val = ""
-            else:
-                axis_val = axis_val[0:self.caret_pos - 1] + \
-                           axis_val[self.caret_pos:len(axis_val)]
-                self.caret_pos -= 1
-        elif event.type in self.key_map["move_caret_next"]:
-            self.caret_pos += 1
-            if event.ctrl:
-                snap_chars = ".-+*/%()"
-                i = self.caret_pos
-                while axis_val[i:i + 1] not in snap_chars:
-                    i += 1
-                self.caret_pos = i
-        elif event.type in self.key_map["move_caret_prev"]:
-            self.caret_pos -= 1
-            if event.ctrl:
-                snap_chars = ".-+*/%()"
-                i = self.caret_pos
-                while axis_val[i - 1:i] not in snap_chars:
-                    i -= 1
-                self.caret_pos = i
-        elif event.type in self.key_map["move_caret_home"]:
-            self.caret_pos = 0
-        elif event.type in self.key_map["move_caret_end"]:
-            self.caret_pos = len(axis_val)
-        elif event.type in self.key_char_map:
-            # Currently accessing event.ascii seems to crash Blender
-            c = self.key_char_map[event.type]
-            if event.shift:
-                if c == "8":
-                    c = "*"
-                elif c == "5":
-                    c = "%"
-                elif c == "9":
-                    c = "("
-                elif c == "0":
-                    c = ")"
-            axis_val = axis_val[0:self.caret_pos] + c + \
-                       axis_val[self.caret_pos:len(axis_val)]
-            self.caret_pos += 1
-        
-        self.caret_pos = min(max(self.caret_pos, 0), len(axis_val))
-        
-        self.set_axis_input(axis_id, axis_val)
-    
-    # ====== DRAWING ====== #
-    def gizmo_distance(self, pos):
-        rv3d = self.vu.region_data
-        if rv3d.view_perspective == 'ORTHO':
-            dist = rv3d.view_distance
-        else:
-            view_pos = self.vu.get_viewpoint()
-            view_dir = self.vu.get_direction()
-            dist = (pos - view_pos).dot(view_dir)
-        return dist
-    
-    def gizmo_scale(self, pos):
-        return self.gizmo_distance(pos) * self.gizmo_factor
-    
-    def check_v3d_local(self, context):
-        csu_v3d = self.csu.space_data
-        v3d = context.space_data
-        if csu_v3d.local_view:
-            return csu_v3d != v3d
-        return v3d.local_view
-    
-    def draw_3d(self, context):
-        if self.check_v3d_local(context):
-            return
-        
-        if time.time() < (self.click_start + self.click_period):
-            return
-        
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        initial_matrix = self.particles[0].get_initial_matrix()
-        
-        sys_matrix = self.csu.get_matrix()
-        if tfm_opts.use_relative_coords:
-            sys_matrix.translation = initial_matrix.translation.copy()
-        sys_origin = sys_matrix.to_translation()
-        dest_point = self.particles[0].get_location()
-        
-        if self.is_normal_visible():
-            p0, x, y, z, _x, _z = \
-                self.get_normal_params(tfm_opts, dest_point)
-            
-            # use theme colors?
-            #ThemeView3D.normal
-            #ThemeView3D.vertex_normal
-            
-            bgl.glDisable(bgl.GL_LINE_STIPPLE)
-            
-            if settings.draw_N:
-                bgl.glColor4f(0, 1, 1, 1)
-                draw_arrow(p0, _x, y, z) # Z (normal)
-            if settings.draw_T1:
-                bgl.glColor4f(1, 0, 1, 1)
-                draw_arrow(p0, y, _z, x) # X (1st tangential)
-            if settings.draw_T2:
-                bgl.glColor4f(1, 1, 0, 1)
-                draw_arrow(p0, _z, x, y) # Y (2nd tangential)
-            
-            bgl.glEnable(bgl.GL_BLEND)
-            bgl.glDisable(bgl.GL_DEPTH_TEST)
-            
-            if settings.draw_N:
-                bgl.glColor4f(0, 1, 1, 0.25)
-                draw_arrow(p0, _x, y, z) # Z (normal)
-            if settings.draw_T1:
-                bgl.glColor4f(1, 0, 1, 0.25)
-                draw_arrow(p0, y, _z, x) # X (1st tangential)
-            if settings.draw_T2:
-                bgl.glColor4f(1, 1, 0, 0.25)
-                draw_arrow(p0, _z, x, y) # Y (2nd tangential)
-        
-        if settings.draw_guides:
-            p0 = dest_point
-            try:
-                p00 = sys_matrix.inverted() * p0
-            except:
-                # this is some degenerate system
-                p00 = p0.copy()
-            
-            axes_line_params = [
-                (Vector((0, p00.y, p00.z)), (1, 0, 0)),
-                (Vector((p00.x, 0, p00.z)), (0, 1, 0)),
-                (Vector((p00.x, p00.y, 0)), (0, 0, 1)),
-            ]
-            
-            for i in range(3):
-                p1, color = axes_line_params[i]
-                p1 = sys_matrix * p1
-                constrained = (self.axes_coords[i] is not None) or \
-                    (not self.allowed_axes[i])
-                alpha = (0.25 if constrained else 1.0)
-                draw_line_hidden_depth(p0, p1, color, \
-                    alpha, alpha, False, True)
-            
-            # line from origin to cursor
-            p0 = sys_origin
-            p1 = dest_point
-            
-            bgl.glEnable(bgl.GL_LINE_STIPPLE)
-            bgl.glColor4f(1, 1, 0, 1)
-            
-            draw_line_hidden_depth(p0, p1, (1, 1, 0), 1.0, 0.5, True, True)
-        
-        if settings.draw_snap_elements:
-            sui = self.su.implementation
-            if sui.potential_snap_elements and (sui.snap_type == 'EDGE'):
-                bgl.glDisable(bgl.GL_LINE_STIPPLE)
-                
-                bgl.glEnable(bgl.GL_BLEND)
-                bgl.glDisable(bgl.GL_DEPTH_TEST)
-                
-                bgl.glLineWidth(2)
-                bgl.glColor4f(0, 0, 1, 0.5)
-                
-                bgl.glBegin(bgl.GL_LINE_LOOP)
-                for p in sui.potential_snap_elements:
-                    bgl.glVertex3f(p[0], p[1], p[2])
-                bgl.glEnd()
-            elif sui.potential_snap_elements and (sui.snap_type == 'FACE'):
-                bgl.glEnable(bgl.GL_BLEND)
-                bgl.glDisable(bgl.GL_DEPTH_TEST)
-                
-                bgl.glColor4f(0, 1, 0, 0.5)
-                
-                co = sui.potential_snap_elements
-                tris = tessellate_polygon([co])
-                bgl.glBegin(bgl.GL_TRIANGLES)
-                for tri in tris:
-                    for vi in tri:
-                        p = co[vi]
-                        bgl.glVertex3f(p[0], p[1], p[2])
-                bgl.glEnd()
-    
-    def draw_2d(self, context):
-        if self.check_v3d_local(context):
-            return
-        
-        r = context.region
-        rv3d = context.region_data
-        
-        settings = find_settings()
-        
-        if settings.draw_snap_elements:
-            sui = self.su.implementation
-            
-            snap_points = []
-            if sui.potential_snap_elements and \
-                    (sui.snap_type in {'VERTEX', 'VOLUME'}):
-                snap_points.extend(sui.potential_snap_elements)
-            if sui.extra_snap_points:
-                snap_points.extend(sui.extra_snap_points)
-            
-            if snap_points:
-                bgl.glEnable(bgl.GL_BLEND)
-                
-                bgl.glPointSize(5)
-                bgl.glColor4f(1, 0, 0, 0.5)
-                
-                bgl.glBegin(bgl.GL_POINTS)
-                for p in snap_points:
-                    p = location_3d_to_region_2d(r, rv3d, p)
-                    if p is not None:
-                        bgl.glVertex2f(p[0], p[1])
-                bgl.glEnd()
-                
-                bgl.glPointSize(1)
-        
-        if self.transform_mode == 'MOVE':
-            return
-        
-        bgl.glEnable(bgl.GL_LINE_STIPPLE)
-        
-        bgl.glLineWidth(1)
-        
-        bgl.glColor4f(0, 0, 0, 1)
-        draw_line_2d(self.origin_xy, self.xy)
-        
-        bgl.glDisable(bgl.GL_LINE_STIPPLE)
-        
-        line_width = 3
-        bgl.glLineWidth(line_width)
-        
-        L = 12.0
-        arrow_len = 6.0
-        arrow_width = 8.0
-        arrow_space = 5.0
-        
-        Lmax = arrow_space * 2 + L * 2 + line_width
-        
-        pos = self.xy.to_2d()
-        normal = self.prev_delta_xy.to_2d().normalized()
-        dist = self.prev_delta_xy.length
-        tangential = Vector((-normal[1], normal[0]))
-        
-        if self.transform_mode == 'ROTATE':
-            n_axes = sum(int(v) for v in self.allowed_axes)
-            if n_axes == 2:
-                bgl.glColor4f(0.4, 0.15, 0.15, 1)
-                for sgn in (-1, 1):
-                    n = sgn * Vector((0, 1))
-                    p0 = pos + arrow_space * n
-                    draw_arrow_2d(p0, n, L, arrow_len, arrow_width)
-                
-                bgl.glColor4f(0.11, 0.51, 0.11, 1)
-                for sgn in (-1, 1):
-                    n = sgn * Vector((1, 0))
-                    p0 = pos + arrow_space * n
-                    draw_arrow_2d(p0, n, L, arrow_len, arrow_width)
-            else:
-                bgl.glColor4f(0, 0, 0, 1)
-                for sgn in (-1, 1):
-                    n = sgn * tangential
-                    if dist < Lmax:
-                        n *= dist / Lmax
-                    p0 = pos + arrow_space * n
-                    draw_arrow_2d(p0, n, L, arrow_len, arrow_width)
-        elif self.transform_mode == 'SCALE':
-            bgl.glColor4f(0, 0, 0, 1)
-            for sgn in (-1, 1):
-                n = sgn * normal
-                p0 = pos + arrow_space * n
-                draw_arrow_2d(p0, n, L, arrow_len, arrow_width)
-        
-        bgl.glLineWidth(1)
-    
-    def draw_axes_coords(self, context, header_size):
-        if self.check_v3d_local(context):
-            return
-        
-        if time.time() < (self.click_start + self.click_period):
-            return
-        
-        v3d = context.space_data
-        
-        userprefs_view = context.user_preferences.view
-        
-        tool_settings = context.tool_settings
-        
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        localmat = CursorDynamicSettings.local_matrix
-        
-        font_id = 0 # default font
-        
-        font_size = 11
-        blf.size(font_id, font_size, 72) # font, point size, dpi
-        
-        tet = context.user_preferences.themes[0].text_editor
-        
-        # Prepare the table...
-        if self.transform_mode == 'MOVE':
-            axis_prefix = ("D" if tfm_opts.use_relative_coords else "")
-        elif self.transform_mode == 'SCALE':
-            axis_prefix = "S"
-        else:
-            axis_prefix = "R"
-        axis_names = ["X", "Y", "Z"]
-        
-        axis_cells = []
-        coord_cells = []
-        #caret_cell = TextCell("_", tet.cursor)
-        caret_cell = TextCell("|", tet.cursor)
-        
-        try:
-            axes_text = self.get_axes_text()
-            
-            for i in range(3):
-                color = tet.space.text
-                alpha = (1.0 if self.allowed_axes[i] else 0.5)
-                text = axis_prefix + axis_names[i] + " : "
-                axis_cells.append(TextCell(text, color, alpha))
-                
-                if self.axes_values[i]:
-                    if self.axes_eval_success[i]:
-                        color = tet.syntax_numbers
-                    else:
-                        color = tet.syntax_string
-                else:
-                    color = tet.space.text
-                text = axes_text[i]
-                coord_cells.append(TextCell(text, color))
-        except Exception as e:
-            print(e)
-        
-        mode_cells = []
-        
-        try:
-            snap_type = self.su.implementation.snap_type
-            if snap_type is None:
-                color = tet.space.text
-            elif (not self.use_object_centers) or \
-                    (snap_type == 'INCREMENT'):
-                color = tet.syntax_numbers
-            else:
-                color = tet.syntax_special
-            text = tool_settings.snap_element
-            if text == 'VOLUME':
-                text = "BBOX"
-            mode_cells.append(TextCell(text, color))
-            
-            if self.csu.tou.is_custom:
-                color = tet.space.text
-            else:
-                color = tet.syntax_builtin
-            text = self.csu.tou.get_title()
-            mode_cells.append(TextCell(text, color))
-            
-            color = tet.space.text
-            text = self.csu.get_pivot_name(raw=True)
-            if self.use_object_centers:
-                color = tet.syntax_special
-            mode_cells.append(TextCell(text, color))
-        except Exception as e:
-            print(e)
-        
-        hdr_w, hdr_h = header_size
-        
-        try:
-            xyz_x_start_min = 12
-            xyz_x_start = xyz_x_start_min
-            mode_x_start = 6
-            
-            mode_margin = 4
-            xyz_margin = 16
-            blend_margin = 32
-            
-            color = tet.space.back
-            bgl.glColor4f(color[0], color[1], color[2], 1.0)
-            draw_rect(0, 0, hdr_w, hdr_h)
-            
-            if tool_settings.use_snap_self:
-                x = hdr_w - mode_x_start
-                y = hdr_h / 2
-                cell = mode_cells[0]
-                x -= cell.w
-                y -= cell.h * 0.5
-                bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-                draw_rect(x, y, cell.w, cell.h, 1, True)
-            
-            x = hdr_w - mode_x_start
-            y = hdr_h / 2
-            for cell in mode_cells:
-                cell.draw(x, y, (1, 0.5))
-                x -= (cell.w + mode_margin)
-            
-            curr_axis_x_start = 0
-            curr_axis_x_end = 0
-            caret_x = 0
-            
-            xyz_width = 0
-            for i in range(3):
-                if i == self.current_axis:
-                    curr_axis_x_start = xyz_width
-                
-                xyz_width += axis_cells[i].w
-                
-                if i == self.current_axis:
-                    char_offset = 0
-                    if self.axes_values[i]:
-                        char_offset = blf.dimensions(font_id,
-                            coord_cells[i].text[:self.caret_pos])[0]
-                    caret_x = xyz_width + char_offset
-                
-                xyz_width += coord_cells[i].w
-                
-                if i == self.current_axis:
-                    curr_axis_x_end = xyz_width
-                
-                xyz_width += xyz_margin
-            
-            xyz_width = int(xyz_width)
-            xyz_width_ext = xyz_width + blend_margin
-            
-            offset = (xyz_x_start + curr_axis_x_end) - hdr_w
-            if offset > 0:
-                xyz_x_start -= offset
-            
-            offset = xyz_x_start_min - (xyz_x_start + curr_axis_x_start)
-            if offset > 0:
-                xyz_x_start += offset
-            
-            offset = (xyz_x_start + caret_x) - hdr_w
-            if offset > 0:
-                xyz_x_start -= offset
-            
-            # somewhy GL_BLEND should be set right here
-            # to actually draw the box with blending %)
-            # (perhaps due to text draw happened before)
-            bgl.glEnable(bgl.GL_BLEND)
-            bgl.glShadeModel(bgl.GL_SMOOTH)
-            gl_enable(bgl.GL_SMOOTH, True)
-            color = tet.space.back
-            bgl.glBegin(bgl.GL_TRIANGLE_STRIP)
-            bgl.glColor4f(color[0], color[1], color[2], 1.0)
-            bgl.glVertex2i(0, 0)
-            bgl.glVertex2i(0, hdr_h)
-            bgl.glVertex2i(xyz_width, 0)
-            bgl.glVertex2i(xyz_width, hdr_h)
-            bgl.glColor4f(color[0], color[1], color[2], 0.0)
-            bgl.glVertex2i(xyz_width_ext, 0)
-            bgl.glVertex2i(xyz_width_ext, hdr_h)
-            bgl.glEnd()
-            
-            x = xyz_x_start
-            y = hdr_h / 2
-            for i in range(3):
-                cell = axis_cells[i]
-                cell.draw(x, y, (0, 0.5))
-                x += cell.w
-                
-                cell = coord_cells[i]
-                cell.draw(x, y, (0, 0.5))
-                x += (cell.w + xyz_margin)
-            
-            caret_x -= blf.dimensions(font_id, caret_cell.text)[0] * 0.5
-            caret_cell.draw(xyz_x_start + caret_x, y, (0, 0.5))
-            
-            bgl.glEnable(bgl.GL_BLEND)
-            bgl.glShadeModel(bgl.GL_SMOOTH)
-            gl_enable(bgl.GL_SMOOTH, True)
-            color = tet.space.back
-            bgl.glBegin(bgl.GL_TRIANGLE_STRIP)
-            bgl.glColor4f(color[0], color[1], color[2], 1.0)
-            bgl.glVertex2i(0, 0)
-            bgl.glVertex2i(0, hdr_h)
-            bgl.glVertex2i(xyz_x_start_min, 0)
-            bgl.glColor4f(color[0], color[1], color[2], 0.0)
-            bgl.glVertex2i(xyz_x_start_min, hdr_h)
-            bgl.glEnd()
-            
-        except Exception as e:
-            print(e)
-        
-        return
-    
-    # ====== NORMAL SNAPSHOT ====== #
-    def is_normal_visible(self):
-        if self.csu.tou.get() == "Surface":
-            return True
-        
-        if self.use_object_centers:
-            return False
-        
-        return self.su.implementation.snap_type \
-            not in {None, 'INCREMENT', 'VOLUME'}
-    
-    def get_normal_params(self, tfm_opts, dest_point):
-        surf_matrix = self.csu.get_matrix("Surface")
-        if tfm_opts.use_relative_coords:
-            surf_origin = dest_point
-        else:
-            surf_origin = surf_matrix.to_translation()
-        
-        m3 = surf_matrix.to_3x3()
-        p0 = surf_origin
-        scl = self.gizmo_scale(p0)
-        
-        # Normal and tangential are not always orthogonal
-        # (e.g. when normal is interpolated)
-        x = (m3 * Vector((1, 0, 0))).normalized()
-        y = (m3 * Vector((0, 1, 0))).normalized()
-        z = (m3 * Vector((0, 0, 1))).normalized()
-        
-        _x = z.cross(y)
-        _z = y.cross(x)
-        
-        return p0, x * scl, y * scl, z * scl, _x * scl, _z * scl
-    
-    def make_normal_snapshot(self, scene, tangential=False):
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        dest_point = self.particles[0].get_location()
-        
-        if self.is_normal_visible():
-            p0, x, y, z, _x, _z = \
-                self.get_normal_params(tfm_opts, dest_point)
-            
-            snapshot = bpy.data.objects.new("normal_snapshot", None)
-            
-            if tangential:
-                m = MatrixCompose(_z, y, x, p0)
-            else:
-                m = MatrixCompose(_x, y, z, p0)
-            snapshot.matrix_world = m
-            
-            snapshot.empty_draw_type = 'SINGLE_ARROW'
-            #snapshot.empty_draw_type = 'ARROWS'
-            #snapshot.layers = [True] * 20 # ?
-            scene.objects.link(snapshot)
-#============================================================================#
-
-
-class Particle:
-    pass
-
-class View3D_Cursor(Particle):
-    def __init__(self, context):
-        assert context.space_data.type == 'VIEW_3D'
-        self.v3d = context.space_data
-        self.initial_pos = self.get_location()
-        self.initial_matrix = Matrix.Translation(self.initial_pos)
-    
-    def revert(self):
-        self.set_location(self.initial_pos)
-    
-    def get_location(self):
-        return get_cursor_location(v3d=self.v3d)
-    
-    def set_location(self, value):
-        set_cursor_location(Vector(value), v3d=self.v3d)
-    
-    def get_rotation(self):
-        return Quaternion()
-    
-    def set_rotation(self, value):
-        pass
-    
-    def get_scale(self):
-        return Vector((1.0, 1.0, 1.0))
-    
-    def set_scale(self, value):
-        pass
-    
-    def get_matrix(self):
-        return Matrix.Translation(self.get_location())
-    
-    def set_matrix(self, value):
-        self.set_location(value.to_translation())
-    
-    def get_initial_matrix(self):
-        return self.initial_matrix
-
-class View3D_Object(Particle):
-    def __init__(self, obj):
-        self.obj = obj
-    
-    def get_location(self):
-        # obj.location seems to be in parent's system...
-        # or even maybe not bounded by constraints %)
-        return self.obj.matrix_world.to_translation()
-
-class View3D_EditMesh_Vertex(Particle):
-    pass
-
-class View3D_EditMesh_Edge(Particle):
-    pass
-
-class View3D_EditMesh_Face(Particle):
-    pass
-
-class View3D_EditSpline_Point(Particle):
-    pass
-
-class View3D_EditSpline_BezierPoint(Particle):
-    pass
-
-class View3D_EditSpline_BezierHandle(Particle):
-    pass
-
-class View3D_EditMeta_Element(Particle):
-    pass
-
-class View3D_EditBone_Bone(Particle):
-    pass
-
-class View3D_EditBone_HeadTail(Particle):
-    pass
-
-class View3D_PoseBone(Particle):
-    pass
-
-class UV_Cursor(Particle):
-    pass
-
-class UV_Vertex(Particle):
-    pass
-
-class UV_Edge(Particle):
-    pass
-
-class UV_Face(Particle):
-    pass
-
-# Other types:
-# NLA / Dopesheet / Graph editor ...
-
-# Particles are used in the following situations:
-# - as subjects of transformation
-# - as reference point(s) for cursor transformation
-# Note: particles 'dragged' by Proportional Editing
-# are a separate issue (they can come and go).
-def gather_particles(**kwargs):
-    context = kwargs.get("context", bpy.context)
-    
-    area_type = kwargs.get("area_type", context.area.type)
-    
-    scene = kwargs.get("scene", context.scene)
-    
-    space_data = kwargs.get("space_data", context.space_data)
-    region_data = kwargs.get("region_data", context.region_data)
-    
-    particles = []
-    pivots = {}
-    normal_system = None
-    
-    active_element = None
-    cursor_pos = None
-    median = None
-    
-    if area_type == 'VIEW_3D':
-        context_mode = kwargs.get("context_mode", context.mode)
-        
-        selected_objects = kwargs.get("selected_objects",
-            context.selected_objects)
-        
-        active_object = kwargs.get("active_object",
-            context.active_object)
-        
-        if context_mode == 'OBJECT':
-            for obj in selected_objects:
-                particle = View3D_Object(obj)
-                particles.append(particle)
-            
-            if active_object:
-                active_element = active_object.\
-                    matrix_world.to_translation()
-        
-        # On Undo/Redo scene hash value is changed ->
-        # -> the monitor tries to update the CSU ->
-        # -> object.mode_set seem to somehow conflict
-        # with Undo/Redo mechanisms.
-        elif active_object and active_object.data and \
-        (context_mode in {
-        'EDIT_MESH', 'EDIT_METABALL',
-        'EDIT_CURVE', 'EDIT_SURFACE',
-        'EDIT_ARMATURE', 'POSE'}):
-            
-            m = active_object.matrix_world
-            
-            positions = []
-            normal = Vector((0, 0, 0))
-            
-            if context_mode == 'EDIT_MESH':
-                bm = bmesh.from_edit_mesh(active_object.data)
-                
-                if bm.select_history:
-                    elem = bm.select_history[-1]
-                    if isinstance(elem, bmesh.types.BMVert):
-                        active_element = elem.co.copy()
-                    else:
-                        active_element = Vector()
-                        for v in elem.verts:
-                            active_element += v.co
-                        active_element *= 1.0 / len(elem.verts)
-                
-                for v in bm.verts:
-                    if v.select:
-                        positions.append(v.co)
-                        normal += v.normal
-                
-                # mimic Blender's behavior (as of now,
-                # order of selection is ignored)
-                if len(positions) == 2:
-                    normal = positions[1] - positions[0]
-                elif len(positions) == 3:
-                    a = positions[0] - positions[1]
-                    b = positions[2] - positions[1]
-                    normal = a.cross(b)
-            elif context_mode == 'EDIT_METABALL':
-                active_elem = active_object.data.elements.active
-                if active_elem:
-                    active_element = active_elem.co.copy()
-                    active_element = active_object.\
-                        matrix_world * active_element
-                
-                # Currently there is no API for element.select
-                #for element in active_object.data.elements:
-                #    if element.select:
-                #        positions.append(element.co)
-            elif context_mode == 'EDIT_ARMATURE':
-                # active bone seems to have the same pivot
-                # as median of the selection
-                '''
-                active_bone = active_object.data.edit_bones.active
-                if active_bone:
-                    active_element = active_bone.head + \
-                                     active_bone.tail
-                    active_element = active_object.\
-                        matrix_world * active_element
-                '''
-                
-                for bone in active_object.data.edit_bones:
-                    if bone.select_head:
-                        positions.append(bone.head)
-                    if bone.select_tail:
-                        positions.append(bone.tail)
-            elif context_mode == 'POSE':
-                active_bone = active_object.data.bones.active
-                if active_bone:
-                    active_element = active_bone.\
-                        matrix_local.translation.to_3d()
-                    active_element = active_object.\
-                        matrix_world * active_element
-                
-                # consider only topmost parents
-                bones = set()
-                for bone in active_object.data.bones:
-                    if bone.select:
-                        bones.add(bone)
-                
-                parents = set()
-                for bone in bones:
-                    if not set(bone.parent_recursive).intersection(bones):
-                        parents.add(bone)
-                
-                for bone in parents:
-                    positions.append(bone.matrix_local.translation.to_3d())
-            else:
-                for spline in active_object.data.splines:
-                    for point in spline.bezier_points:
-                        if point.select_control_point:
-                            positions.append(point.co)
-                        else:
-                            if point.select_left_handle:
-                                positions.append(point.handle_left)
-                            if point.select_right_handle:
-                                positions.append(point.handle_right)
-                        
-                        n = None
-                        nL = point.co - point.handle_left
-                        nR = point.co - point.handle_right
-                        #nL = point.handle_left.copy()
-                        #nR = point.handle_right.copy()
-                        if point.select_control_point:
-                            n = nL + nR
-                        elif point.select_left_handle or \
-                             point.select_right_handle:
-                            n = nL + nR
-                        else:
-                            if point.select_left_handle:
-                                n = -nL
-                            if point.select_right_handle:
-                                n = nR
-                        
-                        if n is not None:
-                            if n.length_squared < epsilon:
-                                n = -nL
-                            normal += n.normalized()
-                    
-                    for point in spline.points:
-                        if point.select:
-                            positions.append(point.co)
-            
-            if len(positions) != 0:
-                if normal.length_squared < epsilon:
-                    normal = Vector((0, 0, 1))
-                normal.rotate(m)
-                normal.normalize()
-                
-                if (1.0 - abs(normal.z)) < epsilon:
-                    t1 = Vector((1, 0, 0))
-                else:
-                    t1 = Vector((0, 0, 1)).cross(normal)
-                t2 = t1.cross(normal)
-                normal_system = MatrixCompose(t1, t2, normal)
-                
-                median, bbox_center = calc_median_bbox_pivots(positions)
-                median = m * median
-                bbox_center = m * bbox_center
-                
-                # Currently I don't know how to get active mesh element
-                if active_element is None:
-                    if context_mode == 'EDIT_ARMATURE':
-                        # Somewhy EDIT_ARMATURE has such behavior
-                        active_element = bbox_center
-                    else:
-                        active_element = median
-            else:
-                if active_element is None:
-                    active_element = active_object.\
-                        matrix_world.to_translation()
-                
-                median = active_element
-                bbox_center = active_element
-                
-                normal_system = active_object.matrix_world.to_3x3()
-                normal_system.col[0].normalize()
-                normal_system.col[1].normalize()
-                normal_system.col[2].normalize()
-        else:
-            # paint/sculpt, etc.?
-            particle = View3D_Object(active_object)
-            particles.append(particle)
-            
-            if active_object:
-                active_element = active_object.\
-                    matrix_world.to_translation()
-        
-        cursor_pos = get_cursor_location(v3d=space_data)
-    
-    #elif area_type == 'IMAGE_EDITOR':
-        # currently there is no way to get UV editor's
-        # offset (and maybe some other parameters
-        # required to implement these operators)
-        #cursor_pos = space_data.uv_editor.cursor_location
-    
-    #elif area_type == 'EMPTY':
-    #elif area_type == 'GRAPH_EDITOR':
-    #elif area_type == 'OUTLINER':
-    #elif area_type == 'PROPERTIES':
-    #elif area_type == 'FILE_BROWSER':
-    #elif area_type == 'INFO':
-    #elif area_type == 'SEQUENCE_EDITOR':
-    #elif area_type == 'TEXT_EDITOR':
-    #elif area_type == 'AUDIO_WINDOW':
-    #elif area_type == 'DOPESHEET_EDITOR':
-    #elif area_type == 'NLA_EDITOR':
-    #elif area_type == 'SCRIPTS_WINDOW':
-    #elif area_type == 'TIMELINE':
-    #elif area_type == 'NODE_EDITOR':
-    #elif area_type == 'LOGIC_EDITOR':
-    #elif area_type == 'CONSOLE':
-    #elif area_type == 'USER_PREFERENCES':
-    
-    else:
-        print("gather_particles() not implemented for '{}'".\
-              format(area_type))
-        return None, None
-    
-    # 'INDIVIDUAL_ORIGINS' is not handled here
-    
-    if cursor_pos:
-        pivots['CURSOR'] = cursor_pos.copy()
-    
-    if active_element:
-        # in v3d: ACTIVE_ELEMENT
-        pivots['ACTIVE'] = active_element.copy()
-    
-    if (len(particles) != 0) and (median is None):
-        positions = (p.get_location() for p in particles)
-        median, bbox_center = calc_median_bbox_pivots(positions)
-    
-    if median:
-        # in v3d: MEDIAN_POINT, in UV editor: MEDIAN
-        pivots['MEDIAN'] = median.copy()
-        # in v3d: BOUNDING_BOX_CENTER, in UV editor: CENTER
-        pivots['CENTER'] = bbox_center.copy()
-    
-    csu = CoordinateSystemUtility(scene, space_data, region_data, \
-        pivots, normal_system)
-    
-    return particles, csu
-
-def calc_median_bbox_pivots(positions):
-    median = None # pos can be 3D or 2D
-    bbox = [None, None]
-    
-    n = 0
-    for pos in positions:
-        extend_bbox(bbox, pos)
-        try:
-            median += pos
-        except:
-            median = pos.copy()
-        n += 1
-    
-    median = median / n
-    bbox_center = (Vector(bbox[0]) + Vector(bbox[1])) * 0.5
-    
-    return median, bbox_center
-
-def extend_bbox(bbox, pos):
-    try:
-        bbox[0] = tuple(min(e0, e1) for e0, e1 in zip(bbox[0], pos))
-        bbox[1] = tuple(max(e0, e1) for e0, e1 in zip(bbox[1], pos))
-    except:
-        bbox[0] = tuple(pos)
-        bbox[1] = tuple(pos)
-
-
-# ====== COORDINATE SYSTEM UTILITY ====== #
-class CoordinateSystemUtility:
-    pivot_name_map = {
-        'CENTER':'CENTER',
-        'BOUNDING_BOX_CENTER':'CENTER',
-        'MEDIAN':'MEDIAN',
-        'MEDIAN_POINT':'MEDIAN',
-        'CURSOR':'CURSOR', 
-        'INDIVIDUAL_ORIGINS':'INDIVIDUAL',
-        'ACTIVE_ELEMENT':'ACTIVE',
-        'WORLD':'WORLD',
-        'SURFACE':'SURFACE', # ?
-        'BOOKMARK':'BOOKMARK',
-    }
-    pivot_v3d_map = {
-        'CENTER':'BOUNDING_BOX_CENTER',
-        'MEDIAN':'MEDIAN_POINT',
-        'CURSOR':'CURSOR', 
-        'INDIVIDUAL':'INDIVIDUAL_ORIGINS',
-        'ACTIVE':'ACTIVE_ELEMENT',
-    }
-    
-    def __init__(self, scene, space_data, region_data, \
-                 pivots, normal_system):
-        self.space_data = space_data
-        self.region_data = region_data
-        
-        if space_data.type == 'VIEW_3D':
-            self.pivot_map_inv = self.pivot_v3d_map
-        
-        self.tou = TransformOrientationUtility(
-            scene, space_data, region_data)
-        self.tou.normal_system = normal_system
-        
-        self.pivots = pivots
-        
-        # Assigned by caller (for cursor or selection)
-        self.source_pos = None
-        self.source_rot = None
-        self.source_scale = None
-    
-    def set_orientation(self, name):
-        self.tou.set(name)
-    
-    def set_pivot(self, pivot):
-        self.space_data.pivot_point = self.pivot_map_inv[pivot]
-    
-    def get_pivot_name(self, name=None, relative=None, raw=False):
-        pivot = self.pivot_name_map[self.space_data.pivot_point]
-        if raw:
-            return pivot
-        
-        if not name:
-            name = self.tou.get()
-        
-        if relative is None:
-            settings = find_settings()
-            tfm_opts = settings.transform_options
-            relative = tfm_opts.use_relative_coords
-        
-        if relative:
-            pivot = "RELATIVE"
-        elif (name == 'GLOBAL') or (pivot == 'WORLD'):
-            pivot = 'WORLD'
-        elif (name == "Surface") or (pivot == 'SURFACE'):
-            pivot = "SURFACE"
-        
-        return pivot
-    
-    def get_origin(self, name=None, relative=None, pivot=None):
-        if not pivot:
-            pivot = self.get_pivot_name(name, relative)
-        
-        if relative or (pivot == "RELATIVE"):
-            # "relative" parameter overrides "pivot"
-            return self.source_pos
-        elif pivot == 'WORLD':
-            return Vector()
-        elif pivot == "SURFACE":
-            runtime_settings = find_runtime_settings()
-            return Vector(runtime_settings.surface_pos)
-        else:
-            if pivot == 'INDIVIDUAL':
-                pivot = 'MEDIAN'
-            
-            #if pivot == 'ACTIVE':
-            #    print(self.pivots)
-            
-            try:
-                return self.pivots[pivot]
-            except:
-                return Vector()
-    
-    def get_matrix(self, name=None, relative=None, pivot=None):
-        if not name:
-            name = self.tou.get()
-        
-        matrix = self.tou.get_matrix(name)
-        
-        if isinstance(pivot, Vector):
-            pos = pivot
-        else:
-            pos = self.get_origin(name, relative, pivot)
-        
-        return to_matrix4x4(matrix, pos)
-
-# ====== TRANSFORM ORIENTATION UTILITIES ====== #
-class TransformOrientationUtility:
-    special_systems = {"Surface", "Scaled"}
-    predefined_systems = {
-        'GLOBAL', 'LOCAL', 'VIEW', 'NORMAL', 'GIMBAL',
-        "Scaled", "Surface",
-    }
-    
-    def __init__(self, scene, v3d, rv3d):
-        self.scene = scene
-        self.v3d = v3d
-        self.rv3d = rv3d
-        
-        self.custom_systems = [item for item in scene.orientations \
-            if item.name not in self.special_systems]
-        
-        self.is_custom = False
-        self.custom_id = -1
-        
-        # This is calculated elsewhere
-        self.normal_system = None
-        
-        self.set(v3d.transform_orientation)
-    
-    def get(self):
-        return self.transform_orientation
-    
-    def get_title(self):
-        if self.is_custom:
-            return self.transform_orientation
-        
-        name = self.transform_orientation
-        return name[:1].upper() + name[1:].lower()
-    
-    def set(self, name, set_v3d=True):
-        if isinstance(name, int):
-            n = len(self.custom_systems)
-            if n == 0:
-                # No custom systems, do nothing
-                return
-            
-            increment = name
-            
-            if self.is_custom:
-                # If already custom, switch to next custom system
-                self.custom_id = (self.custom_id + increment) % n
-            
-            self.is_custom = True
-            
-            name = self.custom_systems[self.custom_id].name
-        else:
-            self.is_custom = name not in self.predefined_systems
-            
-            if self.is_custom:
-                self.custom_id = next((i for i, v in \
-                    enumerate(self.custom_systems) if v.name == name), -1)
-            
-            if name in self.special_systems:
-                # Ensure such system exists
-                self.get_custom(name)
-        
-        self.transform_orientation = name
-        
-        if set_v3d:
-            self.v3d.transform_orientation = name
-    
-    def get_matrix(self, name=None):
-        active_obj = self.scene.objects.active
-        
-        if not name:
-            name = self.transform_orientation
-        
-        if self.is_custom:
-            matrix = self.custom_systems[self.custom_id].matrix.copy()
-        else:
-            if (name == 'VIEW') and self.rv3d:
-                matrix = self.rv3d.view_rotation.to_matrix()
-            elif name == "Surface":
-                matrix = self.get_custom(name).matrix.copy()
-            elif (name == 'GLOBAL') or (not active_obj):
-                matrix = Matrix().to_3x3()
-            elif (name == 'NORMAL') and self.normal_system:
-                matrix = self.normal_system.copy()
-            else:
-                matrix = active_obj.matrix_world.to_3x3()
-                if name == "Scaled":
-                    self.get_custom(name).matrix = matrix
-                else: # 'LOCAL', 'GIMBAL', ['NORMAL'] for now
-                    matrix[0].normalize()
-                    matrix[1].normalize()
-                    matrix[2].normalize()
-        
-        return matrix
-    
-    def get_custom(self, name):
-        try:
-            return self.scene.orientations[name]
-        except:
-            return create_transform_orientation(
-                self.scene, name, Matrix())
-
-# Is there a less cumbersome way to create transform orientation?
-def create_transform_orientation(scene, name=None, matrix=None):
-    active_obj = scene.objects.active
-    prev_mode = None
-    
-    if active_obj:
-        prev_mode = active_obj.mode
-        bpy.ops.object.mode_set(mode='OBJECT')
-    else:
-        bpy.ops.object.add()
-    
-    # ATTENTION! This uses context's scene
-    bpy.ops.transform.create_orientation()
-    
-    tfm_orient = scene.orientations[-1]
-    
-    if name is not None:
-        basename = name
-        i = 1
-        while name in scene.orientations:
-            name = "%s.%03i" % (basename, i)
-            i += 1
-        tfm_orient.name = name
-    
-    if matrix:
-        tfm_orient.matrix = matrix.to_3x3()
-    
-    if active_obj:
-        bpy.ops.object.mode_set(mode=prev_mode)
-    else:
-        bpy.ops.object.delete()
-    
-    return tfm_orient
-
-# ====== VIEW UTILITY CLASS ====== #
-class ViewUtility:
-    methods = dict(
-        get_locks = lambda: {},
-        set_locks = lambda locks: None,
-        get_position = lambda: Vector(),
-        set_position = lambda: None,
-        get_rotation = lambda: Quaternion(),
-        get_direction = lambda: Vector((0, 0, 1)),
-        get_viewpoint = lambda: Vector(),
-        get_matrix = lambda: Matrix(),
-        get_point = lambda xy, pos: \
-            Vector((xy[0], xy[1], 0)),
-        get_ray = lambda xy: tuple(
-            Vector((xy[0], xy[1], 0)),
-            Vector((xy[0], xy[1], 1)),
-            False),
-    )
-    
-    def __init__(self, region, space_data, region_data):
-        self.region = region
-        self.space_data = space_data
-        self.region_data = region_data
-        
-        if space_data.type == 'VIEW_3D':
-            self.implementation = View3DUtility(
-                region, space_data, region_data)
-        else:
-            self.implementation = None
-        
-        if self.implementation:
-            for name in self.methods:
-                setattr(self, name,
-                    getattr(self.implementation, name))
-        else:
-            for name, value in self.methods.items():
-                setattr(self, name, value)
-
-class View3DUtility:
-    lock_types = {"lock_cursor":False, "lock_object":None, "lock_bone":""}
-    
-    # ====== INITIALIZATION / CLEANUP ====== #
-    def __init__(self, region, space_data, region_data):
-        self.region = region
-        self.space_data = space_data
-        self.region_data = region_data
-    
-    # ====== GET VIEW MATRIX AND ITS COMPONENTS ====== #
-    def get_locks(self):
-        v3d = self.space_data
-        return {k:getattr(v3d, k) for k in self.lock_types}
-    
-    def set_locks(self, locks):
-        v3d = self.space_data
-        for k in self.lock_types:
-            setattr(v3d, k, locks.get(k, self.lock_types[k]))
-    
-    def _get_lock_obj_bone(self):
-        v3d = self.space_data
-        
-        obj = v3d.lock_object
-        if not obj:
-            return None, None
-        
-        if v3d.lock_bone:
-            try:
-                # this is not tested!
-                if obj.mode == 'EDIT':
-                    bone = obj.data.edit_bones[v3d.lock_bone]
-                else:
-                    bone = obj.data.bones[v3d.lock_bone]
-            except:
-                bone = None
-        
-        return obj, bone
-    
-    # TODO: learn how to get these values from
-    # rv3d.perspective_matrix and rv3d.view_matrix ?
-    def get_position(self, no_locks=False):
-        v3d = self.space_data
-        rv3d = self.region_data
-        
-        if no_locks:
-            return rv3d.view_location.copy()
-        
-        # rv3d.perspective_matrix and rv3d.view_matrix
-        # seem to have some weird translation components %)
-        
-        if rv3d.view_perspective == 'CAMERA':
-            p = v3d.camera.matrix_world.to_translation()
-            d = self.get_direction()
-            return p + d * rv3d.view_distance
-        else:
-            if v3d.lock_object:
-                obj, bone = self._get_lock_obj_bone()
-                if bone:
-                    return (obj.matrix_world * bone.matrix).to_translation()
-                else:
-                    return obj.matrix_world.to_translation()
-            elif v3d.lock_cursor:
-                return get_cursor_location(v3d=v3d)
-            else:
-                return rv3d.view_location.copy()
-    
-    def set_position(self, pos, no_locks=False):
-        v3d = self.space_data
-        rv3d = self.region_data
-        
-        pos = pos.copy()
-        
-        if no_locks:
-            rv3d.view_location = pos
-            return
-        
-        if rv3d.view_perspective == 'CAMERA':
-            d = self.get_direction()
-            v3d.camera.matrix_world.translation = pos - d * rv3d.view_distance
-        else:
-            if v3d.lock_object:
-                obj, bone = self._get_lock_obj_bone()
-                if bone:
-                    try:
-                        bone.matrix.translation = \
-                            obj.matrix_world.inverted() * pos
-                    except:
-                        # this is some degenerate object
-                        bone.matrix.translation = pos
-                else:
-                    obj.matrix_world.translation = pos
-            elif v3d.lock_cursor:
-                set_cursor_location(pos, v3d=v3d)
-            else:
-                rv3d.view_location = pos
-    
-    def get_rotation(self):
-        v3d = self.space_data
-        rv3d = self.region_data
-        
-        if rv3d.view_perspective == 'CAMERA':
-            return v3d.camera.matrix_world.to_quaternion()
-        else:
-            return rv3d.view_rotation
-    
-    def get_direction(self):
-        # Camera (as well as viewport) looks in the direction of -Z;
-        # Y is up, X is left
-        d = self.get_rotation() * Vector((0, 0, -1))
-        d.normalize()
-        return d
-    
-    def get_viewpoint(self):
-        v3d = self.space_data
-        rv3d = self.region_data
-        
-        if rv3d.view_perspective == 'CAMERA':
-            return v3d.camera.matrix_world.to_translation()
-        else:
-            p = self.get_position()
-            d = self.get_direction()
-            return p - d * rv3d.view_distance
-    
-    def get_matrix(self):
-        m = self.get_rotation().to_matrix()
-        m.resize_4x4()
-        m.translation = self.get_viewpoint()
-        return m
-    
-    def get_point(self, xy, pos):
-        region = self.region
-        rv3d = self.region_data
-        return region_2d_to_location_3d(region, rv3d, xy, pos)
-    
-    def get_ray(self, xy):
-        region = self.region
-        v3d = self.space_data
-        rv3d = self.region_data
-        
-        viewPos = self.get_viewpoint()
-        viewDir = self.get_direction()
-        
-        near = viewPos + viewDir * v3d.clip_start
-        far = viewPos + viewDir * v3d.clip_end
-        
-        a = region_2d_to_location_3d(region, rv3d, xy, near)
-        b = region_2d_to_location_3d(region, rv3d, xy, far)
-        
-        # When viewed from in-scene camera, near and far
-        # planes clip geometry even in orthographic mode.
-        clip = rv3d.is_perspective or (rv3d.view_perspective == 'CAMERA')
-        
-        return a, b, clip
-
-# ====== SNAP UTILITY CLASS ====== #
-class SnapUtility:
-    def __init__(self, context):
-        if context.area.type == 'VIEW_3D':
-            v3d = context.space_data
-            shade = v3d.viewport_shade
-            self.implementation = Snap3DUtility(context.scene, shade)
-            self.implementation.update_targets(
-                context.visible_objects, [])
-    
-    def dispose(self):
-        self.implementation.dispose()
-    
-    def update_targets(self, to_include, to_exclude):
-        self.implementation.update_targets(to_include, to_exclude)
-    
-    def set_modes(self, **kwargs):
-        return self.implementation.set_modes(**kwargs)
-    
-    def snap(self, *args, **kwargs):
-        return self.implementation.snap(*args, **kwargs)
-    
-class SnapUtilityBase:
-    def __init__(self):
-        self.targets = set()
-        # TODO: set to current blend settings?
-        self.interpolation = 'NEVER'
-        self.editmode = False
-        self.snap_type = None
-        self.projection = [None, None, None]
-        self.potential_snap_elements = None
-        self.extra_snap_points = None
-    
-    def update_targets(self, to_include, to_exclude):
-        self.targets.update(to_include)
-        self.targets.difference_update(to_exclude)
-    
-    def set_modes(self, **kwargs):
-        if "use_relative_coords" in kwargs:
-            self.use_relative_coords = kwargs["use_relative_coords"]
-        if "interpolation" in kwargs:
-            # NEVER, ALWAYS, SMOOTH
-            self.interpolation = kwargs["interpolation"]
-        if "editmode" in kwargs:
-            self.editmode = kwargs["editmode"]
-        if "snap_align" in kwargs:
-            self.snap_align = kwargs["snap_align"]
-        if "snap_type" in kwargs:
-            # 'INCREMENT', 'VERTEX', 'EDGE', 'FACE', 'VOLUME'
-            self.snap_type = kwargs["snap_type"]
-        if "axes_coords" in kwargs:
-            # none, point, line, plane
-            self.axes_coords = kwargs["axes_coords"]
-    
-    # ====== CURSOR REPOSITIONING ====== #
-    def snap(self, xy, src_matrix, initial_matrix, do_raycast, \
-        alt_snap, vu, csu, modify_Surface, use_object_centers):
-        
-        grid_step = self.grid_steps[alt_snap]
-        
-        su = self
-        use_relative_coords = su.use_relative_coords
-        snap_align = su.snap_align
-        axes_coords = su.axes_coords
-        snap_type = su.snap_type
-        
-        runtime_settings = find_runtime_settings()
-        
-        matrix = src_matrix.to_3x3()
-        pos = src_matrix.to_translation().copy()
-        
-        sys_matrix = csu.get_matrix()
-        if use_relative_coords:
-            sys_matrix.translation = initial_matrix.translation.copy()
-        
-        # Axes of freedom and line/plane parameters
-        start = Vector(((0 if v is None else v) for v in axes_coords))
-        direction = Vector(((v is not None) for v in axes_coords))
-        axes_of_freedom = 3 - int(sum(direction))
-        
-        # do_raycast is False when mouse is not moving
-        if do_raycast:
-            su.hide_bbox(True)
-            
-            self.potential_snap_elements = None
-            self.extra_snap_points = None
-            
-            set_stick_obj(csu.tou.scene, None)
-            
-            raycast = None
-            snap_to_obj = (snap_type != 'INCREMENT') #or use_object_centers
-            snap_to_obj = snap_to_obj and (snap_type is not None)
-            if snap_to_obj:
-                a, b, clip = vu.get_ray(xy)
-                view_dir = vu.get_direction()
-                raycast = su.snap_raycast(a, b, clip, view_dir, csu, alt_snap)
-            
-            if raycast:
-                surf_matrix, face_id, obj, orig_obj = raycast
-                
-                if not use_object_centers:
-                    self.potential_snap_elements = [
-                        (obj.matrix_world * obj.data.vertices[vi].co)
-                        for vi in obj.data.tessfaces[face_id].vertices
-                    ]
-                
-                if use_object_centers:
-                    self.extra_snap_points = \
-                        [obj.matrix_world.to_translation()]
-                elif alt_snap:
-                    pse = self.potential_snap_elements
-                    n = len(pse)
-                    if self.snap_type == 'EDGE':
-                        self.extra_snap_points = []
-                        for i in range(n):
-                            v0 = pse[i]
-                            v1 = pse[(i + 1) % n]
-                            self.extra_snap_points.append((v0 + v1) / 2)
-                    elif self.snap_type == 'FACE':
-                        self.extra_snap_points = []
-                        v0 = Vector()
-                        for v1 in pse:
-                            v0 += v1
-                        self.extra_snap_points.append(v0 / n)
-                
-                if snap_align:
-                    matrix = surf_matrix.to_3x3()
-                
-                if not use_object_centers:
-                    pos = surf_matrix.to_translation()
-                else:
-                    pos = orig_obj.matrix_world.to_translation()
-                
-                try:
-                    local_pos = orig_obj.matrix_world.inverted() * pos
-                except:
-                    # this is some degenerate object
-                    local_pos = pos
-                
-                set_stick_obj(csu.tou.scene, orig_obj.name, local_pos)
-                
-                modify_Surface = modify_Surface and \
-                    (snap_type != 'VOLUME') and (not use_object_centers)
-                
-                # === Update "Surface" orientation === #
-                if modify_Surface:
-                    # Use raycast[0], not matrix! If snap_align == False,
-                    # matrix will be src_matrix!
-                    coordsys = csu.tou.get_custom("Surface")
-                    coordsys.matrix = surf_matrix.to_3x3()
-                    runtime_settings.surface_pos = pos
-                    if csu.tou.get() == "Surface":
-                        sys_matrix = to_matrix4x4(matrix, pos)
-            else:
-                if axes_of_freedom == 0:
-                    # Constrained in all axes, can't move.
-                    pass
-                elif axes_of_freedom == 3:
-                    # Not constrained, move in view plane.
-                    pos = vu.get_point(xy, pos)
-                else:
-                    a, b, clip = vu.get_ray(xy)
-                    view_dir = vu.get_direction()
-                    
-                    start = sys_matrix * start
-                    
-                    if axes_of_freedom == 1:
-                        direction = Vector((1, 1, 1)) - direction
-                    direction.rotate(sys_matrix)
-                    
-                    if axes_of_freedom == 2:
-                        # Constrained in one axis.
-                        # Find intersection with plane.
-                        i_p = intersect_line_plane(a, b, start, direction)
-                        if i_p is not None:
-                            pos = i_p
-                    elif axes_of_freedom == 1:
-                        # Constrained in two axes.
-                        # Find nearest point to line.
-                        i_p = intersect_line_line(a, b, start,
-                                                  start + direction)
-                        if i_p is not None:
-                            pos = i_p[1]
-        #end if do_raycast
-        
-        try:
-            sys_matrix_inv = sys_matrix.inverted()
-        except:
-            # this is some degenerate system
-            sys_matrix_inv = Matrix()
-        
-        _pos = sys_matrix_inv * pos
-        
-        # don't snap when mouse hasn't moved
-        if (snap_type == 'INCREMENT') and do_raycast:
-            for i in range(3):
-                _pos[i] = round_step(_pos[i], grid_step)
-        
-        for i in range(3):
-            if axes_coords[i] is not None:
-                _pos[i] = axes_coords[i]
-        
-        if (snap_type == 'INCREMENT') or (axes_of_freedom != 3):
-            pos = sys_matrix * _pos
-        
-        res_matrix = to_matrix4x4(matrix, pos)
-        
-        CursorDynamicSettings.local_matrix = \
-            sys_matrix_inv * res_matrix
-        
-        return res_matrix
-
-class Snap3DUtility(SnapUtilityBase):
-    grid_steps = {False:1.0, True:0.1}
-    
-    cube_verts = [Vector((i, j, k))
-        for i in (-1, 1)
-        for j in (-1, 1)
-        for k in (-1, 1)]
-    
-    def __init__(self, scene, shade):
-        SnapUtilityBase.__init__(self)
-        
-        convert_types = {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META'}
-        self.cache = MeshCache(scene, convert_types)
-        
-        # ? seems that dict is enough
-        self.bbox_cache = {}#collections.OrderedDict()
-        self.sys_matrix_key = [0.0] * 9
-        
-        bm = prepare_gridbox_mesh(subdiv=2)
-        mesh = bpy.data.meshes.new(tmp_name)
-        bm.to_mesh(mesh)
-        mesh.update(calc_tessface=True)
-        #mesh.calc_tessface()
-        
-        self.bbox_obj = self.cache._make_obj(mesh, None)
-        self.bbox_obj.hide = True
-        self.bbox_obj.draw_type = 'WIRE'
-        self.bbox_obj.name = "BoundBoxSnap"
-        
-        self.shade_bbox = (shade == 'BOUNDBOX')
-    
-    def update_targets(self, to_include, to_exclude):
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        only_solid = tfm_opts.snap_only_to_solid
-        
-        # Ensure this is a set and not some other
-        # type of collection
-        to_exclude = set(to_exclude)
-        
-        for target in to_include:
-            if only_solid and ((target.draw_type == 'BOUNDS') \
-                    or (target.draw_type == 'WIRE')):
-                to_exclude.add(target)
-        
-        SnapUtilityBase.update_targets(self, to_include, to_exclude)
-    
-    def dispose(self):
-        self.hide_bbox(True)
-        
-        mesh = self.bbox_obj.data
-        bpy.data.objects.remove(self.bbox_obj)
-        bpy.data.meshes.remove(mesh)
-        
-        self.cache.clear()
-    
-    def hide_bbox(self, hide):
-        if self.bbox_obj.hide == hide:
-            return
-        
-        self.bbox_obj.hide = hide
-        
-        # We need to unlink bbox until required to show it,
-        # because otherwise outliner will blink each
-        # time cursor is clicked
-        if hide:
-            self.cache.scene.objects.unlink(self.bbox_obj)
-        else:
-            self.cache.scene.objects.link(self.bbox_obj)
-    
-    def get_bbox_obj(self, obj, sys_matrix, sys_matrix_inv, is_local):
-        if is_local:
-            bbox = None
-        else:
-            bbox = self.bbox_cache.get(obj, None)
-        
-        if bbox is None:
-            m = obj.matrix_world
-            if is_local:
-                sys_matrix = m.copy()
-                try:
-                    sys_matrix_inv = sys_matrix.inverted()
-                except Exception:
-                    # this is some degenerate system
-                    sys_matrix_inv = Matrix()
-            m_combined = sys_matrix_inv * m
-            bbox = [None, None]
-            
-            variant = ('RAW' if (self.editmode and
-                       (obj.type == 'MESH') and (obj.mode == 'EDIT'))
-                       else 'PREVIEW')
-            mesh_obj = self.cache.get(obj, variant, reuse=False)
-            if (mesh_obj is None) or self.shade_bbox or \
-                    (obj.draw_type == 'BOUNDS'):
-                if is_local:
-                    bbox = [(-1, -1, -1), (1, 1, 1)]
-                else:
-                    for p in self.cube_verts:
-                        extend_bbox(bbox, m_combined * p.copy())
-            elif is_local:
-                bbox = [mesh_obj.bound_box[0], mesh_obj.bound_box[6]]
-            else:
-                for v in mesh_obj.data.vertices:
-                    extend_bbox(bbox, m_combined * v.co.copy())
-            
-            bbox = (Vector(bbox[0]), Vector(bbox[1]))
-            
-            if not is_local:
-                self.bbox_cache[obj] = bbox
-        
-        half = (bbox[1] - bbox[0]) * 0.5
-        
-        m = MatrixCompose(half[0], half[1], half[2])
-        m = sys_matrix.to_3x3() * m
-        m.resize_4x4()
-        m.translation = sys_matrix * (bbox[0] + half)
-        self.bbox_obj.matrix_world = m
-        
-        return self.bbox_obj
-    
-    # TODO: ?
-    # - Sort snap targets according to raycasted distance?
-    # - Ignore targets if their bounding sphere is further
-    #   than already picked position?
-    # Perhaps these "optimizations" aren't worth the overhead.
-    
-    def raycast(self, a, b, clip, view_dir, is_bbox, \
-                sys_matrix, sys_matrix_inv, is_local, x_ray):
-        # If we need to interpolate normals or snap to
-        # vertices/edges, we must convert mesh.
-        #force = (self.interpolation != 'NEVER') or \
-        #    (self.snap_type in {'VERTEX', 'EDGE'})
-        # Actually, we have to always convert, since
-        # we need to get face at least to find tangential.
-        force = True
-        edit = self.editmode
-        
-        res = None
-        L = None
-        
-        for obj in self.targets:
-            orig_obj = obj
-            
-            if obj.name == self.bbox_obj.name:
-                # is there a better check?
-                # ("a is b" doesn't work here)
-                continue
-            if obj.show_x_ray != x_ray:
-                continue
-            
-            if is_bbox:
-                obj = self.get_bbox_obj(obj, \
-                    sys_matrix, sys_matrix_inv, is_local)
-            elif obj.draw_type == 'BOUNDS':
-                # Outside of BBox, there is no meaningful visual snapping
-                # for such display mode
-                continue
-            
-            m = obj.matrix_world.copy()
-            try:
-                mi = m.inverted()
-            except:
-                # this is some degenerate object
-                continue
-            la = mi * a
-            lb = mi * b
-            
-            # Bounding sphere check (to avoid unnecesary conversions
-            # and to make ray 'infinite')
-            bb_min = Vector(obj.bound_box[0])
-            bb_max = Vector(obj.bound_box[6])
-            c = (bb_min + bb_max) * 0.5
-            r = (bb_max - bb_min).length * 0.5
-            sec = intersect_line_sphere(la, lb, c, r, False)
-            if sec[0] is None:
-                continue # no intersection with the bounding sphere
-            
-            if not is_bbox:
-                # Ensure we work with raycastable object.
-                variant = ('RAW' if (edit and
-                           (obj.type == 'MESH') and (obj.mode == 'EDIT'))
-                           else 'PREVIEW')
-                obj = self.cache.get(obj, variant, reuse=(not force))
-                if (obj is None) or (not obj.data.polygons):
-                    continue # the object has no raycastable geometry
-            
-            # If ray must be infinite, ensure that
-            # endpoints are outside of bounding volume
-            if not clip:
-                # Seems that intersect_line_sphere()
-                # returns points in flipped order
-                lb, la = sec
-            
-            # Does ray actually intersect something?
-            lp, ln, face_id = obj.ray_cast(la, lb)
-            if face_id == -1:
-                continue
-            
-            # transform position to global space
-            p = m * lp
-            
-            # This works both for prespective and ortho
-            l = p.dot(view_dir)
-            if (L is None) or (l < L):
-                res = (lp, ln, face_id, obj, p, m, la, lb, orig_obj)
-                L = l
-        #end for
-        
-        return res
-    
-    # Returns:
-    # Matrix(X -- tangential,
-    #        Y -- 2nd tangential,
-    #        Z -- normal,
-    #        T -- raycasted/snapped position)
-    # Face ID (-1 if not applicable)
-    # Object (None if not applicable)
-    def snap_raycast(self, a, b, clip, view_dir, csu, alt_snap):
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        if self.shade_bbox and tfm_opts.snap_only_to_solid:
-            return None
-        
-        # Since introduction of "use object centers",
-        # this check is useless (use_object_centers overrides
-        # even INCREMENT snapping)
-        #if self.snap_type not in {'VERTEX', 'EDGE', 'FACE', 'VOLUME'}:
-        #    return None
-        
-        # key shouldn't depend on system origin;
-        # for bbox calculation origin is always zero
-        #if csu.tou.get() != "Surface":
-        #    sys_matrix = csu.get_matrix().to_3x3()
-        #else:
-        #    sys_matrix = csu.get_matrix('LOCAL').to_3x3()
-        sys_matrix = csu.get_matrix().to_3x3()
-        sys_matrix_key = list(c for v in sys_matrix for c in v)
-        sys_matrix_key.append(self.editmode)
-        sys_matrix = sys_matrix.to_4x4()
-        try:
-            sys_matrix_inv = sys_matrix.inverted()
-        except:
-            # this is some degenerate system
-            return None
-        
-        if self.sys_matrix_key != sys_matrix_key:
-            self.bbox_cache.clear()
-            self.sys_matrix_key = sys_matrix_key
-        
-        # In this context, Volume represents BBox :P
-        is_bbox = (self.snap_type == 'VOLUME')
-        is_local = (csu.tou.get() in \
-            {'LOCAL', "Scaled"})
-        
-        res = self.raycast(a, b, clip, view_dir, \
-            is_bbox, sys_matrix, sys_matrix_inv, is_local, True)
-        
-        if res is None:
-            res = self.raycast(a, b, clip, view_dir, \
-                is_bbox, sys_matrix, sys_matrix_inv, is_local, False)
-        
-        # Occlusion-based edge/vertex snapping will be
-        # too inefficient in Python (well, even without
-        # the occlusion, iterating over all edges/vertices
-        # of each object is inefficient too)
-        
-        if not res:
-            return None
-        
-        lp, ln, face_id, obj, p, m, la, lb, orig_obj = res
-        
-        if is_bbox:
-            self.bbox_obj.matrix_world = m.copy()
-            self.bbox_obj.show_x_ray = orig_obj.show_x_ray
-            self.hide_bbox(False)
-        
-        _ln = ln.copy()
-        
-        face = obj.data.tessfaces[face_id]
-        L = None
-        t1 = None
-        
-        if self.snap_type == 'VERTEX' or self.snap_type == 'VOLUME':
-            for v0 in face.vertices:
-                v = obj.data.vertices[v0]
-                p0 = v.co
-                l = (lp - p0).length_squared
-                if (L is None) or (l < L):
-                    p = p0
-                    ln = v.normal.copy()
-                    #t1 = ln.cross(_ln)
-                    L = l
-            
-            _ln = ln.copy()
-            '''
-            if t1.length < epsilon:
-                if (1.0 - abs(ln.z)) < epsilon:
-                    t1 = Vector((1, 0, 0))
-                else:
-                    t1 = Vector((0, 0, 1)).cross(_ln)
-            '''
-            p = m * p
-        elif self.snap_type == 'EDGE':
-            use_smooth = face.use_smooth
-            if self.interpolation == 'NEVER':
-                use_smooth = False
-            elif self.interpolation == 'ALWAYS':
-                use_smooth = True
-            
-            for v0, v1 in face.edge_keys:
-                p0 = obj.data.vertices[v0].co
-                p1 = obj.data.vertices[v1].co
-                dp = p1 - p0
-                q = dp.dot(lp - p0) / dp.length_squared
-                if (q >= 0.0) and (q <= 1.0):
-                    ep = p0 + dp * q
-                    l = (lp - ep).length_squared
-                    if (L is None) or (l < L):
-                        if alt_snap:
-                            p = (p0 + p1) * 0.5
-                            q = 0.5
-                        else:
-                            p = ep
-                        if not use_smooth:
-                            q = 0.5
-                        ln = obj.data.vertices[v1].normal * q + \
-                             obj.data.vertices[v0].normal * (1.0 - q)
-                        t1 = dp
-                        L = l
-            
-            p = m * p
-        else:
-            if alt_snap:
-                lp = face.center
-                p = m * lp
-            
-            if self.interpolation != 'NEVER':
-                ln = self.interpolate_normal(
-                    obj, face_id, lp, la, lb - la)
-            
-            # Comment this to make 1st tangential 
-            # always lie in the face's plane
-            _ln = ln.copy()
-            
-            '''
-            for v0, v1 in face.edge_keys:
-                p0 = obj.data.vertices[v0].co
-                p1 = obj.data.vertices[v1].co
-                dp = p1 - p0
-                q = dp.dot(lp - p0) / dp.length_squared
-                if (q >= 0.0) and (q <= 1.0):
-                    ep = p0 + dp * q
-                    l = (lp - ep).length_squared
-                    if (L is None) or (l < L):
-                        t1 = dp
-                        L = l
-            '''
-        
-        n = ln.copy()
-        n.rotate(m)
-        n.normalize()
-        
-        if t1 is None:
-            _ln.rotate(m)
-            _ln.normalize()
-            if (1.0 - abs(_ln.z)) < epsilon:
-                t1 = Vector((1, 0, 0))
-            else:
-                t1 = Vector((0, 0, 1)).cross(_ln)
-            t1.normalize()
-        else:
-            t1.rotate(m)
-            t1.normalize()
-        
-        t2 = t1.cross(n)
-        t2.normalize()
-        
-        matrix = MatrixCompose(t1, t2, n, p)
-        
-        return (matrix, face_id, obj, orig_obj)
-    
-    def interpolate_normal(self, obj, face_id, p, orig, ray):
-        face = obj.data.tessfaces[face_id]
-        
-        use_smooth = face.use_smooth
-        if self.interpolation == 'NEVER':
-            use_smooth = False
-        elif self.interpolation == 'ALWAYS':
-            use_smooth = True
-        
-        if not use_smooth:
-            return face.normal.copy()
-        
-        # edge.use_edge_sharp affects smoothness only if
-        # mesh has EdgeSplit modifier
-        
-        # ATTENTION! Coords/Normals MUST be copied
-        # (a bug in barycentric_transform implementation ?)
-        # Somewhat strangely, the problem also disappears
-        # if values passed to barycentric_transform
-        # are print()ed beforehand.
-        
-        co = [obj.data.vertices[vi].co.copy()
-            for vi in face.vertices]
-        
-        normals = [obj.data.vertices[vi].normal.copy()
-            for vi in face.vertices]
-        
-        if len(face.vertices) != 3:
-            tris = tessellate_polygon([co])
-            for tri in tris:
-                i0, i1, i2 = tri
-                if intersect_ray_tri(co[i0], co[i1], co[i2], ray, orig):
-                    break
-        else:
-            i0, i1, i2 = 0, 1, 2
-        
-        n = barycentric_transform(p, co[i0], co[i1], co[i2],
-            normals[i0], normals[i1], normals[i2])
-        n.normalize()
-        
-        return n
-
-# ====== CONVERTED-TO-MESH OBJECTS CACHE ====== #
-#============================================================================#
-class ToggleObjectMode:
-    def __init__(self, mode='OBJECT'):
-        if not isinstance(mode, str):
-            mode = ('OBJECT' if mode else None)
-        
-        self.mode = mode
-    
-    def __enter__(self):
-        if self.mode:
-            edit_preferences = bpy.context.user_preferences.edit
-            
-            self.global_undo = edit_preferences.use_global_undo
-            self.prev_mode = bpy.context.object.mode
-            
-            if self.prev_mode != self.mode:
-                edit_preferences.use_global_undo = False
-                bpy.ops.object.mode_set(mode=self.mode)
-        
-        return self
-    
-    def __exit__(self, type, value, traceback):
-        if self.mode:
-            edit_preferences = bpy.context.user_preferences.edit
-            
-            if self.prev_mode != self.mode:
-                bpy.ops.object.mode_set(mode=self.prev_mode)
-                edit_preferences.use_global_undo = self.global_undo
-
-class MeshCacheItem:
-    def __init__(self):
-        self.variants = {}
-    
-    def __getitem__(self, variant):
-        return self.variants[variant][0]
-    
-    def __setitem__(self, variant, conversion):
-        mesh = conversion[0].data
-        #mesh.update(calc_tessface=True)
-        #mesh.calc_tessface()
-        mesh.calc_normals()
-        
-        self.variants[variant] = conversion
-    
-    def __contains__(self, variant):
-        return variant in self.variants
-    
-    def dispose(self):
-        for obj, converted in self.variants.values():
-            if converted:
-                mesh = obj.data
-                bpy.data.objects.remove(obj)
-                bpy.data.meshes.remove(mesh)
-        self.variants = None
-
-class MeshCache:
-    """
-    Keeps a cache of mesh equivalents of requested objects.
-    It is assumed that object's data does not change while
-    the cache is in use.
-    """
-    
-    variants_enum = {'RAW', 'PREVIEW', 'RENDER'}
-    variants_normalization = {
-        'MESH':{},
-        'CURVE':{},
-        'SURFACE':{},
-        'FONT':{},
-        'META':{'RAW':'PREVIEW'},
-        'ARMATURE':{'RAW':'PREVIEW', 'RENDER':'PREVIEW'},
-        'LATTICE':{'RAW':'PREVIEW', 'RENDER':'PREVIEW'},
-        'EMPTY':{'RAW':'PREVIEW', 'RENDER':'PREVIEW'},
-        'CAMERA':{'RAW':'PREVIEW', 'RENDER':'PREVIEW'},
-        'LAMP':{'RAW':'PREVIEW', 'RENDER':'PREVIEW'},
-        'SPEAKER':{'RAW':'PREVIEW', 'RENDER':'PREVIEW'},
-    }
-    conversible_types = {'MESH', 'CURVE', 'SURFACE', 'FONT',
-                         'META', 'ARMATURE', 'LATTICE'}
-    convert_types = conversible_types
-    
-    def __init__(self, scene, convert_types=None):
-        self.scene = scene
-        if convert_types:
-            self.convert_types = convert_types
-        self.cached = {}
-    
-    def __del__(self):
-        self.clear()
-    
-    def clear(self, expect_zero_users=False):
-        for cache_item in self.cached.values():
-            if cache_item:
-                try:
-                    cache_item.dispose()
-                except RuntimeError:
-                    if expect_zero_users:
-                        raise
-        self.cached.clear()
-    
-    def __delitem__(self, obj):
-        cache_item = self.cached.pop(obj, None)
-        if cache_item:
-            cache_item.dispose()
-    
-    def __contains__(self, obj):
-        return obj in self.cached
-    
-    def __getitem__(self, obj):
-        if isinstance(obj, tuple):
-            return self.get(*obj)
-        return self.get(obj)
-    
-    def get(self, obj, variant='PREVIEW', reuse=True):
-        if variant not in self.variants_enum:
-            raise ValueError("Mesh variant must be one of %s" %
-                             self.variants_enum)
-        
-        # Make sure the variant is proper for this type of object
-        variant = (self.variants_normalization[obj.type].
-                   get(variant, variant))
-        
-        if obj in self.cached:
-            cache_item = self.cached[obj]
-            try:
-                # cache_item is None if object isn't conversible to mesh
-                return (None if (cache_item is None)
-                        else cache_item[variant])
-            except KeyError:
-                pass
-        else:
-            cache_item = None
-        
-        if obj.type not in self.conversible_types:
-            self.cached[obj] = None
-            return None
-        
-        if not cache_item:
-            cache_item = MeshCacheItem()
-            self.cached[obj] = cache_item
-        
-        conversion = self._convert(obj, variant, reuse)
-        cache_item[variant] = conversion
-        
-        return conversion[0]
-    
-    def _convert(self, obj, variant, reuse=True):
-        obj_type = obj.type
-        obj_mode = obj.mode
-        data = obj.data
-        
-        if obj_type == 'MESH':
-            if reuse and ((variant == 'RAW') or (len(obj.modifiers) == 0)):
-                return (obj, False)
-            else:
-                force_objectmode = (obj_mode in {'EDIT', 'SCULPT'})
-                return (self._to_mesh(obj, variant, force_objectmode), True)
-        elif obj_type in {'CURVE', 'SURFACE', 'FONT'}:
-            if variant == 'RAW':
-                bm = bmesh.new()
-                for spline in data.splines:
-                    for point in spline.bezier_points:
-                        bm.verts.new(point.co)
-                        bm.verts.new(point.handle_left)
-                        bm.verts.new(point.handle_right)
-                    for point in spline.points:
-                        bm.verts.new(point.co[:3])
-                return (self._make_obj(bm, obj), True)
-            else:
-                if variant == 'RENDER':
-                    resolution_u = data.resolution_u
-                    resolution_v = data.resolution_v
-                    if data.render_resolution_u != 0:
-                        data.resolution_u = data.render_resolution_u
-                    if data.render_resolution_v != 0:
-                        data.resolution_v = data.render_resolution_v
-                
-                result = (self._to_mesh(obj, variant), True)
-                
-                if variant == 'RENDER':
-                    data.resolution_u = resolution_u
-                    data.resolution_v = resolution_v
-                
-                return result
-        elif obj_type == 'META':
-            if variant == 'RAW':
-                # To avoid the hassle of snapping metaelements
-                # to themselves, we just create an empty mesh
-                bm = bmesh.new()
-                return (self._make_obj(bm, obj), True)
-            else:
-                if variant == 'RENDER':
-                    resolution = data.resolution
-                    data.resolution = data.render_resolution
-                
-                result = (self._to_mesh(obj, variant), True)
-                
-                if variant == 'RENDER':
-                    data.resolution = resolution
-                
-                return result
-        elif obj_type == 'ARMATURE':
-            bm = bmesh.new()
-            if obj_mode == 'EDIT':
-                for bone in data.edit_bones:
-                    head = bm.verts.new(bone.head)
-                    tail = bm.verts.new(bone.tail)
-                    bm.edges.new((head, tail))
-            elif obj_mode == 'POSE':
-                for bone in obj.pose.bones:
-                    head = bm.verts.new(bone.head)
-                    tail = bm.verts.new(bone.tail)
-                    bm.edges.new((head, tail))
-            else:
-                for bone in data.bones:
-                    head = bm.verts.new(bone.head_local)
-                    tail = bm.verts.new(bone.tail_local)
-                    bm.edges.new((head, tail))
-            return (self._make_obj(bm, obj), True)
-        elif obj_type == 'LATTICE':
-            bm = bmesh.new()
-            for point in data.points:
-                bm.verts.new(point.co_deform)
-            return (self._make_obj(bm, obj), True)
-    
-    def _to_mesh(self, obj, variant, force_objectmode=False):
-        tmp_name = chr(0x10ffff) # maximal Unicode value
-        
-        with ToggleObjectMode(force_objectmode):
-            if variant == 'RAW':
-                mesh = obj.to_mesh(self.scene, False, 'PREVIEW')
-            else:
-                mesh = obj.to_mesh(self.scene, True, variant)
-            mesh.name = tmp_name
-        
-        return self._make_obj(mesh, obj)
-    
-    def _make_obj(self, mesh, src_obj):
-        tmp_name = chr(0x10ffff) # maximal Unicode value
-        
-        if isinstance(mesh, bmesh.types.BMesh):
-            bm = mesh
-            mesh = bpy.data.meshes.new(tmp_name)
-            bm.to_mesh(mesh)
-        
-        tmp_obj = bpy.data.objects.new(tmp_name, mesh)
-        
-        if src_obj:
-            tmp_obj.matrix_world = src_obj.matrix_world
-            
-            # This is necessary for correct bbox display # TODO
-            # (though it'd be better to change the logic in the raycasting)
-            tmp_obj.show_x_ray = src_obj.show_x_ray
-            
-            tmp_obj.dupli_faces_scale = src_obj.dupli_faces_scale
-            tmp_obj.dupli_frames_end = src_obj.dupli_frames_end
-            tmp_obj.dupli_frames_off = src_obj.dupli_frames_off
-            tmp_obj.dupli_frames_on = src_obj.dupli_frames_on
-            tmp_obj.dupli_frames_start = src_obj.dupli_frames_start
-            tmp_obj.dupli_group = src_obj.dupli_group
-            #tmp_obj.dupli_list = src_obj.dupli_list
-            tmp_obj.dupli_type = src_obj.dupli_type
-        
-        # Make Blender recognize object as having geometry
-        # (is there a simpler way to do this?)
-        self.scene.objects.link(tmp_obj)
-        self.scene.update()
-        # We don't need this object in scene
-        self.scene.objects.unlink(tmp_obj)
-        
-        return tmp_obj
-
-#============================================================================#
-
-# A base class for emulating ID-datablock behavior
-class PseudoIDBlockBase(bpy.types.PropertyGroup):
-    # TODO: use normal metaprogramming?
-
-    @staticmethod
-    def create_props(type, name, options={'ANIMATABLE'}):
-        def active_update(self, context):
-            # necessary to avoid recursive calls
-            if self._self_update[0]:
-                return
-            
-            if self._dont_rename[0]:
-                return
-            
-            if len(self.collection) == 0:
-                return
-            
-            # prepare data for renaming...
-            old_key = (self.enum if self.enum else self.collection[0].name)
-            new_key = (self.active if self.active else "Untitled")
-            
-            if old_key == new_key:
-                return
-            
-            old_item = None
-            new_item = None
-            existing_names = []
-            
-            for item in self.collection:
-                if (item.name == old_key) and (not new_item):
-                    new_item = item
-                elif (item.name == new_key) and (not old_item):
-                    old_item = item
-                else:
-                    existing_names.append(item.name)
-            existing_names.append(new_key)
-            
-            # rename current item
-            new_item.name = new_key
-            
-            if old_item:
-                # rename other item if it has that name
-                name = new_key
-                i = 1
-                while name in existing_names:
-                    name = "{}.{:0>3}".format(new_key, i)
-                    i += 1
-                old_item.name = name
-            
-            # update the enum
-            self._self_update[0] += 1
-            self.update_enum()
-            self._self_update[0] -= 1
-        # end def
-        
-        def enum_update(self, context):
-            # necessary to avoid recursive calls
-            if self._self_update[0]:
-                return
-            
-            self._dont_rename[0] = True
-            self.active = self.enum
-            self._dont_rename[0] = False
-            
-            self.on_item_select()
-        # end def
-        
-        collection = bpy.props.CollectionProperty(
-            type=type)
-        active = bpy.props.StringProperty(
-            name="Name",
-            description="Name of the active {}".format(name),
-            options=options,
-            update=active_update)
-        enum = bpy.props.EnumProperty(
-            items=[],
-            name="Choose",
-            description="Choose {}".format(name),
-            default=set(),
-            options={'ENUM_FLAG'},
-            update=enum_update)
-        
-        return collection, active, enum
-    # end def
-    
-    def add(self, name="", **kwargs):
-        if not name:
-            name = 'Untitled'
-        _name = name
-        
-        existing_names = [item.name for item in self.collection]
-        i = 1
-        while name in existing_names:
-            name = "{}.{:0>3}".format(_name, i)
-            i += 1
-        
-        instance = self.collection.add()
-        instance.name = name
-        
-        for key, value in kwargs.items():
-            setattr(instance, key, value)
-        
-        self._self_update[0] += 1
-        self.active = name
-        self.update_enum()
-        self._self_update[0] -= 1
-        
-        return instance
-    
-    def remove(self, key):
-        if isinstance(key, int):
-            i = key
-        else:
-            i = self.indexof(key)
-        
-        # Currently remove() ignores non-existing indices...
-        # In the case this behavior changes, we have the try block.
-        try:
-            self.collection.remove(i)
-        except:
-            pass
-        
-        self._self_update[0] += 1
-        if len(self.collection) != 0:
-            i = min(i, len(self.collection) - 1)
-            self.active = self.collection[i].name
-        else:
-            self.active = ""
-        self.update_enum()
-        self._self_update[0] -= 1
-    
-    def get_item(self, key=None):
-        if key is None:
-            i = self.indexof(self.active)
-        elif isinstance(key, int):
-            i = key
-        else:
-            i = self.indexof(key)
-        
-        try:
-            return self.collection[i]
-        except:
-            return None
-    
-    def indexof(self, key):
-        return next((i for i, v in enumerate(self.collection) \
-            if v.name == key), -1)
-        
-        # Which is more Pythonic?
-        
-        #for i, item in enumerate(self.collection):
-        #    if item.name == key:
-        #        return i
-        #return -1 # non-existing index
-    
-    def update_enum(self):
-        names = []
-        items = []
-        for item in self.collection:
-            names.append(item.name)
-            items.append((item.name, item.name, ""))
-        
-        prop_class, prop_params = type(self).enum
-        prop_params["items"] = items
-        if len(items) == 0:
-            prop_params["default"] = set()
-            prop_params["options"] = {'ENUM_FLAG'}
-        else:
-            # Somewhy active may be left from previous times,
-            # I don't want to dig now why that happens.
-            if self.active not in names:
-                self.active = items[0][0]
-            prop_params["default"] = self.active
-            prop_params["options"] = set()
-        
-        # Can this cause problems? In the near future, shouldn't...
-        type(self).enum = (prop_class, prop_params)
-        #type(self).enum = bpy.props.EnumProperty(**prop_params)
-        
-        if len(items) != 0:
-            self.enum = self.active
-    
-    def on_item_select(self):
-        pass
-    
-    data_name = ""
-    op_new = ""
-    op_delete = ""
-    icon = 'DOT'
-    
-    def draw(self, context, layout):
-        if len(self.collection) == 0:
-            if self.op_new:
-                layout.operator(self.op_new, icon=self.icon)
-            else:
-                layout.label(
-                    text="({})".format(self.data_name),
-                    icon=self.icon)
-            return
-        
-        row = layout.row(align=True)
-        row.prop_menu_enum(self, "enum", text="", icon=self.icon)
-        row.prop(self, "active", text="")
-        if self.op_new:
-            row.operator(self.op_new, text="", icon='ZOOMIN')
-        if self.op_delete:
-            row.operator(self.op_delete, text="", icon='X')
-# end class
-#============================================================================#
-# ===== PROPERTY DEFINITIONS ===== #
-
-# ===== TRANSFORM EXTRA OPTIONS ===== #
-class TransformExtraOptionsProp(bpy.types.PropertyGroup):
-    use_relative_coords = bpy.props.BoolProperty(
-        name="Relative coordinates", 
-        description="Consider existing transformation as the starting point", 
-        default=True)
-    snap_interpolate_normals_mode = bpy.props.EnumProperty(
-        items=[('NEVER', "Never", "Don't interpolate normals"),
-               ('ALWAYS', "Always", "Always interpolate normals"),
-               ('SMOOTH', "Smoothness-based", "Interpolate normals only "\
-               "for faces with smooth shading"),],
-        name="Normal interpolation", 
-        description="Normal interpolation mode for snapping", 
-        default='SMOOTH')
-    snap_only_to_solid = bpy.props.BoolProperty(
-        name="Snap only to soild", 
-        description="Ignore wireframe/non-solid objects during snapping", 
-        default=False)
-    snap_element_screen_size = bpy.props.IntProperty(
-        name="Snap distance", 
-        description="Radius in pixels for snapping to edges/vertices", 
-        default=8,
-        min=2,
-        max=64)
-    use_comma_separator = bpy.props.BoolProperty(
-        name="Use comma separator",
-        description="Use comma separator when copying/pasting"\
-                    "coordinate values (instead of Tab character)",
-        default=True,
-        options={'HIDDEN'})
-
-# ===== 3D VECTOR LOCATION ===== #
-class LocationProp(bpy.types.PropertyGroup):
-    pos = bpy.props.FloatVectorProperty(
-        name="xyz", description="xyz coords",
-        options={'HIDDEN'}, subtype='XYZ')
-
-# ===== HISTORY ===== #
-def update_history_max_size(self, context):
-    settings = find_settings()
-    
-    history = settings.history
-    
-    prop_class, prop_params = type(history).current_id
-    old_max = prop_params["max"]
-    
-    size = history.max_size
-    try:
-        int_size = int(size)
-        int_size = max(int_size, 0)
-        int_size = min(int_size, history.max_size_limit)
-    except:
-        int_size = old_max
-    
-    if old_max != int_size:
-        prop_params["max"] = int_size
-        type(history).current_id = (prop_class, prop_params)
-    
-    # also: clear immediately?
-    for i in range(len(history.entries) - 1, int_size, -1):
-        history.entries.remove(i)
-    
-    if str(int_size) != size:
-        # update history.max_size if it's not inside the limits
-        history.max_size = str(int_size)
-
-def update_history_id(self, context):
-    scene = bpy.context.scene
-    
-    settings = find_settings()
-    history = settings.history
-    
-    pos = history.get_pos()
-    if pos is not None:
-        # History doesn't depend on view (?)
-        cursor_pos = get_cursor_location(scene=scene)
-        
-        if CursorHistoryProp.update_cursor_on_id_change:
-            # Set cursor position anyway (we're changing v3d's
-            # cursor, which may be separate from scene's)
-            # This, however, should be done cautiously
-            # from scripts, since, e.g., CursorMonitor
-            # can supply wrong context -> cursor will be set
-            # in a different view than required
-            set_cursor_location(pos, v3d=context.space_data)
-        
-        if pos != cursor_pos:
-            if (history.current_id == 0) and (history.last_id <= 1):
-                history.last_id = 1
-            else:
-                history.last_id = history.curr_id
-            history.curr_id = history.current_id
-
-class CursorHistoryProp(bpy.types.PropertyGroup):
-    max_size_limit = 500
-    
-    update_cursor_on_id_change = True
-    
-    show_trace = bpy.props.BoolProperty(
-        name="Trace",
-        description="Show history trace",
-        default=False)
-    max_size = bpy.props.StringProperty(
-        name="Size",
-        description="History max size",
-        default=str(50),
-        update=update_history_max_size)
-    current_id = bpy.props.IntProperty(
-        name="Index",
-        description="Current position in cursor location history",
-        default=50,
-        min=0,
-        max=50,
-        update=update_history_id)
-    entries = bpy.props.CollectionProperty(
-        type=LocationProp)
-    
-    curr_id = bpy.props.IntProperty(options={'HIDDEN'})
-    last_id = bpy.props.IntProperty(options={'HIDDEN'})
-    
-    def get_pos(self, id = None):
-        if id is None:
-            id = self.current_id
-        
-        id = min(max(id, 0), len(self.entries) - 1)
-        
-        if id < 0:
-            # history is empty
-            return None
-        
-        return self.entries[id].pos
-    
-    # for updating the upper bound on file load
-    def update_max_size(self):
-        prop_class, prop_params = type(self).current_id
-        # self.max_size expected to be always a correct integer
-        prop_params["max"] = int(self.max_size)
-        type(self).current_id = (prop_class, prop_params)
-    
-    def draw_trace(self, context):
-        bgl.glColor4f(0.75, 1.0, 0.75, 1.0)
-        bgl.glBegin(bgl.GL_LINE_STRIP)
-        for entry in self.entries:
-            p = entry.pos
-            bgl.glVertex3f(p[0], p[1], p[2])
-        bgl.glEnd()
-    
-    def draw_offset(self, context):
-        bgl.glShadeModel(bgl.GL_SMOOTH)
-        
-        tfm_operator = CursorDynamicSettings.active_transform_operator
-        
-        bgl.glBegin(bgl.GL_LINE_STRIP)
-        
-        if tfm_operator:
-            p = tfm_operator.particles[0]. \
-                get_initial_matrix().to_translation()
-        else:
-            p = self.get_pos(self.last_id)
-        bgl.glColor4f(1.0, 0.75, 0.5, 1.0)
-        bgl.glVertex3f(p[0], p[1], p[2])
-        
-        p = get_cursor_location(v3d=context.space_data)
-        bgl.glColor4f(1.0, 1.0, 0.25, 1.0)
-        bgl.glVertex3f(p[0], p[1], p[2])
-        
-        bgl.glEnd()
-
-# ===== BOOKMARK ===== #
-class BookmarkProp(bpy.types.PropertyGroup):
-    name = bpy.props.StringProperty(
-        name="name", description="bookmark name",
-        options={'HIDDEN'})
-    pos = bpy.props.FloatVectorProperty(
-        name="xyz", description="xyz coords",
-        options={'HIDDEN'}, subtype='XYZ')
-
-class BookmarkIDBlock(PseudoIDBlockBase):
-    # Somewhy instance members aren't seen in update()
-    # callbacks... but class members are.
-    _self_update = [0]
-    _dont_rename = [False]
-    
-    data_name = "Bookmark"
-    op_new = "scene.cursor_3d_new_bookmark"
-    op_delete = "scene.cursor_3d_delete_bookmark"
-    icon = 'CURSOR'
-    
-    collection, active, enum = PseudoIDBlockBase.create_props(
-        BookmarkProp, "Bookmark")
-
-class NewCursor3DBookmark(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_new_bookmark"
-    bl_label = "New Bookmark"
-    bl_description = "Add a new bookmark"
-    
-    name = bpy.props.StringProperty(
-        name="Name",
-        description="Name of the new bookmark",
-        default="Mark")
-    
-    @classmethod
-    def poll(cls, context):
-        return context.area.type == 'VIEW_3D'
-    
-    def execute(self, context):
-        settings = find_settings()
-        library = settings.libraries.get_item()
-        if not library:
-            return {'CANCELLED'}
-        
-        bookmark = library.bookmarks.add(name=self.name)
-        
-        cusor_pos = get_cursor_location(v3d=context.space_data)
-        
-        try:
-            bookmark.pos = library.convert_from_abs(context.space_data,
-                                                    cusor_pos, True)
-        except Exception as exc:
-            self.report({'ERROR_INVALID_CONTEXT'}, exc.args[0])
-            return {'CANCELLED'}
-        
-        return {'FINISHED'}
-
-class DeleteCursor3DBookmark(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_delete_bookmark"
-    bl_label = "Delete Bookmark"
-    bl_description = "Delete active bookmark"
-    
-    def execute(self, context):
-        settings = find_settings()
-        library = settings.libraries.get_item()
-        if not library:
-            return {'CANCELLED'}
-        
-        name = library.bookmarks.active
-        
-        library.bookmarks.remove(key=name)
-        
-        return {'FINISHED'}
-
-class OverwriteCursor3DBookmark(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_overwrite_bookmark"
-    bl_label = "Overwrite"
-    bl_description = "Overwrite active bookmark "\
-        "with the current cursor location"
-    
-    @classmethod
-    def poll(cls, context):
-        return context.area.type == 'VIEW_3D'
-    
-    def execute(self, context):
-        settings = find_settings()
-        library = settings.libraries.get_item()
-        if not library:
-            return {'CANCELLED'}
-        
-        bookmark = library.bookmarks.get_item()
-        if not bookmark:
-            return {'CANCELLED'}
-        
-        cusor_pos = get_cursor_location(v3d=context.space_data)
-        
-        try:
-            bookmark.pos = library.convert_from_abs(context.space_data,
-                                                    cusor_pos, True)
-        except Exception as exc:
-            self.report({'ERROR_INVALID_CONTEXT'}, exc.args[0])
-            return {'CANCELLED'}
-        
-        CursorDynamicSettings.recalc_csu(context, 'PRESS')
-        
-        return {'FINISHED'}
-
-class RecallCursor3DBookmark(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_recall_bookmark"
-    bl_label = "Recall"
-    bl_description = "Move cursor to the active bookmark"
-    
-    @classmethod
-    def poll(cls, context):
-        return context.area.type == 'VIEW_3D'
-    
-    def execute(self, context):
-        settings = find_settings()
-        library = settings.libraries.get_item()
-        if not library:
-            return {'CANCELLED'}
-        
-        bookmark = library.bookmarks.get_item()
-        if not bookmark:
-            return {'CANCELLED'}
-        
-        try:
-            bookmark_pos = library.convert_to_abs(context.space_data,
-                                                  bookmark.pos, True)
-            set_cursor_location(bookmark_pos, v3d=context.space_data)
-        except Exception as exc:
-            self.report({'ERROR_INVALID_CONTEXT'}, exc.args[0])
-            return {'CANCELLED'}
-        
-        CursorDynamicSettings.recalc_csu(context)
-        
-        return {'FINISHED'}
-
-class SwapCursor3DBookmark(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_swap_bookmark"
-    bl_label = "Swap"
-    bl_description = "Swap cursor position with the active bookmark"
-    
-    @classmethod
-    def poll(cls, context):
-        return context.area.type == 'VIEW_3D'
-    
-    def execute(self, context):
-        settings = find_settings()
-        library = settings.libraries.get_item()
-        if not library:
-            return {'CANCELLED'}
-        
-        bookmark = library.bookmarks.get_item()
-        if not bookmark:
-            return {'CANCELLED'}
-        
-        cusor_pos = get_cursor_location(v3d=context.space_data)
-        
-        try:
-            bookmark_pos = library.convert_to_abs(context.space_data,
-                                                  bookmark.pos, True)
-            
-            set_cursor_location(bookmark_pos, v3d=context.space_data)
-            
-            bookmark.pos = library.convert_from_abs(context.space_data,
-                                                    cusor_pos, True,
-                use_history=False)
-        except Exception as exc:
-            self.report({'ERROR_INVALID_CONTEXT'}, exc.args[0])
-            return {'CANCELLED'}
-        
-        CursorDynamicSettings.recalc_csu(context)
-        
-        return {'FINISHED'}
-
-# Will this be used?
-class SnapSelectionToCursor3DBookmark(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_snap_selection_to_bookmark"
-    bl_label = "Snap Selection"
-    bl_description = "Snap selection to the active bookmark"
-
-# Will this be used?
-class AddEmptyAtCursor3DBookmark(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_add_empty_at_bookmark"
-    bl_label = "Add Empty"
-    bl_description = "Add new Empty at the active bookmark"
-    
-    @classmethod
-    def poll(cls, context):
-        return context.area.type == 'VIEW_3D'
-    
-    def execute(self, context):
-        settings = find_settings()
-        library = settings.libraries.get_item()
-        if not library:
-            return {'CANCELLED'}
-        
-        bookmark = library.bookmarks.get_item()
-        if not bookmark:
-            return {'CANCELLED'}
-        
-        try:
-            matrix = library.get_matrix(use_history=False,
-                                        v3d=context.space_data, warn=True)
-            bookmark_pos = matrix * bookmark.pos
-        except Exception as exc:
-            self.report({'ERROR_INVALID_CONTEXT'}, exc.args[0])
-            return {'CANCELLED'}
-        
-        name = "{}.{}".format(library.name, bookmark.name)
-        obj = bpy.data.objects.new(name, None)
-        obj.matrix_world = to_matrix4x4(matrix, bookmark_pos)
-        context.scene.objects.link(obj)
-        
-        """
-        for sel_obj in list(context.selected_objects):
-            sel_obj.select = False
-        obj.select = True
-        context.scene.objects.active = obj
-        
-        # We need this to update bookmark position if
-        # library's system is local/scaled/normal/etc.
-        CursorDynamicSettings.recalc_csu(context, "PRESS")
-        """
-        
-        # TODO: exit from editmode? It has separate history!
-        # If we just link object to scene, it will not trigger
-        # addition of new entry to Undo history
-        bpy.ops.ed.undo_push(message="Add Object")
-        
-        return {'FINISHED'}
-
-# ===== BOOKMARK LIBRARY ===== #
-class BookmarkLibraryProp(bpy.types.PropertyGroup):
-    name = bpy.props.StringProperty(
-        name="Name", description="Name of the bookmark library",
-        options={'HIDDEN'})
-    bookmarks = bpy.props.PointerProperty(
-        type=BookmarkIDBlock,
-        options={'HIDDEN'})
-    system = bpy.props.EnumProperty(
-        items=[
-            ('GLOBAL', "Global", "Global (absolute) coordinates"),
-            ('LOCAL', "Local", "Local coordinate system, "\
-                "relative to the active object"),
-            ('SCALED', "Scaled", "Scaled local coordinate system, "\
-                "relative to the active object"),
-            ('NORMAL', "Normal", "Normal coordinate system, "\
-                "relative to the selected elements"),
-            ('CONTEXT', "Context", "Current transform orientation; "\
-                "origin depends on selection"),
-        ],
-        default="GLOBAL",
-        name="System",
-        description="Coordinate system in which to store/recall "\
-                    "cursor locations",
-        options={'HIDDEN'})
-    offset = bpy.props.BoolProperty(
-        name="Offset",
-        description="Store/recall relative to the last cursor position",
-        default=False,
-        options={'HIDDEN'})
-    
-    # Returned None means "operation is not aplicable"
-    def get_matrix(self, use_history, v3d, warn=True, **kwargs):
-        #particles, csu = gather_particles(**kwargs)
-        
-        # Ensure we have relevant CSU (Blender will crash
-        # if we use the old one after Undo/Redo)
-        CursorDynamicSettings.recalc_csu(bpy.context)
-        
-        csu = CursorDynamicSettings.csu
-        
-        if self.offset:
-            # history? or keep separate for each scene?
-            if not use_history:
-                csu.source_pos = get_cursor_location(v3d=v3d)
-            else:
-                settings = find_settings()
-                history = settings.history
-                csu.source_pos = history.get_pos(history.last_id)
-        else:
-            csu.source_pos = Vector()
-        
-        active_obj = csu.tou.scene.objects.active
-        
-        if self.system == 'GLOBAL':
-            sys_name = 'GLOBAL'
-            pivot = 'WORLD'
-        elif self.system == 'LOCAL':
-            if not active_obj:
-                if warn:
-                    raise Exception("There is no active object")
-                return None
-            sys_name = 'LOCAL'
-            pivot = 'ACTIVE'
-        elif self.system == 'SCALED':
-            if not active_obj:
-                if warn:
-                    raise Exception("There is no active object")
-                return None
-            sys_name = 'Scaled'
-            pivot = 'ACTIVE'
-        elif self.system == 'NORMAL':
-            if (not active_obj) or ('EDIT' not in active_obj.mode):
-                if warn:
-                    raise Exception("Active object must be in Edit mode")
-                return None
-            sys_name = 'NORMAL'
-            pivot = 'MEDIAN' # ?
-        elif self.system == 'CONTEXT':
-            sys_name = None # use current orientation
-            pivot = None
-            
-            if active_obj and (active_obj.mode != 'OBJECT'):
-                if len(particles) == 0:
-                    pivot = active_obj.matrix_world.to_translation()
-        
-        return csu.get_matrix(sys_name, self.offset, pivot)
-    
-    def convert_to_abs(self, v3d, pos, warn=False, **kwargs):
-        kwargs.pop("use_history", None)
-        matrix = self.get_matrix(False, v3d, warn, **kwargs)
-        if not matrix:
-            return None
-        return matrix * pos
-    
-    def convert_from_abs(self, v3d, pos, warn=False, **kwargs):
-        use_history = kwargs.pop("use_history", True)
-        matrix = self.get_matrix(use_history, v3d, warn, **kwargs)
-        if not matrix:
-            return None
-        
-        try:
-            return matrix.inverted() * pos
-        except:
-            # this is some degenerate object
-            return Vector()
-    
-    def draw_bookmark(self, context):
-        r = context.region
-        rv3d = context.region_data
-        
-        bookmark = self.bookmarks.get_item()
-        if not bookmark:
-            return
-        
-        pos = self.convert_to_abs(context.space_data, bookmark.pos)
-        if pos is None:
-            return
-        
-        projected = location_3d_to_region_2d(r, rv3d, pos)
-        
-        if projected:
-            # Store previous OpenGL settings
-            smooth_prev = gl_get(bgl.GL_SMOOTH)
-            
-            bgl.glShadeModel(bgl.GL_SMOOTH)
-            bgl.glLineWidth(2)
-            bgl.glColor4f(0.0, 1.0, 0.0, 1.0)
-            bgl.glBegin(bgl.GL_LINE_STRIP)
-            radius = 6
-            n = 8
-            da = 2 * math.pi / n
-            x, y = projected
-            x, y = int(x), int(y)
-            for i in range(n + 1):
-                a = i * da
-                dx = math.sin(a) * radius
-                dy = math.cos(a) * radius
-                if (i % 2) == 0:
-                    bgl.glColor4f(0.0, 1.0, 0.0, 1.0)
-                else:
-                    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-                bgl.glVertex2i(x + int(dx), y + int(dy))
-            bgl.glEnd()
-            
-            # Restore previous OpenGL settings
-            gl_enable(bgl.GL_SMOOTH, smooth_prev)
-
-class BookmarkLibraryIDBlock(PseudoIDBlockBase):
-    # Somewhy instance members aren't seen in update()
-    # callbacks... but class members are.
-    _self_update = [0]
-    _dont_rename = [False]
-    
-    data_name = "Bookmark Library"
-    op_new = "scene.cursor_3d_new_bookmark_library"
-    op_delete = "scene.cursor_3d_delete_bookmark_library"
-    icon = 'BOOKMARKS'
-    
-    collection, active, enum = PseudoIDBlockBase.create_props(
-        BookmarkLibraryProp, "Bookmark Library")
-    
-    def on_item_select(self):
-        library = self.get_item()
-        library.bookmarks.update_enum()
-
-class NewCursor3DBookmarkLibrary(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_new_bookmark_library"
-    bl_label = "New Library"
-    bl_description = "Add a new bookmark library"
-    
-    name = bpy.props.StringProperty(
-        name="Name",
-        description="Name of the new library",
-        default="Lib")
-    
-    def execute(self, context):
-        settings = find_settings()
-        
-        settings.libraries.add(name=self.name)
-        
-        return {'FINISHED'}
-
-class DeleteCursor3DBookmarkLibrary(bpy.types.Operator):
-    bl_idname = "scene.cursor_3d_delete_bookmark_library"
-    bl_label = "Delete Library"
-    bl_description = "Delete active bookmark library"
-    
-    def execute(self, context):
-        settings = find_settings()
-        
-        name = settings.libraries.active
-        
-        settings.libraries.remove(key=name)
-        
-        return {'FINISHED'}
-
-# ===== MAIN PROPERTIES ===== #
-# TODO: ~a bug? Somewhy tooltip shows "Cursor3DToolsSettings.foo"
-# instead of "bpy.types.Screen.cursor_3d_tools_settings.foo"
-class Cursor3DToolsSettings(bpy.types.PropertyGroup):
-    transform_options = bpy.props.PointerProperty(
-        type=TransformExtraOptionsProp,
-        options={'HIDDEN'})
-    
-    cursor_visible = bpy.props.BoolProperty(
-        name="Cursor visibility",
-        description="Cursor visibility (causing bugs, commented out)",
-        default=True)
-    
-    draw_guides = bpy.props.BoolProperty(
-        name="Guides",
-        description="Display guides",
-        default=True)
-    
-    draw_snap_elements = bpy.props.BoolProperty(
-        name="Snap elements",
-        description="Display snap elements",
-        default=True)
-    
-    draw_N = bpy.props.BoolProperty(
-        name="Surface normal",
-        description="Display surface normal",
-        default=True)
-    
-    draw_T1 = bpy.props.BoolProperty(
-        name="Surface 1st tangential",
-        description="Display 1st surface tangential",
-        default=True)
-    
-    draw_T2 = bpy.props.BoolProperty(
-        name="Surface 2nd tangential",
-        description="Display 2nd surface tangential",
-        default=True)
-    
-    stick_to_obj = bpy.props.BoolProperty(
-        name="Stick to objects",
-        description="Move cursor along with object it was snapped to",
-        default=True)
-    
-    # HISTORY-RELATED
-    history = bpy.props.PointerProperty(
-        type=CursorHistoryProp,
-        options={'HIDDEN'})
-    
-    # BOOKMARK-RELATED
-    libraries = bpy.props.PointerProperty(
-        type=BookmarkLibraryIDBlock,
-        options={'HIDDEN'})
-    
-    show_bookmarks = bpy.props.BoolProperty(
-        name="Show bookmarks",
-        description="Show active bookmark in 3D view",
-        default=True,
-        options={'HIDDEN'})
-    
-    free_coord_precision = bpy.props.IntProperty(
-        name="Coord precision",
-        description="Numer of digits afer comma "\
-                    "for displayed coordinate values",
-        default=4,
-        min=0,
-        max=10,
-        options={'HIDDEN'})
-
-class Cursor3DToolsSceneSettings(bpy.types.PropertyGroup):
-    stick_obj_name = bpy.props.StringProperty(
-        name="Stick-to-object name",
-        description="Name of the object to stick cursor to",
-        options={'HIDDEN'})
-    stick_obj_pos = bpy.props.FloatVectorProperty(
-        default=(0.0, 0.0, 0.0),
-        options={'HIDDEN'},
-        subtype='XYZ')
-
-# ===== CURSOR RUNTIME PROPERTIES ===== #
-class CursorRuntimeSettings(bpy.types.PropertyGroup):
-    current_monitor_id = bpy.props.IntProperty(
-        default=0,
-        options={'HIDDEN'})
-    
-    surface_pos = bpy.props.FloatVectorProperty(
-        default=(0.0, 0.0, 0.0),
-        options={'HIDDEN'},
-        subtype='XYZ')
-
-class CursorDynamicSettings:
-    local_matrix = Matrix()
-    
-    active_transform_operator = None
-    
-    csu = None
-    
-    active_scene_hash = 0
-    
-    @classmethod
-    def recalc_csu(cls, context, event_value=None):
-        scene_hash_changed = (cls.active_scene_hash != hash(context.scene))
-        cls.active_scene_hash = hash(context.scene)
-        
-        # Don't recalc if mouse is over some UI panel!
-        # (otherwise, this may lead to applying operator
-        # (e.g. Subdivide) in Edit Mode, even if user
-        # just wants to change some operator setting)
-        clicked = (event_value in {'PRESS', 'RELEASE'}) and \
-            (context.region.type == 'WINDOW')
-        
-        if clicked or scene_hash_changed:
-            particles, cls.csu = gather_particles()
-
-#============================================================================#
-# ===== PANELS AND DIALOGS ===== #
-class TransformExtraOptions(bpy.types.Panel):
-    bl_label = "Transform Extra Options"
-    bl_idname = "OBJECT_PT_transform_extra_options"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "UI"
-    #bl_context = "object"
-    bl_options = {'DEFAULT_CLOSED'}
-    
-    def draw(self, context):
-        layout = self.layout
-        
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        layout.prop(tfm_opts, "use_relative_coords")
-        layout.prop(tfm_opts, "snap_only_to_solid")
-        layout.prop(tfm_opts, "snap_interpolate_normals_mode", text="")
-        layout.prop(tfm_opts, "use_comma_separator")
-        #layout.prop(tfm_opts, "snap_element_screen_size")
-
-class Cursor3DTools(bpy.types.Panel):
-    bl_label = "3D Cursor Tools"
-    bl_idname = "OBJECT_PT_cursor_3d_tools"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "UI"
-    bl_options = {'DEFAULT_CLOSED'}
-    
-    def draw(self, context):
-        layout = self.layout
-        
-        # Attempt to launch the monitor
-        if bpy.ops.view3d.cursor3d_monitor.poll():
-            bpy.ops.view3d.cursor3d_monitor()
-        
-        # If addon is enabled by default, the new scene
-        # created on Blender startup will have disabled
-        # standard Cursor3D behavior. However, if user
-        # creates new scene, somehow Cursor3D is active
-        # as if nothing happened xD
-        update_keymap(True)
-        #=============================================#
-        
-        settings = find_settings()
-        
-        row = layout.split(0.5)
-        #row = layout.row()
-        row.operator("view3d.set_cursor3d_dialog",
-            "Set", 'CURSOR')
-        row = row.split(1 / 3, align=True)
-        #row = row.row(align=True)
-        row.prop(settings, "draw_guides",
-            text="", icon='MANIPUL', toggle=True)
-        row.prop(settings, "draw_snap_elements",
-            text="", icon='EDITMODE_HLT', toggle=True)
-        row.prop(settings, "stick_to_obj",
-            text="", icon='SNAP_ON', toggle=True)
-        
-        row = layout.row()
-        #row.label(text="Draw")
-        #row.prop(settings, "cursor_visible", text="", toggle=True,
-        #         icon=('RESTRICT_VIEW_OFF' if settings.cursor_visible
-        #               else 'RESTRICT_VIEW_ON'))
-        subrow = row.row()
-        subrow.enabled = False
-        subrow.alert = True
-        subrow.prop(settings, "cursor_visible", text="", toggle=True,
-                 icon='RESTRICT_VIEW_OFF')
-        row = row.split(1 / 3, align=True)
-        row.prop(settings, "draw_N",
-            text="N", toggle=True, index=0)
-        row.prop(settings, "draw_T1",
-            text="T1", toggle=True, index=1)
-        row.prop(settings, "draw_T2",
-            text="T2", toggle=True, index=2)
-        
-        # === HISTORY === #
-        history = settings.history
-        row = layout.row(align=True)
-        row.prop(history, "show_trace", text="", icon='SORTTIME')
-        row = row.split(0.35, True)
-        row.prop(history, "max_size", text="")
-        row.prop(history, "current_id", text="")
-        
-        # === BOOKMARK LIBRARIES === #
-        settings.libraries.draw(context, layout)
-        
-        library = settings.libraries.get_item()
-        
-        if library is None:
-            return
-        
-        row = layout.row()
-        row.prop(settings, "show_bookmarks",
-            text="", icon='RESTRICT_VIEW_OFF')
-        row = row.row(align=True)
-        row.prop(library, "system", text="")
-        row.prop(library, "offset", text="",
-            icon='ARROW_LEFTRIGHT')
-        
-        # === BOOKMARKS === #
-        library.bookmarks.draw(context, layout)
-        
-        if len(library.bookmarks.collection) == 0:
-            return
-        
-        row = layout.row()
-        row = row.split(align=True)
-        # PASTEDOWN
-        # COPYDOWN
-        row.operator("scene.cursor_3d_overwrite_bookmark",
-            text="", icon='REC')
-        row.operator("scene.cursor_3d_swap_bookmark",
-            text="", icon='FILE_REFRESH')
-        row.operator("scene.cursor_3d_recall_bookmark",
-            text="", icon='FILE_TICK')
-        row.operator("scene.cursor_3d_add_empty_at_bookmark",
-            text="", icon='EMPTY_DATA')
-        # Not implemented (and maybe shouldn't)
-        #row.operator("scene.cursor_3d_snap_selection_to_bookmark",
-        #    text="", icon='SNAP_ON')
-
-class SetCursorDialog(bpy.types.Operator):
-    bl_idname = "view3d.set_cursor3d_dialog"
-    bl_label = "Set 3D Cursor"
-    bl_description = "Set 3D Cursor XYZ values"
-    
-    pos = bpy.props.FloatVectorProperty(
-        name="Location",
-        description="3D Cursor location in current coordinate system",
-        subtype='XYZ',
-        )
-    
-    @classmethod
-    def poll(cls, context):
-        return context.area.type == 'VIEW_3D'
-    
-    def execute(self, context):
-        scene = context.scene
-        
-        # "current system" / "relative" could have changed
-        self.matrix = self.csu.get_matrix()
-        
-        pos = self.matrix * self.pos
-        set_cursor_location(pos, v3d=context.space_data)
-        
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        scene = context.scene
-        
-        cursor_pos = get_cursor_location(v3d=context.space_data)
-        
-        particles, self.csu = gather_particles(context=context)
-        self.csu.source_pos = cursor_pos
-        
-        self.matrix = self.csu.get_matrix()
-        
-        try:
-            self.pos = self.matrix.inverted() * cursor_pos
-        except:
-            # this is some degenerate system
-            self.pos = Vector()
-        
-        wm = context.window_manager
-        return wm.invoke_props_dialog(self, width=160)
-    
-    def draw(self, context):
-        layout = self.layout
-        
-        settings = find_settings()
-        tfm_opts = settings.transform_options
-        
-        v3d = context.space_data
-        
-        col = layout.column()
-        col.prop(self, "pos", text="")
-        
-        row = layout.row()
-        row.prop(tfm_opts, "use_relative_coords", text="Relative")
-        row.prop(v3d, "transform_orientation", text="")
-
-class AlignOrientationProperties(bpy.types.PropertyGroup):
-    axes_items = [
-        ('X', 'X', 'X axis'),
-        ('Y', 'Y', 'Y axis'),
-        ('Z', 'Z', 'Z axis'),
-        ('-X', '-X', '-X axis'),
-        ('-Y', '-Y', '-Y axis'),
-        ('-Z', '-Z', '-Z axis'),
-    ]
-    
-    axes_items_ = [
-        ('X', 'X', 'X axis'),
-        ('Y', 'Y', 'Y axis'),
-        ('Z', 'Z', 'Z axis'),
-        (' ', ' ', 'Same as source axis'),
-    ]
-    
-    def get_orients(self, context):
-        orients = []
-        orients.append(('GLOBAL', "Global", ""))
-        orients.append(('LOCAL', "Local", ""))
-        orients.append(('GIMBAL', "Gimbal", ""))
-        orients.append(('NORMAL', "Normal", ""))
-        orients.append(('VIEW', "View", ""))
-        
-        for orientation in context.scene.orientations:
-            name = orientation.name
-            orients.append((name, name, ""))
-        
-        return orients
-    
-    src_axis = bpy.props.EnumProperty(default='Z', items=axes_items,
-                                      name="Initial axis")
-    #src_orient = bpy.props.EnumProperty(default='GLOBAL', items=get_orients)
-    
-    dest_axis = bpy.props.EnumProperty(default=' ', items=axes_items_,
-                                       name="Final axis")
-    dest_orient = bpy.props.EnumProperty(items=get_orients,
-                                         name="Final orientation")
-
-class AlignOrientation(bpy.types.Operator):
-    bl_idname = "view3d.align_orientation"
-    bl_label = "Align Orientation"
-    bl_description = "Rotates active object to match axis of current "\
-        "orientation to axis of another orientation"
-    bl_options = {'REGISTER', 'UNDO'}
-    
-    axes_items = [
-        ('X', 'X', 'X axis'),
-        ('Y', 'Y', 'Y axis'),
-        ('Z', 'Z', 'Z axis'),
-        ('-X', '-X', '-X axis'),
-        ('-Y', '-Y', '-Y axis'),
-        ('-Z', '-Z', '-Z axis'),
-    ]
-    
-    axes_items_ = [
-        ('X', 'X', 'X axis'),
-        ('Y', 'Y', 'Y axis'),
-        ('Z', 'Z', 'Z axis'),
-        (' ', ' ', 'Same as source axis'),
-    ]
-    
-    axes_ids = {'X':0, 'Y':1, 'Z':2}
-    
-    def get_orients(self, context):
-        orients = []
-        orients.append(('GLOBAL', "Global", ""))
-        orients.append(('LOCAL', "Local", ""))
-        orients.append(('GIMBAL', "Gimbal", ""))
-        orients.append(('NORMAL', "Normal", ""))
-        orients.append(('VIEW', "View", ""))
-        
-        for orientation in context.scene.orientations:
-            name = orientation.name
-            orients.append((name, name, ""))
-        
-        return orients
-    
-    src_axis = bpy.props.EnumProperty(default='Z', items=axes_items,
-                                      name="Initial axis")
-    #src_orient = bpy.props.EnumProperty(default='GLOBAL', items=get_orients)
-    
-    dest_axis = bpy.props.EnumProperty(default=' ', items=axes_items_,
-                                       name="Final axis")
-    dest_orient = bpy.props.EnumProperty(items=get_orients,
-                                         name="Final orientation")
-    
-    @classmethod
-    def poll(cls, context):
-        return (context.area.type == 'VIEW_3D') and context.object
-    
-    def execute(self, context):
-        wm = context.window_manager
-        obj = context.object
-        scene = context.scene
-        v3d = context.space_data
-        rv3d = context.region_data
-        
-        particles, csu = gather_particles(context=context)
-        tou = csu.tou
-        #tou = TransformOrientationUtility(scene, v3d, rv3d)
-        
-        aop = wm.align_orientation_properties # self
-        
-        src_matrix = tou.get_matrix()
-        src_axes = MatrixDecompose(src_matrix)
-        src_axis_name = aop.src_axis
-        if src_axis_name.startswith("-"):
-            src_axis_name = src_axis_name[1:]
-            src_axis = -src_axes[self.axes_ids[src_axis_name]]
-        else:
-            src_axis = src_axes[self.axes_ids[src_axis_name]]
-        
-        tou.set(aop.dest_orient, False)
-        dest_matrix = tou.get_matrix()
-        dest_axes = MatrixDecompose(dest_matrix)
-        if self.dest_axis != ' ':
-            dest_axis_name = aop.dest_axis
-        else:
-            dest_axis_name = src_axis_name
-        dest_axis = dest_axes[self.axes_ids[dest_axis_name]]
-        
-        q = src_axis.rotation_difference(dest_axis)
-        
-        m = obj.matrix_world.to_3x3()
-        m.rotate(q)
-        m.resize_4x4()
-        m.translation = obj.matrix_world.translation.copy()
-        
-        obj.matrix_world = m
-        
-        #bpy.ops.ed.undo_push(message="Align Orientation")
-        
-        return {'FINISHED'}
-    
-    # ATTENTION!
-    # This _must_ be a dialog, because with 'UNDO' option
-    # the last selected orientation may revert to the previous state
-    def invoke(self, context, event):
-        wm = context.window_manager
-        return wm.invoke_props_dialog(self, width=200)
-    
-    def draw(self, context):
-        layout = self.layout
-        wm = context.window_manager
-        aop = wm.align_orientation_properties # self
-        layout.prop(aop, "src_axis")
-        layout.prop(aop, "dest_axis")
-        layout.prop(aop, "dest_orient")
-
-class CopyOrientation(bpy.types.Operator):
-    bl_idname = "view3d.copy_orientation"
-    bl_label = "Copy Orientation"
-    bl_description = "Makes a copy of current orientation"
-    
-    def execute(self, context):
-        scene = context.scene
-        v3d = context.space_data
-        rv3d = context.region_data
-        
-        particles, csu = gather_particles(context=context)
-        tou = csu.tou
-        #tou = TransformOrientationUtility(scene, v3d, rv3d)
-        
-        orient = create_transform_orientation(scene,
-            name=tou.get()+".copy", matrix=tou.get_matrix())
-        
-        tou.set(orient.name)
-        
-        return {'FINISHED'}
-
-def transform_orientations_panel_extension(self, context):
-    row = self.layout.row()
-    row.operator("view3d.align_orientation", text="Align")
-    row.operator("view3d.copy_orientation", text="Copy")
-
-# ===== CURSOR MONITOR ===== #
-class CursorMonitor(bpy.types.Operator):
-    """Monitor changes in cursor location and write to history"""
-    bl_idname = "view3d.cursor3d_monitor"
-    bl_label = "Cursor Monitor"
-    
-    # A class-level variable (it must be accessed from poll())
-    is_running = False
-    
-    storage = {}
-    
-    @classmethod
-    def poll(cls, context):
-        try:
-            runtime_settings = find_runtime_settings()
-            if not runtime_settings:
-                return False
-            
-            # When addon is enabled by default and
-            # user started another new scene, is_running
-            # would still be True
-            return (not CursorMonitor.is_running) or \
-                (runtime_settings.current_monitor_id == 0)
-        except Exception as e:
-            print("Cursor monitor exeption in poll:\n" + str(e))
-            return False
-    
-    def modal(self, context, event):
-        try:
-            return self._modal(context, event)
-        except Exception as e:
-            print("Cursor monitor exeption in modal:\n" + str(e))
-            # Remove callbacks at any cost
-            self.cancel(context)
-            #raise
-            return {'CANCELLED'}
-    
-    def _modal(self, context, event):
-        runtime_settings = find_runtime_settings()
-        
-        # ATTENTION: will this work correctly when another
-        # blend is loaded? (it should, since all scripts
-        # seem to be reloaded in such case)
-        if (runtime_settings is None) or \
-                (self.id != runtime_settings.current_monitor_id):
-            # Another (newer) monitor was launched;
-            # this one should stop.
-            # (OR addon was disabled)
-            return self.cancel(context)
-        
-        # Somewhy after addon re-registration
-        # this permanently becomes False
-        CursorMonitor.is_running = True
-        
-        if self.update_storage(runtime_settings):
-            # hmm... can this cause flickering of menus?
-            context.area.tag_redraw()
-        
-        settings = find_settings()
-        
-        # ================== #
-        # Update bookmark enums when addon is initialized.
-        # Since CursorMonitor operator can be called from draw(),
-        # we have to postpone all re-registration-related tasks
-        # (such as redefining the enums).
-        if self.just_initialized:
-            # update the relevant enums, bounds and other options
-            # (is_running becomes False once another scene is loaded,
-            # so this operator gets restarted)
-            settings.history.update_max_size()
-            settings.libraries.update_enum()
-            library = settings.libraries.get_item()
-            if library:
-                library.bookmarks.update_enum()
-            
-            self.just_initialized = False
-        # ================== #
-        
-        # Seems like recalc_csu() in this place causes trouble
-        # if space type is switched from 3D to e.g. UV
-        '''
-        tfm_operator = CursorDynamicSettings.active_transform_operator
-        if tfm_operator:
-            CursorDynamicSettings.csu = tfm_operator.csu
-        else:
-            CursorDynamicSettings.recalc_csu(context, event.value)
-        '''
-        
-        return {'PASS_THROUGH'}
-    
-    def update_storage(self, runtime_settings):
-        if CursorDynamicSettings.active_transform_operator:
-            # Don't add to history while operator is running
-            return False
-        
-        new_pos = None
-        
-        last_locations = {}
-        
-        for scene in bpy.data.scenes:
-            # History doesn't depend on view (?)
-            curr_pos = get_cursor_location(scene=scene)
-            
-            last_locations[scene.name] = curr_pos
-            
-            # Ignore newly-created or some renamed scenes
-            if scene.name in self.last_locations:
-                if curr_pos != self.last_locations[scene.name]:
-                    new_pos = curr_pos
-            elif runtime_settings.current_monitor_id == 0:
-                # startup location should be added
-                new_pos = curr_pos
-        
-        # Seems like scene.cursor_location is fast enough here
-        # -> no need to resort to v3d.cursor_location.
-        """
-        screen = bpy.context.screen
-        scene = screen.scene
-        v3d = None
-        for area in screen.areas:
-            for space in area.spaces:
-                if space.type == 'VIEW_3D':
-                    v3d = space
-                    break
-        
-        if v3d is not None:
-            curr_pos = get_cursor_location(v3d=v3d)
-            
-            last_locations[scene.name] = curr_pos
-            
-            # Ignore newly-created or some renamed scenes
-            if scene.name in self.last_locations:
-                if curr_pos != self.last_locations[scene.name]:
-                    new_pos = curr_pos
-        """
-        
-        self.last_locations = last_locations
-        
-        if new_pos is not None:
-            settings = find_settings()
-            history = settings.history
-            
-            pos = history.get_pos()
-            if (pos is not None):# and (history.current_id != 0): # ?
-                if pos == new_pos:
-                    return False # self.just_initialized ?
-            
-            entry = history.entries.add()
-            entry.pos = new_pos
-            
-            last_id = len(history.entries) - 1
-            history.entries.move(last_id, 0)
-            
-            if last_id > int(history.max_size):
-                history.entries.remove(last_id)
-            
-            # make sure the most recent history entry is displayed
-            
-            CursorHistoryProp.update_cursor_on_id_change = False
-            history.current_id = 0
-            CursorHistoryProp.update_cursor_on_id_change = True
-            
-            history.curr_id = history.current_id
-            history.last_id = 1
-            
-            return True
-        
-        return False # self.just_initialized ?
-    
-    def execute(self, context):
-        print("Cursor monitor: launched")
-        
-        runtime_settings = find_runtime_settings()
-        
-        self.just_initialized = True
-        
-        self.id = 0
-        
-        self.last_locations = {}
-        
-        # Important! Call update_storage() before assigning
-        # current_monitor_id (used to add startup cursor location)
-        self.update_storage(runtime_settings)
-        
-        # Indicate that this is the most recent monitor.
-        # All others should shut down.
-        self.id = runtime_settings.current_monitor_id + 1
-        runtime_settings.current_monitor_id = self.id
-        
-        CursorMonitor.is_running = True
-        
-        CursorDynamicSettings.recalc_csu(context, 'PRESS')
-
-        # I suppose that cursor position would change
-        # only with user interaction.
-        #self._timer = context.window_manager. \
-        #    event_timer_add(0.1, context.window)
-        
-        #'''
-        #self._draw_callback_view = context.region.callback_add( \
-        #    draw_callback_view, (self, context), 'POST_VIEW')
-        self._draw_callback_view = find_region(context.area).\
-            callback_add(draw_callback_view, \
-            (self, context), 'POST_VIEW')
-        self._draw_callback_px = find_region(context.area).\
-            callback_add(draw_callback_px, \
-            (self, context), 'POST_PIXEL')
-        
-        self._draw_header_px = find_region(context.area, 'HEADER').\
-            callback_add(draw_callback_header_px, \
-            (self, context), 'POST_PIXEL')
-        #'''
-        
-        # Here we cannot return 'PASS_THROUGH',
-        # or Blender will crash!
-
-        # Currently there seems to be only one window
-        context.window_manager.modal_handler_add(self)
-        return {'RUNNING_MODAL'}
-    
-    def cancel(self, context):
-        CursorMonitor.is_running = False
-        #type(self).is_running = False
-        
-        # Unregister callbacks...
-        #'''
-        #context.region.callback_remove(self._draw_callback_view)
-        find_region(context.area).callback_remove(self._draw_callback_view)
-        find_region(context.area).callback_remove(self._draw_callback_px)
-        
-        find_region(context.area, 'HEADER').\
-            callback_remove(self._draw_header_px)
-        #'''
-        
-        return {'CANCELLED'}
-
-
-# ===== MATH / GEOMETRY UTILITIES ===== #
-def to_matrix4x4(orient, pos):
-    if not isinstance(orient, Matrix):
-        orient = orient.to_matrix()
-    m = orient.to_4x4()
-    m.translation = pos.to_3d()
-    return m
-
-def MatrixCompose(*args):
-    size = len(args)
-    m = Matrix.Identity(size)
-    axes = m.col # m.row
-    
-    if size == 2:
-        for i in (0, 1):
-            c = args[i]
-            if isinstance(c, Vector):
-                axes[i] = c.to_2d()
-            elif hasattr(c, "__iter__"):
-                axes[i] = Vector(c).to_2d()
-            else:
-                axes[i][i] = c
-    else:
-        for i in (0, 1, 2):
-            c = args[i]
-            if isinstance(c, Vector):
-                axes[i][:3] = c.to_3d()
-            elif hasattr(c, "__iter__"):
-                axes[i][:3] = Vector(c).to_3d()
-            else:
-                axes[i][i] = c
-        
-        if size == 4:
-            c = args[3]
-            if isinstance(c, Vector):
-                m.translation = c.to_3d()
-            elif hasattr(c, "__iter__"):
-                m.translation = Vector(c).to_3d()
-    
-    return m
-
-def MatrixDecompose(m, res_size=None):
-    size = len(m)
-    axes = m.col # m.row
-    if res_size is None:
-        res_size = size
-    
-    if res_size == 2:
-        return (axes[0].to_2d(), axes[1].to_2d())
-    else:
-        x = axes[0].to_3d()
-        y = axes[1].to_3d()
-        z = (axes[2].to_3d() if size > 2 else Vector())
-        if res_size == 3:
-            return (x, y, z)
-        
-        t = (m.translation.to_3d() if size == 4 else Vector())
-        if res_size == 4:
-            return (x, y, z, t)
-
-def angle_axis_to_quat(angle, axis):
-    w = math.cos(angle / 2.0)
-    xyz = axis.normalized() * math.sin(angle / 2.0)
-    return Quaternion((w, xyz.x, xyz.y, xyz.z))
-
-def round_step(x, s=1.0):
-    #return math.floor(x * s + 0.5) / s
-    return math.floor(x / s + 0.5) * s
-
-twoPi = 2.0 * math.pi
-def clamp_angle(ang):
-    # Attention! In Python the behaviour is:
-    # -359.0 % 180.0 == 1.0
-    # -359.0 % -180.0 == -179.0
-    ang = (ang % twoPi)
-    return ((ang - twoPi) if (ang > math.pi) else ang)
-
-def prepare_grid_mesh(bm, nx=1, ny=1, sx=1.0, sy=1.0,
-                      z=0.0, xyz_indices=(0,1,2)):
-    vertices = []
-    for i in range(nx + 1):
-        x = 2 * (i / nx) - 1
-        x *= sx
-        for j in range(ny + 1):
-            y = 2 * (j / ny) - 1
-            y *= sy
-            pos = (x, y, z)
-            vert = bm.verts.new((pos[xyz_indices[0]],
-                                 pos[xyz_indices[1]],
-                                 pos[xyz_indices[2]]))
-            vertices.append(vert)
-    
-    nxmax = nx + 1
-    for i in range(nx):
-        i1 = i + 1
-        for j in range(ny):
-            j1 = j + 1
-            verts = [vertices[j + i * nxmax],
-                     vertices[j1 + i * nxmax],
-                     vertices[j1 + i1 * nxmax],
-                     vertices[j + i1 * nxmax]]
-            bm.faces.new(verts)
-    #return
-
-def prepare_gridbox_mesh(subdiv=1):
-    bm = bmesh.new()
-    
-    sides = [
-        (-1, (0,1,2)), # -Z
-        (1, (1,0,2)), # +Z
-        (-1, (1,2,0)), # -Y
-        (1, (0,2,1)), # +Y
-        (-1, (2,0,1)), # -X
-        (1, (2,1,0)), # +X
-        ]
-    
-    for side in sides:
-        prepare_grid_mesh(bm, nx=subdiv, ny=subdiv,
-            z=side[0], xyz_indices=side[1])
-    
-    return bm
-
-# ===== DRAWING UTILITIES ===== #
-class GfxCell:
-    def __init__(self, w, h, color=None, alpha=None, draw=None):
-        self.w = w
-        self.h = h
-        
-        self.color = (0, 0, 0, 1)
-        self.set_color(color, alpha)
-        
-        if draw:
-            self.draw = draw
-    
-    def set_color(self, color=None, alpha=None):
-        if color is None:
-            color = self.color
-        if alpha is None:
-            alpha = (color[3] if len(color) > 3 else self.color[3])
-        self.color = Vector((color[0], color[1], color[2], alpha))
-    
-    def prepare_draw(self, x, y, align=(0, 0)):
-        if self.color[3] <= 0.0:
-            return None
-        
-        if (align[0] != 0) or (align[1] != 0):
-            x -= self.w * align[0]
-            y -= self.h * align[1]
-        
-        x = int(math.floor(x + 0.5))
-        y = int(math.floor(y + 0.5))
-        
-        bgl.glColor4f(*self.color)
-        
-        return x, y
-    
-    def draw(self, x, y, align=(0, 0)):
-        xy = self.prepare_draw(x, y, align)
-        if not xy:
-            return
-        
-        draw_rect(xy[0], xy[1], w, h)
-
-class TextCell(GfxCell):
-    font_id = 0
-    
-    def __init__(self, text="", color=None, alpha=None, font_id=None):
-        if font_id is None:
-            font_id = TextCell.font_id
-        self.font_id = font_id
-        
-        self.set_text(text)
-        
-        self.color = (0, 0, 0, 1)
-        self.set_color(color, alpha)
-    
-    def set_text(self, text):
-        self.text = str(text)
-        dims = blf.dimensions(self.font_id, self.text)
-        self.w = dims[0]
-        dims = blf.dimensions(self.font_id, "dp") # fontheight
-        self.h = dims[1]
-    
-    def draw(self, x, y, align=(0, 0)):
-        xy = self.prepare_draw(x, y, align)
-        if not xy:
-            return
-        
-        blf.position(self.font_id, xy[0], xy[1], 0)
-        blf.draw(self.font_id, self.text)
-
-def find_region(area, region_type='WINDOW'):
-    # 'WINDOW', 'HEADER', 'CHANNELS', 'TEMPORARY',
-    # 'UI', 'TOOLS', 'TOOL_PROPS', 'PREVIEW'
-    for region in area.regions:
-        if region.type == region_type:
-            return region
-
-def draw_text(x, y, value, font_id=0, align=(0, 0), font_height=None):
-    value = str(value)
-    
-    if (align[0] != 0) or (align[1] != 0):
-        dims = blf.dimensions(font_id, value)
-        if font_height is not None:
-            dims = (dims[0], font_height)
-        x -= dims[0] * align[0]
-        y -= dims[1] * align[1]
-    
-    x = int(math.floor(x + 0.5))
-    y = int(math.floor(y + 0.5))
-    
-    blf.position(font_id, x, y, 0)
-    blf.draw(font_id, value)
-
-def draw_rect(x, y, w, h, margin=0, outline=False):
-    if w < 0:
-        x += w
-        w = abs(w)
-    
-    if h < 0:
-        y += h
-        h = abs(h)
-    
-    x = int(x)
-    y = int(y)
-    w = int(w)
-    h = int(h)
-    margin = int(margin)
-    
-    if outline:
-        bgl.glBegin(bgl.GL_LINE_LOOP)
-    else:
-        bgl.glBegin(bgl.GL_TRIANGLE_FAN)
-    bgl.glVertex2i(x - margin, y - margin)
-    bgl.glVertex2i(x + w + margin, y - margin)
-    bgl.glVertex2i(x + w + margin, y + h + margin)
-    bgl.glVertex2i(x - margin, y + h + margin)
-    bgl.glEnd()
-
-def append_round_rect(verts, x, y, w, h, rw, rh=None):
-    if rh is None:
-        rh = rw
-    
-    if w < 0:
-        x += w
-        w = abs(w)
-    
-    if h < 0:
-        y += h
-        h = abs(h)
-    
-    if rw < 0:
-        rw = min(abs(rw), w * 0.5)
-        x += rw
-        w -= rw * 2
-    
-    if rh < 0:
-        rh = min(abs(rh), h * 0.5)
-        y += rh
-        h -= rh * 2
-    
-    n = int(max(rw, rh) * math.pi / 2.0)
-    
-    a0 = 0.0
-    a1 = math.pi / 2.0
-    append_oval_segment(verts, x + w, y + h, rw, rh, a0, a1, n)
-    
-    a0 = math.pi / 2.0
-    a1 = math.pi
-    append_oval_segment(verts, x + w, y, rw, rh, a0, a1, n)
-    
-    a0 = math.pi
-    a1 = 3.0 * math.pi / 2.0
-    append_oval_segment(verts, x, y, rw, rh, a0, a1, n)
-    
-    a0 = 3.0 * math.pi / 2.0
-    a1 = math.pi * 2.0
-    append_oval_segment(verts, x, y + h, rw, rh, a0, a1, n)
-
-def append_oval_segment(verts, x, y, rw, rh, a0, a1, n, skip_last=False):
-    nmax = n - 1
-    da = a1 - a0
-    for i in range(n - int(skip_last)):
-        a = a0 + da * (i / nmax)
-        dx = math.sin(a) * rw
-        dy = math.cos(a) * rh
-        verts.append((x + int(dx), y + int(dy)))
-
-def draw_line(p0, p1, c=None):
-    if c is not None:
-        bgl.glColor4f(c[0], c[1], c[2], \
-            (c[3] if len(c) > 3 else 1.0))
-    bgl.glBegin(bgl.GL_LINE_STRIP)
-    bgl.glVertex3f(p0[0], p0[1], p0[2])
-    bgl.glVertex3f(p1[0], p1[1], p1[2])
-    bgl.glEnd()
-
-def draw_line_2d(p0, p1, c=None):
-    if c is not None:
-        bgl.glColor4f(c[0], c[1], c[2], \
-            (c[3] if len(c) > 3 else 1.0))
-    bgl.glBegin(bgl.GL_LINE_STRIP)
-    bgl.glVertex2f(p0[0], p0[1])
-    bgl.glVertex2f(p1[0], p1[1])
-    bgl.glEnd()
-
-def draw_line_hidden_depth(p0, p1, c, a0=1.0, a1=0.5, s0=None, s1=None):
-    bgl.glEnable(bgl.GL_DEPTH_TEST)
-    bgl.glColor4f(c[0], c[1], c[2], a0)
-    if s0 is not None:
-        gl_enable(bgl.GL_LINE_STIPPLE, int(bool(s0)))
-    draw_line(p0, p1)
-    bgl.glDisable(bgl.GL_DEPTH_TEST)
-    if (a1 == a0) and (s1 == s0):
-        return
-    bgl.glColor4f(c[0], c[1], c[2], a1)
-    if s1 is not None:
-        gl_enable(bgl.GL_LINE_STIPPLE, int(bool(s1)))
-    draw_line(p0, p1)
-
-def draw_arrow(p0, x, y, z, n_scl=0.2, ort_scl=0.035):
-    p1 = p0 + z
-    
-    bgl.glBegin(bgl.GL_LINE_STRIP)
-    bgl.glVertex3f(p0[0], p0[1], p0[2])
-    bgl.glVertex3f(p1[0], p1[1], p1[2])
-    bgl.glEnd()
-    
-    p2 = p1 - z * n_scl
-    bgl.glBegin(bgl.GL_TRIANGLE_FAN)
-    bgl.glVertex3f(p1[0], p1[1], p1[2])
-    p3 = p2 + (x + y) * ort_scl
-    bgl.glVertex3f(p3[0], p3[1], p3[2])
-    p3 = p2 + (-x + y) * ort_scl
-    bgl.glVertex3f(p3[0], p3[1], p3[2])
-    p3 = p2 + (-x - y) * ort_scl
-    bgl.glVertex3f(p3[0], p3[1], p3[2])
-    p3 = p2 + (x - y) * ort_scl
-    bgl.glVertex3f(p3[0], p3[1], p3[2])
-    p3 = p2 + (x + y) * ort_scl
-    bgl.glVertex3f(p3[0], p3[1], p3[2])
-    bgl.glEnd()
-
-def draw_arrow_2d(p0, n, L, arrow_len, arrow_width):
-    p1 = p0 + n * L
-    t = Vector((-n[1], n[0]))
-    pA = p1 - n * arrow_len + t * arrow_width
-    pB = p1 - n * arrow_len - t * arrow_width
-    
-    bgl.glBegin(bgl.GL_LINES)
-    
-    bgl.glVertex2f(p0[0], p0[1])
-    bgl.glVertex2f(p1[0], p1[1])
-    
-    bgl.glVertex2f(p1[0], p1[1])
-    bgl.glVertex2f(pA[0], pA[1])
-    
-    bgl.glVertex2f(p1[0], p1[1])
-    bgl.glVertex2f(pB[0], pB[1])
-    
-    bgl.glEnd()
-
-# Store/restore OpenGL settings and working with
-# projection matrices -- inspired by space_view3d_panel_measure
-# of Buerbaum Martin (Pontiac).
-
-# OpenGl helper functions/data
-gl_state_info = {
-    bgl.GL_MATRIX_MODE:(bgl.GL_INT, 1),
-    bgl.GL_PROJECTION_MATRIX:(bgl.GL_DOUBLE, 16),
-    bgl.GL_LINE_WIDTH:(bgl.GL_FLOAT, 1),
-    bgl.GL_BLEND:(bgl.GL_BYTE, 1),
-    bgl.GL_LINE_STIPPLE:(bgl.GL_BYTE, 1),
-    bgl.GL_COLOR:(bgl.GL_FLOAT, 4),
-    bgl.GL_SMOOTH:(bgl.GL_BYTE, 1),
-    bgl.GL_DEPTH_TEST:(bgl.GL_BYTE, 1),
-    bgl.GL_DEPTH_WRITEMASK:(bgl.GL_BYTE, 1),
-}
-gl_type_getters = {
-    bgl.GL_INT:bgl.glGetIntegerv,
-    bgl.GL_DOUBLE:bgl.glGetFloatv, # ?
-    bgl.GL_FLOAT:bgl.glGetFloatv,
-    #bgl.GL_BYTE:bgl.glGetFloatv, # Why GetFloat for getting byte???
-    bgl.GL_BYTE:bgl.glGetBooleanv, # maybe like that?
-}
-
-def gl_get(state_id):
-    type, size = gl_state_info[state_id]
-    buf = bgl.Buffer(type, [size])
-    gl_type_getters[type](state_id, buf)
-    return (buf if (len(buf) != 1) else buf[0])
-
-def gl_enable(state_id, enable):
-    if enable:
-        bgl.glEnable(state_id)
-    else:
-        bgl.glDisable(state_id)
-
-def gl_matrix_to_buffer(m):
-    tempMat = [m[i][j] for i in range(4) for j in range(4)]
-    return bgl.Buffer(bgl.GL_FLOAT, 16, tempMat)
-
-
-# ===== DRAWING CALLBACKS ===== #
-cursor_save_location = Vector()
-
-def draw_callback_view(self, context):
-    global cursor_save_location
-    
-    settings = find_settings()
-    if settings is None:
-        return
-    
-    update_stick_to_obj(context)
-    
-    if "EDIT" not in context.mode:
-        # It's nice to have bookmark position update interactively
-        # However, this still can be slow if there are many
-        # selected objects
-        
-        # ATTENTION!!!
-        # This eats a lot of processor time!
-        #CursorDynamicSettings.recalc_csu(context, 'PRESS')
-        pass
-    
-    history = settings.history
-    
-    tfm_operator = CursorDynamicSettings.active_transform_operator
-    
-    is_drawing = history.show_trace or tfm_operator
-    
-    if is_drawing:
-        # Store previous OpenGL settings
-        MatrixMode_prev = gl_get(bgl.GL_MATRIX_MODE)
-        ProjMatrix_prev = gl_get(bgl.GL_PROJECTION_MATRIX)
-        lineWidth_prev = gl_get(bgl.GL_LINE_WIDTH)
-        blend_prev = gl_get(bgl.GL_BLEND)
-        line_stipple_prev = gl_get(bgl.GL_LINE_STIPPLE)
-        color_prev = gl_get(bgl.GL_COLOR)
-        smooth_prev = gl_get(bgl.GL_SMOOTH)
-        depth_test_prev = gl_get(bgl.GL_DEPTH_TEST)
-        depth_mask_prev = gl_get(bgl.GL_DEPTH_WRITEMASK)
-    
-    if history.show_trace:
-        bgl.glDepthRange(0.0, 0.9999)
-        
-        history.draw_trace(context)
-        
-        library = settings.libraries.get_item()
-        if library and library.offset:
-            history.draw_offset(context)
-        
-        bgl.glDepthRange(0.0, 1.0)
-    
-    if tfm_operator:
-        tfm_operator.draw_3d(context)
-    
-    if is_drawing:
-        # Restore previous OpenGL settings
-        bgl.glLineWidth(lineWidth_prev)
-        gl_enable(bgl.GL_BLEND, blend_prev)
-        gl_enable(bgl.GL_LINE_STIPPLE, line_stipple_prev)
-        gl_enable(bgl.GL_SMOOTH, smooth_prev)
-        gl_enable(bgl.GL_DEPTH_TEST, depth_test_prev)
-        bgl.glDepthMask(depth_mask_prev)
-        bgl.glColor4f(color_prev[0],
-            color_prev[1],
-            color_prev[2],
-            color_prev[3])
-    
-    cursor_save_location = Vector(bpy.context.space_data.cursor_location)
-    if not settings.cursor_visible:
-        # This is causing problems! See <http://projects.blender.org/
-        # tracker/index.php?func=detail&aid=33197&group_id=9&atid=498>
-        #bpy.context.space_data.cursor_location = Vector([float('nan')] * 3)
-        pass
-
-def draw_callback_header_px(self, context):
-    r = context.region
-    
-    tfm_operator = CursorDynamicSettings.active_transform_operator
-    if not tfm_operator:
-        return
-    
-    smooth_prev = gl_get(bgl.GL_SMOOTH)
-    
-    tfm_operator.draw_axes_coords(context, (r.width, r.height))
-    
-    gl_enable(bgl.GL_SMOOTH, smooth_prev)
-    
-    bgl.glDisable(bgl.GL_BLEND)
-    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-
-def draw_callback_px(self, context):
-    global cursor_save_location
-    settings = find_settings()
-    if settings is None:
-        return
-    library = settings.libraries.get_item()
-    
-    if not settings.cursor_visible:
-        bpy.context.space_data.cursor_location = cursor_save_location
-    
-    tfm_operator = CursorDynamicSettings.active_transform_operator
-    
-    if settings.show_bookmarks and library:
-        library.draw_bookmark(context)
-    
-    if tfm_operator:
-        tfm_operator.draw_2d(context)
-    
-    # restore opengl defaults
-    bgl.glLineWidth(1)
-    bgl.glDisable(bgl.GL_BLEND)
-    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
-
-
-# ===== UTILITY FUNCTIONS ===== #
-
-def update_stick_to_obj(context):
-    settings = find_settings()
-    
-    if not settings.stick_to_obj:
-        return
-    
-    scene = context.scene
-    
-    settings_scene = scene.cursor_3d_tools_settings
-    
-    name = settings_scene.stick_obj_name
-    
-    try:
-        obj = scene.objects[name]
-        pos = settings_scene.stick_obj_pos
-        pos = obj.matrix_world * pos
-        context.space_data.cursor_location = pos
-    except Exception as e:
-        pass
-
-def get_cursor_location(v3d=None, scene=None):
-    if v3d:
-        pos = v3d.cursor_location
-    elif scene:
-        pos = scene.cursor_location
-    
-    return pos.copy()
-
-def set_cursor_location(pos, v3d=None, scene=None):
-    pos = pos.to_3d().copy()
-    
-    if v3d:
-        scene = bpy.context.scene
-        # Accessing scene.cursor_location is SLOW
-        # (well, at least assigning to it).
-        # Accessing v3d.cursor_location is fast.
-        v3d.cursor_location = pos
-    elif scene:
-        scene.cursor_location = pos
-    
-    set_stick_obj(scene, None)
-
-def set_stick_obj(scene, name=None, pos=None):
-    settings_scene = scene.cursor_3d_tools_settings
-    
-    if name:
-        settings_scene.stick_obj_name = name
-    else:
-        settings_scene.stick_obj_name = ""
-    
-    if pos is not None:
-        settings_scene.stick_obj_pos = Vector(pos).to_3d()
-
-# WHERE TO STORE SETTINGS:
-# Currently there are two types of ID blocks
-# which properties don't change on Undo/Redo.
-# - WindowManager seems to be unique (at least
-#   for majority of situations). However, the
-#   properties stored in it are not saved
-#   with the blend.
-# - Screen. Properties are saved with blend,
-#   but there is some probability that any of
-#   the pre-chosen screen names may not exist
-#   in the user's blend.
-
-def find_settings():
-    #wm = bpy.data.window_managers[0]
-    #settings = wm.cursor_3d_tools_settings
-    
-    screen = bpy.data.screens.get("Default", bpy.data.screens[0])
-    try:
-        settings = screen.cursor_3d_tools_settings
-    except:
-        # addon was unregistered
-        settings = None
-    
-    return settings
-
-def find_runtime_settings():
-    wm = bpy.data.window_managers[0]
-    try:
-        runtime_settings = wm.cursor_3d_runtime_settings
-    except:
-        # addon was unregistered
-        runtime_settings = None
-    
-    return runtime_settings
-
-# ===== REGISTRATION ===== #
-def find_keymap_items(km, idname):
-    items = []
-    for kmi in km.keymap_items:
-        if kmi.idname == idname:
-            items.append(kmi)
-    return items
-
-def update_keymap(activate):
-    #if activate:
-    #    if bpy.ops.view3d.cursor3d_monitor.poll():
-    #        bpy.ops.view3d.cursor3d_monitor()
-    
-    wm = bpy.context.window_manager
-    
-    try:
-        km = wm.keyconfigs.user.keymaps['3D View']
-    except:
-        # wm.keyconfigs.user is empty on Blender startup!
-        if activate:
-            # activate temporary operator
-            km = wm.keyconfigs.active.keymaps['Window']
-            kmi = km.keymap_items.new( \
-                'wm.enhanced_3d_cursor_registration', \
-                'MOUSEMOVE', 'ANY')
-        return
-    
-    # We need for the enhanced operator to take precedence over
-    # the default cursor3d, but not over the manipulator.
-    # If we add the operator to "addon" keymaps, it will
-    # take precedence over both. If we add it to "user"
-    # keymaps, the default will take precedence.
-    # However, we may just simply turn it off or remove
-    # (depending on what saves with blend).
-    
-    items = find_keymap_items(km, 'view3d.cursor3d_enhanced')
-    if activate and (len(items) == 0):
-        kmi = km.keymap_items.new('view3d.cursor3d_enhanced', \
-            'ACTIONMOUSE', 'PRESS')
-        for key in EnhancedSetCursor.key_map["free_mouse"]:
-            kmi = km.keymap_items.new('view3d.cursor3d_enhanced', \
-                key, 'PRESS')
-    else:
-        if activate:
-            for kmi in items:
-                kmi.active = activate
-        else:
-            for kmi in items:
-                km.keymap_items.remove(kmi)
-    
-    for kmi in find_keymap_items(km, 'view3d.cursor3d'):
-        kmi.active = not activate
-    
-    try:
-        km = wm.keyconfigs.active.keymaps['3D View']
-        for kmi in find_keymap_items(km, 'view3d.cursor3d'):
-            kmi.active = not activate
-    except KeyError:
-        # seems like in recent builds (after 2.63a)
-        # 'bpy_prop_collection[key]: key "3D View" not found'
-        pass
-    
-    try:
-        km = wm.keyconfigs.default.keymaps['3D View']
-        for kmi in find_keymap_items(km, 'view3d.cursor3d'):
-            kmi.active = not activate
-    except KeyError:
-        pass
-
-def register():
-    bpy.utils.register_class(AlignOrientationProperties)
-    bpy.utils.register_class(AlignOrientation)
-    bpy.utils.register_class(CopyOrientation)
-    bpy.types.WindowManager.align_orientation_properties = \
-        bpy.props.PointerProperty(type=AlignOrientationProperties)
-    bpy.types.VIEW3D_PT_transform_orientations.append(
-        transform_orientations_panel_extension)
-    
-    bpy.utils.register_class(SetCursorDialog)
-    
-    bpy.utils.register_class(NewCursor3DBookmarkLibrary)
-    bpy.utils.register_class(DeleteCursor3DBookmarkLibrary)
-    
-    bpy.utils.register_class(NewCursor3DBookmark)
-    bpy.utils.register_class(DeleteCursor3DBookmark)
-    bpy.utils.register_class(OverwriteCursor3DBookmark)
-    bpy.utils.register_class(RecallCursor3DBookmark)
-    bpy.utils.register_class(SwapCursor3DBookmark)
-    bpy.utils.register_class(SnapSelectionToCursor3DBookmark)
-    bpy.utils.register_class(AddEmptyAtCursor3DBookmark)
-    
-    bpy.utils.register_class(TransformExtraOptionsProp)
-    bpy.utils.register_class(TransformExtraOptions)
-    
-    # View properties panel is already long. Appending something
-    # to it would make it too inconvenient
-    #bpy.types.VIEW3D_PT_view3d_properties.append(draw_cursor_tools)
-    bpy.utils.register_class(Cursor3DTools)
-    
-    bpy.utils.register_class(LocationProp)
-    bpy.utils.register_class(CursorHistoryProp)
-    
-    bpy.utils.register_class(BookmarkProp)
-    bpy.utils.register_class(BookmarkIDBlock)
-    
-    bpy.utils.register_class(BookmarkLibraryProp)
-    bpy.utils.register_class(BookmarkLibraryIDBlock)
-    
-    bpy.utils.register_class(Cursor3DToolsSettings)
-    
-    bpy.utils.register_class(CursorRuntimeSettings)
-    bpy.utils.register_class(CursorMonitor)
-    
-    bpy.utils.register_class(Cursor3DToolsSceneSettings)
-    
-    bpy.types.Screen.cursor_3d_tools_settings = \
-        bpy.props.PointerProperty(type=Cursor3DToolsSettings)
-    
-    bpy.types.WindowManager.cursor_3d_runtime_settings = \
-        bpy.props.PointerProperty(type=CursorRuntimeSettings)
-    
-    bpy.types.Scene.cursor_3d_tools_settings = \
-        bpy.props.PointerProperty(type=Cursor3DToolsSceneSettings)
-    
-    bpy.utils.register_class(EnhancedSetCursor)
-    
-    bpy.utils.register_class(DelayRegistrationOperator)
-    
-    update_keymap(True)
-
-def unregister():
-    # Manually set this to False on unregister
-    CursorMonitor.is_running = False
-    
-    update_keymap(False)
-    
-    bpy.utils.unregister_class(DelayRegistrationOperator)
-    
-    bpy.utils.unregister_class(EnhancedSetCursor)
-    
-    if hasattr(bpy.types.Scene, "cursor_3d_tools_settings"):
-        del bpy.types.Scene.cursor_3d_tools_settings
-    
-    if hasattr(bpy.types.WindowManager, "cursor_3d_runtime_settings"):
-        del bpy.types.WindowManager.cursor_3d_runtime_settings
-    
-    if hasattr(bpy.types.Screen, "cursor_3d_tools_settings"):
-        del bpy.types.Screen.cursor_3d_tools_settings
-    
-    bpy.utils.unregister_class(Cursor3DToolsSceneSettings)
-    
-    bpy.utils.unregister_class(CursorMonitor)
-    bpy.utils.unregister_class(CursorRuntimeSettings)
-    
-    bpy.utils.unregister_class(Cursor3DToolsSettings)
-    
-    bpy.utils.unregister_class(BookmarkLibraryIDBlock)
-    bpy.utils.unregister_class(BookmarkLibraryProp)
-    
-    bpy.utils.unregister_class(BookmarkIDBlock)
-    bpy.utils.unregister_class(BookmarkProp)
-    
-    bpy.utils.unregister_class(CursorHistoryProp)
-    bpy.utils.unregister_class(LocationProp)
-    
-    bpy.utils.unregister_class(Cursor3DTools)
-    #bpy.types.VIEW3D_PT_view3d_properties.remove(draw_cursor_tools)
-    
-    bpy.utils.unregister_class(TransformExtraOptions)
-    bpy.utils.unregister_class(TransformExtraOptionsProp)
-    
-    bpy.utils.unregister_class(NewCursor3DBookmarkLibrary)
-    bpy.utils.unregister_class(DeleteCursor3DBookmarkLibrary)
-    
-    bpy.utils.unregister_class(NewCursor3DBookmark)
-    bpy.utils.unregister_class(DeleteCursor3DBookmark)
-    bpy.utils.unregister_class(OverwriteCursor3DBookmark)
-    bpy.utils.unregister_class(RecallCursor3DBookmark)
-    bpy.utils.unregister_class(SwapCursor3DBookmark)
-    bpy.utils.unregister_class(SnapSelectionToCursor3DBookmark)
-    bpy.utils.unregister_class(AddEmptyAtCursor3DBookmark)
-    
-    bpy.utils.unregister_class(SetCursorDialog)
-    
-    bpy.types.VIEW3D_PT_transform_orientations.remove(
-        transform_orientations_panel_extension)
-    del bpy.types.WindowManager.align_orientation_properties
-    bpy.utils.unregister_class(CopyOrientation)
-    bpy.utils.unregister_class(AlignOrientation)
-    bpy.utils.unregister_class(AlignOrientationProperties)
-
-class DelayRegistrationOperator(bpy.types.Operator):
-    bl_idname = "wm.enhanced_3d_cursor_registration"
-    bl_label = "[Enhanced 3D Cursor] registration delayer"
-    
-    _timer = None
-    
-    def modal(self, context, event):
-        if (not self.keymap_updated) and \
-            ((event.type == 'TIMER') or ("MOVE" in event.type)):
-            # clean up (we don't need this operator to run anymore)
-            wm = bpy.context.window_manager
-            
-            for kcfg in wm.keyconfigs.values():
-                for km in kcfg.keymaps.values():
-                    items = find_keymap_items(km,
-                        'wm.enhanced_3d_cursor_registration')
-                    for kmi in items:
-                        km.keymap_items.remove(kmi)
-            
-            """
-            try:
-                # A bug when using Maya keymap presets
-                # (reported by chafouin in BlenderArtists thread)
-                # KeyError: key "Window" not found'
-                # Circumvent for now.
-                km = wm.keyconfigs.active.keymaps['Window']
-            except KeyError:
-                km = None
-            
-            if km:
-                items = find_keymap_items(km,
-                    'wm.enhanced_3d_cursor_registration')
-                for kmi in items:
-                    km.keymap_items.remove(kmi)
-            """
-            
-            update_keymap(True)
-            
-            self.keymap_updated = True
-            
-            # No, better don't (at least in current version),
-            # since the monitor has dependencies on View3D context.
-            # Attempt to launch the monitor
-            #if bpy.ops.view3d.cursor3d_monitor.poll():
-            #    bpy.ops.view3d.cursor3d_monitor()
-            
-            return self.cancel(context)
-        
-        return {'PASS_THROUGH'}
-    
-    def execute(self, context):
-        self.keymap_updated = False
-
-        self._timer = context.window_manager.\
-            event_timer_add(0.1, context.window)
-
-        context.window_manager.modal_handler_add(self)        
-        return {'RUNNING_MODAL'}
-    
-    def cancel(self, context):
-        context.window_manager.event_timer_remove(self._timer)
-        
-        return {'CANCELLED'}
-
-if __name__ == "__main__":
-    # launched from the Blender text editor
-    try:
-        register()
-    except Exception as e:
-        print(e)
-        raise
diff --git a/release/scripts/addons_contrib/space_view3d_game_props_visualiser.py b/release/scripts/addons_contrib/space_view3d_game_props_visualiser.py
deleted file mode 100644
index fe169c4..0000000
--- a/release/scripts/addons_contrib/space_view3d_game_props_visualiser.py
+++ /dev/null
@@ -1,198 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-
-bl_info = {
-    "name": "Game Property Visualizer",
-    "author": "Bartius Crouch/Vilem Novak",
-    "version": (2,5),
-    "blender": (2, 53, 0),
-    "location": "View3D > Properties panel > Display tab",
-    "description": "Display the game properties next to selected objects "
-                   "in the 3d-view",
-    "warning": "Script is returning errors",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/Game_Property_Visualiser",
-    "tracker_url": "http://projects.blender.org/tracker/?func=detail&aid=22607&group_id=153&atid=468",
-    "category": "3D View"}
-
-"""
-Displays game properties next to selected objects(under name)
-
-How to use:
-    just toggle the button 'Visualize game props' in the right side panel
-"""
-
-import bgl
-import blf
-import bpy
-import mathutils
-
-
-# calculate locations and store them as ID property in the mesh
-def calc_callback(self, context):
-    # polling
-    if context.mode == 'EDIT_MESH':
-        return
-    
-    # get screen information
-    mid_x = context.region.width/2.0
-    mid_y = context.region.height/2.0
-    width = context.region.width
-    height = context.region.height
-    
-    # get matrices
-    view_mat = context.space_data.region_3d.perspective_matrix
-
-    ob_mat = context.active_object.matrix_world
-    total_mat = view_mat*ob_mat
-    
-    # calculate location info
-    texts = []
-    
-    # uncomment 2 lines below, to enable live updating of the selection
-    #ob=context.active_object
-    for ob in context.selected_objects:
-        locs = []
-        ob_mat = ob.matrix_world
-        total_mat = view_mat*ob_mat
- 
-        for p in ob.game.properties:
-            # d = {'data':p.name+':'+str(p.value)}
-            # print (d)
-            locs.append([ mathutils.Vector([0,0,0]).resize_4d()])
-    
-    
-        for loc in locs:
-    
-            vec = loc[0]*total_mat # order is important
-            # dehomogenise
-            vec = mathutils.Vector((vec[0]/vec[3],vec[1]/vec[3],vec[2]/vec[3]))
-            x = int(mid_x + vec[0]*width/2.0)
-            y = int(mid_y + vec[1]*height/2.0)
-            texts+=[x, y]
-        
-
-    # store as ID property in mesh
-    #print (texts)
-    context.scene['GamePropsVisualizer'] = texts
-
-
-# draw in 3d-view
-def draw_callback(self, context):
-    # polling
-    if context.mode == 'EDIT_MESH':
-        return
-    # retrieving ID property data
-    try:
-        #print(context.scene['GamePropsVisualizer'])
-        texts = context.scene['GamePropsVisualizer']
-        
-    except:
-        return
-    if not texts:
-        return
-    
-    # draw
-    i=0
-
-    blf.size(0, 12, 72)
-   
-        
-    bgl.glColor3f(1.0,1.0,1.0)
-    for ob in bpy.context.selected_objects:
-        for pi,p in enumerate(ob.game.properties):
-            blf.position(0, texts[i], texts[i+1]-(pi+1)*14, 0)
-            if p.type=='FLOAT':
-                t=p.name+':  '+ str('%g'% p.value)
-            else:    
-                t=p.name+':  '+ str(p.value)
-            blf.draw(0, t)
-            i+=2
-
-
-# operator
-class GamePropertyVisualizer(bpy.types.Operator):
-    bl_idname = "view3d.game_props_visualizer"
-    bl_label = "Game Properties Visualizer"
-    bl_description = "Toggle the visualization of game properties"
-    
-    @classmethod
-    def poll(cls, context):
-        return context.mode!='EDIT_MESH'
-    
-    def modal(self, context, event):
-        context.area.tag_redraw()
-
-        # removal of callbacks when operator is called again
-        #print(context.scene.display_game_properties)
-        if context.scene.display_game_properties == -1:
-           # print('deinit2')
-
-            context.scene.display_game_properties = 0
-            context.region.callback_remove(self.handle1)
-            context.region.callback_remove(self.handle2)
-            context.scene.display_game_properties = 0
-            
-            return {'FINISHED'}
-        
-        return {'PASS_THROUGH'}
-    
-    def invoke(self, context, event):
-        if context.area.type == 'VIEW_3D':
-            print(context.scene.display_game_properties)
-            if context.scene.display_game_properties == 0 or context.scene.display_game_properties == -1:
-                print('init')
-                # operator is called for the first time, start everything
-                context.scene.display_game_properties = 1
-                self.handle1 = context.region.callback_add(calc_callback,
-                    (self, context), 'POST_VIEW')
-                self.handle2 = context.region.callback_add(draw_callback,
-                    (self, context), 'POST_PIXEL')
-
-                context.window_manager.modal_handler_add(self)
-                return {'RUNNING_MODAL'}
-            else:
-                # operator is called again, stop displaying
-                context.scene.display_game_properties = -1
-                #print(dir(self))
-                #
-                return {'RUNNING_MODAL'}
-        else:
-            self.report({'WARNING'}, "View3D not found, can't run operator")
-            return {'CANCELLED'}
-
-
-# defining the panel
-def menu_func(self, context):
-    col = self.layout.column(align=True)
-    col.operator(GamePropertyVisualizer.bl_idname, text="Visualize game props")
-    self.layout.separator()
-
-
-def register():
-    bpy.types.Scene.display_game_properties = bpy.props.IntProperty(name='Visualize Game Poperties')
-    bpy.types.VIEW3D_PT_view3d_display.prepend(menu_func)
-
-def unregister():
-    del bpy.types.Scene.display_game_properties
-    bpy.types.VIEW3D_PT_view3d_display.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/space_view3d_library_hide.py b/release/scripts/addons_contrib/space_view3d_library_hide.py
deleted file mode 100644
index 0633e3f..0000000
--- a/release/scripts/addons_contrib/space_view3d_library_hide.py
+++ /dev/null
@@ -1,254 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-# Script copyright (C) Campbell Barton
-
-bl_info = {
-    "name": "Library Hide",
-    "description": "Hide objects within library dupligroups",
-    "author": "Campbell Barton",
-    "version": (1, 0),
-    "blender": (2, 63, 0),
-    'location': 'Search: RayCast View Operator',
-    "wiki_url": "",
-    "tracker_url":"",
-    "category": "3D View",
-}
-
-import bpy
-from mathutils import Vector
-from bpy_extras import view3d_utils
-
-LIB_HIDE_TEXT_ID = "blender_hide_objects.py"
-
-LIB_HIDE_TEXT_HEADER = """
-import bpy
-print("running: %r" % __file__)
-def hide(name, lib):
-    obj = bpy.data.objects.get((name, lib))
-    if obj is None:
-        print("hide can't find: %r %r" % (name, lib))
-    else:
-        obj.hide = obj.hide_render = True
-
-"""
-
-def pick_object(context, event, pick_objects, ray_max=10000.0):
-    """Run this function on left mouse, execute the ray cast"""
-    # get the context arguments
-    scene = context.scene
-    region = context.region
-    rv3d = context.region_data
-    coord = event.mouse_region_x, event.mouse_region_y
-
-    # get the ray from the viewport and mouse
-    view_vector = view3d_utils.region_2d_to_vector_3d(region, rv3d, coord)
-    ray_origin = view3d_utils.region_2d_to_origin_3d(region, rv3d, coord)
-    ray_target = ray_origin + (view_vector * ray_max)
-
-    scene.cursor_location = ray_target
-
-    def visible_objects_and_duplis():
-        """Loop over (object, matrix) pairs (mesh only)"""
-
-        for obj in context.visible_objects:  # scene.objects:
-            if obj.hide:
-                continue
-
-            if obj.type == 'MESH':
-                yield (None, obj, obj.matrix_world.copy())
-
-            if obj.dupli_type != 'NONE':
-                print("DupliInst: %r" % obj)
-                obj.dupli_list_create(scene)
-                # matrix = obj.matrix_world.copy()
-                for dob in obj.dupli_list:
-                    obj_dupli = dob.object
-                    if not obj_dupli.hide:
-                        # print("Dupli: %r" % obj_dupli)
-                        if obj_dupli.type == 'MESH':
-                            yield (obj, obj_dupli, dob.matrix.copy())
-
-                obj.dupli_list_clear()
-
-    def obj_ray_cast(obj, matrix):
-        """Wrapper for ray casting that moves the ray into object space"""
-
-        # get the ray relative to the object
-        matrix_inv = matrix.inverted()
-        ray_origin_obj = matrix_inv * ray_origin
-        ray_target_obj = matrix_inv * ray_target
-
-        mesh = obj.data
-        if not mesh.polygons:
-            return None, None, None
-
-        hit, normal, face_index = obj.ray_cast(ray_origin_obj, ray_target_obj)
-
-        if face_index == -1:
-            hit, normal, face_index = obj.ray_cast(ray_target_obj, ray_origin_obj)
-
-        if face_index != -1:
-            return hit, normal, face_index
-        else:
-            return None, None, None
-
-    # cast rays and find the closest object
-    best_length_squared = ray_max * ray_max
-    best_obj = None
-    best_obj_parent = None
-
-    for obj_parent, obj, matrix in visible_objects_and_duplis():
-        if obj.type == 'MESH':
-            hit, normal, face_index = obj_ray_cast(obj, matrix)
-            if hit is not None:
-                length_squared = (hit - ray_origin).length_squared
-                if length_squared < best_length_squared:
-                    best_length_squared = length_squared
-                    best_obj = obj
-                    best_obj_parent = obj_parent
-
-    # now we have the object under the mouse cursor,
-    # we could do lots of stuff but for the example just select.
-    if best_obj is not None:
-        pick_objects.append((best_obj, best_obj.hide, best_obj.hide_render))
-        best_obj.hide = True
-        best_obj.hide_render = True
-        
-        #if best_obj_parent:
-        #    best_obj_parent.update_tag(refresh={'OBJECT'})
-        #scene.update()
-        return True
-    else:
-        print("found none")
-        return False
-
-
-def pick_finalize(context, pick_objects):
-    text = bpy.data.texts.get((LIB_HIDE_TEXT_ID, None))
-    if text is None:
-        text = bpy.data.texts.new(LIB_HIDE_TEXT_ID)
-        text.use_module = True
-        is_new = True
-    else:
-        is_new = False
-
-    if is_new:
-        data = []
-        
-        data += LIB_HIDE_TEXT_HEADER.split("\n")
-    else:
-        data = text.as_string().split("\n")
-
-    data.append("# ---")
-    
-    for pick_obj_tuple in pick_objects:
-        
-        pick_obj = pick_obj_tuple[0]
-        
-        pick_obj.hide = True
-        pick_obj.hide_render = True
-
-        line = "hide(%r, %s)" % (pick_obj.name, repr(pick_obj.library.filepath) if pick_obj.library is not None else "None")
-        data.append(line)
-    
-    text.from_string("\n".join(data))
-
-
-def pick_restore(pick_obj):
-    best_obj, hide, hide_render = pick_obj
-    best_obj.hide = hide
-    best_obj.hide_render = hide_render
-
-
-class ViewOperatorRayCast(bpy.types.Operator):
-    """Modal object selection with a ray cast"""
-    bl_idname = "view3d.modal_operator_raycast"
-    bl_label = "RayCast View Operator"
-
-    _header_text = "Add: LMB, Undo: BackSpace, Finish: Enter"
-
-    def _update_header(self, context):
-        if self.pick_objects:
-            pick_obj = self.pick_objects[-1][0]
-            info_obj = "%s, %s" % (pick_obj.name, pick_obj.library.filepath if pick_obj.library is not None else "None")
-            info = "%s - added: %s" % (ViewOperatorRayCast._header_text, info_obj)
-        else:
-            info = ViewOperatorRayCast._header_text
-
-        context.area.header_text_set(info)
-
-    def modal(self, context, event):
-        if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:
-            # allow navigation
-            return {'PASS_THROUGH'}
-        elif event.type == 'LEFTMOUSE':
-            if event.value == 'RELEASE':
-                if pick_object(context, event, self.pick_objects):
-                    self._update_header(context)
-                return {'RUNNING_MODAL'}
-        elif event.type == 'BACK_SPACE':
-            if event.value == 'RELEASE':
-                if self.pick_objects:
-                    pick_obj = self.pick_objects.pop()
-                    pick_restore(pick_obj)
-                    self._update_header(context)
-
-        elif event.type in {'RET', 'NUMPAD_ENTER'}:
-            if event.value == 'RELEASE':
-                if self.pick_objects:  # avoid enter taking effect on startup
-                    pick_finalize(context, self.pick_objects)
-                    context.area.header_text_set()
-                    self.report({'INFO'}, "Finished")
-                    return {'FINISHED'}
-                
-        elif event.type in {'RIGHTMOUSE', 'ESC'}:
-            if event.value == 'RELEASE':
-                for pick_obj in self.pick_objects:
-                    pick_restore(pick_obj)
-                context.area.header_text_set()
-                self.report({'INFO'}, "Cancelled")
-                return {'CANCELLED'}
-
-        return {'RUNNING_MODAL'}
-
-    def invoke(self, context, event):
-        if context.space_data.type == 'VIEW_3D':
-            
-            self.pick_objects = []
-            self._update_header(context)
-
-            context.window_manager.modal_handler_add(self)
-            return {'RUNNING_MODAL'}
-        else:
-            self.report({'WARNING'}, "Active space must be a View3d")
-            return {'CANCELLED'}
-
-
-def register():
-    bpy.utils.register_class(ViewOperatorRayCast)
-
-
-def unregister():
-    bpy.utils.unregister_class(ViewOperatorRayCast)
-
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/space_view3d_manipulator_Menu.py b/release/scripts/addons_contrib/space_view3d_manipulator_Menu.py
deleted file mode 100644
index d6dabf9..0000000
--- a/release/scripts/addons_contrib/space_view3d_manipulator_Menu.py
+++ /dev/null
@@ -1,109 +0,0 @@
-#re creating the functionality of the manipulator menu from 2.49
-
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-bl_info = {
-    "name": "3d View: Manipulator Menu",
-    "author": "MichaelW",
-    "version": (1, 2 ,1),
-    "blender": (2, 61, 0),
-    "location": "View3D > Ctrl Space ",
-    "description": "Menu to change the manipulator type and/or disable it",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/3D_interaction/Manipulator_Menu",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"
-                   "func=detail&aid=22092",
-    "category": "3D View"}
-
-
-import bpy
-
-def main(context):
-    bpy.context.space_data.manipulator = False
-
-#class VIEW3D_OT_disable_manipulator(bpy.types.Operator):
-#    """"""
-#    bl_idname = "VIEW3D_OT_disable_manipulator"
-#    bl_label = "disable manipulator"
-#
-#    def poll(self, context):
-#        return context.active_object != None
-#
-#    def execute(self, context):
-#        main(context)
-#        return {'FINISHED'}
-#
-
-
-class VIEW3D_MT_ManipulatorMenu(bpy.types.Menu):
-    bl_label = "ManipulatorType"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-
-        props = layout.operator("view3d.enable_manipulator",text ='Translate', icon='MAN_TRANS')
-        props.translate = True
-
-        props = layout.operator("view3d.enable_manipulator",text ='Rotate', icon='MAN_ROT')
-        props.rotate = True
-
-        props = layout.operator("view3d.enable_manipulator",text ='Scale', icon='MAN_SCALE')
-        props.scale = True
-        layout.separator()
-
-        props = layout.operator("view3d.enable_manipulator",text ='Combo', icon='MAN_SCALE')
-        props.scale = True
-        props.rotate = True
-        props.translate = True
-
-        layout.separator()
-
-        props = layout.operator("view3d.enable_manipulator",text ='Hide', icon='MAN_SCALE')
-        props.scale = False
-        props.rotate = False
-        props.translate = False
-        
-        layout.separator()
-
-
-            
-def register():
-    bpy.utils.register_module(__name__)
-
-    wm = bpy.context.window_manager
-    km = wm.keyconfigs.addon.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
-    kmi = km.keymap_items.new('wm.call_menu', 'SPACE', 'PRESS', ctrl=True)
-    kmi.properties.name = "VIEW3D_MT_ManipulatorMenu"
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    wm = bpy.context.window_manager
-    km = wm.keyconfigs.addon.keymaps['3D View Generic']
-    for kmi in km.keymap_items:
-        if kmi.idname == 'wm.call_menu':
-            if kmi.properties.name == "VIEW3D_MT_ManipulatorMenu":
-                km.keymap_items.remove(kmi)
-                break
-
-if __name__ == "__main__":
-    register
diff --git a/release/scripts/addons_contrib/space_view3d_multiselect_menu.py b/release/scripts/addons_contrib/space_view3d_multiselect_menu.py
deleted file mode 100644
index 2702c93..0000000
--- a/release/scripts/addons_contrib/space_view3d_multiselect_menu.py
+++ /dev/null
@@ -1,121 +0,0 @@
-#view3d_multiselect_menu.py (c) 2011 Sean Olson (liquidApe)
-#Original Script by: Mariano Hidalgo (uselessdreamer)
-#contributed to by: Crouch, sim88, sam, meta-androcto, and Michael W
-#
-#Tested with r37702
-#
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "3D View: Multiselect Menu",
-    "author": "Sean Olson (liquidApe)",
-    "version": (1, 2),
-    "blender": (2, 61, 0),
-    "location": "View3D > Mouse > Menu ",
-    "warning":"",
-    "description": "Added options for multiselect to the ctrl-tab menu",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/3D_interaction/multiselect_Menu",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"
-                   "func=detail&aid=22132",
-    "category": "3D View"}
-
-import bpy
-
-# multiselect menu
-class VIEW3D_MT_Multiselect_Menu(bpy.types.Menu):
-    bl_label = "MultiSelect Menu"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-
-        layout.separator()
-        prop = layout.operator("wm.context_set_value", text="Vertex Select",
-            icon='VERTEXSEL')
-        prop.value = "(True, False, False)"
-        prop.data_path = "tool_settings.mesh_select_mode"
-
-        prop = layout.operator("wm.context_set_value", text="Edge Select",
-            icon='EDGESEL')
-        prop.value = "(False, True, False)"
-        prop.data_path = "tool_settings.mesh_select_mode"
-
-        prop = layout.operator("wm.context_set_value", text="Face Select",
-            icon='FACESEL')
-        prop.value = "(False, False, True)"
-        prop.data_path = "tool_settings.mesh_select_mode"
-        layout.separator()
-
-        prop = layout.operator("wm.context_set_value",
-            text="Vertex & Edge Select", icon='EDITMODE_HLT')
-        prop.value = "(True, True, False)"
-        prop.data_path = "tool_settings.mesh_select_mode"
-
-        prop = layout.operator("wm.context_set_value",
-            text="Vertex & Face Select", icon='ORTHO')
-        prop.value = "(True, False, True)"
-        prop.data_path = "tool_settings.mesh_select_mode"
-
-        prop = layout.operator("wm.context_set_value",
-            text="Edge & Face Select", icon='SNAP_FACE')
-        prop.value = "(False, True, True)"
-        prop.data_path = "tool_settings.mesh_select_mode"
-        layout.separator()
-
-        prop = layout.operator("wm.context_set_value",
-            text="Vertex & Edge & Face Select", icon='SNAP_VOLUME')
-        prop.value = "(True, True, True)"
-        prop.data_path = "tool_settings.mesh_select_mode"
-        layout.separator()
-
-def register():
-    bpy.utils.register_module(__name__)
-    
-    #add multiselect keybinding
-    km = bpy.context.window_manager.keyconfigs.active.keymaps['Mesh']
-    kmi = km.keymap_items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True)
-    kmi.properties.name = "VIEW3D_MT_Multiselect_Menu"
-
-    #remove default keybinding
-    km = bpy.context.window_manager.keyconfigs.active.keymaps['Mesh']
-    for kmi in km.keymap_items:
-        if kmi.idname == 'wm.call_menu':
-            if kmi.properties.name == "VIEW3D_MT_edit_mesh_select_mode":
-                km.keymap_items.remove(kmi)
-                break
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    #remove multiselect keybinding
-    km = bpy.context.window_manager.keyconfigs.active.keymaps['Mesh']
-    for kmi in km.keymap_items:
-        if kmi.idname == 'wm.call_menu':
-            if kmi.properties.name == "VIEW3D_MT_Multiselect_Menu":
-                km.keymap_items.remove(kmi)
-                break
-
-    #replace default keymap
-    km = bpy.context.window_manager.keyconfigs.active.keymaps['Mesh']
-    kmi = km.keymap_items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True)
-    kmi.properties.name = "VIEW3D_MT_edit_mesh_select_mode"
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/space_view3d_objects_panel.py b/release/scripts/addons_contrib/space_view3d_objects_panel.py
deleted file mode 100644
index 622f3a9..0000000
--- a/release/scripts/addons_contrib/space_view3d_objects_panel.py
+++ /dev/null
@@ -1,75 +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 #####
-
-bl_info = {
-    "name": "Add Objects Panel",
-    "author": "Murat Egretli (Demohero)",
-    "version": (1,2),
-    "blender": (2, 61, 0),
-    "location": "View3D > Toolbar",
-    "description": "add objects(mesh, curve etc.) from Toolbar",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=22154",
-    "category": "3D View"}
-
-
-import bpy
-
-
-class View3DPanel():
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    
-
-class VIEW3D_PT_add_menu(View3DPanel,bpy.types.Panel):
-    bl_context = "objectmode"
-    bl_label = "Add Objects"
-    bl_options = {"DEFAULT_CLOSED"}
-    
-    def draw(self, context):
-        layout = self.layout
-
-        layout.menu("INFO_MT_mesh_add", text="Mesh", icon='OUTLINER_OB_MESH')
-        layout.menu("INFO_MT_curve_add", text="Curve", icon='OUTLINER_OB_CURVE')
-        layout.menu("INFO_MT_surface_add", text="Surface", icon='OUTLINER_OB_SURFACE')
-        layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
-        layout.menu("INFO_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
-        layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
-        layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY')
-        layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
-        layout.operator("object.add", text="Empty", icon='OUTLINER_OB_EMPTY').type = 'EMPTY'
-        layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
-        layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
-        layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
-      
-# register the class
-def register():
-    bpy.utils.register_module(__name__)
- 
-    pass 
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
- 
-    pass 
-
-if __name__ == "__main__": 
-    register()
diff --git a/release/scripts/addons_contrib/space_view3d_paint_bprojection.py b/release/scripts/addons_contrib/space_view3d_paint_bprojection.py
deleted file mode 100644
index 4ddd7db..0000000
--- a/release/scripts/addons_contrib/space_view3d_paint_bprojection.py
+++ /dev/null
@@ -1,1405 +0,0 @@
-bl_info = {
-    "name": "BProjection",
-    "description": "Help Clone tool",
-    "author": "kgeogeo",
-    "version": (1, 0),
-    "blender": (2, 63, 0),
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/bprojection",
-    "tracker_url":"http://projects.blender.org/tracker/index.php?func=detail&aid=30521&group_id=153&atid=468",
-    "category": "Paint"}
-
-import bpy
-from bpy.app.handlers import persistent
-from bpy.types import Panel, Operator
-from bpy.props import IntProperty, FloatProperty, BoolProperty, IntVectorProperty, StringProperty, FloatVectorProperty, CollectionProperty
-from bpy_extras import view3d_utils
-import math
-from math import *
-import mathutils
-from mathutils import *
-
-BProjection_Empty    = 'Empty for BProjection'
-BProjection_Material = 'Material for BProjection'
-BProjection_Texture  = 'Texture for BProjection'
-
-# Main function for align the plan to view
-def align_to_view(context):
-    ob = context.object
-    em = bpy.data.objects[BProjection_Empty]       
-    rotation = em.custom_rotation
-    scale = em.custom_scale
-    z = em.custom_location.z
-    pos = [em.custom_location.x, em.custom_location.y]
-    
-    reg = context.area.regions[4]        
-    width = reg.width
-    height = reg.height 
-    
-    sd = context.space_data    
-    r3d = sd.region_3d     
-    r3d.update()
-    vr = r3d.view_rotation
-    quat = mathutils.Quaternion((0.0, 0.0, 1.0), math.radians(float(rotation)))
-    v = Vector((pos[0],pos[1],z))
-    v.rotate(vr)
-
-    em = bpy.data.objects[BProjection_Empty]
-    img = bpy.data.textures[BProjection_Texture].image
-    if img and img.size[1] != 0:
-        prop = img.size[0]/img.size[1]
-    else: prop = 1    
-    
-    if em.custom_linkscale:    
-        em.scale = Vector((prop*scale[0], scale[0], 1))
-    else:
-        em.scale = Vector((prop*scale[0], scale[1], 1))
-    pos_cur = em.location - sd.cursor_location
-    rot_cur1 = em.rotation_euler.to_quaternion()
-    em.location = v + ob.location
-    em.rotation_euler = Quaternion.to_euler(vr*quat)   
-    if em.custom_c3d:
-        if em.custom_old_scale != em.custom_scale:
-            pos_cur = em.location - sd.cursor_location       
-        rot_cur2 = em.rotation_euler.to_quaternion()
-        rot_cur1.invert()
-        pos_cur.rotate(rot_cur1)
-        pos_cur.rotate(rot_cur2)
-        v = em.location - pos_cur
-        sd.cursor_location =  v
-
-def applyimage(context):        
-        img = bpy.data.textures[BProjection_Texture].image
-        em = bpy.data.objects[BProjection_Empty]
-        ob = context.object
-               
-        face = ob.data.polygons
-        uvdata = ob.data.uv_textures.active.data 
-            
-        for f,d in zip(face,uvdata):
-            if f.select:
-                d.image = img
-               
-        align_to_view(context)
-        ob.data.update()
-
-# Function to update the properties
-def update_Location(self, context):          
-    align_to_view(context)
-
-def find_uv(context):
-    obj = context.object
-    me = obj.data.vertices
-    vg = obj.vertex_groups
-    l=[]
-    index_uv = 0      
-    for face in obj.data.polygons:
-        x=len(face.vertices)
-        for vertex in face.vertices:
-            if len(me[vertex].groups)>0:
-                for g in me[vertex].groups:
-                    if vg[g.group].name == 'texture plane':
-                        x-=1
-        
-                        
-        if x == 0:
-            l.append([index_uv,len(face.vertices)])
-        index_uv += len(face.vertices)
-    return l
-
-# Function to update the scaleUV
-def update_UVScale(self, context):
-    ob = context.object
-    em = bpy.data.objects[BProjection_Empty]
-    v = Vector((em.custom_offsetuv[0]/10 + 0.5, em.custom_offsetuv[1]/10 + 0.5))
-    l = Vector((0.0,0.0))
-    s = em.custom_scaleuv
-    os = em.custom_old_scaleuv 
-    scale = s - os
-    l = find_uv(context)
-    for i,j in l:
-        for t in range(j):
-            d = context.object.data.uv_layers.active.data[i+t]
-            vres =  v - d.uv  
-            d.uv.x = v.x - vres.x/os[0]*s[0]
-            d.uv.y = v.y - vres.y/os[1]*s[1]
-
-    em.custom_old_scaleuv = s  
-    
-    applyimage(context)
-
-def update_PropUVScale(self, context):
-    em = bpy.data.objects[BProjection_Empty]
-    if em.custom_linkscaleuv:
-        em.custom_scaleuv = [em.custom_propscaleuv,em.custom_propscaleuv]
-
-def update_LinkUVScale(self, context):
-    em = bpy.data.objects[BProjection_Empty]
-    if em.custom_linkscaleuv:
-        em.custom_propscaleuv = em.custom_scaleuv.x
-        update_PropUVScale(self, context)
-    else:
-        update_UVScale(self, context) 
-        
-# Function to update the offsetUV
-def update_UVOffset(self, context):
-    ob = context.object
-    em = bpy.data.objects[BProjection_Empty]
-    o = em.custom_offsetuv
-    oo = em.custom_old_offsetuv 
-    l = find_uv(context)
-    for i,j in l:
-        for t in range(j):
-            d = context.object.data.uv_layers.active.data[i+t]
-            d.uv = [d.uv[0] - oo[0]/10 + o[0]/10, d.uv[1] - oo[1]/10 + o[1]/10]   
-    em.custom_old_offsetuv = o
-    
-    applyimage(context)
-
-# Function to update the flip horizontal
-def update_FlipUVX(self, context):
-    l = find_uv(context)
-    for i,j in l:
-        for t in range(j):
-            d = context.object.data.uv_layers.active.data[i+t]
-            x = d.uv.x
-            d.uv.x = 1 - x
-    
-    applyimage(context)
-
-# Function to update the flip vertical
-def update_FlipUVY(self, context):
-    l = find_uv(context)
-    for i,j in l:
-        for t in range(j):
-            d = context.object.data.uv_layers.active.data[i+t]
-            y = d.uv[1]
-            d.uv[1] = 1 - y
-    
-    applyimage(context)
-
-# Function to update
-def update_Rotation(self, context):              
-    ob = context.object
-    em = bpy.data.objects[BProjection_Empty]
-    if em.custom_rotc3d:
-        angle = em.custom_rotation - em.custom_old_rotation
-        sd = context.space_data
-        vr = sd.region_3d.view_rotation.copy()        
-        c = sd.cursor_location - ob.location
-        e = bpy.data.objects[BProjection_Empty].location - ob.location
-        vo = Vector((0.0, 0.0, 1.0))
-        vo.rotate(vr)
-        quat = mathutils.Quaternion(vo, math.radians(angle))
-        v = e-c
-        v.rotate(quat)
-        vr.invert()
-        v.rotate(vr)
-        c.rotate(vr)
-        em.custom_location = c + v
-    else:        
-        align_to_view(context)
-   
-    em.custom_old_rotation = em.custom_rotation
-
-# Function to update scale
-def update_Scale(self, context):              
-    ob = context.object
-    em = bpy.data.objects[BProjection_Empty]
-    
-    if em.custom_scac3d:
-        sd = context.space_data
-        r3d =  sd.region_3d
-        vr = r3d.view_rotation.copy()
-        vr.invert()
-        e = em.location - ob.location
-        c = sd.cursor_location - ob.location
-        ce = e - c
-        
-        s = em.custom_scale
-        os = em.custom_old_scale
-        c.rotate(vr)
-        ce.rotate(vr)
-        
-        img = bpy.data.textures[BProjection_Texture].image
-        if img and img.size[1] != 0:
-            prop = img.size[0]/img.size[1]
-        else: prop = 1
-        
-        v = Vector((s.x*ce.x/os.x, s.y*ce.y/os.y,0.0))
-        em.custom_location = c + v
-        
-
-    else:          
-        align_to_view(context)
-            
-    
-    em.custom_old_scale = em.custom_scale
-
-def update_PropScale(self, context):
-    em = bpy.data.objects[BProjection_Empty]
-    if em.custom_linkscale:
-        em.custom_scale = [em.custom_propscale,em.custom_propscale]
-    
-def update_LinkScale(self, context):
-    em = bpy.data.objects[BProjection_Empty]
-    if em.custom_linkscale:
-        em.custom_propscale = em.custom_scale.x
-        update_PropScale(self, context)
-    else:
-        update_Scale(self, context) 
-
-def update_activeviewname(self, context):
-    em = bpy.data.objects[BProjection_Empty]
-    if self.custom_active:
-        em.custom_active_view = self.custom_active_view
-
-class custom_props(bpy.types.PropertyGroup):
-    custom_fnlevel = IntProperty(name="Fast navigate level", description="Increase or decrease the SubSurf level, decrease make navigation faster", default=0)
-    
-    custom_location = FloatVectorProperty(name="Location", description="Location of the plane",
-                                          default=(1.0,0,-1.0),
-                                          subtype = 'XYZ', 
-                                          soft_min = -10,
-                                          soft_max = 10,
-                                          step=0.1,
-                                          size=3)
-                                           
-    custom_rotation = FloatProperty(name="Rotation", description="Rotate the plane",
-                                    min=-180, max=180, default=0)
-                                         
-    custom_scale = FloatVectorProperty(name="Scales", description="Scale the planes",
-                                       default=(1.0, 1.0),
-                                       subtype = 'XYZ',
-                                       min = 0.1,
-                                       max = 10,
-                                       soft_min=0.1,
-                                       soft_max=10,
-                                       step=0.1,
-                                       size=2)
-    custom_propscale = FloatProperty(name="PropScale", description="Scale the Plane",
-                                     default=1.0,
-                                     min = 0.1,
-                                     max = 10,
-                                     soft_min=0.1,
-                                     soft_max=10,
-                                     step=0.1)
-                                                                                    
-    custom_linkscale = BoolProperty(name="linkscale", default=True)
-   
-    # UV properties
-    custom_scaleuv = FloatVectorProperty(name="ScaleUV", description="Scale the texture's UV",
-                                            default=(1.0,1.0),min = 0.01, subtype = 'XYZ', size=2)
-    custom_propscaleuv = FloatProperty(name="PropScaleUV", description="Scale the texture's UV",
-                                           default=1.0,min = 0.01) 
-    custom_offsetuv = FloatVectorProperty(name="OffsetUV", description="Decal the texture's UV",
-                                            default=(0.0,0.0), subtype = 'XYZ', size=2)       
-    custom_linkscaleuv = BoolProperty(name="linkscaleUV", default=True)
-    custom_flipuvx = BoolProperty(name="flipuvx", default=False)
-    custom_flipuvy = BoolProperty(name="flipuvy", default=False)
-    
-    # other properties
-    custom_active= BoolProperty(name="custom_active", default=True)   
-    custom_expand = BoolProperty(name="expand", default=False)
-    
-    custom_active_view = StringProperty(name = "custom_active_view",default = "View",update = update_activeviewname)
-    
-    custom_image = StringProperty(name = "custom_image",default = "")
-    
-    custom_index = IntProperty()
-
-# Function to create custom properties
-def createcustomprops(context):
-    Ob = bpy.types.Object
-    
-    Ob.custom_fnlevel = IntProperty(name="Fast navigate level", description="Increase or decrease the SubSurf level, decrease make navigation faster", default=0)
-    
-    # plane properties 
-    Ob.custom_location = FloatVectorProperty(name="Location", description="Location of the plane",
-                                           default  = (1.0, 0, -1.0),
-                                           subtype  = 'XYZ', 
-                                           size     = 3,
-                                           step     = 0.5,
-                                           soft_min = -10,
-                                           soft_max = 10,
-                                           update   = update_Location)
-                                           
-    Ob.custom_rotation = FloatProperty(name="Rotation", description="Rotate the plane",
-                                       min=-180, max=180, default=0,update = update_Rotation)
-                                     
-    Ob.custom_old_rotation = FloatProperty(name="old_Rotation", description="Old Rotate the plane",
-                                           min=-180, max=180, default=0)
-                                         
-    Ob.custom_scale = FloatVectorProperty(name="Scales", description="Scale the planes",
-                                          subtype = 'XYZ',
-                                          default=(1.0, 1.0),
-                                          min = 0.1,
-                                          max = 10,
-                                          soft_min = 0.1,
-                                          soft_max = 10,
-                                          size=2,
-                                          step=0.5,
-                                          update = update_Scale)
-                                          
-    Ob.custom_propscale = FloatProperty(name="PropScale", description="Scale the Plane",
-                                        default  = 1.0,
-                                        min      = 0.1,
-                                        soft_min = 0.1,
-                                        soft_max = 10,
-                                        step     = 0.5,
-                                        update   = update_PropScale)
-                                           
-    Ob.custom_old_scale = FloatVectorProperty(name="old_Scales", description="Old Scale the planes",
-                                          subtype = 'XYZ', default=(1.0, 1.0),min = 0.1, size=2)
-                                          
-    Ob.custom_linkscale = BoolProperty(name="linkscale", default=True, update = update_LinkScale)
-    
-                                
-    Ob.custom_sub = IntProperty(name="Subdivide", description="Number of subdivision of the plane",
-                                     min=0, max=20, default=0)                                
-    
-    # UV properties
-    Ob.custom_scaleuv = FloatVectorProperty(name="ScaleUV", description="Scale the texture's UV",
-                                            default  = (1.0,1.0),
-                                            soft_min = 0.01,
-                                            soft_max = 100,
-                                            min      = 0.01, 
-                                            subtype  = 'XYZ',
-                                            size     = 2,
-                                            update   = update_UVScale)
-                                            
-    Ob.custom_propscaleuv = FloatProperty(name="PropScaleUV", description="Scale the texture's UV",
-                                          default    = 1.0,
-                                          soft_min   = 0.01,
-                                          soft_max   = 100,
-                                          min        = 0.01,
-                                          update     = update_PropUVScale)    
-
-    Ob.custom_old_scaleuv = FloatVectorProperty(name="old_ScaleUV", description="Scale the texture's UV",
-                                                default=(1.0,1.0),min = 0.01, subtype = 'XYZ', size=2)
-    Ob.custom_offsetuv = FloatVectorProperty(name="OffsetUV", description="Decal the texture's UV",
-                                            default=(0.0,0.0), subtype = 'XYZ', size=2,update = update_UVOffset)    
-    Ob.custom_old_offsetuv = FloatVectorProperty(name="old_OffsetUV", description="Decal the texture's UV",
-                                                 default=(0.0,0.0), subtype = 'XYZ', size=2)    
-    Ob.custom_linkscaleuv = BoolProperty(name="linkscaleUV", default=True, update = update_LinkUVScale)
-    Ob.custom_flipuvx = BoolProperty(name="flipuvx", default=False, update = update_FlipUVX)
-    Ob.custom_flipuvy = BoolProperty(name="flipuvy", default=False, update = update_FlipUVY)
-    
-    # other properties    
-    Ob.custom_c3d = BoolProperty(name="c3d", default=True)
-    Ob.custom_rotc3d = BoolProperty(name="rotc3d", default=False)
-    Ob.custom_scac3d = BoolProperty(name="scac3d", default=False)
-    Ob.custom_expand = BoolProperty(name="expand", default=True)
-    Ob.custom_active_view = StringProperty(name = "custom_active_view",default = "View")
-    try:
-        Ob.custom_active_object = StringProperty(name = "custom_active_object",default = context.object.name)
-    except:
-        Ob.custom_active_object = StringProperty(name = "custom_active_object",default = 'debut')    
-    Ob.custom_props = CollectionProperty(type = custom_props)
-
-# Function to remove custom properties
-def removecustomprops():    
-    list_prop = ['custom_location', 'custom_rotation', 'custom_old_rotation', 'custom_scale', 'custom_old_scale', 'custom_c3d',
-                 'custom_rotc3d', 'custom_scaleuv', 'custom_flipuvx', 'custom_flipuvy', 'custom_linkscale',
-                 'custom_linkscaleuv', 'custom_old_scaleuv', 'custom_offsetuv', 'custom_old_offsetuv', 'custom_scac3d', 'custom_sub',
-                 'custom_expand', 'custom_active_view', 'custom_propscaleuv', 'custom_props', 'custom_propscale']
-    for prop in list_prop:
-        try:
-            del bpy.data.objects[BProjection_Empty][prop]
-        except:
-            pass
-        
-def clear_props(context):
-    em = bpy.data.objects[BProjection_Empty] 
-    em.custom_scale = [1,1]
-    em.custom_rotation = 0
-    em.custom_scaleuv =[1.0,1.0]
-    em.custom_offsetuv =[0.0,0.0]
-    em.custom_propscaleuv = 1.0
-    em.custom_propscale = 1.0
-    if em.custom_flipuvx == True:
-        em.custom_flipuvx = False
-    if em.custom_flipuvy == True:
-        em.custom_flipuvy = False
-
-# Oprerator Class to create view            
-class CreateView(Operator):
-    bl_idname = "object.create_view"
-    bl_label = "Create a new view"
-
-    def execute(self, context):              
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-        new_props = em.custom_props.add()        
-        em.custom_active_view = new_props.custom_active_view               
-        ob.data.shape_keys.key_blocks[ob.active_shape_key_index].mute = True
-        bpy.ops.object.shape_key_add(from_mix = False)
-        ob.data.shape_keys.key_blocks[ob.active_shape_key_index].value = 1.0
-        new_props.custom_index = len(em.custom_props)-1
-        bpy.ops.object.active_view(index = new_props.custom_index)
-        return {'FINISHED'}
-
-# Oprerator Class to copy view 
-class SaveView(Operator):
-    bl_idname = "object.save_view"
-    bl_label = "copy the view"
-    
-    index = IntProperty(default = 0)
-    
-    def execute(self, context):              
-        em = bpy.data.objects[BProjection_Empty]
-        prop = em.custom_props[self.index]                            
-        prop.custom_rotation =  em.custom_rotation                    
-        prop.custom_scale =  em.custom_scale                  
-        prop.custom_linkscale =  em.custom_linkscale                                      
-        prop.custom_scaleuv = em.custom_scaleuv
-        prop.custom_propscale = em.custom_propscale
-        prop.custom_offsetuv =  em.custom_offsetuv  
-        prop.custom_linkscaleuv = em.custom_linkscaleuv
-        prop.custom_propscaleuv = em.custom_propscaleuv
-        prop.custom_flipuvx = em.custom_flipuvx
-        prop.custom_flipuvy = em.custom_flipuvy
-        try:
-            prop.custom_image = bpy.data.textures[BProjection_Texture].image.name
-        except:
-            pass
-        
-        return {'FINISHED'}
-
-# Oprerator Class to copy view 
-class PasteView(Operator):
-    bl_idname = "object.paste_view"
-    bl_label = "paste the view"
-    
-    index = IntProperty(default = 0)
-    
-    def execute(self, context):              
-        em = bpy.data.objects[BProjection_Empty]
-        tmp_scac3d = em.custom_scac3d
-        tmp_rotc3d = em.custom_rotc3d
-        em.custom_scac3d = False
-        em.custom_rotc3d = False
-        prop = em.custom_props[self.index]
-        em.custom_linkscale =  prop.custom_linkscale
-        em.custom_offsetuv =  prop.custom_offsetuv 
-        em.custom_linkscaleuv = prop.custom_linkscaleuv
-        em.custom_scaleuv = prop.custom_scaleuv
-        em.custom_propscaleuv = prop.custom_propscaleuv       
-        em.custom_rotation =  prop.custom_rotation                    
-        em.custom_scale =  prop.custom_scale
-        em.custom_propscale = prop.custom_propscale                     
-        if prop.custom_image != '':
-            if bpy.data.textures[BProjection_Texture].image.name != prop.custom_image:
-                bpy.data.textures[BProjection_Texture].image = bpy.data.images[prop.custom_image]
-                applyimage(context)
-        if em.custom_flipuvx != prop.custom_flipuvx:
-            em.custom_flipuvx = prop.custom_flipuvx
-        if em.custom_flipuvy != prop.custom_flipuvy:
-            em.custom_flipuvy = prop.custom_flipuvy
-        em.custom_scac3d = tmp_scac3d
-        em.custom_rotc3d = tmp_rotc3d        
-        return {'FINISHED'}
-
-# Oprerator Class to remove view 
-class RemoveView(Operator):
-    bl_idname = "object.remove_view"
-    bl_label = "Rmeove the view"
-    
-    index = IntProperty(default = 0)
-    
-    def execute(self, context):              
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-        
-        ob.active_shape_key_index =  self.index + 1
-        bpy.ops.object.shape_key_remove()
-        
-        if  em.custom_props[self.index].custom_active: 
-            if len(em.custom_props) > 0:
-                bpy.ops.object.active_view(index = self.index-1)
-            if self.index == 0 and len(em.custom_props) > 1:
-                bpy.ops.object.active_view(index = 1)            
-                
-        em.custom_props.remove(self.index)
-                
-        if len(em.custom_props) == 0:
-            clear_props(context)
-            
-            bpy.ops.object.create_view()            
-                 
-        i=0
-        for item in em.custom_props:
-            item.custom_index = i           
-            i+=1 
-
-        for item in (item for item in em.custom_props if item.custom_active):
-                ob.active_shape_key_index = item.custom_index+1
-           
-        return {'FINISHED'}
-
-# Oprerator Class to copy view 
-class ActiveView(Operator):
-    bl_idname = "object.active_view"
-    bl_label = "Active the view"
-    
-    index = IntProperty(default = 0)
-    
-    def execute(self, context):
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-        for item in (item for item in em.custom_props if item.custom_active == True):
-            bpy.ops.object.save_view(index = item.custom_index)
-            item.custom_active = False
-        em.custom_props[self.index].custom_active  = True
-        em.custom_active_view = em.custom_props[self.index].custom_active_view 
-        ob.active_shape_key_index =  self.index + 1
-        
-        for i in ob.data.shape_keys.key_blocks:
-            i.mute = True
-        
-        ob.data.shape_keys.key_blocks[ob.active_shape_key_index].mute = False
-        
-        bpy.ops.object.paste_view(index = self.index)         
-        
-        return {'FINISHED'}
-
-# Draw Class to show the panel
-class BProjection(Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "BProjection"
-
-    @classmethod
-    def poll(cls, context):
-        return (context.image_paint_object or context.sculpt_object)
-
-    def draw(self, context):
-        layout = self.layout        
-        if  BProjection_Empty in [ob.name for ob in bpy.data.objects]:
-            tex = bpy.data.textures[BProjection_Texture]
-
-            ob = context.object
-            em = bpy.data.objects[BProjection_Empty]
-            if ob == bpy.data.objects[em.custom_active_object]:            
-                col = layout.column(align =True)
-                col.operator("object.removebprojectionplane", text="Remove BProjection plane")           
-
-            try:
-                matBProjection = bpy.data.materials[BProjection_Material]
-            except:
-                matBProjection = None
-            
-            box = layout.box()
-
-            row = box.row()
-            if not em.custom_expand:
-                row.prop(em, "custom_expand", text  = "", icon="TRIA_RIGHT", emboss=False)
-                row.label(text= 'Paint Object: '+ ob.name)
-            else:
-                row.prop(em, "custom_expand", text = "" , icon="TRIA_DOWN", emboss=False)                
-                row.label(text= 'Paint Object: '+ ob.name)
-                
-                if ob == bpy.data.objects[em.custom_active_object]:
-                    col = box.column(align =True)
-                    col.template_ID(tex, "image", open="image.open")
-                    row  = box.row(align=True)
-                    row.operator('object.applyimage', text="Apply image", icon = 'FILE_TICK')
-                    row.prop(em, "custom_c3d",text="", icon='CURSOR')
-                    row  = box.row(align =True)
-                    row.label(text="Location:")
-                    row  = box.row(align =True)
-                    row.prop(em,'custom_location', text='')
-                    row  = box.row(align =True)            
-                    row.prop(em,'custom_rotation')
-                    row.prop(em,'custom_rotc3d',text="",icon='MANIPUL')            
-                    row  = box.row(align =True)
-                    row.label(text="Scale:")
-                    row  = box.row(align =True) 
-                    if em.custom_linkscale :
-                        row.prop(em, "custom_propscale",text="")
-                        row.prop(em, "custom_linkscale",text="",icon='LINKED')
-                    else: 
-                        row.prop(em,'custom_scale',text='')
-                        row.prop(em, "custom_linkscale",text="",icon='UNLINKED')
-                    row.prop(em,'custom_scac3d',text="",icon='MANIPUL')                            
-                    row  = box.row(align =True)
-                    row.label(text="UV's Offset:")
-                    row  = box.row(align =True)
-                    row.prop(em,'custom_offsetuv',text='')
-                    row.prop(em, "custom_flipuvx",text="",icon='ARROW_LEFTRIGHT')   
-                    row.prop(em, "custom_flipuvy",text="",icon='FULLSCREEN_ENTER') 
-                    row  = box.row(align =True)
-                    row.label(text="UV's Scale:")
-                    row  = box.row(align =True)                            
-                    if em.custom_linkscaleuv:
-                        row.prop(em,'custom_propscaleuv',text='')
-                        row.prop(em, "custom_linkscaleuv",text="",icon='LINKED')
-                    else: 
-                        row.prop(em,'custom_scaleuv',text='')
-                        row.prop(em, "custom_linkscaleuv",text="",icon='UNLINKED')            
-                    
-                    if matBProjection:
-                        row = box.column(align =True)
-                        row.prop(matBProjection,'alpha', slider = True)
-                        row = box.column(align =True)
-                    
-                    row.prop(ob,"custom_fnlevel")
-                    row = box.column(align =True)
-                        
-    
-                if ob == bpy.data.objects[em.custom_active_object]:    
-                    for item in em.custom_props:
-                        box = layout.box()
-                        row = box.row()
-                        if item.custom_active:
-                            row.operator("object.active_view",text = "", icon='RADIOBUT_ON', emboss = False).index = item.custom_index 
-                        else:
-                            row.operator("object.active_view",text = "", icon='RADIOBUT_OFF', emboss = False).index = item.custom_index 
-                        row.prop(item, "custom_active_view", text="")        
-                        row.operator('object.remove_view', text="", icon = 'PANEL_CLOSE', emboss = False).index = item.custom_index
-                    row = layout.row()
-                    row.operator('object.create_view', text="Create View", icon = 'RENDER_STILL') 
-                else:
-                    col = box.column(align =True)
-                    col.operator("object.change_object", text="Change Object")       
-
-        else:
-            ob = context.object
-            col = layout.column(align = True)
-            
-            if ob.active_material is None:
-                col.label(text="Add a material first!", icon="ERROR")
-            elif ob.data.uv_textures.active is None:
-                col.label(text="Create UVMap first!!", icon="ERROR")
-            else:
-                col.operator("object.addbprojectionplane", text="Add BProjection plane")
-                col = layout.column(align = True)
-                col.prop(ob, "custom_sub",text="Subdivision level")
-                   
-
-# Oprerator Class to apply the image to the plane             
-class ApplyImage(Operator):
-    bl_idname = "object.applyimage"
-    bl_label = "Apply image"
-
-    def execute(self, context):        
-        applyimage(context)
-        
-        return {'FINISHED'}
-
-# Oprerator Class to make the 4 or 6 point and scale the plan
-class IntuitiveScale(Operator):
-    bl_idname = "object.intuitivescale"
-    bl_label = "Draw lines"
-
-    def invoke(self, context, event):
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-        x = event.mouse_region_x
-        y = event.mouse_region_y                
-        if len(ob.grease_pencil.layers.active.frames) == 0: 
-            bpy.ops.gpencil.draw(mode='DRAW', stroke=[{"name":"", "pen_flip":False,
-                                                       "is_start":True, "location":(0, 0, 0),
-                                                       "mouse":(x,y), "pressure":1, "time":0}])
-        else:
-            if em.custom_linkscale:
-                nb_point = 4
-            else:
-                nb_point = 6
-                   
-            if len(ob.grease_pencil.layers.active.frames[0].strokes) < nb_point:
-                bpy.ops.gpencil.draw(mode='DRAW', stroke=[{"name":"", "pen_flip":False,
-                                                           "is_start":True, "location":(0, 0, 0),
-                                                           "mouse":(x,y), "pressure":1, "time":0}])
-                                                           
-            if len(ob.grease_pencil.layers.active.frames[0].strokes) == nb_point:
-                s = ob.grease_pencil.layers.active.frames[0]
-                v1 = s.strokes[1].points[0].co - s.strokes[0].points[0].co
-                if not em.custom_linkscale:
-                    v2 = s.strokes[4].points[0].co - s.strokes[3].points[0].co
-                else:
-                    v2 = s.strokes[3].points[0].co - s.strokes[2].points[0].co
-                propx = v1.x/v2.x                
-                em.custom_scale[0] *= abs(propx)
-                
-                if not em.custom_linkscale:
-                    v1 = s.strokes[2].points[0].co - s.strokes[0].points[0].co
-                    v2 = s.strokes[5].points[0].co - s.strokes[3].points[0].co
-                    propy = v1.y/v2.y
-                    em.custom_scale[1] *= abs(propy)
-                bpy.ops.gpencil.active_frame_delete()
-        
-        return {'FINISHED'}
-
-# Oprerator Class to configure all wath is needed
-class AddBProjectionPlane(Operator):
-    bl_idname = "object.addbprojectionplane"
-    bl_label = "Configure"
-    
-    def creatematerial(self, context):        
-        if 'Material for BProjection' not in [mat.name for mat in bpy.data.materials]:            
-            bpy.data.textures.new(name='Texture for BProjection',type='IMAGE')
-    
-            bpy.data.materials.new(name='Material for BProjection')
-            
-            matBProjection = bpy.data.materials['Material for BProjection']
-            matBProjection.texture_slots.add()
-            matBProjection.use_shadeless = True
-            matBProjection.use_transparency = True
-            matBProjection.active_texture = bpy.data.textures['Texture for BProjection']
-        
-            index = matBProjection.active_texture_index
-            matBProjection.texture_slots[index].texture_coords = 'UV'
-        
-        ob = context.object 
-        old_index = ob.active_material_index
-        bpy.ops.object.material_slot_add()
-        index = ob.active_material_index
-        ob.material_slots[index].material = bpy.data.materials['Material for BProjection']
-        bpy.ops.object.material_slot_assign()
-        ob.active_material_index = old_index
-        ob.data.update()
-            
-    def execute(self, context):    
-        if  BProjection_Empty not in [ob.name for ob in bpy.data.objects]:                
-            
-            cm = bpy.context.object.mode
-            '''tmp = context.object
-            for ob in (ob for ob in bpy.data.objects if ob.type == 'MESH' and ob.hide == False and context.scene in ob.users_scene):
-                context.scene.objects.active = ob
-                bpy.ops.object.mode_set(mode = cm, toggle=False) 
-            
-            context.scene.objects.active = tmp'''
-            bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
-            
-            context.space_data.show_relationship_lines = False
-            
-            ob = context.object
-        
-            bpy.ops.object.add()
-            em = context.object
-            em.name = BProjection_Empty
-                        
-            context.scene.objects.active = ob
-            ob.select = True
-    
-            bpy.ops.object.editmode_toggle()
-    
-            bpy.ops.mesh.primitive_plane_add()
-            bpy.ops.object.vertex_group_assign(new = True)
-            ob.vertex_groups.active.name = 'texture plane'   
-            bpy.ops.uv.unwrap()
-            
-            bpy.ops.mesh.select_all(action='DESELECT')                                
-            bpy.ops.object.vertex_group_select()
-            
-            bpy.ops.object.editmode_toggle()
-            for i in range(4):
-                ob.data.edges[len(ob.data.edges)-1-i].crease = 1
-            bpy.ops.object.editmode_toggle()
-            
-            em.custom_sub = ob.custom_sub
-            if em.custom_sub > 0:
-                bpy.ops.mesh.subdivide(number_cuts = em.custom_sub)
-    
-            em.select = True
-            bpy.ops.object.hook_add_selob()
-            em.select = False
-            em.hide = True   
-                     
-            self.creatematerial(context)
-  
-          
-            bpy.ops.gpencil.data_add()
-            ob.grease_pencil.draw_mode = 'VIEW'
-            bpy.ops.gpencil.layer_add()
-            ob.grease_pencil.layers.active.color = [1.0,0,0]
-            
-            bpy.ops.object.editmode_toggle()
-            
-            bpy.ops.object.shape_key_add(from_mix = False)
-            
-            bpy.ops.object.create_view()
-                    
-            km = bpy.data.window_managers['WinMan'].keyconfigs['Blender'].keymaps['3D View']
-            l = ['view3d.rotate','view3d.move','view3d.zoom','view3d.viewnumpad','MOUSE','KEYBOARD','MIDDLEMOUSE','WHEELINMOUSE','WHEELOUTMOUSE','NUMPAD_1','NUMPAD_3','NUMPAD_7']
-            for kmi in km.keymap_items:
-                if kmi.idname in l and kmi.map_type in l and kmi.type in l:
-                    try:
-                        p = kmi.properties.delta
-                        if p == -1 or p == 1:
-                            kmi.idname = 'view3d.zoom_view3d'
-                            kmi.properties.delta = p
-                    except:
-                        try:
-                            p = kmi.properties.type
-                            if kmi.shift == False :
-                                kmi.idname = 'view3d.preset_view3d'
-                                kmi.properties.view = p
-                        except:
-                            if kmi.idname == 'view3d.rotate':
-                                kmi.idname = 'view3d.rotate_view3d'  
-                            if kmi.idname == 'view3d.move':
-                                kmi.idname = 'view3d.pan_view3d' 
-                                                       
-            km = context.window_manager.keyconfigs.default.keymaps['Image Paint']
-            kmi = km.keymap_items.new("object.intuitivescale", 'LEFTMOUSE', 'PRESS', shift=True)
-                        
-            align_to_view(context)
-            
-            context.space_data.cursor_location = em.location
-            
-            bpy.ops.object.mode_set(mode = cm, toggle=False)
-            bpy.data.objects[BProjection_Empty].custom_active_object = context.object.name
-            
-        return {'FINISHED'}
-
-# Oprerator Class to remove what is no more needed    
-class RemoveBProjectionPlane(Operator):
-    bl_idname = "object.removebprojectionplane"
-    bl_label = "Configure"
-
-    def removematerial(self, context):
-        ob = context.object 
-        i = 0
-
-        for ms in ob.material_slots:
-            if ms.name == BProjection_Material:
-                index = i
-            i+=1
-                
-        ob.active_material_index = index
-        bpy.ops.object.material_slot_remove()
-    
-    def execute(self, context):
-        try:               
-            cm = bpy.context.object.mode
-            bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
-            
-            context.space_data.show_relationship_lines = True
-            
-            bpy.ops.object.modifier_remove(modifier="Hook-Empty for BProjection")
-            
-            self.removematerial(context)
-
-            ob = context.object
-    
-            bpy.ops.object.editmode_toggle()
-    
-            bpy.ops.mesh.reveal()
-                                   
-            bpy.ops.mesh.select_all(action='DESELECT')                    
-            
-            ob.vertex_groups.active_index = ob.vertex_groups['texture plane'].index
-            bpy.ops.object.vertex_group_select()
-            bpy.ops.mesh.delete()
-            bpy.ops.object.vertex_group_remove()
-    
-            bpy.ops.object.editmode_toggle()
-   
-            ob.select = False
-                
-            em = bpy.data.objects[BProjection_Empty]
-            context.scene.objects.active = em
-            em.hide = False
-            em.select = True
-            bpy.ops.object.delete()
-    
-            context.scene.objects.active = ob
-            ob.select = True
-            
-            reinitkey()
-                        
-            '''tmp = context.object
-            for ob in (ob for ob in bpy.data.objects if ob.type == 'MESH' and ob.hide == False and context.scene in ob.users_scene):
-                context.scene.objects.active = ob
-                bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False) 
-            
-            context.scene.objects.active = tmp'''
-            ob = context.object           
-            
-            
-            for i in ob.data.shape_keys.key_blocks:
-                bpy.ops.object.shape_key_remove()
-            bpy.ops.object.shape_key_remove()
-               
-            bpy.ops.object.mode_set(mode = cm, toggle=False)
-            removecustomprops()
-                    
-        except:
-            nothing = 0
-        
-        return {'FINISHED'}
-
-def reinitkey():
-    km = bpy.data.window_managers['WinMan'].keyconfigs['Blender'].keymaps['3D View']
-    l = ['view3d.zoom_view3d','view3d.preset_view3d','view3d.rotate_view3d','view3d.pan_view3d','MOUSE','KEYBOARD','MIDDLEMOUSE','WHEELINMOUSE','WHEELOUTMOUSE','NUMPAD_1','NUMPAD_3','NUMPAD_7']
-    for kmi in km.keymap_items:
-        if kmi.idname in l and kmi.map_type in l and kmi.type in l:
-            try:
-                p = kmi.properties.delta
-                if p == -1 or p == 1:
-                    kmi.idname = 'view3d.zoom'
-                    kmi.properties.delta = p
-            except:
-                try:
-                    p = kmi.properties.view
-                    if kmi.shift == False :
-                        kmi.idname = 'view3d.viewnumpad'
-                        kmi.properties.type = p
-                except:
-                    if kmi.idname == 'view3d.rotate_view3d':
-                        kmi.idname = 'view3d.rotate'  
-                    if kmi.idname == 'view3d.pan_view3d':
-                        kmi.idname = 'view3d.move'            
-            
-    km = bpy.context.window_manager.keyconfigs.default.keymaps['Image Paint']
-    #to do
-    for kmi in (kmi for kmi in km.keymap_items if kmi.idname in {"object.intuitivescale", }):
-            km.keymap_items.remove(kmi)
-
-# Oprerator Class to remove what is no more needed    
-class ChangeObject(Operator):
-    bl_idname = "object.change_object"
-    bl_label = "Change Object"
-
-    def removematerial(self, context):
-        ob = context.object 
-        i = 0
-
-        for ms in ob.material_slots:
-            if ms.name == BProjection_Material:
-                index = i
-            i+=1
-                
-        ob.active_material_index = index
-        bpy.ops.object.material_slot_remove()
-    
-    def execute(self, context):
-            new_ob = context.object
-            em = bpy.data.objects[BProjection_Empty]              
-            context.scene.objects.active = bpy.data.objects[em.custom_active_object]
-            ob = context.object
-            if ob != new_ob:
-                cm = bpy.context.object.mode
-                bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
-                
-                bpy.ops.object.modifier_remove(modifier="Hook-Empty for BProjection") 
-    
-                ob = context.object
-        
-                bpy.ops.object.editmode_toggle()
-        
-                bpy.ops.mesh.reveal()
-                                       
-                bpy.ops.mesh.select_all(action='DESELECT')                               
-                ob.vertex_groups.active_index = ob.vertex_groups['texture plane'].index
-                bpy.ops.object.vertex_group_select()
-                lo_b = [ob for ob in bpy.data.objects if ob.type == 'MESH']
-                bpy.ops.mesh.separate(type='SELECTED')
-                lo_a = [ob for ob in bpy.data.objects if ob.type == 'MESH']
-                bpy.ops.object.vertex_group_remove()
-                
-                for i in lo_b:
-                    lo_a.remove(i)
-                bplane = lo_a[0]
-                
-                bpy.ops.object.editmode_toggle()
-                
-                self.removematerial(context)
-                
-                bpy.ops.object.mode_set(mode = cm, toggle=False)
-                
-                shape_index = ob.active_shape_key_index
-                
-                for i in ob.data.shape_keys.key_blocks:
-                    bpy.ops.object.shape_key_remove()
-                bpy.ops.object.shape_key_remove()
-                
-                ob.select = False
-                
-                bplane.select = True            
-                context.scene.objects.active = bplane
-                for ms in (ms for ms in bplane.material_slots if ms.name != BProjection_Material):
-                    bplane.active_material = ms.material
-                    bpy.ops.object.material_slot_remove()
-                
-                for gs in (gs for gs in bplane.vertex_groups if gs.name != 'texture plane'):
-                    bplane.vertex_groups.active_index = gs.index
-                    bpy.ops.object.vertex_group_remove()
-              
-                context.scene.objects.active = new_ob
-                cm = new_ob.mode
-                bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False) 
-                bpy.ops.object.join()
-    
-                em.hide = False
-                em.select = True
-                new_ob.select = False
-                bpy.ops.object.location_clear()
-                bpy.ops.object.rotation_clear()
-                bpy.ops.object.scale_clear()
-                context.scene.objects.active = new_ob
-                bpy.ops.object.editmode_toggle()            
-                bpy.ops.object.hook_add_selob()
-                bpy.ops.object.editmode_toggle()
-                em.hide = True
-                em.select = False
-                new_ob.select = True
-                em.custom_active_object = new_ob.name
-                tmp = em.custom_c3d
-                em.custom_c3d = False
-                bpy.ops.object.active_view(index = shape_index-1)
-                bpy.ops.object.mode_set(mode = cm, toggle=False)
-                        
-                sd = context.space_data
-                r3d = sd.region_3d 
-                vr = r3d.view_rotation.copy()
-                vr.invert()
-                ob_loc = ob.location.copy()            
-                new_ob_loc = new_ob.location.copy() 
-                ob_loc.rotate(vr)
-                new_ob_loc.rotate(vr)
-                em.custom_location += Vector((ob_loc.x - new_ob_loc.x, ob_loc.y - new_ob_loc.y, 0.0))
-                em.custom_c3d = tmp
-                    
-            return {'FINISHED'}
-
-# Oprerator Class to rotate the view3D
-class RotateView3D(Operator):
-    bl_idname = "view3d.rotate_view3d"
-    bl_label = "Rotate the View3D"
-    
-    first_mouse = Vector((0,0))
-
-    pan = Vector((0,0))
-
-    key = ['']
-    block = 0
- 
-    first_time = True
-    tmp_level = -1
-
-    def vect_sphere(self, context, mx, my):
-        width = context.area.regions[4].width
-        height = context.area.regions[4].height
-           
-        if width >= height:
-            ratio = height/width
-        
-            x = 2*mx/width
-            y = 2*ratio*my/height
-            
-            x = x - 1
-            y = y - ratio
-        else:
-            ratio = width/height
-        
-            x = 2*ratio*mx/width
-            y = 2*my/height
- 
-            x = x - ratio
-            y = y - 1
-        
-        z2 = 1 - x * x - y * y
-        if z2 > 0:
-            z= sqrt(z2)
-        else : z=0
-            
-        p = Vector((x, y, z))
-        p.normalize()
-        return p
-    
-    def tracball(self, context, mx, my, origine):
-        sd = context.space_data
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-            
-        vr_b = sd.region_3d.view_rotation.copy()
-        vr_b.invert()
-        pos_init = sd.region_3d.view_location - origine
-        sd.region_3d.view_location = origine
-        
-        v1 = self.vect_sphere(context, self.first_mouse.x, self.first_mouse.y)
-        v2 = self.vect_sphere(context, mx, my)
-                        
-        axis = Vector.cross(v1,v2);
-        angle = Vector.angle(v1,v2);
-            
-        q =  Quaternion(axis,-2*angle)
-                        
-        sd.region_3d.view_rotation *=q
-        sd.region_3d.update()
-        
-        vr_a = sd.region_3d.view_rotation.copy()                           
-        pos_init.rotate(vr_a*vr_b)            
-        sd.region_3d.view_location =  pos_init + origine
-        
-        self.first_mouse = Vector((mx, my))
-                
-    def modal(self, context, event):                                
-        ob = context.object
-        em = bpy.data.objects['Empty for BProjection'] 
-        reg = context.area.regions[4]        
-            
-                    
-        if event.type not in {'MOUSEMOVE','INBETWEEN_MOUSEMOVE'}:
-            self.pan = Vector((event.mouse_region_x, event.mouse_region_y))
-            self.key = [event.type]
-            self.block = 1
-            
-        if event.value == 'RELEASE':
-            if self.tmp_level > -1:
-                for sub in context.object.modifiers:
-                    if sub.type in ['SUBSURF','MULTIRES']:
-                        sub.levels = self.tmp_level 
-            return {'FINISHED'}
-
-        if event.type == 'MOUSEMOVE':                        
-            if self.block == 0:
-                self.tracball(context, event.mouse_region_x, event.mouse_region_y,ob.location)
-                align_to_view(context)
-                #to unlock the camera
-                if self.first_time:                    
-                    rot_ang = context.user_preferences.view.rotation_angle            
-                    context.user_preferences.view.rotation_angle = 0
-                    bpy.ops.view3d.view_orbit(type='ORBITLEFT')
-                    context.user_preferences.view.rotation_angle = rot_ang   
-                    bpy.ops.view3d.view_persportho()         
-                    bpy.ops.view3d.view_persportho()
-                    self.first_time = False
-            else:          
-                deltax = event.mouse_region_x - round(self.pan.x)
-                deltay = event.mouse_region_y - round(self.pan.y)          
-     
-                if 'G' in self.key:     
-                    sd = context.space_data              
-                    l =  sd.region_3d
-                    vr = l.view_rotation.copy()
-                    vr.invert()
-                    
-                    v_init = Vector((0.0,0.0,1.0))
-                    
-                    pos = [-deltax,-deltay]
-                    v = view3d_utils.region_2d_to_location_3d(context.region, l, pos, v_init)
-                    pos = [0,0]
-                    vbl = view3d_utils.region_2d_to_location_3d(context.region, l, pos, v_init)        
-                    loc = vbl - v 
-              
-                    loc.rotate(vr)
-                    em.custom_location += loc              
-                                       
-                if 'S' in self.key:                
-                    s = em.custom_scale
-                    if em.custom_linkscale:
-                        em.custom_propscale += deltax/20
-                    else:
-                        em.custom_scale = [s[0] + deltax/20, s[1] + deltay/20]
-                                              
-                if 'Z' in self.key:                
-                    em.custom_location.z+=deltax/10
-                          
-                if 'R' in self.key:
-                    em.custom_rotation+=deltax
-                        
-                if 'U' in self.key:
-                    suv = em.custom_scaleuv
-                    if em.custom_linkscaleuv:    
-                        em.custom_propscaleuv += deltax/50
-                    else:
-                        em.custom_scaleuv= [suv[0] + deltax/50 , suv[1] + deltay/50]               
-    
-                if 'Y' in self.key:       
-                    ouv = em.custom_offsetuv
-                    em.custom_offsetuv = [ouv[0] - deltax/50,ouv[1] - deltay/50] 
-    
-                self.pan = Vector((event.mouse_region_x, event.mouse_region_y))
-        
-        if 'C' in self.key:
-            clear_props(context)
-        
-        if 'O' in self.key:
-            bpy.ops.object.change_object()           
-        return {'RUNNING_MODAL'}
-    
-    def execute(self, context):        
-        align_to_view(context)  
-        
-        return{'FINISHED'}
-
-    def invoke(self, context, event):
-        bpy.data.objects['Empty for BProjection']
-        context.window_manager.modal_handler_add(self)
-        self.first_mouse = Vector((event.mouse_region_x,event.mouse_region_y))
-        self.first_time = True
-        for sub in context.object.modifiers:
-            if sub.type in ['SUBSURF', 'MULTIRES']:
-                self.tmp_level = sub.levels
-                if sub.levels - self.tmp_level <0:
-                    sub.levels = 0
-                else:
-                    sub.levels += bpy.context.object.custom_fnlevel
-        return {'RUNNING_MODAL'}
-            
-
-# Oprerator Class to pan the view3D
-class PanView3D(bpy.types.Operator):
-    bl_idname = "view3d.pan_view3d"
-    bl_label = "Pan View3D"
-    
-    first_mouse = Vector((0,0))
-    tmp_level = -1
-
-    def modal(self, context, event):
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-        width = context.area.regions[4].width
-        height = context.area.regions[4].height
-
-        deltax = event.mouse_region_x - self.first_mouse.x
-        deltay = event.mouse_region_y - self.first_mouse.y                
-        
-        sd = context.space_data              
-        r3d =  sd.region_3d
-        vr = r3d.view_rotation.copy()
-        vr.invert()
-        
-        v_init = Vector((0.0,0.0,1.0))
-        
-        pos = [deltax,deltay]
-        v = view3d_utils.region_2d_to_location_3d(context.region, r3d, pos, v_init)
-        pos = [0,0]
-        vbl = view3d_utils.region_2d_to_location_3d(context.region, r3d, pos, v_init)        
-        loc = vbl - v       
-        sd.region_3d.view_location += loc         
-        loc.rotate(vr)
-        em.custom_location += loc
-
-        self.first_mouse.x = event.mouse_region_x
-        self.first_mouse.y = event.mouse_region_y
-
-        if event.type == 'MIDDLEMOUSE'and event.value == 'RELEASE':
-            if self.tmp_level > -1:
-                for sub in context.object.modifiers:
-                    if sub.type in ['SUBSURF','MULTIRES']:
-                        sub.levels = self.tmp_level
-            return {'FINISHED'}
-        
-        return {'RUNNING_MODAL'}
-                
-    def invoke(self, context, event):
-        bpy.data.objects['Empty for BProjection']    
-        context.window_manager.modal_handler_add(self)
-        self.first_mouse.x = event.mouse_region_x
-        self.first_mouse.y = event.mouse_region_y   
-        for sub in context.object.modifiers:
-            if sub.type in ['SUBSURF', 'MULTIRES']:
-                self.tmp_level = sub.levels
-                if sub.levels - self.tmp_level <0:
-                    sub.levels = 0
-                else:
-                    sub.levels += bpy.context.object.custom_fnlevel 
-                      
-        return {'RUNNING_MODAL'}
-        
-    def execute(self, context):        
-        align_to_view(context)  
-        
-        return{'FINISHED'}
-
-# Oprerator Class to zoom the view3D
-class ZoomView3D(Operator):
-    bl_idname = "view3d.zoom_view3d"
-    bl_label = "Zoom View3D"
-
-    delta = FloatProperty(
-        name="delta",
-        description="Delta",
-        min=-1.0, max=1,
-        default=1.0)
-
-    def invoke(self, context, event):                   
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-        sd = context.space_data
-
-        width = context.area.regions[4].width
-        height = context.area.regions[4].height              
-                    
-        r3d =  sd.region_3d
-        v_init = Vector((0.0,0.0,1.0))
-
-        pos = [width,height]
-        vtr_b = view3d_utils.region_2d_to_location_3d(context.region, r3d, pos, v_init)
-        pos = [0,0]
-        vbl_b = view3d_utils.region_2d_to_location_3d(context.region, r3d, pos, v_init)
-        len_b = vtr_b - vbl_b
-       
-        bpy.ops.view3d.zoom(delta = self.delta)
-        r3d.update()
-
-        pos = [width,height]
-        vtr_a = view3d_utils.region_2d_to_location_3d(context.region, r3d, pos, v_init)
-        pos = [0,0]
-        vbl_a = view3d_utils.region_2d_to_location_3d(context.region, r3d, pos, v_init) 
-        len_a = vtr_a - vbl_a
-        
-        fac = len_a.length/len_b.length
-        r3d.view_location -= ob.location
-        r3d.view_location *= fac
-        r3d.view_location += ob.location
-        vres = Vector((em.custom_location.x*fac,em.custom_location.y*fac,em.custom_location.z))
-        em.custom_location = vres
-        
-        
-        align_to_view(context)
-        
-        return {'FINISHED'}
-
-    def execute(self, context):        
-        align_to_view(context)
-        
-        return{'FINISHED'}
-
-# Oprerator Class to use numpad shortcut
-class PresetView3D(Operator):
-    bl_idname = "view3d.preset_view3d"
-    bl_label = "Preset View3D"
-
-    view = StringProperty(name="View", description="Select the view", default='TOP')
-    def invoke(self, context, event):                   
-        ob = context.object
-        em = bpy.data.objects[BProjection_Empty]
-        origine = ob.location
-        sd = context.space_data
-
-        vr_b = sd.region_3d.view_rotation.copy()
-        vr_b.invert()
-        pos_init = sd.region_3d.view_location - origine
-        sd.region_3d.view_location = origine
-
-        tmp = context.user_preferences.view.smooth_view
-        context.user_preferences.view.smooth_view = 0
-        bpy.ops.view3d.viewnumpad(type=self.view)
-        align_to_view(context)        
-        context.user_preferences.view.smooth_view = tmp
-
-        vr_a = sd.region_3d.view_rotation.copy()                           
-        pos_init.rotate(vr_a*vr_b)            
-        sd.region_3d.view_location =  pos_init + origine              
-                    
-        return {'FINISHED'}
-
- at persistent
-def load_handler(dummy):
-    reinitkey()
-
-def register():
-    bpy.utils.register_module(__name__)
-    createcustomprops(bpy.context)
-    bpy.app.handlers.load_post.append(load_handler)
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/space_view3d_quickPrefs.py b/release/scripts/addons_contrib/space_view3d_quickPrefs.py
deleted file mode 100644
index 79a7d24..0000000
--- a/release/scripts/addons_contrib/space_view3d_quickPrefs.py
+++ /dev/null
@@ -1,968 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "QuickPrefs",
-    "author": "Sean Olson",
-    "version": (2,2),
-    "blender": (2, 66, 0),
-    "location": "3DView->Properties Panel (N-Key)",
-    "description": "Add often changed User Preference options to Properties panel.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-                "Scripts/3D_interaction/QuickPrefs",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-                   "func=detail&aid=27822",
-    "category": "3D View"}
-
-import os
-    
-import bpy
-from bpy.types import Menu, Panel
-from rna_prop_ui import PropertyPanel
-from bpy.app.handlers import persistent
-from bpy.props import (
-                       BoolProperty,
-                       EnumProperty,
-                       FloatProperty,
-                       CollectionProperty, 
-                       IntProperty,
-                       StringProperty, 
-                       PointerProperty
-                       )
-
-
-import bpy_extras
-
-#Global Variables
-recursive  = False
-renaming   = True
-lastindex  = 0
-lastname   = ""
-debug = 0
-defaultfilepath=os.path.join(bpy.utils.script_paths(subdir="addons")[0], "quickprefpresets")
-
-
-##########################################
-####### Import/Export Functions ##########
-##########################################
-
-#import all grabs all files in the given directory and imports them
- at persistent
-def gllightpreset_importall():
-    path = bpy.context.scene.quickprefs.gllightpreset_importdirectory
-    directorylisting = os.listdir(path)
-
-    for infile in directorylisting:
-        if not os.path.isdir(infile):                       #check if the file is a directory
-            if '.preset' in infile:                           #check that this is a .preset file
-                thefile=os.path.join(path, infile)       #join the filename with the path
-                gllightpreset_importsingle(thefile)     #import it!
-       
-#import single takes a given filename and imports it
-def gllightpreset_importsingle(filename):
-    
-    if not os.path.isdir(filename):           #check if the file is a directory
-        if '.preset' in filename:              #check to make sure this is a preset file
-            readfile=open(filename, 'r')
-            
-            name=readfile.readline()
-            name=name[:-1]
-            
-            illuminationString0=readfile.readline()
-            illuminationString0=illuminationString0[:-1]
-            
-            if illuminationString0=="True":
-                illumination0=True
-            else:
-                illumination0=False
-           
-            illuminationString1=readfile.readline()
-            illuminationString1=illuminationString1[:-1]
-            if illuminationString1=="True":
-                illumination1=True
-            else:
-                illumination1=False
-                
-            illuminationString2=readfile.readline()
-            illuminationString2=illuminationString2[:-1]
-            if illuminationString2=="True":
-                illumination2=True
-            else:
-                illumination2=False
-            
-            #convert strings to booleans
-
-            str=readfile.readline()
-            strArray=str.split()
-            direction0x=strArray[0]
-            direction0y=strArray[1]
-            direction0z=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            direction1x=strArray[0]
-            direction1y=strArray[1]
-            direction1z=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            direction2x=strArray[0]
-            direction2y=strArray[1]
-            direction2z=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            diffuse0r=strArray[0]
-            diffuse0g=strArray[1]
-            diffuse0b=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            diffuse1r=strArray[0]
-            diffuse1g=strArray[1]
-            diffuse1b=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            diffuse2r=strArray[0]
-            diffuse2g=strArray[1]
-            diffuse2b=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            spec0r=strArray[0]
-            spec0g=strArray[1]
-            spec0b=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            spec1r=strArray[0]
-            spec1g=strArray[1]
-            spec1b=strArray[2]
-
-            str=readfile.readline()
-            strArray=str.split()
-            spec2r=strArray[0]
-            spec2g=strArray[1]
-            spec2b=strArray[2]
-            
-            #set the variables
-            system=bpy.context.user_preferences.system
-            system.solid_lights[0].use=illumination0
-            system.solid_lights[1].use=illumination1
-            system.solid_lights[2].use=illumination2
-
-            system.solid_lights[0].direction = (float(direction0x), float(direction0y), float(direction0z))
-            system.solid_lights[1].direction = (float(direction1x), float(direction1y), float(direction1z))
-            system.solid_lights[2].direction = (float(direction2x), float(direction2y), float(direction2z))
-
-            system.solid_lights[0].diffuse_color=(float(diffuse0r), float(diffuse0g), float(diffuse0b))
-            system.solid_lights[1].diffuse_color=(float(diffuse1r), float(diffuse1g), float(diffuse1b))
-            system.solid_lights[2].diffuse_color=(float(diffuse2r), float(diffuse2g), float(diffuse2b))
-
-            system.solid_lights[0].specular_color=(float(spec0r), float(spec0g), float(spec0b))
-            system.solid_lights[1].specular_color=(float(spec1r), float(spec1g), float(spec1b))
-            system.solid_lights[2].specular_color=(float(spec2r), float(spec2g), float(spec2b))
-            gllightpreset_add(name)
-            gllightpreset_save()
-
-#Export all exports the entire contents of your presets list to the given file    
- at persistent     
-def gllightpreset_exportall(context):
-   for i in range(len(bpy.context.scene.quickprefs.gllightpreset)):
-        gllightpreset_exportsingle(i, True)
-             
-    
-def gllightpreset_exportsingle(index, multiimport):
-    scn=bpy.context.scene.quickprefs
-    name=scn.gllightpreset[index].name
-    
-    illuminatedBool0=scn.gllightpreset[index].illuminated0
-    illuminatedBool1=scn.gllightpreset[index].illuminated1
-    illuminatedBool2=scn.gllightpreset[index].illuminated2
-    
-    #illuminations
-    if illuminatedBool0==True:
-        illuminated0="True"
-    else:
-        illuminated0="False"
-    
-    if illuminatedBool1==True:
-        illuminated1="True"
-    else:
-        illuminated1="False"
-        
-    if illuminatedBool2==True:
-        illuminated2="True"
-    else:
-        illuminated2="False"
-        
-    #direction light0
-    dirx=str(scn.gllightpreset[index].direction0[0])
-    diry=str(scn.gllightpreset[index].direction0[1])
-    dirz=str(scn.gllightpreset[index].direction0[2])
-    direction0=dirx + " " + diry + " " + dirz + " "
-    
-    #direction light1
-    dirx=str(scn.gllightpreset[index].direction1[0])
-    diry=str(scn.gllightpreset[index].direction1[1])
-    dirz=str(scn.gllightpreset[index].direction1[2])
-    direction1=dirx + " " + diry + " " + dirz + " "
-    
-    #direction light2
-    dirx=str(scn.gllightpreset[index].direction2[0])
-    diry=str(scn.gllightpreset[index].direction2[1])
-    dirz=str(scn.gllightpreset[index].direction2[2])
-    direction2=dirx + " " + diry + " " + dirz + " "
-    
-    #diffuse light0
-    difr=str(scn.gllightpreset[index].diffuse0[0])
-    difg=str(scn.gllightpreset[index].diffuse0[1])
-    difb=str(scn.gllightpreset[index].diffuse0[2])
-    diffuse0=difr + " " + difg + " " + difb + " "
-    
-    #diffuse light1
-    difr=str(scn.gllightpreset[index].diffuse1[0])
-    difg=str(scn.gllightpreset[index].diffuse1[1])
-    difb=str(scn.gllightpreset[index].diffuse1[2])
-    diffuse1=difr + " " + difg + " " + difb + " "
-    
-    #diffuse light2
-    difr=str(scn.gllightpreset[index].diffuse2[0])
-    difg=str(scn.gllightpreset[index].diffuse2[1])
-    difb=str(scn.gllightpreset[index].diffuse2[2])
-    diffuse2=difr + " " + difg + " " + difb + " "
-    
-    #specular light 0
-    specr=str(scn.gllightpreset[index].specular0[0])
-    specg=str(scn.gllightpreset[index].specular0[1])
-    specb=str(scn.gllightpreset[index].specular0[2])
-    specular0=specr + " " + specg + " " + specb + " "
-    
-    #specular light 1
-    specr=str(scn.gllightpreset[index].specular1[0])
-    specg=str(scn.gllightpreset[index].specular1[1])
-    specb=str(scn.gllightpreset[index].specular1[2])
-    specular1=specr + " " + specg + " " + specb + " "
-    
-    #specular light 2
-    specr=str(scn.gllightpreset[index].specular2[0])
-    specg=str(scn.gllightpreset[index].specular2[1])
-    specb=str(scn.gllightpreset[index].specular2[2])
-    specular2=specr + " " + specg + " " + specb + " "
-    
-    printstring=name+"\n"
-    printstring+=illuminated0 +"\n"+ illuminated1 +"\n"+ illuminated2+"\n"
-    printstring+=direction0  +"\n"+ direction1 +"\n"+ direction2 +"\n"
-    printstring+=diffuse0+"\n"+diffuse1 +"\n"+ diffuse2 +"\n"
-    printstring+=specular0+"\n"+specular1+"\n"+specular2+"\n"
-
-    if multiimport==True:
-        filepath = scn.gllightpreset_exportdirectory
-    else:
-        filepath = scn.gllightpreset_exportfile
-
-    if not os.path.exists(filepath):
-        os.mkdir(filepath)
-    filepath=os.path.join(filepath, (name+".preset"))        
-    writefile = open(filepath, 'w') 
-    writefile.write(printstring) 
-
-##########################################
-####### General  Presets Functions #######
-##########################################
-
-def gllightpreset_addPresets():
-  
-    system=bpy.context.user_preferences.system
-  
-    system.solid_lights[0].use=True
-    system.solid_lights[1].use=True
-    system.solid_lights[2].use=True
-  
-    system.solid_lights[0].direction = (-0.8920, 0.3000, 0.8999)
-    system.solid_lights[1].direction = (0.5880, 0.4600, 0.2480)
-    system.solid_lights[2].direction = (0.2159, -0.3920, -0.2159)
-    
-    system.solid_lights[0].diffuse_color=(0.8000, 0.8000, 0.8000)
-    system.solid_lights[1].diffuse_color=(0.4980, 0.5000, 0.6000)
-    system.solid_lights[2].diffuse_color=(0.7980, 0.8379, 1.0)
-    
-    system.solid_lights[0].specular_color=(0.5, 0.5, 0.5)
-    system.solid_lights[1].specular_color=(0.2000, 0.2, 0.2)
-    system.solid_lights[2].specular_color=(0.0659, 0.0, 0.0)
-    gllightpreset_add("(Default)")
-    gllightpreset_save()
-    
-    system.solid_lights[0].use=True
-    system.solid_lights[1].use=True
-    system.solid_lights[2].use=True
-    
-    system.solid_lights[0].direction = (-0.3207, 0.4245, 0.8466)
-    system.solid_lights[1].direction = (0.4259, -0.0555, 0.9030)
-    system.solid_lights[2].direction = (-0.4485, 0.2400, -0.8609)
-    
-    system.solid_lights[0].diffuse_color=(0.4292, 0.0457, 0.0457)
-    system.solid_lights[1].diffuse_color=(0.7873, 0.4424, 0.2893)
-    system.solid_lights[2].diffuse_color=(0.7483, 0.7168, 0.6764)
-    
-    system.solid_lights[0].specular_color=(0.2000, 0.2000, 0.2000)
-    system.solid_lights[1].specular_color=(0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color=(0.0, 0.0, 0.0)
-    gllightpreset_add("Orange Clay")
-    gllightpreset_save()
-    
-    system.solid_lights[0].use=True
-    system.solid_lights[1].use=True
-    system.solid_lights[2].use=True
-    
-    system.solid_lights[0].direction=(-0.06666, 0.8222, 0.5652)
-    system.solid_lights[1].direction=(-0.8555, 0.1111, 0.5056)
-    system.solid_lights[2].direction=(0.9000, 0.1555, 0.4071)
-    
-    system.solid_lights[0].diffuse_color=(0.1000, 0.1000, 0.1000)
-    system.solid_lights[1].diffuse_color=(1.0, 0.9734, 0.8713)
-    system.solid_lights[2].diffuse_color=(0.7835, 0.9215, 1.0)
-    
-    system.solid_lights[0].specular_color=(0.0, 0.0, 0.0)
-    system.solid_lights[1].specular_color=(0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color=(0.0, 0.0, 0.0)
-    gllightpreset_add("Softblend")
-    gllightpreset_save()
-    
-    system.solid_lights[0].use = True
-    system.solid_lights[1].use = True
-    system.solid_lights[2].use = True
-
-    system.solid_lights[0].direction = (0.3666, 0.2888, 0.8843)
-    system.solid_lights[1].direction = (0.1111, 0.0888, 0.9898)
-    system.solid_lights[2].direction = (-0.5142, 0.5142, -0.6864)
-
-    system.solid_lights[0].diffuse_color = (0.6618, 0.5481, 0.5054)
-    system.solid_lights[1].diffuse_color = (0.3672, 0.2371, 0.1752)
-    system.solid_lights[2].diffuse_color = (1.0, 0.9574, 0.9058)
-
-    system.solid_lights[0].specular_color = (0.4969, 0.4886, 0.4820)
-    system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
-    gllightpreset_add("Skin")
-    gllightpreset_save()
-
-    system.solid_lights[0].use = True
-    system.solid_lights[1].use = False
-    system.solid_lights[2].use = False
-
-    system.solid_lights[0].direction = (0.0111, 0.4000, 0.9164)
-    system.solid_lights[1].direction = (0.1111, 0.0888, 0.9898)
-    system.solid_lights[2].direction = (-0.5142, 0.5142, -0.6864)
-
-    system.solid_lights[0].diffuse_color = (1.0, 0.5912, 0.4148)
-    system.solid_lights[1].diffuse_color = (0.4962, 0.4962, 0.4962)
-    system.solid_lights[2].diffuse_color = (1.0, 0.9574, 0.9058)
-
-    system.solid_lights[0].specular_color = (0.2036, 0.4206, 0.7873)
-    system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
-    gllightpreset_add("Candy")
-    gllightpreset_save();
-    
-    system.solid_lights[0].use = True
-    system.solid_lights[1].use = True
-    system.solid_lights[2].use = True
-
-    system.solid_lights[0].direction = (-0.6124, 0.6046, 0.5092)
-    system.solid_lights[1].direction = (0.1627, 0.5271, 0.8340)
-    system.solid_lights[2].direction = (-0.5858, 0.7811, -0.2160)
-
-    system.solid_lights[0].diffuse_color = (0.0, 0.3564, 0.4292)
-    system.solid_lights[1].diffuse_color = (0.7873, 0.0038, 0.7197)
-    system.solid_lights[2].diffuse_color = (0.1994, 0.2014, 0.2330)
-
-    system.solid_lights[0].specular_color = (0.0946, 0.0946, 0.0946)
-    system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color = (0.0, 0.0, 0.0)
-    gllightpreset_add("Purpleboogers.com")
-    gllightpreset_save();
-    
-    system.solid_lights[0].use = True
-    system.solid_lights[1].use = False
-    system.solid_lights[2].use = False
-
-    system.solid_lights[0].direction = (0.0111, 0.4000, 0.9164)
-    system.solid_lights[1].direction = (0.1111, 0.0888, 0.9898)
-    system.solid_lights[2].direction = (-0.5142, 0.5142, -0.6864)
-
-    system.solid_lights[0].diffuse_color = (0.8000, 0.8000, 0.8000)
-    system.solid_lights[1].diffuse_color = (0.4962, 0.4962, 0.4962)
-    system.solid_lights[2].diffuse_color = (1.0, 0.9574, 0.9058)
-
-    system.solid_lights[0].specular_color = (0.4540, 0.4540, 0.4540)
-    system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
-    gllightpreset_add("Dark Gray")
-    gllightpreset_save()
-
-    system.solid_lights[0].use = True
-    system.solid_lights[1].use = False
-    system.solid_lights[2].use = False
-
-    system.solid_lights[0].direction = (0.0333, 0.2444, 0.9690)
-    system.solid_lights[1].direction = (0.1111, 0.08888, 0.9898)
-    system.solid_lights[2].direction = (-0.5142, 0.5142, -0.6864)
-
-    system.solid_lights[0].diffuse_color = (0.8000, 0.6670, 0.6020)
-    system.solid_lights[1].diffuse_color = (0.4962, 0.4962, 0.4962)
-    system.solid_lights[2].diffuse_color = (1.0, 0.9574, 0.9058)
-
-    system.solid_lights[0].specular_color = (0.3281, 0.3281, 0.3281)
-    system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
-    gllightpreset_add("Turntable")
-    gllightpreset_save()
-
-    system.solid_lights[0].use = True
-    system.solid_lights[1].use = True
-    system.solid_lights[2].use = True
-
-    system.solid_lights[0].direction = (-0.2555, 0.5444, 0.7989)
-    system.solid_lights[1].direction = (0.5666, -0.7333, 0.3756)
-    system.solid_lights[2].direction = (-0.5142, 0.5142, -0.6864)
-
-    system.solid_lights[0].diffuse_color = (1.0, 0.9475, 0.3194)
-    system.solid_lights[1].diffuse_color = (0.3851, 0.2978, 0.1612)
-    system.solid_lights[2].diffuse_color = (1.0, 1.0, 1.0)
-
-    system.solid_lights[0].specular_color = (0.2740, 0.2740, 0.2740)
-    system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
-    system.solid_lights[2].specular_color = (0.0, 0.0, 0.0)
-    gllightpreset_add("Yellow Clay")
-    gllightpreset_save()
-    
-##########################################
-####### LightPreset Functions #######
-##########################################
-
-def gllightpreset_name(self, context):
-    global recursive
-    global renaming
-    global lastname
-    if recursive==True: return
-    recursive=True
-
-    tmp=self.name
-    self.name=self.name+"@temporaryname"
-    self.name=gllightpreset_checkname(tmp)
-    tmp=self.name
-    if renaming==True: gllightpreset_rename(lastname, tmp)
-    #gllightpreset_sort()
-
-    recursive=False
-    
-def gllightpreset_checkname(name):
-    collection=bpy.context.scene.quickprefs.gllightpreset
-    if name=="": name="Preset"
-
-    if not name in collection:
-        return name
-
-    pos = name.rfind(".")
-    if pos==-1:
-        name=name+".001"
-        pos=len(name)-4
-
-    for i in range(1, 1000):
-        nr="00"+str(i)
-        tmp=name[:pos+1]+nr[len(nr)-3:]
-        if not tmp in collection:
-            return tmp        
-    return "Preset.???"
-    
-def gllightpreset_rename(old, new):
-    for o in bpy.context.scene.quickprefs.objects:
-        if o.get("gllightpreset", "Default")==old:
-            o.gllightpreset=new
-
- at persistent            
-def gllightpreset_index(self, context):
-    global recursive
-    if recursive==True: return
-    recursive=True
-
-    scn=bpy.context.scene.quickprefs
-    
-    if scn.gllightpreset_index > len(scn.gllightpreset)-1:
-        scn.gllightpreset_index = len(scn.gllightpreset)-1
-
-    recursive=False
-
-def gllightpreset_add(name=""):
-    global renaming
-    renaming=False
-    
-    scn=bpy.context.scene.quickprefs
-
-    entry=scn.gllightpreset.add()
-    bpy.context.scene.quickprefs['gllightpreset_index']=len(scn.gllightpreset)-1
-    entry.name=gllightpreset_checkname(name)
-    
-    renaming=True
-    gllightpreset_save()
-       
-def gllightpreset_delete():
-    scn=bpy.context.scene
-    index=scn.quickprefs.gllightpreset_index
-    name=scn.quickprefs.gllightpreset[index].name
-    
-    for o in scn.objects:
-        if o.get("gllightpreset", "Default")==name:
-            o.gllightpreset="Default"
-    
-    scn.quickprefs.gllightpreset.remove(index)
-   
-    
-def gllightpreset_save():
-    index=bpy.context.scene.quickprefs.gllightpreset_index
-    name=bpy.context.scene.quickprefs.gllightpreset[index].name
-    
-    bpy.context.scene.quickprefs.gllightpreset[index].illuminated0 = bpy.context.user_preferences.system.solid_lights[0].use
-    bpy.context.scene.quickprefs.gllightpreset[index].illuminated1 = bpy.context.user_preferences.system.solid_lights[1].use
-    bpy.context.scene.quickprefs.gllightpreset[index].illuminated2 = bpy.context.user_preferences.system.solid_lights[2].use
-    
-    bpy.context.scene.quickprefs.gllightpreset[index].direction0 = bpy.context.user_preferences.system.solid_lights[0].direction
-    bpy.context.scene.quickprefs.gllightpreset[index].direction1 = bpy.context.user_preferences.system.solid_lights[1].direction
-    bpy.context.scene.quickprefs.gllightpreset[index].direction2 = bpy.context.user_preferences.system.solid_lights[2].direction
-    
-    bpy.context.scene.quickprefs.gllightpreset[index].diffuse0 = bpy.context.user_preferences.system.solid_lights[0].diffuse_color
-    bpy.context.scene.quickprefs.gllightpreset[index].diffuse1 = bpy.context.user_preferences.system.solid_lights[1].diffuse_color
-    bpy.context.scene.quickprefs.gllightpreset[index].diffuse2 = bpy.context.user_preferences.system.solid_lights[2].diffuse_color
-    
-    bpy.context.scene.quickprefs.gllightpreset[index].specular0 = bpy.context.user_preferences.system.solid_lights[0].specular_color
-    bpy.context.scene.quickprefs.gllightpreset[index].specular1 = bpy.context.user_preferences.system.solid_lights[1].specular_color
-    bpy.context.scene.quickprefs.gllightpreset[index].specular2 = bpy.context.user_preferences.system.solid_lights[2].specular_color
-        
-#select the current light    
-def gllightpreset_select():
-    index=bpy.context.scene.quickprefs.gllightpreset_index
-    name=bpy.context.scene.quickprefs.gllightpreset[index].name
-    
-    bpy.context.user_preferences.system.solid_lights[0].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated0
-    bpy.context.user_preferences.system.solid_lights[1].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated1
-    bpy.context.user_preferences.system.solid_lights[2].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated2
-    
-    bpy.context.user_preferences.system.solid_lights[0].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction0
-    bpy.context.user_preferences.system.solid_lights[1].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction1
-    bpy.context.user_preferences.system.solid_lights[2].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction2
-    
-    bpy.context.user_preferences.system.solid_lights[0].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse0
-    bpy.context.user_preferences.system.solid_lights[1].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse1
-    bpy.context.user_preferences.system.solid_lights[2].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse2
-    
-    bpy.context.user_preferences.system.solid_lights[0].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular0
-    bpy.context.user_preferences.system.solid_lights[1].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular1
-    bpy.context.user_preferences.system.solid_lights[2].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular2
-    
-#sort alphabetically
-def gllightpreset_sort():
-    collection=bpy.context.scene.quickprefs.gllightpreset
-    count=len(collection)
-    for i in range(0, count):
-        for j in range(i+1, count):
-            if collection[i].name > collection[j].name:
-                collection.move(j, i)
-
-#Add default setting
-def gllightpreset_addDefault():
-    print('adding default presets')  
-    gllightpreset_addPresets()
-    gllightpreset_sort();
-    bpy.context.scene.quickprefs['gllightpreset_index']=0
-    gllightpreset_select()
-
-##########################################
-####### Persistant functions##############
-##########################################       
-#This function decides where to load presets from - The order goes: BPY>File>Defaults
-#@persistent
-def gllightpreset_chooseLoadLocation(context):
-
-    filepath=bpy.context.scene.quickprefs.gllightpreset_importdirectory
-    if len(bpy.context.scene.quickprefs.gllightpreset)==0:                    #is it in bpy?
-          if not os.path.exists(filepath):                                                     #is it in the folder?
-               print('quickprefs: loading default presets')
-               gllightpreset_addDefault()                                                       #it's not, add the default
-          else:                                                                                             #the folder exists
-               directorylisting = os.listdir(filepath)
-               if len(directorylisting)==0:                                                      #is the folder empty?
-                    print('quickprefs: loading default presets')
-                    gllightpreset_addDefault()                                                  #the folder is empty, add default
-               else:                                                                                        #the folder is not empty
-                    print('quickprefs: loading preset folder')
-                    gllightpreset_loadpresets(1)                                                #go ahead and load it
-    #print('quickprefs: loading from bpy')
-
-#This function scans for changes of the index of the selected preset and updates the selection if needed
- at persistent
-def gllightpreset_scan(context):
-    global lastindex
-    if debug==0:
-        if lastindex!=bpy.context.scene.quickprefs.gllightpreset_index:
-            lastindex=bpy.context.scene.quickprefs.gllightpreset_index
-            gllightpreset_select()
-
-#This function loads all the presets from a given folder (stored in bpy)
- at persistent
-def gllightpreset_loadpresets(context):
-       gllightpreset_importall()
-       bpy.context.scene['gllightpreset_index']=0
-       gllightpreset_select()
-           
-##########################################
-####### GUI ##############################
-##########################################
-
-#This function defines the layout of the openGL lamps
-def opengl_lamp_buttons(column, lamp):
-    split = column.split(percentage=0.1)
-
-    split.prop(lamp, "use", text="", icon='OUTLINER_OB_LAMP' if lamp.use else 'LAMP_DATA')
-
-    col = split.column()
-    col.active = lamp.use
-    row = col.row()
-    row.label(text="Diffuse:")
-    row.prop(lamp, "diffuse_color", text="")
-    row = col.row()
-    row.label(text="Specular:")
-    row.prop(lamp, "specular_color", text="")
-
-    col = split.column()
-    col.active = lamp.use
-    col.prop(lamp, "direction", text="")
-
-class gllightpreset(bpy.types.PropertyGroup):
-
-    props=bpy.props
-    name = props.StringProperty(update=gllightpreset_name)
-    
-    illuminated0 = props.BoolProperty(default = True)
-    illuminated1 = props.BoolProperty(default = True)
-    illuminated2 = props.BoolProperty(default = True)
-    
-    direction0 = props.FloatVectorProperty(name="",  default=(-0.8920, 0.3000, 0.8999))
-    direction1 = props.FloatVectorProperty(name="",  default=(0.5880, 0.4600, 0.2480))
-    direction2 = props.FloatVectorProperty(name="",  default=(0.2159, -0.3920, -0.2159))
-    
-    diffuse0 = props.FloatVectorProperty(name="",  default=(0.8000, 0.8000, 0.8000))
-    diffuse1 = props.FloatVectorProperty(name="",  default=(0.4980, 0.5000, 0.6000))
-    diffuse2 = props.FloatVectorProperty(name="",  default=(0.7980, 0.8379, 1.0))
-    
-    specular0 = props.FloatVectorProperty(name="",  default=(0.5, 0.5, 0.5))
-    specular1 = props.FloatVectorProperty(name="",  default=(0.2000, 0.2000, 0.2000))
-    specular2 = props.FloatVectorProperty(name="",  default=(0.0659, 0.0, 0.0))
-
-    count = props.IntProperty(name="", default=0)
-    count2 = props.IntProperty(name="", default=0)
-
-class SCENE_OT_gllightpreset(bpy.types.Operator):
-    bl_label ="Preset Action"
-    bl_idname="gllightpreset.action"
-
-    #alias
-    
-
-    button=bpy.props.StringProperty(default="")
-
-    def execute(self, context):
-        scn=bpy.context.scene
-        button=self.button
-           
-        
-        if   button=="add":
-            gllightpreset_add()
-        elif button=="delete":   
-            if len(scn.quickprefs.gllightpreset)>1:
-                gllightpreset_delete()
-            else:
-                self.report({'INFO'}, "Must have at least 1 Preset")
-                
-        elif button=="save":     
-            gllightpreset_save()
-            self.report({'INFO'}, "Saved Preset to Blend File.")
-        elif button=="sort":     gllightpreset_sort()
-        elif button=="select":   gllightpreset_select()
-        elif button=="export":   
-            gllightpreset_exportsingle(scn.quickprefs.gllightpreset_index, False)
-            self.report({'INFO'}, "Exported Preset to: "+scn.quickprefs.gllightpreset_exportfile)
-        elif button=="exportall":
-            gllightpreset_exportall(1)
-            self.report({'INFO'}, "Exported Presets to: "+scn.quickprefs.gllightpreset_exportdirectory)
-        elif button=="import":   
-            if not os.path.isdir(scn.quickprefs.gllightpreset_importfile):
-                if not scn.quickprefs.gllightpreset_importdirectory=="":
-                    gllightpreset_importsingle(scn.quickprefs.gllightpreset_importfile)
-                else:
-                    self.report({'INFO'}, "Please choose a valid preset file")
-            else:
-                self.report({'INFO'}, "Please choose a valid preset file")
-        elif button=="importall":
-            gllightpreset_importall()
-            self.report({'INFO'}, "Imported Presets from: "+scn.quickprefs.gllightpreset_importdirectory)
-        elif button=="defaults":
-                gllightpreset_addDefault()
-  
-        if scn.quickprefs.gllightpreset_index > len(scn.quickprefs.gllightpreset)-1:
-            scn.quickprefs.gllightpreset_index = len(scn.quickprefs.gllightpreset)-1
-
-        return {"FINISHED"}
-         
-#Panel for tools
-class PANEL(bpy.types.Panel):
-    bl_label = 'Quick Preferences'
-    bl_space_type = 'VIEW_3D'
-    bl_context = "render"
-    bl_region_type = 'UI'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    
-    def draw(self, context):
-        global lastname
-    
-        #aliases
-        scn = bpy.context.scene.quickprefs
-        system = context.user_preferences.system
-        inputs = context.user_preferences.inputs
-        edit = context.user_preferences.edit
-        layout = self.layout
-        split = layout.split()
-        
-#Setup the OpenGL lights box
-#Draw the Lights
-        box = layout.box().column(align=False)
-        box.prop(scn,'gllights')
-        if scn.gllights:
-
-            split = box.split(percentage=0.1)
-            split.label()
-            split.label(text="Colors:")
-            split.label(text="Direction:")
-
-            lamp = system.solid_lights[0]
-            opengl_lamp_buttons(box, lamp)
-
-            lamp = system.solid_lights[1]
-            opengl_lamp_buttons(box, lamp)
-
-            lamp = system.solid_lights[2]
-            opengl_lamp_buttons(box, lamp)
-
-            box.separator()
-            
-#Draw the selection box        
-            split = box.split(percentage=0.7)
-            col = split.row()
-			#original
-            col.template_list("UI_UL_list", "", scn, "gllightpreset", scn, "gllightpreset_index", rows=5, maxrows=5)
-
-#Draw the buttons
-            split = split.split()
-            col = split.column()
-            col.operator("gllightpreset.action", icon="ZOOMIN", text="Add").button="add"
-            col.operator("gllightpreset.action", icon="ZOOMOUT", text="Delete").button="delete"
-            col.operator("gllightpreset.action", icon="FILE_TICK", text="Save to Blend").button="save"
-            col.operator("gllightpreset.action", icon="SORTALPHA", text="Sort").button="sort"
-            col.operator("gllightpreset.action", icon="SHORTDISPLAY", text="Add Defaults").button="defaults"                     
-            col=box.row()
-            col=col.column()
-#Draw the text box            
-            count=len(scn.gllightpreset)           
-            if count>0:
-                entry=scn.gllightpreset[scn.gllightpreset_index]
-                lastname=entry.name
-                
-                if entry.count==0: 
-                    col.prop(entry, "name", text="")
-                if entry.count> 0: 
-                    col.prop(entry, "name", text="")
-                if bpy.context.scene.objects.active != None:
-                    name=bpy.context.scene.objects.active.get("gllightpreset", "Default")
-#Draw the import/export part of the box                
-                col.prop(scn,'importexport')
-                if scn.importexport:
-                    split = box.split(percentage=0.5)
-                    col = split.column()
-                    col.label("Import Directory or File")
-                    col.prop(scn, 'gllightpreset_importfile')
-                    col.prop(scn, 'gllightpreset_importdirectory')
-                    col.label("Export Directory or File")
-                    col.prop(scn, 'gllightpreset_exportfile')
-                    col.prop(scn, 'gllightpreset_exportdirectory')
-                                
-                    split = split.split()
-                    col = split.column()
-                    
-                    col.label("")
-                    col.operator("gllightpreset.action", icon="IMPORT", text="Import File").button="import"
-                    col.operator("gllightpreset.action", icon="IMPORT", text="Import All").button="importall"  
-                    col.label("")
-                    col.operator("gllightpreset.action", icon="EXPORT", text="Export Selection").button="export"
-                    col.operator("gllightpreset.action", icon="EXPORT", text="Export All").button="exportall"
-                    
-                    
-#The second box containing interface options is here
-        #interface options   
-        box = layout.box().column(align=True)
-        box.prop(scn,'interface')
-        
-        
-        if scn.interface:
-            #Select with
-            boxrow=box.row()
-            boxrow.label(text="Select With:")
-            boxrow=box.row()
-            boxrow.prop(inputs, "select_mouse", expand=True)
-
-            #Orbit
-            boxrow=box.row()
-            boxrow.label(text="Orbit Style:")
-            boxrow=box.row()
-            boxrow.prop(inputs, "view_rotate_method", expand=True)
-        
-            #continuous grab
-            boxrow=box.row()
-            boxrow.prop(inputs, "use_mouse_continuous")
-
-            #Color Picker
-            boxrow=box.row()
-            boxrow.label(text="Color Picker Type")
-            boxrow=box.row()
-            boxrow.row().prop(system, "color_picker_type", text="")
-
-            #Align To
-            boxrow=box.row()
-            boxrow.label(text="Align New Objects To:")
-            boxrow=box.row()
-            boxrow.prop(edit, "object_align", text="")
-         
-##########################################
-####### Registration Functions ############
-##########################################
-class quickprefproperties(bpy.types.PropertyGroup):
-    @classmethod
-    def register(cls):
-            bpy.types.Scene.quickprefs = PointerProperty(
-                    name="QuickPrefs Settings",
-                    description="QuickPrefs render settings",
-                    type=cls,
-                    )
-            #strings for file IO       
-            cls.gllightpreset_importfile = StringProperty(name = "",
-                    subtype='FILE_PATH',
-                    default=defaultfilepath
-                    )
-                    
-            cls.gllightpreset_importdirectory = StringProperty(name = "",
-                    subtype='FILE_PATH',
-                    default=defaultfilepath
-                    )
-                    
-            cls.gllightpreset_exportfile = StringProperty(name = "",
-                    subtype='FILE_PATH',
-                    default=defaultfilepath
-                    )
-                    
-            cls.gllightpreset_exportdirectory = StringProperty(
-                    name = "",
-                    subtype='FILE_PATH',
-                    default=defaultfilepath
-                    )
-                    
-            cls.gllights = BoolProperty(
-                    name='Lights', 
-                    default=True
-                    )
-                    
-            cls.gllightPresets = BoolProperty(
-                    name='GL Light Presets', 
-                    default=True
-                    )
-                    
-            cls.interface = BoolProperty(
-                    name='Interface', 
-                    default=True
-                    )
-                    
-            cls.importexport = BoolProperty(
-                    name='Import/Export', 
-                    default=True
-                    )
-                    
-            cls.gllights = BoolProperty(
-                    name='Lights', 
-                    default=True
-                    )
-                    
-            #important storage of stuff
-            cls.gllightpreset = CollectionProperty(
-                    type=gllightpreset
-                    )
-                    
-            cls.gllightpreset_index = IntProperty(
-                    min=0, 
-                    default=0, 
-                    update=gllightpreset_index
-                    )
-                    
-    @classmethod
-    def unregister(cls):
-        del bpy.types.Scene.quickprefs 
-
- at persistent
-def setup(s):
-	#let the fun begin!
-    gllightpreset_chooseLoadLocation(1)
-    gllightpreset_scan(bpy.context)
-
-def register():
-    #aliases
-    handler=bpy.app.handlers
-
-    #register classes
-    bpy.utils.register_class(PANEL)
-    bpy.utils.register_class(gllightpreset)
-    bpy.utils.register_class(SCENE_OT_gllightpreset)
-    bpy.utils.register_class(quickprefproperties)
-
-    #handler.scene_update_pre.append(gllightpreset_scan)
-    handler.scene_update_pre.append(setup)
-    #handler.load_post.append(setup)     #was crashing blender on new file load - comment for now
-    
-    
-    
-           
-# unregistering and removing menus
-def unregister():
-    bpy.utils.unregister_class(PANEL)
-    bpy.utils.unregister_class(gllightpreset)
-    bpy.utils.unregister_class(SCENE_OT_gllightpreset)
-    bpy.utils.unregister_class(quickprefproperties)
-
-
-if __name__ == "__main__":
-    register()
-    
diff --git a/release/scripts/addons_contrib/space_view3d_simple_align.py b/release/scripts/addons_contrib/space_view3d_simple_align.py
deleted file mode 100644
index e270053..0000000
--- a/release/scripts/addons_contrib/space_view3d_simple_align.py
+++ /dev/null
@@ -1,341 +0,0 @@
-# AlingTools.py (c) 2009, 2010 Gabriel Beaudin (gabhead)
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Simple Align",
-    "author": "Gabriel Beaudin (gabhead)",
-    "version": (0,1),
-    "blender": (2, 61, 0),
-    "location": "View3D > Tool Shelf > Simple Align Panel",
-    "description": "Align Selected Objects to Active Object",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/3D interaction/Align_Tools",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=22389",
-    "category": "3D View"}
-
-"""Align Selected Objects"""
-
-import bpy
-
-
-class AlignUi(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Simple Align"
-    bl_context = "objectmode"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        layout = self.layout
-        obj = context.object
-
-        if obj != None:
-            row = layout.row()
-            row.label(text="Active object is: ", icon='OBJECT_DATA')
-            row = layout.row()
-            row.label(obj.name, icon='EDITMODE_HLT')
-        
-        layout.separator()
-        
-        col = layout.column()
-        col.label(text="Align Loc + Rot:", icon='MANIPUL')
-
-        
-        col = layout.column(align=False)
-        col.operator("object.align",text="XYZ")
-        
-        col = layout.column()
-        col.label(text="Align Location:", icon='MAN_TRANS')
-
-        col = layout.column_flow(columns=5,align=True)
-        col.operator("object.align_location_x",text="X")
-        col.operator("object.align_location_y",text="Y")
-        col.operator("object.align_location_z",text="Z")
-        col.operator("object.align_location_all",text="All")
-
-        col = layout.column()
-        col.label(text="Align Rotation:", icon='MAN_ROT')
-
-        col = layout.column_flow(columns=5,align=True)
-        col.operator("object.align_rotation_x",text="X")
-        col.operator("object.align_rotation_y",text="Y")
-        col.operator("object.align_rotation_z",text="Z")
-        col.operator("object.align_rotation_all",text="All")
-        
-        col = layout.column()
-        col.label(text="Align Scale:", icon='MAN_SCALE')
-
-        col = layout.column_flow(columns=5,align=True)
-        col.operator("object.align_objects_scale_x",text="X")
-        col.operator("object.align_objects_scale_y",text="Y")
-        col.operator("object.align_objects_scale_z",text="Z")
-        col.operator("object.align_objects_scale_all",text="All")
-
-
-##Align all
-def main(context):
-    for i in bpy.context.selected_objects:
-        i.location = bpy.context.active_object.location
-        i.rotation_euler = bpy.context.active_object.rotation_euler
-
-## Align Location
-
-def LocAll(context):
-    for i in bpy.context.selected_objects:
-        i.location = bpy.context.active_object.location
-
-def LocX(context):
-    for i in bpy.context.selected_objects:
-        i.location.x = bpy.context.active_object.location.x
-
-def LocY(context):
-    for i in bpy.context.selected_objects:
-        i.location.y = bpy.context.active_object.location.y
-
-def LocZ(context):
-    for i in bpy.context.selected_objects:
-        i.location.z = bpy.context.active_object.location.z
-
-## Aling Rotation
-def RotAll(context):
-    for i in bpy.context.selected_objects:
-        i.rotation_euler = bpy.context.active_object.rotation_euler
-
-def RotX(context):
-    for i in bpy.context.selected_objects:
-        i.rotation_euler.x = bpy.context.active_object.rotation_euler.x
-
-def RotY(context):
-    for i in bpy.context.selected_objects:
-        i.rotation_euler.y = bpy.context.active_object.rotation_euler.y
-
-def RotZ(context):
-    for i in bpy.context.selected_objects:
-        i.rotation_euler.z = bpy.context.active_object.rotation_euler.z
-## Aling Scale
-def ScaleAll(context):
-    for i in bpy.context.selected_objects:
-        i.scale = bpy.context.active_object.scale
-
-def ScaleX(context):
-    for i in bpy.context.selected_objects:
-        i.scale.x = bpy.context.active_object.scale.x
-
-def ScaleY(context):
-    for i in bpy.context.selected_objects:
-        i.scale.y = bpy.context.active_object.scale.y
-
-def ScaleZ(context):
-    for i in bpy.context.selected_objects:
-        i.scale.z = bpy.context.active_object.scale.z
-
-## Classes
-
-## Align All Rotation And Location
-class AlignOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align"
-    bl_label = "Align Selected To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        main(context)
-        return {'FINISHED'}
-
-#######################Align Location########################
-## Align LocationAll
-class AlignLocationOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_location_all"
-    bl_label = "Align Selected Location To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        LocAll(context)
-        return {'FINISHED'}
-## Align LocationX
-class AlignLocationXOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_location_x"
-    bl_label = "Align Selected Location X To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        LocX(context)
-        return {'FINISHED'}
-## Align LocationY
-class AlignLocationYOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_location_y"
-    bl_label = "Align Selected Location Y To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        LocY(context)
-        return {'FINISHED'}
-## Align LocationZ
-class AlignLocationZOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_location_z"
-    bl_label = "Align Selected Location Z To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        LocZ(context)
-        return {'FINISHED'}
-
-#######################Align Rotation########################
-## Align RotationAll
-class AlignRotationOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_rotation_all"
-    bl_label = "Align Selected Rotation To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        RotAll(context)
-        return {'FINISHED'}
-## Align RotationX
-class AlignRotationXOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_rotation_x"
-    bl_label = "Align Selected Rotation X To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        RotX(context)
-        return {'FINISHED'}
-## Align RotationY
-class AlignRotationYOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_rotation_y"
-    bl_label = "Align Selected Rotation Y To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        RotY(context)
-        return {'FINISHED'}
-## Align RotationZ
-class AlignRotationZOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_rotation_z"
-    bl_label = "Align Selected Rotation Z To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        RotZ(context)
-        return {'FINISHED'}
-#######################Align Scale########################
-## Scale All
-class AlignScaleOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_objects_scale_all"
-    bl_label = "Align Selected Scale To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        ScaleAll(context)
-        return {'FINISHED'}
-## Align ScaleX
-class AlignScaleXOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_objects_scale_x"
-    bl_label = "Align Selected Scale X To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        ScaleX(context)
-        return {'FINISHED'}
-## Align ScaleY
-class AlignScaleYOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_objects_scale_y"
-    bl_label = "Align Selected Scale Y To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        ScaleY(context)
-        return {'FINISHED'}
-## Align ScaleZ
-class AlignScaleZOperator(bpy.types.Operator):
-    """"""
-    bl_idname = "object.align_objects_scale_z"
-    bl_label = "Align Selected Scale Z To Active"
-
-    @classmethod
-    def poll(cls, context):
-        return context.active_object != None
-
-    def execute(self, context):
-        ScaleZ(context)
-        return {'FINISHED'}
-
-## registring
-def register():
-    bpy.utils.register_module(__name__)
-
-    pass
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    pass
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/system_cycles_material_text_node.py b/release/scripts/addons_contrib/system_cycles_material_text_node.py
deleted file mode 100644
index 68c6032..0000000
--- a/release/scripts/addons_contrib/system_cycles_material_text_node.py
+++ /dev/null
@@ -1,608 +0,0 @@
-# system_cycles_material_text_node.py Copyright (C) 5-mar-2012, Silvio Falcinelli 
-#
-# 
-# special thanks to user blenderartists.org cmomoney  
-# 
-#
-# Show Information About the Blend.
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Cycles Auto Material Texures Node Editor",
-    "author": "Silvio Falcinelli",
-    "version": (0,5),
-    "blender": (2, 62, 0),
-    "api": 44136,
-    "location": "Properties > Material > Automatic Node Editor ",
-    "description": "automatic cycles texture map",
-    "warning": "beta",
-    "wiki_url": 'http://www.rendering3d.net/' \
-        'scripts/materialedior',
-    "tracker_url": "https://projects.blender.org/tracker/index.php?" \
-        "func=detail&aid=????",
-    "category": "System"}
-
-
-import bpy
-import math
-from math import log
-from math import pow
-from math import exp
-import os.path
-
-
-
-def AutoNodeOff():
-    mats = bpy.data.materials
-    for cmat in mats:
-        cmat.use_nodes=False
-    bpy.context.scene.render.engine='BLENDER_RENDER'
-
-
-def BakingText(tex,mode):
-    print('________________________________________')
-    print('INFO start bake texture ' + tex.name)
-    bpy.ops.object.mode_set(mode='OBJECT')
-    sc=bpy.context.scene
-    tmat=''
-    img=''
-    Robj=bpy.context.active_object
-    for n in bpy.data.materials:
-
-        if n.name=='TMP_BAKING':
-            tmat=n
-   
-    if not tmat:
-        tmat = bpy.data.materials.new('TMP_BAKING')
-        tmat.name="TMP_BAKING"
-    
-    
-    bpy.ops.mesh.primitive_plane_add()
-    tm=bpy.context.active_object
-    tm.name="TMP_BAKING"
-    tm.data.name="TMP_BAKING"
-    bpy.ops.object.select_pattern(extend=False, pattern="TMP_BAKING", case_sensitive=False)
-    sc.objects.active = tm
-    bpy.context.scene.render.engine='BLENDER_RENDER'
-    tm.data.materials.append(tmat)
-    if len(tmat.texture_slots.items()) == 0:
-        tmat.texture_slots.add()
-    tmat.texture_slots[0].texture_coords='UV'
-    tmat.texture_slots[0].use_map_alpha=True
-    tmat.texture_slots[0].texture = tex.texture
-    tmat.texture_slots[0].use_map_alpha=True
-    tmat.texture_slots[0].use_map_color_diffuse=False
-    tmat.use_transparency=True
-    tmat.alpha=0
-    tmat.use_nodes=False
-    tmat.diffuse_color=1,1,1
-    bpy.ops.object.mode_set(mode='EDIT')
-    bpy.ops.uv.unwrap()
-
-    for n in bpy.data.images:
-        if n.name=='TMP_BAKING':
-            n.user_clear()
-            bpy.data.images.remove(n)
-
-
-    if mode == "ALPHA" and tex.texture.type=='IMAGE':
-        sizeX=tex.texture.image.size[0]
-        sizeY=tex.texture.image.size[1]
-    else:
-        sizeX=600
-        sizeY=600
-    bpy.ops.image.new(name="TMP_BAKING", width=sizeX, height=sizeY, color=(0.0, 0.0, 0.0, 1.0), alpha=True, uv_test_grid=False, float=False)
-    bpy.data.screens['UV Editing'].areas[1].spaces[0].image = bpy.data.images["TMP_BAKING"]
-    sc.render.engine='BLENDER_RENDER'
-    img = bpy.data.images["TMP_BAKING"]
-    img=bpy.data.images.get("TMP_BAKING")
-    img.file_format = "JPEG"
-    if mode == "ALPHA" and tex.texture.type=='IMAGE':
-        img.filepath_raw = tex.texture.image.filepath + "_BAKING.jpg"
-
-    else:
-        img.filepath_raw = tex.texture.name + "_PTEXT.jpg"
-    
-    sc.render.bake_type = 'ALPHA'
-    sc.render.use_bake_selected_to_active = True
-    sc.render.use_bake_clear = True
-    bpy.ops.object.bake_image()
-    img.save()
-    bpy.ops.object.mode_set(mode='OBJECT')
-    bpy.ops.object.delete() 
-    bpy.ops.object.select_pattern(extend=False, pattern=Robj.name, case_sensitive=False)           
-    sc.objects.active = Robj       
-    img.user_clear()
-    bpy.data.images.remove(img)
-    bpy.data.materials.remove(tmat)
-
-    print('INFO : end Bake ' + img.filepath_raw )
-    print('________________________________________')
-
-def AutoNode():
-    
-    mats = bpy.data.materials
-    sc = bpy.context.scene
-
-    for cmat in mats:
-
-        cmat.use_nodes=True
-        TreeNodes=cmat.node_tree
-        links = TreeNodes.links
-    
-        shader=''
-        shmix=''
-        shtsl=''
-        Add_Emission=''
-        Add_Translucent=''
-        Mix_Alpha=''        
-        sT=False
-        lock=True
-        
-        for n in TreeNodes.nodes:
-            if n.type == 'OUTPUT_MATERIAL':
-                if n.label == 'Lock':
-                    lock=False
-
-                    
-        if lock:        
-            for n in TreeNodes.nodes:
-                TreeNodes.nodes.remove(n)
-        
-     
-    
-            if not shader :
-                shader = TreeNodes.nodes.new('BSDF_DIFFUSE')    
-                shader.location = 0,470
-                 
-                shout = TreeNodes.nodes.new('OUTPUT_MATERIAL')
-                shout.location = 200,400          
-                links.new(shader.outputs[0],shout.inputs[0])
-                
-            textures = cmat.texture_slots
-            sM=True
-    
-            for tex in textures:
-                if tex:
-                    if tex.use:
-                        if tex.use_map_alpha:
-                            sM=False
-                            
-                            if sc.EXTRACT_ALPHA:
-                                
-                                if tex.texture.type =='IMAGE' and tex.texture.use_alpha: 
-                                    
-                                    if not os.path.exists(bpy.path.abspath(tex.texture.image.filepath + "_BAKING.jpg")) or sc.EXTRACT_OW:
-
-                                        BakingText(tex,'ALPHA')
-                                else:
-                                    if not tex.texture.type =='IMAGE': 
-                                    
-                                        if not os.path.exists(bpy.path.abspath(tex.texture.name + "_PTEXT.jpg")) or sc.EXTRACT_OW:
-    
-                                            BakingText(tex,'PTEXT')                                             
-                                    
-                            
-
-
-
-    
-            if  cmat.use_transparency and cmat.raytrace_transparency.ior == 1 and not cmat.raytrace_mirror.use  and sM:
-                if not shader.type == 'BSDF_TRANSPARENT':
-                    print("INFO:  Make TRANSPARENT shader node " + cmat.name)
-                    TreeNodes.nodes.remove(shader)
-                    shader = TreeNodes.nodes.new('BSDF_TRANSPARENT')    
-                    shader.location = 0,470
-                    links.new(shader.outputs[0],shout.inputs[0]) 
-    
-    
-    
-            if not cmat.raytrace_mirror.use and not cmat.use_transparency:
-                if not shader.type == 'BSDF_DIFFUSE':
-                    print("INFO:  Make DIFFUSE shader node" + cmat.name)
-                    TreeNodes.nodes.remove(shader)
-                    shader = TreeNodes.nodes.new('BSDF_DIFFUSE')    
-                    shader.location = 0,470
-                    links.new(shader.outputs[0],shout.inputs[0]) 
-                    
-                    
-    
-            if cmat.raytrace_mirror.use and cmat.raytrace_mirror.reflect_factor>0.001 and cmat.use_transparency:
-                if not shader.type == 'BSDF_GLASS':
-                    print("INFO:  Make GLASS shader node" + cmat.name)
-                    TreeNodes.nodes.remove(shader)
-                    shader = TreeNodes.nodes.new('BSDF_GLASS')  
-                    shader.location = 0,470
-                    links.new(shader.outputs[0],shout.inputs[0]) 
-    
-    
-    
-    
-            if cmat.raytrace_mirror.use and not cmat.use_transparency and cmat.raytrace_mirror.reflect_factor>0.001 :
-                if not shader.type == 'BSDF_GLOSSY':
-                    print("INFO:  Make MIRROR shader node" + cmat.name)
-                    TreeNodes.nodes.remove(shader)
-                    shader = TreeNodes.nodes.new('BSDF_GLOSSY') 
-                    shader.location = 0,520
-                    links.new(shader.outputs[0],shout.inputs[0]) 
-                    
-                    
-                            
-            if cmat.emit > 0.001 :
-                if not shader.type == 'EMISSION' and not cmat.raytrace_mirror.reflect_factor>0.001 and not cmat.use_transparency:
-                    print("INFO:  Mix EMISSION shader node" + cmat.name)
-                    TreeNodes.nodes.remove(shader)
-                    shader = TreeNodes.nodes.new('EMISSION')    
-                    shader.location = 0,450
-                    links.new(shader.outputs[0],shout.inputs[0])               
-                       
-                else:
-                    if not Add_Emission:
-                        print("INFO:  Add EMISSION shader node" + cmat.name)
-                        shout.location = 550,330
-                        Add_Emission = TreeNodes.nodes.new('ADD_SHADER')
-                        Add_Emission.location = 370,490
-                        
-                        shem = TreeNodes.nodes.new('EMISSION')
-                        shem.location = 180,380  
-                        
-                        links.new(Add_Emission.outputs[0],shout.inputs[0]) 
-                        links.new(shem.outputs[0],Add_Emission.inputs[1])
-                        links.new(shader.outputs[0],Add_Emission.inputs[0])
-                        
-                        shem.inputs['Color'].default_value=cmat.diffuse_color.r,cmat.diffuse_color.g,cmat.diffuse_color.b,1
-                        shem.inputs['Strength'].default_value=cmat.emit
-    
-                                   
-    
-    
-            if cmat.translucency > 0.001 : 
-                print("INFO:  Add BSDF_TRANSLUCENT shader node" + cmat.name)
-                shout.location = 770,330
-                Add_Translucent = TreeNodes.nodes.new('ADD_SHADER')
-                Add_Translucent.location = 580,490
-                        
-                shtsl = TreeNodes.nodes.new('BSDF_TRANSLUCENT')
-                shtsl.location = 400,350     
-                        
-                links.new(Add_Translucent.outputs[0],shout.inputs[0]) 
-                links.new(shtsl.outputs[0],Add_Translucent.inputs[1])
-    
-                
-                if Add_Emission:
-                    links.new(Add_Emission.outputs[0],Add_Translucent.inputs[0])
-     
-                    pass
-                else:
-    
-                    links.new(shader.outputs[0],Add_Translucent.inputs[0]) 
-                    pass               
-                shtsl.inputs['Color'].default_value=cmat.translucency, cmat.translucency,cmat.translucency,1                             
-          
-                       
-
-
-            shader.inputs['Color'].default_value=cmat.diffuse_color.r,cmat.diffuse_color.g,cmat.diffuse_color.b,1
-            
-            if shader.type=='BSDF_DIFFUSE':
-                shader.inputs['Roughness'].default_value=cmat.specular_intensity    
-                       
-            if shader.type=='BSDF_GLOSSY':
-                shader.inputs['Roughness'].default_value=1-cmat.raytrace_mirror.gloss_factor  
-                
-                
-            if shader.type=='BSDF_GLASS':
-                shader.inputs['Roughness'].default_value=1-cmat.raytrace_mirror.gloss_factor                   
-                shader.inputs['IOR'].default_value=cmat.raytrace_transparency.ior
-                
-                
-            if shader.type=='EMISSION':
-                shader.inputs['Strength'].default_value=cmat.emit              
-              
-                      
-                                  
-            textures = cmat.texture_slots
-            for tex in textures:
-                sT=False   
-                pText=''            
-                if tex:
-                    if tex.use:
-                        if tex.texture.type=='IMAGE':
-                            img = tex.texture.image
-                            shtext = TreeNodes.nodes.new('TEX_IMAGE')
-                            shtext.location = -200,400 
-                            shtext.image=img
-                            sT=True
-    
-
-               
-                            
-  
-                        if not tex.texture.type=='IMAGE':                           
-                            if sc.EXTRACT_PTEX:
-                                print('INFO : Extract Procedural Texture  ' )
-                                
-                                if not os.path.exists(bpy.path.abspath(tex.texture.name + "_PTEXT.jpg")) or sc.EXTRACT_OW:
-                                    BakingText(tex,'PTEX')    
-                                                     
-                                img=bpy.data.images.load(tex.texture.name + "_PTEXT.jpg")
-                                shtext = TreeNodes.nodes.new('TEX_IMAGE')
-                                shtext.location = -200,400 
-                                shtext.image=img                                
-                                sT=True
-                                                                     
-
-                if sT:
-                        if tex.use_map_color_diffuse :
-                            links.new(shtext.outputs[0],shader.inputs[0]) 
-                            
-                                                
-                        if tex.use_map_emit:                            
-                            if not Add_Emission:
-                                print("INFO:  Mix EMISSION + Texure shader node " + cmat.name)
-                                
-                                intensity=0.5+(tex.emit_factor / 2)
-                                
-                                shout.location = 550,330
-                                Add_Emission = TreeNodes.nodes.new('ADD_SHADER')
-                                Add_Emission.name="Add_Emission"
-                                Add_Emission.location = 370,490
-                                
-                                shem = TreeNodes.nodes.new('EMISSION')
-                                shem.location = 180,380  
-                                
-                                links.new(Add_Emission.outputs[0],shout.inputs[0]) 
-                                links.new(shem.outputs[0],Add_Emission.inputs[1])
-                                links.new(shader.outputs[0],Add_Emission.inputs[0])
-                                
-                                shem.inputs['Color'].default_value=cmat.diffuse_color.r,cmat.diffuse_color.g,cmat.diffuse_color.b,1
-                                shem.inputs['Strength'].default_value=intensity * 2
-
-                            links.new(shtext.outputs[0],shem.inputs[0]) 
-
-
-                        if tex.use_map_mirror:   
-                            links.new(shader.inputs[0],shtext.outputs[0]) 
-
-
-                        if tex.use_map_translucency:
-                            if not Add_Translucent:   
-                                print("INFO:  Add Translucency + Texure shader node " + cmat.name)
-                                
-                                intensity=0.5+(tex.emit_factor / 2)
-                                
-                                shout.location = 550,330
-                                Add_Translucent = TreeNodes.nodes.new('ADD_SHADER')
-                                Add_Translucent.name="Add_Translucent"
-                                Add_Translucent.location = 370,290
-                                
-                                shtsl = TreeNodes.nodes.new('BSDF_TRANSLUCENT')
-                                shtsl.location = 180,240     
-                                
-                                links.new(shtsl.outputs[0],Add_Translucent.inputs[1])
-                                
-                                if Add_Emission:
-                                    links.new(Add_Translucent.outputs[0],shout.inputs[0]) 
-                                    links.new(Add_Emission.outputs[0],Add_Translucent.inputs[0]) 
-                                    pass
-                                else:
-                                    links.new(Add_Translucent.outputs[0],shout.inputs[0]) 
-                                    links.new(shader.outputs[0],Add_Translucent.inputs[0])
-                                                            
-                            links.new(shtext.outputs[0],shtsl.inputs[0]) 
-                            
-
-                        if tex.use_map_alpha:
-                            if not Mix_Alpha:   
-                                print("INFO:  Mix Alpha + Texure shader node " + cmat.name)
-
-                                shout.location = 750,330
-                                Mix_Alpha = TreeNodes.nodes.new('MIX_SHADER')
-                                Mix_Alpha.name="Add_Alpha"
-                                Mix_Alpha.location = 570,290
-                                sMask = TreeNodes.nodes.new('BSDF_TRANSPARENT') 
-                                sMask.location = 250,180                                
-                                tMask = TreeNodes.nodes.new('TEX_IMAGE')
-                                tMask.location = -200,250
-
-                                if tex.texture.type=='IMAGE':
-                                    if tex.texture.use_alpha:
-                                        imask=bpy.data.images.load(img.filepath+"_BAKING.jpg")       
-                                    else:  
-                                        imask=bpy.data.images.load(img.filepath)   
-                                else:
-                                    imask=bpy.data.images.load(img.name)         
-                                      
-
-                                tMask.image = imask
-                                links.new(Mix_Alpha.inputs[0],tMask.outputs[0])
-                                links.new(shout.inputs[0],Mix_Alpha.outputs[0])
-                                links.new(sMask.outputs[0],Mix_Alpha.inputs[1])
-                                
-                                if not Add_Emission and not Add_Translucent:
-                                    links.new(Mix_Alpha.inputs[2],shader.outputs[0])
-                                
-                                if Add_Emission and not Add_Translucent:
-                                    links.new(Mix_Alpha.inputs[2],Add_Emission.outputs[0])  
-                                
-                                if Add_Translucent:
-                                    links.new(Mix_Alpha.inputs[2],Add_Translucent.outputs[0])                                    
-                                    
-                                    
-                            
-                        if tex.use_map_normal:
-                            t = TreeNodes.nodes.new('RGBTOBW')
-                            t.location = -0,300 
-                            links.new(t.outputs[0],shout.inputs[2]) 
-                            links.new(shtext.outputs[0],t.inputs[0])    
-    bpy.context.scene.render.engine='CYCLES'                                                      
-                                                     
- 
-class mllock(bpy.types.Operator):
-    bl_idname = "ml.lock"
-    bl_label = "Lock"
-    bl_description = "Safe to overwrite of mssive BL conversion"
-    bl_register = True
-    bl_undo = True
-    @classmethod
-    def poll(cls, context):
-        return True
-    def execute(self, context):
-        cmat=bpy.context.selected_objects[0].active_material
-        TreeNodes=cmat.node_tree
-        links = TreeNodes.links
-        for n in TreeNodes.nodes:
-            if n.type == 'OUTPUT_MATERIAL':
-                if n.label == 'Lock':
-                    n.label=''
-                else:
-                    n.label='Lock'     
-
-
-
-
-        return {'FINISHED'}
- 
- 
-class mlrefresh(bpy.types.Operator):
-    bl_idname = "ml.refresh"
-    bl_label = "Refresh"
-    bl_description = "Refresh"
-    bl_register = True
-    bl_undo = True
-    @classmethod
-    def poll(cls, context):
-        return True
-    def execute(self, context):
-        AutoNode()
-        return {'FINISHED'}
-
-
-class mlrestore(bpy.types.Operator):
-    bl_idname = "ml.restore"
-    bl_label = "Restore"
-    bl_description = "Restore"
-    bl_register = True
-    bl_undo = True
-    @classmethod
-    def poll(cls, context):
-        return True
-    def execute(self, context):
-        AutoNodeOff()
-        return {'FINISHED'}
-
-from bpy.props import *
-sc = bpy.types.Scene
-sc.EXTRACT_ALPHA= BoolProperty(attr="EXTRACT_ALPHA",default= False)
-sc.EXTRACT_PTEX= BoolProperty(attr="EXTRACT_PTEX",default= False)
-sc.EXTRACT_OW= BoolProperty(attr="Overwrite",default= False)
-
-class OBJECT_PT_scenemassive(bpy.types.Panel):
-    bl_label = "Automatic Massive Material Nodes"
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "material"
-    
-
-    def draw(self, context):
-        sc = context.scene
-        t=''
-        lock=''
-        try:
-            cmat=bpy.context.selected_objects[0].active_material
-            t="Material : " + cmat.name
-            
-            
-            TreeNodes=cmat.node_tree
-            links = TreeNodes.links
-        
-      
-            lock=False
-            
-            for n in TreeNodes.nodes:
-                if n.type == 'OUTPUT_MATERIAL':
-                    if n.label == 'Lock':
-                        lock=True          
-            
-            
-        except:
-            pass    
-        
-        ob_cols = []
-        db_cols = []
-        layout = self.layout
-        row = layout.row()
-        row.prop(sc,"EXTRACT_ALPHA",text='Extract Alpha Texture  (slow)',icon='FORCE_TEXTURE')
-        row = layout.row()
-        row.prop(sc,"EXTRACT_PTEX",text='Extract Procedural Texture (slow)',icon='FORCE_TEXTURE')        
-        row = layout.row()
-        row.prop(sc,"EXTRACT_OW",text='Extract Texture Overwrite') 
-        row = layout.row()
-        row = layout.row()
-        l_row = layout.row()
-        ob_cols.append(l_row.column())
-        layout.separator()
-        row = ob_cols[0].row() 
-        row.operator("ml.refresh", text='BLENDER > CYCLES', icon='TEXTURE')
-        layout.separator()
-        row = ob_cols[0].row() 
-        row.operator("ml.restore", text='BLENDER Mode  (Node Off)', icon='MATERIAL')        
-        layout.separator()
-        row = ob_cols[0].row() 
-        layout.separator()
-        layout.separator()
-        row = ob_cols[0].row() 
-        layout.separator()
-        row = ob_cols[0].row() 
-
-
-
-        if t:
-            row.label(text=t)
-            row.label(text='', icon='MATERIAL')
-            if lock:
-                row.operator("ml.lock", text="Lock" )
-            else:
-                row.operator("ml.lock", text="UnLock" ) 
-            
-        layout.separator()
-        row = ob_cols[0].row() 
-        layout.separator()          
-        row = ob_cols[0].row() 
-        layout.separator()
-        row = ob_cols[0].row() 
-        row.label(text="Ver 0,4 beta  blender 2.62 - 2.63    Silvio Falcinelli")
-        layout.separator()
-        row = ob_cols[0].row() 
-        row.label(text="wwww.rendering3d.net")
-
-
- 
-def register():
-    bpy.utils.register_module(__name__)
-    pass
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    pass
-
-if __name__ == "__main__":
-    register()
\ No newline at end of file
diff --git a/release/scripts/addons_contrib/system_keyboard_svg.py b/release/scripts/addons_contrib/system_keyboard_svg.py
deleted file mode 100644
index 83c08d0..0000000
--- a/release/scripts/addons_contrib/system_keyboard_svg.py
+++ /dev/null
@@ -1,273 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-# this script creates Keyboard layout images of the current keyboard configuration.
-# the result will be writen to the blender default directory.
-
-# first implementation done by jbakker
-
-bl_info = {
-    "name": "Keyboard Layout (svg)",
-    "author": "Jbakker",
-    "version": (0, 1),
-    "blender": (2, 60, 0),
-    "location": "",
-    "description": "Save the hotkeys as a .svg file (search: Keyboard)",
-    "warning": "may not work in recent svn",
-    "wiki_url": 'http://wiki.blender.org/index.php/Extensions:2.6/Py/' \
-        'Scripts/System/keymaps_to_svg',
-    "tracker_url": "https://projects.blender.org/tracker/index.php?" \
-        "func==detail&aid=21490",
-    "category": "System"}
-
-import bpy
-
-keyboard = (
-    ('`', 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE', 'ZERO', 'MINUS', 'EQUAL', 'BACKSPACE'),
-    ('TAB', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '(', ')', '\\'),
-    ('CAPSLOCK', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', "'", 'ENTER'),
-    ('SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/', 'SHIFT'),
-    ('CONTROL', 'OSKEY', 'ALT', 'SPACE', 'ALT', 'OSKEY', 'MENUKEY', 'CONTROL')
-    )
-
-# default dimension of a single key [width, heidgh]
-DEFAULT_KEY_DIMENSION = 100, 100
-# alternative dimensions of specufic keys [keyname,[width, height]]
-ALTERNATIVE_KEY_DIMENSIONS = {
-    'BACKSPACE': (250, 100),
-    'TAB': (175, 100),
-    '\\': (175, 100),
-    'CAPSLOCK': (225, 100),
-    'ENTER': (240, 100),
-    'SHIFT': (290, 100),
-    'CONTROL': (225, 100),
-    'ALT': (100, 100),
-    'OSKEY': (100, 100),
-    'MENUKEY': (100, 100),
-    'SPACE': (690, 100),
-}
-
-
-def createKeyboard(viewtype):
-    """
-    Creates a keyboard layout (.svg) file of the current configuration for a specific viewtype.
-    example of a viewtype is "VIEW_3D".
-    """
-    for keyconfig in bpy.data.window_managers[0].keyconfigs:
-        kc_map = {}
-        for keymap in keyconfig.keymaps:
-            if keymap.space_type == viewtype:
-                for key in keymap.keymap_items:
-                    if key.map_type == 'KEYBOARD':
-                        test = 0
-                        pre = []
-                        cont = ""
-                        if key.ctrl:
-                            test = test + 1
-                            cont = "C"
-                        if key.alt:
-                            test = test + 2
-                            cont = cont + "A"
-                        if key.shift:
-                            test = test + 4
-                            cont = cont + "S"
-                        if key.oskey:
-                            test = test + 8
-                            cont = cont + "O"
-                        if len(cont) > 0:
-                            cont = "[" + cont + "] "
-                        ktype = key.type
-                        if ktype not in kc_map:
-                            kc_map[ktype] = []
-                        kc_map[ktype].append((test, cont + key.name))
-
-        filename = "keyboard_%s.svg" % viewtype
-        print(filename)
-        svgfile = open(filename, "w")
-        svgfile.write("""<?xml version="1.0" standalone="no"?>
-    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-    """)
-        svgfile.write("""<svg width="2000" height="800" version="1.1" xmlns="http://www.w3.org/2000/svg">
-    """)
-        svgfile.write("""<style>
-    rect {
-        fill:rgb(192,192,192);
-        stroke-width:1;
-        stroke:rgb(0,0,0);
-    }
-    text.header {
-        font-size:xx-large;
-    }
-    text.key {
-        stroke-width:1;
-        stroke:rgb(0,0,0);
-    }
-    text.action {
-        font-size:smaller;
-    }
-    text.add0 {
-        font-size:smaller;
-        fill:rgb(0,0,0)
-    }
-    text.add1 {
-        font-size:smaller;
-        fill:rgb(255,0,0)
-    }
-    text.add2 {
-        font-size:smaller;
-        fill:rgb(0,255,0)
-    }
-    text.add3 {
-       font-size:smaller;
-       fill:rgb(128,128,0)
-    }
-    text.add4 {
-        font-size:smaller;
-        fill:rgb(0,0,255)
-    }
-    text.add5 {
-        font-size:smaller;
-        fill:rgb(128,0,128)
-    }
-    text.add6 {
-        font-size:smaller;
-        fill:rgb(0, 128, 128)
-    }
-    text.add7 {
-        font-size:smaller;
-        fill:rgb(128,128,128)
-    }
-    text.add8 {
-        font-size:smaller;
-        fill:rgb(128,128,128)
-    }
-    text.add9 {
-        font-size:smaller;
-        fill:rgb(255,128,128)
-    }
-    text.add10 {
-        font-size:smaller;
-        fill:rgb(128,255,128)
-    }
-    text.add11 {
-        font-size:smaller;
-        fill:rgb(255,255,128)
-    }
-    text.add12 {
-        font-size:smaller;
-        fill:rgb(128,128,255)
-    }
-    text.add13 {
-        font-size:smaller;
-        fill:rgb(255,128,255)
-    }
-    text.add14 {
-        font-size:smaller;
-        fill:rgb(128,255,255)
-    }
-    text.add15 {
-        font-size:smaller;
-        fill:rgb(255,255,128)
-    }
-    </style>
-    """)
-        svgfile.write("""<text class="header" x="100" y="24">keyboard layout - """ + viewtype + """</text>
-""")
-
-        x = 0
-        xgap = 15
-        ygap = 15
-        y = 32
-        for row in keyboard:
-            x = 0
-            for key in row:
-                width, height = ALTERNATIVE_KEY_DIMENSIONS.get(key, DEFAULT_KEY_DIMENSION)
-                tx = 16
-                ty = 16
-                svgfile.write("""<rect x=\"""" + str(x) +
-                              """\" y=\"""" + str(y) +
-                              """\" width=\"""" + str(width) +
-                              """\" height=\"""" + str(height) +
-                              """\" rx="20" ry="20" />
-    """)
-                svgfile.write("""<text class="key" x=\"""" + str(x + tx) +
-                              """\" y=\"""" + str(y + ty) +
-                              """\" width=\"""" + str(width) +
-                              """\" height=\"""" + str(height) + """\">
-    """)
-                svgfile.write(key)
-                svgfile.write("</text>")
-                ty = ty + 16
-                tx = 4
-                if key in kc_map:
-                    for a in kc_map[key]:
-                        svgfile.write("""<text class="add""" + str(a[0]) +
-                                      """" x=\"""" + str(x + tx) +
-                                      """\" y=\"""" + str(y + ty) +
-                                      """\" width=\"""" + str(width) +
-                                      """\" height=\"""" + str(height) + """\">
-    """)
-                        svgfile.write(a[1])
-                        svgfile.write("</text>")
-                        ty = ty + 16
-                x = x + width + xgap
-            y = y + 100 + ygap
-        svgfile.write("""</svg>""")
-        svgfile.flush()
-        svgfile.close()
-
-
-class WM_OT_Keyboardlayout(bpy.types.Operator):
-    """
-        Windows manager operator for keyboard leyout export
-    """
-    bl_idname = "wm.keyboardlayout"
-    bl_label = "Keyboard layout (SVG)"
-
-    def execute(self, context):
-        """
-        Iterate over all viewtypes to export the keyboard layout.
-        """
-        for vt in ('VIEW_3D',
-                   'LOGIC_EDITOR',
-                   'NODE_EDITOR',
-                   'CONSOLE',
-                   'GRAPH_EDITOR',
-                   'PROPERTIES',
-                   'SEQUENCE_EDITOR',
-                   'OUTLINER',
-                   'IMAGE_EDITOR',
-                   'TEXT_EDITOR',
-                   'DOPESHEET_EDITOR',
-                   'Window'):
-
-            createKeyboard(vt)
-        return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/system_project_folder.py b/release/scripts/addons_contrib/system_project_folder.py
deleted file mode 100644
index d791a35..0000000
--- a/release/scripts/addons_contrib/system_project_folder.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# system_project_folder.py (c) 2010 Dany Lebel (Axon_D)
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Project Folder",
-    "author": "Dany Lebel (Axon_D), Spirou4D",
-    "version": (0,3, 1),
-    "blender": (2, 61, 0),
-    "api": 43260,
-    "location": "Info -> File Menu -> Project Folder",
-    "description": "Open the project folder in a file browser",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/System/Project_Folder",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=25910",
-    "category": "System"}
-
-
-import bpy
-import os
-from platform import system as currentOS
-
-
-class ProjectFolder(bpy.types.Operator):
-    """Open the Project Folder in a file Browser"""
-    bl_idname = "file.project_folder"
-    bl_label = "Project Folder"
-    
-    
-    def execute(self, context):
-        try :
-            path = self.path()
-        except ValueError:
-            self.report({'INFO'}, "No project folder yet")
-            return {'FINISHED'}
-        
-        bpy.ops.wm.path_open(filepath=path)
-
-        
-        return {'FINISHED'}
-
-    def path(self):
-        filepath = bpy.data.filepath
-        relpath = bpy.path.relpath(filepath)
-        path = filepath[0: -1 * (relpath.__len__() - 2)]
-        return path
-
-
-# Registration
-
-def menu_func(self, context):
-    self.layout.operator(
-        ProjectFolder.bl_idname,
-        text="Project Folder", 
-        icon="FILESEL")
-
-def register():
-    bpy.utils.register_class(ProjectFolder)
-    bpy.types.INFO_MT_file.prepend(menu_func)
-
-def unregister():
-    bpy.utils.unregister_class(ProjectFolder)
-    bpy.types.INFO_MT_file.remove(menu_func)
-
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/text_editor_pasteall.py b/release/scripts/addons_contrib/text_editor_pasteall.py
deleted file mode 100644
index a25d535..0000000
--- a/release/scripts/addons_contrib/text_editor_pasteall.py
+++ /dev/null
@@ -1,221 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "PasteAll",
-    "author": "Dalai Felinto (dfelinto)",
-    "version": (0,7),
-    "blender": (2, 60, 0),
-    "location": "Text editor > Properties panel",
-    "description": "Send your selection or text to www.pasteall.org",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Text_Editor/PasteAll",
-    "tracker_url": "https://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=23493",
-    "category": "Text Editor"}
-
-# ########################################################
-# PasteAll.org Text Sender Script
-#
-# Dalai Felinto (dfelinto)
-# blenderecia.orgfree.com
-#
-# Rio de Janeiro - Brasil
-# Vancouver - Canada
-#
-# Original code: 23rd August 2010 (Blender 2.5.3 rev. 31525)
-#
-# Important Note:
-# This script is not official. I did it for fun and for my own usage.
-# And please do not abuse of their generosity - use it wisely (a.k.a no flood).
-#
-# ########################################################
-
-
-import bpy
-import urllib
-import urllib.request
-import webbrowser
-
-class TEXT_PT_pasteall(bpy.types.Panel):
-    bl_space_type = 'TEXT_EDITOR'
-    bl_region_type = 'UI'
-    bl_label = "PasteAll.org"
-
-    def draw(self, context):
-        layout = self.layout        
-        layout.operator("text.pasteall", icon='URL')
-        layout.prop(context.scene, "use_webbrowser")
-
-class TEXT_OT_pasteall(bpy.types.Operator):
-    """"""
-    bl_idname = "text.pasteall"
-    bl_label = "PasteAll.org"
-    bl_description = "Send the current text or selection to www.pasteall.org"
-
-    @classmethod
-    def poll(cls, context):
-        if context.area.type != 'TEXT_EDITOR':
-            return False
-        else:
-            return context.space_data.text != None
-
-    def invoke(self, context, event):
-        import webbrowser
-        st = context.space_data
-
-        # get the selected text
-        text = self.get_selected_text(st.text)
-        # if no text is selected send the whole file
-        if text is None: text = st.text.as_string()
-
-        # get the file type based on the extension
-        format = self.get_file_format(st.text)
-
-        # send the text and receive the returned page
-        html = self.send_text(text, format)
-
-        if html is None:
-            self.report({'ERROR'}, "Error in sending the text to the server.")
-            return {'CANCELLED'}
-
-        # get the link of the posted page
-        page = self.get_page(str(html))
-        
-        if page is None or page == "":
-            self.report({'ERROR'}, "Error in retrieving the page.")
-            return {'CANCELLED'}
-        else:
-            self.report({'INFO'}, page)
-
-        # store the link in the clipboard
-        bpy.context.window_manager.clipboard = page
-
-        if context.scene.use_webbrowser:
-            try:
-                webbrowser.open_new_tab(page)
-            except:
-                self.report({'WARNING'}, "Error in opening the page %s." % (page))
-
-        return {'FINISHED'}
-            
-    def send_text(self, text, format):
-        """"""
-        import urllib
-        url = "http://www.pasteall.org/index.php"
-        values = {  'action' : 'savepaste',
-                    'parent_id' : '0',
-                    'language_id': format,
-                    'code' : text }
-
-        try:
-            data = urllib.parse.urlencode(values).encode()
-            req = urllib.request.Request(url, data)
-            response = urllib.request.urlopen(req)
-            page_source = response.read()
-        except:
-            return None
-        else:
-            return page_source
-
-    def get_page(self, html):
-        """"""
-        id = html.find('directlink')
-        id_begin = id + 12 # hardcoded: directlink">
-        id_end = html[id_begin:].find("</a>")
-
-        if id != -1 and id_end != -1:
-            return html[id_begin:id_begin + id_end]
-        else:
-            return None
-
-    def get_selected_text(self, text):
-        """"""
-        current_line = text.current_line
-        select_end_line = text.select_end_line
-        
-        current_character = text.current_character
-        select_end_character = text.select_end_character
-        
-        # if there is no selected text return None
-        if current_line == select_end_line:
-            if current_character == select_end_character:
-                return None
-            else:
-                return current_line.body[min(current_character,select_end_character):max(current_character,select_end_character)]
-
-        text_return = None
-        writing = False
-        normal_order = True # selection from top to bottom
-
-        for line in text.lines:
-            if not writing:
-                if line == current_line:
-                    text_return = current_line.body[current_character:] + "\n"
-                    writing = True
-                    continue
-                elif line == select_end_line:
-                    text_return =  select_end_line.body[select_end_character:] + "\n"
-                    writing = True
-                    normal_order = False
-                    continue
-            else:
-                if normal_order:
-                    if line == select_end_line:
-                        text_return += select_end_line.body[:select_end_character]
-                        break
-                    else:
-                        text_return += line.body + "\n"
-                        continue
-                else:
-                    if line == current_line:
-                        text_return += current_line.body[:current_character]
-                        break
-                    else:
-                        text_return += line.body + "\n"
-                        continue
-
-        return text_return
-    
-    def get_file_format(self, text):
-        """Try to guess what is the format based on the file extension"""
-        extensions =   {'diff':'24',
-                        'patch':'24',
-                        'py':'62',
-                        'c':'12',
-                        'cpp':'18'}
-
-        type = text.name.split(".")[-1]
-        return extensions.get(type, '0')
-
-def register():
-    bpy.types.Scene.use_webbrowser = bpy.props.BoolProperty(
-        name='Launch Browser',
-        description='Opens the page with the submitted text.',
-        default=True)
-
-    bpy.utils.register_module(__name__)
-
-def unregister():
-    del bpy.types.Scene.use_webbrowser
-    bpy.utils.unregister_module(__name__)
-
-if __name__ == "__main__":
-    register()
-
-
diff --git a/release/scripts/addons_contrib/text_intellisense.py b/release/scripts/addons_contrib/text_intellisense.py
deleted file mode 100644
index 5b93017..0000000
--- a/release/scripts/addons_contrib/text_intellisense.py
+++ /dev/null
@@ -1,436 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-
-bl_info = {
-    "name": "Intellisense for Text Editor",
-    "author": "Mackraken",
-    "version": (0, 2),
-    "blender": (2, 60, 0),
-    "api": 41851,
-    "location": "Ctrl + Space at Text Editor",
-    "description": "Adds intellense to the Text Editor",
-    "warning": "Only works with 2.57 intellisense",
-    "wiki_url": "",
-    "tracker_url": "",
-    "category": "Development"}
-
-import bpy
-
-def complete(context):
-	from console import intellisense
-	from console_python import get_console
-	
-	sc = context.space_data
-	text = sc.text
-	
-	region = context.region
-	for area in context.screen.areas:
-		if area.type=="CONSOLE":
-			region = area.regions[1]
-			break
-	
-	console = get_console(hash(region))[0]
-
-	line = text.current_line.body
-	cursor = text.current_character
-	
-	result  = intellisense.expand(line, cursor, console.locals, bpy.app.debug)
-	
-	return result
-
-	
-class Intellimenu(bpy.types.Menu):
-	bl_label = ""
-	bl_idname = "IntelliMenu"
-	
-	text = ""
-	
-	def draw(self, context):
-		layout = self.layout
-		#Very ugly see how can i fix this
-		options = complete(context)
-		
-		options = options[2].split("  ")
-		for op in options:
-			layout.operator("text.intellioptions", text=op).text=op
-		
-#This operator executes when hits Ctrl+Space at the text editor
-
-class Intellisense(bpy.types.Operator):
-	#"""Tooltip"""
-	bl_idname = "text.intellisense"
-	bl_label = "Text Editor Intellisense"
-	
-	text = ""
-	
-#	@classmethod
-#	def poll(cls, context):
-#		return context.active_object is not None
-
-	def execute(self, context):
-		sc = context.space_data
-		text = sc.text
-		
-		if text.current_character>0:
-			result = complete(context)
-	
-			#print(result)
-			
-			if result[2]=="":
-				text.current_line.body = result[0]
-				bpy.ops.text.move(type='LINE_END')
-			else:
-				bpy.ops.wm.call_menu(name=Intellimenu.bl_idname)
-
-		return {'FINISHED'}
-	
-#this operator completes the line with the options you choose from the menu
-class Intellioptions(bpy.types.Operator):
-	#"""Tooltip"""
-	bl_idname = "text.intellioptions"
-	bl_label = "Intellisense options"
-
-	text = bpy.props.StringProperty()
-	
-	@classmethod
-	def poll(cls, context):
-		return context.active_object is not None
-
-	def execute(self, context):
-		sc = context.space_data
-		text = sc.text
-		
-		comp = self.text
-		line = text.current_line.body
-		
-		lline = len(line)
-		lcomp = len(comp)
-		
-		#intersect text 
-		intersect = [-1,-1]
-		
-		for i in range(lcomp):
-			val1 = comp[0:i+1]
-			
-			for j in range(lline):
-				val2 = line[lline-j-1::]
-				#print("	",j, val2)
-			
-				if val1==val2:
-					intersect = [i, j]
-					break
-				
-		if intersect[0]>-1:
-			newline = line[0:lline-intersect[1]-1]+comp
-		else:
-			newline = line + comp
-			
-		#print(newline)		
-		text.current_line.body = newline
-			
-		bpy.ops.text.move(type='LINE_END')
-		   
-
-		return {'FINISHED'}
-
-def send_console(context, all=0):
-	
-	sc = context.space_data
-	text = sc.text
-	
-	console = None
-	
-	for area in bpy.context.screen.areas:
-		if area.type=="CONSOLE":
-			from console_python import get_console
-				
-			console = get_console(hash(area.regions[1]))[0]
-
-	if console==None:
-		return {'FINISHED'}
-	
-	if all:
-		
-		for l in text.lines:
-			console.push(l.body)
-			
-	else:
-		#print(console.prompt)
-		console.push(text.current_line.body)
-	
-	
-	
-	
-class TestLine(bpy.types.Operator):
-	#"""Tooltip"""
-	bl_idname = "text.test_line"
-	bl_label = "Test line"
-
-	all = bpy.props.BoolProperty(default=False)
-	
-	
-#   @classmethod
-#   def poll(cls, context):
-#	   return context.active_object is not None
-
-	def execute(self, context):
-		#print("test line")
-		
-		#send_console(context, self.all)
-		sc = context.space_data
-		text = sc.text
-		
-		line = text.current_line.body
-		console = None
-		
-		for area in bpy.context.screen.areas:
-			if area.type=="CONSOLE":
-				from console_python import get_console
-					
-				console = get_console(hash(area.regions[1]))[0]
-		
-		if console==None:
-			return {'FINISHED'}
-				
-		command = ""
-			
-		forindex = line.find("for ")
-		if forindex >-1:
-			
-			var = line[forindex+4:-1]
-			var = var[0:var.find(" ")]
-			state = line[line.rindex(" ")+1:-1]
-			 
-			command = var + " = " +state+"[0]"
-			
-				
-		else:
-			command = line
-			
-		#print(command)
-		try:
-			console.push(command)
-		except:
-			pass
-		
-		bpy.ops.text.line_break()
-		
-
-		return {'FINISHED'}
-class SetBreakPoint(bpy.types.Operator):
-	bl_idname = "text.set_breakpoint"
-	bl_label = "Set Breakpoint"
-	
-	def execute(self, context):
-		
-		sc = bpy.context.space_data
-		text = sc.text
-		
-		line = text.current_line
-		br = " #breakpoint"
-		#print(line.body.find(br))
-		if line.body.find(br)>-1:
-			
-			line.body = line.body.replace(br, "")
-		else:
-			
-			line.body += br
-		
-		return {'FINISHED'}
-
-class Debug(bpy.types.Operator):
-	bl_idname = "text.debug"
-	bl_label = "Debug"
-	
-	def execute(self, context):
-		
-		binpath = bpy.app.binary_path
-			
-		addonspath = binpath[0:binpath.rindex("\\")+1]+str(bpy.app.version[0])+"."+str(bpy.app.version[1])+"\\scripts\\addons\\"
-		
-		print(addonspath)
-			
-		sc = context.space_data
-		text = sc.text
-		
-		br = " #breakpoint"
-	
-		filepath = addonspath+"debug.py"
-		file = open(filepath, "w")
-		file.write("import pdb\n")
-		
-		for line in text.lines:
-			l = line.body
-			
-			if line.body.find(br)>-1:
-				indent = ""
-				for letter in line.body:
-					
-					if not letter.isalpha():
-						indent+=letter
-					else:
-						break
-				file.write(l[0:-len(br)]+"\n")
-				
-				file.write(indent+"pdb.set_trace()\n")
-				
-			else:
-				file.write(line.body+"\n")
-						
-				
-		
-		file.close()
-		
-		import pdb
-		import debug
-		
-		pdb.runcall("debug")	
-		
-		
-		return {'FINISHED'}
-
-
-class DebugPanel(bpy.types.Panel):
-	bl_label = "Debug"
-	bl_idname = "text.test_line"
-	bl_space_type = "TEXT_EDITOR"
-	bl_region_type = "UI"
-	#bl_context = "object"
-
-	text = bpy.props.StringProperty()
-	
-	def draw(self, context):
-		layout = self.layout
-		row = layout.row()
-		
-		text = self.text
-		row = layout.row()
-		row.operator("text.debug", text ="Debug")
-		row = layout.row()
-		row.operator("text.set_breakpoint")
-		row = layout.row()
-		row.operator("text.test_line").all=False
-		row = layout.row()
-		row.operator("text.test_line", text ="Test All").all=True
-		
-		row = layout.row()
-		row.label(text="Coming Soon ...")
-
-
-### ASSIGN A KEY
- 
-#section = Input section. "Window, Text, ..."
-#name = operator name or wm.call_menu 
-#type = key 
-#event = keyboard event (Press, release, ...)
-#mods = array containing key modifiers (["ctrl", "alt", "shift"]
-#propvalue = menu name, if name is set to "wm.call_menu"
-#overwrite doesnt work at the moment
-
-def assignKey(section, name, type, event, mods=[],propvalue = "",  overwrite=0):
-	
-	kconf = bpy.context.window_manager.keyconfigs.active
-	
-	
-	#check section
-	validsections = [item.name for item in kconf.keymaps]
-	if not section in validsections:
-		print(section  + " is not a valid section.")
-		#print(validsections)	
-		return False
-	
-	#check type
-	type = type.upper()
-	validkeys = [item.identifier for item in bpy.types.KeyMapItem.bl_rna.properties['type'].enum_items]
-	if not type in validkeys:
-		print(type + " is not a valid key.")
-		#print(validkeys)
-		return False
-
-
-	#check event
-	event = event.upper()   
-	validevents = [item.identifier for item in bpy.types.KeyMapItem.bl_rna.properties['value'].enum_items]
-	if not event in validevents:
-		print(event + " is not a valid event.")
-		#print(validevents)
-		
-	kmap = kconf.keymaps[section] 
-
-	
-#   get mods
-	for i, mod in enumerate(mods):
-		mods[i]= mod.lower()
-		
-	#any, shift, ctrl, alt, oskey
-	kmod = [False, False, False, False, False]
-	
-	if "any" in mods: kmod[0] = True
-	if "shift" in mods: kmod[1] = True
-	if "ctrl" in mods: kmod[2] = True
-	if "alt" in mods: kmod[3] = True
-	if "oskey" in mods: kmod[4] = True
-	
-#   #check if key exist
-	kexists = False
-  
-	for key in kmap.keymap_items:
-		keymods = [key.any, key.shift, key.ctrl, key.alt, key.oskey]
-		if key.type == type and keymods == kmod:
-			kexists = True
-			print(key,"key exists")
-			break
-			
-	if kexists:
-		#overwrite?
-		if overwrite:
-			key.idname=name
-			
-			#key.type = type
-		
-	else:
-		#create key
-		key = kmap.keymap_items.new(name, type, event, False)
-		key.any = kmod[0]
-		key.shift = kmod[1]
-		key.ctrl = kmod[2]
-		key.alt = kmod[3]
-		key.oskey = kmod[4]
-				
-		if propvalue!="": key.properties.name = propvalue
-
-
-
-
-classes = [Intellisense, Intellioptions, Intellimenu, DebugPanel, TestLine, SetBreakPoint, Debug]
-
-def register():
-	
-	for c in classes:
-		bpy.utils.register_class(c)
-
-	assignKey("Text", "text.intellisense", "SPACE", "Press",  ["ctrl"])
-	assignKey("Text", "text.test_line", "RET", "Press", [],"",1)
-
-def unregister():
-	for c in classes:
-		bpy.utils.unregister_class(c)
-
-if __name__ == "__main__":
-	register()
diff --git a/release/scripts/addons_contrib/ui_layer_manager.py b/release/scripts/addons_contrib/ui_layer_manager.py
deleted file mode 100644
index 553d5df..0000000
--- a/release/scripts/addons_contrib/ui_layer_manager.py
+++ /dev/null
@@ -1,762 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-#
-bl_info = {
-    "name": "Layer Management",
-    "author": "Alfonso Annarumma",
-    "version": (1,4),
-    "blender": (2, 63, 0),
-    "location": "View3D > Properties panel > Layer Management",
-    "warning": "",
-    "description": "Display and Edit Layer Name",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/3D_interaction/layer_manager",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"
-                   "func=detail&aid=32472",
-    "category": "3D View"}
-    
-import bpy
-from bpy.props import StringProperty, BoolProperty, IntProperty, CollectionProperty, BoolVectorProperty
-
-EDIT = ["EDIT_MESH", "EDIT_CURVE", "EDIT_SURFACE", "EDIT_METABALL", "EDIT_TEXT", "EDIT_ARMATURE"]
-
-class LayerGroups(bpy.types.PropertyGroup):
-    
-    toggle    = BoolProperty(name="",default=False)
-    
-    lock    = BoolProperty(name="",default=False)
-
-    layer_groups = BoolVectorProperty(name="Layer Groups", default = ([False]*20), size=20, subtype='LAYER')
-    
-    # A list of identifiers (colon-separated strings) which property’s controls should be displayed
-    # in a template_list.
-    # Note that the order is respected.
-    #template_list_controls = StringProperty(default="toggle", options={"HIDDEN"})
- 
-bpy.utils.register_class(LayerGroups)
- 
-bpy.types.Scene.layergroups = CollectionProperty(type=LayerGroups)
-# Unused, but this is needed for the TemplateList to work…
-bpy.types.Scene.layergroups_index = IntProperty(default=-1)
-
-class RemoveLayerGroup(bpy.types.Operator):
-    '''Tooltip'''
-    bl_idname = "object.layergroup_remove"
-    bl_label = "Remove select Layer Group"
-    
-    index_group = bpy.props.IntProperty()
-    
-    @classmethod
-    def poll(cls, context):
-        return context.scene is not None
-
-    def execute(self, context):
-        scene = context.scene
-        
-        index_group =self.index_group
-        
-        scene.layergroups.remove(index_group)
-       
-        scene.layergroups_index= index_group-1
-        
-        return {'FINISHED'}
-
-class AddLayerGroup(bpy.types.Operator):
-    '''Tooltip'''
-    bl_idname = "object.layergroup_add"
-    bl_label = "Add select Layer group"
-    
-    index = bpy.props.IntProperty()
-    layer = layer = BoolVectorProperty(name="Layer", default = ([False]*20), size=20)
-    
-    @classmethod
-    def poll(cls, context):
-        return context.scene is not None
-
-    def execute(self, context):
-        
-        scene = context.scene
-        layergroups = scene.layergroups
-        
-        index = self.index
-        layer = self.layer
-        
-        item = layergroups.add()
-        index_number= str(index)
-
-        if len(index_number)==2:
-            index_number = "0"+index_number
-            if len(index_number)==3:
-                index_number = index_number
-        else:
-            index_number = "00"+index_number
-        item.name= 'LayerGroup.'+index_number
-        #item.use=True
-        scene.layergroups_index= index
-        scene.layergroups[index].layer_groups = layer
-        
-        return {'FINISHED'}
-
-class LayerToggle(bpy.types.Operator):
-    '''Visualize this Layer, Shift-Click to select multiple layers'''
-    bl_idname = "object.layertoggle"
-    bl_label = "Visualize this layer"
-    
-    #prop definition
-    #layer number
-    layerN = bpy.props.IntProperty()
-    spacecheck = bpy.props.BoolProperty()
-    index_group = bpy.props.IntProperty()
-
-    @classmethod
- 
-    def poll(cls, context):
-        
-        return context.scene
-
-    def execute(self, context):
-
-        spacecheck = self.spacecheck
-        scene = context.scene
-        
-        layerN = self.layerN
-
-        if spacecheck:
-            
-            space = context.area.spaces.active
-        else:
-            space = context.scene
-
-        if layerN==-1:
-            index = self.index_group
-            groups = scene.layergroups[index].layer_groups
-            layergroups = scene.layergroups[index]
-            
-            layers = space.layers
-            union= [False]*20
-            
-            if not layergroups.toggle:
-                for i in range(0,20):
-                    
-                    union[i]= groups[i] or layers[i]
-
-                space.layers=union  
-                layergroups.toggle=True
-            else:
-                for i in range(0,20):
-                    
-                    union[i]=  not groups[i]  and layers[i]
-
-                space.layers=union  
-                layergroups.toggle=False
-                        
-        else:
-        
-            if self.shift:
-                
-                if space.layers[layerN]:
-                    toggle = False
-                else:
-
-                    toggle= True                            
-                space.layers[layerN]=toggle
-            
-            else:
-
-                layer = [False]*20
-                layer[layerN]=True
-                space.layers=layer
-
-                if space.layers[layerN]:
-                    toggle = False   
-
-        return {'FINISHED'}
-    def invoke(self, context, event):
-        self.shift = event.shift
-        
-        return self.execute(context)
-
-class MergeSelected(bpy.types.Operator):
-    '''Move Selected Objects in this Layer Shift-Click to select multiple layers'''
-    bl_idname = "object.mergeselected"
-    bl_label = "Merge Selected object in this layer"
-    
-    #prop definition
-    #layer number
-    layerN = bpy.props.IntProperty()
-
-    @classmethod
- 
-    def poll(cls, context):
-        
-        return context.scene
-
-    def execute(self, context):
-        
-        layerN = self.layerN
-        
-        scene= context.scene
-           
-        #cyecle all object in the layer 
-        
-        for obj in scene.objects:
-            
-            if obj.select:
-                visible=False
-                
-                for i in range(0,20):
-                    if obj.layers[i] and scene.layers[i]:
-                        visible=True
-                        break
-               
-                if visible:
-                    if self.shift:
-                        
-                        if obj.layers[layerN]:
-                            toggle = False
-                        else:
-
-                            toggle= True                            
-                        obj.layers[layerN]=toggle
-                    
-                    else:
-
-                        layer = [False]*20
-                        layer[layerN]=True
-                        obj.layers=layer
-
-                        if obj.layers[layerN]:
-                            toggle = False   
-
-        return {'FINISHED'}
-    
-    def invoke(self, context, event):
-        self.shift = event.shift
-        
-        return self.execute(context)
-
-class LockSelected(bpy.types.Operator):
-    '''Loock All Objects on this Layer'''
-    bl_idname = "object.lockselected"
-    bl_label = "Hide Select of Selected"
-    
-    #prop definition
-    #layer number
-    layerN = bpy.props.IntProperty()
-    
-    #lock status
-    lock = bpy.props.BoolProperty()
-
-    index_group = bpy.props.IntProperty()
-    
-    @classmethod
-    
-    def poll(cls, context):
-        
-        return context.scene
-
-    def execute(self, context):
-        
-        scene = context.scene
-        layerN = self.layerN
-        lock =self.lock  
-        
-        view_3d = context.area.spaces.active
-        
-        #check if layer have some thing
-        if view_3d.layers_used[layerN] or  layerN==-1:
-            
-            #cyecle all object in the layer 
-            for obj in context.scene.objects:
-                
-                if layerN==-1:
-                    
-                    index = self.index_group
-                    groups = scene.layergroups[index].layer_groups
-                    layers = obj.layers
-                    
-                    layergroup=[False]*20
-
-                    for i in range (0,20):
-                        layergroup[i]= layers[i] and groups[i]
-                    
-                    if True in layergroup:
-                        obj.hide_select=not lock
-                        obj.select=False
-
-                        scene.layergroups[index].lock=not lock
-
-                else:
-                    if obj.layers[layerN]:
-                        obj.hide_select=not lock
-                        obj.select=False
-
-                        scene.LockLayer[layerN]= not lock
-
-        return {'FINISHED'}
-
-class SelectObjectsLayer(bpy.types.Operator):
-    '''Select All the Objects on this Layer'''
-    bl_idname = "object.selectobjectslayer"
-    bl_label = "Select objects in Layer"
-    
-    select_obj = bpy.props.BoolProperty()
-    layerN = bpy.props.IntProperty()
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene
-
-    def execute(self, context):
-        
-        view_3d = context.area.spaces.active
-        select_obj= self.select_obj
-        layerN = self.layerN
-        scene = context.scene
-        i=0
-        s=0
-        #check if layer have some thing       
-        if view_3d.layers_used[layerN]:
-     
-            for obj in context.scene.objects:
-
-                if obj.layers[layerN]:
-                    i = i+1
-                if obj.layers[layerN] and obj.select:
-                    s = s+1
-
-            if s==i:
-                for obj in context.scene.objects:
-                        
-                    if obj.layers[layerN]:
-                        obj.select=False
-
-            else:
-                bpy.ops.object.select_by_layer(extend=True, layers=layerN+1)        
-
-        return {'FINISHED'}
-
-class AllLayersSelect(bpy.types.Operator):
-    '''Active all Layer in scene'''
-    bl_idname = "scene.layersselect"
-    bl_label = "Select All Layer"
-    
-    vis = bpy.props.BoolProperty()
-
-    @classmethod
-    def poll(cls, context):
-        return context.scene
-
-    def execute(self, context):
-        
-        scene = context.scene
-        vis = self.vis
-        #store the active layer
-        active = scene.active_layer
-        
-        view_3d = context.area.spaces.active
-                #check for lock camera and layer is active
-        if view_3d.lock_camera_and_layers is True:
-            space= scene
-
-        else:
-            space= view_3d         
-
-        if not vis:
-            for i in range (0,20):           
-            
-                 #keep selection of active layer
-                if active == i:
-                    space.layers[i]= True
-                
-                #deselect the other...
-                else: 
-                    space.layers[i]= False
-
-        else:
-            for i in range (0,20):     
-                #select all layer
-                space.layers[i]=True
-                
-            #after the cycle, deselect and select the previus active layer        
-            space.layers[active]=False
-            space.layers[active]=True
-        return {'FINISHED'}
-
-class LayerName(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Layer Management"
-    bl_idname = "_PT_rig_layers"
-    bl_options = {'DEFAULT_CLOSED'}
-    
-    # layer name prop definition
-    bpy.types.Scene.LayerName1 = bpy.props.StringProperty(name="Layer Name", default='layer1')
-    bpy.types.Scene.LayerName2 = bpy.props.StringProperty(name="Layer Name", default='layer2')
-    bpy.types.Scene.LayerName3 = bpy.props.StringProperty(name="Layer Name", default='layer3')
-    bpy.types.Scene.LayerName4 = bpy.props.StringProperty(name="Layer Name", default='layer4')
-    bpy.types.Scene.LayerName5 = bpy.props.StringProperty(name="Layer Name", default='layer5')
-    bpy.types.Scene.LayerName6 = bpy.props.StringProperty(name="Layer Name", default='layer6')
-    bpy.types.Scene.LayerName7 = bpy.props.StringProperty(name="Layer Name", default='layer7')
-    bpy.types.Scene.LayerName8 = bpy.props.StringProperty(name="Layer Name", default='layer8')
-    bpy.types.Scene.LayerName9 = bpy.props.StringProperty(name="Layer Name", default='layer9')
-    bpy.types.Scene.LayerName10 = bpy.props.StringProperty(name="Layer Name", default='layer10')
-    bpy.types.Scene.LayerName11 = bpy.props.StringProperty(name="Layer Name", default='layer11')
-    bpy.types.Scene.LayerName12 = bpy.props.StringProperty(name="Layer Name", default='layer12')
-    bpy.types.Scene.LayerName13 = bpy.props.StringProperty(name="Layer Name", default='layer13')
-    bpy.types.Scene.LayerName14 = bpy.props.StringProperty(name="Layer Name", default='layer14')
-    bpy.types.Scene.LayerName15 = bpy.props.StringProperty(name="Layer Name", default='layer15')
-    bpy.types.Scene.LayerName16 = bpy.props.StringProperty(name="Layer Name", default='layer16')
-    bpy.types.Scene.LayerName17 = bpy.props.StringProperty(name="Layer Name", default='layer17')
-    bpy.types.Scene.LayerName18 = bpy.props.StringProperty(name="Layer Name", default='layer18')
-    bpy.types.Scene.LayerName19 = bpy.props.StringProperty(name="Layer Name", default='layer19')
-    bpy.types.Scene.LayerName20 = bpy.props.StringProperty(name="Layer Name", default='layer20')
-    
-    #prop for hide empty
-    bpy.types.Scene.LayerVisibility = bpy.props.BoolProperty(name="Hide empty Layer", default=False)
-    
-    #prop for extra option
-    bpy.types.Scene.ExtraOptions = bpy.props.BoolProperty(name="Show extra options", default=True)
-    
-    #lock layer status
-    bpy.types.Scene.LockLayer = bpy.props.BoolVectorProperty(name="Lock Layer", default = ([False]*20), size=20)
-
-    #prop for show index
-    bpy.types.Scene.LayerIndex = bpy.props.BoolProperty(name="Show Index", default=False)
-   
-    #prop for show classic
-    bpy.types.Scene.Classic = bpy.props.BoolProperty(name="Classic", default=False,description="Use a classic layer selection visibility")
-    #Select object Status
-    bpy.types.Scene.ObjectSelect = bpy.props.BoolVectorProperty(name="Object Select", default = ([True]*20), size=20)
-      
-    #toggle for merge
-    #bpy.types.Scene.MergeToggle = bpy.props.BoolVectorProperty(name="Merge Toggle", default = (False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False), size=20)
-
-    @classmethod
-    def poll(self, context):
-        try:
-            return (context.mode not in EDIT)
-        except (AttributeError, KeyError, TypeError):
-            return False
-
-    def draw(self, context):
-
-        scene = context.scene
-
-        view_3d = context.area.spaces.active
-                #check for lock camera and layer is active
-        if view_3d.lock_camera_and_layers is True:
-            space= scene
-            spacecheck=False
-            
-        else:
-            space= view_3d  
-            spacecheck=True     
-        
-        #row = layout.row(align=True)
-
-        vis=False
-        allIcon='RESTRICT_VIEW_OFF'
-        allText="Isolate active"
-
-        #check if there is a layer off
-        for layer in space.layers:
-            
-            if not layer:
-                vis=True
-                allIcon='RESTRICT_VIEW_ON'
-                allText="All Visible"
-
-        layout = self.layout
-        column = layout.column()
-        row = column.row()
-        col2= row.column()
-           
-        #lock camera and layers button 
-           
-        col2.prop(view_3d, "lock_camera_and_layers", text="")
-        
-        #select all
-        
-        allView = col2.operator("scene.layersselect", emboss=False, icon=allIcon, text="")
-        allView.vis=vis
-        
-        col= row.column()  
-        col.alignment='RIGHT'
-        #classic
-        col.prop(scene, "Classic", text="Classic")
-        
-        #show extra option checkbox
-        
-        col.alignment='RIGHT'
-        col.prop(scene, "ExtraOptions", text="Options")
-
-        col1= row.column()  
-
-        #show index        
-        col1.prop(scene, "LayerIndex", text="Index")
-        
-        # hide empty
-
-        if context.object:
-            col1.alignment='RIGHT'
-            col1.prop(scene, "LayerVisibility", toggle=False, text="Hide Empty")        
-
-        ##########
-
-        #list the layer
-        for i in range(0,20): 
-
-            #inizializing the icon 
-            #lockIcon='UNLOCKED'            
-            iconUsed= 'RADIOBUT_OFF'
-            iconAc='NONE'
-            iconLayer='NONE'
-            #selectIcon ='RESTRICT_SELECT_OFF'
-            #inizializing the bool value
-            noitem = False
-            
-            active=False
-            
-            layer=20
-            scene = context.scene
-            
-            extra = scene.ExtraOptions
-            
-            layer_used = view_3d.layers_used[i]
-            
-            #check the hide empty value
-            if scene.LayerVisibility:
-               
-                #find the empty layer                  
-                if layer_used:
-                    #print (i)
-                    layer = i
-                
-                    'Add ad object to see the layer' 
-            else:
-                layer=i
-                #the layer number
-                            
-            #set icon for lock layer
-            lock = scene.LockLayer[i]
-                     
-            if lock:
-                lockIcon= 'LOCKED'
-            else:
-                lockIcon= 'UNLOCKED'
-
-            #check if there are Selected obj in the layer
-
-            #check if layer have some thing       
-            if layer_used:
-               
-                iconUsed= 'LAYER_USED'
-                
-                active_object = context.object
-                
-                if active_object:
-                    
-                    if context.object.layers[i]:
-                        
-                        active = True     
-
-            else:
-                scene.ObjectSelect[i]= True
-
-            if layer ==i:
-
-                #check for active layer and set the icon 
-                if view_3d.lock_camera_and_layers:
-                   
-                    if scene.active_layer==layer:
-                        iconAc = 'FILE_TICK'
-                        noitem = True
-                
-                if active:
-                    iconUsed = 'LAYER_ACTIVE'
-
-                #set icon for layer view        
-                if view_3d.layers[layer]:
-                    viewIcon = 'RESTRICT_VIEW_OFF'
-                    noitem = True
-                else:
-                    viewIcon = 'RESTRICT_VIEW_ON'
-                    noitem = False
-
-                row2=column.row(align=True)
-#                if space==scene:
-#                    
-#                    colb1= row2.column()
-#                    #layer visibility operator   
-#                    tog = colb1.operator("view3d.layers", text="",icon=viewIcon, emboss=False)
-#                    tog.nr=layer+1
-#                    tog.toggle=True
-#                    viewemboss = True
-                
-                iconLayer=viewIcon
-
-                # layer index
-                if scene.LayerIndex:
-                    
-                    col6 = row2.column()
-                    col6.scale_x=0.14
-                    col6.label(text=str(i+1)+".")
-                
-                # visualization 
-                classic = scene.Classic
-                if not classic:
-                    
-                    colb2= row2.column()
-                    colb2.prop(space, "layers", index=layer, emboss=True, icon=iconLayer, toggle=True, text="")
-                else:    
-                    colb6 = row2.column() 
-                    used = colb6.operator("object.layertoggle", text="", icon= iconLayer, emboss=True)
-                    used.layerN=i
-                    used.spacecheck=spacecheck
-
-                #text prop
-                s = "LayerName"+str(i+1)
-                colb3= row2.column()
-                colb3.prop(scene,s,text="",icon=iconAc)
-
-                if extra:
-
-                    #Select by type operator
-                    colb4 = row2.column()
-                    select = colb4.operator("object.selectobjectslayer", icon='RESTRICT_SELECT_OFF',text="", emboss=True ) 
-                    select.layerN = i 
-                    #select.select_obj= selobj
-
-                    #lock operator 
-                    colb5 = row2.column()   
-                    lk = colb5.operator("object.lockselected", text="", emboss=True, icon= lockIcon)
-                    
-                    lk.layerN = i
-                    lk.lock=lock
-
-    #                #occuped layer
-    #                colb6.label(text="", icon=iconUsed)
-
-                    #merge layer
-                    colb7 = row2.column()
-                    merge = colb7.operator("object.mergeselected", text="", emboss=True, icon= iconUsed)
-                    merge.layerN=i
-
-                if not scene.LayerVisibility:
-                    if i==4 or i==9 or i==14 or i==19:
-                        row3 = column.row() 
-                        row3.separator()
-        if len(scene.objects)==0:            
-            layout.label(text='No objects in scene')
-class LayerGroupsUI(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Layer Groups"
-    bl_idname = "_PT_layer_group"
-    bl_options = {'DEFAULT_CLOSED'}     
-
-    @classmethod
-    def poll(self, context):
-        try:
-            return (context.mode not in EDIT)
-        except (AttributeError, KeyError, TypeError):
-            return False
-
-    def draw(self, context):
-
-        scene = context.scene
-        view_3d = context.area.spaces.active
-
-        #check for lock camera and layer is active
-        if view_3d.lock_camera_and_layers is True:
-            space= scene
-            spacecheck = False
-        else:
-            space= view_3d  
-            spacecheck = True   
-        #######################
-        
-        index_group =  scene.layergroups_index   
-        items =len(scene.layergroups) 
-        viewIcon = 'RESTRICT_VIEW_OFF'
-        layout = self.layout
-        row = layout.row()
-        row.template_list(context.scene, "layergroups", context.scene, "layergroups_index", rows=items)
-        col =row.column(align =True)
-        add = col.operator("object.layergroup_add", icon='ZOOMIN', text="")        
-        add.index= items
-        add.layer= scene.layers               
-        remove = col.operator("object.layergroup_remove", icon='ZOOMOUT', text="")
-        remove.index_group= index_group         
-        if index_group >= 0:
-
-            lock=scene.layergroups[index_group].lock
-            toggle = scene.layergroups[index_group].toggle
-            if lock:
-                iconLock= 'LOCKED'
-            else:
-                iconLock='UNLOCKED'
-            
-            lk = col.operator("object.lockselected", text="", emboss=True, icon= iconLock)                        
-            lk.index_group = index_group
-            lk.lock=lock
-            lk.layerN=-1
-
-            #set icon for layer view        
-            if toggle:
-                iconLayer = 'RESTRICT_VIEW_OFF'
-                #noitem = True
-            else:
-                iconLayer = 'RESTRICT_VIEW_ON'
-                #noitem = False
-            
-            view = col.operator("object.layertoggle", text="", icon= iconLayer, emboss=True)
-            view.index_group = index_group
-            view.layerN=-1
-            view.spacecheck=spacecheck
-
-            layout.prop(scene.layergroups[index_group], "layer_groups", text="", toggle=True)
-            layout.prop(scene.layergroups[index_group], "name", text="Name:")
- 
-def register():
-    
-    bpy.utils.register_class(AddLayerGroup)
-    bpy.utils.register_class(RemoveLayerGroup)
-    bpy.utils.register_class(LayerGroupsUI)
-    bpy.utils.register_class(AllLayersSelect)
-    bpy.utils.register_class(LayerToggle)
-    bpy.utils.register_class(MergeSelected)
-    bpy.utils.register_class(LayerName)
-    bpy.utils.register_class(LockSelected)
-    bpy.utils.register_class(SelectObjectsLayer)
-
-def unregister():
-    bpy.utils.unregister_class(AddLayerGroup)
-    bpy.utils.unregister_class(RemoveLayerGroup)
-    bpy.utils.unregister_class(LayerGroupsUI)
-    bpy.utils.unregister_class(LayerName)
-    bpy.utils.uregister_class(AllLayersSelect)
-    bpy.utils.unregister_class(LayerToggle)
-    bpy.utils.uregister_class(MergeSelected)
-    bpy.utils.unregister_class(LockSelected)
-    bpy.utils.unregister_class(SelectObjectsLayer)
-if __name__ == "__main__":
-    register()
diff --git a/release/scripts/addons_contrib/wetted_mesh.py b/release/scripts/addons_contrib/wetted_mesh.py
deleted file mode 100644
index 24e25fa..0000000
--- a/release/scripts/addons_contrib/wetted_mesh.py
+++ /dev/null
@@ -1,373 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
-    "name": "Add Wetted Mesh",
-    "author": "freejack",
-    "version": (0, 2, 1),
-    "blender": (2, 58, 0),
-    "location": "View3D > Tool Shelf > Wetted Mesh Panel",
-    "description": "Adds separated fluid, dry and wetted mesh for selected pair.",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
-        "Scripts/Mesh/Wetted_Mesh",
-    "tracker_url": "http://projects.blender.org/tracker/index.php?"\
-        "func=detail&aid=27156",
-    "category": "Mesh"}
-
-import bpy
-import collections
-import math
-
-### Tool Panel ###
-class VIEW3D_PT_tools_WettedMesh(bpy.types.Panel):
-    """Wetted Mesh Tool Panel"""
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = 'Wetted Mesh'
-    bl_context = 'objectmode'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        layout = self.layout
-        col = layout.column(align=True)
-        slcnt = len(context.selected_objects)
-
-        if slcnt != 2:
-            col.label(text = 'Select two mesh objects')
-            col.label(text = 'to generate separated')
-            col.label(text = 'fluid, dry and wetted')
-            col.label(text = 'meshes.')
-        else:
-            (solid, fluid) = getSelectedPair(context)
-            col.label(text = 'solid = '+solid.name)
-            col.label(text = 'fluid = '+fluid.name)
-            col.operator('mesh.primitive_wetted_mesh_add', text='Generate Meshes')
-
-### Operator ###
-class AddWettedMesh(bpy.types.Operator):
-    """Add wetted mesh for selected mesh pair"""
-    bl_idname = "mesh.primitive_wetted_mesh_add"
-    bl_label = "Add Wetted Mesh"
-    bl_options = {'REGISTER', 'UNDO'}
-    statusMessage = ''
-
-    def draw(self, context):
-        layout = self.layout
-        col = layout.column(align=True)
-        col.label(text = self.statusMessage)
-
-    def execute(self, context):
-        # make sure a pair of objects is selected
-        if len(context.selected_objects) != 2:
-            # should not happen if called from tool panel
-            self.report({'WARNING'}, "no mesh pair selected, operation cancelled")
-            return {'CANCELLED'}
-
-        print("add_wetted_mesh begin")
-        
-        # super-selected object is solid, other object is fluid
-        (solid, fluid) = getSelectedPair(context)
-        print("   solid = "+solid.name)
-        print("   fluid = "+fluid.name)
-            
-        # make a copy of fluid object, convert to mesh if required
-        print("   copy fluid")
-        bpy.ops.object.select_all(action='DESELECT')
-        fluid.select = True
-        context.scene.objects.active = fluid
-        bpy.ops.object.duplicate()
-        bpy.ops.object.convert(target='MESH', keep_original=False)
-        bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
-        fluidCopy = context.object
-        
-        # substract solid from fluidCopy
-        print("   bool: fluidCopy DIFFERENCE solid")
-        bpy.ops.object.modifier_add(type='BOOLEAN')
-        bop = fluidCopy.modifiers.items()[0]
-        bop[1].operation = 'DIFFERENCE'
-        bop[1].object = solid
-        bpy.ops.object.modifier_apply(apply_as='DATA', modifier=bop[0])
-        fluidMinusSolid = fluidCopy
-        fluidMinusSolid.name = "fluidMinusSolid"
-        
-        # make a second copy of fluid object
-        print("   copy fluid")
-        bpy.ops.object.select_all(action='DESELECT')
-        fluid.select = True
-        context.scene.objects.active = fluid
-        bpy.ops.object.duplicate()
-        bpy.ops.object.convert(target='MESH', keep_original=False)
-        bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
-        fluidCopy = context.object
-        
-        # make union from fluidCopy and solid
-        print("   bool: fluidCopy UNION solid")
-        bpy.ops.object.modifier_add(type='BOOLEAN')
-        bop = fluidCopy.modifiers.items()[0]
-        bop[1].operation = 'UNION'
-        bop[1].object = solid
-        bpy.ops.object.modifier_apply(apply_as='DATA', modifier=bop[0])
-        fluidUnionSolid = fluidCopy
-        fluidUnionSolid.name = "fluidUnionSolid"
-        
-        # index meshes
-        print("   KDTree index fluidMinusSolid")
-        fluidMinusSolidKDT = KDTree(3, fluidMinusSolid.data.vertices)
-        print("   KDTree index fluidUnionSolid")
-        fluidUnionSolidKDT = KDTree(3, fluidUnionSolid.data.vertices)
-        kdtrees = (fluidMinusSolidKDT, fluidUnionSolidKDT)
-        
-        # build mesh face sets
-        faceDict = { }
-        vertDict = { }
-        
-        print("   processing fluidMinusSolid faces")
-        cacheDict = { }
-        setFMSfaces = set()
-        numFaces = len(fluidUnionSolid.data.faces)
-        i = 0
-        for f in fluidMinusSolid.data.faces:
-            if i % 500 == 0:
-                print("      ", i, " / ", numFaces)
-            i += 1
-            fuid = unifiedFaceId(kdtrees, f, fluidMinusSolid.data.vertices, \
-                                 faceDict, vertDict, cacheDict)
-            setFMSfaces.add(fuid)
-        
-        print("   processing fluidUnionSolid faces")
-        cacheDict = { }
-        setFUSfaces = set()
-        numFaces = len(fluidUnionSolid.data.faces)
-        i = 0
-        for f in fluidUnionSolid.data.faces:
-            if i % 500 == 0:
-                print("      ", i, " / ", numFaces)
-            i += 1
-            fuid = unifiedFaceId(kdtrees, f, fluidUnionSolid.data.vertices, \
-                                 faceDict, vertDict, cacheDict)
-            setFUSfaces.add(fuid)
-        
-        # remove boolean helpers
-        print("   delete helper objects")
-        bpy.ops.object.select_all(action='DESELECT')
-        fluidUnionSolid.select = True
-        fluidMinusSolid.select = True
-        bpy.ops.object.delete()
-
-        # wetted = FMS - FUS
-        print("   set operation FMS diff FUS")
-        setWetFaces = setFMSfaces.difference(setFUSfaces)
-        print("   build wetted mesh")
-        verts, faces = buildMesh(setWetFaces, faceDict, vertDict)
-        print("   create wetted mesh")
-        wetted = createMesh("Wetted", verts, faces)
-
-        # fluid = FMS x FUS
-        print("   set operation FMS intersect FUS")
-        setFluidFaces = setFMSfaces.intersection(setFUSfaces)
-        print("   build fluid mesh")
-        verts, faces = buildMesh(setFluidFaces, faceDict, vertDict)
-        print("   create fluid mesh")
-        fluid = createMesh("Fluid", verts, faces)
-        
-        # solid = FUS - FMS
-        print("   set operation FUS diff FMS")
-        setSolidFaces = setFUSfaces.difference(setFMSfaces)
-        print("   build solid mesh")
-        verts, faces = buildMesh(setSolidFaces, faceDict, vertDict)
-        print("   create solid mesh")
-        solid = createMesh("Solid", verts, faces)
-        
-        # parent wetted mesh
-        print("   parent mesh")
-        bpy.ops.object.add(type='EMPTY')
-        wettedMesh = context.object
-        solid.select = True
-        fluid.select = True
-        wetted.select = True
-        wettedMesh.select = True
-        bpy.ops.object.parent_set(type='OBJECT')
-        wettedMesh.name = 'WettedMesh'
-        
-        print("add_wetted_mesh done")
-        self.statusMessage = 'created '+wettedMesh.name
-
-        return {'FINISHED'}
-
-
-### Registration ###
-def register():
-    bpy.utils.register_class(VIEW3D_PT_tools_WettedMesh)
-    bpy.utils.register_class(AddWettedMesh)
-
-
-def unregister():
-    bpy.utils.unregister_class(VIEW3D_PT_tools_WettedMesh)
-    bpy.utils.unregister_class(AddWettedMesh)
-
-if __name__ == "__main__":
-    register()
-
-
-#
-# KD tree (used to create a geometric index of mesh vertices)
-#
-
-def distance(a, b):
-    return (a-b).length
-
-Node = collections.namedtuple("Node", 'point axis label left right')
-
-class KDTree(object):
-    """A tree for nearest neighbor search in a k-dimensional space.
-
-    For information about the implementation, see
-    http://en.wikipedia.org/wiki/Kd-tree
-
-    Usage:
-    objects is an iterable of (co, index) tuples (so MeshVertex is useable)
-    k is the number of dimensions (=3)
-    
-    t = KDTree(k, objects)
-    point, label, distance = t.nearest_neighbor(destination)
-    """
-
-    def __init__(self, k, objects=[]):
-
-        def build_tree(objects, axis=0):
-
-            if not objects:
-                return None
-
-            objects.sort(key=lambda o: o.co[axis])
-            median_idx = len(objects) // 2
-            median_point = objects[median_idx].co
-            median_label = objects[median_idx].index
-
-            next_axis = (axis + 1) % k
-            return Node(median_point, axis, median_label,
-                        build_tree(objects[:median_idx], next_axis),
-                        build_tree(objects[median_idx + 1:], next_axis))
-
-        self.root = build_tree(list(objects))
-        self.size = len(objects)
-
-
-    def nearest_neighbor(self, destination):
-
-        best = [None, None, float('inf')]
-        # state of search: best point found, its label,
-        # lowest distance
-
-        def recursive_search(here):
-
-            if here is None:
-                return
-            point, axis, label, left, right = here
-
-            here_sd = distance(point, destination)
-            if here_sd < best[2]:
-                best[:] = point, label, here_sd
-
-            diff = destination[axis] - point[axis]
-            close, away = (left, right) if diff <= 0 else (right, left)
-
-            recursive_search(close)
-            if math.fabs(diff) < best[2]:
-                recursive_search(away)
-
-        recursive_search(self.root)
-        return best[0], best[1], best[2]
-
-
-#
-# helper functions
-#
-
-# get super-selected object and other object from selected pair
-def getSelectedPair(context):
-    objA = context.object
-    objB = context.selected_objects[0]
-    if objA == objB:
-        objB = context.selected_objects[1]
-    return (objA, objB)
-
-# get a unified vertex id for given coordinates
-def unifiedVertexId(kdtrees, location, vertDict):
-    eps = 0.0001
-    offset = 0
-    for t in kdtrees:
-        co, index, d = t.nearest_neighbor(location)
-        if d < eps:
-            uvid = offset + index
-            if uvid not in vertDict:
-                vertDict[uvid] = co
-            return uvid
-        offset += t.size
-    return -1
-
-# get a unified face id tuple
-#    Stores the ordered face id tuple in faceDict
-#    and the used coordinates for vertex id in vertDict.
-#    cacheDict caches the unified vertex id (lookup in kdtree is expensive).
-#    For each mesh (where the face belongs to) a separate cacheDict is expected.
-def unifiedFaceId(kdtrees, face, vertices, faceDict, vertDict, cacheDict):
-    fids = [ ]
-    for v in face.vertices:
-        uvid = cacheDict.get(v)
-        if uvid == None:
-            uvid = unifiedVertexId(kdtrees, vertices[v].co, vertDict)
-            cacheDict[v] = uvid
-        fids.append(uvid)
-    ofids = tuple(fids)
-    fids.sort()
-    fuid = tuple(fids)
-    if fuid not in faceDict:
-        faceDict[fuid] = ofids
-    return fuid
-
-# build vertex and face array from unified face sets
-def buildMesh(unifiedFaceSet, faceDict, vertDict):
-    verts = [ ]
-    nextV = 0
-    myV = { }
-    faces = [ ]
-    for uf in unifiedFaceSet:
-        of = faceDict[uf]
-        myf = [ ]
-        for uV in of:
-            v = myV.get(uV)
-            if v == None:
-                v = nextV
-                myV[uV] = nextV
-                verts.append(vertDict[uV])
-                nextV += 1
-            myf.append(v)
-        faces.append(myf)
-    return verts, faces
-
-# create mesh object and link to scene
-def createMesh(name, verts, faces):
-    me = bpy.data.meshes.new(name+"Mesh")
-    ob = bpy.data.objects.new(name, me)
-    ob.show_name = True
-    bpy.context.scene.objects.link(ob)
-    me.from_pydata(verts, [], faces)
-    me.update(calc_edges=True)
-    return ob
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 65ea91c..0211505 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -208,9 +208,9 @@ def check(module_name):
 
     if loaded_state is Ellipsis:
         print("Warning: addon-module %r found module "
-               "but without __addon_enabled__ field, "
-               "possible name collision from file: %r" %
-               (module_name, getattr(mod, "__file__", "<unknown>")))
+              "but without __addon_enabled__ field, "
+              "possible name collision from file: %r" %
+              (module_name, getattr(mod, "__file__", "<unknown>")))
 
         loaded_state = False
 
diff --git a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
index 7e9266d..006d717 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
@@ -23,27 +23,41 @@
 #      You should not directly use this script, rather use update_msg.py!
 
 import os
+import re
+import collections
+import copy
 
 # XXX Relative import does not work here when used from Blender...
 from bl_i18n_utils import settings
 
+import bpy
 
-#classes = set()
-
+print(dir(settings))
 
 SOURCE_DIR = settings.SOURCE_DIR
 
 CUSTOM_PY_UI_FILES = [os.path.abspath(os.path.join(SOURCE_DIR, p)) for p in settings.CUSTOM_PY_UI_FILES]
 FILE_NAME_MESSAGES = settings.FILE_NAME_MESSAGES
-COMMENT_PREFIX = settings.COMMENT_PREFIX
-CONTEXT_PREFIX = settings.CONTEXT_PREFIX
+MSG_COMMENT_PREFIX = settings.MSG_COMMENT_PREFIX
+MSG_CONTEXT_PREFIX = settings.MSG_CONTEXT_PREFIX
 CONTEXT_DEFAULT = settings.CONTEXT_DEFAULT
+#CONTEXT_DEFAULT = bpy.app.i18n.contexts.default # XXX Not yet! :)
 UNDOC_OPS_STR = settings.UNDOC_OPS_STR
 
 NC_ALLOWED = settings.WARN_MSGID_NOT_CAPITALIZED_ALLOWED
 
 
+##### Utils #####
+
+# check for strings like ": %d"
+ignore_reg = re.compile(r"^(?:[-*.()/\\+:%xWXYZ0-9]|%d|%f|%s|%r|\s)*$")
+filter_message = ignore_reg.match
+
+
 def check(check_ctxt, messages, key, msgsrc):
+    """
+    Performs a set of checks over the given key (context, message)...
+    """
     if check_ctxt is None:
         return
     multi_rnatip = check_ctxt.get("multi_rnatip")
@@ -73,7 +87,79 @@ def check(check_ctxt, messages, key, msgsrc):
             undoc_ops.add(key)
 
 
+def print_warnings(check_ctxt, messages):
+    if check_ctxt is not None:
+        print("WARNINGS:")
+        keys = set()
+        for c in check_ctxt.values():
+            keys |= c
+        # XXX Temp, see below
+        keys -= check_ctxt["multi_rnatip"]
+        for key in keys:
+            if key in check_ctxt["undoc_ops"]:
+                print("\tThe following operators are undocumented:")
+            else:
+                print("\t“{}”|“{}”:".format(*key))
+                if key in check_ctxt["multi_lines"]:
+                    print("\t\t-> newline in this message!")
+                if key in check_ctxt["not_capitalized"]:
+                    print("\t\t-> message not capitalized!")
+                if key in check_ctxt["end_point"]:
+                    print("\t\t-> message with endpoint!")
+                # XXX Hide this one for now, too much false positives.
+#                if key in check_ctxt["multi_rnatip"]:
+#                    print("\t\t-> tip used in several RNA items")
+                if key in check_ctxt["py_in_rna"]:
+                    print("\t\t-> RNA message also used in py UI code:")
+            print("\t\t{}".format("\n\t\t".join(messages[key])))
+
+
+def enable_addons(addons={}, support={}, disable=False):
+    """
+    Enable (or disable) addons based either on a set of names, or a set of 'support' types.
+    Returns the list of all affected addons (as fake modules)!
+    """
+    import addon_utils
+    import bpy
+
+    userpref = bpy.context.user_preferences
+    used_ext = {ext.module for ext in userpref.addons}
+
+    ret = [mod for mod in addon_utils.modules(addon_utils.addons_fake_modules)
+           if ((addons and mod.__name__ in addons) or
+               (not addons and addon_utils.module_bl_info(mod)["support"] in support))]
+
+    for mod in ret:
+        module_name = mod.__name__
+        if disable:
+            if module_name not in used_ext:
+                continue
+            print("    Disabling module ", module_name)
+            bpy.ops.wm.addon_disable(module=module_name)
+        else:
+            if module_name in used_ext:
+                continue
+            print("    Enabling module ", module_name)
+            bpy.ops.wm.addon_enable(module=module_name)
+
+    # XXX There are currently some problems with bpy/rna...
+    #     *Very* tricky to solve!
+    #     So this is a hack to make all newly added operator visible by
+    #     bpy.types.OperatorProperties.__subclasses__()
+    for cat in dir(bpy.ops):
+        cat = getattr(bpy.ops, cat)
+        for op in dir(cat):
+            getattr(cat, op).get_rna()
+
+    return ret
+
+
+##### RNA #####
+
 def dump_messages_rna(messages, check_ctxt):
+    """
+    Dump into messages dict all RNA-defined UI messages (labels en tooltips).
+    """
     import bpy
 
     def classBlackList():
@@ -257,49 +343,163 @@ def dump_messages_rna(messages, check_ctxt):
     # Parse everything (recursively parsing from bpy_struct "class"...).
     processed = process_cls_list(type(bpy.context).__base__.__subclasses__())
     print("{} classes processed!".format(processed))
-#    import pickle
-#    global classes
-#    classes = {str(c) for c in classes}
-#    with open("/home/i7deb64/Bureau/tpck_2", "wb") as f:
-#        pickle.dump(classes, f, protocol=0)
 
     from bpy_extras.keyconfig_utils import KM_HIERARCHY
 
     walk_keymap_hierarchy(KM_HIERARCHY, "KM_HIERARCHY")
 
 
-def dump_messages_pytext(messages, check_ctxt):
-    """ dumps text inlined in the python user interface: eg.
+##### Python source code #####
 
+def dump_py_messages_from_files(messages, check_ctxt, files):
+    """
+    Dump text inlined in the python files given, e.g. 'My Name' in:
         layout.prop("someprop", text="My Name")
     """
     import ast
 
+    bpy_struct = bpy.types.ID.__base__
+
+    # Helper function
+    def extract_strings_ex(node, is_split=False):
+        """
+        Recursively get strings, needed in case we have "Blah" + "Blah", passed as an argument in that case it won't
+        evaluate to a string. However, break on some kind of stopper nodes, like e.g. Subscript.
+        """
+
+        if type(node) == ast.Str:
+            eval_str = ast.literal_eval(node)
+            if eval_str:
+                yield (is_split, eval_str, (node,))
+        else:
+            is_split = (type(node) in separate_nodes)
+            for nd in ast.iter_child_nodes(node):
+                if type(nd) not in stopper_nodes:
+                    yield from extract_strings_ex(nd, is_split=is_split)
+
+    def _extract_string_merge(estr_ls, nds_ls):
+        return "".join(s for s in estr_ls if s is not None), tuple(n for n in nds_ls if n is not None)
+
+    def extract_strings(node):
+        estr_ls = []
+        nds_ls = []
+        for is_split, estr, nds in extract_strings_ex(node):
+            estr_ls.append(estr)
+            nds_ls.extend(nds)
+        ret = _extract_string_merge(estr_ls, nds_ls)
+        #print(ret)
+        return ret
+    
+    def extract_strings_split(node):
+        """
+        Returns a list args as returned by 'extract_strings()',
+        But split into groups based on separate_nodes, this way
+        expressions like ("A" if test else "B") wont be merged but
+        "A" + "B" will.
+        """
+        estr_ls = []
+        nds_ls = []
+        bag = []
+        for is_split, estr, nds in extract_strings_ex(node):
+            if is_split:
+                bag.append((estr_ls, nds_ls))
+                estr_ls = []
+                nds_ls = []
+
+            estr_ls.append(estr)
+            nds_ls.extend(nds)
+
+        bag.append((estr_ls, nds_ls))
+
+        return [_extract_string_merge(estr_ls, nds_ls) for estr_ls, nds_ls in bag]
+
+
+    def _ctxt_to_ctxt(node):
+        return extract_strings(node)[0]
+
+    def _op_to_ctxt(node):
+        opname, _ = extract_strings(node)
+        if not opname:
+            return ""
+        op = bpy.ops
+        for n in opname.split('.'):
+            op = getattr(op, n)
+        try:
+            return op.get_rna().bl_rna.translation_context
+        except Exception as e:
+            default_op_context = bpy.app.translations.contexts.operator_default
+            print("ERROR: ", str(e))
+            print("       Assuming default operator context '{}'".format(default_op_context))
+            return default_op_context
+
     # -------------------------------------------------------------------------
     # Gather function names
 
-    import bpy
-    # key: func_id
-    # val: [(arg_kw, arg_pos), (arg_kw, arg_pos), ...]
+    # In addition of UI func, also parse pgettext ones...
+    # Tuples of (module name, (short names, ...)).
+    pgettext_variants = (
+        ("pgettext", ("_",)),
+        ("pgettext_iface", ("iface_",)),
+        ("pgettext_tip", ("tip_",))
+    )
+    pgettext_variants_args = {"msgid": (0, {"msgctxt": 1})}
+
+    # key: msgid keywords.
+    # val: tuples of ((keywords,), context_getter_func) to get a context for that msgid.
+    #      Note: order is important, first one wins!
+    translate_kw = {
+        "text": ((("text_ctxt",), _ctxt_to_ctxt),
+                 (("operator",), _op_to_ctxt),
+                ),
+        "msgid": ((("msgctxt",), _ctxt_to_ctxt),
+                 ),
+    }
+
+    context_kw_set = {}
+    for k, ctxts in translate_kw.items():
+        s = set()
+        for c, _ in ctxts:
+            s |= set(c)
+        context_kw_set[k] = s
+
+    # {func_id: {msgid: (arg_pos,
+    #                    {msgctxt: arg_pos,
+    #                     ...
+    #                    }
+    #                   ),
+    #            ...
+    #           },
+    #  ...
+    # }
     func_translate_args = {}
 
-    # so far only 'text' keywords, but we may want others translated later
-    translate_kw = ("text", )
+    # First, functions from UILayout
+    # First loop is for msgid args, second one is for msgctxt args.
+    for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
+        # check it has one or more arguments as defined in translate_kw
+        for arg_pos, (arg_kw, arg) in enumerate(func.parameters.items()):
+            if ((arg_kw in translate_kw) and (not arg.is_output) and (arg.type == 'STRING')):
+                func_translate_args.setdefault(func_id, {})[arg_kw] = (arg_pos, {})
+    for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
+        if func_id not in func_translate_args:
+            continue
+        for arg_pos, (arg_kw, arg) in enumerate(func.parameters.items()):
+            if (not arg.is_output) and (arg.type == 'STRING'):
+                for msgid, msgctxts in context_kw_set.items():
+                    if arg_kw in msgctxts:
+                        func_translate_args[func_id][msgid][1][arg_kw] = arg_pos
+    # We manually add funcs from bpy.app.translations
+    for func_id, func_ids in pgettext_variants:
+        func_translate_args[func_id] = pgettext_variants_args
+        for func_id in func_ids:
+            func_translate_args[func_id] = pgettext_variants_args
+    #print(func_translate_args)
 
     # Break recursive nodes look up on some kind of nodes.
     # E.g. we don’t want to get strings inside subscripts (blah["foo"])!
-    stopper_nodes = {ast.Subscript, }
-
-    for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
-        # check it has a 'text' argument
-        for (arg_pos, (arg_kw, arg)) in enumerate(func.parameters.items()):
-            if ((arg_kw in translate_kw) and
-                (arg.is_output is False) and
-                (arg.type == 'STRING')):
-
-                func_translate_args.setdefault(func_id, []).append((arg_kw,
-                                                                    arg_pos))
-    # print(func_translate_args)
+    stopper_nodes = {ast.Subscript}
+    # Consider strings separate: ("a" if test else "b")
+    separate_nodes = {ast.IfExp}
 
     check_ctxt_py = None
     if check_ctxt:
@@ -308,32 +508,9 @@ def dump_messages_pytext(messages, check_ctxt):
                          "not_capitalized": check_ctxt["not_capitalized"],
                          "end_point": check_ctxt["end_point"]}
 
-    # -------------------------------------------------------------------------
-    # Function definitions
-
-    def extract_strings(fp_rel, node):
-        """ Recursively get strings, needed in case we have "Blah" + "Blah",
-            passed as an argument in that case it wont evaluate to a string.
-            However, break on some kind of stopper nodes, like e.g. Subscript.
-        """
-
-        if type(node) == ast.Str:
-            eval_str = ast.literal_eval(node)
-            if eval_str:
-                key = (CONTEXT_DEFAULT, eval_str)
-                msgsrc = "{}:{}".format(fp_rel, node.lineno)
-                check(check_ctxt_py, messages, key, msgsrc)
-                messages.setdefault(key, []).append(msgsrc)
-            return
-
-        for nd in ast.iter_child_nodes(node):
-            if type(nd) not in stopper_nodes:
-                extract_strings(fp_rel, nd)
-
-    def extract_strings_from_file(fp):
-        filedata = open(fp, 'r', encoding="utf8")
-        root_node = ast.parse(filedata.read(), fp, 'exec')
-        filedata.close()
+    for fp in files:
+        with open(fp, 'r', encoding="utf8") as filedata:
+            root_node = ast.parse(filedata.read(), fp, 'exec')
 
         fp_rel = os.path.relpath(fp, SOURCE_DIR)
 
@@ -342,91 +519,146 @@ def dump_messages_pytext(messages, check_ctxt):
                 # print("found function at")
                 # print("%s:%d" % (fp, node.lineno))
 
-                # lambda's
+                # We can't skip such situations! from blah import foo\nfoo("bar") would also be an ast.Name func!
                 if type(node.func) == ast.Name:
+                    func_id = node.func.id
+                elif hasattr(node.func, "attr"):
+                    func_id = node.func.attr
+                # Ugly things like getattr(self, con.type)(context, box, con)
+                else:
                     continue
 
-                # getattr(self, con.type)(context, box, con)
-                if not hasattr(node.func, "attr"):
-                    continue
-
-                translate_args = func_translate_args.get(node.func.attr, ())
-
+                func_args = func_translate_args.get(func_id, {})
+
+                # First try to get i18n contexts, for every possible msgid id.
+                contexts = dict.fromkeys(func_args.keys(), "")
+                for msgid, (_, context_args) in func_args.items():
+                    context_elements = {}
+                    for arg_kw, arg_pos in context_args.items():
+                        if arg_pos < len(node.args):
+                            context_elements[arg_kw] = node.args[arg_pos]
+                        else:
+                            for kw in node.keywords:
+                                if kw.arg == arg_kw:
+                                    context_elements[arg_kw] = kw.value
+                                    break
+                    #print(context_elements)
+                    for kws, proc in translate_kw[msgid]:
+                        if set(kws) <= context_elements.keys():
+                            args = tuple(context_elements[k] for k in kws)
+                            #print("running ", proc, " with ", args)
+                            ctxt = proc(*args)
+                            if ctxt:
+                                contexts[msgid] = ctxt
+                                break
+
+                #print(translate_args)
                 # do nothing if not found
-                for arg_kw, arg_pos in translate_args:
+                for arg_kw, (arg_pos, _) in func_args.items():
+                    estr_lst = [(None, ())]
                     if arg_pos < len(node.args):
-                        extract_strings(fp_rel, node.args[arg_pos])
+                        estr_lst = extract_strings_split(node.args[arg_pos])
+                        #print(estr, nds)
                     else:
                         for kw in node.keywords:
                             if kw.arg == arg_kw:
-                                extract_strings(fp_rel, kw.value)
-
-    # -------------------------------------------------------------------------
-    # Dump Messages
-
-    mod_dir = os.path.join(SOURCE_DIR,
-                           "release",
-                           "scripts",
-                           "startup",
-                           "bl_ui")
-
-    files = [os.path.join(mod_dir, fn)
-             for fn in sorted(os.listdir(mod_dir))
-             if not fn.startswith("_")
-             if fn.endswith("py")
-             ]
+                                estr_lst = extract_strings_split(kw.value)
+                                break
+                        #print(estr, nds)
+                    for estr, nds in estr_lst:
+                        if estr:
+                            key = (contexts[arg_kw], estr)
+                            if nds:
+                                msgsrc = ["{}:{}".format(fp_rel, sorted({nd.lineno for nd in nds})[0])]
+                            else:
+                                msgsrc = ["{}:???".format(fp_rel)]
+                            check(check_ctxt_py, messages, key, msgsrc)
+                            messages.setdefault(key, []).extend(msgsrc)
+
+
+def dump_py_messages(messages, check_ctxt, addons):
+    mod_dir = os.path.join(SOURCE_DIR, "release", "scripts", "startup", "bl_ui")
+
+    files = [os.path.join(mod_dir, fn) for fn in sorted(os.listdir(mod_dir))
+             if not fn.startswith("_") if fn.endswith("py")]
 
     # Dummy Cycles has its py addon in its own dir!
     files += CUSTOM_PY_UI_FILES
 
-    for fp in files:
-        extract_strings_from_file(fp)
+    # Add all addons we support in main translation file!
+    for mod in addons:
+        fn = mod.__file__
+        if os.path.basename(fn) == "__init__.py":
+            mod_dir = os.path.dirname(fn)
+            files += [fn for fn in sorted(os.listdir(mod_dir))
+                      if os.path.isfile(fn) and os.path.splitext(fn)[1] == ".py"]
+        else:
+            files.append(fn)
+
+    dump_py_messages_from_files(messages, check_ctxt, files)
 
 
+##### Main functions! #####
+
 def dump_messages(do_messages, do_checks):
-    import collections
-    import re
+    messages = getattr(collections, 'OrderedDict', dict)()
 
-    def enable_addons():
-        """For now, enable all official addons, before extracting msgids."""
-        import addon_utils
-        import bpy
+    messages[(CONTEXT_DEFAULT, "")] = []
 
-        userpref = bpy.context.user_preferences
-        used_ext = {ext.module for ext in userpref.addons}
-        support = {"OFFICIAL"}
-        # collect the categories that can be filtered on
-        addons = [(mod, addon_utils.module_bl_info(mod)) for mod in
-                  addon_utils.modules(addon_utils.addons_fake_modules)]
+    # Enable all wanted addons.
+    # For now, enable all official addons, before extracting msgids.
+    addons = enable_addons(support={"OFFICIAL"})
 
-        for mod, info in addons:
-            module_name = mod.__name__
-            if module_name in used_ext or info["support"] not in support:
-                continue
-            print("    Enabling module ", module_name)
-            bpy.ops.wm.addon_enable(module=module_name)
+    check_ctxt = None
+    if do_checks:
+        check_ctxt = {"multi_rnatip": set(),
+                      "multi_lines": set(),
+                      "py_in_rna": set(),
+                      "not_capitalized": set(),
+                      "end_point": set(),
+                      "undoc_ops": set()}
+
+    # get strings from RNA
+    dump_messages_rna(messages, check_ctxt)
+
+    # get strings from UI layout definitions text="..." args
+    dump_py_messages(messages, check_ctxt, addons)
+
+    del messages[(CONTEXT_DEFAULT, "")]
+
+    print_warnings(check_ctxt, messages)
+
+    if do_messages:
+        print("Writing messages…")
+        num_written = 0
+        num_filtered = 0
+        with open(FILE_NAME_MESSAGES, 'w', encoding="utf8") as message_file:
+            for (ctx, key), value in messages.items():
+                # filter out junk values
+                if filter_message(key):
+                    num_filtered += 1
+                    continue
+
+                # Remove newlines in key and values!
+                message_file.write("\n".join(MSG_COMMENT_PREFIX + msgsrc.replace("\n", "") for msgsrc in value))
+                message_file.write("\n")
+                if ctx:
+                    message_file.write(MSG_CONTEXT_PREFIX + ctx.replace("\n", "") + "\n")
+                message_file.write(key.replace("\n", "") + "\n")
+                num_written += 1
 
-        # XXX There are currently some problems with bpy/rna...
-        #     *Very* tricky to solve!
-        #     So this is a hack to make all newly added operator visible by
-        #     bpy.types.OperatorProperties.__subclasses__()
-        for cat in dir(bpy.ops):
-            cat = getattr(bpy.ops, cat)
-            for op in dir(cat):
-                getattr(cat, op).get_rna()
+        print("Written {} messages to: {} ({} were filtered out)."
+              "".format(num_written, FILE_NAME_MESSAGES, num_filtered))
 
-    # check for strings like ": %d"
-    ignore_reg = re.compile(r"^(?:[-*.()/\\+:%xWXYZ0-9]|%d|%f|%s|%r|\s)*$")
-    filter_message = ignore_reg.match
 
+def dump_addon_messages(module_name, messages_formats, do_checks):
     messages = getattr(collections, 'OrderedDict', dict)()
 
     messages[(CONTEXT_DEFAULT, "")] = []
-
-    # Enable all wanted addons.
-    enable_addons()
+    minus_messages = copy.deepcopy(messages)
 
     check_ctxt = None
+    minus_check_ctxt = None
     if do_checks:
         check_ctxt = {"multi_rnatip": set(),
                       "multi_lines": set(),
@@ -434,39 +666,44 @@ def dump_messages(do_messages, do_checks):
                       "not_capitalized": set(),
                       "end_point": set(),
                       "undoc_ops": set()}
+        minus_check_ctxt = copy.deepcopy(check_ctxt)
 
-    # get strings from RNA
+    # Get current addon state (loaded or not):
+    was_loaded = addon_utils.check(module_name)[1]
+
+    # Enable our addon and get strings from RNA.
+    enable_addons(addons={module_name})
     dump_messages_rna(messages, check_ctxt)
 
+    # Now disable our addon, and rescan RNA.
+    enable_addons(addons={module_name}, disable=True)
+    dump_messages_rna(minus_messages, minus_check_ctxt)
+
+    # Restore previous state if needed!
+    if was_loaded:
+        enable_addons(addons={module_name})
+
+    # and make the diff!
+    for key in minus_messages:
+        if k == (CONTEXT_DEFAULT, ""):
+            continue
+        del messages[k]
+
+    if check_ctxt:
+        for key in check_ctxt:
+            for warning in minus_check_ctxt[key]:
+                check_ctxt[key].remove(warning)
+
+    # and we are done with those!
+    del minus_messages
+    del minus_check_ctxt
+
     # get strings from UI layout definitions text="..." args
     dump_messages_pytext(messages, check_ctxt)
 
     del messages[(CONTEXT_DEFAULT, "")]
 
-    if do_checks:
-        print("WARNINGS:")
-        keys = set()
-        for c in check_ctxt.values():
-            keys |= c
-        # XXX Temp, see below
-        keys -= check_ctxt["multi_rnatip"]
-        for key in keys:
-            if key in check_ctxt["undoc_ops"]:
-                print("\tThe following operators are undocumented:")
-            else:
-                print("\t“{}”|“{}”:".format(*key))
-                if key in check_ctxt["multi_lines"]:
-                    print("\t\t-> newline in this message!")
-                if key in check_ctxt["not_capitalized"]:
-                    print("\t\t-> message not capitalized!")
-                if key in check_ctxt["end_point"]:
-                    print("\t\t-> message with endpoint!")
-                # XXX Hide this one for now, too much false positives.
-#                if key in check_ctxt["multi_rnatip"]:
-#                    print("\t\t-> tip used in several RNA items")
-                if key in check_ctxt["py_in_rna"]:
-                    print("\t\t-> RNA message also used in py UI code:")
-            print("\t\t{}".format("\n\t\t".join(messages[key])))
+    print_warnings
 
     if do_messages:
         print("Writing messages…")
@@ -491,6 +728,7 @@ def dump_messages(do_messages, do_checks):
               "".format(num_written, FILE_NAME_MESSAGES, num_filtered))
 
 
+
 def main():
     try:
         import bpy
diff --git a/release/scripts/modules/bl_i18n_utils/check_po.py b/release/scripts/modules/bl_i18n_utils/check_po.py
index 2e82047..96f91ee 100755
--- a/release/scripts/modules/bl_i18n_utils/check_po.py
+++ b/release/scripts/modules/bl_i18n_utils/check_po.py
@@ -38,45 +38,47 @@ BRANCHES_DIR = settings.BRANCHES_DIR
 FILE_NAME_POT = settings.FILE_NAME_POT
 
 
-def print_diff(ref_messages, messages, states):
+def print_diff(ref_msgs, msgs):
     # Remove comments from messages list!
-    messages = set(messages.keys()) - states["comm_msg"]
-    unneeded = (messages - ref_messages)
-    for msgid in unneeded:
-        print('\tUnneeded message id "{}"'.format(msgid))
+    messages = set(msgs.msgs.keys()) - msgs.comm_msgs
+    unneeded = (messages - ref_msgs.msgs.keys())
+    for msgkey in unneeded:
+        print('\tUnneeded message context/id "{}"'.format(msgkey))
 
-    missing = (ref_messages - messages)
-    for msgid in missing:
-        print('\tMissing message id "{}"'.format(msgid))
+    missing = (ref_msgs.msgs.keys() - messages)
+    for msgkey in missing:
+        print('\tMissing message context/id "{}"'.format(msgkey))
 
-    for msgid in states["comm_msg"]:
-        print('\tCommented message id "{}"'.format(msgid))
+    for msgid in msgs.comm_msgs:
+        print('\tCommented message context/id "{}"'.format(msgkey))
 
-    print("\t{} unneeded messages, {} missing messages, {} commented messages." \
-          "".format(len(unneeded), len(missing), len(states["comm_msg"])))
+    print("\t{} unneeded messages, {} missing messages, {} commented messages."
+          "".format(len(unneeded), len(missing), len(msgs.comm_msgs)))
     return 0
 
 
-def process_po(ref_messages, po, glob_stats, do_stats, do_messages):
+#def process_po(ref_messages, po, glob_stats, do_stats, do_messages):
+def process_po(ref_messages, po, do_stats, do_messages):
     print("Checking {}...".format(po))
     ret = 0
 
-    messages, states, stats = utils.parse_messages(po)
+    messages = utils.I18nMessages(kind='PO', src=po)
     if do_messages:
-        t = print_diff(ref_messages, messages, states)
+        t = print_diff(ref_messages, messages)
         if t:
             ret = t
     if do_stats:
         print("\tStats:")
-        t = utils.print_stats(stats, glob_stats, prefix="        ")
+        t = messages.print_stats(prefix="        ")
         if t:
             ret = t
-    if states["is_broken"]:
+    if messages.parsing_errors:
         print("\tERROR! This .po is broken!")
         ret = 1
     return ret
 
 
+# XXX Quick update for new I18Nfoo objects, need rework!
 def main():
     import argparse
     parser = argparse.ArgumentParser(description="Check po’s in branches " \
@@ -97,22 +99,21 @@ def main():
     if args.pot:
         global FILE_NAME_POT
         FILE_NAME_POT = args.pot
-    glob_stats = {"nbr"               : 0.0,
-                  "lvl"               : 0.0,
-                  "lvl_ttips"         : 0.0,
-                  "lvl_trans_ttips"   : 0.0,
-                  "lvl_ttips_in_trans": 0.0,
-                  "lvl_comm"          : 0.0,
-                  "nbr_signs"         : 0,
-                  "nbr_trans_signs"   : 0,
-                  "contexts"          : set()}
+    #glob_stats = {"nbr"               : 0.0,
+                  #"lvl"               : 0.0,
+                  #"lvl_ttips"         : 0.0,
+                  #"lvl_trans_ttips"   : 0.0,
+                  #"lvl_ttips_in_trans": 0.0,
+                  #"lvl_comm"          : 0.0,
+                  #"nbr_signs"         : 0,
+                  #"nbr_trans_signs"   : 0,
+                  #"contexts"          : set()}
     ret = 0
 
     pot_messages = None
     if args.messages:
-        pot_messages, u1, pot_stats = utils.parse_messages(FILE_NAME_POT)
-        pot_messages = set(pot_messages.keys())
-        glob_stats["nbr_signs"] = pot_stats["nbr_signs"]
+        pot_messages = utils.I18nMessages(kind='PO', src=FILE_NAME_POT)
+        #glob_stats["nbr_signs"] = pot_stats["nbr_signs"]
 
     if args.langs:
         for lang in args.langs:
@@ -121,16 +122,16 @@ def main():
             else:
                 po = os.path.join(BRANCHES_DIR, lang, ".".join((lang, "po")))
             if os.path.exists(po):
-                t = process_po(pot_messages, po, glob_stats,
-                               args.stats, args.messages)
+                #t = process_po(pot_messages, po, glob_stats, args.stats, args.messages)
+                t = process_po(pot_messages, po, args.stats, args.messages)
                 if t:
                     ret = t
     elif args.trunk:
         for po in os.listdir(TRUNK_PO_DIR):
             if po.endswith(".po"):
                 po = os.path.join(TRUNK_PO_DIR, po)
-                t = process_po(pot_messages, po, glob_stats,
-                               args.stats, args.messages)
+                #t = process_po(pot_messages, po, glob_stats, args.stats, args.messages)
+                t = process_po(pot_messages, po, args.stats, args.messages)
                 if t:
                     ret = t
     else:
@@ -138,35 +139,35 @@ def main():
             for po in os.listdir(os.path.join(BRANCHES_DIR, lang)):
                 if po.endswith(".po"):
                     po = os.path.join(BRANCHES_DIR, lang, po)
-                    t = process_po(pot_messages, po, glob_stats,
-                                   args.stats, args.messages)
+                    #t = process_po(pot_messages, po, glob_stats, args.stats, args.messages)
+                    t = process_po(pot_messages, po, args.stats, args.messages)
                     if t:
                         ret = t
 
-    if args.stats and glob_stats["nbr"] != 0.0:
-        nbr_contexts = len(glob_stats["contexts"] - {""})
-        if nbr_contexts != 1:
-            if nbr_contexts == 0:
-                nbr_contexts = "No"
-            _ctx_txt = "s are"
-        else:
-            _ctx_txt = " is"
-        print("\nAverage stats for all {:.0f} processed files:\n"
-              "    {:>6.1%} done!\n"
-              "    {:>6.1%} of messages are tooltips.\n"
-              "    {:>6.1%} of tooltips are translated.\n"
-              "    {:>6.1%} of translated messages are tooltips.\n"
-              "    {:>6.1%} of messages are commented.\n"
-              "    The org msgids are currently made of {} signs.\n"
-              "    All processed translations are currently made of {} signs.\n"
-              "    {} specific context{} present:\n            {}\n"
-              "".format(glob_stats["nbr"], glob_stats["lvl"] / glob_stats["nbr"],
-                        glob_stats["lvl_ttips"] / glob_stats["nbr"],
-                        glob_stats["lvl_trans_ttips"] / glob_stats["nbr"],
-                        glob_stats["lvl_ttips_in_trans"] / glob_stats["nbr"],
-                        glob_stats["lvl_comm"] / glob_stats["nbr"], glob_stats["nbr_signs"],
-                        glob_stats["nbr_trans_signs"], nbr_contexts, _ctx_txt,
-                        "\n            ".join(glob_stats["contexts"]-{""})))
+    #if args.stats and glob_stats["nbr"] != 0.0:
+        #nbr_contexts = len(glob_stats["contexts"] - {""})
+        #if nbr_contexts != 1:
+            #if nbr_contexts == 0:
+                #nbr_contexts = "No"
+            #_ctx_txt = "s are"
+        #else:
+            #_ctx_txt = " is"
+        #print("\nAverage stats for all {:.0f} processed files:\n"
+              #"    {:>6.1%} done!\n"
+              #"    {:>6.1%} of messages are tooltips.\n"
+              #"    {:>6.1%} of tooltips are translated.\n"
+              #"    {:>6.1%} of translated messages are tooltips.\n"
+              #"    {:>6.1%} of messages are commented.\n"
+              #"    The org msgids are currently made of {} signs.\n"
+              #"    All processed translations are currently made of {} signs.\n"
+              #"    {} specific context{} present:\n            {}\n"
+              #"".format(glob_stats["nbr"], glob_stats["lvl"] / glob_stats["nbr"],
+                        #glob_stats["lvl_ttips"] / glob_stats["nbr"],
+                        #glob_stats["lvl_trans_ttips"] / glob_stats["nbr"],
+                        #glob_stats["lvl_ttips_in_trans"] / glob_stats["nbr"],
+                        #glob_stats["lvl_comm"] / glob_stats["nbr"], glob_stats["nbr_signs"],
+                        #glob_stats["nbr_trans_signs"], nbr_contexts, _ctx_txt,
+                        #"\n            ".join(glob_stats["contexts"]-{""})))
 
     return ret
 
diff --git a/release/scripts/modules/bl_i18n_utils/clean_po.py b/release/scripts/modules/bl_i18n_utils/clean_po.py
index 2924ad9..da8d25c 100755
--- a/release/scripts/modules/bl_i18n_utils/clean_po.py
+++ b/release/scripts/modules/bl_i18n_utils/clean_po.py
@@ -39,30 +39,27 @@ BRANCHES_DIR = settings.BRANCHES_DIR
 
 def do_clean(po, strict):
     print("Cleaning {}...".format(po))
-    messages, states, u1 = utils.parse_messages(po)
+    msgs = utils.I18nMessages(kind='PO', src=po)
 
-    if strict and states["is_broken"]:
+    if strict and msgs.parsing_errors:
         print("ERROR! This .po file is broken!")
         return 1
 
-    for msgkey in states["comm_msg"]:
-        del messages[msgkey]
-    utils.write_messages(po, messages, states["comm_msg"], states["fuzzy_msg"])
-    print("Removed {} commented messages.".format(len(states["comm_msg"])))
+    nbr_rem = len(msgs.comm_msgs)
+    for msgkey in msgs.comm_msgs:
+        del msgs.msgs[msgkey]
+    msgs.write(kind='PO', dest=po)
+    print("Removed {} commented messages.".format(nbr_rem))
     return 0
 
 
 def main():
     import argparse
-    parser = argparse.ArgumentParser(description="Clean po’s in branches " \
-                                                 "or trunk (i.e. remove " \
-                                                 "all commented messages).")
-    parser.add_argument('-t', '--trunk', action="store_true",
-                        help="Clean po’s in trunk rather than branches.")
-    parser.add_argument('-s', '--strict', action="store_true",
-                        help="Raise an error if a po is broken.")
-    parser.add_argument('langs', metavar='ISO_code', nargs='*',
-                        help="Restrict processed languages to those.")
+    parser = argparse.ArgumentParser(description="Clean po’s in branches or trunk (i.e. remove all commented "
+                                                 "messages).")
+    parser.add_argument('-t', '--trunk', action="store_true", help="Clean po’s in trunk rather than branches.")
+    parser.add_argument('-s', '--strict', action="store_true", help="Raise an error if a po is broken.")
+    parser.add_argument('langs', metavar='ISO_code', nargs='*', help="Restrict processed languages to those.")
     args = parser.parse_args()
 
     ret = 0
diff --git a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
index 533dded..956d2e9 100755
--- a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
+++ b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
@@ -26,7 +26,6 @@ import os
 import shutil
 import sys
 import subprocess
-from codecs import open
 
 try:
     import settings
@@ -48,14 +47,10 @@ PY3 = settings.PYTHON3_EXEC
 
 def main():
     import argparse
-    parser = argparse.ArgumentParser(description="Import advanced enough po’s " \
-                                                 "from branches to trunk.")
-    parser.add_argument('-t', '--threshold', type=int,
-                        help="Import threshold, as a percentage.")
-    parser.add_argument('-s', '--strict', action="store_true",
-                        help="Raise an error if a po is broken.")
-    parser.add_argument('langs', metavar='ISO_code', nargs='*',
-                        help="Restrict processed languages to those.")
+    parser = argparse.ArgumentParser(description="Import advanced enough po’s from branches to trunk.")
+    parser.add_argument('-t', '--threshold', type=float, help="Import threshold, as a percentage.")
+    parser.add_argument('-s', '--strict', action="store_true", help="Raise an error if a po is broken.")
+    parser.add_argument('langs', metavar='ISO_code', nargs='*', help="Restrict processed languages to those.")
     args = parser.parse_args()
 
     ret = 0
@@ -70,51 +65,40 @@ def main():
         po = os.path.join(BRANCHES_DIR, lang, ".".join((lang, "po")))
         if os.path.exists(po):
             po_is_rtl = os.path.join(BRANCHES_DIR, lang, RTL_PREPROCESS_FILE)
-            msgs, state, stats = utils.parse_messages(po)
-            tot_msgs = stats["tot_msg"]
-            trans_msgs = stats["trans_msg"]
+            msgs = utils.I18nMessages(iso=lang, kind='PO', src=po)
             lvl = 0.0
-            if tot_msgs:
-                lvl = float(trans_msgs) / float(tot_msgs)
+            if msgs.nbr_msgs:
+                lvl = msgs.nbr_trans_msgs / msgs.nbr_msgs
             if lvl > threshold:
-                if state["is_broken"] and args.strict:
-                    print("{:<10}: {:>6.1%} done, but BROKEN, skipped." \
-                          "".format(lang, lvl))
+                if msgs.parsing_errors and args.strict:
+                    print("{:<10}: {:>6.1%} done, but BROKEN, skipped.".format(lang, lvl))
                     ret = 1
                 else:
                     if os.path.exists(po_is_rtl):
-                        out_po = os.path.join(TRUNK_PO_DIR,
-                                              ".".join((lang, "po")))
-                        out_raw_po = os.path.join(TRUNK_PO_DIR,
-                                                  "_".join((lang, "raw.po")))
+                        out_po = os.path.join(TRUNK_PO_DIR, ".".join((lang, "po")))
+                        out_raw_po = os.path.join(TRUNK_PO_DIR, "_".join((lang, "raw.po")))
                         keys = []
                         trans = []
-                        for k, m in msgs.items():
+                        for k, m in msgs.msgs.items():
                             keys.append(k)
-                            trans.append("".join(m["msgstr_lines"]))
+                            trans.append(m.msgstr)
                         trans = rtl_preprocess.log2vis(trans)
                         for k, t in zip(keys, trans):
-                            # Mono-line for now...
-                            msgs[k]["msgstr_lines"] = [t]
-                        utils.write_messages(out_po, msgs, state["comm_msg"],
-                                             state["fuzzy_msg"])
+                            msgs.msgs[k].msgstr = t
+                        msgs.write(kind='PO', dest=out_po)
                         # Also copies org po!
                         shutil.copy(po, out_raw_po)
-                        print("{:<10}: {:>6.1%} done, enough translated " \
-                              "messages, processed and copied to trunk." \
+                        print("{:<10}: {:>6.1%} done, enough translated messages, processed and copied to trunk."
                               "".format(lang, lvl))
                     else:
                         shutil.copy(po, TRUNK_PO_DIR)
-                        print("{:<10}: {:>6.1%} done, enough translated " \
-                              "messages, copied to trunk.".format(lang, lvl))
+                        print("{:<10}: {:>6.1%} done, enough translated messages, copied to trunk.".format(lang, lvl))
             else:
-                if state["is_broken"] and args.strict:
-                    print("{:<10}: {:>6.1%} done, BROKEN and not enough " \
-                          "translated messages, skipped".format(lang, lvl))
+                if msgs.parsing_errors and args.strict:
+                    print("{:<10}: {:>6.1%} done, BROKEN and not enough translated messages, skipped".format(lang, lvl))
                     ret = 1
                 else:
-                    print("{:<10}: {:>6.1%} done, not enough translated " \
-                          "messages, skipped.".format(lang, lvl))
+                    print("{:<10}: {:>6.1%} done, not enough translated messages, skipped.".format(lang, lvl))
     return ret
 
 
diff --git a/release/scripts/modules/bl_i18n_utils/merge_po.py b/release/scripts/modules/bl_i18n_utils/merge_po.py
index baf67de..610be0f 100755
--- a/release/scripts/modules/bl_i18n_utils/merge_po.py
+++ b/release/scripts/modules/bl_i18n_utils/merge_po.py
@@ -37,26 +37,22 @@ except:
     from . import (settings, utils)
 
 
+# XXX This is a quick hack to make it work with new I18n... objects! To be reworked!
 def main():
     import argparse
-    parser = argparse.ArgumentParser(description="" \
-                    "Merge one or more .po files into the first dest one.\n" \
-                    "If a msgkey (msgctxt, msgid) is present in more than " \
-                    "one merged po, the one in the first file wins, unless " \
-                    "it’s marked as fuzzy and one later is not.\n" \
-                    "The fuzzy flag is removed if necessary.\n" \
-                    "All other comments are never modified.\n" \
-                    "Commented messages in dst will always remain " \
-                    "commented, and commented messages are never merged " \
+    parser = argparse.ArgumentParser(description=""
+                    "Merge one or more .po files into the first dest one.\n"
+                    "If a msgkey (msgctxt, msgid) is present in more than one merged po, the one in the first file "
+                    "wins, unless it’s marked as fuzzy and one later is not.\n"
+                    "The fuzzy flag is removed if necessary.\n"
+                    "All other comments are never modified.\n"
+                    "Commented messages in dst will always remain commented, and commented messages are never merged "
                     "from sources.")
-    parser.add_argument('-s', '--stats', action="store_true",
-                        help="Show statistics info.")
+    parser.add_argument('-s', '--stats', action="store_true", help="Show statistics info.")
     parser.add_argument('-r', '--replace', action="store_true",
                         help="Replace existing messages of same \"level\" already in dest po.")
-    parser.add_argument('dst', metavar='dst.po',
-                        help="The dest po into which merge the others.")
-    parser.add_argument('src', metavar='src.po', nargs='+',
-                        help="The po's to merge into the dst.po one.")
+    parser.add_argument('dst', metavar='dst.po', help="The dest po into which merge the others.")
+    parser.add_argument('src', metavar='src.po', nargs='+', help="The po's to merge into the dst.po one.")
     args = parser.parse_args()
 
     ret = 0
@@ -67,89 +63,78 @@ def main():
     nbr_added = 0
     nbr_unfuzzied = 0
 
-    dst_messages, dst_states, dst_stats = utils.parse_messages(args.dst)
-    if dst_states["is_broken"]:
+    dst_msgs = utils.I18nMessages(kind='PO', src=args.dst)
+    if dst_msgs.parsing_errors:
         print("Dest po is BROKEN, aborting.")
         return 1
     if args.stats:
         print("Dest po, before merging:")
-        utils.print_stats(dst_stats, prefix="\t")
-    # If we don’t want to replace existing valid translations, pre-populate
-    # done_msgkeys and done_fuzzy_msgkeys.
+        dst_msgs.print_stats(prefix="\t")
+    # If we don’t want to replace existing valid translations, pre-populate done_msgkeys and done_fuzzy_msgkeys.
     if not args.replace:
-        done_msgkeys = dst_states["trans_msg"].copy()
-        done_fuzzy_msgkeys = dst_states["fuzzy_msg"].copy()
+        done_msgkeys = dst_msgs.trans_msgs.copy()
+        done_fuzzy_msgkeys = dst_msgs.fuzzy_msgs.copy()
     for po in args.src:
-        messages, states, stats = utils.parse_messages(po)
-        if states["is_broken"]:
+        msgs = utils.I18nMessages(kind='PO', src=po)
+        if msgs.parsing_errors:
             print("\tSrc po {} is BROKEN, skipping.".format(po))
             ret = 1
             continue
         print("\tMerging {}...".format(po))
         if args.stats:
             print("\t\tMerged po stats:")
-            utils.print_stats(stats, prefix="\t\t\t")
-        for msgkey, val in messages.items():
+            msgs.print_stats(prefix="\t\t\t")
+        for msgkey, msg in msgs.msgs.items():
             msgctxt, msgid = msgkey
             # This msgkey has already been completely merged, or is a commented one,
             # or the new message is commented, skip it.
-            if msgkey in (done_msgkeys | dst_states["comm_msg"] | states["comm_msg"]):
+            if msgkey in (done_msgkeys | dst_msgs.comm_msgs | msgs.comm_msgs):
                 continue
-            is_ttip = utils.is_tooltip(msgid)
+            is_ttip = msg.is_tooltip
             # New messages does not yet exists in dest.
-            if msgkey not in dst_messages:
-                dst_messages[msgkey] = messages[msgkey]
-                if msgkey in states["fuzzy_msg"]:
+            if msgkey not in dst_msgs.msgs:
+                dst_msgs[msgkey] = msgs.msgs[msgkey]
+                if msgkey in msgs.fuzzy_msgs:
                     done_fuzzy_msgkeys.add(msgkey)
-                    dst_states["fuzzy_msg"].add(msgkey)
-                elif msgkey in states["trans_msg"]:
+                    dst_msgs.fuzzy_msgs.add(msgkey)
+                elif msgkey in msgs.trans_msgs:
                     done_msgkeys.add(msgkey)
-                    dst_states["trans_msg"].add(msgkey)
-                    dst_stats["trans_msg"] += 1
-                    if is_ttip:
-                        dst_stats["trans_ttips"] += 1
+                    dst_msgs.trans_msgs.add(msgkey)
                 nbr_added += 1
-                dst_stats["tot_msg"] += 1
-                if is_ttip:
-                    dst_stats["tot_ttips"] += 1
             # From now on, the new messages is already in dst.
             # New message is neither translated nor fuzzy, skip it.
-            elif msgkey not in (states["trans_msg"] | states["fuzzy_msg"]):
+            elif msgkey not in (msgs.trans_msgs | msgs.fuzzy_msgs):
                 continue
             # From now on, the new message is either translated or fuzzy!
             # The new message is translated.
-            elif msgkey in states["trans_msg"]:
-                dst_messages[msgkey]["msgstr_lines"] = messages[msgkey]["msgstr_lines"]
+            elif msgkey in msgs.trans_msgs:
+                dst_msgs.msgs[msgkey].msgstr = msg.msgstr
                 done_msgkeys.add(msgkey)
                 done_fuzzy_msgkeys.discard(msgkey)
-                if msgkey in dst_states["fuzzy_msg"]:
-                    dst_states["fuzzy_msg"].remove(msgkey)
+                if msgkey in dst_msgs.fuzzy_msgs:
+                    dst_msgs.fuzzy_msgs.remove(msgkey)
                     nbr_unfuzzied += 1
-                if msgkey not in dst_states["trans_msg"]:
-                    dst_states["trans_msg"].add(msgkey)
-                    dst_stats["trans_msg"] += 1
-                    if is_ttip:
-                        dst_stats["trans_ttips"] += 1
+                if msgkey not in dst_msgs.trans_msgs:
+                    dst_msgs.trans_msgs.add(msgkey)
                 else:
                     nbr_replaced += 1
                 nbr_merged += 1
-            # The new message is fuzzy, org one is fuzzy too,
-            # and this msgkey has not yet been merged.
-            elif msgkey not in (dst_states["trans_msg"] | done_fuzzy_msgkeys):
-                dst_messages[msgkey]["msgstr_lines"] = messages[msgkey]["msgstr_lines"]
+            # The new message is fuzzy, org one is fuzzy too, and this msgkey has not yet been merged.
+            elif msgkey not in (dst_msgs.trans_msgs | done_fuzzy_msgkeys):
+                dst_msgs[msgkey].msgstr = msg.msgstr
                 done_fuzzy_msgkeys.add(msgkey)
-                dst_states["fuzzy_msg"].add(msgkey)
+                dst_msgs.fuzzy_msgs.add(msgkey)
                 nbr_merged += 1
                 nbr_replaced += 1
 
-    utils.write_messages(args.dst, dst_messages, dst_states["comm_msg"], dst_states["fuzzy_msg"])
+    dst_msgs.write(kind='PO', dest=args.dst)
 
-    print("Merged completed. {} messages were merged (among which {} were replaced), " \
-          "{} were added, {} were \"un-fuzzied\"." \
-          "".format(nbr_merged, nbr_replaced, nbr_added, nbr_unfuzzied))
+    print("Merged completed. {} messages were merged (among which {} were replaced), {} were added, "
+          "{} were \"un-fuzzied\".".format(nbr_merged, nbr_replaced, nbr_added, nbr_unfuzzied))
     if args.stats:
+        dst_msgs.update_info()
         print("Final merged po stats:")
-        utils.print_stats(dst_stats, prefix="\t")
+        dst_msgs.print_stats(prefix="\t")
     return ret
 
 
diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py
index 0f09e82..7e37dff 100644
--- a/release/scripts/modules/bl_i18n_utils/settings.py
+++ b/release/scripts/modules/bl_i18n_utils/settings.py
@@ -83,6 +83,7 @@ LANGUAGES = (
     (37, "Amharic (አማርኛ)", "am_ET"),
     (38, "Uzbek (Oʻzbek)", "uz_UZ"),
     (39, "Uzbek Cyrillic (Ўзбек)", "uz_UZ at cyrillic"),
+    (40, "Hindi (मानक हिन्दी)", "hi_IN"),
 )
 
 # Name of language file used by Blender to generate translations' menu.
@@ -93,16 +94,65 @@ LANGUAGES_FILE = "languages"
 IMPORT_MIN_LEVEL = -1
 
 # Languages in /branches we do not want to import in /trunk currently...
-IMPORT_LANGUAGES_SKIP = {'am', 'bg', 'fi', 'el', 'et', 'ko', 'ne', 'pl', 'ro', 'uz', 'uz at cyrillic'}
+IMPORT_LANGUAGES_SKIP = {'am', 'bg', 'fi', 'el', 'et', 'ne', 'pl', 'ro', 'uz', 'uz at cyrillic'}
 
 # The comment prefix used in generated messages.txt file.
-COMMENT_PREFIX = "#~ "
+MSG_COMMENT_PREFIX = "#~ "
+
+# The comment prefix used in generated messages.txt file.
+MSG_CONTEXT_PREFIX = "MSGCTXT:"
+
+# The default comment prefix used in po's.
+PO_COMMENT_PREFIX= "# "
 
 # The comment prefix used to mark sources of msgids, in po's.
-COMMENT_PREFIX_SOURCE = "#: "
+PO_COMMENT_PREFIX_SOURCE = "#: "
 
-# The comment prefix used in generated messages.txt file.
-CONTEXT_PREFIX = "MSGCTXT:"
+# The comment prefix used to mark sources of msgids, in po's.
+PO_COMMENT_PREFIX_SOURCE_CUSTOM = "#. :src: "
+
+# The comment prefix used to comment entries in po's.
+PO_COMMENT_PREFIX_MSG= "#~ "
+
+# The comment prefix used to mark fuzzy msgids, in po's.
+PO_COMMENT_FUZZY = "#, fuzzy"
+
+# The prefix used to define context, in po's.
+PO_MSGCTXT = "msgctxt "
+
+# The prefix used to define msgid, in po's.
+PO_MSGID = "msgid "
+
+# The prefix used to define msgstr, in po's.
+PO_MSGSTR = "msgstr "
+
+# The 'header' key of po files.
+PO_HEADER_KEY = ("", "")
+
+PO_HEADER_MSGSTR = (
+    "Project-Id-Version: Blender {blender_ver} (r{blender_rev})\\n\n"
+    "Report-Msgid-Bugs-To: \\n\n"
+    "POT-Creation-Date: {time}\\n\n"
+    "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\n"
+    "Last-Translator: FULL NAME <EMAIL at ADDRESS>\\n\n"
+    "Language-Team: LANGUAGE <LL at li.org>\\n\n"
+    "Language: {iso}\\n\n"
+    "MIME-Version: 1.0\\n\n"
+    "Content-Type: text/plain; charset=UTF-8\\n\n"
+    "Content-Transfer-Encoding: 8bit\n"
+)
+PO_HEADER_COMMENT_COPYRIGHT = (
+    "# Blender's translation file (po format).\n"
+    "# Copyright (C) {year} The Blender Foundation.\n"
+    "# This file is distributed under the same license as the Blender package.\n"
+    "#\n"
+)
+PO_HEADER_COMMENT = (
+    "# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.\n"
+    "#"
+)
+
+TEMPLATE_ISO_ID = "__TEMPLATE__"
 
 # Default context.
 CONTEXT_DEFAULT = ""
@@ -121,8 +171,7 @@ PYGETTEXT_ALLOWED_EXTS = {".c", ".cpp", ".cxx", ".hpp", ".hxx", ".h"}
 PYGETTEXT_MAX_MULTI_CTXT = 16
 
 # Where to search contexts definitions, relative to SOURCE_DIR (defined below).
-PYGETTEXT_CONTEXTS_DEFSRC = os.path.join("source", "blender", "blenfont",
-                                         "BLF_translation.h")
+PYGETTEXT_CONTEXTS_DEFSRC = os.path.join("source", "blender", "blenfont", "BLF_translation.h")
 
 # Regex to extract contexts defined in BLF_translation.h
 # XXX Not full-proof, but should be enough here!
@@ -146,11 +195,21 @@ _str_base = (
     "(?P={_}2)"  # And closing quote.
 )
 str_clean_re = _str_base.format(_="g", capt="P<clean>")
+_inbetween_str_re = (
+    # XXX Strings may have comments between their pieces too, not only spaces!
+    r"(?:\s*(?:"
+        # A C comment
+        r"/\*.*(?!\*/).\*/|"
+        # Or a C++ one!
+        r"//[^\n]*\n"
+    # And we are done!
+    r")?)*"
+)
 # Here we have to consider two different cases (empty string and other).
 _str_whole_re = (
     _str_base.format(_="{_}1_", capt=":") +
     # Optional loop start, this handles "split" strings...
-    "(?:(?<=[\"'])\\s*(?=[\"'])(?:"
+    "(?:(?<=[\"'])" + _inbetween_str_re + "(?=[\"'])(?:"
         + _str_base.format(_="{_}2_", capt=":") +
     # End of loop.
     "))*"
@@ -168,9 +227,10 @@ PYGETTEXT_KEYWORDS = (() +
           for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_")) + 
 
     tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
-          for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf")) +
+          for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf",
+                     "CTX_wm_operator_poll_msg_set")) +
 
-    tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*,").format(it)
+    tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*\)").format(it)
           for it in ("BMO_error_raise",)) +
 
     tuple(("{}\\((?:[^\"',]+,)\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
@@ -231,6 +291,8 @@ WARN_MSGID_NOT_CAPITALIZED_ALLOWED = {
 }
 WARN_MSGID_NOT_CAPITALIZED_ALLOWED |= set(lng[2] for lng in LANGUAGES)
 
+PARSER_CACHE_HASH = 'sha1'
+
 
 ###############################################################################
 # PATHS
@@ -246,6 +308,10 @@ PYTHON3_EXEC = "python3"
 # The Blender executable!
 # This is just an example, you’ll most likely have to edit it in your user_settings.py!
 BLENDER_EXEC = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", "blender"))
+# check for blender.bin
+if not os.path.exists(BLENDER_EXEC):
+    if os.path.exists(BLENDER_EXEC + ".bin"):
+        BLENDER_EXEC = BLENDER_EXEC + ".bin"
 
 # The xgettext tool. You’ll likely have to edit it in your user_settings.py if you’re under Windows.
 GETTEXT_XGETTEXT_EXECUTABLE = "xgettext"
@@ -303,7 +369,10 @@ FILE_NAME_POT = os.path.join(TRUNK_PO_DIR, ".".join((DOMAIN, "pot")))
 
 # Other py files that should be searched for ui strings, relative to SOURCE_DIR.
 # Needed for Cycles, currently...
-CUSTOM_PY_UI_FILES = [os.path.join("intern", "cycles", "blender", "addon", "ui.py"),]
+CUSTOM_PY_UI_FILES = [
+    os.path.join("intern", "cycles", "blender", "addon", "ui.py"),
+    os.path.join("release", "scripts", "modules", "rna_prop_ui.py"),
+]
 
 
 # A cache storing validated msgids, to avoid re-spellchecking them.
diff --git a/release/scripts/modules/bl_i18n_utils/spell_check_utils.py b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py
index 3fd039c..6adf321 100644
--- a/release/scripts/modules/bl_i18n_utils/spell_check_utils.py
+++ b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py
@@ -37,7 +37,7 @@ dict_uimsgs = {
     "aren",  # aren't
     "betweens",  # yuck! in-betweens!
     "boolean", "booleans",
-    "couldn",  #couldn't
+    "couldn",  # couldn't
     "decrement",
     "derivate",
     "doesn",  # doesn't
@@ -220,11 +220,12 @@ dict_uimsgs = {
     "grless",
     "http",
     "init",
-    "kbit",
+    "kbit", "kb",
     "lensdist",
     "loc", "rot", "pos",
     "lorem",
     "luma",
+    "mem",
     "multicam",
     "num",
     "ok",
@@ -246,6 +247,7 @@ dict_uimsgs = {
     "tri", "tris",
     "uv", "uvs", "uvw", "uw", "uvmap",
     "vec",
+    "vel",  # velocity!
     "vert", "verts",
     "vis",
     "xyz", "xzy", "yxz", "yzx", "zxy", "zyx",
@@ -311,6 +313,7 @@ dict_uimsgs = {
     "inpaint",
     "lightmap",
     "lossless", "lossy",
+    "matcap",
     "midtones",
     "mipmap", "mipmaps", "mip",
     "ngon", "ngons",
@@ -488,6 +491,7 @@ dict_uimsgs = {
     # Files types/formats
     "avi",
     "attrac",
+    "autocad",
     "autodesk",
     "bmp",
     "btx",
diff --git a/release/scripts/modules/bl_i18n_utils/update_branches.py b/release/scripts/modules/bl_i18n_utils/update_branches.py
index 4c38a2f..1a22a98 100755
--- a/release/scripts/modules/bl_i18n_utils/update_branches.py
+++ b/release/scripts/modules/bl_i18n_utils/update_branches.py
@@ -43,42 +43,31 @@ FILE_NAME_POT = settings.FILE_NAME_POT
 
 def main():
     import argparse
-    parser = argparse.ArgumentParser(description="" \
-                                 "Update all branches:\n" \
-                                 "* Generate a temp messages.txt file.\n" \
-                                 "* Use it to generate a temp .pot file.\n" \
-                                 "* Use it to update all .po’s in /branches.")
-    parser.add_argument('--pproc-contexts', action="store_true",
-                        help="Pre-process po’s to avoid having plenty of "
-                             "fuzzy msgids just because a context was "
-                             "added/changed!")
-    parser.add_argument('-c', '--no_checks', default=True,
-                        action="store_false",
-                        help="No checks over UI messages.")
+    parser = argparse.ArgumentParser(description="Update all branches:\n"
+                                                 "* Generate a temp messages.txt file.\n"
+                                                 "* Use it to generate a blender.pot file.\n"
+                                                 "* Use it to update all .po’s in /branches.")
+    #parser.add_argument('--pproc-contexts', action="store_true",
+                        #help="Pre-process po’s to avoid having plenty of fuzzy msgids just because a context was "
+                             #"added/changed!")
+    parser.add_argument('-c', '--no_checks', default=True, action="store_false", help="No checks over UI messages.")
     parser.add_argument('-a', '--add', action="store_true",
-                        help="Add missing po’s (useful only when one or " \
-                             "more languages are given!).")
-    parser.add_argument('langs', metavar='ISO_code', nargs='*',
-                        help="Restrict processed languages to those.")
+                        help="Add missing po’s (useful only when one or more languages are given!).")
+    parser.add_argument('langs', metavar='ISO_code', nargs='*', help="Restrict processed languages to those.")
     args = parser.parse_args()
 
     ret = 0
 
     # Generate a temp messages file.
-    dummy, msgfile = tempfile.mkstemp(suffix=".txt",
-                                      prefix="blender_messages_")
+    dummy, msgfile = tempfile.mkstemp(suffix=".txt", prefix="blender_messages_")
     os.close(dummy)
     cmd = (PY3, "./update_msg.py", "-o", msgfile)
     t = subprocess.call(cmd)
     if t:
         ret = t
 
-    # Generate a temp pot file.
-    # Back to having a pot file in trunk/po. It's quite useful for translators that want to start
+    # Generate blender.pot file in trunk/po. It's quite useful for translators that want to start
     # a new translation and not not want to bother generating their own po from scratch!
-#    dummy, potfile = tempfile.mkstemp(suffix=".pot",
-#                                      prefix="blender_pot_")
-#    os.close(dummy)
     potfile = FILE_NAME_POT
     cmd = [PY3, "./update_pot.py", "-i", msgfile, "-o", potfile]
     if not args.no_checks:
@@ -93,8 +82,8 @@ def main():
         if args.add:
             cmd.append("-a")
         cmd += args.langs
-    if args.pproc_contexts:
-        cmd.append("--pproc-contexts")
+    #if args.pproc_contexts:
+        #cmd.append("--pproc-contexts")
     t = subprocess.call(cmd)
     if t:
         ret = t
diff --git a/release/scripts/modules/bl_i18n_utils/update_languages_menu.py b/release/scripts/modules/bl_i18n_utils/update_languages_menu.py
index 9b4cb20..6263f1c 100755
--- a/release/scripts/modules/bl_i18n_utils/update_languages_menu.py
+++ b/release/scripts/modules/bl_i18n_utils/update_languages_menu.py
@@ -73,11 +73,11 @@ def find_matching_po(languages, stats, forbidden):
 
 def main():
     import argparse
-    parser = argparse.ArgumentParser(description=""
-                        "Update 'languages' text file used by Blender at runtime to build translations menu.")
+    parser = argparse.ArgumentParser(description="Update 'languages' text file used by Blender at runtime to build "
+                                                 "translations menu.")
     parser.add_argument('-m', '--min_translation', type=int, default=-100,
-                        help="Minimum level of translation, as a percentage "
-                             "(translations below this are commented out in menu).")
+                        help="Minimum level of translation, as a percentage (translations below this are commented out "
+                             "in menu).")
     parser.add_argument('langs', metavar='ISO_code', nargs='*',
                         help="Unconditionally exclude those languages from the menu.")
     args = parser.parse_args()
@@ -92,8 +92,8 @@ def main():
     for po in os.listdir(TRUNK_PO_DIR):
         if po.endswith(".po") and not po.endswith("_raw.po"):
             lang = os.path.basename(po)[:-3]
-            u1, u2, _stats = utils.parse_messages(os.path.join(TRUNK_PO_DIR, po))
-            stats[lang] = _stats["trans_msg"] / _stats["tot_msg"]
+            msgs = utils.I18nMessages(kind='PO', src=os.path.join(TRUNK_PO_DIR, po))
+            stats[lang] = msgs.nbr_trans_msgs / msgs.nbr_msgs
 
     # Generate languages file used by Blender's i18n system.
     # First, match all entries in LANGUAGES to a lang in stats, if possible!
diff --git a/release/scripts/modules/bl_i18n_utils/update_mo.py b/release/scripts/modules/bl_i18n_utils/update_mo.py
index 7f68736..ab6fedc 100755
--- a/release/scripts/modules/bl_i18n_utils/update_mo.py
+++ b/release/scripts/modules/bl_i18n_utils/update_mo.py
@@ -51,11 +51,11 @@ def process_po(po, lang, mo=None):
 
     # show stats
     cmd = (GETTEXT_MSGFMT_EXECUTABLE,
-        "--statistics",
-        po,
-        "-o",
-        mo or os.path.join(mo_dir, ".".join((DOMAIN, "mo"))),
-        )
+           "--statistics",
+           po,
+           "-o",
+           mo or os.path.join(mo_dir, ".".join((DOMAIN, "mo"))),
+          )
 
     print("Running ", " ".join(cmd))
     ret = subprocess.call(cmd)
diff --git a/release/scripts/modules/bl_i18n_utils/update_po.py b/release/scripts/modules/bl_i18n_utils/update_po.py
index 4c6495c..eb12782 100755
--- a/release/scripts/modules/bl_i18n_utils/update_po.py
+++ b/release/scripts/modules/bl_i18n_utils/update_po.py
@@ -22,7 +22,7 @@
 
 # Update po’s in the branches from blender.pot in /trunk/po dir.
 
-import subprocess
+import concurrent.futures
 import os
 import sys
 from codecs import open
@@ -41,73 +41,25 @@ TRUNK_PO_DIR = settings.TRUNK_PO_DIR
 FILE_NAME_POT = settings.FILE_NAME_POT
 
 
-def pproc_newcontext_po(po, pot_messages, pot_stats):
-    print("Adding new contexts to {}...".format(po))
-    messages, state, stats = utils.parse_messages(po)
-    known_ctxt = stats["contexts"]
-    print("Already known (present) context(s): {}".format(str(known_ctxt)))
-
-    new_ctxt = set()
-    added = 0
-    # Only use valid already translated messages!
-    allowed_keys = state["trans_msg"] - state["fuzzy_msg"] - state["comm_msg"]
-    for key in pot_messages.keys():
-        ctxt, msgid = key
-        if ctxt in known_ctxt:
-            continue
-        new_ctxt.add(ctxt)
-        for t_ctxt in known_ctxt:
-            # XXX The first match will win, this might not be optimal...
-            t_key = (t_ctxt, msgid)
-            if t_key in allowed_keys:
-                # Wrong comments (sources) will be removed by msgmerge...
-                messages[key] = messages[t_key]
-                messages[key]["msgctxt_lines"] = [ctxt]
-                added += 1
-
-    utils.write_messages(po, messages, state["comm_msg"], state["fuzzy_msg"])
-    print("Finished!\n    {} new context(s) was/were added {}, adding {} new "
-          "messages.\n".format(len(new_ctxt), str(new_ctxt), added))
-    return 0
-
-
-def process_po(po, lang):
+def process_po(data):
+    po, lang, pot_msgs = data
     # update po file
-    cmd = (GETTEXT_MSGMERGE_EXECUTABLE,
-           "--update",
-           "-w", "1",  # XXX Ugly hack to prevent msgmerge merging
-                       #     short source comments together!
-           "--no-wrap",
-           "--backup=none",
-           "--lang={}".format(lang),
-           po,
-           FILE_NAME_POT,
-           )
-
+    msg = utils.I18nMessages(iso=lang, kind='PO', src=po)
     print("Updating {}...".format(po))
-    print("Running ", " ".join(cmd))
-    ret = subprocess.call(cmd)
-    print("Finished!\n")
-    return ret
+    msg.update(pot_msgs)
+    msg.write(kind='PO', dest=po)
+    print("Finished updating {}!\n".format(po))
+    return 0
 
 
 def main():
     import argparse
-    parser = argparse.ArgumentParser(description="Write out messages.txt "
-                                                 "from Blender.")
-    parser.add_argument('-t', '--trunk', action="store_true",
-                        help="Update po’s in /trunk/po rather than /branches.")
-    parser.add_argument('-i', '--input', metavar="File",
-                        help="Input pot file path.")
-    parser.add_argument('--pproc-contexts', action="store_true",
-                        help="Pre-process po’s to avoid having plenty of "
-                             "fuzzy msgids just because a context was "
-                             "added/changed!")
+    parser = argparse.ArgumentParser(description="Write out messages.txt from Blender.")
+    parser.add_argument('-t', '--trunk', action="store_true", help="Update po’s in /trunk/po rather than /branches.")
+    parser.add_argument('-i', '--input', metavar="File", help="Input pot file path.")
     parser.add_argument('-a', '--add', action="store_true",
-                        help="Add missing po’s (useful only when one or "
-                             "more languages are given!).")
-    parser.add_argument('langs', metavar='ISO_code', nargs='*',
-                        help="Restrict processed languages to those.")
+                        help="Add missing po’s (useful only when one or more languages are given!).")
+    parser.add_argument('langs', metavar='ISO_code', nargs='*', help="Restrict processed languages to those.")
     args = parser.parse_args()
 
     if args.input:
@@ -115,12 +67,8 @@ def main():
         FILE_NAME_POT = args.input
     ret = 0
 
-    if args.pproc_contexts:
-        _ctxt_proc = pproc_newcontext_po
-        pot_messages, _a, pot_stats = utils.parse_messages(FILE_NAME_POT)
-    else:
-        _ctxt_proc = lambda a, b, c: 0
-        pot_messages, pot_stats = None, None
+    pot_msgs = utils.I18nMessages(kind='PO', src=FILE_NAME_POT)
+    pool_data = []
 
     if args.langs:
         for lang in args.langs:
@@ -136,37 +84,30 @@ def main():
                 if not os.path.exists(po):
                     shutil.copy(FILE_NAME_POT, po)
             if args.add or os.path.exists(po):
-                t = _ctxt_proc(po, pot_messages, pot_stats)
-                if t:
-                    ret = t
-                t = process_po(po, lang)
-                if t:
-                    ret = t
+                pool_data.append((po, lang, pot_msgs))
     elif args.trunk:
         for po in os.listdir(TRUNK_PO_DIR):
             if po.endswith(".po"):
                 lang = os.path.basename(po)[:-3]
                 po = os.path.join(TRUNK_PO_DIR, po)
-                t = _ctxt_proc(po, pot_messages, pot_stats)
-                if t:
-                    ret = t
-                t = process_po(po, lang)
-                if t:
-                    ret = t
+                pool_data.append((po, lang, pot_msgs))
     else:
         for lang in os.listdir(BRANCHES_DIR):
             po = os.path.join(BRANCHES_DIR, lang, ".".join((lang, "po")))
             if os.path.exists(po):
-                t = _ctxt_proc(po, pot_messages, pot_stats)
-                if t:
-                    ret = t
-                t = process_po(po, lang)
-                if t:
-                    ret = t
+                pool_data.append((po, lang, pot_msgs))
+
+    for r in map(process_po, pool_data):
+        if r != 0:
+            ret = r
+    #with concurrent.futures.ProcessPoolExecutor() as executor:
+        #for r in executor.map(process_po, pool_data, timeout=600):
+            #if r != 0:
+                #ret = r
 
     return ret
 
 
 if __name__ == "__main__":
     print("\n\n *** Running {} *** \n".format(__file__))
-    sys.exit(main())
+    sys.exit(main())
\ No newline at end of file
diff --git a/release/scripts/modules/bl_i18n_utils/update_pot.py b/release/scripts/modules/bl_i18n_utils/update_pot.py
index ecb5d83..e05e609 100755
--- a/release/scripts/modules/bl_i18n_utils/update_pot.py
+++ b/release/scripts/modules/bl_i18n_utils/update_pot.py
@@ -23,6 +23,7 @@
 # Update blender.pot file from messages.txt
 
 import subprocess
+import collections
 import os
 import sys
 import re
@@ -41,9 +42,11 @@ except:
 LANGUAGES_CATEGORIES = settings.LANGUAGES_CATEGORIES
 LANGUAGES = settings.LANGUAGES
 
-COMMENT_PREFIX = settings.COMMENT_PREFIX
-COMMENT_PREFIX_SOURCE = settings.COMMENT_PREFIX_SOURCE
-CONTEXT_PREFIX = settings.CONTEXT_PREFIX
+PO_COMMENT_PREFIX = settings.PO_COMMENT_PREFIX
+PO_COMMENT_PREFIX_SOURCE = settings.PO_COMMENT_PREFIX_SOURCE
+PO_COMMENT_PREFIX_SOURCE_CUSTOM = settings.PO_COMMENT_PREFIX_SOURCE_CUSTOM
+MSG_COMMENT_PREFIX = settings.MSG_COMMENT_PREFIX
+MSG_CONTEXT_PREFIX = settings.MSG_CONTEXT_PREFIX
 FILE_NAME_MESSAGES = settings.FILE_NAME_MESSAGES
 FILE_NAME_POT = settings.FILE_NAME_POT
 SOURCE_DIR = settings.SOURCE_DIR
@@ -79,6 +82,10 @@ _clean_str = re.compile(settings.str_clean_re).finditer
 clean_str = lambda s: "".join(m.group("clean") for m in _clean_str(s))
 
 
+def _new_messages():
+    return getattr(collections, "OrderedDict", dict)()
+
+
 def check_file(path, rel_path, messages):
     def process_entry(ctxt, msg):
         # Context.
@@ -207,20 +214,22 @@ def get_svnrev():
 
 
 def gen_empty_pot():
+    blender_ver = ""
     blender_rev = get_svnrev().decode()
     utctime = time.gmtime()
     time_str = time.strftime("%Y-%m-%d %H:%M+0000", utctime)
     year_str = time.strftime("%Y", utctime)
 
-    return utils.gen_empty_messages(blender_rev, time_str, year_str)
+    return utils.I18nMessages.gen_empty_messages("__POT__", blender_ver, blender_rev, time_str, year_str)
 
 
 escape_re = tuple(re.compile(r[0]) for r in settings.ESCAPE_RE)
 escape = lambda s, n: escape_re[n].sub(settings.ESCAPE_RE[n][1], s)
 
 
-def merge_messages(msgs, states, messages, do_checks, spell_cache):
-    num_added = num_present = 0
+def merge_messages(msgs, messages, do_checks, spell_cache):
+    num_added = 0
+    num_present = msgs.nbr_msgs
     for (context, msgid), srcs in messages.items():
         if do_checks:
             err = spell_check(msgid, spell_cache)
@@ -233,19 +242,15 @@ def merge_messages(msgs, states, messages, do_checks, spell_cache):
         for n in range(len(escape_re)):
             msgid = escape(msgid, n)
 
-        srcs = [COMMENT_PREFIX_SOURCE + s for s in srcs]
-
         key = (context, msgid)
-        if key not in msgs:
-            msgs[key] = {"msgid_lines": [msgid],
-                         "msgstr_lines": [""],
-                         "comment_lines": srcs,
-                         "msgctxt_lines": [context]}
+        if key not in msgs.msgs:
+            msg = utils.I18nMessage([context], [msgid], [""], [])
+            msg.sources = srcs
+            msgs.msgs[key] = msg
             num_added += 1
         else:
-            # We need to merge comments!
-            msgs[key]["comment_lines"].extend(srcs)
-            num_present += 1
+            # We need to merge sources!
+            msgs.msgs[key].sources += srcs
 
     return num_added, num_present
 
@@ -270,7 +275,7 @@ def main():
 
     print("Running fake py gettext…")
     # Not using any more xgettext, simpler to do it ourself!
-    messages = utils.new_messages()
+    messages = _new_messages()
     py_xgettext(messages)
     print("Finished, found {} messages.".format(len(messages)))
 
@@ -281,55 +286,49 @@ def main():
         spell_cache = set()
 
     print("Generating POT file {}…".format(FILE_NAME_POT))
-    msgs, states = gen_empty_pot()
-    tot_messages, _a = merge_messages(msgs, states, messages,
-                                      True, spell_cache)
+    msgs = gen_empty_pot()
+    tot_messages, _a = merge_messages(msgs, messages, True, spell_cache)
 
     # add messages collected automatically from RNA
     print("\tMerging RNA messages from {}…".format(FILE_NAME_MESSAGES))
-    messages = utils.new_messages()
+    messages.clear()
     with open(FILE_NAME_MESSAGES, encoding="utf-8") as f:
         srcs = []
         context = ""
         for line in f:
             line = utils.stripeol(line)
 
-            if line.startswith(COMMENT_PREFIX):
-                srcs.append(line[len(COMMENT_PREFIX):].strip())
-            elif line.startswith(CONTEXT_PREFIX):
-                context = line[len(CONTEXT_PREFIX):].strip()
+            if line.startswith(MSG_COMMENT_PREFIX):
+                srcs.append(line[len(MSG_COMMENT_PREFIX):].strip())
+            elif line.startswith(MSG_CONTEXT_PREFIX):
+                context = line[len(MSG_CONTEXT_PREFIX):].strip()
             else:
                 key = (context, line)
                 messages[key] = srcs
                 srcs = []
                 context = ""
-    num_added, num_present = merge_messages(msgs, states, messages,
-                                            True, spell_cache)
+    num_added, num_present = merge_messages(msgs, messages, True, spell_cache)
     tot_messages += num_added
-    print("\tMerged {} messages ({} were already present)."
-          "".format(num_added, num_present))
+    print("\tMerged {} messages ({} were already present).".format(num_added, num_present))
 
     print("\tAdding languages labels...")
-    messages = {(CONTEXT_DEFAULT, lng[1]):
-                ("Languages’ labels from bl_i18n_utils/settings.py",)
-                for lng in LANGUAGES}
-    messages.update({(CONTEXT_DEFAULT, cat[1]):
-                     ("Language categories’ labels from bl_i18n_utils/settings.py",)
-                     for cat in LANGUAGES_CATEGORIES})
-    num_added, num_present = merge_messages(msgs, states, messages,
-                                            True, spell_cache)
+    messages.clear()
+    messages.update(((CONTEXT_DEFAULT, lng[1]), ("Languages’ labels from bl_i18n_utils/settings.py",))
+                    for lng in LANGUAGES)
+    messages.update(((CONTEXT_DEFAULT, cat[1]), ("Language categories’ labels from bl_i18n_utils/settings.py",))
+                     for cat in LANGUAGES_CATEGORIES)
+    num_added, num_present = merge_messages(msgs, messages, True, spell_cache)
     tot_messages += num_added
     print("\tAdded {} language messages.".format(num_added))
 
     # Write back all messages into blender.pot.
-    utils.write_messages(FILE_NAME_POT, msgs, states["comm_msg"],
-                         states["fuzzy_msg"])
+    msgs.write('PO', FILE_NAME_POT)
 
     if SPELL_CACHE and spell_cache:
         with open(SPELL_CACHE, 'wb') as f:
             pickle.dump(spell_cache, f)
 
-    print("Finished, total: {} messages!".format(tot_messages - 1))
+    print("Finished, total: {} messages!".format(tot_messages))
 
     return 0
 
diff --git a/release/scripts/modules/bl_i18n_utils/update_trunk.py b/release/scripts/modules/bl_i18n_utils/update_trunk.py
index b84a227..d7d1a97 100755
--- a/release/scripts/modules/bl_i18n_utils/update_trunk.py
+++ b/release/scripts/modules/bl_i18n_utils/update_trunk.py
@@ -25,8 +25,7 @@
 # * Copy po’s from branches advanced enough.
 # * Clean po’s in trunk.
 # * Compile po’s in trunk in mo’s, keeping track of those failing.
-# * Remove po’s, mo’s (and their dir’s) that failed to compile or
-#   are no more present in trunk.
+# * Remove po’s, mo’s (and their dir’s) that failed to compile or are no more present in trunk.
 
 import subprocess
 import os
@@ -50,25 +49,6 @@ LANGUAGES_FILE = settings.LANGUAGES_FILE
 PY3 = settings.PYTHON3_EXEC
 
 
-def find_matching_po(languages, stats):
-    """Match languages defined in LANGUAGES setting to relevant po, if possible!"""
-    ret = []
-    for uid, label, org_key in languages:
-        key = org_key
-        if key not in stats:
-            # Try to simplify the key (eg from es_ES to es).
-            if '_' in org_key:
-                key = org_key[0:org_key.index('_')]
-            if '@' in org_key:
-                key = key + org_key[org_key.index('@'):]
-        if key in stats:
-            ret.append((stats[key], uid, label, org_key))
-        else:
-            # Mark invalid entries, so that we can put them in the languages file,
-            # but commented!
-            ret.append((0.0, -uid, label, org_key))
-    return ret
-
 def main():
     import argparse
     parser = argparse.ArgumentParser(description=""
@@ -99,7 +79,8 @@ def main():
             os.remove(po)
 
     # Copy po’s from branches.
-    cmd = [PY3, "./import_po_from_branches.py", "-s"]
+    #cmd = [PY3, "./import_po_from_branches.py", "-s"]
+    cmd = [PY3, "./import_po_from_branches.py"]
     if args.threshold is not None:
         cmd += ["-t", str(args.threshold)]
     if args.langs:
@@ -124,7 +105,8 @@ def main():
             if args.langs and lang not in args.langs:
                 continue
 
-            cmd = [PY3, "./clean_po.py", "-t", "-s", lang]
+            #cmd = [PY3, "./clean_po.py", "-t", "-s", lang]
+            cmd = [PY3, "./clean_po.py", "-t", lang]
             t = subprocess.call(cmd)
             if t:
                 ret = t
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index 9481f75..f7a7480 100644
--- a/release/scripts/modules/bl_i18n_utils/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
@@ -20,357 +20,724 @@
 
 # Some misc utilities...
 
+import collections
+import concurrent.futures
+import copy
 import os
+import re
 import sys
-import collections
 
 from bl_i18n_utils import settings
 
 
-COMMENT_PREFIX = settings.COMMENT_PREFIX
+PO_COMMENT_PREFIX = settings.PO_COMMENT_PREFIX
+PO_COMMENT_PREFIX_MSG = settings.PO_COMMENT_PREFIX_MSG
+PO_COMMENT_PREFIX_SOURCE = settings.PO_COMMENT_PREFIX_SOURCE
+PO_COMMENT_PREFIX_SOURCE_CUSTOM = settings.PO_COMMENT_PREFIX_SOURCE_CUSTOM
+PO_COMMENT_FUZZY = settings.PO_COMMENT_FUZZY
+PO_MSGCTXT = settings.PO_MSGCTXT
+PO_MSGID = settings.PO_MSGID
+PO_MSGSTR = settings.PO_MSGSTR
+
+PO_HEADER_KEY = settings.PO_HEADER_KEY
+PO_HEADER_COMMENT = settings.PO_HEADER_COMMENT
+PO_HEADER_COMMENT_COPYRIGHT = settings.PO_HEADER_COMMENT_COPYRIGHT
+PO_HEADER_MSGSTR = settings.PO_HEADER_MSGSTR
+
+PARSER_CACHE_HASH = settings.PARSER_CACHE_HASH
+
 WARN_NC = settings.WARN_MSGID_NOT_CAPITALIZED
 NC_ALLOWED = settings.WARN_MSGID_NOT_CAPITALIZED_ALLOWED
+PARSER_CACHE_HASH = settings.PARSER_CACHE_HASH
 
 
+##### Misc Utils #####
+
 def stripeol(s):
     return s.rstrip("\n\r")
 
 
-# XXX For now, we assume that all messages > 30 chars are tooltips!
-def is_tooltip(msgid):
-    return len(msgid) > 30
+_valid_po_path_re = re.compile(r"^\S+:[0-9]+$")
+def is_valid_po_path(path):
+    return bool(_valid_po_path_re.match(path))
+
+
+def get_best_similar(data):
+    import difflib
+    key, use_similar, similar_pool = data
+
+    # try to find some close key in existing messages...
+    # Optimized code inspired by difflib.get_close_matches (as we only need the best match).
+    # We also consider to never make a match when len differs more than -len_key / 2, +len_key * 2 (which is valid
+    # as long as use_similar is not below ~0.7).
+    # Gives an overall ~20% of improvement!
+    #tmp = difflib.get_close_matches(key[1], similar_pool, n=1, cutoff=use_similar)
+    #if tmp:
+        #tmp = tmp[0]
+    tmp = None
+    s = difflib.SequenceMatcher()
+    s.set_seq2(key[1])
+    len_key = len(key[1])
+    min_len = len_key // 2
+    max_len = len_key * 2
+    for x in similar_pool:
+        if min_len < len(x) < max_len:
+            s.set_seq1(x)
+            if s.real_quick_ratio() >= use_similar and s.quick_ratio() >= use_similar:
+                sratio = s.ratio()
+                if sratio >= use_similar:
+                    tmp = x
+                    use_similar = sratio
+    return key, tmp
+
+
+class I18nMessage:
+    """
+    Internal representation of a message.
+    """
+    __slots__ = ("msgctxt_lines", "msgid_lines", "msgstr_lines", "comment_lines", "is_fuzzy", "is_commented")
+
+    def __init__(self, msgctxt_lines=[], msgid_lines=[], msgstr_lines=[], comment_lines=[],
+                 is_commented=False, is_fuzzy=False):
+        self.msgctxt_lines = msgctxt_lines
+        self.msgid_lines = msgid_lines
+        self.msgstr_lines = msgstr_lines
+        self.comment_lines = comment_lines
+        self.is_fuzzy = is_fuzzy
+        self.is_commented = is_commented
+
+    def _get_msgctxt(self):
+        return ("".join(self.msgctxt_lines)).replace("\\n", "\n")
+    def _set_msgctxt(self, ctxt):
+        self.msgctxt_lines = [ctxt]
+    msgctxt = property(_get_msgctxt, _set_msgctxt)
+
+    def _get_msgid(self):
+        return ("".join(self.msgid_lines)).replace("\\n", "\n")
+    def _set_msgid(self, msgid):
+        self.msgid_lines = [msgid]
+    msgid = property(_get_msgid, _set_msgid)
+
+    def _get_msgstr(self):
+        return ("".join(self.msgstr_lines)).replace("\\n", "\n")
+    def _set_msgstr(self, msgstr):
+        self.msgstr_lines = [msgstr]
+    msgstr = property(_get_msgstr, _set_msgstr)
+
+    def _get_sources(self):
+        lstrip1 = len(PO_COMMENT_PREFIX_SOURCE)
+        lstrip2 = len(PO_COMMENT_PREFIX_SOURCE_CUSTOM)
+        return ([l[lstrip1:] for l in self.comment_lines if l.startswith(PO_COMMENT_PREFIX_SOURCE)] +
+                [l[lstrip2:] for l in self.comment_lines if l.startswith(PO_COMMENT_PREFIX_SOURCE_CUSTOM)])
+    def _set_sources(self, sources):
+        # list.copy() is not available in py3.2 ...
+        cmmlines = []
+        cmmlines[:] = self.comment_lines
+        for l in cmmlines:
+            if l.startswith(PO_COMMENT_PREFIX_SOURCE) or l.startswith(PO_COMMENT_PREFIX_SOURCE_CUSTOM):
+                self.comment_lines.remove(l)
+        lines_src = []
+        lines_src_custom = []
+        for src in  sources:
+            if is_valid_po_path(src):
+                lines_src.append(PO_COMMENT_PREFIX_SOURCE + src)
+            else:
+                lines_src_custom.append(PO_COMMENT_PREFIX_SOURCE_CUSTOM + src)
+        self.comment_lines += lines_src_custom + lines_src
+    sources = property(_get_sources, _set_sources)
+
+    def _get_is_tooltip(self):
+        # XXX For now, we assume that all messages > 30 chars are tooltips!
+        return len(self.msgid) > 30
+    is_tooltip = property(_get_is_tooltip)
+
+    def normalize(self, max_len=80):
+        """
+        Normalize this message, call this before exporting it...
+        Currently normalize msgctxt, msgid and msgstr lines to given max_len (if below 1, make them single line).
+        """
+        max_len -= 2  # The two quotes!
+        # We do not need the full power of textwrap... We just split first at escaped new lines, then into each line
+        # if needed... No word splitting, nor fancy spaces handling!
+        def _wrap(text, max_len, init_len):
+            if len(text) + init_len < max_len:
+                return [text]
+            lines = text.splitlines()
+            ret = []
+            for l in lines:
+                tmp = []
+                cur_len = 0
+                words = l.split(' ')
+                for w in words:
+                    cur_len += len(w) + 1
+                    if cur_len > (max_len - 1) and tmp:
+                        ret.append(" ".join(tmp) + " ")
+                        del tmp[:]
+                        cur_len = len(w) + 1
+                    tmp.append(w)
+                if tmp:
+                    ret.append(" ".join(tmp))
+            return ret
+        if max_len < 1:
+            self.msgctxt_lines = self.msgctxt.replace("\n", "\\n\n").splitlines()
+            self.msgid_lines = self.msgid.replace("\n", "\\n\n").splitlines()
+            self.msgstr_lines = self.msgstr.replace("\n", "\\n\n").splitlines()
+        else:
+            init_len = len(PO_MSGCTXT) + 1
+            if self.is_commented:
+                init_len += len(PO_COMMENT_PREFIX_MSG)
+            self.msgctxt_lines = _wrap(self.msgctxt.replace("\n", "\\n\n"), max_len, init_len)
 
+            init_len = len(PO_MSGID) + 1
+            if self.is_commented:
+                init_len += len(PO_COMMENT_PREFIX_MSG)
+            self.msgid_lines = _wrap(self.msgid.replace("\n", "\\n\n"), max_len, init_len)
 
-def new_messages():
-    return getattr(collections, 'OrderedDict', dict)()
+            init_len = len(PO_MSGSTR) + 1
+            if self.is_commented:
+                init_len += len(PO_COMMENT_PREFIX_MSG)
+            self.msgstr_lines = _wrap(self.msgstr.replace("\n", "\\n\n"), max_len, init_len)
 
 
-def parse_messages(fname):
+class I18nMessages:
     """
-    Returns a tupple (messages, states, stats).
-    messages is an odereddict of dicts
-        {(ctxt, msgid): {msgid_lines:, msgstr_lines:,
-                         comment_lines:, msgctxt_lines:}}.
-    states is a dict of three sets of (msgid, ctxt), and a boolean flag
-        indicating the .po is somewhat broken
-        {trans_msg:, fuzzy_msg:, comm_msg:, is_broken:}.
-    stats is a dict of values
-        {tot_msg:, trans_msg:, tot_ttips:, trans_ttips:, comm_msg:,
-         nbr_signs:, nbr_trans_signs:, contexts: set()}.
-    Note: This function will silently "arrange" mis-formated entries, thus
-        using afterward write_messages() should always produce a po-valid file,
-        though not correct!
+    Internal representation of messages for one language (iso code), with additional stats info.
     """
-    tot_messages = 0
-    tot_tooltips = 0
-    trans_messages = 0
-    trans_tooltips = 0
-    comm_messages = 0
-    nbr_signs = 0
-    nbr_trans_signs = 0
-    contexts = set()
-    reading_msgid = False
-    reading_msgstr = False
-    reading_msgctxt = False
-    reading_comment = False
-    is_translated = False
-    is_fuzzy = False
-    is_commented = False
-    is_broken = False
-    msgid_lines = []
-    msgstr_lines = []
-    msgctxt_lines = []
-    comment_lines = []
-
-    messages = new_messages()
-    translated_messages = set()
-    fuzzy_messages = set()
-    commented_messages = set()
-
-    def clean_vars():
-        nonlocal reading_msgid, reading_msgstr, reading_msgctxt, \
-                 reading_comment, is_fuzzy, is_translated, is_commented, \
-                 msgid_lines, msgstr_lines, msgctxt_lines, comment_lines
-        reading_msgid = reading_msgstr = reading_msgctxt = \
-                        reading_comment = False
-        is_tooltip = is_fuzzy = is_translated = is_commented = False
+
+    # Avoid parsing again!
+    # Keys should be (pseudo) file-names, values are tuples (hash, I18nMessages)
+    # Note: only used by po parser currently!
+    _parser_cache = {}
+
+    def __init__(self, iso="__POT__", kind=None, key=None, src=None):
+        self.iso = iso
+        self.msgs = self._new_messages()
+        self.trans_msgs = set()
+        self.fuzzy_msgs = set()
+        self.comm_msgs = set()
+        self.ttip_msgs = set()
+        self.contexts = set()
+        self.nbr_msgs = 0
+        self.nbr_trans_msgs = 0
+        self.nbr_ttips = 0
+        self.nbr_trans_ttips = 0
+        self.nbr_comm_msgs = 0
+        self.nbr_signs = 0
+        self.nbr_trans_signs = 0
+        self.parsing_errors = []
+        if kind and src:
+            self.parse(kind, key, src)
+        self.update_info()
+
+    @staticmethod
+    def _new_messages():
+        return getattr(collections, 'OrderedDict', dict)()
+
+    @classmethod
+    def gen_empty_messages(cls, iso, blender_ver, blender_rev, time, year, default_copyright=True):
+        """Generate an empty I18nMessages object (only header is present!)."""
+        msgstr = PO_HEADER_MSGSTR.format(blender_ver=str(blender_ver), blender_rev=int(blender_rev),
+                                         time=str(time), iso=str(iso))
+        comment = ""
+        if default_copyright:
+            comment = PO_HEADER_COMMENT_COPYRIGHT.format(year=str(year))
+        comment = comment + PO_HEADER_COMMENT
+
+        msgs = cls(iso=iso)
+        msgs.msgs[PO_HEADER_KEY] = I18nMessage([], [""], [msgstr], [comment], False, True)
+        msgs.update_info()
+
+        return msgs
+
+    def normalize(self, max_len=80):
+        for msg in self.msgs.values():
+            msg.normalize(max_len)
+
+    def merge(self, replace=False, *args):
+        pass
+
+    def update(self, ref, use_similar=0.75, keep_old_commented=True):
+        """
+        Update this I18nMessage with the ref one. Translations from ref are never used. Source comments from ref
+        completely replace current ones. If use_similar is not 0.0, it will try to match new messages in ref with an
+        existing one. Messages no more found in ref will be marked as commented if keep_old_commented is True,
+        or removed.
+        """
+        similar_pool = {}
+        if use_similar > 0.0:
+            for key, msg in self.msgs.items():
+                if msg.msgstr:  # No need to waste time with void translations!
+                    similar_pool.setdefault(key[1], set()).add(key)
+
+        msgs = self._new_messages().fromkeys(ref.msgs.keys())
+        ref_keys = set(ref.msgs.keys())
+        org_keys = set(self.msgs.keys())
+        new_keys = ref_keys - org_keys
+        removed_keys = org_keys - ref_keys
+
+        # First process keys present in both org and ref messages.
+        for key in ref_keys - new_keys:
+            msg, refmsg = self.msgs[key], ref.msgs[key]
+            msg.sources = refmsg.sources
+            msg.is_commented = refmsg.is_commented
+            msg.is_fuzzy = refmsg.is_fuzzy
+            msgs[key] = msg
+
+        # Next process new keys.
+        if use_similar > 0.0:
+            with concurrent.futures.ProcessPoolExecutor() as exctr:
+                for key, msgid in exctr.map(get_best_similar,
+                                            tuple((nk, use_similar, tuple(similar_pool.keys())) for nk in new_keys)):
+                    if msgid:
+                        # Try to get the same context, else just get one...
+                        skey = (key[0], msgid)
+                        if skey not in similar_pool[msgid]:
+                            skey = tuple(similar_pool[msgid])[0]
+                        # We keep org translation and comments, and mark message as fuzzy.
+                        msg, refmsg = copy.deepcopy(self.msgs[skey]), ref.msgs[key]
+                        msg.msgctxt = refmsg.msgctxt
+                        msg.msgid = refmsg.msgid
+                        msg.sources = refmsg.sources
+                        msg.is_fuzzy = True
+                        msg.is_commented = refmsg.is_commented
+                        msgs[key] = msg
+                    else:
+                        msgs[key] = ref.msgs[key]
+        else:
+            for key in new_keys:
+                msgs[key] = ref.msgs[key]
+
+        # Add back all "old" and already commented messages as commented ones, if required
+        # (and translation was not void!).
+        if keep_old_commented:
+            for key in removed_keys:
+                msgs[key] = self.msgs[key]
+                msgs[key].is_commented = True
+                msgs[key].sources = []
+
+        # Special 'meta' message, change project ID version and pot creation date...
+        key = ("", "")
+        rep = []
+        markers = ("Project-Id-Version:", "POT-Creation-Date:")
+        for mrk in markers:
+            for rl in ref.msgs[key].msgstr_lines:
+                if rl.startswith(mrk):
+                    for idx, ml in enumerate(msgs[key].msgstr_lines):
+                        if ml.startswith(mrk):
+                            rep.append((idx, rl))
+        for idx, txt in rep:
+            msgs[key].msgstr_lines[idx] = txt
+
+        # And finalize the update!
+        self.msgs = msgs
+
+    def update_info(self):
+        self.trans_msgs.clear()
+        self.fuzzy_msgs.clear()
+        self.comm_msgs.clear()
+        self.ttip_msgs.clear()
+        self.contexts.clear()
+        self.nbr_signs = 0
+        self.nbr_trans_signs = 0
+        for key, msg in self.msgs.items():
+            if key == PO_HEADER_KEY:
+                continue
+            if msg.is_commented:
+                self.comm_msgs.add(key)
+            else:
+                if msg.msgstr:
+                    self.trans_msgs.add(key)
+                if msg.is_fuzzy:
+                    self.fuzzy_msgs.add(key)
+                if msg.is_tooltip:
+                    self.ttip_msgs.add(key)
+                self.contexts.add(key[0])
+                self.nbr_signs += len(msg.msgid)
+                self.nbr_trans_signs += len(msg.msgstr)
+        self.nbr_msgs = len(self.msgs)
+        self.nbr_trans_msgs = len(self.trans_msgs)
+        self.nbr_ttips = len(self.ttip_msgs)
+        self.nbr_trans_ttips = len(self.ttip_msgs & self.trans_msgs)
+        self.nbr_comm_msgs = len(self.comm_msgs)
+
+    def print_stats(self, prefix=""):
+        """
+        Print out some stats about an I18nMessages object.
+        """
+        lvl = 0.0
+        lvl_ttips = 0.0
+        lvl_comm = 0.0
+        lvl_trans_ttips = 0.0
+        lvl_ttips_in_trans = 0.0
+        if self.nbr_msgs > 0:
+            lvl = float(self.nbr_trans_msgs) / float(self.nbr_msgs)
+            lvl_ttips = float(self.nbr_ttips) / float(self.nbr_msgs)
+            lvl_comm = float(self.nbr_comm_msgs) / float(self.nbr_msgs + self.nbr_comm_msgs)
+        if self.nbr_ttips > 0:
+            lvl_trans_ttips = float(self.nbr_trans_ttips) / float(self.nbr_ttips)
+        if self.nbr_trans_msgs > 0:
+            lvl_ttips_in_trans = float(self.nbr_trans_ttips) / float(self.nbr_trans_msgs)
+
+        lines = ("",
+                 "{:>6.1%} done! ({} translated messages over {}).\n"
+                 "".format(lvl, self.nbr_trans_msgs, self.nbr_msgs),
+                 "{:>6.1%} of messages are tooltips ({} over {}).\n"
+                 "".format(lvl_ttips, self.nbr_ttips, self.nbr_msgs),
+                 "{:>6.1%} of tooltips are translated ({} over {}).\n"
+                 "".format(lvl_trans_ttips, self.nbr_trans_ttips, self.nbr_ttips),
+                 "{:>6.1%} of translated messages are tooltips ({} over {}).\n"
+                 "".format(lvl_ttips_in_trans, self.nbr_trans_ttips, self.nbr_trans_msgs),
+                 "{:>6.1%} of messages are commented ({} over {}).\n"
+                 "".format(lvl_comm, self.nbr_comm_msgs, self.nbr_comm_msgs + self.nbr_msgs),
+                 "This translation is currently made of {} signs.\n".format(self.nbr_trans_signs))
+        print(prefix.join(lines))
+
+    def parse(self, kind, key, src):
+        del self.parsing_errors[:]
+        self.parsers[kind](self, src, key)
+        if self.parsing_errors:
+            print("WARNING! Errors while parsing {}:".format(key))
+            for line, error in self.parsing_errors:
+                print("    Around line {}: {}".format(line, error))
+            print("The parser solved them as well as it could...")
+        self.update_info()
+
+    def parse_messages_from_po(self, src, key=None):
+        """
+        Parse a po file.
+        Note: This function will silently "arrange" mis-formated entries, thus using afterward write_messages() should
+              always produce a po-valid file, though not correct!
+        """
+        reading_msgid = False
+        reading_msgstr = False
+        reading_msgctxt = False
+        reading_comment = False
+        is_commented = False
+        is_fuzzy = False
+        msgctxt_lines = []
         msgid_lines = []
         msgstr_lines = []
-        msgctxt_lines = []
         comment_lines = []
 
-    def finalize_message():
-        nonlocal reading_msgid, reading_msgstr, reading_msgctxt, \
-                 reading_comment, is_fuzzy, is_translated, is_commented, \
-                 msgid_lines, msgstr_lines, msgctxt_lines, comment_lines, \
-                 messages, translated_messages, fuzzy_messages, \
-                 commented_messages, \
-                 tot_messages, tot_tooltips, trans_messages, trans_tooltips, \
-                 comm_messages, nbr_signs, nbr_trans_signs, contexts
-
-        msgid = "".join(msgid_lines)
-        msgctxt = "".join(msgctxt_lines)
-        msgkey = (msgctxt, msgid)
-        is_ttip = is_tooltip(msgid)
-
-        # Never allow overriding existing msgid/msgctxt pairs!
-        if msgkey in messages:
-            clean_vars()
-            return
-
-        nbr_signs += len(msgid)
-        if is_commented:
-            commented_messages.add(msgkey)
-        elif is_fuzzy:
-            fuzzy_messages.add(msgkey)
-        elif is_translated:
-            translated_messages.add(msgkey)
-            nbr_trans_signs += len("".join(msgstr_lines))
-        messages[msgkey] = {"msgid_lines"  : msgid_lines,
-                            "msgstr_lines" : msgstr_lines,
-                            "comment_lines": comment_lines,
-                            "msgctxt_lines": msgctxt_lines}
-
-        if is_commented:
-            comm_messages += 1
-        else:
-            tot_messages += 1
-            if is_ttip:
-                tot_tooltips += 1
-            if not is_fuzzy and is_translated:
-                trans_messages += 1
-                if is_ttip:
-                    trans_tooltips += 1
-            if msgctxt not in contexts:
-                contexts.add(msgctxt)
-
-        clean_vars()
-
-    with open(fname, 'r', encoding="utf-8") as f:
-        for line_nr, line in enumerate(f):
-            line = stripeol(line)
+        # Helper function
+        def finalize_message(self, line_nr):
+            nonlocal reading_msgid, reading_msgstr, reading_msgctxt, reading_comment
+            nonlocal is_commented, is_fuzzy, msgid_lines, msgstr_lines, msgctxt_lines, comment_lines
+
+            msgid = "".join(msgid_lines)
+            msgctxt = "".join(msgctxt_lines)
+            msgkey = (msgctxt, msgid)
+
+            # Never allow overriding existing msgid/msgctxt pairs!
+            if msgkey in self.msgs:
+                self.parsing_errors.append((line_nr, "{} context/msgid is already in current messages!".format(msgkey)))
+                return
+
+            self.msgs[msgkey] = I18nMessage(msgctxt_lines, msgid_lines, msgstr_lines, comment_lines,
+                                            is_commented, is_fuzzy)
+
+            # Let's clean up and get ready for next message!
+            reading_msgid = reading_msgstr = reading_msgctxt = reading_comment = False
+            is_commented = is_fuzzy = False
+            msgctxt_lines = []
+            msgid_lines = []
+            msgstr_lines = []
+            comment_lines = []
+
+        # try to use src as file name...
+        if os.path.exists(src):
+            if not key:
+                key = src
+            with open(src, 'r', encoding="utf-8") as f:
+                src = f.read()
+
+        # Try to use values from cache!
+        curr_hash = None
+        if key and key in self._parser_cache:
+            old_hash, msgs = self._parser_cache[key]
+            import hashlib
+            curr_hash = hashlib.new(PARSER_CACHE_HASH, src.encode()).digest()
+            if curr_hash == old_hash:
+                self.msgs = copy.deepcopy(msgs)  # we might edit self.msgs!
+                return
+
+        _comm_msgctxt = PO_COMMENT_PREFIX_MSG + PO_MSGCTXT
+        _len_msgctxt = len(PO_MSGCTXT + '"')
+        _len_comm_msgctxt = len(_comm_msgctxt + '"')
+        _comm_msgid = PO_COMMENT_PREFIX_MSG + PO_MSGID
+        _len_msgid = len(PO_MSGID + '"')
+        _len_comm_msgid = len(_comm_msgid + '"')
+        _comm_msgstr = PO_COMMENT_PREFIX_MSG + PO_MSGSTR
+        _len_msgstr = len(PO_MSGSTR + '"')
+        _len_comm_msgstr = len(_comm_msgstr + '"')
+        _len_comm_str = len(PO_COMMENT_PREFIX_MSG + '"')
+
+        # Main loop over all lines in src...
+        for line_nr, line in enumerate(src.splitlines()):
             if line == "":
-                finalize_message()
+                if reading_msgstr:
+                    finalize_message(self, line_nr)
+                continue
 
-            elif line.startswith("msgctxt") or \
-                 line.startswith("".join((COMMENT_PREFIX, "msgctxt"))):
+            elif line.startswith(PO_MSGCTXT) or line.startswith(_comm_msgctxt):
                 reading_comment = False
                 reading_ctxt = True
-                if line.startswith(COMMENT_PREFIX):
+                if line.startswith(PO_COMMENT_PREFIX_MSG):
                     is_commented = True
-                    line = line[9 + len(COMMENT_PREFIX):-1]
+                    line = line[_len_comm_msgctxt:-1]
                 else:
-                    line = line[9:-1]
+                    line = line[_len_msgctxt:-1]
                 msgctxt_lines.append(line)
 
-            elif line.startswith("msgid") or \
-                 line.startswith("".join((COMMENT_PREFIX, "msgid"))):
+            elif line.startswith(PO_MSGID) or line.startswith(_comm_msgid):
                 reading_comment = False
                 reading_msgid = True
-                if line.startswith(COMMENT_PREFIX):
+                if line.startswith(PO_COMMENT_PREFIX_MSG):
+                    if not is_commented and reading_ctxt:
+                        self.parsing_errors.append((line_nr, "commented msgid following regular msgctxt"))
                     is_commented = True
-                    line = line[7 + len(COMMENT_PREFIX):-1]
+                    line = line[_len_comm_msgid:-1]
                 else:
-                    line = line[7:-1]
+                    line = line[_len_msgid:-1]
+                reading_ctxt = False
                 msgid_lines.append(line)
 
-            elif line.startswith("msgstr") or \
-                 line.startswith("".join((COMMENT_PREFIX, "msgstr"))):
+            elif line.startswith(PO_MSGSTR) or line.startswith(_comm_msgstr):
                 if not reading_msgid:
-                    is_broken = True
+                    self.parsing_errors.append((line_nr, "msgstr without a prior msgid"))
                 else:
                     reading_msgid = False
                 reading_msgstr = True
-                if line.startswith(COMMENT_PREFIX):
-                    line = line[8 + len(COMMENT_PREFIX):-1]
+                if line.startswith(PO_COMMENT_PREFIX_MSG):
+                    line = line[_len_comm_msgstr:-1]
                     if not is_commented:
-                        is_broken = True
+                        self.parsing_errors.append((line_nr, "commented msgstr following regular msgid"))
                 else:
-                    line = line[8:-1]
+                    line = line[_len_msgstr:-1]
                     if is_commented:
-                        is_broken = True
+                        self.parsing_errors.append((line_nr, "regular msgstr following commented msgid"))
                 msgstr_lines.append(line)
-                if line:
-                    is_translated = True
 
-            elif line.startswith("#"):
-                if reading_msgid:
-                    if is_commented:
-                        msgid_lines.append(line[1 + len(COMMENT_PREFIX):-1])
-                    else:
-                        msgid_lines.append(line)
-                        is_broken = True
-                elif reading_msgstr:
-                    if is_commented:
-                        msgstr_lines.append(line[1 + len(COMMENT_PREFIX):-1])
-                    else:
-                        msgstr_lines.append(line)
-                        is_broken = True
+            elif line.startswith(PO_COMMENT_PREFIX[0]):
+                if line.startswith(PO_COMMENT_PREFIX_MSG):
+                    if reading_msgctxt:
+                        if is_commented:
+                            msgctxt_lines.append(line[_len_comm_str:-1])
+                        else:
+                            msgctxt_lines.append(line)
+                            self.parsing_errors.append((line_nr, "commented string while reading regular msgctxt"))
+                    elif reading_msgid:
+                        if is_commented:
+                            msgid_lines.append(line[_len_comm_str:-1])
+                        else:
+                            msgid_lines.append(line)
+                            self.parsing_errors.append((line_nr, "commented string while reading regular msgid"))
+                    elif reading_msgstr:
+                        if is_commented:
+                            msgstr_lines.append(line[_len_comm_str:-1])
+                        else:
+                            msgstr_lines.append(line)
+                            self.parsing_errors.append((line_nr, "commented string while reading regular msgstr"))
                 else:
-                    if line.startswith("#, fuzzy"):
+                    if reading_msgctxt or reading_msgid or reading_msgstr:
+                        self.parsing_errors.append((line_nr,
+                                                    "commented string within msgctxt, msgid or msgstr scope, ignored"))
+                    elif line.startswith(PO_COMMENT_FUZZY):
                         is_fuzzy = True
                     else:
                         comment_lines.append(line)
                     reading_comment = True
 
             else:
-                if reading_msgid:
+                if reading_msgctxt:
+                    msgctxt_lines.append(line[1:-1])
+                elif reading_msgid:
                     msgid_lines.append(line[1:-1])
                 elif reading_msgstr:
                     line = line[1:-1]
                     msgstr_lines.append(line)
-                    if not is_translated and line:
-                        is_translated = True
                 else:
-                    is_broken = True
+                    self.parsing_errors.append((line_nr, "regular string outside msgctxt, msgid or msgstr scope"))
+                    #self.parsing_errors += (str(comment_lines), str(msgctxt_lines), str(msgid_lines), str(msgstr_lines))
 
         # If no final empty line, last message is not finalized!
         if reading_msgstr:
-            finalize_message()
-
-    return (messages,
-            {"trans_msg": translated_messages,
-             "fuzzy_msg": fuzzy_messages,
-             "comm_msg" : commented_messages,
-             "is_broken": is_broken},
-            {"tot_msg"        : tot_messages,
-             "trans_msg"      : trans_messages,
-             "tot_ttips"      : tot_tooltips,
-             "trans_ttips"    : trans_tooltips,
-             "comm_msg"       : comm_messages,
-             "nbr_signs"      : nbr_signs,
-             "nbr_trans_signs": nbr_trans_signs,
-             "contexts"       : contexts})
-
-
-def write_messages(fname, messages, commented, fuzzy):
-    "Write in fname file the content of messages (similar to parse_messages " \
-    "returned values). commented and fuzzy are two sets containing msgid. " \
-    "Returns the number of written messages."
-    num = 0
-    with open(fname, 'w', encoding="utf-8") as f:
-        for msgkey, val in messages.items():
-            msgctxt, msgid = msgkey
-            f.write("\n".join(val["comment_lines"]))
-            # Only mark as fuzzy if msgstr is not empty!
-            if msgkey in fuzzy and "".join(val["msgstr_lines"]):
-                f.write("\n#, fuzzy")
-            if msgkey in commented:
-                if msgctxt:
-                    f.write("\n{}msgctxt \"".format(COMMENT_PREFIX))
-                    f.write("\"\n{}\"".format(COMMENT_PREFIX).join(
-                                       val["msgctxt_lines"]))
-                    f.write("\"")
-                f.write("\n{}msgid \"".format(COMMENT_PREFIX))
-                f.write("\"\n{}\"".format(COMMENT_PREFIX).join(
-                                   val["msgid_lines"]))
-                f.write("\"\n{}msgstr \"".format(COMMENT_PREFIX))
-                f.write("\"\n{}\"".format(COMMENT_PREFIX).join(
-                                   val["msgstr_lines"]))
-                f.write("\"\n\n")
-            else:
-                if msgctxt:
-                    f.write("\nmsgctxt \"")
-                    f.write("\"\n\"".join(val["msgctxt_lines"]))
-                    f.write("\"")
-                f.write("\nmsgid \"")
-                f.write("\"\n\"".join(val["msgid_lines"]))
-                f.write("\"\nmsgstr \"")
-                f.write("\"\n\"".join(val["msgstr_lines"]))
-                f.write("\"\n\n")
-            num += 1
-    return num
-
-
-def gen_empty_messages(blender_rev, time_str, year_str):
-    """Generate an empty messages & state data (only header if present!)."""
-    header_key = ("", "")
-
-    messages = new_messages()
-    messages[header_key] = {
-        "msgid_lines": [""],
-        "msgctxt_lines": [],
-        "msgstr_lines": [
-            "Project-Id-Version: Blender r{}\\n"
-            "".format(blender_rev),
-            "Report-Msgid-Bugs-To: \\n",
-            "POT-Creation-Date: {}\\n"
-            "".format(time_str),
-            "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n",
-            "Last-Translator: FULL NAME <EMAIL at ADDRESS>\\n",
-            "Language-Team: LANGUAGE <LL at li.org>\\n",
-            "Language: \\n",
-            "MIME-Version: 1.0\\n",
-            "Content-Type: text/plain; charset=UTF-8\\n",
-            "Content-Transfer-Encoding: 8bit\\n"
-        ],
-        "comment_lines": [
-            "# Blender's translation file (po format).",
-            "# Copyright (C) {} The Blender Foundation."
-            "".format(year_str),
-            "# This file is distributed under the same "
-            "# license as the Blender package.",
-            "# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.",
-            "#",
-        ],
-    }
+            finalize_message(self, line_nr)
+
+        if key:
+            if not curr_hash:
+                import hashlib
+                curr_hash = hashlib.new(PARSER_CACHE_HASH, src.encode()).digest()
+            self._parser_cache[key] = (curr_hash, self.msgs)
+
+    def write(self, kind, dest):
+        self.writers[kind](self, dest)
+
+    def write_messages_to_po(self, fname):
+        """
+        Write messages in fname po file.
+        """
+        self.normalize(max_len=0)  # No wrapping for now...
+        with open(fname, 'w', encoding="utf-8") as f:
+            for msg in self.msgs.values():
+                f.write("\n".join(msg.comment_lines))
+                # Only mark as fuzzy if msgstr is not empty!
+                if msg.is_fuzzy and msg.msgstr:
+                    f.write("\n" + PO_COMMENT_FUZZY)
+                _p = PO_COMMENT_PREFIX_MSG if msg.is_commented else ""
+                _pmsgctxt = _p + PO_MSGCTXT
+                _pmsgid = _p + PO_MSGID
+                _pmsgstr = _p + PO_MSGSTR
+                chunks = []
+                if msg.msgctxt:
+                    if len(msg.msgctxt_lines) > 1:
+                        chunks += [
+                            "\n" + _pmsgctxt + "\"\"\n" + _p + "\"",
+                            ("\"\n" + _p + "\"").join(msg.msgctxt_lines),
+                            "\"",
+                        ]
+                    else:
+                        chunks += ["\n" + _pmsgctxt + "\"" + msg.msgctxt + "\""]
+                if len(msg.msgid_lines) > 1:
+                    chunks += [
+                        "\n" + _pmsgid + "\"\"\n" + _p + "\"",
+                        ("\"\n" + _p + "\"").join(msg.msgid_lines),
+                        "\"",
+                    ]
+                else:
+                    chunks += ["\n" + _pmsgid + "\"" + msg.msgid + "\""]
+                if len(msg.msgstr_lines) > 1:
+                    chunks += [
+                        "\n" + _pmsgstr + "\"\"\n" + _p + "\"",
+                        ("\"\n" + _p + "\"").join(msg.msgstr_lines),
+                        "\"",
+                    ]
+                else:
+                    chunks += ["\n" + _pmsgstr + "\"" + msg.msgstr + "\""]
+                chunks += ["\n\n"]
+                f.write("".join(chunks))
 
-    states = {"trans_msg": set(),
-              "fuzzy_msg": {header_key},
-              "comm_msg": set(),
-              "is_broken": False}
+    parsers = {
+        "PO": parse_messages_from_po,
+#        "PYTUPLE": parse_messages_from_pytuple,
+    }
 
-    return messages, states
+    writers = {
+        "PO": write_messages_to_po,
+        #"PYDICT": write_messages_to_pydict,
+    }
 
 
-def print_stats(stats, glob_stats=None, prefix=""):
+class I18n:
     """
-    Print out some stats about a po file.
-    glob_stats is for making global stats over several po's.
+    Internal representation of a whole translation set.
     """
-    tot_msgs        = stats["tot_msg"]
-    trans_msgs      = stats["trans_msg"]
-    tot_ttips       = stats["tot_ttips"]
-    trans_ttips     = stats["trans_ttips"]
-    comm_msgs       = stats["comm_msg"]
-    nbr_signs       = stats["nbr_signs"]
-    nbr_trans_signs = stats["nbr_trans_signs"]
-    contexts        = stats["contexts"]
-    lvl = lvl_ttips = lvl_trans_ttips = lvl_ttips_in_trans = lvl_comm = 0.0
-
-    if tot_msgs > 0:
-        lvl = float(trans_msgs) / float(tot_msgs)
-        lvl_ttips = float(tot_ttips) / float(tot_msgs)
-        lvl_comm = float(comm_msgs) / float(tot_msgs+comm_msgs)
-    if tot_ttips > 0:
-        lvl_trans_ttips = float(trans_ttips) / float(tot_ttips)
-    if trans_msgs > 0:
-        lvl_ttips_in_trans = float(trans_ttips) / float(trans_msgs)
-
-    if glob_stats:
-        glob_stats["nbr"]                += 1.0
-        glob_stats["lvl"]                += lvl
-        glob_stats["lvl_ttips"]          += lvl_ttips
-        glob_stats["lvl_trans_ttips"]    += lvl_trans_ttips
-        glob_stats["lvl_ttips_in_trans"] += lvl_ttips_in_trans
-        glob_stats["lvl_comm"]           += lvl_comm
-        glob_stats["nbr_trans_signs"]    += nbr_trans_signs
-        if glob_stats["nbr_signs"] == 0:
-            glob_stats["nbr_signs"] = nbr_signs
-        glob_stats["contexts"] |= contexts
-
-    lines = ("",
-             "{:>6.1%} done! ({} translated messages over {}).\n"
-             "".format(lvl, trans_msgs, tot_msgs),
-             "{:>6.1%} of messages are tooltips ({} over {}).\n"
-             "".format(lvl_ttips, tot_ttips, tot_msgs),
-             "{:>6.1%} of tooltips are translated ({} over {}).\n"
-             "".format(lvl_trans_ttips, trans_ttips, tot_ttips),
-             "{:>6.1%} of translated messages are tooltips ({} over {}).\n"
-             "".format(lvl_ttips_in_trans, trans_ttips, trans_msgs),
-             "{:>6.1%} of messages are commented ({} over {}).\n"
-             "".format(lvl_comm, comm_msgs, comm_msgs + tot_msgs),
-             "This translation is currently made of {} signs.\n"
-             "".format(nbr_trans_signs))
-    print(prefix.join(lines))
-    return 0
+
+    def __init__(self, src):
+        self.trans = {}
+        self.update_info()
+
+    def update_info(self):
+        self.nbr_trans = 0
+        self.lvl = 0.0
+        self.lvl_ttips = 0.0
+        self.lvl_trans_ttips = 0.0
+        self.lvl_ttips_in_trans = 0.0
+        self.lvl_comm = 0.0
+        self.nbr_signs = 0
+        self.nbr_trans_signs = 0
+        self.contexts = set()
+
+        if TEMPLATE_ISO_ID in self.trans:
+            self.nbr_trans = len(self.trans) - 1
+            self.nbr_signs = self.trans[TEMPLATE_ISO_ID].nbr_signs
+        else:
+            self.nbr_trans = len(self.trans)
+        for iso, msgs in self.trans.items():
+            msgs.update_info()
+            if msgs.nbr_msgs > 0:
+                self.lvl += float(msgs.nbr_trans_msgs) / float(msgs.nbr_msgs)
+                self.lvl_ttips += float(msgs.nbr_ttips) / float(msgs.nbr_msgs)
+                self.lvl_comm += float(msgs.nbr_comm_msgs) / float(msgs.nbr_msgs + msgs.nbr_comm_msgs)
+            if msgs.nbr_ttips > 0:
+                self.lvl_trans_ttips = float(msgs.nbr_trans_ttips) / float(msgs.nbr_ttips)
+            if msgs.nbr_trans_msgs > 0:
+                self.lvl_ttips_in_trans = float(msgs.nbr_trans_ttips) / float(msgs.nbr_trans_msgs)
+            if self.nbr_signs == 0:
+                self.nbr_signs = msgs.nbr_signs
+            self.nbr_trans_signs += msgs.nbr_trans_signs
+            self.contexts |= msgs.contexts
+
+    def print_stats(self, prefix="", print_msgs=True):
+        """
+        Print out some stats about an I18n object.
+        If print_msgs is True, it will also print all its translations' stats.
+        """
+        if print_msgs:
+            msgs_prefix = prefix + "    "
+            for key, msgs in self.trans:
+                if key == TEMPLATE_ISO_ID:
+                    continue
+                print(prefix + key + ":")
+                msgs.print_stats(prefix=msgs_prefix)
+                print(prefix)
+
+        nbr_contexts = len(self.contexts - {CONTEXT_DEFAULT})
+        if nbr_contexts != 1:
+            if nbr_contexts == 0:
+                nbr_contexts = "No"
+            _ctx_txt = "s are"
+        else:
+            _ctx_txt = " is"
+        lines = ("",
+                 "Average stats for all {} translations:\n".format(self.nbr_trans),
+                 "    {:>6.1%} done!\n".format(self.lvl / self.nbr_trans),
+                 "    {:>6.1%} of messages are tooltips.\n".format(self.lvl_ttips / self.nbr_trans),
+                 "    {:>6.1%} of tooltips are translated.\n".format(self.lvl_trans_ttips / self.nbr_trans),
+                 "    {:>6.1%} of translated messages are tooltips.\n".format(self.lvl_ttips_in_trans / self.nbr_trans),
+                 "    {:>6.1%} of messages are commented.\n".format(self.lvl_comm / self.nbr_trans),
+                 "    The org msgids are currently made of {} signs.\n".format(self.nbr_signs),
+                 "    All processed translations are currently made of {} signs.\n".format(self.nbr_trans_signs),
+                 "    {} specific context{} present:\n            {}\n"
+                 "".format(self.nbr_contexts, _ctx_txt, "\n            ".join(self.contexts - {CONTEXT_DEFAULT})),
+                 "\n")
+        print(prefix.join(lines))
+
+
+##### Parsers #####
+
+#def parse_messages_from_pytuple(self, src, key=None):
+    #"""
+    #Returns a dict of tuples similar to the one returned by parse_messages_from_po (one per language, plus a 'pot'
+    #one keyed as '__POT__').
+    #"""
+    ## src may be either a string to be interpreted as py code, or a real tuple!
+    #if isinstance(src, str):
+        #src = eval(src)
+#
+    #curr_hash = None
+    #if key and key in _parser_cache:
+        #old_hash, ret = _parser_cache[key]
+        #import hashlib
+        #curr_hash = hashlib.new(PARSER_CACHE_HASH, str(src).encode()).digest()
+        #if curr_hash == old_hash:
+            #return ret
+#
+    #pot = new_messages()
+    #states = gen_states()
+    #stats = gen_stats()
+    #ret = {"__POT__": (pot, states, stats)}
+    #for msg in src:
+        #key = msg[0]
+        #messages[msgkey] = gen_message(msgid_lines, msgstr_lines, comment_lines, msgctxt_lines)
+        #pot[key] = gen_message(msgid_lines=[key[1]], msgstr_lines=[
+        #for lang, trans, (is_fuzzy, comments) in msg[2:]:
+            #if trans and not is_fuzzy:
+                #i18n_dict.setdefault(lang, dict())[key] = trans
+#
+    #if key:
+        #if not curr_hash:
+            #import hashlib
+            #curr_hash = hashlib.new(PARSER_CACHE_HASH, str(src).encode()).digest()
+        #_parser_cache[key] = (curr_hash, val)
+    #return ret
\ No newline at end of file
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py
index 34b7a9e..3a2f9bd 100644
--- a/release/scripts/modules/bpy/__init__.py
+++ b/release/scripts/modules/bpy/__init__.py
@@ -58,6 +58,7 @@ def main():
     #   from bpy.types import Panel
     sys.modules["bpy.app"] = app
     sys.modules["bpy.app.handlers"] = app.handlers
+    sys.modules["bpy.app.translations"] = app.translations
     sys.modules["bpy.types"] = types
 
     #~ if "-d" in sys.argv: # Enable this to measure start up speed
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index 69ed431..6c91568 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -47,6 +47,7 @@ from _bpy_path import (extensions_audio,
                        extensions_image,
                        )
 
+
 def abspath(path, start=None, library=None):
     """
     Returns the absolute path relative to the current blend file
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
index 25fe6c1..7b5de23 100644
--- a/release/scripts/modules/bpy/utils.py
+++ b/release/scripts/modules/bpy/utils.py
@@ -237,7 +237,8 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
     _addon_utils.reset_all(reload_scripts)
 
     # run the active integration preset
-    filepath = preset_find(_user_preferences.inputs.active_keyconfig, "keyconfig")
+    filepath = preset_find(_user_preferences.inputs.active_keyconfig,
+                           "keyconfig")
 
     if filepath:
         keyconfig_set(filepath)
diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py
index 7a5d169..20a9a41 100644
--- a/release/scripts/modules/bpy_extras/anim_utils.py
+++ b/release/scripts/modules/bpy_extras/anim_utils.py
@@ -169,15 +169,16 @@ def bake_action(frame_start,
         euler_prev = None
 
         for (f, matrix) in zip(frame_range, obj_info):
-            obj.matrix_basis = matrix[name]
+            name = "Action Bake" # XXX: placeholder
+            obj.matrix_basis = matrix
 
-            obj.keyframe_insert("location", -1, f, options)
+            obj.keyframe_insert("location", -1, f, name, options)
 
             rotation_mode = obj.rotation_mode
             if rotation_mode == 'QUATERNION':
-                obj.keyframe_insert("rotation_quaternion", -1, f, options)
+                obj.keyframe_insert("rotation_quaternion", -1, f, name, options)
             elif rotation_mode == 'AXIS_ANGLE':
-                obj.keyframe_insert("rotation_axis_angle", -1, f, options)
+                obj.keyframe_insert("rotation_axis_angle", -1, f, name, options)
             else:  # euler, XYZ, ZXY etc
                 if euler_prev is not None:
                     euler = obj.rotation_euler.copy()
@@ -187,9 +188,9 @@ def bake_action(frame_start,
                     del euler
                 else:
                     euler_prev = obj.rotation_euler.copy()
-                obj.keyframe_insert("rotation_euler", -1, f, options)
+                obj.keyframe_insert("rotation_euler", -1, f, name, options)
 
-            obj.keyframe_insert("scale", -1, f, options)
+            obj.keyframe_insert("scale", -1, f, name, options)
 
     # -------------------------------------------------------------------------
     # Clean
diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py
index 4457ecb..dfb6c46 100644
--- a/release/scripts/modules/bpy_extras/io_utils.py
+++ b/release/scripts/modules/bpy_extras/io_utils.py
@@ -79,20 +79,23 @@ class ExportHelper:
         return {'RUNNING_MODAL'}
 
     def check(self, context):
+        import os
         change_ext = False
         change_axis = _check_axis_conversion(self)
 
         check_extension = self.check_extension
 
         if check_extension is not None:
-            filepath = bpy.path.ensure_ext(self.filepath,
-                                           self.filename_ext
-                                           if check_extension
-                                           else "")
+            filepath = self.filepath
+            if os.path.basename(filepath):
+                filepath = bpy.path.ensure_ext(filepath,
+                                               self.filename_ext
+                                               if check_extension
+                                               else "")
 
-            if filepath != self.filepath:
-                self.filepath = filepath
-                change_ext = True
+                if filepath != self.filepath:
+                    self.filepath = filepath
+                    change_ext = True
 
         return (change_ext or change_axis)
 
@@ -338,7 +341,7 @@ path_reference_mode = EnumProperty(
                ('COPY', "Copy", "Copy the file to the destination path "
                                 "(or subdirectory)"),
                ),
-        default='AUTO'
+        default='AUTO',
         )
 
 
@@ -433,10 +436,7 @@ def path_reference_copy(copy_set, report=print):
             pass
         else:
             dir_to = os.path.dirname(file_dst)
-
-            if not os.path.isdir(dir_to):
-                os.makedirs(dir_to)
-
+            os.makedirs(dir_to, exist_ok=True)
             shutil.copy(file_src, file_dst)
 
 
@@ -477,10 +477,10 @@ def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."):
             while name_new in name_dict_values:
                 count_str = "%03d" % count
                 name_new = "%.*s%s%s" % (name_max - (len(count_str) + 1),
-                                        name_new_orig,
-                                        sep,
-                                        count_str,
-                                        )
+                                         name_new_orig,
+                                         sep,
+                                         count_str,
+                                         )
                 count += 1
 
         name_dict[key] = name_new
diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py
index 0166f95..f4fdfec 100644
--- a/release/scripts/modules/bpy_extras/mesh_utils.py
+++ b/release/scripts/modules/bpy_extras/mesh_utils.py
@@ -152,10 +152,13 @@ def edge_face_count_dict(mesh):
        faces using each edge.
     :rtype: dict
     """
-    face_edge_keys = [face.edge_keys for face in mesh.tessfaces]
+
     face_edge_count = {}
-    for face_keys in face_edge_keys:
-        for key in face_keys:
+    loops = mesh.loops
+    edges = mesh.edges
+    for poly in mesh.polygons:
+        for i in poly.loop_indices:
+            key = edges[loops[i].edge_index].key
             try:
                 face_edge_count[key] += 1
             except:
@@ -247,7 +250,7 @@ def edge_loops_from_tessfaces(mesh, tessfaces=None, seams=()):
                         break
 
                 i = ed_adj.index(context_loop[-2])
-                context_loop.append(ed_adj[not  i])
+                context_loop.append(ed_adj[not i])
 
                 # Dont look at this again
                 del ed_adj[:]
@@ -530,12 +533,12 @@ def face_random_points(num_points, tessfaces):
         tris.append((verts[fv[0]].co,
                      verts[fv[1]].co,
                      verts[fv[2]].co,
-                    ))
+                     ))
         if len(fv) == 4:
             tris.append((verts[fv[0]].co,
                          verts[fv[3]].co,
                          verts[fv[2]].co,
-                        ))
+                         ))
         tri_faces.append(tris)
 
     # For each face, generate the required number of random points
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index 4e1385c..ab5dc3e 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -123,9 +123,10 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
             base.layers[scene.active_layer] = True
         else:
             base.layers = [True if i == scene.active_layer
-                else False for i in range(len(scene.layers))]
-    if v3d:
-        base.layers_from_view(context.space_data)
+                           else False for i in range(len(scene.layers))]
+    else:
+        if v3d:
+            base.layers_from_view(context.space_data)
 
     obj_new.matrix_world = add_object_align_init(context, operator)
 
diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py
index b2f366d..7a075e9 100644
--- a/release/scripts/modules/bpy_extras/view3d_utils.py
+++ b/release/scripts/modules/bpy_extras/view3d_utils.py
@@ -50,7 +50,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
         out = Vector(((2.0 * coord[0] / region.width) - 1.0,
                       (2.0 * coord[1] / region.height) - 1.0,
                       -0.5
-                    ))
+                     ))
 
         w = out.dot(persinv[3].xyz) + persinv[3][3]
 
@@ -89,7 +89,7 @@ def region_2d_to_origin_3d(region, rv3d, coord):
         persinv = persmat.inverted()
         origin_start = ((persinv.col[0].xyz * dx) +
                         (persinv.col[1].xyz * dy) +
-                         viewinv.translation)
+                        viewinv.translation)
     return origin_start
 
 
diff --git a/release/scripts/modules/bpy_restrict_state.py b/release/scripts/modules/bpy_restrict_state.py
index 21c6921..4aa3c5d 100644
--- a/release/scripts/modules/bpy_restrict_state.py
+++ b/release/scripts/modules/bpy_restrict_state.py
@@ -28,13 +28,21 @@ __all__ = (
 
 import bpy as _bpy
 
+
 class _RestrictContext():
     __slots__ = ()
     _real_data = _bpy.data
+    # safe, the pointer never changes
+    _real_pref = _bpy.context.user_preferences
+
     @property
     def window_manager(self):
         return self._real_data.window_managers[0]
 
+    @property
+    def user_preferences(self):
+        return self._real_pref
+
 
 class _RestrictData():
     __slots__ = ()
@@ -46,6 +54,7 @@ _data_restrict = _RestrictData()
 
 class RestrictBlend():
     __slots__ = ("context", "data")
+
     def __enter__(self):
         self.data = _bpy.data
         self.context = _bpy.context
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 1c861aa..4398b17 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -484,13 +484,16 @@ class Text(bpy_types.ID):
                                  if cont.type == 'PYTHON']
                      )
 
+
 class NodeSocket(StructRNA):  # , metaclass=RNAMeta
     __slots__ = ()
 
     @property
     def links(self):
         """List of node links from or to this socket"""
-        return tuple(link for link in self.id_data.links if link.from_socket == self or link.to_socket == self)
+        return tuple(link for link in self.id_data.links
+                     if (link.from_socket == self or
+                         link.to_socket == self))
 
 
 # values are module: [(cls, path, line), ...]
@@ -612,6 +615,10 @@ class KeyingSetInfo(StructRNA, metaclass=RNAMeta):
     __slots__ = ()
 
 
+class AddonPreferences(StructRNA, metaclass=RNAMeta):
+    __slots__ = ()
+
+
 class _GenericUI:
     __slots__ = ()
 
@@ -711,7 +718,9 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
         files.sort()
 
         for f, filepath in files:
-            props = layout.operator(operator, text=bpy.path.display_name(f))
+            props = layout.operator(operator,
+                                    text=bpy.path.display_name(f),
+                                    translate=False)
 
             for attr, value in props_default.items():
                 setattr(props, attr, value)
@@ -730,3 +739,21 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
         self.path_menu(bpy.utils.preset_paths(self.preset_subdir),
                        self.preset_operator,
                        filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
+
+class Region(StructRNA):
+    __slots__ = ()
+
+    def callback_add(self, cb, args, draw_mode):
+        """
+        Append a draw function to this region,
+        deprecated, instead use bpy.types.SpaceView3D.draw_handler_add
+        """
+        for area in self.id_data.areas:
+            for region in area.regions:
+                if region == self:
+                    spacetype = type(area.spaces[0])
+                    return spacetype.draw_handler_add(cb, args, self.type,
+                                                      draw_mode)
+
+        return None
+
diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py
index 60dfa2b..55ff84f 100644
--- a/release/scripts/modules/console_python.py
+++ b/release/scripts/modules/console_python.py
@@ -334,8 +334,8 @@ def banner(context):
     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("Autocomplete:        Ctrl-Space", 'OUTPUT')
+    add_scrollback("Zoom:                Ctrl +/-, Ctrl-Wheel", 'OUTPUT')
     add_scrollback("Builtin Modules:     bpy, bpy.data, bpy.ops, "
                    "bpy.props, bpy.types, bpy.context, bpy.utils, "
                    "bgl, blf, mathutils",
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index 32c8ed1..dd0cd63 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -92,6 +92,9 @@ def draw(layout, context, context_member, property_type, use_edit=True):
     if not rna_item:
         return
 
+    if rna_item.id_data.library is not None:
+        use_edit = False
+
     assert(isinstance(rna_item, property_type))
 
     items = rna_item.items()
@@ -132,11 +135,11 @@ def draw(layout, context, context_member, property_type, use_edit=True):
         else:
             row = box.row()
 
-        row.label(text=key)
+        row.label(text=key, translate=False)
 
         # explicit exception for arrays
         if to_dict or to_list:
-            row.label(text=val_draw)
+            row.label(text=val_draw, translate=False)
         else:
             if key in rna_properties:
                 row.prop(rna_item, key, text="")
@@ -145,7 +148,7 @@ def draw(layout, context, context_member, property_type, use_edit=True):
 
         if use_edit:
             row = split.row(align=True)
-            props = row.operator("wm.properties_edit", text="edit")
+            props = row.operator("wm.properties_edit", text="Edit")
             assign_props(props, val_draw, key)
 
             props = row.operator("wm.properties_remove", text="", icon='ZOOMOUT')
diff --git a/release/scripts/presets/interface_theme/back_to_black.xml b/release/scripts/presets/interface_theme/back_to_black.xml
index 18a3e53..0521684 100644
--- a/release/scripts/presets/interface_theme/back_to_black.xml
+++ b/release/scripts/presets/interface_theme/back_to_black.xml
@@ -1,7 +1,9 @@
 <bpy>
   <Theme>
     <user_interface>
-      <ThemeUserInterface icon_file=""
+      <ThemeUserInterface menu_shadow_fac="0.5"
+                          menu_shadow_width="12"
+                          icon_file=""
                           icon_alpha="1"
                           axis_x="#dc0000"
                           axis_y="#00dc00"
@@ -275,17 +277,16 @@
                    camera_path="#5a5a5a"
                    skin_root="#000000">
         <space>
-          <ThemeSpaceGeneric back="#0f0f0f"
-                             title="#5d5d5d"
-                             text="#7d7d7d"
-                             text_hi="#ffffff"
-                             header="#000000"
-                             header_text="#979797"
-                             header_text_hi="#ffffff"
-                             button="#00000057"
-                             button_title="#c5c5c5"
-                             button_text="#c3c3c3"
-                             button_text_hi="#ffffff">
+          <ThemeSpaceGradient title="#5d5d5d"
+                              text="#7d7d7d"
+                              text_hi="#ffffff"
+                              header="#000000"
+                              header_text="#979797"
+                              header_text_hi="#ffffff"
+                              button="#00000057"
+                              button_title="#c5c5c5"
+                              button_text="#c3c3c3"
+                              button_text_hi="#ffffff">
             <panelcolors>
               <ThemePanelColors header="#00000019"
                                 back="#72727280"
@@ -293,7 +294,13 @@
                                 show_back="FALSE">
               </ThemePanelColors>
             </panelcolors>
-          </ThemeSpaceGeneric>
+            <gradients>
+              <ThemeGradientColors show_grad="FALSE"
+                                   gradient="#393939"
+                                   high_gradient="#000000">
+              </ThemeGradientColors>
+            </gradients>
+          </ThemeSpaceGradient>
         </space>
       </ThemeView3D>
     </view_3d>
@@ -586,7 +593,10 @@
                        selected_text="#202020"
                        cursor="#ff0000"
                        syntax_builtin="#cf3d99"
+                       syntax_symbols="#4c4c4c"
                        syntax_special="#969629"
+                       syntax_preprocessor="#32008c"
+                       syntax_reserved="#8c3c00"
                        syntax_comment="#249d60"
                        syntax_string="#cc3535"
                        syntax_numbers="#3c68ff">
@@ -651,6 +661,8 @@
                        operator_node="#0e3157"
                        group_node="#091a07"
                        frame_node="#9a9b9ba0"
+                       matte_node="#977474"
+                       distor_node="#749797"
                        noodle_curving="5">
         <space>
           <ThemeSpaceGeneric back="#000000"
@@ -788,7 +800,8 @@
                     line_input="#cecece"
                     line_info="#00aa00"
                     line_error="#dc6060"
-                    cursor="#dc6060">
+                    cursor="#dc6060"
+                    select="#ffffff30">
         <space>
           <ThemeSpaceGeneric back="#0f0f0f"
                              title="#5d5d5d"
diff --git a/release/scripts/presets/interface_theme/blender_24x.xml b/release/scripts/presets/interface_theme/blender_24x.xml
index 5ad7c50..48a3ee9 100644
--- a/release/scripts/presets/interface_theme/blender_24x.xml
+++ b/release/scripts/presets/interface_theme/blender_24x.xml
@@ -1,7 +1,9 @@
 <bpy>
   <Theme>
     <user_interface>
-      <ThemeUserInterface icon_file=""
+      <ThemeUserInterface menu_shadow_fac="0.5"
+                          menu_shadow_width="12"
+                          icon_file=""
                           icon_alpha="1"
                           axis_x="#dc0000"
                           axis_y="#00dc00"
@@ -275,17 +277,16 @@
                    camera_path="#000000"
                    skin_root="#000000">
         <space>
-          <ThemeSpaceGeneric back="#757575"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#b4b4b4"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#b4b4b457"
-                             button_title="#5a5a5a"
-                             button_text="#5a5a5a"
-                             button_text_hi="#ffffff">
+          <ThemeSpaceGradient title="#000000"
+                              text="#000000"
+                              text_hi="#ffffff"
+                              header="#b4b4b4"
+                              header_text="#000000"
+                              header_text_hi="#ffffff"
+                              button="#b4b4b457"
+                              button_title="#5a5a5a"
+                              button_text="#5a5a5a"
+                              button_text_hi="#ffffff">
             <panelcolors>
               <ThemePanelColors header="#00000019"
                                 back="#72727280"
@@ -293,7 +294,13 @@
                                 show_back="FALSE">
               </ThemePanelColors>
             </panelcolors>
-          </ThemeSpaceGeneric>
+            <gradients>
+              <ThemeGradientColors show_grad="FALSE"
+                                   gradient="#000000"
+                                   high_gradient="#757575">
+              </ThemeGradientColors>
+            </gradients>
+          </ThemeSpaceGradient>
         </space>
       </ThemeView3D>
     </view_3d>
@@ -586,7 +593,10 @@
                        selected_text="#c67777"
                        cursor="#ff0000"
                        syntax_builtin="#800050"
+                       syntax_symbols="#4c4c4c"
                        syntax_special="#5f5f00"
+                       syntax_preprocessor="#32008c"
+                       syntax_reserved="#8c3c00"
                        syntax_comment="#006432"
                        syntax_string="#640000"
                        syntax_numbers="#0000c8">
@@ -651,6 +661,8 @@
                        operator_node="#6c696f"
                        group_node="#69756e"
                        frame_node="#9a9b9ba0"
+                       matte_node="#977474"
+                       distor_node="#749797"
                        noodle_curving="5">
         <space>
           <ThemeSpaceGeneric back="#757575"
@@ -788,7 +800,8 @@
                     line_input="#ffffff"
                     line_info="#00aa00"
                     line_error="#dc6060"
-                    cursor="#dc6060">
+                    cursor="#dc6060"
+                    select="#c6777799">
         <space>
           <ThemeSpaceGeneric back="#b4b4b4"
                              title="#000000"
diff --git a/release/scripts/presets/interface_theme/elsyiun.xml b/release/scripts/presets/interface_theme/elsyiun.xml
index 0daadcd..3ea49ed 100644
--- a/release/scripts/presets/interface_theme/elsyiun.xml
+++ b/release/scripts/presets/interface_theme/elsyiun.xml
@@ -1,7 +1,9 @@
 <bpy>
   <Theme>
     <user_interface>
-      <ThemeUserInterface icon_file=""
+      <ThemeUserInterface menu_shadow_fac="0.5"
+                          menu_shadow_width="12"
+                          icon_file=""
                           icon_alpha="1"
                           axis_x="#dc0000"
                           axis_y="#00dc00"
@@ -275,17 +277,16 @@
                    camera_path="#000000"
                    skin_root="#000000">
         <space>
-          <ThemeSpaceGeneric back="#4b4b4b"
-                             title="#000000"
-                             text="#b8b8b8"
-                             text_hi="#e9e9e9"
-                             header="#3b3b3b"
-                             header_text="#b9b9b9"
-                             header_text_hi="#ffffff"
-                             button="#3b3b3b57"
-                             button_title="#979797"
-                             button_text="#979797"
-                             button_text_hi="#ffffff">
+          <ThemeSpaceGradient title="#000000"
+                              text="#b8b8b8"
+                              text_hi="#e9e9e9"
+                              header="#3b3b3b"
+                              header_text="#b9b9b9"
+                              header_text_hi="#ffffff"
+                              button="#3b3b3b57"
+                              button_title="#979797"
+                              button_text="#979797"
+                              button_text_hi="#ffffff">
             <panelcolors>
               <ThemePanelColors header="#00000019"
                                 back="#72727280"
@@ -293,7 +294,13 @@
                                 show_back="FALSE">
               </ThemePanelColors>
             </panelcolors>
-          </ThemeSpaceGeneric>
+            <gradients>
+              <ThemeGradientColors show_grad="FALSE"
+                                   gradient="#000000"
+                                   high_gradient="#4b4b4b">
+              </ThemeGradientColors>
+            </gradients>
+          </ThemeSpaceGradient>
         </space>
       </ThemeView3D>
     </view_3d>
@@ -586,7 +593,10 @@
                        selected_text="#4e4e8f"
                        cursor="#8b8bff"
                        syntax_builtin="#808bed"
+                       syntax_symbols="#4c4c4c"
                        syntax_special="#c080d0"
+                       syntax_preprocessor="#409090"
+                       syntax_reserved="#8c3c00"
                        syntax_comment="#cd8b00"
                        syntax_string="#ffcd8b"
                        syntax_numbers="#f0ad6d">
@@ -651,6 +661,8 @@
                        operator_node="#2c6f6f"
                        group_node="#1e7524"
                        frame_node="#9a9b9ba0"
+                       matte_node="#977474"
+                       distor_node="#749797"
                        noodle_curving="5">
         <space>
           <ThemeSpaceGeneric back="#3b3b3b"
@@ -788,7 +800,8 @@
                     line_input="#ffffff"
                     line_info="#00aa00"
                     line_error="#dc6060"
-                    cursor="#dc6060">
+                    cursor="#dc6060"
+                    select="#4e4e8f80">
         <space>
           <ThemeSpaceGeneric back="#202020"
                              title="#000000"
diff --git a/release/scripts/presets/interface_theme/hexagon.xml b/release/scripts/presets/interface_theme/hexagon.xml
index 932bd52..299df38 100644
--- a/release/scripts/presets/interface_theme/hexagon.xml
+++ b/release/scripts/presets/interface_theme/hexagon.xml
@@ -1,7 +1,9 @@
 <bpy>
   <Theme>
     <user_interface>
-      <ThemeUserInterface icon_file=""
+      <ThemeUserInterface menu_shadow_fac="0.5"
+                          menu_shadow_width="12"
+                          icon_file=""
                           icon_alpha="1"
                           axis_x="#dc0000"
                           axis_y="#00dc00"
@@ -275,17 +277,16 @@
                    camera_path="#000000"
                    skin_root="#000000">
         <space>
-          <ThemeSpaceGeneric back="#7f818d"
-                             title="#000000"
-                             text="#000000"
-                             text_hi="#ffffff"
-                             header="#646875"
-                             header_text="#000000"
-                             header_text_hi="#ffffff"
-                             button="#6c717f57"
-                             button_title="#eaeaea"
-                             button_text="#d7d7d7"
-                             button_text_hi="#ffffff">
+          <ThemeSpaceGradient title="#000000"
+                              text="#000000"
+                              text_hi="#ffffff"
+                              header="#646875"
+                              header_text="#000000"
+                              header_text_hi="#ffffff"
+                              button="#6c717f57"
+                              button_title="#eaeaea"
+                              button_text="#d7d7d7"
+                              button_text_hi="#ffffff">
             <panelcolors>
               <ThemePanelColors header="#00000019"
                                 back="#72727280"
@@ -293,7 +294,13 @@
                                 show_back="FALSE">
               </ThemePanelColors>
             </panelcolors>
-          </ThemeSpaceGeneric>
+            <gradients>
+              <ThemeGradientColors show_grad="FALSE"
+                                   gradient="#000000"
+                                   high_gradient="#7f818d">
+              </ThemeGradientColors>
+            </gradients>
+          </ThemeSpaceGradient>
         </space>
       </ThemeView3D>
     </view_3d>
@@ -586,7 +593,10 @@
                        selected_text="#c67777"
                        cursor="#ff0000"
                        syntax_builtin="#800050"
+                       syntax_symbols="#4c4c4c"
                        syntax_special="#5f5f00"
+                       syntax_preprocessor="#32008c"
+                       syntax_reserved="#8c3c00"
                        syntax_comment="#006432"
                        syntax_string="#640000"
                        syntax_numbers="#0000c8">
@@ -651,6 +661,8 @@
                        operator_node="#6c697e"
                        group_node="#69756e"
                        frame_node="#9a9b9ba0"
+                       matte_node="#977474"
+                       distor_node="#749797"
                        noodle_curving="5">
         <space>
           <ThemeSpaceGeneric back="#7c7e88"
@@ -788,7 +800,8 @@
                     line_input="#ffffff"
                     line_info="#00aa00"
                     line_error="#dc0606"
-                    cursor="#dc6060">
+                    cursor="#dc6060"
+                    select="#ffffff30">
         <space>
           <ThemeSpaceGeneric back="#7c7e88"
                              title="#000000"
diff --git a/release/scripts/presets/interface_theme/ubuntu_ambiance.xml b/release/scripts/presets/interface_theme/ubuntu_ambiance.xml
index 8be83cb..38ab35d 100644
--- a/release/scripts/presets/interface_theme/ubuntu_ambiance.xml
+++ b/release/scripts/presets/interface_theme/ubuntu_ambiance.xml
@@ -1,7 +1,9 @@
 <bpy>
   <Theme>
     <user_interface>
-      <ThemeUserInterface icon_file=""
+      <ThemeUserInterface menu_shadow_fac="0.5"
+                          menu_shadow_width="12"
+                          icon_file=""
                           icon_alpha="1"
                           axis_x="#dc0000"
                           axis_y="#00dc00"
@@ -275,17 +277,16 @@
                    camera_path="#7dbd00"
                    skin_root="#000000">
         <space>
-          <ThemeSpaceGeneric back="#131311"
-                             title="#9c9c9c"
-                             text="#9c9c9c"
-                             text_hi="#ffffff"
-                             header="#464541"
-                             header_text="#acacac"
-                             header_text_hi="#ffffff"
-                             button="#3c3b3757"
-                             button_title="#9c9c9c"
-                             button_text="#9c9c9c"
-                             button_text_hi="#ffffff">
+          <ThemeSpaceGradient title="#9c9c9c"
+                              text="#9c9c9c"
+                              text_hi="#ffffff"
+                              header="#464541"
+                              header_text="#acacac"
+                              header_text_hi="#ffffff"
+                              button="#3c3b3757"
+                              button_title="#9c9c9c"
+                              button_text="#9c9c9c"
+                              button_text_hi="#ffffff">
             <panelcolors>
               <ThemePanelColors header="#00000000"
                                 back="#72727280"
@@ -293,7 +294,13 @@
                                 show_back="FALSE">
               </ThemePanelColors>
             </panelcolors>
-          </ThemeSpaceGeneric>
+            <gradients>
+              <ThemeGradientColors show_grad="FALSE"
+                                   gradient="#000000"
+                                   high_gradient="#131311">
+              </ThemeGradientColors>
+            </gradients>
+          </ThemeSpaceGradient>
         </space>
       </ThemeView3D>
     </view_3d>
@@ -586,7 +593,10 @@
                        selected_text="#641f44"
                        cursor="#f47421"
                        syntax_builtin="#d6ff01"
+                       syntax_symbols="#4c4c4c"
                        syntax_special="#33a500"
+                       syntax_preprocessor="#be00ff"
+                       syntax_reserved="#8c3c00"
                        syntax_comment="#249d60"
                        syntax_string="#6e00ff"
                        syntax_numbers="#972144">
@@ -651,6 +661,8 @@
                        operator_node="#000000"
                        group_node="#19b6ee"
                        frame_node="#9a9b9ba0"
+                       matte_node="#977474"
+                       distor_node="#749797"
                        noodle_curving="5">
         <space>
           <ThemeSpaceGeneric back="#29001b"
@@ -788,7 +800,8 @@
                     line_input="#19b6ee"
                     line_info="#f47421"
                     line_error="#ff0000"
-                    cursor="#f47421">
+                    cursor="#f47421"
+                    select="#641f4480">
         <space>
           <ThemeSpaceGeneric back="#131311"
                              title="#000000"
diff --git a/release/scripts/presets/keyconfig/maya.py b/release/scripts/presets/keyconfig/maya.py
index ec8efc8..d6805fb 100644
--- a/release/scripts/presets/keyconfig/maya.py
+++ b/release/scripts/presets/keyconfig/maya.py
@@ -138,41 +138,49 @@ kmi.properties.extend = False
 kmi.properties.center = False
 kmi.properties.object = False
 kmi.properties.enumerate = False
+kmi.properties.toggle = False
 kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True)
-kmi.properties.extend = True
+kmi.properties.extend = False
 kmi.properties.center = False
 kmi.properties.object = False
 kmi.properties.enumerate = False
+kmi.properties.toggle = True
 kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', ctrl=True)
 kmi.properties.extend = False
 kmi.properties.center = True
 kmi.properties.object = False
 kmi.properties.enumerate = False
+kmi.properties.toggle = False
 kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', alt=True)
 kmi.properties.extend = False
 kmi.properties.center = False
 kmi.properties.object = False
 kmi.properties.enumerate = True
+kmi.properties.toggle = False
 kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True, ctrl=True)
 kmi.properties.extend = True
 kmi.properties.center = True
 kmi.properties.object = False
 kmi.properties.enumerate = False
+kmi.properties.toggle = True
 kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', ctrl=True, alt=True)
 kmi.properties.extend = False
 kmi.properties.center = True
 kmi.properties.object = False
 kmi.properties.enumerate = True
+kmi.properties.toggle = False
 kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True, alt=True)
 kmi.properties.extend = True
 kmi.properties.center = False
 kmi.properties.object = False
 kmi.properties.enumerate = True
+kmi.properties.toggle = True
 kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True, ctrl=True, alt=True)
 kmi.properties.extend = True
 kmi.properties.center = True
 kmi.properties.object = False
 kmi.properties.enumerate = True
+kmi.properties.toggle = True
 kmi = km.keymap_items.new('view3d.select_border', 'EVT_TWEAK_S', 'ANY')
 kmi.properties.extend = False
 kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True)
@@ -218,7 +226,9 @@ kmi.properties.use = True
 kmi = km.keymap_items.new('transform.mirror', 'M', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True)
 kmi.properties.data_path = 'tool_settings.use_snap'
-kmi = km.keymap_items.new('transform.snap_type', 'TAB', 'PRESS', shift=True, ctrl=True)
+kmi = km.keymap_items.new('WM_OT_context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True)
+kmi.properties.data_path = 'tool_settings.snap_element'
+
 kmi = km.keymap_items.new('view3d.enable_manipulator', 'W', 'PRESS')
 kmi.properties.translate = True
 kmi = km.keymap_items.new('view3d.enable_manipulator', 'E', 'PRESS')
diff --git a/release/scripts/presets/operator/wm.collada_export/second_life_rigged.py b/release/scripts/presets/operator/wm.collada_export/second_life_rigged.py
index 2c695a2..81769a8 100644
--- a/release/scripts/presets/operator/wm.collada_export/second_life_rigged.py
+++ b/release/scripts/presets/operator/wm.collada_export/second_life_rigged.py
@@ -7,6 +7,7 @@ op.export_mesh_type_selection = 'view'
 op.selected = True
 op.include_children = False
 op.include_armatures = True
+op.include_shapekeys = False
 op.deform_bones_only = True
 op.active_uv_only = True
 op.include_uv_textures = True
diff --git a/release/scripts/presets/operator/wm.collada_export/second_life_static.py b/release/scripts/presets/operator/wm.collada_export/second_life_static.py
index 081788b..ad06909 100644
--- a/release/scripts/presets/operator/wm.collada_export/second_life_static.py
+++ b/release/scripts/presets/operator/wm.collada_export/second_life_static.py
@@ -7,6 +7,7 @@ op.export_mesh_type_selection = 'view'
 op.selected = True
 op.include_children = False
 op.include_armatures = False
+op.include_shapekeys = False
 op.deform_bones_only = False
 op.active_uv_only = True
 op.include_uv_textures = True
diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py
index ecbbe34..3ff0242 100644
--- a/release/scripts/startup/bl_operators/__init__.py
+++ b/release/scripts/startup/bl_operators/__init__.py
@@ -35,6 +35,7 @@ _modules = (
     "object_randomize_transform",
     "object_quick_effects",
     "presets",
+    "rigidbody",
     "screen_play_rendered_anim",
     "sequencer",
     "uvcalc_follow_active",
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py
index 39e00f9..bc0224d 100644
--- a/release/scripts/startup/bl_operators/node.py
+++ b/release/scripts/startup/bl_operators/node.py
@@ -22,6 +22,7 @@ import bpy
 from bpy.types import Operator
 from bpy.props import BoolProperty, EnumProperty, StringProperty
 
+
 # Base class for node 'Add' operators
 class NodeAddOperator():
     @staticmethod
@@ -78,8 +79,9 @@ class NODE_OT_add_node(NodeAddOperator, Operator):
     use_transform = BoolProperty(
             name="Use Transform",
             description="Start transform operator after inserting the node",
-            default = False,
+            default=False,
             )
+
     def execute(self, context):
         node = self.create_node(context, self.type)
 
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index d6a0e30..567ea83 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -111,10 +111,10 @@ class SelectCamera(Operator):
     bl_options = {'REGISTER', 'UNDO'}
 
     extend = BoolProperty(
-           name="Extend",
-           description="Extend the selection",
-           default=False
-           )
+            name="Extend",
+            description="Extend the selection",
+            default=False
+            )
 
     def execute(self, context):
         scene = context.scene
@@ -305,7 +305,7 @@ class ShapeTransfer(Operator):
                    ('RELATIVE_EDGE',
                    "Relative Edge",
                    "Calculate relative position (using edges)",
-                   ),
+                    ),
                    ),
             name="Transformation Mode",
             description="Relative shape positions to the new shape method",
@@ -682,7 +682,7 @@ class TransformsToDeltasAnim(Operator):
             "scale"                : "delta_scale"
         }
         DELTA_PATHS = STANDARD_TO_DELTA_PATHS.values()
-        
+
         # try to apply on each selected object
         success = False
         for obj in context.selected_editable_objects:
@@ -692,7 +692,7 @@ class TransformsToDeltasAnim(Operator):
                             "No animation data to convert on object: %r" %
                             obj.name)
                 continue
-            
+
             # first pass over F-Curves: ensure that we don't have conflicting
             # transforms already (e.g. if this was applied already) [#29110]
             existingFCurves = {}
@@ -708,7 +708,7 @@ class TransformsToDeltasAnim(Operator):
                 else:
                     # non-transform - ignore
                     continue
-                    
+
                 # a delta path like this for the same index shouldn't
                 # exist already, otherwise we've got a conflict
                 if dpath in existingFCurves:
@@ -716,8 +716,9 @@ class TransformsToDeltasAnim(Operator):
                     if fcu.array_index in existingFCurves[dpath]:
                         # conflict
                         self.report({'ERROR'},
-                            "Object '%r' already has '%r' F-Curve(s). Remove these before trying again" %
-                            (obj.name, dpath))
+                                    "Object '%r' already has '%r' F-Curve(s). "
+                                    "Remove these before trying again" %
+                                    (obj.name, dpath))
                         return {'CANCELLED'}
                     else:
                         # no conflict here
@@ -725,8 +726,7 @@ class TransformsToDeltasAnim(Operator):
                 else:
                     # no conflict yet
                     existingFCurves[dpath] = [fcu.array_index]
-                
-            
+
             # if F-Curve uses standard transform path
             # just append "delta_" to this path
             for fcu in adt.action.fcurves:
@@ -766,7 +766,7 @@ class DupliOffsetFromCursor(Operator):
 
     @classmethod
     def poll(cls, context):
-        return  context.active_object is not None
+        return (context.active_object is not None)
 
     def execute(self, context):
         scene = context.scene
diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py
index a32bb8c..e843209 100644
--- a/release/scripts/startup/bl_operators/object_align.py
+++ b/release/scripts/startup/bl_operators/object_align.py
@@ -114,31 +114,32 @@ def GlobalBB_HQ(obj):
     return Vector((left, front, up)), Vector((right, back, down))
 
 
-def align_objects(align_x,
+def align_objects(context,
+                  align_x,
                   align_y,
                   align_z,
                   align_mode,
                   relative_to,
                   bb_quality):
 
-    cursor = bpy.context.scene.cursor_location
+    cursor = context.scene.cursor_location
 
     Left_Front_Up_SEL = [0.0, 0.0, 0.0]
     Right_Back_Down_SEL = [0.0, 0.0, 0.0]
 
     flag_first = True
 
-    objs = []
+    objects = []
 
-    for obj in bpy.context.selected_objects:
+    for obj in context.selected_objects:
         matrix_world = obj.matrix_world.copy()
         bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
-        objs.append((obj, bb_world))
+        objects.append((obj, bb_world))
 
-    if not objs:
+    if not objects:
         return False
 
-    for obj, bb_world in objs:
+    for obj, bb_world in objects:
 
         if bb_quality and obj.type == 'MESH':
             GBB = GlobalBB_HQ(obj)
@@ -150,7 +151,7 @@ def align_objects(align_x,
 
         # Active Center
 
-        if obj == bpy.context.active_object:
+        if obj == context.active_object:
 
             center_active_x = (Left_Front_Up[0] + Right_Back_Down[0]) / 2.0
             center_active_y = (Left_Front_Up[1] + Right_Back_Down[1]) / 2.0
@@ -200,7 +201,7 @@ def align_objects(align_x,
 
     # Main Loop
 
-    for obj, bb_world in objs:
+    for obj, bb_world in objects:
         matrix_world = obj.matrix_world.copy()
         bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
 
@@ -386,7 +387,8 @@ class AlignObjects(Operator):
 
     def execute(self, context):
         align_axis = self.align_axis
-        ret = align_objects('X' in align_axis,
+        ret = align_objects(context,
+                            'X' in align_axis,
                             'Y' in align_axis,
                             'Z' in align_axis,
                             self.align_mode,
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index cd0b63a..47012f0 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -72,7 +72,7 @@ class QuickFur(Operator):
             )
 
     def execute(self, context):
-        fake_context = bpy.context.copy()
+        fake_context = context.copy()
         mesh_objects = [obj for obj in context.selected_objects
                         if obj.type == 'MESH']
 
@@ -161,7 +161,7 @@ class QuickExplode(Operator):
             )
 
     def execute(self, context):
-        fake_context = bpy.context.copy()
+        fake_context = context.copy()
         obj_act = context.active_object
 
         if obj_act is None or obj_act.type != 'MESH':
@@ -311,7 +311,7 @@ class QuickSmoke(Operator):
             )
 
     def execute(self, context):
-        fake_context = bpy.context.copy()
+        fake_context = context.copy()
         mesh_objects = [obj for obj in context.selected_objects
                         if obj.type == 'MESH']
         min_co = Vector((100000.0, 100000.0, 100000.0))
@@ -432,7 +432,7 @@ class QuickFluid(Operator):
             )
 
     def execute(self, context):
-        fake_context = bpy.context.copy()
+        fake_context = context.copy()
         mesh_objects = [obj for obj in context.selected_objects
                         if (obj.type == 'MESH' and not 0.0 in obj.dimensions)]
         min_co = Vector((100000, 100000, 100000))
diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py
index a6efc9d..3811032 100644
--- a/release/scripts/startup/bl_operators/object_randomize_transform.py
+++ b/release/scripts/startup/bl_operators/object_randomize_transform.py
@@ -23,7 +23,8 @@ from bpy.types import Operator
 from mathutils import Vector
 
 
-def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
+def randomize_selected(context, seed, delta,
+                       loc, rot, scale, scale_even, scale_min):
 
     import random
     from random import uniform
@@ -33,7 +34,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
     def rand_vec(vec_range):
         return Vector(uniform(-val, val) for val in vec_range)
 
-    for obj in bpy.context.selected_objects:
+    for obj in context.selected_objects:
 
         if loc:
             if delta:
@@ -180,6 +181,7 @@ class RandomizeLocRotSize(Operator):
         #scale_min = self.scale_min
         scale_min = 0
 
-        randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min)
+        randomize_selected(context, seed, delta,
+                           loc, rot, scale, scale_even, scale_min)
 
         return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index ee9769d..dac7ade 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -320,13 +320,13 @@ class AddPresetFluid(AddPresetBase, Operator):
     preset_menu = "FLUID_MT_presets"
 
     preset_defines = [
-    "fluid = bpy.context.fluid"
-    ]
+        "fluid = bpy.context.fluid"
+        ]
 
     preset_values = [
-    "fluid.settings.viscosity_base",
-    "fluid.settings.viscosity_exponent",
-    ]
+        "fluid.settings.viscosity_base",
+        "fluid.settings.viscosity_exponent",
+        ]
 
     preset_subdir = "fluid"
 
@@ -477,7 +477,7 @@ class AddPresetNodeColor(AddPresetBase, Operator):
 class AddPresetInterfaceTheme(AddPresetBase, Operator):
     """Add a theme preset"""
     bl_idname = "wm.interface_theme_preset_add"
-    bl_label = "Add Tracking Settings Preset"
+    bl_label = "Add Theme Preset"
     preset_menu = "USERPREF_MT_interface_theme_presets"
     preset_subdir = "interface_theme"
 
diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py
new file mode 100644
index 0000000..652ad4b
--- /dev/null
+++ b/release/scripts/startup/bl_operators/rigidbody.py
@@ -0,0 +1,260 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
+import bpy
+from bpy.types import Operator
+from bpy.props import IntProperty
+from bpy.props import EnumProperty
+
+
+class CopyRigidbodySettings(Operator):
+    '''Copy Rigid Body settings from active object to selected'''
+    bl_idname = "rigidbody.object_settings_copy"
+    bl_label = "Copy Rigid Body Settings"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    @classmethod
+    def poll(cls, context):
+        obj = context.object
+        return (obj and obj.rigid_body)
+
+    def execute(self, context):
+        obj = context.object
+        scene = context.scene
+
+        # deselect all but mesh objects
+        for o in context.selected_objects:
+            if o.type != 'MESH':
+                o.select = False
+
+        objects = context.selected_objects
+        if objects:
+            # add selected objects to active one groups and recalculate
+            bpy.ops.group.objects_add_active()
+            scene.frame_set(scene.frame_current)
+
+            # copy settings
+            for o in objects:
+                if o.rigid_body is None:
+                    continue
+
+                o.rigid_body.type = obj.rigid_body.type
+                o.rigid_body.kinematic = obj.rigid_body.kinematic
+                o.rigid_body.mass = obj.rigid_body.mass
+                o.rigid_body.collision_shape = obj.rigid_body.collision_shape
+                o.rigid_body.use_margin = obj.rigid_body.use_margin
+                o.rigid_body.collision_margin = obj.rigid_body.collision_margin
+                o.rigid_body.friction = obj.rigid_body.friction
+                o.rigid_body.restitution = obj.rigid_body.restitution
+                o.rigid_body.use_deactivation = obj.rigid_body.use_deactivation
+                o.rigid_body.start_deactivated = obj.rigid_body.start_deactivated
+                o.rigid_body.deactivate_linear_velocity = obj.rigid_body.deactivate_linear_velocity
+                o.rigid_body.deactivate_angular_velocity = obj.rigid_body.deactivate_angular_velocity
+                o.rigid_body.linear_damping = obj.rigid_body.linear_damping
+                o.rigid_body.angular_damping = obj.rigid_body.angular_damping
+                o.rigid_body.collision_groups = obj.rigid_body.collision_groups
+
+        return {'FINISHED'}
+
+
+class BakeToKeyframes(Operator):
+    '''Bake rigid body transformations of selected objects to keyframes'''
+    bl_idname = "rigidbody.bake_to_keyframes"
+    bl_label = "Bake To Keyframes"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    frame_start = IntProperty(
+            name="Start Frame",
+            description="Start frame for baking",
+            min=0, max=300000,
+            default=1,
+            )
+    frame_end = IntProperty(
+            name="End Frame",
+            description="End frame for baking",
+            min=1, max=300000,
+            default=250,
+            )
+    step = IntProperty(
+            name="Frame Step",
+            description="Frame Step",
+            min=1, max=120,
+            default=1,
+            )
+
+    @classmethod
+    def poll(cls, context):
+        obj = context.object
+        return (obj and obj.rigid_body)
+
+    def execute(self, context):
+        bake = []
+        objects = []
+        scene = context.scene
+        frame_orig = scene.frame_current
+        frames = list(range(self.frame_start, self.frame_end + 1, self.step))
+
+        # filter objects selection
+        for obj in context.selected_objects:
+            if not obj.rigid_body or obj.rigid_body.type != 'ACTIVE':
+                obj.select = False
+
+        objects = context.selected_objects
+
+        if objects:
+            # store transformation data
+            # need to start at scene start frame so simulation is run from the beginning
+            for f in list(range(scene.frame_start, self.frame_end + 1)):
+                scene.frame_set(f)
+                if f in frames:
+                    mat = {}
+                    for i, obj in enumerate(objects):
+                        mat[i] = obj.matrix_world.copy()
+                    bake.append(mat)
+
+            # apply transformations as keyframes
+            for i, f in enumerate(frames):
+                scene.frame_set(f)
+                obj_prev = objects[0]
+                for j, obj in enumerate(objects):
+                    mat = bake[i][j]
+
+                    obj.location = mat.to_translation()
+
+                    rot_mode = obj.rotation_mode
+                    if rot_mode == 'QUATERNION':
+                        obj.rotation_quaternion = mat.to_quaternion()
+                    elif rot_mode == 'AXIS_ANGLE':
+                        # this is a little roundabout but there's no better way right now
+                        aa = mat.to_quaternion().to_axis_angle()
+                        obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
+                    else:  # euler
+                        # make sure euler rotation is compatible to previous frame
+                        obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
+
+                    obj_prev = obj
+
+                bpy.ops.anim.keyframe_insert(type='BUILTIN_KSI_LocRot', confirm_success=False)
+
+            # remove baked objects from simulation
+            bpy.ops.rigidbody.objects_remove()
+
+            # clean up keyframes
+            for obj in objects:
+                action = obj.animation_data.action
+                for fcu in action.fcurves:
+                    keyframe_points = fcu.keyframe_points
+                    i = 1
+                    # remove unneeded keyframes
+                    while i < len(keyframe_points) - 1:
+                        val_prev = keyframe_points[i - 1].co[1]
+                        val_next = keyframe_points[i + 1].co[1]
+                        val = keyframe_points[i].co[1]
+
+                        if abs(val - val_prev) + abs(val - val_next) < 0.0001:
+                            keyframe_points.remove(keyframe_points[i])
+                        else:
+                            i += 1
+                    # use linear interpolation for better visual results
+                    for keyframe in keyframe_points:
+                        keyframe.interpolation = 'LINEAR'
+
+            # return to the frame we started on
+            scene.frame_set(frame_orig)
+
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+        scene = context.scene
+        self.frame_start = scene.frame_start
+        self.frame_end = scene.frame_end
+
+        wm = context.window_manager
+        return wm.invoke_props_dialog(self)
+
+
+class ConnectRigidBodies(Operator):
+    """Create rigid body constraints between """ \
+    """selected and active rigid bodies"""
+    bl_idname = "rigidbody.connect"
+    bl_label = "Connect Rigid Bodies"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    con_type = EnumProperty(
+        name="Type",
+        description="Type of generated constraint",
+        # XXX Would be nice to get icons too, but currently not possible ;)
+        items=tuple((e.identifier, e.name, e.description, e. value)
+                    for e in bpy.types.RigidBodyConstraint.bl_rna.properties["type"].enum_items),
+        default='FIXED',)
+
+    pivot_type = EnumProperty(
+        name="Location",
+        description="Constraint pivot location",
+        items=(('CENTER', "Center", "Pivot location is between the constrained rigid bodies"),
+               ('ACTIVE', "Active", "Pivot location is at the active object position"),
+               ('SELECTED', "Selected", "Pivot location is at the selected object position")),
+        default='CENTER',)
+
+    @classmethod
+    def poll(cls, context):
+        obj = context.object
+        return (obj and obj.rigid_body)
+
+    def execute(self, context):
+
+        scene = context.scene
+        objects = context.selected_objects
+        obj_act = context.active_object
+        change = False
+
+        for obj in objects:
+            if obj == obj_act:
+                continue
+            if self.pivot_type == 'ACTIVE':
+                loc = obj_act.location
+            elif self.pivot_type == 'SELECTED':
+                loc = obj.location
+            else:
+                loc = (obj_act.location + obj.location) / 2.0
+            # TODO: use bpy.data.objects.new(...)
+            bpy.ops.object.add(type='EMPTY',
+                               view_align=False,
+                               enter_editmode=False,
+                               location=loc)
+            bpy.ops.rigidbody.constraint_add()
+            con_obj = context.active_object
+            con_obj.empty_draw_type = 'ARROWS'
+            con = con_obj.rigid_body_constraint
+            con.type = self.con_type
+            con.object1 = obj_act
+            con.object2 = obj
+            change = True
+
+        if change:
+            # restore selection
+            bpy.ops.object.select_all(action='DESELECT')
+            for obj in objects:
+                obj.select = True
+            scene.objects.active = obj_act
+            return {'FINISHED'}
+        else:
+            self.report({'WARNING'}, "No other objects selected")
+            return {'CANCELLED'}
diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
index 7b6013f..ee3ae28 100644
--- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py
+++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
@@ -26,18 +26,18 @@ from bpy.types import Operator
 
 
 def extend(obj, operator, EXTEND_MODE):
-    
+
     import bmesh
     me = obj.data
     # script will fail without UVs
     if not me.uv_textures:
         me.uv_textures.new()
-    
+
     bm = bmesh.from_edit_mesh(me)
-    
+
     f_act = bm.faces.active
     uv_act = bm.loops.layers.uv.active
-    
+
     if f_act is None:
         operator.report({'ERROR'}, "No active face")
         return
@@ -57,7 +57,7 @@ def extend(obj, operator, EXTEND_MODE):
             f.tag = False
         # tag the active face True since we begin there
         f_act.tag = True
-    
+
     def walk_face(f):
         # all faces in this list must be tagged
         f.tag = True
@@ -102,7 +102,6 @@ def extend(obj, operator, EXTEND_MODE):
             else:
                 break
 
-
     def extrapolate_uv(fac,
                        l_a_outer, l_a_inner,
                        l_b_outer, l_b_inner):
@@ -112,7 +111,7 @@ def extend(obj, operator, EXTEND_MODE):
     def apply_uv(f_prev, l_prev, f_next):
         l_a = [None, None, None, None]
         l_b = [None, None, None, None]
-        
+
         l_a[0] = l_prev
         l_a[1] = l_a[0].link_loop_next
         l_a[2] = l_a[1].link_loop_next
@@ -133,7 +132,7 @@ def extend(obj, operator, EXTEND_MODE):
         #  +-----------+
         #  copy from this face to the one above.
 
-        # get the other loops 
+        # get the other loops
         l_next = l_prev.link_loop_radial_next
         if l_next.vert != l_prev.vert:
             l_b[1] = l_next
diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
index 198b366..b24a713 100644
--- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py
+++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
@@ -189,14 +189,14 @@ class prettyface(object):
 
 
 def lightmap_uvpack(meshes,
-                      PREF_SEL_ONLY=True,
-                      PREF_NEW_UVLAYER=False,
-                      PREF_PACK_IN_ONE=False,
-                      PREF_APPLY_IMAGE=False,
-                      PREF_IMG_PX_SIZE=512,
-                      PREF_BOX_DIV=8,
-                      PREF_MARGIN_DIV=512
-                      ):
+                    PREF_SEL_ONLY=True,
+                    PREF_NEW_UVLAYER=False,
+                    PREF_PACK_IN_ONE=False,
+                    PREF_APPLY_IMAGE=False,
+                    PREF_IMG_PX_SIZE=512,
+                    PREF_BOX_DIV=8,
+                    PREF_MARGIN_DIV=512
+                    ):
     """
     BOX_DIV if the maximum division of the UV map that
     a box may be consolidated into.
@@ -516,7 +516,7 @@ def lightmap_uvpack(meshes,
 
 def unwrap(operator, context, **kwargs):
 
-    is_editmode = (bpy.context.object.mode == 'EDIT')
+    is_editmode = (context.object.mode == 'EDIT')
     if is_editmode:
         bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
 
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 00cc763..6ac61a9 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -35,6 +35,7 @@ class MESH_OT_delete_edgeloop(Operator):
     """to a single face loop"""
     bl_idname = "mesh.delete_edgeloop"
     bl_label = "Delete Edge Loop"
+    bl_options = {'UNDO', 'REGISTER'}
 
     @classmethod
     def poll(cls, context):
@@ -500,18 +501,16 @@ class WM_MT_context_menu_enum(Menu):
 
     def draw(self, context):
         data_path = self.data_path
-        value = context_path_validate(bpy.context, data_path)
+        value = context_path_validate(context, data_path)
         if value is Ellipsis:
             return {'PASS_THROUGH'}
         base_path, prop_string = data_path.rsplit(".", 1)
         value_base = context_path_validate(context, base_path)
+        prop = value_base.bl_rna.properties[prop_string]
 
-        values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].enum_items]
-
-        for name, identifier in values:
-            props = self.layout.operator("wm.context_set_enum", text=name)
-            props.data_path = data_path
-            props.value = identifier
+        layout = self.layout
+        layout.label(prop.name, icon=prop.icon)
+        layout.prop(value_base, prop_string, expand=True)
 
 
 class WM_OT_context_menu_enum(Operator):
@@ -1255,13 +1254,6 @@ class WM_OT_copy_prev_settings(Operator):
         else:
             shutil.copytree(path_src, path_dst, symlinks=True)
 
-            # in 2.57 and earlier windows installers, system scripts were copied
-            # into the configuration directory, don't want to copy those
-            system_script = os.path.join(path_dst, "scripts/modules/bpy_types.py")
-            if os.path.isfile(system_script):
-                shutil.rmtree(os.path.join(path_dst, "scripts"))
-                shutil.rmtree(os.path.join(path_dst, "plugins"))
-
             # don't loose users work if they open the splash later.
             if bpy.data.is_saved is bpy.data.is_dirty is False:
                 bpy.ops.wm.read_homefile()
@@ -1596,7 +1588,7 @@ class WM_OT_addon_enable(Operator):
                                           "version %d.%d.%d and might not "
                                           "function (correctly), "
                                           "though it is enabled") %
-                                          info_ver)
+                                         info_ver)
             return {'FINISHED'}
         else:
             return {'CANCELLED'}
@@ -1739,7 +1731,7 @@ class WM_OT_addon_install(Operator):
             # don't use bpy.utils.script_paths("addons") because we may not be able to write to it.
             path_addons = bpy.utils.user_resource('SCRIPTS', "addons", create=True)
         else:
-            path_addons = bpy.context.user_preferences.filepaths.script_directory
+            path_addons = context.user_preferences.filepaths.script_directory
             if path_addons:
                 path_addons = os.path.join(path_addons, "addons")
 
@@ -1748,8 +1740,7 @@ class WM_OT_addon_install(Operator):
             return {'CANCELLED'}
 
         # create dir is if missing.
-        if not os.path.exists(path_addons):
-            os.makedirs(path_addons)
+        os.makedirs(path_addons, exist_ok=True)
 
         # Check if we are installing from a target path,
         # doing so causes 2+ addons of same name or when the same from/to
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index aa1a8a9..09813d8 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -48,6 +48,8 @@ _modules = (
     "properties_physics_dynamicpaint",
     "properties_physics_field",
     "properties_physics_fluid",
+    "properties_physics_rigidbody",
+    "properties_physics_rigidbody_constraint",
     "properties_physics_smoke",
     "properties_physics_softbody",
     "properties_render",
@@ -133,7 +135,9 @@ def register():
 def unregister():
     bpy.utils.unregister_module(__name__)
 
+
 # Define a default UIList, when a list does not need any custom drawing...
+# Keep in sync with its #defined name in UI_interface.h
 class UI_UL_list(bpy.types.UIList):
     pass
 
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index 1643210..74f3317 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -124,7 +124,7 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
         rows = 2
         if group:
             rows = 5
-        row.template_list("UI_UL_list", "", pose, "bone_groups", pose.bone_groups, "active_index", rows=rows)
+        row.template_list("UI_UL_list", "bone_groups", pose, "bone_groups", pose.bone_groups, "active_index", rows=rows)
 
         col = row.column(align=True)
         col.active = (ob.proxy is None)
@@ -184,7 +184,8 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
         if poselib:
             # list of poses in pose library
             row = layout.row()
-            row.template_list("UI_UL_list", "", poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
+            row.template_list("UI_UL_list", "pose_markers", poselib, "pose_markers",
+                              poselib.pose_markers, "active_index", rows=5)
 
             # column of operators for active pose
             # - goes beside list
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 5fdb71b..86a4899 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -34,7 +34,8 @@ class MESH_MT_vertex_group_specials(Menu):
         layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA')
         layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA')
         layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT')
-        layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all = True
+        layout.operator("object.vertex_group_remove", icon='X', text="Delete All Vertex Groups").all = True
+        layout.operator("object.vertex_group_remove_from", icon='X', text="Remove Selected from All Vertex Groups").all = True
         layout.separator()
         layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'LOCK'
         layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'UNLOCK'
@@ -59,12 +60,12 @@ class MESH_UL_vgroups(UIList):
         # assert(isinstance(item, bpy.types.VertexGroup)
         vgroup = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(vgroup.name, icon_value=icon)
+            layout.label(text=vgroup.name, translate=False, icon_value=icon)
             icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED'
             layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MESH_UL_shape_keys(UIList):
@@ -75,30 +76,30 @@ class MESH_UL_shape_keys(UIList):
         key_block = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             split = layout.split(0.66, False)
-            split.label(item.name, icon_value=icon)
+            split.label(text=item.name, translate=False, icon_value=icon)
             row = split.row(True)
             if key_block.mute or (obj.mode == 'EDIT' and not (obj.use_shape_key_edit_mode and obj.type == 'MESH')):
                 row.active = False
             if not item.relative_key or index > 0:
                 row.prop(key_block, "value", text="", emboss=False)
             else:
-                row.label("")
+                row.label(text="")
             row.prop(key_block, "mute", text="", emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MESH_UL_uvmaps_vcols(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
         # assert(isinstance(item, (bpy.types.MeshTexturePolyLayer, bpy.types.MeshLoopColorLayer))
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(item.name, icon_value=icon)
+            layout.label(text=item.name, translate=False, icon_value=icon)
             icon = 'RESTRICT_RENDER_OFF' if item.active_render else 'RESTRICT_RENDER_ON'
             layout.prop(item, "active_render", text="", icon=icon, emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MeshButtonsPanel():
@@ -193,7 +194,6 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
         row = layout.row()
         row.template_list("MESH_UL_vgroups", "", ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
 
-
         col = row.column(align=True)
         col.operator("object.vertex_group_add", icon='ZOOMIN', text="")
         col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="").all = False
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index df29f18..7be0019 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 from bpy.types import Panel
+from bpy.app.translations import pgettext_iface as iface_
 
 
 class ModifierButtonsPanel():
@@ -162,6 +163,44 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         sub.active = md.use_random_order
         sub.prop(md, "seed")
 
+    def MESH_CACHE(self, layout, ob, md):
+        layout.prop(md, "cache_format")
+        layout.prop(md, "filepath")
+
+        layout.label(text="Evaluation:")
+        layout.prop(md, "factor", slider=True)
+        layout.prop(md, "deform_mode")
+        layout.prop(md, "interpolation")
+
+        layout.label(text="Time Mapping:")
+
+        row = layout.row()
+        row.prop(md, "time_mode", expand=True)
+        row = layout.row()
+        row.prop(md, "play_mode", expand=True)
+        if md.play_mode == 'SCENE':
+            layout.prop(md, "frame_start")
+            layout.prop(md, "frame_scale")
+        else:
+            time_mode = md.time_mode
+            if time_mode == 'FRAME':
+                layout.prop(md, "eval_frame")
+            elif time_mode == 'TIME':
+                layout.prop(md, "eval_time")
+            elif time_mode == 'FACTOR':
+                layout.prop(md, "eval_factor")
+
+        layout.label(text="Axis Mapping:")
+        split = layout.split(percentage=0.5, align=True)
+        split.alert = (md.forward_axis[-1] == md.up_axis[-1])
+        split.label("Forward/Up Axis:")
+        split.prop(md, "forward_axis", text="")
+        split.prop(md, "up_axis", text="")
+        split = layout.split(percentage=0.5)
+        split.label(text="Flip Axis:")
+        row = split.row()
+        row.prop(md, "flip_axis")
+
     def CAST(self, layout, ob, md):
         split = layout.split(percentage=0.25)
 
@@ -227,7 +266,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
             layout.prop(md, "angle_limit")
             layout.prop(md, "use_dissolve_boundaries")
 
-        layout.label(text="Face Count" + ": %d" % md.face_count)
+        layout.label(text=iface_("Face Count: %d") % md.face_count, translate=False)
 
     def DISPLACE(self, layout, ob, md):
         has_texture = (md.texture is not None)
@@ -333,23 +372,24 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 
     def LAPLACIANSMOOTH(self, layout, ob, md):
         layout.prop(md, "iterations")
-        
+
         split = layout.split(percentage=0.25)
-        
+
         col = split.column()
         col.label(text="Axis:")
         col.prop(md, "use_x")
         col.prop(md, "use_y")
         col.prop(md, "use_z")
-        
+
         col = split.column()
         col.label(text="Lambda:")
         col.prop(md, "lambda_factor", text="Factor")
         col.prop(md, "lambda_border", text="Border")
-        
+
         col.separator()
         col.prop(md, "use_volume_preserve")
-        
+        col.prop(md, "use_normalized")
+
         layout.label(text="Vertex Group:")
         layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
 
@@ -558,7 +598,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 
         col = split.column()
 
-
     def PARTICLE_INSTANCE(self, layout, ob, md):
         layout.prop(md, "object")
         layout.prop(md, "particle_system_index", text="Particle System")
@@ -1045,12 +1084,12 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
     def UV_WARP(self, layout, ob, md):
         split = layout.split()
         col = split.column()
-        col.prop(md, "center");
+        col.prop(md, "center")
 
         col = split.column()
         col.label(text="UV Axis:")
-        col.prop(md, "axis_u", text="");
-        col.prop(md, "axis_v", text="");
+        col.prop(md, "axis_u", text="")
+        col.prop(md, "axis_v", text="")
 
         split = layout.split()
         col = split.column()
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py
index 58b6aa6..1f05c8e 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -199,6 +199,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
             col = split.column()
             col.prop(game, "collision_mask")
 
+
 class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
     bl_label = "Collision Bounds"
     COMPAT_ENGINES = {'BLENDER_GAME'}
@@ -411,10 +412,10 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel):
         col = row.column()
         col.prop(gs, "use_display_lists")
         col.active = gs.raster_storage != 'VERTEX_BUFFER_OBJECT'
-		
+
         row = layout.row()
         row.prop(gs, "raster_storage")
-        
+
         row = layout.row()
         row.label("Exit Key")
         row.prop(gs, "exit_key", text="", event=True)
@@ -620,7 +621,9 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
 
         layout.prop(gs, "physics_engine")
         if gs.physics_engine != 'NONE':
-            layout.prop(gs, "physics_gravity", text="Gravity")
+            col = layout.column()
+            col.prop(gs, "physics_gravity", text="Gravity")
+            col.prop(gs, "occlusion_culling_resolution", text="Culling Resolution")
 
             split = layout.split()
 
@@ -643,12 +646,6 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
             sub = col.row()
             sub.prop(gs, "deactivation_time", text="Time")
 
-            col = layout.column()
-            col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
-            sub = col.column()
-            sub.active = gs.use_occlusion_culling
-            sub.prop(gs, "occlusion_culling_resolution", text="Resolution")
-
         else:
             split = layout.split()
 
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py
index 9861db3..4ceaffb 100644
--- a/release/scripts/startup/bl_ui/properties_mask_common.py
+++ b/release/scripts/startup/bl_ui/properties_mask_common.py
@@ -26,12 +26,13 @@ from bpy.types import Menu, UIList
 
 
 class MASK_UL_layers(UIList):
-    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+    def draw_item(self, context, layout, data, item, icon,
+                  active_data, active_propname, index):
         # assert(isinstance(item, bpy.types.MaskLayer)
         mask = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             split = layout.split()
-            split.label(mask.name, icon_value=icon)
+            split.label(text=mask.name, translate=False, icon_value=icon)
             row = split.row(align=True)
             row.prop(mask, "alpha", text="", emboss=False)
             row.prop(mask, "hide", text="", emboss=False)
@@ -39,7 +40,7 @@ class MASK_UL_layers(UIList):
             row.prop(mask, "hide_render", text="", emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MASK_PT_mask:
@@ -86,7 +87,8 @@ class MASK_PT_layers:
         rows = 5 if active_layer else 2
 
         row = layout.row()
-        row.template_list("MASK_UL_layers", "", mask, "layers", mask, "active_layer_index", rows=rows)
+        row.template_list("MASK_UL_layers", "", mask, "layers",
+                          mask, "active_layer_index", rows=rows)
 
         sub = row.column(align=True)
 
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 7e18cf8..9a3957f 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -20,6 +20,7 @@
 import bpy
 from bpy.types import Menu, Panel, UIList
 from rna_prop_ui import PropertyPanel
+from bpy.app.translations import pgettext_iface as iface_
 
 
 def active_node_mat(mat):
@@ -76,16 +77,16 @@ class MATERIAL_UL_matslots(UIList):
         slot = item
         ma = slot.material
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(ma.name if ma else "", icon_value=icon)
+            layout.label(text=ma.name if ma else "", translate=False, icon_value=icon)
             if ma and not context.scene.render.use_shading_nodes:
                 manode = ma.active_node_material
                 if manode:
-                    layout.label("Node %s" % manode.name, icon_value=layout.icon(manode))
+                    layout.label(text=iface_("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
                 elif ma.use_nodes:
-                    layout.label("Node <none>")
+                    layout.label(text="Node <none>")
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MaterialButtonsPanel():
@@ -563,7 +564,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
             row.prop(halo, toggle, text="")
             sub = row.column()
             sub.active = getattr(halo, toggle)
-            sub.prop(halo, number, text=name)
+            sub.prop(halo, number, text=name, translate=False)
             if not color == "":
                 sub.prop(mat, color, text="")
 
@@ -590,9 +591,9 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
         col.prop(halo, "use_soft")
 
         col = split.column()
-        number_but(col, "use_ring", "ring_count", "Rings", "mirror_color")
-        number_but(col, "use_lines", "line_count", "Lines", "specular_color")
-        number_but(col, "use_star", "star_tip_count", "Star tips", "")
+        number_but(col, "use_ring", "ring_count", iface_("Rings"), "mirror_color")
+        number_but(col, "use_lines", "line_count", iface_("Lines"), "specular_color")
+        number_but(col, "use_star", "star_tip_count", iface_("Star Tips"), "")
 
 
 class MATERIAL_PT_flare(MaterialButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 9518074..b9dcdc1 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -230,6 +230,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
         col.prop(ob, "show_x_ray", text="X-Ray")
         if ob.type == 'MESH':
             col.prop(ob, "show_transparent", text="Transparency")
+            col.prop(ob, "show_all_edges")
 
 
 class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py
index eb09298..6478e49 100644
--- a/release/scripts/startup/bl_ui/properties_object_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_object_constraint.py
@@ -172,7 +172,6 @@ class ConstraintButtonsPanel():
             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)
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 53cf640..7c06aef 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -70,34 +70,40 @@ class UnifiedPaintPanel():
 
 
 # Used in both the View3D toolbar and texture properties
-def sculpt_brush_texture_settings(layout, brush):
+def brush_texture_settings(layout, brush, sculpt):
     tex_slot = brush.texture_slot
 
     layout.label(text="Brush Mapping:")
 
     # map_mode
-    layout.row().prop(tex_slot, "map_mode", text="")
-    layout.separator()
-
-    # angle and texture_angle_source
-    col = layout.column()
-    col.active = brush.sculpt_capabilities.has_texture_angle_source
-    col.label(text="Angle:")
-    if brush.sculpt_capabilities.has_random_texture_angle:
-        col.prop(brush, "texture_angle_source_random", text="")
+    if sculpt:
+        layout.row().prop(tex_slot, "map_mode", text="")
+        layout.separator()
     else:
-        col.prop(brush, "texture_angle_source_no_random", text="")
+        layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
+        layout.separator()
 
+    # angle and texture_angle_source
     col = layout.column()
-    col.active = brush.sculpt_capabilities.has_texture_angle
-    col.prop(tex_slot, "angle", text="")
+    if sculpt:
+        col.active = brush.sculpt_capabilities.has_texture_angle_source
+        col.label(text="Angle:")
+        if brush.sculpt_capabilities.has_random_texture_angle:
+            col.prop(brush, "texture_angle_source_random", text="")
+        else:
+            col.prop(brush, "texture_angle_source_no_random", text="")
+
+        col = layout.column()
+        col.active = brush.sculpt_capabilities.has_texture_angle
+        col.prop(tex_slot, "angle", text="")
 
     # scale and offset
     split = layout.split()
     split.prop(tex_slot, "offset")
     split.prop(tex_slot, "scale")
 
-    # texture_sample_bias
-    col = layout.column(align=True)
-    col.label(text="Sample Bias:")
-    col.prop(brush, "texture_sample_bias", slider=True, text="")
+    if sculpt:
+        # texture_sample_bias
+        col = layout.column(align=True)
+        col.label(text="Sample Bias:")
+        col.prop(brush, "texture_sample_bias", slider=True, text="")
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 90dcf59..f6784cb 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -20,6 +20,7 @@
 import bpy
 from bpy.types import Panel
 from rna_prop_ui import PropertyPanel
+from bpy.app.translations import pgettext_iface as iface_
 
 from bl_ui.properties_physics_common import (point_cache_ui,
                                              effector_weights_ui,
@@ -96,7 +97,8 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
         if ob:
             row = layout.row()
 
-            row.template_list("UI_UL_list", "", ob, "particle_systems", ob.particle_systems, "active_index", rows=2)
+            row.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
+                              ob.particle_systems, "active_index", rows=2)
 
             col = row.column(align=True)
             col.operator("object.particle_system_add", icon='ZOOMIN', text="")
@@ -148,7 +150,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
             #row.label(text="Render")
 
             if part.is_fluid:
-                layout.label(text="%d fluid particles for this frame" % part.count)
+                layout.label(text=iface_("%d fluid particles for this frame") % part.count, translate=False)
                 return
 
             row = col.row()
@@ -542,7 +544,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
                     # spacing between particles when the fluid is at rest. This
                     # makes it easier to set stable initial conditions.
                     particle_volume = part.mass / fluid.rest_density
-                    spacing = pow(particle_volume, 1/3)
+                    spacing = pow(particle_volume, 1.0 / 3.0)
                     sub = col.row()
                     sub.label(text="Spacing: %g" % spacing)
 
@@ -636,7 +638,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
                 layout.label(text="Fluid interaction:")
 
             row = layout.row()
-            row.template_list("UI_UL_list", "", psys, "targets", psys, "active_particle_target_index")
+            row.template_list("UI_UL_list", "particle_targets", psys, "targets", psys, "active_particle_target_index")
 
             col = row.column()
             sub = col.row()
@@ -702,7 +704,8 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
 
         # Currently boids can only use the first state so these are commented out for now.
         #row = layout.row()
-        #row.template_list("UI_UL_list", "", boids, "states", boids, "active_boid_state_index", compact="True")
+        #row.template_list("UI_UL_list", "particle_boids", boids, "states",
+        #                  boids, "active_boid_state_index", compact="True")
         #col = row.row()
         #sub = col.row(align=True)
         #sub.operator("boid.state_add", icon='ZOOMIN', text="")
@@ -723,7 +726,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
             row.label(text="")
 
         row = layout.row()
-        row.template_list("UI_UL_list", "", state, "rules", state, "active_boid_rule_index")
+        row.template_list("UI_UL_list", "particle_boids_rules", state, "rules", state, "active_boid_rule_index")
 
         col = row.column()
         sub = col.row()
@@ -886,7 +889,8 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
 
             if part.use_group_count and not part.use_whole_group:
                 row = layout.row()
-                row.template_list("UI_UL_list", "", part, "dupli_weights", part, "active_dupliweight_index")
+                row.template_list("UI_UL_list", "particle_dupli_weights", part, "dupli_weights",
+                                  part, "active_dupliweight_index")
 
                 col = row.column()
                 sub = col.row()
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index b70ff32..2d9d464 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -21,6 +21,8 @@
 import bpy
 from bpy.types import Panel
 
+i18n_default_ctxt = bpy.app.translations.contexts.default
+
 
 class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
@@ -37,12 +39,20 @@ def physics_add(self, layout, md, name, type, typeicon, toggles):
     sub = layout.row(align=True)
     if md:
         sub.context_pointer_set("modifier", md)
-        sub.operator("object.modifier_remove", text=name, icon='X')
+        sub.operator("object.modifier_remove", text=name, text_ctxt=i18n_default_ctxt, icon='X')
         if(toggles):
             sub.prop(md, "show_render", text="")
             sub.prop(md, "show_viewport", text="")
     else:
-        sub.operator("object.modifier_add", text=name, icon=typeicon).type = type
+        sub.operator("object.modifier_add", text=name, text_ctxt=i18n_default_ctxt, icon=typeicon).type = type
+
+
+def physics_add_special(self, layout, data, name, addop, removeop, typeicon):
+    sub = layout.row(align=True)
+    if data:
+        sub.operator(removeop, text=name, text_ctxt=i18n_default_ctxt, icon='X')
+    else:
+        sub.operator(addop, text=name, text_ctxt=i18n_default_ctxt, icon=typeicon)
 
 
 class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
@@ -76,6 +86,18 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
             physics_add(self, col, context.fluid, "Fluid", 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True)
             physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True)
 
+        if(ob.type == 'MESH'):
+            physics_add_special(self, col, ob.rigid_body, "Rigid Body",
+                                "rigidbody.object_add",
+                                "rigidbody.object_remove",
+                                'MESH_ICOSPHERE')  # XXX: need dedicated icon
+
+        # all types of objects can have rigid body constraint
+        physics_add_special(self, col, ob.rigid_body_constraint, "Rigid Body Constraint",
+                            "rigidbody.constraint_add",
+                            "rigidbody.constraint_remove",
+                            'CONSTRAINT')  # RB_TODO needs better icon
+
 
 # cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc
 
@@ -84,11 +106,13 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
 
     layout.context_pointer_set("point_cache", cache)
 
-    row = layout.row()
-    row.template_list("UI_UL_list", "", cache, "point_caches", cache.point_caches, "active_index", rows=2)
-    col = row.column(align=True)
-    col.operator("ptcache.add", icon='ZOOMIN', text="")
-    col.operator("ptcache.remove", icon='ZOOMOUT', text="")
+    if not cachetype == 'RIGID_BODY':
+        row = layout.row()
+        row.template_list("UI_UL_list", "point_caches", cache, "point_caches",
+                          cache.point_caches, "active_index", rows=2)
+        col = row.column(align=True)
+        col.operator("ptcache.add", icon='ZOOMIN', text="")
+        col.operator("ptcache.remove", icon='ZOOMOUT', text="")
 
     row = layout.row()
     if cachetype in {'PSYS', 'HAIR', 'SMOKE'}:
@@ -131,13 +155,13 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
             row.enabled = enabled
             row.prop(cache, "frame_start")
             row.prop(cache, "frame_end")
-        if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT'}:
+        if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
             row.prop(cache, "frame_step")
-            
+
         if cachetype != 'SMOKE':
             layout.label(text=cache.info)
 
-        if cachetype not in {'SMOKE', 'DYNAMIC_PAINT'}:
+        if cachetype not in {'SMOKE', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
             split = layout.split()
             split.enabled = enabled and bpy.data.is_saved
 
diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
index 9393852..7ee63ee 100644
--- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
+++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
@@ -33,7 +33,7 @@ class PHYSICS_UL_dynapaint_surfaces(UIList):
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             row = layout.row(align=True)
             row.label(text="", icon_value=icon)
-            row.label(text=surf.name, icon_value=sticon)
+            row.label(text=surf.name, translate=False, icon_value=sticon)
             row = layout.row(align=True)
             if surf.use_color_preview:
                 row.prop(surf, "show_preview", text="", emboss=False,
@@ -80,7 +80,7 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
 
                 row = layout.row()
                 row.template_list("PHYSICS_UL_dynapaint_surfaces", "", canvas, "canvas_surfaces",
-                                   canvas.canvas_surfaces, "active_index", rows=2)
+                                  canvas.canvas_surfaces, "active_index", rows=2)
 
                 col = row.column(align=True)
                 col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="")
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 08278c0..2164b86 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 from bpy.types import Panel, Menu
+from bpy.app.translations import pgettext_iface as iface_
 
 
 class FLUID_MT_presets(Menu):
@@ -64,7 +65,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
 
         if fluid.type == 'DOMAIN':
             # odd formatting here so translation script can extract string
-            layout.operator("fluid.bake", text="Bake (Req. Memory:" + " %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM')
+            layout.operator("fluid.bake", text=iface_("Bake (Req. Memory: %s)") % fluid.memory_estimate,
+                            translate=False, icon='MOD_FLUIDSIM')
             split = layout.split()
 
             col = split.column()
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
new file mode 100644
index 0000000..922eee6
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
@@ -0,0 +1,135 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Panel
+
+
+class PHYSICS_PT_rigidbody_panel():
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "physics"
+
+
+class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
+    bl_label = "Rigid Body"
+
+    @classmethod
+    def poll(cls, context):
+        obj = context.object
+        return (obj and obj.rigid_body and
+                (not context.scene.render.use_game_engine))
+
+    def draw_header(self, context):
+        obj = context.object
+        rbo = obj.rigid_body
+        if rbo is not None:
+            self.layout.prop(rbo, "enabled", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        rbo = ob.rigid_body
+
+        if rbo is not None:
+            layout.prop(rbo, "type", text="Type")
+            layout.prop(rbo, "kinematic", text="Animated")
+
+            if rbo.type == 'ACTIVE':
+                layout.prop(rbo, "mass")
+
+
+class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
+    bl_label = "Rigid Body Collisions"
+
+    @classmethod
+    def poll(cls, context):
+        obj = context.object
+        return (obj and obj.rigid_body and
+                (not context.scene.render.use_game_engine))
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        rbo = ob.rigid_body
+
+        layout.prop(rbo, "collision_shape", text="Shape")
+
+        split = layout.split()
+
+        col = split.column()
+        col.label(text="Surface Response:")
+        col.prop(rbo, "friction")
+        col.prop(rbo, "restitution", text="Bounciness")
+
+        col = split.column()
+        col.label(text="Sensitivity:")
+        if rbo.collision_shape in {'MESH', 'CONE'}:
+            col.prop(rbo, "collision_margin", text="Margin")
+        else:
+            col.prop(rbo, "use_margin")
+            sub = col.column()
+            sub.active = rbo.use_margin
+            sub.prop(rbo, "collision_margin", text="Margin")
+
+        layout.prop(rbo, "collision_groups")
+
+
+class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
+    bl_label = "Rigid Body Dynamics"
+    bl_default_closed = True
+
+    @classmethod
+    def poll(cls, context):
+        obj = context.object
+        return (obj and obj.rigid_body and
+                obj.rigid_body.type == 'ACTIVE' and
+                (not context.scene.render.use_game_engine))
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        rbo = ob.rigid_body
+
+        #col = layout.column(align=1)
+        #col.label(text="Activation:")
+        # XXX: settings such as activate on collison/etc. 
+
+        split = layout.split()
+
+        col = split.column()
+        col.label(text="Deactivation:")
+        col.prop(rbo, "use_deactivation")
+        sub = col.column()
+        sub.active = rbo.use_deactivation
+        sub.prop(rbo, "start_deactivated")
+        sub.prop(rbo, "deactivate_linear_velocity", text="Linear Vel")
+        sub.prop(rbo, "deactivate_angular_velocity", text="Angular Vel")
+        # TODO: other params such as time?
+
+        col = split.column()
+        col.label(text="Damping:")
+        col.prop(rbo, "linear_damping", text="Translation")
+        col.prop(rbo, "angular_damping", text="Rotation")
+
+if __name__ == "__main__":  # only for live edit.
+    bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
new file mode 100644
index 0000000..e4e5b94
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
@@ -0,0 +1,208 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Panel
+
+
+class PHYSICS_PT_rigidbody_constraint_panel():
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "physics"
+
+
+class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Panel):
+    bl_label = "Rigid Body Constraint"
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        rd = context.scene.render
+        return (ob and ob.rigid_body_constraint and (not rd.use_game_engine))
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        rbc = ob.rigid_body_constraint
+
+        layout.prop(rbc, "type")
+
+        row = layout.row()
+        row.prop(rbc, "enabled")
+        row.prop(rbc, "disable_collisions")
+
+        layout.prop(rbc, "object1")
+        layout.prop(rbc, "object2")
+
+        row = layout.row()
+        row.prop(rbc, "use_breaking")
+        sub = row.row()
+        sub.active = rbc.use_breaking
+        sub.prop(rbc, "breaking_threshold", text="Threshold")
+
+        row = layout.row()
+        row.prop(rbc, "override_solver_iterations", text="Override Iterations")
+        sub = row.row()
+        sub.active = rbc.override_solver_iterations
+        sub.prop(rbc, "num_solver_iterations", text="Iterations")
+
+        if rbc.type == 'HINGE':
+            col = layout.column(align=True)
+            col.label("Limits:")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_ang_z", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_ang_z
+            sub.prop(rbc, "limit_ang_z_lower", text="Lower")
+            sub.prop(rbc, "limit_ang_z_upper", text="Upper")
+
+        elif rbc.type == 'SLIDER':
+            col = layout.column(align=True)
+            col.label("Limits:")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_lin_x", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_lin_x
+            sub.prop(rbc, "limit_lin_x_lower", text="Lower")
+            sub.prop(rbc, "limit_lin_x_upper", text="Upper")
+
+        elif rbc.type == 'PISTON':
+            col = layout.column(align=True)
+            col.label("Limits:")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_lin_x", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_lin_x
+            sub.prop(rbc, "limit_lin_x_lower", text="Lower")
+            sub.prop(rbc, "limit_lin_x_upper", text="Upper")
+
+            col = layout.column(align=True)
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_ang_x", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_ang_x
+            sub.prop(rbc, "limit_ang_x_lower", text="Lower")
+            sub.prop(rbc, "limit_ang_x_upper", text="Upper")
+
+        elif rbc.type in {'GENERIC', 'GENERIC_SPRING'}:
+            col = layout.column(align=True)
+            col.label("Limits:")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_lin_x", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_lin_x
+            sub.prop(rbc, "limit_lin_x_lower", text="Lower")
+            sub.prop(rbc, "limit_lin_x_upper", text="Upper")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_lin_y", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_lin_y
+            sub.prop(rbc, "limit_lin_y_lower", text="Lower")
+            sub.prop(rbc, "limit_lin_y_upper", text="Upper")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_lin_z", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_lin_z
+            sub.prop(rbc, "limit_lin_z_lower", text="Lower")
+            sub.prop(rbc, "limit_lin_z_upper", text="Upper")
+
+            col = layout.column(align=True)
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_ang_x", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_ang_x
+            sub.prop(rbc, "limit_ang_x_lower", text="Lower")
+            sub.prop(rbc, "limit_ang_x_upper", text="Upper")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_ang_y", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_ang_y
+            sub.prop(rbc, "limit_ang_y_lower", text="Lower")
+            sub.prop(rbc, "limit_ang_y_upper", text="Upper")
+
+            row = col.row()
+            sub = row.row()
+            sub.scale_x = 0.5
+            sub.prop(rbc, "use_limit_ang_z", toggle=True)
+            sub = row.row()
+            sub.active = rbc.use_limit_ang_z
+            sub.prop(rbc, "limit_ang_z_lower", text="Lower")
+            sub.prop(rbc, "limit_ang_z_upper", text="Upper")
+
+            if rbc.type == 'GENERIC_SPRING':
+                col = layout.column(align=True)
+                col.label("Springs:")
+
+                row = col.row()
+                sub = row.row()
+                sub.scale_x = 0.1
+                sub.prop(rbc, "use_spring_x", toggle=True, text="X")
+                sub = row.row()
+                sub.active = rbc.use_spring_x
+                sub.prop(rbc, "spring_stiffness_x", text="Stiffness")
+                sub.prop(rbc, "spring_damping_x")
+
+                row = col.row()
+                sub = row.row()
+                sub.scale_x = 0.1
+                sub.prop(rbc, "use_spring_y", toggle=True, text="Y")
+                sub = row.row()
+                sub.active = rbc.use_spring_y
+                sub.prop(rbc, "spring_stiffness_y", text="Stiffness")
+                sub.prop(rbc, "spring_damping_y")
+
+                row = col.row()
+                sub = row.row()
+                sub.scale_x = 0.1
+                sub.prop(rbc, "use_spring_z", toggle=True, text="Z")
+                sub = row.row()
+                sub.active = rbc.use_spring_z
+                sub.prop(rbc, "spring_stiffness_z", text="Stiffness")
+                sub.prop(rbc, "spring_damping_z")
+
+if __name__ == "__main__":  # only for live edit.
+    bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index ce5053f..487f43a 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -76,7 +76,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
         elif md.smoke_type == 'FLOW':
 
             flow = md.flow_settings
-            
+
             layout.prop(flow, "smoke_flow_type", expand=False)
 
             if flow.smoke_flow_type != "OUTFLOW":
@@ -118,7 +118,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
 
             col = split.column()
             col.prop(coll, "collision_type")
-            
+
+
 class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Flow Advanced"
     bl_options = {'DEFAULT_CLOSED'}
@@ -132,7 +133,7 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
         layout = self.layout
         ob = context.object
         flow = context.smoke.flow_settings
-        
+
         split = layout.split()
         col = split.column()
 
@@ -147,11 +148,12 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
         if flow.texture_map_type == "AUTO":
             sub.prop(flow, "texture_size")
         sub.prop(flow, "texture_offset")
-        
+
         col = split.column()
         col.label(text="Vertex Group:")
         col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="")
 
+
 class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Flames"
     bl_options = {'DEFAULT_CLOSED'}
@@ -179,7 +181,8 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
         col.prop(domain, "flame_ignition")
         col.prop(domain, "flame_max_temp")
         col.prop(domain, "flame_smoke_color")
-        
+
+
 class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Adaptive Domain"
     bl_options = {'DEFAULT_CLOSED'}
@@ -199,10 +202,10 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
 
         domain = context.smoke.domain_settings
         layout.active = domain.use_adaptive_domain
-        
+
         split = layout.split()
-        split.enabled = not domain.point_cache.is_baked
- 
+        split.enabled = (not domain.point_cache.is_baked)
+
         col = split.column(align=True)
         col.label(text="Resolution:")
         col.prop(domain, "additional_res")
@@ -212,6 +215,7 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
         col.label(text="Advanced:")
         col.prop(domain, "adapt_threshold")
 
+
 class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
     bl_label = "Smoke High Resolution"
     bl_options = {'DEFAULT_CLOSED'}
@@ -249,6 +253,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
 
         layout.prop(md, "show_high_resolution")
 
+
 class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Groups"
     bl_options = {'DEFAULT_CLOSED'}
@@ -262,7 +267,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
         domain = context.smoke.domain_settings
-        
+
         split = layout.split()
 
         col = split.column()
@@ -276,6 +281,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
         col.label(text="Collision Group:")
         col.prop(domain, "collision_group", text="")
 
+
 class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Cache"
     bl_options = {'DEFAULT_CLOSED'}
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 03b3d41..1cd5832 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -48,17 +48,12 @@ class RENDER_UL_renderlayers(UIList):
         # assert(isinstance(item, bpy.types.SceneRenderLayer)
         layer = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(layer.name, icon_value=icon)
+            layout.label(text=layer.name, translate=False, icon_value=icon)
             layout.prop(layer, "use", text="", index=index)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
-#	else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) {
-#		uiItemL(sub, name, icon);
-#		uiBlockSetEmboss(block, UI_EMBOSS);
-#		uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "use", 0, 0, 0, 0, 0,  NULL);
-#	}
 
 class RenderButtonsPanel():
     bl_space_type = 'PROPERTIES'
@@ -356,7 +351,7 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel):
         subsub = sub.column()
         subsub.enabled = rd.threads_mode == 'FIXED'
         subsub.prop(rd, "threads")
-        
+
         sub = col.column(align=True)
         sub.label(text="Tile Size:")
         sub.prop(rd, "tile_x", text="X")
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index 66a16da..519f9ca 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -21,6 +21,11 @@ import bpy
 from bpy.types import Panel, UIList
 from rna_prop_ui import PropertyPanel
 
+from bl_ui.properties_physics_common import (
+    point_cache_ui,
+    effector_weights_ui,
+    )
+
 
 class SCENE_UL_keying_set_paths(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
@@ -28,10 +33,10 @@ class SCENE_UL_keying_set_paths(UIList):
         kspath = item
         icon = layout.enum_item_icon(kspath, "id_type", kspath.id_type)
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(kspath.data_path, icon_value=icon)
+            layout.label(text=kspath.data_path, translate=False, icon_value=icon)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class SceneButtonsPanel():
@@ -59,36 +64,6 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
         layout.prop(scene, "active_clip", text="Active Clip")
 
 
-class SCENE_PT_audio(SceneButtonsPanel, Panel):
-    bl_label = "Audio"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
-    def draw(self, context):
-        layout = self.layout
-
-        scene = context.scene
-        rd = context.scene.render
-        ffmpeg = rd.ffmpeg
-
-        layout.prop(scene, "audio_volume")
-        layout.operator("sound.bake_animation")
-
-        split = layout.split()
-
-        col = split.column()
-        col.label("Listener:")
-        col.prop(scene, "audio_distance_model", text="")
-        col.prop(scene, "audio_doppler_speed", text="Speed")
-        col.prop(scene, "audio_doppler_factor", text="Doppler")
-
-        col = split.column()
-        col.label("Format:")
-        col.prop(ffmpeg, "audio_channels", text="")
-        col.prop(ffmpeg, "audio_mixrate", text="Rate")
-
-        layout.operator("sound.mixdown")
-
-
 class SCENE_PT_unit(SceneButtonsPanel, Panel):
     bl_label = "Units"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -119,7 +94,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
         row = layout.row()
 
         col = row.column()
-        col.template_list("UI_UL_list", "", scene, "keying_sets", scene.keying_sets, "active_index", rows=2)
+        col.template_list("UI_UL_list", "keying_sets", scene, "keying_sets", scene.keying_sets, "active_index", rows=2)
 
         col = row.column(align=True)
         col.operator("anim.keying_set_add", icon='ZOOMIN', text="")
@@ -198,6 +173,63 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
             col.prop(ksp, "bl_options")
 
 
+class SCENE_PT_color_management(SceneButtonsPanel, Panel):
+    bl_label = "Color Management"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        scene = context.scene
+        rd = scene.render
+
+        col = layout.column()
+        col.label(text="Display:")
+        col.prop(scene.display_settings, "display_device")
+
+        col = layout.column()
+        col.separator()
+        col.label(text="Render:")
+        col.template_colormanaged_view_settings(scene, "view_settings")
+
+        col = layout.column()
+        col.separator()
+        col.label(text="Sequencer:")
+        col.prop(scene.sequencer_colorspace_settings, "name")
+
+
+class SCENE_PT_audio(SceneButtonsPanel, Panel):
+    bl_label = "Audio"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        scene = context.scene
+        rd = context.scene.render
+        ffmpeg = rd.ffmpeg
+
+        layout.prop(scene, "audio_volume")
+        layout.operator("sound.bake_animation")
+
+        split = layout.split()
+
+        col = split.column()
+        col.label("Listener:")
+        col.prop(scene, "audio_distance_model", text="")
+        col.prop(scene, "audio_doppler_speed", text="Speed")
+        col.prop(scene, "audio_doppler_factor", text="Doppler")
+
+        col = split.column()
+        col.label("Format:")
+        col.prop(ffmpeg, "audio_channels", text="")
+        col.prop(ffmpeg, "audio_mixrate", text="Rate")
+
+        layout.operator("sound.mixdown")
+
+
 class SCENE_PT_physics(SceneButtonsPanel, Panel):
     bl_label = "Gravity"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -215,6 +247,88 @@ class SCENE_PT_physics(SceneButtonsPanel, Panel):
         layout.prop(scene, "gravity", text="")
 
 
+class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
+    bl_label = "Rigid Body World"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+    @classmethod
+    def poll(cls, context):
+        scene = context.scene
+        rd = scene.render
+        return scene and (rd.engine in cls.COMPAT_ENGINES)
+
+    def draw_header(self, context):
+        scene = context.scene
+        rbw = scene.rigidbody_world
+        if rbw is not None:
+            self.layout.prop(rbw, "enabled", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        scene = context.scene
+
+        rbw = scene.rigidbody_world
+
+        if rbw is None:
+            layout.operator("rigidbody.world_add")
+        else:
+            layout.operator("rigidbody.world_remove")
+
+            col = layout.column()
+            col.active = rbw.enabled
+
+            col = col.column()
+            col.prop(rbw, "group")
+            col.prop(rbw, "constraints")
+
+            split = col.split()
+
+            col = split.column()
+            col.prop(rbw, "time_scale", text="Speed")
+            col.prop(rbw, "use_split_impulse")
+
+            col = split.column()
+            col.prop(rbw, "steps_per_second", text="Steps Per Second")
+            col.prop(rbw, "num_solver_iterations", text="Solver Iterations")
+
+
+class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel):
+    bl_label = "Rigid Body Cache"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+    @classmethod
+    def poll(cls, context):
+        rd = context.scene.render
+        scene = context.scene
+        return scene and scene.rigidbody_world and (rd.engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        scene = context.scene
+        rbw = scene.rigidbody_world
+
+        point_cache_ui(self, context, rbw.point_cache, rbw.point_cache.is_baked is False and rbw.enabled, 'RIGID_BODY')
+
+
+class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):
+    bl_label = "Rigid Body Field Weights"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+    @classmethod
+    def poll(cls, context):
+        rd = context.scene.render
+        scene = context.scene
+        return scene and scene.rigidbody_world and (rd.engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        scene = context.scene
+        rbw = scene.rigidbody_world
+
+        effector_weights_ui(self, context, rbw.effector_weights, 'RIGID_BODY')
+
+
 class SCENE_PT_simplify(SceneButtonsPanel, Panel):
     bl_label = "Simplify"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -243,33 +357,6 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
         col.prop(rd, "simplify_ao_sss", text="AO and SSS")
 
 
-class SCENE_PT_color_management(Panel):
-    bl_label = "Color Management"
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = "scene"
-
-    def draw(self, context):
-        layout = self.layout
-
-        scene = context.scene
-        rd = scene.render
-
-        col = layout.column()
-        col.label(text="Display:")
-        col.prop(scene.display_settings, "display_device")
-
-        col = layout.column()
-        col.separator()
-        col.label(text="Render:")
-        col.template_colormanaged_view_settings(scene, "view_settings")
-
-        col = layout.column()
-        col.separator()
-        col.label(text="Sequencer:")
-        col.prop(scene.sequencer_colorspace_settings, "name")
-
-
 class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
     _context_path = "scene"
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 6842b32..dd30627 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -30,7 +30,7 @@ from bpy.types import (Brush,
 
 from rna_prop_ui import PropertyPanel
 
-from bl_ui.properties_paint_common import sculpt_brush_texture_settings
+from bl_ui.properties_paint_common import brush_texture_settings
 
 
 class TEXTURE_MT_specials(Menu):
@@ -63,12 +63,12 @@ class TEXTURE_UL_texslots(UIList):
         slot = item
         tex = slot.texture if slot else None
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(tex.name if tex else "", icon_value=icon)
+            layout.label(text=tex.name if tex else "", translate=False, icon_value=icon)
             if tex and isinstance(item, bpy.types.MaterialTextureSlot):
                 layout.prop(ma, "use_textures", text="", index=index)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 from bl_ui.properties_material import active_node_mat
@@ -432,6 +432,12 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
+        if context.scene.render.engine == 'BLENDER_GAME':
+            self.draw_bge(context)
+        else:
+            self.draw_bi(context)
+
+    def draw_bi(self, context):
         layout = self.layout
 
         idblock = context_tex_datablock(context)
@@ -468,6 +474,33 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
 
         texture_filter_common(tex, col)
 
+    def draw_bge(self, context):
+        layout = self.layout
+
+        idblock = context_tex_datablock(context)
+        tex = context.texture
+        slot = getattr(context, "texture_slot", None)
+
+        split = layout.split()
+
+        col = split.column()
+        col.label(text="Alpha:")
+        col.prop(tex, "use_calculate_alpha", text="Calculate")
+        col.prop(tex, "invert_alpha", text="Invert")
+
+        col = split.column()
+
+        #Only for Material based textures, not for Lamp/World...
+        if slot and isinstance(idblock, Material):
+            col.prop(tex, "use_normal_map")
+            row = col.row()
+            row.active = tex.use_normal_map
+            row.prop(slot, "normal_map_space", text="")
+
+            row = col.row()
+            row.active = not tex.use_normal_map
+            row.prop(tex, "use_derivative_map")
+
 
 class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
     bl_label = "Image Mapping"
@@ -884,8 +917,8 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
                 split.prop(tex, "object", text="")
 
         if isinstance(idblock, Brush):
-            if context.sculpt_object:
-                sculpt_brush_texture_settings(layout, idblock)
+            if context.sculpt_object or context.image_paint_object:
+                brush_texture_settings(layout, idblock, context.sculpt_object)
         else:
             if isinstance(idblock, Material):
                 split = layout.split(percentage=0.3)
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index 5fc5713..e32db80 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -20,17 +20,23 @@
 
 import bpy
 from bpy.types import Panel, Header, Menu, UIList
+from bpy.app.translations import pgettext_iface as iface_
 
 
 class CLIP_UL_tracking_objects(UIList):
-    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+    def draw_item(self, context, layout, data, item, icon,
+                  active_data, active_propname, index):
         # assert(isinstance(item, bpy.types.MovieTrackingObject)
         tobj = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(tobj.name, icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
+            layout.label(text=tobj.name, translate=False,
+                         icon='CAMERA_DATA' if tobj.is_camera
+                         else 'OBJECT_DATA')
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
+            layout.label(text="",
+                         icon='CAMERA_DATA' if tobj.is_camera
+                         else 'OBJECT_DATA')
 
 
 class CLIP_HT_header(Header):
@@ -333,7 +339,8 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
 
         col = layout.column(align=True)
         col.active = not settings.use_tripod_solver
-        col.prop(settings, "use_fallback_reconstruction", text="Allow Fallback")
+        col.prop(settings, "use_fallback_reconstruction",
+                 text="Allow Fallback")
         sub = col.column()
         sub.active = settings.use_fallback_reconstruction
         sub.prop(settings, "reconstruction_success_threshold")
@@ -482,7 +489,8 @@ class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
         tracking = sc.clip.tracking
 
         row = layout.row()
-        row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects", tracking, "active_object_index", rows=3)
+        row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects",
+                          tracking, "active_object_index", rows=3)
 
         sub = row.column(align=True)
 
@@ -738,7 +746,8 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
         layout.active = stab.use_2d_stabilization
 
         row = layout.row()
-        row.template_list("UI_UL_list", "", stab, "tracks", stab, "active_track_index", rows=3)
+        row.template_list("UI_UL_list", "stabilization_tracks", stab, "tracks",
+                          stab, "active_track_index", rows=3)
 
         sub = row.column(align=True)
 
@@ -903,10 +912,11 @@ class CLIP_MT_view(Menu):
 
             ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
 
+            text = iface_("Zoom %d:%d")
             for a, b in ratios:
-                text = "Zoom %d:%d" % (a, b)
                 layout.operator("clip.view_zoom_ratio",
-                                text=text).ratio = a / b
+                                text=text % (a, b),
+                                translate=False).ratio = a / b
         else:
             if sc.view == 'GRAPH':
                 layout.operator_context = 'INVOKE_REGION_PREVIEW'
diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py
index 23d16c1..70e0fb4 100644
--- a/release/scripts/startup/bl_ui/space_console.py
+++ b/release/scripts/startup/bl_ui/space_console.py
@@ -80,7 +80,9 @@ class CONSOLE_MT_language(Menu):
         languages.sort()
 
         for language in languages:
-            layout.operator("console.language", text=language[0].upper() + language[1:]).language = language
+            layout.operator("console.language",
+                            text=language.title(),
+                            translate=False).language = language
 
 
 def add_scrollback(text, text_type):
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 5535070..094fa4a 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -275,8 +275,8 @@ class DOPESHEET_MT_key(Menu):
         layout.operator("action.keyframe_insert")
 
         layout.separator()
-        layout.operator("action.frame_jump")        
-        
+        layout.operator("action.frame_jump")
+
         layout.separator()
         layout.operator("action.duplicate_move")
         layout.operator("action.delete")
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 1ea20d9..01b6766 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -19,7 +19,8 @@
 # <pep8 compliant>
 import bpy
 from bpy.types import Header, Menu, Panel
-from bl_ui.properties_paint_common import UnifiedPaintPanel
+from bl_ui.properties_paint_common import UnifiedPaintPanel, brush_texture_settings
+from bpy.app.translations import pgettext_iface as iface_
 
 
 class ImagePaintPanel(UnifiedPaintPanel):
@@ -71,7 +72,7 @@ class IMAGE_MT_view(Menu):
         ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
 
         for a, b in ratios:
-            layout.operator("image.view_zoom_ratio", text="Zoom" + " %d:%d" % (a, b)).ratio = a / b
+            layout.operator("image.view_zoom_ratio", text=iface_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
 
         layout.separator()
 
@@ -146,9 +147,7 @@ class IMAGE_MT_image(Menu):
             if not show_render:
                 layout.separator()
 
-                if ima.packed_file:
-                    layout.operator("image.unpack")
-                else:
+                if not ima.packed_file:
                     layout.operator("image.pack")
 
                 # only for dirty && specific image types, perhaps
@@ -722,7 +721,8 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
 
         col = layout.column()
         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
-        col.prop(brush, "use_fixed_texture")
+        
+        brush_texture_settings(col, brush, 0)
 
 
 class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 8df117e..51c975c 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -65,7 +65,7 @@ class INFO_HT_header(Header):
 
         row = layout.row(align=True)
         row.operator("wm.splash", text="", icon='BLENDER', emboss=False)
-        row.label(text=scene.statistics())
+        row.label(text=scene.statistics(), translate=False)
 
         # XXX: BEFORE RELEASE, MOVE FILE MENU OUT OF INFO!!!
         """
@@ -112,7 +112,7 @@ class INFO_MT_file(Menu):
 
         layout.separator()
 
-        layout.operator_context = 'EXEC_AREA' if  context.blend_data.is_saved else 'INVOKE_AREA'
+        layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
         layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
 
         layout.operator_context = 'INVOKE_AREA'
@@ -124,8 +124,9 @@ class INFO_MT_file(Menu):
 
         layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
 
-        layout.operator_context = 'EXEC_AREA'
+        layout.operator_context = 'INVOKE_AREA'
         layout.operator("wm.save_homefile", icon='SAVE_PREFS')
+        layout.operator_context = 'EXEC_AREA'
         layout.operator("wm.read_factory_settings", icon='LOAD_FACTORY')
 
         layout.separator()
@@ -361,6 +362,12 @@ class INFO_MT_window(Menu):
 
         layout.operator("wm.window_duplicate")
         layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
+
+        layout.separator()
+
+        layout.operator("screen.screenshot").full = True
+        layout.operator("screen.screencast").full = True
+
         if sys.platform[:3] == "win":
             layout.separator()
             layout.operator("wm.console_toggle", icon='CONSOLE')
@@ -373,7 +380,7 @@ class INFO_MT_help(Menu):
         layout = self.layout
 
         layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://wiki.blender.org/index.php/Doc:2.6/Manual"
-        layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://www.blender.org/development/release-logs/blender-265"
+        layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://www.blender.org/development/release-logs/blender-266"
         layout.separator()
 
         layout.operator("wm.url_open", text="Blender Website", icon='URL').url = "http://www.blender.org"
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index c46b1c2..104c150 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -252,6 +252,7 @@ class NODE_PT_quality(bpy.types.Panel):
 
         col = layout.column()
         col.prop(tree, "use_opencl")
+        col.prop(tree, "use_groupnode_buffer")
         col.prop(tree, "two_pass")
         col.prop(snode, "show_highlight")
         col.prop(snode, "use_hidden_preview")
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 64ad565..7841acf 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 from bpy.types import Header, Menu, Panel
+from bpy.app.translations import pgettext_iface as iface_
 
 
 def act_strip(context):
@@ -422,13 +423,15 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
 
         col = layout.column(align=True)
         row = col.row()
-        row.label(text="Final Length" + ": %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration))
+        row.label(text=iface_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
+                  translate=False)
         row = col.row()
         row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
-        row.label(text="Playhead" + ": %d" % (frame_current - strip.frame_start))
+        row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
 
-        col.label(text="Frame Offset" + " %d:%d" % (strip.frame_offset_start, strip.frame_offset_end))
-        col.label(text="Frame Still" + " %d:%d" % (strip.frame_still_start, strip.frame_still_end))
+        col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
+                  translate=False)
+        col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
 
         elem = False
 
@@ -438,7 +441,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
             elem = strip.elements[0]
 
         if elem and elem.orig_width > 0 and elem.orig_height > 0:
-            col.label(text="Original Dimension" + ": %dx%d" % (elem.orig_width, elem.orig_height))
+            col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
         else:
             col.label(text="Original Dimension: None")
 
@@ -715,7 +718,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
         if scene:
             sta = scene.frame_start
             end = scene.frame_end
-            layout.label(text="Original frame range" + ": %d-%d (%d)" % (sta, end, end - sta + 1))
+            layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
 
 
 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
@@ -744,7 +747,7 @@ class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
         if mask:
             sta = mask.frame_start
             end = mask.frame_end
-            layout.label(text="Original frame range" + ": %d-%d (%d)" % (sta, end, end - sta + 1))
+            layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
 
 
 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index 960a945..4264fc9 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -19,6 +19,7 @@
 # <pep8-80 compliant>
 import bpy
 from bpy.types import Header, Menu, Panel
+from bpy.app.translations import pgettext_iface as iface_
 
 
 class TEXT_HT_header(Header):
@@ -72,11 +73,11 @@ class TEXT_HT_header(Header):
             row = layout.row()
             if text.filepath:
                 if text.is_dirty:
-                    row.label(text="File" + ": *%r " %
-                              text.filepath + "(unsaved)")
+                    row.label(text=iface_("File: *%r (unsaved)") %
+                              text.filepath, translate=False)
                 else:
-                    row.label(text="File" + ": %r" %
-                              text.filepath)
+                    row.label(text=iface_("File: %r") %
+                              text.filepath, translate=False)
             else:
                 row.label(text="Text: External"
                           if text.library
@@ -152,7 +153,7 @@ class TEXT_MT_view(Menu):
         layout = self.layout
 
         layout.operator("text.properties", icon='MENU_PANEL')
-        
+
         layout.separator()
 
         layout.operator("text.move",
diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index cb9e244..6af9f37 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -152,6 +152,7 @@ class TIME_MT_cache(Menu):
         col.prop(st, "cache_cloth")
         col.prop(st, "cache_smoke")
         col.prop(st, "cache_dynamicpaint")
+        col.prop(st, "cache_rigidbody")
 
 
 class TIME_MT_frame(Menu):
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index a9712b1..017f75b 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -19,30 +19,30 @@
 # <pep8 compliant>
 import bpy
 from bpy.types import Header, Menu, Panel
-import os
+from bpy.app.translations import pgettext_iface as iface_
 
 
 def ui_style_items(col, context):
     """ UI Style settings """
-    
+
     split = col.split()
-    
+
     col = split.column()
     col.label(text="Kerning Style:")
     col.row().prop(context, "font_kerning_style", expand=True)
     col.prop(context, "points")
-    
+
     col = split.column()
     col.label(text="Shadow Offset:")
     col.prop(context, "shadow_offset_x", text="X")
     col.prop(context, "shadow_offset_y", text="Y")
-    
+
     col = split.column()
     col.prop(context, "shadow")
     col.prop(context, "shadowalpha")
     col.prop(context, "shadowcolor")
 
-    
+
 def ui_items_general(col, context):
     """ General UI Theme Settings (User Interface)
     """
@@ -183,6 +183,7 @@ class USERPREF_PT_interface(Panel):
         return (userpref.active_section == 'INTERFACE')
 
     def draw(self, context):
+        import sys
         layout = self.layout
 
         userpref = context.user_preferences
@@ -200,7 +201,7 @@ class USERPREF_PT_interface(Panel):
         col.prop(view, "show_playback_fps", text="Playback FPS")
         col.prop(view, "use_global_scene")
         col.prop(view, "object_origin_size")
- 
+
         col.separator()
         col.separator()
         col.separator()
@@ -268,7 +269,7 @@ class USERPREF_PT_interface(Panel):
 
         col.prop(view, "show_splash")
 
-        if os.name == "nt":
+        if sys.platform[:3] == "win":
             col.prop(view, "use_quit_dialog")
 
 
@@ -403,6 +404,7 @@ class USERPREF_PT_system(Panel):
         return (userpref.active_section == 'SYSTEM')
 
     def draw(self, context):
+        import sys
         layout = self.layout
 
         userpref = context.user_preferences
@@ -466,6 +468,9 @@ class USERPREF_PT_system(Panel):
         col.label(text="Window Draw Method:")
         col.prop(system, "window_draw_method", text="")
         col.prop(system, "multi_sample", text="")
+        if sys.platform == "linux" and system.multi_sample != 'NONE':
+            col.label(text="Might fail for Mesh editing selection!")
+            col.separator()
         col.prop(system, "use_region_overlap")
         col.label(text="Text Draw Options:")
         col.prop(system, "use_text_antialiasing")
@@ -763,20 +768,20 @@ class USERPREF_PT_theme(Panel):
             colsub.row().prop(ui, "axis_x")
             colsub.row().prop(ui, "axis_y")
             colsub.row().prop(ui, "axis_z")
-            
+
             subsplit = row.split(percentage=0.85)
 
             padding = subsplit.split(percentage=0.15)
             colsub = padding.column()
             colsub = padding.column()
-            
+
             layout.separator()
             layout.separator()
         elif theme.theme_area == 'BONE_COLOR_SETS':
             col = split.column()
 
             for i, ui in enumerate(theme.bone_color_sets):
-                col.label(text="Color Set" + " %d:" % (i + 1))  # i starts from 0
+                col.label(text=iface_("Color Set %d:") % (i + 1), translate=False)  # i starts from 0
 
                 row = col.row()
 
@@ -797,16 +802,23 @@ class USERPREF_PT_theme(Panel):
                 colsub.row().prop(ui, "show_colored_constraints")
         elif theme.theme_area == 'STYLE':
             col = split.column()
-            
+
             style = context.user_preferences.ui_styles[0]
-            
+
+            ui = style.panel_title
+            col.label(text="Panel Title:")
+            ui_style_items(col, ui)
+
+            col.separator()
+            col.separator()
+
             ui = style.widget
             col.label(text="Widget:")
             ui_style_items(col, ui)
-            
+
             col.separator()
             col.separator()
-            
+
             ui = style.widget_label
             col.label(text="Widget Label:")
             ui_style_items(col, ui)
@@ -956,6 +968,8 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
         return (userpref.active_section == 'INPUT')
 
     def draw_input_prefs(self, inputs, layout):
+        import sys
+
         # General settings
         row = layout.row()
         col = row.column()
@@ -1008,6 +1022,11 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
         sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
         #sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
 
+        if sys.platform == "darwin":
+            sub = col.column()
+            sub.label(text="Trackpad:")
+            sub.prop(inputs, "use_trackpad_natural")
+
         col.separator()
         sub = col.column()
         sub.label(text="NDOF Device:")
@@ -1070,6 +1089,8 @@ class USERPREF_PT_addons(Panel):
 
     @staticmethod
     def is_user_addon(mod, user_addon_paths):
+        import os
+
         if not user_addon_paths:
             for path in (bpy.utils.script_path_user(),
                          bpy.utils.script_path_pref()):
@@ -1092,6 +1113,7 @@ class USERPREF_PT_addons(Panel):
             box.label(l)
 
     def draw(self, context):
+        import os
         import addon_utils
 
         layout = self.layout
@@ -1100,8 +1122,8 @@ class USERPREF_PT_addons(Panel):
         used_ext = {ext.module for ext in userpref.addons}
 
         userpref_addons_folder = os.path.join(userpref.filepaths.script_directory, "addons")
-        scripts_addons_folder  = bpy.utils.user_resource('SCRIPTS', "addons")
-        
+        scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons")
+
         # collect the categories that can be filtered on
         addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(addon_utils.addons_fake_modules)]
 
@@ -1152,7 +1174,7 @@ class USERPREF_PT_addons(Panel):
                     (filter == "Enabled" and is_enabled) or
                     (filter == "Disabled" and not is_enabled) or
                     (filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder))))
-                   ):
+                    ):
 
                 if search and search not in info["name"].lower():
                     if info["author"]:
@@ -1196,15 +1218,15 @@ class USERPREF_PT_addons(Panel):
                     if mod:
                         split = colsub.row().split(percentage=0.15)
                         split.label(text="File:")
-                        split.label(text=mod.__file__)
+                        split.label(text=mod.__file__, translate=False)
                     if info["author"]:
                         split = colsub.row().split(percentage=0.15)
                         split.label(text="Author:")
-                        split.label(text=info["author"])
+                        split.label(text=info["author"], translate=False)
                     if info["version"]:
                         split = colsub.row().split(percentage=0.15)
                         split.label(text="Version:")
-                        split.label(text='.'.join(str(x) for x in info["version"]))
+                        split.label(text='.'.join(str(x) for x in info["version"]), translate=False)
                     if info["warning"]:
                         split = colsub.row().split(percentage=0.15)
                         split.label(text="Warning:")
@@ -1244,7 +1266,6 @@ class USERPREF_PT_addons(Panel):
                                     box_prefs.label(text="Error (see console)", icon='ERROR')
                                 del addon_preferences_class.layout
 
-
         # Append missing scripts
         # First collect scripts that are used but have no script file.
         module_names = {mod.__name__ for mod, info in addons}
@@ -1262,7 +1283,7 @@ class USERPREF_PT_addons(Panel):
                 colsub = box.column()
                 row = colsub.row()
 
-                row.label(text=module_name, icon='ERROR')
+                row.label(text=module_name, translate=False, icon='ERROR')
 
                 if is_enabled:
                     row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name
diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py
index 81d67aa..e9eb2aa 100644
--- a/release/scripts/startup/bl_ui/space_userpref_keymap.py
+++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 from bpy.types import Menu
+from bpy.app.translations import pgettext_iface as iface_
 
 
 class USERPREF_MT_keyconfigs(Menu):
@@ -97,7 +98,7 @@ class InputKeyMapPanel:
                 subcol = self.indented_layout(col, level + 1)
                 subrow = subcol.row()
                 subrow.prop(km, "show_expanded_items", text="", emboss=False)
-                subrow.label(text="%s " % km.name + "(Global)")
+                subrow.label(text=iface_("%s (Global)") % km.name, translate=False)
             else:
                 km.show_expanded_items = True
 
@@ -172,17 +173,17 @@ class InputKeyMapPanel:
         if kmi.show_expanded:
             box = col.box()
 
-            if map_type not in {'TEXTINPUT', 'TIMER'}:
-                split = box.split(percentage=0.4)
-                sub = split.row()
+            split = box.split(percentage=0.4)
+            sub = split.row()
 
-                if km.is_modal:
-                    sub.prop(kmi, "propvalue", text="")
-                else:
-                    # One day...
-                    #~ sub.prop_search(kmi, "idname", bpy.context.window_manager, "operators_all", text="")
-                    sub.prop(kmi, "idname", text="")
+            if km.is_modal:
+                sub.prop(kmi, "propvalue", text="")
+            else:
+                # One day...
+                #~ sub.prop_search(kmi, "idname", bpy.context.window_manager, "operators_all", text="")
+                sub.prop(kmi, "idname", text="")
 
+            if map_type not in {'TEXTINPUT', 'TIMER'}:
                 sub = split.column()
                 subrow = sub.row(align=True)
 
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 8189ee2..fcc2024 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1066,12 +1066,14 @@ class VIEW3D_MT_make_links(Menu):
 
     def draw(self, context):
         layout = self.layout
-
+        operator_context_default = layout.operator_context
         if(len(bpy.data.scenes) > 10):
-            layout.operator_context = 'INVOKE_DEFAULT'
+            layout.operator_context = 'INVOKE_REGION_WIN'
             layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
         else:
+            layout.operator_context = 'EXEC_REGION_WIN'
             layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
+        layout.operator_context = operator_context_default
 
         layout.operator_enum("object.make_links_data", "type")  # inline
 
@@ -1537,7 +1539,7 @@ class VIEW3D_MT_pose_group(Menu):
 
     def draw(self, context):
         layout = self.layout
-        
+
         pose = context.active_object.pose
 
         layout.operator_context = 'EXEC_AREA'
@@ -1680,7 +1682,6 @@ class VIEW3D_MT_edit_mesh(Menu):
         layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
         layout.operator("mesh.duplicate_move")
         layout.menu("VIEW3D_MT_edit_mesh_delete")
-        layout.menu("VIEW3D_MT_edit_mesh_dissolve")
 
         layout.separator()
 
@@ -1710,19 +1711,37 @@ class VIEW3D_MT_edit_mesh_specials(Menu):
 
         layout.operator("mesh.subdivide", text="Subdivide").smoothness = 0.0
         layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
+
+        layout.separator()
+
         layout.operator("mesh.merge", text="Merge...")
         layout.operator("mesh.remove_doubles")
+
+        layout.separator()
+
         layout.operator("mesh.hide", text="Hide").unselected = False
         layout.operator("mesh.reveal", text="Reveal")
         layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT'
+
+        layout.separator()
+
         layout.operator("mesh.flip_normals")
         layout.operator("mesh.vertices_smooth", text="Smooth")
         layout.operator("mesh.vertices_smooth_laplacian", text="Laplacian Smooth")
+
+        layout.separator()
+
         layout.operator("mesh.inset")
         layout.operator("mesh.bevel", text="Bevel")
         layout.operator("mesh.bridge_edge_loops")
+
+        layout.separator()
+
         layout.operator("mesh.faces_shade_smooth")
         layout.operator("mesh.faces_shade_flat")
+
+        layout.separator()
+
         layout.operator("mesh.blend_from_shape")
         layout.operator("mesh.shape_propagate_to_all")
         layout.operator("mesh.select_vertex_path")
@@ -1789,10 +1808,11 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
         layout.operator("mesh.split")
         layout.operator_menu_enum("mesh.separate", "type")
         layout.operator("mesh.vert_connect")
-        layout.operator("mesh.vert_slide")
+        layout.operator("transform.vert_slide")
 
         layout.separator()
 
+        layout.operator("mesh.bevel").vertex_only = True
         layout.operator("mesh.vertices_smooth")
         layout.operator("mesh.remove_doubles")
         layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
@@ -1924,21 +1944,12 @@ class VIEW3D_MT_edit_mesh_delete(Menu):
         layout.separator()
 
         layout.operator("mesh.dissolve")
-        layout.operator("mesh.edge_collapse")
-        layout.operator("mesh.delete_edgeloop", text="Edge Loop")
-
-
-class VIEW3D_MT_edit_mesh_dissolve(Menu):
-    bl_label = "Dissolve"
-
-    def draw(self, context):
-        layout = self.layout
-
-        layout.operator("mesh.dissolve")
+        layout.operator("mesh.dissolve_limited")
 
         layout.separator()
 
-        layout.operator("mesh.dissolve_limited")
+        layout.operator("mesh.edge_collapse")
+        layout.operator("mesh.delete_edgeloop", text="Edge Loop")
 
 
 class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu):
@@ -2382,9 +2393,6 @@ class VIEW3D_PT_view3d_display(Panel):
         col.prop(view, "show_outline_selected")
         col.prop(view, "show_all_objects_origin")
         col.prop(view, "show_relationship_lines")
-        if ob and ob.type == 'MESH':
-            mesh = ob.data
-            col.prop(mesh, "show_all_edges")
 
         col = layout.column()
         col.active = display_all
@@ -2409,7 +2417,10 @@ class VIEW3D_PT_view3d_display(Panel):
             col.label(text="Shading:")
             col.prop(gs, "material_mode", text="")
             col.prop(view, "show_textured_solid")
-
+        if view.viewport_shade == 'SOLID':
+            col.prop(view, "use_matcap")
+            if view.use_matcap:
+                col.template_icon_view(view, "matcap_icon")
         col.prop(view, "show_backface_culling")
 
         layout.separator()
@@ -2666,6 +2677,8 @@ class VIEW3D_PT_etch_a_ton(Panel):
         col.prop(toolsettings, "use_etch_quick")
         col.prop(toolsettings, "use_etch_overdraw")
 
+        col.separator()
+
         col.prop(toolsettings, "etch_convert_mode")
 
         if toolsettings.etch_convert_mode == 'LENGTH':
@@ -2677,11 +2690,20 @@ class VIEW3D_PT_etch_a_ton(Panel):
         elif toolsettings.etch_convert_mode == 'RETARGET':
             col.prop(toolsettings, "etch_template")
             col.prop(toolsettings, "etch_roll_mode")
-            col.prop(toolsettings, "use_etch_autoname")
-            col.prop(toolsettings, "etch_number")
-            col.prop(toolsettings, "etch_side")
 
-        col.operator("sketch.convert", text="Convert")
+            col.separator()
+
+            colsub = col.column(align=True)
+            colsub.prop(toolsettings, "use_etch_autoname")
+            sub = colsub.column()
+            sub.enabled = not toolsettings.use_etch_autoname
+            sub.prop(toolsettings, "etch_number")
+            sub.prop(toolsettings, "etch_side")
+
+        col.separator()
+
+        col.operator("sketch.convert", text="Convert to Bones")
+        col.operator("sketch.delete", text="Delete Strokes")
 
 
 class VIEW3D_PT_context_properties(Panel):
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 3c56ff8..d649206 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -20,7 +20,7 @@
 import bpy
 from bpy.types import Menu, Panel
 from bl_ui.properties_paint_common import UnifiedPaintPanel
-from bl_ui.properties_paint_common import sculpt_brush_texture_settings
+from bl_ui.properties_paint_common import brush_texture_settings
 
 
 class View3DPanel():
@@ -108,6 +108,33 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
         draw_repeat_tools(context, layout)
 
         draw_gpencil_tools(context, layout)
+        col = layout.column(align=True)
+
+
+class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel):
+    bl_context = "objectmode"
+    bl_label = "Rigid Body Tools"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        col = layout.column(align=True)
+        col.label(text="Add/Remove:")
+        row = col.row()
+        row.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE'
+        row.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE'
+        row = col.row()
+        row.operator("rigidbody.objects_remove", text="Remove")
+
+        col = layout.column(align=True)
+        col.label(text="Object Tools:")
+        col.operator("rigidbody.shape_change", text="Change Shape")
+        col.operator("rigidbody.mass_calculate", text="Calculate Mass")
+        col.operator("rigidbody.object_settings_copy", text="Copy from Active")
+        col.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes")
+        col.label(text="Constraints:")
+        col.operator("rigidbody.connect", text="Connect")
 
 # ********** default tools for editmode_mesh ****************
 
@@ -720,12 +747,10 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
         col = layout.column()
 
         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
-        if brush.use_paint_image:
-            col.prop(brush, "use_fixed_texture")
 
-        if context.sculpt_object:
-            sculpt_brush_texture_settings(col, brush)
+        brush_texture_settings(col, brush, context.sculpt_object)
 
+        if context.sculpt_object:
             # use_texture_overlay and texture_overlay_alpha
             col = layout.column(align=True)
             col.active = brush.sculpt_capabilities.has_overlay
@@ -1117,14 +1142,14 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
         row = split.row()
         row.active = (ipaint.use_stencil_layer)
         stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
-        row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text)
+        row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
         row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
 
         col = layout.column()
         col.active = (settings.brush.image_tool == 'CLONE')
         col.prop(ipaint, "use_clone_layer", text="Clone from UV map")
         clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else ""
-        col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text)
+        col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
 
         layout.prop(ipaint, "seam_bleed")
 
@@ -1163,7 +1188,7 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu):
         layout = self.layout
 
         for i, tex in enumerate(context.active_object.data.uv_textures):
-            props = layout.operator("wm.context_set_int", text=tex.name)
+            props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
             props.data_path = "active_object.data.uv_texture_clone_index"
             props.value = i
 
@@ -1174,7 +1199,7 @@ class VIEW3D_MT_tools_projectpaint_stencil(Menu):
     def draw(self, context):
         layout = self.layout
         for i, tex in enumerate(context.active_object.data.uv_textures):
-            props = layout.operator("wm.context_set_int", text=tex.name)
+            props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
             props.data_path = "active_object.data.uv_texture_stencil_index"
             props.value = i
 
@@ -1197,7 +1222,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
         if pe.type == 'PARTICLES':
             if ob.particle_systems:
                 if len(ob.particle_systems) > 1:
-                    layout.template_list("UI_UL_list", "", ob, "particle_systems",
+                    layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
                                          ob.particle_systems, "active_index", rows=2, maxrows=3)
 
                 ptcache = ob.particle_systems.active.point_cache
@@ -1207,8 +1232,8 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
                     ptcache = md.point_cache
 
         if ptcache and len(ptcache.point_caches) > 1:
-            layout.template_list("UI_UL_list", "", ptcache, "point_caches", ptcache.point_caches, "active_index",
-                                 rows=2, maxrows=3)
+            layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
+                                 ptcache.point_caches, "active_index", rows=2, maxrows=3)
 
         if not pe.is_editable:
             layout.label(text="Point cache must be baked")
diff --git a/release/scripts/templates_py/ui_list.py b/release/scripts/templates_py/ui_list.py
index 18861f7..f71b342 100644
--- a/release/scripts/templates_py/ui_list.py
+++ b/release/scripts/templates_py/ui_list.py
@@ -20,7 +20,8 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
             # You should always start your row layout by a label (icon + text), this will also make the row easily
             # selectable in the list!
             # We use icon_value of label, as our given icon is an integer value, not an enum ID.
-            layout.label(ma.name if ma else "", icon_value=icon)
+            # Note "data" names should never be translated!
+            layout.label(text=ma.name if ma else "", translate=False, icon_value=icon)
             # And now we can add other UI stuff...
             # Here, we add nodes info if this material uses (old!) shading nodes.
             if ma and not context.scene.render.use_shading_nodes:
@@ -28,15 +29,15 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
                 if manode:
                     # The static method UILayout.icon returns the integer value of the icon ID "computed" for the given
                     # RNA object.
-                    layout.label("Node %s" % manode.name, icon_value=layout.icon(manode))
+                    layout.label(text="Node %s" % manode.name, translate=False, icon_value=layout.icon(manode))
                 elif ma.use_nodes:
-                    layout.label("Node <none>")
+                    layout.label(text="Node <none>", translate=False)
                 else:
-                    layout.label("")
+                    layout.label(text="")
         # 'GRID' layout type should be as compact as possible (typically a single icon!).
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 # And now we can use this list everywhere in Blender. Here is a small example panel.
diff --git a/release/text/readme.html b/release/text/readme.html
index 414a7d8..54d112c 100644
--- a/release/text/readme.html
+++ b/release/text/readme.html
@@ -12,18 +12,18 @@
   </style>
 </head>
 <body>
-<p class="title"><b>Blender 2.65</b></p>
+<p class="title"><b>Blender 2.66</b></p>
 <p><br></p>
 <p class="header"><b>About</b></p>
 <p class="body">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 and FreeBSD and has a large world-wide community.</p>
 <p class="body">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.</p>
 <p class="body">For more information, visit <a href="http://www.blender.org">blender.org</a>.</p>
 <p><br></p>
-<p class="header"><b>2.65</b></p>
-<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.65. This release is the sixth official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features. <a href="http://www.blender.org/development/release-logs/blender-265/">More information about this release</a>.</p>
+<p class="header"><b>2.66</b></p>
+<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.66. This release is the seventh official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features. <a href="http://www.blender.org/development/release-logs/blender-266/">More information about this release</a>.</p>
 <p><br></p>
 <p class="header"><b>Bugs</b></p>
-<p class="body">Although Blender 2.65 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. 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.</p>
+<p class="body">Although Blender 2.66 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. 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.</p>
 <p><br></p>
 <p class="header"><b>Package Contents</b></p>
 <p class="body">The downloaded Blender package includes:</p>
@@ -47,7 +47,7 @@
 <p class="header"><b>Links</b></p>
 <p class="body">Users:</p>
 <p class="body">	General information		<a href="http://www.blender.org">www.blender.org</a> <br>
-	Full release log 			<a href="http://www.blender.org/development/release-logs/blender-265/">www.blender.org/development/release-logs/blender-265/</a><br>
+	Full release log 			<a href="http://www.blender.org/development/release-logs/blender-266/">www.blender.org/development/release-logs/blender-266/</a><br>
 	Tutorials 			<a href="http://www.blender.org/education-help/">www.blender.org/education-help/</a>	<br>
 	Manual 			<a href="http://wiki.blender.org/index.php/Doc:2.6/Manual">wiki.blender.org/index.php/Doc:2.6/Manual</a><br>
 	User Forum 			<a href="http://www.blenderartists.org">www.blenderartists.org</a><br>
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index ae3f3dc..50e1318 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -66,6 +66,7 @@ set(SRC_DNA_INC
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_packedFile_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_particle_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_property_types.h
+	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_rigidbody_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_scene_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_screen_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_sdna_types.h
@@ -107,7 +108,6 @@ add_subdirectory(makesdna)
 add_subdirectory(makesrna)
 
 if(WITH_COMPOSITOR)
-	add_subdirectory(opencl)  # later on this may be used more generally
 	add_subdirectory(compositor)
 endif()
 
diff --git a/source/blender/SConscript b/source/blender/SConscript
index bf52f2e..8a4e2a3 100644
--- a/source/blender/SConscript
+++ b/source/blender/SConscript
@@ -65,5 +65,4 @@ if env['WITH_BF_COLLADA']:
     SConscript (['collada/SConscript'])
     
 if env['WITH_BF_COMPOSITOR']:
-    SConscript (['compositor/SConscript',
-                 'opencl/SConscript'])
+    SConscript (['compositor/SConscript'])
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index d6301b7..fcc9526 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -950,7 +950,6 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
 {
 	AviList list;
 	AviChunk chunk;
-	AviIndexEntry *temp;
 	va_list ap;
 	int stream;
 	int64_t rec_off;
@@ -965,15 +964,7 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
 
 	if (frame_num + 1 > movie->index_entries) {
 		const size_t entry_size = (movie->header->Streams + 1) * sizeof(AviIndexEntry);
-
-		if (movie->entries != NULL) {
-			temp = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
-		}
-		else {
-			temp = (AviIndexEntry *) MEM_callocN((frame_num + 1) * entry_size, "newidxentry");
-		}
-
-		movie->entries = temp;
+		movie->entries = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
 		movie->index_entries = frame_num + 1;
 	}
 
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 25b55ea..0ca9797 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -183,6 +183,7 @@ void BLF_dir_free(char **dirs, int count);
 #define BLF_KERNING_DEFAULT  (1 << 3)
 #define BLF_MATRIX           (1 << 4)
 #define BLF_ASPECT           (1 << 5)
+#define BLF_HINTING          (1 << 6)
 
 #define BLF_DRAW_STR_DUMMY_MAX 1024
 
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index 0832907..cbfc7c2 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -33,6 +33,8 @@
 #ifndef __BLF_TRANSLATION_H__
 #define __BLF_TRANSLATION_H__
 
+#include "BLI_utildefines.h"  /* for bool type */
+
 #define TEXT_DOMAIN_NAME "blender"
 
 /* blf_lang.c */
@@ -48,24 +50,30 @@ void BLF_lang_free(void);
 
 /* Set the current locale. */
 void BLF_lang_set(const char *);
-/* Get the current locale (short code, e.g. es_ES). */
+/* Get the current locale ([partial] ISO code, e.g. es_ES). */
 const char *BLF_lang_get(void);
 
+/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. if there is no variant,
+ * *variant and *language_variant will always be NULL).
+ * Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them.
+ * NOTE: Always available, even in non-WITH_INTERNATIONAL builds.
+ */
+void BLF_locale_explode(const char *locale, char **language, char **country, char **variant,
+                        char **language_country, char **language_variant);
+
 /* Get EnumPropertyItem's for translations menu. */
 struct EnumPropertyItem *BLF_RNA_lang_enum_properties(void);
 
 /* blf_translation.c  */
 
-#ifdef WITH_INTERNATIONAL
 unsigned char *BLF_get_unifont(int *unifont_size);
 void BLF_free_unifont(void);
-#endif
 
 const char *BLF_pgettext(const char *msgctxt, const char *msgid);
 
 /* translation */
-int BLF_translate_iface(void);
-int BLF_translate_tooltips(void);
+bool BLF_translate_iface(void);
+bool BLF_translate_tooltips(void);
 const char *BLF_translate_do_iface(const char *msgctxt, const char *msgid);
 const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
 
@@ -76,17 +84,17 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
 
 /* Those macros should be used everywhere in UI code. */
 #ifdef WITH_INTERNATIONAL
-/*	#define _(msgid) BLF_gettext(msgid) */
-	#define IFACE_(msgid) BLF_translate_do_iface(NULL, msgid)
-	#define TIP_(msgid) BLF_translate_do_tooltip(NULL, msgid)
-	#define CTX_IFACE_(context, msgid) BLF_translate_do_iface(context, msgid)
-	#define CTX_TIP_(context, msgid) BLF_translate_do_tooltip(context, msgid)
+/*#  define _(msgid) BLF_gettext(msgid) */
+#  define IFACE_(msgid) BLF_translate_do_iface(NULL, msgid)
+#  define TIP_(msgid) BLF_translate_do_tooltip(NULL, msgid)
+#  define CTX_IFACE_(context, msgid) BLF_translate_do_iface(context, msgid)
+#  define CTX_TIP_(context, msgid) BLF_translate_do_tooltip(context, msgid)
 #else
-/*	#define _(msgid) msgid */
-	#define IFACE_(msgid) msgid
-	#define TIP_(msgid) msgid
-	#define CTX_IFACE_(context, msgid) msgid
-	#define CTX_TIP_(context, msgid)   msgid
+/*#  define _(msgid) msgid */
+#  define IFACE_(msgid) msgid
+#  define TIP_(msgid)   msgid
+#  define CTX_IFACE_(context, msgid) msgid
+#  define CTX_TIP_(context, msgid)   msgid
 #endif
 
 /* Helper macro, when we want to define a same msgid for multiple msgctxt...
@@ -102,8 +110,15 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
  * things, and limit the number of existing contexts!
  */
 
-/* Default, void context. Just in case... */
-#define BLF_I18NCONTEXT_DEFAULT ""
+/* Default, void context.
+ * WARNING! The "" context is not the same as no (NULL) context at mo/boost::locale level!
+ * NOTE: We translate BLF_I18NCONTEXT_DEFAULT as BLF_I18NCONTEXT_DEFAULT_BPY in Python, as we can't use "natural"
+ *       None value in rna string properties... :/
+ *       For perf reason, we only use the first char to detect this context, so other contexts should never start
+ *       with the same char!
+ */
+#define BLF_I18NCONTEXT_DEFAULT NULL
+#define BLF_I18NCONTEXT_DEFAULT_BPY "*"
 
 /* Default context for operator names/labels. */
 #define BLF_I18NCONTEXT_OPERATOR_DEFAULT "Operator"
@@ -143,4 +158,53 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
 #define BLF_I18NCONTEXT_ID_MOVIECLIP            "MovieClip"
 #define BLF_I18NCONTEXT_ID_MASK                 "Mask"
 
+/* Helper for bpy.app.i18n object... */
+typedef struct
+{
+	const char *c_id;
+	const char *py_id;
+	const char *value;
+} BLF_i18n_contexts_descriptor;
+
+#define BLF_I18NCONTEXTS_ITEM(ctxt_id, py_id) {#ctxt_id, py_id, ctxt_id}
+
+#define BLF_I18NCONTEXTS_DESC {                                                                                        \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT, "default_real"),                                                    \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT_BPY, "default"),                                                     \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "operator_default"),                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_ACTION, "id_action"),                                                     \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_ARMATURE, "id_armature"),                                                 \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_BRUSH, "id_brush"),                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_CAMERA, "id_camera"),                                                     \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_CURVE, "id_curve"),                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_GPENCIL, "id_gpencil"),                                                   \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_GROUP, "id_group"),                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_ID, "id_id"),                                                             \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_IMAGE, "id_image"),                                                       \
+	/*BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_IPO, "id_ipo"),*/                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SHAPEKEY, "id_shapekey"),                                                 \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LAMP, "id_lamp"),                                                         \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LIBRARY, "id_library"),                                                   \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LATTICE, "id_lattice"),                                                   \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MATERIAL, "id_material"),                                                 \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_METABALL, "id_metaball"),                                                 \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MESH, "id_mesh"),                                                         \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_NODETREE, "id_nodetree"),                                                 \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_OBJECT, "id_object"),                                                     \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_PARTICLESETTINGS, "id_particlesettings"),                                 \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SCENE, "id_scene"),                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SCREEN, "id_screen"),                                                     \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SEQUENCE, "id_sequence"),                                                 \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SPEAKER, "id_speaker"),                                                   \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SOUND, "id_sound"),                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_TEXTURE, "id_texture"),                                                   \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_TEXT, "id_text"),                                                         \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_VFONT, "id_vfont"),                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_WORLD, "id_world"),                                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_WINDOWMANAGER, "id_windowmanager"),                                       \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MOVIECLIP, "id_movieclip"),                                               \
+	BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MASK, "id_mask"),                                                         \
+	{NULL, NULL, NULL}                                                                                                 \
+}
+
 #endif /* __BLF_TRANSLATION_H__ */
diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt
index 90baef1..7bb80c3 100644
--- a/source/blender/blenfont/CMakeLists.txt
+++ b/source/blender/blenfont/CMakeLists.txt
@@ -29,6 +29,7 @@ set(INC
 	../editors/include
 	../makesdna
 	../makesrna
+	../python
 	../imbuf
 	../../../intern/guardedalloc
 	../../../intern/locale
diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript
index a6ea724..3529330 100644
--- a/source/blender/blenfont/SConscript
+++ b/source/blender/blenfont/SConscript
@@ -31,7 +31,7 @@ Import ('env')
 sources = env.Glob('intern/*.c')
 
 incs = '. intern  #/intern/guardedalloc #/intern/locale ../blenkernel ../blenlib ../blenloader'
-incs += ' ../makesdna ../makesrna ../imbuf ../editors/include'
+incs += ' ../makesdna ../makesrna ../python ../imbuf ../editors/include'
 incs += ' #/extern/glew/include'
 incs += ' ' + env['BF_FREETYPE_INC']
 
@@ -43,4 +43,4 @@ if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross':
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
-env.BlenderLib ( 'bf_blenfont', sources, Split(incs), Split(defs), libtype=['core','player'], priority=[210,210] )
+env.BlenderLib ( 'bf_blenfont', sources, Split(incs), defines=defs, libtype=['core','player'], priority=[210,210] )
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 12c0088..a6b04b2 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -213,6 +213,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
 	FT_Error err;
 	FT_Bitmap bitmap, tempbitmap;
 	int sharp = (U.text_render & USER_TEXT_DISABLE_AA);
+	int flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP;
 	FT_BBox bbox;
 	unsigned int key;
 
@@ -220,10 +221,13 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
 	if (g)
 		return g;
 
+	if (font->flags & BLF_HINTING)
+		flags &= ~FT_LOAD_NO_HINTING;
+	
 	if (sharp)
 		err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO);
 	else
-		err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);  /* Sure about NO_* flags? */
+		err = FT_Load_Glyph(font->face, (FT_UInt)index, flags);  
 	if (err)
 		return NULL;
 
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 9086799..73294f1 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -27,41 +27,35 @@
  *  \ingroup blf
  */
 
-
-#include "BLF_translation.h" /* own include */
-
-#include "BLI_utildefines.h"
-
-#ifdef WITH_INTERNATIONAL
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "boost_locale_wrapper.h"
-
-#include "BKE_global.h"
-
-#include "DNA_userdef_types.h"
-
 #include "RNA_types.h"
 
-#include "MEM_guardedalloc.h"
+#include "BLF_translation.h" /* own include */
 
 #include "BLI_fileops.h"
 #include "BLI_linklist.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
 
+#include "BKE_global.h"
+
+#include "DNA_userdef_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#ifdef WITH_INTERNATIONAL
+
+#include "boost_locale_wrapper.h"
+
 /* Locale options. */
 static const char **locales = NULL;
 static int num_locales = 0;
 static EnumPropertyItem *locales_menu = NULL;
 static int num_locales_menu = 0;
 
-#define ULANGUAGE ((U.language >= 0 && U.language < num_locales) ? U.language : 0)
-#define LOCALE(_id) (locales ? locales[_id] : "")
-
 static void free_locales(void)
 {
 	if (locales) {
@@ -113,7 +107,7 @@ static void fill_locales(void)
 	}
 	num_locales_menu++; /* The "closing" void item... */
 
-	/* And now, buil locales and locale_menu! */
+	/* And now, build locales and locale_menu! */
 	locales_menu = MEM_callocN(num_locales_menu * sizeof(EnumPropertyItem), __func__);
 	line = lines;
 	/* Do not allocate locales with zero-sized mem, as LOCALE macro uses NULL locales as invalid marker! */
@@ -177,14 +171,20 @@ static void fill_locales(void)
 
 	BLI_file_free_lines(lines);
 }
+#endif  /* WITH_INTERNATIONAL */
 
 EnumPropertyItem *BLF_RNA_lang_enum_properties(void)
 {
+#ifdef WITH_INTERNATIONAL
 	return locales_menu;
+#else
+	return NULL;
+#endif
 }
 
 void BLF_lang_init(void)
 {
+#ifdef WITH_INTERNATIONAL
 	char *messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale");
 
 	if (messagepath) {
@@ -194,15 +194,24 @@ void BLF_lang_init(void)
 	else {
 		printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
 	}
+#else
+#endif
 }
 
 void BLF_lang_free(void)
 {
+#ifdef WITH_INTERNATIONAL
 	free_locales();
+#else
+#endif
 }
 
+#define ULANGUAGE ((U.language >= 0 && U.language < num_locales) ? U.language : 0)
+#define LOCALE(_id) (locales ? locales[(_id)] : "")
+
 void BLF_lang_set(const char *str)
 {
+#ifdef WITH_INTERNATIONAL
 	int ulang = ULANGUAGE;
 	const char *short_locale = str ? str : LOCALE(ulang);
 	const char *short_locale_utf8 = NULL;
@@ -232,37 +241,77 @@ void BLF_lang_set(const char *str)
 	if (short_locale[0]) {
 		MEM_freeN((void *)short_locale_utf8);
 	}
+#else
+	(void)str;
+#endif
 }
 
+/* Get the current locale (short code, e.g. es_ES). */
 const char *BLF_lang_get(void)
 {
-	int uilang = ULANGUAGE;
-	return LOCALE(uilang);
+#ifdef WITH_INTERNATIONAL
+	const char *locale = LOCALE(ULANGUAGE);
+	if (locale[0] == '\0') {
+		/* Default locale, we have to find which one we are actually using! */
+		locale = bl_locale_get();
+	}
+	return locale;
+#else
+	return "";
+#endif
 }
 
 #undef LOCALE
 #undef ULANGUAGE
 
-#else /* ! WITH_INTERNATIONAL */
-
-void BLF_lang_init(void)
-{
-	return;
-}
-
-void BLF_lang_free(void)
+/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. if there is no variant,
+ * *variant and *language_variant will always be NULL).
+ * Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them.
+ * NOTE: Keep that one always available, you never know, may become useful even in no-WITH_INTERNATIONAL context...
+ */
+void BLF_locale_explode(const char *locale, char **language, char **country, char **variant,
+                        char **language_country, char **language_variant)
 {
-	return;
-}
+	char *m1, *m2, *_t = NULL;
 
-void BLF_lang_set(const char *UNUSED(str))
-{
-	return;
-}
+	m1 = strchr(locale, '_');
+	m2 = strchr(locale, '@');
 
-const char *BLF_lang_get(void)
-{
-	return "";
+	if (language || language_variant) {
+		if (m1 || m2) {
+			_t = m1 ? BLI_strdupn(locale, m1 - locale) : BLI_strdupn(locale, m2 - locale);
+			if (language)
+				*language = _t;
+		}
+		else if (language) {
+			*language = BLI_strdup(locale);
+		}
+	}
+	if (country) {
+		if (m1)
+			*country = m2 ? BLI_strdupn(m1 + 1, m2 - (m1 + 1)) : BLI_strdup(m1 + 1);
+		else
+			*country = NULL;
+	}
+	if (variant) {
+		if (m2)
+			*variant = BLI_strdup(m2 + 1);
+		else
+			*variant = NULL;
+	}
+	if (language_country) {
+		if (m1)
+			*language_country = m2 ? BLI_strdupn(locale, m2 - locale) : BLI_strdup(locale);
+		else
+			*language_country = NULL;
+	}
+	if (language_variant) {
+		if (m2)
+			*language_variant = m1 ? BLI_strdupcat(_t, m2) : BLI_strdup(locale);
+		else
+			*language_variant = NULL;
+	}
+	if (_t && !language) {
+		MEM_freeN(_t);
+	}
 }
-
-#endif /* WITH_INTERNATIONAL */
diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
index 5d4b631..b5b72b6 100644
--- a/source/blender/blenfont/intern/blf_translation.c
+++ b/source/blender/blenfont/intern/blf_translation.c
@@ -33,26 +33,28 @@
 
 #include "BLF_translation.h"
 
-#ifdef WITH_INTERNATIONAL
-
-#include "boost_locale_wrapper.h"
-
 #include "MEM_guardedalloc.h"
 
-#include "BLI_utildefines.h"
+#include "BLI_fileops.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
-#include "BLI_path_util.h"
-#include "BLI_fileops.h"
 
 #include "DNA_userdef_types.h" /* For user settings. */
 
+#include "BPY_extern.h"
+
+#ifdef WITH_INTERNATIONAL
+
+#include "boost_locale_wrapper.h"
+
 static const char unifont_filename[] = "droidsans.ttf.gz";
 static unsigned char *unifont_ttf = NULL;
 static int unifont_size = 0;
+#endif  /* WITH_INTERNATIONAL */
 
 unsigned char *BLF_get_unifont(int *unifont_size_r)
 {
+#ifdef WITH_INTERNATIONAL
 	if (unifont_ttf == NULL) {
 		char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
 		if (fontpath) {
@@ -70,21 +72,41 @@ unsigned char *BLF_get_unifont(int *unifont_size_r)
 	*unifont_size_r = unifont_size;
 
 	return unifont_ttf;
+#else
+	(void)unifont_size_r;
+	return NULL;
+#endif
 }
 
 void BLF_free_unifont(void)
 {
+#ifdef WITH_INTERNATIONAL
 	if (unifont_ttf)
 		MEM_freeN(unifont_ttf);
-}
-
+#else
 #endif
+}
 
 const char *BLF_pgettext(const char *msgctxt, const char *msgid)
 {
 #ifdef WITH_INTERNATIONAL
 	if (msgid && msgid[0]) {
-		return bl_locale_pgettext(msgctxt, msgid);
+		const char *ret;
+
+		/*if (msgctxt && !strcmp(msgctxt, BLF_I18NCONTEXT_DEFAULT_BPY_INTERN)) { */
+		if (msgctxt && msgctxt[0] == BLF_I18NCONTEXT_DEFAULT_BPY[0]) {
+			/* BLF_I18NCONTEXT_DEFAULT_BPY context is reserved and considered the same as default NULL one. */
+			msgctxt = BLF_I18NCONTEXT_DEFAULT;
+		}
+		ret = bl_locale_pgettext(msgctxt, msgid);
+		/* We assume if the returned string is the same (memory level) as the msgid, no translation was found,
+		 * and we can try py scripts' ones!
+		 */
+		if (ret == msgid) {
+			ret = BPY_app_translations_py_pgettext(msgctxt, msgid);
+		}
+
+		return ret;
 	}
 	return "";
 #else
@@ -93,21 +115,21 @@ const char *BLF_pgettext(const char *msgctxt, const char *msgid)
 #endif
 }
 
-int BLF_translate_iface(void)
+bool BLF_translate_iface(void)
 {
 #ifdef WITH_INTERNATIONAL
 	return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE);
 #else
-	return 0;
+	return false;
 #endif
 }
 
-int BLF_translate_tooltips(void)
+bool BLF_translate_tooltips(void)
 {
 #ifdef WITH_INTERNATIONAL
 	return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS);
 #else
-	return 0;
+	return false;
 #endif
 }
 
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index f06547f..486834f 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -95,6 +95,8 @@ struct BMEditMesh;
 struct ListBase;
 struct PBVH;
 
+#define DM_OMP_LIMIT 10000  /* setting zero so we can catch bugs in OpenMP/BMesh */
+
 /* number of sub-elements each mesh element has (for interpolation) */
 #define SUB_ELEMS_VERT 0
 #define SUB_ELEMS_EDGE 2
@@ -729,4 +731,4 @@ BLI_INLINE int DM_origindex_mface_mpoly(const int *index_mf_to_mpoly, const int
 	return (j != ORIGINDEX_NONE) ? (index_mp_to_orig ? index_mp_to_orig[j] : j) : ORIGINDEX_NONE;
 }
 
-#endif
+#endif  /* __BKE_DERIVEDMESH_H__ */
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 2d7030b..12c9f6b 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -44,6 +44,7 @@ struct FCurve;
 struct bPose;
 struct bItasc;
 struct bPoseChannel;
+struct Main;
 struct Object;
 struct Scene;
 struct ID;
@@ -56,7 +57,7 @@ extern "C" {
 /* Action Lib Stuff ----------------- */
 
 /* Allocate a new bAction with the given name */
-struct bAction *add_empty_action(const char name[]);
+struct bAction *add_empty_action(struct Main *bmain, const char name[]);
 
 /* Allocate a copy of the given Action and all its data */	
 struct bAction *BKE_action_copy(struct bAction *src);
@@ -220,7 +221,7 @@ void BKE_pose_remove_group(struct Object *ob);
 void what_does_obaction(struct Object *ob, struct Object *workob, struct bPose *pose, struct bAction *act, char groupname[], float cframe);
 
 /* for proxy */
-void BKE_pose_copy_result(struct bPose *to, struct bPose *from);
+bool BKE_pose_copy_result(struct bPose *to, struct bPose *from);
 /* clear all transforms */
 void BKE_pose_rest(struct bPose *pose);
 
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 765a00b..fb9e9f4 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -73,7 +73,7 @@ typedef struct PoseTree {
 extern "C" {
 #endif
 
-struct bArmature *BKE_armature_add(const char *name);
+struct bArmature *BKE_armature_add(struct Main *bmain, const char *name);
 struct bArmature *BKE_armature_from_object(struct Object *ob);
 void BKE_armature_bonelist_free(struct ListBase *lb);
 void BKE_armature_free(struct bArmature *arm);
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 9c6d26c..370a8c7 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -41,8 +41,8 @@ extern "C" {
 /* these lines are grep'd, watch out for our not-so-awesome regex
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
-#define BLENDER_VERSION         265
-#define BLENDER_SUBVERSION      8
+#define BLENDER_VERSION         266
+#define BLENDER_SUBVERSION      0
 
 /* 262 was the last editmesh release but it has compatibility code for bmesh data */
 #define BLENDER_MINVERSION      262
@@ -50,9 +50,9 @@ extern "C" {
 
 /* used by packaging tools */
 /* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR    a
+#define BLENDER_VERSION_CHAR    
 /* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE   alpha
+#define BLENDER_VERSION_CYCLE   release
 
 extern char versionstr[]; /* from blender.c */
 
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index 248fe9c..cfae159 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -36,12 +36,14 @@
 struct ID;
 struct Brush;
 struct ImBuf;
+struct ImagePool;
+struct Main;
 struct Scene;
 struct wmOperator;
 // enum CurveMappingPreset;
 
 /* datablock functions */
-struct Brush *BKE_brush_add(const char *name);
+struct Brush *BKE_brush_add(struct Main *bmain, const char *name);
 struct Brush *BKE_brush_copy(struct Brush *brush);
 void BKE_brush_make_local(struct Brush *brush);
 void BKE_brush_free(struct Brush *brush);
@@ -67,7 +69,8 @@ float BKE_brush_curve_strength_clamp(struct Brush *br, float p, const float len)
 float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
 
 /* sampling */
-void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread);
+void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float sampleco[3], float rgba[4], const int thread, struct ImagePool *pool);
+void BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread);
 void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
                          struct ImBuf **imbuf, int use_color_correction);
 
diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h
index 2a27934..057cd79 100644
--- a/source/blender/blenkernel/BKE_camera.h
+++ b/source/blender/blenkernel/BKE_camera.h
@@ -39,6 +39,7 @@ extern "C" {
 #include "DNA_vec_types.h"
 
 struct Camera;
+struct Main;
 struct Object;
 struct RegionView3D;
 struct RenderData;
@@ -48,7 +49,7 @@ struct View3D;
 
 /* Camera Datablock */
 
-void *BKE_camera_add(const char *name);
+void *BKE_camera_add(struct Main *bmain, const char *name);
 struct Camera *BKE_camera_copy(struct Camera *cam);
 void BKE_camera_make_local(struct Camera *cam);
 void BKE_camera_free(struct Camera *ca);
diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h
index 96e05aa..e0b7e68 100644
--- a/source/blender/blenkernel/BKE_colortools.h
+++ b/source/blender/blenkernel/BKE_colortools.h
@@ -42,14 +42,6 @@ struct Histogram;
 struct ImBuf;
 struct rctf;
 
-#if defined _MSC_VER
-#   define DO_INLINE __inline
-#elif defined(__sun) || defined(__sun__)
-#   define DO_INLINE
-#else
-#   define DO_INLINE static inline
-#endif
-
 void                curvemapping_set_defaults(struct CurveMapping *cumap, int tot, float minx, float miny, float maxx, float maxy);
 struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
 void                curvemapping_free_data(struct CurveMapping *cumap);
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index 536bbec..358f884 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -39,6 +39,7 @@ struct Curve;
 struct EditNurb;
 struct ListBase;
 struct ListBase;
+struct Main;
 struct Nurb;
 struct Object;
 struct Scene;
@@ -57,7 +58,7 @@ struct Scene;
 void BKE_curve_unlink(struct Curve *cu);
 void BKE_curve_free(struct Curve *cu);
 void BKE_curve_editfont_free(struct Curve *cu);
-struct Curve *BKE_curve_add(const char *name, int type);
+struct Curve *BKE_curve_add(struct Main *bmain, const char *name, int type);
 struct Curve *BKE_curve_copy(struct Curve *cu);
 void BKE_curve_make_local(struct Curve *cu);
 short BKE_curve_type_get(struct Curve *cu);
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index ab27421..0fa7356 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -56,6 +56,7 @@ void                     defvert_remove_group(struct MDeformVert *dvert, struct
 void                     defvert_clear(struct MDeformVert *dvert);
 int                      defvert_find_shared(const struct MDeformVert *dvert_a, const struct MDeformVert *dvert_b);
 
+void BKE_defvert_array_free_elems(struct MDeformVert *dvert, int totvert);
 void BKE_defvert_array_free(struct MDeformVert *dvert, int totvert);
 void BKE_defvert_array_copy(struct MDeformVert *dst, const struct MDeformVert *src, int totvert);
 
diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h
index cf7e4b2..49dc1bf 100644
--- a/source/blender/blenkernel/BKE_depsgraph.h
+++ b/source/blender/blenkernel/BKE_depsgraph.h
@@ -36,13 +36,14 @@ extern "C" {
 
 // #define DEPS_DEBUG
 
-struct ID;
-struct Main;
-struct Scene;
-struct DagNodeQueue;
 struct DagForest;
 struct DagNode;
+struct DagNodeQueue;
 struct GHash;
+struct ID;
+struct Main;
+struct Object;
+struct Scene;
 
 /* **** DAG relation types *** */
 
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index bf2f126..6ce7b95 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -41,6 +41,7 @@ struct FModifier;
 struct ChannelDriver;
 struct DriverVar;
 struct DriverTarget;
+struct FCM_EnvelopeData;
 
 struct bAction;
 struct BezTriple;
@@ -181,6 +182,8 @@ void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *c
 
 void fcurve_bake_modifiers(struct FCurve *fcu, int start, int end);
 
+int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, short *exists);
+
 /* ************** F-Curves API ******************** */
 
 /* -------- Data Managemnt  --------  */
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h
index 3e9803a..8c36a73 100644
--- a/source/blender/blenkernel/BKE_group.h
+++ b/source/blender/blenkernel/BKE_group.h
@@ -36,13 +36,14 @@
 struct Base;
 struct Group;
 struct GroupObject;
+struct Main;
 struct Object;
 struct bAction;
 struct Scene;
 
 void        BKE_group_free(struct Group *group);
 void        BKE_group_unlink(struct Group *group);
-struct Group *add_group(const char *name);
+struct Group *add_group(struct Main *bmain, const char *name);
 struct Group *BKE_group_copy(struct Group *group);
 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);
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 4996099..dd7e062 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -44,6 +44,7 @@ struct anim;
 struct Scene;
 struct Object;
 struct ImageFormatData;
+struct ImagePool;
 struct Main;
 
 #define IMA_MAX_SPACE       64
@@ -146,13 +147,21 @@ int BKE_image_has_ibuf(struct Image *ima, struct ImageUser *iuser);
 struct ImBuf *BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **lock_r);
 void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock);
 
+struct ImagePool *BKE_image_pool_new(void);
+void BKE_image_pool_free(struct ImagePool *pool);
+struct ImBuf *BKE_image_pool_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, struct ImagePool *pool);
+void BKE_image_pool_release_ibuf(struct Image *ima, struct ImBuf *ibuf, struct ImagePool *pool);
+
+/* set an alpha mode based on file extension */
+void BKE_image_alpha_mode_from_extension(struct Image *image);
+
 /* returns a new image or NULL if it can't load */
-struct Image *BKE_image_load(const char *filepath);
+struct Image *BKE_image_load(struct Main *bmain, const char *filepath);
 /* returns existing Image when filename/type is same (frame optional) */
 struct Image *BKE_image_load_exists(const char *filepath);
 
 /* adds image, adds ibuf, generates color or pattern */
-struct Image *BKE_image_add_generated(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
+struct Image *BKE_image_add_generated(struct Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, float color[4]);
 /* adds image from imbuf, owns imbuf */
 struct Image *BKE_image_add_from_imbuf(struct ImBuf *ibuf);
 
@@ -199,7 +208,7 @@ void BKE_image_memorypack(struct Image *ima);
 void BKE_image_print_memlist(void);
 
 /* empty image block, of similar type and filename */
-struct Image *BKE_image_copy(struct Image *ima);
+struct Image *BKE_image_copy(struct Main *bmain, struct Image *ima);
 
 /* merge source into dest, and free source */
 void BKE_image_merge(struct Image *dest, struct Image *source);
@@ -219,6 +228,10 @@ void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width,
 void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int height, int width);
 void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, int height, int width);
 
+/* Cycles hookup */
+unsigned char *BKE_image_get_pixels_for_frame(struct Image *image, int frame);
+float *BKE_image_get_float_pixels_for_frame(struct Image *image, int frame);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/BKE_lamp.h b/source/blender/blenkernel/BKE_lamp.h
index 244decf..205c7c7 100644
--- a/source/blender/blenkernel/BKE_lamp.h
+++ b/source/blender/blenkernel/BKE_lamp.h
@@ -37,9 +37,10 @@ extern "C" {
 #endif
 
 struct Lamp;
+struct Main;
 struct Scene;
 
-struct Lamp *BKE_lamp_add(const char *name) WARN_UNUSED;
+struct Lamp *BKE_lamp_add(struct Main *bmain, const char *name) WARN_UNUSED;
 struct Lamp *BKE_lamp_copy(struct Lamp *la) WARN_UNUSED;
 struct Lamp *localize_lamp(struct Lamp *la) WARN_UNUSED;
 void BKE_lamp_make_local(struct Lamp *la);
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index a0bebd7..b195af1 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -35,6 +35,7 @@
  */
 
 struct Lattice;
+struct Main;
 struct Object;
 struct Scene;
 struct DerivedMesh;
@@ -42,7 +43,7 @@ struct BPoint;
 struct MDeformVert;
 
 void BKE_lattice_resize(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
-struct Lattice *BKE_lattice_add(const char *name);
+struct Lattice *BKE_lattice_add(struct Main *bmain, const char *name);
 struct Lattice *BKE_lattice_copy(struct Lattice *lt);
 void BKE_lattice_free(struct Lattice *lt);
 void BKE_lattice_make_local(struct Lattice *lt);
@@ -75,5 +76,10 @@ void    BKE_lattice_modifiers_calc(struct Scene *scene, struct Object *ob);
 
 struct MDeformVert *BKE_lattice_deform_verts_get(struct Object *lattice);
 
+void BKE_lattice_minmax(struct Lattice *lt, float min[3], float max[3]);
+void BKE_lattice_center_median(struct Lattice *lt, float cent[3]);
+void BKE_lattice_center_bounds(struct Lattice *lt, float cent[3]);
+void BKE_lattice_translate(struct Lattice *lt, float offset[3], int do_keys);
+
 #endif
 
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index b9bb67f..5aa82be 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -51,6 +51,12 @@ __attribute__((warn_unused_result))
 __attribute__((nonnull))
 #endif
 ;
+void *BKE_libblock_copy_ex(struct Main *bmain, struct ID *id)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
 void *BKE_libblock_copy(struct ID *id)
 #ifdef __GNUC__
 __attribute__((warn_unused_result))
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index 1b7b294..8e4d370 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -99,5 +99,4 @@ typedef struct Main {
 }
 #endif
 
-#endif
-
+#endif  /* __BKE_MAIN_H__ */
diff --git a/source/blender/blenkernel/BKE_mask.h b/source/blender/blenkernel/BKE_mask.h
index cc15cee..b40ad48 100644
--- a/source/blender/blenkernel/BKE_mask.h
+++ b/source/blender/blenkernel/BKE_mask.h
@@ -98,7 +98,7 @@ void BKE_mask_point_select_set(struct MaskSplinePoint *point, const short do_sel
 void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point, const short do_select);
 
 /* general */
-struct Mask *BKE_mask_new(const char *name);
+struct Mask *BKE_mask_new(struct Main *bmain, const char *name);
 struct Mask *BKE_mask_copy_nolib(struct Mask *mask);
 struct Mask *BKE_mask_copy(struct Mask *mask);
 
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index dd1b1a7..350eaf2 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -52,7 +52,7 @@ void BKE_material_free_ex(struct Material *ma, int do_id_user);
 void test_object_materials(struct ID *id);
 void resize_object_material(struct Object *ob, const short totcol);
 void init_material(struct Material *ma);
-struct Material *BKE_material_add(const char *name);
+struct Material *BKE_material_add(struct Main *bmain, const char *name);
 struct Material *BKE_material_copy(struct Material *ma);
 struct Material *localize_material(struct Material *ma);
 struct Material *give_node_material(struct Material *ma); /* returns node material or self */
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h
index 7a0eea1..662bfab 100644
--- a/source/blender/blenkernel/BKE_mball.h
+++ b/source/blender/blenkernel/BKE_mball.h
@@ -32,6 +32,7 @@
  *  \since March 2001
  *  \author nzc
  */
+struct Main;
 struct MetaBall;
 struct Object;
 struct Scene;
@@ -39,7 +40,7 @@ struct MetaElem;
 
 void BKE_mball_unlink(struct MetaBall *mb);
 void BKE_mball_free(struct MetaBall *mb);
-struct MetaBall *BKE_mball_add(const char *name);
+struct MetaBall *BKE_mball_add(struct Main *bmain, const char *name);
 struct MetaBall *BKE_mball_copy(struct MetaBall *mb);
 
 void BKE_mball_make_local(struct MetaBall *mb);
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 3466a91..24535eb 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -39,6 +39,7 @@ struct DispList;
 struct ListBase;
 struct BMEditMesh;
 struct BMesh;
+struct Main;
 struct Mesh;
 struct MPoly;
 struct MLoop;
@@ -100,6 +101,16 @@ void BKE_mesh_calc_poly_center(struct MPoly *mpoly, struct MLoop *loopstart,
 float BKE_mesh_calc_poly_area(struct MPoly *mpoly, struct MLoop *loopstart,
                               struct MVert *mvarray, const float polynormal[3]);
 
+void BKE_mesh_calc_relative_deform(
+        const struct MPoly *mpoly, const int totpoly,
+        const struct MLoop *mloop, const int totvert,
+
+        const float (*vert_cos_src)[3],
+        const float (*vert_cos_dst)[3],
+
+        const float (*vert_cos_org)[3],
+              float (*vert_cos_new)[3]);
+
 /* Find the index of the loop in 'poly' which references vertex,
  * returns -1 if not found */
 int poly_find_loop_from_vert(const struct MPoly *poly,
@@ -136,7 +147,8 @@ void BKE_mesh_flush_select_from_verts(struct Mesh *me);
 
 void BKE_mesh_unlink(struct Mesh *me);
 void BKE_mesh_free(struct Mesh *me, int unlink);
-struct Mesh *BKE_mesh_add(const char *name);
+struct Mesh *BKE_mesh_add(struct Main *bmain, const char *name);
+struct Mesh *BKE_mesh_copy_ex(struct Main *bmain, struct Mesh *me);
 struct Mesh *BKE_mesh_copy(struct Mesh *me);
 void mesh_update_customdata_pointers(struct Mesh *me, const short do_ensure_tess_cd);
 
diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h
index 25d2678..5777a40 100644
--- a/source/blender/blenkernel/BKE_movieclip.h
+++ b/source/blender/blenkernel/BKE_movieclip.h
@@ -43,7 +43,7 @@ struct MovieDistortion;
 void BKE_movieclip_free(struct MovieClip *clip);
 void BKE_movieclip_unlink(struct Main *bmain, struct MovieClip *clip);
 
-struct MovieClip *BKE_movieclip_file_add(const char *name);
+struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
 void BKE_movieclip_reload(struct MovieClip *clip);
 
 struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 0a2f757..5024b36 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -299,7 +299,7 @@ struct bNodeTreeType *ntreeGetType(int type);
 struct bNodeType *ntreeGetNodeType(struct bNodeTree *ntree);
 struct bNodeSocketType *ntreeGetSocketType(int type);
 
-struct bNodeTree *ntreeAddTree(const char *name, int type, int nodetype);
+struct bNodeTree *ntreeAddTree(struct Main *bmain, const char *name, int type, int nodetype);
 void              ntreeInitTypes(struct bNodeTree *ntree);
 
 /* copy/free funcs, need to manage ID users */
@@ -577,7 +577,7 @@ struct ShadeResult;
 
 struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree, int use_tree_data);
 void            ntreeShaderEndExecTree(struct bNodeTreeExec *exec, int use_tree_data);
-void            ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
+bool            ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
 void            ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode);
 void            nodeShaderSynchronizeID(struct bNode *node, int copyto);
 
@@ -737,8 +737,6 @@ void            ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMateria
 
 /* API */
 struct CompBuf;
-struct bNodeTreeExec *ntreeCompositBeginExecTree(struct bNodeTree *ntree, int use_tree_data);
-void ntreeCompositEndExecTree(struct bNodeTreeExec *exec, int use_tree_data);
 void ntreeCompositExecTree(struct bNodeTree *ntree, struct RenderData *rd, int rendering, int do_previews,
                            const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings);
 void ntreeCompositTagRender(struct Scene *sce);
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index bfae1bd..89860cd 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -49,6 +49,8 @@ struct bAction;
 struct RenderData;
 struct rctf;
 struct MovieClip;
+struct Main;
+struct RigidBodyWorld;
 
 void BKE_object_workob_clear(struct Object *workob);
 void BKE_object_workob_calc_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
@@ -78,12 +80,12 @@ void BKE_object_unlink(struct Object *ob);
 int  BKE_object_exists_check(struct Object *obtest);
 int BKE_object_is_in_editmode(struct Object *ob);
 
-struct Object *BKE_object_add_only_object(int type, const char *name);
+struct Object *BKE_object_add_only_object(struct Main *bmain, int type, const char *name);
 struct Object *BKE_object_add(struct Scene *scene, int type);
 void *BKE_object_obdata_add_from_type(int type);
 
+struct Object *BKE_object_copy_ex(struct Main *bmain, struct Object *ob, int copy_caches);
 struct Object *BKE_object_copy(struct Object *ob);
-struct Object *BKE_object_copy_with_caches(struct Object *ob);
 void BKE_object_make_local(struct Object *ob);
 int  BKE_object_is_libdata(struct Object *ob);
 int  BKE_object_obdata_is_libdata(struct Object *ob);
@@ -99,7 +101,10 @@ int BKE_object_pose_context_check(struct Object *ob);
 struct Object *BKE_object_pose_armature_get(struct Object *ob);
 
 void BKE_object_where_is_calc(struct Scene *scene, struct Object *ob);
+void BKE_object_where_is_calc_ex(struct Scene *scene, struct RigidBodyWorld *rbw, struct Object *ob);
 void BKE_object_where_is_calc_time(struct Scene *scene, struct Object *ob, float ctime);
+void BKE_object_where_is_calc_time_ex(struct Scene *scene, struct Object *ob, float ctime,
+                                      struct RigidBodyWorld *rbw);
 void BKE_object_where_is_calc_simul(struct Scene *scene, struct Object *ob);
 void BKE_object_where_is_calc_mat4(struct Scene *scene, struct Object *ob, float obmat[4][4]);
 
@@ -145,6 +150,8 @@ void BKE_object_tfm_protected_restore(struct Object *ob,
                                       const short protectflag);
 
 void BKE_object_handle_update(struct Scene *scene, struct Object *ob);
+void BKE_object_handle_update_ex(struct Scene *scene, struct Object *ob,
+                                 struct RigidBodyWorld *rbw);
 void BKE_object_sculpt_modifiers_changed(struct Object *ob);
 
 int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot);
diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h
index 9dcbb41..b19a209 100644
--- a/source/blender/blenkernel/BKE_packedFile.h
+++ b/source/blender/blenkernel/BKE_packedFile.h
@@ -35,6 +35,7 @@
 #define RET_OK      0
 #define RET_ERROR   1
 
+struct ID;
 struct bSound;
 struct Image;
 struct Main;
@@ -72,5 +73,10 @@ int seekPackedFile(struct PackedFile *pf, int offset, int whence);
 void rewindPackedFile(struct PackedFile *pf);
 int readPackedFile(struct PackedFile *pf, void *data, int size);
 
+/* ID should be not NULL, return 1 if there's a packed file */
+int BKE_pack_check(struct ID *id);
+/* ID should be not NULL, throws error when ID is Library */
+void BKE_unpack_id(struct Main *bmain, struct ID *id, struct ReportList *reports, int how);
+
 #endif
 
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 0a4a7f7..211b618 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -34,6 +34,7 @@
 
 struct bContext;
 struct BMesh;
+struct BMFace;
 struct Brush;
 struct MDisps;
 struct MeshElemMap;
@@ -46,6 +47,7 @@ struct Paint;
 struct PBVH;
 struct Scene;
 struct StrokeCache;
+struct ImagePool;
 
 extern const char PAINT_CURSOR_SCULPT[3];
 extern const char PAINT_CURSOR_VERTEX_PAINT[3];
@@ -72,6 +74,7 @@ int paint_vertsel_test(struct Object *ob);
 int paint_is_face_hidden(const struct MFace *f, const struct MVert *mvert);
 int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
                               int gridsize, int x, int y);
+int paint_is_bmesh_face_hidden(struct BMFace *f);
 
 /* paint masks */
 float paint_grid_paint_mask(const struct GridPaintMask *gpm, unsigned level,
@@ -114,6 +117,7 @@ typedef struct SculptSession {
 	
 	/* Used to cache the render of the active texture */
 	unsigned int texcache_side, *texcache, texcache_actual;
+	struct ImagePool *tex_pool;
 
 	/* Layer brush persistence between strokes */
 	float (*layer_co)[3]; /* Copy of the mesh vertices' locations */
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index f15ad29..6c20767 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -96,7 +96,7 @@ typedef struct SPHData {
 	float *gravity;
 	float hfac;
 	/* Average distance to neighbours (other particles in the support domain),
-	   for calculating the Courant number (adaptive time step). */
+	 * for calculating the Courant number (adaptive time step). */
 	int pass;
 	float element_size;
 	float flow[3];
@@ -220,7 +220,10 @@ typedef struct ParticleCollision {
 
 	ParticleCollisionElement pce;
 
-	float total_time, inv_timestep;
+	/* total_time is the amount of time in this subframe
+	 * inv_total_time is the opposite
+	 * inv_timestep is the inverse of the amount of time in this frame */
+	float total_time, inv_total_time, inv_timestep;
 
 	float radius;
 	float co1[3], co2[3];
@@ -306,7 +309,7 @@ int psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct Pa
 
 void psys_sph_init(struct ParticleSimulationData *sim, struct SPHData *sphdata);
 void psys_sph_finalise(struct SPHData *sphdata);
-void psys_sph_density(struct BVHTree *tree, struct SPHData* data, float co[3], float vars[2]);
+void psys_sph_density(struct BVHTree *tree, struct SPHData *data, float co[3], float vars[2]);
 
 /* for anim.c */
 void psys_get_dupli_texture(struct ParticleSystem *psys, struct ParticleSettings *part,
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index 709db7e..99ed978 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -113,6 +113,9 @@ typedef enum {
 
 PBVHType BKE_pbvh_type(const PBVH *bvh);
 
+/* Get the PBVH root's bounding box */
+void BKE_pbvh_bounding_box(const PBVH *bvh, float min[3], float max[3]);
+
 /* multires hidden data, only valid for type == PBVH_GRIDS */
 unsigned int **BKE_pbvh_grid_hidden(const PBVH *bvh);
 
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 77b35e1..1cb5042 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -67,6 +67,7 @@
 #define PTCACHE_TYPE_SMOKE_DOMAIN       3
 #define PTCACHE_TYPE_SMOKE_HIGHRES      4
 #define PTCACHE_TYPE_DYNAMICPAINT       5
+#define PTCACHE_TYPE_RIGIDBODY          6
 
 /* high bits reserved for flags that need to be stored in file */
 #define PTCACHE_TYPEFLAG_COMPRESS       (1 << 16)
@@ -91,6 +92,7 @@ struct PointCache;
 struct Scene;
 struct SmokeModifierData;
 struct SoftBody;
+struct RigidBodyWorld;
 
 /* temp structure for read/write */
 typedef struct PTCacheData {
@@ -260,6 +262,7 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct Par
 void BKE_ptcache_id_from_cloth(PTCacheID *pid, struct Object *ob, struct ClothModifierData *clmd);
 void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd);
 void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, struct Object *ob, struct DynamicPaintSurface *surface);
+void BKE_ptcache_id_from_rigidbody(PTCacheID *pid, struct Object *ob, struct RigidBodyWorld *rbw);
 
 void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob, struct Scene *scene, int duplis);
 
@@ -294,10 +297,6 @@ int     BKE_ptcache_read(PTCacheID *pid, float cfra);
 /* Main cache writing call. */
 int     BKE_ptcache_write(PTCacheID *pid, unsigned int cfra);
 
-/****************** Continue physics ***************/
-void BKE_ptcache_set_continue_physics(struct Main *bmain, struct Scene *scene, int enable);
-int BKE_ptcache_get_continue_physics(void);
-
 /******************* Allocate & free ***************/
 struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
 void BKE_ptcache_free_mem(struct ListBase *mem_cache);
diff --git a/source/blender/blenkernel/BKE_rigidbody.h b/source/blender/blenkernel/BKE_rigidbody.h
new file mode 100644
index 0000000..12779a6
--- /dev/null
+++ b/source/blender/blenkernel/BKE_rigidbody.h
@@ -0,0 +1,96 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file BKE_rigidbody.h
+ *  \ingroup blenkernel
+ *  \brief API for Blender-side Rigid Body stuff
+ */
+ 
+
+#ifndef __BKE_RIGIDBODY_H__
+#define __BKE_RIGIDBODY_H__
+
+struct RigidBodyWorld;
+struct RigidBodyOb;
+
+struct Scene;
+struct Object;
+struct Group;
+
+/* -------------- */
+/* Memory Management */
+
+void BKE_rigidbody_free_world(struct RigidBodyWorld *rbw);
+void BKE_rigidbody_free_object(struct Object *ob);
+void BKE_rigidbody_free_constraint(struct Object *ob);
+
+/* ...... */
+
+struct RigidBodyOb *BKE_rigidbody_copy_object(struct Object *ob);
+struct RigidBodyCon *BKE_rigidbody_copy_constraint(struct Object *ob);
+void BKE_rigidbody_relink_constraint(struct RigidBodyCon *rbc);
+
+/* -------------- */
+/* Setup */
+
+/* create Blender-side settings data - physics objects not initialised yet */
+struct RigidBodyWorld *BKE_rigidbody_create_world(struct Scene *scene);
+struct RigidBodyOb *BKE_rigidbody_create_object(struct Scene *scene, struct Object *ob, short type);
+struct RigidBodyCon *BKE_rigidbody_create_constraint(struct Scene *scene, struct Object *ob, short type);
+
+/* 'validate' (i.e. make new or replace old) Physics-Engine objects */
+void BKE_rigidbody_validate_sim_world(struct Scene *scene, struct RigidBodyWorld *rbw, short rebuild);
+void BKE_rigidbody_validate_sim_object(struct RigidBodyWorld *rbw, struct Object *ob, short rebuild);
+void BKE_rigidbody_validate_sim_shape(struct Object *ob, short rebuild);
+void BKE_rigidbody_validate_sim_constraint(struct RigidBodyWorld *rbw, struct Object *ob, short rebuild);
+
+/* -------------- */
+/* Utilities */
+
+struct RigidBodyWorld *BKE_rigidbody_get_world(struct Scene *scene);
+void BKE_rigidbody_remove_object(struct Scene *scene, struct Object *ob);
+void BKE_rigidbody_remove_constraint(struct Scene *scene, struct Object *ob);
+
+/* -------------- */
+/* Utility Macros */
+
+/* get mass of Rigid Body Object to supply to RigidBody simulators */
+#define RBO_GET_MASS(rbo) \
+	((rbo && ((rbo->type == RBO_TYPE_PASSIVE) || (rbo->flag & RBO_FLAG_KINEMATIC) || (rbo->flag & RBO_FLAG_DISABLED))) ? (0.0f) : (rbo->mass))
+/* get collision margin for Rigid Body Object, triangle mesh and cone shapes cannot embed margin, convex hull always uses custom margin */
+#define RBO_GET_MARGIN(rbo) \
+	((rbo->flag & RBO_FLAG_USE_MARGIN || rbo->shape == RB_SHAPE_CONVEXH || rbo->shape == RB_SHAPE_TRIMESH || rbo->shape == RB_SHAPE_CONE) ? (rbo->margin) : (0.04f))
+
+/* -------------- */
+/* Simulation */
+
+void BKE_rigidbody_aftertrans_update(struct Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle);
+void BKE_rigidbody_sync_transforms(struct RigidBodyWorld *rbw, struct Object *ob, float ctime);
+void BKE_rigidbody_cache_reset(struct RigidBodyWorld *rbw);
+void BKE_rigidbody_do_simulation(struct Scene *scene, float ctime);
+
+#endif /* __BKE_RIGIDBODY_H__ */
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 6447b2a..9bf0991 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -72,6 +72,7 @@ struct Scene *BKE_scene_add(struct Main *bmain, const char *name);
 /* base functions */
 struct Base *BKE_scene_base_find(struct Scene *scene, struct Object *ob);
 struct Base *BKE_scene_base_add(struct Scene *sce, struct Object *ob);
+void         BKE_scene_base_unlink(struct Scene *sce, struct Base *base);
 void         BKE_scene_base_deselect_all(struct Scene *sce);
 void         BKE_scene_base_select(struct Scene *sce, struct Base *selbase);
 int          BKE_scene_base_iter_next(struct Scene **scene, int val, struct Base **base, struct Object **ob);
@@ -115,6 +116,7 @@ int BKE_scene_use_new_shading_nodes(struct Scene *scene);
 
 void BKE_scene_disable_color_management(struct Scene *scene);
 int BKE_scene_check_color_management_enabled(const struct Scene *scene);
+int BKE_scene_check_rigidbody_active(const struct Scene *scene);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 3c6f886..629acab 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -261,6 +261,7 @@ void            BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
 void            BKE_screen_area_free(struct ScrArea *sa);
 
 struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type);
+struct ARegion *BKE_area_find_region_active_win(struct ScrArea *sa);
 struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min);
 
 void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index e3d9c51..eef134a 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -356,6 +356,8 @@ typedef struct SeqLoadInfo {
 typedef struct Sequence *(*SeqLoadFunc)(struct bContext *, ListBase *, struct SeqLoadInfo *);
 
 struct Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine);
+
+void BKE_sequence_alpha_mode_from_extension(struct Sequence *seq);
 void BKE_sequence_init_colorspace(struct Sequence *seq);
 
 struct Sequence *BKE_sequencer_add_image_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
diff --git a/source/blender/blenkernel/BKE_speaker.h b/source/blender/blenkernel/BKE_speaker.h
index 52c177f..e2f0fa5 100644
--- a/source/blender/blenkernel/BKE_speaker.h
+++ b/source/blender/blenkernel/BKE_speaker.h
@@ -33,7 +33,9 @@
  *  \brief General operations for speakers.
  */
 
-void *BKE_speaker_add(const char *name);
+struct Main;
+
+void *BKE_speaker_add(struct Main *bmain, const char *name);
 struct Speaker *BKE_speaker_copy(struct Speaker *spk);
 void BKE_speaker_make_local(struct Speaker *spk);
 void BKE_speaker_free(struct Speaker *spk);
diff --git a/source/blender/blenkernel/BKE_tessmesh.h b/source/blender/blenkernel/BKE_tessmesh.h
index 9462822..b3e6ab3 100644
--- a/source/blender/blenkernel/BKE_tessmesh.h
+++ b/source/blender/blenkernel/BKE_tessmesh.h
@@ -83,7 +83,7 @@ typedef struct BMEditMesh {
 } BMEditMesh;
 
 void BMEdit_RecalcTessellation(BMEditMesh *em);
-BMEditMesh *BMEdit_Create(BMesh *bm, int do_tessellate);
+BMEditMesh *BMEdit_Create(BMesh *bm, const bool do_tessellate);
 BMEditMesh *BMEdit_Copy(BMEditMesh *em);
 BMEditMesh *BMEdit_FromObject(struct Object *ob);
 void BMEdit_Free(BMEditMesh *em);
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index 1e3dd42..3d7b5d1 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -45,10 +45,10 @@ struct SpaceText;
 void			BKE_text_free		(struct Text *text);
 void 			txt_set_undostate	(int u);
 int 			txt_get_undostate	(void);
-struct Text*	BKE_text_add	(const char *name);
+struct Text*	BKE_text_add	(struct Main *bmain, const char *name);
 int				txt_extended_ascii_as_utf8(char **str);
 int				BKE_text_reload		(struct Text *text);
-struct Text*	BKE_text_load		(const char *file, const char *relpath);
+struct Text*	BKE_text_load	(struct Main *bmain, const char *file, const char *relpath);
 struct Text*	BKE_text_copy		(struct Text *ta);
 void			BKE_text_unlink		(struct Main *bmain, struct Text *text);
 void			BKE_text_clear      (struct Text *text);
@@ -66,8 +66,8 @@ void	txt_move_up			(struct Text *text, short sel);
 void	txt_move_down		(struct Text *text, short sel);
 void	txt_move_left		(struct Text *text, short sel);
 void	txt_move_right		(struct Text *text, short sel);
-void	txt_jump_left		(struct Text *text, short sel);
-void	txt_jump_right		(struct Text *text, short sel);
+void	txt_jump_left		(struct Text *text, bool sel, bool use_init_step);
+void	txt_jump_right		(struct Text *text, bool sel, bool use_init_step);
 void	txt_move_bof		(struct Text *text, short sel);
 void	txt_move_eof		(struct Text *text, short sel);
 void	txt_move_bol		(struct Text *text, short sel);
@@ -105,9 +105,14 @@ int text_check_bracket(const char ch);
 int text_check_delim(const char ch);
 int text_check_digit(const char ch);
 int text_check_identifier(const char ch);
+int text_check_identifier_nodigit(const char ch);
 int text_check_whitespace(const char ch);
 int text_find_identifier_start(const char *str, int i);
 
+/* defined in bpy_interface.c */
+extern int text_check_identifier_unicode(const unsigned int ch);
+extern int text_check_identifier_nodigit_unicode(const unsigned int ch);
+
 enum {
 	TXT_MOVE_LINE_UP   = -1,
 	TXT_MOVE_LINE_DOWN =  1
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index 78fdd26..f179637 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -44,6 +44,7 @@ struct EnvMap;
 struct HaloRen;
 struct Lamp;
 struct LampRen;
+struct Main;
 struct Material;
 struct MTex;
 struct OceanTex;
@@ -69,7 +70,7 @@ int colorband_element_remove(struct ColorBand *coba, int index);
 void colorband_update_sort(struct ColorBand *coba);
 
 void default_tex(struct Tex *tex);
-struct Tex *add_texture(const char *name);
+struct Tex *add_texture(struct Main *bmain, const char *name);
 void tex_set_type(struct Tex *tex, int type);
 void default_mtex(struct MTex *mtex);
 struct MTex *add_mtex(void);
diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h
index eb7004b..9bdc96e 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -46,6 +46,7 @@ struct MovieDistortion;
 struct Camera;
 struct Object;
 struct Scene;
+struct rcti;
 
 /* **** Common functions **** */
 
@@ -156,6 +157,8 @@ struct ImBuf *BKE_tracking_undistort_frame(struct MovieTracking *tracking, struc
 struct ImBuf *BKE_tracking_distort_frame(struct MovieTracking *tracking, struct ImBuf *ibuf,
                                          int calibration_width, int calibration_height, float overscan);
 
+void BKE_tracking_max_undistortion_delta_across_bound(struct MovieTracking *tracking, struct rcti *rect, float delta[2]);
+
 /* **** Image sampling **** */
 struct ImBuf *BKE_tracking_sample_pattern(int frame_width, int frame_height,
                                           struct ImBuf *struct_ibuf, struct MovieTrackingTrack *track,
diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h
index 7a23bff..6bb35e4 100644
--- a/source/blender/blenkernel/BKE_world.h
+++ b/source/blender/blenkernel/BKE_world.h
@@ -33,11 +33,12 @@
  *  \author nzc
  */
 
+struct Main;
 struct World;
 
 void BKE_world_free(struct World *sc);
 void BKE_world_free_ex(struct World *sc, int do_id_user);
-struct World *add_world(const char *name);
+struct World *add_world(struct Main *bmian, const char *name);
 struct World *BKE_world_copy(struct World *wrld);
 struct World *localize_world(struct World *wrld);
 void BKE_world_make_local(struct World *wrld);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index aca06a1..cb6da19 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -128,6 +128,7 @@ set(SRC
 	intern/pointcache.c
 	intern/property.c
 	intern/report.c
+	intern/rigidbody.c
 	intern/sca.c
 	intern/scene.c
 	intern/screen.c
@@ -219,6 +220,7 @@ set(SRC
 	BKE_pointcache.h
 	BKE_property.h
 	BKE_report.h
+	BKE_rigidbody.h
 	BKE_sca.h
 	BKE_scene.h
 	BKE_screen.h
@@ -261,7 +263,10 @@ if(WITH_BULLET)
 	list(APPEND INC_SYS
 		${BULLET_INCLUDE_DIRS}
 	)
-	add_definitions(-DUSE_BULLET)
+	list(APPEND INC
+		../../../intern/rigidbody
+	)
+	add_definitions(-DWITH_BULLET)
 endif()
 
 #if(WITH_MOD_CLOTH_ELTOPO)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index 0286172..aa7d8a5 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -41,6 +41,7 @@ incs += ' ../render/extern/include ../makesrna'
 incs += ' ../imbuf ../ikplugin ../avi #/intern/elbeem/extern ../nodes ../modifiers'
 incs += ' #/intern/iksolver/extern ../blenloader'
 incs += ' #/extern/bullet2/src'
+incs += ' #/intern/rigidbody'
 incs += ' #/intern/opennl/extern #/intern/bsp/extern'
 incs += ' ../gpu #/extern/glew/include'
 incs += ' ../bmesh'
@@ -110,7 +111,7 @@ if env['WITH_BF_QUICKTIME']:
     incs += ' ' + env['BF_QUICKTIME_INC']
 
 if env['WITH_BF_BULLET']:
-    defs.append('USE_BULLET')
+    defs.append('WITH_BULLET')
 
 if env['OURPLATFORM'] == 'darwin':
     if env['WITH_BF_OPENMP']:
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index cc20470..e58d484 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -16,12 +16,6 @@
 
 #include "BLI_utildefines.h" /* for BLI_assert */
 
-#ifdef _MSC_VER
-#  define CCG_INLINE __inline
-#else
-#  define CCG_INLINE inline
-#endif
-
 /* used for normalize_v3 in BLI_math_vector
  * float.h's FLT_EPSILON causes trouble with subsurf normals - campbell */
 #define EPSILON (1.0e-35f)
@@ -236,7 +230,7 @@ int ccg_gridsize(int level)
 {
 	BLI_assert(level > 0);
 	BLI_assert(level <= 31);
-         
+
 	return (1 << (level - 1)) + 1;
 }
 
@@ -305,7 +299,7 @@ struct CCGVert {
 //	byte *userData;
 };
 
-static CCG_INLINE byte *VERT_getLevelData(CCGVert *v)
+BLI_INLINE byte *VERT_getLevelData(CCGVert *v)
 {
 	return (byte *)(&(v)[1]);
 }
@@ -324,7 +318,7 @@ struct CCGEdge {
 //	byte *userData;
 };
 
-static CCG_INLINE byte *EDGE_getLevelData(CCGEdge *e)
+BLI_INLINE byte *EDGE_getLevelData(CCGEdge *e)
 {
 	return (byte *)(&(e)[1]);
 }
@@ -342,17 +336,17 @@ struct CCGFace {
 //	byte *userData;
 };
 
-static CCG_INLINE CCGVert **FACE_getVerts(CCGFace *f)
+BLI_INLINE CCGVert **FACE_getVerts(CCGFace *f)
 {
 	return (CCGVert **)(&f[1]);
 }
 
-static CCG_INLINE CCGEdge **FACE_getEdges(CCGFace *f)
+BLI_INLINE CCGEdge **FACE_getEdges(CCGFace *f)
 {
 	return (CCGEdge **)(&(FACE_getVerts(f)[f->numVerts]));
 }
 
-static CCG_INLINE byte *FACE_getCenterData(CCGFace *f)
+BLI_INLINE byte *FACE_getCenterData(CCGFace *f)
 {
 	return (byte *)(&(FACE_getEdges(f)[(f)->numVerts]));
 }
@@ -698,28 +692,28 @@ static CCGFace *_face_new(CCGFaceHDL fHDL, CCGVert **verts, CCGEdge **edges, int
 	return f;
 }
 
-static CCG_INLINE void *_face_getIECo(CCGFace *f, int lvl, int S, int x, int levels, int dataSize)
+BLI_INLINE void *_face_getIECo(CCGFace *f, int lvl, int S, int x, int levels, int dataSize)
 {
 	int maxGridSize = ccg_gridsize(levels);
 	int spacing = ccg_spacing(levels, lvl);
 	byte *gridBase = FACE_getCenterData(f) + dataSize * (1 + S * (maxGridSize + maxGridSize * maxGridSize));
 	return &gridBase[dataSize * x * spacing];
 }
-static CCG_INLINE void *_face_getIENo(CCGFace *f, int lvl, int S, int x, int levels, int dataSize, int normalDataOffset)
+BLI_INLINE void *_face_getIENo(CCGFace *f, int lvl, int S, int x, int levels, int dataSize, int normalDataOffset)
 {
 	int maxGridSize = ccg_gridsize(levels);
 	int spacing = ccg_spacing(levels, lvl);
 	byte *gridBase = FACE_getCenterData(f) + dataSize * (1 + S * (maxGridSize + maxGridSize * maxGridSize));
 	return &gridBase[dataSize * x * spacing + normalDataOffset];
 }
-static CCG_INLINE void *_face_getIFCo(CCGFace *f, int lvl, int S, int x, int y, int levels, int dataSize)
+BLI_INLINE void *_face_getIFCo(CCGFace *f, int lvl, int S, int x, int y, int levels, int dataSize)
 {
 	int maxGridSize = ccg_gridsize(levels);
 	int spacing = ccg_spacing(levels, lvl);
 	byte *gridBase = FACE_getCenterData(f) + dataSize * (1 + S * (maxGridSize + maxGridSize * maxGridSize));
 	return &gridBase[dataSize * (maxGridSize + (y * maxGridSize + x) * spacing)];
 }
-static CCG_INLINE float *_face_getIFNo(CCGFace *f, int lvl, int S, int x, int y, int levels, int dataSize, int normalDataOffset)
+BLI_INLINE float *_face_getIFNo(CCGFace *f, int lvl, int S, int x, int y, int levels, int dataSize, int normalDataOffset)
 {
 	int maxGridSize = ccg_gridsize(levels);
 	int spacing = ccg_spacing(levels, lvl);
@@ -742,7 +736,7 @@ static int _face_getEdgeIndex(CCGFace *f, CCGEdge *e)
 			return i;
 	return -1;
 }
-static CCG_INLINE void *_face_getIFCoEdge(CCGFace *f, CCGEdge *e, int f_ed_idx, int lvl, int eX, int eY, int levels, int dataSize)
+BLI_INLINE void *_face_getIFCoEdge(CCGFace *f, CCGEdge *e, int f_ed_idx, int lvl, int eX, int eY, int levels, int dataSize)
 {
 	int maxGridSize = ccg_gridsize(levels);
 	int spacing = ccg_spacing(levels, lvl);
@@ -1422,18 +1416,25 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
 		float no[3];
 
 		for (S = 0; S < f->numVerts; S++) {
-			for (y = 0; y < gridSize - 1; y++)
-				for (x = 0; x < gridSize - 1; x++)
+			for (y = 0; y < gridSize - 1; y++) {
+				for (x = 0; x < gridSize - 1; x++) {
 					NormZero(FACE_getIFNo(f, lvl, S, x, y));
+				}
+			}
 
-			if (FACE_getEdges(f)[(S - 1 + f->numVerts) % f->numVerts]->flags & Edge_eEffected)
-				for (x = 0; x < gridSize - 1; x++)
+			if (FACE_getEdges(f)[(S - 1 + f->numVerts) % f->numVerts]->flags & Edge_eEffected) {
+				for (x = 0; x < gridSize - 1; x++) {
 					NormZero(FACE_getIFNo(f, lvl, S, x, gridSize - 1));
-			if (FACE_getEdges(f)[S]->flags & Edge_eEffected)
-				for (y = 0; y < gridSize - 1; y++)
+				}
+			}
+			if (FACE_getEdges(f)[S]->flags & Edge_eEffected) {
+				for (y = 0; y < gridSize - 1; y++) {
 					NormZero(FACE_getIFNo(f, lvl, S, gridSize - 1, y));
-			if (FACE_getVerts(f)[S]->flags & Vert_eEffected)
+				}
+			}
+			if (FACE_getVerts(f)[S]->flags & Vert_eEffected) {
 				NormZero(FACE_getIFNo(f, lvl, S, gridSize - 1, gridSize - 1));
+			}
 		}
 
 		for (S = 0; S < f->numVerts; S++) {
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index dde1d58..8e74007 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -169,7 +169,7 @@ static MPoly *dm_getPolyArray(DerivedMesh *dm)
 
 static MVert *dm_dupVertArray(DerivedMesh *dm)
 {
-	MVert *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumVerts(dm),
+	MVert *tmp = MEM_mallocN(sizeof(*tmp) * dm->getNumVerts(dm),
 	                         "dm_dupVertArray tmp");
 
 	if (tmp) dm->copyVertArray(dm, tmp);
@@ -179,7 +179,7 @@ static MVert *dm_dupVertArray(DerivedMesh *dm)
 
 static MEdge *dm_dupEdgeArray(DerivedMesh *dm)
 {
-	MEdge *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumEdges(dm),
+	MEdge *tmp = MEM_mallocN(sizeof(*tmp) * dm->getNumEdges(dm),
 	                         "dm_dupEdgeArray tmp");
 
 	if (tmp) dm->copyEdgeArray(dm, tmp);
@@ -189,7 +189,7 @@ static MEdge *dm_dupEdgeArray(DerivedMesh *dm)
 
 static MFace *dm_dupFaceArray(DerivedMesh *dm)
 {
-	MFace *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumTessFaces(dm),
+	MFace *tmp = MEM_mallocN(sizeof(*tmp) * dm->getNumTessFaces(dm),
 	                         "dm_dupFaceArray tmp");
 
 	if (tmp) dm->copyTessFaceArray(dm, tmp);
@@ -199,7 +199,7 @@ static MFace *dm_dupFaceArray(DerivedMesh *dm)
 
 static MLoop *dm_dupLoopArray(DerivedMesh *dm)
 {
-	MLoop *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumLoops(dm),
+	MLoop *tmp = MEM_mallocN(sizeof(*tmp) * dm->getNumLoops(dm),
 	                         "dm_dupLoopArray tmp");
 
 	if (tmp) dm->copyLoopArray(dm, tmp);
@@ -209,7 +209,7 @@ static MLoop *dm_dupLoopArray(DerivedMesh *dm)
 
 static MPoly *dm_dupPolyArray(DerivedMesh *dm)
 {
-	MPoly *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumPolys(dm),
+	MPoly *tmp = MEM_mallocN(sizeof(*tmp) * dm->getNumPolys(dm),
 	                         "dm_dupPolyArray tmp");
 
 	if (tmp) dm->copyPolyArray(dm, tmp);
@@ -562,6 +562,13 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
 		tmp.key = NULL;
 	}
 
+	/* Clear selection history */
+	tmp.mselect = NULL;
+	tmp.totselect = 0;
+	if (me->mselect) {
+		MEM_freeN(me->mselect);
+	}
+
 	*me = tmp;
 }
 
@@ -574,7 +581,7 @@ void DM_to_meshkey(DerivedMesh *dm, Mesh *me, KeyBlock *kb)
 	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->data = MEM_mallocN(me->key->elemsize * me->totvert, "kb->data");
 	kb->totelem = totvert;
 	
 	fp = kb->data;
@@ -1584,9 +1591,15 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
 					DM_add_edge_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
 					DM_add_poly_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
 
-					range_vn_i(DM_get_vert_data_layer(dm, CD_ORIGINDEX), dm->numVertData, 0);
-					range_vn_i(DM_get_edge_data_layer(dm, CD_ORIGINDEX), dm->numEdgeData, 0);
-					range_vn_i(DM_get_poly_data_layer(dm, CD_ORIGINDEX), dm->numPolyData, 0);
+#pragma omp parallel sections if (dm->numVertData + dm->numEdgeData + dm->numPolyData >= DM_OMP_LIMIT)
+					{
+#pragma omp section
+						{ range_vn_i(DM_get_vert_data_layer(dm, CD_ORIGINDEX), dm->numVertData, 0); }
+#pragma omp section
+						{ range_vn_i(DM_get_edge_data_layer(dm, CD_ORIGINDEX), dm->numEdgeData, 0); }
+#pragma omp section
+						{ range_vn_i(DM_get_poly_data_layer(dm, CD_ORIGINDEX), dm->numPolyData, 0); }
+					}
 				}
 			}
 
@@ -2353,15 +2366,14 @@ DMCoNo *mesh_get_mapped_verts_nors(Scene *scene, Object *ob)
 		return NULL;
 	
 	dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX);
-	vertexcosnos = MEM_callocN(sizeof(DMCoNo) * me->totvert, "vertexcosnos map");
 	
 	if (dm->foreachMappedVert) {
+		vertexcosnos = MEM_callocN(sizeof(DMCoNo) * me->totvert, "vertexcosnos map");
 		dm->foreachMappedVert(dm, make_vertexcosnos__mapFunc, vertexcosnos);
 	}
 	else {
-		DMCoNo *v_co_no = vertexcosnos;
+		DMCoNo *v_co_no = vertexcosnos = MEM_mallocN(sizeof(DMCoNo) * me->totvert, "vertexcosnos map");
 		int a;
-		
 		for (a = 0; a < me->totvert; a++, v_co_no++) {
 			dm->getVertCo(dm, a, v_co_no->co);
 			dm->getVertNo(dm, a, v_co_no->no);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 63e12df..509442b 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -78,11 +78,11 @@
 
 /* ***************** Library data level operations on action ************** */
 
-bAction *add_empty_action(const char name[])
+bAction *add_empty_action(Main *bmain, const char name[])
 {
 	bAction *act;
 	
-	act = BKE_libblock_alloc(&G.main->action, ID_AC, name);
+	act = BKE_libblock_alloc(&bmain->action, ID_AC, name);
 	
 	return act;
 }	
@@ -1118,18 +1118,18 @@ void BKE_pose_rest(bPose *pose)
 }
 
 /* both poses should be in sync */
-void BKE_pose_copy_result(bPose *to, bPose *from)
+bool BKE_pose_copy_result(bPose *to, bPose *from)
 {
 	bPoseChannel *pchanto, *pchanfrom;
 	
 	if (to == NULL || from == NULL) {
-		printf("pose result copy error to:%p from:%p\n", (void *)to, (void *)from); /* debug temp */
-		return;
+		printf("Pose copy error, pose to:%p from:%p\n", (void *)to, (void *)from); /* debug temp */
+		return false;
 	}
 
 	if (to == from) {
 		printf("BKE_pose_copy_result source and target are the same\n");
-		return;
+		return false;
 	}
 
 
@@ -1153,6 +1153,7 @@ void BKE_pose_copy_result(bPose *to, bPose *from)
 			pchanto->protectflag = pchanfrom->protectflag;
 		}
 	}
+	return true;
 }
 
 /* For the calculation of the effects of an Action at the given frame on an object 
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 4058809..a6b3008 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -69,6 +69,7 @@
 #include "BKE_depsgraph.h"
 #include "BKE_anim.h"
 #include "BKE_report.h"
+#include "BKE_rigidbody.h"
 
 
 // XXX bad level call...
@@ -311,7 +312,7 @@ static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets)
 				BLI_addhead(&scene->base, base);
 				
 				mpt->ob->flag |= BA_TEMP_TAG;
-
+				
 				/* we really don't need to continue anymore once this happens, but this line might really 'break' */
 				break;
 			}
@@ -327,6 +328,7 @@ static void motionpaths_calc_update_scene(Scene *scene)
 {
 #if 1 // 'production' optimizations always on
 	Base *base, *last = NULL;
+	float ctime = BKE_scene_frame_get(scene);
 	
 	/* only stuff that moves or needs display still */
 	DAG_scene_update_flags(G.main, scene, scene->lay, TRUE);
@@ -340,6 +342,14 @@ static void motionpaths_calc_update_scene(Scene *scene)
 			last = base;
 	}
 	
+	/* run rigidbody sim 
+	 * NOTE: keep in sync with BKE_scene_update_for_newframe() in scene.c
+	 */
+	// XXX: this position may still change, objects not being updated correctly before simulation is run
+	// NOTE: current position is so that rigidbody sim affects other objects
+	if (BKE_scene_check_rigidbody_active(scene))
+		BKE_rigidbody_do_simulation(scene, ctime);
+	
 	/* perform updates for tagged objects */
 	/* XXX: this will break if rigs depend on scene or other data that
 	 * is animated but not attached to/updatable from objects */
@@ -957,7 +967,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
 		dm = editbmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
 	}
 	else
-		dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH);
+		dm = mesh_get_derived_final(scene, par, CD_MASK_BAREMESH);
 	
 	if (flag & DUPLILIST_FOR_RENDER) {
 		vdd.orco = (float(*)[3])BKE_mesh_orco_verts_get(par);
@@ -1084,7 +1094,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
 		dm = editbmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
 	}
 	else {
-		dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH);
+		dm = mesh_get_derived_final(scene, par, CD_MASK_BAREMESH);
 	}
 
 	totface = dm->getNumPolys(dm);
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 40b883e..74e44ea 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -499,15 +499,15 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
 	if (srcAdt->action) {
 		/* set up an action if necessary, and name it in a similar way so that it can be easily found again */
 		if (dstAdt->action == NULL) {
-			dstAdt->action = add_empty_action(srcAdt->action->id.name + 2);
+			dstAdt->action = add_empty_action(G.main, srcAdt->action->id.name + 2);
 		}
 		else if (dstAdt->action == srcAdt->action) {
 			printf("Argh! Source and Destination share animation! ('%s' and '%s' both use '%s') Making new empty action\n",
 			       srcID->name, dstID->name, srcAdt->action->id.name);
-
+			
 			/* TODO: review this... */
 			id_us_min(&dstAdt->action->id);
-			dstAdt->action = add_empty_action(dstAdt->action->id.name + 2);
+			dstAdt->action = add_empty_action(G.main, dstAdt->action->id.name + 2);
 		}
 			
 		/* loop over base paths, trying to fix for each one... */
@@ -533,9 +533,9 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
 					/* just need to change lists */
 					BLI_remlink(&srcAdt->drivers, fcu);
 					BLI_addtail(&dstAdt->drivers, fcu);
-
+					
 					/* TODO: add depsgraph flushing calls? */
-
+					
 					/* can stop now, as moved already */
 					break;
 				}
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index ad14dee..480814a 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -74,11 +74,11 @@
 
 /* **************** Generic Functions, data level *************** */
 
-bArmature *BKE_armature_add(const char *name)
+bArmature *BKE_armature_add(Main *bmain, const char *name)
 {
 	bArmature *arm;
 
-	arm = BKE_libblock_alloc(&G.main->armature, ID_AR, name);
+	arm = BKE_libblock_alloc(&bmain->armature, ID_AR, name);
 	arm->deformflag = ARM_DEF_VGROUP | ARM_DEF_ENVELOPE;
 	arm->flag = ARM_COL_CUSTOM; /* custom bone-group colors */
 	arm->layer = 1;
@@ -1655,7 +1655,8 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
 		else {
 			/* always copy custom shape */
 			pchan->custom = pchanp->custom;
-			pchan->custom_tx = pchanp->custom_tx;
+			if (pchanp->custom_tx)
+				pchan->custom_tx = BKE_pose_channel_find_name(pose, pchanp->custom_tx->name);
 
 			/* ID-Property Syncing */
 			{
@@ -2258,7 +2259,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
 {
 	bActionModifier *amod;
 	bActionStrip *strip, *strip2;
-	float scene_cfra = (float)scene->r.cfra;
+	float scene_cfra = BKE_scene_frame_get(scene);
 	int do_modif;
 
 	for (strip = armob->nlastrips.first; strip; strip = strip->next) {
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 11ae242..fb2d1a3 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -426,6 +426,9 @@ void BKE_userdef_free(void)
 /* handle changes in settings that need recalc */
 void BKE_userdef_state(void)
 {
+	/* prevent accidents */
+	if (U.pixelsize == 0) U.pixelsize = 1;
+	
 	BLF_default_dpi(U.pixelsize * U.dpi);
 	U.widget_unit = (U.pixelsize * U.dpi * 20 + 36) / 72;
 
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index bb610ed..b002105 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -459,6 +459,10 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
 					OceanModifierData *omd = (OceanModifierData *) md;
 					rewrite_path_fixed(omd->cachepath, visit_cb, absbase, bpath_user_data);
 				}
+				else if (md->type == eModifierType_MeshCache) {
+					MeshCacheModifierData *mcmd = (MeshCacheModifierData *) md;
+					rewrite_path_fixed(mcmd->filepath, visit_cb, absbase, bpath_user_data);
+				}
 			}
 
 			if (ob->soft) {
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index aeb0407..ba69fa4 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -109,11 +109,11 @@ static void brush_defaults(Brush *brush)
 
 /* Datablock add/copy/free/make_local */
 
-Brush *BKE_brush_add(const char *name)
+Brush *BKE_brush_add(Main *bmain, const char *name)
 {
 	Brush *brush;
 
-	brush = BKE_libblock_alloc(&G.main->brush, ID_BR, name);
+	brush = BKE_libblock_alloc(&bmain->brush, ID_BR, name);
 
 	/* enable fake user by default */
 	brush->id.flag |= LIB_FAKEUSER;
@@ -259,7 +259,6 @@ void BKE_brush_debug_print_state(Brush *br)
 	BR_TEST_FLAG(BRUSH_SIZE_PRESSURE);
 	BR_TEST_FLAG(BRUSH_JITTER_PRESSURE);
 	BR_TEST_FLAG(BRUSH_SPACING_PRESSURE);
-	BR_TEST_FLAG(BRUSH_FIXED_TEX);
 	BR_TEST_FLAG(BRUSH_RAKE);
 	BR_TEST_FLAG(BRUSH_ANCHORED);
 	BR_TEST_FLAG(BRUSH_DIR_IN);
@@ -420,7 +419,7 @@ int BKE_brush_texture_set_nr(Brush *brush, int nr)
 	idtest = (ID *)BLI_findlink(&G.main->tex, nr - 1);
 	if (idtest == NULL) { /* new tex */
 		if (id) idtest = (ID *)BKE_texture_copy((Tex *)id);
-		else idtest = (ID *)add_texture("Tex");
+		else idtest = (ID *)add_texture(G.main, "Tex");
 		idtest->us--;
 	}
 	if (idtest != id) {
@@ -472,8 +471,49 @@ int BKE_brush_clone_image_delete(Brush *brush)
 	return 0;
 }
 
-/* Brush Sampling */
-void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], const int thread)
+/* Brush Sampling for 3d brushes. Currently used for texture painting only, but should be generalized */
+void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float sampleco[3], float rgba[4], const int thread, struct ImagePool *pool)
+{
+	MTex *mtex = &brush->mtex;
+
+	if (mtex && mtex->tex) {
+		float tin, tr, tg, tb, ta;
+		int hasrgb;
+		const int radius = BKE_brush_size_get(scene, brush);
+
+		if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) {
+			hasrgb = externtex(mtex, sampleco, &tin, &tr, &tg, &tb, &ta, thread, pool);
+		}
+		else {
+			float co[3];
+
+			co[0] = sampleco[0] / radius;
+			co[1] = sampleco[1] / radius;
+			co[2] = 0.0f;
+
+			hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, thread, pool);
+		}
+
+		if (hasrgb) {
+			rgba[0] = tr;
+			rgba[1] = tg;
+			rgba[2] = tb;
+			rgba[3] = ta;
+		}
+		else {
+			rgba[0] = tin;
+			rgba[1] = tin;
+			rgba[2] = tin;
+			rgba[3] = 1.0f;
+		}
+	}
+	else {
+		rgba[0] = rgba[1] = rgba[2] = rgba[3] = 1.0f;
+	}
+}
+
+/* Brush Sampling for 2D brushes. when we unify the brush systems this will be necessarily a separate function */
+void BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], const int thread)
 {
 	MTex *mtex = &brush->mtex;
 
@@ -486,7 +526,7 @@ void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], f
 		co[1] = xy[1] / radius;
 		co[2] = 0.0f;
 
-		hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, thread);
+		hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, thread, NULL);
 
 		if (hasrgb) {
 			rgba[0] = tr;
@@ -506,7 +546,8 @@ void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], f
 	}
 }
 
-/* TODO, use define for 'texfall' arg */
+/* TODO, use define for 'texfall' arg
+ * NOTE: only used for 2d brushes currently! */
 void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction)
 {
 	ImBuf *ibuf;
@@ -545,13 +586,18 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
 					dstf[3] = alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
 				}
 				else if (texfall == 1) {
-					BKE_brush_sample_tex(scene, brush, xy, dstf, 0);
+					BKE_brush_sample_tex_2D(scene, brush, xy, dstf, 0);
 				}
-				else {
-					BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
+				else if (texfall == 2) {
+					BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
 					mul_v3_v3v3(dstf, rgba, brush_rgb);
 					dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
 				}
+				else {
+					BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
+					copy_v3_v3(dstf, brush_rgb);
+					dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
+				}
 			}
 		}
 	}
@@ -575,11 +621,11 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
 					dst[3] = FTOCHAR(alpha_f);
 				}
 				else if (texfall == 1) {
-					BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
+					BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
 					rgba_float_to_uchar(dst, rgba);
 				}
 				else if (texfall == 2) {
-					BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
+					BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
 					mul_v3_v3(rgba, brush->rgb);
 					alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
 
@@ -588,7 +634,7 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
 					dst[3] = FTOCHAR(alpha_f);
 				}
 				else {
-					BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
+					BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
 					alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
 
 					dst[0] = crgb[0];
@@ -615,13 +661,15 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
  * available.  my ussual solution to this is to use the
  * ratio of change of the size to change the unprojected
  * radius.  Not completely convinced that is correct.
- * In anycase, a better solution is needed to prevent
+ * In any case, a better solution is needed to prevent
  * inconsistency. */
 
 void BKE_brush_size_set(Scene *scene, Brush *brush, int size)
 {
 	UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
-
+	
+	size = (int)((float)size / U.pixelsize);
+	
 	if (ups->flag & UNIFIED_PAINT_SIZE)
 		ups->size = size;
 	else
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index ad828a7..5028d97 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -38,11 +38,11 @@
 
 #include "BLI_utildefines.h"
 #include "BLI_linklist.h"
+#include "BLI_math.h"
 
 #include "BKE_DerivedMesh.h"
 #include "BKE_tessmesh.h"
 
-#include "BLI_math.h"
 #include "MEM_guardedalloc.h"
 
 /* Math stuff for ray casting on mesh faces and for nearest surface */
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 57c8891..34c2d14 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -50,11 +50,11 @@
 
 /****************************** Camera Datablock *****************************/
 
-void *BKE_camera_add(const char *name)
+void *BKE_camera_add(Main *bmain, const char *name)
 {
 	Camera *cam;
 	
-	cam =  BKE_libblock_alloc(&G.main->camera, ID_CA, name);
+	cam =  BKE_libblock_alloc(&bmain->camera, ID_CA, name);
 
 	cam->lens = 35.0f;
 	cam->sensor_x = DEFAULT_SENSOR_WIDTH;
@@ -237,6 +237,9 @@ void BKE_camera_params_from_object(CameraParams *params, Object *ob)
 		params->clipsta = la->clipsta;
 		params->clipend = la->clipend;
 	}
+	else {
+		params->lens = 35.0f;
+	}
 }
 
 void BKE_camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *rv3d)
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 85dd4c6..7f2d943 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1111,6 +1111,19 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
 		index_mp_to_orig = NULL;
 	}
 
+	/* TODO: same as for solid draw, not entirely correct, but works fine for now,
+	 *       will skip using textures (dyntopo currently destroys UV anyway) and
+	 *       works fine for matcap
+	 */
+	if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
+		if (dm->numTessFaceData) {
+			setMaterial(1, &gattribs);
+			BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+		}
+
+		return;
+	}
+
 	cdDM_update_normals_from_pbvh(dm);
 
 	matnr = -1;
@@ -1412,6 +1425,19 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
 		index_mp_to_orig = NULL;
 	}
 
+	/* TODO: same as for solid draw, not entirely correct, but works fine for now,
+	 *       will skip using textures (dyntopo currently destroys UV anyway) and
+	 *       works fine for matcap
+	 */
+	if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
+		if (dm->numTessFaceData) {
+			setMaterial(userData, 1, &gattribs);
+			BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+		}
+
+		return;
+	}
+
 	cdDM_update_normals_from_pbvh(dm);
 
 	matnr = -1;
@@ -2285,6 +2311,7 @@ void CDDM_calc_normals_tessface(DerivedMesh *dm)
  */
 DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
 {
+// #define USE_LOOPS
 	CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
 	CDDerivedMesh *cddm2 = NULL;
 	MVert *mv, *mvert = NULL;
@@ -2296,18 +2323,27 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
 	MLoop *ml, *mloop = NULL;
 	BLI_array_declare(mloop);
 	EdgeHash *ehash = BLI_edgehash_new();
-	int *newv = NULL, *newe = NULL, *newl = NULL;
+	int *newv = NULL, *newe = NULL;
+#ifdef USE_LOOPS
+	int *newl = NULL;
+#endif
 	int *oldv = NULL, *olde = NULL, *oldl = NULL, *oldp = NULL;
 	BLI_array_declare(oldv); BLI_array_declare(olde); BLI_array_declare(oldl); BLI_array_declare(oldp);
-	int i, j, c, totloop, totpoly;
-	
+	int i, j, c, totpoly;
+#ifdef USE_LOOPS
+	int totloop;
+#endif
+
+#ifdef USE_LOOPS
 	totloop = dm->numLoopData;
+#endif
 	totpoly = dm->numPolyData;
 	
-	newv = MEM_callocN(sizeof(int) * dm->numVertData, "newv vtable CDDM_merge_verts");
-	newe = MEM_callocN(sizeof(int) * dm->numEdgeData, "newv etable CDDM_merge_verts");
-	newl = MEM_callocN(sizeof(int) * totloop, "newv ltable CDDM_merge_verts");
-	
+	newv = MEM_mallocN(sizeof(int) * dm->numVertData, "newv vtable CDDM_merge_verts");
+	newe = MEM_mallocN(sizeof(int) * dm->numEdgeData, "newv etable CDDM_merge_verts");
+#ifdef USE_LOOPS
+	newl = MEM_mallocN(sizeof(int) * totloop, "newv ltable CDDM_merge_verts");
+#endif
 	/* fill newl with destination vertex indices */
 	mv = cddm->mvert;
 	c = 0;
@@ -2317,6 +2353,10 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
 			newv[i] = c++;
 			BLI_array_append(mvert, *mv);
 		}
+		else {
+			/* dummy value */
+			newv[i] = 0;
+		}
 	}
 	
 	/* now link target vertices to destination indices */
@@ -2385,7 +2425,9 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
 		for (j = 0; j < mp->totloop; j++, ml++) {
 			med = cddm->medge + ml->e;
 			if (LIKELY(med->v1 != med->v2)) {
+#ifdef USE_LOOPS
 				newl[j + mp->loopstart] = BLI_array_count(mloop);
+#endif
 				BLI_array_append(oldl, j + mp->loopstart);
 				BLI_array_append(mloop, *ml);
 				c++;
@@ -2451,8 +2493,10 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
 		MEM_freeN(newv); 
 	if (newe)
 		MEM_freeN(newe); 
+#ifdef USE_LOOPS
 	if (newl)
 		MEM_freeN(newl);
+#endif
 	if (oldv) 
 		MEM_freeN(oldv); 
 	if (olde) 
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index fdd7dc9..c129354 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -483,7 +483,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
 	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() || ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe))) {
+	if ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe)) {
 		BKE_ptcache_invalidate(cache);
 
 		/* do simulation */
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 60bf67e..061657c 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -59,7 +59,7 @@
 #include "BKE_modifier.h"
 
 #include "BKE_DerivedMesh.h"
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "Bullet-C-Api.h"
 #endif
 #include "BLI_kdopbvh.h"
@@ -385,7 +385,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2,
 	CollisionModifierData *collmd = (CollisionModifierData *) md2;
 	/* Cloth *cloth = clmd->clothObject; */ /* UNUSED */
 	MFace *face1=NULL, *face2 = NULL;
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	ClothVertex *verts1 = clmd->clothObject->verts;
 #endif
 	double distance = 0;
@@ -458,7 +458,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2,
 			}
 		}
 		
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 		// calc distance + normal
 		distance = plNearestPoints (
 			verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa, collpair->pb, collpair->vector );
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 529fe07..d08c16e 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -895,7 +895,7 @@ void curvemapping_table_RGBA(const CurveMapping *cumap, float **array, int *size
 
 #define INV_255     (1.f / 255.f)
 
-DO_INLINE int get_bin_float(float f)
+BLI_INLINE int get_bin_float(float f)
 {
 	int bin = (int)((f * 255.0f) + 0.5f);  /* 0.5 to prevent quantisation differences */
 
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index a45afa5..a9e3d52 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -48,6 +48,8 @@
 #include "BLI_threads.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_main.h"
 #include "BKE_screen.h"
@@ -851,7 +853,7 @@ void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
 
 const char *CTX_wm_operator_poll_msg_get(bContext *C)
 {
-	return C->wm.operator_poll_msg;
+	return IFACE_(C->wm.operator_poll_msg);
 }
 
 /* data context */
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index a9c4a7d..7d6212f 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -167,11 +167,11 @@ void BKE_curve_free(Curve *cu)
 		MEM_freeN(cu->tb);
 }
 
-Curve *BKE_curve_add(const char *name, int type)
+Curve *BKE_curve_add(Main *bmain, const char *name, int type)
 {
 	Curve *cu;
 
-	cu = BKE_libblock_alloc(&G.main->curve, ID_CU, name);
+	cu = BKE_libblock_alloc(&bmain->curve, ID_CU, name);
 	copy_v3_fl(cu->size, 1.0f);
 	cu->flag = CU_FRONT | CU_BACK | CU_DEFORM_BOUNDS_OFF | CU_PATH_RADIUS;
 	cu->pathlen = 100;
@@ -2220,6 +2220,7 @@ void BKE_curve_bevelList_make(Object *ob)
 	struct bevelsort *sortdata, *sd, *sd1;
 	int a, b, nr, poly, resolu = 0, len = 0;
 	int do_tilt, do_radius, do_weight;
+	int is_editmode = 0;
 
 	/* this function needs an object, because of tflag and upflag */
 	cu = ob->data;
@@ -2233,12 +2234,17 @@ void BKE_curve_bevelList_make(Object *ob)
 	if (cu->editnurb && ob->type != OB_FONT) {
 		ListBase *nurbs = BKE_curve_editNurbs_get(cu);
 		nu = nurbs->first;
+		is_editmode = 1;
 	}
 	else {
 		nu = cu->nurb.first;
 	}
 
-	while (nu) {
+	for (; nu; nu = nu->next) {
+		
+		if (nu->hide && is_editmode)
+			continue;
+		
 		/* check if we will calculate tilt data */
 		do_tilt = CU_DO_TILT(cu, nu);
 		do_radius = CU_DO_RADIUS(cu, nu); /* normal display uses the radius, better just to calculate them */
@@ -2384,7 +2390,6 @@ void BKE_curve_bevelList_make(Object *ob)
 				}
 			}
 		}
-		nu = nu->next;
 	}
 
 	/* STEP 2: DOUBLE POINTS AND AUTOMATIC RESOLUTION, REDUCE DATABLOCKS */
@@ -3431,7 +3436,9 @@ int BKE_curve_center_median(Curve *cu, float cent[3])
 		}
 	}
 
-	mul_v3_fl(cent, 1.0f / (float)total);
+	if (total) {
+		mul_v3_fl(cent, 1.0f / (float)total);
+	}
 
 	return (total != 0);
 }
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index f3548f7..580a694 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1242,12 +1242,15 @@ void CustomData_update_typemap(CustomData *data)
 	}
 }
 
+/* currently only used in BLI_assert */
+#ifndef NDEBUG
 static int customdata_typemap_is_valid(const CustomData *data)
 {
 	CustomData data_copy = *data;
 	CustomData_update_typemap(&data_copy);
 	return (memcmp(data->typemap, data_copy.typemap, sizeof(data->typemap)) == 0);
 }
+#endif
 
 void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
                       CustomDataMask mask, int alloctype, int totelem)
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index cea92d5..de15100 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -809,7 +809,7 @@ void BKE_defvert_array_copy(MDeformVert *dst, const MDeformVert *src, int copyco
 
 }
 
-void BKE_defvert_array_free(MDeformVert *dvert, int totvert)
+void BKE_defvert_array_free_elems(MDeformVert *dvert, int totvert)
 {
 	/* Instead of freeing the verts directly,
 	 * call this function to delete any special
@@ -823,6 +823,18 @@ void BKE_defvert_array_free(MDeformVert *dvert, int totvert)
 	for (i = 0; i < totvert; i++) {
 		if (dvert[i].dw) MEM_freeN(dvert[i].dw);
 	}
-	MEM_freeN(dvert);
 }
 
+void BKE_defvert_array_free(MDeformVert *dvert, int totvert)
+{
+	/* Instead of freeing the verts directly,
+	 * call this function to delete any special
+	 * vert data */
+	if (!dvert)
+		return;
+
+	/* Free any special data from the verts */
+	BKE_defvert_array_free_elems(dvert, totvert);
+
+	MEM_freeN(dvert);
+}
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 4238956..99d0c5e 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -424,7 +424,7 @@ static void dag_add_lamp_driver_relations(DagForest *dag, DagNode *node, Lamp *l
 		dag_add_shader_nodetree_driver_relations(dag, node, la->nodetree);
 }
 
-static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Object *ob, DagNode *node, int skip_forcefield)
+static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Object *ob, DagNode *node, int skip_forcefield, bool no_collision)
 {
 	Base *base;
 	DagNode *node2;
@@ -435,7 +435,7 @@ static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Objec
 		if ((base->lay & ob->lay) && base->object->pd) {
 			Object *ob1 = base->object;
 			if ((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) {
-				if (skip_forcefield && ob1->pd->forcefield == skip_forcefield)
+				if ((skip_forcefield && ob1->pd->forcefield == skip_forcefield) || (no_collision && ob1->pd->forcefield == 0))
 					continue;
 				node2 = dag_get_node(dag, ob1);
 				dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Field Collision");
@@ -599,10 +599,13 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
 		    modifiers_isModifierEnabled(ob, eModifierType_Cloth) ||
 		    modifiers_isModifierEnabled(ob, eModifierType_DynamicPaint))
 		{
-			dag_add_collision_field_relation(dag, scene, ob, node, 0);  /* TODO: use effectorweight->group */
+			dag_add_collision_field_relation(dag, scene, ob, node, 0, false);  /* TODO: use effectorweight->group */
 		}
 		else if (modifiers_isModifierEnabled(ob, eModifierType_Smoke)) {
-			dag_add_collision_field_relation(dag, scene, ob, node, PFIELD_SMOKEFLOW);
+			dag_add_collision_field_relation(dag, scene, ob, node, PFIELD_SMOKEFLOW, false);
+		}
+		else if (ob->rigidbody_object) {
+			dag_add_collision_field_relation(dag, scene, ob, node, 0, true);
 		}
 	}
 	
@@ -2290,7 +2293,7 @@ static short animdata_use_time(AnimData *adt)
 	return 0;
 }
 
-static void dag_object_time_update_flags(Object *ob)
+static void dag_object_time_update_flags(Scene *scene, Object *ob)
 {
 	if (ob->constraints.first) {
 		bConstraint *con;
@@ -2350,6 +2353,10 @@ static void dag_object_time_update_flags(Object *ob)
 	if (object_modifiers_use_time(ob)) ob->recalc |= OB_RECALC_DATA;
 	if ((ob->pose) && (ob->pose->flag & POSE_CONSTRAINTS_TIMEDEPEND)) ob->recalc |= OB_RECALC_DATA;
 	
+	// XXX: scene here may not be the scene that contains the rigidbody world affecting this!
+	if (ob->rigidbody_object && BKE_scene_check_rigidbody_active(scene))
+		ob->recalc |= OB_RECALC_OB;
+	
 	{
 		AnimData *adt = BKE_animdata_from_id((ID *)ob->data);
 		Mesh *me;
@@ -2434,7 +2441,11 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const s
 		if (do_time) {
 			/* now if DagNode were part of base, the node->lay could be checked... */
 			/* we do all now, since the scene_flush checks layers and clears recalc flags even */
-			dag_object_time_update_flags(ob);
+			
+			/* NOTE: "sce_iter" not "scene" so that rigidbodies in background scenes work 
+			 * (i.e. muting + rbw availability can be checked and tagged properly) [#33970] 
+			 */
+			dag_object_time_update_flags(sce_iter, ob);
 		}
 
 		/* handled in next loop */
@@ -2447,7 +2458,7 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const s
 		for (group = bmain->group.first; group; group = group->id.next) {
 			if (group->id.flag & LIB_DOIT) {
 				for (go = group->gobject.first; go; go = go->next) {
-					dag_object_time_update_flags(go->ob);
+					dag_object_time_update_flags(scene, go->ob);
 				}
 			}
 		}
@@ -2466,7 +2477,7 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const s
 
 		/* hrmf... an exception to look at once, for invisible camera object we do it over */
 		if (scene->camera)
-			dag_object_time_update_flags(scene->camera);
+			dag_object_time_update_flags(scene, scene->camera);
 	}
 
 	/* and store the info in groupobject */
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 643c7b1..6f85d4d 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -63,6 +63,7 @@
 #include "BLO_sys_types.h" // for intptr_t support
 
 static void boundbox_displist(Object *ob);
+static void boundbox_dispbase(BoundBox *bb, ListBase *dispbase);
 
 void BKE_displist_elem_free(DispList *dl)
 {
@@ -309,10 +310,11 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
 	BPoint *bp;
 	float *data;
 	int a, len, resolu;
+	const int editmode = (!forRender && (cu->editnurb || cu->editfont));
 
 	nu = nubase->first;
 	while (nu) {
-		if (nu->hide == 0) {
+		if (nu->hide == 0 || editmode == 0) {
 			if (forRender && cu->resolu_ren != 0)
 				resolu = cu->resolu_ren;
 			else
@@ -505,7 +507,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, int flipnormal)
 			dl = dl->next;
 		}
 
-		/* XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) { */
+		/* XXX (obedit && obedit->actcol) ? (obedit->actcol-1) : 0)) { */
 		if (totvert && (tot = BLI_scanfill_calc(&sf_ctx, BLI_SCANFILL_CALC_REMOVE_DOUBLES | BLI_SCANFILL_CALC_HOLES))) {
 			if (tot) {
 				dlnew = MEM_callocN(sizeof(DispList), "filldisplist");
@@ -757,7 +759,7 @@ static ModifierData *curve_get_tessellate_point(Scene *scene, Object *ob, int fo
 
 			/* this modifiers are moving point of tessellation automatically
 			 * (some of them even can't be applied on tessellated curve), set flag
-			 * for incformation button in modifier's header
+			 * for information button in modifier's header
 			 */
 			md->mode |= eModifierMode_ApplyOnSpline;
 		}
@@ -1597,15 +1599,15 @@ void BKE_displist_make_curveTypes(Scene *scene, Object *ob, int forOrco)
 
 	if (ob->derivedFinal) {
 		DM_set_object_boundbox(ob, ob->derivedFinal);
+
+		/* always keep curve's  BB in sync with non-deformed displist */
+		if (cu->bb == NULL)
+			cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
+
+		boundbox_dispbase(cu->bb, &cu->disp);
 	}
 	else {
 		boundbox_displist(ob);
-
-		/* if there is no derivedMesh, object's boundbox is unneeded */
-		if (ob->bb) {
-			MEM_freeN(ob->bb);
-			ob->bb = NULL;
-		}
 	}
 }
 
@@ -1641,42 +1643,50 @@ float *BKE_displist_make_orco(Scene *scene, Object *ob, DerivedMesh *derivedFina
 	return orco;
 }
 
-/* this is confusing, there's also min_max_object, appplying the obmat... */
-static void boundbox_displist(Object *ob)
+static void boundbox_dispbase(BoundBox *bb, ListBase *dispbase)
 {
-	BoundBox *bb = NULL;
 	float min[3], max[3];
 	DispList *dl;
 	float *vert;
 	int a, tot = 0;
+	int doit = 0;
 
 	INIT_MINMAX(min, max);
 
+	for (dl = dispbase->first; dl; dl = dl->next) {
+		tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts;
+		vert = dl->verts;
+		for (a = 0; a < tot; a++, vert += 3) {
+			minmax_v3v3_v3(min, max, vert);
+		}
+		doit |= (tot != 0);
+	}
+
+	if (!doit) {
+		/* there's no geometry in displist, use zero-sized boundbox */
+		zero_v3(min);
+		zero_v3(max);
+	}
+
+	BKE_boundbox_init_from_minmax(bb, min, max);
+}
+
+/* this is confusing, there's also min_max_object, appplying the obmat... */
+static void boundbox_displist(Object *ob)
+{
 	if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
 		Curve *cu = ob->data;
-		int doit = 0;
 
-		if (cu->bb == NULL) cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
-		bb = cu->bb;
+		/* calculate curve's BB based on non-deformed displist */
+		if (cu->bb == NULL)
+			cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
 
-		for (dl = ob->disp.first; dl; dl = dl->next) {
-			tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts;
-			vert = dl->verts;
-			for (a = 0; a < tot; a++, vert += 3) {
-				minmax_v3v3_v3(min, max, vert);
-			}
-			doit = (tot != 0);
-		}
+		boundbox_dispbase(cu->bb, &cu->disp);
 
-		if (!doit) {
-			/* there's no geometry in displist, use zero-sized boundbox */
-			zero_v3(min);
-			zero_v3(max);
-		}
-
-	}
+		/* object's BB is calculated from final displist */
+		if (ob->bb == NULL)
+			ob->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
 
-	if (bb) {
-		BKE_boundbox_init_from_minmax(bb, min, max);
+		boundbox_dispbase(ob->bb, &ob->disp);
 	}
 }
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index fff51ab..685d661 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1483,7 +1483,9 @@ static void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
 		/* for vertex surface loop through tfaces and find uv color
 		 *  that provides highest alpha */
 		if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
-			#pragma omp parallel for schedule(static)
+			struct ImagePool *pool = BKE_image_pool_new();
+
+			#pragma omp parallel for schedule(static) shared(pool)
 			for (i = 0; i < numOfFaces; i++) {
 				int numOfVert = (mface[i].v4) ? 4 : 3;
 				float uv[3] = {0.0f};
@@ -1496,7 +1498,7 @@ static void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
 					uv[0] = tface[i].uv[j][0] * 2.0f - 1.0f;
 					uv[1] = tface[i].uv[j][1] * 2.0f - 1.0f;
 
-					multitex_ext_safe(tex, uv, &texres);
+					multitex_ext_safe(tex, uv, &texres, pool);
 
 					if (texres.tin > pPoint[*vert].alpha) {
 						copy_v3_v3(pPoint[*vert].color, &texres.tr);
@@ -1504,6 +1506,7 @@ static void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
 					}
 				}
 			}
+			BKE_image_pool_free(pool);
 		}
 		else if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
 			ImgSeqFormatData *f_data = (ImgSeqFormatData *)sData->format_data;
@@ -1529,7 +1532,7 @@ static void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
 				uv_final[0] = uv_final[0] * 2.0f - 1.0f;
 				uv_final[1] = uv_final[1] * 2.0f - 1.0f;
 					
-				multitex_ext_safe(tex, uv_final, &texres);
+				multitex_ext_safe(tex, uv_final, &texres, NULL);
 
 				/* apply color */
 				copy_v3_v3(pPoint[i].color, &texres.tr);
@@ -2376,7 +2379,8 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
 						dot11 = d2[0] * d2[0] + d2[1] * d2[1];
 						dot12 = d2[0] * d3[0] + d2[1] * d3[1];
 
-						invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
+						invDenom = (dot00 * dot11 - dot01 * dot01);
+						invDenom = invDenom ? 1.0f / invDenom : 1.0f;
 						u = (dot11 * dot02 - dot01 * dot12) * invDenom;
 						v = (dot00 * dot12 - dot01 * dot02) * invDenom;
 
@@ -2396,7 +2400,8 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
 							dot11 = d2[0] * d2[0] + d2[1] * d2[1];
 							dot12 = d2[0] * d3[0] + d2[1] * d3[1];
 
-							invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
+							invDenom = (dot00 * dot11 - dot01 * dot01);
+							invDenom = invDenom ? 1.0f / invDenom : 1.0f;
 							u = (dot11 * dot02 - dot01 * dot12) * invDenom;
 							v = (dot00 * dot12 - dot01 * dot02) * invDenom;
 
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 9157732..d652b97 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -69,7 +69,7 @@
 extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
 
 
-BMEditMesh *BMEdit_Create(BMesh *bm, int do_tessellate)
+BMEditMesh *BMEdit_Create(BMesh *bm, const bool do_tessellate)
 {
 	BMEditMesh *em = MEM_callocN(sizeof(BMEditMesh), __func__);
 
@@ -248,6 +248,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *em)
 
 			totfilltri = BLI_scanfill_calc_ex(&sf_ctx, 0, efa->no);
 			BLI_assert(totfilltri <= efa->len - 2);
+			(void)totfilltri;
 
 			for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
 				BMLoop **l_ptr = looptris[i++];
@@ -1410,7 +1411,7 @@ static void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r)
 			normal_float_to_short_v3(vert_r->no, eve->no);
 			vert_r->flag = BM_vert_flag_to_mflag(eve);
 
-			if (cd_vert_bweight_offset != -1) vert_r->bweight = BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eve, cd_vert_bweight_offset);
+			vert_r->bweight = (cd_vert_bweight_offset != -1) ? BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eve, cd_vert_bweight_offset) : 0;
 
 			vert_r++;
 		}
@@ -1421,7 +1422,7 @@ static void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r)
 			normal_float_to_short_v3(vert_r->no, eve->no);
 			vert_r->flag = BM_vert_flag_to_mflag(eve);
 
-			if (cd_vert_bweight_offset != -1) vert_r->bweight = BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eve, cd_vert_bweight_offset);
+			vert_r->bweight = (cd_vert_bweight_offset != -1) ? BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eve, cd_vert_bweight_offset) : 0;
 
 			vert_r++;
 		}
@@ -1445,8 +1446,8 @@ static void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
 
 		edge_r->flag = BM_edge_flag_to_mflag(eed);
 
-		if (cd_edge_crease_offset  != -1) edge_r->crease  = BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eed, cd_edge_crease_offset);
-		if (cd_edge_bweight_offset != -1) edge_r->bweight = BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eed, cd_edge_bweight_offset);
+		edge_r->crease  = (cd_edge_crease_offset  != -1) ? BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eed, cd_edge_crease_offset)  : 0;
+		edge_r->bweight = (cd_edge_bweight_offset != -1) ? BM_ELEM_CD_GET_FLOAT_AS_UCHAR(eed, cd_edge_bweight_offset) : 0;
 
 		edge_r++;
 	}
@@ -1469,6 +1470,7 @@ static void emDM_copyTessFaceArray(DerivedMesh *dm, MFace *face_r)
 		face_r->mat_nr = (unsigned char) ef->mat_nr;
 
 		face_r->flag = BM_face_flag_to_mflag(ef);
+		face_r->edcode = 0;
 
 		face_r->v1 = BM_elem_index_get(l[0]->v);
 		face_r->v2 = BM_elem_index_get(l[1]->v);
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 1f6db19..9e8693e 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -562,7 +562,7 @@ int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], floa
 			if (mface->v4)
 				add_v3_v3(surface_vel, surmd->v[mface->v4].co);
 
-			mul_v3_fl(surface_vel, mface->v4 ? 0.25f : 0.333f);
+			mul_v3_fl(surface_vel, mface->v4 ? 0.25f : (1.0f / 3.0f));
 		}
 		return 1;
 	}
@@ -769,7 +769,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
 		mul_m4_v3(eff->ob->imat, tex_co);
 	}
 
-	hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result);
+	hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result, NULL);
 
 	if (hasrgb && mode==PFIELD_TEX_RGB) {
 		force[0] = (0.5f - result->tr) * strength;
@@ -780,15 +780,15 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
 		strength/=nabla;
 
 		tex_co[0] += nabla;
-		multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+1);
+		multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+1, NULL);
 
 		tex_co[0] -= nabla;
 		tex_co[1] += nabla;
-		multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+2);
+		multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+2, NULL);
 
 		tex_co[1] -= nabla;
 		tex_co[2] += nabla;
-		multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+3);
+		multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+3, NULL);
 
 		if (mode == PFIELD_TEX_GRAD || !hasrgb) { /* if we don't have rgb fall back to grad */
 			/* generate intensity if texture only has rgb value */
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 7b007af..c3fc659 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -480,6 +480,92 @@ static FModifierTypeInfo FMI_ENVELOPE = {
 	fcm_envelope_evaluate /* evaluate */
 };
 
+/* exported function for finding points */
+
+/* Binary search algorithm for finding where to insert Envelope Data Point.
+ * Returns the index to insert at (data already at that index will be offset if replace is 0)
+ */
+#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001f
+
+int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int arraylen, short *exists)
+{
+	int start = 0, end = arraylen;
+	int loopbreaker = 0, maxloop = arraylen * 2;
+
+	/* initialize exists-flag first */
+	*exists = 0;
+
+	/* sneaky optimizations (don't go through searching process if...):
+	 * - keyframe to be added is to be added out of current bounds
+	 * - keyframe to be added would replace one of the existing ones on bounds
+	 */
+	if ((arraylen <= 0) || (array == NULL)) {
+		printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array\n");
+		return 0;
+	}
+	else {
+		/* check whether to add before/after/on */
+		float framenum;
+
+		/* 'First' Point (when only one point, this case is used) */
+		framenum = array[0].time;
+		if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
+			*exists = 1;
+			return 0;
+		}
+		else if (frame < framenum) {
+			return 0;
+		}
+
+		/* 'Last' Point */
+		framenum = array[(arraylen - 1)].time;
+		if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
+			*exists = 1;
+			return (arraylen - 1);
+		}
+		else if (frame > framenum) {
+			return arraylen;
+		}
+	}
+
+
+	/* most of the time, this loop is just to find where to put it
+	 * - 'loopbreaker' is just here to prevent infinite loops
+	 */
+	for (loopbreaker = 0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) {
+		/* compute and get midpoint */
+		int mid = start + ((end - start) / 2);  /* we calculate the midpoint this way to avoid int overflows... */
+		float midfra = array[mid].time;
+
+		/* check if exactly equal to midpoint */
+		if (IS_EQT(frame, midfra, BINARYSEARCH_FRAMEEQ_THRESH)) {
+			*exists = 1;
+			return mid;
+		}
+
+		/* repeat in upper/lower half */
+		if (frame > midfra) {
+			start = mid + 1;
+		}
+		else if (frame < midfra) {
+			end = mid - 1;
+		}
+	}
+
+	/* print error if loop-limit exceeded */
+	if (loopbreaker == (maxloop - 1)) {
+		printf("Error: binarysearch_fcm_envelopedata_index() was taking too long\n");
+
+		// include debug info
+		printf("\tround = %d: start = %d, end = %d, arraylen = %d\n", loopbreaker, start, end, arraylen);
+	}
+
+	/* not found, so return where to place it */
+	return start;
+}
+#undef BINARYSEARCH_FRAMEEQ_THRESH
+
+
 /* Cycles F-Curve Modifier  --------------------------- */
 
 /* This modifier changes evaltime to something that exists within the curve's frame-range, 
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 20d874e..639d256 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -127,11 +127,11 @@ void BKE_group_unlink(Group *group)
 	group->id.us = 0;
 }
 
-Group *add_group(const char *name)
+Group *add_group(Main *bmain, const char *name)
 {
 	Group *group;
 	
-	group = BKE_libblock_alloc(&G.main->group, ID_GR, name);
+	group = BKE_libblock_alloc(&bmain->group, ID_GR, name);
 	group->layer = (1 << 20) - 1;
 	return group;
 }
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index d8c3e26..9c26581 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -51,6 +51,8 @@
 
 #include "BLO_sys_types.h" // for intptr_t support
 
+#include "GPU_extensions.h"
+
 /* GLOBALS */
 
 static GHash *gIcons = NULL;
@@ -138,7 +140,10 @@ void BKE_previewimg_freefunc(void *link)
 				MEM_freeN(prv->rect[i]);
 				prv->rect[i] = NULL;
 			}
+			if (prv->gputexture[i])
+				GPU_texture_free(prv->gputexture[i]);
 		}
+		
 		MEM_freeN(prv);
 	}
 }
@@ -165,6 +170,7 @@ PreviewImage *BKE_previewimg_copy(PreviewImage *prv)
 			else {
 				prv_img->rect[i] = NULL;
 			}
+			prv_img->gputexture[i] = NULL;
 		}
 	}
 	return prv_img;
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 3be4766..9fdf51c 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -27,7 +27,6 @@
  *  \ingroup bke
  */
 
- 
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -663,7 +662,7 @@ int IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const int is_s
 		{
 			IDProperty *link1, *link2;
 
-			if (is_strict && BLI_countlist(&prop1->data.group) != BLI_countlist(&prop2->data.group))
+			if (is_strict && prop1->len != prop2->len)
 				return 0;
 
 			for (link1 = prop1->data.group.first; link1; link1 = link1->next) {
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 2141738..3655afd 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -242,11 +242,11 @@ void BKE_image_free(Image *ima)
 }
 
 /* only image block itself */
-static Image *image_alloc(const char *name, short source, short type)
+static Image *image_alloc(Main *bmain, const char *name, short source, short type)
 {
 	Image *ima;
 
-	ima = BKE_libblock_alloc(&G.main->image, ID_IM, name);
+	ima = BKE_libblock_alloc(&bmain->image, ID_IM, name);
 	if (ima) {
 		ima->ok = IMA_OK;
 
@@ -323,9 +323,9 @@ static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int frame)
 }
 
 /* empty image block, of similar type and filename */
-Image *BKE_image_copy(Image *ima)
+Image *BKE_image_copy(Main *bmain, Image *ima)
 {
-	Image *nima = image_alloc(ima->id.name + 2, ima->source, ima->type);
+	Image *nima = image_alloc(bmain, ima->id.name + 2, ima->source, ima->type);
 
 	BLI_strncpy(nima->name, ima->name, sizeof(ima->name));
 
@@ -343,6 +343,9 @@ Image *BKE_image_copy(Image *ima)
 
 	BKE_color_managed_colorspace_settings_copy(&nima->colorspace_settings, &ima->colorspace_settings);
 
+	if (ima->packedfile)
+		nima->packedfile = dupPackedFile(ima->packedfile);
+
 	return nima;
 }
 
@@ -433,7 +436,7 @@ void BKE_image_make_local(struct Image *ima)
 		extern_local_image(ima);
 	}
 	else if (is_local && is_lib) {
-		Image *ima_new = BKE_image_copy(ima);
+		Image *ima_new = BKE_image_copy(bmain, ima);
 
 		ima_new->id.us = 0;
 
@@ -568,7 +571,21 @@ static void image_init_color_management(Image *ima)
 	}
 }
 
-Image *BKE_image_load(const char *filepath)
+void BKE_image_alpha_mode_from_extension(Image *image)
+{
+	if (BLI_testextensie(image->name, ".exr") ||
+	    BLI_testextensie(image->name, ".cin") ||
+	    BLI_testextensie(image->name, ".dpx") ||
+	    BLI_testextensie(image->name, ".hdr"))
+	{
+		image->alpha_mode = IMA_ALPHA_PREMUL;
+	}
+	else {
+		image->alpha_mode = IMA_ALPHA_STRAIGHT;
+	}
+}
+
+Image *BKE_image_load(Main *bmain, const char *filepath)
 {
 	Image *ima;
 	int file, len;
@@ -576,7 +593,7 @@ Image *BKE_image_load(const char *filepath)
 	char str[FILE_MAX];
 
 	BLI_strncpy(str, filepath, sizeof(str));
-	BLI_path_abs(str, G.main->name);
+	BLI_path_abs(str, bmain->name);
 
 	/* exists? */
 	file = BLI_open(str, O_BINARY | O_RDONLY, 0);
@@ -589,7 +606,7 @@ Image *BKE_image_load(const char *filepath)
 	while (len > 0 && filepath[len - 1] != '/' && filepath[len - 1] != '\\') len--;
 	libname = filepath + len;
 
-	ima = image_alloc(libname, IMA_SRC_FILE, IMA_TYPE_IMAGE);
+	ima = image_alloc(bmain, libname, IMA_SRC_FILE, IMA_TYPE_IMAGE);
 	BLI_strncpy(ima->name, filepath, sizeof(ima->name));
 
 	if (BLI_testextensie_array(filepath, imb_ext_movie))
@@ -631,7 +648,7 @@ Image *BKE_image_load_exists(const char *filepath)
 		}
 	}
 
-	return BKE_image_load(filepath);
+	return BKE_image_load(G.main, filepath);
 }
 
 static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type,
@@ -691,10 +708,10 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
 }
 
 /* adds new image block, creates ImBuf and initializes color */
-Image *BKE_image_add_generated(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, float color[4])
+Image *BKE_image_add_generated(Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, float color[4])
 {
 	/* on save, type is changed to FILE in editsima.c */
-	Image *ima = image_alloc(name, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST);
+	Image *ima = image_alloc(bmain, name, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST);
 
 	if (ima) {
 		ImBuf *ibuf;
@@ -720,7 +737,7 @@ Image *BKE_image_add_from_imbuf(ImBuf *ibuf)
 	/* on save, type is changed to FILE in editsima.c */
 	Image *ima;
 
-	ima = image_alloc(BLI_path_basename(ibuf->name), IMA_SRC_FILE, IMA_TYPE_IMAGE);
+	ima = image_alloc(G.main, BLI_path_basename(ibuf->name), IMA_SRC_FILE, IMA_TYPE_IMAGE);
 
 	if (ima) {
 		BLI_strncpy(ima->name, ibuf->name, FILE_MAX);
@@ -2104,7 +2121,7 @@ Image *BKE_image_verify_viewer(int type, const char *name)
 				break;
 
 	if (ima == NULL)
-		ima = image_alloc(name, IMA_SRC_VIEWER, type);
+		ima = image_alloc(G.main, name, IMA_SRC_VIEWER, type);
 
 	/* happens on reload, imagewindow cannot be image user when hidden*/
 	if (ima->id.us == 0)
@@ -2205,9 +2222,20 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
 				}
 			}
 
+#if 0
 			/* force reload on first use, but not for multilayer, that makes nodes and buttons in ui drawing fail */
 			if (ima->type != IMA_TYPE_MULTILAYER)
 				image_free_buffers(ima);
+#else
+			/* image buffers for non-sequence multilayer will share buffers with RenderResult,
+			 * however sequence multilayer will own buffers. Such logic makes switching from
+			 * single multilayer file to sequence completely instable
+			 * since changes in nodes seems this workaround isn't needed anymore, all sockets
+			 * are nicely detecting anyway, but freeing buffers always here makes multilayer
+			 * sequences behave stable
+			 */
+			image_free_buffers(ima);
+#endif
 
 			ima->ok = 1;
 			if (iuser)
@@ -2723,6 +2751,14 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
 	if (rres.have_combined && layer == 0) {
 		/* pass */
 	}
+	else if (rect && layer == 0) {
+		/* rect32 is set when there's a Sequence pass, this pass seems
+		 * to have layer=0 (this is from image_buttons.c)
+		 * in this case we ignore float buffer, because it could have
+		 * hung from previous pass which was float
+		 */
+		rectf = NULL;
+	}
 	else if (rres.layers.first) {
 		RenderLayer *rl = BLI_findlink(&rres.layers, layer - (rres.have_combined ? 1 : 0));
 		if (rl) {
@@ -2811,6 +2847,28 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
 	return ibuf;
 }
 
+static void image_get_fame_and_index(Image *ima, ImageUser *iuser, int *frame_r, int *index_r)
+{
+	int frame = 0, index = 0;
+
+	/* see if we already have an appropriate ibuf, with image source and type */
+	if (ima->source == IMA_SRC_MOVIE) {
+		frame = iuser ? iuser->framenr : ima->lastframe;
+	}
+	else if (ima->source == IMA_SRC_SEQUENCE) {
+		if (ima->type == IMA_TYPE_IMAGE) {
+			frame = iuser ? iuser->framenr : ima->lastframe;
+		}
+		else if (ima->type == IMA_TYPE_MULTILAYER) {
+			frame = iuser ? iuser->framenr : ima->lastframe;
+			index = iuser ? iuser->multi_index : IMA_NO_INDEX;
+		}
+	}
+
+	*frame_r = frame;
+	*index_r = index;
+}
+
 static ImBuf *image_get_ibuf_threadsafe(Image *ima, ImageUser *iuser, int *frame_r, int *index_r)
 {
 	ImBuf *ibuf = NULL;
@@ -2866,6 +2924,21 @@ static ImBuf *image_get_ibuf_threadsafe(Image *ima, ImageUser *iuser, int *frame
 	return ibuf;
 }
 
+BLI_INLINE int image_quick_test(Image *ima, ImageUser *iuser)
+{
+	if (ima == NULL)
+		return FALSE;
+
+	if (iuser) {
+		if (iuser->ok == 0)
+			return FALSE;
+	}
+	else if (ima->ok == 0)
+		return FALSE;
+
+	return TRUE;
+}
+
 /* Checks optional ImageUser and verifies/creates ImBuf.
  *
  * not thread-safe, so callee should worry about thread locks
@@ -2880,14 +2953,7 @@ static ImBuf *image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r)
 		*lock_r = NULL;
 
 	/* quick reject tests */
-	if (ima == NULL)
-		return NULL;
-
-	if (iuser) {
-		if (iuser->ok == 0)
-			return NULL;
-	}
-	else if (ima->ok == 0)
+	if (!image_quick_test(ima, iuser))
 		return NULL;
 
 	ibuf = image_get_ibuf_threadsafe(ima, iuser, &frame, &index);
@@ -3011,14 +3077,7 @@ int BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
 	ImBuf *ibuf;
 
 	/* quick reject tests */
-	if (ima == NULL)
-		return FALSE;
-
-	if (iuser) {
-		if (iuser->ok == 0)
-			return FALSE;
-	}
-	else if (ima->ok == 0)
+	if (!image_quick_test(ima, iuser))
 		return FALSE;
 
 	ibuf = image_get_ibuf_threadsafe(ima, iuser, NULL, NULL);
@@ -3037,6 +3096,122 @@ int BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
 	return ibuf != NULL;
 }
 
+/* ******** Pool for image buffers ********  */
+
+typedef struct ImagePoolEntry {
+	struct ImagePoolEntry *next, *prev;
+	Image *image;
+	ImBuf *ibuf;
+	int index;
+	int frame;
+} ImagePoolEntry;
+
+typedef struct ImagePool {
+	ListBase image_buffers;
+} ImagePool;
+
+ImagePool *BKE_image_pool_new(void)
+{
+	ImagePool *pool = MEM_callocN(sizeof(ImagePool), "Image Pool");
+
+	return pool;
+}
+
+void BKE_image_pool_free(ImagePool *pool)
+{
+	ImagePoolEntry *entry, *next_entry;
+
+	/* use single lock to dereference all the image buffers */
+	BLI_spin_lock(&image_spin);
+
+	for (entry = pool->image_buffers.first; entry; entry = next_entry) {
+		next_entry = entry->next;
+
+		if (entry->ibuf)
+			IMB_freeImBuf(entry->ibuf);
+
+		MEM_freeN(entry);
+	}
+
+	BLI_spin_unlock(&image_spin);
+
+	MEM_freeN(pool);
+}
+
+BLI_INLINE ImBuf *image_pool_find_entry(ImagePool *pool, Image *image, int frame, int index, int *found)
+{
+	ImagePoolEntry *entry;
+
+	*found = FALSE;
+
+	for (entry = pool->image_buffers.first; entry; entry = entry->next) {
+		if (entry->image == image && entry->frame == frame && entry->index == index) {
+			*found = TRUE;
+			return entry->ibuf;
+		}
+	}
+
+	return NULL;
+}
+
+ImBuf *BKE_image_pool_acquire_ibuf(Image *ima, ImageUser *iuser, ImagePool *pool)
+{
+	ImBuf *ibuf;
+	int index, frame, found;
+
+	if (!image_quick_test(ima, iuser))
+		return NULL;
+
+	if (pool == NULL) {
+		/* pool could be NULL, in this case use general acquire function */
+		return BKE_image_acquire_ibuf(ima, iuser, NULL);
+	}
+
+	image_get_fame_and_index(ima, iuser, &frame, &index);
+
+	ibuf = image_pool_find_entry(pool, ima, frame, index, &found);
+	if (found)
+		return ibuf;
+
+	BLI_spin_lock(&image_spin);
+
+	ibuf = image_pool_find_entry(pool, ima, frame, index, &found);
+
+	/* will also create entry even in cases image buffer failed to load,
+	 * prevents trying to load the same buggy file multiple times
+	 */
+	if (!found) {
+		ImagePoolEntry *entry;
+
+		ibuf = image_acquire_ibuf(ima, iuser, NULL);
+
+		if (ibuf)
+			IMB_refImBuf(ibuf);
+
+		entry = MEM_callocN(sizeof(ImagePoolEntry), "Image Pool Entry");
+		entry->image = ima;
+		entry->frame = frame;
+		entry->index = index;
+		entry->ibuf = ibuf;
+
+		BLI_addtail(&pool->image_buffers, entry);
+	}
+
+	BLI_spin_unlock(&image_spin);
+
+	return ibuf;
+}
+
+void BKE_image_pool_release_ibuf(Image *ima, ImBuf *ibuf, ImagePool *pool)
+{
+	/* if pool wasn't actually used, use general release stuff,
+	 * for pools image buffers will be dereferenced on pool free
+	 */
+	if (pool == NULL) {
+		BKE_image_release_ibuf(ima, ibuf, NULL);
+	}
+}
+
 int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range)
 {
 	const int len = (iuser->fie_ima * iuser->frames) / 2;
@@ -3199,3 +3374,57 @@ void BKE_image_get_aspect(Image *image, float *aspx, float *aspy)
 	else
 		*aspy = 1.0f;
 }
+
+unsigned char *BKE_image_get_pixels_for_frame(struct Image *image, int frame)
+{
+	ImageUser iuser = {0};
+	void *lock;
+	ImBuf *ibuf;
+	unsigned char *pixels = NULL;
+
+	iuser.framenr = frame;
+	iuser.ok = TRUE;
+
+	ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);
+
+	if (ibuf) {
+		pixels = (unsigned char *) ibuf->rect;
+
+		if (pixels)
+			pixels = MEM_dupallocN(pixels);
+
+		BKE_image_release_ibuf(image, ibuf, lock);
+	}
+
+	if (!pixels)
+		return NULL;
+
+	return pixels;
+}
+
+float *BKE_image_get_float_pixels_for_frame(struct Image *image, int frame)
+{
+	ImageUser iuser = {0};
+	void *lock;
+	ImBuf *ibuf;
+	float *pixels = NULL;
+
+	iuser.framenr = frame;
+	iuser.ok = TRUE;
+
+	ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);
+
+	if (ibuf) {
+		pixels = ibuf->rect_float;
+
+		if (pixels)
+			pixels = MEM_dupallocN(pixels);
+
+		BKE_image_release_ibuf(image, ibuf, lock);
+	}
+
+	if (!pixels)
+		return NULL;
+
+	return pixels;
+}
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 59dd028..c536474 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1548,7 +1548,7 @@ static void ipo_to_animdata(ID *id, Ipo *ipo, char actname[], char constname[],
 			
 			BLI_snprintf(nameBuf, sizeof(nameBuf), "CDA:%s", ipo->id.name + 2);
 			
-			adt->action = add_empty_action(nameBuf);
+			adt->action = add_empty_action(G.main, nameBuf);
 			if (G.debug & G_DEBUG) printf("\t\tadded new action - '%s'\n", nameBuf);
 		}
 		
@@ -2093,7 +2093,7 @@ void do_versions_ipos_to_animato(Main *main)
 			bAction *new_act;
 			
 			/* add a new action for this, and convert all data into that action */
-			new_act = add_empty_action(id->name + 2);
+			new_act = add_empty_action(main, id->name + 2);
 			ipo_to_animato(NULL, ipo, NULL, NULL, NULL, NULL, &new_act->curves, &drivers);
 			new_act->idroot = ipo->blocktype;
 		}
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index ccc57a2..cb0a11a 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -108,19 +108,6 @@ void BKE_key_free_nolib(Key *key)
 	
 }
 
-/* GS reads the memory pointed at in a specific ordering. There are,
- * however two definitions for it. I have jotted them down here, both,
- * but I think the first one is actually used. The thing is that
- * big-endian systems might read this the wrong way round. OTOH, we
- * constructed the IDs that are read out with this macro explicitly as
- * well. I expect we'll sort it out soon... */
-
-/* from blendef: */
-#define GS(a)   (*((short *)(a)))
-
-/* from misc_util: flip the bytes from x  */
-/*  #define GS(x) (((unsigned char *)(x))[0] << 8 | ((unsigned char *)(x))[1]) */
-
 Key *BKE_key_add(ID *id)    /* common function */
 {
 	Key *key;
@@ -1078,7 +1065,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
 	if (key->slurph && key->type != KEY_RELATIVE) {
 		const float ctime_scaled = key->ctime / 100.0f;
 		float delta = (float)key->slurph / tot;
-		float cfra = (float)scene->r.cfra + scene->r.subframe;
+		float cfra = BKE_scene_frame_get(scene);
 		int step, a;
 
 		if (tot > 100 && slurph_opt) {
@@ -1176,7 +1163,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
 	if (key->slurph && key->type != KEY_RELATIVE) {
 		const float ctime_scaled = key->ctime / 100.0f;
 		float delta = (float)key->slurph / tot;
-		float cfra = (float)scene->r.cfra + scene->r.subframe;
+		float cfra = BKE_scene_frame_get(scene);
 		Nurb *nu;
 		int i = 0, remain = 0;
 		int step, a;
@@ -1258,7 +1245,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
 	if (key->slurph && key->type != KEY_RELATIVE) {
 		const float ctime_scaled = key->ctime / 100.0f;
 		float delta = (float)key->slurph / tot;
-		float cfra = (float)scene->r.cfra + scene->r.subframe;
+		float cfra = BKE_scene_frame_get(scene);
 		int a;
 
 		for (a = 0; a < tot; a++, cfra += delta) {
@@ -1373,7 +1360,7 @@ float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
 	}
 	else {
 		/* do shapekey local drivers */
-		float ctime = (float)scene->r.cfra + scene->r.subframe;
+		float ctime = BKE_scene_frame_get(scene);
 
 		BKE_animsys_evaluate_animdata(scene, &key->id, key->adt, ctime, ADT_RECALC_DRIVERS);
 		
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 2f37db8..32cc5c6 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -54,11 +54,11 @@
 #include "BKE_main.h"
 #include "BKE_node.h"
 
-Lamp *BKE_lamp_add(const char *name)
+Lamp *BKE_lamp_add(Main *bmain, const char *name)
 {
 	Lamp *la;
 	
-	la =  BKE_libblock_alloc(&G.main->lamp, ID_LA, name);
+	la =  BKE_libblock_alloc(&bmain->lamp, ID_LA, name);
 	
 	la->r = la->g = la->b = la->k = 1.0f;
 	la->haint = la->energy = 1.0f;
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index fa01e9f..c3e7a96 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -180,11 +180,11 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
 	MEM_freeN(vertexCos);
 }
 
-Lattice *BKE_lattice_add(const char *name)
+Lattice *BKE_lattice_add(Main *bmain, const char *name)
 {
 	Lattice *lt;
 	
-	lt = BKE_libblock_alloc(&G.main->latt, ID_LT, name);
+	lt = BKE_libblock_alloc(&bmain->latt, ID_LT, name);
 	
 	lt->flag = LT_GRID;
 	
@@ -912,7 +912,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];
 						
-						mul_v3_fl(bp->vec, 0.3333333f);
+						mul_v3_fl(bp->vec, 1.0f / 3.0f);
 						
 					}
 				}
@@ -1003,3 +1003,66 @@ struct MDeformVert *BKE_lattice_deform_verts_get(struct Object *oblatt)
 	if (lt->editlatt) lt = lt->editlatt->latt;
 	return lt->dvert;
 }
+
+void BKE_lattice_center_median(struct Lattice *lt, float cent[3])
+{
+	int i, numVerts;
+
+	if (lt->editlatt) lt = lt->editlatt->latt;
+	numVerts = lt->pntsu * lt->pntsv * lt->pntsw;
+
+	zero_v3(cent);
+
+	for (i = 0; i < numVerts; i++)
+		add_v3_v3(cent, lt->def[i].vec);
+
+	mul_v3_fl(cent, 1.0f / (float)numVerts);
+}
+
+void BKE_lattice_minmax(struct Lattice *lt, float min[3], float max[3])
+{
+	int i, numVerts;
+
+	if (lt->editlatt) lt = lt->editlatt->latt;
+	numVerts = lt->pntsu * lt->pntsv * lt->pntsw;
+
+	for (i = 0; i < numVerts; i++)
+		minmax_v3v3_v3(min, max, lt->def[i].vec);
+}
+
+void BKE_lattice_center_bounds(struct Lattice *lt, float cent[3])
+{
+	float min[3], max[3];
+
+	INIT_MINMAX(min, max);
+
+	BKE_lattice_minmax(lt, min, max);
+	mid_v3_v3v3(cent, min, max);
+}
+
+void BKE_lattice_translate(Lattice *lt, float offset[3], int do_keys)
+{
+	int i, numVerts;
+
+	numVerts = lt->pntsu * lt->pntsv * lt->pntsw;
+
+	if (lt->def)
+		for (i = 0; i < numVerts; i++)
+			add_v3_v3(lt->def[i].vec, offset);
+
+	if (lt->editlatt)
+		for (i = 0; i < numVerts; i++)
+			add_v3_v3(lt->editlatt->latt->def[i].vec, offset);
+
+	if (do_keys && lt->key) {
+		KeyBlock *kb;
+
+		for (kb = lt->key->block.first; kb; kb = kb->next) {
+			float *fp = kb->data;
+			for (i = kb->totelem; i--; fp += 3) {
+				add_v3_v3(fp, offset);
+			}
+		}
+	}
+}
+
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 1e6f429..0c5e2b8 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -47,6 +47,7 @@
 #include "DNA_brush_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_group_types.h"
+#include "DNA_gpencil_types.h"
 #include "DNA_ipo_types.h"
 #include "DNA_key_types.h"
 #include "DNA_lamp_types.h"
@@ -54,6 +55,8 @@
 #include "DNA_material_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meta_types.h"
+#include "DNA_movieclip_types.h"
+#include "DNA_mask_types.h"
 #include "DNA_nla_types.h"
 #include "DNA_node_types.h"
 #include "DNA_scene_types.h"
@@ -64,51 +67,49 @@
 #include "DNA_vfont_types.h"
 #include "DNA_windowmanager_types.h"
 #include "DNA_world_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_movieclip_types.h"
-#include "DNA_mask_types.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_dynstr.h"
 #include "BLI_utildefines.h"
 #include "BKE_bpath.h"
 
+#include "BKE_action.h"
 #include "BKE_animsys.h"
+#include "BKE_armature.h"
+#include "BKE_brush.h"
 #include "BKE_camera.h"
 #include "BKE_context.h"
-#include "BKE_lamp.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_sound.h"
-#include "BKE_object.h"
-#include "BKE_screen.h"
-#include "BKE_mesh.h"
-#include "BKE_material.h"
 #include "BKE_curve.h"
-#include "BKE_mball.h"
-#include "BKE_text.h"
-#include "BKE_texture.h"
-#include "BKE_scene.h"
+#include "BKE_fcurve.h"
+#include "BKE_font.h"
+#include "BKE_global.h"
+#include "BKE_group.h"
+#include "BKE_gpencil.h"
+#include "BKE_idprop.h"
 #include "BKE_icons.h"
 #include "BKE_image.h"
 #include "BKE_ipo.h"
 #include "BKE_key.h"
-#include "BKE_world.h"
-#include "BKE_font.h"
-#include "BKE_group.h"
+#include "BKE_lamp.h"
 #include "BKE_lattice.h"
-#include "BKE_armature.h"
-#include "BKE_action.h"
+#include "BKE_library.h"
+#include "BKE_mesh.h"
+#include "BKE_material.h"
+#include "BKE_main.h"
+#include "BKE_mball.h"
+#include "BKE_movieclip.h"
+#include "BKE_mask.h"
 #include "BKE_node.h"
-#include "BKE_brush.h"
-#include "BKE_idprop.h"
+#include "BKE_object.h"
 #include "BKE_particle.h"
-#include "BKE_gpencil.h"
-#include "BKE_fcurve.h"
+#include "BKE_packedFile.h"
 #include "BKE_speaker.h"
-#include "BKE_movieclip.h"
-#include "BKE_mask.h"
+#include "BKE_sound.h"
+#include "BKE_screen.h"
+#include "BKE_scene.h"
+#include "BKE_text.h"
+#include "BKE_texture.h"
+#include "BKE_world.h"
 
 #include "RNA_access.h"
 
@@ -122,9 +123,6 @@
  * only use this definition, makes little and big endian systems
  * work fine, in conjunction with MAKE_ID */
 
-/* from blendef: */
-#define GS(a)  (*((short *)(a)))
-
 /* ************* general ************************ */
 
 
@@ -314,7 +312,7 @@ int id_copy(ID *id, ID **newid, int test)
 			if (!test) *newid = (ID *)BKE_texture_copy((Tex *)id);
 			return 1;
 		case ID_IM:
-			if (!test) *newid = (ID *)BKE_image_copy((Image *)id);
+			if (!test) *newid = (ID *)BKE_image_copy(G.main, (Image *)id);
 			return 1;
 		case ID_LT:
 			if (!test) *newid = (ID *)BKE_lattice_copy((Lattice *)id);
@@ -744,13 +742,13 @@ void BKE_libblock_copy_data(ID *id, const ID *id_from, const short do_action)
 }
 
 /* used everywhere in blenkernel */
-void *BKE_libblock_copy(ID *id)
+void *BKE_libblock_copy_ex(Main *bmain, ID *id)
 {
 	ID *idn;
 	ListBase *lb;
 	size_t idn_len;
 
-	lb = which_libbase(G.main, GS(id->name));
+	lb = which_libbase(bmain, GS(id->name));
 	idn = BKE_libblock_alloc(lb, GS(id->name), id->name + 2);
 
 	assert(idn != NULL);
@@ -771,9 +769,15 @@ void *BKE_libblock_copy(ID *id)
 	return idn;
 }
 
-static void BKE_library_free(Library *UNUSED(lib))
+void *BKE_libblock_copy(ID *id)
+{
+	return BKE_libblock_copy_ex(G.main, id);
+}
+
+static void BKE_library_free(Library *lib)
 {
-	/* no freeing needed for libraries yet */
+	if (lib->packedfile)
+		freePackedFile(lib->packedfile);
 }
 
 static void (*free_windowmanager_cb)(bContext *, wmWindowManager *) = NULL;
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index bda9240..960432d 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -698,18 +698,18 @@ void BKE_mask_point_select_set_handle(MaskSplinePoint *point, const short do_sel
 }
 
 /* only mask block itself */
-static Mask *mask_alloc(const char *name)
+static Mask *mask_alloc(Main *bmain, const char *name)
 {
 	Mask *mask;
 
-	mask = BKE_libblock_alloc(&G.main->mask, ID_MSK, name);
+	mask = BKE_libblock_alloc(&bmain->mask, ID_MSK, name);
 
 	mask->id.flag |= LIB_FAKEUSER;
 
 	return mask;
 }
 
-Mask *BKE_mask_new(const char *name)
+Mask *BKE_mask_new(Main *bmain, const char *name)
 {
 	Mask *mask;
 	char mask_name[MAX_ID_NAME - 2];
@@ -719,7 +719,7 @@ Mask *BKE_mask_new(const char *name)
 	else
 		strcpy(mask_name, "Mask");
 
-	mask = mask_alloc(mask_name);
+	mask = mask_alloc(bmain, mask_name);
 
 	/* arbitrary defaults */
 	mask->sfra = 1;
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 73452b2..e3423c9 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -213,7 +213,7 @@ MaskRasterHandle *BKE_maskrasterize_handle_new(void)
 {
 	MaskRasterHandle *mr_handle;
 
-	mr_handle = MEM_callocN(sizeof(MaskRasterHandle), STRINGIFY(MaskRasterHandle));
+	mr_handle = MEM_callocN(sizeof(MaskRasterHandle), "MaskRasterHandle");
 
 	return mr_handle;
 }
@@ -569,7 +569,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
 	unsigned int masklay_index;
 
 	mr_handle->layers_tot = BLI_countlist(&mask->masklayers);
-	mr_handle->layers = MEM_mallocN(sizeof(MaskRasterLayer) * mr_handle->layers_tot, STRINGIFY(MaskRasterLayer));
+	mr_handle->layers = MEM_mallocN(sizeof(MaskRasterLayer) * mr_handle->layers_tot, "MaskRasterLayer");
 	BLI_rctf_init_minmax(&mr_handle->bounds);
 
 	for (masklay = mask->masklayers.first, masklay_index = 0; masklay; masklay = masklay->next, masklay_index++) {
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index bf64bd3..4711765 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -206,11 +206,11 @@ void init_material(Material *ma)
 	ma->preview = NULL;
 }
 
-Material *BKE_material_add(const char *name)
+Material *BKE_material_add(Main *bmain, const char *name)
 {
 	Material *ma;
 
-	ma = BKE_libblock_alloc(&G.main->mat, ID_MA, name);
+	ma = BKE_libblock_alloc(&bmain->mat, ID_MA, name);
 	
 	init_material(ma);
 	
@@ -681,19 +681,6 @@ Material *give_node_material(Material *ma)
 	return NULL;
 }
 
-/* GS reads the memory pointed at in a specific ordering. There are,
- * however two definitions for it. I have jotted them down here, both,
- * but I think the first one is actually used. The thing is that
- * big-endian systems might read this the wrong way round. OTOH, we
- * constructed the IDs that are read out with this macro explicitly as
- * well. I expect we'll sort it out soon... */
-
-/* from blendef: */
-#define GS(a)   (*((short *)(a)))
-
-/* from misc_util: flip the bytes from x  */
-/*  #define GS(x) (((unsigned char *)(x))[0] << 8 | ((unsigned char *)(x))[1]) */
-
 void resize_object_material(Object *ob, const short totcol)
 {
 	Material **newmatar;
@@ -1791,7 +1778,7 @@ static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag)
 	}
 	/* create a new material */
 	else {
-		ma = BKE_material_add(idname + 2);
+		ma = BKE_material_add(main, idname + 2);
 
 		if (ma) {
 			printf("TexFace Convert: Material \"%s\" created.\n", idname + 2);
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index b3f71e5..5cc3145 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -196,11 +196,11 @@ void BKE_mball_free(MetaBall *mb)
 	if (mb->disp.first) BKE_displist_free(&mb->disp);
 }
 
-MetaBall *BKE_mball_add(const char *name)
+MetaBall *BKE_mball_add(Main *bmain, const char *name)
 {
 	MetaBall *mb;
 	
-	mb = BKE_libblock_alloc(&G.main->mball, ID_MB, name);
+	mb = BKE_libblock_alloc(&bmain->mball, ID_MB, name);
 	
 	mb->size[0] = mb->size[1] = mb->size[2] = 1.0;
 	mb->texflag = MB_AUTOSPACE;
@@ -1654,6 +1654,14 @@ static void polygonize(PROCESS *mbproc, MetaBall *mb)
 	}
 }
 
+/* could move to math api */
+BLI_INLINE void copy_v3_fl3(float v[3], float x, float y, float z)
+{
+	v[0] = x;
+	v[1] = y;
+	v[2] = z;
+}
+
 static float init_meta(Scene *scene, Object *ob)    /* return totsize */
 {
 	Scene *sce_iter = scene;
@@ -1730,6 +1738,7 @@ static float init_meta(Scene *scene, Object *ob)    /* return totsize */
 						float temp1[4][4], temp2[4][4], temp3[4][4];
 						float (*mat)[4] = NULL, (*imat)[4] = NULL;
 						float max_x, max_y, max_z, min_x, min_y, min_z;
+						float expx, expy, expz;
 
 						max_x = max_y = max_z = -3.4e38;
 						min_x = min_y = min_z =  3.4e38;
@@ -1770,39 +1779,27 @@ static float init_meta(Scene *scene, Object *ob)    /* return totsize */
 						G_mb.mainb[a]->mat = (float *) mat;
 						G_mb.mainb[a]->imat = (float *) imat;
 
+						if (!MB_TYPE_SIZE_SQUARED(ml->type)) {
+							expx = ml->expx;
+							expy = ml->expy;
+							expz = ml->expz;
+						}
+						else {
+							expx = ml->expx * ml->expx;
+							expy = ml->expy * ml->expy;
+							expz = ml->expz * ml->expz;
+						}
+
 						/* untransformed Bounding Box of MetaElem */
-						/* 0 */
-						G_mb.mainb[a]->bb->vec[0][0] = -ml->expx;
-						G_mb.mainb[a]->bb->vec[0][1] = -ml->expy;
-						G_mb.mainb[a]->bb->vec[0][2] = -ml->expz;
-						/* 1 */
-						G_mb.mainb[a]->bb->vec[1][0] =  ml->expx;
-						G_mb.mainb[a]->bb->vec[1][1] = -ml->expy;
-						G_mb.mainb[a]->bb->vec[1][2] = -ml->expz;
-						/* 2 */
-						G_mb.mainb[a]->bb->vec[2][0] =  ml->expx;
-						G_mb.mainb[a]->bb->vec[2][1] =  ml->expy;
-						G_mb.mainb[a]->bb->vec[2][2] = -ml->expz;
-						/* 3 */
-						G_mb.mainb[a]->bb->vec[3][0] = -ml->expx;
-						G_mb.mainb[a]->bb->vec[3][1] =  ml->expy;
-						G_mb.mainb[a]->bb->vec[3][2] = -ml->expz;
-						/* 4 */
-						G_mb.mainb[a]->bb->vec[4][0] = -ml->expx;
-						G_mb.mainb[a]->bb->vec[4][1] = -ml->expy;
-						G_mb.mainb[a]->bb->vec[4][2] =  ml->expz;
-						/* 5 */
-						G_mb.mainb[a]->bb->vec[5][0] =  ml->expx;
-						G_mb.mainb[a]->bb->vec[5][1] = -ml->expy;
-						G_mb.mainb[a]->bb->vec[5][2] =  ml->expz;
-						/* 6 */
-						G_mb.mainb[a]->bb->vec[6][0] =  ml->expx;
-						G_mb.mainb[a]->bb->vec[6][1] =  ml->expy;
-						G_mb.mainb[a]->bb->vec[6][2] =  ml->expz;
-						/* 7 */
-						G_mb.mainb[a]->bb->vec[7][0] = -ml->expx;
-						G_mb.mainb[a]->bb->vec[7][1] =  ml->expy;
-						G_mb.mainb[a]->bb->vec[7][2] =  ml->expz;
+						/* TODO, its possible the elem type has been changed and the exp* values can use a fallback */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[0], -expx, -expy, -expz);  /* 0 */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[1], +expx, -expy, -expz);  /* 1 */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[2], +expx, +expy, -expz);  /* 2 */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[3], -expx, +expy, -expz);  /* 3 */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[4], -expx, -expy, +expz);  /* 4 */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[5], +expx, -expy, +expz);  /* 5 */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[6], +expx, +expy, +expz);  /* 6 */
+						copy_v3_fl3(G_mb.mainb[a]->bb->vec[7], -expx, +expy, +expz);  /* 7 */
 
 						/* transformation of Metalem bb */
 						for (i = 0; i < 8; i++)
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 267cf17..c9c86e6 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -445,11 +445,11 @@ static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata)
 	mesh->totface = 0;
 }
 
-Mesh *BKE_mesh_add(const char *name)
+Mesh *BKE_mesh_add(Main *bmain, const char *name)
 {
 	Mesh *me;
 	
-	me = BKE_libblock_alloc(&G.main->mesh, ID_ME, name);
+	me = BKE_libblock_alloc(&bmain->mesh, ID_ME, name);
 	
 	me->size[0] = me->size[1] = me->size[2] = 1.0;
 	me->smoothresh = 30;
@@ -466,7 +466,7 @@ Mesh *BKE_mesh_add(const char *name)
 	return me;
 }
 
-Mesh *BKE_mesh_copy(Mesh *me)
+Mesh *BKE_mesh_copy_ex(Main *bmain, Mesh *me)
 {
 	Mesh *men;
 	MTFace *tface;
@@ -474,7 +474,7 @@ Mesh *BKE_mesh_copy(Mesh *me)
 	int a, i;
 	const int do_tessface = ((me->totface != 0) && (me->totpoly == 0)); /* only do tessface if we have no polys */
 	
-	men = BKE_libblock_copy(&me->id);
+	men = BKE_libblock_copy_ex(bmain, &me->id);
 	
 	men->mat = MEM_dupallocN(me->mat);
 	for (a = 0; a < men->totcol; a++) {
@@ -527,13 +527,18 @@ Mesh *BKE_mesh_copy(Mesh *me)
 	return men;
 }
 
+Mesh *BKE_mesh_copy(Mesh *me)
+{
+	return BKE_mesh_copy_ex(G.main, me);
+}
+
 BMesh *BKE_mesh_to_bmesh(Mesh *me, Object *ob)
 {
 	BMesh *bm;
 
 	bm = BM_mesh_create(&bm_mesh_allocsize_default);
 
-	BM_mesh_bm_from_me(bm, me, TRUE, ob->shapenr);
+	BM_mesh_bm_from_me(bm, me, true, ob->shapenr);
 
 	return bm;
 }
@@ -1489,7 +1494,7 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, int use_orco_u
 	if (dm == NULL) {
 		if (BKE_mesh_nurbs_displist_to_mdata(ob, dispbase, &allvert, &totvert,
 		                                     &alledge, &totedge, &allloop,
-		                                     &allpoly, (use_orco_uv)? &alluv: NULL,
+		                                     &allpoly, (use_orco_uv) ? &alluv : NULL,
 		                                     &totloop, &totpoly) != 0)
 		{
 			/* Error initializing */
@@ -1497,7 +1502,7 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, int use_orco_u
 		}
 
 		/* make mesh */
-		me = BKE_mesh_add("Mesh");
+		me = BKE_mesh_add(G.main, "Mesh");
 		me->totvert = totvert;
 		me->totedge = totedge;
 		me->totloop = totloop;
@@ -1519,7 +1524,7 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, int use_orco_u
 		BKE_mesh_calc_edges(me, TRUE);
 	}
 	else {
-		me = BKE_mesh_add("Mesh");
+		me = BKE_mesh_add(G.main, "Mesh");
 		DM_to_mesh(dm, me, ob);
 	}
 
@@ -1635,7 +1640,7 @@ void BKE_mesh_from_curve(Scene *scene, Object *ob)
 	BLI_edgehash_free(eh, NULL);
 
 	if (edges.first) {
-		Curve *cu = BKE_curve_add(ob->id.name + 2, OB_CURVE);
+		Curve *cu = BKE_curve_add(G.main, ob->id.name + 2, OB_CURVE);
 		cu->flag |= CU_3D;
 
 		while (edges.first) {
@@ -2574,6 +2579,7 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
 			
 			totfilltri = BLI_scanfill_calc(&sf_ctx, 0);
 			BLI_assert(totfilltri <= mp->totloop - 2);
+			(void)totfilltri;
 
 			for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next, mf++) {
 				mface_to_poly_map[mface_index] = poly_index;
@@ -2993,6 +2999,98 @@ float BKE_mesh_calc_poly_area(MPoly *mpoly, MLoop *loopstart,
 	}
 }
 
+/* note, results won't be correct if polygon is non-planar */
+static float mesh_calc_poly_planar_area_centroid(MPoly *mpoly, MLoop *loopstart, MVert *mvarray, float cent[3])
+{
+	int i;
+	float tri_area;
+	float total_area = 0.0f;
+	float v1[3], v2[3], v3[3], normal[3], tri_cent[3];
+
+	BKE_mesh_calc_poly_normal(mpoly, loopstart, mvarray, normal);
+	copy_v3_v3(v1, mvarray[loopstart[0].v].co);
+	copy_v3_v3(v2, mvarray[loopstart[1].v].co);
+	zero_v3(cent);
+
+	for (i = 2; i < mpoly->totloop; i++) {
+		copy_v3_v3(v3, mvarray[loopstart[i].v].co);
+
+		tri_area = area_tri_signed_v3(v1, v2, v3, normal);
+		total_area += tri_area;
+
+		cent_tri_v3(tri_cent, v1, v2, v3);
+		madd_v3_v3fl(cent, tri_cent, tri_area);
+
+		copy_v3_v3(v2, v3);
+	}
+
+	mul_v3_fl(cent, 1.0f / total_area);
+
+	return total_area;
+}
+
+/**
+ * This function takes the difference between 2 vertex-coord-arrays
+ * (\a vert_cos_src, \a vert_cos_dst),
+ * and applies the difference to \a vert_cos_new relative to \a vert_cos_org.
+ *
+ * \param vert_cos_src reference deform source.
+ * \param vert_cos_dst reference deform destination.
+ *
+ * \param vert_cos_org reference for the output location.
+ * \param vert_cos_new resulting coords.
+ */
+void BKE_mesh_calc_relative_deform(
+        const MPoly *mpoly, const int totpoly,
+        const MLoop *mloop, const int totvert,
+
+        const float (*vert_cos_src)[3],
+        const float (*vert_cos_dst)[3],
+
+        const float (*vert_cos_org)[3],
+              float (*vert_cos_new)[3])
+{
+	const MPoly *mp;
+	int i;
+
+	int *vert_accum = MEM_callocN(sizeof(*vert_accum) * totvert, __func__);
+
+	memset(vert_cos_new, '\0', sizeof(*vert_cos_new) * totvert);
+
+	for (i = 0, mp = mpoly; i < totpoly; i++, mp++) {
+		const MLoop *loopstart = mloop + mp->loopstart;
+		int j;
+
+		for (j = 0; j < mp->totloop; j++) {
+			int v_prev = (loopstart + ((mp->totloop + (j - 1)) % mp->totloop))->v;
+			int v_curr = (loopstart + j)->v;
+			int v_next = (loopstart + ((j + 1) % mp->totloop))->v;
+
+			float tvec[3];
+
+			barycentric_transform(
+			            tvec, vert_cos_dst[v_curr],
+			            vert_cos_org[v_prev], vert_cos_org[v_curr], vert_cos_org[v_next],
+			            vert_cos_src[v_prev], vert_cos_src[v_curr], vert_cos_src[v_next]
+			            );
+
+			add_v3_v3(vert_cos_new[v_curr], tvec);
+			vert_accum[v_curr] += 1;
+		}
+	}
+
+	for (i = 0; i < totvert; i++) {
+		if (vert_accum[i]) {
+			mul_v3_fl(vert_cos_new[i], 1.0f / (float)vert_accum[i]);
+		}
+		else {
+			copy_v3_v3(vert_cos_new[i], vert_cos_org[i]);
+		}
+	}
+
+	MEM_freeN(vert_accum);
+}
+
 /* Find the index of the loop in 'poly' which references vertex,
  * returns -1 if not found */
 int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart,
@@ -3224,9 +3322,8 @@ int BKE_mesh_center_centroid(Mesh *me, float cent[3])
 	
 	/* calculate a weighted average of polygon centroids */
 	for (mpoly = me->mpoly; i--; mpoly++) {
-		BKE_mesh_calc_poly_center(mpoly, me->mloop + mpoly->loopstart, me->mvert, poly_cent);
-		poly_area = BKE_mesh_calc_poly_area(mpoly, me->mloop + mpoly->loopstart, me->mvert, NULL);
-		
+		poly_area = mesh_calc_poly_planar_area_centroid(mpoly, me->mloop + mpoly->loopstart, me->mvert, poly_cent);
+
 		madd_v3_v3fl(cent, poly_cent, poly_area);
 		total_area += poly_area;
 	}
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 69e368f..eceac61 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -216,7 +216,7 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user,
 		colorspace = clip->colorspace_settings.name;
 	}
 
-	loadflag = IB_rect | IB_multilayer;
+	loadflag = IB_rect | IB_multilayer | IB_alphamode_detect;
 
 	/* read ibuf */
 	ibuf = IMB_loadiffname(name, loadflag, colorspace);
@@ -479,11 +479,11 @@ static void put_imbuf_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, i
 /*********************** common functions *************************/
 
 /* only image block itself */
-static MovieClip *movieclip_alloc(const char *name)
+static MovieClip *movieclip_alloc(Main *bmain, const char *name)
 {
 	MovieClip *clip;
 
-	clip = BKE_libblock_alloc(&G.main->movieclip, ID_MC, name);
+	clip = BKE_libblock_alloc(&bmain->movieclip, ID_MC, name);
 
 	clip->aspx = clip->aspy = 1.0f;
 
@@ -542,7 +542,7 @@ static void detect_clip_source(MovieClip *clip)
  * otherwise creates new.
  * does not load ibuf itself
  * pass on optional frame for #name images */
-MovieClip *BKE_movieclip_file_add(const char *name)
+MovieClip *BKE_movieclip_file_add(Main *bmain, const char *name)
 {
 	MovieClip *clip;
 	int file, len;
@@ -550,7 +550,7 @@ MovieClip *BKE_movieclip_file_add(const char *name)
 	char str[FILE_MAX], strtest[FILE_MAX];
 
 	BLI_strncpy(str, name, sizeof(str));
-	BLI_path_abs(str, G.main->name);
+	BLI_path_abs(str, bmain->name);
 
 	/* exists? */
 	file = BLI_open(str, O_BINARY | O_RDONLY, 0);
@@ -559,7 +559,7 @@ MovieClip *BKE_movieclip_file_add(const char *name)
 	close(file);
 
 	/* ** first search an identical clip ** */
-	for (clip = G.main->movieclip.first; clip; clip = clip->id.next) {
+	for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
 		BLI_strncpy(strtest, clip->name, sizeof(clip->name));
 		BLI_path_abs(strtest, G.main->name);
 
@@ -580,7 +580,7 @@ MovieClip *BKE_movieclip_file_add(const char *name)
 		len--;
 	libname = name + len;
 
-	clip = movieclip_alloc(libname);
+	clip = movieclip_alloc(bmain, libname);
 	BLI_strncpy(clip->name, name, sizeof(clip->name));
 
 	detect_clip_source(clip);
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index b12463d..722e1f2 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -1559,7 +1559,7 @@ static void old_mdisps_convert(MFace *mface, MDisps *mdisp)
 				if (S == 1) { (*out)[1] = -(*out)[1]; }
 				else if (S == 2) { SWAP(float, (*out)[0], (*out)[1]); }
 				else if (S == 3) { (*out)[0] = -(*out)[0]; }
-				else if (S == 0) { SWAP(float, (*out)[0], (*out)[1]); (*out)[0] = -(*out)[0]; (*out)[1] = -(*out)[1]; };
+				else if (S == 0) { SWAP(float, (*out)[0], (*out)[1]); (*out)[0] = -(*out)[0]; (*out)[1] = -(*out)[1]; }
 			}
 		}
 	}
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 6f58519..143f218 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1447,9 +1447,9 @@ void BKE_nla_validate_state(AnimData *adt)
 			if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) {
 				/* 1) First strip must be set to extend hold, otherwise, stuff before acts dodgy
 				 * 2) Only overwrite extend mode if *not* changing it will most probably result in 
-				 * occlusion problems, which will occur iff
-				 *	- blendmode = REPLACE
-				 *	- all channels the same (this is fiddly to test, so is currently assumed)
+				 * occlusion problems, which will occur if...
+				 * - blendmode = REPLACE
+				 * - all channels the same (this is fiddly to test, so is currently assumed)
 				 *
 				 * Should fix problems such as [#29869]
 				 */
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 84e2800..97bee32 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -656,7 +656,7 @@ void nodeDetachNode(struct bNode *node)
 	}
 }
 
-bNodeTree *ntreeAddTree(const char *name, int type, int nodetype)
+bNodeTree *ntreeAddTree(Main *bmain, const char *name, int type, int nodetype)
 {
 	bNodeTree *ntree;
 	bNodeType *ntype;
@@ -670,7 +670,7 @@ bNodeTree *ntreeAddTree(const char *name, int type, int nodetype)
 		BLI_strncpy(ntree->id.name + 2, name, sizeof(ntree->id.name));
 	}
 	else
-		ntree = BKE_libblock_alloc(&G.main->nodetree, ID_NT, name);
+		ntree = BKE_libblock_alloc(&bmain->nodetree, ID_NT, name);
 	
 	ntree->type = type;
 	ntree->nodetype = nodetype;
@@ -1035,9 +1035,6 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const short do_id_user)
 	 */
 	if (ntree->execdata) {
 		switch (ntree->type) {
-			case NTREE_COMPOSIT:
-				ntreeCompositEndExecTree(ntree->execdata, 1);
-				break;
 			case NTREE_SHADER:
 				ntreeShaderEndExecTree(ntree->execdata, 1);
 				break;
@@ -1637,7 +1634,7 @@ void BKE_node_clipboard_add_node(bNode *node)
 {
 #ifdef USE_NODE_CB_VALIDATE
 	/* add extra info */
-	bNodeClipboardExtraInfo *node_info = MEM_mallocN(sizeof(bNodeClipboardExtraInfo), STRINGIFY(bNodeClipboardExtraInfo));
+	bNodeClipboardExtraInfo *node_info = MEM_mallocN(sizeof(bNodeClipboardExtraInfo), "bNodeClipboardExtraInfo");
 
 	node_info->id = node->id;
 	if (node->id) {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index b2371da..58b4739 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -58,6 +58,7 @@
 #include "DNA_world_types.h"
 #include "DNA_object_types.h"
 #include "DNA_property_types.h"
+#include "DNA_rigidbody_types.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
@@ -83,6 +84,7 @@
 #include "BKE_fcurve.h"
 #include "BKE_group.h"
 #include "BKE_icons.h"
+#include "BKE_image.h"
 #include "BKE_key.h"
 #include "BKE_lamp.h"
 #include "BKE_lattice.h"
@@ -97,6 +99,7 @@
 #include "BKE_particle.h"
 #include "BKE_pointcache.h"
 #include "BKE_property.h"
+#include "BKE_rigidbody.h"
 #include "BKE_sca.h"
 #include "BKE_scene.h"
 #include "BKE_sequencer.h"
@@ -308,6 +311,9 @@ void free_sculptsession(Object *ob)
 		if (ss->texcache)
 			MEM_freeN(ss->texcache);
 
+		if (ss->tex_pool)
+			BKE_image_pool_free(ss->tex_pool);
+
 		if (ss->layer_co)
 			MEM_freeN(ss->layer_co);
 
@@ -382,6 +388,8 @@ void BKE_object_free(Object *ob)
 	BKE_free_constraints(&ob->constraints);
 	
 	free_partdeflect(ob->pd);
+	BKE_rigidbody_free_object(ob);
+	BKE_rigidbody_free_constraint(ob);
 
 	if (ob->soft) sbFree(ob->soft);
 	if (ob->bsoft) bsbFree(ob->bsoft);
@@ -822,16 +830,16 @@ int BKE_object_exists_check(Object *obtest)
 void *BKE_object_obdata_add_from_type(int type)
 {
 	switch (type) {
-		case OB_MESH:      return BKE_mesh_add("Mesh");
-		case OB_CURVE:     return BKE_curve_add("Curve", OB_CURVE);
-		case OB_SURF:      return BKE_curve_add("Surf", OB_SURF);
-		case OB_FONT:      return BKE_curve_add("Text", OB_FONT);
-		case OB_MBALL:     return BKE_mball_add("Meta");
-		case OB_CAMERA:    return BKE_camera_add("Camera");
-		case OB_LAMP:      return BKE_lamp_add("Lamp");
-		case OB_LATTICE:   return BKE_lattice_add("Lattice");
-		case OB_ARMATURE:  return BKE_armature_add("Armature");
-		case OB_SPEAKER:   return BKE_speaker_add("Speaker");
+		case OB_MESH:      return BKE_mesh_add(G.main, "Mesh");
+		case OB_CURVE:     return BKE_curve_add(G.main, "Curve", OB_CURVE);
+		case OB_SURF:      return BKE_curve_add(G.main, "Surf", OB_SURF);
+		case OB_FONT:      return BKE_curve_add(G.main, "Text", OB_FONT);
+		case OB_MBALL:     return BKE_mball_add(G.main, "Meta");
+		case OB_CAMERA:    return BKE_camera_add(G.main, "Camera");
+		case OB_LAMP:      return BKE_lamp_add(G.main, "Lamp");
+		case OB_LATTICE:   return BKE_lattice_add(G.main, "Lattice");
+		case OB_ARMATURE:  return BKE_armature_add(G.main, "Armature");
+		case OB_SPEAKER:   return BKE_speaker_add(G.main, "Speaker");
 		case OB_EMPTY:     return NULL;
 		default:
 			printf("BKE_object_obdata_add_from_type: Internal error, bad type: %d\n", type);
@@ -860,14 +868,14 @@ static const char *get_obdata_defname(int type)
 }
 
 /* more general add: creates minimum required data, but without vertices etc. */
-Object *BKE_object_add_only_object(int type, const char *name)
+Object *BKE_object_add_only_object(Main *bmain, int type, const char *name)
 {
 	Object *ob;
 
 	if (!name)
 		name = get_obdata_defname(type);
 
-	ob = BKE_libblock_alloc(&G.main->object, ID_OB, name);
+	ob = BKE_libblock_alloc(&bmain->object, ID_OB, name);
 
 	/* default object vars */
 	ob->type = type;
@@ -953,7 +961,7 @@ Object *BKE_object_add(struct Scene *scene, int type)
 	char name[MAX_ID_NAME];
 
 	BLI_strncpy(name, get_obdata_defname(type), sizeof(name));
-	ob = BKE_object_add_only_object(type, name);
+	ob = BKE_object_add_only_object(G.main, type, name);
 
 	ob->data = BKE_object_obdata_add_from_type(type);
 
@@ -1219,13 +1227,13 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
 	copy_v3_v3(ob_tar->size, ob_src->size);
 }
 
-static Object *object_copy_do(Object *ob, int copy_caches)
+Object *BKE_object_copy_ex(Main *bmain, Object *ob, int copy_caches)
 {
 	Object *obn;
 	ModifierData *md;
 	int a;
 
-	obn = BKE_libblock_copy(&ob->id);
+	obn = BKE_libblock_copy_ex(bmain, &ob->id);
 	
 	if (ob->totcol) {
 		obn->mat = MEM_dupallocN(ob->mat);
@@ -1282,6 +1290,8 @@ static Object *object_copy_do(Object *ob, int copy_caches)
 	}
 	obn->soft = copy_softbody(ob->soft, copy_caches);
 	obn->bsoft = copy_bulletsoftbody(ob->bsoft);
+	obn->rigidbody_object = BKE_rigidbody_copy_object(ob);
+	obn->rigidbody_constraint = BKE_rigidbody_copy_constraint(ob);
 
 	BKE_object_copy_particlesystems(obn, ob);
 	
@@ -1299,13 +1309,7 @@ static Object *object_copy_do(Object *ob, int copy_caches)
 /* copy objects, will re-initialize cached simulation data */
 Object *BKE_object_copy(Object *ob)
 {
-	return object_copy_do(ob, FALSE);
-}
-
-/* copy objects, will duplicate cached simulation data */
-Object *BKE_object_copy_with_caches(Object *ob)
-{
-	return object_copy_do(ob, TRUE);
+	return BKE_object_copy_ex(G.main, ob, FALSE);
 }
 
 static void extern_local_object(Object *ob)
@@ -1799,7 +1803,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[4][4])
 		CLAMP(ctime, 0.0f, 1.0f);
 	}
 	else {
-		ctime = scene->r.cfra;
+		ctime = BKE_scene_frame_get(scene);
 		if (IS_EQF(cu->pathlen, 0.0f) == 0)
 			ctime /= cu->pathlen;
 		
@@ -2010,7 +2014,7 @@ static void ob_parvert3(Object *ob, Object *par, float mat[4][4])
 		else {
 			add_v3_v3v3(mat[3], v1, v2);
 			add_v3_v3(mat[3], v3);
-			mul_v3_fl(mat[3], 0.3333333f);
+			mul_v3_fl(mat[3], 1.0f / 3.0f);
 		}
 	}
 }
@@ -2113,7 +2117,9 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[
 	return 1;
 }
 
-void BKE_object_where_is_calc_time(Scene *scene, Object *ob, float ctime)
+/* note, scene is the active scene while actual_scene is the scene the object resides in */
+void BKE_object_where_is_calc_time_ex(Scene *scene, Object *ob, float ctime,
+                                      RigidBodyWorld *rbw)
 {
 	if (ob == NULL) return;
 	
@@ -2138,6 +2144,11 @@ void BKE_object_where_is_calc_time(Scene *scene, Object *ob, float ctime)
 	else {
 		BKE_object_to_mat4(ob, ob->obmat);
 	}
+
+	/* try to fall back to the scene rigid body world if none given */
+	rbw = rbw ? rbw : scene->rigidbody_world;
+	/* read values pushed into RBO from sim/cache... */
+	BKE_rigidbody_sync_transforms(rbw, ob, ctime);
 	
 	/* solve constraints */
 	if (ob->constraints.first && !(ob->transflag & OB_NO_CONSTRAINTS)) {
@@ -2153,6 +2164,11 @@ void BKE_object_where_is_calc_time(Scene *scene, Object *ob, float ctime)
 	else ob->transflag &= ~OB_NEG_SCALE;
 }
 
+void BKE_object_where_is_calc_time(Scene *scene, Object *ob, float ctime)
+{
+	BKE_object_where_is_calc_time_ex(scene, ob, ctime, NULL);
+}
+
 /* get object transformation matrix without recalculating dependencies and
  * constraints -- assume dependencies are already solved by depsgraph.
  * no changes to object and it's parent would be done.
@@ -2174,15 +2190,19 @@ void BKE_object_where_is_calc_mat4(Scene *scene, Object *ob, float obmat[4][4])
 	}
 }
 
-void BKE_object_where_is_calc(struct Scene *scene, Object *ob)
+void BKE_object_where_is_calc_ex(Scene *scene, RigidBodyWorld *rbw, Object *ob)
 {
-	BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
+	BKE_object_where_is_calc_time_ex(scene, ob, BKE_scene_frame_get(scene), rbw);
+}
+void BKE_object_where_is_calc(Scene *scene, Object *ob)
+{
+	BKE_object_where_is_calc_time_ex(scene, ob, BKE_scene_frame_get(scene), NULL);
 }
 
-void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
 /* was written for the old game engine (until 2.04) */
 /* It seems that this function is only called
  * for a lamp that is the child of another object */
+void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
 {
 	Object *par;
 	float *fp1, *fp2;
@@ -2215,7 +2235,7 @@ void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
 		bConstraintOb *cob;
 		
 		cob = BKE_constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
-		BKE_solve_constraints(&ob->constraints, cob, (float)scene->r.cfra);
+		BKE_solve_constraints(&ob->constraints, cob, BKE_scene_frame_get(scene));
 		BKE_constraints_clear_evalob(cob);
 	}
 }
@@ -2612,7 +2632,9 @@ int BKE_object_parent_loop_check(const Object *par, const Object *ob)
 
 /* the main object update call, for object matrix, constraints, keys and displist (modifiers) */
 /* requires flags to be set! */
-void BKE_object_handle_update(Scene *scene, Object *ob)
+/* Ideally we shouldn't have to pass the rigid body world, but need bigger restructuring to avoid id */
+void BKE_object_handle_update_ex(Scene *scene, Object *ob,
+                                 RigidBodyWorld *rbw)
 {
 	if (ob->recalc & OB_RECALC_ALL) {
 		/* speed optimization for animation lookups */
@@ -2653,13 +2675,13 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
 					copy_m4_m4(ob->obmat, ob->proxy_from->obmat);
 			}
 			else
-				BKE_object_where_is_calc(scene, ob);
+				BKE_object_where_is_calc_ex(scene, rbw, 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... */
+			float ctime = BKE_scene_frame_get(scene);
 			
 			if (G.debug & G_DEBUG)
 				printf("recalcdata %s\n", ob->id.name + 2);
@@ -2700,8 +2722,10 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
 
 				case OB_ARMATURE:
 					if (ob->id.lib && ob->proxy_from) {
-						// printf("pose proxy copy, lib ob %s proxy %s\n", ob->id.name, ob->proxy_from->id.name);
-						BKE_pose_copy_result(ob->pose, ob->proxy_from->pose);
+						if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
+							printf("Proxy copy error, lib Object: %s proxy Object: %s\n",
+							       ob->id.name + 2, ob->proxy_from->id.name + 2);
+						}
 					}
 					else {
 						BKE_pose_where_is(scene, ob);
@@ -2805,6 +2829,15 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
 		// printf("set proxy pointer for later group stuff %s\n", ob->id.name);
 	}
 }
+/* WARNING: "scene" here may not be the scene object actually resides in. 
+ * When dealing with background-sets, "scene" is actually the active scene.
+ * e.g. "scene" <-- set 1 <-- set 2 ("ob" lives here) <-- set 3 <-- ... <-- set n
+ * rigid bodies depend on their world so use BKE_object_handle_update_ex() to also pass along the corrent rigid body world
+ */
+void BKE_object_handle_update(Scene *scene, Object *ob)
+{
+	BKE_object_handle_update_ex(scene, ob, NULL);
+}
 
 void BKE_object_sculpt_modifiers_changed(Object *ob)
 {
@@ -3178,6 +3211,9 @@ void BKE_object_relink(Object *ob)
 
 	if (ob->adt)
 		BKE_relink_animdata(ob->adt);
+	
+	if (ob->rigidbody_constraint)
+		BKE_rigidbody_relink_constraint(ob->rigidbody_constraint);
 
 	ID_NEW(ob->parent);
 
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index c4274aa..695ac7d 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -35,10 +35,6 @@
 
 #include "DNA_scene_types.h"
 
-#include "BKE_global.h" /* XXX TESTING */
-#include "BKE_image.h"
-#include "BKE_ocean.h"
-
 #include "BLI_math.h"
 #include "BLI_path_util.h"
 #include "BLI_rand.h"
@@ -46,6 +42,9 @@
 #include "BLI_threads.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_image.h"
+#include "BKE_ocean.h"
+
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
 
@@ -1425,4 +1424,4 @@ void BKE_bake_ocean(struct Ocean *UNUSED(o), struct OceanCache *UNUSED(och),
 	/* unused */
 	(void)update_cb;
 }
-#endif /* WITH_OCEANSIM */
\ No newline at end of file
+#endif /* WITH_OCEANSIM */
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 9fab052..288e4cc 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -44,9 +44,9 @@
 
 #include "DNA_image_types.h"
 #include "DNA_ID.h"
+#include "DNA_packedFile_types.h"
 #include "DNA_sound_types.h"
 #include "DNA_vfont_types.h"
-#include "DNA_packedFile_types.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
@@ -233,11 +233,13 @@ void packAll(Main *bmain, ReportList *reports)
 	Image *ima;
 	VFont *vfont;
 	bSound *sound;
+	int tot = 0;
 	
 	for (ima = bmain->image.first; ima; ima = ima->id.next) {
 		if (ima->packedfile == NULL && ima->id.lib == NULL) {
 			if (ima->source == IMA_SRC_FILE) {
 				ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
+				tot ++;
 			}
 			else if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
 				BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported",
@@ -246,13 +248,26 @@ void packAll(Main *bmain, ReportList *reports)
 		}
 	}
 
-	for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next)
-		if (vfont->packedfile == NULL && vfont->id.lib == NULL && BKE_vfont_is_builtin(vfont) == FALSE)
+	for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next) {
+		if (vfont->packedfile == NULL && vfont->id.lib == NULL && BKE_vfont_is_builtin(vfont) == FALSE) {
 			vfont->packedfile = newPackedFile(reports, vfont->name, bmain->name);
+			tot ++;
+		}
+	}
 
-	for (sound = bmain->sound.first; sound; sound = sound->id.next)
-		if (sound->packedfile == NULL && sound->id.lib == NULL)
+	for (sound = bmain->sound.first; sound; sound = sound->id.next) {
+		if (sound->packedfile == NULL && sound->id.lib == NULL) {
 			sound->packedfile = newPackedFile(reports, sound->name, bmain->name);
+			tot++;
+		}
+	}
+	
+	if (tot == 0)
+		BKE_report(reports, RPT_INFO, "No files have been packed");
+	else
+		BKE_reportf(reports, RPT_INFO, "Packed %d files", tot);
+
+
 }
 
 
@@ -316,6 +331,9 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
 			BKE_reportf(reports, RPT_ERROR, "Error writing file '%s'", name);
 			ret_value = RET_ERROR;
 		}
+		else
+			BKE_reportf(reports, RPT_INFO, "Saved packed file to: %s", name);
+		
 		close(file);
 	}
 	else {
@@ -439,6 +457,7 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na
 			case PF_USE_ORIGINAL:
 				/* if file exists use it */
 				if (BLI_exists(abs_name)) {
+					BKE_reportf(reports, RPT_INFO, "Use existing file (instead of packed): %s", abs_name);
 					temp = abs_name;
 					break;
 				}
@@ -604,3 +623,48 @@ void unpackAll(Main *bmain, ReportList *reports, int how)
 			unpackSound(bmain, reports, sound, how);
 }
 
+/* ID should be not NULL, return 1 if there's a packed file */
+int BKE_pack_check(ID *id)
+{
+	if (GS(id->name) == ID_IM) {
+		Image *ima = (Image *)id;
+		return ima->packedfile != NULL;
+	}
+	if (GS(id->name) == ID_VF) {
+		VFont *vf = (VFont *)id;
+		return vf->packedfile != NULL;
+	}
+	if (GS(id->name) == ID_SO) {
+		bSound *snd = (bSound *)id;
+		return snd->packedfile != NULL;
+	}
+	if (GS(id->name) == ID_LI) {
+		Library *li = (Library *)id;
+		return li->packedfile != NULL;
+	}
+	return 0;
+}
+
+/* ID should be not NULL */
+void BKE_unpack_id(Main *bmain, ID *id, ReportList *reports, int how)
+{
+	if (GS(id->name) == ID_IM) {
+		Image *ima = (Image *)id;
+		if (ima->packedfile)
+			unpackImage(reports, ima, how);
+	}
+	if (GS(id->name) == ID_VF) {
+		VFont *vf = (VFont *)id;
+		if (vf->packedfile)
+			unpackVFont(reports, vf, how);
+	}
+	if (GS(id->name) == ID_SO) {
+		bSound *snd = (bSound *)id;
+		if (snd->packedfile)
+			unpackSound(bmain, reports, snd, how);
+	}
+	if (GS(id->name) == ID_LI) {
+		Library *li = (Library *)id;
+		BKE_reportf(reports, RPT_ERROR, "Cannot unpack individual Library file, '%s'", li->name);
+	}
+}
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 5847e75..d34d5ea 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -43,10 +43,13 @@
 
 #include "BKE_brush.h"
 #include "BKE_context.h"
+#include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_paint.h"
 #include "BKE_subsurf.h"
 
+#include "bmesh.h"
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -177,7 +180,7 @@ void BKE_paint_init(Paint *p, const char col[3])
 	/* If there's no brush, create one */
 	brush = paint_brush(p);
 	if (brush == NULL)
-		brush = BKE_brush_add("Brush");
+		brush = BKE_brush_add(G.main, "Brush");
 	paint_brush_set(p, brush);
 
 	memcpy(p->paint_cursor_col, col, 3);
@@ -224,6 +227,22 @@ int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
 	        BLI_BITMAP_GET(grid_hidden, (y + 1) * gridsize + x));
 }
 
+/* Return TRUE if all vertices in the face are visible, FALSE otherwise */
+int paint_is_bmesh_face_hidden(BMFace *f)
+{
+	BMLoop *l_iter;
+	BMLoop *l_first;
+
+	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+	do {
+		if (BM_elem_flag_test(l_iter->v, BM_ELEM_HIDDEN)) {
+			return true;
+		}
+	} while ((l_iter = l_iter->next) != l_first);
+
+	return false;
+}
+
 float paint_grid_paint_mask(const GridPaintMask *gpm, unsigned level,
                             unsigned x, unsigned y)
 {
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index b285196..c01ea4e 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -684,8 +684,6 @@ void psys_render_set(Object *ob, ParticleSystem *psys, float viewmat[4][4], floa
 	ParticleRenderData *data;
 	ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
 
-	if (G.is_rendering == FALSE)
-		return;
 	if (psys->renderdata)
 		return;
 
@@ -2384,7 +2382,7 @@ void psys_find_parents(ParticleSimulationData *sim)
 	int from = PART_FROM_FACE;
 	totparent = (int)(totchild * part->parents * 0.3f);
 
-	if (G.is_rendering && part->child_nbr && part->ren_child_nbr)
+	if ((sim->psys->renderdata || G.is_rendering) && part->child_nbr && part->ren_child_nbr)
 		totparent *= (float)part->child_nbr / (float)part->ren_child_nbr;
 
 	tree = BLI_kdtree_new(totparent);
@@ -2461,7 +2459,7 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c
 	if (totchild && part->childtype == PART_CHILD_FACES) {
 		totparent = (int)(totchild * part->parents * 0.3f);
 		
-		if (G.is_rendering && part->child_nbr && part->ren_child_nbr)
+		if ((psys->renderdata || G.is_rendering) && part->child_nbr && part->ren_child_nbr)
 			totparent *= (float)part->child_nbr / (float)part->ren_child_nbr;
 
 		/* part->parents could still be 0 so we can't test with totparent */
@@ -3849,7 +3847,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
 					break;
 			}
 
-			externtex(mtex, texvec, &value, rgba, rgba + 1, rgba + 2, rgba + 3, 0);
+			externtex(mtex, texvec, &value, rgba, rgba + 1, rgba + 2, rgba + 3, 0, NULL);
 
 			if ((event & mtex->mapto) & PAMAP_ROUGH)
 				ptex->rough1 = ptex->rough2 = ptex->roughe = texture_value_blend(def, ptex->rough1, value, mtex->roughfac, blend);
@@ -3920,7 +3918,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
 					break;
 			}
 
-			externtex(mtex, texvec, &value, rgba, rgba + 1, rgba + 2, rgba + 3, 0);
+			externtex(mtex, texvec, &value, rgba, rgba + 1, rgba + 2, rgba + 3, 0, NULL);
 
 			if ((event & mtex->mapto) & PAMAP_TIME) {
 				/* the first time has to set the base value for time regardless of blend mode */
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 5eac86a..3efe257 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -802,7 +802,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
 				if (mface->v4)
 					psys_uv_to_w(0.5f, 0.5f, mface->v4, pa->fuv);
 				else
-					psys_uv_to_w(0.33333f, 0.33333f, mface->v4, pa->fuv);
+					psys_uv_to_w(1.0f / 3.0f, 1.0f / 3.0f, mface->v4, pa->fuv);
 			}
 			else {
 				ctx->jitoff[i] = fmod(ctx->jitoff[i],(float)ctx->jitlevel);
@@ -3028,13 +3028,20 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
 	normalize_qt(pa->state.rot);
 }
 
-/************************************************/
-/*			Collisions							*/
-/************************************************/
+/************************************************
+ *			Collisions
+ *
+ * The algorithm is roughly:
+ *  1. Use a BVH tree to search for faces that a particle may collide with.
+ *  2. Use Newton's method to find the exact time at which the collision occurs.
+ *     http://en.wikipedia.org/wiki/Newton's_method
+ *
+ ************************************************/
 #define COLLISION_MAX_COLLISIONS	10
 #define COLLISION_MIN_RADIUS 0.001f
 #define COLLISION_MIN_DISTANCE 0.0001f
 #define COLLISION_ZERO 0.00001f
+#define COLLISION_INIT_STEP 0.00008f
 typedef float (*NRDistanceFunc)(float *p, float radius, ParticleCollisionElement *pce, float *nor);
 static float nr_signed_distance_to_plane(float *p, float radius, ParticleCollisionElement *pce, float *nor)
 {
@@ -3189,16 +3196,20 @@ static void collision_point_on_surface(float p[3], ParticleCollisionElement *pce
 /* find first root in range [0-1] starting from 0 */
 static float collision_newton_rhapson(ParticleCollision *col, float radius, ParticleCollisionElement *pce, NRDistanceFunc distance_func)
 {
-	float t0, t1, d0, d1, dd, n[3];
+	float t0, t1, dt_init, d0, d1, dd, n[3];
 	int iter;
 
 	pce->inv_nor = -1;
 
+	/* Initial step size should be small, but not too small or floating point
+	 * precision errors will appear. - z0r */
+	dt_init = COLLISION_INIT_STEP * col->inv_total_time;
+
 	/* start from the beginning */
 	t0 = 0.f;
 	collision_interpolate_element(pce, t0, col->f, col);
 	d0 = distance_func(col->co1, radius, pce, n);
-	t1 = 0.001f;
+	t1 = dt_init;
 	d1 = 0.f;
 
 	for (iter=0; iter<10; iter++) {//, itersum++) {
@@ -3208,11 +3219,6 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
 
 		d1 = distance_func(pce->p, radius, pce, n);
 
-		/* no movement, so no collision */
-		if (d1 == d0) {
-			return -1.f;
-		}
-
 		/* particle already inside face, so report collision */
 		if (iter == 0 && d0 < 0.f && d0 > -radius) {
 			copy_v3_v3(pce->p, col->co1);
@@ -3220,7 +3226,24 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
 			pce->inside = 1;
 			return 0.f;
 		}
-		
+
+		/* Zero gradient (no movement relative to element). Can't step from
+		 * here. */
+		if (d1 == d0) {
+			/* If first iteration, try from other end where the gradient may be
+			 * greater. Note: code duplicated below. */
+			if (iter == 0) {
+				t0 = 1.f;
+				collision_interpolate_element(pce, t0, col->f, col);
+				d0 = distance_func(col->co2, radius, pce, n);
+				t1 = 1.0f - dt_init;
+				d1 = 0.f;
+				continue;
+			}
+			else
+				return -1.f;
+		}
+
 		dd = (t1-t0)/(d1-d0);
 
 		t0 = t1;
@@ -3228,14 +3251,14 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
 
 		t1 -= d1*dd;
 
-		/* particle movin away from plane could also mean a strangely rotating face, so check from end */
+		/* Particle moving away from plane could also mean a strangely rotating
+		 * face, so check from end. Note: code duplicated above. */
 		if (iter == 0 && t1 < 0.f) {
 			t0 = 1.f;
 			collision_interpolate_element(pce, t0, col->f, col);
 			d0 = distance_func(col->co2, radius, pce, n);
-			t1 = 0.999f;
+			t1 = 1.0f - dt_init;
 			d1 = 0.f;
-
 			continue;
 		}
 		else if (iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.f))
@@ -3683,6 +3706,7 @@ static void collision_check(ParticleSimulationData *sim, int p, float dfra, floa
 	memset(&col, 0, sizeof(ParticleCollision));
 
 	col.total_time = timestep * dfra;
+	col.inv_total_time = 1.0f/col.total_time;
 	col.inv_timestep = 1.0f/timestep;
 
 	col.cfra = cfra;
@@ -4500,7 +4524,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
 	int startframe = 0, endframe = 100, oldtotpart = 0;
 
 	/* cache shouldn't be used for hair or "continue physics" */
-	if (part->type != PART_HAIR && BKE_ptcache_get_continue_physics() == 0) {
+	if (part->type != PART_HAIR) {
 		psys_clear_temp_pointcache(psys);
 
 		/* set suitable cache range automatically */
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 2df2dd6..483dd25 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1238,6 +1238,19 @@ PBVHType BKE_pbvh_type(const PBVH *bvh)
 	return bvh->type;
 }
 
+void BKE_pbvh_bounding_box(const PBVH *bvh, float min[3], float max[3])
+{
+	if (bvh->totnode) {
+		const BB *bb = &bvh->nodes[0].vb;
+		copy_v3_v3(min, bb->bmin);
+		copy_v3_v3(max, bb->bmax);
+	}
+	else {
+		zero_v3(min);
+		zero_v3(max);
+	}
+}
+
 BLI_bitmap *BKE_pbvh_grid_hidden(const PBVH *bvh)
 {
 	BLI_assert(bvh->type == PBVH_GRIDS);
@@ -1386,10 +1399,10 @@ void BKE_pbvh_raycast(PBVH *bvh, BKE_pbvh_HitOccludedCallback cb, void *data,
 }
 
 int ray_face_intersection(const float ray_start[3],
-						  const float ray_normal[3],
-						  const float *t0, const float *t1,
-						  const float *t2, const float *t3,
-						  float *fdist)
+                          const float ray_normal[3],
+                          const float *t0, const float *t1,
+                          const float *t2, const float *t3,
+                          float *fdist)
 {
 	float dist;
 
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 791288a..666c85d 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -28,6 +28,7 @@
 #include "BKE_ccg.h"
 #include "BKE_DerivedMesh.h"
 #include "BKE_global.h"
+#include "BKE_paint.h"
 #include "BKE_pbvh.h"
 
 #include "GPU_buffers.h"
@@ -53,7 +54,8 @@ static void pbvh_bmesh_node_finalize(PBVH *bvh, int node_index)
 
 	GHASH_ITER (gh_iter, n->bm_faces) {
 		BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
-		BMIter bm_iter;
+		BMLoop *l_iter;
+		BMLoop *l_first;
 		BMVert *v;
 		void *node_val = SET_INT_IN_POINTER(node_index);
 
@@ -61,7 +63,9 @@ static void pbvh_bmesh_node_finalize(PBVH *bvh, int node_index)
 		BLI_ghash_insert(bvh->bm_face_to_node, f, node_val);
 
 		/* Update vertices */
-		BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
+		l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+		do {
+			v = l_iter->v;
 			if (!BLI_ghash_haskey(n->bm_unique_verts, v)) {
 				if (BLI_ghash_haskey(bvh->bm_vert_to_node, v)) {
 					if (!BLI_ghash_haskey(n->bm_other_verts, v))
@@ -74,7 +78,7 @@ static void pbvh_bmesh_node_finalize(PBVH *bvh, int node_index)
 			}
 			/* Update node bounding box */
 			BB_expand(&n->vb, v->co);
-		}
+		} while ((l_iter = l_iter->next) != l_first);
 	}
 
 	BLI_assert(n->vb.bmin[0] <= n->vb.bmax[0] &&
@@ -233,15 +237,16 @@ static int pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index)
 	prim_bbc = BLI_ghash_ptr_new("prim_bbc");
 
 	GHASH_ITER (gh_iter, bvh->nodes[node_index].bm_faces) {
-		BMIter bm_iter;
-		BMVert *v;
 		BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
 		BBC *bbc = MEM_callocN(sizeof(BBC), "BBC");
+		BMLoop *l_iter;
+		BMLoop *l_first;
 
 		BB_reset((BB *)bbc);
-		BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
-			BB_expand((BB *)bbc, v->co);
-		}
+		l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+		do {
+			BB_expand((BB *)bbc, l_iter->v->co);
+		} while ((l_iter = l_iter->next) != l_first);
 		BBC_update_centroid(bbc);
 
 		BLI_ghash_insert(prim_bbc, f, bbc);
@@ -286,16 +291,16 @@ static BMVert *pbvh_bmesh_vert_create(PBVH *bvh, int node_index,
 	return v;
 }
 
-static BMFace *pbvh_bmesh_face_create(PBVH *bvh, int node_index, BMVert *v1,
-									  BMVert *v2, BMVert *v3,
-									  const BMFace *UNUSED(example))
+static BMFace *pbvh_bmesh_face_create(PBVH *bvh, int node_index,
+                                      BMVert *v1, BMVert *v2, BMVert *v3,
+                                      const BMFace *UNUSED(example))
 {
 	BMFace *f;
 	void *val = SET_INT_IN_POINTER(node_index);
 
 	/* Note: passing NULL for the 'example' parameter, profiling shows
 	 * a small performance bump */
-	f = BM_face_create_quad_tri(bvh->bm, v1, v2, v3, NULL, NULL, TRUE);
+	f = BM_face_create_quad_tri(bvh->bm, v1, v2, v3, NULL, NULL, true);
 	if (!BLI_ghash_haskey(bvh->bm_face_to_node, f)) {
 
 		BLI_ghash_insert(bvh->nodes[node_index].bm_faces, f, NULL);
@@ -394,14 +399,18 @@ static void pbvh_bmesh_vert_remove(PBVH *bvh, BMVert *v)
 static void pbvh_bmesh_face_remove(PBVH *bvh, BMFace *f)
 {
 	PBVHNode *f_node;
-	BMIter bm_iter;
 	BMVert *v;
 
+	BMLoop *l_iter;
+	BMLoop *l_first;
+
 	f_node = pbvh_bmesh_node_lookup(bvh, bvh->bm_face_to_node, f);
 
 	/* Check if any of this face's vertices need to be removed
 	 * from the node */
-	BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
+	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+	do {
+		v = l_iter->v;
 		if (pbvh_bmesh_node_vert_use_count(bvh, f_node, v) == 1) {
 			if (BLI_ghash_lookup(f_node->bm_unique_verts, v)) {
 				/* Find a different node that uses 'v' */
@@ -419,7 +428,7 @@ static void pbvh_bmesh_face_remove(PBVH *bvh, BMFace *f)
 				BLI_ghash_remove(f_node->bm_other_verts, v, NULL, NULL);
 			}
 		}
-	}
+	} while ((l_iter = l_iter->next) != l_first);
 
 	/* Remove face from node and top level */
 	BLI_ghash_remove(f_node->bm_faces, f, NULL, NULL);
@@ -429,57 +438,20 @@ static void pbvh_bmesh_face_remove(PBVH *bvh, BMFace *f)
 	BM_log_face_removed(bvh->bm_log, f);
 }
 
-static BMVert *bm_triangle_other_vert_find(BMFace *triangle, const BMVert *v1,
-										   const BMVert *v2)
+static void pbvh_bmesh_edge_loops(BLI_Buffer *buf, BMEdge *e)
 {
-	BLI_assert(triangle->len == 3);
-	BLI_assert(v1 != v2);
-
-	if (triangle->len == 3) {
-		BMIter iter;
-		BMVert *v, *other = NULL;
-		int found_v1 = FALSE, found_v2 = FALSE;
-
-		BM_ITER_ELEM (v, &iter, triangle, BM_VERTS_OF_FACE) {
-			if (v == v1)
-				found_v1 = TRUE;
-			else if (v == v2)
-				found_v2 = TRUE;
-			else
-				other = v;
-		}
-
-		if (found_v1 && found_v2)
-			return other;
+	/* fast-path for most common case where an edge has 2 faces,
+	 * no need to iterate twice.
+	 * This assumes that the buffer */
+	BMLoop **data = buf->data;
+	BLI_assert(buf->alloc_count >= 2);
+	if (LIKELY(BM_edge_loop_pair(e, &data[0], &data[1]))) {
+		buf->count = 2;
 	}
-
-	BLI_assert(0);
-	return NULL;
-}
-
-static void pbvh_bmesh_edge_faces(BLI_Buffer *buf, BMEdge *e)
-{
-	BLI_buffer_resize(buf, BM_edge_face_count(e));
-	BM_iter_as_array(NULL, BM_FACES_OF_EDGE, e, buf->data, buf->count);
-}
-
-/* TODO: maybe a better way to do this, if not then this should go to
- * bmesh_queries */
-static int bm_face_edge_backwards(BMFace *f, BMEdge *e)
-{
-	BMIter bm_iter;
-	BMLoop *l, *l1 = NULL, *l2 = NULL;
-
-	BM_ITER_ELEM (l, &bm_iter, f, BM_LOOPS_OF_FACE) {
-		if (l->v == e->v1)
-			l1 = l;
-		else if (l->v == e->v2)
-			l2 = l;
+	else {
+		BLI_buffer_resize(buf, BM_edge_face_count(e));
+		BM_iter_as_array(NULL, BM_LOOPS_OF_EDGE, e, buf->data, buf->count);
 	}
-
-	BLI_assert(l1 && l2);
-	BLI_assert(l1->next == l2 || l2->next == l1);
-	return l2->next == l1;
 }
 
 static void pbvh_bmesh_node_drop_orig(PBVHNode *node)
@@ -504,12 +476,14 @@ typedef struct {
 
 static int edge_queue_tri_in_sphere(const EdgeQueue *q, BMFace *f)
 {
-	BMVert *v[3];
+	BMVert *v_tri[3];
 	float c[3];
 
 	/* Get closest point in triangle to sphere center */
-	BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v, 3);
-	closest_on_tri_to_point_v3(c, q->center, v[0]->co, v[1]->co, v[2]->co);
+	// BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v_tri, 3);
+	BM_face_as_array_vert_tri(f, v_tri);
+
+	closest_on_tri_to_point_v3(c, q->center, v_tri[0]->co, v_tri[1]->co, v_tri[2]->co);
 
 	/* Check if triangle intersects the sphere */
 	return ((len_squared_v3v3(q->center, c) <= q->radius_squared));
@@ -542,36 +516,34 @@ static void short_edge_queue_edge_add(EdgeQueue *q, BLI_mempool *pool,
 		edge_queue_insert(q, pool, e, len_sq);
 }
 
-static int long_edge_queue_face_add(EdgeQueue *q, BLI_mempool *pool,
-									BMFace *f)
+static void long_edge_queue_face_add(EdgeQueue *q, BLI_mempool *pool,
+                                     BMFace *f)
 {
-	BMIter bm_iter;
-	BMEdge *e;
-
 	if (edge_queue_tri_in_sphere(q, f)) {
+		BMLoop *l_iter;
+		BMLoop *l_first;
+
 		/* Check each edge of the face */
-		BM_ITER_ELEM (e, &bm_iter, f, BM_EDGES_OF_FACE) {
-			long_edge_queue_edge_add(q, pool, e);
-		}
+		l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+		do {
+			long_edge_queue_edge_add(q, pool, l_iter->e);
+		} while ((l_iter = l_iter->next) != l_first);
 	}
-
-	return TRUE;
 }
 
-static int short_edge_queue_face_add(EdgeQueue *q, BLI_mempool *pool,
-									 BMFace *f)
+static void short_edge_queue_face_add(EdgeQueue *q, BLI_mempool *pool,
+                                      BMFace *f)
 {
-	BMIter bm_iter;
-	BMEdge *e;
-
 	if (edge_queue_tri_in_sphere(q, f)) {
+		BMLoop *l_iter;
+		BMLoop *l_first;
+
 		/* Check each edge of the face */
-		BM_ITER_ELEM (e, &bm_iter, f, BM_EDGES_OF_FACE) {
-			short_edge_queue_edge_add(q, pool, e);
-		}
+		l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+		do {
+			short_edge_queue_edge_add(q, pool, l_iter->e);
+		} while ((l_iter = l_iter->next) != l_first);
 	}
-
-	return TRUE;
 }
 
 /* Create a priority queue containing vertex pairs connected by a long
@@ -655,25 +627,26 @@ static void short_edge_queue_create(EdgeQueue *q, BLI_mempool *pool,
 /*************************** Topology update **************************/
 
 static void pbvh_bmesh_split_edge(PBVH *bvh, EdgeQueue *q, BLI_mempool *pool,
-								  BMEdge *e, BLI_Buffer *edge_faces)
+                                  BMEdge *e, BLI_Buffer *edge_loops)
 {
 	BMVert *v_new;
 	float mid[3];
 	int i, node_index;
 
 	/* Get all faces adjacent to the edge */
-	pbvh_bmesh_edge_faces(edge_faces, e);
+	pbvh_bmesh_edge_loops(edge_loops, e);
 
 	/* Create a new vertex in current node at the edge's midpoint */
 	mid_v3_v3v3(mid, e->v1->co, e->v2->co);
 
 	node_index = GET_INT_FROM_POINTER(BLI_ghash_lookup(bvh->bm_vert_to_node,
-													   e->v1));
+	                                                   e->v1));
 	v_new = pbvh_bmesh_vert_create(bvh, node_index, mid, e->v1);
 
 	/* For each face, add two new triangles and delete the original */
-	for (i = 0; i < edge_faces->count; i++) {
-		BMFace *f_adj = BLI_buffer_at(edge_faces, BMFace *, i);
+	for (i = 0; i < edge_loops->count; i++) {
+		BMLoop *l_adj = BLI_buffer_at(edge_loops, BMLoop *, i);
+		BMFace *f_adj = l_adj->f;
 		BMFace *f_new;
 		BMVert *opp, *v1, *v2;
 		void *nip;
@@ -687,15 +660,13 @@ static void pbvh_bmesh_split_edge(PBVH *bvh, EdgeQueue *q, BLI_mempool *pool,
 		bvh->nodes[ni].flag |= PBVH_UpdateDrawBuffers;
 
 		/* Find the vertex not in the edge */
-		opp = bm_triangle_other_vert_find(f_adj, e->v1, e->v2);
+		opp = l_adj->prev->v;
 
 		/* Get e->v1 and e->v2 in the order they appear in the
 		 * existing face so that the new faces' winding orders
 		 * match */
-		v1 = e->v1;
-		v2 = e->v2;
-		if (bm_face_edge_backwards(f_adj, e))
-			SWAP(BMVert *, v1, v2);
+		v1 = l_adj->v;
+		v2 = l_adj->next->v;
 
 		if (ni != node_index && i == 0)
 			pbvh_bmesh_vert_ownership_transfer(bvh, &bvh->nodes[ni], v_new);
@@ -731,8 +702,8 @@ static void pbvh_bmesh_split_edge(PBVH *bvh, EdgeQueue *q, BLI_mempool *pool,
 }
 
 static int pbvh_bmesh_subdivide_long_edges(PBVH *bvh, EdgeQueue *q,
-										   BLI_mempool *pool,
-										   BLI_Buffer *edge_faces)
+                                           BLI_mempool *pool,
+                                           BLI_Buffer *edge_loops)
 {
 	int any_subdivided = FALSE;
 
@@ -764,30 +735,31 @@ static int pbvh_bmesh_subdivide_long_edges(PBVH *bvh, EdgeQueue *q,
 
 		any_subdivided = TRUE;
 
-		pbvh_bmesh_split_edge(bvh, q, pool, e, edge_faces);
+		pbvh_bmesh_split_edge(bvh, q, pool, e, edge_loops);
 	}
 
 	return any_subdivided;
 }
 
 static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
-									 BMVert *v2, GHash *deleted_verts,
-									 BLI_Buffer *edge_faces,
-									 BLI_Buffer *deleted_faces)
+                                     BMVert *v2, GHash *deleted_verts,
+                                     BLI_Buffer *edge_loops,
+                                     BLI_Buffer *deleted_faces)
 {
 	BMIter bm_iter;
 	BMFace *f;
 	int i;
 
 	/* Get all faces adjacent to the edge */
-	pbvh_bmesh_edge_faces(edge_faces, e);
+	pbvh_bmesh_edge_loops(edge_loops, e);
 
 	/* Remove the merge vertex from the PBVH */
 	pbvh_bmesh_vert_remove(bvh, v2);
 
 	/* Remove all faces adjacent to the edge */
-	for (i = 0; i < edge_faces->count; i++) {
-		BMFace *f_adj = BLI_buffer_at(edge_faces, BMFace *, i);
+	for (i = 0; i < edge_loops->count; i++) {
+		BMLoop *l_adj = BLI_buffer_at(edge_loops, BMLoop *, i);
+		BMFace *f_adj = l_adj->f;
 
 		pbvh_bmesh_face_remove(bvh, f_adj);
 		BM_face_kill(bvh->bm, f_adj);
@@ -798,36 +770,38 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
 	BM_edge_kill(bvh->bm, e);
 
 	/* For all remaining faces of v2, create a new face that is the
-	   same except it uses v1 instead of v2 */
+	 * same except it uses v1 instead of v2 */
 	/* Note: this could be done with BM_vert_splice(), but that
 	 * requires handling other issues like duplicate edges, so doesn't
 	 * really buy anything. */
 	deleted_faces->count = 0;
 	BM_ITER_ELEM (f, &bm_iter, v2, BM_FACES_OF_VERT) {
-		BMVert *v[3];
+		BMVert *v_tri[3];
 		BMFace *existing_face;
 		PBVHNode *n;
 		int ni;
 
 		/* Get vertices, replace use of v2 with v1 */
-		BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v, 3);
+		// BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v_tri, 3);
+		BM_face_as_array_vert_tri(f, v_tri);
 		for (i = 0; i < 3; i++) {
-			if (v[i] == v2)
-				v[i] = v1;
+			if (v_tri[i] == v2) {
+				v_tri[i] = v1;
+			}
 		}
 
 		/* Check if a face using these vertices already exists. If so,
 		 * skip adding this face and mark the existing one for
 		 * deletion as well. Prevents extraneous "flaps" from being
 		 * created. */
-		if (BM_face_exists(v, 3, &existing_face)) {
+		if (BM_face_exists(v_tri, 3, &existing_face)) {
 			BLI_assert(existing_face);
 			BLI_buffer_append(deleted_faces, BMFace *, existing_face);
 		}
 		else {
 			n = pbvh_bmesh_node_lookup(bvh, bvh->bm_face_to_node, f);
 			ni = n - bvh->nodes;
-			pbvh_bmesh_face_create(bvh, ni, v[0], v[1], v[2], f);
+			pbvh_bmesh_face_create(bvh, ni, v_tri[0], v_tri[1], v_tri[2], f);
 
 			/* Ensure that v1 is in the new face's node */
 			if (!BLI_ghash_haskey(n->bm_unique_verts, v1) &&
@@ -842,20 +816,24 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
 	/* Delete the tagged faces */
 	for (i = 0; i < deleted_faces->count; i++) {
 		BMFace *f_del = BLI_buffer_at(deleted_faces, BMFace *, i);
-		BMVert *v[3];
+		BMVert *v_tri[3];
+		BMEdge *e_tri[3];
 		int j;
 
-		BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f_del, (void **)v, 3);
+		/* Get vertices and edges of face */
+		BM_face_as_array_vert_tri(f_del, v_tri);
+		for (j = 0; j < 3; j++)
+			e_tri[j] = BM_edge_exists(v_tri[j], v_tri[j == 2 ? 0 : j + 1]);
 
 		/* Check if any of the face's vertices are now unused, if so
-		   remove them from the PBVH */
+		 * remove them from the PBVH */
 		for (j = 0; j < 3; j++) {
-			if (v[j] != v2 && BM_vert_face_count(v[j]) == 0) {
-				BLI_ghash_insert(deleted_verts, v[j], NULL);
-				pbvh_bmesh_vert_remove(bvh, v[j]);
+			if (v_tri[j] != v2 && BM_vert_face_count(v_tri[j]) == 1) {
+				BLI_ghash_insert(deleted_verts, v_tri[j], NULL);
+				pbvh_bmesh_vert_remove(bvh, v_tri[j]);
 			}
 			else {
-				v[j] = NULL;
+				v_tri[j] = NULL;
 			}
 		}
 
@@ -863,18 +841,28 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
 		pbvh_bmesh_face_remove(bvh, f_del);
 		BM_face_kill(bvh->bm, f_del);
 
+		/* Check if any of the face's edges are now unused by any
+		 * face, if so delete them */
+		for (j = 0; j < 3; j++) {
+			if (BM_edge_face_count(e_tri[j]) == 0)
+				BM_edge_kill(bvh->bm, e_tri[j]);
+		}
+
 		/* Delete unused vertices */
 		for (j = 0; j < 3; j++) {
-			if (v[j]) {
-				BM_log_vert_removed(bvh->bm, bvh->bm_log, v[j]);
-				BM_vert_kill(bvh->bm, v[j]);
+			if (v_tri[j]) {
+				BM_log_vert_removed(bvh->bm, bvh->bm_log, v_tri[j]);
+				BM_vert_kill(bvh->bm, v_tri[j]);
 			}
 		}
 	}
 
-	/* Move v1 to the midpoint of v1 and v2 */
-	BM_log_vert_before_modified(bvh->bm, bvh->bm_log, v1);
-	mid_v3_v3v3(v1->co, v1->co, v2->co);
+	/* Move v1 to the midpoint of v1 and v2 (if v1 still exists, it
+	 * may have been deleted above) */
+	if (!BLI_ghash_haskey(deleted_verts, v1)) {
+		BM_log_vert_before_modified(bvh->bm, bvh->bm_log, v1);
+		mid_v3_v3v3(v1->co, v1->co, v2->co);
+	}
 
 	/* Delete v2 */
 	BLI_assert(BM_vert_face_count(v2) == 0);
@@ -884,9 +872,9 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
 }
 
 static int pbvh_bmesh_collapse_short_edges(PBVH *bvh, EdgeQueue *q,
-										   BLI_mempool *pool,
-										   BLI_Buffer *edge_faces,
-										   BLI_Buffer *deleted_faces)
+                                           BLI_mempool *pool,
+                                           BLI_Buffer *edge_loops,
+                                           BLI_Buffer *deleted_faces)
 {
 	float min_len_squared = bvh->bm_min_edge_len * bvh->bm_min_edge_len;
 	GHash *deleted_verts;
@@ -928,8 +916,8 @@ static int pbvh_bmesh_collapse_short_edges(PBVH *bvh, EdgeQueue *q,
 		any_collapsed = TRUE;
 
 		pbvh_bmesh_collapse_edge(bvh, e, v1, v2,
-								 deleted_verts, edge_faces,
-								 deleted_faces);
+		                         deleted_verts, edge_loops,
+		                         deleted_faces);
 	}
 
 	BLI_ghash_free(deleted_verts, NULL, NULL);
@@ -962,15 +950,15 @@ int pbvh_bmesh_node_raycast(PBVHNode *node, const float ray_start[3],
 			BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
 
 			BLI_assert(f->len == 3);
-			if (f->len == 3) {
-				BMVert *v[3];
+			if (f->len == 3 && !paint_is_bmesh_face_hidden(f)) {
+				BMVert *v_tri[3];
 
-				BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v, 3);
+				BM_face_as_array_vert_tri(f, v_tri);
 				hit |= ray_face_intersection(ray_start, ray_normal,
-											 v[0]->co,
-											 v[1]->co,
-											 v[2]->co,
-											 NULL, dist);
+				                             v_tri[0]->co,
+				                             v_tri[1]->co,
+				                             v_tri[2]->co,
+				                             NULL, dist);
 			}
 		}
 	}
@@ -1038,9 +1026,10 @@ void BKE_pbvh_build_bmesh(PBVH *bvh, BMesh *bm, int smooth_shading,
 
 /* Collapse short edges, subdivide long edges */
 int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
-								   const float center[3], float radius)
+                                   const float center[3], float radius)
 {
-	BLI_buffer_declare_static(BMFace *, edge_faces, BLI_BUFFER_NOP, 8);
+	/* 2 is enough for edge faces - manifold edge */
+	BLI_buffer_declare_static(BMFace *, edge_loops, BLI_BUFFER_NOP, 2);
 	BLI_buffer_declare_static(BMFace *, deleted_faces, BLI_BUFFER_NOP, 32);
 
 	int modified = FALSE;
@@ -1049,10 +1038,10 @@ int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
 	if (mode & PBVH_Collapse) {
 		EdgeQueue q;
 		BLI_mempool *queue_pool = BLI_mempool_create(sizeof(BMVert) * 2,
-													 128, 128, 0);
+		                                             128, 128, 0);
 		short_edge_queue_create(&q, queue_pool, bvh, center, radius);
-		pbvh_bmesh_collapse_short_edges(bvh, &q, queue_pool, &edge_faces,
-										&deleted_faces);
+		pbvh_bmesh_collapse_short_edges(bvh, &q, queue_pool, &edge_loops,
+		                                &deleted_faces);
 		BLI_heap_free(q.heap, NULL);
 		BLI_mempool_destroy(queue_pool);
 	}
@@ -1060,9 +1049,9 @@ int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
 	if (mode & PBVH_Subdivide) {
 		EdgeQueue q;
 		BLI_mempool *queue_pool = BLI_mempool_create(sizeof(BMVert) * 2,
-													 128, 128, 0);
+		                                             128, 128, 0);
 		long_edge_queue_create(&q, queue_pool, bvh, center, radius);
-		pbvh_bmesh_subdivide_long_edges(bvh, &q, queue_pool, &edge_faces);
+		pbvh_bmesh_subdivide_long_edges(bvh, &q, queue_pool, &edge_loops);
 		BLI_heap_free(q.heap, NULL);
 		BLI_mempool_destroy(queue_pool);
 	}
@@ -1077,14 +1066,27 @@ int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
 			node->flag &= ~PBVH_UpdateTopology;
 		}
 	}
-	BLI_buffer_free(&edge_faces);
+	BLI_buffer_free(&edge_loops);
 	BLI_buffer_free(&deleted_faces);
 
 	return modified;
 }
 
+BLI_INLINE void bm_face_as_array_index_tri(BMFace *f, int r_index[3])
+{
+	BMLoop *l = BM_FACE_FIRST_LOOP(f);
+
+	BLI_assert(f->len == 3);
+
+	r_index[0] = BM_elem_index_get(l->v); l = l->next;
+	r_index[1] = BM_elem_index_get(l->v); l = l->next;
+	r_index[2] = BM_elem_index_get(l->v);
+}
+
 /* In order to perform operations on the original node coordinates
- * (such as raycast), store the node's triangles and vertices.*/
+ * (currently just raycast), store the node's triangles and vertices.
+ *
+ * Skips triangles that are hidden. */
 void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node)
 {
 	GHashIterator gh_iter;
@@ -1120,15 +1122,22 @@ void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node)
 	/* Copy the triangles */
 	i = 0;
 	GHASH_ITER (gh_iter, node->bm_faces) {
-		BMIter bm_iter;
 		BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
+
+		if (paint_is_bmesh_face_hidden(f))
+			continue;
+
+#if 0
+		BMIter bm_iter;
 		BMVert *v;
 		int j = 0;
-
 		BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
 			node->bm_ortri[i][j] = BM_elem_index_get(v);
 			j++;
 		}
+#else
+		bm_face_as_array_index_tri(f, node->bm_ortri[i]);
+#endif
 		i++;
 	}
 	node->bm_tot_ortri = i;
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 9794868..27c5e03 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -43,6 +43,7 @@
 #include "DNA_object_types.h"
 #include "DNA_object_force.h"
 #include "DNA_particle_types.h"
+#include "DNA_rigidbody_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_smoke_types.h"
 
@@ -51,6 +52,8 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "PIL_time.h"
 
 #include "WM_api.h"
@@ -72,6 +75,10 @@
 
 #include "BIK_api.h"
 
+#ifdef WITH_BULLET
+#  include "RBI_api.h"
+#endif
+
 /* both in intern */
 #ifdef WITH_SMOKE
 #include "smoke_API.h"
@@ -308,8 +315,9 @@ static void ptcache_particle_read(int index, void *psys_v, void **data, float cf
 		pa->lifetime = times[2];
 	}
 
-	if (boid)
+	if (boid) {
 		PTCACHE_DATA_TO(data, BPHYS_DATA_BOIDS, 0, &boid->data);
+	}
 
 	/* determine velocity from previous location */
 	if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
@@ -866,6 +874,97 @@ static int ptcache_dynamicpaint_read(PTCacheFile *pf, void *dp_v)
 	return 1;
 }
 
+/* Rigid Body functions */
+static int  ptcache_rigidbody_write(int index, void *rb_v, void **data, int UNUSED(cfra))
+{
+	RigidBodyWorld *rbw = rb_v;
+	Object *ob = NULL;
+	
+	if (rbw->objects)
+		ob = rbw->objects[index];
+	
+	if (ob && ob->rigidbody_object) {
+		RigidBodyOb *rbo = ob->rigidbody_object;
+		
+		if (rbo->type == RBO_TYPE_ACTIVE) {
+#ifdef WITH_BULLET
+			RB_body_get_position(rbo->physics_object, rbo->pos);
+			RB_body_get_orientation(rbo->physics_object, rbo->orn);
+#endif
+			PTCACHE_DATA_FROM(data, BPHYS_DATA_LOCATION, rbo->pos);
+			PTCACHE_DATA_FROM(data, BPHYS_DATA_ROTATION, rbo->orn);
+		}
+	}
+
+	return 1;
+}
+static void ptcache_rigidbody_read(int index, void *rb_v, void **data, float UNUSED(cfra), float *old_data)
+{
+	RigidBodyWorld *rbw = rb_v;
+	Object *ob = NULL;
+	
+	if (rbw->objects)
+		ob = rbw->objects[index];
+	
+	if (ob && ob->rigidbody_object) {
+		RigidBodyOb *rbo = ob->rigidbody_object;
+		
+		if (rbo->type == RBO_TYPE_ACTIVE) {
+			
+			if (old_data) {
+				memcpy(rbo->pos, data, 3 * sizeof(float));
+				memcpy(rbo->orn, data + 3, 4 * sizeof(float));
+			}
+			else {
+				PTCACHE_DATA_TO(data, BPHYS_DATA_LOCATION, 0, rbo->pos);
+				PTCACHE_DATA_TO(data, BPHYS_DATA_ROTATION, 0, rbo->orn);
+			}
+		}
+	}
+}
+static void ptcache_rigidbody_interpolate(int index, void *rb_v, void **data, float cfra, float cfra1, float cfra2, float *old_data)
+{
+	RigidBodyWorld *rbw = rb_v;
+	Object *ob = NULL;
+	ParticleKey keys[4];
+	float dfra;
+	
+	if (rbw->objects)
+		ob = rbw->objects[index];
+	
+	if (ob && ob->rigidbody_object) {
+		RigidBodyOb *rbo = ob->rigidbody_object;
+		
+		if (rbo->type == RBO_TYPE_ACTIVE) {
+			
+			copy_v3_v3(keys[1].co, rbo->pos);
+			copy_v3_v3(keys[1].rot, rbo->orn);
+			
+			if (old_data) {
+				memcpy(keys[2].co, data, 3 * sizeof(float));
+				memcpy(keys[2].rot, data + 3, 4 * sizeof(float));
+			}
+			else {
+				BKE_ptcache_make_particle_key(keys+2, 0, data, cfra2);
+			}
+			
+			dfra = cfra2 - cfra1;
+		
+			psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, keys, 1);
+			interp_qt_qtqt(keys->rot, keys[1].rot, keys[2].rot, (cfra - cfra1) / dfra);
+			
+			copy_v3_v3(rbo->pos, keys->co);
+			copy_v3_v3(rbo->orn, keys->rot);
+		}
+	}
+}
+static int ptcache_rigidbody_totpoint(void *rb_v, int UNUSED(cfra))
+{
+	RigidBodyWorld *rbw = rb_v;
+	
+	return rbw->numbodies;
+}
+
 /* Creating ID's */
 void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb)
 {
@@ -1071,6 +1170,42 @@ void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, Object *ob, DynamicPaintSu
 	pid->max_step = 1;
 }
 
+void BKE_ptcache_id_from_rigidbody(PTCacheID *pid, Object *ob, RigidBodyWorld *rbw)
+{
+	
+	memset(pid, 0, sizeof(PTCacheID));
+	
+	pid->ob= ob;
+	pid->calldata= rbw;
+	pid->type= PTCACHE_TYPE_RIGIDBODY;
+	pid->cache= rbw->pointcache;
+	pid->cache_ptr= &rbw->pointcache;
+	pid->ptcaches= &rbw->ptcaches;
+	pid->totpoint= pid->totwrite= ptcache_rigidbody_totpoint;
+	
+	pid->write_point			= ptcache_rigidbody_write;
+	pid->read_point				= ptcache_rigidbody_read;
+	pid->interpolate_point		= ptcache_rigidbody_interpolate;
+	
+	pid->write_stream			= NULL;
+	pid->read_stream			= NULL;
+	
+	pid->write_extra_data		= NULL;
+	pid->read_extra_data		= NULL;
+	pid->interpolate_extra_data	= NULL;
+	
+	pid->write_header			= ptcache_basic_header_write;
+	pid->read_header			= ptcache_basic_header_read;
+	
+	pid->data_types= (1<<BPHYS_DATA_LOCATION) | (1<<BPHYS_DATA_ROTATION);
+	pid->info_types= 0;
+	
+	pid->stack_index = pid->cache->index;
+	
+	pid->default_step = 1;
+	pid->max_step = 1;
+}
+
 void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int duplis)
 {
 	PTCacheID *pid;
@@ -1132,11 +1267,17 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
 			}
 		}
 	}
+	
+	if (scene && ob->rigidbody_object && scene->rigidbody_world) {
+		pid = MEM_callocN(sizeof(PTCacheID), "PTCacheID");
+		BKE_ptcache_id_from_rigidbody(pid, ob, scene->rigidbody_world);
+		BLI_addtail(lb, pid);
+	}
 
 	if (scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) {
 		ListBase *lb_dupli_ob;
 
-		/* don't update the dupli groups, we only wan't their pid's */
+		/* don't update the dupli groups, we only want their pid's */
 		if ((lb_dupli_ob = object_duplilist_ex(scene, ob, FALSE, FALSE))) {
 			DupliObject *dob;
 			for (dob= lb_dupli_ob->first; dob; dob= dob->next) {
@@ -2535,7 +2676,7 @@ int  BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
 	after= 0;
 
 	if (mode == PTCACHE_RESET_DEPSGRAPH) {
-		if (!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) {
+		if (!(cache->flag & PTCACHE_BAKED)) {
 
 			after= 1;
 		}
@@ -2543,12 +2684,7 @@ int  BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
 		cache->flag |= PTCACHE_OUTDATED;
 	}
 	else if (mode == PTCACHE_RESET_BAKED) {
-		if (!BKE_ptcache_get_continue_physics()) {
-			reset= 1;
-			clear= 1;
-		}
-		else
-			cache->flag |= PTCACHE_OUTDATED;
+		cache->flag |= PTCACHE_OUTDATED;
 	}
 	else if (mode == PTCACHE_RESET_OUTDATED) {
 		reset = 1;
@@ -2645,6 +2781,14 @@ int  BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
 		}
 	}
 
+	if (scene->rigidbody_world && (ob->rigidbody_object || ob->rigidbody_constraint)) {
+		if (ob->rigidbody_object)
+			ob->rigidbody_object->flag |= RBO_FLAG_NEEDS_RESHAPE;
+		BKE_ptcache_id_from_rigidbody(&pid, ob, scene->rigidbody_world);
+		/* only flag as outdated, resetting should happen on start frame */
+		pid.cache->flag |= PTCACHE_OUTDATED;
+	}
+
 	if (ob->type == OB_ARMATURE)
 		BIK_clear_cache(ob->pose);
 
@@ -2694,30 +2838,6 @@ void BKE_ptcache_remove(void)
 	}
 }
 
-/* Continuous Interaction */
-
-static int CONTINUE_PHYSICS = 0;
-
-void BKE_ptcache_set_continue_physics(Main *bmain, Scene *scene, int enable)
-{
-	Object *ob;
-
-	if (CONTINUE_PHYSICS != enable) {
-		CONTINUE_PHYSICS = enable;
-
-		if (CONTINUE_PHYSICS == 0) {
-			for (ob=bmain->object.first; ob; ob=ob->id.next)
-				if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED))
-					DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-		}
-	}
-}
-
-int  BKE_ptcache_get_continue_physics(void)
-{
-	return CONTINUE_PHYSICS;
-}
-
 /* Point Cache handling */
 
 PointCache *BKE_ptcache_add(ListBase *ptcaches)
@@ -3387,11 +3507,11 @@ void BKE_ptcache_update_info(PTCacheID *pid)
 
 		/* smoke doesn't use frame 0 as info frame so can't check based on totpoint */
 		if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN && totframes)
-			BLI_snprintf(cache->info, sizeof(cache->info), "%i frames found!", totframes);
+			BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%i frames found!"), totframes);
 		else if (totframes && cache->totpoint)
-			BLI_snprintf(cache->info, sizeof(cache->info), "%i points found!", cache->totpoint);
+			BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%i points found!"), cache->totpoint);
 		else
-			BLI_snprintf(cache->info, sizeof(cache->info), "No valid data to read!");
+			BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("No valid data to read!"));
 		return;
 	}
 
@@ -3400,9 +3520,9 @@ void BKE_ptcache_update_info(PTCacheID *pid)
 			int totpoint = pid->totpoint(pid->calldata, 0);
 
 			if (cache->totpoint > totpoint)
-				BLI_snprintf(mem_info, sizeof(mem_info), "%i cells + High Resolution cached", totpoint);
+				BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i cells + High Resolution cached"), totpoint);
 			else
-				BLI_snprintf(mem_info, sizeof(mem_info), "%i cells cached", totpoint);
+				BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i cells cached"), totpoint);
 		}
 		else {
 			int cfra = cache->startframe;
@@ -3412,7 +3532,7 @@ void BKE_ptcache_update_info(PTCacheID *pid)
 					totframes++;
 			}
 
-			BLI_snprintf(mem_info, sizeof(mem_info), "%i frames on disk", totframes);
+			BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i frames on disk"), totframes);
 		}
 	}
 	else {
@@ -3436,17 +3556,18 @@ void BKE_ptcache_update_info(PTCacheID *pid)
 
 		mb = (bytes > 1024.0f * 1024.0f);
 
-		BLI_snprintf(mem_info, sizeof(mem_info), "%i frames in memory (%.1f %s)",
+		BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i frames in memory (%.1f %s)"),
 		             totframes,
 		             bytes / (mb ? 1024.0f * 1024.0f : 1024.0f),
-		             mb ? "Mb" : "kb");
+		             mb ? IFACE_("Mb") : IFACE_("kb"));
 	}
 
 	if (cache->flag & PTCACHE_OUTDATED) {
-		BLI_snprintf(cache->info, sizeof(cache->info), "%s, cache is outdated!", mem_info);
+		BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%s, cache is outdated!"), mem_info);
 	}
 	else if (cache->flag & PTCACHE_FRAMES_SKIPPED) {
-		BLI_snprintf(cache->info, sizeof(cache->info), "%s, not exact since frame %i.", mem_info, cache->last_exact);
+		BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%s, not exact since frame %i."),
+		             mem_info, cache->last_exact);
 	}
 	else {
 		BLI_snprintf(cache->info, sizeof(cache->info), "%s.", mem_info);
@@ -3468,4 +3589,3 @@ void BKE_ptcache_invalidate(PointCache *cache)
 		cache->last_exact = MIN2(cache->startframe, 0);
 	}
 }
-
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
new file mode 100644
index 0000000..c2fd6a9
--- /dev/null
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -0,0 +1,1323 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file rigidbody.c
+ *  \ingroup blenkernel
+ *  \brief Blender-side interface and methods for dealing with Rigid Body simulations
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stddef.h>
+#include <float.h>
+#include <math.h>
+#include <limits.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+
+#ifdef WITH_BULLET
+#  include "RBI_api.h"
+#endif
+
+#include "DNA_anim_types.h"
+#include "DNA_group_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
+#include "DNA_object_force.h"
+#include "DNA_rigidbody_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_animsys.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_effect.h"
+#include "BKE_group.h"
+#include "BKE_object.h"
+#include "BKE_mesh.h"
+#include "BKE_pointcache.h"
+#include "BKE_rigidbody.h"
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "RNA_access.h"
+
+#ifdef WITH_BULLET
+
+/* ************************************** */
+/* Memory Management */
+
+/* Freeing Methods --------------------- */
+
+/* Free rigidbody world */
+void BKE_rigidbody_free_world(RigidBodyWorld *rbw)
+{
+	/* sanity check */
+	if (!rbw)
+		return;
+
+	if (rbw->physics_world) {
+		/* free physics references, we assume that all physics objects in will have been added to the world */
+		GroupObject *go;
+		if (rbw->constraints) {
+			for (go = rbw->constraints->gobject.first; go; go = go->next) {
+				if (go->ob && go->ob->rigidbody_constraint) {
+					RigidBodyCon *rbc = go->ob->rigidbody_constraint;
+
+					if (rbc->physics_constraint)
+						RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
+				}
+			}
+		}
+		if (rbw->group) {
+			for (go = rbw->group->gobject.first; go; go = go->next) {
+				if (go->ob && go->ob->rigidbody_object) {
+					RigidBodyOb *rbo = go->ob->rigidbody_object;
+
+					if (rbo->physics_object)
+						RB_dworld_remove_body(rbw->physics_world, rbo->physics_object);
+				}
+			}
+		}
+		/* free dynamics world */
+		RB_dworld_delete(rbw->physics_world);
+	}
+	if (rbw->objects)
+		free(rbw->objects);
+
+	/* free cache */
+	BKE_ptcache_free_list(&(rbw->ptcaches));
+	rbw->pointcache = NULL;
+
+	/* free effector weights */
+	if (rbw->effector_weights)
+		MEM_freeN(rbw->effector_weights);
+
+	/* free rigidbody world itself */
+	MEM_freeN(rbw);
+}
+
+/* Free RigidBody settings and sim instances */
+void BKE_rigidbody_free_object(Object *ob)
+{
+	RigidBodyOb *rbo = (ob) ? ob->rigidbody_object : NULL;
+
+	/* sanity check */
+	if (rbo == NULL)
+		return;
+
+	/* free physics references */
+	if (rbo->physics_object) {
+		RB_body_delete(rbo->physics_object);
+		rbo->physics_object = NULL;
+	}
+
+	if (rbo->physics_shape) {
+		RB_shape_delete(rbo->physics_shape);
+		rbo->physics_shape = NULL;
+	}
+
+	/* free data itself */
+	MEM_freeN(rbo);
+	ob->rigidbody_object = NULL;
+}
+
+/* Free RigidBody constraint and sim instance */
+void BKE_rigidbody_free_constraint(Object *ob)
+{
+	RigidBodyCon *rbc = (ob) ? ob->rigidbody_constraint : NULL;
+
+	/* sanity check */
+	if (rbc == NULL)
+		return;
+
+	/* free physics reference */
+	if (rbc->physics_constraint) {
+		RB_constraint_delete(rbc->physics_constraint);
+		rbc->physics_constraint = NULL;
+	}
+
+	/* free data itself */
+	MEM_freeN(rbc);
+	ob->rigidbody_constraint = NULL;
+}
+
+/* Copying Methods --------------------- */
+
+/* These just copy the data, clearing out references to physics objects.
+ * Anything that uses them MUST verify that the copied object will
+ * be added to relevant groups later...
+ */
+
+RigidBodyOb *BKE_rigidbody_copy_object(Object *ob)
+{
+	RigidBodyOb *rboN = NULL;
+
+	if (ob->rigidbody_object) {
+		/* just duplicate the whole struct first (to catch all the settings) */
+		rboN = MEM_dupallocN(ob->rigidbody_object);
+
+		/* tag object as needing to be verified */
+		rboN->flag |= RBO_FLAG_NEEDS_VALIDATE;
+
+		/* clear out all the fields which need to be revalidated later */
+		rboN->physics_object = NULL;
+		rboN->physics_shape = NULL;
+	}
+
+	/* return new copy of settings */
+	return rboN;
+}
+
+RigidBodyCon *BKE_rigidbody_copy_constraint(Object *ob)
+{
+	RigidBodyCon *rbcN = NULL;
+
+	if (ob->rigidbody_constraint) {
+		/* just duplicate the whole struct first (to catch all the settings) */
+		rbcN = MEM_dupallocN(ob->rigidbody_constraint);
+
+		/* tag object as needing to be verified */
+		rbcN->flag |= RBC_FLAG_NEEDS_VALIDATE;
+
+		/* clear out all the fields which need to be revalidated later */
+		rbcN->physics_constraint = NULL;
+	}
+
+	/* return new copy of settings */
+	return rbcN;
+}
+
+/* preserve relationships between constraints and rigid bodies after duplication */
+void BKE_rigidbody_relink_constraint(RigidBodyCon *rbc)
+{
+	ID_NEW(rbc->ob1);
+	ID_NEW(rbc->ob2);
+}
+
+/* ************************************** */
+/* Setup Utilities - Validate Sim Instances */
+
+/* create collision shape of mesh - convex hull */
+static rbCollisionShape *rigidbody_get_shape_convexhull_from_mesh(Object *ob, float margin, bool *can_embed)
+{
+	rbCollisionShape *shape = NULL;
+	Mesh *me = NULL;
+
+	if (ob->type == OB_MESH && ob->data) {
+		me = ob->data;
+	}
+	else {
+		printf("ERROR: cannot make Convex Hull collision shape for non-Mesh object\n");
+	}
+
+	if (me && me->totvert) {
+		shape = RB_shape_new_convex_hull((float *)me->mvert, sizeof(MVert), me->totvert, margin, can_embed);
+	}
+	else {
+		printf("ERROR: no vertices to define Convex Hull collision shape with\n");
+	}
+
+	return shape;
+}
+
+/* create collision shape of mesh - triangulated mesh
+ * returns NULL if creation fails.
+ */
+static rbCollisionShape *rigidbody_get_shape_trimesh_from_mesh(Object *ob)
+{
+	rbCollisionShape *shape = NULL;
+
+	if (ob->type == OB_MESH) {
+		DerivedMesh *dm = CDDM_from_mesh(ob->data, ob);
+
+		MVert *mvert;
+		MFace *mface;
+		int totvert;
+		int totface;
+
+		/* ensure mesh validity, then grab data */
+		DM_ensure_tessface(dm);
+
+		mvert   = (dm) ? dm->getVertArray(dm) : NULL;
+		totvert = (dm) ? dm->getNumVerts(dm) : 0;
+		mface   = (dm) ? dm->getTessFaceArray(dm) : NULL;
+		totface = (dm) ? dm->getNumTessFaces(dm) : 0;
+
+		/* sanity checking - potential case when no data will be present */
+		if ((totvert == 0) || (totface == 0)) {
+			printf("WARNING: no geometry data converted for Mesh Collision Shape (ob = %s)\n", ob->id.name + 2);
+		}
+		else {
+			rbMeshData *mdata;
+			int i;
+
+			/* init mesh data for collision shape */
+			mdata = RB_trimesh_data_new();
+
+			/* loop over all faces, adding them as triangles to the collision shape
+			 * (so for some faces, more than triangle will get added)
+			 */
+			for (i = 0; (i < totface) && (mface) && (mvert); i++, mface++) {
+				/* add first triangle - verts 1,2,3 */
+				{
+					MVert *va = (IN_RANGE(mface->v1, 0, totvert)) ? (mvert + mface->v1) : (mvert);
+					MVert *vb = (IN_RANGE(mface->v2, 0, totvert)) ? (mvert + mface->v2) : (mvert);
+					MVert *vc = (IN_RANGE(mface->v3, 0, totvert)) ? (mvert + mface->v3) : (mvert);
+
+					RB_trimesh_add_triangle(mdata, va->co, vb->co, vc->co);
+				}
+
+				/* add second triangle if needed - verts 1,3,4 */
+				if (mface->v4) {
+					MVert *va = (IN_RANGE(mface->v1, 0, totvert)) ? (mvert + mface->v1) : (mvert);
+					MVert *vb = (IN_RANGE(mface->v3, 0, totvert)) ? (mvert + mface->v3) : (mvert);
+					MVert *vc = (IN_RANGE(mface->v4, 0, totvert)) ? (mvert + mface->v4) : (mvert);
+
+					RB_trimesh_add_triangle(mdata, va->co, vb->co, vc->co);
+				}
+			}
+
+			/* construct collision shape
+			 *
+			 * These have been chosen to get better speed/accuracy tradeoffs with regards
+			 * to limitations of each:
+			 *    - BVH-Triangle Mesh: for passive objects only. Despite having greater
+			 *                         speed/accuracy, they cannot be used for moving objects.
+			 *    - GImpact Mesh:      for active objects. These are slower and less stable,
+			 *                         but are more flexible for general usage.
+			 */
+			if (ob->rigidbody_object->type == RBO_TYPE_PASSIVE) {
+				shape = RB_shape_new_trimesh(mdata);
+			}
+			else {
+				shape = RB_shape_new_gimpact_mesh(mdata);
+			}
+		}
+
+		/* cleanup temp data */
+		if (dm) {
+			dm->release(dm);
+		}
+	}
+	else {
+		printf("ERROR: cannot make Triangular Mesh collision shape for non-Mesh object\n");
+	}
+
+	return shape;
+}
+
+/* Create new physics sim collision shape for object and store it,
+ * or remove the existing one first and replace...
+ */
+void BKE_rigidbody_validate_sim_shape(Object *ob, short rebuild)
+{
+	RigidBodyOb *rbo = ob->rigidbody_object;
+	rbCollisionShape *new_shape = NULL;
+	BoundBox *bb = NULL;
+	float size[3] = {1.0f, 1.0f, 1.0f};
+	float radius = 1.0f;
+	float height = 1.0f;
+	float capsule_height;
+	float hull_margin = 0.0f;
+	bool can_embed = true;
+
+	/* sanity check */
+	if (rbo == NULL)
+		return;
+
+	/* don't create a new shape if we already have one and don't want to rebuild it */
+	if (rbo->physics_shape && !rebuild)
+		return;
+
+	/* if automatically determining dimensions, use the Object's boundbox
+	 *	- assume that all quadrics are standing upright on local z-axis
+	 *	- assume even distribution of mass around the Object's pivot
+	 *	  (i.e. Object pivot is centralized in boundbox)
+	 */
+	// XXX: all dimensions are auto-determined now... later can add stored settings for this
+	/* get object dimensions without scaling */
+	bb = BKE_object_boundbox_get(ob);
+	if (bb) {
+		size[0] = (bb->vec[4][0] - bb->vec[0][0]);
+		size[1] = (bb->vec[2][1] - bb->vec[0][1]);
+		size[2] = (bb->vec[1][2] - bb->vec[0][2]);
+	}
+	mul_v3_fl(size, 0.5f);
+
+	if (ELEM3(rbo->shape, RB_SHAPE_CAPSULE, RB_SHAPE_CYLINDER, RB_SHAPE_CONE)) {
+		/* take radius as largest x/y dimension, and height as z-dimension */
+		radius = MAX2(size[0], size[1]);
+		height = size[2];
+	}
+	else if (rbo->shape == RB_SHAPE_SPHERE) {
+		/* take radius to the the largest dimension to try and encompass everything */
+		radius = MAX3(size[0], size[1], size[2]);
+	}
+
+	/* create new shape */
+	switch (rbo->shape) {
+		case RB_SHAPE_BOX:
+			new_shape = RB_shape_new_box(size[0], size[1], size[2]);
+			break;
+
+		case RB_SHAPE_SPHERE:
+			new_shape = RB_shape_new_sphere(radius);
+			break;
+
+		case RB_SHAPE_CAPSULE:
+			capsule_height = (height - radius) * 2.0f;
+			new_shape = RB_shape_new_capsule(radius, (capsule_height > 0.0f) ? capsule_height : 0.0f);
+			break;
+		case RB_SHAPE_CYLINDER:
+			new_shape = RB_shape_new_cylinder(radius, height);
+			break;
+		case RB_SHAPE_CONE:
+			new_shape = RB_shape_new_cone(radius, height * 2.0f);
+			break;
+
+		case RB_SHAPE_CONVEXH:
+			/* try to emged collision margin */
+			if (!(rbo->flag & RBO_FLAG_USE_MARGIN))
+				hull_margin = 0.04f;
+			new_shape = rigidbody_get_shape_convexhull_from_mesh(ob, hull_margin, &can_embed);
+			if (!(rbo->flag & RBO_FLAG_USE_MARGIN))
+				rbo->margin = (can_embed) ? 0.04f : 0.0f;  /* RB_TODO ideally we shouldn't directly change the margin here */
+			break;
+		case RB_SHAPE_TRIMESH:
+			new_shape = rigidbody_get_shape_trimesh_from_mesh(ob);
+			break;
+	}
+	/* assign new collision shape if creation was successful */
+	if (new_shape) {
+		if (rbo->physics_shape)
+			RB_shape_delete(rbo->physics_shape);
+		rbo->physics_shape = new_shape;
+		RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
+	}
+	else { /* otherwise fall back to box shape */
+		rbo->shape = RB_SHAPE_BOX;
+		BKE_rigidbody_validate_sim_shape(ob, true);
+	}
+}
+
+/* --------------------- */
+
+/* Create physics sim representation of object given RigidBody settings
+ * < rebuild: even if an instance already exists, replace it
+ */
+void BKE_rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, short rebuild)
+{
+	RigidBodyOb *rbo = (ob) ? ob->rigidbody_object : NULL;
+	float loc[3];
+	float rot[4];
+
+	/* sanity checks:
+	 *	- object doesn't have RigidBody info already: then why is it here?
+	 */
+	if (rbo == NULL)
+		return;
+
+	/* make sure collision shape exists */
+	/* FIXME we shouldn't always have to rebuild collision shapes when rebuilding objects, but it's needed for constraints to update correctly */
+	if (rbo->physics_shape == NULL || rebuild)
+		BKE_rigidbody_validate_sim_shape(ob, true);
+
+	if (rbo->physics_object) {
+		if (rebuild == false)
+			RB_dworld_remove_body(rbw->physics_world, rbo->physics_object);
+	}
+	if (!rbo->physics_object || rebuild) {
+		/* remove rigid body if it already exists before creating a new one */
+		if (rbo->physics_object) {
+			RB_body_delete(rbo->physics_object);
+		}
+
+		mat4_to_loc_quat(loc, rot, ob->obmat);
+
+		rbo->physics_object = RB_body_new(rbo->physics_shape, loc, rot);
+
+		RB_body_set_friction(rbo->physics_object, rbo->friction);
+		RB_body_set_restitution(rbo->physics_object, rbo->restitution);
+
+		RB_body_set_damping(rbo->physics_object, rbo->lin_damping, rbo->ang_damping);
+		RB_body_set_sleep_thresh(rbo->physics_object, rbo->lin_sleep_thresh, rbo->ang_sleep_thresh);
+		RB_body_set_activation_state(rbo->physics_object, rbo->flag & RBO_FLAG_USE_DEACTIVATION);
+
+		if (rbo->type == RBO_TYPE_PASSIVE || rbo->flag & RBO_FLAG_START_DEACTIVATED)
+			RB_body_deactivate(rbo->physics_object);
+
+
+		RB_body_set_linear_factor(rbo->physics_object,
+		                          (ob->protectflag & OB_LOCK_LOCX) == 0,
+		                          (ob->protectflag & OB_LOCK_LOCY) == 0,
+		                          (ob->protectflag & OB_LOCK_LOCZ) == 0);
+		RB_body_set_angular_factor(rbo->physics_object,
+		                           (ob->protectflag & OB_LOCK_ROTX) == 0,
+		                           (ob->protectflag & OB_LOCK_ROTY) == 0,
+		                           (ob->protectflag & OB_LOCK_ROTZ) == 0);
+
+		RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
+		RB_body_set_kinematic_state(rbo->physics_object, rbo->flag & RBO_FLAG_KINEMATIC || rbo->flag & RBO_FLAG_DISABLED);
+	}
+
+	if (rbw && rbw->physics_world)
+		RB_dworld_add_body(rbw->physics_world, rbo->physics_object, rbo->col_groups);
+}
+
+/* --------------------- */
+
+/* Create physics sim representation of constraint given rigid body constraint settings
+ * < rebuild: even if an instance already exists, replace it
+ */
+void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, short rebuild)
+{
+	RigidBodyCon *rbc = (ob) ? ob->rigidbody_constraint : NULL;
+	float loc[3];
+	float rot[4];
+	float lin_lower;
+	float lin_upper;
+	float ang_lower;
+	float ang_upper;
+
+	/* sanity checks:
+	 *	- object should have a rigid body constraint
+	 *  - rigid body constraint should have at least one constrained object
+	 */
+	if (rbc == NULL) {
+		return;
+	}
+
+	if (ELEM4(NULL, rbc->ob1, rbc->ob1->rigidbody_object, rbc->ob2, rbc->ob2->rigidbody_object)) {
+		if (rbc->physics_constraint) {
+			RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
+			RB_constraint_delete(rbc->physics_constraint);
+			rbc->physics_constraint = NULL;
+		}
+		return;
+	}
+
+	if (rbc->physics_constraint) {
+		if (rebuild == false)
+			RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
+	}
+	if (rbc->physics_constraint == NULL || rebuild) {
+		rbRigidBody *rb1 = rbc->ob1->rigidbody_object->physics_object;
+		rbRigidBody *rb2 = rbc->ob2->rigidbody_object->physics_object;
+
+		/* remove constraint if it already exists before creating a new one */
+		if (rbc->physics_constraint) {
+			RB_constraint_delete(rbc->physics_constraint);
+			rbc->physics_constraint = NULL;
+		}
+
+		mat4_to_loc_quat(loc, rot, ob->obmat);
+
+		if (rb1 && rb2) {
+			switch (rbc->type) {
+				case RBC_TYPE_POINT:
+					rbc->physics_constraint = RB_constraint_new_point(loc, rb1, rb2);
+					break;
+				case RBC_TYPE_FIXED:
+					rbc->physics_constraint = RB_constraint_new_fixed(loc, rot, rb1, rb2);
+					break;
+				case RBC_TYPE_HINGE:
+					rbc->physics_constraint = RB_constraint_new_hinge(loc, rot, rb1, rb2);
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_Z) {
+						RB_constraint_set_limits_hinge(rbc->physics_constraint, rbc->limit_ang_z_lower, rbc->limit_ang_z_upper);
+					}
+					else
+						RB_constraint_set_limits_hinge(rbc->physics_constraint, 0.0f, -1.0f);
+					break;
+				case RBC_TYPE_SLIDER:
+					rbc->physics_constraint = RB_constraint_new_slider(loc, rot, rb1, rb2);
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X)
+						RB_constraint_set_limits_slider(rbc->physics_constraint, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper);
+					else
+						RB_constraint_set_limits_slider(rbc->physics_constraint, 0.0f, -1.0f);
+					break;
+				case RBC_TYPE_PISTON:
+					rbc->physics_constraint = RB_constraint_new_piston(loc, rot, rb1, rb2);
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X) {
+						lin_lower = rbc->limit_lin_x_lower;
+						lin_upper = rbc->limit_lin_x_upper;
+					}
+					else {
+						lin_lower = 0.0f;
+						lin_upper = -1.0f;
+					}
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_X) {
+						ang_lower = rbc->limit_ang_x_lower;
+						ang_upper = rbc->limit_ang_x_upper;
+					}
+					else {
+						ang_lower = 0.0f;
+						ang_upper = -1.0f;
+					}
+					RB_constraint_set_limits_piston(rbc->physics_constraint, lin_lower, lin_upper, ang_lower, ang_upper);
+					break;
+				case RBC_TYPE_6DOF_SPRING:
+					rbc->physics_constraint = RB_constraint_new_6dof_spring(loc, rot, rb1, rb2);
+
+					RB_constraint_set_spring_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->flag & RBC_FLAG_USE_SPRING_X);
+					RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_stiffness_x);
+					RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_damping_x);
+
+					RB_constraint_set_spring_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->flag & RBC_FLAG_USE_SPRING_Y);
+					RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->spring_stiffness_y);
+					RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->spring_damping_y);
+
+					RB_constraint_set_spring_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->flag & RBC_FLAG_USE_SPRING_Z);
+					RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->spring_stiffness_z);
+					RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->spring_damping_z);
+
+					RB_constraint_set_equilibrium_6dof_spring(rbc->physics_constraint);
+				/* fall through */
+				case RBC_TYPE_6DOF:
+					if (rbc->type == RBC_TYPE_6DOF) /* a litte awkward but avoids duplicate code for limits */
+						rbc->physics_constraint = RB_constraint_new_6dof(loc, rot, rb1, rb2);
+
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X)
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper);
+					else
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_X, 0.0f, -1.0f);
+
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_Y)
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->limit_lin_y_lower, rbc->limit_lin_y_upper);
+					else
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Y, 0.0f, -1.0f);
+
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_Z)
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->limit_lin_z_lower, rbc->limit_lin_z_upper);
+					else
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Z, 0.0f, -1.0f);
+
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_X)
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->limit_ang_x_lower, rbc->limit_ang_x_upper);
+					else
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_X, 0.0f, -1.0f);
+
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_Y)
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->limit_ang_y_lower, rbc->limit_ang_y_upper);
+					else
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Y, 0.0f, -1.0f);
+
+					if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_Z)
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->limit_ang_z_lower, rbc->limit_ang_z_upper);
+					else
+						RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Z, 0.0f, -1.0f);
+					break;
+			}
+		}
+		else { /* can't create constraint without both rigid bodies */
+			return;
+		}
+
+		RB_constraint_set_enabled(rbc->physics_constraint, rbc->flag & RBC_FLAG_ENABLED);
+
+		if (rbc->flag & RBC_FLAG_USE_BREAKING)
+			RB_constraint_set_breaking_threshold(rbc->physics_constraint, rbc->breaking_threshold);
+		else
+			RB_constraint_set_breaking_threshold(rbc->physics_constraint, FLT_MAX);
+
+		if (rbc->flag & RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS)
+			RB_constraint_set_solver_iterations(rbc->physics_constraint, rbc->num_solver_iterations);
+		else
+			RB_constraint_set_solver_iterations(rbc->physics_constraint, -1);
+	}
+
+	if (rbw && rbw->physics_world && rbc->physics_constraint) {
+		RB_dworld_add_constraint(rbw->physics_world, rbc->physics_constraint, rbc->flag & RBC_FLAG_DISABLE_COLLISIONS);
+	}
+}
+
+/* --------------------- */
+
+/* Create physics sim world given RigidBody world settings */
+// NOTE: this does NOT update object references that the scene uses, in case those aren't ready yet!
+void BKE_rigidbody_validate_sim_world(Scene *scene, RigidBodyWorld *rbw, short rebuild)
+{
+	/* sanity checks */
+	if (rbw == NULL)
+		return;
+
+	/* create new sim world */
+	if (rebuild || rbw->physics_world == NULL) {
+		if (rbw->physics_world)
+			RB_dworld_delete(rbw->physics_world);
+		rbw->physics_world = RB_dworld_new(scene->physics_settings.gravity);
+	}
+
+	RB_dworld_set_solver_iterations(rbw->physics_world, rbw->num_solver_iterations);
+	RB_dworld_set_split_impulse(rbw->physics_world, rbw->flag & RBW_FLAG_USE_SPLIT_IMPULSE);
+}
+
+/* ************************************** */
+/* Setup Utilities - Create Settings Blocks */
+
+/* Set up RigidBody world */
+RigidBodyWorld *BKE_rigidbody_create_world(Scene *scene)
+{
+	/* try to get whatever RigidBody world that might be representing this already */
+	RigidBodyWorld *rbw;
+
+	/* sanity checks
+	 *	- there must be a valid scene to add world to
+	 *	- there mustn't be a sim world using this group already
+	 */
+	if (scene == NULL)
+		return NULL;
+
+	/* create a new sim world */
+	rbw = MEM_callocN(sizeof(RigidBodyWorld), "RigidBodyWorld");
+
+	/* set default settings */
+	rbw->effector_weights = BKE_add_effector_weights(NULL);
+
+	rbw->ltime = PSFRA;
+
+	rbw->time_scale = 1.0f;
+
+	rbw->steps_per_second = 60; /* Bullet default (60 Hz) */
+	rbw->num_solver_iterations = 10; /* 10 is bullet default */
+
+	rbw->pointcache = BKE_ptcache_add(&(rbw->ptcaches));
+	rbw->pointcache->step = 1;
+
+	/* return this sim world */
+	return rbw;
+}
+
+/* Add rigid body settings to the specified object */
+RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type)
+{
+	RigidBodyOb *rbo;
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+
+	/* sanity checks
+	 *	- rigidbody world must exist
+	 *	- object must exist
+	 *	- cannot add rigid body if it already exists
+	 */
+	if (ob == NULL || (ob->rigidbody_object != NULL))
+		return NULL;
+
+	/* create new settings data, and link it up */
+	rbo = MEM_callocN(sizeof(RigidBodyOb), "RigidBodyOb");
+
+	/* set default settings */
+	rbo->type = type;
+
+	rbo->mass = 1.0f;
+
+	rbo->friction = 0.5f; /* best when non-zero. 0.5 is Bullet default */
+	rbo->restitution = 0.0f; /* best when zero. 0.0 is Bullet default */
+
+	rbo->margin = 0.04f; /* 0.04 (in meters) is Bullet default */
+
+	rbo->lin_sleep_thresh = 0.4f; /* 0.4 is half of Bullet default */
+	rbo->ang_sleep_thresh = 0.5f; /* 0.5 is half of Bullet default */
+
+	rbo->lin_damping = 0.04f; /* 0.04 is game engine default */
+	rbo->ang_damping = 0.1f; /* 0.1 is game engine default */
+
+	rbo->col_groups = 1;
+
+	/* use triangle meshes for passive objects
+	 * use convex hulls for active objects since dynamic triangle meshes are very unstable
+	 */
+	if (type == RBO_TYPE_ACTIVE)
+		rbo->shape = RB_SHAPE_CONVEXH;
+	else
+		rbo->shape = RB_SHAPE_TRIMESH;
+
+	/* set initial transform */
+	mat4_to_loc_quat(rbo->pos, rbo->orn, ob->obmat);
+
+	/* flag cache as outdated */
+	BKE_rigidbody_cache_reset(rbw);
+
+	/* return this object */
+	return rbo;
+}
+
+/* Add rigid body constraint to the specified object */
+RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short type)
+{
+	RigidBodyCon *rbc;
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+
+	/* sanity checks
+	 *	- rigidbody world must exist
+	 *	- object must exist
+	 *	- cannot add constraint if it already exists
+	 */
+	if (ob == NULL || (ob->rigidbody_constraint != NULL))
+		return NULL;
+
+	/* create new settings data, and link it up */
+	rbc = MEM_callocN(sizeof(RigidBodyCon), "RigidBodyCon");
+
+	/* set default settings */
+	rbc->type = type;
+
+	rbc->ob1 = NULL;
+	rbc->ob2 = NULL;
+
+	rbc->flag |= RBC_FLAG_ENABLED;
+	rbc->flag |= RBC_FLAG_DISABLE_COLLISIONS;
+
+	rbc->breaking_threshold = 10.0f; /* no good default here, just use 10 for now */
+	rbc->num_solver_iterations = 10; /* 10 is Bullet default */
+
+	rbc->limit_lin_x_lower = -1.0f;
+	rbc->limit_lin_x_upper = 1.0f;
+	rbc->limit_lin_y_lower = -1.0f;
+	rbc->limit_lin_y_upper = 1.0f;
+	rbc->limit_lin_z_lower = -1.0f;
+	rbc->limit_lin_z_upper = 1.0f;
+	rbc->limit_ang_x_lower = -M_PI_4;
+	rbc->limit_ang_x_upper = M_PI_4;
+	rbc->limit_ang_y_lower = -M_PI_4;
+	rbc->limit_ang_y_upper = M_PI_4;
+	rbc->limit_ang_z_lower = -M_PI_4;
+	rbc->limit_ang_z_upper = M_PI_4;
+
+	rbc->spring_damping_x = 0.5f;
+	rbc->spring_damping_y = 0.5f;
+	rbc->spring_damping_z = 0.5f;
+	rbc->spring_stiffness_x = 10.0f;
+	rbc->spring_stiffness_y = 10.0f;
+	rbc->spring_stiffness_z = 10.0f;
+
+	/* flag cache as outdated */
+	BKE_rigidbody_cache_reset(rbw);
+
+	/* return this object */
+	return rbc;
+}
+
+/* ************************************** */
+/* Utilities API */
+
+/* Get RigidBody world for the given scene, creating one if needed
+ * < scene: Scene to find active Rigid Body world for
+ */
+RigidBodyWorld *BKE_rigidbody_get_world(Scene *scene)
+{
+	/* sanity check */
+	if (scene == NULL)
+		return NULL;
+
+	return scene->rigidbody_world;
+}
+
+void BKE_rigidbody_remove_object(Scene *scene, Object *ob)
+{
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+	RigidBodyOb *rbo = ob->rigidbody_object;
+	RigidBodyCon *rbc;
+	GroupObject *go;
+	int i;
+
+	if (rbw) {
+		/* remove from rigidbody world, free object won't do this */
+		if (rbw->physics_world && rbo->physics_object)
+			RB_dworld_remove_body(rbw->physics_world, rbo->physics_object);
+
+		/* remove object from array */
+		if (rbw && rbw->objects) {
+			for (i = 0; i < rbw->numbodies; i++) {
+				if (rbw->objects[i] == ob) {
+					rbw->objects[i] = NULL;
+					break;
+				}
+			}
+		}
+
+		/* remove object from rigid body constraints */
+		if (rbw->constraints) {
+			for (go = rbw->constraints->gobject.first; go; go = go->next) {
+				Object *obt = go->ob;
+				if (obt && obt->rigidbody_constraint) {
+					rbc = obt->rigidbody_constraint;
+					if (rbc->ob1 == ob) {
+						rbc->ob1 = NULL;
+						rbc->flag |= RBC_FLAG_NEEDS_VALIDATE;
+					}
+					if (rbc->ob2 == ob) {
+						rbc->ob2 = NULL;
+						rbc->flag |= RBC_FLAG_NEEDS_VALIDATE;
+					}
+				}
+			}
+		}
+	}
+
+	/* remove object's settings */
+	BKE_rigidbody_free_object(ob);
+
+	/* flag cache as outdated */
+	BKE_rigidbody_cache_reset(rbw);
+}
+
+void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob)
+{
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+	RigidBodyCon *rbc = ob->rigidbody_constraint;
+
+	if (rbw) {
+		/* remove from rigidbody world, free object won't do this */
+		if (rbw && rbw->physics_world && rbc->physics_constraint)
+			RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
+	}
+	/* remove object's settings */
+	BKE_rigidbody_free_constraint(ob);
+
+	/* flag cache as outdated */
+	BKE_rigidbody_cache_reset(rbw);
+}
+
+
+/* ************************************** */
+/* Simulation Interface - Bullet */
+
+/* Update object array and rigid body count so they're in sync with the rigid body group */
+static void rigidbody_update_ob_array(RigidBodyWorld *rbw)
+{
+	GroupObject *go;
+	int i, n;
+
+	n = BLI_countlist(&rbw->group->gobject);
+
+	if (rbw->numbodies != n) {
+		rbw->numbodies = n;
+		rbw->objects = realloc(rbw->objects, sizeof(Object *) * rbw->numbodies);
+	}
+
+	for (go = rbw->group->gobject.first, i = 0; go; go = go->next, i++) {
+		Object *ob = go->ob;
+		rbw->objects[i] = ob;
+	}
+}
+
+static void rigidbody_update_sim_world(Scene *scene, RigidBodyWorld *rbw)
+{
+	float adj_gravity[3];
+
+	/* adjust gravity to take effector weights into account */
+	if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
+		copy_v3_v3(adj_gravity, scene->physics_settings.gravity);
+		mul_v3_fl(adj_gravity, rbw->effector_weights->global_gravity * rbw->effector_weights->weight[0]);
+	}
+	else {
+		zero_v3(adj_gravity);
+	}
+
+	/* update gravity, since this RNA setting is not part of RigidBody settings */
+	RB_dworld_set_gravity(rbw->physics_world, adj_gravity);
+
+	/* update object array in case there are changes */
+	rigidbody_update_ob_array(rbw);
+}
+
+static void rigidbody_update_sim_ob(Scene *scene, RigidBodyWorld *rbw, Object *ob, RigidBodyOb *rbo)
+{
+	float loc[3];
+	float rot[4];
+	float scale[3];
+
+	/* only update if rigid body exists */
+	if (rbo->physics_object == NULL)
+		return;
+
+	mat4_decompose(loc, rot, scale, ob->obmat);
+
+	/* update scale for all objects */
+	RB_body_set_scale(rbo->physics_object, scale);
+	/* compensate for embedded convex hull collision margin */
+	if (!(rbo->flag & RBO_FLAG_USE_MARGIN) && rbo->shape == RB_SHAPE_CONVEXH)
+		RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo) * MIN3(scale[0], scale[1], scale[2]));
+
+	/* make transformed objects temporarily kinmatic so that they can be moved by the user during simulation */
+	if (ob->flag & SELECT && G.moving & G_TRANSFORM_OBJ) {
+		RB_body_set_kinematic_state(rbo->physics_object, TRUE);
+		RB_body_set_mass(rbo->physics_object, 0.0f);
+	}
+
+	/* update rigid body location and rotation for kinematic bodies */
+	if (rbo->flag & RBO_FLAG_KINEMATIC || (ob->flag & SELECT && G.moving & G_TRANSFORM_OBJ)) {
+		RB_body_activate(rbo->physics_object);
+		RB_body_set_loc_rot(rbo->physics_object, loc, rot);
+	}
+	/* update influence of effectors - but don't do it on an effector */
+	/* only dynamic bodies need effector update */
+	else if (rbo->type == RBO_TYPE_ACTIVE && ((ob->pd == NULL) || (ob->pd->forcefield == PFIELD_NULL))) {
+		EffectorWeights *effector_weights = rbw->effector_weights;
+		EffectedPoint epoint;
+		ListBase *effectors;
+
+		/* get effectors present in the group specified by effector_weights */
+		effectors = pdInitEffectors(scene, ob, NULL, effector_weights);
+		if (effectors) {
+			float force[3] = {0.0f, 0.0f, 0.0f};
+			float loc[3], vel[3];
+
+			/* create dummy 'point' which represents last known position of object as result of sim */
+			// XXX: this can create some inaccuracies with sim position, but is probably better than using unsimulated vals?
+			RB_body_get_position(rbo->physics_object, loc);
+			RB_body_get_linear_velocity(rbo->physics_object, vel);
+
+			pd_point_from_loc(scene, loc, vel, 0, &epoint);
+
+			/* calculate net force of effectors, and apply to sim object
+			 *	- we use 'central force' since apply force requires a "relative position" which we don't have...
+			 */
+			pdDoEffectors(effectors, NULL, effector_weights, &epoint, force, NULL);
+			if (G.f & G_DEBUG)
+				printf("\tapplying force (%f,%f,%f) to '%s'\n", force[0], force[1], force[2], ob->id.name + 2);
+			/* activate object in case it is deactivated */
+			if (!is_zero_v3(force))
+				RB_body_activate(rbo->physics_object);
+			RB_body_apply_central_force(rbo->physics_object, force);
+		}
+		else if (G.f & G_DEBUG)
+			printf("\tno forces to apply to '%s'\n", ob->id.name + 2);
+
+		/* cleanup */
+		pdEndEffectors(&effectors);
+	}
+	/* NOTE: passive objects don't need to be updated since they don't move */
+
+	/* NOTE: no other settings need to be explicitly updated here,
+	 * since RNA setters take care of the rest :)
+	 */
+}
+
+/* Updates and validates world, bodies and shapes.
+ * < rebuild: rebuild entire simulation
+ */
+static void rigidbody_update_simulation(Scene *scene, RigidBodyWorld *rbw, int rebuild)
+{
+	GroupObject *go;
+
+	/* update world */
+	if (rebuild)
+		BKE_rigidbody_validate_sim_world(scene, rbw, true);
+	rigidbody_update_sim_world(scene, rbw);
+
+	/* update objects */
+	for (go = rbw->group->gobject.first; go; go = go->next) {
+		Object *ob = go->ob;
+
+		if (ob && ob->type == OB_MESH) {
+			/* validate that we've got valid object set up here... */
+			RigidBodyOb *rbo = ob->rigidbody_object;
+			/* update transformation matrix of the object so we don't get a frame of lag for simple animations */
+			BKE_object_where_is_calc(scene, ob);
+
+			if (rbo == NULL) {
+				/* Since this object is included in the sim group but doesn't have
+				 * rigid body settings (perhaps it was added manually), add!
+				 *	- assume object to be active? That is the default for newly added settings...
+				 */
+				ob->rigidbody_object = BKE_rigidbody_create_object(scene, ob, RBO_TYPE_ACTIVE);
+				BKE_rigidbody_validate_sim_object(rbw, ob, true);
+
+				rbo = ob->rigidbody_object;
+			}
+			else {
+				/* perform simulation data updates as tagged */
+				/* refresh object... */
+				if (rebuild) {
+					/* World has been rebuilt so rebuild object */
+					BKE_rigidbody_validate_sim_object(rbw, ob, true);
+				}
+				else if (rbo->flag & RBO_FLAG_NEEDS_VALIDATE) {
+					BKE_rigidbody_validate_sim_object(rbw, ob, false);
+				}
+				/* refresh shape... */
+				if (rbo->flag & RBO_FLAG_NEEDS_RESHAPE) {
+					/* mesh/shape data changed, so force shape refresh */
+					BKE_rigidbody_validate_sim_shape(ob, true);
+					/* now tell RB sim about it */
+					// XXX: we assume that this can only get applied for active/passive shapes that will be included as rigidbodies
+					RB_body_set_collision_shape(rbo->physics_object, rbo->physics_shape);
+				}
+				rbo->flag &= ~(RBO_FLAG_NEEDS_VALIDATE | RBO_FLAG_NEEDS_RESHAPE);
+			}
+
+			/* update simulation object... */
+			rigidbody_update_sim_ob(scene, rbw, ob, rbo);
+		}
+	}
+	/* update constraints */
+	if (rbw->constraints == NULL) /* no constraints, move on */
+		return;
+	for (go = rbw->constraints->gobject.first; go; go = go->next) {
+		Object *ob = go->ob;
+
+		if (ob) {
+			/* validate that we've got valid object set up here... */
+			RigidBodyCon *rbc = ob->rigidbody_constraint;
+			/* update transformation matrix of the object so we don't get a frame of lag for simple animations */
+			BKE_object_where_is_calc(scene, ob);
+
+			if (rbc == NULL) {
+				/* Since this object is included in the group but doesn't have
+				 * constraint settings (perhaps it was added manually), add!
+				 */
+				ob->rigidbody_constraint = BKE_rigidbody_create_constraint(scene, ob, RBC_TYPE_FIXED);
+				BKE_rigidbody_validate_sim_constraint(rbw, ob, true);
+
+				rbc = ob->rigidbody_constraint;
+			}
+			else {
+				/* perform simulation data updates as tagged */
+				if (rebuild) {
+					/* World has been rebuilt so rebuild constraint */
+					BKE_rigidbody_validate_sim_constraint(rbw, ob, true);
+				}
+				else if (rbc->flag & RBC_FLAG_NEEDS_VALIDATE) {
+					BKE_rigidbody_validate_sim_constraint(rbw, ob, false);
+				}
+				rbc->flag &= ~RBC_FLAG_NEEDS_VALIDATE;
+			}
+		}
+	}
+}
+
+static void rigidbody_update_simulation_post_step(RigidBodyWorld *rbw)
+{
+	GroupObject *go;
+
+	for (go = rbw->group->gobject.first; go; go = go->next) {
+		Object *ob = go->ob;
+
+		if (ob) {
+			RigidBodyOb *rbo = ob->rigidbody_object;
+			/* reset kinematic state for transformed objects */
+			if (ob->flag & SELECT && G.moving & G_TRANSFORM_OBJ) {
+				RB_body_set_kinematic_state(rbo->physics_object, rbo->flag & RBO_FLAG_KINEMATIC || rbo->flag & RBO_FLAG_DISABLED);
+				RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
+				/* deactivate passive objects so they don't interfere with deactivation of active objects */
+				if (rbo->type == RBO_TYPE_PASSIVE)
+					RB_body_deactivate(rbo->physics_object);
+			}
+		}
+	}
+}
+/* Sync rigid body and object transformations */
+void BKE_rigidbody_sync_transforms(RigidBodyWorld *rbw, Object *ob, float ctime)
+{
+	RigidBodyOb *rbo = ob->rigidbody_object;
+
+	/* keep original transform for kinematic and passive objects */
+	if (ELEM(NULL, rbw, rbo) || rbo->flag & RBO_FLAG_KINEMATIC || rbo->type == RBO_TYPE_PASSIVE)
+		return;
+
+	/* use rigid body transform after cache start frame if objects is not being transformed */
+	if (ctime > rbw->pointcache->startframe && !(ob->flag & SELECT && G.moving & G_TRANSFORM_OBJ)) {
+		float mat[4][4], size_mat[4][4], size[3];
+
+		/* keep original transform when the simulation is muted */
+		if (rbw->flag & RBW_FLAG_MUTED)
+			return;
+
+		normalize_qt(rbo->orn); // RB_TODO investigate why quaternion isn't normalized at this point
+		quat_to_mat4(mat, rbo->orn);
+		copy_v3_v3(mat[3], rbo->pos);
+
+		mat4_to_size(size, ob->obmat);
+		size_to_mat4(size_mat, size);
+		mult_m4_m4m4(mat, mat, size_mat);
+
+		copy_m4_m4(ob->obmat, mat);
+	}
+	/* otherwise set rigid body transform to current obmat */
+	else {
+		mat4_to_loc_quat(rbo->pos, rbo->orn, ob->obmat);
+	}
+}
+
+/* Used when cancelling transforms - return rigidbody and object to initial states */
+void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle)
+{
+	RigidBodyOb *rbo = ob->rigidbody_object;
+
+	/* return rigid body and object to their initial states */
+	copy_v3_v3(rbo->pos, ob->loc);
+	copy_v3_v3(ob->loc, loc);
+
+	if (ob->rotmode > 0) {
+		eulO_to_quat(rbo->orn, ob->rot, ob->rotmode);
+		copy_v3_v3(ob->rot, rot);
+	}
+	else if (ob->rotmode == ROT_MODE_AXISANGLE) {
+		axis_angle_to_quat(rbo->orn, ob->rotAxis, ob->rotAngle);
+		copy_v3_v3(ob->rotAxis, rotAxis);
+		ob->rotAngle = rotAngle;
+	}
+	else {
+		copy_qt_qt(rbo->orn, ob->quat);
+		copy_qt_qt(ob->quat, quat);
+	}
+	if (rbo->physics_object) {
+		/* allow passive objects to return to original transform */
+		if (rbo->type == RBO_TYPE_PASSIVE)
+			RB_body_set_kinematic_state(rbo->physics_object, TRUE);
+		RB_body_set_loc_rot(rbo->physics_object, rbo->pos, rbo->orn);
+	}
+	// RB_TODO update rigid body physics object's loc/rot for dynamic objects here as well (needs to be done outside bullet's update loop)
+}
+
+void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw)
+{
+	if (rbw)
+		rbw->pointcache->flag |= PTCACHE_OUTDATED;
+}
+
+/* ------------------ */
+
+/* Run RigidBody simulation for the specified physics world */
+void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
+{
+	float timestep;
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+	PointCache *cache;
+	PTCacheID pid;
+	int startframe, endframe;
+
+	BKE_ptcache_id_from_rigidbody(&pid, NULL, rbw);
+	BKE_ptcache_id_time(&pid, scene, ctime, &startframe, &endframe, NULL);
+	cache = rbw->pointcache;
+
+	rbw->flag &= ~RBW_FLAG_FRAME_UPDATE;
+
+	/* flag cache as outdated if we don't have a world or number of objects in the simulation has changed */
+	if (rbw->physics_world == NULL || rbw->numbodies != BLI_countlist(&rbw->group->gobject)) {
+		cache->flag |= PTCACHE_OUTDATED;
+	}
+
+	if (ctime <= startframe) {
+		rbw->ltime = startframe;
+		/* reset and rebuild simulation if necessary */
+		if (cache->flag & PTCACHE_OUTDATED) {
+			BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
+			rigidbody_update_simulation(scene, rbw, true);
+			BKE_ptcache_validate(cache, (int)ctime);
+			cache->last_exact = 0;
+			cache->flag &= ~PTCACHE_REDO_NEEDED;
+		}
+		return;
+	}
+	/* rebuild world if it's outdated on second frame */
+	else if (ctime == startframe + 1 && rbw->ltime == startframe && cache->flag & PTCACHE_OUTDATED) {
+		BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
+		rigidbody_update_simulation(scene, rbw, true);
+	}
+	/* make sure we don't go out of cache frame range */
+	else if (ctime > endframe) {
+		ctime = endframe;
+	}
+
+	/* don't try to run the simulation if we don't have a world yet but allow reading baked cache */
+	if (rbw->physics_world == NULL && !(cache->flag & PTCACHE_BAKED))
+		return;
+	else if (rbw->objects == NULL)
+		rigidbody_update_ob_array(rbw);
+
+	/* try to read from cache */
+	// RB_TODO deal with interpolated, old and baked results
+	if (BKE_ptcache_read(&pid, ctime)) {
+		BKE_ptcache_validate(cache, (int)ctime);
+		rbw->ltime = ctime;
+		return;
+	}
+
+	/* advance simulation, we can only step one frame forward */
+	if (ctime == rbw->ltime + 1 && !(cache->flag & PTCACHE_BAKED)) {
+		/* write cache for first frame when on second frame */
+		if (rbw->ltime == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) {
+			BKE_ptcache_write(&pid, startframe);
+		}
+
+		/* update and validate simulation */
+		rigidbody_update_simulation(scene, rbw, false);
+
+		/* calculate how much time elapsed since last step in seconds */
+		timestep = 1.0f / (float)FPS * (ctime - rbw->ltime) * rbw->time_scale;
+		/* step simulation by the requested timestep, steps per second are adjusted to take time scale into account */
+		RB_dworld_step_simulation(rbw->physics_world, timestep, INT_MAX, 1.0f / (float)rbw->steps_per_second * min_ff(rbw->time_scale, 1.0f));
+
+		rigidbody_update_simulation_post_step(rbw);
+
+		/* write cache for current frame */
+		BKE_ptcache_validate(cache, (int)ctime);
+		BKE_ptcache_write(&pid, (unsigned int)ctime);
+
+		rbw->ltime = ctime;
+	}
+}
+/* ************************************** */
+
+#else  /* WITH_BULLET */
+
+/* stubs */
+#ifdef __GNUC__
+#  pragma GCC diagnostic push
+#  pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+void BKE_rigidbody_free_world(RigidBodyWorld *rbw) {}
+void BKE_rigidbody_free_object(Object *ob) {}
+void BKE_rigidbody_free_constraint(Object *ob) {}
+struct RigidBodyOb *BKE_rigidbody_copy_object(Object *ob) { return NULL; }
+struct RigidBodyCon *BKE_rigidbody_copy_constraint(Object *ob) { return NULL; }
+void BKE_rigidbody_relink_constraint(RigidBodyCon *rbc) {}
+void BKE_rigidbody_validate_sim_shape(Object *ob, short rebuild) {}
+void BKE_rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, short rebuild) {}
+void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, short rebuild) {}
+void BKE_rigidbody_validate_sim_world(Scene *scene, RigidBodyWorld *rbw, short rebuild) {}
+struct RigidBodyWorld *BKE_rigidbody_create_world(Scene *scene) { return NULL; }
+struct RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type) { return NULL; }
+struct RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short type) { return NULL; }
+struct RigidBodyWorld *BKE_rigidbody_get_world(Scene *scene) { return NULL; }
+void BKE_rigidbody_remove_object(Scene *scene, Object *ob) {}
+void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob) {}
+void BKE_rigidbody_sync_transforms(RigidBodyWorld *rbw, Object *ob, float ctime) {}
+void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle) {}
+void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {}
+void BKE_rigidbody_do_simulation(Scene *scene, float ctime) {}
+
+#ifdef __GNUC__
+#  pragma GCC diagnostic pop
+#endif
+
+#endif  /* WITH_BULLET */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 9cf0724..279c321 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -46,6 +46,7 @@
 #include "DNA_group_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
+#include "DNA_rigidbody_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_sequence_types.h"
@@ -72,6 +73,7 @@
 #include "BKE_object.h"
 #include "BKE_paint.h"
 #include "BKE_pointcache.h"
+#include "BKE_rigidbody.h"
 #include "BKE_scene.h"
 #include "BKE_sequencer.h"
 #include "BKE_world.h"
@@ -171,6 +173,7 @@ Scene *BKE_scene_copy(Scene *sce, int type)
 		scen->obedit = NULL;
 		scen->stats = NULL;
 		scen->fps_info = NULL;
+		scen->rigidbody_world = NULL; /* RB_TODO figure out a way of copying the rigid body world */
 
 		BLI_duplicatelist(&(scen->markers), &(sce->markers));
 		BLI_duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces));
@@ -310,6 +313,9 @@ void BKE_scene_free(Scene *sce)
 	BKE_free_animdata((ID *)sce);
 	BKE_keyingsets_free(&sce->keyingsets);
 	
+	if (sce->rigidbody_world)
+		BKE_rigidbody_free_world(sce->rigidbody_world);
+	
 	if (sce->r.avicodecdata) {
 		free_avicodecdata(sce->r.avicodecdata);
 		MEM_freeN(sce->r.avicodecdata);
@@ -373,7 +379,7 @@ void BKE_scene_free(Scene *sce)
 	BKE_color_managed_view_settings_free(&sce->view_settings);
 }
 
-static Scene *scene_add(Main *bmain, const char *name)
+Scene *BKE_scene_add(Main *bmain, const char *name)
 {
 	Scene *sce;
 	ParticleEditSettings *pset;
@@ -608,11 +614,6 @@ static Scene *scene_add(Main *bmain, const char *name)
 	return sce;
 }
 
-Scene *BKE_scene_add(Main *bmain, const char *name)
-{
-	return scene_add(bmain, name);
-}
-
 Base *BKE_scene_base_find(Scene *scene, Object *ob)
 {
 	return BLI_findptr(&scene->base, ob, offsetof(Base, object));
@@ -711,7 +712,7 @@ void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce)
 }
 
 /* used by metaballs
- * doesnt return the original duplicated object, only dupli's
+ * doesn't return the original duplicated object, only dupli's
  */
 int BKE_scene_base_iter_next(Scene **scene, int val, Base **base, Object **ob)
 {
@@ -936,6 +937,18 @@ Base *BKE_scene_base_add(Scene *sce, Object *ob)
 	return b;
 }
 
+void BKE_scene_base_unlink(Scene *sce, Base *base)
+{
+	/* remove rigid body constraint from world before removing object */
+	if (base->object->rigidbody_constraint)
+		BKE_rigidbody_remove_constraint(sce, base->object);
+	/* remove rigid body object from world before removing object */
+	if (base->object->rigidbody_object)
+		BKE_rigidbody_remove_object(sce, base->object);
+	
+	BLI_remlink(&sce->base, base);
+}
+
 void BKE_scene_base_deselect_all(Scene *sce)
 {
 	Base *b;
@@ -1048,7 +1061,7 @@ static void scene_depsgraph_hack(Scene *scene, Scene *scene_parent)
 		
 		if (ob->depsflag) {
 			int recalc = 0;
-			// printf("depshack %s\n", ob->id.name+2);
+			// printf("depshack %s\n", ob->id.name + 2);
 			
 			if (ob->depsflag & OB_DEPS_EXTRA_OB_RECALC)
 				recalc |= OB_RECALC_OB;
@@ -1072,11 +1085,19 @@ static void scene_depsgraph_hack(Scene *scene, Scene *scene_parent)
 
 }
 
+static void scene_flag_rbw_recursive(Scene *scene)
+{
+	if (scene->set)
+		scene_flag_rbw_recursive(scene->set);
+
+	if (BKE_scene_check_rigidbody_active(scene))
+		scene->rigidbody_world->flag |= RBW_FLAG_FRAME_UPDATE;
+}
+
 static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scene_parent)
 {
 	Base *base;
 	
-	
 	scene->customdata_mask = scene_parent->customdata_mask;
 
 	/* sets first, we allow per definition current scene to have
@@ -1084,11 +1105,27 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
 	if (scene->set)
 		scene_update_tagged_recursive(bmain, scene->set, scene_parent);
 	
+	/* run rigidbody sim 
+	 * - calculate/read values from cache into RBO's, to get flushed 
+	 *   later when objects are evaluated (if they're tagged for eval)
+	 */
+	// XXX: this position may still change, objects not being updated correctly before simulation is run
+	// NOTE: current position is so that rigidbody sim affects other objects
+	if (BKE_scene_check_rigidbody_active(scene) && scene->rigidbody_world->flag & RBW_FLAG_FRAME_UPDATE) {
+		/* we use frame time of parent (this is "scene" itself for top-level of sets recursion), 
+		 * as that is the active scene controlling all timing in file at the moment
+		 */
+		float ctime = BKE_scene_frame_get(scene_parent);
+		
+		/* however, "scene" contains the rigidbody world needed for eval... */
+		BKE_rigidbody_do_simulation(scene, ctime);
+	}
+	
 	/* scene objects */
 	for (base = scene->base.first; base; base = base->next) {
 		Object *ob = base->object;
 		
-		BKE_object_handle_update(scene_parent, ob);
+		BKE_object_handle_update_ex(scene_parent, ob, scene->rigidbody_world);
 		
 		if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
 			group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
@@ -1189,7 +1226,7 @@ void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
 	 * such as Scene->World->MTex/Texture) can still get correctly overridden.
 	 */
 	BKE_animsys_evaluate_all_animation(bmain, sce, ctime);
-	/*...done with recusrive funcs */
+	/*...done with recursive funcs */
 
 	/* clear "LIB_DOIT" flag from all materials, to prevent infinite recursion problems later 
 	 * when trying to find materials with drivers that need evaluating [#32017] 
@@ -1197,6 +1234,9 @@ void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
 	tag_main_idcode(bmain, ID_MA, FALSE);
 	tag_main_idcode(bmain, ID_LA, FALSE);
 
+	/* flag rigid body worlds for update */
+	scene_flag_rbw_recursive(sce);
+
 	/* BKE_object_handle_update() on all objects, groups and sets */
 	scene_update_tagged_recursive(bmain, sce, sce);
 
@@ -1376,3 +1416,8 @@ int BKE_scene_check_color_management_enabled(const Scene *scene)
 {
 	return strcmp(scene->display_settings.display_device, "None") != 0;
 }
+
+int BKE_scene_check_rigidbody_active(const Scene *scene)
+{
+	return scene && scene->rigidbody_world && scene->rigidbody_world->group && !(scene->rigidbody_world->flag & RBW_FLAG_MUTED);
+}
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 95b72d0..01f57b9 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -355,6 +355,20 @@ ARegion *BKE_area_find_region_type(ScrArea *sa, int type)
 	return NULL;
 }
 
+ARegion *BKE_area_find_region_active_win(ScrArea *sa)
+{
+	if (sa) {
+		ARegion *ar = BLI_findlink(&sa->regionbase, sa->region_active_win);
+		if (ar && (ar->regiontype == RGN_TYPE_WINDOW)) {
+			return ar;
+		}
+
+		/* fallback to any */
+		return BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+	}
+	return NULL;
+}
+
 /* note, using this function is generally a last resort, you really want to be
  * using the context when you can - campbell
  * -1 for any type */
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index c64609c..c0e8535 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -1317,7 +1317,8 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f
 
 	switch (wipe->wipetype) {
 		case DO_SINGLE_WIPE:
-			width = wipezone->width;
+			width = min_ii(wipezone->width, facf0 * yo);
+			width = min_ii(width, yo - facf0 * yo);
 
 			if (angle == 0.0f) {
 				b1 = posy;
diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c
index 3d8a2f7..9ea405e 100644
--- a/source/blender/blenkernel/intern/seqmodifier.c
+++ b/source/blender/blenkernel/intern/seqmodifier.c
@@ -135,7 +135,7 @@ static void modifier_apply_threaded(ImBuf *ibuf, ImBuf *mask, modifier_apply_thr
 	init_data.apply_callback = apply_callback;
 
 	IMB_processor_apply_threaded(ibuf->y, sizeof(ModifierThread), &init_data,
-                                 modifier_init_handle, modifier_do_thread);
+	                             modifier_init_handle, modifier_do_thread);
 }
 
 /* **** Color Balance Modifier **** */
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 2c1fd09..6861828 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1434,7 +1434,7 @@ void BKE_sequencer_proxy_rebuild(SeqIndexBuildContext *context, short *stop, sho
 			seq_proxy_build_frame(render_context, seq, cfra, 100);
 		}
 
-		*progress = (float) cfra / (seq->enddisp - seq->endstill - seq->startdisp + seq->startstill);
+		*progress = (float) (cfra - seq->startdisp - seq->startstill) / (seq->enddisp - seq->endstill - seq->startdisp - seq->startstill);
 		*do_update = TRUE;
 
 		if (*stop || G.is_break)
@@ -1746,7 +1746,7 @@ void BKE_sequencer_color_balance_apply(StripColorBalance *cb, ImBuf *ibuf, float
 	init_data.mask = mask_input;
 
 	IMB_processor_apply_threaded(ibuf->y, sizeof(ColorBalanceThread), &init_data,
-                                 color_balance_init_handle, color_balance_do_thread);
+	                             color_balance_init_handle, color_balance_do_thread);
 
 	/* color balance either happens on float buffer or byte buffer, but never on both,
 	 * free byte buffer if there's float buffer since float buffer would be used for
@@ -1820,8 +1820,6 @@ static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float cfra,
 		StripCrop c = {0};
 		StripTransform t = {0};
 		int sx, sy, dx, dy;
-		double xscale = 1.0;
-		double yscale = 1.0;
 
 		if (is_proxy_image) {
 			double f = seq_rendersize_to_scale_factor(context.preview_render_size);
@@ -1838,21 +1836,23 @@ static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float cfra,
 			t = *seq->strip->transform;
 		}
 
-		xscale = context.scene->r.xsch ? ((double)context.rectx / (double)context.scene->r.xsch) : 1.0;
-		yscale = context.scene->r.ysch ? ((double)context.recty / (double)context.scene->r.ysch) : 1.0;
-
-		xscale /= (double)context.rectx / (double)ibuf->x;
-		yscale /= (double)context.recty / (double)ibuf->y;
-
-		c.left *= xscale; c.right *= xscale;
-		c.top *= yscale; c.bottom *= yscale;
-
-		t.xofs *= xscale; t.yofs *= yscale;
+		if (is_preprocessed) {
+			double xscale = context.scene->r.xsch ? ((double)context.rectx / (double)context.scene->r.xsch) : 1.0;
+			double yscale = context.scene->r.ysch ? ((double)context.recty / (double)context.scene->r.ysch) : 1.0;
+			if (seq->flag & SEQ_USE_TRANSFORM) {
+				t.xofs *= xscale;
+				t.yofs *= yscale;
+			}
+			if (seq->flag & SEQ_USE_CROP) {
+				c.left *= xscale;
+				c.right *= xscale;
+				c.top *= yscale;
+				c.bottom *= yscale;
+			}
+		}
 
 		sx = ibuf->x - c.left - c.right;
 		sy = ibuf->y - c.top - c.bottom;
-		dx = sx;
-		dy = sy;
 
 		if (seq->flag & SEQ_USE_TRANSFORM) {
 			if (is_preprocessed) {
@@ -1864,6 +1864,10 @@ static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float cfra,
 				dy = context.scene->r.ysch;
 			}
 		}
+		else {
+			dx = sx;
+			dy = sy;
+		}
 
 		if (c.top  + c.bottom >= ibuf->y ||
 		    c.left + c.right  >= ibuf->x ||
@@ -3951,6 +3955,24 @@ Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine)
 	return seq;
 }
 
+void BKE_sequence_alpha_mode_from_extension(Sequence *seq)
+{
+	if (seq->strip && seq->strip->stripdata) {
+		char *name = seq->strip->stripdata->name;
+
+		if (BLI_testextensie(name, ".exr") ||
+		    BLI_testextensie(name, ".cin") ||
+		    BLI_testextensie(name, ".dpx") ||
+		    BLI_testextensie(name, ".hdr"))
+			{
+				seq->alpha_mode = IMA_ALPHA_PREMUL;
+			}
+		else {
+			seq->alpha_mode = IMA_ALPHA_STRAIGHT;
+		}
+	}
+}
+
 void BKE_sequence_init_colorspace(Sequence *seq)
 {
 	if (seq->strip && seq->strip->stripdata) {
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 2563fc2..248cd68 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -213,8 +213,8 @@ static void smoke_pos_to_cell(SmokeDomainSettings *sds, float pos[3])
 	pos[2] *= 1.0f / sds->cell_size[2];
 }
 
-/* set domain resolution and dimensions from object derivedmesh */
-static void smoke_set_domain_from_derivedmesh(SmokeDomainSettings *sds, Object *ob, DerivedMesh *dm)
+/* set domain transformations and base resolution from object derivedmesh */
+static void smoke_set_domain_from_derivedmesh(SmokeDomainSettings *sds, Object *ob, DerivedMesh *dm, int init_resolution)
 {
 	size_t i;
 	float min[3] = {FLT_MAX, FLT_MAX, FLT_MAX}, max[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX};
@@ -246,7 +246,10 @@ static void smoke_set_domain_from_derivedmesh(SmokeDomainSettings *sds, Object *
 
 	/* calculate domain dimensions */
 	sub_v3_v3v3(size, max, min);
-	copy_v3_v3(sds->cell_size, size);
+	if (init_resolution) {
+		zero_v3_int(sds->base_res);
+		copy_v3_v3(sds->cell_size, size);
+	}
 	mul_v3_v3(size, ob->size);
 	copy_v3_v3(sds->global_size, size);
 	copy_v3_v3(sds->dp0, min);
@@ -254,18 +257,18 @@ static void smoke_set_domain_from_derivedmesh(SmokeDomainSettings *sds, Object *
 	invert_m4_m4(sds->imat, ob->obmat);
 
 	// prevent crash when initializing a plane as domain
-	if ((size[0] < FLT_EPSILON) || (size[1] < FLT_EPSILON) || (size[2] < FLT_EPSILON))
+	if (!init_resolution || (size[0] < FLT_EPSILON) || (size[1] < FLT_EPSILON) || (size[2] < FLT_EPSILON))
 		return;
 
 	/* define grid resolutions from longest domain side */
-	if (size[0] > MAX2(size[1], size[2])) {
+	if (size[0] >= MAX2(size[1], size[2])) {
 		scale = res / size[0];
 		sds->scale = size[0] / ob->size[0];
 		sds->base_res[0] = res;
 		sds->base_res[1] = (int)(size[1] * scale + 0.5f);
 		sds->base_res[2] = (int)(size[2] * scale + 0.5f);
 	}
-	else if (size[1] > MAX2(size[0], size[2])) {
+	else if (size[1] >= MAX2(size[0], size[2])) {
 		scale = res / size[1];
 		sds->scale = size[1] / ob->size[1];
 		sds->base_res[0] = (int)(size[0] * scale + 0.5f);
@@ -293,7 +296,7 @@ static int smokeModifier_init(SmokeModifierData *smd, Object *ob, Scene *scene,
 		SmokeDomainSettings *sds = smd->domain;
 		int res[3];
 		/* set domain dimensions from derivedmesh */
-		smoke_set_domain_from_derivedmesh(sds, ob, dm);
+		smoke_set_domain_from_derivedmesh(sds, ob, dm, TRUE);
 		/* reset domain values */
 		zero_v3_int(sds->shift);
 		zero_v3(sds->shift_f);
@@ -1060,7 +1063,7 @@ static void get_texture_value(Tex *texture, float tex_co[3], TexResult *texres)
 	int result_type;
 
 	/* no node textures for now */
-	result_type = multitex_ext_safe(texture, tex_co, texres);
+	result_type = multitex_ext_safe(texture, tex_co, texres, NULL);
 
 	/* if the texture gave an RGB value, we assume it didn't give a valid
 	 * intensity, since this is in the context of modifiers don't use perceptual color conversion.
@@ -1580,7 +1583,7 @@ BLI_INLINE void apply_inflow_fields(SmokeFlowSettings *sfs, float emission_value
 	}
 
 	/* set fire reaction coordinate */
-	if (fuel && fuel[index]) {
+	if (fuel && fuel[index] > FLT_EPSILON) {
 		/* instead of using 1.0 for all new fuel add slight falloff
 		 * to reduce flow blockiness */
 		float value = 1.0f - powf(1.0f - emission_value, 2.0f);
@@ -1588,6 +1591,7 @@ BLI_INLINE void apply_inflow_fields(SmokeFlowSettings *sfs, float emission_value
 		if (value > react[index]) {
 			float f = fuel_flow / fuel[index];
 			react[index] = value * f + (1.0f - f) * react[index];
+			CLAMP(react[index], 0.0f, value);
 		}
 	}
 }
@@ -1984,7 +1988,7 @@ static void step(Scene *scene, Object *ob, SmokeModifierData *smd, DerivedMesh *
 	/* update object state */
 	invert_m4_m4(sds->imat, ob->obmat);
 	copy_m4_m4(sds->obmat, ob->obmat);
-	smoke_set_domain_from_derivedmesh(sds, ob, domain_dm);
+	smoke_set_domain_from_derivedmesh(sds, ob, domain_dm, (sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN));
 
 	/* use global gravity if enabled */
 	if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 79356d3..e2c6df5 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -4108,18 +4108,6 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
 		softbody_reset(ob, sb, vertexCos, numVerts);
 	}
 
-	/* continue physics special case */
-	if (BKE_ptcache_get_continue_physics()) {
-		BKE_ptcache_invalidate(cache);
-		/* do simulation */
-		dtime = timescale;
-		softbody_update_positions(ob, sb, vertexCos, numVerts);
-		softbody_step(scene, ob, sb, dtime);
-		softbody_to_object(ob, vertexCos, numVerts, 0);
-		sb->last_frame = framenr;
-		return;
-	}
-
 	/* still no points? go away */
 	if (sb->totpoint==0) {
 		return;
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index f6599cc..f339180 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -42,11 +42,11 @@
 #include "BKE_main.h"
 #include "BKE_speaker.h"
 
-void *BKE_speaker_add(const char *name)
+void *BKE_speaker_add(Main *bmain, const char *name)
 {
 	Speaker *spk;
 
-	spk =  BKE_libblock_alloc(&G.main->speaker, ID_SPK, name);
+	spk =  BKE_libblock_alloc(&bmain->speaker, ID_SPK, name);
 
 	spk->attenuation = 1.0f;
 	spk->cone_angle_inner = 360.0f;
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 6d4313d..e031002 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1013,7 +1013,11 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
 		mf->flag = faceFlags[i].flag;
 		mf->mat_nr = faceFlags[i].mat_nr;
 	}
-	else mf->flag = ME_SMOOTH;
+	else {
+		mf->flag = ME_SMOOTH;
+	}
+
+	mf->edcode = 0;
 }
 
 /* Translate GridHidden into the ME_HIDE flag for MVerts. Assumes
@@ -1093,6 +1097,14 @@ void subsurf_copy_grid_paint_mask(DerivedMesh *dm, const MPoly *mpoly,
 	}
 }
 
+/* utility functon */
+BLI_INLINE void ccgDM_to_MVert(MVert *mv, const CCGKey *key, CCGElem *elem)
+{
+	copy_v3_v3(mv->co, CCG_elem_co(key, elem));
+	normal_float_to_short_v3(mv->no, CCG_elem_no(key, elem));
+	mv->flag = mv->bweight = 0;
+}
+
 static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
 {
 	CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
@@ -1103,7 +1115,7 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
 	int totvert, totedge, totface;
 	int gridSize = ccgSubSurf_getGridSize(ss);
 	int edgeSize = ccgSubSurf_getEdgeSize(ss);
-	int i = 0;
+	unsigned int i = 0;
 
 	CCG_key_top_level(&key, ss);
 
@@ -1113,24 +1125,20 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
 		int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
 
 		vd = ccgSubSurf_getFaceCenterData(f);
-		copy_v3_v3(mvert[i].co, CCG_elem_co(&key, vd));
-		normal_float_to_short_v3(mvert[i].no, CCG_elem_no(&key, vd));
-		i++;
+		ccgDM_to_MVert(&mvert[i++], &key, vd);
 		
 		for (S = 0; S < numVerts; S++) {
-			for (x = 1; x < gridSize - 1; x++, i++) {
+			for (x = 1; x < gridSize - 1; x++) {
 				vd = ccgSubSurf_getFaceGridEdgeData(ss, f, S, x);
-				copy_v3_v3(mvert[i].co, CCG_elem_co(&key, vd));
-				normal_float_to_short_v3(mvert[i].no, CCG_elem_no(&key, vd));
+				ccgDM_to_MVert(&mvert[i++], &key, vd);
 			}
 		}
 
 		for (S = 0; S < numVerts; S++) {
 			for (y = 1; y < gridSize - 1; y++) {
-				for (x = 1; x < gridSize - 1; x++, i++) {
+				for (x = 1; x < gridSize - 1; x++) {
 					vd = ccgSubSurf_getFaceGridData(ss, f, S, x, y);
-					copy_v3_v3(mvert[i].co, CCG_elem_co(&key, vd));
-					normal_float_to_short_v3(mvert[i].no, CCG_elem_no(&key, vd));
+					ccgDM_to_MVert(&mvert[i++], &key, vd);
 				}
 			}
 		}
@@ -1141,15 +1149,14 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
 		CCGEdge *e = ccgdm->edgeMap[index].edge;
 		int x;
 
-		for (x = 1; x < edgeSize - 1; x++, i++) {
-			vd = ccgSubSurf_getEdgeData(ss, e, x);
-			copy_v3_v3(mvert[i].co, CCG_elem_co(&key, vd));
+		for (x = 1; x < edgeSize - 1; x++) {
 			/* This gives errors with -debug-fpe
 			 * the normals don't seem to be unit length.
 			 * this is most likely caused by edges with no
 			 * faces which are now zerod out, see comment in:
 			 * ccgSubSurf__calcVertNormals(), - campbell */
-			normal_float_to_short_v3(mvert[i].no, CCG_elem_no(&key, vd));
+			vd = ccgSubSurf_getEdgeData(ss, e, x);
+			ccgDM_to_MVert(&mvert[i++], &key, vd);
 		}
 	}
 
@@ -1158,12 +1165,20 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
 		CCGVert *v = ccgdm->vertMap[index].vert;
 
 		vd = ccgSubSurf_getVertData(ss, v);
-		copy_v3_v3(mvert[i].co, CCG_elem_co(&key, vd));
-		normal_float_to_short_v3(mvert[i].no, CCG_elem_no(&key, vd));
-		i++;
+		ccgDM_to_MVert(&mvert[i++], &key, vd);
 	}
 }
 
+
+/* utility functon */
+BLI_INLINE void ccgDM_to_MEdge(MEdge *med, const int v1, const int v2, const short flag)
+{
+	med->v1 = v1;
+	med->v2 = v2;
+	med->crease = med->bweight = 0;
+	med->flag = flag;
+}
+
 static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
 {
 	CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
@@ -1172,8 +1187,9 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
 	int totedge, totface;
 	int gridSize = ccgSubSurf_getGridSize(ss);
 	int edgeSize = ccgSubSurf_getEdgeSize(ss);
-	int i = 0;
+	unsigned int i = 0;
 	short *edgeFlags = ccgdm->edgeFlags;
+	const short ed_interior_flag = ccgdm->drawInteriorEdges ? (ME_EDGEDRAW | ME_EDGERENDER) : 0;
 
 	totface = ccgSubSurf_getNumFaces(ss);
 	for (index = 0; index < totface; index++) {
@@ -1182,36 +1198,22 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
 
 		for (S = 0; S < numVerts; S++) {
 			for (x = 0; x < gridSize - 1; x++) {
-				MEdge *med = &medge[i];
-
-				if (ccgdm->drawInteriorEdges)
-					med->flag = ME_EDGEDRAW | ME_EDGERENDER;
-				med->v1 = getFaceIndex(ss, f, S, x, 0, edgeSize, gridSize);
-				med->v2 = getFaceIndex(ss, f, S, x + 1, 0, edgeSize, gridSize);
-				i++;
+				ccgDM_to_MEdge(&medge[i++],
+				               getFaceIndex(ss, f, S, x,     0, edgeSize, gridSize),
+				               getFaceIndex(ss, f, S, x + 1, 0, edgeSize, gridSize),
+				               ed_interior_flag);
 			}
 
 			for (x = 1; x < gridSize - 1; x++) {
 				for (y = 0; y < gridSize - 1; y++) {
-					MEdge *med;
-
-					med = &medge[i];
-					if (ccgdm->drawInteriorEdges)
-						med->flag = ME_EDGEDRAW | ME_EDGERENDER;
-					med->v1 = getFaceIndex(ss, f, S, x, y,
-					                       edgeSize, gridSize);
-					med->v2 = getFaceIndex(ss, f, S, x, y + 1,
-					                       edgeSize, gridSize);
-					i++;
-
-					med = &medge[i];
-					if (ccgdm->drawInteriorEdges)
-						med->flag = ME_EDGEDRAW | ME_EDGERENDER;
-					med->v1 = getFaceIndex(ss, f, S, y, x,
-					                       edgeSize, gridSize);
-					med->v2 = getFaceIndex(ss, f, S, y + 1, x,
-					                       edgeSize, gridSize);
-					i++;
+					ccgDM_to_MEdge(&medge[i++],
+					               getFaceIndex(ss, f, S, x, y,    edgeSize, gridSize),
+					               getFaceIndex(ss, f, S, x, y + 1, edgeSize, gridSize),
+					               ed_interior_flag);
+					ccgDM_to_MEdge(&medge[i++],
+					               getFaceIndex(ss, f, S, y, x,     edgeSize, gridSize),
+					               getFaceIndex(ss, f, S, y + 1, x, edgeSize, gridSize),
+					               ed_interior_flag);
 				}
 			}
 		}
@@ -1220,27 +1222,28 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
 	totedge = ccgSubSurf_getNumEdges(ss);
 	for (index = 0; index < totedge; index++) {
 		CCGEdge *e = ccgdm->edgeMap[index].edge;
-		unsigned int flags = 0;
+		short ed_flag = 0;
 		int x;
 		int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e));
 
-		if (!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE;
+		if (!ccgSubSurf_getEdgeNumFaces(e)) {
+			ed_flag |= ME_LOOSEEDGE;
+		}
 
 		if (edgeFlags) {
 			if (edgeIdx != -1) {
-				flags |= ((edgeFlags[index] & (ME_SEAM | ME_SHARP)) | ME_EDGEDRAW | ME_EDGERENDER);
+				ed_flag |= ((edgeFlags[index] & (ME_SEAM | ME_SHARP)) | ME_EDGEDRAW | ME_EDGERENDER);
 			}
 		}
 		else {
-			flags |= ME_EDGEDRAW | ME_EDGERENDER;
+			ed_flag |= ME_EDGEDRAW | ME_EDGERENDER;
 		}
 
 		for (x = 0; x < edgeSize - 1; x++) {
-			MEdge *med = &medge[i];
-			med->v1 = getEdgeIndex(ss, e, x, edgeSize);
-			med->v2 = getEdgeIndex(ss, e, x + 1, edgeSize);
-			med->flag = flags;
-			i++;
+			ccgDM_to_MEdge(&medge[i++],
+			               getEdgeIndex(ss, e, x, edgeSize),
+			               getEdgeIndex(ss, e, x + 1, edgeSize),
+			               ed_flag);
 		}
 	}
 }
@@ -1278,6 +1281,7 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface)
 					                      edgeSize, gridSize);
 					mf->mat_nr = mat_nr;
 					mf->flag = flag;
+					mf->edcode = 0;
 
 					i++;
 				}
@@ -1708,7 +1712,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
 	if (ccgdm->pbvh && ccgdm->multires.mmd && !fast) {
 		if (dm->numTessFaceData) {
 			BKE_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL,
-						  setMaterial, FALSE);
+			              setMaterial, FALSE);
 			glShadeModel(GL_FLAT);
 		}
 
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index c337e33..74c0a76 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -38,12 +38,12 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_utildefines.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
 #include "BLI_string_cursor_utf8.h"
 #include "BLI_string_utf8.h"
 #include "BLI_listbase.h"
-#include "BLI_utildefines.h"
 #include "BLI_fileops.h"
 
 #include "DNA_constraint_types.h"
@@ -171,9 +171,8 @@ void BKE_text_free(Text *text)
 #endif
 }
 
-Text *BKE_text_add(const char *name) 
+Text *BKE_text_add(Main *bmain, const char *name) 
 {
-	Main *bmain = G.main;
 	Text *ta;
 	TextLine *tmp;
 	
@@ -363,9 +362,8 @@ int BKE_text_reload(Text *text)
 	return 1;
 }
 
-Text *BKE_text_load(const char *file, const char *relpath)
+Text *BKE_text_load(Main *bmain, const char *file, const char *relpath)
 {
-	Main *bmain = G.main;
 	FILE *fp;
 	int i, llen, len;
 	unsigned char *buffer;
@@ -938,7 +936,7 @@ void txt_move_right(Text *text, short sel)
 	if (!sel) txt_pop_sel(text);
 }
 
-void txt_jump_left(Text *text, short sel)
+void txt_jump_left(Text *text, bool sel, bool use_init_step)
 {
 	TextLine **linep;
 	int *charp;
@@ -950,12 +948,12 @@ void txt_jump_left(Text *text, short sel)
 
 	BLI_str_cursor_step_utf8((*linep)->line, (*linep)->len,
 	                         charp, STRCUR_DIR_PREV,
-	                         STRCUR_JUMP_DELIM);
+	                         STRCUR_JUMP_DELIM, use_init_step);
 	
 	if (!sel) txt_pop_sel(text);
 }
 
-void txt_jump_right(Text *text, short sel)
+void txt_jump_right(Text *text, bool sel, bool use_init_step)
 {
 	TextLine **linep;
 	int *charp;
@@ -967,7 +965,7 @@ void txt_jump_right(Text *text, short sel)
 	
 	BLI_str_cursor_step_utf8((*linep)->line, (*linep)->len,
 	                         charp, STRCUR_DIR_NEXT,
-	                         STRCUR_JUMP_DELIM);
+	                         STRCUR_JUMP_DELIM, use_init_step);
 	
 	if (!sel) txt_pop_sel(text);
 }
@@ -2404,7 +2402,7 @@ void txt_delete_char(Text *text)
 
 void txt_delete_word(Text *text)
 {
-	txt_jump_right(text, 1);
+	txt_jump_right(text, true, true);
 	txt_delete_sel(text);
 }
 
@@ -2453,7 +2451,7 @@ void txt_backspace_char(Text *text)
 
 void txt_backspace_word(Text *text)
 {
-	txt_jump_left(text, 1);
+	txt_jump_left(text, true, true);
 	txt_delete_sel(text);
 }
 
@@ -2930,6 +2928,28 @@ int text_check_identifier(const char ch)
 	return 0;
 }
 
+int text_check_identifier_nodigit(const char ch)
+{
+	if (ch <= '9') return 0;
+	if (ch < 'A') return 0;
+	if (ch <= 'Z' || ch == '_') return 1;
+	if (ch < 'a') return 0;
+	if (ch <= 'z') return 1;
+	return 0;
+}
+
+#ifndef WITH_PYTHON
+int text_check_identifier_unicode(const unsigned int ch)
+{
+	return (ch < 255 && text_check_identifier((char)ch));
+}
+
+int text_check_identifier_nodigit_unicode(const unsigned int ch)
+{
+	return (ch < 255 && text_check_identifier_nodigit((char)ch));
+}
+#endif  /* WITH_PYTHON */
+
 int text_check_whitespace(const char ch)
 {
 	if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n')
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index fbaf6f7..55a0f37 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -540,9 +540,8 @@ void tex_set_type(Tex *tex, int type)
 
 /* ------------------------------------------------------------------------- */
 
-Tex *add_texture(const char *name)
+Tex *add_texture(Main *bmain, const char *name)
 {
-	Main *bmain = G.main;
 	Tex *tex;
 
 	tex = BKE_libblock_alloc(&bmain->tex, ID_TE, name);
@@ -615,6 +614,7 @@ void default_mtex(MTex *mtex)
 	mtex->gravityfac = 1.0f;
 	mtex->fieldfac = 1.0f;
 	mtex->normapspace = MTEX_NSPACE_TANGENT;
+	mtex->brush_map_mode = MTEX_MAP_MODE_TILED;
 }
 
 
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 3c5d94a..a6519f8 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -169,8 +169,9 @@ void BKE_tracking_settings_init(MovieTracking *tracking)
 
 	tracking->settings.default_motion_model = TRACK_MOTION_MODEL_TRANSLATION;
 	tracking->settings.default_minimum_correlation = 0.75;
-	tracking->settings.default_pattern_size = 11;
+	tracking->settings.default_pattern_size = 15;
 	tracking->settings.default_search_size = 61;
+	tracking->settings.default_algorithm_flag |= TRACK_ALGORITHM_FLAG_USE_BRUTE;
 	tracking->settings.dist = 1;
 	tracking->settings.object_distance = 1;
 	tracking->settings.reconstruction_success_threshold = 1e-3;
@@ -1604,6 +1605,67 @@ ImBuf *BKE_tracking_distort_frame(MovieTracking *tracking, ImBuf *ibuf, int cali
 	                                    calibration_height, overscan, FALSE);
 }
 
+void BKE_tracking_max_undistortion_delta_across_bound(MovieTracking *tracking, rcti *rect, float delta[2])
+{
+	int a;
+	float pos[2], warped_pos[2];
+	const int coord_delta = 5;
+
+	delta[0] = delta[1] = -FLT_MAX;
+
+	for (a = rect->xmin; a <= rect->xmax + coord_delta; a += coord_delta) {
+		if (a > rect->xmax)
+			a = rect->xmax;
+
+		/* bottom edge */
+		pos[0] = a;
+		pos[1] = rect->ymin;
+
+		BKE_tracking_undistort_v2(tracking, pos, warped_pos);
+
+		delta[0] = max_ff(delta[0], fabs(pos[0] - warped_pos[0]));
+		delta[1] = max_ff(delta[1], fabs(pos[1] - warped_pos[1]));
+
+		/* top edge */
+		pos[0] = a;
+		pos[1] = rect->ymax;
+
+		BKE_tracking_undistort_v2(tracking, pos, warped_pos);
+
+		delta[0] = max_ff(delta[0], fabs(pos[0] - warped_pos[0]));
+		delta[1] = max_ff(delta[1], fabs(pos[1] - warped_pos[1]));
+
+		if (a >= rect->xmax)
+			break;
+	}
+
+	for (a = rect->ymin; a <= rect->ymax + coord_delta; a += coord_delta) {
+		if (a > rect->ymax)
+			a = rect->ymax;
+
+		/* left edge */
+		pos[0] = rect->xmin;
+		pos[1] = a;
+
+		BKE_tracking_undistort_v2(tracking, pos, warped_pos);
+
+		delta[0] = max_ff(delta[0], fabs(pos[0] - warped_pos[0]));
+		delta[1] = max_ff(delta[1], fabs(pos[1] - warped_pos[1]));
+
+		/* right edge */
+		pos[0] = rect->xmax;
+		pos[1] = a;
+
+		BKE_tracking_undistort_v2(tracking, pos, warped_pos);
+
+		delta[0] = max_ff(delta[0], fabs(pos[0] - warped_pos[0]));
+		delta[1] = max_ff(delta[1], fabs(pos[1] - warped_pos[1]));
+
+		if (a >= rect->ymax)
+			break;
+	}
+}
+
 /*********************** Image sampling *************************/
 
 static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale)
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 84e1f29..dd6ed42 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -142,7 +142,7 @@ static struct bUnitCollection buImperialLenCollecton = {buImperialLenDef, 4, 0,
 /* Areas */
 static struct bUnitDef buMetricAreaDef[] = {
 	{"square kilometer",  "square kilometers",  "km²", "km2",   "Square Kilometers", UN_SC_KM * UN_SC_KM, 0.0,    B_UNIT_DEF_NONE},
-	{"square hectometer", "square hectometers", "hm²", "hm2",   "Square Hectometers", UN_SC_HM * UN_SC_HM, 0.0,   B_UNIT_DEF_NONE},   /* hectare */
+	{"square hectometer", "square hectometers", "hm²", "hm2",   "Square Hectometers", UN_SC_HM * UN_SC_HM, 0.0,   B_UNIT_DEF_SUPPRESS},   /* hectare */
 	{"square dekameter",  "square dekameters",  "dam²", "dam2",  "Square Dekameters", UN_SC_DAM * UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},  /* are */
 	{"square meter",      "square meters",      "m²",  "m2",    "Square Meters", UN_SC_M * UN_SC_M, 0.0,          B_UNIT_DEF_NONE},   /* base unit */
 	{"square decimeter",  "square decimetees",  "dm²", "dm2",   "Square Decimeters", UN_SC_DM * UN_SC_DM, 0.0,    B_UNIT_DEF_SUPPRESS},
@@ -168,7 +168,7 @@ static struct bUnitCollection buImperialAreaCollecton = {buImperialAreaDef, 4, 0
 /* Volumes */
 static struct bUnitDef buMetricVolDef[] = {
 	{"cubic kilometer",  "cubic kilometers",  "km³",  "km3",  "Cubic Kilometers", UN_SC_KM * UN_SC_KM * UN_SC_KM, 0.0,    B_UNIT_DEF_NONE},
-	{"cubic hectometer", "cubic hectometers", "hm³",  "hm3",  "Cubic Hectometers", UN_SC_HM * UN_SC_HM * UN_SC_HM, 0.0,   B_UNIT_DEF_NONE},
+	{"cubic hectometer", "cubic hectometers", "hm³",  "hm3",  "Cubic Hectometers", UN_SC_HM * UN_SC_HM * UN_SC_HM, 0.0,   B_UNIT_DEF_SUPPRESS},
 	{"cubic dekameter",  "cubic dekameters",  "dam³", "dam3", "Cubic Dekameters", UN_SC_DAM * UN_SC_DAM * UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},
 	{"cubic meter",      "cubic meters",      "m³",   "m3",   "Cubic Meters", UN_SC_M * UN_SC_M * UN_SC_M, 0.0,           B_UNIT_DEF_NONE}, /* base unit */
 	{"cubic decimeter",  "cubic decimeters",  "dm³",  "dm3",  "Cubic Decimeters", UN_SC_DM * UN_SC_DM * UN_SC_DM, 0.0,    B_UNIT_DEF_SUPPRESS},
@@ -194,9 +194,9 @@ static struct bUnitCollection buImperialVolCollecton = {buImperialVolDef, 4, 0,
 /* Mass */
 static struct bUnitDef buMetricMassDef[] = {
 	{"ton", "tonnes",           "ton", "t",  "1000 Kilograms", UN_SC_MTON, 0.0,  B_UNIT_DEF_NONE},
-	{"quintal", "quintals",     "ql",  "q",  "100 Kilograms", UN_SC_QL, 0.0,     B_UNIT_DEF_NONE},
+	{"quintal", "quintals",     "ql",  "q",  "100 Kilograms", UN_SC_QL, 0.0,     B_UNIT_DEF_SUPPRESS},
 	{"kilogram", "kilograms",   "kg",  NULL, "Kilograms", UN_SC_KG, 0.0,         B_UNIT_DEF_NONE}, /* base unit */
-	{"hectogram", "hectograms", "hg",  NULL, "Hectograms", UN_SC_HG, 0.0,        B_UNIT_DEF_NONE},
+	{"hectogram", "hectograms", "hg",  NULL, "Hectograms", UN_SC_HG, 0.0,        B_UNIT_DEF_SUPPRESS},
 	{"dekagram", "dekagrams",   "dag", NULL, "10 Grams", UN_SC_DAG, 0.0,         B_UNIT_DEF_SUPPRESS},
 	{"gram", "grams",           "g",   NULL, "Grams", UN_SC_G, 0.0,              B_UNIT_DEF_NONE},
 	{NULL, NULL, NULL,  NULL, NULL, 0.0, 0.0}
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index ad101c4..206f829 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -79,9 +79,8 @@ void BKE_world_free(World *wrld)
 	BKE_world_free_ex(wrld, TRUE);
 }
 
-World *add_world(const char *name)
+World *add_world(Main *bmain, const char *name)
 {
-	Main *bmain = G.main;
 	World *wrld;
 
 	wrld = BKE_libblock_alloc(&bmain->world, ID_WO, name);
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h
index 7c8816c..0ba0f13 100644
--- a/source/blender/blenlib/BLI_array.h
+++ b/source/blender/blenlib/BLI_array.h
@@ -25,53 +25,19 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
+#ifndef __BLI_ARRAY_H__
+#define __BLI_ARRAY_H__
+
 /** \file BLI_array.h
  *  \ingroup bli
- *  \brief A macro array library.
- *
- * this library needs to be changed to not use macros quite so heavily,
- * and to be more of a complete array API.  The way arrays are
- * exposed to client code as normal C arrays is very useful though, imho.
- * it does require some use of macros, however.
- *
- * anyway, it's used a bit too heavily to simply rewrite as a
- * more "correct" solution without macros entirely.  I originally wrote this
- * to be very easy to use, without the normal pain of most array libraries.
- * This was especially helpful when it came to the massive refactors necessary
- * for bmesh, and really helped to speed the process up. - joeedh
- *
- * little array macro library.  example of usage:
- *
- * int *arr = NULL;
- * BLI_array_declare(arr);
- * int i;
- *
- * for (i = 0; i < 10; i++) {
- *     BLI_array_grow_one(arr);
- *     arr[i] = something;
- * }
- * BLI_array_free(arr);
- *
- * arrays are buffered, using double-buffering (so on each reallocation,
- * the array size is doubled).  supposedly this should give good Big Oh
- * behavior, though it may not be the best in practice.
+ *  \brief A (mainly) macro array library.
  */
 
-#define BLI_array_declare(arr)                                                \
-	int   _##arr##_count = 0;                                                 \
-	void *_##arr##_tmp;                                                       \
-	void *_##arr##_static = NULL
-
-/* this will use stack space, up to maxstatic array elements, before
- * switching to dynamic heap allocation */
-#define BLI_array_staticdeclare(arr, maxstatic)                               \
-	int   _##arr##_count = 0;                                                 \
-	void *_##arr##_tmp;                                                       \
-	char  _##arr##_static[maxstatic * sizeof(arr)]
-
+/* -------------------------------------------------------------------- */
+/* internal defines */
 
 /* this returns the entire size of the array, including any buffering. */
-#define BLI_array_totalsize_dyn(arr)  (                                       \
+#define _bli_array_totalsize_dynamic(arr)  (                                  \
 	((arr) == NULL) ?                                                         \
 	    0 :                                                                   \
 	    MEM_allocN_len(arr) / sizeof(*arr)                                    \
@@ -80,55 +46,61 @@
 #define _bli_array_totalsize_static(arr)  \
 	(sizeof(_##arr##_static) / sizeof(*arr))
 
-#define BLI_array_totalsize(arr)  (                                           \
+#define _bli_array_totalsize(arr)  (                                          \
 	(size_t)                                                                  \
 	(((void *)(arr) == (void *)_##arr##_static && (void *)(arr) != NULL) ?    \
 	    _bli_array_totalsize_static(arr) :                                    \
-	    BLI_array_totalsize_dyn(arr))                                         \
+	    _bli_array_totalsize_dynamic(arr))                                    \
 )
 
+/* BLI_array.c
+ *
+ * Doing the realloc in a macro isn't so simple,
+ * so use a function the macros can use.
+ */
+void _bli_array_grow_func(void **arr_p, const void *arr_static,
+                          const int sizeof_arr_p, const int arr_count, const int num,
+                          const char *alloc_str);
+
+
+/* -------------------------------------------------------------------- */
+/* public defines */
+
+#define BLI_array_declare(arr)                                                \
+	int   _##arr##_count = 0;                                                 \
+	void *_##arr##_static = NULL
+
+/* this will use stack space, up to maxstatic array elements, before
+ * switching to dynamic heap allocation */
+#define BLI_array_staticdeclare(arr, maxstatic)                               \
+	int   _##arr##_count = 0;                                                 \
+	char  _##arr##_static[maxstatic * sizeof(arr)]
 
 /* this returns the logical size of the array, not including buffering. */
 #define BLI_array_count(arr) _##arr##_count
 
-/* Grow the array by a fixed number of items. zeroes the new elements.
+/* Grow the array by a fixed number of items.
  *
  * Allow for a large 'num' value when the new size is more then double
  * to allocate the exact sized array. */
-
-/* grow an array by a specified number of items */
-#define BLI_array_grow_items(arr, num)  (                                     \
+#define BLI_array_grow_items(arr, num)  ((                                    \
 	(((void *)(arr) == NULL) &&                                               \
 	 ((void *)(_##arr##_static) != NULL) &&                                   \
-	/* dont add _##arr##_count below because it must be zero */               \
+	/* don't add _##arr##_count below because it must be zero */              \
 	 (_bli_array_totalsize_static(arr) >= _##arr##_count + num)) ?            \
 	/* we have an empty array and a static var big enough */                  \
-	((arr = (void *)_##arr##_static), (_##arr##_count += (num)))              \
+	(arr = (void *)_##arr##_static)                                           \
 	    :                                                                     \
 	/* use existing static array or allocate */                               \
-	(LIKELY(BLI_array_totalsize(arr) >= _##arr##_count + num) ?               \
-	    (_##arr##_count += num) :  /* UNLIKELY --> realloc */                 \
-	    (                                                                     \
-	        (void) (_##arr##_tmp = MEM_callocN(                               \
-	                sizeof(*arr) * (num < _##arr##_count ?                    \
-	                                (_##arr##_count * 2 + 2) :                \
-	                                (_##arr##_count + num)),                  \
-	                #arr " " __FILE__ ":" STRINGIFY(__LINE__)                 \
-	                )                                                         \
-	                ),                                                        \
-	        (void) (arr && memcpy(_##arr##_tmp,                               \
-	                              arr,                                        \
-	                              sizeof(*arr) * _##arr##_count)              \
-	                ),                                                        \
-	        (void) (arr && ((void *)(arr) != (void *)_##arr##_static ?        \
-	                (MEM_freeN(arr), arr) :                                   \
-	                arr)                                                      \
-	                ),                                                        \
-	        (void) (arr = _##arr##_tmp                                        \
-	                ),                                                        \
-	        (_##arr##_count += num)                                           \
-	    ))                                                                    \
-)
+	(LIKELY(_bli_array_totalsize(arr) >= _##arr##_count + num) ?              \
+	 (void)0 /* do nothing */ :                                               \
+	 _bli_array_grow_func((void **)&(arr), _##arr##_static,                   \
+	                       sizeof(*arr), _##arr##_count, num,                 \
+	                       "BLI_array." #arr),                                \
+	 (void)0)  /* msvc2008 needs this */                                      \
+	),                                                                        \
+	/* increment the array count, all conditions above are accounted for. */  \
+	(_##arr##_count += num))
 
 /* returns length of array */
 #define BLI_array_grow_one(arr)  BLI_array_grow_items(arr, 1)
@@ -167,20 +139,23 @@
 /* resets the logical size of an array to zero, but doesn't
  * free the memory. */
 #define BLI_array_empty(arr)                                                  \
-	_##arr##_count = 0; (void)0
+	{ _##arr##_count = 0; } (void)0
 
 /* set the count of the array, doesn't actually increase the allocated array
  * size.  don't use this unless you know what you're doing. */
 #define BLI_array_length_set(arr, count)                                      \
-	_##arr##_count = (count); (void)0
+	{ _##arr##_count = (count); }(void)0
 
 /* only to prevent unused warnings */
 #define BLI_array_fake_user(arr)                                              \
 	(void)_##arr##_count,                                                     \
-	(void)_##arr##_tmp,                                                       \
 	(void)_##arr##_static
 
 
+/* -------------------------------------------------------------------- */
+/* other useful defines
+ * (unrelated to the main array macros) */
+
 /* not part of the 'API' but handy funcs,
  * same purpose as BLI_array_staticdeclare()
  * but use when the max size is known ahead of time */
@@ -224,3 +199,4 @@
 	const int _##arr##_count = (realsize)
 #endif
 
+#endif  /* __BLI_ARRAY_H__ */
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 69d6478..aa4e697 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -80,6 +80,9 @@
 #define MAXFLOAT  ((float)3.40282347e+38)
 #endif
 
+/* do not redefine functions from C99 or POSIX.1-2001 */
+#if !(defined(_ISOC99_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L))
+
 #ifndef sqrtf
 #define sqrtf(a) ((float)sqrt(a))
 #endif
@@ -129,6 +132,8 @@
 #define hypotf(a, b) ((float)hypot(a, b))
 #endif
 
+#endif  /* C99 or POSIX.1-2001 */
+
 #ifdef WIN32
 #  ifndef FREE_WINDOWS
 #    define isnan(n) _isnan(n)
@@ -212,5 +217,26 @@ extern double round(double x);
 
 double double_round(double x, int ndigits);
 
-#endif /* __BLI_MATH_BASE_H__ */
+/* asserts, some math functions expect normalized inputs
+ * check the vector is unit length, or zero length (which can't be helped in some cases).
+ */
+#ifdef DEBUG
+/* note: 0.0001 is too small becaues normals may be converted from short's: see [#34322] */
+#  define BLI_ASSERT_UNIT_EPSILON 0.0002f
+#  define BLI_ASSERT_UNIT_V3(v)  {                                            \
+	const float _test_unit = len_squared_v3(v);                               \
+	BLI_assert((fabsf(_test_unit - 1.0f) < BLI_ASSERT_UNIT_EPSILON) ||        \
+	           (fabsf(_test_unit)        < BLI_ASSERT_UNIT_EPSILON));         \
+} (void)0
 
+#  define BLI_ASSERT_UNIT_V2(v)  {                                            \
+	const float _test_unit = len_squared_v2(v);                               \
+	BLI_assert((fabsf(_test_unit - 1.0f) < BLI_ASSERT_UNIT_EPSILON) ||        \
+	           (fabsf(_test_unit)        < BLI_ASSERT_UNIT_EPSILON));         \
+} (void)0
+#else
+#  define BLI_ASSERT_UNIT_V2(v) (void)0
+#  define BLI_ASSERT_UNIT_V3(v) (void)0
+#endif
+
+#endif /* __BLI_MATH_BASE_H__ */
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h
index 3831ec3..145427e 100644
--- a/source/blender/blenlib/BLI_math_color.h
+++ b/source/blender/blenlib/BLI_math_color.h
@@ -102,8 +102,10 @@ void BLI_init_srgb_conversion(void);
 
 /**************** Alpha Transformations *****************/
 
-MINLINE void premul_to_straight_v4(float straight[4], const float premul[4]);
-MINLINE void straight_to_premul_v4(float straight[4], const float premul[4]);
+MINLINE void premul_to_straight_v4_v4(float straight[4], const float premul[4]);
+MINLINE void premul_to_straight_v4(float color[4]);
+MINLINE void straight_to_premul_v4_v4(float straight[4], const float premul[4]);
+MINLINE void straight_to_premul_v4(float color[4]);
 MINLINE void straight_uchar_to_premul_float(float result[4], const unsigned char color[4]);
 MINLINE void premul_float_to_straight_uchar(unsigned char *result, const float color[4]);
 
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 4483968..c4e17b1 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -51,6 +51,7 @@ float normal_quad_v3(float r[3], const float a[3], const float b[3], const float
 float area_tri_v2(const float a[2], const float b[2], const float c[2]);
 float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2]);
 float area_tri_v3(const float a[3], const float b[3], const float c[3]);
+float area_tri_signed_v3(const float v1[3], const float v2[3], const float v3[3], const float normal[3]);
 float area_quad_v3(const float a[3], const float b[3], const float c[3], const float d[3]);
 float area_poly_v3(int nr, float verts[][3], const float normal[3]);
 float area_poly_v2(int nr, float verts[][2]);
@@ -68,6 +69,7 @@ void closest_to_line_segment_v2(float closest[2], const float p[2], const float
 float dist_to_plane_normalized_v3(const float p[3], const float plane_co[3], const float plane_no_unit[3]);
 float dist_to_plane_v3(const float p[3], const float plane_co[3], const float plane_no[3]);
 float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]);
+float dist_to_line_v3(const float p[3], const float l1[3], const float l2[3]);
 float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const float l2[3]);
 float closest_to_line_v2(float r[2], const float p[2], const float l1[2], const float l2[2]);
 void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3], const float l2[3]);
@@ -130,7 +132,7 @@ int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3],
 /* point in polygon */
 int isect_point_quad_v2(const float p[2], const float a[2], const float b[2], const float c[2], const float d[2]);
 
-int isect_point_tri_v2(const float v1[2], const float v2[2], const float v3[2], const float pt[2]);
+int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2]);
 int isect_point_tri_v2_cw(const float pt[2], const float v1[2], const float v2[2], const float v3[2]);
 int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b);
 int isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3]);
@@ -261,6 +263,7 @@ MINLINE void madd_sh_shfl(float r[9], const float sh[3], const float f);
 float form_factor_hemi_poly(float p[3], float n[3],
                             float v1[3], float v2[3], float v3[3], float v4[3]);
 
+bool  axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3]);
 void  axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float axis[3]);
 float axis_dominant_v3_max(int *r_axis_a, int *r_axis_b, const float axis[3])
 #ifdef __GNUC__
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index c12ec62..97cd6a6 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -88,13 +88,15 @@ void mul_serie_m4(float R[4][4],
 
 void mul_m4_v3(float M[4][4], float r[3]);
 void mul_v3_m4v3(float r[3], float M[4][4], const float v[3]);
+void mul_v2_m2v2(float r[2], float M[2][2], const float v[2]);
 void mul_mat3_m4_v3(float M[4][4], float r[3]);
 void mul_m4_v4(float M[4][4], float r[4]);
-void mul_v4_m4v4(float r[4], float M[4][4], float v[4]);
+void mul_v4_m4v4(float r[4], float M[4][4], const float v[4]);
 void mul_project_m4_v3(float M[4][4], float vec[3]);
 
 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_v3_m3v3(float r[3], float M[3][3], const float a[3]);
+void mul_v2_m3v3(float r[2], float M[3][3], const 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]);
 
@@ -169,10 +171,13 @@ void mat4_to_size(float r[3], float M[4][4]);
 
 void translate_m4(float mat[4][4], float tx, float ty, float tz);
 void rotate_m4(float mat[4][4], const char axis, const float angle);
+void rotate_m2(float mat[2][2], const float angle);
 
 
 void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[3][3]);
 void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wmat[4][4]);
+void mat4_to_loc_quat(float loc[3], float quat[4], float wmat[4][4]);
+void mat4_decompose(float loc[3], float quat[4], float size[3], float wmat[4][4]);
 
 void loc_eul_size_to_mat4(float R[4][4],
                           const float loc[3], const float eul[3], const float size[3]);
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index 652925f..5ba37d7 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -186,6 +186,11 @@ float fov_to_focallength(float fov, float sensor);
 float angle_wrap_rad(float angle);
 float angle_wrap_deg(float angle);
 
+float angle_compat_rad(float angle, float angle_compat);
+
+int mat3_from_axis_conversion(int from_forward, int from_up, int to_forward, int to_up,
+                              float r_mat[3][3]);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index f4572af..42a6b90 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -171,6 +171,10 @@ void mid_v3_v3v3(float r[3], const float a[3], const float b[3]);
 void mid_v2_v2v2(float r[2], const float a[2], const float b[2]);
 void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3]);
 
+void flip_v4_v4v4(float v[4], const float v1[4], const float v2[4]);
+void flip_v3_v3v3(float v[3], const float v1[3], const float v2[3]);
+void flip_v2_v2v2(float v[2], const float v1[2], const float v2[2]);
+
 /********************************* Comparison ********************************/
 
 MINLINE int is_zero_v3(const float a[3]);
@@ -251,6 +255,7 @@ void sub_vn_vn(float *array_tar, const float *array_src, const int size);
 void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size);
 void msub_vn_vn(float *array_tar, const float *array_src, const float f, const int size);
 void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size);
+void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size);
 void fill_vn_i(int *array_tar, const int size, const int val);
 void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
 void fill_vn_fl(float *array_tar, const int size, const float val);
diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h
index 8fd2166..a1cbad7 100644
--- a/source/blender/blenlib/BLI_mempool.h
+++ b/source/blender/blenlib/BLI_mempool.h
@@ -86,6 +86,18 @@ __attribute__((warn_unused_result))
 __attribute__((nonnull(1)))
 #endif
 ;
+void        BLI_mempool_as_array(BLI_mempool *pool, void **data)
+#ifdef __GNUC__
+__attribute__((nonnull(1)))
+#endif
+;
+
+void *BLI_mempool_as_arrayN(BLI_mempool *pool, const char *allocstr)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull(1, 2)))
+#endif
+;
 
 /** iteration stuff.  note: this may easy to produce bugs with **/
 /* private structure */
diff --git a/source/blender/blenlib/BLI_string_cursor_utf8.h b/source/blender/blenlib/BLI_string_cursor_utf8.h
index 3c38c03..04d9df2 100644
--- a/source/blender/blenlib/BLI_string_cursor_utf8.h
+++ b/source/blender/blenlib/BLI_string_cursor_utf8.h
@@ -46,6 +46,6 @@ int BLI_str_cursor_step_prev_utf8(const char *str, size_t maxlen, int *pos);
 
 void BLI_str_cursor_step_utf8(const char *str, size_t maxlen,
                               int *pos, strCursorJumpDirection direction,
-                              strCursorJumpType jump);
+                              strCursorJumpType jump, bool use_init_step);
 
 #endif /* __BLI_STRING_CURSOR_UTF8_H__ */
diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h
index ecbc4cb..30d5c28 100644
--- a/source/blender/blenlib/BLI_string_utf8.h
+++ b/source/blender/blenlib/BLI_string_utf8.h
@@ -41,6 +41,7 @@ int          BLI_str_utf8_size_safe(const char *p);
 /* copied from glib */
 unsigned int BLI_str_utf8_as_unicode(const char *p);
 unsigned int BLI_str_utf8_as_unicode_and_size(const char *__restrict p, size_t *__restrict index);
+unsigned int BLI_str_utf8_as_unicode_and_size_safe(const char *__restrict p, size_t *__restrict index);
 unsigned int BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__restrict index);
 size_t       BLI_str_utf8_from_unicode(unsigned int c, char *outbuf);
 
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 43b1e78..95ad786 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -45,7 +45,11 @@
 #  ifdef __cplusplus
 typedef bool _BLI_Bool;
 #  else
-#   define _BLI_Bool signed char
+/* using char here may cause nasty tricky bugs, e.g.
+ *     bool is_bit_flag = RNA_property_flag(prop) & PROP_ENUM_FLAG;
+ * as PROP_ENUM_FLAG is farther than 8th bit, do_translate would be always false!
+ */
+#   define _BLI_Bool unsigned int
 #  endif
 # else
 #  define _BLI_Bool _Bool
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 49e3db0..e585110 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -38,6 +38,7 @@ set(INC_SYS
 
 set(SRC
 	intern/BLI_args.c
+	intern/BLI_array.c
 	intern/BLI_dynstr.c
 	intern/BLI_ghash.c
 	intern/BLI_heap.c
diff --git a/source/blender/blenlib/intern/BLI_array.c b/source/blender/blenlib/intern/BLI_array.c
new file mode 100644
index 0000000..5823b7d
--- /dev/null
+++ b/source/blender/blenlib/intern/BLI_array.c
@@ -0,0 +1,97 @@
+/*
+ * ***** 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) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joseph Eagar,
+ *                 Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenlib/intern/BLI_array.c
+ *  \ingroup bli
+ *  \brief A (mainly) macro array library.
+ *
+ * This library needs to be changed to not use macros quite so heavily,
+ * and to be more of a complete array API.  The way arrays are
+ * exposed to client code as normal C arrays is very useful though, imho.
+ * it does require some use of macros, however.
+ *
+ * anyway, it's used a bit too heavily to simply rewrite as a
+ * more "correct" solution without macros entirely.  I originally wrote this
+ * to be very easy to use, without the normal pain of most array libraries.
+ * This was especially helpful when it came to the massive refactors necessary
+ * for bmesh, and really helped to speed the process up. - joeedh
+ *
+ * little array macro library.  example of usage:
+ *
+ * int *arr = NULL;
+ * BLI_array_declare(arr);
+ * int i;
+ *
+ * for (i = 0; i < 10; i++) {
+ *     BLI_array_grow_one(arr);
+ *     arr[i] = something;
+ * }
+ * BLI_array_free(arr);
+ *
+ * arrays are buffered, using double-buffering (so on each reallocation,
+ * the array size is doubled).  supposedly this should give good Big Oh
+ * behavior, though it may not be the best in practice.
+ */
+
+#include <string.h>
+
+#include "BLI_array.h"
+
+#include "MEM_guardedalloc.h"
+
+/**
+ * This function is only to be called via macros.
+ *
+ * \note The caller must adjust \a arr_count
+ */
+void _bli_array_grow_func(void **arr_p, const void *arr_static,
+                          const int sizeof_arr_p, const int arr_count, const int num,
+                          const char *alloc_str)
+{
+	void *arr = *arr_p;
+	void *arr_tmp;
+
+	arr_tmp = MEM_mallocN(sizeof_arr_p *
+	                      ((num < arr_count) ?
+	                      (arr_count * 2 + 2) : (arr_count + num)), alloc_str);
+
+	if (arr) {
+		memcpy(arr_tmp, arr, sizeof_arr_p * arr_count);
+
+		if (arr != arr_static) {
+			MEM_freeN(arr);
+		}
+	}
+
+	*arr_p = arr_tmp;
+
+	/* caller must do */
+#if 0
+	arr_count += num;
+#endif
+}
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 7d2fc38..7ebe443 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -78,9 +78,9 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val)
 	unsigned int hash = gh->hashfp(key) % gh->nbuckets;
 	Entry *e = (Entry *)BLI_mempool_alloc(gh->entrypool);
 
+	e->next = gh->buckets[hash];
 	e->key = key;
 	e->val = val;
-	e->next = gh->buckets[hash];
 	gh->buckets[hash] = e;
 
 	if (++gh->nentries > (float)gh->nbuckets / 2) {
@@ -109,13 +109,13 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val)
 
 void *BLI_ghash_lookup(GHash *gh, const void *key)
 {
-	if (gh) {
-		unsigned int hash = gh->hashfp(key) % gh->nbuckets;
-		Entry *e;
+	const unsigned int hash = gh->hashfp(key) % gh->nbuckets;
+	Entry *e;
 
-		for (e = gh->buckets[hash]; e; e = e->next)
-			if (gh->cmpfp(key, e->key) == 0)
-				return e->val;
+	for (e = gh->buckets[hash]; e; e = e->next) {
+		if (gh->cmpfp(key, e->key) == 0) {
+			return e->val;
+		}
 	}
 	return NULL;
 }
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index d98e63d..5f0c90f 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -27,9 +27,7 @@
 
 /** \file blender/blenlib/intern/BLI_mempool.c
  *  \ingroup bli
- */
-
-/*
+ *
  * Simple, fast memory allocator for allocating many elements of the same size.
  */
 
@@ -56,6 +54,9 @@
 
 #define FREEWORD MAKE_ID('f', 'r', 'e', 'e')
 
+/* currently totalloc isnt used */
+// #define USE_TOTALLOC
+
 typedef struct BLI_freenode {
 	struct BLI_freenode *next;
 	int freeword; /* used to identify this as a freed node */
@@ -112,6 +113,7 @@ BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag)
 	pool->pchunk = pchunk;
 	pool->csize = esize * pchunk;
 	pool->chunks.first = pool->chunks.last = NULL;
+	pool->totalloc = 0;
 	pool->totused = 0;
 
 	maxchunks = totelem / pchunk + 1;
@@ -161,10 +163,11 @@ BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag)
 			}
 		}
 
-		/* set the end of this chunks memoryy to the new tail for next iteration */
+		/* set the end of this chunks memory to the new tail for next iteration */
 		lasttail = curnode;
-
+#ifdef USE_TOTALLOC
 		pool->totalloc += pool->pchunk;
+#endif
 	}
 	/* terminate the list */
 	curnode->next = NULL;
@@ -215,8 +218,9 @@ void *BLI_mempool_alloc(BLI_mempool *pool)
 			}
 		}
 		curnode->next = NULL; /* terminate the list */
-
+#ifdef USE_TOTALLOC
 		pool->totalloc += pool->pchunk;
+#endif
 	}
 
 	retval = pool->free;
@@ -237,12 +241,20 @@ void *BLI_mempool_calloc(BLI_mempool *pool)
 	return retval;
 }
 
-/* doesnt protect against double frees, don't be stupid! */
+/**
+ * Free an element from the mempool.
+ *
+ * \note doesnt protect against double frees, don't be stupid!
+ */
 void BLI_mempool_free(BLI_mempool *pool, void *addr)
 {
 	BLI_freenode *newhead = addr;
 
 	if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
+#ifndef NDEBUG
+		/* this will detect double free's */
+		BLI_assert(newhead->freeword != FREEWORD);
+#endif
 		newhead->freeword = FREEWORD;
 	}
 
@@ -276,7 +288,9 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr)
 		}
 
 		BLI_addtail(&pool->chunks, first);
+#ifdef USE_TOTALLOC
 		pool->totalloc = pool->pchunk;
+#endif
 
 		pool->free = first->data; /* start of the list */
 		for (tmpaddr = first->data, i = 0; i < pool->pchunk; i++) {
@@ -295,33 +309,51 @@ int BLI_mempool_count(BLI_mempool *pool)
 
 void *BLI_mempool_findelem(BLI_mempool *pool, int index)
 {
-	if (!(pool->flag & BLI_MEMPOOL_ALLOW_ITER)) {
-		fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__);
-		return NULL;
-	}
-	else if ((index >= 0) && (index < pool->totused)) {
+	BLI_assert(pool->flag & BLI_MEMPOOL_ALLOW_ITER);
+
+	if ((index >= 0) && (index < pool->totused)) {
 		/* we could have some faster mem chunk stepping code inline */
 		BLI_mempool_iter iter;
 		void *elem;
 		BLI_mempool_iternew(pool, &iter);
 		for (elem = BLI_mempool_iterstep(&iter); index-- != 0; elem = BLI_mempool_iterstep(&iter)) {
 			/* do nothing */
-		};
+		}
 		return elem;
 	}
 
 	return NULL;
 }
 
-void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter)
+/**
+ * \param data array of pointers at least the size of 'pool->totused'
+ */
+void BLI_mempool_as_array(BLI_mempool *pool, void **data)
 {
-	if (!(pool->flag & BLI_MEMPOOL_ALLOW_ITER)) {
-		fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__);
-		iter->curchunk = NULL;
-		iter->curindex = 0;
-
-		return;
+	BLI_mempool_iter iter;
+	void *elem;
+	void **p = data;
+	BLI_assert(pool->flag & BLI_MEMPOOL_ALLOW_ITER);
+	BLI_mempool_iternew(pool, &iter);
+	for (elem = BLI_mempool_iterstep(&iter); elem; elem = BLI_mempool_iterstep(&iter)) {
+		*p++ = elem;
 	}
+	BLI_assert((p - data) == pool->totused);
+}
+
+/**
+ * Allocate an array from the mempool.
+ */
+void *BLI_mempool_as_arrayN(BLI_mempool *pool, const char *allocstr)
+{
+	void *data = MEM_mallocN(BLI_mempool_count(pool) * pool->esize, allocstr);
+	BLI_mempool_as_array(pool, data);
+	return data;
+}
+
+void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter)
+{
+	BLI_assert(pool->flag & BLI_MEMPOOL_ALLOW_ITER);
 
 	iter->pool = pool;
 	iter->curchunk = pool->chunks.first;
@@ -391,6 +423,9 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
 
 #endif
 
+/**
+ * Free the mempool its self (and all elements).
+ */
 void BLI_mempool_destroy(BLI_mempool *pool)
 {
 	BLI_mempool_chunk *mpchunk = NULL;
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 0f42fca..24b3c36 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -111,7 +111,7 @@ int BLI_file_gzip(const char *from, const char *to)
 	return rval;
 }
 
-/* gzip the file in from_file and write it to memery to_mem, at most size bytes.
+/* gzip the file in from_file and write it to memory to_mem, at most size bytes.
  * return the unziped size
  */
 char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r)
@@ -283,7 +283,7 @@ int BLI_move(const char *file, const char *to)
 {
 	int err;
 
-	/* windows doesn't support moveing to a directory
+	/* windows doesn't support moving to a directory
 	 * it has to be 'mv filename filename' and not
 	 * 'mv filename destdir' */
 
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index b8eeca5..e9a1c0a 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -174,7 +174,8 @@ MINLINE void srgb_to_linearrgb_uchar4_predivide(float linear[4], const unsigned
 }
 
 /* color macros for themes */
-#define rgba_char_args_set_fl(col, r, g, b, a)  rgba_char_args_set(col, r * 255, g * 255, b * 255, a * 255)
+#define rgba_char_args_set_fl(col, r, g, b, a) \
+	rgba_char_args_set(col, (r) * 255, (g) * 255, (b) * 255, (a) * 255)
 
 MINLINE void rgba_char_args_set(char col[4], const char r, const char g, const char b, const char a)
 {
@@ -270,7 +271,7 @@ MINLINE int compare_rgb_uchar(const unsigned char col_a[3], const unsigned char
 
 /**************** Alpha Transformations *****************/
 
-MINLINE void premul_to_straight_v4(float straight[4], const float premul[4])
+MINLINE void premul_to_straight_v4_v4(float straight[4], const float premul[4])
 {
 	if (premul[3] == 0.0f || premul[3] == 1.0f) {
 		straight[0] = premul[0];
@@ -287,7 +288,12 @@ MINLINE void premul_to_straight_v4(float straight[4], const float premul[4])
 	}
 }
 
-MINLINE void straight_to_premul_v4(float premul[4], const float straight[4])
+MINLINE void premul_to_straight_v4(float color[4])
+{
+	premul_to_straight_v4_v4(color, color);
+}
+
+MINLINE void straight_to_premul_v4_v4(float premul[4], const float straight[4])
 {
 	float alpha = straight[3];
 	premul[0] = straight[0] * alpha;
@@ -296,6 +302,11 @@ MINLINE void straight_to_premul_v4(float premul[4], const float straight[4])
 	premul[3] = straight[3];
 }
 
+MINLINE void straight_to_premul_v4(float color[4])
+{
+	straight_to_premul_v4_v4(color, color);
+}
+
 MINLINE void straight_uchar_to_premul_float(float result[4], const unsigned char color[4])
 {
 	float alpha = color[3] / 255.0f;
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index fc1d0e9..baca7bb 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -39,9 +39,9 @@
 
 void cent_tri_v3(float cent[3], const float v1[3], const float v2[3], const float v3[3])
 {
-	cent[0] = 0.33333f * (v1[0] + v2[0] + v3[0]);
-	cent[1] = 0.33333f * (v1[1] + v2[1] + v3[1]);
-	cent[2] = 0.33333f * (v1[2] + v2[2] + v3[2]);
+	cent[0] = (v1[0] + v2[0] + v3[0]) / 3.0f;
+	cent[1] = (v1[1] + v2[1] + v3[1]) / 3.0f;
+	cent[2] = (v1[2] + v2[2] + v3[2]) / 3.0f;
 }
 
 void cent_quad_v3(float cent[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
@@ -129,6 +129,22 @@ float area_tri_v3(const float v1[3], const float v2[3], const float v3[3])
 	return (len / 2.0f);
 }
 
+float area_tri_signed_v3(const float v1[3], const float v2[3], const float v3[3], const float normal[3])
+{
+	float area, vec1[3], vec2[3], n[3];
+
+	sub_v3_v3v3(vec1, v3, v2);
+	sub_v3_v3v3(vec2, v1, v2);
+	cross_v3_v3v3(n, vec1, vec2);
+	area = len_v3(n) / 2.0f;
+
+	/* negate area for flipped triangles */
+	if (dot_v3v3(n, normal) < 0.0f)
+		area = -area;
+
+	return area;
+}
+
 float area_poly_v3(int nr, float verts[][3], const float normal[3])
 {
 	int a, px, py;
@@ -304,6 +320,15 @@ float dist_to_line_segment_v3(const float v1[3], const float v2[3], const float
 	return len_v3v3(closest, v1);
 }
 
+float dist_to_line_v3(const float v1[3], const float v2[3], const float v3[3])
+{
+	float closest[3];
+
+	closest_to_line_v3(closest, v1, v2, v3);
+
+	return len_v3v3(closest, v1);
+}
+
 /* Adapted from "Real-Time Collision Detection" by Christer Ericson,
  * published by Morgan Kaufmann Publishers, copyright 2005 Elsevier Inc.
  * 
@@ -1957,7 +1982,45 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int,
 	}
 }
 
-/****************************** Interpolation ********************************/
+/****************************** Axis Utils ********************************/
+
+/**
+ * \brief Normal to x,y matrix
+ *
+ * Creates a 3x3 matrix from a normal.
+ * This matrix can be applied to vectors so their 'z' axis runs along \a normal.
+ * In practice it means you can use x,y as 2d coords. \see
+ *
+ * \param r_mat The matrix to return.
+ * \param normal A unit length vector.
+ */
+bool axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3])
+{
+	float up[3] = {0.0f, 0.0f, 1.0f};
+	float axis[3];
+	float angle;
+
+	/* double check they are normalized */
+	BLI_ASSERT_UNIT_V3(normal);
+
+	cross_v3_v3v3(axis, normal, up);
+	angle = saacos(dot_v3v3(normal, up));
+
+	if (angle >= FLT_EPSILON) {
+		if (len_squared_v3(axis) < FLT_EPSILON) {
+			axis[0] = 0.0f;
+			axis[1] = 1.0f;
+			axis[2] = 0.0f;
+		}
+
+		axis_angle_to_mat3(r_mat, axis, angle);
+		return true;
+	}
+	else {
+		unit_m3(r_mat);
+		return false;
+	}
+}
 
 /* get the 2 dominant axis values, 0==X, 1==Y, 2==Z */
 void axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float axis[3])
@@ -1983,6 +2046,9 @@ float axis_dominant_v3_max(int *r_axis_a, int *r_axis_b, const float axis[3])
 	else                           { *r_axis_a = 1; *r_axis_b = 2; return xn; }
 }
 
+
+/****************************** Interpolation ********************************/
+
 static float tri_signed_area(const float v1[3], const float v2[3], const float v3[3], const int i, const int j)
 {
 	return 0.5f * ((v1[i] - v2[i]) * (v2[j] - v3[j]) + (v1[j] - v2[j]) * (v3[i] - v2[i]));
@@ -2378,7 +2444,7 @@ void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[
 		t2 = mean_value_half_tan_v3(co, vmid, vnext);
 
 		len = len_v3v3(co, vmid);
-		w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f;
+		w[i] = (len != 0.0f) ? (t1 + t2) / len: 0.0f;
 		totweight += w[i];
 	}
 
@@ -2430,7 +2496,7 @@ void interp_weights_poly_v2(float *w, float v[][2], const int n, const float co[
 		t2 = mean_value_half_tan_v2(co, vmid, vnext);
 
 		len = len_v2v2(co, vmid);
-		w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f;
+		w[i] = (len != 0.0f) ? (t1 + t2) / len: 0.0f;
 		totweight += w[i];
 	}
 
@@ -3525,44 +3591,57 @@ float form_factor_hemi_poly(float p[3], float n[3], float v1[3], float v2[3], fl
 /* evaluate if entire quad is a proper convex quad */
 int is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
 {
-	float nor[3], nor1[3], nor2[3], vec[4][2];
-	int axis_a, axis_b;
+	float nor[3], nor_a[3], nor_b[3], vec[4][2];
+	float mat[3][3];
+	const bool is_ok_a = (normal_tri_v3(nor_a, v1, v2, v3) > FLT_EPSILON);
+	const bool is_ok_b = (normal_tri_v3(nor_b, v1, v3, v4) > FLT_EPSILON);
 
 	/* define projection, do both trias apart, quad is undefined! */
 
-	normal_tri_v3(nor1, v1, v2, v3);
-	normal_tri_v3(nor2, v1, v3, v4);
+	/* check normal length incase one size is zero area */
+	if (is_ok_a) {
+		if (is_ok_b) {
+			/* use both, most common outcome */
+
+			/* when the face is folded over as 2 tris we probably don't want to create
+			 * a quad from it, but go ahead with the intersection test since this
+			 * isn't a function for degenerate faces */
+			if (UNLIKELY(dot_v3v3(nor_a, nor_b) < 0.0f)) {
+				/* flip so adding normals in the opposite direction
+				 * doesn't give a zero length vector */
+				negate_v3(nor_b);
+			}
 
-	/* when the face is folded over as 2 tris we probably don't want to create
-	 * a quad from it, but go ahead with the intersection test since this
-	 * isn't a function for degenerate faces */
-	if (UNLIKELY(dot_v3v3(nor1, nor2) < 0.0f)) {
-		/* flip so adding normals in the opposite direction
-		 * doesnt give a zero length vector */
-		negate_v3(nor2);
+			add_v3_v3v3(nor, nor_a, nor_b);
+			normalize_v3(nor);
+		}
+		else {
+			copy_v3_v3(nor, nor_a);  /* only 'a' */
+		}
+	}
+	else {
+		if (is_ok_b) {
+			copy_v3_v3(nor, nor_b);  /* only 'b' */
+		}
+		else {
+			return false;  /* both zero, we can't do anything useful here */
+		}
 	}
 
-	add_v3_v3v3(nor, nor1, nor2);
-
-	axis_dominant_v3(&axis_a, &axis_b, nor);
-
-	vec[0][0] = v1[axis_a];
-	vec[0][1] = v1[axis_b];
-	vec[1][0] = v2[axis_a];
-	vec[1][1] = v2[axis_b];
+	axis_dominant_v3_to_m3(mat, nor);
 
-	vec[2][0] = v3[axis_a];
-	vec[2][1] = v3[axis_b];
-	vec[3][0] = v4[axis_a];
-	vec[3][1] = v4[axis_b];
+	mul_v2_m3v3(vec[0], mat, v1);
+	mul_v2_m3v3(vec[1], mat, v2);
+	mul_v2_m3v3(vec[2], mat, v3);
+	mul_v2_m3v3(vec[3], mat, v4);
 
 	/* linetests, the 2 diagonals have to instersect to be convex */
-	return (isect_line_line_v2(vec[0], vec[2], vec[1], vec[3]) > 0) ? TRUE : FALSE;
+	return (isect_line_line_v2(vec[0], vec[2], vec[1], vec[3]) > 0);
 }
 
 int is_quad_convex_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
 {
 	/* linetests, the 2 diagonals have to instersect to be convex */
-	return (isect_line_line_v2(v1, v3, v2, v4) > 0) ? TRUE : FALSE;
+	return (isect_line_line_v2(v1, v3, v2, v4) > 0);
 }
 
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 6784c41..9d9e3e6 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -344,6 +344,15 @@ void mul_v3_m4v3(float in[3], float mat[4][4], const float vec[3])
 	in[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2] + mat[3][2];
 }
 
+void mul_v2_m2v2(float r[2], float mat[2][2], const float vec[2])
+{
+	float x;
+
+	x = vec[0];
+	r[0] = mat[0][0] * x + mat[1][0] * vec[1];
+	r[1] = mat[0][1] * x + mat[1][1] * vec[1];
+}
+
 /* same as mul_m4_v3() but doesnt apply translation component */
 void mul_mat3_m4_v3(float mat[4][4], float vec[3])
 {
@@ -366,7 +375,7 @@ void mul_project_m4_v3(float mat[4][4], float vec[3])
 	vec[2] /= w;
 }
 
-void mul_v4_m4v4(float r[4], float mat[4][4], float v[4])
+void mul_v4_m4v4(float r[4], float mat[4][4], const float v[4])
 {
 	float x, y, z;
 
@@ -404,13 +413,19 @@ void mul_m4_v4d(float mat[4][4], double r[4])
 	mul_v4d_m4v4d(r, mat, r);
 }
 
-void mul_v3_m3v3(float r[3], float M[3][3], float a[3])
+void mul_v3_m3v3(float r[3], float M[3][3], const float a[3])
 {
 	r[0] = M[0][0] * a[0] + M[1][0] * a[1] + M[2][0] * a[2];
 	r[1] = M[0][1] * a[0] + M[1][1] * a[1] + M[2][1] * a[2];
 	r[2] = M[0][2] * a[0] + M[1][2] * a[1] + M[2][2] * a[2];
 }
 
+void mul_v2_m3v3(float r[2], float M[3][3], const float a[3])
+{
+	r[0] = M[0][0] * a[0] + M[1][0] * a[1] + M[2][0] * a[2];
+	r[1] = M[0][1] * a[0] + M[1][1] * a[1] + M[2][1] * a[2];
+}
+
 void mul_m3_v3(float M[3][3], float r[3])
 {
 	float tmp[3];
@@ -980,14 +995,8 @@ void normalize_m4(float mat[4][4])
 
 void normalize_m4_m4(float rmat[4][4], float mat[4][4])
 {
-	float len;
-
-	len = normalize_v3_v3(rmat[0], mat[0]);
-	if (len != 0.0f) rmat[0][3] = mat[0][3] / len;
-	len = normalize_v3_v3(rmat[1], mat[1]);
-	if (len != 0.0f) rmat[1][3] = mat[1][3] / len;
-	len = normalize_v3_v3(rmat[2], mat[2]);
-	if (len != 0.0f) rmat[2][3] = mat[2][3] / len;
+	copy_m4_m4(rmat, mat);
+	normalize_m4(rmat);
 }
 
 void adjoint_m2_m2(float m1[2][2], float m[2][2])
@@ -1212,6 +1221,33 @@ void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wm
 	copy_v3_v3(loc, wmat[3]);
 }
 
+void mat4_to_loc_quat(float loc[3], float quat[4], float wmat[4][4])
+{
+	float mat3[3][3];
+	float mat3_n[3][3]; /* normalized mat3 */
+
+	copy_m3_m4(mat3, wmat);
+	normalize_m3_m3(mat3_n, mat3);
+
+	/* so scale doesn't interfere with rotation [#24291] */
+	/* note: this is a workaround for negative matrix not working for rotation conversion, FIXME */
+	if (is_negative_m3(mat3)) {
+		negate_v3(mat3_n[0]);
+		negate_v3(mat3_n[1]);
+		negate_v3(mat3_n[2]);
+	}
+
+	mat3_to_quat(quat, mat3_n);
+	copy_v3_v3(loc, wmat[3]);
+}
+
+void mat4_decompose(float loc[3], float quat[4], float size[3], float wmat[4][4])
+{
+	float rot[3][3];
+	mat4_to_loc_rot_size(loc, rot, size, wmat);
+	mat3_to_quat(quat, rot);
+}
+
 void scale_m3_fl(float m[3][3], float scale)
 {
 	m[0][0] = m[1][1] = m[2][2] = scale;
@@ -1277,6 +1313,13 @@ void rotate_m4(float mat[4][4], const char axis, const float angle)
 	}
 }
 
+void rotate_m2(float mat[2][2], const float angle)
+{
+	mat[0][0] = mat[1][1] = cosf(angle);
+	mat[0][1] = sinf(angle);
+	mat[1][0] = -mat[0][1];
+}
+
 void blend_m3_m3m3(float out[3][3], float dst[3][3], float src[3][3], const float srcweight)
 {
 	float srot[3][3], drot[3][3];
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index dc54bf9..26576b2 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -84,6 +84,8 @@ void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4])
  * \note:
  * Assumes a unit quaternion?
  *
+ * \note: multiplying by 3x3 matrix is ~25% faster.
+ *
  * in fact not, but you may want to use a unit quat, read on...
  *
  * Shortcut for 'q v q*' when \a v is actually a quaternion.
@@ -1660,7 +1662,7 @@ void quat_apply_track(float quat[4], short axis, short upflag)
 		axis = axis - 3;
 
 	/* there are 2 possible up-axis for each axis used, the 'quat_track' applies so the first
-	 * up axis is used X->Y, Y->X, Z->X, if this first up axis isn used then rotate 90d
+	 * up axis is used X->Y, Y->X, Z->X, if this first up axis isn't used then rotate 90d
 	 * the strange bit shift below just find the low axis {X:Y, Y:X, Z:X} */
 	if (upflag != (2 - axis) >> 1) {
 		float q[4] = {M_SQRT1_2, 0.0, 0.0, 0.0}; /* assign 90d rotation axis */
@@ -1737,3 +1739,158 @@ float angle_wrap_deg(float angle)
 {
 	return mod_inline(angle + 180.0f, 360.0f) - 180.0f;
 }
+
+/* returns an angle compatible with angle_compat */
+float angle_compat_rad(float angle, float angle_compat)
+{
+	return angle + (floorf(((angle_compat - angle) / (float)M_PI) + 0.5f)) * (float)M_PI;
+}
+
+/* axis conversion */
+static float _axis_convert_matrix[23][3][3] = {
+	{{-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, 1.0}},
+	{{-1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, {0.0, -1.0, 0.0}},
+	{{-1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}, {0.0, 1.0, 0.0}},
+	{{-1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}},
+	{{0.0, -1.0, 0.0}, {-1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
+	{{0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
+	{{0.0, 0.0, -1.0}, {-1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}},
+	{{0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}},
+	{{0.0, -1.0, 0.0}, {0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}},
+	{{0.0, 0.0, -1.0}, {0.0, -1.0, 0.0}, {-1.0, 0.0, 0.0}},
+	{{0.0, 0.0, 1.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}},
+	{{0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, {-1.0, 0.0, 0.0}},
+	{{0.0, -1.0, 0.0}, {0.0, 0.0, -1.0}, {1.0, 0.0, 0.0}},
+	{{0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, {1.0, 0.0, 0.0}},
+	{{0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}, {1.0, 0.0, 0.0}},
+	{{0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {1.0, 0.0, 0.0}},
+	{{0.0, -1.0, 0.0}, {1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}},
+	{{0.0, 0.0, -1.0}, {1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
+	{{0.0, 0.0, 1.0}, {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}},
+	{{0.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
+	{{1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, -1.0}},
+	{{1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}},
+	{{1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}},
+};
+
+static int _axis_convert_lut[23][24] = {
+	{0x8C8, 0x4D0, 0x2E0, 0xAE8, 0x701, 0x511, 0x119, 0xB29, 0x682, 0x88A,
+	 0x09A, 0x2A2, 0x80B, 0x413, 0x223, 0xA2B, 0x644, 0x454, 0x05C, 0xA6C,
+	 0x745, 0x94D, 0x15D, 0x365},
+	{0xAC8, 0x8D0, 0x4E0, 0x2E8, 0x741, 0x951, 0x159, 0x369, 0x702, 0xB0A,
+	 0x11A, 0x522, 0xA0B, 0x813, 0x423, 0x22B, 0x684, 0x894, 0x09C, 0x2AC,
+	 0x645, 0xA4D, 0x05D, 0x465},
+	{0x4C8, 0x2D0, 0xAE0, 0x8E8, 0x681, 0x291, 0x099, 0x8A9, 0x642, 0x44A,
+	 0x05A, 0xA62, 0x40B, 0x213, 0xA23, 0x82B, 0x744, 0x354, 0x15C, 0x96C,
+	 0x705, 0x50D, 0x11D, 0xB25},
+	{0x2C8, 0xAD0, 0x8E0, 0x4E8, 0x641, 0xA51, 0x059, 0x469, 0x742, 0x34A,
+	 0x15A, 0x962, 0x20B, 0xA13, 0x823, 0x42B, 0x704, 0xB14, 0x11C, 0x52C,
+	 0x685, 0x28D, 0x09D, 0x8A5},
+	{0x708, 0xB10, 0x120, 0x528, 0x8C1, 0xAD1, 0x2D9, 0x4E9, 0x942, 0x74A,
+	 0x35A, 0x162, 0x64B, 0xA53, 0x063, 0x46B, 0x804, 0xA14, 0x21C, 0x42C,
+	 0x885, 0x68D, 0x29D, 0x0A5},
+	{0xB08, 0x110, 0x520, 0x728, 0x941, 0x151, 0x359, 0x769, 0x802, 0xA0A,
+	 0x21A, 0x422, 0xA4B, 0x053, 0x463, 0x66B, 0x884, 0x094, 0x29C, 0x6AC,
+	 0x8C5, 0xACD, 0x2DD, 0x4E5},
+	{0x508, 0x710, 0xB20, 0x128, 0x881, 0x691, 0x299, 0x0A9, 0x8C2, 0x4CA,
+	 0x2DA, 0xAE2, 0x44B, 0x653, 0xA63, 0x06B, 0x944, 0x754, 0x35C, 0x16C,
+	 0x805, 0x40D, 0x21D, 0xA25},
+	{0x108, 0x510, 0x720, 0xB28, 0x801, 0x411, 0x219, 0xA29, 0x882, 0x08A,
+	 0x29A, 0x6A2, 0x04B, 0x453, 0x663, 0xA6B, 0x8C4, 0x4D4, 0x2DC, 0xAEC,
+	 0x945, 0x14D, 0x35D, 0x765},
+	{0x748, 0x350, 0x160, 0x968, 0xAC1, 0x2D1, 0x4D9, 0x8E9, 0xA42, 0x64A,
+	 0x45A, 0x062, 0x68B, 0x293, 0x0A3, 0x8AB, 0xA04, 0x214, 0x41C, 0x82C,
+	 0xB05, 0x70D, 0x51D, 0x125},
+	{0x948, 0x750, 0x360, 0x168, 0xB01, 0x711, 0x519, 0x129, 0xAC2, 0x8CA,
+	 0x4DA, 0x2E2, 0x88B, 0x693, 0x2A3, 0x0AB, 0xA44, 0x654, 0x45C, 0x06C,
+	 0xA05, 0x80D, 0x41D, 0x225},
+	{0x348, 0x150, 0x960, 0x768, 0xA41, 0x051, 0x459, 0x669, 0xA02, 0x20A,
+	 0x41A, 0x822, 0x28B, 0x093, 0x8A3, 0x6AB, 0xB04, 0x114, 0x51C, 0x72C,
+	 0xAC5, 0x2CD, 0x4DD, 0x8E5},
+	{0x148, 0x950, 0x760, 0x368, 0xA01, 0x811, 0x419, 0x229, 0xB02, 0x10A,
+	 0x51A, 0x722, 0x08B, 0x893, 0x6A3, 0x2AB, 0xAC4, 0x8D4, 0x4DC, 0x2EC,
+	 0xA45, 0x04D, 0x45D, 0x665},
+	{0x688, 0x890, 0x0A0, 0x2A8, 0x4C1, 0x8D1, 0xAD9, 0x2E9, 0x502, 0x70A,
+	 0xB1A, 0x122, 0x74B, 0x953, 0x163, 0x36B, 0x404, 0x814, 0xA1C, 0x22C,
+	 0x445, 0x64D, 0xA5D, 0x065},
+	{0x888, 0x090, 0x2A0, 0x6A8, 0x501, 0x111, 0xB19, 0x729, 0x402, 0x80A,
+	 0xA1A, 0x222, 0x94B, 0x153, 0x363, 0x76B, 0x444, 0x054, 0xA5C, 0x66C,
+	 0x4C5, 0x8CD, 0xADD, 0x2E5},
+	{0x288, 0x690, 0x8A0, 0x0A8, 0x441, 0x651, 0xA59, 0x069, 0x4C2, 0x2CA,
+	 0xADA, 0x8E2, 0x34B, 0x753, 0x963, 0x16B, 0x504, 0x714, 0xB1C, 0x12C,
+	 0x405, 0x20D, 0xA1D, 0x825},
+	{0x088, 0x290, 0x6A0, 0x8A8, 0x401, 0x211, 0xA19, 0x829, 0x442, 0x04A,
+	 0xA5A, 0x662, 0x14B, 0x353, 0x763, 0x96B, 0x4C4, 0x2D4, 0xADC, 0x8EC,
+	 0x505, 0x10D, 0xB1D, 0x725},
+	{0x648, 0x450, 0x060, 0xA68, 0x2C1, 0x4D1, 0x8D9, 0xAE9, 0x282, 0x68A,
+	 0x89A, 0x0A2, 0x70B, 0x513, 0x123, 0xB2B, 0x204, 0x414, 0x81C, 0xA2C,
+	 0x345, 0x74D, 0x95D, 0x165},
+	{0xA48, 0x650, 0x460, 0x068, 0x341, 0x751, 0x959, 0x169, 0x2C2, 0xACA,
+	 0x8DA, 0x4E2, 0xB0B, 0x713, 0x523, 0x12B, 0x284, 0x694, 0x89C, 0x0AC,
+	 0x205, 0xA0D, 0x81D, 0x425},
+	{0x448, 0x050, 0xA60, 0x668, 0x281, 0x091, 0x899, 0x6A9, 0x202, 0x40A,
+	 0x81A, 0xA22, 0x50B, 0x113, 0xB23, 0x72B, 0x344, 0x154, 0x95C, 0x76C,
+	 0x2C5, 0x4CD, 0x8DD, 0xAE5},
+	{0x048, 0xA50, 0x660, 0x468, 0x201, 0xA11, 0x819, 0x429, 0x342, 0x14A,
+	 0x95A, 0x762, 0x10B, 0xB13, 0x723, 0x52B, 0x2C4, 0xAD4, 0x8DC, 0x4EC,
+	 0x285, 0x08D, 0x89D, 0x6A5},
+	{0x808, 0xA10, 0x220, 0x428, 0x101, 0xB11, 0x719, 0x529, 0x142, 0x94A,
+	 0x75A, 0x362, 0x8CB, 0xAD3, 0x2E3, 0x4EB, 0x044, 0xA54, 0x65C, 0x46C,
+	 0x085, 0x88D, 0x69D, 0x2A5},
+	{0xA08, 0x210, 0x420, 0x828, 0x141, 0x351, 0x759, 0x969, 0x042, 0xA4A,
+	 0x65A, 0x462, 0xACB, 0x2D3, 0x4E3, 0x8EB, 0x084, 0x294, 0x69C, 0x8AC,
+	 0x105, 0xB0D, 0x71D, 0x525},
+	{0x408, 0x810, 0xA20, 0x228, 0x081, 0x891, 0x699, 0x2A9, 0x102, 0x50A,
+	 0x71A, 0xB22, 0x4CB, 0x8D3, 0xAE3, 0x2EB, 0x144, 0x954, 0x75C, 0x36C,
+	 0x045, 0x44D, 0x65D, 0xA65},
+	};
+
+// _axis_convert_num = {'X': 0, 'Y': 1, 'Z': 2, '-X': 3, '-Y': 4, '-Z': 5}
+
+MINLINE int _axis_signed(const int axis)
+{
+	return (axis < 3) ? axis : axis - 3;
+}
+
+/*
+ * Each argument us an axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z']
+ * where the first 2 are a source and the second 2 are the target.
+ */
+int mat3_from_axis_conversion(int from_forward, int from_up, int to_forward, int to_up,
+                              float r_mat[3][3])
+{
+	// from functools import reduce
+	int value;
+	int i;
+
+	if (from_forward == to_forward && from_up == to_up) {
+		unit_m3(r_mat);
+		return false;
+	}
+
+	if ((_axis_signed(from_forward) == _axis_signed(from_up)) ||
+	    (_axis_signed(to_forward)   == _axis_signed(to_up)))
+	{
+		/* we could assert here! */
+		unit_m3(r_mat);
+		return false;
+	}
+
+	value = ((from_forward << (0 * 3)) |
+	         (from_up      << (1 * 3)) |
+	         (to_forward   << (2 * 3)) |
+	         (to_up        << (3 * 3)));
+
+	for (i = 0; i < (sizeof(_axis_convert_matrix) / sizeof(*_axis_convert_matrix)); i++) {
+		int j;
+		for (j = 0; j < sizeof(*_axis_convert_lut) / sizeof(*_axis_convert_lut[0]); j++) {
+			if (_axis_convert_lut[i][j] == value) {
+				copy_m3_m3(r_mat, _axis_convert_matrix[i]);
+				return true;
+			}
+		}
+
+	}
+//	BLI_assert(0);
+	return false;
+}
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 812e2b3..58d444f 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -122,6 +122,32 @@ void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float
 	v[2] = (v1[2] + v2[2] + v3[2]) / 3.0f;
 }
 
+/**
+ * Equivalent to:
+ * interp_v3_v3v3(v, v1, v2, -1.0f);
+ */
+
+void flip_v4_v4v4(float v[4], const float v1[4], const float v2[4])
+{
+	v[0] = v1[0] + (v1[0] - v2[0]);
+	v[1] = v1[1] + (v1[1] - v2[1]);
+	v[2] = v1[2] + (v1[2] - v2[2]);
+	v[3] = v1[3] + (v1[3] - v2[3]);
+}
+
+void flip_v3_v3v3(float v[3], const float v1[3], const float v2[3])
+{
+	v[0] = v1[0] + (v1[0] - v2[0]);
+	v[1] = v1[1] + (v1[1] - v2[1]);
+	v[2] = v1[2] + (v1[2] - v2[2]);
+}
+
+void flip_v2_v2v2(float v[2], const float v1[2], const float v2[2])
+{
+	v[0] = v1[0] + (v1[0] - v2[0]);
+	v[1] = v1[1] + (v1[1] - v2[1]);
+}
+
 /********************************** Angles ***********************************/
 
 /* Return the angle in radians between vecs 1-2 and 2-3 in radians
@@ -209,11 +235,8 @@ float angle_signed_v2v2(const float v1[2], const float v2[2])
 float angle_normalized_v3v3(const float v1[3], const float v2[3])
 {
 	/* double check they are normalized */
-#ifdef DEBUG
-	float test;
-	BLI_assert(fabsf((test = len_squared_v3(v1)) - 1.0f) < 0.0001f || fabsf(test) < 0.0001f);
-	BLI_assert(fabsf((test = len_squared_v3(v2)) - 1.0f) < 0.0001f || fabsf(test) < 0.0001f);
-#endif
+	BLI_ASSERT_UNIT_V3(v1);
+	BLI_ASSERT_UNIT_V3(v2);
 
 	/* this is the same as acos(dot_v3v3(v1, v2)), but more accurate */
 	if (dot_v3v3(v1, v2) < 0.0f) {
@@ -232,11 +255,8 @@ float angle_normalized_v3v3(const float v1[3], const float v2[3])
 float angle_normalized_v2v2(const float v1[2], const float v2[2])
 {
 	/* double check they are normalized */
-#ifdef DEBUG
-	float test;
-	BLI_assert(fabsf((test = len_squared_v2(v1)) - 1.0f) < 0.0001f || fabsf(test) < 0.0001f);
-	BLI_assert(fabsf((test = len_squared_v2(v2)) - 1.0f) < 0.0001f || fabsf(test) < 0.0001f);
-#endif
+	BLI_ASSERT_UNIT_V2(v1);
+	BLI_ASSERT_UNIT_V2(v2);
 
 	/* this is the same as acos(dot_v3v3(v1, v2)), but more accurate */
 	if (dot_v2v2(v1, v2) < 0.0f) {
@@ -423,10 +443,7 @@ void rotate_normalized_v3_v3v3fl(float r[3], const float p[3], const float axis[
 	const float sintheta = sin(angle);
 
 	/* double check they are normalized */
-#ifdef DEBUG
-	float test;
-	BLI_assert(fabsf((test = len_squared_v3(axis)) - 1.0f) < 0.0001f || fabsf(test) < 0.0001f);
-#endif
+	BLI_ASSERT_UNIT_V3(axis);
 
 	r[0] = ((costheta + (1 - costheta) * axis[0] * axis[0]) * p[0]) +
 	       (((1 - costheta) * axis[0] * axis[1] - axis[2] * sintheta) * p[1]) +
@@ -685,6 +702,19 @@ void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array
 	}
 }
 
+void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size)
+{
+	const float s = 1.0f - t;
+	float *tar = array_tar + (size - 1);
+	const float *src = array_src + (size - 1);
+	int i = size;
+	while (i--) {
+		*(tar) = (s * *(tar)) + (t * *(src));
+		tar--;
+		src--;
+	}
+}
+
 void fill_vn_i(int *array_tar, const int size, const int val)
 {
 	int *tar = array_tar + (size - 1);
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 8c62fdf..48e7de4 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -528,6 +528,7 @@ MINLINE float cross_v2v2(const float a[2], const float b[2])
 
 MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
 {
+	BLI_assert(r != a && r != b);
 	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];
@@ -662,7 +663,7 @@ MINLINE float normalize_v3_v3(float r[3], const float a[3])
 	float d = dot_v3v3(a, a);
 
 	/* a larger value causes normalize errors in a
-	 * scaled down models with camera xtreme close */
+	 * scaled down models with camera extreme close */
 	if (d > 1.0e-35f) {
 		d = sqrtf(d);
 		mul_v3_v3fl(r, a, 1.0f / d);
@@ -680,7 +681,7 @@ MINLINE double normalize_v3_d(double n[3])
 	double 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 */
+	 * scaled down models with camera extreme close */
 	if (d > 1.0e-35) {
 		double mul;
 
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index f37e1e0..c159f70 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -1460,7 +1460,8 @@ float BLI_gNoise(float noisesize, float x, float y, float z, int hard, int noise
 			noisefunc = cellNoiseU;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc = orgBlenderNoise;
 			/* add one to make return value same as BLI_hnoise */
 			x += 1;
@@ -1592,7 +1593,8 @@ float mg_fBm(float x, float y, float z, float H, float lacunarity, float octaves
 			noisefunc = cellNoise;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc = orgBlenderNoiseS;
 		}
 	}
@@ -1662,7 +1664,8 @@ float mg_MultiFractal(float x, float y, float z, float H, float lacunarity, floa
 			noisefunc = cellNoise;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc = orgBlenderNoiseS;
 		}
 	}
@@ -1728,7 +1731,8 @@ float mg_HeteroTerrain(float x, float y, float z, float H, float lacunarity, flo
 			noisefunc = cellNoise;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc = orgBlenderNoiseS;
 		}
 	}
@@ -1801,7 +1805,8 @@ float mg_HybridMultiFractal(float x, float y, float z, float H, float lacunarity
 			noisefunc = cellNoise;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc = orgBlenderNoiseS;
 		}
 	}
@@ -1876,7 +1881,8 @@ float mg_RidgedMultiFractal(float x, float y, float z, float H, float lacunarity
 			noisefunc = cellNoise;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc = orgBlenderNoiseS;
 		}
 	}
@@ -1941,7 +1947,8 @@ float mg_VLNoise(float x, float y, float z, float distortion, int nbas1, int nba
 			noisefunc1 = cellNoise;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc1 = orgBlenderNoiseS;
 		}
 	}
@@ -1975,7 +1982,8 @@ float mg_VLNoise(float x, float y, float z, float distortion, int nbas1, int nba
 			noisefunc2 = cellNoise;
 			break;
 		case 0:
-		default: {
+		default:
+		{
 			noisefunc2 = orgBlenderNoiseS;
 		}
 	}
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 06b1f1f..5265d86 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -848,7 +848,7 @@ const char *BLI_getDefaultDocumentFolder(void)
 /* ************************************************************* */
 /* ************************************************************* */
 
-// #define PATH_DEBUG2
+// #define PATH_DEBUG
 
 static char *blender_version_decimal(const int ver)
 {
@@ -871,14 +871,14 @@ static int test_path(char *targetpath, const char *path_base, const char *path_s
 		BLI_strncpy(targetpath, tmppath, sizeof(tmppath));
 
 	if (BLI_is_dir(targetpath)) {
-#ifdef PATH_DEBUG2
-		printf("\tpath found: %s\n", targetpath);
+#ifdef PATH_DEBUG
+		printf("\t%s found: %s\n", __func__, targetpath);
 #endif
 		return 1;
 	}
 	else {
-#ifdef PATH_DEBUG2
-		printf("\tpath missing: %s\n", targetpath);
+#ifdef PATH_DEBUG
+		printf("\t%s missing: %s\n", __func__, targetpath);
 #endif
 		//targetpath[0] = '\0';
 		return 0;
@@ -892,10 +892,16 @@ static int test_env_path(char *path, const char *envvar)
 	
 	if (BLI_is_dir(env)) {
 		BLI_strncpy(path, env, FILE_MAX);
+#ifdef PATH_DEBUG
+		printf("\t%s env %s found: %s\n", __func__, envvar, env);
+#endif
 		return 1;
 	}
 	else {
 		path[0] = '\0';
+#ifdef PATH_DEBUG
+		printf("\t%s env %s missing: %s\n", __func__, envvar, env);
+#endif
 		return 0;
 	}
 }
@@ -904,8 +910,8 @@ static int get_path_local(char *targetpath, const char *folder_name, const char
 {
 	char relfolder[FILE_MAX];
 	
-#ifdef PATH_DEBUG2
-	printf("get_path_local...\n");
+#ifdef PATH_DEBUG
+	printf("%s...\n", __func__);
 #endif
 
 	if (folder_name) {
@@ -964,8 +970,8 @@ static int get_path_user(char *targetpath, const char *folder_name, const char *
 	if (!user_path[0])
 		return 0;
 	
-#ifdef PATH_DEBUG2
-	printf("get_path_user: %s\n", user_path);
+#ifdef PATH_DEBUG
+	printf("%s: %s\n", __func__, user_path);
 #endif
 	
 	if (subfolder_name) {
@@ -1034,8 +1040,8 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
 	if (!system_path[0])
 		return 0;
 	
-#ifdef PATH_DEBUG2
-	printf("get_path_system: %s\n", system_path);
+#ifdef PATH_DEBUG
+	printf("%s: %s\n", __func__, system_path);
 #endif
 	
 	if (subfolder_name) {
@@ -1174,7 +1180,7 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check)
 
 
 #ifdef PATH_DEBUG
-#undef PATH_DEBUG
+#  undef PATH_DEBUG
 #endif
 
 void BLI_setenv(const char *env, const char *val)
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index 771295b..298e371 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -325,7 +325,9 @@ static short addedgetoscanvert(ScanFillVertLink *sc, ScanFillEdge *eed)
 		fac1 = 1.0e10f * (eed->v2->xy[0] - x);
 
 	}
-	else fac1 = (x - eed->v2->xy[0]) / fac1;
+	else {
+		fac1 = (x - eed->v2->xy[0]) / fac1;
+	}
 
 	for (ed = sc->edge_first; ed; ed = ed->next) {
 
@@ -509,7 +511,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
 	ScanFillVert *eve, *v1, *v2, *v3;
 	ScanFillEdge *eed, *nexted, *ed1, *ed2, *ed3;
 	int a, b, verts, maxface, totface;
-	short nr, test, twoconnected = 0;
+	short nr, twoconnected = 0;
 
 	nr = pf->nr;
 
@@ -565,6 +567,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
 				verts++;
 				eve->f = 0;  /* flag for connectedges later on */
 				sc->vert = eve;
+				/* if (even->tmp.v == NULL) eve->tmp.u = verts; */ /* Note, debug print only will work for curve polyfill, union is in use for mesh */
 				sc++;
 			}
 		}
@@ -639,7 +642,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
 
 	sc = sf_ctx->_scdata;
 	for (a = 0; a < verts; a++) {
-		/* printf("VERTEX %d %x\n", a, sc->v1); */
+		/* printf("VERTEX %d index %d\n", a, sc->vert->tmp.u); */
 		ed1 = sc->edge_first;
 		while (ed1) {   /* set connectflags  */
 			nexted = ed1->next;
@@ -649,7 +652,9 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
 				if (ed1->v1->h > 1) ed1->v1->h--;
 				if (ed1->v2->h > 1) ed1->v2->h--;
 			}
-			else ed1->v2->f = SF_VERT_UNKNOWN;
+			else {
+				ed1->v2->f = SF_VERT_UNKNOWN;
+			}
 
 			ed1 = nexted;
 		}
@@ -674,39 +679,67 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
 			}
 			else {
 				/* test rest of vertices */
+				ScanFillVertLink *best_sc = NULL;
+				float best_angle = 3.14f;
 				float miny;
+				bool firsttime = false;
+				
 				v1 = ed1->v2;
 				v2 = ed1->v1;
 				v3 = ed2->v2;
+				
 				/* this happens with a serial of overlapping edges */
 				if (v1 == v2 || v2 == v3) break;
-				/* printf("test verts %x %x %x\n", v1, v2, v3); */
+				
+				/* printf("test verts %d %d %d\n", v1->tmp.u, v2->tmp.u, v3->tmp.u); */
 				miny = min_ff(v1->xy[1], v3->xy[1]);
-				/*  miny = min_ff(v1->xy[1], v3->xy[1]); */
 				sc1 = sc + 1;
-				test = 0;
 
-				for (b = a + 1; b < verts; b++) {
+				for (b = a + 1; b < verts; b++, sc1++) {
 					if (sc1->vert->f == 0) {
 						if (sc1->vert->xy[1] <= miny) break;
 						if (testedgeside(v1->xy, v2->xy, sc1->vert->xy)) {
 							if (testedgeside(v2->xy, v3->xy, sc1->vert->xy)) {
 								if (testedgeside(v3->xy, v1->xy, sc1->vert->xy)) {
-									/* point in triangle */
-
-									test = 1;
-									break;
+									/* point is in triangle */
+									
+									/* because multiple points can be inside triangle (concave holes) */
+									/* we continue searching and pick the one with sharpest corner */
+									
+									if (best_sc == NULL) {
+										best_sc = sc1;
+										/* only need to continue checking with holes */
+										if ((flag & BLI_SCANFILL_CALC_HOLES) == 0) {
+											break;
+										}
+									}
+									else {
+										float angle;
+										
+										/* prevent angle calc for the simple cases only 1 vertex is found */
+										if (firsttime == false) {
+											best_angle = angle_v2v2v2(v2->co, v1->co, best_sc->vert->co);
+											firsttime = true;
+										}
+
+										angle = angle_v2v2v2(v2->co, v1->co, sc1->vert->co);
+										if (angle < best_angle) {
+											best_sc = sc1;
+											best_angle = angle;
+										}
+									}
+										
 								}
 							}
 						}
 					}
-					sc1++;
 				}
-				if (test) {
+					
+				if (best_sc) {
 					/* make new edge, and start over */
-					/* printf("add new edge %x %x and start again\n", v2, sc1->vert); */
+					/* printf("add new edge %d %d and start again\n", v2->tmp.u, best_sc->vert->tmp.u); */
 
-					ed3 = BLI_scanfill_edge_add(sf_ctx, v2, sc1->vert);
+					ed3 = BLI_scanfill_edge_add(sf_ctx, v2, best_sc->vert);
 					BLI_remlink(&sf_ctx->filledgebase, ed3);
 					BLI_insertlinkbefore((ListBase *)&(sc->edge_first), ed2, ed3);
 					ed3->v2->f = SF_VERT_UNKNOWN;
@@ -716,7 +749,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
 				}
 				else {
 					/* new triangle */
-					/* printf("add face %x %x %x\n", v1, v2, v3); */
+					/* printf("add face %d %d %d\n", v1->tmp.u, v2->tmp.u, v3->tmp.u); */
 					addfillface(sf_ctx, v1, v2, v3);
 					totface++;
 					BLI_remlink((ListBase *)&(sc->edge_first), ed1);
@@ -762,7 +795,6 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
 							ed3 = ed3->next;
 						}
 					}
-
 				}
 			}
 			/* test for loose edges */
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 28fdf7b..3500f3f 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -199,12 +199,15 @@ char *BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict
 	
 	/* get the starting point (i.e. where prefix starts, and add prefixLen+1 to it to get be after the first " */
 	startMatch = strstr(str, prefix) + prefixLen + 1;
-	
-	/* get the end point (i.e. where the next occurance of " is after the starting point) */
-	endMatch = strchr(startMatch, '"'); /* "  NOTE: this comment here is just so that my text editor still shows the functions ok... */
-
-	/* return the slice indicated */
-	return BLI_strdupn(startMatch, (size_t)(endMatch - startMatch));
+	if (startMatch) {
+		/* get the end point (i.e. where the next occurance of " is after the starting point) */
+		endMatch = strchr(startMatch, '"'); /* "  NOTE: this comment here is just so that my text editor still shows the functions ok... */
+		
+		if (endMatch)
+			/* return the slice indicated */
+			return BLI_strdupn(startMatch, (size_t)(endMatch - startMatch));
+	}
+	return BLI_strdupn("", 0);
 }
 
 /* Replaces all occurrences of oldText with newText in str, returning a new string that doesn't 
diff --git a/source/blender/blenlib/intern/string_cursor_utf8.c b/source/blender/blenlib/intern/string_cursor_utf8.c
index 65763f2..674d5ae 100644
--- a/source/blender/blenlib/intern/string_cursor_utf8.c
+++ b/source/blender/blenlib/intern/string_cursor_utf8.c
@@ -139,12 +139,17 @@ int BLI_str_cursor_step_prev_utf8(const char *str, size_t UNUSED(maxlen), int *p
 
 void BLI_str_cursor_step_utf8(const char *str, size_t maxlen,
                               int *pos, strCursorJumpDirection direction,
-                              strCursorJumpType jump)
+                              strCursorJumpType jump, bool use_init_step)
 {
 	const int pos_prev = *pos;
 
 	if (direction == STRCUR_DIR_NEXT) {
-		BLI_str_cursor_step_next_utf8(str, maxlen, pos);
+		if (use_init_step) {
+			BLI_str_cursor_step_next_utf8(str, maxlen, pos);
+		}
+		else {
+			BLI_assert(jump == STRCUR_JUMP_DELIM);
+		}
 
 		if (jump != STRCUR_JUMP_NONE) {
 			const strCursorDelimType delim_type = (*pos) < maxlen ? cursor_delim_type(&str[*pos]) : STRCUR_DELIM_NONE;
@@ -163,7 +168,12 @@ void BLI_str_cursor_step_utf8(const char *str, size_t maxlen,
 		}
 	}
 	else if (direction == STRCUR_DIR_PREV) {
-		BLI_str_cursor_step_prev_utf8(str, maxlen, pos);
+		if (use_init_step) {
+			BLI_str_cursor_step_prev_utf8(str, maxlen, pos);
+		}
+		else {
+			BLI_assert(jump == STRCUR_JUMP_DELIM);
+		}
 
 		if (jump != STRCUR_JUMP_NONE) {
 			const strCursorDelimType delim_type = (*pos) > 1 ? cursor_delim_type(&str[(*pos) - 1]) : STRCUR_DELIM_NONE;
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index bf98f2a..26235de 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -114,7 +114,7 @@ int BLI_utf8_invalid_byte(const char *str, int length)
 
 		/* Check for valid bytes after the 2nd, if any; all must start 10 */
 		while (--ab > 0) {
-			if ((*(p+1) & 0xc0) != 0x80) goto utf8_error;
+			if ((*(p + 1) & 0xc0) != 0x80) goto utf8_error;
 			p++; /* do this after so we get usable offset - campbell */
 		}
 	}
@@ -369,7 +369,7 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *__restrict dst_w, const char *__rest
 int BLI_str_utf8_size(const char *p)
 {
 	int mask = 0, len;
-	unsigned char c = (unsigned char) *p;
+	const unsigned char c = (unsigned char) *p;
 
 	UTF8_COMPUTE (c, mask, len, -1);
 
@@ -382,7 +382,7 @@ int BLI_str_utf8_size(const char *p)
 int BLI_str_utf8_size_safe(const char *p)
 {
 	int mask = 0, len;
-	unsigned char c = (unsigned char) *p;
+	const unsigned char c = (unsigned char) *p;
 
 	UTF8_COMPUTE (c, mask, len, 1);
 
@@ -408,10 +408,10 @@ unsigned int BLI_str_utf8_as_unicode(const char *p)
 {
 	int i, mask = 0, len;
 	unsigned int result;
-	unsigned char c = (unsigned char) *p;
+	const unsigned char c = (unsigned char) *p;
 
 	UTF8_COMPUTE (c, mask, len, -1);
-	if (len == -1)
+	if (UNLIKELY(len == -1))
 		return BLI_UTF8_ERR;
 	UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR);
 
@@ -423,16 +423,32 @@ unsigned int BLI_str_utf8_as_unicode_and_size(const char *__restrict p, size_t *
 {
 	int i, mask = 0, len;
 	unsigned int result;
-	unsigned char c = (unsigned char) *p;
+	const unsigned char c = (unsigned char) *p;
 
 	UTF8_COMPUTE (c, mask, len, -1);
-	if (len == -1)
+	if (UNLIKELY(len == -1))
 		return BLI_UTF8_ERR;
 	UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR);
 	*index += len;
 	return result;
 }
 
+unsigned int BLI_str_utf8_as_unicode_and_size_safe(const char *__restrict p, size_t *__restrict index)
+{
+	int i, mask = 0, len;
+	unsigned int result;
+	const unsigned char c = (unsigned char) *p;
+
+	UTF8_COMPUTE (c, mask, len, -1);
+	if (UNLIKELY(len == -1)) {
+		*index += 1;
+		return c;
+	}
+	UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR);
+	*index += len;
+	return result;
+}
+
 /* another variant that steps over the index,
  * note, currently this also falls back to latin1 for text drawing. */
 unsigned int BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__restrict index)
@@ -445,7 +461,7 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__re
 	c = (unsigned char) *p;
 
 	UTF8_COMPUTE (c, mask, len, -1);
-	if (len == -1) {
+	if (UNLIKELY(len == -1)) {
 		/* when called with NULL end, result will never be NULL,
 		 * checks for a NULL character */
 		char *p_next = BLI_str_find_next_char_utf8(p, NULL);
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 146e1d5..686484e 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -729,6 +729,9 @@ void BLI_thread_queue_wait_finish(ThreadQueue *queue)
 
 void BLI_begin_threaded_malloc(void)
 {
+	/* Used for debug only */
+	/* BLI_assert(thread_levels >= 0); */
+
 	if (thread_levels == 0) {
 		MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
 	}
@@ -737,6 +740,9 @@ void BLI_begin_threaded_malloc(void)
 
 void BLI_end_threaded_malloc(void)
 {
+	/* Used for debug only */
+	/* BLI_assert(thread_levels >= 0); */
+
 	thread_levels--;
 	if (thread_levels == 0)
 		MEM_set_lock_callback(NULL, NULL);
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index b2d37e3..5111baa 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -311,8 +311,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
 		/* makes lookup of existing video clips in old main */
 		blo_make_movieclip_pointer_map(fd, oldmain);
 		
-		/* makes lookup of existing video clips in old main */
-		blo_make_packed_pointer_map(fd, oldmain);
+		/* removed packed data from this trick - it's internal data that needs saves */
 		
 		bfd = blo_read_file_internal(fd, filename);
 		
@@ -321,10 +320,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
 		
 		/* ensures relinked movie clips are not freed */
 		blo_end_movieclip_pointer_map(fd, oldmain);
-		
-		/* ensures relinked packed data is not freed */
-		blo_end_packed_pointer_map(fd, oldmain);
-		
+				
 		/* move libraries from old main to new main */
 		if (bfd && mainlist.first != mainlist.last) {
 			
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 44499f1..4471e45 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -81,6 +81,7 @@
 #include "DNA_packedFile_types.h"
 #include "DNA_particle_types.h"
 #include "DNA_property_types.h"
+#include "DNA_rigidbody_types.h"
 #include "DNA_text_types.h"
 #include "DNA_view3d_types.h"
 #include "DNA_screen_types.h"
@@ -210,20 +211,6 @@
  * - initialize FileGlobal and copy pointers to Global
  */
 
-/* also occurs in library.c */
-/* GS reads the memory pointed at in a specific ordering. There are,
- * however two definitions for it. I have jotted them down here, both,
- * but I think the first one is actually used. The thing is that
- * big-endian systems might read this the wrong way round. OTOH, we
- * constructed the IDs that are read out with this macro explicitly as
- * well. I expect we'll sort it out soon... */
-
-/* from blendef: */
-#define GS(a)	(*((short *)(a)))
-
-/* from misc_util: flip the bytes from x  */
-/*  #define GS(x) (((unsigned char *)(x))[0] << 8 | ((unsigned char *)(x))[1]) */
-
 /***/
 
 typedef struct OldNew {
@@ -1439,6 +1426,8 @@ void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
 	}
 }
 
+/* XXX disabled this feature - packed files also belong in temp saves and quit.blend, to make restore work */
+
 static void insert_packedmap(FileData *fd, PackedFile *pf)
 {
 	oldnewmap_insert(fd->packedmap, pf, pf, 0);
@@ -1862,6 +1851,7 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p
 			if (prv->rect[i]) {
 				prv->rect[i] = newdataadr(fd, prv->rect[i]);
 			}
+			prv->gputexture[i] = NULL;
 		}
 	}
 	
@@ -2689,15 +2679,15 @@ static void direct_link_constraints(FileData *fd, ListBase *lb)
 				data->prop = newdataadr(fd, data->prop);
 				if (data->prop)
 					IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
-			}
 				break;
+			}
 			case CONSTRAINT_TYPE_SPLINEIK:
 			{
 				bSplineIKConstraint *data= con->data;
-				
+
 				data->points= newdataadr(fd, data->points);
-			}
 				break;
+			}
 			case CONSTRAINT_TYPE_KINEMATIC:
 			{
 				bKinematicConstraint *data = con->data;
@@ -2707,14 +2697,15 @@ static void direct_link_constraints(FileData *fd, ListBase *lb)
 
 				/* version patch for runtime flag, was not cleared in some case */
 				data->flag &= ~CONSTRAINT_IK_AUTO;
+				break;
 			}
 			case CONSTRAINT_TYPE_CHILDOF:
 			{
 				/* XXX version patch, in older code this flag wasn't always set, and is inherent to type */
 				if (con->ownspace == CONSTRAINT_SPACE_POSE)
 					con->flag |= CONSTRAINT_SPACEONCE;
-			}
 				break;
+			}
 		}
 	}
 }
@@ -2723,14 +2714,15 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
 {
 	bPoseChannel *pchan;
 	bArmature *arm = ob->data;
-	int rebuild;
+	int rebuild = 0;
 	
 	if (!pose || !arm)
 		return;
 	
-	
-	/* always rebuild to match proxy or lib changes */
-	rebuild = ob->proxy || (ob->id.lib==NULL && arm->id.lib);
+	/* always rebuild to match proxy or lib changes, but on Undo */
+	if (fd->memfile == NULL)
+		if (ob->proxy || (ob->id.lib==NULL && arm->id.lib))
+			rebuild = 1;
 	
 	if (ob->proxy) {
 		/* sync proxy layer */
@@ -4175,8 +4167,6 @@ static void lib_link_object(FileData *fd, Main *main)
 				else {
 					/* this triggers object_update to always use a copy */
 					ob->proxy->proxy_from = ob;
-					/* force proxy updates after load/undo, a bit weak */
-					ob->recalc = ob->proxy->recalc = (OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
 				}
 			}
 			ob->proxy_group = newlibadr(fd, ob->id.lib, ob->proxy_group);
@@ -4374,6 +4364,11 @@ static void lib_link_object(FileData *fd, Main *main)
 			
 			lib_link_particlesystems(fd, ob, &ob->id, &ob->particlesystem);
 			lib_link_modifiers(fd, ob);
+
+			if (ob->rigidbody_constraint) {
+				ob->rigidbody_constraint->ob1 = newlibadr(fd, ob->id.lib, ob->rigidbody_constraint->ob1);
+				ob->rigidbody_constraint->ob2 = newlibadr(fd, ob->id.lib, ob->rigidbody_constraint->ob2);
+			}
 		}
 	}
 	
@@ -4797,6 +4792,20 @@ static void direct_link_object(FileData *fd, Object *ob)
 	}
 	ob->bsoft = newdataadr(fd, ob->bsoft);
 	ob->fluidsimSettings= newdataadr(fd, ob->fluidsimSettings); /* NT */
+	
+	ob->rigidbody_object = newdataadr(fd, ob->rigidbody_object);
+	if (ob->rigidbody_object) {
+		RigidBodyOb *rbo = ob->rigidbody_object;
+		
+		/* must nullify the references to physics sim objects, since they no-longer exist 
+		 * (and will need to be recalculated) 
+		 */
+		rbo->physics_object = NULL;
+		rbo->physics_shape = NULL;
+	}
+	ob->rigidbody_constraint = newdataadr(fd, ob->rigidbody_constraint);
+	if (ob->rigidbody_constraint)
+		ob->rigidbody_constraint->physics_constraint = NULL;
 
 	link_list(fd, &ob->particlesystem);
 	direct_link_particlesystems(fd, &ob->particlesystem);
@@ -5015,6 +5024,18 @@ static void lib_link_scene(FileData *fd, Main *main)
 			BKE_sequencer_update_muting(sce->ed);
 			BKE_sequencer_update_sound_bounds_all(sce);
 			
+			
+			/* rigidbody world relies on it's linked groups */
+			if (sce->rigidbody_world) {
+				RigidBodyWorld *rbw = sce->rigidbody_world;
+				if (rbw->group)
+					rbw->group = newlibadr(fd, sce->id.lib, rbw->group);
+				if (rbw->constraints)
+					rbw->constraints = newlibadr(fd, sce->id.lib, rbw->constraints);
+				if (rbw->effector_weights)
+					rbw->effector_weights->group = newlibadr(fd, sce->id.lib, rbw->effector_weights->group);
+			}
+			
 			if (sce->nodetree) {
 				lib_link_ntree(fd, &sce->id, sce->nodetree);
 				composite_patch(sce->nodetree, sce);
@@ -5091,6 +5112,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
 	Editing *ed;
 	Sequence *seq;
 	MetaStack *ms;
+	RigidBodyWorld *rbw;
 	
 	sce->theDag = NULL;
 	sce->dagisvalid = 0;
@@ -5277,6 +5299,28 @@ static void direct_link_scene(FileData *fd, Scene *sce)
 	}
 
 	direct_link_view_settings(fd, &sce->view_settings);
+	
+	sce->rigidbody_world = newdataadr(fd, sce->rigidbody_world);
+	rbw = sce->rigidbody_world;
+	if (rbw) {
+		/* must nullify the reference to physics sim object, since it no-longer exist 
+		 * (and will need to be recalculated) 
+		 */
+		rbw->physics_world = NULL;
+		rbw->objects = NULL;
+		rbw->numbodies = 0;
+
+		/* set effector weights */
+		rbw->effector_weights = newdataadr(fd, rbw->effector_weights);
+		if (!rbw->effector_weights)
+			rbw->effector_weights = BKE_add_effector_weights(NULL);
+
+		/* link cache */
+		direct_link_pointcache_list(fd, &rbw->ptcaches, &rbw->pointcache, FALSE);
+		/* make sure simulation starts from the beginning after loading file */
+		if (rbw->pointcache)
+			rbw->ltime = rbw->pointcache->startframe;
+	}
 }
 
 /* ************ READ WM ***************** */
@@ -5544,7 +5588,14 @@ static void lib_link_screen(FileData *fd, Main *main)
 	}
 }
 
-/* Only for undo files, or to restore a screen after reading without UI... */
+/**
+ * Only for undo files, or to restore a screen after reading without UI...
+ *
+ * user
+ * - 0: no usercount change
+ * - 1: ensure a user
+ * - 2: ensure a real user (even if a fake one is set)
+ */
 static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
 {
 	if (id) {
@@ -5955,6 +6006,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
 		
 		sa->handlers.first = sa->handlers.last = NULL;
 		sa->type = NULL;	/* spacetype callbacks */
+		sa->region_active_win = -1;
 		
 		for (ar = sa->regionbase.first; ar; ar = ar->next)
 			direct_link_region(fd, ar, sa->spacetype);
@@ -6003,6 +6055,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
 				v3d->afterdraw_xray.first = v3d->afterdraw_xray.last = NULL;
 				v3d->afterdraw_xraytransp.first = v3d->afterdraw_xraytransp.last = NULL;
 				v3d->properties_storage = NULL;
+				v3d->defmaterial = NULL;
 				
 				/* render can be quite heavy, set to wire on load */
 				if (v3d->drawtype == OB_RENDER)
@@ -7289,6 +7342,17 @@ static void do_version_node_cleanup_dynamic_sockets_264(void *UNUSED(data), ID *
 	}
 }
 
+static void do_version_node_fix_translate_wrapping(void *UNUSED(data), ID *UNUSED(id), bNodeTree *ntree)
+{
+	bNode *node;
+
+	for (node = ntree->nodes.first; node; node = node->next) {
+		if (node->type == CMP_NODE_TRANSLATE && node->storage == NULL) {
+			node->storage = MEM_callocN(sizeof(NodeTranslateData), "node translate data");
+		}
+	}
+}
+
 static void do_version_node_fix_internal_links_264(void *UNUSED(data), ID *UNUSED(id), bNodeTree *ntree)
 {
 	bNode *node;
@@ -8580,36 +8644,109 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
 	if (main->versionfile < 265 || (main->versionfile == 265 && main->subversionfile < 5)) {
 		Scene *scene;
-		Image *image;
-		Tex *tex;
+		Image *image, *nimage;
+		Tex *tex, *otex;
 
 		for (scene = main->scene.first; scene; scene = scene->id.next) {
 			Sequence *seq;
+			bool set_premul = false;
 
 			SEQ_BEGIN (scene->ed, seq)
 			{
-				if (seq->flag & SEQ_MAKE_PREMUL)
+				if (seq->flag & SEQ_MAKE_PREMUL) {
 					seq->alpha_mode = SEQ_ALPHA_STRAIGHT;
+				}
+				else {
+					BKE_sequence_alpha_mode_from_extension(seq);
+				}
 			}
 			SEQ_END
 
 			if (scene->r.bake_samples == 0)
 			scene->r.bake_samples = 256;
+
+			if (scene->world) {
+				World *world = blo_do_versions_newlibadr(fd, scene->id.lib, scene->world);
+
+				if (world && is_zero_v3(&world->horr)) {
+					if ((world->skytype & WO_SKYBLEND) == 0 || is_zero_v3(&world->zenr)) {
+						set_premul = true;
+					}
+				}
+			}
+			else
+				set_premul = true;
+
+			if (set_premul) {
+				printf("2.66 versioning fix: replacing black sky with premultiplied alpha for scene %s\n", scene->id.name + 2);
+				scene->r.alphamode = R_ALPHAPREMUL;
+			}
 		}
 
 		for (image = main->image.first; image; image = image->id.next) {
-			if (image->flag & IMA_DO_PREMUL)
+			if (image->flag & IMA_DO_PREMUL) {
 				image->alpha_mode = IMA_ALPHA_STRAIGHT;
+			}
+			else {
+				BKE_image_alpha_mode_from_extension(image);
+			}
+
+			image->flag &= ~IMA_DONE_TAG;
 		}
 
+		/* use alpha flag moved from texture to image datablock */
 		for (tex = main->tex.first; tex; tex = tex->id.next) {
 			if (tex->type == TEX_IMAGE && (tex->imaflag & TEX_USEALPHA) == 0) {
 				image = blo_do_versions_newlibadr(fd, tex->id.lib, tex->ima);
 
-				if (image)
+				/* skip if no image or already tested */
+				if (!image || (image->flag & (IMA_DONE_TAG|IMA_IGNORE_ALPHA)))
+					continue;
+
+				image->flag |= IMA_DONE_TAG;
+
+				/* we might have some textures using alpha and others not, so we check if
+				 * they exist and duplicate the image datablock if necessary */
+				for (otex = main->tex.first; otex; otex = otex->id.next)
+					if (otex->type == TEX_IMAGE && (otex->imaflag & TEX_USEALPHA))
+						if (image == blo_do_versions_newlibadr(fd, otex->id.lib, otex->ima))
+							break;
+
+				if (otex) {
+					/* copy image datablock */
+					nimage = BKE_image_copy(main, image);
+					nimage->flag |= IMA_IGNORE_ALPHA|IMA_DONE_TAG;
+					nimage->id.us--;
+
+					/* we need to do some trickery to make file loading think
+					 * this new datablock is part of file we're loading */
+					blo_do_versions_oldnewmap_insert(fd->libmap, nimage, nimage, 0);
+					nimage->id.lib = image->id.lib;
+					nimage->id.flag |= (image->id.flag & LIB_NEED_LINK);
+
+					/* assign new image, and update the users counts accordingly */
+					for (otex = main->tex.first; otex; otex = otex->id.next) {
+						if (otex->type == TEX_IMAGE && (otex->imaflag & TEX_USEALPHA) == 0) {
+							if (image == blo_do_versions_newlibadr(fd, otex->id.lib, otex->ima)) {
+								if (!(otex->id.flag & LIB_NEED_LINK)) {
+									image->id.us--;
+									nimage->id.us++;
+								}
+								otex->ima = nimage;
+								break;
+							}
+						}
+					}
+				}
+				else {
+					/* no other textures using alpha, just set the flag */
 					image->flag |= IMA_IGNORE_ALPHA;
+				}
 			}
 		}
+
+		for (image = main->image.first; image; image = image->id.next)
+			image->flag &= ~IMA_DONE_TAG;
 	}
 
 	if (main->versionfile < 265 || (main->versionfile == 265 && main->subversionfile < 7)) {
@@ -8654,6 +8791,28 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 		}
 	}
 
+	if (!MAIN_VERSION_ATLEAST(main, 265, 9)) {
+		Brush *br;
+		for (br = main->brush.first; br; br = br->id.next) {
+			if (br->ob_mode & OB_MODE_TEXTURE_PAINT) {
+				br->mtex.brush_map_mode = MTEX_MAP_MODE_TILED;
+			}
+		}
+	}
+
+	// add storage for compositor translate nodes when not existing
+	if (!MAIN_VERSION_ATLEAST(main, 265, 10)) {
+		bNodeTreeType *ntreetype;
+		bNodeTree *ntree;
+
+		ntreetype = ntreeGetType(NTREE_COMPOSIT);
+		if (ntreetype && ntreetype->foreach_nodetree)
+			ntreetype->foreach_nodetree(main, NULL, do_version_node_fix_translate_wrapping);
+
+		for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+			do_version_node_fix_translate_wrapping(NULL, NULL, ntree);
+	}
+
 	// if (main->versionfile < 265 || (main->versionfile == 265 && main->subversionfile < 7)) {
 
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
@@ -8730,6 +8889,10 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
 	
 	bfd->user = user= read_struct(fd, bhead, "user def");
 	
+	/* User struct has separate do-version handling */
+	user->versionfile = bfd->main->versionfile;
+	user->subversionfile = bfd->main->subversionfile;
+	
 	/* read all data into fd->datamap */
 	bhead = read_data_into_oldnewmap(fd, bhead, "user def");
 	
@@ -8895,7 +9058,7 @@ static void sort_bhead_old_map(FileData *fd)
 	fd->tot_bheadmap = tot;
 	if (tot == 0) return;
 	
-	bhs = fd->bheadmap = MEM_mallocN(tot*sizeof(struct BHeadSort), STRINGIFY(BHeadSort));
+	bhs = fd->bheadmap = MEM_mallocN(tot * sizeof(struct BHeadSort), "BHeadSort");
 	
 	for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead), bhs++) {
 		bhs->bhead = bhead;
@@ -9629,7 +9792,12 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
 	
 	if (ob->pd && ob->pd->tex)
 		expand_doit(fd, mainvar, ob->pd->tex);
-	
+
+	if (ob->rigidbody_constraint) {
+		expand_doit(fd, mainvar, ob->rigidbody_constraint->ob1);
+		expand_doit(fd, mainvar, ob->rigidbody_constraint->ob2);
+	}
+
 }
 
 static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
@@ -9675,6 +9843,11 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
 		}
 		SEQ_END
 	}
+	
+	if (sce->rigidbody_world) {
+		expand_doit(fd, mainvar, sce->rigidbody_world->group);
+		expand_doit(fd, mainvar, sce->rigidbody_world->constraints);
+	}
 
 #ifdef DURIAN_CAMERA_SWITCH
 	{
@@ -9766,7 +9939,7 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
 		
 		a = set_listbasepointers(mainvar, lbarray);
 		while (a--) {
-			id= lbarray[a]->first;
+			id = lbarray[a]->first;
 			while (id) {
 				if (id->flag & LIB_NEED_EXPAND) {
 					switch (GS(id->name)) {
@@ -9909,7 +10082,7 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const
 				
 				if (do_it) {
 					base = MEM_callocN(sizeof(Base), "add_ext_base");
-					BLI_addtail(&(sce->base), base);
+					BLI_addtail(&sce->base, base);
 					base->lay = ob->lay;
 					base->object = ob;
 					base->flag = ob->flag;
@@ -9933,7 +10106,7 @@ static void give_base_to_groups(Main *mainvar, Scene *scene)
 			Base *base;
 			
 			/* BKE_object_add(...) messes with the selection */
-			Object *ob = BKE_object_add_only_object(OB_EMPTY, group->id.name+2);
+			Object *ob = BKE_object_add_only_object(mainvar, OB_EMPTY, group->id.name+2);
 			ob->type = OB_EMPTY;
 			ob->lay = scene->lay;
 			
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 6f5b0e9..e7a5367 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -118,6 +118,7 @@
 #include "DNA_packedFile_types.h"
 #include "DNA_particle_types.h"
 #include "DNA_property_types.h"
+#include "DNA_rigidbody_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_sdna_types.h"
 #include "DNA_sequence_types.h"
@@ -1487,6 +1488,14 @@ static void write_objects(WriteData *wd, ListBase *idbase)
 			}
 			writestruct(wd, DATA, "BulletSoftBody", 1, ob->bsoft);
 			
+			if (ob->rigidbody_object) {
+				// TODO: if any extra data is added to handle duplis, will need separate function then
+				writestruct(wd, DATA, "RigidBodyOb", 1, ob->rigidbody_object);
+			}
+			if (ob->rigidbody_constraint) {
+				writestruct(wd, DATA, "RigidBodyCon", 1, ob->rigidbody_constraint);
+			}
+
 			write_particlesystems(wd, &ob->particlesystem);
 			write_modifiers(wd, &ob->modifiers);
 		}
@@ -1512,7 +1521,7 @@ static void write_vfonts(WriteData *wd, ListBase *idbase)
 
 			/* direct data */
 
-			if (vf->packedfile && !wd->current) {
+			if (vf->packedfile) {
 				pf = vf->packedfile;
 				writestruct(wd, DATA, "PackedFile", 1, pf);
 				writedata(wd, DATA, pf->size, pf->data);
@@ -1962,7 +1971,7 @@ static void write_images(WriteData *wd, ListBase *idbase)
 			writestruct(wd, ID_IM, "Image", 1, ima);
 			if (ima->id.properties) IDP_WriteProperty(ima->id.properties, wd);
 
-			if (ima->packedfile && !wd->current) {
+			if (ima->packedfile) {
 				pf = ima->packedfile;
 				writestruct(wd, DATA, "PackedFile", 1, pf);
 				writedata(wd, DATA, pf->size, pf->data);
@@ -2296,7 +2305,14 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
 		}
 
 		write_view_settings(wd, &sce->view_settings);
-
+		
+		/* writing RigidBodyWorld data to the blend file */
+		if (sce->rigidbody_world) {
+			writestruct(wd, DATA, "RigidBodyWorld", 1, sce->rigidbody_world);
+			writestruct(wd, DATA, "EffectorWeights", 1, sce->rigidbody_world->effector_weights);
+			write_pointcaches(wd, &(sce->rigidbody_world->ptcaches));
+		}
+		
 		sce= sce->id.next;
 	}
 	/* flush helps the compression for undo-save */
@@ -2554,14 +2570,18 @@ static void write_libraries(WriteData *wd, Main *main)
 			}
 		}
 		
+		/* to be able to restore quit.blend and temp saves, the packed blend has to be in undo buffers... */
+		/* XXX needs rethink, just like save UI in undo files now - would be nice to append things only for the]
+		   quit.blend and temp saves */
 		if (foundone) {
 			writestruct(wd, ID_LI, "Library", 1, main->curlib);
 
-			if (main->curlib->packedfile && !wd->current) {
+			if (main->curlib->packedfile) {
 				PackedFile *pf = main->curlib->packedfile;
 				writestruct(wd, DATA, "PackedFile", 1, pf);
 				writedata(wd, DATA, pf->size, pf->data);
-				printf("write packed .blend: %s\n", main->curlib->name);
+				if (wd->current == NULL)
+					printf("write packed .blend: %s\n", main->curlib->name);
 			}
 			
 			while (a--) {
@@ -2692,7 +2712,7 @@ static void write_sounds(WriteData *wd, ListBase *idbase)
 			writestruct(wd, ID_SO, "bSound", 1, sound);
 			if (sound->id.properties) IDP_WriteProperty(sound->id.properties, wd);
 
-			if (sound->packedfile && !wd->current) {
+			if (sound->packedfile) {
 				pf = sound->packedfile;
 				writestruct(wd, DATA, "PackedFile", 1, pf);
 				writedata(wd, DATA, pf->size, pf->data);
diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt
index d11d748..aa1fb2d 100644
--- a/source/blender/bmesh/CMakeLists.txt
+++ b/source/blender/bmesh/CMakeLists.txt
@@ -41,7 +41,6 @@ set(INC_SYS
 set(SRC
 	operators/bmo_bevel.c
 	operators/bmo_connect.c
-	operators/bmo_slide.c
 	operators/bmo_create.c
 	operators/bmo_dissolve.c
 	operators/bmo_dupe.c
@@ -115,6 +114,8 @@ set(SRC
 	tools/bmesh_decimate.h
 	tools/bmesh_edgesplit.c
 	tools/bmesh_edgesplit.h
+	tools/bmesh_triangulate.c
+	tools/bmesh_triangulate.h
 
 	bmesh.h
 	bmesh_class.h
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h
index 60d3871..3b33513 100644
--- a/source/blender/bmesh/bmesh.h
+++ b/source/blender/bmesh/bmesh.h
@@ -243,6 +243,7 @@ extern "C" {
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <assert.h>
 
 #include "bmesh_class.h"
 
@@ -267,8 +268,9 @@ extern "C" {
 
 #include "intern/bmesh_inline.h"
 
-#include "tools/bmesh_decimate.h"
 #include "tools/bmesh_bevel.h"
+#include "tools/bmesh_decimate.h"
+#include "tools/bmesh_triangulate.h"
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h
index 824884f..6dc0218 100644
--- a/source/blender/bmesh/bmesh_class.h
+++ b/source/blender/bmesh/bmesh_class.h
@@ -45,7 +45,7 @@ struct Object;
  * pointers. this is a requirement of mempool's method of
  * iteration.
  *
- * hrm. it doesn't but stull works ok, remove the comment above? - campbell.
+ * hrm. it doesn't but still works ok, remove the comment above? - campbell.
  */
 
 // #pragma GCC diagnostic error "-Wpadded"
@@ -253,18 +253,17 @@ enum {
 };
 
 /* defines */
-
 #define BM_ELEM_CD_GET_VOID_P(ele, offset) \
-	((void)0, (void *)((char *)(ele)->head.data + (offset)))
+	(assert(offset != -1), (void *)((char *)(ele)->head.data + (offset)))
 
 #define BM_ELEM_CD_SET_FLOAT(ele, offset, f) \
-	{ *((float *)((char *)(ele)->head.data + (offset))) = (f); } (void)0
+	{ assert(offset != -1); *((float *)((char *)(ele)->head.data + (offset))) = (f); } (void)0
 
 #define BM_ELEM_CD_GET_FLOAT(ele, offset) \
-	((void)0, *((float *)((char *)(ele)->head.data + (offset))))
+	(assert(offset != -1), *((float *)((char *)(ele)->head.data + (offset))))
 
 #define BM_ELEM_CD_GET_FLOAT_AS_UCHAR(ele, offset) \
-	(unsigned char)(BM_ELEM_CD_GET_FLOAT(ele, offset) * 255.0f)
+	(assert(offset != -1), (unsigned char)(BM_ELEM_CD_GET_FLOAT(ele, offset) * 255.0f))
 
 /*forward declarations*/
 
@@ -289,6 +288,6 @@ enum {
  * but should not error on valid cases */
 #define BM_LOOP_RADIAL_MAX 10000
 #define BM_NGON_MAX 100000
-#define BM_OMP_LIMIT 0  /* setting zero so we can catch bugs in OpenMP/BMesh */
+#define BM_OMP_LIMIT 10000  /* setting zero so we can catch bugs in OpenMP/BMesh */
 
 #endif /* __BMESH_CLASS_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index 31f7958..fddb7b4 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -53,7 +53,7 @@ static void bm_loop_attrs_copy(BMesh *source_mesh, BMesh *target_mesh,
  * \brief Make Quad/Triangle
  *
  * Creates a new quad or triangle from a list of 3 or 4 vertices.
- * If \a nodouble is TRUE, then a check is done to see if a face
+ * If \a no_double is true, then a check is done to see if a face
  * with these vertices already exists and returns it instead.
  *
  * If a pointer to an example face is provided, it's custom data
@@ -65,16 +65,16 @@ static void bm_loop_attrs_copy(BMesh *source_mesh, BMesh *target_mesh,
 
 BMFace *BM_face_create_quad_tri(BMesh *bm,
                                 BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4,
-                                const BMFace *example, const int nodouble)
+                                const BMFace *example, const bool no_double)
 {
 	BMVert *vtar[4] = {v1, v2, v3, v4};
-	return BM_face_create_quad_tri_v(bm, vtar, v4 ? 4 : 3, example, nodouble);
+	return BM_face_create_quad_tri_v(bm, vtar, v4 ? 4 : 3, example, no_double);
 }
 
-BMFace *BM_face_create_quad_tri_v(BMesh *bm, BMVert **verts, int len, const BMFace *example, const int nodouble)
+BMFace *BM_face_create_quad_tri_v(BMesh *bm, BMVert **verts, int len, const BMFace *example, const bool no_double)
 {
 	BMFace *f = NULL;
-	int is_overlap = FALSE;
+	bool is_overlap = false;
 
 	/* sanity check - debug mode only */
 	if (len == 3) {
@@ -97,7 +97,7 @@ BMFace *BM_face_create_quad_tri_v(BMesh *bm, BMVert **verts, int len, const BMFa
 	}
 
 
-	if (nodouble) {
+	if (no_double) {
 		/* check if face exists or overlaps */
 		is_overlap = BM_face_exists(verts, len, &f);
 	}
@@ -793,7 +793,7 @@ void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *sour
 
 	/* First we copy select */
 	if (BM_elem_flag_test((BMElem *)sheader, BM_ELEM_SELECT)) {
-		BM_elem_select_set(target_mesh, (BMElem *)target, TRUE);
+		BM_elem_select_set(target_mesh, (BMElem *)target, true);
 	}
 	
 	/* Now we copy flags */
diff --git a/source/blender/bmesh/intern/bmesh_construct.h b/source/blender/bmesh/intern/bmesh_construct.h
index 60c465e..0f597db 100644
--- a/source/blender/bmesh/intern/bmesh_construct.h
+++ b/source/blender/bmesh/intern/bmesh_construct.h
@@ -29,10 +29,10 @@
 
 BMFace *BM_face_create_quad_tri_v(BMesh *bm,
                                   BMVert **verts, int len,
-                                  const BMFace *example, const int nodouble);
+                                  const BMFace *example, const bool no_double);
 
 BMFace *BM_face_create_quad_tri(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4,
-                                const BMFace *example, const int nodouble);
+                                const BMFace *example, const bool no_double);
 
 void BM_face_copy_shared(BMesh *bm, BMFace *f);
 
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index ea9ab36..643e73e 100644
--- a/source/blender/bmesh/intern/bmesh_core.c
+++ b/source/blender/bmesh/intern/bmesh_core.c
@@ -109,7 +109,7 @@ BMVert *BM_vert_create(BMesh *bm, const float co[3], const BMVert *example, cons
  * \brief Main function for creating a new edge.
  *
  * \note Duplicate edges are supported by the API however users should _never_ see them.
- * so unless you need a unique edge or know the edge won't exist, you should call with \a nodouble = TRUE
+ * so unless you need a unique edge or know the edge won't exist, you should call with \a no_double = true
  */
 BMEdge *BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *example, const eBMCreateFlag create_flag)
 {
@@ -209,7 +209,8 @@ static BMLoop *bm_face_boundary_add(BMesh *bm, BMFace *f, BMVert *startv, BMEdge
 	return l;
 }
 
-BMFace *BM_face_copy(BMesh *bm, BMFace *f, const short copyverts, const short copyedges)
+BMFace *BM_face_copy(BMesh *bm, BMFace *f,
+                     const bool copy_verts, const bool copy_edges)
 {
 	BMVert **verts = BLI_array_alloca(verts, f->len);
 	BMEdge **edges = BLI_array_alloca(edges, f->len);
@@ -222,7 +223,7 @@ BMFace *BM_face_copy(BMesh *bm, BMFace *f, const short copyverts, const short co
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	i = 0;
 	do {
-		if (copyverts) {
+		if (copy_verts) {
 			verts[i] = BM_vert_create(bm, l_iter->v->co, l_iter->v, 0);
 		}
 		else {
@@ -234,7 +235,7 @@ BMFace *BM_face_copy(BMesh *bm, BMFace *f, const short copyverts, const short co
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	i = 0;
 	do {
-		if (copyedges) {
+		if (copy_edges) {
 			BMVert *v1, *v2;
 			
 			if (l_iter->e->v1 == verts[i]) {
@@ -734,7 +735,7 @@ static int UNUSED_FUNCTION(bm_loop_length)(BMLoop *l)
  *
  * \return Success
  */
-static int bm_loop_reverse_loop(BMesh *bm, BMFace *f
+static bool bm_loop_reverse_loop(BMesh *bm, BMFace *f
 #ifdef USE_BMESH_HOLES
                                 , BMLoopList *lst
 #endif
@@ -748,7 +749,7 @@ static int bm_loop_reverse_loop(BMesh *bm, BMFace *f
 #endif
 
 	const int len = f->len;
-	const int do_disps = CustomData_has_layer(&bm->ldata, CD_MDISPS);
+	const bool do_disps = CustomData_has_layer(&bm->ldata, CD_MDISPS);
 	BMLoop *l_iter, *oldprev, *oldnext;
 	BMEdge **edar = BLI_array_alloca(edar, len);
 	int i, j, edok;
@@ -816,13 +817,13 @@ static int bm_loop_reverse_loop(BMesh *bm, BMFace *f
 
 	BM_CHECK_ELEMENT(f);
 
-	return 1;
+	return true;
 }
 
 /**
  * \brief Flip the faces direction
  */
-int bmesh_loop_reverse(BMesh *bm, BMFace *f)
+bool bmesh_loop_reverse(BMesh *bm, BMFace *f)
 {
 #ifdef USE_BMESH_HOLES
 	return bm_loop_reverse_loop(bm, f, f->loops.first);
@@ -893,26 +894,26 @@ static int UNUSED_FUNCTION(count_flagged_disk)(BMVert *v, int flag)
 	return i;
 }
 
-static int disk_is_flagged(BMVert *v, int flag)
+static bool disk_is_flagged(BMVert *v, int flag)
 {
 	BMEdge *e = v->e;
 
 	if (!e)
-		return FALSE;
+		return false;
 
 	do {
 		BMLoop *l = e->l;
 
 		if (!l) {
-			return FALSE;
+			return false;
 		}
 		
 		if (bmesh_radial_length(l) == 1)
-			return FALSE;
+			return false;
 		
 		do {
 			if (!BM_ELEM_API_FLAG_TEST(l->f, flag))
-				return FALSE;
+				return false;
 
 			l = l->radial_next;
 		} while (l != e->l);
@@ -920,7 +921,7 @@ static int disk_is_flagged(BMVert *v, int flag)
 		e = bmesh_disk_edge_next(e, v);
 	} while (e != v->e);
 
-	return TRUE;
+	return true;
 }
 
 /* Mid-level Topology Manipulation Functions */
@@ -939,7 +940,7 @@ static int disk_is_flagged(BMVert *v, int flag)
  * \note this is a generic, flexible join faces function,
  * almost everything uses this, including #BM_faces_join_pair
  */
-BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const short do_del)
+BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
 {
 	BMFace *f, *newf;
 #ifdef USE_BMESH_HOLES
@@ -1198,7 +1199,7 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
                    ListBase *holes,
 #endif
                    BMEdge *example,
-                   const short nodouble
+                   const bool no_double
                    )
 {
 #ifdef USE_BMESH_HOLES
@@ -1225,7 +1226,7 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
 	}
 
 	/* allocate new edge between v1 and v2 */
-	e = BM_edge_create(bm, v1, v2, example, nodouble ? BM_CREATE_NO_DOUBLE : 0);
+	e = BM_edge_create(bm, v1, v2, example, no_double ? BM_CREATE_NO_DOUBLE : 0);
 
 	f2 = bm_face_create__sfme(bm, f);
 	f1loop = bm_loop_create(bm, v2, e, f, v2loop, 0);
@@ -1351,9 +1352,10 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
 	BMLoop *nextl;
 	BMEdge *ne;
 	BMVert *nv, *ov;
-	int i, edok, valence1 = 0, valence2 = 0;
+	int i, valence1 = 0, valence2 = 0;
+	bool edok;
 
-	BLI_assert(bmesh_vert_in_edge(e, tv) != FALSE);
+	BLI_assert(bmesh_vert_in_edge(e, tv) != false);
 
 	ov = bmesh_edge_other_vert_get(e, tv);
 
@@ -1384,11 +1386,11 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
 
 	/* verify disk cycles */
 	edok = bmesh_disk_validate(valence1, ov->e, ov);
-	BMESH_ASSERT(edok != FALSE);
+	BMESH_ASSERT(edok != false);
 	edok = bmesh_disk_validate(valence2, tv->e, tv);
-	BMESH_ASSERT(edok != FALSE);
+	BMESH_ASSERT(edok != false);
 	edok = bmesh_disk_validate(2, nv->e, nv);
-	BMESH_ASSERT(edok != FALSE);
+	BMESH_ASSERT(edok != false);
 
 	/* Split the radial cycle if present */
 	nextl = e->l;
@@ -1454,9 +1456,9 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
 
 		/* verify length of radial cycle */
 		edok = bmesh_radial_validate(radlen, e->l);
-		BMESH_ASSERT(edok != FALSE);
+		BMESH_ASSERT(edok != false);
 		edok = bmesh_radial_validate(radlen, ne->l);
-		BMESH_ASSERT(edok != FALSE);
+		BMESH_ASSERT(edok != false);
 
 		/* verify loop->v and loop->next->v pointers for e */
 		for (i = 0, l = e->l; i < radlen; i++, l = l->radial_next) {
@@ -1465,7 +1467,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
 			BMESH_ASSERT(!(l->prev->e != ne && l->next->e != ne));
 
 			edok = bmesh_verts_in_edge(l->v, l->next->v, e);
-			BMESH_ASSERT(edok != FALSE);
+			BMESH_ASSERT(edok != false);
 			BMESH_ASSERT(l->v != l->next->v);
 			BMESH_ASSERT(l->e != l->next->e);
 
@@ -1481,7 +1483,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
 			// BMESH_ASSERT(l->radial_next == l);
 			BMESH_ASSERT(!(l->prev->e != e && l->next->e != e));
 			edok = bmesh_verts_in_edge(l->v, l->next->v, ne);
-			BMESH_ASSERT(edok != FALSE);
+			BMESH_ASSERT(edok != false);
 			BMESH_ASSERT(l->v != l->next->v);
 			BMESH_ASSERT(l->e != l->next->e);
 
@@ -1533,12 +1535,13 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
  * faces with just 2 edges. It is up to the caller to decide what to do with
  * these faces.
  */
-BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_double)
+BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_double)
 {
 	BMEdge *oe;
 	BMVert *ov, *tv;
 	BMLoop *killoop, *l;
-	int len, radlen = 0, halt = 0, i, valence1, valence2, edok;
+	int len, radlen = 0, i, valence1, valence2;
+	bool edok, halt = false;
 
 	if (bmesh_vert_in_edge(ke, kv) == 0) {
 		return NULL;
@@ -1617,7 +1620,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
 
 				/* Validate radial cycle of oe */
 				edok = bmesh_radial_validate(radlen, oe->l);
-				BMESH_ASSERT(edok != FALSE);
+				BMESH_ASSERT(edok != false);
 			}
 
 			/* deallocate edge */
@@ -1628,17 +1631,17 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
 
 			/* Validate disk cycle lengths of ov, tv are unchanged */
 			edok = bmesh_disk_validate(valence1, ov->e, ov);
-			BMESH_ASSERT(edok != FALSE);
+			BMESH_ASSERT(edok != false);
 			edok = bmesh_disk_validate(valence2, tv->e, tv);
-			BMESH_ASSERT(edok != FALSE);
+			BMESH_ASSERT(edok != false);
 
 			/* Validate loop cycle of all faces attached to 'oe' */
 			for (i = 0, l = oe->l; i < radlen; i++, l = l->radial_next) {
 				BMESH_ASSERT(l->e == oe);
 				edok = bmesh_verts_in_edge(l->v, l->next->v, oe);
-				BMESH_ASSERT(edok != FALSE);
+				BMESH_ASSERT(edok != false);
 				edok = bmesh_loop_validate(l->f);
-				BMESH_ASSERT(edok != FALSE);
+				BMESH_ASSERT(edok != false);
 
 				BM_CHECK_ELEMENT(l);
 				BM_CHECK_ELEMENT(l->v);
@@ -1806,7 +1809,7 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
 
 	/* validate the new loop cycle */
 	edok = bmesh_loop_validate(f1);
-	BMESH_ASSERT(edok != FALSE);
+	BMESH_ASSERT(edok != false);
 	
 	return f1;
 }
@@ -1822,7 +1825,7 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
  * where \a v and \a vtarget are connected by an edge
  * (assert checks for this case).
  */
-int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target)
+bool BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target)
 {
 	void *loops_stack[BM_DEFAULT_ITER_STACK_SIZE];
 	BMLoop **loops;
@@ -1832,7 +1835,7 @@ int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target)
 
 	/* verts already spliced */
 	if (v == v_target) {
-		return FALSE;
+		return false;
 	}
 
 	/* we can't modify the vert while iterating so first allocate an array of loops */
@@ -1862,7 +1865,7 @@ int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target)
 	/* v is unused now, and can be killed */
 	BM_vert_kill(bm, v);
 
-	return TRUE;
+	return true;
 }
 
 /**
@@ -1876,7 +1879,7 @@ int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target)
  *
  * \return Success
  */
-int bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len)
+bool bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len)
 {
 	BMEdge **stack = NULL;
 	BLI_array_staticdeclare(stack, BM_DEFAULT_ITER_STACK_SIZE);
@@ -1993,13 +1996,13 @@ int bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len)
 		MEM_freeN(verts);
 	}
 
-	return TRUE;
+	return true;
 }
 
 /**
  * High level function which wraps both #bmesh_vert_separate and #bmesh_edge_separate
  */
-int BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
+bool BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
                      BMEdge **e_in, int e_in_len)
 {
 	int i;
@@ -2023,7 +2026,7 @@ int BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
  *
  * \note Edges must already have the same vertices.
  */
-int BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target)
+bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target)
 {
 	BMLoop *l;
 
@@ -2034,7 +2037,7 @@ int BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target)
 		 * so assert on release builds */
 		BLI_assert(0);
 
-		return FALSE;
+		return false;
 	}
 
 	while (e->l) {
@@ -2053,7 +2056,7 @@ int BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target)
 	/* removes from disks too */
 	BM_edge_kill(bm, e);
 
-	return TRUE;
+	return true;
 }
 
 /**
@@ -2067,7 +2070,7 @@ int BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target)
  * \note Does nothing if \a l_sep is already the only loop in the
  * edge radial.
  */
-int bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
+bool bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
 {
 	BMEdge *ne;
 	int radlen;
@@ -2078,7 +2081,7 @@ int bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
 	radlen = bmesh_radial_length(e->l);
 	if (radlen < 2) {
 		/* no cut required */
-		return TRUE;
+		return true;
 	}
 
 	if (l_sep == e->l) {
@@ -2096,11 +2099,11 @@ int bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
 	BM_CHECK_ELEMENT(ne);
 	BM_CHECK_ELEMENT(e);
 
-	return TRUE;
+	return true;
 }
 
 /**
- * \brief Unglue Region Make Vert (URMV)
+ * \brief Un-glue Region Make Vert (URMV)
  *
  * Disconnects a face from its vertex fan at loop \a sl
  *
diff --git a/source/blender/bmesh/intern/bmesh_core.h b/source/blender/bmesh/intern/bmesh_core.h
index 5fd4a6e..d8cfc97 100644
--- a/source/blender/bmesh/intern/bmesh_core.h
+++ b/source/blender/bmesh/intern/bmesh_core.h
@@ -27,7 +27,8 @@
  *  \ingroup bmesh
  */
 
-BMFace *BM_face_copy(BMesh *bm, BMFace *f, const short copyverts, const short copyedges);
+BMFace *BM_face_copy(BMesh *bm, BMFace *f,
+                     const bool copy_verts, const bool copy_edges);
 
 typedef enum eBMCreateFlag {
 	/* faces and edges only */
@@ -49,16 +50,16 @@ void    BM_face_kill(BMesh *bm, BMFace *f);
 void    BM_edge_kill(BMesh *bm, BMEdge *e);
 void    BM_vert_kill(BMesh *bm, BMVert *v);
 
-int     bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep);
-int     BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target);
-int     BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target);
+bool    bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep);
+bool    BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target);
+bool    BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target);
 
-int     bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len);
+bool    bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len);
 
-int     bmesh_loop_reverse(BMesh *bm, BMFace *f);
+bool    bmesh_loop_reverse(BMesh *bm, BMFace *f);
 
-BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const short do_del);
-int     BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
+BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del);
+bool    BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
                          BMEdge **e_in, int e_in_len);
 
 /* EULER API - For modifying structure */
@@ -68,11 +69,11 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1,
                           ListBase *holes,
 #endif
                           BMEdge *example,
-                          const short nodouble
+                          const bool no_double
                           );
 
 BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e);
-BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_splice);
+BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_splice);
 BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e);
 BMVert *bmesh_urmv(BMesh *bm, BMFace *sf, BMVert *sv);
 BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl);
diff --git a/source/blender/bmesh/intern/bmesh_error.h b/source/blender/bmesh/intern/bmesh_error.h
index 2ef146c..0f23f87 100644
--- a/source/blender/bmesh/intern/bmesh_error.h
+++ b/source/blender/bmesh/intern/bmesh_error.h
@@ -35,11 +35,11 @@ void BMO_error_raise(BMesh *bm, BMOperator *owner, int errcode, const char *msg)
 
 /* gets the topmost error from the stack.
  * returns error code or 0 if no error.*/
-int BMO_error_get(BMesh *bm, const char **msg, BMOperator **op);
-int BMO_error_occurred(BMesh *bm);
+int  BMO_error_get(BMesh *bm, const char **msg, BMOperator **op);
+bool BMO_error_occurred(BMesh *bm);
 
 /* same as geterror, only pops the error off the stack as well */
-int BMO_error_pop(BMesh *bm, const char **msg, BMOperator **op);
+int  BMO_error_pop(BMesh *bm, const char **msg, BMOperator **op);
 void BMO_error_clear(BMesh *bm);
 
 /* this is meant for handling errors, like self-intersection test failures.
diff --git a/source/blender/bmesh/intern/bmesh_inline.h b/source/blender/bmesh/intern/bmesh_inline.h
index 04b214f..102e9d4 100644
--- a/source/blender/bmesh/intern/bmesh_inline.h
+++ b/source/blender/bmesh/intern/bmesh_inline.h
@@ -44,7 +44,7 @@ BLI_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag)
 	return head->hflag & hflag;
 }
 
-BLI_INLINE short _bm_elem_flag_test_bool(const BMHeader *head, const char hflag)
+BLI_INLINE bool _bm_elem_flag_test_bool(const BMHeader *head, const char hflag)
 {
 	return (head->hflag & hflag) != 0;
 }
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index 1afaf85..44b8baa 100644
--- a/source/blender/bmesh/intern/bmesh_interp.c
+++ b/source/blender/bmesh/intern/bmesh_interp.c
@@ -599,7 +599,7 @@ void BM_loop_interp_multires(BMesh *bm, BMLoop *target, BMFace *source)
  * if do_vertex is true, target's vert data will also get interpolated.
  */
 void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source,
-                              int do_vertex, int do_multires)
+                              const bool do_vertex, const bool do_multires)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
diff --git a/source/blender/bmesh/intern/bmesh_interp.h b/source/blender/bmesh/intern/bmesh_interp.h
index 8be963f..3563ed1 100644
--- a/source/blender/bmesh/intern/bmesh_interp.h
+++ b/source/blender/bmesh/intern/bmesh_interp.h
@@ -44,7 +44,7 @@ void  BM_elem_float_data_set(CustomData *cd, void *element, int type, const floa
 
 void  BM_face_interp_from_face(BMesh *bm, BMFace *target, BMFace *source);
 void  BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source,
-                              int do_vertex, int do_multires);
+                              const bool do_vertex, const bool do_multires);
 
 void  BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f);
 
diff --git a/source/blender/bmesh/intern/bmesh_iterators.c b/source/blender/bmesh/intern/bmesh_iterators.c
index c3f33eb..44b76df 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.c
+++ b/source/blender/bmesh/intern/bmesh_iterators.c
@@ -164,14 +164,12 @@ void *BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len,
  *
  * Counts how many flagged / unflagged items are found in this element.
  */
-int BM_iter_elem_count_flag(const char itype, void *data, const char hflag, const short value)
+int BM_iter_elem_count_flag(const char itype, void *data, const char hflag, const bool value)
 {
 	BMIter iter;
 	BMElem *ele;
 	int count = 0;
 
-	BLI_assert(ELEM(value, TRUE, FALSE));
-
 	for (ele = BM_iter_new(&iter, NULL, itype, data); ele; ele = BM_iter_step(&iter)) {
 		if (BM_elem_flag_test_bool(ele, hflag) == value) {
 			count++;
@@ -186,14 +184,12 @@ int BM_iter_elem_count_flag(const char itype, void *data, const char hflag, cons
  *
  * Counts how many flagged / unflagged items are found in this mesh.
  */
-int BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const short value)
+int BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const bool value)
 {
 	BMIter iter;
 	BMElem *ele;
 	int count = 0;
 
-	BLI_assert(ELEM(value, TRUE, FALSE));
-
 	for (ele = BM_iter_new(&iter, bm, itype, NULL); ele; ele = BM_iter_step(&iter)) {
 		if (BM_elem_flag_test_bool(ele, hflag) == value) {
 			count++;
diff --git a/source/blender/bmesh/intern/bmesh_iterators.h b/source/blender/bmesh/intern/bmesh_iterators.h
index 7291bca..3b795a2 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.h
+++ b/source/blender/bmesh/intern/bmesh_iterators.h
@@ -131,8 +131,8 @@ void   *BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len,
 __attribute__((warn_unused_result))
 #endif
 ;
-int     BM_iter_elem_count_flag(const char itype, void *data, const char hflag, const short value);
-int     BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const short value);
+int     BM_iter_elem_count_flag(const char itype, void *data, const char hflag, const bool value);
+int     BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const bool value);
 
 /* private for bmesh_iterators_inline.c */
 void  bmiter__vert_of_mesh_begin(struct BMIter *iter);
diff --git a/source/blender/bmesh/intern/bmesh_iterators_inline.h b/source/blender/bmesh/intern/bmesh_iterators_inline.h
index 9681652..eef6544 100644
--- a/source/blender/bmesh/intern/bmesh_iterators_inline.h
+++ b/source/blender/bmesh/intern/bmesh_iterators_inline.h
@@ -35,7 +35,7 @@
 /**
  * \brief Iterator Step
  *
- * Calls an iterators step fucntion to return the next element.
+ * Calls an iterators step function to return the next element.
  */
 BLI_INLINE void *BM_iter_step(BMIter *iter)
 {
@@ -50,7 +50,7 @@ BLI_INLINE void *BM_iter_step(BMIter *iter)
  * it with the appropriate function pointers based
  * upon its type.
  */
-BLI_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data)
+BLI_INLINE bool BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data)
 {
 	/* int argtype; */
 	iter->itype = itype;
@@ -77,91 +77,61 @@ BLI_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *dat
 			iter->step =  bmiter__face_of_mesh_step;
 			break;
 		case BM_EDGES_OF_VERT:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__edge_of_vert_begin;
 			iter->step =  bmiter__edge_of_vert_step;
 			iter->vdata = data;
 			break;
 		case BM_FACES_OF_VERT:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__face_of_vert_begin;
 			iter->step =  bmiter__face_of_vert_step;
 			iter->vdata = data;
 			break;
 		case BM_LOOPS_OF_VERT:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__loop_of_vert_begin;
 			iter->step =  bmiter__loop_of_vert_step;
 			iter->vdata = data;
 			break;
 		case BM_VERTS_OF_EDGE:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__vert_of_edge_begin;
 			iter->step =  bmiter__vert_of_edge_step;
 			iter->edata = data;
 			break;
 		case BM_FACES_OF_EDGE:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__face_of_edge_begin;
 			iter->step =  bmiter__face_of_edge_step;
 			iter->edata = data;
 			break;
 		case BM_VERTS_OF_FACE:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__vert_of_face_begin;
 			iter->step =  bmiter__vert_of_face_step;
 			iter->pdata = data;
 			break;
 		case BM_EDGES_OF_FACE:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__edge_of_face_begin;
 			iter->step =  bmiter__edge_of_face_step;
 			iter->pdata = data;
 			break;
 		case BM_LOOPS_OF_FACE:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__loop_of_face_begin;
 			iter->step =  bmiter__loop_of_face_step;
 			iter->pdata = data;
 			break;
 		case BM_LOOPS_OF_LOOP:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__loops_of_loop_begin;
 			iter->step =  bmiter__loops_of_loop_step;
 			iter->ldata = data;
 			break;
 		case BM_LOOPS_OF_EDGE:
-			if (UNLIKELY(!data)) {
-				return FALSE;
-			}
-
+			BLI_assert(data != NULL);
 			iter->begin = bmiter__loops_of_edge_begin;
 			iter->step =  bmiter__loops_of_edge_step;
 			iter->edata = data;
@@ -169,13 +139,13 @@ BLI_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *dat
 		default:
 			/* should never happen */
 			BLI_assert(0);
-			return FALSE;
+			return false;
 			break;
 	}
 	
 	iter->begin(iter);
 
-	return TRUE;
+	return true;
 }
 
 /**
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index a251012..36a5412 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -165,13 +165,13 @@ static BMFace *bm_log_face_from_id(BMLog *log, unsigned int id)
  * Returns zero if no paint-mask layer is present */
 static float vert_mask_get(BMesh *bm, BMVert *v)
 {
-	CustomData *cd = &bm->vdata;
-	if (CustomData_has_layer(&bm->vdata, CD_PAINT_MASK)) {
-		float *mask = CustomData_bmesh_get(cd, v->head.data, CD_PAINT_MASK);
+	float *mask = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_PAINT_MASK);
+	BLI_assert((CustomData_has_layer(&bm->vdata, CD_PAINT_MASK) == 0) == (mask == NULL));
+	if (mask) {
 		return *mask;
 	}
 	else {
-		return 0;
+		return 0.0f;
 	}
 }
 
@@ -180,10 +180,10 @@ static float vert_mask_get(BMesh *bm, BMVert *v)
  * Has no effect is no paint-mask layer is present */
 static void vert_mask_set(BMesh *bm, BMVert *v, float new_mask)
 {
-	CustomData *cd = &bm->vdata;
-	if (CustomData_has_layer(cd, CD_PAINT_MASK)) {
-		float *mask = CustomData_bmesh_get(cd, v->head.data, CD_PAINT_MASK);
-		(*mask) = new_mask;
+	float *mask = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_PAINT_MASK);
+	BLI_assert((CustomData_has_layer(&bm->vdata, CD_PAINT_MASK) == 0) == (mask == NULL));
+	if (*mask) {
+		*mask = new_mask;
 	}
 }
 
@@ -215,7 +215,8 @@ static BMLogFace *bm_log_face_alloc(BMLog *log, BMFace *f)
 
 	BLI_assert(f->len == 3);
 
-	BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v, 3);
+	// BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v, 3);
+	BM_face_as_array_vert_tri(f, v);
 
 	lf->v_ids[0] = bm_log_vert_id_get(log, v[0]);
 	lf->v_ids[1] = bm_log_vert_id_get(log, v[1]);
@@ -251,8 +252,22 @@ static void bm_log_faces_unmake(BMesh *bm, BMLog *log, GHash *faces)
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
 		unsigned int id = GET_INT_FROM_POINTER(key);
 		BMFace *f = bm_log_face_from_id(log, id);
+		BMEdge *e_tri[3];
+		BMLoop *l_iter;
+		int i;
 
+		l_iter = BM_FACE_FIRST_LOOP(f);
+		for (i = 0; i < 3; i++, l_iter = l_iter->next) {
+			e_tri[i] = l_iter->e;
+		}
+
+		/* Remove any unused edges */
 		BM_face_kill(bm, f);
+		for (i = 0; i < 3; i++) {
+			if (BM_edge_is_wire(e_tri[i])) {
+				BM_edge_kill(bm, e_tri[i]);
+			}
+		}
 	}
 }
 
@@ -276,11 +291,11 @@ static void bm_log_faces_restore(BMesh *bm, BMLog *log, GHash *faces)
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
 		BMLogFace *lf = BLI_ghashIterator_getValue(&gh_iter);
 		BMVert *v[3] = {bm_log_vert_from_id(log, lf->v_ids[0]),
-						bm_log_vert_from_id(log, lf->v_ids[1]),
-						bm_log_vert_from_id(log, lf->v_ids[2])};
+		                bm_log_vert_from_id(log, lf->v_ids[1]),
+		                bm_log_vert_from_id(log, lf->v_ids[2])};
 		BMFace *f;
 
-		f = BM_face_create_quad_tri_v(bm, v, 3, NULL, FALSE);
+		f = BM_face_create_quad_tri_v(bm, v, 3, NULL, false);
 		bm_log_face_id_set(log, f, GET_INT_FROM_POINTER(key));
 	}
 }
@@ -451,7 +466,8 @@ BMLog *BM_log_from_existing_entries_create(BMesh *bm, BMLogEntry *entry)
 
 	/* Let BMLog manage the entry list again */
 	log->entries.first = log->entries.last = entry;
-	if (entry) {
+
+	{
 		while (entry->prev) {
 			entry = entry->prev;
 			log->entries.first = entry;
@@ -720,7 +736,7 @@ void BM_log_redo(BMesh *bm, BMLog *log)
  * vertex in the map of added vertices.
  *
  * If the vertex already existed prior to the current log entry, a
- * seperate key/value map of modified vertices is used (using the
+ * separate key/value map of modified vertices is used (using the
  * vertex's ID as the key). The values stored in that case are
  * the vertex's original state so that an undo can restore the
  * previous state.
@@ -805,8 +821,11 @@ void BM_log_vert_removed(BMesh *bm, BMLog *log, BMVert *v)
 	unsigned int v_id = bm_log_vert_id_get(log, v);
 	void *key = SET_INT_IN_POINTER(v_id);
 
-	if (BLI_ghash_lookup(entry->added_verts, key)) {
-		BLI_ghash_remove(entry->added_verts, key, NULL, NULL);
+	/* if it has a key, it shouldn't be NULL */
+	BLI_assert(!!BLI_ghash_lookup(entry->added_verts, key) ==
+	           !!BLI_ghash_haskey(entry->added_verts, key));
+
+	if (BLI_ghash_remove(entry->added_verts, key, NULL, NULL)) {
 		range_tree_uint_release(log->unused_ids, v_id);
 	}
 	else {
@@ -843,8 +862,11 @@ void BM_log_face_removed(BMLog *log, BMFace *f)
 	unsigned int f_id = bm_log_face_id_get(log, f);
 	void *key = SET_INT_IN_POINTER(f_id);
 
-	if (BLI_ghash_lookup(entry->added_faces, key)) {
-		BLI_ghash_remove(entry->added_faces, key, NULL, NULL);
+	/* if it has a key, it shouldn't be NULL */
+	BLI_assert(!!BLI_ghash_lookup(entry->added_faces, key) ==
+	           !!BLI_ghash_haskey(entry->added_faces, key));
+
+	if (BLI_ghash_remove(entry->added_faces, key, NULL, NULL)) {
 		range_tree_uint_release(log->unused_ids, f_id);
 	}
 	else {
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c
index 669be31..4e29756 100644
--- a/source/blender/bmesh/intern/bmesh_marking.c
+++ b/source/blender/bmesh/intern/bmesh_marking.c
@@ -107,18 +107,18 @@ void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode)
 #pragma omp section
 			{
 				BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
-					int ok = TRUE;
+					bool ok = true;
 					if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
 						l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 						do {
 							if (!BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT)) {
-								ok = FALSE;
+								ok = false;
 								break;
 							}
 						} while ((l_iter = l_iter->next) != l_first);
 					}
 					else {
-						ok = FALSE;
+						ok = false;
 					}
 
 					BM_elem_flag_set(f, BM_ELEM_SELECT, ok);
@@ -129,18 +129,18 @@ void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode)
 	}
 	else if (selectmode & SCE_SELECT_EDGE) {
 		BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
-			int ok = TRUE;
+			bool ok = true;
 			if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
 				l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 				do {
 					if (!BM_elem_flag_test(l_iter->e, BM_ELEM_SELECT)) {
-						ok = FALSE;
+						ok = false;
 						break;
 					}
 				} while ((l_iter = l_iter->next) != l_first);
 			}
 			else {
-				ok = FALSE;
+				ok = false;
 			}
 
 			BM_elem_flag_set(f, BM_ELEM_SELECT, ok);
@@ -171,7 +171,7 @@ void BM_mesh_deselect_flush(BMesh *bm)
 	BMIter eiter;
 	BMIter fiter;
 
-	int ok;
+	bool ok;
 
 	/* we can use 2 sections here because the second loop isnt checking edge selection */
 #pragma omp parallel sections if (bm->totedge + bm->totface >= BM_OMP_LIMIT)
@@ -191,21 +191,21 @@ void BM_mesh_deselect_flush(BMesh *bm)
 #pragma omp section
 		{
 			BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
-				ok = TRUE;
+				ok = true;
 				if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
 					l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 					do {
 						if (!BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT)) {
-							ok = FALSE;
+							ok = false;
 							break;
 						}
 					} while ((l_iter = l_iter->next) != l_first);
 				}
 				else {
-					ok = FALSE;
+					ok = false;
 				}
 
-				if (ok == FALSE) {
+				if (ok == false) {
 					BM_elem_flag_disable(f, BM_ELEM_SELECT);
 				}
 			}
@@ -233,7 +233,7 @@ void BM_mesh_select_flush(BMesh *bm)
 	BMIter eiter;
 	BMIter fiter;
 
-	int ok;
+	bool ok;
 
 	/* we can use 2 sections here because the second loop isnt checking edge selection */
 #pragma omp parallel sections if (bm->totedge + bm->totface >= BM_OMP_LIMIT)
@@ -253,18 +253,18 @@ void BM_mesh_select_flush(BMesh *bm)
 #pragma omp section
 		{
 			BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
-				ok = TRUE;
+				ok = true;
 				if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
 					l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 					do {
 						if (!BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT)) {
-							ok = FALSE;
+							ok = false;
 							break;
 						}
 					} while ((l_iter = l_iter->next) != l_first);
 				}
 				else {
-					ok = FALSE;
+					ok = false;
 				}
 
 				if (ok) {
@@ -283,7 +283,7 @@ void BM_mesh_select_flush(BMesh *bm)
  * Changes selection state of a single vertex
  * in a mesh
  */
-void BM_vert_select_set(BMesh *bm, BMVert *v, int select)
+void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
 {
 	BLI_assert(v->head.htype == BM_VERT);
 
@@ -310,7 +310,7 @@ void BM_vert_select_set(BMesh *bm, BMVert *v, int select)
  *
  * Changes selection state of a single edge in a mesh.
  */
-void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
+void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
 {
 	BLI_assert(e->head.htype == BM_EDGE);
 
@@ -322,8 +322,8 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
 		if (!BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel += 1;
 
 		BM_elem_flag_enable(e, BM_ELEM_SELECT);
-		BM_vert_select_set(bm, e->v1, TRUE);
-		BM_vert_select_set(bm, e->v2, TRUE);
+		BM_vert_select_set(bm, e->v1, true);
+		BM_vert_select_set(bm, e->v2, true);
 	}
 	else {
 		if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1;
@@ -354,13 +354,13 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
 				}
 
 				if (deselect) {
-					BM_vert_select_set(bm, verts[i], FALSE);
+					BM_vert_select_set(bm, verts[i], false);
 				}
 			}
 		}
 		else {
-			BM_vert_select_set(bm, e->v1, FALSE);
-			BM_vert_select_set(bm, e->v2, FALSE);
+			BM_vert_select_set(bm, e->v1, false);
+			BM_vert_select_set(bm, e->v2, false);
 		}
 
 	}
@@ -372,7 +372,7 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
  * Changes selection state of a single
  * face in a mesh.
  */
-void BM_face_select_set(BMesh *bm, BMFace *f, int select)
+void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
@@ -391,8 +391,8 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
 		BM_elem_flag_enable(f, BM_ELEM_SELECT);
 		l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 		do {
-			BM_vert_select_set(bm, l_iter->v, TRUE);
-			BM_edge_select_set(bm, l_iter->e, TRUE);
+			BM_vert_select_set(bm, l_iter->v, true);
+			BM_edge_select_set(bm, l_iter->e, true);
 		} while ((l_iter = l_iter->next) != l_first);
 	}
 	else {
@@ -412,7 +412,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
 			}
 
 			if (!f2) {
-				BM_edge_select_set(bm, l->e, FALSE);
+				BM_edge_select_set(bm, l->e, false);
 			}
 		}
 
@@ -426,7 +426,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
 			}
 
 			if (!e) {
-				BM_vert_select_set(bm, l->v, FALSE);
+				BM_vert_select_set(bm, l->v, false);
 			}
 		}
 	}
@@ -467,7 +467,7 @@ void BM_mesh_select_mode_set(BMesh *bm, int selectmode)
 
 		BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) {
 			if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
-				BM_edge_select_set(bm, (BMEdge *)ele, TRUE);
+				BM_edge_select_set(bm, (BMEdge *)ele, true);
 			}
 		}
 		BM_mesh_select_mode_flush(bm);
@@ -481,7 +481,7 @@ void BM_mesh_select_mode_set(BMesh *bm, int selectmode)
 #endif
 		BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) {
 			if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
-				BM_face_select_set(bm, (BMFace *)ele, TRUE);
+				BM_face_select_set(bm, (BMFace *)ele, true);
 			}
 		}
 		BM_mesh_select_mode_flush(bm);
@@ -492,14 +492,12 @@ void BM_mesh_select_mode_set(BMesh *bm, int selectmode)
  * counts number of elements with flag enabled/disabled
  */
 static int bm_mesh_flag_count(BMesh *bm, const char htype, const char hflag,
-                              const short respecthide, const short test_for_enabled)
+                              const short respecthide, const bool test_for_enabled)
 {
 	BMElem *ele;
 	BMIter iter;
 	int tot = 0;
 
-	BLI_assert(ELEM(test_for_enabled, TRUE, FALSE));
-
 	if (htype & BM_VERT) {
 		for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
 			if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
@@ -522,21 +520,21 @@ static int bm_mesh_flag_count(BMesh *bm, const char htype, const char hflag,
 	return tot;
 }
 
-int BM_mesh_elem_hflag_count_enabled(BMesh *bm, const char htype, const char hflag, int respecthide)
+int BM_mesh_elem_hflag_count_enabled(BMesh *bm, const char htype, const char hflag, const bool respecthide)
 {
-	return bm_mesh_flag_count(bm, htype, hflag, respecthide, TRUE);
+	return bm_mesh_flag_count(bm, htype, hflag, respecthide, true);
 }
 
-int BM_mesh_elem_hflag_count_disabled(BMesh *bm, const char htype, const char hflag, int respecthide)
+int BM_mesh_elem_hflag_count_disabled(BMesh *bm, const char htype, const char hflag, const bool respecthide)
 {
-	return bm_mesh_flag_count(bm, htype, hflag, respecthide, FALSE);
+	return bm_mesh_flag_count(bm, htype, hflag, respecthide, false);
 }
 
 /**
  * \note use BM_elem_flag_test(ele, BM_ELEM_SELECT) to test selection
  * \note by design, this will not touch the editselection history stuff
  */
-void BM_elem_select_set(BMesh *bm, BMElem *ele, int select)
+void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
 {
 	switch (ele->head.htype) {
 		case BM_VERT:
@@ -560,12 +558,12 @@ void BM_active_face_set(BMesh *bm, BMFace *efa)
 	bm->act_face = efa;
 }
 
-BMFace *BM_active_face_get(BMesh *bm, int sloppy, int selected)
+BMFace *BM_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
 {
-	if (bm->act_face && (!selected || BM_elem_flag_test(bm->act_face, BM_ELEM_SELECT))) {
+	if (bm->act_face && (!is_selected || BM_elem_flag_test(bm->act_face, BM_ELEM_SELECT))) {
 		return bm->act_face;
 	}
-	else if (sloppy) {
+	else if (is_sloppy) {
 		BMIter iter;
 		BMFace *f = NULL;
 		BMEditSelection *ese;
@@ -579,7 +577,7 @@ BMFace *BM_active_face_get(BMesh *bm, int sloppy, int selected)
 				if (BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
 					f = NULL;
 				}
-				else if (selected && !BM_elem_flag_test(f, BM_ELEM_SELECT)) {
+				else if (is_selected && !BM_elem_flag_test(f, BM_ELEM_SELECT)) {
 					f = NULL;
 				}
 				else {
@@ -712,12 +710,13 @@ void BM_editselection_plane(BMEditSelection *ese, float r_plane[3])
 			cross_v3_v3v3(r_plane, efa->no, vec);
 		}
 		else {
-			BMVert *verts[4] = {NULL};
-
-			BM_iter_as_array(NULL, BM_VERTS_OF_FACE, efa, (void **)verts, 4);
-
 			if (efa->len == 4) {
+				BMVert *verts[4] = {NULL};
 				float vecA[3], vecB[3];
+
+				// BM_iter_as_array(NULL, BM_VERTS_OF_FACE, efa, (void **)verts, 4);
+				BM_face_as_array_vert_quad(efa, verts);
+
 				sub_v3_v3v3(vecA, verts[3]->co, verts[2]->co);
 				sub_v3_v3v3(vecB, verts[0]->co, verts[1]->co);
 				add_v3_v3v3(r_plane, vecA, vecB);
@@ -743,20 +742,20 @@ void BM_editselection_plane(BMEditSelection *ese, float r_plane[3])
 
 
 /* --- macro wrapped funcs --- */
-int _bm_select_history_check(BMesh *bm, const BMHeader *ele)
+bool _bm_select_history_check(BMesh *bm, const BMHeader *ele)
 {
 	return (BLI_findptr(&bm->selected, ele, offsetof(BMEditSelection, ele)) != NULL);
 }
 
-int _bm_select_history_remove(BMesh *bm, BMHeader *ele)
+bool _bm_select_history_remove(BMesh *bm, BMHeader *ele)
 {
 	BMEditSelection *ese = BLI_findptr(&bm->selected, ele, offsetof(BMEditSelection, ele));
 	if (ese) {
 		BLI_freelinkN(&bm->selected, ese);
-		return TRUE;
+		return true;
 	}
 	else {
-		return FALSE;
+		return false;
 	}
 }
 
@@ -800,10 +799,10 @@ void BM_select_history_validate(BMesh *bm)
 }
 
 /* utility function */
-int BM_select_history_active_get(BMesh *bm, BMEditSelection *ese)
+bool BM_select_history_active_get(BMesh *bm, BMEditSelection *ese)
 {
 	BMEditSelection *ese_last = bm->selected.last;
-	BMFace *efa = BM_active_face_get(bm, FALSE, FALSE);
+	BMFace *efa = BM_active_face_get(bm, false, false);
 
 	ese->next = ese->prev = NULL;
 
@@ -828,14 +827,14 @@ int BM_select_history_active_get(BMesh *bm, BMEditSelection *ese)
 	}
 	else {
 		ese->ele = NULL;
-		return FALSE;
+		return false;
 	}
 
-	return TRUE;
+	return true;
 }
 
 void BM_mesh_elem_hflag_disable_test(BMesh *bm, const char htype, const char hflag,
-                                     int respecthide, const char hflag_test)
+                                     const bool respecthide, const char hflag_test)
 {
 	const char iter_types[3] = {BM_VERTS_OF_MESH,
 	                            BM_EDGES_OF_MESH,
@@ -851,7 +850,7 @@ void BM_mesh_elem_hflag_disable_test(BMesh *bm, const char htype, const char hfl
 
 	if ((htype == (BM_VERT | BM_EDGE | BM_FACE)) &&
 	    (hflag == BM_ELEM_SELECT) &&
-	    (respecthide == FALSE) &&
+	    (respecthide == false) &&
 	    (hflag_test == 0))
 	{
 		/* fast path for deselect all, avoid topology loops
@@ -887,7 +886,7 @@ void BM_mesh_elem_hflag_disable_test(BMesh *bm, const char htype, const char hfl
 					}
 
 					if (hflag & BM_ELEM_SELECT) {
-						BM_elem_select_set(bm, ele, FALSE);
+						BM_elem_select_set(bm, ele, false);
 					}
 					BM_elem_flag_disable(ele, hflag);
 				}
@@ -897,7 +896,7 @@ void BM_mesh_elem_hflag_disable_test(BMesh *bm, const char htype, const char hfl
 }
 
 void BM_mesh_elem_hflag_enable_test(BMesh *bm, const char htype, const char hflag,
-                                    int respecthide, const char hflag_test)
+                                    const bool respecthide, const char hflag_test)
 {
 	const char iter_types[3] = {BM_VERTS_OF_MESH,
 	                            BM_EDGES_OF_MESH,
@@ -935,7 +934,7 @@ void BM_mesh_elem_hflag_enable_test(BMesh *bm, const char htype, const char hfla
 				}
 
 				if (hflag & BM_ELEM_SELECT) {
-					BM_elem_select_set(bm, ele, TRUE);
+					BM_elem_select_set(bm, ele, true);
 				}
 				BM_elem_flag_enable(ele, hflag_nosel);
 			}
@@ -944,14 +943,14 @@ void BM_mesh_elem_hflag_enable_test(BMesh *bm, const char htype, const char hfla
 }
 
 void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag,
-                                    int respecthide)
+                                    const bool respecthide)
 {
 	/* call with 0 hflag_test */
 	BM_mesh_elem_hflag_disable_test(bm, htype, hflag, respecthide, 0);
 }
 
 void BM_mesh_elem_hflag_enable_all(BMesh *bm, const char htype, const char hflag,
-                                   int respecthide)
+                                   const bool respecthide)
 {
 	/* call with 0 hflag_test */
 	BM_mesh_elem_hflag_enable_test(bm, htype, hflag, respecthide, 0);
@@ -963,7 +962,7 @@ static void vert_flush_hide_set(BMVert *v)
 {
 	BMIter iter;
 	BMEdge *e;
-	int hide = TRUE;
+	bool hide = true;
 
 	BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
 		hide = hide && BM_elem_flag_test(e, BM_ELEM_HIDDEN);
@@ -976,7 +975,7 @@ static void edge_flush_hide(BMEdge *e)
 {
 	BMIter iter;
 	BMFace *f;
-	int hide = TRUE;
+	bool hide = true;
 
 	BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) {
 		hide = hide && BM_elem_flag_test(f, BM_ELEM_HIDDEN);
@@ -985,13 +984,15 @@ static void edge_flush_hide(BMEdge *e)
 	BM_elem_flag_set(e, BM_ELEM_HIDDEN, hide);
 }
 
-void BM_vert_hide_set(BMVert *v, int hide)
+void BM_vert_hide_set(BMVert *v, const bool hide)
 {
 	/* vert hiding: vert + surrounding edges and faces */
 	BMIter iter, fiter;
 	BMEdge *e;
 	BMFace *f;
 
+	BLI_assert(v->head.htype == BM_VERT);
+
 	BM_elem_flag_set(v, BM_ELEM_HIDDEN, hide);
 
 	BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
@@ -1003,12 +1004,14 @@ void BM_vert_hide_set(BMVert *v, int hide)
 	}
 }
 
-void BM_edge_hide_set(BMEdge *e, int hide)
+void BM_edge_hide_set(BMEdge *e, const bool hide)
 {
 	BMIter iter;
 	BMFace *f;
 	/* BMVert *v; */
 
+	BLI_assert(e->head.htype == BM_EDGE);
+
 	/* edge hiding: faces around the edge */
 	BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) {
 		BM_elem_flag_set(f, BM_ELEM_HIDDEN, hide);
@@ -1021,11 +1024,13 @@ void BM_edge_hide_set(BMEdge *e, int hide)
 	vert_flush_hide_set(e->v2);
 }
 
-void BM_face_hide_set(BMFace *f, int hide)
+void BM_face_hide_set(BMFace *f, const bool hide)
 {
 	BMIter iter;
 	BMLoop *l;
 
+	BLI_assert(f->head.htype == BM_FACE);
+
 	BM_elem_flag_set(f, BM_ELEM_HIDDEN, hide);
 
 	BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) {
@@ -1037,21 +1042,21 @@ void BM_face_hide_set(BMFace *f, int hide)
 	}
 }
 
-void _bm_elem_hide_set(BMesh *bm, BMHeader *head, int hide)
+void _bm_elem_hide_set(BMesh *bm, BMHeader *head, const bool hide)
 {
 	/* Follow convention of always deselecting before
 	 * hiding an element */
 	switch (head->htype) {
 		case BM_VERT:
-			if (hide) BM_vert_select_set(bm, (BMVert *)head, FALSE);
+			if (hide) BM_vert_select_set(bm, (BMVert *)head, false);
 			BM_vert_hide_set((BMVert *)head, hide);
 			break;
 		case BM_EDGE:
-			if (hide) BM_edge_select_set(bm, (BMEdge *)head, FALSE);
+			if (hide) BM_edge_select_set(bm, (BMEdge *)head, false);
 			BM_edge_hide_set((BMEdge *)head, hide);
 			break;
 		case BM_FACE:
-			if (hide) BM_face_select_set(bm, (BMFace *)head, FALSE);
+			if (hide) BM_face_select_set(bm, (BMFace *)head, false);
 			BM_face_hide_set((BMFace *)head, hide);
 			break;
 		default:
diff --git a/source/blender/bmesh/intern/bmesh_marking.h b/source/blender/bmesh/intern/bmesh_marking.h
index 8d43977..a3d2d4a 100644
--- a/source/blender/bmesh/intern/bmesh_marking.h
+++ b/source/blender/bmesh/intern/bmesh_marking.h
@@ -35,29 +35,29 @@ typedef struct BMEditSelection {
 
 /* geometry hiding code */
 #define BM_elem_hide_set(bm, ele, hide) _bm_elem_hide_set(bm, &(ele)->head, hide)
-void _bm_elem_hide_set(BMesh *bm, BMHeader *ele, int hide);
-void BM_vert_hide_set(BMVert *v, int hide);
-void BM_edge_hide_set(BMEdge *e, int hide);
-void BM_face_hide_set(BMFace *f, int hide);
+void _bm_elem_hide_set(BMesh *bm, BMHeader *ele, const bool hide);
+void BM_vert_hide_set(BMVert *v, const bool hide);
+void BM_edge_hide_set(BMEdge *e, const bool hide);
+void BM_face_hide_set(BMFace *f, const bool hide);
 
 /* Selection code */
-void BM_elem_select_set(BMesh *bm, BMElem *ele, int select);
+void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select);
 
 void BM_mesh_elem_hflag_enable_test(BMesh *bm, const char htype, const char hflag,
-                                    int respecthide, const char hflag_test);
+                                    const bool respecthide, const char hflag_test);
 void BM_mesh_elem_hflag_disable_test(BMesh *bm, const char htype, const char hflag,
-                                     int respecthide, const char hflag_test);
+                                     const bool respecthide, const char hflag_test);
 
 void BM_mesh_elem_hflag_enable_all(BMesh *bm, const char htype, const char hflag,
-                                   int respecthide);
+                                   const bool respecthide);
 void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag,
-                                    int respecthide);
+                                    const bool respecthide);
 
 /* individual element select functions, BM_elem_select_set is a shortcut for these
  * that automatically detects which one to use*/
-void BM_vert_select_set(BMesh *bm, BMVert *v, int select);
-void BM_edge_select_set(BMesh *bm, BMEdge *e, int select);
-void BM_face_select_set(BMesh *bm, BMFace *f, int select);
+void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select);
+void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select);
+void BM_face_select_set(BMesh *bm, BMFace *f, const bool select);
 
 void BM_mesh_select_mode_set(BMesh *bm, int selectmode);
 void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode);
@@ -66,12 +66,12 @@ void BM_mesh_select_mode_flush(BMesh *bm);
 void BM_mesh_deselect_flush(BMesh *bm);
 void BM_mesh_select_flush(BMesh *bm);
 
-int BM_mesh_elem_hflag_count_enabled(BMesh *bm, const char htype, const char hflag, int respecthide);
-int BM_mesh_elem_hflag_count_disabled(BMesh *bm, const char htype, const char hflag, int respecthide);
+int BM_mesh_elem_hflag_count_enabled(BMesh *bm, const char htype, const char hflag, const bool respecthide);
+int BM_mesh_elem_hflag_count_disabled(BMesh *bm, const char htype, const char hflag, const bool respecthide);
 
 /* edit selection stuff */
 void    BM_active_face_set(BMesh *bm, BMFace *f);
-BMFace *BM_active_face_get(BMesh *bm, int sloppy, int selected);
+BMFace *BM_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected);
 
 void    BM_editselection_center(BMEditSelection *ese, float r_center[3]);
 void    BM_editselection_normal(BMEditSelection *ese, float r_normal[3]);
@@ -82,13 +82,13 @@ void    BM_editselection_plane(BMEditSelection *ese,  float r_plane[3]);
 #define BM_select_history_store_notest(bm, ele) _bm_select_history_store_notest(bm, &(ele)->head)
 #define BM_select_history_store(bm, ele)        _bm_select_history_store(bm,        &(ele)->head)
 
-int  _bm_select_history_check(BMesh *bm,  const BMHeader *ele);
-int  _bm_select_history_remove(BMesh *bm,       BMHeader *ele);
+bool _bm_select_history_check(BMesh *bm,  const BMHeader *ele);
+bool _bm_select_history_remove(BMesh *bm,       BMHeader *ele);
 void _bm_select_history_store_notest(BMesh *bm, BMHeader *ele);
 void _bm_select_history_store(BMesh *bm,        BMHeader *ele);
 
 void BM_select_history_validate(BMesh *bm);
 void BM_select_history_clear(BMesh *em);
-int  BM_select_history_active_get(BMesh *bm, struct BMEditSelection *ese);
+bool BM_select_history_active_get(BMesh *bm, struct BMEditSelection *ese);
 
 #endif /* __BMESH_MARKING_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 769ede0..3c4fa49 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -245,7 +245,7 @@ void BM_mesh_free(BMesh *bm)
 	BM_mesh_data_free(bm);
 
 	if (bm->py_handle) {
-		/* keep this out of 'BM_mesh_data_free' because we wan't python
+		/* keep this out of 'BM_mesh_data_free' because we want python
 		 * to be able to clear the mesh and maintain access. */
 		extern void bpy_bm_generic_invalidate(void *self);
 
@@ -261,7 +261,7 @@ void BM_mesh_free(BMesh *bm)
  *
  * Updates the normals of a mesh.
  */
-void BM_mesh_normals_update(BMesh *bm, const short skip_hidden)
+void BM_mesh_normals_update(BMesh *bm, const bool skip_hidden)
 {
 	BMVert *v;
 	BMFace *f;
@@ -362,8 +362,8 @@ static void UNUSED_FUNCTION(bm_mdisps_space_set)(Object *ob, BMesh *bm, int from
 {
 	/* switch multires data out of tangent space */
 	if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
-		BMEditMesh *em = BMEdit_Create(bm, FALSE);
-		DerivedMesh *dm = CDDM_from_editbmesh(em, TRUE, FALSE);
+		BMEditMesh *em = BMEdit_Create(bm, false);
+		DerivedMesh *dm = CDDM_from_editbmesh(em, true, false);
 		MDisps *mdisps;
 		BMFace *f;
 		BMIter iter;
@@ -455,7 +455,7 @@ void bmesh_edit_end(BMesh *bm, int UNUSED(flag))
 #endif
 
 	/* compute normals, clear temp flags and flush selections */
-	BM_mesh_normals_update(bm, TRUE);
+	BM_mesh_normals_update(bm, true);
 	BM_mesh_select_mode_flush(bm);
 }
 
@@ -553,12 +553,12 @@ void BM_mesh_elem_index_validate(BMesh *bm, const char *location, const char *fu
 	BMIter iter;
 	BMElem *ele;
 	int i;
-	int is_any_error = 0;
+	bool is_any_error = 0;
 
 	for (i = 0; i < 3; i++) {
-		const int is_dirty = (flag_types[i] & bm->elem_index_dirty);
+		const bool is_dirty = (flag_types[i] & bm->elem_index_dirty);
 		int index = 0;
-		int is_error = FALSE;
+		bool is_error = false;
 		int err_val = 0;
 		int err_idx = 0;
 
@@ -567,7 +567,7 @@ void BM_mesh_elem_index_validate(BMesh *bm, const char *location, const char *fu
 				if (BM_elem_index_get(ele) != index) {
 					err_val = BM_elem_index_get(ele);
 					err_idx = index;
-					is_error = TRUE;
+					is_error = true;
 				}
 			}
 
@@ -575,13 +575,13 @@ void BM_mesh_elem_index_validate(BMesh *bm, const char *location, const char *fu
 			index++;
 		}
 
-		if ((is_error == TRUE) && (is_dirty == FALSE)) {
-			is_any_error = TRUE;
+		if ((is_error == true) && (is_dirty == false)) {
+			is_any_error = true;
 			fprintf(stderr,
 			        "Invalid Index: at %s, %s, %s[%d] invalid index %d, '%s', '%s'\n",
 			        location, func, type_names[i], err_idx, err_val, msg_a, msg_b);
 		}
-		else if ((is_error == FALSE) && (is_dirty == TRUE)) {
+		else if ((is_error == false) && (is_dirty == true)) {
 
 #if 0       /* mostly annoying */
 
diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h
index 8baba56..35ce185 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.h
+++ b/source/blender/bmesh/intern/bmesh_mesh.h
@@ -37,7 +37,7 @@ void   BM_mesh_free(BMesh *bm);
 void   BM_mesh_data_free(BMesh *bm);
 void   BM_mesh_clear(BMesh *bm);
 
-void BM_mesh_normals_update(BMesh *bm, const short skip_hidden);
+void BM_mesh_normals_update(BMesh *bm, const bool skip_hidden);
 
 void bmesh_edit_begin(BMesh *bm, int type_flag);
 void bmesh_edit_end(BMesh *bm, int type_flag);
diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c
index 8198e30..6697430 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_conv.c
+++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c
@@ -162,8 +162,12 @@ char BM_mesh_cd_flag_from_bmesh(BMesh *bm)
 	return cd_flag;
 }
 
-/* Mesh -> BMesh */
-void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
+/**
+ * \brief Mesh -> BMesh
+ *
+ * \warning This function doesn't calculate face normals.
+ */
+void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, bool set_key, int act_key_nr)
 {
 	MVert *mvert;
 	BLI_array_declare(verts);
@@ -174,7 +178,6 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 	BMVert *v, **vt = NULL, **verts = NULL;
 	BMEdge *e, **fedges = NULL, **et = NULL;
 	BMFace *f;
-	BMLoop *l;
 	BLI_array_declare(fedges);
 	float (*keyco)[3] = NULL;
 	int *keyi;
@@ -280,7 +283,7 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
 		/* this is necessary for selection counts to work properly */
 		if (mvert->flag & SELECT) {
-			BM_vert_select_set(bm, v, TRUE);
+			BM_vert_select_set(bm, v, true);
 		}
 
 		normal_short_to_float_v3(v->no, mvert->no);
@@ -328,7 +331,7 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
 		/* this is necessary for selection counts to work properly */
 		if (medge->flag & SELECT) {
-			BM_edge_select_set(bm, e, TRUE);
+			BM_edge_select_set(bm, e, true);
 		}
 
 		/* Copy Custom Data */
@@ -343,7 +346,8 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
 	mpoly = me->mpoly;
 	for (i = 0; i < me->totpoly; i++, mpoly++) {
-		BMIter iter;
+		BMLoop *l_iter;
+		BMLoop *l_first;
 
 		BLI_array_empty(fedges);
 		BLI_array_empty(verts);
@@ -395,17 +399,18 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
 		/* this is necessary for selection counts to work properly */
 		if (mpoly->flag & ME_FACE_SEL) {
-			BM_face_select_set(bm, f, TRUE);
+			BM_face_select_set(bm, f, true);
 		}
 
 		f->mat_nr = mpoly->mat_nr;
 		if (i == me->act_face) bm->act_face = f;
 
-		j = 0;
-		BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, j) {
+		j = mpoly->loopstart;
+		l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+		do {
 			/* Save index of correspsonding MLoop */
-			CustomData_to_bmesh_block(&me->ldata, &bm->ldata, mpoly->loopstart + j, &l->head.data, true);
-		}
+			CustomData_to_bmesh_block(&me->ldata, &bm->ldata, j++, &l_iter->head.data, true);
+		} while ((l_iter = l_iter->next) != l_first);
 
 		/* Copy Custom Data */
 		CustomData_to_bmesh_block(&me->pdata, &bm->pdata, i, &f->head.data, true);
@@ -415,22 +420,20 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
 	if (me->mselect && me->totselect != 0) {
 
-		BMVert **vert_array = MEM_callocN(sizeof(BMVert *) * bm->totvert,
-		                                  "Selection Conversion Vertex Pointer Array");
-		BMEdge **edge_array = MEM_callocN(sizeof(BMEdge *) * bm->totedge,
-		                                  "Selection Conversion Edge Pointer Array");
-		BMFace **face_array = MEM_callocN(sizeof(BMFace *) * bm->totface,
-		                                  "Selection Conversion Face Pointer Array");
-
-		BMIter  iter;
-		BMVert  *vert;
-		BMEdge  *edge;
-		BMFace  *face;
+		BMVert **vert_array = MEM_mallocN(sizeof(BMVert *) * bm->totvert, "VSelConv");
+		BMEdge **edge_array = MEM_mallocN(sizeof(BMEdge *) * bm->totedge, "ESelConv");
+		BMFace **face_array = MEM_mallocN(sizeof(BMFace *) * bm->totface, "FSelConv");
 		MSelect *msel;
 
-		BM_ITER_MESH_INDEX (vert, &iter, bm, BM_VERTS_OF_MESH, i) { vert_array[i] = vert; }
-		BM_ITER_MESH_INDEX (edge, &iter, bm, BM_EDGES_OF_MESH, i) { edge_array[i] = edge; }
-		BM_ITER_MESH_INDEX (face, &iter, bm, BM_FACES_OF_MESH, i) { face_array[i] = face; }
+#pragma omp parallel sections if (bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT)
+		{
+#pragma omp section
+			{ BM_iter_as_array(bm, BM_VERTS_OF_MESH, NULL, (void **)vert_array, bm->totvert); }
+#pragma omp section
+			{ BM_iter_as_array(bm, BM_EDGES_OF_MESH, NULL, (void **)edge_array, bm->totedge); }
+#pragma omp section
+			{ BM_iter_as_array(bm, BM_FACES_OF_MESH, NULL, (void **)face_array, bm->totface); }
+		}
 
 		for (i = 0, msel = me->mselect; i < me->totselect; i++, msel++) {
 			switch (msel->type) {
@@ -466,7 +469,9 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 }
 
 
-/* BMesh -> Mesh */
+/**
+ * \brief BMesh -> Mesh
+ */
 static BMVert **bm_to_mesh_vertex_map(BMesh *bm, int ototvert)
 {
 	BMVert **vertMap = NULL;
@@ -549,7 +554,7 @@ BLI_INLINE void bmesh_quick_edgedraw_flag(MEdge *med, BMEdge *e)
 	}
 }
 
-void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, int dotess)
+void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, bool do_tessface)
 {
 	MLoop *mloop;
 	MPoly *mpoly;
@@ -620,6 +625,8 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, int dotess)
 	CustomData_add_layer(&me->ldata, CD_MLOOP, CD_ASSIGN, mloop, me->totloop);
 	CustomData_add_layer(&me->pdata, CD_MPOLY, CD_ASSIGN, mpoly, me->totpoly);
 
+	me->cd_flag = BM_mesh_cd_flag_from_bmesh(bm);
+
 	/* this is called again, 'dotess' arg is used there */
 	mesh_update_customdata_pointers(me, 0);
 
@@ -755,11 +762,11 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, int dotess)
 		if (vertMap) MEM_freeN(vertMap);
 	}
 
-	if (dotess) {
+	if (do_tessface) {
 		BKE_mesh_tessface_calc(me);
 	}
 
-	mesh_update_customdata_pointers(me, dotess);
+	mesh_update_customdata_pointers(me, do_tessface);
 
 	{
 		BMEditSelection *selected;
@@ -823,12 +830,12 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, int dotess)
 		                                        * bmesh and the mesh are out of sync */
 		    (oldverts != NULL))                /* not used here, but 'oldverts' is used later for applying 'ofs' */
 		{
-			int act_is_basis = FALSE;
+			bool act_is_basis = false;
 
 			/* find if this key is a basis for any others */
 			for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
 				if (bm->shapenr - 1 == currkey->relative) {
-					act_is_basis = TRUE;
+					act_is_basis = true;
 					break;
 				}
 			}
diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.h b/source/blender/bmesh/intern/bmesh_mesh_conv.h
index 55ac39c..7fe4b8f 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_conv.h
+++ b/source/blender/bmesh/intern/bmesh_mesh_conv.h
@@ -38,7 +38,7 @@ void BM_mesh_cd_flag_ensure(BMesh *bm, struct Mesh *mesh, const char cd_flag);
 void BM_mesh_cd_flag_apply(BMesh *bm, const char cd_flag);
 char BM_mesh_cd_flag_from_bmesh(BMesh *bm);
 
-void BM_mesh_bm_from_me(BMesh *bm, struct Mesh *me, int set_key, int act_key_nr);
-void BM_mesh_bm_to_me(BMesh *bm, struct Mesh *me, int dotess);
+void BM_mesh_bm_from_me(BMesh *bm, struct Mesh *me, bool set_key, int act_key_nr);
+void BM_mesh_bm_to_me(BMesh *bm, struct Mesh *me, bool do_tessface);
 
 #endif /* __BMESH_MESH_CONV_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mesh_validate.c b/source/blender/bmesh/intern/bmesh_mesh_validate.c
index 8ab5f10..e6eee16 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_validate.c
+++ b/source/blender/bmesh/intern/bmesh_mesh_validate.c
@@ -49,9 +49,9 @@
 /**
  * Check of this BMesh is valid, this function can be slow since its intended to help with debugging.
  *
- * \return TRUE when the mesh is valid.
+ * \return true when the mesh is valid.
  */
-int BM_mesh_validate(BMesh *bm)
+bool BM_mesh_validate(BMesh *bm)
 {
 	int errtot;
 
@@ -106,11 +106,11 @@ int BM_mesh_validate(BMesh *bm)
 				if (l_iter->e != e) {
 					ERRMSG("edge %d: has invalid loop, loop is of face %d", i, BM_elem_index_get(l_iter->f));
 				}
-				else if (BM_vert_in_edge(e, l_iter->v) == FALSE) {
+				else if (BM_vert_in_edge(e, l_iter->v) == false) {
 					ERRMSG("edge %d: has invalid loop with vert not in edge, loop is of face %d",
 					       i, BM_elem_index_get(l_iter->f));
 				}
-				else if (BM_vert_in_edge(e, l_iter->next->v) == FALSE) {
+				else if (BM_vert_in_edge(e, l_iter->next->v) == false) {
 					ERRMSG("edge %d: has invalid loop with next vert not in edge, loop is of face %d",
 					       i, BM_elem_index_get(l_iter->f));
 				}
@@ -181,7 +181,7 @@ int BM_mesh_validate(BMesh *bm)
 
 	ERRMSG("Finished - errors %d", errtot);
 
-	return TRUE;
+	return true;
 }
 
 
diff --git a/source/blender/bmesh/intern/bmesh_mesh_validate.h b/source/blender/bmesh/intern/bmesh_mesh_validate.h
index 6839dc7..f891413 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_validate.h
+++ b/source/blender/bmesh/intern/bmesh_mesh_validate.h
@@ -30,6 +30,6 @@
  *  \ingroup bmesh
  */
 
-int BM_mesh_validate(BMesh *bm);
+bool BM_mesh_validate(BMesh *bm);
 
 #endif /* __BMESH_MESH_VALIDATE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index 9a99d5b..d98598c 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -64,36 +64,36 @@
  * \note dissolves vert, in more situations then BM_disk_dissolve
  * (e.g. if the vert is part of a wire edge, etc).
  */
-int BM_vert_dissolve(BMesh *bm, BMVert *v)
+bool BM_vert_dissolve(BMesh *bm, BMVert *v)
 {
 	const int len = BM_vert_edge_count(v);
 	
 	if (len == 1) {
 		BM_vert_kill(bm, v); /* will kill edges too */
-		return TRUE;
+		return true;
 	}
 	else if (!BM_vert_is_manifold(v)) {
 		if (!v->e) {
 			BM_vert_kill(bm, v);
-			return TRUE;
+			return true;
 		}
 		else if (!v->e->l) {
 			if (len == 2) {
-				return (BM_vert_collapse_edge(bm, v->e, v, TRUE) != NULL);
+				return (BM_vert_collapse_edge(bm, v->e, v, true) != NULL);
 			}
 			else {
 				/* used to kill the vertex here, but it may be connected to faces.
 				 * so better do nothing */
-				return FALSE;
+				return false;
 			}
 		}
 		else {
-			return FALSE;
+			return false;
 		}
 	}
 	else if (len == 2 && BM_vert_face_count(v) == 1) {
 		/* boundary vertex on a face */
-		return (BM_vert_collapse_edge(bm, v->e, v, TRUE) != NULL);
+		return (BM_vert_collapse_edge(bm, v->e, v, true) != NULL);
 	}
 	else {
 		return BM_disk_dissolve(bm, v);
@@ -103,14 +103,14 @@ int BM_vert_dissolve(BMesh *bm, BMVert *v)
 /**
  * dissolves all faces around a vert, and removes it.
  */
-int BM_disk_dissolve(BMesh *bm, BMVert *v)
+bool BM_disk_dissolve(BMesh *bm, BMVert *v)
 {
 	BMFace *f, *f2;
 	BMEdge *e, *keepedge = NULL, *baseedge = NULL;
 	int len = 0;
 
 	if (!BM_vert_is_manifold(v)) {
-		return FALSE;
+		return false;
 	}
 	
 	if (v->e) {
@@ -135,62 +135,62 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
 		 * increasing valence to four.  this may be hackish. .  */
 		BMLoop *loop = e->l;
 		if (loop->v == v) loop = loop->next;
-		if (!BM_face_split(bm, loop->f, v, loop->v, NULL, NULL, FALSE))
-			return FALSE;
+		if (!BM_face_split(bm, loop->f, v, loop->v, NULL, NULL, false))
+			return false;
 
 		if (!BM_disk_dissolve(bm, v)) {
-			return FALSE;
+			return false;
 		}
 #else
-		if (UNLIKELY(!BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e, TRUE))) {
-			return FALSE;
+		if (UNLIKELY(!BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e, true))) {
+			return false;
 		}
-		else if (UNLIKELY(!BM_vert_collapse_faces(bm, v->e, v, 1.0, FALSE, TRUE))) {
-			return FALSE;
+		else if (UNLIKELY(!BM_vert_collapse_faces(bm, v->e, v, 1.0, false, true))) {
+			return false;
 		}
 #endif
-		return TRUE;
+		return true;
 	}
 	else if (keepedge == NULL && len == 2) {
 		/* collapse the vertex */
-		e = BM_vert_collapse_faces(bm, v->e, v, 1.0, TRUE, TRUE);
+		e = BM_vert_collapse_faces(bm, v->e, v, 1.0, true, true);
 
 		if (!e) {
-			return FALSE;
+			return false;
 		}
 
 		/* handle two-valence */
 		f = e->l->f;
 		f2 = e->l->radial_next->f;
 
-		if (f != f2 && !BM_faces_join_pair(bm, f, f2, e, TRUE)) {
-			return FALSE;
+		if (f != f2 && !BM_faces_join_pair(bm, f, f2, e, true)) {
+			return false;
 		}
 
-		return TRUE;
+		return true;
 	}
 
 	if (keepedge) {
-		int done = FALSE;
+		bool done = false;
 
 		while (!done) {
-			done = TRUE;
+			done = true;
 			e = v->e;
 			do {
 				f = NULL;
 				len = bmesh_radial_length(e->l);
 				if (len == 2 && (e != baseedge) && (e != keepedge)) {
-					f = BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e, TRUE);
+					f = BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e, true);
 					/* return if couldn't join faces in manifold
 					 * conditions */
 					/* !disabled for testing why bad things happen */
 					if (!f) {
-						return FALSE;
+						return false;
 					}
 				}
 
 				if (f) {
-					done = FALSE;
+					done = false;
 					break;
 				}
 				e = bmesh_disk_edge_next(e, v);
@@ -199,10 +199,10 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
 
 		/* collapse the vertex */
 		/* note, the baseedge can be a boundary of manifold, use this as join_faces arg */
-		e = BM_vert_collapse_faces(bm, baseedge, v, 1.0, !BM_edge_is_boundary(baseedge), TRUE);
+		e = BM_vert_collapse_faces(bm, baseedge, v, 1.0, !BM_edge_is_boundary(baseedge), true);
 
 		if (!e) {
-			return FALSE;
+			return false;
 		}
 		
 		/* get remaining two faces */
@@ -211,13 +211,13 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
 
 		if (f != f2) {
 			/* join two remaining faces */
-			if (!BM_faces_join_pair(bm, f, f2, e, TRUE)) {
-				return FALSE;
+			if (!BM_faces_join_pair(bm, f, f2, e, true)) {
+				return false;
 			}
 		}
 	}
 
-	return TRUE;
+	return true;
 }
 
 /**
@@ -235,7 +235,7 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
  *
  * \return pointer to the combined face
  */
-BMFace *BM_faces_join_pair(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e, const short do_del)
+BMFace *BM_faces_join_pair(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e, const bool do_del)
 {
 	BMLoop *l1, *l2;
 	BMEdge *jed = NULL;
@@ -302,7 +302,7 @@ BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f)
 			if (v_iter == v2) {
 				BMLoop *nl;
 
-				f_iter = BM_face_split(bm, f_iter, v1, v2, &nl, NULL, FALSE);
+				f_iter = BM_face_split(bm, f_iter, v1, v2, &nl, NULL, false);
 
 				if (r_f) {
 					*r_f = f_iter;
@@ -336,22 +336,22 @@ BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f)
  * other side). NULL if the split fails.
  */
 BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l,
-                      BMEdge *example, const short nodouble)
+                      BMEdge *example, const bool no_double)
 {
-	const int has_mdisp = CustomData_has_layer(&bm->ldata, CD_MDISPS);
+	const bool has_mdisp = CustomData_has_layer(&bm->ldata, CD_MDISPS);
 	BMFace *nf, *of;
 
 	BLI_assert(v1 != v2);
 
 	/* do we have a multires layer? */
 	if (has_mdisp) {
-		of = BM_face_copy(bm, f, FALSE, FALSE);
+		of = BM_face_copy(bm, f, false, false);
 	}
 	
 #ifdef USE_BMESH_HOLES
-	nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, nodouble);
+	nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, no_double);
 #else
-	nf = bmesh_sfme(bm, f, v1, v2, r_l, example, nodouble);
+	nf = bmesh_sfme(bm, f, v1, v2, r_l, example, no_double);
 #endif
 	
 	if (nf) {
@@ -414,15 +414,15 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[
 
 	BLI_assert(v1 != v2);
 
-	of = BM_face_copy(bm, f, TRUE, TRUE);
+	of = BM_face_copy(bm, f, true, true);
 
 	if (!r_l)
 		r_l = &l_dummy;
 	
 #ifdef USE_BMESH_HOLES
-	nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, FALSE);
+	nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, false);
 #else
-	nf = bmesh_sfme(bm, f, v1, v2, r_l, example, FALSE);
+	nf = bmesh_sfme(bm, f, v1, v2, r_l, example, false);
 #endif
 	/* bmesh_sfme returns in r_l a Loop for nf going from v1 to v2.
 	 * The radial_next is for f and goes from v2 to v1  */
@@ -445,7 +445,7 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[
 				do {
 					if (l_iter->v == newv) {
 						/* this interpolates both loop and vertex data */
-						BM_loop_interp_from_face(bm, l_iter, of, TRUE, TRUE);
+						BM_loop_interp_from_face(bm, l_iter, of, true, true);
 					}
 				} while ((l_iter = l_iter->radial_next) != e_iter->l);
 			}
@@ -482,7 +482,7 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[
  * \returns The New Edge
  */
 BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
-                               const short join_faces, const short kill_degenerate_faces)
+                               const bool join_faces, const bool kill_degenerate_faces)
 {
 	BMEdge *ne = NULL;
 	BMVert *tv = bmesh_edge_other_vert_get(ke, kv);
@@ -534,10 +534,10 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
 		}
 
 		if (BLI_array_count(faces) >= 2) {
-			BMFace *f2 = BM_faces_join(bm, faces, BLI_array_count(faces), TRUE);
+			BMFace *f2 = BM_faces_join(bm, faces, BLI_array_count(faces), true);
 			if (f2) {
 				BMLoop *nl = NULL;
-				if (BM_face_split(bm, f2, tv, tv2, &nl, NULL, FALSE)) {
+				if (BM_face_split(bm, f2, tv, tv2, &nl, NULL, false)) {
 					ne = nl->e;
 				}
 			}
@@ -549,7 +549,7 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
 		/* single face or no faces */
 		/* same as BM_vert_collapse_edge() however we already
 		 * have vars to perform this operation so don't call. */
-		ne = bmesh_jekv(bm, ke, kv, TRUE);
+		ne = bmesh_jekv(bm, ke, kv, true);
 		/* ne = BM_edge_exists(tv, tv2); */ /* same as return above */
 
 		if (ne && kill_degenerate_faces) {
@@ -589,7 +589,7 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
  * \return The New Edge
  */
 BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
-                              const short kill_degenerate_faces)
+                              const bool kill_degenerate_faces)
 {
 	/* nice example implementation but we want loops to have their customdata
 	 * accounted for */
@@ -618,7 +618,7 @@ BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
 #else
 	/* with these args faces are never joined, same as above
 	 * but account for loop customdata */
-	return BM_vert_collapse_faces(bm, ke, kv, 1.0f, FALSE, kill_degenerate_faces);
+	return BM_vert_collapse_faces(bm, ke, kv, 1.0f, false, kill_degenerate_faces);
 #endif
 }
 
@@ -641,7 +641,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
 	BMFace **oldfaces = NULL;
 	BMEdge *e_dummy;
 	BLI_array_staticdeclare(oldfaces, 32);
-	const int do_mdisp = (e->l && CustomData_has_layer(&bm->ldata, CD_MDISPS));
+	const bool do_mdisp = (e->l && CustomData_has_layer(&bm->ldata, CD_MDISPS));
 
 	/* we need this for handling multi-res */
 	if (!r_e) {
@@ -662,7 +662,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
 		/* flag existing faces so we can differentiate oldfaces from new faces */
 		for (i = 0; i < BLI_array_count(oldfaces); i++) {
 			BM_ELEM_API_FLAG_ENABLE(oldfaces[i], _FLAG_OVERLAP);
-			oldfaces[i] = BM_face_copy(bm, oldfaces[i], TRUE, TRUE);
+			oldfaces[i] = BM_face_copy(bm, oldfaces[i], true, true);
 			BM_ELEM_API_FLAG_DISABLE(oldfaces[i], _FLAG_OVERLAP);
 		}
 	}
@@ -761,16 +761,18 @@ BMVert  *BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts)
 	return nv;
 }
 
+#if 0
 /**
  * Checks if a face is valid in the data structure
  */
-int BM_face_validate(BMFace *face, FILE *err)
+bool BM_face_validate(BMFace *face, FILE *err)
 {
 	BMIter iter;
 	BLI_array_declare(verts);
 	BMVert **verts = NULL;
 	BMLoop *l;
-	int ret = 1, i, j;
+	int i, j;
+	bool ret = true;
 	
 	if (face->len == 2) {
 		fprintf(err, "warning: found two-edged face. face ptr: %p\n", face);
@@ -784,7 +786,7 @@ int BM_face_validate(BMFace *face, FILE *err)
 			fprintf(err, "Found bmesh edge with identical verts!\n");
 			fprintf(err, "  edge ptr: %p, vert: %p\n",  l->e, l->e->v1);
 			fflush(err);
-			ret = 0;
+			ret = false;
 		}
 	}
 
@@ -798,7 +800,7 @@ int BM_face_validate(BMFace *face, FILE *err)
 				fprintf(err, "Found duplicate verts in bmesh face!\n");
 				fprintf(err, "  face ptr: %p, vert: %p\n", face, verts[i]);
 				fflush(err);
-				ret = 0;
+				ret = false;
 			}
 		}
 	}
@@ -806,7 +808,7 @@ int BM_face_validate(BMFace *face, FILE *err)
 	BLI_array_free(verts);
 	return ret;
 }
-
+#endif
 
 /**
  * Calculate the 2 loops which _would_ make up the newly rotated Edge
@@ -822,14 +824,14 @@ int BM_face_validate(BMFace *face, FILE *err)
  *
  * \note #BM_edge_rotate_check must have already run.
  */
-void BM_edge_calc_rotate(BMEdge *e, int ccw,
+void BM_edge_calc_rotate(BMEdge *e, const bool ccw,
                          BMLoop **r_l1, BMLoop **r_l2)
 {
 	BMVert *v1, *v2;
 	BMFace *fa, *fb;
 
 	/* this should have already run */
-	BLI_assert(BM_edge_rotate_check(e) == TRUE);
+	BLI_assert(BM_edge_rotate_check(e) == true);
 
 	/* we know this will work */
 	BM_edge_face_pair(e, &fa, &fb);
@@ -855,7 +857,7 @@ void BM_edge_calc_rotate(BMEdge *e, int ccw,
  * Quick check to see if we could rotate the edge,
  * use this to avoid calling exceptions on common cases.
  */
-int BM_edge_rotate_check(BMEdge *e)
+bool BM_edge_rotate_check(BMEdge *e)
 {
 	BMFace *fa, *fb;
 	if (BM_edge_face_pair(e, &fa, &fb)) {
@@ -868,7 +870,7 @@ int BM_edge_rotate_check(BMEdge *e)
 		 * (ie - the next edge doesn't share the same faces).
 		 * since we can't rotate usefully in this case. */
 		if (la->v == lb->v) {
-			return FALSE;
+			return false;
 		}
 
 		/* mirror of the check above but in the opposite direction */
@@ -876,13 +878,13 @@ int BM_edge_rotate_check(BMEdge *e)
 		lb = BM_face_other_vert_loop(fb, e->v1, e->v2);
 
 		if (la->v == lb->v) {
-			return FALSE;
+			return false;
 		}
 
-		return TRUE;
+		return true;
 	}
 	else {
-		return FALSE;
+		return false;
 	}
 }
 
@@ -897,7 +899,7 @@ int BM_edge_rotate_check(BMEdge *e)
  * \param l1,l2 are the loops of the proposed verts to rotate too and should
  * be the result of calling #BM_edge_calc_rotate
  */
-int BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2)
+bool BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2)
 {
 	/* note: for these vars 'old' just means initial edge state. */
 
@@ -924,7 +926,7 @@ int BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2)
 	BMVert *v1_alt, *v2_alt;
 
 	/* this should have already run */
-	BLI_assert(BM_edge_rotate_check(e) == TRUE);
+	BLI_assert(BM_edge_rotate_check(e) == true);
 
 	BM_edge_ordered_verts(e, &v1_old, &v2_old);
 
@@ -965,12 +967,12 @@ int BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2)
 	cross_v3_v3v3(cross_old, ed_dir_old, ed_dir_v1_old);
 	cross_v3_v3v3(cross_new, ed_dir_new, ed_dir_v1_new);
 	if (dot_v3v3(cross_old, cross_new) < 0.0f) { /* does this flip? */
-		return FALSE;
+		return false;
 	}
 	cross_v3_v3v3(cross_old, ed_dir_old, ed_dir_v2_old);
 	cross_v3_v3v3(cross_new, ed_dir_new, ed_dir_v2_new);
 	if (dot_v3v3(cross_old, cross_new) < 0.0f) { /* does this flip? */
-		return FALSE;
+		return false;
 	}
 
 	negate_v3_v3(ed_dir_new_flip, ed_dir_new);
@@ -979,14 +981,14 @@ int BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2)
 	if ((dot_v3v3(ed_dir_new,      ed_dir_v1_new) > 0.999f) ||
 	    (dot_v3v3(ed_dir_new_flip, ed_dir_v2_new) > 0.999f))
 	{
-		return FALSE;
+		return false;
 	}
 
-	return TRUE;
+	return true;
 }
 
-int BM_edge_rotate_check_beauty(BMEdge *e,
-                                BMLoop *l1, BMLoop *l2)
+bool BM_edge_rotate_check_beauty(BMEdge *e,
+                                 BMLoop *l1, BMLoop *l2)
 {
 	/* Stupid check for now:
 	 * Could compare angles of surrounding edges
@@ -1009,7 +1011,7 @@ int BM_edge_rotate_check_beauty(BMEdge *e,
  *
  * \see header definition for \a check_flag enum.
  */
-BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_flag)
+BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_flag)
 {
 	BMVert *v1, *v2;
 	BMLoop *l1, *l2;
@@ -1066,7 +1068,7 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_
 	f_hflag_prev_2 = l2->f->head.hflag;
 
 	/* don't delete the edge, manually remove the egde after so we can copy its attributes */
-	f = BM_faces_join_pair(bm, l1->f, l2->f, NULL, TRUE);
+	f = BM_faces_join_pair(bm, l1->f, l2->f, NULL, true);
 
 	if (f == NULL) {
 		return NULL;
@@ -1075,7 +1077,7 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_
 	/* note, this assumes joining the faces _didnt_ also remove the verts.
 	 * the #BM_edge_rotate_check will ensure this, but its possibly corrupt state or future edits
 	 * break this */
-	if (!BM_face_split(bm, f, v1, v2, NULL, NULL, TRUE)) {
+	if (!BM_face_split(bm, f, v1, v2, NULL, NULL, true)) {
 		return NULL;
 	}
 	else {
diff --git a/source/blender/bmesh/intern/bmesh_mods.h b/source/blender/bmesh/intern/bmesh_mods.h
index 790f0cb..358268c 100644
--- a/source/blender/bmesh/intern/bmesh_mods.h
+++ b/source/blender/bmesh/intern/bmesh_mods.h
@@ -29,18 +29,18 @@
 
 #include <stdio.h>
 
-int BM_vert_dissolve(BMesh *bm, BMVert *v);
+bool BM_vert_dissolve(BMesh *bm, BMVert *v);
 
-int BM_disk_dissolve(BMesh *bm, BMVert *v);
+bool BM_disk_dissolve(BMesh *bm, BMVert *v);
 
-BMFace *BM_faces_join_pair(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e, const short do_del);
+BMFace *BM_faces_join_pair(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e, const bool do_del);
 
 BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f);
 
 BMFace *BM_face_split(BMesh *bm, BMFace *f,
                       BMVert *v1, BMVert *v2,
                       BMLoop **r_l,
-                      BMEdge *example, const short nodouble);
+                      BMEdge *example, const bool no_double);
 
 BMFace *BM_face_split_n(BMesh *bm, BMFace *f,
                         BMVert *v1, BMVert *v2,
@@ -48,25 +48,25 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f,
                         BMLoop **r_l, BMEdge *example);
 
 BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
-                               const short join_faces, const short kill_degenerate_faces);
+                               const bool join_faces, const bool kill_degenerate_faces);
 BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
-                              const short kill_degenerate_faces);
+                              const bool kill_degenerate_faces);
 
 
 BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float percent);
 
 BMVert *BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts);
 
-int     BM_face_validate(BMFace *face, FILE *err);
+bool    BM_face_validate(BMFace *face, FILE *err);
 
-void    BM_edge_calc_rotate(BMEdge *e, int ccw,
+void    BM_edge_calc_rotate(BMEdge *e, const bool ccw,
                             BMLoop **r_l1, BMLoop **r_l2);
-int     BM_edge_rotate_check(BMEdge *e);
-int     BM_edge_rotate_check_degenerate(BMEdge *e,
+bool    BM_edge_rotate_check(BMEdge *e);
+bool    BM_edge_rotate_check_degenerate(BMEdge *e,
                                         BMLoop *l1, BMLoop *l2);
-int     BM_edge_rotate_check_beauty(BMEdge *e,
+bool    BM_edge_rotate_check_beauty(BMEdge *e,
                                     BMLoop *l1, BMLoop *l2);
-BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_flag);
+BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_flag);
 
 /* flags for BM_edge_rotate */
 enum {
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 8461ec6..c5eeceb 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1436,7 +1436,7 @@ static BMOpDefine bmo_beautify_fill_def = {
 	"beautify_fill",
 	/* slots_in */
 	{{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
-	 {"constrain_edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* edges that can't be flipped */
+	 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* edges that can be flipped */
 	 {{'\0'}},
 	},
 	/* slots_out */
@@ -1455,7 +1455,8 @@ static BMOpDefine bmo_beautify_fill_def = {
 static BMOpDefine bmo_triangle_fill_def = {
 	"triangle_fill",
 	/* slots_in */
-	{{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},    /* input edges */
+	{{"use_beauty", BMO_OP_SLOT_BOOL},
+	 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},    /* input edges */
 	 {{'\0'}},
 	},
 	/* slots_out */
@@ -1536,27 +1537,6 @@ static BMOpDefine bmo_wireframe_def = {
 	0
 };
 
-/*
- * Vertex Slide.
- *
- * Translates verts along an edge
- */
-static BMOpDefine bmo_slide_vert_def = {
-	"slide_vert",
-	/* slots_in */
-	{{"vert", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE}},
-	 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
-	 {"factor", BMO_OP_SLOT_FLT},
-	 {{'\0'}},
-	},
-	/* slots_out */
-	{{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
-	 {{'\0'}},
-	},
-	bmo_slide_vert_exec,
-	BMO_OP_FLAG_UNTAN_MULTIRES
-};
-
 #ifdef WITH_BULLET
 /*
  * Convex Hull
@@ -1676,7 +1656,6 @@ const BMOpDefine *bmo_opdefines[] = {
 	&bmo_similar_edges_def,
 	&bmo_similar_faces_def,
 	&bmo_similar_verts_def,
-	&bmo_slide_vert_def,
 	&bmo_smooth_vert_def,
 	&bmo_smooth_laplacian_vert_def,
 	&bmo_solidify_def,
diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h
index b8fbfbe..fd6571d 100644
--- a/source/blender/bmesh/intern/bmesh_operator_api.h
+++ b/source/blender/bmesh/intern/bmesh_operator_api.h
@@ -244,19 +244,19 @@ void BMO_push(BMesh *bm, BMOperator *op);
 void BMO_pop(BMesh *bm);
 
 /*executes an operator*/
-int BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...);
+bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...);
 
 /* initializes, but doesn't execute an operator.  this is so you can
  * gain access to the outputs of the operator.  note that you have
  * to execute/finish (BMO_op_exec and BMO_op_finish) yourself. */
-int BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...);
+bool BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...);
 
 /* va_list version, used to implement the above two functions,
  * plus EDBM_op_callf in editmesh_utils.c. */
-int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, va_list vlist);
+bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, va_list vlist);
 
 /* test whether a named slot exists */
-int BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
+bool BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
 
 /* get a pointer to a slot.  this may be removed layer on from the public API. */
 BMOpSlot *BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
@@ -301,8 +301,8 @@ void  BMO_slot_float_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_
 float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
 void  BMO_slot_int_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int i);
 int   BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
-void  BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int i);
-int   BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
+void  BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const bool i);
+bool  BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
 void *BMO_slot_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int *len);
 
 
@@ -360,11 +360,11 @@ void BMO_slot_buffer_flag_disable(BMesh *bm,
 /* tool-flags all elements inside an element slot array with flag flag. */
 void BMO_slot_buffer_hflag_enable(BMesh *bm,
                                   BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
-                                  const char htype, const char hflag, const char do_flush);
+                                  const char htype, const char hflag, const bool do_flush);
 /* clears tool-flag flag from all elements inside a slot array. */
 void BMO_slot_buffer_hflag_disable(BMesh *bm,
                                    BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
-                                   const char htype, const char hflag, const char do_flush);
+                                   const char htype, const char hflag, const bool do_flush);
 
 /* puts every element of type 'type' (which is a bitmask) with header
  * flag 'flag', into a slot.  note: ignores hidden elements
diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.h b/source/blender/bmesh/intern/bmesh_operator_api_inline.h
index ad11601..053d703 100644
--- a/source/blender/bmesh/intern/bmesh_operator_api_inline.h
+++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.h
@@ -80,7 +80,7 @@ BLI_INLINE void BMO_slot_map_bool_insert(BMOperator *op, BMOpSlot *slot,
                                         void *element, const int val)
 {
 	BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_BOOL);
-	BLI_assert(val == FALSE || val == TRUE);
+	BLI_assert(val == false || val == true);
 	BMO_slot_map_insert(op, slot, element, &val, sizeof(int));
 }
 
@@ -173,16 +173,16 @@ BLI_INLINE int BMO_slot_map_int_get(BMOpSlot *slot, const void *element)
 	return 0;
 }
 
-BLI_INLINE int BMO_slot_map_bool_get(BMOpSlot *slot, const void *element)
+BLI_INLINE bool BMO_slot_map_bool_get(BMOpSlot *slot, const void *element)
 {
 	int *val;
 	BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_BOOL);
 
 	val = (int *) BMO_slot_map_data_get(slot, element);
-	BLI_assert(val == NULL || *val == FALSE || *val == TRUE);
-	if (val) return *val;
+	BLI_assert(val == NULL || *val == false || *val == true);
+	if (val) return (bool)*val;
 
-	return 0;
+	return false;
 }
 
 BLI_INLINE void *BMO_slot_map_ptr_get(BMOpSlot *slot, const void *element)
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index fbf51b7..00f8dbe 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -238,7 +238,7 @@ void BMO_op_finish(BMesh *bm, BMOperator *op)
  *
  * \return Success if the slot if found.
  */
-int BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
+bool BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
 {
 	int slot_code = bmo_name_to_slotcode(slot_args, identifier);
 	return (slot_code >= 0);
@@ -390,7 +390,7 @@ void BMO_slot_int_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_nam
 	slot->data.i = i;
 }
 
-void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int i)
+void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const bool i)
 {
 	BMOpSlot *slot = BMO_slot_get(slot_args, slot_name);
 	BLI_assert(slot->slot_type == BMO_OP_SLOT_BOOL);
@@ -495,7 +495,7 @@ int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name
 	return slot->data.i;
 }
 
-int BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
+bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
 {
 	BMOpSlot *slot = BMO_slot_get(slot_args, slot_name);
 	BLI_assert(slot->slot_type == BMO_OP_SLOT_BOOL);
@@ -549,7 +549,7 @@ void BMO_slot_vec_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_nam
  */
 
 static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag,
-                               const short test_for_enabled)
+                               const bool test_for_enabled)
 {
 	const char iter_types[3] = {BM_VERTS_OF_MESH,
 	                            BM_EDGES_OF_MESH,
@@ -562,7 +562,7 @@ static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag,
 	BMElemF *ele_f;
 	int i;
 
-	BLI_assert(ELEM(TRUE, FALSE, test_for_enabled));
+	BLI_assert((unsigned int)test_for_enabled <= 1);
 
 	for (i = 0; i < 3; i++) {
 		if (htype & flag_types[i]) {
@@ -579,12 +579,12 @@ static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag,
 
 int BMO_mesh_enabled_flag_count(BMesh *bm, const char htype, const short oflag)
 {
-	return bmo_mesh_flag_count(bm, htype, oflag, TRUE);
+	return bmo_mesh_flag_count(bm, htype, oflag, true);
 }
 
 int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag)
 {
-	return bmo_mesh_flag_count(bm, htype, oflag, FALSE);
+	return bmo_mesh_flag_count(bm, htype, oflag, false);
 }
 
 void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *UNUSED(op), const char htype, const short oflag)
@@ -595,13 +595,13 @@ void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *UNUSED(op), const char hty
 
 	const char flag_types[3] = {BM_VERT, BM_EDGE, BM_FACE};
 
-	BMIter iter;
 	BMElemF *ele;
 	int i;
 
 #pragma omp parallel for schedule(dynamic) if (bm->totvert + bm->totedge + bm->totface >= BM_OMP_LIMIT)
 	for (i = 0; i < 3; i++) {
 		if (htype & flag_types[i]) {
+			BMIter iter;
 			BM_ITER_MESH (ele, &iter, bm, iter_types[i]) {
 				BMO_elem_flag_disable(bm, ele, oflag);
 			}
@@ -795,14 +795,12 @@ void BMO_slot_buffer_from_all(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_
  */
 static void bmo_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
                                        const char htype, const char hflag,
-                                       const short test_for_enabled)
+                                       const bool test_for_enabled)
 {
 	BMOpSlot *output = BMO_slot_get(slot_args, slot_name);
 	int totelement = 0, i = 0;
 	const int respecthide = (op->flag & BMO_FLAG_RESPECT_HIDE) != 0;
 
-	BLI_assert(ELEM(test_for_enabled, TRUE, FALSE));
-
 	if (test_for_enabled)
 		totelement = BM_mesh_elem_hflag_count_enabled(bm, htype, hflag, respecthide);
 	else
@@ -858,14 +856,14 @@ void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op,
                                         BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
                                         const char htype, const char hflag)
 {
-	bmo_slot_buffer_from_hflag(bm, op, slot_args, slot_name, htype, hflag, TRUE);
+	bmo_slot_buffer_from_hflag(bm, op, slot_args, slot_name, htype, hflag, true);
 }
 
 void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op,
                                          BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
                                          const char htype, const char hflag)
 {
-	bmo_slot_buffer_from_hflag(bm, op, slot_args, slot_name, htype, hflag, FALSE);
+	bmo_slot_buffer_from_hflag(bm, op, slot_args, slot_name, htype, hflag, false);
 }
 
 void BMO_slot_buffer_from_single(BMOperator *op, BMOpSlot *slot, BMHeader *ele)
@@ -934,13 +932,13 @@ void _bmo_slot_buffer_append(BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS], const cha
 static void bmo_slot_buffer_from_flag(BMesh *bm, BMOperator *op,
                                       BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
                                       const char htype, const short oflag,
-                                      const short test_for_enabled)
+                                      const bool test_for_enabled)
 {
 	BMOpSlot *slot = BMO_slot_get(slot_args, slot_name);
 	int totelement, i = 0;
 
 	BLI_assert(op->slots_in == slot_args || op->slots_out == slot_args);
-	BLI_assert(ELEM(TRUE, FALSE, test_for_enabled));
+	BLI_assert((unsigned int)test_for_enabled <= 1);
 
 	if (test_for_enabled)
 		totelement = BMO_mesh_enabled_flag_count(bm, htype, oflag);
@@ -997,14 +995,14 @@ void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op,
                                        BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
                                        const char htype, const short oflag)
 {
-	bmo_slot_buffer_from_flag(bm, op, slot_args, slot_name, htype, oflag, TRUE);
+	bmo_slot_buffer_from_flag(bm, op, slot_args, slot_name, htype, oflag, true);
 }
 
 void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op,
                                         BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
                                         const char htype, const short oflag)
 {
-	bmo_slot_buffer_from_flag(bm, op, slot_args, slot_name, htype, oflag, FALSE);
+	bmo_slot_buffer_from_flag(bm, op, slot_args, slot_name, htype, oflag, false);
 }
 
 /**
@@ -1015,13 +1013,13 @@ void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op,
  */
 void BMO_slot_buffer_hflag_enable(BMesh *bm,
                                   BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
-                                  const char htype, const char hflag, const char do_flush)
+                                  const char htype, const char hflag, const bool do_flush)
 {
 	BMOpSlot *slot = BMO_slot_get(slot_args, slot_name);
 	BMElem **data =  (BMElem **)slot->data.buf;
 	int i;
-	const char do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT));
-	const char do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN));
+	const bool do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT));
+	const bool do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN));
 
 	BLI_assert(slot->slot_type == BMO_OP_SLOT_ELEMENT_BUF);
 	BLI_assert(((slot->slot_subtype.elem & BM_ALL_NOLOOP) & htype) == htype);
@@ -1031,11 +1029,11 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm,
 			continue;
 
 		if (do_flush_select) {
-			BM_elem_select_set(bm, *data, TRUE);
+			BM_elem_select_set(bm, *data, true);
 		}
 
 		if (do_flush_hide) {
-			BM_elem_hide_set(bm, *data, FALSE);
+			BM_elem_hide_set(bm, *data, false);
 		}
 
 		BM_elem_flag_enable(*data, hflag);
@@ -1050,13 +1048,13 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm,
  */
 void BMO_slot_buffer_hflag_disable(BMesh *bm,
                                    BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name,
-                                   const char htype, const char hflag, const char do_flush)
+                                   const char htype, const char hflag, const bool do_flush)
 {
 	BMOpSlot *slot = BMO_slot_get(slot_args, slot_name);
 	BMElem **data =  (BMElem **)slot->data.buf;
 	int i;
-	const char do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT));
-	const char do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN));
+	const bool do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT));
+	const bool do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN));
 
 	BLI_assert(slot->slot_type == BMO_OP_SLOT_ELEMENT_BUF);
 	BLI_assert(((slot->slot_subtype.elem & BM_ALL_NOLOOP) & htype) == htype);
@@ -1066,11 +1064,11 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm,
 			continue;
 
 		if (do_flush_select) {
-			BM_elem_select_set(bm, *data, FALSE);
+			BM_elem_select_set(bm, *data, false);
 		}
 
 		if (do_flush_hide) {
-			BM_elem_hide_set(bm, *data, FALSE);
+			BM_elem_hide_set(bm, *data, false);
 		}
 
 		BM_elem_flag_disable(*data, hflag);
@@ -1482,7 +1480,7 @@ void BMO_error_raise(BMesh *bm, BMOperator *owner, int errcode, const char *msg)
 	BLI_addhead(&bm->errorstack, err);
 }
 
-int BMO_error_occurred(BMesh *bm)
+bool BMO_error_occurred(BMesh *bm)
 {
 	return bm->errorstack.first != NULL;
 }
@@ -1588,7 +1586,7 @@ static int bmo_opname_to_opcode(const char *opname)
  * **Utility**
  *
  * Pass an existing slot which is copied to either an input or output slot.
- * Taking the operator and slot-name pair of args.
+ * Taking the operator and slot-name pair of args (BMOperator *, const char *).
  * - `s` - slot_in (lower case)
  * - `S` - slot_out (upper case)
  *
@@ -1616,7 +1614,7 @@ static int bmo_opname_to_opcode(const char *opname)
  * Order is not important so `Hfev` is also valid (all unflagged verts, edges and faces).
  */
 
-int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, va_list vlist)
+bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, va_list vlist)
 {
 //	BMOpDefine *def;
 	char *opname, *ofmt, *fmt;
@@ -1653,7 +1651,7 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, v
 
 	if (i == -1) {
 		MEM_freeN(ofmt);
-		return FALSE;
+		return false;
 	}
 
 	BMO_op_init(bm, op, flag, opname);
@@ -1816,7 +1814,7 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, v
 	}
 
 	MEM_freeN(ofmt);
-	return TRUE;
+	return true;
 error:
 
 	/* non urgent todo - explain exactly what is failing */
@@ -1841,14 +1839,14 @@ error:
 	MEM_freeN(ofmt);
 
 	BMO_op_finish(bm, op);
-	return FALSE;
+	return false;
 
 #undef GOTO_ERROR
 
 }
 
 
-int BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...)
+bool BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...)
 {
 	va_list list;
 
@@ -1856,14 +1854,14 @@ int BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...
 	if (!BMO_op_vinitf(bm, op, flag, fmt, list)) {
 		printf("%s: failed\n", __func__);
 		va_end(list);
-		return FALSE;
+		return false;
 	}
 	va_end(list);
 
-	return TRUE;
+	return true;
 }
 
-int BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...)
+bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...)
 {
 	va_list list;
 	BMOperator op;
@@ -1872,12 +1870,12 @@ int BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...)
 	if (!BMO_op_vinitf(bm, &op, flag, fmt, list)) {
 		printf("%s: failed, format is:\n    \"%s\"\n", __func__, fmt);
 		va_end(list);
-		return FALSE;
+		return false;
 	}
 
 	BMO_op_exec(bm, &op);
 	BMO_op_finish(bm, &op);
 
 	va_end(list);
-	return TRUE;
+	return true;
 }
diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h
index 9175af1..ea9ad2e 100644
--- a/source/blender/bmesh/intern/bmesh_operators_private.h
+++ b/source/blender/bmesh/intern/bmesh_operators_private.h
@@ -89,7 +89,6 @@ void bmo_shortest_path_exec(BMesh *bm, BMOperator *op);
 void bmo_similar_edges_exec(BMesh *bm, BMOperator *op);
 void bmo_similar_faces_exec(BMesh *bm, BMOperator *op);
 void bmo_similar_verts_exec(BMesh *bm, BMOperator *op);
-void bmo_slide_vert_exec(BMesh *bm, BMOperator *op);
 void bmo_smooth_vert_exec(BMesh *bm, BMOperator *op);
 void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op);
 void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op);
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 4545c9b..9592c34 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -50,7 +50,7 @@
  * Used for tessellator
  */
 
-static short testedgesidef(const float v1[2], const float v2[2], const float v3[2])
+static bool testedgesidef(const float v1[2], const float v2[2], const float v3[2])
 {
 	/* is v3 to the right of v1 - v2 ? With exception: v3 == v1 || v3 == v2 */
 	double inp;
@@ -59,13 +59,13 @@ static short testedgesidef(const float v1[2], const float v2[2], const float v3[
 	inp = (v2[0] - v1[0]) * (v1[1] - v3[1]) + (v1[1] - v2[1]) * (v1[0] - v3[0]);
 
 	if (inp < 0.0) {
-		return FALSE;
+		return false;
 	}
 	else if (inp == 0) {
-		if (v1[0] == v3[0] && v1[1] == v3[1]) return FALSE;
-		if (v2[0] == v3[0] && v2[1] == v3[1]) return FALSE;
+		if (v1[0] == v3[0] && v1[1] == v3[1]) return false;
+		if (v2[0] == v3[0] && v2[1] == v3[1]) return false;
 	}
-	return TRUE;
+	return true;
 }
 
 /**
@@ -297,7 +297,6 @@ static void scale_edge_v3f(float v1[3], float v2[3], const float fac)
 	add_v3_v3v3(v2, v2, mid);
 }
 
-
 /**
  * \brief POLY ROTATE PLANE
  *
@@ -306,30 +305,14 @@ static void scale_edge_v3f(float v1[3], float v2[3], const float fac)
  */
 void poly_rotate_plane(const float normal[3], float (*verts)[3], const int nverts)
 {
-
-	float up[3] = {0.0f, 0.0f, 1.0f}, axis[3], q[4];
 	float mat[3][3];
-	float angle;
-	int i;
-
-	cross_v3_v3v3(axis, normal, up);
 
-	angle = saacos(dot_v3v3(normal, up));
-
-	if (angle < FLT_EPSILON)
-		return;
-
-	if (len_v3(axis) < FLT_EPSILON) {
-		axis[0] = 0.0f;
-		axis[1] = 1.0f;
-		axis[2] = 0.0f;
+	if (axis_dominant_v3_to_m3(mat, normal)) {
+		int i;
+		for (i = 0; i < nverts; i++) {
+			mul_m3_v3(mat, verts[i]);
+		}
 	}
-
-	axis_angle_to_quat(q, axis, angle);
-	quat_to_mat3(mat, q);
-
-	for (i = 0; i < nverts; i++)
-		mul_m3_v3(mat, verts[i]);
 }
 
 /**
@@ -498,7 +481,7 @@ void BM_face_normal_flip(BMesh *bm, BMFace *f)
 
 /* detects if two line segments cross each other (intersects).
  * note, there could be more winding cases then there needs to be. */
-static int line_crosses_v2f(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
+static bool line_crosses_v2f(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
 {
 
 #define GETMIN2_AXIS(a, b, ma, mb, axis)   \
@@ -526,7 +509,7 @@ static int line_crosses_v2f(const float v1[2], const float v2[2], const float v3
 	w5 = !testedgesidef(v3, v1, v4);
 	
 	if (w1 == w2 && w2 == w3 && w3 == w4 && w4 == w5) {
-		return TRUE;
+		return true;
 	}
 	
 	GETMIN2(v1, v2, mv1, mv2);
@@ -549,7 +532,7 @@ static int line_crosses_v2f(const float v1[2], const float v2[2], const float v3
 		return (mv4[1] >= mv1[1] && mv3[1] <= mv2[1]);
 	}
 
-	return FALSE;
+	return false;
 
 #undef GETMIN2_AXIS
 #undef GETMIN2
@@ -567,7 +550,7 @@ static int line_crosses_v2f(const float v1[2], const float v2[2], const float v3
  * instead of projecting co directly into f's orientation space,
  * so there might be accuracy issues.
  */
-int BM_face_point_inside_test(BMFace *f, const float co[3])
+bool BM_face_point_inside_test(BMFace *f, const float co[3])
 {
 	int ax, ay;
 	float co2[2], cent[2] = {0.0f, 0.0f}, out[2] = {FLT_MAX * 0.5f, FLT_MAX * 0.5f};
@@ -614,26 +597,26 @@ int BM_face_point_inside_test(BMFace *f, const float co[3])
 	return crosses % 2 != 0;
 }
 
-static int bm_face_goodline(float const (*projectverts)[3], BMFace *f, int v1i, int v2i, int v3i)
+static bool bm_face_goodline(float const (*projectverts)[2], BMFace *f, int v1i, int v2i, int v3i)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
-	float v1[3], v2[3], v3[3], pv1[3];
-	int i;
 
-	copy_v3_v3(v1, projectverts[v1i]);
-	copy_v3_v3(v2, projectverts[v2i]);
-	copy_v3_v3(v3, projectverts[v3i]);
+	float pv1[2];
+	const float *v1 = projectverts[v1i];
+	const float *v2 = projectverts[v2i];
+	const float *v3 = projectverts[v3i];
+	int i;
 
 	/* v3 must be on the left side of [v1, v2] line, else we know [v1, v3] is outside of f! */
 	if (testedgesidef(v1, v2, v3)) {
-		return FALSE;
+		return false;
 	}
 
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	do {
 		i = BM_elem_index_get(l_iter->v);
-		copy_v3_v3(pv1, projectverts[i]);
+		copy_v2_v2(pv1, projectverts[i]);
 
 		if (ELEM3(i, v1i, v2i, v3i)) {
 #if 0
@@ -649,23 +632,24 @@ static int bm_face_goodline(float const (*projectverts)[3], BMFace *f, int v1i,
 			else
 				printf("%d in (%d, %d, %d)\n", v1i, i, v3i, v2i);
 #endif
-			return FALSE;
+			return false;
 		}
 	} while ((l_iter = l_iter->next) != l_first);
-	return TRUE;
+	return true;
 }
 
 /**
  * \brief Find Ear
  *
  * Used by tessellator to find the next triangle to 'clip off' of a polygon while tessellating.
+ *
  * \param f The face to search.
- * \param verts an array of face vert coords.
+ * \param projectverts an array of face vert coords.
  * \param use_beauty Currently only applies to quads, can be extended later on.
  * \param abscoss Must be allocated by caller, and at least f->len length
  *        (allow to avoid allocating a new one for each tri!).
  */
-static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int use_beauty, float *abscoss)
+static BMLoop *poly_find_ear(BMFace *f, float (*projectverts)[2], const bool use_beauty, float *abscoss)
 {
 	BMLoop *bestear = NULL;
 
@@ -690,7 +674,7 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int use_beauty, floa
 		i = (((len_squared_v3v3(larr[0]->v->co, larr[2]->v->co) >
 		     len_squared_v3v3(larr[1]->v->co, larr[3]->v->co) * bias)) != use_beauty);
 		i4 = (i + 3) % 4;
-		/* Check produced tris aren’t too flat/narrow...
+		/* Check produced tris aren't too flat/narrow...
 		 * Probably not the best test, but is quite efficient and should at least avoid null-area faces! */
 		cos1 = fabsf(cos_v3v3v3(larr[i4]->v->co, larr[i]->v->co, larr[i + 1]->v->co));
 		cos2 = fabsf(cos_v3v3v3(larr[i4]->v->co, larr[i + 2]->v->co, larr[i + 1]->v->co));
@@ -711,7 +695,7 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int use_beauty, floa
 		/* Last check we do not get overlapping triangles
 		 * (as much as possible, there are some cases with no good solution!) */
 		i4 = (i + 3) % 4;
-		if (!bm_face_goodline((float const (*)[3])verts, f, BM_elem_index_get(larr[i4]->v),
+		if (!bm_face_goodline((float const (*)[2])projectverts, f, BM_elem_index_get(larr[i4]->v),
 		                      BM_elem_index_get(larr[i]->v), BM_elem_index_get(larr[i + 1]->v)))
 		{
 			i = !i;
@@ -721,77 +705,44 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int use_beauty, floa
 
 	}
 	else {
-		BMVert *v1, *v2, *v3;
-
 		/* float angle, bestangle = 180.0f; */
-		float cos, tcos, bestcos = 1.0f;
-		float *tcoss;
-		int isear, i = 0, j, len;
+		float cos, bestcos = 1.0f;
+		int i, j, len;
 
 		/* Compute cos of all corners! */
+		i = 0;
 		l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 		len = l_iter->f->len;
-		tcoss = abscoss;
 		do {
-			v1 = l_iter->prev->v;
-			v2 = l_iter->v;
-			v3 = l_iter->next->v;
+			const BMVert *v1 = l_iter->prev->v;
+			const BMVert *v2 = l_iter->v;
+			const BMVert *v3 = l_iter->next->v;
 
-			*tcoss = fabsf(cos_v3v3v3(v1->co, v2->co, v3->co));
+			abscoss[i] = fabsf(cos_v3v3v3(v1->co, v2->co, v3->co));
 /*			printf("tcoss: %f\n", *tcoss);*/
-			tcoss++;
+			i++;
 		} while ((l_iter = l_iter->next) != l_first);
 
+		i = 0;
 		l_iter = l_first;
-		tcoss = abscoss;
 		do {
-			isear = TRUE;
-
-			v1 = l_iter->prev->v;
-			v2 = l_iter->v;
-			v3 = l_iter->next->v;
+			const BMVert *v1 = l_iter->prev->v;
+			const BMVert *v2 = l_iter->v;
+			const BMVert *v3 = l_iter->next->v;
 
-			/* We may have already internal edges... */
-			if (BM_edge_exists(v1, v3)) {
-				isear = FALSE;
-			}
-			else if (!bm_face_goodline((float const (*)[3])verts, f, BM_elem_index_get(v1),
-			                           BM_elem_index_get(v2), BM_elem_index_get(v3)))
+			if (bm_face_goodline((float const (*)[2])projectverts, f,
+			                     BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3)))
 			{
-#if 0
-				printf("(%d, %d, %d) would not be a valid tri!\n",
-				       BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3));
-#endif
-				isear = FALSE;
-			}
-
-			if (isear) {
-#if 0 /* Old, already commented code */
-				/* if this code comes back, it needs to be converted to radians */
-				angle = angle_v3v3v3(verts[v1->head.eflag2], verts[v2->head.eflag2], verts[v3->head.eflag2]);
-				if (!bestear || ABS(angle - 45.0f) < bestangle) {
-					bestear = l;
-					bestangle = ABS(45.0f - angle);
-				}
-
-				if (angle > 20 && angle < 90) break;
-				if (angle < 100 && i > 5) break;
-				i += 1;
-#endif
-
 				/* Compute highest cos (i.e. narrowest angle) of this tri. */
-				cos = *tcoss;
-				tcos = fabsf(cos_v3v3v3(v2->co, v3->co, v1->co));
-				if (tcos > cos)
-					cos = tcos;
-				tcos = fabsf(cos_v3v3v3(v3->co, v1->co, v2->co));
-				if (tcos > cos)
-					cos = tcos;
+				cos = max_fff(abscoss[i],
+				              fabsf(cos_v3v3v3(v2->co, v3->co, v1->co)),
+				              fabsf(cos_v3v3v3(v3->co, v1->co, v2->co)));
 
 				/* Compare to prev best (i.e. lowest) cos. */
 				if (cos < bestcos) {
 					/* We must check this tri would not leave a (too much) degenerated remaining face! */
-					/* For now just assume if the average of cos of all "remaining face"'s corners is below a given threshold, it’s OK. */
+					/* For now just assume if the average of cos of all
+					 * "remaining face"'s corners is below a given threshold, it's OK. */
 					float avgcos = fabsf(cos_v3v3v3(v1->co, v3->co, l_iter->next->next->v->co));
 					const int i_limit = (i - 1 + len) % len;
 					avgcos += fabsf(cos_v3v3v3(l_iter->prev->prev->v->co, v1->co, v3->co));
@@ -815,7 +766,6 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int use_beauty, floa
 #endif
 				}
 			}
-			tcoss++;
 			i++;
 		} while ((l_iter = l_iter->next) != l_first);
 	}
@@ -826,120 +776,71 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int use_beauty, floa
 /**
  * \brief BMESH TRIANGULATE FACE
  *
- * --- Prev description (wasn’t correct, ear clipping was currently simply picking the first tri in the loop!)
- * Triangulates a face using a simple 'ear clipping' algorithm that tries to
- * favor non-skinny triangles (angles less than 90 degrees).
- *
- * If the triangulator has bits left over (or cannot triangulate at all)
- * it uses a simple fan triangulation,
- * --- End of prev description
- *
- * Currently tries to repeatedly find the best triangle (i.e. the most "open" one), provided it does not
+ * Currently repeatedly find the best triangle (i.e. the most "open" one), provided it does not
  * produces a "remaining" face with too much wide/narrow angles
  * (using cos (i.e. dot product of normalized vectors) of angles).
  *
- * newfaces, if non-null, must be an array of BMFace pointers,
- * with a length equal to f->len. It will be filled with the new
- * triangles, and will be NULL-terminated.
+ * \param r_faces_new if non-null, must be an array of BMFace pointers,
+ * with a length equal to (f->len - 2). It will be filled with the new
+ * triangles.
  *
- * \note newedgeflag sets a flag layer flag, obviously not the header flag.
+ * \note use_tag tags new flags and edges.
  */
-void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3], const short newedge_oflag,
-                         const short newface_oflag, BMFace **newfaces, const short use_beauty)
+void BM_face_triangulate(BMesh *bm, BMFace *f,
+                         BMFace **r_faces_new,
+                         const bool use_beauty, const bool use_tag)
 {
-	int i, done, nvert, nf_i = 0;
-	BMLoop *newl;
+	const float f_len_orig = f->len;
+	int i, nf_i = 0;
+	BMLoop *l_new;
 	BMLoop *l_iter;
 	BMLoop *l_first;
 	/* BM_face_triangulate: temp absolute cosines of face corners */
-	float *abscoss = BLI_array_alloca(abscoss, f->len);
+	float (*projectverts)[2] = BLI_array_alloca(projectverts, f_len_orig);
+	float *abscoss = BLI_array_alloca(abscoss, f_len_orig);
+	float mat[3][3];
+
+	axis_dominant_v3_to_m3(mat, f->no);
 
 	/* copy vertex coordinates to vertspace area */
 	i = 0;
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	do {
-		copy_v3_v3(projectverts[i], l_iter->v->co);
-		BM_elem_index_set(l_iter->v, i); /* set dirty! */
-		i++;
+		mul_v2_m3v3(projectverts[i], mat, l_iter->v->co);
+		BM_elem_index_set(l_iter->v, i++); /* set dirty! */
 	} while ((l_iter = l_iter->next) != l_first);
 
 	bm->elem_index_dirty |= BM_VERT; /* see above */
 
-	/* bmesh_face_normal_update(bm, f, f->no, projectverts); */
-
-	calc_poly_normal(f->no, projectverts, f->len);
-	poly_rotate_plane(f->no, projectverts, i);
-
-	nvert = f->len;
+	while (f->len > 3) {
+		l_iter = poly_find_ear(f, projectverts, use_beauty, abscoss);
 
-	/* calc_poly_plane(projectverts, i); */
-	for (i = 0; i < nvert; i++) {
-		projectverts[i][2] = 0.0f;
-	}
+		/* force triangulation - if we can't find an ear the face is degenerate */
+		if (l_iter == NULL) {
+			l_iter = BM_FACE_FIRST_LOOP(f);
+		}
 
-	done = FALSE;
-	while (!done && f->len > 3) {
-		done = TRUE;
-		l_iter = find_ear(f, projectverts, use_beauty, abscoss);
-		if (l_iter) {
-			done = FALSE;
-/*			printf("Subdividing face...\n");*/
-			f = BM_face_split(bm, l_iter->f, l_iter->prev->v, l_iter->next->v, &newl, NULL, TRUE);
-
-			if (UNLIKELY(!f)) {
-				fprintf(stderr, "%s: triangulator failed to split face! (bmesh internal error)\n", __func__);
-				break;
-			}
+/*		printf("Subdividing face...\n");*/
+		f = BM_face_split(bm, l_iter->f, l_iter->prev->v, l_iter->next->v, &l_new, NULL, true);
 
-			copy_v3_v3(f->no, l_iter->f->no);
-			BMO_elem_flag_enable(bm, newl->e, newedge_oflag);
-			BMO_elem_flag_enable(bm, f, newface_oflag);
-			
-			if (newfaces)
-				newfaces[nf_i++] = f;
+		if (UNLIKELY(!f)) {
+			fprintf(stderr, "%s: triangulator failed to split face! (bmesh internal error)\n", __func__);
+			break;
+		}
 
-#if 0
-			l = f->loopbase;
-			do {
-				if (l->v == v) {
-					f->loopbase = l;
-					break;
-				}
-				l = l->next;
-			} while (l != f->loopbase);
-#endif
+		copy_v3_v3(f->no, l_iter->f->no);
 
+		if (use_tag) {
+			BM_elem_flag_enable(l_new->e, BM_ELEM_TAG);
+			BM_elem_flag_enable(f, BM_ELEM_TAG);
 		}
-	}
-
-#if 0 /* XXX find_ear should now always return a corner, so no more need for this piece of code... */
-	if (f->len > 3) {
-		l_iter = BM_FACE_FIRST_LOOP(f);
-		while (l_iter->f->len > 3) {
-			nextloop = l_iter->next->next;
-			f = BM_face_split(bm, l_iter->f, l_iter->v, nextloop->v,
-			                  &newl, NULL, TRUE);
-			if (!f) {
-				printf("triangle fan step of triangulator failed.\n");
-
-				/* NULL-terminate */
-				if (newfaces) newfaces[nf_i] = NULL;
-				return;
-			}
 
-			if (newfaces) newfaces[nf_i++] = f;
-			
-			BMO_elem_flag_enable(bm, newl->e, newedge_oflag);
-			BMO_elem_flag_enable(bm, f, newface_oflag);
-			l_iter = nextloop;
+		if (r_faces_new) {
+			r_faces_new[nf_i++] = f;
 		}
 	}
-#endif
 
-	/* NULL-terminate */
-	if (newfaces) {
-		newfaces[nf_i] = NULL;
-	}
+	BLI_assert(f->len == 3);
 }
 
 /**
@@ -1078,3 +979,37 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
 		}
 	}
 }
+
+
+/**
+ * Small utility functions for fast access
+ *
+ * faster alternative to:
+ *  BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 3);
+ */
+void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3])
+{
+	BMLoop *l = BM_FACE_FIRST_LOOP(f);
+
+	BLI_assert(f->len == 3);
+
+	r_verts[0] = l->v; l = l->next;
+	r_verts[1] = l->v; l = l->next;
+	r_verts[2] = l->v;
+}
+
+/**
+ * faster alternative to:
+ *  BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 4);
+ */
+void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4])
+{
+	BMLoop *l = BM_FACE_FIRST_LOOP(f);
+
+	BLI_assert(f->len == 4);
+
+	r_verts[0] = l->v; l = l->next;
+	r_verts[1] = l->v; l = l->next;
+	r_verts[2] = l->v; l = l->next;
+	r_verts[3] = l->v;
+}
diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h
index e5777d3..601caae 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.h
+++ b/source/blender/bmesh/intern/bmesh_polygon.h
@@ -42,12 +42,14 @@ void  BM_vert_normal_update(BMVert *v);
 void  BM_vert_normal_update_all(BMVert *v);
 
 void  BM_face_normal_flip(BMesh *bm, BMFace *f);
-int   BM_face_point_inside_test(BMFace *f, const float co[3]);
+bool  BM_face_point_inside_test(BMFace *f, const float co[3]);
 
-void  BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
-                          const short newedge_oflag, const short newface_oflag, BMFace **newfaces,
-                          const short use_beauty);
+void  BM_face_triangulate(BMesh *bm, BMFace *f, BMFace **newfaces,
+                          const bool use_beauty, const bool use_tag);
 
 void  BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len);
 
+void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3]);
+void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4]);
+
 #endif /* __BMESH_POLYGON_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index b5b6c69..44dc483 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -43,7 +43,7 @@
  * Returns whether or not a given vertex is
  * is part of a given edge.
  */
-int BM_vert_in_edge(BMEdge *e, BMVert *v)
+bool BM_vert_in_edge(BMEdge *e, BMVert *v)
 {
 	return bmesh_vert_in_edge(e, v);
 }
@@ -208,9 +208,9 @@ BMLoop *BM_vert_find_first_loop(BMVert *v)
 }
 
 /**
- * Returns TRUE if the vertex is used in a given face.
+ * Returns true if the vertex is used in a given face.
  */
-int BM_vert_in_face(BMFace *f, BMVert *v)
+bool BM_vert_in_face(BMFace *f, BMVert *v)
 {
 	BMLoop *l_iter, *l_first;
 
@@ -226,19 +226,19 @@ int BM_vert_in_face(BMFace *f, BMVert *v)
 #endif
 		do {
 			if (l_iter->v == v) {
-				return TRUE;
+				return true;
 			}
 		} while ((l_iter = l_iter->next) != l_first);
 	}
 
-	return FALSE;
+	return false;
 }
 
 /**
  * Compares the number of vertices in an array
  * that appear in a given face
  */
-int BM_verts_in_face(BMFace *f, BMVert **varr, int len)
+int BM_verts_in_face_count(BMFace *f, BMVert **varr, int len)
 {
 	BMLoop *l_iter, *l_first;
 
@@ -278,10 +278,64 @@ int BM_verts_in_face(BMFace *f, BMVert **varr, int len)
 	return count;
 }
 
+
+/**
+ * Return true if all verts are in the face.
+ */
+bool BM_verts_in_face(BMFace *f, BMVert **varr, int len)
+{
+	BMLoop *l_iter, *l_first;
+
+#ifdef USE_BMESH_HOLES
+	BMLoopList *lst;
+#endif
+
+	int i;
+	bool ok = true;
+
+	/* simple check, we know can't succeed */
+	if (f->len < len) {
+		return false;
+	}
+
+	for (i = 0; i < len; i++) {
+		BM_ELEM_API_FLAG_ENABLE(varr[i], _FLAG_OVERLAP);
+	}
+
+#ifdef USE_BMESH_HOLES
+	for (lst = f->loops.first; lst; lst = lst->next)
+#endif
+	{
+
+#ifdef USE_BMESH_HOLES
+		l_iter = l_first = lst->first;
+#else
+		l_iter = l_first = f->l_first;
+#endif
+
+		do {
+			if (BM_ELEM_API_FLAG_TEST(l_iter->v, _FLAG_OVERLAP)) {
+				/* pass */
+			}
+			else {
+				ok = false;
+				break;
+			}
+
+		} while ((l_iter = l_iter->next) != l_first);
+	}
+
+	for (i = 0; i < len; i++) {
+		BM_ELEM_API_FLAG_DISABLE(varr[i], _FLAG_OVERLAP);
+	}
+
+	return ok;
+}
+
 /**
  * Returns whether or not a given edge is is part of a given face.
  */
-int BM_edge_in_face(BMFace *f, BMEdge *e)
+bool BM_edge_in_face(BMFace *f, BMEdge *e)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
@@ -290,17 +344,17 @@ int BM_edge_in_face(BMFace *f, BMEdge *e)
 
 	do {
 		if (l_iter->e == e) {
-			return TRUE;
+			return true;
 		}
 	} while ((l_iter = l_iter->next) != l_first);
 
-	return FALSE;
+	return false;
 }
 
 /**
  * Returns whether or not a given edge is is part of a given loop.
  */
-int BM_edge_in_loop(BMEdge *e, BMLoop *l)
+bool BM_edge_in_loop(BMEdge *e, BMLoop *l)
 {
 	return (l->e == e || l->prev->e == e);
 }
@@ -309,7 +363,7 @@ int BM_edge_in_loop(BMEdge *e, BMLoop *l)
  * Returns whether or not two vertices are in
  * a given edge
  */
-int BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e)
+bool BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e)
 {
 	return bmesh_verts_in_edge(v1, v2, e);
 }
@@ -418,7 +472,7 @@ BMLoop *BM_vert_step_fan_loop(BMLoop *l, BMEdge **e_step)
  * The function takes a vertex at the center of a fan and returns the opposite edge in the fan.
  * All edges in the fan must be manifold, otherwise return NULL.
  *
- * \note This could (probably) be done more effieiently.
+ * \note This could (probably) be done more efficiently.
  */
 BMEdge *BM_vert_other_disk_edge(BMVert *v, BMEdge *e_first)
 {
@@ -487,9 +541,9 @@ float BM_edge_calc_length_squared(BMEdge *e)
  * Utility function, since enough times we have an edge
  * and want to access 2 connected faces.
  *
- * \return TRUE when only 2 faces are found.
+ * \return true when only 2 faces are found.
  */
-int BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
+bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
 {
 	BMLoop *la, *lb;
 
@@ -500,12 +554,12 @@ int BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
 	{
 		*r_fa = la->f;
 		*r_fb = lb->f;
-		return TRUE;
+		return true;
 	}
 	else {
 		*r_fa = NULL;
 		*r_fb = NULL;
-		return FALSE;
+		return false;
 	}
 }
 
@@ -513,9 +567,9 @@ int BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
  * Utility function, since enough times we have an edge
  * and want to access 2 connected loops.
  *
- * \return TRUE when only 2 faces are found.
+ * \return true when only 2 faces are found.
  */
-int BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
+bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
 {
 	BMLoop *la, *lb;
 
@@ -526,12 +580,12 @@ int BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
 	{
 		*r_la = la;
 		*r_lb = lb;
-		return TRUE;
+		return true;
 	}
 	else {
 		*r_la = NULL;
 		*r_lb = NULL;
-		return FALSE;
+		return false;
 	}
 }
 
@@ -589,7 +643,7 @@ int BM_vert_face_count(BMVert *v)
  * Tests whether or not the vertex is part of a wire edge.
  * (ie: has no faces attached to it)
  */
-int BM_vert_is_wire(BMVert *v)
+bool BM_vert_is_wire(BMVert *v)
 {
 	if (v->e) {
 		BMEdge *e_first, *e_iter;
@@ -597,14 +651,14 @@ int BM_vert_is_wire(BMVert *v)
 		e_first = e_iter = v->e;
 		do {
 			if (e_iter->l) {
-				return FALSE;
+				return false;
 			}
 		} while ((e_iter = bmesh_disk_edge_next(e_iter, v)) != e_first);
 
-		return TRUE;
+		return true;
 	}
 	else {
-		return FALSE;
+		return false;
 	}
 }
 
@@ -612,9 +666,9 @@ int BM_vert_is_wire(BMVert *v)
  * Tests whether or not the edge is part of a wire.
  * (ie: has no faces attached to it)
  */
-int BM_edge_is_wire(BMEdge *e)
+bool BM_edge_is_wire(BMEdge *e)
 {
-	return (e->l) ? FALSE : TRUE;
+	return (e->l == NULL);
 }
 
 /**
@@ -624,7 +678,7 @@ int BM_edge_is_wire(BMEdge *e)
  * 3: Is part of a an edge with more than 2 faces.
  * 4: Is part of a wire edge.
  */
-int BM_vert_is_manifold(BMVert *v)
+bool BM_vert_is_manifold(BMVert *v)
 {
 	BMEdge *e, *oe;
 	BMLoop *l;
@@ -632,7 +686,7 @@ int BM_vert_is_manifold(BMVert *v)
 
 	if (v->e == NULL) {
 		/* loose vert */
-		return FALSE;
+		return false;
 	}
 
 	/* count edges while looking for non-manifold edges */
@@ -643,7 +697,7 @@ int BM_vert_is_manifold(BMVert *v)
 		 * edges with 1 face user are OK, otherwise we could
 		 * use BM_edge_is_manifold() here */
 		if (e->l == NULL || bmesh_radial_length(e->l) > 2) {
-			return FALSE;
+			return false;
 		}
 		len++;
 	} while ((e = bmesh_disk_edge_next(e, v)) != oe);
@@ -677,10 +731,10 @@ int BM_vert_is_manifold(BMVert *v)
 
 	if (count < len) {
 		/* vert shared by multiple regions */
-		return FALSE;
+		return false;
 	}
 
-	return TRUE;
+	return true;
 }
 
 /**
@@ -689,7 +743,7 @@ int BM_vert_is_manifold(BMVert *v)
  */
 
 #if 1 /* fast path for checking manifold */
-int BM_edge_is_manifold(BMEdge *e)
+bool BM_edge_is_manifold(BMEdge *e)
 {
 	const BMLoop *l = e->l;
 	return (l && (l->radial_next != l) &&             /* not 0 or 1 face users */
@@ -700,21 +754,34 @@ int BM_edge_is_manifold(BMEdge *e)
 {
 	int count = BM_edge_face_count(e);
 	if (count == 2) {
-		return TRUE;
+		return true;
 	}
 	else {
-		return FALSE;
+		return false;
 	}
 }
 #endif
 
 /**
+ * Tests that the edge is manifold and
+ * that both its faces point the same way.
+ */
+bool BM_edge_is_contiguous(BMEdge *e)
+{
+	const BMLoop *l = e->l;
+	const BMLoop *l_other = l->radial_next;
+	return (l && (l_other != l) &&               /* not 0 or 1 face users */
+	             (l_other->radial_next == l) &&  /* 2 face users */
+	             (l_other->v != l->v));
+}
+
+/**
  * Tests whether or not an edge is on the boundary
  * of a shell (has one face associated with it)
  */
 
 #if 1 /* fast path for checking boundary */
-int BM_edge_is_boundary(BMEdge *e)
+bool BM_edge_is_boundary(BMEdge *e)
 {
 	const BMLoop *l = e->l;
 	return (l && (l->radial_next == l));
@@ -724,10 +791,10 @@ int BM_edge_is_boundary(BMEdge *e)
 {
 	int count = BM_edge_face_count(e);
 	if (count == 1) {
-		return TRUE;
+		return true;
 	}
 	else {
-		return FALSE;
+		return false;
 	}
 }
 #endif
@@ -757,7 +824,7 @@ int BM_face_share_face_count(BMFace *f1, BMFace *f2)
 /**
  * same as #BM_face_share_face_count but returns a bool
  */
-int BM_face_share_face_check(BMFace *f1, BMFace *f2)
+bool BM_face_share_face_check(BMFace *f1, BMFace *f2)
 {
 	BMIter iter1, iter2;
 	BMEdge *e;
@@ -766,11 +833,11 @@ int BM_face_share_face_check(BMFace *f1, BMFace *f2)
 	BM_ITER_ELEM (e, &iter1, f1, BM_EDGES_OF_FACE) {
 		BM_ITER_ELEM (f, &iter2, e, BM_FACES_OF_EDGE) {
 			if (f != f1 && f != f2 && BM_face_share_edge_check(f, f2))
-				return TRUE;
+				return true;
 		}
 	}
 
-	return FALSE;
+	return false;
 }
 
 /**
@@ -793,9 +860,9 @@ int BM_face_share_edge_count(BMFace *f1, BMFace *f2)
 }
 
 /**
- *  Returns TRUE if the faces share an edge
+ *  Returns true if the faces share an edge
  */
-int BM_face_share_edge_check(BMFace *f1, BMFace *f2)
+bool BM_face_share_edge_check(BMFace *f1, BMFace *f2)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
@@ -803,17 +870,17 @@ int BM_face_share_edge_check(BMFace *f1, BMFace *f2)
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f1);
 	do {
 		if (bmesh_radial_face_find(l_iter->e, f2)) {
-			return TRUE;
+			return true;
 		}
 	} while ((l_iter = l_iter->next) != l_first);
 
-	return FALSE;
+	return false;
 }
 
 /**
- *	Test if e1 shares any faces with e2
+ * Test if e1 shares any faces with e2
  */
-int BM_edge_share_face_check(BMEdge *e1, BMEdge *e2)
+bool BM_edge_share_face_check(BMEdge *e1, BMEdge *e2)
 {
 	BMLoop *l;
 	BMFace *f;
@@ -823,18 +890,18 @@ int BM_edge_share_face_check(BMEdge *e1, BMEdge *e2)
 		do {
 			f = l->f;
 			if (bmesh_radial_face_find(e2, f)) {
-				return TRUE;
+				return true;
 			}
 			l = l->radial_next;
 		} while (l != e1->l);
 	}
-	return FALSE;
+	return false;
 }
 
 /**
  *	Test if e1 shares any quad faces with e2
  */
-int BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2)
+bool BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2)
 {
 	BMLoop *l;
 	BMFace *f;
@@ -845,19 +912,19 @@ int BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2)
 			f = l->f;
 			if (f->len == 4) {
 				if (bmesh_radial_face_find(e2, f)) {
-					return TRUE;
+					return true;
 				}
 			}
 			l = l->radial_next;
 		} while (l != e1->l);
 	}
-	return FALSE;
+	return false;
 }
 
 /**
  *	Tests to see if e1 shares a vertex with e2
  */
-int BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2)
+bool BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2)
 {
 	return (e1->v1 == e2->v1 ||
 	        e1->v1 == e2->v2 ||
@@ -953,6 +1020,22 @@ void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
 }
 
 /**
+ * Check if the loop is convex or concave
+ * (depends on face normal)
+ */
+bool BM_loop_is_convex(BMLoop *l)
+{
+	float e_dir_prev[3];
+	float e_dir_next[3];
+	float l_no[3];
+
+	sub_v3_v3v3(e_dir_prev, l->prev->v->co, l->v->co);
+	sub_v3_v3v3(e_dir_next, l->next->v->co, l->v->co);
+	cross_v3_v3v3(l_no, e_dir_next, e_dir_prev);
+	return dot_v3v3(l_no, l->f->no) > 0.0f;
+}
+
+/**
  * Calculates the angle between the previous and next loops
  * (angle at this loops face corner).
  *
@@ -980,7 +1063,7 @@ void BM_loop_calc_face_normal(BMLoop *l, float r_normal[3])
 	                  l->v->co,
 	                  l->next->v->co) != 0.0f)
 	{
-		return;
+		/* pass */
 	}
 	else {
 		copy_v3_v3(r_normal, l->f->no);
@@ -988,6 +1071,29 @@ void BM_loop_calc_face_normal(BMLoop *l, float r_normal[3])
 }
 
 /**
+ * \brief BM_loop_calc_face_direction
+ *
+ * Calculate the direction a loop is pointing.
+ *
+ * \param l The loop to calculate the direction at
+ * \param r_dir Resulting direction
+ */
+void BM_loop_calc_face_direction(BMLoop *l, float r_dir[3])
+{
+	float v_prev[3];
+	float v_next[3];
+
+	sub_v3_v3v3(v_prev, l->v->co, l->prev->v->co);
+	sub_v3_v3v3(v_next, l->next->v->co, l->v->co);
+
+	normalize_v3(v_prev);
+	normalize_v3(v_next);
+
+	add_v3_v3v3(r_dir, v_prev, v_next);
+	normalize_v3(r_dir);
+}
+
+/**
  * \brief BM_loop_calc_face_tangent
  *
  * Calculate the tangent at this loop corner or fallback to the face normal on straight lines.
@@ -1000,23 +1106,27 @@ void BM_loop_calc_face_tangent(BMLoop *l, float r_tangent[3])
 {
 	float v_prev[3];
 	float v_next[3];
+	float dir[3];
 
 	sub_v3_v3v3(v_prev, l->prev->v->co, l->v->co);
 	sub_v3_v3v3(v_next, l->v->co, l->next->v->co);
 
 	normalize_v3(v_prev);
 	normalize_v3(v_next);
+	add_v3_v3v3(dir, v_prev, v_next);
 
-	if (compare_v3v3(v_prev, v_next, FLT_EPSILON) == FALSE) {
-		float dir[3];
+	if (compare_v3v3(v_prev, v_next, FLT_EPSILON * 10.0f) == false) {
 		float nor[3]; /* for this purpose doesn't need to be normalized */
-		add_v3_v3v3(dir, v_prev, v_next);
 		cross_v3_v3v3(nor, v_prev, v_next);
+		/* concave face check */
+		if (UNLIKELY(dot_v3v3(nor, l->f->no) < 0.0f)) {
+			negate_v3(nor);
+		}
 		cross_v3_v3v3(r_tangent, dir, nor);
 	}
 	else {
 		/* prev/next are the same - compare with face normal since we don't have one */
-		cross_v3_v3v3(r_tangent, v_next, l->f->no);
+		cross_v3_v3v3(r_tangent, dir, l->f->no);
 	}
 
 	normalize_v3(r_tangent);
@@ -1273,67 +1383,94 @@ BMEdge *BM_edge_find_double(BMEdge *e)
 }
 
 /**
- * Given a set of vertices \a varr, find out if
- * all those vertices overlap an existing face.
- *
- * \note Making a face here is valid but in some cases you wont want to
- * make a face thats part of another.
- *
- * \returns TRUE for overlap
+ * Given a set of vertices (varr), find out if
+ * there is a face with exactly those vertices
+ * (and only those vertices).
  *
+ * \note there used to be a BM_face_exists_overlap function that checked for partial overlap,
+ * however this is no longer used, simple to add back.
  */
-int BM_face_exists_overlap(BMVert **varr, int len, BMFace **r_overlapface)
+bool BM_face_exists(BMVert **varr, int len, BMFace **r_existface)
 {
+	BMVert *v_search = varr[0];  /* we can search any of the verts in the array */
 	BMIter viter;
 	BMFace *f;
-	int i, amount;
 
-	for (i = 0; i < len; i++) {
-		BM_ITER_ELEM (f, &viter, varr[i], BM_FACES_OF_VERT) {
-			amount = BM_verts_in_face(f, varr, len);
-			if (amount >= len) {
-				if (r_overlapface) {
-					*r_overlapface = f;
+
+#if 0
+	BM_ITER_ELEM (f, &viter, v_search, BM_FACES_OF_VERT) {
+		if (f->len == len) {
+			if (BM_verts_in_face(f, varr, len)) {
+				if (r_existface) {
+					*r_existface = f;
 				}
-				return TRUE;
+				return true;
 			}
 		}
 	}
 
-	if (r_overlapface) {
-		*r_overlapface = NULL;
+	if (r_existface) {
+		*r_existface = NULL;
 	}
+	return false;
 
-	return FALSE;
-}
+#else
 
-/**
- * Given a set of vertices (varr), find out if
- * there is a face with exactly those vertices
- * (and only those vertices).
- */
-int BM_face_exists(BMVert **varr, int len, BMFace **r_existface)
-{
-	BMIter viter;
-	BMFace *f;
-	int i, amount;
+	/* faster to do the flagging once, and inline */
+	bool is_init = false;
+	bool is_found = false;
+	int i;
 
-	for (i = 0; i < len; i++) {
-		BM_ITER_ELEM (f, &viter, varr[i], BM_FACES_OF_VERT) {
-			amount = BM_verts_in_face(f, varr, len);
-			if (amount == len && amount == f->len) {
+
+	BM_ITER_ELEM (f, &viter, v_search, BM_FACES_OF_VERT) {
+		if (f->len == len) {
+			if (is_init == false) {
+				is_init = true;
+				for (i = 0; i < len; i++) {
+					BLI_assert(!BM_ELEM_API_FLAG_TEST(varr[i], _FLAG_OVERLAP));
+					BM_ELEM_API_FLAG_ENABLE(varr[i], _FLAG_OVERLAP);
+				}
+			}
+
+			is_found = true;
+
+			{
+				BMLoop *l_iter;
+				BMLoop *l_first;
+
+				l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+
+				do {
+					if (!BM_ELEM_API_FLAG_TEST(l_iter->v, _FLAG_OVERLAP)) {
+						is_found = false;
+						break;
+					}
+				} while ((l_iter = l_iter->next) != l_first);
+			}
+
+			if (is_found) {
 				if (r_existface) {
 					*r_existface = f;
 				}
-				return TRUE;
+				break;
 			}
 		}
 	}
 
-	if (r_existface) {
-		*r_existface = NULL;
+	if (is_found == false) {
+		if (r_existface) {
+			*r_existface = NULL;
+		}
 	}
-	return FALSE;
+
+	if (is_init == true) {
+		for (i = 0; i < len; i++) {
+			BM_ELEM_API_FLAG_DISABLE(varr[i], _FLAG_OVERLAP);
+		}
+	}
+
+	return is_found;
+#endif
 }
 
 
@@ -1349,12 +1486,12 @@ int BM_face_exists(BMVert **varr, int len, BMFace **r_existface)
  *
  * \a earr and \a varr can be in any order, however they _must_ form a closed loop.
  */
-int BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len)
+bool BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len)
 {
 	BMFace *f;
 	BMEdge *e;
 	BMVert *v;
-	int ok;
+	bool ok;
 	int tot_tag;
 
 	BMIter fiter;
@@ -1394,10 +1531,10 @@ int BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len)
 	for (i = 0; i < len; i++) {
 		BM_ITER_ELEM (f, &fiter, earr[i], BM_FACES_OF_EDGE) {
 			if (!BM_elem_flag_test(f, BM_ELEM_INTERNAL_TAG)) {
-				ok = TRUE;
+				ok = true;
 				BM_ITER_ELEM (v, &viter, f, BM_VERTS_OF_FACE) {
 					if (!BM_elem_flag_test(v, BM_ELEM_INTERNAL_TAG)) {
-						ok = FALSE;
+						ok = false;
 						break;
 					}
 				}
@@ -1416,20 +1553,20 @@ int BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len)
 
 	if (tot_tag == 0) {
 		/* no faces use only boundary verts, quit early */
-		return FALSE;
+		return false;
 	}
 
 	/* 2) loop over non-boundary edges that use boundary verts,
 	 *    check each have 2 tagges faces connected (faces that only use 'varr' verts) */
-	ok = TRUE;
+	ok = true;
 	for (i = 0; i < len; i++) {
 		BM_ITER_ELEM (e, &fiter, varr[i], BM_EDGES_OF_VERT) {
 
 			if (/* non-boundary edge */
-			    BM_elem_flag_test(e, BM_ELEM_INTERNAL_TAG) == FALSE &&
+			    BM_elem_flag_test(e, BM_ELEM_INTERNAL_TAG) == false &&
 			    /* ...using boundary verts */
-			    BM_elem_flag_test(e->v1, BM_ELEM_INTERNAL_TAG) == TRUE &&
-			    BM_elem_flag_test(e->v2, BM_ELEM_INTERNAL_TAG) == TRUE)
+			    BM_elem_flag_test(e->v1, BM_ELEM_INTERNAL_TAG) == true &&
+			    BM_elem_flag_test(e->v2, BM_ELEM_INTERNAL_TAG) == true)
 			{
 				int tot_face_tag = 0;
 				BM_ITER_ELEM (f, &fiter, e, BM_FACES_OF_EDGE) {
@@ -1439,14 +1576,14 @@ int BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len)
 				}
 
 				if (tot_face_tag != 2) {
-					ok = FALSE;
+					ok = false;
 					break;
 				}
 
 			}
 		}
 
-		if (ok == FALSE) {
+		if (ok == false) {
 			break;
 		}
 	}
@@ -1455,25 +1592,25 @@ int BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len)
 }
 
 /* same as 'BM_face_exists_multi' but built vert array from edges */
-int BM_face_exists_multi_edge(BMEdge **earr, int len)
+bool BM_face_exists_multi_edge(BMEdge **earr, int len)
 {
 	BMVert **varr = BLI_array_alloca(varr, len);
 
-	int ok;
+	bool ok;
 	int i, i_next;
 
 	/* first check if verts have edges, if not we can bail out early */
-	ok = TRUE;
+	ok = true;
 	for (i = len - 1, i_next = 0; i_next < len; (i = i_next++)) {
 		if (!(varr[i] = BM_edge_share_vert(earr[i], earr[i_next]))) {
-			ok = FALSE;
+			ok = false;
 			break;
 		}
 	}
 
-	if (ok == FALSE) {
+	if (ok == false) {
 		BMESH_ASSERT(0);
-		return FALSE;
+		return false;
 	}
 
 	ok = BM_face_exists_multi(varr, earr, len);
@@ -1482,13 +1619,13 @@ int BM_face_exists_multi_edge(BMEdge **earr, int len)
 }
 
 /* convenience functions for checking flags */
-int BM_edge_is_any_vert_flag_test(BMEdge *e, const char hflag)
+bool BM_edge_is_any_vert_flag_test(BMEdge *e, const char hflag)
 {
 	return (BM_elem_flag_test(e->v1, hflag) ||
 	        BM_elem_flag_test(e->v2, hflag));
 }
 
-int BM_face_is_any_vert_flag_test(BMFace *f, const char hflag)
+bool BM_face_is_any_vert_flag_test(BMFace *f, const char hflag)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
@@ -1496,13 +1633,13 @@ int BM_face_is_any_vert_flag_test(BMFace *f, const char hflag)
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	do {
 		if (BM_elem_flag_test(l_iter->v, hflag)) {
-			return TRUE;
+			return true;
 		}
 	} while ((l_iter = l_iter->next) != l_first);
-	return FALSE;
+	return false;
 }
 
-int BM_face_is_any_edge_flag_test(BMFace *f, const char hflag)
+bool BM_face_is_any_edge_flag_test(BMFace *f, const char hflag)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
@@ -1510,8 +1647,8 @@ int BM_face_is_any_edge_flag_test(BMFace *f, const char hflag)
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	do {
 		if (BM_elem_flag_test(l_iter->e, hflag)) {
-			return TRUE;
+			return true;
 		}
 	} while ((l_iter = l_iter->next) != l_first);
-	return FALSE;
+	return false;
 }
diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h
index a9d6719..7cb5749 100644
--- a/source/blender/bmesh/intern/bmesh_queries.h
+++ b/source/blender/bmesh/intern/bmesh_queries.h
@@ -27,19 +27,20 @@
  *  \ingroup bmesh
  */
 
-int     BM_vert_in_face(BMFace *f, BMVert *v);
-int     BM_verts_in_face(BMFace *f, BMVert **varr, int len);
+bool    BM_vert_in_face(BMFace *f, BMVert *v);
+int     BM_verts_in_face_count(BMFace *f, BMVert **varr, int len);
+bool    BM_verts_in_face(BMFace *f, BMVert **varr, int len);
 
-int     BM_edge_in_face(BMFace *f, BMEdge *e);
-int     BM_edge_in_loop(BMEdge *e, BMLoop *l);
+bool    BM_edge_in_face(BMFace *f, BMEdge *e);
+bool    BM_edge_in_loop(BMEdge *e, BMLoop *l);
 
-int     BM_vert_in_edge(BMEdge *e, BMVert *v);
-int     BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e);
+bool    BM_vert_in_edge(BMEdge *e, BMVert *v);
+bool    BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e);
 
 float   BM_edge_calc_length(BMEdge *e);
 float   BM_edge_calc_length_squared(BMEdge *e);
-int     BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb);
-int     BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb);
+bool    BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb);
+bool    BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb);
 BMVert *BM_edge_other_vert(BMEdge *e, BMVert *v);
 BMLoop *BM_edge_other_loop(BMEdge *e, BMLoop *l);
 BMLoop *BM_face_other_edge_loop(BMFace *f, BMEdge *e, BMVert *v);
@@ -54,15 +55,19 @@ int     BM_edge_face_count(BMEdge *e);
 int     BM_vert_face_count(BMVert *v);
 BMEdge *BM_vert_other_disk_edge(BMVert *v, BMEdge *e);
 
-int     BM_vert_is_wire(BMVert *v);
-int     BM_edge_is_wire(BMEdge *e);
+bool    BM_vert_is_wire(BMVert *v);
+bool    BM_edge_is_wire(BMEdge *e);
 
-int     BM_vert_is_manifold(BMVert *v);
-int     BM_edge_is_manifold(BMEdge *e);
-int     BM_edge_is_boundary(BMEdge *e);
+bool    BM_vert_is_manifold(BMVert *v);
+bool    BM_edge_is_manifold(BMEdge *e);
+bool    BM_edge_is_boundary(BMEdge *e);
+bool    BM_edge_is_contiguous(BMEdge *e);
+
+bool    BM_loop_is_convex(BMLoop *l);
 
 float   BM_loop_calc_face_angle(BMLoop *l);
 void    BM_loop_calc_face_normal(BMLoop *l, float r_normal[3]);
+void    BM_loop_calc_face_direction(BMLoop *l, float r_normal[3]);
 void    BM_loop_calc_face_tangent(BMLoop *l, float r_tangent[3]);
 
 float   BM_edge_calc_face_angle(BMEdge *e);
@@ -79,21 +84,19 @@ BMLoop *BM_face_find_longest_loop(BMFace *f);
 BMEdge *BM_edge_exists(BMVert *v1, BMVert *v2);
 BMEdge *BM_edge_find_double(BMEdge *e);
 
-int     BM_face_exists_overlap(BMVert **varr, int len, BMFace **r_existface);
-
-int     BM_face_exists(BMVert **varr, int len, BMFace **r_existface);
+bool    BM_face_exists(BMVert **varr, int len, BMFace **r_existface);
 
-int     BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len);
-int     BM_face_exists_multi_edge(BMEdge **earr, int len);
+bool    BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len);
+bool    BM_face_exists_multi_edge(BMEdge **earr, int len);
 
 int     BM_face_share_face_count(BMFace *f1, BMFace *f2);
 int     BM_face_share_edge_count(BMFace *f1, BMFace *f2);
 
-int     BM_face_share_face_check(BMFace *f1, BMFace *f2);
-int     BM_face_share_edge_check(BMFace *f1, BMFace *f2);
-int     BM_edge_share_face_check(BMEdge *e1, BMEdge *e2);
-int     BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2);
-int     BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2);
+bool    BM_face_share_face_check(BMFace *f1, BMFace *f2);
+bool    BM_face_share_edge_check(BMFace *f1, BMFace *f2);
+bool    BM_edge_share_face_check(BMEdge *e1, BMEdge *e2);
+bool    BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2);
+bool    BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2);
 
 BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2);
 BMLoop *BM_face_vert_share_loop(BMFace *f, BMVert *v);
@@ -103,8 +106,8 @@ void    BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2);
 void    BM_edge_ordered_verts_ex(BMEdge *edge, BMVert **r_v1, BMVert **r_v2,
                                  BMLoop *edge_loop);
 
-int BM_edge_is_any_vert_flag_test(BMEdge *e, const char hflag);
-int BM_face_is_any_vert_flag_test(BMFace *f, const char hflag);
-int BM_face_is_any_edge_flag_test(BMFace *f, const char hflag);
+bool BM_edge_is_any_vert_flag_test(BMEdge *e, const char hflag);
+bool BM_face_is_any_vert_flag_test(BMFace *f, const char hflag);
+bool BM_face_is_any_edge_flag_test(BMFace *f, const char hflag);
 
 #endif /* __BMESH_QUERIES_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c
index b58e61a..2f568a4 100644
--- a/source/blender/bmesh/intern/bmesh_structure.c
+++ b/source/blender/bmesh/intern/bmesh_structure.c
@@ -40,16 +40,16 @@
  *	MISC utility functions.
  */
 
-int bmesh_vert_in_edge(BMEdge *e, BMVert *v)
+bool bmesh_vert_in_edge(BMEdge *e, BMVert *v)
 {
-	if (e->v1 == v || e->v2 == v) return TRUE;
-	return FALSE;
+	if (e->v1 == v || e->v2 == v) return true;
+	return false;
 }
-int bmesh_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e)
+bool bmesh_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e)
 {
-	if (e->v1 == v1 && e->v2 == v2) return TRUE;
-	else if (e->v1 == v2 && e->v2 == v1) return TRUE;
-	return FALSE;
+	if (e->v1 == v1 && e->v2 == v2) return true;
+	else if (e->v1 == v2 && e->v2 == v1) return true;
+	return false;
 }
 
 BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v)
@@ -63,19 +63,19 @@ BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v)
 	return NULL;
 }
 
-int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
+bool bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
 {
 	if (e->v1 == orig) {
 		e->v1 = newv;
 		e->v1_disk_link.next = e->v1_disk_link.prev = NULL;
-		return TRUE;
+		return true;
 	}
 	else if (e->v2 == orig) {
 		e->v2 = newv;
 		e->v2_disk_link.next = e->v2_disk_link.prev = NULL;
-		return TRUE;
+		return true;
 	}
-	return FALSE;
+	return false;
 }
 
 /**
@@ -165,7 +165,7 @@ BLI_INLINE BMDiskLink *bmesh_disk_edge_link_from_vert(BMEdge *e, BMVert *v)
 	}
 }
 
-int bmesh_disk_edge_append(BMEdge *e, BMVert *v)
+void bmesh_disk_edge_append(BMEdge *e, BMVert *v)
 {
 	if (!v->e) {
 		BMDiskLink *dl1 = bmesh_disk_edge_link_from_vert(e, v);
@@ -187,8 +187,6 @@ int bmesh_disk_edge_append(BMEdge *e, BMVert *v)
 		if (dl3)
 			dl3->next = e;
 	}
-
-	return TRUE;
 }
 
 void bmesh_disk_edge_remove(BMEdge *e, BMVert *v)
@@ -280,23 +278,23 @@ int bmesh_disk_count(BMVert *v)
 	}
 }
 
-int bmesh_disk_validate(int len, BMEdge *e, BMVert *v)
+bool bmesh_disk_validate(int len, BMEdge *e, BMVert *v)
 {
 	BMEdge *e_iter;
 
 	if (!BM_vert_in_edge(e, v))
-		return FALSE;
+		return false;
 	if (bmesh_disk_count(v) != len || len == 0)
-		return FALSE;
+		return false;
 
 	e_iter = e;
 	do {
 		if (len != 1 && bmesh_disk_edge_prev(e_iter, v) == e_iter) {
-			return FALSE;
+			return false;
 		}
 	} while ((e_iter = bmesh_disk_edge_next(e_iter, v)) != e);
 
-	return TRUE;
+	return true;
 }
 
 /**
@@ -362,34 +360,34 @@ BMEdge *bmesh_disk_faceedge_find_next(BMEdge *e, BMVert *v)
 }
 
 /*****radial cycle functions, e.g. loops surrounding edges**** */
-int bmesh_radial_validate(int radlen, BMLoop *l)
+bool bmesh_radial_validate(int radlen, BMLoop *l)
 {
 	BMLoop *l_iter = l;
 	int i = 0;
 	
 	if (bmesh_radial_length(l) != radlen)
-		return FALSE;
+		return false;
 
 	do {
 		if (UNLIKELY(!l_iter)) {
 			BMESH_ASSERT(0);
-			return FALSE;
+			return false;
 		}
 		
 		if (l_iter->e != l->e)
-			return FALSE;
+			return false;
 		if (l_iter->v != l->e->v1 && l_iter->v != l->e->v2)
-			return FALSE;
+			return false;
 		
 		if (UNLIKELY(i > BM_LOOP_RADIAL_MAX)) {
 			BMESH_ASSERT(0);
-			return FALSE;
+			return false;
 		}
 		
 		i++;
 	} while ((l_iter = l_iter->radial_next) != l);
 
-	return TRUE;
+	return true;
 }
 
 /**
@@ -511,7 +509,7 @@ void bmesh_radial_append(BMEdge *e, BMLoop *l)
 	l->e = e;
 }
 
-int bmesh_radial_face_find(BMEdge *e, BMFace *f)
+bool bmesh_radial_face_find(BMEdge *e, BMFace *f)
 {
 	BMLoop *l_iter;
 	int i, len;
@@ -519,9 +517,9 @@ int bmesh_radial_face_find(BMEdge *e, BMFace *f)
 	len = bmesh_radial_length(e->l);
 	for (i = 0, l_iter = e->l; i < len; i++, l_iter = l_iter->radial_next) {
 		if (l_iter->f == f)
-			return TRUE;
+			return true;
 	}
-	return FALSE;
+	return false;
 }
 
 /**
@@ -545,7 +543,7 @@ int bmesh_radial_facevert_count(BMLoop *l, BMVert *v)
 }
 
 /*****loop cycle functions, e.g. loops surrounding a face**** */
-int bmesh_loop_validate(BMFace *f)
+bool bmesh_loop_validate(BMFace *f)
 {
 	int i;
 	int len = f->len;
@@ -554,7 +552,7 @@ int bmesh_loop_validate(BMFace *f)
 	l_first = BM_FACE_FIRST_LOOP(f);
 
 	if (l_first == NULL) {
-		return FALSE;
+		return false;
 	}
 
 	/* Validate that the face loop cycle is the length specified by f->len */
@@ -562,22 +560,22 @@ int bmesh_loop_validate(BMFace *f)
 		if ((l_iter->f != f) ||
 		    (l_iter == l_first))
 		{
-			return FALSE;
+			return false;
 		}
 	}
 	if (l_iter != l_first) {
-		return FALSE;
+		return false;
 	}
 
 	/* Validate the loop->prev links also form a cycle of length f->len */
 	for (i = 1, l_iter = l_first->prev; i < len; i++, l_iter = l_iter->prev) {
 		if (l_iter == l_first) {
-			return FALSE;
+			return false;
 		}
 	}
 	if (l_iter != l_first) {
-		return FALSE;
+		return false;
 	}
 
-	return TRUE;
+	return true;
 }
diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h
index b19df46..e67f1e4 100644
--- a/source/blender/bmesh/intern/bmesh_structure.h
+++ b/source/blender/bmesh/intern/bmesh_structure.h
@@ -42,10 +42,10 @@
 struct ListBase;
 
 /* LOOP CYCLE MANAGEMENT */
-int bmesh_loop_validate(BMFace *f);
+bool    bmesh_loop_validate(BMFace *f);
 
 /* DISK CYCLE MANAGMENT */
-int     bmesh_disk_edge_append(BMEdge *e, BMVert *v);
+void    bmesh_disk_edge_append(BMEdge *e, BMVert *v);
 void    bmesh_disk_edge_remove(BMEdge *e, BMVert *v);
 BMEdge *bmesh_disk_edge_next(BMEdge *e, BMVert *v);
 BMEdge *bmesh_disk_edge_prev(BMEdge *e, BMVert *v);
@@ -60,19 +60,19 @@ void    bmesh_radial_loop_remove(BMLoop *l, BMEdge *e);
  *      bmesh_radial_loop_next(BMLoop *l) / prev.
  * just use member access l->radial_next, l->radial_prev now */
 
-int     bmesh_radial_face_find(BMEdge *e, BMFace *f);
+bool    bmesh_radial_face_find(BMEdge *e, BMFace *f);
 int     bmesh_radial_facevert_count(BMLoop *l, BMVert *v);
 BMLoop *bmesh_radial_faceloop_find_first(BMLoop *l, BMVert *v);
 BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v);
 BMLoop *bmesh_radial_faceloop_find_vert(BMFace *f, BMVert *v);
-int     bmesh_radial_validate(int radlen, BMLoop *l);
+bool    bmesh_radial_validate(int radlen, BMLoop *l);
 
 /* EDGE UTILITIES */
-int     bmesh_vert_in_edge(BMEdge *e, BMVert *v);
-int     bmesh_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e);
-int     bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv); /*relink edge*/
+bool    bmesh_vert_in_edge(BMEdge *e, BMVert *v);
+bool    bmesh_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e);
+bool    bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv);  /* relink edge */
 BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v);
 BMEdge *bmesh_disk_edge_exists(BMVert *v1, BMVert *v2);
-int     bmesh_disk_validate(int len, BMEdge *e, BMVert *v);
+bool    bmesh_disk_validate(int len, BMEdge *e, BMVert *v);
 
 #endif /* __BMESH_STRUCTURE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_walkers.h b/source/blender/bmesh/intern/bmesh_walkers.h
index 4f81f38..8be362b 100644
--- a/source/blender/bmesh/intern/bmesh_walkers.h
+++ b/source/blender/bmesh/intern/bmesh_walkers.h
@@ -100,10 +100,9 @@ void  BMW_reset(BMWalker *walker);
  * BMFace *f;
  *
  * BMW_init(&walker, bm, BMW_ISLAND, SOME_OP_FLAG);
- * f = BMW_begin(&walker, some_start_face);
- * for (; f; f = BMW_step(&walker))
- * {
- *     //do something with f
+ *
+ * for (f = BMW_begin(&walker, some_start_face); f; f = BMW_step(&walker)) {
+ *     // do something with f
  * }
  * BMW_end(&walker);
  */
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 538a905..ac6d408 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -34,42 +34,42 @@
 #include "intern/bmesh_private.h"
 #include "intern/bmesh_walkers_private.h"
 
-static int bmw_mask_check_vert(BMWalker *walker, BMVert *v)
+static bool bmw_mask_check_vert(BMWalker *walker, BMVert *v)
 {
 	if ((walker->flag & BMW_FLAG_TEST_HIDDEN) && BM_elem_flag_test(v, BM_ELEM_HIDDEN)) {
-		return FALSE;
+		return false;
 	}
 	else if (walker->mask_vert && !BMO_elem_flag_test(walker->bm, v, walker->mask_vert)) {
-		return FALSE;
+		return false;
 	}
 	else {
-		return TRUE;
+		return true;
 	}
 }
 
-static int bmw_mask_check_edge(BMWalker *walker, BMEdge *e)
+static bool bmw_mask_check_edge(BMWalker *walker, BMEdge *e)
 {
 	if ((walker->flag & BMW_FLAG_TEST_HIDDEN) && BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
-		return FALSE;
+		return false;
 	}
 	else if (walker->mask_edge && !BMO_elem_flag_test(walker->bm, e, walker->mask_edge)) {
-		return FALSE;
+		return false;
 	}
 	else {
-		return TRUE;
+		return true;
 	}
 }
 
-static int bmw_mask_check_face(BMWalker *walker, BMFace *f)
+static bool bmw_mask_check_face(BMWalker *walker, BMFace *f)
 {
 	if ((walker->flag & BMW_FLAG_TEST_HIDDEN) && BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
-		return FALSE;
+		return false;
 	}
 	else if (walker->mask_face && !BMO_elem_flag_test(walker->bm, f, walker->mask_face)) {
-		return FALSE;
+		return false;
 	}
 	else {
-		return TRUE;
+		return true;
 	}
 }
 
@@ -164,7 +164,7 @@ static void *bmw_ShellWalker_step(BMWalker *walker)
 {
 	BMEdge *curedge, *next = NULL;
 	BMVert *ov = NULL;
-	int restrictpass = 1;
+	bool restrictpass = true;
 	BMwShellWalker shellWalk = *((BMwShellWalker *)BMW_current_state(walker));
 	
 	if (!BLI_ghash_haskey(walker->visithash, shellWalk.base)) {
@@ -447,7 +447,7 @@ static void bmw_LoopWalker_begin(BMWalker *walker, void *data)
 	lwalk->is_single = (vert_edge_count[0] == 2 && vert_edge_count[1] == 2);
 
 	/* could also check that vertex*/
-	if ((lwalk->is_boundary == FALSE) &&
+	if ((lwalk->is_boundary == false) &&
 	    (vert_edge_count[0] == 3 || vert_edge_count[1] == 3))
 	{
 		BMIter iter;
@@ -548,19 +548,19 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
 
 			/* typical loopiong over edges in the middle of a mesh */
 			/* however, why use 2 here at all? I guess for internal ngon loops it can be useful. Antony R. */
-			((vert_edge_tot == 4 || vert_edge_tot == 2) && owalk.is_boundary == FALSE) ||
+			((vert_edge_tot == 4 || vert_edge_tot == 2) && owalk.is_boundary == false) ||
 
 			/* walk over boundary of faces but stop at corners */
-			(owalk.is_boundary == TRUE && owalk.is_single == FALSE && vert_edge_tot > 2) ||
+			(owalk.is_boundary == true && owalk.is_single == false && vert_edge_tot > 2) ||
 
 			/* initial edge was a boundary, so is this edge and vertex is only apart of this face
 			 * this lets us walk over the the boundary of an ngon which is handy */
-			(owalk.is_boundary == TRUE && owalk.is_single == TRUE && vert_edge_tot == 2 && BM_edge_is_boundary(e)))
+			(owalk.is_boundary == true && owalk.is_single == true && vert_edge_tot == 2 && BM_edge_is_boundary(e)))
 		{
 			i = 0;
 			stopi = vert_edge_tot / 2;
 			while (1) {
-				if ((owalk.is_boundary == FALSE) && (i == stopi)) {
+				if ((owalk.is_boundary == false) && (i == stopi)) {
 					break;
 				}
 
@@ -589,7 +589,7 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
 			    bmw_mask_check_edge(walker, l->e) &&
 			    !BLI_ghash_haskey(walker->visithash, l->e))
 			{
-				if (!(owalk.is_boundary == FALSE && i != stopi)) {
+				if (!(owalk.is_boundary == false && i != stopi)) {
 					lwalk = BMW_state_add(walker);
 					lwalk->cur = l->e;
 					lwalk->lastv = v;
@@ -642,47 +642,47 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
 
 /* Check whether the face loop should includes the face specified
  * by the given BMLoop */
-static int bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
+static bool bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
 {
 	/* face must have degree 4 */
 	if (l->f->len != 4) {
-		return FALSE;
+		return false;
 	}
 
 	if (!bmw_mask_check_face(walker, l->f)) {
-		return FALSE;
+		return false;
 	}
 
 	/* the face must not have been already visite */
 	if (BLI_ghash_haskey(walker->visithash, l->f) && BLI_ghash_haskey(walker->secvisithash, l->e)) {
-		return FALSE;
+		return false;
 	}
 
-	return TRUE;
+	return true;
 }
 
 /* Check whether the face loop can start from the given edge */
-static int bmw_FaceLoopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
+static bool bmw_FaceLoopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
 {
 	/* There is no face loop starting from a wire edge */
 	if (BM_edge_is_wire(e)) {
-		return FALSE;
+		return false;
 	}
 	
 	/* Don't start a loop from a boundary edge if it cannot
 	 * be extended to cover any faces */
 	if (BM_edge_is_boundary(e)) {
 		if (!bmw_FaceLoopWalker_include_face(walker, e->l)) {
-			return FALSE;
+			return false;
 		}
 	}
 	
 	/* Don't start a face loop from non-manifold edges */
 	if (!BM_edge_is_manifold(e)) {
-		return FALSE;
+		return false;
 	}
 
-	return TRUE;
+	return true;
 }
 
 static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
@@ -697,7 +697,7 @@ static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
 
 	lwalk = BMW_state_add(walker);
 	lwalk->l = e->l;
-	lwalk->nocalc = 0;
+	lwalk->no_calc = false;
 	BLI_ghash_insert(walker->visithash, lwalk->l->f, NULL);
 
 	/* rewin */
@@ -708,7 +708,7 @@ static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
 
 	lwalk = BMW_state_add(walker);
 	*lwalk = owalk;
-	lwalk->nocalc = 0;
+	lwalk->no_calc = false;
 
 	BLI_ghash_free(walker->secvisithash, NULL, NULL);
 	walker->secvisithash = BLI_ghash_ptr_new("bmesh walkers 3");
@@ -740,7 +740,7 @@ static void *bmw_FaceLoopWalker_step(BMWalker *walker)
 
 	l = l->radial_next;
 	
-	if (lwalk->nocalc) {
+	if (lwalk->no_calc) {
 		return f;
 	}
 
@@ -758,11 +758,11 @@ static void *bmw_FaceLoopWalker_step(BMWalker *walker)
 		lwalk->l = l;
 
 		if (l->f->len != 4) {
-			lwalk->nocalc = 1;
+			lwalk->no_calc = true;
 			lwalk->l = origl;
 		}
 		else {
-			lwalk->nocalc = 0;
+			lwalk->no_calc = false;
 		}
 
 		BLI_ghash_insert(walker->secvisithash, l->e, NULL);
@@ -858,7 +858,7 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
 	if (!EDGE_CHECK(e)) {
 		/* walker won't traverse to a non-manifold edge, but may
 		 * be started on one, and should not traverse *away* from
-		 * a non-manfold edge (non-manifold edges are never in an
+		 * a non-manifold edge (non-manifold edges are never in an
 		 * edge ring with manifold edges */
 		return e;
 	}
diff --git a/source/blender/bmesh/intern/bmesh_walkers_private.h b/source/blender/bmesh/intern/bmesh_walkers_private.h
index fc56393..09dd4f1 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_private.h
+++ b/source/blender/bmesh/intern/bmesh_walkers_private.h
@@ -62,14 +62,14 @@ typedef struct BMwLoopWalker {
 	BMEdge *cur, *start;
 	BMVert *lastv, *startv;
 	BMFace *f_hub;
-	short is_boundary; /* boundary looping changes behavior */
-	short is_single;  /* single means the edge verts are only connected to 1 face */
+	bool is_boundary; /* boundary looping changes behavior */
+	bool is_single;  /* single means the edge verts are only connected to 1 face */
 } BMwLoopWalker;
 
 typedef struct BMwFaceLoopWalker {
 	BMwGenericWalker header;
 	BMLoop *l;
-	int nocalc;
+	bool no_calc;
 } BMwFaceLoopWalker;
 
 typedef struct BMwEdgeringWalker {
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c
index eb8e84d..c56af82 100644
--- a/source/blender/bmesh/operators/bmo_bevel.c
+++ b/source/blender/bmesh/operators/bmo_bevel.c
@@ -34,7 +34,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
 {
 	const float offset = BMO_slot_float_get(op->slots_in, "offset");
 	const int   seg    = BMO_slot_int_get(op->slots_in,   "segments");
-	const int   vonly  = BMO_slot_bool_get(op->slots_in,  "vertex_only");
+	const bool  vonly  = BMO_slot_bool_get(op->slots_in,  "vertex_only");
 
 	if (offset > 0) {
 		BMOIter siter;
@@ -43,7 +43,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
 
 		/* first flush 'geom' into flags, this makes it possible to check connected data,
 		 * BM_FACE is cleared so we can put newly created faces into a bmesh slot. */
-		BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, FALSE);
+		BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, false);
 
 		BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
 			BM_elem_flag_enable(v, BM_ELEM_TAG);
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c
index c7cd1e7..9a17ebe 100644
--- a/source/blender/bmesh/operators/bmo_connect.c
+++ b/source/blender/bmesh/operators/bmo_connect.c
@@ -106,7 +106,7 @@ void bmo_connect_verts_exec(BMesh *bm, BMOperator *op)
 		}
 
 		for (i = 0; i < BLI_array_count(verts_pair); i++) {
-			nf = BM_face_split(bm, f, verts_pair[i][0], verts_pair[i][1], &nl, NULL, FALSE);
+			nf = BM_face_split(bm, f, verts_pair[i][0], verts_pair[i][1], &nl, NULL, false);
 			f = nf;
 			
 			if (!nl || !nf) {
@@ -221,7 +221,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
 	int c = 0, cl1 = 0, cl2 = 0;
 
 	/* merge-bridge support */
-	const int   use_merge    = BMO_slot_bool_get(op->slots_in,  "use_merge");
+	const bool  use_merge    = BMO_slot_bool_get(op->slots_in,  "use_merge");
 	const float merge_factor = BMO_slot_float_get(op->slots_in, "merge_factor");
 
 	BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, EDGE_MARK);
@@ -359,6 +359,17 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
 			/* Last point of loop 2 */
 			v4 = get_outer_vert(bm, ee2[clamp_index(-1, BLI_array_count(ee2))]);
 
+			/* ugh, happens when bridging single edges, user could just make a face
+			 * but better support it for sake of completeness */
+			if (v1 == v2) {
+				BLI_assert(BLI_array_count(ee1) == 1);
+				v2 = (vv1[0] == v2) ? vv1[1] : vv1[0];
+			}
+			if (v3 == v4) {
+				BLI_assert(BLI_array_count(ee2) == 1);
+				v4 = (vv2[0] == v4) ? vv2[1] : vv2[0];
+			}
+
 			/* If v1 is a better match for v4 than v3, AND v2 is a better match
 			 * for v3 than v4, the loops are in opposite directions, so reverse
 			 * the order of reads from vv1. We can avoid sqrt for comparison */
@@ -508,7 +519,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
 				                            vv2[i2],
 				                            vv2[i2next],
 				                            vv1[i1next],
-				                            f_example, TRUE);
+				                            f_example, true);
 				if (UNLIKELY((f == NULL) || (f->len != 4))) {
 					fprintf(stderr, "%s: in bridge! (bmesh internal error)\n", __func__);
 				}
diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c
index 2ea5914..ae07c2c 100644
--- a/source/blender/bmesh/operators/bmo_create.c
+++ b/source/blender/bmesh/operators/bmo_create.c
@@ -87,8 +87,8 @@ BLI_INLINE BMDiskLink *rs_edge_link_get(BMEdge *e, BMVert *v, EdgeData *e_data)
 	                                &(((EdgeData *)e_data)->v2_disk_link);
 }
 
-static int rotsys_append_edge(BMEdge *e, BMVert *v,
-                              EdgeData *edata, VertData *vdata)
+static bool rotsys_append_edge(BMEdge *e, BMVert *v,
+                               EdgeData *edata, VertData *vdata)
 {
 	EdgeData *ed = &edata[BM_elem_index_get(e)];
 	VertData *vd = &vdata[BM_elem_index_get(v)];
@@ -116,7 +116,7 @@ static int rotsys_append_edge(BMEdge *e, BMVert *v,
 		}
 	}
 
-	return TRUE;
+	return true;
 }
 
 static void UNUSED_FUNCTION(rotsys_remove_edge)(BMEdge *e, BMVert *v,
@@ -613,10 +613,10 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
 			BM_elem_index_set(v2, -1); /* set_dirty! */
 			//BM_edge_create(bm, cv, v2, NULL, 0);
 			
-			BM_vert_select_set(bm, v2, TRUE);
+			BM_vert_select_set(bm, v2, true);
 			if (lastv) {
 				e2 = BM_edge_create(bm, lastv, v2, NULL, 0);
-				BM_edge_select_set(bm, e2, TRUE);
+				BM_edge_select_set(bm, e2, true);
 			}
 			
 			lastv = v2;
@@ -742,7 +742,7 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E
 	BMVert *endv;
 	EPathNode *node;
 	int i;
-	const int use_restrict = BMO_slot_bool_get(op->slots_in, "use_restrict");
+	const bool use_restrict = BMO_slot_bool_get(op->slots_in, "use_restrict");
 	BMOpSlot *slot_restrict = BMO_slot_get(op->slots_in, "restrict");
 
 
@@ -899,10 +899,10 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
 	BMEdge **edges = NULL;
 	PathBase *pathbase;
 	BLI_array_declare(edges);
-	int use_restrict       = BMO_slot_bool_get(op->slots_in, "use_restrict");
-	int use_fill_check     = BMO_slot_bool_get(op->slots_in, "use_fill_check");
-	const short mat_nr     = BMO_slot_int_get(op->slots_in,  "mat_nr");
-	const short use_smooth = BMO_slot_bool_get(op->slots_in, "use_smooth");
+	const bool use_restrict   = BMO_slot_bool_get(op->slots_in, "use_restrict");
+	const bool use_fill_check = BMO_slot_bool_get(op->slots_in, "use_fill_check");
+	const short mat_nr        = BMO_slot_int_get(op->slots_in,  "mat_nr");
+	const bool use_smooth     = BMO_slot_bool_get(op->slots_in, "use_smooth");
 	int i, j, group = 0;
 	unsigned int winding[2]; /* accumulte winding directions for each edge which has a face */
 	BMOpSlot *slot_restrict          = BMO_slot_get(op->slots_in, "restrict");
@@ -1047,9 +1047,9 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
 				v2 = verts[0];
 			}
 
-			if ((use_fill_check == FALSE) ||
+			if ((use_fill_check == false) ||
 			    /* fairly expensive check - see if there are already faces filling this area */
-			    (BM_face_exists_multi_edge(edges, i) == FALSE))
+			    (BM_face_exists_multi_edge(edges, i) == false))
 			{
 				f = BM_face_create_ngon(bm, v1, v2, edges, i, BM_CREATE_NO_DOUBLE);
 				if (f && !BMO_elem_flag_test(bm, f, ELE_ORIG)) {
@@ -1287,7 +1287,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
 	BMFace *f;
 	int totv = 0, tote = 0, totf = 0, amount;
 	const short mat_nr     = BMO_slot_int_get(op->slots_in,  "mat_nr");
-	const short use_smooth = BMO_slot_bool_get(op->slots_in, "use_smooth");
+	const bool use_smooth  = BMO_slot_bool_get(op->slots_in, "use_smooth");
 
 	/* count number of each element type we were passe */
 	BMO_ITER (h, &oiter, op->slots_in, "geom", BM_VERT | BM_EDGE | BM_FACE) {
@@ -1321,7 +1321,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
 	if (totf == 0 && totv >= 4 && totv == tote + 2) {
 		/* find a free standing vertex and 2 endpoint verts */
 		BMVert *v_free = NULL, *v_a = NULL, *v_b = NULL;
-		int ok = TRUE;
+		bool ok = true;
 
 
 		BMO_ITER (v, &oiter, op->slots_in, "geom", BM_VERT) {
@@ -1339,26 +1339,26 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
 			if (tot_edges == 0) {
 				/* only accept 1 free vert */
 				if (v_free == NULL)  v_free = v;
-				else                 ok = FALSE;  /* only ever want one of these */
+				else                 ok = false;  /* only ever want one of these */
 			}
 			else if (tot_edges == 1) {
 				if (v_a == NULL)       v_a = v;
 				else if (v_b == NULL)  v_b = v;
-				else                   ok = FALSE;  /* only ever want 2 of these */
+				else                   ok = false;  /* only ever want 2 of these */
 			}
 			else if (tot_edges == 2) {
 				/* do nothing, regular case */
 			}
 			else {
-				ok = FALSE; /* if a vertex has 3+ edge users then cancel - this is only simple cases */
+				ok = false; /* if a vertex has 3+ edge users then cancel - this is only simple cases */
 			}
 
-			if (ok == FALSE) {
+			if (ok == false) {
 				break;
 			}
 		}
 
-		if (ok == TRUE && v_free && v_a && v_b) {
+		if (ok == true && v_free && v_a && v_b) {
 			e = BM_edge_create(bm, v_free, v_a, NULL, BM_CREATE_NO_DOUBLE);
 			BMO_elem_flag_enable(bm, e, ELE_NEW);
 
@@ -1377,7 +1377,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
 
 	BMO_op_initf(bm, &op2, op->flag,
 	             "edgenet_fill edges=%fe use_fill_check=%b mat_nr=%i use_smooth=%b",
-	             ELE_NEW, TRUE, mat_nr, use_smooth);
+	             ELE_NEW, true, mat_nr, use_smooth);
 
 	BMO_op_exec(bm, &op2);
 
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c
index 7c3bcd6..47b2497 100644
--- a/source/blender/bmesh/operators/bmo_dissolve.c
+++ b/source/blender/bmesh/operators/bmo_dissolve.c
@@ -41,7 +41,7 @@
 
 #define VERT_MARK   1
 
-static int UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f)
+static bool UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f)
 {
 	BMWalker regwalker;
 	BMIter liter2;
@@ -55,23 +55,21 @@ static int UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f)
 	         BMW_FLAG_NOP,
 	         BMW_NIL_LAY);
 
-	f2 = BMW_begin(&regwalker, f);
-	for ( ; f2; f2 = BMW_step(&regwalker)) {
-		l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2);
-		for ( ; l2; l2 = BM_iter_step(&liter2)) {
+	for (f2 = BMW_begin(&regwalker, f); f2; f2 = BMW_step(&regwalker)) {
+		BM_ITER_ELEM (l2, &liter2, f2, BM_LOOPS_OF_FACE) {
 			l3 = l2->radial_next;
 			if (BMO_elem_flag_test(bm, l3->f, FACE_MARK) !=
 			    BMO_elem_flag_test(bm, l2->f, FACE_MARK))
 			{
 				if (!BMO_elem_flag_test(bm, l2->e, EDGE_MARK)) {
-					return FALSE;
+					return false;
 				}
 			}
 		}
 	}
 	BMW_end(&regwalker);
 
-	return TRUE;
+	return true;
 }
 
 void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
@@ -85,7 +83,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
 	BMWalker regwalker;
 	int i;
 
-	int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
+	const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
 
 	if (use_verts) {
 		/* tag verts that start out with only 2 edges,
@@ -115,8 +113,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
 		         BMW_FLAG_NOP, /* no need to check BMW_FLAG_TEST_HIDDEN, faces are already marked by the bmo */
 		         BMW_NIL_LAY);
 
-		f2 = BMW_begin(&regwalker, f);
-		for ( ; f2; f2 = BMW_step(&regwalker)) {
+		for (f2 = BMW_begin(&regwalker, f); f2; f2 = BMW_step(&regwalker)) {
 			BLI_array_append(faces, f2);
 		}
 		BMW_end(&regwalker);
@@ -150,7 +147,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
 		while (faces[tot])
 			tot++;
 		
-		f = BM_faces_join(bm, faces, tot, TRUE);
+		f = BM_faces_join(bm, faces, tot, true);
 		if (!f) {
 			BMO_error_raise(bm, op, BMERR_DISSOLVEFACES_FAILED,
 			                "Could not create merged face");
@@ -174,7 +171,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
 		BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) {
 			if (BMO_elem_flag_test(bm, v, VERT_MARK)) {
 				if (BM_vert_edge_count(v) == 2) {
-					BM_vert_collapse_edge(bm, v->e, v, TRUE);
+					BM_vert_collapse_edge(bm, v->e, v, true);
 				}
 			}
 		}
@@ -215,7 +212,7 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op)
 
 			/* BMESH_TODO - check on delaying edge removal since we may end up removing more then
 			 * one edge, and later reference a removed edge */
-			BM_faces_join_pair(bm, fa, fb, e, TRUE);
+			BM_faces_join_pair(bm, fa, fb, e, true);
 		}
 	}
 
@@ -228,7 +225,7 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op)
 	/* clean up extreneous 2-valence vertice */
 	for (i = 0; i < BLI_array_count(verts); i++) {
 		if (verts[i]->e) {
-			BM_vert_collapse_edge(bm, verts[i]->e, verts[i], TRUE);
+			BM_vert_collapse_edge(bm, verts[i]->e, verts[i], true);
 		}
 	}
 	
@@ -254,7 +251,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op)
 	BMIter viter;
 	BMVert *v;
 
-	int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
+	const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
 
 	if (use_verts) {
 		BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) {
@@ -271,7 +268,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op)
 
 			/* BMESH_TODO - check on delaying edge removal since we may end up removing more then
 			 * one edge, and later reference a removed edge */
-			BM_faces_join_pair(bm, fa, fb, e, TRUE);
+			BM_faces_join_pair(bm, fa, fb, e, true);
 		}
 	}
 
@@ -279,20 +276,20 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op)
 		BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) {
 			if (BMO_elem_flag_test(bm, v, VERT_MARK)) {
 				if (BM_vert_edge_count(v) == 2) {
-					BM_vert_collapse_edge(bm, v->e, v, TRUE);
+					BM_vert_collapse_edge(bm, v->e, v, true);
 				}
 			}
 		}
 	}
 }
 
-static int test_extra_verts(BMesh *bm, BMVert *v)
+static bool test_extra_verts(BMesh *bm, BMVert *v)
 {
 	BMIter iter, liter, iter2, iter3;
 	BMFace *f, *f2;
 	BMLoop *l;
 	BMEdge *e;
-	int found;
+	bool found;
 
 	/* test faces around verts for verts that would be wrongly killed
 	 * by dissolve faces. */
@@ -305,31 +302,31 @@ static int test_extra_verts(BMesh *bm, BMVert *v)
 				 * then dissolve faces won't destroy it.
 				 * also if it forms a boundary with one
 				 * of the face region */
-				found = FALSE;
+				found = false;
 				e = BM_iter_new(&iter2, bm, BM_EDGES_OF_VERT, l->v);
 				for ( ; e; e = BM_iter_step(&iter2)) {
 					if (BM_edge_is_boundary(e)) {
-						found = TRUE;
+						found = true;
 					}
 					f2 = BM_iter_new(&iter3, bm, BM_FACES_OF_EDGE, e);
 					for ( ; f2; f2 = BM_iter_step(&iter3)) {
 						if (!BMO_elem_flag_test(bm, f2, FACE_MARK)) {
-							found = TRUE;
+							found = true;
 							break;
 						}
 					}
-					if (found == TRUE) {
+					if (found == true) {
 						break;
 					}
 				}
-				if (found == FALSE) {
-					return FALSE;
+				if (found == false) {
+					return false;
 				}
 			}
 		}
 	}
 
-	return TRUE;
+	return true;
 }
 void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
 {
@@ -349,9 +346,9 @@ void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
 				/* previously the faces were joined, but collapsing between 2 edges
 				 * gives some advantage/difference in using vertex-dissolve over edge-dissolve */
 #if 0
-				BM_vert_collapse_faces(bm, v->e, v, 1.0f, TRUE, TRUE);
+				BM_vert_collapse_faces(bm, v->e, v, 1.0f, true, true);
 #else
-				BM_vert_collapse_edge(bm, v->e, v, TRUE);
+				BM_vert_collapse_edge(bm, v->e, v, true);
 #endif
 
 				continue;
@@ -483,7 +480,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
 	BMOpSlot *vinput = BMO_slot_get(op->slots_in, "verts");
 	const float angle_max = (float)M_PI / 2.0f;
 	const float angle_limit = min_ff(angle_max, BMO_slot_float_get(op->slots_in, "angle_limit"));
-	const int do_dissolve_boundaries = BMO_slot_bool_get(op->slots_in, "use_dissolve_boundaries");
+	const bool do_dissolve_boundaries = BMO_slot_bool_get(op->slots_in, "use_dissolve_boundaries");
 
 	BM_mesh_decimate_dissolve_ex(bm, angle_limit, do_dissolve_boundaries,
 	                             (BMVert **)BMO_SLOT_AS_BUFFER(vinput), vinput->len,
diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c
index f288901..1448129 100644
--- a/source/blender/bmesh/operators/bmo_dupe.c
+++ b/source/blender/bmesh/operators/bmo_dupe.c
@@ -213,13 +213,13 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
 		    !BMO_elem_flag_test(bm_src, v, DUPE_DONE))
 		{
 			BMIter iter;
-			int isolated = 1;
+			bool isolated = true;
 
 			v2 = copy_vertex(bm_src, v, bm_dst, vhash);
 
 			BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) {
 				if (BMO_elem_flag_test(bm_src, f, DUPE_INPUT)) {
-					isolated = 0;
+					isolated = false;
 					break;
 				}
 			}
@@ -227,7 +227,7 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
 			if (isolated) {
 				BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
 					if (BMO_elem_flag_test(bm_src, e, DUPE_INPUT)) {
-						isolated = 0;
+						isolated = false;
 						break;
 					}
 				}
@@ -386,7 +386,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op)
 	BMOperator *splitop = op;
 	BMOperator dupeop;
 	BMOperator delop;
-	const short use_only_faces = BMO_slot_bool_get(op->slots_in, "use_only_faces");
+	const bool use_only_faces = BMO_slot_bool_get(op->slots_in, "use_only_faces");
 
 	/* initialize our sub-operator */
 	BMO_op_init(bm, &dupeop, op->flag, "duplicate");
diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c
index b4b50a6..378f790 100644
--- a/source/blender/bmesh/operators/bmo_edgesplit.c
+++ b/source/blender/bmesh/operators/bmo_edgesplit.c
@@ -37,17 +37,17 @@
 /* keep this operator fast, its used in a modifier */
 void bmo_split_edges_exec(BMesh *bm, BMOperator *op)
 {
-	const int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
+	const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
 
-	BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, FALSE);
+	BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, false);
 
 	if (use_verts) {
 		/* this slows down the operation but its ok because the modifier doesn't use */
-		BMO_slot_buffer_hflag_enable(bm, op->slots_in, "verts", BM_VERT, BM_ELEM_TAG, FALSE);
+		BMO_slot_buffer_hflag_enable(bm, op->slots_in, "verts", BM_VERT, BM_ELEM_TAG, false);
 	}
 
 	/* this is where everything happens */
-	BM_mesh_edgesplit(bm, use_verts, TRUE);
+	BM_mesh_edgesplit(bm, use_verts, true);
 
 	BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_INTERNAL_TAG);
 }
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c
index 2cca3fc..4fde615 100644
--- a/source/blender/bmesh/operators/bmo_extrude.c
+++ b/source/blender/bmesh/operators/bmo_extrude.c
@@ -112,7 +112,7 @@ void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
 			l3 = l->next;
 			l4 = l2->next;
 
-			f3 = BM_face_create_quad_tri(bm, l3->v, l4->v, l2->v, l->v, f, FALSE);
+			f3 = BM_face_create_quad_tri(bm, l3->v, l4->v, l2->v, l->v, f, false);
 			/* XXX, no error check here, why? - Campbell */
 
 			l_tmp = BM_FACE_FIRST_LOOP(f3);
@@ -225,7 +225,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
 			f_verts[3] = e_new->v2;
 		}
 		/* not sure what to do about example face, pass NULL for now */
-		f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, FALSE);
+		f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, false);
 		bm_extrude_copy_face_loop_attributes(bm, f);
 		
 		if (BMO_elem_flag_test(bm, e, EXT_INPUT))
@@ -248,7 +248,7 @@ void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op)
 	BMOIter siter;
 	BMVert *v, *dupev;
 	BMEdge *e;
-	const int has_vskin = CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN);
+	const bool has_vskin = CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN);
 
 	for (v = BMO_iter_new(&siter, op->slots_in, "verts", BM_VERT); v; v = BMO_iter_step(&siter)) {
 		dupev = BM_vert_create(bm, v->co, v, 0);
@@ -273,7 +273,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
 	BMEdge *e, *e_new;
 	BMVert *v, *v2;
 	BMFace *f;
-	int found, fwd, delorig = FALSE;
+	bool found, fwd, delorig = false;
 	BMOpSlot *slot_facemap_out;
 	BMOpSlot *slot_edges_exclude;
 
@@ -293,20 +293,20 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
 				continue;
 			}
 
-			found = FALSE; /* found a face that isn't input? */
+			found = false; /* found a face that isn't input? */
 			edge_face_tot = 0; /* edge/face count */
 
 			BM_ITER_ELEM (f, &fiter, e, BM_FACES_OF_EDGE) {
 				if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
-					found = TRUE;
-					delorig = TRUE;
+					found = true;
+					delorig = true;
 					break;
 				}
 
 				edge_face_tot++;
 			}
 
-			if ((edge_face_tot > 1) && (found == FALSE)) {
+			if ((edge_face_tot > 1) && (found == false)) {
 				/* edge has a face user, that face isn't extrude input */
 				BMO_elem_flag_enable(bm, e, EXT_DEL);
 			}
@@ -316,26 +316,26 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
 	/* calculate verts to delete */
 	BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
 		if (v->e) {  /* only deal with verts attached to geometry [#33651] */
-			found = FALSE;
+			found = false;
 
 			BM_ITER_ELEM (e, &viter, v, BM_EDGES_OF_VERT) {
 				if (!BMO_elem_flag_test(bm, e, EXT_INPUT) || !BMO_elem_flag_test(bm, e, EXT_DEL)) {
-					found = TRUE;
+					found = true;
 					break;
 				}
 			}
 
 			/* avoid an extra loop */
-			if (found == TRUE) {
+			if (found == true) {
 				BM_ITER_ELEM (f, &viter, v, BM_FACES_OF_VERT) {
 					if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
-						found = TRUE;
+						found = true;
 						break;
 					}
 				}
 			}
 
-			if (found == FALSE) {
+			if (found == false) {
 				BMO_elem_flag_enable(bm, v, EXT_DEL);
 			}
 		}
@@ -347,7 +347,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
 		}
 	}
 
-	if (delorig == TRUE) {
+	if (delorig == true) {
 		BMO_op_initf(bm, &delop, op->flag,
 		             "delete geom=%fvef context=%i",
 		             EXT_DEL, DEL_ONLYTAGGED);
@@ -435,7 +435,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
 		}
 
 		/* not sure what to do about example face, pass NULL for now */
-		f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, FALSE);
+		f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, false);
 		bm_extrude_copy_face_loop_attributes(bm, f);
 	}
 
@@ -665,7 +665,7 @@ void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op)
 	BMO_op_finish(bm, &reverseop);
 
 	/* Extrude the region */
-	BMO_op_initf(bm, &extrudeop, op->flag, "extrude_face_region use_keep_orig=%b", TRUE);
+	BMO_op_initf(bm, &extrudeop, op->flag, "extrude_face_region use_keep_orig=%b", true);
 	BMO_slot_copy(op,         slots_in, "geom",
 	              &extrudeop, slots_in, "geom");
 	BMO_op_exec(bm, &extrudeop);
diff --git a/source/blender/bmesh/operators/bmo_hull.c b/source/blender/bmesh/operators/bmo_hull.c
index e2da4f4..5d8689b 100644
--- a/source/blender/bmesh/operators/bmo_hull.c
+++ b/source/blender/bmesh/operators/bmo_hull.c
@@ -136,12 +136,12 @@ static void hull_output_triangles(BMesh *bm, GHash *hull_triangles)
 				}
 
 				/* Create new hull face */
-				f = BM_face_create_quad_tri_v(bm, t->v, 3, example, TRUE);
+				f = BM_face_create_quad_tri_v(bm, t->v, 3, example, true);
 				BM_face_copy_shared(bm, f);
 			}
 			/* Mark face for 'geom.out' slot and select */
 			BMO_elem_flag_enable(bm, f, HULL_FLAG_OUTPUT_GEOM);
-			BM_face_select_set(bm, f, TRUE);
+			BM_face_select_set(bm, f, true);
 
 			/* Mark edges for 'geom.out' slot */
 			for (i = 0; i < 3; i++) {
@@ -200,7 +200,7 @@ static int hull_final_edges_lookup(HullFinalEdges *final_edges,
 
 	adj = BLI_ghash_lookup(final_edges->edges, v1);
 	if (!adj)
-		return FALSE;
+		return false;
 
 	return !!final_edges_find_link(adj, v2);
 }
@@ -268,17 +268,17 @@ static void hull_remove_overlapping(BMesh *bm, GHash *hull_triangles,
 		HullTriangle *t = BLI_ghashIterator_getKey(&hull_iter);
 		BMIter bm_iter1, bm_iter2;
 		BMFace *f;
-		int f_on_hull;
+		bool f_on_hull;
 
 		BM_ITER_ELEM (f, &bm_iter1, t->v[0], BM_FACES_OF_VERT) {
 			BMEdge *e;
 
 			/* Check that all the face's edges are on the hull,
 			 * otherwise can't reuse it */
-			f_on_hull = TRUE;
+			f_on_hull = true;
 			BM_ITER_ELEM (e, &bm_iter2, f, BM_EDGES_OF_FACE) {
 				if (!hull_final_edges_lookup(final_edges, e->v1, e->v2)) {
-					f_on_hull = FALSE;
+					f_on_hull = false;
 					break;
 				}
 			}
@@ -288,7 +288,7 @@ static void hull_remove_overlapping(BMesh *bm, GHash *hull_triangles,
 			if (BM_vert_in_face(f, t->v[1]) &&
 			    BM_vert_in_face(f, t->v[2]) && f_on_hull)
 			{
-				t->skip = TRUE;
+				t->skip = true;
 				BMO_elem_flag_disable(bm, f, HULL_FLAG_INTERIOR_ELE);
 				BMO_elem_flag_enable(bm, f, HULL_FLAG_HOLE);
 			}
@@ -330,18 +330,18 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op)
 	 * input set */
 	BMO_ITER (v, &oiter, op->slots_in, "input", BM_VERT) {
 		if (BMO_elem_flag_test(bm, v, HULL_FLAG_INTERIOR_ELE)) {
-			int del = TRUE;
+			bool del = true;
 		
 			BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
 				if (!BMO_elem_flag_test(bm, e, HULL_FLAG_INPUT)) {
-					del = FALSE;
+					del = false;
 					break;
 				}
 			}
 
 			BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) {
 				if (!BMO_elem_flag_test(bm, f, HULL_FLAG_INPUT)) {
-					del = FALSE;
+					del = false;
 					break;
 				}
 			}
@@ -353,11 +353,11 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op)
 
 	BMO_ITER (e, &oiter, op->slots_in, "input", BM_EDGE) {
 		if (BMO_elem_flag_test(bm, e, HULL_FLAG_INTERIOR_ELE)) {
-			int del = TRUE;
+			bool del = true;
 
 			BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) {
 				if (!BMO_elem_flag_test(bm, f, HULL_FLAG_INPUT)) {
-					del = FALSE;
+					del = false;
 					break;
 				}
 			}
@@ -396,13 +396,13 @@ static void hull_tag_holes(BMesh *bm, BMOperator *op)
 	/* Mark edges too if all adjacent faces are holes and the edge is
 	 * not already isolated */
 	BMO_ITER (e, &oiter, op->slots_in, "input", BM_EDGE) {
-		int hole = TRUE;
-		int any_faces = FALSE;
+		bool hole = true;
+		bool any_faces = false;
 		
 		BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) {
-			any_faces = TRUE;
+			any_faces = true;
 			if (!BMO_elem_flag_test(bm, f, HULL_FLAG_HOLE)) {
-				hole = FALSE;
+				hole = false;
 				break;
 			}
 		}
diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c
index cef1181..ef99dae 100644
--- a/source/blender/bmesh/operators/bmo_inset.c
+++ b/source/blender/bmesh/operators/bmo_inset.c
@@ -92,13 +92,13 @@ static BMLoop *bm_edge_is_mixed_face_tag(BMLoop *l)
 
 void bmo_inset_exec(BMesh *bm, BMOperator *op)
 {
-	const int use_outset          = BMO_slot_bool_get(op->slots_in, "use_outset");
-	const int use_boundary        = BMO_slot_bool_get(op->slots_in, "use_boundary") && (use_outset == FALSE);
-	const int use_even_offset     = BMO_slot_bool_get(op->slots_in, "use_even_offset");
-	const int use_even_boundry    = use_even_offset; /* could make own option */
-	const int use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset");
-	const float thickness         = BMO_slot_float_get(op->slots_in, "thickness");
-	const float depth             = BMO_slot_float_get(op->slots_in, "depth");
+	const bool use_outset          = BMO_slot_bool_get(op->slots_in, "use_outset");
+	const bool use_boundary        = BMO_slot_bool_get(op->slots_in, "use_boundary") && (use_outset == false);
+	const bool use_even_offset     = BMO_slot_bool_get(op->slots_in, "use_even_offset");
+	const bool use_even_boundry    = use_even_offset; /* could make own option */
+	const bool use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset");
+	const float thickness          = BMO_slot_float_get(op->slots_in, "thickness");
+	const float depth              = BMO_slot_float_get(op->slots_in, "depth");
 
 	int edge_info_len = 0;
 
@@ -111,13 +111,13 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op)
 	BMFace *f;
 	int i, j, k;
 
-	if (use_outset == FALSE) {
-		BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE);
-		BMO_slot_buffer_hflag_enable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+	if (use_outset == false) {
+		BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false);
+		BMO_slot_buffer_hflag_enable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false);
 	}
 	else {
-		BM_mesh_elem_hflag_enable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE);
-		BMO_slot_buffer_hflag_disable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+		BM_mesh_elem_hflag_enable_all(bm, BM_FACE, BM_ELEM_TAG, false);
+		BMO_slot_buffer_hflag_disable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false);
 	}
 
 	/* first count all inset edges we will split */
@@ -411,11 +411,11 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op)
 
 					/* this saves expensive/slow glue check for common cases */
 					if (r_vout_len > 2) {
-						int ok = TRUE;
+						bool ok = true;
 						/* last step, NULL this vertex if has a tagged face */
 						BM_ITER_ELEM (f, &iter, v_split, BM_FACES_OF_VERT) {
 							if (BM_elem_flag_test(f, BM_ELEM_TAG)) {
-								ok = FALSE;
+								ok = false;
 								break;
 							}
 						}
@@ -471,7 +471,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op)
 #endif
 		/* no need to check doubles, we KNOW there won't be any */
 		/* yes - reverse face is correct in this case */
-		f = BM_face_create_quad_tri_v(bm, varr, j, es->l->f, FALSE);
+		f = BM_face_create_quad_tri_v(bm, varr, j, es->l->f, false);
 		BMO_elem_flag_enable(bm, f, ELE_NEW);
 
 		/* copy for loop data, otherwise UV's and vcols are no good.
@@ -548,7 +548,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op)
 		/* done correcting edge verts normals */
 
 		/* untag verts */
-		BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, FALSE);
+		BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, false);
 
 		/* tag face verts */
 		BMO_ITER (f, &oiter, op->slots_in, "faces", BM_FACE) {
diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c
index 45ecdee..e052968 100644
--- a/source/blender/bmesh/operators/bmo_join_triangles.c
+++ b/source/blender/bmesh/operators/bmo_join_triangles.c
@@ -105,7 +105,7 @@ static float measure_facepair(BMVert *v1, BMVert *v2,
 #define T2QUV_LIMIT 0.005f
 #define T2QCOL_LIMIT 3
 
-static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do_tf, const int do_vcol)
+static bool bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const bool do_uv, const bool do_tf, const bool do_vcol)
 {
 	/* first get loops */
 	BMLoop *l[4];
@@ -138,7 +138,7 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do
 		if (luv[0] && (!compare_v2v2(luv[0]->uv, luv[2]->uv, T2QUV_LIMIT) ||
 		               !compare_v2v2(luv[1]->uv, luv[3]->uv, T2QUV_LIMIT)))
 		{
-			return FALSE;
+			return false;
 		}
 	}
 
@@ -149,7 +149,7 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do
 		};
 
 		if (tp[0] && (tp[0]->tpage != tp[1]->tpage)) {
-			return FALSE;
+			return false;
 		}
 	}
 
@@ -166,12 +166,12 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do
 			if (!compare_rgb_uchar((unsigned char *)&lcol[0]->r, (unsigned char *)&lcol[2]->r, T2QCOL_LIMIT) ||
 			    !compare_rgb_uchar((unsigned char *)&lcol[1]->r, (unsigned char *)&lcol[3]->r, T2QCOL_LIMIT))
 			{
-				return FALSE;
+				return false;
 			}
 		}
 	}
 
-	return TRUE;
+	return true;
 }
 
 typedef struct JoinEdge {
@@ -197,6 +197,13 @@ static int fplcmp(const void *v1, const void *v2)
 
 void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
 {
+	const bool do_sharp = BMO_slot_bool_get(op->slots_in, "cmp_sharp");
+	const bool do_uv    = BMO_slot_bool_get(op->slots_in, "cmp_uvs");
+	const bool do_tf    = do_uv;  /* texture face, make make its own option eventually */
+	const bool do_vcol  = BMO_slot_bool_get(op->slots_in, "cmp_vcols");
+	const bool do_mat   = BMO_slot_bool_get(op->slots_in, "cmp_materials");
+	const float limit   = BMO_slot_float_get(op->slots_in, "limit");
+
 	BMIter iter, liter;
 	BMOIter siter;
 	BMFace *f;
@@ -204,12 +211,6 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
 	BMEdge *e;
 	BLI_array_declare(jedges);
 	JoinEdge *jedges = NULL;
-	int do_sharp = BMO_slot_bool_get(op->slots_in, "cmp_sharp");
-	int do_uv    = BMO_slot_bool_get(op->slots_in, "cmp_uvs");
-	int do_tf    = do_uv;  /* texture face, make make its own option eventually */
-	int do_vcol  = BMO_slot_bool_get(op->slots_in, "cmp_vcols");
-	int do_mat   = BMO_slot_bool_get(op->slots_in, "cmp_materials");
-	float limit  = BMO_slot_float_get(op->slots_in, "limit");
 	int i, totedge;
 
 	/* flag all edges of all input face */
@@ -265,7 +266,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
 		if (do_mat && f1->mat_nr != f2->mat_nr)
 			continue;
 
-		if ((do_uv || do_tf || do_vcol) && (bm_edge_faces_cmp(bm, e, do_uv, do_tf, do_vcol) == FALSE))
+		if ((do_uv || do_tf || do_vcol) && (bm_edge_faces_cmp(bm, e, do_uv, do_tf, do_vcol) == false))
 			continue;
 
 		measure = measure_facepair(v1, v2, v3, v4, limit);
@@ -308,7 +309,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
 
 
 		BM_edge_face_pair(e, &f1, &f2); /* checked above */
-		BM_faces_join_pair(bm, f1, f2, e, TRUE);
+		BM_faces_join_pair(bm, f1, f2, e, true);
 	}
 
 	BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
@@ -342,7 +343,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
 				continue;
 			}
 
-			BM_faces_join_pair(bm, f1, f2, e, TRUE);
+			BM_faces_join_pair(bm, f1, f2, e, true);
 		}
 	}
 
diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c
index 4b897a2..0976c4c 100644
--- a/source/blender/bmesh/operators/bmo_mesh_conv.c
+++ b/source/blender/bmesh/operators/bmo_mesh_conv.c
@@ -36,6 +36,9 @@
 #include "DNA_key_types.h"
 #include "DNA_modifier_types.h"
 
+#include "BLI_math.h"
+#include "BLI_array.h"
+
 #include "BKE_mesh.h"
 #include "BLI_listbase.h"
 #include "BKE_global.h"
@@ -43,9 +46,6 @@
 #include "BKE_main.h"
 #include "BKE_customdata.h"
 
-#include "BLI_math.h"
-#include "BLI_array.h"
-
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
 
@@ -53,9 +53,9 @@
 
 void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
 {
-	Object *ob  = BMO_slot_ptr_get(op->slots_in,  "object");
-	Mesh *me    = BMO_slot_ptr_get(op->slots_in,  "mesh");
-	int set_key = BMO_slot_bool_get(op->slots_in, "use_shapekey");
+	Object *ob   = BMO_slot_ptr_get(op->slots_in,  "object");
+	Mesh *me     = BMO_slot_ptr_get(op->slots_in,  "mesh");
+	bool set_key = BMO_slot_bool_get(op->slots_in, "use_shapekey");
 
 	BM_mesh_bm_from_me(bm, me, set_key, ob->shapenr);
 
@@ -72,14 +72,14 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
 
 	BMO_op_callf(bm, op->flag,
 	             "bmesh_to_mesh mesh=%p object=%p skip_tessface=%b",
-	             me, ob, TRUE);
+	             me, ob, true);
 }
 
 void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
 {
 	Mesh *me = BMO_slot_ptr_get(op->slots_in, "mesh");
 	/* Object *ob = BMO_slot_ptr_get(op, "object"); */
-	int dotess = !BMO_slot_bool_get(op->slots_in, "skip_tessface");
+	const bool dotess = !BMO_slot_bool_get(op->slots_in, "skip_tessface");
 
 	BM_mesh_bm_to_me(bm, me, dotess);
 }
diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c
index 61b061d..48b2f76 100644
--- a/source/blender/bmesh/operators/bmo_mirror.c
+++ b/source/blender/bmesh/operators/bmo_mirror.c
@@ -53,8 +53,8 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
 	float dist = BMO_slot_float_get(op->slots_in, "merge_dist");
 	int i, ototvert /*, ototedge */;
 	int axis = BMO_slot_int_get(op->slots_in, "axis");
-	int mirroru = BMO_slot_bool_get(op->slots_in, "mirror_u");
-	int mirrorv = BMO_slot_bool_get(op->slots_in, "mirror_v");
+	bool mirror_u = BMO_slot_bool_get(op->slots_in, "mirror_u");
+	bool mirror_v = BMO_slot_bool_get(op->slots_in, "mirror_v");
 	BMOpSlot *slot_targetmap;
 
 	ototvert = bm->totvert;
@@ -97,7 +97,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
 		v = BM_iter_step(&iter);
 	}
 	
-	if (mirroru || mirrorv) {
+	if (mirror_u || mirror_v) {
 		BMFace *f;
 		BMLoop *l;
 		MLoopUV *luv;
@@ -109,9 +109,9 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
 				totlayer = CustomData_number_of_layers(&bm->ldata, CD_MLOOPUV);
 				for (i = 0; i < totlayer; i++) {
 					luv = CustomData_bmesh_get_n(&bm->ldata, l->head.data, CD_MLOOPUV, i);
-					if (mirroru)
+					if (mirror_u)
 						luv->uv[0] = 1.0f - luv->uv[0];
-					if (mirrorv)
+					if (mirror_v)
 						luv->uv[1] = 1.0f - luv->uv[1];
 				}
 			}
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index c582f71..0110027 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -420,7 +420,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
 		v2 = eva[icoface[a][1]];
 		v3 = eva[icoface[a][2]];
 
-		eftemp = BM_face_create_quad_tri(bm, v1, v2, v3, NULL, NULL, FALSE);
+		eftemp = BM_face_create_quad_tri(bm, v1, v2, v3, NULL, NULL, false);
 		
 		BM_ITER_ELEM (l, &liter, eftemp, BM_LOOPS_OF_FACE) {
 			BMO_elem_flag_enable(bm, l->e, EDGE_MARK);
@@ -438,7 +438,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
 		             "cuts=%i "
 		             "use_grid_fill=%b use_sphere=%b",
 		             EDGE_MARK, dia, (1 << (subdiv - 1)) - 1,
-		             TRUE, TRUE);
+		             true, true);
 
 		BMO_op_exec(bm, &bmop);
 		BMO_slot_buffer_flag_enable(bm, bmop.slots_out, "geom.out", BM_VERT, VERT_MARK);
@@ -488,14 +488,14 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
 		                        tv[monkeyf[i][1] + i - monkeyo],
 		                        tv[monkeyf[i][2] + i - monkeyo],
 		                        (monkeyf[i][3] != monkeyf[i][2]) ? tv[monkeyf[i][3] + i - monkeyo] : NULL,
-		                        NULL, FALSE);
+		                        NULL, false);
 
 		BM_face_create_quad_tri(bm,
 		                        tv[monkeynv + monkeyf[i][2] + i - monkeyo],
 		                        tv[monkeynv + monkeyf[i][1] + i - monkeyo],
 		                        tv[monkeynv + monkeyf[i][0] + i - monkeyo],
 		                        (monkeyf[i][3] != monkeyf[i][2]) ? tv[monkeynv + monkeyf[i][3] + i - monkeyo] : NULL,
-		                        NULL, FALSE);
+		                        NULL, false);
 	}
 
 	MEM_freeN(tv);
@@ -508,8 +508,8 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
 {
 	const float dia = BMO_slot_float_get(op->slots_in, "diameter");
 	const int segs = BMO_slot_int_get(op->slots_in, "segments");
-	const int cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends");
-	const int cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris");
+	const bool cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends");
+	const bool cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris");
 
 	BMVert *v1, *lastv1 = NULL, *cent1, *firstv1 = NULL;
 	float vec[3], mat[4][4], phi, phid;
@@ -547,7 +547,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
 		if (a && cap_ends) {
 			BMFace *f;
 			
-			f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, FALSE);
+			f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, false);
 			BMO_elem_flag_enable(bm, f, FACE_NEW);
 		}
 		
@@ -565,7 +565,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
 	if (cap_ends) {
 		BMFace *f;
 		
-		f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, FALSE);
+		f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, false);
 		BMO_elem_flag_enable(bm, f, FACE_NEW);
 	}
 	
@@ -584,8 +584,8 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
 	float dia2 = BMO_slot_float_get(op->slots_in, "diameter2");
 	float depth = BMO_slot_float_get(op->slots_in, "depth");
 	int segs = BMO_slot_int_get(op->slots_in, "segments");
-	int cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends");
-	int cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris");
+	const bool cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends");
+	const bool cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris");
 	int a;
 	
 	if (!segs)
@@ -634,12 +634,12 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
 			if (cap_ends) {
 				BMFace *f;
 				
-				f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, FALSE);
+				f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, false);
 				BMO_elem_flag_enable(bm, f, FACE_NEW);
-				f = BM_face_create_quad_tri(bm, cent2, v2, lastv2, NULL, NULL, FALSE);
+				f = BM_face_create_quad_tri(bm, cent2, v2, lastv2, NULL, NULL, false);
 				BMO_elem_flag_enable(bm, f, FACE_NEW);
 			}
-			BM_face_create_quad_tri(bm, lastv1, lastv2, v2, v1, NULL, FALSE);
+			BM_face_create_quad_tri(bm, lastv1, lastv2, v2, v1, NULL, false);
 		}
 		else {
 			firstv1 = v1;
@@ -656,9 +656,9 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
 	if (cap_ends) {
 		BMFace *f;
 		
-		f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, FALSE);
+		f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, false);
 		BMO_elem_flag_enable(bm, f, FACE_NEW);
-		f = BM_face_create_quad_tri(bm, cent2, firstv2, v2, NULL, NULL, FALSE);
+		f = BM_face_create_quad_tri(bm, cent2, firstv2, v2, NULL, NULL, false);
 		BMO_elem_flag_enable(bm, f, FACE_NEW);
 	}
 	
@@ -666,7 +666,7 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
 		BMO_op_callf(bm, op->flag, "dissolve_faces faces=%ff", FACE_NEW);
 	}
 	
-	BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, FALSE);
+	BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, false);
 
 	BMO_op_callf(bm, op->flag, "remove_doubles verts=%fv dist=%f", VERT_MARK, 0.000001);
 	BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, VERT_MARK);
@@ -738,14 +738,14 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
 	BMO_elem_flag_enable(bm, v8, VERT_MARK);
 
 	/* the four sides */
-	BM_face_create_quad_tri(bm, v5, v6, v2, v1, NULL, FALSE);
-	BM_face_create_quad_tri(bm, v6, v7, v3, v2, NULL, FALSE);
-	BM_face_create_quad_tri(bm, v7, v8, v4, v3, NULL, FALSE);
-	BM_face_create_quad_tri(bm, v8, v5, v1, v4, NULL, FALSE);
+	BM_face_create_quad_tri(bm, v5, v6, v2, v1, NULL, false);
+	BM_face_create_quad_tri(bm, v6, v7, v3, v2, NULL, false);
+	BM_face_create_quad_tri(bm, v7, v8, v4, v3, NULL, false);
+	BM_face_create_quad_tri(bm, v8, v5, v1, v4, NULL, false);
 	
 	/* top/bottom */
-	BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, FALSE);
-	BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, FALSE);
+	BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, false);
+	BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, false);
 
 	BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, VERT_MARK);
 }
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c
index 87e26f1..7beac67 100644
--- a/source/blender/bmesh/operators/bmo_removedoubles.c
+++ b/source/blender/bmesh/operators/bmo_removedoubles.c
@@ -41,7 +41,7 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op, BMOpSlot
 	BMIter liter;
 	BMLoop *l;
 	BMVert *v2, *doub;
-	int split = FALSE;
+	bool split = false;
 
 	BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
 		v2 = BMO_slot_map_elem_get(slot_targetmap, l->v);
@@ -52,14 +52,14 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op, BMOpSlot
 		    (v2 != l->next->v))
 		{
 			doub = l->v;
-			split = TRUE;
+			split = true;
 			break;
 		}
 	}
 
 	if (split && doub != v2) {
 		BMLoop *nl;
-		BMFace *f2 = BM_face_split(bm, f, doub, v2, &nl, NULL, FALSE);
+		BMFace *f2 = BM_face_split(bm, f, doub, v2, &nl, NULL, false);
 
 		remdoubles_splitface(f, bm, op, slot_targetmap);
 		remdoubles_splitface(f2, bm, op, slot_targetmap);
@@ -87,12 +87,12 @@ int remdoubles_face_overlaps(BMesh *bm, BMVert **varr,
 			amount = BM_verts_in_face(bm, f, varr, len);
 			if (amount >= len) {
 				if (overlapface) *overlapface = f;
-				return TRUE;
+				return true;
 			}
 			f = BM_iter_step(&vertfaces);
 		}
 	}
-	return FALSE;
+	return false;
 }
 #endif
 
@@ -394,11 +394,10 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op)
 		if (!BMO_elem_flag_test(bm, e, EDGE_MARK))
 			continue;
 
-		e = BMW_begin(&walker, e->v1);
 		BLI_array_empty(edges);
 
 		INIT_MINMAX(min, max);
-		for (tot = 0; e; tot++, e = BMW_step(&walker)) {
+		for (e = BMW_begin(&walker, e->v1), tot = 0; e; e = BMW_step(&walker), tot++) {
 			BLI_array_grow_one(edges);
 			edges[tot] = e;
 
@@ -454,11 +453,9 @@ static void bmo_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer)
 			if (BMO_elem_flag_test(bm, l->e, EDGE_MARK)) {
 				/* walk */
 				BLI_array_empty(blocks);
-				tot = 0;
-				l2 = BMW_begin(&walker, l);
 
 				CustomData_data_initminmax(type, &min, &max);
-				for (tot = 0; l2; tot++, l2 = BMW_step(&walker)) {
+				for (l2 = BMW_begin(&walker, l), tot = 0; l2; l2 = BMW_step(&walker), tot++) {
 					BLI_array_grow_one(blocks);
 					blocks[tot] = CustomData_bmesh_get_layer_n(&bm->ldata, l2->head.data, layer);
 					CustomData_data_dominmax(type, blocks[tot], &min, &max);
diff --git a/source/blender/bmesh/operators/bmo_similar.c b/source/blender/bmesh/operators/bmo_similar.c
index 548e1ad..baabcff 100644
--- a/source/blender/bmesh/operators/bmo_similar.c
+++ b/source/blender/bmesh/operators/bmo_similar.c
@@ -185,21 +185,21 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
 	for (i = 0; i < num_total; i++) {
 		fm = f_ext[i].f;
 		if (!BMO_elem_flag_test(bm, fm, FACE_MARK) && !BM_elem_flag_test(fm, BM_ELEM_HIDDEN)) {
-			int cont = TRUE;
-			for (idx = 0; idx < num_sels && cont == TRUE; idx++) {
+			bool cont = true;
+			for (idx = 0; idx < num_sels && cont == true; idx++) {
 				fs = f_ext[indices[idx]].f;
 				switch (type) {
 					case SIMFACE_MATERIAL:
 						if (fm->mat_nr == fs->mat_nr) {
 							BMO_elem_flag_enable(bm, fm, FACE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
 					case SIMFACE_IMAGE:
 						if (f_ext[i].t == f_ext[indices[idx]].t) {
 							BMO_elem_flag_enable(bm, fm, FACE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -207,7 +207,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
 						angle = angle_normalized_v3v3(fs->no, fm->no);	/* if the angle between the normals -> 0 */
 						if (angle <= thresh_radians) {
 							BMO_elem_flag_enable(bm, fm, FACE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -217,7 +217,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
 							delta_fl = f_ext[i].d - f_ext[indices[idx]].d;
 							if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) {
 								BMO_elem_flag_enable(bm, fm, FACE_MARK);
-								cont = FALSE;
+								cont = false;
 							}
 						}
 						break;
@@ -226,7 +226,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
 						delta_fl = f_ext[i].area - f_ext[indices[idx]].area;
 						if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) {
 							BMO_elem_flag_enable(bm, fm, FACE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -234,7 +234,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
 						delta_i = fm->len - fs->len;
 						if (bm_sel_similar_cmp_i(delta_i, compare)) {
 							BMO_elem_flag_enable(bm, fm, FACE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -242,7 +242,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
 						delta_fl = f_ext[i].perim - f_ext[indices[idx]].perim;
 						if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) {
 							BMO_elem_flag_enable(bm, fm, FACE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 					default:
@@ -373,15 +373,15 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
 	for (i = 0; i < num_total; i++) {
 		e = e_ext[i].e;
 		if (!BMO_elem_flag_test(bm, e, EDGE_MARK) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
-			int cont = TRUE;
-			for (idx = 0; idx < num_sels && cont == TRUE; idx++) {
+			bool cont = true;
+			for (idx = 0; idx < num_sels && cont == true; idx++) {
 				es = e_ext[indices[idx]].e;
 				switch (type) {
 					case SIMEDGE_LENGTH:
 						delta_fl = e_ext[i].length - e_ext[indices[idx]].length;
 						if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) {
 							BMO_elem_flag_enable(bm, e, EDGE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -394,7 +394,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
 
 						if (angle / (float)(M_PI / 2.0) <= thresh) {
 							BMO_elem_flag_enable(bm, e, EDGE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -402,7 +402,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
 						delta_i = e_ext[i].faces - e_ext[indices[idx]].faces;
 						if (bm_sel_similar_cmp_i(delta_i, compare)) {
 							BMO_elem_flag_enable(bm, e, EDGE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -411,12 +411,12 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
 							if (e_ext[indices[idx]].faces == 2) {
 								if (fabsf(e_ext[i].angle - e_ext[indices[idx]].angle) <= thresh) {
 									BMO_elem_flag_enable(bm, e, EDGE_MARK);
-									cont = FALSE;
+									cont = false;
 								}
 							}
 						}
 						else {
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -430,7 +430,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
 
 							if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) {
 								BMO_elem_flag_enable(bm, e, EDGE_MARK);
-								cont = FALSE;
+								cont = false;
 							}
 						}
 						break;
@@ -445,7 +445,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
 
 							if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) {
 								BMO_elem_flag_enable(bm, e, EDGE_MARK);
-								cont = FALSE;
+								cont = false;
 							}
 						}
 						break;
@@ -453,14 +453,14 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
 					case SIMEDGE_SEAM:
 						if (BM_elem_flag_test(e, BM_ELEM_SEAM) == BM_elem_flag_test(es, BM_ELEM_SEAM)) {
 							BMO_elem_flag_enable(bm, e, EDGE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
 					case SIMEDGE_SHARP:
 						if (BM_elem_flag_test(e, BM_ELEM_SMOOTH) == BM_elem_flag_test(es, BM_ELEM_SMOOTH)) {
 							BMO_elem_flag_enable(bm, e, EDGE_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 					default:
@@ -562,15 +562,15 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op)
 	for (i = 0; i < num_total; i++) {
 		v = v_ext[i].v;
 		if (!BMO_elem_flag_test(bm, v, VERT_MARK) && !BM_elem_flag_test(v, BM_ELEM_HIDDEN)) {
-			int cont = TRUE;
-			for (idx = 0; idx < num_sels && cont == TRUE; idx++) {
+			bool cont = true;
+			for (idx = 0; idx < num_sels && cont == true; idx++) {
 				vs = v_ext[indices[idx]].v;
 				switch (type) {
 					case SIMVERT_NORMAL:
 						/* compare the angle between the normals */
 						if (angle_normalized_v3v3(v->no, vs->no) <= thresh_radians) {
 							BMO_elem_flag_enable(bm, v, VERT_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 					case SIMVERT_FACE:
@@ -578,7 +578,7 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op)
 						delta_i = v_ext[i].num_faces - v_ext[indices[idx]].num_faces;
 						if (bm_sel_similar_cmp_i(delta_i, compare)) {
 							BMO_elem_flag_enable(bm, v, VERT_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 
@@ -586,7 +586,7 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op)
 						if (v_ext[i].dvert != NULL && v_ext[indices[idx]].dvert != NULL) {
 							if (defvert_find_shared(v_ext[i].dvert, v_ext[indices[idx]].dvert) != -1) {
 								BMO_elem_flag_enable(bm, v, VERT_MARK);
-								cont = FALSE;
+								cont = false;
 							}
 						}
 						break;
@@ -595,7 +595,7 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op)
 						delta_i = v_ext[i].num_edges - v_ext[indices[idx]].num_edges;
 						if (bm_sel_similar_cmp_i(delta_i, compare)) {
 							BMO_elem_flag_enable(bm, v, VERT_MARK);
-							cont = FALSE;
+							cont = false;
 						}
 						break;
 					default:
diff --git a/source/blender/bmesh/operators/bmo_slide.c b/source/blender/bmesh/operators/bmo_slide.c
deleted file mode 100644
index ea9f9bf..0000000
--- a/source/blender/bmesh/operators/bmo_slide.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Contributor(s): Francisco De La Cruz
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/bmesh/operators/bmo_slide.c
- *  \ingroup bmesh
- */
-
-#include "MEM_guardedalloc.h"
-
-#include "BKE_global.h"
-
-#include "BLI_math.h"
-
-#include "bmesh.h"
-#include "intern/bmesh_operators_private.h" /* own include */
-
-#define EDGE_MARK 1
-#define VERT_MARK 2
-
-/*
- * Slides a vertex along a connected edge
- *
- */
-void bmo_slide_vert_exec(BMesh *bm, BMOperator *op)
-{
-	BMOIter oiter;
-	BMIter iter;
-	BMHeader *h;
-	BMVert *vertex;
-	BMEdge *edge;
-	BMEdge *slide_edge;
-
-	/* Selection counts */
-	int selected_edges = 0;
-
-	/* Get slide amount */
-	const float factor = BMO_slot_float_get(op->slots_in, "factor");
-
-	/* Get start vertex */
-	vertex = BMO_slot_buffer_get_single(BMO_slot_get(op->slots_in, "vert"));
-
-	if (!vertex) {
-		if (G.debug & G_DEBUG) {
-			fprintf(stderr, "slide_vert: No vertex selected...");
-		}
-		BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide error: invalid selection");
-		return;
-	}
-
-	/* BMESH_TODO - this is odd, it only uses one edge, why take a list at all? */
-	/* Count selected edges */
-	BMO_ITER (h, &oiter, op->slots_in, "edges", BM_EDGE) {
-		selected_edges++;
-		/* Mark all selected edges (cast BMHeader->BMEdge) */
-		BMO_elem_flag_enable(bm, (BMElemF *)h, EDGE_MARK);
-		break;
-	}
-
-	/* Only allow sliding if an edge is selected */
-	if (selected_edges == 0) {
-		if (G.debug & G_DEBUG) {
-			fprintf(stderr, "slide_vert: select a single edge\n");
-		}
-		BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide error: invalid selection");
-		return;
-	}
-
-	/* Make sure we get the correct edge. */
-	slide_edge = NULL;
-	BM_ITER_ELEM (edge, &iter, vertex, BM_EDGES_OF_VERT) {
-		if (BMO_elem_flag_test(bm, edge, EDGE_MARK) && BM_vert_in_edge(edge, vertex)) {
-			slide_edge = edge;
-			break;
-		}
-	}
-
-	/* Found edge */
-	if (slide_edge) {
-		BMVert *other = BM_edge_other_vert(slide_edge, vertex);
-
-		/* mark */
-		BMO_elem_flag_enable(bm, vertex, VERT_MARK);
-
-		/* Interpolate */
-		interp_v3_v3v3(vertex->co, vertex->co, other->co, factor);
-	}
-
-	/* Return the new edge. The same previously marked with VERT_MARK */
-	BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, VERT_MARK);
-	return;
-}
-
-#undef EDGE_MARK
-#undef VERT_MARK
diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
index ce58468..ba755a8 100644
--- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c
+++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
@@ -180,7 +180,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys)
 	float *v1, *v2, *v3, *v4;
 	float w1, w2, w3, w4;
 	int i, j;
-	int has_4_vert;
+	bool has_4_vert;
 	unsigned int idv1, idv2, idv3, idv4, idv[4];
 	BMEdge *e;
 	BMFace *f;
@@ -297,7 +297,7 @@ static void fill_laplacian_matrix(LaplacianSystem *sys)
 	float *v1, *v2, *v3, *v4;
 	float w2, w3, w4;
 	int i, j;
-	int has_4_vert;
+	bool has_4_vert;
 	unsigned int idv1, idv2, idv3, idv4, idv[4];
 
 	BMEdge *e;
@@ -537,7 +537,7 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op)
 {
 	int i;
 	int m_vertex_id;
-	int usex, usey, usez, preserve_volume;
+	bool usex, usey, usez, preserve_volume;
 	float lambda_factor, lambda_border;
 	float w;
 	BMOIter siter;
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index 7407eb4..36ad8ef 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -90,7 +90,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace *
 	}
 
 	if (curf) {
-		face = BM_face_split(bm, curf, v1, v2, &nl, NULL, FALSE);
+		face = BM_face_split(bm, curf, v1, v2, &nl, NULL, false);
 		
 		if (r_nf) *r_nf = face;
 		return nl ? nl->e : NULL;
@@ -165,7 +165,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDPar
 	}
 
 	/* apply the new difference to the rest of the shape keys,
-	 * note that this dosn't take rotations into account, we _could_ support
+	 * note that this doesn't take rotations into account, we _could_ support
 	 * this by getting the normals and coords for each shape key and
 	 * re-calculate the smooth value for each but this is quite involved.
 	 * for now its ok to simply apply the difference IMHO - campbell */
@@ -715,8 +715,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
 	BMFace *face;
 	BLI_array_declare(verts);
 	float smooth, fractal, along_normal;
-	int use_sphere, cornertype, use_single_edge, use_grid_fill, use_only_quads;
-	int skey, seed, i, j, matched, a, b, numcuts, totesel;
+	bool use_sphere, use_single_edge, use_grid_fill, use_only_quads;
+	int cornertype, skey, seed, i, j, matched, a, b, numcuts, totesel;
 	
 	BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, SUBD_SPLIT);
 	
@@ -912,6 +912,10 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
 			j = BLI_array_count(facedata) - 1;
 			
 			BMO_elem_flag_enable(bm, face, SUBD_SPLIT);
+
+			/* must initialize all members here */
+			facedata[j].start = NULL;
+			facedata[j].pat = NULL;
 			facedata[j].totedgesel = totesel;
 			facedata[j].face = face;
 		}
@@ -983,7 +987,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
 
 			BLI_array_grow_items(loops_split, numcuts);
 			for (j = 0; j < numcuts; j++) {
-				int ok = TRUE;
+				bool ok = true;
 
 				/* Check for special case: [#32500]
 				 * This edge pair could be used by more then one face,
@@ -1006,7 +1010,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
 								BLI_assert(other_loop->prev->v != loops[a]->v);
 								BLI_assert(other_loop->next->v != loops[a]->v);
 
-								ok = FALSE;
+								ok = false;
 								break;
 							}
 						}
@@ -1014,7 +1018,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
 				}
 
 
-				if (ok == TRUE) {
+				if (ok == true) {
 					loops_split[j][0] = loops[a];
 					loops_split[j][1] = loops[b];
 				}
@@ -1036,10 +1040,10 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
 
 			for (j = 0; j < BLI_array_count(loops_split); j++) {
 				if (loops_split[j][0]) {
-					BLI_assert(BM_edge_exists(loops_split[j][0]->v, loops_split[j][1]->v) == FALSE);
+					BLI_assert(BM_edge_exists(loops_split[j][0]->v, loops_split[j][1]->v) == NULL);
 
 					/* BMFace *nf = */ /* UNUSED */
-					BM_face_split(bm, face, loops_split[j][0]->v, loops_split[j][1]->v, &nl, NULL, FALSE);
+					BM_face_split(bm, face, loops_split[j][0]->v, loops_split[j][1]->v, &nl, NULL, false);
 				}
 			}
 
@@ -1123,7 +1127,7 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag,
 		BMElem *ele;
 
 		for (ele = BMO_iter_new(&iter, op.slots_out, "geom_inner.out", BM_EDGE | BM_VERT); ele; ele = BMO_iter_step(&iter)) {
-			BM_elem_select_set(bm, ele, TRUE);
+			BM_elem_select_set(bm, ele, true);
 		}
 	}
 	else if (seltype == SUBDIV_SELECT_LOOPCUT) {
@@ -1131,10 +1135,10 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag,
 		BMElem *ele;
 		
 		/* deselect input */
-		BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
+		BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
 
 		for (ele = BMO_iter_new(&iter, op.slots_out, "geom_inner.out", BM_EDGE | BM_VERT); ele; ele = BMO_iter_step(&iter)) {
-			BM_elem_select_set(bm, ele, TRUE);
+			BM_elem_select_set(bm, ele, true);
 
 			if (ele->head.htype == BM_VERT) {
 				BMEdge *e;
@@ -1145,13 +1149,13 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag,
 					     BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
 					     BM_elem_flag_test(e->v2, BM_ELEM_SELECT))
 					{
-						BM_edge_select_set(bm, e, TRUE);
+						BM_edge_select_set(bm, e, true);
 					}
 					else if (BM_elem_flag_test(e, BM_ELEM_SELECT) &&
 					         (!BM_elem_flag_test(e->v1, BM_ELEM_SELECT) ||
 					          !BM_elem_flag_test(e->v2, BM_ELEM_SELECT)))
 					{
-						BM_edge_select_set(bm, e, FALSE);
+						BM_edge_select_set(bm, e, false);
 					}
 				}
 			}
diff --git a/source/blender/bmesh/operators/bmo_symmetrize.c b/source/blender/bmesh/operators/bmo_symmetrize.c
index 172f0d4..0bfc81f 100644
--- a/source/blender/bmesh/operators/bmo_symmetrize.c
+++ b/source/blender/bmesh/operators/bmo_symmetrize.c
@@ -176,7 +176,7 @@ static void symm_split_asymmetric_edges(Symm *symm)
 			                       plane_co[symm->axis][0],
 			                       plane_co[symm->axis][1],
 			                       plane_co[symm->axis][2],
-			                       &lambda, TRUE);
+			                       &lambda, true);
 			BLI_assert(r);
 
 			madd_v3_v3v3fl(co, e->v1->co, edge_dir, lambda);
@@ -244,7 +244,7 @@ typedef struct {
 	int len;
 
 	/* True only if none of the polygon's edges were split */
-	int already_symmetric;
+	bool already_symmetric;
 
 	BMFace *src_face;
 } SymmPoly;
@@ -261,11 +261,11 @@ static void symm_poly_with_splits(const Symm *symm,
 
 	/* Count vertices and check for edge splits */
 	out->len = f->len;
-	out->already_symmetric = TRUE;
+	out->already_symmetric = true;
 	BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) {
 		if (BLI_ghash_haskey(symm->edge_split_map, l->e)) {
 			out->len++;
-			out->already_symmetric = FALSE;
+			out->already_symmetric = false;
 		}
 	}
 
@@ -332,11 +332,11 @@ static BMVert *symm_poly_mirror_dst(const Symm *symm,
 		return NULL;
 }
 
-static int symm_poly_next_crossing(const Symm *symm,
-                                   const SymmPoly *sp,
-                                   int start,
-                                   int *l1,
-                                   int *l2)
+static bool symm_poly_next_crossing(const Symm *symm,
+                                    const SymmPoly *sp,
+                                    int start,
+                                    int *l1,
+                                    int *l2)
 {
 	int i;
 
@@ -347,12 +347,12 @@ static int symm_poly_next_crossing(const Symm *symm,
 		if ((symm_poly_co_side(symm, sp, *l1) == SYMM_SIDE_KILL) ^
 		    (symm_poly_co_side(symm, sp, *l2) == SYMM_SIDE_KILL))
 		{
-			return TRUE;
+			return true;
 		}
 	}
 
 	BLI_assert(!"symm_poly_next_crossing failed");
-	return FALSE;
+	return false;
 }
 
 static BMFace *symm_face_create_v(BMesh *bm, BMFace *example,
@@ -378,7 +378,7 @@ static BMFace *symm_face_create_v(BMesh *bm, BMFace *example,
 	f_new = BM_face_create(bm, fv, fe, len, BM_CREATE_NO_DOUBLE);
 	if (example)
 		BM_elem_attrs_copy(bm, bm, example, f_new);
-	BM_face_select_set(bm, f_new, TRUE);
+	BM_face_select_set(bm, f_new, true);
 	BMO_elem_flag_enable(bm, f_new, SYMM_OUTPUT_GEOM);
 
 	return f_new;
@@ -465,15 +465,15 @@ static void symm_mirror_polygons(Symm *symm)
 	BMO_ITER (f, &oiter, symm->op->slots_in, "input", BM_FACE) {
 		BMIter iter;
 		BMLoop *l;
-		int mirror_all = TRUE, ignore_all = TRUE;
+		bool mirror_all = true, ignore_all = true;
 
 		/* Check if entire polygon can be mirrored or ignored */
 		BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) {
 			const SymmSide side = symm_co_side(symm, l->v->co);
 			if (side == SYMM_SIDE_KILL)
-				mirror_all = FALSE;
+				mirror_all = false;
 			else if (side == SYMM_SIDE_KEEP)
-				ignore_all = FALSE;
+				ignore_all = false;
 		}
 
 		if (mirror_all) {
diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c
index 663ee46..1f04c7c 100644
--- a/source/blender/bmesh/operators/bmo_triangulate.c
+++ b/source/blender/bmesh/operators/bmo_triangulate.c
@@ -37,45 +37,22 @@
 
 #include "intern/bmesh_operators_private.h" /* own include */
 
-#define EDGE_NEW	1
-#define FACE_NEW	1
-
 #define ELE_NEW		1
 #define FACE_MARK	2
 #define EDGE_MARK	4
 
 void bmo_triangulate_exec(BMesh *bm, BMOperator *op)
 {
-	BMOIter siter;
-	BMFace *face, **newfaces = NULL;
-	BLI_array_declare(newfaces);
-	float (*projectverts)[3] = NULL;
-	BLI_array_declare(projectverts);
-	int i;
-	const int use_beauty = BMO_slot_bool_get(op->slots_in, "use_beauty");
+	const bool use_beauty = BMO_slot_bool_get(op->slots_in, "use_beauty");
 	BMOpSlot *slot_facemap_out = BMO_slot_get(op->slots_out, "face_map.out");
 
-	for (face = BMO_iter_new(&siter, op->slots_in, "faces", BM_FACE); face; face = BMO_iter_step(&siter)) {
-
-		BLI_array_empty(projectverts);
-		BLI_array_empty(newfaces);
-
-		BLI_array_grow_items(projectverts, face->len * 3);
-		BLI_array_grow_items(newfaces, face->len);
+	BM_mesh_elem_hflag_disable_all(bm, BM_FACE | BM_EDGE, BM_ELEM_TAG, false);
+	BMO_slot_buffer_hflag_enable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false);
 
-		BM_face_triangulate(bm, face, projectverts, EDGE_NEW, FACE_NEW, newfaces, use_beauty);
+	BM_mesh_triangulate(bm, use_beauty, true, op, slot_facemap_out);
 
-		BMO_slot_map_elem_insert(op, slot_facemap_out, face, face);
-		for (i = 0; newfaces[i]; i++) {
-			BMO_slot_map_elem_insert(op, slot_facemap_out, newfaces[i], face);
-		}
-	}
-	
-	BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "edges.out", BM_EDGE, EDGE_NEW);
-	BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "faces.out", BM_FACE, FACE_NEW);
-	
-	BLI_array_free(projectverts);
-	BLI_array_free(newfaces);
+	BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_TAG);
+	BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "faces.out", BM_FACE, BM_ELEM_TAG);
 }
 
 void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
@@ -86,7 +63,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
 	BMEdge *e;
 	int stop = 0;
 	
-	BMO_slot_buffer_flag_enable(bm, op->slots_in, "constrain_edges", BM_EDGE, EDGE_MARK);
+	BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, EDGE_MARK);
 	
 	BMO_ITER (f, &siter, op->slots_in, "faces", BM_FACE) {
 		if (f->len == 3) {
@@ -100,7 +77,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
 		BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
 			BMVert *v1, *v2, *v3, *v4;
 			
-			if (!BM_edge_is_manifold(e) || BMO_elem_flag_test(bm, e, EDGE_MARK)) {
+			if (!BM_edge_is_manifold(e) || !BMO_elem_flag_test(bm, e, EDGE_MARK)) {
 				continue;
 			}
 
@@ -109,12 +86,12 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
 			{
 				continue;
 			}
-			
+
 			v1 = e->l->prev->v;
 			v2 = e->l->v;
 			v3 = e->l->radial_next->prev->v;
 			v4 = e->l->next->v;
-			
+
 			if (is_quad_convex_v3(v1->co, v2->co, v3->co, v4->co)) {
 				float len1, len2, len3, len4, len5, len6, opp1, opp2, fac1, fac2;
 				/* testing rule:
@@ -138,9 +115,9 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
 				fac2 = opp1 / (len2 + len3 + len6) + opp2 / (len4 + len1 + len6);
 				
 				if (fac1 > fac2) {
-					e = BM_edge_rotate(bm, e, FALSE, BM_EDGEROT_CHECK_EXISTS);
+					e = BM_edge_rotate(bm, e, false, BM_EDGEROT_CHECK_EXISTS);
 					if (e) {
-						BMO_elem_flag_enable(bm, e, ELE_NEW);
+						BMO_elem_flag_enable(bm, e, ELE_NEW | EDGE_MARK);
 
 						BMO_elem_flag_enable(bm, e->l->f, FACE_MARK | ELE_NEW);
 						BMO_elem_flag_enable(bm, e->l->radial_next->f, FACE_MARK | ELE_NEW);
@@ -156,9 +133,9 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
 
 void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
 {
+	const bool use_beauty = BMO_slot_bool_get(op->slots_in, "use_beauty");
 	BMOIter siter;
 	BMEdge *e;
-	BMOperator bmop;
 	ScanFillContext sf_ctx;
 	/* ScanFillEdge *sf_edge; */ /* UNUSED */
 	ScanFillVert *sf_vert, *sf_vert_1, *sf_vert_2;
@@ -195,7 +172,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
 	for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
 		BMFace *f = BM_face_create_quad_tri(bm,
 		                                    sf_tri->v1->tmp.p, sf_tri->v2->tmp.p, sf_tri->v3->tmp.p, NULL,
-		                                    NULL, TRUE);
+		                                    NULL, true);
 		BMLoop *l;
 		BMIter liter;
 		
@@ -210,11 +187,14 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
 	BLI_scanfill_end(&sf_ctx);
 	BLI_smallhash_release(&hash);
 	
-	/* clean up fill */
-	BMO_op_initf(bm, &bmop, op->flag, "beautify_fill faces=%ff constrain_edges=%fe", ELE_NEW, EDGE_MARK);
-	BMO_op_exec(bm, &bmop);
-	BMO_slot_buffer_flag_enable(bm, bmop.slots_out, "geom.out", BM_FACE | BM_EDGE, ELE_NEW);
-	BMO_op_finish(bm, &bmop);
+	if (use_beauty) {
+		BMOperator bmop;
+
+		BMO_op_initf(bm, &bmop, op->flag, "beautify_fill faces=%ff edges=%Fe", ELE_NEW, EDGE_MARK);
+		BMO_op_exec(bm, &bmop);
+		BMO_slot_buffer_flag_enable(bm, bmop.slots_out, "geom.out", BM_FACE | BM_EDGE, ELE_NEW);
+		BMO_op_finish(bm, &bmop);
+	}
 	
 	BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "geom.out", BM_EDGE | BM_FACE, ELE_NEW);
 }
diff --git a/source/blender/bmesh/operators/bmo_unsubdivide.c b/source/blender/bmesh/operators/bmo_unsubdivide.c
index fae7db3..784e695 100644
--- a/source/blender/bmesh/operators/bmo_unsubdivide.c
+++ b/source/blender/bmesh/operators/bmo_unsubdivide.c
@@ -55,5 +55,5 @@ void bmo_unsubdivide_exec(BMesh *bm, BMOperator *op)
 	}
 
 	/* do all the real work here */
-	BM_mesh_decimate_unsubdivide_ex(bm, iterations, TRUE);
+	BM_mesh_decimate_unsubdivide_ex(bm, iterations, true);
 }
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c
index 64dbf0c..6398d9d 100644
--- a/source/blender/bmesh/operators/bmo_utils.c
+++ b/source/blender/bmesh/operators/bmo_utils.c
@@ -122,8 +122,8 @@ void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op)
 {
 	BMOIter siter;
 	BMEdge *e, *e2;
-	const int use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
-	const int is_single = BMO_slot_buffer_count(op->slots_in, "edges") == 1;
+	const bool use_ccw   = BMO_slot_bool_get(op->slots_in, "use_ccw");
+	const bool is_single = BMO_slot_buffer_count(op->slots_in, "edges") == 1;
 	short check_flag = is_single ?
 	            BM_EDGEROT_CHECK_EXISTS :
 	            BM_EDGEROT_CHECK_EXISTS | BM_EDGEROT_CHECK_DEGENERATE;
@@ -140,8 +140,8 @@ void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op)
 			if (BM_edge_face_pair(e, &fa, &fb)) {
 
 				/* check we're untouched */
-				if (BMO_elem_flag_test(bm, fa, FACE_TAINT) == FALSE &&
-				    BMO_elem_flag_test(bm, fb, FACE_TAINT) == FALSE)
+				if (BMO_elem_flag_test(bm, fa, FACE_TAINT) == false &&
+				    BMO_elem_flag_test(bm, fb, FACE_TAINT) == false)
 				{
 
 					if (!(e2 = BM_edge_rotate(bm, e, use_ccw, check_flag))) {
@@ -172,14 +172,14 @@ void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op)
 #define SEL_FLAG	1
 #define SEL_ORIG	2
 
-static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, int usefaces)
+static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, const bool use_faces)
 {
 	BMVert *v;
 	BMEdge *e;
 	BMIter eiter;
 	BMOIter siter;
 
-	if (!usefaces) {
+	if (!use_faces) {
 		BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
 			BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
 				if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN))
@@ -216,14 +216,14 @@ static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, int usefaces)
 	}
 }
 
-static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, int usefaces)
+static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, const bool use_faces)
 {
 	BMVert *v;
 	BMEdge *e;
 	BMIter eiter;
 	BMOIter siter;
 
-	if (!usefaces) {
+	if (!use_faces) {
 		BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
 			BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
 				if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN))
@@ -265,8 +265,8 @@ static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, int usefaces)
 
 void bmo_region_extend_exec(BMesh *bm, BMOperator *op)
 {
-	int use_faces = BMO_slot_bool_get(op->slots_in, "use_faces");
-	int constrict = BMO_slot_bool_get(op->slots_in, "use_constrict");
+	const bool use_faces = BMO_slot_bool_get(op->slots_in, "use_faces");
+	const bool constrict = BMO_slot_bool_get(op->slots_in, "use_constrict");
 
 	BMO_slot_buffer_flag_enable(bm, op->slots_in, "geom", BM_ALL_NOLOOP, SEL_ORIG);
 
@@ -314,7 +314,8 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
 	BLI_array_declare(fstack);
 	BMLoop *l, *l2;
 	float maxx, maxx_test, cent[3];
-	int i, i_max, flagflip = BMO_slot_bool_get(op->slots_in, "use_flip");
+	int i, i_max;
+	const bool use_flip = BMO_slot_bool_get(op->slots_in, "use_flip");
 
 	startf = NULL;
 	maxx = -1.0e10;
@@ -349,7 +350,7 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
 		BM_face_normal_flip(bm, startf);
 		BMO_elem_flag_toggle(bm, startf, FACE_FLIP);
 
-		if (flagflip)
+		if (use_flip)
 			BM_elem_flag_toggle(startf, BM_ELEM_TAG);
 	}
 	
@@ -381,11 +382,11 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
 						BM_face_normal_flip(bm, l2->f);
 						
 						BMO_elem_flag_toggle(bm, l2->f, FACE_FLIP);
-						if (flagflip)
+						if (use_flip)
 							BM_elem_flag_toggle(l2->f, BM_ELEM_TAG);
 					}
 					else if (BM_elem_flag_test(l2->f, BM_ELEM_TAG) || BM_elem_flag_test(l->f, BM_ELEM_TAG)) {
-						if (flagflip) {
+						if (use_flip) {
 							BM_elem_flag_disable(l->f, BM_ELEM_TAG);
 							BM_elem_flag_disable(l2->f, BM_ELEM_TAG);
 						}
@@ -436,9 +437,11 @@ void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op)
 	i = 0;
 	BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) {
 		BLI_array_grow_one(cos);
+
 		co = cos[i];
-		
-		j  = 0;
+		zero_v3(co);
+
+		j = 0;
 		BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
 			co2 = BM_edge_other_vert(e, v)->co;
 			add_v3_v3v3(co, co, co2);
@@ -489,11 +492,11 @@ void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op)
 	BMFace *fs;       /* current face */
 	BMIter l_iter;    /* iteration loop */
 
-	const int use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
+	const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
 
 	BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
 		if (CustomData_has_layer(&(bm->ldata), CD_MLOOPUV)) {
-			if (use_ccw == FALSE) {  /* same loops direction */
+			if (use_ccw == false) {  /* same loops direction */
 				BMLoop *lf;	/* current face loops */
 				MLoopUV *f_luv; /* first face loop uv */
 				float p_uv[2];	/* previous uvs */
@@ -594,11 +597,11 @@ void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op)
 	BMFace *fs;       /* current face */
 	BMIter l_iter;    /* iteration loop */
 
-	const int use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
+	const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
 
 	BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
 		if (CustomData_has_layer(&(bm->ldata), CD_MLOOPCOL)) {
-			if (use_ccw == FALSE) {  /* same loops direction */
+			if (use_ccw == false) {  /* same loops direction */
 				BMLoop *lf;	/* current face loops */
 				MLoopCol *f_lcol; /* first face loop color */
 				MLoopCol p_col;	/* previous color */
diff --git a/source/blender/bmesh/operators/bmo_wireframe.c b/source/blender/bmesh/operators/bmo_wireframe.c
index 7401704..0d603fa 100644
--- a/source/blender/bmesh/operators/bmo_wireframe.c
+++ b/source/blender/bmesh/operators/bmo_wireframe.c
@@ -134,34 +134,34 @@ static void bm_vert_boundary_tangent(BMVert *v, float r_no[3], float r_no_face[3
 }
 
 /* check if we are the only tagged loop-face around this edge */
-static int bm_loop_is_radial_boundary(BMLoop *l_first)
+static bool bm_loop_is_radial_boundary(BMLoop *l_first)
 {
 	BMLoop *l = l_first->radial_next;
 
 	if (l == l_first) {
-		return TRUE; /* a real boundary */
+		return true; /* a real boundary */
 	}
 	else {
 		do {
 			if (BM_elem_flag_test(l->f, BM_ELEM_TAG)) {
-				return FALSE;
+				return false;
 			}
 		} while ((l = l->radial_next) != l_first);
 	}
-	return TRUE;
+	return true;
 }
 
 extern float BM_vert_calc_mean_tagged_edge_length(BMVert *v);
 
 void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
 {
-	const int use_boundary        = BMO_slot_bool_get(op->slots_in,  "use_boundary");
-	const int use_even_offset     = BMO_slot_bool_get(op->slots_in,  "use_even_offset");
-	const int use_relative_offset = BMO_slot_bool_get(op->slots_in,  "use_relative_offset");
-	const int use_crease          = (BMO_slot_bool_get(op->slots_in,  "use_crease") &&
-	                                 CustomData_has_layer(&bm->edata, CD_CREASE));
-	const float depth             = BMO_slot_float_get(op->slots_in, "thickness");
-	const float inset             = depth;
+	const bool use_boundary        = BMO_slot_bool_get(op->slots_in,  "use_boundary");
+	const bool use_even_offset     = BMO_slot_bool_get(op->slots_in,  "use_even_offset");
+	const bool use_relative_offset = BMO_slot_bool_get(op->slots_in,  "use_relative_offset");
+	const bool use_crease          = (BMO_slot_bool_get(op->slots_in,  "use_crease") &&
+	                                  CustomData_has_layer(&bm->edata, CD_CREASE));
+	const float depth              = BMO_slot_float_get(op->slots_in, "thickness");
+	const float inset              = depth;
 
 	const int totvert_orig = bm->totvert;
 
@@ -203,7 +203,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
 	}
 
 	/* setup tags, all faces and verts will be tagged which will be duplicated */
-	BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE);
+	BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false);
 
 	BMO_ITER (f_src, &oiter, op->slots_in, "faces", BM_FACE) {
 		verts_loop_tot += f_src->len;
@@ -239,13 +239,13 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
 		}
 
 		/* conflicts with BM_vert_calc_mean_tagged_edge_length */
-		if (use_relative_offset == FALSE) {
+		if (use_relative_offset == false) {
 			BM_elem_flag_disable(v_src, BM_ELEM_TAG);
 		}
 	}
 
 	if (use_relative_offset) {
-		BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, FALSE);
+		BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, false);
 	}
 
 	verts_loop = MEM_mallocN(sizeof(BMVert **) * verts_loop_tot, __func__);
@@ -332,7 +332,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
 			BMVert *v_pos1 = verts_pos[i_1];
 			BMVert *v_pos2 = verts_pos[i_2];
 
-			f_new = BM_face_create_quad_tri(bm, v_l1, v_l2, v_neg2, v_neg1, f_src, FALSE);
+			f_new = BM_face_create_quad_tri(bm, v_l1, v_l2, v_neg2, v_neg1, f_src, false);
 			BM_elem_flag_enable(f_new, BM_ELEM_TAG);
 			l_new = BM_FACE_FIRST_LOOP(f_new);
 
@@ -341,7 +341,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
 			BM_elem_attrs_copy(bm, bm, l_next, l_new->next);
 			BM_elem_attrs_copy(bm, bm, l_next, l_new->next->next);
 
-			f_new = BM_face_create_quad_tri(bm, v_l2, v_l1, v_pos1, v_pos2, f_src, FALSE);
+			f_new = BM_face_create_quad_tri(bm, v_l2, v_l1, v_pos1, v_pos2, f_src, false);
 			BM_elem_flag_enable(f_new, BM_ELEM_TAG);
 			l_new = BM_FACE_FIRST_LOOP(f_new);
 
@@ -357,7 +357,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
 					BMVert *v_b1 = verts_boundary[i_1];
 					BMVert *v_b2 = verts_boundary[i_2];
 
-					f_new = BM_face_create_quad_tri(bm, v_b2, v_b1, v_neg1, v_neg2, f_src, FALSE);
+					f_new = BM_face_create_quad_tri(bm, v_b2, v_b1, v_neg1, v_neg2, f_src, false);
 					BM_elem_flag_enable(f_new, BM_ELEM_TAG);
 					l_new = BM_FACE_FIRST_LOOP(f_new);
 
@@ -366,7 +366,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
 					BM_elem_attrs_copy(bm, bm, l,      l_new->next);
 					BM_elem_attrs_copy(bm, bm, l,      l_new->next->next);
 
-					f_new = BM_face_create_quad_tri(bm, v_b1, v_b2, v_pos2, v_pos1, f_src, FALSE);
+					f_new = BM_face_create_quad_tri(bm, v_b1, v_b2, v_pos2, v_pos1, f_src, false);
 					BM_elem_flag_enable(f_new, BM_ELEM_TAG);
 					l_new = BM_FACE_FIRST_LOOP(f_new);
 
diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c
index 5e1d581..47b5076 100644
--- a/source/blender/bmesh/tools/BME_bevel.c
+++ b/source/blender/bmesh/tools/BME_bevel.c
@@ -90,7 +90,7 @@ static BME_TransData *BME_assign_transdata(BME_TransData_Head *td, BMesh *bm, BM
                                            float factor, float weight, float maxfactor, float *max)
 {
 	BME_TransData *vtd;
-	int is_new = 0;
+	int is_new = false;
 
 	if (v == NULL) {
 		return NULL;
@@ -100,7 +100,7 @@ static BME_TransData *BME_assign_transdata(BME_TransData_Head *td, BMesh *bm, BM
 		vtd = BLI_memarena_alloc(td->ma, sizeof(*vtd));
 		BLI_ghash_insert(td->gh, v, vtd);
 		td->len++;
-		is_new = 1;
+		is_new = true;
 	}
 
 	vtd->bm = bm;
@@ -151,12 +151,12 @@ static void BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
 {
 	BMFace *f;
 	BMEdge *e;
-	int done;
+	bool done;
 
 	if (v->e) {
-		done = FALSE;
+		done = false;
 		while (!done) {
-			done = TRUE;
+			done = true;
 			e = v->e; /*loop the edge looking for a edge to dissolve*/
 			do {
 				f = NULL;
@@ -164,14 +164,14 @@ static void BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
 					f = bmesh_jfke(bm, e->l->f, e->l->radial_next->f, e);
 				}
 				if (f) {
-					done = FALSE;
+					done = false;
 					break;
 				}
 				e = bmesh_disk_edge_next(e, v);
 			} while (e != v->e);
 		}
-		BM_vert_collapse_edge(bm, v->e, v, TRUE);
-		// bmesh_jekv(bm, v->e, v, FALSE);
+		BM_vert_collapse_edge(bm, v->e, v, true);
+		// bmesh_jekv(bm, v->e, v, false);
 	}
 }
 
@@ -539,18 +539,18 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
 		se = l->next->e;
 		jf = NULL;
 		if (kl->v == kv) {
-			BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e, TRUE);
+			BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e, true);
 			ke = kl->e;
 			/* BMESH-TODO: jfke doesn't handle customdata */
 			jf = bmesh_jfke(bm, kl->prev->radial_next->f, kl->f, kl->prev->e);
-			BM_vert_collapse_edge(bm, ke, kv, FALSE);
+			BM_vert_collapse_edge(bm, ke, kv, false);
 		}
 		else {
-			BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e, TRUE);
+			BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e, true);
 			ke = kl->e;
 			/* BMESH-TODO: jfke doesn't handle customdata */
 			jf = bmesh_jfke(bm, kl->next->radial_next->f, kl->f, kl->next->e);
-			BM_vert_collapse_edge(bm, ke, kv, FALSE);
+			BM_vert_collapse_edge(bm, ke, kv, false);
 		}
 		/* find saved loop pointer */
 		l = se->l;
@@ -585,18 +585,18 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
 		se = l->e;
 		jf = NULL;
 		if (kl->v == kv) {
-			BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e, TRUE);
+			BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e, true);
 			ke = kl->e;
 			/* BMESH-TODO: jfke doesn't handle customdata */
 			jf = bmesh_jfke(bm, kl->prev->radial_next->f, kl->f, kl->prev->e);
-			BM_vert_collapse_edge(bm, ke, kv, FALSE);
+			BM_vert_collapse_edge(bm, ke, kv, false);
 		}
 		else {
-			BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e, TRUE);
+			BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e, true);
 			ke = kl->e;
 			/* BMESH-TODO: jfke doesn't handle customdata */
 			jf = bmesh_jfke(bm, kl->next->radial_next->f, kl->f, kl->next->e);
-			BM_vert_collapse_edge(bm, ke, kv, FALSE);
+			BM_vert_collapse_edge(bm, ke, kv, false);
 		}
 		/* find saved loop pointer */
 		l = se->l;
@@ -607,7 +607,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
 	}
 
 	if (!BMO_elem_flag_test(bm, v1, BME_BEVEL_NONMAN) || !BMO_elem_flag_test(bm, v2, BME_BEVEL_NONMAN)) {
-		BM_face_split(bm, f, v2, v1, &l, e, TRUE);
+		BM_face_split(bm, f, v2, v1, &l, e, true);
 		BMO_elem_flag_enable(bm, l->e, BME_BEVEL_BEVEL);
 		l = l->radial_next;
 	}
@@ -636,7 +636,7 @@ static BMLoop *BME_bevel_vert(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
 	l = l->next->next;
 
 	/* "cut off" this corner */
-	/* f = */ BM_face_split(bm, l->f, v2, v1, NULL, l->e, TRUE);
+	/* f = */ BM_face_split(bm, l->f, v2, v1, NULL, l->e, true);
 
 	return l;
 }
@@ -1069,7 +1069,7 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
 	/* get rid of beveled edge */
 	BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
 		if (BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL) && BMO_elem_flag_test(bm, e, BME_BEVEL_ORIG)) {
-			BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e, TRUE);
+			BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e, true);
 		}
 	}
 
@@ -1083,9 +1083,9 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
 				if (l->v != v) l = l->next;
 				if (l2->v != v) l2 = l2->next;
 				if (l->f->len > 3)
-					BM_face_split(bm, l->f, l->next->v, l->prev->v, &l, l->e, TRUE);  /* clip this corner off */
+					BM_face_split(bm, l->f, l->next->v, l->prev->v, &l, l->e, true);  /* clip this corner off */
 				if (l2->f->len > 3)
-					BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e, TRUE);  /* clip this corner off */
+					BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e, true);  /* clip this corner off */
 				curedge = bmesh_disk_edge_next(curedge, v);
 			} while (curedge != v->e);
 			BME_Bevel_Dissolve_Disk(bm, v);
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index a593e40..1e74354 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -41,10 +41,8 @@
 
 
 
-/* experemental - Campbell */
-// #define USE_ALTERNATE_ADJ
-
-#define BEVEL_EPSILON  1e-6
+#define BEVEL_EPSILON_D  1e-6
+#define BEVEL_EPSILON    1e-6f
 
 /* for testing */
 // #pragma GCC diagnostic error "-Wpadded"
@@ -94,7 +92,7 @@ typedef struct VMesh {
 		M_NONE,         /* no polygon mesh needed */
 		M_POLY,         /* a simple polygon */
 		M_ADJ,          /* "adjacent edges" mesh pattern */
-//		M_CROSS,        /* "cross edges" mesh pattern */
+		M_ADJ_SUBDIV,   /* like M_ADJ, but using subdivision */
 		M_TRI_FAN,      /* a simple polygon - fan filled */
 		M_QUAD_STRIP,   /* a simple polygon - cut into paralelle strips */
 	} mesh_kind;
@@ -124,7 +122,7 @@ typedef struct BevelParams {
 
 // #pragma GCC diagnostic ignored "-Wpadded"
 
-//#include "bevdebug.c"
+// #include "bevdebug.c"
 
 /* Make a new BoundVert of the given kind, insert it at the end of the circular linked
  * list with entry point bv->boundstart, and return it. */
@@ -323,7 +321,7 @@ static void offset_meet(EdgeHalf *e1, EdgeHalf *e2, BMVert *v, BMFace *f,
 	sub_v3_v3v3(dir1, v->co, BM_edge_other_vert(e1->e, v)->co);
 	sub_v3_v3v3(dir2, BM_edge_other_vert(e2->e, v)->co, v->co);
 
-	if (angle_v3v3(dir1, dir2) < 100.0f * (float)BEVEL_EPSILON) {
+	if (angle_v3v3(dir1, dir2) < 100.0f * BEVEL_EPSILON) {
 		/* special case: e1 and e2 are parallel; put offset point perp to both, from v.
 		 * need to find a suitable plane.
 		 * if offsets are different, we're out of luck: just use e1->offset */
@@ -386,6 +384,7 @@ static void offset_in_two_planes(EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid,
 	int iret;
 
 	BLI_assert(f1 != NULL && f2 != NULL);
+	(void)f1, (void)f2;  /* UNUSED */
 
 	/* get direction vectors for two offset lines */
 	sub_v3_v3v3(dir1, v->co, BM_edge_other_vert(e1->e, v)->co);
@@ -409,7 +408,7 @@ static void offset_in_two_planes(EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid,
 	madd_v3_v3fl(off2a, norm_perp2, e2->offset);
 	add_v3_v3v3(off2b, off2a, dir2);
 
-	if (angle_v3v3(dir1, dir2) < 100.0f * (float)BEVEL_EPSILON) {
+	if (angle_v3v3(dir1, dir2) < 100.0f * BEVEL_EPSILON) {
 		/* lines are parallel; off1a is a good meet point */
 		copy_v3_v3(meetco, off1a);
 	}
@@ -421,7 +420,7 @@ static void offset_in_two_planes(EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid,
 		}
 		else if (iret == 2) {
 			/* lines are not coplanar; meetco and isect2 are nearest to first and second lines */
-			if (len_v3v3(meetco, isect2) > 100.0f * (float)BEVEL_EPSILON) {
+			if (len_v3v3(meetco, isect2) > 100.0f * BEVEL_EPSILON) {
 				/* offset lines don't meet: project average onto emid; this is not ideal (see TODO above) */
 				mid_v3_v3v3(co, meetco, isect2);
 				closest_to_line_v3(meetco, co, v->co, BM_edge_other_vert(emid->e, v)->co);
@@ -470,7 +469,7 @@ static void slide_dist(EdgeHalf *e, BMVert *v, float d, float slideco[3])
 	sub_v3_v3v3(dir, v->co, BM_edge_other_vert(e->e, v)->co);
 	len = normalize_v3(dir);
 	if (d > len)
-		d = len - (float)(50.0 * BEVEL_EPSILON);
+		d = len - (float)(50.0 * BEVEL_EPSILON_D);
 	copy_v3_v3(slideco, v->co);
 	madd_v3_v3fl(slideco, dir, -d);
 }
@@ -501,79 +500,6 @@ static int bev_ccw_test(BMEdge *a, BMEdge *b, BMFace *f)
 	return lb->next == la ? 1 : -1;
 }
 
-#ifdef USE_ALTERNATE_ADJ
-
-static void vmesh_cent(VMesh *vm, float r_cent[3])
-{
-	BoundVert *v;
-	zero_v3(r_cent);
-
-	v = vm->boundstart;
-	do {
-		add_v3_v3(r_cent, v->nv.co);
-	} while ((v = v->next) != vm->boundstart);
-	mul_v3_fl(r_cent, 1.0f / (float)vm->count);
-}
-
-/**
- *
- * This example shows a tri fan of quads,
- * but could be an NGon fan of quads too.
- * <pre>
- *      The whole triangle   X
- *      represents the      / \
- *      new bevel face.    /   \
- *                        /     \
- *       Split into      /       \
- *       a quad fan.    /         \
- *                     /           \
- *                    /             \
- *                   /               \
- *          co_prev +-.             .-+
- *                 /   `-._     _.-'   \
- *                / co_cent`-+-'        \
- *               /           |           \
- * Quad of      /            |            \
- * interest -- / ---> X      |             \
- *            /              |              \
- *           /               |               \
- *          /         co_next|                \
- * co_orig +-----------------+-----------------+
- *
- *         For each quad, calcualte UV's based on the following:
- *           U = k    / (vm->seg * 2)
- *           V = ring / (vm->seg * 2)
- *           quad = (co_orig, co_prev, co_cent, co_next)
- *           ... note that co_cent is the same for all quads in the fan.
- * </pre>
- *
- */
-
-static void get_point_uv(float uv[2],
-                         /* all these args are int's originally
-                          * but pass as floats to the function */
-                         const float seg, const float ring, const float k)
-{
-	uv[0] = (ring / seg) * 2.0f;
-	uv[1] = (k    / seg) * 2.0f;
-}
-
-/* TODO: make this a lot smarter!,
- * this is the main reason USE_ALTERNATE_ADJ isn't so good right now :S */
-static float get_point_uv_factor(const float uv[2])
-{
-	return sinf(1.0f - max_ff(uv[0], uv[1]) / 2.0f);
-}
-
-static void get_point_on_round_edge(const float uv[2],
-                                    float quad[4][3],
-                                    float r_co[3])
-{
-	interp_bilinear_quad_v3(quad, uv[0], uv[1], r_co);
-}
-
-#else  /* USE_ALTERNATE_ADJ */
-
 /* Fill matrix r_mat so that a point in the sheared parallelogram with corners
  * va, vmid, vb (and the 4th that is implied by it being a parallelogram)
  * is transformed to the unit square by multiplication with r_mat.
@@ -593,7 +519,7 @@ static void get_point_on_round_edge(const float uv[2],
  * We want M to make M*A=B where A has the left side above, as columns
  * and B has the right side as columns - both extended into homogeneous coords.
  * So M = B*(Ainverse).  Doing Ainverse by hand gives the code below.
-*/
+ */
 static int make_unit_square_map(const float va[3], const float vmid[3], const float vb[3],
                                 float r_mat[4][4])
 {
@@ -601,7 +527,7 @@ static int make_unit_square_map(const float va[3], const float vmid[3], const fl
 
 	sub_v3_v3v3(va_vmid, vmid, va);
 	sub_v3_v3v3(vb_vmid, vmid, vb);
-	if (fabsf(angle_v3v3(va_vmid, vb_vmid) - (float)M_PI) > 100.f *(float)BEVEL_EPSILON) {
+	if (fabsf(angle_v3v3(va_vmid, vb_vmid) - (float)M_PI) > 100.0f * BEVEL_EPSILON) {
 		sub_v3_v3v3(vo, va, vb_vmid);
 		cross_v3_v3v3(vddir, vb_vmid, va_vmid);
 		normalize_v3(vddir);
@@ -694,8 +620,6 @@ static void snap_to_edge_profile(EdgeHalf *e, const float va[3], const float vb[
 	}
 }
 
-#endif  /* !USE_ALTERNATE_ADJ */
-
 /* Make a circular list of BoundVerts for bv, each of which has the coordinates
  * of a vertex on the the boundary of the beveled vertex bv->v.
  * Also decide on the mesh pattern that will be used inside the boundary.
@@ -811,7 +735,10 @@ static void build_boundary(BevelParams *bp, BevVert *bv)
 	} while ((e = e->next) != efirst);
 
 	BLI_assert(vm->count >= 2);
-	if (vm->count == 2 && bv->edgecount == 3) {
+	if (bp->vertex_only) {
+		vm->mesh_kind = bp->seg > 1 ? M_ADJ_SUBDIV : M_POLY;
+	}
+	else if (vm->count == 2 && bv->edgecount == 3) {
 		vm->mesh_kind = M_NONE;
 	}
 	else if (bv->selcount == 2) {
@@ -846,19 +773,6 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 	float co[3], coa[3], cob[3], midco[3];
 	float va_pipe[3], vb_pipe[3];
 
-#ifdef USE_ALTERNATE_ADJ
-	/* ordered as follows (orig, prev, center, next)*/
-	float quad_plane[4][3];
-	float quad_orig[4][3];
-#endif
-
-
-#ifdef USE_ALTERNATE_ADJ
-	/* the rest are initialized inline, this remains the same for all */
-	vmesh_cent(vm, quad_plane[2]);
-	copy_v3_v3(quad_orig[2], bv->v->co);
-#endif
-
 	n = vm->count;
 	ns = vm->seg;
 	ns2 = ns / 2;
@@ -875,7 +789,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 							float dir1[3], dir2[3];
 							sub_v3_v3v3(dir1, bv->v->co, BM_edge_other_vert(e1->e, bv->v)->co);
 							sub_v3_v3v3(dir2, BM_edge_other_vert(e2->e, bv->v)->co, bv->v->co);
-							if (angle_v3v3(dir1, dir2) < 100.0f * (float)BEVEL_EPSILON) {
+							if (angle_v3v3(dir1, dir2) < 100.0f * BEVEL_EPSILON) {
 								epipe = e1;
 								break;
 							}
@@ -918,37 +832,6 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 				copy_v3_v3(nv->co, cob);
 				nv->v = nvnext->v;
 
-#ifdef USE_ALTERNATE_ADJ
-				/* plane */
-				copy_v3_v3(quad_plane[0], v->nv.co);
-				mid_v3_v3v3(quad_plane[1], v->nv.co, v->prev->nv.co);
-				/* quad[2] is set */
-				mid_v3_v3v3(quad_plane[3], v->nv.co, v->next->nv.co);
-
-				/* orig */
-				copy_v3_v3(quad_orig[0], v->nv.co);  /* only shared location between 2 quads */
-				project_to_edge(v->ebev->prev->e, v->nv.co, v->prev->nv.co, quad_orig[1]);
-				project_to_edge(v->ebev->e,       v->nv.co, v->next->nv.co, quad_orig[3]);
-
-				//bl_debug_draw_quad_add(UNPACK4(quad_plane));
-				//bl_debug_draw_quad_add(UNPACK4(quad_orig));
-#endif
-
-#ifdef USE_ALTERNATE_ADJ
-				for (k = 1; k < ns; k++) {
-					float uv[2];
-					float fac;
-					float co_plane[3];
-					float co_orig[3];
-
-					get_point_uv(uv, v->ebev->seg, ring, k);
-					get_point_on_round_edge(uv, quad_plane, co_plane);
-					get_point_on_round_edge(uv, quad_orig,  co_orig);
-					fac = get_point_uv_factor(uv);
-					interp_v3_v3v3(co, co_plane, co_orig, fac);
-					copy_v3_v3(mesh_vert(vm, i, ring, k)->co, co);
-				}
-#else
 				/* TODO: better calculation of new midarc point? */
 				project_to_edge(v->ebev->e, coa, cob, midco);
 
@@ -962,7 +845,6 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 					copy_v3_v3(va_pipe, mesh_vert(vm, i, 0, 0)->co);
 					copy_v3_v3(vb_pipe, mesh_vert(vm, i, 0, ns)->co);
 				}
-#endif
 			}
 		} while ((v = v->next) != vm->boundstart);
 	}
@@ -990,9 +872,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 						if (epipe)
 							snap_to_edge_profile(epipe, va_pipe, vb_pipe, co);
 
-#ifndef USE_ALTERNATE_ADJ
 						copy_v3_v3(nv->co, co);
-#endif
 						BLI_assert(nv->v == NULL && nvprev->v == NULL);
 						create_mesh_bmvert(bm, vm, i, ring, k, bv->v);
 						copy_mesh_vert(vm, vprev->index, k, ns - ring, i, ring, k);
@@ -1041,9 +921,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 						mid_v3_v3v3v3(co, nvprev->co, nv->co, nvnext->co);
 						if (epipe)
 							snap_to_edge_profile(epipe, va_pipe, vb_pipe, co);
-#ifndef USE_ALTERNATE_ADJ
 						copy_v3_v3(nv->co, co);
-#endif
 						create_mesh_bmvert(bm, vm, i, k, ns2, bv->v);
 						copy_mesh_vert(vm, vprev->index, ns2, ns - k, i, k, ns2);
 						copy_mesh_vert(vm, vnext->index, ns2, k, i, k, ns2);
@@ -1053,9 +931,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 						mid_v3_v3v3(co, nvprev->co, nv->co);
 						if (epipe)
 							snap_to_edge_profile(epipe, va_pipe, vb_pipe, co);
-#ifndef USE_ALTERNATE_ADJ
 						copy_v3_v3(nv->co, co);
-#endif
 						create_mesh_bmvert(bm, vm, i, k, ns2, bv->v);
 						copy_mesh_vert(vm, vprev->index, ns2, ns - k, i, k, ns2);
 
@@ -1065,9 +941,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 						mid_v3_v3v3(co, nv->co, nvnext->co);
 						if (epipe)
 							snap_to_edge_profile(epipe, va_pipe, vb_pipe, co);
-#ifndef USE_ALTERNATE_ADJ
 						copy_v3_v3(nv->co, co);
-#endif
 						create_mesh_bmvert(bm, vm, i, k, ns2, bv->v);
 						copy_mesh_vert(vm, vnext->index, ns2, k, i, k, ns2);
 
@@ -1220,6 +1094,413 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
 	}
 }
 
+static VMesh *new_adj_subdiv_vmesh(MemArena *mem_arena, int count, int seg, BoundVert *bounds)
+{
+	VMesh *vm;
+
+	vm = (VMesh *)BLI_memarena_alloc(mem_arena, sizeof(VMesh));
+	vm->count = count;
+	vm->seg = seg;
+	vm->boundstart = bounds;
+	vm->mesh = (NewVert *)BLI_memarena_alloc(mem_arena, count * (1 + seg / 2) * (1 + seg) * sizeof(NewVert));
+	vm->mesh_kind = M_ADJ_SUBDIV;
+	return vm;
+}
+
+/* VMesh verts for vertex i have data for (i, 0 <= j <= ns2, 0 <= k <= ns), where ns2 = floor(nseg / 2).
+ * But these overlap data from previous and next i: there are some forced equivalences.
+ * Let's call these indices the canonical ones: we will just calculate data for these
+ *    0 <= j <= ns2, 0 <= k < ns2  (for odd ns2)
+ *    0 <= j < ns2, 0 <= k <= ns2  (for even ns2)
+ *        also (j=ns2, k=ns2) at i=0 (for even ns2)
+ * This function returns the canonical one for any i, j, k in [0,n],[0,ns],[0,ns] */
+static NewVert *mesh_vert_canon(VMesh *vm, int i, int j, int k)
+{
+	int n, ns, ns2, odd;
+	NewVert *ans;
+
+	n = vm->count;
+	ns = vm->seg;
+	ns2 = ns / 2;
+	odd = ns % 2;
+	BLI_assert(0 <= i && i <= n && 0 <= j && j <= ns && 0 <= k && k <= ns);
+
+	if (!odd && j == ns2 && k == ns2)
+		ans = mesh_vert(vm, 0, j, k);
+	else if (j <= ns2 - 1 + odd && k <= ns2)
+		ans = mesh_vert(vm, i, j, k);
+	else if (k <= ns2)
+		ans = mesh_vert(vm, (i + n - 1) % n, k, ns - j);
+	else
+		ans = mesh_vert(vm, (i + 1) % n, ns - k, j);
+	return ans;
+}
+
+static int is_canon(VMesh *vm, int i, int j, int k)
+{
+	int ns2 = vm->seg / 2;
+	if (vm->seg % 2 == 1)
+		return (j <= ns2 && k <= ns2);
+	else
+		return ((j < ns2 && k <= ns2) || (j == ns2 && k == ns2 && i == 0));
+}
+
+/* Copy the vertex data to all of vm verts from canonical ones */
+static void vmesh_copy_equiv_verts(VMesh *vm)
+{
+	int n, ns, ns2, i, j, k;
+	NewVert *v0, *v1;
+
+	n = vm->count;
+	ns = vm->seg;
+	ns2 = ns / 2;
+	for (i = 0; i < n; i++) {
+		for (j = 0; j <= ns2; j++) {
+			for (k = 0; k <= ns; k++) {
+				if (is_canon(vm, i, j, k))
+					continue;
+				v1 = mesh_vert(vm, i, j, k);
+				v0 = mesh_vert_canon(vm, i, j, k);
+				copy_v3_v3(v1->co, v0->co);
+				v1->v = v0->v;
+			}
+		}
+	}
+}
+
+/* Calculate and return in r_cent the centroid of the center poly */
+static void vmesh_center(VMesh *vm, float r_cent[3])
+{
+	int n, ns2, i;
+
+	n = vm->count;
+	ns2 = vm->seg / 2;
+	if (vm->seg % 2) {
+		zero_v3(r_cent);
+		for (i = 0; i < n; i++) {
+			add_v3_v3(r_cent, mesh_vert(vm, i, ns2, ns2)->co);
+		}
+		mul_v3_fl(r_cent, 1.0f / (float) n);
+	}
+	else {
+		copy_v3_v3(r_cent, mesh_vert(vm, 0, ns2, ns2)->co);
+	}
+}
+
+/* Do one step of quadratic subdivision (Doo-Sabin), with special rules at boundaries.
+ * For now, this is written assuming vm0->nseg is odd.
+ * See Hwang-Chuang 2003 paper: "N-sided hole filling and vertex blending using subdivision surfaces"  */
+static VMesh *quadratic_subdiv(MemArena *mem_arena, VMesh *vm0)
+{
+	int n, ns0, ns20, ns1 /*, ns21 */;
+	int i, j, k, j1, k1;
+	VMesh *vm1;
+	float co[3], co1[3], co2[3], co3[3], co4[3];
+	float co11[3], co21[3], co31[3], co41[3];
+	float denom;
+	const float wcorner[4] = {0.25f, 0.25f, 0.25f, 0.25f};
+	const float wboundary[4] = {0.375f, 0.375f, 0.125f, 0.125f};  /* {3, 3, 1, 1}/8 */
+	const float winterior[4] = {0.5625f, 0.1875f, 0.1875f, 0.0625f}; /* {9, 3, 3, 1}/16 */
+
+	n = vm0->count;
+	ns0 = vm0->seg;
+	ns20 = ns0 / 2;
+	BLI_assert(ns0 % 2 == 1);
+
+	ns1 = 2 * ns0 - 1;
+	// ns21 = ns1 / 2;  /* UNUSED */
+	vm1 = new_adj_subdiv_vmesh(mem_arena, n, ns1, vm0->boundstart);
+
+	for (i = 0; i < n; i ++) {
+		/* For handle vm0 polys with lower left corner at (i,j,k) for
+		 * j in [0, ns20], k in [0, ns20]; then the center ngon.
+		 * but only fill in data for canonical verts of v1. */
+		for (j = 0; j <= ns20; j++) {
+			for (k = 0; k <= ns20; k++) {
+				if (j == ns20 && k == ns20)
+					continue;  /* center ngon is special */
+				copy_v3_v3(co1, mesh_vert_canon(vm0, i, j, k)->co);
+				copy_v3_v3(co2, mesh_vert_canon(vm0, i, j, k + 1)->co);
+				copy_v3_v3(co3, mesh_vert_canon(vm0, i, j + 1, k + 1)->co);
+				copy_v3_v3(co4, mesh_vert_canon(vm0, i, j + 1, k)->co);
+				if (j == 0 && k == 0) {
+					/* corner */
+					copy_v3_v3(co11, co1);
+					interp_v3_v3v3(co21, co1, co2, 0.5f);
+					interp_v3_v3v3v3v3(co31, co1, co2, co3, co4, wcorner);
+					interp_v3_v3v3(co41, co1, co4, 0.5f);
+				}
+				else if (j == 0) {
+					/* ring 0 boundary */
+					interp_v3_v3v3(co11, co1, co2, 0.25f);
+					interp_v3_v3v3(co21, co1, co2, 0.75f);
+					interp_v3_v3v3v3v3(co31, co2, co3, co1, co4, wboundary);
+					interp_v3_v3v3v3v3(co41, co1, co4, co2, co3, wboundary);
+				}
+				else if (k == 0) {
+					/* ring-starts boundary */
+					interp_v3_v3v3(co11, co1, co4, 0.25f);
+					interp_v3_v3v3v3v3(co21, co1, co2, co3, co4, wboundary);
+					interp_v3_v3v3v3v3(co31, co3, co4, co1, co2, wboundary);
+					interp_v3_v3v3(co41, co1, co4, 0.75f);
+				}
+				else {
+					/* interior */
+					interp_v3_v3v3v3v3(co11, co1, co2, co4, co3, winterior);
+					interp_v3_v3v3v3v3(co21, co2, co1, co3, co4, winterior);
+					interp_v3_v3v3v3v3(co31, co3, co2, co4, co1, winterior);
+					interp_v3_v3v3v3v3(co41, co4, co1, co3, co2, winterior);
+				}
+				j1 = 2 * j;
+				k1 = 2 * k;
+				if (is_canon(vm1, i, j1, k1))
+					copy_v3_v3(mesh_vert(vm1, i, j1, k1)->co, co11);
+				if (is_canon(vm1, i, j1, k1 + 1))
+					copy_v3_v3(mesh_vert(vm1, i, j1, k1 + 1)->co, co21);
+				if (is_canon(vm1, i, j1 + 1, k1 + 1))
+					copy_v3_v3(mesh_vert(vm1, i, j1 + 1, k1 + 1)->co, co31);
+				if (is_canon(vm1, i, j1 + 1, k1))
+					copy_v3_v3(mesh_vert(vm1, i, j1 + 1, k1)->co, co41);
+			}
+		}
+
+		/* center ngon */
+		denom = 8.0f * (float) n;
+		zero_v3(co);
+		for (j = 0; j < n; j++) {
+			copy_v3_v3(co1, mesh_vert(vm0, j, ns20, ns20)->co);
+			if (i == j)
+				madd_v3_v3fl(co, co1, (4.0f * (float) n + 2.0f) / denom);
+			else if ((i + 1) % n == j || (i + n - 1) % n == j)
+				madd_v3_v3fl(co, co1, ((float) n + 2.0f) / denom);
+			else
+				madd_v3_v3fl(co, co1, 2.0f / denom);
+		}
+		copy_v3_v3(mesh_vert(vm1, i, 2 * ns20, 2 * ns20)->co, co);
+	}
+
+	vmesh_copy_equiv_verts(vm1);
+	return vm1;
+}
+
+/* After a step of quadratic_subdiv, adjust the ring 1 verts to be on the planes of their respective faces,
+ * so that the cross-tangents will match on further subdivision. */
+static void fix_vmesh_tangents(VMesh *vm, BevVert *bv)
+{
+	int i, n;
+	NewVert *v;
+	BoundVert *bndv;
+	float co[3];
+
+	n = vm->count;
+	bndv = vm->boundstart;
+	do {
+		i = bndv->index;
+
+		/* (i, 1, 1) snap to edge line */
+		v = mesh_vert(vm, i, 1, 1);
+		closest_to_line_v3(co, v->co, bndv->nv.co, bv->v->co);
+		copy_v3_v3(v->co, co);
+		copy_v3_v3(mesh_vert(vm, (i + n -1) % n, 1, vm->seg - 1)->co, co);
+
+		/* Also want (i, 1, k) snapped to plane of adjacent face for
+		 * 1 < k < ns - 1, but current initial cage and subdiv rules
+		 * ensure this, so nothing to do */
+	} while ((bndv = bndv->next) != vm->boundstart);
+}
+
+/* Fill frac with fractions of way along ring 0 for vertex i, for use with interp_range function */
+static void fill_vmesh_fracs(VMesh *vm, float *frac, int i)
+{
+	int k, ns;
+	float total = 0.0f;
+
+	ns = vm->seg;
+	frac[0] = 0.0f;
+	for (k = 0; k < ns; k++) {
+		total += len_v3v3(mesh_vert(vm, i, 0, k)->co, mesh_vert(vm, i, 0, k + 1)->co);
+		frac[k + 1] = total;
+	}
+	if (total > BEVEL_EPSILON) {
+		for (k = 1; k <= ns; k++)
+			frac[k] /= total;
+	}
+}
+
+/* Return i such that frac[i] <= f <= frac[i + 1], where frac[n] == 1.0
+ * and put fraction of rest of way between frac[i] and frac[i + 1] into r_rest */
+static int interp_range(const float *frac, int n, const float f, float *r_rest)
+{
+	int i;
+	float rest;
+
+	/* could binary search in frac, but expect n to be reasonably small */
+	for (i = 0; i < n; i++) {
+		if (f <= frac[i + 1]) {
+			rest = f - frac[i];
+			if (rest == 0)
+				*r_rest = 0.0f;
+			else
+				*r_rest = rest / (frac[i + 1] - frac[i]);
+			return i;
+		}
+	}
+	*r_rest = 0.0f;
+	return n;
+}
+
+/* Interpolate given vmesh to make one with target nseg and evenly spaced border vertices */
+static VMesh *interp_vmesh(MemArena *mem_arena, VMesh *vm0, int nseg)
+{
+	int n, ns0, nseg2, odd, i, j, k, j0, k0;
+	float *prev_frac, *frac, f, restj, restk;
+	float quad[4][3], co[3], center[3];
+	VMesh *vm1;
+
+	n = vm0->count;
+	ns0 = vm0->seg;
+	nseg2 = nseg / 2;
+	odd = nseg % 2;
+	vm1 = new_adj_subdiv_vmesh(mem_arena, n, nseg, vm0->boundstart);
+	prev_frac = (float *)BLI_memarena_alloc(mem_arena, (ns0 + 1 ) *sizeof(float));
+	frac = (float *)BLI_memarena_alloc(mem_arena, (ns0 + 1 ) *sizeof(float));
+
+	fill_vmesh_fracs(vm0, prev_frac, n - 1);
+	fill_vmesh_fracs(vm0, frac, 0);
+	for (i = 0; i < n; i++) {
+		for (j = 0; j <= nseg2 -1 + odd; j++) {
+			for (k = 0; k <= nseg2; k++) {
+				f = (float) k / (float) nseg;
+				k0 = interp_range(frac, ns0, f, &restk);
+				f = 1.0f - (float) j / (float) nseg;
+				j0 = interp_range(prev_frac, ns0, f, &restj);
+				if (restj < BEVEL_EPSILON) {
+					j0 = ns0 - j0;
+					restj = 0.0f;
+				}
+				else {
+					j0 = ns0 - j0 - 1;
+					restj = 1.0f - restj;
+				}
+				/* Use bilinear interpolation within the source quad; could be smarter here */
+				if (restj < BEVEL_EPSILON && restk < BEVEL_EPSILON) {
+					copy_v3_v3(co, mesh_vert_canon(vm0, i, j0, k0)->co);
+				}
+				else {
+					copy_v3_v3(quad[0], mesh_vert_canon(vm0, i, j0, k0)->co);
+					copy_v3_v3(quad[1], mesh_vert_canon(vm0, i, j0, k0 + 1)->co);
+					copy_v3_v3(quad[2], mesh_vert_canon(vm0, i, j0 + 1, k0 + 1)->co);
+					copy_v3_v3(quad[3], mesh_vert_canon(vm0, i, j0 + 1, k0)->co);
+					interp_bilinear_quad_v3(quad, restk, restj, co);
+				}
+				copy_v3_v3(mesh_vert(vm1, i, j, k)->co, co);
+			}
+		}
+	}
+	if (!odd) {
+		vmesh_center(vm0, center);
+		copy_v3_v3(mesh_vert(vm1, 0, nseg2, nseg2)->co, center);
+	}
+	vmesh_copy_equiv_verts(vm1);
+	return vm1;
+}
+
+/*
+ * Given that the boundary is built and the boundary BMVerts have been made,
+ * calculate the positions of the interior mesh points for the M_ADJ_SUBDIV pattern,
+ * then make the BMVerts and the new faces. */
+static void bevel_build_rings_subdiv(BevelParams *bp, BMesh *bm, BevVert *bv)
+{
+	int n, ns, ns2, odd, i, j, k;
+	VMesh *vm0, *vm1, *vm;
+	float coa[3], cob[3], coc[3];
+	BoundVert *v;
+	BMVert *bmv1, *bmv2, *bmv3, *bmv4;
+	BMFace *f;
+	MemArena *mem_arena = bp->mem_arena;
+	const float fullness = 0.5f;
+
+	n = bv->edgecount;
+	ns = bv->vmesh->seg;
+	ns2 = ns / 2;
+	odd = ns % 2;
+	BLI_assert(n >= 3 && ns > 1);
+
+	/* First construct an initial control mesh, with nseg==3 */
+	vm0 = new_adj_subdiv_vmesh(mem_arena, n, 3, bv->vmesh->boundstart);
+
+	for (i = 0; i < n; i++) {
+		/* Boundaries just divide input polygon edges into 3 even segments */
+		copy_v3_v3(coa, mesh_vert(bv->vmesh, i, 0, 0)->co);
+		copy_v3_v3(cob, mesh_vert(bv->vmesh, (i + 1) % n, 0, 0)->co);
+		copy_v3_v3(coc, mesh_vert(bv->vmesh, (i + n -1) % n, 0, 0)->co);
+		copy_v3_v3(mesh_vert(vm0, i, 0, 0)->co, coa);
+		interp_v3_v3v3(mesh_vert(vm0, i, 0, 1)->co, coa, cob, 1.0f / 3.0f);
+		interp_v3_v3v3(mesh_vert(vm0, i, 1, 0)->co, coa, coc, 1.0f / 3.0f);
+		interp_v3_v3v3(mesh_vert(vm0, i, 1, 1)->co, coa, bv->v->co, fullness);
+	}
+	vmesh_copy_equiv_verts(vm0);
+
+	vm1 = vm0;
+	do {
+		vm1 = quadratic_subdiv(mem_arena, vm1);
+		fix_vmesh_tangents(vm1, bv);
+	} while (vm1->seg <= ns);
+	vm1 = interp_vmesh(mem_arena, vm1, ns);
+
+	/* copy final vmesh into bv->vmesh, make BMVerts and BMFaces */
+	vm = bv->vmesh;
+	for (i = 0; i < n; i ++) {
+		for (j = 0; j <= ns2; j++) {
+			for (k = 0; k <= ns; k++) {
+				if (j == 0 && (k == 0 || k == ns))
+					continue;  /* boundary corners already made */
+				if (!is_canon(vm, i, j, k))
+					continue;
+				copy_v3_v3(mesh_vert(vm, i, j, k)->co, mesh_vert(vm1, i, j, k)->co);
+				create_mesh_bmvert(bm, vm, i, j, k, bv->v);
+			}
+		}
+	}
+	vmesh_copy_equiv_verts(vm);
+	/* make the polygons */
+	v = vm->boundstart;
+	do {
+		i = v->index;
+		f = boundvert_rep_face(v);
+		/* For odd ns, make polys with lower left corner at (i,j,k) for
+		 *    j in [0, ns2-1], k in [0, ns2].  And then the center ngon.
+		 * For even ns,
+		 *    j in [0, ns2-1], k in [0, ns2-1] */
+		for (j = 0; j < ns2; j++) {
+			for (k = 0; k < ns2 + odd; k++) {
+				bmv1 = mesh_vert(vm, i, j, k)->v;
+				bmv2 = mesh_vert(vm, i, j, k + 1)->v;
+				bmv3 = mesh_vert(vm, i, j + 1, k + 1)->v;
+				bmv4 = mesh_vert(vm, i, j + 1, k)->v;
+				BLI_assert(bmv1 && bmv2 && bmv3 && bmv4);
+				bev_create_quad_tri(bm, bmv1, bmv2, bmv3, bmv4, f);
+			}
+		}
+	} while ((v = v->next) != vm->boundstart);
+
+	/* center ngon */
+	if (odd) {
+		BMVert **vv = NULL;
+		BLI_array_staticdeclare(vv, BM_DEFAULT_NGON_STACK_SIZE);
+
+		v = vm->boundstart;
+		do {
+			i = v->index;
+			BLI_array_append(vv, mesh_vert(vm, i, ns2, ns2)->v);
+		} while ((v = v->next) != vm->boundstart);
+		f = boundvert_rep_face(vm->boundstart);
+		bev_create_ngon(bm, vv, BLI_array_count(vv), f);
+
+		BLI_array_free(vv);
+	}
+}
+
 static BMFace *bevel_build_poly_ex(BMesh *bm, BevVert *bv)
 {
 	BMFace *f;
@@ -1339,24 +1620,7 @@ static void build_vmesh(BevelParams *bp, BMesh *bm, BevVert *bv)
 	BoundVert *v, *weld1, *weld2;
 	int n, ns, ns2, i, k, weld;
 	float *va, *vb, co[3];
-
-#ifdef USE_ALTERNATE_ADJ
-	/* ordered as follows (orig, prev, center, next)*/
-	float quad_plane[4][3];
-	float quad_orig_a[4][3];
-	float quad_orig_b[4][3];
-	const int is_odd = (vm->seg % 2);
-#else
 	float midco[3];
-#endif
-
-#ifdef USE_ALTERNATE_ADJ
-	/* the rest are initialized inline, this remains the same for all */
-	/* NOTE; in this usage we only interpolate on the 'V' so cent and next points are unused (2,3)*/
-	vmesh_cent(vm, quad_plane[2]);
-	copy_v3_v3(quad_orig_a[2], bv->v->co);
-	copy_v3_v3(quad_orig_b[2], bv->v->co);
-#endif
 
 	n = vm->count;
 	ns = vm->seg;
@@ -1389,69 +1653,21 @@ static void build_vmesh(BevelParams *bp, BMesh *bm, BevVert *bv)
 		i = v->index;
 		copy_mesh_vert(vm, i, 0, ns, v->next->index, 0, 0);
 		if (v->ebev) {
-
-#ifdef USE_ALTERNATE_ADJ
-			copy_v3_v3(quad_plane[0], v->nv.co);
-			mid_v3_v3v3(quad_plane[1], v->nv.co, v->prev->nv.co);
-			/* quad[2] is set */
-			mid_v3_v3v3(quad_plane[3], v->nv.co, v->next->nv.co);
-
-			/* orig 'A' */
-			copy_v3_v3(quad_orig_a[0], v->nv.co);  /* only shared location between 2 quads */
-			project_to_edge(v->ebev->prev->e, v->nv.co, v->prev->nv.co, quad_orig_a[1]);
-			project_to_edge(v->ebev->e,       v->nv.co, v->next->nv.co, quad_orig_a[3]);
-
-			/* orig 'B' */
-			copy_v3_v3(quad_orig_b[3], v->next->nv.co);  /* only shared location between 2 quads */
-			project_to_edge(v->ebev->prev->e, v->nv.co, v->prev->nv.co, quad_orig_b[1]);
-			project_to_edge(v->ebev->e,       v->nv.co, v->next->nv.co, quad_orig_b[0]);
-
-			//bl_debug_draw_quad_add(UNPACK4(quad_plane));
-			//bl_debug_draw_quad_add(UNPACK4(quad_orig_a));
-			//bl_debug_draw_quad_add(UNPACK4(quad_orig_b));
-#endif  /* USE_ALTERNATE_ADJ */
-
-#ifdef USE_ALTERNATE_ADJ
-			for (k = 1; k < ns; k++) {
-				float uv[2];
-				float fac;
-				float co_plane[3];
-				float co_orig[3];
-
-				/* quad_plane */
-				get_point_uv(uv, v->ebev->seg, 0, k);
-				get_point_on_round_edge(uv, quad_plane, co_plane);
-
-				/* quad_orig */
-				/* each half has different UV's */
-				if (k <= ns2) {
-					get_point_uv(uv, v->ebev->seg, 0, k);
-					get_point_on_round_edge(uv, quad_orig_a, co_orig);
-				}
-				else {
-					get_point_uv(uv, v->ebev->seg, 0, (k - ns2) - (is_odd ? 0.5f : 0.0f));
-					get_point_on_round_edge(uv, quad_orig_b, co_orig);
-					uv[1] = 1.0f - uv[1];  /* so we can get the factor */
-				}
-				fac = get_point_uv_factor(uv);
-
-				/* done. interp */
-				interp_v3_v3v3(co, co_plane, co_orig, fac);
-				copy_v3_v3(mesh_vert(vm, i, 0, k)->co, co);
-				if (!weld)
-					create_mesh_bmvert(bm, vm, i, 0, k, bv->v);
-			}
-#else  /* USE_ALTERNATE_ADJ */
 			va = mesh_vert(vm, i, 0, 0)->co;
 			vb = mesh_vert(vm, i, 0, ns)->co;
-			project_to_edge(v->ebev->e, va, vb, midco);
+			if (bv->edgecount == 3 && bv->selcount == 1) {
+				/* special case: profile cuts the third face, so line it up with that */
+				copy_v3_v3(midco, bv->v->co);
+			}
+			else {
+				project_to_edge(v->ebev->e, va, vb, midco);
+			}
 			for (k = 1; k < ns; k++) {
 				get_point_on_round_edge(v->ebev, k, va, midco, vb, co);
 				copy_v3_v3(mesh_vert(vm, i, 0, k)->co, co);
 				if (!weld)
 					create_mesh_bmvert(bm, vm, i, 0, k, bv->v);
 			}
-#endif  /* !USE_ALTERNATE_ADJ */
 		}
 	} while ((v = v->next) != vm->boundstart);
 
@@ -1478,6 +1694,9 @@ static void build_vmesh(BevelParams *bp, BMesh *bm, BevVert *bv)
 		case M_ADJ:
 			bevel_build_rings(bm, bv);
 			break;
+		case M_ADJ_SUBDIV:
+			bevel_build_rings_subdiv(bp, bm, bv);
+			break;
 		case M_TRI_FAN:
 			bevel_build_trifan(bm, bv);
 			break;
@@ -1687,6 +1906,14 @@ static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
 						BLI_array_append(vv, bmv);
 					}
 				}
+				else if (bp->vertex_only && vm->mesh_kind == M_ADJ_SUBDIV && vm->seg > 1) {
+					BLI_assert(v->prev == vend);
+					i = vend->index;
+					for (k = vm->seg - 1; k > 0; k--) {
+						bmv = mesh_vert(vm, i, 0, k)->v;
+						BLI_array_append(vv, bmv);
+					}
+				}
 				v = v->prev;
 				BLI_array_append(vv, v->nv.v);
 			}
diff --git a/source/blender/bmesh/tools/bmesh_decimate.h b/source/blender/bmesh/tools/bmesh_decimate.h
index 4a557c2..d3eaf1c 100644
--- a/source/blender/bmesh/tools/bmesh_decimate.h
+++ b/source/blender/bmesh/tools/bmesh_decimate.h
@@ -27,15 +27,15 @@
  *  \ingroup bmesh
  */
 
-void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights, const int do_triangulate);
+void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights, const bool do_triangulate);
 
-void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int tag_only);
+void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const bool tag_only);
 void BM_mesh_decimate_unsubdivide(BMesh *bm, const int iterations);
 
-void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const int do_dissolve_boundaries,
+void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const bool do_dissolve_boundaries,
                                   BMVert **vinput_arr, const int vinput_len,
                                   BMEdge **einput_arr, const int einput_len);
-void BM_mesh_decimate_dissolve(BMesh *bm, const float angle_limit, const int do_dissolve_boundaries);
+void BM_mesh_decimate_dissolve(BMesh *bm, const float angle_limit, const bool do_dissolve_boundaries);
 
 /* these weights are accumulated so too high values may reach 'inf' too quickly */
 #define BM_MESH_DECIM_WEIGHT_MAX 100000.0f
diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
index 794afb3..e94bb9f 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
@@ -134,7 +134,7 @@ static void bm_decim_calc_target_co(BMEdge *e, float optimize_co[3],
 	}
 }
 
-static int bm_edge_collapse_is_degenerate_flip(BMEdge *e, const float optimize_co[3])
+static bool bm_edge_collapse_is_degenerate_flip(BMEdge *e, const float optimize_co[3])
 {
 	BMIter liter;
 	BMLoop *l;
@@ -175,13 +175,13 @@ static int bm_edge_collapse_is_degenerate_flip(BMEdge *e, const float optimize_c
 				 * (first making it zero area, then flipping again) */
 				if (dot_v3v3(cross_exist, cross_optim) <= FLT_EPSILON) {
 					//printf("no flip\n");
-					return TRUE;
+					return true;
 				}
 			}
 		}
 	}
 
-	return FALSE;
+	return false;
 }
 
 static void bm_decim_build_edge_cost_single(BMEdge *e,
@@ -291,15 +291,15 @@ static void bm_decim_build_edge_cost(BMesh *bm,
  * collapsing edges so even has some advantage over decimating quads
  * directly.
  *
- * \return TRUE if any faces were triangulated.
+ * \return true if any faces were triangulated.
  */
 
-static int bm_decim_triangulate_begin(BMesh *bm)
+static bool bm_decim_triangulate_begin(BMesh *bm)
 {
 	BMIter iter;
 	BMFace *f;
-	// int has_quad;  // could optimize this a little
-	int has_cut = FALSE;
+	// bool has_quad;  // could optimize this a little
+	bool has_cut = false;
 
 	BLI_assert((bm->elem_index_dirty & BM_VERT) == 0);
 
@@ -345,7 +345,7 @@ static int bm_decim_triangulate_begin(BMesh *bm)
 			}
 
 #ifdef USE_SAFETY_CHECKS
-			if (BM_edge_exists(l_a->v, l_b->v) == FALSE)
+			if (BM_edge_exists(l_a->v, l_b->v) == false)
 #endif
 			{
 				BMFace *f_new;
@@ -355,7 +355,7 @@ static int bm_decim_triangulate_begin(BMesh *bm)
 				 * - if there is a quad that has a free standing edge joining it along
 				 * where we want to split the face, there isnt a good way we can handle this.
 				 * currently that edge will get removed when joining the tris back into a quad. */
-				f_new = BM_face_split(bm, f, l_a->v, l_b->v, &l_new, NULL, FALSE);
+				f_new = BM_face_split(bm, f, l_a->v, l_b->v, &l_new, NULL, false);
 
 				if (f_new) {
 					/* the value of this doesn't matter, only that the 2 loops match and have unique values */
@@ -370,7 +370,7 @@ static int bm_decim_triangulate_begin(BMesh *bm)
 					BM_face_normal_update(f);
 					BM_face_normal_update(f_new);
 
-					has_cut = TRUE;
+					has_cut = true;
 				}
 			}
 		}
@@ -410,15 +410,15 @@ static void bm_decim_triangulate_end(BMesh *bm)
 								BM_vert_in_edge(e, l_b->next->v) ? l_b->prev->v : l_b->next->v,
 							};
 
-							BLI_assert(ELEM3(vquad[0], vquad[1], vquad[2], vquad[3]) == FALSE);
-							BLI_assert(ELEM3(vquad[1], vquad[0], vquad[2], vquad[3]) == FALSE);
-							BLI_assert(ELEM3(vquad[2], vquad[1], vquad[0], vquad[3]) == FALSE);
-							BLI_assert(ELEM3(vquad[3], vquad[1], vquad[2], vquad[0]) == FALSE);
+							BLI_assert(ELEM3(vquad[0], vquad[1], vquad[2], vquad[3]) == false);
+							BLI_assert(ELEM3(vquad[1], vquad[0], vquad[2], vquad[3]) == false);
+							BLI_assert(ELEM3(vquad[2], vquad[1], vquad[0], vquad[3]) == false);
+							BLI_assert(ELEM3(vquad[3], vquad[1], vquad[2], vquad[0]) == false);
 
 							if (is_quad_convex_v3(vquad[0]->co, vquad[1]->co, vquad[2]->co, vquad[3]->co)) {
 								/* highly unlikely to fail, but prevents possible double-ups */
 								BMFace *f[2] = {l_a->f, l_b->f};
-								BM_faces_join(bm, f, 2, TRUE);
+								BM_faces_join(bm, f, 2, true);
 							}
 						}
 					}
@@ -445,7 +445,7 @@ static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_cle
 //#define USE_SEAM
 	/* these don't need to be updated, since they will get removed when the edge collapses */
 	BMLoop *l_clear, *l_other;
-	const int is_manifold = BM_edge_is_manifold(l->e);
+	const bool is_manifold = BM_edge_is_manifold(l->e);
 	int side;
 
 	/* l defines the vert to collapse into  */
@@ -467,7 +467,7 @@ static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_cle
 	/* now we have both corners of the face 'l->f' */
 	for (side = 0; side < 2; side++) {
 #ifdef USE_SEAM
-		int is_seam = FALSE;
+		bool is_seam = false;
 #endif
 		void *src[2];
 		BMFace *f_exit = is_manifold ? l->radial_next->f : NULL;
@@ -507,7 +507,7 @@ static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_cle
 
 #ifdef USE_SEAM
 			/* break out unless we find a match */
-			is_seam = TRUE;
+			is_seam = true;
 #endif
 
 			/* ok. we have a loop. now be smart with it! */
@@ -517,13 +517,13 @@ static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_cle
 					const int type = bm->ldata.layers[i].type;
 					void *cd_src[2] = {(char *)src[0] + offset,
 					                   (char *)src[1] + offset};
-					void *cd_iter  = (char *)l_iter->head.data  + offset;;
+					void *cd_iter = (char *)l_iter->head.data + offset;
 
 					/* detect seams */
 					if (CustomData_data_equals(type, cd_src[0], cd_iter)) {
 						CustomData_bmesh_interp_n(&bm->ldata, cd_src, w, NULL, 2, l_iter->head.data, i);
 #ifdef USE_SEAM
-						is_seam = FALSE;
+						is_seam = false;
 #endif
 					}
 				}
@@ -598,7 +598,7 @@ BLI_INLINE int bm_edge_is_manifold_or_boundary(BMLoop *l)
 #endif
 }
 
-static int bm_edge_collapse_is_degenerate_topology(BMEdge *e_first)
+static bool bm_edge_collapse_is_degenerate_topology(BMEdge *e_first)
 {
 	/* simply check that there is no overlap between faces and edges of each vert,
 	 * (excluding the 2 faces attached to 'e' and 'e' its self) */
@@ -609,7 +609,7 @@ static int bm_edge_collapse_is_degenerate_topology(BMEdge *e_first)
 	e_iter = e_first;
 	do {
 		if (!bm_edge_is_manifold_or_boundary(e_iter->l)) {
-			return TRUE;
+			return true;
 		}
 		bm_edge_tag_disable(e_iter);
 	} while ((e_iter = bmesh_disk_edge_next(e_iter, e_first->v1)) != e_first);
@@ -617,7 +617,7 @@ static int bm_edge_collapse_is_degenerate_topology(BMEdge *e_first)
 	e_iter = e_first;
 	do {
 		if (!bm_edge_is_manifold_or_boundary(e_iter->l)) {
-			return TRUE;
+			return true;
 		}
 		bm_edge_tag_disable(e_iter);
 	} while ((e_iter = bmesh_disk_edge_next(e_iter, e_first->v2)) != e_first);
@@ -673,11 +673,11 @@ static int bm_edge_collapse_is_degenerate_topology(BMEdge *e_first)
 	e_iter = e_first;
 	do {
 		if (bm_edge_tag_test(e_iter)) {
-			return TRUE;
+			return true;
 		}
 	} while ((e_iter = bmesh_disk_edge_next(e_iter, e_first->v2)) != e_first);
 
-	return FALSE;
+	return false;
 }
 
 /**
@@ -690,13 +690,13 @@ static int bm_edge_collapse_is_degenerate_topology(BMEdge *e_first)
  * \param e_clear_other let caller know what edges we remove besides \a e_clear
  * \param customdata_flag merge factor, scales from 0 - 1 ('v_clear' -> 'v_other')
  */
-static int bm_edge_collapse(BMesh *bm, BMEdge *e_clear, BMVert *v_clear, int r_e_clear_other[2],
+static bool bm_edge_collapse(BMesh *bm, BMEdge *e_clear, BMVert *v_clear, int r_e_clear_other[2],
 #ifdef USE_CUSTOMDATA
-                            const CD_UseFlag customdata_flag,
-                            const float customdata_fac
+                             const CD_UseFlag customdata_flag,
+                             const float customdata_fac
 #else
-                            const CD_UseFlag UNUSED(customdata_flag),
-                            const float UNUSED(customdata_fac)
+                             const CD_UseFlag UNUSED(customdata_flag),
+                             const float UNUSED(customdata_fac)
 #endif
                             )
 {
@@ -708,11 +708,11 @@ static int bm_edge_collapse(BMesh *bm, BMEdge *e_clear, BMVert *v_clear, int r_e
 	if (BM_edge_is_manifold(e_clear)) {
 		BMLoop *l_a, *l_b;
 		BMEdge *e_a_other[2], *e_b_other[2];
-		int ok;
+		bool ok;
 
 		ok = BM_edge_loop_pair(e_clear, &l_a, &l_b);
 
-		BLI_assert(ok == TRUE);
+		BLI_assert(ok == true);
 		BLI_assert(l_a->f->len == 3);
 		BLI_assert(l_b->f->len == 3);
 
@@ -749,7 +749,7 @@ static int bm_edge_collapse(BMesh *bm, BMEdge *e_clear, BMVert *v_clear, int r_e
 		if (ELEM(e_a_other[0], e_b_other[0], e_b_other[1]) ||
 		    ELEM(e_a_other[1], e_b_other[0], e_b_other[1]))
 		{
-			return FALSE;
+			return false;
 		}
 
 		r_e_clear_other[0] = BM_elem_index_get(e_a_other[0]);
@@ -782,7 +782,7 @@ static int bm_edge_collapse(BMesh *bm, BMEdge *e_clear, BMVert *v_clear, int r_e
 
 		// BM_mesh_validate(bm);
 
-		return TRUE;
+		return true;
 	}
 	else if (BM_edge_is_boundary(e_clear)) {
 		/* same as above but only one triangle */
@@ -829,10 +829,10 @@ static int bm_edge_collapse(BMesh *bm, BMEdge *e_clear, BMVert *v_clear, int r_e
 
 		// BM_mesh_validate(bm);
 
-		return TRUE;
+		return true;
 	}
 	else {
-		return FALSE;
+		return false;
 	}
 }
 
@@ -869,7 +869,7 @@ static void bm_decim_edge_collapse(BMesh *bm, BMEdge *e,
 	}
 
 	/* use for customdata merging */
-	if (LIKELY(compare_v3v3(e->v1->co, e->v2->co, FLT_EPSILON) == FALSE)) {
+	if (LIKELY(compare_v3v3(e->v1->co, e->v2->co, FLT_EPSILON) == false)) {
 		customdata_fac = line_point_factor_v3(optimize_co, e->v1->co, e->v2->co);
 #if 0
 		/* simple test for stupid collapse */
@@ -946,7 +946,7 @@ static void bm_decim_edge_collapse(BMesh *bm, BMEdge *e,
 					else
 						e_outer = l->prev->e;
 
-					BLI_assert(BM_vert_in_edge(e_outer, l->v) == FALSE);
+					BLI_assert(BM_vert_in_edge(e_outer, l->v) == false);
 
 					bm_decim_build_edge_cost_single(e_outer, vquadrics, vweights, eheap, eheap_table);
 				}
@@ -972,14 +972,14 @@ static void bm_decim_edge_collapse(BMesh *bm, BMEdge *e,
  * \param vweights Optional array of vertex  aligned weights [0 - 1],
  *        a vertex group is the usual source for this.
  */
-void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights, const int do_triangulate)
+void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights, const bool do_triangulate)
 {
 	Heap *eheap;             /* edge heap */
 	HeapNode **eheap_table;  /* edge index aligned table pointing to the eheap */
 	Quadric *vquadrics;      /* vert index aligned quadrics */
 	int tot_edge_orig;
 	int face_tot_target;
-	int use_triangulate;
+	bool use_triangulate;
 
 	CD_UseFlag customdata_flag = 0;
 
@@ -1015,7 +1015,7 @@ void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights, c
 
 	/* iterative edge collapse and maintain the eheap */
 	while ((bm->totface > face_tot_target) &&
-	       (BLI_heap_is_empty(eheap) == FALSE) &&
+	       (BLI_heap_is_empty(eheap) == false) &&
 	       (BLI_heap_node_value(BLI_heap_top(eheap)) != COST_INVALID))
 	{
 		// const float value = BLI_heap_node_value(BLI_heap_top(eheap));
@@ -1033,7 +1033,7 @@ void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights, c
 
 
 #ifdef USE_TRIANGULATE
-	if (do_triangulate == FALSE) {
+	if (do_triangulate == false) {
 		/* its possible we only had triangles, skip this step in that case */
 		if (LIKELY(use_triangulate)) {
 			/* temp convert quads to triangles */
diff --git a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
index f67f01e..3a72476 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
@@ -69,7 +69,7 @@ static int dissolve_elem_cmp(const void *a1, const void *a2)
 	return 0;
 }
 
-void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const int do_dissolve_boundaries,
+void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const bool do_dissolve_boundaries,
                                   BMVert **vinput_arr, const int vinput_len,
                                   BMEdge **einput_arr, const int einput_len)
 {
@@ -117,7 +117,7 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const int
 				BMFace *nf = BM_faces_join_pair(bm, e->l->f,
 				                                e->l->radial_next->f,
 				                                e,
-				                                FALSE); /* join faces */
+				                                false); /* join faces */
 
 				/* there may be some errors, we don't mind, just move on */
 				if (nf) {
@@ -148,7 +148,7 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const int
 	for (i = bm->totedge - 1; i != -1; i--) {
 		e_iter = earray[i];
 
-		if (BM_edge_is_wire(e_iter) && (BM_elem_flag_test(e_iter, BM_ELEM_TAG) == FALSE)) {
+		if (BM_edge_is_wire(e_iter) && (BM_elem_flag_test(e_iter, BM_ELEM_TAG) == false)) {
 			/* edge has become wire */
 			int vidx_reverse;
 			BMVert *v1 = e_iter->v1;
@@ -179,7 +179,7 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const int
 			if (LIKELY(v != NULL) &&
 			    BM_vert_edge_count(v) == 2)
 			{
-				BM_vert_collapse_edge(bm, v->e, v, TRUE); /* join edges */
+				BM_vert_collapse_edge(bm, v->e, v, true); /* join edges */
 			}
 		}
 	}
@@ -210,7 +210,7 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const int
 				    /* check twice because cumulative effect could dissolve over angle limit */
 				    bm_vert_edge_face_angle(v) < angle_limit)
 				{
-					BMEdge *ne = BM_vert_collapse_edge(bm, v->e, v, TRUE); /* join edges */
+					BMEdge *ne = BM_vert_collapse_edge(bm, v->e, v, true); /* join edges */
 
 					if (ne && ne->l) {
 						BM_edge_normals_update(ne);
@@ -223,7 +223,7 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const int
 	MEM_freeN(weight_elems);
 }
 
-void BM_mesh_decimate_dissolve(BMesh *bm, const float angle_limit, const int do_dissolve_boundaries)
+void BM_mesh_decimate_dissolve(BMesh *bm, const float angle_limit, const bool do_dissolve_boundaries)
 {
 	int vinput_len;
 	int einput_len;
diff --git a/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c b/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c
index 71c1ced..7e9a578 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c
@@ -36,7 +36,7 @@
 #include "intern/bmesh_operators_private.h" /* own include */
 
 
-static int bm_vert_dissolve_fan_test(BMVert *v)
+static bool bm_vert_dissolve_fan_test(BMVert *v)
 {
 	/* check if we should walk over these verts */
 	BMIter iter;
@@ -61,21 +61,21 @@ static int bm_vert_dissolve_fan_test(BMVert *v)
 	}
 
 	if ((tot_edge == 4) && (tot_edge_boundary == 0) && (tot_edge_manifold == 4)) {
-		return TRUE;
+		return true;
 	}
 	else if ((tot_edge == 3) && (tot_edge_boundary == 0) && (tot_edge_manifold == 3)) {
-		return TRUE;
+		return true;
 	}
 	else if ((tot_edge == 3) && (tot_edge_boundary == 2) && (tot_edge_manifold == 1)) {
-		return TRUE;
+		return true;
 	}
 	else if ((tot_edge == 2) && (tot_edge_wire == 2)) {
-		return TRUE;
+		return true;
 	}
-	return FALSE;
+	return false;
 }
 
-static int bm_vert_dissolve_fan(BMesh *bm, BMVert *v)
+static bool bm_vert_dissolve_fan(BMesh *bm, BMVert *v)
 {
 	/* collapse under 2 conditions.
 	 * - vert connects to 4 manifold edges (and 4 faces).
@@ -110,7 +110,7 @@ static int bm_vert_dissolve_fan(BMesh *bm, BMVert *v)
 	if (tot_edge == 2) {
 		/* check for 2 wire verts only */
 		if (tot_edge_wire == 2) {
-			return (BM_vert_collapse_edge(bm, v->e, v, TRUE) != NULL);
+			return (BM_vert_collapse_edge(bm, v->e, v, true) != NULL);
 		}
 	}
 	else if (tot_edge == 4) {
@@ -145,7 +145,7 @@ static int bm_vert_dissolve_fan(BMesh *bm, BMVert *v)
 			if (l->f->len > 3) {
 				BMLoop *l_new;
 				BLI_assert(l->prev->v != l->next->v);
-				BM_face_split(bm, l->f, l->prev->v, l->next->v, &l_new, NULL, TRUE);
+				BM_face_split(bm, l->f, l->prev->v, l->next->v, &l_new, NULL, true);
 				BM_elem_flag_merge_into(l_new->e, l->e, l->prev->e);
 			}
 		}
@@ -153,7 +153,7 @@ static int bm_vert_dissolve_fan(BMesh *bm, BMVert *v)
 		return BM_vert_dissolve(bm, v);
 	}
 
-	return FALSE;
+	return false;
 }
 
 enum {
@@ -170,7 +170,7 @@ enum {
 
 /**
  * \param tag_only so we can call this from an operator */
-void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int tag_only)
+void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const bool tag_only)
 {
 #ifdef USE_WALKER
 #  define ELE_VERT_TAG 1
@@ -189,16 +189,16 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int
 
 	int iter_step;
 
-	/* if tag_only is set, we assyme the caller knows what verts to tag
+	/* if tag_only is set, we assume the caller knows what verts to tag
 	 * needed for the operator */
-	if (tag_only == FALSE) {
+	if (tag_only == false) {
 		BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
 			BM_elem_flag_enable(v, BM_ELEM_TAG);
 		}
 	}
 
 	for (iter_step = 0; iter_step < iterations; iter_step++) {
-		int iter_done;
+		bool iter_done;
 
 		BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
 			if (BM_elem_flag_test(v, BM_ELEM_TAG) && bm_vert_dissolve_fan_test(v)) {
@@ -215,7 +215,7 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int
 
 
 		/* main loop, keep tagging until we can't tag any more islands */
-		while (TRUE) {
+		while (true) {
 #ifdef USE_WALKER
 			BMWalker walker;
 #else
@@ -273,7 +273,7 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int
 			vert_seek_b_tot = 0;
 			vert_seek_b[vert_seek_b_tot++] = v_first;
 
-			while (TRUE) {
+			while (true) {
 				BMEdge *e;
 
 				if ((offset + depth) % nth) {
@@ -318,14 +318,16 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int
 		}
 
 		/* now we tagged all verts -1 for removal, lets loop over and rebuild faces */
-		iter_done = FALSE;
+		iter_done = false;
 		BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
 			if (BM_elem_index_get(v) == VERT_INDEX_DO_COLLAPSE) {
-				iter_done |= bm_vert_dissolve_fan(bm, v);
+				if (bm_vert_dissolve_fan(bm, v)) {
+					iter_done = true;
+				}
 			}
 		}
 
-		if (iter_done == FALSE) {
+		if (iter_done == false) {
 			break;
 		}
 	}
@@ -340,5 +342,5 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const int
 
 void BM_mesh_decimate_unsubdivide(BMesh *bm, const int iterations)
 {
-	BM_mesh_decimate_unsubdivide_ex(bm, iterations, FALSE);
+	BM_mesh_decimate_unsubdivide_ex(bm, iterations, false);
 }
diff --git a/source/blender/bmesh/tools/bmesh_edgesplit.c b/source/blender/bmesh/tools/bmesh_edgesplit.c
index b6a8c79..1d3f973 100644
--- a/source/blender/bmesh/tools/bmesh_edgesplit.c
+++ b/source/blender/bmesh/tools/bmesh_edgesplit.c
@@ -98,14 +98,14 @@ static void bm_edgesplit_validate_seams(BMesh *bm)
 	MEM_freeN(vtouch);
 }
 
-void BM_mesh_edgesplit(BMesh *bm, const int use_verts, const int tag_only)
+void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only)
 {
 	BMIter iter;
 	BMEdge *e;
 
 
-	if (tag_only == FALSE) {
-		BM_mesh_elem_hflag_enable_all(bm, BM_EDGE | (use_verts ? BM_VERT : 0), BM_ELEM_TAG, FALSE);
+	if (tag_only == false) {
+		BM_mesh_elem_hflag_enable_all(bm, BM_EDGE | (use_verts ? BM_VERT : 0), BM_ELEM_TAG, false);
 	}
 
 	if (use_verts) {
@@ -117,8 +117,8 @@ void BM_mesh_edgesplit(BMesh *bm, const int use_verts, const int tag_only)
 		 */
 		BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
 			if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
-				if (UNLIKELY(((BM_elem_flag_test(e->v1, BM_ELEM_TAG) == FALSE) &&
-				              (BM_elem_flag_test(e->v2, BM_ELEM_TAG) == FALSE))))
+				if (UNLIKELY(((BM_elem_flag_test(e->v1, BM_ELEM_TAG) == false) &&
+				              (BM_elem_flag_test(e->v2, BM_ELEM_TAG) == false))))
 				{
 					BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
 					BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
@@ -146,10 +146,10 @@ void BM_mesh_edgesplit(BMesh *bm, const int use_verts, const int tag_only)
 
 	if (use_verts) {
 		BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
-			if (BM_elem_flag_test(e->v1, BM_ELEM_TAG) == FALSE) {
+			if (BM_elem_flag_test(e->v1, BM_ELEM_TAG) == false) {
 				BM_elem_flag_disable(e->v1, BM_ELEM_TAG);
 			}
-			if (BM_elem_flag_test(e->v2, BM_ELEM_TAG) == FALSE) {
+			if (BM_elem_flag_test(e->v2, BM_ELEM_TAG) == false) {
 				BM_elem_flag_disable(e->v2, BM_ELEM_TAG);
 			}
 		}
diff --git a/source/blender/bmesh/tools/bmesh_edgesplit.h b/source/blender/bmesh/tools/bmesh_edgesplit.h
index 687fdac..8c1231d 100644
--- a/source/blender/bmesh/tools/bmesh_edgesplit.h
+++ b/source/blender/bmesh/tools/bmesh_edgesplit.h
@@ -27,6 +27,6 @@
  *  \ingroup bmesh
  */
 
-void BM_mesh_edgesplit(BMesh *bm, const int use_verts, const int tag_only);
+void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only);
 
 #endif /* __BMESH_EDGESPLIT_H__ */
diff --git a/source/blender/bmesh/tools/bmesh_triangulate.c b/source/blender/bmesh/tools/bmesh_triangulate.c
new file mode 100644
index 0000000..79f6c76
--- /dev/null
+++ b/source/blender/bmesh/tools/bmesh_triangulate.c
@@ -0,0 +1,87 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Joseph Eagar
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/bmesh/tools/bmesh_triangulate.c
+ *  \ingroup bmesh
+ *
+ * Triangulate.
+ *
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_array.h"
+
+#include "bmesh.h"
+
+#include "bmesh_triangulate.h"  /* own include */
+
+/**
+ * a version of #BM_face_triangulate that maps to #BMOpSlot
+ */
+static void bm_face_triangulate_mapping(BMesh *bm, BMFace *face, const bool use_beauty, const bool use_tag,
+                                        BMOperator *op, BMOpSlot *slot_facemap_out)
+{
+	const int faces_array_tot = face->len - 3;
+	BMFace  **faces_array = BLI_array_alloca(faces_array, faces_array_tot);
+	BLI_assert(face->len > 3);
+
+	BM_face_triangulate(bm, face, faces_array, use_beauty, use_tag);
+
+	if (faces_array) {
+		int i;
+		BMO_slot_map_elem_insert(op, slot_facemap_out, face, face);
+		for (i = 0; i < faces_array_tot; i++) {
+			BMO_slot_map_elem_insert(op, slot_facemap_out, faces_array[i], face);
+		}
+	}
+}
+
+
+void BM_mesh_triangulate(BMesh *bm, const bool use_beauty, const bool tag_only,
+                         BMOperator *op, BMOpSlot *slot_facemap_out)
+{
+	BMIter iter;
+	BMFace *face;
+
+	if (slot_facemap_out) {
+		/* same as below but call: bm_face_triangulate_mapping() */
+		BM_ITER_MESH (face, &iter, bm, BM_FACES_OF_MESH) {
+			if (face->len > 3) {
+				if (tag_only == false || BM_elem_flag_test(face, BM_ELEM_TAG)) {
+					bm_face_triangulate_mapping(bm, face, use_beauty, tag_only,
+					                            op, slot_facemap_out);
+				}
+			}
+		}
+	}
+	else {
+		BM_ITER_MESH (face, &iter, bm, BM_FACES_OF_MESH) {
+			if (face->len > 3) {
+				if (tag_only == false || BM_elem_flag_test(face, BM_ELEM_TAG)) {
+					BM_face_triangulate(bm, face, NULL, use_beauty, tag_only);
+				}
+			}
+		}
+	}
+}
diff --git a/source/blender/bmesh/tools/bmesh_triangulate.h b/source/blender/bmesh/tools/bmesh_triangulate.h
new file mode 100644
index 0000000..936a90d
--- /dev/null
+++ b/source/blender/bmesh/tools/bmesh_triangulate.h
@@ -0,0 +1,36 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Joseph Eagar
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/bmesh/tools/bmesh_triangulate.h
+ *  \ingroup bmesh
+ *
+ * Triangulate.
+ *
+ */
+
+#ifndef __BMESH_TRIAMGULATE_H__
+#define __BMESH_TRIAMGULATE_H__
+
+void BM_mesh_triangulate(BMesh *bm, const bool use_beauty, const bool tag_only,
+                         BMOperator *op, BMOpSlot *slot_facemap_out);
+
+#endif  /* __BMESH_TRIAMGULATE_H__ */
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 26b5edf..a69f791 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -24,6 +24,8 @@
 #include "AnimationExporter.h"
 #include "MaterialExporter.h"
 
+Global G;
+
 template<class Functor>
 void forEachObjectInExportSet(Scene *sce, Functor &f, LinkNode *export_set)
 {
@@ -83,6 +85,11 @@ void AnimationExporter::operator()(Object *ob)
 
 	}
 
+	export_object_constraint_animation(ob);
+
+	//This needs to be handled by extra profiles, so postponed for now
+	//export_morph_animation(ob);
+		
 	//Export Lamp parameter animations
 	if ( (ob->type == OB_LAMP) && ((Lamp *)ob->data)->adt && ((Lamp *)ob->data)->adt->action) {
 		fcu = (FCurve *)(((Lamp *)ob->data)->adt->action->curves.first);
@@ -134,7 +141,69 @@ void AnimationExporter::operator()(Object *ob)
 				fcu = fcu->next;
 			}
 		}
+	}
+
+
+}
+
+void AnimationExporter::export_object_constraint_animation(Object *ob)
+{
+	std::vector<float> fra;
+	//Takes frames of target animations
+	make_anim_frames_from_targets(ob, fra);
+
+	if (fra.size())
+		dae_baked_object_animation(fra, ob);
+}
+
+void AnimationExporter::export_morph_animation(Object *ob)
+{ 
+	FCurve *fcu;
+	char *transformName;
+	Key *key = BKE_key_from_object(ob);
+	if (!key) return;
+
+	if (key->adt && key->adt->action) {
+		fcu = (FCurve *)key->adt->action->curves.first;
+		
+		while (fcu) {
+			transformName = extract_transform_name(fcu->rna_path);
+
+			dae_animation(ob, fcu, transformName, true);
+			
+			fcu = fcu->next;
+		}
+	}
+
+}
 
+void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<float> &frames )
+{
+	ListBase *conlist = get_active_constraints(ob);
+	if (conlist == NULL) return;
+	bConstraint *con;
+	for (con = (bConstraint*)conlist->first; con; con = con->next) {
+		ListBase targets = {NULL, NULL};
+		
+		bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
+		
+		if (!validateConstraints(con)) continue;
+
+		if (cti && cti->get_constraint_targets) {
+			bConstraintTarget *ct;
+			Object *obtar;
+			/* get targets 
+			 *  - constraints should use ct->matrix, not directly accessing values
+			 *	- ct->matrix members have not yet been calculated here! 
+			 */
+			cti->get_constraint_targets(con, &targets);
+			if (cti) {
+				for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
+					obtar = ct->tar;
+					find_frames(obtar, frames);
+				}
+			}
+		}
 	}
 }
 
@@ -205,8 +274,8 @@ void AnimationExporter::dae_animation(Object *ob, FCurve *fcu, char *transformNa
 
 	//axis names for colors
 	else if (!strcmp(transformName, "color") ||
-			 !strcmp(transformName, "specular_color") ||
-			 !strcmp(transformName, "diffuse_color") ||
+	         !strcmp(transformName, "specular_color") ||
+	         !strcmp(transformName, "diffuse_color") ||
 	         !strcmp(transformName, "alpha"))
 	{
 		const char *axis_names[] = {"R", "G", "B"};
@@ -216,9 +285,9 @@ void AnimationExporter::dae_animation(Object *ob, FCurve *fcu, char *transformNa
 
 	//axis names for transforms
 	else if (!strcmp(transformName, "location") ||
-			 !strcmp(transformName, "scale") ||
+	         !strcmp(transformName, "scale") ||
 	         !strcmp(transformName, "rotation_euler") ||
-			 !strcmp(transformName, "rotation_quaternion"))
+	         !strcmp(transformName, "rotation_quaternion"))
 	{
 		const char *axis_names[] = {"X", "Y", "Z"};
 		if (fcu->array_index < 3)
@@ -320,6 +389,9 @@ void AnimationExporter::dae_animation(Object *ob, FCurve *fcu, char *transformNa
 		if (ma)
 			target = translate_id(id_name(ma)) + "-effect" +
 			         "/common/" /*profile common is only supported */ + get_transform_sid(fcu->rna_path, -1, axis_name, true);
+		//if shape key animation, this is the main problem, how to define the channel targets.
+		/*target = get_morph_id(ob) +
+				 "/value" +*/ 
 	}
 	addChannel(COLLADABU::URI(empty, sampler_id), target);
 
@@ -367,7 +439,10 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
 	std::vector<float> fra;
 	//char prefix[256];
 
-	FCurve *fcu = (FCurve *)ob_arm->adt->action->curves.first;
+	//Check if there is a fcurve in the armature for the bone in param
+	//when baking this check is not needed, solve every bone for every frame.
+	/*FCurve *fcu = (FCurve *)ob_arm->adt->action->curves.first;
+
 	while (fcu) {
 		std::string bone_name = getObjectBoneName(ob_arm, fcu);
 		int val = BLI_strcasecmp((char *)bone_name.c_str(), bone->name);
@@ -375,11 +450,13 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
 		fcu = fcu->next;
 	}
 
-	if (!(fcu)) return; 
+	if (!(fcu)) return;*/ 
+
 	bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name);
 	if (!pchan)
 		return;
 
+	//every inserted keyframe of bones.	
 	find_frames(ob_arm, fra);
 
 	if (flag & ARM_RESTPOS) {
@@ -415,7 +492,8 @@ void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_
 
 	// create output source
 	std::string output_id;
-	output_id = create_4x4_source(fra, ob_arm, bone,  anim_id);
+
+	output_id = create_4x4_source(fra, ob_arm, bone, anim_id);
 
 	// create interpolations source
 	std::string interpolation_id = fake_interpolation_source(fra.size(), anim_id, "");
@@ -439,6 +517,48 @@ void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_
 	closeAnimation();
 }
 
+void AnimationExporter::dae_baked_object_animation(std::vector<float> &fra, Object *ob)
+{
+	std::string ob_name = id_name(ob);
+	char anim_id[200];
+
+	if (!fra.size())
+		return;
+
+	BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s", (char*)translate_id(ob_name).c_str(),
+	             "object_matrix");
+
+	openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING);
+
+	// create input source
+	std::string input_id = create_source_from_vector(COLLADASW::InputSemantic::INPUT, fra, false, anim_id, "");
+
+	// create output source
+	std::string output_id;
+	output_id = create_4x4_source( fra, ob, NULL, anim_id);
+
+	// create interpolations source
+	std::string interpolation_id = fake_interpolation_source(fra.size(), anim_id, "");
+
+	std::string sampler_id = std::string(anim_id) + SAMPLER_ID_SUFFIX;
+	COLLADASW::LibraryAnimations::Sampler sampler(sw, sampler_id);
+	std::string empty;
+	sampler.addInput(COLLADASW::InputSemantic::INPUT, COLLADABU::URI(empty, input_id));
+	sampler.addInput(COLLADASW::InputSemantic::OUTPUT, COLLADABU::URI(empty, output_id));
+
+	// TODO create in/out tangents source
+
+	// this input is required
+	sampler.addInput(COLLADASW::InputSemantic::INTERPOLATION, COLLADABU::URI(empty, interpolation_id));
+
+	addSampler(sampler);
+
+	std::string target = translate_id(ob_name) + "/transform";
+	addChannel(COLLADABU::URI(empty, sampler_id), target);
+
+	closeAnimation();
+}
+
 // dae_bone_animation -> add_bone_animation
 // (blend this into dae_bone_animation)
 void AnimationExporter::dae_bone_animation(std::vector<float> &fra, float *values, int tm_type, int axis, std::string ob_name, std::string bone_name)
@@ -610,7 +730,6 @@ void AnimationExporter::get_source_values(BezTriple *bezt, COLLADASW::InputSeman
 				values[1] = bezt->vec[2][1];
 			}
 			break;
-			break;
 		default:
 			*length = 0;
 			break;
@@ -762,7 +881,8 @@ std::string AnimationExporter::create_source_from_vector(COLLADASW::InputSemanti
 	return source_id;
 }
 
-std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Object *ob_arm, Bone *bone, const std::string& anim_id)
+
+std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Object * ob, Bone *bone, const std::string& anim_id)
 {
 	COLLADASW::InputSemantic::Semantics semantic = COLLADASW::InputSemantic::OUTPUT;
 	std::string source_id = anim_id + get_semantic_suffix(semantic);
@@ -780,71 +900,90 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj
 
 	bPoseChannel *parchan = NULL;
 	bPoseChannel *pchan = NULL;
-	bPose *pose = ob_arm->pose;
-
-	pchan = BKE_pose_channel_find_name(pose, bone->name);
 
-	if (!pchan)
-		return "";
+	if (ob->type == OB_ARMATURE ) {
+		bPose *pose = ob->pose;
+		pchan = BKE_pose_channel_find_name(pose, bone->name);
+		if (!pchan)
+			return "";
 
-	parchan = pchan->parent;
-
-	enable_fcurves(ob_arm->adt->action, bone->name);
+		parchan = pchan->parent;
 
+		enable_fcurves(ob->adt->action, bone->name);
+	}
+	
 	std::vector<float>::iterator it;
 	int j = 0;
 	for (it = frames.begin(); it != frames.end(); it++) {
 		float mat[4][4], ipar[4][4];
 
 		float ctime = BKE_scene_frame_get_from_ctime(scene, *it);
-
-		BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
-		BKE_pose_where_is_bone(scene, ob_arm, pchan, ctime, 1);
-
-		// compute bone local mat
-		if (bone->parent) {
-			invert_m4_m4(ipar, parchan->pose_mat);
-			mult_m4_m4m4(mat, ipar, pchan->pose_mat);
-		}
-		else
-			copy_m4_m4(mat, pchan->pose_mat);
-		UnitConverter converter;
-
+		CFRA = BKE_scene_frame_get_from_ctime(scene, *it);
+		//BKE_scene_update_for_newframe(G.main,scene,scene->lay);
+		BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL);
+				
+		if (bone) {
+			if (pchan->flag & POSE_CHAIN) {
+				enable_fcurves(ob->adt->action, NULL);
+				BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL);
+				BKE_pose_where_is(scene, ob);
+			}
+			else {
+				BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
+			}
+			
+			// compute bone local mat
+			if (bone->parent) {
+				invert_m4_m4(ipar, parchan->pose_mat);
+				mult_m4_m4m4(mat, ipar, pchan->pose_mat);
+			}
+			else
+				copy_m4_m4(mat, pchan->pose_mat);
+			
 		// SECOND_LIFE_COMPATIBILITY
 		// AFAIK animation to second life is via BVH, but no
 		// reason to not have the collada-animation be correct
-		if (export_settings->second_life) {
-			float temp[4][4];
-			copy_m4_m4(temp, bone->arm_mat);
-			temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
-			invert_m4(temp);
+			if (export_settings->second_life) {
+				float temp[4][4];
+				copy_m4_m4(temp, bone->arm_mat);
+				temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
+				invert_m4(temp);
 
-			mult_m4_m4m4(mat, mat, temp);
+				mult_m4_m4m4(mat, mat, temp);
 
-			if (bone->parent) {
-				copy_m4_m4(temp, bone->parent->arm_mat);
-				temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
+				if (bone->parent) {
+					copy_m4_m4(temp, bone->parent->arm_mat);
+					temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
 
-				mult_m4_m4m4(mat, temp, mat);
+					mult_m4_m4m4(mat, temp, mat);
+				}
 			}
-		}
 
-		float outmat[4][4];
-		converter.mat4_to_dae(outmat, mat);
+		}
+		else {
+			calc_ob_mat_at_time(ob, ctime, mat);
+		}
+		
+		UnitConverter converter;
 
+		double outmat[4][4];
+		converter.mat4_to_dae_double(outmat, mat);
 
 		source.appendValues(outmat);
 
-
 		j++;
+
+		BIK_release_tree(scene, ob, ctime);
 	}
 
-	enable_fcurves(ob_arm->adt->action, NULL);
+	enable_fcurves(ob->adt->action, NULL);
 
 	source.finish();
 
 	return source_id;
 }
+
+
 // only used for sources with OUTPUT semantic ( locations and scale)
 std::string AnimationExporter::create_xyz_source(float *v, int tot, const std::string& anim_id)
 {
@@ -1184,6 +1323,12 @@ bool AnimationExporter::hasAnimations(Scene *sce)
 			}
 		}
 
+		//check shape key animation
+		if (!fcu) {
+			Key *key = BKE_key_from_object(ob);
+			if (key && key->adt && key->adt->action)
+				fcu = (FCurve *)key->adt->action->curves.first;
+		}
 		if (fcu)
 			return true;
 	}
@@ -1351,3 +1496,43 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
 
 	enable_fcurves(ob_arm->adt->action, NULL);
 }
+
+bool AnimationExporter::validateConstraints(bConstraint *con)
+{
+	bool valid = true;
+	bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
+	/* these we can skip completely (invalid constraints...) */
+	if (cti == NULL) valid = false;
+	if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) valid = false;
+	/* these constraints can't be evaluated anyway */
+	if (cti->evaluate_constraint == NULL) valid = false;
+	/* influence == 0 should be ignored */
+	if (con->enforce == 0.0f) valid = false;
+
+	return valid;
+}
+
+void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[][4])
+{
+	ListBase *conlist = get_active_constraints(ob);
+	bConstraint *con;
+	for (con = (bConstraint*)conlist->first; con; con = con->next) {
+		ListBase targets = {NULL, NULL};
+		
+		bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
+		
+		if (cti && cti->get_constraint_targets) {
+			bConstraintTarget *ct;
+			Object *obtar;
+			cti->get_constraint_targets(con, &targets);
+			for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
+				obtar = ct->tar;
+				BKE_animsys_evaluate_animdata(scene, &obtar->id, obtar->adt, ctime, ADT_RECALC_ANIM);
+				BKE_object_where_is_calc_time(scene, obtar, ctime);
+			}
+		}
+	}
+	BKE_object_where_is_calc_time(scene, ob, ctime);
+	copy_m4_m4(mat, ob->obmat);
+}
+
diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h
index 349930d..d2f50b2 100644
--- a/source/blender/collada/AnimationExporter.h
+++ b/source/blender/collada/AnimationExporter.h
@@ -34,6 +34,7 @@ extern "C"
 #include "DNA_camera_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_material_types.h"
+#include "DNA_constraint_types.h"
 
 #include "BLI_math.h"
 #include "BLI_string.h"
@@ -47,6 +48,10 @@ extern "C"
 #include "BKE_action.h" // pose functions
 #include "BKE_armature.h"
 #include "BKE_object.h"
+#include "BKE_constraint.h"
+#include "BIK_api.h"
+#include "BKE_global.h"
+#include "ED_object.h"
 
 #ifdef NAN_BUILDINFO
 extern char build_rev[];
@@ -73,9 +78,13 @@ extern char build_rev[];
 
 #include "collada_internal.h"
 
+#include "IK_solver.h"
+
 #include <vector>
 #include <algorithm> // std::find
 
+
+
 class AnimationExporter: COLLADASW::LibraryAnimations
 {
 private:
@@ -98,6 +107,10 @@ protected:
 	const ExportSettings *export_settings;
 
 	void dae_animation(Object *ob, FCurve *fcu, char *transformName, bool is_param, Material *ma = NULL);
+    
+	void export_object_constraint_animation(Object *ob);
+
+	void export_morph_animation(Object *ob);
 
 	void write_bone_animation_matrix(Object *ob_arm, Bone *bone);
 
@@ -119,6 +132,8 @@ protected:
 	
 	void dae_baked_animation(std::vector<float> &fra, Object *ob_arm, Bone *bone);
 
+	void dae_baked_object_animation(std::vector<float> &fra, Object *ob);
+
 	float convert_time(float frame);
 
 	float convert_angle(float angle);
@@ -130,7 +145,7 @@ protected:
 	
 	void get_source_values(BezTriple *bezt, COLLADASW::InputSemantic::Semantics semantic, bool rotation, float *values, int *length);
 	
-	float * get_eul_source_for_quat(Object *ob );
+	float* get_eul_source_for_quat(Object *ob );
 
 	std::string create_source_from_fcurve(COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id, const char *axis_name);
 
@@ -143,17 +158,21 @@ protected:
 	std::string create_xyz_source(float *v, int tot, const std::string& anim_id);
 
 	std::string create_4x4_source(std::vector<float> &frames, Object * ob_arm, Bone *bone, const std::string& anim_id);
-
+    
 	std::string create_interpolation_source(FCurve *fcu, const std::string& anim_id, const char *axis_name, bool *has_tangents);
 
 	std::string fake_interpolation_source(int tot, const std::string& anim_id, const char *axis_name);
+	
 	// for rotation, axis name is always appended and the value of append_axis is ignored
 	std::string get_transform_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis);
 	std::string get_light_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis);
 	std::string get_camera_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis);
+	
 	void find_frames(Object *ob, std::vector<float> &fra, const char *prefix, const char *tm_name);
 	void find_frames(Object *ob, std::vector<float> &fra);
 
+	void make_anim_frames_from_targets(Object *ob, std::vector<float> &frames );
+
 	void find_rotation_frames(Object *ob, std::vector<float> &fra, const char *prefix, int rotmode);
 	
 	// enable fcurves driving a specific bone, disable all the rest
@@ -165,4 +184,11 @@ protected:
 	char *extract_transform_name(char *rna_path);
 
 	std::string getObjectBoneName(Object *ob, const FCurve * fcu);
+
+	void getBakedPoseData(Object *obarm, int startFrame, int endFrame, bool ActionBake, bool ActionBakeFirstFrame);
+
+	bool validateConstraints(bConstraint *con);
+
+	void calc_ob_mat_at_time(Object *ob, float ctime , float mat[][4]);
+
 };
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 3d0ceb5..943c4fb 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -937,10 +937,9 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node,
 					if (is_matrix) {
 						apply_matrix_curves(ob, animcurves, root, node,  transform);
 					}
-					else {
+					else {				
 
 						if (is_joint) {
-
 							add_bone_animation_sampled(ob, animcurves, root, node, transform);
 						}
 						else {
@@ -1676,8 +1675,6 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4], COLLADAFW::
 				default:
 					fprintf(stderr, "unsupported transformation type %d\n", type);
 			}
-			// dae_matrix_to_mat4(tm, m);
-			
 		}
 
 		float temp[4][4];
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp
index 134fd63..a56010a 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -75,12 +75,6 @@ void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce,
 	}
 }
 
-bool ArmatureExporter::is_skinned_mesh(Object *ob)
-{
-	return bc_get_assigned_armature(ob) != NULL;
-}
-
-
 void ArmatureExporter::write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone)
 {
 	if (bc_is_root_bone(bone, this->export_settings->deform_bones_only))
@@ -117,26 +111,12 @@ bool ArmatureExporter::add_instance_controller(Object *ob)
 	return true;
 }
 
-void ArmatureExporter::export_controllers(Scene *sce)
-{
-	scene = sce;
-
-	openLibrary();
-
-	GeometryFunctor gf;
-	gf.forEachMeshObjectInExportSet<ArmatureExporter>(sce, *this, this->export_settings->export_set);
-
-	closeLibrary();
-}
-
+#if 0
 void ArmatureExporter::operator()(Object *ob)
 {
 	Object *ob_arm = bc_get_assigned_armature(ob);
 
-	if (ob_arm /*&& !already_written(ob_arm)*/)
-		export_controller(ob, ob_arm);
 }
-#if 0
 
 bool ArmatureExporter::already_written(Object *ob_arm)
 {
@@ -187,67 +167,67 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce,
 		node.setNodeName(node_name);
 		node.setNodeSid(node_sid);
 
-#if 0
+#if 0 
 		if (bone->childbase.first == NULL || BLI_countlist(&(bone->childbase)) >= 2) {
 			add_blender_leaf_bone( bone, ob_arm, node);
 		}
-		else {
+		else{
 #endif
-		node.start();
+			node.start();
 
-		add_bone_transform(ob_arm, bone, node);
+			add_bone_transform(ob_arm, bone, node);
 
-		// Write nodes of childobjects, remove written objects from list
-		std::list<Object *>::iterator i = child_objects.begin();
+			// Write nodes of childobjects, remove written objects from list
+			std::list<Object *>::iterator i = child_objects.begin();
 
-		while (i != child_objects.end()) {
-			if ((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name))) {
-				float backup_parinv[4][4];
-				copy_m4_m4(backup_parinv, (*i)->parentinv);
+			while (i != child_objects.end()) {
+				if ((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name))) {
+					float backup_parinv[4][4];
+					copy_m4_m4(backup_parinv, (*i)->parentinv);
 
-				// crude, temporary change to parentinv
-				// so transform gets exported correctly.
+					// crude, temporary change to parentinv
+					// so transform gets exported correctly.
 
-				// Add bone tail- translation... don't know why
-				// bone parenting is against the tail of a bone
-				// and not it's head, seems arbitrary.
-				(*i)->parentinv[3][1] += bone->length;
+					// Add bone tail- translation... don't know why
+					// bone parenting is against the tail of a bone
+					// and not it's head, seems arbitrary.
+					(*i)->parentinv[3][1] += bone->length;
 
-				// SECOND_LIFE_COMPATIBILITY
-				// TODO: when such objects are animated as
-				// single matrix the tweak must be applied
-				// to the result.
-				if (export_settings->second_life) {
-					// tweak objects parentinverse to match compatibility
-					float temp[4][4];
+					// SECOND_LIFE_COMPATIBILITY
+					// TODO: when such objects are animated as
+					// single matrix the tweak must be applied
+					// to the result.
+					if (export_settings->second_life) {
+						// tweak objects parentinverse to match compatibility
+						float temp[4][4];
 
-					copy_m4_m4(temp, bone->arm_mat);
-					temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
+						copy_m4_m4(temp, bone->arm_mat);
+						temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
 
-					mult_m4_m4m4((*i)->parentinv, temp, (*i)->parentinv);
-				}
+						mult_m4_m4m4((*i)->parentinv, temp, (*i)->parentinv);
+					}
 
-				se->writeNodes(*i, sce);
+					se->writeNodes(*i, sce);
 
-				copy_m4_m4((*i)->parentinv, backup_parinv);
-				child_objects.erase(i++);
+					copy_m4_m4((*i)->parentinv, backup_parinv);
+					child_objects.erase(i++);
+				}
+				else i++;
 			}
-			else i++;
-		}
 
-		for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
-			add_bone_node(child, ob_arm, sce, se, child_objects);
+			for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
+				add_bone_node(child, ob_arm, sce, se, child_objects);
+			}
+			node.end();
 		}
-		node.end();
-	}
-	else {
-		for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
-			add_bone_node(child, ob_arm, sce, se, child_objects);
+		else {
+			for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
+				add_bone_node(child, ob_arm, sce, se, child_objects);
+			}
 		}
-	}
 }
 
-#if 0
+//#if 1
 void ArmatureExporter::add_blender_leaf_bone(Bone *bone, Object *ob_arm, COLLADASW::Node& node)
 {
 	node.start();
@@ -258,33 +238,38 @@ void ArmatureExporter::add_blender_leaf_bone(Bone *bone, Object *ob_arm, COLLADA
 	node.addExtraTechniqueParameter("blender", "tip_y", bone->tail[1]);
 	node.addExtraTechniqueParameter("blender", "tip_z", bone->tail[2]);
 	
-	for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
+	/*for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
 		add_bone_node(child, ob_arm, sce, se, child_objects);
-	}
+	}*/
 	node.end();
 	
 }
-#endif
+//#endif
 
 void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node)
 {
-	bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name);
+	//bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name);
 
 	float mat[4][4];
 
 	if (bone->parent) {
-		// get bone-space matrix from armature-space
-		bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, bone->parent->name);
-
+		// get bone-space matrix from parent pose
+		/*bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, bone->parent->name);
 		float invpar[4][4];
 		invert_m4_m4(invpar, parchan->pose_mat);
-		mult_m4_m4m4(mat, invpar, pchan->pose_mat);
+		mult_m4_m4m4(mat, invpar, pchan->pose_mat);*/
+		
+		float invpar[4][4];
+		invert_m4_m4(invpar, bone->parent->arm_mat);
+		mult_m4_m4m4(mat, invpar, bone->arm_mat);
+
 	}
 	else {
-		copy_m4_m4(mat, pchan->pose_mat);
-		// Why? Joint's localspace is still it's parent node
-		//get world-space from armature-space
-		//mult_m4_m4m4(mat, ob_arm->obmat, pchan->pose_mat);
+		
+		//copy_m4_m4(mat, pchan->pose_mat);
+		//pose mat is object space
+		//New change: export bone->arm_mat
+		copy_m4_m4(mat, bone->arm_mat);
 	}
 
 	// SECOND_LIFE_COMPATIBILITY
@@ -313,315 +298,3 @@ std::string ArmatureExporter::get_controller_id(Object *ob_arm, Object *ob)
 {
 	return translate_id(id_name(ob_arm)) + "_" + translate_id(id_name(ob)) + SKIN_CONTROLLER_ID_SUFFIX;
 }
-
-// ob should be of type OB_MESH
-// both args are required
-void ArmatureExporter::export_controller(Object *ob, Object *ob_arm)
-{
-	// joint names
-	// joint inverse bind matrices
-	// vertex weights
-
-	// input:
-	// joint names: ob -> vertex group names
-	// vertex group weights: me->dvert -> groups -> index, weight
-
-#if 0
-	me->dvert :
-
-	typedef struct MDeformVert {
-		struct MDeformWeight *dw;
-		int totweight;
-		int flag;   // flag only in use for weightpaint now
-	} MDeformVert;
-
-	typedef struct MDeformWeight {
-		int def_nr;
-		float weight;
-	} MDeformWeight;
-#endif
-
-	bool use_instantiation = this->export_settings->use_object_instantiation;
-	Mesh *me;
-
-	if (this->export_settings->apply_modifiers) {
-		me = bc_to_mesh_apply_modifiers(scene, ob, this->export_settings->export_mesh_type);
-	}
-	else {
-		me = (Mesh *)ob->data;
-	}
-	BKE_mesh_tessface_ensure(me);
-
-	if (!me->dvert) return;
-
-	std::string controller_name = id_name(ob_arm);
-	std::string controller_id = get_controller_id(ob_arm, ob);
-
-	openSkin(controller_id, controller_name,
-	         COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob, use_instantiation)));
-
-	add_bind_shape_mat(ob);
-
-	std::string joints_source_id = add_joints_source(ob_arm, &ob->defbase, controller_id);
-	std::string inv_bind_mat_source_id = add_inv_bind_mats_source(ob_arm, &ob->defbase, controller_id);
-
-	std::list<int> vcounts;
-	std::list<int> joints;
-	std::list<float> weights;
-
-	{
-		int i, j;
-
-		// def group index -> joint index
-		std::vector<int> joint_index_by_def_index;
-		bDeformGroup *def;
-
-		for (def = (bDeformGroup *)ob->defbase.first, i = 0, j = 0; def; def = def->next, i++) {
-			if (is_bone_defgroup(ob_arm, def))
-				joint_index_by_def_index.push_back(j++);
-			else
-				joint_index_by_def_index.push_back(-1);
-		}
-
-		for (i = 0; i < me->totvert; i++) {
-			MDeformVert *vert = &me->dvert[i];
-			std::map<int, float> jw;
-
-			// We're normalizing the weights later
-			float sumw = 0.0f;
-
-			for (j = 0; j < vert->totweight; j++) {
-				int joint_index = joint_index_by_def_index[vert->dw[j].def_nr];
-				if (joint_index != -1 && vert->dw[j].weight > 0.0f) {
-					jw[joint_index] += vert->dw[j].weight;
-					sumw += vert->dw[j].weight;
-				}
-			}
-
-			if (sumw > 0.0f) {
-				float invsumw = 1.0f / sumw;
-				vcounts.push_back(jw.size());
-				for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m) {
-					joints.push_back((*m).first);
-					weights.push_back(invsumw * (*m).second);
-				}
-			}
-			else {
-				vcounts.push_back(0);
-#if 0
-				vcounts.push_back(1);
-				joints.push_back(-1);
-				weights.push_back(1.0f);
-#endif
-			}
-		}
-	}
-
-	std::string weights_source_id = add_weights_source(me, controller_id, weights);
-	add_joints_element(&ob->defbase, joints_source_id, inv_bind_mat_source_id);
-	add_vertex_weights_element(weights_source_id, joints_source_id, vcounts, joints);
-
-	if (this->export_settings->apply_modifiers)
-	{
-		BKE_libblock_free_us(&(G.main->mesh), me);
-	}
-	closeSkin();
-	closeController();
-}
-
-void ArmatureExporter::add_joints_element(ListBase *defbase,
-                                          const std::string& joints_source_id, const std::string& inv_bind_mat_source_id)
-{
-	COLLADASW::JointsElement joints(mSW);
-	COLLADASW::InputList &input = joints.getInputList();
-
-	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::JOINT, // constant declared in COLLADASWInputList.h
-	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id)));
-	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::BINDMATRIX,
-	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, inv_bind_mat_source_id)));
-	joints.add();
-}
-
-void ArmatureExporter::add_bind_shape_mat(Object *ob)
-{
-	double bind_mat[4][4];
-
-	converter.mat4_to_dae_double(bind_mat, ob->obmat);
-
-	addBindShapeTransform(bind_mat);
-}
-
-std::string ArmatureExporter::add_joints_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id)
-{
-	std::string source_id = controller_id + JOINTS_SOURCE_ID_SUFFIX;
-
-	int totjoint = 0;
-	bDeformGroup *def;
-	for (def = (bDeformGroup *)defbase->first; def; def = def->next) {
-		if (is_bone_defgroup(ob_arm, def))
-			totjoint++;
-	}
-
-	COLLADASW::NameSource source(mSW);
-	source.setId(source_id);
-	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
-	source.setAccessorCount(totjoint);
-	source.setAccessorStride(1);
-	
-	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
-	param.push_back("JOINT");
-
-	source.prepareToAppendValues();
-
-	for (def = (bDeformGroup *)defbase->first; def; def = def->next) {
-		Bone *bone = get_bone_from_defgroup(ob_arm, def);
-		if (bone)
-			source.appendValues(get_joint_sid(bone, ob_arm));
-	}
-
-	source.finish();
-
-	return source_id;
-}
-
-std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id)
-{
-	std::string source_id = controller_id + BIND_POSES_SOURCE_ID_SUFFIX;
-
-	int totjoint = 0;
-	for (bDeformGroup *def = (bDeformGroup *)defbase->first; def; def = def->next) {
-		if (is_bone_defgroup(ob_arm, def))
-			totjoint++;
-	}
-
-	COLLADASW::FloatSourceF source(mSW);
-	source.setId(source_id);
-	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
-	source.setAccessorCount(totjoint); //BLI_countlist(defbase));
-	source.setAccessorStride(16);
-	
-	source.setParameterTypeName(&COLLADASW::CSWC::CSW_VALUE_TYPE_FLOAT4x4);
-	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
-	param.push_back("TRANSFORM");
-
-	source.prepareToAppendValues();
-
-	bPose *pose = ob_arm->pose;
-	bArmature *arm = (bArmature *)ob_arm->data;
-
-	int flag = arm->flag;
-
-	// put armature in rest position
-	if (!(arm->flag & ARM_RESTPOS)) {
-		arm->flag |= ARM_RESTPOS;
-		BKE_pose_where_is(scene, ob_arm);
-	}
-
-	for (bDeformGroup *def = (bDeformGroup *)defbase->first; def; def = def->next) {
-		if (is_bone_defgroup(ob_arm, def)) {
-			bPoseChannel *pchan = BKE_pose_channel_find_name(pose, def->name);
-
-			float mat[4][4];
-			float world[4][4];
-			float inv_bind_mat[4][4];
-
-			// SECOND_LIFE_COMPATIBILITY
-			if (export_settings->second_life) {
-				// Only translations, no rotation vs armature
-				float temp[4][4];
-				unit_m4(temp);
-				copy_v3_v3(temp[3], pchan->bone->arm_mat[3]);
-				mult_m4_m4m4(world, ob_arm->obmat, temp);
-			}
-			else {
-				// make world-space matrix, arm_mat is armature-space
-				mult_m4_m4m4(world, ob_arm->obmat, pchan->bone->arm_mat);
-			}
-
-			invert_m4_m4(mat, world);
-			converter.mat4_to_dae(inv_bind_mat, mat);
-
-			source.appendValues(inv_bind_mat);
-		}
-	}
-
-	// back from rest positon
-	if (!(flag & ARM_RESTPOS)) {
-		arm->flag = flag;
-		BKE_pose_where_is(scene, ob_arm);
-	}
-
-	source.finish();
-
-	return source_id;
-}
-
-Bone *ArmatureExporter::get_bone_from_defgroup(Object *ob_arm, bDeformGroup *def)
-{
-	bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, def->name);
-	return pchan ? pchan->bone : NULL;
-}
-
-bool ArmatureExporter::is_bone_defgroup(Object *ob_arm, bDeformGroup *def)
-{
-	return get_bone_from_defgroup(ob_arm, def) != NULL;
-}
-
-std::string ArmatureExporter::add_weights_source(Mesh *me, const std::string& controller_id, const std::list<float>& weights)
-{
-	std::string source_id = controller_id + WEIGHTS_SOURCE_ID_SUFFIX;
-
-	COLLADASW::FloatSourceF source(mSW);
-	source.setId(source_id);
-	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
-	source.setAccessorCount(weights.size());
-	source.setAccessorStride(1);
-	
-	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
-	param.push_back("WEIGHT");
-
-	source.prepareToAppendValues();
-
-	for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
-		source.appendValues(*i);
-	}
-
-	source.finish();
-
-	return source_id;
-}
-
-void ArmatureExporter::add_vertex_weights_element(const std::string& weights_source_id, const std::string& joints_source_id,
-                                                  const std::list<int>& vcounts,
-                                                  const std::list<int>& joints)
-{
-	COLLADASW::VertexWeightsElement weightselem(mSW);
-	COLLADASW::InputList &input = weightselem.getInputList();
-
-	int offset = 0;
-	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::JOINT, // constant declared in COLLADASWInputList.h
-	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id), offset++));
-	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::WEIGHT,
-	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, weights_source_id), offset++));
-
-	weightselem.setCount(vcounts.size());
-
-	// write number of deformers per vertex
-	COLLADASW::PrimitivesBase::VCountList vcountlist;
-
-	vcountlist.resize(vcounts.size());
-	std::copy(vcounts.begin(), vcounts.end(), vcountlist.begin());
-
-	weightselem.prepareToAppendVCountValues();
-	weightselem.appendVertexCount(vcountlist);
-
-	weightselem.CloseVCountAndOpenVElement();
-
-	// write deformer index - weight index pairs
-	int weight_index = 0;
-	for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i) {
-		weightselem.appendValues(*i, weight_index++);
-	}
-
-	weightselem.finish();
-}
diff --git a/source/blender/collada/ArmatureExporter.h b/source/blender/collada/ArmatureExporter.h
index 086c16f..6222496 100644
--- a/source/blender/collada/ArmatureExporter.h
+++ b/source/blender/collada/ArmatureExporter.h
@@ -41,6 +41,7 @@
 #include "DNA_listBase.h"
 #include "DNA_mesh_types.h"
 #include "DNA_object_types.h"
+#include "DNA_constraint_types.h"
 #include "DNA_scene_types.h"
 
 #include "TransformWriter.h"
@@ -62,13 +63,11 @@ public:
 	void add_armature_bones(Object *ob_arm, Scene *sce, SceneExporter *se,
 	                        std::list<Object *>& child_objects);
 
-	bool is_skinned_mesh(Object *ob);
-
 	bool add_instance_controller(Object *ob);
 
-	void export_controllers(Scene *sce);
+	//void export_controllers(Scene *sce);*/
 
-	void operator()(Object *ob);
+	//void operator()(Object *ob);
 
 private:
 	Scene *scene;
@@ -98,29 +97,6 @@ private:
 
 	std::string get_controller_id(Object *ob_arm, Object *ob);
 
-	// ob should be of type OB_MESH
-	// both args are required
-	void export_controller(Object *ob, Object *ob_arm);
-
-	void add_joints_element(ListBase *defbase,
-	                        const std::string& joints_source_id, const std::string& inv_bind_mat_source_id);
-
-	void add_bind_shape_mat(Object *ob);
-
-	std::string add_joints_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id);
-
-	std::string add_inv_bind_mats_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id);
-
-	Bone *get_bone_from_defgroup(Object *ob_arm, bDeformGroup *def);
-
-	bool is_bone_defgroup(Object *ob_arm, bDeformGroup *def);
-
-	std::string add_weights_source(Mesh *me, const std::string& controller_id,
-	                               const std::list<float>& weights);
-
-	void add_vertex_weights_element(const std::string& weights_source_id, const std::string& joints_source_id,
-	                                const std::list<int>& vcount, const std::list<int>& joints);
-
 	void write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone);
 };
 
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index f1cf732..c270a1e 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -78,84 +78,8 @@ JointData *ArmatureImporter::get_joint_data(COLLADAFW::Node *node);
 	return &joint_index_to_joint_info_map[joint_index];
 }
 #endif
-void ArmatureImporter::create_unskinned_bone(COLLADAFW::Node *node, EditBone *parent, int totchild,
-                                             float parent_mat[4][4], Object *ob_arm)
-{
-	std::vector<COLLADAFW::Node *>::iterator it;
-	it = std::find(finished_joints.begin(), finished_joints.end(), node);
-	if (it != finished_joints.end()) return;
-
-	float mat[4][4];
-	float obmat[4][4];
-
-	// object-space
-	get_node_mat(obmat, node, NULL, NULL);
 
-	EditBone *bone = ED_armature_edit_bone_add((bArmature *)ob_arm->data, (char *)bc_get_joint_name(node));
-	totbone++;
-	
-	if (parent) bone->parent = parent;
-
-	float angle = 0;
-
-	// get world-space
-	if (parent) {
-		mult_m4_m4m4(mat, parent_mat, obmat);
-
-	}
-	else {
-		copy_m4_m4(mat, obmat);
-
-	}
-	float loc[3], size[3], rot[3][3];
-	mat4_to_loc_rot_size(loc, rot, size, obmat);
-	mat3_to_vec_roll(rot, NULL, &angle);
-	bone->roll = angle;
-	// set head
-	copy_v3_v3(bone->head, mat[3]);
-
-	// set tail, don't set it to head because 0-length bones are not allowed
-	float vec[3] = {0.0f, 0.5f, 0.0f};
-	add_v3_v3v3(bone->tail, bone->head, vec);
-
-	// set parent tail
-	if (parent && totchild == 1) {
-		copy_v3_v3(parent->tail, bone->head);
-		
-		// not setting BONE_CONNECTED because this would lock child bone location with respect to parent
-		// bone->flag |= BONE_CONNECTED;
-	
-		// XXX increase this to prevent "very" small bones?
-		const float epsilon = 0.000001f;
-
-		// derive leaf bone length
-		float length = len_v3v3(parent->head, parent->tail);
-		if ((length < leaf_bone_length || totbone == 0) && length > epsilon) {
-			leaf_bone_length = length;
-		}
-
-		// treat zero-sized bone like a leaf bone
-		if (length <= epsilon) {
-			add_leaf_bone(parent_mat, parent, node);
-		}
-
-	}
-
-	COLLADAFW::NodePointerArray& children = node->getChildNodes();
-	for (unsigned int i = 0; i < children.getCount(); i++) {
-		create_unskinned_bone(children[i], bone, children.getCount(), mat, ob_arm);
-	}
-
-	// in second case it's not a leaf bone, but we handle it the same way
-	if (!children.getCount() || children.getCount() > 1) {
-		add_leaf_bone(mat, bone, node);
-	}
-
-	finished_joints.push_back(node);
-
-}
-
-void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBone *parent, int totchild,
+void ArmatureImporter::create_bone(SkinInfo* skin, COLLADAFW::Node *node, EditBone *parent, int totchild,
                                    float parent_mat[4][4], bArmature *arm)
 {
 	//Checking if bone is already made.
@@ -168,50 +92,52 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
 	// JointData* jd = get_joint_data(node);
 
 	float mat[4][4];
-
+	float obmat[4][4];
+	
 	// TODO rename from Node "name" attrs later
 	EditBone *bone = ED_armature_edit_bone_add(arm, (char *)bc_get_joint_name(node));
 	totbone++;
 
-	if (skin.get_joint_inv_bind_matrix(joint_inv_bind_mat, node)) {
+	if (skin && skin->get_joint_inv_bind_matrix(joint_inv_bind_mat, node)) {
 		// get original world-space matrix
 		invert_m4_m4(mat, joint_inv_bind_mat);
 	}
 	// create a bone even if there's no joint data for it (i.e. it has no influence)
 	else {
-		float obmat[4][4];
-
-		// object-space
+		// bone-space
 		get_node_mat(obmat, node, NULL, NULL);
 
 		// get world-space
-		if (parent)
+		if (parent) {
 			mult_m4_m4m4(mat, parent_mat, obmat);
-		else
+		}
+		else {
 			copy_m4_m4(mat, obmat);
-
-		float loc[3], size[3], rot[3][3], angle;
-		mat4_to_loc_rot_size(loc, rot, size, obmat);
-		mat3_to_vec_roll(rot, NULL, &angle);
-		bone->roll = angle;
+		}
 	}
 
-	
 	if (parent) bone->parent = parent;
 
+	float loc[3], size[3], rot[3][3]; 
+	float angle;
+	float vec[3] = {0.0f, 0.5f, 0.0f};
+	mat4_to_loc_rot_size(loc, rot, size, mat);
+	//copy_m3_m4(bonemat,mat);
+	mat3_to_vec_roll(rot, vec, &angle);
+
+	bone->roll = angle;
 	// set head
 	copy_v3_v3(bone->head, mat[3]);
 
 	// set tail, don't set it to head because 0-length bones are not allowed
-	float vec[3] = {0.0f, 0.5f, 0.0f};
 	add_v3_v3v3(bone->tail, bone->head, vec);
 
 	// set parent tail
 	if (parent && totchild == 1) {
-		copy_v3_v3(parent->tail, bone->head);
+	   copy_v3_v3(parent->tail, bone->head);
 
 		// not setting BONE_CONNECTED because this would lock child bone location with respect to parent
-		// bone->flag |= BONE_CONNECTED;
+		 bone->flag |= BONE_CONNECTED;
 
 		// XXX increase this to prevent "very" small bones?
 		const float epsilon = 0.000001f;
@@ -227,32 +153,6 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
 			add_leaf_bone(parent_mat, parent, node);
 		}
 
-		/*
-#if 0
-		// and which row in mat is bone direction
-		float vec[3];
-		sub_v3_v3v3(vec, parent->tail, parent->head);
-#ifdef COLLADA_DEBUG
-		print_v3("tail - head", vec);
-		print_m4("matrix", parent_mat);
-#endif
-		for (int i = 0; i < 3; i++) {
-#ifdef COLLADA_DEBUG
-			char *axis_names[] = {"X", "Y", "Z"};
-			printf("%s-axis length is %f\n", axis_names[i], len_v3(parent_mat[i]));
-#endif
-			float angle = angle_v2v2(vec, parent_mat[i]);
-			if (angle < min_angle) {
-#ifdef COLLADA_DEBUG
-				print_v3("picking", parent_mat[i]);
-				printf("^ %s axis of %s's matrix\n", axis_names[i], get_dae_name(node));
-#endif
-				bone_direction_row = i;
-				min_angle = angle;
-			}
-		}
-#endif
-		*/
 	}
 
 	COLLADAFW::NodePointerArray& children = node->getChildNodes();
@@ -265,6 +165,8 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
 		add_leaf_bone(mat, bone, node);
 	}
 
+	bone->length = len_v3v3(bone->head, bone->tail);
+
 	finished_joints.push_back(node);
 }
 
@@ -299,7 +201,6 @@ void ArmatureImporter::add_leaf_bone(float mat[4][4], EditBone *bone,  COLLADAFW
 void ArmatureImporter::fix_leaf_bones( )
 {
 	// just setting tail for leaf bones here
-
 	std::vector<LeafBone>::iterator it;
 	for (it = leaf_bones.begin(); it != leaf_bones.end(); it++) {
 		LeafBone& leaf = *it;
@@ -307,11 +208,10 @@ void ArmatureImporter::fix_leaf_bones( )
 		// pointing up
 		float vec[3] = {0.0f, 0.0f, 0.1f};
 		
-		// if parent: take parent length and direction
-		if (leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
+		sub_v3_v3v3(vec, leaf.bone->tail , leaf.bone->head);
+		mul_v3_fl(vec, leaf_bone_length);
+		add_v3_v3v3(leaf.bone->tail, leaf.bone->head , vec);
 
-		copy_v3_v3(leaf.bone->tail, leaf.bone->head);
-		add_v3_v3v3(leaf.bone->tail, leaf.bone->head, vec);
 	}
 }
 
@@ -410,46 +310,40 @@ ArmatureJoints& ArmatureImporter::get_armature_joints(Object *ob_arm)
 void ArmatureImporter::create_armature_bones( )
 {
 	std::vector<COLLADAFW::Node *>::iterator ri;
+
+	leaf_bone_length = FLT_MAX;
 	//if there is an armature created for root_joint next root_joint
 	for (ri = root_joints.begin(); ri != root_joints.end(); ri++) {
 		if (get_armature_for_joint(*ri) != NULL) continue;
 		
-		//add armature object for current joint
-		//Object *ob_arm = bc_add_object(scene, OB_ARMATURE, NULL);
-
 		Object *ob_arm = joint_parent_map[(*ri)->getUniqueId()];
 
 		if (!ob_arm)
 			continue;
 
-		//ob_arm->type = OB_ARMATURE;
 		ED_armature_to_edit(ob_arm);
 
-		// min_angle = 360.0f;		// minimum angle between bone head-tail and a row of bone matrix
-
-		// create unskinned bones
 		/*
 		 * TODO:
 		 * check if bones have already been created for a given joint
 		 */
-		leaf_bone_length = FLT_MAX;
-		create_unskinned_bone(*ri, NULL, (*ri)->getChildNodes().getCount(), NULL, ob_arm);
 
+		create_bone(NULL, *ri , NULL, (*ri)->getChildNodes().getCount(), NULL, (bArmature *)ob_arm->data);
+
+		//leaf bone tails are derived from the matrix, so no need of this.
 		fix_leaf_bones();
 
 		// exit armature edit mode
-	
 		unskinned_armature_map[(*ri)->getUniqueId()] = ob_arm;
 
 		ED_armature_from_edit(ob_arm);
 
-		set_pose(ob_arm, *ri, NULL, NULL);
+		//This serves no purpose, as pose is automatically reset later, in BKE_where_is_bone()
+		//set_pose(ob_arm, *ri, NULL, NULL);
 
 		ED_armature_edit_free(ob_arm);
 		DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB | OB_RECALC_DATA);
 	}
-
-	
 }
 
 void ArmatureImporter::create_armature_bones(SkinInfo& skin)
@@ -521,10 +415,23 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
 			break;
 	}
 
-	if (shared)
+	if (!shared && this->joint_parent_map.size() > 0) {
+		// All armatures have been created while creating the Node tree. 
+		// The Collada exporter currently does not create a 
+		// strict relationship between geometries and armatures
+		// So when we reimport a Blender collada file, then we have
+		// to guess what is meant.
+		// XXX This is not safe when we have more than one armatures
+		// in the import.
+		shared = this->joint_parent_map.begin()->second;
+	}
+
+	if (shared) {
 		ob_arm = skin.set_armature(shared);
-	else
+	}
+	else {
 		ob_arm = skin.create_armature(scene);  //once for every armature
+	}
 
 	// enter armature edit mode
 	ED_armature_to_edit(ob_arm);
@@ -533,7 +440,6 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
 	totbone = 0;
 	// bone_direction_row = 1; // TODO: don't default to Y but use asset and based on it decide on default row
 	leaf_bone_length = FLT_MAX;
-	// min_angle = 360.0f;		// minimum angle between bone head-tail and a row of bone matrix
 
 	// create bones
 	/*
@@ -549,7 +455,7 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
 
 		// since root_joints may contain joints for multiple controllers, we need to filter
 		if (skin.uses_joint_or_descendant(*ri)) {
-			create_bone(skin, *ri, NULL, (*ri)->getChildNodes().getCount(), NULL, (bArmature *)ob_arm->data);
+			create_bone(&skin, *ri, NULL, (*ri)->getChildNodes().getCount(), NULL, (bArmature *)ob_arm->data);
 
 			if (joint_parent_map.find((*ri)->getUniqueId()) != joint_parent_map.end() && !skin.get_parent())
 				skin.set_parent(joint_parent_map[(*ri)->getUniqueId()]);
@@ -563,24 +469,14 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
 	ED_armature_edit_free(ob_arm);
 	DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB | OB_RECALC_DATA);
 
-	// set_leaf_bone_shapes(ob_arm);
-	// set_euler_rotmode();
 }
 
-
-// root - if this joint is the top joint in hierarchy, if a joint
-// is a child of a node (not joint), root should be true since
-// this is where we build armature bones from
-
 void ArmatureImporter::set_pose(Object *ob_arm,  COLLADAFW::Node *root_node, const char *parentname, float parent_mat[4][4])
 { 
 	char *bone_name = (char *) bc_get_joint_name(root_node);
 	float mat[4][4];
 	float obmat[4][4];
 
-	float ax[3];
-	float angle = 0.0f;
-	
 	// object-space
 	get_node_mat(obmat, root_node, NULL, NULL);
 
@@ -597,14 +493,17 @@ void ArmatureImporter::set_pose(Object *ob_arm,  COLLADAFW::Node *root_node, con
 
 	}
 	else {
+		
 		copy_m4_m4(mat, obmat);
 		float invObmat[4][4];
 		invert_m4_m4(invObmat, ob_arm->obmat);
 		mult_m4_m4m4(pchan->pose_mat, invObmat, mat);
+		
 	}
 
-	mat4_to_axis_angle(ax, &angle, mat);
-	pchan->bone->roll = angle;
+	//float angle = 0.0f;
+	///*mat4_to_axis_angle(ax, &angle, mat);
+	//pchan->bone->roll = angle;*/
 
 
 	COLLADAFW::NodePointerArray& children = root_node->getChildNodes();
@@ -614,6 +513,10 @@ void ArmatureImporter::set_pose(Object *ob_arm,  COLLADAFW::Node *root_node, con
 
 }
 
+
+// root - if this joint is the top joint in hierarchy, if a joint
+// is a child of a node (not joint), root should be true since
+// this is where we build armature bones from
 void ArmatureImporter::add_joint(COLLADAFW::Node *node, bool root, Object *parent, Scene *sce)
 {
 	joint_by_uid[node->getUniqueId()] = node;
@@ -729,13 +632,12 @@ bool ArmatureImporter::write_skin_controller_data(const COLLADAFW::SkinControlle
 bool ArmatureImporter::write_controller(const COLLADAFW::Controller *controller)
 {
 	// - create and store armature object
-
-	const COLLADAFW::UniqueId& skin_id = controller->getUniqueId();
+	const COLLADAFW::UniqueId& con_id = controller->getUniqueId();
 
 	if (controller->getControllerType() == COLLADAFW::Controller::CONTROLLER_TYPE_SKIN) {
 		COLLADAFW::SkinController *co = (COLLADAFW::SkinController *)controller;
 		// to be able to find geom id by controller id
-		geom_uid_by_controller_uid[skin_id] = co->getSource();
+		geom_uid_by_controller_uid[con_id] = co->getSource();
 
 		const COLLADAFW::UniqueId& data_uid = co->getSkinControllerData();
 		if (skin_by_data_uid.find(data_uid) == skin_by_data_uid.end()) {
@@ -746,14 +648,71 @@ bool ArmatureImporter::write_controller(const COLLADAFW::Controller *controller)
 		skin_by_data_uid[data_uid].set_controller(co);
 	}
 	// morph controller
-	else {
-		// shape keys? :)
-		fprintf(stderr, "Morph controller is not supported yet.\n");
+	else if (controller->getControllerType() == COLLADAFW::Controller::CONTROLLER_TYPE_MORPH) {
+		COLLADAFW::MorphController *co = (COLLADAFW::MorphController *)controller;
+		// to be able to find geom id by controller id
+		geom_uid_by_controller_uid[con_id] = co->getSource();
+		//Shape keys are applied in DocumentImporter->finish()
+		morph_controllers.push_back(co);
 	}
 
 	return true;
 }
 
+void ArmatureImporter::make_shape_keys()
+{
+	std::vector<COLLADAFW::MorphController *>::iterator mc;
+	float weight;
+
+	for (mc = morph_controllers.begin(); mc != morph_controllers.end(); mc++) {
+		//Controller data
+		COLLADAFW::UniqueIdArray& morphTargetIds = (*mc)->getMorphTargets();
+		COLLADAFW::FloatOrDoubleArray& morphWeights = (*mc)->getMorphWeights();
+
+		//Prereq: all the geometries must be imported and mesh objects must be made
+		Object *source_ob = this->mesh_importer->get_object_by_geom_uid((*mc)->getSource());
+		
+		if (source_ob) {
+
+			Mesh *source_me = (Mesh*) source_ob->data;
+			//insert key to source mesh
+			Key *key = source_me->key = BKE_key_add((ID *)source_me);
+			key->type = KEY_RELATIVE;
+			KeyBlock *kb;
+			
+			//insert basis key
+			kb = BKE_keyblock_add_ctime(key, "Basis", FALSE);
+			BKE_key_convert_from_mesh(source_me, kb);
+
+			//insert other shape keys
+			for (int i = 0 ; i < morphTargetIds.getCount() ; i++ ) {
+				//better to have a seperate map of morph objects, 
+				//This'll do for now since only mesh morphing is imported
+
+				Mesh *me = this->mesh_importer->get_mesh_by_geom_uid(morphTargetIds[i]);
+				
+				if (me) {
+					me->key = key;
+					std::string morph_name = *this->mesh_importer->get_geometry_name(me->id.name);
+
+					kb = BKE_keyblock_add_ctime(key, morph_name.c_str(), FALSE);
+					BKE_key_convert_from_mesh(me, kb);
+					
+					//apply weights
+					weight =  morphWeights.getFloatValues()->getData()[i];
+					kb->curval = weight;
+				}
+				else {
+					fprintf(stderr, "Morph target geometry not found.\n");
+				}
+			}
+		}
+		else {
+			fprintf(stderr, "Morph target object not found.\n");
+		}
+	}
+}
+
 
 COLLADAFW::UniqueId *ArmatureImporter::get_geometry_uid(const COLLADAFW::UniqueId& controller_uid)
 {
diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h
index bb710f0..b07edfb 100644
--- a/source/blender/collada/ArmatureImporter.h
+++ b/source/blender/collada/ArmatureImporter.h
@@ -29,13 +29,16 @@
 
 #include "COLLADAFWNode.h"
 #include "COLLADAFWUniqueId.h"
+#include "COLLADAFWMorphController.h"
 
 extern "C" {
 #include "BKE_context.h"
+#include "BKE_key.h"
 
 #include "DNA_armature_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_key_types.h"
 
 #include "ED_armature.h"
 }
@@ -88,6 +91,7 @@ private:
 	std::map<COLLADAFW::UniqueId, COLLADAFW::Node*> joint_by_uid; // contains all joints
 	std::vector<COLLADAFW::Node*> root_joints;
 	std::vector<COLLADAFW::Node*> finished_joints;
+	std::vector<COLLADAFW::MorphController*> morph_controllers;
 	std::map<COLLADAFW::UniqueId, Object*> joint_parent_map;
 	std::map<COLLADAFW::UniqueId, Object*> unskinned_armature_map;
 
@@ -103,12 +107,9 @@ private:
 	JointData *get_joint_data(COLLADAFW::Node *node);
 #endif
 
-	void create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBone *parent, int totchild,
+	void create_bone(SkinInfo* skin, COLLADAFW::Node *node, EditBone *parent, int totchild,
 	                 float parent_mat[4][4], bArmature *arm);
 
-	void create_unskinned_bone(COLLADAFW::Node *node, EditBone *parent, int totchild,
-	                           float parent_mat[4][4], Object * ob_arm);
-
 	void add_leaf_bone(float mat[4][4], EditBone *bone, COLLADAFW::Node * node);
 
 	void fix_leaf_bones();
@@ -140,9 +141,6 @@ public:
 	ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, AnimationImporterBase *anim, Scene *sce);
 	~ArmatureImporter();
 
-	// root - if this joint is the top joint in hierarchy, if a joint
-	// is a child of a node (not joint), root should be true since
-	// this is where we build armature bones from
 	void add_joint(COLLADAFW::Node *node, bool root, Object *parent, Scene *sce);
 
 #if 0
@@ -152,6 +150,8 @@ public:
 	// here we add bones to armatures, having armatures previously created in write_controller
 	void make_armatures(bContext *C);
 
+	void make_shape_keys();
+
 #if 0
 	// link with meshes, create vertex groups, assign weights
 	void link_armature(Object *ob_arm, const COLLADAFW::UniqueId& geom_id, const COLLADAFW::UniqueId& controller_data_id);
diff --git a/source/blender/collada/CMakeLists.txt b/source/blender/collada/CMakeLists.txt
index 0091df3..326ca2b 100644
--- a/source/blender/collada/CMakeLists.txt
+++ b/source/blender/collada/CMakeLists.txt
@@ -36,6 +36,9 @@ set(INC
 	../windowmanager
 	../imbuf
 	../../../intern/guardedalloc
+	../ikplugin
+	../../../intern/iksolver/extern
+	
 )
 
 set(INC_SYS
@@ -48,11 +51,13 @@ set(SRC
 	ArmatureExporter.cpp
 	ArmatureImporter.cpp
 	CameraExporter.cpp
+	ControllerExporter.cpp
 	DocumentExporter.cpp
 	DocumentImporter.cpp
 	EffectExporter.cpp
 	ErrorHandler.cpp
 	ExportSettings.cpp
+	ImportSettings.cpp
 	ExtraHandler.cpp
 	ExtraTags.cpp
 	GeometryExporter.cpp
@@ -74,11 +79,13 @@ set(SRC
 	ArmatureExporter.h
 	ArmatureImporter.h
 	CameraExporter.h
+	ControllerExporter.h
 	DocumentExporter.h
 	DocumentImporter.h
 	EffectExporter.h
 	ErrorHandler.h
 	ExportSettings.h
+	ImportSettings.h
 	ExtraHandler.h
 	ExtraTags.h
 	GeometryExporter.h
diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp
index 7d438f7..fc56ff8 100644
--- a/source/blender/collada/CameraExporter.cpp
+++ b/source/blender/collada/CameraExporter.cpp
@@ -70,7 +70,8 @@ void CamerasExporter::operator()(Object *ob, Scene *sce)
 
 	switch (cam->type) {
 		case CAM_PANO:
-		case CAM_PERSP: {
+		case CAM_PERSP:
+		{
 			COLLADASW::PerspectiveOptic persp(mSW);
 			persp.setXFov(RAD2DEGF(focallength_to_fov(cam->lens, cam->sensor_x)), "xfov");
 			persp.setAspectRatio((float)(sce->r.xsch) / (float)(sce->r.ysch), false, "aspect_ratio");
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp
new file mode 100644
index 0000000..41693d4
--- /dev/null
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -0,0 +1,604 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Jan Diederich, Tod Liverseed,
+ *                 Nathan Letwory, Sukhitha Jayathilake
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/collada/ControllerExporter.cpp
+ *  \ingroup collada
+ */
+
+#include "COLLADASWBaseInputElement.h"
+#include "COLLADASWInstanceController.h"
+#include "COLLADASWPrimitves.h"
+#include "COLLADASWSource.h"
+
+#include "DNA_action_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
+
+#include "BKE_action.h"
+#include "BKE_armature.h"
+
+extern "C" {
+#include "BKE_main.h"
+#include "BKE_mesh.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+}
+
+#include "ED_armature.h"
+
+#include "BLI_listbase.h"
+
+#include "GeometryExporter.h"
+#include "ArmatureExporter.h"
+#include "ControllerExporter.h"
+#include "SceneExporter.h"
+
+#include "collada_utils.h"
+
+// XXX exporter writes wrong data for shared armatures.  A separate
+// controller should be written for each armature-mesh binding how do
+// we make controller ids then?
+ControllerExporter::ControllerExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) : COLLADASW::LibraryControllers(sw), export_settings(export_settings) {
+}
+
+bool ControllerExporter::is_skinned_mesh(Object *ob)
+{
+	return bc_get_assigned_armature(ob) != NULL;
+}
+
+
+void ControllerExporter::write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone)
+{
+	if (bc_is_root_bone(bone, this->export_settings->deform_bones_only))
+		ins.addSkeleton(COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_joint_id(bone, ob_arm)));
+	else {
+		for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
+			write_bone_URLs(ins, ob_arm, child);
+		}
+	}
+}
+
+bool ControllerExporter::add_instance_controller(Object *ob)
+{
+	Object *ob_arm = bc_get_assigned_armature(ob);
+	bArmature *arm = (bArmature *)ob_arm->data;
+
+	const std::string& controller_id = get_controller_id(ob_arm, ob);
+
+	COLLADASW::InstanceController ins(mSW);
+	ins.setUrl(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, controller_id));
+
+	Mesh *me = (Mesh *)ob->data;
+	if (!me->dvert) return false;
+
+	// write root bone URLs
+	Bone *bone;
+	for (bone = (Bone *)arm->bonebase.first; bone; bone = bone->next) {
+		write_bone_URLs(ins, ob_arm, bone);
+	}
+
+	InstanceWriter::add_material_bindings(ins.getBindMaterial(), ob, this->export_settings->active_uv_only);
+		
+	ins.add();
+	return true;
+}
+
+void ControllerExporter::export_controllers(Scene *sce)
+{
+	scene = sce;
+
+	openLibrary();
+
+	GeometryFunctor gf;
+	gf.forEachMeshObjectInExportSet<ControllerExporter>(sce, *this, this->export_settings->export_set);
+
+	closeLibrary();
+}
+
+void ControllerExporter::operator()(Object *ob)
+{
+	Object *ob_arm = bc_get_assigned_armature(ob);
+	Key *key = BKE_key_from_object(ob);
+
+	if (ob_arm) {
+		export_skin_controller(ob, ob_arm);
+	}
+	if (key) {
+		export_morph_controller(ob, key);
+	}
+}
+#if 0
+
+bool ArmatureExporter::already_written(Object *ob_arm)
+{
+	return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) != written_armatures.end();
+}
+
+void ArmatureExporter::wrote(Object *ob_arm)
+{
+	written_armatures.push_back(ob_arm);
+}
+
+void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce)
+{
+	objects.clear();
+
+	Base *base = (Base *) sce->base.first;
+	while (base) {
+		Object *ob = base->object;
+		
+		if (ob->type == OB_MESH && get_assigned_armature(ob) == ob_arm) {
+			objects.push_back(ob);
+		}
+
+		base = base->next;
+	}
+}
+#endif
+
+std::string ControllerExporter::get_joint_sid(Bone *bone, Object *ob_arm)
+{
+	return get_joint_id(bone, ob_arm);
+}
+
+std::string ControllerExporter::get_controller_id(Object *ob_arm, Object *ob)
+{
+	return translate_id(id_name(ob_arm)) + "_" + translate_id(id_name(ob)) + SKIN_CONTROLLER_ID_SUFFIX;
+}
+
+std::string ControllerExporter::get_controller_id(Key *key, Object *ob)
+{
+	return translate_id(id_name(ob)) + MORPH_CONTROLLER_ID_SUFFIX;
+}
+
+// ob should be of type OB_MESH
+// both args are required
+void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm)
+{
+	// joint names
+	// joint inverse bind matrices
+	// vertex weights
+
+	// input:
+	// joint names: ob -> vertex group names
+	// vertex group weights: me->dvert -> groups -> index, weight
+
+#if 0
+	me->dvert :
+
+	typedef struct MDeformVert {
+		struct MDeformWeight *dw;
+		int totweight;
+		int flag;   // flag only in use for weightpaint now
+	} MDeformVert;
+
+	typedef struct MDeformWeight {
+		int def_nr;
+		float weight;
+	} MDeformWeight;
+#endif
+
+	bool use_instantiation = this->export_settings->use_object_instantiation;
+	Mesh *me;
+
+	if (this->export_settings->apply_modifiers) 
+		me = bc_to_mesh_apply_modifiers(scene, ob, this->export_settings->export_mesh_type);
+	else 
+		me = (Mesh *)ob->data;
+	
+	BKE_mesh_tessface_ensure(me);
+
+	if (!me->dvert) return;
+
+	std::string controller_name = id_name(ob_arm);
+	std::string controller_id = get_controller_id(ob_arm, ob);
+
+	openSkin(controller_id, controller_name,
+	         COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob, use_instantiation)));
+
+	add_bind_shape_mat(ob);
+
+	std::string joints_source_id = add_joints_source(ob_arm, &ob->defbase, controller_id);
+	std::string inv_bind_mat_source_id = add_inv_bind_mats_source(ob_arm, &ob->defbase, controller_id);
+
+	std::list<int> vcounts;
+	std::list<int> joints;
+	std::list<float> weights;
+
+	{
+		int i, j;
+
+		// def group index -> joint index
+		std::vector<int> joint_index_by_def_index;
+		bDeformGroup *def;
+
+		for (def = (bDeformGroup *)ob->defbase.first, i = 0, j = 0; def; def = def->next, i++) {
+			if (is_bone_defgroup(ob_arm, def))
+				joint_index_by_def_index.push_back(j++);
+			else
+				joint_index_by_def_index.push_back(-1);
+		}
+
+		for (i = 0; i < me->totvert; i++) {
+			MDeformVert *vert = &me->dvert[i];
+			std::map<int, float> jw;
+
+			// We're normalizing the weights later
+			float sumw = 0.0f;
+
+			for (j = 0; j < vert->totweight; j++) {
+				int idx = vert->dw[j].def_nr;
+				if (idx >= 0) {
+					int joint_index = joint_index_by_def_index[idx];
+					if (joint_index != -1 && vert->dw[j].weight > 0.0f) {
+						jw[joint_index] += vert->dw[j].weight;
+						sumw += vert->dw[j].weight;
+					}
+				}
+			}
+
+			if (sumw > 0.0f) {
+				float invsumw = 1.0f / sumw;
+				vcounts.push_back(jw.size());
+				for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m) {
+					joints.push_back((*m).first);
+					weights.push_back(invsumw * (*m).second);
+				}
+			}
+			else {
+				vcounts.push_back(0);
+#if 0
+				vcounts.push_back(1);
+				joints.push_back(-1);
+				weights.push_back(1.0f);
+#endif
+			}
+		}
+	}
+
+	std::string weights_source_id = add_weights_source(me, controller_id, weights);
+	add_joints_element(&ob->defbase, joints_source_id, inv_bind_mat_source_id);
+	add_vertex_weights_element(weights_source_id, joints_source_id, vcounts, joints);
+
+	if (this->export_settings->apply_modifiers)
+	{
+		BKE_libblock_free_us(&(G.main->mesh), me);
+	}
+	closeSkin();
+	closeController();
+}
+
+void ControllerExporter::export_morph_controller(Object *ob, Key *key)
+{
+	bool use_instantiation = this->export_settings->use_object_instantiation;
+	Mesh *me;
+
+	if (this->export_settings->apply_modifiers) {
+		me = bc_to_mesh_apply_modifiers(scene, ob, this->export_settings->export_mesh_type);
+	} 
+	else {
+		me = (Mesh *)ob->data;
+	}
+	BKE_mesh_tessface_ensure(me);
+
+	std::string controller_name = id_name(ob) + "-morph";
+	std::string controller_id = get_controller_id(key, ob);
+
+	openMorph(controller_id, controller_name,
+	         COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob, use_instantiation)));
+
+	std::string targets_id = add_morph_targets(key, ob);
+	std::string morph_weights_id = add_morph_weights(key, ob);
+	
+	COLLADASW::TargetsElement targets(mSW);
+
+	COLLADASW::InputList &input = targets.getInputList();
+
+	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::MORPH_TARGET, // constant declared in COLLADASWInputList.h
+	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, targets_id)));
+	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::MORPH_WEIGHT,
+	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, morph_weights_id)));
+	targets.add();
+
+	if (this->export_settings->apply_modifiers)
+	{
+		BKE_libblock_free_us(&(G.main->mesh), me);
+	}
+
+	//support for animations
+	//can also try the base element and param alternative
+	add_weight_extras(key);
+	closeMorph();
+	closeController();
+}
+
+std::string ControllerExporter::add_morph_targets(Key *key, Object *ob)
+{
+	std::string source_id = translate_id(id_name(ob)) + TARGETS_SOURCE_ID_SUFFIX;
+
+	COLLADASW::IdRefSource source(mSW);
+	source.setId(source_id);
+	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
+	source.setAccessorCount(key->totkey - 1);
+	source.setAccessorStride(1);
+
+	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
+	param.push_back("IDREF");
+
+	source.prepareToAppendValues();
+
+	KeyBlock * kb = (KeyBlock*)key->block.first;
+	//skip the basis
+	kb = kb->next;
+	for (; kb; kb = kb->next) {
+		std::string geom_id = get_geometry_id(ob, false) + "_morph_" + translate_id(kb->name);
+		source.appendValues(geom_id);
+
+	}
+
+	source.finish();
+
+	return source_id;
+}
+
+std::string ControllerExporter::add_morph_weights(Key *key, Object *ob)
+{
+	std::string source_id = translate_id(id_name(ob)) + WEIGHTS_SOURCE_ID_SUFFIX;
+
+	COLLADASW::FloatSourceF source(mSW);
+	source.setId(source_id);
+	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
+	source.setAccessorCount(key->totkey - 1);
+	source.setAccessorStride(1);
+
+	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
+	param.push_back("MORPH_WEIGHT");
+	
+	source.prepareToAppendValues();
+
+	KeyBlock * kb = (KeyBlock*)key->block.first;
+	//skip the basis
+	kb = kb->next;
+	for (; kb; kb = kb->next) {
+		float weight = kb->curval;
+		source.appendValues(weight);
+	}
+	source.finish();
+
+	return source_id;
+}
+
+//Added to implemente support for animations.
+void ControllerExporter::add_weight_extras(Key *key)
+{
+	// can also try the base element and param alternative
+	COLLADASW::BaseExtraTechnique extra;
+	
+	KeyBlock * kb = (KeyBlock*)key->block.first;
+	//skip the basis
+	kb = kb->next;
+	for (; kb; kb = kb->next) {
+		// XXX why is the weight not used here and set to 0.0?
+		float weight = kb->curval;
+		extra.addExtraTechniqueParameter ("KHR", "morph_weights" , 0.000, "MORPH_WEIGHT_TO_TARGET");
+	}
+}
+
+
+
+void ControllerExporter::add_joints_element(ListBase *defbase,
+                                          const std::string& joints_source_id, const std::string& inv_bind_mat_source_id)
+{
+	COLLADASW::JointsElement joints(mSW);
+	COLLADASW::InputList &input = joints.getInputList();
+
+	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::JOINT, // constant declared in COLLADASWInputList.h
+	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id)));
+	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::BINDMATRIX,
+	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, inv_bind_mat_source_id)));
+	joints.add();
+}
+
+void ControllerExporter::add_bind_shape_mat(Object *ob)
+{
+	double bind_mat[4][4];
+
+	converter.mat4_to_dae_double(bind_mat, ob->obmat);
+
+	addBindShapeTransform(bind_mat);
+}
+
+std::string ControllerExporter::add_joints_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id)
+{
+	std::string source_id = controller_id + JOINTS_SOURCE_ID_SUFFIX;
+
+	int totjoint = 0;
+	bDeformGroup *def;
+	for (def = (bDeformGroup *)defbase->first; def; def = def->next) {
+		if (is_bone_defgroup(ob_arm, def))
+			totjoint++;
+	}
+
+	COLLADASW::NameSource source(mSW);
+	source.setId(source_id);
+	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
+	source.setAccessorCount(totjoint);
+	source.setAccessorStride(1);
+	
+	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
+	param.push_back("JOINT");
+
+	source.prepareToAppendValues();
+
+	for (def = (bDeformGroup *)defbase->first; def; def = def->next) {
+		Bone *bone = get_bone_from_defgroup(ob_arm, def);
+		if (bone)
+			source.appendValues(get_joint_sid(bone, ob_arm));
+	}
+
+	source.finish();
+
+	return source_id;
+}
+
+std::string ControllerExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id)
+{
+	std::string source_id = controller_id + BIND_POSES_SOURCE_ID_SUFFIX;
+
+	int totjoint = 0;
+	for (bDeformGroup *def = (bDeformGroup *)defbase->first; def; def = def->next) {
+		if (is_bone_defgroup(ob_arm, def))
+			totjoint++;
+	}
+
+	COLLADASW::FloatSourceF source(mSW);
+	source.setId(source_id);
+	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
+	source.setAccessorCount(totjoint); //BLI_countlist(defbase));
+	source.setAccessorStride(16);
+	
+	source.setParameterTypeName(&COLLADASW::CSWC::CSW_VALUE_TYPE_FLOAT4x4);
+	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
+	param.push_back("TRANSFORM");
+
+	source.prepareToAppendValues();
+
+	bPose *pose = ob_arm->pose;
+	bArmature *arm = (bArmature *)ob_arm->data;
+
+	int flag = arm->flag;
+
+	// put armature in rest position
+	if (!(arm->flag & ARM_RESTPOS)) {
+		arm->flag |= ARM_RESTPOS;
+		BKE_pose_where_is(scene, ob_arm);
+	}
+
+	for (bDeformGroup *def = (bDeformGroup *)defbase->first; def; def = def->next) {
+		if (is_bone_defgroup(ob_arm, def)) {
+			bPoseChannel *pchan = BKE_pose_channel_find_name(pose, def->name);
+
+			float mat[4][4];
+			float world[4][4];
+			float inv_bind_mat[4][4];
+
+			// SECOND_LIFE_COMPATIBILITY
+			if (export_settings->second_life) {
+				// Only translations, no rotation vs armature
+				float temp[4][4];
+				unit_m4(temp);
+				copy_v3_v3(temp[3], pchan->bone->arm_mat[3]);
+				mult_m4_m4m4(world, ob_arm->obmat, temp);
+			}
+			else {
+				// make world-space matrix, arm_mat is armature-space
+				mult_m4_m4m4(world, ob_arm->obmat, pchan->bone->arm_mat);
+			}
+
+			invert_m4_m4(mat, world);
+			converter.mat4_to_dae(inv_bind_mat, mat);
+
+			source.appendValues(inv_bind_mat);
+		}
+	}
+
+	// back from rest positon
+	if (!(flag & ARM_RESTPOS)) {
+		arm->flag = flag;
+		BKE_pose_where_is(scene, ob_arm);
+	}
+
+	source.finish();
+
+	return source_id;
+}
+
+Bone *ControllerExporter::get_bone_from_defgroup(Object *ob_arm, bDeformGroup *def)
+{
+	bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, def->name);
+	return pchan ? pchan->bone : NULL;
+}
+
+bool ControllerExporter::is_bone_defgroup(Object *ob_arm, bDeformGroup *def)
+{
+	return get_bone_from_defgroup(ob_arm, def) != NULL;
+}
+
+std::string ControllerExporter::add_weights_source(Mesh *me, const std::string& controller_id, const std::list<float>& weights)
+{
+	std::string source_id = controller_id + WEIGHTS_SOURCE_ID_SUFFIX;
+
+	COLLADASW::FloatSourceF source(mSW);
+	source.setId(source_id);
+	source.setArrayId(source_id + ARRAY_ID_SUFFIX);
+	source.setAccessorCount(weights.size());
+	source.setAccessorStride(1);
+	
+	COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
+	param.push_back("WEIGHT");
+
+	source.prepareToAppendValues();
+
+	for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
+		source.appendValues(*i);
+	}
+
+	source.finish();
+
+	return source_id;
+}
+
+void ControllerExporter::add_vertex_weights_element(const std::string& weights_source_id, const std::string& joints_source_id,
+                                                  const std::list<int>& vcounts,
+                                                  const std::list<int>& joints)
+{
+	COLLADASW::VertexWeightsElement weightselem(mSW);
+	COLLADASW::InputList &input = weightselem.getInputList();
+
+	int offset = 0;
+	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::JOINT, // constant declared in COLLADASWInputList.h
+	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id), offset++));
+	input.push_back(COLLADASW::Input(COLLADASW::InputSemantic::WEIGHT,
+	                                 COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, weights_source_id), offset++));
+
+	weightselem.setCount(vcounts.size());
+
+	// write number of deformers per vertex
+	COLLADASW::PrimitivesBase::VCountList vcountlist;
+
+	vcountlist.resize(vcounts.size());
+	std::copy(vcounts.begin(), vcounts.end(), vcountlist.begin());
+
+	weightselem.prepareToAppendVCountValues();
+	weightselem.appendVertexCount(vcountlist);
+
+	weightselem.CloseVCountAndOpenVElement();
+
+	// write deformer index - weight index pairs
+	int weight_index = 0;
+	for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i) {
+		weightselem.appendValues(*i, weight_index++);
+	}
+
+	weightselem.finish();
+}
diff --git a/source/blender/collada/ControllerExporter.h b/source/blender/collada/ControllerExporter.h
new file mode 100644
index 0000000..0be5118
--- /dev/null
+++ b/source/blender/collada/ControllerExporter.h
@@ -0,0 +1,127 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Jan Diederich, Tod Liverseed,
+ *                 Nathan Letwory, Sukhitha Jayathilake
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file ControllerExporter.h
+ *  \ingroup collada
+ */
+
+#ifndef __CONTROLLEREXPORTER_H__
+#define __CONTROLLEREXPORTER_H__
+
+#include <list>
+#include <string>
+//#include <vector>
+
+#include "COLLADASWStreamWriter.h"
+#include "COLLADASWLibraryControllers.h"
+#include "COLLADASWInstanceController.h"
+#include "COLLADASWInputList.h"
+#include "COLLADASWNode.h"
+#include "COLLADASWExtraTechnique.h"
+
+#include "DNA_armature_types.h"
+#include "DNA_listBase.h"
+#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
+#include "DNA_constraint_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_key_types.h"
+
+#include "TransformWriter.h"
+#include "InstanceWriter.h"
+
+#include "ExportSettings.h"
+
+#include "BKE_key.h"
+
+class SceneExporter;
+
+class ControllerExporter : public COLLADASW::LibraryControllers, protected TransformWriter, protected InstanceWriter
+{
+public:
+	ControllerExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings);
+
+	bool is_skinned_mesh(Object *ob);
+
+	bool add_instance_controller(Object *ob);
+
+	void export_controllers(Scene *sce);
+
+	void operator()(Object *ob);
+
+private:
+	Scene *scene;
+	UnitConverter converter;
+	const ExportSettings *export_settings;
+
+#if 0
+	std::vector<Object *> written_armatures;
+
+	bool already_written(Object *ob_arm);
+
+	void wrote(Object *ob_arm);
+
+	void find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce);
+#endif
+
+	std::string get_joint_sid(Bone *bone, Object *ob_arm);
+
+	std::string get_controller_id(Object *ob_arm, Object *ob);
+
+	std::string get_controller_id(Key *key, Object *ob);
+
+	// ob should be of type OB_MESH
+	// both args are required
+	void export_skin_controller(Object *ob, Object *ob_arm);
+
+	void export_morph_controller(Object *ob, Key *key);
+
+	void add_joints_element(ListBase *defbase,
+	                        const std::string& joints_source_id, const std::string& inv_bind_mat_source_id);
+
+	void add_bind_shape_mat(Object *ob);
+
+	std::string add_morph_targets(Key *key, Object *ob);
+
+	std::string add_morph_weights(Key *key, Object *ob);
+
+	void add_weight_extras(Key *key);
+
+	std::string add_joints_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id);
+
+	std::string add_inv_bind_mats_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id);
+
+	Bone *get_bone_from_defgroup(Object *ob_arm, bDeformGroup *def);
+
+	bool is_bone_defgroup(Object *ob_arm, bDeformGroup *def);
+
+	std::string add_weights_source(Mesh *me, const std::string& controller_id,
+	                               const std::list<float>& weights);
+
+	void add_vertex_weights_element(const std::string& weights_source_id, const std::string& joints_source_id,
+	                                const std::list<int>& vcount, const std::list<int>& joints);
+
+	void write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone);
+};
+
+#endif
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp
index c491326..71909b3 100644
--- a/source/blender/collada/DocumentExporter.cpp
+++ b/source/blender/collada/DocumentExporter.cpp
@@ -123,6 +123,7 @@ extern bool bc_has_object_type(LinkNode *export_set, short obtype);
 #include "ArmatureExporter.h"
 #include "AnimationExporter.h"
 #include "CameraExporter.h"
+#include "ControllerExporter.h"
 #include "EffectExporter.h"
 #include "GeometryExporter.h"
 #include "ImageExporter.h"
@@ -269,11 +270,15 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
 
 	// <library_controllers>
 	ArmatureExporter arm_exporter(&sw, this->export_settings);
-	if (bc_has_object_type(export_set, OB_ARMATURE)) {
-		arm_exporter.export_controllers(sce);
-	}
+	ControllerExporter controller_exporter(&sw , this->export_settings);
+	//for Morph controller export, removing the check
+	/*if (bc_has_object_type(export_set, OB_ARMATURE)) 
+	{*/
+	controller_exporter.export_controllers(sce);
+	//}
 
 	// <library_visual_scenes>
+
 	SceneExporter se(&sw, &arm_exporter, this->export_settings);
 	se.exportScene(sce);
 	
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index b7797b5..17a1c7f 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -54,6 +54,7 @@ extern "C" {
 #include "BLI_math.h"
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
+#include "BLI_fileops.h"
 
 #include "BKE_camera.h"
 #include "BKE_main.h"
@@ -76,6 +77,9 @@ extern "C" {
 
 #include "MEM_guardedalloc.h"
 
+#include "WM_api.h"
+#include "WM_types.h"
+
 }
 
 #include "ExtraHandler.h"
@@ -96,9 +100,9 @@ extern "C" {
 // creates empties for each imported bone on layer 2, for debugging
 // #define ARMATURE_TEST
 
-DocumentImporter::DocumentImporter(bContext *C, const char *filename) :
+DocumentImporter::DocumentImporter(bContext *C, const ImportSettings *import_settings) :
+	import_settings(import_settings),
 	mImportStage(General),
-	mFilename(filename),
 	mContext(C),
 	armature_importer(&unit_converter, &mesh_importer, &anim_importer, CTX_data_scene(C)),
 	mesh_importer(&unit_converter, &armature_importer, CTX_data_scene(C)),
@@ -128,7 +132,9 @@ bool DocumentImporter::import()
 	// deselect all to select new objects
 	BKE_scene_base_deselect_all(CTX_data_scene(mContext));
 
-	if (!root.loadDocument(mFilename)) {
+	std::string mFilename = std::string(this->import_settings->filepath);
+	const std::string encodedFilename = bc_url_encode(mFilename);
+	if (!root.loadDocument(encodedFilename)) {
 		fprintf(stderr, "COLLADAFW::Root::loadDocument() returned false on 1st pass\n");
 		return false;
 	}
@@ -143,7 +149,7 @@ bool DocumentImporter::import()
 	COLLADASaxFWL::Loader loader2;
 	COLLADAFW::Root root2(&loader2, this);
 	
-	if (!root2.loadDocument(mFilename)) {
+	if (!root2.loadDocument(encodedFilename)) {
 		fprintf(stderr, "COLLADAFW::Root::loadDocument() returned false on 2nd pass\n");
 		return false;
 	}
@@ -174,46 +180,70 @@ void DocumentImporter::finish()
 {
 	if (mImportStage != General)
 		return;
-		
+
+	Main *bmain = CTX_data_main(mContext);
+	// TODO: create a new scene except the selected <visual_scene> - use current blender scene for it
+	Scene *sce = CTX_data_scene(mContext);
+
 	/** TODO Break up and put into 2-pass parsing of DAE */
 	std::vector<const COLLADAFW::VisualScene *>::iterator it;
 	for (it = vscenes.begin(); it != vscenes.end(); it++) {
 		PointerRNA sceneptr, unit_settings;
 		PropertyRNA *system, *scale;
-		// TODO: create a new scene except the selected <visual_scene> - use current blender scene for it
-		Scene *sce = CTX_data_scene(mContext);
 		
 		// for scene unit settings: system, scale_length
+
 		RNA_id_pointer_create(&sce->id, &sceneptr);
 		unit_settings = RNA_pointer_get(&sceneptr, "unit_settings");
 		system = RNA_struct_find_property(&unit_settings, "system");
 		scale = RNA_struct_find_property(&unit_settings, "scale_length");
-		
-		switch (unit_converter.isMetricSystem()) {
-			case UnitConverter::Metric:
-				RNA_property_enum_set(&unit_settings, system, USER_UNIT_METRIC);
-				break;
-			case UnitConverter::Imperial:
-				RNA_property_enum_set(&unit_settings, system, USER_UNIT_IMPERIAL);
-				break;
-			default:
-				RNA_property_enum_set(&unit_settings, system, USER_UNIT_NONE);
-				break;
+
+		if (this->import_settings->import_units) {
+			
+			switch (unit_converter.isMetricSystem()) {
+				case UnitConverter::Metric:
+					RNA_property_enum_set(&unit_settings, system, USER_UNIT_METRIC);
+					break;
+				case UnitConverter::Imperial:
+					RNA_property_enum_set(&unit_settings, system, USER_UNIT_IMPERIAL);
+					break;
+				default:
+					RNA_property_enum_set(&unit_settings, system, USER_UNIT_NONE);
+					break;
+			}
+			float unit_factor = unit_converter.getLinearMeter();
+			RNA_property_float_set(&unit_settings, scale, unit_factor);
+			fprintf(stdout, "Collada: Adjusting Blender units to Importset units: %f.\n", unit_factor);
+
 		}
-		RNA_property_float_set(&unit_settings, scale, unit_converter.getLinearMeter());
-		
-		const COLLADAFW::NodePointerArray& roots = (*it)->getRootNodes();
 
+		// Write nodes to scene
+		const COLLADAFW::NodePointerArray& roots = (*it)->getRootNodes();
 		for (unsigned int i = 0; i < roots.getCount(); i++) {
-			write_node(roots[i], NULL, sce, NULL, false);
+			std::vector<Object *> *objects_done;
+			objects_done = write_node(roots[i], NULL, sce, NULL, false);
+			
+			if (!this->import_settings->import_units) {
+				// Match incoming scene with current unit settings
+				bc_match_scale(objects_done, *sce, unit_converter);
+			}
 		}
+
+		// update scene
+		DAG_scene_sort(bmain, sce);
+		DAG_ids_flush_update(bmain, 0);
+		WM_event_add_notifier(mContext, NC_OBJECT | ND_TRANSFORM, NULL);
+
 	}
 
 
-	mesh_importer.optimize_material_assignments();
+	mesh_importer.optimize_material_assignements();
 
 	armature_importer.set_tags_map(this->uid_tags_map);
 	armature_importer.make_armatures(mContext);
+	armature_importer.make_shape_keys();
+	DAG_scene_sort(bmain, sce);
+	DAG_ids_flush_update(bmain, 0);
 
 #if 0
 	armature_importer.fix_animation();
@@ -222,8 +252,9 @@ void DocumentImporter::finish()
 	for (std::vector<const COLLADAFW::VisualScene *>::iterator it = vscenes.begin(); it != vscenes.end(); it++) {
 		const COLLADAFW::NodePointerArray& roots = (*it)->getRootNodes();
 
-		for (unsigned int i = 0; i < roots.getCount(); i++)
+		for (unsigned int i = 0; i < roots.getCount(); i++) {
 			translate_anim_recursive(roots[i], NULL, NULL);
+		}
 	}
 
 	if (libnode_ob.size()) {
@@ -246,8 +277,8 @@ void DocumentImporter::finish()
 		}
 		libnode_ob.clear();
 
-		DAG_scene_sort(CTX_data_main(mContext), sce);
-		DAG_ids_flush_update(CTX_data_main(mContext), 0);
+		DAG_scene_sort(bmain, sce);
+		DAG_ids_flush_update(bmain, 0);
 	}
 }
 
@@ -256,7 +287,7 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW
 {
 
 	// The split in #29246, rootmap must point at actual root when
-	// calculating bones in apply_curves_as_matrix.
+	// calculating bones in apply_curves_as_matrix. - actual root is the root node.
 	// This has to do with inverse bind poses being world space
 	// (the sources for skinned bones' restposes) and the way
 	// non-skinning nodes have their "restpose" recursively calculated.
@@ -265,7 +296,7 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW
 	if (par) { // && par->getType() == COLLADAFW::Node::JOINT) {
 		// par is root if there's no corresp. key in root_map
 		if (root_map.find(par->getUniqueId()) == root_map.end())
-			root_map[node->getUniqueId()] = par;
+			root_map[node->getUniqueId()] = node;
 		else
 			root_map[node->getUniqueId()] = root_map[par->getUniqueId()];
 	}
@@ -282,13 +313,22 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW
 #endif
 	unsigned int i;
 
+
 	//for (i = 0; i < 4; i++)
 	//    ob =
 	anim_importer.translate_Animations(node, root_map, object_map, FW_object_map);
 
-	COLLADAFW::NodePointerArray &children = node->getChildNodes();
-	for (i = 0; i < children.getCount(); i++) {
-		translate_anim_recursive(children[i], node, NULL);
+	if (node->getType() == COLLADAFW::Node::JOINT && par == NULL) {
+		// For Skeletons without root node we have to simulate the
+		// root node here and recursively enter the same function
+		// XXX: maybe this can be made more elegant.
+		translate_anim_recursive(node, node, parob);
+	}
+	else {
+		COLLADAFW::NodePointerArray &children = node->getChildNodes();
+		for (i = 0; i < children.getCount(); i++) {
+			translate_anim_recursive(children[i], node, NULL);
+		}
 	}
 }
 
@@ -376,8 +416,8 @@ Object *DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
 		anim_importer.read_node_transform(source_node, obn);
 	}
 
-	DAG_scene_sort(CTX_data_main(mContext), sce);
-	DAG_ids_flush_update(CTX_data_main(mContext), 0);
+	/*DAG_scene_sort(CTX_data_main(mContext), sce);
+	DAG_ids_flush_update(CTX_data_main(mContext), 0);*/
 
 	COLLADAFW::NodePointerArray &children = source_node->getChildNodes();
 	if (children.getCount()) {
@@ -406,23 +446,50 @@ Object *DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
 	return obn;
 }
 
-void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent_node, Scene *sce, Object *par, bool is_library_node)
+// to create constraints off node <extra> tags. Assumes only constraint data in
+// current <extra> with blender profile.
+void DocumentImporter::create_constraints(ExtraTags *et, Object *ob)
+{
+	if (et && et->isProfile("blender")) {
+		std::string name;
+		short* type = 0;
+		et->setData("type", type);
+		BKE_add_ob_constraint(ob, "Test_con", *type);
+		
+	}
+}
+
+std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent_node, Scene *sce, Object *par, bool is_library_node)
 {
 	Object *ob = NULL;
 	bool is_joint = node->getType() == COLLADAFW::Node::JOINT;
 	bool read_transform = true;
+	std::string id   = node->getOriginalId();
+	std::string name = node->getName();
 
 	std::vector<Object *> *objects_done = new std::vector<Object *>();
 
+	fprintf(stderr,
+			"Writing node id='%s', name='%s'\n",
+			id.c_str(),
+			name.c_str());
+
 	if (is_joint) {
-		if (par) {
-			Object *empty = par;
-			par = bc_add_object(sce, OB_ARMATURE, NULL);
-			bc_set_parent(par, empty->parent, mContext);
-			//remove empty : todo
-			object_map.insert(std::make_pair<COLLADAFW::UniqueId, Object *>(parent_node->getUniqueId(), par));
+		if (parent_node == NULL) {
+			// A Joint on root level is a skeleton without root node.
+			// Here we add the armature "on the fly":
+			par = bc_add_object(sce, OB_ARMATURE, std::string("Armature").c_str());
+			objects_done->push_back(par);
+			object_map.insert(std::make_pair<COLLADAFW::UniqueId, Object *>(node->getUniqueId(), par));
+			node_map[node->getUniqueId()] = node;
 		}
 		armature_importer.add_joint(node, parent_node == NULL || parent_node->getType() != COLLADAFW::Node::JOINT, par, sce);
+
+		if (parent_node == NULL) {
+			// for skeletons without root node all has been done above.
+			// Skeletons with root node are handled further down.
+			return objects_done;
+		}
 	}
 	else {
 		COLLADAFW::InstanceGeometryPointerArray &geom = node->getInstanceGeometries();
@@ -442,13 +509,21 @@ void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent
 		while (geom_done < geom.getCount()) {
 			ob = mesh_importer.create_mesh_object(node, geom[geom_done], false, uid_material_map,
 			                                      material_texture_mapping_map);
-			objects_done->push_back(ob);
+			if (ob == NULL) {
+				fprintf(stderr,
+						"<node id=\"%s\", name=\"%s\" >...contains a reference to an unknown instance_mesh.\n",
+						id.c_str(),
+						name.c_str());
+			}
+			else {
+				objects_done->push_back(ob);
+			}
 			++geom_done;
 		}
 		while (camera_done < camera.getCount()) {
 			ob = create_camera_object(camera[camera_done], sce);
 			if (ob == NULL) {
-				std::string id = node->getOriginalId();
+				std::string id   = node->getOriginalId();
 				std::string name = node->getName();
 				fprintf(stderr, "<node id=\"%s\", name=\"%s\" >...contains a reference to an unknown instance_camera.\n", id.c_str(), name.c_str());
 			}
@@ -487,16 +562,25 @@ void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent
 
 			read_transform = false;
 		}
+
 		// if node is empty - create empty object
 		// XXX empty node may not mean it is empty object, not sure about this
 		if ( (geom_done + camera_done + lamp_done + controller_done + inst_done) < 1) {
-			ob = bc_add_object(sce, OB_EMPTY, NULL);
+			//Check if Object is armature, by checking if immediate child is a JOINT node.
+			if (is_armature(node)) {
+				ob = bc_add_object(sce, OB_ARMATURE, name.c_str());
+			}
+			else {
+				ob = bc_add_object(sce, OB_EMPTY, NULL);
+			}
 			objects_done->push_back(ob);
+
 		}
 		
 		// XXX: if there're multiple instances, only one is stored
 
-		if (!ob) return;
+		if (!ob) return objects_done;
+
 		for (std::vector<Object *>::iterator it = objects_done->begin(); it != objects_done->end(); ++it) {
 			ob = *it;
 			std::string nodename = node->getName().size() ? node->getName() : node->getOriginalId();
@@ -508,6 +592,9 @@ void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent
 				libnode_ob.push_back(ob);
 		}
 
+
+		//create_constraints(et,ob);
+
 	}
 
 	for (std::vector<Object *>::iterator it = objects_done->begin(); it != objects_done->end(); ++it) {
@@ -524,9 +611,19 @@ void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent
 	}
 	// if node has child nodes write them
 	COLLADAFW::NodePointerArray &child_nodes = node->getChildNodes();
+
+	if (objects_done->size() > 0) {
+		ob = *objects_done->begin();
+	}
+	else {
+		ob = NULL;
+	}
+
 	for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
 		write_node(child_nodes[i], node, sce, ob, is_library_node);
 	}
+
+	return objects_done;
 }
 
 /** When this method is called, the writer must write the entire visual scene.
@@ -588,7 +685,7 @@ bool DocumentImporter::writeMaterial(const COLLADAFW::Material *cmat)
 		return true;
 		
 	const std::string& str_mat_id = cmat->getName().size() ? cmat->getName() : cmat->getOriginalId();
-	Material *ma = BKE_material_add((char *)str_mat_id.c_str());
+	Material *ma = BKE_material_add(G.main, (char *)str_mat_id.c_str());
 	
 	this->uid_effect_map[cmat->getInstantiatedEffect()] = ma;
 	this->uid_material_map[cmat->getUniqueId()] = ma;
@@ -612,7 +709,7 @@ MTex *DocumentImporter::create_texture(COLLADAFW::EffectCommon *ef, COLLADAFW::T
 	
 	ma->mtex[i] = add_mtex();
 	ma->mtex[i]->texco = TEXCO_UV;
-	ma->mtex[i]->tex = add_texture("Texture");
+	ma->mtex[i]->tex = add_texture(G.main, "Texture");
 	ma->mtex[i]->tex->type = TEX_IMAGE;
 	ma->mtex[i]->tex->ima = uid_image_map[ima_uid];
 	
@@ -818,8 +915,8 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
 	
 	cam_id = camera->getOriginalId();
 	cam_name = camera->getName();
-	if (cam_name.size()) cam = (Camera *)BKE_camera_add((char *)cam_name.c_str());
-	else cam = (Camera *)BKE_camera_add((char *)cam_id.c_str());
+	if (cam_name.size()) cam = (Camera *)BKE_camera_add(G.main, (char *)cam_name.c_str());
+	else cam = (Camera *)BKE_camera_add(G.main, (char *)cam_id.c_str());
 	
 	if (!cam) {
 		fprintf(stderr, "Cannot create camera.\n");
@@ -931,17 +1028,29 @@ bool DocumentImporter::writeImage(const COLLADAFW::Image *image)
 	if (mImportStage != General)
 		return true;
 		
-	// XXX maybe it is necessary to check if the path is absolute or relative
-	const std::string& filepath = image->getImageURI().toNativePath();
-	const char *filename = (const char *)mFilename.c_str();
+	const std::string& imagepath = image->getImageURI().toNativePath();
+
 	char dir[FILE_MAX];
-	char full_path[FILE_MAX];
-	
-	BLI_split_dir_part(filename, dir, sizeof(dir));
-	BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str());
-	Image *ima = BKE_image_load_exists(full_path);
+	char absolute_path[FILE_MAX];
+	const char *workpath;
+
+	BLI_split_dir_part(this->import_settings->filepath, dir, sizeof(dir));
+	BLI_join_dirfile(absolute_path, sizeof(absolute_path), dir, imagepath.c_str());
+	if (BLI_exists(absolute_path)) {
+		workpath = absolute_path;
+	} 
+	else {
+		// Maybe imagepath was already absolute ?
+		if (!BLI_exists(imagepath.c_str())) {
+			fprintf(stderr, "Image not found: %s.\n", imagepath.c_str() );
+			return true;
+		}
+		workpath = imagepath.c_str();
+	}
+
+	Image *ima = BKE_image_load_exists(workpath);
 	if (!ima) {
-		fprintf(stderr, "Cannot create image.\n");
+		fprintf(stderr, "Cannot create image: %s\n", workpath);
 		return true;
 	}
 	this->uid_image_map[image->getUniqueId()] = ima;
@@ -959,16 +1068,17 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light)
 	Lamp *lamp = NULL;
 	std::string la_id, la_name;
 
-	TagsMap::iterator etit;
+	ExtraTags *et = getExtraTags(light->getUniqueId());
+	/*TagsMap::iterator etit;
 	ExtraTags *et = 0;
 	etit = uid_tags_map.find(light->getUniqueId().toAscii());
 	if (etit != uid_tags_map.end())
-		et = etit->second;
+		et = etit->second;*/
 
 	la_id = light->getOriginalId();
 	la_name = light->getName();
-	if (la_name.size()) lamp = (Lamp *)BKE_lamp_add((char *)la_name.c_str());
-	else lamp = (Lamp *)BKE_lamp_add((char *)la_id.c_str());
+	if (la_name.size()) lamp = (Lamp *)BKE_lamp_add(G.main, (char *)la_name.c_str());
+	else lamp = (Lamp *)BKE_lamp_add(G.main, (char *)la_id.c_str());
 
 	if (!lamp) {
 		fprintf(stderr, "Cannot create lamp.\n");
@@ -1183,3 +1293,18 @@ bool DocumentImporter::addExtraTags(const COLLADAFW::UniqueId &uid, ExtraTags *e
 	return true;
 }
 
+bool DocumentImporter::is_armature(COLLADAFW::Node *node)
+{
+	COLLADAFW::NodePointerArray &child_nodes = node->getChildNodes();
+	for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
+		if (child_nodes[i]->getType() == COLLADAFW::Node::JOINT) {
+			return true;
+		}
+		else {
+			continue;
+		}
+	}
+
+	//no child is JOINT
+	return false;
+}
diff --git a/source/blender/collada/DocumentImporter.h b/source/blender/collada/DocumentImporter.h
index d54b8db..ff0cbd4 100644
--- a/source/blender/collada/DocumentImporter.h
+++ b/source/blender/collada/DocumentImporter.h
@@ -40,11 +40,14 @@
 
 
 #include "BKE_object.h"
+#include "BKE_constraint.h"
 
 #include "TransformReader.h"
 #include "AnimationImporter.h"
 #include "ArmatureImporter.h"
+#include "ControllerExporter.h"
 #include "MeshImporter.h"
+#include "ImportSettings.h"
 
 
 
@@ -61,7 +64,7 @@ public:
 		Controller,		//!< Second pass to collect controller data
 	};
 	/** Constructor */
-	DocumentImporter(bContext *C, const char *filename);
+	DocumentImporter(bContext *C, const ImportSettings *import_settings);
 
 	/** Destructor */
 	~DocumentImporter();
@@ -73,9 +76,11 @@ public:
 	Object* create_camera_object(COLLADAFW::InstanceCamera*, Scene*);
 	Object* create_lamp_object(COLLADAFW::InstanceLight*, Scene*);
 	Object* create_instance_node(Object*, COLLADAFW::Node*, COLLADAFW::Node*, Scene*, bool);
-	void write_node(COLLADAFW::Node*, COLLADAFW::Node*, Scene*, Object*, bool);
+	void create_constraints(ExtraTags *et, Object *ob);
+	std::vector<Object *> *write_node(COLLADAFW::Node*, COLLADAFW::Node*, Scene*, Object*, bool);
 	MTex* create_texture(COLLADAFW::EffectCommon*, COLLADAFW::Texture&, Material*, int, TexIndexTextureArrayMap&);
 	void write_profile_COMMON(COLLADAFW::EffectCommon*, Material*);
+	
 	void translate_anim_recursive(COLLADAFW::Node*, COLLADAFW::Node*, Object*);
 
 	/**
@@ -128,11 +133,15 @@ public:
 	/** Get an extisting ExtraTags for uid */
 	ExtraTags* getExtraTags(const COLLADAFW::UniqueId &uid);
 
+	bool is_armature(COLLADAFW::Node * node);
+
+
+
 private:
+	const ImportSettings *import_settings;
 
 	/** Current import stage we're in. */
 	ImportStage mImportStage;
-	std::string mFilename;
 
 	bContext *mContext;
 
diff --git a/source/blender/collada/ExportSettings.h b/source/blender/collada/ExportSettings.h
index 2504c27..cf45b9b 100644
--- a/source/blender/collada/ExportSettings.h
+++ b/source/blender/collada/ExportSettings.h
@@ -37,6 +37,7 @@ public:
 	bool selected;
 	bool include_children;
 	bool include_armatures;
+	bool include_shapekeys;
 	bool deform_bones_only;
 
 	bool active_uv_only;
diff --git a/source/blender/collada/ExtraHandler.cpp b/source/blender/collada/ExtraHandler.cpp
index df49b4f..bcf7e57 100644
--- a/source/blender/collada/ExtraHandler.cpp
+++ b/source/blender/collada/ExtraHandler.cpp
@@ -74,6 +74,7 @@ bool ExtraHandler::parseElement(
 		if (!et) {
 			et = new ExtraTags(std::string(profileName));
 			dimp->addExtraTags(uniqueId, et);
+
 		}
 		currentExtraTags = et;
 		return true;
diff --git a/source/blender/collada/ExtraHandler.h b/source/blender/collada/ExtraHandler.h
index 900e7b7..aa1ae52 100644
--- a/source/blender/collada/ExtraHandler.h
+++ b/source/blender/collada/ExtraHandler.h
@@ -31,6 +31,7 @@
 
 #include "COLLADASaxFWLIExtraDataCallbackHandler.h"
 #include "COLLADASaxFWLFilePartLoader.h"
+#include "COLLADASWInstanceController.h"
 
 #include "DocumentImporter.h"
 #include "AnimationImporter.h"
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
index f33f0fa..4a6c5b4 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -53,7 +53,8 @@ extern "C" {
 #include "collada_utils.h"
 
 // TODO: optimize UV sets by making indexed list with duplicates removed
-GeometryExporter::GeometryExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) : COLLADASW::LibraryGeometries(sw), export_settings(export_settings) {
+GeometryExporter::GeometryExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) : COLLADASW::LibraryGeometries(sw), export_settings(export_settings)
+{
 }
 
 
@@ -69,9 +70,8 @@ void GeometryExporter::exportGeom(Scene *sce)
 }
 
 void GeometryExporter::operator()(Object *ob)
-{
+{ 
 	// XXX don't use DerivedMesh, Mesh instead?
-
 #if 0		
 	DerivedMesh *dm = mesh_get_derived_final(mScene, ob, CD_MASK_BAREMESH);
 #endif
@@ -155,17 +155,93 @@ void GeometryExporter::operator()(Object *ob)
 
 	closeGeometry();
 
-	if (this->export_settings->apply_modifiers)
-	{
+	if (this->export_settings->apply_modifiers) {
 		BKE_libblock_free_us(&(G.main->mesh), me);
 	}
 
-
+	if (this->export_settings->include_shapekeys) {
+		Key * key = BKE_key_from_object(ob);
+		if (key) {
+			KeyBlock * kb = (KeyBlock*)key->block.first;
+			//skip the basis
+			kb = kb->next;
+			for (; kb; kb = kb->next) {
+				BKE_key_convert_to_mesh(kb, me);
+				export_key_mesh(ob, me, kb);
+			}
+		}
+	}
 #if 0
 	dm->release(dm);
 #endif
 }
 
+void GeometryExporter::export_key_mesh(Object *ob, Mesh *me, KeyBlock *kb)
+{
+	std::string geom_id = get_geometry_id(ob, false) + "_morph_" + translate_id(kb->name);
+	std::vector<Normal> nor;
+	std::vector<Face> norind;
+	
+	if (exportedGeometry.find(geom_id) != exportedGeometry.end())
+	{
+		return;
+	}
+
+	std::string geom_name = kb->name;
+
+	exportedGeometry.insert(geom_id);
+
+	bool has_color = (bool)CustomData_has_layer(&me->fdata, CD_MCOL);
+
+	create_normals(nor, norind, me);
+
+	// openMesh(geoId, geoName, meshId)
+	openMesh(geom_id, geom_name);
+	
+	// writes <source> for vertex coords
+	createVertsSource(geom_id, me);
+	
+	// writes <source> for normal coords
+	createNormalsSource(geom_id, me, nor);
+
+	bool has_uvs = (bool)CustomData_has_layer(&me->fdata, CD_MTFACE);
+	
+	// writes <source> for uv coords if mesh has uv coords
+	if (has_uvs)
+		createTexcoordsSource(geom_id, me);
+
+	if (has_color)
+		createVertexColorSource(geom_id, me);
+
+	// <vertices>
+
+	COLLADASW::Vertices verts(mSW);
+	verts.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::VERTEX));
+	COLLADASW::InputList &input_list = verts.getInputList();
+	COLLADASW::Input input(COLLADASW::InputSemantic::POSITION, getUrlBySemantics(geom_id, COLLADASW::InputSemantic::POSITION));
+	input_list.push_back(input);
+	verts.add();
+
+	//createLooseEdgeList(ob, me, geom_id, norind);
+
+	// XXX slow		
+	if (ob->totcol) {
+		for (int a = 0; a < ob->totcol; a++) {
+			createPolylist(a, has_uvs, has_color, ob, me, geom_id, norind);
+		}
+	}
+	else {
+		createPolylist(0, has_uvs, has_color, ob, me, geom_id, norind);
+	}
+	
+	closeMesh();
+	
+	if (me->flag & ME_TWOSIDED) {
+		mSW->appendTextBlock("<extra><technique profile=\"MAYA\"><double_sided>1</double_sided></technique></extra>");
+	}
+
+	closeGeometry();
+}
 
 void GeometryExporter::createLooseEdgeList(Object *ob,
                                            Mesh   *me,
diff --git a/source/blender/collada/GeometryExporter.h b/source/blender/collada/GeometryExporter.h
index 7161bb7..7cbbf0d 100644
--- a/source/blender/collada/GeometryExporter.h
+++ b/source/blender/collada/GeometryExporter.h
@@ -39,9 +39,12 @@
 #include "DNA_mesh_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_key_types.h"
 
 #include "ExportSettings.h"
 
+#include "BKE_key.h"
+
 extern Object *bc_get_highest_selected_ancestor_or_self(Object *ob);
 
 // TODO: optimize UV sets by making indexed list with duplicates removed
@@ -100,6 +103,8 @@ public:
 	COLLADASW::URI getUrlBySemantics(std::string geom_id, COLLADASW::InputSemantic::Semantics type, std::string other_suffix = "");
 
 	COLLADASW::URI makeUrl(std::string id);
+
+	void export_key_mesh(Object *ob, Mesh *me, KeyBlock *kb);
 	
 	/* int getTriCount(MFace *faces, int totface);*/
 private:
diff --git a/source/blender/collada/ImportSettings.cpp b/source/blender/collada/ImportSettings.cpp
new file mode 100644
index 0000000..7460778
--- /dev/null
+++ b/source/blender/collada/ImportSettings.cpp
@@ -0,0 +1,27 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Gaia Clary.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/collada/ExportSettings.cpp
+ *  \ingroup collada
+ */
+
+#include "ImportSettings.h"
diff --git a/source/blender/collada/ImportSettings.h b/source/blender/collada/ImportSettings.h
new file mode 100644
index 0000000..3f3a9fb
--- /dev/null
+++ b/source/blender/collada/ImportSettings.h
@@ -0,0 +1,39 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Gaia Clary
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file ExportSettings.h
+ *  \ingroup collada
+ */
+
+#ifndef __IMPORTSETTINGS_H__
+#define __IMPORTSETTINGS_H__
+
+#include "collada.h"
+
+struct ImportSettings {
+public:
+	bool import_units;
+
+	char *filepath;
+};
+
+#endif
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 8256618..26915f3 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -63,10 +63,9 @@ extern "C" {
 
 // get node name, or fall back to original id if not present (name is optional)
 template<class T>
-static const char *bc_get_dae_name(T *node)
+static const std::string bc_get_dae_name(T *node)
 {
-	const std::string& name = node->getName();
-	return name.size() ? name.c_str() : node->getOriginalId().c_str();
+	return node->getName().size() ? node->getName(): node->getOriginalId();
 }
 
 static const char *bc_primTypeToStr(COLLADAFW::MeshPrimitive::PrimitiveType type)
@@ -268,7 +267,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)  // checks if mesh has su
 {
 	COLLADAFW::MeshPrimitiveArray& prim_arr = mesh->getMeshPrimitives();
 
-	const char *name = bc_get_dae_name(mesh);
+	const std::string &name = bc_get_dae_name(mesh);
 	
 	for (unsigned i = 0; i < prim_arr.getCount(); i++) {
 		
@@ -287,7 +286,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)  // checks if mesh has su
 				int count = vca[j];
 				if (count < 3) {
 					fprintf(stderr, "Primitive %s in %s has at least one face with vertex count < 3\n",
-					        type_str, name);
+					        type_str, name.c_str());
 					return false;
 				}
 			}
@@ -305,7 +304,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)  // checks if mesh has su
 	}
 	
 	if (mesh->getPositions().empty()) {
-		fprintf(stderr, "Mesh %s has no vertices.\n", name);
+		fprintf(stderr, "Mesh %s has no vertices.\n", name.c_str());
 		return false;
 	}
 
@@ -946,6 +945,20 @@ Object *MeshImporter::get_object_by_geom_uid(const COLLADAFW::UniqueId& geom_uid
 	return NULL;
 }
 
+Mesh *MeshImporter::get_mesh_by_geom_uid(const COLLADAFW::UniqueId& mesh_uid)
+{
+	if (uid_mesh_map.find(mesh_uid) != uid_mesh_map.end())
+		return uid_mesh_map[mesh_uid];
+	return NULL;
+}
+
+std::string *MeshImporter::get_geometry_name(const std::string &mesh_name)
+{
+	if (this->mesh_geom_map.find(mesh_name) != this->mesh_geom_map.end())
+		return &this->mesh_geom_map[mesh_name];
+	return NULL;
+}
+
 MTex *MeshImporter::assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBinding &ctexture,
                                                Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
                                                MTex *color_texture)
@@ -1061,7 +1074,7 @@ std::vector<Object *> MeshImporter::get_all_users_of(Mesh *reference_mesh)
  *
  * During import all materials have been assigned to Object.
  * Now we iterate over the imported objects and optimize
- * the assignments as follows:
+ * the assignements as follows:
  *
  * for each imported geometry:
  *     if number of users is 1:
@@ -1075,7 +1088,7 @@ std::vector<Object *> MeshImporter::get_all_users_of(Mesh *reference_mesh)
  *             adjust all other users accordingly.
  *
  **/
-void MeshImporter::optimize_material_assignments()
+void MeshImporter::optimize_material_assignements()
 {
 	for (std::vector<Object *>::iterator it = imported_objects.begin();
 	     it != imported_objects.end(); ++it)
@@ -1119,7 +1132,7 @@ void MeshImporter::optimize_material_assignments()
  * come along with different materials. So we first create the objects
  * and assign the materials to Object, then in a later cleanup we decide
  * which materials shall be moved to the created geometries. Also see
- * optimize_material_assignments() above.
+ * optimize_material_assignements() above.
  */
 MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial,
                                               std::map<COLLADAFW::UniqueId, Material *>& uid_material_map,
@@ -1284,17 +1297,19 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom)
 	COLLADAFW::Mesh *mesh = (COLLADAFW::Mesh *)geom;
 	
 	if (!is_nice_mesh(mesh)) {
-		fprintf(stderr, "Ignoring mesh %s\n", bc_get_dae_name(mesh));
+		fprintf(stderr, "Ignoring mesh %s\n", bc_get_dae_name(mesh).c_str());
 		return true;
 	}
 	
 	const std::string& str_geom_id = mesh->getName().size() ? mesh->getName() : mesh->getOriginalId();
-	Mesh *me = BKE_mesh_add((char *)str_geom_id.c_str());
+	Mesh *me = BKE_mesh_add(G.main, (char *)str_geom_id.c_str());
 	me->id.us--; // is already 1 here, but will be set later in set_mesh
 
 	// store the Mesh pointer to link it later with an Object
 	this->uid_mesh_map[mesh->getUniqueId()] = me;
-	
+	// needed to map mesh to its geometry name (needed for shape key naming)
+	this->mesh_geom_map[std::string(me->id.name)] = str_geom_id;
+
 	int new_tris = 0;
 	
 	read_vertices(mesh, me);
diff --git a/source/blender/collada/MeshImporter.h b/source/blender/collada/MeshImporter.h
index 746b073..8b0f5cd 100644
--- a/source/blender/collada/MeshImporter.h
+++ b/source/blender/collada/MeshImporter.h
@@ -59,6 +59,8 @@ class MeshImporterBase
 {
 public:
 	virtual Object *get_object_by_geom_uid(const COLLADAFW::UniqueId& geom_uid) = 0;
+	virtual Mesh *get_mesh_by_geom_uid(const COLLADAFW::UniqueId& mesh_uid) = 0;
+	virtual std::string *get_geometry_name(const std::string &mesh_name) = 0;
 };
 
 class UVDataWrapper
@@ -83,6 +85,7 @@ private:
 	Scene *scene;
 	ArmatureImporter *armature_importer;
 
+	std::map<std::string, std::string> mesh_geom_map; // needed for correct shape key naming
 	std::map<COLLADAFW::UniqueId, Mesh*> uid_mesh_map; // geometry unique id-to-mesh map
 	std::map<COLLADAFW::UniqueId, Object*> uid_object_map; // geom uid-to-object
 	std::vector<Object*> imported_objects; // list of imported objects
@@ -106,10 +109,10 @@ private:
 #endif
 	
 	void set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
-	                 COLLADAFW::IndexList& index_list, unsigned int *tris_indices);
+					 COLLADAFW::IndexList& index_list, unsigned int *tris_indices);
 
 	void set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
-	                 COLLADAFW::IndexList& index_list, int index, bool quad);
+					COLLADAFW::IndexList& index_list, int index, bool quad);
 
 #ifdef COLLADA_DEBUG
 	void print_index_list(COLLADAFW::IndexList& index_list);
@@ -151,28 +154,30 @@ public:
 	void bmeshConversion();
 
 	virtual Object *get_object_by_geom_uid(const COLLADAFW::UniqueId& geom_uid);
+
+	virtual Mesh *get_mesh_by_geom_uid(const COLLADAFW::UniqueId& geom_uid);
 	
 	MTex *assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBinding &ctexture,
-	                                 Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
-	                                 MTex *color_texture);
+									 Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
+									 MTex *color_texture);
 
-	void optimize_material_assignments();
+	void optimize_material_assignements();
 
 	MTFace *assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial,
-	                                std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
-	                                Object *ob, const COLLADAFW::UniqueId *geom_uid,
-	                                MTex **color_texture, char *layername, MTFace *texture_face,
-	                                std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index);
+									std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
+									Object *ob, const COLLADAFW::UniqueId *geom_uid, 
+									MTex **color_texture, char *layername, MTFace *texture_face,
+									std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index);
 	
 	
 	Object *create_mesh_object(COLLADAFW::Node *node, COLLADAFW::InstanceGeometry *geom,
-	                           bool isController,
-	                           std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
-	                           std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map);
+							   bool isController,
+							   std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
+							   std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map);
 
 	// create a mesh storing a pointer in a map so it can be retrieved later by geometry UID
 	bool write_geometry(const COLLADAFW::Geometry* geom);
-
+	std::string *get_geometry_name(const std::string &mesh_name);
 };
 
 #endif
diff --git a/source/blender/collada/SConscript b/source/blender/collada/SConscript
index 1351441..18ef62e 100644
--- a/source/blender/collada/SConscript
+++ b/source/blender/collada/SConscript
@@ -33,9 +33,9 @@ defs = []
 # TODO sanitize inc path building
 # relative paths to include dirs, space-separated, string
 if  env['OURPLATFORM']=='darwin':
-    incs = '../blenlib ../blenkernel ../windowmanager ../blenloader ../makesdna ../makesrna ../editors/include ../imbuf ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter [OPENCOLLADA]/COLLADABaseUtils [OPENCOLLADA]/COLLADAFramework [OPENCOLLADA]/COLLADASaxFrameworkLoader [OPENCOLLADA]/GeneratedSaxParser '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
+    incs = '../ikplugin ../../../intern/iksolver/extern ../blenlib ../blenkernel ../windowmanager ../blenloader ../makesdna ../makesrna ../editors/include ../imbuf ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter [OPENCOLLADA]/COLLADABaseUtils [OPENCOLLADA]/COLLADAFramework [OPENCOLLADA]/COLLADASaxFrameworkLoader [OPENCOLLADA]/GeneratedSaxParser '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
 else:
-    incs = '../blenlib ../blenkernel ../windowmanager ../makesdna ../blenloader ../makesrna ../editors/include ../imbuf ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter/include [OPENCOLLADA]/COLLADABaseUtils/include [OPENCOLLADA]/COLLADAFramework/include [OPENCOLLADA]/COLLADASaxFrameworkLoader/include [OPENCOLLADA]/GeneratedSaxParser/include '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
+    incs = '../ikplugin ../../../intern/iksolver/extern ../blenlib ../blenkernel ../windowmanager ../makesdna ../blenloader ../makesrna ../editors/include ../imbuf ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter/include [OPENCOLLADA]/COLLADABaseUtils/include [OPENCOLLADA]/COLLADAFramework/include [OPENCOLLADA]/COLLADASaxFrameworkLoader/include [OPENCOLLADA]/GeneratedSaxParser/include '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
 
 if env['BF_BUILDINFO']:
     defs.append('WITH_BUILDINFO')
diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp
index 6d239ae..dbf7d40 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -182,6 +182,45 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
 		colladaNode.end();
 	}
 
+	if (ob->constraints.first != NULL ) {
+		bConstraint *con = (bConstraint*) ob->constraints.first;
+		while (con) {
+			std::string con_name(id_name(con));
+			std::string con_tag = con_name + "_constraint";
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"type",con->type);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"enforce",con->enforce);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"flag",con->flag);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"headtail",con->headtail);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"lin_error",con->lin_error);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"own_space",con->ownspace);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"rot_error",con->rot_error);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"tar_space",con->tarspace);
+			colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"lin_error",con->lin_error);
+			
+			//not ideal: add the target object name as another parameter. 
+			//No real mapping in the .dae
+			//Need support for multiple target objects also.
+			bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
+			ListBase targets = {NULL, NULL};
+			if (cti && cti->get_constraint_targets) {
+			
+				bConstraintTarget *ct;
+				Object *obtar;
+			
+				cti->get_constraint_targets(con, &targets);
+				if (cti) {
+					for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
+						obtar = ct->tar;
+						std::string tar_id(id_name(obtar));
+						colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"target_id",tar_id);
+					}
+				}
+			}
+
+			con = con->next;
+		}
+	}
+
 	for (std::list<Object *>::iterator i = child_objects.begin(); i != child_objects.end(); ++i) {
 		if (bc_is_marked(*i)) {
 			bc_remove_mark(*i);
@@ -189,8 +228,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
 		}
 	}
 
-	if (ob->type != OB_ARMATURE) {
+	if (ob->type != OB_ARMATURE)
 		colladaNode.end();
-	}
 }
 
diff --git a/source/blender/collada/SceneExporter.h b/source/blender/collada/SceneExporter.h
index 31b471a..f438c00 100644
--- a/source/blender/collada/SceneExporter.h
+++ b/source/blender/collada/SceneExporter.h
@@ -43,6 +43,7 @@ extern "C" {
 #include "DNA_anim_types.h"
 #include "DNA_action_types.h"
 #include "DNA_curve_types.h"
+#include "DNA_constraint_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_userdef_types.h"
@@ -51,6 +52,7 @@ extern "C" {
 #include "BKE_fcurve.h"
 #include "BKE_animsys.h"
 #include "BLI_path_util.h"
+#include "BKE_constraint.h"
 #include "BLI_fileops.h"
 #include "ED_keyframing.h"
 }
diff --git a/source/blender/collada/TransformReader.cpp b/source/blender/collada/TransformReader.cpp
index 5bc135e..67166d8 100644
--- a/source/blender/collada/TransformReader.cpp
+++ b/source/blender/collada/TransformReader.cpp
@@ -46,28 +46,31 @@ void TransformReader::get_node_mat(float mat[4][4], COLLADAFW::Node *node, std::
 		COLLADAFW::Transformation *tm = node->getTransformations()[i];
 		COLLADAFW::Transformation::TransformationType type = tm->getTransformationType();
 
-		switch (type) {
-			case COLLADAFW::Transformation::TRANSLATE:
-				dae_translate_to_mat4(tm, cur);
-				break;
-			case COLLADAFW::Transformation::ROTATE:
-				dae_rotate_to_mat4(tm, cur);
-				break;
-			case COLLADAFW::Transformation::SCALE:
-				dae_scale_to_mat4(tm, cur);
-				break;
-			case COLLADAFW::Transformation::MATRIX:
-				dae_matrix_to_mat4(tm, cur);
-				break;
-			case COLLADAFW::Transformation::LOOKAT:
-			case COLLADAFW::Transformation::SKEW:
-				fprintf(stderr, "LOOKAT and SKEW transformations are not supported yet.\n");
-				break;
+		if (type == COLLADAFW::Transformation::MATRIX) {
+			// XXX why does this return and discard all following transformations?
+			dae_matrix_to_mat4(tm, mat);
+			return;
 		}
-
-		copy_m4_m4(copy, mat);
-		mult_m4_m4m4(mat, copy, cur);
-
+		else {
+			switch (type) {
+				case COLLADAFW::Transformation::TRANSLATE:
+					dae_translate_to_mat4(tm, cur);
+					break;
+				case COLLADAFW::Transformation::ROTATE:
+					dae_rotate_to_mat4(tm, cur);
+					break;
+				case COLLADAFW::Transformation::SCALE:
+					dae_scale_to_mat4(tm, cur);
+					break;
+				case COLLADAFW::Transformation::LOOKAT:
+				case COLLADAFW::Transformation::SKEW:
+					fprintf(stderr, "LOOKAT and SKEW transformations are not supported yet.\n");
+					break;
+			}
+			copy_m4_m4(copy, mat);
+			mult_m4_m4m4(mat, copy, cur);
+		}
+		
 		if (animation_map) {
 			// AnimationList that drives this Transformation
 			const COLLADAFW::UniqueId& anim_list_id = tm->getAnimationList();
diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp
index 3fe3f62..fa813e0 100644
--- a/source/blender/collada/TransformWriter.cpp
+++ b/source/blender/collada/TransformWriter.cpp
@@ -51,10 +51,10 @@ void TransformWriter::add_node_transform(COLLADASW::Node& node, float mat[4][4],
 	converter->mat4_to_dae_double(dmat, local);
 
 	TransformBase::decompose(local, loc, rot, NULL, scale);
-	if (node.getType() == COLLADASW::Node::JOINT)
-		node.addMatrix("transform", dmat);
-	else
-		add_transform(node, loc, rot, scale);
+	//if (node.getType() == COLLADASW::Node::JOINT)
+	node.addMatrix("transform", dmat);
+	//else
+	//add_transform(node, loc, rot, scale);
 }
 
 void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
@@ -93,12 +93,13 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
 
 	add_transform(node, loc, rot, scale);
 #endif
-
+	UnitConverter converter;
+	
 	/* Using parentinv should allow use of existing curves */
 	if (ob->parent) {
 		// If parentinv is identity don't add it.
 		bool add_parinv = false;
-
+    		
 		for (int i = 0; i < 16; ++i) {
 			float f = (i % 4 == i / 4) ? 1.0f : 0.0f;
 			add_parinv |= (ob->parentinv[i % 4][i / 4] != f);
@@ -106,13 +107,15 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
 
 		if (add_parinv) {
 			double dmat[4][4];
-			UnitConverter converter;
 			converter.mat4_to_dae_double(dmat, ob->parentinv);
 			node.addMatrix("parentinverse", dmat);
 		}
 	}
 
-	add_transform(node, ob->loc, ob->rot, ob->size);
+	double d_obmat[4][4];	
+	converter.mat4_to_dae_double(d_obmat, ob->obmat);
+	node.addMatrix("transform",d_obmat);
+	//add_transform(node, ob->loc, ob->rot, ob->size);
 }
 
 void TransformWriter::add_node_transform_identity(COLLADASW::Node& node)
@@ -123,15 +126,15 @@ void TransformWriter::add_node_transform_identity(COLLADASW::Node& node)
 
 void TransformWriter::add_transform(COLLADASW::Node& node, float loc[3], float rot[3], float scale[3])
 {
-	node.addTranslate("location", loc[0], loc[1], loc[2]);
 #if 0
 	node.addRotateZ("rotationZ", COLLADABU::Math::Utils::radToDegF(rot[2]));
 	node.addRotateY("rotationY", COLLADABU::Math::Utils::radToDegF(rot[1]));
 	node.addRotateX("rotationX", COLLADABU::Math::Utils::radToDegF(rot[0]));
 #endif
+	node.addTranslate("location", loc[0], loc[1], loc[2]);
 	node.addRotateZ("rotationZ", RAD2DEGF(rot[2]));
 	node.addRotateY("rotationY", RAD2DEGF(rot[1]));
 	node.addRotateX("rotationX", RAD2DEGF(rot[0]));
-
 	node.addScale("scale", scale[0], scale[1], scale[2]);
+
 }
diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp
index fbb1888..b3c288c 100644
--- a/source/blender/collada/collada.cpp
+++ b/source/blender/collada/collada.cpp
@@ -31,6 +31,7 @@
 #include "DocumentExporter.h"
 #include "DocumentImporter.h"
 #include "ExportSettings.h"
+#include "ImportSettings.h"
 
 extern "C"
 {
@@ -39,12 +40,19 @@ extern "C"
 
 /* make dummy file */
 #include "BLI_fileops.h"
-#include "BLI_path_util.h"
 #include "BLI_linklist.h"
 
-int collada_import(bContext *C, const char *filepath)
+int collada_import(bContext *C,
+				   const char *filepath,
+				   int import_units)
 {
-	DocumentImporter imp(C, filepath);
+
+	ImportSettings import_settings;
+	import_settings.filepath = (char *)filepath;
+
+	import_settings.import_units =  import_units != 0;
+
+	DocumentImporter imp(C, &import_settings);
 	if (imp.import()) return 1;
 
 	return 0;
@@ -59,6 +67,7 @@ int collada_export(Scene *sce,
                    int selected,
                    int include_children,
                    int include_armatures,
+				   int include_shapekeys,
                    int deform_bones_only,
 
 				   int active_uv_only,
@@ -89,6 +98,7 @@ int collada_export(Scene *sce,
 	export_settings.selected                 = selected          != 0;
 	export_settings.include_children         = include_children  != 0;
 	export_settings.include_armatures        = include_armatures != 0;
+	export_settings.include_shapekeys        = include_shapekeys != 0;
 	export_settings.deform_bones_only        = deform_bones_only != 0;
 
 	export_settings.active_uv_only           = active_uv_only != 0;
diff --git a/source/blender/collada/collada.h b/source/blender/collada/collada.h
index 13f8151..2fa5b22 100644
--- a/source/blender/collada/collada.h
+++ b/source/blender/collada/collada.h
@@ -33,6 +33,7 @@ extern "C" {
 #endif
 
 #include "BLI_linklist.h"
+#include "BLI_path_util.h"
 #include "RNA_types.h"
 
 typedef enum BC_export_mesh_type {
@@ -46,7 +47,10 @@ struct Scene;
 /*
  * both return 1 on success, 0 on error
  */
-int collada_import(bContext *C, const char *filepath);
+int collada_import(bContext *C,
+				   const char *filepath,
+				   int import_units);
+
 int collada_export(Scene *sce,
                    const char *filepath,
                    int apply_modifiers,
@@ -55,6 +59,7 @@ int collada_export(Scene *sce,
                    int selected,
                    int include_children,
                    int include_armatures,
+                   int include_shapekeys,
                    int deform_bones_only,
 
 				   int active_uv_only,
diff --git a/source/blender/collada/collada_internal.cpp b/source/blender/collada/collada_internal.cpp
index 51d81dc..85f98da 100644
--- a/source/blender/collada/collada_internal.cpp
+++ b/source/blender/collada/collada_internal.cpp
@@ -33,7 +33,14 @@
 
 UnitConverter::UnitConverter() : unit(), up_axis(COLLADAFW::FileInfo::Z_UP)
 {
-	/* pass */
+	unit_m4(x_up_mat4);
+	rotate_m4(x_up_mat4, 'Y', -0.5 * M_PI);
+
+	unit_m4(y_up_mat4);
+	rotate_m4(y_up_mat4, 'X', 0.5 * M_PI);
+
+	unit_m4(z_up_mat4);
+
 }
 
 void UnitConverter::read_asset(const COLLADAFW::FileInfo *asset)
@@ -102,6 +109,21 @@ void UnitConverter::mat4_to_dae_double(double out[4][4], float in[4][4])
 			out[i][j] = mat[i][j];
 }
 
+float(&UnitConverter::get_rotation())[4][4]
+{
+	switch(up_axis) {
+		case COLLADAFW::FileInfo::X_UP:
+			return x_up_mat4;
+			break;
+		case COLLADAFW::FileInfo::Y_UP:
+			return y_up_mat4;
+			break;
+		default:
+			return z_up_mat4;
+			break;
+	}
+}
+
 void TransformBase::decompose(float mat[4][4], float *loc, float eul[3], float quat[4], float *size)
 {
 	mat4_to_size(size, mat);
@@ -283,3 +305,9 @@ std::string get_material_id(Material *mat)
 {
 	return translate_id(id_name(mat)) + "-material";
 }
+
+std::string get_morph_id(Object *ob)
+{
+	return translate_id(id_name(ob)) + "-morph";
+}
+
diff --git a/source/blender/collada/collada_internal.h b/source/blender/collada/collada_internal.h
index d92f53f..7d59932 100644
--- a/source/blender/collada/collada_internal.h
+++ b/source/blender/collada/collada_internal.h
@@ -39,7 +39,6 @@
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "BLI_math.h"
-#include "BLI_math.h"
 #include "BLI_linklist.h"
 
 class UnitConverter
@@ -48,6 +47,10 @@ private:
 	COLLADAFW::FileInfo::Unit unit;
 	COLLADAFW::FileInfo::UpAxisType up_axis;
 
+	float x_up_mat4[4][4];
+	float y_up_mat4[4][4];
+	float z_up_mat4[4][4];
+
 public:
 
 	enum UnitSystem {
@@ -74,6 +77,10 @@ public:
 	void mat4_to_dae(float out[4][4], float in[4][4]);
 
 	void mat4_to_dae_double(double out[4][4], float in[4][4]);
+
+	float(&get_rotation())[4][4];
+
+
 };
 
 class TransformBase
@@ -99,4 +106,6 @@ extern std::string get_camera_id(Object *ob);
 
 extern std::string get_material_id(Material *mat);
 
+extern std::string get_morph_id(Object *ob);
+
 #endif /* __COLLADA_INTERNAL_H__ */
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index 7bdda38..45db851 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -49,6 +49,7 @@ extern "C" {
 #include "BKE_customdata.h"
 #include "BKE_depsgraph.h"
 #include "BKE_object.h"
+#include "BKE_global.h"
 #include "BKE_mesh.h"
 #include "BKE_scene.h"
 #include "BKE_DerivedMesh.h"
@@ -115,16 +116,19 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
 	ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA;
 	par->recalc |= OB_RECALC_OB;
 
+	/** done once after import
 	DAG_scene_sort(bmain, sce);
 	DAG_ids_flush_update(bmain, 0);
 	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+    */
+
 
 	return true;
 }
 
 Object *bc_add_object(Scene *scene, int type, const char *name)
 {
-	Object *ob = BKE_object_add_only_object(type, name);
+	Object *ob = BKE_object_add_only_object(G.main, type, name);
 
 	ob->data = BKE_object_obdata_add_from_type(type);
 	ob->lay = scene->lay;
@@ -151,7 +155,7 @@ Mesh *bc_to_mesh_apply_modifiers(Scene *scene, Object *ob, BC_export_mesh_type e
 		}
 	}
 
-	tmpmesh = BKE_mesh_add("ColladaMesh"); // name is not important here
+	tmpmesh = BKE_mesh_add(G.main, "ColladaMesh"); // name is not important here
 	DM_to_mesh(dm, tmpmesh, ob);
 	dm->release(dm);
 	return tmpmesh;
@@ -282,3 +286,85 @@ int bc_get_active_UVLayer(Object *ob)
 	Mesh *me = (Mesh *)ob->data;
 	return CustomData_get_active_layer_index(&me->fdata, CD_MTFACE);
 }
+
+std::string bc_url_encode(std::string data) {
+	/* XXX We probably do not need to do a full encoding.
+	   But in case that is necessary,then it can be added here.
+	*/
+	return bc_replace_string(data,"#", "%23");
+}
+
+std::string bc_replace_string(std::string data, const std::string& pattern,
+							  const std::string& replacement) {
+	size_t pos = 0;
+	while((pos = data.find(pattern, pos)) != std::string::npos) {
+		data.replace(pos, pattern.length(), replacement);
+		pos += replacement.length();
+	}
+	return data;
+}
+
+/**
+	Calculate a rescale factor such that the imported scene's scale
+	is preserved. I.e. 1 meter in the import will also be
+	1 meter in the current scene.
+	XXX : I am not sure if it is correct to map 1 Blender Unit
+	to 1 Meter for unit type NONE. But it looks reasonable to me.
+*/
+void bc_match_scale(std::vector<Object *> *objects_done, 
+					Scene &sce, 
+					UnitConverter &bc_unit) {
+
+	Object *ob = NULL;
+
+	PointerRNA scene_ptr, unit_settings;
+	PropertyRNA *system_ptr, *scale_ptr;
+	RNA_id_pointer_create(&sce.id, &scene_ptr);
+
+	unit_settings = RNA_pointer_get(&scene_ptr, "unit_settings");
+	system_ptr = RNA_struct_find_property(&unit_settings, "system");
+	scale_ptr = RNA_struct_find_property(&unit_settings, "scale_length");
+
+	int   type  = RNA_property_enum_get(&unit_settings, system_ptr);
+
+	float bl_scale;
+	
+	switch (type) {
+		case USER_UNIT_NONE:
+			bl_scale = 1.0; // map 1 Blender unit to 1 Meter
+			break;
+
+		case USER_UNIT_METRIC:
+			bl_scale = RNA_property_float_get(&unit_settings, scale_ptr);
+			break;
+
+		default :
+			bl_scale = RNA_property_float_get(&unit_settings, scale_ptr);
+			// it looks like the conversion to Imperial is done implicitly.
+			// So nothing to do here.
+			break;
+	}
+	
+	float scale_conv = bc_unit.getLinearMeter() / bl_scale;
+
+	float rescale[3];
+	rescale[0] = rescale[1] = rescale[2] = scale_conv;
+
+	float size_mat4[4][4];
+
+	float axis_mat4[4][4];
+	unit_m4(axis_mat4);
+
+	size_to_mat4(size_mat4, rescale);
+
+	for (std::vector<Object *>::iterator it = objects_done->begin();
+			it != objects_done->end();
+			++it) 
+	{
+		ob = *it;
+		mult_m4_m4m4(ob->obmat, size_mat4, ob->obmat);
+		mult_m4_m4m4(ob->obmat, bc_unit.get_rotation(), ob->obmat);
+		BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
+	}
+
+}
\ No newline at end of file
diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index b8990c3..892b57e 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -42,15 +42,19 @@ extern "C" {
 #include "DNA_texture_types.h"
 #include "DNA_scene_types.h"
 
+#include "RNA_access.h"
+
 #include "BLI_linklist.h"
 #include "BLI_utildefines.h"
 
 #include "BKE_context.h"
 #include "BKE_object.h"
 #include "BKE_DerivedMesh.h"
+#include "BKE_scene.h"
 }
 
 #include "ExportSettings.h"
+#include "collada_internal.h"
 
 typedef std::map<COLLADAFW::TextureMapId, std::vector<MTex *> > TexIndexTextureArrayMap;
 
@@ -77,4 +81,7 @@ extern void bc_bubble_sort_by_Object_name(LinkNode *export_set);
 extern bool bc_is_root_bone(Bone *aBone, bool deform_bones_only);
 extern int  bc_get_active_UVLayer(Object *ob);
 
+extern std::string bc_replace_string(std::string data, const std::string& pattern, const std::string& replacement); 
+extern std::string bc_url_encode(std::string data); 
+extern void bc_match_scale(std::vector<Object *> *objects_done, Scene &sce, UnitConverter &unit_converter);
 #endif
diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt
index 0e8ddf4..ba897a8 100644
--- a/source/blender/compositor/CMakeLists.txt
+++ b/source/blender/compositor/CMakeLists.txt
@@ -35,13 +35,13 @@ set(INC
 	../imbuf
 	../makesdna
 	../makesrna
-	../opencl
 	../windowmanager
 	../nodes
 	../nodes/composite
 	../nodes/intern
 	../render/extern/include
 	../render/intern/include
+	../../../intern/opencl
 	../../../intern/guardedalloc
 )
 
@@ -580,6 +580,8 @@ set(SRC
 	# Distort operation
 	operations/COM_TranslateOperation.h
 	operations/COM_TranslateOperation.cpp
+	operations/COM_WrapOperation.h
+	operations/COM_WrapOperation.cpp
 	operations/COM_RotateOperation.h
 	operations/COM_RotateOperation.cpp
 	operations/COM_ScaleOperation.h
diff --git a/source/blender/compositor/SConscript b/source/blender/compositor/SConscript
index 1872bf2..64169ac 100644
--- a/source/blender/compositor/SConscript
+++ b/source/blender/compositor/SConscript
@@ -32,7 +32,7 @@ sources = env.Glob('intern/*.cpp') + env.Glob('nodes/*.cpp') + env.Glob('operati
 
 incs = '. nodes intern operations ../blenlib ../blenkernel ../makesdna ../render/extern/include ../render/intern/include'
 incs += ' ../makesrna ../blenloader ../../../intern/guardedalloc ../imbuf ../windowmanager '
-incs += '../opencl ../nodes ../nodes/intern ../nodes/composite '
+incs += '#intern/opencl ../nodes ../nodes/intern ../nodes/composite '
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
     incs += ' ' + env['BF_PTHREADS_INC']
diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h
index 2f5e8c0..840a9e5 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.h
+++ b/source/blender/compositor/intern/COM_CompositorContext.h
@@ -74,7 +74,7 @@ private:
 	 * @brief does this system have active opencl devices?
 	 */
 	bool m_hasActiveOpenCLDevices;
-	
+
 	/**
 	 * @brief Skip slow nodes
 	 */
@@ -178,6 +178,7 @@ public:
 	
 	void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;}
 	bool isFastCalculation() {return this->m_fastCalculation;}
+	inline bool isGroupnodeBufferEnabled() {return this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER;}
 };
 
 
diff --git a/source/blender/compositor/nodes/COM_CompositorNode.cpp b/source/blender/compositor/nodes/COM_CompositorNode.cpp
index e331375..fc4dea8 100644
--- a/source/blender/compositor/nodes/COM_CompositorNode.cpp
+++ b/source/blender/compositor/nodes/COM_CompositorNode.cpp
@@ -41,6 +41,7 @@ void CompositorNode::convertToOperations(ExecutionSystem *graph, CompositorConte
 	compositorOperation->setSceneName(editorNode->id->name);
 	compositorOperation->setRenderData(context->getRenderData());
 	compositorOperation->setbNodeTree(context->getbNodeTree());
+	compositorOperation->setIgnoreAlpha(editorNode->custom2 & 1);
 	imageSocket->relinkConnections(compositorOperation->getInputSocket(0), 0, graph);
 	alphaSocket->relinkConnections(compositorOperation->getInputSocket(1));
 	depthSocket->relinkConnections(compositorOperation->getInputSocket(2));
diff --git a/source/blender/compositor/nodes/COM_GroupNode.cpp b/source/blender/compositor/nodes/COM_GroupNode.cpp
index e10d7db..05c7493 100644
--- a/source/blender/compositor/nodes/COM_GroupNode.cpp
+++ b/source/blender/compositor/nodes/COM_GroupNode.cpp
@@ -58,17 +58,18 @@ void GroupNode::ungroup(ExecutionSystem &system)
 		InputSocket *inputSocket = inputsockets[index];
 		bNodeSocket *editorInput = inputSocket->getbNodeSocket();
 		if (editorInput->groupsock) {
-			SocketProxyNode *proxy = new SocketProxyNode(bnode, editorInput, editorInput->groupsock);
+			SocketProxyNode *proxy = new SocketProxyNode(bnode, editorInput, editorInput->groupsock, false);
 			inputSocket->relinkConnections(proxy->getInputSocket(0), index, &system);
 			ExecutionSystemHelper::addNode(system.getNodes(), proxy);
 		}
 	}
 
+	const bool groupnodeBuffering = system.getContext().isGroupnodeBufferEnabled();
 	for (index = 0; index < outputsockets.size(); index++) {
 		OutputSocket *outputSocket = outputsockets[index];
 		bNodeSocket *editorOutput = outputSocket->getbNodeSocket();
 		if (editorOutput->groupsock) {
-			SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput->groupsock, editorOutput);
+			SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput->groupsock, editorOutput, groupnodeBuffering);
 			outputSocket->relinkConnections(proxy->getOutputSocket(0));
 			ExecutionSystemHelper::addNode(system.getNodes(), proxy);
 		}
diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cpp b/source/blender/compositor/nodes/COM_ScaleNode.cpp
index 6f7bd33..e139eb8 100644
--- a/source/blender/compositor/nodes/COM_ScaleNode.cpp
+++ b/source/blender/compositor/nodes/COM_ScaleNode.cpp
@@ -43,7 +43,8 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
 	bNode *bnode = this->getbNode();
 
 	switch (bnode->custom1) {
-		case CMP_SCALE_RELATIVE: {
+		case CMP_SCALE_RELATIVE:
+		{
 			ScaleOperation *operation = new ScaleOperation();
 
 			inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
@@ -51,9 +52,10 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
 			inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
 
 			scaleoperation = operation;
+			break;
 		}
-		break;
-		case CMP_SCALE_SCENEPERCENT: {
+		case CMP_SCALE_SCENEPERCENT:
+		{
 			SetValueOperation *scaleFactorOperation = new SetValueOperation();
 			scaleFactorOperation->setValue(context->getRenderData()->size / 100.0f);
 			ScaleOperation *operation = new ScaleOperation();
@@ -63,10 +65,10 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
 			graph->addOperation(scaleFactorOperation);
 
 			scaleoperation = operation;
+			break;
 		}
-		break;
-
-		case CMP_SCALE_RENDERPERCENT: {
+		case CMP_SCALE_RENDERPERCENT:
+		{
 			const RenderData *rd = context->getRenderData();
 			ScaleFixedSizeOperation *operation = new ScaleFixedSizeOperation();
 
@@ -81,10 +83,10 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
 			operation->getInputSocket(0)->getConnection()->setIgnoreResizeCheck(true);
 
 			scaleoperation = operation;
+			break;
 		}
-		break;
-
-		case CMP_SCALE_ABSOLUTE: {
+		case CMP_SCALE_ABSOLUTE:
+		{
 			ScaleAbsoluteOperation *operation = new ScaleAbsoluteOperation(); // TODO: what is the use of this one.... perhaps some issues when the ui was updated....
 
 			inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
@@ -92,8 +94,8 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
 			inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
 
 			scaleoperation = operation;
+			break;
 		}
-		break;
 	}
 
 	outputSocket->relinkConnections(scaleoperation->getOutputSocket(0));
diff --git a/source/blender/compositor/nodes/COM_SetAlphaNode.cpp b/source/blender/compositor/nodes/COM_SetAlphaNode.cpp
index 709dc75..dd3ff5f 100644
--- a/source/blender/compositor/nodes/COM_SetAlphaNode.cpp
+++ b/source/blender/compositor/nodes/COM_SetAlphaNode.cpp
@@ -27,7 +27,11 @@
 void SetAlphaNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
 {
 	SetAlphaOperation *operation = new SetAlphaOperation();
-	
+
+	if (!this->getInputSocket(0)->isConnected() && this->getInputSocket(1)->isConnected()) {
+		operation->setResolutionInputSocketIndex(1);
+	}
+
 	this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
 	this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph);
 	this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.cpp b/source/blender/compositor/nodes/COM_SocketProxyNode.cpp
index bfb32a9..ded6186 100644
--- a/source/blender/compositor/nodes/COM_SocketProxyNode.cpp
+++ b/source/blender/compositor/nodes/COM_SocketProxyNode.cpp
@@ -27,11 +27,14 @@
 #include "COM_SetValueOperation.h"
 #include "COM_SetVectorOperation.h"
 #include "COM_SetColorOperation.h"
+#include "COM_WriteBufferOperation.h"
+#include "COM_ReadBufferOperation.h"
 
-SocketProxyNode::SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput) : Node(editorNode, false)
+SocketProxyNode::SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool buffer) : Node(editorNode, false)
 {
 	DataType dt;
-	
+	this->m_buffer = buffer;
+
 	dt = COM_DT_VALUE;
 	if (editorInput->type == SOCK_RGBA) dt = COM_DT_COLOR;
 	if (editorInput->type == SOCK_VECTOR) dt = COM_DT_VECTOR;
@@ -53,6 +56,17 @@ void SocketProxyNode::convertToOperations(ExecutionSystem *graph, CompositorCont
 			inputsocket->relinkConnections(operation->getInputSocket(0));
 			outputsocket->relinkConnections(operation->getOutputSocket(0));
 			graph->addOperation(operation);
+			if (m_buffer) {
+				WriteBufferOperation *writeOperation = new WriteBufferOperation();
+				ReadBufferOperation *readOperation = new ReadBufferOperation();
+				readOperation->setMemoryProxy(writeOperation->getMemoryProxy());
+
+				operation->getOutputSocket()->relinkConnections(readOperation->getOutputSocket());
+				addLink(graph, operation->getOutputSocket(), writeOperation->getInputSocket(0));
+
+				graph->addOperation(writeOperation);
+				graph->addOperation(readOperation);
+			}
 		}
 		else {
 			/* If input is not connected, add a constant value operation instead */
diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.h b/source/blender/compositor/nodes/COM_SocketProxyNode.h
index ea50be4..a83ac09 100644
--- a/source/blender/compositor/nodes/COM_SocketProxyNode.h
+++ b/source/blender/compositor/nodes/COM_SocketProxyNode.h
@@ -30,8 +30,10 @@
  * @ingroup Node
  */
 class SocketProxyNode : public Node {
+private:
+    bool m_buffer;
 public:
-	SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput);
+    SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool buffer);
 	void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
 
 	virtual bool isProxyNode() const { return true; }
diff --git a/source/blender/compositor/nodes/COM_TranslateNode.cpp b/source/blender/compositor/nodes/COM_TranslateNode.cpp
index c805f8f..44d796c 100644
--- a/source/blender/compositor/nodes/COM_TranslateNode.cpp
+++ b/source/blender/compositor/nodes/COM_TranslateNode.cpp
@@ -23,6 +23,7 @@
 #include "COM_TranslateNode.h"
 
 #include "COM_TranslateOperation.h"
+#include "COM_WrapOperation.h"
 #include "COM_ExecutionSystem.h"
 
 TranslateNode::TranslateNode(bNode *editorNode) : Node(editorNode)
@@ -37,10 +38,32 @@ void TranslateNode::convertToOperations(ExecutionSystem *graph, CompositorContex
 	InputSocket *inputYSocket = this->getInputSocket(2);
 	OutputSocket *outputSocket = this->getOutputSocket(0);
 	TranslateOperation *operation = new TranslateOperation();
-	
-	inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
+
+	bNode *bnode = this->getbNode();
+	NodeTranslateData *data = (NodeTranslateData *)bnode->storage;
+
+	if (data->wrap_axis) {
+		WrapOperation *wrapOperation = new WrapOperation();
+		wrapOperation->setWrapping(data->wrap_axis);
+		inputSocket->relinkConnections(wrapOperation->getInputSocket(0), 0, graph);
+		addLink(graph, wrapOperation->getOutputSocket(), operation->getInputSocket(0));
+		graph->addOperation(wrapOperation);
+	}
+	else {
+		inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
+	}
+
+	if (data->relative) {
+		const RenderData *rd = context->getRenderData();
+		float fx = rd->xsch * rd->size / 100.0f;
+		float fy = rd->ysch * rd->size / 100.0f;
+
+		operation->setFactorXY(fx, fy);
+	}
+
 	inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
 	inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
 	outputSocket->relinkConnections(operation->getOutputSocket(0));
 	graph->addOperation(operation);
 }
+
diff --git a/source/blender/compositor/nodes/COM_ViewerNode.cpp b/source/blender/compositor/nodes/COM_ViewerNode.cpp
index f44470a..94f3c2e 100644
--- a/source/blender/compositor/nodes/COM_ViewerNode.cpp
+++ b/source/blender/compositor/nodes/COM_ViewerNode.cpp
@@ -47,6 +47,7 @@ void ViewerNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
 	viewerOperation->setChunkOrder((OrderOfChunks)editorNode->custom1);
 	viewerOperation->setCenterX(editorNode->custom3);
 	viewerOperation->setCenterY(editorNode->custom4);
+	viewerOperation->setIgnoreAlpha(editorNode->custom2 & 1);
 
 	viewerOperation->setViewSettings(context->getViewSettings());
 	viewerOperation->setDisplaySettings(context->getDisplaySettings());
diff --git a/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp b/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp
index 234a1c7..84cc8aa 100644
--- a/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp
+++ b/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp
@@ -38,7 +38,8 @@ void ChannelMatteOperation::initExecution()
 
 	switch (this->m_limit_method) {
 		/* SINGLE */
-		case 0: {
+		case 0:
+		{
 			/* 123 / RGB / HSV / YUV / YCC */
 			const int matte_channel = this->m_matte_channel - 1;
 			const int limit_channel = this->m_limit_channel - 1;
@@ -48,21 +49,25 @@ void ChannelMatteOperation::initExecution()
 			break;
 		}
 		/* MAX */
-		case 1: {
+		case 1:
+		{
 			switch (this->m_matte_channel) {
-				case 1: {
+				case 1:
+				{
 					this->m_ids[0] = 0;
 					this->m_ids[1] = 1;
 					this->m_ids[2] = 2;
 					break;
 				}
-				case 2: {
+				case 2:
+				{
 					this->m_ids[0] = 1;
 					this->m_ids[1] = 0;
 					this->m_ids[2] = 2;
 					break;
 				}
-				case 3: {
+				case 3:
+				{
 					this->m_ids[0] = 2;
 					this->m_ids[1] = 0;
 					this->m_ids[2] = 1;
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index 141d071..43f491a 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -49,6 +49,8 @@ CompositorOperation::CompositorOperation() : NodeOperation()
 	this->m_alphaInput = NULL;
 	this->m_depthInput = NULL;
 
+	this->m_ignoreAlpha = false;
+
 	this->m_sceneName[0] = '\0';
 }
 
@@ -91,14 +93,14 @@ void CompositorOperation::deinitExecution()
 			}
 		}
 
-		BLI_lock_thread(LOCK_DRAW_IMAGE);
-		BKE_image_signal(BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"), NULL, IMA_SIGNAL_FREE);
-		BLI_unlock_thread(LOCK_DRAW_IMAGE);
-
 		if (re) {
 			RE_ReleaseResult(re);
 			re = NULL;
 		}
+
+		BLI_lock_thread(LOCK_DRAW_IMAGE);
+		BKE_image_signal(BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"), NULL, IMA_SIGNAL_FREE);
+		BLI_unlock_thread(LOCK_DRAW_IMAGE);
 	}
 	else {
 		if (this->m_outputBuffer) {
@@ -138,9 +140,15 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber)
 	for (y = y1; y < y2 && (!breaked); y++) {
 		for (x = x1; x < x2 && (!breaked); x++) {
 			this->m_imageInput->read(color, x, y, COM_PS_NEAREST);
-			if (this->m_alphaInput != NULL) {
-				this->m_alphaInput->read(&(color[3]), x, y, COM_PS_NEAREST);
+			if (this->m_ignoreAlpha) {
+				color[3] = 1.0f;
 			}
+			else {
+				if (this->m_alphaInput != NULL) {
+					this->m_alphaInput->read(&(color[3]), x, y, COM_PS_NEAREST);
+				}
+			}
+
 			copy_v4_v4(buffer + offset4, color);
 
 			if (this->m_depthInput != NULL) {
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h
index c1d91c1..27d2966 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.h
+++ b/source/blender/compositor/operations/COM_CompositorOperation.h
@@ -65,6 +65,10 @@ private:
 	 * @brief local reference to the depth operation
 	 */
 	SocketReader *m_depthInput;
+
+	/* Ignore any alpha input */
+	bool m_ignoreAlpha;
+
 public:
 	CompositorOperation();
 	void executeRegion(rcti *rect, unsigned int tileNumber);
@@ -75,5 +79,6 @@ public:
 	void deinitExecution();
 	const CompositorPriority getRenderPriority() const { return COM_PRIORITY_MEDIUM; }
 	void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
+	void setIgnoreAlpha(bool value) { this->m_ignoreAlpha = value; }
 };
 #endif
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
index f0fffa7..b54e47c 100644
--- a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
+++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
@@ -323,89 +323,147 @@ DilateStepOperation::DilateStepOperation() : NodeOperation()
 void DilateStepOperation::initExecution()
 {
 	this->m_inputProgram = this->getInputSocketReader(0);
-	this->m_cached_buffer = NULL;
-	this->initMutex();
+}
+
+
+// small helper to pass data from initializeTileData to executePixel
+typedef struct tile_info {
+	rcti rect;
+	int width;
+	float *buffer;
+} tile_info;
+
+static tile_info *create_cache(int xmin, int xmax, int ymin, int ymax)
+{
+	tile_info *result = (tile_info *)MEM_mallocN(sizeof(tile_info), "dilate erode tile");
+	result->rect.xmin = xmin;
+	result->rect.xmax = xmax;
+	result->rect.ymin = ymin;
+	result->rect.ymax = ymax;
+	result->width = xmax - xmin;
+	result->buffer = (float *)MEM_callocN(sizeof(float) * (ymax - ymin) * result->width, "dilate erode cache");
+	return result;
 }
 
 void *DilateStepOperation::initializeTileData(rcti *rect)
 {
-	if (this->m_cached_buffer != NULL) {
-		return this->m_cached_buffer;
-	}
-	lockMutex();
-	if (this->m_cached_buffer == NULL) {
-		MemoryBuffer *buffer = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
-		float *rectf = buffer->convertToValueBuffer();
-		int x, y, i;
-		float *p;
-		int bwidth = buffer->getWidth();
-		int bheight = buffer->getHeight();
-		for (i = 0; i < this->m_iterations; i++) {
-			for (y = 0; y < bheight; y++) {
-				for (x = 0; x < bwidth - 1; x++) {
-					p = rectf + (bwidth * y + x);
-					*p = max(*p, *(p + 1));
-				}
+	MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
+	int x, y, i;
+	int width = tile->getWidth();
+	int height = tile->getHeight();
+	float *buffer = tile->getBuffer();
+
+	int half_window = this->m_iterations;
+	int window = half_window * 2 + 1;
+
+	int xmin = max(0, rect->xmin - half_window);
+	int ymin = max(0, rect->ymin - half_window);
+	int xmax = min(width,  rect->xmax + half_window);
+	int ymax = min(height, rect->ymax + half_window);
+
+	int bwidth = rect->xmax - rect->xmin;
+	int bheight = rect->ymax - rect->ymin;
+
+	// Note: Cache buffer has original tilesize width, but new height.
+	// We have to calculate the additional rows in the first pass,
+	// to have valid data available for the second pass.
+	tile_info *result = create_cache(rect->xmin, rect->xmax, ymin, ymax);
+	float *rectf = result->buffer;
+
+	// temp holds maxima for every step in the algorithm, buf holds a
+	// single row or column of input values, padded with MAXFLOATs to
+	// simplify the logic.
+	float *temp = (float *)MEM_mallocN(sizeof(float) * (2 * window - 1), "dilate erode temp");
+	float *buf = (float *)MEM_mallocN(sizeof(float) * (max(bwidth, bheight) + 5 * half_window), "dilate erode buf");
+
+	// The following is based on the van Herk/Gil-Werman algorithm for morphology operations.
+	// first pass, horizontal dilate/erode
+	for (y = ymin; y < ymax; y++) {
+		for (x = 0; x < bwidth + 5 * half_window; x++) {
+			buf[x] = -MAXFLOAT;
+		}
+		for (x = xmin; x < xmax; ++x) {
+			buf[x - rect->xmin + window - 1] = buffer[4 * (y * width + x)];
+		}
+
+		for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
+			int start = (i + 1) * window - 1;
+
+			temp[window - 1] = buf[start];
+			for (x = 1; x < window; x++) {
+				temp[window - 1 - x] = max(temp[window - x], buf[start - x]);
+				temp[window - 1 + x] = max(temp[window + x - 2], buf[start + x]);
 			}
-		
-			for (y = 0; y < bheight; y++) {
-				for (x = bwidth - 1; x >= 1; x--) {
-					p = rectf + (bwidth * y + x);
-					*p = max(*p, *(p - 1));
-				}
+
+			start = half_window + (i - 1) * window + 1;
+			for (x = -min(0, start); x < window - max(0, start + window - bwidth); x++) {
+				rectf[bwidth * (y - ymin) + (start + x)] = max(temp[x], temp[x + window - 1]);
 			}
-		
-			for (x = 0; x < bwidth; x++) {
-				for (y = 0; y < bheight - 1; y++) {
-					p = rectf + (bwidth * y + x);
-					*p = max(*p, *(p + bwidth));
-				}
+		}
+	}
+
+	// second pass, vertical dilate/erode
+	for (x = 0; x < bwidth; x++) {
+		for (y = 0; y < bheight + 5 * half_window; y++) {
+			buf[y] = -MAXFLOAT;
+		}
+		for (y = ymin; y < ymax; y++) {
+			buf[y - rect->ymin + window - 1] = rectf[(y - ymin) * bwidth + x];
+		}
+
+		for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
+			int start = (i + 1) * window - 1;
+
+			temp[window - 1] = buf[start];
+			for (y = 1; y < window; y++) {
+				temp[window - 1 - y] = max(temp[window - y], buf[start - y]);
+				temp[window - 1 + y] = max(temp[window + y - 2], buf[start + y]);
 			}
-		
-			for (x = 0; x < bwidth; x++) {
-				for (y = bheight - 1; y >= 1; y--) {
-					p = rectf + (bwidth * y + x);
-					*p = max(*p, *(p - bwidth));
-				}
+
+			start = half_window + (i - 1) * window + 1;
+			for (y = -min(0, start); y < window - max(0, start + window - bheight); y++) {
+				rectf[bwidth * (y + start + (rect->ymin - ymin)) + x] = max(temp[y], temp[y + window - 1]);
 			}
 		}
-		this->m_cached_buffer = rectf;
 	}
-	unlockMutex();
-	return this->m_cached_buffer;
+
+	MEM_freeN(temp);
+	MEM_freeN(buf);
+
+	return result;
 }
 
 
 void DilateStepOperation::executePixel(float output[4], int x, int y, void *data)
 {
-	output[0] = this->m_cached_buffer[y * this->getWidth() + x];
+	tile_info *tile = (tile_info *)data;
+	int nx = x - tile->rect.xmin;
+	int ny = y - tile->rect.ymin;
+	output[0] = tile->buffer[tile->width * ny + nx];
 }
 
 void DilateStepOperation::deinitExecution()
 {
 	this->m_inputProgram = NULL;
-	this->deinitMutex();
-	if (this->m_cached_buffer) {
-		MEM_freeN(this->m_cached_buffer);
-		this->m_cached_buffer = NULL;
-	}
+}
+
+void DilateStepOperation::deinitializeTileData(rcti *rect, void *data)
+{
+	tile_info *tile = (tile_info *)data;
+	MEM_freeN(tile->buffer);
+	MEM_freeN(tile);
 }
 
 bool DilateStepOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
 {
-	if (this->m_cached_buffer) {
-		return false;
-	}
-	else {
-		rcti newInput;
-	
-		newInput.xmax = getWidth();
-		newInput.xmin = 0;
-		newInput.ymax = getHeight();
-		newInput.ymin = 0;
-	
-		return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
-	}
+	rcti newInput;
+	int it = this->m_iterations;
+	newInput.xmax = input->xmax + it;
+	newInput.xmin = input->xmin - it;
+	newInput.ymax = input->ymax + it;
+	newInput.ymin = input->ymin - it;
+
+	return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
 
 // Erode step
@@ -416,48 +474,88 @@ ErodeStepOperation::ErodeStepOperation() : DilateStepOperation()
 
 void *ErodeStepOperation::initializeTileData(rcti *rect)
 {
-	if (this->m_cached_buffer != NULL) {
-		return this->m_cached_buffer;
-	}
-	lockMutex();
-	if (this->m_cached_buffer == NULL) {
-		MemoryBuffer *buffer = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
-		float *rectf = buffer->convertToValueBuffer();
-		int x, y, i;
-		float *p;
-		int bwidth = buffer->getWidth();
-		int bheight = buffer->getHeight();
-		for (i = 0; i < this->m_iterations; i++) {
-			for (y = 0; y < bheight; y++) {
-				for (x = 0; x < bwidth - 1; x++) {
-					p = rectf + (bwidth * y + x);
-					*p = MIN2(*p, *(p + 1));
-				}
+	MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
+	int x, y, i;
+	int width = tile->getWidth();
+	int height = tile->getHeight();
+	float *buffer = tile->getBuffer();
+
+	int half_window = this->m_iterations;
+	int window = half_window * 2 + 1;
+
+	int xmin = max(0, rect->xmin - half_window);
+	int ymin = max(0, rect->ymin - half_window);
+	int xmax = min(width,  rect->xmax + half_window);
+	int ymax = min(height, rect->ymax + half_window);
+
+	int bwidth = rect->xmax - rect->xmin;
+	int bheight = rect->ymax - rect->ymin;
+
+	// Note: Cache buffer has original tilesize width, but new height.
+	// We have to calculate the additional rows in the first pass,
+	// to have valid data available for the second pass.
+	tile_info *result = create_cache(rect->xmin, rect->xmax, ymin, ymax);
+	float *rectf = result->buffer;
+
+	// temp holds maxima for every step in the algorithm, buf holds a
+	// single row or column of input values, padded with MAXFLOATs to
+	// simplify the logic.
+	float *temp = (float *)MEM_mallocN(sizeof(float) * (2 * window - 1), "dilate erode temp");
+	float *buf = (float *)MEM_mallocN(sizeof(float) * (max(bwidth, bheight) + 5 * half_window), "dilate erode buf");
+
+	// The following is based on the van Herk/Gil-Werman algorithm for morphology operations.
+	// first pass, horizontal dilate/erode
+	for (y = ymin; y < ymax; y++) {
+		for (x = 0; x < bwidth + 5 * half_window; x++) {
+			buf[x] = MAXFLOAT;
+		}
+		for (x = xmin; x < xmax; ++x) {
+			buf[x - rect->xmin + window - 1] = buffer[4 * (y * width + x)];
+		}
+
+		for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
+			int start = (i + 1) * window - 1;
+
+			temp[window - 1] = buf[start];
+			for (x = 1; x < window; x++) {
+				temp[window - 1 - x] = min(temp[window - x], buf[start - x]);
+				temp[window - 1 + x] = min(temp[window + x - 2], buf[start + x]);
 			}
-		
-			for (y = 0; y < bheight; y++) {
-				for (x = bwidth - 1; x >= 1; x--) {
-					p = rectf + (bwidth * y + x);
-					*p = MIN2(*p, *(p - 1));
-				}
+
+			start = half_window + (i - 1) * window + 1;
+			for (x = -min(0, start); x < window - max(0, start + window - bwidth); x++) {
+				rectf[bwidth * (y - ymin) + (start + x)] = min(temp[x], temp[x + window - 1]);
 			}
-		
-			for (x = 0; x < bwidth; x++) {
-				for (y = 0; y < bheight - 1; y++) {
-					p = rectf + (bwidth * y + x);
-					*p = MIN2(*p, *(p + bwidth));
-				}
+		}
+	}
+
+	// second pass, vertical dilate/erode
+	for (x = 0; x < bwidth; x++) {
+		for (y = 0; y < bheight + 5 * half_window; y++) {
+			buf[y] = MAXFLOAT;
+		}
+		for (y = ymin; y < ymax; y++) {
+			buf[y - rect->ymin + window - 1] = rectf[(y - ymin) * bwidth + x];
+		}
+
+		for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
+			int start = (i + 1) * window - 1;
+
+			temp[window - 1] = buf[start];
+			for (y = 1; y < window; y++) {
+				temp[window - 1 - y] = min(temp[window - y], buf[start - y]);
+				temp[window - 1 + y] = min(temp[window + y - 2], buf[start + y]);
 			}
-		
-			for (x = 0; x < bwidth; x++) {
-				for (y = bheight - 1; y >= 1; y--) {
-					p = rectf + (bwidth * y + x);
-					*p = MIN2(*p, *(p - bwidth));
-				}
+
+			start = half_window + (i - 1) * window + 1;
+			for (y = -min(0, start); y < window - max(0, start + window - bheight); y++) {
+				rectf[bwidth * (y + start + (rect->ymin - ymin)) + x] = min(temp[y], temp[y + window - 1]);
 			}
 		}
-		this->m_cached_buffer = rectf;
 	}
-	unlockMutex();
-	return this->m_cached_buffer;
+
+	MEM_freeN(temp);
+	MEM_freeN(buf);
+
+	return result;
 }
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.h b/source/blender/compositor/operations/COM_DilateErodeOperation.h
index 47480d4..51bad81 100644
--- a/source/blender/compositor/operations/COM_DilateErodeOperation.h
+++ b/source/blender/compositor/operations/COM_DilateErodeOperation.h
@@ -128,7 +128,6 @@ protected:
 	
 	int m_iterations;
 	
-	float *m_cached_buffer;
 public:
 	DilateStepOperation();
 	
@@ -147,6 +146,7 @@ public:
 	 * Deinitialize the execution
 	 */
 	void deinitExecution();
+	void deinitializeTileData(rcti *rect, void *data);
 	
 	void setIterations(int iterations) { this->m_iterations = iterations; }
 	
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
index 0efead7..aaf5f92 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
@@ -182,8 +182,8 @@ bool GaussianAlphaXBlurOperation::determineDependingAreaOfInterest(rcti *input,
 #endif
 	{
 		if (this->m_sizeavailable && this->m_gausstab != NULL) {
-			newInput.xmax = input->xmax + this->m_rad;
-			newInput.xmin = input->xmin - this->m_rad;
+			newInput.xmax = input->xmax + this->m_rad + 1;
+			newInput.xmin = input->xmin - this->m_rad - 1;
 			newInput.ymax = input->ymax;
 			newInput.ymin = input->ymin;
 		}
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
index 1f9cc8e..650805f 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
@@ -184,8 +184,8 @@ bool GaussianAlphaYBlurOperation::determineDependingAreaOfInterest(rcti *input,
 		if (this->m_sizeavailable && this->m_gausstab != NULL) {
 			newInput.xmax = input->xmax;
 			newInput.xmin = input->xmin;
-			newInput.ymax = input->ymax + this->m_rad;
-			newInput.ymin = input->ymin - this->m_rad;
+			newInput.ymax = input->ymax + this->m_rad + 1;
+			newInput.ymin = input->ymin - this->m_rad - 1;
 		}
 		else {
 			newInput.xmax = this->getWidth();
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
index 573a194..af231d1 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
@@ -133,8 +133,8 @@ bool GaussianXBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadB
 	}
 	{
 		if (this->m_sizeavailable && this->m_gausstab != NULL) {
-			newInput.xmax = input->xmax + this->m_rad;
-			newInput.xmin = input->xmin - this->m_rad;
+			newInput.xmax = input->xmax + this->m_rad + 1;
+			newInput.xmin = input->xmin - this->m_rad - 1;
 			newInput.ymax = input->ymax;
 			newInput.ymin = input->ymin;
 		}
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
index 0c0a4d8..7bf85a9 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
@@ -136,8 +136,8 @@ bool GaussianYBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadB
 		if (this->m_sizeavailable && this->m_gausstab != NULL) {
 			newInput.xmax = input->xmax;
 			newInput.xmin = input->xmin;
-			newInput.ymax = input->ymax + this->m_rad;
-			newInput.ymin = input->ymin - this->m_rad;
+			newInput.ymax = input->ymax + this->m_rad + 1;
+			newInput.ymin = input->ymin - this->m_rad - 1;
 		}
 		else {
 			newInput.xmax = this->getWidth();
diff --git a/source/blender/compositor/operations/COM_InpaintOperation.cpp b/source/blender/compositor/operations/COM_InpaintOperation.cpp
index 81ca06c..edcd156 100644
--- a/source/blender/compositor/operations/COM_InpaintOperation.cpp
+++ b/source/blender/compositor/operations/COM_InpaintOperation.cpp
@@ -84,8 +84,8 @@ float *InpaintSimpleOperation::get_pixel(int x, int y)
 	ASSERT_XY_RANGE(x, y);
 
 	return &this->m_cached_buffer[
-	           y * width * COM_NUMBER_OF_CHANNELS
-	           + x * COM_NUMBER_OF_CHANNELS];
+	        y * width * COM_NUMBER_OF_CHANNELS +
+	        x * COM_NUMBER_OF_CHANNELS];
 }
 
 int InpaintSimpleOperation::mdist(int x, int y) 
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
index 68a61df..863a404 100644
--- a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
@@ -75,9 +75,31 @@ void MovieDistortionOperation::initExecution()
 		                                            calibration_width, calibration_height, this->m_distortion);
 		s_cache.push_back(newC);
 		this->m_cache = newC;
+
+		if (this->m_distortion) {
+			float delta[2];
+			rcti full_frame;
+			full_frame.xmin = full_frame.ymin = 0;
+			full_frame.xmax = this->m_width;
+			full_frame.ymax = this->m_height;
+			BKE_tracking_max_undistortion_delta_across_bound(&this->m_movieClip->tracking, &full_frame, delta);
+
+			/* 5 is just in case we didn't hit real max of distortion in
+			 * BKE_tracking_max_undistortion_delta_across_bound
+			 */
+			m_margin[0] = delta[0] + 5;
+			m_margin[1] = delta[1] + 5;
+		}
+		else {
+			/* undistortion with sane distortion coefficients would be mapped inside
+			 * of each tile, should be no need in margin in this case
+			 */
+			m_margin[0] = m_margin[1] = 0;
+		}
 	}
 	else {
 		this->m_cache = NULL;
+		m_margin[0] = m_margin[1] = 0;
 	}
 }
 
@@ -112,3 +134,13 @@ void MovieDistortionOperation::executePixel(float output[4], float x, float y, P
 		this->m_inputOperation->read(output, x, y, COM_PS_BILINEAR);
 	}
 }
+
+bool MovieDistortionOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+	rcti newInput;
+	newInput.xmin = input->xmin - m_margin[0];
+	newInput.ymin = input->ymin - m_margin[1];
+	newInput.xmax = input->xmax + m_margin[0];
+	newInput.ymax = input->ymax + m_margin[1];
+	return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+}
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.h b/source/blender/compositor/operations/COM_MovieDistortionOperation.h
index 9f8aa06..c962945 100644
--- a/source/blender/compositor/operations/COM_MovieDistortionOperation.h
+++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.h
@@ -148,6 +148,7 @@ private:
 	DistortionCache *m_cache;
 	SocketReader *m_inputOperation;
 	MovieClip *m_movieClip;
+	int m_margin[2];
 
 protected:
 	bool m_distortion;
@@ -162,6 +163,8 @@ public:
 	
 	void setMovieClip(MovieClip *clip) { this->m_movieClip = clip; }
 	void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
+	bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
+
 };
 
 void deintializeDistortionCache(void);
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp
index f8d6c0c..23a3abe 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cpp
+++ b/source/blender/compositor/operations/COM_TextureOperation.cpp
@@ -23,6 +23,7 @@
 #include "COM_TextureOperation.h"
 
 #include "BLI_listbase.h"
+#include "BKE_image.h"
 
 TextureBaseOperation::TextureBaseOperation() : NodeOperation()
 {
@@ -46,11 +47,14 @@ void TextureBaseOperation::initExecution()
 {
 	this->m_inputOffset = getInputSocketReader(0);
 	this->m_inputSize = getInputSocketReader(1);
+	this->m_pool = BKE_image_pool_new();
 }
 void TextureBaseOperation::deinitExecution()
 {
 	this->m_inputSize = NULL;
 	this->m_inputOffset = NULL;
+	BKE_image_pool_free(this->m_pool);
+	this->m_pool = NULL;
 }
 
 void TextureBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
@@ -95,7 +99,7 @@ void TextureBaseOperation::executePixel(float output[4], float x, float y, Pixel
 	vec[1] = textureSize[1] * (v + textureOffset[1]);
 	vec[2] = textureSize[2] * textureOffset[2];
 
-	retval = multitex_ext(this->m_texture, vec, NULL, NULL, 0, &texres);
+	retval = multitex_ext(this->m_texture, vec, NULL, NULL, 0, &texres, m_pool);
 
 	if (texres.talpha)
 		output[3] = texres.ta;
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index f8435ec..227ad37 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -45,6 +45,7 @@ private:
 	const RenderData *m_rd;
 	SocketReader *m_inputSize;
 	SocketReader *m_inputOffset;
+	struct ImagePool *m_pool;
 
 protected:
 
diff --git a/source/blender/compositor/operations/COM_TranslateOperation.cpp b/source/blender/compositor/operations/COM_TranslateOperation.cpp
index 761f55a..9f6924e 100644
--- a/source/blender/compositor/operations/COM_TranslateOperation.cpp
+++ b/source/blender/compositor/operations/COM_TranslateOperation.cpp
@@ -15,9 +15,10 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * Contributor: 
- *		Jeroen Bakker 
+ * Contributor:
+ *		Jeroen Bakker
  *		Monique Dewanchand
+ *		Thomas Beck (plasmasolutions.de)
  */
 
 #include "COM_TranslateOperation.h"
@@ -33,6 +34,8 @@ TranslateOperation::TranslateOperation() : NodeOperation()
 	this->m_inputXOperation = NULL;
 	this->m_inputYOperation = NULL;
 	this->m_isDeltaSet = false;
+	this->m_factorX = 1.0f;
+	this->m_factorY = 1.0f;
 }
 void TranslateOperation::initExecution()
 {
@@ -40,6 +43,7 @@ void TranslateOperation::initExecution()
 	this->m_inputXOperation = this->getInputSocketReader(1);
 	this->m_inputYOperation = this->getInputSocketReader(2);
 
+	ensureDelta();
 }
 
 void TranslateOperation::deinitExecution()
@@ -53,18 +57,30 @@ void TranslateOperation::deinitExecution()
 void TranslateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
 {
 	ensureDelta();
-	this->m_inputOperation->read(output, x - this->getDeltaX(), y - this->getDeltaY(), sampler);
+
+	float originalXPos = x - this->getDeltaX();
+	float originalYPos = y - this->getDeltaY();
+
+	this->m_inputOperation->read(output, originalXPos, originalYPos, sampler);
 }
 
 bool TranslateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
 {
-	ensureDelta();
 	rcti newInput;
-	
-	newInput.xmax = input->xmax - this->getDeltaX();
+
+	ensureDelta();
+
 	newInput.xmin = input->xmin - this->getDeltaX();
-	newInput.ymax = input->ymax - this->getDeltaY();
+	newInput.xmax = input->xmax - this->getDeltaX();
 	newInput.ymin = input->ymin - this->getDeltaY();
-	
+	newInput.ymax = input->ymax - this->getDeltaY();
+
 	return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
+
+void TranslateOperation::setFactorXY(float factorX, float factorY)
+{
+	m_factorX = factorX;
+	m_factorY = factorY;
+}
+
diff --git a/source/blender/compositor/operations/COM_TranslateOperation.h b/source/blender/compositor/operations/COM_TranslateOperation.h
index faaadb1..d53c3e4 100644
--- a/source/blender/compositor/operations/COM_TranslateOperation.h
+++ b/source/blender/compositor/operations/COM_TranslateOperation.h
@@ -33,6 +33,10 @@ private:
 	float m_deltaX;
 	float m_deltaY;
 	bool m_isDeltaSet;
+	float m_relativeOffsetX;
+	float m_relativeOffsetY;
+	float m_factorX;
+	float m_factorY;
 public:
 	TranslateOperation();
 	bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
@@ -41,8 +45,8 @@ public:
 	void initExecution();
 	void deinitExecution();
 
-	float getDeltaX() { return this->m_deltaX; }
-	float getDeltaY() { return this->m_deltaY; }
+	float getDeltaX() { return this->m_deltaX * this->m_factorX; }
+	float getDeltaY() { return this->m_deltaY * this->m_factorY; }
 	
 	inline void ensureDelta() {
 		if (!this->m_isDeltaSet) {
@@ -54,6 +58,8 @@ public:
 			this->m_isDeltaSet = true;
 		}
 	}
+
+	void setFactorXY(float factorX, float factorY);
 };
 
 #endif
diff --git a/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp b/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp
index d5f2c28..0722469 100644
--- a/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp
@@ -48,6 +48,7 @@ ViewerBaseOperation::ViewerBaseOperation() : NodeOperation()
 	this->m_doDepthBuffer = false;
 	this->m_viewSettings = NULL;
 	this->m_displaySettings = NULL;
+	this->m_ignoreAlpha = false;
 }
 
 void ViewerBaseOperation::initExecution()
diff --git a/source/blender/compositor/operations/COM_ViewerBaseOperation.h b/source/blender/compositor/operations/COM_ViewerBaseOperation.h
index f7d479e..9f7e80a 100644
--- a/source/blender/compositor/operations/COM_ViewerBaseOperation.h
+++ b/source/blender/compositor/operations/COM_ViewerBaseOperation.h
@@ -39,6 +39,7 @@ protected:
 	OrderOfChunks m_chunkOrder;
 	bool m_doDepthBuffer;
 	ImBuf *m_ibuf;
+	bool m_ignoreAlpha;
 
 	const ColorManagedViewSettings *m_viewSettings;
 	const ColorManagedDisplaySettings *m_displaySettings;
@@ -59,6 +60,7 @@ public:
 	OrderOfChunks getChunkOrder() { return this->m_chunkOrder; }
 	const CompositorPriority getRenderPriority() const;
 	bool isViewerOperation() { return true; }
+	void setIgnoreAlpha(bool value) { this->m_ignoreAlpha = value; }
 
 	void setViewSettings(const ColorManagedViewSettings *viewSettings) { this->m_viewSettings = viewSettings; }
 	void setDisplaySettings(const ColorManagedDisplaySettings *displaySettings) { this->m_displaySettings = displaySettings; }
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp
index d1ac7d7..4d10e49 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.cpp
+++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp
@@ -89,9 +89,14 @@ void ViewerOperation::executeRegion(rcti *rect, unsigned int tileNumber)
 	for (y = y1; y < y2 && (!breaked); y++) {
 		for (x = x1; x < x2; x++) {
 			this->m_imageInput->read(&(buffer[offset4]), x, y, COM_PS_NEAREST);
-			if (this->m_alphaInput != NULL) {
-				this->m_alphaInput->read(alpha, x, y, COM_PS_NEAREST);
-				buffer[offset4 + 3] = alpha[0];
+			if (this->m_ignoreAlpha) {
+				buffer[offset4 + 3] = 1.0f;
+			}
+			else {
+				if (this->m_alphaInput != NULL) {
+					this->m_alphaInput->read(alpha, x, y, COM_PS_NEAREST);
+					buffer[offset4 + 3] = alpha[0];
+				}
 			}
 			if (m_depthInput) {
 				this->m_depthInput->read(depth, x, y, COM_PS_NEAREST);
diff --git a/source/blender/compositor/operations/COM_WrapOperation.cpp b/source/blender/compositor/operations/COM_WrapOperation.cpp
new file mode 100644
index 0000000..37a9352
--- /dev/null
+++ b/source/blender/compositor/operations/COM_WrapOperation.cpp
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor:
+ *		Jeroen Bakker
+ *		Monique Dewanchand
+ *		Thomas Beck (plasmasolutions.de)
+ */
+
+#include "COM_WrapOperation.h"
+
+WrapOperation::WrapOperation() : NodeOperation()
+{
+	this->addInputSocket(COM_DT_COLOR);
+	this->addOutputSocket(COM_DT_COLOR);
+	this->setResolutionInputSocketIndex(0);
+	this->m_inputOperation = NULL;
+}
+void WrapOperation::initExecution()
+{
+	this->m_inputOperation = this->getInputSocketReader(0);
+}
+
+void WrapOperation::deinitExecution()
+{
+	this->m_inputOperation = NULL;
+}
+
+inline float WrapOperation::getWrappedOriginalXPos(float x)
+{
+	while (x < 0) x += this->m_width;
+	return fmodf(x, this->getWidth());
+}
+
+inline float WrapOperation::getWrappedOriginalYPos(float y)
+{
+	while (y < 0) y += this->m_height;
+	return fmodf(y, this->getHeight());
+}
+
+void WrapOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
+{
+	float nx, ny;
+	nx = x;
+	ny = y;
+	switch (m_wrappingType) {
+		case CMP_NODE_WRAP_NONE:
+			//Intentionally empty, originalXPos and originalYPos have been set before
+			break;
+		case CMP_NODE_WRAP_X:
+			// wrap only on the x-axis
+			nx = this->getWrappedOriginalXPos(x);
+			break;
+		case CMP_NODE_WRAP_Y:
+			// wrap only on the y-axis
+			ny = this->getWrappedOriginalYPos(y);
+			break;
+		case CMP_NODE_WRAP_XY:
+			// wrap on both
+			nx = this->getWrappedOriginalXPos(x);
+			ny = this->getWrappedOriginalYPos(y);
+			break;
+	}
+
+	this->m_inputOperation->read(output, nx, ny, sampler);
+
+}
+
+bool WrapOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+	rcti newInput;
+
+	newInput.xmin = input->xmin;
+	newInput.xmax = input->xmax;
+	newInput.ymin = input->ymin;
+	newInput.ymax = input->ymax;
+
+	if (m_wrappingType == 1 || m_wrappingType == 3) {
+		// wrap only on the x-axis if tile is wrapping
+		newInput.xmin = getWrappedOriginalXPos(input->xmin);
+		newInput.xmax = getWrappedOriginalXPos(input->xmax);
+		if (newInput.xmin > newInput.xmax) {
+			newInput.xmin = 0;
+			newInput.xmax = this->getWidth();
+		}
+	}
+	if (m_wrappingType == 2 || m_wrappingType == 3) {
+		// wrap only on the y-axis if tile is wrapping
+		newInput.ymin = getWrappedOriginalYPos(input->ymin);
+		newInput.ymax = getWrappedOriginalYPos(input->ymax);
+		if (newInput.ymin > newInput.ymax) {
+			newInput.ymin = 0;
+			newInput.ymax = this->getHeight();
+		}
+	}
+
+	return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+}
+
+void WrapOperation::setWrapping(int wrapping_type)
+{
+	m_wrappingType = wrapping_type;
+}
diff --git a/source/blender/compositor/operations/COM_WrapOperation.h b/source/blender/compositor/operations/COM_WrapOperation.h
new file mode 100644
index 0000000..b84d85e
--- /dev/null
+++ b/source/blender/compositor/operations/COM_WrapOperation.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: 
+ *		Jeroen Bakker 
+ *		Monique Dewanchand
+ */
+
+#ifndef _COM_WrapOperation_h_
+#define _COM_WrapOperation_h_
+
+#include "COM_NodeOperation.h"
+
+class WrapOperation : public NodeOperation {
+private:
+	SocketReader *m_inputOperation;
+	int m_wrappingType;
+public:
+	WrapOperation();
+	bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
+	void executePixel(float output[4], float x, float y, PixelSampler sampler);
+
+	void initExecution();
+	void deinitExecution();
+
+	void setWrapping(int wrapping_type);
+	float getWrappedOriginalXPos(float x);
+	float getWrappedOriginalYPos(float y);
+
+	void setFactorXY(float factorX, float factorY);
+};
+
+#endif
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index d83d180..eb1f5ef 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -399,20 +399,23 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short rest
 static short bezt_unit_mapping_apply(KeyframeEditData *ked, BezTriple *bezt)
 {
 	/* mapping factor is stored in f1, flags are stored in i1 */
-	short only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS);
-	short sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS);
+	const bool only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS);
+	const bool sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS);
+	const bool skip_knot = (ked->i1 & ANIM_UNITCONV_SKIPKNOTS);
 	float fac = ked->f1;
 	
 	/* adjust BezTriple handles only if allowed to */
-	if (only_keys == 0) {
-		if ((sel_vs == 0) || (bezt->f1 & SELECT))
+	if (only_keys == false) {
+		if ((sel_vs == false) || (bezt->f1 & SELECT))
 			bezt->vec[0][1] *= fac;
-		if ((sel_vs == 0) || (bezt->f3 & SELECT))
+		if ((sel_vs == false) || (bezt->f3 & SELECT))
 			bezt->vec[2][1] *= fac;
 	}
 	
-	if ((sel_vs == 0) || (bezt->f2 & SELECT))
-		bezt->vec[1][1] *= fac;
+	if (skip_knot == false) {
+		if ((sel_vs == false) || (bezt->f2 & SELECT))
+			bezt->vec[1][1] *= fac;
+	}
 	
 	return 0;
 }
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index f684e57..62725cb 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -41,6 +41,7 @@
 #include "RNA_enum_types.h"
 
 #include "BLI_blenlib.h"
+#include "BLI_math_base.h"
 #include "BLI_utildefines.h"
 
 #include "BKE_context.h"
@@ -146,16 +147,15 @@ int ED_markers_post_apply_transform(ListBase *markers, Scene *scene, int mode, f
 						marker->frame += (int)floorf(value + 0.5f);
 						changed++;
 					}
+					break;
 				}
-				break;
-					
 				case TFM_TIME_SCALE:
 				{
 					/* rescale the distance between the marker and the current frame */
 					marker->frame = cfra + (int)floorf(((float)(marker->frame - cfra) * value) + 0.5f);
 					changed++;
+					break;
 				}
-				break;
 			}
 		}
 	}
@@ -402,17 +402,22 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
 	/* and the marker name too, shifted slightly to the top-right */
 	if (marker->name && marker->name[0]) {
 		float x, y;
+
+		/* minimal y coordinate which wouldn't be occluded by scroll */
+		int min_y = 17.0f * UI_DPI_FAC;
 		
 		if (marker->flag & SELECT) {
 			UI_ThemeColor(TH_TEXT_HI);
 			x = xpos * xscale + 4.0f * UI_DPI_FAC;
 			y = (ypixels <= 39.0f * UI_DPI_FAC) ? (ypixels - 10.0f * UI_DPI_FAC) : 29.0f * UI_DPI_FAC;
+			y = max_ii(y, min_y);
 		}
 		else {
 			UI_ThemeColor(TH_TEXT);
 			if ((marker->frame <= cfra) && (marker->frame + 5 > cfra)) {
 				x = xpos * xscale + 8.0f * UI_DPI_FAC;
 				y = (ypixels <= 39.0f * UI_DPI_FAC) ? (ypixels - 10.0f * UI_DPI_FAC) : 29.0f * UI_DPI_FAC;
+				y = max_ii(y, min_y);
 			}
 			else {
 				x = xpos * xscale + 8.0f * UI_DPI_FAC;
@@ -1203,7 +1208,7 @@ static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, w
 static void MARKER_OT_select_border(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Marker Border select";
+	ot->name = "Marker Border Select";
 	ot->description = "Select all time markers using border selection";
 	ot->idname = "MARKER_OT_select_border";
 	
@@ -1260,7 +1265,7 @@ static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
 static void MARKER_OT_select_all(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "(De)select all markers";
+	ot->name = "(De)select all Markers";
 	ot->description = "Change selection of all time markers";
 	ot->idname = "MARKER_OT_select_all";
 	
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 6bd774e..cc2366a 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -327,88 +327,7 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short
 	uiItemR(col, &ptr, "depth", 0, NULL, ICON_NONE);
 }
 
-/* --------------- */
-
-#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001f
-
-/* Binary search algorithm for finding where to insert Envelope Data Point.
- * Returns the index to insert at (data already at that index will be offset if replace is 0)
- */
-static int binarysearch_fcm_envelopedata_index(FCM_EnvelopeData array[], float frame, int arraylen, short *exists)
-{
-	int start = 0, end = arraylen;
-	int loopbreaker = 0, maxloop = arraylen * 2;
-	
-	/* initialize exists-flag first */
-	*exists = 0;
-	
-	/* sneaky optimizations (don't go through searching process if...):
-	 *	- keyframe to be added is to be added out of current bounds
-	 *	- keyframe to be added would replace one of the existing ones on bounds
-	 */
-	if ((arraylen <= 0) || (array == NULL)) {
-		printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array\n");
-		return 0;
-	}
-	else {
-		/* check whether to add before/after/on */
-		float framenum;
-		
-		/* 'First' Point (when only one point, this case is used) */
-		framenum = array[0].time;
-		if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
-			*exists = 1;
-			return 0;
-		}
-		else if (frame < framenum)
-			return 0;
-			
-		/* 'Last' Point */
-		framenum = array[(arraylen - 1)].time;
-		if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
-			*exists = 1;
-			return (arraylen - 1);
-		}
-		else if (frame > framenum)
-			return arraylen;
-	}
-	
-	
-	/* most of the time, this loop is just to find where to put it
-	 *  - 'loopbreaker' is just here to prevent infinite loops
-	 */
-	for (loopbreaker = 0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) {
-		/* compute and get midpoint */
-		int mid = start + ((end - start) / 2);  /* we calculate the midpoint this way to avoid int overflows... */
-		float midfra = array[mid].time;
-		
-		/* check if exactly equal to midpoint */
-		if (IS_EQT(frame, midfra, BINARYSEARCH_FRAMEEQ_THRESH)) {
-			*exists = 1;
-			return mid;
-		}
-		
-		/* repeat in upper/lower half */
-		if (frame > midfra)
-			start = mid + 1;
-		else if (frame < midfra)
-			end = mid - 1;
-	}
-	
-	/* print error if loop-limit exceeded */
-	if (loopbreaker == (maxloop - 1)) {
-		printf("Error: binarysearch_fcm_envelopedata_index() was taking too long\n");
-		
-		// include debug info 
-		printf("\tround = %d: start = %d, end = %d, arraylen = %d\n", loopbreaker, start, end, arraylen);
-	}
-	
-	/* not found, so return where to place it */
-	return start;
-}
-
 /* callback to add new envelope data point */
-// TODO: should we have a separate file for things like this?
 static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void *UNUSED(arg))
 {
 	Scene *scene = CTX_data_scene(C);
@@ -425,7 +344,7 @@ static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void *UNUSED(ar
 	/* check that no data exists for the current frame... */
 	if (env->data) {
 		short exists = -1;
-		int i = binarysearch_fcm_envelopedata_index(env->data, (float)(scene->r.cfra), env->totvert, &exists);
+		int i = BKE_fcm_envelope_find_index(env->data, (float)(scene->r.cfra), env->totvert, &exists);
 		
 		/* binarysearch_...() will set exists by default to 0, so if it is non-zero, that means that the point exists already */
 		if (exists)
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 015c266..decbc35 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -300,7 +300,14 @@ static short summary_keyframes_loop(KeyframeEditData *ked, bAnimContext *ac, Key
 	
 	/* loop through each F-Curve, working on the keyframes until the first curve aborts */
 	for (ale = anim_data.first; ale; ale = ale->next) {
-		ret_code = ANIM_fcurve_keyframes_loop(ked, ale->data, key_ok, key_cb, fcu_cb);
+		switch (ale->datatype) {
+			case ALE_MASKLAY:
+			case ALE_GPFRAME:
+				break;
+			default:
+				ret_code = ANIM_fcurve_keyframes_loop(ked, ale->data, key_ok, key_cb, fcu_cb);
+				break;
+		}
 		
 		if (ret_code)
 			break;
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 9add193..c99f939 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -52,6 +52,7 @@
 #include "DNA_material_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
+#include "DNA_rigidbody_types.h"
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
@@ -142,7 +143,7 @@ bAction *verify_adt_action(ID *id, short add)
 	if ((adt->action == NULL) && (add)) {
 		char actname[sizeof(id->name) - 2];
 		BLI_snprintf(actname, sizeof(actname), "%sAction", id->name + 2);
-		adt->action = add_empty_action(actname);
+		adt->action = add_empty_action(G.main, actname);
 	}
 		
 	/* return the action */
@@ -550,11 +551,12 @@ enum {
  * blocktypes, when using "standard" keying but 'Visual Keying' option in Auto-Keying 
  * settings is on.
  */
-static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
+static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
 {
 	bConstraint *con = NULL;
 	short searchtype = VISUALKEY_NONE;
-	short has_parent = FALSE;
+	bool has_rigidbody = false;
+	bool has_parent = false;
 	const char *identifier = NULL;
 	
 	/* validate data */
@@ -569,10 +571,14 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
 	if (ptr->type == &RNA_Object) {
 		/* Object */
 		Object *ob = (Object *)ptr->data;
+		RigidBodyOb *rbo = ob->rigidbody_object;
 		
 		con = ob->constraints.first;
 		identifier = RNA_property_identifier(prop);
 		has_parent = (ob->parent != NULL);
+		
+		/* active rigidbody objects only, as only those are affected by sim */
+		has_rigidbody = ((rbo) && (rbo->type == RBO_TYPE_ACTIVE));
 	}
 	else if (ptr->type == &RNA_PoseBone) {
 		/* Pose Channel */
@@ -584,13 +590,13 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
 	}
 	
 	/* check if any data to search using */
-	if (ELEM(NULL, con, identifier) && (has_parent == FALSE))
-		return 0;
+	if (ELEM(NULL, con, identifier) && (has_parent == false) && (has_rigidbody == false))
+		return false;
 	
 	/* location or rotation identifiers only... */
 	if (identifier == NULL) {
 		printf("%s failed: NULL identifier\n", __func__);
-		return 0;
+		return false;
 	}
 	else if (strstr(identifier, "location")) {
 		searchtype = VISUALKEY_LOC;
@@ -603,15 +609,15 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
 	}
 	else {
 		printf("%s failed: identifier - '%s'\n", __func__, identifier);
-		return 0;
+		return false;
 	}
 	
 	
 	/* only search if a searchtype and initial constraint are available */
 	if (searchtype) {
-		/* parent is always matching */
-		if (has_parent)
-			return 1;
+		/* parent or rigidbody are always matching */
+		if (has_parent || has_rigidbody)
+			return true;
 		
 		/* constraints */
 		for (; con; con = con->next) {
@@ -623,48 +629,48 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
 			switch (con->type) {
 				/* multi-transform constraints */
 				case CONSTRAINT_TYPE_CHILDOF:
-					return 1;
+					return true;
 				case CONSTRAINT_TYPE_TRANSFORM:
 				case CONSTRAINT_TYPE_TRANSLIKE:
-					return 1;
+					return true;
 				case CONSTRAINT_TYPE_FOLLOWPATH:
-					return 1;
+					return true;
 				case CONSTRAINT_TYPE_KINEMATIC:
-					return 1;
+					return true;
 				
 				/* single-transform constraits  */
 				case CONSTRAINT_TYPE_TRACKTO:
-					if (searchtype == VISUALKEY_ROT) return 1;
+					if (searchtype == VISUALKEY_ROT) return true;
 					break;
 				case CONSTRAINT_TYPE_DAMPTRACK:
-					if (searchtype == VISUALKEY_ROT) return 1;
+					if (searchtype == VISUALKEY_ROT) return true;
 					break;
 				case CONSTRAINT_TYPE_ROTLIMIT:
-					if (searchtype == VISUALKEY_ROT) return 1;
+					if (searchtype == VISUALKEY_ROT) return true;
 					break;
 				case CONSTRAINT_TYPE_LOCLIMIT:
-					if (searchtype == VISUALKEY_LOC) return 1;
+					if (searchtype == VISUALKEY_LOC) return true;
 					break;
 				case CONSTRAINT_TYPE_SIZELIMIT:
-					if (searchtype == VISUALKEY_SCA) return 1;
+					if (searchtype == VISUALKEY_SCA) return true;
 					break;
 				case CONSTRAINT_TYPE_DISTLIMIT:
-					if (searchtype == VISUALKEY_LOC) return 1;
+					if (searchtype == VISUALKEY_LOC) return true;
 					break;
 				case CONSTRAINT_TYPE_ROTLIKE:
-					if (searchtype == VISUALKEY_ROT) return 1;
+					if (searchtype == VISUALKEY_ROT) return true;
 					break;
 				case CONSTRAINT_TYPE_LOCLIKE:
-					if (searchtype == VISUALKEY_LOC) return 1;
+					if (searchtype == VISUALKEY_LOC) return true;
 					break;
 				case CONSTRAINT_TYPE_SIZELIKE:
-					if (searchtype == VISUALKEY_SCA) return 1;
+					if (searchtype == VISUALKEY_SCA) return true;
 					break;
 				case CONSTRAINT_TYPE_LOCKTRACK:
-					if (searchtype == VISUALKEY_ROT) return 1;
+					if (searchtype == VISUALKEY_ROT) return true;
 					break;
 				case CONSTRAINT_TYPE_MINMAX:
-					if (searchtype == VISUALKEY_LOC) return 1;
+					if (searchtype == VISUALKEY_LOC) return true;
 					break;
 				
 				default:
@@ -673,8 +679,8 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
 		}
 	}
 	
-	/* when some condition is met, this function returns, so here it can be 0 */
-	return 0;
+	/* when some condition is met, this function returns, so that means we've got nothing */
+	return false;
 }
 
 /* This helper function extracts the value to use for visual-keyframing 
@@ -696,12 +702,12 @@ static float visualkey_get_value(PointerRNA *ptr, PropertyRNA *prop, int array_i
 	 */
 	if (ptr->type == &RNA_Object) {
 		Object *ob = (Object *)ptr->data;
-
+		
 		/* Loc code is specific... */
 		if (strstr(identifier, "location")) {
 			return ob->obmat[3][array_index];
 		}
-
+		
 		copy_m4_m4(tmat, ob->obmat);
 		rotmode = ob->rotmode;
 	}
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 4a987d1..06e00cd 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -563,7 +563,9 @@ void docenter_armature(Scene *scene, Object *ob, float cursor[3], int centermode
 				add_v3_v3(cent, ebone->head);
 				add_v3_v3(cent, ebone->tail);
 			}
-			mul_v3_fl(cent, 1.0f / (float)total);
+			if (total) {
+				mul_v3_fl(cent, 1.0f / (float)total);
+			}
 		}
 		else {
 			float min[3], max[3];
@@ -2002,7 +2004,7 @@ float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const short
 
 	sub_v3_v3v3(nor, bone->tail, bone->head);
 	vec_roll_to_mat3(nor, 0.0f, mat);
-
+	
 	/* check the bone isn't aligned with the axis */
 	if (!is_zero_v3(align_axis) && angle_v3v3(align_axis, mat[2]) > FLT_EPSILON) {
 		float vec[3], align_axis_proj[3], roll;
@@ -2266,7 +2268,7 @@ EditBone *ED_armature_edit_bone_add(bArmature *arm, const char *name)
 	
 	BLI_addtail(arm->edbo, bone);
 	
-	bone->flag |= BONE_TIPSEL | BONE_RELATIVE_PARENTING;
+	bone->flag |= BONE_TIPSEL;
 	bone->weight = 1.0f;
 	bone->dist = 0.25f;
 	bone->xwidth = 0.1f;
@@ -3420,7 +3422,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
 						copy_v3_v3(newbone->tail, ebone->head);
 						newbone->parent = ebone->parent;
 						
-						newbone->flag = BONE_TIPSEL | BONE_RELATIVE_PARENTING;
+						newbone->flag = BONE_TIPSEL;
 						
 						if (newbone->parent && (ebone->flag & BONE_CONNECTED)) {
 							newbone->flag |= BONE_CONNECTED;
@@ -3658,6 +3660,16 @@ void ARMATURE_OT_subdivide(wmOperatorType *ot)
  * easy to retrieve any hierarchical/chain relationships which are necessary for
  * this to be done easily.
  */
+ 
+/* helper to clear BONE_TRANSFORM flags */
+static void armature_clear_swap_done_flags(bArmature *arm)
+{
+	EditBone *ebone;
+	
+	for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
+		ebone->flag &= ~BONE_TRANSFORM;
+	}
+}
 
 static int armature_switch_direction_exec(bContext *C, wmOperator *UNUSED(op)) 
 {
@@ -3669,9 +3681,16 @@ static int armature_switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
 	/* get chains of bones (ends on chains) */
 	chains_find_tips(arm->edbo, &chains);
 	if (chains.first == NULL) return OPERATOR_CANCELLED;
-
+	
+	/* ensure that mirror bones will also be operated on */
 	armature_tag_select_mirrored(arm);
-
+	
+	/* clear BONE_TRANSFORM flags 
+	 * - used to prevent duplicate/cancelling operations from occurring [#34123] 
+	 * - BONE_DONE cannot be used here as that's already used for mirroring
+	 */
+	armature_clear_swap_done_flags(arm);
+	
 	/* loop over chains, only considering selected and visible bones */
 	for (chain = chains.first; chain; chain = chain->next) {
 		EditBone *ebo, *child = NULL, *parent = NULL;
@@ -3684,51 +3703,59 @@ static int armature_switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
 			 */
 			parent = ebo->parent;
 			
-			/* only if selected and editable */
-			if (EBONE_VISIBLE(arm, ebo) && EBONE_EDITABLE(ebo)) {
-				/* swap head and tail coordinates */
-				SWAP(float, ebo->head[0], ebo->tail[0]);
-				SWAP(float, ebo->head[1], ebo->tail[1]);
-				SWAP(float, ebo->head[2], ebo->tail[2]);
-				
-				/* do parent swapping:
-				 *	- use 'child' as new parent
-				 *	- connected flag is only set if points are coincidental
-				 */
-				ebo->parent = child;
-				if ((child) && equals_v3v3(ebo->head, child->tail))
-					ebo->flag |= BONE_CONNECTED;
-				else
-					ebo->flag &= ~BONE_CONNECTED;
-				
-				/* get next bones 
-				 *	- child will become the new parent of next bone
-				 */
-				child = ebo;
-			}
-			else {
-				/* not swapping this bone, however, if its 'parent' got swapped, unparent us from it 
-				 * as it will be facing in opposite direction
-				 */
-				if ((parent) && (EBONE_VISIBLE(arm, parent) && EBONE_EDITABLE(parent))) {
-					ebo->parent = NULL;
-					ebo->flag &= ~BONE_CONNECTED;
+			/* skip bone if already handled... [#34123] */
+			if ((ebo->flag & BONE_TRANSFORM) == 0) {
+				/* only if selected and editable */
+				if (EBONE_VISIBLE(arm, ebo) && EBONE_EDITABLE(ebo)) {
+					/* swap head and tail coordinates */
+					SWAP(float, ebo->head[0], ebo->tail[0]);
+					SWAP(float, ebo->head[1], ebo->tail[1]);
+					SWAP(float, ebo->head[2], ebo->tail[2]);
+					
+					/* do parent swapping:
+					 *	- use 'child' as new parent
+					 *	- connected flag is only set if points are coincidental
+					 */
+					ebo->parent = child;
+					if ((child) && equals_v3v3(ebo->head, child->tail))
+						ebo->flag |= BONE_CONNECTED;
+					else
+						ebo->flag &= ~BONE_CONNECTED;
+					
+					/* get next bones 
+					 *	- child will become the new parent of next bone
+					 */
+					child = ebo;
+				}
+				else {
+					/* not swapping this bone, however, if its 'parent' got swapped, unparent us from it 
+					 * as it will be facing in opposite direction
+					 */
+					if ((parent) && (EBONE_VISIBLE(arm, parent) && EBONE_EDITABLE(parent))) {
+						ebo->parent = NULL;
+						ebo->flag &= ~BONE_CONNECTED;
+					}
+					
+					/* get next bones
+					 *	- child will become new parent of next bone (not swapping occurred, 
+					 *	  so set to NULL to prevent infinite-loop)
+					 */
+					child = NULL;
 				}
 				
-				/* get next bones
-				 *	- child will become new parent of next bone (not swapping occurred, 
-				 *	  so set to NULL to prevent infinite-loop)
-				 */
-				child = NULL;
+				/* tag as done (to prevent double-swaps) */
+				ebo->flag |= BONE_TRANSFORM;
 			}
 		}
 	}
 	
 	/* free chains */
 	BLI_freelistN(&chains);
-
+	
+	/* clear temp flags */
+	armature_clear_swap_done_flags(arm);
 	armature_tag_unselect(arm);
-
+	
 	/* note, notifier might evolve */
 	WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
 	
@@ -4997,13 +5024,18 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob,
 	bArmature *arm = par->data;
 
 	if (mode == ARM_GROUPS_NAME) {
+		const int defbase_tot = BLI_countlist(&ob->defbase);
+		int defbase_add;
 		/* Traverse the bone list, trying to create empty vertex 
 		 * groups corresponding to the bone.
 		 */
-		bone_looper(ob, arm->bonebase.first, NULL, vgroup_add_unique_bone_cb);
+		defbase_add = bone_looper(ob, arm->bonebase.first, NULL, vgroup_add_unique_bone_cb);
 
-		if (ob->type == OB_MESH)
-			ED_vgroup_data_create(ob->data);
+		if (defbase_add) {
+			/* its possible there are DWeight's outside the range of the current
+			 * objects deform groups, in this case the new groups wont be empty [#33889] */
+			ED_vgroup_data_clamp_range(ob->data, defbase_tot);
+		}
 	}
 	else if (mode == ARM_GROUPS_ENVELOPE || mode == ARM_GROUPS_AUTO) {
 		/* Traverse the bone list, trying to create vertex groups 
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 04815b9..48c0a4a 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -54,6 +54,7 @@
 #include "BKE_action.h"
 #include "BKE_armature.h"
 #include "BKE_depsgraph.h"
+#include "BKE_global.h"
 #include "BKE_idprop.h"
 #include "BKE_library.h"
 #include "BKE_object.h"
@@ -196,7 +197,7 @@ static bAction *poselib_init_new(Object *ob)
 	/* init object's poselib action (unlink old one if there) */
 	if (ob->poselib)
 		id_us_min(&ob->poselib->id);
-	ob->poselib = add_empty_action("PoseLib");
+	ob->poselib = add_empty_action(G.main, "PoseLib");
 	
 	return ob->poselib;
 }
@@ -662,7 +663,7 @@ static int poselib_rename_exec(bContext *C, wmOperator *op)
 	}
 	
 	/* get index (and pointer) of pose to remove */
-	marker = BLI_findlink(&act->markers, RNA_int_get(op->ptr, "pose"));
+	marker = BLI_findlink(&act->markers, RNA_enum_get(op->ptr, "pose"));
 	if (marker == NULL) {
 		BKE_report(op->reports, RPT_ERROR, "Invalid index for pose");
 		return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 3892410..c7d1e42 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -238,7 +238,7 @@ static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNU
 	
 	/* show popup dialog to allow editing of range... */
 	// FIXME: hardcoded dimensions here are just arbitrary
-	return WM_operator_props_dialog_popup(C, op, 200, 200);
+	return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 10 * UI_UNIT_Y);
 }
 
 /* For the object with pose/action: create path curves for selected bones 
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 69c4b38..e736c49 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1279,8 +1279,24 @@ void CU_deselect_all(Object *obedit)
 	ListBase *editnurb = object_editcurve_get(obedit);
 
 	if (editnurb) {
-		selectend_nurb(obedit, FIRST, 0, DESELECT); /* set first control points as unselected */
-		select_adjacent_cp(editnurb, 1, 1, DESELECT); /* cascade selection */
+		Nurb *nu;
+		int a;
+		for (nu = editnurb->first; nu; nu = nu->next) {
+			if (nu->bezt) {
+				BezTriple *bezt;
+				for (bezt = nu->bezt, a = 0; a < nu->pntsu; a++, bezt++) {
+					bezt->f1 &= ~SELECT;
+					bezt->f2 &= ~SELECT;
+					bezt->f3 &= ~SELECT;
+				}
+			}
+			else if (nu->bp) {
+				BPoint *bp;
+				for (bp = nu->bp, a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) {
+					bp->f1 &= ~SELECT;
+				}
+			}
+		}
 	}
 }
 
@@ -1289,8 +1305,27 @@ void CU_select_all(Object *obedit)
 	ListBase *editnurb = object_editcurve_get(obedit);
 
 	if (editnurb) {
-		selectend_nurb(obedit, FIRST, 0, SELECT); /* set first control points as unselected */
-		select_adjacent_cp(editnurb, 1, 1, SELECT); /* cascade selection */
+		Nurb *nu;
+		int a;
+		for (nu = editnurb->first; nu; nu = nu->next) {
+			if (nu->bezt) {
+				BezTriple *bezt;
+				for (bezt = nu->bezt, a = 0; a < nu->pntsu; a++, bezt++) {
+					if (bezt->hide == 0) {
+						bezt->f1 |= SELECT;
+						bezt->f2 |= SELECT;
+						bezt->f3 |= SELECT;
+					}
+				}
+			}
+			else if (nu->bp) {
+				BPoint *bp;
+				for (bp = nu->bp, a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) {
+					if (bp->hide == 0)
+						bp->f1 |= SELECT;
+				}
+			}
+		}
 	}
 }
 
@@ -1999,11 +2034,12 @@ static int switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
 	EditNurb *editnurb = cu->editnurb;
 	Nurb *nu;
 
-	for (nu = editnurb->nurbs.first; nu; nu = nu->next)
+	for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
 		if (isNurbsel(nu)) {
 			BKE_nurb_direction_switch(nu);
 			keyData_switchDirectionNurb(cu, nu);
 		}
+	}
 
 	if (ED_curve_updateAnimPaths(obedit->data))
 		WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, obedit);
@@ -2446,10 +2482,11 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
 
 /**************** select start/end operators **************/
 
-/* (de)selects first or last of visible part of each Nurb depending on selFirst     */
-/* selFirst: defines the end of which to select					    */
-/* doswap: defines if selection state of each first/last control point is swapped   */
-/* selstatus: selection status in case doswap is false				    */
+/* (de)selects first or last of visible part of each Nurb depending on selFirst
+ * selFirst: defines the end of which to select
+ * doswap: defines if selection state of each first/last control point is swapped
+ * selstatus: selection status in case doswap is false
+ */
 void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatus)
 {
 	ListBase *editnurb = object_editcurve_get(obedit);
@@ -2523,7 +2560,7 @@ void CURVE_OT_de_select_first(wmOperatorType *ot)
 	/* identifiers */
 	ot->name = "(De)select First";
 	ot->idname = "CURVE_OT_de_select_first";
-	ot->description = "(De)select first of visible part of each Nurb";
+	ot->description = "(De)select first of visible part of each NURBS";
 	
 	/* api cfirstbacks */
 	ot->exec = de_select_first_exec;
@@ -2548,7 +2585,7 @@ void CURVE_OT_de_select_last(wmOperatorType *ot)
 	/* identifiers */
 	ot->name = "(De)select Last";
 	ot->idname = "CURVE_OT_de_select_last";
-	ot->description = "(De)select last of visible part of each Nurb";
+	ot->description = "(De)select last of visible part of each NURBS";
 	
 	/* api clastbacks */
 	ot->exec = de_select_last_exec;
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt
index 6d6b7ec..8d10864 100644
--- a/source/blender/editors/datafiles/CMakeLists.txt
+++ b/source/blender/editors/datafiles/CMakeLists.txt
@@ -43,6 +43,7 @@ if(WITH_BLENDER)
 
 		# blends
 		data_to_c_simple(../../../../release/datafiles/preview.blend SRC)
+		data_to_c_simple(../../../../release/datafiles/preview_cycles.blend SRC)
 
 		# images
 		data_to_c_simple(../../../../release/datafiles/splash.png SRC)
@@ -81,6 +82,33 @@ if(WITH_BLENDER)
 		data_to_c_simple(../../../../release/datafiles/brushicons/thumb.png SRC)
 		data_to_c_simple(../../../../release/datafiles/brushicons/twist.png SRC)
 		data_to_c_simple(../../../../release/datafiles/brushicons/vertexdraw.png SRC)
+
+		# matcap
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc01.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc02.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc03.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc04.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc05.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc06.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc07.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc08.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc09.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc10.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc11.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc12.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc13.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc14.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc15.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc16.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc17.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc18.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc19.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc20.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc21.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc22.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc23.jpg SRC)
+		data_to_c_simple(../../../../release/datafiles/matcaps/mc24.jpg SRC)
+
 	endif()
 
 	data_to_c_simple(../../../../release/datafiles/startup.blend SRC)
diff --git a/source/blender/editors/datafiles/SConscript b/source/blender/editors/datafiles/SConscript
index cb6fe11..c17ab38 100644
--- a/source/blender/editors/datafiles/SConscript
+++ b/source/blender/editors/datafiles/SConscript
@@ -46,6 +46,7 @@ sources.extend((
 
 	os.path.join(env['DATA_SOURCES'], "startup.blend.c"),
 	os.path.join(env['DATA_SOURCES'], "preview.blend.c"),
+	os.path.join(env['DATA_SOURCES'], "preview_cycles.blend.c"),
 	
 	os.path.join(env['DATA_SOURCES'], "add.png.c"),
 	os.path.join(env['DATA_SOURCES'], "blob.png.c"),
@@ -77,6 +78,32 @@ sources.extend((
 	os.path.join(env['DATA_SOURCES'], "thumb.png.c"),
 	os.path.join(env['DATA_SOURCES'], "twist.png.c"),
 	os.path.join(env['DATA_SOURCES'], "vertexdraw.png.c"),
+	
+	os.path.join(env['DATA_SOURCES'], "mc01.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc02.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc03.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc04.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc05.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc06.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc07.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc08.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc09.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc10.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc11.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc12.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc13.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc14.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc15.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc16.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc17.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc18.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc19.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc20.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc21.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc22.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc23.jpg.c"),
+	os.path.join(env['DATA_SOURCES'], "mc24.jpg.c"),
+
 	))
 
 env.BlenderLib ( 'bf_editor_datafiles', sources, Split(incs), [], libtype=['core', 'player'], priority=[235, 30] )
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 3e092ed..09a7890 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -27,7 +27,6 @@
  *  \ingroup edgpencil
  */
 
- 
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index e4e640e..671adfb 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1387,12 +1387,15 @@ static void gp_layer_to_curve(bContext *C, ReportList *reports, bGPdata *gpd, bG
 static int gp_convert_check_has_valid_timing(bContext *C, bGPDlayer *gpl, wmOperator *op)
 {
 	Scene *scene = CTX_data_scene(C);
-	bGPDframe *gpf = gpencil_layer_getframe(gpl, CFRA, 0);
-	bGPDstroke *gps = gpf->strokes.first;
+	bGPDframe *gpf = NULL;
+	bGPDstroke *gps = NULL;
 	bGPDspoint *pt;
 	double base_time, cur_time, prev_time = -1.0;
 	int i, valid = TRUE;
 	
+	if (!gpl || !(gpf = gpencil_layer_getframe(gpl, CFRA, 0)) || !(gps = gpf->strokes.first))
+		return FALSE;
+	
 	do {
 		base_time = cur_time = gps->inittime;
 		if (cur_time <= prev_time) {
@@ -1438,11 +1441,19 @@ static void gp_convert_set_end_frame(struct Main *UNUSED(main), struct Scene *UN
 static int gp_convert_poll(bContext *C)
 {
 	bGPdata *gpd = gpencil_data_get_active(C);
+	bGPDlayer *gpl = NULL;
+	bGPDframe *gpf = NULL;
 	ScrArea *sa = CTX_wm_area(C);
 	Scene *scene = CTX_data_scene(C);
 
-	/* only if there's valid data, and the current view is 3D View */
-	return ((sa && sa->spacetype == SPACE_VIEW3D) && gpencil_layer_getactive(gpd) && (scene->obedit == NULL));
+	/* only if the current view is 3D View, if there's valid data (i.e. at least one stroke!),
+	 * and if we are not in edit mode!
+	 */
+	return ((sa && sa->spacetype == SPACE_VIEW3D) &&
+	        (gpl = gpencil_layer_getactive(gpd)) &&
+	        (gpf = gpencil_layer_getframe(gpl, CFRA, 0)) &&
+	        (gpf->strokes.first) &&
+	        (scene->obedit == NULL));
 }
 
 static int gp_convert_layer_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index c403127..8cd2bd8 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -39,6 +39,8 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "PIL_time.h"
 
 #include "BKE_gpencil.h"
@@ -1457,28 +1459,27 @@ static void gpencil_draw_status_indicators(tGPsdata *p)
 		case GP_STATUS_PAINTING:
 			/* only print this for paint-sessions, otherwise it gets annoying */
 			if (GPENCIL_SKETCH_SESSIONS_ON(p->scene))
-				ED_area_headerprint(p->sa, "Grease Pencil: Drawing/erasing stroke... Release to end stroke");
+				ED_area_headerprint(p->sa, IFACE_("Grease Pencil: Drawing/erasing stroke... Release to end stroke"));
 			break;
 		
 		case GP_STATUS_IDLING:
 			/* print status info */
 			switch (p->paintmode) {
 				case GP_PAINTMODE_ERASER:
-					ED_area_headerprint(p->sa,
-					                    "Grease Pencil Erase Session: Hold and drag LMB or RMB to erase |"
-					                    " ESC/Enter to end");
+					ED_area_headerprint(p->sa, IFACE_("Grease Pencil Erase Session: Hold and drag LMB or RMB to erase |"
+					                                  " ESC/Enter to end"));
 					break;
 				case GP_PAINTMODE_DRAW_STRAIGHT:
-					ED_area_headerprint(p->sa, "Grease Pencil Line Session: Hold and drag LMB to draw | "
-					                    "ESC/Enter to end");
+					ED_area_headerprint(p->sa, IFACE_("Grease Pencil Line Session: Hold and drag LMB to draw | "
+					                                  "ESC/Enter to end"));
 					break;
 				case GP_PAINTMODE_DRAW:
-					ED_area_headerprint(p->sa, "Grease Pencil Freehand Session: Hold and drag LMB to draw | "
-					                    "ESC/Enter to end");
+					ED_area_headerprint(p->sa, IFACE_("Grease Pencil Freehand Session: Hold and drag LMB to draw | "
+					                                  "ESC/Enter to end"));
 					break;
 					
 				default: /* unhandled future cases */
-					ED_area_headerprint(p->sa, "Grease Pencil Session: ESC/Enter to end");
+					ED_area_headerprint(p->sa, IFACE_("Grease Pencil Session: ESC/Enter to end"));
 					break;
 			}
 			break;
@@ -1564,8 +1565,8 @@ static void gpencil_draw_apply_event(wmOperator *op, wmEvent *event)
 	p->curtime = PIL_check_seconds_timer();
 	
 	/* handle pressure sensitivity (which is supplied by tablets) */
-	if (event->custom == EVT_DATA_TABLET) {
-		wmTabletData *wmtab = event->customdata;
+	if (event->tablet_data) {
+		wmTabletData *wmtab = event->tablet_data;
 		
 		tablet = (wmtab->Active != EVT_TABLET_NONE);
 		p->pressure = wmtab->Pressure;
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 551d304..20f568a 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -552,7 +552,8 @@ typedef enum eAnimUnitConv_Flags {
 	/* only touch selected BezTriples */
 	ANIM_UNITCONV_ONLYSEL   = (1 << 2),
 	/* only touch selected vertices */
-	ANIM_UNITCONV_SELVERTS  = (1 << 3)
+	ANIM_UNITCONV_SELVERTS  = (1 << 3),
+	ANIM_UNITCONV_SKIPKNOTS  = (1 << 4),
 } eAnimUnitConv_Flags;
 
 /* Get unit conversion factor for given ID + F-Curve */
diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h
index 6d7bcec..81dbb8e 100644
--- a/source/blender/editors/include/ED_datafiles.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -36,6 +36,12 @@
 extern int datatoc_startup_blend_size;
 extern char datatoc_startup_blend[];
 
+extern int datatoc_preview_blend_size;
+extern char datatoc_preview_blend[];
+
+extern int datatoc_preview_cycles_blend_size;
+extern char datatoc_preview_cycles_blend[];
+
 extern int datatoc_blender_icons16_png_size;
 extern char datatoc_blender_icons16_png[];
 
@@ -150,6 +156,81 @@ extern char datatoc_twist_png[];
 extern int datatoc_vertexdraw_png_size;
 extern char datatoc_vertexdraw_png[];
 
+/* Matcap files */
+
+extern int datatoc_mc01_jpg_size;
+extern char datatoc_mc01_jpg[];
+
+extern int datatoc_mc02_jpg_size;
+extern char datatoc_mc02_jpg[];
+
+extern int datatoc_mc03_jpg_size;
+extern char datatoc_mc03_jpg[];
+
+extern int datatoc_mc04_jpg_size;
+extern char datatoc_mc04_jpg[];
+
+extern int datatoc_mc05_jpg_size;
+extern char datatoc_mc05_jpg[];
+
+extern int datatoc_mc06_jpg_size;
+extern char datatoc_mc06_jpg[];
+
+extern int datatoc_mc07_jpg_size;
+extern char datatoc_mc07_jpg[];
+
+extern int datatoc_mc08_jpg_size;
+extern char datatoc_mc08_jpg[];
+
+extern int datatoc_mc09_jpg_size;
+extern char datatoc_mc09_jpg[];
+
+extern int datatoc_mc10_jpg_size;
+extern char datatoc_mc10_jpg[];
+
+extern int datatoc_mc11_jpg_size;
+extern char datatoc_mc11_jpg[];
+
+extern int datatoc_mc12_jpg_size;
+extern char datatoc_mc12_jpg[];
+
+extern int datatoc_mc13_jpg_size;
+extern char datatoc_mc13_jpg[];
+
+extern int datatoc_mc14_jpg_size;
+extern char datatoc_mc14_jpg[];
+
+extern int datatoc_mc15_jpg_size;
+extern char datatoc_mc15_jpg[];
+
+extern int datatoc_mc16_jpg_size;
+extern char datatoc_mc16_jpg[];
+
+extern int datatoc_mc17_jpg_size;
+extern char datatoc_mc17_jpg[];
+
+extern int datatoc_mc18_jpg_size;
+extern char datatoc_mc18_jpg[];
+
+extern int datatoc_mc19_jpg_size;
+extern char datatoc_mc19_jpg[];
+
+extern int datatoc_mc20_jpg_size;
+extern char datatoc_mc20_jpg[];
+
+extern int datatoc_mc21_jpg_size;
+extern char datatoc_mc21_jpg[];
+
+extern int datatoc_mc22_jpg_size;
+extern char datatoc_mc22_jpg[];
+
+extern int datatoc_mc23_jpg_size;
+extern char datatoc_mc23_jpg[];
+
+extern int datatoc_mc24_jpg_size;
+extern char datatoc_mc24_jpg[];
+
+
 
 #endif /* __ED_DATAFILES_H__ */
 
diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h
index 1321765..4655188 100644
--- a/source/blender/editors/include/ED_mball.h
+++ b/source/blender/editors/include/ED_mball.h
@@ -32,6 +32,7 @@
 #define __ED_MBALL_H__
 
 struct bContext;
+struct MetaBall;
 struct Object;
 struct wmKeyConfig;
 
@@ -48,5 +49,6 @@ void load_editMball(struct Object *obedit);
 
 void undo_push_mball(struct bContext *C, const char *name);
 
-#endif
+void ED_mball_transform(struct MetaBall *mb, float *mat);
 
+#endif  /* __ED_MBALL_H__ */
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index f5ab002..d3de259 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -119,7 +119,7 @@ int  EDBM_vert_color_check(struct BMEditMesh *em);
 void EDBM_mesh_hide(struct BMEditMesh *em, int swap);
 void EDBM_mesh_reveal(struct BMEditMesh *em);
 
-void EDBM_update_generic(struct BMEditMesh *em, const short do_tessface, const short is_destructive);
+void EDBM_update_generic(struct BMEditMesh *em, const bool do_tessface, const bool is_destructive);
 
 struct UvElementMap *EDBM_uv_element_map_create(struct BMEditMesh *em, int selected, int doIslands);
 void                 EDBM_uv_element_map_free(struct UvElementMap *vmap);
@@ -130,7 +130,7 @@ struct MTexPoly *EDBM_mtexpoly_active_get(struct BMEditMesh *em, struct BMFace *
 
 void              EDBM_uv_vert_map_free(struct UvVertMap *vmap);
 struct UvMapVert *EDBM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v);
-struct UvVertMap *EDBM_uv_vert_map_create(struct BMEditMesh *em, int selected, const float limit[2]);
+struct UvVertMap *EDBM_uv_vert_map_create(struct BMEditMesh *em, bool use_select, const float limit[2]);
 
 void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag);
 void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
@@ -227,6 +227,7 @@ void                 ED_vgroup_delete(struct Object *ob, struct bDeformGroup *de
 void                 ED_vgroup_clear(struct Object *ob);
 void                 ED_vgroup_select_by_name(struct Object *ob, const char *name);
 int                  ED_vgroup_data_create(struct ID *id);
+void                 ED_vgroup_data_clamp_range(struct ID *id, const int total);
 int                  ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
 int                  ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from);
 void                 ED_vgroup_mirror(struct Object *ob, const short mirror_weights, const short flip_vgroups, const short all_vgroups);
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 533bfe2..e212f2c 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -83,6 +83,7 @@ typedef enum eParentType {
 	PAR_ARMATURE_ENVELOPE,
 	PAR_ARMATURE_AUTO,
 	PAR_BONE,
+	PAR_BONE_RELATIVE,
 	PAR_CURVE,
 	PAR_FOLLOW,
 	PAR_PATH_CONST,
diff --git a/source/blender/editors/include/ED_physics.h b/source/blender/editors/include/ED_physics.h
index cd9ddd3..192bcd8 100644
--- a/source/blender/editors/include/ED_physics.h
+++ b/source/blender/editors/include/ED_physics.h
@@ -32,13 +32,26 @@
 #ifndef __ED_PHYSICS_H__
 #define __ED_PHYSICS_H__
 
+struct bContext;
+struct wmOperator;
 struct wmKeyConfig;
 
+struct Scene;
+struct Object;
+
 /* particle_edit.c */
 int PE_poll(struct bContext *C);
 int PE_hair_poll(struct bContext *C);
 int PE_poll_view3d(struct bContext *C);
 
+/* rigidbody_object.c */
+void ED_rigidbody_ob_add(struct wmOperator *op, struct Scene *scene, struct Object *ob, int type);
+void ED_rigidbody_ob_remove(struct Scene *scene, struct Object *ob);
+
+/* rigidbody_constraint.c */
+void ED_rigidbody_con_add(struct wmOperator *op, struct Scene *scene, struct Object *ob, int type);
+void ED_rigidbody_con_remove(struct Scene *scene, struct Object *ob);
+
 /* operators */
 void ED_operatortypes_physics(void);
 void ED_keymap_physics(struct wmKeyConfig *keyconf);
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 03c1dd5..a41aaca 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -83,6 +83,7 @@ enum {
 	TFM_BWEIGHT,
 	TFM_ALIGN,
 	TFM_EDGE_SLIDE,
+	TFM_VERT_SLIDE,
 	TFM_SEQ_SLIDE
 } TfmMode;
 
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index 0a79404..0560cbd 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -990,11 +990,37 @@ DEF_ICON(BRUSH_THUMB)
 DEF_ICON(BRUSH_ROTATE)
 DEF_ICON(BRUSH_VERTEXDRAW)
 
+	/* Matcaps */
+DEF_ICON(MATCAP_01)
+DEF_ICON(MATCAP_02)
+DEF_ICON(MATCAP_03)
+DEF_ICON(MATCAP_04)
+DEF_ICON(MATCAP_05)
+DEF_ICON(MATCAP_06)
+DEF_ICON(MATCAP_07)
+DEF_ICON(MATCAP_08)
+DEF_ICON(MATCAP_09)
+DEF_ICON(MATCAP_10)
+DEF_ICON(MATCAP_11)
+DEF_ICON(MATCAP_12)
+DEF_ICON(MATCAP_13)
+DEF_ICON(MATCAP_14)
+DEF_ICON(MATCAP_15)
+DEF_ICON(MATCAP_16)
+DEF_ICON(MATCAP_17)
+DEF_ICON(MATCAP_18)
+DEF_ICON(MATCAP_19)
+DEF_ICON(MATCAP_20)
+DEF_ICON(MATCAP_21)
+DEF_ICON(MATCAP_22)
+DEF_ICON(MATCAP_23)
+DEF_ICON(MATCAP_24)
+
 /* vector icons, VICO_ prefix added */	
 DEF_VICO(VIEW3D_VEC)
 DEF_VICO(EDIT_VEC)
-DEF_VICO(EDITMODE_DEHLT)
-DEF_VICO(EDITMODE_HLT)
+DEF_VICO(EDITMODE_VEC_DEHLT)
+DEF_VICO(EDITMODE_VEC_HLT)
 DEF_VICO(DISCLOSURE_TRI_RIGHT_VEC)
 DEF_VICO(DISCLOSURE_TRI_DOWN_VEC)
 DEF_VICO(MOVE_UP_VEC)
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 292cc4c..648f8bf 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -85,6 +85,9 @@ typedef struct uiLayout uiLayout;
 #define UI_MAX_DRAW_STR 400
 #define UI_MAX_NAME_STR 128
 
+/* use for clamping popups within the screen */
+#define UI_SCREEN_MARGIN 10
+
 /* uiBlock->dt */
 #define UI_EMBOSS       0   /* use widget style for drawing */
 #define UI_EMBOSSN      1   /* Nothing, only icon and/or text */
@@ -219,7 +222,7 @@ typedef enum {
 	NUMSLI        = (14 << 9),
 	COLOR         = (15 << 9),
 	IDPOIN        = (16 << 9),
-	HSVSLI        = (17 << 9),
+	HSVSLI        = (17 << 9),  /* UNUSED, but code still references */
 	SCROLL        = (18 << 9),
 	BLOCK         = (19 << 9),
 	BUTM          = (20 << 9),
@@ -358,7 +361,7 @@ void uiPupMenuInvoke(struct bContext *C, const char *idname); /* popup registere
  * but allow using all button types and creating an own layout. */
 
 typedef uiBlock * (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1);
-typedef void (*uiBlockCancelFunc)(void *arg1);
+typedef void (*uiBlockCancelFunc)(struct bContext *C, void *arg1);
 
 void uiPupBlock(struct bContext *C, uiBlockCreateFunc func, void *arg);
 void uiPupBlockO(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext);
@@ -807,6 +810,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct Pointe
 uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr);
 void uiTemplatePreview(uiLayout *layout, struct ID *id, int show_buttons, struct ID *parent, struct MTex *slot);
 void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int expand);
+void uiTemplateIconView(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
 void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
 void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
 void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
@@ -828,6 +832,8 @@ void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *te
 void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
 void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
 
+/* Default UIList class name, keep in sync with its declaration in bl_ui/__init__.py */
+#define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list"
 void uiTemplateList(uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id,
                     struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr,
                     const char *active_propname, int rows, int maxrows, int layout_type);
diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index f578d68..10026bb 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -39,6 +39,7 @@ struct World;
 struct Tex;
 struct Lamp;
 struct Material;
+struct PreviewImage;
 struct PointerRNA;
 
 typedef struct IconFile {
@@ -76,6 +77,8 @@ void UI_icons_free_drawinfo(void *drawinfo);
 struct ListBase *UI_iconfile_list(void);
 int UI_iconfile_get_index(const char *filename);
 
+struct PreviewImage *UI_icon_to_preview(int icon_id);
+
 int UI_rnaptr_icon_get(struct bContext *C, struct PointerRNA *ptr, int rnaicon, int big);
 
 #endif /*  __UI_INTERFACE_ICONS_H__ */
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 7e7be17..b497a97 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -147,12 +147,15 @@ enum {
 	TH_NODE_CONVERTOR,
 	TH_NODE_GROUP,
 	TH_NODE_FRAME,
+	TH_NODE_MATTE,
+	TH_NODE_DISTORT,
 	
 	TH_CONSOLE_OUTPUT,
 	TH_CONSOLE_INPUT,
 	TH_CONSOLE_INFO,
 	TH_CONSOLE_ERROR,
 	TH_CONSOLE_CURSOR,
+	TH_CONSOLE_SELECT,
 	
 	TH_SEQ_MOVIE,
 	TH_SEQ_MOVIECLIP,
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 1dee497..d245349 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -319,6 +319,7 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, eBlockBound
 	wmWindow *window = CTX_wm_window(C);
 	int startx, starty, endx, endy, width, height, oldwidth, oldheight;
 	int oldbounds, xmax, ymax;
+	const int margin = UI_SCREEN_MARGIN;
 
 	oldbounds = block->bounds;
 
@@ -356,20 +357,20 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, eBlockBound
 	startx = window->eventstate->x + block->rect.xmin + (block->mx * width) / oldwidth;
 	starty = window->eventstate->y + block->rect.ymin + (block->my * height) / oldheight;
 
-	if (startx < 10)
-		startx = 10;
-	if (starty < 10)
-		starty = 10;
+	if (startx < margin)
+		startx = margin;
+	if (starty < margin)
+		starty = margin;
 
 	endx = startx + width;
 	endy = starty + height;
 
 	if (endx > xmax) {
-		endx = xmax - 10;
+		endx = xmax - margin;
 		startx = endx - width;
 	}
-	if (endy > ymax - 20) {
-		endy = ymax - 20;
+	if (endy > ymax - margin) {
+		endy = ymax - margin;
 		starty = endy - height;
 	}
 
@@ -927,6 +928,8 @@ void uiEndBlock(const bContext *C, uiBlock *block)
 		block->auto_open = block->oldblock->auto_open;
 		block->auto_open_last = block->oldblock->auto_open_last;
 		block->tooltipdisabled = block->oldblock->tooltipdisabled;
+		copy_v3_v3(ui_block_hsv_get(block),
+		           ui_block_hsv_get(block->oldblock));
 
 		block->oldblock = NULL;
 	}
@@ -997,7 +1000,7 @@ void ui_fontscale(short *points, float aspect)
 /* project button or block (but==NULL) to pixels in regionspace */
 static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, uiBut *but)
 {
-	rctf rectf = (but)? but->rect: block->rect;
+	rctf rectf = (but) ? but->rect : block->rect;
 	
 	ui_block_to_window_fl(ar, block, &rectf.xmin, &rectf.ymin);
 	ui_block_to_window_fl(ar, block, &rectf.xmax, &rectf.ymax);
@@ -1797,9 +1800,9 @@ int ui_set_but_string_eval_num(bContext *C, uiBut *but, const char *str, double
 #ifdef WITH_PYTHON
 
 	if (str[0] != '\0') {
-		int is_unit_but = ui_is_but_unit(but);
+		bool is_unit_but = (ui_is_but_float(but) && ui_is_but_unit(but));
 		/* only enable verbose if we won't run again with units */
-		if (BPY_button_exec(C, str, value, is_unit_but == FALSE) != -1) {
+		if (BPY_button_exec(C, str, value, is_unit_but == false) != -1) {
 			/* if the value parsed ok without unit conversion this button may still need a unit multiplier */
 			if (is_unit_but) {
 				char str_new[128];
@@ -2778,21 +2781,21 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
 	return but;
 }
 
-/* ui_def_but_rna_propname and ui_def_but_rna
+static void ui_def_but_rna__disable(uiBut *but)
+{
+	but->flag |= UI_BUT_DISABLED;
+	but->lock = true;
+	but->lockstr = "";
+}
+
+/**
+ * ui_def_but_rna_propname and ui_def_but_rna
  * both take the same args except for propname vs prop, this is done so we can
  * avoid an extra lookup on 'prop' when its already available.
  *
  * When this kind of change won't disrupt branches, best look into making more
  * of our UI functions take prop rather then propname.
  */
-
-#define UI_DEF_BUT_RNA_DISABLE(but)  { \
-		but->flag |= UI_BUT_DISABLED;  \
-		but->lock = TRUE;              \
-		but->lockstr = "";             \
-	} (void)0
-
-
 static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str,
                              int x, int y, short width, short height,
                              PointerRNA *ptr, PropertyRNA *prop, int index,
@@ -2929,7 +2932,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
 	}
 	
 	if (!RNA_property_editable(&but->rnapoin, prop)) {
-		UI_DEF_BUT_RNA_DISABLE(but);
+		ui_def_but_rna__disable(but);
 	}
 
 	if (but->flag & UI_BUT_UNDO && (ui_but_is_rna_undo(but) == FALSE)) {
@@ -2959,7 +2962,7 @@ static uiBut *ui_def_but_rna_propname(uiBlock *block, int type, int retval, cons
 	else {
 		but = ui_def_but(block, type, retval, propname, x, y, width, height, NULL, min, max, a1, a2, tip);
 
-		UI_DEF_BUT_RNA_DISABLE(but);
+		ui_def_but_rna__disable(but);
 	}
 
 	return but;
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 5d62ef7..e4c163e 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -57,7 +57,11 @@
 
 static FCurve *ui_but_get_fcurve(uiBut *but, bAction **action, int *driven)
 {
-	return rna_get_fcurve(&but->rnapoin, but->rnaprop, but->rnaindex, action, driven);
+	/* for entire array buttons we check the first component, it's not perfect
+	 * but works well enough in typical cases */
+	int rnaindex = (but->rnaindex == -1) ? 0 : but->rnaindex;
+
+	return rna_get_fcurve(&but->rnapoin, but->rnaprop, rnaindex, action, driven);
 }
 
 void ui_but_anim_flag(uiBut *but, float cfra)
@@ -131,7 +135,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
 	ID *id;
 	FCurve *fcu;
 	char *path;
-	short ok = 0;
+	bool ok = false;
 	
 	/* button must have RNA-pointer to a numeric-capable property */
 	if (ELEM(NULL, but->rnapoin.data, but->rnaprop)) {
@@ -140,6 +144,14 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
 		return 0;
 	}
 	
+	if (RNA_property_array_length(&but->rnapoin, but->rnaprop) != 0) {
+		if (but->rnaindex == -1) {
+			if (G.debug & G_DEBUG)
+				printf("ERROR: create expression failed - can't create expression for entire array\n");
+			return 0;
+		}
+	}
+	
 	/* make sure we have animdata for this */
 	/* FIXME: until materials can be handled by depsgraph, don't allow drivers to be created for them */
 	id = (ID *)but->rnapoin.id.data;
@@ -168,6 +180,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
 			/* updates */
 			driver->flag |= DRIVER_FLAG_RECOMPILE;
 			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME, NULL);
+			ok = true;
 		}
 	}
 	
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 792553f..e19e89a 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -373,7 +373,7 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad)
 	glEnable(GL_BLEND);
 
 	uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
-   
+
 	glDisable(GL_BLEND);
 	glDisable(GL_LINE_SMOOTH);
 }
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index c87bb2a..017ab55 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -214,18 +214,22 @@ typedef struct uiAfterFunc {
 static int ui_but_contains_pt(uiBut *but, int mx, int my);
 static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y);
 static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state);
-static int ui_handler_region_menu(bContext *C, wmEvent *event, void *userdata);
+static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *userdata);
 static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type);
 static void button_timers_tooltip_remove(bContext *C, uiBut *but);
 
 /* ******************** menu navigation helpers ************** */
 
 /* assumes event type is MOUSEPAN */
-void ui_pan_to_scroll(wmEvent *event, int *type, int *val)
+void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
 {
 	static int lastdy = 0;
 	int dy = event->prevy - event->y;
-	
+
+	/* This event should be originally from event->type,
+	 * converting wrong event into wheel is bad, see [#33803] */
+	BLI_assert(*type == MOUSEPAN);
+
 	/* sign differs, reset */
 	if ((dy > 0 && lastdy < 0) || (dy < 0 && lastdy > 0))
 		lastdy = dy;
@@ -233,8 +237,14 @@ void ui_pan_to_scroll(wmEvent *event, int *type, int *val)
 		lastdy += dy;
 		
 		if (ABS(lastdy) > (int)UI_UNIT_Y) {
+			int dy = event->prevy - event->y;
+			
+			if (U.uiflag2 & USER_TRACKPAD_NATURAL)
+				dy = -dy;
+			
 			*val = KM_PRESS;
-			if (event->prevy - event->y > 0)
+			
+			if (dy > 0)
 				*type = WHEELUPMOUSE;
 			else
 				*type = WHEELDOWNMOUSE;
@@ -291,15 +301,15 @@ static uiBut *ui_but_last(uiBlock *block)
 	return NULL;
 }
 
-static int ui_is_a_warp_but(uiBut *but)
+static bool ui_is_a_warp_but(uiBut *but)
 {
 	if (U.uiflag & USER_CONTINUOUS_MOUSE) {
-		if (ELEM6(but->type, NUM, NUMABS, HSVCIRCLE, TRACKPREVIEW, HSVCUBE, BUT_CURVE)) {
-			return TRUE;
+		if (ELEM7(but->type, NUM, NUMSLI, NUMABS, HSVCIRCLE, TRACKPREVIEW, HSVCUBE, BUT_CURVE)) {
+			return true;
 		}
 	}
 
-	return FALSE;
+	return false;
 }
 
 static float ui_mouse_scale_warp_factor(const short shift)
@@ -721,7 +731,7 @@ static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *da
 
 /* ****************** drag drop code *********************** */
 
-static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, wmEvent *event)
+static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, const wmEvent *event)
 {
 	rcti rect;
 	int x = event->x, y = event->y;
@@ -745,7 +755,7 @@ static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, wmEvent *event)
 	return BLI_rcti_isect_pt(&rect, x, y);
 }
 
-static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	/* prevent other WM gestures to start while we try to drag */
 	WM_gestures_remove(C);
@@ -1162,7 +1172,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
 /* ******************* drop event ********************  */
 
 /* only call if event type is EVT_DROP */
-static void ui_but_drop(bContext *C, wmEvent *event, uiBut *but, uiHandleButtonData *data)
+static void ui_but_drop(bContext *C, const wmEvent *event, uiBut *but, uiHandleButtonData *data)
 {
 	wmDrag *wmd;
 	ListBase *drags = event->customdata; /* drop event type has listbase customdata by default */
@@ -1416,11 +1426,11 @@ static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
 }
 
 /* note, but->block->aspect is used here, when drawing button style is getting scaled too */
-static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, short x)
+static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, const float x)
 {
 	uiStyle *style = UI_GetStyle();  // XXX pass on as arg
 	uiFontStyle *fstyle = &style->widget;
-	int startx = but->rect.xmin;
+	float startx = but->rect.xmin;
 	char *origstr, password_str[UI_MAX_DRAW_STR];
 
 	uiStyleFontSet(fstyle);
@@ -1430,24 +1440,27 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
 	
 	ui_button_text_password_hide(password_str, but, FALSE);
 
-	origstr = MEM_callocN(sizeof(char) * data->maxlen, "ui_textedit origstr");
+	origstr = MEM_mallocN(sizeof(char) * data->maxlen, "ui_textedit origstr");
 	
 	BLI_strncpy(origstr, but->drawstr, data->maxlen);
 	
-	/* XXX solve generic */
-	if (but->type == NUM || but->type == NUMSLI)
+	/* XXX solve generic, see: #widget_draw_text_icon */
+	if (but->type == NUM || but->type == NUMSLI) {
 		startx += (int)(0.5f * (BLI_rctf_size_y(&but->rect)));
+	}
 	else if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
-		startx += 5;
-		if (but->flag & UI_HAS_ICON)
+		if (but->flag & UI_HAS_ICON) {
 			startx += UI_DPI_ICON_SIZE;
+		}
+		/* but this extra .05 makes clicks inbetween characters feel nicer */
+		startx += ((UI_TEXT_MARGIN_X + 0.05f) * U.widget_unit);
 	}
 	
 	/* mouse dragged outside the widget to the left */
-	if (x < startx && but->ofs > 0) {
+	if (x < startx) {
 		int i = but->ofs;
 
-		origstr[but->ofs] = 0;
+		origstr[but->ofs] = '\0';
 		
 		while (i > 0) {
 			if (BLI_str_cursor_step_prev_utf8(origstr, but->ofs, &i)) {
@@ -1463,21 +1476,18 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
 		but->ofs = i;
 		but->pos = but->ofs;
 	}
-	/* mouse inside the widget */
-	else if (x >= startx) {
+	/* mouse inside the widget, mouse coords mapped in widget space */
+	else {  /* (x >= startx) */
 		int pos_i;
 
 		/* keep track of previous distance from the cursor to the char */
 		float cdist, cdist_prev = 0.0f;
 		short pos_prev;
-
-		const float aspect_sqrt = sqrtf(but->block->aspect);
 		
 		but->pos = pos_prev = strlen(origstr) - but->ofs;
 
-		while (TRUE) {
-			/* XXX does not take zoom level into account */
-			cdist = startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr + but->ofs);
+		while (true) {
+			cdist = startx + BLF_width(fstyle->uifont_id, origstr + but->ofs);
 
 			/* check if position is found */
 			if (cdist < x) {
@@ -1513,7 +1523,7 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
 	MEM_freeN(origstr);
 }
 
-static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data, short x)
+static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data, const float x)
 {
 	if      (x > data->selstartx) data->selextend = EXTEND_RIGHT;
 	else if (x < data->selstartx) data->selextend = EXTEND_LEFT;
@@ -1600,7 +1610,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, strCursorJump
 	}
 	else {
 		int pos_i = but->pos;
-		BLI_str_cursor_step_utf8(str, len, &pos_i, direction, jump);
+		BLI_str_cursor_step_utf8(str, len, &pos_i, direction, jump, true);
 		but->pos = pos_i;
 
 		if (select) {
@@ -1669,7 +1679,7 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
 		else if (but->pos >= 0 && but->pos < len) {
 			int pos = but->pos;
 			int step;
-			BLI_str_cursor_step_utf8(str, len, &pos, direction, jump);
+			BLI_str_cursor_step_utf8(str, len, &pos, direction, jump, true);
 			step = pos - but->pos;
 			memmove(&str[but->pos], &str[but->pos + step], (len + 1) - but->pos);
 			changed = 1;
@@ -1684,7 +1694,7 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
 				int pos = but->pos;
 				int step;
 
-				BLI_str_cursor_step_utf8(str, len, &pos, direction, jump);
+				BLI_str_cursor_step_utf8(str, len, &pos, direction, jump, true);
 				step = but->pos - pos;
 				memmove(&str[but->pos - step], &str[but->pos], (len + 1) - but->pos);
 				but->pos -= step;
@@ -1911,7 +1921,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
 }
 
 
-static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my, changed = 0, inbox = 0, update = 0, retval = WM_UI_HANDLER_CONTINUE;
 
@@ -2103,7 +2113,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
 		ED_region_tag_redraw(data->region);
 }
 
-static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my, retval = WM_UI_HANDLER_CONTINUE;
 
@@ -2292,7 +2302,7 @@ int ui_button_open_menu_direction(uiBut *but)
 
 /* ***************** events for different button types *************** */
 
-static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
 		if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
@@ -2320,7 +2330,7 @@ static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEv
 	return WM_UI_HANDLER_CONTINUE;
 }
 
-static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
 		if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
@@ -2381,7 +2391,7 @@ static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data
 	return WM_UI_HANDLER_CONTINUE;
 }
 
-static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
 		if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
@@ -2406,7 +2416,7 @@ static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, w
 	return WM_UI_HANDLER_CONTINUE;
 }
 
-static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
 		if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val == KM_PRESS) {
@@ -2431,7 +2441,7 @@ static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 	return WM_UI_HANDLER_CONTINUE;
 }
 
-static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	/* unlink icon is on right */
 	if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val == KM_PRESS) {
@@ -2459,7 +2469,7 @@ static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHa
 	return ui_do_but_TEX(C, block, but, data, event);
 }
 
-static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
 		if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
@@ -2472,7 +2482,7 @@ static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, wmEv
 	return WM_UI_HANDLER_CONTINUE;
 }
 
-static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
@@ -2593,6 +2603,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
 {
 	float deler, tempf, softmin, softmax, softrange;
 	int lvalue, temp, changed = 0;
+	const bool is_float = ui_is_but_float(but);
 	
 	if (mx == data->draglastx)
 		return changed;
@@ -2614,7 +2625,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
 	if (ui_is_a_warp_but(but)) {
 		/* Mouse location isn't screen clamped to the screen so use a linear mapping
 		 * 2px == 1-int, or 1px == 1-ClickStep */
-		if (ui_is_but_float(but)) {
+		if (is_float) {
 			fac *= 0.01f * but->a1;
 			tempf = (float)data->startvalue + ((float)(mx - data->dragstartx) * fac);
 			tempf = ui_numedit_apply_snapf(but, tempf, softmin, softmax, softrange, snap);
@@ -2671,21 +2682,21 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
 	else {
 		/* Use a non-linear mapping of the mouse drag especially for large floats (normal behavior) */
 		deler = 500;
-		if (!ui_is_but_float(but)) {
+		if (!is_float) {
 			/* prevent large ranges from getting too out of control */
-			if      (softrange > 600) deler = powf(softrange, 0.75);
-			else if (softrange < 100) deler = 200.0;
+			if      (softrange > 600) deler = powf(softrange, 0.75f);
 			else if (softrange <  25) deler = 50.0;
+			else if (softrange < 100) deler = 100.0;
 		}
 		deler /= fac;
 
-		if (softrange > 11) {
+		if ((is_float == true) && (softrange > 11)) {
 			/* non linear change in mouse input- good for high precicsion */
-			data->dragf += (((float)(mx - data->draglastx)) / deler) * (fabsf(data->dragstartx - mx) * 0.002f);
+			data->dragf += (((float)(mx - data->draglastx)) / deler) * (fabsf(mx - data->dragstartx) / 500.0f);
 		}
-		else if (softrange > 129) { /* only scale large int buttons */
+		else if ((is_float == false) && (softrange > 129)) { /* only scale large int buttons */
 			/* non linear change in mouse input- good for high precicsionm ints need less fine tuning */
-			data->dragf += (((float)(mx - data->draglastx)) / deler) * (fabsf(data->dragstartx - mx) * 0.004f);
+			data->dragf += (((float)(mx - data->draglastx)) / deler) * (fabsf(mx - data->dragstartx) / 250.0f);
 		}
 		else {
 			/*no scaling */
@@ -2697,7 +2708,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
 		tempf = (softmin + data->dragf * softrange);
 
 
-		if (!ui_is_but_float(but)) {
+		if (!is_float) {
 			temp = floorf(tempf + 0.5f);
 
 			temp = ui_numedit_apply_snap(temp, softmin, softmax, snap);
@@ -2729,7 +2740,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
 	return changed;
 }
 
-static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my; /* mouse location scaled to fit the UI */
 	int screen_mx, screen_my; /* mouse location kept at screen pixel coords */
@@ -2744,7 +2755,9 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
 		int type = event->type, val = event->val;
 		
-		ui_pan_to_scroll(event, &type, &val);
+		if (type == MOUSEPAN) {
+			ui_pan_to_scroll(event, &type, &val);
+		}
 		
 		/* XXX hardcoded keymap check.... */
 		if (type == MOUSEPAN && event->alt)
@@ -2881,36 +2894,66 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 	return retval;
 }
 
-static int ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, const short shift, const short ctrl, int mx)
+static bool ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data,
+                               const bool is_horizontal, const bool shift, const bool ctrl, int mx)
 {
 	float deler, f, tempf, softmin, softmax, softrange;
-	int temp, lvalue, changed = 0;
+	int temp, lvalue;
+	bool changed = false;
+	float mx_fl, my_fl;
+	/* note, 'offs' is really from the widget drawing rounded corners see 'widget_numslider' */
+	float offs;
 
 	softmin = but->softmin;
 	softmax = but->softmax;
 	softrange = softmax - softmin;
 
+	/* yes, 'mx' as both x/y is intentional */
+	ui_mouse_scale_warp(data, mx, mx, &mx_fl, &my_fl, shift);
+
 	if (but->type == NUMSLI) {
-		deler = (BLI_rctf_size_x(&but->rect) - 5.0f * but->aspect);
+		offs = (BLI_rctf_size_y(&but->rect) / 2.0f) * but->aspect;
+		deler = BLI_rctf_size_x(&but->rect) - offs;
 	}
 	else if (but->type == HSVSLI) {
-		deler = (BLI_rctf_size_x(&but->rect) / 2.0f - 5.0f * but->aspect);
+		offs = (BLI_rctf_size_y(&but->rect) / 2.0f) * but->aspect;
+		deler = (BLI_rctf_size_x(&but->rect) / 2.0f) - offs;
 	}
 	else if (but->type == SCROLL) {
-		int horizontal = (BLI_rctf_size_x(&but->rect) > BLI_rctf_size_y(&but->rect));
-		float size = (horizontal) ? BLI_rctf_size_x(&but->rect) : -BLI_rctf_size_y(&but->rect);
+		const float size = (is_horizontal) ? BLI_rctf_size_x(&but->rect) : -BLI_rctf_size_y(&but->rect);
 		deler = size * (but->softmax - but->softmin) / (but->softmax - but->softmin + but->a1);
+		offs = 0.0;
 	}
 	else {
-		deler = (BLI_rctf_size_x(&but->rect) - 5.0f * but->aspect);
+		offs = (BLI_rctf_size_y(&but->rect) / 2.0f) * but->aspect;
+		deler = (BLI_rctf_size_x(&but->rect) - offs);
 	}
 
-	f = (float)(mx - data->dragstartx) / deler + data->dragfstart;
-	
-	if (shift)
-		f = (f - data->dragfstart) / 10.0f + data->dragfstart;
-
+	f = (mx_fl - data->dragstartx) / deler + data->dragfstart;
 	CLAMP(f, 0.0f, 1.0f);
+
+
+	/* deal with mouse correction */
+#ifdef USE_CONT_MOUSE_CORRECT
+	if (ui_is_a_warp_but(but)) {
+		/* OK but can go outside bounds */
+		if (is_horizontal) {
+			data->ungrab_mval[0] = (but->rect.xmin + offs / but->aspect) + (f * deler);
+			data->ungrab_mval[1] = BLI_rctf_cent_y(&but->rect);
+		}
+		else {
+			data->ungrab_mval[1] = (but->rect.ymin + offs / but->aspect) + (f * deler);
+			data->ungrab_mval[0] = BLI_rctf_cent_x(&but->rect);
+		}
+		BLI_rctf_clamp_pt_v(&but->rect, data->ungrab_mval);
+	}
+#endif
+	if (is_horizontal == false) {
+		mx_fl = my_fl;
+	}
+	/* done correcting mouse */
+
+
 	tempf = softmin + f * softrange;
 	temp = floorf(tempf + 0.5f);
 
@@ -2946,7 +2989,7 @@ static int ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, const short
 		if (temp != lvalue) {
 			data->value = temp;
 			data->dragchange = 1;
-			changed = 1;
+			changed = true;
 		}
 	}
 	else {
@@ -2955,14 +2998,14 @@ static int ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, const short
 		if (tempf != (float)data->value) {
 			data->value = tempf;
 			data->dragchange = 1;
-			changed = 1;
+			changed = true;
 		}
 	}
 
 	return changed;
 }
 
-static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my, click = 0;
 	int retval = WM_UI_HANDLER_CONTINUE;
@@ -2973,8 +3016,10 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
 		int type = event->type, val = event->val;
-		
-		ui_pan_to_scroll(event, &type, &val);
+
+		if (type == MOUSEPAN) {
+			ui_pan_to_scroll(event, &type, &val);
+		}
 
 		/* XXX hardcoded keymap check.... */
 		if (type == MOUSEPAN && event->alt)
@@ -3031,7 +3076,7 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 				click = 1;
 		}
 		else if (event->type == MOUSEMOVE) {
-			if (ui_numedit_but_SLI(but, data, event->shift, event->ctrl, mx))
+			if (ui_numedit_but_SLI(but, data, true, event->shift, event->ctrl, mx))
 				ui_numedit_apply(C, block, but, data);
 		}
 		retval = WM_UI_HANDLER_BREAK;
@@ -3104,11 +3149,11 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 	return retval;
 }
 
-static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my /*, click = 0 */;
 	int retval = WM_UI_HANDLER_CONTINUE;
-	int horizontal = (BLI_rctf_size_x(&but->rect) > BLI_rctf_size_y(&but->rect));
+	bool horizontal = (BLI_rctf_size_x(&but->rect) > BLI_rctf_size_y(&but->rect));
 	
 	mx = event->x;
 	my = event->y;
@@ -3145,7 +3190,7 @@ static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
 			button_activate_state(C, but, BUTTON_STATE_EXIT);
 		}
 		else if (event->type == MOUSEMOVE) {
-			if (ui_numedit_but_SLI(but, data, 0, 0, (horizontal) ? mx : my))
+			if (ui_numedit_but_SLI(but, data, horizontal, false, false, (horizontal) ? mx : my))
 				ui_numedit_apply(C, block, but, data);
 		}
 
@@ -3156,7 +3201,7 @@ static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
 }
 
 
-static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	
 	if (data->state == BUTTON_STATE_HIGHLIGHT) {
@@ -3319,7 +3364,7 @@ static int ui_numedit_but_NORMAL(uiBut *but, uiHandleButtonData *data, int mx, i
 	return changed;
 }
 
-static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my;
 
@@ -3359,6 +3404,19 @@ static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
 	return WM_UI_HANDLER_CONTINUE;
 }
 
+/* scales a vector so no axis exceeds max
+ * (could become BLI_math func) */
+static void clamp_axis_max_v3(float v[3], const float max)
+{
+	const float v_max = max_fff(v[0], v[1], v[2]);
+	if (v_max > max) {
+		mul_v3_fl(v, max / v_max);
+		if (v[0] > max) v[0] = max;
+		if (v[1] > max) v[1] = max;
+		if (v[2] > max) v[2] = max;
+	}
+}
+
 static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, int my, const short shift)
 {
 	float rgb[3];
@@ -3435,6 +3493,11 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
 	if (color_profile && ((int)but->a1 != UI_GRAD_SV))
 		ui_block_to_scene_linear_v3(but->block, rgb);
 
+	/* clamp because with color conversion we can exceed range [#34295] */
+	if ((int)but->a1 == UI_GRAD_V_ALT) {
+		clamp_axis_max_v3(rgb, but->softmax);
+	}
+
 	copy_v3_v3(data->vec, rgb);
 
 	data->draglastx = mx;
@@ -3505,7 +3568,7 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOF
 	ui_set_but_vectorf(but, data->vec);
 }
 
-static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my;
 
@@ -3705,7 +3768,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
 }
 
 
-static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my;
 	mx = event->x;
@@ -3824,7 +3887,7 @@ static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx
 	return changed;
 }
 
-static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	ColorBand *coba;
 	CBData *cbd;
@@ -3988,7 +4051,7 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
 	return changed;
 }
 
-static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my, a, changed = 0;
 
@@ -4170,7 +4233,7 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx
 	return changed;
 }
 
-static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my;
 	
@@ -4253,7 +4316,7 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx,
 	return changed;
 }
 
-static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my;
 
@@ -4328,7 +4391,7 @@ static int ui_numedit_but_VECTORSCOPE(uiBut *but, uiHandleButtonData *data, int
 	return changed;
 }
 
-static int ui_do_but_VECTORSCOPE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_VECTORSCOPE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my;
 
@@ -4373,7 +4436,7 @@ static int ui_do_but_VECTORSCOPE(bContext *C, uiBlock *block, uiBut *but, uiHand
 }
 
 #ifdef WITH_INTERNATIONAL
-static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut *UNUSED(but), uiHandleButtonData *UNUSED(data), wmEvent *UNUSED(event))
+static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut *UNUSED(but), uiHandleButtonData *UNUSED(data), const wmEvent *UNUSED(event))
 {
 	/* XXX 2.50 bad global and state access */
 #if 0
@@ -4478,7 +4541,7 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut
 #endif
 
 
-static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {	
 	VECCOPY2D(but->linkto, event->mval);
 
@@ -4545,7 +4608,7 @@ static int ui_numedit_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonDa
 	return changed;
 }
 
-static int ui_do_but_TRACKPREVIEW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+static int ui_do_but_TRACKPREVIEW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
 	int mx, my;
 
@@ -4721,7 +4784,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 {
 	uiPopupMenu *pup;
 	uiLayout *layout;
-	int length;
+	bool is_array, is_array_component;
 	const char *name;
 	uiStringInfo label = {BUT_GET_LABEL, NULL};
 
@@ -4748,12 +4811,14 @@ static int ui_but_menu(bContext *C, uiBut *but)
 		if (is_anim)
 			is_anim = RNA_property_path_from_ID_check(&but->rnapoin, but->rnaprop);
 
-		length = RNA_property_array_length(&but->rnapoin, but->rnaprop);
+		/* determine if we can key a single component of an array */
+		is_array = RNA_property_array_length(&but->rnapoin, but->rnaprop) != 0;
+		is_array_component = (is_array && but->rnaindex != -1);
 		
 		/* Keyframes */
 		if (but->flag & UI_BUT_ANIMATED_KEY) {
 			/* replace/delete keyfraemes */
-			if (length) {
+			if (is_array_component) {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Replace Keyframes"),
 				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Replace Single Keyframe"),
@@ -4765,9 +4830,9 @@ static int ui_but_menu(bContext *C, uiBut *but)
 			}
 			else {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Replace Keyframe"),
-				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0);
+				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Keyframe"),
-				               ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 0);
+				               ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 1);
 			}
 			
 			/* keyframe settings */
@@ -4779,7 +4844,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 			/* pass */
 		}
 		else if (is_anim) {
-			if (length) {
+			if (is_array_component) {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframes"),
 				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Single Keyframe"),
@@ -4787,12 +4852,12 @@ static int ui_but_menu(bContext *C, uiBut *but)
 			}
 			else {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframe"),
-				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0);
+				               ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
 			}
 		}
 		
 		if (but->flag & UI_BUT_ANIMATED) {
-			if (length) {
+			if (is_array_component) {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Clear Keyframes"),
 				               ICON_NONE, "ANIM_OT_keyframe_clear_button", "all", 1);
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Clear Single Keyframes"),
@@ -4800,7 +4865,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 			}
 			else {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Clear Keyframes"),
-				               ICON_NONE, "ANIM_OT_keyframe_clear_button", "all", 0);
+				               ICON_NONE, "ANIM_OT_keyframe_clear_button", "all", 1);
 			}
 		}
 
@@ -4808,7 +4873,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 		if (but->flag & UI_BUT_DRIVEN) {
 			uiItemS(layout);
 
-			if (length) {
+			if (is_array_component) {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Drivers"),
 				               ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1);
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Single Driver"),
@@ -4816,7 +4881,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 			}
 			else {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Driver"),
-				               ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0);
+				               ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1);
 			}
 
 			uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"),
@@ -4832,7 +4897,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 		else if (is_anim) {
 			uiItemS(layout);
 
-			if (length) {
+			if (is_array_component) {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Drivers"),
 				               ICON_NONE, "ANIM_OT_driver_button_add", "all", 1);
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single Driver"),
@@ -4840,7 +4905,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 			}
 			else {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Driver"),
-				               ICON_NONE, "ANIM_OT_driver_button_add", "all", 0);
+				               ICON_NONE, "ANIM_OT_driver_button_add", "all", 1);
 			}
 
 			if (ANIM_driver_can_paste()) {
@@ -4854,7 +4919,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 		if (is_anim) {
 			uiItemS(layout);
 
-			if (length) {
+			if (is_array_component) {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add All to Keying Set"),
 				               ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 1);
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single to Keying Set"),
@@ -4864,7 +4929,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 			}
 			else {
 				uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add to Keying Set"),
-				               ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 0);
+				               ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 1);
 				uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Keying Set"),
 				        ICON_NONE, "ANIM_OT_keyingset_button_remove");
 			}
@@ -4877,15 +4942,15 @@ static int ui_but_menu(bContext *C, uiBut *but)
 		/* Copy Property Value
 		 * Paste Property Value */
 		
-		if (length) {
+		if (is_array_component) {
 			uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset All to Default Values"),
 			               ICON_NONE, "UI_OT_reset_default_button", "all", 1);
 			uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset Single to Default Value"),
 			               ICON_NONE, "UI_OT_reset_default_button", "all", 0);
 		}
 		else {
-			uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset to Default Value"),
-			        ICON_NONE, "UI_OT_reset_default_button");
+			uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset to Default Value"),
+			        ICON_NONE, "UI_OT_reset_default_button", "all", 1);
 		}
 		
 		uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Data Path"),
@@ -5005,7 +5070,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 	return 1;
 }
 
-static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
+static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *event)
 {
 	uiHandleButtonData *data;
 	int retval;
@@ -5918,7 +5983,7 @@ void uiContextAnimUpdate(const bContext *C)
 
 /************** handle activating a button *************/
 
-static uiBut *uit_but_find_open_event(ARegion *ar, wmEvent *event)
+static uiBut *uit_but_find_open_event(ARegion *ar, const wmEvent *event)
 {
 	uiBlock *block;
 	uiBut *but;
@@ -5931,7 +5996,7 @@ static uiBut *uit_but_find_open_event(ARegion *ar, wmEvent *event)
 	return NULL;
 }
 
-static int ui_handle_button_over(bContext *C, wmEvent *event, ARegion *ar)
+static int ui_handle_button_over(bContext *C, const wmEvent *event, ARegion *ar)
 {
 	uiBut *but;
 
@@ -5986,7 +6051,7 @@ static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiBu
 
 /************ handle events for an activated button ***********/
 
-static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
+static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
 {
 	uiHandleButtonData *data;
 	uiBlock *block;
@@ -6160,7 +6225,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
 	return retval;
 }
 
-static int ui_handle_list_event(bContext *C, wmEvent *event, ARegion *ar)
+static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *ar)
 {
 	uiBut *but = ui_list_find_mouse_over(ar, event->x, event->y);
 	int retval = WM_UI_HANDLER_CONTINUE;
@@ -6247,7 +6312,7 @@ static int ui_handle_list_event(bContext *C, wmEvent *event, ARegion *ar)
 	return retval;
 }
 
-static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut *but)
+static void ui_handle_button_return_submenu(bContext *C, const wmEvent *event, uiBut *but)
 {
 	uiHandleButtonData *data;
 	uiPopupBlockHandle *menu;
@@ -6450,7 +6515,7 @@ static int ui_menu_scroll(ARegion *ar, uiBlock *block, int my, uiBut *to_bt)
 	return 0;
 }
 
-static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, int level)
+static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu, int level)
 {
 	ARegion *ar;
 	uiBlock *block;
@@ -6559,6 +6624,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
 							ui_pan_to_scroll(event, &type, &val);
 						
 						if (val == KM_PRESS) {
+							const eButType type_flip = BUT | ROW;
 
 							PASS_EVENT_TO_PARENT_IF_NONACTIVE;
 
@@ -6571,13 +6637,13 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
 								{
 									/* the following is just a hack - uiBut->type set to BUT and BUTM have there menus built 
 									 * opposite ways - this should be changed so that all popup-menus use the same uiBlock->direction */
-									if (but->type & BUT)
+									if (but->type & type_flip)
 										but = ui_but_next(but);
 									else
 										but = ui_but_prev(but);
 								}
 								else {
-									if (but->type & BUT)
+									if (but->type & type_flip)
 										but = ui_but_prev(but);
 									else
 										but = ui_but_next(but);
@@ -6594,7 +6660,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
 								    ((ELEM(type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_RIGHT)) ||
 								    ((ELEM(type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_TOP)))
 								{
-									if ((bt = ui_but_first(block)) && (bt->type & BUT)) {
+									if ((bt = ui_but_first(block)) && (bt->type & type_flip)) {
 										bt = ui_but_last(block);
 									}
 									else {
@@ -6602,7 +6668,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
 									}
 								}
 								else {
-									if ((bt = ui_but_first(block)) && (bt->type & BUT)) {
+									if ((bt = ui_but_first(block)) && (bt->type & type_flip)) {
 										/* keep ui_but_first() */
 									}
 									else {
@@ -6860,7 +6926,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
 		return retval;
 }
 
-static int ui_handle_menu_return_submenu(bContext *C, wmEvent *event, uiPopupBlockHandle *menu)
+static int ui_handle_menu_return_submenu(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu)
 {
 	ARegion *ar;
 	uiBut *but;
@@ -6909,7 +6975,7 @@ static int ui_handle_menu_return_submenu(bContext *C, wmEvent *event, uiPopupBlo
 		return WM_UI_HANDLER_BREAK;
 }
 
-static int ui_handle_menus_recursive(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, int level)
+static int ui_handle_menus_recursive(bContext *C, const wmEvent *event, uiPopupBlockHandle *menu, int level)
 {
 	uiBut *but;
 	uiHandleButtonData *data;
@@ -6931,7 +6997,7 @@ static int ui_handle_menus_recursive(bContext *C, wmEvent *event, uiPopupBlockHa
 			retval = ui_handle_menu_return_submenu(C, event, menu);
 			submenu = NULL;  /* hint not to use this, it may be freed by call above */
 			(void)submenu;
-			/* we may wan't to quit the submenu and handle the even in this menu,
+			/* we may want to quit the submenu and handle the even in this menu,
 			 * if its important to use it, check 'data->menu' first */
 			if ((retval == WM_UI_HANDLER_BREAK) && do_ret_out_parent) {
 				retval = ui_handle_menu_event(C, event, menu, level);
@@ -6947,7 +7013,7 @@ static int ui_handle_menus_recursive(bContext *C, wmEvent *event, uiPopupBlockHa
 
 /* *************** UI event handlers **************** */
 
-static int ui_handler_region(bContext *C, wmEvent *event, void *UNUSED(userdata))
+static int ui_handler_region(bContext *C, const wmEvent *event, void *UNUSED(userdata))
 {
 	ARegion *ar;
 	uiBut *but;
@@ -7005,7 +7071,7 @@ static void ui_handler_remove_region(bContext *C, void *UNUSED(userdata))
 		ui_apply_but_funcs_after(C);
 }
 
-static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(userdata))
+static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *UNUSED(userdata))
 {
 	ARegion *ar;
 	uiBut *but;
@@ -7060,7 +7126,7 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(user
 }
 
 /* two types of popups, one with operator + enum, other with regular callbacks */
-static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata)
+static int ui_handler_popup(bContext *C, const wmEvent *event, void *userdata)
 {
 	uiPopupBlockHandle *menu = userdata;
 
@@ -7093,7 +7159,7 @@ static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata)
 				WM_operator_name_call(C, temp.optype->idname, temp.opcontext, NULL);
 		}
 		else if (temp.cancel_func)
-			temp.cancel_func(temp.popup_arg);
+			temp.cancel_func(C, temp.popup_arg);
 	}
 	else {
 		/* re-enable tooltips */
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 6878008..086e9da 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -75,10 +75,6 @@
 
 #include "interface_intern.h"
 
-
-// #define ICON_IMAGE_W        600
-// #define ICON_IMAGE_H        640
-
 #define ICON_GRID_COLS      26
 #define ICON_GRID_ROWS      30
 
@@ -89,7 +85,9 @@
 typedef struct IconImage {
 	int w;
 	int h;
-	unsigned int *rect; 
+	unsigned int *rect;
+	unsigned char *datatoc_rect;
+	int datatoc_size;
 } IconImage;
 
 typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
@@ -132,13 +130,13 @@ static IconTexture icongltex = {0, 0, 0, 0.0f, 0.0f};
 
 /* **************************************************** */
 
-static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type)
+#ifndef WITH_HEADLESS
+
+static DrawInfo *def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type)
 {
 	Icon *new_icon = NULL;
 	IconImage *iimg = NULL;
 	DrawInfo *di;
-	int y = 0;
-	int imgsize = 0;
 
 	new_icon = MEM_callocN(sizeof(Icon), "texicon");
 
@@ -155,17 +153,27 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int
 		di->data.texture.h = size;
 	}
 	else if (type == ICON_TYPE_BUFFER) {
-		iimg = MEM_mallocN(sizeof(IconImage), "icon_img");
-		iimg->rect = MEM_mallocN(size * size * sizeof(unsigned int), "icon_rect");
+		iimg = MEM_callocN(sizeof(IconImage), "icon_img");
 		iimg->w = size;
 		iimg->h = size;
 
-		/* Here we store the rect in the icon - same as before */
-		imgsize = bbuf->x;
-		for (y = 0; y < size; y++) {
-			memcpy(&iimg->rect[y * size], &bbuf->rect[(y + yofs) * imgsize + xofs], size * sizeof(int));
+		/* icon buffers can get initialized runtime now, via datatoc */
+		if (bbuf) {
+			int y, imgsize;
+			
+			iimg->rect = MEM_mallocN(size * size * sizeof(unsigned int), "icon_rect");
+			
+			/* Here we store the rect in the icon - same as before */
+			if (size == bbuf->x && size == bbuf->y && xofs == 0 && yofs == 0)
+				memcpy(iimg->rect, bbuf->rect, size * size * sizeof(int));
+			else {
+				/* this code assumes square images */
+				imgsize = bbuf->x;
+				for (y = 0; y < size; y++) {
+					memcpy(&iimg->rect[y * size], &bbuf->rect[(y + yofs) * imgsize + xofs], size * sizeof(int));
+				}
+			}
 		}
-
 		di->data.buffer.image = iimg;
 	}
 
@@ -173,6 +181,8 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int
 	new_icon->drawinfo = di;
 
 	BKE_icon_set(icon_id, new_icon);
+	
+	return di;
 }
 
 static void def_internal_vicon(int icon_id, VectorDrawFunc drawFunc)
@@ -460,24 +470,23 @@ static void vicon_move_down_draw(int x, int y, int w, int h, float UNUSED(alpha)
 }
 
 #ifndef WITH_HEADLESS
+
 static void init_brush_icons(void)
 {
 
-#define INIT_BRUSH_ICON(icon_id, name)                                        \
-	{                                                                         \
-		bbuf = IMB_ibImageFromMemory((unsigned char *)datatoc_ ##name## _png, \
-		                             datatoc_ ##name## _png_size,             \
-		                             IB_rect, NULL, "<brush icon>");          \
-		if (bbuf) {                                                           \
-			IMB_premultiply_alpha(bbuf);                                      \
-			def_internal_icon(bbuf, icon_id, 0, 0, w, ICON_TYPE_BUFFER);      \
-		}                                                                     \
-		IMB_freeImBuf(bbuf);                                                  \
-	} (void)0
+#define INIT_BRUSH_ICON(icon_id, name)                                          \
+	{                                                                           \
+		unsigned char *rect = (unsigned char *)datatoc_ ##name## _png;			\
+		int size = datatoc_ ##name## _png_size;									\
+		DrawInfo *di;															\
+		\
+		di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_BUFFER);		\
+		di->data.buffer.image->datatoc_rect = rect;								\
+		di->data.buffer.image->datatoc_size = size;								\
+	}
 	/* end INIT_BRUSH_ICON */
 
-	ImBuf *bbuf;
-	const int w = 96;
+	const int w = 96; /* warning, brush size hardcoded in C, but it gets scaled */
 
 	INIT_BRUSH_ICON(ICON_BRUSH_ADD, add);
 	INIT_BRUSH_ICON(ICON_BRUSH_BLOB, blob);
@@ -513,6 +522,68 @@ static void init_brush_icons(void)
 #undef INIT_BRUSH_ICON
 }
 
+static void icon_verify_datatoc(IconImage *iimg)
+{
+	/* if it has own rect, things are all OK */
+	if (iimg->rect)
+		return;
+	
+	if (iimg->datatoc_rect) {
+		ImBuf *bbuf = IMB_ibImageFromMemory(iimg->datatoc_rect,
+		                                    iimg->datatoc_size, IB_rect, NULL, "<matcap icon>");
+		/* w and h were set on initialize */
+		if (bbuf->x != iimg->h && bbuf->y != iimg->w)
+			IMB_scaleImBuf(bbuf, iimg->w, iimg->h);
+		
+		iimg->rect = bbuf->rect;
+		bbuf->rect = NULL;
+		IMB_freeImBuf(bbuf);
+	}
+}
+
+static void init_matcap_icons(void)
+{
+	/* dynamic allocation now, tucking datatoc pointers in DrawInfo */
+#define INIT_MATCAP_ICON(icon_id, name)                                       \
+	{                                                                         \
+		unsigned char *rect = (unsigned char *)datatoc_ ##name## _jpg;        \
+		int size = datatoc_ ##name## _jpg_size;                               \
+		DrawInfo *di;                                                         \
+		                                                                      \
+		di = def_internal_icon(NULL, icon_id, 0, 0, 96, ICON_TYPE_BUFFER);   \
+		di->data.buffer.image->datatoc_rect = rect;                           \
+		di->data.buffer.image->datatoc_size = size;                           \
+	} (void)0
+
+	INIT_MATCAP_ICON(ICON_MATCAP_01, mc01);
+	INIT_MATCAP_ICON(ICON_MATCAP_02, mc02);
+	INIT_MATCAP_ICON(ICON_MATCAP_03, mc03);
+	INIT_MATCAP_ICON(ICON_MATCAP_04, mc04);
+	INIT_MATCAP_ICON(ICON_MATCAP_05, mc05);
+	INIT_MATCAP_ICON(ICON_MATCAP_06, mc06);
+	INIT_MATCAP_ICON(ICON_MATCAP_07, mc07);
+	INIT_MATCAP_ICON(ICON_MATCAP_08, mc08);
+	INIT_MATCAP_ICON(ICON_MATCAP_09, mc09);
+	INIT_MATCAP_ICON(ICON_MATCAP_10, mc10);
+	INIT_MATCAP_ICON(ICON_MATCAP_11, mc11);
+	INIT_MATCAP_ICON(ICON_MATCAP_12, mc12);
+	INIT_MATCAP_ICON(ICON_MATCAP_13, mc13);
+	INIT_MATCAP_ICON(ICON_MATCAP_14, mc14);
+	INIT_MATCAP_ICON(ICON_MATCAP_15, mc15);
+	INIT_MATCAP_ICON(ICON_MATCAP_16, mc16);
+	INIT_MATCAP_ICON(ICON_MATCAP_17, mc17);
+	INIT_MATCAP_ICON(ICON_MATCAP_18, mc18);
+	INIT_MATCAP_ICON(ICON_MATCAP_19, mc19);
+	INIT_MATCAP_ICON(ICON_MATCAP_20, mc20);
+	INIT_MATCAP_ICON(ICON_MATCAP_21, mc21);
+	INIT_MATCAP_ICON(ICON_MATCAP_22, mc22);
+	INIT_MATCAP_ICON(ICON_MATCAP_23, mc23);
+	INIT_MATCAP_ICON(ICON_MATCAP_24, mc24);
+
+#undef INIT_MATCAP_ICON
+
+}
+
 static void init_internal_icons(void)
 {
 //	bTheme *btheme = UI_GetTheme();
@@ -613,8 +684,8 @@ static void init_internal_icons(void)
 
 	def_internal_vicon(VICO_VIEW3D_VEC, vicon_view3d_draw);
 	def_internal_vicon(VICO_EDIT_VEC, vicon_edit_draw);
-	def_internal_vicon(VICO_EDITMODE_DEHLT, vicon_editmode_dehlt_draw);
-	def_internal_vicon(VICO_EDITMODE_HLT, vicon_editmode_hlt_draw);
+	def_internal_vicon(VICO_EDITMODE_VEC_DEHLT, vicon_editmode_dehlt_draw);
+	def_internal_vicon(VICO_EDITMODE_VEC_HLT, vicon_editmode_hlt_draw);
 	def_internal_vicon(VICO_DISCLOSURE_TRI_RIGHT_VEC, vicon_disclosure_tri_right_draw);
 	def_internal_vicon(VICO_DISCLOSURE_TRI_DOWN_VEC, vicon_disclosure_tri_down_draw);
 	def_internal_vicon(VICO_MOVE_UP_VEC, vicon_move_up_draw);
@@ -720,6 +791,8 @@ static void free_iconfile_list(struct ListBase *list)
 	}
 }
 
+#endif  /* WITH_HEADLESS */
+
 int UI_iconfile_get_index(const char *filename)
 {
 	IconFile *ifile;
@@ -762,7 +835,8 @@ void UI_icons_free_drawinfo(void *drawinfo)
 	if (di) {
 		if (di->type == ICON_TYPE_BUFFER) {
 			if (di->data.buffer.image) {
-				MEM_freeN(di->data.buffer.image->rect);
+				if (di->data.buffer.image->rect)
+					MEM_freeN(di->data.buffer.image->rect);
 				MEM_freeN(di->data.buffer.image);
 			}
 		}
@@ -842,6 +916,7 @@ void UI_icons_init(int first_dyn_id)
 	BKE_icons_init(first_dyn_id);
 	init_internal_icons();
 	init_brush_icons();
+	init_matcap_icons();
 #endif
 }
 
@@ -891,6 +966,34 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage *prv_img, enum eIco
 	                    prv_img->w[size], prv_img->h[size]);
 }
 
+PreviewImage *UI_icon_to_preview(int icon_id)
+{
+	Icon *icon = BKE_icon_get(icon_id);
+	
+	if (icon) {
+		DrawInfo *di = (DrawInfo *)icon->drawinfo;
+		if (di && di->data.buffer.image) {
+			ImBuf *bbuf;
+			
+			bbuf = IMB_ibImageFromMemory(di->data.buffer.image->datatoc_rect, di->data.buffer.image->datatoc_size, IB_rect, NULL, "<matcap buffer>");
+			if (bbuf) {
+				PreviewImage *prv = BKE_previewimg_create();
+				
+				prv->rect[0] = bbuf->rect;
+
+				prv->w[0] = bbuf->x;
+				prv->h[0] = bbuf->y;
+				
+				bbuf->rect = NULL;
+				IMB_freeImBuf(bbuf);
+				
+				return prv;
+			}
+		}
+	}
+	return NULL;
+}
+
 static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh,
                            unsigned int *rect, float alpha, const float rgb[3], short is_preview)
 {
@@ -994,6 +1097,8 @@ static int get_draw_size(enum eIconSizes size)
 	return 0;
 }
 
+
+
 static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, const float rgb[3],
                            enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
 {
@@ -1029,7 +1134,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
 	if (di->type == ICON_TYPE_VECTOR) {
 		/* vector icons use the uiBlock transformation, they are not drawn
 		 * with untransformed coordinates like the other icons */
-		di->data.vector.func((int)x, (int)y, ICON_DEFAULT_HEIGHT, ICON_DEFAULT_HEIGHT, 1.0f); 
+		di->data.vector.func((int)x, (int)y, w, h, 1.0f);
 	}
 	else if (di->type == ICON_TYPE_TEXTURE) {
 		/* texture image use premul alpha for correct scaling */
@@ -1041,7 +1146,9 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
 	else if (di->type == ICON_TYPE_BUFFER) {
 		/* it is a builtin icon */
 		iimg = di->data.buffer.image;
-
+#ifndef WITH_HEADLESS
+		icon_verify_datatoc(iimg);
+#endif
 		if (!iimg->rect) return;  /* something has gone wrong! */
 
 		glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 706301d..b1e8b7b 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -319,7 +319,7 @@ struct uiBlock {
 	void *handle_func_arg;
 	
 	/* custom extra handling */
-	int (*block_event_func)(const struct bContext *C, struct uiBlock *, struct wmEvent *);
+	int (*block_event_func)(const struct bContext *C, struct uiBlock *, const struct wmEvent *);
 	
 	/* extra draw function for custom blocks */
 	void (*drawextra)(const struct bContext *C, void *idv, void *arg1, void *arg2, rcti *rect);
@@ -429,7 +429,7 @@ struct uiPopupBlockHandle {
 
 	int popup;
 	void (*popup_func)(struct bContext *C, void *arg, int event);
-	void (*cancel_func)(void *arg);
+	void (*cancel_func)(struct bContext *C, void *arg);
 	void *popup_arg;
 	
 	struct wmTimer *scrolltimer;
@@ -468,7 +468,7 @@ ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBu
 int ui_searchbox_inside(struct ARegion *ar, int x, int y);
 void ui_searchbox_update(struct bContext *C, struct ARegion *ar, uiBut *but, int reset);
 void ui_searchbox_autocomplete(struct bContext *C, struct ARegion *ar, uiBut *but, char *str);
-void ui_searchbox_event(struct bContext *C, struct ARegion *ar, uiBut *but, struct wmEvent *event);
+void ui_searchbox_event(struct bContext *C, struct ARegion *ar, uiBut *but, const struct wmEvent *event);
 void ui_searchbox_apply(uiBut *but, struct ARegion *ar);
 void ui_searchbox_free(struct bContext *C, struct ARegion *ar);
 void ui_but_search_test(uiBut *but);
@@ -489,7 +489,7 @@ int ui_step_name_menu(uiBut *but, int step);
 struct AutoComplete;
 
 /* interface_panel.c */
-extern int ui_handler_panel_region(struct bContext *C, struct wmEvent *event);
+extern int ui_handler_panel_region(struct bContext *C, const struct wmEvent *event);
 extern void ui_draw_aligned_panel(struct uiStyle *style, uiBlock *block, rcti *rect);
 
 /* interface_draw.c */
@@ -507,7 +507,7 @@ void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rct
 void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect);
 
 /* interface_handlers.c */
-extern void ui_pan_to_scroll(struct wmEvent *event, int *type, int *val);
+extern void ui_pan_to_scroll(const struct wmEvent *event, int *type, int *val);
 extern void ui_button_activate_do(struct bContext *C, struct ARegion *ar, uiBut *but);
 extern void ui_button_active_free(const struct bContext *C, uiBut *but);
 extern int ui_button_is_active(struct ARegion *ar);
@@ -537,6 +537,8 @@ extern unsigned char checker_stipple_sml[32 * 32 / 8];
 #define UI_TRANSP_DARK 100
 #define UI_TRANSP_LIGHT 160
 
+#define UI_TEXT_MARGIN_X 0.4f
+
 /* interface_style.c */
 void uiStyleInit(void);
 
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 3b0a1cd..c69f53a 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -491,7 +491,14 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt
 
 	RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
 
-	uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1));
+	/* we dont want nested rows, cols in menus */
+	if (layout->root->type != UI_LAYOUT_MENU) {
+		uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1));
+	}
+	else {
+		uiBlockSetCurLayout(block, layout);
+	}
+
 	for (a = 0; a < totitem; a++) {
 		if (!item[a].identifier[0])
 			continue;
@@ -617,6 +624,18 @@ void uiFileBrowseContextProperty(const bContext *C, PointerRNA *ptr, PropertyRNA
 
 /********************* Button Items *************************/
 
+/**
+ * Update a buttons tip with an enum's description if possible.
+ */
+static void ui_but_tip_from_enum_item(uiBut *but, EnumPropertyItem *item)
+{
+	if (but->tip == NULL || but->tip[0] == '\0') {
+		if (item->description && item->description[0]) {
+			but->tip = item->description;
+		}
+	}
+}
+
 /* disabled item */
 static void ui_item_disabled(uiLayout *layout, const char *name)
 {
@@ -830,6 +849,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
 				else {
 					uiItemEnumO_ptr__internal(column, ot, item[i].name, item[i].icon, prop, item[i].value);
 				}
+				ui_but_tip_from_enum_item(block->buttons.last, &item[i]);
 			}
 			else {
 				if (item[i].name) {
@@ -842,6 +862,8 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
 					uiItemL(column, item[i].name, ICON_NONE);
 					bt = block->buttons.last;
 					bt->flag = UI_TEXT_LEFT;
+
+					ui_but_tip_from_enum_item(bt, &item[i]);
 				}
 				else {  /* XXX bug here, colums draw bottom item badly */
 					uiItemS(column);
@@ -1232,6 +1254,7 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname
 		for (i = 0; i < totitem; i++) {
 			if (item[i].identifier[0]) {
 				uiItemEnumR(column, item[i].name, ICON_NONE, ptr, propname, item[i].value);
+				ui_but_tip_from_enum_item(block->buttons.last, &item[i]);
 			}
 			else {
 				if (item[i].name) {
@@ -1244,6 +1267,8 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname
 					uiItemL(column, item[i].name, ICON_NONE);
 					bt = block->buttons.last;
 					bt->flag = UI_TEXT_LEFT;
+
+					ui_but_tip_from_enum_item(bt, &item[i]);
 				}
 				else
 					uiItemS(column);
@@ -1386,7 +1411,11 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
 
 	/* turn button into search button */
 	if (searchprop) {
-		but->type = SEARCH_MENU_UNLINK;
+		if (RNA_property_flag(prop) & PROP_NEVER_UNLINK)
+			but->type = SEARCH_MENU;
+		else
+			but->type = SEARCH_MENU_UNLINK;
+
 		but->hardmax = MAX2(but->hardmax, 256.0f);
 		but->rnasearchpoin = *searchptr;
 		but->rnasearchprop = searchprop;
@@ -1456,6 +1485,7 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna
 	block = uiLayoutGetBlock(layout);
 
 	ui_item_rna_size(layout, name, icon, ptr, prop, 0, 0, &w, &h);
+	w += UI_UNIT_X; /* X icon needs more space */
 	but = ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h, 0);
 
 	ui_but_add_search(but, ptr, prop, searchptr, searchprop);
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index e57e52d..e03a171 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -661,11 +661,12 @@ static int reports_to_text_poll(bContext *C)
 static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	ReportList *reports = CTX_wm_reports(C);
+	Main *bmain = CTX_data_main(C);
 	Text *txt;
 	char *str;
 	
 	/* create new text-block to write to */
-	txt = BKE_text_add("Recent Reports");
+	txt = BKE_text_add(bmain, "Recent Reports");
 	
 	/* convert entire list to a display string, and add this to the text-block
 	 *	- if commandline debug option enabled, show debug reports too
@@ -803,7 +804,7 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
 	}
 
 	if (text == NULL) {
-		text = BKE_text_load(filepath, bmain->name);
+		text = BKE_text_load(bmain, filepath, bmain->name);
 	}
 
 	if (text == NULL) {
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 1df10f9..e466c48 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -247,6 +247,14 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int
 		}
 	}
 
+	/* Do not allow closed panels without headers! Else user could get "disappeared" UI! */
+	if ((pt->flag & PNL_NO_HEADER) && (pa->flag & PNL_CLOSED)) {
+		pa->flag &= ~PNL_CLOSED;
+		/* Force update of panels' positions! */
+		pa->sizex = 0;
+		pa->sizey = 0;
+	}
+
 	BLI_strncpy(pa->drawname, drawname, UI_MAX_NAME_STR);
 
 	/* if a new panel is added, we insert it right after the panel
@@ -439,8 +447,8 @@ static void ui_draw_panel_dragwidget(const rctf *rect)
 	ymin = rect->ymin;
 	ymax = rect->ymax;
 	
-	dx = 0.333f * (xmax - xmin);
-	dy = 0.333f * (ymax - ymin);
+	dx = (xmax - xmin) / 3.0f;
+	dy = (ymax - ymin) / 3.0f;
 	
 	glEnable(GL_BLEND);
 	glColor4ub(255, 255, 255, 50);
@@ -522,11 +530,9 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
 		float y = headrect.ymax;
 
 		glEnable(GL_BLEND);
-
 		
 		if (UI_GetThemeValue(TH_PANEL_SHOW_HEADER)) {
 			/* draw with background color */
-			glEnable(GL_BLEND);
 			UI_ThemeColor4(TH_PANEL_HEADER);
 			glRectf(minx, headrect.ymin + 1, maxx, y);
 
@@ -542,7 +548,6 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
 			fdrawline(minx, y, maxx, y);
 			glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
 			fdrawline(minx, y - 1, maxx, y - 1);
-			glDisable(GL_BLEND);
 		}
 
 		glDisable(GL_BLEND);
@@ -870,7 +875,7 @@ static void ui_do_animate(const bContext *C, Panel *panel)
 void uiBeginPanels(const bContext *UNUSED(C), ARegion *ar)
 {
 	Panel *pa;
-  
+
 	/* set all panels as inactive, so that at the end we know
 	 * which ones were used */
 	for (pa = ar->panels.first; pa; pa = pa->next) {
@@ -1011,7 +1016,7 @@ static void check_panel_overlap(ARegion *ar, Panel *panel)
 
 /************************ panel dragging ****************************/
 
-static void ui_do_drag(const bContext *C, wmEvent *event, Panel *panel)
+static void ui_do_drag(const bContext *C, const wmEvent *event, Panel *panel)
 {
 	uiHandlePanelData *data = panel->activedata;
 	ScrArea *sa = CTX_wm_area(C);
@@ -1129,7 +1134,7 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
 /* XXX should become modal keymap */
 /* AKey is opening/closing panels, independent of button state now */
 
-int ui_handler_panel_region(bContext *C, wmEvent *event)
+int ui_handler_panel_region(bContext *C, const wmEvent *event)
 {
 	ARegion *ar = CTX_wm_region(C);
 	uiBlock *block;
@@ -1157,8 +1162,9 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
 			if (block->rect.xmin <= mx && block->rect.xmin + PNL_HEADER >= mx)
 				inside_header = 1;
 		}
-		else if (block->rect.xmin > mx || block->rect.xmax < mx);
+		else if (block->rect.xmin > mx || block->rect.xmax < mx) {
 			/* outside left/right side */
+		}
 		else if ((block->rect.ymax <= my) && (block->rect.ymax + PNL_HEADER >= my)) {
 			inside_header = 1;
 		}
@@ -1271,7 +1277,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
 /**************** window level modal panel interaction **************/
 
 /* note, this is modal handler and should not swallow events for animation */
-static int ui_handler_panel(bContext *C, wmEvent *event, void *userdata)
+static int ui_handler_panel(bContext *C, const wmEvent *event, void *userdata)
 {
 	Panel *panel = userdata;
 	uiHandlePanelData *data = panel->activedata;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index ca5e2a1..03c127f 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -651,7 +651,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
 	ofsx = 0; //(but->block->panel) ? but->block->panel->ofsx : 0;
 	ofsy = 0; //(but->block->panel) ? but->block->panel->ofsy : 0;
 
-	rect_fl.xmin = (but->rect.xmin + but->rect.xmax) * 0.5f + ofsx - TIP_BORDER_X;
+	rect_fl.xmin = BLI_rctf_cent_x(&but->rect) + ofsx - TIP_BORDER_X;
 	rect_fl.xmax = rect_fl.xmin + fontw + TIP_BORDER_X;
 	rect_fl.ymax = but->rect.ymin + ofsy - TIP_BORDER_Y;
 	rect_fl.ymin = rect_fl.ymax - fonth  - TIP_BORDER_Y;
@@ -893,7 +893,7 @@ void ui_searchbox_apply(uiBut *but, ARegion *ar)
 	}
 }
 
-void ui_searchbox_event(bContext *C, ARegion *ar, uiBut *but, wmEvent *event)
+void ui_searchbox_event(bContext *C, ARegion *ar, uiBut *but, const wmEvent *event)
 {
 	uiSearchboxData *data = ar->regiondata;
 	int type = event->type, val = event->val;
@@ -1532,7 +1532,7 @@ static void ui_block_region_draw(const bContext *C, ARegion *ar)
 static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
 {
 	uiBut *bt;
-	int width = UI_ThemeMenuShadowWidth();
+	int width = UI_SCREEN_MARGIN;
 	int winx, winy;
 
 	if (block->flag & UI_BLOCK_NO_WIN_CLIP) {
@@ -2195,7 +2195,7 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
 }
 
 
-static int ui_picker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *block, wmEvent *event)
+static int ui_picker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *block, const wmEvent *event)
 {
 	float add = 0.0f;
 	
@@ -2574,7 +2574,7 @@ static void operator_cb(bContext *C, void *arg, int retval)
 		WM_operator_free(op);
 }
 
-static void confirm_cancel_operator(void *opv)
+static void confirm_cancel_operator(bContext *UNUSED(C), void *opv)
 {
 	WM_operator_free(opv);
 }
@@ -2621,7 +2621,7 @@ void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...)
 	va_list ap;
 	char titlestr[256];
 
-	BLI_snprintf(titlestr, sizeof(titlestr), "OK? %%i%d", ICON_QUESTION);
+	BLI_snprintf(titlestr, sizeof(titlestr), IFACE_("OK? %%i%d"), ICON_QUESTION);
 
 	va_start(ap, str);
 	vconfirm_opname(C, opname, titlestr, str, ap);
@@ -2635,7 +2635,7 @@ void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...)
  * The operator state for this is implicitly OPERATOR_RUNNING_MODAL */
 void uiPupMenuSaveOver(bContext *C, wmOperator *op, const char *filename)
 {
-	confirm_operator(C, op, "Save Over?", filename);
+	confirm_operator(C, op, IFACE_("Save Over?"), filename);
 }
 
 void uiPupMenuNotice(bContext *C, const char *str, ...)
@@ -2653,7 +2653,7 @@ void uiPupMenuError(bContext *C, const char *str, ...)
 	char nfmt[256];
 	char titlestr[256];
 
-	BLI_snprintf(titlestr, sizeof(titlestr), "Error %%i%d", ICON_ERROR);
+	BLI_snprintf(titlestr, sizeof(titlestr), IFACE_("Error %%i%d"), ICON_ERROR);
 
 	BLI_strncpy(nfmt, str, sizeof(nfmt));
 
@@ -2680,13 +2680,13 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
 			/* pass */
 		}
 		else if (report->type >= RPT_ERROR) {
-			BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message);
+			BLI_dynstr_appendf(ds, IFACE_("Error %%i%d%%t|%s"), ICON_ERROR, report->message);
 		}
 		else if (report->type >= RPT_WARNING) {
-			BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message);
+			BLI_dynstr_appendf(ds, IFACE_("Warning %%i%d%%t|%s"), ICON_ERROR, report->message);
 		}
 		else if (report->type >= RPT_INFO) {
-			BLI_dynstr_appendf(ds, "Info %%i%d%%t|%s", ICON_INFO, report->message);
+			BLI_dynstr_appendf(ds, IFACE_("Info %%i%d%%t|%s"), ICON_INFO, report->message);
 		}
 	}
 
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index a190f3d..8e4d028 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -34,11 +34,14 @@
 #include "DNA_dynamicpaint_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
+#include "DNA_object_force.h"
 
 #include "BLI_utildefines.h"
 #include "BLI_string.h"
 #include "BLI_ghash.h"
 #include "BLI_rect.h"
+#include "BLI_math.h"
+#include "BLI_listbase.h"
 
 #include "BLF_api.h"
 #include "BLF_translation.h"
@@ -46,22 +49,27 @@
 #include "BKE_animsys.h"
 #include "BKE_colortools.h"
 #include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_displist.h"
 #include "BKE_dynamicpaint.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
-#include "BKE_object.h"
 #include "BKE_material.h"
-#include "BKE_texture.h"
+#include "BKE_modifier.h"
+#include "BKE_object.h"
+#include "BKE_packedFile.h"
+#include "BKE_particle.h"
 #include "BKE_report.h"
-#include "BKE_displist.h"
 #include "BKE_sca.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
+#include "BKE_texture.h"
 
 #include "ED_screen.h"
 #include "ED_object.h"
 #include "ED_render.h"
+#include "ED_util.h"
 
 #include "RNA_access.h"
 #include "RNA_enum_types.h"
@@ -504,7 +512,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
 		                                 BLF_I18NCONTEXT_ID_CAMERA,
 		                                 BLF_I18NCONTEXT_ID_WORLD,
 		                                 BLF_I18NCONTEXT_ID_SCREEN,
-		                                 BLF_I18NCONTEXT_ID_TEXT);
+		                                 BLF_I18NCONTEXT_ID_TEXT,
+		);
 		BLF_I18N_MSGID_MULTI_CTXT("New", BLF_I18NCONTEXT_ID_SPEAKER,
 		                                 BLF_I18NCONTEXT_ID_SOUND,
 		                                 BLF_I18NCONTEXT_ID_ARMATURE,
@@ -512,7 +521,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
 		                                 BLF_I18NCONTEXT_ID_NODETREE,
 		                                 BLF_I18NCONTEXT_ID_BRUSH,
 		                                 BLF_I18NCONTEXT_ID_PARTICLESETTINGS,
-		                                 BLF_I18NCONTEXT_ID_GPENCIL);
+		                                 BLF_I18NCONTEXT_ID_GPENCIL,
+		);
 		
 		if (newop) {
 			but = uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN,
@@ -529,7 +539,18 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
 			uiButSetFlag(but, UI_BUT_DISABLED);
 	}
 
-	if (flag & UI_ID_OPEN) {
+	/* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack.
+	   Only for images, sound and fonts */
+	if (id && BKE_pack_check(id)) {
+		but = uiDefIconButO(block, BUT, "FILE_OT_unpack_item", WM_OP_INVOKE_REGION_WIN, ICON_PACKAGE, 0, 0,
+		                    UI_UNIT_X, UI_UNIT_Y, TIP_("Packed File, click to unpack"));
+		uiButGetOperatorPtrRNA(but);
+		
+		RNA_string_set(but->opptr, "id_name", id->name + 2);
+		RNA_int_set(but->opptr, "id_type", GS(id->name));
+		
+	}
+	else if (flag & UI_ID_OPEN) {
 		int w = id ? UI_UNIT_X : (flag & UI_ID_ADD_NEW) ? UI_UNIT_X * 3 : UI_UNIT_X * 6;
 		
 		if (openop) {
@@ -670,7 +691,7 @@ void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, co
 			uiItemL(row, text, ICON_NONE);
 	}
 	else
-		uiItemL(row, "ID-Block:", ICON_NONE);
+		uiItemL(row, IFACE_("ID-Block:"), ICON_NONE);
 	
 	/* ID-Type Selector - just have a menu of icons */
 	/* FIXME: the icon-only setting doesn't work when we supply a blank name */
@@ -714,22 +735,7 @@ void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propna
 
 /************************ Modifier Template *************************/
 
-#define ERROR_LIBDATA_MESSAGE "Can't edit external libdata"
-
-#include <string.h>
-
-#include "DNA_object_force.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_modifier.h"
-#include "BKE_particle.h"
-
-#include "ED_util.h"
-
-#include "BLI_math.h"
-#include "BLI_listbase.h"
-
-#include "ED_object.h"
+#define ERROR_LIBDATA_MESSAGE IFACE_("Can't edit external libdata")
 
 static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v)
 {
@@ -829,8 +835,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
 		block = uiLayoutGetBlock(row);
 		/* VIRTUAL MODIFIER */
 		/* XXX this is not used now, since these cannot be accessed via RNA */
-		BLI_snprintf(str, sizeof(str), "%s parent deform", md->name);
-		uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name"); 
+		BLI_snprintf(str, sizeof(str), IFACE_("%s parent deform"), md->name);
+		uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Modifier name"));
 		
 		but = uiDefBut(block, BUT, 0, IFACE_("Make Real"), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0,
 		               TIP_("Convert virtual modifier to a real modifier"));
@@ -937,18 +943,22 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
 				
 				if (!(ob->mode & OB_MODE_PARTICLE_EDIT) && psys->pathcache) {
 					if (ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB))
-						uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_duplicates_make_real");
+						uiItemO(row, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Convert"), ICON_NONE,
+						        "OBJECT_OT_duplicates_make_real");
 					else if (psys->part->ren_as == PART_DRAW_PATH)
-						uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_modifier_convert");
+						uiItemO(row, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Convert"), ICON_NONE,
+						        "OBJECT_OT_modifier_convert");
 				}
 			}
 			else {
 				uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT);
-				uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply"), 0, "apply_as", MODIFIER_APPLY_DATA);
+				uiItemEnumO(row, "OBJECT_OT_modifier_apply", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Apply"),
+				            0, "apply_as", MODIFIER_APPLY_DATA);
 				
 				if (modifier_isSameTopology(md) && !modifier_isNonGeometrical(md)) {
-					uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply as Shape Key"), 0,
-					            "apply_as", MODIFIER_APPLY_SHAPE);
+					uiItemEnumO(row, "OBJECT_OT_modifier_apply",
+					            CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Apply as Shape Key"),
+					            0, "apply_as", MODIFIER_APPLY_SHAPE);
 				}
 			}
 			
@@ -958,7 +968,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
 			if (!ELEM5(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem,
 			           eModifierType_Cloth, eModifierType_Smoke))
 			{
-				uiItemO(row, IFACE_("Copy"), ICON_NONE, "OBJECT_OT_modifier_copy");
+				uiItemO(row, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE,
+				        "OBJECT_OT_modifier_copy");
 			}
 		}
 		
@@ -1080,10 +1091,10 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
 	cti = BKE_constraint_get_typeinfo(con);
 	if (cti == NULL) {
 		/* exception for 'Null' constraint - it doesn't have constraint typeinfo! */
-		BLI_strncpy(typestr, (con->type == CONSTRAINT_TYPE_NULL) ? "Null" : "Unknown", sizeof(typestr));
+		BLI_strncpy(typestr, (con->type == CONSTRAINT_TYPE_NULL) ? IFACE_("Null") : IFACE_("Unknown"), sizeof(typestr));
 	}
 	else
-		BLI_strncpy(typestr, cti->name, sizeof(typestr));
+		BLI_strncpy(typestr, IFACE_(cti->name), sizeof(typestr));
 		
 	/* determine whether constraint is proxy protected or not */
 	if (BKE_proxylocked_constraints_owner(ob, pchan))
@@ -1188,7 +1199,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
 
 	/* Set but-locks for protected settings (magic numbers are used here!) */
 	if (proxy_protected)
-		uiBlockSetButLock(block, 1, "Cannot edit Proxy-Protected Constraint");
+		uiBlockSetButLock(block, 1, IFACE_("Cannot edit Proxy-Protected Constraint"));
 
 	/* Draw constraint data */
 	if ((con->flag & CONSTRAINT_EXPAND) == 0) {
@@ -1472,7 +1483,7 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
 		RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
 		row = uiLayoutRow(layout, FALSE);
 
-		uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE);
+		uiItemR(row, &ptr, "position", 0, IFACE_("Pos"), ICON_NONE);
 		bt = block->buttons.last;
 		uiButSetFunc(bt, colorband_update_cb, bt, coba);
 
@@ -1554,6 +1565,90 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname
 	MEM_freeN(cb);
 }
 
+
+/********************* Icon viewer Template ************************/
+
+/* ID Search browse menu, open */
+static uiBlock *icon_view_menu(bContext *C, ARegion *ar, void *arg_litem)
+{
+	static RNAUpdateCb cb;
+	uiBlock *block;
+	uiBut *but;
+	int icon;
+	EnumPropertyItem *item;
+	int a, free;
+
+	/* arg_litem is malloced, can be freed by parent button */
+	cb = *((RNAUpdateCb *)arg_litem);
+	
+	/* unused */
+	// icon = RNA_property_enum_get(&cb.ptr, cb.prop);
+	
+	block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+	uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW);
+	
+	
+	RNA_property_enum_items(C, &cb.ptr, cb.prop, &item, NULL, &free);
+	
+	for (a = 0; item[a].identifier; a++) {
+		int x, y;
+		
+		/* XXX hardcoded size to 5 x unit */
+		x = (a % 8) * UI_UNIT_X * 5;
+		y = (a / 8) * UI_UNIT_X * 5;
+		
+		icon = item[a].icon;
+		but = uiDefIconButR_prop(block, ROW, 0, icon, x, y, UI_UNIT_X * 5, UI_UNIT_Y * 5, &cb.ptr, cb.prop, -1, 0, icon, -1, -1, NULL);
+		uiButSetFlag(but, UI_HAS_ICON | UI_ICON_PREVIEW);
+	}
+
+	uiBoundsBlock(block, 0.3f * U.widget_unit);
+	uiBlockSetDirection(block, UI_TOP);
+	uiEndBlock(C, block);
+		
+	if (free) {
+		MEM_freeN(item);
+	}
+	
+	return block;
+}
+
+void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname)
+{
+	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+	RNAUpdateCb *cb;
+	uiBlock *block;
+	uiBut *but;
+//	rctf rect;  /* UNUSED */
+	int icon;
+	
+	if (!prop || RNA_property_type(prop) != PROP_ENUM)
+		return;
+	
+	icon = RNA_property_enum_get(ptr, prop);
+	
+	cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
+	cb->ptr = *ptr;
+	cb->prop = prop;
+	
+//	rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X;
+//	rect.ymin = 0; rect.ymax = 10.0f * UI_UNIT_X;
+	
+	block = uiLayoutAbsoluteBlock(layout);
+
+	but = uiDefBlockButN(block, icon_view_menu, MEM_dupallocN(cb), "", 0, 0, UI_UNIT_X * 6, UI_UNIT_Y * 6, "");
+
+	
+//	but = uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, BLI_rctf_size_x(&rect), BLI_rctf_size_y(&rect), ptr, prop, -1, 0, icon, -1, -1, NULL);
+	
+	but->icon = icon;
+	uiButSetFlag(but, UI_HAS_ICON | UI_ICON_PREVIEW);
+	
+	uiButSetNFunc(but, rna_update_cb, MEM_dupallocN(cb), NULL);
+	
+	MEM_freeN(cb);
+}
+
 /********************* Histogram Template ************************/
 
 void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname)
@@ -1759,7 +1854,7 @@ static uiBlock *curvemap_clipping_func(bContext *C, ARegion *ar, void *cumap_v)
 	/* use this for a fake extra empy space around the buttons */
 	uiDefBut(block, LABEL, 0, "",           -4, 16, width + 8, 6 * UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
 
-	bt = uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, "Use Clipping",
+	bt = uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, IFACE_("Use Clipping"),
 	                  0, 5 * UI_UNIT_Y, width, UI_UNIT_Y, &cumap->flag, 0.0, 0.0, 10, 0, "");
 	uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL);
 
@@ -2020,16 +2115,22 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
 	}
 
 	if (cmp) {
-		const float range_clamp[2]   = {0.0f, 1.0f};
-		const float range_unclamp[2] = {-1000.0f, 1000.0f};  /* arbitrary limits here */
-		const float *range = (cumap->flag & CUMA_DO_CLIP) ? range_clamp : range_unclamp;
+		rctf bounds;
+
+		if (cumap->flag & CUMA_DO_CLIP) {
+			bounds = cumap->clipr;
+		}
+		else {
+			bounds.xmin = bounds.ymin = -1000.0;
+			bounds.xmax = bounds.ymax =  1000.0;
+		}
 
 		uiLayoutRow(layout, TRUE);
 		uiBlockSetNFunc(block, curvemap_buttons_update, MEM_dupallocN(cb), cumap);
 		bt = uiDefButF(block, NUM, 0, "X", 0, 2 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y,
-		               &cmp->x, range[0], range[1], 1, 5, "");
+		               &cmp->x, bounds.xmin, bounds.xmax, 1, 5, "");
 		bt = uiDefButF(block, NUM, 0, "Y", 0, 1 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y,
-		               &cmp->y, range[0], range[1], 1, 5, "");
+		               &cmp->y, bounds.ymin, bounds.ymax, 1, 5, "");
 	}
 
 	/* black/white levels */
@@ -2383,6 +2484,13 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
 	int min, max;
 
 	/* validate arguments */
+	/* Forbid default UI_UL_DEFAULT_CLASS_NAME list class without a custom list_id! */
+	if (!strcmp(UI_UL_DEFAULT_CLASS_NAME, listtype_name) && !(list_id && list_id[0])) {
+		RNA_warning("template_list using default '%s' UIList class must provide a custom list_id",
+		            UI_UL_DEFAULT_CLASS_NAME);
+		return;
+	}
+
 	block = uiLayoutGetBlock(layout);
 
 	if (!active_dataptr->data) {
@@ -2906,7 +3014,7 @@ void uiTemplateColorspaceSettings(uiLayout *layout, PointerRNA *ptr, const char
 
 	colorspace_settings_ptr = RNA_property_pointer_get(ptr, prop);
 
-	uiItemL(layout, "Input Color Space:", ICON_NONE);
+	uiItemL(layout, IFACE_("Input Color Space:"), ICON_NONE);
 	uiItemR(layout, &colorspace_settings_ptr, "name", 0, "", ICON_NONE);
 }
 
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 6b44a82..68df8e2 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -346,7 +346,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, const rcti *re
 	                  (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) == (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2;
 
 	minsize = min_ii(BLI_rcti_size_x(rect) * hnum,
-	               BLI_rcti_size_y(rect) * vnum);
+	                 BLI_rcti_size_y(rect) * vnum);
 	
 	if (2.0f * rad > minsize)
 		rad = 0.5f * minsize;
@@ -646,8 +646,8 @@ static void widget_verts_to_quad_strip_open(uiWidgetBase *wtb, const int totvert
 	for (a = 0; a < totvert; a++) {
 		quad_strip[a * 2][0] = wtb->outer_v[a][0];
 		quad_strip[a * 2][1] = wtb->outer_v[a][1];
-		quad_strip[a * 2 + 1][0] = wtb->inner_v[a][0];
-		quad_strip[a * 2 + 1][1] = wtb->inner_v[a][1];
+		quad_strip[a * 2 + 1][0] = wtb->outer_v[a][0];
+		quad_strip[a * 2 + 1][1] = wtb->outer_v[a][1] - 1.0f;
 	}
 }
 
@@ -1325,11 +1325,11 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
 			rect->xmin += (int)(0.8f * BLI_rcti_size_y(rect));
 
 			if (but->editstr || (but->flag & UI_TEXT_LEFT)) {
-				rect->xmin += (0.4f * U.widget_unit) / but->block->aspect;
+				rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
 			}
 		}
 		else if ((but->flag & UI_TEXT_LEFT)) {
-			rect->xmin += (0.4f * U.widget_unit) / but->block->aspect;
+			rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
 		}
 		
 		/* unlink icon for this button type */
@@ -1794,11 +1794,19 @@ static void widget_state_menu_item(uiWidgetType *wt, int state)
 {
 	wt->wcol = *(wt->wcol_theme);
 	
-	if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE)) {
-		wt->wcol.text[0] = 0.5f * (wt->wcol.text[0] + wt->wcol.text_sel[0]);
-		wt->wcol.text[1] = 0.5f * (wt->wcol.text[1] + wt->wcol.text_sel[1]);
-		wt->wcol.text[2] = 0.5f * (wt->wcol.text[2] + wt->wcol.text_sel[2]);
+	/* active and disabled (not so common) */
+	if ((state & UI_BUT_DISABLED) && (state & UI_ACTIVE)) {
+		widget_state_blend(wt->wcol.text, wt->wcol.text_sel, 0.5f);
+		/* draw the backdrop at low alpha, helps navigating with keys
+		 * when disabled items are active */
+		copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
+		wt->wcol.inner[3] = 64;
+	}
+	/* regular disabled */
+	else if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE)) {
+		widget_state_blend(wt->wcol.text, wt->wcol.inner, 0.5f);
 	}
+	/* regular active */
 	else if (state & UI_ACTIVE) {
 		copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
 		copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
@@ -1892,12 +1900,12 @@ static void ui_hsv_cursor(float x, float y)
 	glTranslatef(x, y, 0.0f);
 	
 	glColor3f(1.0f, 1.0f, 1.0f);
-	glutil_draw_filled_arc(0.0f, M_PI * 2.0, 3.0f, 8);
+	glutil_draw_filled_arc(0.0f, M_PI * 2.0, 3.0f * U.pixelsize, 8);
 	
 	glEnable(GL_BLEND);
 	glEnable(GL_LINE_SMOOTH);
 	glColor3f(0.0f, 0.0f, 0.0f);
-	glutil_draw_lined_arc(0.0f, M_PI * 2.0, 3.0f, 12);
+	glutil_draw_lined_arc(0.0f, M_PI * 2.0, 3.0f * U.pixelsize, 12);
 	glDisable(GL_BLEND);
 	glDisable(GL_LINE_SMOOTH);
 	
@@ -1921,7 +1929,7 @@ void ui_hsvcircle_vals_from_pos(float *val_rad, float *val_dist, const rcti *rec
 
 static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
 {
-	const int tot = 32;
+	const int tot = 64;
 	const float radstep = 2.0f * (float)M_PI / (float)tot;
 
 	const float centx = BLI_rcti_cent_x_fl(rect);
@@ -3443,7 +3451,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int ic
 	uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM);
 	rcti _rect = *rect;
 	char *cpoin;
-	
+
 	wt->state(wt, state);
 	wt->draw(&wt->wcol, rect, 0, 0);
 	
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index ac7d423..672e4eb 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -389,6 +389,10 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
 					cp = ts->syntaxc; break;
 				case TH_NODE_FRAME:
 					cp = ts->movie; break;
+				case TH_NODE_MATTE:
+					cp = ts->syntaxs; break;
+				case TH_NODE_DISTORT:
+					cp = ts->syntaxd; break;
 				case TH_NODE_CURVING:
 					cp = &ts->noodle_curving; break;
 
@@ -423,6 +427,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
 					cp = ts->console_error; break;
 				case TH_CONSOLE_CURSOR:
 					cp = ts->console_cursor; break;
+				case TH_CONSOLE_SELECT:
+					cp = ts->console_select; break;
 
 				case TH_HANDLE_VERTEX:
 					cp = ts->handle_vertex;
@@ -686,6 +692,7 @@ void ui_theme_init_default(void)
 	ui_widget_color_init(&btheme->tui);
 	
 	btheme->tui.iconfile[0] = 0;
+	btheme->tui.panel.show_back = FALSE;
 	btheme->tui.panel.show_header = FALSE;
 	rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
 	
@@ -703,6 +710,8 @@ void ui_theme_init_default(void)
 	ui_theme_init_new(btheme);
 	
 	/* space view3d */
+	btheme->tv3d.panelcolors.show_back = FALSE;
+	btheme->tv3d.panelcolors.show_header = FALSE;
 	rgba_char_args_set_fl(btheme->tv3d.back,       0.225, 0.225, 0.225, 1.0);
 	rgba_char_args_set(btheme->tv3d.text,       0, 0, 0, 255);
 	rgba_char_args_set(btheme->tv3d.text_hi, 255, 255, 255, 255);
@@ -930,6 +939,7 @@ void ui_theme_init_default(void)
 	rgba_char_args_set(btheme->tconsole.console_info, 0, 170, 0, 255);
 	rgba_char_args_set(btheme->tconsole.console_error, 220, 96, 96, 255);
 	rgba_char_args_set(btheme->tconsole.console_cursor, 220, 96, 96, 255);
+	rgba_char_args_set(btheme->tconsole.console_select, 255, 255, 255, 48);
 	
 	/* space time */
 	btheme->ttime = btheme->tv3d;
@@ -1318,7 +1328,6 @@ void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3]
 void init_userdef_do_versions(void)
 {
 	Main *bmain = G.main;
-//	countall();
 	
 	/* the UserDef struct is not corrected with do_versions() .... ugh! */
 	if (U.wheellinescroll == 0) U.wheellinescroll = 3;
@@ -2091,8 +2100,9 @@ void init_userdef_do_versions(void)
 			btheme->tclip.panelcolors = btheme->tui.panel;
 		}
 	}
-	
-	if (bmain->versionfile < 266) {
+
+	/* NOTE!! from now on use U.versionfile and U.subversionfile */
+	if (U.versionfile < 266) {
 		bTheme *btheme;
 		
 		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
@@ -2104,7 +2114,7 @@ void init_userdef_do_versions(void)
 		}
 	}
 
-	if (!MAIN_VERSION_ATLEAST(bmain, 265, 4)) {
+	if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 4)) {
 		bTheme *btheme;
 		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
 			rgba_char_args_set(btheme->text.syntaxd,    50, 0, 140, 255);   /* Decorator/Preprocessor Dir.  Blue-purple */
@@ -2113,13 +2123,31 @@ void init_userdef_do_versions(void)
 		}
 	}
 
-	if (!MAIN_VERSION_ATLEAST(bmain, 265, 6)) {
+	if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 6)) {
 		bTheme *btheme;
 		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
 			copy_v4_v4_char(btheme->tv3d.gradients.high_gradient, btheme->tv3d.back);
 		}
 	}
 
+	if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 9)) {
+		bTheme *btheme;
+		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+			rgba_char_args_test_set(btheme->tnode.syntaxs, 151, 116, 116, 255);  /* matte nodes */
+			rgba_char_args_test_set(btheme->tnode.syntaxd, 116, 151, 151, 255);  /* distort nodes */
+		}
+	}
+
+	if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 11)) {
+		bTheme *btheme;
+		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+			rgba_char_args_test_set(btheme->tconsole.console_select, 255, 255, 255, 48);
+		}
+	}
+
+	/* NOTE!! from now on use U.versionfile and U.subversionfile */
+	
+	
 	if (U.pixelsize == 0.0f)
 		U.pixelsize = 1.0f;
 	
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 41bbed8..ae89b25 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1029,16 +1029,16 @@ void UI_view2d_view_ortho(View2D *v2d)
 	
 	/* XXX ton: this flag set by outliner, for icons */
 	if (v2d->flag & V2D_PIXELOFS_X) {
-		curmasked.xmin = floorf(curmasked.xmin) - 0.001f;
-		curmasked.xmax = floorf(curmasked.xmax) - 0.001f;
+		curmasked.xmin = floorf(curmasked.xmin) - (0.001f + xofs);
+		curmasked.xmax = floorf(curmasked.xmax) - (0.001f + xofs);
 	}
 	if (v2d->flag & V2D_PIXELOFS_Y) {
-		curmasked.ymin = floorf(curmasked.ymin) - 0.001f;
-		curmasked.ymax = floorf(curmasked.ymax) - 0.001f;
+		curmasked.ymin = floorf(curmasked.ymin) - (0.001f + yofs);
+		curmasked.ymax = floorf(curmasked.ymax) - (0.001f + yofs);
 	}
 	
 	/* set matrix on all appropriate axes */
-	wmOrtho2(curmasked.xmin - xofs, curmasked.xmax - xofs, curmasked.ymin - yofs, curmasked.ymax - yofs);
+	wmOrtho2(curmasked.xmin, curmasked.xmax, curmasked.ymin, curmasked.ymax);
 
 	/* XXX is this necessary? */
 	glLoadIdentity();
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index fbbcb65..7f11405 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -1034,14 +1034,17 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
 		}
 		else {
 			/* 'continuous' or 'dolly' */
-			float fac;
+			float fac, zoomfac = 0.001f * v2d->maxzoom;
+			
+			/* some view2d's (graph) don't have min/max zoom, or extreme ones */
+			CLAMP (zoomfac, 0.001f, 0.01f);
 			
 			/* x-axis transform */
-			fac = 0.01f * (event->x - vzd->lastx);
+			fac = zoomfac * (event->x - vzd->lastx);
 			dx = fac * BLI_rctf_size_x(&v2d->cur);
 			
 			/* y-axis transform */
-			fac = 0.01f * (event->y - vzd->lasty);
+			fac = zoomfac * (event->y - vzd->lasty);
 			dy = fac * BLI_rctf_size_y(&v2d->cur);
 			
 		}
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index ba93206..7703a86 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -84,6 +84,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
 	int selected;
 	int include_children;
 	int include_armatures;
+	int include_shapekeys;
 	int deform_bones_only;
 
 	int include_uv_textures;
@@ -109,6 +110,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
 	selected                 = RNA_boolean_get(op->ptr, "selected");
 	include_children         = RNA_boolean_get(op->ptr, "include_children");
 	include_armatures        = RNA_boolean_get(op->ptr, "include_armatures");
+	include_shapekeys        = RNA_boolean_get(op->ptr, "include_shapekeys");
 	deform_bones_only        = RNA_boolean_get(op->ptr, "deform_bones_only");
 
 	include_uv_textures      = RNA_boolean_get(op->ptr, "include_uv_textures");
@@ -130,6 +132,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
 	                   selected,
 	                   include_children,
 	                   include_armatures,
+	                   include_shapekeys,
 	                   deform_bones_only,
 
 	                   active_uv_only,
@@ -176,6 +179,10 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr)
 	uiItemR(row, imfptr, "include_armatures", 0, NULL, ICON_NONE);
 	uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "selected"));
 
+	row = uiLayoutRow(box, FALSE);
+	uiItemR(row, imfptr, "include_shapekeys", 0, NULL, ICON_NONE);
+	uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "selected"));
+
 	/* Texture options */
 	box = uiLayoutBox(layout);
 	row = uiLayoutRow(box, FALSE);
@@ -266,6 +273,9 @@ void WM_OT_collada_export(wmOperatorType *ot)
 	RNA_def_boolean(ot->srna, "include_armatures", 0, "Include Armatures",
 	                "Export related armatures (even if not selected)");
 
+	RNA_def_boolean(ot->srna, "include_shapekeys", 1, "Include Shape Keys",
+	                "Export all Shape Keys from Mesh Objects");
+
 	RNA_def_boolean(ot->srna, "deform_bones_only", 0, "Deform Bones only",
 	                "Only export deforming bones with armatures");
 
@@ -298,18 +308,45 @@ void WM_OT_collada_export(wmOperatorType *ot)
 static int wm_collada_import_exec(bContext *C, wmOperator *op)
 {
 	char filename[FILE_MAX];
+	int import_units;
 
 	if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
 		BKE_report(op->reports, RPT_ERROR, "No filename given");
 		return OPERATOR_CANCELLED;
 	}
 
+	/* Options panel */
+	import_units = RNA_boolean_get(op->ptr, "import_units");
+
 	RNA_string_get(op->ptr, "filepath", filename);
-	if (collada_import(C, filename)) return OPERATOR_FINISHED;
+	if (collada_import(C, filename, import_units)) {
+		return OPERATOR_FINISHED;
+	}
+	else {
+		BKE_report(op->reports, RPT_ERROR, "Errors found during parsing COLLADA document (see console for details)");
+		return OPERATOR_CANCELLED;
+	}
+}
+
+static void uiCollada_importSettings(uiLayout *layout, PointerRNA *imfptr)
+{
+	uiLayout *box, *row;
 
-	BKE_report(op->reports, RPT_ERROR, "Errors found during parsing COLLADA document (see console for details)");
+	/* Import Options: */
+	box = uiLayoutBox(layout);
+	row = uiLayoutRow(box, FALSE);
+	uiItemL(row, IFACE_("Import Data Options:"), ICON_MESH_DATA);
+
+	row = uiLayoutRow(box, FALSE);
+	uiItemR(row, imfptr, "import_units", 0, NULL, ICON_NONE);
+}
+
+static void wm_collada_import_draw(bContext *UNUSED(C), wmOperator *op)
+{
+	PointerRNA ptr;
 
-	return OPERATOR_FINISHED;
+	RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
+	uiCollada_importSettings(op->layout, &ptr);
 }
 
 void WM_OT_collada_import(wmOperatorType *ot)
@@ -322,7 +359,17 @@ void WM_OT_collada_import(wmOperatorType *ot)
 	ot->exec = wm_collada_import_exec;
 	ot->poll = WM_operator_winactive;
 
+	//ot->flag |= OPTYPE_PRESET;
+
+	ot->ui = wm_collada_import_draw;
+
 	WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_OPENFILE,
 	                               WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+
+	RNA_def_boolean(ot->srna,
+	                "import_units", 0, "Import Units",
+	                "If disabled match import to Blender's current Unit settings, "
+	                "otherwise use the settings from the Imported scene");
+
 }
 #endif
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c
index e43c8a2..77abe43 100644
--- a/source/blender/editors/mask/mask_add.c
+++ b/source/blender/editors/mask/mask_add.c
@@ -720,7 +720,7 @@ static int add_feather_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event
 void MASK_OT_add_feather_vertex(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Add feather Vertex";
+	ot->name = "Add Feather Vertex";
 	ot->description = "Add vertex to feather";
 	ot->idname = "MASK_OT_add_feather_vertex";
 
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index 74cdf4c..af9d334 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -409,7 +409,7 @@ static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline
                               int width, int height)
 {
 	const unsigned int resol = max_ii(BKE_mask_spline_feather_resolution(spline, width, height),
-	                                BKE_mask_spline_resolution(spline, width, height));
+	                                  BKE_mask_spline_resolution(spline, width, height));
 
 	unsigned char rgb_tmp[4];
 
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 35f85f3..0a996c1 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -36,6 +36,7 @@
 
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
+#include "BKE_main.h"
 #include "BKE_mask.h"
 
 #include "DNA_scene_types.h"
@@ -261,9 +262,10 @@ int ED_mask_feather_find_nearest(const bContext *C, Mask *mask, float normal_co[
 Mask *ED_mask_new(bContext *C, const char *name)
 {
 	ScrArea *sa = CTX_wm_area(C);
+	Main *bmain = CTX_data_main(C);
 	Mask *mask;
 
-	mask = BKE_mask_new(name);
+	mask = BKE_mask_new(bmain, name);
 
 	if (sa && sa->spacedata.first) {
 		switch (sa->spacetype) {
diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt
index c51d2cf..169e7a6 100644
--- a/source/blender/editors/mesh/CMakeLists.txt
+++ b/source/blender/editors/mesh/CMakeLists.txt
@@ -48,7 +48,6 @@ set(SRC
 	editmesh_select.c
 	editmesh_tools.c
 	editmesh_utils.c
-	editmesh_slide.c
 	mesh_data.c
 	mesh_ops.c
 	meshtools.c
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 3fbfaab..7ac27e0 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -34,6 +34,8 @@
 #include "BLI_math.h"
 #include "BLI_edgehash.h"
 
+#include "BLF_translation.h"
+
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
 
@@ -429,7 +431,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
 	if (me == 0 ||  me->totpoly == 0) return;
 
 	if (mode == 0)
-		mode = pupmenu("Seams %t|Mark Border Seam %x1|Clear Seam %x2");
+		mode = pupmenu(IFACE_("Seams %t|Mark Border Seam %x1|Clear Seam %x2"));
 
 	if (mode != 1 && mode != 2)
 		return;
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index e49dc3c..d7dbe35 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -41,6 +41,8 @@
 #include "BLI_smallhash.h"
 #include "BLI_memarena.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_DerivedMesh.h"
 #include "BKE_context.h"
 
@@ -212,15 +214,16 @@ static void knife_input_ray_segment(KnifeTool_OpData *kcd, const float mval[2],
 
 static void knife_update_header(bContext *C, KnifeTool_OpData *kcd)
 {
-	#define HEADER_LENGTH 190
+	#define HEADER_LENGTH 256
 	char header[HEADER_LENGTH];
 
-	BLI_snprintf(header, HEADER_LENGTH, "LMB: define cut lines, Return/Spacebar: confirm, Esc or RMB: cancel, E: new cut, Ctrl: midpoint snap (%s), "
-	             "Shift: ignore snap (%s), C: angle constrain (%s), Z: cut through (%s)",
-	             kcd->snap_midpoints ? "On" : "Off",
-	             kcd->ignore_edge_snapping ?  "On" : "Off",
-	             kcd->angle_snapping ? "On" : "Off",
-	             kcd->cut_through ? "On" : "Off");
+	BLI_snprintf(header, HEADER_LENGTH, IFACE_("LMB: define cut lines, Return/Spacebar: confirm, Esc or RMB: cancel, "
+	                                           "E: new cut, Ctrl: midpoint snap (%s), Shift: ignore snap (%s), "
+	                                           "C: angle constrain (%s), Z: cut through (%s)"),
+	             kcd->snap_midpoints ? IFACE_("On") : IFACE_("Off"),
+	             kcd->ignore_edge_snapping ?  IFACE_("On") : IFACE_("Off"),
+	             kcd->angle_snapping ? IFACE_("On") : IFACE_("Off"),
+	             kcd->cut_through ? IFACE_("On") : IFACE_("Off"));
 
 	ED_area_headerprint(CTX_wm_area(C), header);
 }
@@ -645,6 +648,7 @@ static void knife_get_vert_faces(KnifeTool_OpData *kcd, KnifeVert *kfv, BMFace *
 {
 	BMIter bmiter;
 	BMFace *f;
+	Ref *r;
 
 	if (kfv->isface && facef) {
 		knife_append_list(kcd, lst, facef);
@@ -654,6 +658,11 @@ static void knife_get_vert_faces(KnifeTool_OpData *kcd, KnifeVert *kfv, BMFace *
 			knife_append_list(kcd, lst, f);
 		}
 	}
+	else {
+		for (r = kfv->faces.first; r; r = r->next) {
+			knife_append_list(kcd, lst, r->ref);
+		}
+	}
 }
 
 static void knife_get_edge_faces(KnifeTool_OpData *kcd, KnifeEdge *kfe, ListBase *lst)
@@ -780,6 +789,7 @@ static void knife_cut_through(KnifeTool_OpData *kcd)
 	kcd->totlinehit = 0;
 
 	/* set up for next cut */
+	kcd->curr.vert = lastv;
 	kcd->prev = kcd->curr;
 }
 
@@ -1853,7 +1863,7 @@ static void remerge_faces(KnifeTool_OpData *kcd)
 	BMOperator bmop;
 	int idx;
 
-	BMO_op_initf(bm, &bmop, "beautify_fill faces=%ff constrain_edges=%fe", FACE_NEW, BOUNDARY);
+	BMO_op_initf(bm, &bmop, "beautify_fill faces=%ff edges=%Fe", FACE_NEW, BOUNDARY);
 
 	BMO_op_exec(bm, &bmop);
 	BMO_slot_buffer_flag_enable(bm, &bmop, "geom.out", BM_FACE, FACE_NEW);
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 5f923dd..8354291 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -37,6 +37,8 @@
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_modifier.h"
 #include "BKE_report.h"
@@ -154,9 +156,9 @@ static void edgering_find_order(BMEdge *lasteed, BMEdge *eed,
 static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
 {
 	BMEditMesh *em = lcd->em;
-	BMEdge *startedge = lcd->eed;
-	BMEdge *eed, *lasteed;
-	BMVert *v[2][2], *lastv1;
+	BMEdge *eed_start = lcd->eed;
+	BMEdge *eed, *eed_last;
+	BMVert *v[2][2], *v_last;
 	BMWalker walker;
 	float (*edges)[2][3] = NULL;
 	BLI_array_declare(edges);
@@ -164,7 +166,7 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
 	
 	memset(v, 0, sizeof(v));
 	
-	if (!startedge)
+	if (!eed_start)
 		return;
 
 	if (lcd->edges) {
@@ -183,8 +185,7 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
 		         BMW_FLAG_TEST_HIDDEN,
 		         BMW_NIL_LAY);
 
-		eed = BMW_begin(&walker, startedge);
-		for ( ; eed; eed = BMW_step(&walker)) {
+		for (eed = BMW_begin(&walker, eed_start); eed; eed = BMW_step(&walker)) {
 			BM_edge_select_set(em->bm, eed, TRUE);
 		}
 		BMW_end(&walker);
@@ -197,22 +198,23 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
 	         BMW_FLAG_TEST_HIDDEN,
 	         BMW_NIL_LAY);
 
-	eed = startedge = BMW_begin(&walker, startedge);
-	lastv1 = NULL;
-	for (lasteed = NULL; eed; eed = BMW_step(&walker)) {
-		if (lasteed) {
-			if (lastv1) {
+	v_last   = NULL;
+	eed_last = NULL;
+
+	for (eed = eed_start = BMW_begin(&walker, eed_start); eed; eed = BMW_step(&walker)) {
+		if (eed_last) {
+			if (v_last) {
 				v[1][0] = v[0][0];
 				v[1][1] = v[0][1];
 			}
 			else {
-				v[1][0] = lasteed->v1;
-				v[1][1] = lasteed->v2;
-				lastv1 = lasteed->v1;
+				v[1][0] = eed_last->v1;
+				v[1][1] = eed_last->v2;
+				v_last  = eed_last->v1;
 			}
 
-			edgering_find_order(lasteed, eed, lastv1, v);
-			lastv1 = v[0][0];
+			edgering_find_order(eed_last, eed, v_last, v);
+			v_last = v[0][0];
 
 			BLI_array_grow_items(edges, previewlines);
 
@@ -223,18 +225,18 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
 				tot++;
 			}
 		}
-		lasteed = eed;
+		eed_last = eed;
 	}
 	
 #ifdef BMW_EDGERING_NGON
 	if (lasteed != startedge && BM_edge_share_face_check(lasteed, startedge)) {
 #else
-	if (lasteed != startedge && BM_edge_share_quad_check(lasteed, startedge)) {
+	if (eed_last != eed_start && BM_edge_share_quad_check(eed_last, eed_start)) {
 #endif
 		v[1][0] = v[0][0];
 		v[1][1] = v[0][1];
 
-		edgering_find_order(lasteed, startedge, lastv1, v);
+		edgering_find_order(eed_last, eed_start, v_last, v);
 		
 		BLI_array_grow_items(edges, previewlines);
 
@@ -411,10 +413,8 @@ static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt)
 		lcd->eed = edge;
 		ringsel_find_edge(lcd, 1);
 	}
-	ED_area_headerprint(sa,
-	                    "Select a ring to be cut, "
-	                    "use mouse-wheel or page-up/down for number of cuts, "
-	                    "Hold Alt for smooth");
+	ED_area_headerprint(sa, IFACE_("Select a ring to be cut, use mouse-wheel or page-up/down for number of cuts, "
+	                               "hold Alt for smooth"));
 	
 	return OPERATOR_RUNNING_MODAL;
 }
@@ -502,7 +502,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
 			
 			ED_region_tag_redraw(lcd->ar);
 			break;
-		case MOUSEMOVE: { /* mouse moved somewhere to select another loop */
+		case MOUSEMOVE:  /* mouse moved somewhere to select another loop */
+		{
 			float dist = 75.0f;
 			BMEdge *edge;
 
@@ -542,7 +543,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
 	
 	if (show_cuts) {
 		char buf[64];
-		BLI_snprintf(buf, sizeof(buf), "Number of Cuts: %d, Smooth: %.2f (Alt)", cuts, smoothness);
+		BLI_snprintf(buf, sizeof(buf), IFACE_("Number of Cuts: %d, Smooth: %.2f (Alt)"), cuts, smoothness);
 		ED_area_headerprint(CTX_wm_area(C), buf);
 	}
 	
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index f552a7b..e856498 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -985,8 +985,8 @@ static void walker_select(BMEditMesh *em, int walkercode, void *start, int selec
 	         BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
 	         BMW_FLAG_TEST_HIDDEN,
 	         BMW_NIL_LAY);
-	ele = BMW_begin(&walker, start);
-	for (; ele; ele = BMW_step(&walker)) {
+
+	for (ele = BMW_begin(&walker, start); ele; ele = BMW_step(&walker)) {
 		if (!select) {
 			BM_select_history_remove(bm, ele);
 		}
@@ -2262,8 +2262,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *
 		         BMW_FLAG_TEST_HIDDEN,
 		         BMW_NIL_LAY);
 
-		efa = BMW_begin(&walker, efa);
-		for (; efa; efa = BMW_step(&walker)) {
+		for (efa = BMW_begin(&walker, efa); efa; efa = BMW_step(&walker)) {
 			BM_face_select_set(bm, efa, sel);
 		}
 		BMW_end(&walker);
@@ -2284,8 +2283,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *
 		         BMW_FLAG_TEST_HIDDEN,
 		         BMW_NIL_LAY);
 
-		e = BMW_begin(&walker, eed->v1);
-		for (; e; e = BMW_step(&walker)) {
+		for (e = BMW_begin(&walker, eed->v1); e; e = BMW_step(&walker)) {
 			BM_edge_select_set(bm, e, sel);
 		}
 		BMW_end(&walker);
@@ -2356,8 +2354,7 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 			if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
-				efa = BMW_begin(&walker, efa);
-				for (; efa; efa = BMW_step(&walker)) {
+				for (efa = BMW_begin(&walker, efa); efa; efa = BMW_step(&walker)) {
 					BM_face_select_set(bm, efa, TRUE);
 				}
 			}
@@ -2385,10 +2382,8 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
 
 		BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
 			if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
-				e = BMW_begin(&walker, v);
-				for (; e; e = BMW_step(&walker)) {
-					BM_vert_select_set(em->bm, e->v1, TRUE);
-					BM_vert_select_set(em->bm, e->v2, TRUE);
+				for (e = BMW_begin(&walker, v); e; e = BMW_step(&walker)) {
+					BM_edge_select_set(em->bm, e, true);
 				}
 			}
 		}
diff --git a/source/blender/editors/mesh/editmesh_slide.c b/source/blender/editors/mesh/editmesh_slide.c
deleted file mode 100644
index eb0a212..0000000
--- a/source/blender/editors/mesh/editmesh_slide.c
+++ /dev/null
@@ -1,793 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Contributor(s): Francisco De La Cruz
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/editors/mesh/editmesh_slide.c
- *  \ingroup edmesh
- */
-
-/* Takes heavily from editmesh_loopcut.c */
-
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_array.h"
-#include "BLI_math.h"
-
-#include "BLF_translation.h"
-
-#include "BKE_context.h"
-#include "BKE_report.h"
-#include "BKE_tessmesh.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-
-#include "ED_screen.h"
-#include "ED_view3d.h"
-#include "ED_mesh.h"
-#include "ED_space_api.h"
-
-#include "UI_resources.h"
-
-#include "RNA_access.h"
-#include "RNA_define.h"
-
-#include "WM_api.h"
-#include "WM_types.h"
-
-#include "mesh_intern.h"
-
-#define VTX_SLIDE_SNAP_THRSH 15
-
-/* Cusom VertexSlide Operator data */
-typedef struct VertexSlideOp {
-	/* Starting Vertex */
-	BMVert *start_vtx;
-	BMEdge *sel_edge;
-
-	ViewContext *view_context;
-	ARegion *active_region;
-
-	/* Draw callback handle */
-	void *draw_handle;
-
-	/* Active Object */
-	Object *obj;
-
-	/* Are we in slide mode */
-	int slide_mode;
-	int snap_n_merge;
-	int snap_to_end_vtx;
-	int snap_to_mid;
-
-	/* Snap threshold */
-	float snap_threshold;
-
-	float distance;
-	float interp[3];
-
-	/* Edge Frame Count */
-	int disk_edges;
-
-	/* Edges */
-	BMEdge **edge_frame;
-
-	/* Slide Frame Endpoints */
-	float (*vtx_frame)[3];
-
-	/* Mouse Click 2d pos */
-	int m_co[2];
-
-} VertexSlideOp;
-
-static void vtx_slide_draw(const bContext *C, ARegion *ar, void *arg);
-static int edbm_vertex_slide_exec_ex(bContext *C, wmOperator *op, const int do_update);
-static void vtx_slide_exit(const bContext *C, wmOperator *op);
-static int vtx_slide_set_frame(VertexSlideOp *vso);
-
-static int vtx_slide_init(bContext *C, wmOperator *op)
-{
-	Object *obedit = CTX_data_edit_object(C);
-	BMEditMesh *em = BMEdit_FromObject(obedit);
-	BMEditSelection *ese;
-
-	/* Custom data */
-	VertexSlideOp *vso;
-
-	const char *header_str = TIP_("Vertex Slide: Hover over an edge and left-click to select slide edge. "
-	                              "Left-Shift: Midpoint Snap, Left-Alt: Snap, Left-Ctrl: Snap & Merge");
-
-	if (!obedit) {
-		BKE_report(op->reports, RPT_ERROR, "Vertex slide error: no object in context");
-		return FALSE;
-	}
-
-	EDBM_selectmode_flush(em);
-	ese = em->bm->selected.last;
-
-	/* Is there a starting vertex  ? */
-	if (ese == NULL || (ese->htype != BM_VERT && ese->htype != BM_EDGE)) {
-		BKE_report(op->reports, RPT_ERROR_INVALID_INPUT, "Vertex slide error: select a (single) vertex");
-		return FALSE;
-	}
-
-	vso = MEM_callocN(sizeof(VertexSlideOp), "Vertex Slide Operator");
-	vso->view_context = MEM_callocN(sizeof(ViewContext), "Vertex Slide View Context");
-
-	op->customdata = vso;
-
-	/* Set the start vertex */
-	vso->start_vtx = (BMVert *)ese->ele;
-
-	vso->sel_edge = NULL;
-
-	/* Edges */
-	vso->edge_frame = NULL;
-
-	vso->vtx_frame = NULL;
-
-	vso->disk_edges = 0;
-
-	vso->slide_mode = FALSE;
-
-	vso->snap_n_merge = FALSE;
-
-	vso->snap_to_end_vtx = FALSE;
-
-	vso->snap_to_mid = FALSE;
-
-	vso->distance = 0.0f;
-
-	vso->snap_threshold = 0.2f;
-
-	/* Notify the viewport */
-	view3d_operator_needs_opengl(C);
-
-	/* Set the drawing region */
-	vso->active_region = CTX_wm_region(C);
-
-	/* Set the draw callback */
-	vso->draw_handle = ED_region_draw_cb_activate(vso->active_region->type, vtx_slide_draw, vso, REGION_DRAW_POST_VIEW);
-
-	ED_area_headerprint(CTX_wm_area(C), header_str);
-	
-	em_setup_viewcontext(C, vso->view_context);
-
-	/* Set the object */
-	vso->obj = obedit;
-
-	/* Init frame */
-	if (!vtx_slide_set_frame(vso)) {
-		BKE_report(op->reports, RPT_ERROR_INVALID_INPUT, "Vertex slide error: cannot find starting vertex!");
-		vtx_slide_exit(C, op);
-		return FALSE;
-	}
-
-	/* Add handler for the vertex sliding */
-	WM_event_add_modal_handler(C, op);
-
-	/* Tag for redraw */
-	ED_region_tag_redraw(vso->active_region);
-
-	return TRUE;
-}
-
-static void vtx_slide_confirm(bContext *C, wmOperator *op)
-{
-	VertexSlideOp *vso = op->customdata;
-	BMEditMesh *em = BMEdit_FromObject(vso->obj);
-	BMesh *bm = em->bm;
-	BMVert *other = NULL;
-
-	BMVert *mirr_vtx = NULL;
-	BMVert *mirr_vtx_other = NULL;
-
-	/* Select new edge */
-	BM_edge_select_set(bm, vso->sel_edge, TRUE);
-
-	if (vso->snap_n_merge) {
-		other = BM_edge_other_vert(vso->sel_edge, vso->start_vtx);
-	}
-
-	if (((Mesh *)em->ob->data)->editflag & ME_EDIT_MIRROR_X) {
-		EDBM_verts_mirror_cache_begin(em, TRUE);
-
-		mirr_vtx = EDBM_verts_mirror_get(em, vso->start_vtx);
-		if (vso->snap_n_merge) {
-			mirr_vtx_other = EDBM_verts_mirror_get(em, other);
-		}
-	}
-
-	/* Invoke operator - warning */
-	edbm_vertex_slide_exec_ex(C, op, FALSE);
-
-	if (mirr_vtx) {
-		mirr_vtx->co[0] = -vso->start_vtx->co[0];
-		mirr_vtx->co[1] =  vso->start_vtx->co[1];
-		mirr_vtx->co[2] =  vso->start_vtx->co[2];
-	}
-
-	if (vso->snap_n_merge) {
-		float other_d;
-		other_d = len_v3v3(vso->interp, other->co);
-
-		/* Only snap if within threshold */
-		if (other_d < vso->snap_threshold) {
-			BM_vert_select_set(bm, other, TRUE);
-			BM_vert_select_set(bm, vso->start_vtx, TRUE);
-			EDBM_op_callf(em, op, "pointmerge verts=%hv merge_co=%v", BM_ELEM_SELECT, other->co);
-			EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-
-			if (mirr_vtx_other) {
-				BM_vert_select_set(bm, mirr_vtx, TRUE);
-				BM_vert_select_set(bm, mirr_vtx_other, TRUE);
-				EDBM_op_callf(em, op, "pointmerge verts=%hv merge_co=%v", BM_ELEM_SELECT, mirr_vtx_other->co);
-				EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-			}
-		}
-		else {
-			/* Store in historty if not merging */
-			BM_select_history_store(em->bm, vso->start_vtx);
-		}
-	}
-	else {
-		/* Store edit selection of the active vertex, allows other
-		 *  ops to run without reselecting */
-		BM_select_history_store(em->bm, vso->start_vtx);
-	}
-
-	if (((Mesh *)em->ob->data)->editflag & ME_EDIT_MIRROR_X) {
-		EDBM_verts_mirror_cache_end(em);
-	}
-
-	EDBM_selectmode_flush(em);
-	
-	/* NC_GEOM | ND_DATA & Retess */
-	EDBM_update_generic(em, TRUE, FALSE);
-	
-	ED_region_tag_redraw(vso->active_region);
-}
-
-static void vtx_slide_exit(const bContext *C, wmOperator *op)
-{
-	/* Fetch custom data */
-	VertexSlideOp *vso = op->customdata;
-
-	/* Clean-up the custom data */
-	ED_region_draw_cb_exit(vso->active_region->type, vso->draw_handle);
-
-	/* Free Custom Data
-	 *
-	 */
-	MEM_freeN(vso->view_context);
-
-	vso->view_context = NULL;
-
-	if (vso->edge_frame) {
-		MEM_freeN(vso->edge_frame);
-	}
-
-	if (vso->vtx_frame) {
-		MEM_freeN(vso->vtx_frame);
-	}
-
-	vso->edge_frame = NULL;
-
-	vso->vtx_frame = NULL;
-
-	vso->slide_mode = FALSE;
-
-	MEM_freeN(vso);
-	vso = NULL;
-	op->customdata = NULL;
-
-	/* Clear the header */
-	ED_area_headerprint(CTX_wm_area(C), NULL);
-}
-
-static void vtx_slide_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
-{
-	VertexSlideOp *vso = arg;
-
-	/* Have an edge to draw */
-	if (vso && vso->sel_edge) {
-		/* Get 3d view */
-		View3D *view3d = CTX_wm_view3d(C);
-		const float outline_w = UI_GetThemeValuef(TH_OUTLINE_WIDTH) + 0.8f;
-		const float pt_size = UI_GetThemeValuef(TH_FACEDOT_SIZE) + 1.5f;
-
-		int i = 0;
-
-		if (view3d && view3d->zbuf)
-			glDisable(GL_DEPTH_TEST);
-
-		glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT | GL_POINT_BIT);
-
-		glPushMatrix();
-		glMultMatrixf(vso->obj->obmat);
-
-		glEnable(GL_BLEND);
-		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-			
-
-		if (vso->slide_mode && vso->disk_edges > 0) {
-			/* Draw intermediate edge frame */
-			UI_ThemeColorShadeAlpha(TH_EDGE_SELECT, 50, -50);
-
-			for (i = 0; i < vso->disk_edges; i++) {
-				glBegin(GL_LINES);
-				glVertex3fv(vso->vtx_frame[i]);
-				glVertex3fv(vso->interp);
-				glEnd();
-			}
-		}
-
-		/* Draw selected edge
-		 * Add color offset and reduce alpha */
-		UI_ThemeColorShadeAlpha(TH_EDGE_SELECT, 40, -50);
-
-		glLineWidth(outline_w);
-
-		glBegin(GL_LINES);
-		bglVertex3fv(vso->sel_edge->v1->co);
-		bglVertex3fv(vso->sel_edge->v2->co);
-		glEnd();
-
-		if (vso->slide_mode) {
-			/* Draw interpolated vertex */
-			
-			UI_ThemeColorShadeAlpha(TH_FACE_DOT, -80, -50);
-
-			glPointSize(pt_size);
-
-			bglBegin(GL_POINTS);
-			bglVertex3fv(vso->interp);
-			bglEnd();
-		}
-
-		glDisable(GL_BLEND);
-		glPopMatrix();
-		glPopAttrib();
-
-		if (view3d && view3d->zbuf)
-			glEnable(GL_DEPTH_TEST);
-	}
-}
-
-static BMEdge *vtx_slide_nrst_in_frame(VertexSlideOp *vso, const float mval[2])
-{
-	BMEdge *cl_edge = NULL;
-	if (vso->disk_edges > 0) {
-		int i = 0;
-		BMEdge *edge = NULL;
-		
-		float v1_proj[3], v2_proj[3];
-		float min_dist = FLT_MAX;
-
-		for (i = 0; i < vso->disk_edges; i++) {
-			edge = vso->edge_frame[i];
-
-			mul_v3_m4v3(v1_proj, vso->obj->obmat, edge->v1->co);
-			mul_v3_m4v3(v2_proj, vso->obj->obmat, edge->v2->co);
-
-			/* we could use ED_view3d_project_float_object here, but for now dont since we dont have the context */
-			if ((ED_view3d_project_float_global(vso->active_region, v1_proj, v1_proj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) &&
-			    (ED_view3d_project_float_global(vso->active_region, v2_proj, v2_proj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK))
-			{
-				const float dist = dist_to_line_segment_v2(mval, v1_proj, v2_proj);
-				if (dist < min_dist) {
-					min_dist = dist;
-					cl_edge = edge;
-				}
-			}
-		}
-	}
-	return cl_edge;
-}
-
-static void vtx_slide_find_edge(VertexSlideOp *vso, wmEvent *event)
-{
-	/* Nearest edge */
-	BMEdge *nst_edge = NULL;
-
-	const float mval_float[2] = {(float)event->mval[0],
-	                             (float)event->mval[1]};
-
-	/* Set mouse coords */
-	copy_v2_v2_int(vso->view_context->mval, event->mval);
-
-	/* Find nearest edge */
-	nst_edge = vtx_slide_nrst_in_frame(vso, mval_float);
-
-	if (nst_edge) {
-		/* Find a connected edge */
-		if (BM_vert_in_edge(nst_edge, vso->start_vtx)) {
-
-			/* Save mouse coords */
-			copy_v2_v2_int(vso->m_co, event->mval);
-
-			/* Set edge */
-			vso->sel_edge = nst_edge;
-		}
-	}
-}
-
-/* Updates the status of the operator - Invoked on mouse movement */
-static void vtx_slide_update(VertexSlideOp *vso, wmEvent *event)
-{
-	BMEdge *edge;
-
-	/* Find nearest edge */
-	edge = vso->sel_edge;
-
-	if (edge) {
-		float edge_other_proj[3];
-		float start_vtx_proj[3];
-		float edge_len;
-		BMVert *other;
-
-		float interp[3];
-
-		/* Calculate interpolation value for preview */
-		float t_val;
-
-		float mval_float[2] = { (float)event->mval[0], (float)event->mval[1]};
-		float closest_2d[2];
-
-		other = BM_edge_other_vert(edge, vso->start_vtx);
-
-		/* Project points onto screen and do interpolation in 2D */
-		mul_v3_m4v3(start_vtx_proj, vso->obj->obmat, vso->start_vtx->co);
-		mul_v3_m4v3(edge_other_proj, vso->obj->obmat, other->co);
-
-		if ((ED_view3d_project_float_global(vso->active_region, edge_other_proj, edge_other_proj, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK) ||
-		    (ED_view3d_project_float_global(vso->active_region, start_vtx_proj, start_vtx_proj, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK))
-		{
-			/* not much we can do here */
-			return;
-		}
-
-		closest_to_line_v2(closest_2d, mval_float, start_vtx_proj, edge_other_proj);
-
-		t_val = line_point_factor_v2(closest_2d, start_vtx_proj, edge_other_proj);
-
-		/* Set snap threshold to be proportional to edge length */
-		edge_len = len_v3v3(start_vtx_proj, edge_other_proj);
-		
-		if (edge_len <= 0.0f)
-			edge_len = VTX_SLIDE_SNAP_THRSH;
-
-		edge_len =  (BM_edge_calc_length(edge) * VTX_SLIDE_SNAP_THRSH) / edge_len;
-
-		vso->snap_threshold =  edge_len;
-
-		/* Snap to mid */
-		if (vso->snap_to_mid) {
-			t_val = 0.5f;
-		}
-
-		/* Interpolate preview vertex 3D */
-		interp_v3_v3v3(interp, vso->start_vtx->co, other->co, t_val);
-		copy_v3_v3(vso->interp, interp);
-
-		vso->distance = t_val;
-
-		/* If snapping */
-		if (vso->snap_to_end_vtx) {
-			int start_at_v1 = edge->v1 == vso->start_vtx;
-			float v1_d = len_v3v3(vso->interp, edge->v1->co);
-			float v2_d = len_v3v3(vso->interp, edge->v2->co);
-
-			if (v1_d > v2_d && v2_d < vso->snap_threshold) {
-				copy_v3_v3(vso->interp, edge->v2->co);
-
-				if (start_at_v1)
-					vso->distance = 1.0f;
-				else
-					vso->distance = 0.0f;
-			}
-			if (v2_d > v1_d && v1_d < vso->snap_threshold) {
-				copy_v3_v3(vso->interp, edge->v1->co);
-				if (start_at_v1)
-					vso->distance = 0.0f;
-				else
-					vso->distance = 1.0f;
-			}
-		}
-	}
-}
-
-/* Sets the outline frame */
-static int vtx_slide_set_frame(VertexSlideOp *vso)
-{
-	BMEdge *edge;
-	float (*vtx_frame)[3] = NULL;
-	BMEdge **edge_frame = NULL;
-	BMVert *curr_vert = NULL;
-	BLI_array_declare(vtx_frame);
-	BLI_array_declare(edge_frame);
-	BMIter iter;
-	BMVert *sel_vtx = vso->start_vtx;
-	int idx = 0;
-
-	vso->disk_edges = 0;
-
-	if (vso->edge_frame) {
-		MEM_freeN(vso->edge_frame);
-		vso->edge_frame = NULL;
-	}
-
-	if (vso->vtx_frame) {
-		MEM_freeN(vso->vtx_frame);
-		vso->vtx_frame = NULL;
-	}
-
-	/* Iterate over edges of vertex and copy them */
-	BM_ITER_ELEM_INDEX (edge, &iter, sel_vtx, BM_EDGES_OF_VERT, idx) {
-		curr_vert = BM_edge_other_vert(edge, sel_vtx);
-		if (curr_vert) {
-			BLI_array_grow_one(vtx_frame);
-
-			copy_v3_v3(vtx_frame[idx], curr_vert->co);
-
-			BLI_array_append(edge_frame, edge);
-			vso->disk_edges++;
-		}
-	}
-
-	vso->edge_frame = edge_frame;
-	vso->vtx_frame = vtx_frame;
-
-	/* Set the interp at starting vtx */
-	copy_v3_v3(vso->interp, sel_vtx->co);
-
-	return vso->disk_edges > 0;
-}
-
-static int edbm_vertex_slide_modal(bContext *C, wmOperator *op, wmEvent *event)
-{
-	VertexSlideOp *vso = op->customdata;
-	char buff[128];
-
-	if (!vso)
-		return OPERATOR_CANCELLED;
-
-	/* Notify the viewport */
-	view3d_operator_needs_opengl(C);
-
-	switch (event->type) {
-		case LEFTSHIFTKEY:
-		{
-			switch (event->val) {
-				case KM_PRESS:
-					vso->snap_to_mid = TRUE;
-					break;
-				case KM_RELEASE:
-					vso->snap_to_mid = FALSE;
-					break;
-			}
-
-			break;
-		}
-		case LEFTCTRLKEY:
-		{
-			switch (event->val) {
-				case KM_PRESS:
-					vso->snap_n_merge = TRUE;
-					vso->snap_to_end_vtx = TRUE;
-					break;
-				case KM_RELEASE:
-					vso->snap_n_merge = FALSE;
-					vso->snap_to_end_vtx = FALSE;
-					break;
-			}
-
-			break;
-		}
-		case LEFTALTKEY:
-		{
-			switch (event->val) {
-				case KM_PRESS:
-					vso->snap_to_end_vtx = TRUE;
-					break;
-				case KM_RELEASE:
-					vso->snap_to_end_vtx = FALSE;
-					break;
-			}
-
-			break;
-		}
-		case RIGHTMOUSE:
-		case ESCKEY:
-		{
-			/* Enforce redraw */
-			ED_region_tag_redraw(vso->active_region);
-
-			/* Clean-up */
-			vtx_slide_exit(C, op);
-
-			return OPERATOR_CANCELLED;
-		}
-		case LEFTMOUSE:
-		{
-			if (event->val == KM_PRESS) {
-				/* Update mouse coords */
-				copy_v2_v2_int(vso->m_co, event->mval);
-
-				if (vso->slide_mode) {
-					vtx_slide_confirm(C, op);
-					/* Clean-up */
-					vtx_slide_exit(C, op);
-					return OPERATOR_FINISHED;
-				}
-				else if (vso->sel_edge) {
-					vso->slide_mode = TRUE;
-				}
-			}
-
-			ED_region_tag_redraw(vso->active_region);
-			break;
-
-		}
-		case MOUSEMOVE:
-		{
-			sprintf(buff, "Vertex Slide: %f", vso->distance);
-			if (!vso->slide_mode) {
-				vtx_slide_find_edge(vso, event);
-			}
-			else {
-				vtx_slide_update(vso, event);
-			}
-			ED_area_headerprint(CTX_wm_area(C), buff);
-			ED_region_tag_redraw(vso->active_region);
-			break;
-		}
-	}
-
-	return OPERATOR_RUNNING_MODAL;
-}
-
-static int edbm_vertex_slide_cancel(bContext *C, wmOperator *op)
-{
-	/* Exit the modal */
-	vtx_slide_exit(C, op);
-
-	return OPERATOR_CANCELLED;
-}
-
-static int edbm_vertex_slide_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
-{
-	/* Initialize the operator */
-	if (vtx_slide_init(C, op))
-		return OPERATOR_RUNNING_MODAL;
-	else
-		return OPERATOR_CANCELLED;
-}
-
-/* Vertex Slide */
-static int edbm_vertex_slide_exec_ex(bContext *C, wmOperator *op, const int do_update)
-{
-	Object *obedit = CTX_data_edit_object(C);
-	BMEditMesh *em = BMEdit_FromObject(obedit);
-	BMesh *bm = em->bm;
-	BMVert *start_vert;
-	BMOperator bmop;
-	BMEditSelection *ese = (BMEditSelection *)em->bm->selected.last;
-
-	float factor = 0.0f;
-
-	/* Invoked modally? */
-	if (op->type->modal == edbm_vertex_slide_modal && op->customdata) {
-		VertexSlideOp *vso = (VertexSlideOp *)op->customdata;
-
-		if (bm->totedgesel > 1) {
-			/* Reset selections */
-			EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-			BM_edge_select_set(bm, vso->sel_edge, TRUE);
-			BM_vert_select_set(bm, vso->start_vtx, TRUE);
-
-			BM_select_history_store(em->bm, vso->sel_edge);
-			BM_select_history_store(em->bm, vso->start_vtx);
-			ese = (BMEditSelection *)em->bm->selected.last;
-		}
-		factor = vso->distance;
-		RNA_float_set(op->ptr, "factor", factor);
-	}
-	else {
-		/* Get Properties */
-		factor = RNA_float_get(op->ptr, "factor");
-	}
-
-	/* Is there a starting vertex  ? */
-	if ((ese == NULL) || (ese->htype != BM_VERT && ese->htype != BM_EDGE)) {
-		BKE_report(op->reports, RPT_ERROR_INVALID_INPUT, "Vertex slide error: select a (single) vertex");
-		return OPERATOR_CANCELLED;
-	}
-
-	start_vert = (BMVert *)ese->ele;
-
-	/* Prepare operator */
-	if (!EDBM_op_init(em, &bmop, op,
-	                  "slide_vert vert=%e edges=%he factor=%f",
-	                  start_vert, BM_ELEM_SELECT, factor))
-	{
-		return OPERATOR_CANCELLED;
-	}
-	/* Execute operator */
-	BMO_op_exec(bm, &bmop);
-
-	/* Deselect the input edges */
-	BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "edges", BM_EDGE, BM_ELEM_SELECT, TRUE);
-
-	/* Select the output vert */
-	BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
-
-	/* Flush the select buffers */
-	EDBM_selectmode_flush(em);
-
-	if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
-		return OPERATOR_CANCELLED;
-	}
-
-	if (do_update) {
-		/* Update Geometry */
-		EDBM_update_generic(em, TRUE, FALSE);
-	}
-
-	return OPERATOR_FINISHED;
-}
-
-#if 0
-static int edbm_vertex_slide_exec(bContext *C, wmOperator *op)
-{
-	return edbm_vertex_slide_exec_ex(C, op, TRUE);
-}
-#endif
-
-void MESH_OT_vert_slide(wmOperatorType *ot)
-{
-	PropertyRNA *prop;
-
-	/* identifiers */
-	ot->name = "Vertex Slide";
-	ot->idname = "MESH_OT_vert_slide";
-	ot->description = "Vertex slide";
-
-	/* api callback */
-	ot->invoke = edbm_vertex_slide_invoke;
-	ot->modal = edbm_vertex_slide_modal;
-	ot->cancel = edbm_vertex_slide_cancel;
-	ot->poll = ED_operator_editmesh_region_view3d;
-
-	/* ot->exec = edbm_vertex_slide_exec;
-	 * ot->poll = ED_operator_editmesh; */
-
-	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
-	/* Properties for vertex slide */
-	prop = RNA_def_float(ot->srna, "factor", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "Distance", -5.0f, 5.0f);
-	RNA_def_property_ui_range(prop, -5.0f, 5.0f, 0.1, 4);
-	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
-}
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 951c8b4..3dd9adc 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -47,6 +47,8 @@
 #include "BLI_math.h"
 #include "BLI_rand.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_material.h"
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
@@ -387,7 +389,7 @@ static short edbm_extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
 		if (ele->head.htype == BM_FACE) {
 			f = (BMFace *)ele;
 			add_normal_aligned(nor, f->no);
-		};
+		}
 	}
 
 	normalize_v3(nor);
@@ -1744,9 +1746,9 @@ void MESH_OT_vertices_smooth_laplacian(wmOperatorType *ot)
 	              "Lambda factor", "", 0.0000001f, 1000.0f);
 	RNA_def_float(ot->srna, "lambda_border", 0.00005f, 0.0000001f, 1000.0f,
 	              "Lambda factor in border", "", 0.0000001f, 1000.0f);
-	RNA_def_boolean(ot->srna, "use_x", 1, "Smooth X Axis", "Smooth object along	X axis");
-	RNA_def_boolean(ot->srna, "use_y", 1, "Smooth Y Axis", "Smooth object along	Y axis");
-	RNA_def_boolean(ot->srna, "use_z", 1, "Smooth Z Axis", "Smooth object along	Z axis");
+	RNA_def_boolean(ot->srna, "use_x", 1, "Smooth X Axis", "Smooth object along X axis");
+	RNA_def_boolean(ot->srna, "use_y", 1, "Smooth Y Axis", "Smooth object along Y axis");
+	RNA_def_boolean(ot->srna, "use_z", 1, "Smooth Z Axis", "Smooth object along Z axis");
 	RNA_def_boolean(ot->srna, "preserve_volume", 1, "Preserve Volume", "Apply volume preservation after smooth");
 }
 
@@ -3190,8 +3192,7 @@ static int mesh_separate_loose(Main *bmain, Scene *scene, Base *base_old, BMesh
 		         BMW_FLAG_NOP,
 		         BMW_NIL_LAY);
 
-		e = BMW_begin(&walker, v_seed);
-		for (; e; e = BMW_step(&walker)) {
+		for (e = BMW_begin(&walker, v_seed); e; e = BMW_step(&walker)) {
 			if (!BM_elem_flag_test(e->v1, BM_ELEM_TAG)) { BM_elem_flag_enable(e->v1, BM_ELEM_TAG); tot++; }
 			if (!BM_elem_flag_test(e->v2, BM_ELEM_TAG)) { BM_elem_flag_enable(e->v2, BM_ELEM_TAG); tot++; }
 		}
@@ -3315,9 +3316,12 @@ static int edbm_fill_exec(bContext *C, wmOperator *op)
 {
 	Object *obedit = CTX_data_edit_object(C);
 	BMEditMesh *em = BMEdit_FromObject(obedit);
+	int use_beauty = RNA_boolean_get(op->ptr, "use_beauty");
 	BMOperator bmop;
 	
-	if (!EDBM_op_init(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT)) {
+	if (!EDBM_op_init(em, &bmop, op,
+	                  "triangle_fill edges=%he use_beauty=%b",
+	                  BM_ELEM_SELECT, use_beauty)) {
 		return OPERATOR_CANCELLED;
 	}
 	
@@ -3349,6 +3353,8 @@ void MESH_OT_fill(wmOperatorType *ot)
 
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+	RNA_def_boolean(ot->srna, "use_beauty", true, "Beauty", "Use best triangulation division");
 }
 
 static int edbm_beautify_fill_exec(bContext *C, wmOperator *op)
@@ -3356,7 +3362,7 @@ static int edbm_beautify_fill_exec(bContext *C, wmOperator *op)
 	Object *obedit = CTX_data_edit_object(C);
 	BMEditMesh *em = BMEdit_FromObject(obedit);
 
-	if (!EDBM_op_callf(em, op, "beautify_fill faces=%hf", BM_ELEM_SELECT))
+	if (!EDBM_op_callf(em, op, "beautify_fill faces=%hf edges=ae", BM_ELEM_SELECT))
 		return OPERATOR_CANCELLED;
 
 	EDBM_update_generic(em, TRUE, TRUE);
@@ -3385,10 +3391,22 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op)
 {
 	Object *obedit = CTX_data_edit_object(C);
 	BMEditMesh *em = BMEdit_FromObject(obedit);
+	BMOperator bmop;
 	int use_beauty = RNA_boolean_get(op->ptr, "use_beauty");
 
-	if (!EDBM_op_callf(em, op, "triangulate faces=%hf use_beauty=%b", BM_ELEM_SELECT, use_beauty))
+	EDBM_op_init(em, &bmop, op, "triangulate faces=%hf use_beauty=%b", BM_ELEM_SELECT, use_beauty);
+	BMO_op_exec(em->bm, &bmop);
+
+	/* now call beauty fill */
+	if (use_beauty) {
+		EDBM_op_callf(em, op,
+		              "beautify_fill faces=%S edges=%S",
+		              &bmop, "faces.out", &bmop, "edges.out");
+	}
+
+	if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
 		return OPERATOR_CANCELLED;
+	}
 
 	EDBM_update_generic(em, TRUE, TRUE);
 
@@ -3409,7 +3427,7 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot)
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-	RNA_def_boolean(ot->srna, "use_beauty", 1, "Beauty", "Use best triangulation division (currently quads only)");
+	RNA_def_boolean(ot->srna, "use_beauty", 1, "Beauty", "Use best triangulation division");
 }
 
 static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op)
@@ -3956,9 +3974,11 @@ static int edbm_select_mirror_exec(bContext *C, wmOperator *op)
 	BMEditMesh *em = BMEdit_FromObject(obedit);
 	int extend = RNA_boolean_get(op->ptr, "extend");
 
-	EDBM_select_mirrored(obedit, em, extend);
-	EDBM_selectmode_flush(em);
-	WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+	if (em->bm->totvert && em->bm->totvertsel) {
+		EDBM_select_mirrored(obedit, em, extend);
+		EDBM_selectmode_flush(em);
+		WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+	}
 
 	return OPERATOR_FINISHED;
 }
@@ -4603,7 +4623,7 @@ static int edbm_noise_exec(bContext *C, wmOperator *op)
 		BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
 			if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
 				float tin, dum;
-				externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0);
+				externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0, NULL);
 				eve->co[2] += fac * tin;
 			}
 		}
@@ -4655,9 +4675,10 @@ typedef struct {
 static void edbm_bevel_update_header(wmOperator *op, bContext *C)
 {
 #ifdef NEW_BEVEL
-	static char str[] = "Confirm: Enter/LClick, Cancel: (Esc/RMB), offset: %s, segments: %d";
+	const char *str = IFACE_("Confirm: Enter/LClick, Cancel: (Esc/RMB), Offset: %s, Segments: %d");
 #else
-	static char str[] = "Confirm: Enter/LClick, Cancel: (Esc/RMB), factor: %s, Use Dist (D): %s: Use Even (E): %s";
+	const char *str = IFACE_("Confirm: Enter/LClick, Cancel: (Esc/RMB), Factor: %s, Use Dist (D): %s, "
+	                         "Use Even (E): %s");
 	BevelData *opdata = op->customdata;
 #endif
 
@@ -4680,8 +4701,8 @@ static void edbm_bevel_update_header(wmOperator *op, bContext *C)
 			BLI_snprintf(factor_str, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "percent"));
 		BLI_snprintf(msg, HEADER_LENGTH, str,
 		             factor_str,
-		             RNA_boolean_get(op->ptr, "use_dist") ? "On" : "Off",
-		             RNA_boolean_get(op->ptr, "use_even") ? "On" : "Off"
+		             RNA_boolean_get(op->ptr, "use_dist") ? IFACE_("On") : IFACE_("Off"),
+		             RNA_boolean_get(op->ptr, "use_even") ? IFACE_("On") : IFACE_("Off")
 		            );
 #endif
 
@@ -4959,7 +4980,7 @@ static float edbm_bevel_mval_factor(wmOperator *op, wmEvent *event)
 	if (event->shift) {
 		if (opdata->shift_factor < 0.0f) {
 #ifdef NEW_BEVEL
-			opdata->shift_factor = RNA_float_get(op->ptr, "percent");
+			opdata->shift_factor = RNA_float_get(op->ptr, "offset");
 #else
 			opdata->shift_factor = RNA_float_get(op->ptr, "factor");
 #endif
@@ -5194,12 +5215,8 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C)
 {
 	InsetData *opdata = op->customdata;
 
-	static const char str[] = "Confirm: Enter/LClick, "
-	                          "Cancel: (Esc/RClick), "
-	                          "thickness: %s, "
-	                          "depth (Ctrl to tweak): %s (%s), "
-	                          "Outset (O): (%s), "
-	                          "Boundary (B): (%s)";
+	const char *str = IFACE_("Confirm: Enter/LClick, Cancel: (Esc/RClick), Thickness: %s, "
+	                         "Depth (Ctrl to tweak): %s (%s), Outset (O): (%s), Boundary (B): (%s)");
 
 	char msg[HEADER_LENGTH];
 	ScrArea *sa = CTX_wm_area(C);
@@ -5215,9 +5232,9 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C)
 		BLI_snprintf(msg, HEADER_LENGTH, str,
 		             flts_str,
 		             flts_str + NUM_STR_REP_LEN,
-		             opdata->modify_depth ? "On" : "Off",
-		             RNA_boolean_get(op->ptr, "use_outset") ? "On" : "Off",
-		             RNA_boolean_get(op->ptr, "use_boundary") ? "On" : "Off"
+		             opdata->modify_depth ? IFACE_("On") : IFACE_("Off"),
+		             RNA_boolean_get(op->ptr, "use_outset") ? IFACE_("On") : IFACE_("Off"),
+		             RNA_boolean_get(op->ptr, "use_boundary") ? IFACE_("On") : IFACE_("Off")
 		            );
 
 		ED_area_headerprint(sa, msg);
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index b95c8a0..fd90246 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -136,8 +136,10 @@ void EDBM_mesh_clear(BMEditMesh *em)
 	
 	/* free tessellation data */
 	em->tottri = 0;
-	if (em->looptris) 
+	if (em->looptris) {
 		MEM_freeN(em->looptris);
+		em->looptris = NULL;
+	}
 }
 
 void EDBM_stats_update(BMEditMesh *em)
@@ -682,8 +684,10 @@ void undo_push_mesh(bContext *C, const char *name)
 	undo_editmode_push(C, name, getEditMesh, free_undo, undoMesh_to_editbtMesh, editbtMesh_to_undoMesh, NULL);
 }
 
-/* write comment here */
-UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, const float limit[2])
+/**
+ * Return a new UVVertMap from the editmesh
+ */
+UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, bool use_select, const float limit[2])
 {
 	BMVert *ev;
 	BMFace *efa;
@@ -696,6 +700,7 @@ UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, const float lim
 	MLoopUV *luv;
 	unsigned int a;
 	int totverts, i, totuv;
+	const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 
 	BM_mesh_elem_index_ensure(em->bm, BM_VERT | BM_FACE);
 	
@@ -704,8 +709,9 @@ UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, const float lim
 
 	/* generate UvMapVert array */
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		if (!selected || ((!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) && BM_elem_flag_test(efa, BM_ELEM_SELECT)))
+		if ((use_select == false) || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 			totuv += efa->len;
+		}
 	}
 
 	if (totuv == 0) {
@@ -726,7 +732,7 @@ UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, const float lim
 	
 	a = 0;
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		if (!selected || ((!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) && BM_elem_flag_test(efa, BM_ELEM_SELECT))) {
+		if ((use_select == false) || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 			i = 0;
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 				buf->tfindex = i;
@@ -761,7 +767,7 @@ UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, const float lim
 			/* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
 			
 			l = BM_iter_at_index(em->bm, BM_LOOPS_OF_FACE, efa, v->tfindex);
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			uv = luv->uv;
 			
 			lastv = NULL;
@@ -773,7 +779,7 @@ UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, const float lim
 				/* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
 				
 				l = BM_iter_at_index(em->bm, BM_LOOPS_OF_FACE, efa, iterv->tfindex);
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				uv2 = luv->uv;
 				
 				sub_v2_v2v2(uvdiff, uv2, uv);
@@ -831,6 +837,8 @@ UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, int selected, int do_is
 	BMFace **stack;
 	int stacksize = 0;
 
+	const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	BM_mesh_elem_index_ensure(em->bm, BM_VERT | BM_FACE);
 
 	totverts = em->bm->totvert;
@@ -843,8 +851,9 @@ UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, int selected, int do_is
 
 	/* generate UvElement array */
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		if (!selected || ((!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) && BM_elem_flag_test(efa, BM_ELEM_SELECT)))
+		if (!selected || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 			totuv += efa->len;
+		}
 	}
 
 	if (totuv == 0) {
@@ -869,7 +878,7 @@ UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, int selected, int do_is
 	j = 0;
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 		island_number[j++] = INVALID_ISLAND;
-		if (!selected || ((!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) && BM_elem_flag_test(efa, BM_ELEM_SELECT))) {
+		if (!selected || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 			BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
 				buf->l = l;
 				buf->separate = 0;
@@ -898,7 +907,7 @@ UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, int selected, int do_is
 			newvlist = v;
 
 			l = v->l;
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			uv = luv->uv;
 
 			lastv = NULL;
@@ -908,7 +917,7 @@ UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, int selected, int do_is
 				next = iterv->next;
 
 				l = iterv->l;
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				uv2 = luv->uv;
 
 				sub_v2_v2v2(uvdiff, uv2, uv);
@@ -1339,7 +1348,7 @@ void EDBM_mesh_reveal(BMEditMesh *em)
 
 /* so many tools call these that we better make it a generic function.
  */
-void EDBM_update_generic(BMEditMesh *em, const short do_tessface, const short is_destructive)
+void EDBM_update_generic(BMEditMesh *em, const bool do_tessface, const bool is_destructive)
 {
 	Object *ob = em->ob;
 	/* order of calling isn't important */
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 1d13aa3..0c9a5aa 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -575,13 +575,19 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
 	Main *bmain = CTX_data_main(C);
 	Scene *scene = CTX_data_scene(C);
 	View3D *v3d = CTX_wm_view3d(C);
-	Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
+	Base *base;
 	Image *ima = NULL;
 	Mesh *me;
 	Object *obedit;
 	int exitmode = 0;
-	char name[MAX_ID_NAME - 2];
 	
+	if (v3d == NULL) {
+		BKE_report(op->reports, RPT_ERROR, "No 3D View Available");
+		return OPERATOR_CANCELLED;
+	}
+
+	base = ED_view3d_give_base_under_cursor(C, event->mval);
+
 	/* Check context */
 	if (base == NULL || base->object->type != OB_MESH) {
 		BKE_report(op->reports, RPT_ERROR, "Not an object or mesh");
@@ -596,6 +602,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
 		ima = BKE_image_load_exists(path);
 	}
 	else {
+		char name[MAX_ID_NAME - 2];
 		RNA_string_get(op->ptr, "name", name);
 		ima = (Image *)BKE_libblock_find_name(ID_IM, name);
 	}
@@ -641,7 +648,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void MESH_OT_drop_named_image(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Assign Image to UV Map";
+	ot->name = "Drop Image to Mesh UV Map";
 	ot->description = "Assign Image to active UV Map, or create an UV Map";
 	ot->idname = "MESH_OT_drop_named_image";
 	
@@ -650,7 +657,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
 	ot->invoke = drop_named_image_invoke;
 	
 	/* flags */
-	ot->flag = OPTYPE_UNDO;
+	ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME - 2, "Name", "Image name to assign");
diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h
index e335c90..9ea15f9 100644
--- a/source/blender/editors/mesh/mesh_intern.h
+++ b/source/blender/editors/mesh/mesh_intern.h
@@ -210,7 +210,6 @@ void MESH_OT_bevel(struct wmOperatorType *ot);
 void MESH_OT_bridge_edge_loops(struct wmOperatorType *ot);
 void MESH_OT_inset(struct wmOperatorType *ot);
 void MESH_OT_wireframe(struct wmOperatorType *ot);
-void MESH_OT_vert_slide(struct wmOperatorType *ot);
 
 void MESH_OT_convex_hull(struct wmOperatorType *ot);
 
diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c
index 99fa85b..8d5bfe6 100644
--- a/source/blender/editors/mesh/mesh_navmesh.c
+++ b/source/blender/editors/mesh/mesh_navmesh.c
@@ -56,7 +56,8 @@
 #include "recast-capi.h"
 
 
-static void createVertsTrisData(bContext *C, LinkNode *obs, int *nverts_r, float **verts_r, int *ntris_r, int **tris_r)
+static void createVertsTrisData(bContext *C, LinkNode *obs,
+                                int *nverts_r, float **verts_r, int *ntris_r, int **tris_r, unsigned int *r_lay)
 {
 	MVert *mvert;
 	int nfaces = 0, *tri, i, curnverts, basenverts, curnfaces;
@@ -91,6 +92,8 @@ static void createVertsTrisData(bContext *C, LinkNode *obs, int *nverts_r, float
 			if (mf->v4)
 				ntris += 1;
 		}
+
+		*r_lay |= ob->lay;
 	}
 
 	/* create data */
@@ -295,7 +298,8 @@ static bool buildNavMesh(const RecastData *recastParams, int nverts, float *vert
 	return true;
 }
 
-static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh, Base *base)
+static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh,
+                                  Base *base, unsigned int lay)
 {
 	float co[3], rot[3];
 	BMEditMesh *em;
@@ -316,7 +320,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
 
 	if (createob) {
 		/* create new object */
-		obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, 1);
+		obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, lay);
 	}
 	else {
 		obedit = base->object;
@@ -452,15 +456,16 @@ static int navmesh_create_exec(bContext *C, wmOperator *op)
 		struct recast_polyMesh *pmesh = NULL;
 		struct recast_polyMeshDetail *dmesh = NULL;
 		bool ok;
+		unsigned int lay = 0;
 
 		int nverts = 0, ntris = 0;
 		int *tris = 0;
 		float *verts = NULL;
 
-		createVertsTrisData(C, obs, &nverts, &verts, &ntris, &tris);
+		createVertsTrisData(C, obs, &nverts, &verts, &ntris, &tris, &lay);
 		BLI_linklist_free(obs, NULL);
 		if ((ok = buildNavMesh(&scene->gm.recastData, nverts, verts, ntris, tris, &pmesh, &dmesh, op->reports))) {
-			createRepresentation(C, pmesh, dmesh, navmeshBase);
+			createRepresentation(C, pmesh, dmesh, navmeshBase, lay);
 		}
 
 		MEM_freeN(verts);
@@ -478,7 +483,7 @@ static int navmesh_create_exec(bContext *C, wmOperator *op)
 void MESH_OT_navmesh_make(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Create navigation mesh";
+	ot->name = "Create Navigation Mesh";
 	ot->description = "Create navigation mesh for selected objects";
 	ot->idname = "MESH_OT_navmesh_make";
 
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index 09b190d..884c4a3 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -148,7 +148,6 @@ void ED_operatortypes_mesh(void)
 	WM_operatortype_append(MESH_OT_solidify);
 	WM_operatortype_append(MESH_OT_select_nth);
 	WM_operatortype_append(MESH_OT_vert_connect);
-	WM_operatortype_append(MESH_OT_vert_slide);
 	WM_operatortype_append(MESH_OT_knife_tool);
 
 	WM_operatortype_append(MESH_OT_bevel);
@@ -198,7 +197,7 @@ void ED_operatormacros_mesh(void)
 	                                  OPTYPE_UNDO | OPTYPE_REGISTER);
 	WM_operatortype_macro_define(ot, "MESH_OT_loopcut");
 	otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
-	RNA_struct_idprops_unset(otmacro->ptr, "release_confirm");
+	RNA_boolean_set(otmacro->ptr, "release_confirm", false);
 
 	ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", "Duplicate mesh and move",
 	                                  OPTYPE_UNDO | OPTYPE_REGISTER);
@@ -263,10 +262,14 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
 	keymap = WM_keymap_find(keyconf, "Mesh", 0, 0);
 	keymap->poll = ED_operator_editmesh;
 	
-	WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0);
-	WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL, 0);
+	WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0);	
 	WM_keymap_add_item(keymap, "MESH_OT_inset", IKEY, KM_PRESS, 0, 0);
 
+	kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL, 0);
+	RNA_boolean_set(kmi->ptr, "vertex_only", FALSE);
+	kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
+	RNA_boolean_set(kmi->ptr, "vertex_only", TRUE);
+
 	/* selecting */
 	/* standard mouse selection goes via space_view3d */
 	kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
@@ -360,7 +363,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
 	WM_keymap_add_item(keymap, "MESH_OT_vert_connect", JKEY, KM_PRESS, 0, 0);
 
 	/* Vertex Slide */
-	WM_keymap_add_item(keymap, "MESH_OT_vert_slide", VKEY, KM_PRESS, KM_SHIFT, 0);
+	WM_keymap_add_item(keymap, "TRANSFORM_OT_vert_slide", VKEY, KM_PRESS, KM_SHIFT, 0);
 	/* use KM_CLICK because same key is used for tweaks */
 	kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0);
 	RNA_boolean_set(kmi->ptr, "rotate_source", TRUE);
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 96b8f10..cb69faa 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -502,6 +502,9 @@ int join_mesh_exec(bContext *C, wmOperator *op)
 
 	/* tessface data removed above, no need to update */
 	mesh_update_customdata_pointers(me, FALSE);
+
+	/* update normals in case objects with non-uniform scale are joined */
+	ED_mesh_calc_normals(me);
 	
 	/* old material array */
 	for (a = 1; a <= ob->totcol; a++) {
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index 8633a7a..6c056df 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -586,3 +586,27 @@ void undo_push_mball(bContext *C, const char *name)
 	undo_editmode_push(C, name, get_data, free_undoMball, undoMball_to_editMball, editMball_to_undoMball, NULL);
 }
 
+/* matrix is 4x4 */
+void ED_mball_transform(MetaBall *mb, float *mat)
+{
+	MetaElem *me;
+	float quat[4];
+	const float scale = mat4_to_scale((float (*)[4])mat);
+	const float scale_sqrt = sqrtf(scale);
+
+	mat4_to_quat(quat, (float (*)[4])mat);
+
+	for (me = mb->elems.first; me; me = me->next) {
+		mul_m4_v3((float (*)[4])mat, &me->x);
+		mul_qt_qtqt(me->quat, quat, me->quat);
+		me->rad *= scale;
+		/* hrmf, probably elems shouldn't be
+		 * treating scale differently - campbell */
+		if (!MB_TYPE_SIZE_SQUARED(me->type)) {
+			mul_v3_fl(&me->expx, scale);
+		}
+		else {
+			mul_v3_fl(&me->expx, scale_sqrt);
+		}
+	}
+}
diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c
index e98654f..f91d574 100644
--- a/source/blender/editors/metaball/mball_ops.c
+++ b/source/blender/editors/metaball/mball_ops.c
@@ -28,10 +28,6 @@
  *  \ingroup edmeta
  */
 
-
-#include "WM_api.h"
-#include "WM_types.h"
-
 #include "RNA_access.h"
 
 #include "ED_mball.h"
@@ -40,6 +36,9 @@
 
 #include "BLI_utildefines.h"
 
+#include "WM_api.h"
+#include "WM_types.h"
+
 #include "mball_intern.h"
 
 void ED_operatortypes_metaball(void)
diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt
index 05c042a..a92b25c 100644
--- a/source/blender/editors/object/CMakeLists.txt
+++ b/source/blender/editors/object/CMakeLists.txt
@@ -20,6 +20,7 @@
 
 set(INC
 	../include
+	../../blenfont
 	../../blenkernel
 	../../blenlib
 	../../blenloader
@@ -66,4 +67,8 @@ if(WITH_GAMEENGINE)
 	add_definitions(-DWITH_GAMEENGINE)
 endif()
 
+if(WITH_INTERNATIONAL)
+	add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
 blender_add_lib(bf_editor_object "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/object/SConscript b/source/blender/editors/object/SConscript
index df51198..203d7df 100644
--- a/source/blender/editors/object/SConscript
+++ b/source/blender/editors/object/SConscript
@@ -29,7 +29,7 @@ Import ('env')
 
 sources = env.Glob('*.c')
 
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs = '../include ../../blenlib ../../blenfont ../../blenkernel ../../makesdna ../../imbuf'
 incs += ' ../../windowmanager #/intern/guardedalloc ../../blenloader'
 incs += ' ../../makesrna ../../python ../../ikplugin ../../bmesh'
 incs += ' ../../render/extern/include ../../gpu' # for object_bake.c
@@ -50,4 +50,7 @@ if env['WITH_BF_PYTHON']:
 if env['WITH_BF_GAMEENGINE']:
     defs.append('WITH_GAMEENGINE')
 
+if env['WITH_BF_INTERNATIONAL']:
+    defs.append('WITH_INTERNATIONAL')
+
 env.BlenderLib ( 'bf_editors_object', sources, Split(incs), defs, libtype=['core'], priority=[35] )
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 4db416b..ffaa6f6 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -941,7 +941,7 @@ static void object_delete_check_glsl_update(Object *ob)
 void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base)
 {
 	DAG_id_type_tag(bmain, ID_OB);
-	BLI_remlink(&scene->base, base);
+	BKE_scene_base_unlink(scene, base);
 	object_delete_check_glsl_update(base->object);
 	BKE_libblock_free_us(&bmain->object, base->object);
 	if (scene->basact == base) scene->basact = NULL;
@@ -1558,7 +1558,7 @@ static int convert_exec(bContext *C, wmOperator *op)
 				mb = newob->data;
 				mb->id.us--;
 
-				newob->data = BKE_mesh_add("Mesh");
+				newob->data = BKE_mesh_add(bmain, "Mesh");
 				newob->type = OB_MESH;
 
 				me = newob->data;
@@ -1698,7 +1698,11 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
 		BLI_addhead(&scene->base, basen);   /* addhead: prevent eternal loop */
 		basen->object = obn;
 
-		if (basen->flag & OB_FROMGROUP) {
+		/* 1) duplis should end up in same group as the original
+		 * 2) Rigid Body sim participants MUST always be part of a group...
+		 */
+		// XXX: is 2) really a good measure here?
+		if ((basen->flag & OB_FROMGROUP) || ob->rigidbody_object || ob->rigidbody_constraint) {
 			Group *group;
 			for (group = bmain->group.first; group; group = group->id.next) {
 				if (object_in_group(ob, group))
@@ -2001,7 +2005,8 @@ void OBJECT_OT_duplicate(wmOperatorType *ot)
 
 static int add_named_exec(bContext *C, wmOperator *op)
 {
-	wmEvent *event = CTX_wm_window(C)->eventstate;
+	wmWindow *win = CTX_wm_window(C);
+	wmEvent *event = win ? win->eventstate : NULL;
 	Main *bmain = CTX_data_main(C);
 	Scene *scene = CTX_data_scene(C);
 	Base *basen, *base;
@@ -2033,8 +2038,10 @@ static int add_named_exec(bContext *C, wmOperator *op)
 
 	basen->lay = basen->object->lay = scene->lay;
 
-	ED_object_location_from_view(C, basen->object->loc);
-	ED_view3d_cursor3d_position(C, basen->object->loc, event->x, event->y);
+	if (event) {
+		ED_object_location_from_view(C, basen->object->loc);
+		ED_view3d_cursor3d_position(C, basen->object->loc, event->x, event->y);
+	}
 	
 	ED_base_object_activate(C, basen);
 
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index f36c6d7..a680230 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -257,11 +257,18 @@ static DerivedMesh *multiresbake_create_hiresdm(Scene *scene, Object *ob, int *l
 	return dm;
 }
 
-static void clear_images(MTFace *mtface, int totface)
+typedef enum ClearFlag {
+	CLEAR_NORMAL = 1
+} ClearFlag;
+
+
+static void clear_images(MTFace *mtface, int totface, ClearFlag flag)
 {
 	int a;
 	const float vec_alpha[4] = {0.0f, 0.0f, 0.0f, 0.0f};
 	const float vec_solid[4] = {0.0f, 0.0f, 0.0f, 1.0f};
+	const float nor_alpha[4] = {0.5f, 0.5f, 1.0f, 0.0f};
+	const float nor_solid[4] = {0.5f, 0.5f, 1.0f, 1.0f};
 
 	for (a = 0; a < totface; a++)
 		mtface[a].tpage->id.flag &= ~LIB_DOIT;
@@ -272,7 +279,11 @@ static void clear_images(MTFace *mtface, int totface)
 		if ((ima->id.flag & LIB_DOIT) == 0) {
 			ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
 
-			IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
+			if (flag == CLEAR_NORMAL)
+				IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? nor_alpha : nor_solid);
+			else
+				IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
+
 			ima->id.flag |= LIB_DOIT;
 
 			BKE_image_release_ibuf(ima, ibuf, NULL);
@@ -300,7 +311,10 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op)
 			ob = base->object;
 			me = (Mesh *)ob->data;
 
-			clear_images(me->mtface, me->totface);
+			if (scene->r.bake_mode == RE_BAKE_NORMALS && scene->r.bake_normal_space == R_BAKE_SPACE_TANGENT)
+				clear_images(me->mtface, me->totface, CLEAR_NORMAL);
+			else
+				clear_images(me->mtface, me->totface, 0);
 		}
 		CTX_DATA_END;
 	}
@@ -395,7 +409,10 @@ static void multiresbake_startjob(void *bkv, short *stop, short *do_update, floa
 			DerivedMesh *dm = data->lores_dm;
 			MTFace *mtface = CustomData_get_layer(&dm->faceData, CD_MTFACE);
 
-			clear_images(mtface, dm->getNumTessFaces(dm));
+			if (bkj->mode == RE_BAKE_NORMALS)
+				clear_images(mtface, dm->getNumTessFaces(dm), CLEAR_NORMAL);
+			else
+				clear_images(mtface, dm->getNumTessFaces(dm), 0);
 		}
 	}
 
@@ -610,7 +627,12 @@ static void finish_bake_internal(BakeRender *bkr)
 		/* freed when baking is done, but if its canceled we need to free here */
 		if (ibuf) {
 			if (ibuf->userdata) {
-				MEM_freeN(ibuf->userdata);
+				BakeImBufuserData *userdata = (BakeImBufuserData *) ibuf->userdata;
+				if (userdata->mask_buffer)
+					MEM_freeN(userdata->mask_buffer);
+				if (userdata->displacement_buffer)
+					MEM_freeN(userdata->displacement_buffer);
+				MEM_freeN(userdata);
 				ibuf->userdata = NULL;
 			}
 		}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 6cb7cd5..7746329 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -718,81 +718,87 @@ void CONSTRAINT_OT_limitdistance_reset(wmOperatorType *ot)
 
 /* ------------- Child-Of Constraint ------------------ */
 
-static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con, float invmat[4][4])
+static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con, float invmat[4][4], const int owner)
 {
-	bConstraint *lastcon = NULL;
-	bPoseChannel *pchan = NULL;
-	
 	/* nullify inverse matrix first */
 	unit_m4(invmat);
 	
-	/* try to find a pose channel - assume that this is the constraint owner */
-	/* TODO: get from context instead? */
-	if (ob && ob->pose)
-		pchan = BKE_pose_channel_active(ob);
-	
-	/* calculate/set inverse matrix:
-	 *  We just calculate all transform-stack eval up to but not including this constraint.
-	 *  This is because inverse should just inverse correct for just the constraint's influence
-	 *  when it gets applied; that is, at the time of application, we don't know anything about
-	 *  what follows.
-	 */
-	if (pchan) {
-		float imat[4][4], tmat[4][4];
-		float pmat[4][4];
-		
-		/* 1. calculate posemat where inverse doesn't exist yet (inverse was cleared above), 
-		 * to use as baseline ("pmat") to derive delta from. This extra calc saves users 
-		 * from having pressing "Clear Inverse" first
-		 */
-		BKE_pose_where_is(scene, ob);
-		copy_m4_m4(pmat, pchan->pose_mat);
-		
-		/* 2. knock out constraints starting from this one */
-		lastcon = pchan->constraints.last;
-		pchan->constraints.last = con->prev;
-		
-		if (con->prev) {
-			/* new end must not point to this one, else this chain cutting is useless */
-			con->prev->next = NULL;
-		}
-		else {
-			/* constraint was first */
-			pchan->constraints.first = NULL;
-		}
-		
-		/* 3. solve pose without disabled constraints */
-		BKE_pose_where_is(scene, ob);
-		
-		/* 4. determine effect of constraint by removing the newly calculated 
-		 * pchan->pose_mat from the original pchan->pose_mat, thus determining 
-		 * the effect of the constraint
-		 */
-		invert_m4_m4(imat, pchan->pose_mat);
-		mult_m4_m4m4(tmat, pmat, imat);
-		invert_m4_m4(invmat, tmat);
-		
-		/* 5. restore constraints */
-		pchan->constraints.last = lastcon;
-		
-		if (con->prev) {
-			/* hook up prev to this one again */
-			con->prev->next = con;
-		}
-		else {
-			/* set as first again */
-			pchan->constraints.first = con;
+	if (owner == EDIT_CONSTRAINT_OWNER_BONE) {
+		bPoseChannel *pchan;
+		/* try to find a pose channel - assume that this is the constraint owner */
+		/* TODO: get from context instead? */
+		if (ob && ob->pose && (pchan = BKE_pose_channel_active(ob))) {
+			bConstraint *con_last;
+			/* calculate/set inverse matrix:
+			 *  We just calculate all transform-stack eval up to but not including this constraint.
+			 *  This is because inverse should just inverse correct for just the constraint's influence
+			 *  when it gets applied; that is, at the time of application, we don't know anything about
+			 *  what follows.
+			 */
+			float imat[4][4], tmat[4][4];
+			float pmat[4][4];
+
+			/* make sure we passed the correct constraint */
+			BLI_assert(BLI_findindex(&pchan->constraints, con) != -1);
+
+			/* 1. calculate posemat where inverse doesn't exist yet (inverse was cleared above),
+			 * to use as baseline ("pmat") to derive delta from. This extra calc saves users
+			 * from having pressing "Clear Inverse" first
+			 */
+			BKE_pose_where_is(scene, ob);
+			copy_m4_m4(pmat, pchan->pose_mat);
+
+			/* 2. knock out constraints starting from this one */
+			con_last = pchan->constraints.last;
+			pchan->constraints.last = con->prev;
+
+			if (con->prev) {
+				/* new end must not point to this one, else this chain cutting is useless */
+				con->prev->next = NULL;
+			}
+			else {
+				/* constraint was first */
+				pchan->constraints.first = NULL;
+			}
+
+			/* 3. solve pose without disabled constraints */
+			BKE_pose_where_is(scene, ob);
+
+			/* 4. determine effect of constraint by removing the newly calculated
+			 * pchan->pose_mat from the original pchan->pose_mat, thus determining
+			 * the effect of the constraint
+			 */
+			invert_m4_m4(imat, pchan->pose_mat);
+			mult_m4_m4m4(tmat, pmat, imat);
+			invert_m4_m4(invmat, tmat);
+
+			/* 5. restore constraints */
+			pchan->constraints.last = con_last;
+
+			if (con->prev) {
+				/* hook up prev to this one again */
+				con->prev->next = con;
+			}
+			else {
+				/* set as first again */
+				pchan->constraints.first = con;
+			}
+
+			/* 6. recalculate pose with new inv-mat applied */
+			BKE_pose_where_is(scene, ob);
 		}
-		
-		/* 6. recalculate pose with new inv-mat applied */
-		BKE_pose_where_is(scene, ob);
 	}
-	else if (ob) {
-		Object workob;
-		
-		/* use BKE_object_workob_calc_parent to find inverse - just like for normal parenting */
-		BKE_object_workob_calc_parent(scene, ob, &workob);
-		invert_m4_m4(invmat, workob.obmat);
+	if (owner == EDIT_CONSTRAINT_OWNER_OBJECT) {
+		if (ob) {
+			Object workob;
+
+			/* make sure we passed the correct constraint */
+			BLI_assert(BLI_findindex(&ob->constraints, con) != -1);
+
+			/* use BKE_object_workob_calc_parent to find inverse - just like for normal parenting */
+			BKE_object_workob_calc_parent(scene, ob, &workob);
+			invert_m4_m4(invmat, workob.obmat);
+		}
 	}
 }
 
@@ -803,6 +809,7 @@ static int childof_set_inverse_exec(bContext *C, wmOperator *op)
 	Object *ob = ED_object_active_context(C);
 	bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_CHILDOF);
 	bChildOfConstraint *data = (con) ? (bChildOfConstraint *)con->data : NULL;
+	const int owner = RNA_enum_get(op->ptr, "owner");
 
 	/* despite 3 layers of checks, we may still not be able to find a constraint */
 	if (data == NULL) {
@@ -811,7 +818,7 @@ static int childof_set_inverse_exec(bContext *C, wmOperator *op)
 		return OPERATOR_CANCELLED;
 	}
 	
-	child_get_inverse_matrix(scene, ob, con, data->invmat);
+	child_get_inverse_matrix(scene, ob, con, data->invmat, owner);
 
 	WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, ob);
 	
@@ -1024,6 +1031,7 @@ static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op)
 	Object *ob = ED_object_active_context(C);
 	bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_OBJECTSOLVER);
 	bObjectSolverConstraint *data = (con) ? (bObjectSolverConstraint *)con->data : NULL;
+	const int owner = RNA_enum_get(op->ptr, "owner");
 
 	/* despite 3 layers of checks, we may still not be able to find a constraint */
 	if (data == NULL) {
@@ -1032,7 +1040,7 @@ static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op)
 		return OPERATOR_CANCELLED;
 	}
 
-	child_get_inverse_matrix(scene, ob, con, data->invmat);
+	child_get_inverse_matrix(scene, ob, con, data->invmat, owner);
 
 	WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, ob);
 
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index fcc3b5d..a13c050 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -376,7 +376,7 @@ void ED_object_exit_editmode(bContext *C, int flag)
 		scene->obedit = NULL; // XXX for context
 
 		/* flag object caches as outdated */
-		BKE_ptcache_ids_from_object(&pidlist, obedit, NULL, 0);
+		BKE_ptcache_ids_from_object(&pidlist, obedit, scene, 0);
 		for (pid = pidlist.first; pid; pid = pid->next) {
 			if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
 				pid->cache->flag |= PTCACHE_OUTDATED;
@@ -1151,7 +1151,7 @@ static int object_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *U
 	
 	/* show popup dialog to allow editing of range... */
 	/* FIXME: hardcoded dimensions here are just arbitrary */
-	return WM_operator_props_dialog_popup(C, op, 200, 200);
+	return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 10 * UI_UNIT_Y);
 }
 
 /* Calculate/recalculate whole paths (avs.path_sf to avs.path_ef) */
@@ -1864,9 +1864,7 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
 			ob_iter->max_vel = ob->max_vel;
 			ob_iter->obstacleRad = ob->obstacleRad;
 			ob_iter->mass = ob->mass;
-			ob_iter->anisotropicFriction[0] = ob->anisotropicFriction[0];
-			ob_iter->anisotropicFriction[1] = ob->anisotropicFriction[1];
-			ob_iter->anisotropicFriction[2] = ob->anisotropicFriction[2];
+			copy_v3_v3(ob_iter->anisotropicFriction, ob->anisotropicFriction);
 			ob_iter->collision_boundtype = ob->collision_boundtype;
 			ob_iter->margin = ob->margin;
 			ob_iter->bsoft = copy_bulletsoftbody(ob->bsoft);
@@ -1874,6 +1872,9 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
 				ob_iter->restrictflag |= OB_RESTRICT_RENDER;
 			else
 				ob_iter->restrictflag &= ~OB_RESTRICT_RENDER;
+
+			ob_iter->col_group = ob->col_group;
+			ob_iter->col_mask = ob->col_mask;
 		}
 	}
 	CTX_DATA_END;
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 7bf1a5d..9b683a1 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -311,7 +311,7 @@ static int group_create_exec(bContext *C, wmOperator *op)
 	
 	RNA_string_get(op->ptr, "name", name);
 	
-	group = add_group(name);
+	group = add_group(bmain, name);
 		
 	CTX_DATA_BEGIN (C, Base *, base, selected_bases)
 	{
@@ -348,12 +348,13 @@ static int group_add_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Scene *scene = CTX_data_scene(C);
 	Object *ob = ED_object_context(C);
+	Main *bmain = CTX_data_main(C);
 	Group *group;
 
 	if (ob == NULL)
 		return OPERATOR_CANCELLED;
 
-	group = add_group("Group");
+	group = add_group(bmain, "Group");
 	add_to_group(group, ob, scene, NULL);
 
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index caeff1e..b1612a2 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -386,6 +386,31 @@ static void select_editcurve_hook(Object *obedit, HookModifierData *hmd)
 	}
 }
 
+static void object_hook_from_context(bContext *C, PointerRNA *ptr, const int num,
+                                     Object **r_ob, HookModifierData **r_hmd)
+{
+	Object *ob;
+	HookModifierData *hmd;
+
+	if (ptr->data) {  /* if modifier context is available, use that */
+		ob = ptr->id.data;
+		hmd = ptr->data;
+	}
+	else {  /* use the provided property */
+		ob = CTX_data_edit_object(C);
+		hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
+	}
+
+	if (ob && hmd && (hmd->modifier.type == eModifierType_Hook)) {
+		*r_ob = ob;
+		*r_hmd = hmd;
+	}
+	else {
+		*r_ob = NULL;
+		*r_hmd = NULL;
+	}
+}
+
 static void object_hook_select(Object *ob, HookModifierData *hmd) 
 {
 	if (hmd->indexar == NULL)
@@ -533,7 +558,7 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
 	}
 }
 
-void OBJECT_OT_hook_add_selobj(wmOperatorType *ot)
+void OBJECT_OT_hook_add_selob(wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name = "Hook to Selected Object";
@@ -567,7 +592,7 @@ static int object_add_hook_newob_exec(bContext *C, wmOperator *op)
 	}
 }
 
-void OBJECT_OT_hook_add_newobj(wmOperatorType *ot)
+void OBJECT_OT_hook_add_newob(wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name = "Hook to New Object";
@@ -663,16 +688,9 @@ static int object_hook_reset_exec(bContext *C, wmOperator *op)
 	int num = RNA_enum_get(op->ptr, "modifier");
 	Object *ob = NULL;
 	HookModifierData *hmd = NULL;
-	
-	if (ptr.data) {     /* if modifier context is available, use that */
-		ob = ptr.id.data;
-		hmd = ptr.data;
-	}
-	else {          /* use the provided property */
-		ob = CTX_data_edit_object(C);
-		hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
-	}
-	if (!ob || !hmd) {
+
+	object_hook_from_context(C, &ptr, num, &ob, &hmd);
+	if (hmd == NULL) {
 		BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
 		return OPERATOR_CANCELLED;
 	}
@@ -732,15 +750,8 @@ static int object_hook_recenter_exec(bContext *C, wmOperator *op)
 	Scene *scene = CTX_data_scene(C);
 	float bmat[3][3], imat[3][3];
 	
-	if (ptr.data) {  /* if modifier context is available, use that */
-		ob = ptr.id.data;
-		hmd = ptr.data;
-	}
-	else {  /* use the provided property */
-		ob = CTX_data_edit_object(C);
-		hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
-	}
-	if (!ob || !hmd) {
+	object_hook_from_context(C, &ptr, num, &ob, &hmd);
+	if (hmd == NULL) {
 		BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
 		return OPERATOR_CANCELLED;
 	}
@@ -790,15 +801,8 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
 	char name[MAX_NAME];
 	int *indexar, tot;
 	
-	if (ptr.data) {     /* if modifier context is available, use that */
-		ob = ptr.id.data;
-		hmd = ptr.data;
-	}
-	else {          /* use the provided property */
-		ob = CTX_data_edit_object(C);
-		hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
-	}
-	if (!ob || !hmd) {
+	object_hook_from_context(C, &ptr, num, &ob, &hmd);
+	if (hmd == NULL) {
 		BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
 		return OPERATOR_CANCELLED;
 	}
@@ -852,15 +856,8 @@ static int object_hook_select_exec(bContext *C, wmOperator *op)
 	Object *ob = NULL;
 	HookModifierData *hmd = NULL;
 	
-	if (ptr.data) {     /* if modifier context is available, use that */
-		ob = ptr.id.data;
-		hmd = ptr.data;
-	}
-	else {          /* use the provided property */
-		ob = CTX_data_edit_object(C);
-		hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
-	}
-	if (!ob || !hmd) {
+	object_hook_from_context(C, &ptr, num, &ob, &hmd);
+	if (hmd == NULL) {
 		BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
 		return OPERATOR_CANCELLED;
 	}
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 0be9c92..4523ac0 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -127,8 +127,8 @@ void OBJECT_OT_join_shapes(struct wmOperatorType *ot);
 void OBJECT_OT_convert(struct wmOperatorType *ot);
 
 /* object_hook.c */
-void OBJECT_OT_hook_add_selobj(struct wmOperatorType *ot);
-void OBJECT_OT_hook_add_newobj(struct wmOperatorType *ot);
+void OBJECT_OT_hook_add_selob(struct wmOperatorType *ot);
+void OBJECT_OT_hook_add_newob(struct wmOperatorType *ot);
 void OBJECT_OT_hook_remove(struct wmOperatorType *ot);
 void OBJECT_OT_hook_select(struct wmOperatorType *ot);
 void OBJECT_OT_hook_assign(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 7d3d686..00082b0 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1196,6 +1196,11 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op)
 
 	DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 	WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
+
+	if (ob->mode & OB_MODE_SCULPT) {
+		/* ensure that grid paint mask layer is created */
+		ED_sculpt_mask_layers_ensure(ob, mmd);
+	}
 	
 	return OPERATOR_FINISHED;
 }
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 03b50c0..bf408d6 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -217,8 +217,8 @@ void ED_operatortypes_object(void)
 	WM_operatortype_append(OBJECT_OT_group_link);
 	WM_operatortype_append(OBJECT_OT_group_remove);
 
-	WM_operatortype_append(OBJECT_OT_hook_add_selobj);
-	WM_operatortype_append(OBJECT_OT_hook_add_newobj);
+	WM_operatortype_append(OBJECT_OT_hook_add_selob);
+	WM_operatortype_append(OBJECT_OT_hook_add_newob);
 	WM_operatortype_append(OBJECT_OT_hook_remove);
 	WM_operatortype_append(OBJECT_OT_hook_select);
 	WM_operatortype_append(OBJECT_OT_hook_assign);
@@ -394,6 +394,12 @@ void ED_keymap_object(wmKeyConfig *keyconf)
 	WM_keymap_verify_item(keymap, "GROUP_OT_objects_remove_all", GKEY, KM_PRESS, KM_SHIFT | KM_CTRL | KM_ALT, 0);
 	WM_keymap_verify_item(keymap, "GROUP_OT_objects_add_active", GKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
 	WM_keymap_verify_item(keymap, "GROUP_OT_objects_remove_active", GKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0);
+	
+	kmi = WM_keymap_add_item(keymap, "RIGIDBODY_OT_objects_add", RKEY, KM_PRESS, KM_CTRL, 0);
+	RNA_enum_set(kmi->ptr, "type", 0); /* active */
+	kmi = WM_keymap_add_item(keymap, "RIGIDBODY_OT_objects_add", RKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
+	RNA_enum_set(kmi->ptr, "type", 1); /* passive */
+	WM_keymap_add_item(keymap, "RIGIDBODY_OT_objects_remove", RKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
 
 	WM_keymap_add_menu(keymap, "VIEW3D_MT_object_specials", WKEY, KM_PRESS, 0, 0);
 
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index fa44d3d..629dba4 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -35,6 +35,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "DNA_anim_types.h"
+#include "DNA_armature_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_constraint_types.h"
 #include "DNA_group_types.h"
@@ -55,6 +56,8 @@
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_action.h"
 #include "BKE_animsys.h"
 #include "BKE_armature.h"
@@ -354,7 +357,7 @@ static int make_proxy_exec(bContext *C, wmOperator *op)
 		
 		/* remove base, leave user count of object, it gets linked in BKE_object_make_proxy */
 		if (gob == NULL) {
-			BLI_remlink(&scene->base, oldbase);
+			BKE_scene_base_unlink(scene, oldbase);
 			MEM_freeN(oldbase);
 		}
 		
@@ -578,6 +581,7 @@ EnumPropertyItem prop_make_parent_types[] = {
 	{PAR_ARMATURE_AUTO, "ARMATURE_AUTO", 0, "   With Automatic Weights", ""},
 	{PAR_ARMATURE_ENVELOPE, "ARMATURE_ENVELOPE", 0, "   With Envelope Weights", ""},
 	{PAR_BONE, "BONE", 0, "Bone", ""},
+	{PAR_BONE_RELATIVE, "BONE_RELATIVE", 0, "Bone Relative", ""},
 	{PAR_CURVE, "CURVE", 0, "Curve Deform", ""},
 	{PAR_FOLLOW, "FOLLOW", 0, "Follow Path", ""},
 	{PAR_PATH_CONST, "PATH_CONST", 0, "Path Constraint", ""},
@@ -624,7 +628,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
 				partype = PAR_OBJECT;
 		}
 	}
-	else if (partype == PAR_BONE) {
+	else if (ELEM(partype, PAR_BONE, PAR_BONE_RELATIVE)) {
 		pchan = BKE_pose_channel_active(par);
 		
 		if (pchan == NULL) {
@@ -705,8 +709,16 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
 					}
 				}
 			}
-			else if (partype == PAR_BONE)
+			else if (partype == PAR_BONE) {
+				ob->partype = PARBONE;  /* note, dna define, not operator property */
+				if (pchan->bone)
+					pchan->bone->flag &= ~BONE_RELATIVE_PARENTING;
+			}
+			else if (partype == PAR_BONE_RELATIVE) {
 				ob->partype = PARBONE;  /* note, dna define, not operator property */
+				if (pchan->bone)
+					pchan->bone->flag |= BONE_RELATIVE_PARENTING;
+			}
 			else
 				ob->partype = PAROBJECT;  /* note, dna define, not operator property */
 			
@@ -791,7 +803,7 @@ static int parent_set_exec(bContext *C, wmOperator *op)
 static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event))
 {
 	Object *ob = ED_object_active_context(C);
-	uiPopupMenu *pup = uiPupMenuBegin(C, "Set Parent To", ICON_NONE);
+	uiPopupMenu *pup = uiPupMenuBegin(C, IFACE_("Set Parent To"), ICON_NONE);
 	uiLayout *layout = uiPupMenuLayout(pup);
 
 	wmOperatorType *ot = WM_operatortype_find("OBJECT_OT_parent_set", TRUE);
@@ -800,11 +812,12 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSE
 #if 0
 	uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_OBJECT);
 #else
-	opptr = uiItemFullO_ptr(layout, ot, "Object", ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+	opptr = uiItemFullO_ptr(layout, ot, IFACE_("Object"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
 	RNA_enum_set(&opptr, "type", PAR_OBJECT);
 	RNA_boolean_set(&opptr, "keep_transform", FALSE);
 
-	opptr = uiItemFullO_ptr(layout, ot, "Object (Keep Transform)", ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+	opptr = uiItemFullO_ptr(layout, ot, IFACE_("Object (Keep Transform)"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT,
+	                        UI_ITEM_O_RETURN_PROPS);
 	RNA_enum_set(&opptr, "type", PAR_OBJECT);
 	RNA_boolean_set(&opptr, "keep_transform", TRUE);
 #endif
@@ -815,6 +828,7 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSE
 		uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_ENVELOPE);
 		uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_ARMATURE_AUTO);
 		uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE);
+		uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE_RELATIVE);
 	}
 	else if (ob->type == OB_CURVE) {
 		uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_CURVE);
@@ -1069,7 +1083,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
 void OBJECT_OT_track_clear(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Clear track";
+	ot->name = "Clear Track";
 	ot->description = "Clear tracking constraint or flag from object";
 	ot->idname = "OBJECT_OT_track_clear";
 	
@@ -2168,7 +2182,7 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot)
 	ot->poll = ED_operator_objectmode;
 	
 	/* flags */
-	ot->flag = OPTYPE_UNDO;
+	ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	RNA_def_string(ot->srna, "name", "Material", MAX_ID_NAME - 2, "Name", "Material name to assign");
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 7a2eb56..1352315 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -57,6 +57,7 @@
 #include "BKE_tessmesh.h"
 #include "BKE_multires.h"
 #include "BKE_armature.h"
+#include "BKE_lattice.h"
 
 #include "RNA_define.h"
 #include "RNA_access.h"
@@ -66,6 +67,7 @@
 
 #include "ED_armature.h"
 #include "ED_keyframing.h"
+#include "ED_mball.h"
 #include "ED_mesh.h"
 #include "ED_screen.h"
 #include "ED_view3d.h"
@@ -406,6 +408,12 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
 				change = 0;
 			}
 		}
+		else if (ob->type == OB_MBALL) {
+			if (ID_REAL_USERS(ob->data) > 1) {
+				BKE_report(reports, RPT_ERROR, "Cannot apply to a multi user metaball, doing nothing");
+				change = 0;
+			}
+		}
 		else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
 			Curve *cu;
 
@@ -416,7 +424,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
 
 			cu = ob->data;
 
-			if (!(cu->flag & CU_3D) && (apply_rot || apply_loc)) {
+			if (((ob->type == OB_CURVE) && !(cu->flag & CU_3D)) && (apply_rot || apply_loc)) {
 				BKE_report(reports, RPT_ERROR,
 				           "Neither rotation nor location could be applied to a 2D curve, doing nothing");
 				change = 0;
@@ -515,6 +523,10 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
 				bp++;
 			}
 		}
+		else if (ob->type == OB_MBALL) {
+			MetaBall *mb = ob->data;
+			ED_mball_transform(mb, (float *)mat);
+		}
 		else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
 			Curve *cu = ob->data;
 
@@ -699,9 +711,11 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 			}
 			else {
 				if (around == V3D_CENTROID) {
-					const float total_div = 1.0f / (float)em->bm->totvert;
-					BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
-						madd_v3_v3fl(cent, eve->co, total_div);
+					if (em->bm->totvert) {
+						const float total_div = 1.0f / (float)em->bm->totvert;
+						BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
+							madd_v3_v3fl(cent, eve->co, total_div);
+						}
 					}
 				}
 				else {
@@ -899,6 +913,20 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 					break;
 				}
 			}
+			else if (ob->type == OB_LATTICE) {
+				Lattice *lt = ob->data;
+
+				if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
+				else if (around == V3D_CENTROID) { BKE_lattice_center_median(lt, cent); }
+				else { BKE_lattice_center_bounds(lt, cent); }
+
+				negate_v3_v3(cent_neg, cent);
+				BKE_lattice_translate(lt, cent_neg, 1);
+
+				tot_change++;
+				lt->id.flag |= LIB_DOIT;
+				do_inverse_offset = TRUE;
+			}
 
 			/* offset other selected objects */
 			if (do_inverse_offset && (centermode != GEOMETRY_TO_ORIGIN)) {
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index e7c619a..87ff42e 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -82,6 +82,7 @@ static void vgroup_remap_update_users(Object *ob, int *map);
 static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *defgroup);
 static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg);
 static void vgroup_delete_all(Object *ob);
+static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot, const short use_vert_sel);
 
 static int vertex_group_use_vert_sel(Object *ob)
 {
@@ -183,6 +184,29 @@ int ED_vgroup_data_create(ID *id)
 	}
 }
 
+/**
+ * Removes out of range MDeformWeights
+ */
+void ED_vgroup_data_clamp_range(ID *id, const int total)
+{
+	MDeformVert **dvert_arr;
+	int dvert_tot;
+
+	if (ED_vgroup_give_parray(id, &dvert_arr, &dvert_tot, false)) {
+		int i;
+		for (i = 0; i < dvert_tot; i++) {
+			MDeformVert *dv = dvert_arr[i];
+			int j;
+			for (j = 0; j < dv->totweight; j++) {
+				if (dv->dw[j].def_nr >= total) {
+					defvert_remove_group(dv, &dv->dw[j]);
+					j--;
+				}
+			}
+		}
+	}
+}
+
 static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot, const short use_vert_sel)
 {
 	*dvert_tot = 0;
@@ -2725,7 +2749,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
 	/* identifiers */
 	ot->name = "Remove from Vertex Group";
 	ot->idname = "OBJECT_OT_vertex_group_remove_from";
-	ot->description = "Remove the selected vertices from the active vertex group";
+	ot->description = "Remove the selected vertices from active or all vertex group(s)";
 
 	/* api callbacks */
 	ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
@@ -3127,7 +3151,7 @@ void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-	RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit", 0.001f, 0.99f);
+	RNA_def_float(ot->srna, "limit", 0.0f, 0.0f, 1.0, "Limit", "Remove weights under this limit", 0.0f, 0.99f);
 	RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups");
 	RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single",
 	                "Keep verts assigned to at least one group when cleaning");
diff --git a/source/blender/editors/physics/CMakeLists.txt b/source/blender/editors/physics/CMakeLists.txt
index da12a26..29d8aec 100644
--- a/source/blender/editors/physics/CMakeLists.txt
+++ b/source/blender/editors/physics/CMakeLists.txt
@@ -43,6 +43,9 @@ set(SRC
 	physics_fluid.c
 	physics_ops.c
 	physics_pointcache.c
+	rigidbody_constraint.c
+	rigidbody_object.c
+	rigidbody_world.c
 
 	physics_intern.h
 )
@@ -59,4 +62,11 @@ if(WITH_INTERNATIONAL)
 	add_definitions(-DWITH_INTERNATIONAL)
 endif()
 
+if(WITH_BULLET)
+	list(APPEND INC
+		../../../../intern/rigidbody
+	)
+	add_definitions(-DWITH_BULLET)
+endif()
+
 blender_add_lib(bf_editor_physics "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/physics/SConscript b/source/blender/editors/physics/SConscript
index 293f776..7916ea2 100644
--- a/source/blender/editors/physics/SConscript
+++ b/source/blender/editors/physics/SConscript
@@ -33,6 +33,7 @@ incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../gpu ../../blenloader ../../bmesh'
 incs += ' ../../makesrna ../../render/extern/include  #/intern/elbeem/extern'
+incs += ' #/intern/rigidbody'
 
 defs = []
 
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index c51b3ca..ecc7ea4 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -304,7 +304,9 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
 		if (blender_test_break()) return 0;
 
 		/* Update progress bar cursor */
-		WM_cursor_time(win, (int)progress);
+		if (!G.background) {
+			WM_cursor_time(win, (int)progress);
+		}
 
 		/* calculate a frame */
 		scene->r.cfra = (int)frame;
@@ -346,6 +348,7 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
  */
 static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
 {
+	wmWindow *win = CTX_wm_window(C);
 	DynamicPaintModifierData *pmd = NULL;
 	DynamicPaintCanvasSettings *canvas;
 	Object *ob = ED_object_context(C);
@@ -379,7 +382,9 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
 	status = dynamicPaint_bakeImageSequence(C, surface, ob);
 	/* Clear bake */
 	canvas->flags &= ~MOD_DPAINT_BAKING;
-	WM_cursor_restore(CTX_wm_window(C));
+	if (!G.background) {
+		WM_cursor_restore(win);
+	}
 	dynamicPaint_freeSurfaceData(surface);
 
 	/* Bake was successful:
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 9dbc0f9..31079de 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -1112,7 +1112,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
 			mul_v3_fl(vec, 0.25);
 		}
 		else
-			mul_v3_fl(vec, 0.3333f);
+			mul_v3_fl(vec, 1.0f / 3.0f);
 
 		normalize_v3(nor);
 
@@ -2004,7 +2004,7 @@ static int rekey_exec(bContext *C, wmOperator *op)
 	PE_set_data(C, &data);
 
 	data.dval= 1.0f / (float)(data.totrekey-1);
-	data.totrekey= RNA_int_get(op->ptr, "keys");
+	data.totrekey= RNA_int_get(op->ptr, "keys_number");
 
 	foreach_selected_point(&data, rekey_particle);
 	
@@ -2031,7 +2031,7 @@ void PARTICLE_OT_rekey(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* properties */
-	RNA_def_int(ot->srna, "keys", 2, 2, INT_MAX, "Number of Keys", "", 2, 100);
+	RNA_def_int(ot->srna, "keys_number", 2, 2, INT_MAX, "Number of Keys", "", 2, 100);
 }
 
 static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float path_time)
@@ -3254,7 +3254,7 @@ static int brush_add(PEData *data, short number)
 	ParticleEditSettings *pset= PE_settings(scene);
 	int i, k, n= 0, totpart= psys->totpart;
 	float mco[2];
-	short dmx= 0, dmy= 0;
+	float dmx, dmy;
 	float co1[3], co2[3], min_d, imat[4][4];
 	float framestep, timestep;
 	short size= pset->brush[PE_BRUSH_ADD].size;
@@ -3282,12 +3282,19 @@ static int brush_add(PEData *data, short number)
 
 	for (i=0; i<number; i++) {
 		if (number>1) {
-			dmx=dmy=size;
-			while (dmx*dmx+dmy*dmy>size2) {
-				dmx=(short)((2.0f*BLI_frand()-1.0f)*size);
-				dmy=(short)((2.0f*BLI_frand()-1.0f)*size);
+			dmx = size;
+			dmy = size;
+
+			/* rejection sampling to get points in circle */
+			while (dmx*dmx + dmy*dmy > size2) {
+				dmx= (2.0f*BLI_frand() - 1.0f)*size;
+				dmy= (2.0f*BLI_frand() - 1.0f)*size;
 			}
 		}
+		else {
+			dmx = 0.0f;
+			dmy = 0.0f;
+		}
 
 		mco[0] = data->mval[0] + dmx;
 		mco[1] = data->mval[1] + dmy;
@@ -3307,8 +3314,8 @@ static int brush_add(PEData *data, short number)
 		int newtotpart=totpart+n;
 		float hairmat[4][4], cur_co[3];
 		KDTree *tree=0;
-		ParticleData *pa, *new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new");
-		PTCacheEditPoint *point, *new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint), "PTCacheEditPoint array new");
+		ParticleData *pa, *new_pars = MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new");
+		PTCacheEditPoint *point, *new_points = MEM_callocN(newtotpart*sizeof(PTCacheEditPoint), "PTCacheEditPoint array new");
 		PTCacheEditKey *key;
 		HairKey *hkey;
 
@@ -3343,8 +3350,8 @@ static int brush_add(PEData *data, short number)
 		edit->totpoint= psys->totpart= newtotpart;
 
 		/* create new elements */
-		pa= psys->particles + totpart;
-		point= edit->points + totpart;
+		pa = psys->particles + totpart;
+		point = edit->points + totpart;
 
 		for (i=totpart; i<newtotpart; i++, pa++, point++) {
 			memcpy(pa, add_pars + i - totpart, sizeof(ParticleData));
@@ -3390,8 +3397,14 @@ static int brush_add(PEData *data, short number)
 					weight[w] = 0.0f;
 				}
 
-				for (w=0; w<maxw; w++)
-					weight[w] /= totw;
+				if (totw > 0.0f) {
+					for (w=0; w<maxw; w++)
+						weight[w] /= totw;
+				}
+				else {
+					for (w=0; w<maxw; w++)
+						weight[w] = 1.0f/maxw;
+				}
 
 				ppa= psys->particles+ptn[0].index;
 
@@ -3403,7 +3416,7 @@ static int brush_add(PEData *data, short number)
 					psys_get_particle_on_path(&sim, ptn[0].index, key3, 0);
 					mul_v3_fl(key3[0].co, weight[0]);
 					
-					/* TODO: interpolatint the weight would be nicer */
+					/* TODO: interpolating the weight would be nicer */
 					thkey->weight= (ppa->hair+MIN2(k, ppa->totkey-1))->weight;
 					
 					if (maxw>1) {
@@ -4138,7 +4151,7 @@ int PE_minmax(Scene *scene, float min[3], float max[3])
 		BKE_object_minmax(ob, min, max, TRUE);
 		ok= 1;
 	}
-  
+
 	return ok;
 }
 
@@ -4147,8 +4160,8 @@ int PE_minmax(Scene *scene, float min[3], float max[3])
 /* initialize needed data for bake edit */
 static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys)
 {
-	PTCacheEdit *edit= (psys)? psys->edit : cache->edit;
-	ParticleSystemModifierData *psmd= (psys)? psys_get_modifier(ob, psys): NULL;
+	PTCacheEdit *edit;
+	ParticleSystemModifierData *psmd = (psys) ? psys_get_modifier(ob, psys) : NULL;
 	POINT_P; KEY_K;
 	ParticleData *pa = NULL;
 	HairKey *hkey;
@@ -4164,6 +4177,8 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
 	if (psys == NULL && (cache && cache->mem_cache.first == NULL))
 		return;
 
+	edit = (psys) ? psys->edit : cache->edit;
+
 	if (!edit) {
 		totpoint = psys ? psys->totpart : (int)((PTCacheMem *)cache->mem_cache.first)->totpoint;
 
diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h
index 75779cf..77ce5a3 100644
--- a/source/blender/editors/physics/physics_intern.h
+++ b/source/blender/editors/physics/physics_intern.h
@@ -105,5 +105,23 @@ void PTCACHE_OT_bake_from_cache(struct wmOperatorType *ot);
 void PTCACHE_OT_add(struct wmOperatorType *ot);
 void PTCACHE_OT_remove(struct wmOperatorType *ot);
 
-#endif /* __PHYSICS_INTERN_H__ */
+/* rigidbody_object.c */
+void RIGIDBODY_OT_object_add(struct wmOperatorType *ot);
+void RIGIDBODY_OT_object_remove(struct wmOperatorType *ot);
+
+void RIGIDBODY_OT_objects_add(struct wmOperatorType *ot);
+void RIGIDBODY_OT_objects_remove(struct wmOperatorType *ot);
+
+void RIGIDBODY_OT_shape_change(struct wmOperatorType *ot);
+void RIGIDBODY_OT_mass_calculate(struct wmOperatorType *ot);
 
+/* rigidbody_constraint.c */
+void RIGIDBODY_OT_constraint_add(struct wmOperatorType *ot);
+void RIGIDBODY_OT_constraint_remove(struct wmOperatorType *ot);
+
+/*rigidbody_world.c */
+void RIGIDBODY_OT_world_add(struct wmOperatorType *ot);
+void RIGIDBODY_OT_world_remove(struct wmOperatorType *ot);
+void RIGIDBODY_OT_world_export(struct wmOperatorType *ot);
+
+#endif /* __PHYSICS_INTERN_H__ */
diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c
index fb99d29..51a6688 100644
--- a/source/blender/editors/physics/physics_ops.c
+++ b/source/blender/editors/physics/physics_ops.c
@@ -86,6 +86,22 @@ static void operatortypes_particle(void)
 	WM_operatortype_append(PARTICLE_OT_dupliob_remove);
 	WM_operatortype_append(PARTICLE_OT_dupliob_move_up);
 	WM_operatortype_append(PARTICLE_OT_dupliob_move_down);
+
+	WM_operatortype_append(RIGIDBODY_OT_object_add);
+	WM_operatortype_append(RIGIDBODY_OT_object_remove);
+
+	WM_operatortype_append(RIGIDBODY_OT_objects_add);
+	WM_operatortype_append(RIGIDBODY_OT_objects_remove);
+
+	WM_operatortype_append(RIGIDBODY_OT_shape_change);
+	WM_operatortype_append(RIGIDBODY_OT_mass_calculate);
+
+	WM_operatortype_append(RIGIDBODY_OT_constraint_add);
+	WM_operatortype_append(RIGIDBODY_OT_constraint_remove);
+
+	WM_operatortype_append(RIGIDBODY_OT_world_add);
+	WM_operatortype_append(RIGIDBODY_OT_world_remove);
+//	WM_operatortype_append(RIGIDBODY_OT_world_export);
 }
 
 static void keymap_particle(wmKeyConfig *keyconf)
diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c
new file mode 100644
index 0000000..a72a409
--- /dev/null
+++ b/source/blender/editors/physics/rigidbody_constraint.c
@@ -0,0 +1,201 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file rigidbody_constraint.c
+ *  \ingroup editor_physics
+ *  \brief Rigid Body constraint editing operators
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_group_types.h"
+#include "DNA_object_types.h"
+#include "DNA_rigidbody_types.h"
+#include "DNA_scene_types.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+
+#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_global.h"
+#include "BKE_group.h"
+#include "BKE_object.h"
+#include "BKE_report.h"
+#include "BKE_rigidbody.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_physics.h"
+#include "ED_screen.h"
+
+#include "physics_intern.h"
+
+/* ********************************************** */
+/* Helper API's for RigidBody Constraint Editing */
+
+static int ED_operator_rigidbody_con_active_poll(bContext *C)
+{
+	if (ED_operator_object_active_editable(C)) {
+		Object *ob = CTX_data_active_object(C);
+		return (ob && ob->rigidbody_constraint);
+	}
+	else
+		return 0;
+}
+
+
+void ED_rigidbody_con_add(wmOperator *op, Scene *scene, Object *ob, int type)
+{
+	RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
+
+	/* check that object doesn't already have a constraint */
+	if (ob->rigidbody_constraint) {
+		BKE_reportf(op->reports, RPT_INFO, "Object '%s' already has a Rigid Body Constraint", ob->id.name + 2);
+		return;
+	}
+	/* create constraint group if it doesn't already exits */
+	if (rbw->constraints == NULL) {
+		rbw->constraints = add_group(G.main, "RigidBodyConstraints");
+	}
+	/* make rigidbody constraint settings */
+	ob->rigidbody_constraint = BKE_rigidbody_create_constraint(scene, ob, type);
+	ob->rigidbody_constraint->flag |= RBC_FLAG_NEEDS_VALIDATE;
+
+	/* add constraint to rigid body constraint group */
+	add_to_group(rbw->constraints, ob, scene, NULL);
+}
+
+void ED_rigidbody_con_remove(Scene *scene, Object *ob)
+{
+	RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
+
+	BKE_rigidbody_remove_constraint(scene, ob);
+	if (rbw)
+		rem_from_group(rbw->constraints, ob, scene, NULL);
+
+	DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+}
+
+/* ********************************************** */
+/* Active Object Add/Remove Operators */
+
+/* ************ Add Rigid Body Constraint ************** */
+
+static int rigidbody_con_add_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
+	Object *ob = (scene) ? OBACT : NULL;
+	int type = RNA_enum_get(op->ptr, "type");
+
+	/* sanity checks */
+	if (ELEM(NULL, scene, rbw)) {
+		BKE_report(op->reports, RPT_ERROR, "No Rigid Body World to add Rigid Body Constraint to");
+		return OPERATOR_CANCELLED;
+	}
+	/* apply to active object */
+	ED_rigidbody_con_add(op, scene, ob, type);
+
+	/* send updates */
+	DAG_ids_flush_update(CTX_data_main(C), 0);
+
+	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_constraint_add(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_constraint_add";
+	ot->name = "Add Rigid Body Constraint";
+	ot->description = "Add Rigid Body Constraint to active object";
+
+	/* callbacks */
+	ot->exec = rigidbody_con_add_exec;
+	ot->poll = ED_operator_object_active_editable;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+	/* properties */
+	ot->prop = RNA_def_enum(ot->srna, "type", rigidbody_con_type_items, RBC_TYPE_FIXED, "Rigid Body Constraint Type", "");
+}
+
+/* ************ Remove Rigid Body Constraint ************** */
+
+static int rigidbody_con_remove_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	Object *ob = (scene) ? OBACT : NULL;
+
+	/* sanity checks */
+	if (scene == NULL)
+		return OPERATOR_CANCELLED;
+
+	/* apply to active object */
+	if (ELEM(NULL, ob, ob->rigidbody_constraint)) {
+		BKE_report(op->reports, RPT_ERROR, "Object has no Rigid Body Constraint to remove");
+		return OPERATOR_CANCELLED;
+	}
+	else {
+		ED_rigidbody_con_remove(scene, ob);
+	}
+
+	/* send updates */
+	DAG_ids_flush_update(CTX_data_main(C), 0);
+
+	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_constraint_remove(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_constraint_remove";
+	ot->name = "Remove Rigid Body Constraint";
+	ot->description = "Remove Rigid Body Constraint from Object";
+
+	/* callbacks */
+	ot->exec = rigidbody_con_remove_exec;
+	ot->poll = ED_operator_rigidbody_con_active_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c
new file mode 100644
index 0000000..2bf962f
--- /dev/null
+++ b/source/blender/editors/physics/rigidbody_object.c
@@ -0,0 +1,629 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file rigidbody_object.c
+ *  \ingroup editor_physics
+ *  \brief Rigid Body object editing operators
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_group_types.h"
+#include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_rigidbody_types.h"
+#include "DNA_scene_types.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+
+#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_global.h"
+#include "BKE_group.h"
+#include "BKE_object.h"
+#include "BKE_report.h"
+#include "BKE_rigidbody.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_physics.h"
+#include "ED_screen.h"
+
+#include "physics_intern.h"
+
+/* ********************************************** */
+/* Helper API's for RigidBody Objects Editing */
+
+static int ED_operator_rigidbody_active_poll(bContext *C)
+{
+	if (ED_operator_object_active_editable(C)) {
+		Object *ob = CTX_data_active_object(C);
+		return (ob && ob->rigidbody_object);
+	}
+	else
+		return 0;
+}
+
+static int ED_operator_rigidbody_add_poll(bContext *C)
+{
+	if (ED_operator_object_active_editable(C)) {
+		Object *ob = CTX_data_active_object(C);
+		return (ob && ob->type == OB_MESH);
+	}
+	else
+		return 0;
+}
+
+/* ----------------- */
+
+void ED_rigidbody_ob_add(wmOperator *op, Scene *scene, Object *ob, int type)
+{
+	RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
+
+	if (ob->type != OB_MESH) {
+		BKE_report(op->reports, RPT_ERROR, "Can't add Rigid Body to non mesh object");
+		return;
+	}
+	if (((Mesh *)ob->data)->totpoly == 0) {
+		BKE_report(op->reports, RPT_ERROR, "Can't create Rigid Body from mesh with no polygons");
+		return;
+	}
+
+	/* Add rigid body world and group if they don't exist for convenience */
+	if (rbw == NULL) {
+		rbw = BKE_rigidbody_create_world(scene);
+		BKE_rigidbody_validate_sim_world(scene, rbw, false);
+		scene->rigidbody_world = rbw;
+	}
+	if (rbw->group == NULL) {
+		rbw->group = add_group(G.main, "RigidBodyWorld");
+	}
+
+	/* make rigidbody object settings */
+	if (ob->rigidbody_object == NULL) {
+		ob->rigidbody_object = BKE_rigidbody_create_object(scene, ob, type);
+	}
+	ob->rigidbody_object->type = type;
+	ob->rigidbody_object->flag |= RBO_FLAG_NEEDS_VALIDATE;
+
+	/* add object to rigid body group */
+	add_to_group(rbw->group, ob, scene, NULL);
+
+	DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+}
+
+void ED_rigidbody_ob_remove(Scene *scene, Object *ob)
+{
+	RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
+
+	BKE_rigidbody_remove_object(scene, ob);
+	if (rbw)
+		rem_from_group(rbw->group, ob, scene, NULL);
+
+	DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+}
+
+/* ********************************************** */
+/* Active Object Add/Remove Operators */
+
+/* ************ Add Rigid Body ************** */
+
+static int rigidbody_ob_add_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	Object *ob = (scene) ? OBACT : NULL;
+	int type = RNA_enum_get(op->ptr, "type");
+
+	/* apply to active object */
+	ED_rigidbody_ob_add(op, scene, ob, type);
+
+	/* send updates */
+	DAG_ids_flush_update(CTX_data_main(C), 0);
+
+	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_object_add(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_object_add";
+	ot->name = "Add Rigid Body";
+	ot->description = "Add active object as Rigid Body";
+
+	/* callbacks */
+	ot->exec = rigidbody_ob_add_exec;
+	ot->poll = ED_operator_rigidbody_add_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+	/* properties */
+	ot->prop = RNA_def_enum(ot->srna, "type", rigidbody_ob_type_items, RBO_TYPE_ACTIVE, "Rigid Body Type", "");
+}
+
+/* ************ Remove Rigid Body ************** */
+
+static int rigidbody_ob_remove_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	Object *ob = (scene) ? OBACT : NULL;
+
+	/* sanity checks */
+	if (scene == NULL)
+		return OPERATOR_CANCELLED;
+
+	/* apply to active object */
+	if (ELEM(NULL, ob, ob->rigidbody_object)) {
+		BKE_report(op->reports, RPT_ERROR, "Object has no Rigid Body settings to remove");
+		return OPERATOR_CANCELLED;
+	}
+	else
+		ED_rigidbody_ob_remove(scene, ob);
+
+	/* send updates */
+	DAG_ids_flush_update(CTX_data_main(C), 0);
+
+	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_object_remove(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_object_remove";
+	ot->name = "Remove Rigid Body";
+	ot->description = "Remove Rigid Body settings from Object";
+
+	/* callbacks */
+	ot->exec = rigidbody_ob_remove_exec;
+	ot->poll = ED_operator_rigidbody_active_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+/* ********************************************** */
+/* Selected Object Add/Remove Operators */
+
+/* ************ Add Rigid Bodies ************** */
+
+static int rigidbody_obs_add_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	int type = RNA_enum_get(op->ptr, "type");
+
+	/* sanity check */
+	if (scene == NULL) {
+		BKE_report(op->reports, RPT_ERROR, "No Scene to add Rigid Bodies to");
+		return OPERATOR_CANCELLED;
+	}
+	/* create rigid body objects and add them to the world's group */
+	CTX_DATA_BEGIN(C, Object *, ob, selected_objects) {
+		ED_rigidbody_ob_add(op, scene, ob, type);
+	}
+	CTX_DATA_END;
+
+	/* send updates */
+	DAG_ids_flush_update(CTX_data_main(C), 0);
+
+	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+	WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_objects_add(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_objects_add";
+	ot->name = "Add Rigid Bodies";
+	ot->description = "Add selected objects as Rigid Bodies";
+
+	/* callbacks */
+	ot->exec = rigidbody_obs_add_exec;
+	ot->poll = ED_operator_rigidbody_add_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+	/* properties */
+	ot->prop = RNA_def_enum(ot->srna, "type", rigidbody_ob_type_items, RBO_TYPE_ACTIVE, "Rigid Body Type", "");
+}
+
+/* ************ Remove Rigid Bodies ************** */
+
+static int rigidbody_obs_remove_exec(bContext *C, wmOperator *UNUSED(op))
+{
+	Scene *scene = CTX_data_scene(C);
+
+	/* sanity checks */
+	if (scene == NULL)
+		return OPERATOR_CANCELLED;
+
+	/* apply this to all selected objects... */
+	CTX_DATA_BEGIN(C, Object *, ob, selected_objects)
+	{
+		if (ob->rigidbody_object) {
+			ED_rigidbody_ob_remove(scene, ob);
+		}
+	}
+	CTX_DATA_END;
+
+	/* send updates */
+	DAG_ids_flush_update(CTX_data_main(C), 0);
+
+	WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_objects_remove(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_objects_remove";
+	ot->name = "Remove Rigid Bodies";
+	ot->description = "Remove selected objects from Rigid Body simulation";
+
+	/* callbacks */
+	ot->exec = rigidbody_obs_remove_exec;
+	ot->poll = ED_operator_rigidbody_active_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+/* ********************************************** */
+/* Utility Operators */
+
+/* ************ Change Collision Shapes ************** */
+
+static int rigidbody_obs_shape_change_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	int shape = RNA_enum_get(op->ptr, "type");
+
+	/* sanity checks */
+	if (scene == NULL)
+		return OPERATOR_CANCELLED;
+
+	/* apply this to all selected objects... */
+	CTX_DATA_BEGIN(C, Object *, ob, selected_objects)
+	{
+		if (ob->rigidbody_object) {
+			PointerRNA ptr;
+
+			/* use RNA-system to change the property and perform all necessary changes */
+			RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr);
+			RNA_enum_set(&ptr, "collision_shape", shape);
+
+			DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+		}
+	}
+	CTX_DATA_END;
+
+	/* send updates */
+	WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_shape_change(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_shape_change";
+	ot->name = "Change Collision Shape";
+	ot->description = "Change collision shapes for selected Rigid Body Objects";
+
+	/* callbacks */
+	ot->invoke = WM_menu_invoke;
+	ot->exec = rigidbody_obs_shape_change_exec;
+	ot->poll = ED_operator_rigidbody_active_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+	/* properties */
+	ot->prop = RNA_def_enum(ot->srna, "type", rigidbody_ob_shape_items, RB_SHAPE_TRIMESH, "Rigid Body Shape", "");
+}
+
+/* ************ Calculate Mass ************** */
+
+/* Entry in material density table */
+typedef struct rbMaterialDensityItem {
+	const char *name;   /* Name of material */
+	float density;      /* Density (kg/m^3) */
+} rbMaterialDensityItem;
+
+/* Preset density values for materials (kg/m^3)
+ * Selected values obtained from:
+ * 1) http://www.jaredzone.info/2010/09/densities.html
+ * 2) http://www.avlandesign.com/density_construction.htm
+ * 3) http://www.avlandesign.com/density_metal.htm
+ */
+static rbMaterialDensityItem RB_MATERIAL_DENSITY_TABLE[] = {
+	{"Air", 1.0f}, /* not quite; adapted from 1.43 for oxygen for use as default */
+	{"Acrylic", 1400.0f},
+	{"Asphalt (Crushed)", 721.0f},
+	{"Bark", 240.0f},
+	{"Beans (Cocoa)", 593.0f},
+	{"Beans (Soy)", 721.0f},
+	{"Brick (Pressed)", 2400.0f},
+	{"Brick (Common)", 2000.0f},
+	{"Brick (Soft)", 1600.0f},
+	{"Brass", 8216.0f},
+	{"Bronze", 8860.0f},
+	{"Carbon (Solid)", 2146.0f},
+	{"Cardboard", 689.0f},
+	{"Cast Iron", 7150.0f},
+	//{"Cement", 1442.0f},
+	{"Chalk (Solid)", 2499.0f},
+	//{"Coffee (Fresh/Roast)", ~500},
+	{"Concrete", 2320.0f},
+	{"Charcoal", 208.0f},
+	{"Cork", 240.0f},
+	{"Copper", 8933.0f},
+	{"Garbage", 481.0f},
+	{"Glass (Broken)", 1940.0f},
+	{"Glass (Solid)", 2190.0f},
+	{"Gold", 19282.0f},
+	{"Granite (Broken)", 1650.0f},
+	{"Granite (Solid)", 2691.0f},
+	{"Gravel", 2780.0f},
+	{"Ice (Crushed)", 593.0f},
+	{"Ice (Solid)", 919.0f},
+	{"Iron", 7874.0f},
+	{"Lead", 11342.0f},
+	{"Limestone (Broken)", 1554.0f},
+	{"Limestone (Solid)", 2611.0f},
+	{"Marble (Broken)", 1570.0f},
+	{"Marble (Solid)", 2563.0f},
+	{"Paper", 1201.0f},
+	{"Peanuts (Shelled)", 641.0f},
+	{"Peanuts (Not Shelled)", 272.0f},
+	{"Plaster", 849.0f},
+	{"Plastic", 1200.0f},
+	{"Polystyrene", 1050.0f},
+	{"Rubber", 1522.0f},
+	{"Silver", 10501.0f},
+	{"Steel", 7860.0f},
+	{"Stone", 2515.0f},
+	{"Stone (Crushed)", 1602.0f},
+	{"Timber", 610.0f}
+};
+static const int NUM_RB_MATERIAL_PRESETS = sizeof(RB_MATERIAL_DENSITY_TABLE) / sizeof(rbMaterialDensityItem);
+
+
+/* dynamically generate list of items
+ * - Although there is a runtime cost, this has a lower maintenance cost
+ *	 in the long run than other two-list solutions...
+ */
+static EnumPropertyItem *rigidbody_materials_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
+{
+	EnumPropertyItem item_tmp = {0};
+	EnumPropertyItem *item = NULL;
+	int totitem = 0;
+	int i = 0;
+
+	/* add each preset to the list */
+	for (i = 0; i < NUM_RB_MATERIAL_PRESETS; i++) {
+		rbMaterialDensityItem *preset = &RB_MATERIAL_DENSITY_TABLE[i];
+
+		item_tmp.identifier = item_tmp.name = preset->name;
+		item_tmp.value = i;
+		RNA_enum_item_add(&item, &totitem, &item_tmp);
+	}
+
+	/* add special "custom" entry to the end of the list */
+	{
+		item_tmp.identifier = item_tmp.name = "Custom";
+		item_tmp.value = -1;
+		RNA_enum_item_add(&item, &totitem, &item_tmp);
+	}
+
+	RNA_enum_item_end(&item, &totitem);
+	*free = 1;
+
+	return item;
+}
+
+/* ------------------------------------------ */
+
+/* helper function to calculate volume of rigidbody object */
+// TODO: allow a parameter to specify method used to calculate this?
+static float calc_rigidbody_ob_volume(Object *ob)
+{
+	RigidBodyOb *rbo = ob->rigidbody_object;
+
+	float size[3]  = {1.0f, 1.0f, 1.0f};
+	float radius = 1.0f;
+	float height = 1.0f;
+
+	float volume = 0.0f;
+
+	/* if automatically determining dimensions, use the Object's boundbox
+	 *	- assume that all quadrics are standing upright on local z-axis
+	 *	- assume even distribution of mass around the Object's pivot
+	 *	  (i.e. Object pivot is centralised in boundbox)
+	 *	- boundbox gives full width
+	 */
+	// XXX: all dimensions are auto-determined now... later can add stored settings for this
+	BKE_object_dimensions_get(ob, size);
+
+	if (ELEM3(rbo->shape, RB_SHAPE_CAPSULE, RB_SHAPE_CYLINDER, RB_SHAPE_CONE)) {
+		/* take radius as largest x/y dimension, and height as z-dimension */
+		radius = MAX2(size[0], size[1]) * 0.5f;
+		height = size[2];
+	}
+	else if (rbo->shape == RB_SHAPE_SPHERE) {
+		/* take radius to the the largest dimension to try and encompass everything */
+		radius = max_fff(size[0], size[1], size[2]) * 0.5f;
+	}
+
+	/* calculate volume as appropriate  */
+	switch (rbo->shape) {
+		case RB_SHAPE_BOX:
+			volume = size[0] * size[1] * size[2];
+			break;
+
+		case RB_SHAPE_SPHERE:
+			volume = 4.0f / 3.0f * (float)M_PI * radius * radius * radius;
+			break;
+
+		/* for now, assume that capsule is close enough to a cylinder... */
+		case RB_SHAPE_CAPSULE:
+		case RB_SHAPE_CYLINDER:
+			volume = (float)M_PI * radius * radius * height;
+			break;
+
+		case RB_SHAPE_CONE:
+			volume = (float)M_PI / 3.0f * radius * radius * height;
+			break;
+
+		/* for now, all mesh shapes are just treated as boxes...
+		 * NOTE: this may overestimate the volume, but other methods are overkill
+		 */
+		case RB_SHAPE_CONVEXH:
+		case RB_SHAPE_TRIMESH:
+			volume = size[0] * size[1] * size[2];
+			break;
+
+#if 0 // XXX: not defined yet
+		case RB_SHAPE_COMPOUND:
+			volume = 0.0f;
+			break;
+#endif
+	}
+
+	/* return the volume calculated */
+	return volume;
+}
+
+/* ------------------------------------------ */
+
+static int rigidbody_obs_calc_mass_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	int material = RNA_enum_get(op->ptr, "material");
+	float density;
+
+	/* sanity checks */
+	if (scene == NULL)
+		return OPERATOR_CANCELLED;
+
+	/* get density (kg/m^3) to apply */
+	if (material >= 0) {
+		/* get density from table, and store in props for later repeating */
+		if (material >= NUM_RB_MATERIAL_PRESETS)
+			material = 0;
+
+		density = RB_MATERIAL_DENSITY_TABLE[material].density;
+		RNA_float_set(op->ptr, "density", density);
+	}
+	else {
+		/* custom - grab from whatever value is set */
+		density = RNA_float_get(op->ptr, "density");
+	}
+
+	/* apply this to all selected objects (with rigidbodies)... */
+	CTX_DATA_BEGIN(C, Object *, ob, selected_objects)
+	{
+		if (ob->rigidbody_object) {
+			PointerRNA ptr;
+
+			float volume; /* m^3 */
+			float mass;   /* kg */
+
+			/* mass is calculated from the approximate volume of the object,
+			 * and the density of the material we're simulating
+			 */
+			volume = calc_rigidbody_ob_volume(ob);
+			mass = volume * density;
+
+			/* use RNA-system to change the property and perform all necessary changes */
+			RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr);
+			RNA_float_set(&ptr, "mass", mass);
+
+			DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+		}
+	}
+	CTX_DATA_END;
+
+	/* send updates */
+	WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_mass_calculate(wmOperatorType *ot)
+{
+	PropertyRNA *prop;
+
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_mass_calculate";
+	ot->name = "Calculate Mass";
+	ot->description = "Automatically calculate mass values for Rigid Body Objects based on volume";
+
+	/* callbacks */
+	ot->invoke = WM_menu_invoke; // XXX
+	ot->exec = rigidbody_obs_calc_mass_exec;
+	ot->poll = ED_operator_rigidbody_active_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+	/* properties */
+	ot->prop = prop = RNA_def_enum(ot->srna, "material",
+	                               DummyRNA_DEFAULT_items, 0,
+	                               "Material Preset",
+	                               "Type of material that objects are made of (determines material density)");
+	RNA_def_enum_funcs(prop, rigidbody_materials_itemf);
+
+	RNA_def_float(ot->srna, "density", 1.0, FLT_MIN, FLT_MAX,
+	              "Density",
+	              "Custom density value (kg/m^3) to use instead of material preset",
+	              1.0f, 2500.0f);
+}
+
+/* ********************************************** */
diff --git a/source/blender/editors/physics/rigidbody_world.c b/source/blender/editors/physics/rigidbody_world.c
new file mode 100644
index 0000000..babe32c
--- /dev/null
+++ b/source/blender/editors/physics/rigidbody_world.c
@@ -0,0 +1,210 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+ 
+/** \file rigidbody_world.c
+ *  \ingroup editor_physics
+ *  \brief Rigid Body world editing operators
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "DNA_object_types.h"
+#include "DNA_rigidbody_types.h"
+#include "DNA_scene_types.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+
+#ifdef WITH_BULLET
+#  include "RBI_api.h"
+#endif
+
+#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_group.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_report.h"
+#include "BKE_rigidbody.h"
+#include "BKE_utildefines.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_physics.h"
+#include "ED_screen.h"
+
+#include "physics_intern.h"
+
+/* ********************************************** */
+/* API */
+
+/* check if there is an active rigid body world */
+static int ED_rigidbody_world_active_poll(bContext *C)
+{
+	Scene *scene = CTX_data_scene(C);
+	return (scene && scene->rigidbody_world);
+}
+static int ED_rigidbody_world_add_poll(bContext *C)
+{
+	Scene *scene = CTX_data_scene(C);
+	return (scene && scene->rigidbody_world == NULL);
+}
+
+/* ********************************************** */
+/* OPERATORS - Management */
+
+/* ********** Add RigidBody World **************** */
+
+static int rigidbody_world_add_exec(bContext *C, wmOperator *UNUSED(op))
+{
+	Scene *scene = CTX_data_scene(C);
+	RigidBodyWorld *rbw;
+
+	rbw = BKE_rigidbody_create_world(scene);
+//	BKE_rigidbody_validate_sim_world(scene, rbw, false);
+	scene->rigidbody_world = rbw;
+
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_world_add(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_world_add";
+	ot->name = "Add Rigid Body World";
+	ot->description = "Add Rigid Body simulation world to the current scene";
+
+	/* callbacks */
+	ot->exec = rigidbody_world_add_exec;
+	ot->poll = ED_rigidbody_world_add_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/* ********** Remove RigidBody World ************* */
+
+static int rigidbody_world_remove_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+
+	/* sanity checks */
+	if (ELEM(NULL, scene, rbw)) {
+		BKE_report(op->reports, RPT_ERROR, "No Rigid Body World to remove");
+		return OPERATOR_CANCELLED;
+	}
+
+	BKE_rigidbody_free_world(rbw);
+	scene->rigidbody_world = NULL;
+
+	/* done */
+	return OPERATOR_FINISHED;
+}
+
+void RIGIDBODY_OT_world_remove(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_world_remove";
+	ot->name = "Remove Rigid Body World";
+	ot->description = "Remove Rigid Body simulation world from the current scene";
+
+	/* callbacks */
+	ot->exec = rigidbody_world_remove_exec;
+	ot->poll = ED_rigidbody_world_active_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/* ********************************************** */
+/* UTILITY OPERATORS */
+
+/* ********** Export RigidBody World ************* */
+
+static int rigidbody_world_export_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene = CTX_data_scene(C);
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+	char path[FILE_MAX];
+
+	/* sanity checks */
+	if ELEM(NULL, scene, rbw) {
+		BKE_report(op->reports, RPT_ERROR, "No Rigid Body World to export");
+		return OPERATOR_CANCELLED;
+	}
+	if (rbw->physics_world == NULL) {
+		BKE_report(op->reports, RPT_ERROR, "Rigid Body World has no associated physics data to export");
+		return OPERATOR_CANCELLED;
+	}
+
+	RNA_string_get(op->ptr, "filepath", path);
+#ifdef WITH_BULLET
+	RB_dworld_export(rbw->physics_world, path);
+#endif
+	return OPERATOR_FINISHED;
+}
+
+static int rigidbody_world_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
+{
+	if (!RNA_struct_property_is_set(op->ptr, "relative_path"))
+		RNA_boolean_set(op->ptr, "relative_path", (U.flag & USER_RELPATHS));
+
+	if (RNA_struct_property_is_set(op->ptr, "filepath"))
+		return rigidbody_world_export_exec(C, op);
+
+	// TODO: use the actual rigidbody world's name + .bullet instead of this temp crap
+	RNA_string_set(op->ptr, "filepath", "rigidbodyworld_export.bullet");
+	WM_event_add_fileselect(C, op); 
+
+	return OPERATOR_RUNNING_MODAL;
+}
+
+void RIGIDBODY_OT_world_export(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->idname = "RIGIDBODY_OT_world_export";
+	ot->name = "Export Rigid Body World";
+	ot->description = "Export Rigid Body world to simulator's own fileformat (i.e. '.bullet' for Bullet Physics)";
+
+	/* callbacks */
+	ot->invoke = rigidbody_world_export_invoke;
+	ot->exec = rigidbody_world_export_exec;
+	ot->poll = ED_rigidbody_world_active_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+
+	/* properties */
+	WM_operator_properties_filesel(ot, FOLDERFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH, FILE_DEFAULTDISPLAY);
+}
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index f8154f4..deb6eaf 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -73,6 +73,7 @@
 #include "render_intern.h"
 
 /* Render Callbacks */
+static int render_break(void *rjv);
 
 /* called inside thread! */
 void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volatile rcti *renrect)
@@ -210,7 +211,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
 	lay = (v3d) ? v3d->lay : scene->lay;
 
 	G.is_break = FALSE;
-	RE_test_break_cb(re, NULL, (int (*)(void *))blender_test_break);
+	RE_test_break_cb(re, NULL, render_break);
 
 	ima = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
 	BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
@@ -443,6 +444,15 @@ static int render_breakjob(void *rjv)
 	return 0;
 }
 
+/* for exec() when there is no render job
+ * note: this wont check for the escape key being pressed, but doing so isnt threadsafe */
+static int render_break(void *UNUSED(rjv))
+{
+	if (G.is_break)
+		return 1;
+	return 0;
+}
+
 /* runs in thread, no cursor setting here works. careful with notifiers too (malloc conflicts) */
 /* maybe need a way to get job send notifer? */
 static void render_drawlock(void *UNUSED(rjv), int lock)
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 7ba6a92..ea18f2c 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -264,7 +264,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
 		/* sequencer has got tricker ocnversion happened above */
 
 		IMB_buffer_float_from_float(rr->rectf, rr->rectf,
-		                            4, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, FALSE,
+		                            4, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, TRUE,
 		                            oglrender->sizex, oglrender->sizey, oglrender->sizex, oglrender->sizex);
 	}
 
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 25ad1f6..dfc80e4 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -97,6 +97,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+#include "ED_datafiles.h"
 #include "ED_render.h"
 #include "ED_view3d.h"
 
@@ -168,7 +169,8 @@ typedef struct ShaderPreview {
 	int sizex, sizey;
 	unsigned int *pr_rect;
 	int pr_method;
-	
+
+	Main *pr_main;
 } ShaderPreview;
 
 typedef struct IconPreviewSize {
@@ -187,23 +189,33 @@ typedef struct IconPreview {
 /* *************************** Preview for buttons *********************** */
 
 static Main *pr_main = NULL;
+static Main *pr_main_cycles = NULL;
 
-void ED_preview_init_dbase(void)
-{
 #ifndef WITH_HEADLESS
-	BlendFileData *bfd;
-	extern int datatoc_preview_blend_size;
-	extern char datatoc_preview_blend[];
+static Main *load_main_from_memory(char *blend, int blend_size)
+{
 	const int fileflags = G.fileflags;
-	
+	Main *bmain = NULL;
+	BlendFileData *bfd;
+
 	G.fileflags |= G_FILE_NO_UI;
-	bfd = BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL);
+	bfd = BLO_read_from_memory(blend, blend_size, NULL);
 	if (bfd) {
-		pr_main = bfd->main;
-		
+		bmain = bfd->main;
+
 		MEM_freeN(bfd);
 	}
 	G.fileflags = fileflags;
+
+	return bmain;
+}
+#endif
+
+void ED_preview_init_dbase(void)
+{
+#ifndef WITH_HEADLESS
+	pr_main = load_main_from_memory(datatoc_preview_blend, datatoc_preview_blend_size);
+	pr_main_cycles = load_main_from_memory(datatoc_preview_cycles_blend, datatoc_preview_cycles_blend_size);
 #endif
 }
 
@@ -211,6 +223,9 @@ void ED_preview_free_dbase(void)
 {
 	if (pr_main)
 		free_main(pr_main);
+
+	if (pr_main_cycles)
+		free_main(pr_main_cycles);
 }
 
 static int preview_mat_has_sss(Material *mat, bNodeTree *ntree)
@@ -239,7 +254,7 @@ static int preview_mat_has_sss(Material *mat, bNodeTree *ntree)
 	return 0;
 }
 
-static Scene *preview_get_scene(void)
+static Scene *preview_get_scene(Main *pr_main)
 {
 	if (pr_main == NULL) return NULL;
 	
@@ -253,8 +268,9 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
 {
 	Scene *sce;
 	Base *base;
+	Main *pr_main = sp->pr_main;
 	
-	sce = preview_get_scene();
+	sce = preview_get_scene(pr_main);
 	if (sce) {
 		
 		/* this flag tells render to not execute depsgraph or ipos etc */
@@ -299,50 +315,56 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
 				sp->matcopy = mat;
 				BLI_addtail(&pr_main->mat, mat);
 				
-				init_render_material(mat, 0, NULL);     /* call that retrieves mode_l */
-				end_render_material(mat);
-				
-				/* un-useful option */
-				if (sp->pr_method == PR_ICON_RENDER)
-					mat->shade_flag &= ~MA_OBCOLOR;
-
-				/* turn on raytracing if needed */
-				if (mat->mode_l & MA_RAYMIRROR)
-					sce->r.mode |= R_RAYTRACE;
-				if (mat->material_type == MA_TYPE_VOLUME)
-					sce->r.mode |= R_RAYTRACE;
-				if ((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
-					sce->r.mode |= R_RAYTRACE;
-				if (preview_mat_has_sss(mat, NULL))
-					sce->r.mode |= R_SSS;
-				
-				/* turn off fake shadows if needed */
-				/* this only works in a specific case where the preview.blend contains
-				 * an object starting with 'c' which has a material linked to it (not the obdata)
-				 * and that material has a fake shadow texture in the active texture slot */
-				for (base = sce->base.first; base; base = base->next) {
-					if (base->object->id.name[2] == 'c') {
-						Material *shadmat = give_current_material(base->object, base->object->actcol);
-						if (shadmat) {
-							if (mat->mode & MA_SHADBUF) shadmat->septex = 0;
-							else shadmat->septex |= 1;
+				if (!BKE_scene_use_new_shading_nodes(scene)) {
+					init_render_material(mat, 0, NULL);     /* call that retrieves mode_l */
+					end_render_material(mat);
+					
+					/* un-useful option */
+					if (sp->pr_method == PR_ICON_RENDER)
+						mat->shade_flag &= ~MA_OBCOLOR;
+
+					/* turn on raytracing if needed */
+					if (mat->mode_l & MA_RAYMIRROR)
+						sce->r.mode |= R_RAYTRACE;
+					if (mat->material_type == MA_TYPE_VOLUME)
+						sce->r.mode |= R_RAYTRACE;
+					if ((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
+						sce->r.mode |= R_RAYTRACE;
+					if (preview_mat_has_sss(mat, NULL))
+						sce->r.mode |= R_SSS;
+					
+					/* turn off fake shadows if needed */
+					/* this only works in a specific case where the preview.blend contains
+					 * an object starting with 'c' which has a material linked to it (not the obdata)
+					 * and that material has a fake shadow texture in the active texture slot */
+					for (base = sce->base.first; base; base = base->next) {
+						if (base->object->id.name[2] == 'c') {
+							Material *shadmat = give_current_material(base->object, base->object->actcol);
+							if (shadmat) {
+								if (mat->mode & MA_SHADBUF) shadmat->septex = 0;
+								else shadmat->septex |= 1;
+							}
 						}
 					}
-				}
-				
-				/* turn off bounce lights for volume, 
-				 * doesn't make much visual difference and slows it down too */
-				if (mat->material_type == MA_TYPE_VOLUME) {
-					for (base = sce->base.first; base; base = base->next) {
-						if (base->object->type == OB_LAMP) {
-							/* if doesn't match 'Lamp.002' --> main key light */
-							if (strcmp(base->object->id.name + 2, "Lamp.002") != 0) {
-								base->object->restrictflag |= OB_RESTRICT_RENDER;
+					
+					/* turn off bounce lights for volume, 
+					 * doesn't make much visual difference and slows it down too */
+					if (mat->material_type == MA_TYPE_VOLUME) {
+						for (base = sce->base.first; base; base = base->next) {
+							if (base->object->type == OB_LAMP) {
+								/* if doesn't match 'Lamp.002' --> main key light */
+								if (strcmp(base->object->id.name + 2, "Lamp.002") != 0) {
+									base->object->restrictflag |= OB_RESTRICT_RENDER;
+								}
 							}
 						}
 					}
 				}
-
+				else {
+					/* use current scene world to light sphere */
+					if (mat->pr_type == MA_SPHERE_A)
+						sce->world = scene->world;
+				}
 				
 				if (sp->pr_method == PR_ICON_RENDER) {
 					if (mat->material_type == MA_TYPE_HALO) {
@@ -432,19 +454,21 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
 				sp->lampcopy = la;
 				BLI_addtail(&pr_main->lamp, la);
 			}
-			
-			if (la && la->type == LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) {
-				sce->lay = 1 << MA_ATMOS;
-				sce->world = scene->world;
-				sce->camera = (Object *)BLI_findstring(&pr_main->object, "CameraAtmo", offsetof(ID, name) + 2);
-			}
-			else {
-				sce->lay = 1 << MA_LAMP;
-				sce->world = NULL;
-				sce->camera = (Object *)BLI_findstring(&pr_main->object, "Camera", offsetof(ID, name) + 2);
+
+			sce->lay = 1 << MA_LAMP;
+
+			if (!BKE_scene_use_new_shading_nodes(scene)) {
+				if (la && la->type == LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) {
+					sce->lay = 1 << MA_ATMOS;
+					sce->world = scene->world;
+					sce->camera = (Object *)BLI_findstring(&pr_main->object, "CameraAtmo", offsetof(ID, name) + 2);
+				}
+				else {
+					sce->world = NULL;
+					sce->camera = (Object *)BLI_findstring(&pr_main->object, "Camera", offsetof(ID, name) + 2);
+				}
 			}
-			sce->r.mode &= ~R_SHADOW;
-			
+				
 			for (base = sce->base.first; base; base = base->next) {
 				if (base->object->id.name[2] == 'p') {
 					if (base->object->type == OB_LAMP)
@@ -639,6 +663,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
 	short idtype = GS(id->name);
 	char name[32];
 	int sizex;
+	Main *pr_main = sp->pr_main;
 	
 	/* in case of split preview, use border render */
 	if (split) {
@@ -648,7 +673,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
 	else sizex = sp->sizex;
 	
 	/* we have to set preview variables first */
-	sce = preview_get_scene();
+	sce = preview_get_scene(pr_main);
 	if (sce) {
 		sce->r.xsch = sizex;
 		sce->r.ysch = sp->sizey;
@@ -749,6 +774,7 @@ static void shader_preview_startjob(void *customdata, short *stop, short *do_upd
 static void shader_preview_free(void *customdata)
 {
 	ShaderPreview *sp = customdata;
+	Main *pr_main = sp->pr_main;
 	
 	if (sp->matcopy) {
 		struct IDProperty *properties;
@@ -904,8 +930,10 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
 		 * already there. Very expensive for large images. Need to find a way to 
 		 * only get existing ibuf */
 		ibuf = BKE_image_acquire_ibuf(ima, &iuser, NULL);
-		if (ibuf == NULL || ibuf->rect == NULL)
+		if (ibuf == NULL || ibuf->rect == NULL) {
+			BKE_image_release_ibuf(ima, ibuf, NULL);
 			return;
+		}
 		
 		icon_copy_rect(ibuf, sp->sizex, sp->sizey, sp->pr_rect);
 
@@ -997,6 +1025,7 @@ static void icon_preview_startjob_all_sizes(void *customdata, short *stop, short
 		sp->pr_method = PR_ICON_RENDER;
 		sp->pr_rect = cur_size->rect;
 		sp->id = ip->id;
+		sp->pr_main = pr_main;
 
 		common_preview_startjob(sp, stop, do_update, progress);
 		shader_preview_free(sp);
@@ -1076,13 +1105,18 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
 	Object *ob = CTX_data_active_object(C);
 	wmJob *wm_job;
 	ShaderPreview *sp;
+	Scene *scene = CTX_data_scene(C);
+
+	/* node previews not supported for cycles */
+	if (BKE_scene_use_new_shading_nodes(scene) && method == PR_NODE_RENDER)
+		return;
 
 	wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview",
 	                    WM_JOB_EXCL_RENDER, WM_JOB_TYPE_RENDER_PREVIEW);
 	sp = MEM_callocN(sizeof(ShaderPreview), "shader preview");
 
 	/* customdata for preview thread */
-	sp->scene = CTX_data_scene(C);
+	sp->scene = scene;
 	sp->owner = owner;
 	sp->sizex = sizex;
 	sp->sizey = sizey;
@@ -1090,6 +1124,14 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
 	sp->id = id;
 	sp->parent = parent;
 	sp->slot = slot;
+
+	/* hardcoded preview .blend for cycles/internal, this should be solved
+	 * once with custom preview .blend path for external engines */
+	if (BKE_scene_use_new_shading_nodes(scene))
+		sp->pr_main = pr_main_cycles;
+	else
+		sp->pr_main = pr_main;
+
 	if (ob && ob->totcol) copy_v4_v4(sp->col, ob->col);
 	else sp->col[0] = sp->col[1] = sp->col[2] = sp->col[3] = 1.0f;
 	
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 53e1f49..e00db9b 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -367,6 +367,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Scene *scene = CTX_data_scene(C);
 	Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
+	Main *bmain = CTX_data_main(C);
 	PointerRNA ptr, idptr;
 	PropertyRNA *prop;
 
@@ -375,7 +376,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
 		ma = BKE_material_copy(ma);
 	}
 	else {
-		ma = BKE_material_add("Material");
+		ma = BKE_material_add(bmain, "Material");
 
 		if (BKE_scene_use_new_shading_nodes(scene)) {
 			ED_node_shader_default(scene, &ma->id);
@@ -420,6 +421,7 @@ void MATERIAL_OT_new(wmOperatorType *ot)
 static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+	Main *bmain = CTX_data_main(C);
 	PointerRNA ptr, idptr;
 	PropertyRNA *prop;
 
@@ -427,7 +429,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
 	if (tex)
 		tex = BKE_texture_copy(tex);
 	else
-		tex = add_texture("Texture");
+		tex = add_texture(bmain, "Texture");
 
 	/* hook into UI */
 	uiIDContextProperty(C, &ptr, &prop);
@@ -467,6 +469,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Scene *scene = CTX_data_scene(C);
 	World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data;
+	Main *bmain = CTX_data_main(C);
 	PointerRNA ptr, idptr;
 	PropertyRNA *prop;
 
@@ -475,7 +478,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
 		wo = BKE_world_copy(wo);
 	}
 	else {
-		wo = add_world("World");
+		wo = add_world(bmain, "World");
 
 		if (BKE_scene_use_new_shading_nodes(scene)) {
 			ED_node_shader_default(scene, &wo->id);
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index 38535ec..16d7923 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -394,7 +394,14 @@ static void texture_changed(Main *bmain, Tex *tex)
 
 			if (dm && totmaterial && material) {
 				for (a = 0; a < *totmaterial; a++) {
-					if (material_uses_texture((*material)[a], tex)) {
+					Material *ma;
+
+					if (ob->matbits && ob->matbits[a])
+						ma = ob->mat[a];
+					else
+						ma = (*material)[a];
+
+					if (ma && material_uses_texture(ma, tex)) {
 						GPU_drawobject_free(dm);
 						break;
 					}
diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c
index f15f7b5..8b2ac74 100644
--- a/source/blender/editors/render/render_view.c
+++ b/source/blender/editors/render/render_view.c
@@ -289,7 +289,10 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
 		
 		/* is there another window showing result? */
 		for (win = CTX_wm_manager(C)->windows.first; win; win = win->next) {
-			if (win->screen->temp || (win == winshow && winshow != wincur)) {
+			bScreen *sc = win->screen;
+			if ((sc->temp && ((ScrArea *)sc->areabase.first)->spacetype == SPACE_IMAGE) ||
+			    (win == winshow && winshow != wincur))
+			{
 				wm_window_raise(win);
 				return OPERATOR_FINISHED;
 			}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index cea7b12..63232b8 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -446,7 +446,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
 		glClear(GL_COLOR_BUFFER_BIT);
 		
 		UI_ThemeColor(TH_TEXT);
-		BLF_draw_default(20, 8, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX);
+		BLF_draw_default(UI_UNIT_X, 0.4f*UI_UNIT_Y, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX);
 	}
 	else if (at->draw) {
 		at->draw(C, ar);
@@ -1864,15 +1864,11 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
 
 	/* background box */
 	ED_region_visible_rect(ar, &rect);
-	rect.xmin = 0;
 	rect.ymin = BLI_rcti_size_y(&ar->winrct) - header_height;
 
-	if (block) {
-		rect.xmax = BLI_rcti_size_x(&ar->winrct);
-	}
-	else {
-		rect.xmax = rect.xmin + BLF_width(fontid, text) + 24;
-	}
+	/* box fill entire width or just around text */
+	if (!block)
+		rect.xmax = min_ii(rect.xmax, rect.xmin + BLF_width(fontid, text) + 1.2f * U.widget_unit);
 
 	rect.ymax = BLI_rcti_size_y(&ar->winrct);
 
@@ -1884,8 +1880,13 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
 
 	/* text */
 	UI_ThemeColor(TH_TEXT_HI);
-	BLF_position(fontid, 12, rect.ymin + 5, 0.0f);
+	BLF_clipping(fontid, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+	BLF_enable(fontid, BLF_CLIPPING);
+	BLF_position(fontid, rect.xmin + 0.6f * U.widget_unit, rect.ymin + 0.3f * U.widget_unit, 0.0f);
+
 	BLF_draw(fontid, text, BLF_DRAW_STR_DUMMY_MAX);
+
+	BLF_disable(fontid, BLF_CLIPPING);
 }
 
 void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index f073fdd..105c2dc 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -38,13 +38,12 @@
 
 #include "BLI_rect.h"
 #include "BLI_utildefines.h"
+#include "BLI_math.h"
+#include "BLI_threads.h"
 
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 
-#include "BLI_math.h"
-#include "BLI_threads.h"
-
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index cca713e..7c22dff 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1337,13 +1337,14 @@ int ED_screen_area_active(const bContext *C)
 /* Do NOT call in area/region queues! */
 void ED_screen_set(bContext *C, bScreen *sc)
 {
+	Main *bmain = CTX_data_main(C);
 	wmWindowManager *wm = CTX_wm_manager(C);
 	wmWindow *win = CTX_wm_window(C);
 	bScreen *oldscreen = CTX_wm_screen(C);
 	ID *id;
 	
 	/* validate screen, it's called with notifier reference */
-	for (id = CTX_data_main(C)->screen.first; id; id = id->next)
+	for (id = bmain->screen.first; id; id = id->next)
 		if (sc == (bScreen *)id)
 			break;
 	if (id == NULL)
@@ -1355,7 +1356,7 @@ void ED_screen_set(bContext *C, bScreen *sc)
 	
 	if (sc->full) {             /* find associated full */
 		bScreen *sc1;
-		for (sc1 = CTX_data_main(C)->screen.first; sc1; sc1 = sc1->id.next) {
+		for (sc1 = bmain->screen.first; sc1; sc1 = sc1->id.next) {
 			ScrArea *sa = sc1->areabase.first;
 			if (sa->full == sc) {
 				sc = sc1;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index a22faea..12a7a33 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -360,7 +360,7 @@ int ED_operator_editarmature(bContext *C)
 /**
  * \brief check for pose mode (no mixed modes)
  *
- * We wan't to enable most pose operations in weight paint mode,
+ * We want to enable most pose operations in weight paint mode,
  * when it comes to transforming bones, but managing bomes layers/groups
  * can be left for pose mode only. (not weight paint mode)
  */
@@ -729,7 +729,7 @@ static int actionzone_cancel(bContext *UNUSED(C), wmOperator *op)
 static void SCREEN_OT_actionzone(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Handle area action zones";
+	ot->name = "Handle Area Action Zones";
 	ot->description = "Handle area action zones for mouse actions/gestures";
 	ot->idname = "SCREEN_OT_actionzone";
 	
@@ -851,7 +851,7 @@ static int area_swap_modal(bContext *C, wmOperator *op, wmEvent *event)
 
 static void SCREEN_OT_area_swap(wmOperatorType *ot)
 {
-	ot->name = "Swap areas";
+	ot->name = "Swap Areas";
 	ot->description = "Swap selected areas screen positions";
 	ot->idname = "SCREEN_OT_area_swap";
 	
@@ -1169,7 +1169,7 @@ static int area_move_modal(bContext *C, wmOperator *op, wmEvent *event)
 static void SCREEN_OT_area_move(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Move area edges";
+	ot->name = "Move Area Edges";
 	ot->description = "Move selected area edges";
 	ot->idname = "SCREEN_OT_area_move";
 	
@@ -2568,7 +2568,7 @@ static int spacedata_cleanup(bContext *C, wmOperator *op)
 static void SCREEN_OT_spacedata_cleanup(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Clean-up space-data";
+	ot->name = "Clean-up Space-data";
 	ot->description = "Remove unused settings for invisible editors";
 	ot->idname = "SCREEN_OT_spacedata_cleanup";
 	
@@ -2963,7 +2963,7 @@ static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *U
 	uiPopupMenu *pup;
 	uiLayout *layout;
 
-	pup = uiPupMenuBegin(C, N_("Header"), ICON_NONE);
+	pup = uiPupMenuBegin(C, IFACE_("Header"), ICON_NONE);
 	layout = uiPupMenuLayout(pup);
 
 	ED_screens_header_tools_menu_create(C, layout, NULL);
@@ -3368,7 +3368,7 @@ static int border_select_do(bContext *C, wmOperator *op)
 static void SCREEN_OT_border_select(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Border select";
+	ot->name = "Border Select";
 	ot->idname = "SCREEN_OT_border_select";
 	
 	/* api callbacks */
@@ -3597,9 +3597,9 @@ static void SCENE_OT_delete(wmOperatorType *ot)
 
 /* ***************** region alpha blending ***************** */
 
-/* implementation note: a disapplearing region needs at least 1 last draw with 100% backbuffer
-    texture over it- then triple buffer will clear it entirely. 
-    This because flag RGN_HIDDEN is set in end - region doesnt draw at all then */
+/* implementation note: a disappearing region needs at least 1 last draw with 100% backbuffer
+ * texture over it- then triple buffer will clear it entirely.
+ * This because flag RGN_HIDDEN is set in end - region doesnt draw at all then */
 
 typedef struct RegionAlphaInfo {
 	ScrArea *sa;
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 2982e1f..1f7fee3 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -86,8 +86,8 @@ static unsigned int *screenshot(bContext *C, int *dumpsx, int *dumpsy)
 
 	x = 0;
 	y = 0;
-	*dumpsx = win->sizex;
-	*dumpsy = win->sizey;
+	*dumpsx = WM_window_pixels_x(win);
+	*dumpsy = WM_window_pixels_y(win);
 
 	if (*dumpsx && *dumpsy) {
 		
@@ -272,7 +272,8 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
 	
 	WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE, FILE_SPECIAL, FILE_SAVE,
 	                               WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
-	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Screenshot the whole Blender window");
+	RNA_def_boolean(ot->srna, "full", 1, "Full Screen",
+	                "Capture the whole window (otherwise only capture the active area)");
 }
 
 /* *************** screenshot movie job ************************* */
@@ -457,8 +458,8 @@ static int screencast_exec(bContext *C, wmOperator *op)
 		wmWindow *win = CTX_wm_window(C);
 		sj->x = 0;
 		sj->y = 0;
-		sj->dumpsx = win->sizex;
-		sj->dumpsy = win->sizey;
+		sj->dumpsx = WM_window_pixels_x(win);
+		sj->dumpsy = WM_window_pixels_y(win);
 	}
 	else {
 		ScrArea *curarea = CTX_wm_area(C);
@@ -500,5 +501,6 @@ void SCREEN_OT_screencast(wmOperatorType *ot)
 	ot->flag = 0;
 	
 	RNA_def_property(ot->srna, "filepath", PROP_STRING, PROP_FILEPATH);
-	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Screencast the whole Blender window");
+	RNA_def_boolean(ot->srna, "full", 1, "Full Screen",
+	                "Capture the whole window (otherwise only capture the active area)");
 }
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 5e23a14..ffea5af 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -43,6 +43,7 @@
 
 #include "BKE_brush.h"
 #include "BKE_context.h"
+#include "BKE_image.h"
 #include "BKE_paint.h"
 
 #include "WM_api.h"
@@ -116,7 +117,7 @@ static void make_snap(Snapshot *snap, Brush *brush, ViewContext *vc)
 	snap->winy = vc->ar->winy;
 }
 
-static int load_tex(Sculpt *sd, Brush *br, ViewContext *vc)
+static int load_tex(Brush *br, ViewContext *vc)
 {
 	static GLuint overlay_texture = 0;
 	static int init = 0;
@@ -130,10 +131,6 @@ static int load_tex(Sculpt *sd, Brush *br, ViewContext *vc)
 	int size;
 	int j;
 	int refresh;
-
-#ifndef _OPENMP
-	(void)sd; /* quied unused warning */
-#endif
 	
 	if (br->mtex.brush_map_mode == MTEX_MAP_MODE_TILED && !br->mtex.tex) return 0;
 	
@@ -147,6 +144,8 @@ static int load_tex(Sculpt *sd, Brush *br, ViewContext *vc)
 	    !same_snap(&snap, br, vc);
 
 	if (refresh) {
+		struct ImagePool *pool = NULL;
+
 		if (br->mtex.tex && br->mtex.tex->preview)
 			tex_changed_timestamp = br->mtex.tex->preview->changed_timestamp[0];
 
@@ -186,7 +185,10 @@ static int load_tex(Sculpt *sd, Brush *br, ViewContext *vc)
 
 		buffer = MEM_mallocN(sizeof(GLubyte) * size * size, "load_tex");
 
-		#pragma omp parallel for schedule(static) if (sd->flags & SCULPT_USE_OPENMP)
+		if (br->mtex.tex)
+			pool = BKE_image_pool_new();
+
+		#pragma omp parallel for schedule(static)
 		for (j = 0; j < size; j++) {
 			int i;
 			float y;
@@ -236,7 +238,7 @@ static int load_tex(Sculpt *sd, Brush *br, ViewContext *vc)
 					x += br->mtex.ofs[0];
 					y += br->mtex.ofs[1];
 
-					avg = br->mtex.tex ? paint_get_tex_pixel(br, x, y) : 1;
+					avg = br->mtex.tex ? paint_get_tex_pixel(br, x, y, pool) : 1;
 
 					avg += br->texture_sample_bias;
 
@@ -251,6 +253,9 @@ static int load_tex(Sculpt *sd, Brush *br, ViewContext *vc)
 			}
 		}
 
+		if (pool)
+			BKE_image_pool_free(pool);
+
 		if (!overlay_texture)
 			glGenTextures(1, &overlay_texture);
 	}
@@ -376,7 +381,7 @@ static int sculpt_get_brush_geometry(bContext *C, ViewContext *vc,
 /* Draw an overlay that shows what effect the brush's texture will
  * have on brush strength */
 /* TODO: sculpt only for now */
-static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
+static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush,
                                      ViewContext *vc, int x, int y)
 {
 	rctf quad;
@@ -401,7 +406,7 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
 	             GL_VIEWPORT_BIT |
 	             GL_TEXTURE_BIT);
 
-	if (load_tex(sd, brush, vc)) {
+	if (load_tex(brush, vc)) {
 		glEnable(GL_BLEND);
 
 		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
@@ -416,24 +421,24 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
 			/* brush rotation */
 			glTranslatef(0.5, 0.5, 0);
 			glRotatef((double)RAD2DEGF((brush->flag & BRUSH_RAKE) ?
-			                           sd->last_angle : sd->special_rotation),
+			                           ups->last_angle : ups->special_rotation),
 			          0.0, 0.0, 1.0);
 			glTranslatef(-0.5f, -0.5f, 0);
 
 			/* scale based on tablet pressure */
-			if (sd->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush)) {
+			if (ups->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush)) {
 				glTranslatef(0.5f, 0.5f, 0);
-				glScalef(1.0f / sd->pressure_value, 1.0f / sd->pressure_value, 1);
+				glScalef(1.0f / ups->pressure_value, 1.0f / ups->pressure_value, 1);
 				glTranslatef(-0.5f, -0.5f, 0);
 			}
 
-			if (sd->draw_anchored) {
-				const float *aim = sd->anchored_initial_mouse;
+			if (ups->draw_anchored) {
+				const float *aim = ups->anchored_initial_mouse;
 				const rcti *win = &vc->ar->winrct;
-				quad.xmin = aim[0] - sd->anchored_size - win->xmin;
-				quad.ymin = aim[1] - sd->anchored_size - win->ymin;
-				quad.xmax = aim[0] + sd->anchored_size - win->xmin;
-				quad.ymax = aim[1] + sd->anchored_size - win->ymin;
+				quad.xmin = aim[0] - ups->anchored_size - win->xmin;
+				quad.ymin = aim[1] - ups->anchored_size - win->ymin;
+				quad.xmax = aim[0] + ups->anchored_size - win->xmin;
+				quad.ymax = aim[1] + ups->anchored_size - win->ymin;
 			}
 			else {
 				const int radius = BKE_brush_size_get(vc->scene, brush);
@@ -476,7 +481,7 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
 
 /* Special actions taken when paint cursor goes over mesh */
 /* TODO: sculpt only for now */
-static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
+static void paint_cursor_on_hit(UnifiedPaintSettings *ups, Brush *brush, ViewContext *vc,
                                 const float location[3])
 {
 	float unprojected_radius, projected_radius;
@@ -484,8 +489,8 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
 	/* update the brush's cached 3D radius */
 	if (!BKE_brush_use_locked_size(vc->scene, brush)) {
 		/* get 2D brush radius */
-		if (sd->draw_anchored)
-			projected_radius = sd->anchored_size;
+		if (ups->draw_anchored)
+			projected_radius = ups->anchored_size;
 		else {
 			if (brush->flag & BRUSH_ANCHORED)
 				projected_radius = 8;
@@ -498,8 +503,8 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
 		                                                    projected_radius);
 
 		/* scale 3D brush radius by pressure */
-		if (sd->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush))
-			unprojected_radius *= sd->pressure_value;
+		if (ups->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush))
+			unprojected_radius *= ups->pressure_value;
 
 		/* set cached value in either Brush or UnifiedPaintSettings */
 		BKE_brush_unprojected_radius_set(vc->scene, brush, unprojected_radius);
@@ -509,6 +514,7 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
 static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 {
 	Scene *scene = CTX_data_scene(C);
+	UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 	Paint *paint = paint_get_active_from_context(C);
 	Brush *brush = paint_brush(paint);
 	ViewContext vc;
@@ -534,7 +540,6 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 	/* TODO: as sculpt and other paint modes are unified, this
 	 * special mode of drawing will go away */
 	if (vc.obact->sculpt) {
-		Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
 		float location[3];
 		int pixel_radius, hit;
 
@@ -547,14 +552,14 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 			const float v = 1 - u;
 			const float r = 20;
 
-			const float dx = sd->last_x - x;
-			const float dy = sd->last_y - y;
+			const float dx = ups->last_x - x;
+			const float dy = ups->last_y - y;
 
 			if (dx * dx + dy * dy >= r * r) {
-				sd->last_angle = atan2(dx, dy);
+				ups->last_angle = atan2(dx, dy);
 
-				sd->last_x = u * sd->last_x + v * x;
-				sd->last_y = u * sd->last_y + v * y;
+				ups->last_x = u * ups->last_x + v * x;
+				ups->last_y = u * ups->last_y + v * y;
 			}
 		}
 
@@ -562,7 +567,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 		hit = sculpt_get_brush_geometry(C, &vc, x, y, &pixel_radius, location);
 
 		/* draw overlay */
-		paint_draw_alpha_overlay(sd, brush, &vc, x, y);
+		paint_draw_alpha_overlay(ups, brush, &vc, x, y);
 
 		if (BKE_brush_use_locked_size(scene, brush))
 			BKE_brush_size_set(scene, brush, pixel_radius);
@@ -581,12 +586,12 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 
 		/* only do if brush is over the mesh */
 		if (hit)
-			paint_cursor_on_hit(sd, brush, &vc, location);
+			paint_cursor_on_hit(ups, brush, &vc, location);
 
-		if (sd->draw_anchored) {
-			final_radius = sd->anchored_size;
-			translation[0] = sd->anchored_initial_mouse[0] - vc.ar->winrct.xmin;
-			translation[1] = sd->anchored_initial_mouse[1] - vc.ar->winrct.ymin;
+		if (ups->draw_anchored) {
+			final_radius = ups->anchored_size;
+			translation[0] = ups->anchored_initial_mouse[0] - vc.ar->winrct.xmin;
+			translation[1] = ups->anchored_initial_mouse[1] - vc.ar->winrct.ymin;
 		}
 	}
 
@@ -599,6 +604,14 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 
 	/* draw brush outline */
 	glTranslatef(translation[0], translation[1], 0);
+
+	/* draw an inner brush */
+	if (ups->draw_pressure && BKE_brush_use_size_pressure(scene, brush)) {
+		/* inner at full alpha */
+		glutil_draw_lined_arc(0.0, M_PI * 2.0, final_radius * ups->pressure_value, 40);
+		/* outer at half alpha */
+		glColor4f(outline_col[0], outline_col[1], outline_col[2], outline_alpha * 0.5f);
+	}
 	glutil_draw_lined_arc(0.0, M_PI * 2.0, final_radius, 40);
 	glTranslatef(-translation[0], -translation[1], 0);
 
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index d0f8e36..1f8c06f 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -140,7 +140,7 @@ BLI_INLINE unsigned char f_to_char(const float val)
 #define IMAPAINT_TILE_SIZE          (1 << IMAPAINT_TILE_BITS)
 #define IMAPAINT_TILE_NUMBER(size)  (((size) + IMAPAINT_TILE_SIZE - 1) >> IMAPAINT_TILE_BITS)
 
-static void imapaint_image_update(Scene *scene, SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint);
+static void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint);
 
 
 typedef struct ImagePaintState {
@@ -316,7 +316,7 @@ typedef struct ProjPaintState {
 	float normal_angle_range;       /* difference between normal_angle and normal_angle_inner, for easy access */
 	
 	short is_ortho;
-	short is_airbrush;              /* only to avoid using (ps.brush->flag & BRUSH_AIRBRUSH) */
+	bool do_masking;              /* use masking during painting. Some operations such as airbrush may disable */
 	short is_texbrush;              /* only to avoid running  */
 #ifndef PROJ_DEBUG_NOSEAMBLEED
 	float seam_bleed_px;
@@ -355,7 +355,7 @@ typedef union pixelStore {
 
 typedef struct ProjPixel {
 	float projCoSS[2]; /* the floating point screen projection of this pixel */
-	
+	float worldCoSS[3];
 	/* Only used when the airbrush is disabled.
 	 * Store the max mask value to avoid painting over an area with a lower opacity
 	 * with an advantage that we can avoid touching the pixel at all, if the 
@@ -904,7 +904,7 @@ static int project_paint_occlude_ptv_clip(const ProjPaintState *ps, const MFace
 
 /* Check if a screenspace location is occluded by any other faces
  * check, pixelScreenCo must be in screenspace, its Z-Depth only needs to be used for comparison
- * and dosn't need to be correct in relation to X and Y coords (this is the case in perspective view) */
+ * and doesn't need to be correct in relation to X and Y coords (this is the case in perspective view) */
 static int project_bucket_point_occluded(const ProjPaintState *ps, LinkNode *bucketFace, const int orig_face, float pixelScreenCo[4])
 {
 	MFace *mf;
@@ -1526,6 +1526,7 @@ static int project_paint_pixel_sizeof(const short tool)
 	}
 }
 
+
 /* run this function when we know a bucket's, face's pixel can be initialized,
  * return the ProjPixel which is added to 'ps->bucketRect[bucket_index]' */
 static ProjPixel *project_paint_uvpixel_init(
@@ -1537,6 +1538,7 @@ static ProjPixel *project_paint_uvpixel_init(
         const int face_index,
         const int image_index,
         const float pixelScreenCo[4],
+        const float world_spaceCo[3],
         const int side,
         const float w[3])
 {
@@ -1565,6 +1567,10 @@ static ProjPixel *project_paint_uvpixel_init(
 	}
 	
 	/* screenspace unclamped, we could keep its z and w values but don't need them at the moment */
+	if (ps->brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) {
+		copy_v3_v3(projPixel->worldCoSS, world_spaceCo);
+	}
+
 	copy_v2_v2(projPixel->projCoSS, pixelScreenCo);
 	
 	projPixel->x_px = x_px;
@@ -2374,6 +2380,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 	
 	float *uv1co, *uv2co, *uv3co; /* for convenience only, these will be assigned to tf->uv[0],1,2 or tf->uv[0],2,3 */
 	float pixelScreenCo[4];
+	bool do_3d_mapping = ps->brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D;
 	
 	rcti bounds_px; /* ispace bounds */
 	/* vars for getting uvspace bounds */
@@ -2449,7 +2456,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 		v1coSS = ps->screenCoords[(*(&mf->v1 + i1))];
 		v2coSS = ps->screenCoords[(*(&mf->v1 + i2))];
 		v3coSS = ps->screenCoords[(*(&mf->v1 + i3))];
-		
+
 		/* This funtion gives is a concave polyline in UV space from the clipped quad and tri*/
 		project_bucket_clip_face(
 		        is_ortho, bucket_bounds,
@@ -2501,9 +2508,9 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 						else          screen_px_from_persp(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
 						
 						/* a pity we need to get the worldspace pixel location here */
-						if (do_clip) {
+						if (do_clip || do_3d_mapping) {
 							interp_v3_v3v3v3(wco, ps->dm_mvert[(*(&mf->v1 + i1))].co, ps->dm_mvert[(*(&mf->v1 + i2))].co, ps->dm_mvert[(*(&mf->v1 + i3))].co, w);
-							if (ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) {
+							if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) {
 								continue; /* Watch out that no code below this needs to run */
 							}
 						}
@@ -2514,13 +2521,13 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 						if ((ps->do_occlude == FALSE) ||
 						    !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo))
 						{
-							
 							mask = project_paint_uvpixel_mask(ps, face_index, side, w);
-							
+
 							if (mask > 0.0f) {
 								BLI_linklist_prepend_arena(
 								        bucketPixelNodes,
-								        project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index, image_index, pixelScreenCo, side, w),
+								        project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index,
+								                                   image_index, pixelScreenCo, wco, side, w),
 								        arena
 								        );
 							}
@@ -2725,11 +2732,11 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 											}
 											
 											/* a pity we need to get the worldspace pixel location here */
-											if (do_clip) {
+											if (do_clip || do_3d_mapping) {
 												if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w);
 												else      interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w);
 
-												if (ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) {
+												if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) {
 													continue; /* Watch out that no code below this needs to run */
 												}
 											}
@@ -2739,7 +2746,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 											if (mask > 0.0f) {
 												BLI_linklist_prepend_arena(
 												        bucketPixelNodes,
-												        project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index, image_index, pixelScreenCo, side, w),
+												        project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index, image_index, pixelScreenCo, wco, side, w),
 												        arena
 												        );
 											}
@@ -3649,7 +3656,7 @@ static int project_image_refresh_tagged(ProjPaintState *ps)
 				pr = &(projIma->partRedrawRect[i]);
 				if (pr->x2 != -1) { /* TODO - use 'enabled' ? */
 					imapaintpartial = *pr;
-					imapaint_image_update(NULL, NULL, projIma->ima, projIma->ibuf, 1); /*last 1 is for texpaint*/
+					imapaint_image_update(NULL, projIma->ima, projIma->ibuf, 1); /*last 1 is for texpaint*/
 					redraw = 1;
 				}
 			}
@@ -3749,6 +3756,8 @@ typedef struct ProjectHandle {
 	
 	/* thread settings */
 	int thread_index;
+
+	struct ImagePool *pool;
 } ProjectHandle;
 
 static void blend_color_mix(unsigned char cp[4], const unsigned char cp1[4], const unsigned char cp2[4], const int fac)
@@ -3800,7 +3809,7 @@ static void blend_color_mix_accum_float(float cp[4], const float cp1[4], const u
 
 static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask)
 {
-	if (ps->is_airbrush == 0 && mask < 1.0f) {
+	if (ps->do_masking && mask < 1.0f) {
 		projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, ((ProjPixelClone *)projPixel)->clonepx.uint, (int)(alpha * 255), ps->blend);
 		blend_color_mix(projPixel->pixel.ch_pt,  projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask * 255));
 	}
@@ -3811,7 +3820,7 @@ static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, floa
 
 static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask)
 {
-	if (ps->is_airbrush == 0 && mask < 1.0f) {
+	if (ps->do_masking && mask < 1.0f) {
 		IMB_blend_color_float(projPixel->newColor.f, projPixel->newColor.f, ((ProjPixelClone *)projPixel)->clonepx.f, alpha, ps->blend);
 		blend_color_mix_float(projPixel->pixel.f_pt,  projPixel->origColor.f, projPixel->newColor.f, mask);
 	}
@@ -3946,7 +3955,7 @@ static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, const
 		rgba_ub[3] = 255;
 	}
 	
-	if (ps->is_airbrush == 0 && mask < 1.0f) {
+	if (ps->do_masking && mask < 1.0f) {
 		projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, *((unsigned int *)rgba_ub), (int)(alpha * 255), ps->blend);
 		blend_color_mix(projPixel->pixel.ch_pt,  projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask * 255));
 	}
@@ -3978,7 +3987,7 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, flo
 		rgba[3] = 1.0;
 	}
 	
-	if (ps->is_airbrush == 0 && mask < 1.0f) {
+	if (ps->do_masking && mask < 1.0f) {
 		IMB_blend_color_float(projPixel->newColor.f, projPixel->newColor.f, rgba, alpha, ps->blend);
 		blend_color_mix_float(projPixel->pixel.f_pt,  projPixel->origColor.f, projPixel->newColor.f, mask);
 	}
@@ -3998,10 +4007,12 @@ static void *do_projectpaint_thread(void *ph_v)
 	const float *lastpos =       ((ProjectHandle *)ph_v)->prevmval;
 	const float *pos =           ((ProjectHandle *)ph_v)->mval;
 	const int thread_index =     ((ProjectHandle *)ph_v)->thread_index;
+	struct ImagePool *pool =     ((ProjectHandle *)ph_v)->pool;
 	/* Done with args from ProjectHandle */
 
 	LinkNode *node;
 	ProjPixel *projPixel;
+	Brush *brush = ps->brush;
 	
 	int last_index = -1;
 	ProjPaintImage *last_projIma = NULL;
@@ -4021,10 +4032,10 @@ static void *do_projectpaint_thread(void *ph_v)
 	float co[2];
 	float mask = 1.0f; /* airbrush wont use mask */
 	unsigned short mask_short;
-	const float radius = (float)BKE_brush_size_get(ps->scene, ps->brush);
+	const float radius = (float)BKE_brush_size_get(ps->scene, brush);
 	const float radius_squared = radius * radius; /* avoid a square root with every dist comparison */
 	
-	short lock_alpha = ELEM(ps->brush->blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA) ? 0 : ps->brush->flag & BRUSH_LOCK_ALPHA;
+	short lock_alpha = ELEM(brush->blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA) ? 0 : brush->flag & BRUSH_LOCK_ALPHA;
 	
 	LinkNode *smearPixels = NULL;
 	LinkNode *smearPixels_f = NULL;
@@ -4105,23 +4116,36 @@ static void *do_projectpaint_thread(void *ph_v)
 
 				/*if (dist < radius) {*/ /* correct but uses a sqrtf */
 				if (dist_nosqrt <= radius_squared) {
+					float samplecos[3];
 					dist = sqrtf(dist_nosqrt);
 
 					falloff = BKE_brush_curve_strength_clamp(ps->brush, dist, radius);
 
+					if (ps->is_texbrush) {
+						MTex *mtex = &brush->mtex;
+						if (mtex->brush_map_mode == MTEX_MAP_MODE_VIEW) {
+							sub_v2_v2v2(samplecos, projPixel->projCoSS, pos);
+						}
+						/* taking 3d copy to account for 3D mapping too. It gets concatenated during sampling */
+						else if (mtex->brush_map_mode == MTEX_MAP_MODE_3D)
+							copy_v3_v3(samplecos, projPixel->worldCoSS);
+						else
+							copy_v3_v3(samplecos, projPixel->projCoSS);
+					}
+
 					if (falloff > 0.0f) {
 						if (ps->is_texbrush) {
 							/* note, for clone and smear, we only use the alpha, could be a special function */
-							BKE_brush_sample_tex(ps->scene, ps->brush, projPixel->projCoSS, rgba, thread_index);
+							BKE_brush_sample_tex(ps->scene, brush, samplecos, rgba, thread_index, pool);
 							alpha = rgba[3];
 						}
 						else {
 							alpha = 1.0f;
 						}
 						
-						if (ps->is_airbrush) {
+						if (!ps->do_masking) {
 							/* for an aurbrush there is no real mask, so just multiply the alpha by it */
-							alpha *= falloff * BKE_brush_alpha_get(ps->scene, ps->brush);
+							alpha *= falloff * BKE_brush_alpha_get(ps->scene, brush);
 							mask = ((float)projPixel->mask) / 65535.0f;
 						}
 						else {
@@ -4129,7 +4153,7 @@ static void *do_projectpaint_thread(void *ph_v)
 							falloff = 1.0f - falloff;
 							falloff = 1.0f - (falloff * falloff);
 							
-							mask_short = (unsigned short)(projPixel->mask * (BKE_brush_alpha_get(ps->scene, ps->brush) * falloff));
+							mask_short = (unsigned short)(projPixel->mask * (BKE_brush_alpha_get(ps->scene, brush) * falloff));
 							if (mask_short > projPixel->mask_max) {
 								mask = ((float)mask_short) / 65535.0f;
 								projPixel->mask_max = mask_short;
@@ -4248,6 +4272,8 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
 	ListBase threads;
 	int a, i;
 	
+	struct ImagePool *pool;
+	
 	if (!project_bucket_iter_init(ps, pos)) {
 		return 0;
 	}
@@ -4255,6 +4281,8 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
 	if (ps->thread_tot > 1)
 		BLI_init_threads(&threads, do_projectpaint_thread, ps->thread_tot);
 	
+	pool = BKE_image_pool_new();
+	
 	/* get the threads running */
 	for (a = 0; a < ps->thread_tot; a++) {
 		
@@ -4278,6 +4306,8 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
 			memcpy(handles[a].projImages[i].partRedrawRect, ps->projImages[i].partRedrawRect, sizeof(ImagePaintPartialRedraw) * PROJ_BOUNDBOX_SQUARED);
 		}
 
+		handles[a].pool = pool;
+
 		if (ps->thread_tot > 1)
 			BLI_insert_thread(&threads, &handles[a]);
 	}
@@ -4288,6 +4318,8 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
 		do_projectpaint_thread(&handles[0]);
 		
 	
+	BKE_image_pool_free(pool);
+	
 	/* move threaded bounds back into ps->projectPartialRedraws */
 	for (i = 0; i < ps->image_tot; i++) {
 		int touch = 0;
@@ -4315,7 +4347,7 @@ static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, c
 	pos[1] = (float)(mval_i[1]);
 	
 	// we may want to use this later 
-	// BKE_brush_painter_require_imbuf(painter, ((ibuf->rect_float)? 1: 0), 0, 0);
+	// BKE_brush_painter_require_imbuf(painter, ((ibuf->rect_float) ? 1 : 0), 0, 0);
 	
 	if (BKE_brush_painter_paint(painter, project_paint_op, pos, time, pressure, ps, 0)) {
 		return 1;
@@ -4385,16 +4417,13 @@ static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w,
 		IMB_freeImBuf(tmpibuf);
 }
 
-static void imapaint_image_update(Scene *scene, SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint)
+static void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint)
 {
-	if (scene) {
-		IMB_partial_display_buffer_update(ibuf, ibuf->rect_float, (unsigned char *) ibuf->rect, ibuf->x, 0, 0,
-		                                  &scene->view_settings, &scene->display_settings,
-		                                  imapaintpartial.x1, imapaintpartial.y1,
-		                                  imapaintpartial.x2, imapaintpartial.y2, FALSE);
-	}
-	else {
-		ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
+	if (imapaintpartial.x1 != imapaintpartial.x2 &&
+	    imapaintpartial.y1 != imapaintpartial.y2)
+	{
+		IMB_partial_display_buffer_update_delayed(ibuf, imapaintpartial.x1, imapaintpartial.y1,
+		                                          imapaintpartial.x2, imapaintpartial.y2);
 	}
 	
 	if (ibuf->mipmap[0])
@@ -4714,6 +4743,7 @@ static int imapaint_canvas_set(ImagePaintState *s, Image *ima)
 		
 		if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) {
 			BKE_image_release_ibuf(ima, ibuf, NULL);
+			BKE_image_release_ibuf(s->image, s->canvas, NULL);
 			return 0;
 		}
 
@@ -4757,7 +4787,7 @@ static int imapaint_paint_sub_stroke(ImagePaintState *s, BrushPainter *painter,
 	 */
 	if (BKE_brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s, is_data == FALSE)) {
 		if (update)
-			imapaint_image_update(s->scene, s->sima, image, ibuf, texpaint);
+			imapaint_image_update(s->sima, image, ibuf, texpaint);
 		BKE_image_release_ibuf(image, ibuf, NULL);
 		return 1;
 	}
@@ -4955,7 +4985,6 @@ typedef struct PaintOperation {
 
 	int first;
 	int prevmouse[2];
-	float prev_pressure; /* need this since we don't get tablet events for pressure change */
 	int orig_brush_size;
 	double starttime;
 
@@ -4987,21 +5016,29 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps)
 {
 	Scene *scene = CTX_data_scene(C);
 	ToolSettings *settings = scene->toolsettings;
-	Brush *brush = paint_brush(&settings->imapaint.paint);
 
 	/* brush */
-	ps->brush = brush;
-	ps->tool = brush->imagepaint_tool;
-	ps->blend = brush->blend;
+	ps->brush = paint_brush(&settings->imapaint.paint);
+	if (ps->brush) {
+		Brush *brush = ps->brush;
+		ps->tool = brush->imagepaint_tool;
+		ps->blend = brush->blend;
+
+		/* disable for 3d mapping also because painting on mirrored mesh can create "stripes" */
+		ps->do_masking = (brush->flag & BRUSH_AIRBRUSH || brush->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW ||
+		                  brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) ? false : true;
+		ps->is_texbrush = (brush->mtex.tex) ? 1 : 0;
+	}
+	else {
+		/* brush may be NULL*/
+		ps->do_masking = false;
+		ps->is_texbrush = false;
+	}
 
 	/* sizeof ProjPixel, since we alloc this a _lot_ */
 	ps->pixel_sizeof = project_paint_pixel_sizeof(ps->tool);
 	BLI_assert(ps->pixel_sizeof >= sizeof(ProjPixel));
 
-	ps->is_airbrush = (brush->flag & BRUSH_AIRBRUSH) ? 1 : 0;
-	ps->is_texbrush = (brush->mtex.tex) ? 1 : 0;
-
-
 	/* these can be NULL */
 	ps->v3d = CTX_wm_view3d(C);
 	ps->rv3d = CTX_wm_region_view3d(C);
@@ -5173,6 +5210,11 @@ static int texture_paint_init(bContext *C, wmOperator *op)
 	/* create painter */
 	pop->painter = BKE_brush_painter_new(scene, pop->s.brush);
 
+	{
+		UnifiedPaintSettings *ups = &settings->unified_paint_settings;
+		ups->draw_pressure = true;
+	}
+
 	return 1;
 }
 
@@ -5261,6 +5303,11 @@ static void paint_exit(bContext *C, wmOperator *op)
 		BKE_reportf(op->reports, RPT_WARNING, "Packed MultiLayer files cannot be painted: %s", pop->s.warnpackedfile);
 
 	MEM_freeN(pop);
+
+	{
+		UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
+		ups->draw_pressure = false;
+	}
 }
 
 static int paint_exec(bContext *C, wmOperator *op)
@@ -5285,7 +5332,6 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
 {
 	const Scene *scene = CTX_data_scene(C);
 	PaintOperation *pop = op->customdata;
-	wmTabletData *wmtab;
 	PointerRNA itemptr;
 	float pressure, mousef[2];
 	double time;
@@ -5296,16 +5342,17 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
 	tablet = 0;
 	pop->s.blend = pop->s.brush->blend;
 
-	if (event->custom == EVT_DATA_TABLET) {
-		wmtab = event->customdata;
+	if (event->tablet_data) {
+		wmTabletData *wmtab = event->tablet_data;
 
 		tablet = (wmtab->Active != EVT_TABLET_NONE);
 		pressure = wmtab->Pressure;
 		if (wmtab->Active == EVT_TABLET_ERASER)
 			pop->s.blend = IMB_BLEND_ERASE_ALPHA;
 	}
-	else { /* otherwise airbrush becomes 1.0 pressure instantly */
-		pressure = pop->prev_pressure ? pop->prev_pressure : 1.0f;
+	else {
+		BLI_assert(fabsf(WM_cursor_pressure(CTX_wm_window(C))) == 1.0f);
+		pressure = 1.0f;
 	}
 
 	if (pop->first) {
@@ -5338,7 +5385,10 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
 	/* apply */
 	paint_apply(C, op, &itemptr);
 
-	pop->prev_pressure = pressure;
+	{
+		UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
+		ups->pressure_value = pressure;
+	}
 }
 
 static int paint_invoke(bContext *C, wmOperator *op, wmEvent *event)
@@ -5349,7 +5399,7 @@ static int paint_invoke(bContext *C, wmOperator *op, wmEvent *event)
 		MEM_freeN(op->customdata);
 		return OPERATOR_CANCELLED;
 	}
-	
+
 	paint_apply_event(C, op, event);
 
 	pop = op->customdata;
@@ -5479,6 +5529,16 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
 		glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], alpha);
 		glEnable(GL_LINE_SMOOTH);
 		glEnable(GL_BLEND);
+		{
+			UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
+			/* hrmf, duplicate paint_draw_cursor logic here */
+			if (ups->draw_pressure && BKE_brush_use_size_pressure(scene, brush)) {
+				/* inner at full alpha */
+				glutil_draw_lined_arc(0, (float)(M_PI * 2.0), size * ups->pressure_value, 40);
+				/* outer at half alpha */
+				glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], alpha * 0.5f);
+			}
+		}
 		glutil_draw_lined_arc(0, (float)(M_PI * 2.0), size, 40);
 		glDisable(GL_BLEND);
 		glDisable(GL_LINE_SMOOTH);
@@ -5953,7 +6013,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
 
 	/* override */
 	ps.is_texbrush = 0;
-	ps.is_airbrush = 1;
+	ps.do_masking = false;
 	orig_brush_size = BKE_brush_size_get(scene, ps.brush);
 	BKE_brush_size_set(scene, ps.brush, 32); /* cover the whole image */
 
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index dd7412c..8425085 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -197,15 +197,14 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
 
 			for (x = origx; x < w; x++, bf += 4, mf += 4, tf += 4) {
 				if (dotexold) {
-					copy_v3_v3(tf, otf);
-					tf[3] = otf[3];
+					copy_v4_v4(tf, otf);
 					otf += 4;
 				}
 				else {
 					xy[0] = x + xoff;
 					xy[1] = y + yoff;
 
-					BKE_brush_sample_tex(scene, brush, xy, tf, 0);
+					BKE_brush_sample_tex_2D(scene, brush, xy, tf, 0);
 				}
 
 				bf[0] = tf[0] * mf[0];
@@ -236,7 +235,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
 					xy[0] = x + xoff;
 					xy[1] = y + yoff;
 
-					BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
+					BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
 					rgba_float_to_uchar(t, rgba);
 				}
 
@@ -249,7 +248,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
 	}
 }
 
-static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, const float pos[2])
+static void brush_painter_tiled_tex_partial_update(BrushPainter *painter, const float pos[2])
 {
 	const Scene *scene = painter->scene;
 	Brush *brush = painter->brush;
@@ -265,7 +264,6 @@ static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, const
 
 	oldtexibuf = cache->texibuf;
 	cache->texibuf = IMB_allocImBuf(diameter, diameter, 32, imbflag);
-
 	if (oldtexibuf) {
 		srcx = srcy = 0;
 		destx = (int)painter->lastpaintpos[0] - (int)pos[0];
@@ -314,6 +312,7 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2
 	short flt;
 	const int diameter = 2 * BKE_brush_size_get(scene, brush);
 	const float alpha = BKE_brush_alpha_get(scene, brush);
+	const bool do_tiled = ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_3D);
 
 	if (diameter != cache->lastsize ||
 	    alpha != cache->lastalpha ||
@@ -331,9 +330,9 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2
 		flt = cache->flt;
 		size = (cache->size) ? cache->size : diameter;
 
-		if (brush->flag & BRUSH_FIXED_TEX) {
+		if (do_tiled) {
 			BKE_brush_imbuf_new(scene, brush, flt, 3, size, &cache->maskibuf, use_color_correction);
-			brush_painter_fixed_tex_partial_update(painter, pos);
+			brush_painter_tiled_tex_partial_update(painter, pos);
 		}
 		else
 			BKE_brush_imbuf_new(scene, brush, flt, 2, size, &cache->ibuf, use_color_correction);
@@ -342,12 +341,12 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2
 		cache->lastalpha = alpha;
 		cache->lastjitter = brush->jitter;
 	}
-	else if ((brush->flag & BRUSH_FIXED_TEX) && mtex && mtex->tex) {
+	else if (do_tiled && mtex && mtex->tex) {
 		int dx = (int)painter->lastpaintpos[0] - (int)pos[0];
 		int dy = (int)painter->lastpaintpos[1] - (int)pos[1];
 
 		if ((dx != 0) || (dy != 0))
-			brush_painter_fixed_tex_partial_update(painter, pos);
+			brush_painter_tiled_tex_partial_update(painter, pos);
 	}
 }
 
@@ -539,7 +538,7 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side)
 				co[2] = 0.0f;
 				
 				/* This is copied from displace modifier code */
-				hasrgb = multitex_ext(mtex->tex, co, NULL, NULL, 0, &texres);
+				hasrgb = multitex_ext(mtex->tex, co, NULL, NULL, 0, &texres, NULL);
 			
 				/* if the texture gave an RGB value, we assume it didn't give a valid
 				 * intensity, so calculate one (formula from do_material_tex).
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index cf55c93..faa9ce0 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -36,6 +36,7 @@ struct ARegion;
 struct bContext;
 struct bglMats;
 struct Brush;
+struct ImagePool;
 struct ListBase;
 struct Mesh;
 struct Object;
@@ -61,7 +62,8 @@ struct PaintStroke *paint_stroke_new(struct bContext *C,
                                      StrokeUpdateStep update_step, StrokeDone done, int event_type);
 void paint_stroke_data_free(struct wmOperator *op);
 
-int paint_space_stroke_enabled(struct Brush *br);
+bool paint_space_stroke_enabled(struct Brush *br);
+bool paint_supports_dynamic_size(struct Brush *br);
 
 struct wmKeyMap *paint_stroke_modal_keymap(struct wmKeyConfig *keyconf);
 int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
@@ -139,7 +141,7 @@ void paint_calc_redraw_planes(float planes[4][4],
 
 void projectf(struct bglMats *mats, const float v[3], float p[2]);
 float paint_calc_object_space_radius(struct ViewContext *vc, const float center[3], float pixel_radius);
-float paint_get_tex_pixel(struct Brush *br, float u, float v);
+float paint_get_tex_pixel(struct Brush *br, float u, float v, struct ImagePool *pool);
 int imapaint_pick_face(struct ViewContext *vc, const int mval[2], unsigned int *index, unsigned int totface);
 void imapaint_pick_uv(struct Scene *scene, struct Object *ob, unsigned int faceindex, const int xy[2], float uv[2]);
 
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index e5d6a18..ba33ad2 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -62,11 +62,12 @@ static int brush_add_exec(bContext *C, wmOperator *UNUSED(op))
 	/*int type = RNA_enum_get(op->ptr, "type");*/
 	Paint *paint = paint_get_active_from_context(C);
 	struct Brush *br = paint_brush(paint);
+	Main *bmain = CTX_data_main(C);
 
 	if (br)
 		br = BKE_brush_copy(br);
 	else
-		br = BKE_brush_add("Brush");
+		br = BKE_brush_add(bmain, "Brush");
 
 	paint_brush_set(paint, br);
 
@@ -272,7 +273,7 @@ static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool,
 		brush = brush_tool_cycle(bmain, brush_orig, tool, tool_offset, ob_mode);
 
 	if (!brush && brush_tool(brush_orig, tool_offset) != tool && create_missing) {
-		brush = BKE_brush_add(tool_name);
+		brush = BKE_brush_add(bmain, tool_name);
 		brush_tool_set(brush, tool_offset, tool);
 		brush->ob_mode = ob_mode;
 		brush->toggle_brush = brush_orig;
@@ -681,6 +682,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
 	keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_FLATTEN, TKEY, KM_SHIFT);
 	keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_CLAY, CKEY, 0);
 	keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_CREASE, CKEY, KM_SHIFT);
+	keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_SNAKE_HOOK, KKEY, 0);
 	kmi = keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_MASK, MKEY, 0);
 	RNA_boolean_set(kmi->ptr, "toggle", 1);
 	RNA_boolean_set(kmi->ptr, "create_missing", 1);
@@ -719,8 +721,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
 	WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
 
 	/* these keys are from 2.4x but could be changed */
-	WM_keymap_verify_item(keymap, "PAINT_OT_weight_sample", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
-	WM_keymap_verify_item(keymap, "PAINT_OT_weight_sample_group", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
+	WM_keymap_verify_item(keymap, "PAINT_OT_weight_sample", ACTIONMOUSE, KM_PRESS, KM_CTRL, 0);
+	WM_keymap_verify_item(keymap, "PAINT_OT_weight_sample_group", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
 
 	RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_gradient", LEFTMOUSE, KM_PRESS, KM_ALT, 0)->ptr,           "type", WPAINT_GRADIENT_TYPE_LINEAR);
 	RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_gradient", LEFTMOUSE, KM_PRESS, KM_ALT | KM_CTRL, 0)->ptr, "type", WPAINT_GRADIENT_TYPE_RADIAL);
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 2f4115d..5d93134 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -125,8 +125,8 @@ static float event_tablet_data(wmEvent *event, int *pen_flip)
 	int erasor = 0;
 	float pressure = 1;
 
-	if (event->custom == EVT_DATA_TABLET) {
-		wmTabletData *wmtab = event->customdata;
+	if (event->tablet_data) {
+		wmTabletData *wmtab = event->tablet_data;
 
 		erasor = (wmtab->Active == EVT_TABLET_ERASER);
 		pressure = (wmtab->Active != EVT_TABLET_NONE) ? wmtab->Pressure : 1;
@@ -324,10 +324,15 @@ static void stroke_done(struct bContext *C, struct wmOperator *op)
 }
 
 /* Returns zero if the stroke dots should not be spaced, non-zero otherwise */
-int paint_space_stroke_enabled(Brush *br)
+bool paint_space_stroke_enabled(Brush *br)
 {
-	return (br->flag & BRUSH_SPACE) &&
-	       !(br->flag & BRUSH_ANCHORED) &&
+	return (br->flag & BRUSH_SPACE) && paint_supports_dynamic_size(br);
+}
+
+/* return true if the brush size can change during paint (normally used for pressure) */
+bool paint_supports_dynamic_size(Brush *br)
+{
+	return !(br->flag & BRUSH_ANCHORED) &&
 	       !ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK);
 }
 
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index e7d13bd..4f15627 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -173,13 +173,13 @@ float paint_calc_object_space_radius(ViewContext *vc, const float center[3],
 	return len_v3(delta) / scale;
 }
 
-float paint_get_tex_pixel(Brush *br, float u, float v)
+float paint_get_tex_pixel(Brush *br, float u, float v, struct ImagePool *pool)
 {
 	TexResult texres = {0};
 	float co[3] = {u, v, 0.0f};
 	int hasrgb;
 
-	hasrgb = multitex_ext(br->mtex.tex, co, NULL, NULL, 0, &texres);
+	hasrgb = multitex_ext(br->mtex.tex, co, NULL, NULL, 0, &texres, pool);
 
 	if (hasrgb & TEX_RGB)
 		texres.tin = rgb_to_grayscale(&texres.tr) * texres.ta;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 08c26aa..8ff2a68 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1029,6 +1029,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
 		unsigned int index;
 
 		view3d_operator_needs_opengl(C);
+		ED_view3d_init_mats_rv3d(vc.obact, vc.rv3d);
 
 		if (use_vert_sel) {
 			if (ED_mesh_pick_vert(C, vc.obact, event->mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, TRUE)) {
@@ -1118,6 +1119,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA
 				               win->eventstate->y - vc.ar->winrct.ymin};
 
 				view3d_operator_needs_opengl(C);
+				ED_view3d_init_mats_rv3d(vc.obact, vc.rv3d);
 
 				if (use_vert_sel) {
 					if (ED_mesh_pick_vert(C, vc.obact, mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, TRUE)) {
@@ -2172,6 +2174,11 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UNU
 	if (me->editflag & ME_EDIT_MIRROR_X) {
 		wpd->vgroup_mirror = wpaint_mirror_vgroup_ensure(ob, wpd->vgroup_active);
 	}
+
+	{
+		UnifiedPaintSettings *ups = &ts->unified_paint_settings;
+		ups->draw_pressure = true;
+	}
 	
 	return TRUE;
 }
@@ -2225,7 +2232,8 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
 	indexar = wpd->indexar;
 	
 	view3d_operator_needs_opengl(C);
-		
+	ED_view3d_init_mats_rv3d(ob, vc->rv3d);
+
 	/* load projection matrix */
 	mult_m4_m4m4(mat, vc->rv3d->persmat, ob->obmat);
 
@@ -2414,6 +2422,11 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
 
 	swap_m4m4(vc->rv3d->persmat, mat);
 
+	{
+		UnifiedPaintSettings *ups = &ts->unified_paint_settings;
+		ups->pressure_value = pressure;
+	}
+
 	DAG_id_tag_update(ob->data, 0);
 	ED_region_tag_redraw(vc->ar);
 }
@@ -2454,7 +2467,12 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
 			}
 		}
 	}
-	
+
+	{
+		UnifiedPaintSettings *ups = &ts->unified_paint_settings;
+		ups->draw_pressure = false;
+	}
+
 	DAG_id_tag_update(ob->data, 0);
 
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
@@ -2583,9 +2601,8 @@ static int set_vpaint(bContext *C, wmOperator *op)  /* toggle */
 		BKE_paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT);
 	}
 	
-	if (me)
-		/* update modifier stack for mapping requirements */
-		DAG_id_tag_update(&me->id, 0);
+	/* update modifier stack for mapping requirements */
+	DAG_id_tag_update(&me->id, 0);
 	
 	WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
 	
@@ -2735,6 +2752,11 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const fl
 	invert_m4_m4(imat, mat);
 	copy_m3_m4(vpd->vpimat, imat);
 
+	{
+		UnifiedPaintSettings *ups = &ts->unified_paint_settings;
+		ups->draw_pressure = true;
+	}
+
 	return 1;
 }
 
@@ -2844,7 +2866,8 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
 	RNA_float_get_array(itemptr, "mouse", mval);
 
 	view3d_operator_needs_opengl(C);
-			
+	ED_view3d_init_mats_rv3d(ob, vc->rv3d);
+
 	/* load projection matrix */
 	mult_m4_m4m4(mat, vc->rv3d->persmat, ob->obmat);
 
@@ -2889,6 +2912,11 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
 		do_shared_vertexcol(me, do_tessface);
 	}
 
+	{
+		UnifiedPaintSettings *ups = &ts->unified_paint_settings;
+		ups->pressure_value = pressure;
+	}
+
 	ED_region_tag_redraw(vc->ar);
 
 	if (vpd->use_fast_update == FALSE) {
@@ -2920,6 +2948,11 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
 		BLI_memarena_free(vpd->polyfacemap_arena);
 	}
 
+	{
+		UnifiedPaintSettings *ups = &ts->unified_paint_settings;
+		ups->draw_pressure = false;
+	}
+
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
 
 	MEM_freeN(vpd);
@@ -3149,8 +3182,11 @@ static int paint_weight_gradient_modal(bContext *C, wmOperator *op, wmEvent *eve
 		VPaint *wp = ts->wpaint;
 		Object *ob = CTX_data_active_object(C);
 		Mesh *me = ob->data;
-		BKE_defvert_array_copy(me->dvert, wp->wpaint_prev, me->totvert);
-		free_wpaint_prev(wp);
+		if (wp->wpaint_prev) {
+			BKE_defvert_array_free_elems(me->dvert, me->totvert);
+			BKE_defvert_array_copy(me->dvert, wp->wpaint_prev, me->totvert);
+			free_wpaint_prev(wp);
+		}
 
 		DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 		WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
@@ -3167,6 +3203,7 @@ static int paint_weight_gradient_modal(bContext *C, wmOperator *op, wmEvent *eve
 static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
 {
 	wmGesture *gesture = op->customdata;
+	DMGradient_vertStore *vert_cache;
 	struct ARegion *ar = CTX_wm_region(C);
 	Scene *scene = CTX_data_scene(C);
 	Object *ob = CTX_data_active_object(C);
@@ -3177,24 +3214,31 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
 	int y_end = RNA_int_get(op->ptr, "yend");
 	float sco_start[2] = {x_start, y_start};
 	float sco_end[2] = {x_end, y_end};
-
+	const bool is_interactive = (gesture != NULL);
 	DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
 
 	DMGradient_userData data = {0};
 
-	if (gesture->userdata == NULL) {
-		VPaint *wp = scene->toolsettings->wpaint;
+	if (is_interactive) {
+		if (gesture->userdata == NULL) {
+			VPaint *wp = scene->toolsettings->wpaint;
 
-		gesture->userdata = MEM_mallocN(sizeof(DMGradient_vertStore) * me->totvert, __func__);
-		data.is_init = TRUE;
+			gesture->userdata = MEM_mallocN(sizeof(DMGradient_vertStore) * me->totvert, __func__);
+			data.is_init = true;
 
-		copy_wpaint_prev(wp, me->dvert, me->totvert);
+			copy_wpaint_prev(wp, me->dvert, me->totvert);
 
-		/* on init only, convert face -> vert sel  */
-		if (me->editflag & ME_EDIT_PAINT_FACE_SEL) {
-			BKE_mesh_flush_select_from_polys(me);
+			/* on init only, convert face -> vert sel  */
+			if (me->editflag & ME_EDIT_PAINT_FACE_SEL) {
+				BKE_mesh_flush_select_from_polys(me);
+			}
 		}
 
+		vert_cache = gesture->userdata;
+	}
+	else {
+		data.is_init = true;
+		vert_cache = MEM_mallocN(sizeof(DMGradient_vertStore) * me->totvert, __func__);
 	}
 
 	data.ar = ar;
@@ -3205,7 +3249,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
 	data.sco_line_div = 1.0f / len_v2v2(sco_start, sco_end);
 	data.def_nr = ob->actdef - 1;
 	data.use_select = (me->editflag & (ME_EDIT_PAINT_FACE_SEL | ME_EDIT_PAINT_VERT_SEL));
-	data.vert_cache = gesture->userdata;
+	data.vert_cache = vert_cache;
 	data.type = RNA_enum_get(op->ptr, "type");
 
 	{
@@ -3221,6 +3265,10 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
 	DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
 
+	if (is_interactive == false) {
+		MEM_freeN(vert_cache);
+	}
+
 	return OPERATOR_FINISHED;
 }
 
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 2dc4176..3426716 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -56,6 +56,7 @@
 #include "BKE_cdderivedmesh.h"
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
+#include "BKE_image.h"
 #include "BKE_key.h"
 #include "BKE_library.h"
 #include "BKE_mesh.h"
@@ -430,13 +431,22 @@ static void paint_mesh_restore_co(Sculpt *sd, Object *ob)
 
 	BKE_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode);
 
-	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
+	/* Disable OpenMP when dynamic-topology is enabled. Otherwise, new
+	 * entries might be inserted by sculpt_undo_push_node() into the
+	 * GHash used internally by BM_log_original_vert_co() by a
+	 * different thread. [#33787] */
+	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP && !ss->bm)
 	for (n = 0; n < totnode; n++) {
 		SculptUndoNode *unode;
 		SculptUndoType type = (brush->sculpt_tool == SCULPT_TOOL_MASK ?
 							   SCULPT_UNDO_MASK : SCULPT_UNDO_COORDS);
 
-		unode = sculpt_undo_push_node(ob, nodes[n], type);
+		if (ss->bm) {
+			unode = sculpt_undo_push_node(ob, nodes[n], type);
+		}
+		else {
+			unode = sculpt_undo_get_node(nodes[n]);
+		}
 		if (unode) {
 			PBVHVertexIter vd;
 			SculptOrigVertData orig_data;
@@ -649,7 +659,6 @@ static int sculpt_brush_test_cyl(SculptBrushTest *test, float co[3], float locat
 /* ===== Sculpting =====
  *
  */
-  
 
 static float overlapped_curve(Brush *br, float x)
 {
@@ -874,7 +883,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
 
 /* Return a multiplier for brush strength on a particular vertex. */
 static float tex_strength(SculptSession *ss, Brush *br,
-						  const float point[3],
+                          const float point[3],
                           const float len,
                           const float sculpt_normal[3],
                           const short vno[3],
@@ -893,7 +902,7 @@ static float tex_strength(SculptSession *ss, Brush *br,
 		/* Get strength by feeding the vertex 
 		 * location directly into a texture */
 		externtex(mtex, point, &avg,
-		          &jnk, &jnk, &jnk, &jnk, 0);
+		          &jnk, &jnk, &jnk, &jnk, 0, ss->tex_pool);
 	}
 	else if (ss->texcache) {
 		float rotation = -mtex->rot;
@@ -979,7 +988,7 @@ static float tex_strength(SculptSession *ss, Brush *br,
 		x += br->mtex.ofs[0];
 		y += br->mtex.ofs[1];
 
-		avg = paint_get_tex_pixel(br, x, y);
+		avg = paint_get_tex_pixel(br, x, y, ss->tex_pool);
 	}
 
 	avg += br->texture_sample_bias;
@@ -1402,8 +1411,8 @@ static float bmesh_neighbor_average_mask(BMesh *bm, BMVert *v)
 		for (i = 0; i < 3; i++) {
 			BMVert *v2 = adj_v[i];
 			float *vmask = CustomData_bmesh_get(&bm->vdata,
-												v2->head.data,
-												CD_PAINT_MASK);
+			                                    v2->head.data,
+			                                    CD_PAINT_MASK);
 			avg += (*vmask);
 			total++;
 		}
@@ -1414,8 +1423,8 @@ static float bmesh_neighbor_average_mask(BMesh *bm, BMVert *v)
 	}
 	else {
 		float *vmask = CustomData_bmesh_get(&bm->vdata,
-											v->head.data,
-											CD_PAINT_MASK);
+			                                v->head.data,
+			                                CD_PAINT_MASK);
 		return (*vmask);
 	}
 }
@@ -1929,11 +1938,11 @@ static void do_grab_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
 
 			if (sculpt_brush_test(&test, orig_data.co)) {
 				const float fade = bstrength * tex_strength(ss, brush,
-															orig_data.co,
-															test.dist,
+				                                            orig_data.co,
+				                                            test.dist,
 				                                            ss->cache->sculpt_normal_symm,
-															orig_data.no,
-															NULL, vd.mask ? *vd.mask : 0.0f);
+				                                            orig_data.no,
+				                                            NULL, vd.mask ? *vd.mask : 0.0f);
 
 				mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
 
@@ -2068,11 +2077,11 @@ static void do_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
 
 			if (sculpt_brush_test(&test, orig_data.co)) {
 				const float fade = bstrength * tex_strength(ss, brush,
-															orig_data.co,
-															test.dist,
+				                                            orig_data.co,
+				                                            test.dist,
 				                                            ss->cache->sculpt_normal_symm,
 				                                            orig_data.no,
-															NULL, vd.mask ? *vd.mask : 0.0f);
+				                                            NULL, vd.mask ? *vd.mask : 0.0f);
 
 				mul_v3_v3fl(proxy[vd.i], cono, fade);
 
@@ -2126,7 +2135,7 @@ static void do_rotate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
 				                                            test.dist,
 				                                            ss->cache->sculpt_normal_symm,
 				                                            orig_data.no,
-		                                                    NULL, vd.mask ? *vd.mask : 0.0f);
+				                                            NULL, vd.mask ? *vd.mask : 0.0f);
 
 				mul_v3_m4v3(proxy[vd.i], m, orig_data.co);
 				sub_v3_v3(proxy[vd.i], orig_data.co);
@@ -2996,7 +3005,7 @@ static void sculpt_topology_update(Sculpt *sd, Object *ob, Brush *brush)
 
 		if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) {
 			BKE_pbvh_bmesh_update_topology(ss->pbvh, mode,
-										   ss->cache->location,
+			                               ss->cache->location,
 			                               ss->cache->radius);
 		}
 
@@ -3149,7 +3158,7 @@ static void sculpt_combine_proxies(Sculpt *sd, Object *ob)
 			PBVHVertexIter vd;
 			PBVHProxyNode *proxies;
 			int proxy_count;
-			float (*orco)[3];
+			float (*orco)[3] = NULL;
 
 			if (use_orco && !ss->bm)
 				orco = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS)->co;
@@ -3304,7 +3313,7 @@ static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm,
 typedef void (*BrushActionFunc)(Sculpt *sd, Object *ob, Brush *brush);
 
 static void do_radial_symmetry(Sculpt *sd, Object *ob, Brush *brush,
-							   BrushActionFunc action,
+                               BrushActionFunc action,
                                const char symm, const int axis,
                                const float feather)
 {
@@ -3372,11 +3381,17 @@ static void sculpt_update_tex(const Scene *scene, Sculpt *sd, SculptSession *ss)
 		ss->texcache = NULL;
 	}
 
+	if (ss->tex_pool) {
+		BKE_image_pool_free(ss->tex_pool);
+		ss->tex_pool = NULL;
+	}
+
 	/* Need to allocate a bigger buffer for bigger brush size */
 	ss->texcache_side = 2 * radius;
 	if (!ss->texcache || ss->texcache_side > ss->texcache_actual) {
 		ss->texcache = BKE_brush_gen_texture_cache(brush, radius);
 		ss->texcache_actual = ss->texcache_side;
+		ss->tex_pool = BKE_image_pool_new();
 	}
 }
 
@@ -3654,6 +3669,7 @@ static void sculpt_omp_done(SculptSession *ss)
 static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSession *ss, wmOperator *op, const float mouse[2])
 {
 	StrokeCache *cache = MEM_callocN(sizeof(StrokeCache), "stroke cache");
+	UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
 	Brush *brush = paint_brush(&sd->paint);
 	ViewContext *vc = paint_stroke_view_context(op->customdata);
 	Object *ob = CTX_data_active_object(C);
@@ -3762,7 +3778,7 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
 		}
 	}
 
-	cache->special_rotation = (brush->flag & BRUSH_RAKE) ? sd->last_angle : 0;
+	cache->special_rotation = (brush->flag & BRUSH_RAKE) ? ups->last_angle : 0;
 
 	cache->first_time = 1;
 
@@ -3771,7 +3787,7 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
 	sculpt_omp_start(sd, ss);
 }
 
-static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush)
+static void sculpt_update_brush_delta(UnifiedPaintSettings *ups, Object *ob, Brush *brush)
 {
 	SculptSession *ss = ob->sculpt;
 	StrokeCache *cache = ss->cache;
@@ -3836,17 +3852,17 @@ static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush)
 		copy_v3_v3(cache->old_grab_location, grab_location);
 
 		if (tool == SCULPT_TOOL_GRAB)
-			copy_v3_v3(sd->anchored_location, cache->true_location);
+			copy_v3_v3(ups->anchored_location, cache->true_location);
 		else if (tool == SCULPT_TOOL_THUMB)
-			copy_v3_v3(sd->anchored_location, cache->orig_grab_location);
+			copy_v3_v3(ups->anchored_location, cache->orig_grab_location);
 
 		if (ELEM(tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB)) {
 			/* location stays the same for finding vertices in brush radius */
 			copy_v3_v3(cache->true_location, cache->orig_grab_location);
 
-			sd->draw_anchored = 1;
-			copy_v2_v2(sd->anchored_initial_mouse, cache->initial_mouse);
-			sd->anchored_size = cache->pixel_radius;
+			ups->draw_anchored = 1;
+			copy_v2_v2(ups->anchored_initial_mouse, cache->initial_mouse);
+			ups->anchored_size = cache->pixel_radius;
 		}
 	}
 }
@@ -3857,6 +3873,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
                                          PointerRNA *ptr)
 {
 	Scene *scene = CTX_data_scene(C);
+	UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 	SculptSession *ss = ob->sculpt;
 	StrokeCache *cache = ss->cache;
 	Brush *brush = paint_brush(&sd->paint);
@@ -3880,13 +3897,14 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
 	 *      brush coord/pressure/etc.
 	 *      It's more an events design issue, which doesn't split coordinate/pressure/angle
 	 *      changing events. We should avoid this after events system re-design */
-	if (paint_space_stroke_enabled(brush) || cache->first_time)
+	if (paint_supports_dynamic_size(brush) || cache->first_time) {
 		cache->pressure = RNA_float_get(ptr, "pressure");
+	}
 
 	/* Truly temporary data that isn't stored in properties */
 
-	sd->draw_pressure =  1;
-	sd->pressure_value = cache->pressure;
+	ups->draw_pressure =  1;
+	ups->pressure_value = cache->pressure;
 
 	cache->previous_pixel_radius = cache->pixel_radius;
 	cache->pixel_radius = BKE_brush_size_get(scene, brush);
@@ -3903,12 +3921,13 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
 		}
 	}
 
-	if (BKE_brush_use_size_pressure(scene, brush)) {
+	if (BKE_brush_use_size_pressure(scene, brush) && paint_supports_dynamic_size(brush)) {
 		cache->pixel_radius *= cache->pressure;
 		cache->radius = cache->initial_radius * cache->pressure;
 	}
-	else
+	else {
 		cache->radius = cache->initial_radius;
+	}
 
 	cache->radius_squared = cache->radius * cache->radius;
 
@@ -3932,7 +3951,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
 		const float dx = cache->mouse[0] - cache->initial_mouse[0];
 		const float dy = cache->mouse[1] - cache->initial_mouse[1];
 
-		sd->anchored_size = cache->pixel_radius = sqrt(dx * dx + dy * dy);
+		ups->anchored_size = cache->pixel_radius = sqrt(dx * dx + dy * dy);
 
 		cache->special_rotation = atan2(dx, dy) + M_PI;
 
@@ -3944,27 +3963,27 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
 			halfway[1] = dy * 0.5f + cache->initial_mouse[1];
 
 			if (sculpt_stroke_get_location(C, out, halfway)) {
-				copy_v3_v3(sd->anchored_location, out);
-				copy_v2_v2(sd->anchored_initial_mouse, halfway);
+				copy_v3_v3(ups->anchored_location, out);
+				copy_v2_v2(ups->anchored_initial_mouse, halfway);
 				copy_v2_v2(cache->tex_mouse, halfway);
-				copy_v3_v3(cache->true_location, sd->anchored_location);
-				sd->anchored_size /= 2.0f;
+				copy_v3_v3(cache->true_location, ups->anchored_location);
+				ups->anchored_size /= 2.0f;
 				cache->pixel_radius  /= 2.0f;
 				hit = 1;
 			}
 		}
 
 		if (!hit)
-			copy_v2_v2(sd->anchored_initial_mouse, cache->initial_mouse);
+			copy_v2_v2(ups->anchored_initial_mouse, cache->initial_mouse);
 
 		cache->radius = paint_calc_object_space_radius(paint_stroke_view_context(stroke),
 		                                               cache->true_location,
 		                                               cache->pixel_radius);
 		cache->radius_squared = cache->radius * cache->radius;
 
-		copy_v3_v3(sd->anchored_location, cache->true_location);
+		copy_v3_v3(ups->anchored_location, cache->true_location);
 
-		sd->draw_anchored = 1;
+		ups->draw_anchored = 1;
 	}
 	else if (brush->flag & BRUSH_RAKE) {
 		const float u = 0.5f;
@@ -3985,7 +4004,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
 		}
 	}
 
-	sculpt_update_brush_delta(sd, ob, brush);
+	sculpt_update_brush_delta(ups, ob, brush);
 
 	if (brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
 		const float dx = cache->mouse[0] - cache->initial_mouse[0];
@@ -3993,13 +4012,13 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
 
 		cache->vertex_rotation = -atan2f(dx, dy) * cache->bstrength;
 
-		sd->draw_anchored = 1;
-		copy_v2_v2(sd->anchored_initial_mouse, cache->initial_mouse);
-		copy_v3_v3(sd->anchored_location, cache->true_location);
-		sd->anchored_size = cache->pixel_radius;
+		ups->draw_anchored = 1;
+		copy_v2_v2(ups->anchored_initial_mouse, cache->initial_mouse);
+		copy_v3_v3(ups->anchored_location, cache->true_location);
+		ups->anchored_size = cache->pixel_radius;
 	}
 
-	sd->special_rotation = cache->special_rotation;
+	ups->special_rotation = cache->special_rotation;
 }
 
 /* Returns true iff any of the smoothing modes are active (currently
@@ -4058,7 +4077,7 @@ static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin)
 		}
 
 		if (BKE_pbvh_node_raycast(srd->ss->pbvh, node, origco, use_origco,
-								  srd->ray_start, srd->ray_normal, &srd->dist))
+		                          srd->ray_start, srd->ray_normal, &srd->dist))
 		{
 			srd->hit = 1;
 			*tmin = srd->dist;
@@ -4172,6 +4191,17 @@ static void sculpt_restore_mesh(Sculpt *sd, Object *ob)
 	}
 }
 
+/* Copy the PBVH bounding box into the object's bounding box */
+static void sculpt_update_object_bounding_box(Object *ob)
+{
+	if (ob->bb) {
+		float bb_min[3], bb_max[3];
+
+		BKE_pbvh_bounding_box(ob->sculpt->pbvh, bb_min, bb_max);
+		BKE_boundbox_init_from_minmax(ob->bb, bb_min, bb_max);
+	}
+}
+
 static void sculpt_flush_update(bContext *C)
 {
 	Object *ob = CTX_data_active_object(C);
@@ -4192,6 +4222,11 @@ static void sculpt_flush_update(bContext *C)
 		rcti r;
 
 		BKE_pbvh_update(ss->pbvh, PBVH_UpdateBB, NULL);
+		/* Update the object's bounding box too so that the object
+		 * doesn't get incorrectly clipped during drawing in
+		 * draw_mesh_object(). [#33790] */
+		sculpt_update_object_bounding_box(ob);
+
 		if (sculpt_get_redraw_rect(ar, CTX_wm_region_view3d(C), ob, &r)) {
 			if (ss->cache)
 				ss->cache->previous_r = r;
@@ -4289,6 +4324,7 @@ static void sculpt_brush_exit_tex(Sculpt *sd)
 
 static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(stroke))
 {
+	UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
 	Object *ob = CTX_data_active_object(C);
 	SculptSession *ss = ob->sculpt;
 	Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
@@ -4296,9 +4332,9 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
 	sculpt_omp_done(ss);
 
 	/* reset values used to draw brush after completing the stroke */
-	sd->draw_anchored = 0;
-	sd->draw_pressure = 0;
-	sd->special_rotation = 0;
+	ups->draw_anchored = 0;
+	ups->draw_pressure = 0;
+	ups->special_rotation = 0;
 
 	/* Finished */
 	if (ss->cache) {
@@ -4495,7 +4531,7 @@ static void SCULPT_OT_set_persistent_base(wmOperatorType *ot)
 
 static void sculpt_dynamic_topology_triangulate(BMesh *bm)
 {
-	BMO_op_callf(bm, BMO_FLAG_DEFAULTS, "triangulate faces=%af");
+	BM_mesh_triangulate(bm, false, false, NULL, NULL);
 }
 
 void sculpt_pbvh_clear(Object *ob)
@@ -4539,6 +4575,7 @@ void sculpt_dynamic_topology_enable(bContext *C)
 	ss->bm = BM_mesh_create(&bm_mesh_allocsize_default);
 
 	BM_mesh_bm_from_me(ss->bm, me, TRUE, ob->shapenr);
+	BM_mesh_normals_update(ss->bm, false);
 	sculpt_dynamic_topology_triangulate(ss->bm);
 	BM_data_layer_add(ss->bm, &ss->bm->vdata, CD_PAINT_MASK);
 	BM_mesh_normals_update(ss->bm, TRUE);
@@ -4628,24 +4665,25 @@ static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(o
 }
 
 static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op,
-												 wmEvent *UNUSED(event))
+                                                 wmEvent *UNUSED(event))
 {
 	Object *ob = CTX_data_active_object(C);
 	Mesh *me = ob->data;
 	SculptSession *ss = ob->sculpt;
 	const char *msg = "Dynamic-topology sculpting will not preserve"
-		              "vertex colors, UVs, or other customdata";
+	                  "vertex colors, UVs, or other customdata";
 
 	if (!ss->bm) {
 		int i;
 
 		for (i = 0; i < CD_NUMTYPES; i++) {
 			if (!ELEM7(i, CD_MVERT, CD_MEDGE, CD_MFACE,
-					   CD_MLOOP, CD_MPOLY, CD_PAINT_MASK,
-					   CD_ORIGINDEX) &&
-				(CustomData_has_layer(&me->vdata, i) ||
-				 CustomData_has_layer(&me->edata, i) ||
-				 CustomData_has_layer(&me->fdata, i))) {
+			           CD_MLOOP, CD_MPOLY, CD_PAINT_MASK,
+			           CD_ORIGINDEX) &&
+			    (CustomData_has_layer(&me->vdata, i) ||
+			     CustomData_has_layer(&me->edata, i) ||
+			     CustomData_has_layer(&me->fdata, i)))
+			{
 				/* The mesh has customdata that will be lost, let the
 				 * user confirm this is OK */
 				return WM_operator_confirm_message(C, op, msg);
@@ -4726,8 +4764,8 @@ static int sculpt_symmetrize_exec(bContext *C, wmOperator *UNUSED(op))
 
 	/* Symmetrize and re-triangulate */
 	BMO_op_callf(ss->bm, BMO_FLAG_DEFAULTS,
-				 "symmetrize input=%avef direction=%i",
-				 sd->symmetrize_direction);
+	             "symmetrize input=%avef direction=%i",
+	             sd->symmetrize_direction);
 	sculpt_dynamic_topology_triangulate(ss->bm);
 
 	/* Finish undo */
@@ -4869,6 +4907,12 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
 		/* Enter sculptmode */
 		ob->mode |= OB_MODE_SCULPT;
 
+		/* Remove dynamic-topology flag; this will be enabled if the
+		 * file was saved with dynamic topology on, but we don't
+		 * automatically re-enter dynamic-topology mode when loading a
+		 * file. */
+		me->flag &= ~ME_SCULPT_DYNAMIC_TOPOLOGY;
+
 		if (flush_recalc)
 			DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index e56962a..fa1bdd6 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -73,7 +73,7 @@ void sculpt_pbvh_clear(Object *ob);
 void sculpt_update_after_dynamic_topology_toggle(bContext *C);
 void sculpt_dynamic_topology_enable(struct bContext *C);
 void sculpt_dynamic_topology_disable(struct bContext *C,
-									 struct SculptUndoNode *unode);
+                                     struct SculptUndoNode *unode);
 
 /* Undo */
 
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index aaa1328..eb138bf 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -264,7 +264,7 @@ static void SOUND_OT_update_animation_flags(wmOperatorType *ot)
 	 */
 
 	/* identifiers */
-	ot->name = "Update animation";
+	ot->name = "Update Animation";
 	ot->description = "Update animation flags";
 	ot->idname = "SOUND_OT_update_animation_flags";
 
@@ -300,7 +300,7 @@ static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op))
 static void SOUND_OT_bake_animation(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Update animation cache";
+	ot->name = "Update Animation Cache";
 	ot->description = "Update the audio animation cache";
 	ot->idname = "SOUND_OT_bake_animation";
 
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index a80d425..7e99e6c 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -53,6 +53,7 @@
 #include "BKE_action.h"
 #include "BKE_fcurve.h"
 #include "BKE_global.h"
+#include "BKE_main.h"
 #include "BKE_nla.h"
 #include "BKE_context.h"
 #include "BKE_report.h"
@@ -104,8 +105,10 @@ static int act_new_exec(bContext *C, wmOperator *UNUSED(op))
 			action = BKE_action_copy(oldact);
 		}
 		else {
+			Main *bmain = CTX_data_main(C);
+
 			/* just make a new (empty) action */
-			action = add_empty_action("Action");
+			action = add_empty_action(bmain, "Action");
 		}
 		
 		/* when creating new ID blocks, use is already 1 (fake user), 
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index d0f76c2..964a6a2 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -259,12 +259,35 @@ static void borderselect_action(bAnimContext *ac, rcti rect, short mode, short s
 		    !((ymax < rectf.ymin) || (ymin > rectf.ymax)))
 		{
 			/* loop over data selecting */
-			if (ale->type == ANIMTYPE_GPLAYER)
-				ED_gplayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
-			else if (ale->type == ANIMTYPE_MASKLAYER)
-				ED_masklayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
-			else
-				ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
+			switch (ale->type) {
+				case ANIMTYPE_GPDATABLOCK:
+				{
+					bGPdata *gpd = ale->data;
+					bGPDlayer *gpl;
+					for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+						ED_gplayer_frames_select_border(gpl, rectf.xmin, rectf.xmax, selectmode);
+					}
+					break;
+				}
+				case ANIMTYPE_GPLAYER:
+					ED_gplayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
+					break;
+				case ANIMTYPE_MASKDATABLOCK:
+				{
+					Mask *mask = ale->data;
+					MaskLayer *masklay;
+					for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
+						ED_masklayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
+					}
+					break;
+				}
+				case ANIMTYPE_MASKLAYER:
+					ED_masklayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode);
+					break;
+				default:
+					ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
+					break;
+			}
 		}
 		
 		/* set minimum extent to be the maximum of the next channel */
@@ -944,6 +967,7 @@ static void actkeys_mselect_single(bAnimContext *ac, bAnimListElem *ale, short s
 				else if (ale->type == ANIMTYPE_MASKLAYER)
 					ED_mask_select_frame(ale->data, selx, select_mode);
 			}
+			BLI_freelistN(&anim_data);
 		}
 		else {
 			ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 2a5b64c..0bdae9e 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -36,6 +36,8 @@
 #include "BLI_listbase.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "DNA_armature_types.h"
 #include "DNA_lamp_types.h"
 #include "DNA_material_types.h"
@@ -1028,7 +1030,8 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
 
 	block = uiLayoutGetBlock(row);
 	uiBlockSetEmboss(block, UI_EMBOSSN);
-	but = uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed");
+	but = uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag,
+	                       0, 0, 0, 0, IFACE_("Follow context or keep fixed datablock displayed"));
 	uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
 	uiButSetFunc(but, pin_cb, NULL, NULL);
 
@@ -1068,7 +1071,7 @@ void buttons_context_register(ARegionType *art)
 
 	pt = MEM_callocN(sizeof(PanelType), "spacetype buttons panel context");
 	strcpy(pt->idname, "BUTTONS_PT_context");
-	strcpy(pt->label, "Context");
+	strcpy(pt->label, N_("Context"));  /* XXX C panels are not available through RNA (bpy.types)! */
 	pt->draw = buttons_panel_context;
 	pt->flag = PNL_NO_HEADER;
 	BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c
index ebba7d9..ae7026a 100644
--- a/source/blender/editors/space_buttons/buttons_header.c
+++ b/source/blender/editors/space_buttons/buttons_header.c
@@ -97,14 +97,15 @@ static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event)
 	sbuts->mainbuser = sbuts->mainb;
 }
 
-#define BUT_UNIT_X (UI_UNIT_X + 2)
+#define BUT_UNIT_X (UI_UNIT_X + 2 * U.pixelsize)
 
 void buttons_header_buttons(const bContext *C, ARegion *ar)
 {
 	SpaceButs *sbuts = CTX_wm_space_buts(C);
 	uiBlock *block;
 	uiBut *but;
-	int xco, yco = 2;
+	int headery = ED_area_headersize();
+	int xco, yco = 0.5f * (headery - UI_UNIT_Y);
 
 	buttons_context_compute(C, sbuts);
 	
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index d40426a..8b6682f 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -40,6 +40,8 @@
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
@@ -70,7 +72,7 @@ static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(e
 
 	RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr);
 
-	pup = uiPupMenuBegin(C, "Align", ICON_NONE);
+	pup = uiPupMenuBegin(C, IFACE_("Align"), ICON_NONE);
 	layout = uiPupMenuLayout(pup);
 	uiItemsEnumR(layout, &ptr, "align");
 	uiPupMenuEnd(C, pup);
@@ -112,14 +114,22 @@ static int file_browse_exec(bContext *C, wmOperator *op)
 	/* add slash for directories, important for some properties */
 	if (RNA_property_subtype(fbo->prop) == PROP_DIRPATH) {
 		char name[FILE_MAX];
-		
+		int is_relative = RNA_boolean_get(op->ptr, "relative_path");
 		id = fbo->ptr.id.data;
 
 		BLI_strncpy(path, str, FILE_MAX);
 		BLI_path_abs(path, id ? ID_BLEND_PATH(G.main, id) : G.main->name);
 		
 		if (BLI_is_dir(path)) {
-			str = MEM_reallocN(str, strlen(str) + 2);
+			if (is_relative) {
+				BLI_strncpy(path, str, FILE_MAX);
+				BLI_path_rel(path, G.main->name);
+				str = MEM_reallocN(str, strlen(path) + 2);
+				BLI_strncpy(str, path, FILE_MAX);
+			}
+			else {
+				str = MEM_reallocN(str, strlen(str) + 2);
+			}
 			BLI_add_slash(str);
 		}
 		else
diff --git a/source/blender/editors/space_clip/CMakeLists.txt b/source/blender/editors/space_clip/CMakeLists.txt
index 75e3d8d..e09a8b4 100644
--- a/source/blender/editors/space_clip/CMakeLists.txt
+++ b/source/blender/editors/space_clip/CMakeLists.txt
@@ -57,4 +57,8 @@ set(SRC
 	clip_intern.h
 )
 
+if(WITH_INTERNATIONAL)
+	add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
 blender_add_lib(bf_editor_space_clip "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_clip/SConscript b/source/blender/editors/space_clip/SConscript
index 2cbefee..c65a076 100644
--- a/source/blender/editors/space_clip/SConscript
+++ b/source/blender/editors/space_clip/SConscript
@@ -32,4 +32,7 @@ defs = []
 incs = '../include ../../blenkernel ../../blenloader ../../blenfont ../../blenlib ../../imbuf ../../makesdna'
 incs += ' ../../makesrna ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../gpu'
 
+if env['WITH_BF_INTERNATIONAL']:
+    defs.append('WITH_INTERNATIONAL')
+
 env.BlenderLib ( 'bf_editors_space_clip', sources, Split(incs), defs, libtype=['core'], priority=[95] )
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c
index 2cb6d8c..e442de2 100644
--- a/source/blender/editors/space_clip/clip_buttons.c
+++ b/source/blender/editors/space_clip/clip_buttons.c
@@ -43,6 +43,8 @@
 #include "BLI_listbase.h"
 #include "BLI_rect.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
 #include "BKE_screen.h"
@@ -124,7 +126,7 @@ void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
 
 		row = uiLayoutRow(layout, FALSE);
 		block = uiLayoutGetBlock(row);
-		uiDefBut(block, LABEL, 0, "File Path:", 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
+		uiDefBut(block, LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
 
 		row = uiLayoutRow(layout, FALSE);
 		split = uiLayoutSplit(row, 0.0f, FALSE);
@@ -387,9 +389,9 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
 		block = uiLayoutGetBlock(layout);
 
 		if (cb->marker_flag & MARKER_DISABLED)
-			tip = "Marker is disabled at current frame";
+			tip = TIP_("Marker is disabled at current frame");
 		else
-			tip = "Marker is enabled at current frame";
+			tip = TIP_("Marker is enabled at current frame");
 
 		bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20,
 		                      &cb->marker_flag, 0, 0, 1, 0, tip);
@@ -405,7 +407,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
 		if (track->flag & TRACK_LOCKED) {
 			uiLayoutSetActive(layout, FALSE);
 			block = uiLayoutAbsoluteBlock(layout);
-			uiDefBut(block, LABEL, 0, "Track is locked", 0, 0, 300, 19, NULL, 0, 0, 0, 0, "");
+			uiDefBut(block, LABEL, 0, IFACE_("Track is locked"), 0, 0, 300, 19, NULL, 0, 0, 0, 0, "");
 
 			return;
 		}
@@ -434,12 +436,12 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
 		uiBlockSetNFunc(block, marker_update_cb, cb, NULL);
 
 		if (cb->marker_flag & MARKER_DISABLED)
-			tip = "Marker is disabled at current frame";
+			tip = TIP_("Marker is disabled at current frame");
 		else
-			tip = "Marker is enabled at current frame";
+			tip = TIP_("Marker is enabled at current frame");
 
-		uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG,  "Enabled", 10, 190, 145, 19, &cb->marker_flag,
-		             0, 0, 0, 0, tip);
+		uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 10, 190, 145, 19,
+		             &cb->marker_flag, 0, 0, 0, 0, tip);
 
 		col = uiLayoutColumn(layout, TRUE);
 		uiLayoutSetActive(col, (cb->marker_flag & MARKER_DISABLED) == 0);
@@ -447,33 +449,34 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
 		block = uiLayoutAbsoluteBlock(col);
 		uiBlockBeginAlign(block);
 
-		uiDefBut(block, LABEL, 0, "Position:", 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
-		uiDefButF(block, NUM, B_MARKER_POS, "X:", 10, 171, 145, 19, &cb->marker_pos[0],
-		          -10 * width, 10.0 * width, step, digits, "X-position of marker at frame in screen coordinates");
-		uiDefButF(block, NUM, B_MARKER_POS, "Y:", 165, 171, 145, 19, &cb->marker_pos[1],
-		          -10 * height, 10.0 * height, step, digits, "Y-position of marker at frame in screen coordinates");
-
-		uiDefBut(block, LABEL, 0, "Offset:", 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
-		uiDefButF(block, NUM, B_MARKER_OFFSET, "X:", 10, 133, 145, 19, &cb->track_offset[0],
-		          -10 * width, 10.0 * width, step, digits, "X-offset to parenting point");
-		uiDefButF(block, NUM, B_MARKER_OFFSET, "Y:", 165, 133, 145, 19, &cb->track_offset[1],
-		          -10 * height, 10.0 * height, step, digits, "Y-offset to parenting point");
-
-		uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
-		uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Width:", 10, 95, 300, 19, &cb->marker_pat[0], 3.0f,
-		          10.0 * width, step, digits, "Width of marker's pattern in screen coordinates");
-		uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Height:", 10, 76, 300, 19, &cb->marker_pat[1], 3.0f,
-		          10.0 * height, step, digits, "Height of marker's pattern in screen coordinates");
-
-		uiDefBut(block, LABEL, 0, "Search Area:", 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
-		uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "X:", 10, 38, 145, 19, &cb->marker_search_pos[0],
-		          -width, width, step, digits, "X-position of search at frame relative to marker's position");
-		uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "Y:", 165, 38, 145, 19, &cb->marker_search_pos[1],
-		          -height, height, step, digits, "X-position of search at frame relative to marker's position");
-		uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Width:", 10, 19, 300, 19, &cb->marker_search[0], 3.0f,
-		          10.0 * width, step, digits, "Width of marker's search in screen soordinates");
-		uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Height:", 10, 0, 300, 19, &cb->marker_search[1], 3.0f,
-		          10.0 * height, step, digits, "Height of marker's search in screen soordinates");
+		uiDefBut(block, LABEL, 0, IFACE_("Position:"), 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
+		uiDefButF(block, NUM, B_MARKER_POS, IFACE_("X:"), 10, 171, 145, 19, &cb->marker_pos[0],
+		          -10 * width, 10.0 * width, step, digits, TIP_("X-position of marker at frame in screen coordinates"));
+		uiDefButF(block, NUM, B_MARKER_POS, IFACE_("Y:"), 165, 171, 145, 19, &cb->marker_pos[1],
+		          -10 * height, 10.0 * height, step, digits,
+		          TIP_("Y-position of marker at frame in screen coordinates"));
+
+		uiDefBut(block, LABEL, 0, IFACE_("Offset:"), 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
+		uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("X:"), 10, 133, 145, 19, &cb->track_offset[0],
+		          -10 * width, 10.0 * width, step, digits, TIP_("X-offset to parenting point"));
+		uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("Y:"), 165, 133, 145, 19, &cb->track_offset[1],
+		          -10 * height, 10.0 * height, step, digits, TIP_("Y-offset to parenting point"));
+
+		uiDefBut(block, LABEL, 0, IFACE_("Pattern Area:"), 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
+		uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 10, 95, 300, 19, &cb->marker_pat[0], 3.0f,
+		          10.0 * width, step, digits, TIP_("Width of marker's pattern in screen coordinates"));
+		uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 10, 76, 300, 19, &cb->marker_pat[1], 3.0f,
+		          10.0 * height, step, digits, TIP_("Height of marker's pattern in screen coordinates"));
+
+		uiDefBut(block, LABEL, 0, IFACE_("Search Area:"), 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
+		uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 10, 38, 145, 19, &cb->marker_search_pos[0],
+		          -width, width, step, digits, TIP_("X-position of search at frame relative to marker's position"));
+		uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 165, 38, 145, 19, &cb->marker_search_pos[1],
+		          -height, height, step, digits, TIP_("Y-position of search at frame relative to marker's position"));
+		uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 10, 19, 300, 19, &cb->marker_search[0], 3.0f,
+		          10.0 * width, step, digits, TIP_("Width of marker's search in screen coordinates"));
+		uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 10, 0, 300, 19, &cb->marker_search[1], 3.0f,
+		          10.0 * height, step, digits, TIP_("Height of marker's search in screen coordinates"));
 
 		uiBlockEndAlign(block);
 	}
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index cc1b8d4..09d97c3 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -159,7 +159,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 		MovieTrackingDopesheetChannel *channel;
 		float y, xscale, yscale;
 		float strip[4], selected_strip[4];
-		float height = (dopesheet->tot_channel * CHANNEL_STEP) + (CHANNEL_HEIGHT * 2);
+		float height = (dopesheet->tot_channel * CHANNEL_STEP) + (CHANNEL_HEIGHT);
 
 		/* don't use totrect set, as the width stays the same
 		 * (NOTE: this is ok here, the configuration is pretty straightforward)
@@ -272,7 +272,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
 
 	tracking = &clip->tracking;
 	dopesheet = &tracking->dopesheet;
-	height = (dopesheet->tot_channel * CHANNEL_STEP) + (CHANNEL_HEIGHT * 2);
+	height = (dopesheet->tot_channel * CHANNEL_STEP) + (CHANNEL_HEIGHT);
 
 	if (height > BLI_rcti_size_y(&v2d->mask)) {
 		/* don't use totrect set, as the width stays the same
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 04154a2..728110d 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -33,13 +33,6 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "BKE_main.h"
-#include "BKE_mask.h"
-#include "BKE_movieclip.h"
-#include "BKE_context.h"
-#include "BKE_tracking.h"
-#include "BKE_library.h"
-
 #include "DNA_mask_types.h"
 #include "DNA_object_types.h"	/* SELECT */
 
@@ -48,6 +41,13 @@
 #include "BLI_string.h"
 #include "BLI_rect.h"
 
+#include "BKE_main.h"
+#include "BKE_mask.h"
+#include "BKE_movieclip.h"
+#include "BKE_context.h"
+#include "BKE_tracking.h"
+#include "BKE_library.h"
+
 #include "GPU_extensions.h"
 
 #include "IMB_imbuf_types.h"
@@ -618,7 +618,7 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf, const unsign
 	context->last_texture = glaGetOneInteger(GL_TEXTURE_2D);
 
 	/* image texture need to be rebinded if displaying another image buffer
-	 * assuming displaying happens of footage frames only on which painting doesn't heppen.
+	 * assuming displaying happens of footage frames only on which painting doesn't happen.
 	 * so not changed image buffer pointer means unchanged image content */
 	need_rebind |= context->texture_ibuf != ibuf;
 	need_rebind |= context->display_buffer != display_buffer;
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 26bae6e..dfb69be 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -160,6 +160,7 @@ static int open_exec(bContext *C, wmOperator *op)
 {
 	SpaceClip *sc = CTX_wm_space_clip(C);
 	bScreen *screen = CTX_wm_screen(C);
+	Main *bmain = CTX_data_main(C);
 	PropertyPointerRNA *pprop;
 	PointerRNA idptr;
 	MovieClip *clip = NULL;
@@ -191,7 +192,7 @@ static int open_exec(bContext *C, wmOperator *op)
 
 	errno = 0;
 
-	clip = BKE_movieclip_file_add(str);
+	clip = BKE_movieclip_file_add(bmain, str);
 
 	if (!clip) {
 		if (op->customdata)
@@ -908,7 +909,7 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
 void CLIP_OT_change_frame(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Change frame";
+	ot->name = "Change Frame";
 	ot->idname = "CLIP_OT_change_frame";
 	ot->description = "Interactively change the current frame number";
 
diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c
index 1bdf521..7543988 100644
--- a/source/blender/editors/space_clip/clip_toolbar.c
+++ b/source/blender/editors/space_clip/clip_toolbar.c
@@ -33,11 +33,15 @@
 
 #include "DNA_windowmanager_types.h"
 
+#include "RNA_access.h"
+
 #include "MEM_guardedalloc.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_screen.h"
 
@@ -197,16 +201,16 @@ static void clip_panel_operator_redo_header(const bContext *C, Panel *pa)
 	wmOperator *op = WM_operator_last_redo(C);
 
 	if (op)
-		BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
+		BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname));
 	else
-		BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname));
+		BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname));
 }
 
 static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op)
 {
 	if (op->type->flag & OPTYPE_MACRO) {
 		for (op = op->macro.first; op; op = op->next) {
-			uiItemL(pa->layout, op->type->name, ICON_NONE);
+			uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE);
 			clip_panel_operator_redo_operator(C, pa, op);
 		}
 	}
@@ -219,23 +223,32 @@ static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOp
 static void clip_panel_operator_redo(const bContext *C, Panel *pa)
 {
 	wmOperator *op = WM_operator_last_redo(C);
-	uiBlock *block;
+	ARegion *ar;
+	ARegion *ar1;
 
 	if (op == NULL)
 		return;
 
-	if (WM_operator_poll((bContext *)C, op->type) == 0)
-		return;
+	/* keep in sync with logic in ED_undo_operator_repeat() */
+	ar = CTX_wm_region(C);
+	ar1 = BKE_area_find_region_type(CTX_wm_area(C), RGN_TYPE_WINDOW);
+	if (ar1)
+		CTX_wm_region_set((bContext *)C, ar1);
 
-	block = uiLayoutGetBlock(pa->layout);
+	if (WM_operator_poll((bContext *)C, op->type)) {
+		uiBlock *block = uiLayoutGetBlock(pa->layout);
 
-	if (!WM_operator_check_ui_enabled(C, op->type->name))
-		uiLayoutSetEnabled(pa->layout, FALSE);
+		if (!WM_operator_check_ui_enabled(C, op->type->name))
+			uiLayoutSetEnabled(pa->layout, FALSE);
 
-	/* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */
-	uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op);
+		/* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */
+		uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op);
+
+		clip_panel_operator_redo_operator(C, pa, op);
+	}
 
-	clip_panel_operator_redo_operator(C, pa, op);
+	/* set region back */
+	CTX_wm_region_set((bContext *)C, ar);
 }
 
 void ED_clip_tool_props_register(ARegionType *art)
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 9d04213..f0c0e7b 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -1282,6 +1282,9 @@ static void clip_channels_area_init(wmWindowManager *wm, ARegion *ar)
 {
 	wmKeyMap *keymap;
 
+	/* ensure the 2d view sync works - main region has bottom scroller */
+	ar->v2d.scroll = V2D_SCROLL_BOTTOM;
+
 	UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
 
 	keymap = WM_keymap_find(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
@@ -1293,7 +1296,6 @@ static void clip_channels_area_draw(const bContext *C, ARegion *ar)
 	SpaceClip *sc = CTX_wm_space_clip(C);
 	MovieClip *clip = ED_space_clip_get_clip(sc);
 	View2D *v2d = &ar->v2d;
-	View2DScrollers *scrollers;
 
 	if (clip)
 		BKE_tracking_dopesheet_update(&clip->tracking);
@@ -1309,11 +1311,6 @@ static void clip_channels_area_draw(const bContext *C, ARegion *ar)
 
 	/* reset view matrix */
 	UI_view2d_view_restore(C);
-
-	/* scrollers */
-	scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
-	UI_view2d_scrollers_draw(C, v2d, scrollers);
-	UI_view2d_scrollers_free(scrollers);
 }
 
 static void clip_channels_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 56a890c..77ed197 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1105,7 +1105,7 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo
 {
 	TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
 	int framenr = tmj->sfra;
-	//double t = PIL_check_seconds_timer();
+	// double t = PIL_check_seconds_timer();
 
 	while (framenr != tmj->efra) {
 		if (tmj->delay > 0) {
@@ -1141,7 +1141,7 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo
 			break;
 	}
 
-	//printf("Tracking time: %lf\n", PIL_check_seconds_timer()-t);
+	// printf("Tracking time: %lf\n", PIL_check_seconds_timer()-t);
 }
 
 static void track_markers_updatejob(void *tmv)
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index 22c260d..7374723 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -158,9 +158,9 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha
 	if (tvc->iter_index == 0) {
 		const SpaceConsole *sc = (SpaceConsole *)tvc->arg1;
 		const ConsoleLine *cl = (ConsoleLine *)sc->history.last;
-		const int prompt_len = strlen(sc->prompt);
-		const int cursor_loc = cl->cursor + prompt_len;
-		const int line_len = cl->len + prompt_len;
+		const int prompt_len = BLI_strlen_utf8(sc->prompt);
+		const int cursor_loc = BLI_strnlen_utf8(cl->line, cl->cursor) + prompt_len;
+		const int line_len = BLI_strlen_utf8(cl->line) + prompt_len;
 		int xy[2] = {CONSOLE_DRAW_MARGIN, CONSOLE_DRAW_MARGIN};
 		int pen[2];
 		xy[1] += tvc->lheight / 6;
@@ -193,6 +193,10 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha
 	return TVC_LINE_FG;
 }
 
+static void console_textview_const_colors(TextViewContext *UNUSED(tvc), unsigned char bg_sel[4])
+{
+	UI_GetThemeColor4ubv(TH_CONSOLE_SELECT, bg_sel);
+}
 
 static int console_textview_main__internal(struct SpaceConsole *sc, ARegion *ar, int draw,
                                            int mval[2], void **mouse_pick, int *pos_pick)
@@ -210,6 +214,7 @@ static int console_textview_main__internal(struct SpaceConsole *sc, ARegion *ar,
 	tvc.step = console_textview_step;
 	tvc.line_get = console_textview_line_get;
 	tvc.line_color = console_textview_line_color;
+	tvc.const_colors = console_textview_const_colors;
 
 	tvc.arg1 = sc;
 	tvc.arg2 = NULL;
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 36716ae..1242d12 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -34,11 +34,12 @@
 
 #include "DNA_userdef_types.h"
 
+#include "BLI_utildefines.h"
 #include "BLI_listbase.h"
 #include "BLI_string_cursor_utf8.h"
+#include "BLI_string_utf8.h"
 #include "BLI_string.h"
 #include "BLI_dynstr.h"
-#include "BLI_utildefines.h"
 #include "BLI_math.h"
 
 #include "BKE_context.h"
@@ -283,28 +284,28 @@ static int console_move_exec(bContext *C, wmOperator *op)
 			pos = ci->cursor;
 			BLI_str_cursor_step_utf8(ci->line, ci->len,
 			                         &pos, STRCUR_DIR_PREV,
-			                         STRCUR_JUMP_ALL);
+			                         STRCUR_JUMP_ALL, true);
 			done = console_line_cursor_set(ci, pos);
 			break;
 		case LINE_END:
 			pos = ci->cursor;
 			BLI_str_cursor_step_utf8(ci->line, ci->len,
 			                         &pos, STRCUR_DIR_NEXT,
-			                         STRCUR_JUMP_ALL);
+			                         STRCUR_JUMP_ALL, true);
 			done = console_line_cursor_set(ci, pos);
 			break;
 		case PREV_CHAR:
 			pos = ci->cursor;
 			BLI_str_cursor_step_utf8(ci->line, ci->len,
 			                         &pos, STRCUR_DIR_PREV,
-			                         STRCUR_JUMP_NONE);
+			                         STRCUR_JUMP_NONE, true);
 			done = console_line_cursor_set(ci, pos);
 			break;
 		case NEXT_CHAR:
 			pos = ci->cursor;
 			BLI_str_cursor_step_utf8(ci->line, ci->len,
 			                         &pos, STRCUR_DIR_NEXT,
-			                         STRCUR_JUMP_NONE);
+			                         STRCUR_JUMP_NONE, true);
 			done = console_line_cursor_set(ci, pos);
 			break;
 
@@ -314,14 +315,14 @@ static int console_move_exec(bContext *C, wmOperator *op)
 			pos = ci->cursor;
 			BLI_str_cursor_step_utf8(ci->line, ci->len,
 			                         &pos, STRCUR_DIR_PREV,
-			                         STRCUR_JUMP_DELIM);
+			                         STRCUR_JUMP_DELIM, true);
 			done = console_line_cursor_set(ci, pos);
 			break;
 		case NEXT_WORD:
 			pos = ci->cursor;
 			BLI_str_cursor_step_utf8(ci->line, ci->len,
 			                         &pos, STRCUR_DIR_NEXT,
-			                         STRCUR_JUMP_DELIM);
+			                         STRCUR_JUMP_DELIM, true);
 			done = console_line_cursor_set(ci, pos);
 			break;
 	}
@@ -393,15 +394,26 @@ static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
 	// if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
 	if (!RNA_string_length(op->ptr, "text")) {
-		/* if alt/ctrl/super are pressed pass through */
-		if (event->ctrl || event->oskey) {
+		/* if alt/ctrl/super are pressed pass through except for utf8 character event
+		 * (when input method are used for utf8 inputs, the user may assign key event
+		 * including alt/ctrl/super like ctrl+m to commit utf8 string.  in such case,
+		 * the modifiers in the utf8 character event make no sense.) */
+		if ((event->ctrl || event->oskey) && !event->utf8_buf[0]) {
 			return OPERATOR_PASS_THROUGH;
 		}
 		else {
-			char str[2];
-			str[0] = event->ascii;
-			str[1] = '\0';
-
+			char str[BLI_UTF8_MAX + 1];
+			size_t len;
+			
+			if (event->utf8_buf[0]) {
+				len = BLI_str_utf8_size_safe(event->utf8_buf);
+				memcpy(str, event->utf8_buf, len);
+			}
+			else {
+				/* in theory, ghost can set value to extended ascii here */
+				len = BLI_str_utf8_from_unicode(event->ascii, str);
+			}
+			str[len] = '\0';
 			RNA_string_set(op->ptr, "text", str);
 		}
 	}
@@ -550,7 +562,7 @@ static int console_delete_exec(bContext *C, wmOperator *op)
 				pos = ci->cursor;
 				BLI_str_cursor_step_utf8(ci->line, ci->len,
 				                         &pos, STRCUR_DIR_NEXT,
-				                         (type == DEL_NEXT_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM);
+				                         (type == DEL_NEXT_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM, true);
 				stride = pos - ci->cursor;
 				if (stride) {
 					memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1);
@@ -566,7 +578,7 @@ static int console_delete_exec(bContext *C, wmOperator *op)
 				pos = ci->cursor;
 				BLI_str_cursor_step_utf8(ci->line, ci->len,
 				                         &pos, STRCUR_DIR_PREV,
-				                         (type == DEL_PREV_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM);
+				                         (type == DEL_PREV_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM, true);
 				stride = ci->cursor - pos;
 				if (stride) {
 					ci->cursor -= stride; /* same as above */
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 08f01b4..afe32ec 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -335,7 +335,9 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
 		float scale;
 		int ex, ey;
 		
-		if ( (imb->x > layout->prv_w) || (imb->y > layout->prv_h) ) {
+		if ((imb->x * UI_DPI_FAC > layout->prv_w) ||
+		    (imb->y * UI_DPI_FAC > layout->prv_h))
+		{
 			if (imb->x > imb->y) {
 				scaledx = (float)layout->prv_w;
 				scaledy =  ( (float)imb->y / (float)imb->x) * layout->prv_w;
@@ -348,10 +350,11 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
 			}
 		}
 		else {
-			scaledx = (float)imb->x;
-			scaledy = (float)imb->y;
-			scale = 1.0;
+			scaledx = (float)imb->x * UI_DPI_FAC;
+			scaledy = (float)imb->y * UI_DPI_FAC;
+			scale = UI_DPI_FAC;
 		}
+
 		ex = (int)scaledx;
 		ey = (int)scaledy;
 		fx = ((float)layout->prv_w - (float)ex) / 2.0f;
@@ -461,7 +464,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
 	int i;
 	short is_icon;
 	short align;
-
+	int column_space = 0.6f * UI_UNIT_X;
 
 	numfiles = filelist_numfiles(files);
 	
@@ -492,7 +495,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
 
 	for (i = offset; (i < numfiles) && (i < offset + numfiles_layout); i++) {
 		ED_fileselect_layout_tilepos(layout, i, &sx, &sy);
-		sx += (int)(v2d->tot.xmin + 2.0f);
+		sx += (int)(v2d->tot.xmin + 0.1f * UI_UNIT_X);
 		sy = (int)(v2d->tot.ymax - sy);
 
 		file = filelist_file(files, i);
@@ -521,13 +524,13 @@ void file_draw_list(const bContext *C, ARegion *ar)
 		}
 		else {
 			file_draw_icon(block, file->path, sx, sy - (UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE);
-			sx += ICON_DEFAULT_WIDTH_SCALE + 4;
+			sx += ICON_DEFAULT_WIDTH_SCALE + 0.2f * UI_UNIT_X;
 		}
 
 		UI_ThemeColor4(TH_TEXT);
 
 		if (file->selflag & EDITING_FILE) {
-			uiBut *but = uiDefBut(block, TEX, 1, "", sx, sy - layout->tile_h - 3,
+			uiBut *but = uiDefBut(block, TEX, 1, "", sx, sy - layout->tile_h - 0.15f * UI_UNIT_X,
 			                      textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit), 0, 0, "");
 			uiButSetRenameFunc(but, renamebutton_cb, file);
 			uiButSetFlag(but, UI_BUT_NO_UTF8); /* allow non utf8 names */
@@ -543,39 +546,39 @@ void file_draw_list(const bContext *C, ARegion *ar)
 		}
 
 		if (params->display == FILE_SHORTDISPLAY) {
-			sx += (int)layout->column_widths[COLUMN_NAME] + 12;
+			sx += (int)layout->column_widths[COLUMN_NAME] + column_space;
 			if (!(file->type & S_IFDIR)) {
 				file_draw_string(sx, sy, file->size, layout->column_widths[COLUMN_SIZE], layout->tile_h, align);
-				sx += (int)layout->column_widths[COLUMN_SIZE] + 12;
+				sx += (int)layout->column_widths[COLUMN_SIZE] + column_space;
 			}
 		}
 		else if (params->display == FILE_LONGDISPLAY) {
-			sx += (int)layout->column_widths[COLUMN_NAME] + 12;
+			sx += (int)layout->column_widths[COLUMN_NAME] + column_space;
 
 #ifndef WIN32
 			/* rwx rwx rwx */
 			file_draw_string(sx, sy, file->mode1, layout->column_widths[COLUMN_MODE1], layout->tile_h, align); 
-			sx += layout->column_widths[COLUMN_MODE1] + 12;
+			sx += layout->column_widths[COLUMN_MODE1] + column_space;
 
 			file_draw_string(sx, sy, file->mode2, layout->column_widths[COLUMN_MODE2], layout->tile_h, align);
-			sx += layout->column_widths[COLUMN_MODE2] + 12;
+			sx += layout->column_widths[COLUMN_MODE2] + column_space;
 
 			file_draw_string(sx, sy, file->mode3, layout->column_widths[COLUMN_MODE3], layout->tile_h, align);
-			sx += layout->column_widths[COLUMN_MODE3] + 12;
+			sx += layout->column_widths[COLUMN_MODE3] + column_space;
 
 			file_draw_string(sx, sy, file->owner, layout->column_widths[COLUMN_OWNER], layout->tile_h, align);
-			sx += layout->column_widths[COLUMN_OWNER] + 12;
+			sx += layout->column_widths[COLUMN_OWNER] + column_space;
 #endif
 
 			file_draw_string(sx, sy, file->date, layout->column_widths[COLUMN_DATE], layout->tile_h, align);
-			sx += (int)layout->column_widths[COLUMN_DATE] + 12;
+			sx += (int)layout->column_widths[COLUMN_DATE] + column_space;
 
 			file_draw_string(sx, sy, file->time, layout->column_widths[COLUMN_TIME], layout->tile_h, align);
-			sx += (int)layout->column_widths[COLUMN_TIME] + 12;
+			sx += (int)layout->column_widths[COLUMN_TIME] + column_space;
 
 			if (!(file->type & S_IFDIR)) {
 				file_draw_string(sx, sy, file->size, layout->column_widths[COLUMN_SIZE], layout->tile_h, align);
-				sx += (int)layout->column_widths[COLUMN_SIZE] + 12;
+				sx += (int)layout->column_widths[COLUMN_SIZE] + column_space;
 			}
 		}
 	}
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 778a3f4..3c6f635 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -95,7 +95,7 @@ FileSelectParams *ED_fileselect_get_params(struct SpaceFile *sfile)
 }
 
 /**
- * \note RNA_struct_property_is_set_ex is used here because we wan't
+ * \note RNA_struct_property_is_set_ex is used here because we want
  *       the previously used settings to be used here rather then overriding them */
 short ED_fileselect_set_params(SpaceFile *sfile)
 {
@@ -244,9 +244,11 @@ short ED_fileselect_set_params(SpaceFile *sfile)
 		params->display = FILE_SHORTDISPLAY;
 		params->filter = 0;
 		params->filter_glob[0] = '\0';
-		params->sort = FILE_SORT_ALPHA;
 	}
 
+	/* operator has no setting for this */
+	params->sort = FILE_SORT_ALPHA;
+
 
 	/* initialize the list with previous folders */
 	if (!sfile->folders_prev)
@@ -498,12 +500,12 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar)
 	layout->textheight = textheight;
 
 	if (params->display == FILE_IMGDISPLAY) {
-		layout->prv_w = 96;
-		layout->prv_h = 96;
-		layout->tile_border_x = 6;
-		layout->tile_border_y = 6;
-		layout->prv_border_x = 6;
-		layout->prv_border_y = 6;
+		layout->prv_w = 4.8f * UI_UNIT_X;
+		layout->prv_h = 4.8f * UI_UNIT_Y;
+		layout->tile_border_x = 0.3f * UI_UNIT_X;
+		layout->tile_border_y = 0.3f * UI_UNIT_X;
+		layout->prv_border_x = 0.3f * UI_UNIT_X;
+		layout->prv_border_y = 0.3f * UI_UNIT_Y;
 		layout->tile_w = layout->prv_w + 2 * layout->prv_border_x;
 		layout->tile_h = layout->prv_h + 2 * layout->prv_border_y + textheight;
 		layout->width = (int)(BLI_rctf_size_x(&v2d->cur) - 2 * layout->tile_border_x);
@@ -518,10 +520,13 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar)
 		layout->flag = FILE_LAYOUT_VER;
 	}
 	else {
+		int column_space = 0.6f * UI_UNIT_X;
+		int column_icon_space = 0.2f * UI_UNIT_X;
+
 		layout->prv_w = 0;
 		layout->prv_h = 0;
-		layout->tile_border_x = 8;
-		layout->tile_border_y = 2;
+		layout->tile_border_x = 0.4f * UI_UNIT_X;
+		layout->tile_border_y = 0.1f * UI_UNIT_Y;
 		layout->prv_border_x = 0;
 		layout->prv_border_y = 0;
 		layout->tile_h = textheight * 3 / 2;
@@ -531,22 +536,22 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar)
 		column_widths(sfile->files, layout);
 
 		if (params->display == FILE_SHORTDISPLAY) {
-			maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
-			         (int)layout->column_widths[COLUMN_NAME] + 12 +
-			         (int)layout->column_widths[COLUMN_SIZE] + 12;
+			maxlen = ICON_DEFAULT_WIDTH_SCALE + column_icon_space +
+			         (int)layout->column_widths[COLUMN_NAME] + column_space +
+			         (int)layout->column_widths[COLUMN_SIZE] + column_space;
 		}
 		else {
-			maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
-			         (int)layout->column_widths[COLUMN_NAME] + 12 +
+			maxlen = ICON_DEFAULT_WIDTH_SCALE + column_icon_space +
+			         (int)layout->column_widths[COLUMN_NAME] + column_space +
 #ifndef WIN32
-			         (int)layout->column_widths[COLUMN_MODE1] + 12 +
-			         (int)layout->column_widths[COLUMN_MODE2] + 12 +
-			         (int)layout->column_widths[COLUMN_MODE3] + 12 +
-			         (int)layout->column_widths[COLUMN_OWNER] + 12 +
+			         (int)layout->column_widths[COLUMN_MODE1] + column_space +
+			         (int)layout->column_widths[COLUMN_MODE2] + column_space +
+			         (int)layout->column_widths[COLUMN_MODE3] + column_space +
+			         (int)layout->column_widths[COLUMN_OWNER] + column_space +
 #endif
-			         (int)layout->column_widths[COLUMN_DATE] + 12 +
-			         (int)layout->column_widths[COLUMN_TIME] + 12 +
-			         (int)layout->column_widths[COLUMN_SIZE] + 12;
+			         (int)layout->column_widths[COLUMN_DATE] + column_space +
+			         (int)layout->column_widths[COLUMN_TIME] + column_space +
+			         (int)layout->column_widths[COLUMN_SIZE] + column_space;
 
 		}
 		layout->tile_w = maxlen;
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 7cc322c..0a4b922 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -478,6 +478,7 @@ static void file_channel_area_init(wmWindowManager *wm, ARegion *ar)
 {
 	wmKeyMap *keymap;
 
+	ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
 	ED_region_panels_init(wm, ar);
 
 	/* own keymaps */
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 060a181..01364fc 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -498,17 +498,17 @@ static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr,
 	}
 
 	/* decrease, increase arrows */
-	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT,   0, 0, 17, 20, NULL, 0, 0, 0, 0, TIP_("Previous Layer"));
+	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT,   0, 0, 0.85f * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Previous Layer"));
 	uiButSetFunc(but, image_multi_declay_cb, rr, iuser);
-	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT,  0, 0, 18, 20, NULL, 0, 0, 0, 0, TIP_("Next Layer"));
+	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT,  0, 0, 0.90f * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Next Layer"));
 	uiButSetFunc(but, image_multi_inclay_cb, rr, iuser);
 
 	uiblock_layer_pass_buttons(row, rr, iuser, 230 * dpi_fac, render_slot);
 
 	/* decrease, increase arrows */
-	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT,   0, 0, 17, 20, NULL, 0, 0, 0, 0, TIP_("Previous Pass"));
+	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT,   0, 0, 0.85f * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Previous Pass"));
 	uiButSetFunc(but, image_multi_decpass_cb, rr, iuser);
-	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT,  0, 0, 18, 20, NULL, 0, 0, 0, 0, TIP_("Next Pass"));
+	but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT,  0, 0, 0.90f * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Next Pass"));
 	uiButSetFunc(but, image_multi_incpass_cb, rr, iuser);
 
 	uiBlockEndAlign(block);
@@ -784,6 +784,8 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man
 	           R_IMF_CHAN_DEPTH_32)) == 0)
 	{
 		row = uiLayoutRow(col, FALSE);
+
+		uiItemL(row, IFACE_("Color Depth:"), ICON_NONE);
 		uiItemR(row, imfptr, "color_depth", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 	}
 
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 7b4814d..cae7188 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -110,8 +110,8 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar, float zoomx,
 			glScalef(zoomx, zoomy, 1.0f);
 
 			if (scene->r.mode & R_BORDER) {
-				glTranslatef(-scene->r.border.xmin * scene->r.xsch * scene->r.size / 100.0f,
-				             -scene->r.border.ymin * scene->r.ysch * scene->r.size / 100.0f,
+				glTranslatef((int)(-scene->r.border.xmin * scene->r.xsch * scene->r.size / 100.0f),
+				             (int)(-scene->r.border.ymin * scene->r.ysch * scene->r.size / 100.0f),
 				             0.0f);
 			}
 
@@ -185,29 +185,28 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 
 	/* noisy, high contrast make impossible to read if lower alpha is used. */
 	glColor4ub(0, 0, 0, 190);
-	glRecti(0.0, 0.0, BLI_rcti_size_x(&ar->winrct) + 1, 20);
+	glRecti(0.0, 0.0, BLI_rcti_size_x(&ar->winrct) + 1, UI_UNIT_Y);
 	glDisable(GL_BLEND);
 
-	BLF_size(blf_mono_font, 11, 72);
+	BLF_size(blf_mono_font, 11 * U.pixelsize, U.dpi);
 
 	glColor3ub(255, 255, 255);
 	BLI_snprintf(str, sizeof(str), "X:%-4d  Y:%-4d |", x, y);
-	// UI_DrawString(6, 6, str); // works ok but fixed width is nicer.
-	BLF_position(blf_mono_font, dx, 6, 0);
+	BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_Y, 0);
 	BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 	dx += BLF_width(blf_mono_font, str);
 
 	if (zp) {
 		glColor3ub(255, 255, 255);
 		BLI_snprintf(str, sizeof(str), " Z:%-.4f |", 0.5f + 0.5f * (((float)*zp) / (float)0x7fffffff));
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 	}
 	if (zpf) {
 		glColor3ub(255, 255, 255);
 		BLI_snprintf(str, sizeof(str), " Z:%-.3f |", *zpf);
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 	}
@@ -220,7 +219,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 			BLI_snprintf(str, sizeof(str), "  R:%-3d", cp[0]);
 		else
 			BLI_snprintf(str, sizeof(str), "  R:-");
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 		
@@ -231,7 +230,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 			BLI_snprintf(str, sizeof(str), "  G:%-3d", cp[1]);
 		else
 			BLI_snprintf(str, sizeof(str), "  G:-");
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 		
@@ -242,7 +241,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 			BLI_snprintf(str, sizeof(str), "  B:%-3d", cp[2]);
 		else
 			BLI_snprintf(str, sizeof(str), "  B:-");
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 		
@@ -254,7 +253,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 				BLI_snprintf(str, sizeof(str), "  A:%-3d", cp[3]);
 			else
 				BLI_snprintf(str, sizeof(str), "- ");
-			BLF_position(blf_mono_font, dx, 6, 0);
+			BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 			BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 			dx += BLF_width(blf_mono_font, str);
 		}
@@ -268,7 +267,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 				IMB_colormanagement_pixel_to_display_space_v4(pixel, fp,  &scene->view_settings, &scene->display_settings);
 
 			BLI_snprintf(str, sizeof(str), "  |  CM  R:%-.4f  G:%-.4f  B:%-.4f", pixel[0], pixel[1], pixel[2]);
-			BLF_position(blf_mono_font, dx, 6, 0);
+			BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 			BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 			dx += BLF_width(blf_mono_font, str);
 		}
@@ -326,24 +325,24 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 
 	glDisable(GL_BLEND);
 	glColor3fv(finalcol);
-	dx += 5;
+	dx += 0.25f * UI_UNIT_X;
 	glBegin(GL_QUADS);
-	glVertex2f(dx, 3);
-	glVertex2f(dx, 17);
-	glVertex2f(dx + 30, 17);
-	glVertex2f(dx + 30, 3);
+	glVertex2f(dx, 0.15f * UI_UNIT_Y);
+	glVertex2f(dx, 0.85f * UI_UNIT_Y);
+	glVertex2f(dx + 1.5f * UI_UNIT_X, 0.85 * UI_UNIT_Y);
+	glVertex2f(dx + 1.5f * UI_UNIT_X, 0.15f * UI_UNIT_Y);
 	glEnd();
 
 	/* draw outline */
 	glColor3ub(128, 128, 128);
 	glBegin(GL_LINE_LOOP);
-	glVertex2f(dx, 3);
-	glVertex2f(dx, 17);
-	glVertex2f(dx + 30, 17);
-	glVertex2f(dx + 30, 3);
+	glVertex2f(dx, 0.15f * UI_UNIT_Y);
+	glVertex2f(dx, 0.85f * UI_UNIT_Y);
+	glVertex2f(dx + 1.5f * UI_UNIT_X, 0.85f * UI_UNIT_Y);
+	glVertex2f(dx + 1.5f * UI_UNIT_X, 0.15f * UI_UNIT_Y);
 	glEnd();
 
-	dx += 35;
+	dx += 1.75f * UI_UNIT_X;
 
 	glColor3ub(255, 255, 255);
 	if (channels == 1) {
@@ -357,12 +356,12 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 		}
 		
 		BLI_snprintf(str, sizeof(str), "V:%-.4f", val);
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 
 		BLI_snprintf(str, sizeof(str), "   L:%-.4f", lum);
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 	}
@@ -377,22 +376,22 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
 		}
 
 		BLI_snprintf(str, sizeof(str), "H:%-.4f", hue);
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 
 		BLI_snprintf(str, sizeof(str), "  S:%-.4f", sat);
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 
 		BLI_snprintf(str, sizeof(str), "  V:%-.4f", val);
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 
 		BLI_snprintf(str, sizeof(str), "   L:%-.4f", lum);
-		BLF_position(blf_mono_font, dx, 6, 0);
+		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
 		BLF_draw_ascii(blf_mono_font, str, sizeof(str));
 		dx += BLF_width(blf_mono_font, str);
 	}
@@ -425,11 +424,11 @@ static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, fl
 	MEM_freeN(trectf);
 	/* ogl trick below is slower... (on ATI 9600) */
 //	glColorMask(1, 0, 0, 0);
-//	glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+3);
+//	glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf + 3);
 //	glColorMask(0, 1, 0, 0);
-//	glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+2);
+//	glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf + 2);
 //	glColorMask(0, 0, 1, 0);
-//	glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+1);
+//	glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf + 1);
 //	glColorMask(1, 1, 1, 1);
 }
 
@@ -514,16 +513,12 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
 		unsigned char *display_buffer;
 		void *cache_handle;
 
-		glEnable(GL_BLEND);
-		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
 		if (sima->flag & SI_USE_ALPHA) {
+			glEnable(GL_BLEND);
+			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
 			fdrawcheckerboard(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy);
 		}
-		else {
-			glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
-			glRecti(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy);
-		}
 
 		display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
 
@@ -536,7 +531,8 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
 
 		IMB_display_buffer_release(cache_handle);
 
-		glDisable(GL_BLEND);
+		if (sima->flag & SI_USE_ALPHA)
+			glDisable(GL_BLEND);
 	}
 
 	/* reset zoom */
@@ -834,7 +830,7 @@ void draw_image_main(const bContext *C, ARegion *ar)
 	show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT);
 
 	if (show_viewer) {
-		/* use locked draw for drawing viewer image buffer since the conpositor
+		/* use locked draw for drawing viewer image buffer since the compositor
 		 * is running in separated thread and compositor could free this buffers.
 		 * other images are not modifying in such a way so they does not require
 		 * lock (sergey)
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 23adf7e..dc834d8 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1084,7 +1084,7 @@ void IMAGE_OT_match_movie_length(wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name = "Match Movie Length";
-	ot->description = "Set image's users length to the one of this video";
+	ot->description = "Set image's user's length to the one of this video";
 	ot->idname = "IMAGE_OT_match_movie_length";
 	
 	/* api callbacks */
@@ -1716,6 +1716,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
 	Scene *scene;
 	Object *obedit;
 	Image *ima;
+	Main *bmain;
 	PointerRNA ptr, idptr;
 	PropertyRNA *prop;
 	char name[MAX_ID_NAME - 2];
@@ -1726,6 +1727,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
 	sima = CTX_wm_space_image(C);
 	scene = CTX_data_scene(C);
 	obedit = CTX_data_edit_object(C);
+	bmain = CTX_data_main(C);
 
 	RNA_string_get(op->ptr, "name", name);
 	width = RNA_int_get(op->ptr, "width");
@@ -1735,15 +1737,10 @@ static int image_new_exec(bContext *C, wmOperator *op)
 	RNA_float_get_array(op->ptr, "color", color);
 	alpha = RNA_boolean_get(op->ptr, "alpha");
 	
-	if (!floatbuf) {
-		/* OCIO_TODO: perhaps we need to convert to display space, not just to sRGB */
-		linearrgb_to_srgb_v3_v3(color, color);
-	}
-
 	if (!alpha)
 		color[3] = 1.0f;
 
-	ima = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, floatbuf, gen_type, color);
+	ima = BKE_image_add_generated(bmain, width, height, name, alpha ? 32 : 24, floatbuf, gen_type, color);
 
 	if (!ima)
 		return OPERATOR_CANCELLED;
@@ -1780,7 +1777,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
 /* XXX Note: the WM_operator_props_dialog_popup() doesn't work for uiIDContextProperty(), image is not being that way */
 static int image_new_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
-	return WM_operator_props_dialog_popup(C, op, 300, 100);
+	return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, 5 * UI_UNIT_Y);
 
 }
 
@@ -1806,6 +1803,7 @@ void IMAGE_OT_new(wmOperatorType *ot)
 	RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384);
 	RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384);
 	prop = RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f);
+	RNA_def_property_subtype(prop, PROP_COLOR_GAMMA);
 	RNA_def_property_float_array_default(prop, default_color);
 	RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel");
 	RNA_def_enum(ot->srna, "generated_type", image_generated_type_items, IMA_GENTYPE_BLANK,
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 9492e29..ca8270b 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -38,6 +38,7 @@
 
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
+#include "BLI_threads.h"
 
 #include "BKE_colortools.h"
 #include "BKE_context.h"
@@ -151,7 +152,7 @@ static SpaceLink *image_new(const bContext *UNUSED(C))
 	simage->spacetype = SPACE_IMAGE;
 	simage->zoom = 1.0f;
 	simage->lock = TRUE;
-	simage->flag = SI_SHOW_GPENCIL;
+	simage->flag = SI_SHOW_GPENCIL | SI_USE_ALPHA;
 
 	simage->iuser.ok = TRUE;
 	simage->iuser.fie_ima = 2;
@@ -692,10 +693,25 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
 	}
 
 	if (mask) {
-		int width, height;
+		Image *image = ED_space_image(sima);
+		int width, height, show_viewer;
 		float aspx, aspy;
+
+		show_viewer = (image && image->source == IMA_SRC_VIEWER);
+
+		if (show_viewer) {
+			/* ED_space_image_get* will acquire image buffer which requires
+			 * lock here by the same reason why lock is needed in draw_image_main
+			 */
+			BLI_lock_thread(LOCK_DRAW_IMAGE);
+		}
+
 		ED_space_image_get_size(sima, &width, &height);
 		ED_space_image_get_aspect(sima, &aspx, &aspy);
+
+		if (show_viewer)
+			BLI_unlock_thread(LOCK_DRAW_IMAGE);
+
 		ED_mask_draw_region(mask, ar,
 		                    sima->mask_info.draw_flag, sima->mask_info.draw_type,
 		                    width, height,
@@ -734,6 +750,7 @@ static void image_buttons_area_init(wmWindowManager *wm, ARegion *ar)
 {
 	wmKeyMap *keymap;
 
+	ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
 	ED_region_panels_init(wm, ar);
 	
 	keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
@@ -773,6 +790,7 @@ static void image_scope_area_init(wmWindowManager *wm, ARegion *ar)
 {
 	wmKeyMap *keymap;
 	
+	ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
 	ED_region_panels_init(wm, ar);
 	
 	keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index 54afc9a..a748c30 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -251,7 +251,8 @@ static int report_textview_line_color(struct TextViewContext *tvc, unsigned char
 
 #undef USE_INFO_NEWLINE
 
-static int info_textview_main__internal(struct SpaceInfo *sinfo, ARegion *ar, ReportList *reports, int draw, int mval[2], void **mouse_pick, int *pos_pick)
+static int info_textview_main__internal(struct SpaceInfo *sinfo, ARegion *ar, ReportList *reports,
+                                        int draw, int mval[2], void **mouse_pick, int *pos_pick)
 {
 	int ret = 0;
 	
@@ -264,6 +265,7 @@ static int info_textview_main__internal(struct SpaceInfo *sinfo, ARegion *ar, Re
 	tvc.step = report_textview_step;
 	tvc.line_get = report_textview_line_get;
 	tvc.line_color = report_textview_line_color;
+	tvc.const_colors = NULL;
 
 	tvc.arg1 = sinfo;
 	tvc.arg2 = reports;
diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h
index 62e9a3a..b5426fe 100644
--- a/source/blender/editors/space_info/info_intern.h
+++ b/source/blender/editors/space_info/info_intern.h
@@ -39,6 +39,7 @@ struct ReportList;
 
 void FILE_OT_pack_all(struct wmOperatorType *ot);
 void FILE_OT_unpack_all(struct wmOperatorType *ot);
+void FILE_OT_unpack_item(struct wmOperatorType *ot);
 void FILE_OT_pack_libraries(struct wmOperatorType *ot);
 void FILE_OT_unpack_libraries(struct wmOperatorType *ot);
 
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index 104349e..22668a3 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -46,9 +46,11 @@
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
+#include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_packedFile.h"
 #include "BKE_report.h"
+#include "BKE_screen.h"
 
 
 #include "WM_api.h"
@@ -249,6 +251,78 @@ void FILE_OT_unpack_all(wmOperatorType *ot)
 	RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack");
 }
 
+/********************* unpack single item operator *********************/
+
+static const EnumPropertyItem unpack_item_method_items[] = {
+	{PF_USE_LOCAL, "USE_LOCAL", 0, "Use file from current directory (create when necessary)", ""},
+	{PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write file to current directory (overwrite existing file)", ""},
+	{PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use file in original location (create when necessary)", ""},
+	{PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write file to original location (overwrite existing file)", ""},
+	/* {PF_ASK, "ASK", 0, "Ask for each file", ""}, */
+	{0, NULL, 0, NULL, NULL}};
+
+
+static int unpack_item_exec(bContext *C, wmOperator *op)
+{
+	Main *bmain = CTX_data_main(C);
+	ID *id;
+	char idname[MAX_ID_NAME - 2];
+	int type = RNA_int_get(op->ptr, "id_type");
+	int method = RNA_enum_get(op->ptr, "method");
+
+	RNA_string_get(op->ptr, "id_name", idname);
+	id = BKE_libblock_find_name(type, idname);
+
+	if (id == NULL) {
+		BKE_report(op->reports, RPT_WARNING, "No packed file");
+		return OPERATOR_CANCELLED;
+	}
+	
+	if (method != PF_KEEP)
+		BKE_unpack_id(bmain, id, op->reports, method);  /* XXX PF_ASK can't work here */
+	
+	G.fileflags &= ~G_AUTOPACK;
+	
+	return OPERATOR_FINISHED;
+}
+
+static int unpack_item_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+{
+	uiPopupMenu *pup;
+	uiLayout *layout;
+	
+	pup = uiPupMenuBegin(C, "Unpack", ICON_NONE);
+	layout = uiPupMenuLayout(pup);
+	
+	uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
+	uiItemsFullEnumO(layout, op->type->idname, "method", op->ptr->data, WM_OP_EXEC_REGION_WIN, 0);
+	
+	uiPupMenuEnd(C, pup);
+	
+	return OPERATOR_CANCELLED;
+}
+
+void FILE_OT_unpack_item(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name = "Unpack Item";
+	ot->idname = "FILE_OT_unpack_item";
+	ot->description = "Unpack this file to an external file";
+	
+	/* api callbacks */
+	ot->exec = unpack_item_exec;
+	ot->invoke = unpack_item_invoke;
+	
+	/* flags */
+	ot->flag = OPTYPE_UNDO;
+	
+	/* properties */
+	RNA_def_enum(ot->srna, "method", unpack_item_method_items, PF_USE_LOCAL, "Method", "How to unpack");
+	RNA_def_string(ot->srna, "id_name", "", BKE_ST_MAXNAME, "ID name", "Name of ID block to unpack");
+	RNA_def_int(ot->srna, "id_type", ID_IM, 0, INT_MAX, "ID Type", "Identifier type of ID block", 0, INT_MAX);
+}
+
+
 /********************* make paths relative operator *********************/
 
 static int make_paths_relative_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index 023ffa5..3050563 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -148,7 +148,7 @@ static int select_report_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
 void INFO_OT_select_pick(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Select report";
+	ot->name = "Select Report";
 	ot->description = "Select reports by index";
 	ot->idname = "INFO_OT_select_pick";
 
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index 3f73fc2..5a8a77f 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -41,6 +41,8 @@
 #include "BLI_utildefines.h"
 #include "BLI_math.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_anim.h"
 #include "BKE_blender.h"
 #include "BKE_curve.h"
@@ -166,8 +168,11 @@ static void stats_object_edit(Object *obedit, SceneStats *stats)
 			if (ebo->flag & BONE_SELECTED) stats->totbonesel++;
 
 			/* if this is a connected child and it's parent is being moved, remove our root */
-			if ((ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL))
+			if ((ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL) &&
+			    ebo->parent && (ebo->parent->flag & BONE_TIPSEL))
+			{
 				stats->totvertsel--;
+			}
 
 			stats->totvert += 2;
 		}
@@ -376,10 +381,12 @@ static void stats_string(Scene *scene)
 
 		if (scene->obedit->type == OB_MESH) {
 			s += sprintf(s, "Verts:%d/%d | Edges:%d/%d | Faces:%d/%d | Tris:%d",
-		             stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface, stats->tottri);
+		                 stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel,
+		                 stats->totface, stats->tottri);
 		}
 		else if (scene->obedit->type == OB_ARMATURE) {
-			s += sprintf(s, "Verts:%d/%d | Bones:%d/%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
+			s += sprintf(s, "Verts:%d/%d | Bones:%d/%d", stats->totvertsel, stats->totvert, stats->totbonesel,
+			             stats->totbone);
 		}
 		else {
 			s += sprintf(s, "Verts:%d/%d", stats->totvertsel, stats->totvert);
@@ -395,8 +402,9 @@ static void stats_string(Scene *scene)
 		s += sprintf(s, "Verts:%d | Tris:%d", stats->totvert, stats->tottri);
 	}
 	else {
-		s += sprintf(s, "Verts:%d | Faces:%d| Tris:%d | Objects:%d/%d | Lamps:%d/%d%s",
-		             stats->totvert, stats->totface, stats->tottri, stats->totobjsel, stats->totobj, stats->totlampsel, stats->totlamp, memstr);
+		s += sprintf(s, "Verts:%d | Faces:%d | Tris:%d | Objects:%d/%d | Lamps:%d/%d%s",
+		             stats->totvert, stats->totface, stats->tottri, stats->totobjsel, stats->totobj, stats->totlampsel,
+		             stats->totlamp, memstr);
 	}
 
 	if (ob)
@@ -419,4 +427,3 @@ const char *ED_info_stats_string(Scene *scene)
 
 	return scene->stats->infostr;
 }
-
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 60b04f7..1577ac3 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -180,6 +180,7 @@ static void info_operatortypes(void)
 	WM_operatortype_append(FILE_OT_pack_all);
 	WM_operatortype_append(FILE_OT_pack_libraries);
 	WM_operatortype_append(FILE_OT_unpack_all);
+	WM_operatortype_append(FILE_OT_unpack_item);
 	WM_operatortype_append(FILE_OT_unpack_libraries);
 	
 	WM_operatortype_append(FILE_OT_make_paths_relative);
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index fc0a7b3..66f4904 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -68,31 +68,28 @@ BLI_INLINE void console_step_sel(ConsoleDrawContext *cdc, const int step)
 	cdc->sel[1] += step;
 }
 
-static void console_draw_sel(const int sel[2], const int xy[2], const int str_len_draw, int cwidth, int lheight)
+static void console_draw_sel(const int sel[2], const int xy[2], const int str_len_draw, int cwidth, int lheight,
+                             const unsigned char bg_sel[4])
 {
 	if (sel[0] <= str_len_draw && sel[1] >= 0) {
 		const int sta = max_ii(sel[0], 0);
 		const int end = min_ii(sel[1], str_len_draw);
 
-		glEnable(GL_POLYGON_STIPPLE);
-		glPolygonStipple(stipple_halftone);
 		glEnable(GL_BLEND);
 		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-		glColor4ub(255, 255, 255, 48);
+		glColor4ubv(bg_sel);
 
 		glRecti(xy[0] + (cwidth * sta), xy[1] - 2 + lheight, xy[0] + (cwidth * end), xy[1] - 2);
 
-		glDisable(GL_POLYGON_STIPPLE);
 		glDisable(GL_BLEND);
 	}
 }
 
-
 /* return 0 if the last line is off the screen
  * should be able to use this for any string type */
 
 static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const int str_len,
-                               const unsigned char *fg, const unsigned char *bg)
+                               const unsigned char fg[3], const unsigned char bg[3], const unsigned char bg_sel[4])
 {
 	int rct_ofs = cdc->lheight / 4;
 	int tot_lines = (str_len / cdc->console_width) + 1; /* total number of lines for wrapping */
@@ -108,7 +105,8 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
 
 					/* wrap */
 					if (str_len > cdc->console_width)
-						ofs += (cdc->console_width * ((int)((((float)(y_next - cdc->mval[1]) / (float)(y_next - cdc->xy[1])) * tot_lines))));
+						ofs += cdc->console_width * ((int)((((float)(y_next - cdc->mval[1]) /
+						                                     (float)(y_next - cdc->xy[1])) * tot_lines)));
 	
 					CLAMP(ofs, 0, str_len);
 					*cdc->pos_pick += str_len - ofs;
@@ -158,7 +156,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
 		if (cdc->sel[0] != cdc->sel[1]) {
 			console_step_sel(cdc, -initial_offset);
 			// glColor4ub(255, 0, 0, 96); // debug
-			console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->lheight);
+			console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->lheight, bg_sel);
 			console_step_sel(cdc, cdc->console_width);
 			glColor3ubv(fg);
 		}
@@ -173,7 +171,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
 			
 			if (cdc->sel[0] != cdc->sel[1]) {
 				// glColor4ub(0, 255, 0, 96); // debug
-				console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->lheight);
+				console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->lheight, bg_sel);
 				console_step_sel(cdc, cdc->console_width);
 				glColor3ubv(fg);
 			}
@@ -207,7 +205,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
 			isel[1] = str_len - cdc->sel[0];
 
 			// glColor4ub(255, 255, 0, 96); // debug
-			console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->lheight);
+			console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->lheight, bg_sel);
 			console_step_sel(cdc, -(str_len + 1));
 		}
 
@@ -269,6 +267,11 @@ int textview_draw(TextViewContext *tvc, const int draw, int mval[2], void **mous
 	}
 
 	if (tvc->begin(tvc)) {
+		unsigned char bg_sel[4] = {0};
+
+		if (draw && tvc->const_colors) {
+			tvc->const_colors(tvc, bg_sel);
+		}
 
 		do {
 			const char *ext_line;
@@ -282,7 +285,11 @@ int textview_draw(TextViewContext *tvc, const int draw, int mval[2], void **mous
 
 			tvc->line_get(tvc, &ext_line, &ext_len);
 
-			if (!console_draw_string(&cdc, ext_line, ext_len, (color_flag & TVC_LINE_FG) ? fg : NULL, (color_flag & TVC_LINE_BG) ? bg : NULL)) {
+			if (!console_draw_string(&cdc, ext_line, ext_len,
+			                         (color_flag & TVC_LINE_FG) ? fg : NULL,
+			                         (color_flag & TVC_LINE_BG) ? bg : NULL,
+			                         bg_sel))
+			{
 				/* when drawing, if we pass v2d->cur.ymax, then quit */
 				if (draw) {
 					break; /* past the y limits */
diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h
index d0fab88..653c9b8 100644
--- a/source/blender/editors/space_info/textview.h
+++ b/source/blender/editors/space_info/textview.h
@@ -46,6 +46,7 @@ typedef struct TextViewContext {
 	int (*step)(struct TextViewContext *tvc);
 	int (*line_get)(struct TextViewContext *tvc, const char **, int *);
 	int (*line_color)(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3]);
+	void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]);  /* constant theme colors */
 	void *iter;
 	int iter_index;
 	int iter_char;		/* char intex, used for multi-line report display */
diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c
index e898a1b..a55da0e 100644
--- a/source/blender/editors/space_logic/logic_buttons.c
+++ b/source/blender/editors/space_logic/logic_buttons.c
@@ -145,7 +145,7 @@ void LOGIC_OT_links_cut(wmOperatorType *ot)
 {
 	PropertyRNA *prop;
 	
-	ot->name = "Cut links";
+	ot->name = "Cut Links";
 	ot->idname = "LOGIC_OT_links_cut";
 	ot->description = "Remove logic brick connections";
 	
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index 74be7c4..2313885 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -54,6 +54,8 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+#include "UI_view2d.h"
+
 #include "logic_intern.h"
 
 // temporary new includes for texface functions
@@ -328,8 +330,10 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot)
 	/* properties */
 	ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
 	RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
-	RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
-	RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
+	prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Add/Remove Controller Operator ************* */
@@ -427,6 +431,8 @@ static int controller_add_exec(bContext *C, wmOperator *op)
 
 static void LOGIC_OT_controller_add(wmOperatorType *ot)
 {
+	PropertyRNA *prop;
+
 	/* identifiers */
 	ot->name = "Add Controller";
 	ot->description = "Add a controller to the active object";
@@ -442,8 +448,10 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot)
 	
 	/* properties */
 	ot->prop = RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
-	RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
-	RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
+	prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Add/Remove Actuator Operator ************* */
@@ -545,8 +553,10 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
 	/* properties */
 	ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
 	RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
-	RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
-	RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
+	prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Move Logic Bricks Operator ************* */
@@ -723,6 +733,39 @@ static void LOGIC_OT_texface_convert(wmOperatorType *ot)
 }
 
 
+/* ************************ view ********************* */
+
+static int logic_view_all_exec(bContext *C, wmOperator *UNUSED(op))
+{
+	ARegion *ar = CTX_wm_region(C);
+	rctf cur_new = ar->v2d.tot;
+	float aspect = BLI_rctf_size_y(&ar->v2d.cur) / BLI_rctf_size_x(&ar->v2d.cur);
+	
+	/* force the view2d code to zoom to width, not height */
+	cur_new.ymin = cur_new.ymax - BLI_rctf_size_x(&cur_new) * aspect;
+	
+	UI_view2d_smooth_view(C, ar, &cur_new);
+
+	return OPERATOR_FINISHED;
+}
+
+static void LOGIC_OT_view_all(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name = "View All";
+	ot->idname = "LOGIC_OT_view_all";
+	ot->description = "Resize view so you can see all logic bricks";
+	
+	/* api callbacks */
+	ot->exec = logic_view_all_exec;
+	ot->poll = ED_operator_logic_active;
+	
+	/* flags */
+	ot->flag = 0;
+}
+
+/* ************************* */
+
 void ED_operatortypes_logic(void)
 {
 	WM_operatortype_append(LOGIC_OT_sensor_remove);
@@ -735,4 +778,5 @@ void ED_operatortypes_logic(void)
 	WM_operatortype_append(LOGIC_OT_actuator_add);
 	WM_operatortype_append(LOGIC_OT_actuator_move);
 	WM_operatortype_append(LOGIC_OT_texface_convert);
+	WM_operatortype_append(LOGIC_OT_view_all);
 }
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index a7599f2..fa7e888 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1860,6 +1860,25 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
 			uiItemR(col, ptr, "integral_coefficient", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
 			uiItemR(col, ptr, "derivate_coefficient", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
 			break;
+		case ACT_OBJECT_CHARACTER:
+			split = uiLayoutSplit(layout, 0.9, FALSE);
+			row = uiLayoutRow(split, FALSE);
+			uiItemR(row, ptr, "offset_location", 0, NULL, ICON_NONE);
+			row = uiLayoutRow(split, TRUE);
+			uiItemR(row, ptr, "use_local_location", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+			uiItemR(row, ptr, "use_add_character_location", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+
+			split = uiLayoutSplit(layout, 0.9, FALSE);
+			row = uiLayoutRow(split, FALSE);
+			uiItemR(row, ptr, "offset_rotation", 0, NULL, ICON_NONE);
+			uiItemR(split, ptr, "use_local_rotation", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+
+			split = uiLayoutSplit(layout, 0.9, FALSE);
+			row = uiLayoutRow(split, FALSE);
+			split = uiLayoutSplit(row, 0.7, FALSE);
+			uiItemL(split, "", ICON_NONE); /*Just use this for some spacing */
+			uiItemR(split, ptr, "use_character_jump", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+			break;
 	}
 }
 
@@ -2226,6 +2245,7 @@ void logic_buttons(bContext *C, ARegion *ar)
 	BLI_snprintf(uiblockstr, sizeof(uiblockstr), "buttonswin %p", (void *)ar);
 	block= uiBeginBlock(C, ar, uiblockstr, UI_EMBOSS);
 	uiBlockSetHandleFunc(block, do_logic_buts, NULL);
+	uiBoundsBlock(block, U.widget_unit/2);
 	
 	/* loop over all objects and set visible/linked flags for the logic bricks */
 	for (a=0; a<count; a++) {
@@ -2516,7 +2536,7 @@ void logic_buttons(bContext *C, ARegion *ar)
 	uiBlockLayoutResolve(block, NULL, &yco);	/* stores final height in yco */
 	height = MIN2(height, yco);
 
-	UI_view2d_totRect_set(&ar->v2d, 57.5f * U.widget_unit, height);
+	UI_view2d_totRect_set(&ar->v2d, 57.5f * U.widget_unit, height - U.widget_unit);
 	
 	/* set the view */
 	UI_view2d_view_ortho(&ar->v2d);
diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c
index 8795d65..3f3c81f 100644
--- a/source/blender/editors/space_logic/space_logic.c
+++ b/source/blender/editors/space_logic/space_logic.c
@@ -183,7 +183,7 @@ static void logic_keymap(struct wmKeyConfig *keyconf)
 	WM_keymap_add_item(keymap, "LOGIC_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
 	WM_keymap_add_menu(keymap, "LOGIC_MT_logicbricks_add", AKEY, KM_PRESS, KM_SHIFT, 0);
 	
-	WM_keymap_add_item(keymap, "VIEW2D_OT_reset", HOMEKEY, KM_PRESS, 0, 0);
+	WM_keymap_add_item(keymap, "LOGIC_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
 
 }
 
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 0c89e3e..acfb4a5 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -874,7 +874,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View
 						glVertex2f((float)v2d->cur.xmax - offset - 1, y + 0.45f * U.widget_unit);
 						glVertex2f((float)v2d->cur.xmax - 1, y + 0.45f * U.widget_unit);
 						glVertex2f((float)v2d->cur.xmax - 1, y - 0.35f * U.widget_unit);
-						glEnd(); // GL_LINES
+						glEnd();
 						
 						/* 'push down' icon for normal active-actions */
 						UI_icon_draw((float)v2d->cur.xmax - offset, ydatac, ICON_FREEZE);
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 981a177..f303bba 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1121,8 +1121,10 @@ static void node_update_reroute(const bContext *UNUSED(C), bNodeTree *UNUSED(ntr
 static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(snode),  bNodeTree *ntree, bNode *node)
 {
 	bNodeSocket *sock;
-#if 0   /* UNUSED */
+	char showname[128]; /* 128 used below */
 	rctf *rct = &node->totr;
+
+#if 0   /* UNUSED */
 	float size = NODE_REROUTE_SIZE;
 #endif
 	float socket_size = NODE_SOCKSIZE;
@@ -1163,6 +1165,15 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(
 	}
 #endif
 
+	if (node->label[0] != '\0') {
+		/* draw title (node label) */
+		BLI_strncpy(showname, node->label, sizeof(showname));
+		uiDefBut(node->block, LABEL, 0, showname,
+		         (int)(rct->xmin - NODE_DYS), (int)(rct->ymax),
+		         (short)512, (short)NODE_DY,
+		         NULL, 0, 0, 0, 0, NULL);
+	}
+
 	/* only draw input socket. as they all are placed on the same position.
 	 * highlight also if node itself is selected, since we don't display the node body separately!
 	 */
@@ -1972,7 +1983,7 @@ static void node_composit_buts_distance_matte(uiLayout *layout, bContext *UNUSED
 	uiLayout *col, *row;
 	
 	col = uiLayoutColumn(layout, TRUE);
-   
+
 	uiItemL(layout, IFACE_("Color Space:"), ICON_NONE);
 	row = uiLayoutRow(layout, FALSE);
 	uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
@@ -2368,6 +2379,12 @@ static void node_composit_buts_stabilize2d(uiLayout *layout, bContext *C, Pointe
 	uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
 }
 
+static void node_composit_buts_translate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+	uiItemR(layout, ptr, "use_relative", 0, NULL, ICON_NONE);
+	uiItemR(layout, ptr, "wrap_axis", 0, NULL, ICON_NONE);
+}
+
 static void node_composit_buts_transform(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 {
 	uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
@@ -2637,10 +2654,21 @@ static void node_composit_buts_ellipsemask(uiLayout *layout, bContext *UNUSED(C)
 	uiItemR(layout, ptr, "mask_type", 0, NULL, ICON_NONE);
 }
 
+static void node_composit_buts_composite(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+	uiItemR(layout, ptr, "use_alpha", 0, NULL, ICON_NONE);
+}
+
+static void node_composit_buts_viewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+	uiItemR(layout, ptr, "use_alpha", 0, NULL, ICON_NONE);
+}
+
 static void node_composit_buts_viewer_but(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 {
 	uiLayout *col;
 	
+	uiItemR(layout, ptr, "use_alpha", 0, NULL, ICON_NONE);
 	uiItemR(layout, ptr, "tile_order", 0, NULL, ICON_NONE);
 	if (RNA_enum_get(ptr, "tile_order") == 0) {
 		col = uiLayoutColumn(layout, TRUE);
@@ -2920,6 +2948,9 @@ static void node_composit_set_butfunc(bNodeType *ntype)
 		case CMP_NODE_TRANSFORM:
 			ntype->uifunc = node_composit_buts_transform;
 			break;
+		case CMP_NODE_TRANSLATE:
+			ntype->uifunc = node_composit_buts_translate;
+			break;
 		case CMP_NODE_MOVIEDISTORTION:
 			ntype->uifunc = node_composit_buts_moviedistortion;
 			break;
@@ -2945,10 +2976,13 @@ static void node_composit_set_butfunc(bNodeType *ntype)
 			ntype->uifunc = node_composit_buts_bokehblur;
 			break;
 		case CMP_NODE_VIEWER:
-			ntype->uifunc = NULL;
+			ntype->uifunc = node_composit_buts_viewer;
 			ntype->uifuncbut = node_composit_buts_viewer_but;
 			ntype->uibackdropfunc = node_composit_backdrop_viewer;
 			break;
+		case CMP_NODE_COMPOSITE:
+			ntype->uifunc = node_composit_buts_composite;
+			break;
 		case CMP_NODE_MASK:
 			ntype->uifunc = node_composit_buts_mask;
 			break;
@@ -3272,17 +3306,9 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode)
 				else {
 					glPixelZoom(snode->zoom, snode->zoom);
 
-					glEnable(GL_BLEND);
-					glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-					glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
-					glRecti(x, y, x + ibuf->x * snode->zoom, y + ibuf->y * snode->zoom);
-
 					glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, display_buffer);
 					
 					glPixelZoom(1.0f, 1.0f);
-
-					glDisable(GL_BLEND);
 				}
 			}
 
diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c
index 18ce2c8..2263156 100644
--- a/source/blender/editors/space_node/node_add.c
+++ b/source/blender/editors/space_node/node_add.c
@@ -305,7 +305,7 @@ void NODE_OT_add_reroute(wmOperatorType *ot)
 {
 	PropertyRNA *prop;
 
-	ot->name = "Add reroute";
+	ot->name = "Add Reroute";
 	ot->idname = "NODE_OT_add_reroute";
 
 	ot->invoke = WM_gesture_lines_invoke;
@@ -441,6 +441,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
 {
 	SpaceNode *snode;
 	bNodeTree *ntree;
+	Main *bmain;
 	PointerRNA ptr, idptr;
 	PropertyRNA *prop;
 	int treetype;
@@ -448,6 +449,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
 
 	/* retrieve state */
 	snode = CTX_wm_space_node(C);
+	bmain = CTX_data_main(C);
 
 	if (RNA_struct_property_is_set(op->ptr, "type"))
 		treetype = RNA_enum_get(op->ptr, "type");
@@ -457,7 +459,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
 	if (RNA_struct_property_is_set(op->ptr, "name"))
 		RNA_string_get(op->ptr, "name", treename);
 
-	ntree = ntreeAddTree(treename, treetype, 0);
+	ntree = ntreeAddTree(bmain, treename, treetype, 0);
 	if (!ntree)
 		return OPERATOR_CANCELLED;
 
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 2b10637..34f7799 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -368,7 +368,8 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
 	}
 
 	/* buttons rect? */
-	if ((node->flag & NODE_OPTIONS) && node->typeinfo->uifunc) {
+	/* TODO: NODE_OPTION shall be cleaned up */
+	if (/*(node->flag & NODE_OPTIONS) && */node->typeinfo->uifunc) {
 		dy -= NODE_DYS / 2;
 
 		/* set this for uifunc() that don't use layout engine yet */
@@ -501,21 +502,18 @@ int node_tweak_area_default(bNode *node, int x, int y)
 
 int node_get_colorid(bNode *node)
 {
-	if (node->typeinfo->nclass == NODE_CLASS_INPUT)
-		return TH_NODE_IN_OUT;
-	if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) {
-		if (node->flag & NODE_DO_OUTPUT)
-			return TH_NODE_IN_OUT;
-		else
-			return TH_NODE;
+	switch (node->typeinfo->nclass) {
+		case NODE_CLASS_INPUT:      return TH_NODE_IN_OUT;
+		case NODE_CLASS_OUTPUT:     return (node->flag & NODE_DO_OUTPUT) ? TH_NODE_IN_OUT : TH_NODE;
+		case NODE_CLASS_CONVERTOR:  return TH_NODE_CONVERTOR;
+		case NODE_CLASS_OP_COLOR:
+		case NODE_CLASS_OP_VECTOR:
+		case NODE_CLASS_OP_FILTER:  return TH_NODE_OPERATOR;
+		case NODE_CLASS_GROUP:      return TH_NODE_GROUP;
+		case NODE_CLASS_MATTE:      return TH_NODE_MATTE;
+		case NODE_CLASS_DISTORT:    return TH_NODE_DISTORT;
+		default:                    return TH_NODE;
 	}
-	if (node->typeinfo->nclass == NODE_CLASS_CONVERTOR)
-		return TH_NODE_CONVERTOR;
-	if (ELEM3(node->typeinfo->nclass, NODE_CLASS_OP_COLOR, NODE_CLASS_OP_VECTOR, NODE_CLASS_OP_FILTER))
-		return TH_NODE_OPERATOR;
-	if (node->typeinfo->nclass == NODE_CLASS_GROUP)
-		return TH_NODE_GROUP;
-	return TH_NODE;
 }
 
 /* note: in cmp_util.c is similar code, for node_compo_pass_on()
@@ -704,6 +702,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
 	
 	if (node->flag & NODE_MUTED)
 		UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
+	
 
 #ifdef WITH_COMPOSITOR
 	if (ntree->type == NTREE_COMPOSIT && (snode->flag & SNODE_SHOW_HIGHLIGHT)) {
@@ -798,6 +797,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
 
 	/* outline active and selected emphasis */
 	if (node->flag & SELECT) {
+		
 		glEnable(GL_BLEND);
 		glEnable(GL_LINE_SMOOTH);
 		
@@ -805,6 +805,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
 			UI_ThemeColorShadeAlpha(TH_ACTIVE, 0, -40);
 		else
 			UI_ThemeColorShadeAlpha(TH_SELECT, 0, -40);
+		
 		uiSetRoundBox(UI_CNR_ALL);
 		uiDrawBox(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD);
 		
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index ae95d9a..fb4e4f6 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -328,7 +328,7 @@ void ED_node_shader_default(Scene *scene, ID *id)
 	int output_type, shader_type;
 	float color[3], strength = 1.0f;
 	
-	ntree = ntreeAddTree("Shader Nodetree", NTREE_SHADER, 0);
+	ntree = ntreeAddTree(G.main, "Shader Nodetree", NTREE_SHADER, 0);
 
 	switch (GS(id->name)) {
 		case ID_MA:
@@ -424,7 +424,7 @@ void ED_node_composit_default(Scene *sce)
 		return;
 	}
 	
-	sce->nodetree = ntreeAddTree("Compositing Nodetree", NTREE_COMPOSIT, 0);
+	sce->nodetree = ntreeAddTree(G.main, "Compositing Nodetree", NTREE_COMPOSIT, 0);
 
 	sce->nodetree->chunksize = 256;
 	sce->nodetree->edit_quality = NTREE_QUALITY_HIGH;
@@ -468,7 +468,7 @@ void ED_node_texture_default(Tex *tx)
 		return;
 	}
 	
-	tx->nodetree = ntreeAddTree("Texture Nodetree", NTREE_TEXTURE, 0);
+	tx->nodetree = ntreeAddTree(G.main, "Texture Nodetree", NTREE_TEXTURE, 0);
 	
 	ntemp.type = TEX_NODE_OUTPUT;
 	out = nodeAddNode(tx->nodetree, &ntemp);
@@ -550,6 +550,12 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
 	snode->id = snode->from = NULL;
 	
 	if (snode->treetype == NTREE_SHADER) {
+		/* we use this to signal warnings, when node shaders are drawn in wrong render engine */
+		if (BKE_scene_use_new_shading_nodes(scene))
+			snode->flag |= SNODE_NEW_SHADERS;
+		else
+			snode->flag &= ~SNODE_NEW_SHADERS;
+			
 		/* need active object, or we allow pinning... */
 		if (snode->shaderfrom == SNODE_SHADER_OBJECT) {
 			if (ob) {
@@ -1743,7 +1749,7 @@ static int node_delete_reconnect_exec(bContext *C, wmOperator *UNUSED(op))
 void NODE_OT_delete_reconnect(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Delete with reconnect";
+	ot->name = "Delete with Reconnect";
 	ot->description = "Delete nodes; will reconnect nodes as if deletion was muted";
 	ot->idname = "NODE_OT_delete_reconnect";
 
@@ -2025,7 +2031,7 @@ static int node_clipboard_copy_exec(bContext *C, wmOperator *UNUSED(op))
 void NODE_OT_clipboard_copy(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Copy to clipboard";
+	ot->name = "Copy to Clipboard";
 	ot->description = "Copies selected nodes to the clipboard";
 	ot->idname = "NODE_OT_clipboard_copy";
 
@@ -2146,7 +2152,7 @@ static int node_clipboard_paste_invoke(bContext *C, wmOperator *op, wmEvent *eve
 void NODE_OT_clipboard_paste(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Paste from clipboard";
+	ot->name = "Paste from Clipboard";
 	ot->description = "Pastes nodes from the clipboard to the active node tree";
 	ot->idname = "NODE_OT_clipboard_paste";
 
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c
index 4dd9c89..943f12c 100644
--- a/source/blender/editors/space_node/node_group.c
+++ b/source/blender/editors/space_node/node_group.c
@@ -457,8 +457,10 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
 		/* ensure unique node name in the nodee tree */
 		nodeUniqueName(ntree, node);
 
-		node->locx += gnode->locx;
-		node->locy += gnode->locy;
+		if (!node->parent) {
+			node->locx += gnode->locx;
+			node->locy += gnode->locy;
+		}
 
 		node->flag |= NODE_SELECT;
 	}
@@ -673,8 +675,10 @@ static int node_group_separate_selected(bNodeTree *ntree, bNode *gnode, int make
 			/* ensure unique node name in the node tree */
 			nodeUniqueName(ntree, newnode);
 			
-			newnode->locx += gnode->locx;
-			newnode->locy += gnode->locy;
+			if (!newnode->parent) {
+				newnode->locx += gnode->locx;
+				newnode->locy += gnode->locy;
+			}
 		}
 		else {
 			/* ensure valid parent pointers, detach if child stays inside the group */
@@ -865,12 +869,14 @@ static int node_group_make_test(bNodeTree *ntree, bNode *gnode)
 static void node_get_selected_minmax(bNodeTree *ntree, bNode *gnode, float *min, float *max)
 {
 	bNode *node;
+	float loc[2];
 	INIT_MINMAX2(min, max);
 	for (node = ntree->nodes.first; node; node = node->next) {
 		if (node == gnode)
 			continue;
 		if (node->flag & NODE_SELECT) {
-			minmax_v2v2_v2(min, max, &node->locx);
+			nodeToView(node, 0.0f, 0.0f, &loc[0], &loc[1]);
+			minmax_v2v2_v2(min, max, loc);
 		}
 	}
 }
@@ -921,8 +927,10 @@ static int node_group_make_insert_selected(bNodeTree *ntree, bNode *gnode)
 			/* ensure unique node name in the ngroup */
 			nodeUniqueName(ngroup, node);
 
-			node->locx -= 0.5f * (min[0] + max[0]);
-			node->locy -= 0.5f * (min[1] + max[1]);
+			if (!node->parent) {
+				node->locx -= 0.5f * (min[0] + max[0]);
+				node->locy -= 0.5f * (min[1] + max[1]);
+			}
 		}
 		else {
 			/* if the parent is to be inserted but not the child, detach properly */
@@ -1039,7 +1047,7 @@ static bNode *node_group_make_from_selected(bNodeTree *ntree)
 	node_get_selected_minmax(ntree, NULL, min, max);
 
 	/* new nodetree */
-	ngroup = ntreeAddTree("NodeGroup", ntree->type, NODE_GROUP);
+	ngroup = ntreeAddTree(G.main, "NodeGroup", ntree->type, NODE_GROUP);
 
 	/* make group node */
 	ntemp.type = NODE_GROUP;
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c
index e82917f..f26b6ff 100644
--- a/source/blender/editors/space_node/node_header.c
+++ b/source/blender/editors/space_node/node_header.c
@@ -136,7 +136,7 @@ static void do_node_add_group(bContext *C, void *UNUSED(arg), int event)
 		ntemp.type = -event;
 		switch (ntemp.type) {
 			case NODE_GROUP:
-				ntemp.ngroup = ntreeAddTree("Group", snode->treetype, ntemp.type);
+				ntemp.ngroup = ntreeAddTree(bmain, "Group", snode->treetype, ntemp.type);
 				break;
 			default:
 				ntemp.ngroup = NULL;
@@ -234,7 +234,7 @@ static void node_menu_add(const bContext *C, Menu *menu)
 		uiLayoutSetActive(layout, FALSE);
 	
 	uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT);
-	uiItemO(layout, "Search ...", 0, "NODE_OT_add_search");
+	uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Search ..."), 0, "NODE_OT_add_search");
 	
 	if (ntreetype && ntreetype->foreach_nodeclass)
 		ntreetype->foreach_nodeclass(scene, layout, node_menu_add_foreach_cb);
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 7fa48c4..8d7eef2 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -876,7 +876,7 @@ void NODE_OT_links_cut(wmOperatorType *ot)
 {
 	PropertyRNA *prop;
 
-	ot->name = "Cut links";
+	ot->name = "Cut Links";
 	ot->idname = "NODE_OT_links_cut";
 	ot->description = "Use the mouse to cut (remove) some links";
 
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index a3efa15..7d2b80d 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -30,14 +30,14 @@
 
 #include "DNA_node_types.h"
 
-#include "BKE_context.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-
 #include "BLI_rect.h"
 #include "BLI_lasso.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_context.h"
+#include "BKE_main.h"
+#include "BKE_node.h"
+
 #include "ED_node.h"  /* own include */
 #include "ED_screen.h"
 #include "ED_types.h"
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 513f6b4..264bea5 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -119,7 +119,7 @@ static SpaceLink *node_new(const bContext *UNUSED(C))
 	snode = MEM_callocN(sizeof(SpaceNode), "initnode");
 	snode->spacetype = SPACE_NODE;
 
-	snode->flag = SNODE_SHOW_GPENCIL;
+	snode->flag = SNODE_SHOW_GPENCIL | SNODE_USE_ALPHA;
 
 	/* backdrop */
 	snode->zoom = 1.0f;
@@ -498,6 +498,7 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
 		case NC_SCENE:
 		case NC_MATERIAL:
 		case NC_TEXTURE:
+		case NC_WORLD:
 		case NC_NODE:
 			ED_region_tag_redraw(ar);
 			break;
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 1a05810..cacbc6d 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1066,7 +1066,8 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
 						UI_icon_draw(x, y, ICON_MOD_SKIN); break;
 					case eModifierType_Triangulate:
 						UI_icon_draw(x, y, ICON_MOD_TRIANGULATE); break;
-
+					case eModifierType_MeshCache:
+						UI_icon_draw(x, y, ICON_MOD_MESHDEFORM); break;  /* XXX, needs own icon */
 					/* Default */
 					case eModifierType_None:
 					case eModifierType_ShapeKey:
@@ -1676,7 +1677,7 @@ void draw_outliner(const bContext *C)
 		 *				 (OL_RNA_COL_X), whichever is wider...
 		 *	- column 2 is fixed at OL_RNA_COL_SIZEX
 		 *
-		 *  (*) XXX max width for now is a fixed factor of UI_UNIT_X*(max_indention+100)
+		 *  (*) XXX max width for now is a fixed factor of (UI_UNIT_X * (max_indention + 100))
 		 */
 		 
 		/* get actual width of column 1 */
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index a087ff6..ab660b9 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1309,8 +1309,8 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
 						 * for now, we don't supply one, and just let this use the KeyingSet name */
 						BKE_keyingset_add_path(ks, id, NULL, path, array_index, flag, groupmode);
 						ks->active_path = BLI_countlist(&ks->paths);
+						break;
 					}
-					break;
 					case KEYINGSET_EDITMODE_REMOVE:
 					{
 						/* find the relevant path, then remove it from the KeyingSet */
@@ -1322,8 +1322,8 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
 
 							ks->active_path = 0;
 						}
+						break;
 					}
-					break;
 				}
 				
 				/* free path, since it had to be generated */
@@ -1637,7 +1637,7 @@ void OUTLINER_OT_parent_drop(wmOperatorType *ot)
 	ot->poll = ED_operator_outliner_active;
 
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_string(ot->srna, "child", "Object", MAX_ID_NAME, "Child", "Child Object");
@@ -1726,7 +1726,7 @@ void OUTLINER_OT_parent_clear(wmOperatorType *ot)
 	ot->poll = ED_operator_outliner_active;
 
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_string(ot->srna, "dragged_obj", "Object", MAX_ID_NAME, "Child", "Child Object");
@@ -1819,7 +1819,7 @@ void OUTLINER_OT_scene_drop(wmOperatorType *ot)
 	ot->poll = ED_operator_outliner_active;
 
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_string(ot->srna, "object", "Object", MAX_ID_NAME, "Object", "Target Object");
@@ -1883,7 +1883,7 @@ void OUTLINER_OT_material_drop(wmOperatorType *ot)
 	ot->poll = ED_operator_outliner_active;
 
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_string(ot->srna, "object", "Object", MAX_ID_NAME, "Object", "Target Object");
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index 4e6783e..9600800 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -71,7 +71,7 @@ static int run_pyfile_exec(bContext *C, wmOperator *op)
 void SCRIPT_OT_python_file_run(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Run python file";
+	ot->name = "Run Python File";
 	ot->description = "Run Python file";
 	ot->idname = "SCRIPT_OT_python_file_run";
 	ot->flag = OPTYPE_UNDO;
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index c6c70cc..7be2d51 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -817,18 +817,23 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
 
 
 /* like duplicate, but only duplicate and cut overlapping strips,
- * strips to the left of the cutframe are ignored and strips to the right are moved into the new list */
-static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe,
+ * strips to the left of the cutframe are ignored and strips to the right 
+ * are moved to the end of slist
+ * we have to work on the same slist (not using a seperate list), since
+ * otherwise dupli_seq can't check for duplicate names properly and
+ * may generate strips with the same name (which will mess up animdata)
+ */
+
+static int cut_seq_list(Scene *scene, ListBase *slist, int cutframe,
                         Sequence * (*cut_seq)(Scene *, Sequence *, int))
 {
-	int did_something = FALSE;
 	Sequence *seq, *seq_next_iter;
+	Sequence *seq_first_new = NULL;
 	
-	seq = old->first;
-	
-	while (seq) {
+	seq = slist->first;
+
+	while (seq && seq != seq_first_new) {
 		seq_next_iter = seq->next; /* we need this because we may remove seq */
-		
 		seq->tmp = NULL;
 		if (seq->flag & SELECT) {
 			if (cutframe > seq->startdisp && 
@@ -836,22 +841,29 @@ static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe
 			{
 				Sequence *seqn = cut_seq(scene, seq, cutframe);
 				if (seqn) {
-					BLI_addtail(new, seqn);
+					BLI_addtail(slist, seqn);
+					if (seq_first_new == NULL) {
+						seq_first_new = seqn;
+					}
 				}
-				did_something = TRUE;
 			}
 			else if (seq->enddisp <= cutframe) {
 				/* do nothing */
 			}
 			else if (seq->startdisp >= cutframe) {
-				/* move into new list */
-				BLI_remlink(old, seq);
-				BLI_addtail(new, seq);
+				/* move to tail */
+				BLI_remlink(slist, seq);
+				BLI_addtail(slist, seq);
+
+				if (seq_first_new == NULL) {
+					seq_first_new = seq;
+				}
 			}
 		}
 		seq = seq_next_iter;
 	}
-	return did_something;
+
+	return (seq_first_new != NULL);
 }
 
 static int insert_gap(Scene *scene, int gap, int cfra)
@@ -1124,7 +1136,7 @@ static int sequencer_snap_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
 void SEQUENCER_OT_snap(struct wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Snap strips";
+	ot->name = "Snap Strips";
 	ot->idname = "SEQUENCER_OT_snap";
 	ot->description = "Frame where selected strips will be snapped";
 	
@@ -1488,25 +1500,21 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
 	Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
 	int cut_side, cut_hard, cut_frame;
 
-	ListBase newlist;
 	int changed;
 
 	cut_frame = RNA_int_get(op->ptr, "frame");
 	cut_hard = RNA_enum_get(op->ptr, "type");
 	cut_side = RNA_enum_get(op->ptr, "side");
 	
-	newlist.first = newlist.last = NULL;
-
 	if (cut_hard == SEQ_CUT_HARD) {
-		changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_hard);
+		changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_hard);
 	}
 	else {
-		changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_soft);
+		changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_soft);
 	}
 	
-	if (newlist.first) { /* got new strips ? */
+	if (changed) { /* got new strips ? */
 		Sequence *seq;
-		BLI_movelisttolist(ed->seqbasep, &newlist);
 
 		if (cut_side != SEQ_SIDE_BOTH) {
 			SEQP_BEGIN (ed, seq)
@@ -2463,9 +2471,15 @@ void SEQUENCER_OT_strip_jump(wmOperatorType *ot)
 static void swap_sequence(Scene *scene, Sequence *seqa, Sequence *seqb)
 {
 	int gap = seqb->startdisp - seqa->enddisp;
-	seqb->start = (seqb->start - seqb->startdisp) + seqa->startdisp;
+	int seq_a_start;
+	int seq_b_start;
+
+	seq_b_start = (seqb->start - seqb->startdisp) + seqa->startdisp;
+	BKE_sequence_translate(scene, seqb, seq_b_start - seqb->start);
 	BKE_sequence_calc(scene, seqb);
-	seqa->start = (seqa->start - seqa->startdisp) + seqb->enddisp + gap;
+
+	seq_a_start = (seqa->start - seqa->startdisp) + seqb->enddisp + gap;
+	BKE_sequence_translate(scene, seqa, seq_a_start - seqa->start);
 	BKE_sequence_calc(scene, seqa);
 }
 
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 192f45a..0d1ecb7 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -704,7 +704,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEv
 void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Select pick linked";
+	ot->name = "Select Pick Linked";
 	ot->idname = "SEQUENCER_OT_select_linked_pick";
 	ot->description = "Select a chain of linked strips nearest to the mouse pointer";
 	
@@ -739,7 +739,7 @@ static int sequencer_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
 void SEQUENCER_OT_select_linked(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Select linked";
+	ot->name = "Select Linked";
 	ot->idname = "SEQUENCER_OT_select_linked";
 	ot->description = "Select all strips adjacent to the current selection";
 	
diff --git a/source/blender/editors/space_text/CMakeLists.txt b/source/blender/editors/space_text/CMakeLists.txt
index a33a9ab..1a6b8ea 100644
--- a/source/blender/editors/space_text/CMakeLists.txt
+++ b/source/blender/editors/space_text/CMakeLists.txt
@@ -39,6 +39,7 @@ set(SRC
 	text_autocomplete.c
 	text_draw.c
 	text_format.c
+	text_format_lua.c
 	text_format_osl.c
 	text_format_py.c
 	text_header.c
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index fa3eefc..ff9d132 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -232,6 +232,12 @@ static void text_keymap(struct wmKeyConfig *keyconf)
 	wmKeyMap *keymap;
 	wmKeyMapItem *kmi;
 	
+	keymap = WM_keymap_find(keyconf, "Text Generic", SPACE_TEXT, 0);
+	WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_CTRL, 0);
+#ifdef __APPLE__
+	WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_OSKEY, 0);
+#endif
+	
 	keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0);
 	
 	#ifdef __APPLE__
@@ -256,7 +262,6 @@ static void text_keymap(struct wmKeyConfig *keyconf)
 	WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_OSKEY, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0); 
 	WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
-	WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_OSKEY, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_find_set_selected", EKEY, KM_PRESS, KM_OSKEY, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_find", GKEY, KM_PRESS, KM_OSKEY, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0);
@@ -305,7 +310,6 @@ static void text_keymap(struct wmKeyConfig *keyconf)
 	WM_keymap_add_item(keymap, "TEXT_OT_jump", JKEY, KM_PRESS, KM_CTRL, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_find", GKEY, KM_PRESS, KM_CTRL, 0);
 	
-	WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_CTRL, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_CTRL, 0);
 
 	kmi = WM_keymap_add_item(keymap, "TEXT_OT_to_3d_object", MKEY, KM_PRESS, KM_ALT, 0);
@@ -413,6 +417,8 @@ static void text_main_area_init(wmWindowManager *wm, ARegion *ar)
 	UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
 	
 	/* own keymap */
+	keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
+	WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 	keymap = WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0);
 	WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 	
@@ -496,6 +502,11 @@ static void text_header_area_draw(const bContext *C, ARegion *ar)
 /* add handlers, stuff you only do once or on area/region changes */
 static void text_properties_area_init(wmWindowManager *wm, ARegion *ar)
 {
+	wmKeyMap *keymap;
+
+	keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
+	WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+
 	ED_region_panels_init(wm, ar);
 }
 
@@ -560,5 +571,6 @@ void ED_spacetype_text(void)
 	/* register formatters */
 	ED_text_format_register_py();
 	ED_text_format_register_osl();
+	ED_text_format_register_lua();
 }
 
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index e406a1b..7c18b5c 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -162,20 +162,30 @@ static GHash *text_autocomplete_build(Text *text)
 		gh = BLI_ghash_str_new(__func__);
 
 		for (linep = text->lines.first; linep; linep = linep->next) {
-			int i_start = 0;
-			int i_end = 0;
+			size_t i_start = 0;
+			size_t i_end = 0;
+			size_t i_pos = 0;
 
 			while (i_start < linep->len) {
 				/* seek identifier beginning */
-				while (i_start < linep->len && !text_check_identifier(linep->line[i_start])) {
-					i_start++;
+				i_pos = i_start;
+				while ((i_start < linep->len) &&
+				       (!text_check_identifier_nodigit_unicode(BLI_str_utf8_as_unicode_and_size_safe(&linep->line[i_start], &i_pos))))
+				{
+					i_start = i_pos;
 				}
-				i_end = i_start;
-				while (i_end < linep->len && text_check_identifier(linep->line[i_end])) {
-					i_end++;
+				i_pos = i_end = i_start;
+				while ((i_end < linep->len) &&
+				       (text_check_identifier_unicode(BLI_str_utf8_as_unicode_and_size_safe(&linep->line[i_end], &i_pos))))
+				{
+					i_end = i_pos;
 				}
 
-				if (i_start != i_end) {
+				if ((i_start != i_end) &&
+				    /* check we're at the beginning of a line or that the previous char is not an identifier
+				     * this prevents digits from being added */
+				    ((i_start < 1) || !text_check_identifier_unicode(BLI_str_utf8_as_unicode(&linep->line[i_start - 1]))))
+				{
 					char *str_sub = &linep->line[i_start];
 					const int choice_len = i_end - i_start;
 
@@ -193,7 +203,13 @@ static GHash *text_autocomplete_build(Text *text)
 						str_sub[choice_len] = str_sub_last;
 					}
 				}
-				i_start = i_end;
+				if (i_end != i_start) {
+					i_start = i_end;
+				}
+				else {
+					/* highly unlikely, but prevent eternal loop */
+					i_start++;
+				}
 			}
 		}
 
diff --git a/source/blender/editors/space_text/text_format.c b/source/blender/editors/space_text/text_format.c
index 294f94d..a8c2de1 100644
--- a/source/blender/editors/space_text/text_format.c
+++ b/source/blender/editors/space_text/text_format.c
@@ -140,6 +140,54 @@ int text_check_format_len(TextLine *line, unsigned int len)
 	return 1;
 }
 
+/**
+ * Fill the string with formatting constant,
+ * advancing \a str_p and \a fmt_p
+ *
+ * \param len length in bytes
+ */
+void text_format_fill(const char **str_p, char **fmt_p, const char type, const int len)
+{
+	const char *str = *str_p;
+	char *fmt = *fmt_p;
+	int i = 0;
+
+	while (i < len) {
+		const int size = BLI_str_utf8_size_safe(str);
+		*fmt++ = type;
+
+		str += size;
+		i   += size;
+	}
+
+	str--;
+	fmt--;
+
+	BLI_assert(*str != '\0');
+
+	*str_p = str;
+	*fmt_p = fmt;
+}
+/**
+ * ascii version of #text_format_fill,
+ * use when we no the text being stepped over is ascii (as is the case for most keywords)
+ */
+void text_format_fill_ascii(const char **str_p, char **fmt_p, const char type, const int len)
+{
+	const char *str = *str_p;
+	char *fmt = *fmt_p;
+
+	memset(fmt, type, len);
+
+	str += len - 1;
+	fmt += len - 1;
+
+	BLI_assert(*str != '\0');
+
+	*str_p = str;
+	*fmt_p = fmt;
+}
+
 /* *** Registration *** */
 static ListBase tft_lb = {NULL, NULL};
 void ED_text_format_register(TextFormatType *tft)
@@ -149,14 +197,31 @@ void ED_text_format_register(TextFormatType *tft)
 
 TextFormatType *ED_text_format_get(Text *text)
 {
-	/* NOTE: once more types are added we'll need to return some type based on 'text'
-	 * for now this function is more of a placeholder */
+	TextFormatType *tft;
+
+	if (text) {
+		const char *text_ext = strchr(text->id.name + 2, '.');
+		if (text_ext) {
+			text_ext++;  /* skip the '.' */
+			/* Check all text formats in the static list */
+			for (tft = tft_lb.first; tft; tft = tft->next) {
+				/* All formats should have an ext, but just in case */
+				const char **ext;
+				for (ext = tft->ext; *ext; ext++) {
+					/* If extension matches text name, return the matching tft */
+					if (BLI_strcasecmp(text_ext, *ext) == 0) {
+						return tft;
+					}
+				}
+			}
+		}
 
-	/* XXX, wrong, but OK for testing */
-	if (text && BLI_testextensie(text->id.name + 2, ".osl")) {
-		return tft_lb.last;
+		/* If we make it here we never found an extension that worked - return 
+		 * the "default" text format */
+		return tft_lb.first;
 	}
 	else {
+		/* Return the "default" text format */
 		return tft_lb.first;
 	}
 }
diff --git a/source/blender/editors/space_text/text_format.h b/source/blender/editors/space_text/text_format.h
index e593e41..808311c 100644
--- a/source/blender/editors/space_text/text_format.h
+++ b/source/blender/editors/space_text/text_format.h
@@ -49,18 +49,18 @@ enum {
 	FMT_CONT_TRIPLE             = (1 << 2),  /* triplets of quotes: """ or ''' */
 	FMT_CONT_QUOTESINGLE_TRIPLE = (FMT_CONT_TRIPLE | FMT_CONT_QUOTESINGLE),
 	FMT_CONT_QUOTEDOUBLE_TRIPLE = (FMT_CONT_TRIPLE | FMT_CONT_QUOTEDOUBLE),
-	FMT_CONT_COMMENT_C          = (1 << 3),  /* multi-line comments, OSL only (C style) */
-	FMT_CONT_COMMENT_CXX        = (1 << 4),  /* single-line comments, OSL only (C++ style) */
+	FMT_CONT_COMMENT_C          = (1 << 3)   /* multi-line comments, OSL only (C style) */
 };
 #define FMT_CONT_ALL \
-	(FMT_CONT_QUOTESINGLE | FMT_CONT_QUOTEDOUBLE | FMT_CONT_TRIPLE | FMT_CONT_COMMENT_C | FMT_CONT_COMMENT_CXX)
+	(FMT_CONT_QUOTESINGLE | FMT_CONT_QUOTEDOUBLE | FMT_CONT_TRIPLE | FMT_CONT_COMMENT_C)
 
 int  flatten_string(struct SpaceText *st, FlattenString *fs, const char *in);
 void flatten_string_free(FlattenString *fs);
 int  flatten_string_strlen(FlattenString *fs, const char *str);
 
 int  text_check_format_len(TextLine *line, unsigned int len);
-
+void text_format_fill(const char **str_p, char **fmt_p, const char type, const int len);
+void text_format_fill_ascii(const char **str_p, char **fmt_p, const char type, const int len);
 
 /* *** Generalize Formatting *** */
 typedef struct TextFormatType {
@@ -101,6 +101,7 @@ void            ED_text_format_register(TextFormatType *tft);
 /* formatters */
 void ED_text_format_register_py(void);
 void ED_text_format_register_osl(void);
+void ED_text_format_register_lua(void);
 
 #define STR_LITERAL_STARTSWITH(str, str_literal, len_var) \
 	(strncmp(str, str_literal, len_var = (sizeof(str_literal) - 1)) == 0)
diff --git a/source/blender/editors/space_text/text_format_lua.c b/source/blender/editors/space_text/text_format_lua.c
new file mode 100644
index 0000000..6c72e04
--- /dev/null
+++ b/source/blender/editors/space_text/text_format_lua.c
@@ -0,0 +1,318 @@
+/*
+ * ***** 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
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/editors/space_text/text_format_lua.c
+ *  \ingroup sptext
+ */
+
+#include <string.h>
+
+#include "BLI_blenlib.h"
+
+#include "DNA_text_types.h"
+#include "DNA_space_types.h"
+
+#include "BKE_text.h"
+
+#include "text_format.h"
+
+/* *** Lua Keywords (for format_line) *** */
+
+/* Checks the specified source string for a Lua keyword (minus boolean & 'nil'). 
+ * This name must start at the beginning of the source string and must be 
+ * followed by a non-identifier (see text_check_identifier(char)) or null char.
+ *
+ * If a keyword is found, the length of the matching word is returned.
+ * Otherwise, -1 is returned.
+ *
+ * See:
+ * http://www.lua.org/manual/5.1/manual.html#2.1
+ */
+
+static int txtfmt_lua_find_keyword(const char *string)
+{
+	int i, len;
+
+	if      (STR_LITERAL_STARTSWITH(string, "and",      len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "break",    len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "do",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "else",     len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "elseif",   len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "end",      len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "for",      len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "function", len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "if",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "in",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "local",    len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "not",      len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "or",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "repeat",   len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "return",   len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "then",     len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "until",    len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "while",    len)) i = len;
+	else                                                      i = 0;
+
+	/* If next source char is an identifier (eg. 'i' in "definate") no match */
+	if (i == 0 || text_check_identifier(string[i]))
+		return -1;
+	return i;
+}
+
+/* Checks the specified source string for a Lua special name/function. This 
+ * name must start at the beginning of the source string and must be followed 
+ * by a non-identifier (see text_check_identifier(char)) or null character.
+ *
+ * If a special name is found, the length of the matching name is returned.
+ * Otherwise, -1 is returned. 
+ * 
+ * See:
+ * http://www.lua.org/manual/5.1/manual.html#5.1
+ */
+
+static int txtfmt_lua_find_specialvar(const char *string)
+{
+	int i, len;
+
+	if      (STR_LITERAL_STARTSWITH(string, "assert",           len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "collectgarbage",   len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "dofile",           len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "error",            len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "_G",               len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "getfenv",          len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "getmetatable",     len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "__index",          len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "ipairs",           len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "load",             len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "loadfile",         len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "loadstring",       len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "next",             len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "pairs",            len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "pcall",            len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "print",            len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "rawequal",         len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "rawget",           len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "rawset",           len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "select",           len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "setfenv",          len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "setmetatable",     len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "tonumber",         len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "tostring",         len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "type",             len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "unpack",           len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "_VERSION",         len))   i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "xpcall",           len))   i = len;
+	else                                                i = 0;
+
+	/* If next source char is an identifier (eg. 'i' in "definate") no match */
+	if (i == 0 || text_check_identifier(string[i]))
+		return -1;
+	return i;
+}
+
+static int txtfmt_lua_find_bool(const char *string)
+{
+	int i, len;
+
+	if      (STR_LITERAL_STARTSWITH(string, "nil",   len))  i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "true",  len))  i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "false", len))  i = len;
+	else                                                    i = 0;
+
+	/* If next source char is an identifier (eg. 'i' in "Nonetheless") no match */
+	if (i == 0 || text_check_identifier(string[i]))
+		return -1;
+	return i;
+}
+
+static char txtfmt_lua_format_identifier(const char *str)
+{
+	char fmt;
+	if      ((txtfmt_lua_find_specialvar(str))  != -1) fmt = FMT_TYPE_SPECIAL;
+	else if ((txtfmt_lua_find_keyword(str))     != -1) fmt = FMT_TYPE_KEYWORD;
+	else                                               fmt = FMT_TYPE_DEFAULT;
+	return fmt;
+}
+
+static void txtfmt_lua_format_line(SpaceText *st, TextLine *line, const int do_next)
+{
+	FlattenString fs;
+	const char *str;
+	char *fmt;
+	char cont_orig, cont, find, prev = ' ';
+	int len, i;
+
+	/* Get continuation from previous line */
+	if (line->prev && line->prev->format != NULL) {
+		fmt = line->prev->format;
+		cont = fmt[strlen(fmt) + 1]; /* Just after the null-terminator */
+		BLI_assert((FMT_CONT_ALL & cont) == cont);
+	}
+	else {
+		cont = FMT_CONT_NOP;
+	}
+
+	/* Get original continuation from this line */
+	if (line->format != NULL) {
+		fmt = line->format;
+		cont_orig = fmt[strlen(fmt) + 1]; /* Just after the null-terminator */
+		BLI_assert((FMT_CONT_ALL & cont_orig) == cont_orig);
+	}
+	else {
+		cont_orig = 0xFF;
+	}
+
+	len = flatten_string(st, &fs, line->line);
+	str = fs.buf;
+	if (!text_check_format_len(line, len)) {
+		flatten_string_free(&fs);
+		return;
+	}
+	fmt = line->format;
+
+	while (*str) {
+		/* Handle escape sequences by skipping both \ and next char */
+		if (*str == '\\') {
+			*fmt = prev; fmt++; str++;
+			if (*str == '\0') break;
+			*fmt = prev; fmt++; str += BLI_str_utf8_size_safe(str);
+			continue;
+		}
+		/* Handle continuations */
+		else if (cont) {
+			/* Multi-line comments */
+			if (cont & FMT_CONT_COMMENT_C) {
+				if (*str == ']' && *(str + 1) == ']') {
+					*fmt = FMT_TYPE_COMMENT; fmt++; str++;
+					*fmt = FMT_TYPE_COMMENT;
+					cont = FMT_CONT_NOP;
+				}
+				else {
+					*fmt = FMT_TYPE_COMMENT;
+				}
+				/* Handle other comments */
+			}
+			else {
+				find = (cont & FMT_CONT_QUOTEDOUBLE) ? '"' : '\'';
+				if (*str == find) cont = 0;
+				*fmt = FMT_TYPE_STRING;
+			}
+
+			str += BLI_str_utf8_size_safe(str) - 1;
+		}
+		/* Not in a string... */
+		else {
+			/* Multi-line comments */
+			if (*str == '-'       && *(str + 1) == '-' &&
+			    *(str + 2) == '[' && *(str + 3) == '[')
+			{
+				cont = FMT_CONT_COMMENT_C;
+				*fmt = FMT_TYPE_COMMENT; fmt++; str++;
+				*fmt = FMT_TYPE_COMMENT; fmt++; str++;
+				*fmt = FMT_TYPE_COMMENT; fmt++; str++;
+				*fmt = FMT_TYPE_COMMENT;
+			}
+			/* Single line comment */
+			else if (*str == '-' && *(str + 1) == '-') {
+				text_format_fill(&str, &fmt, FMT_TYPE_COMMENT, len - (int)(str - fs.buf));
+			}
+			else if (*str == '"' || *str == '\'') {
+				/* Strings */
+				find = *str;
+				cont = (*str == '"') ? FMT_CONT_QUOTEDOUBLE : FMT_CONT_QUOTESINGLE;
+				*fmt = FMT_TYPE_STRING;
+			}
+			/* Whitespace (all ws. has been converted to spaces) */
+			else if (*str == ' ') {
+				*fmt = FMT_TYPE_WHITESPACE;
+			}
+			/* Numbers (digits not part of an identifier and periods followed by digits) */
+			else if ((prev != FMT_TYPE_DEFAULT && text_check_digit(*str)) ||
+			         (*str == '.' && text_check_digit(*(str + 1))))
+			{
+				*fmt = FMT_TYPE_NUMERAL;
+			}
+			/* Booleans */
+			else if (prev != FMT_TYPE_DEFAULT && (i = txtfmt_lua_find_bool(str)) != -1) {
+				if (i > 0) {
+					text_format_fill_ascii(&str, &fmt, FMT_TYPE_NUMERAL, i);
+				}
+				else {
+					str += BLI_str_utf8_size_safe(str) - 1;
+					*fmt = FMT_TYPE_DEFAULT;
+				}
+			}
+			/* Punctuation */
+			else if ((*str != '#') && text_check_delim(*str)) {
+				*fmt = FMT_TYPE_SYMBOL;
+			}
+			/* Identifiers and other text (no previous ws. or delims. so text continues) */
+			else if (prev == FMT_TYPE_DEFAULT) {
+				str += BLI_str_utf8_size_safe(str) - 1;
+				*fmt = FMT_TYPE_DEFAULT;
+			}
+			/* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
+			else {
+				/* Special vars(v) or built-in keywords(b) */
+				/* keep in sync with 'txtfmt_osl_format_identifier()' */
+				if      ((i = txtfmt_lua_find_specialvar(str))   != -1) prev = FMT_TYPE_SPECIAL;
+				else if ((i = txtfmt_lua_find_keyword(str))      != -1) prev = FMT_TYPE_KEYWORD;
+
+				if (i > 0) {
+					text_format_fill_ascii(&str, &fmt, prev, i);
+				}
+				else {
+					str += BLI_str_utf8_size_safe(str) - 1;
+					*fmt = FMT_TYPE_DEFAULT;
+				}
+			}
+		}
+		prev = *fmt; fmt++; str++;
+	}
+
+	/* Terminate and add continuation char */
+	*fmt = '\0'; fmt++;
+	*fmt = cont;
+
+	/* If continuation has changed and we're allowed, process the next line */
+	if (cont != cont_orig && do_next && line->next) {
+		txtfmt_lua_format_line(st, line->next, do_next);
+	}
+
+	flatten_string_free(&fs);
+}
+
+void ED_text_format_register_lua(void)
+{
+	static TextFormatType tft = {0};
+	static const char *ext[] = {"lua", NULL};
+
+	tft.format_identifier = txtfmt_lua_format_identifier;
+	tft.format_line       = txtfmt_lua_format_line;
+	tft.ext = ext;
+
+	ED_text_format_register(&tft);
+}
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c
index 3120e88..7d493eb 100644
--- a/source/blender/editors/space_text/text_format_osl.c
+++ b/source/blender/editors/space_text/text_format_osl.c
@@ -228,10 +228,7 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_n
 		/* Handle continuations */
 		else if (cont) {
 			/* C-Style comments */
-			if (cont & FMT_CONT_COMMENT_CXX) {
-				*fmt = FMT_TYPE_COMMENT;
-			}
-			else if (cont & FMT_CONT_COMMENT_C) {
+			if (cont & FMT_CONT_COMMENT_C) {
 				if (*str == '*' && *(str + 1) == '/') {
 					*fmt = FMT_TYPE_COMMENT; fmt++; str++;
 					*fmt = FMT_TYPE_COMMENT;
@@ -254,8 +251,8 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_n
 		else {
 			/* Deal with comments first */
 			if (*str == '/' && *(str + 1) == '/') {
-				cont = FMT_CONT_COMMENT_CXX;
-				*fmt = FMT_TYPE_COMMENT;
+				/* fill the remaining line */
+				text_format_fill(&str, &fmt, FMT_TYPE_COMMENT, len - (int)(str - fs.buf));
 			}
 			/* C-Style (multi-line) comments */
 			else if (*str == '/' && *(str + 1) == '*') {
@@ -298,8 +295,12 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_n
 				else if ((i = txtfmt_osl_find_preprocessor(str)) != -1) prev = FMT_TYPE_DIRECTIVE;
 
 				if (i > 0) {
-					memset(fmt, prev, i);
-					i--; fmt += i; str += i;
+					if (prev == FMT_TYPE_DIRECTIVE) {  /* can contain utf8 */
+						text_format_fill(&str, &fmt, prev, i);
+					}
+					else {
+						text_format_fill_ascii(&str, &fmt, prev, i);
+					}
 				}
 				else {
 					str += BLI_str_utf8_size_safe(str) - 1;
diff --git a/source/blender/editors/space_text/text_format_py.c b/source/blender/editors/space_text/text_format_py.c
index cbccc6a..902d60d 100644
--- a/source/blender/editors/space_text/text_format_py.c
+++ b/source/blender/editors/space_text/text_format_py.c
@@ -231,9 +231,9 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const int do_ne
 		/* Not in a string... */
 		else {
 			/* Deal with comments first */
-			if (prev == FMT_TYPE_COMMENT || *str == '#') {
-				*fmt = FMT_TYPE_COMMENT;
-				str += BLI_str_utf8_size_safe(str) - 1;
+			if (*str == '#') {
+				/* fill the remaining line */
+				text_format_fill(&str, &fmt, FMT_TYPE_COMMENT, len - (int)(str - fs.buf));
 			}
 			else if (*str == '"' || *str == '\'') {
 				/* Strings */
@@ -259,8 +259,7 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const int do_ne
 			/* Booleans */
 			else if (prev != FMT_TYPE_DEFAULT && (i = txtfmt_py_find_bool(str)) != -1) {
 				if (i > 0) {
-					memset(fmt, FMT_TYPE_NUMERAL, i);
-					i--; fmt += i; str += i;
+					text_format_fill_ascii(&str, &fmt, FMT_TYPE_NUMERAL, i);
 				}
 				else {
 					str += BLI_str_utf8_size_safe(str) - 1;
@@ -285,8 +284,12 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const int do_ne
 				else if ((i = txtfmt_py_find_decorator(str))    != -1) prev = FMT_TYPE_DIRECTIVE;
 
 				if (i > 0) {
-					memset(fmt, prev, i);
-					i--; fmt += i; str += i;
+					if (prev == FMT_TYPE_DIRECTIVE) {  /* can contain utf8 */
+						text_format_fill(&str, &fmt, prev, i);
+					}
+					else {
+						text_format_fill_ascii(&str, &fmt, prev, i);
+					}
 				}
 				else {
 					str += BLI_str_utf8_size_safe(str) - 1;
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 21966ef..9b5d453 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -161,11 +161,12 @@ void text_update_edited(Text *text)
 static int text_new_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	SpaceText *st = CTX_wm_space_text(C);
+	Main *bmain = CTX_data_main(C);
 	Text *text;
 	PointerRNA ptr, idptr;
 	PropertyRNA *prop;
 
-	text = BKE_text_add("Text");
+	text = BKE_text_add(bmain, "Text");
 
 	/* hook into UI */
 	uiIDContextProperty(C, &ptr, &prop);
@@ -226,6 +227,7 @@ static int text_open_cancel(bContext *UNUSED(C), wmOperator *op)
 static int text_open_exec(bContext *C, wmOperator *op)
 {
 	SpaceText *st = CTX_wm_space_text(C);
+	Main *bmain = CTX_data_main(C);
 	Text *text;
 	PropertyPointerRNA *pprop;
 	PointerRNA idptr;
@@ -234,7 +236,7 @@ static int text_open_exec(bContext *C, wmOperator *op)
 
 	RNA_string_get(op->ptr, "filepath", str);
 
-	text = BKE_text_load(str, G.main->name);
+	text = BKE_text_load(bmain, str, G.main->name);
 
 	if (!text) {
 		if (op->customdata) MEM_freeN(op->customdata);
@@ -1310,9 +1312,11 @@ void TEXT_OT_select_line(wmOperatorType *ot)
 static int text_select_word_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Text *text = CTX_data_edit_text(C);
+	/* don't advance cursor before stepping */
+	const bool use_init_step = false;
 
-	txt_jump_left(text, 0);
-	txt_jump_right(text, 1);
+	txt_jump_left(text, false, use_init_step);
+	txt_jump_right(text, true, use_init_step);
 
 	text_update_cursor_moved(C);
 	WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
@@ -1814,11 +1818,11 @@ static int text_move_cursor(bContext *C, int type, int select)
 			break;
 
 		case PREV_WORD:
-			txt_jump_left(text, select);
+			txt_jump_left(text, select, true);
 			break;
 
 		case NEXT_WORD:
-			txt_jump_right(text, select);
+			txt_jump_right(text, select, true);
 			break;
 
 		case PREV_CHAR:
@@ -1925,7 +1929,7 @@ static int text_jump_exec(bContext *C, wmOperator *op)
 
 static int text_jump_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
-	return WM_operator_props_dialog_popup(C, op, 200, 100);
+	return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y);
 
 }
 
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 13c1938..e5bd9e6 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -92,7 +92,7 @@ static void time_draw_sfra_efra(Scene *scene, View2D *v2d)
 
 #define CACHE_DRAW_HEIGHT   3.0f
 
-static void time_draw_cache(SpaceTime *stime, Object *ob)
+static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
 {
 	PTCacheID *pid;
 	ListBase pidlist;
@@ -102,7 +102,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
 	if (!(stime->cache_display & TIME_CACHE_DISPLAY) || (!ob))
 		return;
 
-	BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+	BKE_ptcache_ids_from_object(&pidlist, ob, scene, 0);
 
 	/* iterate over pointcaches on the active object, 
 	 * add spacetimecache and vertex array for each */
@@ -128,6 +128,9 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
 			case PTCACHE_TYPE_DYNAMICPAINT:
 				if (!(stime->cache_display & TIME_CACHE_DYNAMICPAINT)) continue;
 				break;
+			case PTCACHE_TYPE_RIGIDBODY:
+				if (!(stime->cache_display & TIME_CACHE_RIGIDBODY)) continue;
+				break;
 		}
 
 		if (pid->cache->cached_frames == NULL)
@@ -193,6 +196,10 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
 				col[0] = 1.0;   col[1] = 0.1;   col[2] = 0.75;
 				col[3] = 0.1;
 				break;
+			case PTCACHE_TYPE_RIGIDBODY:
+				col[0] = 1.0;   col[1] = 0.6;   col[2] = 0.0;
+				col[3] = 0.1;
+				break;
 			default:
 				BLI_assert(0);
 				col[0] = 1.0;   col[1] = 0.0;   col[2] = 1.0;
@@ -499,7 +506,7 @@ static void time_main_area_draw(const bContext *C, ARegion *ar)
 	draw_markers_time(C, 0);
 	
 	/* caches */
-	time_draw_cache(stime, obact);
+	time_draw_cache(stime, obact, scene);
 	
 	/* reset view matrix */
 	UI_view2d_view_restore(C);
@@ -648,6 +655,7 @@ static void time_init(wmWindowManager *UNUSED(wm), ScrArea *sa)
 	stime->cache_display |= TIME_CACHE_DISPLAY;
 	stime->cache_display |= (TIME_CACHE_SOFTBODY | TIME_CACHE_PARTICLES);
 	stime->cache_display |= (TIME_CACHE_CLOTH | TIME_CACHE_SMOKE | TIME_CACHE_DYNAMICPAINT);
+	stime->cache_display |= TIME_CACHE_RIGIDBODY;
 }
 
 static SpaceLink *time_duplicate(SpaceLink *sl)
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index fa72f28..2cef10e 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -236,8 +236,9 @@ static struct TextureDrawState {
 	Object *ob;
 	int is_lit, is_tex;
 	int color_profile;
+	bool use_backface_culling;
 	unsigned char obcol[4];
-} Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}};
+} Gtexdraw = {NULL, 0, 0, 0, false, {0, 0, 0, 0}};
 
 static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *ma, struct TextureDrawState gtexdraw)
 {
@@ -250,7 +251,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
 	static int c_has_texface;
 
 	Object *litob = NULL;  /* to get mode to turn off mipmap in painting mode */
-	int backculled = GEMAT_BACKCULL;
+	int backculled = GEMAT_BACKCULL || gtexdraw.use_backface_culling;
 	int alphablend = 0;
 	int textured = 0;
 	int lit = 0;
@@ -274,7 +275,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
 	if (ma) {
 		alphablend = ma->game.alpha_blend;
 		if (ma->mode & MA_SHLESS) lit = 0;
-		backculled = ma->game.flag & GEMAT_BACKCULL;
+		backculled = (ma->game.flag & GEMAT_BACKCULL) || gtexdraw.use_backface_culling;
 	}
 
 	if (texface) {
@@ -375,17 +376,12 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
 	Gtexdraw.is_tex = is_tex;
 
 	Gtexdraw.color_profile = BKE_scene_check_color_management_enabled(scene);
+	Gtexdraw.use_backface_culling = (v3d->flag2 & V3D_BACKFACE_CULLING) != 0;
 
 	memcpy(Gtexdraw.obcol, obcol, sizeof(obcol));
 	set_draw_settings_cached(1, NULL, NULL, Gtexdraw);
 	glShadeModel(GL_SMOOTH);
-	if (v3d->flag2 & V3D_BACKFACE_CULLING) {
-		glEnable(GL_CULL_FACE);
-		glCullFace(GL_BACK);
-	}
-	else {
-		glDisable(GL_CULL_FACE);
-	}
+	glCullFace(GL_BACK);
 	glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, (me->flag & ME_TWOSIDED) ? GL_TRUE : GL_FALSE);
 }
 
@@ -458,12 +454,15 @@ static DMDrawOption draw_mcol__set_draw_legacy(MTFace *UNUSED(tface), int has_mc
 		return DM_DRAW_OPTION_NO_MCOL;
 }
 
-static DMDrawOption draw_tface__set_draw(MTFace *UNUSED(tface), int UNUSED(has_mcol), int matnr)
+static DMDrawOption draw_tface__set_draw(MTFace *tface, int UNUSED(has_mcol), int matnr)
 {
 	Material *ma = give_current_material(Gtexdraw.ob, matnr + 1);
 
 	if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0;
 
+	if (tface)
+		set_draw_settings_cached(0, tface, ma, Gtexdraw);
+
 	/* always use color from mcol, as set in update_tface_color_layer */
 	return DM_DRAW_OPTION_NORMAL;
 }
@@ -937,7 +936,8 @@ static int tex_mat_set_face_editmesh_cb(void *userData, int index)
 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                         Object *ob, DerivedMesh *dm, const int draw_flags)
 {
-	if ((!BKE_scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_MODIFIERS_PREVIEW)) {
+	/* if not cycles, or preview-modifiers, or drawing matcaps */
+	if ((!BKE_scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_MODIFIERS_PREVIEW) || (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)) {
 		draw_mesh_textured_old(scene, v3d, rv3d, ob, dm, draw_flags);
 		return;
 	}
@@ -1067,7 +1067,7 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
 		draw_mesh_face_select(rv3d, me, dm);
 	}
 	else if ((do_light == FALSE) || (ob->dtx & OB_DRAWWIRE)) {
-		const int use_depth = (v3d->flag & V3D_ZBUF_SELECT);
+		const int use_depth = (v3d->flag & V3D_ZBUF_SELECT) || !(ob->mode & OB_MODE_WEIGHT_PAINT);
 
 		/* weight paint in solid mode, special case. focus on making the weights clear
 		 * rather than the shading, this is also forced in wire view */
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 76f73e1..6dd3ecc 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -88,6 +88,7 @@
 #include "ED_types.h"
 
 #include "UI_resources.h"
+#include "UI_interface_icons.h"
 
 #include "WM_api.h"
 #include "BLF_api.h"
@@ -168,17 +169,26 @@ static void ob_wire_color_blend_theme_id(const unsigned char ob_wire_col[4], con
 }
 
 /* this condition has been made more complex since editmode can draw textures */
-static int check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
+static bool check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
 {
 	/* texture and material draw modes */
-	if (ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) && drawtype > OB_SOLID)
-		return TRUE;
+	if (ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) && drawtype > OB_SOLID) {
+		return true;
+	}
 
 	/* textured solid */
-	if (v3d->drawtype == OB_SOLID && (v3d->flag2 & V3D_SOLID_TEX) && !BKE_scene_use_new_shading_nodes(scene))
-		return TRUE;
+	if ((v3d->drawtype == OB_SOLID) &&
+	    (v3d->flag2 & V3D_SOLID_TEX) &&
+	    (BKE_scene_use_new_shading_nodes(scene) == false))
+	{
+		return true;
+	}
 	
-	return FALSE;
+	if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP) {
+		return true;
+	}
+	
+	return false;
 }
 
 static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
@@ -206,7 +216,7 @@ static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
 
 /* check for glsl drawing */
 
-int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, const short dt)
+int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, const char dt)
 {
 	if (!GPU_glsl_support())
 		return 0;
@@ -216,6 +226,10 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, const short dt)
 		return 0;
 	if (ob == OBACT && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
 		return 0;
+	
+	if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)
+		return 1;
+	
 	if (BKE_scene_use_new_shading_nodes(scene))
 		return 0;
 	
@@ -1077,7 +1091,7 @@ static void draw_transp_spot_volume(Lamp *la, float x, float z)
 }
 
 static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
-                     const short dt, const short dflag, const unsigned char ob_wire_col[4])
+                     const char dt, const short dflag, const unsigned char ob_wire_col[4])
 {
 	Object *ob = base->object;
 	const float pixsize = ED_view3d_pixel_size(rv3d, ob->obmat[3]);
@@ -2639,16 +2653,21 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
 		BMFace *f;
 		int n;
 
-#define DRAW_EM_MEASURE_STATS_FACEAREA()                                      \
-	if (BM_elem_flag_test(f, BM_ELEM_SELECT)) {                               \
-		mul_v3_fl(vmid, 1.0f / (float)n);                                     \
-		if (unit->system)                                                     \
-			bUnit_AsString(numstr, sizeof(numstr),                            \
-			               (double)(area * unit->scale_length),               \
-			               3, unit->system, B_UNIT_LENGTH, do_split, FALSE);  \
-		else                                                                  \
-			BLI_snprintf(numstr, sizeof(numstr), conv_float, area);           \
-		view3d_cached_text_draw_add(vmid, numstr, 0, txt_flag, col);          \
+#define DRAW_EM_MEASURE_STATS_FACEAREA()                                                 \
+	if (BM_elem_flag_test(f, BM_ELEM_SELECT)) {                                          \
+		mul_v3_fl(vmid, 1.0f / (float)n);                                                \
+		if (unit->system) {                                                              \
+			bUnit_AsString(numstr, sizeof(numstr),                                       \
+			               (double)(area * unit->scale_length * unit->scale_length),     \
+			               3, unit->system, B_UNIT_AREA, do_split, FALSE);               \
+			view3d_cached_text_draw_add(vmid, numstr, 0,                                 \
+			                            /* Metric system uses unicode "squared" sign! */ \
+			                            txt_flag ^ V3D_CACHE_TEXT_ASCII, col);           \
+		}                                                                                \
+		else {                                                                           \
+			BLI_snprintf(numstr, sizeof(numstr), conv_float, area);                      \
+			view3d_cached_text_draw_add(vmid, numstr, 0, txt_flag, col);                 \
+		}                                                                                \
 	} (void)0
 
 		UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
@@ -2820,7 +2839,7 @@ static DMDrawOption draw_em_fancy__setGLSLFaceOpts(void *userData, int index)
 }
 
 static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
-                          Object *ob, BMEditMesh *em, DerivedMesh *cageDM, DerivedMesh *finalDM, const short dt)
+                          Object *ob, BMEditMesh *em, DerivedMesh *cageDM, DerivedMesh *finalDM, const char dt)
 
 {
 	Mesh *me = ob->data;
@@ -3026,7 +3045,7 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm)
 }
 
 static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, Base *base,
-                            const short dt, const unsigned char ob_wire_col[4], const short dflag)
+                            const char dt, const unsigned char ob_wire_col[4], const short dflag)
 {
 	Object *ob = base->object;
 	Mesh *me = ob->data;
@@ -3235,7 +3254,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 			glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
 		}
 		
-		dm->drawEdges(dm, (dt == OB_WIRE || totface == 0), me->drawflag & ME_ALLEDGES);
+		dm->drawEdges(dm, (dt == OB_WIRE || totface == 0), (ob->dtx & OB_DRAW_ALL_EDGES));
 
 		if (dt != OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
 			glDepthMask(1);
@@ -3261,7 +3280,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
 /* returns 1 if nothing was drawn, for detecting to draw an object center */
 static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, Base *base,
-                            const short dt, const unsigned char ob_wire_col[4], const short dflag)
+                            const char dt, const unsigned char ob_wire_col[4], const short dflag)
 {
 	Object *ob = base->object;
 	Object *obedit = scene->obedit;
@@ -3583,7 +3602,7 @@ static void drawCurveDMWired(Object *ob)
 }
 
 /* return 1 when nothing was drawn */
-static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, const short dt)
+static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, const char dt)
 {
 	Object *ob = base->object;
 	DerivedMesh *dm = ob->derivedFinal;
@@ -3619,7 +3638,7 @@ static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, B
  * \return 1 when nothing was drawn
  */
 static int drawDispList_nobackface(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
-                                   const short dt, const short dflag, const unsigned char ob_wire_col[4])
+                                   const char dt, const short dflag, const unsigned char ob_wire_col[4])
 {
 	Object *ob = base->object;
 	ListBase *lb = NULL;
@@ -3745,7 +3764,7 @@ static int drawDispList_nobackface(Scene *scene, View3D *v3d, RegionView3D *rv3d
 	return FALSE;
 }
 static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
-                        const short dt, const short dflag, const unsigned char ob_wire_col[4])
+                        const char dt, const short dflag, const unsigned char ob_wire_col[4])
 {
 	int retval;
 
@@ -4909,9 +4928,9 @@ static void ob_draw_RE_motion(float com[3], float rotscale[3][3], float itw, flo
 	glEnd();
 }
 
-/*place to add drawers */
+/* place to add drawers */
 
-static void tekenhandlesN(Nurb *nu, short sel, short hide_handles)
+static void drawhandlesN(Nurb *nu, short sel, short hide_handles)
 {
 	BezTriple *bezt;
 	float *fp;
@@ -4971,7 +4990,7 @@ static void tekenhandlesN(Nurb *nu, short sel, short hide_handles)
 	glEnd();
 }
 
-static void tekenhandlesN_active(Nurb *nu)
+static void drawhandlesN_active(Nurb *nu)
 {
 	BezTriple *bezt;
 	float *fp;
@@ -5006,7 +5025,7 @@ static void tekenhandlesN_active(Nurb *nu)
 	glLineWidth(1);
 }
 
-static void tekenvertsN(Nurb *nu, short sel, short hide_handles, void *lastsel)
+static void drawvertsN(Nurb *nu, short sel, short hide_handles, void *lastsel)
 {
 	BezTriple *bezt;
 	BPoint *bp;
@@ -5262,7 +5281,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
 }
 
 static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, Nurb *nurb,
-                     const short dt, const short dflag, const unsigned char ob_wire_col[4])
+                     const char dt, const short dflag, const unsigned char ob_wire_col[4])
 {
 	ToolSettings *ts = scene->toolsettings;
 	Object *ob = base->object;
@@ -5286,8 +5305,8 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
 	for (nu = nurb; nu; nu = nu->next) {
 		if (nu->type == CU_BEZIER) {
 			if (index == cu->actnu && !hide_handles)
-				tekenhandlesN_active(nu);
-			tekenhandlesN(nu, 0, hide_handles);
+				drawhandlesN_active(nu);
+			drawhandlesN(nu, 0, hide_handles);
 		}
 		index++;
 	}
@@ -5296,8 +5315,8 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
 	/* selected handles */
 	for (nu = nurb; nu; nu = nu->next) {
 		if (nu->type == CU_BEZIER && (cu->drawflag & CU_HIDE_HANDLES) == 0)
-			tekenhandlesN(nu, 1, hide_handles);
-		tekenvertsN(nu, 0, hide_handles, NULL);
+			drawhandlesN(nu, 1, hide_handles);
+		drawvertsN(nu, 0, hide_handles, NULL);
 	}
 	
 	if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
@@ -5348,7 +5367,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
 	if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
 	
 	for (nu = nurb; nu; nu = nu->next) {
-		tekenvertsN(nu, 1, hide_handles, cu->lastsel);
+		drawvertsN(nu, 1, hide_handles, cu->lastsel);
 	}
 	
 	if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
@@ -5410,39 +5429,6 @@ static void draw_empty_cone(float size)
 	gluDeleteQuadric(qobj);
 }
 
-/* draw points on curve speed handles */
-#if 0  /* XXX old animation system stuff */
-static void curve_draw_speed(Scene *scene, Object *ob)
-{
-	Curve *cu = ob->data;
-	IpoCurve *icu;
-	BezTriple *bezt;
-	float loc[4], dir[3];
-	int a;
-	
-	if (cu->ipo == NULL)
-		return;
-	
-	icu = cu->ipo->curve.first;
-	if (icu == NULL || icu->totvert < 2)
-		return;
-	
-	glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
-	bglBegin(GL_POINTS);
-
-	for (a = 0, bezt = icu->bezt; a < icu->totvert; a++, bezt++) {
-		if (where_on_path(ob, bezt->vec[1][1], loc, dir)) {
-			UI_ThemeColor((bezt->f2 & SELECT) && ob == OBACT ? TH_VERTEX_SELECT : TH_VERTEX);
-			bglVertex3fv(loc);
-		}
-	}
-
-	glPointSize(1.0);
-	bglEnd();
-}
-#endif  /* XXX old animation system stuff */
-
-
 static void draw_textcurs(RegionView3D *rv3d, float textcurs[4][2])
 {
 	cpack(0);
@@ -5546,7 +5532,7 @@ static void drawcircle_size(float size)
 
 }
 
-/* needs fixing if non-identity matrice used */
+/* needs fixing if non-identity matrix used */
 static void drawtube(const float vec[3], float radius, float height, float tmat[4][4])
 {
 	float cur[3];
@@ -5568,7 +5554,8 @@ static void drawtube(const float vec[3], float radius, float height, float tmat[
 	glVertex3f(cur[0], cur[1] - radius, cur[2]);
 	glEnd();
 }
-/* needs fixing if non-identity matrice used */
+
+/* needs fixing if non-identity matrix used */
 static void drawcone(const float vec[3], float radius, float height, float tmat[4][4])
 {
 	float cur[3];
@@ -5589,9 +5576,10 @@ static void drawcone(const float vec[3], float radius, float height, float tmat[
 	glVertex3f(cur[0], cur[1] - radius, cur[2]);
 	glEnd();
 }
+
 /* return TRUE if nothing was drawn */
 static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
-                     const short dt, const short dflag, const unsigned char ob_wire_col[4])
+                     const char dt, const short dflag, const unsigned char ob_wire_col[4])
 {
 	Object *ob = base->object;
 	MetaBall *mb;
@@ -5637,7 +5625,6 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
 	}
 	
 	while (ml) {
-
 		/* draw radius */
 		if (mb->editelems) {
 			if ((dflag & DRAW_CONSTCOLOR) == 0) {
@@ -6224,6 +6211,34 @@ static void draw_object_wire_color(Scene *scene, Base *base, unsigned char r_ob_
 	r_ob_wire_col[3] = 255;
 }
 
+static void draw_object_matcap_check(Scene *scene, View3D *v3d, Object *ob)
+{
+	/* fixed rule, active object draws as matcap */
+	if (ob == OBACT) {
+		if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))
+			return;
+			
+		if (v3d->defmaterial == NULL) {
+			extern Material defmaterial;
+			
+			v3d->defmaterial = MEM_mallocN(sizeof(Material), "matcap material");
+			*(v3d->defmaterial) = defmaterial;
+			v3d->defmaterial->gpumaterial.first = v3d->defmaterial->gpumaterial.last = NULL;
+			v3d->defmaterial->preview = NULL;
+		}
+		/* first time users */
+		if (v3d->matcap_icon == 0)
+			v3d->matcap_icon = ICON_MATCAP_01;
+		
+		if (v3d->defmaterial->preview == NULL)
+			v3d->defmaterial->preview = UI_icon_to_preview(v3d->matcap_icon);
+		
+		/* signal to all material checks, gets cleared below */
+		v3d->flag2 |= V3D_SHOW_SOLID_MATCAP;
+	}
+
+}
+
 /**
  * main object drawing function, draws in selection
  * \param dflag (draw flag) can be DRAW_PICKING and/or DRAW_CONSTCOLOR, DRAW_SCENESET
@@ -6240,7 +6255,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 	unsigned char _ob_wire_col[4];      /* dont initialize this */
 	unsigned char *ob_wire_col = NULL;  /* dont initialize this, use NULL crashes as a way to find invalid use */
 	int i, selstart, selend, empty_object = 0;
-	short dt, dtx, zbufoff = 0;
+	short dtx;
+	char  dt;
+	short zbufoff = 0;
 	const short is_obact = (ob == OBACT);
 
 	/* only once set now, will be removed too, should become a global standard */
@@ -6311,6 +6328,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 	dt = MIN2(dt, ob->dt);
 	if (v3d->zbuf == 0 && dt > OB_WIRE) dt = OB_WIRE;
 	dtx = 0;
+	
+	/* matcap check */
+	if (dt == OB_SOLID && (v3d->flag2 & V3D_SOLID_MATCAP))
+		draw_object_matcap_check(scene, v3d, ob);
 
 	/* faceselect exception: also draw solid when (dt == wire), except in editmode */
 	if (is_obact && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) {
@@ -6754,7 +6775,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 		}
 
 		if (ob->gameflag & OB_BOUNDS) {
-			if (ob->boundtype != ob->collision_boundtype || (dtx & OB_BOUNDBOX) == 0) {
+			if (ob->boundtype != ob->collision_boundtype || (dtx & OB_DRAWBOUNDOX) == 0) {
 
 				setlinestyle(2);
 				draw_bounding_volume(scene, ob, ob->collision_boundtype);
@@ -6768,7 +6789,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 			if (dtx & OB_AXIS) {
 				drawaxes(1.0f, OB_ARROWS);
 			}
-			if (dtx & OB_BOUNDBOX) {
+			if (dtx & OB_DRAWBOUNDOX) {
 				draw_bounding_volume(scene, ob, ob->boundtype);
 			}
 			if (dtx & OB_TEXSPACE) {
@@ -6811,7 +6832,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 	/* return warning, this is cached text draw */
 	invert_m4_m4(ob->imat, ob->obmat);
 	view3d_cached_text_draw_end(v3d, ar, 1, NULL);
-
+	/* return warning, clear temp flag */
+	v3d->flag2 &= ~V3D_SHOW_SOLID_MATCAP;
+	
 	glLoadMatrixf(rv3d->viewmat);
 
 	if (zbufoff) {
@@ -7251,7 +7274,7 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r
 	if (dm) dm->release(dm);
 }
 
-void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, const short dt, int outline)
+void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, const char dt, int outline)
 {
 	if (ob == NULL)
 		return;
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 29daee3..70d3857 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -74,61 +74,18 @@
 
 #include "ED_mesh.h"
 
-
 #include "BLF_api.h"
 
-
 #include "view3d_intern.h"  // own include
 
+struct GPUTexture;
 
-#ifdef _WIN32
-#include <time.h>
-#include <stdio.h>
-#include <conio.h>
-#include <windows.h>
-
-static LARGE_INTEGER liFrequency;
-static LARGE_INTEGER liStartTime;
-static LARGE_INTEGER liCurrentTime;
+// #define DEBUG_DRAW_TIME
 
-static void tstart(void)
-{
-	QueryPerformanceFrequency(&liFrequency);
-	QueryPerformanceCounter(&liStartTime);
-}
-static void tend(void)
-{
-	QueryPerformanceCounter(&liCurrentTime);
-}
-static double tval(void)
-{
-	return ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart) * (double)1000.0 / (double)liFrequency.QuadPart));
-}
-#else
-#include <sys/time.h>
-static struct timeval _tstart, _tend;
-static struct timezone tz;
-static void tstart(void)
-{
-	gettimeofday(&_tstart, &tz);
-}
-static void tend(void)
-{
-	gettimeofday(&_tend, &tz);
-}
-  #if 0
-static double tval()
-{
-	double t1, t2;
-	t1 = ( double ) _tstart.tv_sec * 1000 + ( double ) _tstart.tv_usec / (1000);
-	t2 = ( double ) _tend.tv_sec * 1000 + ( double ) _tend.tv_usec / (1000);
-	return t2 - t1;
-}
-  #endif
+#ifdef DEBUG_DRAW_TIME
+#  include "PIL_time.h"
 #endif
 
-struct GPUTexture;
-
 static int intersect_edges(float *points, float a, float b, float c, float d, float edges[12][2][3])
 {
 	int i;
@@ -275,7 +232,10 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
 		return;
 	}
 
-	tstart();
+#ifdef DEBUG_DRAW_TIME
+	TIMEIT_START(draw);
+#endif
+
 	/* generate flame spectrum texture */
 	#define SPEC_WIDTH 256
 	#define FIRE_THRESH 7
@@ -522,8 +482,10 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
 		n++;
 	}
 
-	tend();
-	// printf ( "Draw Time: %f\n",(float) tval() );
+#ifdef DEBUG_DRAW_TIME
+	printf("Draw Time: %f\n", (float)TIMEIT_VALUE(draw));
+	TIMEIT_END(draw);
+#endif
 
 	if (tex_shadow)
 		GPU_texture_unbind(tex_shadow);
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 1d87895..658196a 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -32,6 +32,7 @@
 #include <string.h>
 #include <stdio.h>
 
+#include "DNA_material_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 
@@ -42,16 +43,18 @@
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"
 
-#include "BKE_object.h"
 #include "BKE_context.h"
+#include "BKE_icons.h"
+#include "BKE_object.h"
 #include "BKE_screen.h"
 
 #include "ED_space_api.h"
 #include "ED_screen.h"
 #include "ED_object.h"
 
-#include "BIF_gl.h"
+#include "GPU_material.h"
 
+#include "BIF_gl.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -143,7 +146,7 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C)
 	if (rv3d == NULL) {
 		ScrArea *sa = CTX_wm_area(C);
 		if (sa && sa->spacetype == SPACE_VIEW3D) {
-			ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+			ARegion *ar = BKE_area_find_region_active_win(sa);
 			if (ar) {
 				rv3d = ar->regiondata;
 			}
@@ -335,6 +338,14 @@ static void view3d_free(SpaceLink *sl)
 	if (vd->localvd) MEM_freeN(vd->localvd);
 	
 	if (vd->properties_storage) MEM_freeN(vd->properties_storage);
+	
+	/* matcap material, its preview rect gets freed via icons */
+	if (vd->defmaterial) {
+		if (vd->defmaterial->gpumaterial.first)
+			GPU_material_free(vd->defmaterial);
+		BKE_previewimg_free(&vd->defmaterial->preview);
+		MEM_freeN(vd->defmaterial);
+	}
 }
 
 
@@ -365,6 +376,8 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
 	
 	/* copy or clear inside new stuff */
 
+	v3dn->defmaterial = NULL;
+	
 	BLI_duplicatelist(&v3dn->bgpicbase, &v3do->bgpicbase);
 
 	v3dn->properties_storage = NULL;
@@ -584,6 +597,9 @@ static void view3d_main_area_free(ARegion *ar)
 			if (rv3d->depths->depths) MEM_freeN(rv3d->depths->depths);
 			MEM_freeN(rv3d->depths);
 		}
+		if (rv3d->sms) {
+			MEM_freeN(rv3d->sms);
+		}
 		MEM_freeN(rv3d);
 		ar->regiondata = NULL;
 	}
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index ec71628..bb28619 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -222,6 +222,9 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 				}
 			}
 		}
+		else {
+			totedgedata = bm->totedgesel;
+		}
 
 		/* check for defgroups */
 		if (evedef)
@@ -400,53 +403,43 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 		uiBlockBeginAlign(block);
 
 		/* Should be no need to translate these. */
-		but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, yi -= buth, 200, buth,
+		but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("X:"), 0, yi -= buth, 200, buth,
 		                &(tfp->ve_median[LOC_X]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
 		uiButSetUnitType(but, PROP_UNIT_LENGTH);
-		but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, yi -= buth, 200, buth,
+		but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Y:"), 0, yi -= buth, 200, buth,
 		                &(tfp->ve_median[LOC_Y]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
 		uiButSetUnitType(but, PROP_UNIT_LENGTH);
-		but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, yi -= buth, 200, buth,
+		but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Z:"), 0, yi -= buth, 200, buth,
 		                &(tfp->ve_median[LOC_Z]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
 		uiButSetUnitType(but, PROP_UNIT_LENGTH);
 
 		if (totcurvebweight == tot) {
-			uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, yi -= buth, 200, buth,
+			uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("W:"), 0, yi -= buth, 200, buth,
 			          &(tfp->ve_median[C_BWEIGHT]), 0.01, 100.0, 1, 3, "");
 		}
 
 		uiBlockBeginAlign(block);
 		uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, IFACE_("Global"),
 		             0, yi -= buth + but_margin, 100, buth,
-		             &v3d->flag, 0, 0, 0, 0, "Displays global values");
+		             &v3d->flag, 0, 0, 0, 0, TIP_("Displays global values"));
 		uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, IFACE_("Local"),
 		             100, yi, 100, buth,
-		             &v3d->flag, 0, 0, 0, 0, "Displays local values");
+		             &v3d->flag, 0, 0, 0, 0, TIP_("Displays local values"));
 		uiBlockEndAlign(block);
 
 		/* Meshes... */
 		if (meshdata) {
 			if (totedgedata) {
-				Mesh *me = ob->data;
-				BMEditMesh *em = me->edit_btmesh;
-				BMesh *bm = em->bm;
-
-				const int cd_edge_bweight_offset = CustomData_get_offset(&bm->edata, CD_BWEIGHT);
-				const int cd_edge_crease_offset  = CustomData_get_offset(&bm->edata, CD_CREASE);
-
-				if (cd_edge_crease_offset != -1) {
-					uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
-					          totedgedata == 1 ? IFACE_("Crease:") : IFACE_("Mean Crease:"),
-					          0, yi -= buth + but_margin, 200, buth,
-					          &(tfp->ve_median[M_CREASE]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
-				}
-
-				if (cd_edge_bweight_offset != -1) {
-					uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
-					          totedgedata == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"),
-					          0, yi -= buth + but_margin, 200, buth,
-					          &(tfp->ve_median[M_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
-				}
+				/* customdata layer added on demand */
+				uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
+				          totedgedata == 1 ? IFACE_("Crease:") : IFACE_("Mean Crease:"),
+				          0, yi -= buth + but_margin, 200, buth,
+				          &(tfp->ve_median[M_CREASE]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+				/* customdata layer added on demand */
+				uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
+				          totedgedata == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"),
+				          0, yi -= buth + but_margin, 200, buth,
+				          &(tfp->ve_median[M_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
 			}
 			if (totskinradius) {
 				uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
@@ -461,11 +454,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 		}
 		/* Curve... */
 		else if (totcurvedata == 1) {
-			uiDefButR(block, NUM, 0, "Weight", 0, yi -= buth + but_margin, 200, buth,
+			uiDefButR(block, NUM, 0, IFACE_("Weight"), 0, yi -= buth + but_margin, 200, buth,
 			          &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL);
-			uiDefButR(block, NUM, 0, "Radius", 0, yi -= buth + but_margin, 200, buth,
+			uiDefButR(block, NUM, 0, IFACE_("Radius"), 0, yi -= buth + but_margin, 200, buth,
 			          &data_ptr, "radius", 0, 0.0, 100.0, 1, 3, NULL);
-			uiDefButR(block, NUM, 0, "Tilt", 0, yi -= buth + but_margin, 200, buth,
+			uiDefButR(block, NUM, 0, IFACE_("Tilt"), 0, yi -= buth + but_margin, 200, buth,
 			          &data_ptr, "tilt", 0, -FLT_MAX, FLT_MAX, 1, 3, NULL);
 		}
 		else if (totcurvedata > 1) {
@@ -483,7 +476,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 		}
 		/* Lattice... */
 		else if (totlattdata == 1) {
-			uiDefButR(block, NUM, 0, "Weight", 0, yi -= buth + but_margin, 200, buth,
+			uiDefButR(block, NUM, 0, IFACE_("Weight"), 0, yi -= buth + but_margin, 200, buth,
 			          &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL);
 		}
 		else if (totlattdata > 1) {
@@ -529,7 +522,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 			}
 
 			if (median[M_CREASE] != 0.0f) {
-				const int cd_edge_crease_offset  = CustomData_get_offset(&bm->edata, CD_CREASE);
+				const int cd_edge_crease_offset  = (BM_mesh_cd_flag_ensure(bm, me, ME_CDFLAG_EDGE_CREASE),
+				                                    CustomData_get_offset(&bm->edata, CD_CREASE));
 				const float sca = compute_scale_factor(ve_median[M_CREASE], median[M_CREASE]);
 				BMEdge *eed;
 
@@ -561,7 +555,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 			}
 
 			if (median[M_WEIGHT] != 0.0f) {
-				const int cd_edge_bweight_offset  = CustomData_get_offset(&bm->edata, CD_BWEIGHT);
+				const int cd_edge_bweight_offset = (BM_mesh_cd_flag_ensure(bm, me, ME_CDFLAG_EDGE_BWEIGHT),
+				                                    CustomData_get_offset(&bm->edata, CD_BWEIGHT));
 				const float sca = compute_scale_factor(ve_median[M_WEIGHT], median[M_WEIGHT]);
 				BMEdge *eed;
 
@@ -1274,20 +1269,20 @@ void view3d_buttons_register(ARegionType *art)
 
 	pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
 	strcpy(pt->idname, "VIEW3D_PT_object");
-	strcpy(pt->label, "Transform");
+	strcpy(pt->label, N_("Transform"));  /* XXX C panels not  available through RNA (bpy.types)! */
 	pt->draw = view3d_panel_object;
 	BLI_addtail(&art->paneltypes, pt);
 
 	pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
 	strcpy(pt->idname, "VIEW3D_PT_gpencil");
-	strcpy(pt->label, "Grease Pencil");
+	strcpy(pt->label, N_("Grease Pencil"));  /* XXX C panels are not available through RNA (bpy.types)! */
 	pt->draw_header = gpencil_panel_standard_header;
 	pt->draw = gpencil_panel_standard;
 	BLI_addtail(&art->paneltypes, pt);
 
 	pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
 	strcpy(pt->idname, "VIEW3D_PT_vgroup");
-	strcpy(pt->label, "Vertex Groups");
+	strcpy(pt->label, N_("Vertex Groups"));  /* XXX C panels are not available through RNA (bpy.types)! */
 	pt->draw = view3d_panel_vgroup;
 	pt->poll = view3d_panel_vgroup_poll;
 	BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 67344a9..4aaa333 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -75,7 +75,9 @@
 #include "BIF_glutil.h"
 
 #include "WM_api.h"
+
 #include "BLF_api.h"
+#include "BLF_translation.h"
 
 #include "ED_armature.h"
 #include "ED_keyframing.h"
@@ -345,7 +347,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
 				CLAMP(blend_fac, 0.3f, 1.0f);
 
 
-				UI_ThemeColorBlend(TH_BACK, TH_GRID, blend_fac);
+				UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, blend_fac);
 
 				drawgrid_draw(ar, wx, wy, x, y, dx_scalar);
 			}
@@ -374,7 +376,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
 					}
 				}
 				else {  /* start blending out */
-					UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+					UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
 					drawgrid_draw(ar, wx, wy, x, y, dx);
 
 					UI_ThemeColor(TH_GRID);
@@ -382,7 +384,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
 				}
 			}
 			else {  /* start blending out (GRID_MIN_PX < dx < (GRID_MIN_PX * 10)) */
-				UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+				UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
 				drawgrid_draw(ar, wx, wy, x, y, dx);
 
 				UI_ThemeColor(TH_GRID);
@@ -401,21 +403,21 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
 						drawgrid_draw(ar, wx, wy, x, y, dx);
 					}
 					else {
-						UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+						UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
 						drawgrid_draw(ar, wx, wy, x, y, dx);
 						UI_ThemeColor(TH_GRID);
 						drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
 					}
 				}
 				else {
-					UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+					UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
 					drawgrid_draw(ar, wx, wy, x, y, dx);
 					UI_ThemeColor(TH_GRID);
 					drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
 				}
 			}
 			else {
-				UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+				UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
 				drawgrid_draw(ar, wx, wy, x, y, dx);
 				UI_ThemeColor(TH_GRID);
 				drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
@@ -804,28 +806,28 @@ static const char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
 	
 	switch (rv3d->view) {
 		case RV3D_VIEW_FRONT:
-			if (rv3d->persp == RV3D_ORTHO) name = "Front Ortho";
-			else name = "Front Persp";
+			if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Front Ortho");
+			else name = IFACE_("Front Persp");
 			break;
 		case RV3D_VIEW_BACK:
-			if (rv3d->persp == RV3D_ORTHO) name = "Back Ortho";
-			else name = "Back Persp";
+			if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Back Ortho");
+			else name = IFACE_("Back Persp");
 			break;
 		case RV3D_VIEW_TOP:
-			if (rv3d->persp == RV3D_ORTHO) name = "Top Ortho";
-			else name = "Top Persp";
+			if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Top Ortho");
+			else name = IFACE_("Top Persp");
 			break;
 		case RV3D_VIEW_BOTTOM:
-			if (rv3d->persp == RV3D_ORTHO) name = "Bottom Ortho";
-			else name = "Bottom Persp";
+			if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Bottom Ortho");
+			else name = IFACE_("Bottom Persp");
 			break;
 		case RV3D_VIEW_RIGHT:
-			if (rv3d->persp == RV3D_ORTHO) name = "Right Ortho";
-			else name = "Right Persp";
+			if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Right Ortho");
+			else name = IFACE_("Right Persp");
 			break;
 		case RV3D_VIEW_LEFT:
-			if (rv3d->persp == RV3D_ORTHO) name = "Left Ortho";
-			else name = "Left Persp";
+			if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Left Ortho");
+			else name = IFACE_("Left Persp");
 			break;
 			
 		default:
@@ -833,14 +835,14 @@ static const char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
 				if ((v3d->camera) && (v3d->camera->type == OB_CAMERA)) {
 					Camera *cam;
 					cam = v3d->camera->data;
-					name = (cam->type != CAM_ORTHO) ? "Camera Persp" : "Camera Ortho";
+					name = (cam->type != CAM_ORTHO) ? IFACE_("Camera Persp") : IFACE_("Camera Ortho");
 				}
 				else {
-					name = "Object as Camera";
+					name = IFACE_("Object as Camera");
 				}
 			}
 			else {
-				name = (rv3d->persp == RV3D_ORTHO) ? "User Ortho" : "User Persp";
+				name = (rv3d->persp == RV3D_ORTHO) ? IFACE_("User Ortho") : IFACE_("User Persp");
 			}
 			break;
 	}
@@ -852,16 +854,25 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, rcti *rect)
 {
 	RegionView3D *rv3d = ar->regiondata;
 	const char *name = view3d_get_name(v3d, rv3d);
+	/* XXX 24 may be a bit small for unicode languages (Chinese in utf-8...) */
+#ifdef WITH_INTERNATIONAL
+	char tmpstr[32];
+#else
 	char tmpstr[24];
-	
+#endif
+
 	if (v3d->localvd) {
-		BLI_snprintf(tmpstr, sizeof(tmpstr), "%s (Local)", name);
+		BLI_snprintf(tmpstr, sizeof(tmpstr), IFACE_("%s (Local)"), name);
 		name = tmpstr;
 	}
 
 	if (name) {
 		UI_ThemeColor(TH_TEXT_HI);
+#ifdef WITH_INTERNATIONAL
+		BLF_draw_default(U.widget_unit + rect->xmin,  rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr));
+#else
 		BLF_draw_default_ascii(U.widget_unit + rect->xmin,  rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr));
+#endif
 	}
 }
 
@@ -871,7 +882,7 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, rcti *rect)
 static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
 {
 	char info[256], *markern;
-	short offset = 30 + rect->xmin;
+	short offset = 1.5f * UI_UNIT_X + rect->xmin;
 	
 	/* get name of marker on current frame (if available) */
 	markern = BKE_scene_find_marker_name(scene, CFRA);
@@ -918,7 +929,7 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
 				if (kb) {
 					BLI_snprintf(shapes, sizeof(shapes), ": %s ", kb->name);
 					if (ob->shapeflag == OB_SHAPE_LOCK) {
-						strcat(shapes, " (Pinned)");
+						strcat(shapes, IFACE_(" (Pinned)"));
 					}
 				}
 			}
@@ -1927,7 +1938,8 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
 	BoundBox bb, *bb_tmp; /* use a copy because draw_object, calls clear_mesh_caches */
 	GLuint displist = 0;
 	short transflag, use_displist = -1;  /* -1 is initialize */
-	char dt, dtx;
+	char dt;
+	short dtx;
 	
 	if (base->object->restrictflag & OB_RESTRICT_VIEW) return;
 	
@@ -2845,14 +2857,18 @@ static void draw_viewport_fps(Scene *scene, rcti *rect)
 	/* is this more then half a frame behind? */
 	if (fps + 0.5f < (float)(FPS)) {
 		UI_ThemeColor(TH_REDALERT);
-		BLI_snprintf(printable, sizeof(printable), "fps: %.2f", fps);
+		BLI_snprintf(printable, sizeof(printable), IFACE_("fps: %.2f"), fps);
 	}
 	else {
 		UI_ThemeColor(TH_TEXT_HI);
-		BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps + 0.5f));
+		BLI_snprintf(printable, sizeof(printable), IFACE_("fps: %i"), (int)(fps + 0.5f));
 	}
-	
+
+#ifdef WITH_INTERNATIONAL
+	BLF_draw_default(rect->xmin + U.widget_unit,  rect->ymax - U.widget_unit, 0.0f, printable, sizeof(printable));
+#else
 	BLF_draw_default_ascii(rect->xmin + U.widget_unit,  rect->ymax - U.widget_unit, 0.0f, printable, sizeof(printable));
+#endif
 }
 
 static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const char **grid_unit);
@@ -2882,7 +2898,7 @@ static int view3d_main_area_draw_engine(const bContext *C, ARegion *ar, int draw
 		if (!(type->view_update && type->view_draw))
 			return 0;
 
-		engine = RE_engine_create(type);
+		engine = RE_engine_create_ex(type, TRUE);
 
 		engine->tile_x = scene->r.tilex;
 		engine->tile_y = scene->r.tiley;
@@ -3458,14 +3474,14 @@ static void bl_debug_draw(void)
 	if (_bl_debug_draw_quads_tot) {
 		int i;
 		cpack(0x00FF0000);
-		glBegin(GL_LINE_LOOP);
 		for (i = 0; i < _bl_debug_draw_quads_tot; i ++) {
+			glBegin(GL_LINE_LOOP);
 			glVertex3fv(_bl_debug_draw_quads[i][0]);
 			glVertex3fv(_bl_debug_draw_quads[i][1]);
 			glVertex3fv(_bl_debug_draw_quads[i][2]);
 			glVertex3fv(_bl_debug_draw_quads[i][3]);
+			glEnd();
 		}
-		glEnd();
 	}
 	if (_bl_debug_draw_edges_tot) {
 		int i;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index a1e132c..8c0a2dc 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -83,6 +83,9 @@
 
 #include "view3d_intern.h"  /* own include */
 
+/* for ndof prints */
+// #define DEBUG_NDOF_MOTION
+
 /* ********************** view3d_edit: view manipulations ********************* */
 
 int ED_view3d_camera_lock_check(View3D *v3d, RegionView3D *rv3d)
@@ -921,8 +924,12 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
 	}
 	
 	if (event->type == MOUSEPAN) {
-		/* invert it, trackpad scroll then follows how you mapped it globally */
-		viewrotate_apply(vod, 2 * event->x - event->prevx, 2 * event->y - event->prevy);
+		/* Rotate direction we keep always same */
+		if (U.uiflag2 & USER_TRACKPAD_NATURAL)
+			viewrotate_apply(vod, 2 * event->x - event->prevx, 2 * event->y - event->prevy);
+		else
+			viewrotate_apply(vod, event->prevx, event->prevy);
+			
 		ED_view3d_depth_tag_update(rv3d);
 		
 		viewops_data_free(C, op);
@@ -972,7 +979,7 @@ static int viewrotate_cancel(bContext *C, wmOperator *op)
 void VIEW3D_OT_rotate(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Rotate view";
+	ot->name = "Rotate View";
 	ot->description = "Rotate the view";
 	ot->idname = "VIEW3D_OT_rotate";
 
@@ -1039,11 +1046,10 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, wmEvent *event)
 			float view_inv[4];
 			invert_qt_qt(view_inv, rv3d->viewquat);
 
-			/* #define DEBUG_NDOF_MOTION */
-			#ifdef DEBUG_NDOF_MOTION
+#ifdef DEBUG_NDOF_MOTION
 			printf("ndof: T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f delivered to 3D view\n",
 			       ndof->tx, ndof->ty, ndof->tz, ndof->rx, ndof->ry, ndof->rz, ndof->dt);
-			#endif
+#endif
 
 			if (rv3d->viewlock == RV3D_LOCKED) {
 				/* rotation not allowed -- explore panning options instead */
@@ -1200,11 +1206,10 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
 			float view_inv[4];
 			invert_qt_qt(view_inv, rv3d->viewquat);
 
-			/* #define DEBUG_NDOF_MOTION */
-			#ifdef DEBUG_NDOF_MOTION
+#ifdef DEBUG_NDOF_MOTION
 			printf("ndof: T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f delivered to 3D view\n",
 			       ndof->tx, ndof->ty, ndof->tz, ndof->rx, ndof->ry, ndof->rz, ndof->dt);
-			#endif
+#endif
 
 			if (ndof->tz) {
 				/* Zoom!
@@ -1330,7 +1335,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void VIEW3D_OT_ndof_orbit_zoom(struct wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "NDOF Orbit View with zoom";
+	ot->name = "NDOF Orbit View with Zoom";
 	ot->description = "Explore every angle of an object using the 3D mouse";
 	ot->idname = "VIEW3D_OT_ndof_orbit_zoom";
 
@@ -1590,7 +1595,7 @@ static int ndof_all_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void VIEW3D_OT_ndof_all(struct wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "NDOF move View";
+	ot->name = "NDOF Move View";
 	ot->description = "Position your viewpoint with the 3D mouse";
 	ot->idname = "VIEW3D_OT_ndof_all";
 
@@ -1753,7 +1758,7 @@ void VIEW3D_OT_move(wmOperatorType *ot)
 {
 
 	/* identifiers */
-	ot->name = "Move view";
+	ot->name = "Move View";
 	ot->description = "Move the view";
 	ot->idname = "VIEW3D_OT_move";
 
@@ -2375,7 +2380,7 @@ static int viewdolly_cancel(bContext *C, wmOperator *op)
 void VIEW3D_OT_dolly(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Dolly view";
+	ot->name = "Dolly View";
 	ot->description = "Dolly in/out in the view";
 	ot->idname = "VIEW3D_OT_dolly";
 
@@ -3457,7 +3462,7 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
 	PropertyRNA *prop;
 
 	/* identifiers */
-	ot->name = "View numpad";
+	ot->name = "View Numpad";
 	ot->description = "Use a preset viewpoint";
 	ot->idname = "VIEW3D_OT_viewnumpad";
 
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index a6daf61..c8f0fe4 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -119,8 +119,8 @@ void draw_motion_paths_cleanup(View3D *v3d);
 
 /* drawobject.c */
 void draw_object(Scene *scene, struct ARegion *ar, View3D *v3d, Base *base, const short dflag);
-int draw_glsl_material(Scene *scene, struct Object *ob, View3D *v3d, const short dt);
-void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, const short dt, int outline);
+int draw_glsl_material(Scene *scene, struct Object *ob, View3D *v3d, const char dt);
+void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, const char dt, int outline);
 void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob);
 void drawaxes(float size, char drawtype);
 
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index 615ae71..bf1c540 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -39,14 +39,14 @@
 #include "DNA_space_types.h"
 #include "DNA_view3d_types.h"
 
-#include "BKE_blender.h"
-#include "BKE_context.h"
-#include "BKE_main.h"
-
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_blender.h"
+#include "BKE_context.h"
+#include "BKE_main.h"
+
 #include "RNA_access.h"
 
 #include "WM_api.h"
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index bfeb560..bb5b7aa 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -101,22 +101,33 @@ static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wm
 static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
 {
 	wmOperator *op = WM_operator_last_redo(C);
-	uiBlock *block;
-	
-	if (op == NULL)
-		return;
-	if (WM_operator_poll((bContext *)C, op->type) == 0)
+	ARegion *ar;
+	ARegion *ar1;
+
+	if (op == NULL) {
 		return;
-	
-	block = uiLayoutGetBlock(pa->layout);
-	
-	if (!WM_operator_check_ui_enabled(C, op->type->name))
-		uiLayoutSetEnabled(pa->layout, FALSE);
+	}
 
-	/* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */
-	uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op);
-	
-	view3d_panel_operator_redo_operator(C, pa, op);
+	/* keep in sync with logic in ED_undo_operator_repeat() */
+	ar = CTX_wm_region(C);
+	ar1 = BKE_area_find_region_active_win(CTX_wm_area(C));
+	if (ar1)
+		CTX_wm_region_set((bContext *)C, ar1);
+
+	if (WM_operator_poll((bContext *)C, op->type)) {
+		uiBlock *block = uiLayoutGetBlock(pa->layout);
+
+		if (!WM_operator_check_ui_enabled(C, op->type->name))
+			uiLayoutSetEnabled(pa->layout, FALSE);
+
+		/* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */
+		uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op);
+
+		view3d_panel_operator_redo_operator(C, pa, op);
+	}
+
+	/* set region back */
+	CTX_wm_region_set((bContext *)C, ar);
 }
 
 /* ******************* */
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 41d092c..fba1ce3 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -111,17 +111,43 @@ float *give_cursor(Scene *scene, View3D *v3d)
 /* ****************** smooth view operator ****************** */
 /* This operator is one of the 'timer refresh' ones like animation playback */
 
+struct SmoothView3DState {
+	float dist;
+	float lens;
+	float quat[4];
+	float ofs[3];
+};
+
 struct SmoothView3DStore {
-	float orig_dist, new_dist;
-	float orig_lens, new_lens;
-	float orig_quat[4], new_quat[4];
-	float orig_ofs[3], new_ofs[3];
-	
-	int to_camera, orig_view;
-	
+	/* source*/
+	struct SmoothView3DState src;  /* source */
+	struct SmoothView3DState dst;  /* destination */
+	struct SmoothView3DState org;  /* original */
+
+	bool to_camera;
+	char org_view;
+
 	double time_allowed;
 };
 
+static void view3d_smooth_view_state_backup(struct SmoothView3DState *sms_state,
+                                            const View3D *v3d, const RegionView3D *rv3d)
+{
+	copy_v3_v3(sms_state->ofs,   rv3d->ofs);
+	copy_qt_qt(sms_state->quat,  rv3d->viewquat);
+	sms_state->dist            = rv3d->dist;
+	sms_state->lens            = v3d->lens;
+}
+
+static void view3d_smooth_view_state_restore(const struct SmoothView3DState *sms_state,
+                                             View3D *v3d, RegionView3D *rv3d)
+{
+	copy_v3_v3(rv3d->ofs,      sms_state->ofs);
+	copy_qt_qt(rv3d->viewquat, sms_state->quat);
+	rv3d->dist               = sms_state->dist;
+	v3d->lens                = sms_state->lens;
+}
+
 /* will start timer if appropriate */
 /* the arguments are the desired situation */
 void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Object *camera,
@@ -132,15 +158,22 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera
 	ScrArea *sa = CTX_wm_area(C);
 
 	RegionView3D *rv3d = ar->regiondata;
-	struct SmoothView3DStore sms = {0};
-	short ok = FALSE;
+	struct SmoothView3DStore sms = {{0}};
+	bool ok = false;
 	
 	/* initialize sms */
-	copy_v3_v3(sms.new_ofs, rv3d->ofs);
-	copy_qt_qt(sms.new_quat, rv3d->viewquat);
-	sms.new_dist = rv3d->dist;
-	sms.new_lens = v3d->lens;
-	sms.to_camera = FALSE;
+	view3d_smooth_view_state_backup(&sms.dst, v3d, rv3d);
+	view3d_smooth_view_state_backup(&sms.src, v3d, rv3d);
+	/* if smoothview runs multiple times... */
+	if (rv3d->sms == NULL) {
+		view3d_smooth_view_state_backup(&sms.org, v3d, rv3d);
+		sms.org_view = rv3d->view;
+	}
+	else {
+		sms.org = rv3d->sms->org;
+		sms.org_view = rv3d->sms->org_view;
+	}
+	/* sms.to_camera = false; */  /* initizlized to zero anyway */
 
 	/* note on camera locking, this is a little confusing but works ok.
 	 * we may be changing the view 'as if' there is no active camera, but in fact
@@ -155,50 +188,43 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera
 	}
 
 	/* store the options we want to end with */
-	if (ofs) copy_v3_v3(sms.new_ofs, ofs);
-	if (quat) copy_qt_qt(sms.new_quat, quat);
-	if (dist) sms.new_dist = *dist;
-	if (lens) sms.new_lens = *lens;
+	if (ofs)  copy_v3_v3(sms.dst.ofs, ofs);
+	if (quat) copy_qt_qt(sms.dst.quat, quat);
+	if (dist) sms.dst.dist = *dist;
+	if (lens) sms.dst.lens = *lens;
 
 	if (camera) {
-		sms.new_dist = ED_view3d_offset_distance(camera->obmat, ofs, VIEW3D_DIST_FALLBACK);
-		ED_view3d_from_object(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens);
-		sms.to_camera = TRUE; /* restore view3d values in end */
+		sms.dst.dist = ED_view3d_offset_distance(camera->obmat, ofs, VIEW3D_DIST_FALLBACK);
+		ED_view3d_from_object(camera, sms.dst.ofs, sms.dst.quat, &sms.dst.dist, &sms.dst.lens);
+		sms.to_camera = true; /* restore view3d values in end */
 	}
 	
 	if (C && U.smooth_viewtx) {
-		int changed = FALSE; /* zero means no difference */
+		bool changed = false; /* zero means no difference */
 		
 		if (oldcamera != camera)
-			changed = TRUE;
-		else if (sms.new_dist != rv3d->dist)
-			changed = TRUE;
-		else if (sms.new_lens != v3d->lens)
-			changed = TRUE;
-		else if (!equals_v3v3(sms.new_ofs, rv3d->ofs))
-			changed = TRUE;
-		else if (!equals_v4v4(sms.new_quat, rv3d->viewquat))
-			changed = TRUE;
+			changed = true;
+		else if (sms.dst.dist != rv3d->dist)
+			changed = true;
+		else if (sms.dst.lens != v3d->lens)
+			changed = true;
+		else if (!equals_v3v3(sms.dst.ofs, rv3d->ofs))
+			changed = true;
+		else if (!equals_v4v4(sms.dst.quat, rv3d->viewquat))
+			changed = true;
 		
 		/* The new view is different from the old one
 		 * so animate the view */
 		if (changed) {
-
 			/* original values */
 			if (oldcamera) {
-				sms.orig_dist = ED_view3d_offset_distance(oldcamera->obmat, rv3d->ofs, 0.0f);
-				ED_view3d_from_object(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens);
-			}
-			else {
-				copy_v3_v3(sms.orig_ofs, rv3d->ofs);
-				copy_qt_qt(sms.orig_quat, rv3d->viewquat);
-				sms.orig_dist = rv3d->dist;
-				sms.orig_lens = v3d->lens;
+				sms.src.dist = ED_view3d_offset_distance(oldcamera->obmat, rv3d->ofs, 0.0f);
+				/* this */
+				ED_view3d_from_object(oldcamera, sms.src.ofs, sms.src.quat, &sms.src.dist, &sms.src.lens);
 			}
 			/* grid draw as floor */
 			if ((rv3d->viewlock & RV3D_LOCKED) == 0) {
 				/* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */
-				sms.orig_view = rv3d->sms ? rv3d->sms->orig_view : rv3d->view;
 				rv3d->view = RV3D_VIEW_USER;
 			}
 
@@ -212,8 +238,8 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera
 				float vec1[3] = {0, 0, 1}, vec2[3] = {0, 0, 1};
 				float q1[4], q2[4];
 
-				invert_qt_qt(q1, sms.new_quat);
-				invert_qt_qt(q2, sms.orig_quat);
+				invert_qt_qt(q1, sms.dst.quat);
+				invert_qt_qt(q2, sms.src.quat);
 
 				mul_qt_v3(q1, vec1);
 				mul_qt_v3(q2, vec2);
@@ -223,36 +249,45 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera
 			}
 
 			/* ensure it shows correct */
-			if (sms.to_camera) rv3d->persp = RV3D_PERSP;
+			if (sms.to_camera) {
+				rv3d->persp = RV3D_PERSP;
+			}
 
 			rv3d->rflag |= RV3D_NAVIGATING;
 			
+			/* not essential but in some cases the caller will tag the area for redraw,
+			 * and in that case we can get a ficker of the 'org' user view but we want to see 'src' */
+			view3d_smooth_view_state_restore(&sms.src, v3d, rv3d);
+
 			/* keep track of running timer! */
-			if (rv3d->sms == NULL)
+			if (rv3d->sms == NULL) {
 				rv3d->sms = MEM_mallocN(sizeof(struct SmoothView3DStore), "smoothview v3d");
+			}
 			*rv3d->sms = sms;
-			if (rv3d->smooth_timer)
+			if (rv3d->smooth_timer) {
 				WM_event_remove_timer(wm, win, rv3d->smooth_timer);
+			}
 			/* TIMER1 is hardcoded in keymap */
 			rv3d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0); /* max 30 frs/sec */
-			
-			ok = TRUE;
+
+			ok = true;
 		}
 	}
 	
 	/* if we get here nothing happens */
-	if (ok == FALSE) {
-		if (sms.to_camera == FALSE) {
-			copy_v3_v3(rv3d->ofs, sms.new_ofs);
-			copy_qt_qt(rv3d->viewquat, sms.new_quat);
-			rv3d->dist = sms.new_dist;
-			v3d->lens = sms.new_lens;
+	if (ok == false) {
+		if (sms.to_camera == false) {
+			copy_v3_v3(rv3d->ofs, sms.dst.ofs);
+			copy_qt_qt(rv3d->viewquat, sms.dst.quat);
+			rv3d->dist = sms.dst.dist;
+			v3d->lens = sms.dst.lens;
 
 			ED_view3d_camera_lock_sync(v3d, rv3d);
 		}
 
-		if (rv3d->viewlock & RV3D_BOXVIEW)
+		if (rv3d->viewlock & RV3D_BOXVIEW) {
 			view3d_boxview_copy(sa, ar);
+		}
 
 		ED_region_tag_redraw(ar);
 	}
@@ -281,22 +316,16 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
 		/* if we went to camera, store the original */
 		if (sms->to_camera) {
 			rv3d->persp = RV3D_CAMOB;
-			copy_v3_v3(rv3d->ofs, sms->orig_ofs);
-			copy_qt_qt(rv3d->viewquat, sms->orig_quat);
-			rv3d->dist = sms->orig_dist;
-			v3d->lens = sms->orig_lens;
+			view3d_smooth_view_state_restore(&sms->org, v3d, rv3d);
 		}
 		else {
-			copy_v3_v3(rv3d->ofs, sms->new_ofs);
-			copy_qt_qt(rv3d->viewquat, sms->new_quat);
-			rv3d->dist = sms->new_dist;
-			v3d->lens = sms->new_lens;
+			view3d_smooth_view_state_restore(&sms->dst, v3d, rv3d);
 
 			ED_view3d_camera_lock_sync(v3d, rv3d);
 		}
 		
 		if ((rv3d->viewlock & RV3D_LOCKED) == 0) {
-			rv3d->view = sms->orig_view;
+			rv3d->view = sms->org_view;
 		}
 
 		MEM_freeN(rv3d->sms);
@@ -312,11 +341,11 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
 
 		step_inv = 1.0f - step;
 
-		interp_v3_v3v3(rv3d->ofs,      sms->orig_ofs,  sms->new_ofs,  step);
-		interp_qt_qtqt(rv3d->viewquat, sms->orig_quat, sms->new_quat, step);
+		interp_v3_v3v3(rv3d->ofs,      sms->src.ofs,  sms->dst.ofs,  step);
+		interp_qt_qtqt(rv3d->viewquat, sms->src.quat, sms->dst.quat, step);
 		
-		rv3d->dist = sms->new_dist * step + sms->orig_dist * step_inv;
-		v3d->lens  = sms->new_lens * step + sms->orig_lens * step_inv;
+		rv3d->dist = sms->dst.dist * step + sms->src.dist * step_inv;
+		v3d->lens  = sms->dst.lens * step + sms->src.lens * step_inv;
 
 		ED_view3d_camera_lock_sync(v3d, rv3d);
 	}
@@ -325,12 +354,16 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
 		view3d_boxview_copy(CTX_wm_area(C), CTX_wm_region(C));
 
 	/* note: this doesn't work right because the v3d->lens is now used in ortho mode r51636,
-	 * when switching camera in quad-view the other ortho views would zoom & reset. */
-#if 0
-	WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
-#else
-	ED_region_tag_redraw(CTX_wm_region(C));
-#endif
+	 * when switching camera in quad-view the other ortho views would zoom & reset.
+	 *
+	 * For now only redraw all regions when smoothview finishes.
+	 */
+	if (step >= 1.0f) {
+		WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
+	}
+	else {
+		ED_region_tag_redraw(CTX_wm_region(C));
+	}
 	
 	return OPERATOR_FINISHED;
 }
@@ -846,7 +879,8 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
 	ARegion *ar = vc->ar;
 	rctf rect;
 	short code, hits;
-	char dt, dtx;
+	char dt;
+	short dtx;
 	
 	G.f |= G_PICKSEL;
 	
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 5b5e520..ea82ebb 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -52,12 +52,14 @@
 #include "DNA_movieclip_types.h"
 #include "DNA_scene_types.h"  /* PET modes */
 
-#include "RNA_access.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-
-#include "BLF_api.h"
+#include "BLI_utildefines.h"
+#include "BLI_math.h"
+#include "BLI_rect.h"
+#include "BLI_listbase.h"
+#include "BLI_string.h"
+#include "BLI_ghash.h"
+#include "BLI_linklist.h"
+#include "BLI_smallhash.h"
 
 #include "BKE_nla.h"
 #include "BKE_bmesh.h"
@@ -69,6 +71,9 @@
 #include "BKE_unit.h"
 #include "BKE_mask.h"
 
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
 #include "ED_image.h"
 #include "ED_keyframing.h"
 #include "ED_screen.h"
@@ -79,25 +84,36 @@
 #include "ED_clip.h"
 #include "ED_mask.h"
 
-#include "UI_view2d.h"
 #include "WM_types.h"
 #include "WM_api.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
-#include "BLI_ghash.h"
-#include "BLI_linklist.h"
-#include "BLI_smallhash.h"
-#include "BLI_array.h"
-
+#include "UI_view2d.h"
 #include "UI_interface_icons.h"
 #include "UI_resources.h"
 
+#include "RNA_access.h"
+
+#include "BLF_api.h"
+#include "BLF_translation.h"
+
 #include "transform.h"
 
 static void drawTransformApply(const struct bContext *C, ARegion *ar, void *arg);
 static int doEdgeSlide(TransInfo *t, float perc);
+static int doVertSlide(TransInfo *t, float perc);
+
+static void drawEdgeSlide(const struct bContext *C, TransInfo *t);
+static void drawVertSlide(const struct bContext *C, TransInfo *t);
+
+static bool transdata_check_local_center(TransInfo *t)
+{
+	return ((t->around == V3D_LOCAL) && (
+	            (t->flag & (T_OBJECT | T_POSE)) ||
+	            (t->obedit && t->obedit->type == OB_MESH && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
+	            (t->obedit && t->obedit->type == OB_ARMATURE) ||
+	            (t->spacetype == SPACE_IPO))
+	        );
+}
 
 /* ************************** SPACE DEPENDANT CODE **************************** */
 
@@ -775,22 +791,29 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
 	if (!(t->flag & T_NO_CONSTRAINT)) {
 		int constraint_axis, constraint_plane;
 		int edit_2d = (t->flag & T_2D_EDIT);
-		char msg1[] = "along _";
-		char msg2[] = "along %s _";
-		char msg3[] = "locking %s _";
+		const char *msg1 = "", *msg2 = "", *msg3 = "";
 		char axis;
 	
 		/* Initialize */
 		switch (key_type) {
 			case XKEY:
+				msg1 = IFACE_("along X");
+				msg2 = IFACE_("along %s X");
+				msg3 = IFACE_("locking %s X");
 				axis = 'X';
 				constraint_axis = CON_AXIS0;
 				break;
 			case YKEY:
+				msg1 = IFACE_("along Y");
+				msg2 = IFACE_("along %s Y");
+				msg3 = IFACE_("locking %s Y");
 				axis = 'Y';
 				constraint_axis = CON_AXIS1;
 				break;
 			case ZKEY:
+				msg1 = IFACE_("along Z");
+				msg2 = IFACE_("along %s Z");
+				msg3 = IFACE_("locking %s Z");
 				axis = 'Z';
 				constraint_axis = CON_AXIS2;
 				break;
@@ -798,9 +821,6 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
 				/* Invalid key */
 				return;
 		}
-		msg1[sizeof(msg1) - 2] = axis;
-		msg2[sizeof(msg2) - 2] = axis;
-		msg3[sizeof(msg3) - 2] = axis;
 		constraint_plane = ((CON_AXIS0 | CON_AXIS1 | CON_AXIS2) & (~constraint_axis));
 
 		if (edit_2d && (key_type != ZKEY)) {
@@ -875,19 +895,56 @@ int transformEvent(TransInfo *t, wmEvent *event)
 				break;
 			case TFM_MODAL_TRANSLATE:
 				/* only switch when... */
-				if (ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
+				if (ELEM5(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
+					if (t->mode == TFM_EDGE_SLIDE) {
+						freeEdgeSlideVerts(t);
+					}
+					else if (t->mode == TFM_VERT_SLIDE) {
+						freeVertSlideVerts(t);
+					}
 					resetTransRestrictions(t);
 					restoreTransObjects(t);
 					initTranslation(t);
 					initSnapping(t, NULL); // need to reinit after mode change
 					t->redraw |= TREDRAW_HARD;
+					WM_event_add_mousemove(t->context);
 				}
-				else if (t->mode == TFM_TRANSLATION) {
-					if (t->options & (CTX_MOVIECLIP | CTX_MASK)) {
-						restoreTransObjects(t);
+				else if (t->mode == TFM_SEQ_SLIDE) {
+					t->flag ^= T_ALT_TRANSFORM;
+					t->redraw |= TREDRAW_HARD;
+				}
+				else {
+					if (t->obedit && t->obedit->type == OB_MESH) {
+						if ((t->mode == TFM_TRANSLATION) && (t->spacetype == SPACE_VIEW3D)) {
+							resetTransRestrictions(t);
+							restoreTransObjects(t);
 
-						t->flag ^= T_ALT_TRANSFORM;
-						t->redraw |= TREDRAW_HARD;
+							/* first try edge slide */
+							initEdgeSlide(t);
+							/* if that fails, do vertex slide */
+							if (t->state == TRANS_CANCEL) {
+								t->state = TRANS_STARTING;
+								initVertSlide(t);
+							}
+							/* vert slide can fail on unconnected vertices (rare but possible) */
+							if (t->state == TRANS_CANCEL) {
+								t->state = TRANS_STARTING;
+								resetTransRestrictions(t);
+								restoreTransObjects(t);
+								initTranslation(t);
+							}
+							initSnapping(t, NULL); // need to reinit after mode change
+							t->redraw |= TREDRAW_HARD;
+							WM_event_add_mousemove(t->context);
+						}
+					}
+					else if (t->options & (CTX_MOVIECLIP | CTX_MASK)) {
+						if (t->mode == TFM_TRANSLATION) {
+							restoreTransObjects(t);
+
+							t->flag ^= T_ALT_TRANSFORM;
+							t->redraw |= TREDRAW_HARD;
+						}
 					}
 				}
 				break;
@@ -920,6 +977,10 @@ int transformEvent(TransInfo *t, wmEvent *event)
 					initSnapping(t, NULL); // need to reinit after mode change
 					t->redraw |= TREDRAW_HARD;
 				}
+				else if (t->mode == TFM_SHRINKFATTEN) {
+					t->flag ^= T_ALT_TRANSFORM;
+					t->redraw |= TREDRAW_HARD;
+				}
 				else if (t->mode == TFM_RESIZE) {
 					if (t->options & CTX_MOVIECLIP) {
 						restoreTransObjects(t);
@@ -949,10 +1010,10 @@ int transformEvent(TransInfo *t, wmEvent *event)
 					}
 					else {
 						if (t->flag & T_2D_EDIT) {
-							setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS0), "along X");
+							setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS0), IFACE_("along X"));
 						}
 						else {
-							setUserConstraint(t, t->current_orientation, (CON_AXIS0), "along %s X");
+							setUserConstraint(t, t->current_orientation, (CON_AXIS0), IFACE_("along %s X"));
 						}
 					}
 					t->redraw |= TREDRAW_HARD;
@@ -965,10 +1026,10 @@ int transformEvent(TransInfo *t, wmEvent *event)
 					}
 					else {
 						if (t->flag & T_2D_EDIT) {
-							setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS1), "along Y");
+							setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS1), IFACE_("along Y"));
 						}
 						else {
-							setUserConstraint(t, t->current_orientation, (CON_AXIS1), "along %s Y");
+							setUserConstraint(t, t->current_orientation, (CON_AXIS1), IFACE_("along %s Y"));
 						}
 					}
 					t->redraw |= TREDRAW_HARD;
@@ -980,7 +1041,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
 						stopConstraint(t);
 					}
 					else {
-						setUserConstraint(t, t->current_orientation, (CON_AXIS2), "along %s Z");
+						setUserConstraint(t, t->current_orientation, (CON_AXIS2), IFACE_("along %s Z"));
 					}
 					t->redraw |= TREDRAW_HARD;
 				}
@@ -991,7 +1052,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
 						stopConstraint(t);
 					}
 					else {
-						setUserConstraint(t, t->current_orientation, (CON_AXIS1 | CON_AXIS2), "locking %s X");
+						setUserConstraint(t, t->current_orientation, (CON_AXIS1 | CON_AXIS2), IFACE_("locking %s X"));
 					}
 					t->redraw |= TREDRAW_HARD;
 				}
@@ -1002,7 +1063,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
 						stopConstraint(t);
 					}
 					else {
-						setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS2), "locking %s Y");
+						setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS2), IFACE_("locking %s Y"));
 					}
 					t->redraw |= TREDRAW_HARD;
 				}
@@ -1013,7 +1074,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
 						stopConstraint(t);
 					}
 					else {
-						setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS1), "locking %s Z");
+						setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS1), IFACE_("locking %s Z"));
 					}
 					t->redraw |= TREDRAW_HARD;
 				}
@@ -1118,7 +1179,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
 					/* exception for switching to dolly, or trackball, in camera view */
 					if (t->flag & T_CAMERA) {
 						if (t->mode == TFM_TRANSLATION)
-							setLocalConstraint(t, (CON_AXIS2), "along local Z");
+							setLocalConstraint(t, (CON_AXIS2), IFACE_("along local Z"));
 						else if (t->mode == TFM_ROTATION) {
 							restoreTransObjects(t);
 							initTrackball(t);
@@ -1600,14 +1661,17 @@ static void drawTransformView(const struct bContext *C, ARegion *UNUSED(ar), voi
 	drawConstraint(t);
 	drawPropCircle(C, t);
 	drawSnapping(C, t);
-	drawNonPropEdge(C, t);
+
+	/* edge slide, vert slide */
+	drawEdgeSlide(C, t);
+	drawVertSlide(C, t);
 }
 
 /* just draw a little warning message in the top-right corner of the viewport to warn that autokeying is enabled */
 static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar)
 {
 	rcti rect;
-	const char printable[] = "Auto Keying On";
+	const char *printable = IFACE_("Auto Keying On");
 	float      printable_size[2];
 	int xco, yco;
 
@@ -1622,7 +1686,11 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar)
 	 * - original color was red to match the icon, but that clashes badly with a less nasty border
 	 */
 	UI_ThemeColorShade(TH_TEXT_HI, -50);
+#ifdef WITH_INTERNATIONAL
+	BLF_draw_default(xco, ar->winy - 17, 0.0f, printable, sizeof(printable));
+#else
 	BLF_draw_default_ascii(xco, ar->winy - 17, 0.0f, printable, sizeof(printable));
+#endif
 	
 	/* autokey recording icon... */
 	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -1879,6 +1947,8 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
 
 	}
 
+	t->keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap);
+
 	initSnapping(t, op); // Initialize snapping data AFTER mode flags
 
 	/* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */
@@ -1949,6 +2019,9 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
 		case TFM_EDGE_SLIDE:
 			initEdgeSlide(t);
 			break;
+		case TFM_VERT_SLIDE:
+			initVertSlide(t);
+			break;
 		case TFM_BONE_ROLL:
 			initBoneRoll(t);
 			break;
@@ -2080,12 +2153,6 @@ void transformApply(bContext *C, TransInfo *t)
 		t->state = TRANS_CONFIRM;
 	}
 
-	if (BKE_ptcache_get_continue_physics()) {
-		// TRANSFORM_FIX_ME
-		//do_screenhandlers(G.curscreen);
-		t->redraw |= TREDRAW_HARD;
-	}
-
 	t->context = NULL;
 }
 
@@ -2298,7 +2365,7 @@ static void constraintTransLim(TransInfo *t, TransData *td)
 			ListBase targets = {NULL, NULL};
 			
 			/* only consider constraint if enabled */
-			if (con->flag & CONSTRAINT_DISABLE) continue;
+			if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) continue;
 			if (con->enforce == 0.0f) continue;
 			
 			/* only use it if it's tagged for this purpose (and the right type) */
@@ -2389,7 +2456,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
 		/* Evaluate valid constraints */
 		for (con = td->con; con; con = con->next) {
 			/* only consider constraint if enabled */
-			if (con->flag & CONSTRAINT_DISABLE) continue;
+			if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) continue;
 			if (con->enforce == 0.0f) continue;
 
 			/* we're only interested in Limit-Rotation constraints */
@@ -2479,7 +2546,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
 		/* Evaluate valid constraints */
 		for (con = td->con; con; con = con->next) {
 			/* only consider constraint if enabled */
-			if (con->flag & CONSTRAINT_DISABLE) continue;
+			if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) continue;
 			if (con->enforce == 0.0f) continue;
 			
 			/* we're only interested in Limit-Scale constraints */
@@ -2641,13 +2708,13 @@ int Warp(TransInfo *t, const int UNUSED(mval[2]))
 		
 		outputNumInput(&(t->num), c);
 		
-		sprintf(str, "Warp: %s", c);
+		sprintf(str, IFACE_("Warp: %s"), c);
 
 		circumfac = DEG2RADF(circumfac);
 	}
 	else {
 		/* default header print */
-		sprintf(str, "Warp: %.3f", RAD2DEGF(circumfac));
+		sprintf(str, IFACE_("Warp: %.3f"), RAD2DEGF(circumfac));
 	}
 	
 	t->values[0] = circumfac;
@@ -2782,11 +2849,11 @@ int Shear(TransInfo *t, const int UNUSED(mval[2]))
 		
 		outputNumInput(&(t->num), c);
 		
-		sprintf(str, "Shear: %s %s", c, t->proptext);
+		sprintf(str, IFACE_("Shear: %s %s"), c, t->proptext);
 	}
 	else {
 		/* default header print */
-		sprintf(str, "Shear: %.3f %s (Press X or Y to set shear axis)", value, t->proptext);
+		sprintf(str, IFACE_("Shear: %.3f %s (Press X or Y to set shear axis)"), value, t->proptext);
 	}
 	
 	t->values[0] = value;
@@ -2878,30 +2945,30 @@ static void headerResize(TransInfo *t, float vec[3], char *str)
 	if (t->con.mode & CON_APPLY) {
 		switch (t->num.idx_max) {
 			case 0:
-				spos += sprintf(spos, "Scale: %s%s %s", &tvec[0], t->con.text, t->proptext);
+				spos += sprintf(spos, IFACE_("Scale: %s%s %s"), &tvec[0], t->con.text, t->proptext);
 				break;
 			case 1:
-				spos += sprintf(spos, "Scale: %s : %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+				spos += sprintf(spos, IFACE_("Scale: %s : %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
 				                t->con.text, t->proptext);
 				break;
 			case 2:
-				spos += sprintf(spos, "Scale: %s : %s : %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+				spos += sprintf(spos, IFACE_("Scale: %s : %s : %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
 				                &tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
 		}
 	}
 	else {
 		if (t->flag & T_2D_EDIT) {
-			spos += sprintf(spos, "Scale X: %s   Y: %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+			spos += sprintf(spos, IFACE_("Scale X: %s   Y: %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
 			                t->con.text, t->proptext);
 		}
 		else {
-			spos += sprintf(spos, "Scale X: %s   Y: %s  Z: %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+			spos += sprintf(spos, IFACE_("Scale X: %s   Y: %s  Z: %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
 			                &tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
 		}
 	}
 	
 	if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
-		spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+		spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
 	}
 
 	(void)spos;
@@ -2957,12 +3024,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
 	}
 	
 	/* local constraint shouldn't alter center */
-	if ((t->around == V3D_LOCAL) &&
-	    (   (t->flag & (T_OBJECT | T_POSE)) ||
-	        ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
-	        (t->obedit && t->obedit->type == OB_ARMATURE))
-	    )
-	{
+	if (transdata_check_local_center(t)) {
 		copy_v3_v3(center, td->center);
 	}
 	else if (t->options & CTX_MOVIECLIP) {
@@ -3265,11 +3327,11 @@ int ToSphere(TransInfo *t, const int UNUSED(mval[2]))
 		
 		outputNumInput(&(t->num), c);
 		
-		sprintf(str, "To Sphere: %s %s", c, t->proptext);
+		sprintf(str, IFACE_("To Sphere: %s %s"), c, t->proptext);
 	}
 	else {
 		/* default header print */
-		sprintf(str, "To Sphere: %.4f %s", ratio, t->proptext);
+		sprintf(str, IFACE_("To Sphere: %.4f %s"), ratio, t->proptext);
 	}
 	
 	
@@ -3339,20 +3401,16 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
 {
 	float vec[3], totmat[3][3], smat[3][3];
 	float eul[3], fmat[3][3], quat[4];
-	float *center = t->center;
+	const float *center;
 
 	/* local constraint shouldn't alter center */
-	if (around == V3D_LOCAL) {
-		if (    (t->flag & (T_OBJECT | T_POSE)) ||
-		        (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE)) ||
-		        (t->obedit && t->obedit->type == OB_ARMATURE))
-		{
-			center = td->center;
-		}
-
-		if (t->options & CTX_MOVIECLIP) {
-			center = td->center;
-		}
+	if (transdata_check_local_center(t) ||
+	    ((around == V3D_LOCAL) && (t->options & CTX_MOVIECLIP)))
+	{
+		center = td->center;
+	}
+	else {
+		center = t->center;
 	}
 
 	if (t->flag & T_POINTS) {
@@ -3613,17 +3671,17 @@ int Rotation(TransInfo *t, const int UNUSED(mval[2]))
 		
 		outputNumInput(&(t->num), c);
 		
-		spos += sprintf(spos, "Rot: %s %s %s", &c[0], t->con.text, t->proptext);
+		spos += sprintf(spos, IFACE_("Rot: %s %s %s"), &c[0], t->con.text, t->proptext);
 
 		/* Clamp between -180 and 180 */
 		final = angle_wrap_rad(DEG2RADF(final));
 	}
 	else {
-		spos += sprintf(spos, "Rot: %.2f%s %s", RAD2DEGF(final), t->con.text, t->proptext);
+		spos += sprintf(spos, IFACE_("Rot: %.2f%s %s"), RAD2DEGF(final), t->con.text, t->proptext);
 	}
 	
 	if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
-		spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+		spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
 	}
 	(void)spos;
 
@@ -3712,17 +3770,17 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
 
 		outputNumInput(&(t->num), c);
 
-		spos += sprintf(spos, "Trackball: %s %s %s", &c[0], &c[NUM_STR_REP_LEN], t->proptext);
+		spos += sprintf(spos, IFACE_("Trackball: %s %s %s"), &c[0], &c[NUM_STR_REP_LEN], t->proptext);
 
 		phi[0] = DEG2RADF(phi[0]);
 		phi[1] = DEG2RADF(phi[1]);
 	}
 	else {
-		spos += sprintf(spos, "Trackball: %.2f %.2f %s", RAD2DEGF(phi[0]), RAD2DEGF(phi[1]), t->proptext);
+		spos += sprintf(spos, IFACE_("Trackball: %.2f %.2f %s"), RAD2DEGF(phi[0]), RAD2DEGF(phi[1]), t->proptext);
 	}
 
 	if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
-		spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+		spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
 	}
 	(void)spos;
 
@@ -3833,7 +3891,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
 		short chainlen = t->settings->autoik_chainlen;
 
 		if (chainlen)
-			sprintf(autoik, "AutoIK-Len: %d", chainlen);
+			sprintf(autoik, IFACE_("AutoIK-Len: %d"), chainlen);
 		else
 			autoik[0] = '\0';
 	}
@@ -3866,7 +3924,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
 	}
 	
 	if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
-		spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+		spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
 	}
 	(void)spos;
 }
@@ -4016,7 +4074,8 @@ int ShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
 {
 	float distance;
 	int i;
-	char str[64];
+	char str[128];
+	char *str_p;
 	TransData *td = t->data;
 
 	distance = -t->values[0];
@@ -4026,17 +4085,33 @@ int ShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
 	applyNumInput(&t->num, &distance);
 
 	/* header print for NumInput */
+	str_p = str;
+	str_p += BLI_snprintf(str_p, sizeof(str), IFACE_("Shrink/Fatten:"));
 	if (hasNumInput(&t->num)) {
 		char c[NUM_STR_REP_LEN];
-
 		outputNumInput(&(t->num), c);
-
-		sprintf(str, "Shrink/Fatten: %s %s", c, t->proptext);
+		str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), " %s", c);
 	}
 	else {
 		/* default header print */
-		sprintf(str, "Shrink/Fatten: %.4f %s", distance, t->proptext);
+		str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), " %.4f", distance);
+	}
+
+	if (t->proptext[0]) {
+		str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), " %s", t->proptext);
 	}
+	str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), ", (");
+
+	{
+		wmKeyMapItem *kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_RESIZE);
+		if (kmi) {
+			str_p += WM_keymap_item_to_string(kmi, str_p, sizeof(str) - (str_p - str));
+		}
+	}
+	str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_(" or Alt) Even Thickness %s"),
+	                      (t->flag & T_ALT_TRANSFORM) ? IFACE_("ON") : IFACE_("OFF"));
+	/* done with header string */
+
 
 	t->values[0] = -distance;
 
@@ -4105,7 +4180,7 @@ int Tilt(TransInfo *t, const int UNUSED(mval[2]))
 
 		outputNumInput(&(t->num), c);
 
-		sprintf(str, "Tilt: %s° %s", &c[0], t->proptext);
+		sprintf(str, IFACE_("Tilt: %s° %s"), &c[0], t->proptext);
 
 		final = DEG2RADF(final);
 
@@ -4113,7 +4188,7 @@ int Tilt(TransInfo *t, const int UNUSED(mval[2]))
 		t->values[0] = final;
 	}
 	else {
-		sprintf(str, "Tilt: %.2f° %s", RAD2DEGF(final), t->proptext);
+		sprintf(str, IFACE_("Tilt: %.2f° %s"), RAD2DEGF(final), t->proptext);
 	}
 
 	for (i = 0; i < t->total; i++, td++) {
@@ -4177,10 +4252,10 @@ int CurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
 		char c[NUM_STR_REP_LEN];
 
 		outputNumInput(&(t->num), c);
-		sprintf(str, "Shrink/Fatten: %s", c);
+		sprintf(str, IFACE_("Shrink/Fatten: %s"), c);
 	}
 	else {
-		sprintf(str, "Shrink/Fatten: %3f", ratio);
+		sprintf(str, IFACE_("Shrink/Fatten: %3f"), ratio);
 	}
 
 	for (i = 0; i < t->total; i++, td++) {
@@ -4245,10 +4320,10 @@ int MaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
 		char c[NUM_STR_REP_LEN];
 
 		outputNumInput(&(t->num), c);
-		sprintf(str, "Feather Shrink/Fatten: %s", c);
+		sprintf(str, IFACE_("Feather Shrink/Fatten: %s"), c);
 	}
 	else {
-		sprintf(str, "Feather Shrink/Fatten: %3f", ratio);
+		sprintf(str, IFACE_("Feather Shrink/Fatten: %3f"), ratio);
 	}
 
 	/* detect if no points have feather yet */
@@ -4333,11 +4408,11 @@ int PushPull(TransInfo *t, const int UNUSED(mval[2]))
 
 		outputNumInput(&(t->num), c);
 
-		sprintf(str, "Push/Pull: %s%s %s", c, t->con.text, t->proptext);
+		sprintf(str, IFACE_("Push/Pull: %s%s %s"), c, t->con.text, t->proptext);
 	}
 	else {
 		/* default header print */
-		sprintf(str, "Push/Pull: %.4f%s %s", distance, t->con.text, t->proptext);
+		sprintf(str, IFACE_("Push/Pull: %.4f%s %s"), distance, t->con.text, t->proptext);
 	}
 
 	t->values[0] = distance;
@@ -4454,7 +4529,7 @@ int Bevel(TransInfo *t, const int UNUSED(mval[2]))
 	const char *mode;
 	TransData *td = t->data;
 
-	mode = (G.editBMesh->options & BME_BEVEL_VERT) ? "verts only" : "normal";
+	mode = (G.editBMesh->options & BME_BEVEL_VERT) ? IFACE_("verts only") : IFACE_("normal");
 	distance = t->values[0] / 4; /* 4 just seemed a nice value to me, nothing special */
 
 	distance = fabs(distance);
@@ -4469,11 +4544,11 @@ int Bevel(TransInfo *t, const int UNUSED(mval[2]))
 
 		outputNumInput(&(t->num), c);
 
-		sprintf(str, "Bevel - Dist: %s, Mode: %s (MMB to toggle))", c, mode);
+		sprintf(str, IFACE_("Bevel - Dist: %s, Mode: %s (MMB to toggle))"), c, mode);
 	}
 	else {
 		/* default header print */
-		sprintf(str, "Bevel - Dist: %.4f, Mode: %s (MMB to toggle))", distance, mode);
+		sprintf(str, IFACE_("Bevel - Dist: %.4f, Mode: %s (MMB to toggle))"), distance, mode);
 	}
 
 	if (distance < 0) distance = -distance;
@@ -4537,16 +4612,16 @@ int BevelWeight(TransInfo *t, const int UNUSED(mval[2]))
 		outputNumInput(&(t->num), c);
 
 		if (weight >= 0.0f)
-			sprintf(str, "Bevel Weight: +%s %s", c, t->proptext);
+			sprintf(str, IFACE_("Bevel Weight: +%s %s"), c, t->proptext);
 		else
-			sprintf(str, "Bevel Weight: %s %s", c, t->proptext);
+			sprintf(str, IFACE_("Bevel Weight: %s %s"), c, t->proptext);
 	}
 	else {
 		/* default header print */
 		if (weight >= 0.0f)
-			sprintf(str, "Bevel Weight: +%.3f %s", weight, t->proptext);
+			sprintf(str, IFACE_("Bevel Weight: +%.3f %s"), weight, t->proptext);
 		else
-			sprintf(str, "Bevel Weight: %.3f %s", weight, t->proptext);
+			sprintf(str, IFACE_("Bevel Weight: %.3f %s"), weight, t->proptext);
 	}
 
 	for (i = 0; i < t->total; i++, td++) {
@@ -4610,16 +4685,16 @@ int Crease(TransInfo *t, const int UNUSED(mval[2]))
 		outputNumInput(&(t->num), c);
 
 		if (crease >= 0.0f)
-			sprintf(str, "Crease: +%s %s", c, t->proptext);
+			sprintf(str, IFACE_("Crease: +%s %s"), c, t->proptext);
 		else
-			sprintf(str, "Crease: %s %s", c, t->proptext);
+			sprintf(str, IFACE_("Crease: %s %s"), c, t->proptext);
 	}
 	else {
 		/* default header print */
 		if (crease >= 0.0f)
-			sprintf(str, "Crease: +%.3f %s", crease, t->proptext);
+			sprintf(str, IFACE_("Crease: +%.3f %s"), crease, t->proptext);
 		else
-			sprintf(str, "Crease: %.3f %s", crease, t->proptext);
+			sprintf(str, IFACE_("Crease: %.3f %s"), crease, t->proptext);
 	}
 
 	for (i = 0; i < t->total; i++, td++) {
@@ -4678,14 +4753,14 @@ static void headerBoneSize(TransInfo *t, float vec[3], char *str)
 	/* hmm... perhaps the y-axis values don't need to be shown? */
 	if (t->con.mode & CON_APPLY) {
 		if (t->num.idx_max == 0)
-			sprintf(str, "ScaleB: %s%s %s", &tvec[0], t->con.text, t->proptext);
+			sprintf(str, IFACE_("ScaleB: %s%s %s"), &tvec[0], t->con.text, t->proptext);
 		else
-			sprintf(str, "ScaleB: %s : %s : %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN], &tvec[NUM_STR_REP_LEN * 2],
-			        t->con.text, t->proptext);
+			sprintf(str, IFACE_("ScaleB: %s : %s : %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
+			        &tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
 	}
 	else {
-		sprintf(str, "ScaleB X: %s  Y: %s  Z: %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN], &tvec[NUM_STR_REP_LEN * 2],
-		        t->con.text, t->proptext);
+		sprintf(str, IFACE_("ScaleB X: %s  Y: %s  Z: %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
+		        &tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
 	}
 }
 
@@ -4801,10 +4876,10 @@ int BoneEnvelope(TransInfo *t, const int UNUSED(mval[2]))
 		char c[NUM_STR_REP_LEN];
 		
 		outputNumInput(&(t->num), c);
-		sprintf(str, "Envelope: %s", c);
+		sprintf(str, IFACE_("Envelope: %s"), c);
 	}
 	else {
-		sprintf(str, "Envelope: %3f", ratio);
+		sprintf(str, IFACE_("Envelope: %3f"), ratio);
 	}
 	
 	for (i = 0; i < t->total; i++, td++) {
@@ -4834,97 +4909,200 @@ int BoneEnvelope(TransInfo *t, const int UNUSED(mval[2]))
 static BMEdge *get_other_edge(BMVert *v, BMEdge *e)
 {
 	BMIter iter;
-	BMEdge *e2;
+	BMEdge *e_iter;
 
-	BM_ITER_ELEM (e2, &iter, v, BM_EDGES_OF_VERT) {
-		if (BM_elem_flag_test(e2, BM_ELEM_SELECT) && e2 != e)
-			return e2;
+	BM_ITER_ELEM (e_iter, &iter, v, BM_EDGES_OF_VERT) {
+		if (BM_elem_flag_test(e_iter, BM_ELEM_SELECT) && e_iter != e) {
+			return e_iter;
+		}
 	}
 
 	return NULL;
 }
 
+static void len_v3_ensure(float v[3], const float length)
+{
+	normalize_v3(v);
+	mul_v3_fl(v, length);
+}
+
+/**
+ * Find the closest point on the ngon on the opposite side.
+ * used to set the edge slide distance for ngons.
+ */
+static bool bm_loop_calc_opposite_co(BMLoop *l_tmp,
+                                     const float plane_no[3],
+                                     float r_co[3])
+{
+	/* skip adjacent edges */
+	BMLoop *l_first = l_tmp->next;
+	BMLoop *l_last  = l_tmp->prev;
+	BMLoop *l_iter;
+	float dist = FLT_MAX;
+
+	l_iter = l_first;
+	do {
+		float tvec[3];
+		if (isect_line_plane_v3(tvec,
+		                        l_iter->v->co, l_iter->next->v->co,
+		                        l_tmp->v->co, plane_no, false))
+		{
+			const float fac = line_point_factor_v3(tvec, l_iter->v->co, l_iter->next->v->co);
+			/* allow some overlap to avoid missing the intersection because of float precision */
+			if ((fac > -FLT_EPSILON) && (fac < 1.0f + FLT_EPSILON)) {
+				/* likelyhood of multiple intersections per ngon is quite low,
+				 * it would have to loop back on its self, but better support it
+				 * so check for the closest opposite edge */
+				const float tdist = len_v3v3(l_tmp->v->co, tvec);
+				if (tdist < dist) {
+					copy_v3_v3(r_co, tvec);
+					dist = tdist;
+				}
+			}
+		}
+	} while ((l_iter = l_iter->next) != l_last);
+
+	return (dist != FLT_MAX);
+}
+
+/**
+ * Given 2 edges and a loop, step over the loops
+ * and calculate a direction to slide along.
+ *
+ * \param r_slide_vec the direction to slide,
+ * the length of the vector defines the slide distance.
+ */
 static BMLoop *get_next_loop(BMVert *v, BMLoop *l,
-                             BMEdge *olde, BMEdge *nexte, float vec[3])
+                             BMEdge *e_prev, BMEdge *e_next, float r_slide_vec[3])
 {
-	BMLoop *firstl;
-	float a[3] = {0.0f, 0.0f, 0.0f}, n[3] = {0.0f, 0.0f, 0.0f};
+	BMLoop *l_first;
+	float vec_accum[3] = {0.0f, 0.0f, 0.0f};
+	float vec_accum_len = 0.0f;
 	int i = 0;
 
-	firstl = l;
+	BLI_assert(BM_edge_share_vert(e_prev, e_next) == v);
+
+	l_first = l;
 	do {
 		l = BM_face_other_edge_loop(l->f, l->e, v);
 		if (l->radial_next == l)
 			return NULL;
 		
-		if (l->e == nexte) {
+		if (l->e == e_next) {
 			if (i) {
-				mul_v3_fl(a, 1.0f / (float)i);
+				len_v3_ensure(vec_accum, vec_accum_len / (float)i);
 			}
 			else {
-				float f1[3], f2[3], f3[3];
+				/* When there is no edge to slide along,
+				 * we must slide along the vector defined by the face we're attach to */
+				BMLoop *l_tmp = BM_face_vert_share_loop(l_first->f, v);
 
-				sub_v3_v3v3(f1, BM_edge_other_vert(olde, v)->co, v->co);
-				sub_v3_v3v3(f2, BM_edge_other_vert(nexte, v)->co, v->co);
+				BLI_assert(ELEM(l_tmp->e, e_prev, e_next) && ELEM(l_tmp->prev->e, e_prev, e_next));
+
+				if (l_tmp->f->len == 4) {
+					/* we could use code below, but in this case
+					 * sliding diagonally across the quad works well */
+					sub_v3_v3v3(vec_accum, l_tmp->next->next->v->co, v->co);
+				}
+				else {
+					float tdir[3];
+					BM_loop_calc_face_direction(l_tmp, tdir);
+					cross_v3_v3v3(vec_accum, l_tmp->f->no, tdir);
+#if 0
+					/* rough guess, we can  do better! */
+					len_v3_ensure(vec_accum, (BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f);
+#else
+					/* be clever, check the opposite ngon edge to slide into.
+					 * this gives best results */
+					{
+						float tvec[3];
+						float dist;
 
-				cross_v3_v3v3(f3, f1, l->f->no);
-				cross_v3_v3v3(a, f2, l->f->no);
-				mul_v3_fl(a, -1.0f);
+						if (bm_loop_calc_opposite_co(l_tmp, tdir, tvec)) {
+							dist = len_v3v3(l_tmp->v->co, tvec);
+						}
+						else {
+							dist = (BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f;
+						}
 
-				mid_v3_v3v3(a, a, f3);
+						len_v3_ensure(vec_accum, dist);
+					}
+#endif
+				}
 			}
-			
-			copy_v3_v3(vec, a);
+
+			copy_v3_v3(r_slide_vec, vec_accum);
 			return l;
 		}
 		else {
-			sub_v3_v3v3(n, BM_edge_other_vert(l->e, v)->co, v->co);
-			add_v3_v3v3(a, a, n);
+			/* accumulate the normalized edge vector,
+			 * normalize so some edges don't skew the result */
+			float tvec[3];
+			sub_v3_v3v3(tvec, BM_edge_other_vert(l->e, v)->co, v->co);
+			vec_accum_len += normalize_v3(tvec);
+			add_v3_v3(vec_accum, tvec);
 			i += 1;
 		}
 
-		if (BM_face_other_edge_loop(l->f, l->e, v)->e == nexte) {
-			if (i)
-				mul_v3_fl(a, 1.0f / (float)i);
-			
-			copy_v3_v3(vec, a);
+		if (BM_face_other_edge_loop(l->f, l->e, v)->e == e_next) {
+			if (i) {
+				len_v3_ensure(vec_accum, vec_accum_len / (float)i);
+			}
+
+			copy_v3_v3(r_slide_vec, vec_accum);
 			return BM_face_other_edge_loop(l->f, l->e, v);
 		}
 		
+		BLI_assert(l != l->radial_next);
 		l = l->radial_next;
-	} while (l != firstl);
+	} while (l != l_first);
 
-	if (i)
-		mul_v3_fl(a, 1.0f / (float)i);
+	if (i) {
+		len_v3_ensure(vec_accum, vec_accum_len / (float)i);
+	}
 	
-	copy_v3_v3(vec, a);
+	copy_v3_v3(r_slide_vec, vec_accum);
 	
 	return NULL;
 }
 
-static void calcNonProportionalEdgeSlide(TransInfo *t, SlideData *sld, const float mval[2])
+static void calcNonProportionalEdgeSlide(TransInfo *t, EdgeSlideData *sld, const float mval[2])
 {
-	TransDataSlideVert *sv = sld->sv;
+	TransDataEdgeSlideVert *sv = sld->sv;
 
 	if (sld->totsv > 0) {
+		ARegion *ar = t->ar;
+		RegionView3D *rv3d = NULL;
+		float projectMat[4][4];
+
 		int i = 0;
 
-		float v_proj[3];
+		float v_proj[2];
 		float dist = 0;
 		float min_dist = FLT_MAX;
 
+		if (t->spacetype == SPACE_VIEW3D) {
+			/* background mode support */
+			rv3d = t->ar ? t->ar->regiondata : NULL;
+		}
+
+		if (!rv3d) {
+			/* ok, let's try to survive this */
+			unit_m4(projectMat);
+		}
+		else {
+			ED_view3d_ob_project_mat_get(rv3d, t->obedit, projectMat);
+		}
+
 		for (i = 0; i < sld->totsv; i++, sv++) {
 			/* Set length */
 			sv->edge_len = len_v3v3(sv->upvec, sv->downvec);
 
-			mul_v3_m4v3(v_proj, t->obedit->obmat, sv->v->co);
-			/* allow points behind the view [#33643] */
-			if (ED_view3d_project_float_global(t->ar, v_proj, v_proj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
-				dist = len_squared_v2v2(mval, v_proj);
-				if (dist < min_dist) {
-					min_dist = dist;
-					sld->curr_sv_index = i;
-				}
+			ED_view3d_project_float_v2_m4(ar, sv->v->co, v_proj, projectMat);
+			dist = len_squared_v2v2(mval, v_proj);
+			if (dist < min_dist) {
+				min_dist = dist;
+				sld->curr_sv_index = i;
 			}
 		}
 	}
@@ -4933,17 +5111,18 @@ static void calcNonProportionalEdgeSlide(TransInfo *t, SlideData *sld, const flo
 	}
 }
 
-static int createSlideVerts(TransInfo *t)
+static int createEdgeSlideVerts(TransInfo *t)
 {
 	BMEditMesh *em = BMEdit_FromObject(t->obedit);
 	BMesh *bm = em->bm;
 	BMIter iter;
 	BMEdge *e, *e1;
-	BMVert *v, *v2, *first;
-	TransDataSlideVert *sv_array;
+	BMVert *v, *v2;
+	TransDataEdgeSlideVert *sv_array;
+	int sv_tot;
 	BMBVHTree *btree;
 	SmallHash table;
-	SlideData *sld = MEM_callocN(sizeof(*sld), "sld");
+	EdgeSlideData *sld = MEM_callocN(sizeof(*sld), "sld");
 	View3D *v3d = NULL;
 	RegionView3D *rv3d = NULL;
 	ARegion *ar = t->ar;
@@ -5040,12 +5219,13 @@ static int createSlideVerts(TransInfo *t)
 		return 0;
 	}
 
-	sv_array = MEM_callocN(sizeof(TransDataSlideVert) * j, "sv_array");
+	sv_tot = j;
+	sv_array = MEM_callocN(sizeof(TransDataEdgeSlideVert) * sv_tot, "sv_array");
 	loop_nr = 0;
 
-	j = 0;
 	while (1) {
 		BMLoop *l, *l1, *l2;
+		BMVert *v_first;
 
 		v = NULL;
 		BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
@@ -5060,7 +5240,7 @@ static int createSlideVerts(TransInfo *t)
 		if (!v->e)
 			continue;
 		
-		first = v;
+		v_first = v;
 
 		/*walk along the edge loop*/
 		e = v->e;
@@ -5080,7 +5260,7 @@ static int createSlideVerts(TransInfo *t)
 				break;
 
 			v = BM_edge_other_vert(e, v);
-		} while (e != first->e);
+		} while (e != v_first->e);
 
 		BM_elem_flag_disable(v, BM_ELEM_TAG);
 
@@ -5100,10 +5280,12 @@ static int createSlideVerts(TransInfo *t)
 		}
 
 		/*iterate over the loop*/
-		first = v;
+		v_first = v;
 		do {
-			TransDataSlideVert *sv = sv_array + j;
+			TransDataEdgeSlideVert *sv;
 
+			/* XXX, 'sv' will initialize multiple times, this is suspicious. see [#34024] */
+			sv = sv_array + GET_INT_FROM_POINTER(BLI_smallhash_lookup(&table, (uintptr_t)v));
 			sv->v = v;
 			sv->origvert = *v;
 			sv->loop_nr = loop_nr;
@@ -5125,9 +5307,7 @@ static int createSlideVerts(TransInfo *t)
 			e1 = e;
 			e = get_other_edge(v, e);
 			if (!e) {
-				//v2=v, v = BM_edge_other_vert(l1->e, v);
-
-				sv = sv_array + j + 1;
+				sv = sv_array + GET_INT_FROM_POINTER(BLI_smallhash_lookup(&table, (uintptr_t)v));
 				sv->v = v;
 				sv->origvert = *v;
 				sv->loop_nr = loop_nr;
@@ -5144,19 +5324,16 @@ static int createSlideVerts(TransInfo *t)
 
 				BM_elem_flag_disable(v, BM_ELEM_TAG);
 				BM_elem_flag_disable(v2, BM_ELEM_TAG);
-				
-				j += 2;
+
 				break;
 			}
 
 			l1 = get_next_loop(v, l1, e1, e, vec);
 			l2 = l2 ? get_next_loop(v, l2, e1, e, vec2) : NULL;
 
-			j += 1;
-
 			BM_elem_flag_disable(v, BM_ELEM_TAG);
 			BM_elem_flag_disable(v2, BM_ELEM_TAG);
-		} while (e != first->e && l1);
+		} while (e != v_first->e && l1);
 
 		loop_nr++;
 	}
@@ -5164,7 +5341,7 @@ static int createSlideVerts(TransInfo *t)
 	/* EDBM_flag_disable_all(em, BM_ELEM_SELECT); */
 
 	sld->sv = sv_array;
-	sld->totsv = j;
+	sld->totsv = sv_tot;
 	
 	/* find mouse vectors, the global one, and one per loop in case we have
 	 * multiple loops selected, in case they are oriented different */
@@ -5272,7 +5449,7 @@ static int createSlideVerts(TransInfo *t)
 	if (rv3d)
 		calcNonProportionalEdgeSlide(t, sld, mval);
 
-	sld->origfaces_init = TRUE;
+	sld->origfaces_init = true;
 	sld->em = em;
 	
 	/*zero out start*/
@@ -5305,10 +5482,10 @@ static int createSlideVerts(TransInfo *t)
 	return 1;
 }
 
-void projectSVData(TransInfo *t, int final)
+void projectEdgeSlideData(TransInfo *t, bool is_final)
 {
-	SlideData *sld = t->customData;
-	TransDataSlideVert *sv;
+	EdgeSlideData *sld = t->customData;
+	TransDataEdgeSlideVert *sv;
 	BMEditMesh *em = sld->em;
 	SmallHash visit;
 	int i;
@@ -5435,7 +5612,7 @@ void projectSVData(TransInfo *t, int final)
 				 * and we do not want to mess up other shape keys */
 				BM_loop_interp_from_face(em->bm, l, f_copy_flip, FALSE, FALSE);
 
-				if (final) {
+				if (is_final) {
 					BM_loop_interp_multires(em->bm, l, f_copy_flip);
 					if (f_copy != f_copy_flip) {
 						BM_loop_interp_multires(em->bm, l, f_copy);
@@ -5459,7 +5636,7 @@ void projectSVData(TransInfo *t, int final)
 	BLI_smallhash_release(&visit);
 }
 
-void freeSlideTempFaces(SlideData *sld)
+void freeEdgeSlideTempFaces(EdgeSlideData *sld)
 {
 	if (sld->origfaces_init) {
 		SmallHashIter hiter;
@@ -5472,7 +5649,7 @@ void freeSlideTempFaces(SlideData *sld)
 
 		BLI_smallhash_release(&sld->origfaces);
 
-		sld->origfaces_init = FALSE;
+		sld->origfaces_init = false;
 
 		/* arrays are dirty from removing faces: EDBM_index_arrays_free */
 		EDBM_update_generic(sld->em, FALSE, TRUE);
@@ -5480,13 +5657,13 @@ void freeSlideTempFaces(SlideData *sld)
 }
 
 
-void freeSlideVerts(TransInfo *t)
+void freeEdgeSlideVerts(TransInfo *t)
 {
-	SlideData *sld = t->customData;
+	EdgeSlideData *sld = t->customData;
 	
 #if 0 /*BMESH_TODO*/
 	if (me->drawflag & ME_DRAWEXTRA_EDGELEN) {
-		TransDataSlideVert *sv;
+		TransDataEdgeSlideVert *sv;
 		LinkNode *look = sld->vertlist;
 		GHash *vertgh = sld->vhash;
 		while (look) {
@@ -5503,7 +5680,7 @@ void freeSlideVerts(TransInfo *t)
 	if (!sld)
 		return;
 	
-	freeSlideTempFaces(sld);
+	freeEdgeSlideTempFaces(sld);
 
 	bmesh_edit_end(sld->em->bm, BMO_OP_FLAG_UNTAN_MULTIRES);
 
@@ -5519,13 +5696,13 @@ void freeSlideVerts(TransInfo *t)
 
 void initEdgeSlide(TransInfo *t)
 {
-	SlideData *sld;
+	EdgeSlideData *sld;
 
 	t->mode = TFM_EDGE_SLIDE;
 	t->transform = EdgeSlide;
 	t->handleEvent = handleEventEdgeSlide;
 
-	if (!createSlideVerts(t)) {
+	if (!createEdgeSlideVerts(t)) {
 		t->state = TRANS_CANCEL;
 		return;
 	}
@@ -5535,11 +5712,11 @@ void initEdgeSlide(TransInfo *t)
 	if (!sld)
 		return;
 
-	t->customFree = freeSlideVerts;
+	t->customFree = freeEdgeSlideVerts;
 
 	/* set custom point first if you want value to be initialized by init */
 	setCustomPoints(t, &t->mouse, sld->end, sld->start);
-	initMouseInputMode(t, &t->mouse, INPUT_CUSTOM_RATIO);
+	initMouseInputMode(t, &t->mouse, INPUT_CUSTOM_RATIO_FLIP);
 	
 	t->idx_max = 0;
 	t->num.idx_max = 0;
@@ -5555,7 +5732,7 @@ void initEdgeSlide(TransInfo *t)
 int handleEventEdgeSlide(struct TransInfo *t, struct wmEvent *event)
 {
 	if (t->mode == TFM_EDGE_SLIDE) {
-		SlideData *sld = t->customData;
+		EdgeSlideData *sld = t->customData;
 
 		if (sld) {
 			switch (event->type) {
@@ -5598,17 +5775,17 @@ int handleEventEdgeSlide(struct TransInfo *t, struct wmEvent *event)
 	return 0;
 }
 
-void drawNonPropEdge(const struct bContext *C, TransInfo *t)
+void drawEdgeSlide(const struct bContext *C, TransInfo *t)
 {
 	if (t->mode == TFM_EDGE_SLIDE) {
-		SlideData *sld = (SlideData *)t->customData;
+		EdgeSlideData *sld = (EdgeSlideData *)t->customData;
 		/* Non-Prop mode */
 		if (sld && sld->is_proportional == FALSE) {
 			View3D *v3d = CTX_wm_view3d(C);
 			float marker[3];
 			float v1[3], v2[3];
 			float interp_v;
-			TransDataSlideVert *curr_sv = &sld->sv[sld->curr_sv_index];
+			TransDataEdgeSlideVert *curr_sv = &sld->sv[sld->curr_sv_index];
 			const float ctrl_size = UI_GetThemeValuef(TH_FACEDOT_SIZE) + 1.5f;
 			const float guide_size = ctrl_size - 0.5f;
 			const float line_size = UI_GetThemeValuef(TH_OUTLINE_WIDTH) + 0.5f;
@@ -5674,8 +5851,8 @@ void drawNonPropEdge(const struct bContext *C, TransInfo *t)
 
 static int doEdgeSlide(TransInfo *t, float perc)
 {
-	SlideData *sld = t->customData;
-	TransDataSlideVert *svlist = sld->sv, *sv;
+	EdgeSlideData *sld = t->customData;
+	TransDataEdgeSlideVert *svlist = sld->sv, *sv;
 	int i;
 
 	sld->perc = perc;
@@ -5705,7 +5882,7 @@ static int doEdgeSlide(TransInfo *t, float perc)
 		 * \note len_v3v3(curr_sv->upvec, curr_sv->downvec)
 		 * is the same as the distance between the original vert locations, same goes for the lines below.
 		 */
-		TransDataSlideVert *curr_sv = &sld->sv[sld->curr_sv_index];
+		TransDataEdgeSlideVert *curr_sv = &sld->sv[sld->curr_sv_index];
 		const float curr_length_perc = curr_sv->edge_len * (((sld->flipped_vtx ? perc : -perc) + 1.0f) / 2.0f);
 
 		float down_co[3];
@@ -5728,7 +5905,7 @@ static int doEdgeSlide(TransInfo *t, float perc)
 		}
 	}
 	
-	projectSVData(t, 0);
+	projectEdgeSlideData(t, 0);
 	
 	return 1;
 }
@@ -5737,9 +5914,9 @@ int EdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
 {
 	char str[128];
 	float final;
-	SlideData *sld =  t->customData;
-	int flipped = sld->flipped_vtx;
-	int is_proportional = sld->is_proportional;
+	EdgeSlideData *sld =  t->customData;
+	bool flipped = sld->flipped_vtx;
+	bool is_proportional = sld->is_proportional;
 
 	final = t->values[0];
 
@@ -5755,12 +5932,12 @@ int EdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
 
 		outputNumInput(&(t->num), c);
 
-		BLI_snprintf(str, sizeof(str), "Edge Slide: %s (E)ven: %s, (F)lipped: %s",
-		             &c[0], !is_proportional ? "ON" : "OFF", flipped ? "ON" : "OFF");
+		BLI_snprintf(str, sizeof(str), IFACE_("Edge Slide: %s (E)ven: %s, (F)lipped: %s"),
+		             &c[0], !is_proportional ? IFACE_("ON") : IFACE_("OFF"), flipped ? IFACE_("ON") : IFACE_("OFF"));
 	}
 	else {
-		BLI_snprintf(str, sizeof(str), "Edge Slide: %.2f (E)ven: %s, (F)lipped: %s",
-		             final, !is_proportional ? "ON" : "OFF", flipped ? "ON" : "OFF");
+		BLI_snprintf(str, sizeof(str), IFACE_("Edge Slide: %.4f (E)ven: %s, (F)lipped: %s"),
+		             final, !is_proportional ? IFACE_("ON") : IFACE_("OFF"), flipped ? IFACE_("ON") : IFACE_("OFF"));
 	}
 
 	CLAMP(final, -1.0f, 1.0f);
@@ -5771,7 +5948,7 @@ int EdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
 	if (t->customData)
 		doEdgeSlide(t, final);
 	else {
-		strcpy(str, "Invalid Edge Selection");
+		strcpy(str, IFACE_("Invalid Edge Selection"));
 		t->state = TRANS_CANCEL;
 	}
 
@@ -5782,6 +5959,521 @@ int EdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
 	return 1;
 }
 
+
+/* ******************** Vert Slide *************** */
+static void calcVertSlideCustomPoints(struct TransInfo *t)
+{
+	VertSlideData *sld = t->customData;
+	TransDataVertSlideVert *sv = &sld->sv[sld->curr_sv_index];
+	float *co_orig = sv->co_orig_2d;
+	float *co_curr = sv->co_link_orig_2d[sv->co_link_curr];
+	const int start[2] = {co_orig[0], co_orig[1]};
+	const int end[2]   = {co_curr[0], co_curr[1]};
+
+	if (sld->flipped_vtx && sld->is_proportional == false) {
+		setCustomPoints(t, &t->mouse, start, end);
+	}
+	else {
+		setCustomPoints(t, &t->mouse, end, start);
+	}
+}
+
+/**
+ * Run once when initializing vert slide to find the reference edge
+ */
+static void calcVertSlideMouseActiveVert(struct TransInfo *t, const int mval[2])
+{
+	VertSlideData *sld = t->customData;
+	float mval_fl[2] = {UNPACK2(mval)};
+	TransDataVertSlideVert *sv;
+
+	/* set the vertex to use as a reference for the mouse direction 'curr_sv_index' */
+	float dist = 0.0f;
+	float min_dist = FLT_MAX;
+	int i;
+
+	for (i = 0, sv = sld->sv; i < sld->totsv; i++, sv++) {
+		dist = len_squared_v2v2(mval_fl, sv->co_orig_2d);
+		if (dist < min_dist) {
+			min_dist = dist;
+			sld->curr_sv_index = i;
+		}
+	}
+}
+/**
+ * Run while moving the mouse to slide along the edge matching the mouse direction
+ */
+static void calcVertSlideMouseActiveEdges(struct TransInfo *t, const int mval[2])
+{
+	VertSlideData *sld = t->customData;
+	float mval_fl[2] = {UNPACK2(mval)};
+
+	float dir[2];
+	TransDataVertSlideVert *sv;
+	int i;
+
+	/* first get the direction of the original vertex */
+	sub_v2_v2v2(dir, sld->sv[sld->curr_sv_index].co_orig_2d, mval_fl);
+	normalize_v2(dir);
+
+	for (i = 0, sv = sld->sv; i < sld->totsv; i++, sv++) {
+		if (sv->co_link_tot > 1) {
+			float dir_dot_best = -FLT_MAX;
+			int co_link_curr_best = -1;
+			int j;
+
+			for (j = 0; j < sv->co_link_tot; j++) {
+				float tdir[2];
+				float dir_dot;
+				sub_v2_v2v2(tdir, sv->co_orig_2d, sv->co_link_orig_2d[j]);
+				normalize_v2(tdir);
+				dir_dot = dot_v2v2(dir, tdir);
+				if (dir_dot > dir_dot_best) {
+					dir_dot_best = dir_dot;
+					co_link_curr_best = j;
+				}
+			}
+
+			if (co_link_curr_best != -1) {
+				sv->co_link_curr = co_link_curr_best;
+			}
+		}
+	}
+}
+
+static int createVertSlideVerts(TransInfo *t)
+{
+	BMEditMesh *em = BMEdit_FromObject(t->obedit);
+	BMesh *bm = em->bm;
+	BMIter iter;
+	BMIter eiter;
+	BMEdge *e;
+	BMVert *v;
+	TransDataVertSlideVert *sv_array;
+	VertSlideData *sld = MEM_callocN(sizeof(*sld), "sld");
+//	View3D *v3d = NULL;
+	RegionView3D *rv3d = NULL;
+	ARegion *ar = t->ar;
+	float projectMat[4][4];
+	int j;
+
+	if (t->spacetype == SPACE_VIEW3D) {
+		/* background mode support */
+//		v3d = t->sa ? t->sa->spacedata.first : NULL;
+		rv3d = ar ? ar->regiondata : NULL;
+	}
+
+	sld->is_proportional = true;
+	sld->curr_sv_index = 0;
+	sld->flipped_vtx = false;
+
+	if (!rv3d) {
+		/* ok, let's try to survive this */
+		unit_m4(projectMat);
+	}
+	else {
+		ED_view3d_ob_project_mat_get(rv3d, t->obedit, projectMat);
+	}
+
+	j = 0;
+	BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
+		bool ok = false;
+		if (BM_elem_flag_test(v, BM_ELEM_SELECT) && v->e) {
+			BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
+				if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+					ok = true;
+					break;
+				}
+			}
+		}
+
+		if (ok) {
+			BM_elem_flag_enable(v, BM_ELEM_TAG);
+			j += 1;
+		}
+		else {
+			BM_elem_flag_disable(v, BM_ELEM_TAG);
+		}
+	}
+
+	if (!j) {
+		MEM_freeN(sld);
+		return 0;
+	}
+
+	sv_array = MEM_callocN(sizeof(TransDataVertSlideVert) * j, "sv_array");
+
+	j = 0;
+	BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
+		if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
+			int k;
+			sv_array[j].v = v;
+			copy_v3_v3(sv_array[j].co_orig_3d, v->co);
+
+			k = 0;
+			BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
+				if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+					k++;
+				}
+			}
+
+			sv_array[j].co_link_orig_3d = MEM_mallocN(sizeof(*sv_array[j].co_link_orig_3d) * k, __func__);
+			sv_array[j].co_link_orig_2d = MEM_mallocN(sizeof(*sv_array[j].co_link_orig_2d) * k, __func__);
+			sv_array[j].co_link_tot = k;
+
+			k = 0;
+			BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
+				if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+					BMVert *v_other = BM_edge_other_vert(e, v);
+					copy_v3_v3(sv_array[j].co_link_orig_3d[k], v_other->co);
+					if (ar) {
+						ED_view3d_project_float_v2_m4(ar,
+						                              sv_array[j].co_link_orig_3d[k],
+						                              sv_array[j].co_link_orig_2d[k],
+						                              projectMat);
+					}
+					else {
+						copy_v2_v2(sv_array[j].co_link_orig_2d[k],
+						           sv_array[j].co_link_orig_3d[k]);
+					}
+					k++;
+				}
+			}
+
+			if (ar) {
+				ED_view3d_project_float_v2_m4(ar,
+				                              sv_array[j].co_orig_3d,
+				                              sv_array[j].co_orig_2d,
+				                              projectMat);
+			}
+			else {
+				copy_v2_v2(sv_array[j].co_orig_2d,
+				           sv_array[j].co_orig_3d);
+			}
+
+			j++;
+		}
+	}
+
+	sld->sv = sv_array;
+	sld->totsv = j;
+
+	sld->em = em;
+
+	sld->perc = 0.0f;
+
+	t->customData = sld;
+
+	if (rv3d) {
+		calcVertSlideMouseActiveVert(t, t->mval);
+		calcVertSlideMouseActiveEdges(t, t->mval);
+	}
+
+	return 1;
+}
+
+void freeVertSlideVerts(TransInfo *t)
+{
+	VertSlideData *sld = t->customData;
+
+	if (!sld)
+		return;
+
+
+	if (sld->totsv > 0) {
+		TransDataVertSlideVert *sv = sld->sv;
+		int i = 0;
+		for (i = 0; i < sld->totsv; i++, sv++) {
+			MEM_freeN(sv->co_link_orig_2d);
+			MEM_freeN(sv->co_link_orig_3d);
+		}
+	}
+
+	MEM_freeN(sld->sv);
+	MEM_freeN(sld);
+
+	t->customData = NULL;
+
+	recalcData(t);
+}
+
+void initVertSlide(TransInfo *t)
+{
+	VertSlideData *sld;
+
+	t->mode = TFM_VERT_SLIDE;
+	t->transform = VertSlide;
+	t->handleEvent = handleEventVertSlide;
+
+	if (!createVertSlideVerts(t)) {
+		t->state = TRANS_CANCEL;
+		return;
+	}
+
+	sld = t->customData;
+
+	if (!sld)
+		return;
+
+	t->customFree = freeVertSlideVerts;
+
+	/* set custom point first if you want value to be initialized by init */
+	calcVertSlideCustomPoints(t);
+	initMouseInputMode(t, &t->mouse, INPUT_CUSTOM_RATIO);
+
+	t->idx_max = 0;
+	t->num.idx_max = 0;
+	t->snap[0] = 0.0f;
+	t->snap[1] = 0.1f;
+	t->snap[2] = t->snap[1] * 0.1f;
+
+	t->num.increment = t->snap[1];
+
+	t->flag |= T_NO_CONSTRAINT | T_NO_PROJECT;
+}
+
+int handleEventVertSlide(struct TransInfo *t, struct wmEvent *event)
+{
+	if (t->mode == TFM_VERT_SLIDE) {
+		VertSlideData *sld = t->customData;
+
+		if (sld) {
+			switch (event->type) {
+				case EKEY:
+					if (event->val == KM_PRESS) {
+						sld->is_proportional = !sld->is_proportional;
+						if (sld->flipped_vtx) {
+							calcVertSlideCustomPoints(t);
+						}
+						return 1;
+					}
+					break;
+				case FKEY:
+				{
+					if (event->val == KM_PRESS) {
+						sld->flipped_vtx = !sld->flipped_vtx;
+						calcVertSlideCustomPoints(t);
+						return 1;
+					}
+					break;
+				}
+				case CKEY:
+				{
+					/* use like a modifier key */
+					if (event->val == KM_PRESS) {
+						t->flag ^= T_ALT_TRANSFORM;
+						calcVertSlideCustomPoints(t);
+						return 1;
+					}
+					break;
+				}
+#if 0
+				case EVT_MODAL_MAP:
+				{
+					switch (event->val) {
+						case TFM_MODAL_EDGESLIDE_DOWN:
+						{
+							sld->curr_sv_index = ((sld->curr_sv_index - 1) + sld->totsv) % sld->totsv;
+							break;
+						}
+						case TFM_MODAL_EDGESLIDE_UP:
+						{
+							sld->curr_sv_index = (sld->curr_sv_index + 1) % sld->totsv;
+							break;
+						}
+					}
+				}
+#endif
+				case MOUSEMOVE:
+				{
+					/* don't recalculat the best edge */
+					const bool is_clamp = !(t->flag & T_ALT_TRANSFORM);
+					if (is_clamp) {
+						calcVertSlideMouseActiveEdges(t, event->mval);
+					}
+					calcVertSlideCustomPoints(t);
+				}
+				default:
+					break;
+			}
+		}
+	}
+	return 0;
+}
+
+static void drawVertSlide(const struct bContext *C, TransInfo *t)
+{
+	if (t->mode == TFM_VERT_SLIDE) {
+		VertSlideData *sld = (VertSlideData *)t->customData;
+		/* Non-Prop mode */
+		if (sld) {
+			View3D *v3d = CTX_wm_view3d(C);
+			TransDataVertSlideVert *curr_sv = &sld->sv[sld->curr_sv_index];
+			TransDataVertSlideVert *sv;
+			const float ctrl_size = UI_GetThemeValuef(TH_FACEDOT_SIZE) + 1.5f;
+			const float line_size = UI_GetThemeValuef(TH_OUTLINE_WIDTH) + 0.5f;
+			const int alpha_shade = -30;
+			const bool is_clamp = !(t->flag & T_ALT_TRANSFORM);
+			int i;
+
+			if (v3d && v3d->zbuf)
+				glDisable(GL_DEPTH_TEST);
+
+			glEnable(GL_BLEND);
+			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+			glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT | GL_POINT_BIT);
+			glPushMatrix();
+
+			glMultMatrixf(t->obedit->obmat);
+
+			glLineWidth(line_size);
+			UI_ThemeColorShadeAlpha(TH_EDGE_SELECT, 80, alpha_shade);
+			glBegin(GL_LINES);
+			if (is_clamp) {
+				sv = sld->sv;
+				for (i = 0; i < sld->totsv; i++, sv++) {
+					glVertex3fv(sv->co_orig_3d);
+					glVertex3fv(sv->co_link_orig_3d[sv->co_link_curr]);
+				}
+			}
+			else {
+				sv = sld->sv;
+				for (i = 0; i < sld->totsv; i++, sv++) {
+					float a[3], b[3];
+					sub_v3_v3v3(a, sv->co_link_orig_3d[sv->co_link_curr], sv->co_orig_3d);
+					mul_v3_fl(a, 100.0f);
+					negate_v3_v3(b, a);
+					add_v3_v3(a, sv->co_orig_3d);
+					add_v3_v3(b, sv->co_orig_3d);
+
+					glVertex3fv(a);
+					glVertex3fv(b);
+				}
+			}
+			bglEnd();
+
+			glPointSize(ctrl_size);
+
+			bglBegin(GL_POINTS);
+			bglVertex3fv((sld->flipped_vtx && sld->is_proportional == FALSE) ?
+			             curr_sv->co_link_orig_3d[curr_sv->co_link_curr] :
+			             curr_sv->co_orig_3d);
+			bglEnd();
+
+			glPopMatrix();
+			glPopAttrib();
+
+			glDisable(GL_BLEND);
+
+			if (v3d && v3d->zbuf)
+				glEnable(GL_DEPTH_TEST);
+		}
+	}
+}
+
+static int doVertSlide(TransInfo *t, float perc)
+{
+	VertSlideData *sld = t->customData;
+	TransDataVertSlideVert *svlist = sld->sv, *sv;
+	int i;
+
+	sld->perc = perc;
+	sv = svlist;
+
+	if (sld->is_proportional == TRUE) {
+		for (i = 0; i < sld->totsv; i++, sv++) {
+			interp_v3_v3v3(sv->v->co, sv->co_orig_3d, sv->co_link_orig_3d[sv->co_link_curr], perc);
+		}
+	}
+	else {
+		TransDataVertSlideVert *sv_curr = &sld->sv[sld->curr_sv_index];
+		const float edge_len_curr = len_v3v3(sv_curr->co_orig_3d, sv_curr->co_link_orig_3d[sv_curr->co_link_curr]);
+		const float tperc = perc * edge_len_curr;
+
+		for (i = 0; i < sld->totsv; i++, sv++) {
+			float edge_len;
+			float dir[3];
+
+			sub_v3_v3v3(dir, sv->co_link_orig_3d[sv->co_link_curr], sv->co_orig_3d);
+			edge_len = normalize_v3(dir);
+
+			if (edge_len > FLT_EPSILON) {
+				if (sld->flipped_vtx) {
+					madd_v3_v3v3fl(sv->v->co, sv->co_link_orig_3d[sv->co_link_curr], dir, -tperc);
+				}
+				else {
+					madd_v3_v3v3fl(sv->v->co, sv->co_orig_3d, dir, tperc);
+				}
+			}
+			else {
+				copy_v3_v3(sv->v->co, sv->co_orig_3d);
+			}
+		}
+	}
+
+	return 1;
+}
+
+int VertSlide(TransInfo *t, const int UNUSED(mval[2]))
+{
+	char str[128];
+	char *str_p;
+	float final;
+	VertSlideData *sld =  t->customData;
+	const bool flipped = sld->flipped_vtx;
+	const bool is_proportional = sld->is_proportional;
+	const bool is_clamp = !(t->flag & T_ALT_TRANSFORM);
+	const bool is_constrained = !(is_clamp == false || hasNumInput(&t->num));
+
+	final = t->values[0];
+
+	snapGrid(t, &final);
+
+	/* only do this so out of range values are not displayed */
+	if (is_constrained) {
+		CLAMP(final, 0.0f, 1.0f);
+	}
+
+	/* header string */
+	str_p = str;
+	str_p += BLI_snprintf(str_p, sizeof(str), IFACE_("Vert Slide: "));
+	if (hasNumInput(&t->num)) {
+		char c[NUM_STR_REP_LEN];
+		applyNumInput(&t->num, &final);
+		outputNumInput(&(t->num), c);
+		str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), "%s", &c[0]);
+	}
+	else {
+		str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), "%.4f ", final);
+	}
+	str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_("(E)ven: %s, "),
+	                      !is_proportional ? IFACE_("ON") : IFACE_("OFF"));
+	if (!is_proportional) {
+		str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_("(F)lipped: %s, "),
+		                      flipped ? IFACE_("ON") : IFACE_("OFF"));
+	}
+	str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_("Alt or (C)lamp: %s"),
+	                      is_clamp ? IFACE_("ON") : IFACE_("OFF"));
+	/* done with header string */
+
+	/*do stuff here*/
+	if (t->customData) {
+		doVertSlide(t, final);
+	}
+	else {
+		strcpy(str, IFACE_("Invalid Vert Selection"));
+		t->state = TRANS_CANCEL;
+	}
+
+	recalcData(t);
+
+	ED_area_headerprint(t->sa, str);
+
+	return 1;
+}
+
+
 /* ******************** EditBone roll *************** */
 
 void initBoneRoll(TransInfo *t)
@@ -5821,12 +6513,12 @@ int BoneRoll(TransInfo *t, const int UNUSED(mval[2]))
 
 		outputNumInput(&(t->num), c);
 
-		sprintf(str, "Roll: %s", &c[0]);
+		sprintf(str, IFACE_("Roll: %s"), &c[0]);
 
 		final = DEG2RADF(final);
 	}
 	else {
-		sprintf(str, "Roll: %.2f", RAD2DEGF(final));
+		sprintf(str, IFACE_("Roll: %.2f"), RAD2DEGF(final));
 	}
 
 	/* set roll values */
@@ -5892,16 +6584,16 @@ int BakeTime(TransInfo *t, const int mval[2])
 		outputNumInput(&(t->num), c);
 
 		if (time >= 0.0f)
-			sprintf(str, "Time: +%s %s", c, t->proptext);
+			sprintf(str, IFACE_("Time: +%s %s"), c, t->proptext);
 		else
-			sprintf(str, "Time: %s %s", c, t->proptext);
+			sprintf(str, IFACE_("Time: %s %s"), c, t->proptext);
 	}
 	else {
 		/* default header print */
 		if (time >= 0.0f)
-			sprintf(str, "Time: +%.3f %s", time, t->proptext);
+			sprintf(str, IFACE_("Time: +%.3f %s"), time, t->proptext);
 		else
-			sprintf(str, "Time: %.3f %s", time, t->proptext);
+			sprintf(str, IFACE_("Time: %.3f %s"), time, t->proptext);
 	}
 
 	for (i = 0; i < t->total; i++, td++) {
@@ -5961,7 +6653,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
 			t->con.applySize(t, NULL, mat);
 		}
 
-		sprintf(str, "Mirror%s", t->con.text);
+		sprintf(str, IFACE_("Mirror%s"), t->con.text);
 
 		for (i = 0, td = t->data; i < t->total; i++, td++) {
 			if (td->flag & TD_NOACTION)
@@ -5995,9 +6687,9 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
 		recalcData(t);
 
 		if (t->flag & T_2D_EDIT)
-			ED_area_headerprint(t->sa, "Select a mirror axis (X, Y)");
+			ED_area_headerprint(t->sa, IFACE_("Select a mirror axis (X, Y)"));
 		else
-			ED_area_headerprint(t->sa, "Select a mirror axis (X, Y, Z)");
+			ED_area_headerprint(t->sa, IFACE_("Select a mirror axis (X, Y, Z)"));
 	}
 
 	return 1;
@@ -6054,7 +6746,7 @@ int Align(TransInfo *t, const int UNUSED(mval[2]))
 
 	recalcData(t);
 
-	ED_area_headerprint(t->sa, "Align");
+	ED_area_headerprint(t->sa, IFACE_("Align"));
 
 	return 1;
 }
@@ -6078,9 +6770,10 @@ void initSeqSlide(TransInfo *t)
 	t->num.increment = t->snap[1];
 }
 
-static void headerSeqSlide(TransInfo *t, float val[2], char *str)
+static void headerSeqSlide(TransInfo *t, float val[2], char *str, size_t str_len)
 {
 	char tvec[NUM_STR_REP_LEN * 3];
+	char *str_p;
 
 	if (hasNumInput(&t->num)) {
 		outputNumInput(&(t->num), tvec);
@@ -6089,7 +6782,17 @@ static void headerSeqSlide(TransInfo *t, float val[2], char *str)
 		sprintf(&tvec[0], "%.0f, %.0f", val[0], val[1]);
 	}
 
-	sprintf(str, "Sequence Slide: %s%s", &tvec[0], t->con.text);
+	str_p = str;
+	str_p += BLI_snprintf(str, str_len, IFACE_("Sequence Slide: %s%s, ("), &tvec[0], t->con.text);
+
+	{
+		wmKeyMapItem *kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE);
+		if (kmi) {
+			str_p += WM_keymap_item_to_string(kmi, str_p, str_len - (str_p - str));
+		}
+	}
+	str_p += BLI_snprintf(str_p, str_len - (str_p - str), IFACE_(" or Alt) Expand to fit %s"),
+	                      (t->flag & T_ALT_TRANSFORM) ? IFACE_("ON") : IFACE_("OFF"));
 }
 
 static void applySeqSlide(TransInfo *t, float val[2])
@@ -6133,7 +6836,7 @@ int SeqSlide(TransInfo *t, const int UNUSED(mval[2]))
 	t->values[0] = floor(t->values[0] + 0.5f);
 	t->values[1] = floor(t->values[1] + 0.5f);
 
-	headerSeqSlide(t, t->values, str);
+	headerSeqSlide(t, t->values, str, sizeof(str));
 	applySeqSlide(t, t->values);
 
 	recalcData(t);
@@ -6354,7 +7057,7 @@ static void headerTimeTranslate(TransInfo *t, char *str)
 			sprintf(&tvec[0], "%.4f", val);
 	}
 
-	sprintf(str, "DeltaX: %s", &tvec[0]);
+	sprintf(str, IFACE_("DeltaX: %s"), &tvec[0]);
 }
 
 static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
@@ -6495,7 +7198,7 @@ static void headerTimeSlide(TransInfo *t, float sval, char *str)
 		sprintf(&tvec[0], "%.4f", val);
 	}
 
-	sprintf(str, "TimeSlide: %s", &tvec[0]);
+	sprintf(str, IFACE_("TimeSlide: %s"), &tvec[0]);
 }
 
 static void applyTimeSlide(TransInfo *t, float sval)
@@ -6627,7 +7330,7 @@ static void headerTimeScale(TransInfo *t, char *str)
 	else
 		sprintf(&tvec[0], "%.4f", t->values[0]);
 
-	sprintf(str, "ScaleX: %s", &tvec[0]);
+	sprintf(str, IFACE_("ScaleX: %s"), &tvec[0]);
 }
 
 static void applyTimeScale(TransInfo *t)
@@ -6696,3 +7399,10 @@ void BIF_TransformSetUndo(const char *UNUSED(str))
 	// TRANSFORM_FIX_ME
 	//Trans.undostr = str;
 }
+
+
+/* TODO, move to: transform_queries.c */
+bool checkUseLocalCenter_GraphEdit(TransInfo *t)
+{
+	return ((t->around == V3D_LOCAL) && !ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE));
+}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 08fe1e7..9c57c74 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -52,12 +52,7 @@ struct Object;
 struct View3D;
 struct ScrArea;
 struct Scene;
-struct bPose;
 struct bConstraint;
-struct BezTriple;
-struct wmOperatorType;
-struct wmOperator;
-struct wmWindowManager;
 struct wmKeyMap;
 struct wmKeyConfig;
 struct bContext;
@@ -65,7 +60,6 @@ struct wmEvent;
 struct wmTimer;
 struct ARegion;
 struct ReportList;
-struct SmallHash;
 
 typedef struct TransSnapPoint {
 	struct TransSnapPoint *next, *prev;
@@ -108,15 +102,15 @@ typedef struct TransCon {
 	int   imval[2];	     /* initial mouse value for visual calculation                                */
 	                     /* the one in TransInfo is not garanty to stay the same (Rotates change it)  */
 	int   mode;          /* Mode flags of the Constraint                                              */
-	void  (*drawExtra)(struct TransInfo *);
+	void  (*drawExtra)(struct TransInfo *t);
 	                     /* For constraints that needs to draw differently from the other
 	                      * uses this instead of the generic draw function                            */
-	void  (*applyVec)(struct TransInfo *, struct TransData *, float *, float *, float *);
+	void  (*applyVec)(struct TransInfo *t, struct TransData *td, const float in[3], float out[3], float pvec[3]);
 	                     /* Apply function pointer for linear vectorial transformation                */
 	                     /* The last three parameters are pointers to the in/out/printable vectors    */
-	void  (*applySize)(struct TransInfo *, struct TransData *, float [3][3]);
+	void  (*applySize)(struct TransInfo *t, struct TransData *td, float smat[3][3]);
 	                     /* Apply function pointer for size transformation */
-	void  (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *);
+	void  (*applyRot)(struct TransInfo *t, struct TransData *td, float vec[3], float *angle);
 	                     /* Apply function pointer for rotation transformation */
 } TransCon;
 
@@ -143,6 +137,7 @@ typedef struct TransDataExtension {
 	                      * namely when a bone is in "NoLocal" or "Hinge" mode)... */
 	float  r_smtx[3][3]; /* Invers of previous one. */
 	int    rotOrder;	/* rotation mode,  as defined in eRotationModes (DNA_action_types.h) */
+	float oloc[3], orot[3], oquat[4], orotAxis[3], orotAngle; /* Original object transformation used for rigid bodies */
 } TransDataExtension;
 
 typedef struct TransData2D {
@@ -188,7 +183,7 @@ typedef struct TransDataNla {
 struct LinkNode;
 struct GHash;
 
-typedef struct TransDataSlideVert {
+typedef struct TransDataEdgeSlideVert {
 	struct BMVert vup, vdown;
 	struct BMVert origvert;
 
@@ -201,10 +196,10 @@ typedef struct TransDataSlideVert {
 	float upvec[3], downvec[3];
 
 	int loop_nr;
-} TransDataSlideVert;
+} TransDataEdgeSlideVert;
 
-typedef struct SlideData {
-	TransDataSlideVert *sv;
+typedef struct EdgeSlideData {
+	TransDataEdgeSlideVert *sv;
 	int totsv;
 	
 	struct SmallHash vhash;
@@ -214,15 +209,40 @@ typedef struct SlideData {
 	struct BMEditMesh *em;
 
 	/* flag that is set when origfaces is initialized */
-	int origfaces_init;
+	bool origfaces_init;
 
 	float perc;
 
-	int is_proportional;
-	int flipped_vtx;
+	bool is_proportional;
+	bool flipped_vtx;
 
 	int curr_sv_index;
-} SlideData;
+} EdgeSlideData;
+
+
+typedef struct TransDataVertSlideVert {
+	BMVert *v;
+	float   co_orig_3d[3];
+	float   co_orig_2d[2];
+	float (*co_link_orig_3d)[3];
+	float (*co_link_orig_2d)[2];
+	int     co_link_tot;
+	int     co_link_curr;
+} TransDataVertSlideVert;
+
+typedef struct VertSlideData {
+	TransDataVertSlideVert *sv;
+	int totsv;
+
+	struct BMEditMesh *em;
+
+	float perc;
+
+	bool is_proportional;
+	bool flipped_vtx;
+
+	int curr_sv_index;
+} VertSlideData;
 
 typedef struct TransData {
 	float  dist;         /* Distance needed to affect element (for Proportionnal Editing)                  */
@@ -246,8 +266,8 @@ typedef struct TransData {
 } TransData;
 
 typedef struct MouseInput {
-	void	(*apply)(struct TransInfo *, struct MouseInput *, const int [2], float [3]);
-	void	(*post)(struct TransInfo *, float [3]);
+	void	(*apply)(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]);
+	void	(*post)(struct TransInfo *t, float values[3]);
 
 	int     imval[2];       	/* initial mouse position                */
 	char	precision;
@@ -331,6 +351,7 @@ typedef struct TransInfo {
 	struct Scene	*scene;
 	struct ToolSettings *settings;
 	struct wmTimer *animtimer;
+	struct wmKeyMap *keymap;  /* so we can do lookups for header text */
 	int         mval[2];        /* current mouse position               */
 	struct Object   *obedit;
 	void		*draw_handle_apply;
@@ -530,6 +551,10 @@ void initEdgeSlide(TransInfo *t);
 int handleEventEdgeSlide(TransInfo *t, struct wmEvent *event);
 int EdgeSlide(TransInfo *t, const int mval[2]);
 
+void initVertSlide(TransInfo *t);
+int handleEventVertSlide(TransInfo *t, struct wmEvent *event);
+int VertSlide(TransInfo *t, const int mval[2]);
+
 void initTimeTranslate(TransInfo *t);
 int TimeTranslate(TransInfo *t, const int mval[2]);
 
@@ -653,16 +678,17 @@ typedef enum {
 	INPUT_HORIZONTAL_ABSOLUTE,
 	INPUT_VERTICAL_RATIO,
 	INPUT_VERTICAL_ABSOLUTE,
-	INPUT_CUSTOM_RATIO
+	INPUT_CUSTOM_RATIO,
+	INPUT_CUSTOM_RATIO_FLIP
 } MouseInputMode;
 
-void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], int mval[2]);
+void initMouseInput(TransInfo *t, MouseInput *mi, const int center[2], const int mval[2]);
 void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode);
 int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, struct wmEvent *event);
 void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]);
 
-void setCustomPoints(TransInfo *t, MouseInput *mi, int start[2], int end[2]);
-void setInputPostFct(MouseInput *mi, void	(*post)(struct TransInfo *, float [3]));
+void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]);
+void setInputPostFct(MouseInput *mi, void	(*post)(struct TransInfo *t, float values[3]));
 
 /*********************** Generics ********************************/
 
@@ -672,8 +698,6 @@ void resetTransRestrictions(TransInfo *t);
 
 void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options);
 
-void drawNonPropEdge(const struct bContext *C, TransInfo *t);
-
 /* DRAWLINE options flags */
 #define DRAWLIGHT	1
 
@@ -715,8 +739,14 @@ void applyTransformOrientation(const struct bContext *C, float mat[3][3], char *
 
 int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3], int activeOnly);
 
-void freeSlideTempFaces(SlideData *sld);
-void freeSlideVerts(TransInfo *t);
-void projectSVData(TransInfo *t, int final);
+void freeEdgeSlideTempFaces(EdgeSlideData *sld);
+void freeEdgeSlideVerts(TransInfo *t);
+void projectEdgeSlideData(TransInfo *t, bool is_final);
+
+void freeVertSlideVerts(TransInfo *t);
+
+
+/* TODO. transform_queries.c */
+bool checkUseLocalCenter_GraphEdit(TransInfo *t);
 
 #endif
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 947bdf5..c4d6147 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -60,6 +60,8 @@
 #include "BLI_utildefines.h"
 #include "BLI_string.h"
 
+#include "BLF_translation.h"
+
 #include "UI_resources.h"
 
 #include "transform.h"
@@ -200,13 +202,14 @@ static void viewAxisCorrectCenter(TransInfo *t, float t_con_center[3])
 	}
 }
 
-static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3])
+static void axisProjection(TransInfo *t, const float axis[3], const float in[3], float out[3])
 {
 	float norm[3], vec[3], factor, angle;
 	float t_con_center[3];
 
-	if (in[0] == 0.0f && in[1] == 0.0f && in[2] == 0.0f)
+	if (is_zero_v3(in)) {
 		return;
+	}
 
 	copy_v3_v3(t_con_center, t->con.center);
 
@@ -278,7 +281,7 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
 	}
 }
 
-static void planeProjection(TransInfo *t, float in[3], float out[3])
+static void planeProjection(TransInfo *t, const float in[3], float out[3])
 {
 	float vec[3], factor, norm[3];
 
@@ -308,7 +311,7 @@ static void planeProjection(TransInfo *t, float in[3], float out[3])
  *
  */
 
-static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3])
+static void applyAxisConstraintVec(TransInfo *t, TransData *td, const float in[3], float out[3], float pvec[3])
 {
 	copy_v3_v3(out, in);
 	if (!td && t->con.mode & CON_APPLY) {
@@ -351,7 +354,7 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo
  * Further down, that vector is mapped to each data's space.
  */
 
-static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3])
+static void applyObjectConstraintVec(TransInfo *t, TransData *td, const float in[3], float out[3], float pvec[3])
 {
 	copy_v3_v3(out, in);
 	if (t->con.mode & CON_APPLY) {
@@ -597,24 +600,24 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
 		case V3D_MANIP_GLOBAL:
 		{
 			float mtx[3][3] = MAT3_UNITY;
-			BLI_snprintf(text, sizeof(text), ftext, "global");
+			BLI_snprintf(text, sizeof(text), ftext, IFACE_("global"));
 			setConstraint(t, mtx, mode, text);
 		}
 		break;
 		case V3D_MANIP_LOCAL:
-			BLI_snprintf(text, sizeof(text), ftext, "local");
+			BLI_snprintf(text, sizeof(text), ftext, IFACE_("local"));
 			setLocalConstraint(t, mode, text);
 			break;
 		case V3D_MANIP_NORMAL:
-			BLI_snprintf(text, sizeof(text), ftext, "normal");
+			BLI_snprintf(text, sizeof(text), ftext, IFACE_("normal"));
 			setConstraint(t, t->spacemtx, mode, text);
 			break;
 		case V3D_MANIP_VIEW:
-			BLI_snprintf(text, sizeof(text), ftext, "view");
+			BLI_snprintf(text, sizeof(text), ftext, IFACE_("view"));
 			setConstraint(t, t->spacemtx, mode, text);
 			break;
 		case V3D_MANIP_GIMBAL:
-			BLI_snprintf(text, sizeof(text), ftext, "gimbal");
+			BLI_snprintf(text, sizeof(text), ftext, IFACE_("gimbal"));
 			setConstraint(t, t->spacemtx, mode, text);
 			break;
 		default: /* V3D_MANIP_CUSTOM */
@@ -864,11 +867,11 @@ static void setNearestAxis2d(TransInfo *t)
 	/* no correction needed... just use whichever one is lower */
 	if (abs(t->mval[0] - t->con.imval[0]) < abs(t->mval[1] - t->con.imval[1]) ) {
 		t->con.mode |= CON_AXIS1;
-		BLI_snprintf(t->con.text, sizeof(t->con.text), " along Y axis");
+		BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along Y axis"));
 	}
 	else {
 		t->con.mode |= CON_AXIS0;
-		BLI_snprintf(t->con.text, sizeof(t->con.text), " along X axis");
+		BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along X axis"));
 	}
 }
 
@@ -919,31 +922,31 @@ static void setNearestAxis3d(TransInfo *t)
 	if (len[0] <= len[1] && len[0] <= len[2]) {
 		if (t->modifiers & MOD_CONSTRAINT_PLANE) {
 			t->con.mode |= (CON_AXIS1 | CON_AXIS2);
-			BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s X axis", t->spacename);
+			BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" locking %s X axis"), t->spacename);
 		}
 		else {
 			t->con.mode |= CON_AXIS0;
-			BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s X axis", t->spacename);
+			BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along %s X axis"), t->spacename);
 		}
 	}
 	else if (len[1] <= len[0] && len[1] <= len[2]) {
 		if (t->modifiers & MOD_CONSTRAINT_PLANE) {
 			t->con.mode |= (CON_AXIS0 | CON_AXIS2);
-			BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s Y axis", t->spacename);
+			BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" locking %s Y axis"), t->spacename);
 		}
 		else {
 			t->con.mode |= CON_AXIS1;
-			BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s Y axis", t->spacename);
+			BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along %s Y axis"), t->spacename);
 		}
 	}
 	else if (len[2] <= len[1] && len[2] <= len[0]) {
 		if (t->modifiers & MOD_CONSTRAINT_PLANE) {
 			t->con.mode |= (CON_AXIS0 | CON_AXIS1);
-			BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s Z axis", t->spacename);
+			BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" locking %s Z axis"), t->spacename);
 		}
 		else {
 			t->con.mode |= CON_AXIS2;
-			BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s Z axis", t->spacename);
+			BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along %s Z axis"), t->spacename);
 		}
 	}
 }
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index d38bdb1..32ceaf9 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -85,6 +85,7 @@
 #include "BKE_particle.h"
 #include "BKE_pointcache.h"
 #include "BKE_report.h"
+#include "BKE_rigidbody.h"
 #include "BKE_scene.h"
 #include "BKE_sequencer.h"
 #include "BKE_tessmesh.h"
@@ -122,6 +123,7 @@
 
 #include "BLO_sys_types.h" // for intptr_t support
 
+
 /* local function prototype - for Object/Bone Constraints */
 static short constraints_list_needinv(TransInfo *t, ListBase *list);
 
@@ -2641,6 +2643,14 @@ static void createTransNlaData(bContext *C, TransInfo *t)
 	
 	/* stop if trying to build list if nothing selected */
 	if (count == 0) {
+		/* clear temp metas that may have been created but aren't needed now 
+		 * because they fell on the wrong side of CFRA
+		 */
+		for (ale = anim_data.first; ale; ale = ale->next) {
+			NlaTrack *nlt = (NlaTrack *)ale->data;
+			BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
+		}
+		
 		/* cleanup temp list */
 		BLI_freelistN(&anim_data);
 		return;
@@ -2685,14 +2695,14 @@ static void createTransNlaData(bContext *C, TransInfo *t)
 						tdn->oldTrack = tdn->nlt = nlt;
 						tdn->strip = strip;
 						tdn->trackIndex = BLI_findindex(&adt->nla_tracks, nlt);
-
+						
 						yval = (float)(tdn->trackIndex * NLACHANNEL_STEP(snla));
-
+						
 						tdn->h1[0] = strip->start;
 						tdn->h1[1] = yval;
 						tdn->h2[0] = strip->end;
 						tdn->h2[1] = yval;
-
+						
 						center[0] = (float)CFRA;
 						center[1] = yval;
 						center[2] = 0.0f;
@@ -3521,7 +3531,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
 	int count = 0, i;
 	float cfra;
 	float mtx[3][3], smtx[3][3];
-	const short use_handle = !(sipo->flag & SIPO_NOHANDLES);
+	const bool use_handle = !(sipo->flag & SIPO_NOHANDLES);
+	const bool use_local_center = checkUseLocalCenter_GraphEdit(t);
+	const short anim_map_flag = ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS;
 	
 	/* determine what type of data we are operating on */
 	if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -3653,7 +3665,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
 		if (fcu->bezt == NULL)
 			continue;
 		
-		ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS);
+		ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, anim_map_flag);
 		
 		/* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */
 		for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
@@ -3688,7 +3700,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
 				}
 				
 				/* only include main vert if selected */
-				if (sel2 && (sipo->around != V3D_LOCAL || ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE))) {
+				if (sel2 && (use_local_center == false)) {
 
 					/* move handles relative to center */
 					if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) {
@@ -3724,6 +3736,13 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
 		
 		/* Sets handles based on the selection */
 		testhandles_fcurve(fcu, use_handle);
+
+		/* even though transform values are written back right after during transform,
+		 * using individual center's with rotation means the center point wont
+		 * be touched again see: [#34303] */
+		if (use_local_center) {
+			ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, anim_map_flag | ANIM_UNITCONV_RESTORE);
+		}
 	}
 	
 	/* cleanup temp list */
@@ -4541,6 +4560,27 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
 	short constinv;
 	short skip_invert = 0;
 
+	if (ob->rigidbody_object) {
+		float rot[3][3], scale[3];
+
+		/* save original object transform */
+		copy_v3_v3(td->ext->oloc, ob->loc);
+
+		if (ob->rotmode > 0) {
+			copy_v3_v3(td->ext->orot, ob->rot);
+		}
+		else if (ob->rotmode == ROT_MODE_AXISANGLE) {
+			td->ext->orotAngle = ob->rotAngle;
+			copy_v3_v3(td->ext->orotAxis, ob->rotAxis);
+		}
+		else {
+			copy_qt_qt(td->ext->oquat, ob->quat);
+		}
+		/* update object's loc/rot to get current rigid body transform */
+		mat4_to_loc_rot_size(ob->loc, rot, scale, ob->obmat);
+		BKE_object_mat3_to_rot(ob, rot, FALSE);
+	}
+
 	/* axismtx has the real orientation */
 	copy_m3_m4(td->axismtx, ob->obmat);
 	normalize_m3(td->axismtx);
@@ -5094,25 +5134,25 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
 			if (canceled == 0) {
 				/* we need to delete the temporary faces before automerging */
 				if (t->mode == TFM_EDGE_SLIDE) {
-					SlideData *sld = t->customData;
+					EdgeSlideData *sld = t->customData;
 
 					/* handle multires re-projection, done
 					 * on transform completion since it's
 					 * really slow -joeedh */
-					projectSVData(t, TRUE);
+					projectEdgeSlideData(t, TRUE);
 
 					/* free temporary faces to avoid automerging and deleting
 					 * during cleanup - psy-fi */
-					freeSlideTempFaces(sld);
+					freeEdgeSlideTempFaces(sld);
 				}
 				EDBM_automerge(t->scene, t->obedit, TRUE);
 			}
 			else {
 				if (t->mode == TFM_EDGE_SLIDE) {
-					SlideData *sld = t->customData;
+					EdgeSlideData *sld = t->customData;
 
 					sld->perc = 0.0;
-					projectSVData(t, FALSE);
+					projectEdgeSlideData(t, FALSE);
 				}
 			}
 		}
@@ -5494,6 +5534,9 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
 				if (ob->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)
 					recalcObPaths = 1;
 			}
+			/* restore rigid body transform */
+			if (ob->rigidbody_object && canceled)
+				BKE_rigidbody_aftertrans_update(ob, td->ext->oloc, td->ext->orot, td->ext->oquat, td->ext->orotAxis, td->ext->orotAngle);
 		}
 		
 		/* recalculate motion paths for objects (if necessary) 
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 2591c61..c2a331f 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -56,6 +56,8 @@
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "RNA_access.h"
 
 #include "BIF_gl.h"
@@ -130,6 +132,7 @@ void getViewVector(TransInfo *t, float coord[3], float vec[3])
 
 /* ************************** GENERICS **************************** */
 
+
 static void clipMirrorModifier(TransInfo *t, Object *ob)
 {
 	ModifierData *md = ob->modifiers.first;
@@ -377,6 +380,8 @@ static void recalcData_graphedit(TransInfo *t)
 	
 	bAnimListElem *ale;
 	int dosort = 0;
+
+	const bool use_local_center = checkUseLocalCenter_GraphEdit(t);
 	
 	
 	/* initialize relevant anim-context 'context' data from TransInfo data */
@@ -405,9 +410,10 @@ static void recalcData_graphedit(TransInfo *t)
 		/* ignore unselected fcurves */
 		if (!fcu_test_selected(fcu))
 			continue;
-		
-		// fixme: only do this for selected verts...
-		ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS | ANIM_UNITCONV_RESTORE);
+
+		ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data,
+		                               ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS | ANIM_UNITCONV_RESTORE |
+		                               (use_local_center ? ANIM_UNITCONV_SKIPKNOTS : 0));
 		
 		
 		/* watch it: if the time is wrong: do not correct handles yet */
@@ -550,13 +556,20 @@ static void recalcData_nla(TransInfo *t)
 				break;
 		}
 		
-		/* use RNA to write the values... */
-		// TODO: do we need to write in 2 passes to make sure that no truncation goes on?
+		/* Use RNA to write the values to ensure that constraints on these are obeyed
+		 * (e.g. for transition strips, the values are taken from the neighbours)
+		 * 
+		 * NOTE: we write these twice to avoid truncation errors which can arise when
+		 * moving the strips a large distance using numeric input [#33852] 
+		 */
 		RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr);
 		
 		RNA_float_set(&strip_ptr, "frame_start", tdn->h1[0]);
 		RNA_float_set(&strip_ptr, "frame_end", tdn->h2[0]);
 		
+		RNA_float_set(&strip_ptr, "frame_start", tdn->h1[0]);
+		RNA_float_set(&strip_ptr, "frame_end", tdn->h2[0]);
+		
 		/* flush transforms to child strips (since this should be a meta) */
 		BKE_nlameta_flush_transforms(strip);
 		
@@ -798,6 +811,7 @@ static void recalcData_view3d(TransInfo *t)
 					if (td->extra) {
 						float vec[3], up_axis[3];
 						float qrot[4];
+						float roll;
 						
 						ebo = td->extra;
 						copy_v3_v3(up_axis, td->axismtx[2]);
@@ -812,7 +826,9 @@ static void recalcData_view3d(TransInfo *t)
 							mul_m3_v3(t->mat, up_axis);
 						}
 						
-						ebo->roll = ED_rollBoneToVector(ebo, up_axis, FALSE);
+						/* roll has a tendency to flip in certain orientations - [#34283], [#33974] */
+						roll = ED_rollBoneToVector(ebo, up_axis, false);
+						ebo->roll = angle_compat_rad(roll, ebo->roll);
 					}
 				}
 			}
@@ -1754,25 +1770,25 @@ void calculatePropRatio(TransInfo *t)
 		}
 		switch (t->prop_mode) {
 			case PROP_SHARP:
-				strcpy(t->proptext, "(Sharp)");
+				strcpy(t->proptext, IFACE_("(Sharp)"));
 				break;
 			case PROP_SMOOTH:
-				strcpy(t->proptext, "(Smooth)");
+				strcpy(t->proptext, IFACE_("(Smooth)"));
 				break;
 			case PROP_ROOT:
-				strcpy(t->proptext, "(Root)");
+				strcpy(t->proptext, IFACE_("(Root)"));
 				break;
 			case PROP_LIN:
-				strcpy(t->proptext, "(Linear)");
+				strcpy(t->proptext, IFACE_("(Linear)"));
 				break;
 			case PROP_CONST:
-				strcpy(t->proptext, "(Constant)");
+				strcpy(t->proptext, IFACE_("(Constant)"));
 				break;
 			case PROP_SPHERE:
-				strcpy(t->proptext, "(Sphere)");
+				strcpy(t->proptext, IFACE_("(Sphere)"));
 				break;
 			case PROP_RANDOM:
-				strcpy(t->proptext, "(Random)");
+				strcpy(t->proptext, IFACE_("(Random)"));
 				break;
 			default:
 				t->proptext[0] = '\0';
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index 6956925..4e9a546 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -164,7 +164,7 @@ static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2
 	output[0] = dot_v3v3(t->viewinv[1], vec) * 2.0f;
 }
 
-void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, int start[2], int end[2])
+void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, const int start[2], const int end[2])
 {
 	int *data;
 
@@ -180,7 +180,7 @@ void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, int start[2], int end
 	data[3] = end[1];
 }
 
-static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3])
+static void InputCustomRatioFlip(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3])
 {
 	double length;
 	double distance;
@@ -213,6 +213,12 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mva
 	}
 }
 
+static void InputCustomRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
+{
+	InputCustomRatioFlip(t, mi, mval, output);
+	output[0] = -output[0];
+}
+
 static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3])
 {
 	double dx2 = mval[0] - mi->center[0];
@@ -232,7 +238,7 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
 	double deler = (((dx1 * dx1 + dy1 * dy1) +
 	                 (dx2 * dx2 + dy2 * dy2) -
 	                 (dx3 * dx3 + dy3 * dy3)) / (2.0 * ((A * B) ? (A * B) : 1.0)));
-	/* ((A*B)?(A*B):1.0) this takes care of potential divide by zero errors */
+	/* ((A * B) ? (A * B) : 1.0) this takes care of potential divide by zero errors */
 
 	float dphi;
 
@@ -275,7 +281,7 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
 	output[0] = *angle;
 }
 
-void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, int center[2], int mval[2])
+void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, const int center[2], const int mval[2])
 {
 	mi->factor = 0;
 	mi->precision = 0;
@@ -301,15 +307,8 @@ static void calcSpringFactor(MouseInput *mi)
 
 void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
 {
-	/* may have been allocated previously */
-	/* TODO, holding R-key can cause mem leak, but this causes [#28903]
-	 * disable for now. */
-#if 0
-	if (mi->data) {
-		MEM_freeN(mi->data);
-		mi->data = NULL;
-	}
-#endif
+	/* incase we allocate a new value */
+	void *mi_data_prev = mi->data;
 
 	switch (mode) {
 		case INPUT_VECTOR:
@@ -358,17 +357,27 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
 			mi->apply = InputCustomRatio;
 			t->helpline = HLP_NONE;
 			break;
+		case INPUT_CUSTOM_RATIO_FLIP:
+			mi->apply = InputCustomRatioFlip;
+			t->helpline = HLP_NONE;
+			break;
 		case INPUT_NONE:
 		default:
 			mi->apply = NULL;
 			break;
 	}
 
+	/* if we've allocated new data, free the old data
+	 * less hassle then checking before every alloc above */
+	if (mi_data_prev && (mi_data_prev != mi->data)) {
+		MEM_freeN(mi_data_prev);
+	}
+
 	/* bootstrap mouse input with initial values */
 	applyMouseInput(t, mi, mi->imval, t->values);
 }
 
-void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float[3]))
+void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float values[3]))
 {
 	mi->post = post;
 }
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 916cf54..32dc319 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -73,6 +73,7 @@ static char OP_TILT[] = "TRANSFORM_OT_tilt";
 static char OP_TRACKBALL[] = "TRANSFORM_OT_trackball";
 static char OP_MIRROR[] = "TRANSFORM_OT_mirror";
 static char OP_EDGE_SLIDE[] = "TRANSFORM_OT_edge_slide";
+static char OP_VERT_SLIDE[] = "TRANSFORM_OT_vert_slide";
 static char OP_EDGE_CREASE[] = "TRANSFORM_OT_edge_crease";
 static char OP_EDGE_BWEIGHT[] = "TRANSFORM_OT_edge_bevelweight";
 static char OP_SEQ_SLIDE[] = "TRANSFORM_OT_seq_slide";
@@ -90,6 +91,7 @@ static void TRANSFORM_OT_tilt(struct wmOperatorType *ot);
 static void TRANSFORM_OT_trackball(struct wmOperatorType *ot);
 static void TRANSFORM_OT_mirror(struct wmOperatorType *ot);
 static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot);
+static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot);
 static void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot);
 static void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot);
 static void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot);
@@ -109,6 +111,7 @@ static TransformModeItem transform_modes[] =
 	{OP_TRACKBALL, TFM_TRACKBALL, TRANSFORM_OT_trackball},
 	{OP_MIRROR, TFM_MIRROR, TRANSFORM_OT_mirror},
 	{OP_EDGE_SLIDE, TFM_EDGE_SLIDE, TRANSFORM_OT_edge_slide},
+	{OP_VERT_SLIDE, TFM_VERT_SLIDE, TRANSFORM_OT_vert_slide},
 	{OP_EDGE_CREASE, TFM_CREASE, TRANSFORM_OT_edge_crease},
 	{OP_EDGE_BWEIGHT, TFM_BWEIGHT, TRANSFORM_OT_edge_bevelweight},
 	{OP_SEQ_SLIDE, TFM_SEQ_SLIDE, TRANSFORM_OT_seq_slide},
@@ -150,38 +153,6 @@ EnumPropertyItem transform_mode_types[] =
 	{0, NULL, 0, NULL, NULL}
 };
 
-static int snap_type_exec(bContext *C, wmOperator *op)
-{
-	ToolSettings *ts = CTX_data_tool_settings(C);
-
-	ts->snap_mode = RNA_enum_get(op->ptr, "type");
-
-	WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
-
-	return OPERATOR_FINISHED;
-}
-
-static void TRANSFORM_OT_snap_type(wmOperatorType *ot)
-{
-	/* identifiers */
-	ot->name = "Snap Type";
-	ot->description = "Set the snap element type";
-	ot->idname = "TRANSFORM_OT_snap_type";
-
-	/* api callbacks */
-	ot->invoke = WM_menu_invoke;
-	ot->exec = snap_type_exec;
-
-	ot->poll = ED_operator_areaactive;
-
-	/* flags */
-	ot->flag = OPTYPE_UNDO;
-
-	/* props */
-	ot->prop = RNA_def_enum(ot->srna, "type", snap_element_items, 0, "Type", "Set the snap element type");
-
-}
-
 static int select_orientation_exec(bContext *C, wmOperator *op)
 {
 	int orientation = RNA_enum_get(op->ptr, "orientation");
@@ -793,6 +764,26 @@ static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
 	Transform_Properties(ot, P_MIRROR | P_SNAP | P_CORRECT_UV);
 }
 
+static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name   = "Vertex Slide";
+	ot->description = "Slide a vertex along a mesh";
+	ot->idname = OP_VERT_SLIDE;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
+
+	/* api callbacks */
+	ot->invoke = transform_invoke;
+	ot->exec   = transform_exec;
+	ot->modal  = transform_modal;
+	ot->cancel = transform_cancel;
+	ot->poll   = ED_operator_editmesh;
+
+	RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
+
+	Transform_Properties(ot, P_MIRROR | P_SNAP);
+}
+
 static void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
 {
 	/* identifiers */
@@ -891,8 +882,6 @@ void transform_operatortypes(void)
 	WM_operatortype_append(TRANSFORM_OT_select_orientation);
 	WM_operatortype_append(TRANSFORM_OT_create_orientation);
 	WM_operatortype_append(TRANSFORM_OT_delete_orientation);
-
-	WM_operatortype_append(TRANSFORM_OT_snap_type);
 }
 
 void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spaceid)
@@ -939,7 +928,9 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
 			kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
 			RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_snap");
 
-			WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
+			kmi = WM_keymap_add_item(keymap, "WM_OT_context_menu_enum", TABKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
+			RNA_string_set(kmi->ptr, "data_path", "tool_settings.snap_element");
+
 
 			kmi = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0);
 			RNA_boolean_set(kmi->ptr, "texture_space", TRUE);
@@ -1032,6 +1023,9 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
 
 			kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
 			RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_snap");
+
+			kmi = WM_keymap_add_item(keymap, "WM_OT_context_menu_enum", TABKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
+			RNA_string_set(kmi->ptr, "data_path", "tool_settings.snap_uv_element");
 			break;
 		case SPACE_CLIP:
 			WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 4bd6496..e507d06 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -493,25 +493,25 @@ void initTransformOrientation(bContext *C, TransInfo *t)
 	switch (t->current_orientation) {
 		case V3D_MANIP_GLOBAL:
 			unit_m3(t->spacemtx);
-			strcpy(t->spacename, "global");
+			strcpy(t->spacename, IFACE_("global"));
 			break;
 
 		case V3D_MANIP_GIMBAL:
 			unit_m3(t->spacemtx);
 			if (gimbal_axis(ob, t->spacemtx)) {
-				strcpy(t->spacename, "gimbal");
+				strcpy(t->spacename, IFACE_("gimbal"));
 				break;
 			}
 		/* no gimbal fallthrough to normal */
 		case V3D_MANIP_NORMAL:
 			if (obedit || (ob && ob->mode & OB_MODE_POSE)) {
-				strcpy(t->spacename, "normal");
+				strcpy(t->spacename, IFACE_("normal"));
 				ED_getTransformOrientationMatrix(C, t->spacemtx, (v3d->around == V3D_ACTIVE));
 				break;
 			}
 		/* no break we define 'normal' as 'local' in Object mode */
 		case V3D_MANIP_LOCAL:
-			strcpy(t->spacename, "local");
+			strcpy(t->spacename, IFACE_("local"));
 		
 			if (ob) {
 				copy_m3_m4(t->spacemtx, ob->obmat);
@@ -528,7 +528,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
 				RegionView3D *rv3d = t->ar->regiondata;
 				float mat[3][3];
 
-				strcpy(t->spacename, "view");
+				strcpy(t->spacename, IFACE_("view"));
 				copy_m3_m4(mat, rv3d->viewinv);
 				normalize_m3(mat);
 				copy_m3_m3(t->spacemtx, mat);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 5577619..2efd353 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -303,6 +303,9 @@ void applyProject(TransInfo *t)
 			
 			if (td->flag & TD_SKIP)
 				continue;
+
+			if ((t->flag & T_PROP_EDIT) && (td->factor == 0.0f))
+				continue;
 			
 			copy_v3_v3(iloc, td->loc);
 			if (t->flag & (T_EDIT | T_POSE)) {
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 1dc7e0c..8a0ef06 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -339,8 +339,9 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
 		wmWindowManager *wm = CTX_wm_manager(C);
 		struct Scene *scene = CTX_data_scene(C);
 
+		/* keep in sync with logic in view3d_panel_operator_redo() */
 		ARegion *ar = CTX_wm_region(C);
-		ARegion *ar1 = BKE_area_find_region_type(CTX_wm_area(C), RGN_TYPE_WINDOW);
+		ARegion *ar1 = BKE_area_find_region_active_win(CTX_wm_area(C));
 
 		if (ar1)
 			CTX_wm_region_set(C, ar1);
diff --git a/source/blender/editors/uvedit/CMakeLists.txt b/source/blender/editors/uvedit/CMakeLists.txt
index 1c69e56..695a7cd 100644
--- a/source/blender/editors/uvedit/CMakeLists.txt
+++ b/source/blender/editors/uvedit/CMakeLists.txt
@@ -22,6 +22,7 @@ set(INC
 	../include
 	../../blenkernel
 	../../blenlib
+	../../blenfont
 	../../blenloader
 	../../bmesh
 	../../makesdna
@@ -47,4 +48,8 @@ set(SRC
 	uvedit_parametrizer.h
 )
 
+if(WITH_INTERNATIONAL)
+	add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
 blender_add_lib(bf_editor_uvedit "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/uvedit/SConscript b/source/blender/editors/uvedit/SConscript
index 0131668..dfa15d2 100644
--- a/source/blender/editors/uvedit/SConscript
+++ b/source/blender/editors/uvedit/SConscript
@@ -27,10 +27,15 @@
 
 Import ('env')
 
+defs = []
+
 sources = env.Glob('*.c')
 
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs = '../include ../../blenlib ../../blenfont ../../blenkernel ../../makesdna ../../imbuf'
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../bmesh ../../makesrna #/intern/opennl/extern ../../gpu ../../blenloader'
 
-env.BlenderLib ( 'bf_editors_uvedit', sources, Split(incs), [], libtype=['core'], priority=[45] )
+if env['WITH_BF_INTERNATIONAL']:
+    defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_uvedit', sources, Split(incs), defs, libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c
index 1c32c01..5c18862 100644
--- a/source/blender/editors/uvedit/uvedit_buttons.c
+++ b/source/blender/editors/uvedit/uvedit_buttons.c
@@ -43,6 +43,8 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_customdata.h"
 #include "BKE_mesh.h"
@@ -152,8 +154,10 @@ static void uvedit_vertex_buttons(const bContext *C, uiBlock *block)
 		}
 		
 		uiBlockBeginAlign(block);
-		uiDefButF(block, NUM, B_UVEDIT_VERTEX, "X:",    10, 10, 145, 19, &uvedit_old_center[0], -10 * imx, 10.0 * imx, step, digits, "");
-		uiDefButF(block, NUM, B_UVEDIT_VERTEX, "Y:",    165, 10, 145, 19, &uvedit_old_center[1], -10 * imy, 10.0 * imy, step, digits, "");
+		uiDefButF(block, NUM, B_UVEDIT_VERTEX, IFACE_("X:"), 10, 10, 145, 19, &uvedit_old_center[0],
+		          -10 * imx, 10.0 * imx, step, digits, "");
+		uiDefButF(block, NUM, B_UVEDIT_VERTEX, IFACE_("Y:"), 165, 10, 145, 19, &uvedit_old_center[1],
+		          -10 * imy, 10.0 * imy, step, digits, "");
 		uiBlockEndAlign(block);
 	}
 }
@@ -214,7 +218,7 @@ void ED_uvedit_buttons_register(ARegionType *art)
 
 	pt = MEM_callocN(sizeof(PanelType), "spacetype image panel uv");
 	strcpy(pt->idname, "IMAGE_PT_uv");
-	strcpy(pt->label, "UV Vertex");
+	strcpy(pt->label, N_("UV Vertex"));  /* XXX C panels are not available through RNA (bpy.types)! */
 	pt->draw = image_panel_uv;
 	pt->poll = image_panel_uv_poll;
 	BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index 023f281..ea7e17a 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -134,14 +134,15 @@ static void draw_uvs_shadow(Object *obedit)
 	BMIter iter, liter;
 	MLoopUV *luv;
 
+	const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
+
 	/* draws the gray mesh when painting */
 	glColor3ub(112, 112, 112);
 
 	BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
 		glBegin(GL_LINE_LOOP);
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
-
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			glVertex2fv(luv->uv);
 		}
 		glEnd();
@@ -173,6 +174,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 	float aspx, aspy, col[4];
 	int i;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY);
+
 	ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
 	
 	switch (sima->dt_uvstretch) {
@@ -184,10 +188,10 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 				const int efa_len = efa->len;
 				float (*tf_uv)[2] = BLI_array_alloca(tf_uv, efa_len);
 				float (*tf_uvorig)[2] = BLI_array_alloca(tf_uvorig, efa_len);
-				tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY);
+				tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 				BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
-					luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					copy_v2_v2(tf_uvorig[i], luv->uv);
 				}
 
@@ -214,7 +218,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 					if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
 						glBegin(GL_POLYGON);
 						BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-							luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 							glVertex2fv(luv->uv);
 						}
 						glEnd();
@@ -231,7 +235,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 						area = BM_face_calc_area(efa) / totarea;
 
 						BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
-							luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 							copy_v2_v2(tf_uvorig[i], luv->uv);
 						}
 
@@ -251,7 +255,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 						
 						glBegin(GL_POLYGON);
 						BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-							luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 							glVertex2fv(luv->uv);
 						}
 						glEnd();
@@ -269,7 +273,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 			glShadeModel(GL_SMOOTH);
 			
 			BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
-				tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY);
+				tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 				
 				if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 					const int efa_len = efa->len;
@@ -284,7 +288,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 					BM_elem_flag_enable(efa, BM_ELEM_TAG);
 
 					BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
-						luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						copy_v2_v2(tf_uvorig[i], luv->uv);
 					}
 
@@ -310,7 +314,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 
 					glBegin(GL_POLYGON);
 					BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
-						luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						a = fabsf(uvang[i] - ang[i]) / (float)M_PI;
 						weight_to_rgb(col, 1.0f - powf((1.0f - a), 2.0f));
 						glColor3fv(col);
@@ -418,6 +422,9 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 	int drawfaces, interpedges;
 	Image *ima = sima->image;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY);
+
 	activetf = EDBM_mtexpoly_active_get(em, &efa_act, FALSE, FALSE); /* will be set to NULL if hidden */
 	activef = BM_active_face_get(bm, FALSE, FALSE);
 	ts = scene->toolsettings;
@@ -467,7 +474,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 		glEnable(GL_BLEND);
 		
 		BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			
 			if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 				BM_elem_flag_enable(efa, BM_ELEM_TAG);
@@ -480,7 +487,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 				
 				glBegin(GL_POLYGON);
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					glVertex2fv(luv->uv);
 				}
 				glEnd();
@@ -497,7 +504,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 		/* would be nice to do this within a draw loop but most below are optional, so it would involve too many checks */
 		
 		BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 			if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 				BM_elem_flag_enable(efa, BM_ELEM_TAG);
@@ -514,7 +521,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 	/* 3. draw active face stippled */
 
 	if (activef) {
-		tf = CustomData_bmesh_get(&bm->pdata, activef->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(activef, cd_poly_tex_offset);
 		if (uvedit_face_visible_test(scene, ima, activef, tf)) {
 			glEnable(GL_BLEND);
 			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -525,7 +532,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
 			glBegin(GL_POLYGON);
 			BM_ITER_ELEM (l, &liter, activef, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				glVertex2fv(luv->uv);
 			}
 			glEnd();
@@ -548,14 +555,14 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 			BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
 				if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
 					continue;
-				tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY);
+				tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 				if (tf) {
 					cpack(0x111111);
 
 					glBegin(GL_LINE_LOOP);
 					BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-						luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						glVertex2fv(luv->uv);
 					}
 					glEnd();
@@ -565,20 +572,11 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
 					glBegin(GL_LINE_LOOP);
 					BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-						luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						glVertex2fv(luv->uv);
 					}
 					glEnd();
 
-#if 0
-					glBegin(GL_LINE_STRIP);
-					luv = CustomData_bmesh_get(&bm->ldata, efa->lbase->head.data, CD_MLOOPUV);
-					glVertex2fv(luv->uv);
-					luv = CustomData_bmesh_get(&bm->ldata, efa->lbase->next->head.data, CD_MLOOPUV);
-					glVertex2fv(luv->uv);
-					glEnd();
-#endif
-
 					setlinestyle(0);
 				}
 			}
@@ -594,7 +592,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
 				glBegin(GL_LINE_LOOP);
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					glVertex2fv(luv->uv);
 				}
 				glEnd();
@@ -610,7 +608,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
 				glBegin(GL_LINE_LOOP);
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					glVertex2fv(luv->uv);
 				}
 				glEnd();
@@ -636,7 +634,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 							sel = (uvedit_uv_select_test(em, scene, l) ? 1 : 0);
 							glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2);
 
-							luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 							glVertex2fv(luv->uv);
 						}
 						glEnd();
@@ -656,9 +654,9 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 								glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2);
 								lastsel = sel;
 							}
-							luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 							glVertex2fv(luv->uv);
-							luv = CustomData_bmesh_get(&bm->ldata, l->next->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(l->next, cd_loop_uv_offset);
 							glVertex2fv(luv->uv);
 						}
 						glEnd();
@@ -673,7 +671,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 				
 					glBegin(GL_LINE_LOOP);
 					BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-						luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						glVertex2fv(luv->uv);
 					}
 					glEnd();
@@ -741,7 +739,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				if (!uvedit_uv_select_test(em, scene, l))
 					bglVertex2fv(luv->uv);
 			}
@@ -759,7 +757,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 				if (luv->flag & MLOOPUV_PINNED)
 					bglVertex2fv(luv->uv);
@@ -777,7 +775,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 				if (uvedit_uv_select_test(em, scene, l))
 					bglVertex2fv(luv->uv);
diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h
index b6d8245..d1893d6 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -59,7 +59,7 @@ typedef struct NearestHit {
 	struct BMFace *efa;
 	struct MTexPoly *tf;
 	struct BMLoop *l, *nextl;
-	struct MLoopUV *luv, *nextluv;
+	struct MLoopUV *luv, *luv_next;
 	int lindex; //index of loop within face
 	int vert1, vert2; //index in mesh of edge vertices
 } NearestHit;
@@ -79,7 +79,7 @@ void uvedit_get_aspect(struct Scene *scene, struct Object *ob, struct BMEditMesh
 void UV_OT_average_islands_scale(struct wmOperatorType *ot);
 void UV_OT_cube_project(struct wmOperatorType *ot);
 void UV_OT_cylinder_project(struct wmOperatorType *ot);
-void UV_OT_from_view(struct wmOperatorType *ot);
+void UV_OT_project_from_view(struct wmOperatorType *ot);
 void UV_OT_minimize_stretch(struct wmOperatorType *ot);
 void UV_OT_pack_islands(struct wmOperatorType *ot);
 void UV_OT_reset(struct wmOperatorType *ot);
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 2194ce2..a17d3c2 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -199,6 +199,8 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
 	else {
 		BMFace *efa;
 
+		int cd_poly_tex_offset;
+
 		/* old shading system, assign image to selected faces */
 #ifdef USE_SWITCH_ASPECT
 		float prev_aspect[2], fprev_aspect;
@@ -220,9 +222,11 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
 			update = 1;
 		}
 
+		cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 		/* now assign to all visible faces */
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 			if (uvedit_face_visible_test(scene, previma, efa, tf) &&
 			    (selected == TRUE || uvedit_face_select_test(scene, em, efa)))
@@ -243,7 +247,7 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
 						BMLoop *l;
 
 						BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-							MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+							MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 							luv->uv[0] *= fprev_aspect;
 							luv->uv[0] /= faspect;
@@ -274,6 +278,7 @@ static int uvedit_set_tile(Object *obedit, Image *ima, int curtile)
 	BMFace *efa;
 	BMIter iter;
 	MTexPoly *tf;
+	int cd_poly_tex_offset;
 	
 	/* verify if we have something to do */
 	if (!ima || !ED_uvedit_test(obedit))
@@ -288,10 +293,12 @@ static int uvedit_set_tile(Object *obedit, Image *ima, int curtile)
 	
 	em = BMEdit_FromObject(obedit);
 
+	cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
-		if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BM_elem_flag_test(efa, BM_ELEM_SELECT))
+		if (BM_elem_flag_test(efa, BM_ELEM_SELECT))
 			tf->tile = curtile;  /* set tile index */
 	}
 
@@ -344,15 +351,18 @@ int uvedit_face_select_test(Scene *scene, BMEditMesh *em, BMFace *efa)
 {
 	ToolSettings *ts = scene->toolsettings;
 
-	if (ts->uv_flag & UV_SYNC_SELECTION)
+	if (ts->uv_flag & UV_SYNC_SELECTION) {
 		return (BM_elem_flag_test(efa, BM_ELEM_SELECT));
+	}
 	else {
 		BMLoop *l;
 		MLoopUV *luv;
 		BMIter liter;
 
+		const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);  /* TODO, pass this on */
+
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			if (!(luv->flag & MLOOPUV_VERTSEL))
 				return 0;
 		}
@@ -376,8 +386,10 @@ int uvedit_face_select_enable(Scene *scene, BMEditMesh *em, BMFace *efa, const s
 		MLoopUV *luv;
 		BMIter liter;
 
+		const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);  /* TODO, pass this on */
+
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			luv->flag |= MLOOPUV_VERTSEL;
 		}
 
@@ -399,8 +411,10 @@ int uvedit_face_select_disable(Scene *scene, BMEditMesh *em, BMFace *efa)
 		MLoopUV *luv;
 		BMIter liter;
 
+		const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);  /* TODO, pass this on */
+
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			luv->flag &= ~MLOOPUV_VERTSEL;
 		}
 
@@ -503,7 +517,9 @@ int uvedit_uv_select_test(BMEditMesh *em, Scene *scene, BMLoop *l)
 			return BM_elem_flag_test(l->v, BM_ELEM_SELECT);
 	}
 	else {
-		MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+		const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);  /* TODO, pass this on */
+
+		MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 		return luv->flag & MLOOPUV_VERTSEL;
 	}
@@ -524,7 +540,8 @@ void uvedit_uv_select_enable(BMEditMesh *em, Scene *scene, BMLoop *l, const shor
 		}
 	}
 	else {
-		MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+		const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);  /* TODO, pass this on */
+		MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 		
 		luv->flag |= MLOOPUV_VERTSEL;
 	}
@@ -541,7 +558,8 @@ void uvedit_uv_select_disable(BMEditMesh *em, Scene *scene, BMLoop *l)
 			BM_vert_select_set(em->bm, l->v, FALSE);
 	}
 	else {
-		MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+		const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);  /* TODO, pass this on */
+		MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 		
 		luv->flag &= ~MLOOPUV_VERTSEL;
 	}
@@ -565,10 +583,12 @@ void uv_poly_center(BMEditMesh *em, BMFace *f, float r_cent[2])
 	MLoopUV *luv;
 	BMIter liter;
 
+	const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);  /* TODO, pass this on */
+
 	zero_v2(r_cent);
 
 	BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
-		luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+		luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 		add_v2_v2(r_cent, luv->uv);
 	}
 
@@ -594,17 +614,20 @@ int ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float r_min[2], f
 	MLoopUV *luv;
 	int sel;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	INIT_MINMAX2(r_min, r_max);
 
 	sel = 0;
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 		
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 			if (uvedit_uv_select_test(em, scene, l)) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				minmax_v2v2_v2(r_min, r_max, luv->uv);
 				sel = 1;
 			}
@@ -624,14 +647,17 @@ static int ED_uvedit_median(Scene *scene, Image *ima, Object *obedit, float co[2
 	MLoopUV *luv;
 	unsigned int sel = 0;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	zero_v2(co);
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 		
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			if (uvedit_uv_select_test(em, scene, l)) {
 				add_v2_v2(co, luv->uv);
 				sel++;
@@ -672,26 +698,29 @@ void uv_find_nearest_edge(Scene *scene, Image *ima, BMEditMesh *em, const float
 	BMFace *efa;
 	BMLoop *l;
 	BMIter iter, liter;
-	MLoopUV *luv, *nextluv;
+	MLoopUV *luv, *luv_next;
 	float mindist_squared, dist_squared;
 	int i;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	mindist_squared = 1e10f;
 	memset(hit, 0, sizeof(*hit));
 
 	BM_mesh_elem_index_ensure(em->bm, BM_VERT);
 	
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 		
 		i = 0;
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-			nextluv = CustomData_bmesh_get(&em->bm->ldata, l->next->head.data, CD_MLOOPUV);
+			luv      = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
+			luv_next = BM_ELEM_CD_GET_VOID_P(l->next, cd_loop_uv_offset);
 
-			dist_squared = dist_squared_to_line_segment_v2(co, luv->uv, nextluv->uv);
+			dist_squared = dist_squared_to_line_segment_v2(co, luv->uv, luv_next->uv);
 
 			if (dist_squared < mindist_squared) {
 				hit->tf = tf;
@@ -700,7 +729,7 @@ void uv_find_nearest_edge(Scene *scene, Image *ima, BMEditMesh *em, const float
 				hit->l = l;
 				hit->nextl = l->next;
 				hit->luv = luv;
-				hit->nextluv = nextluv;
+				hit->luv_next = luv_next;
 				hit->lindex = i;
 				hit->vert1 = BM_elem_index_get(hit->l->v);
 				hit->vert2 = BM_elem_index_get(hit->l->next->v);
@@ -720,16 +749,18 @@ static void find_nearest_uv_face(Scene *scene, Image *ima, BMEditMesh *em, const
 	BMIter iter;
 	float mindist, dist, cent[2];
 
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	mindist = 1e10f;
 	memset(hit, 0, sizeof(*hit));
 
 	/*this will fill in hit.vert1 and hit.vert2*/
 	uv_find_nearest_edge(scene, ima, em, co, hit);
 	hit->l = hit->nextl = NULL;
-	hit->luv = hit->nextluv = NULL;
+	hit->luv = hit->luv_next = NULL;
 
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 
@@ -753,6 +784,7 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i
 	BMIter iter;
 	float m[2], v1[2], v2[2], c1, c2, *uv1 = NULL, /* *uv2, */ /* UNUSED */ *uv3 = NULL;
 	int id1, id2, i;
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 
 	id1 = (id + efa->len - 1) % efa->len;
 	id2 = (id + efa->len + 1) % efa->len;
@@ -761,7 +793,7 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i
 
 	i = 0;
 	BM_ITER_ELEM (l, &iter, efa, BM_LOOPS_OF_FACE) {
-		luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+		luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 		
 		if (i == id1) {
 			uv1 = luv->uv;
@@ -803,10 +835,13 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em,
 	float mindist, dist;
 	int i;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	/*this will fill in hit.vert1 and hit.vert2*/
 	uv_find_nearest_edge(scene, ima, em, co, hit);
 	hit->l = hit->nextl = NULL;
-	hit->luv = hit->nextluv = NULL;
+	hit->luv = hit->luv_next = NULL;
 
 	mindist = 1e10f;
 	memset(hit, 0, sizeof(*hit));
@@ -814,13 +849,13 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em,
 	BM_mesh_elem_index_ensure(em->bm, BM_VERT);
 
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 		
 		i = 0;
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 			if (penalty && uvedit_uv_select_test(em, scene, l))
 				dist = fabsf(co[0] - luv->uv[0]) + penalty[0] + fabsf(co[1] - luv->uv[1]) + penalty[1];
@@ -839,7 +874,7 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em,
 				hit->l = l;
 				hit->nextl = l->next;
 				hit->luv = luv;
-				hit->nextluv = CustomData_bmesh_get(&em->bm->ldata, l->next->head.data, CD_MLOOPUV);
+				hit->luv_next = BM_ELEM_CD_GET_VOID_P(l->next, cd_loop_uv_offset);
 				hit->tf = tf;
 				hit->efa = efa;
 				hit->lindex = i;
@@ -862,16 +897,19 @@ int ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, const float c
 	float mindist, dist;
 	int found = FALSE;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	mindist = 1e10f;
 	copy_v2_v2(r_uv, co);
 	
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 		
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			dist = fabsf(co[0] - luv->uv[0]) + fabsf(co[1] - luv->uv[1]);
 
 			if (dist <= mindist) {
@@ -985,6 +1023,8 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
 	UvMapVert *iterv1, *iterv2;
 	int a, looking, nverts, starttotf, select;
 
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	/* setup */
 	EDBM_index_arrays_ensure(em, BM_FACE);
 	vmap = EDBM_uv_vert_map_create(em, 0, limit);
@@ -1018,7 +1058,7 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
 		/* find correct valence edges which are not tagged yet, but connect to tagged one */
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 			if (!BM_elem_flag_test(efa, BM_ELEM_TAG) && uvedit_face_visible_test(scene, ima, efa, tf)) {
 				nverts = efa->len;
@@ -1097,6 +1137,9 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float
 	unsigned int a;
 	char *flag;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	EDBM_index_arrays_ensure(em, BM_FACE); /* we can use this too */
 	vmap = EDBM_uv_vert_map_create(em, 1, limit);
 
@@ -1108,11 +1151,11 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float
 
 	if (!hit) {
 		BM_ITER_MESH_INDEX (efa, &iter, em->bm, BM_FACES_OF_MESH, a) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 			if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 					if (luv->flag & MLOOPUV_VERTSEL) {
 						stack[stacksize] = a;
@@ -1186,7 +1229,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float
 		a = 0;
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				
 				if (flag[a])
 					luv->flag |= MLOOPUV_VERTSEL;
@@ -1205,7 +1248,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float
 			}
 			
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						
 				if (luv->flag & MLOOPUV_VERTSEL)
 					break;
@@ -1226,7 +1269,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float
 				}
 
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					
 					luv->flag &= ~MLOOPUV_VERTSEL;
 				}
@@ -1243,7 +1286,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float
 				}
 
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					
 					luv->flag |= MLOOPUV_VERTSEL;
 				}
@@ -1265,14 +1308,17 @@ static float *uv_sel_co_from_eve(Scene *scene, Image *ima, BMEditMesh *em, BMVer
 	BMIter liter;
 	BMLoop *l;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	BM_ITER_ELEM (l, &liter, eve, BM_LOOPS_OF_VERT) {
-		MTexPoly *tf = CustomData_bmesh_get(&em->bm->pdata, l->f->head.data, CD_MTEXPOLY);
+		MTexPoly *tf = BM_ELEM_CD_GET_VOID_P(l->f, cd_poly_tex_offset);
 
 		if (!uvedit_face_visible_test(scene, ima, l->f, tf))
 			continue;
 
 		if (uvedit_uv_select_test(em, scene, l)) {
-			MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			return luv->uv;
 		}
 	}
@@ -1284,17 +1330,18 @@ static float *uv_sel_co_from_eve(Scene *scene, Image *ima, BMEditMesh *em, BMVer
 
 static void weld_align_uv(bContext *C, int tool)
 {
+	Object *obedit = CTX_data_edit_object(C);
+	BMEditMesh *em = BMEdit_FromObject(obedit);
 	SpaceImage *sima;
 	Scene *scene;
-	Object *obedit;
 	Image *ima;
-	BMEditMesh *em;
 	MTexPoly *tf;
 	float cent[2], min[2], max[2];
-	
+
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	scene = CTX_data_scene(C);
-	obedit = CTX_data_edit_object(C);
-	em = BMEdit_FromObject(obedit);
 	ima = CTX_data_edit_image(C);
 	sima = CTX_wm_space_image(C);
 
@@ -1306,14 +1353,14 @@ static void weld_align_uv(bContext *C, int tool)
 		BMLoop *l;
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 			if (!uvedit_face_visible_test(scene, ima, efa, tf))
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 				if (uvedit_uv_select_test(em, scene, l)) {
-					MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					minmax_v2v2_v2(min, max, luv->uv);
 				}
 			}
@@ -1330,13 +1377,13 @@ static void weld_align_uv(bContext *C, int tool)
 		BMLoop *l;
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			if (!uvedit_face_visible_test(scene, ima, efa, tf))
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 				if (uvedit_uv_select_test(em, scene, l)) {
-					MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					luv->uv[0] = cent[0];
 				}
 
@@ -1350,13 +1397,13 @@ static void weld_align_uv(bContext *C, int tool)
 		BMLoop *l;
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			if (!uvedit_face_visible_test(scene, ima, efa, tf))
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 				if (uvedit_uv_select_test(em, scene, l)) {
-					MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					luv->uv[1] = cent[1];
 				}
 
@@ -1379,7 +1426,7 @@ static void weld_align_uv(bContext *C, int tool)
 		/* tag verts with a selected UV */
 		BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
 			BM_ITER_ELEM (l, &liter, eve, BM_LOOPS_OF_VERT) {
-				tf = CustomData_bmesh_get(&em->bm->pdata, l->f->head.data, CD_MTEXPOLY);
+				tf = BM_ELEM_CD_GET_VOID_P(l->f, cd_poly_tex_offset);
 
 				if (!uvedit_face_visible_test(scene, ima, l->f, tf))
 					continue;
@@ -1469,13 +1516,13 @@ static void weld_align_uv(bContext *C, int tool)
 				/* go over all verts except for endpoints */
 				for (i = 0; i < BLI_array_count(eve_line); i++) {
 					BM_ITER_ELEM (l, &liter, eve_line[i], BM_LOOPS_OF_VERT) {
-						tf = CustomData_bmesh_get(&em->bm->pdata, l->f->head.data, CD_MTEXPOLY);
+						tf = BM_ELEM_CD_GET_VOID_P(l->f, cd_poly_tex_offset);
 
 						if (!uvedit_face_visible_test(scene, ima, l->f, tf))
 							continue;
 
 						if (uvedit_uv_select_test(em, scene, l)) {
-							MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+							MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 							/* Projection of point (x, y) over line (x1, y1, x2, y2) along X axis:
 							 * new_y = (y2 - y1) / (x2 - x1) * (x - x1) + y1
 							 * Maybe this should be a BLI func? Or is it already existing?
@@ -1554,9 +1601,9 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
 
 	SpaceImage *sima;
 	Scene *scene;
-	Object *obedit;
+	Object *obedit = CTX_data_edit_object(C);
+	BMEditMesh *em = BMEdit_FromObject(obedit);
 	Image *ima;
-	BMEditMesh *em;
 	MTexPoly *tf;
 	int uv_a_index;
 	int uv_b_index;
@@ -1567,10 +1614,11 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
 	BMFace *efa;
 	BMLoop *l;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	sima = CTX_wm_space_image(C);
 	scene = CTX_data_scene(C);
-	obedit = CTX_data_edit_object(C);
-	em = BMEdit_FromObject(obedit);
 	ima = CTX_data_edit_image(C);
 
 	if (use_unselected == FALSE) {
@@ -1581,13 +1629,13 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
 
 		/* TODO, use qsort as with MESH_OT_remove_doubles, this isn't optimal */
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			if (!uvedit_face_visible_test(scene, ima, efa, tf))
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 				if (uvedit_uv_select_test(em, scene, l)) {
-					MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					UVvert vert;
 					vert.uv_loop = luv;
 					vert.weld = FALSE;
@@ -1644,12 +1692,12 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
 		BLI_array_declare(loop_arr_unselected);
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			if (!uvedit_face_visible_test(scene, ima, efa, tf))
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				if (uvedit_uv_select_test(em, scene, l)) {
 					BLI_array_append(loop_arr, luv);
 				}
@@ -1738,6 +1786,9 @@ static void select_all_perform(Scene *scene, Image *ima, BMEditMesh *em, int act
 	MTexPoly *tf;
 	MLoopUV *luv;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	if (ts->uv_flag & UV_SYNC_SELECTION) {
 
 		switch (action) {
@@ -1760,13 +1811,13 @@ static void select_all_perform(Scene *scene, Image *ima, BMEditMesh *em, int act
 		if (action == SEL_TOGGLE) {
 			action = SEL_SELECT;
 			BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-				tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+				tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 	
 				if (!uvedit_face_visible_test(scene, ima, efa, tf))
 					continue;
 
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 					if (luv->flag & MLOOPUV_VERTSEL) {
 						action = SEL_DESELECT;
@@ -1778,13 +1829,13 @@ static void select_all_perform(Scene *scene, Image *ima, BMEditMesh *em, int act
 	
 		
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 			if (!uvedit_face_visible_test(scene, ima, efa, tf))
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 				switch (action) {
 					case SEL_SELECT:
@@ -1879,6 +1930,9 @@ static int mouse_select(bContext *C, const float co[2], int extend, int loop)
 	BLI_array_declare(hituv);
 	float penalty[2];
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	/* notice 'limit' is the same no matter the zoom level, since this is like
 	 * remove doubles and could annoying if it joined points when zoomed out.
 	 * 'penalty' is in screen pixel space otherwise zooming in on a uv-vert and
@@ -1957,7 +2011,7 @@ static int mouse_select(bContext *C, const float co[2], int extend, int loop)
 		hitv[hit.lindex] = hit.vert1;
 		hitv[(hit.lindex + 1) % hit.efa->len] = hit.vert2;
 		hituv[hit.lindex] = hit.luv->uv;
-		hituv[(hit.lindex + 1) % hit.efa->len] = hit.nextluv->uv;
+		hituv[(hit.lindex + 1) % hit.efa->len] = hit.luv_next->uv;
 
 		hitlen = hit.efa->len;
 	}
@@ -1979,7 +2033,7 @@ static int mouse_select(bContext *C, const float co[2], int extend, int loop)
 		BLI_array_grow_items(hituv, hit.efa->len);
 		i = 0;
 		BM_ITER_ELEM (l, &liter, hit.efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			hituv[i] = luv->uv;
 			hitv[i] = BM_elem_index_get(l->v);
 			i++;
@@ -2065,12 +2119,12 @@ static int mouse_select(bContext *C, const float co[2], int extend, int loop)
 			/* deselect */
 			if (select == 0) {
 				BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-					tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+					tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 					if (!uvedit_face_visible_test(scene, ima, efa, tf))
 						continue;
 
 					BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-						luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						if (sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
 							uvedit_uv_select_disable(em, scene, l);
 					}
@@ -2080,12 +2134,12 @@ static int mouse_select(bContext *C, const float co[2], int extend, int loop)
 			/* select */
 			else {
 				BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-					tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+					tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 					if (!uvedit_face_visible_test(scene, ima, efa, tf))
 						continue;
 
 					BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-						luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						if (sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
 							uvedit_uv_select_enable(em, scene, l, FALSE);
 					}
@@ -2117,13 +2171,13 @@ static int mouse_select(bContext *C, const float co[2], int extend, int loop)
 		/* select sticky uvs */
 		if (sticky != SI_STICKY_DISABLE) {
 			BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-				tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+				tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 				if (!uvedit_face_visible_test(scene, ima, efa, tf))
 					continue;
 				
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 					if (sticky == SI_STICKY_DISABLE) continue;
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 					if (sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
 						uvedit_uv_select_enable(em, scene, l, FALSE);
@@ -2380,23 +2434,27 @@ static int select_split_exec(bContext *C, wmOperator *op)
 	MLoopUV *luv;
 	short change = FALSE;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY);
+
 	if (ts->uv_flag & UV_SYNC_SELECTION) {
 		BKE_report(op->reports, RPT_ERROR, "Cannot split selection when sync selection is enabled");
 		return OPERATOR_CANCELLED;
 	}
 
 
+
 	BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
 		int is_sel = FALSE;
 		int is_unsel = FALSE;
-		tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 
 		/* are we all selected? */
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 			if (luv->flag & MLOOPUV_VERTSEL) {
 				is_sel = TRUE;
@@ -2413,7 +2471,7 @@ static int select_split_exec(bContext *C, wmOperator *op)
 
 		if (is_sel && is_unsel) {
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				luv->flag &= ~MLOOPUV_VERTSEL;
 			}
 
@@ -2459,6 +2517,9 @@ static int unlink_selection_exec(bContext *C, wmOperator *op)
 	MTexPoly *tf;
 	MLoopUV *luv;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	if (ts->uv_flag & UV_SYNC_SELECTION) {
 		BKE_report(op->reports, RPT_ERROR, "Cannot unlink selection when sync selection is enabled");
 		return OPERATOR_CANCELLED;
@@ -2467,12 +2528,12 @@ static int unlink_selection_exec(bContext *C, wmOperator *op)
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 		int desel = 0;
 
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tf))
 			continue;
 
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			
 			if (!(luv->flag & MLOOPUV_VERTSEL)) {
 				desel = 1;
@@ -2482,7 +2543,7 @@ static int unlink_selection_exec(bContext *C, wmOperator *op)
 
 		if (desel) {
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				luv->flag &= ~MLOOPUV_VERTSEL;
 			}
 		}
@@ -2569,7 +2630,7 @@ static void uv_faces_do_sticky(SpaceImage *sima, Scene *scene, Object *obedit, s
 
 		/* now select tagged verts */
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			/* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
+			/* tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset); */ /* UNUSED */
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 				if (BM_elem_flag_test(l->v, BM_ELEM_TAG)) {
@@ -2604,7 +2665,7 @@ static void uv_faces_do_sticky(SpaceImage *sima, Scene *scene, Object *obedit, s
 		efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
 		for (efa_index = 0; efa; efa = BM_iter_step(&iter), efa_index++) {
 			if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
-				/* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
+				/* tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset); */ /* UNUSED */
 				
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 					if (select)
@@ -2633,7 +2694,7 @@ static void uv_faces_do_sticky(SpaceImage *sima, Scene *scene, Object *obedit, s
 						if (efa_index != vlist_iter->f) {
 							BMLoop *l_other;
 							efa_vlist = EDBM_face_at_index(em, vlist_iter->f);
-							/* tf_vlist = CustomData_bmesh_get(&em->bm->pdata, efa_vlist->head.data, CD_MTEXPOLY); */ /* UNUSED */
+							/* tf_vlist = BM_ELEM_CD_GET_VOID_P(efa_vlist, cd_poly_tex_offset); */ /* UNUSED */
 							
 							l_other = BM_iter_at_index(em->bm, BM_LOOPS_OF_FACE, efa_vlist, vlist_iter->tfindex);
 
@@ -2685,6 +2746,9 @@ static int border_select_exec(bContext *C, wmOperator *op)
 	                            (ts->selectmode == SCE_SELECT_FACE) :
 	                            (ts->uv_selectmode == UV_SELECT_FACE);
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	/* get rectangle from operator */
 	WM_operator_properties_border_to_rcti(op, &rect);
 		
@@ -2710,7 +2774,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
 			/* assume not touched */
 			BM_elem_flag_disable(efa, BM_ELEM_TAG);
 
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 				uv_poly_center(em, efa, cent);
 				if (BLI_rctf_isect_pt_v(&rectf, cent)) {
@@ -2730,11 +2794,11 @@ static int border_select_exec(bContext *C, wmOperator *op)
 		change = 1;
 		
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			if (!uvedit_face_visible_test(scene, ima, efa, tf))
 				continue;
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 				if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) {
 
@@ -2834,6 +2898,8 @@ static int circle_select_exec(bContext *C, wmOperator *op)
 	                            (ts->selectmode == SCE_SELECT_FACE) :
 	                            (ts->uv_selectmode == UV_SELECT_FACE);
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	/* get operator properties */
 	select = (gesture_mode == GESTURE_MODAL_SELECT);
 	x = RNA_int_get(op->ptr, "x");
@@ -2874,7 +2940,7 @@ static int circle_select_exec(bContext *C, wmOperator *op)
 	else {
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				change |= select_uv_inside_ellipse(em, scene, select, offset, ellipse, l, luv);
 			}
 		}
@@ -2929,6 +2995,9 @@ static int do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mov
 	                            (ts->selectmode == SCE_SELECT_FACE) :
 	                            (ts->uv_selectmode == UV_SELECT_FACE);
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	BMIter iter, liter;
 
 	BMFace *efa;
@@ -2964,11 +3033,11 @@ static int do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mov
 	}
 	else { /* Vert Sel */
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+			tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 			if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 					if ((select) != (uvedit_uv_select_test(em, scene, l))) {
-						MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+						MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						UI_view2d_view_to_region(&ar->v2d, luv->uv[0], luv->uv[1], &screen_uv[0], &screen_uv[1]);
 						if (BLI_rcti_isect_pt_v(&rect, screen_uv) &&
 						    BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED))
@@ -3119,14 +3188,17 @@ static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceIma
 	MLoopUV *luv;
 	short change = 0;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tface = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tface))
 			continue;
 
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 			if (uvedit_uv_select_test(em, scene, l)) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				copy_v2_v2(luv->uv, sima->cursor);
 				change = 1;
 			}
@@ -3146,11 +3218,13 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
 	MTexPoly *tface;
 	MLoopUV *luv;
 	short change = FALSE;
+	const int cd_loop_uv_offset  = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY);
 	
 	/* index every vert that has a selected UV using it, but only once so as to
 	 * get unique indices and to count how much to malloc */
 	BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
-		tface = CustomData_bmesh_get(&bm->pdata, f->head.data, CD_MTEXPOLY);
+		tface = BM_ELEM_CD_GET_VOID_P(f, cd_poly_tex_offset);
 		if (uvedit_face_visible_test(scene, ima, f, tface)) {
 			BM_elem_flag_enable(f, BM_ELEM_TAG);
 			BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
@@ -3173,15 +3247,14 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
 						if (BM_elem_flag_test(lsub->f, BM_ELEM_TAG) && /* face: visible */
 						    !BM_elem_flag_test(lsub, BM_ELEM_TAG))     /* loop: unselected  */
 						{
-
-							luv = CustomData_bmesh_get(&bm->ldata, lsub->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(lsub, cd_loop_uv_offset);
 							add_v2_v2(uv, luv->uv);
 							uv_tot++;
 						}
 					}
 
 					if (uv_tot) {
-						luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						mul_v2_v2fl(luv->uv, uv, 1.0f / (float)uv_tot);
 						change = TRUE;
 					}
@@ -3206,18 +3279,21 @@ static int snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit)
 	float w, h;
 	short change = 0;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	ED_space_image_get_size(sima, &width, &height);
 	w = (float)width;
 	h = (float)height;
 	
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tface = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tface))
 			continue;
 
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 			if (uvedit_uv_select_test(em, scene, l)) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				snap_uv_to_pixel(luv->uv, w, h);
 			}
 		}
@@ -3295,13 +3371,16 @@ static int pin_exec(bContext *C, wmOperator *op)
 	MLoopUV *luv;
 	int clear = RNA_boolean_get(op->ptr, "clear");
 	
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tface = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tface))
 			continue;
 
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			
 			if (!clear) {
 				if (uvedit_uv_select_test(em, scene, l))
@@ -3349,13 +3428,16 @@ static int select_pinned_exec(bContext *C, wmOperator *UNUSED(op))
 	MTexPoly *tface;
 	MLoopUV *luv;
 	
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-		tface = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 		if (!uvedit_face_visible_test(scene, ima, efa, tface))
 			continue;
 
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			
 			if (luv->flag & MLOOPUV_PINNED)
 				uvedit_uv_select_enable(em, scene, l, FALSE);
@@ -3387,15 +3469,17 @@ static void UV_OT_select_pinned(wmOperatorType *ot)
 #define UV_SEL_TEST(luv, bool_test) ((((luv)->flag & MLOOPUV_VERTSEL) == MLOOPUV_VERTSEL) == bool_test)
 
 /* is every UV vert selected or unselected depending on bool_test */
-static int bm_face_is_all_uv_sel(BMesh *bm, BMFace *f, int bool_test)
+static int bm_face_is_all_uv_sel(BMFace *f, bool select_test,
+                                 const int cd_loop_uv_offset)
 {
 	BMLoop *l_iter;
 	BMLoop *l_first;
 
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	do {
-		MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, l_iter->head.data, CD_MLOOPUV);
-		if (!UV_SEL_TEST(luv, bool_test)) {
+
+		MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l_iter, cd_loop_uv_offset);
+		if (!UV_SEL_TEST(luv, select_test)) {
 			return FALSE;
 		}
 	} while ((l_iter = l_iter->next) != l_first);
@@ -3419,6 +3503,9 @@ static int hide_exec(bContext *C, wmOperator *op)
 	Image *ima = sima ? sima->image : NULL;
 	const int use_face_center = (ts->uv_selectmode == UV_SELECT_FACE);
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+	const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
+
 	if (ts->uv_flag & UV_SYNC_SELECTION) {
 		EDBM_mesh_hide(em, swap);
 		WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
@@ -3429,14 +3516,14 @@ static int hide_exec(bContext *C, wmOperator *op)
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 		int hide = 0;
 
-		tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+		tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 
 		if (!uvedit_face_visible_test(scene, ima, efa, tf)) {
 			continue;
 		}
 
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 			if (UV_SEL_TEST(luv, !swap)) {
 				hide = 1;
@@ -3450,15 +3537,15 @@ static int hide_exec(bContext *C, wmOperator *op)
 			if (use_face_center) {
 				if (em->selectmode == SCE_SELECT_FACE) {
 					/* check that every UV is selected */
-					if (bm_face_is_all_uv_sel(em->bm, efa, TRUE) == !swap) {
+					if (bm_face_is_all_uv_sel(efa, true, cd_loop_uv_offset) == !swap) {
 						BM_face_select_set(em->bm, efa, FALSE);
 					}
 					uvedit_face_select_disable(scene, em, efa);
 				}
 				else {
-					if (bm_face_is_all_uv_sel(em->bm, efa, TRUE) == !swap) {
+					if (bm_face_is_all_uv_sel(efa, true, cd_loop_uv_offset) == !swap) {
 						BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-							luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+							luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 							if (UV_SEL_TEST(luv, !swap)) {
 								BM_vert_select_set(em->bm, l->v, FALSE);
 							}
@@ -3469,14 +3556,14 @@ static int hide_exec(bContext *C, wmOperator *op)
 			}
 			else if (em->selectmode == SCE_SELECT_FACE) {
 				/* check if a UV is de-selected */
-				if (bm_face_is_all_uv_sel(em->bm, efa, FALSE) != !swap) {
+				if (bm_face_is_all_uv_sel(efa, false, cd_loop_uv_offset) != !swap) {
 					BM_face_select_set(em->bm, efa, FALSE);
 					uvedit_face_select_disable(scene, em, efa);
 				}
 			}
 			else {
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					if (UV_SEL_TEST(luv, !swap)) {
 						BM_vert_select_set(em->bm, l->v, FALSE);
 						if (!swap) luv->flag &= ~MLOOPUV_VERTSEL;
@@ -3530,6 +3617,8 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
 	const int use_face_center = (ts->uv_selectmode == UV_SELECT_FACE);
 	const int stickymode = sima ? (sima->sticky != SI_STICKY_DISABLE) : 1;
 
+	const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	/* note on tagging, selecting faces needs to be delayed so it doesn't select the verts and
 	 * confuse our checks on selected verts. */
 
@@ -3546,7 +3635,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
 				BM_elem_flag_disable(efa, BM_ELEM_TAG);
 				if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 					BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-						luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						luv->flag |= MLOOPUV_VERTSEL;
 					}
 					/* BM_face_select_set(em->bm, efa, TRUE); */
@@ -3567,7 +3656,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
 						
 						if (!totsel) {
 							BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-								luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+								luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 								luv->flag |= MLOOPUV_VERTSEL;
 							}
 							/* BM_face_select_set(em->bm, efa, TRUE); */
@@ -3582,7 +3671,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
 					if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 						BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 							if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) == 0) {
-								luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+								luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 								luv->flag |= MLOOPUV_VERTSEL;
 							}
 						}
@@ -3598,7 +3687,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
 			BM_elem_flag_disable(efa, BM_ELEM_TAG);
 			if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					luv->flag |= MLOOPUV_VERTSEL;
 				}
 				/* BM_face_select_set(em->bm, efa, TRUE); */
@@ -3612,7 +3701,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
 			if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 					if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) == 0) {
-						luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+						luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 						luv->flag |= MLOOPUV_VERTSEL;
 					}
 				}
@@ -3964,7 +4053,7 @@ void ED_operatortypes_uvedit(void)
 	WM_operatortype_append(UV_OT_average_islands_scale);
 	WM_operatortype_append(UV_OT_cube_project);
 	WM_operatortype_append(UV_OT_cylinder_project);
-	WM_operatortype_append(UV_OT_from_view);
+	WM_operatortype_append(UV_OT_project_from_view);
 	WM_operatortype_append(UV_OT_minimize_stretch);
 	WM_operatortype_append(UV_OT_pack_islands);
 	WM_operatortype_append(UV_OT_reset);
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 5d3a598..767003b 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -60,6 +60,7 @@
 			{ /*printf("Assertion %s:%d\n", __FILE__, __LINE__); abort();*/ } (void)0
 	#define param_warning(message) \
 		{ /*printf("Warning %s:%d: %s\n", __FILE__, __LINE__, message);*/ } (void)0
+#if 0
 	#define param_test_equals_ptr(str, a, b) \
 		if (a != b) \
 			{ /*printf("Equals %s => %p != %p\n", str, a, b);*/ } (void)0
@@ -67,6 +68,7 @@
 		if (a != b) \
 			{ /*printf("Equals %s => %d != %d\n", str, a, b);*/ } (void)0
 #endif
+#endif
 typedef enum PBool {
 	P_TRUE = 1,
 	P_FALSE = 0
@@ -1057,7 +1059,7 @@ static PFace *p_face_add(PHandle *handle)
 	e1->pair = NULL;
 	e2->pair = NULL;
 	e3->pair = NULL;
-   
+
 	e1->flag = 0;
 	e2->flag = 0;
 	e3->flag = 0;
@@ -3047,6 +3049,8 @@ static PBool p_chart_lscm_solve(PHandle *handle, PChart *chart)
 	PVert *v, *pin1 = chart->u.lscm.pin1, *pin2 = chart->u.lscm.pin2;
 	PFace *f;
 	float *alpha = chart->u.lscm.abf_alpha;
+	float area_pinned_up, area_pinned_down;
+	bool flip_faces;
 	int row;
 
 	nlMakeCurrent(chart->u.lscm.context);
@@ -3085,6 +3089,26 @@ static PBool p_chart_lscm_solve(PHandle *handle, PChart *chart)
 		}
 	}
 
+	/* detect up direction based on pinned vertices */
+	area_pinned_up = 0.0f;
+	area_pinned_down = 0.0f;
+
+	for (f = chart->faces; f; f = f->nextlink) {
+		PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
+		PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
+
+		if ((v1->flag & PVERT_PIN) && (v2->flag & PVERT_PIN) && (v3->flag & PVERT_PIN)) {
+			float area = p_face_uv_area_signed(f);
+
+			if (area > 0.0f)
+				area_pinned_up += area;
+			else
+				area_pinned_down -= area;
+		}
+	}
+
+	flip_faces = (area_pinned_down > area_pinned_up);
+
 	/* construct matrix */
 
 	nlBegin(NL_MATRIX);
@@ -3105,6 +3129,12 @@ static PBool p_chart_lscm_solve(PHandle *handle, PChart *chart)
 		else
 			p_face_angles(f, &a1, &a2, &a3);
 
+		if (flip_faces) {
+			SWAP(float, a2, a3);
+			SWAP(PEdge *, e2, e3);
+			SWAP(PVert *, v2, v3);
+		}
+
 		sina1 = sin(a1);
 		sina2 = sin(a2);
 		sina3 = sin(a3);
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index b1bb5c8..5bb8105 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -100,11 +100,13 @@ struct IslandStitchData;
 typedef struct IslandStitchData {
 	/* rotation can be used only for edges, for vertices there is no such notion */
 	float rotation;
+	float rotation_neg;
 	float translation[2];
 	/* Used for rotation, the island will rotate around this point */
 	float medianPoint[2];
 	int numOfElements;
 	int num_rot_elements;
+	int num_rot_elements_neg;
 	/* flag to remember if island has been added for preview */
 	char addedForPreview;
 	/* flag an island to be considered for determining static island */
@@ -286,20 +288,15 @@ static int getNumOfIslandUvs(UvElementMap *elementMap, int island)
 	}
 }
 
-static void stitch_uv_rotate(float rotation, float medianPoint[2], float uv[2], float aspect)
+static void stitch_uv_rotate(float mat[2][2], float medianPoint[2], float uv[2], float aspect)
 {
 	float uv_rotation_result[2];
 
 	uv[1] /= aspect;
 
-	uv[0] -= medianPoint[0];
-	uv[1] -= medianPoint[1];
-
-	uv_rotation_result[0] = cosf(rotation) * uv[0] - sinf(rotation) * uv[1];
-	uv_rotation_result[1] = sinf(rotation) * uv[0] + cosf(rotation) * uv[1];
-
-	uv[0] = uv_rotation_result[0] + medianPoint[0];
-	uv[1] = uv_rotation_result[1] + medianPoint[1];
+	sub_v2_v2(uv, medianPoint);
+	mul_v2_m2v2(uv_rotation_result, mat, uv);
+	add_v2_v2v2(uv, uv_rotation_result, medianPoint);
 
 	uv[1] *= aspect;
 }
@@ -412,17 +409,40 @@ static void stitch_calculate_island_snapping(StitchState *state, PreviewPosition
 	for (i = 0; i < state->element_map->totalIslands; i++) {
 		if (island_stitch_data[i].addedForPreview) {
 			int numOfIslandUVs = 0, j;
+			int totelem = island_stitch_data[i].num_rot_elements_neg + island_stitch_data[i].num_rot_elements;
+			float rotation;
+			float rotation_mat[2][2];
 
 			/* check to avoid divide by 0 */
-			if (island_stitch_data[i].num_rot_elements > 0) {
+			if (island_stitch_data[i].num_rot_elements > 1)
 				island_stitch_data[i].rotation /= island_stitch_data[i].num_rot_elements;
+
+			if (island_stitch_data[i].num_rot_elements_neg > 1)
+				island_stitch_data[i].rotation_neg /= island_stitch_data[i].num_rot_elements_neg;
+
+			if (island_stitch_data[i].numOfElements > 1) {
 				island_stitch_data[i].medianPoint[0] /= island_stitch_data[i].numOfElements;
 				island_stitch_data[i].medianPoint[1] /= island_stitch_data[i].numOfElements;
-				island_stitch_data[i].medianPoint[1] /= state->aspect;
+
+				island_stitch_data[i].translation[0] /= island_stitch_data[i].numOfElements;
+				island_stitch_data[i].translation[1] /= island_stitch_data[i].numOfElements;
+			}
+
+			island_stitch_data[i].medianPoint[1] /= state->aspect;
+			if ((island_stitch_data[i].rotation + island_stitch_data[i].rotation_neg < (float)M_PI_2) ||
+			    island_stitch_data[i].num_rot_elements == 0 || island_stitch_data[i].num_rot_elements_neg == 0)
+			{
+				rotation = (island_stitch_data[i].rotation * island_stitch_data[i].num_rot_elements -
+				            island_stitch_data[i].rotation_neg *
+				            island_stitch_data[i].num_rot_elements_neg) / totelem;
+			}
+			else {
+				rotation = (island_stitch_data[i].rotation * island_stitch_data[i].num_rot_elements +
+				            (2.0f * (float)M_PI - island_stitch_data[i].rotation_neg) *
+				            island_stitch_data[i].num_rot_elements_neg) / totelem;
 			}
-			island_stitch_data[i].translation[0] /= island_stitch_data[i].numOfElements;
-			island_stitch_data[i].translation[1] /= island_stitch_data[i].numOfElements;
 
+			rotate_m2(rotation_mat, rotation);
 			numOfIslandUVs = getNumOfIslandUvs(state->element_map, i);
 			element = &state->element_map->buf[state->element_map->islandIndices[i]];
 			for (j = 0; j < numOfIslandUVs; j++, element++) {
@@ -436,15 +456,16 @@ static void stitch_calculate_island_snapping(StitchState *state, PreviewPosition
 
 					if (final) {
 
-						stitch_uv_rotate(island_stitch_data[i].rotation, island_stitch_data[i].medianPoint, luv->uv, state->aspect);
+						stitch_uv_rotate(rotation_mat, island_stitch_data[i].medianPoint, luv->uv, state->aspect);
 
 						add_v2_v2(luv->uv, island_stitch_data[i].translation);
 					}
 
 					else {
+
 						int face_preview_pos = preview_position[BM_elem_index_get(element->l->f)].data_position;
 
-						stitch_uv_rotate(island_stitch_data[i].rotation, island_stitch_data[i].medianPoint,
+						stitch_uv_rotate(rotation_mat, island_stitch_data[i].medianPoint,
 						                 preview->preview_polys + face_preview_pos + 2 * element->tfindex, state->aspect);
 
 						add_v2_v2(preview->preview_polys + face_preview_pos + 2 * element->tfindex,
@@ -500,13 +521,16 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta
 
 	edgecos = dot_v2v2(uv1, uv2);
 	edgesin = cross_v2v2(uv1, uv2);
+	rotation = acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
 
-	rotation = (edgesin > 0.0f) ?
-	            +acosf(max_ff(-1.0f, min_ff(1.0f, edgecos))) :
-	            -acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
-
-	island_stitch_data[element1->island].num_rot_elements++;
-	island_stitch_data[element1->island].rotation += rotation;
+	if (edgesin > 0.0f) {
+		island_stitch_data[element1->island].num_rot_elements++;
+		island_stitch_data[element1->island].rotation += rotation;
+	}
+	else {
+		island_stitch_data[element1->island].num_rot_elements_neg++;
+		island_stitch_data[element1->island].rotation_neg += rotation;
+	}
 }
 
 
@@ -515,7 +539,8 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
 	float edgecos = 1.0f, edgesin = 0.0f;
 	int index;
 	UvElement *element_iter;
-	float rotation = 0;
+	float rotation = 0, rotation_neg = 0;
+	int rot_elem = 0, rot_elem_neg = 0;
 	BMLoop *l;
 
 	if (element->island == state->static_island && !state->midpoints)
@@ -544,16 +569,25 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
 			negate_v2_v2(normal, state->normals + index_tmp2 * 2);
 			edgecos = dot_v2v2(normal, state->normals + index_tmp1 * 2);
 			edgesin = cross_v2v2(normal, state->normals + index_tmp1 * 2);
-			rotation += (edgesin > 0.0f) ?
-			    +acosf(max_ff(-1.0f, min_ff(1.0f, edgecos))) :
-			    -acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
+			if (edgesin > 0.0f) {
+			    rotation += acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
+				rot_elem++;
+			}
+			else {
+			    rotation_neg += acosf(max_ff(-1.0f, min_ff(1.0f, edgecos)));
+				rot_elem_neg++;
+			}
 		}
 	}
 
-	if (state->midpoints)
+	if (state->midpoints) {
 		rotation /= 2.0f;
-	island_stitch_data[element->island].num_rot_elements++;
+		rotation_neg /= 2.0f;
+	}
+	island_stitch_data[element->island].num_rot_elements += rot_elem;
 	island_stitch_data[element->island].rotation += rotation;
+	island_stitch_data[element->island].num_rot_elements_neg += rot_elem_neg;
+	island_stitch_data[element->island].rotation_neg += rotation_neg;
 }
 
 
@@ -650,7 +684,7 @@ static void stitch_uv_edge_generate_linked_edges(GHash *edge_hash, StitchState *
 						edge2 = BLI_ghash_lookup(edge_hash, &edgetmp);
 
 						/* here I am taking care of non manifold case, assuming more than two matching edges.
-							 * I am not too sure we want this though */
+						 * I am not too sure we want this though */
 						last_set->next = edge2;
 						last_set = edge2;
 						/* set first, similarly to uv elements. Now we can iterate among common edges easily */
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 90feaa7..4ddf4bd 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -161,13 +161,16 @@ static int ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit)
 
 /****************** Parametrizer Conversion ***************/
 
-static int uvedit_have_selection(Scene *scene, BMEditMesh *em, short implicit)
+static bool uvedit_have_selection(Scene *scene, BMEditMesh *em, bool implicit)
 {
 	BMFace *efa;
 	BMLoop *l;
 	BMIter iter, liter;
-	MLoopUV *luv;
 	
+	if (!CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV)) {
+		return (em->bm->totfacesel != 0);
+	}
+
 	/* verify if we have any selected uv's before unwrapping,
 	 * so we can cancel the operator early */
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
@@ -175,14 +178,10 @@ static int uvedit_have_selection(Scene *scene, BMEditMesh *em, short implicit)
 			if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
 				continue;
 		}
-		else if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN) || !BM_elem_flag_test(efa, BM_ELEM_SELECT))
+		else if (!BM_elem_flag_test(efa, BM_ELEM_SELECT))
 			continue;
 	
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-			if (!luv)
-				return 1;
-			
 			if (uvedit_uv_select_test(em, scene, l))
 				break;
 		}
@@ -190,10 +189,10 @@ static int uvedit_have_selection(Scene *scene, BMEditMesh *em, short implicit)
 		if (implicit && !l)
 			continue;
 		
-		return 1;
+		return true;
 	}
 
-	return 0;
+	return false;
 }
 
 void uvedit_get_aspect(Scene *scene, Object *ob, BMEditMesh *em, float *aspx, float *aspy)
@@ -226,6 +225,7 @@ static ParamHandle *construct_param_handle(Scene *scene, Object *ob, BMEditMesh
                                            short implicit, short fill, short sel,
                                            short correct_aspect)
 {
+	BMesh *bm = em->bm;
 	ScanFillContext sf_ctx;
 	ParamHandle *handle;
 	BMFace *efa;
@@ -233,8 +233,11 @@ static ParamHandle *construct_param_handle(Scene *scene, Object *ob, BMEditMesh
 	BMEdge *eed;
 	BMIter iter, liter;
 	
+	const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
+
 	handle = param_construct_begin();
 
+
 	if (correct_aspect) {
 		float aspx, aspy;
 
@@ -284,7 +287,7 @@ static ParamHandle *construct_param_handle(Scene *scene, Object *ob, BMEditMesh
 			 * about which split is best for unwrapping than scanfill */
 			i = 0;
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				vkeys[i] = (ParamKey)BM_elem_index_get(l->v);
 				co[i] = l->v->co;
 				uv[i] = luv->uv;
@@ -332,7 +335,7 @@ static ParamHandle *construct_param_handle(Scene *scene, Object *ob, BMEditMesh
 				ls[2] = sf_tri->v3->tmp.p;
 
 				for (i = 0; i < 3; i++) {
-					MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, ls[i]->head.data, CD_MLOOPUV);
+					MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(ls[i], cd_loop_uv_offset);
 					vkeys[i] = (ParamKey)BM_elem_index_get(ls[i]->v);
 					co[i] = ls[i]->v->co;
 					uv[i] = luv->uv;
@@ -364,7 +367,8 @@ static ParamHandle *construct_param_handle(Scene *scene, Object *ob, BMEditMesh
 }
 
 
-static void texface_from_original_index(BMFace *efa, int index, float **uv, ParamBool *pin, ParamBool *select, Scene *scene, BMEditMesh *em)
+static void texface_from_original_index(BMFace *efa, int index, float **uv, ParamBool *pin, ParamBool *select,
+                                        Scene *scene, BMEditMesh *em, const int cd_loop_uv_offset)
 {
 	BMLoop *l;
 	BMIter liter;
@@ -379,10 +383,11 @@ static void texface_from_original_index(BMFace *efa, int index, float **uv, Para
 
 	BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 		if (BM_elem_index_get(l->v) == index) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 			*uv = luv->uv;
 			*pin = (luv->flag & MLOOPUV_PINNED) ? 1 : 0;
 			*select = (uvedit_uv_select_test(em, scene, l) != 0);
+			break;
 		}
 	}
 }
@@ -418,6 +423,8 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, Object *ob, B
 	/* similar to the above, we need a way to map edges to their original ones */
 	BMEdge **edgeMap;
 
+	const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	handle = param_construct_begin();
 
 	if (correct_aspect) {
@@ -506,10 +513,10 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, Object *ob, B
 		
 		/* This is where all the magic is done. If the vertex exists in the, we pass the original uv pointer to the solver, thus
 		 * flushing the solution to the edit mesh. */
-		texface_from_original_index(origFace, origVertIndices[face->v1], &uv[0], &pin[0], &select[0], scene, em);
-		texface_from_original_index(origFace, origVertIndices[face->v2], &uv[1], &pin[1], &select[1], scene, em);
-		texface_from_original_index(origFace, origVertIndices[face->v3], &uv[2], &pin[2], &select[2], scene, em);
-		texface_from_original_index(origFace, origVertIndices[face->v4], &uv[3], &pin[3], &select[3], scene, em);
+		texface_from_original_index(origFace, origVertIndices[face->v1], &uv[0], &pin[0], &select[0], scene, em, cd_loop_uv_offset);
+		texface_from_original_index(origFace, origVertIndices[face->v2], &uv[1], &pin[1], &select[1], scene, em, cd_loop_uv_offset);
+		texface_from_original_index(origFace, origVertIndices[face->v3], &uv[2], &pin[2], &select[2], scene, em, cd_loop_uv_offset);
+		texface_from_original_index(origFace, origVertIndices[face->v4], &uv[3], &pin[3], &select[3], scene, em, cd_loop_uv_offset);
 
 		param_face_add(handle, key, 4, vkeys, co, uv, pin, select);
 	}
@@ -547,17 +554,17 @@ typedef struct MinStretch {
 	wmTimer *timer;
 } MinStretch;
 
-static int minimize_stretch_init(bContext *C, wmOperator *op)
+static bool minimize_stretch_init(bContext *C, wmOperator *op)
 {
 	Scene *scene = CTX_data_scene(C);
 	Object *obedit = CTX_data_edit_object(C);
 	BMEditMesh *em = BMEdit_FromObject(obedit);
 	MinStretch *ms;
 	int fill_holes = RNA_boolean_get(op->ptr, "fill_holes");
-	short implicit = 1;
+	bool implicit = true;
 
 	if (!uvedit_have_selection(scene, em, implicit)) {
-		return 0;
+		return false;
 	}
 
 	ms = MEM_callocN(sizeof(MinStretch), "MinStretch");
@@ -576,7 +583,7 @@ static int minimize_stretch_init(bContext *C, wmOperator *op)
 
 	op->customdata = ms;
 
-	return 1;
+	return true;
 }
 
 static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interactive)
@@ -596,7 +603,7 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact
 		param_flush(ms->handle);
 
 		if (sa) {
-			BLI_snprintf(str, sizeof(str), "Minimize Stretch. Blend %.2f", ms->blend);
+			BLI_snprintf(str, sizeof(str), "Minimize Stretch. Blend %.2f (Press + and -, or scroll wheel to set)", ms->blend);
 			ED_area_headerprint(sa, str);
 		}
 
@@ -679,20 +686,24 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event)
 			return OPERATOR_FINISHED;
 		case PADPLUSKEY:
 		case WHEELUPMOUSE:
-			if (ms->blend < 0.95f) {
-				ms->blend += 0.1f;
-				ms->lasttime = 0.0f;
-				RNA_float_set(op->ptr, "blend", ms->blend);
-				minimize_stretch_iteration(C, op, 1);
+			if (event->val == KM_PRESS) {
+				if (ms->blend < 0.95f) {
+					ms->blend += 0.1f;
+					ms->lasttime = 0.0f;
+					RNA_float_set(op->ptr, "blend", ms->blend);
+					minimize_stretch_iteration(C, op, 1);
+				}
 			}
 			break;
 		case PADMINUS:
 		case WHEELDOWNMOUSE:
-			if (ms->blend > 0.05f) {
-				ms->blend -= 0.1f;
-				ms->lasttime = 0.0f;
-				RNA_float_set(op->ptr, "blend", ms->blend);
-				minimize_stretch_iteration(C, op, 1);
+			if (event->val == KM_PRESS) {
+				if (ms->blend > 0.05f) {
+					ms->blend -= 0.1f;
+					ms->lasttime = 0.0f;
+					RNA_float_set(op->ptr, "blend", ms->blend);
+					minimize_stretch_iteration(C, op, 1);
+				}
 			}
 			break;
 		case TIMER:
@@ -750,7 +761,7 @@ static int pack_islands_exec(bContext *C, wmOperator *op)
 	Object *obedit = CTX_data_edit_object(C);
 	BMEditMesh *em = BMEdit_FromObject(obedit);
 	ParamHandle *handle;
-	short implicit = 1;
+	bool implicit = true;
 
 	if (!uvedit_have_selection(scene, em, implicit)) {
 		return OPERATOR_CANCELLED;
@@ -797,7 +808,7 @@ static int average_islands_scale_exec(bContext *C, wmOperator *UNUSED(op))
 	Object *obedit = CTX_data_edit_object(C);
 	BMEditMesh *em = BMEdit_FromObject(obedit);
 	ParamHandle *handle;
-	short implicit = 1;
+	bool implicit = true;
 
 	if (!uvedit_have_selection(scene, em, implicit)) {
 		return OPERATOR_CANCELLED;
@@ -1047,6 +1058,8 @@ static void correct_uv_aspect(Scene *scene, Object *ob, BMEditMesh *em)
 	BMFace *efa;
 	float scale, aspx, aspy;
 	
+	const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	uvedit_get_aspect(scene, ob, em, &aspx, &aspy);
 	
 	if (aspx == aspy)
@@ -1056,11 +1069,11 @@ static void correct_uv_aspect(Scene *scene, Object *ob, BMEditMesh *em)
 		scale = aspy / aspx;
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			if (!BM_elem_flag_test(efa, BM_ELEM_SELECT) || BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
+			if (!BM_elem_flag_test(efa, BM_ELEM_SELECT))
 				continue;
 			
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				luv->uv[0] = ((luv->uv[0] - 0.5f) * scale) + 0.5f;
 			}
 		}
@@ -1069,11 +1082,11 @@ static void correct_uv_aspect(Scene *scene, Object *ob, BMEditMesh *em)
 		scale = aspx / aspy;
 
 		BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
-			if (!BM_elem_flag_test(efa, BM_ELEM_SELECT) || BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
+			if (!BM_elem_flag_test(efa, BM_ELEM_SELECT))
 				continue;
 			
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				luv->uv[1] = ((luv->uv[1] - 0.5f) * scale) + 0.5f;
 			}
 		}
@@ -1103,6 +1116,8 @@ static void uv_map_clip_correct(Scene *scene, Object *ob, BMEditMesh *em, wmOper
 	int clip_to_bounds = RNA_boolean_get(op->ptr, "clip_to_bounds");
 	int scale_to_bounds = RNA_boolean_get(op->ptr, "scale_to_bounds");
 
+	const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	/* correct for image aspect ratio */
 	if (correct_aspect)
 		correct_uv_aspect(scene, ob, em);
@@ -1115,7 +1130,7 @@ static void uv_map_clip_correct(Scene *scene, Object *ob, BMEditMesh *em, wmOper
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				minmax_v2v2_v2(min, max, luv->uv);
 			}
 		}
@@ -1134,7 +1149,7 @@ static void uv_map_clip_correct(Scene *scene, Object *ob, BMEditMesh *em, wmOper
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				
 				luv->uv[0] = (luv->uv[0] - min[0]) * dx;
 				luv->uv[1] = (luv->uv[1] - min[1]) * dy;
@@ -1148,7 +1163,7 @@ static void uv_map_clip_correct(Scene *scene, Object *ob, BMEditMesh *em, wmOper
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				CLAMP(luv->uv[0], 0.0f, 1.0f);
 				CLAMP(luv->uv[1], 0.0f, 1.0f);
 			}
@@ -1198,7 +1213,7 @@ static int unwrap_exec(bContext *C, wmOperator *op)
 	int use_subsurf = RNA_boolean_get(op->ptr, "use_subsurf_data");
 	short use_subsurf_final;
 	float obsize[3];
-	short implicit = 0;
+	bool implicit = false;
 
 	if (!uvedit_have_selection(scene, em, implicit)) {
 		return OPERATOR_CANCELLED;
@@ -1296,11 +1311,15 @@ static int uv_from_view_exec(bContext *C, wmOperator *op)
 	MLoopUV *luv;
 	float rotmat[4][4];
 
+	int cd_loop_uv_offset;
+
 	/* add uvs if they don't exist yet */
 	if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
 		return OPERATOR_CANCELLED;
 	}
 
+	cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	/* establish the camera object, so we can default to view mapping if anything is wrong with it */
 	if ((rv3d->persp == RV3D_CAMOB) && (v3d->camera) && (v3d->camera->type == OB_CAMERA)) {
 		camera = v3d->camera->data;
@@ -1314,7 +1333,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op)
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				BLI_uvproject_from_view_ortho(luv->uv, l->v->co, rotmat);
 			}
 		}
@@ -1328,7 +1347,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op)
 					continue;
 
 				BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-					luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+					luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 					BLI_uvproject_from_camera(luv->uv, l->v->co, uci);
 				}
 			}
@@ -1344,7 +1363,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op)
 				continue;
 
 			BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-				luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+				luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 				BLI_uvproject_from_view(luv->uv, l->v->co, rv3d->persmat, rotmat, ar->winx, ar->winy);
 			}
 		}
@@ -1368,7 +1387,7 @@ static int uv_from_view_poll(bContext *C)
 	return (rv3d != NULL);
 }
 
-void UV_OT_from_view(wmOperatorType *ot)
+void UV_OT_project_from_view(wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name = "Project From View";
@@ -1448,11 +1467,11 @@ static void uv_map_mirror(BMEditMesh *em, BMFace *efa, MTexPoly *UNUSED(tf))
 	float dx;
 	int i, mi;
 
-	i = 0;
-	BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-		luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+	const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
+	BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
+		luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 		uvs[i] = luv->uv;
-		i++;
 	}
 
 	mi = 0;
@@ -1480,11 +1499,15 @@ static int sphere_project_exec(bContext *C, wmOperator *op)
 	MLoopUV *luv;
 	float center[3], rotmat[4][4];
 
+	int cd_loop_uv_offset;
+
 	/* add uvs if they don't exist yet */
 	if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
 		return OPERATOR_CANCELLED;
 	}
 
+	cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	uv_map_transform(C, op, center, rotmat);
 
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
@@ -1492,7 +1515,7 @@ static int sphere_project_exec(bContext *C, wmOperator *op)
 			continue;
 
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 			uv_sphere_project(luv->uv, l->v->co, center, rotmat);
 		}
@@ -1555,11 +1578,15 @@ static int cylinder_project_exec(bContext *C, wmOperator *op)
 	MLoopUV *luv;
 	float center[3], rotmat[4][4];
 
+	int cd_loop_uv_offset;
+
 	/* add uvs if they don't exist yet */
 	if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
 		return OPERATOR_CANCELLED;
 	}
 
+	cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	uv_map_transform(C, op, center, rotmat);
 
 	BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
@@ -1567,7 +1594,7 @@ static int cylinder_project_exec(bContext *C, wmOperator *op)
 			continue;
 		
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 			uv_cylinder_project(luv->uv, l->v->co, center, rotmat);
 		}
@@ -1617,11 +1644,15 @@ static int cube_project_exec(bContext *C, wmOperator *op)
 	float cube_size, *loc, dx, dy;
 	int cox, coy;
 
+	int cd_loop_uv_offset;
+
 	/* add uvs if they don't exist yet */
 	if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
 		return OPERATOR_CANCELLED;
 	}
 
+	cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+
 	loc = obedit->obmat[3];
 	cube_size = RNA_float_get(op->ptr, "cube_size");
 
@@ -1639,7 +1670,7 @@ static int cube_project_exec(bContext *C, wmOperator *op)
 
 		dx = dy = 0;
 		BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
-			luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+			luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
 			luv->uv[0] = 0.5f + 0.5f * cube_size * (loc[cox] + l->v->co[cox]);
 			luv->uv[1] = 0.5f + 0.5f * cube_size * (loc[coy] + l->v->co[coy]);
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 7eaa408..66a7c91 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -38,7 +38,8 @@ extern "C" {
 
 struct Image;
 struct ImageUser;
-
+struct PreviewImage;
+	
 struct GPUTexture;
 typedef struct GPUTexture GPUTexture;
 
@@ -112,6 +113,8 @@ GPUTexture *GPU_texture_create_depth(int w, int h, char err_out[256]);
 GPUTexture *GPU_texture_create_vsm_shadow_map(int size, char err_out[256]);
 GPUTexture *GPU_texture_from_blender(struct Image *ima,
 	struct ImageUser *iuser, int isdata, double time, int mipmap);
+GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap);
+
 void GPU_texture_free(GPUTexture *tex);
 
 void GPU_texture_ref(GPUTexture *tex);
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 2079165..17d3ce3 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -54,6 +54,7 @@ struct GPUNodeStack;
 struct GPUMaterial;
 struct GPUTexture;
 struct GPULamp;
+struct PreviewImage;
 
 typedef struct GPUNode GPUNode;
 typedef struct GPUNodeLink GPUNodeLink;
@@ -108,6 +109,7 @@ GPUNodeLink *GPU_attribute(int type, const char *name);
 GPUNodeLink *GPU_uniform(float *num);
 GPUNodeLink *GPU_dynamic_uniform(float *num, int dynamictype, void *data);
 GPUNodeLink *GPU_image(struct Image *ima, struct ImageUser *iuser, int isdata);
+GPUNodeLink *GPU_image_preview(struct PreviewImage *prv);
 GPUNodeLink *GPU_texture(int size, float *pixels);
 GPUNodeLink *GPU_dynamic_texture(struct GPUTexture *tex, int dynamictype, void *data);
 GPUNodeLink *GPU_builtin(GPUBuiltin builtin);
@@ -122,6 +124,7 @@ GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4]);
 /* High level functions to create and use GPU materials */
 
 GPUMaterial *GPU_material_from_blender(struct Scene *scene, struct Material *ma);
+GPUMaterial *GPU_material_matcap(struct Scene *scene, struct Material *ma);
 void GPU_material_free(struct Material *ma);
 
 void GPU_materials_free(void);
@@ -234,6 +237,7 @@ int GPU_lamp_has_shadow_buffer(GPULamp *lamp);
 void GPU_lamp_update_buffer_mats(GPULamp *lamp);
 void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[4][4], int *winsize, float winmat[4][4]);
 void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp);
+int GPU_lamp_shadow_buffer_type(GPULamp *lamp);
 
 void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[4][4]);
 void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy);
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 5f9f68e..5bef7a8 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1391,7 +1391,7 @@ void GPU_update_mesh_buffers(GPU_Buffers *buffers, MVert *mvert,
 		vert_data = glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
 
 		if (vert_data) {
-			/* Vertex data is shared if smooth-shaded, but seperate
+			/* Vertex data is shared if smooth-shaded, but separate
 			   copies are made for flat shading because normals
 			   shouldn't be shared. */
 			if (buffers->smooth) {
@@ -1922,20 +1922,6 @@ static int gpu_bmesh_vert_visible_count(GHash *bm_unique_verts,
 	return totvert;
 }
 
-/* Return TRUE if all vertices in the face are visible, FALSE otherwise */
-static int gpu_bmesh_face_visible(BMFace *f)
-{
-	BMIter bm_iter;
-	BMVert *v;
-
-	BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
-		if (BM_elem_flag_test(v, BM_ELEM_HIDDEN))
-			return FALSE;
-	}
-
-	return TRUE;
-}
-
 /* Return the total number of visible faces */
 static int gpu_bmesh_face_visible_count(GHash *bm_faces)
 {
@@ -1945,7 +1931,7 @@ static int gpu_bmesh_face_visible_count(GHash *bm_faces)
 	GHASH_ITER (gh_iter, bm_faces) {
 		BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
 
-		if (gpu_bmesh_face_visible(f))
+		if (!paint_is_bmesh_face_hidden(f))
 			totface++;
 	}
 
@@ -2012,24 +1998,25 @@ void GPU_update_bmesh_buffers(GPU_Buffers *buffers,
 
 				BLI_assert(f->len == 3);
 
-				if (gpu_bmesh_face_visible(f)) {
+				if (!paint_is_bmesh_face_hidden(f)) {
 					BMVert *v[3];
 					float fmask = 0;
 					int i;
 
-					BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 3);
+					// BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 3);
+					BM_face_as_array_vert_tri(f, v);
 
 					/* Average mask value */
 					for (i = 0; i < 3; i++) {
 						fmask += *((float*)CustomData_bmesh_get(&bm->vdata,
-																v[i]->head.data,
-																CD_PAINT_MASK));
+						                                        v[i]->head.data,
+						                                        CD_PAINT_MASK));
 					}
 					fmask /= 3.0f;
 					
 					for (i = 0; i < 3; i++) {
 						gpu_bmesh_vert_to_buffer_copy(v[i], bm, vert_data,
-													  &v_index, f->no, &fmask);
+						                              &v_index, f->no, &fmask);
 					}
 				}
 			}
@@ -2063,12 +2050,15 @@ void GPU_update_bmesh_buffers(GPU_Buffers *buffers,
 			GHashIterator gh_iter;
 
 			GHASH_ITER (gh_iter, bm_faces) {
-				BMIter bm_iter;
 				BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
-				BMVert *v;
 
-				if (gpu_bmesh_face_visible(f)) {
-					BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
+				if (!paint_is_bmesh_face_hidden(f)) {
+					BMLoop *l_iter;
+					BMLoop *l_first;
+
+					l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+					do {
+						BMVert *v = l_iter->v;
 						if (use_short) {
 							unsigned short *elem = tri_data;
 							(*elem) = BM_elem_index_get(v);
@@ -2081,7 +2071,7 @@ void GPU_update_bmesh_buffers(GPU_Buffers *buffers,
 							elem++;
 							tri_data = elem;
 						}
-					}
+					} while ((l_iter = l_iter->next) != l_first);
 				}
 			}
 
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 4432627..b27a4be 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -68,6 +68,9 @@ static char *glsl_material_library = NULL;
 static const char* GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4",
 	NULL, NULL, NULL, NULL, "mat3", NULL, NULL, NULL, NULL, NULL, NULL, "mat4"};
 
+#define LINK_IMAGE_BLENDER	1
+#define LINK_IMAGE_PREVIEW	2
+
 /* GLSL code parsing for finding function definitions.
  * These are stored in a hash for lookup when creating a material. */
 
@@ -339,7 +342,7 @@ static int codegen_input_has_texture(GPUInput *input)
 {
 	if (input->link)
 		return 0;
-	else if (input->ima)
+	else if (input->ima || input->prv)
 		return 1;
 	else
 		return input->tex != NULL;
@@ -411,6 +414,17 @@ static void codegen_set_unique_ids(ListBase *nodes)
 					else
 						input->texid = GET_INT_FROM_POINTER(BLI_ghash_lookup(bindhash, input->ima));
 				}
+				else if (input->prv) {
+					/* input is texture from preview render, assign only one texid per
+					 * buffer to avoid sampling the same texture twice */
+					if (!BLI_ghash_haskey(bindhash, input->prv)) {
+						input->texid = texid++;
+						input->bindtex = 1;
+						BLI_ghash_insert(bindhash, input->prv, SET_INT_IN_POINTER(input->texid));
+					}
+					else
+						input->texid = GET_INT_FROM_POINTER(BLI_ghash_lookup(bindhash, input->prv));
+				}
 				else {
 					if (!BLI_ghash_haskey(bindhash, input->tex)) {
 						/* input is user created texture, check tex pointer */
@@ -718,7 +732,7 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
 				continue;
 			}
 
-			if (input->ima || input->tex)
+			if (input->ima || input->tex || input->prv)
 				BLI_snprintf(input->shadername, sizeof(input->shadername), "samp%d", input->texid);
 			else
 				BLI_snprintf(input->shadername, sizeof(input->shadername), "unf%d", input->id);
@@ -726,7 +740,7 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
 			/* pass non-dynamic uniforms to opengl */
 			extract = 0;
 
-			if (input->ima || input->tex) {
+			if (input->ima || input->tex || input->prv) {
 				if (input->bindtex)
 					extract = 1;
 			}
@@ -762,11 +776,14 @@ void GPU_pass_bind(GPUPass *pass, double time, int mipmap)
 	for (input=inputs->first; input; input=input->next) {
 		if (input->ima)
 			input->tex = GPU_texture_from_blender(input->ima, input->iuser, input->image_isdata, time, mipmap);
+		else if (input->prv)
+			input->tex = GPU_texture_from_preview(input->prv, mipmap);
 
 		if (input->tex && input->bindtex) {
 			GPU_texture_bind(input->tex, input->texid);
 			GPU_shader_uniform_texture(shader, input->shaderloc, input->tex);
 		}
+			
 	}
 }
 
@@ -781,7 +798,7 @@ void GPU_pass_update_uniforms(GPUPass *pass)
 
 	/* pass dynamic inputs to opengl, others were removed */
 	for (input=inputs->first; input; input=input->next)
-		if (!(input->ima || input->tex))
+		if (!(input->ima || input->tex || input->prv))
 			GPU_shader_uniform_vector(shader, input->shaderloc, input->type, 1,
 				input->dynamicvec);
 }
@@ -799,7 +816,7 @@ void GPU_pass_unbind(GPUPass *pass)
 		if (input->tex && input->bindtex)
 			GPU_texture_unbind(input->tex);
 
-		if (input->ima)
+		if (input->ima || input->prv)
 			input->tex = NULL;
 	}
 	
@@ -915,9 +932,13 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
 		input->type = GPU_VEC4;
 		input->source = GPU_SOURCE_TEX;
 
-		input->ima = link->ptr1;
-		input->iuser = link->ptr2;
-		input->image_isdata = link->image_isdata;
+		if (link->image == LINK_IMAGE_PREVIEW)
+			input->prv = link->ptr1;
+		else {
+			input->ima = link->ptr1;
+			input->iuser = link->ptr2;
+			input->image_isdata = link->image_isdata;
+		}
 		input->textarget = GL_TEXTURE_2D;
 		input->textype = GPU_TEX2D;
 		MEM_freeN(link);
@@ -1117,7 +1138,7 @@ GPUNodeLink *GPU_image(Image *ima, ImageUser *iuser, int isdata)
 {
 	GPUNodeLink *link = GPU_node_link_create(0);
 
-	link->image= 1;
+	link->image= LINK_IMAGE_BLENDER;
 	link->ptr1= ima;
 	link->ptr2= iuser;
 	link->image_isdata= isdata;
@@ -1125,6 +1146,17 @@ GPUNodeLink *GPU_image(Image *ima, ImageUser *iuser, int isdata)
 	return link;
 }
 
+GPUNodeLink *GPU_image_preview(PreviewImage *prv)
+{
+	GPUNodeLink *link = GPU_node_link_create(0);
+	
+	link->image= LINK_IMAGE_PREVIEW;
+	link->ptr1= prv;
+	
+	return link;
+}
+
+
 GPUNodeLink *GPU_texture(int size, float *pixels)
 {
 	GPUNodeLink *link = GPU_node_link_create(0);
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h
index f61f349..2e4cfe2 100644
--- a/source/blender/gpu/intern/gpu_codegen.h
+++ b/source/blender/gpu/intern/gpu_codegen.h
@@ -43,6 +43,7 @@ struct GPUOutput;
 struct GPUNode;
 struct GPUVertexAttribs;
 struct GPUFrameBuffer;
+struct PreviewImage;
 
 #define MAX_FUNCTION_NAME	64
 #define MAX_PARAMETER		32
@@ -138,6 +139,7 @@ typedef struct GPUInput {
 
 	struct Image *ima;		/* image */
 	struct ImageUser *iuser;/* image user */
+	struct PreviewImage *prv;	/* preview images & icons */
 	int image_isdata;		/* image does not contain color data */
 	float *dynamicvec;		/* vector data in case it is dynamic */
 	int dynamictype;		/* origin of the dynamic uniform (GPUDynamicType) */
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 254899e..c631f7e 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -52,6 +52,9 @@
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
 
+#include "BLI_threads.h"
+#include "BLI_blenlib.h"
+
 #include "BKE_bmfont.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
@@ -62,9 +65,6 @@
 #include "BKE_scene.h"
 #include "BKE_DerivedMesh.h"
 
-#include "BLI_threads.h"
-#include "BLI_blenlib.h"
-
 #include "GPU_buffers.h"
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
@@ -395,7 +395,12 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
 	}
 	else if (ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT)) {
 		glEnable(GL_BLEND);
-		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+		/* for OpenGL render we use the alpha channel, this makes alpha blend correct */
+		if (GLEW_VERSION_1_4)
+			glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+		else
+			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 		
 		/* if U.glalphaclip == 1.0, some cards go bonkers...
 		 * turn off alpha test in this case */
@@ -664,6 +669,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
 	return *bind;
 }
 
+/* Image *ima can be NULL */
 void GPU_create_gl_tex(unsigned int *bind, unsigned int *pix, float * frect, int rectw, int recth, int mipmap, int use_high_bit_depth, Image *ima)
 {
 	unsigned int *scalerect = NULL;
@@ -723,7 +729,8 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *pix, float * frect, int
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gpu_get_mipmap_filter(0));
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
 
-		ima->tpageflag |= IMA_MIPMAP_COMPLETE;
+		if (ima)
+			ima->tpageflag |= IMA_MIPMAP_COMPLETE;
 	}
 
 	if (GLEW_EXT_texture_filter_anisotropic)
@@ -928,8 +935,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
 	ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
 	
 	if (ima->repbind || (GPU_get_mipmap() && !GTS.gpu_mipmap) || !ima->bindcode || !ibuf ||
-	    (!is_power_of_2_i(ibuf->x) || !is_power_of_2_i(ibuf->y)) ||
-	    (w == 0) || (h == 0))
+		(w == 0) || (h == 0))
 	{
 		/* these cases require full reload still */
 		GPU_free_image(ima);
@@ -1283,10 +1289,9 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
 	GPUMaterial *gpumat;
 	GPUBlendMode alphablend;
 	int a;
-
 	int gamma = BKE_scene_check_color_management_enabled(scene);
-
 	int new_shading_nodes = BKE_scene_use_new_shading_nodes(scene);
+	int use_matcap = (v3d->flag2 & V3D_SHOW_SOLID_MATCAP); /* assumes v3d->defmaterial->preview is set */
 	
 	/* initialize state */
 	memset(&GMS, 0, sizeof(GMS));
@@ -1298,7 +1303,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
 
 	GMS.gob = ob;
 	GMS.gscene = scene;
-	GMS.totmat= ob->totcol+1; /* materials start from 1, default material is 0 */
+	GMS.totmat= use_matcap? 1 : ob->totcol+1; /* materials start from 1, default material is 0 */
 	GMS.glay= (v3d->localvd)? v3d->localvd->lay: v3d->lay; /* keep lamps visible in local view */
 	GMS.gviewmat= rv3d->viewmat;
 	GMS.gviewinv= rv3d->viewinv;
@@ -1324,59 +1329,72 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
 		GMS.alphablend= GMS.alphablend_fixed;
 	}
 
-	/* no materials assigned? */
-	if (ob->totcol==0) {
-		gpu_material_to_fixed(&GMS.matbuf[0], &defmaterial, 0, ob, new_shading_nodes);
-
+	/* viewport material, setup in space_view3d, defaults to matcap using ma->preview now */
+	if (use_matcap) {
+		GMS.gmatbuf[0] = v3d->defmaterial;
+		GPU_material_matcap(scene, v3d->defmaterial);
+		
 		/* do material 1 too, for displists! */
 		memcpy(&GMS.matbuf[1], &GMS.matbuf[0], sizeof(GPUMaterialFixed));
-
-		if (glsl) {
-			GMS.gmatbuf[0]= &defmaterial;
-			GPU_material_from_blender(GMS.gscene, &defmaterial);
-		}
-
+	
 		GMS.alphablend[0]= GPU_BLEND_SOLID;
 	}
+	else {
 	
-	/* setup materials */
-	for (a=1; a<=ob->totcol; a++) {
-		/* find a suitable material */
-		ma= give_current_material(ob, a);
-		if (!glsl && !new_shading_nodes) ma= gpu_active_node_material(ma);
-		if (ma==NULL) ma= &defmaterial;
-
-		/* create glsl material if requested */
-		gpumat = (glsl)? GPU_material_from_blender(GMS.gscene, ma): NULL;
-
-		if (gpumat) {
-			/* do glsl only if creating it succeed, else fallback */
-			GMS.gmatbuf[a]= ma;
-			alphablend = GPU_material_alpha_blend(gpumat, ob->col);
-		}
-		else {
-			/* fixed function opengl materials */
-			gpu_material_to_fixed(&GMS.matbuf[a], ma, gamma, ob, new_shading_nodes);
+		/* no materials assigned? */
+		if (ob->totcol==0) {
+			gpu_material_to_fixed(&GMS.matbuf[0], &defmaterial, 0, ob, new_shading_nodes);
 
-			if (GMS.use_alpha_pass) {
-				GMS.matbuf[a].diff[3]= ma->alpha;
-				alphablend = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA;
+			/* do material 1 too, for displists! */
+			memcpy(&GMS.matbuf[1], &GMS.matbuf[0], sizeof(GPUMaterialFixed));
+
+			if (glsl) {
+				GMS.gmatbuf[0]= &defmaterial;
+				GPU_material_from_blender(GMS.gscene, &defmaterial);
+			}
+
+			GMS.alphablend[0]= GPU_BLEND_SOLID;
+		}
+		
+		/* setup materials */
+		for (a=1; a<=ob->totcol; a++) {
+			/* find a suitable material */
+			ma= give_current_material(ob, a);
+			if (!glsl && !new_shading_nodes) ma= gpu_active_node_material(ma);
+			if (ma==NULL) ma= &defmaterial;
+
+			/* create glsl material if requested */
+			gpumat = (glsl)? GPU_material_from_blender(GMS.gscene, ma): NULL;
+
+			if (gpumat) {
+				/* do glsl only if creating it succeed, else fallback */
+				GMS.gmatbuf[a]= ma;
+				alphablend = GPU_material_alpha_blend(gpumat, ob->col);
 			}
 			else {
-				GMS.matbuf[a].diff[3]= 1.0f;
-				alphablend = GPU_BLEND_SOLID;
+				/* fixed function opengl materials */
+				gpu_material_to_fixed(&GMS.matbuf[a], ma, gamma, ob, new_shading_nodes);
+
+				if (GMS.use_alpha_pass) {
+					GMS.matbuf[a].diff[3]= ma->alpha;
+					alphablend = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA;
+				}
+				else {
+					GMS.matbuf[a].diff[3]= 1.0f;
+					alphablend = GPU_BLEND_SOLID;
+				}
 			}
-		}
 
-		/* setting 'do_alpha_after = TRUE' indicates this object needs to be
-		 * drawn in a second alpha pass for improved blending */
-		if (do_alpha_after && !GMS.is_alpha_pass)
-			if (ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT))
-				*do_alpha_after = TRUE;
+			/* setting 'do_alpha_after = TRUE' indicates this object needs to be
+			 * drawn in a second alpha pass for improved blending */
+			if (do_alpha_after && !GMS.is_alpha_pass)
+				if (ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT))
+					*do_alpha_after = TRUE;
 
-		GMS.alphablend[a]= alphablend;
+			GMS.alphablend[a]= alphablend;
+		}
 	}
-
+	
 	/* let's start with a clean state */
 	GPU_disable_material();
 }
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index bc859d0..e8e4701 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -36,13 +36,12 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "BKE_global.h"
-
-
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 #include "BLI_math_base.h"
 
+#include "BKE_global.h"
+
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
 #include "gpu_codegen.h"
@@ -539,6 +538,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, int isdata, d
 	glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode);
 
 	GPU_update_image_time(ima, time);
+	/* this binds a texture, so that's why to restore it with lastbindcode */
 	bindcode = GPU_verify_image(ima, iuser, 0, 0, mipmap, isdata);
 
 	if (ima->gputexture) {
@@ -579,6 +579,59 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, int isdata, d
 	return tex;
 }
 
+GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap)
+{
+	GPUTexture *tex = prv->gputexture[0];
+	GLint w, h, lastbindcode;
+	GLuint bindcode = 0;
+	
+	glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode);
+	
+	if (tex)
+		bindcode = tex->bindcode;
+	
+	/* this binds a texture, so that's why to restore it */
+	if (bindcode == 0) {
+		GPU_create_gl_tex(&bindcode, prv->rect[0], NULL, prv->w[0], prv->h[0], mipmap, 0, NULL);
+	}
+	if (tex) {
+		tex->bindcode = bindcode;
+		glBindTexture(GL_TEXTURE_2D, lastbindcode);
+		return tex;
+	}
+
+	/* error binding anything */
+	if (!bindcode) {
+		glBindTexture(GL_TEXTURE_2D, lastbindcode);
+		return NULL;
+	}
+	
+	tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
+	tex->bindcode = bindcode;
+	tex->number = -1;
+	tex->refcount = 1;
+	tex->target = GL_TEXTURE_2D;
+	
+	prv->gputexture[0]= tex;
+	
+	if (!glIsTexture(tex->bindcode)) {
+		GPU_print_error("Blender Texture");
+	}
+	else {
+		glBindTexture(GL_TEXTURE_2D, tex->bindcode);
+		glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
+		glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
+		
+		tex->w = w;
+		tex->h = h;
+	}
+	
+	glBindTexture(GL_TEXTURE_2D, lastbindcode);
+	
+	return tex;
+
+}
+
 GPUTexture *GPU_texture_create_1D(int w, float *fpixels, char err_out[256])
 {
 	GPUTexture *tex = GPU_texture_create_nD(w, 1, 1, fpixels, 0, err_out);
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index a2fc1eb..b5ef27a 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1035,7 +1035,7 @@ static void do_material_tex(GPUShadeInput *shi)
 				GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser, FALSE), &tin, &trgb);
 				rgbnor= TEX_RGB;
 
-				talpha= 1;
+				talpha = (tex->ima->flag & IMA_IGNORE_ALPHA) == 0;
 			}
 			else {
 				continue;
@@ -1506,6 +1506,52 @@ static GPUNodeLink *gpu_material_diffuse_bsdf(GPUMaterial *mat, Material *ma)
 	return outlink;
 }
 
+static GPUNodeLink *gpu_material_preview_matcap(GPUMaterial *mat, Material *ma)
+{
+	GPUNodeLink *outlink;
+	
+	GPU_link(mat, "material_preview_matcap", GPU_uniform(&ma->r), GPU_image_preview(ma->preview), GPU_builtin(GPU_VIEW_NORMAL), &outlink);
+	
+	return outlink;
+}
+
+/* new solid draw mode with glsl matcaps */
+GPUMaterial *GPU_material_matcap(Scene *scene, Material *ma)
+{
+	GPUMaterial *mat;
+	GPUNodeLink *outlink;
+	LinkData *link;
+	
+	for (link=ma->gpumaterial.first; link; link=link->next)
+		if (((GPUMaterial*)link->data)->scene == scene)
+			return link->data;
+	
+	/* allocate material */
+	mat = GPU_material_construct_begin(ma);
+	mat->scene = scene;
+	
+	if (ma->preview && ma->preview->rect[0]) {
+		outlink = gpu_material_preview_matcap(mat, ma);
+	}
+	else {
+		outlink = gpu_material_diffuse_bsdf(mat, ma);
+	}
+		
+	GPU_material_output_link(mat, outlink);
+
+	GPU_material_construct_end(mat);
+	
+	/* note that even if building the shader fails in some way, we still keep
+	 * it to avoid trying to compile again and again, and simple do not use
+	 * the actual shader on drawing */
+	
+	link = MEM_callocN(sizeof(LinkData), "GPUMaterialLink");
+	link->data = mat;
+	BLI_addtail(&ma->gpumaterial, link);
+	
+	return mat;
+}
+
 GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
 {
 	GPUMaterial *mat;
@@ -1882,6 +1928,11 @@ void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp)
 	glEnable(GL_SCISSOR_TEST);
 }
 
+int GPU_lamp_shadow_buffer_type(GPULamp *lamp)
+{
+	return lamp->la->shadowmap_type;
+}
+
 int GPU_lamp_shadow_layer(GPULamp *lamp)
 {
 	if (lamp->fb && lamp->tex && (lamp->mode & (LA_LAYER|LA_LAYER_SHADOW)))
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index e89be91..8fc18bf 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -390,6 +390,17 @@ void set_rgba_zero(out vec4 outval)
 	outval = vec4(0.0);
 }
 
+void brightness_contrast(vec4 col, float brightness, float contrast, out vec4 outcol)
+{
+	float a = 1.0 + contrast;
+	float b = brightness - contrast*0.5;
+
+	outcol.r = max(a*col.r + b, 0.0);
+	outcol.g = max(a*col.g + b, 0.0);
+	outcol.b = max(a*col.b + b, 0.0);
+	outcol.a = col.a;
+}
+
 void mix_blend(float fac, vec4 col1, vec4 col2, out vec4 outcol)
 {
 	fac = clamp(fac, 0.0, 1.0);
@@ -2256,3 +2267,18 @@ void node_output_material(vec4 surface, vec4 volume, float displacement, out vec
 	result = surface;
 }
 
+/* ********************** matcap style render ******************** */
+
+void material_preview_matcap(vec4 color, sampler2D ima, vec3 N, out vec4 result)
+{
+	vec2 tex;
+
+	if (N.z < 0.0) {
+		N.z = 0.0;
+		N = normalize(N);
+	}
+
+	tex.x = 0.5 + 0.49 * N.x;
+	tex.y = 0.5 + 0.49 * N.y;
+	result = texture2D(ima, tex);
+}
diff --git a/source/blender/imbuf/IMB_colormanagement.h b/source/blender/imbuf/IMB_colormanagement.h
index 1e33f8d..a05f0d5 100644
--- a/source/blender/imbuf/IMB_colormanagement.h
+++ b/source/blender/imbuf/IMB_colormanagement.h
@@ -133,6 +133,8 @@ void IMB_partial_display_buffer_update(struct ImBuf *ibuf, const float *linear_b
                                        int xmin, int ymin, int xmax, int ymax,
                                        int update_orig_byte_buffer);
 
+void IMB_partial_display_buffer_update_delayed(struct ImBuf *ibuf, int xmin, int ymin, int xmax, int ymax);
+
 /* ** Pixel processor functions ** */
 struct ColormanageProcessor *IMB_colormanagement_display_processor_new(const struct ColorManagedViewSettings *view_settings,
                                                                        const struct ColorManagedDisplaySettings *display_settings);
diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h
index 49e2e7f..dde8d4d 100644
--- a/source/blender/imbuf/IMB_imbuf_types.h
+++ b/source/blender/imbuf/IMB_imbuf_types.h
@@ -28,6 +28,8 @@
 #ifndef __IMB_IMBUF_TYPES_H__
 #define __IMB_IMBUF_TYPES_H__
 
+#include "DNA_vec_types.h"  /* for rcti */
+
 /**
  * \file IMB_imbuf_types.h
  * \ingroup imbuf
@@ -132,6 +134,7 @@ typedef struct ImBuf {
 	unsigned int *display_buffer_flags;          /* array of per-display display buffers dirty flags */
 	struct ColormanageCache *colormanage_cache;  /* cache used by color management */
 	int colormanage_flag;
+	rcti invalid_rect;
 
 	/* information for compressed textures */
 	struct DDSData dds_data;
@@ -175,7 +178,7 @@ typedef struct ImBuf {
  * The bit flag is stored in the ImBuf.ftype variable.
  * Note that the lower 11 bits is used for storing custom flags
  */
-#define IB_CUSTOM_FLAGS_MASK 0x400
+#define IB_CUSTOM_FLAGS_MASK 0x7ff
 
 #define PNG				(1 << 30)
 #define TGA				(1 << 28)
diff --git a/source/blender/imbuf/intern/IMB_colormanagement_intern.h b/source/blender/imbuf/intern/IMB_colormanagement_intern.h
index ba9e20a..e2a8e1e 100644
--- a/source/blender/imbuf/intern/IMB_colormanagement_intern.h
+++ b/source/blender/imbuf/intern/IMB_colormanagement_intern.h
@@ -33,8 +33,6 @@
 
 #include "DNA_listBase.h"
 
-#define BCM_CONFIG_FILE "config.ocio"
-
 struct OCIO_ConstProcessorRcPtr;
 struct ImBuf;
 
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 2c6e46c..ff297d7 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -57,6 +57,7 @@
 #include "BLI_path_util.h"
 #include "BLI_string.h"
 #include "BLI_threads.h"
+#include "BLI_rect.h"
 
 #include "BKE_colortools.h"
 #include "BKE_context.h"
@@ -1222,7 +1223,7 @@ static void *display_buffer_apply_get_linear_buffer(DisplayBufferThread *handle)
 			}
 			else if (channels == 4) {
 				rgba_uchar_to_float(fp, cp);
-				straight_to_premul_v4(fp, fp);
+				straight_to_premul_v4(fp);
 			}
 			else {
 				BLI_assert(!"Buffers of 3 or 4 channels are only supported here");
@@ -1353,6 +1354,23 @@ static void display_buffer_apply_threaded(ImBuf *ibuf, float *buffer, unsigned c
 	                             display_buffer_init_handle, do_display_buffer_apply_thread);
 }
 
+static int is_ibuf_rect_in_display_space(ImBuf *ibuf, const ColorManagedViewSettings *view_settings,
+                                         const ColorManagedDisplaySettings *display_settings)
+{
+	if ((view_settings->flag & COLORMANAGE_VIEW_USE_CURVES) == 0 &&
+	    view_settings->exposure == 0.0f &&
+	    view_settings->gamma == 1.0f)
+	{
+		const char *from_colorspace = ibuf->rect_colorspace->name;
+		const char *to_colorspace = display_transform_get_colorspace_name(view_settings, display_settings);
+
+		if (to_colorspace && !strcmp(from_colorspace, to_colorspace))
+			return TRUE;
+	}
+
+	return FALSE;
+}
+
 static void colormanage_display_buffer_process_ex(ImBuf *ibuf, float *display_buffer, unsigned char *display_buffer_byte,
                                                   const ColorManagedViewSettings *view_settings,
                                                   const ColorManagedDisplaySettings *display_settings)
@@ -1366,16 +1384,7 @@ static void colormanage_display_buffer_process_ex(ImBuf *ibuf, float *display_bu
 	 * computation noticeable faster
 	 */
 	if (ibuf->rect_float == NULL && ibuf->rect_colorspace) {
-		if ((view_settings->flag & COLORMANAGE_VIEW_USE_CURVES) == 0 &&
-		    view_settings->exposure == 0.0f &&
-		    view_settings->gamma == 1.0f)
-		{
-			const char *from_colorspace = ibuf->rect_colorspace->name;
-			const char *to_colorspace = display_transform_get_colorspace_name(view_settings, display_settings);
-
-			if (to_colorspace && !strcmp(from_colorspace, to_colorspace))
-				skip_transform = TRUE;
-		}
+		skip_transform = is_ibuf_rect_in_display_space(ibuf, view_settings, display_settings);
 	}
 
 	if (skip_transform == FALSE)
@@ -1815,6 +1824,18 @@ unsigned char *IMB_display_buffer_acquire(ImBuf *ibuf, const ColorManagedViewSet
 		colormanage_view_settings_to_cache(&cache_view_settings, applied_view_settings);
 		colormanage_display_settings_to_cache(&cache_display_settings, display_settings);
 
+		if (ibuf->invalid_rect.xmin != ibuf->invalid_rect.xmax) {
+			if ((ibuf->userflags & IB_DISPLAY_BUFFER_INVALID) == 0) {
+				IMB_partial_display_buffer_update(ibuf, ibuf->rect_float, (unsigned char *) ibuf->rect,
+				                                  ibuf->x, 0, 0, applied_view_settings, display_settings,
+				                                  ibuf->invalid_rect.xmin, ibuf->invalid_rect.ymin,
+				                                  ibuf->invalid_rect.xmax, ibuf->invalid_rect.ymax,
+				                                  FALSE);
+			}
+
+			BLI_rcti_init(&ibuf->invalid_rect, 0, 0, 0, 0);
+		}
+
 		BLI_lock_thread(LOCK_COLORMANAGE);
 
 		/* ensure color management bit fields exists */
@@ -2110,7 +2131,7 @@ static void colormanage_description_strip(char *description)
 {
 	int i, n;
 
-	for (i = strlen(description) - 1; i >= 0; i--) {
+	for (i = (int)strlen(description) - 1; i >= 0; i--) {
 		if (ELEM(description[i], '\r', '\n')) {
 			description[i] = '\0';
 		}
@@ -2332,37 +2353,67 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
 	int is_data = ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA;
 
 	if (dither != 0.0f) {
+		/* cm_processor is NULL in cases byte_buffer's space matches display
+		 * buffer's space
+		 * in this case we could skip extra transform and only apply dither
+		 * use 4 channels for easier byte->float->byte conversion here so
+		 * (this is only needed to apply dither, in other cases we'll convert
+		 * byte buffer to display directly)
+		 */
+		if (!cm_processor)
+			channels = 4;
+
 		display_buffer_float = MEM_callocN(channels * width * height * sizeof(float), "display buffer for dither");
 	}
 
-	for (y = ymin; y < ymax; y++) {
-		for (x = xmin; x < xmax; x++) {
-			int display_index = (y * display_stride + x) * channels;
-			int linear_index = ((y - linear_offset_y) * linear_stride + (x - linear_offset_x)) * channels;
-			float pixel[4];
-
-			if (linear_buffer) {
-				copy_v4_v4(pixel, (float *) linear_buffer + linear_index);
-			}
-			else if (byte_buffer) {
-				rgba_uchar_to_float(pixel, byte_buffer + linear_index);
-				IMB_colormanagement_colorspace_to_scene_linear_v3(pixel, rect_colorspace);
-				straight_to_premul_v4(pixel, pixel);
-			}
-
-			if (!is_data) {
-				IMB_colormanagement_processor_apply_v4_predivide(cm_processor, pixel);
+	if (cm_processor) {
+		for (y = ymin; y < ymax; y++) {
+			for (x = xmin; x < xmax; x++) {
+				int display_index = (y * display_stride + x) * channels;
+				int linear_index = ((y - linear_offset_y) * linear_stride + (x - linear_offset_x)) * channels;
+				float pixel[4];
+
+				if (linear_buffer) {
+					copy_v4_v4(pixel, (float *) linear_buffer + linear_index);
+				}
+				else if (byte_buffer) {
+					rgba_uchar_to_float(pixel, byte_buffer + linear_index);
+					IMB_colormanagement_colorspace_to_scene_linear_v3(pixel, rect_colorspace);
+					straight_to_premul_v4(pixel);
+				}
+
+				if (!is_data) {
+					IMB_colormanagement_processor_apply_v4_predivide(cm_processor, pixel);
+				}
+
+				if (display_buffer_float) {
+					int index = ((y - ymin) * width + (x - xmin)) * channels;
+
+					copy_v4_v4(display_buffer_float + index, pixel);
+				}
+				else {
+					float pixel_straight[4];
+					premul_to_straight_v4_v4(pixel_straight, pixel);
+					rgba_float_to_uchar(display_buffer + display_index, pixel_straight);
+				}
 			}
+		}
+	}
+	else {
+		if (display_buffer_float) {
+			/* huh, for dither we need float buffer first, no cheaper way. currently */
+			IMB_buffer_float_from_byte(display_buffer_float, byte_buffer,
+			                           IB_PROFILE_SRGB, IB_PROFILE_SRGB, TRUE,
+			                           width, height, width, display_stride);
+		}
+		else {
+			int i, width = xmax - xmin;
 
-			if (display_buffer_float) {
-				int index = ((y - ymin) * width + (x - xmin)) * channels;
+			for (i = ymin; i < ymax; i++) {
+				int byte_offset = (linear_stride * i + xmin) * 4;
+				int display_offset = (display_stride * i + xmin) * 4;
 
-				copy_v4_v4(display_buffer_float + index, pixel);
-			}
-			else {
-				float pixel_straight[4];
-				premul_to_straight_v4(pixel_straight, pixel);
-				rgba_float_to_uchar(display_buffer + display_index, pixel_straight);
+				memcpy(display_buffer + display_offset, byte_buffer + byte_offset, 4 * sizeof(char) * width);
 			}
 		}
 	}
@@ -2371,7 +2422,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
 		int display_index = (ymin * display_stride + xmin) * channels;
 
 		IMB_buffer_byte_from_float(display_buffer + display_index, display_buffer_float, channels, dither,
-		                           IB_PROFILE_SRGB, IB_PROFILE_SRGB, FALSE, width, height, display_stride, width);
+		                           IB_PROFILE_SRGB, IB_PROFILE_SRGB, TRUE, width, height, display_stride, width);
 
 		MEM_freeN(display_buffer_float);
 	}
@@ -2426,20 +2477,42 @@ void IMB_partial_display_buffer_update(ImBuf *ibuf, const float *linear_buffer,
 		BLI_unlock_thread(LOCK_COLORMANAGE);
 
 		if (display_buffer) {
-			ColormanageProcessor *cm_processor;
+			ColormanageProcessor *cm_processor = NULL;
+			int skip_transform = 0;
 
-			cm_processor = IMB_colormanagement_display_processor_new(view_settings, display_settings);
+			/* byte buffer is assumed to be in imbuf's rect space, so if byte buffer
+			 * is known we could skip display->linear->display conversion in case
+			 * display color space matches imbuf's rect space
+			 */
+			if (byte_buffer != NULL)
+				skip_transform = is_ibuf_rect_in_display_space(ibuf, view_settings, display_settings);
+
+			if (!skip_transform)
+				cm_processor = IMB_colormanagement_display_processor_new(view_settings, display_settings);
 
 			partial_buffer_update_rect(ibuf, display_buffer, linear_buffer, byte_buffer, buffer_width, stride,
 			                           offset_x, offset_y, cm_processor, xmin, ymin, xmax, ymax);
 
-			IMB_colormanagement_processor_free(cm_processor);
+			if (cm_processor)
+				IMB_colormanagement_processor_free(cm_processor);
 
 			IMB_display_buffer_release(cache_handle);
 		}
 	}
 }
 
+void IMB_partial_display_buffer_update_delayed(ImBuf *ibuf, int xmin, int ymin, int xmax, int ymax)
+{
+	if (ibuf->invalid_rect.xmin == ibuf->invalid_rect.xmax) {
+		BLI_rcti_init(&ibuf->invalid_rect, xmin, xmax, ymin, ymax);
+	}
+	else {
+		rcti rect;
+		BLI_rcti_init(&rect, xmin, xmax, ymin, ymax);
+		BLI_rcti_union(&ibuf->invalid_rect, &rect);
+	}
+}
+
 /*********************** Pixel processor functions *************************/
 
 ColormanageProcessor *IMB_colormanagement_display_processor_new(const ColorManagedViewSettings *view_settings,
diff --git a/source/blender/imbuf/intern/dds/Stream.cpp b/source/blender/imbuf/intern/dds/Stream.cpp
index 00e1b67..57a2512 100644
--- a/source/blender/imbuf/intern/dds/Stream.cpp
+++ b/source/blender/imbuf/intern/dds/Stream.cpp
@@ -47,7 +47,7 @@ unsigned int mem_read(Stream & mem, unsigned long long & i)
 	if (mem.pos + 8 > mem.size) {
 		printf("DDS: trying to read beyond end of stream (corrupt file?)");
 		return(0);
-	};
+	}
 	memcpy(&i, mem.mem + mem.pos, 8); // @@ todo: make sure little endian
 	mem.pos += 8;
 	return(8);
@@ -58,7 +58,7 @@ unsigned int mem_read(Stream & mem, unsigned int & i)
 	if (mem.pos + 4 > mem.size) {
 		printf("DDS: trying to read beyond end of stream (corrupt file?)");
 		return(0);
-	};
+	}
 	memcpy(&i, mem.mem + mem.pos, 4); // @@ todo: make sure little endian
 	mem.pos += 4;
 	return(4);
@@ -69,7 +69,7 @@ unsigned int mem_read(Stream & mem, unsigned short & i)
 	if (mem.pos + 2 > mem.size) {
 		printf("DDS: trying to read beyond end of stream (corrupt file?)");
 		return(0);
-	};
+	}
 	memcpy(&i, mem.mem + mem.pos, 2); // @@ todo: make sure little endian
 	mem.pos += 2;
 	return(2);
@@ -80,7 +80,7 @@ unsigned int mem_read(Stream & mem, unsigned char & i)
 	if (mem.pos + 1 > mem.size) {
 		printf("DDS: trying to read beyond end of stream (corrupt file?)");
 		return(0);
-	};
+	}
 	i = (mem.mem + mem.pos)[0];
 	mem.pos += 1;
 	return(1);
@@ -91,7 +91,7 @@ unsigned int mem_read(Stream & mem, unsigned char *i, unsigned int cnt)
 	if (mem.pos + cnt > mem.size) {
 		printf("DDS: trying to read beyond end of stream (corrupt file?)");
 		return(0);
-	};
+	}
 	memcpy(i, mem.mem + mem.pos, cnt);
 	mem.pos += cnt;
 	return(cnt);
diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp
index c41bbd5..0c240f1 100644
--- a/source/blender/imbuf/intern/dds/dds_api.cpp
+++ b/source/blender/imbuf/intern/dds/dds_api.cpp
@@ -96,7 +96,7 @@ struct ImBuf *imb_load_dds(unsigned char *mem, size_t size, int flags, char colo
 	Color32 pixel;
 	Color32 *pixels = 0;
 
-	/* OCIO_TODO: never was able to save DDS, so can'ttest loading
+	/* OCIO_TODO: never was able to save DDS, so can't test loading
 	 *            but profile used to be set to sRGB and can't see rect_float here, so
 	 *            default byte space should work fine
 	 */
@@ -136,9 +136,9 @@ struct ImBuf *imb_load_dds(unsigned char *mem, size_t size, int flags, char colo
 			if (pixel.a != 255) {
 				bits_per_pixel = 32;
 				break;
-			};
-		};
-	};
+			}
+		}
+	}
 	ibuf = IMB_allocImBuf(dds.width(), dds.height(), bits_per_pixel, 0); 
 	if (ibuf == 0) return(0); /* memory allocation failed */
 
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index 84339b5..20d51fd 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -255,7 +255,7 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
 				/* no color space conversion */
 				if (dither && predivide) {
 					for (x = 0; x < width; x++, from += 4, to += 4) {
-						premul_to_straight_v4(straight, from);
+						premul_to_straight_v4_v4(straight, from);
 						float_to_byte_dither_v4(to, straight, di);
 					}
 				}
@@ -265,7 +265,7 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
 				}
 				else if (predivide) {
 					for (x = 0; x < width; x++, from += 4, to += 4) {
-						premul_to_straight_v4(straight, from);
+						premul_to_straight_v4_v4(straight, from);
 						rgba_float_to_uchar(to, straight);
 					}
 				}
@@ -281,7 +281,7 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
 
 				if (dither && predivide) {
 					for (x = 0; x < width; x++, from += 4, to += 4) {
-						premul_to_straight_v4(straight, from);
+						premul_to_straight_v4_v4(straight, from);
 						linearrgb_to_srgb_ushort4(us, from);
 						ushort_to_byte_dither_v4(to, us, di);
 					}
@@ -294,7 +294,7 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
 				}
 				else if (predivide) {
 					for (x = 0; x < width; x++, from += 4, to += 4) {
-						premul_to_straight_v4(straight, from);
+						premul_to_straight_v4_v4(straight, from);
 						linearrgb_to_srgb_ushort4(us, from);
 						ushort_to_byte_v4(to, us);
 					}
@@ -690,20 +690,20 @@ void IMB_buffer_float_clamp(float *buf, int width, int height)
 void IMB_buffer_float_unpremultiply(float *buf, int width, int height)
 {
 	int total = width * height;
-	float *cp = buf;
+	float *fp = buf;
 	while (total--) {
-		premul_to_straight_v4(cp, cp);
-		cp += 4;
+		premul_to_straight_v4(fp);
+		fp += 4;
 	}
 }
 
 void IMB_buffer_float_premultiply(float *buf, int width, int height)
 {
 	int total = width * height;
-	float *cp = buf;
+	float *fp = buf;
 	while (total--) {
-		straight_to_premul_v4(cp, cp);
-		cp += 4;
+		straight_to_premul_v4(fp);
+		fp += 4;
 	}
 }
 
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 51fee23..9193954 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -506,6 +506,10 @@ void IMB_makemipmap(ImBuf *ibuf, int use_filter)
 
 	imb_freemipmapImBuf(ibuf);
 	
+	/* no mipmap for non RGBA images */
+	if (ibuf->rect_float && ibuf->channels < 4)
+		return;
+	
 	ibuf->miptot = 1;
 
 	while (curmap < IB_MIPMAP_LEVELS) {
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 86e451e..56e5be7 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -332,7 +332,7 @@ int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size)
 			return 3;
 		default:
 			return 0;
-	};
+	}
 	return 0;
 }
 
@@ -352,7 +352,7 @@ int IMB_timecode_to_array_index(IMB_Timecode_Type tc)
 			return 3;
 		default:
 			return 0;
-	};
+	}
 	return 0;
 }
 
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index dec5f6f..47bd3e5 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -672,7 +672,7 @@ static void expandrow(unsigned char *optr, unsigned char *iptr, int z)
  *	represents one pixel.  xsize and ysize specify the dimensions of
  *	the pixel array.  zsize specifies what kind of image file to
  *	write out.  if zsize is 1, the luminance of the pixels are
- *	calculated, and a sinlge channel black and white image is saved.
+ *	calculated, and a single channel black and white image is saved.
  *	If zsize is 3, an RGB image file is saved.  If zsize is 4, an
  *	RGBA image file is saved.
  *
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 8d6218a..ff0aeb0 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -556,7 +556,7 @@ static float channel_colormanage_noop(float value)
 static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
 {
 	unsigned char *rect_uchar;
-	float *rect_float;
+	float *rect_float, from_straight[4];
 	
 	unsigned int subsampling_dx = parameters->subsampling_dx;
 	unsigned int subsampling_dy = parameters->subsampling_dy;
@@ -668,19 +668,21 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
 				if (numcomps == 4) {
 					PIXEL_LOOPER_BEGIN(rect_float)
 					{
-						r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0]));
-						g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[1]));
-						b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[2]));
-						a[i] = DOWNSAMPLE_FLOAT_TO_8BIT(rect_float[3]);
+						premul_to_straight_v4_v4(from_straight, rect_float);
+						r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[0]));
+						g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[1]));
+						b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[2]));
+						a[i] = DOWNSAMPLE_FLOAT_TO_8BIT(from_straight[3]);
 					}
 					PIXEL_LOOPER_END;
 				}
 				else {
 					PIXEL_LOOPER_BEGIN(rect_float)
 					{
-						r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0]));
-						g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[1]));
-						b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[2]));
+						premul_to_straight_v4_v4(from_straight, rect_float);
+						r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[0]));
+						g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[1]));
+						b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[2]));
 					}
 					PIXEL_LOOPER_END;
 				}
@@ -690,19 +692,21 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
 				if (numcomps == 4) {
 					PIXEL_LOOPER_BEGIN(rect_float)
 					{
-						r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0]));
-						g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[1]));
-						b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[2]));
-						a[i] = DOWNSAMPLE_FLOAT_TO_12BIT(rect_float[3]);
+						premul_to_straight_v4_v4(from_straight, rect_float);
+						r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[0]));
+						g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[1]));
+						b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[2]));
+						a[i] = DOWNSAMPLE_FLOAT_TO_12BIT(from_straight[3]);
 					}
 					PIXEL_LOOPER_END;
 				}
 				else {
 					PIXEL_LOOPER_BEGIN(rect_float)
 					{
-						r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0]));
-						g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[1]));
-						b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[2]));
+						premul_to_straight_v4_v4(from_straight, rect_float);
+						r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[0]));
+						g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[1]));
+						b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[2]));
 					}
 					PIXEL_LOOPER_END;
 				}
@@ -712,19 +716,21 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
 				if (numcomps == 4) {
 					PIXEL_LOOPER_BEGIN(rect_float)
 					{
-						r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0]));
-						g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[1]));
-						b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[2]));
-						a[i] = DOWNSAMPLE_FLOAT_TO_16BIT(rect_float[3]);
+						premul_to_straight_v4_v4(from_straight, rect_float);
+						r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[0]));
+						g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[1]));
+						b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[2]));
+						a[i] = DOWNSAMPLE_FLOAT_TO_16BIT(from_straight[3]);
 					}
 					PIXEL_LOOPER_END;
 				}
 				else {
 					PIXEL_LOOPER_BEGIN(rect_float)
 					{
-						r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0]));
-						g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[1]));
-						b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[2]));
+						premul_to_straight_v4_v4(from_straight, rect_float);
+						r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[0]));
+						g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[1]));
+						b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[2]));
 					}
 					PIXEL_LOOPER_END;
 				}
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 18b08c9..1b7aa1e 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -882,6 +882,12 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
 	const char *token;
 	char tokenbuf[EXR_TOT_MAXNAME];
 	int len;
+	
+	/* some multilayers have the combined buffer with names A B G R saved */
+	if (name[1] == 0) {
+		echan->chan_id = name[0];
+		return 1;
+	}
 
 	/* last token is single character channel identifier */
 	len = imb_exr_split_token(name, end, &token);
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index bbe4313..cc73f68 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -60,6 +60,11 @@ static void ReadData(png_structp png_ptr, png_bytep data, png_size_t length);
 static void WriteData(png_structp png_ptr, png_bytep data, png_size_t length);
 static void Flush(png_structp png_ptr);
 
+BLI_INLINE unsigned short UPSAMPLE_8_TO_16(const unsigned char _val)
+{
+	return (_val << 8) + _val;
+}
+
 int imb_is_a_png(unsigned char *mem)
 {
 	int ret_val = 0;
@@ -102,6 +107,17 @@ static void ReadData(png_structp png_ptr, png_bytep data, png_size_t length)
 	longjmp(png_jmpbuf(png_ptr), 1);
 }
 
+static float channel_colormanage_noop(float value)
+{
+	return value;
+}
+
+/* wrap to avoid macro calling functions multiple times */
+BLI_INLINE unsigned short ftoshort(float val)
+{
+	return FTOUSHORT(val);
+}
+
 int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
 {
 	png_structp png_ptr;
@@ -115,13 +131,25 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
 	int i, bytesperpixel, color_type = PNG_COLOR_TYPE_GRAY;
 	FILE *fp = NULL;
 
-	int is_16bit = (ibuf->ftype & PNG_16BIT) && ibuf->rect_float;
+	bool is_16bit  = (ibuf->ftype & PNG_16BIT);
+	bool has_float = (ibuf->rect_float != NULL);
+
+	float (*chanel_colormanage_cb)(float);
 
 	/* use the jpeg quality setting for compression */
 	int compression;
 	compression = (int)(((float)(ibuf->ftype & 0xff) / 11.1111f));
 	compression = compression < 0 ? 0 : (compression > 9 ? 9 : compression);
 
+	if (ibuf->float_colorspace) {
+		/* float buffer was managed already, no need in color space conversion */
+		chanel_colormanage_cb = channel_colormanage_noop;
+	}
+	else {
+		/* standard linear-to-srgb conversion if float buffer wasn't managed */
+		chanel_colormanage_cb = linearrgb_to_srgb;
+	}
+
 	/* for prints */
 	if (flags & IB_mem)
 		name = "<memory>";
@@ -174,13 +202,24 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
 		case 4:
 			color_type = PNG_COLOR_TYPE_RGBA;
 			if (is_16bit) {
-				for (i = ibuf->x * ibuf->y; i > 0; i--) {
-					premul_to_straight_v4(from_straight, from_float);
-					to16[0] = FTOUSHORT(from_straight[0]);
-					to16[1] = FTOUSHORT(from_straight[1]);
-					to16[2] = FTOUSHORT(from_straight[2]);
-					to16[3] = FTOUSHORT(from_straight[3]);
-					to16 += 4; from_float += 4;
+				if (has_float) {
+					for (i = ibuf->x * ibuf->y; i > 0; i--) {
+						premul_to_straight_v4_v4(from_straight, from_float);
+						to16[0] = ftoshort(chanel_colormanage_cb(from_straight[0]));
+						to16[1] = ftoshort(chanel_colormanage_cb(from_straight[1]));
+						to16[2] = ftoshort(chanel_colormanage_cb(from_straight[2]));
+						to16[3] = ftoshort(chanel_colormanage_cb(from_straight[3]));
+						to16 += 4; from_float += 4;
+					}
+				}
+				else {
+					for (i = ibuf->x * ibuf->y; i > 0; i--) {
+						to16[0] = UPSAMPLE_8_TO_16(from[0]);
+						to16[1] = UPSAMPLE_8_TO_16(from[1]);
+						to16[2] = UPSAMPLE_8_TO_16(from[2]);
+						to16[3] = UPSAMPLE_8_TO_16(from[3]);
+						to16 += 4; from += 4;
+					}
 				}
 			}
 			else {
@@ -196,12 +235,22 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
 		case 3:
 			color_type = PNG_COLOR_TYPE_RGB;
 			if (is_16bit) {
-				for (i = ibuf->x * ibuf->y; i > 0; i--) {
-					premul_to_straight_v4(from_straight, from_float);
-					to16[0] = FTOUSHORT(from_straight[0]);
-					to16[1] = FTOUSHORT(from_straight[1]);
-					to16[2] = FTOUSHORT(from_straight[2]);
-					to16 += 3; from_float += 4;
+				if (has_float) {
+					for (i = ibuf->x * ibuf->y; i > 0; i--) {
+						premul_to_straight_v4_v4(from_straight, from_float);
+						to16[0] = ftoshort(chanel_colormanage_cb(from_straight[0]));
+						to16[1] = ftoshort(chanel_colormanage_cb(from_straight[1]));
+						to16[2] = ftoshort(chanel_colormanage_cb(from_straight[2]));
+						to16 += 3; from_float += 4;
+					}
+				}
+				else {
+					for (i = ibuf->x * ibuf->y; i > 0; i--) {
+						to16[0] = UPSAMPLE_8_TO_16(from[0]);
+						to16[1] = UPSAMPLE_8_TO_16(from[1]);
+						to16[2] = UPSAMPLE_8_TO_16(from[2]);
+						to16 += 3; from += 4;
+					}
 				}
 			}
 			else {
@@ -216,10 +265,18 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
 		case 1:
 			color_type = PNG_COLOR_TYPE_GRAY;
 			if (is_16bit) {
-				for (i = ibuf->x * ibuf->y; i > 0; i--) {
-					premul_to_straight_v4(from_straight, from_float);
-					to16[0] = FTOUSHORT(from_straight[0]);
-					to16++; from_float += 4;
+				if (has_float) {
+					for (i = ibuf->x * ibuf->y; i > 0; i--) {
+						premul_to_straight_v4_v4(from_straight, from_float);
+						to16[0] = ftoshort(chanel_colormanage_cb(from_straight[0]));
+						to16++; from_float += 4;
+					}
+				}
+				else {
+					for (i = ibuf->x * ibuf->y; i > 0; i--) {
+						to16[0] = UPSAMPLE_8_TO_16(from[0]);
+						to16++; from += 4;
+					}
 				}
 			}
 			else {
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index 00bc78e..4d47d88 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -75,6 +75,8 @@ ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, char co
 		if (type->load) {
 			ibuf = type->load(mem, size, flags, effective_colorspace);
 			if (ibuf) {
+				int alpha_flags;
+
 				if (colorspace) {
 					if (ibuf->rect) {
 						/* byte buffer is never internally converted to some standard space,
@@ -86,11 +88,16 @@ ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, char co
 					BLI_strncpy(colorspace, effective_colorspace, IM_MAX_SPACE);
 				}
 
+				if (flags & IB_alphamode_detect)
+					alpha_flags = ibuf->flags & IB_alphamode_premul;
+				else
+					alpha_flags = flags & IB_alphamode_premul;
+
 				if (flags & IB_ignore_alpha) {
 					IMB_rectfill_alpha(ibuf, 1.0f);
 				}
 				else {
-					if (flags & IB_alphamode_premul) {
+					if (alpha_flags & IB_alphamode_premul) {
 						if (ibuf->rect) {
 							IMB_unpremultiply_alpha(ibuf);
 						}
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index d2b0645..0b739b9 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -594,11 +594,13 @@ void IMB_rectfill_area(struct ImBuf *ibuf, const float col[4], int x1, int y1, i
 void IMB_rectfill_alpha(ImBuf *ibuf, const float value)
 {
 	int i;
-	if (ibuf->rect_float) {
+
+	if (ibuf->rect_float && (ibuf->channels == 4)) {
 		float *fbuf = ibuf->rect_float + 3;
 		for (i = ibuf->x * ibuf->y; i > 0; i--, fbuf += 4) { *fbuf = value; }
 	}
-	else {
+
+	if (ibuf->rect) {
 		const unsigned char cvalue = value * 255;
 		unsigned char *cbuf = ((unsigned char *)ibuf->rect) + 3;
 		for (i = ibuf->x * ibuf->y; i > 0; i--, cbuf += 4) { *cbuf = cvalue; }
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 94bb85b..c1d80ad 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -154,7 +154,7 @@ static void escape_uri_string(const char *string, char *escaped_string, int len,
 			*q++ = *p;
 		}
 	}
-  
+
 	*q = '\0';
 }
 
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 0c5e17c..91e9818 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -43,7 +43,8 @@ struct Library;
 struct FileData;
 struct ID;
 struct PackedFile;
-
+struct GPUTexture;
+	
 typedef struct IDPropertyData {
 	void *pointer;
 	ListBase group;
@@ -154,6 +155,7 @@ typedef struct PreviewImage {
 	short changed[2];
 	short changed_timestamp[2];
 	unsigned int *rect[2];
+	struct GPUTexture *gputexture[2];
 } PreviewImage;
 
 /**
@@ -231,7 +233,8 @@ typedef struct PreviewImage {
 #ifdef GS
 #  undef GS
 #endif
-#define GS(a)	(*((short *)(a)))
+// #define GS(a)	(*((short *)(a)))
+#define GS(a)	(CHECK_TYPE_INLINE(a, const char), (*((short *)(a))))
 
 #define ID_NEW(a)		if (      (a) && (a)->id.newid ) (a) = (void *)(a)->id.newid
 #define ID_NEW_US(a)	if (      (a)->id.newid)       { (a) = (void *)(a)->id.newid;       (a)->id.us++; }
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index b445d59..7c4772f 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -277,10 +277,13 @@ typedef struct bActuator {
 #define ACT_ANG_VEL_LOCAL		32
 //#define ACT_ADD_LIN_VEL_LOCAL	64
 #define ACT_ADD_LIN_VEL			64
+#define ACT_ADD_CHAR_LOC		128
+#define ACT_CHAR_JUMP			256
 
 /* objectactuator->type */
-#define ACT_OBJECT_NORMAL	0
-#define ACT_OBJECT_SERVO	1
+#define ACT_OBJECT_NORMAL		0
+#define ACT_OBJECT_SERVO		1
+#define ACT_OBJECT_CHARACTER	2
 
 /* actuator->type */
 #define ACT_OBJECT		0
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index e3571c7..62d696e 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -112,7 +112,7 @@ typedef enum BrushFlags {
 	BRUSH_SIZE_PRESSURE = (1 << 3),
 	BRUSH_JITTER_PRESSURE = (1 << 4),
 	BRUSH_SPACING_PRESSURE = (1 << 5),
-	BRUSH_FIXED_TEX = (1 << 6),
+	// BRUSH_FIXED_TEX = (1 << 6), /* obsolete, use mtex->brush_map_mode = MTEX_MAP_MODE_TILED instead */
 	BRUSH_RAKE = (1 << 7),
 	BRUSH_ANCHORED = (1 << 8),
 	BRUSH_DIR_IN = (1 << 9),
@@ -164,10 +164,12 @@ typedef enum BrushSculptTool {
 } BrushSculptTool;
 
 /* ImagePaintSettings.tool */
-#define PAINT_TOOL_DRAW     0
-#define PAINT_TOOL_SOFTEN   1
-#define PAINT_TOOL_SMEAR    2
-#define PAINT_TOOL_CLONE    3
+typedef enum BrushImagePaintTool {
+	PAINT_TOOL_DRAW = 0,
+	PAINT_TOOL_SOFTEN = 1,
+	PAINT_TOOL_SMEAR = 2,
+	PAINT_TOOL_CLONE = 3
+} BrushImagePaintTool;
 
 /* direction that the brush displaces along */
 enum {
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 0f47ee2..682f544 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -125,7 +125,7 @@ typedef struct Image {
 #define IMA_DO_PREMUL		4    /* deprecated, should not be used */
 #define IMA_REFLECT			16
 #define IMA_NOCOLLECT   	32
-#define IMA_DEPRECATED		64
+#define IMA_DONE_TAG		64
 #define IMA_OLD_PREMUL		128
 /*#define IMA_CM_PREDIVIDE	256*/  /* deprecated, should not be used */
 #define IMA_USED_FOR_RENDER	512
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 9a8d3bf..fceea39 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -309,7 +309,7 @@ typedef struct Material {
 #define MA_SPEC_WARDISO		4
 
 /* dynamode */
-#define MA_DRAW_DYNABUTS    1		/* deprecated */
+// #define MA_DRAW_DYNABUTS    1		/* deprecated */
 #define MA_FH_NOR	        2
 
 /* ramps */
@@ -373,7 +373,7 @@ typedef struct Material {
 #define MAP_AMB			2048
 #define MAP_DISPLACE	4096
 #define MAP_WARP		8192
-#define MAP_LAYER		16384		/* unused */
+// #define MAP_LAYER		16384		/* unused */
 
 /* volume mapto - reuse definitions for now - a bit naughty! */
 #define MAP_DENSITY				128
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 0c708dd..f2ee733 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -186,7 +186,7 @@ typedef struct TFace {
 #define ME_DRAWNORMALS	(1 << 2)
 #define ME_DRAW_VNORMALS (1 << 3)
 
-#define ME_ALLEDGES		(1 << 4)
+// #define ME_ALLEDGES		(1 << 4)
 #define ME_HIDDENEDGES  (1 << 5)
 
 #define ME_DRAWCREASES	(1 << 6)
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index ffa5e42..a189219 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -118,9 +118,14 @@ typedef struct MLoopUV {
 #define MLOOPUV_VERTSEL	2
 #define MLOOPUV_PINNED	4
 
-/* at the moment alpha is abused for vertex painting
- * and not used for transparency,
- * note that red and blue are _not_ swapped, as they are with #MCol */
+/**
+ * at the moment alpha is abused for vertex painting,
+ * otherwise it should _always_ be initialized to 255
+ * Mostly its not used for transparency...
+ * (except for blender-internal rendering, see [#34096]).
+ *
+ * \note red and blue are _not_ swapped, as they are with #MCol
+ */
 typedef struct MLoopCol {
 	char r, g, b, a;
 } MLoopCol;
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index 5b37ff5..56683bf 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -121,6 +121,8 @@ typedef struct MetaBall {
 #define MB_ELIPSOID	6
 #define MB_CUBE 	7
 
+#define MB_TYPE_SIZE_SQUARED(type)  (type == MB_ELIPSOID)
+
 /* ml->flag */
 #define MB_NEGATIVE	2
 #define MB_HIDE		8
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 089103c..117eac0 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -77,7 +77,8 @@ typedef enum ModifierType {
 	eModifierType_Skin              = 42,
 	eModifierType_LaplacianSmooth   = 43,
 	eModifierType_Triangulate       = 44,
-	eModifierType_UVWarp          = 45,
+	eModifierType_UVWarp            = 45,
+	eModifierType_MeshCache         = 46,
 	NUM_MODIFIER_TYPES
 } ModifierType;
 
@@ -1133,6 +1134,7 @@ enum {
 #define MOD_LAPLACIANSMOOTH_Y (1<<2)
 #define MOD_LAPLACIANSMOOTH_Z (1<<3)
 #define MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME (1 << 4)
+#define MOD_LAPLACIANSMOOTH_NORMALIZED (1 << 5)
 
 typedef struct LaplacianSmoothModifierData {
 	ModifierData modifier;
@@ -1157,4 +1159,64 @@ typedef struct UVWarpModifierData {
 	char uvlayer_name[64];  /* MAX_CUSTOMDATA_LAYER_NAME */
 } UVWarpModifierData;
 
+/* cache modifier */
+typedef struct MeshCacheModifierData {
+	ModifierData modifier;
+	char flag;
+	char type;  /* file format */
+	char time_mode;
+	char play_mode;
+
+	/* axis conversion */
+	char forward_axis;
+	char up_axis;
+	char flip_axis;
+
+	char interp;
+
+	float factor;
+	char deform_mode;
+	char pad[7];
+
+	/* play_mode == MOD_MESHCACHE_PLAY_CFEA */
+	float frame_start;
+	float frame_scale;
+
+	/* play_mode == MOD_MESHCACHE_PLAY_EVAL */
+	/* we could use one float for all these but their purpose is very different */
+	float eval_frame;
+	float eval_time;
+	float eval_factor;
+
+	char filepath[1024];	// FILE_MAX
+} MeshCacheModifierData;
+
+enum {
+	MOD_MESHCACHE_TYPE_MDD  = 1,
+	MOD_MESHCACHE_TYPE_PC2  = 2
+};
+
+enum {
+	MOD_MESHCACHE_DEFORM_OVERWRITE  = 0,
+	MOD_MESHCACHE_DEFORM_INTEGRATE  = 1
+};
+
+enum {
+	MOD_MESHCACHE_INTERP_NONE  = 0,
+	MOD_MESHCACHE_INTERP_LINEAR = 1,
+	// MOD_MESHCACHE_INTERP_CARDINAL  = 2
+};
+
+enum {
+	MOD_MESHCACHE_TIME_FRAME = 0,
+	MOD_MESHCACHE_TIME_SECONDS = 1,
+	MOD_MESHCACHE_TIME_FACTOR = 2,
+};
+
+enum {
+	MOD_MESHCACHE_PLAY_CFEA = 0,
+	MOD_MESHCACHE_PLAY_EVAL = 1,
+};
+
+
 #endif  /* __DNA_MODIFIER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index a05ff66..5aaf46a 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -309,9 +309,11 @@ typedef struct bNodeTree {
 #define NTREE_TYPE_INIT		1
 
 /* ntree->flag */
-#define NTREE_DS_EXPAND		1	/* for animation editors */
-#define NTREE_COM_OPENCL	2	/* use opencl */
-#define NTREE_TWO_PASS		4	/* two pass */
+#define NTREE_DS_EXPAND				1	/* for animation editors */
+#define NTREE_COM_OPENCL			2	/* use opencl */
+#define NTREE_TWO_PASS				4	/* two pass */
+#define NTREE_COM_GROUPNODE_BUFFER	8	/* use groupnode buffers */
+
 /* XXX not nice, but needed as a temporary flags
  * for group updates after library linking.
  */
@@ -711,6 +713,13 @@ typedef struct NodeTrackPosData {
 	char track_name[64];
 } NodeTrackPosData;
 
+typedef struct NodeTranslateData {
+	char wrap_axis;
+	char relative;
+	char pad[6];
+} NodeTranslateData;
+
+
 typedef struct NodeShaderScript {
 	int mode;
 	int flag;
@@ -837,6 +846,12 @@ typedef struct NodeShaderNormalMap {
 #define CMP_NODE_BLUR_ASPECT_Y			1
 #define CMP_NODE_BLUR_ASPECT_X			2
 
+/* wrapping */
+#define CMP_NODE_WRAP_NONE		0
+#define CMP_NODE_WRAP_X			1
+#define CMP_NODE_WRAP_Y			2
+#define CMP_NODE_WRAP_XY		3
+
 #define CMP_NODE_MASK_MBLUR_SAMPLES_MAX 64
 
 #endif
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 559ba44..de34f10 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -56,6 +56,7 @@ struct ParticleSystem;
 struct DerivedMesh;
 struct SculptSession;
 struct bGPdata;
+struct RigidBodyOb;
 
 
 /* Vertex Groups - Name Info */
@@ -170,7 +171,7 @@ typedef struct Object {
 	float sf; /* sf is time-offset */
 
 	short flag;			/* copy of Base */
-	short colbits DNA_DEPRECATED;		/* deprecated */
+	short colbits DNA_DEPRECATED;		/* deprecated, use 'matbits' */
 	
 	short transflag, protectflag;	/* transformation settings and transform locks  */
 	short trackflag, upflag;
@@ -218,10 +219,8 @@ typedef struct Object {
 	char boundtype;            /* bounding box use for drawing */
 	char collision_boundtype;  /* bounding box type used for collision */
 
-	char  restrictflag;	/* for restricting view, select, render etc. accessible in outliner */
-
+	short dtx;			/* viewport draw extra settings */
 	char dt;			/* viewport draw type */
-	char dtx;			/* viewport draw extra settings */
 	char empty_drawtype;
 	float empty_drawsize;
 	float dupfacesca;	/* dupliface scale */
@@ -241,8 +240,9 @@ typedef struct Object {
 
 	struct BulletSoftBody *bsoft;	/* settings for game engine bullet soft body */
 
+	char restrictflag;		/* for restricting view, select, render etc. accessible in outliner */
+	char recalc;			/* dependency flag */
 	short softflag;			/* softbody settings */
-	short recalc;			/* dependency flag */
 	float anisotropicFriction[3];
 
 	ListBase constraints;		/* object constraints */
@@ -271,6 +271,9 @@ typedef struct Object {
 	ListBase gpulamp;		/* runtime, for glsl lamp display only */
 	ListBase pc_ids;
 	ListBase *duplilist;	/* for temporary dupli list storage, only for use by RNA API */
+	
+	struct RigidBodyOb *rigidbody_object;		/* settings for Bullet rigid body */
+	struct RigidBodyCon *rigidbody_constraint;	/* settings for Bullet constraint */
 
 	float ima_ofs[2];		/* offset for image empties */
 } Object;
@@ -348,6 +351,9 @@ typedef struct DupliObject {
 #define OB_DATA_SUPPORT_ID(_id_type) \
 	(ELEM8(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_CA, ID_LT, ID_AR))
 
+#define OB_DATA_SUPPORT_ID_CASE \
+	ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_CA: case ID_LT: case ID_AR
+
 /* partype: first 4 bits: type */
 #define PARTYPE			15
 #define PAROBJECT		0
@@ -406,17 +412,19 @@ typedef struct DupliObject {
 
 #define OB_PAINT		100	/* temporary used in draw code */
 
-/* dtx: flags, char! */
-#define OB_AXIS			2
-#define OB_TEXSPACE		4
-#define OB_DRAWNAME		8
-#define OB_DRAWIMAGE	16
+/* dtx: flags (short) */
+#define OB_DRAWBOUNDOX		(1 << 0)
+#define OB_AXIS				(1 << 1)
+#define OB_TEXSPACE			(1 << 2)
+#define OB_DRAWNAME			(1 << 3)
+#define OB_DRAWIMAGE		(1 << 4)
 	/* for solid+wire display */
-#define OB_DRAWWIRE		32
-	/* for overdraw */
-#define OB_DRAWXRAY		64
+#define OB_DRAWWIRE			(1 << 5)
+	/* for overdraw s*/
+#define OB_DRAWXRAY			(1 << 6)
 	/* enable transparent draw */
-#define OB_DRAWTRANSP	128
+#define OB_DRAWTRANSP		(1 << 7)
+#define OB_DRAW_ALL_EDGES	(1 << 8)  /* only for meshes currently */
 
 /* empty_drawtype: no flags */
 #define OB_ARROWS		1
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
new file mode 100644
index 0000000..1636f2f
--- /dev/null
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -0,0 +1,280 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file DNA_rigidbody_types.h
+ *  \ingroup DNA
+ *  \brief Types and defines for representing Rigid Body entities
+ */
+
+#ifndef __DNA_RIGIDBODY_TYPES_H__
+#define __DNA_RIGIDBODY_TYPES_H__
+
+#include "DNA_listBase.h"
+
+struct Group;
+
+struct EffectorWeights;
+
+/* ******************************** */
+/* RigidBody World */
+
+/* RigidBodyWorld (rbw)
+ *
+ * Represents a "simulation scene" existing within the parent scene.
+ */
+typedef struct RigidBodyWorld {
+	/* Sim World Settings ------------------------------------------------------------- */
+	struct EffectorWeights *effector_weights; /* effectors info */
+
+	struct Group *group;		/* Group containing objects to use for Rigid Bodies */
+	struct Object **objects;	/* Array to access group objects by index, only used at runtime */
+	
+	struct Group *constraints;	/* Group containing objects to use for Rigid Body Constraints*/
+
+	int pad;
+	float ltime;				/* last frame world was evaluated for (internal) */
+	
+	/* cache */
+	struct PointCache *pointcache;
+	struct ListBase ptcaches;
+	int numbodies;              /* number of objects in rigid body group */
+	
+	short steps_per_second;		/* number of simulation steps thaken per second */
+	short num_solver_iterations;/* number of constraint solver iterations made per simulation step */
+	
+	int flag;					/* (eRigidBodyWorld_Flag) settings for this RigidBodyWorld */
+	float time_scale;			/* used to speed up or slow down the simulation */
+	
+	/* References to Physics Sim objects. Exist at runtime only ---------------------- */
+	void *physics_world;		/* Physics sim world (i.e. btDiscreteDynamicsWorld) */
+} RigidBodyWorld;
+
+/* Flags for RigidBodyWorld */
+typedef enum eRigidBodyWorld_Flag {
+	/* should sim world be skipped when evaluating (user setting) */
+	RBW_FLAG_MUTED				= (1 << 0),
+	/* sim data needs to be rebuilt */
+	RBW_FLAG_NEEDS_REBUILD		= (1 << 1),
+	/* usse split impulse when stepping the simulation */
+	RBW_FLAG_USE_SPLIT_IMPULSE	= (1 << 2),
+	/* need to step simulation after frame update */
+	RBW_FLAG_FRAME_UPDATE		= (1 << 3)
+} eRigidBodyWorld_Flag;
+
+/* ******************************** */
+/* RigidBody Object */
+
+/* RigidBodyObject (rbo)
+ *
+ * Represents an object participating in a RigidBody sim.
+ * This is attached to each object that is currently
+ * participating in a sim.
+ */
+typedef struct RigidBodyOb {
+	/* References to Physics Sim objects. Exist at runtime only */
+	void *physics_object;	/* Physics object representation (i.e. btRigidBody) */
+	void *physics_shape;	/* Collision shape used by physics sim (i.e. btCollisionShape) */
+	
+	/* General Settings for this RigidBodyOb */
+	short type;				/* (eRigidBodyOb_Type) role of RigidBody in sim  */
+	short shape;			/* (eRigidBody_Shape) collision shape to use */ 
+	
+	int flag;				/* (eRigidBodyOb_Flag) */
+	int col_groups;			/* Collision groups that determines wich rigid bodies can collide with each other */
+	int pad;
+	
+	/* Physics Parameters */
+	float mass;				/* how much object 'weighs' (i.e. absolute 'amount of stuff' it holds) */
+	
+	float friction;			/* resistance of object to movement */
+	float restitution;		/* how 'bouncy' object is when it collides */
+	
+	float margin;			/* tolerance for detecting collisions */ 
+	
+	float lin_damping;		/* damping for linear velocities */
+	float ang_damping;		/* damping for angular velocities */
+	
+	float lin_sleep_thresh;	/* deactivation threshold for linear velocities */
+	float ang_sleep_thresh;	/* deactivation threshold for angular velocities */
+	
+	float orn[4];			/* rigid body orientation */
+	float pos[3];			/* rigid body position */
+	float pad1;
+} RigidBodyOb;
+
+
+/* Participation types for RigidBodyOb */
+typedef enum eRigidBodyOb_Type {
+	/* active geometry participant in simulation. is directly controlled by sim */
+	RBO_TYPE_ACTIVE	= 0,
+	/* passive geometry participant in simulation. is directly controlled by animsys */
+	RBO_TYPE_PASSIVE
+} eRigidBodyOb_Type;
+
+/* Flags for RigidBodyOb */
+typedef enum eRigidBodyOb_Flag {
+	/* rigidbody is kinematic (controlled by the animation system) */
+	RBO_FLAG_KINEMATIC			= (1 << 0),
+	/* rigidbody needs to be validated (usually set after duplicating and not hooked up yet) */
+	RBO_FLAG_NEEDS_VALIDATE		= (1 << 1),
+	/* rigidbody shape needs refreshing (usually after exiting editmode) */
+	RBO_FLAG_NEEDS_RESHAPE		= (1 << 2),
+	/* rigidbody can be deactivated */
+	RBO_FLAG_USE_DEACTIVATION	= (1 << 3),
+	/* rigidbody is deactivated at the beginning of simulation */
+	RBO_FLAG_START_DEACTIVATED	= (1 << 4),
+	/* rigidbody is not dynamically simulated */
+	RBO_FLAG_DISABLED			= (1 << 5),
+	/* collision margin is not embedded (only used by convex hull shapes for now) */
+	RBO_FLAG_USE_MARGIN			= (1 << 6)
+} eRigidBodyOb_Flag;
+
+/* RigidBody Collision Shape */
+typedef enum eRigidBody_Shape {
+		/* simple box (i.e. bounding box) */
+	RB_SHAPE_BOX = 0,
+		/* sphere */
+	RB_SHAPE_SPHERE,
+		/* rounded "pill" shape (i.e. calcium tablets) */
+	RB_SHAPE_CAPSULE,
+		/* cylinder (i.e. pringles can) */
+	RB_SHAPE_CYLINDER,
+		/* cone (i.e. party hat) */
+	RB_SHAPE_CONE,
+	
+		/* convex hull (minimal shrinkwrap encompassing all verts) */
+	RB_SHAPE_CONVEXH,
+		/* triangulated mesh */
+	RB_SHAPE_TRIMESH,
+	
+		/* concave mesh approximated using primitives */
+	//RB_SHAPE_COMPOUND,
+} eRigidBody_Shape;
+
+/* ******************************** */
+/* RigidBody Constraint */
+
+/* RigidBodyConstraint (rbc)
+ *
+ * Represents an constraint connecting two rigid bodies.
+ */
+typedef struct RigidBodyCon {
+	struct Object *ob1;			/* First object influenced by the constraint */
+	struct Object *ob2;			/* Second object influenced by the constraint */
+
+	/* General Settings for this RigidBodyCon */
+	short type;					/* (eRigidBodyCon_Type) role of RigidBody in sim  */
+	short num_solver_iterations;/* number of constraint solver iterations made per simulation step */
+
+	int flag;					/* (eRigidBodyCon_Flag) */
+
+	float breaking_threshold;	/* breaking impulse threshold */
+	float pad;
+
+	/* limits */
+	float limit_lin_x_lower;	/* lower limit for x axis translation */
+	float limit_lin_x_upper;	/* upper limit for x axis translation */
+	float limit_lin_y_lower;	/* lower limit for y axis translation */
+	float limit_lin_y_upper;	/* upper limit for y axis translation */
+	float limit_lin_z_lower;	/* lower limit for z axis translation */
+	float limit_lin_z_upper;	/* upper limit for z axis translation */
+	float limit_ang_x_lower;	/* lower limit for x axis rotation */
+	float limit_ang_x_upper;	/* upper limit for x axis rotation */
+	float limit_ang_y_lower;	/* lower limit for y axis rotation */
+	float limit_ang_y_upper;	/* upper limit for y axis rotation */
+	float limit_ang_z_lower;	/* lower limit for z axis rotation */
+	float limit_ang_z_upper;	/* upper limit for z axis rotation */
+
+	/* spring settings */
+	/* RB_TODO document spring properties */
+	float spring_stiffness_x;
+	float spring_stiffness_y;
+	float spring_stiffness_z;
+	float spring_damping_x;
+	float spring_damping_y;
+	float spring_damping_z;
+
+	/* References to Physics Sim object. Exist at runtime only */
+	void *physics_constraint;	/* Physics object representation (i.e. btTypedConstraint) */
+} RigidBodyCon;
+
+
+/* Participation types for RigidBodyOb */
+typedef enum eRigidBodyCon_Type {
+	/* lets bodies rotate around a specified point */
+	RBC_TYPE_POINT = 0,
+	/* lets bodies rotate around a specified axis */
+	RBC_TYPE_HINGE,
+	/* simulates wheel suspension */
+	RBC_TYPE_HINGE2,
+	/* restricts movent to a specified axis */
+	RBC_TYPE_SLIDER,
+	/* lets object rotate within a cpecified cone */
+	RBC_TYPE_CONE_TWIST,
+	/* allows user to specify constraint axes */
+	RBC_TYPE_6DOF,
+	/* like 6DOF but has springs */
+	RBC_TYPE_6DOF_SPRING,
+	/* simulates a universal joint */
+	RBC_TYPE_UNIVERSAL,
+	/* glues two bodies together */
+	RBC_TYPE_FIXED,
+	/* similar to slider but also allows rotation around slider axis */
+	RBC_TYPE_PISTON,
+	/* Simplified spring constraint with only once axis that's automatically placed between the connected bodies */
+	RBC_TYPE_SPRING
+} eRigidBodyCon_Type;
+
+/* Flags for RigidBodyCon */
+typedef enum eRigidBodyCon_Flag {
+	/* constraint influences rigid body motion */
+	RBC_FLAG_ENABLED					= (1 << 0),
+	/* constraint needs to be validated */
+	RBC_FLAG_NEEDS_VALIDATE				= (1 << 1),
+	/* allow constrained bodies to collide */
+	RBC_FLAG_DISABLE_COLLISIONS			= (1 << 2),
+	/* constraint can break */
+	RBC_FLAG_USE_BREAKING				= (1 << 3),
+	/* constraint use custom number of constraint solver iterations */
+	RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS	= (1 << 4),
+	/* limits */
+	RBC_FLAG_USE_LIMIT_LIN_X			= (1 << 5),
+	RBC_FLAG_USE_LIMIT_LIN_Y			= (1 << 6),
+	RBC_FLAG_USE_LIMIT_LIN_Z			= (1 << 7),
+	RBC_FLAG_USE_LIMIT_ANG_X			= (1 << 8),
+	RBC_FLAG_USE_LIMIT_ANG_Y			= (1 << 9),
+	RBC_FLAG_USE_LIMIT_ANG_Z			= (1 << 10),
+	/* springs */
+	RBC_FLAG_USE_SPRING_X				= (1 << 11),
+	RBC_FLAG_USE_SPRING_Y				= (1 << 12),
+	RBC_FLAG_USE_SPRING_Z				= (1 << 13)
+} eRigidBodyCon_Flag;
+
+/* ******************************** */
+
+#endif /* __DNA_RIGIDBODY_TYPES_H__ */
+
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index c817546..b35323d 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -814,29 +814,11 @@ typedef struct Sculpt {
 	//char tablet_size, tablet_strength; XXX not used?
 	int radial_symm[3];
 
-	// all this below is used to communicate with the cursor drawing routine
-
-	/* record movement of mouse so that rake can start at an intuitive angle */
-	float last_x, last_y;
-	float last_angle;
-
-	int draw_anchored;
-	int   anchored_size;
-	float anchored_location[3];
-	float anchored_initial_mouse[2];
-
-	int draw_pressure;
-	float pressure_value;
-
-	float special_rotation;
-
 	/* Maximum edge length for dynamic topology sculpting (in pixels) */
 	int detail_size;
 
 	/* Direction used for SCULPT_OT_symmetrize operator */
 	int symmetrize_direction;
-
-	int pad;
 } Sculpt;
 
 typedef struct UvSculpt {
@@ -899,7 +881,24 @@ typedef struct UnifiedPaintSettings {
 
 	/* user preferences for sculpt and paint */
 	int flag;
-	int pad;
+
+	/* rake rotation */
+
+	/* record movement of mouse so that rake can start at an intuitive angle */
+	float last_x, last_y;
+	float last_angle;
+
+	float special_rotation;
+
+	// all this below is used to communicate with the cursor drawing routine
+	int draw_anchored;
+	int   anchored_size;
+	float anchored_location[3];
+	float anchored_initial_mouse[2];
+
+	/* drawing pressure */
+	int draw_pressure;
+	float pressure_value;
 } UnifiedPaintSettings;
 
 typedef enum {
@@ -1171,6 +1170,9 @@ typedef struct Scene {
 	ColorManagedViewSettings view_settings;
 	ColorManagedDisplaySettings display_settings;
 	ColorManagedColorspaceSettings sequencer_colorspace_settings;
+	
+	/* RigidBody simulation world+settings */
+	struct RigidBodyWorld *rigidbody_world;
 } Scene;
 
 
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index d6100dc..ceae4e2 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -142,9 +142,11 @@ typedef struct ScrArea {
 	short winx, winy;				/* size */
 	
 	short headertype;				/* OLD! 0=no header, 1= down, 2= up */
-	short pad;
 	short do_refresh;				/* private, for spacetype refresh callback */
-	short cursor, flag;
+	short flag;
+	short region_active_win;		/* index of last used region of 'RGN_TYPE_WINDOW'
+									 * runtuime variable, updated by executing operators */
+	short pad;
 	
 	struct SpaceType *type;		/* callbacks for this space type */
 	
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index d632a88..1dfcff4 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -434,7 +434,7 @@ typedef enum eScreen_Redraws_Flag {
 	TIME_WITH_SEQ_AUDIO    = (1 << 4), /* DEPRECATED */
 	TIME_SEQ               = (1 << 5),
 	TIME_ALL_IMAGE_WIN     = (1 << 6),
-	TIME_CONTINUE_PHYSICS  = (1 << 7),
+	TIME_CONTINUE_PHYSICS  = (1 << 7), /* UNUSED */
 	TIME_NODES             = (1 << 8),
 	TIME_CLIPS             = (1 << 9),
 } eScreen_Redraws_Flag;
@@ -447,6 +447,7 @@ typedef enum eTimeline_Cache_Flag {
 	TIME_CACHE_CLOTH         = (1 << 3),
 	TIME_CACHE_SMOKE         = (1 << 4),
 	TIME_CACHE_DYNAMICPAINT  = (1 << 5),
+	TIME_CACHE_RIGIDBODY     = (1 << 6),
 } eTimeline_Cache_Flag;
 
 
@@ -916,6 +917,7 @@ typedef enum eSpaceNode_Flag {
 	SNODE_AUTO_RENDER    = (1 << 5),
 	SNODE_SHOW_HIGHLIGHT = (1 << 6),
 	SNODE_USE_HIDDEN_PREVIEW = (1 << 10),
+	SNODE_NEW_SHADERS = (1 << 11),
 } eSpaceNode_Flag;
 
 /* snode->texfrom */
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 3027a3a..26b3378 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -66,7 +66,7 @@ typedef struct uiFont {
 	short blf_id;		/* from blfont lib */
 	short uifont_id;	/* own id */
 	short r_to_l;		/* fonts that read from left to right */
-	short pad;
+	short hinting;
 } uiFont;
 
 /* this state defines appearance of text */
@@ -250,7 +250,7 @@ typedef struct ThemeSpace {
 	char ds_channel[4], ds_subchannel[4]; /* dopesheet */
 	
 	char console_output[4], console_input[4], console_info[4], console_error[4];
-	char console_cursor[4];
+	char console_cursor[4], console_select[4], pad1[4];
 	
 	char vertex_size, outline_width, facedot_size;
 	char noodle_curving;
@@ -364,6 +364,9 @@ typedef struct SolidLight {
 } SolidLight;
 
 typedef struct UserDef {
+	/* UserDef has separate do-version handling, and can be read from other files */
+	int versionfile, subversionfile;
+	
 	int flag, dupflag;
 	int savetime;
 	char tempdir[768];	/* FILE_MAXDIR length */
@@ -568,7 +571,8 @@ typedef enum eUserpref_UI_Flag {
 /* uiflag2 */
 typedef enum eUserpref_UI_Flag2 {
 	USER_KEEP_SESSION		= (1 << 0),
-	USER_REGION_OVERLAP		= (1 << 1)
+	USER_REGION_OVERLAP		= (1 << 1),
+	USER_TRACKPAD_NATURAL	= (1 << 2)
 } eUserpref_UI_Flag2;
 	
 /* Auto-Keying mode */
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index dbe54a4..d9d6db5 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -46,6 +46,7 @@ struct RenderEngine;
 struct bGPdata;
 struct SmoothView3DStore;
 struct wmTimer;
+struct Material;
 
 /* This is needed to not let VC choke on near and far... old
  * proprietary MS extensions... */
@@ -160,8 +161,8 @@ typedef struct View3D {
 
 	float bundle_size;			/* size of bundles in reconstructed data */
 	short bundle_drawtype;		/* display style for bundle */
-
-	char pad[6];
+	short pad;
+	int matcap_icon;			/* icon id */
 	
 	unsigned int lay_used; /* used while drawing */
 	
@@ -209,11 +210,11 @@ typedef struct View3D {
 	
 	/* drawflags, denoting state */
 	short zbuf, transp, xray;
-
 	char pad3[2];
 
-	void *properties_storage;	/* Nkey panel stores stuff here (runtime only!) */
-
+	void *properties_storage;		/* Nkey panel stores stuff here (runtime only!) */
+	struct Material *defmaterial;	/* used by matcap now */
+	
 	/* XXX deprecated? */
 	struct bGPdata *gpd  DNA_DEPRECATED;		/* Grease-Pencil Data (annotation layers) */
 
@@ -264,12 +265,14 @@ typedef struct View3D {
 #define V3D_SOLID_TEX			8
 #define V3D_SHOW_GPENCIL		16
 #define V3D_LOCK_CAMERA			32
-#define V3D_RENDER_SHADOW		64 /* This is a runtime only flag that's used to tell draw_mesh_object() that we're doing a shadow pass instead of a regular draw */
-#define V3D_SHOW_RECONSTRUCTION		128
+#define V3D_RENDER_SHADOW		64		/* This is a runtime only flag that's used to tell draw_mesh_object() that we're doing a shadow pass instead of a regular draw */
+#define V3D_SHOW_RECONSTRUCTION	128
 #define V3D_SHOW_CAMERAPATH		256
 #define V3D_SHOW_BUNDLENAME		512
 #define V3D_BACKFACE_CULLING	1024
-#define V3D_RENDER_BORDER	2048
+#define V3D_RENDER_BORDER		2048
+#define V3D_SOLID_MATCAP		4096	/* user flag */
+#define V3D_SHOW_SOLID_MATCAP	8192	/* runtime flag */
 
 /* View3D->around */
 #define V3D_CENTER		 0
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index e131cde..31ff0ff 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -133,6 +133,7 @@ static const char *includefiles[] = {
 	"DNA_tracking_types.h",
 	"DNA_dynamicpaint_types.h",
 	"DNA_mask_types.h",
+	"DNA_rigidbody_types.h",
 
 	/* empty string to indicate end of includefiles */
 	""
@@ -1262,4 +1263,5 @@ int main(int argc, char **argv)
 #include "DNA_tracking_types.h"
 #include "DNA_dynamicpaint_types.h"
 #include "DNA_mask_types.h"
+#include "DNA_rigidbody_types.h"
 /* end of list */
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 29adb8f..e8c1a5d 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -92,6 +92,7 @@ extern StructRNA RNA_BoolProperty;
 extern StructRNA RNA_Brush;
 extern StructRNA RNA_BrushTextureSlot;
 extern StructRNA RNA_BuildModifier;
+extern StructRNA RNA_MeshCacheModifier;
 extern StructRNA RNA_Camera;
 extern StructRNA RNA_CastModifier;
 extern StructRNA RNA_ChildOfConstraint;
@@ -427,6 +428,8 @@ extern StructRNA RNA_RenderLayer;
 extern StructRNA RNA_RenderPass;
 extern StructRNA RNA_RenderResult;
 extern StructRNA RNA_RenderSettings;
+extern StructRNA RNA_RigidBodyWorld;
+extern StructRNA RNA_RigidBodyObject;
 extern StructRNA RNA_RigidBodyJointConstraint;
 extern StructRNA RNA_SPHFluidSettings;
 extern StructRNA RNA_Scene;
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index 463e0e0..5ab37c6 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -43,6 +43,7 @@ BlenderRNA *RNA_create(void);
 void RNA_define_free(BlenderRNA *brna);
 void RNA_free(BlenderRNA *brna);
 void RNA_define_verify_sdna(int verify);
+void RNA_define_animate_sdna(int animate);
 
 void RNA_init(void);
 void RNA_exit(void);
@@ -87,7 +88,6 @@ PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont, const char *identifier, c
 PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
 PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
 PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
-PropertyRNA *RNA_def_string_translate(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
 
 PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description);
 PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description);
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index 6733d8a..eabf039 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -102,6 +102,12 @@ extern EnumPropertyItem object_type_items[];
 
 extern EnumPropertyItem object_type_curve_items[];
 
+extern EnumPropertyItem rigidbody_ob_type_items[];
+extern EnumPropertyItem rigidbody_ob_shape_items[];
+extern EnumPropertyItem rigidbody_con_type_items[];
+
+extern EnumPropertyItem object_axis_items[];
+
 extern EnumPropertyItem controller_type_items[];
 
 extern EnumPropertyItem keymap_propvalue_items[];
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index c76f982..54d2efc 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -110,10 +110,9 @@ typedef enum PropertySubType {
 	PROP_FILEPATH = 1,
 	PROP_DIRPATH = 2,
 	PROP_FILENAME = 3,
-	PROP_BYTESTRING = 4, /* a string which should be represented as bytes
-	                      * in python, still NULL terminated though. */
-	PROP_TRANSLATE = 5, /* a string which should be translated */
-	PROP_PASSWORD = 6,	/* a string which should not be displayed in UI */
+	PROP_BYTESTRING = 4, /* a string which should be represented as bytes in python, still NULL terminated though. */
+	/* 5 was used by "PROP_TRANSLATE" sub-type, which is now a flag. */
+	PROP_PASSWORD = 6, /* a string which should not be displayed in UI */
 
 	/* numbers */
 	PROP_UNSIGNED = 13,
@@ -121,6 +120,7 @@ typedef enum PropertySubType {
 	PROP_FACTOR = 15,
 	PROP_ANGLE = 16 | PROP_UNIT_ROTATION,
 	PROP_TIME = 17 | PROP_UNIT_TIME,
+	/* distance in 3d space, don't use for pixel distance for eg. */
 	PROP_DISTANCE = 18 | PROP_UNIT_LENGTH,
 
 	/* number arrays */
@@ -135,7 +135,7 @@ typedef enum PropertySubType {
 	PROP_AXISANGLE = 28,
 	PROP_XYZ = 29,
 	PROP_XYZ_LENGTH = 29 | PROP_UNIT_LENGTH,
-	PROP_COLOR_GAMMA = 30,
+	PROP_COLOR_GAMMA = 30, /* used for colors which would be color managed before display */
 	PROP_COORDS = 31, /* generic array, no units applied, only that x/y/z/w are used (python vec) */
 
 	/* booleans */
@@ -144,6 +144,7 @@ typedef enum PropertySubType {
 } PropertySubType;
 
 /* Make sure enums are updated with thses */
+/* HIGHEST FLAG IN USE: 1 << 28 */
 typedef enum PropertyFlag {
 	/* editable means the property is editable in the user
 	 * interface, properties are editable by default except
@@ -337,8 +338,8 @@ typedef enum FunctionFlag {
 	FUNC_ALLOW_WRITE = 4096,
 
 	/* registering */
-	FUNC_REGISTER = 16,
-	FUNC_REGISTER_OPTIONAL = 16 | 32,
+	FUNC_REGISTER = 32,
+	FUNC_REGISTER_OPTIONAL = 32 | 64,
 
 	/* internal flags */
 	FUNC_BUILTIN = 128,
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript
index aab08a3..6031e79 100644
--- a/source/blender/makesrna/SConscript
+++ b/source/blender/makesrna/SConscript
@@ -46,6 +46,10 @@ defs = []
 if env['WITH_BF_SMOKE']:
     defs.append('WITH_SMOKE')
 
+if env['WITH_BF_BULLET']:
+    defs.append('WITH_BULLET')
+    incs += ' #/intern/rigidbody'
+
 if env['WITH_BF_OPENEXR']:
     defs.append('WITH_OPENEXR')
 
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 82c0757..7b6fb30 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -70,6 +70,7 @@ set(DEFSRC
 	rna_pose.c
 	rna_property.c
 	rna_render.c
+	rna_rigidbody.c
 	rna_rna.c
 	rna_scene.c
 	rna_screen.c
@@ -104,6 +105,7 @@ set(APISRC
 	rna_main_api.c
 	rna_material_api.c
 	rna_mesh_api.c
+	rna_meta_api.c
 	rna_texture_api.c
 	rna_object_api.c
 	rna_pose_api.c
@@ -237,6 +239,13 @@ if(WITH_INTERNATIONAL)
 	add_definitions(-DWITH_INTERNATIONAL)
 endif()
 
+if(WITH_BULLET)
+	list(APPEND INC
+		../../../../intern/rigidbody
+	)
+	add_definitions(-DWITH_BULLET)
+endif()
+
 # Build makesrna executable
 blender_include_dirs(
 	.
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index 5d60d41..f8608f0 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -65,7 +65,11 @@ incs += ' #/intern/smoke/extern'
 
 if env['WITH_BF_SMOKE']:
     defs.append('WITH_SMOKE')
-    
+
+if env['WITH_BF_BULLET']:
+    defs.append('WITH_BULLET')
+    incs += ' #/intern/rigidbody'
+
 if env['WITH_BF_OPENEXR']:
     defs.append('WITH_OPENEXR')
 
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 2eacdfd..95222a0 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1798,7 +1798,7 @@ static const char *rna_parameter_type_cpp_name(PropertyRNA *prop)
 	}
 }
 
-static void rna_def_struct_function_prototype_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc,
+static void rna_def_struct_function_prototype_cpp(FILE *f, StructRNA *UNUSED(srna), FunctionDefRNA *dfunc,
                                                   const char *namespace, int close_prototype)
 {
 	PropertyDefRNA *dp;
@@ -2444,7 +2444,6 @@ static const char *rna_property_subtypename(PropertySubType type)
 		case PROP_FILENAME: return "PROP_FILENAME";
 		case PROP_DIRPATH: return "PROP_DIRPATH";
 		case PROP_BYTESTRING: return "PROP_BYTESTRING";
-		case PROP_TRANSLATE: return "PROP_TRANSLATE";
 		case PROP_UNSIGNED: return "PROP_UNSIGNED";
 		case PROP_PERCENTAGE: return "PROP_PERCENTAGE";
 		case PROP_FACTOR: return "PROP_FACTOR";
@@ -2466,7 +2465,8 @@ static const char *rna_property_subtypename(PropertySubType type)
 		case PROP_LAYER: return "PROP_LAYER";
 		case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
 		case PROP_PASSWORD: return "PROP_PASSWORD";
-		default: {
+		default:
+		{
 			/* in case we don't have a type preset that includes the subtype */
 			if (RNA_SUBTYPE_UNIT(type)) {
 				return rna_property_subtypename(type & ~RNA_SUBTYPE_UNIT(type));
@@ -3248,7 +3248,7 @@ static RNAProcessItem PROCESS_ITEMS[] = {
 	{"rna_main.c", "rna_main_api.c", RNA_def_main},
 	{"rna_material.c", "rna_material_api.c", RNA_def_material},
 	{"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh},
-	{"rna_meta.c", NULL, RNA_def_meta},
+	{"rna_meta.c", "rna_meta_api.c", RNA_def_meta},
 	{"rna_modifier.c", NULL, RNA_def_modifier},
 	{"rna_nla.c", NULL, RNA_def_nla},
 	{"rna_nodetree.c", NULL, RNA_def_nodetree},
@@ -3259,6 +3259,7 @@ static RNAProcessItem PROCESS_ITEMS[] = {
 	{"rna_pose.c", "rna_pose_api.c", RNA_def_pose},
 	{"rna_property.c", NULL, RNA_def_gameproperty},
 	{"rna_render.c", NULL, RNA_def_render},
+	{"rna_rigidbody.c", NULL, RNA_def_rigidbody},
 	{"rna_scene.c", "rna_scene_api.c", RNA_def_scene},
 	{"rna_screen.c", NULL, RNA_def_screen},
 	{"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint},
@@ -3426,7 +3427,7 @@ static const char *cpp_classes = ""
 "namespace BL {\n"
 "\n"
 "#define BOOLEAN_PROPERTY(sname, identifier) \\\n"
-"	inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr)? true: false; } \\\n"
+"	inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr) ? true: false; } \\\n"
 "	inline void sname::identifier(int value) { sname##_##identifier##_set(&ptr, value); }\n"
 "\n"
 "#define BOOLEAN_ARRAY_PROPERTY(sname, size, identifier) \\\n"
@@ -3585,7 +3586,7 @@ static const char *cpp_classes = ""
 "public:\n"
 "	Pointer(const PointerRNA &p) : ptr(p) { }\n"
 "	operator const PointerRNA&() { return ptr; }\n"
-"	bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type)? true: false; }\n"
+"	bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type) ? true: false; }\n"
 "	operator void*() { return ptr.data; }\n"
 "	operator bool() { return ptr.data != NULL; }\n"
 "\n"
@@ -3881,6 +3882,13 @@ static int rna_preprocess(const char *outfile)
 		if (PROCESS_ITEMS[i].define) {
 			PROCESS_ITEMS[i].define(brna);
 
+			/* sanity check */
+			if (!DefRNA.animate) {
+				fprintf(stderr,
+				        "Error: DefRNA.animate left disabled in %s\n",
+				        PROCESS_ITEMS[i].filename);
+			}
+
 			for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
 				if (!ds->filename)
 					ds->filename = PROCESS_ITEMS[i].filename;
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 59bcb15..adfb096 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1505,7 +1505,7 @@ int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
 
 static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
 {
-	int is_rna = (prop->magic == RNA_MAGIC);
+	const bool is_rna = (prop->magic == RNA_MAGIC);
 	prop = rna_ensure_property(prop);
 
 	if (is_rna) {
@@ -1585,19 +1585,19 @@ static ListBase rna_updates_cache = {NULL, NULL};
 
 void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop)
 {
+	const bool is_rna = (prop->magic == RNA_MAGIC);
 	tRnaUpdateCacheElem *uce = NULL;
 	UpdateFunc fn = NULL;
 	LinkData *ld;
-	short is_rna = (prop->magic == RNA_MAGIC);
 	
 	/* sanity check */
-	if (ELEM(NULL, ptr, prop))
+	if (NULL == ptr)
 		return;
 		
 	prop = rna_ensure_property(prop);
 	
 	/* we can only handle update calls with no context args for now (makes animsys updates easier) */
-	if ((is_rna == 0) || (prop->update == NULL) || (prop->flag & PROP_CONTEXT_UPDATE))
+	if ((is_rna == false) || (prop->update == NULL) || (prop->flag & PROP_CONTEXT_UPDATE))
 		return;
 	fn = prop->update;
 		
@@ -3147,6 +3147,21 @@ int RNA_raw_type_sizeof(RawPropertyType type)
 	}
 }
 
+static int rna_property_array_length_all_dimensions(PointerRNA *ptr, PropertyRNA *prop)
+{
+	int i, len[RNA_MAX_ARRAY_DIMENSION];
+	const int dim = RNA_property_array_dimension(ptr, prop, len);
+	int size;
+
+	if (dim == 0)
+		return 0;
+
+	for (size = 1, i = 0; i < dim; i++)
+		size *= len[i];
+	
+	return size;
+}
+
 static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname,
                           void *inarray, RawPropertyType intype, int inlen, int set)
 {
@@ -3181,12 +3196,18 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
 			return 0;
 		}
 
-		/* check item array */
-		itemlen = RNA_property_array_length(&itemptr, itemprop);
-
+		/* dynamic array? need to get length per item */
+		if (itemprop->getlength) {
+			itemprop = NULL;
+		}
 		/* try to access as raw array */
-		if (RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
-			int arraylen = (itemlen == 0) ? 1 : itemlen;
+		else if (RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
+			int arraylen;
+
+			/* check item array */
+			itemlen = RNA_property_array_length(&itemptr, itemprop);
+
+			arraylen = (itemlen == 0) ? 1 : itemlen;
 			if (in.len != arraylen * out.len) {
 				BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)",
 				            out.len * arraylen, in.len);
@@ -3243,7 +3264,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
 					iprop = RNA_struct_find_property(&itemptr, propname);
 
 					if (iprop) {
-						itemlen = RNA_property_array_length(&itemptr, iprop);
+						itemlen = rna_property_array_length_all_dimensions(&itemptr, iprop);
 						itemtype = RNA_property_type(iprop);
 					}
 					else {
@@ -4210,11 +4231,11 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr)
 
 char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
 {
-	int is_rna = (prop->magic == RNA_MAGIC);
+	const bool is_rna = (prop->magic == RNA_MAGIC);
 	const char *propname;
 	char *ptrpath, *path;
 
-	if (!ptr->id.data || !ptr->data || !prop)
+	if (!ptr->id.data || !ptr->data)
 		return NULL;
 	
 	/* path from ID to the struct holding this property */
@@ -6097,7 +6118,8 @@ int RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop)
 
 	/* get and set the default values as appropriate for the various types */
 	switch (RNA_property_type(prop)) {
-		case PROP_BOOLEAN: {
+		case PROP_BOOLEAN:
+		{
 			if (len) {
 				int fixed_a[16], fixed_b[16];
 				int *array_a, *array_b;
@@ -6122,7 +6144,8 @@ int RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop)
 			}
 		}
 
-		case PROP_INT: {
+		case PROP_INT:
+		{
 			if (len) {
 				int fixed_a[16], fixed_b[16];
 				int *array_a, *array_b;
@@ -6147,7 +6170,8 @@ int RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop)
 			}
 		}
 
-		case PROP_FLOAT: {
+		case PROP_FLOAT:
+		{
 			if (len) {
 				float fixed_a[16], fixed_b[16];
 				float *array_a, *array_b;
@@ -6172,12 +6196,14 @@ int RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop)
 			}
 		}
 
-		case PROP_ENUM: {
+		case PROP_ENUM:
+		{
 			int value = RNA_property_enum_get(a, prop);
 			return value == RNA_property_enum_get(b, prop);
 		}
 
-		case PROP_STRING: {
+		case PROP_STRING:
+		{
 			char fixed_a[128], fixed_b[128];
 			int len_a, len_b;
 			char *value_a = RNA_property_string_get_alloc(a, prop, fixed_a, sizeof(fixed_a), &len_a);
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 07c394a..bf6faa3 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -39,6 +39,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_utildefines.h"
+
 #include "BKE_action.h"
 
 #include "WM_types.h"
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index b653289..fe4a23c 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -389,6 +389,12 @@ static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value)
 				oa->forcerot[1] = 0.5f;
 				oa->forcerot[2] = 0.0f;
 				break;
+
+			case ACT_OBJECT_CHARACTER:
+				memset(oa, 0, sizeof(bObjectActuator));
+				oa->flag = ACT_DLOC_LOCAL | ACT_DROT_LOCAL;
+				oa->type = ACT_OBJECT_CHARACTER;
+				break;
 		}
 	}
 }
@@ -701,6 +707,7 @@ static void rna_def_object_actuator(BlenderRNA *brna)
 	static EnumPropertyItem prop_type_items[] = {
 		{ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""},
 		{ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""},
+		{ACT_OBJECT_CHARACTER, "OBJECT_CHARACTER", 0, "Character Motion", ""},
 		{0, NULL, 0, NULL, NULL}
 	};
 
@@ -867,6 +874,11 @@ static void rna_def_object_actuator(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET linV");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
+	prop = RNA_def_property(srna, "use_add_character_location", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_CHAR_LOC);
+	RNA_def_property_ui_text(prop, "Add", "Toggle between ADD and SET character location");
+	RNA_def_property_update(prop, NC_LOGIC, NULL);
+
 	prop = RNA_def_property(srna, "use_servo_limit_x", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_X);
 	RNA_def_property_ui_text(prop, "X", "Set limit to force along the X axis");
@@ -881,6 +893,11 @@ static void rna_def_object_actuator(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Z);
 	RNA_def_property_ui_text(prop, "Z", "Set limit to force along the Z axis");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+	prop = RNA_def_property(srna, "use_character_jump", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CHAR_JUMP);
+	RNA_def_property_ui_text(prop, "Jump", "Make the character jump using the settings in the physics properties");
+	RNA_def_property_update(prop, NC_LOGIC, NULL);
 }
 
 static void rna_def_camera_actuator(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 3d5106b..c995d3b 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -429,6 +429,13 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna)
 		{0, NULL, 0, NULL, NULL}
 	};
 
+	static EnumPropertyItem prop_tex_paint_map_mode_items[] = {
+		{MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
+		{MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
+		{MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
+		{0, NULL, 0, NULL, NULL}
+	};
+
 	srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
 	RNA_def_struct_sdna(srna, "MTex");
 	RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush datablock");
@@ -444,6 +451,12 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna)
 	RNA_def_property_enum_items(prop, prop_map_mode_items);
 	RNA_def_property_ui_text(prop, "Mode", "");
 	RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
+
+	prop = RNA_def_property(srna, "tex_paint_map_mode", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
+	RNA_def_property_enum_items(prop, prop_tex_paint_map_mode_items);
+	RNA_def_property_ui_text(prop, "Mode", "");
+	RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
 }
 
 static void rna_def_sculpt_capabilities(BlenderRNA *brna)
@@ -605,7 +618,7 @@ static void rna_def_brush(BlenderRNA *brna)
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 	
 	/* number values */
-	prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+	prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
 	RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);
 	RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS * 10);
 	RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
@@ -632,7 +645,7 @@ static void rna_def_brush(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 
-	prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_DISTANCE);
+	prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE);
 	RNA_def_property_range(prop, 10, 200);
 	RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
@@ -855,11 +868,6 @@ static void rna_def_brush(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH);
 	RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
-
-	prop = RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
-	RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position");
-	RNA_def_property_update(prop, 0, "rna_Brush_update");
 	
 	/* only for projection paint, TODO, other paint modes */
 	prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 9ce3b31..c70dc28 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -848,7 +848,7 @@ static void rna_def_histogram(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "show_line", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", HISTO_FLAG_LINE);
-	RNA_def_property_ui_text(prop, "Show Line", "Display lines rather then filled shapes");
+	RNA_def_property_ui_text(prop, "Show Line", "Display lines rather than filled shapes");
 	RNA_def_property_ui_icon(prop, ICON_IPO, 0);
 }
 
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 21aed20..8f8136b 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -460,7 +460,7 @@ static void rna_Curve_body_set(PointerRNA *ptr, const char *value)
 	/* don't know why this is +4, just duplicating load_editText() */
 	cu->strinfo = MEM_callocN((len + 4) * sizeof(CharInfo), "strinfo");
 
-	/*BLI_strncpy_wchar_as_utf8(cu->str, value, len+1);  *//* value is not wchar_t */
+	/*BLI_strncpy_wchar_as_utf8(cu->str, value, len + 1);  *//* value is not wchar_t */
 	BLI_strncpy(cu->str, value, len + 1);
 }
 
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index b94d7eb..97ef4df 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -61,7 +61,7 @@
 
 /* Global used during defining */
 
-BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
+BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1, 1};
 
 /* Duplicated code since we can't link in blenkernel or blenlib */
 
@@ -506,6 +506,13 @@ void RNA_define_verify_sdna(int verify)
 	DefRNA.verify = verify;
 }
 
+#ifndef RNA_RUNTIME
+void RNA_define_animate_sdna(int animate)
+{
+	DefRNA.animate = animate;
+}
+#endif
+
 void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
 {
 #ifdef RNA_RUNTIME
@@ -964,6 +971,14 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
 		{
 			IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
 
+#ifndef RNA_RUNTIME
+			if (subtype == PROP_DISTANCE) {
+				fprintf(stderr, "%s: subtype does not apply to 'PROP_INT' \"%s.%s\"\n", __func__,
+				        CONTAINER_RNA_ID(cont), identifier);
+				DefRNA.error = 1;
+			}
+#endif
+
 			iprop->hardmin = (subtype == PROP_UNSIGNED) ? 0 : INT_MIN;
 			iprop->hardmax = INT_MAX;
 
@@ -1031,8 +1046,15 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
 	if (type != PROP_COLLECTION && type != PROP_POINTER) {
 		prop->flag = PROP_EDITABLE;
 	
-		if (type != PROP_STRING)
+		if (type != PROP_STRING) {
+#ifdef RNA_RUNTIME
 			prop->flag |= PROP_ANIMATABLE;
+#else
+			if (DefRNA.animate) {
+				prop->flag |= PROP_ANIMATABLE;
+			}
+#endif
+		}
 	}
 
 	if (type == PROP_STRING) {
@@ -1210,6 +1232,15 @@ void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
 		prop->flag |= PROP_ICONS_CONSECUTIVE;
 }
 
+/**
+ * The values hare are a little confusing:
+ *
+ * \param step For floats this is (step / 100), why /100? - nobody knows.
+ * for int's, whole values are used.
+ *
+ * \param precision The number of zeros to show
+ * (as a whole number - common range is 1 - 6), see PRECISION_FLOAT_MAX
+ */
 void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
 {
 	StructRNA *srna = DefRNA.laststruct;
@@ -1230,6 +1261,21 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double
 			fprop->softmax = (float)max;
 			fprop->step = (float)step;
 			fprop->precision = (int)precision;
+#if 0 /* handy but annoying */
+			if (DefRNA.preprocess) {
+				/* check we're not over PRECISION_FLOAT_MAX */
+				if (fprop->precision > 6) {
+					fprintf(stderr, "%s: \"%s.%s\", precision value over maximum.\n",
+					        __func__, srna->identifier, prop->identifier);
+					DefRNA.error = 1;
+				}
+				else if (fprop->precision < 1) {
+					fprintf(stderr, "%s: \"%s.%s\", precision value under minimum.\n",
+					        __func__, srna->identifier, prop->identifier);
+					DefRNA.error = 1;
+				}
+			}
+#endif
 			break;
 		}
 		default:
@@ -2096,6 +2142,7 @@ void RNA_def_property_int_funcs_runtime(PropertyRNA *prop, IntPropertyGetFunc ge
 
 	if (getfunc) iprop->get_ex = getfunc;
 	if (setfunc) iprop->set_ex = setfunc;
+	if (rangefunc) iprop->range_ex = rangefunc;
 
 	if (getfunc || setfunc) {
 		/* don't save in id properties */
@@ -2112,6 +2159,7 @@ void RNA_def_property_int_array_funcs_runtime(PropertyRNA *prop, IntArrayPropert
 
 	if (getfunc) iprop->getarray_ex = getfunc;
 	if (setfunc) iprop->setarray_ex = setfunc;
+	if (rangefunc) iprop->range_ex = rangefunc;
 
 	if (getfunc || setfunc) {
 		/* don't save in id properties */
@@ -2534,20 +2582,6 @@ PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *id
 	return prop;
 }
 
-PropertyRNA *RNA_def_string_translate(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value,
-                                      int maxlen, const char *ui_name, const char *ui_description)
-{
-	ContainerRNA *cont = cont_;
-	PropertyRNA *prop;
-
-	prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_TRANSLATE);
-	if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
-	if (default_value) RNA_def_property_string_default(prop, default_value);
-	RNA_def_property_ui_text(prop, ui_name, ui_description);
-
-	return prop;
-}
-
 PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items,
                           int default_value, const char *ui_name, const char *ui_description)
 {
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 4250acf..82e2cb3 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -633,6 +633,81 @@ static void rna_fcurve_range(FCurve *fcu, float range[2])
 	calc_fcurve_range(fcu, range, range + 1, FALSE, FALSE);
 }
 
+
+static FCM_EnvelopeData *rna_FModifierEnvelope_points_add(FModifier *fmod, ReportList *reports, float frame)
+{
+	FCM_EnvelopeData fed;
+	FMod_Envelope *env = (FMod_Envelope *)fmod->data;
+	int i;
+
+	/* init template data */
+	fed.min = -1.0f;
+	fed.max = 1.0f;
+	fed.time = frame;
+	fed.f1 = fed.f2 = 0;
+
+	if (env->data) {
+		short exists = -1;
+		i = BKE_fcm_envelope_find_index(env->data, frame, env->totvert, &exists);
+		if (exists) {
+			BKE_reportf(reports, RPT_ERROR, "Already a control point at frame %.6f", frame);
+			return NULL;
+		}
+
+		/* realloc memory for extra point */
+		env->data = (FCM_EnvelopeData *) MEM_reallocN((void *)env->data, (env->totvert + 1) * sizeof(FCM_EnvelopeData));
+
+		/* move the points after the added point */
+		if (i < env->totvert) {
+			memmove(env->data + i + 1, env->data + i, (env->totvert - i) * sizeof(FCM_EnvelopeData));
+		}
+
+		env->totvert++;
+	}
+	else {
+		env->data = MEM_mallocN(sizeof(FCM_EnvelopeData), "FCM_EnvelopeData");
+		env->totvert = 1;
+		i = 0;
+	}
+
+	/* add point to paste at index i */
+	*(env->data + i) = fed;
+	return (env->data + i);
+}
+
+void rna_FModifierEnvelope_points_remove(FModifier *fmod, ReportList *reports, PointerRNA *point)
+{
+	FCM_EnvelopeData *cp = point->data;
+	FMod_Envelope *env = (FMod_Envelope *)fmod->data;
+
+	int index = (int)(cp - env->data);
+
+	/* test point is in range */
+	if (index < 0 || index >= env->totvert) {
+		BKE_report(reports, RPT_ERROR, "Control point not in Envelope F-Modifier");
+		return;
+	}
+
+	if (env->totvert > 1) {
+		/* move data after the removed point */
+
+		memmove(env->data + index, env->data + (index + 1), sizeof(FCM_EnvelopeData) * ((env->totvert - index) - 1));
+
+		/* realloc smaller array */
+		env->totvert--;
+		env->data = (FCM_EnvelopeData *) MEM_reallocN((void *)env->data, (env->totvert) * sizeof(FCM_EnvelopeData));
+	}
+	else {
+		/* just free array, since the only vert was deleted */
+		if (env->data) {
+			MEM_freeN(env->data);
+			env->data = NULL;
+		}
+		env->totvert = 0;
+	}
+	RNA_POINTER_INVALIDATE(point);
+}
+
 #else
 
 static void rna_def_fmodifier_generator(BlenderRNA *brna)
@@ -770,6 +845,36 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
 	/*	- selection flags (not implemented in UI yet though) */
 }
 
+static void rna_def_fmodifier_envelope_control_points(BlenderRNA *brna, PropertyRNA *cprop)
+{
+	StructRNA *srna;
+
+	FunctionRNA *func;
+	PropertyRNA *parm;
+
+	RNA_def_property_srna(cprop, "FModifierEnvelopeControlPoints");
+	srna = RNA_def_struct(brna, "FModifierEnvelopeControlPoints", NULL);
+	RNA_def_struct_sdna(srna, "FModifier");
+
+	RNA_def_struct_ui_text(srna, "Control Points", "Control points defining the shape of the envelope");
+
+	func = RNA_def_function(srna, "add", "rna_FModifierEnvelope_points_add");
+	RNA_def_function_ui_description(func, "Add a control point to a FModifierEnvelope");
+	RNA_def_function_flag(func, FUNC_USE_REPORTS);
+	parm = RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "",
+	                     "Frame to add this control-point", -FLT_MAX, FLT_MAX);
+	RNA_def_property_flag(parm, PROP_REQUIRED);
+	parm = RNA_def_pointer(func, "point", "FModifierEnvelopeControlPoint", "", "Newly created control-point");
+	RNA_def_function_return(func, parm);
+
+	func = RNA_def_function(srna, "remove", "rna_FModifierEnvelope_points_remove");
+	RNA_def_function_ui_description(func, "Remove a control-point from an FModifierEnvelope");
+	RNA_def_function_flag(func, FUNC_USE_REPORTS);
+	parm = RNA_def_pointer(func, "point", "FModifierEnvelopeControlPoint", "", "Control-point to remove");
+	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
+}
+
+
 static void rna_def_fmodifier_envelope(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -784,6 +889,7 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna)
 	RNA_def_property_collection_sdna(prop, NULL, "data", "totvert");
 	RNA_def_property_struct_type(prop, "FModifierEnvelopeControlPoint");
 	RNA_def_property_ui_text(prop, "Control Points", "Control points defining the shape of the envelope");
+	rna_def_fmodifier_envelope_control_points(brna, prop);
 	
 	/* Range Settings */
 	prop = RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index b3c1f4d..9461a81 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -118,7 +118,7 @@ static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count)
 		if (stroke->points == NULL)
 			stroke->points = MEM_callocN(sizeof(bGPDspoint) * count, "gp_stroke_points");
 		else
-			stroke->points = MEM_reallocN(stroke->points, sizeof(bGPDspoint) * (stroke->totpoints + count));
+			stroke->points = MEM_recallocN(stroke->points, sizeof(bGPDspoint) * (stroke->totpoints + count));
 
 		stroke->totpoints += count;
 	}
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 11510b7..72e27ba 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -88,11 +88,15 @@ static int rna_Image_dirty_get(PointerRNA *ptr)
 	return 0;
 }
 
-static void rna_Image_source_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+static void rna_Image_source_set(PointerRNA *ptr, int value)
 {
 	Image *ima = ptr->id.data;
-	BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
-	DAG_id_tag_update(&ima->id, 0);
+
+	if (value != ima->source) {
+		ima->source = value;
+		BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
+		DAG_id_tag_update(&ima->id, 0);
+	}
 }
 
 static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@ -427,6 +431,11 @@ static void rna_def_imageuser(BlenderRNA *brna)
 	RNA_def_property_update(prop, 0, "rna_ImageUser_update");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 
+	prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
+	RNA_def_property_int_sdna(prop, NULL, "framenr");
+	RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
+	RNA_def_property_ui_text(prop, "Current Frame", "Current frame number in image sequence or movie");
+
 	/* animation */
 	prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
@@ -522,9 +531,9 @@ static void rna_def_image(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_items(prop, image_source_items);
-	RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf");
+	RNA_def_property_enum_funcs(prop, NULL, "rna_Image_source_set", "rna_Image_source_itemf");
 	RNA_def_property_ui_text(prop, "Source", "Where the image comes from");
-	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_source_update");
+	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);
 
 	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_items(prop, prop_type_items);
@@ -709,7 +718,7 @@ static void rna_def_image(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "channels", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_int_funcs(prop, "rna_Image_channels_get", NULL, NULL);
-	RNA_def_property_ui_text(prop, "Channels", "Number of channels in pixels nuffer");
+	RNA_def_property_ui_text(prop, "Channels", "Number of channels in pixels buffer");
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 
 	prop = RNA_def_property(srna, "is_float", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index 686e6c8..5d45e0d 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -318,9 +318,9 @@ void RNA_api_image(StructRNA *srna)
 	RNA_def_function_ui_description(func, "Delay the image from being cleaned from the cache due inactivity");
 	RNA_def_function_flag(func, FUNC_USE_REPORTS);
 	RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter",
-	            "The texture minifying function to use if the image wan't loaded", -INT_MAX, INT_MAX);
+	            "The texture minifying function to use if the image wasn't loaded", -INT_MAX, INT_MAX);
 	RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification",
-	            "The texture magnification function to use if the image wan't loaded", -INT_MAX, INT_MAX);
+	            "The texture magnification function to use if the image wasn't loaded", -INT_MAX, INT_MAX);
 	/* return value */
 	parm = RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX);
 	RNA_def_function_return(func, parm);
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 6520f22..9161f79 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -117,7 +117,7 @@ typedef struct BlenderDefRNA {
 	ListBase structs;
 	ListBase allocs;
 	struct StructRNA *laststruct;
-	int error, silent, preprocess, verify;
+	int error, silent, preprocess, verify, animate;
 } BlenderDefRNA;
 
 extern BlenderDefRNA DefRNA;
@@ -164,6 +164,7 @@ void RNA_def_packedfile(struct BlenderRNA *brna);
 void RNA_def_particle(struct BlenderRNA *brna);
 void RNA_def_pose(struct BlenderRNA *brna);
 void RNA_def_render(struct BlenderRNA *brna);
+void RNA_def_rigidbody(struct BlenderRNA *brna);
 void RNA_def_rna(struct BlenderRNA *brna);
 void RNA_def_scene(struct BlenderRNA *brna);
 void RNA_def_screen(struct BlenderRNA *brna);
@@ -263,6 +264,7 @@ void RNA_api_keymapitems(struct StructRNA *srna);
 void RNA_api_main(struct StructRNA *srna);
 void RNA_api_material(StructRNA *srna);
 void RNA_api_mesh(struct StructRNA *srna);
+void RNA_api_meta(struct StructRNA *srna);
 void RNA_api_object(struct StructRNA *srna);
 void RNA_api_object_base(struct StructRNA *srna);
 void RNA_api_pose(struct StructRNA *srna);
@@ -397,6 +399,10 @@ PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *
 int rna_parameter_size(struct PropertyRNA *parm);
 int rna_parameter_size_alloc(struct PropertyRNA *parm);
 
+struct Mesh *rna_Main_meshes_new_from_object(
+        struct Main *bmain, struct ReportList *reports, struct Scene *sce,
+        struct Object *ob, int apply_modifiers, int settings, int calc_tessface);
+
 /* XXX, these should not need to be defined here~! */
 struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports);
 struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index cc74fce..7175c8e 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -34,8 +34,10 @@
 #include <errno.h>
 
 #include "DNA_ID.h"
+#include "DNA_modifier_types.h"
 
 #include "BLI_path_util.h"
+#include "BLI_utildefines.h"
 
 #include "RNA_define.h"
 #include "RNA_access.h"
@@ -48,6 +50,8 @@
 #include "BKE_main.h"
 #include "BKE_camera.h"
 #include "BKE_curve.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_displist.h"
 #include "BKE_mesh.h"
 #include "BKE_armature.h"
 #include "BKE_lamp.h"
@@ -99,9 +103,9 @@
 
 #include "BLF_translation.h"
 
-static Camera *rna_Main_cameras_new(Main *UNUSED(bmain), const char *name)
+static Camera *rna_Main_cameras_new(Main *bmain, const char *name)
 {
-	ID *id = BKE_camera_add(name);
+	ID *id = BKE_camera_add(bmain, name);
 	id_us_min(id);
 	return (Camera *)id;
 }
@@ -144,7 +148,7 @@ static void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports
 	}
 }
 
-static Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const char *name, ID *data)
+static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
 {
 	Object *ob;
 	int type = OB_EMPTY;
@@ -189,7 +193,7 @@ static Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, co
 		id_us_plus(data);
 	}
 
-	ob = BKE_object_add_only_object(type, name);
+	ob = BKE_object_add_only_object(bmain, type, name);
 	id_us_min(&ob->id);
 
 	ob->data = data;
@@ -212,9 +216,9 @@ static void rna_Main_objects_remove(Main *bmain, ReportList *reports, PointerRNA
 	}
 }
 
-static Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name)
+static Material *rna_Main_materials_new(Main *bmain, const char *name)
 {
-	ID *id = (ID *)BKE_material_add(name);
+	ID *id = (ID *)BKE_material_add(bmain, name);
 	id_us_min(id);
 	return (Material *)id;
 }
@@ -231,9 +235,9 @@ static void rna_Main_materials_remove(Main *bmain, ReportList *reports, PointerR
 	}
 }
 
-static bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, int type)
+static bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
 {
-	bNodeTree *tree = ntreeAddTree(name, type, NODE_GROUP);
+	bNodeTree *tree = ntreeAddTree(bmain, name, type, NODE_GROUP);
 
 	id_us_min(&tree->id);
 	return tree;
@@ -251,12 +255,211 @@ static void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, PointerRN
 	}
 }
 
-static Mesh *rna_Main_meshes_new(Main *UNUSED(bmain), const char *name)
+static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
 {
-	Mesh *me = BKE_mesh_add(name);
+	Mesh *me = BKE_mesh_add(bmain, name);
 	id_us_min(&me->id);
 	return me;
 }
+
+/* copied from Mesh_getFromObject and adapted to RNA interface */
+/* settings: 1 - preview, 2 - render */
+Mesh *rna_Main_meshes_new_from_object(
+        Main *bmain, ReportList *reports, Scene *sce,
+        Object *ob, int apply_modifiers, int settings, int calc_tessface)
+{
+	Mesh *tmpmesh;
+	Curve *tmpcu = NULL, *copycu;
+	Object *tmpobj = NULL;
+	int render = settings == eModifierMode_Render, i;
+	int cage = !apply_modifiers;
+
+	/* perform the mesh extraction based on type */
+	switch (ob->type) {
+		case OB_FONT:
+		case OB_CURVE:
+		case OB_SURF:
+		{
+			ListBase dispbase = {NULL, NULL};
+			DerivedMesh *derivedFinal = NULL;
+			int uv_from_orco;
+
+			/* copies object and modifiers (but not the data) */
+			tmpobj = BKE_object_copy_ex(bmain, ob, TRUE);
+			tmpcu = (Curve *)tmpobj->data;
+			tmpcu->id.us--;
+
+			/* if getting the original caged mesh, delete object modifiers */
+			if (cage)
+				BKE_object_free_modifiers(tmpobj);
+
+			/* copies the data */
+			copycu = tmpobj->data = BKE_curve_copy((Curve *) ob->data);
+
+			/* temporarily set edit so we get updates from edit mode, but
+			 * also because for text datablocks copying it while in edit
+			 * mode gives invalid data structures */
+			copycu->editfont = tmpcu->editfont;
+			copycu->editnurb = tmpcu->editnurb;
+
+			/* get updated display list, and convert to a mesh */
+			BKE_displist_make_curveTypes_forRender(sce, tmpobj, &dispbase, &derivedFinal, FALSE);
+
+			copycu->editfont = NULL;
+			copycu->editnurb = NULL;
+
+			tmpobj->derivedFinal = derivedFinal;
+
+			/* convert object type to mesh */
+			uv_from_orco = (tmpcu->flag & CU_UV_ORCO) != 0;
+			BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco);
+
+			tmpmesh = tmpobj->data;
+
+			BKE_displist_free(&dispbase);
+
+			/* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */
+			if (tmpobj->type != OB_MESH) {
+				BKE_libblock_free_us(&(G.main->object), tmpobj);
+				BKE_report(reports, RPT_ERROR, "Cannot convert curve to mesh (does the curve have any segments?)");
+				return NULL;
+			}
+
+			BKE_libblock_free_us(&bmain->object, tmpobj);
+			break;
+		}
+
+		case OB_MBALL:
+		{
+			/* metaballs don't have modifiers, so just convert to mesh */
+			Object *basis_ob = BKE_mball_basis_find(sce, ob);
+			/* todo, re-generatre for render-res */
+			/* metaball_polygonize(scene, ob) */
+
+			if (ob != basis_ob)
+				return NULL;  /* only do basis metaball */
+
+			tmpmesh = BKE_mesh_add(bmain, "Mesh");
+			/* BKE_mesh_add gives us a user count we don't need */
+			tmpmesh->id.us--;
+
+			if (render) {
+				ListBase disp = {NULL, NULL};
+				BKE_displist_make_mball_forRender(sce, ob, &disp);
+				BKE_mesh_from_metaball(&disp, tmpmesh);
+				BKE_displist_free(&disp);
+			}
+			else
+				BKE_mesh_from_metaball(&ob->disp, tmpmesh);
+
+			break;
+
+		}
+		case OB_MESH:
+			/* copies object and modifiers (but not the data) */
+			if (cage) {
+				/* copies the data */
+				tmpmesh = BKE_mesh_copy_ex(bmain, ob->data);
+				/* if not getting the original caged mesh, get final derived mesh */
+			}
+			else {
+				/* Make a dummy mesh, saves copying */
+				DerivedMesh *dm;
+				/* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */
+				CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
+			                                         * for example, needs CD_MASK_MDEFORMVERT */
+
+				/* Write the display mesh into the dummy mesh */
+				if (render)
+					dm = mesh_create_derived_render(sce, ob, mask);
+				else
+					dm = mesh_create_derived_view(sce, ob, mask);
+
+				tmpmesh = BKE_mesh_add(bmain, "Mesh");
+				DM_to_mesh(dm, tmpmesh, ob);
+				dm->release(dm);
+			}
+
+			/* BKE_mesh_add/copy gives us a user count we don't need */
+			tmpmesh->id.us--;
+
+			break;
+		default:
+			BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
+			return NULL;
+	}
+
+	/* Copy materials to new mesh */
+	switch (ob->type) {
+		case OB_SURF:
+		case OB_FONT:
+		case OB_CURVE:
+			tmpmesh->totcol = tmpcu->totcol;
+
+			/* free old material list (if it exists) and adjust user counts */
+			if (tmpcu->mat) {
+				for (i = tmpcu->totcol; i-- > 0; ) {
+					/* are we an object material or data based? */
+
+					tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i];
+
+					if (tmpmesh->mat[i]) {
+						tmpmesh->mat[i]->id.us++;
+					}
+				}
+			}
+			break;
+
+#if 0
+		/* Crashes when assigning the new material, not sure why */
+		case OB_MBALL:
+			tmpmb = (MetaBall *)ob->data;
+			tmpmesh->totcol = tmpmb->totcol;
+
+			/* free old material list (if it exists) and adjust user counts */
+			if (tmpmb->mat) {
+				for (i = tmpmb->totcol; i-- > 0; ) {
+					tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
+					if (tmpmesh->mat[i]) {
+						tmpmb->mat[i]->id.us++;
+					}
+				}
+			}
+			break;
+#endif
+
+		case OB_MESH:
+			if (!cage) {
+				Mesh *origmesh = ob->data;
+				tmpmesh->flag = origmesh->flag;
+				tmpmesh->mat = MEM_dupallocN(origmesh->mat);
+				tmpmesh->totcol = origmesh->totcol;
+				tmpmesh->smoothresh = origmesh->smoothresh;
+				if (origmesh->mat) {
+					for (i = origmesh->totcol; i-- > 0; ) {
+						/* are we an object material or data based? */
+						tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i];
+
+						if (tmpmesh->mat[i]) {
+							tmpmesh->mat[i]->id.us++;
+						}
+					}
+				}
+			}
+			break;
+	} /* end copy materials */
+
+	if (calc_tessface) {
+		/* cycles and exporters rely on this still */
+		BKE_mesh_tessface_ensure(tmpmesh);
+	}
+
+	/* make sure materials get updated in objects */
+	test_object_materials(&tmpmesh->id);
+
+	return tmpmesh;
+}
+
 static void rna_Main_meshes_remove(Main *bmain, ReportList *reports, PointerRNA *mesh_ptr)
 {
 	Mesh *mesh = mesh_ptr->data;
@@ -270,9 +473,9 @@ static void rna_Main_meshes_remove(Main *bmain, ReportList *reports, PointerRNA
 	}
 }
 
-static Lamp *rna_Main_lamps_new(Main *UNUSED(bmain), const char *name, int type)
+static Lamp *rna_Main_lamps_new(Main *bmain, const char *name, int type)
 {
-	Lamp *lamp = BKE_lamp_add(name);
+	Lamp *lamp = BKE_lamp_add(bmain, name);
 	lamp->type = type;
 	id_us_min(&lamp->id);
 	return lamp;
@@ -290,19 +493,19 @@ static void rna_Main_lamps_remove(Main *bmain, ReportList *reports, PointerRNA *
 	}
 }
 
-static Image *rna_Main_images_new(Main *UNUSED(bmain), const char *name, int width, int height, int alpha, int float_buffer)
+static Image *rna_Main_images_new(Main *bmain, const char *name, int width, int height, int alpha, int float_buffer)
 {
 	float color[4] = {0.0, 0.0, 0.0, 1.0};
-	Image *image = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, float_buffer, 0, color);
+	Image *image = BKE_image_add_generated(bmain, width, height, name, alpha ? 32 : 24, float_buffer, 0, color);
 	id_us_min(&image->id);
 	return image;
 }
-static Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath)
+static Image *rna_Main_images_load(Main *bmain, ReportList *reports, const char *filepath)
 {
 	Image *ima;
 
 	errno = 0;
-	ima = BKE_image_load(filepath);
+	ima = BKE_image_load(bmain, filepath);
 
 	if (!ima) {
 		BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath,
@@ -324,9 +527,9 @@ static void rna_Main_images_remove(Main *bmain, ReportList *reports, PointerRNA
 	}
 }
 
-static Lattice *rna_Main_lattices_new(Main *UNUSED(bmain), const char *name)
+static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
 {
-	Lattice *lt = BKE_lattice_add(name);
+	Lattice *lt = BKE_lattice_add(bmain, name);
 	id_us_min(&lt->id);
 	return lt;
 }
@@ -343,9 +546,9 @@ static void rna_Main_lattices_remove(Main *bmain, ReportList *reports, PointerRN
 	}
 }
 
-static Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type)
+static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
 {
-	Curve *cu = BKE_curve_add(name, type);
+	Curve *cu = BKE_curve_add(bmain, name, type);
 	id_us_min(&cu->id);
 	return cu;
 }
@@ -362,9 +565,9 @@ static void rna_Main_curves_remove(Main *bmain, ReportList *reports, PointerRNA
 	}
 }
 
-static MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name)
+static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
 {
-	MetaBall *mb = BKE_mball_add(name);
+	MetaBall *mb = BKE_mball_add(bmain, name);
 	id_us_min(&mb->id);
 	return mb;
 }
@@ -408,9 +611,9 @@ static void rna_Main_fonts_remove(Main *bmain, ReportList *reports, PointerRNA *
 	}
 }
 
-static Tex *rna_Main_textures_new(Main *UNUSED(bmain), const char *name, int type)
+static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
 {
-	Tex *tex = add_texture(name);
+	Tex *tex = add_texture(bmain, name);
 	tex_set_type(tex, type);
 	id_us_min(&tex->id);
 	return tex;
@@ -428,9 +631,9 @@ static void rna_Main_textures_remove(Main *bmain, ReportList *reports, PointerRN
 	}
 }
 
-static Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name)
+static Brush *rna_Main_brushes_new(Main *bmain, const char *name)
 {
-	Brush *brush = BKE_brush_add(name);
+	Brush *brush = BKE_brush_add(bmain, name);
 	id_us_min(&brush->id);
 	return brush;
 }
@@ -447,9 +650,9 @@ static void rna_Main_brushes_remove(Main *bmain, ReportList *reports, PointerRNA
 	}
 }
 
-static World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name)
+static World *rna_Main_worlds_new(Main *bmain, const char *name)
 {
-	World *world = add_world(name);
+	World *world = add_world(bmain, name);
 	id_us_min(&world->id);
 	return world;
 }
@@ -466,9 +669,9 @@ static void rna_Main_worlds_remove(Main *bmain, ReportList *reports, PointerRNA
 	}
 }
 
-static Group *rna_Main_groups_new(Main *UNUSED(bmain), const char *name)
+static Group *rna_Main_groups_new(Main *bmain, const char *name)
 {
-	return add_group(name);
+	return add_group(bmain, name);
 }
 static void rna_Main_groups_remove(Main *bmain, PointerRNA *group_ptr)
 {
@@ -478,9 +681,9 @@ static void rna_Main_groups_remove(Main *bmain, PointerRNA *group_ptr)
 	RNA_POINTER_INVALIDATE(group_ptr);
 }
 
-static Speaker *rna_Main_speakers_new(Main *UNUSED(bmain), const char *name)
+static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
 {
-	Speaker *speaker = BKE_speaker_add(name);
+	Speaker *speaker = BKE_speaker_add(bmain, name);
 	id_us_min(&speaker->id);
 	return speaker;
 }
@@ -497,9 +700,9 @@ static void rna_Main_speakers_remove(Main *bmain, ReportList *reports, PointerRN
 	}
 }
 
-static Text *rna_Main_texts_new(Main *UNUSED(bmain), const char *name)
+static Text *rna_Main_texts_new(Main *bmain, const char *name)
 {
-	return BKE_text_add(name);
+	return BKE_text_add(bmain, name);
 }
 static void rna_Main_texts_remove(Main *bmain, PointerRNA *text_ptr)
 {
@@ -514,7 +717,7 @@ static Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *f
 	Text *txt;
 
 	errno = 0;
-	txt = BKE_text_load(filepath, bmain->name);
+	txt = BKE_text_load(bmain, filepath, bmain->name);
 
 	if (!txt)
 		BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath,
@@ -523,9 +726,9 @@ static Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *f
 	return txt;
 }
 
-static bArmature *rna_Main_armatures_new(Main *UNUSED(bmain), const char *name)
+static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
 {
-	bArmature *arm = BKE_armature_add(name);
+	bArmature *arm = BKE_armature_add(bmain, name);
 	id_us_min(&arm->id);
 	return arm;
 }
@@ -542,9 +745,9 @@ static void rna_Main_armatures_remove(Main *bmain, ReportList *reports, PointerR
 	}
 }
 
-static bAction *rna_Main_actions_new(Main *UNUSED(bmain), const char *name)
+static bAction *rna_Main_actions_new(Main *bmain, const char *name)
 {
-	bAction *act = add_empty_action(name);
+	bAction *act = add_empty_action(bmain, name);
 	id_us_min(&act->id);
 	act->id.flag &= ~LIB_FAKEUSER;
 	return act;
@@ -581,12 +784,12 @@ static void rna_Main_particles_remove(Main *bmain, ReportList *reports, PointerR
 	}
 }
 
-static MovieClip *rna_Main_movieclip_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath)
+static MovieClip *rna_Main_movieclip_load(Main *bmain, ReportList *reports, const char *filepath)
 {
 	MovieClip *clip;
 
 	errno = 0;
-	clip = BKE_movieclip_file_add(filepath);
+	clip = BKE_movieclip_file_add(bmain, filepath);
 
 	if (!clip)
 		BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath,
@@ -603,11 +806,11 @@ static void rna_Main_movieclips_remove(Main *bmain, PointerRNA *clip_ptr)
 	RNA_POINTER_INVALIDATE(clip_ptr);
 }
 
-static Mask *rna_Main_mask_new(Main *UNUSED(bmain), const char *name)
+static Mask *rna_Main_mask_new(Main *bmain, const char *name)
 {
 	Mask *mask;
 
-	mask = BKE_mask_new("Mask");
+	mask = BKE_mask_new(bmain, "Mask");
 
 	return mask;
 }
@@ -910,6 +1113,12 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
 	PropertyRNA *parm;
 	PropertyRNA *prop;
 
+	static EnumPropertyItem mesh_type_items[] = {
+		{eModifierMode_Realtime, "PREVIEW", 0, "Preview", "Apply modifier preview settings"},
+		{eModifierMode_Render, "RENDER", 0, "Render", "Apply modifier render settings"},
+		{0, NULL, 0, NULL, NULL}
+	};
+
 	RNA_def_property_srna(cprop, "BlendDataMeshes");
 	srna = RNA_def_struct(brna, "BlendDataMeshes", NULL);
 	RNA_def_struct_sdna(srna, "Main");
@@ -923,6 +1132,22 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock");
 	RNA_def_function_return(func, parm);
 
+	func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
+	RNA_def_function_ui_description(func, "Add a new mesh created from object with modifiers applied");
+	RNA_def_function_flag(func, FUNC_USE_REPORTS);
+	parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers");
+	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
+	parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
+	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
+	parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers");
+	RNA_def_property_flag(parm, PROP_REQUIRED);
+	parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
+	RNA_def_property_flag(parm, PROP_REQUIRED);
+	RNA_def_boolean(func, "calc_tessface", true, "Calculate Tessellation", "Calculate tessellation faces");
+	parm = RNA_def_pointer(func, "mesh", "Mesh", "",
+	                       "Mesh created from object, remove it if it is only used for export");
+	RNA_def_function_return(func, parm);
+
 	func = RNA_def_function(srna, "remove", "rna_Main_meshes_remove");
 	RNA_def_function_flag(func, FUNC_USE_REPORTS);
 	RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 1221b84..35173c2 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -114,7 +114,7 @@ static void rna_Material_update_previews(Main *bmain, Scene *scene, PointerRNA *
 	if (ma->nodetree)
 		ntreeClearPreview(ma->nodetree);
 		
-	rna_Material_update(bmain, scene, ptr);
+	WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma);
 }
 
 
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index d5b8e4c..4b4006f 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -2422,7 +2422,7 @@ static void rna_def_loop_colors(BlenderRNA *brna, PropertyRNA *cprop)
 	RNA_def_property_struct_type(prop, "MeshLoopColorLayer");
 	RNA_def_property_pointer_funcs(prop, "rna_Mesh_vertex_color_active_get",
 	                               "rna_Mesh_vertex_color_active_set", NULL, NULL);
-	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
 	RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer");
 	RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
 
@@ -2450,7 +2450,7 @@ static void rna_def_uv_layers(BlenderRNA *brna, PropertyRNA *cprop)
 	RNA_def_property_struct_type(prop, "MeshUVLoopLayer");
 	RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_layer_active_get",
 	                               "rna_Mesh_uv_layer_active_set", NULL, NULL);
-	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
 	RNA_def_property_ui_text(prop, "Active UV loop layer", "Active UV loop layer");
 	RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
 
@@ -2600,7 +2600,7 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
 	RNA_def_property_struct_type(prop, "MeshTexturePolyLayer");
 	RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_active_get",
 	                               "rna_Mesh_uv_texture_active_set", NULL, NULL);
-	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
 	RNA_def_property_ui_text(prop, "Active UV Map", "Active UV Map");
 	RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
 
@@ -2900,11 +2900,6 @@ static void rna_def_mesh(BlenderRNA *brna)
 	                         "Display selected edges using highlights in the 3D view and UV editor");
 	RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
 
-	prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
-	RNA_def_property_ui_text(prop, "All Edges", "Display all edges for wireframe in all view modes in the 3D view");
-	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
-
 	prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
 	RNA_def_property_ui_text(prop, "Draw Faces", "Display all faces as shades in the 3D view and UV editor");
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index 08eefc0..4813f25 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -351,6 +351,8 @@ static void rna_def_metaball(BlenderRNA *brna)
 	
 	/* anim */
 	rna_def_animdata_common(srna);
+
+	RNA_api_meta(srna);
 }
 
 void RNA_def_meta(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_meta_api.c b/source/blender/makesrna/intern/rna_meta_api.c
new file mode 100644
index 0000000..500e202
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_meta_api.c
@@ -0,0 +1,60 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/makesrna/intern/rna_meta_api.c
+ *  \ingroup RNA
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "RNA_define.h"
+
+#include "BLO_sys_types.h"
+
+#include "BLI_utildefines.h"
+
+#include "ED_mball.h"
+
+#include "rna_internal.h"  /* own include */
+
+#ifdef RNA_RUNTIME
+/* none */
+#else
+
+void RNA_api_meta(StructRNA *srna)
+{
+	FunctionRNA *func;
+	PropertyRNA *parm;
+
+	func = RNA_def_function(srna, "transform", "ED_mball_transform");
+	RNA_def_function_ui_description(func, "Transform meta elements by a matrix");
+	parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
+	RNA_def_property_flag(parm, PROP_REQUIRED);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 7a576c8..21ab112 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -58,6 +58,7 @@
 
 EnumPropertyItem modifier_type_items[] = {
 	{0, "", 0, N_("Modify"), ""},
+	{eModifierType_MeshCache, "MESH_CACHE", ICON_MOD_MESHDEFORM, "Mesh Cache", ""},
 	{eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
 	{eModifierType_UVWarp, "UV_WARP", ICON_MOD_UVPROJECT, "UV Warp", ""},
 	{eModifierType_WeightVGEdit, "VERTEX_WEIGHT_EDIT", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Edit", ""},
@@ -219,6 +220,8 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr)
 			return &RNA_TriangulateModifier;
 		case eModifierType_UVWarp:
 			return &RNA_UVWarpModifier;
+		case eModifierType_MeshCache:
+			return &RNA_MeshCacheModifier;
 		/* Default */
 		case eModifierType_None:
 		case eModifierType_ShapeKey:
@@ -1666,7 +1669,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
 	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_vgroup_set");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-	prop = RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE);
+	prop = RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "midlevel");
 	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
 	RNA_def_property_ui_range(prop, 0, 1, 10, 3);
@@ -1840,18 +1843,23 @@ static void rna_def_modifier_laplaciansmooth(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME);
 	RNA_def_property_ui_text(prop, "Preserve Volume", "Apply volume preservation after smooth");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	
+	prop = RNA_def_property(srna, "use_normalized", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_LAPLACIANSMOOTH_NORMALIZED);
+	RNA_def_property_ui_text(prop, "Normalized", "Improve and stabilize the enhanced shape");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "lambda_factor", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "lambda");
 	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
-	RNA_def_property_ui_range(prop, 0.0000001, 1000.0, 0.0000001, 8);
+	RNA_def_property_ui_range(prop, -1000.0, 1000.0, 5, 3);
 	RNA_def_property_ui_text(prop, "Lambda Factor", "Smooth factor effect");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "lambda_border", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "lambda_border");
 	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
-	RNA_def_property_ui_range(prop, 0.0000001, 1000.0, 0.0000001, 8);
+	RNA_def_property_ui_range(prop, -1000.0, 1000.0, 5, 3);
 	RNA_def_property_ui_text(prop, "Lambda Border", "Lambda factor in border");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
@@ -3473,6 +3481,158 @@ static void rna_def_modifier_triangulate(BlenderRNA *brna)
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 }
 
+static void rna_def_modifier_meshcache(BlenderRNA *brna)
+{
+	static EnumPropertyItem prop_format_type_items[] = {
+		{MOD_MESHCACHE_TYPE_MDD, "MDD", 0, "MDD ", ""},
+		{MOD_MESHCACHE_TYPE_PC2, "PC2", 0, "PC2", ""},
+		{0, NULL, 0, NULL, NULL}
+	};
+
+	static EnumPropertyItem prop_deform_mode_items[] = {
+		{MOD_MESHCACHE_DEFORM_OVERWRITE, "OVERWRITE", 0, "Overwrite",
+		 "Replace vertex coords with cached values"},
+		{MOD_MESHCACHE_DEFORM_INTEGRATE, "INTEGRATE", 0, "Integrate",
+		 "Integrate deformation from this modifiers input with the mesh-cache coords (useful for shape keys)"},
+		{0, NULL, 0, NULL, NULL}
+	};
+
+	static EnumPropertyItem prop_interpolation_type_items[] = {
+		{MOD_MESHCACHE_INTERP_NONE, "NONE", 0, "None ", ""},
+		{MOD_MESHCACHE_INTERP_LINEAR, "LINEAR", 0, "Linear", ""},
+		/* for cardinal we'd need to read 4x cache's */
+		// {MOD_MESHCACHE_INTERP_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
+		{0, NULL, 0, NULL, NULL}
+	};
+
+	static EnumPropertyItem prop_time_type_items[] = {
+		/* use 'eval_frame' */
+		{MOD_MESHCACHE_TIME_FRAME,   "FRAME",   0, "Frame",  "Control playback using a frame-number "
+		                                                   "(ignoring time FPS and start frame from the file)"},
+		/* use 'eval_time' */
+		{MOD_MESHCACHE_TIME_SECONDS, "TIME",    0, "Time",   "Control playback using time in seconds"},
+		/* use 'eval_factor' */
+		{MOD_MESHCACHE_TIME_FACTOR,  "FACTOR",  0, "Factor", "Control playback using a value between [0, 1]"},
+		{0, NULL, 0, NULL, NULL}
+	};
+
+	static EnumPropertyItem prop_time_play_items[] = {
+		{MOD_MESHCACHE_PLAY_CFEA, "SCENE", 0, "Scene", "Use the time from the scene"},
+		{MOD_MESHCACHE_PLAY_EVAL, "CUSTOM", 0, "Custom", "Use the modifier's own time evaluation"},
+		{0, NULL, 0, NULL, NULL}
+	};
+
+	static EnumPropertyItem prop_flip_axis_flag_items[] = {
+		{(1 << 0), "X", 0, "X", ""},
+		{(1 << 1), "Y", 0, "Y", ""},
+		{(1 << 2), "Z", 0, "Z", ""},
+		{0, NULL, 0, NULL, NULL}
+	};
+
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	srna = RNA_def_struct(brna, "MeshCacheModifier", "Modifier");
+	RNA_def_struct_ui_text(srna, "Cache Modifier", "Cache Mesh");
+	RNA_def_struct_sdna(srna, "MeshCacheModifierData");
+	RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);  /* XXX, needs own icon */
+
+	prop = RNA_def_property(srna, "cache_format", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "type");
+	RNA_def_property_enum_items(prop, prop_format_type_items);
+	RNA_def_property_ui_text(prop, "Format", "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "interp");
+	RNA_def_property_enum_items(prop, prop_interpolation_type_items);
+	RNA_def_property_ui_text(prop, "Interpolation", "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "time_mode", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "time_mode");
+	RNA_def_property_enum_items(prop, prop_time_type_items);
+	RNA_def_property_ui_text(prop, "Time Mode", "Method to control playback time");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "play_mode", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "play_mode");
+	RNA_def_property_enum_items(prop, prop_time_play_items);
+	RNA_def_property_ui_text(prop, "Time Mode", "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "deform_mode", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "deform_mode");
+	RNA_def_property_enum_items(prop, prop_deform_mode_items);
+	RNA_def_property_ui_text(prop, "Deform Mode", "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+	RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "factor");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_ui_text(prop, "Influence", "Influence of the deformation");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	/* -------------------------------------------------------------------- */
+	/* Axis Conversion */
+	prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "forward_axis");
+	RNA_def_property_enum_items(prop, object_axis_items);
+	RNA_def_property_ui_text(prop, "Forward", "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "up_axis");
+	RNA_def_property_enum_items(prop, object_axis_items);
+	RNA_def_property_ui_text(prop, "Up", "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "flip_axis");
+	RNA_def_property_enum_items(prop, prop_flip_axis_flag_items);
+	RNA_def_property_flag(prop, PROP_ENUM_FLAG);
+	RNA_def_property_ui_text(prop, "Flip Axis",  "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	/* -------------------------------------------------------------------- */
+	/* For Scene time */
+	prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "frame_start");
+	RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
+	RNA_def_property_ui_text(prop, "Frame Start", "Add this to the start frame");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "frame_scale", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "frame_scale");
+	RNA_def_property_range(prop, 0.0f, 100.0f);
+	RNA_def_property_ui_text(prop, "Frame Scale", "Evaluation time in seconds");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	/* -------------------------------------------------------------------- */
+	/* eval values depend on 'time_mode' */
+	prop = RNA_def_property(srna, "eval_frame", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "eval_frame");
+	RNA_def_property_range(prop, MINFRAME, MAXFRAME);
+	RNA_def_property_ui_text(prop, "Evaluation Frame", "The frame to evaluate (starting at 0)");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "eval_time");
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
+	RNA_def_property_ui_text(prop, "Evaluation Time", "Evaluation time in seconds");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "eval_factor", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "eval_factor");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_ui_text(prop, "Evaluation Factor", "Evaluation time in seconds");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+}
+
 void RNA_def_modifier(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -3582,6 +3742,7 @@ void RNA_def_modifier(BlenderRNA *brna)
 	rna_def_modifier_skin(brna);
 	rna_def_modifier_laplaciansmooth(brna);
 	rna_def_modifier_triangulate(brna);
+	rna_def_modifier_meshcache(brna);
 }
 
 #endif
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 574f06e..2b7f6a1 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -115,7 +115,7 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
 		if (data->prev->type == NLASTRIP_TYPE_TRANSITION) {
 			CLAMP(value, data->prev->start + NLASTRIP_MIN_LEN_THRESH, data->end - NLASTRIP_MIN_LEN_THRESH);
 			
-			/* readjust the transition to stick to the endpoints of the action-clips */
+			/* re-adjust the transition to stick to the endpoints of the action-clips */
 			data->prev->end = value;
 		}
 		else {
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index eecdf13..612802c 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -2537,7 +2537,8 @@ static void def_cmp_dilate_erode(StructRNA *srna)
 	
 	prop = RNA_def_property(srna, "distance", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "custom2");
-	RNA_def_property_range(prop, -100, 100);
+	RNA_def_property_range(prop, -5000, 5000);
+	RNA_def_property_ui_range(prop, -100, 100, 0, 0);
 	RNA_def_property_ui_text(prop, "Distance", "Distance to grow/shrink (number of iterations)");
 	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 
@@ -3799,7 +3800,8 @@ static void def_cmp_bokehblur(StructRNA *srna)
 	/* duplicated in def_cmp_blur */
 	prop = RNA_def_property(srna, "use_variable_size", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_NODEFLAG_BLUR_VARIABLE_SIZE);
-	RNA_def_property_ui_text(prop, "Variable Size", "Support variable blue per-pixel when using an image for size input");
+	RNA_def_property_ui_text(prop, "Variable Size",
+	                         "Support variable blur per-pixel when using an image for size input");
 	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 
 #if 0
@@ -4082,6 +4084,21 @@ static void def_cmp_viewer(StructRNA *srna)
 	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Y", "");
 	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+	prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "custom2", 1);
+	RNA_def_property_ui_text(prop, "Use Alpha", "Colors are treated alpha premultiplied, or colors output straight (alpha gets set to 1)");
+	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
+static void def_cmp_composite(StructRNA *srna)
+{
+	PropertyRNA *prop;
+
+	prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "custom2", 1);
+	RNA_def_property_ui_text(prop, "Use Alpha", "Colors are treated alpha premultiplied, or colors output straight (alpha gets set to 1)");
+	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 }
 
 static void def_cmp_keyingscreen(StructRNA *srna)
@@ -4224,6 +4241,33 @@ static void def_cmp_trackpos(StructRNA *srna)
 	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 }
 
+static void def_cmp_translate(StructRNA *srna)
+{
+	static EnumPropertyItem translate_items[] = {
+		{CMP_NODE_WRAP_NONE, "NONE",  0, "None",       "No wrapping on X and Y"},
+		{CMP_NODE_WRAP_X,    "XAXIS", 0, "X Axis",     "Wrap all pixels on the X axis"},
+		{CMP_NODE_WRAP_Y,    "YAXIS", 0, "Y Axis",     "Wrap all pixels on the Y axis"},
+		{CMP_NODE_WRAP_XY,   "BOTH",  0, "Both Axes",  "Wrap all pixels on both axes"},
+		{0, NULL, 0, NULL, NULL}
+	};
+
+	PropertyRNA *prop;
+
+	RNA_def_struct_sdna_from(srna, "NodeTranslateData", "storage");
+
+	prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
+	RNA_def_property_ui_text(prop, "Relative", "Use relative (percent) values to define blur radius");
+	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+	prop = RNA_def_property(srna, "wrap_axis", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "wrap_axis");
+	RNA_def_property_enum_items(prop, translate_items);
+	RNA_def_property_ui_text(prop, "Wrapping", "Wrap image on a specific axis");
+	RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
+
 /* -- Texture Nodes --------------------------------------------------------- */
 
 static void def_tex_output(StructRNA *srna)
@@ -4928,6 +4972,10 @@ static void rna_def_composite_nodetree(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_COM_OPENCL);
 	RNA_def_property_ui_text(prop, "OpenCL", "Enable GPU calculations");
 
+	prop = RNA_def_property(srna, "use_groupnode_buffer", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_COM_GROUPNODE_BUFFER);
+	RNA_def_property_ui_text(prop, "Buffer Groups", "Enable buffering of group nodes");
+
 	prop = RNA_def_property(srna, "two_pass", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_TWO_PASS);
 	RNA_def_property_ui_text(prop, "Two Pass", "Use two pass execution during editing: first calculate fast nodes, "
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index 46f2306..b7ec923 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -31,6 +31,8 @@
 #define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc)
 #endif
 
+/* WARNING! If you edit those strings, please do the same in relevant nodes files (under blender/nodes/...)! */
+
 /*       Tree type       Node ID                  RNA def function        Enum name         Struct name       UI Name              UI Description */
 DefNode( ShaderNode,     SH_NODE_OUTPUT,          0,                      "OUTPUT",         Output,           "Output",            ""              )
 DefNode( ShaderNode,     SH_NODE_MATERIAL,        def_sh_material,        "MATERIAL",       Material,         "Material",          ""              )
@@ -45,12 +47,12 @@ DefNode( ShaderNode,     SH_NODE_GAMMA,           0,                      "GAMMA
 DefNode( ShaderNode,     SH_NODE_BRIGHTCONTRAST,  0,                      "BRIGHTCONTRAST", BrightContrast,   "Bright Contrast",   ""              )
 DefNode( ShaderNode,     SH_NODE_GEOMETRY,        def_sh_geometry,        "GEOMETRY",       Geometry,         "Geometry",          ""              )
 DefNode( ShaderNode,     SH_NODE_MAPPING,         def_sh_mapping,         "MAPPING",        Mapping,          "Mapping",           ""              )
-DefNode( ShaderNode,     SH_NODE_CURVE_VEC,       def_vector_curve,       "CURVE_VEC",      VectorCurve,      "Vector Curve",      ""              )
-DefNode( ShaderNode,     SH_NODE_CURVE_RGB,       def_rgb_curve,          "CURVE_RGB",      RGBCurve,         "RGB Curve",         ""              )
+DefNode( ShaderNode,     SH_NODE_CURVE_VEC,       def_vector_curve,       "CURVE_VEC",      VectorCurve,      "Vector Curves",     ""              )
+DefNode( ShaderNode,     SH_NODE_CURVE_RGB,       def_rgb_curve,          "CURVE_RGB",      RGBCurve,         "RGB Curves",        ""              )
 DefNode( ShaderNode,     SH_NODE_CAMERA,          0,                      "CAMERA",         CameraData,       "Camera Data",       ""              )
 DefNode( ShaderNode,     SH_NODE_MATH,            def_math,               "MATH",           Math,             "Math",              ""              )
 DefNode( ShaderNode,     SH_NODE_VECT_MATH,       def_vector_math,        "VECT_MATH",      VectorMath,       "Vector Math",       ""              )
-DefNode( ShaderNode,     SH_NODE_SQUEEZE,         0,                      "SQUEEZE",        Squeeze,          "Squeeze",           ""              )
+DefNode( ShaderNode,     SH_NODE_SQUEEZE,         0,                      "SQUEEZE",        Squeeze,          "Squeeze Value",     ""              )
 DefNode( ShaderNode,     SH_NODE_MATERIAL_EXT,    def_sh_material,        "MATERIAL_EXT",   ExtendedMaterial, "Extended Material", ""              )
 DefNode( ShaderNode,     SH_NODE_INVERT,          0,                      "INVERT",         Invert,           "Invert",            ""              )
 DefNode( ShaderNode,     SH_NODE_SEPRGB,          0,                      "SEPRGB",         SeparateRGB,      "Separate RGB",      ""              )
@@ -68,14 +70,14 @@ DefNode( ShaderNode,     SH_NODE_ATTRIBUTE,          def_sh_attribute,       "AT
 DefNode( ShaderNode,     SH_NODE_AMBIENT_OCCLUSION,  0,                      "AMBIENT_OCCLUSION",  AmbientOcclusion, "Ambient Occlusion", ""       )
 DefNode( ShaderNode,     SH_NODE_BACKGROUND,         0,                      "BACKGROUND",         Background,       "Background",        ""       )
 DefNode( ShaderNode,     SH_NODE_HOLDOUT,            0,                      "HOLDOUT",            Holdout,          "Holdout",           ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_ANISOTROPIC,   0,                      "BSDF_ANISOTROPIC",   BsdfAnisotropic,  "Anisotropic Bsdf",  ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_DIFFUSE,       0,                      "BSDF_DIFFUSE",       BsdfDiffuse,      "Diffuse Bsdf",      ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_GLOSSY,        def_glossy,             "BSDF_GLOSSY",        BsdfGlossy,       "Glossy Bsdf",       ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_GLASS,         def_glossy,             "BSDF_GLASS",         BsdfGlass,        "Glass Bsdf",        ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_REFRACTION,    def_glossy,             "BSDF_REFRACTION",    BsdfRefraction,   "Refraction Bsdf",   ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_TRANSLUCENT,   0,                      "BSDF_TRANSLUCENT",   BsdfTranslucent,  "Translucent Bsdf",  ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_TRANSPARENT,   0,                      "BSDF_TRANSPARENT",   BsdfTransparent,  "Transparent Bsdf",  ""       )
-DefNode( ShaderNode,     SH_NODE_BSDF_VELVET,        0,                      "BSDF_VELVET",        BsdfVelvet,       "Velvet Bsdf",       ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_ANISOTROPIC,   0,                      "BSDF_ANISOTROPIC",   BsdfAnisotropic,  "Anisotropic BSDF",  ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_DIFFUSE,       0,                      "BSDF_DIFFUSE",       BsdfDiffuse,      "Diffuse BSDF",      ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_GLOSSY,        def_glossy,             "BSDF_GLOSSY",        BsdfGlossy,       "Glossy BSDF",       ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_GLASS,         def_glossy,             "BSDF_GLASS",         BsdfGlass,        "Glass BSDF",        ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_REFRACTION,    def_glossy,             "BSDF_REFRACTION",    BsdfRefraction,   "Refraction BSDF",   ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_TRANSLUCENT,   0,                      "BSDF_TRANSLUCENT",   BsdfTranslucent,  "Translucent BSDF",  ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_TRANSPARENT,   0,                      "BSDF_TRANSPARENT",   BsdfTransparent,  "Transparent BSDF",  ""       )
+DefNode( ShaderNode,     SH_NODE_BSDF_VELVET,        0,                      "BSDF_VELVET",        BsdfVelvet,       "Velvet BSDF",       ""       )
 DefNode( ShaderNode,     SH_NODE_VOLUME_TRANSPARENT, 0,                      "VOLUME_TRANSPARENT", VolumeTransparent,"Transparent Volume",""       )
 DefNode( ShaderNode,     SH_NODE_VOLUME_ISOTROPIC,   0,                      "VOLUME_ISOTROPIC",   VolumeIsotropic,  "Isotropic Volume",  ""       )
 DefNode( ShaderNode,     SH_NODE_EMISSION,           0,                      "EMISSION",           Emission,         "Emission",          ""       )
@@ -109,7 +111,7 @@ DefNode( CompositorNode, CMP_NODE_MIX_RGB,        def_mix_rgb,            "MIX_R
 DefNode( CompositorNode, CMP_NODE_VALTORGB,       def_colorramp,          "VALTORGB",       ValToRGB,         "ColorRamp",         ""              )
 DefNode( CompositorNode, CMP_NODE_RGBTOBW,        0,                      "RGBTOBW",        RGBToBW,          "RGB to BW",         ""              )
 DefNode( CompositorNode, CMP_NODE_NORMAL,         0,                      "NORMAL",         Normal,           "Normal",            ""              )
-DefNode( CompositorNode, CMP_NODE_CURVE_VEC,      def_vector_curve,       "CURVE_VEC",      CurveVec,         "Vector Curve",      ""              )
+DefNode( CompositorNode, CMP_NODE_CURVE_VEC,      def_vector_curve,       "CURVE_VEC",      CurveVec,         "Vector Curves",     ""              )
 DefNode( CompositorNode, CMP_NODE_CURVE_RGB,      def_rgb_curve,          "CURVE_RGB",      CurveRGB,         "RGB Curves",        ""              )
 DefNode( CompositorNode, CMP_NODE_ALPHAOVER,      def_cmp_alpha_over,     "ALPHAOVER",      AlphaOver,        "Alpha Over",        ""              )
 DefNode( CompositorNode, CMP_NODE_BLUR,           def_cmp_blur,           "BLUR",           Blur,             "Blur",              ""              )
@@ -124,10 +126,10 @@ DefNode( CompositorNode, CMP_NODE_SETALPHA,       0,                      "SETAL
 DefNode( CompositorNode, CMP_NODE_HUE_SAT,        def_cmp_hue_saturation, "HUE_SAT",        HueSat,           "Hue Saturation Value",""            )
 DefNode( CompositorNode, CMP_NODE_IMAGE,          def_cmp_image,          "IMAGE",          Image,            "Image",             ""              )
 DefNode( CompositorNode, CMP_NODE_R_LAYERS,       def_cmp_render_layers,  "R_LAYERS",       RLayers,          "Render Layers",     ""              )
-DefNode( CompositorNode, CMP_NODE_COMPOSITE,      0,                      "COMPOSITE",      Composite,        "Composite",         ""              )
+DefNode( CompositorNode, CMP_NODE_COMPOSITE,      def_cmp_composite,      "COMPOSITE",      Composite,        "Composite",         ""              )
 DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE,    def_cmp_output_file,    "OUTPUT_FILE",    OutputFile,       "File Output",       ""              )
 DefNode( CompositorNode, CMP_NODE_TEXTURE,        def_texture,            "TEXTURE",        Texture,          "Texture",           ""              )
-DefNode( CompositorNode, CMP_NODE_TRANSLATE,      0,                      "TRANSLATE",      Translate,        "Translate",         ""              )
+DefNode( CompositorNode, CMP_NODE_TRANSLATE,      def_cmp_translate,      "TRANSLATE",      Translate,        "Translate",         ""              )
 DefNode( CompositorNode, CMP_NODE_ZCOMBINE,       def_cmp_zcombine,       "ZCOMBINE",       Zcombine,         "Z Combine",         ""              )
 DefNode( CompositorNode, CMP_NODE_COMBRGBA,       0,                      "COMBRGBA",       CombRGBA,         "Combine RGBA",      ""              )
 DefNode( CompositorNode, CMP_NODE_DILATEERODE,    def_cmp_dilate_erode,   "DILATEERODE",    DilateErode,      "Dilate/Erode",      ""              )
@@ -194,7 +196,7 @@ DefNode( TextureNode,    TEX_NODE_MIX_RGB,        def_mix_rgb,            "MIX_R
 DefNode( TextureNode,    TEX_NODE_RGBTOBW,        0,                      "RGBTOBW",        RGBToBW,          "RGB to BW",         ""              )
 DefNode( TextureNode,    TEX_NODE_VALTORGB,       def_colorramp,          "VALTORGB",       ValToRGB,         "ColorRamp",         ""              )
 DefNode( TextureNode,    TEX_NODE_IMAGE,          def_tex_image,          "IMAGE",          Image,            "Image",             ""              )
-DefNode( TextureNode,    TEX_NODE_CURVE_RGB,      def_rgb_curve,          "CURVE_RGB",      CurveRGB,         "RGB Curve",         ""              )
+DefNode( TextureNode,    TEX_NODE_CURVE_RGB,      def_rgb_curve,          "CURVE_RGB",      CurveRGB,         "RGB Curves",        ""              )
 DefNode( TextureNode,    TEX_NODE_INVERT,         0,                      "INVERT",         Invert,           "Invert",            ""              )
 DefNode( TextureNode,    TEX_NODE_HUE_SAT,        0,                      "HUE_SAT",        HueSaturation,    "Hue/Saturation",    ""              )
 DefNode( TextureNode,    TEX_NODE_CURVE_TIME,     def_time,               "CURVE_TIME",     CurveTime,        "Curve Time",        ""              )
@@ -203,8 +205,8 @@ DefNode( TextureNode,    TEX_NODE_VIEWER,         0,                      "VIEWE
 DefNode( TextureNode,    TEX_NODE_TRANSLATE,      0,                      "TRANSLATE",      Translate,        "Translate",         ""              )
 DefNode( TextureNode,    TEX_NODE_COORD,          0,                      "COORD",          Coordinates,      "Coordinates",       ""              )
 DefNode( TextureNode,    TEX_NODE_DISTANCE,       0,                      "DISTANCE",       Distance,         "Distance",          ""              )
-DefNode( TextureNode,    TEX_NODE_COMPOSE,        0,                      "COMPOSE",        Compose,          "Compose",           ""              )
-DefNode( TextureNode,    TEX_NODE_DECOMPOSE,      0,                      "DECOMPOSE",      Decompose,        "Decompose",         ""              )
+DefNode( TextureNode,    TEX_NODE_COMPOSE,        0,                      "COMPOSE",        Compose,          "Combine RGBA",      ""              )
+DefNode( TextureNode,    TEX_NODE_DECOMPOSE,      0,                      "DECOMPOSE",      Decompose,        "Separate RGBA",     ""              )
 DefNode( TextureNode,    TEX_NODE_VALTONOR,       0,                      "VALTONOR",       ValToNor,         "Value to Normal",   ""              )
 DefNode( TextureNode,    TEX_NODE_SCALE,          0,                      "SCALE",          Scale,            "Scale",             ""              )
 
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index a617c78..47b7758 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -156,6 +156,15 @@ EnumPropertyItem object_type_curve_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
+EnumPropertyItem object_axis_items[] = {
+	{OB_POSX, "POS_X", 0, "+X", ""},
+	{OB_POSY, "POS_Y", 0, "+Y", ""},
+	{OB_POSZ, "POS_Z", 0, "+Z", ""},
+	{OB_NEGX, "NEG_X", 0, "-X", ""},
+	{OB_NEGY, "NEG_Y", 0, "-Y", ""},
+	{OB_NEGZ, "NEG_Z", 0, "-Z", ""},
+	{0, NULL, 0, NULL, NULL}
+};
 
 #ifdef RNA_RUNTIME
 
@@ -2002,16 +2011,6 @@ static void rna_def_object(BlenderRNA *brna)
 {
 	StructRNA *srna;
 	PropertyRNA *prop;
-	
-	static EnumPropertyItem track_items[] = {
-		{OB_POSX, "POS_X", 0, "+X", ""},
-		{OB_POSY, "POS_Y", 0, "+Y", ""},
-		{OB_POSZ, "POS_Z", 0, "+Z", ""},
-		{OB_NEGX, "NEG_X", 0, "-X", ""},
-		{OB_NEGY, "NEG_Y", 0, "-Y", ""},
-		{OB_NEGZ, "NEG_Z", 0, "-Z", ""},
-		{0, NULL, 0, NULL, NULL}
-	};
 
 	static EnumPropertyItem up_items[] = {
 		{OB_POSX, "X", 0, "X", ""},
@@ -2142,7 +2141,7 @@ static void rna_def_object(BlenderRNA *brna)
 	 *      since some other tools still refer to this */
 	prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "trackflag");
-	RNA_def_property_enum_items(prop, track_items);
+	RNA_def_property_enum_items(prop, object_axis_items);
 	RNA_def_property_ui_text(prop, "Track Axis",
 	                         "Axis that points in 'forward' direction (applies to DupliFrame when "
 	                         "parent 'Follow' is enabled)");
@@ -2429,6 +2428,17 @@ static void rna_def_object(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
 	rna_def_object_particle_systems(brna, prop);
 
+	
+	prop = RNA_def_property(srna, "rigid_body", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_object");
+	RNA_def_property_struct_type(prop, "RigidBodyObject");
+	RNA_def_property_ui_text(prop, "Rigid Body Settings", "Settings for rigid body simulation");
+
+	prop = RNA_def_property(srna, "rigid_body_constraint", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_constraint");
+	RNA_def_property_struct_type(prop, "RigidBodyConstraint");
+	RNA_def_property_ui_text(prop, "Rigid Body Constraint", "Constraint constraining rigid bodies");
+	
 	/* restrict */
 	prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW);
@@ -2557,7 +2567,7 @@ static void rna_def_object(BlenderRNA *brna)
 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
 
 	prop = RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX);
+	RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWBOUNDOX);
 	RNA_def_property_ui_text(prop, "Draw Bounds", "Display the object's bounds");
 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
 
@@ -2586,7 +2596,12 @@ static void rna_def_object(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE);
 	RNA_def_property_ui_text(prop, "Draw Wire", "Add the object's wireframe over solid drawing");
 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
-	
+
+	prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAW_ALL_EDGES);
+	RNA_def_property_ui_text(prop, "Draw All Edges", "Display all edges for mesh objects");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+
 	prop = RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP);
 	RNA_def_property_ui_text(prop, "Draw Transparent",
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 40b8d4c..2b7df1c 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -34,6 +34,8 @@
 #include <string.h>
 #include <time.h>
 
+#include "BLI_utildefines.h"
+
 #include "RNA_define.h"
 
 #include "DNA_constraint_types.h"
@@ -65,8 +67,6 @@ static EnumPropertyItem space_items[] = {
 #include "BKE_context.h"
 #include "BKE_customdata.h"
 #include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_displist.h"
 #include "BKE_font.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
@@ -111,196 +111,11 @@ static void rna_Scene_mat_convert_space(Object *ob, ReportList *reports, bPoseCh
 
 /* copied from Mesh_getFromObject and adapted to RNA interface */
 /* settings: 0 - preview, 1 - render */
-static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings)
+static Mesh *rna_Object_to_mesh(
+        Object *ob, ReportList *reports, Scene *sce,
+        int apply_modifiers, int settings, int calc_tessface)
 {
-	Mesh *tmpmesh;
-	Curve *tmpcu = NULL, *copycu;
-	Object *tmpobj = NULL;
-	int render = settings == eModifierMode_Render, i;
-	int cage = !apply_modifiers;
-
-	/* perform the mesh extraction based on type */
-	switch (ob->type) {
-		case OB_FONT:
-		case OB_CURVE:
-		case OB_SURF:
-		{
-			ListBase dispbase = {NULL, NULL};
-			DerivedMesh *derivedFinal = NULL;
-			int uv_from_orco;
-
-			/* copies object and modifiers (but not the data) */
-			tmpobj = BKE_object_copy_with_caches(ob);
-			tmpcu = (Curve *)tmpobj->data;
-			tmpcu->id.us--;
-
-			/* if getting the original caged mesh, delete object modifiers */
-			if (cage)
-				BKE_object_free_modifiers(tmpobj);
-
-			/* copies the data */
-			copycu = tmpobj->data = BKE_curve_copy((Curve *) ob->data);
-
-			/* temporarily set edit so we get updates from edit mode, but
-			 * also because for text datablocks copying it while in edit
-			 * mode gives invalid data structures */
-			copycu->editfont = tmpcu->editfont;
-			copycu->editnurb = tmpcu->editnurb;
-
-			/* get updated display list, and convert to a mesh */
-			BKE_displist_make_curveTypes_forRender(sce, tmpobj, &dispbase, &derivedFinal, FALSE);
-
-			copycu->editfont = NULL;
-			copycu->editnurb = NULL;
-
-			tmpobj->derivedFinal = derivedFinal;
-
-			/* convert object type to mesh */
-			uv_from_orco = (tmpcu->flag & CU_UV_ORCO) != 0;
-			BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco);
-
-			tmpmesh = tmpobj->data;
-
-			BKE_displist_free(&dispbase);
-
-			/* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */
-			if (tmpobj->type != OB_MESH) {
-				BKE_libblock_free_us(&(G.main->object), tmpobj);
-				BKE_report(reports, RPT_ERROR, "Cannot convert curve to mesh (does the curve have any segments?)");
-				return NULL;
-			}
-
-			BKE_libblock_free_us(&G.main->object, tmpobj);
-			break;
-		}
-
-		case OB_MBALL:
-		{
-			/* metaballs don't have modifiers, so just convert to mesh */
-			Object *basis_ob = BKE_mball_basis_find(sce, ob);
-			/* todo, re-generatre for render-res */
-			/* metaball_polygonize(scene, ob) */
-
-			if (ob != basis_ob)
-				return NULL;  /* only do basis metaball */
-			
-			tmpmesh = BKE_mesh_add("Mesh");
-			/* BKE_mesh_add gives us a user count we don't need */
-			tmpmesh->id.us--;
-
-			if (render) {
-				ListBase disp = {NULL, NULL};
-				BKE_displist_make_mball_forRender(sce, ob, &disp);
-				BKE_mesh_from_metaball(&disp, tmpmesh);
-				BKE_displist_free(&disp);
-			}
-			else
-				BKE_mesh_from_metaball(&ob->disp, tmpmesh);
-
-			break;
-
-		}
-		case OB_MESH:
-			/* copies object and modifiers (but not the data) */
-			if (cage) {
-				/* copies the data */
-				tmpmesh = BKE_mesh_copy(ob->data);
-				/* if not getting the original caged mesh, get final derived mesh */
-			}
-			else {
-				/* Make a dummy mesh, saves copying */
-				DerivedMesh *dm;
-				/* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */
-				CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
-			                                         * for example, needs CD_MASK_MDEFORMVERT */
-
-				/* Write the display mesh into the dummy mesh */
-				if (render)
-					dm = mesh_create_derived_render(sce, ob, mask);
-				else
-					dm = mesh_create_derived_view(sce, ob, mask);
-		
-				tmpmesh = BKE_mesh_add("Mesh");
-				DM_to_mesh(dm, tmpmesh, ob);
-				dm->release(dm);
-			}
-
-			/* BKE_mesh_add/copy gives us a user count we don't need */
-			tmpmesh->id.us--;
-
-			break;
-		default:
-			BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
-			return NULL;
-	}
-
-	/* Copy materials to new mesh */
-	switch (ob->type) {
-		case OB_SURF:
-		case OB_FONT:
-		case OB_CURVE:
-			tmpmesh->totcol = tmpcu->totcol;
-
-			/* free old material list (if it exists) and adjust user counts */
-			if (tmpcu->mat) {
-				for (i = tmpcu->totcol; i-- > 0; ) {
-					/* are we an object material or data based? */
-
-					tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i];
-
-					if (tmpmesh->mat[i]) {
-						tmpmesh->mat[i]->id.us++;
-					}
-				}
-			}
-			break;
-
-#if 0
-		/* Crashes when assigning the new material, not sure why */
-		case OB_MBALL:
-			tmpmb = (MetaBall *)ob->data;
-			tmpmesh->totcol = tmpmb->totcol;
-
-			/* free old material list (if it exists) and adjust user counts */
-			if (tmpmb->mat) {
-				for (i = tmpmb->totcol; i-- > 0; ) {
-					tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
-					if (tmpmesh->mat[i]) {
-						tmpmb->mat[i]->id.us++;
-					}
-				}
-			}
-			break;
-#endif
-
-		case OB_MESH:
-			if (!cage) {
-				Mesh *origmesh = ob->data;
-				tmpmesh->flag = origmesh->flag;
-				tmpmesh->mat = MEM_dupallocN(origmesh->mat);
-				tmpmesh->totcol = origmesh->totcol;
-				tmpmesh->smoothresh = origmesh->smoothresh;
-				if (origmesh->mat) {
-					for (i = origmesh->totcol; i-- > 0; ) {
-						/* are we an object material or data based? */
-						tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i];
-
-						if (tmpmesh->mat[i]) {
-							tmpmesh->mat[i]->id.us++;
-						}
-					}
-				}
-			}
-			break;
-	} /* end copy materials */
-
-	/* cycles and exporters rely on this still */
-	BKE_mesh_tessface_ensure(tmpmesh);
-
-	/* make sure materials get updated in objects */
-	test_object_materials(&tmpmesh->id);
-
-	return tmpmesh;
+	return rna_Main_meshes_new_from_object(G.main, reports, sce, ob, apply_modifiers, settings, calc_tessface);
 }
 
 /* mostly a copy from convertblender.c */
@@ -631,6 +446,7 @@ void RNA_api_object(StructRNA *srna)
 	RNA_def_property_flag(parm, PROP_REQUIRED);
 	parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
+	RNA_def_boolean(func, "calc_tessface", true, "Calculate Tessellation", "Calculate tessellation faces");
 	parm = RNA_def_pointer(func, "mesh", "Mesh", "",
 	                       "Mesh created from object, remove it if it is only used for export");
 	RNA_def_function_return(func, parm);
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 0c2944b..dcb288a 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -764,7 +764,7 @@ static void rna_def_pointcache(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
 	RNA_def_property_int_sdna(prop, NULL, "startframe");
 	RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
-	RNA_def_property_ui_range(prop, -1000, MAXFRAME, 1, 1);
+	RNA_def_property_ui_range(prop, 1, MAXFRAME, 1, 1);
 	RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts");
 	
 	prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
@@ -1182,7 +1182,7 @@ static void rna_def_field(BlenderRNA *brna)
 	
 	prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "f_strength");
-	RNA_def_property_range(prop, -1000.0f, 1000.0f);
+	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
 	RNA_def_property_ui_text(prop, "Strength", "Strength of force field");
 	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
 
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 4a520cd..dbf80f0 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -289,8 +289,8 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle, ParticleSystemMod
 	}
 }
 
-static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *object, ParticleSystemModifierData *modifier, int particle_no, int step,
-                                       float n_co[3])
+static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *object, ParticleSystemModifierData *modifier,
+                                       int particle_no, int step, float n_co[3])
 {
 	ParticleSettings *part = 0;
 	ParticleData *pars = 0;
@@ -299,6 +299,7 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o
 	int path_nbr = 0;
 	int totpart;
 	int max_k = 0;
+	int step_nbr = 0;
 
 	if (particlesystem == NULL)
 		return;
@@ -306,14 +307,21 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o
 	part = particlesystem->part;
 	pars = particlesystem->particles;
 
+	if (particlesystem->renderdata) {
+		step_nbr = part->ren_step;
+		totchild = particlesystem->totchild;
+	}
+	else {
+		step_nbr = part->draw_step;
+		totchild = (int)((float)particlesystem->totchild * (float)(part->disp) / 100.0f);
+	}
+
 	if (part == NULL || pars == NULL || !psys_check_enabled(object, particlesystem))
 		return;
 	
 	if (part->ren_as == PART_DRAW_OB || part->ren_as == PART_DRAW_GR || part->ren_as == PART_DRAW_NOT)
 		return;
 
-	totchild = particlesystem->totchild * part->disp / 100;
-
 	/* can happen for disconnected/global hair */
 	if (part->type == PART_HAIR && !particlesystem->childcache)
 		totchild = 0;
@@ -324,7 +332,7 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o
 		return;
 
 	if (part->ren_as == PART_DRAW_PATH && particlesystem->pathcache)
-		path_nbr = (int)pow(2.0, part->draw_step);
+		path_nbr = (int)pow(2.0, step_nbr);
 
 	if (particle_no < totpart) {
 
@@ -349,14 +357,17 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o
 	/*strands key loop data stored in cache + step->co*/
 	if (path_nbr) {
 		if (step >= 0 && step <= path_nbr) {
-			if (step <= max_k)
+			if (step <= max_k) {
 				copy_v3_v3(n_co, (cache + step)->co);
+				mul_m4_v3(particlesystem->imat, n_co);
+				mul_m4_v3(object->obmat, n_co);
+			}
 		}
 	}
 
 }
 
-static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, ParticleSystemModifierData *modifier, ParticleData *particle, int particle_no,
+static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, ParticleSystemModifierData *modifier, ParticleData *particle, int particle_no, int uv_no,
                                              float n_uv[2])
 {
 	ParticleSettings *part = 0;
@@ -370,7 +381,12 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Par
 
 	part = particlesystem->part;
 
+	if (particlesystem->renderdata) {
 		totchild = particlesystem->totchild;
+	}
+	else {
+		totchild = (int)((float)particlesystem->totchild * (float)(part->disp) / 100.0f);
+	}
 
 	/* can happen for disconnected/global hair */
 	if (part->type == PART_HAIR && !particlesystem->childcache)
@@ -395,7 +411,7 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Par
 		if (n_uv && ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME)) {
 			if (num != DMCACHE_NOTFOUND) {
 				MFace *mface = modifier->dm->getTessFaceData(modifier->dm, num, CD_MFACE);
-				MTFace *mtface = (MTFace *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MTFACE, 0);
+				MTFace *mtface = (MTFace *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MTFACE, uv_no);
 				mtface += num;
 				
 				psys_interpolate_uvs(mtface, mface->v4, particle->fuv, n_uv);
@@ -416,7 +432,7 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Par
 			if (n_uv && ELEM(PART_FROM_FACE, PART_FROM_FACE, PART_FROM_VOLUME)) {
 				if (cpa->num != DMCACHE_NOTFOUND) {
 					MFace *mface = modifier->dm->getTessFaceData(modifier->dm, cpa->num, CD_MFACE);
-					MTFace *mtface = (MTFace *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MTFACE, 0);
+					MTFace *mtface = (MTFace *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MTFACE, uv_no);
 					mtface += cpa->num;
 					
 					psys_interpolate_uvs(mtface, mface->v4, cpa->fuv, n_uv);
@@ -438,7 +454,7 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Par
 			if (n_uv && ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME)) {
 				if (num != DMCACHE_NOTFOUND) {
 					MFace *mface = modifier->dm->getTessFaceData(modifier->dm, num, CD_MFACE);
-					MTFace *mtface = (MTFace *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MTFACE, 0);
+					MTFace *mtface = (MTFace *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MTFACE, uv_no);
 					mtface += num;
 					
 					psys_interpolate_uvs(mtface, mface->v4, parent->fuv, n_uv);
@@ -452,10 +468,11 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Par
 	}
 }
 
-static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, ParticleSystemModifierData *modifier, ParticleData *particle, int particle_no, int vcol_no,
-                                             float n_mcol[3])
+static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, ParticleSystemModifierData *modifier,
+                                               ParticleData *particle, int particle_no, int vcol_no,
+                                               float n_mcol[3])
 {
-	ParticleSettings *part = 0;
+	ParticleSettings *part;
 	int totpart;
 	int totchild = 0;
 	int num;
@@ -467,7 +484,12 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, P
 
 	part = particlesystem->part;
 
+	if (particlesystem->renderdata) {
 		totchild = particlesystem->totchild;
+	}
+	else {
+		totchild = (int)((float)particlesystem->totchild * (float)(part->disp) / 100.0f);
+	}
 
 	/* can happen for disconnected/global hair */
 	if (part->type == PART_HAIR && !particlesystem->childcache)
@@ -478,7 +500,7 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, P
 	if (particle_no >= totpart + totchild)
 		return;
 
-/* 3. start creating renderable things */
+	/* 3. start creating renderable things */
 	/* setup per particle individual stuff */
 	if (particle_no < totpart) {
 
@@ -517,7 +539,7 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, P
 			if (n_mcol && ELEM(PART_FROM_FACE, PART_FROM_FACE, PART_FROM_VOLUME)) {
 				if (cpa->num != DMCACHE_NOTFOUND) {
 					MFace *mface = modifier->dm->getTessFaceData(modifier->dm, cpa->num, CD_MFACE);
-					MCol *mc = (MCol *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MCOL, 0);
+					MCol *mc = (MCol *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MCOL, vcol_no);
 					mc += cpa->num * 4;
 
 					psys_interpolate_mcol(mc, mface->v4, cpa->fuv, &mcol);
@@ -543,7 +565,7 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, P
 			if (n_mcol && ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME)) {
 				if (num != DMCACHE_NOTFOUND) {
 					MFace *mface = modifier->dm->getTessFaceData(modifier->dm, num, CD_MFACE);
-					MCol *mc = (MCol *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MCOL, 0);
+					MCol *mc = (MCol *)CustomData_get_layer_n(&modifier->dm->faceData, CD_MCOL, vcol_no);
 					mc += num * 4;
 
 					psys_interpolate_mcol(mc, mface->v4, parent->fuv, &mcol);
@@ -561,6 +583,24 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, P
 	}
 }
 
+static void rna_ParticleSystem_set_resolution(ParticleSystem *particlesystem, Scene *scene, Object *object, int resolution)
+{
+	if (resolution == eModifierMode_Render) {
+		ParticleSystemModifierData *psmd = psys_get_modifier(object, particlesystem);
+		float mat[4][4];
+
+		unit_m4(mat);
+
+		psys_render_set(object, particlesystem, mat, mat, 1, 1, 0.f);
+		psmd->flag &= ~eParticleSystemFlag_psys_updated;
+		particle_system_update(scene, object, particlesystem);
+	}
+	else {
+		if (particlesystem->renderdata)
+			psys_render_restore(object, particlesystem);
+	}
+}
+
 static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr, short flag)
 {
 	if (ptr->type == &RNA_ParticleSystem) {
@@ -1246,10 +1286,10 @@ static void rna_def_particle_hair_key(BlenderRNA *brna)
 	RNA_def_property_float_funcs(prop, "rna_ParticleHairKey_location_object_get",
 	                             "rna_ParticleHairKey_location_object_set", NULL);
 	
-	prop = RNA_def_property(srna, "co_hair_space", PROP_FLOAT, PROP_TRANSLATION);
+	prop = RNA_def_property(srna, "co_local", PROP_FLOAT, PROP_TRANSLATION);
 	RNA_def_property_float_sdna(prop, NULL, "co");
 	RNA_def_property_ui_text(prop, "Location",
-	                         "Location of the hair key in its internal coordinate system, "
+	                         "Location of the hair key in its local coordinate system, "
 	                         "relative to the emitting face");
 
 	/* Aided co func */
@@ -3044,6 +3084,12 @@ static void rna_def_particle_system(BlenderRNA *brna)
 	PropertyRNA *prop;
 	FunctionRNA *func;
 
+	static EnumPropertyItem resolution_items[] = {
+		{eModifierMode_Realtime, "PREVIEW", 0, "Preview", "Apply modifier preview settings"},
+		{eModifierMode_Render, "RENDER", 0, "Render", "Apply modifier render settings"},
+		{0, NULL, 0, NULL, NULL}
+	};
+
 	srna = RNA_def_struct(brna, "ParticleSystem", NULL);
 	RNA_def_struct_ui_text(srna, "Particle System", "Particle system in an object");
 	RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
@@ -3342,6 +3388,13 @@ static void rna_def_particle_system(BlenderRNA *brna)
 
 	RNA_def_struct_path_func(srna, "rna_ParticleSystem_path");
 
+	/* set viewport or render resolution */
+	func = RNA_def_function(srna, "set_resolution", "rna_ParticleSystem_set_resolution");
+	RNA_def_function_ui_description(func, "Set the resolution to use for the number of particles");
+	prop = RNA_def_pointer(func, "scene", "Scene", "", "Scene");
+	prop = RNA_def_pointer(func, "object", "Object", "", "Object");
+	prop = RNA_def_enum(func, "resolution", resolution_items, 0, "", "Resolution settings to apply");
+
 	/* extract cached hair location data */
 	func = RNA_def_function(srna, "co_hair", "rna_ParticleSystem_co_hair");
 	RNA_def_function_ui_description(func, "Obtain cache hair data");
@@ -3362,6 +3415,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
 	prop = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier");
 	prop = RNA_def_pointer(func, "particle", "Particle", "", "Particle");
 	prop = RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX);
+	prop = RNA_def_int(func, "uv_no", 0, INT_MIN, INT_MAX, "UV no", "", INT_MIN, INT_MAX);
 	prop = RNA_def_property(func, "uv", PROP_FLOAT, PROP_COORDS);
 	RNA_def_property_array(prop, 2);
 	RNA_def_property_flag(prop, PROP_THICK_WRAP);
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c
new file mode 100644
index 0000000..7270cca
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@ -0,0 +1,1007 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Blender Foundation 2013, Joshua Leung, Sergej Reich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file rna_rigidbody.c
+ *  \ingroup rna
+ *  \brief RNA property definitions for Rigid Body datatypes
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "RNA_define.h"
+
+#include "rna_internal.h"
+
+#include "DNA_group_types.h"
+#include "DNA_object_types.h"
+#include "DNA_rigidbody_types.h"
+#include "DNA_scene_types.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_math.h"
+
+#include "WM_types.h"
+
+/* roles of objects in RigidBody Sims */
+EnumPropertyItem rigidbody_ob_type_items[] = {
+	{RBO_TYPE_ACTIVE, "ACTIVE", 0, "Active", "Object is directly controlled by simulation results"},
+	{RBO_TYPE_PASSIVE, "PASSIVE", 0, "Passive", "Object is directly controlled by animation system"},
+	{0, NULL, 0, NULL, NULL}};
+
+/* collision shapes of objects in rigid body sim */
+EnumPropertyItem rigidbody_ob_shape_items[] = {
+	{RB_SHAPE_BOX, "BOX", ICON_MESH_CUBE, "Box", "Box-like shapes (i.e. cubes), including planes (i.e. ground planes)"},
+	{RB_SHAPE_SPHERE, "SPHERE", ICON_MESH_UVSPHERE, "Sphere", ""},
+	{RB_SHAPE_CAPSULE, "CAPSULE", ICON_OUTLINER_OB_META, "Capsule", ""},
+	{RB_SHAPE_CYLINDER, "CYLINDER", ICON_MESH_CYLINDER, "Cylinder", ""},
+	{RB_SHAPE_CONE, "CONE", ICON_MESH_CONE, "Cone", ""},
+	{RB_SHAPE_CONVEXH, "CONVEX_HULL", ICON_MESH_ICOSPHERE, "Convex Hull",
+	                   "A mesh-like surface encompassing (i.e. shrinkwrap over) all vertices (best results with "
+	                   "fewer vertices)"},
+	{RB_SHAPE_TRIMESH, "MESH", ICON_MESH_MONKEY, "Mesh",
+	                   "Mesh consisting of triangles only, allowing for more detailed interactions than convex hulls"},
+	{0, NULL, 0, NULL, NULL}};
+
+/* collision shapes of constraints in rigid body sim */
+EnumPropertyItem rigidbody_con_type_items[] = {
+	{RBC_TYPE_FIXED, "FIXED", ICON_NONE, "Fixed", "Glue rigid bodies together"},
+	{RBC_TYPE_POINT, "POINT", ICON_NONE, "Point", "Constrain rigid bodies to move around common pivot point"},
+	{RBC_TYPE_HINGE, "HINGE", ICON_NONE, "Hinge", "Restrict rigid body rotation to one axis"},
+	{RBC_TYPE_SLIDER, "SLIDER", ICON_NONE, "Slider", "Restrict rigid body translation to one axis"},
+	{RBC_TYPE_PISTON, "PISTON", ICON_NONE, "Piston", "Restrict rigid body translation and rotation to one axis"},
+	{RBC_TYPE_6DOF, "GENERIC", ICON_NONE, "Generic", "Restrict translation and rotation to specified axes"},
+	{RBC_TYPE_6DOF_SPRING, "GENERIC_SPRING", ICON_NONE, "Generic Spring",
+	                       "Restrict translation and rotation to specified axes with springs"},
+	{0, NULL, 0, NULL, NULL}};
+
+
+#ifdef RNA_RUNTIME
+
+#ifdef WITH_BULLET
+#  include "RBI_api.h"
+#endif
+
+#include "BKE_depsgraph.h"
+#include "BKE_rigidbody.h"
+
+#define RB_FLAG_SET(dest, value, flag) { \
+	if (value) \
+		dest |= flag; \
+	else \
+		dest &= ~flag; \
+}
+
+
+/* ******************************** */
+
+static void rna_RigidBodyWorld_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+	RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
+	
+	BKE_rigidbody_cache_reset(rbw);
+}
+
+static char *rna_RigidBodyWorld_path(PointerRNA *ptr)
+{	
+	return BLI_sprintfN("rigidbody_world");
+}
+
+static void rna_RigidBodyWorld_num_solver_iterations_set(PointerRNA *ptr, int value)
+{
+	RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
+	
+	rbw->num_solver_iterations = value;
+
+#ifdef WITH_BULLET
+	if (rbw->physics_world) {
+		RB_dworld_set_solver_iterations(rbw->physics_world, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value)
+{
+	RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
+	
+	RB_FLAG_SET(rbw->flag, value, RBW_FLAG_USE_SPLIT_IMPULSE);
+
+#ifdef WITH_BULLET
+	if (rbw->physics_world) {
+		RB_dworld_set_split_impulse(rbw->physics_world, value);
+	}
+#endif
+}
+
+/* ******************************** */
+
+static void rna_RigidBodyOb_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+	
+	BKE_rigidbody_cache_reset(rbw);
+}
+
+static void rna_RigidBodyOb_shape_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+	RigidBodyWorld *rbw = scene->rigidbody_world;
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	BKE_rigidbody_cache_reset(rbw);
+	if (rbo->physics_shape)
+		rbo->flag |= RBO_FLAG_NEEDS_RESHAPE;
+}
+
+static char *rna_RigidBodyOb_path(PointerRNA *ptr)
+{
+	/* NOTE: this hardcoded path should work as long as only Objects have this */
+	return BLI_sprintfN("rigid_body");
+}
+
+static void rna_RigidBodyOb_type_set(PointerRNA *ptr, int value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->type = value;
+	rbo->flag |= RBO_FLAG_NEEDS_VALIDATE;
+}
+
+static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	RB_FLAG_SET(rbo->flag, !value, RBO_FLAG_DISABLED);
+
+#ifdef WITH_BULLET
+	/* update kinematic state if necessary - only needed for active bodies */
+	if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
+		RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
+		RB_body_set_kinematic_state(rbo->physics_object, !value);
+		rbo->flag |= RBO_FLAG_NEEDS_VALIDATE;
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_mass_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->mass = value;
+
+#ifdef WITH_BULLET
+	/* only active bodies need mass update */
+	if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
+		RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_friction_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->friction = value;
+
+#ifdef WITH_BULLET
+	if (rbo->physics_object) {
+		RB_body_set_friction(rbo->physics_object, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_restitution_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->restitution = value;
+#ifdef WITH_BULLET
+	if (rbo->physics_object) {
+		RB_body_set_restitution(rbo->physics_object, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_collision_margin_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->margin = value;
+
+#ifdef WITH_BULLET
+	if (rbo->physics_shape) {
+		RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	RB_FLAG_SET(rbo->flag, value, RBO_FLAG_KINEMATIC);
+
+#ifdef WITH_BULLET
+	/* update kinematic state if necessary */
+	if (rbo->physics_object) {
+		RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
+		RB_body_set_kinematic_state(rbo->physics_object, value);
+		rbo->flag |= RBO_FLAG_NEEDS_VALIDATE;
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, int value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	RB_FLAG_SET(rbo->flag, value, RBO_FLAG_USE_DEACTIVATION);
+
+#ifdef WITH_BULLET
+	/* update activation state if necessary - only active bodies can be deactivated */
+	if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
+		RB_body_set_activation_state(rbo->physics_object, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_linear_sleepThresh_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->lin_sleep_thresh = value;
+
+#ifdef WITH_BULLET
+	/* only active bodies need sleep threshold update */
+	if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
+		RB_body_set_linear_sleep_thresh(rbo->physics_object, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_angular_sleepThresh_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->ang_sleep_thresh = value;
+
+#ifdef WITH_BULLET
+	/* only active bodies need sleep threshold update */
+	if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
+		RB_body_set_angular_sleep_thresh(rbo->physics_object, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_linear_damping_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->lin_damping = value;
+
+#ifdef WITH_BULLET
+	/* only active bodies need damping update */
+	if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
+		RB_body_set_linear_damping(rbo->physics_object, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyOb_angular_damping_set(PointerRNA *ptr, float value)
+{
+	RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
+	
+	rbo->ang_damping = value;
+
+#ifdef WITH_BULLET
+	/* only active bodies need damping update */
+	if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
+		RB_body_set_angular_damping(rbo->physics_object, value);
+	}
+#endif
+}
+
+static char *rna_RigidBodyCon_path(PointerRNA *ptr)
+{
+	/* NOTE: this hardcoded path should work as long as only Objects have this */
+	return BLI_sprintfN("rigid_body_constraint");
+}
+
+static void rna_RigidBodyCon_type_set(PointerRNA *ptr, int value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->type = value;
+	rbc->flag |= RBC_FLAG_NEEDS_VALIDATE;
+}
+
+static void rna_RigidBodyCon_enabled_set(PointerRNA *ptr, int value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	RB_FLAG_SET(rbc->flag, value, RBC_FLAG_ENABLED);
+
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint) {
+		RB_constraint_set_enabled(rbc->physics_constraint, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_disable_collisions_set(PointerRNA *ptr, int value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	RB_FLAG_SET(rbc->flag, value, RBC_FLAG_DISABLE_COLLISIONS);
+
+	rbc->flag |= RBC_FLAG_NEEDS_VALIDATE;
+}
+
+static void rna_RigidBodyCon_use_breaking_set(PointerRNA *ptr, int value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	if (value) {
+		rbc->flag |= RBC_FLAG_USE_BREAKING;
+#ifdef WITH_BULLET
+		if (rbc->physics_constraint) {
+			RB_constraint_set_breaking_threshold(rbc->physics_constraint, rbc->breaking_threshold);
+		}
+#endif
+	}
+	else {
+		rbc->flag &= ~RBC_FLAG_USE_BREAKING;
+#ifdef WITH_BULLET
+		if (rbc->physics_constraint) {
+			RB_constraint_set_breaking_threshold(rbc->physics_constraint, FLT_MAX);
+		}
+#endif
+	}
+}
+
+static void rna_RigidBodyCon_breaking_threshold_set(PointerRNA *ptr, float value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->breaking_threshold = value;
+
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_USE_BREAKING)) {
+		RB_constraint_set_breaking_threshold(rbc->physics_constraint, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_override_solver_iterations_set(PointerRNA *ptr, int value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	if (value) {
+		rbc->flag |= RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS;
+#ifdef WITH_BULLET
+		if (rbc->physics_constraint) {
+			RB_constraint_set_solver_iterations(rbc->physics_constraint, rbc->num_solver_iterations);
+		}
+#endif
+	}
+	else {
+		rbc->flag &= ~RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS;
+#ifdef WITH_BULLET
+		if (rbc->physics_constraint) {
+			RB_constraint_set_solver_iterations(rbc->physics_constraint, -1);
+		}
+#endif
+	}
+}
+
+static void rna_RigidBodyCon_num_solver_iterations_set(PointerRNA *ptr, int value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->num_solver_iterations = value;
+
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS)) {
+		RB_constraint_set_solver_iterations(rbc->physics_constraint, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_spring_stiffness_x_set(PointerRNA *ptr, float value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->spring_stiffness_x = value;
+
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) {
+		RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_spring_stiffness_y_set(PointerRNA *ptr, float value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->spring_stiffness_y = value;
+
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) {
+		RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_spring_stiffness_z_set(PointerRNA *ptr, float value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->spring_stiffness_z = value;
+
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) {
+		RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_spring_damping_x_set(PointerRNA *ptr, float value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->spring_damping_x = value;
+
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) {
+		RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_spring_damping_y_set(PointerRNA *ptr, float value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->spring_damping_y = value;
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) {
+		RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, value);
+	}
+#endif
+}
+
+static void rna_RigidBodyCon_spring_damping_z_set(PointerRNA *ptr, float value)
+{
+	RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
+
+	rbc->spring_damping_z = value;
+#ifdef WITH_BULLET
+	if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) {
+		RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, value);
+	}
+#endif
+}
+
+#else
+
+static void rna_def_rigidbody_world(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+	
+	srna = RNA_def_struct(brna, "RigidBodyWorld", NULL);
+	RNA_def_struct_sdna(srna, "RigidBodyWorld");
+	RNA_def_struct_ui_text(srna, "Rigid Body World", "Self-contained rigid body simulation environment and settings");
+	RNA_def_struct_path_func(srna, "rna_RigidBodyWorld_path");
+	
+	/* groups */
+	prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "Group");
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
+	RNA_def_property_ui_text(prop, "Group", "Group containing objects participating in this simulation");
+	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
+
+	prop = RNA_def_property(srna, "constraints", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "Group");
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
+	RNA_def_property_ui_text(prop, "Constraints", "Group containing rigid body constraint objects");
+	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
+	
+	/* booleans */
+	prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", RBW_FLAG_MUTED);
+	RNA_def_property_ui_text(prop, "Enabled", "Simulation will be evaluated");
+	RNA_def_property_update(prop, NC_SCENE, NULL);
+	
+	/* time scale */
+	prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "time_scale");
+	RNA_def_property_range(prop, 0.0f, 100.0f);
+	RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_ui_text(prop, "Time Scale", "Change the speed of the simulation");
+	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
+	
+	/* timestep */
+	prop = RNA_def_property(srna, "steps_per_second", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "steps_per_second");
+	RNA_def_property_range(prop, 1, SHRT_MAX);
+	RNA_def_property_ui_range(prop, 60, 1000, 1, 0);
+	RNA_def_property_int_default(prop, 60);
+	RNA_def_property_ui_text(prop, "Steps Per Second",
+	                         "Number of simulation steps taken per second (higher values are more accurate "
+	                         "but slower)");
+	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
+	
+	/* constraint solver iterations */
+	prop = RNA_def_property(srna, "num_solver_iterations", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "num_solver_iterations");
+	RNA_def_property_range(prop, 1, 1000);
+	RNA_def_property_ui_range(prop, 10, 100, 1, 0);
+	RNA_def_property_int_default(prop, 10);
+	RNA_def_property_int_funcs(prop, NULL, "rna_RigidBodyWorld_num_solver_iterations_set", NULL);
+	RNA_def_property_ui_text(prop, "Solver Iterations",
+	                         "Number of constraint solver iterations made per simulation step (higher values are more "
+	                         "accurate but slower)");
+	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
+	
+	/* split impulse */
+	prop = RNA_def_property(srna, "use_split_impulse", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBW_FLAG_USE_SPLIT_IMPULSE);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyWorld_split_impulse_set");
+	RNA_def_property_ui_text(prop, "Split Impulse",
+	                         "Reduce extra velocity that can build up when objects collide (lowers simulation "
+	                         "stability a little so use only when necessary)");
+	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
+
+	/* cache */
+	prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+	RNA_def_property_flag(prop, PROP_NEVER_NULL);
+	RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
+	RNA_def_property_ui_text(prop, "Point Cache", "");
+
+	/* effector weights */
+	prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "EffectorWeights");
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+	RNA_def_property_ui_text(prop, "Effector Weights", "");
+}
+
+static void rna_def_rigidbody_object(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+	
+	
+	srna = RNA_def_struct(brna, "RigidBodyObject", NULL);
+	RNA_def_struct_sdna(srna, "RigidBodyOb");
+	RNA_def_struct_ui_text(srna, "Rigid Body Object", "Settings for object participating in Rigid Body Simulation");
+	RNA_def_struct_path_func(srna, "rna_RigidBodyOb_path");
+	
+	/* Enums */
+	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "type");
+	RNA_def_property_enum_items(prop, rigidbody_ob_type_items);
+	RNA_def_property_enum_funcs(prop, NULL, "rna_RigidBodyOb_type_set", NULL);
+	RNA_def_property_ui_text(prop, "Type", "Role of object in Rigid Body Simulations");
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	/* booleans */
+	prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", RBO_FLAG_DISABLED);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_disabled_set");
+	RNA_def_property_ui_text(prop, "Enabled", "Rigid Body actively participates to the simulation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	prop = RNA_def_property(srna, "collision_shape", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "shape");
+	RNA_def_property_enum_items(prop, rigidbody_ob_shape_items);
+	RNA_def_property_ui_text(prop, "Collision Shape", "Collision Shape of object in Rigid Body Simulations");
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	prop = RNA_def_property(srna, "kinematic", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_KINEMATIC);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_kinematic_state_set");
+	RNA_def_property_ui_text(prop, "Kinematic", "Allow rigid body to be controlled by the animation system");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	/* Physics Parameters */
+	prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_UNIT_MASS);
+	RNA_def_property_float_sdna(prop, NULL, "mass");
+	RNA_def_property_range(prop, 0.001f, FLT_MAX); // range must always be positive (and non-zero)
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_mass_set", NULL);
+	RNA_def_property_ui_text(prop, "Mass", "How much the object 'weighs' irrespective of gravity");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	/* Dynamics Parameters - Activation */
+	// TODO: define and figure out how to implement these
+	
+	/* Dynamics Parameters - Deactivation */
+	prop = RNA_def_property(srna, "use_deactivation", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_USE_DEACTIVATION);
+	RNA_def_property_boolean_default(prop, TRUE);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_activation_state_set");
+	RNA_def_property_ui_text(prop, "Enable Deactivation",
+	                         "Enable deactivation of resting rigid bodies (increases performance and stability "
+	                         "but can cause glitches)");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	prop = RNA_def_property(srna, "start_deactivated", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_START_DEACTIVATED);
+	RNA_def_property_ui_text(prop, "Start Deactivated", "Deactivate rigid body at the start of the simulation");
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	prop = RNA_def_property(srna, "deactivate_linear_velocity", PROP_FLOAT, PROP_UNIT_VELOCITY);
+	RNA_def_property_float_sdna(prop, NULL, "lin_sleep_thresh");
+	RNA_def_property_range(prop, FLT_MIN, FLT_MAX); // range must always be positive (and non-zero)
+	RNA_def_property_float_default(prop, 0.4f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_linear_sleepThresh_set", NULL);
+	RNA_def_property_ui_text(prop, "Linear Velocity Deactivation Threshold",
+	                         "Linear Velocity below which simulation stops simulating object");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	prop = RNA_def_property(srna, "deactivate_angular_velocity", PROP_FLOAT, PROP_UNIT_VELOCITY);
+	RNA_def_property_float_sdna(prop, NULL, "ang_sleep_thresh");
+	RNA_def_property_range(prop, FLT_MIN, FLT_MAX); // range must always be positive (and non-zero)
+	RNA_def_property_float_default(prop, 0.5f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_angular_sleepThresh_set", NULL);
+	RNA_def_property_ui_text(prop, "Angular Velocity Deactivation Threshold",
+	                         "Angular Velocity below which simulation stops simulating object");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	/* Dynamics Parameters - Damping Parameters */
+	prop = RNA_def_property(srna, "linear_damping", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "lin_damping");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_float_default(prop, 0.04f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_linear_damping_set", NULL);
+	RNA_def_property_ui_text(prop, "Linear Damping", "Amount of linear velocity that is lost over time");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	prop = RNA_def_property(srna, "angular_damping", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "ang_damping");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_float_default(prop, 0.1f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_angular_damping_set", NULL);
+	RNA_def_property_ui_text(prop, "Angular Damping", "Amount of angular velocity that is lost over time");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	/* Collision Parameters - Surface Parameters */
+	prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "friction");
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
+	RNA_def_property_float_default(prop, 0.5f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_friction_set", NULL);
+	RNA_def_property_ui_text(prop, "Friction", "Resistance of object to movement");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	prop = RNA_def_property(srna, "restitution", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "restitution");
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
+	RNA_def_property_float_default(prop, 0.0f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_restitution_set", NULL);
+	RNA_def_property_ui_text(prop, "Restitution",
+	                         "Tendency of object to bounce after colliding with another "
+	                         "(0 = stays still, 1 = perfectly elastic)");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	
+	/* Collision Parameters - Sensitivity */
+	prop = RNA_def_property(srna, "use_margin", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_USE_MARGIN);
+	RNA_def_property_boolean_default(prop, FALSE);
+	RNA_def_property_ui_text(prop, "Collision Margin",
+	                         "Use custom collision margin (some shapes will have a visible gap around them)");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_reset");
+	
+	prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_UNIT_LENGTH);
+	RNA_def_property_float_sdna(prop, NULL, "margin");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 3);
+	RNA_def_property_float_default(prop, 0.04f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_collision_margin_set", NULL);
+	RNA_def_property_ui_text(prop, "Collision Margin",
+	                         "Threshold of distance near surface where collisions are still considered "
+	                         "(best results when non-zero)");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_reset");
+	
+	prop = RNA_def_property(srna, "collision_groups", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+	RNA_def_property_boolean_sdna(prop, NULL, "col_groups", 1);
+	RNA_def_property_array(prop, 20);
+	RNA_def_property_ui_text(prop, "Collision Groups", "Collision Groups Rigid Body belongs to");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
+}
+
+static void rna_def_rigidbody_constraint(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	srna = RNA_def_struct(brna, "RigidBodyConstraint", NULL);
+	RNA_def_struct_sdna(srna, "RigidBodyCon");
+	RNA_def_struct_ui_text(srna, "Rigid Body Constraint",
+	                       "Constraint influencing Objects inside Rigid Body Simulation");
+	RNA_def_struct_path_func(srna, "rna_RigidBodyCon_path");
+
+	/* Enums */
+	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "type");
+	RNA_def_property_enum_items(prop, rigidbody_con_type_items);
+	RNA_def_property_enum_funcs(prop, NULL, "rna_RigidBodyCon_type_set", NULL);
+	RNA_def_property_ui_text(prop, "Type", "Type of Rigid Body Constraint");
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_ENABLED);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_enabled_set");
+	RNA_def_property_ui_text(prop, "Enabled", "Enable this constraint");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "disable_collisions", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_DISABLE_COLLISIONS);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_disable_collisions_set");
+	RNA_def_property_ui_text(prop, "Disable Collisions", "Disable collisions between constrained rigid bodies");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "object1", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "ob1");
+	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_ui_text(prop, "Object 1", "First Rigid Body Object to be constrained");
+	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "object2", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "ob2");
+	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_ui_text(prop, "Object 2", "Second Rigid Body Object to be constrained");
+	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	/* Breaking Threshold */
+	prop = RNA_def_property(srna, "use_breaking", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_BREAKING);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_use_breaking_set");
+	RNA_def_property_ui_text(prop, "Breakable",
+	                         "Constraint can be broken if it receives an impulse above the threshold");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "breaking_threshold", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "breaking_threshold");
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 100.0, 2);
+	RNA_def_property_float_default(prop, 10.0f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_breaking_threshold_set", NULL);
+	RNA_def_property_ui_text(prop, "Breaking Threshold",
+	                         "Impulse threshold that must be reached for the constraint to break");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	/* Solver Iterations */
+	prop = RNA_def_property(srna, "override_solver_iterations", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS);
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_override_solver_iterations_set");
+	RNA_def_property_ui_text(prop, "Override Solver Iterations",
+	                         "Override the number of solver iterations for this constraint");
+	RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "num_solver_iterations", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "num_solver_iterations");
+	RNA_def_property_range(prop, 1, 1000);
+	RNA_def_property_ui_range(prop, 1, 100, 1, 0);
+	RNA_def_property_int_default(prop, 10);
+	RNA_def_property_int_funcs(prop, NULL, "rna_RigidBodyCon_num_solver_iterations_set", NULL);
+	RNA_def_property_ui_text(prop, "Solver Iterations",
+	                         "Number of constraint solver iterations made per simulation step (higher values are more "
+	                         "accurate but slower)");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	/* Limits */
+	prop = RNA_def_property(srna, "use_limit_lin_x", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_X);
+	RNA_def_property_ui_text(prop, "X Axis", "Limit translation on X axis");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_limit_lin_y", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_Y);
+	RNA_def_property_ui_text(prop, "Y Axis", "Limit translation on Y axis");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_limit_lin_z", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_Z);
+	RNA_def_property_ui_text(prop, "Z Axis", "Limit translation on Z axis");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_limit_ang_x", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_X);
+	RNA_def_property_ui_text(prop, "X Angle", "Limit rotation around X axis");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_limit_ang_y", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_Y);
+	RNA_def_property_ui_text(prop, "Y Angle", "Limit rotation around Y axis");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_limit_ang_z", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_Z);
+	RNA_def_property_ui_text(prop, "Z Angle", "Limit rotation around Z axis");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_spring_x", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_X);
+	RNA_def_property_ui_text(prop, "X Spring", "Enable spring on X axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_spring_y", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_Y);
+	RNA_def_property_ui_text(prop, "Y Spring", "Enable spring on Y axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "use_spring_z", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_Z);
+	RNA_def_property_ui_text(prop, "Z Spring", "Enable spring on Z axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_lin_x_lower", PROP_FLOAT, PROP_UNIT_LENGTH);
+	RNA_def_property_float_sdna(prop, NULL, "limit_lin_x_lower");
+	RNA_def_property_float_default(prop, -1.0f);
+	RNA_def_property_ui_text(prop, "Lower X Limit", "Lower limit of X axis translation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_lin_x_upper", PROP_FLOAT, PROP_UNIT_LENGTH);
+	RNA_def_property_float_sdna(prop, NULL, "limit_lin_x_upper");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_ui_text(prop, "Upper X Limit", "Upper limit of X axis translation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_lin_y_lower", PROP_FLOAT, PROP_UNIT_LENGTH);
+	RNA_def_property_float_sdna(prop, NULL, "limit_lin_y_lower");
+	RNA_def_property_float_default(prop, -1.0f);
+	RNA_def_property_ui_text(prop, "Lower Y Limit", "Lower limit of Y axis translation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_lin_y_upper", PROP_FLOAT, PROP_UNIT_LENGTH);
+	RNA_def_property_float_sdna(prop, NULL, "limit_lin_y_upper");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_ui_text(prop, "Upper Y Limit", "Upper limit of Y axis translation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_lin_z_lower", PROP_FLOAT, PROP_UNIT_LENGTH);
+	RNA_def_property_float_sdna(prop, NULL, "limit_lin_z_lower");
+	RNA_def_property_float_default(prop, -1.0f);
+	RNA_def_property_ui_text(prop, "Lower Z Limit", "Lower limit of Z axis translation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_lin_z_upper", PROP_FLOAT, PROP_UNIT_LENGTH);
+	RNA_def_property_float_sdna(prop, NULL, "limit_lin_z_upper");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_ui_text(prop, "Upper Z Limit", "Upper limit of Z axis translation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_ang_x_lower", PROP_FLOAT, PROP_ANGLE);
+	RNA_def_property_float_sdna(prop, NULL, "limit_ang_x_lower");
+	RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
+	RNA_def_property_float_default(prop, -M_PI_4);
+	RNA_def_property_ui_text(prop, "Lower X Angle Limit", "Lower limit of X axis rotation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_ang_x_upper", PROP_FLOAT, PROP_ANGLE);
+	RNA_def_property_float_sdna(prop, NULL, "limit_ang_x_upper");
+	RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
+	RNA_def_property_float_default(prop, M_PI_4);
+	RNA_def_property_ui_text(prop, "Upper X Angle Limit", "Upper limit of X axis rotation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_ang_y_lower", PROP_FLOAT, PROP_ANGLE);
+	RNA_def_property_float_sdna(prop, NULL, "limit_ang_y_lower");
+	RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
+	RNA_def_property_float_default(prop, -M_PI_4);
+	RNA_def_property_ui_text(prop, "Lower Y Angle Limit", "Lower limit of Y axis rotation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_ang_y_upper", PROP_FLOAT, PROP_ANGLE);
+	RNA_def_property_float_sdna(prop, NULL, "limit_ang_y_upper");
+	RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
+	RNA_def_property_float_default(prop, M_PI_4);
+	RNA_def_property_ui_text(prop, "Upper Y Angle Limit", "Upper limit of Y axis rotation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_ang_z_lower", PROP_FLOAT, PROP_ANGLE);
+	RNA_def_property_float_sdna(prop, NULL, "limit_ang_z_lower");
+	RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
+	RNA_def_property_float_default(prop, -M_PI_4);
+	RNA_def_property_ui_text(prop, "Lower Z Angle Limit", "Lower limit of Z axis rotation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "limit_ang_z_upper", PROP_FLOAT, PROP_ANGLE);
+	RNA_def_property_float_sdna(prop, NULL, "limit_ang_z_upper");
+	RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
+	RNA_def_property_float_default(prop, M_PI_4);
+	RNA_def_property_ui_text(prop, "Upper Z Angle Limit", "Upper limit of Z axis rotation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "spring_stiffness_x", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "spring_stiffness_x");
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
+	RNA_def_property_float_default(prop, 10.0f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_stiffness_x_set", NULL);
+	RNA_def_property_ui_text(prop, "X Axis Stiffness", "Stiffness on the X axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "spring_stiffness_y", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "spring_stiffness_y");
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
+	RNA_def_property_float_default(prop, 10.0f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_stiffness_y_set", NULL);
+	RNA_def_property_ui_text(prop, "Y Axis Stiffness", "Stiffness on the Y axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "spring_stiffness_z", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "spring_stiffness_z");
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
+	RNA_def_property_float_default(prop, 10.0f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_stiffness_z_set", NULL);
+	RNA_def_property_ui_text(prop, "Z Axis Stiffness", "Stiffness on the Z axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "spring_damping_x", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "spring_damping_x");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_float_default(prop, 0.5f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_x_set", NULL);
+	RNA_def_property_ui_text(prop, "Damping X", "Damping on the X axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "spring_damping_y", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "spring_damping_y");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_float_default(prop, 0.5f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_y_set", NULL);
+	RNA_def_property_ui_text(prop, "Damping Y", "Damping on the Y axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+
+	prop = RNA_def_property(srna, "spring_damping_z", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "spring_damping_z");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_float_default(prop, 0.5f);
+	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_z_set", NULL);
+	RNA_def_property_ui_text(prop, "Damping Z", "Damping on the Z axis");
+	RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
+}
+
+void RNA_def_rigidbody(BlenderRNA *brna)
+{
+	rna_def_rigidbody_world(brna);
+	rna_def_rigidbody_object(brna);
+	rna_def_rigidbody_constraint(brna);
+}
+
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 3f03445..9bd20d8 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -31,6 +31,7 @@
 
 #include "RNA_access.h"
 #include "RNA_define.h"
+#include "RNA_enum_types.h"
 
 #include "rna_internal.h"
 
@@ -45,6 +46,9 @@ EnumPropertyItem property_type_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
+/* XXX Keep in sync with bpy_props.c's property_subtype_xxx_items ???
+ *     Currently it is not...
+ */
 EnumPropertyItem property_subtype_items[] = {
 	{PROP_NONE, "NONE", 0, "None", ""},
 
@@ -52,7 +56,7 @@ EnumPropertyItem property_subtype_items[] = {
 	{PROP_FILEPATH, "FILEPATH", 0, "File Path", ""},
 	{PROP_DIRPATH, "DIRPATH", 0, "Directory Path", ""},
 	{PROP_FILENAME, "FILENAME", 0, "File Name", ""},
-	{PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
+	{PROP_PASSWORD, "PASSWORD", 0, "Password", "A string that is displayed hidden ('********')"},
 
 	/* numbers */
 	{PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""},
@@ -522,6 +526,13 @@ static int rna_Property_unit_get(PointerRNA *ptr)
 	return RNA_SUBTYPE_UNIT(prop->subtype);
 }
 
+static int rna_Property_icon_get(PointerRNA *ptr)
+{
+	PropertyRNA *prop = (PropertyRNA *)ptr->data;
+	rna_idproperty_check(&prop, ptr);
+	return prop->icon;
+}
+
 static int rna_Property_readonly_get(PointerRNA *ptr)
 {
 	PropertyRNA *prop = (PropertyRNA *)ptr->data;
@@ -880,6 +891,11 @@ static int rna_EnumPropertyItem_value_get(PointerRNA *ptr)
 	return ((EnumPropertyItem *)ptr->data)->value;
 }
 
+static int rna_EnumPropertyItem_icon_get(PointerRNA *ptr)
+{
+	return ((EnumPropertyItem *)ptr->data)->icon;
+}
+
 static PointerRNA rna_PointerProperty_fixed_type_get(PointerRNA *ptr)
 {
 	PropertyRNA *prop = (PropertyRNA *)ptr->data;
@@ -930,7 +946,7 @@ static int rna_Function_registered_get(PointerRNA *ptr)
 static int rna_Function_registered_optional_get(PointerRNA *ptr)
 {
 	FunctionRNA *func = (FunctionRNA *)ptr->data;
-	return func->flag & FUNC_REGISTER_OPTIONAL;
+	return func->flag & (FUNC_REGISTER_OPTIONAL & ~FUNC_REGISTER);
 }
 
 static int rna_Function_no_self_get(PointerRNA *ptr)
@@ -1131,6 +1147,12 @@ static void rna_def_property(BlenderRNA *brna)
 	RNA_def_property_enum_funcs(prop, "rna_Property_unit_get", NULL, NULL);
 	RNA_def_property_ui_text(prop, "Unit", "Type of units for this property");
 
+	prop = RNA_def_property(srna, "icon", PROP_ENUM, PROP_NONE);
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+	RNA_def_property_enum_items(prop, icon_items);
+	RNA_def_property_enum_funcs(prop, "rna_Property_icon_get", NULL, NULL);
+	RNA_def_property_ui_text(prop, "Icon", "Icon of the item");
+
 	prop = RNA_def_property(srna, "is_readonly", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 	RNA_def_property_boolean_funcs(prop, "rna_Property_readonly_get", NULL);
@@ -1408,6 +1430,12 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 	RNA_def_property_int_funcs(prop, "rna_EnumPropertyItem_value_get", NULL, NULL);
 	RNA_def_property_ui_text(prop, "Value", "Value of the item");
+
+	prop = RNA_def_property(srna, "icon", PROP_ENUM, PROP_NONE);
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+	RNA_def_property_enum_items(prop, icon_items);
+	RNA_def_property_enum_funcs(prop, "rna_EnumPropertyItem_icon_get", NULL, NULL);
+	RNA_def_property_ui_text(prop, "Icon", "Icon of the item");
 }
 
 static void rna_def_pointer_property(StructRNA *srna, PropertyType type)
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 663e09e..833d8e6 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -35,6 +35,7 @@
 #include "DNA_group_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_particle_types.h"
+#include "DNA_rigidbody_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 #include "DNA_world_types.h"
@@ -405,7 +406,7 @@ static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *o
 		scene->basact = NULL;
 	}
 
-	BLI_remlink(&scene->base, base);
+	BKE_scene_base_unlink(scene, base);
 	MEM_freeN(base);
 
 	ob->id.us--;
@@ -1420,6 +1421,11 @@ static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, flo
 	ups->unprojected_radius = value;
 }
 
+static char *rna_UnifiedPaintSettings_path(PointerRNA *ptr)
+{
+	return BLI_strdup("tool_settings.unified_paint_settings");
+}
+
 /* note: without this, when Multi-Paint is activated/deactivated, the colors
  * will not change right away when multiple bones are selected, this function
  * is not for general use and only for the few cases where changing scene
@@ -1449,6 +1455,11 @@ static void rna_SceneSequencer_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
 	BKE_sequencer_preprocessed_cache_cleanup();
 }
 
+static char *rna_ToolSettings_path(PointerRNA *ptr)
+{
+	return BLI_strdup("tool_settings");
+}
+
 #else
 
 static void rna_def_transform_orientation(BlenderRNA *brna)
@@ -1520,6 +1531,7 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 	};
 
 	srna = RNA_def_struct(brna, "ToolSettings", NULL);
+	RNA_def_struct_path_func(srna, "rna_ToolSettings_path");
 	RNA_def_struct_ui_text(srna, "Tool Settings", "");
 	
 	prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
@@ -1762,28 +1774,29 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 	/* etch-a-ton */
 	prop = RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
-	RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
+	RNA_def_property_ui_text(prop, "Use Bone Sketching", "Use sketching to create and edit bones");
 /*	RNA_def_property_ui_icon(prop, ICON_EDIT, 0); */
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
 	prop = RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
-	RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
+	RNA_def_property_ui_text(prop, "Quick Sketching", "Automatically convert and delete on stroke end");
 
 	prop = RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
-	RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
+	RNA_def_property_ui_text(prop, "Overdraw Sketching", "Adjust strokes by drawing near them");
 	
 	prop = RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
-	RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
+	RNA_def_property_ui_text(prop, "Autoname Bones", "Automatically generate values to replace &N and &S suffix placeholders in template names");
 
 	prop = RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
-	RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
+	RNA_def_property_ui_text(prop, "Number", "Text to replace &N with (e.g. 'Finger.&N' -> 'Finger.1' or 'Finger.One')");
 
 	prop = RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
-	RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
+	RNA_def_property_ui_text(prop, "Side", "Text to replace &S with (e.g. 'Arm.&S' -> 'Arm.R' or 'Arm.Right')");
 
 	prop = RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
@@ -1802,14 +1815,14 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 	RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
 	RNA_def_property_range(prop, 0.00001, 1.0);
 	RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
-	RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
+	RNA_def_property_ui_text(prop, "Limit", "Correlation threshold for number of bones in the subdivided stroke");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
 	prop = RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
 	RNA_def_property_range(prop, 0.00001, 100000.0);
 	RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
-	RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
+	RNA_def_property_ui_text(prop, "Length", "Maximum length of the subdivided bones");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
 	prop = RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
@@ -1836,6 +1849,7 @@ static void rna_def_unified_paint_settings(BlenderRNA  *brna)
 	PropertyRNA *prop;
 
 	srna = RNA_def_struct(brna, "UnifiedPaintSettings", NULL);
+	RNA_def_struct_path_func(srna, "rna_UnifiedPaintSettings_path");
 	RNA_def_struct_ui_text(srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
 
 	/* high-level flags to enable or disable unified paint settings */
@@ -1856,7 +1870,7 @@ static void rna_def_unified_paint_settings(BlenderRNA  *brna)
 
 	/* unified paint settings that override the equivalent settings
 	 * from the active brush */
-	prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+	prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
 	RNA_def_property_int_funcs(prop, NULL, "rna_UnifiedPaintSettings_size_set", NULL);
 	RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS * 10);
 	RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
@@ -2548,7 +2562,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
 	RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
 	RNA_def_property_range(prop, 0.01, 5.0);
 	RNA_def_property_ui_text(prop, "Eye Separation",
-	                         "Set the distance between the eyes - the camera focal length/30 should be fine");
+	                         "Set the distance between the eyes - the camera focal distance/30 should be fine");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 	
 	/* Dome */
@@ -2673,10 +2687,12 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 
 	/* mode */
+	/* not used  *//* deprecated !!!!!!!!!!!!! */
 	prop = RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_DBVT_CULLING);
-	RNA_def_property_ui_text(prop, "DBVT culling",
-	                         "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
+	RNA_def_property_ui_text(prop, "DBVT Culling",
+	                         "Use optimized Bullet DBVT tree for view frustum and occlusion culling (more efficient, "
+	                         "but it can waste unnecessary CPU if the scene doesn't have occluder objects)");
 	
 	/* not used  *//* deprecated !!!!!!!!!!!!! */
 	prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
@@ -2787,7 +2803,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_NO_MATERIAL_CACHING);
 	RNA_def_property_ui_text(prop, "Use Material Caching",
 	                         "Cache materials in the converter (this is faster, but can cause problems with older "
-	                         "Singletexture and Multitexture games");
+	                         "Singletexture and Multitexture games)");
 
 	/* obstacle simulation */
 	prop = RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE);
@@ -3697,7 +3713,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
 	
 	prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED);
 	RNA_def_property_float_sdna(prop, NULL, "blurfac");
-	RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 0);
+	RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 1);
 	RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
@@ -3711,27 +3727,33 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
 	                         "(note that this disables save_buffers and full_sample)");
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
+	
+	
 	prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "border.xmin");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 	RNA_def_property_ui_text(prop, "Border Minimum X", "Minimum X value to for the render border");
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
 	prop = RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "border.ymin");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 	RNA_def_property_ui_text(prop, "Border Minimum Y", "Minimum Y value for the render border");
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
 	prop = RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "border.xmax");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 	RNA_def_property_ui_text(prop, "Border Maximum X", "Maximum X value for the render border");
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
 	prop = RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "border.ymax");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 	RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border");
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 	
@@ -4541,6 +4563,13 @@ void RNA_def_scene(BlenderRNA *brna)
 	RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET, NULL);
 	rna_def_scene_keying_sets_all(brna, prop);
 	
+	/* Rigid Body Simulation */
+	prop = RNA_def_property(srna, "rigidbody_world", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_world");
+	RNA_def_property_struct_type(prop, "RigidBodyWorld");
+	RNA_def_property_ui_text(prop, "Rigid Body World", "");
+	RNA_def_property_update(prop, NC_SCENE, NULL);
+	
 	/* Tool Settings */
 	prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
 	RNA_def_property_flag(prop, PROP_NEVER_NULL);
@@ -4679,15 +4708,19 @@ void RNA_def_scene(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
 
 	/* Nestled Data  */
+	/* *** Non-Animated *** */
+	RNA_define_animate_sdna(false);
 	rna_def_tool_settings(brna);
 	rna_def_unified_paint_settings(brna);
 	rna_def_unit_settings(brna);
 	rna_def_scene_image_format_data(brna);
-	rna_def_scene_render_data(brna);
 	rna_def_scene_game_data(brna);
-	rna_def_scene_render_layer(brna);
 	rna_def_transform_orientation(brna);
 	rna_def_selected_uv_element(brna);
+	RNA_define_animate_sdna(true);
+	/* *** Animated *** */
+	rna_def_scene_render_data(brna);
+	rna_def_scene_render_layer(brna);
 	
 	/* Scene API */
 	RNA_api_scene(srna);
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 9b5a858..b0df27b 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -55,8 +55,10 @@
 
 static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
 {
-	scene->r.cfra = frame;
-	scene->r.subframe = subframe;
+	float cfra = (float)frame + subframe;
+
+	scene->r.cfra = floorf(cfra);
+	scene->r.subframe = cfra - floorf(cfra);
 	
 	CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
 	BKE_scene_update_for_newframe(G.main, scene, (1 << 20) - 1);
@@ -101,6 +103,7 @@ static void rna_Scene_collada_export(
         int selected,
         int include_children,
         int include_armatures,
+        int include_shapekeys,
         int deform_bones_only,
 
         int active_uv_only,
@@ -113,7 +116,7 @@ static void rna_Scene_collada_export(
         int second_life)
 {
 	collada_export(scene, filepath, apply_modifiers, export_mesh_type, selected,
-	               include_children, include_armatures, deform_bones_only,
+	               include_children, include_armatures, include_shapekeys, deform_bones_only,
 	               active_uv_only, include_uv_textures, include_material_textures,
 	               use_texture_copies, use_object_instantiation, sort_by_name, second_life);
 }
@@ -149,6 +152,7 @@ void RNA_api_scene(StructRNA *srna)
 	parm = RNA_def_boolean(func, "selected", 0, "Selection Only", "Export only selected elements");
 	parm = RNA_def_boolean(func, "include_children", 0, "Include Children", "Export all children of selected objects (even if not selected)");
 	parm = RNA_def_boolean(func, "include_armatures", 0, "Include Armatures", "Export related armatures (even if not selected)");
+	parm = RNA_def_boolean(func, "include_shapekeys", 0, "Include Shape Keys", "Export all Shape Keys from Mesh Objects");
 	parm = RNA_def_boolean(func, "deform_bones_only", 0, "Deform Bones only", "Only export deforming bones with armatures");
 
 	parm = RNA_def_boolean(func, "active_uv_only", 0, "Active UV Layer only", "Export only the active UV Layer");
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index cc18955..e068729 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -190,6 +190,11 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
 	return 0;
 }
 
+static char *rna_ParticleEdit_path(PointerRNA *ptr)
+{
+	return BLI_strdup("tool_settings.particle_edit");
+}
+
 static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
 {
 	Scene *scene = (Scene *)ptr->id.data;
@@ -231,7 +236,7 @@ static void rna_Sculpt_ShowDiffuseColor_update(Main *UNUSED(bmain), Scene *scene
 {
 	Object *ob = (scene->basact) ? scene->basact->object : NULL;
 
-	if (ob) {
+	if (ob && ob->sculpt) {
 		Sculpt *sd = scene->toolsettings->sculpt;
 		ob->sculpt->show_diffuse_color = sd->flags & SCULPT_SHOW_DIFFUSE;
 
@@ -242,6 +247,38 @@ static void rna_Sculpt_ShowDiffuseColor_update(Main *UNUSED(bmain), Scene *scene
 	}
 }
 
+static char *rna_Sculpt_path(PointerRNA *ptr)
+{
+	return BLI_strdup("tool_settings.sculpt");
+}
+
+static char *rna_VertexPaint_path(PointerRNA *ptr)
+{
+	Scene *scene = (Scene *)ptr->id.data;
+	ToolSettings *ts = scene->toolsettings;
+	if (ptr->data == ts->vpaint) {
+		return BLI_strdup("tool_settings.vertex_paint");
+	}
+	else {
+		return BLI_strdup("tool_settings.weight_paint");
+	}
+}
+
+static char *rna_ImagePaintSettings_path(PointerRNA *ptr)
+{
+	return BLI_strdup("tool_settings.image_paint");
+}
+
+static char *rna_UvSculpt_path(PointerRNA *ptr)
+{
+	return BLI_strdup("tool_settings.uv_sculpt");
+}
+
+static char *rna_ParticleBrush_path(PointerRNA *ptr)
+{
+	return BLI_strdup("tool_settings.particle_edit.brush");
+}
+
 #else
 
 static void rna_def_paint(BlenderRNA *brna)
@@ -283,6 +320,7 @@ static void rna_def_sculpt(BlenderRNA  *brna)
 	PropertyRNA *prop;
 
 	srna = RNA_def_struct(brna, "Sculpt", "Paint");
+	RNA_def_struct_path_func(srna, "rna_Sculpt_path");
 	RNA_def_struct_ui_text(srna, "Sculpt", "");
 
 	prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
@@ -340,7 +378,7 @@ static void rna_def_sculpt(BlenderRNA  *brna)
 	                         "Show diffuse color of object and overlay sculpt mask on top of it");
 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowDiffuseColor_update");
 
-	prop = RNA_def_property(srna, "detail_size", PROP_INT, PROP_DISTANCE);
+	prop = RNA_def_property(srna, "detail_size", PROP_INT, PROP_NONE);
 	RNA_def_property_ui_range(prop, 2, 100, 0, 0);
 	RNA_def_property_ui_text(prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
 
@@ -368,6 +406,7 @@ static void rna_def_uv_sculpt(BlenderRNA  *brna)
 	StructRNA *srna;
 
 	srna = RNA_def_struct(brna, "UvSculpt", "Paint");
+	RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
 	RNA_def_struct_ui_text(srna, "UV Sculpting", "");
 }
 
@@ -380,6 +419,7 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
 
 	srna = RNA_def_struct(brna, "VertexPaint", "Paint");
 	RNA_def_struct_sdna(srna, "VPaint");
+	RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
 	RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
 
 	/* vertex paint only */
@@ -408,6 +448,7 @@ static void rna_def_image_paint(BlenderRNA *brna)
 	
 	srna = RNA_def_struct(brna, "ImagePaint", "Paint");
 	RNA_def_struct_sdna(srna, "ImagePaintSettings");
+	RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
 	RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
 	
 	/* booleans */
@@ -492,6 +533,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
 
 	srna = RNA_def_struct(brna, "ParticleEdit", NULL);
 	RNA_def_struct_sdna(srna, "ParticleEditSettings");
+	RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
 	RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
 
 	prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
@@ -587,9 +629,10 @@ static void rna_def_particle_edit(BlenderRNA *brna)
 
 	srna = RNA_def_struct(brna, "ParticleBrush", NULL);
 	RNA_def_struct_sdna(srna, "ParticleBrushData");
+	RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
 	RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
 
-	prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+	prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
 	RNA_def_property_range(prop, 1, SHRT_MAX);
 	RNA_def_property_ui_range(prop, 1, 100, 10, 3);
 	RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
@@ -633,12 +676,15 @@ static void rna_def_particle_edit(BlenderRNA *brna)
 
 void RNA_def_sculpt_paint(BlenderRNA *brna)
 {
+	/* *** Non-Animated *** */
+	RNA_define_animate_sdna(false);
 	rna_def_paint(brna);
 	rna_def_sculpt(brna);
 	rna_def_uv_sculpt(brna);
 	rna_def_vertex_paint(brna);
 	rna_def_image_paint(brna);
 	rna_def_particle_edit(brna);
+	RNA_define_animate_sdna(true);
 }
 
 #endif
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index a41551f..a270461 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -40,6 +40,8 @@
 #include "DNA_sequence_types.h"
 #include "DNA_movieclip_types.h"
 
+#include "BLI_math.h"
+
 #include "BKE_animsys.h"
 #include "BKE_global.h"
 #include "BKE_sequencer.h"
@@ -48,7 +50,6 @@
 #include "MEM_guardedalloc.h"
 
 #include "WM_types.h"
-#include "BLI_math.h"
 
 #include "BLF_translation.h"
 
@@ -412,7 +413,7 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
 	/* fix all the animation data which may link to this */
 
 	/* don't rename everywhere because these are per scene */
-	/* BKE_all_animdata_fix_paths_rename(NULL, "sequence_editor.sequences_all", oldname, seq->name+2); */
+	/* BKE_all_animdata_fix_paths_rename(NULL, "sequence_editor.sequences_all", oldname, seq->name + 2); */
 	adt = BKE_animdata_from_id(&scene->id);
 	if (adt)
 		BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, "sequence_editor.sequences_all", oldname, seq->name + 2, 0, 0, 1);
@@ -2058,13 +2059,13 @@ static void rna_def_transform(StructRNA *srna)
 	prop = RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
 	RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
 	RNA_def_property_ui_text(prop, "Scale X", "");
-	RNA_def_property_ui_range(prop, 0, 10, 3, 10);
+	RNA_def_property_ui_range(prop, 0, 10, 3, 6);
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
 	RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
 	RNA_def_property_ui_text(prop, "Scale Y", "");
-	RNA_def_property_ui_range(prop, 0, 10, 3, 10);
+	RNA_def_property_ui_range(prop, 0, 10, 3, 6);
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
@@ -2075,13 +2076,13 @@ static void rna_def_transform(StructRNA *srna)
 	prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "xIni");
 	RNA_def_property_ui_text(prop, "Translate X", "");
-	RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
+	RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 6);
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "yIni");
 	RNA_def_property_ui_text(prop, "Translate Y", "");
-	RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
+	RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 6);
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
@@ -2110,7 +2111,7 @@ static void rna_def_solid_color(StructRNA *srna)
 
 	RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
 
-	prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+	prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
 	RNA_def_property_float_sdna(prop, NULL, "col");
 	RNA_def_property_ui_text(prop, "Color", "");
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 926b141..0ab74fb 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -41,6 +41,7 @@
 
 #include "DNA_action_types.h"
 #include "DNA_key_types.h"
+#include "DNA_material_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
 #include "DNA_space_types.h"
@@ -79,9 +80,9 @@ EnumPropertyItem space_type_items[] = {
 };
 
 static EnumPropertyItem draw_channels_items[] = {
-	{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
 	{SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
 	               "Draw image with RGB colors and alpha transparency"},
+	{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
 	{SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
 	{SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer",
 	               "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
@@ -144,6 +145,7 @@ EnumPropertyItem clip_editor_mode_items[] = {
 #include "BKE_paint.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
+#include "BKE_icons.h"
 
 #include "ED_image.h"
 #include "ED_node.h"
@@ -152,6 +154,8 @@ EnumPropertyItem clip_editor_mode_items[] = {
 #include "ED_sequencer.h"
 #include "ED_clip.h"
 
+#include "GPU_material.h"
+
 #include "IMB_imbuf_types.h"
 
 static StructRNA *rna_Space_refine(struct PointerRNA *ptr)
@@ -376,6 +380,31 @@ static void rna_SpaceView3D_viewport_shade_update(Main *UNUSED(bmain), Scene *UN
 	}
 }
 
+static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+	View3D *v3d = (View3D *)(ptr->data);
+	
+	if (v3d->defmaterial) {
+		Material *ma = v3d->defmaterial;
+		
+		if (ma->preview)
+			BKE_previewimg_free(&ma->preview);
+		
+		if (ma->gpumaterial.first)
+			GPU_material_free(ma);
+		
+		WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
+	}
+}
+
+static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+	View3D *v3d = (View3D *)(ptr->data);
+	
+	if (v3d->matcap_icon == 0)
+		v3d->matcap_icon = ICON_MATCAP_01;
+}
+
 static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	if (U.uiflag & USER_LOCKAROUND) {
@@ -482,8 +511,9 @@ static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *val
 static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
 {
 	RegionView3D *rv3d = (RegionView3D *)(ptr->data);
-	negate_v3_v3(rv3d->ofs, values);
-	ED_view3d_from_m4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
+	float mat[4][4];
+	invert_m4_m4(mat, (float (*)[4])values);
+	ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
 }
 
 /* api call */
@@ -603,15 +633,18 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUS
 	if (alpha && zbuf)
 		return draw_channels_items;
 
-	RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
-
 	if (alpha) {
 		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
+		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
 		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
 	}
 	else if (zbuf) {
+		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
 		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
 	}
+	else {
+		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
+	}
 
 	RNA_enum_item_end(&item, &totitem);
 	*free = 1;
@@ -1463,6 +1496,7 @@ static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop)
 	RNA_def_function_ui_description(func, "Remove all background images");
 }
 
+
 static void rna_def_space_view3d(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -1499,6 +1533,35 @@ static void rna_def_space_view3d(BlenderRNA *brna)
 		{0, NULL, 0, NULL, NULL}
 	};
 	
+	static EnumPropertyItem view3d_matcap_items[] = {
+		{ICON_MATCAP_01, "01", ICON_MATCAP_01, "", ""},
+		{ICON_MATCAP_02, "02", ICON_MATCAP_02, "", ""},
+		{ICON_MATCAP_03, "03", ICON_MATCAP_03, "", ""},
+		{ICON_MATCAP_04, "04", ICON_MATCAP_04, "", ""},
+		{ICON_MATCAP_05, "05", ICON_MATCAP_05, "", ""},
+		{ICON_MATCAP_06, "06", ICON_MATCAP_06, "", ""},
+		{ICON_MATCAP_07, "07", ICON_MATCAP_07, "", ""},
+		{ICON_MATCAP_08, "08", ICON_MATCAP_08, "", ""},
+		{ICON_MATCAP_09, "09", ICON_MATCAP_09, "", ""},
+		{ICON_MATCAP_10, "10", ICON_MATCAP_10, "", ""},
+		{ICON_MATCAP_11, "11", ICON_MATCAP_11, "", ""},
+		{ICON_MATCAP_12, "12", ICON_MATCAP_12, "", ""},
+		{ICON_MATCAP_13, "13", ICON_MATCAP_13, "", ""},
+		{ICON_MATCAP_14, "14", ICON_MATCAP_14, "", ""},
+		{ICON_MATCAP_15, "15", ICON_MATCAP_15, "", ""},
+		{ICON_MATCAP_16, "16", ICON_MATCAP_16, "", ""},
+		{ICON_MATCAP_17, "17", ICON_MATCAP_17, "", ""},
+		{ICON_MATCAP_18, "18", ICON_MATCAP_18, "", ""},
+		{ICON_MATCAP_19, "19", ICON_MATCAP_19, "", ""},
+		{ICON_MATCAP_20, "20", ICON_MATCAP_20, "", ""},
+		{ICON_MATCAP_21, "21", ICON_MATCAP_21, "", ""},
+		{ICON_MATCAP_22, "22", ICON_MATCAP_22, "", ""},
+		{ICON_MATCAP_23, "23", ICON_MATCAP_23, "", ""},
+		{ICON_MATCAP_24, "24", ICON_MATCAP_24, "", ""},
+		{0, NULL, 0, NULL, NULL}
+	};
+	
+
 	srna = RNA_def_struct(brna, "SpaceView3D", "Space");
 	RNA_def_struct_sdna(srna, "View3D");
 	RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
@@ -1819,6 +1882,17 @@ static void rna_def_space_view3d(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
+	prop = RNA_def_property(srna, "use_matcap", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_MATCAP);
+	RNA_def_property_ui_text(prop, "Matcap", "Active Objects draw images mapped on normals, enhancing Solid Draw Mode");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_matcap_enable");
+	
+	prop = RNA_def_property(srna, "matcap_icon", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "matcap_icon");
+	RNA_def_property_enum_items(prop, view3d_matcap_items);
+	RNA_def_property_ui_text(prop, "Matcap", "Image to use for Material Capture, active objects only");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_matcap_update");
+
 	/* region */
 
 	srna = RNA_def_struct(brna, "RegionView3D", NULL);
@@ -1979,7 +2053,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
 	/* note: custom set function is ONLY to avoid rna setting a user for this. */
 	RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set",
 	                               "rna_SpaceProperties_pin_id_typef", NULL);
-	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
 
 	prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
@@ -2474,7 +2548,7 @@ static void rna_def_space_graph(BlenderRNA *brna)
 		{0, NULL, 0, NULL, NULL}
 	};
 		
-	/* this is basically the same as the one for the 3D-View, but with some entries ommitted */
+	/* this is basically the same as the one for the 3D-View, but with some entries omitted */
 	static EnumPropertyItem gpivot_items[] = {
 		{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
 		{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
@@ -2698,6 +2772,11 @@ static void rna_def_space_time(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DYNAMICPAINT);
 	RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
+	
+	prop = RNA_def_property(srna, "cache_rigidbody", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_RIGIDBODY);
+	RNA_def_property_ui_text(prop, "Rigid Body", "Show the active object's Rigid Body cache");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
 }
 
 static void rna_def_console_line(BlenderRNA *brna)
@@ -2994,9 +3073,9 @@ static void rna_def_space_node(BlenderRNA *brna)
 	};
 
 	static EnumPropertyItem backdrop_channels_items[] = {
-		{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
 		{SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
 		                  "Draw image with RGB colors and alpha transparency"},
+		{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
 		{SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
 		{SNODE_SHOW_R, "RED",   ICON_COLOR_RED, "Red", ""},
 		{SNODE_SHOW_G, "GREEN", ICON_COLOR_GREEN, "Green", ""},
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 2ab448c..e007fe6 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -44,6 +44,8 @@
 #include "DNA_particle_types.h"
 #include "DNA_scene_types.h" /* MAXFRAME only */
 
+#include "BLI_utildefines.h"
+
 #include "BKE_node.h"
 
 #include "WM_api.h"
@@ -563,7 +565,7 @@ static void rna_def_colormapping(BlenderRNA *brna)
 	RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
 
 	prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_range(prop, 0.01, 5);
+	RNA_def_property_range(prop, 0.0, 5);
 	RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture");
 	RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
 
@@ -1840,7 +1842,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "file_format");
 	RNA_def_property_enum_items(prop, file_format_items);
-	RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render	");
+	RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render");
 	RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
 	
 	prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
@@ -1978,7 +1980,7 @@ static void rna_def_texture(BlenderRNA *brna)
 	RNA_def_property_update(prop, 0, "rna_Texture_update");
 
 	prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_range(prop, 0.01, 5);
+	RNA_def_property_range(prop, 0.0, 5);
 	RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture");
 	RNA_def_property_update(prop, 0, "rna_Texture_update");
 
diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c
index 5be9d3a..218fda3 100644
--- a/source/blender/makesrna/intern/rna_texture_api.c
+++ b/source/blender/makesrna/intern/rna_texture_api.c
@@ -71,7 +71,7 @@ static void clear_envmap(struct EnvMap *env, bContext *C)
 static void texture_evaluate(struct Tex *tex, float value[3], float color_r[4])
 {
 	TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
-	multitex_ext(tex, value, NULL, NULL, 1, &texres);
+	multitex_ext(tex, value, NULL, NULL, 1, &texres, NULL);
 
 	color_r[0] = texres.tr;
 	color_r[1] = texres.tg;
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 00124a8..e5585b4 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -791,7 +791,7 @@ static void rna_def_panel(BlenderRNA *brna)
 
 	func = RNA_def_function(srna, "draw_header", NULL);
 	RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout");
-	RNA_def_function_flag(func, FUNC_REGISTER);
+	RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
 	parm = RNA_def_pointer(func, "context", "Context", "", "");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
 
@@ -813,9 +813,6 @@ static void rna_def_panel(BlenderRNA *brna)
 	                         "class name is \"OBJECT_PT_hello\", and bl_idname is not set by the "
 	                         "script, then bl_idname = \"OBJECT_PT_hello\"");
 
-	/* panel's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
-	 * when drawing panel and having this flag set will make runtime switching of language much more tricky
-	 * because label will be stored translated */
 	prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "type->label");
 	RNA_def_property_flag(prop, PROP_REGISTER);
@@ -866,7 +863,7 @@ static void rna_def_uilist(BlenderRNA *brna)
 	func = RNA_def_function(srna, "draw_item", NULL);
 	RNA_def_function_ui_description(func, "Draw an item in the list (NOTE: when you define your own draw_item "
 	                                      "function, you may want to check given 'item' is of the right type...)");
-	RNA_def_function_flag(func, FUNC_REGISTER);
+	RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
 	parm = RNA_def_pointer(func, "context", "Context", "", "");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
 	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Layout to draw the item");
@@ -992,9 +989,6 @@ static void rna_def_menu(BlenderRNA *brna)
 	                         "class name is \"OBJECT_MT_hello\", and bl_idname is not set by the "
 	                         "script, then bl_idname = \"OBJECT_MT_hello\")");
 
-	/* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
-	 * when drawing panel and having this flag set will make runtime switching of language much more tricky
-	 * because label will be stored translated */
 	prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "type->label");
 	RNA_def_property_flag(prop, PROP_REGISTER);
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 366d0dc..0ce98e0 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -32,21 +32,72 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include "BLI_utildefines.h"
+
+#include "BLF_translation.h"
+
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
 #include "DNA_screen_types.h"
 
 #include "UI_resources.h"
+#include "UI_interface.h"
 #include "UI_interface_icons.h"
 
 #include "rna_internal.h"
 
+#define DEF_ICON_BLANK_SKIP
+#define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""},
+#define DEF_VICO(name) {VICO_##name, (#name), 0, (#name), ""},
+EnumPropertyItem icon_items[] = {
+#include "UI_icons.h"
+	{0, NULL, 0, NULL, NULL}
+};
+#undef DEF_ICON_BLANK_SKIP
+#undef DEF_ICON
+#undef DEF_VICO
+
 #ifdef RNA_RUNTIME
 
-static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon,
-                        int expand, int slider, int toggle, int icon_only, int event, int full_event,
-                        int emboss, int index)
+static const char *rna_translate_ui_text(const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop,
+                                         int translate)
+{
+	/* Also return text if UI labels translation is disabled. */
+	if (!text || !text[0] || !translate || !BLF_translate_iface()) {
+		return text;
+	}
+
+	/* If a text_ctxt is specified, use it! */
+	if (text_ctxt && text_ctxt[0]) {
+		return BLF_pgettext(text_ctxt, text);
+	}
+
+	/* Else, if an RNA type or property is specified, use its context. */
+#if 0
+	/* XXX Disabled for now. Unfortunately, their is absolutely no way from py code to get the RNA struct corresponding
+	 *     to the 'data' (in functions like prop() & co), as this is pure runtime data. Hence, messages extraction
+	 *     script can't determine the correct context it should use for such 'text' messages...
+	 *     So for now, one have to explicitly specify the 'text_ctxt' when using prop() etc. functions,
+	 *     if default context is not suitable.
+	 */
+	if (prop) {
+		return BLF_pgettext(RNA_property_translation_context(prop), text);
+	}
+#else
+	(void)prop;
+#endif
+	if (type) {
+		return BLF_pgettext(RNA_struct_translation_context(type), text);
+	}
+
+	/* Else, default context! */
+	return BLF_pgettext(BLF_I18NCONTEXT_DEFAULT, text);
+}
+
+static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, const char *text_ctxt,
+                        int translate, int icon, int expand, int slider, int toggle, int icon_only, int event,
+                        int full_event, int emboss, int index)
 {
 	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
 	int flag = 0;
@@ -56,6 +107,9 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname,
 		return;
 	}
 
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
+
 	flag |= (slider) ? UI_ITEM_R_SLIDER : 0;
 	flag |= (expand) ? UI_ITEM_R_EXPAND : 0;
 	flag |= (toggle) ? UI_ITEM_R_TOGGLE : 0;
@@ -67,15 +121,102 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname,
 	uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
 }
 
-static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, int icon, int emboss)
+static void rna_uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name,
+                                const char *text_ctxt, int translate, int icon)
+{
+	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+
+	if (!prop) {
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
+		return;
+	}
+
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
+
+	/* XXX This will search property again :( */
+	uiItemMenuEnumR(layout, ptr, propname, name, icon);
+}
+
+static void rna_uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value,
+                                   const char *name, const char *text_ctxt, int translate, int icon)
 {
-	int flag = UI_ITEM_O_RETURN_PROPS;
+	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+
+	if (!prop) {
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
+		return;
+	}
+
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
+
+	/* XXX This will search property again :( */
+	uiItemEnumR_string(layout, ptr, propname, value, name, icon);
+}
+
+static void rna_uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname,
+                               struct PointerRNA *searchptr, const char *searchpropname,
+                               const char *name, const char *text_ctxt, int translate, int icon)
+{
+	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+
+	if (!prop) {
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
+		return;
+	}
+
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
+
+	/* XXX This will search property again :( */
+	uiItemPointerR(layout, ptr, propname, searchptr, searchpropname, name, icon);
+}
+
+static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, const char *text_ctxt,
+                              int translate, int icon, int emboss)
+{
+	wmOperatorType *ot;
+	int flag;
+
+	ot = WM_operatortype_find(opname, 0); /* print error next */
+	if (!ot || !ot->srna) {
+		RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
+		return PointerRNA_NULL;
+	}
+
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
+
+	flag = UI_ITEM_O_RETURN_PROPS;
 	flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG;
-	return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
+
+	return uiItemFullO_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
+}
+
+static void rna_uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, const char *name,
+                                const char *text_ctxt, int translate, int icon)
+{
+	wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
+
+	if (!ot || !ot->srna) {
+		RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
+		return;
+	}
+
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
+
+	/* XXX This will search operator again :( */
+	uiItemMenuEnumO(layout, opname, propname, name, icon);
 }
 
-static void rna_uiItemL(uiLayout *layout, const char *name, int icon, int icon_value)
+static void rna_uiItemL(uiLayout *layout, const char *name, const char *text_ctxt, int translate,
+                        int icon, int icon_value)
 {
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
+
 	if (icon_value && !icon) {
 		icon = icon_value;
 	}
@@ -83,6 +224,49 @@ static void rna_uiItemL(uiLayout *layout, const char *name, int icon, int icon_v
 	uiItemL(layout, name, icon);
 }
 
+static void rna_uiItemM(uiLayout *layout, bContext *C, const char *menuname, const char *name, const char *text_ctxt,
+                        int translate, int icon)
+{
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
+
+	uiItemM(layout, C, menuname, name, icon);
+}
+
+static void rna_uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *proptypename,
+                                const char *name, const char *text_ctxt, int translate)
+{
+	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+
+	if (!prop) {
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
+		return;
+	}
+
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
+
+	/* XXX This will search property again :( */
+	uiTemplateAnyID(layout, ptr, propname, proptypename, name);
+}
+
+static void rna_uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *root_ptr,
+                                      const char *name, const char *text_ctxt, int translate)
+{
+	PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+
+	if (!prop) {
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
+		return;
+	}
+
+	/* Get translated name (label). */
+	name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
+
+	/* XXX This will search property again :( */
+	uiTemplatePathBuilder(layout, ptr, propname, root_ptr, name);
+}
+
 static int rna_ui_get_rnaptr_icon(bContext *C, PointerRNA *ptr_icon)
 {
 	return UI_rnaptr_icon_get(C, ptr_icon, RNA_struct_ui_icon(ptr_icon->type), FALSE);
@@ -181,22 +365,18 @@ static int rna_ui_get_enum_icon(bContext *C, PointerRNA *ptr, const char *propna
 
 #else
 
-#define DEF_ICON_BLANK_SKIP
-#define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""},
-#define DEF_VICO(name) {VICO_##name, (#name), 0, (#name), ""},
-EnumPropertyItem icon_items[] = {
-#include "UI_icons.h"
-	{0, NULL, 0, NULL, NULL}
-};
-#undef DEF_ICON_BLANK_SKIP
-#undef DEF_ICON
-#undef DEF_VICO
+static void api_ui_item_common_text(FunctionRNA *func)
+{
+	RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item");
+	RNA_def_string(func, "text_ctxt", "", 0, "", "Override automatic translation context of the given text");
+	RNA_def_boolean(func, "translate", true, "", "Translate the given text, when UI translation is enabled");
+}
 
 static void api_ui_item_common(FunctionRNA *func)
 {
 	PropertyRNA *prop;
 
-	RNA_def_string_translate(func, "text", "", 0, "", "Override automatic text of the item");
+	api_ui_item_common_text(func);
 
 	prop = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_items(prop, icon_items);
@@ -333,17 +513,17 @@ void RNA_api_ui_layout(StructRNA *srna)
 	func = RNA_def_function(srna, "props_enum", "uiItemsEnumR");
 	api_ui_item_rna_common(func);
 
-	func = RNA_def_function(srna, "prop_menu_enum", "uiItemMenuEnumR");
+	func = RNA_def_function(srna, "prop_menu_enum", "rna_uiItemMenuEnumR");
 	api_ui_item_rna_common(func);
 	api_ui_item_common(func);
 
-	func = RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
+	func = RNA_def_function(srna, "prop_enum", "rna_uiItemEnumR_string");
 	api_ui_item_rna_common(func);
 	parm = RNA_def_string(func, "value", "", 0, "", "Enum property value");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
 	api_ui_item_common(func);
 
-	func = RNA_def_function(srna, "prop_search", "uiItemPointerR");
+	func = RNA_def_function(srna, "prop_search", "rna_uiItemPointerR");
 	api_ui_item_rna_common(func);
 	parm = RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL);
@@ -366,7 +546,7 @@ void RNA_api_ui_layout(StructRNA *srna)
 	parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
 
-	func = RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO");
+	func = RNA_def_function(srna, "operator_menu_enum", "rna_uiItemMenuEnumO");
 	api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
 	parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -415,13 +595,13 @@ void RNA_api_ui_layout(StructRNA *srna)
 
 	func = RNA_def_function(srna, "label", "rna_uiItemL");
 	RNA_def_function_ui_description(func, "Item. Display text and/or icon in the layout");
-	api_ui_item_common(func);
+	 api_ui_item_common(func);
 	parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_ui_text(parm, "Icon Value",
 	                         "Override automatic icon of the item "
 	                         "(use it e.g. with custom material icons returned by icon()...)");
 
-	func = RNA_def_function(srna, "menu", "uiItemM");
+	func = RNA_def_function(srna, "menu", "rna_uiItemM");
 	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
 	parm = RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu");
 	api_ui_item_common(func);
@@ -458,7 +638,7 @@ void RNA_api_ui_layout(StructRNA *srna)
 	RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
 	RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX);
 	
-	func = RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
+	func = RNA_def_function(srna, "template_any_ID", "rna_uiTemplateAnyID");
 	parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL);
 	parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
@@ -466,16 +646,16 @@ void RNA_api_ui_layout(StructRNA *srna)
 	parm = RNA_def_string(func, "type_property", "", 0, "",
 	                      "Identifier of property in data giving the type of the ID-blocks to use");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
-	RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
+	api_ui_item_common_text(func);
 	
-	func = RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
+	func = RNA_def_function(srna, "template_path_builder", "rna_uiTemplatePathBuilder");
 	parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL);
 	parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
 	parm = RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR);
-	RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
+	api_ui_item_common_text(func);
 	
 	func = RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
 	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
@@ -512,6 +692,10 @@ void RNA_api_ui_layout(StructRNA *srna)
 	api_ui_item_rna_common(func);
 	RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail");
 	
+	func = RNA_def_function(srna, "template_icon_view", "uiTemplateIconView");
+	RNA_def_function_ui_description(func, "Enum. Large widget showing Icon previews");
+	api_ui_item_rna_common(func);
+	
 	func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
 	RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data");
 	api_ui_item_rna_common(func);
@@ -587,7 +771,8 @@ void RNA_api_ui_layout(StructRNA *srna)
 	parm = RNA_def_string(func, "listtype_name", "", 0, "", "Identifier of the list type to use");
 	RNA_def_property_flag(parm, PROP_REQUIRED);
 	parm = RNA_def_string(func, "list_id", "", 0, "",
-	                      "Identifier of this list widget. "
+	                      "Identifier of this list widget (mandatory when using default \"" UI_UL_DEFAULT_CLASS_NAME
+	                      "\" class). "
 	                      "If this is set, the uilist gets a custom ID, otherwise it takes the "
 	                      "name of the class used to define the uilist (for example, if the "
 	                      "class name is \"OBJECT_UL_vgroups\", and list_id is not set by the "
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 28ba7d4..9d5a002 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -325,6 +325,11 @@ static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *bext_ptr)
 		return;
 	}
 
+	if (bext->prop) {
+		IDP_FreeProperty(bext->prop);
+		MEM_freeN(bext->prop);
+	}
+
 	BLI_freelinkN(&U.addons, bext);
 	RNA_POINTER_INVALIDATE(bext_ptr);
 }
@@ -603,22 +608,14 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
 	RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
 	RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
 	
-	/* (not used yet) */
-#if 0
-	prop = RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_range(prop, 0.5, 2.0);
-	RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
-#endif
 
-	/*	(not used yet) */
-#if 0
-	prop = RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
+	prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
 	RNA_def_property_flag(prop, PROP_NEVER_NULL);
-	RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
+	RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
 	RNA_def_property_struct_type(prop, "ThemeFontStyle");
-	RNA_def_property_ui_text(prop, "Group Label Font", "");
+	RNA_def_property_ui_text(prop, "Panel Title Font", "");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
-#endif
+
 	prop = RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
 	RNA_def_property_flag(prop, PROP_NEVER_NULL);
 	RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
@@ -1692,6 +1689,13 @@ static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
 	RNA_def_property_array(prop, 3);
 	RNA_def_property_ui_text(prop, "Cursor", "");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+	prop = RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_float_sdna(prop, NULL, "console_select");
+	RNA_def_property_array(prop, 4);
+	RNA_def_property_ui_text(prop, "Selection", "");
+	RNA_def_property_update(prop, 0, "rna_userdef_update");
+
 }
 
 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
@@ -1879,6 +1883,18 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
 	RNA_def_property_array(prop, 4);
 	RNA_def_property_ui_text(prop, "Frame Node", "");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
+	
+	prop = RNA_def_property(srna, "matte_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_float_sdna(prop, NULL, "syntaxs");
+	RNA_def_property_array(prop, 3);
+	RNA_def_property_ui_text(prop, "Matte Node", "");
+	RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+	prop = RNA_def_property(srna, "distor_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_float_sdna(prop, NULL, "syntaxd");
+	RNA_def_property_array(prop, 3);
+	RNA_def_property_ui_text(prop, "Distort Node", "");
+	RNA_def_property_update(prop, 0, "rna_userdef_update");
 
 	prop = RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "noodle_curving");
@@ -3311,7 +3327,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "dpi");
-	RNA_def_property_range(prop, 48, 128);
+	RNA_def_property_range(prop, 48, 144);
 	RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
 	RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
 	
@@ -3540,7 +3556,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 	                         "Draw tool/property regions over the main region, when using Triple Buffer");
 	RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
 	
-
 #ifdef WITH_CYCLES
 	prop = RNA_def_property(srna, "compute_device_type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
@@ -3746,6 +3761,11 @@ static void rna_def_userdef_input(BlenderRNA *brna)
 	RNA_def_property_range(prop, 0, 32);
 	RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel");
 	
+	prop = RNA_def_property(srna, "use_trackpad_natural", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_TRACKPAD_NATURAL);
+	RNA_def_property_ui_text(prop, "Trackpad Natural",
+	                         "If your system uses 'natural' scrolling, this option keeps consistent trackpad usage throughout the UI");
+
 	prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
 	RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
 	RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index f416d34..0c1c5d8 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -853,8 +853,11 @@ static void rna_Operator_unregister(struct Main *bmain, StructRNA *type)
 
 	/* update while blender is running */
 	wm = bmain->wm.first;
-	if (wm)
+	if (wm) {
 		WM_operator_stack_clear(wm);
+
+		WM_operator_handlers_clear(wm, ot);
+	}
 	WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
 
 	RNA_struct_free_extension(type, &ot->ext);
@@ -1330,9 +1333,6 @@ static void rna_def_operator(BlenderRNA *brna)
 	RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP);
 	RNA_def_struct_name_property(srna, prop);
 
-	/* operator's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
-	 * when drawing panel and having this flag set will make runtime switching of language much more tricky
-	 * because label will be stored translated */
 	prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "type->name");
 	RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
@@ -1397,9 +1397,6 @@ static void rna_def_macro_operator(BlenderRNA *brna)
 	RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP);
 	RNA_def_struct_name_property(srna, prop);
 
-	/* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
-	 * when drawing panel and having this flag set will make runtime switching of language much more tricky
-	 * because label will be stored translated */
 	prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "type->name");
 	RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 3320909..9f1361b 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -28,7 +28,6 @@ set(INC
 	.
 	intern
 	../blenkernel
-	../blenkernel/intern
 	../blenlib
 	../blenfont
 	../blenloader
@@ -67,6 +66,10 @@ set(SRC
 	intern/MOD_laplaciansmooth.c
 	intern/MOD_lattice.c
 	intern/MOD_mask.c
+	intern/MOD_meshcache.c
+	intern/MOD_meshcache_mdd.c
+	intern/MOD_meshcache_pc2.c
+	intern/MOD_meshcache_util.c
 	intern/MOD_meshdeform.c
 	intern/MOD_mirror.c
 	intern/MOD_multires.c
@@ -100,6 +103,7 @@ set(SRC
 	MOD_modifiertypes.h
 	intern/MOD_boolean_util.h
 	intern/MOD_fluidsim_util.h
+	intern/MOD_meshcache_util.h
 	intern/MOD_util.h
 	intern/MOD_weightvg_util.h
 )
diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h
index 17e903e..bac75b3 100644
--- a/source/blender/modifiers/MOD_modifiertypes.h
+++ b/source/blender/modifiers/MOD_modifiertypes.h
@@ -78,6 +78,7 @@ extern ModifierTypeInfo modifierType_Skin;
 extern ModifierTypeInfo modifierType_LaplacianSmooth;
 extern ModifierTypeInfo modifierType_Triangulate;
 extern ModifierTypeInfo modifierType_UVWarp;
+extern ModifierTypeInfo modifierType_MeshCache;
 
 /* MOD_util.c */
 void modifier_type_init(ModifierTypeInfo *types[]);
diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript
index d3430c6..6791090 100644
--- a/source/blender/modifiers/SConscript
+++ b/source/blender/modifiers/SConscript
@@ -25,17 +25,30 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-Import ('env')
+Import('env')
 
 sources = env.Glob('intern/*.c')
 
-incs = '. ./intern'
-incs += ' #/intern/guardedalloc #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include #/intern/opennl/extern'
-incs += ' ../render/extern/include ../blenloader ../bmesh'
-incs += ' ../include ../blenlib ../blenfont ../makesdna ../makesrna ../blenkernel ../blenkernel/intern'
-incs += ' ../gpu'
-
-incs += ' ' + env['BF_ZLIB_INC']
+incs = [
+    '.',
+    './intern', 
+    '#/intern/guardedalloc',
+    '#/intern/bsp/extern',
+    '#/intern/elbeem/extern',
+    '#/extern/glew/include',
+    '#/intern/opennl/extern',
+    '../render/extern/include',
+    '../blenloader',
+    '../bmesh',
+    '../include',
+    '../blenlib',
+    '../blenfont',
+    '../makesdna',
+    '../makesrna',
+    '../blenkernel',
+    '../gpu',
+    env['BF_ZLIB_INC'],
+    ]
 
 defs = []
 
@@ -43,7 +56,7 @@ if env ['WITH_BF_BOOLEAN']:
     defs.append('WITH_MOD_BOOLEAN')
 
 if env['WITH_BF_REMESH']:
-    incs += ' #/intern/dualcon'
+    incs.append('#/intern/dualcon')
     defs.append('WITH_MOD_REMESH')
 
 if env['WITH_BF_FLUID']:
@@ -53,12 +66,12 @@ if env['WITH_BF_OCEANSIM']:
     defs.append('WITH_OCEANSIM')
 
 if env['WITH_BF_GAMEENGINE']:
-    incs += ' #/extern/recastnavigation'
+    incs.append('#/extern/recastnavigation')
     defs.append('WITH_GAMEENGINE')
 
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
-env.BlenderLib ( libname = 'bf_modifiers', sources = sources,
-                 includes = Split(incs), defines=defs,
-                 libtype=['core','player'], priority = [80, 40] )
+env.BlenderLib(libname='bf_modifiers', sources=sources,
+               includes=incs, defines=defs,
+               libtype=['core', 'player'], priority=[80, 40])
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index 0a48003..04198d9 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -135,7 +135,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 	 * in some cases the depsgraph fails us - especially for objects
 	 * in other scenes when compositing */
 	if (bmd->object != ob) {
-		dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_MESH);
+		/* weak! - but we can too easy end up with circular dep crash otherwise */
+		if (modifiers_findByType(bmd->object, eModifierType_Boolean) == NULL) {
+			dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_MESH);
+		}
+		else {
+			dm = bmd->object->derivedFinal;
+		}
 	}
 	else {
 		dm = NULL;
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c
index 0cf4f6a..a3d93b5 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.c
+++ b/source/blender/modifiers/intern/MOD_boolean_util.c
@@ -46,6 +46,7 @@
 
 #include "BKE_cdderivedmesh.h"
 #include "BKE_depsgraph.h"
+#include "BKE_global.h"
 #include "BKE_material.h"
 #include "BKE_mesh.h"
 #include "BKE_object.h"
@@ -295,7 +296,7 @@ static Object *AddNewBlenderMesh(Scene *scene, Base *base)
 	basen->flag &= ~SELECT;
 				
 	/* Initialize the mesh data associated with this object. */
-	ob_new->data = BKE_mesh_add("Mesh");
+	ob_new->data = BKE_mesh_add(G.main, "Mesh");
 
 	/* Finally assign the object type. */
 	ob_new->type = OB_MESH;
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c
index 2105a6e..c5a7567 100644
--- a/source/blender/modifiers/intern/MOD_build.c
+++ b/source/blender/modifiers/intern/MOD_build.c
@@ -37,6 +37,7 @@
 
 #include "BLI_utildefines.h"
 #include "BLI_rand.h"
+#include "BLI_math_vector.h"
 #include "BLI_ghash.h"
 
 #include "DNA_scene_types.h"
@@ -104,12 +105,19 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 	MVert *mvert_src = dm->getVertArray(dm);
 
 
-	vertMap = MEM_callocN(sizeof(*vertMap) * numVert_src, "build modifier vertMap");
-	for (i = 0; i < numVert_src; i++) vertMap[i] = i;
-	edgeMap = MEM_callocN(sizeof(*edgeMap) * numEdge_src, "build modifier edgeMap");
-	for (i = 0; i < numEdge_src; i++) edgeMap[i] = i;
-	faceMap = MEM_callocN(sizeof(*faceMap) * numPoly_src, "build modifier faceMap");
-	for (i = 0; i < numPoly_src; i++) faceMap[i] = i;
+	vertMap = MEM_mallocN(sizeof(*vertMap) * numVert_src, "build modifier vertMap");
+	edgeMap = MEM_mallocN(sizeof(*edgeMap) * numEdge_src, "build modifier edgeMap");
+	faceMap = MEM_mallocN(sizeof(*faceMap) * numPoly_src, "build modifier faceMap");
+
+#pragma omp parallel sections if (numVert_src + numEdge_src + numPoly_src >= DM_OMP_LIMIT)
+	{
+#pragma omp section
+		{ range_vn_i(vertMap, numVert_src, 0); }
+#pragma omp section
+		{ range_vn_i(edgeMap, numEdge_src, 0); }
+#pragma omp section
+		{ range_vn_i(faceMap, numPoly_src, 0); }
+	}
 
 	frac = (BKE_scene_frame_get(md->scene) - bmd->start) / bmd->length;
 	CLAMP(frac, 0.0f, 1.0f);
diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c
index b9384e6..ab14131 100644
--- a/source/blender/modifiers/intern/MOD_collision.c
+++ b/source/blender/modifiers/intern/MOD_collision.c
@@ -137,7 +137,7 @@ static void deformVerts(ModifierData *md, Object *ob,
 		
 		numverts = dm->getNumVerts(dm);
 		
-		if ((current_time > collmd->time_xnew) || (BKE_ptcache_get_continue_physics())) {
+		if (current_time > collmd->time_xnew) {
 			unsigned int i;
 
 			/* check if mesh has changed */
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index 1298d28..638f8f0 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -161,7 +161,7 @@ static void createFacepa(ExplodeModifierData *emd,
 			mul_v3_fl(center, 0.25);
 		}
 		else
-			mul_v3_fl(center, 0.3333f);
+			mul_v3_fl(center, 1.0f / 3.0f);
 
 		p = BLI_kdtree_find_nearest(tree, center, NULL, NULL);
 
diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
index 2662260..62da82a 100644
--- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c
+++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
@@ -82,6 +82,7 @@ typedef struct BLaplacianSystem LaplacianSystem;
 
 static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md);
 static int is_disabled(ModifierData *md, int UNUSED(useRenderParams));
+static float average_area_quad_v3(float *v1, float *v2, float *v3, float *v4);
 static float compute_volume(float (*vertexCos)[3], MFace *mfaces, int numFaces);
 static float cotan_weight(float *v1, float *v2, float *v3);
 static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, int a_numVerts);
@@ -93,7 +94,7 @@ static void init_data(ModifierData *md);
 static void init_laplacian_matrix(LaplacianSystem *sys);
 static void memset_laplacian_system(LaplacianSystem *sys, int val);
 static void volume_preservation(LaplacianSystem *sys, float vini, float vend, short flag);
-static void validate_solution(LaplacianSystem *sys, short flag);
+static void validate_solution(LaplacianSystem *sys, short flag, float lambda, float lambda_border);
 
 static void delete_void_pointer(void *data)
 {
@@ -196,10 +197,10 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, in
 static void init_data(ModifierData *md)
 {
 	LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
-	smd->lambda = 0.00001f;
-	smd->lambda_border = 0.00005f;
+	smd->lambda = 0.01f;
+	smd->lambda_border = 0.01f;
 	smd->repeat = 1;
-	smd->flag = MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z | MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME;
+	smd->flag = MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z | MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME | MOD_LAPLACIANSMOOTH_NORMALIZED;
 	smd->defgrp_name[0] = '\0';
 }
 
@@ -239,6 +240,13 @@ static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md)
 	return dataMask;
 }
 
+static float average_area_quad_v3(float *v1, float *v2, float *v3, float *v4)
+{
+	float areaq = 0.0f;
+	areaq = area_tri_v3(v1, v2, v3) + area_tri_v3(v1, v2, v4) + area_tri_v3(v1, v3, v4);
+	return areaq / 2.0f;
+}
+
 static float cotan_weight(float *v1, float *v2, float *v3)
 {
 	float a[3], b[3], c[3], clen;
@@ -372,10 +380,17 @@ static void init_laplacian_matrix(LaplacianSystem *sys)
 			if (has_4_vert) sys->zerola[idv4] = 1;
 		}
 
-		sys->ring_areas[idv1] += areaf;
-		sys->ring_areas[idv2] += areaf;
-		sys->ring_areas[idv3] += areaf;
-		if (has_4_vert) sys->ring_areas[idv4] += areaf;
+		if (has_4_vert) {
+			sys->ring_areas[idv1] += average_area_quad_v3(v1, v2, v3, v4);
+			sys->ring_areas[idv2] += average_area_quad_v3(v2, v3, v4, v1);
+			sys->ring_areas[idv3] += average_area_quad_v3(v3, v4, v1, v2);
+			sys->ring_areas[idv4] += average_area_quad_v3(v4, v1, v2, v3);
+		}
+		else {
+			sys->ring_areas[idv1] += areaf;
+			sys->ring_areas[idv2] += areaf;
+			sys->ring_areas[idv3] += areaf;
+		}
 
 		if (has_4_vert) {
 
@@ -403,9 +418,9 @@ static void init_laplacian_matrix(LaplacianSystem *sys)
 			}
 		}
 		else {
-			w1 = cotan_weight(v1, v2, v3);
-			w2 = cotan_weight(v2, v3, v1);
-			w3 = cotan_weight(v3, v1, v2);
+			w1 = cotan_weight(v1, v2, v3) / 2.0f;
+			w2 = cotan_weight(v2, v3, v1) / 2.0f;
+			w3 = cotan_weight(v3, v1, v2) / 2.0f;
 
 			sys->fweights[i][0] = sys->fweights[i][0] + w1;
 			sys->fweights[i][1] = sys->fweights[i][1] + w2;
@@ -505,43 +520,26 @@ static void fill_laplacian_matrix(LaplacianSystem *sys)
 	}
 }
 
-static void validate_solution(LaplacianSystem *sys, short flag)
+static void validate_solution(LaplacianSystem * sys, short flag, float lambda, float lambda_border)
 {
-	int i, idv1, idv2;
-	float leni, lene;
+	int i;
+	float lam;
 	float vini, vend;
-	float *vi1, *vi2, ve1[3], ve2[3];
+
 	if (flag & MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME) {
 		vini = compute_volume(sys->vertexCos, sys->mfaces, sys->numFaces);
 	}
-	for (i = 0; i < sys->numEdges; i++) {
-		idv1 = sys->medges[i].v1;
-		idv2 = sys->medges[i].v2;
-		vi1 = sys->vertexCos[idv1];
-		vi2 = sys->vertexCos[idv2];
-		ve1[0] = nlGetVariable(0, idv1);
-		ve1[1] = nlGetVariable(1, idv1);
-		ve1[2] = nlGetVariable(2, idv1);
-		ve2[0] = nlGetVariable(0, idv2);
-		ve2[1] = nlGetVariable(1, idv2);
-		ve2[2] = nlGetVariable(2, idv2);
-		leni = len_v3v3(vi1, vi2);
-		lene = len_v3v3(ve1, ve2);
-		if (lene > leni * MOD_LAPLACIANSMOOTH_MAX_EDGE_PERCENTAGE || lene < leni * MOD_LAPLACIANSMOOTH_MIN_EDGE_PERCENTAGE) {
-			sys->zerola[idv1] = 1;
-			sys->zerola[idv2] = 1;
-		}
-	}
 	for (i = 0; i < sys->numVerts; i++) {
 		if (sys->zerola[i] == 0) {
+			lam = sys->numNeEd[i] == sys->numNeFa[i] ? (lambda >= 0.0f ? 1.0f : -1.0f) : (lambda_border >= 0.0f ? 1.0f : -1.0f);
 			if (flag & MOD_LAPLACIANSMOOTH_X) {
-				sys->vertexCos[i][0] = nlGetVariable(0, i);
+				sys->vertexCos[i][0] += lam * (nlGetVariable(0, i) - sys->vertexCos[i][0]);
 			}
 			if (flag & MOD_LAPLACIANSMOOTH_Y) {
-				sys->vertexCos[i][1] = nlGetVariable(1, i);
+				sys->vertexCos[i][1] += lam * (nlGetVariable(1, i) - sys->vertexCos[i][1]);
 			}
 			if (flag & MOD_LAPLACIANSMOOTH_Z) {
-				sys->vertexCos[i][2] = nlGetVariable(2, i);
+				sys->vertexCos[i][2] += lam * (nlGetVariable(2, i) - sys->vertexCos[i][2]);
 			}
 		}
 	}
@@ -578,17 +576,17 @@ static void laplaciansmoothModifier_do(
 	sys->vert_centroid[0] = 0.0f;
 	sys->vert_centroid[1] = 0.0f;
 	sys->vert_centroid[2] = 0.0f;
-	for (iter = 0; iter < smd->repeat; iter++) {
-		memset_laplacian_system(sys, 0);
-		nlNewContext();
-		sys->context = nlGetCurrent();
-		nlSolverParameteri(NL_NB_VARIABLES, numVerts);
-		nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
-		nlSolverParameteri(NL_NB_ROWS, numVerts);
-		nlSolverParameteri(NL_NB_RIGHT_HAND_SIDES, 3);
+	memset_laplacian_system(sys, 0);
+	nlNewContext();
+	sys->context = nlGetCurrent();
+	nlSolverParameteri(NL_NB_VARIABLES, numVerts);
+	nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
+	nlSolverParameteri(NL_NB_ROWS, numVerts);
+	nlSolverParameteri(NL_NB_RIGHT_HAND_SIDES, 3);
 
-		init_laplacian_matrix(sys);
+	init_laplacian_matrix(sys);
 
+	for (iter = 0; iter < smd->repeat; iter++) {
 		nlBegin(NL_SYSTEM);
 		for (i = 0; i < numVerts; i++) {
 			nlSetVariable(0, i, vertexCos[i][0]);
@@ -605,46 +603,64 @@ static void laplaciansmoothModifier_do(
 		nlBegin(NL_MATRIX);
 		dv = dvert;
 		for (i = 0; i < numVerts; i++) {
-			nlRightHandSideAdd(0, i, vertexCos[i][0]);
-			nlRightHandSideAdd(1, i, vertexCos[i][1]);
-			nlRightHandSideAdd(2, i, vertexCos[i][2]);
-			if (dv) {
-				wpaint = defvert_find_weight(dv, defgrp_index);
-				dv++;
-			}
-			else {
-				wpaint = 1.0f;
-			}
-
-			if (sys->zerola[i] == 0) {
-				w = sys->vweights[i] * sys->ring_areas[i];
-				sys->vweights[i] = (w == 0.0f) ? 0.0f : -smd->lambda * wpaint / (4.0f * w);
-				w = sys->vlengths[i];
-				sys->vlengths[i] = (w == 0.0f) ? 0.0f : -smd->lambda_border * wpaint * 2.0f / w;
+			nlRightHandSideSet(0, i, vertexCos[i][0]);
+			nlRightHandSideSet(1, i, vertexCos[i][1]);
+			nlRightHandSideSet(2, i, vertexCos[i][2]);
+			if (iter == 0) {
+				if (dv) {
+					wpaint = defvert_find_weight(dv, defgrp_index);
+					dv++;
+				}
+				else {
+					wpaint = 1.0f;
+				}
 
-				if (sys->numNeEd[i] == sys->numNeFa[i]) {
-					nlMatrixAdd(i, i,  1.0f + smd->lambda * wpaint / (4.0f * sys->ring_areas[i]));
+				if (sys->zerola[i] == 0) {
+					if (smd->flag & MOD_LAPLACIANSMOOTH_NORMALIZED) {
+						w = sys->vweights[i];
+						sys->vweights[i] = (w == 0.0f) ? 0.0f : -fabsf(smd->lambda) * wpaint / w;
+						w = sys->vlengths[i];
+						sys->vlengths[i] = (w == 0.0f) ? 0.0f : -fabsf(smd->lambda_border) * wpaint * 2.0f / w;
+						if (sys->numNeEd[i] == sys->numNeFa[i]) {
+							nlMatrixAdd(i, i,  1.0f + fabsf(smd->lambda) * wpaint);
+						}
+						else {
+							nlMatrixAdd(i, i,  1.0f + fabsf(smd->lambda_border) * wpaint * 2.0f);
+						}
+					}
+					else {
+						w = sys->vweights[i] * sys->ring_areas[i];
+						sys->vweights[i] = (w == 0.0f) ? 0.0f : -fabsf(smd->lambda) * wpaint / (4.0f * w);
+						w = sys->vlengths[i];
+						sys->vlengths[i] = (w == 0.0f) ? 0.0f : -fabsf(smd->lambda_border) * wpaint * 2.0f / w;
+
+						if (sys->numNeEd[i] == sys->numNeFa[i]) {
+							nlMatrixAdd(i, i,  1.0f + fabsf(smd->lambda) * wpaint / (4.0f * sys->ring_areas[i]));
+						}
+						else {
+							nlMatrixAdd(i, i,  1.0f + fabsf(smd->lambda_border) * wpaint * 2.0f);
+						}
+					}
 				}
 				else {
-					nlMatrixAdd(i, i,  1.0f + smd->lambda_border * wpaint * 2.0f);
+					nlMatrixAdd(i, i, 1.0f);
 				}
 			}
-			else {
-				nlMatrixAdd(i, i, 1.0f);
-			}
 		}
 
-		fill_laplacian_matrix(sys);
+		if (iter == 0) {
+			fill_laplacian_matrix(sys);
+		}
 
 		nlEnd(NL_MATRIX);
 		nlEnd(NL_SYSTEM);
 
 		if (nlSolveAdvanced(NULL, NL_TRUE)) {
-			validate_solution(sys, smd->flag);
+			validate_solution(sys, smd->flag, smd->lambda, smd->lambda_border);
 		}
-		nlDeleteContext(sys->context);
-		sys->context = NULL;
 	}
+	nlDeleteContext(sys->context);
+	sys->context = NULL;
 	delete_laplacian_system(sys);
 
 }
diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c
new file mode 100644
index 0000000..5e702a4
--- /dev/null
+++ b/source/blender/modifiers/intern/MOD_meshcache.c
@@ -0,0 +1,344 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/modifiers/intern/MOD_meshcache.c
+ *  \ingroup modifiers
+ */
+
+#include <stdio.h>
+
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_string.h"
+#include "BLI_path_util.h"
+#include "BLI_math.h"
+
+#include "BKE_DerivedMesh.h"
+#include "BKE_scene.h"
+#include "BKE_global.h"
+#include "BKE_mesh.h"
+#include "BKE_main.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "MOD_meshcache_util.h"  /* utility functions */
+
+#include "MOD_modifiertypes.h"
+
+#include "MOD_util.h"
+
+static void initData(ModifierData *md)
+{
+	MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+
+	mcmd->flag = 0;
+	mcmd->type = MOD_MESHCACHE_TYPE_MDD;
+	mcmd->interp = MOD_MESHCACHE_INTERP_LINEAR;
+	mcmd->frame_scale = 1.0f;
+
+	mcmd->factor = 1.0f;
+
+	/* (Y, Z). Blender default */
+	mcmd->forward_axis = 1;
+	mcmd->up_axis      = 2;
+}
+
+static void copyData(ModifierData *md, ModifierData *target)
+{
+	MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+	MeshCacheModifierData *tmcmd = (MeshCacheModifierData *)target;
+
+	tmcmd->flag = mcmd->flag;
+	tmcmd->type = mcmd->type;
+
+	tmcmd->time_mode = mcmd->time_mode;
+	tmcmd->play_mode = mcmd->play_mode;
+
+	tmcmd->forward_axis = mcmd->forward_axis;
+	tmcmd->up_axis      = mcmd->up_axis;
+	tmcmd->flip_axis    = mcmd->flip_axis;
+
+	tmcmd->interp = mcmd->interp;
+
+	tmcmd->frame_start = mcmd->frame_start;
+	tmcmd->frame_scale = mcmd->frame_scale;
+
+	tmcmd->factor = mcmd->factor;
+	tmcmd->deform_mode = mcmd->deform_mode;
+
+	tmcmd->eval_frame  = mcmd->eval_frame;
+	tmcmd->eval_time   = mcmd->eval_time;
+	tmcmd->eval_factor = mcmd->eval_factor;
+
+	BLI_strncpy(tmcmd->filepath, mcmd->filepath, sizeof(tmcmd->filepath));
+}
+
+static int dependsOnTime(ModifierData *md)
+{
+	MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+	return (mcmd->play_mode == MOD_MESHCACHE_PLAY_CFEA);
+}
+
+static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
+{
+	MeshCacheModifierData *mcmd = (MeshCacheModifierData *) md;
+
+	/* leave it up to the modifier to check the file is valid on calculation */
+	return (mcmd->factor <= 0.0f) || (mcmd->filepath[0] == '\0');
+}
+
+
+static void meshcache_do(
+        MeshCacheModifierData *mcmd, Object *ob, DerivedMesh *UNUSED(dm),
+        float (*vertexCos_Real)[3], int numVerts)
+{
+	const bool use_factor = mcmd->factor < 1.0f;
+	float (*vertexCos_Store)[3] = (use_factor || (mcmd->deform_mode == MOD_MESHCACHE_DEFORM_INTEGRATE)) ?
+	                              MEM_mallocN(sizeof(*vertexCos_Store) * numVerts, __func__) : NULL;
+	float (*vertexCos)[3] = vertexCos_Store ? vertexCos_Store : vertexCos_Real;
+
+	Scene *scene = mcmd->modifier.scene;
+	const float fps = FPS;
+
+	char filepath[FILE_MAX];
+	const char *err_str = NULL;
+	bool ok;
+
+	float time;
+
+
+	/* -------------------------------------------------------------------- */
+	/* Interpret Time (the reading functions also do some of this ) */
+	if (mcmd->play_mode == MOD_MESHCACHE_PLAY_CFEA) {
+		const float cfra = BKE_scene_frame_get(scene);
+
+		switch (mcmd->time_mode) {
+			case MOD_MESHCACHE_TIME_FRAME:
+			{
+				time = cfra;
+				break;
+			}
+			case MOD_MESHCACHE_TIME_SECONDS:
+			{
+				time = cfra / fps;
+				break;
+			}
+			case MOD_MESHCACHE_TIME_FACTOR:
+			default:
+			{
+				time = cfra / fps;
+				break;
+			}
+		}
+
+		/* apply offset and scale */
+		time = (mcmd->frame_scale * time) - mcmd->frame_start;
+	}
+	else {  /*  if (mcmd->play_mode == MOD_MESHCACHE_PLAY_EVAL) { */
+		switch (mcmd->time_mode) {
+			case MOD_MESHCACHE_TIME_FRAME:
+			{
+				time = mcmd->eval_frame;
+				break;
+			}
+			case MOD_MESHCACHE_TIME_SECONDS:
+			{
+				time = mcmd->eval_time;
+				break;
+			}
+			case MOD_MESHCACHE_TIME_FACTOR:
+			default:
+			{
+				time = mcmd->eval_factor;
+				break;
+			}
+		}
+	}
+
+
+	/* -------------------------------------------------------------------- */
+	/* Read the File (or error out when the file is bad) */
+
+	/* would be nice if we could avoid doing this _every_ frame */
+	BLI_strncpy(filepath, mcmd->filepath, sizeof(filepath));
+	BLI_path_abs(filepath, ID_BLEND_PATH(G.main, (ID *)ob));
+
+	switch (mcmd->type) {
+		case MOD_MESHCACHE_TYPE_MDD:
+			ok = MOD_meshcache_read_mdd_times(filepath, vertexCos, numVerts,
+			                                  mcmd->interp, time, fps, mcmd->time_mode, &err_str);
+			break;
+		case MOD_MESHCACHE_TYPE_PC2:
+			ok = MOD_meshcache_read_pc2_times(filepath, vertexCos, numVerts,
+			                                  mcmd->interp, time, fps, mcmd->time_mode, &err_str);
+			break;
+		default:
+			ok = false;
+			break;
+	}
+
+
+	/* -------------------------------------------------------------------- */
+	/* tricky shape key integration (slow!) */
+	if (mcmd->deform_mode == MOD_MESHCACHE_DEFORM_INTEGRATE) {
+		Mesh *me = ob->data;
+
+		/* we could support any object type */
+		if (UNLIKELY(ob->type != OB_MESH)) {
+			modifier_setError(&mcmd->modifier, "'Integrate' only valid for Mesh objects");
+		}
+		else if (UNLIKELY(me->totvert != numVerts)) {
+			modifier_setError(&mcmd->modifier, "'Integrate' original mesh vertex mismatch");
+		}
+		else if (UNLIKELY(me->totpoly == 0)) {
+			modifier_setError(&mcmd->modifier, "'Integrate' requires faces");
+		}
+		else {
+			/* the moons align! */
+			int i;
+
+			float (*vertexCos_Source)[3] = MEM_mallocN(sizeof(*vertexCos_Source) * numVerts, __func__);
+			float (*vertexCos_New)[3]    = MEM_mallocN(sizeof(*vertexCos_New) * numVerts, __func__);
+			MVert *mv = me->mvert;
+
+			for (i = 0; i < numVerts; i++, mv++) {
+				copy_v3_v3(vertexCos_Source[i], mv->co);
+			}
+
+			BKE_mesh_calc_relative_deform(
+			        me->mpoly, me->totpoly,
+			        me->mloop, me->totvert,
+
+			        (const float (*)[3])vertexCos_Source,   /* from the original Mesh*/
+			        (const float (*)[3])vertexCos_Real,     /* the input we've been given (shape keys!) */
+
+			        (const float (*)[3])vertexCos,          /* the result of this modifier */
+			        vertexCos_New                           /* the result of this function */
+			        );
+
+			/* write the corrected locations back into the result */
+			memcpy(vertexCos, vertexCos_New, sizeof(*vertexCos) * numVerts);
+
+			MEM_freeN(vertexCos_Source);
+			MEM_freeN(vertexCos_New);
+		}
+	}
+
+
+	/* -------------------------------------------------------------------- */
+	/* Apply the transformation matrix (if needed) */
+	if (UNLIKELY(err_str)) {
+		modifier_setError(&mcmd->modifier, err_str);
+	}
+	else if (ok) {
+		bool use_matrix = false;
+		float mat[3][3];
+		unit_m3(mat);
+
+		if (mat3_from_axis_conversion(mcmd->forward_axis, mcmd->up_axis, 1, 2, mat)) {
+			use_matrix = true;
+		}
+
+		if (mcmd->flip_axis) {
+			float tmat[3][3];
+			unit_m3(tmat);
+			if (mcmd->flip_axis & (1 << 0)) tmat[0][0] = -1.0f;
+			if (mcmd->flip_axis & (1 << 1)) tmat[1][1] = -1.0f;
+			if (mcmd->flip_axis & (1 << 2)) tmat[2][2] = -1.0f;
+			mul_m3_m3m3(mat, tmat, mat);
+
+			use_matrix = true;
+		}
+
+		if (use_matrix) {
+			int i;
+			for (i = 0; i < numVerts; i++) {
+				mul_m3_v3(mat, vertexCos[i]);
+			}
+		}
+	}
+
+	if (vertexCos_Store) {
+		if (ok) {
+			if (use_factor) {
+				interp_vn_vn(*vertexCos_Real, *vertexCos_Store, mcmd->factor, numVerts * 3);
+			}
+			else {
+				memcpy(vertexCos_Real, vertexCos_Store, sizeof(*vertexCos_Store) * numVerts);
+			}
+		}
+
+		MEM_freeN(vertexCos_Store);
+	}
+}
+
+static void deformVerts(ModifierData *md, Object *ob,
+                        DerivedMesh *derivedData,
+                        float (*vertexCos)[3],
+                        int numVerts,
+                        ModifierApplyFlag UNUSED(flag))
+{
+	MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+
+	meshcache_do(mcmd, ob, derivedData, vertexCos, numVerts);
+}
+
+static void deformVertsEM(
+        ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData),
+        DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+{
+	MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+
+	meshcache_do(mcmd, ob, derivedData, vertexCos, numVerts);
+}
+
+
+ModifierTypeInfo modifierType_MeshCache = {
+	/* name */              "Mesh Cache",
+	/* structName */        "MeshCacheModifierData",
+	/* structSize */        sizeof(MeshCacheModifierData),
+	/* type */              eModifierTypeType_OnlyDeform,
+	/* flags */             eModifierTypeFlag_AcceptsCVs |
+	                        eModifierTypeFlag_SupportsEditmode,
+
+	/* copyData */          copyData,
+	/* deformVerts */       deformVerts,
+	/* deformMatrices */    NULL,
+	/* deformVertsEM */     deformVertsEM,
+	/* deformMatricesEM */  NULL,
+	/* applyModifier */     NULL,
+	/* applyModifierEM */   NULL,
+	/* initData */          initData,
+	/* requiredDataMask */  NULL,
+	/* freeData */          NULL,
+	/* isDisabled */        isDisabled,
+	/* updateDepgraph */    NULL,
+	/* dependsOnTime */     dependsOnTime,
+	/* dependsOnNormals */  NULL,
+	/* foreachObjectLink */ NULL,
+	/* foreachIDLink */     NULL,
+	/* foreachTexLink */    NULL,
+};
diff --git a/source/blender/modifiers/intern/MOD_meshcache_mdd.c b/source/blender/modifiers/intern/MOD_meshcache_mdd.c
new file mode 100644
index 0000000..e001855
--- /dev/null
+++ b/source/blender/modifiers/intern/MOD_meshcache_mdd.c
@@ -0,0 +1,301 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton, pkowal
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/modifiers/intern/MOD_meshcache_mdd.c
+ *  \ingroup modifiers
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "BLO_sys_types.h"
+#include "BLI_utildefines.h"
+#include "BLI_endian_switch.h"
+#include "BLI_fileops.h"
+#include "BLI_math.h"
+
+#include "MOD_meshcache_util.h"  /* own include */
+
+#include "DNA_modifier_types.h"
+
+typedef struct MDDHead {
+	int frame_tot;
+	int verts_tot;
+} MDDHead;  /* frames, verts */
+
+static bool meshcache_read_mdd_head(FILE *fp, const int verts_tot,
+                                    MDDHead *mdd_head,
+                                    const char **err_str)
+{
+	if (!fread(mdd_head, sizeof(*mdd_head), 1, fp)) {
+		*err_str = "Missing header";
+		return false;
+	}
+
+#ifdef __LITTLE_ENDIAN__
+	BLI_endian_switch_int32_array((int *)mdd_head, 2);
+#endif
+
+	if (mdd_head->verts_tot != verts_tot) {
+		*err_str = "Vertex count mismatch";
+		return false;
+	}
+
+	if (mdd_head->frame_tot <= 0) {
+		*err_str = "Invalid frame total";
+		return false;
+	}
+	/* intentionally dont seek back */
+
+	return true;
+}
+
+/**
+ * Gets the index frange and factor
+ */
+static bool meshcache_read_mdd_range(FILE *fp,
+                                     const int verts_tot,
+                                     const float frame, const char interp,
+                                     int r_index_range[2], float *r_factor,
+                                     const char **err_str)
+{
+	MDDHead mdd_head;
+
+	/* first check interpolation and get the vert locations */
+
+	if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
+		return false;
+	}
+
+	MOD_meshcache_calc_range(frame, interp, mdd_head.frame_tot, r_index_range, r_factor);
+
+	return true;
+}
+
+static bool meshcache_read_mdd_range_from_time(FILE *fp,
+                                               const int verts_tot,
+                                               const float time, const float UNUSED(fps),
+                                               float *r_frame,
+                                               const char **err_str)
+{
+	MDDHead mdd_head;
+	int i;
+	float f_time, f_time_prev = FLT_MAX;
+	float frame;
+
+	if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
+		return false;
+	}
+
+	for (i = 0; i < mdd_head.frame_tot; i++) {
+		fread(&f_time, sizeof(float), 1, fp);
+#ifdef __LITTLE_ENDIAN__
+		BLI_endian_switch_float(&f_time);
+#endif
+		if (f_time >= time) {
+			break;
+		}
+		f_time_prev = f_time;
+	}
+
+	if (i == mdd_head.frame_tot) {
+		frame = (float)(mdd_head.frame_tot - 1);
+	}
+	if (UNLIKELY(f_time_prev == FLT_MAX)) {
+		frame = 0.0f;
+	}
+	else {
+		const float range  = f_time - f_time_prev;
+
+		if (range <= FRAME_SNAP_EPS) {
+			frame = (float)i;
+		}
+		else {
+			frame = (float)(i - 1) + ((time - f_time_prev) / range);
+		}
+	}
+
+	*r_frame = frame;
+	return true;
+}
+
+bool MOD_meshcache_read_mdd_index(FILE *fp,
+                                  float (*vertexCos)[3], const int verts_tot,
+                                  const int index, const float factor,
+                                  const char **err_str)
+{
+	MDDHead mdd_head;
+
+	if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
+		return false;
+	}
+
+	if (fseek(fp, mdd_head.frame_tot * sizeof(int), SEEK_CUR) != 0) {
+		*err_str = "Header seek failed";
+		return false;
+	}
+
+	if (fseek(fp, index * mdd_head.verts_tot * sizeof(float) * 3, SEEK_CUR) != 0) {
+		*err_str = "Failed to seek frame";
+		return false;
+	}
+
+	if (factor >= 1.0f) {
+#if 1
+		float *vco = *vertexCos;
+		unsigned int i;
+		for (i = mdd_head.verts_tot; i != 0 ; i--, vco += 3) {
+			fread(vco, sizeof(float) * 3, 1, fp);
+
+#  ifdef __LITTLE_ENDIAN__
+			BLI_endian_switch_float(vco + 0);
+			BLI_endian_switch_float(vco + 1);
+			BLI_endian_switch_float(vco + 2);
+#  endif  /* __LITTLE_ENDIAN__ */
+		}
+#else
+		/* no blending */
+		if (!fread(vertexCos, sizeof(float) * 3, mdd_head.verts_tot, f)) {
+			*err_str = errno ? strerror(errno) : "Failed to read frame";
+			return false;
+		}
+#  ifdef __LITTLE_ENDIAN__
+		BLI_endian_switch_float_array(vertexCos[0], mdd_head.verts_tot * 3);
+#  endif
+#endif
+	}
+	else {
+		const float ifactor = 1.0f - factor;
+		float *vco = *vertexCos;
+		unsigned int i;
+		for (i = mdd_head.verts_tot; i != 0 ; i--, vco += 3) {
+			float tvec[3];
+			fread(tvec, sizeof(float) * 3, 1, fp);
+
+#ifdef __LITTLE_ENDIAN__
+			BLI_endian_switch_float(tvec + 0);
+			BLI_endian_switch_float(tvec + 1);
+			BLI_endian_switch_float(tvec + 2);
+#endif
+
+			vco[0] = (vco[0] * ifactor) + (tvec[0] * factor);
+			vco[1] = (vco[1] * ifactor) + (tvec[1] * factor);
+			vco[2] = (vco[2] * ifactor) + (tvec[2] * factor);
+		}
+	}
+
+	return true;
+}
+
+bool MOD_meshcache_read_mdd_frame(FILE *fp,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float frame,
+                                  const char **err_str)
+{
+	int index_range[2];
+	float factor;
+
+	if (meshcache_read_mdd_range(fp, verts_tot, frame, interp,
+	                             index_range, &factor,  /* read into these values */
+	                             err_str) == false)
+	{
+		return false;
+	}
+
+	if (index_range[0] == index_range[1]) {
+		/* read single */
+		if ((fseek(fp, 0, SEEK_SET) == 0) &&
+		    MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str))
+		{
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
+	else {
+		/* read both and interpolate */
+		if ((fseek(fp, 0, SEEK_SET) == 0) &&
+		    MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) &&
+		    (fseek(fp, 0, SEEK_SET) == 0) &&
+		    MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str))
+		{
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
+}
+
+bool MOD_meshcache_read_mdd_times(const char *filepath,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float time, const float fps, const char time_mode,
+                                  const char **err_str)
+{
+	float frame;
+
+	FILE *fp = BLI_fopen(filepath, "rb");
+	bool ok;
+
+	if (fp == NULL) {
+		*err_str = errno ? strerror(errno) : "Unknown error opening file";
+		return false;
+	}
+
+	switch (time_mode) {
+		case MOD_MESHCACHE_TIME_FRAME:
+		{
+			frame = time;
+			break;
+		}
+		case MOD_MESHCACHE_TIME_SECONDS:
+		{
+			/* we need to find the closest time */
+			if (meshcache_read_mdd_range_from_time(fp, verts_tot, time, fps, &frame, err_str) == false) {
+				fclose(fp);
+				return false;
+			}
+			rewind(fp);
+			break;
+		}
+		case MOD_MESHCACHE_TIME_FACTOR:
+		default:
+		{
+			MDDHead mdd_head;
+			if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
+				fclose(fp);
+				return false;
+			}
+
+			frame = CLAMPIS(time, 0.0f, 1.0f) * (float)mdd_head.frame_tot;
+			rewind(fp);
+			break;
+		}
+	}
+
+	ok = MOD_meshcache_read_mdd_frame(fp, vertexCos, verts_tot, interp, frame, err_str);
+
+	fclose(fp);
+	return ok;
+}
diff --git a/source/blender/modifiers/intern/MOD_meshcache_pc2.c b/source/blender/modifiers/intern/MOD_meshcache_pc2.c
new file mode 100644
index 0000000..1ecb347
--- /dev/null
+++ b/source/blender/modifiers/intern/MOD_meshcache_pc2.c
@@ -0,0 +1,277 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/modifiers/intern/MOD_meshcache_pc2.c
+ *  \ingroup modifiers
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "BLO_sys_types.h"
+#include "BLI_utildefines.h"
+#include "BLI_endian_switch.h"
+#include "BLI_fileops.h"
+#include "BLI_math.h"
+
+#include "MOD_meshcache_util.h"  /* own include */
+
+#include "DNA_modifier_types.h"
+
+typedef struct PC2Head {
+	char    header[12];  /* 'POINTCACHE2\0' */
+	int     file_version;  /* unused - should be 1 */
+	int     verts_tot;
+	float   start;
+	float   sampling;
+	int     frame_tot;
+} PC2Head;  /* frames, verts */
+
+static bool meshcache_read_pc2_head(FILE *fp, const int verts_tot,
+                                    PC2Head *pc2_head,
+                                    const char **err_str)
+{
+	if (!fread(pc2_head, sizeof(*pc2_head), 1, fp)) {
+		*err_str = "Missing header";
+		return false;
+	}
+
+	if (strcmp(pc2_head->header, "POINTCACHE2") != 0) {
+		*err_str = "Invalid header";
+		return false;
+	}
+
+#ifdef __BIG_ENDIAN__
+	BLI_endian_switch_int32_array(&pc2_head->huh, (sizeof(*pc2_head) - sizeof(pc2_head->header)) / sizeof(int));
+#endif
+
+	if (pc2_head->verts_tot != verts_tot) {
+		*err_str = "Vertex count mismatch";
+		return false;
+	}
+
+	if (pc2_head->frame_tot <= 0) {
+		*err_str = "Invalid frame total";
+		return false;
+	}
+	/* intentionally dont seek back */
+
+	return true;
+}
+
+
+/**
+ * Gets the index frange and factor
+ *
+ * currently same as for MDD
+ */
+static bool meshcache_read_pc2_range(FILE *fp,
+                                     const int verts_tot,
+                                     const float frame, const char interp,
+                                     int r_index_range[2], float *r_factor,
+                                     const char **err_str)
+{
+	PC2Head pc2_head;
+
+	/* first check interpolation and get the vert locations */
+
+	if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
+		return false;
+	}
+
+	MOD_meshcache_calc_range(frame, interp, pc2_head.frame_tot, r_index_range, r_factor);
+
+	return true;
+}
+
+static bool meshcache_read_pc2_range_from_time(FILE *fp,
+                                               const int verts_tot,
+                                               const float time, const float fps,
+                                               float *r_frame,
+                                               const char **err_str)
+{
+	PC2Head pc2_head;
+	float frame;
+
+	if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
+		return false;
+	}
+
+	frame = ((time / fps) - pc2_head.start) / pc2_head.sampling;
+
+	if (frame >= pc2_head.frame_tot) {
+		frame = (float)(pc2_head.frame_tot - 1);
+	}
+	else if (frame < 0.0f) {
+		frame = 0.0f;
+	}
+
+	*r_frame = frame;
+	return true;
+}
+
+bool MOD_meshcache_read_pc2_index(FILE *fp,
+                                  float (*vertexCos)[3], const int verts_tot,
+                                  const int index, const float factor,
+                                  const char **err_str)
+{
+	PC2Head pc2_head;
+
+	if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
+		return false;
+	}
+
+	if (fseek(fp, index * pc2_head.verts_tot * sizeof(float) * 3, SEEK_CUR) != 0) {
+		*err_str = "Failed to seek frame";
+		return false;
+	}
+
+	if (factor >= 1.0f) {
+		float *vco = *vertexCos;
+		unsigned int i;
+		for (i = pc2_head.verts_tot; i != 0 ; i--, vco += 3) {
+			fread(vco, sizeof(float) * 3, 1, fp);
+
+#  ifdef __BIG_ENDIAN__
+			BLI_endian_switch_float(vco + 0);
+			BLI_endian_switch_float(vco + 1);
+			BLI_endian_switch_float(vco + 2);
+#  endif  /* __BIG_ENDIAN__ */
+		}
+	}
+	else {
+		const float ifactor = 1.0f - factor;
+		float *vco = *vertexCos;
+		unsigned int i;
+		for (i = pc2_head.verts_tot; i != 0 ; i--, vco += 3) {
+			float tvec[3];
+			fread(tvec, sizeof(float) * 3, 1, fp);
+
+#ifdef __BIG_ENDIAN__
+			BLI_endian_switch_float(tvec + 0);
+			BLI_endian_switch_float(tvec + 1);
+			BLI_endian_switch_float(tvec + 2);
+#endif  /* __BIG_ENDIAN__ */
+
+			vco[0] = (vco[0] * ifactor) + (tvec[0] * factor);
+			vco[1] = (vco[1] * ifactor) + (tvec[1] * factor);
+			vco[2] = (vco[2] * ifactor) + (tvec[2] * factor);
+		}
+	}
+
+	return true;
+}
+
+
+bool MOD_meshcache_read_pc2_frame(FILE *fp,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float frame,
+                                  const char **err_str)
+{
+	int index_range[2];
+	float factor;
+
+	if (meshcache_read_pc2_range(fp, verts_tot, frame, interp,
+	                             index_range, &factor,  /* read into these values */
+	                             err_str) == false)
+	{
+		return false;
+	}
+
+	if (index_range[0] == index_range[1]) {
+		/* read single */
+		if ((fseek(fp, 0, SEEK_SET) == 0) &&
+		    MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str))
+		{
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
+	else {
+		/* read both and interpolate */
+		if ((fseek(fp, 0, SEEK_SET) == 0) &&
+		    MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) &&
+		    (fseek(fp, 0, SEEK_SET) == 0) &&
+		    MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str))
+		{
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
+}
+
+bool MOD_meshcache_read_pc2_times(const char *filepath,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float time, const float fps, const char time_mode,
+                                  const char **err_str)
+{
+	float frame;
+
+	FILE *fp = BLI_fopen(filepath, "rb");
+	bool ok;
+
+	if (fp == NULL) {
+		*err_str = errno ? strerror(errno) : "Unknown error opening file";
+		return false;
+	}
+
+	switch (time_mode) {
+		case MOD_MESHCACHE_TIME_FRAME:
+		{
+			frame = time;
+			break;
+		}
+		case MOD_MESHCACHE_TIME_SECONDS:
+		{
+			/* we need to find the closest time */
+			if (meshcache_read_pc2_range_from_time(fp, verts_tot, time, fps, &frame, err_str) == false) {
+				fclose(fp);
+				return false;
+			}
+			rewind(fp);
+			break;
+		}
+		case MOD_MESHCACHE_TIME_FACTOR:
+		default:
+		{
+			PC2Head pc2_head;
+			if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
+				fclose(fp);
+				return false;
+			}
+
+			frame = CLAMPIS(time, 0.0f, 1.0f) * (float)pc2_head.frame_tot;
+			rewind(fp);
+			break;
+		}
+	}
+
+	ok = MOD_meshcache_read_pc2_frame(fp, vertexCos, verts_tot, interp, frame, err_str);
+
+	fclose(fp);
+	return ok;
+}
diff --git a/source/blender/modifiers/intern/MOD_meshcache_util.c b/source/blender/modifiers/intern/MOD_meshcache_util.c
new file mode 100644
index 0000000..679a793
--- /dev/null
+++ b/source/blender/modifiers/intern/MOD_meshcache_util.c
@@ -0,0 +1,71 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "BLI_utildefines.h"
+#include "BLI_math.h"
+
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "MOD_meshcache_util.h"
+
+void MOD_meshcache_calc_range(const float frame, const char interp,
+                              const int frame_tot,
+                              int r_index_range[2], float *r_factor)
+{
+	if (interp == MOD_MESHCACHE_INTERP_NONE) {
+		r_index_range[0] = r_index_range[1] = max_ii(0, min_ii(frame_tot - 1, (int)(floorf(frame) + 0.5f)));
+		*r_factor = 1.0f; /* dummy */
+	}
+	else {
+		const float tframe = floorf(frame);
+		const float range  = frame - tframe;
+		r_index_range[0] = (int)tframe;
+		if (range <= FRAME_SNAP_EPS) {
+			/* we're close enough not to need blending */
+			r_index_range[1] = r_index_range[0];
+			*r_factor = 1.0f; /* dummy */
+		}
+		else {
+			/* blend between 2 frames */
+			r_index_range[1] = r_index_range[0] + 1;
+			*r_factor = range;
+		}
+
+		/* clamp */
+		if ((r_index_range[0] >= frame_tot) ||
+		    (r_index_range[1] >= frame_tot))
+		{
+			r_index_range[0] = r_index_range[1] = frame_tot - 1;
+			*r_factor = 1.0f; /* dummy */
+		}
+		else if ((r_index_range[0] < 0) ||
+		         (r_index_range[1] < 0))
+		{
+			r_index_range[0] = r_index_range[1] = 0;
+			*r_factor = 1.0f; /* dummy */
+		}
+	}
+}
diff --git a/source/blender/modifiers/intern/MOD_meshcache_util.h b/source/blender/modifiers/intern/MOD_meshcache_util.h
new file mode 100644
index 0000000..d7e7151
--- /dev/null
+++ b/source/blender/modifiers/intern/MOD_meshcache_util.h
@@ -0,0 +1,67 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/modifiers/intern/MOD_meshcache_util.h
+ *  \ingroup modifiers
+ */
+
+#ifndef __MOD_MESHCACHE_UTIL_H__
+
+struct MPoly;
+struct MLoop;
+
+/* MOD_meshcache_mdd.c */
+bool MOD_meshcache_read_mdd_index(FILE *fp,
+                                  float (*vertexCos)[3], const int vertex_tot,
+                                  const int index, const float factor,
+                                  const char **err_str);
+bool MOD_meshcache_read_mdd_frame(FILE *fp,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float frame,
+                                  const char **err_str);
+bool MOD_meshcache_read_mdd_times(const char *filepath,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float time, const float fps, const char time_mode,
+                                  const char **err_str);
+
+/* MOD_meshcache_pc2.c */
+bool MOD_meshcache_read_pc2_index(FILE *fp,
+                                  float (*vertexCos)[3], const int verts_tot,
+                                  const int index, const float factor,
+                                  const char **err_str);
+bool MOD_meshcache_read_pc2_frame(FILE *fp,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float frame,
+                                  const char **err_str);
+bool MOD_meshcache_read_pc2_times(const char *filepath,
+                                  float (*vertexCos)[3], const int verts_tot, const char interp,
+                                  const float time, const float fps, const char time_mode,
+                                  const char **err_str);
+
+/* MOD_meshcache_util.c */
+void MOD_meshcache_calc_range(const float frame, const char interp,
+                              const int frame_tot,
+                              int r_index_range[2], float *r_factor);
+
+#define FRAME_SNAP_EPS 0.0001f
+
+#endif /* __MOD_MESHCACHE_UTIL_H__ */
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index c0e529f..77250ec 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -1,4 +1,4 @@
-/**
+/*
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -25,6 +25,10 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file blender/modifiers/intern/MOD_ocean.c
+ *  \ingroup modifiers
+ */
+
 #include "MEM_guardedalloc.h"
 
 #include "DNA_customdata_types.h"
@@ -486,7 +490,8 @@ static DerivedMesh *doOcean(ModifierData *md, Object *ob,
 
 						mlcol = &mloopcols[mp->loopstart + j];
 						mlcol->r = mlcol->g = mlcol->b = (char)(foam * 255);
-						/* mc->a = 255; */ /* no need to set */
+						/* This needs to be set (render engine uses) */
+						mlcol->a = 255;
 					} while (j--);
 				}
 			}
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index 1021620..e7d6245 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -314,11 +314,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 		CustomData_add_layer(&result->polyData, CD_ORIGINDEX, CD_CALLOC, NULL, maxPolys);
 	}
 
-#if 0 // trunk
-	origindex = result->getPolyDataArray(result, CD_ORIGINDEX);
-#else // bmesh
 	origindex = CustomData_get_layer(&result->polyData, CD_ORIGINDEX);
-#endif
 
 	DM_copy_vert_data(dm, result, 0, 0, totvert); /* copy first otherwise this overwrites our own vertex normals */
 	
diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index a73d52a..81c5318 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -1278,7 +1278,8 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f
 		return;
 
 	/* Get split face's verts */
-	BM_iter_as_array(bm, BM_VERTS_OF_FACE, split_face, (void **)verts, 4);
+	// BM_iter_as_array(bm, BM_VERTS_OF_FACE, split_face, (void **)verts, 4);
+	BM_face_as_array_vert_quad(split_face, verts);
 	skin_choose_quad_bridge_order(verts, frame->verts, best_order);
 
 	/* Delete split face and merge */
@@ -1314,16 +1315,21 @@ static void skin_hole_detach_partially_attached_frame(BMesh *bm, Frame *frame)
 }
 
 
-static void quad_from_tris(BMesh *bm, BMEdge *e, BMFace *adj[2], BMVert *ndx[4])
+static void quad_from_tris(BMEdge *e, BMFace *adj[2], BMVert *ndx[4])
 {
 	BMVert *tri[2][3];
 	BMVert *opp = NULL;
 	int i, j;
 
 	BLI_assert(adj[0]->len == 3 && adj[1]->len == 3);
-	
+
+#if 0
 	BM_iter_as_array(bm, BM_VERTS_OF_FACE, adj[0], (void **)tri[0], 3);
 	BM_iter_as_array(bm, BM_VERTS_OF_FACE, adj[1], (void **)tri[1], 3);
+#else
+	BM_face_as_array_vert_tri(adj[0], tri[0]);
+	BM_face_as_array_vert_tri(adj[1], tri[1]);
+#endif
 
 	/* Find what the second tri has that the first doesn't */
 	for (i = 0; i < 3; i++) {
@@ -1354,7 +1360,7 @@ static void add_quad_from_tris(SkinOutput *so, BMEdge *e, BMFace *adj[2])
 {
 	BMVert *quad[4];
 
-	quad_from_tris(so->bm, e, adj, quad);
+	quad_from_tris(e, adj, quad);
 
 	add_poly(so, quad[0], quad[1], quad[2], quad[3]);
 }
@@ -1381,7 +1387,7 @@ static void hull_merge_triangles(SkinOutput *so, const SkinModifierData *smd)
 
 				/* Construct quad using the two triangles adjacent to
 				 * the edge */
-				quad_from_tris(so->bm, e, adj, quad);
+				quad_from_tris(e, adj, quad);
 
 				/* Calculate a score for the quad, higher score for
 				 * triangles being closer to coplanar */
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index e97f419..c0d46b1 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -47,7 +47,7 @@
 
 #include "MOD_modifiertypes.h"
 
-#include "CCGSubSurf.h"
+#include "intern/CCGSubSurf.h"
 
 static void initData(ModifierData *md)
 {
@@ -103,7 +103,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 		subsurf_flags |= SUBSURF_USE_RENDER_PARAMS;
 	if (isFinalCalc)
 		subsurf_flags |= SUBSURF_IS_FINAL_CALC;
-	if (ob->flag & OB_MODE_EDIT)
+	if (ob->mode & OB_MODE_EDIT)
 		subsurf_flags |= SUBSURF_IN_EDIT_MODE;
 	
 	result = subsurf_make_derived_from_derived(derivedData, smd, NULL, subsurf_flags);
diff --git a/source/blender/modifiers/intern/MOD_triangulate.c b/source/blender/modifiers/intern/MOD_triangulate.c
index 645fd5e..1c22e9b 100644
--- a/source/blender/modifiers/intern/MOD_triangulate.c
+++ b/source/blender/modifiers/intern/MOD_triangulate.c
@@ -33,8 +33,6 @@
 #include "BKE_modifier.h"
 #include "BKE_tessmesh.h"
 
-/* triangulation modifier, directly calls the bmesh operator */
-
 static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int flag)
 {
 	DerivedMesh *result;
@@ -44,13 +42,7 @@ static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int flag)
 
 	bm = DM_to_bmesh(dm);
 
-	BM_mesh_elem_toolflags_ensure(bm);
-	BMO_push(bm, NULL);
-
-	BMO_op_callf(bm, BMO_FLAG_DEFAULTS,
-	             "triangulate faces=%af use_beauty=%b",
-	             (flag & MOD_TRIANGULATE_BEAUTY));
-	BMO_pop(bm);
+	BM_mesh_triangulate(bm, (flag & MOD_TRIANGULATE_BEAUTY), false, NULL, NULL);
 
 	result = CDDM_from_bmesh(bm, FALSE);
 	BM_mesh_free(bm);
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index 6c2f688..1084023 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -74,7 +74,7 @@ void get_texture_value(Tex *texture, float *tex_co, TexResult *texres)
 	int result_type;
 
 	/* no node textures for now */
-	result_type = multitex_ext_safe(texture, tex_co, texres);
+	result_type = multitex_ext_safe(texture, tex_co, texres, NULL);
 
 	/* if the texture gave an RGB value, we assume it didn't give a valid
 	 * intensity, since this is in the context of modifiers don't use perceptual color conversion.
@@ -280,5 +280,6 @@ void modifier_type_init(ModifierTypeInfo *types[])
 	INIT_TYPE(LaplacianSmooth);
 	INIT_TYPE(Triangulate);
 	INIT_TYPE(UVWarp);
+	INIT_TYPE(MeshCache);
 #undef INIT_TYPE
 }
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index a7b491c..1284208 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -123,6 +123,7 @@ set(SRC
 	composite/nodes/node_composite_pixelate.c
 
 	composite/node_composite_tree.c
+	composite/node_composite_util.h
 
 	shader/nodes/node_shader_camera.c
 	shader/nodes/node_shader_common.c
@@ -235,13 +236,6 @@ set(SRC
 	intern/node_common.h
 )
 
-if(WITH_COMPOSITOR_LEGACY)
-	list(APPEND SRC
-		composite/node_composite_util.h
-		composite/node_composite_util.c
-	)
-endif()
-
 if(WITH_PYTHON)
 	list(APPEND INC
 		../python
@@ -267,8 +261,4 @@ if(WITH_COMPOSITOR)
 	add_definitions(-DWITH_COMPOSITOR)
 endif()
 
-if(WITH_COMPOSITOR_LEGACY)
-	add_definitions(-DWITH_COMPOSITOR_LEGACY)
-endif()
-
 blender_add_lib(bf_nodes "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index cc73590..9f56689 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -66,9 +66,6 @@ if env['WITH_BF_COMPOSITOR']:
     incs += ' ../compositor '
     defs.append("WITH_COMPOSITOR")
 
-if env['WITH_BF_COMPOSITOR_LEGACY']:
-    defs.append("WITH_COMPOSITOR_LEGACY")
-
 env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [190,105] )
 env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] )
 env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] )
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index 0346273..a6592b4 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -51,7 +51,6 @@
 #include "BKE_tracking.h"
 
 #include "node_common.h"
-#include "node_exec.h"
 #include "node_util.h"
 
 #include "PIL_time.h"
@@ -95,9 +94,6 @@ static void free_node_cache(bNodeTree *UNUSED(ntree), bNode *node)
 	
 	for (sock= node->outputs.first; sock; sock= sock->next) {
 		if (sock->cache) {
-#ifdef WITH_COMPOSITOR_LEGACY
-			free_compbuf(sock->cache);
-#endif
 			sock->cache= NULL;
 		}
 	}
@@ -161,9 +157,6 @@ static void localize(bNodeTree *localtree, bNodeTree *ntree)
 		
 		for (sock= node->outputs.first; sock; sock= sock->next) {
 			sock->new_sock->cache= sock->cache;
-#ifdef WITH_COMPOSITOR_LEGACY
-			compbuf_set_node(sock->new_sock->cache, node->new_node);
-#endif
 			sock->cache= NULL;
 			sock->new_sock->new_sock= sock;
 		}
@@ -239,9 +232,6 @@ static void local_merge(bNodeTree *localtree, bNodeTree *ntree)
 			for (lsock= lnode->outputs.first; lsock; lsock= lsock->next) {
 				if (ntreeOutputExists(lnode->new_node, lsock->new_sock)) {
 					lsock->new_sock->cache= lsock->cache;
-#ifdef WITH_COMPOSITOR_LEGACY
-					compbuf_set_node(lsock->new_sock->cache, lnode->new_node);
-#endif
 					lsock->cache= NULL;
 					lsock->new_sock= NULL;
 				}
@@ -277,421 +267,6 @@ bNodeTreeType ntreeType_Composite = {
 };
 
 
-/* XXX Group nodes must set use_tree_data to false, since their trees can be shared by multiple nodes.
- * If use_tree_data is true, the ntree->execdata pointer is checked to avoid multiple execution of top-level trees.
- */
-struct bNodeTreeExec *ntreeCompositBeginExecTree(bNodeTree *ntree, int use_tree_data)
-{
-	bNodeTreeExec *exec;
-	bNode *node;
-	bNodeSocket *sock;
-	
-	if (use_tree_data) {
-		/* XXX hack: prevent exec data from being generated twice.
-		 * this should be handled by the renderer!
-		 */
-		if (ntree->execdata)
-			return ntree->execdata;
-	}
-	
-	/* ensures only a single output node is enabled */
-	ntreeSetOutput(ntree);
-	
-	exec = ntree_exec_begin(ntree);
-	
-	for (node= exec->nodetree->nodes.first; node; node= node->next) {
-		/* initialize needed for groups */
-		node->exec= 0;
-		
-		for (sock= node->outputs.first; sock; sock= sock->next) {
-			bNodeStack *ns= node_get_socket_stack(exec->stack, sock);
-			if (ns && sock->cache) {
-				ns->data= sock->cache;
-				sock->cache= NULL;
-			}
-		}
-		/* cannot initialize them while using in threads */
-		if (ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT)) {
-			curvemapping_initialize(node->storage);
-			if (node->type==CMP_NODE_CURVE_RGB)
-				curvemapping_premultiply(node->storage, 0);
-		}
-	}
-	
-	if (use_tree_data) {
-		/* XXX this should not be necessary, but is still used for cmp/sha/tex nodes,
-		 * which only store the ntree pointer. Should be fixed at some point!
-		 */
-		ntree->execdata = exec;
-	}
-	
-	return exec;
-}
-
-/* XXX Group nodes must set use_tree_data to false, since their trees can be shared by multiple nodes.
- * If use_tree_data is true, the ntree->execdata pointer is checked to avoid multiple execution of top-level trees.
- */
-void ntreeCompositEndExecTree(bNodeTreeExec *exec, int use_tree_data)
-{
-	if (exec) {
-		bNodeTree *ntree= exec->nodetree;
-		bNode *node;
-		bNodeStack *ns;
-		
-		for (node= exec->nodetree->nodes.first; node; node= node->next) {
-			bNodeSocket *sock;
-			
-			for (sock= node->outputs.first; sock; sock= sock->next) {
-				ns = node_get_socket_stack(exec->stack, sock);
-				if (ns && ns->data) {
-					sock->cache= ns->data;
-					ns->data= NULL;
-				}
-			}
-			if (node->type==CMP_NODE_CURVE_RGB)
-				curvemapping_premultiply(node->storage, 1);
-			
-			node->need_exec= 0;
-		}
-	
-		ntree_exec_end(exec);
-		
-		if (use_tree_data) {
-			/* XXX clear nodetree backpointer to exec data, same problem as noted in ntreeBeginExecTree */
-			ntree->execdata = NULL;
-		}
-	}
-}
-
-#ifdef WITH_COMPOSITOR
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* ***************************** threaded version for execute composite nodes ************* */
-/* these are nodes without input, only giving values */
-/* or nodes with only value inputs */
-static int node_only_value(bNode *node)
-{
-	bNodeSocket *sock;
-	
-	if (ELEM3(node->type, CMP_NODE_TIME, CMP_NODE_VALUE, CMP_NODE_RGB))
-		return 1;
-	
-	/* doing this for all node types goes wrong. memory free errors */
-	if (node->inputs.first && node->type==CMP_NODE_MAP_VALUE) {
-		int retval= 1;
-		for (sock= node->inputs.first; sock; sock= sock->next) {
-			if (sock->link)
-				retval &= node_only_value(sock->link->fromnode);
-		}
-		return retval;
-	}
-	return 0;
-}
-
-/* not changing info, for thread callback */
-typedef struct ThreadData {
-	bNodeStack *stack;
-	RenderData *rd;
-} ThreadData;
-
-static void *exec_composite_node(void *nodeexec_v)
-{
-	bNodeStack *nsin[MAX_SOCKET];	/* arbitrary... watch this */
-	bNodeStack *nsout[MAX_SOCKET];	/* arbitrary... watch this */
-	bNodeExec *nodeexec= nodeexec_v;
-	bNode *node= nodeexec->node;
-	ThreadData *thd= (ThreadData *)node->threaddata;
-	
-	node_get_stack(node, thd->stack, nsin, nsout);
-	
-	if (node->typeinfo->execfunc)
-		node->typeinfo->execfunc(thd->rd, node, nsin, nsout);
-	else if (node->typeinfo->newexecfunc)
-		node->typeinfo->newexecfunc(thd->rd, 0, node, nodeexec->data, nsin, nsout);
-	
-	node->exec |= NODE_READY;
-	return NULL;
-}
-
-/* return total of executable nodes, for timecursor */
-static int setExecutableNodes(bNodeTreeExec *exec, ThreadData *thd)
-{
-	bNodeTree *ntree = exec->nodetree;
-	bNodeStack *nsin[MAX_SOCKET];	/* arbitrary... watch this */
-	bNodeStack *nsout[MAX_SOCKET];	/* arbitrary... watch this */
-	bNodeExec *nodeexec;
-	bNode *node;
-	bNodeSocket *sock;
-	int n, totnode= 0, group_edit= 0;
-	
-	/* if we are in group edit, viewer nodes get skipped when group has viewer */
-	for (node= ntree->nodes.first; node; node= node->next)
-		if (node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
-			if (ntreeHasType((bNodeTree *)node->id, CMP_NODE_VIEWER))
-				group_edit= 1;
-	
-	/* NB: using the exec data list here to have valid dependency sort */
-	for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
-		int a;
-		node = nodeexec->node;
-		
-		node_get_stack(node, exec->stack, nsin, nsout);
-		
-		/* test the outputs */
-		/* skip value-only nodes (should be in type!) */
-		if (!node_only_value(node)) {
-			for (a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
-				if (nsout[a]->data==NULL && nsout[a]->hasoutput) {
-					node->need_exec= 1;
-					break;
-				}
-			}
-		}
-		
-		/* test the inputs */
-		for (a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
-			/* skip viewer nodes in bg render or group edit */
-			if ( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) && (G.background || group_edit))
-				node->need_exec= 0;
-			/* is sock in use? */
-			else if (sock->link) {
-				bNodeLink *link= sock->link;
-				
-				/* this is the test for a cyclic case */
-				if (link->fromnode==NULL || link->tonode==NULL);
-				else if (link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) {
-					if (link->fromnode->need_exec) {
-						node->need_exec= 1;
-						break;
-					}
-				}
-				else {
-					node->need_exec= 0;
-					printf("Node %s skipped, cyclic dependency\n", node->name);
-				}
-			}
-		}
-		
-		if (node->need_exec) {
-			
-			/* free output buffers */
-			for (a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
-				if (nsout[a]->data) {
-					free_compbuf(nsout[a]->data);
-					nsout[a]->data= NULL;
-				}
-			}
-			totnode++;
-			/* printf("node needs exec %s\n", node->name); */
-			
-			/* tag for getExecutableNode() */
-			node->exec= 0;
-		}
-		else {
-			/* tag for getExecutableNode() */
-			node->exec= NODE_READY|NODE_FINISHED|NODE_SKIPPED;
-			
-		}
-	}
-	
-	/* last step: set the stack values for only-value nodes */
-	/* just does all now, compared to a full buffer exec this is nothing */
-	if (totnode) {
-		for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
-			node = nodeexec->node;
-			if (node->need_exec==0 && node_only_value(node)) {
-				if (node->typeinfo->execfunc) {
-					node_get_stack(node, exec->stack, nsin, nsout);
-					node->typeinfo->execfunc(thd->rd, node, nsin, nsout);
-				}
-			}
-		}
-	}
-	
-	return totnode;
-}
-
-/* while executing tree, free buffers from nodes that are not needed anymore */
-static void freeExecutableNode(bNodeTreeExec *exec)
-{
-	/* node outputs can be freed when:
-	 * - not a render result or image node
-	 * - when node outputs go to nodes all being set NODE_FINISHED
-	 */
-	bNodeTree *ntree = exec->nodetree;
-	bNodeExec *nodeexec;
-	bNode *node;
-	bNodeSocket *sock;
-	int n;
-	
-	/* set exec flag for finished nodes that might need freed */
-	for (node= ntree->nodes.first; node; node= node->next) {
-		if (node->type!=CMP_NODE_R_LAYERS)
-			if (node->exec & NODE_FINISHED)
-				node->exec |= NODE_FREEBUFS;
-	}
-	/* clear this flag for input links that are not done yet.
-	 * Using the exec data for valid dependency sort.
-	 */
-	for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
-		node = nodeexec->node;
-		if ((node->exec & NODE_FINISHED)==0) {
-			for (sock= node->inputs.first; sock; sock= sock->next)
-				if (sock->link)
-					sock->link->fromnode->exec &= ~NODE_FREEBUFS;
-		}
-	}
-	/* now we can free buffers */
-	for (node= ntree->nodes.first; node; node= node->next) {
-		if (node->exec & NODE_FREEBUFS) {
-			for (sock= node->outputs.first; sock; sock= sock->next) {
-				bNodeStack *ns= node_get_socket_stack(exec->stack, sock);
-				if (ns && ns->data) {
-					free_compbuf(ns->data);
-					ns->data= NULL;
-					// printf("freed buf node %s\n", node->name);
-				}
-			}
-		}
-	}
-}
-
-static bNodeExec *getExecutableNode(bNodeTreeExec *exec)
-{
-	bNodeExec *nodeexec;
-	bNodeSocket *sock;
-	int n;
-	
-	for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
-		if (nodeexec->node->exec==0) {
-			/* input sockets should be ready */
-			for (sock= nodeexec->node->inputs.first; sock; sock= sock->next) {
-				if (sock->link && sock->link->fromnode)
-					if ((sock->link->fromnode->exec & NODE_READY)==0)
-						break;
-			}
-			if (sock==NULL)
-				return nodeexec;
-		}
-	}
-	return NULL;
-}
-
-/* check if texture nodes need exec or end */
-static  void ntree_composite_texnode(bNodeTree *ntree, int init)
-{
-	bNode *node;
-	
-	for (node= ntree->nodes.first; node; node= node->next) {
-		if (node->type==CMP_NODE_TEXTURE && node->id) {
-			Tex *tex= (Tex *)node->id;
-			if (tex->nodetree && tex->use_nodes) {
-				/* has internal flag to detect it only does it once */
-				if (init) {
-					if (!tex->nodetree->execdata)
-						tex->nodetree->execdata = ntreeTexBeginExecTree(tex->nodetree, 1); 
-				}
-				else
-					ntreeTexEndExecTree(tex->nodetree->execdata, 1);
-					tex->nodetree->execdata = NULL;
-			}
-		}
-	}
-
-}
-
-/* optimized tree execute test for compositing */
-static void ntreeCompositExecTreeOld(bNodeTree *ntree, RenderData *rd, int do_preview)
-{
-	bNodeExec *nodeexec;
-	bNode *node;
-	ListBase threads;
-	ThreadData thdata;
-	int totnode, curnode, rendering = TRUE, n;
-	bNodeTreeExec *exec = ntree->execdata;
-
-	if (do_preview)
-		ntreeInitPreview(ntree, 0, 0);
-	
-	if (!ntree->execdata) {
-		/* XXX this is the top-level tree, so we use the ntree->execdata pointer. */
-		exec = ntreeCompositBeginExecTree(ntree, 1);
-	}
-	ntree_composite_texnode(ntree, 1);
-	
-	/* prevent unlucky accidents */
-	if (G.background)
-		rd->scemode &= ~R_COMP_CROP;
-	
-	/* setup callerdata for thread callback */
-	thdata.rd= rd;
-	thdata.stack= exec->stack;
-	
-	/* fixed seed, for example noise texture */
-	BLI_srandom(rd->cfra);
-
-	/* sets need_exec tags in nodes */
-	curnode = totnode= setExecutableNodes(exec, &thdata);
-
-	BLI_init_threads(&threads, exec_composite_node, rd->threads);
-	
-	while (rendering) {
-		
-		if (BLI_available_threads(&threads)) {
-			nodeexec= getExecutableNode(exec);
-			if (nodeexec) {
-				node = nodeexec->node;
-				if (ntree->progress && totnode)
-					ntree->progress(ntree->prh, (1.0f - curnode/(float)totnode));
-				if (ntree->stats_draw) {
-					char str[128];
-					BLI_snprintf(str, sizeof(str), "Compositing %d %s", curnode, node->name);
-					ntree->stats_draw(ntree->sdh, str);
-				}
-				curnode--;
-				
-				node->threaddata = &thdata;
-				node->exec= NODE_PROCESSING;
-				BLI_insert_thread(&threads, nodeexec);
-			}
-			else
-				PIL_sleep_ms(50);
-		}
-		else
-			PIL_sleep_ms(50);
-		
-		rendering= 0;
-		/* test for ESC */
-		if (ntree->test_break && ntree->test_break(ntree->tbh)) {
-			for (node= ntree->nodes.first; node; node= node->next)
-				node->exec |= NODE_READY;
-		}
-		
-		/* check for ready ones, and if we need to continue */
-		for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
-			node = nodeexec->node;
-			if (node->exec & NODE_READY) {
-				if ((node->exec & NODE_FINISHED)==0) {
-					BLI_remove_thread(&threads, nodeexec); /* this waits for running thread to finish btw */
-					node->exec |= NODE_FINISHED;
-					
-					/* freeing unused buffers */
-					if (rd->scemode & R_COMP_FREE)
-						freeExecutableNode(exec);
-				}
-			}
-			else rendering= 1;
-		}
-	}
-	
-	BLI_end_threads(&threads);
-	
-	/* XXX top-level tree uses the ntree->execdata pointer */
-	ntreeCompositEndExecTree(exec, 1);
-}
-#endif  /* WITH_COMPOSITOR_LEGACY */
-#endif  /* WITH_COMPOSITOR */
-
 void *COM_linker_hack = NULL;
 
 void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int rendering, int do_preview,
@@ -699,16 +274,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int rendering, int
                            const ColorManagedDisplaySettings *display_settings)
 {
 #ifdef WITH_COMPOSITOR
-#ifdef WITH_COMPOSITOR_LEGACY
-	if (G.debug_value == 200)
-	{
-		ntreeCompositExecTreeOld(ntree, rd, do_preview);
-	}
-	else
-#endif
-	{
-		COM_execute(rd, ntree, rendering, view_settings, display_settings);
-	}
+	COM_execute(rd, ntree, rendering, view_settings, display_settings);
 #else
 	(void)ntree, (void)rd, (void)rendering, (void)do_preview;
 	(void)view_settings, (void)display_settings;
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c
deleted file mode 100644
index c4b48b8..0000000
--- a/source/blender/nodes/composite/node_composite_util.c
+++ /dev/null
@@ -1,1412 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2006 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/nodes/composite/node_composite_util.c
- *  \ingroup nodes
- */
-
-#include "node_composite_util.h"
-
-#ifdef WITH_COMPOSITOR_LEGACY
-
-#include <limits.h>
-
-CompBuf *alloc_compbuf(int sizex, int sizey, int type, int alloc)
-{
-	CompBuf *cbuf= MEM_callocN(sizeof(CompBuf), "compbuf");
-	
-	cbuf->x= sizex;
-	cbuf->y= sizey;
-	cbuf->xrad= sizex/2;
-	cbuf->yrad= sizey/2;
-	
-	cbuf->type= type;
-	if (alloc) {
-		if (cbuf->type==CB_RGBA)
-			cbuf->rect= MEM_mapallocN(4*sizeof(float)*sizex*sizey, "compbuf RGBA rect");
-		else if (cbuf->type==CB_VEC3)
-			cbuf->rect= MEM_mapallocN(3*sizeof(float)*sizex*sizey, "compbuf Vector3 rect");
-		else if (cbuf->type==CB_VEC2)
-			cbuf->rect= MEM_mapallocN(2*sizeof(float)*sizex*sizey, "compbuf Vector2 rect");
-		else
-			cbuf->rect= MEM_mapallocN(sizeof(float)*sizex*sizey, "compbuf Fac rect");
-		cbuf->malloc= 1;
-	}
-	cbuf->disprect.xmin = 0;
-	cbuf->disprect.ymin = 0;
-	cbuf->disprect.xmax = sizex;
-	cbuf->disprect.ymax = sizey;
-	
-	return cbuf;
-}
-
-CompBuf *dupalloc_compbuf(CompBuf *cbuf)
-{
-	CompBuf *dupbuf= alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1);
-	if (dupbuf) {
-		memcpy(dupbuf->rect, cbuf->rect, cbuf->type*sizeof(float)*cbuf->x*cbuf->y);
-	
-		dupbuf->xof= cbuf->xof;
-		dupbuf->yof= cbuf->yof;
-	}
-	return dupbuf;
-}
-
-/* instead of reference counting, we create a list */
-CompBuf *pass_on_compbuf(CompBuf *cbuf)
-{
-	CompBuf *dupbuf= (cbuf)? alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 0): NULL;
-	CompBuf *lastbuf;
-	
-	if (dupbuf) {
-		dupbuf->rect= cbuf->rect;
-		dupbuf->xof= cbuf->xof;
-		dupbuf->yof= cbuf->yof;
-		dupbuf->malloc= 0;
-		
-		/* get last buffer in list, and append dupbuf */
-		for (lastbuf= cbuf; lastbuf; lastbuf= lastbuf->next)
-			if (lastbuf->next==NULL)
-				break;
-		lastbuf->next= dupbuf;
-		dupbuf->prev= lastbuf;
-	}
-	return dupbuf;
-}
-
-
-void free_compbuf(CompBuf *cbuf)
-{
-	/* check referencing, then remove from list and set malloc tag */
-	if (cbuf->prev || cbuf->next) {
-		if (cbuf->prev)
-			cbuf->prev->next= cbuf->next;
-		if (cbuf->next)
-			cbuf->next->prev= cbuf->prev;
-		if (cbuf->malloc) {
-			if (cbuf->prev)
-				cbuf->prev->malloc= 1;
-			else
-				cbuf->next->malloc= 1;
-			cbuf->malloc= 0;
-		}
-	}
-	
-	if (cbuf->malloc && cbuf->rect)
-		MEM_freeN(cbuf->rect);
-
-	MEM_freeN(cbuf);
-}
-
-void print_compbuf(char *str, CompBuf *cbuf)
-{
-	printf("Compbuf %s %d %d %p\n", str, cbuf->x, cbuf->y, (void *)cbuf->rect);
-	
-}
-
-void compbuf_set_node(CompBuf *cbuf, bNode *node)
-{
-	if (cbuf) cbuf->node = node;
-}
-
-
-CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, int type)
-{
-	CompBuf *cbuf;
-	rcti disprect= *drect;
-	float *outfp;
-	int dx, y;
-	
-	if (disprect.xmax>rectx) disprect.xmax = rectx;
-	if (disprect.ymax>recty) disprect.ymax = recty;
-	if (disprect.xmin>= disprect.xmax) return NULL;
-	if (disprect.ymin>= disprect.ymax) return NULL;
-	
-	cbuf= alloc_compbuf(BLI_rcti_size_x(&disprect), BLI_rcti_size_y(&disprect), type, 1);
-	outfp= cbuf->rect;
-	rectf += type*(disprect.ymin*rectx + disprect.xmin);
-	dx= type*cbuf->x;
-	for (y=cbuf->y; y>0; y--, outfp+=dx, rectf+=type*rectx)
-		memcpy(outfp, rectf, sizeof(float)*dx);
-	
-	return cbuf;
-}
-
-CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy)
-{
-	CompBuf *outbuf; 
-	float *rectf, *newrectf, *rf;
-	int x, y, c, pixsize= inbuf->type;
-	int ofsx, ofsy, stepx, stepy;
-	
-	if (inbuf->x==newx && inbuf->y==newy)
-		return dupalloc_compbuf(inbuf);
-	
-	outbuf= alloc_compbuf(newx, newy, inbuf->type, 1);
-	newrectf= outbuf->rect;
-	
-	stepx = (65536.0 * (inbuf->x - 1.0) / (newx - 1.0)) + 0.5;
-	stepy = (65536.0 * (inbuf->y - 1.0) / (newy - 1.0)) + 0.5;
-	ofsy = 32768;
-	
-	for (y = newy; y > 0 ; y--) {
-		rectf = inbuf->rect;
-		rectf += pixsize * (ofsy >> 16) * inbuf->x;
-
-		ofsy += stepy;
-		ofsx = 32768;
-		
-		for (x = newx ; x>0 ; x--) {
-			
-			rf= rectf + pixsize*(ofsx >> 16);
-			for (c=0; c<pixsize; c++)
-				newrectf[c] = rf[c];
-			
-			newrectf+= pixsize;
-			
-			ofsx += stepx;
-		}
-	}
-	
-	return outbuf;
-}
-
-void typecheck_compbuf_color(float *out, float *in, int outtype, int intype)
-{
-	if (intype == outtype) {
-		memcpy(out, in, sizeof(float)*outtype);
-	}
-	else if (outtype==CB_VAL) {
-		if (intype==CB_VEC2) {
-			*out= 0.5f*(in[0]+in[1]);
-		}
-		else if (intype==CB_VEC3) {
-			*out= 0.333333f*(in[0]+in[1]+in[2]);
-		}
-		else if (intype==CB_RGBA) {
-			*out = rgb_to_bw(in);
-		}
-	}
-	else if (outtype==CB_VEC2) {
-		if (intype==CB_VAL) {
-			out[0] = in[0];
-			out[1] = in[0];
-		}
-		else if (intype==CB_VEC3) {
-			out[0] = in[0];
-			out[1] = in[1];
-		}
-		else if (intype==CB_RGBA) {
-			out[0] = in[0];
-			out[1] = in[1];
-		}
-	}
-	else if (outtype==CB_VEC3) {
-		if (intype==CB_VAL) {
-			out[0] = in[0];
-			out[1] = in[0];
-			out[2] = in[0];
-		}
-		else if (intype==CB_VEC2) {
-			out[0] = in[0];
-			out[1] = in[1];
-			out[2] = 0.0f;
-		}
-		else if (intype==CB_RGBA) {
-			out[0] = in[0];
-			out[1] = in[1];
-			out[2] = in[2];
-		}
-	}
-	else if (outtype==CB_RGBA) {
-		if (intype==CB_VAL) {
-			out[0] = in[0];
-			out[1] = in[0];
-			out[2] = in[0];
-			out[3] = 1.0f;
-		}
-		else if (intype==CB_VEC2) {
-			out[0] = in[0];
-			out[1] = in[1];
-			out[2] = 0.0f;
-			out[3] = 1.0f;
-		}
-		else if (intype==CB_VEC3) {
-			out[0] = in[0];
-			out[1] = in[1];
-			out[2] = in[2];
-			out[3] = 1.0f;
-		}
-	}
-}
-
-CompBuf *typecheck_compbuf(CompBuf *inbuf, int type)
-{
-	if (inbuf && inbuf->type!=type) {
-		CompBuf *outbuf;
-		float *inrf, *outrf;
-		int x;
-
-		outbuf= alloc_compbuf(inbuf->x, inbuf->y, type, 1); 
-
-		/* warning note: xof and yof are applied in pixelprocessor, but should be copied otherwise? */
-		outbuf->xof= inbuf->xof;
-		outbuf->yof= inbuf->yof;
-
-		if (inbuf->rect_procedural) {
-			outbuf->rect_procedural= inbuf->rect_procedural;
-			copy_v3_v3(outbuf->procedural_size, inbuf->procedural_size);
-			copy_v3_v3(outbuf->procedural_offset, inbuf->procedural_offset);
-			outbuf->procedural_type= inbuf->procedural_type;
-			outbuf->node= inbuf->node;
-			return outbuf;
-		}
-
-		inrf= inbuf->rect;
-		outrf= outbuf->rect;
-		x= inbuf->x*inbuf->y;
-		
-		if (type==CB_VAL) {
-			if (inbuf->type==CB_VEC2) {
-				for (; x>0; x--, outrf+= 1, inrf+= 2)
-					*outrf= 0.5f*(inrf[0]+inrf[1]);
-			}
-			else if (inbuf->type==CB_VEC3) {
-				for (; x>0; x--, outrf+= 1, inrf+= 3)
-					*outrf= 0.333333f*(inrf[0]+inrf[1]+inrf[2]);
-			}
-			else if (inbuf->type==CB_RGBA) {
-				for (; x>0; x--, outrf+= 1, inrf+= 4)
-					*outrf = rgb_to_bw(inrf);
-			}
-		}
-		else if (type==CB_VEC2) {
-			if (inbuf->type==CB_VAL) {
-				for (; x>0; x--, outrf+= 2, inrf+= 1) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[0];
-				}
-			}
-			else if (inbuf->type==CB_VEC3) {
-				for (; x>0; x--, outrf+= 2, inrf+= 3) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[1];
-				}
-			}
-			else if (inbuf->type==CB_RGBA) {
-				for (; x>0; x--, outrf+= 2, inrf+= 4) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[1];
-				}
-			}
-		}
-		else if (type==CB_VEC3) {
-			if (inbuf->type==CB_VAL) {
-				for (; x>0; x--, outrf+= 3, inrf+= 1) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[0];
-					outrf[2] = inrf[0];
-				}
-			}
-			else if (inbuf->type==CB_VEC2) {
-				for (; x>0; x--, outrf+= 3, inrf+= 2) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[1];
-					outrf[2] = 0.0f;
-				}
-			}
-			else if (inbuf->type==CB_RGBA) {
-				for (; x>0; x--, outrf+= 3, inrf+= 4) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[1];
-					outrf[2] = inrf[2];
-				}
-			}
-		}
-		else if (type==CB_RGBA) {
-			if (inbuf->type==CB_VAL) {
-				for (; x>0; x--, outrf+= 4, inrf+= 1) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[0];
-					outrf[2] = inrf[0];
-					outrf[3] = 1.0f;
-				}
-			}
-			else if (inbuf->type==CB_VEC2) {
-				for (; x>0; x--, outrf+= 4, inrf+= 2) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[1];
-					outrf[2] = 0.0f;
-					outrf[3] = 1.0f;
-				}
-			}
-			else if (inbuf->type==CB_VEC3) {
-				for (; x>0; x--, outrf+= 4, inrf+= 3) {
-					outrf[0] = inrf[0];
-					outrf[1] = inrf[1];
-					outrf[2] = inrf[2];
-					outrf[3] = 1.0f;
-				}
-			}
-		}
-		
-		return outbuf;
-	}
-	return inbuf;
-}
-
-float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y, int xrad, int yrad)
-{
-	if (cbuf) {
-		if (cbuf->rect_procedural) {
-			cbuf->rect_procedural(cbuf, use, (float)x/(float)xrad, (float)y/(float)yrad);
-			return use;
-		}
-		else {
-			static float col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-			
-			/* map coords */
-			x-= cbuf->xof;
-			y-= cbuf->yof;
-			
-			if (y<-cbuf->yrad || y>= -cbuf->yrad+cbuf->y) return col;
-			if (x<-cbuf->xrad || x>= -cbuf->xrad+cbuf->x) return col;
-			
-			return cbuf->rect + cbuf->type*( (cbuf->yrad+y)*cbuf->x + (cbuf->xrad+x) );
-		}
-	}
-	else return defcol;
-}
-
-/* **************************************************** */
-
-static CompBuf *composit_check_compbuf(CompBuf *cbuf, int type, CompBuf *outbuf)
-{
-	/* check type */
-	CompBuf *dbuf= typecheck_compbuf(cbuf, type);
-
-	/* if same as output and translated, duplicate so pixels don't interfere */
-	if (dbuf == outbuf && !dbuf->rect_procedural && (dbuf->xof || dbuf->yof))
-		dbuf= dupalloc_compbuf(dbuf);
-	
-	return dbuf;
-}
-
-/* Pixel-to-Pixel operation, 1 Image in, 1 out */
-void composit1_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col,
-									  void (*func)(bNode *, float *, float *), 
-									  int src_type)
-{
-	CompBuf *src_use;
-	float *outfp=out->rect, *srcfp;
-	float color[4];	/* local color if compbuf is procedural */
-	int xrad, yrad, x, y;
-	
-	src_use= composit_check_compbuf(src_buf, src_type, out);
-	
-	xrad= out->xrad;
-	yrad= out->yrad;
-	
-	for (y= -yrad; y<-yrad+out->y; y++) {
-		for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
-			srcfp= compbuf_get_pixel(src_use, src_col, color, x, y, xrad, yrad);
-			func(node, outfp, srcfp);
-		}
-	}
-	
-	if (src_use!=src_buf)
-		free_compbuf(src_use);
-}
-
-/* Pixel-to-Pixel operation, 2 Images in, 1 out */
-void composit2_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col,
-									  CompBuf *fac_buf, float *fac, void (*func)(bNode *, float *, float *, float *), 
-									  int src_type, int fac_type)
-{
-	CompBuf *src_use, *fac_use;
-	float *outfp=out->rect, *srcfp, *facfp;
-	float color[4];	/* local color if compbuf is procedural */
-	int xrad, yrad, x, y;
-	
-	src_use= composit_check_compbuf(src_buf, src_type, out);
-	fac_use= composit_check_compbuf(fac_buf, fac_type, out);
-
-	xrad= out->xrad;
-	yrad= out->yrad;
-	
-	for (y= -yrad; y<-yrad+out->y; y++) {
-		for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
-			srcfp= compbuf_get_pixel(src_use, src_col, color, x, y, xrad, yrad);
-			facfp= compbuf_get_pixel(fac_use, fac, color, x, y, xrad, yrad);
-			
-			func(node, outfp, srcfp, facfp);
-		}
-	}
-	if (src_use!=src_buf)
-		free_compbuf(src_use);
-	if (fac_use!=fac_buf)
-		free_compbuf(fac_use);
-}
-
-/* Pixel-to-Pixel operation, 3 Images in, 1 out */
-void composit3_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, float *src1_col, CompBuf *src2_buf, float *src2_col, 
-									  CompBuf *fac_buf, float *fac, void (*func)(bNode *, float *, float *, float *, float *), 
-									  int src1_type, int src2_type, int fac_type)
-{
-	CompBuf *src1_use, *src2_use, *fac_use;
-	float *outfp=out->rect, *src1fp, *src2fp, *facfp;
-	float color[4];	/* local color if compbuf is procedural */
-	int xrad, yrad, x, y;
-	
-	src1_use= composit_check_compbuf(src1_buf, src1_type, out);
-	src2_use= composit_check_compbuf(src2_buf, src2_type, out);
-	fac_use= composit_check_compbuf(fac_buf, fac_type, out);
-	
-	xrad= out->xrad;
-	yrad= out->yrad;
-	
-	for (y= -yrad; y<-yrad+out->y; y++) {
-		for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
-			src1fp= compbuf_get_pixel(src1_use, src1_col, color, x, y, xrad, yrad);
-			src2fp= compbuf_get_pixel(src2_use, src2_col, color, x, y, xrad, yrad);
-			facfp= compbuf_get_pixel(fac_use, fac, color, x, y, xrad, yrad);
-			
-			func(node, outfp, src1fp, src2fp, facfp);
-		}
-	}
-	
-	if (src1_use!=src1_buf)
-		free_compbuf(src1_use);
-	if (src2_use!=src2_buf)
-		free_compbuf(src2_use);
-	if (fac_use!=fac_buf)
-		free_compbuf(fac_use);
-}
-
-/* Pixel-to-Pixel operation, 4 Images in, 1 out */
-void composit4_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, float *src1_col, CompBuf *fac1_buf, float *fac1, 
-									  CompBuf *src2_buf, float *src2_col, CompBuf *fac2_buf, float *fac2, 
-									  void (*func)(bNode *, float *, float *, float *, float *, float *), 
-									  int src1_type, int fac1_type, int src2_type, int fac2_type)
-{
-	CompBuf *src1_use, *src2_use, *fac1_use, *fac2_use;
-	float *outfp=out->rect, *src1fp, *src2fp, *fac1fp, *fac2fp;
-	float color[4];	/* local color if compbuf is procedural */
-	int xrad, yrad, x, y;
-	
-	src1_use= composit_check_compbuf(src1_buf, src1_type, out);
-	src2_use= composit_check_compbuf(src2_buf, src2_type, out);
-	fac1_use= composit_check_compbuf(fac1_buf, fac1_type, out);
-	fac2_use= composit_check_compbuf(fac2_buf, fac2_type, out);
-	
-	xrad= out->xrad;
-	yrad= out->yrad;
-	
-	for (y= -yrad; y<-yrad+out->y; y++) {
-		for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
-			src1fp= compbuf_get_pixel(src1_use, src1_col, color, x, y, xrad, yrad);
-			src2fp= compbuf_get_pixel(src2_use, src2_col, color, x, y, xrad, yrad);
-			fac1fp= compbuf_get_pixel(fac1_use, fac1, color, x, y, xrad, yrad);
-			fac2fp= compbuf_get_pixel(fac2_use, fac2, color, x, y, xrad, yrad);
-			
-			func(node, outfp, src1fp, fac1fp, src2fp, fac2fp);
-		}
-	}
-	
-	if (src1_use!=src1_buf)
-		free_compbuf(src1_use);
-	if (src2_use!=src2_buf)
-		free_compbuf(src2_use);
-	if (fac1_use!=fac1_buf)
-		free_compbuf(fac1_use);
-	if (fac2_use!=fac2_buf)
-		free_compbuf(fac2_use);
-}
-
-
-CompBuf *valbuf_from_rgbabuf(CompBuf *cbuf, int channel)
-{
-	CompBuf *valbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
-	float *valf, *rectf;
-	int tot;
-	
-	/* warning note: xof and yof are applied in pixelprocessor, but should be copied otherwise? */
-	valbuf->xof= cbuf->xof;
-	valbuf->yof= cbuf->yof;
-	
-	valf= valbuf->rect;
-
-	/* defaults to returning alpha channel */
-	if ((channel < CHAN_R) || (channel > CHAN_A)) channel = CHAN_A;
-
-	rectf= cbuf->rect + channel;
-	
-	for (tot= cbuf->x*cbuf->y; tot>0; tot--, valf++, rectf+=4)
-		*valf= *rectf;
-	
-	return valbuf;
-}
-
-void valbuf_to_rgbabuf(CompBuf *valbuf, CompBuf *cbuf, int channel)
-{
-	float *valf, *rectf;
-	int tot;
-
-	valf= valbuf->rect;
-
-	/* defaults to returning alpha channel */
-	if ((channel < CHAN_R) || (channel > CHAN_A)) channel = CHAN_A;
-
-	rectf = cbuf->rect + channel;
-
-	for (tot= cbuf->x*cbuf->y; tot>0; tot--, valf++, rectf+=4)
-		*rectf = *valf;
-}
-
-static CompBuf *generate_procedural_preview(CompBuf *cbuf, int newx, int newy)
-{
-	CompBuf *outbuf;
-	float *outfp;
-	int xrad, yrad, x, y;
-	
-	outbuf= alloc_compbuf(newx, newy, CB_RGBA, 1);
-
-	outfp= outbuf->rect;
-	xrad= outbuf->xrad;
-	yrad= outbuf->yrad;
-	
-	for (y= -yrad; y<-yrad+outbuf->y; y++)
-		for (x= -xrad; x<-xrad+outbuf->x; x++, outfp+=outbuf->type)
-			cbuf->rect_procedural(cbuf, outfp, (float)x/(float)xrad, (float)y/(float)yrad);
-
-	return outbuf;
-}
-
-/* OCIO_TODO: this function is only used by legacy compositor system only, which would likely be removed soon,
- *            keep check for old color management flag for now
- */
-void generate_preview(void *data, bNode *node, CompBuf *stackbuf)
-{
-	RenderData *rd= data;
-	bNodePreview *preview= node->preview;
-	int xsize, ysize;
-	int profile_from= (rd->color_mgt_flag & R_COLOR_MANAGEMENT)? IB_PROFILE_LINEAR_RGB: IB_PROFILE_SRGB;
-	int predivide= TRUE;
-	int dither= 0;
-	unsigned char *rect;
-	
-	if (preview && stackbuf) {
-		CompBuf *cbuf, *stackbuf_use;
-		
-		if (stackbuf->rect==NULL && stackbuf->rect_procedural==NULL) return;
-		
-		stackbuf_use= typecheck_compbuf(stackbuf, CB_RGBA);
-
-		if (stackbuf->x > stackbuf->y) {
-			xsize= 140;
-			ysize= (140*stackbuf->y)/stackbuf->x;
-		}
-		else {
-			ysize= 140;
-			xsize= (140*stackbuf->x)/stackbuf->y;
-		}
-		
-		if (stackbuf_use->rect_procedural)
-			cbuf= generate_procedural_preview(stackbuf_use, xsize, ysize);
-		else
-			cbuf= scalefast_compbuf(stackbuf_use, xsize, ysize);
-
-		/* convert to byte for preview */
-		rect= MEM_callocN(sizeof(unsigned char)*4*xsize*ysize, "bNodePreview.rect");
-
-		IMB_buffer_byte_from_float(rect, cbuf->rect,
-			4, dither, IB_PROFILE_SRGB, profile_from, predivide, 
-			xsize, ysize, xsize, xsize);
-		
-		free_compbuf(cbuf);
-		if (stackbuf_use!=stackbuf)
-			free_compbuf(stackbuf_use);
-
-		// BLI_lock_thread(LOCK_PREVIEW);
-
-		if (preview->rect)
-			MEM_freeN(preview->rect);
-		preview->xsize= xsize;
-		preview->ysize= ysize;
-		preview->rect= rect;
-
-		// BLI_unlock_thread(LOCK_PREVIEW);
-	}
-}
-
-void do_rgba_to_yuva(bNode *UNUSED(node), float *out, float *in)
-{
-	rgb_to_yuv(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
-	out[3]=in[3];
-}
-
-void do_rgba_to_hsva(bNode *UNUSED(node), float *out, float *in)
-{
-	rgb_to_hsv(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
-	out[3]=in[3];
-}
-
-void do_rgba_to_ycca(bNode *UNUSED(node), float *out, float *in)
-{
-	rgb_to_ycc(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
-	out[3]=in[3];
-}
-
-void do_yuva_to_rgba(bNode *UNUSED(node), float *out, float *in)
-{
-	yuv_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
-	out[3]=in[3];
-}
-
-void do_hsva_to_rgba(bNode *UNUSED(node), float *out, float *in)
-{
-	hsv_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
-	out[3]=in[3];
-}
-
-void do_ycca_to_rgba(bNode *UNUSED(node), float *out, float *in)
-{
-	ycc_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
-	out[3]=in[3];
-}
-
-void do_copy_rgba(bNode *UNUSED(node), float *out, float *in)
-{
-	copy_v4_v4(out, in);
-}
-
-void do_copy_rgb(bNode *UNUSED(node), float *out, float *in)
-{
-	copy_v3_v3(out, in);
-	out[3] = 1.0f;
-}
-
-void do_copy_value(bNode *UNUSED(node), float *out, float *in)
-{
-	out[0] = in[0];
-}
-
-void do_copy_a_rgba(bNode *UNUSED(node), float *out, float *in, float *fac)
-{
-	copy_v3_v3(out, in);
-	out[3] = *fac;
-}
-
-/* only accepts RGBA buffers */
-void gamma_correct_compbuf(CompBuf *img, int inversed)
-{
-	float *drect;
-	int x;
-
-	if (img->type!=CB_RGBA) return;
-
-	drect= img->rect;
-	if (inversed) {
-		for (x=img->x*img->y; x>0; x--, drect+=4) {
-			if (drect[0]>0.0f) drect[0] = sqrt(drect[0]); else drect[0] = 0.0f;
-			if (drect[1]>0.0f) drect[1] = sqrt(drect[1]); else drect[1] = 0.0f;
-			if (drect[2]>0.0f) drect[2] = sqrt(drect[2]); else drect[2] = 0.0f;
-		}
-	}
-	else {
-		for (x=img->x*img->y; x>0; x--, drect+=4) {
-			if (drect[0]>0.0f) drect[0]*= drect[0]; else drect[0] = 0.0f;
-			if (drect[1]>0.0f) drect[1]*= drect[1]; else drect[1] = 0.0f;
-			if (drect[2]>0.0f) drect[2]*= drect[2]; else drect[2] = 0.0f;
-		}
-	}
-}
-
-void premul_compbuf(CompBuf *img, int inversed)
-{
-	float *drect;
-	int x;
-
-	if (img->type!=CB_RGBA) return;
-
-	drect= img->rect;
-	if (inversed) {
-		for (x=img->x*img->y; x>0; x--, drect+=4) {
-			if (fabsf(drect[3]) < 1e-5f) {
-				drect[0] = 0.0f;
-				drect[1] = 0.0f;
-				drect[2] = 0.0f;
-			}
-			else {
-				drect[0] /= drect[3];
-				drect[1] /= drect[3];
-				drect[2] /= drect[3];
-			}
-		}
-	}
-	else {
-		for (x=img->x*img->y; x>0; x--, drect+=4) {
-			drect[0] *= drect[3];
-			drect[1] *= drect[3];
-			drect[2] *= drect[3];
-		}
-	}
-}
-
-
-
-/*
- *  2D Fast Hartley Transform, used for convolution
- */
-
-typedef float fREAL;
-
-// returns next highest power of 2 of x, as well it's log2 in L2
-static unsigned int nextPow2(unsigned int x, unsigned int* L2)
-{
-	unsigned int pw, x_notpow2 = x & (x-1);
-	*L2 = 0;
-	while (x>>=1) ++(*L2);
-	pw = 1 << (*L2);
-	if (x_notpow2) { (*L2)++;  pw<<=1; }
-	return pw;
-}
-
-//------------------------------------------------------------------------------
-
-// from FXT library by Joerg Arndt, faster in order bitreversal
-// use: r = revbin_upd(r, h) where h = N>>1
-static unsigned int revbin_upd(unsigned int r, unsigned int h)
-{
-	while (!((r^=h)&h)) h >>= 1;
-	return r;
-}
-//------------------------------------------------------------------------------
-static void FHT(fREAL* data, unsigned int M, unsigned int inverse)
-{
-	double tt, fc, dc, fs, ds, a = M_PI;
-	fREAL t1, t2;
-	int n2, bd, bl, istep, k, len = 1 << M, n = 1;
-
-	int i, j = 0;
-	unsigned int Nh = len >> 1;
-	for (i=1;i<(len-1);++i) {
-		j = revbin_upd(j, Nh);
-		if (j>i) {
-			t1 = data[i];
-			data[i] = data[j];
-			data[j] = t1;
-		}
-	}
-
-	do {
-		fREAL* data_n = &data[n];
-
-		istep = n << 1;
-		for (k=0; k<len; k+=istep) {
-			t1 = data_n[k];
-			data_n[k] = data[k] - t1;
-			data[k] += t1;
-		}
-
-		n2 = n >> 1;
-		if (n>2) {
-			fc = dc = cos(a);
-			fs = ds = sqrt(1.0 - fc*fc); //sin(a);
-			bd = n-2;
-			for (bl=1; bl<n2; bl++) {
-				fREAL* data_nbd = &data_n[bd];
-				fREAL* data_bd = &data[bd];
-				for (k=bl; k<len; k+=istep) {
-					t1 = fc*data_n[k] + fs*data_nbd[k];
-					t2 = fs*data_n[k] - fc*data_nbd[k];
-					data_n[k] = data[k] - t1;
-					data_nbd[k] = data_bd[k] - t2;
-					data[k] += t1;
-					data_bd[k] += t2;
-				}
-				tt = fc*dc - fs*ds;
-				fs = fs*dc + fc*ds;
-				fc = tt;
-				bd -= 2;
-			}
-		}
-
-		if (n>1) {
-			for (k=n2; k<len; k+=istep) {
-				t1 = data_n[k];
-				data_n[k] = data[k] - t1;
-				data[k] += t1;
-			}
-		}
-
-		n = istep;
-		a *= 0.5;
-	} while (n<len);
-
-	if (inverse) {
-		fREAL sc = (fREAL)1 / (fREAL)len;
-		for (k=0; k<len; ++k)
-			data[k] *= sc;
-	}
-}
-//------------------------------------------------------------------------------
-/* 2D Fast Hartley Transform, Mx/My -> log2 of width/height,
- * nzp -> the row where zero pad data starts,
- * inverse -> see above */
-static void FHT2D(fREAL *data, unsigned int Mx, unsigned int My,
-		unsigned int nzp, unsigned int inverse)
-{
-	unsigned int i, j, Nx, Ny, maxy;
-	fREAL t;
-
-	Nx = 1 << Mx;
-	Ny = 1 << My;
-
-	// rows (forward transform skips 0 pad data)
-	maxy = inverse ? Ny : nzp;
-	for (j=0; j<maxy; ++j)
-		FHT(&data[Nx*j], Mx, inverse);
-
-	// transpose data
-	if (Nx==Ny) {  // square
-		for (j=0; j<Ny; ++j)
-			for (i=j+1; i<Nx; ++i) {
-				unsigned int op = i + (j << Mx), np = j + (i << My);
-				t=data[op], data[op]=data[np], data[np]=t;
-			}
-	}
-	else {  // rectangular
-		unsigned int k, Nym = Ny-1, stm = 1 << (Mx + My);
-		for (i=0; stm>0; i++) {
-			#define PRED(k) (((k & Nym) << Mx) + (k >> My))
-			for (j=PRED(i); j>i; j=PRED(j));
-			if (j < i) continue;
-			for (k=i, j=PRED(i); j!=i; k=j, j=PRED(j), stm--) {
-				t=data[j], data[j]=data[k], data[k]=t;
-			}
-			#undef PRED
-			stm--;
-		}
-	}
-	// swap Mx/My & Nx/Ny
-	i = Nx, Nx = Ny, Ny = i;
-	i = Mx, Mx = My, My = i;
-
-	// now columns == transposed rows
-	for (j=0; j<Ny; ++j)
-		FHT(&data[Nx*j], Mx, inverse);
-
-	// finalize
-	for (j=0; j<=(Ny >> 1); j++) {
-		unsigned int jm = (Ny - j) & (Ny-1);
-		unsigned int ji = j << Mx;
-		unsigned int jmi = jm << Mx;
-		for (i=0; i<=(Nx >> 1); i++) {
-			unsigned int im = (Nx - i) & (Nx-1);
-			fREAL A = data[ji + i];
-			fREAL B = data[jmi + i];
-			fREAL C = data[ji + im];
-			fREAL D = data[jmi + im];
-			fREAL E = (fREAL)0.5*((A + D) - (B + C));
-			data[ji + i] = A - E;
-			data[jmi + i] = B + E;
-			data[ji + im] = C + E;
-			data[jmi + im] = D - E;
-		}
-	}
-
-}
-
-//------------------------------------------------------------------------------
-
-/* 2D convolution calc, d1 *= d2, M/N - > log2 of width/height */
-static void fht_convolve(fREAL* d1, fREAL* d2, unsigned int M, unsigned int N)
-{
-	fREAL a, b;
-	unsigned int i, j, k, L, mj, mL;
-	unsigned int m = 1 << M, n = 1 << N;
-	unsigned int m2 = 1 << (M-1), n2 = 1 << (N-1);
-	unsigned int mn2 = m << (N-1);
-
-	d1[0] *= d2[0];
-	d1[mn2] *= d2[mn2];
-	d1[m2] *= d2[m2];
-	d1[m2 + mn2] *= d2[m2 + mn2];
-	for (i=1; i<m2; i++) {
-		k = m - i;
-		a = d1[i]*d2[i] - d1[k]*d2[k];
-		b = d1[k]*d2[i] + d1[i]*d2[k];
-		d1[i] = (b + a)*(fREAL)0.5;
-		d1[k] = (b - a)*(fREAL)0.5;
-		a = d1[i + mn2]*d2[i + mn2] - d1[k + mn2]*d2[k + mn2];
-		b = d1[k + mn2]*d2[i + mn2] + d1[i + mn2]*d2[k + mn2];
-		d1[i + mn2] = (b + a)*(fREAL)0.5;
-		d1[k + mn2] = (b - a)*(fREAL)0.5;
-	}
-	for (j=1; j<n2; j++) {
-		L = n - j;
-		mj = j << M;
-		mL = L << M;
-		a = d1[mj]*d2[mj] - d1[mL]*d2[mL];
-		b = d1[mL]*d2[mj] + d1[mj]*d2[mL];
-		d1[mj] = (b + a)*(fREAL)0.5;
-		d1[mL] = (b - a)*(fREAL)0.5;
-		a = d1[m2 + mj]*d2[m2 + mj] - d1[m2 + mL]*d2[m2 + mL];
-		b = d1[m2 + mL]*d2[m2 + mj] + d1[m2 + mj]*d2[m2 + mL];
-		d1[m2 + mj] = (b + a)*(fREAL)0.5;
-		d1[m2 + mL] = (b - a)*(fREAL)0.5;
-	}
-	for (i=1; i<m2; i++) {
-		k = m - i;
-		for (j=1; j<n2; j++) {
-			L = n - j;
-			mj = j << M;
-			mL = L << M;
-			a = d1[i + mj]*d2[i + mj] - d1[k + mL]*d2[k + mL];
-			b = d1[k + mL]*d2[i + mj] + d1[i + mj]*d2[k + mL];
-			d1[i + mj] = (b + a)*(fREAL)0.5;
-			d1[k + mL] = (b - a)*(fREAL)0.5;
-			a = d1[i + mL]*d2[i + mL] - d1[k + mj]*d2[k + mj];
-			b = d1[k + mj]*d2[i + mL] + d1[i + mL]*d2[k + mj];
-			d1[i + mL] = (b + a)*(fREAL)0.5;
-			d1[k + mj] = (b - a)*(fREAL)0.5;
-		}
-	}
-}
-
-//------------------------------------------------------------------------------
-
-void convolve(CompBuf* dst, CompBuf* in1, CompBuf* in2)
-{
-	fREAL *data1, *data2, *fp;
-	unsigned int w2, h2, hw, hh, log2_w, log2_h;
-	fRGB wt, *colp;
-	int x, y, ch;
-	int xbl, ybl, nxb, nyb, xbsz, ybsz;
-	int in2done = FALSE;
-
-	CompBuf* rdst = alloc_compbuf(in1->x, in1->y, in1->type, 1);
-
-	// convolution result width & height
-	w2 = 2*in2->x - 1;
-	h2 = 2*in2->y - 1;
-	// FFT pow2 required size & log2
-	w2 = nextPow2(w2, &log2_w);
-	h2 = nextPow2(h2, &log2_h);
-
-	// alloc space
-	data1 = (fREAL*)MEM_callocN(3*w2*h2*sizeof(fREAL), "convolve_fast FHT data1");
-	data2 = (fREAL*)MEM_callocN(w2*h2*sizeof(fREAL), "convolve_fast FHT data2");
-
-	// normalize convolutor
-	wt[0] = wt[1] = wt[2] = 0.f;
-	for (y=0; y<in2->y; y++) {
-		colp = (fRGB*)&in2->rect[y*in2->x*in2->type];
-		for (x=0; x<in2->x; x++)
-			add_v3_v3(wt, colp[x]);
-	}
-	if (wt[0] != 0.f) wt[0] = 1.f/wt[0];
-	if (wt[1] != 0.f) wt[1] = 1.f/wt[1];
-	if (wt[2] != 0.f) wt[2] = 1.f/wt[2];
-	for (y=0; y<in2->y; y++) {
-		colp = (fRGB*)&in2->rect[y*in2->x*in2->type];
-		for (x=0; x<in2->x; x++)
-			mul_v3_v3(colp[x], wt);
-	}
-
-	// copy image data, unpacking interleaved RGBA into separate channels
-	// only need to calc data1 once
-
-	// block add-overlap
-	hw = in2->x >> 1;
-	hh = in2->y >> 1;
-	xbsz = (w2 + 1) - in2->x;
-	ybsz = (h2 + 1) - in2->y;
-	nxb = in1->x / xbsz;
-	if (in1->x % xbsz) nxb++;
-	nyb = in1->y / ybsz;
-	if (in1->y % ybsz) nyb++;
-	for (ybl=0; ybl<nyb; ybl++) {
-		for (xbl=0; xbl<nxb; xbl++) {
-
-			// each channel one by one
-			for (ch=0; ch<3; ch++) {
-				fREAL* data1ch = &data1[ch*w2*h2];
-
-				// only need to calc fht data from in2 once, can re-use for every block
-				if (!in2done) {
-					// in2, channel ch -> data1
-					for (y=0; y<in2->y; y++) {
-						fp = &data1ch[y*w2];
-						colp = (fRGB*)&in2->rect[y*in2->x*in2->type];
-						for (x=0; x<in2->x; x++)
-							fp[x] = colp[x][ch];
-					}
-				}
-
-				// in1, channel ch -> data2
-				memset(data2, 0, w2*h2*sizeof(fREAL));
-				for (y=0; y<ybsz; y++) {
-					int yy = ybl*ybsz + y;
-					if (yy >= in1->y) continue;
-					fp = &data2[y*w2];
-					colp = (fRGB*)&in1->rect[yy*in1->x*in1->type];
-					for (x=0; x<xbsz; x++) {
-						int xx = xbl*xbsz + x;
-						if (xx >= in1->x) continue;
-						fp[x] = colp[xx][ch];
-					}
-				}
-
-				// forward FHT
-				// zero pad data start is different for each == height+1
-				if (!in2done) FHT2D(data1ch, log2_w, log2_h, in2->y+1, 0);
-				FHT2D(data2, log2_w, log2_h, in2->y+1, 0);
-
-				// FHT2D transposed data, row/col now swapped
-				// convolve & inverse FHT
-				fht_convolve(data2, data1ch, log2_h, log2_w);
-				FHT2D(data2, log2_h, log2_w, 0, 1);
-				// data again transposed, so in order again
-
-				// overlap-add result
-				for (y=0; y<(int)h2; y++) {
-					const int yy = ybl*ybsz + y - hh;
-					if ((yy < 0) || (yy >= in1->y)) continue;
-					fp = &data2[y*w2];
-					colp = (fRGB*)&rdst->rect[yy*in1->x*in1->type];
-					for (x=0; x<(int)w2; x++) {
-						const int xx = xbl*xbsz + x - hw;
-						if ((xx < 0) || (xx >= in1->x)) continue;
-						colp[xx][ch] += fp[x];
-					}
-				}
-
-			}
-			in2done = TRUE;
-		}
-	}
-
-	MEM_freeN(data2);
-	MEM_freeN(data1);
-	memcpy(dst->rect, rdst->rect, sizeof(float)*dst->x*dst->y*dst->type);
-	free_compbuf(rdst);
-}
-
-
-/*
- *
- * Utility functions qd_* should probably be integrated better with other functions here.
- *
- */
-// sets fcol to pixelcolor at (x, y)
-void qd_getPixel(CompBuf* src, int x, int y, float* col)
-{
-	if (src->rect_procedural) {
-		float bc[4];
-		src->rect_procedural(src, bc, (float)x/(float)src->xrad, (float)y/(float)src->yrad);
-
-		switch (src->type) {
-			/* these fallthrough to get all the channels */
-			case CB_RGBA: col[3]=bc[3]; 
-			case CB_VEC3: col[2]=bc[2];
-			case CB_VEC2: col[1]=bc[1];
-			case CB_VAL: col[0]=bc[0];
-		}
-	}
-	else if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
-		float* bc = &src->rect[(x + y*src->x)*src->type];
-		switch (src->type) {
-			/* these fallthrough to get all the channels */
-			case CB_RGBA: col[3]=bc[3]; 
-			case CB_VEC3: col[2]=bc[2];
-			case CB_VEC2: col[1]=bc[1];
-			case CB_VAL: col[0]=bc[0];
-		}
-	}
-	else {
-		switch (src->type) {
-			/* these fallthrough to get all the channels */
-			case CB_RGBA: col[3]=0.0; 
-			case CB_VEC3: col[2]=0.0; 
-			case CB_VEC2: col[1]=0.0; 
-			case CB_VAL: col[0]=0.0; 
-		}
-	}
-}
-
-// sets pixel (x, y) to color col
-void qd_setPixel(CompBuf* src, int x, int y, float* col)
-{
-	if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
-		float* bc = &src->rect[(x + y*src->x)*src->type];
-		switch (src->type) {
-			/* these fallthrough to get all the channels */
-			case CB_RGBA: bc[3]=col[3]; 
-			case CB_VEC3: bc[2]=col[2];
-			case CB_VEC2: bc[1]=col[1];
-			case CB_VAL: bc[0]=col[0];
-		}
-	}
-}
-
-// adds fcol to pixelcolor (x, y)
-void qd_addPixel(CompBuf* src, int x, int y, float* col)
-{
-	if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
-		float* bc = &src->rect[(x + y*src->x)*src->type];
-		bc[0] += col[0], bc[1] += col[1], bc[2] += col[2];
-	}
-}
-
-// multiplies pixel by factor value f
-void qd_multPixel(CompBuf* src, int x, int y, float f)
-{
-	if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
-		float* bc = &src->rect[(x + y*src->x)*src->type];
-		bc[0] *= f, bc[1] *= f, bc[2] *= f;
-	}
-}
-
-// bilinear interpolation with wraparound
-void qd_getPixelLerpWrap(CompBuf* src, float u, float v, float* col)
-{
-	const float ufl = floor(u), vfl = floor(v);
-	const int nx = (int)ufl % src->x, ny = (int)vfl % src->y;
-	const int x1 = (nx < 0) ? (nx + src->x) : nx;
-	const int y1 = (ny < 0) ? (ny + src->y) : ny;
-	const int x2 = (x1 + 1) % src->x, y2 = (y1 + 1) % src->y;
-	const float* c00 = &src->rect[(x1 + y1*src->x)*src->type];
-	const float* c10 = &src->rect[(x2 + y1*src->x)*src->type];
-	const float* c01 = &src->rect[(x1 + y2*src->x)*src->type];
-	const float* c11 = &src->rect[(x2 + y2*src->x)*src->type];
-	const float uf = u - ufl, vf = v - vfl;
-	const float w00=(1.f-uf)*(1.f-vf), w10=uf*(1.f-vf), w01=(1.f-uf)*vf, w11=uf*vf;
-	col[0] = w00*c00[0] + w10*c10[0] + w01*c01[0] + w11*c11[0];
-	if (src->type != CB_VAL) {
-		col[1] = w00*c00[1] + w10*c10[1] + w01*c01[1] + w11*c11[1];
-		col[2] = w00*c00[2] + w10*c10[2] + w01*c01[2] + w11*c11[2];
-		col[3] = w00*c00[3] + w10*c10[3] + w01*c01[3] + w11*c11[3];
-	}
-}
-
-// as above, without wrap around
-void qd_getPixelLerp(CompBuf* src, float u, float v, float* col)
-{
-	const float ufl = floor(u), vfl = floor(v);
-	const int x1 = (int)ufl, y1 = (int)vfl;
-	const int x2 = (int)ceil(u), y2 = (int)ceil(v);
-	if ((x2 >= 0) && (y2 >= 0) && (x1 < src->x) && (y1 < src->y)) {
-		const float B[4] = {0, 0, 0, 0};
-		const int ox1 = (x1 < 0), oy1 = (y1 < 0), ox2 = (x2 >= src->x), oy2 = (y2 >= src->y);
-		const float* c00 = (ox1 || oy1) ? B : &src->rect[(x1 + y1*src->x)*src->type];
-		const float* c10 = (ox2 || oy1) ? B : &src->rect[(x2 + y1*src->x)*src->type];
-		const float* c01 = (ox1 || oy2) ? B : &src->rect[(x1 + y2*src->x)*src->type];
-		const float* c11 = (ox2 || oy2) ? B : &src->rect[(x2 + y2*src->x)*src->type];
-		const float uf = u - ufl, vf = v - vfl;
-		const float w00=(1.f-uf)*(1.f-vf), w10=uf*(1.f-vf), w01=(1.f-uf)*vf, w11=uf*vf;
-		col[0] = w00*c00[0] + w10*c10[0] + w01*c01[0] + w11*c11[0];
-		if (src->type != CB_VAL) {
-			col[1] = w00*c00[1] + w10*c10[1] + w01*c01[1] + w11*c11[1];
-			col[2] = w00*c00[2] + w10*c10[2] + w01*c01[2] + w11*c11[2];
-			col[3] = w00*c00[3] + w10*c10[3] + w01*c01[3] + w11*c11[3];
-		}
-	}
-	else col[0] = col[1] = col[2] = col[3] = 0.f;
-}
-
-// as above, sampling only one channel
-void qd_getPixelLerpChan(CompBuf* src, float u, float v, int chan, float* out)
-{
-	const float ufl = floor(u), vfl = floor(v);
-	const int x1 = (int)ufl, y1 = (int)vfl;
-	const int x2 = (int)ceil(u), y2 = (int)ceil(v);
-	if (chan >= src->type) chan = 0;
-	if ((x2 >= 0) && (y2 >= 0) && (x1 < src->x) && (y1 < src->y)) {
-		const float B[4] = {0, 0, 0, 0};
-		const int ox1 = (x1 < 0), oy1 = (y1 < 0), ox2 = (x2 >= src->x), oy2 = (y2 >= src->y);
-		const float* c00 = (ox1 || oy1) ? B : &src->rect[(x1 + y1*src->x)*src->type + chan];
-		const float* c10 = (ox2 || oy1) ? B : &src->rect[(x2 + y1*src->x)*src->type + chan];
-		const float* c01 = (ox1 || oy2) ? B : &src->rect[(x1 + y2*src->x)*src->type + chan];
-		const float* c11 = (ox2 || oy2) ? B : &src->rect[(x2 + y2*src->x)*src->type + chan];
-		const float uf = u - ufl, vf = v - vfl;
-		const float w00=(1.f-uf)*(1.f-vf), w10=uf*(1.f-vf), w01=(1.f-uf)*vf, w11=uf*vf;
-		out[0] = w00*c00[0] + w10*c10[0] + w01*c01[0] + w11*c11[0];
-	}
-	else *out = 0.f;
-}
-
-
-CompBuf* qd_downScaledCopy(CompBuf* src, int scale)
-{
-	CompBuf* fbuf;
-	if (scale <= 1)
-		fbuf = dupalloc_compbuf(src);
-	else {
-		int nw = src->x/scale, nh = src->y/scale;
-		if ((2*(src->x % scale)) > scale) nw++;
-		if ((2*(src->y % scale)) > scale) nh++;
-		fbuf = alloc_compbuf(nw, nh, src->type, 1);
-		{
-			int x, y, xx, yy, sx, sy, mx, my;
-			float colsum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-			float fscale = 1.f/(float)(scale*scale);
-			for (y=0; y<nh; y++) {
-				fRGB* fcolp = (fRGB*)&fbuf->rect[y*fbuf->x*fbuf->type];
-				yy = y*scale;
-				my = yy + scale;
-				if (my > src->y) my = src->y;
-				for (x=0; x<nw; x++) {
-					xx = x*scale;
-					mx = xx + scale;
-					if (mx > src->x) mx = src->x;
-					zero_v3(colsum);
-					for (sy=yy; sy<my; sy++) {
-						fRGB* scolp = (fRGB*)&src->rect[sy*src->x*src->type];
-						for (sx=xx; sx<mx; sx++)
-							add_v3_v3(colsum, scolp[sx]);
-					}
-					mul_v3_fl(colsum, fscale);
-					copy_v3_v3(fcolp[x], colsum);
-				}
-			}
-		}
-	}
-	return fbuf;
-}
-
-// fast g.blur, per channel
-// xy var. bits 1 & 2 ca be used to blur in x or y direction separately
-void IIR_gauss(CompBuf* src, float sigma, int chan, int xy)
-{
-	double q, q2, sc, cf[4], tsM[9], tsu[3], tsv[3];
-	double *X, *Y, *W;
-	const unsigned int src_width = src->x;
-	const unsigned int src_height = src->y;
-	unsigned int i, x, y, sz;
-
-	// <0.5 not valid, though can have a possibly useful sort of sharpening effect
-	if (sigma < 0.5f) return;
-
-	if ((xy < 1) || (xy > 3)) xy = 3;
-
-	// XXX The YVV macro defined below explicitly expects sources of at least 3x3 pixels,
-	//     so just skiping blur along faulty direction if src's def is below that limit!
-	if (src_width < 3) xy &= ~(int) 1;
-	if (src_height < 3) xy &= ~(int) 2;
-	if (xy < 1) return;
-
-	// see "Recursive Gabor Filtering" by Young/VanVliet
-	// all factors here in double.prec. Required, because for single.prec it seems to blow up if sigma > ~200
-	if (sigma >= 3.556f)
-		q = 0.9804f * (sigma - 3.556f) + 2.5091f;
-	else     // sigma >= 0.5
-		q = (0.0561f * sigma + 0.5784f) * sigma - 0.2568f;
-	q2 = q * q;
-	sc = (1.1668 + q) * (3.203729649  + (2.21566 + q) * q);
-	// no gabor filtering here, so no complex multiplies, just the regular coefs.
-	// all negated here, so as not to have to recalc Triggs/Sdika matrix
-	cf[1] = q * (5.788961737 + (6.76492 + 3.0 * q) * q) / sc;
-	cf[2] = -q2 * (3.38246 + 3.0 * q) / sc;
-	// 0 & 3 unchanged
-	cf[3] = q2 * q / sc;
-	cf[0] = 1.0 - cf[1] - cf[2] - cf[3];
-
-	// Triggs/Sdika border corrections,
-	// it seems to work, not entirely sure if it is actually totally correct,
-	// Besides J.M.Geusebroek's anigauss.c (see http://www.science.uva.nl/~mark),
-	// found one other implementation by Cristoph Lampert,
-	// but neither seem to be quite the same, result seems to be ok so far anyway.
-	// Extra scale factor here to not have to do it in filter,
-	// though maybe this had something to with the precision errors
-	sc = cf[0] / ((1.0 + cf[1] - cf[2] + cf[3]) * (1.0 - cf[1] - cf[2] - cf[3]) * (1.0 + cf[2] + (cf[1] - cf[3]) * cf[3]));
-	tsM[0] = sc * (-cf[3] * cf[1] + 1.0 - cf[3] * cf[3] - cf[2]);
-	tsM[1] = sc * ((cf[3] + cf[1]) * (cf[2] + cf[3] * cf[1]));
-	tsM[2] = sc * (cf[3] * (cf[1] + cf[3] * cf[2]));
-	tsM[3] = sc * (cf[1] + cf[3] * cf[2]);
-	tsM[4] = sc * (-(cf[2] - 1.0) * (cf[2] + cf[3] * cf[1]));
-	tsM[5] = sc * (-(cf[3] * cf[1] + cf[3] * cf[3] + cf[2] - 1.0) * cf[3]);
-	tsM[6] = sc * (cf[3] * cf[1] + cf[2] + cf[1] * cf[1] - cf[2] * cf[2]);
-	tsM[7] = sc * (cf[1] * cf[2] + cf[3] * cf[2] * cf[2] - cf[1] * cf[3] * cf[3] - cf[3] * cf[3] * cf[3] - cf[3] * cf[2] + cf[3]);
-	tsM[8] = sc * (cf[3] * (cf[1] + cf[3] * cf[2]));
-
-#define YVV(L)                                                                          \
-{                                                                                       \
-	W[0] = cf[0] * X[0] + cf[1] * X[0] + cf[2] * X[0] + cf[3] * X[0];                   \
-	W[1] = cf[0] * X[1] + cf[1] * W[0] + cf[2] * X[0] + cf[3] * X[0];                   \
-	W[2] = cf[0] * X[2] + cf[1] * W[1] + cf[2] * W[0] + cf[3] * X[0];                   \
-	for (i = 3; i < L; i++) {                                                           \
-		W[i] = cf[0] * X[i] + cf[1] * W[i - 1] + cf[2] * W[i - 2] + cf[3] * W[i - 3];   \
-	}                                                                                   \
-	tsu[0] = W[L - 1] - X[L - 1];                                                       \
-	tsu[1] = W[L - 2] - X[L - 1];                                                       \
-	tsu[2] = W[L - 3] - X[L - 1];                                                       \
-	tsv[0] = tsM[0] * tsu[0] + tsM[1] * tsu[1] + tsM[2] * tsu[2] + X[L - 1];            \
-	tsv[1] = tsM[3] * tsu[0] + tsM[4] * tsu[1] + tsM[5] * tsu[2] + X[L - 1];            \
-	tsv[2] = tsM[6] * tsu[0] + tsM[7] * tsu[1] + tsM[8] * tsu[2] + X[L - 1];            \
-	Y[L - 1] = cf[0] * W[L - 1] + cf[1] * tsv[0] + cf[2] * tsv[1] + cf[3] * tsv[2];     \
-	Y[L - 2] = cf[0] * W[L - 2] + cf[1] * Y[L - 1] + cf[2] * tsv[0] + cf[3] * tsv[1];   \
-	Y[L - 3] = cf[0] * W[L - 3] + cf[1] * Y[L - 2] + cf[2] * Y[L - 1] + cf[3] * tsv[0]; \
-	/* 'i != UINT_MAX' is really 'i >= 0', but necessary for unsigned int wrapping */   \
-	for (i = L - 4; i != UINT_MAX; i--) {                                               \
-		Y[i] = cf[0] * W[i] + cf[1] * Y[i + 1] + cf[2] * Y[i + 2] + cf[3] * Y[i + 3];   \
-	}                                                                                   \
-} (void)0
-
-	// intermediate buffers
-	sz = MAX2(src_width, src_height);
-	X = MEM_callocN(sz * sizeof(double), "IIR_gauss X buf");
-	Y = MEM_callocN(sz * sizeof(double), "IIR_gauss Y buf");
-	W = MEM_callocN(sz * sizeof(double), "IIR_gauss W buf");
-	if (xy & 1) {       // H
-		for (y = 0; y < src_height; ++y) {
-			const int yx = y * src_width;
-			for (x = 0; x < src_width; ++x)
-				X[x] = src->rect[(x + yx) * src->type + chan];
-			YVV(src_width);
-			for (x = 0; x < src_width; ++x)
-				src->rect[(x + yx) * src->type + chan] = Y[x];
-		}
-	}
-	if (xy & 2) {       // V
-		for (x = 0; x < src_width; ++x) {
-			for (y = 0; y < src_height; ++y)
-				X[y] = src->rect[(x + y * src_width) * src->type + chan];
-			YVV(src_height);
-			for (y = 0; y < src_height; ++y)
-				src->rect[(x + y * src_width) * src->type + chan] = Y[y];
-		}
-	}
-
-	MEM_freeN(X);
-	MEM_freeN(W);
-	MEM_freeN(Y);
-#undef YVV
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
diff --git a/source/blender/nodes/composite/node_composite_util.h b/source/blender/nodes/composite/node_composite_util.h
index f2719ee..a3c4bff 100644
--- a/source/blender/nodes/composite/node_composite_util.h
+++ b/source/blender/nodes/composite/node_composite_util.h
@@ -33,177 +33,30 @@
 #ifndef __NODE_COMPOSITE_UTIL_H__
 #define __NODE_COMPOSITE_UTIL_H__
 
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_camera_types.h" /* qdn: defocus node, need camera info */
-#include "DNA_color_types.h"
 #include "DNA_ID.h"
-#include "DNA_image_types.h"
-#include "DNA_material_types.h"
 #include "DNA_movieclip_types.h"
 #include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_threads.h"
-#include "BLI_utildefines.h"
-#include "BLI_utildefines.h"
 
 #include "BLF_translation.h"
 
-#include "BKE_blender.h"
-#include "BKE_camera.h"
 #include "BKE_colortools.h"
-#include "BKE_global.h"
 #include "BKE_image.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_movieclip.h"
-#include "BKE_node.h"
 #include "BKE_texture.h"
 #include "BKE_tracking.h"
 
-#include "BKE_library.h"
-#include "BKE_object.h"
-
 #include "node_util.h"
 
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
 
 #include "RE_pipeline.h"
-#include "RE_shader_ext.h"
-#include "RE_render_ext.h"
 
 /* only for forward declarations */
 #include "NOD_composite.h"
 
 #define CMP_SCALE_MAX	12000
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* *************************** operations support *************************** */
-
-/* general signal that's in output sockets, and goes over the wires */
-typedef struct CompBuf {
-	float *rect;
-	int x, y, xrad, yrad;
-	short type, malloc;
-	rcti disprect;		/* cropped part of image */
-	int xof, yof;		/* relative to center of target image */
-	
-	void (*rect_procedural)(struct CompBuf *, float *, float, float);
-	float procedural_size[3], procedural_offset[3];
-	int procedural_type;
-	bNode *node;		/* only in use for procedural bufs */
-	
-	struct CompBuf *next, *prev;	/* for pass-on, works nicer than reference counting */
-} CompBuf;
-
-/* defines also used for pixel size */
-#define CB_RGBA		4
-#define CB_VEC4		4
-#define CB_VEC3		3
-#define CB_VEC2		2
-#define CB_VAL		1
-
-/* defines for RGBA channels */
-#define CHAN_R	0
-#define CHAN_G	1
-#define CHAN_B	2
-#define CHAN_A	3
-
-
-
-CompBuf *alloc_compbuf(int sizex, int sizey, int type, int alloc);
-CompBuf *dupalloc_compbuf(CompBuf *cbuf);
-CompBuf *pass_on_compbuf(CompBuf *cbuf);
-void free_compbuf(CompBuf *cbuf);
-void print_compbuf(char *str, CompBuf *cbuf);
-void compbuf_set_node(struct CompBuf *cbuf, struct bNode *node);
-
-CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, int type);
-CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy);
-CompBuf *typecheck_compbuf(CompBuf *inbuf, int type);
-void typecheck_compbuf_color(float *out, float *in, int outtype, int intype);
-
-/* **************************************************** */
-
-float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y, int xrad, int yrad);
-
-/* Pixel-to-Pixel operation, 1 Image in, 1 out */
-void composit1_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col,
-									  void (*func)(bNode *, float *, float *), 
-									  int src_type);
-/* Pixel-to-Pixel operation, 2 Images in, 1 out */
-void composit2_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col,
-									  CompBuf *fac_buf, float *fac, void (*func)(bNode *, float *, float *, float *), 
-									  int src_type, int fac_type);
-
-/* Pixel-to-Pixel operation, 3 Images in, 1 out */
-void composit3_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, float *src1_col, CompBuf *src2_buf, float *src2_col, 
-									  CompBuf *fac_buf, float *fac, void (*func)(bNode *, float *, float *, float *, float *), 
-									  int src1_type, int src2_type, int fac_type);
-
-/* Pixel-to-Pixel operation, 4 Images in, 1 out */
-void composit4_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, float *src1_col, CompBuf *fac1_buf, float *fac1, 
-									  CompBuf *src2_buf, float *src2_col, CompBuf *fac2_buf, float *fac2, 
-									  void (*func)(bNode *, float *, float *, float *, float *, float *), 
-									  int src1_type, int fac1_type, int src2_type, int fac2_type);
-
-CompBuf *valbuf_from_rgbabuf(CompBuf *cbuf, int channel);
-void valbuf_to_rgbabuf(CompBuf *valbuf, CompBuf *cbuf, int channel);
-void generate_preview(void *data, bNode *node, CompBuf *stackbuf);
-
-void do_copy_rgba(bNode *node, float *out, float *in);
-void do_copy_rgb(bNode *node, float *out, float *in);
-void do_copy_value(bNode *node, float *out, float *in);
-void do_copy_a_rgba(bNode *node, float *out, float *in, float *fac);
-
-void do_rgba_to_yuva(bNode *node, float *out, float *in);
-void do_rgba_to_hsva(bNode *node, float *out, float *in);
-void do_rgba_to_ycca(bNode *node, float *out, float *in);
-void do_yuva_to_rgba(bNode *node, float *out, float *in);
-void do_hsva_to_rgba(bNode *node, float *out, float *in);
-void do_ycca_to_rgba(bNode *node, float *out, float *in);
-
-void gamma_correct_compbuf(CompBuf *img, int inversed);
-void premul_compbuf(CompBuf *img, int inversed);
-void convolve(CompBuf* dst, CompBuf* in1, CompBuf* in2);
-
-extern void node_ID_title_cb(void *node_v, void *unused_v);
-
-
-/* utility functions used by glare, tonemap and lens distortion */
-/* soms macros for color handling */
-typedef float fRGB[4];
-/* multiply c2 by color rgb, rgb as separate arguments */
-#define fRGB_rgbmult(c, r, g, b) { c[0]*=(r);  c[1]*=(g);  c[2]*=(b); } (void)0
-
-void qd_getPixel(CompBuf* src, int x, int y, float* col);
-void qd_setPixel(CompBuf* src, int x, int y, float* col);
-void qd_addPixel(CompBuf* src, int x, int y, float* col);
-void qd_multPixel(CompBuf* src, int x, int y, float f);
-void qd_getPixelLerpWrap(CompBuf* src, float u, float v, float* col);
-void qd_getPixelLerp(CompBuf* src, float u, float v, float* col);
-void qd_getPixelLerpChan(CompBuf* src, float u, float v, int chan, float* out);
-CompBuf* qd_downScaledCopy(CompBuf* src, int scale);
-void IIR_gauss(CompBuf* src, float sigma, int chan, int xy);
-/* end utility funcs */
-
-/* transformations */
-
-CompBuf* node_composit_transform(CompBuf *cbuf, float x, float y, float angle, float scale, int filter_type);
-float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc);
-
-#endif
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
+#endif  /* __NODE_COMPOSITE_UTIL_H__ */
diff --git a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
index 71b71c9..3722ad1 100644
--- a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
+++ b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
@@ -43,103 +43,6 @@ static bNodeSocketTemplate cmp_node_alphaover_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_alphaover_premul(bNode *UNUSED(node), float *out, float *src, float *over, float *fac)
-{
-	
-	/* Zero alpha values should still permit an add of RGB data */
-	if (over[3]<0.0f) {
-		copy_v4_v4(out, src);
-	}
-	else if (fac[0]==1.0f && over[3]>=1.0f) {
-		copy_v4_v4(out, over);
-	}
-	else {
-		float mul= 1.0f - fac[0]*over[3];
-
-		out[0] = (mul*src[0]) + fac[0]*over[0];
-		out[1] = (mul*src[1]) + fac[0]*over[1];
-		out[2] = (mul*src[2]) + fac[0]*over[2];
-		out[3] = (mul*src[3]) + fac[0]*over[3];
-	}
-}
-
-/* result will be still premul, but the over part is premulled */
-static void do_alphaover_key(bNode *UNUSED(node), float *out, float *src, float *over, float *fac)
-{
-	
-	if (over[3]<=0.0f) {
-		copy_v4_v4(out, src);
-	}
-	else if (fac[0]==1.0f && over[3]>=1.0f) {
-		copy_v4_v4(out, over);
-	}
-	else {
-		float premul= fac[0]*over[3];
-		float mul= 1.0f - premul;
-
-		out[0] = (mul*src[0]) + premul*over[0];
-		out[1] = (mul*src[1]) + premul*over[1];
-		out[2] = (mul*src[2]) + premul*over[2];
-		out[3] = (mul*src[3]) + fac[0]*over[3];
-	}
-}
-
-/* result will be still premul, but the over part is premulled */
-static void do_alphaover_mixed(bNode *node, float *out, float *src, float *over, float *fac)
-{
-	
-	if (over[3]<=0.0f) {
-		copy_v4_v4(out, src);
-	}
-	else if (fac[0]==1.0f && over[3]>=1.0f) {
-		copy_v4_v4(out, over);
-	}
-	else {
-		NodeTwoFloats *ntf= node->storage;
-		float addfac= 1.0f - ntf->x + over[3]*ntf->x;
-		float premul= fac[0]*addfac;
-		float mul= 1.0f - fac[0]*over[3];
-		
-		out[0] = (mul*src[0]) + premul*over[0];
-		out[1] = (mul*src[1]) + premul*over[1];
-		out[2] = (mul*src[2]) + premul*over[2];
-		out[3] = (mul*src[3]) + fac[0]*over[3];
-	}
-}
-
-
-static void node_composit_exec_alphaover(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: col col */
-	/* stack order out: col */
-	if (out[0]->hasoutput==0) 
-		return;
-	
-	/* input no image? then only color operation */
-	if (in[1]->data==NULL && in[2]->data==NULL) {
-		do_alphaover_premul(node, out[0]->vec, in[1]->vec, in[2]->vec, in[0]->vec);
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf= in[1]->data?in[1]->data:in[2]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		NodeTwoFloats *ntf= node->storage;
-		
-		if (ntf->x != 0.0f)
-			composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, in[0]->vec, do_alphaover_mixed, CB_RGBA, CB_RGBA, CB_VAL);
-		else if (node->custom1)
-			composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, in[0]->vec, do_alphaover_key, CB_RGBA, CB_RGBA, CB_VAL);
-		else
-			composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, in[0]->vec, do_alphaover_premul, CB_RGBA, CB_RGBA, CB_VAL);
-		
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_alphaover_init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->storage= MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats");
@@ -151,12 +54,9 @@ void register_node_type_cmp_alphaover(bNodeTreeType *ttype)
 
 	node_type_base(ttype, &ntype, CMP_NODE_ALPHAOVER, "Alpha Over", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_alphaover_in, cmp_node_alphaover_out);
-	node_type_size(&ntype, 80, 40, 120);
+	node_type_size(&ntype, 80, 40, 160);
 	node_type_init(&ntype, node_alphaover_init);
 	node_type_storage(&ntype, "NodeTwoFloats", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_alphaover);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
index 7674ace..34cc9a9 100644
--- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
@@ -43,221 +43,6 @@ static bNodeSocketTemplate cmp_node_bilateralblur_out[] = {
 	{ -1, 0, "" }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-#define INIT_C3                                                               \
-    mean0 = 1;                                                                \
-    mean1[0] = src[0];                                                        \
-    mean1[1] = src[1];                                                        \
-    mean1[2] = src[2];                                                        \
-    mean1[3] = src[3];                                                        \
-    (void)0
-
-/* finds color distances */
-#define COLOR_DISTANCE_C3(c1, c2)                                             \
-    ((c1[0] - c2[0]) * (c1[0] - c2[0]) +                                      \
-     (c1[1] - c2[1]) * (c1[1] - c2[1]) +                                      \
-     (c1[2] - c2[2]) * (c1[2] - c2[2]) +                                      \
-     (c1[3] - c2[3]) * (c1[3] - c2[3]))
-
-/* this is the main kernel function for comparing color distances
- * and adding them weighted to the final color */
-#define KERNEL_ELEMENT_C3(k)                                                  \
-    temp_color = src + deltas[k];                                             \
-    ref_color = ref + deltas[k];                                              \
-    w = weight_tab[k] +                                                       \
-        (double)COLOR_DISTANCE_C3(ref, ref_color) * i2sigma_color;            \
-    w = 1.0 / (w * w + 1);                                                    \
-    mean0 += w;                                                               \
-    mean1[0] += (double)temp_color[0] * w;                                    \
-    mean1[1] += (double)temp_color[1] * w;                                    \
-    mean1[2] += (double)temp_color[2] * w;                                    \
-    mean1[3] += (double)temp_color[3] * w;                                    \
-    (void)0
-
-/* write blurred values to image */
-#define UPDATE_OUTPUT_C3                                                      \
-    mean0 = 1.0 / mean0;                                                      \
-    dest[x * pix + 0] = mean1[0] * mean0;                                     \
-    dest[x * pix + 1] = mean1[1] * mean0;                                     \
-    dest[x * pix + 2] = mean1[2] * mean0;                                     \
-    dest[x * pix + 3] = mean1[3] * mean0;                                     \
-    (void)0
-
-/* initializes deltas for fast access to neighbor pixels */
-#define INIT_3X3_DELTAS(deltas, step, nch)                                    \
-    ((deltas)[0] =  (nch),  (deltas)[1] = -(step) + (nch),                    \
-     (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch),                    \
-     (deltas)[4] = -(nch),  (deltas)[5] =  (step) - (nch),                    \
-     (deltas)[6] =  (step), (deltas)[7] =  (step) + (nch));                   \
-    (void)0
-
-
-/* code of this node was heavily inspired by the smooth function of opencv library.
- * The main change is an optional image input */
-static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	NodeBilateralBlurData *nbbd = node->storage;
-	CompBuf *new, *source, *img = in[0]->data, *refimg = in[1]->data;
-	double mean0, w, i2sigma_color, i2sigma_space;
-	double mean1[4];
-	double weight_tab[8];
-	float *src, *dest, *ref, *temp_color, *ref_color;
-	float sigma_color, sigma_space;
-	int imgx, imgy, x, y, pix, i, step;
-	int deltas[8];
-	short found_determinator = 0;
-
-	if (img == NULL || out[0]->hasoutput == 0)
-		return;
-
-	if (img->type != CB_RGBA) {
-		img = typecheck_compbuf(in[0]->data, CB_RGBA);
-	}
-
-	imgx = img->x;
-	imgy = img->y;
-	pix = img->type;
-	step = pix * imgx;
-
-	if (refimg) {
-		if (refimg->x == imgx && refimg->y == imgy) {
-			if (ELEM3(refimg->type, CB_VAL, CB_VEC2, CB_VEC3)) {
-				refimg = typecheck_compbuf(in[1]->data, CB_RGBA);
-				found_determinator = 1;
-			}
-		}
-	}
-	else {
-		refimg = img;
-	}
-
-	/* allocs */
-	source = dupalloc_compbuf(img);
-	new = alloc_compbuf(imgx, imgy, pix, 1);
-	
-	/* accept image offsets from other nodes */
-	new->xof = img->xof;
-	new->yof = img->yof;
-
-	/* bilateral code properties */
-	sigma_color = nbbd->sigma_color;
-	sigma_space = nbbd->sigma_space;
-	
-	i2sigma_color = 1.0f / (sigma_color * sigma_color);
-	i2sigma_space = 1.0f / (sigma_space * sigma_space);
-
-	INIT_3X3_DELTAS(deltas, step, pix);
-
-	weight_tab[0] = weight_tab[2] = weight_tab[4] = weight_tab[6] = i2sigma_space;
-	weight_tab[1] = weight_tab[3] = weight_tab[5] = weight_tab[7] = i2sigma_space * 2;
-
-	/* iterations */
-	for (i = 0; i < nbbd->iter; i++) {
-		src = source->rect;
-		ref = refimg->rect;
-		dest = new->rect;
-		/*goes through image, there are more loops for 1st/last line and all other lines*/
-		/*kernel element accumulates surrounding colors, which are then written with the update_output function*/
-		for (x = 0; x < imgx; x++, src += pix, ref += pix) {
-			INIT_C3;
-
-			KERNEL_ELEMENT_C3(6);
-
-			if (x > 0) {
-				KERNEL_ELEMENT_C3(5);
-				KERNEL_ELEMENT_C3(4);
-			}
-
-			if (x < imgx - 1) {
-				KERNEL_ELEMENT_C3(7);
-				KERNEL_ELEMENT_C3(0);
-			}
-
-			UPDATE_OUTPUT_C3;
-		}
-
-		dest += step;
-
-		for (y = 1; y < imgy - 1; y++, dest += step, src += pix, ref += pix) {
-			x = 0;
-
-			INIT_C3;
-
-			KERNEL_ELEMENT_C3(0);
-			KERNEL_ELEMENT_C3(1);
-			KERNEL_ELEMENT_C3(2);
-			KERNEL_ELEMENT_C3(6);
-			KERNEL_ELEMENT_C3(7);
-
-			UPDATE_OUTPUT_C3;
-
-			src += pix;
-			ref += pix;
-
-			for (x = 1; x < imgx - 1; x++, src += pix, ref += pix) {
-				INIT_C3;
-
-				KERNEL_ELEMENT_C3(0);
-				KERNEL_ELEMENT_C3(1);
-				KERNEL_ELEMENT_C3(2);
-				KERNEL_ELEMENT_C3(3);
-				KERNEL_ELEMENT_C3(4);
-				KERNEL_ELEMENT_C3(5);
-				KERNEL_ELEMENT_C3(6);
-				KERNEL_ELEMENT_C3(7);
-
-				UPDATE_OUTPUT_C3;
-			}
-
-			INIT_C3;
-
-			KERNEL_ELEMENT_C3(2);
-			KERNEL_ELEMENT_C3(3);
-			KERNEL_ELEMENT_C3(4);
-			KERNEL_ELEMENT_C3(5);
-			KERNEL_ELEMENT_C3(6);
-
-			UPDATE_OUTPUT_C3;
-		}
-
-		for (x = 0; x < imgx; x++, src += pix, ref += pix) {
-			INIT_C3;
-
-			KERNEL_ELEMENT_C3(2);
-
-			if (x > 0) {
-				KERNEL_ELEMENT_C3(3);
-				KERNEL_ELEMENT_C3(4);
-			}
-			if (x < imgx - 1) {
-				KERNEL_ELEMENT_C3(1);
-				KERNEL_ELEMENT_C3(0);
-			}
-
-			UPDATE_OUTPUT_C3;
-		}
-
-		if (node->exec & NODE_BREAK) break;
-
-		SWAP(CompBuf, *source, *new);
-	}
-
-	if (img != in[0]->data)
-		free_compbuf(img);
-
-	if (found_determinator == 1) {
-		if (refimg != in[1]->data)
-			free_compbuf(refimg);
-	}
-
-	out[0]->data = source;
-
-	free_compbuf(new);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_bilateralblur(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeBilateralBlurData *nbbd = MEM_callocN(sizeof(NodeBilateralBlurData), "node bilateral blur data");
@@ -275,9 +60,6 @@ void register_node_type_cmp_bilateralblur(bNodeTreeType *ttype)
 	node_type_size(&ntype, 150, 120, 200);
 	node_type_init(&ntype, node_composit_init_bilateralblur);
 	node_type_storage(&ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_bilateralblur);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.c b/source/blender/nodes/composite/nodes/node_composite_blur.c
index eb7f776..9d19f96 100644
--- a/source/blender/nodes/composite/nodes/node_composite_blur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_blur.c
@@ -44,686 +44,6 @@ static bNodeSocketTemplate cmp_node_blur_out[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static float *make_gausstab(int filtertype, int rad)
-{
-	float *gausstab, sum, val;
-	int i, n;
-	
-	n = 2 * rad + 1;
-	
-	gausstab = (float *) MEM_mallocN(n * sizeof(float), "gauss");
-	
-	sum = 0.0f;
-	for (i = -rad; i <= rad; i++) {
-		val = RE_filter_value(filtertype, (float)i / (float)rad);
-		sum += val;
-		gausstab[i + rad] = val;
-	}
-	
-	sum = 1.0f / sum;
-	for (i = 0; i < n; i++)
-		gausstab[i] *= sum;
-	
-	return gausstab;
-}
-
-static float *make_bloomtab(int rad)
-{
-	float *bloomtab, val;
-	int i, n;
-	
-	n = 2 * rad + 1;
-	
-	bloomtab = (float *) MEM_mallocN(n * sizeof(float), "bloom");
-	
-	for (i = -rad; i <= rad; i++) {
-		val = powf(1.0f - fabsf((float)i) / ((float)rad), 4.0f);
-		bloomtab[i + rad] = val;
-	}
-	
-	return bloomtab;
-}
-
-/* both input images of same type, either 4 or 1 channel */
-static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float scale)
-{
-	NodeBlurData *nbd = node->storage;
-	CompBuf *work;
-	register float sum, val;
-	float rval, gval, bval, aval;
-	float *gausstab, *gausstabcent;
-	int rad, imgx = img->x, imgy = img->y;
-	int x, y, pix = img->type;
-	int i, bigstep;
-	float *src, *dest;
-	
-	/* helper image */
-	work = alloc_compbuf(imgx, imgy, img->type, 1); /* allocs */
-
-	/* horizontal */
-	if (nbd->sizex == 0) {
-		memcpy(work->rect, img->rect, sizeof(float) * img->type * imgx * imgy);
-	}
-	else {
-		rad = scale * (float)nbd->sizex;
-		if (rad > imgx / 2)
-			rad = imgx / 2;
-		else if (rad < 1)
-			rad = 1;
-		
-		gausstab = make_gausstab(nbd->filtertype, rad);
-		gausstabcent = gausstab + rad;
-		
-		for (y = 0; y < imgy; y++) {
-			float *srcd = img->rect + pix * (y * img->x);
-			
-			dest = work->rect + pix * (y * img->x);
-			
-			for (x = 0; x < imgx; x++) {
-				int minr = x - rad < 0 ? -x : -rad;
-				int maxr = x + rad > imgx ? imgx - x : rad;
-				
-				src = srcd + pix * (x + minr);
-				
-				sum = gval = rval = bval = aval = 0.0f;
-				for (i = minr; i < maxr; i++) {
-					val = gausstabcent[i];
-					sum += val;
-					rval += val * (*src++);
-					if (pix == 4) {
-						gval += val * (*src++);
-						bval += val * (*src++);
-						aval += val * (*src++);
-					}
-				}
-				sum = 1.0f / sum;
-				*dest++ = rval * sum;
-				if (pix == 4) {
-					*dest++ = gval * sum;
-					*dest++ = bval * sum;
-					*dest++ = aval * sum;
-				}
-			}
-			if (node->exec & NODE_BREAK)
-				break;
-		}
-		
-		/* vertical */
-		MEM_freeN(gausstab);
-	}
-	
-	if (nbd->sizey == 0) {
-		memcpy(new->rect, work->rect, sizeof(float) * img->type * imgx * imgy);
-	}
-	else {
-		rad = scale * (float)nbd->sizey;
-		if (rad > imgy / 2)
-			rad = imgy / 2;
-		else if (rad < 1)
-			rad = 1;
-	
-		gausstab = make_gausstab(nbd->filtertype, rad);
-		gausstabcent = gausstab + rad;
-		
-		bigstep = pix * imgx;
-		for (x = 0; x < imgx; x++) {
-			float *srcd = work->rect + pix * x;
-			
-			dest = new->rect + pix * x;
-			
-			for (y = 0; y < imgy; y++) {
-				int minr = y - rad < 0 ? -y : -rad;
-				int maxr = y + rad > imgy ? imgy - y : rad;
-				
-				src = srcd + bigstep * (y + minr);
-				
-				sum = gval = rval = bval = aval = 0.0f;
-				for (i = minr; i < maxr; i++) {
-					val = gausstabcent[i];
-					sum += val;
-					rval += val * src[0];
-					if (pix == 4) {
-						gval += val * src[1];
-						bval += val * src[2];
-						aval += val * src[3];
-					}
-					src += bigstep;
-				}
-				sum = 1.0f / sum;
-				dest[0] = rval * sum;
-				if (pix == 4) {
-					dest[1] = gval * sum;
-					dest[2] = bval * sum;
-					dest[3] = aval * sum;
-				}
-				dest += bigstep;
-			}
-			if (node->exec & NODE_BREAK)
-				break;
-		}
-		MEM_freeN(gausstab);
-	}
-
-	free_compbuf(work);
-}
-
-/* reference has to be mapped 0-1, and equal in size */
-static void bloom_with_reference(CompBuf *new, CompBuf *img, CompBuf *UNUSED(ref), float UNUSED(fac), NodeBlurData *nbd)
-{
-	CompBuf *wbuf;
-	register float val;
-	float radxf, radyf;
-	float **maintabs;
-	float *gausstabx, *gausstabcenty;
-	float *gausstaby, *gausstabcentx;
-	int radx, rady, imgx = img->x, imgy = img->y;
-	int x, y;
-	int i, j;
-	float *src, *dest, *wb;
-	
-	wbuf = alloc_compbuf(imgx, imgy, CB_VAL, 1);
-	
-	/* horizontal */
-	radx = (float)nbd->sizex;
-	if (radx > imgx / 2)
-		radx = imgx / 2;
-	else if (radx < 1)
-		radx = 1;
-	
-	/* vertical */
-	rady = (float)nbd->sizey;
-	if (rady > imgy / 2)
-		rady = imgy / 2;
-	else if (rady < 1)
-		rady = 1;
-
-	x = MAX2(radx, rady);
-	maintabs = MEM_mallocN(x * sizeof(void *), "gauss array");
-	for (i = 0; i < x; i++)
-		maintabs[i] = make_bloomtab(i + 1);
-		
-	/* vars to store before we go */
-//	refd= ref->rect;
-	src = img->rect;
-	
-	radxf = (float)radx;
-	radyf = (float)rady;
-	
-	for (y = 0; y < imgy; y++) {
-		for (x = 0; x < imgx; x++, src += 4) { //, refd++) {
-			
-//			int refradx= (int)(refd[0]*radxf);
-//			int refrady= (int)(refd[0]*radyf);
-			
-			int refradx = (int)(radxf * 0.3f * src[3] * (src[0] + src[1] + src[2]));
-			int refrady = (int)(radyf * 0.3f * src[3] * (src[0] + src[1] + src[2]));
-			
-			if (refradx > radx) refradx = radx;
-			else if (refradx < 1) refradx = 1;
-			if (refrady > rady) refrady = rady;
-			else if (refrady < 1) refrady = 1;
-
-			if (refradx == 1 && refrady == 1) {
-				wb = wbuf->rect + (y * imgx + x);
-				dest = new->rect + 4 * (y * imgx + x);
-				wb[0] += 1.0f;
-				dest[0] += src[0];
-				dest[1] += src[1];
-				dest[2] += src[2];
-				dest[3] += src[3];
-			}
-			else {
-				int minxr = x - refradx < 0 ? -x : -refradx;
-				int maxxr = x + refradx > imgx ? imgx - x : refradx;
-				int minyr = y - refrady < 0 ? -y : -refrady;
-				int maxyr = y + refrady > imgy ? imgy - y : refrady;
-
-				float *destd = new->rect + 4 * ( (y + minyr) * imgx + x + minxr);
-				float *wbufd = wbuf->rect + ( (y + minyr) * imgx + x + minxr);
-
-				gausstabx = maintabs[refradx - 1];
-				gausstabcentx = gausstabx + refradx;
-				gausstaby = maintabs[refrady - 1];
-				gausstabcenty = gausstaby + refrady;
-
-				for (i = minyr; i < maxyr; i++, destd += 4 * imgx, wbufd += imgx) {
-					dest = destd;
-					wb = wbufd;
-					for (j = minxr; j < maxxr; j++, dest += 4, wb++) {
-						
-						val = gausstabcenty[i] * gausstabcentx[j];
-						wb[0] += val;
-						dest[0] += val * src[0];
-						dest[1] += val * src[1];
-						dest[2] += val * src[2];
-						dest[3] += val * src[3];
-					}
-				}
-			}
-		}
-	}
-	
-	x = imgx * imgy;
-	dest = new->rect;
-	wb = wbuf->rect;
-	while (x--) {
-		val = 1.0f / wb[0];
-		dest[0] *= val;
-		dest[1] *= val;
-		dest[2] *= val;
-		dest[3] *= val;
-		wb++;
-		dest += 4;
-	}
-	
-	free_compbuf(wbuf);
-	
-	x = MAX2(radx, rady);
-	for (i = 0; i < x; i++)
-		MEM_freeN(maintabs[i]);
-	MEM_freeN(maintabs);
-	
-}
-
-#if 0
-static float hexagon_filter(float fi, float fj)
-{
-	fi = fabs(fi);
-	fj = fabs(fj);
-	
-	if (fj > 0.33f) {
-		fj = (fj - 0.33f) / 0.66f;
-		if (fi + fj > 1.0f)
-			return 0.0f;
-		else
-			return 1.0f;
-	}
-	else return 1.0f;
-}
-#endif
-
-/* uses full filter, no horizontal/vertical optimize possible */
-/* both images same type, either 1 or 4 channels */
-static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fac)
-{
-	NodeBlurData *nbd = node->storage;
-	register float val;
-	float radxf, radyf;
-	float *gausstab, *dgauss;
-	int radx, rady, imgx = img->x, imgy = img->y;
-	int x, y, pix = img->type;
-	int i, j, n;
-	float *src = NULL, *dest, *srcd = NULL;
-	
-	/* horizontal */
-	radxf = fac * (float)nbd->sizex;
-	if (radxf > imgx / 2.0f)
-		radxf = imgx / 2.0f;
-	else if (radxf < 1.0f)
-		radxf = 1.0f;
-	
-	/* vertical */
-	radyf = fac * (float)nbd->sizey;
-	if (radyf > imgy / 2.0f)
-		radyf = imgy / 2.0f;
-	else if (radyf < 1.0f)
-		radyf = 1.0f;
-	
-	radx = ceil(radxf);
-	rady = ceil(radyf);
-	
-	n = (2 * radx + 1) * (2 * rady + 1);
-	
-	/* create a full filter image */
-	gausstab = MEM_mallocN(sizeof(float) * n, "filter tab");
-	dgauss = gausstab;
-	val = 0.0f;
-	for (j = -rady; j <= rady; j++) {
-		for (i = -radx; i <= radx; i++, dgauss++) {
-			float fj = (float)j / radyf;
-			float fi = (float)i / radxf;
-			float dist = sqrt(fj * fj + fi * fi);
-
-			// *dgauss= hexagon_filter(fi, fj);
-			*dgauss = RE_filter_value(nbd->filtertype, dist);
-
-			val += *dgauss;
-		}
-	}
-
-	if (val != 0.0f) {
-		val = 1.0f / val;
-		for (j = n - 1; j >= 0; j--)
-			gausstab[j] *= val;
-	}
-	else gausstab[4] = 1.0f;
-
-	for (y = -rady + 1; y < imgy + rady - 1; y++) {
-
-		if (y <= 0) srcd = img->rect;
-		else if (y < imgy) srcd += pix * imgx;
-		else srcd = img->rect + pix * (imgy - 1) * imgx;
-
-		for (x = -radx + 1; x < imgx + radx - 1; x++) {
-			int minxr = x - radx < 0 ? -x : -radx;
-			int maxxr = x + radx >= imgx ? imgx - x - 1 : radx;
-			int minyr = y - rady < 0 ? -y : -rady;
-			int maxyr = y + rady > imgy - 1 ? imgy - y - 1 : rady;
-
-			float *destd = new->rect + pix * ( (y + minyr) * imgx + x + minxr);
-			float *dgausd = gausstab + (minyr + rady) * (2 * radx + 1) + minxr + radx;
-
-			if (x <= 0) src = srcd;
-			else if (x < imgx) src += pix;
-			else src = srcd + pix * (imgx - 1);
-
-			for (i = minyr; i <= maxyr; i++, destd += pix * imgx, dgausd += 2 * radx + 1) {
-				dest = destd;
-				dgauss = dgausd;
-				for (j = minxr; j <= maxxr; j++, dest += pix, dgauss++) {
-					val = *dgauss;
-					if (val != 0.0f) {
-						dest[0] += val * src[0];
-						if (pix > 1) {
-							dest[1] += val * src[1];
-							dest[2] += val * src[2];
-							dest[3] += val * src[3];
-						}
-					}
-				}
-			}
-		}
-		if (node->exec & NODE_BREAK)
-			break;
-	}
-	
-	MEM_freeN(gausstab);
-}
-
-
-/* reference has to be mapped 0-1, and equal in size */
-static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf *ref)
-{
-	NodeBlurData *nbd = node->storage;
-	CompBuf *blurbuf, *ref_use;
-	register float sum, val;
-	float rval, gval, bval, aval, radxf, radyf;
-	float **maintabs;
-	float *gausstabx, *gausstabcenty;
-	float *gausstaby, *gausstabcentx;
-	int radx, rady, imgx = img->x, imgy = img->y;
-	int x, y, pix = img->type;
-	int i, j;
-	float *src, *dest, *refd, *blurd;
-	float defcol[4] = {1.0f, 1.0f, 1.0f, 1.0f}; /* default color for compbuf_get_pixel */
-	float proccol[4];   /* local color if compbuf is procedural */
-	int refradx, refrady;
-
-	if (ref->x != img->x || ref->y != img->y)
-		return;
-	
-	ref_use = typecheck_compbuf(ref, CB_VAL);
-	
-	/* trick is; we blur the reference image... but only works with clipped values*/
-	blurbuf = alloc_compbuf(imgx, imgy, CB_VAL, 1);
-	blurbuf->xof = ref_use->xof;
-	blurbuf->yof = ref_use->yof;
-	blurd = blurbuf->rect;
-	refd = ref_use->rect;
-	for (x = imgx * imgy; x > 0; x--, refd++, blurd++) {
-		if (refd[0] < 0.0f) blurd[0] = 0.0f;
-		else if (refd[0] > 1.0f) blurd[0] = 1.0f;
-		else blurd[0] = refd[0];
-	}
-	
-	blur_single_image(node, blurbuf, blurbuf, 1.0f);
-	
-	/* horizontal */
-	radx = (float)nbd->sizex;
-	if (radx > imgx / 2)
-		radx = imgx / 2;
-	else if (radx < 1)
-		radx = 1;
-	
-	/* vertical */
-	rady = (float)nbd->sizey;
-	if (rady > imgy / 2)
-		rady = imgy / 2;
-	else if (rady < 1)
-		rady = 1;
-
-	x = MAX2(radx, rady);
-	maintabs = MEM_mallocN(x * sizeof(void *), "gauss array");
-	for (i = 0; i < x; i++)
-		maintabs[i] = make_gausstab(nbd->filtertype, i + 1);
-
-	dest = new->rect;
-	radxf = (float)radx;
-	radyf = (float)rady;
-	
-	for (y = 0; y < imgy; y++) {
-		for (x = 0; x < imgx; x++, dest += pix) {
-			refd = compbuf_get_pixel(blurbuf, defcol, proccol, x - blurbuf->xrad, y - blurbuf->yrad, blurbuf->xrad, blurbuf->yrad);
-			refradx = (int)(refd[0] * radxf);
-			refrady = (int)(refd[0] * radyf);
-
-			if (refradx > radx) refradx = radx;
-			else if (refradx < 1) refradx = 1;
-			if (refrady > rady) refrady = rady;
-			else if (refrady < 1) refrady = 1;
-
-			if (refradx == 1 && refrady == 1) {
-				src = img->rect + pix * (y * imgx + x);
-				if (pix == 1)
-					dest[0] = src[0];
-				else
-					copy_v4_v4(dest, src);
-			}
-			else {
-				int minxr = x - refradx < 0 ? -x : -refradx;
-				int maxxr = x + refradx > imgx ? imgx - x : refradx;
-				int minyr = y - refrady < 0 ? -y : -refrady;
-				int maxyr = y + refrady > imgy ? imgy - y : refrady;
-
-				float *srcd = img->rect + pix * ( (y + minyr) * imgx + x + minxr);
-
-				gausstabx = maintabs[refradx - 1];
-				gausstabcentx = gausstabx + refradx;
-				gausstaby = maintabs[refrady - 1];
-				gausstabcenty = gausstaby + refrady;
-
-				sum = gval = rval = bval = aval = 0.0f;
-
-				for (i = minyr; i < maxyr; i++, srcd += pix * imgx) {
-					src = srcd;
-					for (j = minxr; j < maxxr; j++, src += pix) {
-					
-						val = gausstabcenty[i] * gausstabcentx[j];
-						sum += val;
-						rval += val * src[0];
-						if (pix > 1) {
-							gval += val * src[1];
-							bval += val * src[2];
-							aval += val * src[3];
-						}
-					}
-				}
-				sum = 1.0f / sum;
-				dest[0] = rval * sum;
-				if (pix > 1) {
-					dest[1] = gval * sum;
-					dest[2] = bval * sum;
-					dest[3] = aval * sum;
-				}
-			}
-		}
-		if (node->exec & NODE_BREAK)
-			break;
-	}
-	
-	free_compbuf(blurbuf);
-	
-	x = MAX2(radx, rady);
-	for (i = 0; i < x; i++)
-		MEM_freeN(maintabs[i]);
-	MEM_freeN(maintabs);
-	
-	if (ref_use != ref)
-		free_compbuf(ref_use);
-}
-
-static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *new, *img = in[0]->data;
-	NodeBlurData *nbd = node->storage;
-	
-	if (img == NULL) return;
-	
-	/* store image in size that is needed for absolute/relative conversions on ui level */
-	nbd->image_in_width = img->x;
-	nbd->image_in_height = img->y;
-	
-	if (out[0]->hasoutput == 0) return;
-	
-	if (nbd->relative) {
-		if (nbd->aspect == CMP_NODE_BLUR_ASPECT_NONE) {
-			nbd->sizex = (int)(nbd->percentx * 0.01f * nbd->image_in_width);
-			nbd->sizey = (int)(nbd->percenty * 0.01f * nbd->image_in_height);
-		}
-		else if (nbd->aspect == CMP_NODE_BLUR_ASPECT_Y) {
-			nbd->sizex = (int)(nbd->percentx * 0.01f * nbd->image_in_width);
-			nbd->sizey = (int)(nbd->percenty * 0.01f * nbd->image_in_width);
-		}
-		else if (nbd->aspect == CMP_NODE_BLUR_ASPECT_X) {
-			nbd->sizex = (int)(nbd->percentx * 0.01f * nbd->image_in_height);
-			nbd->sizey = (int)(nbd->percenty * 0.01f * nbd->image_in_height);
-		}
-	}
-
-	if (nbd->sizex == 0 && nbd->sizey == 0) {
-		new = pass_on_compbuf(img);
-		out[0]->data = new;
-	}
-	else if (nbd->filtertype == R_FILTER_FAST_GAUSS) {
-		if (in[1]->vec[0] < 0.001f) { /* time node inputs can be a tiny value */
-			new = pass_on_compbuf(img);
-		}
-		else {
-			// TODO: can this be mapped with reference, too?
-			const float sx = ((float)nbd->sizex * in[1]->vec[0]) / 2.0f, sy = ((float)nbd->sizey * in[1]->vec[0]) / 2.0f;
-			int c;
-
-			if ((img == NULL) || (out[0]->hasoutput == 0)) return;
-
-			if (img->type == CB_VEC2)
-				new = typecheck_compbuf(img, CB_VAL);
-			else if (img->type == CB_VEC3)
-				new = typecheck_compbuf(img, CB_RGBA);
-			else
-				new = dupalloc_compbuf(img);
-
-			if ((sx == sy) && (sx > 0.f)) {
-				for (c = 0; c < new->type; ++c)
-					IIR_gauss(new, sx, c, 3);
-			}
-			else {
-				if (sx > 0.f) {
-					for (c = 0; c < new->type; ++c)
-						IIR_gauss(new, sx, c, 1);
-				}
-				if (sy > 0.f) {
-					for (c = 0; c < new->type; ++c)
-						IIR_gauss(new, sy, c, 2);
-				}
-			}
-		}
-		out[0]->data = new;
-	}
-	else {
-		/* All non fast gauss blur methods */
-		if (img->type == CB_VEC2 || img->type == CB_VEC3) {
-			img = typecheck_compbuf(in[0]->data, CB_RGBA);
-		}
-		
-		/* if fac input, we do it different */
-		if (in[1]->data) {
-			CompBuf *gammabuf;
-			
-			/* make output size of input image */
-			new = alloc_compbuf(img->x, img->y, img->type, 1); /* allocs */
-			
-			/* accept image offsets from other nodes */
-			new->xof = img->xof;
-			new->yof = img->yof;
-			
-			if (nbd->gamma) {
-				gammabuf = dupalloc_compbuf(img);
-				gamma_correct_compbuf(gammabuf, 0);
-			}
-			else gammabuf = img;
-			
-			blur_with_reference(node, new, gammabuf, in[1]->data);
-			
-			if (nbd->gamma) {
-				gamma_correct_compbuf(new, 1);
-				free_compbuf(gammabuf);
-			}
-			if (node->exec & NODE_BREAK) {
-				free_compbuf(new);
-				new = NULL;
-			}
-			out[0]->data = new;
-		}
-		else {
-			
-			if (in[1]->vec[0] <= 0.001f) {    /* time node inputs can be a tiny value */
-				new = pass_on_compbuf(img);
-			}
-			else {
-				CompBuf *gammabuf;
-				
-				/* make output size of input image */
-				new = alloc_compbuf(img->x, img->y, img->type, 1); /* allocs */
-				
-				/* accept image offsets from other nodes */
-				new->xof = img->xof;
-				new->yof = img->yof;
-					
-				if (nbd->gamma) {
-					gammabuf = dupalloc_compbuf(img);
-					gamma_correct_compbuf(gammabuf, 0);
-				}
-				else gammabuf = img;
-				
-				if (nbd->bokeh)
-					bokeh_single_image(node, new, gammabuf, in[1]->vec[0]);
-				else if (1)
-					blur_single_image(node, new, gammabuf, in[1]->vec[0]);
-				else  /* bloom experimental... */
-					bloom_with_reference(new, gammabuf, NULL, in[1]->vec[0], nbd);
-				
-				if (nbd->gamma) {
-					gamma_correct_compbuf(new, 1);
-					free_compbuf(gammabuf);
-				}
-				if (node->exec & NODE_BREAK) {
-					free_compbuf(new);
-					new = NULL;
-				}
-			}
-			out[0]->data = new;
-		}
-		if (img != in[0]->data)
-			free_compbuf(img);
-	}
-
-	generate_preview(data, node, out[0]->data);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_blur(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeBlurData *data = MEM_callocN(sizeof(NodeBlurData), "node blur data");
@@ -740,9 +60,6 @@ void register_node_type_cmp_blur(bNodeTreeType *ttype)
 	node_type_size(&ntype, 120, 80, 200);
 	node_type_init(&ntype, node_composit_init_blur);
 	node_type_storage(&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_blur);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_bokehimage.c b/source/blender/nodes/composite/nodes/node_composite_bokehimage.c
index 8324b77..fa21e12 100644
--- a/source/blender/nodes/composite/nodes/node_composite_bokehimage.c
+++ b/source/blender/nodes/composite/nodes/node_composite_bokehimage.c
@@ -36,7 +36,7 @@
 #include "../node_composite_util.h"
 
 /* **************** Bokeh image Tools  ******************** */
-  
+
 static bNodeSocketTemplate cmp_node_bokehimage_out[] = {
 	{	SOCK_RGBA, 0, N_("Image"),			0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
 	{	-1, 0, ""	}
diff --git a/source/blender/nodes/composite/nodes/node_composite_brightness.c b/source/blender/nodes/composite/nodes/node_composite_brightness.c
index ecf572f..719423e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_brightness.c
+++ b/source/blender/nodes/composite/nodes/node_composite_brightness.c
@@ -47,54 +47,6 @@ static bNodeSocketTemplate cmp_node_brightcontrast_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_brightnesscontrast(bNode *UNUSED(node), float *out, float *in, float *in_brightness, float *in_contrast)
-{
-	float i;
-	int c;
-	float a, b, v;
-	float brightness = (*in_brightness) / 100.0f;
-	float contrast = *in_contrast;
-	float delta = contrast / 200.0f;
-	a = 1.0f - delta * 2.0f;
-	/*
-	 * The algorithm is by Werner D. Streidt
-	 * (http://visca.com/ffactory/archives/5-99/msg00021.html)
-	 * Extracted of OpenCV demhist.c
-	 */
-	if (contrast > 0) {
-		a = 1.0f / a;
-		b = a * (brightness - delta);
-	}
-	else {
-		delta *= -1;
-		b = a * (brightness + delta);
-	}
-	
-	for (c=0; c<3; c++) {
-		i = in[c];
-		v = a*i + b;
-		out[c] = v;
-	}
-}
-
-static void node_composit_exec_brightcontrast(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (out[0]->hasoutput==0)
-		return;
-	
-	if (in[0]->data) {
-		CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
-		stackbuf= dupalloc_compbuf(cbuf);
-		composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, do_brightnesscontrast, CB_RGBA, CB_VAL, CB_VAL);
-		out[0]->data = stackbuf;
-		if (cbuf != in[0]->data)
-			free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
 
 void register_node_type_cmp_brightcontrast(bNodeTreeType *ttype)
 {
@@ -103,9 +55,6 @@ void register_node_type_cmp_brightcontrast(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_brightcontrast_in, cmp_node_brightcontrast_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_brightcontrast);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
index 40dbbbb..bfeeb7d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
@@ -34,164 +34,17 @@
 
 
 /* ******************* Channel Matte Node ********************************* */
-static bNodeSocketTemplate cmp_node_channel_matte_in[] ={
+static bNodeSocketTemplate cmp_node_channel_matte_in[] = {
 	{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
 	{-1, 0, ""}
 };
 
-static bNodeSocketTemplate cmp_node_channel_matte_out[] ={
+static bNodeSocketTemplate cmp_node_channel_matte_out[] = {
 	{SOCK_RGBA, 0, N_("Image")},
 	{SOCK_FLOAT, 0, N_("Matte")},
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_normalized_rgba_to_ycca2(bNode *UNUSED(node), float *out, float *in)
-{
-	/*normalize to the range 0.0 to 1.0) */
-	rgb_to_ycc(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
-	out[0]=(out[0])/255.0f;
-	out[1]=(out[1])/255.0f;
-	out[2]=(out[2])/255.0f;
-	out[3]=in[3];
-}
-
-static void do_normalized_ycca_to_rgba2(bNode *UNUSED(node), float *out, float *in)
-{
-	/*un-normalize the normalize from above */
-	in[0]=in[0]*255.0f;
-	in[1]=in[1]*255.0f;
-	in[2]=in[2]*255.0f;
-	ycc_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
-	out[3]=in[3];
-}
-
-
-static void do_channel_matte(bNode *node, float *out, float *in)
-{
-	NodeChroma *c=(NodeChroma *)node->storage;
-	float alpha=0.0;
-
-	switch (c->algorithm) {
-	case 0: { /* Alpha=key_channel-limit channel */
-		int key_channel=node->custom2-1;
-		int limit_channel=c->channel-1;
-		alpha=in[key_channel]-in[limit_channel];
-		break;
-	}
-	case 1: { /* Alpha=G-MAX(R, B) */
-		switch (node->custom2) {
-			case 1:
-			{
-				alpha=in[0]-MAX2(in[1], in[2]);
-				break;
-			}
-			case 2:
-			{
-				alpha=in[1]-MAX2(in[0], in[2]);
-				break;
-			}
-			case 3:
-			{
-				alpha=in[2]-MAX2(in[0], in[1]);
-				break;
-			}
-			default:
-				break;
-		}
-		break;
-	}
-	default:
-		break;
-	}
-
-	/*flip because 0.0 is transparent, not 1.0*/
-	alpha=1-alpha;
-	
-	/* test range*/
-	if (alpha>c->t1) {
-		alpha=in[3]; /*whatever it was prior */
-	}
-	else if (alpha<c->t2) {
-		alpha=0.0;
-	}
-	else {/*blend */
-		alpha=(alpha-c->t2)/(c->t1-c->t2);
-	}
-
-	
-	/* don't make something that was more transparent less transparent */
-	if (alpha<in[3]) {
-		out[3]=alpha;
-	}
-	else {
-		out[3]=in[3];
-	}
-}
-
-static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *cbuf;
-	CompBuf *outbuf;
-	
-	if (in[0]->hasinput==0) return;
-	if (in[0]->data==NULL) return;
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
-	
-	cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
-	
-	outbuf=dupalloc_compbuf(cbuf);
-	
-	/*convert to colorspace*/
-	switch (node->custom1) {
-	case CMP_NODE_CHANNEL_MATTE_CS_RGB:
-		break;
-	case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/
-		composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_hsva, CB_RGBA);
-		break;
-	case CMP_NODE_CHANNEL_MATTE_CS_YUV: /*YUV*/
-		composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_yuva, CB_RGBA);
-		break;
-	case CMP_NODE_CHANNEL_MATTE_CS_YCC: /*YCC*/
-		composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_normalized_rgba_to_ycca2, CB_RGBA);
-		break;
-	default:
-		break;
-	}
-
-	/*use the selected channel information to do the key */
-	composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_channel_matte, CB_RGBA);
-
-	/*convert back to RGB colorspace in place*/
-	switch (node->custom1) {
-	case CMP_NODE_CHANNEL_MATTE_CS_RGB: /*RGB*/
-		break;
-	case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/
-		composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_hsva_to_rgba, CB_RGBA);
-		break;
-	case CMP_NODE_CHANNEL_MATTE_CS_YUV: /*YUV*/
-		composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_yuva_to_rgba, CB_RGBA);
-		break;
-	case CMP_NODE_CHANNEL_MATTE_CS_YCC: /*YCC*/
-		composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_normalized_ycca_to_rgba2, CB_RGBA);
-		break;
-	default:
-		break;
-	}
-
-	generate_preview(data, node, outbuf);
-	out[0]->data=outbuf;
-	if (out[1]->hasoutput)
-		out[1]->data=valbuf_from_rgbabuf(outbuf, CHAN_A);
-
-	if (cbuf!=in[0]->data)
-		free_compbuf(cbuf);
-
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_channel_matte(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
@@ -216,9 +69,6 @@ void register_node_type_cmp_channel_matte(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 80, 250);
 	node_type_init(&ntype, node_composit_init_channel_matte);
 	node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_channel_matte);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
index f343f80..83c8bbc 100644
--- a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
@@ -45,136 +45,6 @@ static bNodeSocketTemplate cmp_node_chroma_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_rgba_to_ycca_normalized(bNode *UNUSED(node), float *out, float *in)
-{
-	rgb_to_ycc(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
-
-	//normalize to 0..1.0
-	out[0]=out[0]/255.0f;
-	out[1]=out[1]/255.0f;
-	out[2]=out[2]/255.0f;
-
-	//rescale to -1.0..1.0
-	out[0]=(out[0]*2.0f)-1.0f;
-	out[1]=(out[1]*2.0f)-1.0f;
-	out[2]=(out[2]*2.0f)-1.0f;
-
-	//	out[0]=((out[0])-16)/255.0;
-	//	out[1]=((out[1])-128)/255.0;
-	//	out[2]=((out[2])-128)/255.0;
-	out[3]=in[3];
-}
-
-static void do_ycca_to_rgba_normalized(bNode *UNUSED(node), float *out, float *in)
-{
-	/*un-normalize the normalize from above */
-	in[0]=(in[0]+1.0f)/2.0f;
-	in[1]=(in[1]+1.0f)/2.0f;
-	in[2]=(in[2]+1.0f)/2.0f;
-
-	in[0]=(in[0]*255.0f);
-	in[1]=(in[1]*255.0f);
-	in[2]=(in[2]*255.0f);
-
-	//	in[0]=(in[0]*255.0)+16;
-	//	in[1]=(in[1]*255.0)+128;
-	//	in[2]=(in[2]*255.0)+128;
-	ycc_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
-	out[3]=in[3];
-}
-
-static void do_chroma_key(bNode *node, float *out, float *in)
-{
-	NodeChroma *c;
-	float x, z, alpha;
-	float theta, beta, angle, angle2;
-	float kfg;
-
-	c=node->storage;
-
-	/* Algorithm from book "Video Demistified," does not include the spill reduction part */
-
-	/* find theta, the angle that the color space should be rotated based on key chroma values*/
-	theta=atan2(c->key[2], c->key[1]);
-
-	/*rotate the cb and cr into x/z space */
-	x=in[1]*cosf(theta)+in[2]*sinf(theta);
-	z=in[2]*cosf(theta)-in[1]*sinf(theta);
-
-	/*if within the acceptance angle */
-	angle=c->t1; /* t1 is radians. */
-
-	/* if kfg is <0 then the pixel is outside of the key color */
-	kfg= x-(fabsf(z)/tanf(angle/2.0f));
-
-	copy_v3_v3(out, in);
-
-	if (kfg>0.0f) {  /* found a pixel that is within key color */
-		beta=atan2(z, x);
-		angle2=c->t2; /* t2 is radians. */
-
-		/* if beta is within the cutoff angle */
-		if (fabsf(beta) < (angle2/2.0f)) {
-			alpha=0.0;
-		}
-		else {
-			alpha=1.0f-(kfg/c->fstrength);
-		}
-
-		/* don't make something that was more transparent less transparent */
-		if (alpha<in[3]) {
-			out[3]=alpha;
-		}
-		else {
-			out[3]=in[3];
-		}
-	}
-	else { /* make pixel just as transparent as it was before */
-		out[3]=in[3];
-	}
-}
-
-static void node_composit_exec_chroma_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *cbuf;
-	CompBuf *chromabuf;
-	NodeChroma *c;
-
-	if (in[0]->hasinput==0) return;
-	if (in[0]->data==NULL) return;
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
-
-	cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
-
-	chromabuf= dupalloc_compbuf(cbuf);
-
-	c=node->storage;
-
-	/*convert rgbbuf to normalized chroma space*/
-	composit1_pixel_processor(node, chromabuf, cbuf, in[0]->vec, do_rgba_to_ycca_normalized, CB_RGBA);
-	/*convert key to normalized chroma color space */
-	do_rgba_to_ycca_normalized(node, c->key, in[1]->vec);
-
-	/*per pixel chroma key*/
-	composit1_pixel_processor(node, chromabuf, chromabuf, in[0]->vec, do_chroma_key, CB_RGBA);
-
-	/*convert back*/
-	composit1_pixel_processor(node, chromabuf, chromabuf, in[0]->vec, do_ycca_to_rgba_normalized, CB_RGBA);
-
-	out[0]->data= chromabuf;
-	if (out[1]->hasoutput)
-		out[1]->data= valbuf_from_rgbabuf(chromabuf, CHAN_A);
-
-	generate_preview(data, node, chromabuf);
-
-	if (cbuf!=in[0]->data)
-		free_compbuf(cbuf);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_chroma_matte(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
@@ -195,9 +65,6 @@ void register_node_type_cmp_chroma_matte(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 80, 300);
 	node_type_init(&ntype, node_composit_init_chroma_matte);
 	node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_chroma_matte);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
index 07a6647..1642d92 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
@@ -45,77 +45,6 @@ static bNodeSocketTemplate cmp_node_color_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_color_key(bNode *node, float *out, float *in)
-{
-	float h_wrap;
-	NodeChroma *c;
-	c=node->storage;
-
-
-	copy_v3_v3(out, in);
-
-	if (
-	/* do hue last because it needs to wrap, and does some more checks  */
-
-	/* sat */	(fabsf(in[1]-c->key[1]) < c->t2) &&
-	/* val */	(fabsf(in[2]-c->key[2]) < c->t3) &&
-
-	/* multiply by 2 because it wraps on both sides of the hue,
-	 * otherwise 0.5 would key all hue's */
-
-	/* hue */	((h_wrap= 2.0f * fabsf(in[0]-c->key[0])) < c->t1 || (2.0f - h_wrap) < c->t1)
-	) {
-		out[3]=0.0; /*make transparent*/
-	}
-
-	else { /*pixel is outside key color */
-		out[3]=in[3]; /* make pixel just as transparent as it was before */
-	}
-}
-
-static void node_composit_exec_color_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *cbuf;
-	CompBuf *colorbuf;
-	NodeChroma *c;
-	
-	if (in[0]->hasinput==0) return;
-	if (in[0]->data==NULL) return;
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
-	
-	cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
-	
-	colorbuf= dupalloc_compbuf(cbuf);
-	
-	c=node->storage;
-	
-	/*convert rgbbuf to hsv*/
-	composit1_pixel_processor(node, colorbuf, cbuf, in[0]->vec, do_rgba_to_hsva, CB_RGBA);
-	
-	/*convert key to hsv*/
-	do_rgba_to_hsva(node, c->key, in[1]->vec);
-	
-
-	/*per pixel color key*/
-	composit1_pixel_processor(node, colorbuf, colorbuf, in[0]->vec, do_color_key, CB_RGBA);
-	
-	/*convert back*/
-	composit1_pixel_processor(node, colorbuf, colorbuf, in[0]->vec, do_hsva_to_rgba, CB_RGBA);
-	
-	out[0]->data= colorbuf;
-	if (out[1]->hasoutput)
-		out[1]->data= valbuf_from_rgbabuf(colorbuf, CHAN_A);
-	
-	generate_preview(data, node, colorbuf);
-
-	if (cbuf!=in[0]->data)
-		free_compbuf(cbuf);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_color_matte(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node color");
@@ -136,9 +65,6 @@ void register_node_type_cmp_color_matte(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 80, 300);
 	node_type_init(&ntype, node_composit_init_color_matte);
 	node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_color_matte);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
index 44a5ac9..3679a65 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
@@ -43,281 +43,6 @@ static bNodeSocketTemplate cmp_node_color_spill_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-#define AVG(a, b) ((a + b) / 2)
-
-
-static void do_simple_spillmap_red(bNode *node, float* out, float *in)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	out[0]=in[0]-( ncs->limscale * in[ncs->limchan] );
-}
-
-static void do_simple_spillmap_red_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-
-	out[0] = *fac * (in[0]-( ncs->limscale * in[ncs->limchan]));
-}
-
-static void do_simple_spillmap_green(bNode *node, float* out, float *in)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	out[0]=in[1]-( ncs->limscale * in[ncs->limchan] );
-}
-
-static void do_simple_spillmap_green_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-
-	out[0] = *fac * (in[1]-( ncs->limscale * in[ncs->limchan]));
-}
-
-static void do_simple_spillmap_blue(bNode *node, float* out, float *in)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	out[0]=in[2]-( ncs->limscale * in[ncs->limchan] );
-}
-
-static void do_simple_spillmap_blue_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-
-	out[0] = *fac * (in[2]-( ncs->limscale * in[ncs->limchan]));
-}
-
-static void do_average_spillmap_red(bNode *node, float* out, float *in)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	out[0]=in[0]-(ncs->limscale * AVG(in[1], in[2]) );
-}
-
-static void do_average_spillmap_red_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-
-	out[0] = *fac * (in[0]-(ncs->limscale * AVG(in[1], in[2]) ));
-}
-
-static void do_average_spillmap_green(bNode *node, float* out, float *in)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	out[0]=in[1]-(ncs->limscale * AVG(in[0], in[2]) );
-}
-
-static void do_average_spillmap_green_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-
-	out[0] = *fac * (in[0]-(ncs->limscale * AVG(in[0], in[2]) ));
-}
-
-static void do_average_spillmap_blue(bNode *node, float* out, float *in)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	out[0]=in[2]-(ncs->limscale * AVG(in[0], in[1]) );
-}
-
-static void do_average_spillmap_blue_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-
-	out[0] = *fac * (in[0]-(ncs->limscale * AVG(in[0], in[1]) ));
-}
-
-static void do_apply_spillmap_red(bNode *node, float* out, float *in, float *map)
-{	
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	if (map[0]>0) {
-		out[0]=in[0]-(ncs->uspillr*map[0]);
-		out[1]=in[1]+(ncs->uspillg*map[0]);
-		out[2]=in[2]+(ncs->uspillb*map[0]);
-	}
-	else {
-		out[0]=in[0];
-		out[1]=in[1];
-		out[2]=in[2];
-	}
-}
-
-static void do_apply_spillmap_green(bNode *node, float* out, float *in, float *map)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	if (map[0]>0) {
-		out[0]=in[0]+(ncs->uspillr*map[0]);
-		out[1]=in[1]-(ncs->uspillg*map[0]);
-		out[2]=in[2]+(ncs->uspillb*map[0]);
-	}
-	else {
-		out[0]=in[0];
-		out[1]=in[1];
-		out[2]=in[2];
-	}
-}
-
-static void do_apply_spillmap_blue(bNode *node, float* out, float *in, float *map)
-{
-	NodeColorspill *ncs;
-	ncs=node->storage;
-	if (map[0]>0) {
-		out[0]=in[0]+(ncs->uspillr*map[0]);
-		out[1]=in[1]+(ncs->uspillg*map[0]);
-		out[2]=in[2]-(ncs->uspillb*map[0]);
-	}
-	else {
-		out[0]=in[0];
-		out[1]=in[1];
-		out[2]=in[2];
-	}
-}
-
-static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* Originally based on the information from the book "The Art and Science of Digital Composition" and
-	 * discussions from vfxtalk.com .*/
-	CompBuf *cbuf;
-	/* CompBuf *mask; */ /* UNUSED */
-	CompBuf *rgbbuf;
-	CompBuf *spillmap;
-	NodeColorspill *ncs;
-	ncs=node->storage;
-
-	/* early out for missing connections */
-	if (out[0]->hasoutput==0 ) return;
-	if (in[0]->hasinput==0) return;
-	if (in[0]->data==NULL) return;
-	
-	cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
-	/* mask= */ /* UNUSED */ typecheck_compbuf(in[1]->data, CB_VAL);
-	spillmap=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
-	rgbbuf=dupalloc_compbuf(cbuf);
-
-	switch (node->custom1) {
-		case 1:  /*red spill*/
-		{
-			switch (node->custom2) {
-				case 0: /* simple limit */
-				{
-					if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
-						composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_red, CB_RGBA);
-					}
-					else {
-						composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_red_fac, CB_RGBA,  CB_VAL);
-					}
-					break;
-				}
-				case 1: /* average limit */
-				{
-					if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
-						composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_red, CB_RGBA);
-					}
-					else {
-						composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_red_fac, CB_RGBA,  CB_VAL);
-					}
-					break;
-				}
-			}
-			if (ncs->unspill==0) {
-				ncs->uspillr=1.0f;
-				ncs->uspillg=0.0f;
-				ncs->uspillb=0.0f;
-			}
-			composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_red, CB_RGBA, CB_VAL);
-			break;
-		}
-		case 2: /*green spill*/
-		{
-			switch (node->custom2) {
-				case 0: /* simple limit */
-				{
-					if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
-						composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_green, CB_RGBA);
-					}
-					else {
-						composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_green_fac, CB_RGBA,  CB_VAL);
-					}
-					break;
-				}
-				case 1: /* average limit */
-				{
-					if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
-						composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_green, CB_RGBA);
-					}
-					else {
-						composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_green_fac, CB_RGBA,  CB_VAL);
-					}
-					break;
-				}
-			}
-			if (ncs->unspill==0) {
-				ncs->uspillr=0.0f;
-				ncs->uspillg=1.0f;
-				ncs->uspillb=0.0f;
-			}
-			composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_green, CB_RGBA, CB_VAL);
-			break;
-		}
-		case 3: /*blue spill*/
-		{
-			switch (node->custom2) {
-				case 0: /* simple limit */
-				{
-					if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
-						composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_blue, CB_RGBA);
-					}
-					else {
-						composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_blue_fac, CB_RGBA,  CB_VAL);
-					}
-					break;
-				}
-				case 1: /* average limit */
-				{
-					if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
-						composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_blue, CB_RGBA);
-					}
-					else {
-						composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_blue_fac, CB_RGBA,  CB_VAL);
-					}
-					break;
-				}
-			}
-			if (ncs->unspill==0) {
-				ncs->uspillr=0.0f;
-				ncs->uspillg=0.0f;
-				ncs->uspillb=1.0f;
-			}
-			composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_blue, CB_RGBA, CB_VAL);
-			break;
-		}
-		default:
-			break;
-	}
-
-	out[0]->data=rgbbuf;
-
-	if (cbuf!=in[0]->data)
-		free_compbuf(cbuf);
-
-	free_compbuf(spillmap);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_color_spill(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeColorspill *ncs= MEM_callocN(sizeof(NodeColorspill), "node colorspill");
@@ -338,9 +63,6 @@ void register_node_type_cmp_color_spill(bNodeTreeType *ttype)
 	node_type_size(&ntype, 140, 80, 200);
 	node_type_init(&ntype, node_composit_init_color_spill);
 	node_type_storage(&ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_color_spill);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
index df49e53..da9ce64 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
@@ -46,138 +46,6 @@ static bNodeSocketTemplate cmp_node_colorbalance_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* this function implements ASC-CDL according to the spec at http://www.asctech.org/
- * Slope
- *       S = in * slope
- * Offset
- *       O = S + offset
- *         = (in * slope) + offset
- * Power
- *     out = Clamp(O) ^ power
- *         = Clamp((in * slope) + offset) ^ power
- */
-DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slope)
-{
-	float x = in * slope + offset;
-	
-	/* prevent NaN */
-	CLAMP(x, 0.0f, 1.0f);
-	
-	return powf(x, power);
-}
-
-/* note: lift_lgg is just 2-lift, gamma_inv is 1.0/gamma */
-DO_INLINE float colorbalance_lgg(float in, float lift_lgg, float gamma_inv, float gain)
-{
-	/* 1:1 match with the sequencer with linear/srgb conversions, the conversion isn't pretty
-	 * but best keep it this way, since testing for durian shows a similar calculation
-	 * without lin/srgb conversions gives bad results (over-saturated shadows) with colors
-	 * slightly below 1.0. some correction can be done but it ends up looking bad for shadows or lighter tones - campbell */
-	float x= (((linearrgb_to_srgb(in) - 1.0f) * lift_lgg) + 1.0f) * gain;
-
-	/* prevent NaN */
-	if (x < 0.f) x = 0.f;
-
-	return powf(srgb_to_linearrgb(x), gamma_inv);
-}
-
-static void do_colorbalance_cdl(bNode *node, float* out, float *in)
-{
-	NodeColorBalance *n= (NodeColorBalance *)node->storage;
-	
-	out[0] = colorbalance_cdl(in[0], n->lift[0], n->gamma[0], n->gain[0]);
-	out[1] = colorbalance_cdl(in[1], n->lift[1], n->gamma[1], n->gain[1]);
-	out[2] = colorbalance_cdl(in[2], n->lift[2], n->gamma[2], n->gain[2]);
-	out[3] = in[3];
-}
-
-static void do_colorbalance_cdl_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorBalance *n= (NodeColorBalance *)node->storage;
-	const float mfac= 1.0f - *fac;
-	
-	out[0] = mfac*in[0] + *fac * colorbalance_cdl(in[0], n->lift[0], n->gamma[0], n->gain[0]);
-	out[1] = mfac*in[1] + *fac * colorbalance_cdl(in[1], n->lift[1], n->gamma[1], n->gain[1]);
-	out[2] = mfac*in[2] + *fac * colorbalance_cdl(in[2], n->lift[2], n->gamma[2], n->gain[2]);
-	out[3] = in[3];
-}
-
-static void do_colorbalance_lgg(bNode *node, float* out, float *in)
-{
-	NodeColorBalance *n= (NodeColorBalance *)node->storage;
-
-	out[0] = colorbalance_lgg(in[0], n->lift_lgg[0], n->gamma_inv[0], n->gain[0]);
-	out[1] = colorbalance_lgg(in[1], n->lift_lgg[1], n->gamma_inv[1], n->gain[1]);
-	out[2] = colorbalance_lgg(in[2], n->lift_lgg[2], n->gamma_inv[2], n->gain[2]);
-	out[3] = in[3];
-}
-
-static void do_colorbalance_lgg_fac(bNode *node, float* out, float *in, float *fac)
-{
-	NodeColorBalance *n= (NodeColorBalance *)node->storage;
-	const float mfac= 1.0f - *fac;
-
-	out[0] = mfac*in[0] + *fac * colorbalance_lgg(in[0], n->lift_lgg[0], n->gamma_inv[0], n->gain[0]);
-	out[1] = mfac*in[1] + *fac * colorbalance_lgg(in[1], n->lift_lgg[1], n->gamma_inv[1], n->gain[1]);
-	out[2] = mfac*in[2] + *fac * colorbalance_lgg(in[2], n->lift_lgg[2], n->gamma_inv[2], n->gain[2]);
-	out[3] = in[3];
-}
-
-static void node_composit_exec_colorbalance(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *cbuf= in[1]->data;
-	CompBuf *stackbuf;
-	
-	/* stack order input:  fac, image */
-	/* stack order output: image */
-	if (out[0]->hasoutput==0) return;
-	
-	if (in[0]->vec[0] == 0.f && in[0]->data == NULL) {
-		out[0]->data = pass_on_compbuf(cbuf);
-		return;
-	}
-
-	{
-		NodeColorBalance *n= (NodeColorBalance *)node->storage;
-		int c;
-
-		for (c = 0; c < 3; c++) {
-			n->lift_lgg[c] = 2.0f - n->lift[c];
-			n->gamma_inv[c] = (n->gamma[c] != 0.0f) ? 1.0f/n->gamma[c] : 1000000.0f;
-		}
-	}
-
-	if (cbuf) {
-		stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* create output based on image input */
-			
-		if (node->custom1 == 0) {
-			/* lift gamma gain */
-			if ((in[0]->data==NULL) && (in[0]->vec[0] >= 1.f)) {
-				composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_colorbalance_lgg, CB_RGBA);
-			}
-			else {
-				composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_colorbalance_lgg_fac, CB_RGBA, CB_VAL);
-			}
-		}
-		else {
-			/* offset/power/slope : ASC-CDL */
-			if ((in[0]->data==NULL) && (in[0]->vec[0] >= 1.f)) {
-				composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_colorbalance_cdl, CB_RGBA);
-			}
-			else {
-				composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_colorbalance_cdl_fac, CB_RGBA, CB_VAL);
-			}
-			
-		}
-
-		out[0]->data=stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_colorbalance(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeColorBalance *n= node->storage= MEM_callocN(sizeof(NodeColorBalance), "node colorbalance");
@@ -196,9 +64,6 @@ void register_node_type_cmp_colorbalance(bNodeTreeType *ttype)
 	node_type_size(&ntype, 400, 200, 400);
 	node_type_init(&ntype, node_composit_init_colorbalance);
 	node_type_storage(&ntype, "NodeColorBalance", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_colorbalance);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_common.c b/source/blender/nodes/composite/nodes/node_composite_common.c
index 10b81cd..7198798 100644
--- a/source/blender/nodes/composite/nodes/node_composite_common.c
+++ b/source/blender/nodes/composite/nodes/node_composite_common.c
@@ -32,187 +32,11 @@
 
 #include "DNA_node_types.h"
 
-#include "BKE_node.h"
-
 #include "node_composite_util.h"
 #include "node_common.h"
 #include "node_exec.h"
 
-#if 0
-static void PRINT_BUFFERS(bNodeTreeExec *exec)
-{
-	bNodeTree *ntree= exec->nodetree;
-	bNode *node;
-	bNodeSocket *sock;
-	bNodeStack *ns;
-	int i;
-	
-	printf("-------------- DEBUG --------------\n");
-	for (sock=ntree->inputs.first, i=0; sock; sock=sock->next, ++i) {
-		ns = node_get_socket_stack(exec->stack, sock);
-		printf("%d. Tree Input %s", i, sock->name);
-		if (ns->external)
-			printf(" (external)");
-		printf(": data=%p\n", ns->data);
-	}
-	for (sock=ntree->outputs.first, i=0; sock; sock=sock->next, ++i) {
-		ns = node_get_socket_stack(exec->stack, sock);
-		printf("%d. Tree Output %s", i, sock->name);
-		if (ns->external)
-			printf(" (external)");
-		printf(": data=%p\n", ns->data);
-	}
-	for (node=ntree->nodes.first; node; node=node->next) {
-		printf("Node %s:\n", node->name);
-		for (sock=node->inputs.first, i=0; sock; sock=sock->next, ++i) {
-			ns = node_get_socket_stack(exec->stack, sock);
-			printf("\t%d. Input %s", i, sock->name);
-			if (ns->external)
-				printf(" (external)");
-			printf(": data=%p\n", ns->data);
-		}
-		for (sock=node->outputs.first, i=0; sock; sock=sock->next, ++i) {
-			ns = node_get_socket_stack(exec->stack, sock);
-			printf("\t%d. Output %s", i, sock->name);
-			if (ns->external)
-				printf(" (external)");
-			printf(": data=%p\n", ns->data);
-		}
-	}
-}
-#endif
-
-static void copy_stack(bNodeStack *to, bNodeStack *from)
-{
-	if (to != from) {
-		copy_v4_v4(to->vec, from->vec);
-		to->data = from->data;
-		to->datatype = from->datatype;
-
-		/* tag as copy to prevent freeing */
-		to->is_copy = 1;
-	}
-}
-
-static void move_stack(bNodeStack *to, bNodeStack *from)
-{
-	if (to != from) {
-		copy_v4_v4(to->vec, from->vec);
-		to->data = from->data;
-		to->datatype = from->datatype;
-		to->is_copy = from->is_copy;
-
-		zero_v4(from->vec);
-		from->data = NULL;
-		from->datatype = 0;
-		from->is_copy = 0;
-	}
-}
-
-/**** GROUP ****/
-
-static void *group_initexec(bNode *node)
-{
-	bNodeTree *ngroup = (bNodeTree *)node->id;
-	bNodeTreeExec *exec;
-	bNodeSocket *sock;
-	bNodeStack *ns;
-
-	if (!ngroup)
-		return NULL;
-
-	/* initialize the internal node tree execution */
-	exec = ntreeCompositBeginExecTree(ngroup, 0);
-
-	/* tag group outputs as external to prevent freeing */
-	for (sock = ngroup->outputs.first; sock; sock = sock->next) {
-		if (!(sock->flag & SOCK_INTERNAL)) {
-			ns = node_get_socket_stack(exec->stack, sock);
-			ns->external = 1;
-		}
-	}
-
-	return exec;
-}
-
-static void group_freeexec(bNode *UNUSED(node), void *nodedata)
-{
-	bNodeTreeExec *gexec = (bNodeTreeExec *)nodedata;
-
-	if (gexec)
-		ntreeCompositEndExecTree(gexec, 0);
-}
-
-/* Copy inputs to the internal stack.
- * This is a shallow copy, no buffers are duplicated here!
- */
-static void group_copy_inputs(bNode *node, bNodeStack **in, bNodeStack *gstack)
-{
-	bNodeSocket *sock;
-	bNodeStack *ns;
-	int a;
-	for (sock=node->inputs.first, a=0; sock; sock=sock->next, ++a) {
-		if (sock->groupsock) {
-			ns = node_get_socket_stack(gstack, sock->groupsock);
-			copy_stack(ns, in[a]);
-		}
-	}
-}
-
-/* Copy internal results to the external outputs.
- */
-static void group_move_outputs(bNode *node, bNodeStack **out, bNodeStack *gstack)
-{
-	bNodeSocket *sock;
-	bNodeStack *ns;
-	int a;
-	for (sock = node->outputs.first, a = 0; sock; sock = sock->next, ++a) {
-		if (sock->groupsock) {
-			ns = node_get_socket_stack(gstack, sock->groupsock);
-			move_stack(out[a], ns);
-		}
-	}
-}
-
-/* Free internal buffers */
-static void group_free_internal(bNodeTreeExec *gexec)
-{
-	bNodeStack *ns;
-	int i;
-
-	for (i = 0, ns = gexec->stack; i < gexec->stacksize; ++i, ++ns) {
-		if (!ns->external && !ns->is_copy) {
-			if (ns->data) {
-#ifdef WITH_COMPOSITOR_LEGACY
-				free_compbuf(ns->data);
-#endif
-				ns->data = NULL;
-			}
-		}
-	}
-}
-
-static void group_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out)
-{
-	bNodeTreeExec *exec= (bNodeTreeExec *)nodedata;
-	
-	if (!exec)
-		return;
-	
-	/* XXX same behavior as trunk: all nodes inside group are executed.
-	 * it's stupid, but just makes it work. compo redesign will do this better.
-	 */
-	{
-		bNode *inode;
-		for (inode=exec->nodetree->nodes.first; inode; inode=inode->next)
-			inode->need_exec = 1;
-	}
-	
-	group_copy_inputs(node, in, exec->stack);
-	ntreeExecNodes(exec, data, thread);
-	group_free_internal(exec);
-	group_move_outputs(node, out, exec->stack);
-}
+#include "BKE_node.h"
 
 void register_node_type_cmp_group(bNodeTreeType *ttype)
 {
@@ -227,7 +51,7 @@ void register_node_type_cmp_group(bNodeTreeType *ttype)
 	node_type_template(&ntype, node_group_template);
 	node_type_update(&ntype, NULL, node_group_verify);
 	node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
-	node_type_exec_new(&ntype, group_initexec, group_freeexec, group_execute);
 
 	nodeRegisterType(ttype, &ntype);
 }
+
diff --git a/source/blender/nodes/composite/nodes/node_composite_composite.c b/source/blender/nodes/composite/nodes/node_composite_composite.c
index cb932b6..6cff403 100644
--- a/source/blender/nodes/composite/nodes/node_composite_composite.c
+++ b/source/blender/nodes/composite/nodes/node_composite_composite.c
@@ -39,75 +39,13 @@ static bNodeSocketTemplate cmp_node_composite_in[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* applies to render pipeline */
-static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
-{
-	/* image assigned to output */
-	/* stack order input sockets: col, alpha, z */
-	
-	if (node->flag & NODE_DO_OUTPUT) {	/* only one works on out */
-		Scene *scene= (Scene *)node->id;
-		RenderData *rd= data;
-		
-		if (scene && (rd->scemode & R_DOCOMP)) {
-			Render *re= RE_GetRender(scene->id.name);
-			RenderResult *rr= RE_AcquireResultWrite(re); 
-			if (rr) {
-				CompBuf *outbuf, *zbuf=NULL;
-				
-				if (rr->rectf) 
-					MEM_freeN(rr->rectf);
-				outbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 1);
-				
-				if (in[1]->data==NULL)
-					composit1_pixel_processor(node, outbuf, in[0]->data, in[0]->vec, do_copy_rgba, CB_RGBA);
-				else
-					composit2_pixel_processor(node, outbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_copy_a_rgba, CB_RGBA, CB_VAL);
-				
-				if (in[2]->data) {
-					if (rr->rectz) 
-						MEM_freeN(rr->rectz);
-					zbuf= alloc_compbuf(rr->rectx, rr->recty, CB_VAL, 1);
-					composit1_pixel_processor(node, zbuf, in[2]->data, in[2]->vec, do_copy_value, CB_VAL);
-					rr->rectz= zbuf->rect;
-					zbuf->malloc= 0;
-					free_compbuf(zbuf);
-				}
-				generate_preview(data, node, outbuf);
-				
-				/* we give outbuf to rr... */
-				rr->rectf= outbuf->rect;
-				outbuf->malloc= 0;
-				free_compbuf(outbuf);
-
-				/* signal for imageviewer to refresh (it converts to byte rects...) */
-				BKE_image_signal(BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"), NULL, IMA_SIGNAL_FREE);
-
-				RE_ReleaseResult(re);
-				return;
-			}
-			else
-				RE_ReleaseResult(re);
-		}
-	}
-	if (in[0]->data)
-		generate_preview(data, node, in[0]->data);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_composite(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
 
-	node_type_base(ttype, &ntype, CMP_NODE_COMPOSITE, "Composite", NODE_CLASS_OUTPUT, NODE_PREVIEW);
+	node_type_base(ttype, &ntype, CMP_NODE_COMPOSITE, "Composite", NODE_CLASS_OUTPUT, NODE_OPTIONS | NODE_PREVIEW);
 	node_type_socket_templates(&ntype, cmp_node_composite_in, NULL);
 	node_type_size(&ntype, 80, 60, 200);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_composite);
-#endif
 
 	/* Do not allow muting for this node. */
 	node_type_internal_links(&ntype, NULL);
diff --git a/source/blender/nodes/composite/nodes/node_composite_crop.c b/source/blender/nodes/composite/nodes/node_composite_crop.c
index ad51fae..90d48a5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_crop.c
+++ b/source/blender/nodes/composite/nodes/node_composite_crop.c
@@ -43,68 +43,6 @@ static bNodeSocketTemplate cmp_node_crop_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (in[0]->data) {
-		NodeTwoXYs *ntxy= node->storage;
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf;
-		int x, y;
-		float *srcfp, *outfp;
-		rcti outputrect;
-
-		if (node->custom2) {
-			ntxy->x1= cbuf->x* ntxy->fac_x1;
-			ntxy->x2= cbuf->x* ntxy->fac_x2;
-			ntxy->y1= cbuf->y* ntxy->fac_y1;
-			ntxy->y2= cbuf->y* ntxy->fac_y2;
-		}
-
-		/* check input image size */
-		if (cbuf->x <= ntxy->x1 + 1)
-			ntxy->x1= cbuf->x - 1;
-
-		if (cbuf->y <= ntxy->y1 + 1)
-			ntxy->y1= cbuf->y - 1;
-
-		if (cbuf->x <= ntxy->x2 + 1)
-			ntxy->x2= cbuf->x - 1;
-
-		if (cbuf->y <= ntxy->y2 + 1)
-			ntxy->y2= cbuf->y - 1;
-
-		/* figure out the minimums and maximums */
-		outputrect.xmax=MAX2(ntxy->x1, ntxy->x2) + 1;
-		outputrect.xmin=MIN2(ntxy->x1, ntxy->x2);
-		outputrect.ymax=MAX2(ntxy->y1, ntxy->y2) + 1;
-		outputrect.ymin=MIN2(ntxy->y1, ntxy->y2);
-
-		if (node->custom1) {
-			/* this option crops the image size too  */
-			stackbuf= get_cropped_compbuf(&outputrect, cbuf->rect, cbuf->x, cbuf->y, cbuf->type);
-		}
-		else {
-			/* this option won't crop the size of the image as well  */
-			/* allocate memory for the output image            */
-			stackbuf = alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1);
-
-			/* select the cropped part of the image and set it to the output */
-			for (y=outputrect.ymin; y<outputrect.ymax; y++) {
-				srcfp= cbuf->rect     + (y * cbuf->x     + outputrect.xmin) * cbuf->type;
-				outfp= stackbuf->rect + (y * stackbuf->x + outputrect.xmin) * stackbuf->type;
-				for (x=outputrect.xmin; x<outputrect.xmax; x++, outfp+= stackbuf->type, srcfp+= cbuf->type)
-							memcpy(outfp, srcfp, sizeof(float)*stackbuf->type);
-			}
-		}
-
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_crop(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeTwoXYs *nxy= MEM_callocN(sizeof(NodeTwoXYs), "node xy data");
@@ -124,9 +62,6 @@ void register_node_type_cmp_crop(bNodeTreeType *ttype)
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_crop);
 	node_type_storage(&ntype, "NodeTwoXYs", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_crop);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.c b/source/blender/nodes/composite/nodes/node_composite_curves.c
index a1999ec..9f40159 100644
--- a/source/blender/nodes/composite/nodes/node_composite_curves.c
+++ b/source/blender/nodes/composite/nodes/node_composite_curves.c
@@ -41,25 +41,6 @@ static bNodeSocketTemplate cmp_node_time_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	RenderData *rd= data;
-	/* stack order output: fac */
-	float fac= 0.0f;
-	
-	if (node->custom1 < node->custom2)
-		fac= (rd->cfra - node->custom1)/(float)(node->custom2-node->custom1);
-	
-	curvemapping_initialize(node->storage);
-	fac = curvemapping_evaluateF(node->storage, 0, fac);
-
-	out[0]->vec[0] = CLAMPIS(fac, 0.0f, 1.0f);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_curves_time(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->custom1= 1;
@@ -76,9 +57,6 @@ void register_node_type_cmp_curve_time(bNodeTreeType *ttype)
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_curves_time);
 	node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_curves_time);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -96,19 +74,6 @@ static bNodeSocketTemplate cmp_node_curve_vec_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_curve_vec(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order input:  vec */
-	/* stack order output: vec */
-
-	curvemapping_initialize(node->storage);
-	curvemapping_evaluate_premulRGBF(node->storage, out[0]->vec, in[0]->vec);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_curve_vec(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
@@ -123,9 +88,6 @@ void register_node_type_cmp_curve_vec(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 140, 320);
 	node_type_init(&ntype, node_composit_init_curve_vec);
 	node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_curve_vec);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -145,67 +107,6 @@ static bNodeSocketTemplate cmp_node_curve_rgb_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_curves(bNode *node, float *out, float *in)
-{
-	curvemapping_initialize(node->storage);
-	curvemapping_evaluate_premulRGBF(node->storage, out, in);
-	out[3] = in[3];
-}
-
-static void do_curves_fac(bNode *node, float *out, float *in, float *fac)
-{
-	curvemapping_initialize(node->storage);
-
-	if (*fac >= 1.0f)
-		curvemapping_evaluate_premulRGBF(node->storage, out, in);
-	else if (*fac <= 0.0f) {
-		copy_v3_v3(out, in);
-	}
-	else {
-		float col[4], mfac= 1.0f-*fac;
-		curvemapping_evaluate_premulRGBF(node->storage, col, in);
-		out[0] = mfac*in[0] + *fac*col[0];
-		out[1] = mfac*in[1] + *fac*col[1];
-		out[2] = mfac*in[2] + *fac*col[2];
-	}
-	out[3] = in[3];
-}
-
-static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order input:  fac, image, black level, white level */
-	/* stack order output: image */
-	
-	if (out[0]->hasoutput==0)
-		return;
-
-	curvemapping_initialize(node->storage);
-
-	/* input no image? then only color operation */
-	if (in[1]->data==NULL) {
-		curvemapping_evaluateRGBF(node->storage, out[0]->vec, in[1]->vec);
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf= in[1]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		
-		curvemapping_set_black_white(node->storage, in[2]->vec, in[3]->vec);
-		
-		if (in[0]->data==NULL && in[0]->vec[0] == 1.0f)
-			composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_curves, CB_RGBA);
-		else
-			composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_curves_fac, CB_RGBA, CB_VAL);
-		
-		out[0]->data= stackbuf;
-	}
-	
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -220,9 +121,6 @@ void register_node_type_cmp_curve_rgb(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 140, 320);
 	node_type_init(&ntype, node_composit_init_curve_rgb);
 	node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_curve_rgb);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.c b/source/blender/nodes/composite/nodes/node_composite_defocus.c
index 27ce0f7..88787cc 100644
--- a/source/blender/nodes/composite/nodes/node_composite_defocus.c
+++ b/source/blender/nodes/composite/nodes/node_composite_defocus.c
@@ -44,830 +44,6 @@ static bNodeSocketTemplate cmp_node_defocus_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-// line coefs for point sampling & scancon. data.
-typedef struct BokehCoeffs {
-	float x0, y0, dx, dy;
-	float ls_x, ls_y;
-	float min_x, min_y, max_x, max_y;
-} BokehCoeffs;
-
-// returns array of BokehCoeffs
-// returns length of array in 'len_bkh',
-// radius squared of inscribed disk in 'inradsq', needed in getWeight() test,
-// BKH[8] is the data returned for the bokeh shape & bkh_b[4] is it's 2d bound
-static void makeBokeh(char bktype, char ro, int* len_bkh, float* inradsq, BokehCoeffs BKH[8], float bkh_b[4])
-{
-	float x0, x1, y0, y1, dx, dy, iDxy;
-	/* ro now is in radians. */
-	float w = MAX2(1e-6f, ro);  // never reported stangely enough, but a zero offset causes missing center line...
-	float wi = DEG2RADF(360.f/bktype);
-	int i, ov, nv;
-	
-	// bktype must be at least 3 & <= 8
-	bktype = (bktype<3) ? 3 : ((bktype>8) ? 8 : bktype);
-	*len_bkh = bktype;
-	*inradsq = -1.f;
-
-	for (i=0; i<(*len_bkh); i++) {
-		x0 = cos(w);
-		y0 = sin(w);
-		w += wi;
-		x1 = cos(w);
-		y1 = sin(w);
-		if ((*inradsq)<0.f) {
-			// radius squared of inscribed disk
-			float idx=(x0+x1)*0.5f, idy=(y0+y1)*0.5f;
-			*inradsq = idx*idx + idy*idy;
-		}
-		BKH[i].x0 = x0;
-		BKH[i].y0 = y0;
-		dx = x1-x0, dy = y1-y0;
-		iDxy = 1.f / sqrtf(dx*dx + dy*dy);
-		dx *= iDxy;
-		dy *= iDxy;
-		BKH[i].dx = dx;
-		BKH[i].dy = dy;
-	}
-
-	// precalc scanconversion data
-	// bokeh bound, not transformed, for scanconvert
-	bkh_b[0] = bkh_b[2] = 1e10f;	// xmin/ymin
-	bkh_b[1] = bkh_b[3] = -1e10f;	// xmax/ymax
-	ov = (*len_bkh) - 1;
-	for (nv=0; nv<(*len_bkh); nv++) {
-		bkh_b[0] = MIN2(bkh_b[0], BKH[nv].x0);	// xmin
-		bkh_b[1] = MAX2(bkh_b[1], BKH[nv].x0);	// xmax
-		bkh_b[2] = MIN2(bkh_b[2], BKH[nv].y0);	// ymin
-		bkh_b[3] = MAX2(bkh_b[3], BKH[nv].y0);	// ymax
-		BKH[nv].min_x = MIN2(BKH[ov].x0, BKH[nv].x0);
-		BKH[nv].max_x = MAX2(BKH[ov].x0, BKH[nv].x0);
-		BKH[nv].min_y = MIN2(BKH[ov].y0, BKH[nv].y0);
-		BKH[nv].max_y = MAX2(BKH[ov].y0, BKH[nv].y0);
-		dy = BKH[nv].y0 - BKH[ov].y0;
-		BKH[nv].ls_x = (BKH[nv].x0 - BKH[ov].x0) / ((dy==0.f) ? 1.f : dy);
-		BKH[nv].ls_y = (BKH[nv].ls_x==0.f) ? 1.f : (1.f/BKH[nv].ls_x);
-		ov = nv;
-	}
-}
-
-// test if u/v inside shape & returns weight value
-static float getWeight(BokehCoeffs* BKH, int len_bkh, float u, float v, float rad, float inradsq)
-{
-	BokehCoeffs* bc = BKH;
-	float cdist, irad = (rad==0.f) ? 1.f : (1.f/rad);
-	u *= irad;
-	v *= irad;
- 
-	// early out test1: if point outside outer unit disk, it cannot be inside shape
-	cdist = u*u + v*v;
-	if (cdist>1.f) return 0.f;
-	
-	// early out test2: if point inside or on inner disk, point must be inside shape
-	if (cdist<=inradsq) return 1.f;
-	
-	while (len_bkh--) {
-		if ((bc->dy*(u - bc->x0) - bc->dx*(v - bc->y0)) > 0.f) return 0.f;
-		bc++;
-	}
-	return 1.f;
-}
-
-// QMC.seq. for sampling, A.Keller, EMS
-static float RI_vdC(unsigned int bits, unsigned int r)
-{
-	bits = ( bits << 16) | ( bits >> 16);
-	bits = ((bits & 0x00ff00ff) << 8) | ((bits & 0xff00ff00) >> 8);
-	bits = ((bits & 0x0f0f0f0f) << 4) | ((bits & 0xf0f0f0f0) >> 4);
-	bits = ((bits & 0x33333333) << 2) | ((bits & 0xcccccccc) >> 2);
-	bits = ((bits & 0x55555555) << 1) | ((bits & 0xaaaaaaaa) >> 1);
-	bits ^= r;
-	return (float)((double)bits / 4294967296.0);
-}
-
-// single channel IIR gaussian filtering
-// much faster than anything else, constant time independent of width
-// should extend to multichannel and make this a node, could be useful
-// note: this is an almost exact copy of 'IIR_gauss'
-static void IIR_gauss_single(CompBuf *buf, float sigma)
-{
-	double q, q2, sc, cf[4], tsM[9], tsu[3], tsv[3];
-	float *X, *Y, *W;
-	const unsigned int src_width = buf->x;
-	const unsigned int src_height = buf->y;
-	unsigned int i, x, y, sz;
-
-	// single channel only for now
-	if (buf->type != CB_VAL) return;
-
-	// <0.5 not valid, though can have a possibly useful sort of sharpening effect
-	if (sigma < 0.5f) return;
-	
-	// see "Recursive Gabor Filtering" by Young/VanVliet
-	// all factors here in double.prec. Required, because for single.prec it seems to blow up if sigma > ~200
-	if (sigma >= 3.556f)
-		q = 0.9804f * (sigma - 3.556f) + 2.5091f;
-	else // sigma >= 0.5
-		q = (0.0561f * sigma + 0.5784f) * sigma - 0.2568f;
-	q2 = q * q;
-	sc = (1.1668 + q) * (3.203729649  + (2.21566 + q) * q);
-	// no gabor filtering here, so no complex multiplies, just the regular coefs.
-	// all negated here, so as not to have to recalc Triggs/Sdika matrix
-	cf[1] = q * (5.788961737 + (6.76492 + 3.0 * q) * q) / sc;
-	cf[2] = -q2 * (3.38246 + 3.0 * q) / sc;
-	// 0 & 3 unchanged
-	cf[3] = q2 * q / sc;
-	cf[0] = 1.0 - cf[1] - cf[2] - cf[3];
-
-	// Triggs/Sdika border corrections,
-	// it seems to work, not entirely sure if it is actually totally correct,
-	// Besides J.M.Geusebroek's anigauss.c (see http://www.science.uva.nl/~mark),
-	// found one other implementation by Cristoph Lampert,
-	// but neither seem to be quite the same, result seems to be ok so far anyway.
-	// Extra scale factor here to not have to do it in filter,
-	// though maybe this had something to with the precision errors
-	sc = cf[0] / ((1.0 + cf[1] - cf[2] + cf[3]) * (1.0 - cf[1] - cf[2] - cf[3]) * (1.0 + cf[2] + (cf[1] - cf[3]) * cf[3]));
-	tsM[0] = sc * (-cf[3] * cf[1] + 1.0 - cf[3] * cf[3] - cf[2]);
-	tsM[1] = sc * ((cf[3] + cf[1]) * (cf[2] + cf[3] * cf[1]));
-	tsM[2] = sc * (cf[3] * (cf[1] + cf[3] * cf[2]));
-	tsM[3] = sc * (cf[1] + cf[3] * cf[2]);
-	tsM[4] = sc * (-(cf[2] - 1.0) * (cf[2] + cf[3] * cf[1]));
-	tsM[5] = sc * (-(cf[3] * cf[1] + cf[3] * cf[3] + cf[2] - 1.0) * cf[3]);
-	tsM[6] = sc * (cf[3] * cf[1] + cf[2] + cf[1] * cf[1] - cf[2] * cf[2]);
-	tsM[7] = sc * (cf[1] * cf[2] + cf[3] * cf[2] * cf[2] - cf[1] * cf[3] * cf[3] - cf[3] * cf[3] * cf[3] - cf[3] * cf[2] + cf[3]);
-	tsM[8] = sc * (cf[3] * (cf[1] + cf[3] * cf[2]));
-
-#define YVV(L)                                                                          \
-{                                                                                       \
-	W[0] = cf[0] * X[0] + cf[1] * X[0] + cf[2] * X[0] + cf[3] * X[0];                   \
-	W[1] = cf[0] * X[1] + cf[1] * W[0] + cf[2] * X[0] + cf[3] * X[0];                   \
-	W[2] = cf[0] * X[2] + cf[1] * W[1] + cf[2] * W[0] + cf[3] * X[0];                   \
-	for (i = 3; i < L; i++) {                                                           \
-		W[i] = cf[0] * X[i] + cf[1] * W[i - 1] + cf[2] * W[i - 2] + cf[3] * W[i - 3];   \
-	}                                                                                   \
-	tsu[0] = W[L - 1] - X[L - 1];                                                       \
-	tsu[1] = W[L - 2] - X[L - 1];                                                       \
-	tsu[2] = W[L - 3] - X[L - 1];                                                       \
-	tsv[0] = tsM[0] * tsu[0] + tsM[1] * tsu[1] + tsM[2] * tsu[2] + X[L - 1];            \
-	tsv[1] = tsM[3] * tsu[0] + tsM[4] * tsu[1] + tsM[5] * tsu[2] + X[L - 1];            \
-	tsv[2] = tsM[6] * tsu[0] + tsM[7] * tsu[1] + tsM[8] * tsu[2] + X[L - 1];            \
-	Y[L - 1] = cf[0] * W[L - 1] + cf[1] * tsv[0] + cf[2] * tsv[1] + cf[3] * tsv[2];     \
-	Y[L - 2] = cf[0] * W[L - 2] + cf[1] * Y[L - 1] + cf[2] * tsv[0] + cf[3] * tsv[1];   \
-	Y[L - 3] = cf[0] * W[L - 3] + cf[1] * Y[L - 2] + cf[2] * Y[L - 1] + cf[3] * tsv[0]; \
-	/* 'i != UINT_MAX' is really 'i >= 0', but necessary for unsigned int wrapping */   \
-	for (i = L - 4; i != UINT_MAX; i--) {                                               \
-		Y[i] = cf[0] * W[i] + cf[1] * Y[i + 1] + cf[2] * Y[i + 2] + cf[3] * Y[i + 3];   \
-	}                                                                                   \
-} (void)0
-
-	// intermediate buffers
-	sz = MAX2(src_width, src_height);
-	Y = MEM_callocN(sz * sizeof(float), "IIR_gauss Y buf");
-	W = MEM_callocN(sz * sizeof(float), "IIR_gauss W buf");
-	// H
-	for (y = 0; y < src_height; y++) {
-		X = &buf->rect[y * src_width];
-		YVV(src_width);
-		memcpy(X, Y, sizeof(float) * src_width);
-	}
-	// V
-	X = MEM_callocN(src_height * sizeof(float), "IIR_gauss X buf");
-	for (x = 0; x < src_width; x++) {
-		for (y = 0; y < src_height; y++)
-			X[y] = buf->rect[x + y * src_width];
-		YVV(src_height);
-		for (y = 0; y < src_height; y++)
-			buf->rect[x + y * src_width] = Y[y];
-	}
-	MEM_freeN(X);
-
-	MEM_freeN(W);
-	MEM_freeN(Y);
-#undef YVV
-}
-
-static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, float inpval, int no_zbuf)
-{
-	NodeDefocus *nqd = node->storage;
-	CompBuf *wts;		// weights buffer
-	CompBuf *crad;		// CoC radius buffer
-	BokehCoeffs BKH[8];	// bokeh shape data, here never > 8 pts.
-	float bkh_b[4] = {0};	// shape 2D bound
-	float cam_fdist=1, cam_invfdist=1, cam_lens=35;
-	float cam_sensor = DEFAULT_SENSOR_WIDTH;
-	float dof_sp, maxfgc, bk_hn_theta=0, inradsq=0;
-	int y, len_bkh=0, ydone = FALSE;
-	float aspect, aperture;
-	int minsz;
-	//float bcrad, nmaxc, scf;
-	
-	// get some required params from the current scene camera
-	// (ton) this is wrong, needs fixed
-	Scene *scene= (Scene*)node->id;
-	Object* camob = (scene)? scene->camera: NULL;
-	if (camob && camob->type==OB_CAMERA) {
-		Camera* cam = (Camera*)camob->data;
-		cam_lens = cam->lens;
-		cam_fdist = BKE_camera_object_dof_distance(camob);
-		cam_sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
-		if (cam_fdist == 0.0f) cam_fdist = 1e10f; /* if the dof is 0.0 then set it be be far away */
-		cam_invfdist = 1.f / cam_fdist;
-	}
-	// guess work here.. best match with raytraced result
-	minsz = MIN2(img->x, img->y);
-	dof_sp = (float)minsz / ((cam_sensor / 2.0f) / cam_lens);	// <- == aspect * MIN2(img->x, img->y) / tan(0.5f * fov);
-	
-	// aperture
-	aspect = (img->x > img->y) ? (img->y / (float)img->x) : (img->x / (float)img->y);
-	aperture = 0.5f * (cam_lens / (aspect * cam_sensor)) / nqd->fstop;
-	
-	// if not disk, make bokeh coefficients and other needed data
-	if (nqd->bktype!=0) {
-		makeBokeh(nqd->bktype, nqd->rotation, &len_bkh, &inradsq, BKH, bkh_b);
-		bk_hn_theta = 0.5 * nqd->bktype * sin(2.0 * M_PI / nqd->bktype);	// weight factor
-	}
-	
-	// accumulated weights
-	wts = alloc_compbuf(img->x, img->y, CB_VAL, 1);
-	// CoC radius buffer
-	crad = alloc_compbuf(img->x, img->y, CB_VAL, 1);
-
-	// if 'no_zbuf' flag set (which is always set if input is not an image),
-	// values are instead interpreted directly as blur radius values
-	if (no_zbuf) {
-		// to prevent *reaaallly* big radius values and impossible calculation times,
-		// limit the maximum to half the image width or height, whichever is smaller
-		float maxr = 0.5f*(float)MIN2(img->x, img->y);
-		unsigned int p;
-
-		for (p=0; p<(unsigned int)(img->x*img->y); p++) {
-			crad->rect[p] = zbuf ? (zbuf->rect[p]*nqd->scale) : inpval;
-			// bug #5921, limit minimum
-			crad->rect[p] = MAX2(1e-5f, crad->rect[p]);
-			crad->rect[p] = MIN2(crad->rect[p], maxr);
-			// if maxblur!=0, limit maximum
-			if (nqd->maxblur != 0.f) crad->rect[p] = MIN2(crad->rect[p], nqd->maxblur);
-		}
-	}
-	else {
-		float wt;
-
-		// actual zbuffer.
-		// separate foreground from background CoC's
-		// then blur background and blend in again with foreground,
-		// improves the 'blurred foreground overlapping in-focus midground' sharp boundary problem.
-		// wts buffer here used for blendmask
-		maxfgc = 0.f; // maximum foreground CoC radius
-		for (y=0; y<img->y; y++) {
-			unsigned int p = y * img->x;
-			int x;
-			for (x=0; x<img->x; x++) {
-				unsigned int px = p + x;
-				float iZ = (zbuf->rect[px]==0.f) ? 0.f : (1.f/zbuf->rect[px]);
-				crad->rect[px] = 0.5f*(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f));
-				if (crad->rect[px] <= 0.f) {
-					wts->rect[px] = 1.f;
-					crad->rect[px] = -crad->rect[px];
-					if (crad->rect[px] > maxfgc) maxfgc = crad->rect[px];
-				}
-				else crad->rect[px] = wts->rect[px] = 0;
-			}
-		}
-		
-		// fast blur...
-		// bug #6656 part 1, probably when previous node_composite.c was split into separate files, it was not properly updated
-		// to include recent cvs commits (well, at least not defocus node), so this part was missing...
-		wt = min_ff(nqd->maxblur, aperture * 128.0f);
-		IIR_gauss_single(crad, wt);
-		IIR_gauss_single(wts, wt);
-		
-		// bug #6656 part 2a, although foreground blur is not based anymore on closest object,
-		// the rescaling op below was still based on that anyway, and unlike the comment in below code,
-		// the difference is therefore not always that small at all...
-		// so for now commented out, not sure if this is going to cause other future problems, lets just wait and see...
-		/*
-		// find new maximum to scale it back to original
-		// (could skip this, not strictly necessary, in general, difference is quite small, but just in case...)
-		nmaxc = 0;
-		for (p=0; p<(img->x*img->y); p++)
-			if (crad->rect[p] > nmaxc) nmaxc = crad->rect[p];
-		// rescale factor
-		scf = (nmaxc==0.f) ? 1.f: (maxfgc / nmaxc);
-		*/
-
-		// and blend...
-		for (y=0; y<img->y; y++) {
-			unsigned int p = y*img->x;
-			int x;
-
-			for (x=0; x<img->x; x++) {
-				unsigned px = p + x;
-				if (zbuf->rect[px]!=0.f) {
-					float iZ = (zbuf->rect[px]==0.f) ? 0.f : (1.f/zbuf->rect[px]);
-					
-					// bug #6656 part 2b, do not rescale
-					/*
-					bcrad = 0.5f*fabs(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f));
-					// scale crad back to original maximum and blend
-					crad->rect[px] = bcrad + wts->rect[px]*(scf*crad->rect[px] - bcrad);
-					*/
-					crad->rect[px] = 0.5f*fabsf(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f));
-					
-					// 'bug' #6615, limit minimum radius to 1 pixel, not really a solution, but somewhat mitigates the problem
-					crad->rect[px] = MAX2(crad->rect[px], 0.5f);
-					// if maxblur!=0, limit maximum
-					if (nqd->maxblur != 0.f) crad->rect[px] = MIN2(crad->rect[px], nqd->maxblur);
-				}
-				else crad->rect[px] = 0.f;
-				// clear weights for next part
-				wts->rect[px] = 0.f;
-			}
-			// esc set by main calling process
-			if (node->exec & NODE_BREAK)
-				break;
-		}
-	}
-
-	//------------------------------------------------------------------
-	// main loop
-#ifndef __APPLE__ /* can crash on Mac, see bug #22856, disabled for now */
-#ifdef __INTEL_COMPILER /* icc doesn't like the compound statement -- internal error: 0_1506 */
-	#pragma omp parallel for private(y) if (!nqd->preview) schedule(guided)
-#else
-	#pragma omp parallel for private(y) if (!nqd->preview && img->y*img->x > 16384) schedule(guided)
-#endif
-#endif
-	for (y=0; y<img->y; y++) {
-		unsigned int p, p4, zp, cp, cp4;
-		float *ctcol, u, v, ct_crad, cR2=0;
-		int x, sx, sy;
-
-		// some sort of visual feedback would be nice, or at least this text in the renderwin header
-		// but for now just print some info in the console every 8 scanlines.
-		#pragma omp critical
-		{
-			if (((ydone & 7)==0) || (ydone==(img->y-1))) {
-				if (G.background==0) {
-					printf("\rdefocus: Processing Line %d of %d ... ", ydone+1, img->y);
-					fflush(stdout);
-				}
-			}
-
-			ydone++;
-		}
-
-		// esc set by main calling process. don't break because openmp doesn't
-		// allow it, just continue and do nothing 
-		if (node->exec & NODE_BREAK)
-			continue;
-
-		zp = y * img->x;
-		for (x=0; x<img->x; x++) {
-			cp = zp + x;
-			cp4 = cp * img->type;
-
-			// Circle of Confusion radius for current pixel
-			cR2 = ct_crad = crad->rect[cp];
-			// skip if zero (border render)
-			if (ct_crad==0.f) {
-				// related to bug #5921, forgot output image when skipping 0 radius values
-				new->rect[cp4] = img->rect[cp4];
-				if (new->type != CB_VAL) {
-					new->rect[cp4+1] = img->rect[cp4+1];
-					new->rect[cp4+2] = img->rect[cp4+2];
-					new->rect[cp4+3] = img->rect[cp4+3];
-				}
-				continue;
-			}
-			cR2 *= cR2;
-			
-			// pixel color
-			ctcol = &img->rect[cp4];
-			
-			if (!nqd->preview) {
-				int xs, xe, ys, ye;
-				float lwt, wtcol[4] = {0}, aacol[4] = {0};
-				float wt;
-
-				// shape weight
-				if (nqd->bktype==0)	// disk
-					wt = 1.f/((float)M_PI*cR2);
-				else
-					wt = 1.f/(cR2*bk_hn_theta);
-
-				// weighted color
-				wtcol[0] = wt*ctcol[0];
-				if (new->type != CB_VAL) {
-					wtcol[1] = wt*ctcol[1];
-					wtcol[2] = wt*ctcol[2];
-					wtcol[3] = wt*ctcol[3];
-				}
-
-				// macro for background blur overlap test
-				// unfortunately, since this is done per pixel,
-				// it has a very significant negative impact on processing time...
-				// (eg. aa disk blur without test: 112 sec, vs with test: 176 sec...)
-				// iff center blur radius > threshold
-				// and if overlap pixel in focus, do nothing, else add color/weigbt
-				// (threshold constant is dependent on amount of blur)
-				#define TESTBG1(c, w) {\
-					if (ct_crad > nqd->bthresh) {\
-						if (crad->rect[p] > nqd->bthresh) {\
-							new->rect[p] += c[0];\
-							wts->rect[p] += w;\
-						}\
-					}\
-					else {\
-						new->rect[p] += c[0];\
-						wts->rect[p] += w;\
-					}\
-				}
-				#define TESTBG4(c, w) {\
-					if (ct_crad > nqd->bthresh) {\
-						if (crad->rect[p] > nqd->bthresh) {\
-							new->rect[p4] += c[0];\
-							new->rect[p4+1] += c[1];\
-							new->rect[p4+2] += c[2];\
-							new->rect[p4+3] += c[3];\
-							wts->rect[p] += w;\
-						}\
-					}\
-					else {\
-						new->rect[p4] += c[0];\
-						new->rect[p4+1] += c[1];\
-						new->rect[p4+2] += c[2];\
-						new->rect[p4+3] += c[3];\
-						wts->rect[p] += w;\
-					}\
-				}
-				if (nqd->bktype == 0) {
-					// Disk
-					int _x, i, j, di;
-					float Dj, T;
-					// AA pixel
-					#define AAPIX(a, b) {\
-						int _ny = b;\
-						if ((_ny >= 0) && (_ny < new->y)) {\
-							int _nx = a;\
-							if ((_nx >=0) && (_nx < new->x)) {\
-								p = _ny*new->x + _nx;\
-								if (new->type==CB_VAL) {\
-									TESTBG1(aacol, lwt);\
-								}\
-								else {\
-									p4 = p * new->type;\
-									TESTBG4(aacol, lwt);\
-								}\
-							}\
-						}\
-					}
-					// circle scanline
-					#define CSCAN(a, b) {\
-						int _ny = y + b;\
-						if ((_ny >= 0) && (_ny < new->y)) {\
-							xs = x - a + 1;\
-							if (xs < 0) xs = 0;\
-							xe = x + a;\
-							if (xe > new->x) xe = new->x;\
-							p = _ny*new->x + xs;\
-							if (new->type==CB_VAL) {\
-								for (_x=xs; _x<xe; _x++, p++) TESTBG1(wtcol, wt);\
-							}\
-							else {\
-								p4 = p * new->type;\
-								for (_x=xs; _x<xe; _x++, p++, p4+=new->type) TESTBG4(wtcol, wt);\
-							}\
-						}\
-					}
-
-					i = ceil(ct_crad);
-					j = 0;
-					T = 0;
-					while (i > j) {
-						Dj = sqrt(cR2 - j*j);
-						Dj -= floorf(Dj);
-						di = 0;
-						if (Dj > T) { i--;  di = 1; }
-						T = Dj;
-						aacol[0] = wtcol[0]*Dj;
-						if (new->type != CB_VAL) {
-							aacol[1] = wtcol[1]*Dj;
-							aacol[2] = wtcol[2]*Dj;
-							aacol[3] = wtcol[3]*Dj;
-						}
-						lwt = wt*Dj;
-						if (i!=j) {
-							// outer pixels
-							AAPIX(x+j, y+i)
-							AAPIX(x+j, y-i)
-							if (j) {
-								AAPIX(x-j, y+i) // BL
-								AAPIX(x-j, y-i) // TL
-							}
-							if (di) { // only when i changed, interior of outer section
-								CSCAN(j, i) // bottom
-								CSCAN(j, -i) // top
-							}
-						}
-						// lower mid section
-						AAPIX(x+i, y+j)
-						if (i) AAPIX(x-i, y+j)
-						CSCAN(i, j)
-						// upper mid section
-						if (j) {
-							AAPIX(x+i, y-j)
-							if (i) AAPIX(x-i, y-j)
-							CSCAN(i, -j)
-						}
-						j++;
-					}
-					#undef CSCAN
-					#undef AAPIX
-				}
-				else {
-					// n-agonal
-					int ov, nv;
-					float mind, maxd, lwt;
-					ys = max_ii((int)floor(bkh_b[2] * ct_crad + y), 0);
-					ye = min_ii((int)ceil(bkh_b[3] * ct_crad + y), new->y - 1);
-					for (sy=ys; sy<=ye; sy++) {
-						float fxs = 1e10f, fxe = -1e10f;
-						float yf = (sy - y)/ct_crad;
-						int found = 0;
-						ov = len_bkh - 1;
-						mind = maxd = 0;
-						for (nv=0; nv<len_bkh; nv++) {
-							if ((BKH[nv].max_y >= yf) && (BKH[nv].min_y <= yf)) {
-								float tx = BKH[ov].x0 + BKH[nv].ls_x*(yf - BKH[ov].y0);
-								if (tx < fxs) { fxs = tx;  mind = BKH[nv].ls_x; }
-								if (tx > fxe) { fxe = tx;  maxd = BKH[nv].ls_x; }
-								if (++found == 2) break;
-							}
-							ov = nv;
-						}
-						if (found) {
-							fxs = fxs*ct_crad + x;
-							fxe = fxe*ct_crad + x;
-							xs = (int)floor(fxs), xe = (int)ceil(fxe);
-							// AA hack for first and last x pixel, near vertical edges only
-							if (fabsf(mind) <= 1.f) {
-								if ((xs >= 0) && (xs < new->x)) {
-									lwt = 1.f-(fxs - xs);
-									aacol[0] = wtcol[0]*lwt;
-									p = xs + sy*new->x;
-									if (new->type==CB_VAL) {
-										lwt *= wt;
-										TESTBG1(aacol, lwt);
-									}
-									else {
-										p4 = p * new->type;
-										aacol[1] = wtcol[1]*lwt;
-										aacol[2] = wtcol[2]*lwt;
-										aacol[3] = wtcol[3]*lwt;
-										lwt *= wt;
-										TESTBG4(aacol, lwt);
-									}
-								}
-							}
-							if (fabsf(maxd) <= 1.f) {
-								if ((xe >= 0) && (xe < new->x)) {
-									lwt = 1.f-(xe - fxe);
-									aacol[0] = wtcol[0]*lwt;
-									p = xe + sy*new->x;
-									if (new->type==CB_VAL) {
-										lwt *= wt;
-										TESTBG1(aacol, lwt);
-									}
-									else {
-										p4 = p * new->type;
-										aacol[1] = wtcol[1]*lwt;
-										aacol[2] = wtcol[2]*lwt;
-										aacol[3] = wtcol[3]*lwt;
-										lwt *= wt;
-										TESTBG4(aacol, lwt);
-									}
-								}
-							}
-							xs = MAX2(xs+1, 0);
-							xe = MIN2(xe, new->x);
-							// remaining interior scanline
-							p = sy*new->x + xs;
-							if (new->type==CB_VAL) {
-								for (sx=xs; sx<xe; sx++, p++) TESTBG1(wtcol, wt);
-							}
-							else {
-								p4 = p * new->type;
-								for (sx=xs; sx<xe; sx++, p++, p4+=new->type) TESTBG4(wtcol, wt);
-							}
-						}
-					}
-
-					// now traverse in opposite direction, y scanlines,
-					// but this time only draw the near horizontal edges,
-					// applying same AA hack as above
-					xs = MAX2((int)floor(bkh_b[0]*ct_crad + x), 0);
-					xe = MIN2((int)ceil(bkh_b[1]*ct_crad + x), img->x - 1);
-					for (sx=xs; sx<=xe; sx++) {
-						float xf = (sx - x)/ct_crad;
-						float fys = 1e10f, fye = -1e10f;
-						int found = 0;
-						ov = len_bkh - 1;
-						mind = maxd = 0;
-						for (nv=0; nv<len_bkh; nv++) {
-							if ((BKH[nv].max_x >= xf) && (BKH[nv].min_x <= xf)) {
-								float ty = BKH[ov].y0 + BKH[nv].ls_y*(xf - BKH[ov].x0);
-								if (ty < fys) { fys = ty;  mind = BKH[nv].ls_y; }
-								if (ty > fye) { fye = ty;  maxd = BKH[nv].ls_y; }
-								if (++found == 2) break;
-							}
-							ov = nv;
-						}
-						if (found) {
-							fys = fys*ct_crad + y;
-							fye = fye*ct_crad + y;
-							// near horizontal edges only, line slope <= 1
-							if (fabsf(mind) <= 1.f) {
-								int iys = (int)floor(fys);
-								if ((iys >= 0) && (iys < new->y)) {
-									lwt = 1.f - (fys - iys);
-									aacol[0] = wtcol[0]*lwt;
-									p = sx + iys*new->x;
-									if (new->type==CB_VAL) {
-										lwt *= wt;
-										TESTBG1(aacol, lwt);
-									}
-									else {
-										p4 = p * new->type;
-										aacol[1] = wtcol[1]*lwt;
-										aacol[2] = wtcol[2]*lwt;
-										aacol[3] = wtcol[3]*lwt;
-										lwt *= wt;
-										TESTBG4(aacol, lwt);
-									}
-								}
-							}
-							if (fabsf(maxd) <= 1.f) {
-								int iye = ceil(fye);
-								if ((iye >= 0) && (iye < new->y)) {
-									lwt = 1.f - (iye - fye);
-									aacol[0] = wtcol[0]*lwt;
-									p = sx + iye*new->x;
-									if (new->type==CB_VAL) {
-										lwt *= wt;
-										TESTBG1(aacol, lwt);
-									}
-									else {
-										p4 = p * new->type;
-										aacol[1] = wtcol[1]*lwt;
-										aacol[2] = wtcol[2]*lwt;
-										aacol[3] = wtcol[3]*lwt;
-										lwt *= wt;
-										TESTBG4(aacol, lwt);
-									}
-								}
-							}
-						}
-					}
-
-				}
-				#undef TESTBG4
-				#undef TESTBG1
-
-			}
-			else {
-				// sampled, simple rejection sampling here, good enough
-				unsigned int maxsam, s, ui = BLI_rand()*BLI_rand();
-				float wcor, cpr = BLI_frand(), lwt;
-				if (no_zbuf)
-					maxsam = nqd->samples;	// no zbuffer input, use sample value directly
-				else {
-					// depth adaptive sampling hack, the more out of focus, the more samples taken, 16 minimum.
-					maxsam = (int)(0.5f + nqd->samples*(1.f-(float)exp(-fabs(zbuf->rect[cp] - cam_fdist))));
-					if (maxsam < 16) maxsam = 16;
-				}
-				wcor = 1.f/(float)maxsam;
-				for (s=0; s<maxsam; ++s) {
-					u = ct_crad*(2.f*RI_vdC(s, ui) - 1.f);
-					v = ct_crad*(2.f*(s + cpr)/(float)maxsam - 1.f);
-					sx = (int)(x + u + 0.5f), sy = (int)(y + v + 0.5f);
-					if ((sx<0) || (sx >= new->x) || (sy<0) || (sy >= new->y)) continue;
-					p = sx + sy*new->x;
-					p4 = p * new->type;
-					if (nqd->bktype==0)	// Disk
-						lwt = ((u*u + v*v)<=cR2) ? wcor : 0.f;
-					else  /* AA not needed here */
-						lwt = wcor * getWeight(BKH, len_bkh, u, v, ct_crad, inradsq);
-					// prevent background bleeding onto in-focus pixels, user-option
-					if (ct_crad > nqd->bthresh) {  // if center blur > threshold
-						if (crad->rect[p] > nqd->bthresh) { // if overlap pixel in focus, do nothing, else add color/weigbt
-							new->rect[p4] += ctcol[0] * lwt;
-							if (new->type != CB_VAL) {
-								new->rect[p4+1] += ctcol[1] * lwt;
-								new->rect[p4+2] += ctcol[2] * lwt;
-								new->rect[p4+3] += ctcol[3] * lwt;
-							}
-							wts->rect[p] += lwt;
-						}
-					}
-					else {
-						new->rect[p4] += ctcol[0] * lwt;
-						if (new->type != CB_VAL) {
-							new->rect[p4+1] += ctcol[1] * lwt;
-							new->rect[p4+2] += ctcol[2] * lwt;
-							new->rect[p4+3] += ctcol[3] * lwt;
-						}
-						wts->rect[p] += lwt;
-					}
-				}
-			}
-
-		}
-	}
-	
-	// finally, normalize
-	for (y=0; y<new->y; y++) {
-		unsigned int p = y * new->x;
-		unsigned int p4 = p * new->type;
-		int x;
-
-		for (x=0; x<new->x; x++) {
-			float dv = (wts->rect[p]==0.f) ? 1.f : (1.f/wts->rect[p]);
-			new->rect[p4] *= dv;
-			if (new->type!=CB_VAL) {
-				new->rect[p4+1] *= dv;
-				new->rect[p4+2] *= dv;
-				new->rect[p4+3] *= dv;
-			}
-			p++;
-			p4 += new->type;
-		}
-	}
-
-	free_compbuf(crad);
-	free_compbuf(wts);
-	
-	printf("Done\n");
-}
-
-
-static void node_composit_exec_defocus(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *new, *old, *zbuf_use = NULL, *img = in[0]->data, *zbuf = in[1]->data;
-	NodeDefocus *nqd = node->storage;
-	int no_zbuf = nqd->no_zbuf;
-	
-	if ((img==NULL) || (out[0]->hasoutput==0)) return;
-	
-	// if image not valid type or fstop==infinite (128), nothing to do, pass in to out
-	if (((img->type!=CB_RGBA) && (img->type!=CB_VAL)) || ((no_zbuf==0) && (nqd->fstop==128.f))) {
-		out[0]->data = pass_on_compbuf(img);
-		return;
-	}
-	
-	if (zbuf!=NULL) {
-		// Zbuf input, check to make sure, single channel, same size
-		// doesn't have to be actual zbuffer, but must be value type
-		if ((zbuf->x != img->x) || (zbuf->y != img->y)) {
-			// could do a scale here instead...
-			printf("Z input must be same size as image !\n");
-			return;
-		}
-		zbuf_use = typecheck_compbuf(zbuf, CB_VAL);
-	}
-	else no_zbuf = 1;	// no zbuffer input
-		
-	// ok, process
-	old = img;
-	if (nqd->gamco) {
-		// gamma correct, blender func is simplified, fixed value & RGBA only,
-		// should make user param. also depremul and premul afterwards, gamma
-		// correction can't work with premul alpha
-		old = dupalloc_compbuf(img);
-		premul_compbuf(old, 1);
-		gamma_correct_compbuf(old, 0);
-		premul_compbuf(old, 0);
-	}
-	
-	new = alloc_compbuf(old->x, old->y, old->type, 1);
-	defocus_blur(node, new, old, zbuf_use, in[1]->vec[0]*nqd->scale, no_zbuf);
-	
-	if (nqd->gamco) {
-		premul_compbuf(new, 1);
-		gamma_correct_compbuf(new, 1);
-		premul_compbuf(new, 0);
-		free_compbuf(old);
-	}
-	if (node->exec & NODE_BREAK) {
-		free_compbuf(new);
-		new= NULL;
-	}
-	out[0]->data = new;
-	if (zbuf_use && (zbuf_use != zbuf)) free_compbuf(zbuf_use);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_defocus(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	/* qdn: defocus node */
@@ -894,9 +70,6 @@ void register_node_type_cmp_defocus(bNodeTreeType *ttype)
 	node_type_size(&ntype, 150, 120, 200);
 	node_type_init(&ntype, node_composit_init_defocus);
 	node_type_storage(&ntype, "NodeDefocus", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_defocus);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_despeckle.c b/source/blender/nodes/composite/nodes/node_composite_despeckle.c
index 9d47e4b..8fc97ef 100644
--- a/source/blender/nodes/composite/nodes/node_composite_despeckle.c
+++ b/source/blender/nodes/composite/nodes/node_composite_despeckle.c
@@ -42,15 +42,6 @@ static bNodeSocketTemplate cmp_node_despeckle_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_despeckle(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
-{
-	/* pass */
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_despeckle(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->custom3 = 0.5f;
@@ -65,9 +56,6 @@ void register_node_type_cmp_despeckle(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_despeckle_in, cmp_node_despeckle_out);
 	node_type_size(&ntype, 80, 40, 120);
 	node_type_init(&ntype, node_composit_init_despeckle);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_despeckle);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
index 014b72d..bcfd9dd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
@@ -45,91 +45,6 @@ static bNodeSocketTemplate cmp_node_diff_matte_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *inColor2)
-{
-	NodeChroma *c= (NodeChroma *)node->storage;
-	float tolerance=c->t1;
-	float fper=c->t2;
-	/* get falloff amount over tolerance size */
-	float falloff=(1.0f-fper) * tolerance;
-	float difference;
-	float alpha;
-	float maxInputAlpha;
-
-	/* average together the distances */
-	difference= fabs(inColor2[0]-inColor1[0]) +
-		fabs(inColor2[1]-inColor1[1]) +
-		fabs(inColor2[2]-inColor1[2]);
-	difference=difference/3.0f;
-
-	copy_v3_v3(outColor, inColor1);
-
-	if (difference <= tolerance) {
-		if (difference <= falloff) {
-			alpha = 0.0f;
-		}
-		else {
-			/* alpha as percent (distance / tolerance), each modified by falloff amount (in pixels)*/
-			alpha=(difference-falloff)/(tolerance-falloff);
-		}
-
-		/*only change if more transparent than either image */
-		maxInputAlpha=max_ff(inColor1[3], inColor2[3]);
-		if (alpha < maxInputAlpha) {
-			/*clamp*/
-			if (alpha < 0.0f) alpha = 0.0f;
-			if (alpha > 1.0f) alpha = 1.0f;
-			outColor[3] = alpha;
-		}
-		else { /* leave as before */
-			outColor[3]=maxInputAlpha;
-		}
-	}
-}
-
-static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *outbuf= NULL;
-	CompBuf *imbuf1= NULL;
-	CompBuf *imbuf2= NULL;
-	/* NodeChroma *c; */ /* UNUSED */
-
-	/*is anything connected?*/
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
-
-	/*must have an image imput*/
-	if (in[0]->data==NULL) return;
-
-
-	imbuf1=typecheck_compbuf(in[0]->data, CB_RGBA);
-
-	/* if there's an image, use that, if not use the color */
-	if (in[1]->data) {
-		imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA);
-	}
-
-	/* c=node->storage; */ /* UNUSED */
-	outbuf=dupalloc_compbuf(imbuf1);
-
-	/* note, processor gets a keyvals array passed on as buffer constant */
-	composit2_pixel_processor(node, outbuf, imbuf1, in[0]->vec, imbuf2, in[1]->vec, do_diff_matte, CB_RGBA, CB_RGBA);
-
-	out[0]->data=outbuf;
-	if (out[1]->hasoutput)
-		out[1]->data=valbuf_from_rgbabuf(outbuf, CHAN_A);
-	generate_preview(data, node, outbuf);
-
-	if (imbuf1!=in[0]->data)
-		free_compbuf(imbuf1);
-
-	if (imbuf2!=in[1]->data)
-		free_compbuf(imbuf2);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_diff_matte(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
@@ -147,9 +62,6 @@ void register_node_type_cmp_diff_matte(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 80, 250);
 	node_type_init(&ntype, node_composit_init_diff_matte);
 	node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_diff_matte);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.c b/source/blender/nodes/composite/nodes/node_composite_dilate.c
index 9787c9f..0238914 100644
--- a/source/blender/nodes/composite/nodes/node_composite_dilate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_dilate.c
@@ -44,112 +44,6 @@ static bNodeSocketTemplate cmp_node_dilateerode_out[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void morpho_dilate(CompBuf *cbuf)
-{
-	int x, y;
-	float *p, *rectf = cbuf->rect;
-	
-	for (y = 0; y < cbuf->y; y++) {
-		for (x = 0; x < cbuf->x - 1; x++) {
-			p = rectf + cbuf->x * y + x;
-			*p = max_ff(*p, *(p + 1));
-		}
-	}
-
-	for (y = 0; y < cbuf->y; y++) {
-		for (x = cbuf->x - 1; x >= 1; x--) {
-			p = rectf + cbuf->x * y + x;
-			*p = max_ff(*p, *(p - 1));
-		}
-	}
-
-	for (x = 0; x < cbuf->x; x++) {
-		for (y = 0; y < cbuf->y - 1; y++) {
-			p = rectf + cbuf->x * y + x;
-			*p = max_ff(*p, *(p + cbuf->x));
-		}
-	}
-
-	for (x = 0; x < cbuf->x; x++) {
-		for (y = cbuf->y - 1; y >= 1; y--) {
-			p = rectf + cbuf->x * y + x;
-			*p = max_ff(*p, *(p - cbuf->x));
-		}
-	}
-}
-
-static void morpho_erode(CompBuf *cbuf)
-{
-	int x, y;
-	float *p, *rectf = cbuf->rect;
-	
-	for (y = 0; y < cbuf->y; y++) {
-		for (x = 0; x < cbuf->x - 1; x++) {
-			p = rectf + cbuf->x * y + x;
-			*p = min_ff(*p, *(p + 1));
-		}
-	}
-
-	for (y = 0; y < cbuf->y; y++) {
-		for (x = cbuf->x - 1; x >= 1; x--) {
-			p = rectf + cbuf->x * y + x;
-			*p = min_ff(*p, *(p - 1));
-		}
-	}
-
-	for (x = 0; x < cbuf->x; x++) {
-		for (y = 0; y < cbuf->y - 1; y++) {
-			p = rectf + cbuf->x * y + x;
-			*p = min_ff(*p, *(p + cbuf->x));
-		}
-	}
-
-	for (x = 0; x < cbuf->x; x++) {
-		for (y = cbuf->y - 1; y >= 1; y--) {
-			p = rectf + cbuf->x * y + x;
-			*p = min_ff(*p, *(p - cbuf->x));
-		}
-	}
-	
-}
-
-static void node_composit_exec_dilateerode(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: mask */
-	/* stack order out: mask */
-	if (out[0]->hasoutput == 0)
-		return;
-	
-	/* input no image? then only color operation */
-	if (in[0]->data == NULL) {
-		zero_v4(out[0]->vec);
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf = typecheck_compbuf(in[0]->data, CB_VAL);
-		CompBuf *stackbuf = dupalloc_compbuf(cbuf);
-		short i;
-		
-		if (node->custom2 > 0) { // positive, dilate
-			for (i = 0; i < node->custom2; i++)
-				morpho_dilate(stackbuf);
-		}
-		else if (node->custom2 < 0) { // negative, erode
-			for (i = 0; i > node->custom2; i--)
-				morpho_erode(stackbuf);
-		}
-		
-		if (cbuf != in[0]->data)
-			free_compbuf(cbuf);
-		
-		out[0]->data = stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_dilateerode(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeDilateErode *data = MEM_callocN(sizeof(NodeDilateErode), "NodeDilateErode");
@@ -165,9 +59,6 @@ void register_node_type_cmp_dilateerode(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_dilateerode_in, cmp_node_dilateerode_out);
 	node_type_size(&ntype, 130, 100, 320);
 	node_type_init(&ntype, node_composit_init_dilateerode);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_dilateerode);
-#endif
 	
 	node_type_storage(&ntype, "NodeDilateErode", node_free_standard_storage, node_copy_standard_storage);
 
diff --git a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
index a343315..ca32f37 100644
--- a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
@@ -42,90 +42,6 @@ static bNodeSocketTemplate cmp_node_dblur_out[] = {
 	{   -1, 0, ""       }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap,
-                      float center_x, float center_y, float dist, float angle, float spin, float zoom)
-{
-	if ((dist != 0.f) || (spin != 0.f) || (zoom != 0.f)) {
-		void (*getpix)(CompBuf *, float, float, float *) = wrap ? qd_getPixelLerpWrap : qd_getPixelLerp;
-		const float a = angle;
-		const float itsc = 1.f / powf(2.f, (float)iterations);
-		float D;
-		float center_x_pix, center_y_pix;
-		float tx, ty;
-		float sc, rot;
-		CompBuf *tmp;
-		int i, j;
-		
-		tmp = dupalloc_compbuf(img);
-		
-		D = dist * sqrtf(img->x * img->x + img->y * img->y);
-		center_x_pix = center_x * img->x;
-		center_y_pix = center_y * img->y;
-
-		tx =  itsc * D * cosf(a);
-		ty = -itsc * D * sinf(a);
-		sc =  itsc * zoom;
-		rot = itsc * spin;
-
-		/* blur the image */
-		for (i = 0; i < iterations; ++i) {
-			const float cs = cosf(rot), ss = sinf(rot);
-			const float isc = 1.f / (1.f + sc);
-			unsigned int x, y;
-			float col[4] = {0, 0, 0, 0};
-
-			for (y = 0; y < img->y; ++y) {
-				const float v = isc * (y - center_y_pix) + ty;
-
-				for (x = 0; x < img->x; ++x) {
-					const float u = isc * (x - center_x_pix) + tx;
-					unsigned int p = (x + y * img->x) * img->type;
-
-					getpix(tmp, cs * u + ss * v + center_x_pix, cs * v - ss * u + center_y_pix, col);
-
-					/* mix img and transformed tmp */
-					for (j = 0; j < 4; ++j) {
-						img->rect[p + j] = 0.5f * (img->rect[p + j] + col[j]);
-					}
-				}
-			}
-
-			/* copy img to tmp */
-			if (i != (iterations - 1)) 
-				memcpy(tmp->rect, img->rect, sizeof(float) * img->x * img->y * img->type);
-
-			/* double transformations */
-			tx *= 2.f, ty  *= 2.f;
-			sc *= 2.f, rot *= 2.f;
-
-			if (node->exec & NODE_BREAK) break;
-		}
-
-		free_compbuf(tmp);
-	}
-
-	return img;
-}
-
-static void node_composit_exec_dblur(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	NodeDBlurData *ndbd = node->storage;
-	CompBuf *new, *img = in[0]->data;
-	
-	if ((img == NULL) || (out[0]->hasoutput == 0)) return;
-
-	if (img->type != CB_RGBA)
-		new = typecheck_compbuf(img, CB_RGBA);
-	else
-		new = dupalloc_compbuf(img);
-	
-	out[0]->data = dblur(node, new, ndbd->iter, ndbd->wrap, ndbd->center_x, ndbd->center_y, ndbd->distance, ndbd->angle, ndbd->spin, ndbd->zoom);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_dblur(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeDBlurData *ndbd = MEM_callocN(sizeof(NodeDBlurData), "node dblur data");
@@ -143,9 +59,6 @@ void register_node_type_cmp_dblur(bNodeTreeType *ttype)
 	node_type_size(&ntype, 150, 120, 200);
 	node_type_init(&ntype, node_composit_init_dblur);
 	node_type_storage(&ntype, "NodeDBlurData", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_dblur);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_displace.c b/source/blender/nodes/composite/nodes/node_composite_displace.c
index c07ad0a..5955967 100644
--- a/source/blender/nodes/composite/nodes/node_composite_displace.c
+++ b/source/blender/nodes/composite/nodes/node_composite_displace.c
@@ -47,145 +47,6 @@ static bNodeSocketTemplate cmp_node_displace_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* minimum distance (in pixels) a pixel has to be displaced
- * in order to take effect */
-#define DISPLACE_EPSILON	0.01f
-
-static void do_displace(bNode *node, CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float *UNUSED(veccol), CompBuf *xbuf,  CompBuf *ybuf, float *xscale, float *yscale)
-{
-	ImBuf *ibuf;
-	int x, y;
-	float p_dx, p_dy;	/* main displacement in pixel space */
-	float d_dx, d_dy;
-	float dxt, dyt;
-	float u, v;
-	float xs, ys;
-	float vec[3], vecdx[3], vecdy[3];
-	float col[3];
-	
-	ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
-	ibuf->rect_float= cbuf->rect;
-	
-	for (y=0; y < stackbuf->y; y++) {
-		for (x=0; x < stackbuf->x; x++) {
-			/* calc pixel coordinates */
-			qd_getPixel(vecbuf, x-vecbuf->xof, y-vecbuf->yof, vec);
-			
-			if (xbuf)
-				qd_getPixel(xbuf, x-xbuf->xof, y-xbuf->yof, &xs);
-			else
-				xs = xscale[0];
-			
-			if (ybuf)
-				qd_getPixel(ybuf, x-ybuf->xof, y-ybuf->yof, &ys);
-			else
-				ys = yscale[0];
-
-			/* clamp x and y displacement to triple image resolution - 
-			 * to prevent hangs from huge values mistakenly plugged in eg. z buffers */
-			CLAMP(xs, -stackbuf->x*4, stackbuf->x*4);
-			CLAMP(ys, -stackbuf->y*4, stackbuf->y*4);
-			
-			p_dx = vec[0] * xs;
-			p_dy = vec[1] * ys;
-			
-			/* if no displacement, then just copy this pixel */
-			if (fabsf(p_dx) < DISPLACE_EPSILON && fabsf(p_dy) < DISPLACE_EPSILON) {
-				qd_getPixel(cbuf, x-cbuf->xof, y-cbuf->yof, col);
-				qd_setPixel(stackbuf, x, y, col);
-				continue;
-			}
-			
-			/* displaced pixel in uv coords, for image sampling */
-			u = (x - cbuf->xof - p_dx + 0.5f) / (float)stackbuf->x;
-			v = (y - cbuf->yof - p_dy + 0.5f) / (float)stackbuf->y;
-			
-			
-			/* calc derivatives */
-			qd_getPixel(vecbuf, x-vecbuf->xof+1, y-vecbuf->yof, vecdx);
-			qd_getPixel(vecbuf, x-vecbuf->xof, y-vecbuf->yof+1, vecdy);
-			d_dx = vecdx[0] * xs;
-			d_dy = vecdy[1] * ys;
-
-			/* clamp derivatives to minimum displacement distance in UV space */
-			dxt = p_dx - d_dx;
-			dyt = p_dy - d_dy;
-
-			dxt = signf(dxt)*max_ff(fabsf(dxt), DISPLACE_EPSILON)/(float)stackbuf->x;
-			dyt = signf(dyt)*max_ff(fabsf(dyt), DISPLACE_EPSILON)/(float)stackbuf->y;
-			
-			ibuf_sample(ibuf, u, v, dxt, dyt, col);
-			qd_setPixel(stackbuf, x, y, col);
-			
-			if (node->exec & NODE_BREAK) break;
-		}
-		
-		if (node->exec & NODE_BREAK) break;
-	}
-	IMB_freeImBuf(ibuf);
-	
-	
-/* simple method for reference, linear interpolation */
-#if 0
-	int x, y;
-	float dx, dy;
-	float u, v;
-	float vec[3];
-	float col[3];
-	
-	for (y=0; y < stackbuf->y; y++) {
-		for (x=0; x < stackbuf->x; x++) {
-			qd_getPixel(vecbuf, x, y, vec);
-			
-			dx = vec[0] * (xscale[0]);
-			dy = vec[1] * (yscale[0]);
-			
-			u = (x - dx + 0.5f) / (float)stackbuf->x;
-			v = (y - dy + 0.5f) / (float)stackbuf->y;
-			
-			qd_getPixelLerp(cbuf, u*cbuf->x - 0.5f, v*cbuf->y - 0.5f, col);
-			qd_setPixel(stackbuf, x, y, col);
-		}
-	}
-#endif
-}
-
-
-static void node_composit_exec_displace(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (out[0]->hasoutput==0)
-		return;
-	
-	if (in[0]->data && in[1]->data) {
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *vecbuf= in[1]->data;
-		CompBuf *xbuf= in[2]->data;
-		CompBuf *ybuf= in[3]->data;
-		CompBuf *stackbuf;
-		
-		cbuf= typecheck_compbuf(cbuf, CB_RGBA);
-		vecbuf= typecheck_compbuf(vecbuf, CB_VEC3);
-		xbuf= typecheck_compbuf(xbuf, CB_VAL);
-		ybuf= typecheck_compbuf(ybuf, CB_VAL);
-		
-		stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-
-		do_displace(node, stackbuf, cbuf, vecbuf, in[1]->vec, xbuf, ybuf, in[2]->vec, in[3]->vec);
-		
-		out[0]->data= stackbuf;
-		
-		
-		if (cbuf!=in[0]->data)
-			free_compbuf(cbuf);
-		if (vecbuf!=in[1]->data)
-			free_compbuf(vecbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_displace(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -193,9 +54,6 @@ void register_node_type_cmp_displace(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_DISPLACE, "Displace", NODE_CLASS_DISTORT, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_displace_in, cmp_node_displace_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_displace);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
index 7e60586..fffb85c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
@@ -45,147 +45,6 @@ static bNodeSocketTemplate cmp_node_distance_matte_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* note, keyvals is passed on from caller as stack array */
-/* might have been nicer as temp struct though... */
-static void do_distance_matte(bNode *node, float *out, float *in)
-{
-	NodeChroma *c= (NodeChroma *)node->storage;
-	float tolerance=c->t1;
-	float fper=c->t2;
-	/* get falloff amount over tolerance size */
-	float falloff=(1.0f-fper) * tolerance;
-	float distance;
-	float alpha;
-
-	distance=sqrt((c->key[0]-in[0])*(c->key[0]-in[0]) +
-		(c->key[1]-in[1])*(c->key[1]-in[1]) +
-		(c->key[2]-in[2])*(c->key[2]-in[2]));
-
-	copy_v3_v3(out, in);
-
-	if (distance <= tolerance) {
-		if (distance <= falloff) {
-			alpha = 0.0f;
-		}
-		else {
-			/* alpha as percent (distance / tolerance), each modified by falloff amount (in pixels)*/
-			alpha=(distance-falloff)/(tolerance-falloff);
-		}
-
-		/*only change if more transparent than before */
-		if (alpha < in[3]) {
-			/*clamp*/
-			if (alpha < 0.0f) alpha = 0.0f;
-			if (alpha > 1.0f) alpha = 1.0f;
-			out[3]=alpha;
-		}
-		else { /* leave as before */
-			out[3]=in[3];
-		}
-	}
-}
-
-static void do_chroma_distance_matte(bNode *node, float *out, float *in)
-{
-	NodeChroma *c= (NodeChroma *)node->storage;
-	float tolerance=c->t1;
-	float fper=c->t2;
-	/* get falloff amount over tolerance size */
-	float falloff=(1.0f-fper) * tolerance;
-	float y_key, cb_key, cr_key;
-	float y_pix, cb_pix, cr_pix;
-	float distance;
-	float alpha;
-
-	/*convert key to chroma colorspace */
-	rgb_to_ycc(c->key[0], c->key[1], c->key[2], &y_key, &cb_key, &cr_key, BLI_YCC_JFIF_0_255);
-	/* normalize the values */
-	cb_key=cb_key/255.0f;
-	cr_key=cr_key/255.0f;
-
-	/*convert pixel to chroma colorspace */
-	rgb_to_ycc(in[0], in[1], in[2], &y_pix, &cb_pix, &cr_pix, BLI_YCC_JFIF_0_255);
-	/*normalize the values */
-	cb_pix=cb_pix/255.0f;
-	cr_pix=cr_pix/255.0f;
-
-	distance=sqrt((cb_key-cb_pix)*(cb_key-cb_pix) +
-		(cr_key-cr_pix)*(cr_key-cr_pix));
-
-	copy_v3_v3(out, in);
-
-	if (distance <= tolerance) {
-		if (distance <= falloff) {
-			alpha = 0.0f;
-		}
-		else {
-			/* alpha as percent (distance / tolerance), each modified by falloff amount (in pixels)*/
-			alpha=(distance-falloff)/(tolerance-falloff);
-		}
-
-		/*only change if more transparent than before */
-		if (alpha < in[3]) {
-			/*clamp*/
-			if (alpha < 0.0f) alpha = 0.0f;
-			if (alpha > 1.0f) alpha = 1.0f;
-			out[3]=alpha;
-		}
-		else { /* leave as before */
-			out[3]=in[3];
-		}
-	}
-}
-
-static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/*
-	 * Loosely based on the Sequencer chroma key plug-in, but enhanced to work in other color spaces and
-	 * uses a different difference function (suggested in forums of vfxtalk.com).
-	 */
-	CompBuf *workbuf;
-	CompBuf *inbuf;
-	NodeChroma *c;
-
-	/*is anything connected?*/
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
-	/*must have an image imput*/
-	if (in[0]->data==NULL) return;
-
-	inbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
-
-	c=node->storage;
-	workbuf=dupalloc_compbuf(inbuf);
-
-	/*use the input color*/
-	c->key[0] = in[1]->vec[0];
-	c->key[1] = in[1]->vec[1];
-	c->key[2] = in[1]->vec[2];
-
-	/* work in RGB color space */
-	if (c->channel == 1) {
-		/* note, processor gets a keyvals array passed on as buffer constant */
-		composit1_pixel_processor(node, workbuf, workbuf, in[0]->vec, do_distance_matte, CB_RGBA);
-	}
-	/* work in YCbCr color space */
-	else {
-		composit1_pixel_processor(node, workbuf, workbuf, in[0]->vec, do_chroma_distance_matte, CB_RGBA);
-	}
-
-
-
-	out[0]->data=workbuf;
-	if (out[1]->hasoutput)
-		out[1]->data=valbuf_from_rgbabuf(workbuf, CHAN_A);
-	generate_preview(data, node, workbuf);
-
-	if (inbuf!=in[0]->data)
-		free_compbuf(inbuf);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_distance_matte(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
@@ -204,9 +63,6 @@ void register_node_type_cmp_distance_matte(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 80, 250);
 	node_type_init(&ntype, node_composit_init_distance_matte);
 	node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_distance_matte);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
index 3c1e3ee..4f42c40 100644
--- a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
@@ -42,1239 +42,6 @@ static bNodeSocketTemplate cmp_node_doubleedgemask_out[] = {
 	{ -1, 0, "" }					// output socket array terminator
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
-{
-	int x;
-	unsigned int isz=0; // inner edge size
-	unsigned int osz=0; // outer edge size
-	unsigned int gsz=0; // gradient fill area size
-	/* Test the four corners */
-	/* upper left corner */
-	x=t-rw+1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel underneath, or to the right, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-	/* upper right corner */
-	x=t;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel underneath, or to the left, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-	/* lower left corner */
-	x=0;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel above, or to the right, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-	/* lower right corner */
-	x=rw-1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel above, or to the left, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-
-	/* Test the TOP row of pixels in buffer, except corners */
-	for (x= t-1; x>=(t-rw)+2; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel to the right, or to the left, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-
-	/* Test the BOTTOM row of pixels in buffer, except corners */
-	for (x= rw-2; x; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel to the right, or to the left, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-	/* Test the LEFT edge of pixels in buffer, except corners */
-	for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel underneath, or above, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-
-	/* Test the RIGHT edge of pixels in buffer, except corners */
-	for (x= t-rw; x>rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel underneath, or above, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-
-	rsize[0]=isz; // fill in our return sizes for edges + fill
-	rsize[1]=osz;
-	rsize[2]=gsz;
-}
-
-static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
-{
-	int x;
-	unsigned int isz=0; // inner edge size
-	unsigned int osz=0; // outer edge size
-	unsigned int gsz=0; // gradient fill area size
-	/* Test the four corners */
-	/* upper left corner */
-	x=t-rw+1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel underneath, or to the right, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x-rw] || !lomask[x+1]) {		// test if outer mask is empty underneath or to the right
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* upper right corner */
-	x=t;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel underneath, or to the left, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x-rw] || !lomask[x-1]) {	// test if outer mask is empty underneath or to the left
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* lower left corner */
-	x=0;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel above, or to the right, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x+rw] || !lomask[x+1]) {	// test if outer mask is empty above or to the right
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* lower right corner */
-	x=rw-1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if pixel above, or to the left, are empty in the inner mask,
-		// but filled in the outer mask
-		if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x+rw] || !lomask[x-1]) {	// test if outer mask is empty above or to the left
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* Test the TOP row of pixels in buffer, except corners */
-	for (x= t-1; x>=(t-rw)+2; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel to the left, or to the right, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-1] || !lomask[x+1]) {	// test if outer mask is empty to the left or to the right
-				osz++;							// increment outer edge size
-				lres[x]=3;						// flag pixel as outer edge
-			}
-			else {
-				gsz++;							// increment the gradient pixel count
-				lres[x]=2;						// flag pixel as gradient
-			}
-		}
-	}
-
-	/* Test the BOTTOM row of pixels in buffer, except corners */
-	for (x= rw-2; x; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel to the left, or to the right, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-1] || !lomask[x+1]) {	// test if outer mask is empty to the left or to the right
-				osz++;							// increment outer edge size
-				lres[x]=3;						// flag pixel as outer edge
-			}
-			else {
-				gsz++;							// increment the gradient pixel count
-				lres[x]=2;						// flag pixel as gradient
-			}
-		}
-	}
-	/* Test the LEFT edge of pixels in buffer, except corners */
-	for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel underneath, or above, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-rw] || !lomask[x+rw]) {	// test if outer mask is empty underneath or above
-				osz++;								// increment outer edge size
-				lres[x]=3;							// flag pixel as outer edge
-			}
-			else {
-				gsz++;							// increment the gradient pixel count
-				lres[x]=2;						// flag pixel as gradient
-			}
-		}
-	}
-
-	/* Test the RIGHT edge of pixels in buffer, except corners */
-	for (x= t-rw; x>rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if pixel underneath, or above, are empty in the inner mask,
-			// but filled in the outer mask
-			if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-rw] || !lomask[x+rw]) {	// test if outer mask is empty underneath or above
-				osz++;								// increment outer edge size
-				lres[x]=3;							// flag pixel as outer edge
-			}
-			else {
-				gsz++;							// increment the gradient pixel count
-				lres[x]=2;						// flag pixel as gradient
-			}
-		}
-	}
-
-	rsize[0]=isz;  // fill in our return sizes for edges + fill
-	rsize[1]=osz;
-	rsize[2]=gsz;
-}
-
-static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
-{
-	int x;
-	unsigned int isz=0; // inner edge size
-	unsigned int osz=0; // outer edge size
-	unsigned int gsz=0; // gradient fill area size
-	/* Test the four corners */
-	/* upper left corner */
-	x=t-rw+1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if the inner mask is empty underneath or to the right
-		if (!limask[x-rw] || !limask[x+1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-	/* upper right corner */
-	x=t;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if the inner mask is empty underneath or to the left
-		if (!limask[x-rw] || !limask[x-1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-	/* lower left corner */
-	x=0;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if inner mask is empty above or to the right
-		if (!limask[x+rw] || !limask[x+1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-	/* lower right corner */
-	x=rw-1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if inner mask is empty above or to the left
-		if (!limask[x+rw] || !limask[x-1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		osz++;									// increment outer edge size
-		lres[x]=3;								// flag pixel as outer edge
-	}
-
-	/* Test the TOP row of pixels in buffer, except corners */
-	for (x= t-1; x>=(t-rw)+2; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty to the left or to the right
-			if (!limask[x-1] || !limask[x+1]) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-
-	/* Test the BOTTOM row of pixels in buffer, except corners */
-	for (x= rw-2; x; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty to the left or to the right
-			if (!limask[x-1] || !limask[x+1]) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-	/* Test the LEFT edge of pixels in buffer, except corners */
-	for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty underneath or above
-			if (!limask[x-rw] || !limask[x+rw]) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-
-	/* Test the RIGHT edge of pixels in buffer, except corners */
-	for (x= t-rw; x>rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty underneath or above
-			if (!limask[x-rw] || !limask[x+rw]) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-	}
-
-	rsize[0]=isz;  // fill in our return sizes for edges + fill
-	rsize[1]=osz;
-	rsize[2]=gsz;
-}
-
-static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
-{
-	int x;
-	unsigned int isz=0; // inner edge size
-	unsigned int osz=0; // outer edge size
-	unsigned int gsz=0; // gradient fill area size
-	/* Test the four corners */
-	/* upper left corner */
-	x=t-rw+1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if the inner mask is empty underneath or to the right
-		if (!limask[x-rw] || !limask[x+1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x-rw] || !lomask[x+1]) {	// test if outer mask is empty underneath or to the right
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* upper right corner */
-	x=t;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if the inner mask is empty underneath or to the left
-		if (!limask[x-rw] || !limask[x-1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x-rw] || !lomask[x-1]) {		// test if outer mask is empty above or to the left
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* lower left corner */
-	x=0;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if inner mask is empty above or to the right
-		if (!limask[x+rw] || !limask[x+1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x+rw] || !lomask[x+1]) {	// test if outer mask is empty underneath or to the right
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* lower right corner */
-	x=rw-1;
-	// test if inner mask is filled
-	if (limask[x]) {
-		// test if inner mask is empty above or to the left
-		if (!limask[x+rw] || !limask[x-1]) {
-			isz++;								// increment inner edge size
-			lres[x]=4;							// flag pixel as inner edge
-		}
-		else {
-			res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-		}
-	}
-	else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-		if (!lomask[x+rw] || !lomask[x-1]) {	// test if outer mask is empty underneath or to the left
-			osz++;								// increment outer edge size
-			lres[x]=3;							// flag pixel as outer edge
-		}
-		else {
-			gsz++;								// increment the gradient pixel count
-			lres[x]=2;							// flag pixel as gradient
-		}
-	}
-	/* Test the TOP row of pixels in buffer, except corners */
-	for (x= t-1; x>=(t-rw)+2; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty to the left or to the right
-			if (!limask[x-1] || !limask[x+1]) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-1] || !lomask[x+1]) {	// test if outer mask is empty to the left or to the right
-				osz++;							// increment outer edge size
-				lres[x]=3;						// flag pixel as outer edge
-			}
-			else {
-				gsz++;							// increment the gradient pixel count
-				lres[x]=2;						// flag pixel as gradient
-			}
-		}
-	}
-
-	/* Test the BOTTOM row of pixels in buffer, except corners */
-	for (x= rw-2; x; x--) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty to the left or to the right
-			if (!limask[x-1] || !limask[x+1]) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {					// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-1] || !lomask[x+1]) {	// test if outer mask is empty to the left or to the right
-				osz++;							// increment outer edge size
-				lres[x]=3;						// flag pixel as outer edge
-			}
-			else {
-				gsz++;							// increment the gradient pixel count
-				lres[x]=2;						// flag pixel as gradient
-			}
-		}
-	}
-	/* Test the LEFT edge of pixels in buffer, except corners */
-	for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty underneath or above
-			if (!limask[x-rw] || !limask[x+rw]) {
-				isz++;								// increment inner edge size
-				lres[x]=4;							// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;						// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-rw] || !lomask[x+rw]) {	// test if outer mask is empty underneath or above
-				osz++;								// increment outer edge size
-				lres[x]=3;							// flag pixel as outer edge
-			}
-			else {
-				gsz++;								// increment the gradient pixel count
-				lres[x]=2;							// flag pixel as gradient
-			}
-		}
-	}
-
-	/* Test the RIGHT edge of pixels in buffer, except corners */
-	for (x= t-rw; x>rw; x-=rw) {
-		// test if inner mask is filled
-		if (limask[x]) {
-			// test if inner mask is empty underneath or above
-			if (!limask[x-rw] || !limask[x+rw]) {
-				isz++;							// increment inner edge size
-				lres[x]=4;						// flag pixel as inner edge
-			}
-			else {
-				res[x]=1.0f;					// pixel is just part of inner mask, and it's not an edge
-			}
-		}
-		else if (lomask[x]) {						// inner mask was empty, test if outer mask is filled
-			if (!lomask[x-rw] || !lomask[x+rw]) {	// test if outer mask is empty underneath or above
-				osz++;								// increment outer edge size
-				lres[x]=3;							// flag pixel as outer edge
-			}
-			else {
-				gsz++;							// increment the gradient pixel count
-				lres[x]=2;						// flag pixel as gradient
-			}
-		}
-	}
-
-	rsize[0]=isz;  // fill in our return sizes for edges + fill
-	rsize[1]=osz;
-	rsize[2]=gsz;
-}
-
-static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz)
-{
-	int x;								// x = pixel loop counter
-	int a;								// a = pixel loop counter
-	int dx;								// dx = delta x
-	int pix_prevRow;					// pix_prevRow = pixel one row behind the one we are testing in a loop
-	int pix_nextRow;					// pix_nextRow = pixel one row in front of the one we are testing in a loop
-	int pix_prevCol;					// pix_prevCol = pixel one column behind the one we are testing in a loop
-	int pix_nextCol;					// pix_nextCol = pixel one column in front of the one we are testing in a loop
-	/* Test all rows between the FIRST and LAST rows, excluding left and right edges */
-	for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw, dx-=rw) {
-		a=x-2;
-		pix_prevRow=a+rw;
-		pix_nextRow=a-rw;
-		pix_prevCol=a+1;
-		pix_nextCol=a-1;
-		while (a>dx-2) {
-			if (!limask[a]) {			// if the inner mask is empty
-				if (lomask[a]) {		// if the outer mask is full
-					/*
-					 * Next we test all 4 directions around the current pixel: next/prev/up/down
-					 * The test ensures that the outer mask is empty and that the inner mask
-					 * is also empty. If both conditions are true for any one of the 4 adjacent pixels
-					 * then the current pixel is counted as being a true outer edge pixel.
-					 */
-					if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
-					    (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
-					    (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
-					    (!lomask[pix_prevRow] && !limask[pix_prevRow]))
-					{
-						in_osz++;		// increment the outer boundary pixel count
-						lres[a]=3;		// flag pixel as part of outer edge
-					}
-					else {				// it's not a boundary pixel, but it is a gradient pixel
-						in_gsz++;		// increment the gradient pixel count
-						lres[a]=2;		// flag pixel as gradient
-					}
-				}
-
-			}
-			else {
-				if (!limask[pix_nextCol] || !limask[pix_prevCol] || !limask[pix_nextRow] || !limask[pix_prevRow]) {
-					in_isz++;			// increment the inner boundary pixel count
-					lres[a]=4;			// flag pixel as part of inner edge
-				}
-				else {
-					res[a]=1.0f;		// pixel is part of inner mask, but not at an edge
-				}
-			}
-			a--;
-			pix_prevRow--;
-			pix_nextRow--;
-			pix_prevCol--;
-			pix_nextCol--;
-		}
-	}
-
-	rsize[0]=in_isz;  // fill in our return sizes for edges + fill
-	rsize[1]=in_osz;
-	rsize[2]=in_gsz;
-}
-
-static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz)
-{
-	int x;							// x = pixel loop counter
-	int a;							// a = pixel loop counter
-	int dx;							// dx = delta x
-	int pix_prevRow;				// pix_prevRow = pixel one row behind the one we are testing in a loop
-	int pix_nextRow;				// pix_nextRow = pixel one row in front of the one we are testing in a loop
-	int pix_prevCol;				// pix_prevCol = pixel one column behind the one we are testing in a loop
-	int pix_nextCol;				// pix_nextCol = pixel one column in front of the one we are testing in a loop
-	/* Test all rows between the FIRST and LAST rows, excluding left and right edges */
-	for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw, dx-=rw) {
-		a=x-2;
-		pix_prevRow=a+rw;
-		pix_nextRow=a-rw;
-		pix_prevCol=a+1;
-		pix_nextCol=a-1;
-		while (a>dx-2) {
-			if (!limask[a]) {			// if the inner mask is empty
-				if (lomask[a]) {		// if the outer mask is full
-					/*
-					 * Next we test all 4 directions around the current pixel: next/prev/up/down
-					 * The test ensures that the outer mask is empty and that the inner mask
-					 * is also empty. If both conditions are true for any one of the 4 adjacent pixels
-					 * then the current pixel is counted as being a true outer edge pixel.
-					 */
-					if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
-					    (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
-					    (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
-					    (!lomask[pix_prevRow] && !limask[pix_prevRow]))
-					{
-						in_osz++;		// increment the outer boundary pixel count
-						lres[a]=3;		// flag pixel as part of outer edge
-					}
-					else {				// it's not a boundary pixel, but it is a gradient pixel
-						in_gsz++;		// increment the gradient pixel count
-						lres[a]=2;		// flag pixel as gradient
-					}
-				}
-
-			}
-			else {
-				if ((!limask[pix_nextCol] && lomask[pix_nextCol]) ||
-				    (!limask[pix_prevCol] && lomask[pix_prevCol]) ||
-				    (!limask[pix_nextRow] && lomask[pix_nextRow]) ||
-				    (!limask[pix_prevRow] && lomask[pix_prevRow]))
-				{
-					in_isz++;			// increment the inner boundary pixel count
-					lres[a]=4;			// flag pixel as part of inner edge
-				}
-				else {
-					res[a]=1.0f;		// pixel is part of inner mask, but not at an edge
-				}
-			}
-			a--;
-			pix_prevRow--;				// advance all four "surrounding" pixel pointers
-			pix_nextRow--;
-			pix_prevCol--;
-			pix_nextCol--;
-		}
-	}
-
-	rsize[0]=in_isz;  // fill in our return sizes for edges + fill
-	rsize[1]=in_osz;
-	rsize[2]=in_gsz;
-}
-
-static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigned int *lres, float *res, unsigned short *gbuf, unsigned int *innerEdgeOffset, unsigned int *outerEdgeOffset, unsigned int isz, unsigned int gsz)
-{
-	int x;							// x = pixel loop counter
-	int a;							// a = temporary pixel index buffer loop counter
-	unsigned int ud;				// ud = unscaled edge distance
-	unsigned int dmin;				// dmin = minimum edge distance
-
-	unsigned int rsl;				// long used for finding fast 1.0/sqrt
-	unsigned int gradientFillOffset;
-	unsigned int innerAccum=0;		// for looping inner edge pixel indexes, represents current position from offset
-	unsigned int outerAccum=0;		// for looping outer edge pixel indexes, represents current position from offset
-	unsigned int gradientAccum=0;	// for looping gradient pixel indexes, represents current position from offset
-	/*
-	 * Here we compute the size of buffer needed to hold (row, col) coordinates
-	 * for each pixel previously determined to be either gradient, inner edge,
-	 * or outer edge.
-	 *
-	 * Allocation is done by requesting 4 bytes "sizeof(int)" per pixel, even
-	 * though gbuf[] is declared as unsigned short* (2 bytes) because we don't
-	 * store the pixel indexes, we only store x, y location of pixel in buffer.
-	 *
-	 * This does make the assumption that x and y can fit in 16 unsigned bits
-	 * so if Blender starts doing renders greater than 65536 in either direction
-	 * this will need to allocate gbuf[] as unsigned int* and allocate 8 bytes
-	 * per flagged pixel.
-	 *
-	 * In general, the buffer on-screen:
-	 *
-	 * Example:  9 by 9 pixel block
-	 *
-	 * . = pixel non-white in both outer and inner mask
-	 * o = pixel white in outer, but not inner mask, adjacent to "." pixel
-	 * g = pixel white in outer, but not inner mask, not adjacent to "." pixel
-	 * i = pixel white in inner mask, adjacent to "g" or "." pixel
-	 * F = pixel white in inner mask, only adjacent to other pixels white in the inner mask
-	 *
-	 *
-	 *                  .........   <----- pixel #80
-	 *                  ..oooo...
-	 *                  .oggggo..
-	 *                  .oggiggo.
-	 *                  .ogiFigo.
-	 *                  .oggiggo.
-	 *                  .oggggo..
-	 *                  ..oooo...
-	 * pixel #00 -----> .........
-	 *
-	 * gsz = 18   (18 "g" pixels above)
-	 * isz = 4    (4 "i" pixels above)
-	 * osz = 18   (18 "o" pixels above)
-	 *
-	 *
-	 * The memory in gbuf[] after filling will look like this:
-	 *
-	 *  gradientFillOffset (0 pixels)                   innerEdgeOffset (18 pixels)    outerEdgeOffset (22 pixels)
-	 * /                                               /                              /
-	 * /                                               /                              /
-	 * |X   Y   X   Y   X   Y   X   Y   >     <X   Y   X   Y   >     <X   Y   X   Y   X   Y   >     <X   Y   X   Y   | <- (x, y)
-	 * +-------------------------------->     <---------------->     <------------------------>     <----------------+
-	 * |0   2   4   6   8   10  12  14  > ... <68  70  72  74  > ... <80  82  84  86  88  90  > ... <152 154 156 158 | <- bytes
-	 * +-------------------------------->     <---------------->     <------------------------>     <----------------+
-	 * |g0  g0  g1  g1  g2  g2  g3  g3  >     <g17 g17 i0  i0  >     <i2  i2  i3  i3  o0  o0  >     <o16 o16 o17 o17 | <- pixel
-	 *                                              /                              /                              /
-	 *                                             /                              /                              /
-	 *                                            /                              /                              /
-	 *   +---------- gradientAccum (18) ---------+      +--- innerAccum (22) ---+      +--- outerAccum (40) ---+
-	 *
-	 *
-	 * Ultimately we do need the pixel's memory buffer index to set the output
-	 * pixel color, but it's faster to reconstruct the memory buffer location
-	 * each iteration of the final gradient calculation than it is to deconstruct
-	 * a memory location into x, y pairs each round.
-	 */
-
-
-	gradientFillOffset=0;								// since there are likely "more" of these, put it first. :)
-	*innerEdgeOffset=gradientFillOffset+gsz;			// set start of inner edge indexes
-	*outerEdgeOffset=(*innerEdgeOffset)+isz;			// set start of outer edge indexes
-	/* set the accumulators to correct positions */		// set up some accumulator variables for loops
-	gradientAccum = gradientFillOffset;					// each accumulator variable starts at its respective
-	innerAccum = *innerEdgeOffset;						// section's offset so when we start filling, each
-	outerAccum = *outerEdgeOffset;						// section fills up it's allocated space in gbuf
-	//uses dmin=row, rsl=col
-	for (x=0, dmin=0; x<t; x+=rw, dmin++) {
-		for (rsl=0; rsl<rw; rsl++) {
-			a=x+rsl;
-			if (lres[a]==2) {			// it is a gradient pixel flagged by 2
-				ud=gradientAccum<<1;	// double the index to reach correct unsigned short location
-				gbuf[ud]=dmin;			// insert pixel's row into gradient pixel location buffer
-				gbuf[ud+1]=rsl;			// insert pixel's column into gradient pixel location buffer
-				gradientAccum++;		// increment gradient index buffer pointer
-			}
-			else if (lres[a]==3) {		// it is an outer edge pixel flagged by 3
-				ud=outerAccum<<1;		// double the index to reach correct unsigned short location
-				gbuf[ud]=dmin;			// insert pixel's row into outer edge pixel location buffer
-				gbuf[ud+1]=rsl;			// insert pixel's column into outer edge pixel location buffer
-				outerAccum++;			// increment outer edge index buffer pointer
-				res[a]=0.0f;			// set output pixel intensity now since it won't change later
-			}
-			else if (lres[a]==4) {		// it is an inner edge pixel flagged by 4
-				ud=innerAccum<<1;		// double int index to reach correct unsigned short location
-				gbuf[ud]=dmin;			// insert pixel's row into inner edge pixel location buffer
-				gbuf[ud+1]=rsl;			// insert pixel's column into inner edge pixel location buffer
-				innerAccum++;			// increment inner edge index buffer pointer
-				res[a]=1.0f;			// set output pixel intensity now since it won't change later
-			}
-		}
-	}
-
-}
-
-static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *gbuf, unsigned int isz, unsigned int osz, unsigned int gsz, unsigned int innerEdgeOffset, unsigned int outerEdgeOffset)
-{
-	int x;							// x = pixel loop counter
-	int a;							// a = temporary pixel index buffer loop counter
-	int fsz;						// size of the frame
-	unsigned int rsl;				// long used for finding fast 1.0/sqrt
-	float rsf;						// float used for finding fast 1.0/sqrt
-	const float rsopf = 1.5f;		// constant float used for finding fast 1.0/sqrt
-
-	unsigned int gradientFillOffset;
-	unsigned int t;
-	unsigned int ud;				// ud = unscaled edge distance
-	unsigned int dmin;				// dmin = minimum edge distance
-	float odist;					// odist = current outer edge distance
-	float idist;					// idist = current inner edge distance
-	int dx;							// dx = X-delta (used for distance proportion calculation)
-	int dy;							// dy = Y-delta (used for distance proportion calculation)
-	/*
-	 * The general algorithm used to color each gradient pixel is:
-	 *
-	 * 1.) Loop through all gradient pixels.
-	 *    A.) For each gradient pixel:
-	 *        a.) Loop though all outside edge pixels, looking for closest one
-	 *            to the gradient pixel we are in.
-	 *        b.) Loop through all inside edge pixels, looking for closest one
-	 *            to the gradient pixel we are in.
-	 *        c.) Find proportion of distance from gradient pixel to inside edge
-	 *            pixel compared to sum of distance to inside edge and distance to
-	 *            outside edge.
-	 *
-	 *            In an image where:
-	 *            . = blank (black) pixels, not covered by inner mask or outer mask
-	 *            + = desired gradient pixels, covered only by outer mask
-	 *            * = white full mask pixels, covered by at least inner mask
-	 *
-	 *            ...............................
-	 *            ...............+++++++++++.....
-	 *            ...+O++++++..++++++++++++++....
-	 *            ..+++\++++++++++++++++++++.....
-	 *            .+++++G+++++++++*******+++.....
-	 *            .+++++|+++++++*********+++.....
-	 *            .++***I****************+++.....
-	 *            .++*******************+++......
-	 *            .+++*****************+++.......
-	 *            ..+++***************+++........
-	 *            ....+++**********+++...........
-	 *            ......++++++++++++.............
-	 *            ...............................
-	 *
-	 *                O = outside edge pixel
-	 *                 \
-	 *                  G = gradient pixel
-	 *                  |
-	 *                  I = inside edge pixel
-	 *
-	 *                             __
-	 *                  *note that IO does not need to be a straight line, in fact
-	 *                   many cases can arise where straight lines do not work
-	 *                   correctly.
-	 *
-	 *                                        __       __     __
-	 *        d.) Pixel color is assigned as |GO| / ( |GI| + |GO| )
-	 *
-	 * The implementation does not compute distance, but the reciprocal of the
-	 * distance. This is done to avoid having to compute a square root, as a
-	 * reciprocal square root can be computed faster. Therefore, the code computes
-	 * pixel color as |GI| / (|GI| + |GO|). Since these are reciprocals, GI serves the
-	 * purpose of GO for the proportion calculation.
-	 *
-	 * For the purposes of the minimum distance comparisons, we only check
-	 * the sums-of-squares against each other, since they are in the same
-	 * mathematical sort-order as if we did go ahead and take square roots
-	 *
-	 * Loop through all gradient pixels.
-	 */
-
-	for (x= gsz-1; x>=0; x--) {
-		gradientFillOffset=x<<1;
-		t=gbuf[gradientFillOffset];		// calculate column of pixel indexed by gbuf[x]
-		fsz=gbuf[gradientFillOffset+1];	// calculate row of pixel indexed by gbuf[x]
-		dmin=0xffffffff;					// reset min distance to edge pixel
-		for (a=outerEdgeOffset+osz-1; a>=outerEdgeOffset; a--) {	// loop through all outer edge buffer pixels
-			ud=a<<1;
-			dy=t-gbuf[ud];					// set dx to gradient pixel column - outer edge pixel row
-			dx=fsz-gbuf[ud+1];				// set dy to gradient pixel row - outer edge pixel column
-			ud=dx*dx+dy*dy;					// compute sum of squares
-			if (ud<dmin) {					// if our new sum of squares is less than the current minimum
-				dmin=ud;					// set a new minimum equal to the new lower value
-			}
-		}
-		odist=(float)(dmin);					// cast outer min to a float
-		rsf=odist*0.5f;							//
-		rsl=*(unsigned int*)&odist;				// use some peculiar properties of the way bits are stored
-		rsl=0x5f3759df-(rsl>>1);				// in floats vs. unsigned ints to compute an approximate
-		odist=*(float*)&rsl;					// reciprocal square root
-		odist=odist*(rsopf-(rsf*odist*odist));	// -- ** this line can be iterated for more accuracy ** --
-		dmin=0xffffffff;						// reset min distance to edge pixel
-		for (a= innerEdgeOffset+isz-1; a>=innerEdgeOffset; a--) {	// loop through all inside edge pixels
-			ud=a<<1;
-			dy=t-gbuf[ud];			// compute delta in Y from gradient pixel to inside edge pixel
-			dx=fsz-gbuf[ud+1];		// compute delta in X from gradient pixel to inside edge pixel
-			ud=dx*dx+dy*dy;			// compute sum of squares
-			if (ud<dmin) {			// if our new sum of squares is less than the current minimum we've found
-				dmin=ud;			// set a new minimum equal to the new lower value
-			}
-		}
-		idist=(float)(dmin);					// cast inner min to a float
-		rsf=idist*0.5f;							//
-		rsl=*(unsigned int*)&idist;				//
-		rsl=0x5f3759df-(rsl>>1);				// see notes above
-		idist=*(float*)&rsl;					//
-		idist=idist*(rsopf-(rsf*idist*idist));	//
-		/*
-		 * Note once again that since we are using reciprocals of distance values our
-		 * proportion is already the correct intensity, and does not need to be
-		 * subtracted from 1.0 like it would have if we used real distances.
-		 */
-
-		/*
-		 * Here we reconstruct the pixel's memory location in the CompBuf by
-		 * Pixel Index = Pixel Column + ( Pixel Row * Row Width )
-		 */
-		res[gbuf[gradientFillOffset+1]+(gbuf[gradientFillOffset]*rw)]=(idist/(idist+odist));	//set intensity
-	}
-
-}
-
-
-static void node_composit_exec_doubleedgemask(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-
-	float *imask;					// imask = pointer to inner mask pixel buffer
-	float *omask;					// omask = pointer to outer mask pixel buffer
-	float *res;						// res = pointer to output mask
-
-	unsigned int *lres;				// lres = unsigned int pointer to output pixel buffer (for bit operations)
-	unsigned int *limask;			// limask = unsigned int pointer to inner mask (for bit operations)
-	unsigned int *lomask;			// lomask = unsigned int pointer to outer mask (for bit operations)
-
-	int rw;							// rw = pixel row width
-	int t;							// t = total number of pixels in buffer - 1 (used for loop starts)
-	int fsz;						// size of the frame
-
-	unsigned int isz=0;				// size (in pixels) of inside edge pixel index buffer
-	unsigned int osz=0;				// size (in pixels) of outside edge pixel index buffer
-	unsigned int gsz=0;				// size (in pixels) of gradient pixel index buffer
-	unsigned int rsize[3];			// size storage to pass to helper functions
-	unsigned int innerEdgeOffset=0;	// offset into final buffer where inner edge pixel indexes start
-	unsigned int outerEdgeOffset=0;	// offset into final buffer where outer edge pixel indexes start
-
-	unsigned short *gbuf;			// gradient/inner/outer pixel location index buffer
-
-	CompBuf *cbuf;					// pointer, will be set to inner mask data
-	CompBuf *dbuf;					// pointer, will be set to outer mask data
-	CompBuf *stackbuf;				// pointer, will get allocated as output buffer
-
-	if (out[0]->hasoutput==0) {		// if the node's output socket is not connected to anything...
-		return;						//     do not execute any further, just exit the node immediately
-	}
-
-	if (in[0]->data && in[1]->data) {					// if both input sockets have some data coming in...
-		cbuf= in[0]->data;								//     get a pointer to the inner mask data
-		dbuf= in[1]->data;								//     get a pointer to the outer mask data
-		if (cbuf->type!=CB_VAL || dbuf->type!=CB_VAL) {	// if either input socket has an incorrect data type coming in
-			return;										//     exit the node immediately
-		}
-
-		t=(cbuf->x*cbuf->y)-1;									// determine size of the frame
-
-		stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);	// allocate the output buffer
-
-		imask= cbuf->rect;				// set the inner mask
-		omask= dbuf->rect;				// set the outer mask
-		res= stackbuf->rect;			// set output pointer
-		lres= (unsigned int*)res;		// unsigned int pointer to output buffer (for bit level ops)
-		limask=(unsigned int*)imask;	// unsigned int pointer to input mask (for bit level ops)
-		lomask=(unsigned int*)omask;	// unsigned int pointer to output mask (for bit level ops)
-		rw= cbuf->x;					// width of a row of pixels
-
-
-		/*
-		 * The whole buffer is broken up into 4 parts. The four CORNERS, the FIRST and LAST rows, the
-		 * LEFT and RIGHT edges (excluding the corner pixels), and all OTHER rows.
-		 * This allows for quick computation of outer edge pixels where
-		 * a screen edge pixel is marked to be gradient.
-		 *
-		 * The pixel type (gradient vs inner-edge vs outer-edge) tests change
-		 * depending on the user selected "Inner Edge Mode" and the user selected
-		 * "Buffer Edge Mode" on the node's GUI. There are 4 sets of basically the
-		 * same algorithm:
-		 *
-		 * 1.) Inner Edge -> Adjacent Only
-		 *     Buffer Edge -> Keep Inside
-		 *
-		 * 2.) Inner Edge -> Adjacent Only
-		 *     Buffer Edge -> Bleed Out
-		 *
-		 * 3.) Inner Edge -> All
-		 *     Buffer Edge -> Keep Inside
-		 *
-		 * 4.) Inner Edge -> All
-		 *     Buffer Edge -> Bleed Out
-		 *
-		 * Each version has slightly different criteria for detecting an edge pixel.
-		 */
-		if (node->custom2) {		// if "adjacent only" inner edge mode is turned on
-			if (node->custom1) {	// if "keep inside" buffer edge mode is turned on
-				do_adjacentKeepBorders(t, rw, limask, lomask, lres, res, rsize);
-			}
-			else {					// "bleed out" buffer edge mode is turned on
-				do_adjacentBleedBorders(t, rw, limask, lomask, lres, res, rsize);
-			}
-			isz=rsize[0];			// set up inner edge, outer edge, and gradient buffer sizes after border pass
-			osz=rsize[1];
-			gsz=rsize[2];
-			// detect edges in all non-border pixels in the buffer
-			do_adjacentEdgeDetection(t, rw, limask, lomask, lres, res, rsize, isz, osz, gsz);
-		}
-		else {						// "all" inner edge mode is turned on
-			if (node->custom1) {	// if "keep inside" buffer edge mode is turned on
-				do_allKeepBorders(t, rw, limask, lomask, lres, res, rsize);
-			}
-			else {					// "bleed out" buffer edge mode is turned on
-				do_allBleedBorders(t, rw, limask, lomask, lres, res, rsize);
-			}
-			isz=rsize[0];			// set up inner edge, outer edge, and gradient buffer sizes after border pass
-			osz=rsize[1];
-			gsz=rsize[2];
-			// detect edges in all non-border pixels in the buffer
-			do_allEdgeDetection(t, rw, limask, lomask, lres, res, rsize, isz, osz, gsz);
-		}
-
-		isz=rsize[0];				// set edge and gradient buffer sizes once again...
-		osz=rsize[1];				// the sizes in rsize[] may have been modified
-		gsz=rsize[2];				// by the do_*EdgeDetection() function.
-
-		// quick check for existance of edges in the buffer...
-		// if we don't have any one of the three sizes, the other two make no difference visually,
-		// so we can just pass the inner input buffer back as output.
-		if (!gsz || !isz || !osz) {
-			out[0]->data= stackbuf;	// point the node output buffer to our filled buffer
-			return;
-		}
-
-
-		fsz=gsz+isz+osz;									// calculate size of pixel index buffer needed
-		gbuf= MEM_mallocN(fsz*sizeof(int), "grd buf");		// allocate edge/gradient pixel index buffer
-
-		do_createEdgeLocationBuffer(t, rw, lres, res, gbuf, &innerEdgeOffset, &outerEdgeOffset, isz, gsz);
-		do_fillGradientBuffer(rw, res, gbuf, isz, osz, gsz, innerEdgeOffset, outerEdgeOffset);
-
-		MEM_freeN(gbuf);		// free the gradient index buffer
-		out[0]->data= stackbuf;	// point the node output buffer to our filled buffer
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_doubleedgemask(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;	// allocate a node type data structure
@@ -1282,9 +49,6 @@ void register_node_type_cmp_doubleedgemask(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_MATTE, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_doubleedgemask_in, cmp_node_doubleedgemask_out);
 	node_type_size(&ntype, 210, 210, 210);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_doubleedgemask);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_filter.c b/source/blender/nodes/composite/nodes/node_composite_filter.c
index a27116a..338bfc0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_filter.c
+++ b/source/blender/nodes/composite/nodes/node_composite_filter.c
@@ -43,186 +43,6 @@ static bNodeSocketTemplate cmp_node_filter_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac)
-{
-	float *row1, *row2, *row3;
-	float *fp, f1, f2, mfac= 1.0f-fac;
-	int rowlen, x, y, c, pix= in->type;
-	
-	rowlen= in->x;
-	
-	for (y=0; y<in->y; y++) {
-		/* setup rows */
-		if (y==0) row1= in->rect;
-		else row1= in->rect + pix*(y-1)*rowlen;
-		
-		row2= in->rect + y*pix*rowlen;
-		
-		if (y==in->y-1) row3= row2;
-		else row3= row2 + pix*rowlen;
-		
-		fp= out->rect + pix*y*rowlen;
-		
-		if (pix==CB_RGBA) {
-			copy_v4_v4(fp, row2);
-			fp+= pix;
-			
-			for (x=2; x<rowlen; x++) {
-				for (c=0; c<3; c++) {
-					f1= filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8];
-					f2= filter[0]*row1[0] + filter[3]*row1[4] + filter[6]*row1[8] + filter[1]*row2[0] + filter[4]*row2[4] + filter[7]*row2[8] + filter[2]*row3[0] + filter[5]*row3[4] + filter[8]*row3[8];
-					fp[0] = mfac*row2[4] + fac*sqrt(f1*f1 + f2*f2);
-					fp++; row1++; row2++; row3++;
-				}
-				fp[0] = row2[4];
-				/* no alpha... will clear it completely */
-				fp++; row1++; row2++; row3++;
-			}
-			copy_v4_v4(fp, row2+4);
-		}
-		else if (pix==CB_VAL) {
-			fp+= pix;
-			for (x=2; x<rowlen; x++) {
-				f1= filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2];
-				f2= filter[0]*row1[0] + filter[3]*row1[1] + filter[6]*row1[2] + filter[1]*row2[0] + filter[4]*row2[1] + filter[7]*row2[2] + filter[2]*row3[0] + filter[5]*row3[1] + filter[8]*row3[2];
-				fp[0] = mfac*row2[1] + fac*sqrt(f1*f1 + f2*f2);
-				fp++; row1++; row2++; row3++;
-			}
-		}
-	}
-}
-
-static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
-{
-	float *row1, *row2, *row3;
-	float *fp, mfac= 1.0f-fac;
-	int rowlen, x, y, c;
-	int pixlen= in->type;
-	
-	rowlen= in->x;
-	
-	for (y=0; y<in->y; y++) {
-		/* setup rows */
-		if (y==0) row1= in->rect;
-		else row1= in->rect + pixlen*(y-1)*rowlen;
-		
-		row2= in->rect + y*pixlen*rowlen;
-		
-		if (y==in->y-1) row3= row2;
-		else row3= row2 + pixlen*rowlen;
-		
-		fp= out->rect + pixlen*(y)*rowlen;
-		
-		if (pixlen==1) {
-			fp[0] = row2[0];
-			fp+= 1;
-			
-			for (x=2; x<rowlen; x++) {
-				fp[0] = mfac*row2[1] + fac*(filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2]);
-				fp++; row1++; row2++; row3++;
-			}
-			fp[0] = row2[1];
-		}
-		else if (pixlen==2) {
-			fp[0] = row2[0];
-			fp[1] = row2[1];
-			fp+= 2;
-			
-			for (x=2; x<rowlen; x++) {
-				for (c=0; c<2; c++) {
-					fp[0] = mfac*row2[2] + fac*(filter[0]*row1[0] + filter[1]*row1[2] + filter[2]*row1[4] + filter[3]*row2[0] + filter[4]*row2[2] + filter[5]*row2[4] + filter[6]*row3[0] + filter[7]*row3[2] + filter[8]*row3[4]);
-					fp++; row1++; row2++; row3++;
-				}
-			}
-			fp[0] = row2[2];
-			fp[1] = row2[3];
-		}
-		else if (pixlen==3) {
-			copy_v3_v3(fp, row2);
-			fp+= 3;
-			
-			for (x=2; x<rowlen; x++) {
-				for (c=0; c<3; c++) {
-					fp[0] = mfac*row2[3] + fac*(filter[0]*row1[0] + filter[1]*row1[3] + filter[2]*row1[6] + filter[3]*row2[0] + filter[4]*row2[3] + filter[5]*row2[6] + filter[6]*row3[0] + filter[7]*row3[3] + filter[8]*row3[6]);
-					fp++; row1++; row2++; row3++;
-				}
-			}
-			copy_v3_v3(fp, row2+3);
-		}
-		else {
-			copy_v4_v4(fp, row2);
-			fp+= 4;
-			
-			for (x=2; x<rowlen; x++) {
-				for (c=0; c<4; c++) {
-					fp[0] = mfac*row2[4] + fac*(filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8]);
-					fp++; row1++; row2++; row3++;
-				}
-			}
-			copy_v4_v4(fp, row2+4);
-		}
-	}
-}
-
-
-static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	static float soft[9] = {1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f};
-	float sharp[9] = {-1, -1, -1, -1, 9, -1, -1, -1, -1};
-	float laplace[9] = {-1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f, 1.0f, -1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f};
-	float sobel[9] = {1, 2, 1, 0, 0, 0, -1, -2, -1};
-	float prewitt[9] = {1, 1, 1, 0, 0, 0, -1, -1, -1};
-	float kirsch[9] = {5, 5, 5, -3, -3, -3, -2, -2, -2};
-	float shadow[9] = {1, 2, 1, 0, 1, 0, -1, -2, -1};
-	
-	if (out[0]->hasoutput==0) return;
-	
-	/* stack order in: Image */
-	/* stack order out: Image */
-	
-	if (in[1]->data) {
-		/* make output size of first available input image */
-		CompBuf *cbuf= in[1]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1); /* allocs */
-		
-		/* warning note: xof and yof are applied in pixelprocessor, but should be copied otherwise? */
-		stackbuf->xof= cbuf->xof;
-		stackbuf->yof= cbuf->yof;
-		
-		switch (node->custom1) {
-			case CMP_FILT_SOFT:
-				do_filter3(stackbuf, cbuf, soft, in[0]->vec[0]);
-				break;
-			case CMP_FILT_SHARP:
-				do_filter3(stackbuf, cbuf, sharp, in[0]->vec[0]);
-				break;
-			case CMP_FILT_LAPLACE:
-				do_filter3(stackbuf, cbuf, laplace, in[0]->vec[0]);
-				break;
-			case CMP_FILT_SOBEL:
-				do_filter_edge(stackbuf, cbuf, sobel, in[0]->vec[0]);
-				break;
-			case CMP_FILT_PREWITT:
-				do_filter_edge(stackbuf, cbuf, prewitt, in[0]->vec[0]);
-				break;
-			case CMP_FILT_KIRSCH:
-				do_filter_edge(stackbuf, cbuf, kirsch, in[0]->vec[0]);
-				break;
-			case CMP_FILT_SHADOW:
-				do_filter3(stackbuf, cbuf, shadow, in[0]->vec[0]);
-				break;
-		}
-			
-		out[0]->data= stackbuf;
-		
-		generate_preview(data, node, out[0]->data);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_filter(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -231,9 +51,6 @@ void register_node_type_cmp_filter(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_filter_in, cmp_node_filter_out);
 	node_type_size(&ntype, 80, 40, 120);
 	node_type_label(&ntype, node_filter_label);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_filter);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_flip.c b/source/blender/nodes/composite/nodes/node_composite_flip.c
index 4aa98d1..de41c72 100644
--- a/source/blender/nodes/composite/nodes/node_composite_flip.c
+++ b/source/blender/nodes/composite/nodes/node_composite_flip.c
@@ -43,55 +43,6 @@ static bNodeSocketTemplate cmp_node_flip_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (in[0]->data) {
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1);	/* note, this returns zero'd image */
-		int i, src_pix, src_width, src_height, srcydelt, outydelt, x, y;
-		float *srcfp, *outfp;
-		
-		src_pix= cbuf->type;
-		src_width= cbuf->x;
-		src_height= cbuf->y;
-		srcfp= cbuf->rect;
-		outfp= stackbuf->rect;
-		srcydelt= src_width*src_pix;
-		outydelt= srcydelt;
-		
-		if (node->custom1) {		/*set up output pointer for y flip*/
-			outfp+= (src_height-1)*outydelt;
-			outydelt= -outydelt;
-		}
-
-		for (y=0; y<src_height; y++) {
-			if (node->custom1 == 1) {	/* no x flip so just copy line*/
-				memcpy(outfp, srcfp, sizeof(float) * src_pix * src_width);
-				srcfp+=srcydelt;
-			}
-			else {
-				outfp += (src_width-1)*src_pix;
-				for (x=0; x<src_width; x++) {
-					for (i=0; i<src_pix; i++) {
-						outfp[i] = srcfp[i];
-					}
-					outfp -= src_pix;
-					srcfp += src_pix;
-				}
-				outfp += src_pix;
-			}
-			outfp += outydelt;
-		}
-
-		out[0]->data= stackbuf;
-
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_flip(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -99,9 +50,6 @@ void register_node_type_cmp_flip(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_FLIP, "Flip", NODE_CLASS_DISTORT, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_flip_in, cmp_node_flip_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_flip);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_gamma.c b/source/blender/nodes/composite/nodes/node_composite_gamma.c
index b8c9989..8a9966a 100644
--- a/source/blender/nodes/composite/nodes/node_composite_gamma.c
+++ b/source/blender/nodes/composite/nodes/node_composite_gamma.c
@@ -34,7 +34,7 @@
 #include "node_composite_util.h"
 
 /* **************** Gamma Tools  ******************** */
-  
+
 static bNodeSocketTemplate cmp_node_gamma_in[] = {
 	{	SOCK_RGBA, 1, N_("Image"),			1.0f, 1.0f, 1.0f, 1.0f},
 	{	SOCK_FLOAT, 1, N_("Gamma"),			1.0f, 0.0f, 0.0f, 0.0f, 0.001f, 10.0f, PROP_UNSIGNED},
@@ -45,40 +45,6 @@ static bNodeSocketTemplate cmp_node_gamma_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_gamma(bNode *UNUSED(node), float *out, float *in, float *fac)
-{
-	int i=0;
-	for (i=0; i<3; i++) {
-		/* check for negative to avoid nan's */
-		out[i] = (in[i] > 0.0f)? powf(in[i], fac[0]): in[i];
-	}
-	out[3] = in[3];
-}
-static void node_composit_exec_gamma(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: Fac, Image */
-	/* stack order out: Image */
-	if (out[0]->hasoutput==0) return;
-	
-	/* input no image? then only color operation */
-	if (in[0]->data==NULL) {
-		do_gamma(node, out[0]->vec, in[0]->vec, in[1]->vec);
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs
-		
-		composit2_pixel_processor(node, stackbuf, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_gamma, CB_RGBA, CB_VAL);
-
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_gamma(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -86,9 +52,6 @@ void register_node_type_cmp_gamma(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_gamma_in, cmp_node_gamma_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_gamma);
-#endif
 	
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.c b/source/blender/nodes/composite/nodes/node_composite_glare.c
index 950d8a5..5fdb262 100644
--- a/source/blender/nodes/composite/nodes/node_composite_glare.c
+++ b/source/blender/nodes/composite/nodes/node_composite_glare.c
@@ -41,442 +41,6 @@ static bNodeSocketTemplate cmp_node_glare_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-// mix two images, src buffer does not have to be same size,
-static void mixImages(CompBuf *dst, CompBuf *src, float mix)
-{
-	int x, y;
-	fRGB c1, c2, *dcolp, *scolp;
-	const float mf = 2.f - 2.f*fabsf(mix - 0.5f);
-	if ((dst->x == src->x) && (dst->y == src->y)) {
-		for (y=0; y<dst->y; y++) {
-			dcolp = (fRGB*)&dst->rect[y*dst->x*dst->type];
-			scolp = (fRGB*)&src->rect[y*dst->x*dst->type];
-			for (x=0; x<dst->x; x++) {
-				copy_v3_v3(c1, dcolp[x]);
-				copy_v3_v3(c2, scolp[x]);
-				c1[0] += mix*(c2[0] - c1[0]);
-				c1[1] += mix*(c2[1] - c1[1]);
-				c1[2] += mix*(c2[2] - c1[2]);
-				if (c1[0] < 0.f) c1[0] = 0.f;
-				if (c1[1] < 0.f) c1[1] = 0.f;
-				if (c1[2] < 0.f) c1[2] = 0.f;
-				mul_v3_fl(c1, mf);
-				copy_v3_v3(dcolp[x], c1);
-			}
-		}
-	}
-	else {
-		float xr = src->x / (float)dst->x;
-		float yr = src->y / (float)dst->y;
-		for (y=0; y<dst->y; y++) {
-			dcolp = (fRGB*)&dst->rect[y*dst->x*dst->type];
-			for (x=0; x<dst->x; x++) {
-				copy_v3_v3(c1, dcolp[x]);
-				qd_getPixelLerp(src, (x + 0.5f)*xr - 0.5f, (y + 0.5f)*yr - 0.5f, c2);
-				c1[0] += mix*(c2[0] - c1[0]);
-				c1[1] += mix*(c2[1] - c1[1]);
-				c1[2] += mix*(c2[2] - c1[2]);
-				if (c1[0] < 0.f) c1[0] = 0.f;
-				if (c1[1] < 0.f) c1[1] = 0.f;
-				if (c1[2] < 0.f) c1[2] = 0.f;
-				mul_v3_fl(c1, mf);
-				copy_v3_v3(dcolp[x], c1);
-			}
-		}
-	}
-}
-
-
-// adds src to dst image, must be of same size
-static void addImage(CompBuf* dst, CompBuf* src, float scale)
-{
-	if ((dst->x == src->x) && (dst->y == src->y)) {
-		int p = dst->x*dst->y*dst->type;
-		float *dcol = dst->rect, *scol = src->rect;
-		while (p--) *dcol++ += *scol++ * scale;
-	}
-}
-
-
-// returns possibly downscaled copy of all pixels above threshold
-static CompBuf* BTP(CompBuf* src, float threshold, int scaledown)
-{
-	int x, y;
-	CompBuf* bsrc = qd_downScaledCopy(src, scaledown);
-	float* cr = bsrc->rect;
-	for (y=0; y<bsrc->y; ++y)
-		for (x=0; x<bsrc->x; ++x, cr+=4) {
-			if (rgb_to_luma_y(cr) >= threshold) {
-				cr[0] -= threshold, cr[1] -= threshold, cr[2] -= threshold;
-				cr[0] = MAX2(cr[0], 0.f);
-				cr[1] = MAX2(cr[1], 0.f);
-				cr[2] = MAX2(cr[2], 0.f);
-			}
-			else cr[0] = cr[1] = cr[2] = 0.f;
-		}
-	return bsrc;
-}
-
-//--------------------------------------------------------------------------------------------
-// simple 4-point star filter
-
-static void star4(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
-{
-	int x, y, i, xm, xp, ym, yp;
-	float c[4] = {0, 0, 0, 0}, tc[4] = {0, 0, 0, 0};
-	CompBuf *tbuf1, *tbuf2, *tsrc;
-	const float f1 = 1.f - ndg->fade, f2 = (1.f - f1)*0.5f;
-	//const float t3 = ndg->threshold*3.f;
-	const float sc = (float)(1 << ndg->quality);
-	const float isc = 1.f/sc;
-
-	tsrc = BTP(src, ndg->threshold, (int)sc);
-
-	tbuf1 = dupalloc_compbuf(tsrc);
-	tbuf2 = dupalloc_compbuf(tsrc);
-
-	for (i=0; i<ndg->iter; i++) {
-		// (x || x-1, y-1) to (x || x+1, y+1)
-		// F
-		for (y=0; y<tbuf1->y; y++) {
-			ym = y - i;
-			yp = y + i;
-			for (x=0; x<tbuf1->x; x++) {
-				xm = x - i;
-				xp = x + i;
-				qd_getPixel(tbuf1, x, y, c);
-				mul_v3_fl(c, f1);
-				qd_getPixel(tbuf1, (ndg->angle ? xm : x), ym, tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_getPixel(tbuf1, (ndg->angle ? xp : x), yp, tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_setPixel(tbuf1, x, y, c);
-			}
-		}
-		// B
-		for (y=tbuf1->y-1; y>=0; y--) {
-			ym = y - i;
-			yp = y + i;
-			for (x=tbuf1->x-1; x>=0; x--) {
-				xm = x - i;
-				xp = x + i;
-				qd_getPixel(tbuf1, x, y, c);
-				mul_v3_fl(c, f1);
-				qd_getPixel(tbuf1, (ndg->angle ? xm : x), ym, tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_getPixel(tbuf1, (ndg->angle ? xp : x), yp, tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_setPixel(tbuf1, x, y, c);
-			}
-		}
-		// (x-1, y || y+1) to (x+1, y || y-1)
-		// F
-		for (y=0; y<tbuf2->y; y++) {
-			ym = y - i;
-			yp = y + i;
-			for (x=0; x<tbuf2->x; x++) {
-				xm = x - i;
-				xp = x + i;
-				qd_getPixel(tbuf2, x, y, c);
-				mul_v3_fl(c, f1);
-				qd_getPixel(tbuf2, xm, (ndg->angle ? yp : y), tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_getPixel(tbuf2, xp, (ndg->angle ? ym : y), tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_setPixel(tbuf2, x, y, c);
-			}
-		}
-		// B
-		for (y=tbuf2->y-1; y>=0; y--) {
-			ym = y - i;
-			yp = y + i;
-			for (x=tbuf2->x-1; x>=0; x--) {
-				xm = x - i;
-				xp = x + i;
-				qd_getPixel(tbuf2, x, y, c);
-				mul_v3_fl(c, f1);
-				qd_getPixel(tbuf2, xm, (ndg->angle ? yp : y), tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_getPixel(tbuf2, xp, (ndg->angle ? ym : y), tc);
-				madd_v3_v3fl(c, tc, f2);
-				qd_setPixel(tbuf2, x, y, c);
-			}
-		}
-	}
-
-	for (y=0; y<tbuf1->y; ++y)
-		for (x=0; x<tbuf1->x; ++x) {
-			unsigned int p = (x + y*tbuf1->x)*tbuf1->type;
-			tbuf1->rect[p] += tbuf2->rect[p];
-			tbuf1->rect[p+1] += tbuf2->rect[p+1];
-			tbuf1->rect[p+2] += tbuf2->rect[p+2];
-		}
-
-	for (y=0; y<dst->y; ++y) {
-		const float m = 0.5f + 0.5f*ndg->mix;
-		for (x=0; x<dst->x; ++x) {
-			unsigned int p = (x + y*dst->x)*dst->type;
-			qd_getPixelLerp(tbuf1, x*isc, y*isc, tc);
-			dst->rect[p] = src->rect[p] + m*(tc[0] - src->rect[p]);
-			dst->rect[p+1] = src->rect[p+1] + m*(tc[1] - src->rect[p+1]);
-			dst->rect[p+2] = src->rect[p+2] + m*(tc[2] - src->rect[p+2]);
-		}
-	}
-
-	free_compbuf(tbuf1);
-	free_compbuf(tbuf2);
-	free_compbuf(tsrc);
-}
-
-//--------------------------------------------------------------------------------------------
-// streak filter
-
-static void streaks(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
-{
-	CompBuf *bsrc, *tsrc, *tdst, *sbuf;
-	int x, y, n;
-	unsigned int nump=0;
-	fRGB c1, c2, c3, c4;
-	float a, ang = DEG2RADF(360.0f)/(float)ndg->angle;
-
-	bsrc = BTP(src, ndg->threshold, 1 << ndg->quality);
-	tsrc = dupalloc_compbuf(bsrc); // sample from buffer
-	tdst = alloc_compbuf(tsrc->x, tsrc->y, tsrc->type, 1); // sample to buffer
-	sbuf = alloc_compbuf(tsrc->x, tsrc->y, tsrc->type, 1);  // streak sum buffer
-
-	
-	for (a=0.f; a<DEG2RADF(360.0f); a+=ang) {
-		const float an = a + ndg->angle_ofs;
-		const float vx = cos((double)an), vy = sin((double)an);
-		for (n=0; n<ndg->iter; ++n) {
-			const float p4 = pow(4.0, (double)n);
-			const float vxp = vx*p4, vyp = vy*p4;
-			const float wt = pow((double)ndg->fade, (double)p4);
-			const float cmo = 1.f - (float)pow((double)ndg->colmod, (double)n+1);	// colormodulation amount relative to current pass
-			float* tdstcol = tdst->rect;
-			for (y=0; y<tsrc->y; ++y) {
-				for (x=0; x<tsrc->x; ++x, tdstcol+=4) {
-					// first pass no offset, always same for every pass, exact copy,
-					// otherwise results in uneven brightness, only need once
-					if (n==0) qd_getPixel(tsrc, x, y, c1); else c1[0]=c1[1]=c1[2]=0;
-					qd_getPixelLerp(tsrc, x + vxp,     y + vyp,     c2);
-					qd_getPixelLerp(tsrc, x + vxp*2.f, y + vyp*2.f, c3);
-					qd_getPixelLerp(tsrc, x + vxp*3.f, y + vyp*3.f, c4);
-					// modulate color to look vaguely similar to a color spectrum
-					fRGB_rgbmult(c2, 1.f, cmo, cmo);
-					fRGB_rgbmult(c3, cmo, cmo, 1.f);
-					fRGB_rgbmult(c4, cmo, 1.f, cmo);
-					tdstcol[0] = 0.5f*(tdstcol[0] + c1[0] + wt*(c2[0] + wt*(c3[0] + wt*c4[0])));
-					tdstcol[1] = 0.5f*(tdstcol[1] + c1[1] + wt*(c2[1] + wt*(c3[1] + wt*c4[1])));
-					tdstcol[2] = 0.5f*(tdstcol[2] + c1[2] + wt*(c2[2] + wt*(c3[2] + wt*c4[2])));
-				}
-			}
-			memcpy(tsrc->rect, tdst->rect, sizeof(float)*tdst->x*tdst->y*tdst->type);
-		}
-
-		addImage(sbuf, tsrc, 1.f/(float)(6 - ndg->iter));
-		memset(tdst->rect, 0, tdst->x*tdst->y*tdst->type*sizeof(float));
-		memcpy(tsrc->rect, bsrc->rect, bsrc->x*bsrc->y*bsrc->type*sizeof(float));
-		nump++;
-	}
-
-	mixImages(dst, sbuf, 0.5f + 0.5f*ndg->mix);
-
-	free_compbuf(tsrc);
-	free_compbuf(tdst);
-	free_compbuf(sbuf);
-	free_compbuf(bsrc);
-}
-
-
-//--------------------------------------------------------------------------------------------
-// Ghosts (lensflare)
-
-static float smoothMask(float x, float y)
-{
-	float t;
-	x = 2.f*x - 1.f, y = 2.f*y - 1.f;
-	if ((t = 1.f - sqrtf(x*x + y*y)) <= 0.f) return 0.f;
-	return t;
-}
-
-static void ghosts(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
-{
-	// colormodulation and scale factors (cm & scalef) for 16 passes max: 64
-	int x, y, n, p, np;
-	fRGB c, tc, cm[64];
-	float sc, isc, u, v, sm, s, t, ofs, scalef[64];
-	CompBuf *tbuf1, *tbuf2, *gbuf;
-	const float cmo = 1.f - ndg->colmod;
-	const int qt = 1 << ndg->quality;
-	const float s1 = 4.f/(float)qt, s2 = 2.f*s1;
-
-	gbuf = BTP(src, ndg->threshold, qt);
-	tbuf1 = dupalloc_compbuf(gbuf);
-	IIR_gauss(tbuf1, s1, 0, 3);
-	IIR_gauss(tbuf1, s1, 1, 3);
-	IIR_gauss(tbuf1, s1, 2, 3);
-	tbuf2 = dupalloc_compbuf(tbuf1);
-	IIR_gauss(tbuf2, s2, 0, 3);
-	IIR_gauss(tbuf2, s2, 1, 3);
-	IIR_gauss(tbuf2, s2, 2, 3);
-
-	if (ndg->iter & 1) ofs = 0.5f; else ofs = 0.f;
-	for (x=0; x<(ndg->iter*4); x++) {
-		y = x & 3;
-		cm[x][0] = cm[x][1] = cm[x][2] = 1;
-		if (y==1) fRGB_rgbmult(cm[x], 1.f, cmo, cmo);
-		if (y==2) fRGB_rgbmult(cm[x], cmo, cmo, 1.f);
-		if (y==3) fRGB_rgbmult(cm[x], cmo, 1.f, cmo);
-		scalef[x] = 2.1f*(1.f-(x+ofs)/(float)(ndg->iter*4));
-		if (x & 1) scalef[x] = -0.99f/scalef[x];
-	}
-
-	sc = 2.13;
-	isc = -0.97;
-	for (y=0; y<gbuf->y; y++) {
-		v = (float)(y+0.5f) / (float)gbuf->y;
-		for (x=0; x<gbuf->x; x++) {
-			u = (float)(x+0.5f) / (float)gbuf->x;
-			s = (u-0.5f)*sc + 0.5f, t = (v-0.5f)*sc + 0.5f;
-			qd_getPixelLerp(tbuf1, s*gbuf->x, t*gbuf->y, c);
-			sm = smoothMask(s, t);
-			mul_v3_fl(c, sm);
-			s = (u-0.5f)*isc + 0.5f, t = (v-0.5f)*isc + 0.5f;
-			qd_getPixelLerp(tbuf2, s*gbuf->x - 0.5f, t*gbuf->y - 0.5f, tc);
-			sm = smoothMask(s, t);
-			madd_v3_v3fl(c, tc, sm);
-			qd_setPixel(gbuf, x, y, c);
-		}
-	}
-
-	memset(tbuf1->rect, 0, tbuf1->x*tbuf1->y*tbuf1->type*sizeof(float));
-	for (n=1; n<ndg->iter; n++) {
-		for (y=0; y<gbuf->y; y++) {
-			v = (float)(y+0.5f) / (float)gbuf->y;
-			for (x=0; x<gbuf->x; x++) {
-				u = (float)(x+0.5f) / (float)gbuf->x;
-				tc[0] = tc[1] = tc[2] = 0.f;
-				for (p=0;p<4;p++) {
-					np = (n<<2) + p;
-					s = (u-0.5f)*scalef[np] + 0.5f;
-					t = (v-0.5f)*scalef[np] + 0.5f;
-					qd_getPixelLerp(gbuf, s*gbuf->x - 0.5f, t*gbuf->y - 0.5f, c);
-					mul_v3_v3(c, cm[np]);
-					sm = smoothMask(s, t)*0.25f;
-					madd_v3_v3fl(tc, c, sm);
-				}
-				p = (x + y*tbuf1->x)*tbuf1->type;
-				tbuf1->rect[p] += tc[0];
-				tbuf1->rect[p+1] += tc[1];
-				tbuf1->rect[p+2] += tc[2];
-			}
-		}
-		memcpy(gbuf->rect, tbuf1->rect, tbuf1->x*tbuf1->y*tbuf1->type*sizeof(float));
-	}
-
-	free_compbuf(tbuf1);
-	free_compbuf(tbuf2);
-
-	mixImages(dst, gbuf, 0.5f + 0.5f*ndg->mix);
-	free_compbuf(gbuf);
-}
-
-//--------------------------------------------------------------------------------------------
-// Fog glow (convolution with kernel of exponential falloff)
-
-static void fglow(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
-{
-	int x, y;
-	float scale, u, v, r, w, d;
-	fRGB fcol;
-	CompBuf *tsrc, *ckrn;
-	unsigned int sz = 1 << ndg->size;
-	const float cs_r = 1.f, cs_g = 1.f, cs_b = 1.f;
-
-	// temp. src image
-	tsrc = BTP(src, ndg->threshold, 1 << ndg->quality);
-	// make the convolution kernel
-	ckrn = alloc_compbuf(sz, sz, CB_RGBA, 1);
-
-	scale = 0.25f*sqrtf(sz*sz);
-
-	for (y=0; y<sz; ++y) {
-		v = 2.f*(y / (float)sz) - 1.f;
-		for (x=0; x<sz; ++x) {
-			u = 2.f*(x / (float)sz) - 1.f;
-			r = (u*u + v*v)*scale;
-			d = -sqrtf(sqrtf(sqrtf(r)))*9.f;
-			fcol[0] = expf(d*cs_r), fcol[1] = expf(d*cs_g), fcol[2] = expf(d*cs_b);
-			// linear window good enough here, visual result counts, not scientific analysis
-			//w = (1.f-fabs(u))*(1.f-fabs(v));
-			// actually, Hanning window is ok, cos^2 for some reason is slower
-			w = (0.5f + 0.5f*cos((double)u*M_PI))*(0.5f + 0.5f*cos((double)v*M_PI));
-			mul_v3_fl(fcol, w);
-			qd_setPixel(ckrn, x, y, fcol);
-		}
-	}
-
-	convolve(tsrc, tsrc, ckrn);
-	free_compbuf(ckrn);
-	mixImages(dst, tsrc, 0.5f + 0.5f*ndg->mix);
-	free_compbuf(tsrc);
-}
-
-//--------------------------------------------------------------------------------------------
-
-static void node_composit_exec_glare(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *new, *src, *img = in[0]->data;
-	NodeGlare* ndg = node->storage;
-
-	if ((img == NULL) || (out[0]->hasoutput == 0)) return;
-
-	if (img->type != CB_RGBA) {
-		new = typecheck_compbuf(img, CB_RGBA);
-		src = typecheck_compbuf(img, CB_RGBA);
-	}
-	else {
-		new = dupalloc_compbuf(img);
-		src = dupalloc_compbuf(img);
-	}
-
-	{
-		int x, y;
-		for (y=0; y<new->y; ++y) {
-			fRGB* col = (fRGB*)&new->rect[y*new->x*new->type];
-			for (x=0; x<new->x; ++x) {
-				col[x][0] = MAX2(col[x][0], 0.f);
-				col[x][1] = MAX2(col[x][1], 0.f);
-				col[x][2] = MAX2(col[x][2], 0.f);
-			}
-		}
-	}
-
-	switch (ndg->type) {
-		case 0:
-			star4(ndg, new, src);
-			break;
-		case 1:
-			fglow(ndg, new, src);
-			break;
-		case 3:
-			ghosts(ndg, new, src);
-			break;
-		case 2:
-		default:
-			streaks(ndg, new, src);
-			break;
-	}
-
-	free_compbuf(src);
-	out[0]->data = new;
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_glare(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeGlare *ndg = MEM_callocN(sizeof(NodeGlare), "node glare data");
@@ -502,9 +66,6 @@ void register_node_type_cmp_glare(bNodeTreeType *ttype)
 	node_type_size(&ntype, 150, 120, 200);
 	node_type_init(&ntype, node_composit_init_glare);
 	node_type_storage(&ntype, "NodeGlare", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_glare);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
index d52e3d0..be74819 100644
--- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
+++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
@@ -44,59 +44,6 @@ static bNodeSocketTemplate cmp_node_hue_sat_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac)
-{
-	NodeHueSat *nhs= node->storage;
-	
-	if (*fac!=0.0f && (nhs->hue!=0.5f || nhs->sat!=1.0f || nhs->val!=1.0f)) {
-		float col[3], hsv[3], mfac= 1.0f - *fac;
-		
-		rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2);
-		hsv[0]+= (nhs->hue - 0.5f);
-		if (hsv[0]>1.0f) hsv[0]-=1.0f; else if (hsv[0]<0.0f) hsv[0]+= 1.0f;
-		hsv[1]*= nhs->sat;
-		hsv[2]*= nhs->val;
-		hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
-		
-		out[0] = mfac*in[0] + *fac*col[0];
-		out[1] = mfac*in[1] + *fac*col[1];
-		out[2] = mfac*in[2] + *fac*col[2];
-		out[3] = in[3];
-	}
-	else {
-		copy_v4_v4(out, in);
-	}
-}
-
-static void node_composit_exec_hue_sat(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: Fac, Image */
-	/* stack order out: Image */
-	if (out[0]->hasoutput==0) return;
-	
-	/* input no image? then only color operation */
-	if (in[1]->data==NULL) {
-		do_hue_sat_fac(node, out[0]->vec, in[1]->vec, in[0]->vec);
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf= dupalloc_compbuf(in[1]->data);
-		CompBuf *stackbuf=typecheck_compbuf(cbuf, CB_RGBA);
-		
-		composit2_pixel_processor(node, stackbuf, stackbuf, in[1]->vec, in[0]->data, in[0]->vec, do_hue_sat_fac, CB_RGBA, CB_VAL);
-
-		out[0]->data= stackbuf;
-
-		/* get rid of intermediary cbuf if it's extra */
-		if (stackbuf!=cbuf)
-			free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_hue_sat(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeHueSat *nhs= MEM_callocN(sizeof(NodeHueSat), "node hue sat");
@@ -115,9 +62,6 @@ void register_node_type_cmp_hue_sat(bNodeTreeType *ttype)
 	node_type_size(&ntype, 150, 80, 250);
 	node_type_init(&ntype, node_composit_init_hue_sat);
 	node_type_storage(&ntype, "NodeHueSat", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_hue_sat);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
index f751dbe..45002b0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
+++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
@@ -43,106 +43,6 @@ static bNodeSocketTemplate cmp_node_huecorrect_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_huecorrect(bNode *node, float *out, float *in)
-{
-	float hsv[3], f;
-	
-	rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2);
-	
-	curvemapping_initialize(node->storage);
-
-	/* adjust hue, scaling returned default 0.5 up to 1 */
-	f = curvemapping_evaluateF(node->storage, 0, hsv[0]);
-	hsv[0] += f-0.5f;
-	
-	/* adjust saturation, scaling returned default 0.5 up to 1 */
-	f = curvemapping_evaluateF(node->storage, 1, hsv[0]);
-	hsv[1] *= (f * 2.f);
-	
-	/* adjust value, scaling returned default 0.5 up to 1 */
-	f = curvemapping_evaluateF(node->storage, 2, hsv[0]);
-	hsv[2] *= (f * 2.f);
-	
-	hsv[0] = hsv[0] - floorf(hsv[0]); /* mod 1.0 */
-	CLAMP(hsv[1], 0.f, 1.f);
-	
-	/* convert back to rgb */
-	hsv_to_rgb(hsv[0], hsv[1], hsv[2], out, out+1, out+2);
-	
-	out[3] = in[3];
-}
-
-static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac)
-{
-	float hsv[3], rgb[3], f;
-	const float mfac = 1.f-*fac;
-	
-	rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2);
-	
-	curvemapping_initialize(node->storage);
-
-	/* adjust hue, scaling returned default 0.5 up to 1 */
-	f = curvemapping_evaluateF(node->storage, 0, hsv[0]);
-	hsv[0] += f-0.5f;
-	
-	/* adjust saturation, scaling returned default 0.5 up to 1 */
-	f = curvemapping_evaluateF(node->storage, 1, hsv[0]);
-	hsv[1] *= (f * 2.f);
-	
-	/* adjust value, scaling returned default 0.5 up to 1 */
-	f = curvemapping_evaluateF(node->storage, 2, hsv[0]);
-	hsv[2] *= (f * 2.f);
-	
-	hsv[0] = hsv[0] - floorf(hsv[0]);  /* mod 1.0 */
-	CLAMP(hsv[1], 0.f, 1.f);
-	
-	/* convert back to rgb */
-	hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
-	
-	out[0] = mfac*in[0] + *fac*rgb[0];
-	out[1] = mfac*in[1] + *fac*rgb[1];
-	out[2] = mfac*in[2] + *fac*rgb[2];
-	out[3] = in[3];
-}
-
-static void node_composit_exec_huecorrect(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *cbuf= in[1]->data;
-	CompBuf *stackbuf;
-	
-	/* stack order input:  fac, image, black level, white level */
-	/* stack order output: image */
-	
-	if (out[0]->hasoutput==0)
-		return;
-
-	if (in[0]->vec[0] == 0.f && in[0]->data == NULL) {
-		out[0]->data = pass_on_compbuf(cbuf);
-		return;
-	}
-
-	/* input no image? then only color operation */
-	if (in[1]->data==NULL) {
-		do_huecorrect_fac(node, out[0]->vec, in[1]->vec, in[0]->vec);
-	}
-	
-	if (cbuf) {
-		stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* make output size of input image */
-		
-		if ((in[0]->data==NULL) && (in[0]->vec[0] >= 1.f))
-			composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_huecorrect, CB_RGBA);
-		else
-			composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_huecorrect_fac, CB_RGBA, CB_VAL);
-		
-		out[0]->data= stackbuf;
-	}
-	
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_huecorrect(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	CurveMapping *cumapping = node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -168,9 +68,6 @@ void register_node_type_cmp_huecorrect(bNodeTreeType *ttype)
 	node_type_size(&ntype, 320, 140, 400);
 	node_type_init(&ntype, node_composit_init_huecorrect);
 	node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_huecorrect);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_idMask.c b/source/blender/nodes/composite/nodes/node_composite_idMask.c
index ef0c502..8aa0838 100644
--- a/source/blender/nodes/composite/nodes/node_composite_idMask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_idMask.c
@@ -44,72 +44,6 @@ static bNodeSocketTemplate cmp_node_idmask_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* stackbuf should be zeroed */
-static void do_idmask(CompBuf *stackbuf, CompBuf *cbuf, float idnr)
-{
-	float *rect;
-	int x;
-	char *abuf= MEM_mapallocN(cbuf->x*cbuf->y, "anti ali buf");
-	
-	rect= cbuf->rect;
-	for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
-		if (rect[x]==idnr)
-			abuf[x] = 255;
-	
-	antialias_tagbuf(cbuf->x, cbuf->y, abuf);
-	
-	rect= stackbuf->rect;
-	for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
-		if (abuf[x]>1)
-			rect[x] = (1.0f/255.0f)*(float)abuf[x];
-	
-	MEM_freeN(abuf);
-}
-
-/* full sample version */
-static void do_idmask_fsa(CompBuf *stackbuf, CompBuf *cbuf, float idnr)
-{
-	float *rect, *rs;
-	int x;
-	
-	rect= cbuf->rect;
-	rs= stackbuf->rect;
-	for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
-		if (rect[x]==idnr)
-			rs[x] = 1.0f;
-	
-}
-
-
-static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	RenderData *rd= data;
-	
-	if (out[0]->hasoutput==0)
-		return;
-	
-	if (in[0]->data) {
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf;
-		
-		if (cbuf->type!=CB_VAL)
-			return;
-		
-		stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */;
-		
-		if ((rd->scemode & R_FULL_SAMPLE) || node->custom2 == 0)
-			do_idmask_fsa(stackbuf, cbuf, (float)node->custom1);
-		else
-			do_idmask(stackbuf, cbuf, (float)node->custom1);
-		
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_idmask(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -117,9 +51,6 @@ void register_node_type_cmp_idmask(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_ID_MASK, "ID Mask", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_idmask_in, cmp_node_idmask_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_idmask);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c
index 7e44210..66a141b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_image.c
+++ b/source/blender/nodes/composite/nodes/node_composite_image.c
@@ -29,7 +29,6 @@
  *  \ingroup cmpnodes
  */
 
-
 #include "node_composite_util.h"
 
 /* **************** IMAGE (and RenderResult, multilayer image) ******************** */
@@ -285,242 +284,6 @@ static void cmp_node_image_update(bNodeTree *ntree, bNode *node)
 		cmp_node_image_verify_outputs(ntree, node);
 }
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* float buffer from the image with matching color management */
-float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc)
-{
-	float *rect;
-
-	*alloc= FALSE;
-
-	/* OCIO_TODO: this is a part of legacy compositor system, don't bother with porting this code
-	 *            to new color management system since this code would likely be simply removed soon
-	 */
-	if (rd->color_mgt_flag & R_COLOR_MANAGEMENT) {
-		rect= ibuf->rect_float;
-	}
-	else {
-		rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image");
-
-		IMB_buffer_float_from_float(rect, ibuf->rect_float,
-			4, IB_PROFILE_SRGB, IB_PROFILE_LINEAR_RGB, TRUE,
-			ibuf->x, ibuf->y, ibuf->x, ibuf->x);
-
-			*alloc= TRUE;
-	}
-
-	return rect;
-}
-
-/* note: this function is used for multilayer too, to ensure uniform 
- * handling with BKE_image_acquire_ibuf() */
-static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *iuser)
-{
-	ImBuf *ibuf;
-	CompBuf *stackbuf;
-	int type;
-
-	float *rect;
-	int alloc= FALSE;
-
-	ibuf= BKE_image_acquire_ibuf(ima, iuser, NULL);
-	if (ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
-		return NULL;
-	}
-
-	if (ibuf->rect_float == NULL) {
-		IMB_float_from_rect(ibuf);
-	}
-
-	/* now we need a float buffer from the image with matching color management */
-	/* XXX weak code, multilayer is excluded from this */
-	if (ibuf->channels == 4 && ima->rr==NULL) {
-		rect= node_composit_get_float_buffer(rd, ibuf, &alloc);
-	}
-	else {
-		/* non-rgba passes can't use color profiles */
-		rect= ibuf->rect_float;
-	}
-	/* done coercing into the correct color management */
-
-
-	type= ibuf->channels;
-	
-	if (rd->scemode & R_COMP_CROP) {
-		stackbuf= get_cropped_compbuf(&rd->disprect, rect, ibuf->x, ibuf->y, type);
-		if (alloc)
-			MEM_freeN(rect);
-	}
-	else {
-		/* we put imbuf copy on stack, cbuf knows rect is from other ibuf when freed! */
-		stackbuf= alloc_compbuf(ibuf->x, ibuf->y, type, FALSE);
-		stackbuf->rect= rect;
-		stackbuf->malloc= alloc;
-	}
-	
-	/* code to respect the premul flag of images; I'm
-	 * not sure if this is a good idea for multilayer images,
-	 * since it never worked before for them.
-	 */
-#if 0
-	if (type==CB_RGBA && ima->flag & IMA_DO_PREMUL) {
-		//premul the image
-		int i;
-		float *pixel = stackbuf->rect;
-		
-		for (i=0; i<stackbuf->x*stackbuf->y; i++, pixel += 4) {
-			pixel[0] *= pixel[3];
-			pixel[1] *= pixel[3];
-			pixel[2] *= pixel[3];
-		}
-	}
-#endif
-
-	BKE_image_release_ibuf(ima, ibuf, NULL);
-
-	return stackbuf;
-}
-
-static CompBuf *node_composit_get_zimage(bNode *node, RenderData *rd)
-{
-	ImBuf *ibuf= BKE_image_acquire_ibuf((Image *)node->id, node->storage, NULL);
-	CompBuf *zbuf= NULL;
-	
-	if (ibuf && ibuf->zbuf_float) {
-		if (rd->scemode & R_COMP_CROP) {
-			zbuf= get_cropped_compbuf(&rd->disprect, ibuf->zbuf_float, ibuf->x, ibuf->y, CB_VAL);
-		}
-		else {
-			zbuf= alloc_compbuf(ibuf->x, ibuf->y, CB_VAL, 0);
-			zbuf->rect= ibuf->zbuf_float;
-		}
-	}
-
-	BKE_image_release_ibuf((Image *)node->id, ibuf, NULL);
-
-	return zbuf;
-}
-
-/* check if layer is available, returns pass buffer */
-static CompBuf *compbuf_multilayer_get(RenderData *rd, RenderLayer *rl, Image *ima, ImageUser *iuser, int passindex)
-{
-	RenderPass *rpass = BLI_findlink(&rl->passes, passindex);
-	if (rpass) {
-		CompBuf *cbuf;
-		
-		iuser->pass = passindex;
-		BKE_image_multilayer_index(ima->rr, iuser);
-		cbuf = node_composit_get_image(rd, ima, iuser);
-		
-		return cbuf;
-	}
-	return NULL;
-}
-
-static void node_composit_exec_image(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	/* image assigned to output */
-	/* stack order input sockets: col, alpha */
-	if (node->id) {
-		RenderData *rd= data;
-		Image *ima= (Image *)node->id;
-		ImageUser *iuser= (ImageUser *)node->storage;
-		ImBuf *ibuf = NULL;
-		
-		/* first set the right frame number in iuser */
-		BKE_image_user_frame_calc(iuser, rd->cfra, 0);
-		
-		/* force a load, we assume iuser index will be set OK anyway */
-		if (ima->type==IMA_TYPE_MULTILAYER)
-			ibuf = BKE_image_acquire_ibuf(ima, iuser, NULL);
-		
-		if (ima->type==IMA_TYPE_MULTILAYER && ima->rr) {
-			RenderLayer *rl= BLI_findlink(&ima->rr->layers, iuser->layer);
-			
-			if (rl) {
-				bNodeSocket *sock;
-				NodeImageLayer *sockdata;
-				int out_index;
-				CompBuf *combinedbuf= NULL, *firstbuf= NULL;
-				
-				for (sock=node->outputs.first, out_index=0; sock; sock=sock->next, ++out_index) {
-					sockdata = sock->storage;
-					if (out[out_index]->hasoutput) {
-						CompBuf *stackbuf = out[out_index]->data = compbuf_multilayer_get(rd, rl, ima, iuser, sockdata->pass_index);
-						if (stackbuf) {
-							/* preview policy: take first 'Combined' pass if available,
-							 * otherwise just use the first layer.
-							 */
-							if (!firstbuf) {
-								firstbuf = stackbuf;
-							}
-							if (!combinedbuf &&
-							    (strcmp(sock->name, "Combined") == 0 || strcmp(sock->name, "Image") == 0))
-							{
-								combinedbuf = stackbuf;
-							}
-						}
-					}
-				}
-				
-				/* preview */
-				if (combinedbuf)
-					generate_preview(data, node, combinedbuf);
-				else if (firstbuf)
-					generate_preview(data, node, firstbuf);
-			}
-		}
-		else {
-			CompBuf *stackbuf = node_composit_get_image(rd, ima, iuser);
-			if (stackbuf) {
-				int num_outputs = BLI_countlist(&node->outputs);
-				
-				/*respect image premul option*/
-				if (stackbuf->type==CB_RGBA && ima->flag & IMA_DO_PREMUL) {
-					int i;
-					float *pixel;
-			
-					/* first duplicate stackbuf->rect, since it's just a pointer
-					 * to the source imbuf, and we don't want to change that.*/
-					stackbuf->rect = MEM_dupallocN(stackbuf->rect);
-					
-					/* since stackbuf now has allocated memory, rather than just a pointer,
-					 * mark it as allocated so it can be freed properly */
-					stackbuf->malloc=1;
-					
-					/*premul the image*/
-					pixel = stackbuf->rect;
-					for (i=0; i<stackbuf->x*stackbuf->y; i++, pixel += 4) {
-						pixel[0] *= pixel[3];
-						pixel[1] *= pixel[3];
-						pixel[2] *= pixel[3];
-					}
-				}
-			
-				/* put image on stack */
-				if (num_outputs > 0)
-					out[0]->data= stackbuf;
-				
-				/* alpha output */
-				if (num_outputs > 1 && out[1]->hasoutput)
-					out[1]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
-				
-				/* Z output */
-				if (num_outputs > 2 && out[2]->hasoutput)
-					out[2]->data= node_composit_get_zimage(node, rd);
-				
-				/* preview */
-				generate_preview(data, node, stackbuf);
-			}
-		}
-
-		BKE_image_release_ibuf(ima, ibuf, NULL);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_image(bNodeTree *ntree, bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user");
@@ -565,9 +328,6 @@ void register_node_type_cmp_image(bNodeTreeType *ttype)
 	node_type_init(&ntype, node_composit_init_image);
 	node_type_storage(&ntype, "ImageUser", node_composit_free_image, node_composit_copy_image);
 	node_type_update(&ntype, cmp_node_image_update, NULL);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_image);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -575,141 +335,6 @@ void register_node_type_cmp_image(bNodeTreeType *ttype)
 
 /* **************** RENDER RESULT ******************** */
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, int recty, int passcode)
-{
-	float *fp= RE_RenderLayerGetPass(rl, passcode);
-	if (fp) {
-		CompBuf *buf;
-		int buftype= CB_VEC3;
-
-		if (ELEM4(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST, SCE_PASS_INDEXMA))
-			buftype= CB_VAL;
-		else if (passcode==SCE_PASS_VECTOR)
-			buftype= CB_VEC4;
-		else if (ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA))
-			buftype= CB_RGBA;
-
-		if (rd->scemode & R_COMP_CROP)
-			buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype);
-		else {
-			buf= alloc_compbuf(rectx, recty, buftype, 0);
-			buf->rect= fp;
-		}
-		return buf;
-	}
-	return NULL;
-}
-
-static void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out, int rectx, int recty)
-{
-	if (out[RRES_OUT_Z]->hasoutput)
-		out[RRES_OUT_Z]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_Z);
-	if (out[RRES_OUT_VEC]->hasoutput)
-		out[RRES_OUT_VEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_VECTOR);
-	if (out[RRES_OUT_NORMAL]->hasoutput)
-		out[RRES_OUT_NORMAL]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_NORMAL);
-	if (out[RRES_OUT_UV]->hasoutput)
-		out[RRES_OUT_UV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_UV);
-
-	if (out[RRES_OUT_RGBA]->hasoutput)
-		out[RRES_OUT_RGBA]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_RGBA);
-	if (out[RRES_OUT_DIFF]->hasoutput)
-		out[RRES_OUT_DIFF]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE);
-	if (out[RRES_OUT_SPEC]->hasoutput)
-		out[RRES_OUT_SPEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SPEC);
-	if (out[RRES_OUT_SHADOW]->hasoutput)
-		out[RRES_OUT_SHADOW]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SHADOW);
-	if (out[RRES_OUT_AO]->hasoutput)
-		out[RRES_OUT_AO]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_AO);
-	if (out[RRES_OUT_REFLECT]->hasoutput)
-		out[RRES_OUT_REFLECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFLECT);
-	if (out[RRES_OUT_REFRACT]->hasoutput)
-		out[RRES_OUT_REFRACT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFRACT);
-	if (out[RRES_OUT_INDIRECT]->hasoutput)
-		out[RRES_OUT_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDIRECT);
-	if (out[RRES_OUT_INDEXOB]->hasoutput)
-		out[RRES_OUT_INDEXOB]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXOB);
-	if (out[RRES_OUT_INDEXMA]->hasoutput)
-		out[RRES_OUT_INDEXMA]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXMA);
-	if (out[RRES_OUT_MIST]->hasoutput)
-		out[RRES_OUT_MIST]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_MIST);
-	if (out[RRES_OUT_EMIT]->hasoutput)
-		out[RRES_OUT_EMIT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_EMIT);
-	if (out[RRES_OUT_ENV]->hasoutput)
-		out[RRES_OUT_ENV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_ENVIRONMENT);
-	if (out[RRES_OUT_DIFF_DIRECT]->hasoutput)
-		out[RRES_OUT_DIFF_DIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE_DIRECT);
-	if (out[RRES_OUT_DIFF_INDIRECT]->hasoutput)
-		out[RRES_OUT_DIFF_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE_INDIRECT);
-	if (out[RRES_OUT_DIFF_COLOR]->hasoutput)
-		out[RRES_OUT_DIFF_COLOR]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE_COLOR);
-	if (out[RRES_OUT_GLOSSY_DIRECT]->hasoutput)
-		out[RRES_OUT_GLOSSY_DIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_GLOSSY_DIRECT);
-	if (out[RRES_OUT_GLOSSY_INDIRECT]->hasoutput)
-		out[RRES_OUT_GLOSSY_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_GLOSSY_INDIRECT);
-	if (out[RRES_OUT_GLOSSY_COLOR]->hasoutput)
-		out[RRES_OUT_GLOSSY_COLOR]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_GLOSSY_COLOR);
-	if (out[RRES_OUT_TRANSM_DIRECT]->hasoutput)
-		out[RRES_OUT_TRANSM_DIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_TRANSM_DIRECT);
-	if (out[RRES_OUT_TRANSM_INDIRECT]->hasoutput)
-		out[RRES_OUT_TRANSM_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_TRANSM_INDIRECT);
-	if (out[RRES_OUT_TRANSM_COLOR]->hasoutput)
-		out[RRES_OUT_TRANSM_COLOR]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_TRANSM_COLOR);
-}
-
-static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	Scene *sce= (Scene *)node->id;
-	Render *re= (sce)? RE_GetRender(sce->id.name): NULL;
-	RenderData *rd= data;
-	RenderResult *rr= NULL;
-
-	if (re)
-		rr= RE_AcquireResultRead(re);
-
-	if (rr) {
-		SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
-		if (srl) {
-			RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
-			if (rl && rl->rectf) {
-				CompBuf *stackbuf;
-
-				/* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */
-				if (rd->scemode & R_COMP_CROP)
-					stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA);
-				else {
-					stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0);
-					stackbuf->rect= rl->rectf;
-				}
-				if (stackbuf==NULL) {
-					printf("Error; Preview Panel in UV Window returns zero sized image\n");
-				}
-				else {
-					stackbuf->xof= rr->xof;
-					stackbuf->yof= rr->yof;
-
-					/* put on stack */
-					out[RRES_OUT_IMAGE]->data= stackbuf;
-
-					if (out[RRES_OUT_ALPHA]->hasoutput)
-						out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
-
-					node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty);
-
-					generate_preview(data, node, stackbuf);
-				}
-			}
-		}
-	}
-
-	if (re)
-		RE_ReleaseResult(re);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_rlayers(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -717,9 +342,6 @@ void register_node_type_cmp_rlayers(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_R_LAYERS, "Render Layers", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
 	node_type_socket_templates(&ntype, NULL, cmp_node_rlayers_out);
 	node_type_size(&ntype, 150, 100, 300);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_rlayers);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_inpaint.c b/source/blender/nodes/composite/nodes/node_composite_inpaint.c
index 25ecf42..95e5834 100644
--- a/source/blender/nodes/composite/nodes/node_composite_inpaint.c
+++ b/source/blender/nodes/composite/nodes/node_composite_inpaint.c
@@ -44,15 +44,6 @@ static bNodeSocketTemplate cmp_node_inpaint_out[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_inpaint(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
-{
-	/* pass */
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_inpaint(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -60,9 +51,6 @@ void register_node_type_cmp_inpaint(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_INPAINT, "Inpaint", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_inpaint_in, cmp_node_inpaint_out);
 	node_type_size(&ntype, 130, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_inpaint);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.c b/source/blender/nodes/composite/nodes/node_composite_invert.c
index 2db6e42..05bccf8 100644
--- a/source/blender/nodes/composite/nodes/node_composite_invert.c
+++ b/source/blender/nodes/composite/nodes/node_composite_invert.c
@@ -43,82 +43,6 @@ static bNodeSocketTemplate cmp_node_invert_out[] = {
 	{ -1, 0, "" }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_invert(bNode *node, float *out, float *in)
-{
-	if (node->custom1 & CMP_CHAN_RGB) {
-		out[0] = 1.0f - in[0];
-		out[1] = 1.0f - in[1];
-		out[2] = 1.0f - in[2];
-	}
-	else {
-		copy_v3_v3(out, in);
-	}
-		
-	if (node->custom1 & CMP_CHAN_A)
-		out[3] = 1.0f - in[3];
-	else
-		out[3] = in[3];
-}
-
-static void do_invert_fac(bNode *node, float *out, float *in, float *fac)
-{
-	float col[4], facm;
-
-	do_invert(node, col, in);
-
-	/* blend inverted result against original input with fac */
-	facm = 1.0f - fac[0];
-
-	if (node->custom1 & CMP_CHAN_RGB) {
-		col[0] = fac[0]*col[0] + (facm*in[0]);
-		col[1] = fac[0]*col[1] + (facm*in[1]);
-		col[2] = fac[0]*col[2] + (facm*in[2]);
-	}
-	if (node->custom1 & CMP_CHAN_A)
-		col[3] = fac[0]*col[3] + (facm*in[3]);
-	
-	copy_v4_v4(out, col);
-}
-
-static void node_composit_exec_invert(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: fac, Image, Image */
-	/* stack order out: Image */
-	float *fac= in[0]->vec;
-	
-	if (out[0]->hasoutput==0) return;
-	
-	/* input no image? then only color operation */
-	if (in[1]->data==NULL && in[0]->data==NULL) {
-		do_invert_fac(node, out[0]->vec, in[1]->vec, fac);
-	}
-	else {
-		/* make output size of first available input image, or then size of fac */
-		CompBuf *cbuf= in[1]->data?in[1]->data:in[0]->data;
-
-		/* if neither RGB or A toggled on, pass through */
-		if (node->custom1 != 0) {
-			CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-			
-			if (fac[0] < 1.0f || in[0]->data!=NULL)
-				composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, fac, do_invert_fac, CB_RGBA, CB_VAL);
-			else
-				composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_invert, CB_RGBA);
-			out[0]->data= stackbuf;
-			return;
-			
-		}
-		else {
-			out[0]->data = pass_on_compbuf(cbuf);
-			return;
-		}
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_invert(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->custom1 |= CMP_CHAN_RGB;
@@ -133,9 +57,6 @@ void register_node_type_cmp_invert(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_invert_in, cmp_node_invert_out);
 	node_type_size(&ntype, 120, 120, 140);
 	node_type_init(&ntype, node_composit_init_invert);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_invert);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_keying.c b/source/blender/nodes/composite/nodes/node_composite_keying.c
index 6553df3..5e28509 100644
--- a/source/blender/nodes/composite/nodes/node_composite_keying.c
+++ b/source/blender/nodes/composite/nodes/node_composite_keying.c
@@ -60,13 +60,6 @@ static bNodeSocketTemplate cmp_node_keying_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-static void node_composit_exec_keying(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
-{
-	/* pass */
-}
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_keying(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeKeyingData *data;
@@ -94,9 +87,6 @@ void register_node_type_cmp_keying(bNodeTreeType *ttype)
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_keying);
 	node_type_storage(&ntype, "NodeKeyingData", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_keying);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_keyingscreen.c b/source/blender/nodes/composite/nodes/node_composite_keyingscreen.c
index 96e9058..5db7f8f 100644
--- a/source/blender/nodes/composite/nodes/node_composite_keyingscreen.c
+++ b/source/blender/nodes/composite/nodes/node_composite_keyingscreen.c
@@ -50,140 +50,6 @@ static bNodeSocketTemplate cmp_node_keyingscreen_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void compute_gradient_screen(RenderData *rd, NodeKeyingScreenData *keyingscreen_data, MovieClip *clip, CompBuf *screenbuf)
-{
-	MovieClipUser user = {0};
-	MovieTracking *tracking = &clip->tracking;
-	MovieTrackingTrack *track;
-	VoronoiTriangulationPoint *triangulated_points;
-	VoronoiSite *sites;
-	ImBuf *ibuf;
-	ListBase *tracksbase;
-	ListBase edges = {NULL, NULL};
-	int sites_total, triangulated_points_total, triangles_total;
-	int (*triangles)[3];
-	int i, x, y;
-	float *rect = screenbuf->rect;
-
-	if (keyingscreen_data->tracking_object[0]) {
-		MovieTrackingObject *object = BKE_tracking_object_get_named(tracking, keyingscreen_data->tracking_object);
-
-		if (!object)
-			return;
-
-		tracksbase = BKE_tracking_object_get_tracks(tracking, object);
-	}
-	else
-		tracksbase = BKE_tracking_get_active_tracks(tracking);
-
-	sites_total = BLI_countlist(tracksbase);
-
-	if (!sites_total)
-		return;
-
-	BKE_movieclip_user_set_frame(&user, rd->cfra);
-	ibuf = BKE_movieclip_get_ibuf(clip, &user);
-
-	sites = MEM_callocN(sizeof(VoronoiSite) * sites_total, "keyingscreen voronoi sites");
-	track = tracksbase->first;
-	i = 0;
-	while (track) {
-		VoronoiSite *site = &sites[i];
-		MovieTrackingMarker *marker = BKE_tracking_marker_get(track, rd->cfra);
-		ImBuf *pattern_ibuf = BKE_tracking_get_pattern_imbuf(ibuf, track, marker, TRUE, FALSE);
-		int j;
-
-		zero_v3(site->color);
-
-		if (pattern_ibuf) {
-			for (j = 0; j < pattern_ibuf->x * pattern_ibuf->y; j++) {
-				if (pattern_ibuf->rect_float) {
-					add_v3_v3(site->color, &pattern_ibuf->rect_float[4 * j]);
-				}
-				else {
-					unsigned char *rrgb = (unsigned char *)pattern_ibuf->rect;
-
-					site->color[0] += srgb_to_linearrgb((float)rrgb[4 * j + 0] / 255.0f);
-					site->color[1] += srgb_to_linearrgb((float)rrgb[4 * j + 1] / 255.0f);
-					site->color[2] += srgb_to_linearrgb((float)rrgb[4 * j + 2] / 255.0f);
-				}
-			}
-
-			mul_v3_fl(site->color, 1.0f / (pattern_ibuf->x * pattern_ibuf->y));
-			IMB_freeImBuf(pattern_ibuf);
-		}
-
-		site->co[0] = marker->pos[0] * screenbuf->x;
-		site->co[1] = marker->pos[1] * screenbuf->y;
-
-		track = track->next;
-		i++;
-	}
-
-	IMB_freeImBuf(ibuf);
-
-	BLI_voronoi_compute(sites, sites_total, screenbuf->x, screenbuf->y, &edges);
-
-	BLI_voronoi_triangulate(sites, sites_total, &edges, screenbuf->x, screenbuf->y,
-	                        &triangulated_points, &triangulated_points_total,
-                            &triangles, &triangles_total);
-
-	for (y = 0; y < screenbuf->y; y++) {
-		for (x = 0; x < screenbuf->x; x++) {
-			int index = 4 * (y * screenbuf->x + x);
-
-			rect[index + 0] = rect[index + 1] = rect[index + 2] = 0.0f;
-			rect[index + 3] = 1.0f;
-
-			for (i = 0; i < triangles_total; i++) {
-				int *triangle = triangles[i];
-				VoronoiTriangulationPoint *a = &triangulated_points[triangle[0]],
-				                          *b = &triangulated_points[triangle[1]],
-				                          *c = &triangulated_points[triangle[2]];
-				float co[2] = {x, y}, w[3];
-
-				if (barycentric_coords_v2(a->co, b->co, c->co, co, w)) {
-					if (barycentric_inside_triangle_v2(w)) {
-						rect[index + 0] += a->color[0] * w[0] + b->color[0] * w[1] + c->color[0] * w[2];
-						rect[index + 1] += a->color[1] * w[0] + b->color[1] * w[1] + c->color[1] * w[2];
-						rect[index + 2] += a->color[2] * w[0] + b->color[2] * w[1] + c->color[2] * w[2];
-					}
-				}
-			}
-		}
-	}
-
-	MEM_freeN(triangulated_points);
-	MEM_freeN(triangles);
-	MEM_freeN(sites);
-	BLI_freelistN(&edges);
-}
-
-static void node_composit_exec_keyingscreen(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	NodeKeyingScreenData *keyingscreen_data = node->storage;
-	RenderData *rd = data;
-	CompBuf *screenbuf = NULL;
-
-	if (node->id) {
-		MovieClip *clip = (MovieClip *) node->id;
-		MovieClipUser user = {0};
-		int width, height;
-
-		BKE_movieclip_user_set_frame(&user, rd->cfra);
-		BKE_movieclip_get_size(clip, &user, &width, &height);
-
-		screenbuf = alloc_compbuf(width, height, CB_RGBA, TRUE);
-		compute_gradient_screen(rd, keyingscreen_data, clip, screenbuf);
-	}
-
-	out[0]->data = screenbuf;
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_keyingscreen(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeKeyingScreenData *data;
@@ -202,9 +68,6 @@ void register_node_type_cmp_keyingscreen(bNodeTreeType *ttype)
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_keyingscreen);
 	node_type_storage(&ntype, "NodeKeyingScreenData", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_keyingscreen);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_lensdist.c b/source/blender/nodes/composite/nodes/node_composite_lensdist.c
index 1ac8c45..e454022 100644
--- a/source/blender/nodes/composite/nodes/node_composite_lensdist.c
+++ b/source/blender/nodes/composite/nodes/node_composite_lensdist.c
@@ -43,149 +43,6 @@ static bNodeSocketTemplate cmp_node_lensdist_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* assumes *dst is type RGBA */
-static void lensDistort(CompBuf *dst, CompBuf *src, float kr, float kg, float kb, int jit, int proj, int fit)
-{
-	int x, y, z;
-	const float cx = 0.5f*(float)dst->x, cy = 0.5f*(float)dst->y;
-
-	if (proj) {
-		// shift
-		CompBuf *tsrc = dupalloc_compbuf(src);
-		
-		for (z=0; z<tsrc->type; ++z)
-			IIR_gauss(tsrc, (kr+0.5f)*(kr+0.5f), z, 1);
-		kr *= 20.f;
-		
-		for (y=0; y<dst->y; y++) {
-			fRGB *colp = (fRGB*)&dst->rect[y*dst->x*dst->type];
-			const float v = (y + 0.5f)/(float)dst->y;
-			
-			for (x=0; x<dst->x; x++) {
-				const float u = (x + 0.5f)/(float)dst->x;
-				
-				qd_getPixelLerpChan(tsrc, (u*dst->x + kr) - 0.5f, v*dst->y - 0.5f, 0, colp[x]);
-				if (tsrc->type == CB_VAL)
-					colp[x][1] = tsrc->rect[x + y*tsrc->x];
-				else
-					colp[x][1] = tsrc->rect[(x + y*tsrc->x)*tsrc->type + 1];
-				qd_getPixelLerpChan(tsrc, (u*dst->x - kr) - 0.5f, v*dst->y - 0.5f, 2, colp[x]+2);
-				
-				/* set alpha */
-				colp[x][3] = 1.0f;
-			}
-		}
-		free_compbuf(tsrc);
-	}
-	else {
-		// Spherical
-		// Scale factor to make bottom/top & right/left sides fit in window after deform
-		// so in the case of pincushion (kn < 0), corners will be outside window.
-		// Now also optionally scales image such that black areas are not visible when distort factor is positive
-		// (makes distorted corners match window corners, but really only valid if mk<=0.5)
-		const float mk = max_fff(kr, kg, kb);
-		const float sc = (fit && (mk > 0.f)) ? (1.f/(1.f + 2.f*mk)) : (1.f/(1.f + mk));
-		const float drg = 4.f*(kg - kr), dgb = 4.f*(kb - kg);
-		
-		kr *= 4.f, kg *= 4.f, kb *= 4.f;
-
-		for (y=0; y<dst->y; y++) {
-			fRGB *colp = (fRGB*)&dst->rect[y*dst->x*dst->type];
-			const float v = sc*((y + 0.5f) - cy)/cy;
-			
-			for (x=0; x<dst->x; x++) {
-				int dr = 0, dg = 0, db = 0;
-				float d, t, ln[6] = {0, 0, 0, 0, 0, 0};
-				fRGB c1, tc = {0, 0, 0, 0};
-				const float u = sc*((x + 0.5f) - cx)/cx;
-				const float uv_dot = u * u + v * v;
-				int sta = 0, mid = 0, end = 0;
-				
-				if ((t = 1.f - kr*uv_dot) >= 0.f) {
-					d = 1.f/(1.f + sqrtf(t));
-					ln[0] = (u*d + 0.5f)*dst->x - 0.5f, ln[1] = (v*d + 0.5f)*dst->y - 0.5f;
-					sta = 1;
-				}
-				if ((t = 1.f - kg*uv_dot) >= 0.f) {
-					d = 1.f/(1.f + sqrtf(t));
-					ln[2] = (u*d + 0.5f)*dst->x - 0.5f, ln[3] = (v*d + 0.5f)*dst->y - 0.5f;
-					mid = 1;
-				}
-				if ((t = 1.f - kb*uv_dot) >= 0.f) {
-					d = 1.f/(1.f + sqrtf(t));
-					ln[4] = (u*d + 0.5f)*dst->x - 0.5f, ln[5] = (v*d + 0.5f)*dst->y - 0.5f;
-					end = 1;
-				}
-	
-				if (sta && mid && end) {
-					// RG
-					const int dx = ln[2] - ln[0], dy = ln[3] - ln[1];
-					const float dsf = sqrtf(dx*dx + dy*dy) + 1.f;
-					const int ds = (int)(jit ? ((dsf < 4.f) ? 2.f : sqrtf(dsf)) : dsf);
-					const float sd = 1.f/(float)ds;
-					
-					for (z=0; z<ds; ++z) {
-						const float tz = ((float)z + (jit ? BLI_frand() : 0.5f))*sd;
-						t = 1.f - (kr + tz*drg)*uv_dot;
-						d = 1.f / (1.f + sqrtf(t));
-						qd_getPixelLerp(src, (u*d + 0.5f)*dst->x - 0.5f, (v*d + 0.5f)*dst->y - 0.5f, c1);
-						if (src->type == CB_VAL) c1[1] = c1[2] = c1[0];
-						tc[0] += (1.f-tz)*c1[0], tc[1] += tz*c1[1];
-						dr++, dg++;
-					}
-					// GB
-					{
-						const int dx = ln[4] - ln[2], dy = ln[5] - ln[3];
-						const float dsf = sqrtf(dx*dx + dy*dy) + 1.f;
-						const int ds = (int)(jit ? ((dsf < 4.f) ? 2.f : sqrtf(dsf)) : dsf);
-						const float sd = 1.f/(float)ds;
-						
-						for (z=0; z<ds; ++z) {
-							const float tz = ((float)z + (jit ? BLI_frand() : 0.5f))*sd;
-							t = 1.f - (kg + tz*dgb)*uv_dot;
-							d = 1.f / (1.f + sqrtf(t));
-							qd_getPixelLerp(src, (u*d + 0.5f)*dst->x - 0.5f, (v*d + 0.5f)*dst->y - 0.5f, c1);
-							if (src->type == CB_VAL) c1[1] = c1[2] = c1[0];
-							tc[1] += (1.f-tz)*c1[1], tc[2] += tz*c1[2];
-							dg++, db++;
-						}
-					}
-				}
-	
-				if (dr) colp[x][0] = 2.f*tc[0] / (float)dr;
-				if (dg) colp[x][1] = 2.f*tc[1] / (float)dg;
-				if (db) colp[x][2] = 2.f*tc[2] / (float)db;
-	
-				/* set alpha */
-				colp[x][3] = 1.0f;
-			}
-		}
-	}
-}
-
-
-static void node_composit_exec_lensdist(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *new, *img = in[0]->data;
-	NodeLensDist *nld = node->storage;
-	const float k = MAX2(MIN2(in[1]->vec[0], 1.f), -0.999f);
-	// smaller dispersion range for somewhat more control
-	const float d = 0.25f*MAX2(MIN2(in[2]->vec[0], 1.f), 0.f);
-	const float kr = MAX2(MIN2((k+d), 1.f), -0.999f), kb = MAX2(MIN2((k-d), 1.f), -0.999f);
-
-	if ((img==NULL) || (out[0]->hasoutput==0)) return;
-
-	new = alloc_compbuf(img->x, img->y, CB_RGBA, 1);
-
-	lensDistort(new, img, (nld->proj ? d : kr), k, kb, nld->jit, nld->proj, nld->fit);
-
-	out[0]->data = new;
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_lensdist(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeLensDist *nld = MEM_callocN(sizeof(NodeLensDist), "node lensdist data");
@@ -203,9 +60,6 @@ void register_node_type_cmp_lensdist(bNodeTreeType *ttype)
 	node_type_size(&ntype, 150, 120, 200);
 	node_type_init(&ntype, node_composit_init_lensdist);
 	node_type_storage(&ntype, "NodeLensDist", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_lensdist);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_levels.c b/source/blender/nodes/composite/nodes/node_composite_levels.c
index 57d94d6..5f9797d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_levels.c
+++ b/source/blender/nodes/composite/nodes/node_composite_levels.c
@@ -45,274 +45,6 @@ static bNodeSocketTemplate cmp_node_view_levels_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void fill_bins(bNode *node, CompBuf* in, int* bins)
-{
-	float value[4];
-	int ivalue=0;
-	int x, y;
-
-	/*fill bins */
-	for (y=0; y<in->y; y++) {
-		for (x=0; x<in->x; x++) {
-
-			/* get the pixel */
-			qd_getPixel(in, x, y, value);
-
-			if (value[3] > 0.0f) { /* don't count transparent pixels */
-				switch (node->custom1) {
-					case 1: { /* all colors */
-						value[0] = rgb_to_bw(value);
-						value[0]=value[0]*255; /* scale to 0-255 range */
-						ivalue=(int)value[0];
-						break;
-					}
-					case 2: { /* red channel */
-						value[0]=value[0]*255; /* scale to 0-255 range */
-						ivalue=(int)value[0];
-						break;
-					}
-					case 3:  { /* green channel */
-						value[1]=value[1]*255; /* scale to 0-255 range */
-						ivalue=(int)value[1];
-						break;
-					}
-					case 4: /*blue channel */
-					{
-						value[2]=value[2]*255; /* scale to 0-255 range */
-						ivalue=(int)value[2];
-						break;
-					}
-					case 5: /* luminence */
-					{
-						rgb_to_yuv(value[0], value[1], value[2], &value[0], &value[1], &value[2]);
-						value[0]=value[0]*255; /* scale to 0-255 range */
-						ivalue=(int)value[0];
-						break;
-					}
-				} /*end switch */
-
-				/*clip*/
-				if (ivalue<0) ivalue=0;
-				if (ivalue>255) ivalue=255;
-
-				/*put in the correct bin*/
-				bins[ivalue]+=1;
-			} /*end if alpha */
-		}
-	}
-}
-
-static float brightness_mean(bNode *node, CompBuf* in)
-{
-	float sum=0.0;
-	int numPixels=0.0;
-	int x, y;
-	float value[4];
-
-	for (x=0; x< in->x; x++) {
-		for (y=0; y < in->y; y++) {
-			
-			/* get the pixel */
-			qd_getPixel(in, x, y, value);
-
-			if (value[3] > 0.0f) { /* don't count transparent pixels */
-				numPixels++;
-				switch (node->custom1) {
-				case 1:
-					{
-						value[0] = rgb_to_bw(value);
-						sum+=value[0];
-						break;
-					}
-				case 2:
-					{
-						sum+=value[0];
-						break;
-					}
-				case 3:
-					{
-						sum+=value[1];
-						break;
-					}
-				case 4:
-					{
-						sum+=value[2];
-						break;
-					}
-				case 5:
-					{
-						rgb_to_yuv(value[0], value[1], value[2], &value[0], &value[1], &value[2]);
-						sum+=value[0];
-						break;
-					}
-				}
-			}
-		}
-	}
-
-	return sum/numPixels;
-}
-
-static float brightness_standard_deviation(bNode *node, CompBuf* in, float mean)
-{
-	float sum=0.0;
-	int numPixels=0.0;
-	int x, y;
-	float value[4];
-
-	for (x=0; x< in->x; x++) {
-		for (y=0; y < in->y; y++) {
-			
-			/* get the pixel */
-			qd_getPixel(in, x, y, value);
-
-			if (value[3] > 0.0f) { /* don't count transparent pixels */
-				numPixels++;
-				switch (node->custom1) {
-				case 1:
-					{
-						value[0] = rgb_to_bw(value);
-						sum+=(value[0]-mean)*(value[0]-mean);
-						break;
-					}
-				case 2:
-					{
-						sum+=value[0];
-						sum+=(value[0]-mean)*(value[0]-mean);
-						break;
-					}
-				case 3:
-					{
-						sum+=value[1];
-						sum+=(value[1]-mean)*(value[1]-mean);
-						break;
-					}
-				case 4:
-					{
-						sum+=value[2];
-						sum+=(value[2]-mean)*(value[2]-mean);
-						break;
-					}
-				case 5:
-					{
-						rgb_to_yuv(value[0], value[1], value[2], &value[0], &value[1], &value[2]);
-						sum+=(value[0]-mean)*(value[0]-mean);
-						break;
-					}
-				}
-			}
-		}
-	}
-
-
-	return sqrt(sum/(float)(numPixels-1));
-}
-
-static void draw_histogram(bNode *node, CompBuf *out, int* bins)
-{
-	int x, y;
-	float color[4]; 
-	float value;
-	int max;
-
-	/* find max value */
-	max=0;
-	for (x=0; x<256; x++) {
-		if (bins[x]>max) max=bins[x];
-	}
-
-	/*draw histogram in buffer */
-	for (x=0; x<out->x; x++) {
-		for (y=0;y<out->y; y++) {
-
-			/* get normalized value (0..255) */
-			value=((float)bins[x]/(float)max)*255.0f;
-
-			if (y < (int)value) { /*if the y value is below the height of the bar for this line then draw with the color */
-				switch (node->custom1) {
-					case 1: { /* draw in black */
-						color[0]=0.0; color[1]=0.0; color[2]=0.0; color[3]=1.0;
-						break;
-					}
-					case 2: { /* draw in red */
-						color[0]=1.0; color[1]=0.0; color[2]=0.0; color[3]=1.0;
-						break;
-					}
-					case 3: { /* draw in green */
-						color[0]=0.0; color[1]=1.0; color[2]=0.0; color[3]=1.0;
-						break;
-					}
-					case 4: { /* draw in blue */
-						color[0]=0.0; color[1]=0.0; color[2]=1.0; color[3]=1.0;
-						break;
-					}
-					case 5: { /* draw in white */
-						color[0]=1.0; color[1]=1.0; color[2]=1.0; color[3]=1.0;
-						break;
-					}
-				}
-			}
-			else {
-				color[0]=0.8; color[1]=0.8; color[2]=0.8; color[3]=1.0;
-			}
-
-			/* set the color */
-			qd_setPixel(out, x, y, color);
-		}
-	}
-}
-
-static void node_composit_exec_view_levels(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf* cbuf;
-	CompBuf* histogram;
-	float mean, std_dev;
-	int bins[256];
-	int x;
-
-	if (in[0]->hasinput==0)  return;
-	if (in[0]->data==NULL) return;
-
-	histogram=alloc_compbuf(256, 256, CB_RGBA, 1);
-	cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
-		
-	/*initalize bins*/
-	for (x=0; x<256; x++) {
-		bins[x]=0;
-	}
-	
-	/*fill bins */
-	fill_bins(node, in[0]->data, bins);
-
-	/* draw the histogram chart */
-	draw_histogram(node, histogram, bins);
-
-	/* calculate the average brightness and contrast */
-	mean=brightness_mean(node, in[0]->data);
-	std_dev=brightness_standard_deviation(node, in[0]->data, mean);
-
-	/*  Printf debuging ;) */
-#if 0
-	printf("Mean: %f\n", mean);
-	printf("Std Dev: %f\n", std_dev);
-#endif
-
-	if (out[0]->hasoutput)
-			out[0]->vec[0] = mean;
-	if (out[1]->hasoutput)
-			out[1]->vec[0] = std_dev;
-
-	generate_preview(data, node, histogram);
-
-	if (cbuf!=in[0]->data)
-		free_compbuf(cbuf);
-	free_compbuf(histogram);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_view_levels(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->custom1=1; /*All channels*/
@@ -327,9 +59,6 @@ void register_node_type_cmp_view_levels(bNodeTreeType *ttype)
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_view_levels);
 	node_type_storage(&ntype, "ImageUser", NULL, NULL);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_view_levels);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
index ed23293..6e0c877 100644
--- a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
@@ -45,61 +45,6 @@ static bNodeSocketTemplate cmp_node_luma_matte_out[] = {
 	{-1, 0, ""}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_luma_matte(bNode *node, float *out, float *in)
-{
-	NodeChroma *c=(NodeChroma *)node->storage;
-	float alpha;
-
-	/* test range*/
-	if (in[0]>c->t1) {
-		alpha=1.0;
-	}
-	else if (in[0]<c->t2) {
-		alpha=0.0;
-	}
-	else {/*blend */
-		alpha=(in[0]-c->t2)/(c->t1-c->t2);
-	}
-	
-	/* don't make something that was more transparent less transparent */
-	if (alpha<in[3]) {
-		out[3]=alpha;
-	}
-	else {
-		out[3]=in[3];
-	}
-
-}
-
-static void node_composit_exec_luma_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *cbuf;
-	CompBuf *outbuf;
-	
-	if (in[0]->hasinput==0)  return;
-	if (in[0]->data==NULL) return;
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
-	
-	cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
-	
-	outbuf=dupalloc_compbuf(cbuf);
-
-	composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_yuva, CB_RGBA);
-	composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_luma_matte, CB_RGBA);
-	composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_yuva_to_rgba, CB_RGBA);
-	
-	generate_preview(data, node, outbuf);
-	out[0]->data=outbuf;
-	if (out[1]->hasoutput)
-		out[1]->data=valbuf_from_rgbabuf(outbuf, CHAN_A);
-	if (cbuf!=in[0]->data)
-		free_compbuf(cbuf);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_luma_matte(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
@@ -117,9 +62,6 @@ void register_node_type_cmp_luma_matte(bNodeTreeType *ttype)
 	node_type_size(&ntype, 200, 80, 250);
 	node_type_init(&ntype, node_composit_init_luma_matte);
 	node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_luma_matte);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_mapUV.c b/source/blender/nodes/composite/nodes/node_composite_mapUV.c
index 40092a8..8fd49cd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mapUV.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mapUV.c
@@ -44,128 +44,6 @@ static bNodeSocketTemplate cmp_node_mapuv_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* foreach UV, use these values to read in cbuf and write to stackbuf */
-/* stackbuf should be zeroed */
-static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float threshold)
-{
-	ImBuf *ibuf;
-	float *out= stackbuf->rect, *uv, *uvnext, *uvprev;
-	float dx, dy, alpha;
-	int x, y, sx, sy, row= 3*stackbuf->x;
-	
-	/* ibuf needed for sampling */
-	ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
-	ibuf->rect_float= cbuf->rect;
-	
-	/* vars for efficient looping */
-	uv= uvbuf->rect;
-	uvnext= uv+row;
-	uvprev= uv-row;
-	sx= stackbuf->x;
-	sy= stackbuf->y;
-	
-	for (y=0; y<sy; y++) {
-		for (x=0; x<sx; x++, out+=4, uv+=3, uvnext+=3, uvprev+=3) {
-			if (x>0 && x<sx-1 && y>0 && y<sy-1) {
-				if (uv[2]!=0.0f) {
-					float uv_l, uv_r;
-					
-					/* adaptive sampling, red (U) channel */
-					
-					/* prevent alpha zero UVs to be used */
-					uv_l= uv[-1]!=0.0f? fabsf(uv[0]-uv[-3]) : 0.0f;
-					uv_r= uv[ 5]!=0.0f? fabsf(uv[0]-uv[ 3]) : 0.0f;
-					
-					//dx= 0.5f*(fabs(uv[0]-uv[-3]) + fabs(uv[0]-uv[3]));
-					dx= 0.5f*(uv_l + uv_r);
-					
-					uv_l= uvprev[-1]!=0.0f? fabsf(uv[0]-uvprev[-3]) : 0.0f;
-					uv_r= uvnext[-1]!=0.0f? fabsf(uv[0]-uvnext[-3]) : 0.0f;
-					
-					//dx+= 0.25f*(fabs(uv[0]-uvprev[-3]) + fabs(uv[0]-uvnext[-3]));
-					dx+= 0.25f*(uv_l + uv_r);
-						
-					uv_l= uvprev[ 5]!=0.0f? fabsf(uv[0]-uvprev[+3]) : 0.0f;
-					uv_r= uvnext[ 5]!=0.0f? fabsf(uv[0]-uvnext[+3]) : 0.0f;
-					
-					//dx+= 0.25f*(fabs(uv[0]-uvprev[+3]) + fabs(uv[0]-uvnext[+3]));
-					dx+= 0.25f*(uv_l + uv_r);
-					
-					/* adaptive sampling, green (V) channel */
-					
-					uv_l= uv[-row+2]!=0.0f? fabsf(uv[1]-uv[-row+1]) : 0.0f;
-					uv_r= uv[ row+2]!=0.0f? fabsf(uv[1]-uv[ row+1]) : 0.0f;
-					
-					//dy= 0.5f*(fabs(uv[1]-uv[-row+1]) + fabs(uv[1]-uv[row+1]));
-					dy= 0.5f*(uv_l + uv_r);
-					
-					uv_l= uvprev[-1]!=0.0f? fabsf(uv[1]-uvprev[+1-3]) : 0.0f;
-					uv_r= uvnext[-1]!=0.0f? fabsf(uv[1]-uvnext[+1-3]) : 0.0f;
-					
-					//dy+= 0.25f*(fabs(uv[1]-uvprev[+1-3]) + fabs(uv[1]-uvnext[+1-3]));
-					dy+= 0.25f*(uv_l + uv_r);
-					
-					uv_l= uvprev[ 5]!=0.0f? fabsf(uv[1]-uvprev[+1+3]) : 0.0f;
-					uv_r= uvnext[ 5]!=0.0f? fabsf(uv[1]-uvnext[+1+3]) : 0.0f;
-					
-					//dy+= 0.25f*(fabs(uv[1]-uvprev[+1+3]) + fabs(uv[1]-uvnext[+1+3]));
-					dy+= 0.25f*(uv_l + uv_r);
-					
-					/* UV to alpha threshold */
-					alpha= 1.0f - threshold*(dx+dy);
-					if (alpha<0.0f) alpha= 0.0f;
-					else alpha*= uv[2];
-					
-					/* should use mipmap */
-					if (dx > 0.20f) dx= 0.20f;
-					if (dy > 0.20f) dy= 0.20f;
-					
-					ibuf_sample(ibuf, uv[0], uv[1], dx, dy, out);
-					/* premul */
-					if (alpha<1.0f) {
-						out[0]*= alpha;
-						out[1]*= alpha;
-						out[2]*= alpha;
-						out[3]*= alpha;
-					}
-				}
-			}
-		}
-	}
-
-	IMB_freeImBuf(ibuf);
-}
-
-
-static void node_composit_exec_mapuv(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (out[0]->hasoutput==0)
-		return;
-	
-	if (in[0]->data && in[1]->data) {
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *uvbuf= in[1]->data;
-		CompBuf *stackbuf;
-		
-		cbuf= typecheck_compbuf(cbuf, CB_RGBA);
-		uvbuf= typecheck_compbuf(uvbuf, CB_VEC3);
-		stackbuf= alloc_compbuf(uvbuf->x, uvbuf->y, CB_RGBA, 1); /* allocs */;
-		
-		do_mapuv(stackbuf, cbuf, uvbuf, 0.05f*(float)node->custom1);
-		
-		out[0]->data= stackbuf;
-		
-		if (cbuf!=in[0]->data)
-			free_compbuf(cbuf);
-		if (uvbuf!=in[1]->data)
-			free_compbuf(uvbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_mapuv(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -173,9 +51,6 @@ void register_node_type_cmp_mapuv(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_MAP_UV, "Map UV", NODE_CLASS_DISTORT, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_mapuv_in, cmp_node_mapuv_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_mapuv);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_mapValue.c b/source/blender/nodes/composite/nodes/node_composite_mapValue.c
index 677d5bd..62db0be 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mapValue.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mapValue.c
@@ -42,44 +42,6 @@ static bNodeSocketTemplate cmp_node_map_value_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_map_value(bNode *node, float *out, float *src)
-{
-	TexMapping *texmap= node->storage;
-	
-	out[0] = (src[0] + texmap->loc[0])*texmap->size[0];
-	if (texmap->flag & TEXMAP_CLIP_MIN)
-		if (out[0]<texmap->min[0])
-			out[0] = texmap->min[0];
-	if (texmap->flag & TEXMAP_CLIP_MAX)
-		if (out[0]>texmap->max[0])
-			out[0] = texmap->max[0];
-}
-
-static void node_composit_exec_map_value(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: valbuf */
-	/* stack order out: valbuf */
-	if (out[0]->hasoutput==0) return;
-	
-	/* input no image? then only value operation */
-	if (in[0]->data==NULL) {
-		do_map_value(node, out[0]->vec, in[0]->vec);
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */
-		
-		composit1_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, do_map_value, CB_VAL);
-		
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->storage= add_tex_mapping();
@@ -94,9 +56,6 @@ void register_node_type_cmp_map_value(bNodeTreeType *ttype)
 	node_type_size(&ntype, 100, 60, 150);
 	node_type_init(&ntype, node_composit_init_map_value);
 	node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_map_value);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_mask.c b/source/blender/nodes/composite/nodes/node_composite_mask.c
index 3463c1a..8be6ecd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mask.c
@@ -45,51 +45,9 @@ static bNodeSocketTemplate cmp_node_mask_out[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-static void node_composit_exec_mask(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	if (node->id) {
-		Mask *mask = (Mask *)node->id;
-		MaskRasterHandle *mr_handle;
-		CompBuf *stackbuf;
-		RenderData *rd = data;
-		float *res;
-		int sx, sy;
-
-		if (!out[0]->hasoutput) {
-			/* the node's output socket is not connected to anything...
-			 * do not execute any further, just exit the node immediately
-			 */
-			return;
-		}
-
-		sx = (rd->size * rd->xsch) / 100;
-		sy = (rd->size * rd->ysch) / 100;
-
-		/* allocate the output buffer */
-		stackbuf = alloc_compbuf(sx, sy, CB_VAL, TRUE);
-		res = stackbuf->rect;
-
-		/* mask raster begin */
-		mr_handle = BKE_maskrasterize_handle_new();
-		BKE_maskrasterize_handle_init(mr_handle, mask,
-		                              sx, sy,
-		                              TRUE,
-		                              (node->custom1 & CMP_NODEFLAG_MASK_AA) != 0,
-		                              (node->custom1 & CMP_NODEFLAG_MASK_NO_FEATHER) == 0);
-		BKE_maskrasterize_buffer(mr_handle, sx, sy, res);
-		BKE_maskrasterize_handle_free(mr_handle);
-		/* mask raster end */
-
-		/* pass on output and free */
-		out[0]->data = stackbuf;
-	}
-}
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_mask(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
-	NodeMask *data = MEM_callocN(sizeof(NodeMask), STRINGIFY(NodeMask));
+	NodeMask *data = MEM_callocN(sizeof(NodeMask), "NodeMask");
 	data->size_x = data->size_y = 256;
 	node->storage = data;
 
@@ -105,9 +63,6 @@ void register_node_type_cmp_mask(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, NULL, cmp_node_mask_out);
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_mask);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_mask);
-#endif
 
 	node_type_storage(&ntype, "NodeMask", node_free_standard_storage, node_copy_standard_storage);
 
diff --git a/source/blender/nodes/composite/nodes/node_composite_math.c b/source/blender/nodes/composite/nodes/node_composite_math.c
index 5bc67ad..5bf555c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_math.c
+++ b/source/blender/nodes/composite/nodes/node_composite_math.c
@@ -44,161 +44,6 @@ static bNodeSocketTemplate cmp_node_math_out[] = {
 	{ -1, 0, "" }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_math(bNode *node, float *out, float *in, float *in2)
-{
-	switch (node->custom1) {
-	case 0: /* Add */
-		out[0] = in[0] + in2[0];
-		break; 
-	case 1: /* Subtract */
-		out[0] = in[0] - in2[0];
-		break; 
-	case 2: /* Multiply */
-		out[0] = in[0] * in2[0];
-		break; 
-	case 3: /* Divide */
-		{
-			if (in2[0]==0)	/* We don't want to divide by zero. */
-				out[0] = 0.0;
-			else
-				out[0] = in[0] / in2[0];
-			}
-		break;
-	case 4: /* Sine */
-		out[0] = sin(in[0]);
-		break;
-	case 5: /* Cosine */
-		out[0] = cos(in[0]);
-		break;
-	case 6: /* Tangent */
-		out[0] = tan(in[0]);
-		break;
-	case 7: /* Arc-Sine */
-		{
-			/* Can't do the impossible... */
-			if (in[0] <= 1 && in[0] >= -1 )
-				out[0] = asin(in[0]);
-			else
-				out[0] = 0.0;
-		}
-		break;
-	case 8: /* Arc-Cosine */
-		{
-			/* Can't do the impossible... */
-			if ( in[0] <= 1 && in[0] >= -1 )
-				out[0] = acos(in[0]);
-			else
-				out[0] = 0.0;
-		}
-		break;
-	case 9: /* Arc-Tangent */
-		out[0] = atan(in[0]);
-		break;
-	case 10: /* Power */
-		{
-			/* Only raise negative numbers by full integers */
-			if ( in[0] >= 0 ) {
-				out[0] = pow(in[0], in2[0]);
-			}
-			else {
-				float y_mod_1 = fabsf(fmodf(in2[0], 1.0f));
-				
-				/* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */
-				if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
-					out[0] = powf(in[0], floorf(in2[0] + 0.5f));
-				}
-				else {
-					out[0] = 0.0f;
-				}
-			}
-		}
-		break;
-	case 11: /* Logarithm */
-		{
-			/* Don't want any imaginary numbers... */
-			if ( in[0] > 0  && in2[0] > 0 )
-				out[0] = log(in[0]) / log(in2[0]);
-			else
-				out[0] = 0.0;
-		}
-		break;
-	case 12: /* Minimum */
-		{
-			if ( in[0] < in2[0] )
-				out[0] = in[0];
-			else
-				out[0] = in2[0];
-		}
-		break;
-	case 13: /* Maximum */
-		{
-			if ( in[0] > in2[0] )
-				out[0] = in[0];
-			else
-				out[0] = in2[0];
-		}
-		break;
-	case 14: /* Round */
-		{
-			/* round by the second value */
-			if ( in2[0] != 0.0f )
-				out[0] = floorf(in[0] / in2[0] + 0.5f) * in2[0];
-			else
-				out[0] = floorf(in[0] + 0.5f);
-		}
-		break;
-	case 15: /* Less Than */
-		{
-			if ( in[0] < in2[0] )
-				out[0] = 1.0f;
-			else
-				out[0] = 0.0f;
-		}
-		break;
-	case 16: /* Greater Than */
-		{
-			if ( in[0] > in2[0] )
-				out[0] = 1.0f;
-			else
-				out[0] = 0.0f;
-		}
-		break;
-	}
-}
-
-static void node_composit_exec_math(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *cbuf=in[0]->data;
-	CompBuf *cbuf2=in[1]->data;
-	CompBuf *stackbuf; 
-
-	/* check for inputs and outputs for early out*/
-	if (out[0]->hasoutput==0) return;
-
-	/* no image-color operation */
-	if (in[0]->data==NULL && in[1]->data==NULL) {
-		do_math(node, out[0]->vec, in[0]->vec, in[1]->vec);
-		return;
-	}
-
-	/* create output based on first input */
-	if (cbuf) {
-		stackbuf=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
-	}
-	/* and if it doesn't exist use the second input since we 
-	 * know that one of them must exist at this point*/
-	else {
-		stackbuf=alloc_compbuf(cbuf2->x, cbuf2->y, CB_VAL, 1);
-	}
-
-	/* operate in case there's valid size */
-	composit2_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_math, CB_VAL, CB_VAL);
-	out[0]->data= stackbuf;
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
 
 void register_node_type_cmp_math(bNodeTreeType *ttype)
 {
@@ -208,9 +53,6 @@ void register_node_type_cmp_math(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_math_in, cmp_node_math_out);
 	node_type_size(&ntype, 120, 110, 160);
 	node_type_label(&ntype, node_math_label);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_math);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
index 5d3ee48..fed73e1 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
@@ -43,48 +43,6 @@ static bNodeSocketTemplate cmp_node_mix_rgb_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float *fac)
-{
-	float col[3];
-	
-	copy_v3_v3(col, in1);
-	if (node->custom2)
-		ramp_blend(node->custom1, col, in2[3]*fac[0], in2);
-	else
-		ramp_blend(node->custom1, col, fac[0], in2);
-	copy_v3_v3(out, col);
-	out[3] = in1[3];
-}
-
-static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: fac, Image, Image */
-	/* stack order out: Image */
-	float *fac= in[0]->vec;
-	
-	if (out[0]->hasoutput==0) return;
-	
-	/* input no image? then only color operation */
-	if (in[1]->data==NULL && in[2]->data==NULL) {
-		do_mix_rgb(node, out[0]->vec, in[1]->vec, in[2]->vec, fac);
-	}
-	else {
-		/* make output size of first available input image */
-		CompBuf *cbuf= in[1]->data?in[1]->data:in[2]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		
-		composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, fac, do_mix_rgb, CB_RGBA, CB_RGBA, CB_VAL);
-		
-		out[0]->data= stackbuf;
-		
-		generate_preview(data, node, out[0]->data);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 /* custom1 = mix type */
 void register_node_type_cmp_mix_rgb(bNodeTreeType *ttype)
 {
@@ -94,9 +52,6 @@ void register_node_type_cmp_mix_rgb(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_mix_rgb_in, cmp_node_mix_rgb_out);
 	node_type_size(&ntype, 110, 60, 120);
 	node_type_label(&ntype, node_blend_label);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_mix_rgb);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_movieclip.c b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
index 370cff5..85745d2 100644
--- a/source/blender/nodes/composite/nodes/node_composite_movieclip.c
+++ b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
@@ -42,106 +42,6 @@ static bNodeSocketTemplate cmp_node_movieclip_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static CompBuf *node_composit_get_movieclip(RenderData *rd, MovieClip *clip, MovieClipUser *user)
-{
-	ImBuf *orig_ibuf, *ibuf;
-	CompBuf *stackbuf;
-	int type;
-
-	float *rect;
-	int alloc = FALSE;
-
-	orig_ibuf = BKE_movieclip_get_ibuf(clip, user);
-
-	if (orig_ibuf == NULL || (orig_ibuf->rect == NULL && orig_ibuf->rect_float == NULL)) {
-		IMB_freeImBuf(orig_ibuf);
-		return NULL;
-	}
-
-	ibuf = IMB_dupImBuf(orig_ibuf);
-	IMB_freeImBuf(orig_ibuf);
-
-	if (ibuf->rect_float == NULL || (ibuf->userflags & IB_RECT_INVALID)) {
-		IMB_float_from_rect(ibuf);
-		ibuf->userflags &= ~IB_RECT_INVALID;
-	}
-
-	/* now we need a float buffer from the image with matching color management */
-	if (ibuf->channels == 4) {
-		rect = node_composit_get_float_buffer(rd, ibuf, &alloc);
-	}
-	else {
-		/* non-rgba passes can't use color profiles */
-		rect = ibuf->rect_float;
-	}
-	/* done coercing into the correct color management */
-
-	if (!alloc) {
-		rect = MEM_dupallocN(rect);
-		alloc = TRUE;
-	}
-
-	type = ibuf->channels;
-
-	if (rd->scemode & R_COMP_CROP) {
-		stackbuf = get_cropped_compbuf(&rd->disprect, rect, ibuf->x, ibuf->y, type);
-		if (alloc)
-			MEM_freeN(rect);
-	}
-	else {
-		/* we put imbuf copy on stack, cbuf knows rect is from other ibuf when freed! */
-		stackbuf = alloc_compbuf(ibuf->x, ibuf->y, type, FALSE);
-		stackbuf->rect = rect;
-		stackbuf->malloc = alloc;
-	}
-
-	IMB_freeImBuf(ibuf);
-
-	return stackbuf;
-}
-
-static void node_composit_exec_movieclip(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	if (node->id) {
-		RenderData *rd = data;
-		MovieClip *clip = (MovieClip *)node->id;
-		MovieClipUser *user = (MovieClipUser *)node->storage;
-		CompBuf *stackbuf = NULL;
-
-		BKE_movieclip_user_set_frame(user, rd->cfra);
-
-		stackbuf = node_composit_get_movieclip(rd, clip, user);
-
-		if (stackbuf) {
-			MovieTrackingStabilization *stab = &clip->tracking.stabilization;
-
-			/* put image on stack */
-			out[0]->data = stackbuf;
-
-			if (stab->flag & TRACKING_2D_STABILIZATION) {
-				float loc[2], scale, angle;
-				int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, rd->cfra);
-
-				BKE_tracking_stabilization_data_get(&clip->tracking, clip_framenr, stackbuf->x, stackbuf->y,
-							loc, &scale, &angle);
-
-				out[1]->vec[0] = loc[0];
-				out[2]->vec[0] = loc[1];
-
-				out[3]->vec[0] = scale;
-				out[4]->vec[0] = angle;
-			}
-
-			/* generate preview */
-			generate_preview(data, node, stackbuf);
-		}
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	MovieClipUser *user = MEM_callocN(sizeof(MovieClipUser), "node movie clip user");
@@ -159,9 +59,6 @@ void register_node_type_cmp_movieclip(bNodeTreeType *ttype)
 	node_type_size(&ntype, 120, 80, 300);
 	node_type_init(&ntype, init);
 	node_type_storage(&ntype, "MovieClipUser", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_movieclip);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
index 9f4cd46..4817c59 100644
--- a/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
+++ b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
@@ -30,9 +30,6 @@
  *  \ingroup cmpnodes
  */
 
-#include "BLF_translation.h"
-
-
 #include "node_composite_util.h"
 
 /* **************** Translate  ******************** */
@@ -47,66 +44,6 @@ static bNodeSocketTemplate cmp_node_moviedistortion_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-static void node_composit_exec_moviedistortion(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (in[0]->data) {
-		if (node->id) {
-			MovieClip *clip = (MovieClip *)node->id;
-			CompBuf *cbuf = typecheck_compbuf(in[0]->data, CB_RGBA);
-			CompBuf *stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 0);
-			ImBuf *ibuf;
-
-			ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
-
-			if (ibuf) {
-				RenderData *rd = data;
-				ImBuf *obuf;
-				MovieTracking *tracking = &clip->tracking;
-				int width, height;
-				float overscan = 0.0f;
-				MovieClipUser user = {0};
-
-				BKE_movieclip_user_set_frame(&user, rd->cfra);
-
-				ibuf->rect_float = cbuf->rect;
-
-				BKE_movieclip_get_size(clip, &user, &width, &height);
-
-				if (!node->storage)
-					node->storage = BKE_tracking_distortion_new();
-
-				if (node->custom1 == 0)
-					obuf = BKE_tracking_distortion_exec(node->storage, tracking, ibuf, width, height, overscan, 1);
-				else
-					obuf = BKE_tracking_distortion_exec(node->storage, tracking, ibuf, width, height, overscan, 0);
-
-				stackbuf->rect = obuf->rect_float;
-				stackbuf->malloc = TRUE;
-
-				obuf->mall &= ~IB_rectfloat;
-				obuf->rect_float = NULL;
-
-				IMB_freeImBuf(ibuf);
-				IMB_freeImBuf(obuf);
-			}
-
-			/* pass on output and free */
-			out[0]->data = stackbuf;
-
-			if (cbuf != in[0]->data)
-				free_compbuf(cbuf);
-		}
-		else {
-			CompBuf *cbuf = in[0]->data;
-			CompBuf *stackbuf = pass_on_compbuf(cbuf);
-
-			out[0]->data = stackbuf;
-		}
-	}
-}
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static const char *label(bNode *node)
 {
 	if (node->custom1 == 0)
@@ -137,9 +74,6 @@ void register_node_type_cmp_moviedistortion(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_moviedistortion_in, cmp_node_moviedistortion_out);
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_label(&ntype, label);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_moviedistortion);
-#endif
 
 	node_type_storage(&ntype, NULL, storage_free, storage_copy);
 
diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.c b/source/blender/nodes/composite/nodes/node_composite_normal.c
index d104e8f..1497757 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normal.c
+++ b/source/blender/nodes/composite/nodes/node_composite_normal.c
@@ -45,44 +45,6 @@ static bNodeSocketTemplate cmp_node_normal_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_normal(bNode *node, float *out, float *in)
-{
-	bNodeSocket *sock= node->outputs.first;
-	float *nor= ((bNodeSocketValueVector*)sock->default_value)->value;
-	
-	/* render normals point inside... the widget points outside */
-	out[0] = -dot_v3v3(nor, in);
-}
-
-/* generates normal, does dot product */
-static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	bNodeSocket *sock= node->outputs.first;
-	float *nor= ((bNodeSocketValueVector*)sock->default_value)->value;
-	/* stack order input:  normal */
-	/* stack order output: normal, value */
-	
-	/* input no image? then only vector op */
-	if (in[0]->data==NULL) {
-		copy_v3_v3(out[0]->vec, nor);
-		/* render normals point inside... the widget points outside */
-		out[1]->vec[0] = -dot_v3v3(out[0]->vec, in[0]->vec);
-	}
-	else if (out[1]->hasoutput) {
-		/* make output size of input image */
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */
-		
-		composit1_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, do_normal, CB_VEC3);
-		
-		out[1]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	bNodeSocket *sock= node->outputs.first;
@@ -101,9 +63,6 @@ void register_node_type_cmp_normal(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_normal_in, cmp_node_normal_out);
 	node_type_init(&ntype, init);
 	node_type_size(&ntype, 100, 60, 200);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_normal);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_normalize.c b/source/blender/nodes/composite/nodes/node_composite_normalize.c
index 19b543d..f90a5cd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normalize.c
+++ b/source/blender/nodes/composite/nodes/node_composite_normalize.c
@@ -43,69 +43,6 @@ static bNodeSocketTemplate cmp_node_normalize_out[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_normalize(bNode *UNUSED(node), float *out, float *src, float *min, float *mult)
-{
-	float res;
-	res = (src[0] - min[0]) * mult[0];
-	if (res > 1.0f) {
-		out[0] = 1.0f;
-	}
-	else if (res < 0.0f) {
-		out[0] = 0.0f;
-	}
-	else {
-		out[0] = res;
-	}
-}
-
-/* The code below assumes all data is inside range +- this, and that input buffer is single channel */
-#define BLENDER_ZMAX 10000.0f
-
-static void node_composit_exec_normalize(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: valbuf */
-	/* stack order out: valbuf */
-	if (out[0]->hasoutput==0) return;
-
-	/* Input has no image buffer? Then pass the value */
-	if (in[0]->data==NULL) {
-		copy_v4_v4(out[0]->vec, in[0]->vec);
-	}
-	else {
-		float min = 1.0f+BLENDER_ZMAX;
-		float max = -1.0f-BLENDER_ZMAX;
-		float mult = 1.0f;
-		float *val;
-		/* make output size of input image */
-		CompBuf *cbuf= in[0]->data;
-		int tot= cbuf->x*cbuf->y;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */
-
-		for (val = cbuf->rect; tot; tot--, val++) {
-			if ((*val > max) && (*val <= BLENDER_ZMAX)) {
-				max = *val;
-			}
-			if ((*val < min) && (*val >= -BLENDER_ZMAX)) {
-				min = *val;
-			}
-		}
-		/* In the rare case of flat buffer, which would cause a divide by 0, just pass the input to the output */
-		if ((max-min) != 0.0f) {
-			mult = 1.0f/(max-min);
-			composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, NULL, &min, NULL, &mult, do_normalize, CB_VAL, CB_VAL, CB_VAL);
-		}
-		else {
-			memcpy(stackbuf->rect, cbuf->rect, sizeof(float) * cbuf->x * cbuf->y);
-		}
-
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_normalize(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -113,9 +50,6 @@ void register_node_type_cmp_normalize(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_NORMALIZE, "Normalize", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_normalize_in, cmp_node_normalize_out);
 	node_type_size(&ntype, 100, 60, 150);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_normalize);
-#endif
 	
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_outputFile.c b/source/blender/nodes/composite/nodes/node_composite_outputFile.c
index fe23f73..e8a6506 100644
--- a/source/blender/nodes/composite/nodes/node_composite_outputFile.c
+++ b/source/blender/nodes/composite/nodes/node_composite_outputFile.c
@@ -225,183 +225,6 @@ static void update_output_file(bNodeTree *UNUSED(ntree), bNode *node)
 	}
 }
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* write input data into individual files */
-static void exec_output_file_singlelayer(RenderData *rd, bNode *node, bNodeStack **in)
-{
-	Main *bmain= G.main; /* TODO, have this passed along */
-	NodeImageMultiFile *nimf= node->storage;
-	bNodeSocket *sock;
-	int i;
-	int has_preview = 0;
-	
-	for (sock=node->inputs.first, i=0; sock; sock=sock->next, ++i) {
-		if (in[i]->data) {
-			NodeImageMultiFileSocket *sockdata = sock->storage;
-			ImageFormatData *format = (sockdata->use_node_format ? &nimf->format : &sockdata->format);
-			char path[FILE_MAX];
-			char filename[FILE_MAX];
-			CompBuf *cbuf = NULL;
-			ImBuf *ibuf;
-			
-			switch (format->planes) {
-			case R_IMF_PLANES_BW:
-				cbuf = typecheck_compbuf(in[i]->data, CB_VAL);
-				break;
-			case R_IMF_PLANES_RGB:
-				cbuf = typecheck_compbuf(in[i]->data, CB_VEC3);
-				break;
-			case R_IMF_PLANES_RGBA:
-				cbuf = typecheck_compbuf(in[i]->data, CB_RGBA);
-				break;
-			}
-			
-			ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, format->planes, 0);
-			/* XXX have to set this explicitly it seems */
-			switch (format->planes) {
-			case R_IMF_PLANES_BW:	ibuf->channels = 1;	break;
-			case R_IMF_PLANES_RGB:	ibuf->channels = 3;	break;
-			case R_IMF_PLANES_RGBA:	ibuf->channels = 4;	break;
-			}
-			ibuf->rect_float = cbuf->rect;
-			ibuf->dither = rd->dither_intensity;
-			
-			/* get full path */
-			BLI_join_dirfile(path, FILE_MAX, nimf->base_path, sockdata->path);
-			BKE_makepicstring(filename, path, bmain->name, rd->cfra, format, (rd->scemode & R_EXTENSION), TRUE);
-			
-			if (0 == BKE_imbuf_write(ibuf, filename, format))
-				printf("Cannot save Node File Output to %s\n", filename);
-			else
-				printf("Saved: %s\n", filename);
-			
-			IMB_freeImBuf(ibuf);
-			
-			/* simply pick the first valid input for preview */
-			if (!has_preview) {
-				generate_preview(rd, node, cbuf);
-				has_preview = 1;
-			}
-			
-			if (in[i]->data != cbuf) 
-				free_compbuf(cbuf);
-		}
-	}
-}
-
-/* write input data into layers */
-static void exec_output_file_multilayer(RenderData *rd, bNode *node, bNodeStack **in)
-{
-	Main *bmain= G.main; /* TODO, have this passed along */
-	NodeImageMultiFile *nimf= node->storage;
-	void *exrhandle= IMB_exr_get_handle();
-	char filename[FILE_MAX];
-	bNodeSocket *sock;
-	int i;
-	/* Must have consistent pixel size for exr file, simply take the first valid input size. */
-	int rectx = -1;
-	int recty = -1;
-	int has_preview = 0;
-	
-	BKE_makepicstring_from_type(filename, nimf->base_path, bmain->name, rd->cfra, R_IMF_IMTYPE_MULTILAYER, (rd->scemode & R_EXTENSION), TRUE);
-	BLI_make_existing_file(filename);
-	
-	for (sock=node->inputs.first, i=0; sock; sock=sock->next, ++i) {
-		if (in[i]->data) {
-			NodeImageMultiFileSocket *sockdata = sock->storage;
-			CompBuf *cbuf = in[i]->data;
-			char channelname[EXR_TOT_MAXNAME];	/* '.' and single character channel name is appended */
-			char *channelname_ext;
-			
-			if (cbuf->rect_procedural) {
-				printf("Error writing multilayer EXR: Procedural buffer not supported\n");
-				continue;
-			}
-			if (rectx < 0) {
-				rectx = cbuf->x;
-				recty = cbuf->y;
-			}
-			else if (cbuf->x != rectx || cbuf->y != recty) {
-				printf("Error: Multilayer EXR output node %s expects same resolution for all input buffers. Layer %s skipped.\n", node->name, sock->name);
-				continue;
-			}
-			
-			BLI_strncpy(channelname, sockdata->layer, sizeof(channelname)-2);
-			channelname_ext = channelname + strlen(channelname);
-			
-			/* create channels */
-			switch (cbuf->type) {
-			case CB_VAL:
-				strcpy(channelname_ext, ".V");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 1, rectx, cbuf->rect);
-				break;
-			case CB_VEC2:
-				strcpy(channelname_ext, ".X");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 2, 2*rectx, cbuf->rect);
-				strcpy(channelname_ext, ".Y");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 2, 2*rectx, cbuf->rect+1);
-				break;
-			case CB_VEC3:
-				strcpy(channelname_ext, ".X");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 3, 3*rectx, cbuf->rect);
-				strcpy(channelname_ext, ".Y");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 3, 3*rectx, cbuf->rect+1);
-				strcpy(channelname_ext, ".Z");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 3, 3*rectx, cbuf->rect+2);
-				break;
-			case CB_RGBA:
-				strcpy(channelname_ext, ".R");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 4, 4*rectx, cbuf->rect);
-				strcpy(channelname_ext, ".G");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 4, 4*rectx, cbuf->rect+1);
-				strcpy(channelname_ext, ".B");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 4, 4*rectx, cbuf->rect+2);
-				strcpy(channelname_ext, ".A");
-				IMB_exr_add_channel(exrhandle, NULL, channelname, 4, 4*rectx, cbuf->rect+3);
-				break;
-			}
-			
-			/* simply pick the first valid input for preview */
-			if (!has_preview) {
-				generate_preview(rd, node, cbuf);
-				has_preview = 1;
-			}
-		}
-	}
-	
-	/* when the filename has no permissions, this can fail */
-	if (IMB_exr_begin_write(exrhandle, filename, rectx, recty, nimf->format.exr_codec)) {
-		IMB_exr_write_channels(exrhandle);
-	}
-	else {
-		/* TODO, get the error from openexr's exception */
-		/* XXX nice way to do report? */
-		printf("Error Writing Render Result, see console\n");
-	}
-	
-	IMB_exr_close(exrhandle);
-}
-
-static void node_composit_exec_outputfile(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
-{
-	RenderData *rd= data;
-	NodeImageMultiFile *nimf= node->storage;
-	
-	if (G.is_rendering == FALSE) {
-		/* only output files when rendering a sequence -
-		 * otherwise, it overwrites the output files just 
-		 * scrubbing through the timeline when the compositor updates */
-		return;
-	}
-	
-	if (nimf->format.imtype==R_IMF_IMTYPE_MULTILAYER)
-		exec_output_file_multilayer(rd, node, in);
-	else
-		exec_output_file_singlelayer(rd, node, in);
-}
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_output_file(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -412,9 +235,6 @@ void register_node_type_cmp_output_file(bNodeTreeType *ttype)
 	node_type_init(&ntype, init_output_file);
 	node_type_storage(&ntype, "NodeImageMultiFile", free_output_file, copy_output_file);
 	node_type_update(&ntype, update_output_file, NULL);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_outputfile);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_premulkey.c b/source/blender/nodes/composite/nodes/node_composite_premulkey.c
index 7f7b769..88f583b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_premulkey.c
+++ b/source/blender/nodes/composite/nodes/node_composite_premulkey.c
@@ -44,27 +44,6 @@ static bNodeSocketTemplate cmp_node_premulkey_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_premulkey(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (out[0]->hasoutput==0)
-		return;
-	
-	if (in[0]->data) {
-		CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
-
-		stackbuf= dupalloc_compbuf(cbuf);
-		premul_compbuf(stackbuf, node->custom1 == 1);
-
-		out[0]->data = stackbuf;
-		if (cbuf != in[0]->data)
-			free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_premulkey(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -72,9 +51,6 @@ void register_node_type_cmp_premulkey(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_PREMULKEY, "Alpha Convert", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_premulkey_in, cmp_node_premulkey_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_premulkey);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_rgb.c b/source/blender/nodes/composite/nodes/node_composite_rgb.c
index 54fba65..ad06d7a 100644
--- a/source/blender/nodes/composite/nodes/node_composite_rgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_rgb.c
@@ -39,18 +39,6 @@ static bNodeSocketTemplate cmp_node_rgb_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	bNodeSocket *sock= node->outputs.first;
-	float *col= ((bNodeSocketValueRGBA*)sock->default_value)->value;
-	
-	copy_v4_v4(out[0]->vec, col);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_rgb(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	bNodeSocket *sock= node->outputs.first;
@@ -70,9 +58,6 @@ void register_node_type_cmp_rgb(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, NULL, cmp_node_rgb_out);
 	node_type_init(&ntype, node_composit_init_rgb);
 	node_type_size(&ntype, 140, 80, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_rgb);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_rotate.c b/source/blender/nodes/composite/nodes/node_composite_rotate.c
index 50c8b2a..4eb869e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_rotate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_rotate.c
@@ -44,87 +44,6 @@ static bNodeSocketTemplate cmp_node_rotate_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* only supports RGBA nodes now */
-static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-
-	if (out[0]->hasoutput==0)
-		return;
-
-	if (in[0]->data) {
-		CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1);	/* note, this returns zero'd image */
-		float rad, u, v, s, c, centx, centy, miny, maxy, minx, maxx;
-		int x, y, yo, xo;
-		ImBuf *ibuf, *obuf;
-
-		rad= in[1]->vec[0];
-
-
-		s= sin(rad);
-		c= cos(rad);
-		centx= cbuf->x/2;
-		centy= cbuf->y/2;
-
-		minx= -centx;
-		maxx= -centx + (float)cbuf->x;
-		miny= -centy;
-		maxy= -centy + (float)cbuf->y;
-
-
-		ibuf=IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
-		obuf=IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0);
-
-		if (ibuf && obuf) {
-			ibuf->rect_float=cbuf->rect;
-			obuf->rect_float=stackbuf->rect;
-
-			for (y=miny; y<maxy; y++) {
-				yo= y+(int)centy;
-
-				for (x=minx; x<maxx;x++) {
-					u=c*x + y*s + centx;
-					v=-s*x + c*y + centy;
-					xo= x+(int)centx;
-
-					switch (node->custom1) {
-					case 0:
-						nearest_interpolation(ibuf, obuf, u, v, xo, yo);
-						break;
-					case 1:
-						bilinear_interpolation(ibuf, obuf, u, v, xo, yo);
-						break;
-					case 2:
-						bicubic_interpolation(ibuf, obuf, u, v, xo, yo);
-						break;
-					}
-
-				}
-			}
-
-			/* rotate offset vector too, but why negative rad, ehh?? Has to be replaced with [3][3] matrix once (ton) */
-			s= sin(-rad);
-			c= cos(-rad);
-			centx= (float)cbuf->xof; centy= (float)cbuf->yof;
-			stackbuf->xof= (int)( c*centx + s*centy);
-			stackbuf->yof= (int)(-s*centx + c*centy);
-
-			IMB_freeImBuf(ibuf);
-			IMB_freeImBuf(obuf);
-		}
-
-		/* pass on output and free */
-		out[0]->data= stackbuf;
-		if (cbuf!=in[0]->data) {
-			free_compbuf(cbuf);
-		}
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_rotate(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->custom1= 1; /* Bilinear Filter*/
@@ -138,9 +57,6 @@ void register_node_type_cmp_rotate(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, cmp_node_rotate_in, cmp_node_rotate_out);
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_rotate);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_rotate);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_scale.c b/source/blender/nodes/composite/nodes/node_composite_scale.c
index 2224d65..5136aec 100644
--- a/source/blender/nodes/composite/nodes/node_composite_scale.c
+++ b/source/blender/nodes/composite/nodes/node_composite_scale.c
@@ -45,147 +45,6 @@ static bNodeSocketTemplate cmp_node_scale_out[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* only supports RGBA nodes now */
-/* node->custom1 stores if input values are absolute or relative scale */
-static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (out[0]->hasoutput == 0)
-		return;
-
-	if (in[0]->data) {
-		RenderData *rd = data;
-		CompBuf *stackbuf, *cbuf = typecheck_compbuf(in[0]->data, CB_RGBA);
-		ImBuf *ibuf;
-		int newx, newy;
-		float ofsx = 0.0f, ofsy = 0.0f;
-
-		if (node->custom1 == CMP_SCALE_RELATIVE) {
-			newx = MAX2((int)(in[1]->vec[0] * cbuf->x), 1);
-			newy = MAX2((int)(in[2]->vec[0] * cbuf->y), 1);
-		}
-		else if (node->custom1 == CMP_SCALE_SCENEPERCENT) {
-			newx = cbuf->x * (rd->size / 100.0f);
-			newy = cbuf->y * (rd->size / 100.0f);
-		}
-		else if (node->custom1 == CMP_SCALE_RENDERPERCENT) {
-
-			if (node->custom3 != 0.0f || node->custom4 != 0.0f) {
-				const float w_dst = (rd->xsch * rd->size) / 100;
-				const float h_dst = (rd->ysch * rd->size) / 100;
-
-				if (w_dst > h_dst) {
-					ofsx = node->custom3 * w_dst;
-					ofsy = node->custom4 * w_dst;
-				}
-				else {
-					ofsx = node->custom3 * h_dst;
-					ofsy = node->custom4 * h_dst;
-				}
-			}
-
-			/* supports framing options */
-			if (node->custom2 & CMP_SCALE_RENDERSIZE_FRAME_ASPECT) {
-				/* apply aspect from clip */
-				const float w_src = cbuf->x;
-				const float h_src = cbuf->y;
-
-				/* destination aspect is already applied from the camera frame */
-				const float w_dst = (rd->xsch * rd->size) / 100;
-				const float h_dst = (rd->ysch * rd->size) / 100;
-
-				const float asp_src = w_src / h_src;
-				const float asp_dst = w_dst / h_dst;
-
-				if (fabsf(asp_src - asp_dst) >= FLT_EPSILON) {
-					if ((asp_src > asp_dst) == ((node->custom2 & CMP_SCALE_RENDERSIZE_FRAME_CROP) != 0)) {
-						/* fit X */
-						const float div = asp_src / asp_dst;
-						newx = w_dst * div;
-						newy = h_dst;
-					}
-					else {
-						/* fit Y */
-						const float div = asp_dst / asp_src;
-						newx = w_dst;
-						newy = h_dst * div;
-					}
-				}
-				else {
-					/* same as below - no aspect correction needed  */
-					newx = w_dst;
-					newy = h_dst;
-				}
-			}
-			else {
-				/* stretch */
-				newx = (rd->xsch * rd->size) / 100;
-				newy = (rd->ysch * rd->size) / 100;
-			}
-		}
-		else {  /* CMP_SCALE_ABSOLUTE */
-			newx = MAX2((int)in[1]->vec[0], 1);
-			newy = MAX2((int)in[2]->vec[0], 1);
-		}
-		newx = MIN2(newx, CMP_SCALE_MAX);
-		newy = MIN2(newy, CMP_SCALE_MAX);
-
-		ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
-		if (ibuf) {
-			ibuf->rect_float = cbuf->rect;
-			IMB_scaleImBuf(ibuf, newx, newy);
-
-			if (ibuf->rect_float == cbuf->rect) {
-				/* no scaling happened. */
-				stackbuf = pass_on_compbuf(in[0]->data);
-			}
-			else {
-				stackbuf = alloc_compbuf(newx, newy, CB_RGBA, 0);
-				stackbuf->rect = ibuf->rect_float;
-				stackbuf->malloc = 1;
-			}
-
-			ibuf->rect_float = NULL;
-			ibuf->mall &= ~IB_rectfloat;
-			IMB_freeImBuf(ibuf);
-
-			/* also do the translation vector */
-			stackbuf->xof = (int)(ofsx + (((float)newx / (float)cbuf->x) * (float)cbuf->xof));
-			stackbuf->yof = (int)(ofsy + (((float)newy / (float)cbuf->y) * (float)cbuf->yof));
-		}
-		else {
-			stackbuf = dupalloc_compbuf(cbuf);
-			printf("Scaling to %dx%d failed\n", newx, newy);
-		}
-
-		out[0]->data = stackbuf;
-		if (cbuf != in[0]->data)
-			free_compbuf(cbuf);
-	}
-	else if (node->custom1 == CMP_SCALE_ABSOLUTE) {
-		CompBuf *stackbuf;
-		int a, x, y;
-		float *fp;
-
-		x = MAX2((int)in[1]->vec[0], 1);
-		y = MAX2((int)in[2]->vec[0], 1);
-
-		stackbuf = alloc_compbuf(x, y, CB_RGBA, 1);
-		fp = stackbuf->rect;
-
-		a = stackbuf->x * stackbuf->y;
-		while (a--) {
-			copy_v4_v4(fp, in[0]->vec);
-			fp += 4;
-		}
-
-		out[0]->data = stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_scale(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -193,9 +52,6 @@ void register_node_type_cmp_scale(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_scale_in, cmp_node_scale_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_scale);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
index f1a7549..83b9d5d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
@@ -46,63 +46,6 @@ static bNodeSocketTemplate cmp_node_sephsva_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_sephsva(bNode *UNUSED(node), float *out, float *in)
-{
-	float h, s, v;
-	
-	rgb_to_hsv(in[0], in[1], in[2], &h, &s, &v);
-	
-	out[0] = h;
-	out[1] = s;
-	out[2] = v;
-	out[3] = in[3];
-}
-
-static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: bw channels */
-	/* stack order in: col */
-
-	/* input no image? then only color operation */
-	if (in[0]->data==NULL) {
-		float h, s, v;
-	
-	rgb_to_hsv(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &h, &s, &v);
-		
-		out[0]->vec[0] = h;
-		out[1]->vec[0] = s;
-		out[2]->vec[0] = v;
-		out[3]->vec[0] = in[0]->vec[3];
-	}
-	else if ((out[0]->hasoutput) || (out[1]->hasoutput) || (out[2]->hasoutput) || (out[3]->hasoutput)) {
-		/* create new buffer so input buffer doesn't get corrupted */
-		CompBuf *cbuf= dupalloc_compbuf(in[0]->data);
-		CompBuf *cbuf2= typecheck_compbuf(cbuf, CB_RGBA);
-
-		/* convert the RGB stackbuf to an HSV representation */
-		composit1_pixel_processor(node, cbuf2, cbuf2, in[0]->vec, do_sephsva, CB_RGBA);
-
-		/* separate each of those channels */
-		if (out[0]->hasoutput)
-			out[0]->data= valbuf_from_rgbabuf(cbuf2, CHAN_R);
-		if (out[1]->hasoutput)
-			out[1]->data= valbuf_from_rgbabuf(cbuf2, CHAN_G);
-		if (out[2]->hasoutput)
-			out[2]->data= valbuf_from_rgbabuf(cbuf2, CHAN_B);
-		if (out[3]->hasoutput)
-			out[3]->data= valbuf_from_rgbabuf(cbuf2, CHAN_A);
-
-		/*not used anymore */
-		if (cbuf2!=cbuf)
-			free_compbuf(cbuf2);
-		free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_sephsva(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -110,9 +53,6 @@ void register_node_type_cmp_sephsva(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_SEPHSVA, "Separate HSVA", NODE_CLASS_CONVERTOR, 0);
 	node_type_socket_templates(&ntype, cmp_node_sephsva_in, cmp_node_sephsva_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_sephsva);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -131,53 +71,6 @@ static bNodeSocketTemplate cmp_node_combhsva_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_comb_hsva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
-{
-	float r, g, b;
-	hsv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b);
-
-	out[0] = r;
-	out[1] = g;
-	out[2] = b;
-	out[3] = in4[0];
-}
-
-static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: 1 rgba channels */
-	/* stack order in: 4 value channels */
-
-	/* input no image? then only color operation in HSV */
-	if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
-		hsv_to_rgb(in[0]->vec[0], in[1]->vec[0], in[2]->vec[0],
-		&out[0]->vec[0], &out[0]->vec[1], &out[0]->vec[2]);
-		out[0]->vec[3] = in[3]->vec[0];
-	}
-	else {
-		/* make output size of first available input image */
-		CompBuf *cbuf;
-		CompBuf *stackbuf;
-
-		/* allocate a CompBuf the size of the first available input */
-		if (in[0]->data) cbuf = in[0]->data;
-		else if (in[1]->data) cbuf = in[1]->data;
-		else if (in[2]->data) cbuf = in[2]->data;
-		else cbuf = in[3]->data;
-
-		stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-
-		composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec,
-		in[2]->data, in[2]->vec, in[3]->data, in[3]->vec,
-		do_comb_hsva, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
-
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_combhsva(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -185,9 +78,6 @@ void register_node_type_cmp_combhsva(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_COMBHSVA, "Combine HSVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_combhsva_in, cmp_node_combhsva_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_combhsva);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
index 83b2c73..8508087 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
@@ -45,42 +45,6 @@ static bNodeSocketTemplate cmp_node_seprgba_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_seprgba(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: bw channels */
-	/* stack order in: col */
-	
-	/* input no image? then only color operation */
-	if (in[0]->data==NULL) {
-		out[0]->vec[0] = in[0]->vec[0];
-		out[1]->vec[0] = in[0]->vec[1];
-		out[2]->vec[0] = in[0]->vec[2];
-		out[3]->vec[0] = in[0]->vec[3];
-	}
-	else {
-		/* make sure we get right rgba buffer */
-		CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
-
-		/* don't do any pixel processing, just copy the stack directly (faster, I presume) */
-		if (out[0]->hasoutput)
-			out[0]->data= valbuf_from_rgbabuf(cbuf, CHAN_R);
-		if (out[1]->hasoutput)
-			out[1]->data= valbuf_from_rgbabuf(cbuf, CHAN_G);
-		if (out[2]->hasoutput)
-			out[2]->data= valbuf_from_rgbabuf(cbuf, CHAN_B);
-		if (out[3]->hasoutput)
-			out[3]->data= valbuf_from_rgbabuf(cbuf, CHAN_A);
-		
-		if (cbuf!=in[0]->data) 
-			free_compbuf(cbuf);
-
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_seprgba(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -88,9 +52,6 @@ void register_node_type_cmp_seprgba(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_SEPRGBA, "Separate RGBA", NODE_CLASS_CONVERTOR, 0);
 	node_type_socket_templates(&ntype, cmp_node_seprgba_in, cmp_node_seprgba_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_seprgba);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -110,51 +71,6 @@ static bNodeSocketTemplate cmp_node_combrgba_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_combrgba(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
-{
-	out[0] = in1[0];
-	out[1] = in2[0];
-	out[2] = in3[0];
-	out[3] = in4[0];
-}
-
-static void node_composit_exec_combrgba(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: 1 rgba channels */
-	/* stack order in: 4 value channels */
-	
-	/* input no image? then only color operation */
-	if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
-		out[0]->vec[0] = in[0]->vec[0];
-		out[0]->vec[1] = in[1]->vec[0];
-		out[0]->vec[2] = in[2]->vec[0];
-		out[0]->vec[3] = in[3]->vec[0];
-	}
-	else {
-		/* make output size of first available input image */
-		CompBuf *cbuf;
-		CompBuf *stackbuf;
-
-		/* allocate a CompBuf the size of the first available input */
-		if (in[0]->data) cbuf = in[0]->data;
-		else if (in[1]->data) cbuf = in[1]->data;
-		else if (in[2]->data) cbuf = in[2]->data;
-		else cbuf = in[3]->data;
-		
-		stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		
-		composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, 
-								  in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, 
-								  do_combrgba, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
-		
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_combrgba(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -162,9 +78,6 @@ void register_node_type_cmp_combrgba(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_COMBRGBA, "Combine RGBA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_combrgba_in, cmp_node_combrgba_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_combrgba);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
index 982d674..a7cc736 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
@@ -46,109 +46,6 @@ static bNodeSocketTemplate cmp_node_sepycca_out[] = {
 	{  -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_sepycca_601(bNode *UNUSED(node), float *out, float *in)
-{
-	float y, cb, cr;
-	
-	rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT601);
-	
-	/*divided by 255 to normalize for viewing in */
-	out[0] =  y/255.0f;
-	out[1] = cb/255.0f;
-	out[2] = cr/255.0f;
-	out[3] = in[3];
-}
-
-static void do_sepycca_709(bNode *UNUSED(node), float *out, float *in)
-{
-	float y, cb, cr;
-	
-	rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT709);
-	
-	/*divided by 255 to normalize for viewing in */
-	out[0] =  y/255.0f;
-	out[1] = cb/255.0f;
-	out[2] = cr/255.0f;
-	out[3] = in[3];
-}
-
-static void do_sepycca_jfif(bNode *UNUSED(node), float *out, float *in)
-{
-	float y, cb, cr;
-	
-	rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_JFIF_0_255);
-	
-	/*divided by 255 to normalize for viewing in */
-	out[0] =  y/255.0f;
-	out[1] = cb/255.0f;
-	out[2] = cr/255.0f;
-	out[3] = in[3];
-}
-
-static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* input no image? then only color operation */
-	if (in[0]->data==NULL) {
-		float y, cb, cr;
-	
-		switch (node->custom1) {
-		case 1:
-			rgb_to_ycc(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &y, &cb, &cr, BLI_YCC_ITU_BT709);
-			break;
-		case 2:
-			rgb_to_ycc(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &y, &cb, &cr, BLI_YCC_JFIF_0_255);
-			break;
-		case 0:
-		default:
-			rgb_to_ycc(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &y, &cb, &cr, BLI_YCC_ITU_BT601);
-			break;
-		}
-	
-		/*divided by 255 to normalize for viewing in */
-		out[0]->vec[0] =  y/255.0f;
-		out[1]->vec[0] = cb/255.0f;
-		out[2]->vec[0] = cr/255.0f;
-		out[3]->vec[0] = in[0]->vec[3];
-	}
-	else if ((out[0]->hasoutput) || (out[1]->hasoutput) || (out[2]->hasoutput) || (out[3]->hasoutput)) {
-		/* make copy of buffer so input buffer doesn't get corrupted */
-		CompBuf *cbuf= dupalloc_compbuf(in[0]->data);
-		CompBuf *cbuf2=typecheck_compbuf(cbuf, CB_RGBA);
-	
-		/* convert the RGB stackbuf to an HSV representation */
-		switch (node->custom1) {
-		case 1:
-			composit1_pixel_processor(node, cbuf2, cbuf2, in[0]->vec, do_sepycca_709, CB_RGBA);
-			break;
-		case 2:
-			composit1_pixel_processor(node, cbuf2, cbuf2, in[0]->vec, do_sepycca_jfif, CB_RGBA);
-			break;
-		case 0:
-		default:
-			composit1_pixel_processor(node, cbuf2, cbuf2, in[0]->vec, do_sepycca_601, CB_RGBA);
-			break;
-		}
-	
-		/* separate each of those channels */
-		if (out[0]->hasoutput)
-			out[0]->data= valbuf_from_rgbabuf(cbuf2, CHAN_R);
-		if (out[1]->hasoutput)
-			out[1]->data= valbuf_from_rgbabuf(cbuf2, CHAN_G);
-		if (out[2]->hasoutput)
-			out[2]->data= valbuf_from_rgbabuf(cbuf2, CHAN_B);
-		if (out[3]->hasoutput)
-			out[3]->data= valbuf_from_rgbabuf(cbuf2, CHAN_A);
-
-		/*not used anymore */
-		if (cbuf2!=cbuf)
-			free_compbuf(cbuf2);
-		free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
 
 void register_node_type_cmp_sepycca(bNodeTreeType *ttype)
 {
@@ -157,9 +54,6 @@ void register_node_type_cmp_sepycca(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_SEPYCCA, "Separate YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_sepycca_in, cmp_node_sepycca_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_sepycca);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -179,128 +73,6 @@ static bNodeSocketTemplate cmp_node_combycca_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_comb_ycca_601(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
-{
-	float r, g, b;
-	float y, cb, cr;
-
-	/*need to un-normalize the data*/
-	y=in1[0]*255;
-	cb=in2[0]*255;
-	cr=in3[0]*255;
-
-	ycc_to_rgb(y, cb, cr, &r, &g, &b, BLI_YCC_ITU_BT601);
-	
-	out[0] = r;
-	out[1] = g;
-	out[2] = b;
-	out[3] = in4[0];
-}
-
-static void do_comb_ycca_709(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
-{
-	float r, g, b;
-	float y, cb, cr;
-
-	/*need to un-normalize the data*/
-	y=in1[0]*255;
-	cb=in2[0]*255;
-	cr=in3[0]*255;
-
-	ycc_to_rgb(y, cb, cr, &r, &g, &b, BLI_YCC_ITU_BT709);
-	
-	out[0] = r;
-	out[1] = g;
-	out[2] = b;
-	out[3] = in4[0];
-}
-
-static void do_comb_ycca_jfif(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
-{
-	float r, g, b;
-	float y, cb, cr;
-
-	/*need to un-normalize the data*/
-	y=in1[0]*255;
-	cb=in2[0]*255;
-	cr=in3[0]*255;
-
-	ycc_to_rgb(y, cb, cr, &r, &g, &b, BLI_YCC_JFIF_0_255);
-	
-	out[0] = r;
-	out[1] = g;
-	out[2] = b;
-	out[3] = in4[0];
-}
-
-static void node_composit_exec_combycca(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: 1 ycca channels */
-	/* stack order in: 4 value channels */
-	
-	/* input no image? then only color operation */
-	if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
-		float y = in[0]->vec[0] * 255;
-		float cb = in[1]->vec[0] * 255;
-		float cr = in[2]->vec[0] * 255;
-		
-		switch (node->custom1) {
-		case 1:
-			ycc_to_rgb(y, cb, cr, &out[0]->vec[0], &out[0]->vec[1], &out[0]->vec[2], BLI_YCC_ITU_BT709);
-			break;
-		case 2:
-			ycc_to_rgb(y, cb, cr, &out[0]->vec[0], &out[0]->vec[1], &out[0]->vec[2], BLI_YCC_JFIF_0_255);
-			break;
-		case 0:
-		default:
-			ycc_to_rgb(y, cb, cr, &out[0]->vec[0], &out[0]->vec[1], &out[0]->vec[2], BLI_YCC_ITU_BT601);
-			break;
-		}
-		
-		out[0]->vec[3] = in[3]->vec[0];
-	}
-	else {
-		/* make output size of first available input image */
-		CompBuf *cbuf;
-		CompBuf *stackbuf;
-
-		/* allocate a CompBuf the size of the first available input */
-		if (in[0]->data) cbuf = in[0]->data;
-		else if (in[1]->data) cbuf = in[1]->data;
-		else if (in[2]->data) cbuf = in[2]->data;
-		else cbuf = in[3]->data;
-		
-		stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		
-		
-		switch (node->custom1) {
-		case 1:
-			composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, 
-			                          in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, 
-			                          do_comb_ycca_709, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
-			break;
-		
-		case 2:
-			composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, 
-			                          in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, 
-			                          do_comb_ycca_jfif, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
-			break;
-		case 0:
-		default:
-			composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, 
-			                          in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, 
-			                          do_comb_ycca_601, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
-			break;
-		}
-
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_combycca(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -308,9 +80,6 @@ void register_node_type_cmp_combycca(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_COMBYCCA, "Combine YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_combycca_in, cmp_node_combycca_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_combycca);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
index 0a95759..88edf7e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
@@ -46,63 +46,6 @@ static bNodeSocketTemplate cmp_node_sepyuva_out[] = {
 	{  -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_sepyuva(bNode *UNUSED(node), float *out, float *in)
-{
-	float y, u, v;
-	
-	rgb_to_yuv(in[0], in[1], in[2], &y, &u, &v);
-	
-	out[0] = y;
-	out[1] = u;
-	out[2] = v;
-	out[3] = in[3];
-}
-
-static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: bw channels */
-	/* stack order in: col */
-	
-	/* input no image? then only color operation */
-	if (in[0]->data==NULL) {
-		float y, u, v;
-	
-		rgb_to_yuv(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &y, &u, &v);
-	
-		out[0]->vec[0] = y;
-		out[1]->vec[0] = u;
-		out[2]->vec[0] = v;
-		out[3]->vec[0] = in[0]->vec[3];
-	}
-	else if ((out[0]->hasoutput) || (out[1]->hasoutput) || (out[2]->hasoutput) || (out[3]->hasoutput)) {
-		/* make copy of buffer so input image doesn't get corrupted */
-		CompBuf *cbuf= dupalloc_compbuf(in[0]->data);
-		CompBuf *cbuf2=typecheck_compbuf(cbuf, CB_RGBA);
-	
-		/* convert the RGB stackbuf to an YUV representation */
-		composit1_pixel_processor(node, cbuf2, cbuf2, in[0]->vec, do_sepyuva, CB_RGBA);
-	
-		/* separate each of those channels */
-		if (out[0]->hasoutput)
-			out[0]->data= valbuf_from_rgbabuf(cbuf2, CHAN_R);
-		if (out[1]->hasoutput)
-			out[1]->data= valbuf_from_rgbabuf(cbuf2, CHAN_G);
-		if (out[2]->hasoutput)
-			out[2]->data= valbuf_from_rgbabuf(cbuf2, CHAN_B);
-		if (out[3]->hasoutput)
-			out[3]->data= valbuf_from_rgbabuf(cbuf2, CHAN_A);
-
-		/*not used anymore */
-		if (cbuf2!=cbuf)
-			free_compbuf(cbuf2);
-		free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 
 void register_node_type_cmp_sepyuva(bNodeTreeType *ttype)
 {
@@ -111,9 +54,6 @@ void register_node_type_cmp_sepyuva(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_SEPYUVA, "Separate YUVA", NODE_CLASS_CONVERTOR, 0);
 	node_type_socket_templates(&ntype, cmp_node_sepyuva_in, cmp_node_sepyuva_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_sepyuva);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -133,54 +73,6 @@ static bNodeSocketTemplate cmp_node_combyuva_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_comb_yuva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
-{
-	float r, g, b;
-	yuv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b);
-	
-	out[0] = r;
-	out[1] = g;
-	out[2] = b;
-	out[3] = in4[0];
-}
-
-static void node_composit_exec_combyuva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: 1 rgba channels */
-	/* stack order in: 4 value channels */
-	
-	/* input no image? then only color operation */
-	if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
-		out[0]->vec[0] = in[0]->vec[0];
-		out[0]->vec[1] = in[1]->vec[0];
-		out[0]->vec[2] = in[2]->vec[0];
-		out[0]->vec[3] = in[3]->vec[0];
-	}
-	else {
-		/* make output size of first available input image */
-		CompBuf *cbuf;
-		CompBuf *stackbuf;
-
-		/* allocate a CompBuf the size of the first available input */
-		if (in[0]->data) cbuf = in[0]->data;
-		else if (in[1]->data) cbuf = in[1]->data;
-		else if (in[2]->data) cbuf = in[2]->data;
-		else cbuf = in[3]->data;
-		
-		stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		
-		composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, 
-								  in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, 
-								  do_comb_yuva, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
-
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_combyuva(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -188,9 +80,6 @@ void register_node_type_cmp_combyuva(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_COMBYUVA, "Combine YUVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_combyuva_in, cmp_node_combyuva_out);
 	node_type_size(&ntype, 80, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_combyuva);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_setalpha.c b/source/blender/nodes/composite/nodes/node_composite_setalpha.c
index 59c1048..0cec19b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_setalpha.c
+++ b/source/blender/nodes/composite/nodes/node_composite_setalpha.c
@@ -43,41 +43,6 @@ static bNodeSocketTemplate cmp_node_setalpha_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_setalpha(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: RGBA image */
-	/* stack order in: col, alpha */
-	
-	/* input no image? then only color operation */
-	if (in[0]->data==NULL && in[1]->data==NULL) {
-		out[0]->vec[0] = in[0]->vec[0];
-		out[0]->vec[1] = in[0]->vec[1];
-		out[0]->vec[2] = in[0]->vec[2];
-		out[0]->vec[3] = in[1]->vec[0];
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf= in[0]->data?in[0]->data:in[1]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		
-		if (in[1]->data==NULL && in[1]->vec[0]==1.0f) {
-			/* pass on image */
-			composit1_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, do_copy_rgb, CB_RGBA);
-		}
-		else {
-			/* send an compbuf or a value to set as alpha - composit2_pixel_processor handles choosing the right one */
-			composit2_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_copy_a_rgba, CB_RGBA, CB_VAL);
-		}
-	
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
-
 void register_node_type_cmp_setalpha(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -85,9 +50,6 @@ void register_node_type_cmp_setalpha(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_SETALPHA, "Set Alpha", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_setalpha_in, cmp_node_setalpha_out);
 	node_type_size(&ntype, 120, 40, 140);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_setalpha);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
index 523f1de..3f4c3d6 100644
--- a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
+++ b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
@@ -39,110 +39,6 @@ static bNodeSocketTemplate cmp_node_splitviewer_in[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_copy_split_rgba(bNode *UNUSED(node), float *out, float *in1, float *in2, float *fac)
-{
-	if (*fac==0.0f) {
-		copy_v4_v4(out, in1);
-	}
-	else {
-		copy_v4_v4(out, in2);
-	}
-}
-
-static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
-{
-	/* image assigned to output */
-	/* stack order input sockets: image image */
-	
-	if (in[0]->data==NULL || in[1]->data==NULL)
-		return;
-	
-	if (node->id && (node->flag & NODE_DO_OUTPUT)) {	/* only one works on out */
-		Image *ima= (Image *)node->id;
-		RenderData *rd= data;
-		ImBuf *ibuf;
-		CompBuf *cbuf, *buf1, *buf2, *mask;
-		int x, y;
-		float offset;
-		void *lock;
-		
-		buf1= typecheck_compbuf(in[0]->data, CB_RGBA);
-		buf2= typecheck_compbuf(in[1]->data, CB_RGBA);
-		
-		BKE_image_user_frame_calc(node->storage, rd->cfra, 0);
-		
-		/* always returns for viewer image, but we check nevertheless */
-		ibuf= BKE_image_acquire_ibuf(ima, node->storage, &lock);
-		if (ibuf==NULL) {
-			printf("node_composit_exec_viewer error\n");
-			BKE_image_release_ibuf(ima, ibuf, lock);
-			return;
-		}
-		
-		/* free all in ibuf */
-		imb_freerectImBuf(ibuf);
-		imb_freerectfloatImBuf(ibuf);
-		IMB_freezbuffloatImBuf(ibuf);
-		
-		/* make ibuf, and connect to ima */
-		ibuf->x= buf1->x;
-		ibuf->y= buf1->y;
-		imb_addrectfloatImBuf(ibuf);
-		
-		ima->ok= IMA_OK_LOADED;
-
-		/* output buf */
-		cbuf= alloc_compbuf(buf1->x, buf1->y, CB_RGBA, 0);	/* no alloc*/
-		cbuf->rect= ibuf->rect_float;
-		
-		/* mask buf */
-		mask= alloc_compbuf(buf1->x, buf1->y, CB_VAL, 1);
-		
-		
-		/* Check which offset mode is selected and limit offset if needed */
-		if (node->custom2 == 0) {
-			offset = buf1->x / 100.0f * node->custom1;
-			CLAMP(offset, 0, buf1->x);
-		}
-		else {
-			offset = buf1->y / 100.0f * node->custom1;
-			CLAMP(offset, 0, buf1->y);
-		}
-		
-		if (node->custom2 == 0) {
-			for (y=0; y<buf1->y; y++) {
-				float *fac= mask->rect + y*buf1->x;
-				for (x=offset; x>0; x--, fac++)
-					*fac= 1.0f;
-			}
-		}
-		else {
-			for (y=0; y<offset; y++) {
-				float *fac= mask->rect + y*buf1->x;
-				for (x=buf1->x; x>0; x--, fac++)
-					*fac= 1.0f;
-			}
-		}
-		
-		composit3_pixel_processor(node, cbuf, buf1, in[0]->vec, buf2, in[1]->vec, mask, NULL, do_copy_split_rgba, CB_RGBA, CB_RGBA, CB_VAL);
-		
-		BKE_image_release_ibuf(ima, ibuf, lock);
-		
-		generate_preview(data, node, cbuf);
-		free_compbuf(cbuf);
-		free_compbuf(mask);
-		
-		if (in[0]->data != buf1) 
-			free_compbuf(buf1);
-		if (in[1]->data != buf2) 
-			free_compbuf(buf2);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user");
@@ -162,9 +58,6 @@ void register_node_type_cmp_splitviewer(bNodeTreeType *ttype)
 	node_type_size(&ntype, 140, 100, 320);
 	node_type_init(&ntype, node_composit_init_splitviewer);
 	node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_splitviewer);
-#endif
 
 	/* Do not allow muting for this node. */
 	node_type_internal_links(&ntype, NULL);
diff --git a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
index 1787e07..964e54e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
+++ b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
@@ -45,32 +45,6 @@ static bNodeSocketTemplate cmp_node_stabilize2d_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_stabilize2d(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (in[0]->data && node->id) {
-		RenderData *rd = data;
-		MovieClip *clip = (MovieClip *)node->id;
-		CompBuf *cbuf = typecheck_compbuf(in[0]->data, CB_RGBA);
-		CompBuf *stackbuf;
-		float loc[2], scale, angle;
-		int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, rd->cfra);
-
-		BKE_tracking_stabilization_data_get(&clip->tracking, clip_framenr, cbuf->x, cbuf->y, loc, &scale, &angle);
-
-		stackbuf = node_composit_transform(cbuf, loc[0], loc[1], angle, scale, node->custom1);
-
-		/* pass on output and free */
-		out[0]->data = stackbuf;
-
-		if (cbuf != in[0]->data)
-			free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_stabilize2d(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -78,9 +52,6 @@ void register_node_type_cmp_stabilize2d(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_stabilize2d_in, cmp_node_stabilize2d_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_stabilize2d);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_texture.c b/source/blender/nodes/composite/nodes/node_composite_texture.c
index b6518c4..17b5720 100644
--- a/source/blender/nodes/composite/nodes/node_composite_texture.c
+++ b/source/blender/nodes/composite/nodes/node_composite_texture.c
@@ -44,108 +44,6 @@ static bNodeSocketTemplate cmp_node_texture_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-/* called without rect allocated */
-static void texture_procedural(CompBuf *cbuf, float *out, float xco, float yco)
-{
-	bNode *node= cbuf->node;
-	TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
-	float vec[3], *size, nor[3] = {0.0f, 0.0f, 0.0f}, col[4];
-	int retval, type= cbuf->procedural_type;
-	
-	size= cbuf->procedural_size;
-	
-	vec[0] = size[0]*(xco + cbuf->procedural_offset[0]);
-	vec[1] = size[1]*(yco + cbuf->procedural_offset[1]);
-	vec[2] = size[2]*cbuf->procedural_offset[2];
-	
-	retval= multitex_ext((Tex *)node->id, vec, NULL, NULL, 0, &texres);
-	
-	if (type==CB_VAL) {
-		if (texres.talpha)
-			col[0] = texres.ta;
-		else
-			col[0] = texres.tin;
-	}
-	else if (type==CB_RGBA) {
-		if (texres.talpha)
-			col[3] = texres.ta;
-		else
-			col[3] = texres.tin;
-		
-		if ((retval & TEX_RGB)) {
-			copy_v3_v3(col, &texres.tr);
-		}
-		else {
-			copy_v3_fl(col, col[3]);
-		}
-	}
-	else {
-		copy_v3_v3(col, nor);
-	}
-	
-	typecheck_compbuf_color(out, col, cbuf->type, cbuf->procedural_type);
-}
-
-/* texture node outputs get a small rect, to make sure all other nodes accept it */
-/* only the pixel-processor nodes do something with it though */
-static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* outputs: value, color, normal */
-	
-	if (node->id) {
-		RenderData *rd= data;
-		short sizex, sizey;
-		
-		/* first make the preview image */
-		CompBuf *prevbuf= alloc_compbuf(140, 140, CB_RGBA, 1); /* alloc */
-
-		prevbuf->rect_procedural= texture_procedural;
-		prevbuf->node= node;
-		copy_v3_v3(prevbuf->procedural_offset, in[0]->vec);
-		copy_v3_v3(prevbuf->procedural_size, in[1]->vec);
-		prevbuf->procedural_type= CB_RGBA;
-		composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
-		
-		generate_preview(data, node, prevbuf);
-		free_compbuf(prevbuf);
-		
-		/* texture procedural buffer type doesnt work well, we now render a buffer in scene size */
-		sizex = (rd->size*rd->xsch)/100;
-		sizey = (rd->size*rd->ysch)/100;
-		
-		if (out[0]->hasoutput) {
-			CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_VAL, 1); /* alloc */
-			
-			stackbuf->rect_procedural= texture_procedural;
-			stackbuf->node= node;
-			copy_v3_v3(stackbuf->procedural_offset, in[0]->vec);
-			copy_v3_v3(stackbuf->procedural_size, in[1]->vec);
-			stackbuf->procedural_type= CB_VAL;
-			composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_value, CB_VAL);
-			stackbuf->rect_procedural= NULL;
-			
-			out[0]->data= stackbuf; 
-		}
-		if (out[1]->hasoutput) {
-			CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_RGBA, 1); /* alloc */
-			
-			stackbuf->rect_procedural= texture_procedural;
-			stackbuf->node= node;
-			copy_v3_v3(stackbuf->procedural_offset, in[0]->vec);
-			copy_v3_v3(stackbuf->procedural_size, in[1]->vec);
-			stackbuf->procedural_type= CB_RGBA;
-			composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
-			stackbuf->rect_procedural= NULL;
-			
-			out[1]->data= stackbuf;
-		}
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_texture(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -153,9 +51,6 @@ void register_node_type_cmp_texture(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
 	node_type_socket_templates(&ntype, cmp_node_texture_in, cmp_node_texture_out);
 	node_type_size(&ntype, 120, 80, 240);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_texture);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_tonemap.c b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
index 00b1a55..9449243 100644
--- a/source/blender/nodes/composite/nodes/node_composite_tonemap.c
+++ b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
@@ -41,114 +41,6 @@ static bNodeSocketTemplate cmp_node_tonemap_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static float avgLogLum(CompBuf *src, float* auto_key, float* Lav, float* Cav)
-{
-	float lsum = 0;
-	int p = src->x*src->y;
-	fRGB* bc = (fRGB*)src->rect;
-	float avl, maxl = -1e10f, minl = 1e10f;
-	const float sc = 1.f/(src->x*src->y);
-	*Lav = 0.f;
-	while (p--) {
-		float L = rgb_to_luma_y(bc[0]);
-		*Lav += L;
-		add_v3_v3(Cav, bc[0]);
-		lsum += (float)log((double)MAX2(L, 0.0) + 1e-5);
-		maxl = (L > maxl) ? L : maxl;
-		minl = (L < minl) ? L : minl;
-		bc++;
-	}
-	*Lav *= sc;
-	mul_v3_fl(Cav, sc);
-	maxl = log((double)maxl + 1e-5); minl = log((double)minl + 1e-5f); avl = lsum*sc;
-	*auto_key = (maxl > minl) ? ((maxl - avl) / (maxl - minl)) : 1.f;
-	return exp((double)avl);
-}
-
-
-static void tonemap(NodeTonemap* ntm, CompBuf* dst, CompBuf* src)
-{
-	int x, y;
-	float dr, dg, db, al, igm = (ntm->gamma==0.f) ? 1 : (1.f / ntm->gamma);
-	float auto_key, Lav, Cav[3] = {0, 0, 0};
-
-	al = avgLogLum(src, &auto_key, &Lav, Cav);
-	al = (al == 0.f) ? 0.f : (ntm->key / al);
-
-	if (ntm->type == 1) {
-		// Reinhard/Devlin photoreceptor
-		const float f = exp((double)-ntm->f);
-		const float m = (ntm->m > 0.f) ? ntm->m : (0.3f + 0.7f*pow((double)auto_key, 1.4));
-		const float ic = 1.f - ntm->c, ia = 1.f - ntm->a;
-		if (ntm->m == 0.f) printf("tonemap node, M: %g\n", m); 
-		for (y=0; y<src->y; ++y) {
-			fRGB* sp = (fRGB*)&src->rect[y*src->x*src->type];
-			fRGB* dp = (fRGB*)&dst->rect[y*src->x*src->type];
-			for (x=0; x<src->x; ++x) {
-				const float L = rgb_to_luma_y(sp[x]);
-				float I_l = sp[x][0] + ic*(L - sp[x][0]);
-				float I_g = Cav[0] + ic*(Lav - Cav[0]);
-				float I_a = I_l + ia*(I_g - I_l);
-				dp[x][0] /= (dp[x][0] + pow((double)f*I_a, (double)m));
-				I_l = sp[x][1] + ic*(L - sp[x][1]);
-				I_g = Cav[1] + ic*(Lav - Cav[1]);
-				I_a = I_l + ia*(I_g - I_l);
-				dp[x][1] /= (dp[x][1] + pow((double)f*I_a, (double)m));
-				I_l = sp[x][2] + ic*(L - sp[x][2]);
-				I_g = Cav[2] + ic*(Lav - Cav[2]);
-				I_a = I_l + ia*(I_g - I_l);
-				dp[x][2] /= (dp[x][2] + pow((double)f*I_a, (double)m));
-			}
-		}
-		return;
-	}
-
-	// Reinhard simple photographic tm (simplest, not using whitepoint var)
-	for (y=0; y<src->y; y++) {
-		fRGB* sp = (fRGB*)&src->rect[y*src->x*src->type];
-		fRGB* dp = (fRGB*)&dst->rect[y*src->x*src->type];
-		for (x=0; x<src->x; x++) {
-			copy_v4_v4(dp[x], sp[x]);
-			mul_v3_fl(dp[x], al);
-			dr = dp[x][0] + ntm->offset;
-			dg = dp[x][1] + ntm->offset;
-			db = dp[x][2] + ntm->offset;
-			dp[x][0] /= ((dr == 0.f) ? 1.f : dr);
-			dp[x][1] /= ((dg == 0.f) ? 1.f : dg);
-			dp[x][2] /= ((db == 0.f) ? 1.f : db);
-			if (igm != 0.f) {
-				dp[x][0] = pow((double)MAX2(dp[x][0], 0.0), igm);
-				dp[x][1] = pow((double)MAX2(dp[x][1], 0.0), igm);
-				dp[x][2] = pow((double)MAX2(dp[x][2], 0.0), igm);
-			}
-		}
-	}
-}
-
-
-static void node_composit_exec_tonemap(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	CompBuf *new, *img = in[0]->data;
-
-	if ((img==NULL) || (out[0]->hasoutput==0)) return;
-
-	if (img->type != CB_RGBA)
-		img = typecheck_compbuf(img, CB_RGBA);
-	
-	new = dupalloc_compbuf(img);
-
-	tonemap(node->storage, new, img);
-
-	out[0]->data = new;
-	
-	if (img!=in[0]->data)
-		free_compbuf(img);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_tonemap(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeTonemap *ntm = MEM_callocN(sizeof(NodeTonemap), "node tonemap data");
@@ -174,9 +66,6 @@ void register_node_type_cmp_tonemap(bNodeTreeType *ttype)
 	node_type_size(&ntype, 150, 120, 200);
 	node_type_init(&ntype, node_composit_init_tonemap);
 	node_type_storage(&ntype, "NodeTonemap", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_tonemap);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_trackpos.c b/source/blender/nodes/composite/nodes/node_composite_trackpos.c
index 4364ca6..41dc563 100644
--- a/source/blender/nodes/composite/nodes/node_composite_trackpos.c
+++ b/source/blender/nodes/composite/nodes/node_composite_trackpos.c
@@ -39,15 +39,6 @@ static bNodeSocketTemplate cmp_node_trackpos_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_trackpos(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
-{
-	/* pass */
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeTrackPosData *data = MEM_callocN(sizeof(NodeTrackPosData), "node track position data");
@@ -64,9 +55,6 @@ void register_node_type_cmp_trackpos(bNodeTreeType *ttype)
 	node_type_size(&ntype, 120, 80, 300);
 	node_type_init(&ntype, init);
 	node_type_storage(&ntype, "NodeTrackPosData", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_trackpos);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_transform.c b/source/blender/nodes/composite/nodes/node_composite_transform.c
index d6bb545..f51e493 100644
--- a/source/blender/nodes/composite/nodes/node_composite_transform.c
+++ b/source/blender/nodes/composite/nodes/node_composite_transform.c
@@ -48,89 +48,6 @@ static bNodeSocketTemplate cmp_node_transform_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-CompBuf* node_composit_transform(CompBuf *cbuf, float x, float y, float angle, float scale, int filter_type)
-{
-	CompBuf *stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, TRUE);
-	ImBuf *ibuf, *obuf;
-	float mat[4][4], lmat[4][4], rmat[4][4], smat[4][4], cmat[4][4], icmat[4][4];
-	float svec[3] = {scale, scale, scale}, loc[2] = {x, y};
-
-	unit_m4(rmat);
-	unit_m4(lmat);
-	unit_m4(smat);
-	unit_m4(cmat);
-
-	/* image center as rotation center */
-	cmat[3][0] = (float)cbuf->x/2.0f;
-	cmat[3][1] = (float)cbuf->y/2.0f;
-	invert_m4_m4(icmat, cmat);
-
-	size_to_mat4(smat, svec);		/* scale matrix */
-	add_v2_v2(lmat[3], loc);		/* tranlation matrix */
-	rotate_m4(rmat, 'Z', angle);	/* rotation matrix */
-
-	/* compose transformation matrix */
-	mul_serie_m4(mat, lmat, cmat, rmat, smat, icmat, NULL, NULL, NULL);
-
-	invert_m4(mat);
-
-	ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
-	obuf = IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0);
-
-	if (ibuf && obuf) {
-		int i, j;
-
-		ibuf->rect_float = cbuf->rect;
-		obuf->rect_float = stackbuf->rect;
-
-		for (j = 0; j < cbuf->y; j++) {
-			for (i = 0; i < cbuf->x; i++) {
-				float vec[3] = {i, j, 0};
-
-				mul_v3_m4v3(vec, mat, vec);
-
-				switch (filter_type) {
-					case 0:
-						nearest_interpolation(ibuf, obuf, vec[0], vec[1], i, j);
-						break;
-					case 1:
-						bilinear_interpolation(ibuf, obuf, vec[0], vec[1], i, j);
-						break;
-					case 2:
-						bicubic_interpolation(ibuf, obuf, vec[0], vec[1], i, j);
-						break;
-				}
-			}
-		}
-
-		IMB_freeImBuf(ibuf);
-		IMB_freeImBuf(obuf);
-	}
-
-	/* pass on output and free */
-	return stackbuf;
-}
-
-static void node_composit_exec_transform(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	if (in[0]->data) {
-		CompBuf *cbuf = typecheck_compbuf(in[0]->data, CB_RGBA);
-		CompBuf *stackbuf;
-
-		stackbuf = node_composit_transform(cbuf, in[1]->vec[0], in[2]->vec[0], in[3]->vec[0], in[4]->vec[0], node->custom1);
-
-		/* pass on output and free */
-		out[0]->data = stackbuf;
-
-		if (cbuf != in[0]->data)
-			free_compbuf(cbuf);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_transform(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -138,9 +55,6 @@ void register_node_type_cmp_transform(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_TRANSFORM, "Transform", NODE_CLASS_DISTORT, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_transform_in, cmp_node_transform_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_transform);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_translate.c b/source/blender/nodes/composite/nodes/node_composite_translate.c
index 1c2963a..60b3256 100644
--- a/source/blender/nodes/composite/nodes/node_composite_translate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_translate.c
@@ -46,23 +46,12 @@ static bNodeSocketTemplate cmp_node_translate_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_translate(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out)
+static void node_composit_init_translate(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
-	if (in[0]->data) {
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf= pass_on_compbuf(cbuf);
-	
-		stackbuf->xof+= (int)floor(in[1]->vec[0]);
-		stackbuf->yof+= (int)floor(in[2]->vec[0]);
-		
-		out[0]->data= stackbuf;
-	}
+	NodeTranslateData *data = MEM_callocN(sizeof(NodeTranslateData), "node translate data");
+	node->storage = data;
 }
 
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_translate(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -70,9 +59,8 @@ void register_node_type_cmp_translate(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_translate_in, cmp_node_translate_out);
 	node_type_size(&ntype, 140, 100, 320);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_translate);
-#endif
+	node_type_init(&ntype, node_composit_init_translate);
+	node_type_storage(&ntype, "NodeTranslateData", node_free_standard_storage, node_copy_standard_storage);
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
index 5c11199..c40880c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
@@ -44,44 +44,6 @@ static bNodeSocketTemplate cmp_node_valtorgb_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_colorband_composit(bNode *node, float *out, float *in)
-{
-	do_colorband(node->storage, in[0], out);
-}
-
-static void node_composit_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order in: fac */
-	/* stack order out: col, alpha */
-	
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) 
-		return;
-	
-	if (node->storage) {
-		/* input no image? then only color operation */
-		if (in[0]->data==NULL) {
-			do_colorband(node->storage, in[0]->vec[0], out[0]->vec);
-		}
-		else {
-			/* make output size of input image */
-			CompBuf *cbuf= in[0]->data;
-			CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-			
-			composit1_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, do_colorband_composit, CB_VAL);
-			
-			out[0]->data= stackbuf;
-			
-			if (out[1]->hasoutput)
-				out[1]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
-
-		}
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_valtorgb(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	node->storage= add_colorband(1);
@@ -96,9 +58,6 @@ void register_node_type_cmp_valtorgb(bNodeTreeType *ttype)
 	node_type_size(&ntype, 240, 200, 300);
 	node_type_init(&ntype, node_composit_init_valtorgb);
 	node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_valtorgb);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
@@ -115,38 +74,6 @@ static bNodeSocketTemplate cmp_node_rgbtobw_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_rgbtobw(bNode *UNUSED(node), float *out, float *in)
-{
-	out[0] = rgb_to_bw(in);
-}
-
-static void node_composit_exec_rgbtobw(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	/* stack order out: bw */
-	/* stack order in: col */
-	
-	if (out[0]->hasoutput==0)
-		return;
-	
-	/* input no image? then only color operation */
-	if (in[0]->data==NULL) {
-		do_rgbtobw(node, out[0]->vec, in[0]->vec);
-	}
-	else {
-		/* make output size of input image */
-		CompBuf *cbuf= in[0]->data;
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */
-		
-		composit1_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, do_rgbtobw, CB_RGBA);
-		
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_rgbtobw(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -154,9 +81,6 @@ void register_node_type_cmp_rgbtobw(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
 	node_type_socket_templates(&ntype, cmp_node_rgbtobw_in, cmp_node_rgbtobw_out);
 	node_type_size(&ntype, 80, 40, 120);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_rgbtobw);
-#endif
 	
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_value.c b/source/blender/nodes/composite/nodes/node_composite_value.c
index 2c65fe6..05e79ef 100644
--- a/source/blender/nodes/composite/nodes/node_composite_value.c
+++ b/source/blender/nodes/composite/nodes/node_composite_value.c
@@ -49,18 +49,6 @@ static void node_composit_init_value(bNodeTree *UNUSED(ntree), bNode *node, bNod
 	dval->max = FLT_MAX;
 }
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_value(void *UNUSED(data), bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
-{
-	bNodeSocket *sock= node->outputs.first;
-	float val= ((bNodeSocketValueFloat*)sock->default_value)->value;
-	
-	out[0]->vec[0] = val;
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_value(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -69,9 +57,6 @@ void register_node_type_cmp_value(bNodeTreeType *ttype)
 	node_type_socket_templates(&ntype, NULL, cmp_node_value_out);
 	node_type_init(&ntype, node_composit_init_value);
 	node_type_size(&ntype, 80, 40, 120);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_value);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_vecBlur.c b/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
index 62c2c02..ff4fe8d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
@@ -45,48 +45,6 @@ static bNodeSocketTemplate cmp_node_vecblur_out[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_vecblur(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	NodeBlurData *nbd = node->storage;
-	CompBuf *new, *img = in[0]->data, *vecbuf = in[2]->data, *zbuf = in[1]->data;
-	
-	if (img == NULL || vecbuf == NULL || zbuf == NULL || out[0]->hasoutput == 0)
-		return;
-	if (vecbuf->x != img->x || vecbuf->y != img->y) {
-		printf("ERROR: cannot do different sized vecbuf yet\n");
-		return;
-	}
-	if (vecbuf->type != CB_VEC4) {
-		printf("ERROR: input should be vecbuf\n");
-		return;
-	}
-	if (zbuf->type != CB_VAL) {
-		printf("ERROR: input should be zbuf\n");
-		return;
-	}
-	if (zbuf->x != img->x || zbuf->y != img->y) {
-		printf("ERROR: cannot do different sized zbuf yet\n");
-		return;
-	}
-	
-	/* allow the input image to be of another type */
-	img = typecheck_compbuf(in[0]->data, CB_RGBA);
-
-	new = dupalloc_compbuf(img);
-	
-	/* call special zbuffer version */
-	RE_zbuf_accumulate_vecblur(nbd, img->x, img->y, new->rect, img->rect, vecbuf->rect, zbuf->rect);
-	
-	out[0]->data = new;
-	
-	if (img != in[0]->data)
-		free_compbuf(img);
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_vecblur(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	NodeBlurData *nbd = MEM_callocN(sizeof(NodeBlurData), "node blur data");
@@ -105,9 +63,6 @@ void register_node_type_cmp_vecblur(bNodeTreeType *ttype)
 	node_type_size(&ntype, 120, 80, 200);
 	node_type_init(&ntype, node_composit_init_vecblur);
 	node_type_storage(&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_vecblur);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.c b/source/blender/nodes/composite/nodes/node_composite_viewer.c
index 1c27cc2..233a062 100644
--- a/source/blender/nodes/composite/nodes/node_composite_viewer.c
+++ b/source/blender/nodes/composite/nodes/node_composite_viewer.c
@@ -41,90 +41,6 @@ static bNodeSocketTemplate cmp_node_viewer_in[] = {
 	{   -1, 0, ""   }
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
-{
-	/* image assigned to output */
-	/* stack order input sockets: col, alpha, z */
-	
-	if (node->id && (node->flag & NODE_DO_OUTPUT)) {  /* only one works on out */
-		RenderData *rd = data;
-		Image *ima = (Image *)node->id;
-		ImBuf *ibuf;
-		CompBuf *cbuf, *tbuf;
-		int rectx, recty;
-		void *lock;
-		
-		BKE_image_user_frame_calc(node->storage, rd->cfra, 0);
-
-		/* always returns for viewer image, but we check nevertheless */
-		ibuf = BKE_image_acquire_ibuf(ima, node->storage, &lock);
-		if (ibuf == NULL) {
-			printf("node_composit_exec_viewer error\n");
-			BKE_image_release_ibuf(ima, ibuf, lock);
-			return;
-		}
-		
-		/* free all in ibuf */
-		imb_freerectImBuf(ibuf);
-		imb_freerectfloatImBuf(ibuf);
-		IMB_freezbuffloatImBuf(ibuf);
-		
-		/* get size */
-		tbuf = in[0]->data ? in[0]->data : (in[1]->data ? in[1]->data : in[2]->data);
-		if (tbuf == NULL) {
-			rectx = 320; recty = 256;
-		}
-		else {
-			rectx = tbuf->x;
-			recty = tbuf->y;
-		}
-		
-		/* make ibuf, and connect to ima */
-		ibuf->x = rectx;
-		ibuf->y = recty;
-		imb_addrectfloatImBuf(ibuf);
-		
-		ima->ok = IMA_OK_LOADED;
-
-		/* now we combine the input with ibuf */
-		cbuf = alloc_compbuf(rectx, recty, CB_RGBA, 0);  /* no alloc*/
-		cbuf->rect = ibuf->rect_float;
-		
-		/* when no alpha, we can simply copy */
-		if (in[1]->data == NULL) {
-			composit1_pixel_processor(node, cbuf, in[0]->data, in[0]->vec, do_copy_rgba, CB_RGBA);
-		}
-		else
-			composit2_pixel_processor(node, cbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_copy_a_rgba, CB_RGBA, CB_VAL);
-		
-		/* zbuf option */
-		if (in[2]->data) {
-			CompBuf *zbuf = alloc_compbuf(rectx, recty, CB_VAL, 1);
-			ibuf->zbuf_float = zbuf->rect;
-			ibuf->mall |= IB_zbuffloat;
-			
-			composit1_pixel_processor(node, zbuf, in[2]->data, in[2]->vec, do_copy_value, CB_VAL);
-			
-			/* free compbuf, but not the rect */
-			zbuf->malloc = 0;
-			free_compbuf(zbuf);
-		}
-
-		BKE_image_release_ibuf(ima, ibuf, lock);
-
-		generate_preview(data, node, cbuf);
-		free_compbuf(cbuf);
-
-	}
-	else if (in[0]->data) {
-		generate_preview(data, node, in[0]->data);
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 static void node_composit_init_viewer(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
 	ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user");
@@ -140,14 +56,11 @@ void register_node_type_cmp_viewer(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
 
-	node_type_base(ttype, &ntype, CMP_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW);
+	node_type_base(ttype, &ntype, CMP_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_OPTIONS | NODE_PREVIEW);
 	node_type_socket_templates(&ntype, cmp_node_viewer_in, NULL);
 	node_type_size(&ntype, 80, 60, 200);
 	node_type_init(&ntype, node_composit_init_viewer);
 	node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_viewer);
-#endif
 
 	node_type_internal_links(&ntype, NULL);
 
diff --git a/source/blender/nodes/composite/nodes/node_composite_zcombine.c b/source/blender/nodes/composite/nodes/node_composite_zcombine.c
index 8e639aa..89d0ccc 100644
--- a/source/blender/nodes/composite/nodes/node_composite_zcombine.c
+++ b/source/blender/nodes/composite/nodes/node_composite_zcombine.c
@@ -48,183 +48,6 @@ static bNodeSocketTemplate cmp_node_zcombine_out[] = {
 	{	-1, 0, ""	}
 };
 
-#ifdef WITH_COMPOSITOR_LEGACY
-
-static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float *src2, float *z2)
-{
-	float alpha;
-	float malpha;
-	
-	if (*z1 <= *z2) {
-		if (node->custom1) {
-			// use alpha in combine operation
-			alpha= src1[3];
-			malpha= 1.0f - alpha;
-			out[0] = malpha*src2[0] + alpha*src1[0];
-			out[1] = malpha*src2[1] + alpha*src1[1];
-			out[2] = malpha*src2[2] + alpha*src1[2];
-			out[3] = malpha*src2[3] + alpha*src1[3];
-		}
-		else {
-			// do combination based solely on z value
-			copy_v4_v4(out, src1);
-		}
-	}
-	else {
-		if (node->custom1) {
-			// use alpha in combine operation
-			alpha= src2[3];
-			malpha= 1.0f - alpha;
-			out[0] = malpha*src1[0] + alpha*src2[0];
-			out[1] = malpha*src1[1] + alpha*src2[1];
-			out[2] = malpha*src1[2] + alpha*src2[2];
-			out[3] = malpha*src1[3] + alpha*src2[3];
-		}
-		else {
-			// do combination based solely on z value
-			copy_v4_v4(out, src1);
-		}
-		
-		if (node->custom2)
-			*z1= *z2;
-	}
-}
-
-static void do_zcombine_mask(bNode *node, float *out, float *z1, float *z2)
-{
-	if (*z1 > *z2) {
-		*out= 1.0f;
-		if (node->custom2)
-			*z1= *z2;
-	}
-}
-
-static void do_zcombine_add(bNode *node, float *out, float *col1, float *col2, float *acol)
-{
-	float alpha;
-	float malpha;
-
-	if (node->custom1) {
-		// use alpha in combine operation, antialiased mask in used here just as hint for the z value
-		if (*acol>0.0f) {
-			alpha= col2[3];
-			malpha= 1.0f - alpha;
-		
-		
-			out[0] = malpha*col1[0] + alpha*col2[0];
-			out[1] = malpha*col1[1] + alpha*col2[1];
-			out[2] = malpha*col1[2] + alpha*col2[2];
-			out[3] = malpha*col1[3] + alpha*col2[3];
-		}
-		else {
-			alpha= col1[3];
-			malpha= 1.0f - alpha;
-		
-		
-			out[0] = malpha*col2[0] + alpha*col1[0];
-			out[1] = malpha*col2[1] + alpha*col1[1];
-			out[2] = malpha*col2[2] + alpha*col1[2];
-			out[3] = malpha*col2[3] + alpha*col1[3];
-		}
-	}
-	else {
-		// do combination based solely on z value but with antialiased mask
-		alpha = *acol;
-		malpha= 1.0f - alpha;
-		
-		out[0] = malpha*col1[0] + alpha*col2[0];
-		out[1] = malpha*col1[1] + alpha*col2[1];
-		out[2] = malpha*col1[2] + alpha*col2[2];
-		out[3] = malpha*col1[3] + alpha*col2[3];
-	}
-}
-
-static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
-	RenderData *rd= data;
-	CompBuf *cbuf= in[0]->data;
-	CompBuf *zbuf;
-
-	/* stack order in: col z col z */
-	/* stack order out: col z */
-	if (out[0]->hasoutput==0 && out[1]->hasoutput==0) 
-		return;
-	
-	/* no input image; do nothing now */
-	if (in[0]->data==NULL) {
-		return;
-	}
-	
-	if (out[1]->hasoutput) {
-		/* copy or make a buffer for for the first z value, here we write result in */
-		if (in[1]->data)
-			zbuf= dupalloc_compbuf(in[1]->data);
-		else {
-			float *zval;
-			int tot= cbuf->x*cbuf->y;
-			
-			zbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
-			for (zval= zbuf->rect; tot; tot--, zval++)
-				*zval= in[1]->vec[0];
-		}
-		/* lazy coder hack */
-		node->custom2= 1;
-		out[1]->data= zbuf;
-	}
-	else {
-		node->custom2= 0;
-		zbuf= in[1]->data;
-	}
-	
-	if (rd->scemode & R_FULL_SAMPLE) {
-		/* make output size of first input image */
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs
-		
-		composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, zbuf, in[1]->vec, in[2]->data, in[2]->vec, 
-								  in[3]->data, in[3]->vec, do_zcombine, CB_RGBA, CB_VAL, CB_RGBA, CB_VAL);
-		
-		out[0]->data= stackbuf;
-	}
-	else {
-		/* make output size of first input image */
-		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		CompBuf *mbuf;
-		float *fp;
-		int x;
-		char *aabuf;
-		
-		
-		/* make a mask based on comparison, optionally write zvalue */
-		mbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
-		composit2_pixel_processor(node, mbuf, zbuf, in[1]->vec, in[3]->data, in[3]->vec, do_zcombine_mask, CB_VAL, CB_VAL);
-		
-		/* convert to char */
-		aabuf= MEM_mallocN(cbuf->x*cbuf->y, "aa buf");
-		fp= mbuf->rect;
-		for (x= cbuf->x*cbuf->y-1; x>=0; x--)
-			if (fp[x]==0.0f) aabuf[x] = 0;
-			else aabuf[x] = 255;
-		
-		antialias_tagbuf(cbuf->x, cbuf->y, aabuf);
-		
-		/* convert to float */
-		fp= mbuf->rect;
-		for (x= cbuf->x*cbuf->y-1; x>=0; x--)
-			if (aabuf[x]>1)
-				fp[x] = (1.0f/255.0f)*(float)aabuf[x];
-		
-		composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[2]->data, in[2]->vec, mbuf, NULL, 
-								  do_zcombine_add, CB_RGBA, CB_RGBA, CB_VAL);
-		/* free */
-		free_compbuf(mbuf);
-		MEM_freeN(aabuf);
-		
-		out[0]->data= stackbuf;
-	}
-}
-
-#endif  /* WITH_COMPOSITOR_LEGACY */
-
 void register_node_type_cmp_zcombine(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -232,9 +55,6 @@ void register_node_type_cmp_zcombine(bNodeTreeType *ttype)
 	node_type_base(ttype, &ntype, CMP_NODE_ZCOMBINE, "Z Combine", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
 	node_type_socket_templates(&ntype, cmp_node_zcombine_in, cmp_node_zcombine_out);
 	node_type_size(&ntype, 80, 40, 120);
-#ifdef WITH_COMPOSITOR_LEGACY
-	node_type_exec(&ntype, node_composit_exec_zcombine);
-#endif
 
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index dc8d427..d59061d 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -197,7 +197,7 @@ void node_group_remove_socket(bNodeTree *ngroup, bNodeSocket *gsock, int in_out)
 /* groups display their internal tree name as label */
 const char *node_group_label(bNode *node)
 {
-	return (node->id)? node->id->name+2: IFACE_("Missing Datablock");
+	return (node->id)? node->id->name + 2: IFACE_("Missing Datablock");
 }
 
 int node_group_valid(bNodeTree *ntree, bNodeTemplate *ntemp)
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index 86f8f4d..7a8b8c9 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -258,7 +258,7 @@ void ntree_exec_end(bNodeTreeExec *exec)
 	MEM_freeN(exec);
 }
 
-/**** Compositor/Material/Texture trees ****/
+/**** Material/Texture trees ****/
 
 bNodeThreadStack *ntreeGetThreadStack(bNodeTreeExec *exec, int thread)
 {
@@ -287,33 +287,7 @@ void ntreeReleaseThreadStack(bNodeThreadStack *nts)
 	nts->used = 0;
 }
 
-void ntreeExecNodes(bNodeTreeExec *exec, void *callerdata, int thread)
-{
-	bNodeStack *nsin[MAX_SOCKET];	/* arbitrary... watch this */
-	bNodeStack *nsout[MAX_SOCKET];	/* arbitrary... watch this */
-	bNodeExec *nodeexec;
-	bNode *node;
-	int n;
-	
-	/* nodes are presorted, so exec is in order of list */
-	
-	for (n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
-		node = nodeexec->node;
-		if (node->need_exec) {
-			node_get_stack(node, exec->stack, nsin, nsout);
-			/* Handle muted nodes...
-			 * If the mute func is not set, assume the node should never be muted,
-			 * and hence execute it!
-			 */
-			if (node->typeinfo->execfunc)
-				node->typeinfo->execfunc(callerdata, node, nsin, nsout);
-			else if (node->typeinfo->newexecfunc)
-				node->typeinfo->newexecfunc(callerdata, thread, node, nodeexec->data, nsin, nsout);
-		}
-	}
-}
-
-void ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *callerdata, int thread)
+bool ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *callerdata, int thread)
 {
 	bNodeStack *nsin[MAX_SOCKET];	/* arbitrary... watch this */
 	bNodeStack *nsout[MAX_SOCKET];	/* arbitrary... watch this */
@@ -331,10 +305,15 @@ void ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *call
 			 * If the mute func is not set, assume the node should never be muted,
 			 * and hence execute it!
 			 */
+//			if (node->typeinfo->compatibility == NODE_NEW_SHADING)
+//				return false;
 			if (node->typeinfo->execfunc)
 				node->typeinfo->execfunc(callerdata, node, nsin, nsout);
 			else if (node->typeinfo->newexecfunc)
 				node->typeinfo->newexecfunc(callerdata, thread, node, nodeexec->data, nsin, nsout);
 		}
 	}
+	
+	/* signal to that all went OK, for render */
+	return true;
 }
diff --git a/source/blender/nodes/intern/node_exec.h b/source/blender/nodes/intern/node_exec.h
index e985795..5febda0 100644
--- a/source/blender/nodes/intern/node_exec.h
+++ b/source/blender/nodes/intern/node_exec.h
@@ -77,10 +77,8 @@ void node_get_stack(struct bNode *node, struct bNodeStack *stack, struct bNodeSt
 struct bNodeTreeExec *ntree_exec_begin(struct bNodeTree *ntree);
 void ntree_exec_end(struct bNodeTreeExec *exec);
 
-void ntreeExecNodes(struct bNodeTreeExec *exec, void *callerdata, int thread);
-
 struct bNodeThreadStack *ntreeGetThreadStack(struct bNodeTreeExec *exec, int thread);
 void ntreeReleaseThreadStack(struct bNodeThreadStack *nts);
-void ntreeExecThreadNodes(struct bNodeTreeExec *exec, struct bNodeThreadStack *nts, void *callerdata, int thread);
+bool ntreeExecThreadNodes(struct bNodeTreeExec *exec, struct bNodeThreadStack *nts, void *callerdata, int thread);
 
 #endif
diff --git a/source/blender/nodes/intern/node_util.h b/source/blender/nodes/intern/node_util.h
index 3134baa..6b78391 100644
--- a/source/blender/nodes/intern/node_util.h
+++ b/source/blender/nodes/intern/node_util.h
@@ -65,13 +65,3 @@ const char *node_filter_label(struct bNode *node);
 void node_update_internal_links_default(struct bNodeTree *ntree, struct bNode *node);
 
 #endif
-
-// this is needed for inlining behavior
-#if defined _MSC_VER
-#   define DO_INLINE __inline
-#elif defined (__sun) || defined (__sun__)
-#   define DO_INLINE
-#else
-#   define DO_INLINE static inline
-#endif
-
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index b7dc83d..8fde0b9 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -248,7 +248,8 @@ void ntreeShaderEndExecTree(bNodeTreeExec *exec, int use_tree_data)
 	}
 }
 
-void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
+/* only for Blender internal */
+bool ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
 {
 	ShaderCallData scd;
 	/**
@@ -258,6 +259,7 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
 	Material *mat = shi->mat;
 	bNodeThreadStack *nts = NULL;
 	bNodeTreeExec *exec = ntree->execdata;
+	int compat;
 	
 	/* convert caller data to struct */
 	scd.shi = shi;
@@ -277,13 +279,17 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
 	}
 	
 	nts = ntreeGetThreadStack(exec, shi->thread);
-	ntreeExecThreadNodes(exec, nts, &scd, shi->thread);
+	compat = ntreeExecThreadNodes(exec, nts, &scd, shi->thread);
 	ntreeReleaseThreadStack(nts);
 	
 	// \note: set material back to preserved material
 	shi->mat = mat;
+		
 	/* better not allow negative for now */
 	if (shr->combined[0] < 0.0f) shr->combined[0] = 0.0f;
 	if (shr->combined[1] < 0.0f) shr->combined[1] = 0.0f;
 	if (shr->combined[2] < 0.0f) shr->combined[2] = 0.0f;
+	
+	/* if compat is zero, it has been using non-compatible nodes */
+	return compat;
 }
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index 544ccb8..1123a0d 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -46,7 +46,7 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
 		if (ns->sockettype==SOCK_FLOAT)
 			*in= *from;
 		else 
-			*in= 0.333333f*(from[0]+from[1]+from[2]);
+			*in= (from[0]+from[1]+from[2]) / 3.0f;
 	}
 	else if (type_in==SOCK_VECTOR) {
 		if (ns->sockettype==SOCK_FLOAT) {
@@ -221,6 +221,7 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns)
 
 void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs)
 {
+	copy_v4_v4(ns->vec, gs->vec);
 	ns->data= gs->link;
 	ns->sockettype= gs->sockettype;
 }
@@ -276,7 +277,7 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs)
 	bNodeStack *stack;
 	bNodeStack *nsin[MAX_SOCKET];	/* arbitrary... watch this */
 	bNodeStack *nsout[MAX_SOCKET];	/* arbitrary... watch this */
-	GPUNodeStack gpuin[MAX_SOCKET+1], gpuout[MAX_SOCKET+1];
+	GPUNodeStack gpuin[MAX_SOCKET + 1], gpuout[MAX_SOCKET + 1];
 	int do_it;
 
 	stack= exec->stack;
diff --git a/source/blender/nodes/shader/node_shader_util.h b/source/blender/nodes/shader/node_shader_util.h
index e4dc74e..9c91150 100644
--- a/source/blender/nodes/shader/node_shader_util.h
+++ b/source/blender/nodes/shader/node_shader_util.h
@@ -49,6 +49,12 @@
 #include "DNA_scene_types.h"
 #include "DNA_texture_types.h"
 
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_rand.h"
+#include "BLI_threads.h"
+#include "BLI_utildefines.h"
+
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 #include "BKE_global.h"
@@ -63,12 +69,6 @@
 #include "NOD_shader.h"
 #include "node_util.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_threads.h"
-#include "BLI_utildefines.h"
-
 #include "BLF_translation.h"
 
 #include "IMB_imbuf_types.h"
diff --git a/source/blender/nodes/shader/nodes/node_shader_brightness.c b/source/blender/nodes/shader/nodes/node_shader_brightness.c
index 9c23a29..fa77fce 100644
--- a/source/blender/nodes/shader/nodes/node_shader_brightness.c
+++ b/source/blender/nodes/shader/nodes/node_shader_brightness.c
@@ -43,6 +43,11 @@ static bNodeSocketTemplate sh_node_brightcontrast_out[] = {
 	{	-1, 0, ""	}
 };
 
+static int gpu_shader_brightcontrast(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
+{
+	return GPU_stack_link(mat, "brightness_contrast", in, out);
+}
+
 void register_node_type_sh_brightcontrast(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
@@ -54,7 +59,7 @@ void register_node_type_sh_brightcontrast(bNodeTreeType *ttype)
 	node_type_init(&ntype, NULL);
 	node_type_storage(&ntype, "", NULL, NULL);
 	node_type_exec(&ntype, NULL);
-	node_type_gpu(&ntype, NULL);
+	node_type_gpu(&ntype, gpu_shader_brightcontrast);
 	
 	nodeRegisterType(ttype, &ntype);
 }
diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c
index cf6f778..9c78470 100644
--- a/source/blender/nodes/shader/nodes/node_shader_common.c
+++ b/source/blender/nodes/shader/nodes/node_shader_common.c
@@ -33,6 +33,8 @@
 
 #include "DNA_node_types.h"
 
+#include "BLI_utildefines.h"
+
 #include "BKE_node.h"
 
 #include "node_shader_util.h"
diff --git a/source/blender/nodes/shader/nodes/node_shader_gamma.c b/source/blender/nodes/shader/nodes/node_shader_gamma.c
index c49554c..365bac7 100644
--- a/source/blender/nodes/shader/nodes/node_shader_gamma.c
+++ b/source/blender/nodes/shader/nodes/node_shader_gamma.c
@@ -29,7 +29,7 @@
 #include "node_shader_util.h"
 
 /* **************** Gamma Tools  ******************** */
-  
+
 static bNodeSocketTemplate sh_node_gamma_in[] = {
 	{	SOCK_RGBA, 1, N_("Color"),			1.0f, 1.0f, 1.0f, 1.0f},
 	{	SOCK_FLOAT, 1, N_("Gamma"),			1.0f, 0.0f, 0.0f, 0.0f, 0.001f, 10.0f, PROP_UNSIGNED},
diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c
index b77c7d0..ec238b6 100644
--- a/source/blender/nodes/shader/nodes/node_shader_texture.c
+++ b/source/blender/nodes/shader/nodes/node_shader_texture.c
@@ -72,7 +72,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
 			
 			if (in[0]->datatype==NS_OSA_VECTORS) {
 				float *fp= in[0]->data;
-				retval= multitex_nodes((Tex *)node->id, vec, fp, fp+3, shi->osatex, &texres, thread, which_output, NULL, NULL);
+				retval = multitex_nodes((Tex *)node->id, vec, fp, fp+3, shi->osatex, &texres, thread, which_output, NULL, NULL, NULL);
 			}
 			else if (in[0]->datatype==NS_OSA_VALUES) {
 				float *fp= in[0]->data;
@@ -80,14 +80,14 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
 				
 				dxt[0] = fp[0]; dxt[1] = dxt[2] = 0.0f;
 				dyt[0] = fp[1]; dyt[1] = dyt[2] = 0.0f;
-				retval= multitex_nodes((Tex *)node->id, vec, dxt, dyt, shi->osatex, &texres, thread, which_output, NULL, NULL);
+				retval = multitex_nodes((Tex *)node->id, vec, dxt, dyt, shi->osatex, &texres, thread, which_output, NULL, NULL, NULL);
 			}
 			else
-				retval= multitex_nodes((Tex *)node->id, vec, NULL, NULL, 0, &texres, thread, which_output, NULL, NULL);
+				retval = multitex_nodes((Tex *)node->id, vec, NULL, NULL, 0, &texres, thread, which_output, NULL, NULL, NULL);
 		}
 		else {
 			copy_v3_v3(vec, shi->lo);
-			retval= multitex_nodes((Tex *)node->id, vec, NULL, NULL, 0, &texres, thread, which_output, NULL, NULL);
+			retval = multitex_nodes((Tex *)node->id, vec, NULL, NULL, 0, &texres, thread, which_output, NULL, NULL, NULL);
 		}
 		
 		/* stupid exception */
diff --git a/source/blender/nodes/texture/node_texture_util.h b/source/blender/nodes/texture/node_texture_util.h
index 16dbc2f..3b2a7e1 100644
--- a/source/blender/nodes/texture/node_texture_util.h
+++ b/source/blender/nodes/texture/node_texture_util.h
@@ -48,6 +48,12 @@
 #include "DNA_scene_types.h"
 #include "DNA_texture_types.h"
 
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_rand.h"
+#include "BLI_threads.h"
+#include "BLI_utildefines.h"
+
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 #include "BKE_global.h"
@@ -56,19 +62,12 @@
 #include "BKE_material.h"
 #include "BKE_node.h"
 #include "BKE_texture.h"
-
 #include "BKE_library.h"
 
 #include "node_util.h"
 
 #include "NOD_texture.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_threads.h"
-#include "BLI_utildefines.h"
-
 #include "BLF_translation.h"
 
 #include "IMB_imbuf_types.h"
diff --git a/source/blender/nodes/texture/nodes/node_texture_common.c b/source/blender/nodes/texture/nodes/node_texture_common.c
index 41bfd0a..aa427ff 100644
--- a/source/blender/nodes/texture/nodes/node_texture_common.c
+++ b/source/blender/nodes/texture/nodes/node_texture_common.c
@@ -33,6 +33,8 @@
 
 #include "DNA_node_types.h"
 
+#include "BLI_utildefines.h"
+
 #include "BKE_node.h"
 
 #include "node_texture_util.h"
diff --git a/source/blender/nodes/texture/nodes/node_texture_compose.c b/source/blender/nodes/texture/nodes/node_texture_compose.c
index 25da4f1..43a8ba1 100644
--- a/source/blender/nodes/texture/nodes/node_texture_compose.c
+++ b/source/blender/nodes/texture/nodes/node_texture_compose.c
@@ -61,7 +61,7 @@ void register_node_type_tex_compose(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
 	
-	node_type_base(ttype, &ntype, TEX_NODE_COMPOSE, "Compose RGBA", NODE_CLASS_OP_COLOR, 0);
+	node_type_base(ttype, &ntype, TEX_NODE_COMPOSE, "Combine RGBA", NODE_CLASS_OP_COLOR, 0);
 	node_type_socket_templates(&ntype, inputs, outputs);
 	node_type_size(&ntype, 100, 60, 150);
 	node_type_exec(&ntype, exec);
diff --git a/source/blender/nodes/texture/nodes/node_texture_decompose.c b/source/blender/nodes/texture/nodes/node_texture_decompose.c
index a2875c3..0866428 100644
--- a/source/blender/nodes/texture/nodes/node_texture_decompose.c
+++ b/source/blender/nodes/texture/nodes/node_texture_decompose.c
@@ -82,7 +82,7 @@ void register_node_type_tex_decompose(bNodeTreeType *ttype)
 {
 	static bNodeType ntype;
 	
-	node_type_base(ttype, &ntype, TEX_NODE_DECOMPOSE, "Decompose RGBA", NODE_CLASS_OP_COLOR, 0);
+	node_type_base(ttype, &ntype, TEX_NODE_DECOMPOSE, "Separate RGBA", NODE_CLASS_OP_COLOR, 0);
 	node_type_socket_templates(&ntype, inputs, outputs);
 	node_type_size(&ntype, 100, 60, 150);
 	node_type_exec(&ntype, exec);
diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c
index 8876d98..de2dac2 100644
--- a/source/blender/nodes/texture/nodes/node_texture_proc.c
+++ b/source/blender/nodes/texture/nodes/node_texture_proc.c
@@ -69,7 +69,7 @@ static void do_proc(float *result, TexParams *p, const float col1[4], const floa
 		texres.nor = NULL;
 	
 	textype = multitex_nodes(tex, p->co, p->dxt, p->dyt, p->osatex,
-	                         &texres, thread, 0, p->shi, p->mtex);
+	                         &texres, thread, 0, p->shi, p->mtex, NULL);
 	
 	if (is_normal)
 		return;
diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c
index cc7367a..f839f48 100644
--- a/source/blender/nodes/texture/nodes/node_texture_texture.c
+++ b/source/blender/nodes/texture/nodes/node_texture_texture.c
@@ -78,7 +78,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
 		
 		texres.nor = nor;
 		textype = multitex_nodes(nodetex, co, dxt, dyt, p->osatex,
-			&texres, thread, 0, p->shi, p->mtex);
+			&texres, thread, 0, p->shi, p->mtex, NULL);
 		
 		if (textype & TEX_RGB) {
 			copy_v4_v4(out, &texres.tr);
diff --git a/source/blender/opencl/CMakeLists.txt b/source/blender/opencl/CMakeLists.txt
deleted file mode 100644
index b3c76db..0000000
--- a/source/blender/opencl/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-set(INC
-	.
-)
-
-set(INC_SYS
-
-)
-
-set(SRC
-	OCL_opencl.h
-	intern/clew.h
-	intern/clew.c
-	intern/OCL_opencl.c
-)
-
-
-blender_add_lib(bf_opencl "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/opencl/SConscript b/source/blender/opencl/SConscript
deleted file mode 100644
index 388789a..0000000
--- a/source/blender/opencl/SConscript
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Nathan Letwory.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-Import ('env')
-
-sources = env.Glob('intern/*.c')
-
-incs = '.'
-
-env.BlenderLib ( 'bf_opencl', sources, Split(incs), libtype=['core','player'], priority = [192,192] )
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index 13cb11d..0f5be09 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -87,6 +87,11 @@ void	BPY_context_update(struct bContext *C);
 
 void	BPY_id_release(struct ID *id);
 
+/* I18n for addons */
+#ifdef WITH_INTERNATIONAL
+const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *msgid);
+#endif
+
 #ifdef __cplusplus
 }				/* extern "C" */
 #endif
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index ce8153f..47e6baf 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -115,8 +115,8 @@ static PyObject *bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args,
 	static const char *kwlist[] = {"mesh", "tessface", "destructive", NULL};
 	PyObject *py_me;
 	Mesh *me;
-	int do_tessface = TRUE;
-	int is_destructive = TRUE;
+	int do_tessface = true;
+	int is_destructive = true;
 
 	if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:update_edit_mesh", (char **)kwlist,
 	                                 &py_me, &do_tessface, &is_destructive))
@@ -137,7 +137,7 @@ static PyObject *bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args,
 	}
 
 	{
-		extern void EDBM_update_generic(BMEditMesh *em, const short do_tessface, const short is_destructive);
+		extern void EDBM_update_generic(BMEditMesh *em, const bool do_tessface, const bool is_destructive);
 		EDBM_update_generic(me->edit_btmesh, do_tessface, is_destructive);
 	}
 
diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.c b/source/blender/python/bmesh/bmesh_py_ops_call.c
index 3231519..fad3e4a 100644
--- a/source/blender/python/bmesh/bmesh_py_ops_call.c
+++ b/source/blender/python/bmesh/bmesh_py_ops_call.c
@@ -48,11 +48,13 @@
 static int bpy_bm_op_as_py_error(BMesh *bm)
 {
 	if (BMO_error_occurred(bm)) {
+		/* note: we could have multiple errors */
 		const char *errmsg;
 		if (BMO_error_get(bm, &errmsg, NULL)) {
 			PyErr_Format(PyExc_RuntimeError,
 			             "bmesh operator: %.200s",
 			             errmsg);
+			BMO_error_clear(bm);
 			return -1;
 		}
 	}
@@ -214,7 +216,7 @@ static int bpy_slot_from_py(BMesh *bm, BMOperator *bmop, BMOpSlot *slot, PyObjec
 				return -1;
 			}
 			else if (((size = ((MatrixObject *)value)->num_col) != ((MatrixObject *)value)->num_row) ||
-			         (ELEM(size, 3, 4) == FALSE))
+			         (ELEM(size, 3, 4) == false))
 			{
 				PyErr_Format(PyExc_TypeError,
 				             "%.200s: keyword \"%.200s\" expected a 3x3 or 4x4 matrix Matrix",
@@ -319,7 +321,7 @@ static int bpy_slot_from_py(BMesh *bm, BMOperator *bmop, BMOpSlot *slot, PyObjec
 
 					elem_array = BPy_BMElem_PySeq_As_Array(&bm, value, 0, PY_SSIZE_T_MAX,
 					                                       &elem_array_len, (slot->slot_subtype.elem & BM_ALL_NOLOOP),
-					                                       TRUE, TRUE, slot_name);
+					                                       true, true, slot_name);
 
 					/* error is set above */
 					if (elem_array == NULL) {
@@ -692,6 +694,9 @@ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw)
 	{
 		BPY_BM_CHECK_OBJ(py_bm);
 		bm = py_bm->bm;
+
+		/* could complain about entering with exceptions... */
+		BMO_error_clear(bm);
 	}
 	else {
 		PyErr_SetString(PyExc_TypeError,
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index ea6e1e2..b96c522 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -50,6 +50,8 @@
 #include "bmesh_py_types_customdata.h"
 #include "bmesh_py_types_meshdata.h"
 
+static void bm_dealloc_editmode_warn(BPy_BMesh *self);
+
 /* Common Flags
  * ************ */
 
@@ -120,11 +122,11 @@ static int bpy_bm_elem_hflag_set(BPy_BMElem *self, PyObject *value, void *flag)
 
 	param = PyLong_AsLong(value);
 
-	if (param == TRUE) {
+	if (param == true) {
 		BM_elem_flag_enable(self->ele, hflag);
 		return 0;
 	}
-	else if (param == FALSE) {
+	else if (param == false) {
 		BM_elem_flag_disable(self->ele, hflag);
 		return 0;
 	}
@@ -412,6 +414,14 @@ static PyObject *bpy_bmedge_is_manifold_get(BPy_BMEdge *self)
 	return PyBool_FromLong(BM_edge_is_manifold(self->e));
 }
 
+PyDoc_STRVAR(bpy_bmedge_is_contiguous_doc,
+"True when this edge is manifold, between two faces with the same winding (read-only).\n\n:type: boolean"
+);
+static PyObject *bpy_bmedge_is_contiguous_get(BPy_BMEdge *self)
+{
+	BPY_BM_CHECK_OBJ(self);
+	return PyBool_FromLong(BM_edge_is_contiguous(self->e));
+}
 
 PyDoc_STRVAR(bpy_bmedge_is_wire_doc,
 "True when this edge is not connected to any faces (read-only).\n\n:type: boolean"
@@ -559,6 +569,15 @@ static PyObject *bpy_bmloop_link_loop_radial_prev_get(BPy_BMLoop *self)
 	return BPy_BMLoop_CreatePyObject(self->bm, self->l->radial_prev);
 }
 
+PyDoc_STRVAR(bpy_bm_is_convex_doc,
+"True when this loop is at the convex corner of a face, depends on a valid face normal (read-only).\n\n:type: :class:`BMLoop`"
+);
+static PyObject *bpy_bm_is_convex_get(BPy_BMLoop *self)
+{
+	BPY_BM_CHECK_OBJ(self);
+	return PyBool_FromLong(BM_loop_is_convex(self->l));
+}
+
 /* ElemSeq
  * ^^^^^^^ */
 
@@ -669,10 +688,11 @@ static PyGetSetDef bpy_bmedge_getseters[] = {
 	{(char *)"link_loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_link_loops_doc, (void *)BM_LOOPS_OF_EDGE},
 
 	/* readonly checks */
-	{(char *)"is_manifold",  (getter)bpy_bmedge_is_manifold_get,  (setter)NULL, (char *)bpy_bmedge_is_manifold_doc, NULL},
-	{(char *)"is_wire",      (getter)bpy_bmedge_is_wire_get,      (setter)NULL, (char *)bpy_bmedge_is_wire_doc, NULL},
+	{(char *)"is_manifold",   (getter)bpy_bmedge_is_manifold_get,   (setter)NULL, (char *)bpy_bmedge_is_manifold_doc, NULL},
+	{(char *)"is_contiguous", (getter)bpy_bmedge_is_contiguous_get, (setter)NULL, (char *)bpy_bmedge_is_contiguous_doc, NULL},
+	{(char *)"is_wire",       (getter)bpy_bmedge_is_wire_get,       (setter)NULL, (char *)bpy_bmedge_is_wire_doc, NULL},
 	{(char *)"is_boundary",   (getter)bpy_bmedge_is_boundary_get,   (setter)NULL, (char *)bpy_bmedge_is_boundary_doc, NULL},
-	{(char *)"is_valid",     (getter)bpy_bm_is_valid_get,         (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+	{(char *)"is_valid",      (getter)bpy_bm_is_valid_get,          (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
 
 	{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
 };
@@ -721,7 +741,8 @@ static PyGetSetDef bpy_bmloop_getseters[] = {
 	{(char *)"link_loop_radial_prev", (getter)bpy_bmloop_link_loop_radial_prev_get, (setter)NULL, (char *)bpy_bmloop_link_loop_radial_prev_doc, NULL},
 
 	/* readonly checks */
-	{(char *)"is_valid",   (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+	{(char *)"is_convex",  (getter)bpy_bm_is_convex_get, (setter)NULL, (char *)bpy_bm_is_convex_doc, NULL},
+	{(char *)"is_valid",   (getter)bpy_bm_is_valid_get,  (setter)NULL, (char *)bpy_bm_is_valid_doc,  NULL},
 
 	{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
 };
@@ -813,6 +834,8 @@ static PyObject *bpy_bmesh_free(BPy_BMesh *self)
 	if (self->bm) {
 		BMesh *bm = self->bm;
 
+		bm_dealloc_editmode_warn(self);
+
 		if ((self->flag & BPY_BMFLAG_IS_WRAPPED) == 0) {
 			BM_mesh_free(bm);
 		}
@@ -854,7 +877,7 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args)
 
 	bm = self->bm;
 
-	BM_mesh_bm_to_me(bm, me, FALSE);
+	BM_mesh_bm_to_me(bm, me, false);
 
 	/* we could have the user do this but if they forget blender can easy crash
 	 * since the references arrays for the objects derived meshes are now invalid */
@@ -884,9 +907,9 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args)
 	Object *ob;
 	struct Scene *scene;
 	BMesh *bm;
-	int use_deform = TRUE;
-	int use_render = FALSE;
-	int use_cage   = FALSE;
+	int use_deform = true;
+	int use_render = false;
+	int use_cage   = false;
 	DerivedMesh *dm;
 	const int mask = CD_MASK_BMESH;
 
@@ -984,7 +1007,7 @@ static PyObject *bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *
 	BMesh *bm;
 	PyObject *py_mesh;
 	Mesh *me;
-	int use_shape_key = FALSE;
+	int use_shape_key = false;
 	int shape_key_index = 0;
 
 	if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:from_mesh", (char **)kwlist,
@@ -1032,7 +1055,7 @@ static PyObject *bpy_bmesh_select_flush(BPy_BMesh *self, PyObject *value)
 	BPY_BM_CHECK_OBJ(self);
 
 	param = PyLong_AsLong(value);
-	if (param != FALSE && param != TRUE) {
+	if (param != false && param != true) {
 		PyErr_SetString(PyExc_TypeError,
 		                "expected a boolean type 0/1");
 		return NULL;
@@ -1056,7 +1079,7 @@ PyDoc_STRVAR(bpy_bmesh_normal_update_doc,
 static PyObject *bpy_bmesh_normal_update(BPy_BMesh *self, PyObject *args)
 {
 
-	int skip_hidden = FALSE;
+	int skip_hidden = false;
 
 	BPY_BM_CHECK_OBJ(self);
 
@@ -1163,7 +1186,7 @@ static PyObject *bpy_bm_elem_select_set(BPy_BMElem *self, PyObject *value)
 	BPY_BM_CHECK_OBJ(self);
 
 	param = PyLong_AsLong(value);
-	if (param != FALSE && param != TRUE) {
+	if (param != false && param != true) {
 		PyErr_SetString(PyExc_TypeError,
 		                "expected a boolean type 0/1");
 		return NULL;
@@ -1191,7 +1214,7 @@ static PyObject *bpy_bm_elem_hide_set(BPy_BMElem *self, PyObject *value)
 	BPY_BM_CHECK_OBJ(self);
 
 	param = PyLong_AsLong(value);
-	if (param != FALSE && param != TRUE) {
+	if (param != false && param != true) {
 		PyErr_SetString(PyExc_TypeError,
 		                "expected a boolean type 0/1");
 		return NULL;
@@ -1258,7 +1281,7 @@ static PyObject *bpy_bmvert_copy_from_vert_interp(BPy_BMVert *self, PyObject *ar
 
 		vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 2, 2,
 		                                       &vert_seq_len, BM_VERT,
-		                                       TRUE, TRUE, "BMVert.copy_from_vert_interp(...)");
+		                                       true, true, "BMVert.copy_from_vert_interp(...)");
 
 		if (vert_array == NULL) {
 			return NULL;
@@ -1508,8 +1531,8 @@ static PyObject *bpy_bmface_copy(BPy_BMFace *self, PyObject *args, PyObject *kw)
 	static const char *kwlist[] = {"verts", "edges", NULL};
 
 	BMesh *bm = self->bm;
-	int do_verts = TRUE;
-	int do_edges = TRUE;
+	int do_verts = true;
+	int do_edges = true;
 
 	BMFace *f_cpy;
 	BPY_BM_CHECK_OBJ(self);
@@ -1649,8 +1672,8 @@ PyDoc_STRVAR(bpy_bmloop_copy_from_face_interp_doc,
 static PyObject *bpy_bmloop_copy_from_face_interp(BPy_BMLoop *self, PyObject *args)
 {
 	BPy_BMFace *py_face = NULL;
-	int do_vertex   = TRUE;
-	int do_multires = TRUE;
+	int do_vertex   = true;
+	int do_multires = true;
 
 	BPY_BM_CHECK_OBJ(self);
 
@@ -1818,7 +1841,7 @@ static PyObject *bpy_bmedgeseq_new(BPy_BMElemSeq *self, PyObject *args)
 
 		vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 2, 2,
 		                                       &vert_seq_len, BM_VERT,
-		                                       TRUE, TRUE, "edges.new(...)");
+		                                       true, true, "edges.new(...)");
 
 		if (vert_array == NULL) {
 			return NULL;
@@ -1896,7 +1919,7 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
 
 		vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 3, PY_SSIZE_T_MAX,
 		                                       &vert_seq_len, BM_VERT,
-		                                       TRUE, TRUE, "faces.new(...)");
+		                                       true, true, "faces.new(...)");
 
 		if (vert_array == NULL) {
 			return NULL;
@@ -2049,7 +2072,7 @@ static PyObject *bpy_bmedgeseq_get__method(BPy_BMElemSeq *self, PyObject *args)
 
 		vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 2, 2,
 		                                       &vert_seq_len, BM_VERT,
-		                                       TRUE, TRUE, "edges.get(...)");
+		                                       true, true, "edges.get(...)");
 
 		if (vert_array == NULL) {
 			return NULL;
@@ -2101,7 +2124,7 @@ static PyObject *bpy_bmfaceseq_get__method(BPy_BMElemSeq *self, PyObject *args)
 
 		vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 1, PY_SSIZE_T_MAX,
 		                                       &vert_seq_len, BM_VERT,
-		                                       TRUE, TRUE, "faces.get(...)");
+		                                       true, true, "faces.get(...)");
 
 		if (vert_array == NULL) {
 			return NULL;
@@ -2228,7 +2251,7 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
 {
 	static const char *kwlist[] = {"key", "reverse", NULL};
 	PyObject *keyfunc = NULL; /* optional */
-	int reverse = FALSE; /* optional */
+	int do_reverse = false; /* optional */
 
 	const char htype = bm_iter_itype_htype_map[self->itype];
 	int n_elem;
@@ -2253,7 +2276,7 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
 		if (!PyArg_ParseTupleAndKeywords(args, kw,
 		                                 "|Oi:BMElemSeq.sort",
 		                                 (char **)kwlist,
-		                                 &keyfunc, &reverse))
+		                                 &keyfunc, &do_reverse))
 		{
 			return NULL;
 		}
@@ -2323,7 +2346,7 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
 	range_vn_i(elem_idx, n_elem, 0);
 
 	/* Sort the index array according to the order of the 'keys' array */
-	if (reverse)
+	if (do_reverse)
 		elem_idx_compare_by_keys = bpy_bmelemseq_sort_cmp_by_keys_descending;
 	else
 		elem_idx_compare_by_keys = bpy_bmelemseq_sort_cmp_by_keys_ascending;
@@ -2601,7 +2624,7 @@ static PyObject *bpy_bmelemseq_subscript_slice(BPy_BMElemSeq *self, Py_ssize_t s
 {
 	BMIter iter;
 	int count = 0;
-	int ok;
+	bool ok;
 
 	PyObject *list;
 	PyObject *item;
@@ -2613,14 +2636,14 @@ static PyObject *bpy_bmelemseq_subscript_slice(BPy_BMElemSeq *self, Py_ssize_t s
 
 	ok = BM_iter_init(&iter, self->bm, self->itype, self->py_ele ? self->py_ele->ele : NULL);
 
-	BLI_assert(ok == TRUE);
+	BLI_assert(ok == true);
 
-	if (UNLIKELY(ok == FALSE)) {
+	if (UNLIKELY(ok == false)) {
 		return list;
 	}
 
 	/* first loop up-until the start */
-	for (ok = TRUE; ok; ok = (BM_iter_step(&iter) != NULL)) {
+	for (ok = true; ok; ok = (BM_iter_step(&iter) != NULL)) {
 		if (count == start) {
 			break;
 		}
@@ -2794,6 +2817,8 @@ static void bpy_bmesh_dealloc(BPy_BMesh *self)
 
 	/* have have been freed by bmesh */
 	if (bm) {
+		bm_dealloc_editmode_warn(self);
+
 		BM_data_layer_free(bm, &bm->vdata, CD_BM_ELEM_PYPTR);
 		BM_data_layer_free(bm, &bm->edata, CD_BM_ELEM_PYPTR);
 		BM_data_layer_free(bm, &bm->pdata, CD_BM_ELEM_PYPTR);
@@ -3419,7 +3444,7 @@ int bpy_bm_generic_valid_check(BPy_BMGeneric *self)
 		 * function where the actual error will be caused by
 		 * the previous action. */
 #if 0
-		if (BM_mesh_validate(self->bm) == FALSE) {
+		if (BM_mesh_validate(self->bm) == false) {
 			PyErr_Format(PyExc_ReferenceError,
 			             "BMesh used by %.200s has become invalid",
 			             Py_TYPE(self)->tp_name);
@@ -3464,7 +3489,7 @@ void bpy_bm_generic_invalidate(BPy_BMGeneric *self)
  */
 void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_size,
                                 const char htype,
-                                const char do_unique_check, const char do_bm_check,
+                                const bool do_unique_check, const bool do_bm_check,
                                 const char *error_prefix)
 {
 	BMesh *bm = (r_bm && *r_bm) ? *r_bm : NULL;
@@ -3531,17 +3556,17 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
 
 		if (do_unique_check) {
 			/* check for double verts! */
-			int ok = TRUE;
+			bool ok = true;
 			for (i = 0; i < seq_len; i++) {
-				if (UNLIKELY(BM_elem_flag_test(alloc[i], BM_ELEM_INTERNAL_TAG) == FALSE)) {
-					ok = FALSE;
+				if (UNLIKELY(BM_elem_flag_test(alloc[i], BM_ELEM_INTERNAL_TAG) == false)) {
+					ok = false;
 				}
 
 				/* ensure we don't leave this enabled */
 				BM_elem_flag_disable(alloc[i], BM_ELEM_INTERNAL_TAG);
 			}
 
-			if (ok == FALSE) {
+			if (ok == false) {
 				PyErr_Format(PyExc_ValueError,
 				             "%s: found the same %.200s used multiple times",
 				             error_prefix, BPy_BMElem_StringFromHType(htype));
@@ -3604,3 +3629,51 @@ char *BPy_BMElem_StringFromHType(const char htype)
 	static char ret[32];
 	return BPy_BMElem_StringFromHType_ex(htype, ret);
 }
+
+
+/* -------------------------------------------------------------------- */
+/* keep at bottom */
+/* BAD INCLUDES */
+
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_tessmesh.h"
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
+#include "MEM_guardedalloc.h"
+
+/* there are cases where this warning isnt needed, otherwise it could be made into an error */
+static void bm_dealloc_warn(const char *mesh_name)
+{
+	PySys_WriteStdout("Modified BMesh '%.200s' from a wrapped editmesh is freed without a call "
+	                  "to bmesh.update_edit_mesh(mesh, destructive=True), this is will likely cause a crash\n",
+	                  mesh_name);
+}
+
+/* this function is called on free, it should stay quite fast */
+static void bm_dealloc_editmode_warn(BPy_BMesh *self)
+{
+	if (self->flag & BPY_BMFLAG_IS_WRAPPED) {
+		/* likely editmesh */
+		BMesh *bm = self->bm;
+		Scene *scene;
+		for (scene = G.main->scene.first; scene; scene = scene->id.next) {
+			Base *base = scene->basact;
+			if (base && base->object->type == OB_MESH) {
+				Mesh *me = base->object->data;
+				BMEditMesh *em = me->edit_btmesh;
+				if (em && em->bm == bm) {
+					/* not foolproof, scripter may have added/removed verts */
+					if (((em->vert_index && (MEM_allocN_len(em->vert_index) / sizeof(*em->vert_index)) != bm->totvert)) ||
+					    ((em->edge_index && (MEM_allocN_len(em->edge_index) / sizeof(*em->edge_index)) != bm->totedge)) ||
+					    ((em->face_index && (MEM_allocN_len(em->face_index) / sizeof(*em->face_index)) != bm->totface)))
+					{
+						bm_dealloc_warn(me->id.name + 2);
+						break;
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h
index d15918a..8e6d04e 100644
--- a/source/blender/python/bmesh/bmesh_py_types.h
+++ b/source/blender/python/bmesh/bmesh_py_types.h
@@ -160,7 +160,7 @@ PyObject *BPy_BMElem_CreatePyObject(BMesh *bm, BMHeader *ele); /* just checks ty
 
 void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_size,
                                 const char htype,
-                                const char do_unique_check, const char do_bm_check,
+                                const bool do_unique_check, const bool do_bm_check,
                                 const char *error_prefix);
 
 PyObject *BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_len);
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
index b087057..f596762 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -187,10 +187,10 @@ static int bpy_bmloopuv_flag_set(BPy_BMLoopUV *self, PyObject *value, void *flag
 	const int flag = GET_INT_FROM_POINTER(flag_p);
 
 	switch (PyLong_AsLong(value)) {
-		case TRUE:
+		case true:
 			self->data->flag |= flag;
 			return 0;
-		case FALSE:
+		case false:
 			self->data->flag &= ~flag;
 			return 0;
 		default:
diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c
index dfcfbeb..33cb1f5 100644
--- a/source/blender/python/bmesh/bmesh_py_types_select.c
+++ b/source/blender/python/bmesh/bmesh_py_types_select.c
@@ -107,7 +107,7 @@ static PyObject *bpy_bmeditselseq_add(BPy_BMEditSelSeq *self, BPy_BMElem *value)
 
 	if ((BPy_BMVert_Check(value) ||
 	     BPy_BMEdge_Check(value) ||
-	     BPy_BMFace_Check(value)) == FALSE)
+	     BPy_BMFace_Check(value)) == false)
 	{
 		PyErr_Format(PyExc_TypeError,
 		             "Expected a BMVert/BMedge/BMFace not a %.200s", Py_TYPE(value)->tp_name);
@@ -132,7 +132,7 @@ static PyObject *bpy_bmeditselseq_remove(BPy_BMEditSelSeq *self, BPy_BMElem *val
 
 	if ((BPy_BMVert_Check(value) ||
 	     BPy_BMEdge_Check(value) ||
-	     BPy_BMFace_Check(value)) == FALSE)
+	     BPy_BMFace_Check(value)) == false)
 	{
 		PyErr_Format(PyExc_TypeError,
 		             "Expected a BMVert/BMedge/BMFace not a %.200s", Py_TYPE(value)->tp_name);
@@ -141,7 +141,7 @@ static PyObject *bpy_bmeditselseq_remove(BPy_BMEditSelSeq *self, BPy_BMElem *val
 
 	BPY_BM_CHECK_SOURCE_OBJ(value, self->bm, "select_history.remove()");
 
-	if (BM_select_history_remove(self->bm, value->ele) == FALSE) {
+	if (BM_select_history_remove(self->bm, value->ele) == false) {
 		PyErr_SetString(PyExc_ValueError,
 		                "Element not found in selection history");
 		return NULL;
@@ -196,7 +196,7 @@ static PyObject *bpy_bmeditselseq_subscript_int(BPy_BMEditSelSeq *self, int keyn
 static PyObject *bpy_bmeditselseq_subscript_slice(BPy_BMEditSelSeq *self, Py_ssize_t start, Py_ssize_t stop)
 {
 	int count = 0;
-	int ok;
+	bool ok;
 
 	PyObject *list;
 	PyObject *item;
@@ -210,12 +210,12 @@ static PyObject *bpy_bmeditselseq_subscript_slice(BPy_BMEditSelSeq *self, Py_ssi
 
 	ok = (ese != NULL);
 
-	if (UNLIKELY(ok == FALSE)) {
+	if (UNLIKELY(ok == false)) {
 		return list;
 	}
 
 	/* first loop up-until the start */
-	for (ok = TRUE; ok; ok = ((ese = ese->next) != NULL)) {
+	for (ok = true; ok; ok = ((ese = ese->next) != NULL)) {
 		if (count == start) {
 			break;
 		}
@@ -429,7 +429,7 @@ int BPy_BMEditSel_Assign(BPy_BMesh *self, PyObject *value)
 
 	value_array = BPy_BMElem_PySeq_As_Array(&bm, value, 0, PY_SSIZE_T_MAX,
 	                                        &value_len, BM_VERT | BM_EDGE | BM_FACE,
-	                                        TRUE, TRUE, "BMesh.select_history = value");
+	                                        true, true, "BMesh.select_history = value");
 
 	if (value_array == NULL) {
 		return -1;
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index a43c5c1..7c0adcf 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -90,7 +90,7 @@ static PyObject *bpy_bm_utils_vert_collapse_edge(PyObject *UNUSED(self), PyObjec
 
 	bm = py_edge->bm;
 
-	e_new = BM_vert_collapse_edge(bm, py_edge->e, py_vert->v, TRUE);
+	e_new = BM_vert_collapse_edge(bm, py_edge->e, py_vert->v, true);
 
 	if (e_new) {
 		return BPy_BMEdge_CreatePyObject(bm, e_new);
@@ -156,7 +156,7 @@ static PyObject *bpy_bm_utils_vert_collapse_faces(PyObject *UNUSED(self), PyObje
 
 	bm = py_edge->bm;
 
-	e_new = BM_vert_collapse_faces(bm, py_edge->e, py_vert->v, CLAMPIS(fac, 0.0f, 1.0f), do_join_faces, TRUE);
+	e_new = BM_vert_collapse_faces(bm, py_edge->e, py_vert->v, CLAMPIS(fac, 0.0f, 1.0f), do_join_faces, true);
 
 	if (e_new) {
 		return BPy_BMEdge_CreatePyObject(bm, e_new);
@@ -239,7 +239,7 @@ static PyObject *bpy_bm_utils_vert_separate(PyObject *UNUSED(self), PyObject *ar
 
 	edge_array = BPy_BMElem_PySeq_As_Array(&bm, edge_seq, 0, PY_SSIZE_T_MAX,
 	                                       &edge_array_len, BM_EDGE,
-	                                       TRUE, TRUE, "vert_separate(...)");
+	                                       true, true, "vert_separate(...)");
 
 	if (edge_array == NULL) {
 		return NULL;
@@ -338,7 +338,7 @@ PyDoc_STRVAR(bpy_bm_utils_edge_rotate_doc,
 static PyObject *bpy_bm_utils_edge_rotate(PyObject *UNUSED(self), PyObject *args)
 {
 	BPy_BMEdge *py_edge;
-	int do_ccw = FALSE;
+	int do_ccw = false;
 
 	BMesh *bm;
 	BMEdge *e_new = NULL;
@@ -396,7 +396,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args,
 
 	/* optional */
 	PyObject *py_coords = NULL;
-	int edge_exists = TRUE;
+	int edge_exists = true;
 	BPy_BMEdge *py_edge_example = NULL;
 
 	float *coords;
@@ -426,8 +426,8 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args,
 	}
 
 	/* this doubles for checking that the verts are in the same mesh */
-	if (BM_vert_in_face(py_face->f, py_vert_a->v) == FALSE ||
-	    BM_vert_in_face(py_face->f, py_vert_b->v) == FALSE)
+	if (BM_vert_in_face(py_face->f, py_vert_a->v) == false ||
+	    BM_vert_in_face(py_face->f, py_vert_b->v) == false)
 	{
 		PyErr_SetString(PyExc_ValueError,
 		                "face_split(...): one of the verts passed is not found in the face");
@@ -496,7 +496,7 @@ static PyObject *bpy_bm_utils_face_join(PyObject *UNUSED(self), PyObject *args)
 	BMFace **face_array;
 	Py_ssize_t face_seq_len = 0;
 	BMFace *f_new;
-	int do_remove = TRUE;
+	int do_remove = true;
 
 	if (!PyArg_ParseTuple(args, "O|i:face_join", &py_face_array, &do_remove)) {
 		return NULL;
@@ -504,7 +504,7 @@ static PyObject *bpy_bm_utils_face_join(PyObject *UNUSED(self), PyObject *args)
 
 	face_array = BPy_BMElem_PySeq_As_Array(&bm, py_face_array, 2, PY_SSIZE_T_MAX,
 	                                       &face_seq_len, BM_FACE,
-	                                       TRUE, TRUE, "face_join(...)");
+	                                       true, true, "face_join(...)");
 
 	if (face_array == NULL) {
 		return NULL; /* error will be set */
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 8d146be..0c0ad50 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -66,7 +66,7 @@ static PyObject   *imp_reload_orig = NULL;
  *
  * However Python's alternative is to use import hooks,
  * which are implemented in a way that we can't use our own importer as a
- * fall-back (instead we must try and fail - raise an exception evert time).
+ * fall-back (instead we must try and fail - raise an exception every time).
  * Since importing from blenders text-blocks is not the common case
  * I prefer to use Pythons import by default and fall-back to
  * Blenders - which we can only do by intercepting import calls I'm afraid.
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 10ca7a9..a0e2f1a 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -1454,6 +1454,8 @@ static PyObject *BPyInit_idprop_types(void)
 
 	submodule = PyModule_Create(&IDProp_types_module_def);
 
+	IDProp_Init_Types();
+
 #define MODULE_TYPE_ADD(s, t) \
 	PyModule_AddObject(s, t.tp_name, (PyObject *)&t); Py_INCREF((PyObject *)&t)
 
@@ -1497,7 +1499,7 @@ PyObject *BPyInit_idprop(void)
 
 	mod = PyModule_Create(&IDProp_module_def);
 
-	/* bmesh.types */
+	/* idprop.types */
 	PyModule_AddObject(mod, "types", (submodule = BPyInit_idprop_types()));
 	PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule);
 	Py_INCREF(submodule);
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index 575185e..b531e08 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -49,6 +49,7 @@ set(SRC
 	bpy_app_ffmpeg.c
 	bpy_app_build_options.c
 	bpy_app_handlers.c
+	bpy_app_translations.c
 	bpy_driver.c
 	bpy_interface.c
 	bpy_interface_atexit.c
@@ -72,6 +73,7 @@ set(SRC
 	bpy_app_ffmpeg.h
 	bpy_app_build_options.h
 	bpy_app_handlers.h
+	bpy_app_translations.h
 	bpy_driver.h
 	bpy_intern_string.h
 	bpy_library.h
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 3e2353c..5195f82 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -36,6 +36,8 @@
 #include "bpy_app_ffmpeg.h"
 #include "bpy_app_build_options.h"
 
+#include "bpy_app_translations.h"
+
 #include "bpy_app_handlers.h"
 #include "bpy_driver.h"
 
@@ -86,7 +88,8 @@ static PyStructSequence_Field app_info_fields[] = {
 	{(char *)"ffmpeg", (char *)"FFmpeg library information backend"},
 	{(char *)"build_options", (char *)"A set containing most important enabled optional build features"},
 	{(char *)"handlers", (char *)"Application handler callbacks"},
-	{NULL}
+	{(char *)"translations", (char *)"Application and addons internationalization API"},
+	{NULL},
 };
 
 static PyStructSequence_Desc app_info_desc = {
@@ -152,6 +155,7 @@ static PyObject *make_app_info(void)
 	SetObjItem(BPY_app_ffmpeg_struct());
 	SetObjItem(BPY_app_build_options_struct());
 	SetObjItem(BPY_app_handlers_struct());
+	SetObjItem(BPY_app_translations_struct());
 
 #undef SetIntItem
 #undef SetStrItem
diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c
index 0036b37..6db0a52 100644
--- a/source/blender/python/intern/bpy_app_build_options.c
+++ b/source/blender/python/intern/bpy_app_build_options.c
@@ -32,7 +32,7 @@
 static PyTypeObject BlenderAppBuildOptionsType;
 
 static PyStructSequence_Field app_builtopts_info_fields[] = {
-	/* names mostly follow CMake options, lowecases, after WITH_ */
+	/* names mostly follow CMake options, lowercase, after WITH_ */
 	{(char *)"bullet", NULL},
 	{(char *)"codec_avi", NULL},
 	{(char *)"codec_ffmpeg", NULL},
@@ -71,7 +71,7 @@ static PyStructSequence_Field app_builtopts_info_fields[] = {
 
 static PyStructSequence_Desc app_builtopts_info_desc = {
 	(char *)"bpy.app.build_options",     /* name */
-	(char *)"This module contains information about FFmpeg blender is linked against",    /* doc */
+	(char *)"This module contains information about options blender is built with",    /* doc */
 	app_builtopts_info_fields,    /* fields */
 	(sizeof(app_builtopts_info_fields) / sizeof(PyStructSequence_Field)) - 1
 };
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
new file mode 100644
index 0000000..7c89972
--- /dev/null
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -0,0 +1,808 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Bastien Montagne
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/intern/bpy_app_translations.c
+ *  \ingroup pythonintern
+ *
+ * This file defines a singleton py object accessed via 'bpy.app.translations',
+ * which exposes various data and functions useful in i18n work.
+ * Most notably, it allows to extend main translations with py dicts.
+ */
+
+#include <Python.h>
+/* XXX Why bloody hell isn't that included in Python.h???? */
+#include <structmember.h>
+
+#include "BLI_string.h"
+#include "BLI_ghash.h"
+#include "BLI_utildefines.h"
+
+#include "BPY_extern.h"
+#include "bpy_app_translations.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLF_translation.h"
+
+#include "RNA_types.h"
+#include "RNA_access.h"
+
+
+typedef struct
+{
+	PyObject_HEAD
+	/* The string used to separate context from actual message in PY_TRANSLATE RNA props. */
+	const char *context_separator;
+	/* A "named tuple" (StructSequence actually...) containing all C-defined contexts. */
+	PyObject *contexts;
+	/* A readonly mapping {C context id: python id}  (actually, a MappingProxy). */
+	PyObject *contexts_C_to_py;
+	/* A py dict containing all registered py dicts (order is more or less random, first match wins!). */
+	PyObject *py_messages;
+} BlenderAppTranslations;
+
+/* Our singleton instance pointer */
+static BlenderAppTranslations *_translations = NULL;
+
+#ifdef WITH_INTERNATIONAL
+
+/***** Helpers for ghash *****/
+typedef struct GHashKey {
+	const char *msgctxt;
+	const char *msgid;
+} GHashKey;
+
+static GHashKey *_ghashutil_keyalloc(const void *msgctxt, const void *msgid)
+{
+	GHashKey *key = MEM_mallocN(sizeof(GHashKey), "Py i18n GHashKey");
+	key->msgctxt = BLI_strdup(msgctxt ? msgctxt : BLF_I18NCONTEXT_DEFAULT_BPY);
+	key->msgid = BLI_strdup(msgid);
+	return key;
+}
+
+static unsigned int _ghashutil_keyhash(const void *ptr)
+{
+	const GHashKey *key = ptr;
+	unsigned int hash =  BLI_ghashutil_strhash(key->msgctxt);
+	return hash ^ BLI_ghashutil_strhash(key->msgid);
+}
+
+static int _ghashutil_keycmp(const void *a, const void *b)
+{
+	const GHashKey *A = a;
+	const GHashKey *B = b;
+
+	/* Note: comparing msgid first, most of the time it will be enough! */
+	int cmp = BLI_ghashutil_strcmp(A->msgid, B->msgid);
+	if (cmp == 0)
+		return BLI_ghashutil_strcmp(A->msgctxt, B->msgctxt);
+	return cmp;
+}
+
+static void _ghashutil_keyfree(void *ptr)
+{
+	const GHashKey *key = ptr;
+
+	/* We assume both msgctxt and msgid were BLI_strdup'ed! */
+	MEM_freeN((void *)key->msgctxt);
+	MEM_freeN((void *)key->msgid);
+	MEM_freeN((void *)key);
+}
+
+static void _ghashutil_valfree(void *ptr)
+{
+	MEM_freeN(ptr);
+}
+
+/***** Python's messages cache *****/
+
+/* We cache all messages available for a given locale from all py dicts into a single ghash.
+ * Changing of locale is not so common, while looking for a message translation is, so let's try to optimize
+ * the later as much as we can!
+ * Note changing of locale, as well as (un)registering a message dict, invalidate that cache.
+ */
+static GHash *_translations_cache = NULL;
+
+static void _clear_translations_cache(void)
+{
+	if (_translations_cache) {
+		BLI_ghash_free(_translations_cache, _ghashutil_keyfree, _ghashutil_valfree);
+	}
+	_translations_cache = NULL;
+}
+
+static void _build_translations_cache(PyObject *py_messages, const char *locale)
+{
+	PyObject *uuid, *uuid_dict;
+	Py_ssize_t pos = 0;
+	char *language = NULL, *language_country = NULL, *language_variant = NULL;
+
+	/* For each py dict, we'll search for full locale, then language+country, then language+variant,
+	 * then only language keys... */
+	BLF_locale_explode(locale, &language, NULL, NULL, &language_country, &language_variant);
+
+	/* Clear the cached ghash if needed, and create a new one. */
+	_clear_translations_cache();
+	_translations_cache = BLI_ghash_new(_ghashutil_keyhash, _ghashutil_keycmp, __func__);
+
+	/* Iterate over all py dicts. */
+	while (PyDict_Next(py_messages, &pos, &uuid, &uuid_dict)) {
+		PyObject *lang_dict;
+
+#if 0
+		PyObject_Print(uuid_dict, stdout, 0);
+		printf("\n");
+#endif
+
+		/* Try to get first complete locale, then language+country, then language+variant, then only language */
+		lang_dict = PyDict_GetItemString(uuid_dict, locale);
+		if (!lang_dict && language_country) {
+			lang_dict = PyDict_GetItemString(uuid_dict, language_country);
+			locale = language_country;
+		}
+		if (!lang_dict && language_variant) {
+			lang_dict = PyDict_GetItemString(uuid_dict, language_variant);
+			locale = language_variant;
+		}
+		if (!lang_dict && language) {
+			lang_dict = PyDict_GetItemString(uuid_dict, language);
+			locale = language;
+		}
+
+		if (lang_dict) {
+			PyObject *pykey, *trans;
+			Py_ssize_t ppos = 0;
+
+			if (!PyDict_Check(lang_dict)) {
+				printf("WARNING! In translations' dict of \"");
+				PyObject_Print(uuid, stdout, Py_PRINT_RAW);
+				printf("\":\n");
+				printf("    Each language key must have a dictionary as value, \"%s\" is not valid, skipping: ",
+				       locale);
+				PyObject_Print(lang_dict, stdout, Py_PRINT_RAW);
+				printf("\n");
+				continue;
+			}
+
+			/* Iterate over all translations of the found language dict, and populate our ghash cache. */
+			while (PyDict_Next(lang_dict, &ppos, &pykey, &trans)) {
+				GHashKey *key;
+				const char *msgctxt = NULL, *msgid = NULL;
+				bool invalid_key = false;
+
+				if ((PyTuple_CheckExact(pykey) == false) || (PyTuple_GET_SIZE(pykey) != 2)) {
+					invalid_key = true;
+				}
+				else {
+					PyObject *tmp = PyTuple_GET_ITEM(pykey, 0);
+					if (tmp == Py_None) {
+						msgctxt = BLF_I18NCONTEXT_DEFAULT_BPY;
+					}
+					else if (PyUnicode_Check(tmp)) {
+						msgctxt = _PyUnicode_AsString(tmp);
+					}
+					else {
+						invalid_key = true;
+					}
+
+					tmp = PyTuple_GET_ITEM(pykey, 1);
+					if (PyUnicode_Check(tmp)) {
+						msgid = _PyUnicode_AsString(tmp);
+					}
+					else {
+						invalid_key = true;
+					}
+				}
+
+				if (invalid_key) {
+					printf("WARNING! In translations' dict of \"");
+					PyObject_Print(uuid, stdout, Py_PRINT_RAW);
+					printf("\", %s language:\n", locale);
+					printf("    Keys must be tuples of (msgctxt [string or None], msgid [string]), "
+					       "this one is not valid, skipping: ");
+					PyObject_Print(pykey, stdout, Py_PRINT_RAW);
+					printf("\n");
+					continue;
+				}
+				if (PyUnicode_Check(trans) == false) {
+					printf("WARNING! In translations' dict of \"");
+					PyObject_Print(uuid, stdout, Py_PRINT_RAW);
+					printf("\":\n");
+					printf("    Values must be strings, this one is not valid, skipping: ");
+					PyObject_Print(trans, stdout, Py_PRINT_RAW);
+					printf("\n");
+					continue;
+				}
+
+				key = _ghashutil_keyalloc(msgctxt, msgid);
+
+				/* Do not overwrite existing keys! */
+				if (BLI_ghash_lookup(_translations_cache, (void *)key)) {
+					continue;
+				}
+
+				BLI_ghash_insert(_translations_cache, key, BLI_strdup(_PyUnicode_AsString(trans)));
+			}
+		}
+	}
+
+	/* Clean up! */
+	if (language)
+		MEM_freeN(language);
+	if (language_country)
+		MEM_freeN(language_country);
+	if (language_variant)
+		MEM_freeN(language_variant);
+}
+
+const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *msgid)
+{
+#define STATIC_LOCALE_SIZE 32  /* Should be more than enough! */
+
+	GHashKey *key;
+	static char locale[STATIC_LOCALE_SIZE] = "";
+	const char *tmp;
+
+	/* Just in case, should never happen! */
+	if (!_translations)
+		return msgid;
+
+	tmp = BLF_lang_get();
+	if (strcmp(tmp, locale) || !_translations_cache) {
+		PyGILState_STATE _py_state;
+
+		BLI_strncpy(locale, tmp, STATIC_LOCALE_SIZE);
+
+		/* Locale changed or cache does not exist, refresh the whole cache! */
+		/* This func may be called from C (i.e. outside of python interpreter 'context'). */
+		_py_state = PyGILState_Ensure();
+
+		_build_translations_cache(_translations->py_messages, locale);
+
+		PyGILState_Release(_py_state);
+	}
+
+	/* And now, simply create the key (context, messageid) and find it in the cached dict! */
+	key = _ghashutil_keyalloc(msgctxt, msgid);
+
+	tmp = BLI_ghash_lookup(_translations_cache, key);
+
+	_ghashutil_keyfree((void *)key);
+
+	return tmp ? tmp : msgid;
+
+#undef STATIC_LOCALE_SIZE
+}
+
+#endif  /* WITH_INTERNATIONAL */
+
+PyDoc_STRVAR(app_translations_py_messages_register_doc,
+".. method:: register(module_name, translations_dict)\n"
+"\n"
+"   Registers an addon's UI translations.\n"
+"\n"
+"   Note: Does nothing when Blender is built without internationalization support.\n"
+"\n"
+"   :arg module_name: The name identifying the addon.\n"
+"   :type module_name: string\n"
+"   :arg translations_dict: A dictionary built like that:\n"
+"       {locale: {msg_key: msg_translation, ...}, ...}\n"
+"   :type translations_dict: dict\n"
+"\n"
+);
+static PyObject *app_translations_py_messages_register(BlenderAppTranslations *self, PyObject *args, PyObject *kw)
+{
+#ifdef WITH_INTERNATIONAL
+	static const char *kwlist[] = {"module_name", "translations_dict", NULL};
+	PyObject *module_name, *uuid_dict;
+
+	if (!PyArg_ParseTupleAndKeywords(args, kw, "O!O!:bpy.app.translations.register", (char **)kwlist, &PyUnicode_Type,
+	                                 &module_name, &PyDict_Type, &uuid_dict))
+	{
+		return NULL;
+	}
+
+	if (PyDict_Contains(self->py_messages, module_name)) {
+		PyErr_Format(PyExc_ValueError,
+		             "bpy.app.translations.register: translations message cache already contains some data for "
+		             "addon '%s'", (const char *)_PyUnicode_AsString(module_name));
+		return NULL;
+	}
+
+	PyDict_SetItem(self->py_messages, module_name, uuid_dict);
+
+	/* Clear cached messages dict! */
+	_clear_translations_cache();
+#else
+	(void)self;
+	(void)args;
+	(void)kw;
+#endif
+
+	/* And we are done! */
+	Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(app_translations_py_messages_unregister_doc,
+".. method:: unregister(module_name)\n"
+"\n"
+"   Unregisters an addon's UI translations.\n"
+"\n"
+"   Note: Does nothing when Blender is built without internationalization support.\n"
+"\n"
+"   :arg module_name: The name identifying the addon.\n"
+"   :type module_name: string\n"
+"\n"
+);
+static PyObject *app_translations_py_messages_unregister(BlenderAppTranslations *self, PyObject *args, PyObject *kw)
+{
+#ifdef WITH_INTERNATIONAL
+	static const char *kwlist[] = {"module_name", NULL};
+	PyObject *module_name;
+
+	if (!PyArg_ParseTupleAndKeywords(args, kw, "O!:bpy.app.translations.unregister", (char **)kwlist, &PyUnicode_Type,
+	                                 &module_name))
+	{
+		return NULL;
+	}
+
+	if (PyDict_Contains(self->py_messages, module_name)) {
+		PyDict_DelItem(self->py_messages, module_name);
+		/* Clear cached messages ghash! */
+		_clear_translations_cache();
+	}
+#else
+	(void)self;
+	(void)args;
+	(void)kw;
+#endif
+
+	/* And we are done! */
+	Py_RETURN_NONE;
+}
+
+/***** C-defined contexts *****/
+/* This is always available (even when WITH_INTERNATIONAL is not defined). */
+
+static PyTypeObject BlenderAppTranslationsContextsType;
+
+static BLF_i18n_contexts_descriptor _contexts[] = BLF_I18NCONTEXTS_DESC;
+
+/* These fields are just empty placeholders, actual values get set in app_translations_struct().
+ * This allows us to avoid many handwriting, and above all, to keep all context definition stuff in BLF_translation.h!
+ */
+static PyStructSequence_Field
+app_translations_contexts_fields[sizeof(_contexts) / sizeof(BLF_i18n_contexts_descriptor)] = {{NULL}};
+
+static PyStructSequence_Desc app_translations_contexts_desc = {
+	(char *)"bpy.app.translations.contexts",     /* name */
+	(char *)"This named tuple contains all pre-defined translation contexts",    /* doc */
+	app_translations_contexts_fields,    /* fields */
+	(sizeof(app_translations_contexts_fields) / sizeof(PyStructSequence_Field)) - 1
+};
+
+static PyObject *app_translations_contexts_make(void)
+{
+	PyObject *translations_contexts;
+	BLF_i18n_contexts_descriptor *ctxt;
+	int pos = 0;
+
+	translations_contexts = PyStructSequence_New(&BlenderAppTranslationsContextsType);
+	if (translations_contexts == NULL) {
+		return NULL;
+	}
+
+#define SetObjString(item) PyStructSequence_SET_ITEM(translations_contexts, pos++, PyUnicode_FromString((item)))
+#define SetObjNone() Py_INCREF(Py_None); PyStructSequence_SET_ITEM(translations_contexts, pos++, Py_None)
+
+	for (ctxt = _contexts; ctxt->c_id; ctxt++) {
+		if (ctxt->value) {
+			SetObjString(ctxt->value);
+		}
+		else {
+			SetObjNone();
+		}
+	}
+
+#undef SetObjString
+#undef SetObjNone
+
+	return translations_contexts;
+}
+
+/***** Main BlenderAppTranslations Py object definition *****/
+
+PyDoc_STRVAR(app_translations_contexts_doc,
+	"A named tuple containing all pre-defined translation contexts.\n"
+	"WARNING: Never use a (new) context starting with \"" BLF_I18NCONTEXT_DEFAULT_BPY "\", it would be internally "
+	"assimilated as the default one!\n"
+);
+
+PyDoc_STRVAR(app_translations_contexts_C_to_py_doc,
+	"A readonly dict mapping contexts' C-identifiers to their py-identifiers."
+);
+
+PyMemberDef app_translations_members[] = {
+	{(char *)"contexts", T_OBJECT_EX, offsetof(BlenderAppTranslations, contexts), READONLY,
+	                     app_translations_contexts_doc},
+	{(char *)"contexts_C_to_py", T_OBJECT_EX, offsetof(BlenderAppTranslations, contexts_C_to_py), READONLY,
+	                             app_translations_contexts_C_to_py_doc},
+	{NULL}
+};
+
+PyDoc_STRVAR(app_translations_locale_doc,
+	"The actual locale currently in use (will always return a void string when Blender is built without "
+	"internationalization support)."
+);
+static PyObject *app_translations_locale_get(PyObject *UNUSED(self), void *UNUSED(userdata))
+{
+	return PyUnicode_FromString(BLF_lang_get());
+}
+
+/* Note: defining as getter, as (even if quite unlikely), this *may* change during runtime... */
+PyDoc_STRVAR(app_translations_locales_doc, "All locales currently known by Blender (i.e. available as translations).");
+static PyObject *app_translations_locales_get(PyObject *UNUSED(self), void *UNUSED(userdata))
+{
+	PyObject *ret;
+	EnumPropertyItem *it, *items = BLF_RNA_lang_enum_properties();
+	int num_locales = 0, pos = 0;
+
+	if (items) {
+		/* This is not elegant, but simple! */
+		for (it = items; it->identifier; it++) {
+			if (it->value)
+				num_locales++;
+		}
+	}
+
+	ret = PyTuple_New(num_locales);
+
+	if (items) {
+		for (it = items; it->identifier; it++) {
+			if (it->value)
+				PyTuple_SET_ITEM(ret, pos++, PyUnicode_FromString(it->description));
+		}
+	}
+
+	return ret;
+}
+
+PyGetSetDef app_translations_getseters[] = {
+	/* {name, getter, setter, doc, userdata} */
+	{(char *)"locale", (getter)app_translations_locale_get, NULL, app_translations_locale_doc, NULL},
+	{(char *)"locales", (getter)app_translations_locales_get, NULL, app_translations_locales_doc, NULL},
+	{NULL}
+};
+
+/* pgettext helper. */
+static PyObject *_py_pgettext(PyObject *args, PyObject *kw, const char *(*_pgettext)(const char *, const char *))
+{
+	static const char *kwlist[] = {"msgid", "msgctxt", NULL};
+
+#ifdef WITH_INTERNATIONAL
+	char *msgid, *msgctxt = NULL;
+
+	if (!PyArg_ParseTupleAndKeywords(args, kw,
+	                                 "s|z:bpy.app.translations.pgettext",
+	                                 (char **)kwlist, &msgid, &msgctxt))
+	{
+		return NULL;
+	}
+
+	return PyUnicode_FromString((*_pgettext)(msgctxt ? msgctxt : BLF_I18NCONTEXT_DEFAULT, msgid));
+#else
+	PyObject *msgid, *msgctxt;
+	(void)_pgettext;
+
+	if (!PyArg_ParseTupleAndKeywords(args, kw,
+	                                 "O|O:bpy.app.translations.pgettext",
+	                                 (char **)kwlist, &msgid, &msgctxt))
+	{
+		return NULL;
+	}
+
+	Py_INCREF(msgid);
+
+	return msgid;
+#endif
+}
+
+PyDoc_STRVAR(app_translations_pgettext_doc,
+".. method:: pgettext(msgid, msgctxt)\n"
+"\n"
+"   Try to translate the given msgid (with optional msgctxt).\n"
+"   NOTE: The (msgid, msgctxt) parameter orders has been switched compared to gettext function, to allow\n"
+"         single-parameter calls (context then defaults to BLF_I18NCONTEXT_DEFAULT).\n"
+"   NOTE: You should really rarely need to use this function in regular addon code, as all translation should be\n"
+"         handled by Blender internal code. The only exception are string containing formatting (like \"File: %r\"),\n"
+"         but you should rather use pgettext_iface/_tip in those cases!\n"
+"   Note: Does nothing when Blender is built without internationalization support (hence always returns msgid).\n"
+"\n"
+"   :arg msgid: The string to translate.\n"
+"   :type msgid: string\n"
+"   :arg msgctxt: The translation context.\n"
+"   :type msgctxt: string or None\n"
+"   :default msgctxt: BLF_I18NCONTEXT_DEFAULT value.\n"
+"   :return: The translated string (or msgid if no translation was found).\n"
+"\n"
+);
+static PyObject *app_translations_pgettext(BlenderAppTranslations *UNUSED(self), PyObject *args, PyObject *kw)
+{
+	return _py_pgettext(args, kw, BLF_pgettext);
+}
+
+PyDoc_STRVAR(app_translations_pgettext_iface_doc,
+".. method:: pgettext_iface(msgid, msgctxt)\n"
+"\n"
+"   Try to translate the given msgid (with optional msgctxt), if labels' translation is enabled.\n"
+"   NOTE: See pgettext notes.\n"
+"\n"
+"   :arg msgid: The string to translate.\n"
+"   :type msgid: string\n"
+"   :arg msgctxt: The translation context.\n"
+"   :type msgctxt: string or None\n"
+"   :default msgctxt: BLF_I18NCONTEXT_DEFAULT value.\n"
+"   :return: The translated string (or msgid if no translation was found).\n"
+"\n"
+);
+static PyObject *app_translations_pgettext_iface(BlenderAppTranslations *UNUSED(self), PyObject *args, PyObject *kw)
+{
+	return _py_pgettext(args, kw, BLF_translate_do_iface);
+}
+
+PyDoc_STRVAR(app_translations_pgettext_tip_doc,
+".. method:: pgettext(msgid, msgctxt)\n"
+"\n"
+"   Try to translate the given msgid (with optional msgctxt), if tooltips' translation is enabled.\n"
+"   NOTE: See pgettext notes.\n"
+"\n"
+"   :arg msgid: The string to translate.\n"
+"   :type msgid: string\n"
+"   :arg msgctxt: The translation context.\n"
+"   :type msgctxt: string or None\n"
+"   :default msgctxt: BLF_I18NCONTEXT_DEFAULT value.\n"
+"   :return: The translated string (or msgid if no translation was found).\n"
+"\n"
+);
+static PyObject *app_translations_pgettext_tip(BlenderAppTranslations *UNUSED(self), PyObject *args, PyObject *kw)
+{
+	return _py_pgettext(args, kw, BLF_translate_do_tooltip);
+}
+
+PyDoc_STRVAR(app_translations_locale_explode_doc,
+".. method:: locale_explode(locale)\n"
+"\n"
+"   Return all components and their combinations  of the given ISO locale string.\n"
+"\n"
+"   >>> bpy.app.translations.locale_explode(\"sr_RS at latin\")\n"
+"   (\"sr\", \"RS\", \"latin\", \"sr_RS\", \"sr at latin\")\n"
+"\n"
+"   For non-complete locales, missing elements will be None.\n"
+"\n"
+"   :arg locale: The ISO locale string to explode.\n"
+"   :type msgid: string\n"
+"   :return: A tuple (language, country, variant, language_country, language at variant).\n"
+"\n"
+);
+static PyObject *app_translations_locale_explode(BlenderAppTranslations *UNUSED(self), PyObject *args, PyObject *kw)
+{
+	static const char *kwlist[] = {"locale", NULL};
+	const char *locale;
+	char *language, *country, *variant, *language_country, *language_variant;
+
+	if (!PyArg_ParseTupleAndKeywords(args, kw, "s:bpy.app.translations.locale_explode", (char **)kwlist, &locale)) {
+		return NULL;
+	}
+
+	BLF_locale_explode(locale, &language, &country, &variant, &language_country, &language_variant);
+
+	return Py_BuildValue("sssss", language, country, variant, language_country, language_variant);
+}
+
+PyMethodDef app_translations_methods[] = {
+	/* Can't use METH_KEYWORDS alone, see http://bugs.python.org/issue11587 */
+	{(char *)"register", (PyCFunction)app_translations_py_messages_register, METH_VARARGS | METH_KEYWORDS,
+	                     app_translations_py_messages_register_doc},
+	{(char *)"unregister", (PyCFunction)app_translations_py_messages_unregister, METH_VARARGS | METH_KEYWORDS,
+	                       app_translations_py_messages_unregister_doc},
+	{(char *)"pgettext", (PyCFunction)app_translations_pgettext, METH_VARARGS | METH_KEYWORDS | METH_STATIC,
+	                     app_translations_pgettext_doc},
+	{(char *)"pgettext_iface", (PyCFunction)app_translations_pgettext_iface, METH_VARARGS | METH_KEYWORDS | METH_STATIC,
+	                           app_translations_pgettext_iface_doc},
+	{(char *)"pgettext_tip", (PyCFunction)app_translations_pgettext_tip, METH_VARARGS | METH_KEYWORDS | METH_STATIC,
+	                         app_translations_pgettext_tip_doc},
+	{(char *)"locale_explode", (PyCFunction)app_translations_locale_explode, METH_VARARGS | METH_KEYWORDS | METH_STATIC,
+	                           app_translations_locale_explode_doc},
+	{NULL}
+};
+
+static PyObject *app_translations_new(PyTypeObject *type, PyObject *UNUSED(args), PyObject *UNUSED(kw))
+{
+/*	printf("%s (%p)\n", __func__, _translations); */
+
+	if (!_translations) {
+		_translations = (BlenderAppTranslations *)type->tp_alloc(type, 0);
+		if (_translations) {
+			PyObject *py_ctxts;
+			BLF_i18n_contexts_descriptor *ctxt;
+
+			_translations->contexts = app_translations_contexts_make();
+
+			py_ctxts = PyDict_New();
+			for (ctxt = _contexts; ctxt->c_id; ctxt++) {
+				PyObject *val = PyUnicode_FromString(ctxt->py_id);
+				PyDict_SetItemString(py_ctxts, ctxt->c_id, val);
+				Py_DECREF(val);
+			}
+			_translations->contexts_C_to_py = PyDictProxy_New(py_ctxts);
+			Py_DECREF(py_ctxts);  /* The actual dict is only owned by its proxy */
+
+			_translations->py_messages = PyDict_New();
+		}
+	}
+
+	return (PyObject *)_translations;
+}
+
+static void app_translations_free(void *obj)
+{
+	PyObject_Del(obj);
+#ifdef WITH_INTERNATIONAL
+	_clear_translations_cache();
+#endif
+}
+
+PyDoc_STRVAR(app_translations_doc,
+"   This object contains some data/methods regarding internationalization in Blender, and allows every py script\n"
+"   to feature translations for its own UI messages.\n"
+"\n"
+"   WARNING: Most of this object should only be useful if you actually manipulate i18n stuff from Python.\n"
+"            If you are a regular addon, you should only bother about :contexts: and :context_sep: members, and the \n"
+"            :register:/:unregister: functions!"
+"\n"
+"   To add translations to your python script, you must define a dictionary formatted like that:\n"
+"       {locale: {msg_key: msg_translation, ...}, ...}\n"
+"       where:\n"
+"           locale is either a lang iso code (e.g. 'fr'), a lang+country code (e.g. 'pt_BR'),\n"
+"                  a lang+variant code (e.g. 'sr at latin'), or a full code (e.g. 'uz_UZ at cyrilic').\n"
+"           msg_key is a tuple (context, org message) - use, as much as possible, the predefined :contexts:.\n"
+"           msg_translation is the translated message in given language!"
+"   Then, call bpy.app.translations.register(__name__, your_dict) in your register() function, and \n"
+"   bpy.app.translations.unregister(__name__) in your unregister() one.\n"
+"\n"
+"   bl_i18n_utils module has several functions to help you collect strings to translate, and generate the needed\n"
+"   python code (the translation dictionary), as well as optional intermediary po files if you want some...\n"
+"   See its documentation for more details.\n"
+"\n"
+);
+static PyTypeObject BlenderAppTranslationsType = {
+	PyVarObject_HEAD_INIT(NULL, 0)
+	                            /* tp_name */
+	(char *)"bpy.app._translations_type",
+	                            /* tp_basicsize */
+	sizeof(BlenderAppTranslations),
+	0,                          /* tp_itemsize */
+	/* methods */
+	/* No destructor, this is a singleton! */
+	NULL,                       /* tp_dealloc */
+	NULL,                       /* printfunc tp_print; */
+	NULL,                       /* getattrfunc tp_getattr; */
+	NULL,                       /* setattrfunc tp_setattr; */
+	NULL,                       /* tp_compare */ /* DEPRECATED in python 3.0! */
+	NULL,                       /* tp_repr */
+
+	/* Method suites for standard classes */
+	NULL,                       /* PyNumberMethods *tp_as_number; */
+	NULL,                       /* PySequenceMethods *tp_as_sequence; */
+	NULL,                       /* PyMappingMethods *tp_as_mapping; */
+
+	/* More standard operations (here for binary compatibility) */
+	NULL,                       /* hashfunc tp_hash; */
+	NULL,                       /* ternaryfunc tp_call; */
+	NULL,                       /* reprfunc tp_str; */
+	NULL,                       /* getattrofunc tp_getattro; */
+	NULL,                       /* setattrofunc tp_setattro; */
+
+	/* Functions to access object as input/output buffer */
+	NULL,                       /* PyBufferProcs *tp_as_buffer; */
+
+	/*** Flags to define presence of optional/expanded features ***/
+	Py_TPFLAGS_DEFAULT,         /* long tp_flags; */
+
+	app_translations_doc,       /* char *tp_doc;  Documentation string */
+
+	/*** Assigned meaning in release 2.0 ***/
+	/* call function for all accessible objects */
+	NULL,                       /* traverseproc tp_traverse; */
+
+	/* delete references to contained objects */
+	NULL,                       /* inquiry tp_clear; */
+
+	/***  Assigned meaning in release 2.1 ***/
+	/*** rich comparisons ***/
+	NULL,                       /* richcmpfunc tp_richcompare; */
+
+	/***  weak reference enabler ***/
+	0,                          /* long tp_weaklistoffset */
+
+	/*** Added in release 2.2 ***/
+	/*   Iterators */
+	NULL,                       /* getiterfunc tp_iter; */
+	NULL,                       /* iternextfunc tp_iternext; */
+
+	/*** Attribute descriptor and subclassing stuff ***/
+	app_translations_methods,   /* struct PyMethodDef *tp_methods; */
+	app_translations_members,   /* struct PyMemberDef *tp_members; */
+	app_translations_getseters, /* struct PyGetSetDef *tp_getset; */
+	NULL,                       /* struct _typeobject *tp_base; */
+	NULL,                       /* PyObject *tp_dict; */
+	NULL,                       /* descrgetfunc tp_descr_get; */
+	NULL,                       /* descrsetfunc tp_descr_set; */
+	0,                          /* long tp_dictoffset; */
+	NULL,                       /* initproc tp_init; */
+	NULL,                       /* allocfunc tp_alloc; */
+	                            /* newfunc tp_new; */
+	(newfunc)app_translations_new,
+	/*  Low-level free-memory routine */
+	app_translations_free,      /* freefunc tp_free;  */
+	/* For PyObject_IS_GC */
+	NULL,                       /* inquiry tp_is_gc;  */
+	NULL,                       /* PyObject *tp_bases; */
+	/* method resolution order */
+	NULL,                       /* PyObject *tp_mro;  */
+	NULL,                       /* PyObject *tp_cache; */
+	NULL,                       /* PyObject *tp_subclasses; */
+	NULL,                       /* PyObject *tp_weaklist; */
+	NULL
+};
+
+PyObject *BPY_app_translations_struct(void)
+{
+	PyObject *ret;
+
+	/* Let's finalize our contexts structseq definition! */
+	{
+		BLF_i18n_contexts_descriptor *ctxt;
+		PyStructSequence_Field *desc;
+
+		/* We really populate the contexts' fields here! */
+		for (ctxt = _contexts, desc = app_translations_contexts_desc.fields; ctxt->c_id; ctxt++, desc++) {
+			desc->name = (char *)ctxt->py_id;
+			desc->doc = NULL;
+		}
+		desc->name = desc->doc = NULL;  /* End sentinel! */
+
+		PyStructSequence_InitType(&BlenderAppTranslationsContextsType, &app_translations_contexts_desc);
+	}
+
+	if (PyType_Ready(&BlenderAppTranslationsType) < 0)
+		return NULL;
+
+	ret = PyObject_CallObject((PyObject *)&BlenderAppTranslationsType, NULL);
+
+	/* prevent user from creating new instances */
+	BlenderAppTranslationsType.tp_new = NULL;
+	/* without this we can't do set(sys.modules) [#29635] */
+	BlenderAppTranslationsType.tp_hash = (hashfunc)_Py_HashPointer;
+
+	return ret;
+}
diff --git a/source/blender/python/intern/bpy_app_translations.h b/source/blender/python/intern/bpy_app_translations.h
new file mode 100644
index 0000000..7043075
--- /dev/null
+++ b/source/blender/python/intern/bpy_app_translations.h
@@ -0,0 +1,32 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Bastien Montagne
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/intern/bpy_app_translations.h
+ *  \ingroup pythonintern
+ */
+
+#ifndef __BPY_APP_TRANSLATIONS_H__
+#define __BPY_APP_TRANSLATIONS_H__
+
+PyObject *BPY_app_translations_struct(void);
+
+#endif /* __BPY_APP_TRANSLATIONS_H__ */
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index e9fa00c..90199a4 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -310,11 +310,33 @@ void BPY_python_start(int argc, const char **argv)
 	(void)argv;
 
 	/* must run before python initializes */
-	PyImport_ExtendInittab(bpy_internal_modules);
+	/* broken in py3.3, load explicitly below */
+	// PyImport_ExtendInittab(bpy_internal_modules);
 #endif
 
 	bpy_intern_string_init();
 
+
+#ifdef WITH_PYTHON_MODULE
+	{
+		/* Manually load all modules */
+		struct _inittab *inittab_item;
+		PyObject *sys_modules = PyImport_GetModuleDict();
+
+		for (inittab_item = bpy_internal_modules; inittab_item->name; inittab_item++) {
+			PyObject *mod = inittab_item->initfunc();
+			if (mod) {
+				PyDict_SetItemString(sys_modules, inittab_item->name, mod);
+			}
+			else {
+				PyErr_Print();
+				PyErr_Clear();
+			}
+			// Py_DECREF(mod); /* ideally would decref, but in this case we never want to free */
+		}
+	}
+#endif
+
 	/* bpy.* and lets us import it */
 	BPy_init_modules();
 
@@ -743,6 +765,7 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
 
 		//result->ptr = ((BPy_StructRNA *)item)->ptr;
 		CTX_data_pointer_set(result, ptr->id.data, ptr->type, ptr->data);
+		CTX_data_type_set(result, CTX_DATA_TYPE_POINTER);
 		done = true;
 	}
 	else if (PySequence_Check(item)) {
@@ -773,12 +796,12 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
 
 			}
 			Py_DECREF(seq_fast);
-
+			CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
 			done = true;
 		}
 	}
 
-	if (done == 0) {
+	if (done == false) {
 		if (item) printf("PyContext '%s' not a valid type\n", member);
 		else      printf("PyContext '%s' not found\n", member);
 	}
@@ -905,3 +928,20 @@ static void bpy_module_free(void *UNUSED(mod))
 }
 
 #endif
+
+
+/* EVIL, define text.c functions here... */
+extern int text_check_identifier_unicode(const unsigned int ch);
+extern int text_check_identifier_nodigit_unicode(const unsigned int ch);
+extern int text_check_identifier(const char ch);
+extern int text_check_identifier_nodigit(const char ch);
+
+int text_check_identifier_unicode(const unsigned int ch)
+{
+	return (ch < 255 && text_check_identifier((char)ch)) || Py_UNICODE_ISALNUM(ch);
+}
+
+int text_check_identifier_nodigit_unicode(const unsigned int ch)
+{
+	return (ch < 255 && text_check_identifier_nodigit((char)ch)) || Py_UNICODE_ISALPHA(ch);
+}
diff --git a/source/blender/python/intern/bpy_intern_string.c b/source/blender/python/intern/bpy_intern_string.c
index 70ea57b..294f230 100644
--- a/source/blender/python/intern/bpy_intern_string.c
+++ b/source/blender/python/intern/bpy_intern_string.c
@@ -35,6 +35,7 @@
 PyObject *bpy_intern_str_register;
 PyObject *bpy_intern_str_unregister;
 PyObject *bpy_intern_str_bl_rna;
+PyObject *bpy_intern_str_bl_property;
 PyObject *bpy_intern_str_order;
 PyObject *bpy_intern_str_attr;
 PyObject *bpy_intern_str___slots__;
@@ -46,6 +47,7 @@ void bpy_intern_string_init(void)
 	bpy_intern_str_register = PyUnicode_FromString("register");
 	bpy_intern_str_unregister = PyUnicode_FromString("unregister");
 	bpy_intern_str_bl_rna = PyUnicode_FromString("bl_rna");
+	bpy_intern_str_bl_property = PyUnicode_FromString("bl_property");
 	bpy_intern_str_order = PyUnicode_FromString("order");
 	bpy_intern_str_attr = PyUnicode_FromString("attr");
 	bpy_intern_str___slots__ = PyUnicode_FromString("__slots__");
@@ -58,6 +60,7 @@ void bpy_intern_string_exit(void)
 	Py_DECREF(bpy_intern_str_register);
 	Py_DECREF(bpy_intern_str_unregister);
 	Py_DECREF(bpy_intern_str_bl_rna);
+	Py_DECREF(bpy_intern_str_bl_property);
 	Py_DECREF(bpy_intern_str_order);
 	Py_DECREF(bpy_intern_str_attr);
 	Py_DECREF(bpy_intern_str___slots__);
diff --git a/source/blender/python/intern/bpy_intern_string.h b/source/blender/python/intern/bpy_intern_string.h
index 0b7ca2c..2e0d18d 100644
--- a/source/blender/python/intern/bpy_intern_string.h
+++ b/source/blender/python/intern/bpy_intern_string.h
@@ -30,6 +30,7 @@ void bpy_intern_string_exit(void);
 extern PyObject *bpy_intern_str_register;
 extern PyObject *bpy_intern_str_unregister;
 extern PyObject *bpy_intern_str_bl_rna;
+extern PyObject *bpy_intern_str_bl_property;
 extern PyObject *bpy_intern_str_order;
 extern PyObject *bpy_intern_str_attr;
 extern PyObject *bpy_intern_str___slots__;
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index cb2e12b..9d92ff5 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -29,10 +29,8 @@
  * functionality.
  */
 
-
 #include <Python.h>
 
-#include "bpy_operator_wrap.h"
 #include "WM_api.h"
 #include "WM_types.h"
 
@@ -42,6 +40,8 @@
 #include "RNA_define.h"
 
 #include "bpy_rna.h"
+#include "bpy_intern_string.h"
+#include "bpy_operator_wrap.h"  /* own include */
 
 static void operator_properties_init(wmOperatorType *ot)
 {
@@ -57,6 +57,66 @@ static void operator_properties_init(wmOperatorType *ot)
 		PyErr_Print(); /* failed to register operator props */
 		PyErr_Clear();
 	}
+
+	/* set the default property: ot->prop */
+	{
+		/* picky developers will notice that 'bl_property' won't work with inheritance
+		 * get direct from the dict to avoid raising a load of attribute errors (yes this isnt ideal) - campbell */
+		PyTypeObject *py_class = ot->ext.data;
+		PyObject *py_class_dict = py_class->tp_dict;
+		PyObject *bl_property = PyDict_GetItem(py_class_dict, bpy_intern_str_bl_property);
+		const char *prop_id;
+		bool prop_raise_error;
+
+		if (bl_property) {
+			if (PyUnicode_Check(bl_property)) {
+				/* since the property is explicitly given, raise an error if its not found */
+				prop_id = _PyUnicode_AsString(bl_property);
+				prop_raise_error = true;
+			}
+			else {
+				PyErr_Format(PyExc_ValueError,
+				             "%.200s.bl_property should be a string, not %.200s",
+				             ot->idname, Py_TYPE(bl_property)->tp_name);
+
+				/* this could be done cleaner, for now its OK */
+				PyErr_Print();
+				PyErr_Clear();
+
+				prop_id = NULL;
+				prop_raise_error = false;
+			}
+		}
+		else {
+			/* fallback to hard-coded string (pre 2.66, could be deprecated) */
+			prop_id = "type";
+			prop_raise_error = false;
+		}
+
+		if (prop_id) {
+			PointerRNA ptr;
+			PropertyRNA *prop;
+
+			RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
+			prop = RNA_struct_find_property(&ptr, prop_id);
+			if (prop) {
+				ot->prop = prop;
+			}
+			else {
+				if (prop_raise_error) {
+					PyErr_Format(PyExc_ValueError,
+					             "%.200s.bl_property '%.200s' not found",
+					             ot->idname, prop_id);
+
+					/* this could be done cleaner, for now its OK */
+					PyErr_Print();
+					PyErr_Clear();
+				}
+			}
+		}
+	}
+	/* end 'ot->prop' assignment */
+
 }
 
 void operator_wrapper(wmOperatorType *ot, void *userdata)
@@ -68,18 +128,6 @@ void operator_wrapper(wmOperatorType *ot, void *userdata)
 	ot->srna = srna; /* restore */
 
 	operator_properties_init(ot);
-
-	/* XXX - not nice, set the first enum as searchable, should have a way for python to set */
-	{
-		PointerRNA ptr;
-		PropertyRNA *prop;
-
-		RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
-		prop = RNA_struct_find_property(&ptr, "type");
-		if (prop) {
-			ot->prop = prop;
-		}
-	}
 }
 
 void macro_wrapper(wmOperatorType *ot, void *userdata)
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index f3fa0c9..830c2c8 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -74,13 +74,15 @@ static EnumPropertyItem property_flag_enum_items[] = {
 	{0, NULL, 0, NULL, NULL}};
 
 /* subtypes */
+/* XXX Keep in sync with rna_rna.c's property_subtype_items ???
+ *     Currently it is not...
+ */
 static EnumPropertyItem property_subtype_string_items[] = {
 	{PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""},
 	{PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""},
 	{PROP_FILENAME, "FILE_NAME", 0, "Filename", ""},
 	{PROP_BYTESTRING, "BYTE_STRING", 0, "Byte String", ""},
-	{PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
-	{PROP_PASSWORD, "PASSWORD", 0, "Password", 0},
+	{PROP_PASSWORD, "PASSWORD", 0, "Password", "A string that is displayed hidden ('********')"},
 
 	{PROP_NONE, "NONE", 0, "None", ""},
 	{0, NULL, 0, NULL, NULL}};
@@ -1257,6 +1259,20 @@ static size_t strswapbufcpy(char *buf, const char **orig)
 }
 #endif
 
+static int icon_id_from_name(const char *name)
+{
+	EnumPropertyItem *item;
+	int id;
+
+	if (name[0]) {
+		for (item = icon_items, id = 0; item->identifier; item++, id++)
+			if (strcmp(item->name, name) == 0)
+				return item->value;
+	}
+	
+	return 0;
+}
+
 static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, int *defvalue, const short is_enum_flag)
 {
 	EnumPropertyItem *items;
@@ -1303,6 +1319,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
 
 	for (i = 0; i < seq_len; i++) {
 		EnumPropertyItem tmp = {0, "", 0, "", ""};
+		const char *tmp_icon = NULL;
 		Py_ssize_t item_size;
 		Py_ssize_t id_str_size;
 		Py_ssize_t name_str_size;
@@ -1312,12 +1329,14 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
 
 		if ((PyTuple_CheckExact(item)) &&
 		    (item_size = PyTuple_GET_SIZE(item)) &&
-		    (item_size == 3 || item_size == 4) &&
+		    (item_size >= 3 && item_size <= 5) &&
 		    (tmp.identifier =  _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
 		    (tmp.name =        _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
 		    (tmp.description = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
 		    /* TODO, number isn't ensured to be unique from the script author */
-		    (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1))
+		    (item_size != 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1) &&
+		    (item_size != 5 || ((tmp_icon = _PyUnicode_AsString(PyTuple_GET_ITEM(item, 3))) &&
+		                        py_long_as_int(PyTuple_GET_ITEM(item, 4), &tmp.value) != -1)))
 		{
 			if (is_enum_flag) {
 				if (item_size < 4) {
@@ -1340,6 +1359,9 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
 				}
 			}
 
+			if (tmp_icon)
+				tmp.icon = icon_id_from_name(tmp_icon);
+
 			items[i] = tmp;
 
 			/* calculate combine string length */
@@ -1349,8 +1371,8 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
 			MEM_freeN(items);
 			PyErr_SetString(PyExc_TypeError,
 			                "EnumProperty(...): expected a tuple containing "
-			                "(identifier, name, description) and optionally a "
-			                "unique number");
+			                "(identifier, name, description) and optionally an "
+			                "icon name and unique number");
 			return NULL;
 		}
 
@@ -2501,7 +2523,7 @@ BPY_PROPDEF_DESC_DOC
 "   :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE', 'ENUM_FLAG', 'LIBRARY_EDITABLE'].\n"
 "   :type options: set\n"
 "   :arg items: sequence of enum items formatted:\n"
-"      [(identifier, name, description, number), ...] where the identifier is used\n"
+"      [(identifier, name, description, icon, number), ...] where the identifier is used\n"
 "      for python access and other values are used for the interface.\n"
 "      Note the item is optional.\n"
 "      For dynamic values a callback can be passed which returns a list in\n"
@@ -2509,7 +2531,7 @@ BPY_PROPDEF_DESC_DOC
 "      This function must take 2 arguments (self, context)\n"
 "      WARNING: Do not use generators here (they will work the first time, but will lead to empty values\n"
 "               in some unload/reload scenarii)!\n"
-"   :type items: sequence of string triplets or a function\n"
+"   :type items: sequence of string triples or a function\n"
 BPY_PROPDEF_UPDATE_DOC
 );
 static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
@@ -2774,12 +2796,17 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject
 }
 
 PyDoc_STRVAR(BPy_RemoveProperty_doc,
-".. function:: RemoveProperty(attr)\n"
+".. function:: RemoveProperty(cls, attr="")\n"
 "\n"
 "   Removes a dynamically defined property.\n"
 "\n"
-"   :arg attr: Property name.\n"
+"   :arg cls: The class containing the property (must be a positional argument).\n"
+"   :type cls: type\n"
+"   :arg attr: Property name (must be passed as a keyword).\n"
 "   :type attr: string\n"
+"\n"
+".. note:: Typically this function doesn't need to be accessed directly.\n"
+"   Instead use ``del cls.attr``\n"
 );
 static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
 {
@@ -2794,7 +2821,7 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw
 		return ret;
 	}
 	else if (PyTuple_GET_SIZE(args) > 1) {
-		PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+		PyErr_SetString(PyExc_ValueError, "expected one positional arg, one keyword arg");
 		return NULL;
 	}
 
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 94f262f..19ec35a 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -1623,9 +1623,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
 					}
 				}
 				else {
-
 					/* Unicode String */
-
 #ifdef USE_STRING_COERCE
 					PyObject *value_coerce = NULL;
 					if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
@@ -1634,12 +1632,6 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
 					}
 					else {
 						param = _PyUnicode_AsString(value);
-#ifdef WITH_INTERNATIONAL
-						if (subtype == PROP_TRANSLATE) {
-							param = IFACE_(param);
-						}
-#endif  /* WITH_INTERNATIONAL */
-
 					}
 #else  /* USE_STRING_COERCE */
 					param = _PyUnicode_AsString(value);
@@ -4524,7 +4516,7 @@ PyDoc_STRVAR(pyrna_prop_collection_foreach_get_doc,
 "\n"
 "   .. code-block:: python\n"
 "\n"
-"      collection.foreach_get(someseq, attr)\n"
+"      collection.foreach_get(attr, someseq)\n"
 "\n"
 "      # Python equivalent\n"
 "      for i in range(len(seq)): someseq[i] = getattr(collection, attr)\n"
@@ -4544,7 +4536,7 @@ PyDoc_STRVAR(pyrna_prop_collection_foreach_set_doc,
 "\n"
 "   .. code-block:: python\n"
 "\n"
-"      collection.foreach_set(seq, attr)\n"
+"      collection.foreach_set(attr, seq)\n"
 "\n"
 "      # Python equivalent\n"
 "      for i in range(len(seq)): setattr(collection[i], attr, seq[i])\n"
@@ -6539,6 +6531,9 @@ static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self)
 
 static PyTypeObject pyrna_basetype_Type = BLANK_PYTHON_TYPE;
 
+/**
+ * Accessed from Python as 'bpy.types'
+ */
 PyObject *BPY_rna_types(void)
 {
 	BPy_BaseTypeRNA *self;
@@ -6854,7 +6849,7 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
 		i++;
 
 		if (item == NULL) {
-			if ((flag & FUNC_REGISTER_OPTIONAL) == 0) {
+			if ((flag & (FUNC_REGISTER_OPTIONAL & ~FUNC_REGISTER)) == 0) {
 				PyErr_Format(PyExc_AttributeError,
 				             "expected %.200s, %.200s class to have an \"%.200s\" attribute",
 				             class_type, py_class_name,
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c
index 3d05f51..91cff67 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -251,6 +251,86 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
 	}
 }
 
+/* Line-Line intersection using algorithm from mathworld.wolfram.com */
+
+PyDoc_STRVAR(M_Geometry_intersect_sphere_sphere_2d_doc,
+".. function:: intersect_sphere_sphere_2d(p_a, radius_a, p_b, radius_b)\n"
+"\n"
+"   Returns 2 points on between intersecting circles.\n"
+"\n"
+"   :arg p_a: Center of the first circle\n"
+"   :type p_a: :class:`mathutils.Vector`\n"
+"   :arg radius_a: Radius of the first circle\n"
+"   :type radius_a: float\n"
+"   :arg p_b: Center of the second circle\n"
+"   :type p_b: :class:`mathutils.Vector`\n"
+"   :arg radius_b: Radius of the second circle\n"
+"   :type radius_b: float\n"
+"   :rtype: tuple of :class:`mathutils.Vector`'s or None when there is no intersection\n"
+);
+static PyObject *M_Geometry_intersect_sphere_sphere_2d(PyObject *UNUSED(self), PyObject *args)
+{
+	PyObject *ret;
+	VectorObject *vec_a, *vec_b;
+	float *v_a, *v_b;
+	float rad_a, rad_b;
+	float v_ab[2];
+	float dist;
+
+	if (!PyArg_ParseTuple(args, "O!fO!f:intersect_sphere_sphere_2d",
+	                      &vector_Type, &vec_a, &rad_a,
+	                      &vector_Type, &vec_b, &rad_b))
+	{
+		return NULL;
+	}
+
+	if (BaseMath_ReadCallback(vec_a) == -1 ||
+	    BaseMath_ReadCallback(vec_b) == -1)
+	{
+		return NULL;
+	}
+
+	ret = PyTuple_New(2);
+
+	v_a = vec_a->vec;
+	v_b = vec_b->vec;
+
+	sub_v2_v2v2(v_ab, v_b, v_a);
+	dist = len_v2(v_ab);
+
+	if (/* out of range */
+	    (dist > rad_a + rad_b) ||
+	    /* fully-contained in the other */
+	    (dist < abs(rad_a - rad_b)) ||
+	    /* co-incident */
+	    (dist < FLT_EPSILON))
+	{
+		/* out of range */
+		PyTuple_SET_ITEM(ret, 0,  Py_None); Py_INCREF(Py_None);
+		PyTuple_SET_ITEM(ret, 1,  Py_None); Py_INCREF(Py_None);
+	}
+	else {
+		const float dist_delta = ((rad_a * rad_a) - (rad_b * rad_b) + (dist * dist)) / (2.0f * dist);
+		const float h = powf(fabsf((rad_a * rad_a) - (dist_delta * dist_delta)), 0.5f);
+		float i_cent[2];
+		float i1[2], i2[2];
+
+		i_cent[0] = v_a[0] + ((v_ab[0] * dist_delta) / dist);
+		i_cent[1] = v_a[1] + ((v_ab[1] * dist_delta) / dist);
+
+		i1[0] = i_cent[0] + h * v_ab[1] / dist;
+		i1[1] = i_cent[1] - h * v_ab[0] / dist;
+
+		i2[0] = i_cent[0] - h * v_ab[1] / dist;
+		i2[1] = i_cent[1] + h * v_ab[0] / dist;
+
+		PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(i1, 2, Py_NEW, NULL));
+		PyTuple_SET_ITEM(ret, 1, Vector_CreatePyObject(i2, 2, Py_NEW, NULL));
+	}
+
+	return ret;
+}
+
 PyDoc_STRVAR(M_Geometry_normal_doc,
 ".. function:: normal(v1, v2, v3, v4=None)\n"
 "\n"
@@ -1376,6 +1456,7 @@ static PyMethodDef M_Geometry_methods[] = {
 	{"intersect_line_sphere", (PyCFunction) M_Geometry_intersect_line_sphere, METH_VARARGS, M_Geometry_intersect_line_sphere_doc},
 	{"intersect_line_sphere_2d", (PyCFunction) M_Geometry_intersect_line_sphere_2d, METH_VARARGS, M_Geometry_intersect_line_sphere_2d_doc},
 	{"distance_point_to_plane", (PyCFunction) M_Geometry_distance_point_to_plane, METH_VARARGS, M_Geometry_distance_point_to_plane_doc},
+	{"intersect_sphere_sphere_2d", (PyCFunction) M_Geometry_intersect_sphere_sphere_2d, METH_VARARGS, M_Geometry_intersect_sphere_sphere_2d_doc},
 	{"area_tri", (PyCFunction) M_Geometry_area_tri, METH_VARARGS, M_Geometry_area_tri_doc},
 	{"normal", (PyCFunction) M_Geometry_normal, METH_VARARGS, M_Geometry_normal_doc},
 	{"barycentric_transform", (PyCFunction) M_Geometry_barycentric_transform, METH_VARARGS, M_Geometry_barycentric_transform_doc},
diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c
index 1c4ab5a..c85df29 100644
--- a/source/blender/quicktime/apple/quicktime_export.c
+++ b/source/blender/quicktime/apple/quicktime_export.c
@@ -905,7 +905,7 @@ int fromcocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
 void SCENE_OT_render_data_set_quicktime_codec(wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name = "Change codec";
+	ot->name = "Change Codec";
 	ot->description = "Change Quicktime codec Settings";
 	ot->idname = "SCENE_OT_render_data_set_quicktime_codec";
 	
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index 7deecb9..eb81e7f 100644
--- a/source/blender/render/CMakeLists.txt
+++ b/source/blender/render/CMakeLists.txt
@@ -54,6 +54,7 @@ set(SRC
 	intern/raytrace/rayobject_qbvh.cpp
 	intern/raytrace/rayobject_rtbuild.cpp
 	intern/raytrace/rayobject_vbvh.cpp
+	intern/source/bake.c
 	intern/source/convertblender.c
 	intern/source/envmap.c
 	intern/source/external_engine.c
diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h
index 64135a1..b687aca 100644
--- a/source/blender/render/extern/include/RE_engine.h
+++ b/source/blender/render/extern/include/RE_engine.h
@@ -62,6 +62,7 @@ struct Scene;
 #define RE_ENGINE_DO_UPDATE		8
 #define RE_ENGINE_RENDERING		16
 #define RE_ENGINE_HIGHLIGHT_TILES	32
+#define RE_ENGINE_USED_FOR_VIEWPORT	64
 
 extern ListBase R_engines;
 
@@ -105,6 +106,7 @@ typedef struct RenderEngine {
 } RenderEngine;
 
 RenderEngine *RE_engine_create(RenderEngineType *type);
+RenderEngine *RE_engine_create_ex(RenderEngineType *type, int use_for_viewport);
 void RE_engine_free(RenderEngine *engine);
 
 void RE_layer_load_from_file(struct RenderLayer *layer, struct ReportList *reports, const char *filename, int x, int y);
diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h
index 2a9a1be..2dfbdd0 100644
--- a/source/blender/render/extern/include/RE_render_ext.h
+++ b/source/blender/render/extern/include/RE_render_ext.h
@@ -49,10 +49,11 @@ struct RNode;
 struct Render;
 struct MTex;
 struct ImBuf;
+struct ImagePool;
 struct DerivedMesh;
 
 /* particle.c, effect.c, editmesh_modes.c and brush.c, returns 1 if rgb, 0 otherwise */
-int	externtex(struct MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta, const int thread);
+int	externtex(struct MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta, const int thread, struct ImagePool *pool);
 
 /* particle.c */
 void texture_rgb_blend(float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype);
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h
index 10045a8..d686de2 100644
--- a/source/blender/render/extern/include/RE_shader_ext.h
+++ b/source/blender/render/extern/include/RE_shader_ext.h
@@ -184,19 +184,24 @@ typedef struct ShadeInput {
 	
 } ShadeInput;
 
+typedef struct BakeImBufuserData {
+	float *displacement_buffer;
+	char *mask_buffer;
+} BakeImBufuserData;
 
 /* node shaders... */
 struct Tex;
 struct MTex;
 struct ImBuf;
+struct ImagePool;
 
 /* this one uses nodes */
-int	multitex_ext(struct Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres);
+int	multitex_ext(struct Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres, struct ImagePool *pool);
 /* nodes disabled */
-int multitex_ext_safe(struct Tex *tex, float texvec[3], struct TexResult *texres);
+int multitex_ext_safe(struct Tex *tex, float texvec[3], struct TexResult *texres, struct ImagePool *pool);
 /* only for internal node usage */
 int multitex_nodes(struct Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres,
-                   const short thread, short which_output, struct ShadeInput *shi, struct MTex *mtex);
+                   const short thread, short which_output, struct ShadeInput *shi, struct MTex *mtex, struct ImagePool *pool);
 
 /* shaded view and bake */
 struct Render;
@@ -206,6 +211,7 @@ struct Object;
 int RE_bake_shade_all_selected(struct Render *re, int type, struct Object *actob, short *do_update, float *progress);
 struct Image *RE_bake_shade_get_image(void);
 void RE_bake_ibuf_filter(struct ImBuf *ibuf, char *mask, const int filter);
+void RE_bake_ibuf_normalize_displacement(struct ImBuf *ibuf, float *displacement, char *mask, float displacement_min, float displacement_max);
 
 #define BAKE_RESULT_OK			0
 #define BAKE_RESULT_NO_OBJECTS		1
diff --git a/source/blender/render/intern/include/envmap.h b/source/blender/render/intern/include/envmap.h
index d0f346f..a6c6d46 100644
--- a/source/blender/render/intern/include/envmap.h
+++ b/source/blender/render/intern/include/envmap.h
@@ -44,9 +44,10 @@
 
 struct Render;
 struct TexResult;
+struct ImagePool;
 
 void make_envmaps(struct Render *re);
-int envmaptex(struct Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres);
+int envmaptex(struct Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres, struct ImagePool *pool);
 
 #endif /* __ENVMAP_H__ */
 
diff --git a/source/blender/render/intern/include/pixelshading.h b/source/blender/render/intern/include/pixelshading.h
index 30d5746..faf8c5f 100644
--- a/source/blender/render/intern/include/pixelshading.h
+++ b/source/blender/render/intern/include/pixelshading.h
@@ -32,6 +32,8 @@
 #ifndef __PIXELSHADING_H__
 #define __PIXELSHADING_H__
 
+struct ImagePool;
+
 /**
  * Render the pixel at (x,y) for object ap. Apply the jitter mask. 
  * Output is given in float collector[4]. The type vector:
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 905b4b4..d65da58 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -62,6 +62,7 @@ struct RayFace;
 struct RenderEngine;
 struct ReportList;
 struct Main;
+struct ImagePool;
 
 #define TABLEINITSIZE 1024
 
@@ -260,6 +261,8 @@ struct Render
 	RenderStats i;
 
 	struct ReportList *reports;
+
+	struct ImagePool *pool;
 };
 
 /* ------------------------------------------------------------------------- */
@@ -373,6 +376,7 @@ struct halosort {
 /* ------------------------------------------------------------------------- */
 struct Material;
 struct MTFace;
+struct ImagePool;
 
 typedef struct RadFace {
 	float unshot[3], totrad[3];
@@ -402,6 +406,7 @@ typedef struct HaloRen {
 	int pixels;
 	unsigned int lay;
 	struct Material *mat;
+	struct ImagePool *pool;
 } HaloRen;
 
 /* ------------------------------------------------------------------------- */
diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h
index 4b9fa2d..2dc12f3 100644
--- a/source/blender/render/intern/include/texture.h
+++ b/source/blender/render/intern/include/texture.h
@@ -60,6 +60,7 @@ struct TexResult;
 struct Tex;
 struct Image;
 struct ImBuf;
+struct ImagePool;
 
 /* texture.h */
 
@@ -76,9 +77,9 @@ void render_realtime_texture(struct ShadeInput *shi, struct Image *ima);
 
 /* imagetexture.h */
 
-int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], const float dxt[2], const float dyt[2], struct TexResult *texres);
-int imagewrap(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], struct TexResult *texres);
-void image_sample(struct Image *ima, float fx, float fy, float dx, float dy, float result[4]);
+int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], const float dxt[2], const float dyt[2], struct TexResult *texres, struct ImagePool *pool);
+int imagewrap(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], struct TexResult *texres, struct ImagePool *pool);
+void image_sample(struct Image *ima, float fx, float fy, float dx, float dy, float result[4], struct ImagePool *pool);
 
 #endif /* __TEXTURE_H__ */
 
diff --git a/source/blender/render/intern/raytrace/rayobject_octree.cpp b/source/blender/render/intern/raytrace/rayobject_octree.cpp
index 658ab9d..e4fd5a6 100644
--- a/source/blender/render/intern/raytrace/rayobject_octree.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_octree.cpp
@@ -667,10 +667,12 @@ static void RE_rayobject_octree_done(RayObject *tree)
 	oc->ocface = NULL;
 	MEM_freeN(oc->ro_nodes);
 	oc->ro_nodes = NULL;
-	
+
+#if 0
 	printf("%f %f - %f\n", oc->min[0], oc->max[0], oc->ocfacx);
 	printf("%f %f - %f\n", oc->min[1], oc->max[1], oc->ocfacy);
 	printf("%f %f - %f\n", oc->min[2], oc->max[2], oc->ocfacz);
+#endif
 }
 
 static void RE_rayobject_octree_bb(RayObject *tree, float *min, float *max)
diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
index d03bdb7..3e80dee 100644
--- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
@@ -38,12 +38,12 @@ int tot_hints    = 0;
 
 #include "MEM_guardedalloc.h"
 
-#include "BKE_global.h"
-
 #include "BLI_math.h"
 #include "BLI_memarena.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_global.h"
+
 #include "rayintersection.h"
 #include "rayobject.h"
 #include "rayobject_rtbuild.h"
diff --git a/source/blender/render/intern/source/bake.c b/source/blender/render/intern/source/bake.c
new file mode 100644
index 0000000..7c5d603
--- /dev/null
+++ b/source/blender/render/intern/source/bake.c
@@ -0,0 +1,1117 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributors: 2004/2005/2006 Blender Foundation, full recode
+ * Contributors: Vertex color baking, Copyright 2011 AutoCRC
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/render/intern/source/bake.c
+ *  \ingroup render
+ */
+
+
+/* system includes */
+#include <stdio.h>
+#include <string.h>
+
+/* External modules: */
+#include "MEM_guardedalloc.h"
+
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_threads.h"
+#include "BLI_utildefines.h"
+
+#include "DNA_image_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+
+#include "BKE_customdata.h"
+#include "BKE_depsgraph.h"
+#include "BKE_global.h"
+#include "BKE_image.h"
+#include "BKE_main.h"
+#include "BKE_node.h"
+#include "BKE_scene.h"
+
+#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
+#include "IMB_colormanagement.h"
+
+/* local include */
+#include "rayintersection.h"
+#include "rayobject.h"
+#include "render_types.h"
+#include "renderdatabase.h"
+#include "shading.h"
+#include "zbuf.h"
+
+#include "PIL_time.h"
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */
+/* only to be used here in this file, it's for speed */
+extern struct Render R;
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+
+/* ************************* bake ************************ */
+
+
+typedef struct BakeShade {
+	ShadeSample ssamp;
+	ObjectInstanceRen *obi;
+	VlakRen *vlr;
+	
+	ZSpan *zspan;
+	Image *ima;
+	ImBuf *ibuf;
+	
+	int rectx, recty, quad, type, vdone;
+	bool ready;
+
+	float dir[3];
+	Object *actob;
+
+	/* Output: vertex color or image data. If vcol is not NULL, rect and
+	 * rect_float should be NULL. */
+	MPoly *mpoly;
+	MLoop *mloop;
+	MLoopCol *vcol;
+	
+	unsigned int *rect;
+	float *rect_float;
+
+	/* displacement buffer used for normalization with unknown maximal distance */
+	bool use_displacement_buffer;
+	float *displacement_buffer;
+	float displacement_min, displacement_max;
+	
+	bool use_mask;
+	char *rect_mask; /* bake pixel mask */
+
+	float dxco[3], dyco[3];
+
+	short *do_update;
+
+	struct ColorSpace *rect_colorspace;
+} BakeShade;
+
+static void bake_set_shade_input(ObjectInstanceRen *obi, VlakRen *vlr, ShadeInput *shi, int quad, int UNUSED(isect), int x, int y, float u, float v)
+{
+	if (quad)
+		shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3);
+	else
+		shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2);
+		
+	/* cache for shadow */
+	shi->samplenr = R.shadowsamplenr[shi->thread]++;
+
+	shi->mask = 0xFFFF; /* all samples */
+
+	shi->u = -u;
+	shi->v = -v;
+	shi->xs = x;
+	shi->ys = y;
+
+	shade_input_set_uv(shi);
+	shade_input_set_normals(shi);
+
+	/* no normal flip */
+	if (shi->flippednor)
+		shade_input_flip_normals(shi);
+
+	/* set up view vector to look right at the surface (note that the normal
+	 * is negated in the renderer so it does not need to be done here) */
+	shi->view[0] = shi->vn[0];
+	shi->view[1] = shi->vn[1];
+	shi->view[2] = shi->vn[2];
+}
+
+static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(quad), int x, int y, float UNUSED(u), float UNUSED(v), float *tvn, float *ttang)
+{
+	BakeShade *bs = handle;
+	ShadeSample *ssamp = &bs->ssamp;
+	ShadeResult shr;
+	VlakRen *vlr = shi->vlr;
+
+	shade_input_init_material(shi);
+
+	if (bs->type == RE_BAKE_AO) {
+		ambient_occlusion(shi);
+
+		if (R.r.bake_flag & R_BAKE_NORMALIZE) {
+			copy_v3_v3(shr.combined, shi->ao);
+		}
+		else {
+			zero_v3(shr.combined);
+			environment_lighting_apply(shi, &shr);
+		}
+	}
+	else {
+		if (bs->type == RE_BAKE_SHADOW) /* Why do shadows set the color anyhow?, ignore material color for baking */
+			shi->r = shi->g = shi->b = 1.0f;
+	
+		shade_input_set_shade_texco(shi);
+		
+		/* only do AO for a full bake (and obviously AO bakes)
+		 * AO for light bakes is a leftover and might not be needed */
+		if (ELEM3(bs->type, RE_BAKE_ALL, RE_BAKE_AO, RE_BAKE_LIGHT))
+			shade_samples_do_AO(ssamp);
+		
+		if (shi->mat->nodetree && shi->mat->use_nodes) {
+			ntreeShaderExecTree(shi->mat->nodetree, shi, &shr);
+			shi->mat = vlr->mat;  /* shi->mat is being set in nodetree */
+		}
+		else
+			shade_material_loop(shi, &shr);
+
+		if (bs->type == RE_BAKE_NORMALS) {
+			float nor[3];
+
+			copy_v3_v3(nor, shi->vn);
+
+			if (R.r.bake_normal_space == R_BAKE_SPACE_CAMERA) {
+				/* pass */
+			}
+			else if (R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
+				float mat[3][3], imat[3][3];
+
+				/* bitangent */
+				if (tvn && ttang) {
+					copy_v3_v3(mat[0], ttang);
+					cross_v3_v3v3(mat[1], tvn, ttang);
+					mul_v3_fl(mat[1], ttang[3]);
+					copy_v3_v3(mat[2], tvn);
+				}
+				else {
+					copy_v3_v3(mat[0], shi->nmaptang);
+					cross_v3_v3v3(mat[1], shi->nmapnorm, shi->nmaptang);
+					mul_v3_fl(mat[1], shi->nmaptang[3]);
+					copy_v3_v3(mat[2], shi->nmapnorm);
+				}
+
+				invert_m3_m3(imat, mat);
+				mul_m3_v3(imat, nor);
+			}
+			else if (R.r.bake_normal_space == R_BAKE_SPACE_OBJECT)
+				mul_mat3_m4_v3(ob->imat_ren, nor);  /* ob->imat_ren includes viewinv! */
+			else if (R.r.bake_normal_space == R_BAKE_SPACE_WORLD)
+				mul_mat3_m4_v3(R.viewinv, nor);
+
+			normalize_v3(nor); /* in case object has scaling */
+
+			/* The invert of the red channel is to make
+			 * the normal map compliant with the outside world.
+			 * It needs to be done because in Blender
+			 * the normal used in the renderer points inward. It is generated
+			 * this way in calc_vertexnormals(). Should this ever change
+			 * this negate must be removed. */
+			shr.combined[0] = (-nor[0]) / 2.0f + 0.5f;
+			shr.combined[1] = nor[1]    / 2.0f + 0.5f;
+			shr.combined[2] = nor[2]    / 2.0f + 0.5f;
+		}
+		else if (bs->type == RE_BAKE_TEXTURE) {
+			copy_v3_v3(shr.combined, &shi->r);
+			shr.alpha = shi->alpha;
+		}
+		else if (bs->type == RE_BAKE_SHADOW) {
+			copy_v3_v3(shr.combined, shr.shad);
+			shr.alpha = shi->alpha;
+		}
+		else if (bs->type == RE_BAKE_SPEC_COLOR) {
+			copy_v3_v3(shr.combined, &shi->specr);
+			shr.alpha = 1.0f;
+		}
+		else if (bs->type == RE_BAKE_SPEC_INTENSITY) {
+			copy_v3_fl(shr.combined, shi->spec);
+			shr.alpha = 1.0f;
+		}
+		else if (bs->type == RE_BAKE_MIRROR_COLOR) {
+			copy_v3_v3(shr.combined, &shi->mirr);
+			shr.alpha = 1.0f;
+		}
+		else if (bs->type == RE_BAKE_MIRROR_INTENSITY) {
+			copy_v3_fl(shr.combined, shi->ray_mirror);
+			shr.alpha = 1.0f;
+		}
+		else if (bs->type == RE_BAKE_ALPHA) {
+			copy_v3_fl(shr.combined, shi->alpha);
+			shr.alpha = 1.0f;
+		}
+		else if (bs->type == RE_BAKE_EMIT) {
+			copy_v3_fl(shr.combined, shi->emit);
+			shr.alpha = 1.0f;
+		}
+	}
+	
+	if (bs->rect_float && !bs->vcol) {
+		float *col = bs->rect_float + 4 * (bs->rectx * y + x);
+		copy_v3_v3(col, shr.combined);
+		if (bs->type == RE_BAKE_ALL || bs->type == RE_BAKE_TEXTURE) {
+			col[3] = shr.alpha;
+		}
+		else {
+			col[3] = 1.0;
+		}
+	}
+	else {
+		/* Target is char (LDR). */
+		unsigned char col[4];
+
+		if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE)) {
+			float rgb[3];
+
+			copy_v3_v3(rgb, shr.combined);
+			if (R.scene_color_manage) {
+				/* Vertex colors have no way to specify color space, so they
+				 * default to sRGB. */
+				if (!bs->vcol)
+					IMB_colormanagement_scene_linear_to_colorspace_v3(rgb, bs->rect_colorspace);
+				else
+					linearrgb_to_srgb_v3_v3(rgb, rgb);
+			}
+			rgb_float_to_uchar(col, rgb);
+		}
+		else {
+			rgb_float_to_uchar(col, shr.combined);
+		}
+		
+		if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE)) {
+			col[3] = FTOCHAR(shr.alpha);
+		}
+		else {
+			col[3] = 255;
+		}
+
+		if (bs->vcol) {
+			/* Vertex color baking. Vcol has no useful alpha channel (it exists
+			 * but is used only for vertex painting). */
+			bs->vcol->r = col[0];
+			bs->vcol->g = col[1];
+			bs->vcol->b = col[2];
+		}
+		else {
+			unsigned char *imcol = (unsigned char *)(bs->rect + bs->rectx * y + x);
+			copy_v4_v4_char((char *)imcol, (char *)col);
+		}
+
+	}
+	
+	if (bs->rect_mask) {
+		bs->rect_mask[bs->rectx * y + x] = FILTER_MASK_USED;
+	}
+}
+
+static void bake_displacement(void *handle, ShadeInput *UNUSED(shi), float dist, int x, int y)
+{
+	BakeShade *bs = handle;
+	float disp;
+
+	if (R.r.bake_flag & R_BAKE_NORMALIZE) {
+		if (R.r.bake_maxdist)
+			disp = (dist + R.r.bake_maxdist) / (R.r.bake_maxdist * 2);  /* alter the range from [-bake_maxdist, bake_maxdist] to [0, 1]*/
+		else
+			disp = dist;
+	}
+	else {
+		disp = 0.5f + dist; /* alter the range from [-0.5,0.5] to [0,1]*/
+	}
+
+	if (bs->displacement_buffer) {
+		float *displacement = bs->displacement_buffer + (bs->rectx * y + x);
+		*displacement = disp;
+		bs->displacement_min = min_ff(bs->displacement_min, disp);
+		bs->displacement_max = max_ff(bs->displacement_max, disp);
+	}
+
+	if (bs->rect_float && !bs->vcol) {
+		float *col = bs->rect_float + 4 * (bs->rectx * y + x);
+		col[0] = col[1] = col[2] = disp;
+		col[3] = 1.0f;
+	}
+	else {
+		/* Target is char (LDR). */
+		unsigned char col[4];
+		col[0] = col[1] = col[2] = FTOCHAR(disp);
+		col[3] = 255;
+
+		if (bs->vcol) {
+			/* Vertex color baking. Vcol has no useful alpha channel (it exists
+			 * but is used only for vertex painting). */
+			bs->vcol->r = col[0];
+			bs->vcol->g = col[1];
+			bs->vcol->b = col[2];
+		}
+		else {
+			char *imcol = (char *)(bs->rect + bs->rectx * y + x);
+			copy_v4_v4_char((char *)imcol, (char *)col);
+		}
+	}
+	if (bs->rect_mask) {
+		bs->rect_mask[bs->rectx * y + x] = FILTER_MASK_USED;
+	}
+}
+
+static int bake_intersect_tree(RayObject *raytree, Isect *isect, float *start, float *dir, float sign, float *hitco, float *dist)
+{
+	float maxdist;
+	int hit;
+
+	/* might be useful to make a user setting for maxsize*/
+	if (R.r.bake_maxdist > 0.0f)
+		maxdist = R.r.bake_maxdist;
+	else
+		maxdist = RE_RAYTRACE_MAXDIST + R.r.bake_biasdist;
+
+	/* 'dir' is always normalized */
+	madd_v3_v3v3fl(isect->start, start, dir, -R.r.bake_biasdist);
+
+	mul_v3_v3fl(isect->dir, dir, sign);
+
+	isect->dist = maxdist;
+
+	hit = RE_rayobject_raycast(raytree, isect);
+	if (hit) {
+		madd_v3_v3v3fl(hitco, isect->start, isect->dir, isect->dist);
+
+		*dist = isect->dist;
+	}
+
+	return hit;
+}
+
+static void bake_set_vlr_dxyco(BakeShade *bs, float *uv1, float *uv2, float *uv3)
+{
+	VlakRen *vlr = bs->vlr;
+	float A, d1, d2, d3, *v1, *v2, *v3;
+
+	if (bs->quad) {
+		v1 = vlr->v1->co;
+		v2 = vlr->v3->co;
+		v3 = vlr->v4->co;
+	}
+	else {
+		v1 = vlr->v1->co;
+		v2 = vlr->v2->co;
+		v3 = vlr->v3->co;
+	}
+
+	/* formula derived from barycentric coordinates:
+	 * (uvArea1*v1 + uvArea2*v2 + uvArea3*v3)/uvArea
+	 * then taking u and v partial derivatives to get dxco and dyco */
+	A = (uv2[0] - uv1[0]) * (uv3[1] - uv1[1]) - (uv3[0] - uv1[0]) * (uv2[1] - uv1[1]);
+
+	if (fabsf(A) > FLT_EPSILON) {
+		A = 0.5f / A;
+
+		d1 = uv2[1] - uv3[1];
+		d2 = uv3[1] - uv1[1];
+		d3 = uv1[1] - uv2[1];
+		bs->dxco[0] = (v1[0] * d1 + v2[0] * d2 + v3[0] * d3) * A;
+		bs->dxco[1] = (v1[1] * d1 + v2[1] * d2 + v3[1] * d3) * A;
+		bs->dxco[2] = (v1[2] * d1 + v2[2] * d2 + v3[2] * d3) * A;
+
+		d1 = uv3[0] - uv2[0];
+		d2 = uv1[0] - uv3[0];
+		d3 = uv2[0] - uv1[0];
+		bs->dyco[0] = (v1[0] * d1 + v2[0] * d2 + v3[0] * d3) * A;
+		bs->dyco[1] = (v1[1] * d1 + v2[1] * d2 + v3[1] * d3) * A;
+		bs->dyco[2] = (v1[2] * d1 + v2[2] * d2 + v3[2] * d3) * A;
+	}
+	else {
+		bs->dxco[0] = bs->dxco[1] = bs->dxco[2] = 0.0f;
+		bs->dyco[0] = bs->dyco[1] = bs->dyco[2] = 0.0f;
+	}
+
+	if (bs->obi->flag & R_TRANSFORMED) {
+		mul_m3_v3(bs->obi->nmat, bs->dxco);
+		mul_m3_v3(bs->obi->nmat, bs->dyco);
+	}
+}
+
+static void do_bake_shade(void *handle, int x, int y, float u, float v)
+{
+	BakeShade *bs = handle;
+	VlakRen *vlr = bs->vlr;
+	ObjectInstanceRen *obi = bs->obi;
+	Object *ob = obi->obr->ob;
+	float l, *v1, *v2, *v3, tvn[3], ttang[4];
+	int quad;
+	ShadeSample *ssamp = &bs->ssamp;
+	ShadeInput *shi = ssamp->shi;
+
+	/* fast threadsafe break test */
+	if (R.test_break(R.tbh))
+		return;
+
+	/* setup render coordinates */
+	if (bs->quad) {
+		v1 = vlr->v1->co;
+		v2 = vlr->v3->co;
+		v3 = vlr->v4->co;
+	}
+	else {
+		v1 = vlr->v1->co;
+		v2 = vlr->v2->co;
+		v3 = vlr->v3->co;
+	}
+
+	l = 1.0f - u - v;
+
+	/* shrink barycentric coordinates inwards slightly to avoid some issues
+	 * where baking selected to active might just miss the other face at the
+	 * near the edge of a face */
+	if (bs->actob) {
+		const float eps = 1.0f - 1e-4f;
+		float invsum;
+
+		u = (u - 0.5f) * eps + 0.5f;
+		v = (v - 0.5f) * eps + 0.5f;
+		l = (l - 0.5f) * eps + 0.5f;
+
+		invsum = 1.0f / (u + v + l);
+
+		u *= invsum;
+		v *= invsum;
+		l *= invsum;
+	}
+
+	/* renderco */
+	shi->co[0] = l * v3[0] + u * v1[0] + v * v2[0];
+	shi->co[1] = l * v3[1] + u * v1[1] + v * v2[1];
+	shi->co[2] = l * v3[2] + u * v1[2] + v * v2[2];
+
+	/* avoid self shadow with vertex bake from adjacent faces [#33729] */
+	if ((bs->vcol != NULL) && (bs->actob == NULL)) {
+		madd_v3_v3fl(shi->co, vlr->n, 0.0001f);
+	}
+
+	if (obi->flag & R_TRANSFORMED)
+		mul_m4_v3(obi->mat, shi->co);
+
+	copy_v3_v3(shi->dxco, bs->dxco);
+	copy_v3_v3(shi->dyco, bs->dyco);
+
+	quad = bs->quad;
+	bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v);
+
+	if (bs->type == RE_BAKE_NORMALS && R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
+		shade_input_set_shade_texco(shi);
+		copy_v3_v3(tvn, shi->nmapnorm);
+		copy_v4_v4(ttang, shi->nmaptang);
+	}
+
+	/* if we are doing selected to active baking, find point on other face */
+	if (bs->actob) {
+		Isect isec, minisec;
+		float co[3], minco[3], dist, mindist = 0.0f;
+		int hit, sign, dir = 1;
+
+		/* intersect with ray going forward and backward*/
+		hit = 0;
+		memset(&minisec, 0, sizeof(minisec));
+		minco[0] = minco[1] = minco[2] = 0.0f;
+
+		copy_v3_v3(bs->dir, shi->vn);
+
+		for (sign = -1; sign <= 1; sign += 2) {
+			memset(&isec, 0, sizeof(isec));
+			isec.mode = RE_RAY_MIRROR;
+
+			isec.orig.ob   = obi;
+			isec.orig.face = vlr;
+			isec.userdata = bs->actob;
+			isec.check = RE_CHECK_VLR_BAKE;
+			isec.skip = RE_SKIP_VLR_NEIGHBOUR;
+
+			if (bake_intersect_tree(R.raytree, &isec, shi->co, shi->vn, sign, co, &dist)) {
+				if (!hit || len_squared_v3v3(shi->co, co) < len_squared_v3v3(shi->co, minco)) {
+					minisec = isec;
+					mindist = dist;
+					copy_v3_v3(minco, co);
+					hit = 1;
+					dir = sign;
+				}
+			}
+		}
+
+		if (bs->type == RE_BAKE_DISPLACEMENT) {
+			if (hit)
+				bake_displacement(handle, shi, (dir == -1) ? mindist : -mindist, x, y);
+			else
+				bake_displacement(handle, shi, 0.0f, x, y);
+			return;
+		}
+
+		/* if hit, we shade from the new point, otherwise from point one starting face */
+		if (hit) {
+			obi = (ObjectInstanceRen *)minisec.hit.ob;
+			vlr = (VlakRen *)minisec.hit.face;
+			quad = (minisec.isect == 2);
+			copy_v3_v3(shi->co, minco);
+
+			u = -minisec.u;
+			v = -minisec.v;
+			bake_set_shade_input(obi, vlr, shi, quad, 1, x, y, u, v);
+		}
+	}
+
+	if (bs->type == RE_BAKE_NORMALS && R.r.bake_normal_space == R_BAKE_SPACE_TANGENT)
+		bake_shade(handle, ob, shi, quad, x, y, u, v, tvn, ttang);
+	else
+		bake_shade(handle, ob, shi, quad, x, y, u, v, 0, 0);
+}
+
+static int get_next_bake_face(BakeShade *bs)
+{
+	ObjectRen *obr;
+	VlakRen *vlr;
+	MTFace *tface;
+	static int v = 0, vdone = false;
+	static ObjectInstanceRen *obi = NULL;
+
+	if (bs == NULL) {
+		vlr = NULL;
+		v = vdone = false;
+		obi = R.instancetable.first;
+		return 0;
+	}
+	
+	BLI_lock_thread(LOCK_CUSTOM1);
+
+	for (; obi; obi = obi->next, v = 0) {
+		obr = obi->obr;
+
+		for (; v < obr->totvlak; v++) {
+			vlr = RE_findOrAddVlak(obr, v);
+
+			if ((bs->actob && bs->actob == obr->ob) || (!bs->actob && (obr->ob->flag & SELECT))) {
+				if (R.r.bake_flag & R_BAKE_VCOL) {
+					/* Gather face data for vertex color bake */
+					Mesh *me;
+					int *origindex, vcollayer;
+					CustomDataLayer *cdl;
+
+					if (obr->ob->type != OB_MESH)
+						continue;
+					me = obr->ob->data;
+
+					origindex = RE_vlakren_get_origindex(obr, vlr, 0);
+					if (origindex == NULL)
+						continue;
+					if (*origindex >= me->totpoly) {
+						/* Small hack for Array modifier, which gives false
+						   original indices - z0r */
+						continue;
+					}
+#if 0
+					/* Only shade selected faces. */
+					if ((me->mface[*origindex].flag & ME_FACE_SEL) == 0)
+						continue;
+#endif
+
+					vcollayer = CustomData_get_render_layer_index(&me->ldata, CD_MLOOPCOL);
+					if (vcollayer == -1)
+						continue;
+
+					cdl = &me->ldata.layers[vcollayer];
+					bs->mpoly = me->mpoly + *origindex;
+					bs->vcol = ((MLoopCol *)cdl->data) + bs->mpoly->loopstart;
+					bs->mloop = me->mloop + bs->mpoly->loopstart;
+
+					/* Tag mesh for reevaluation. */
+					DAG_id_tag_update(&me->id, 0);
+				}
+				else {
+					Image *ima = NULL;
+					ImBuf *ibuf = NULL;
+					const float vec_alpha[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+					const float vec_solid[4] = {0.0f, 0.0f, 0.0f, 1.0f};
+					const float nor_alpha[4] = {0.5f, 0.5f, 1.0f, 0.0f};
+					const float nor_solid[4] = {0.5f, 0.5f, 1.0f, 1.0f};
+
+					tface = RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
+
+					if (!tface || !tface->tpage)
+						continue;
+
+					ima = tface->tpage;
+					ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
+
+					if (ibuf == NULL)
+						continue;
+
+					if (ibuf->rect == NULL && ibuf->rect_float == NULL) {
+						BKE_image_release_ibuf(ima, ibuf, NULL);
+						continue;
+					}
+
+					if (ibuf->rect_float && !(ibuf->channels == 0 || ibuf->channels == 4)) {
+						BKE_image_release_ibuf(ima, ibuf, NULL);
+						continue;
+					}
+					
+					if (ima->flag & IMA_USED_FOR_RENDER) {
+						ima->id.flag &= ~LIB_DOIT;
+						BKE_image_release_ibuf(ima, ibuf, NULL);
+						continue;
+					}
+					
+					/* find the image for the first time? */
+					if (ima->id.flag & LIB_DOIT) {
+						ima->id.flag &= ~LIB_DOIT;
+						
+						/* we either fill in float or char, this ensures things go fine */
+						if (ibuf->rect_float)
+							imb_freerectImBuf(ibuf);
+						/* clear image */
+						if (R.r.bake_flag & R_BAKE_CLEAR) {
+							if (R.r.bake_mode == RE_BAKE_NORMALS && R.r.bake_normal_space == R_BAKE_SPACE_TANGENT)
+								IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? nor_alpha : nor_solid);
+							else
+								IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
+						}
+						/* might be read by UI to set active image for display */
+						R.bakebuf = ima;
+					}
+
+					/* Tag image for redraw. */
+					ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
+					BKE_image_release_ibuf(ima, ibuf, NULL);
+				}
+
+				bs->obi = obi;
+				bs->vlr = vlr;
+				bs->vdone++;  /* only for error message if nothing was rendered */
+				v++;
+				BLI_unlock_thread(LOCK_CUSTOM1);
+				return 1;
+			}
+		}
+	}
+	
+	BLI_unlock_thread(LOCK_CUSTOM1);
+	return 0;
+}
+
+static void bake_single_vertex(BakeShade *bs, VertRen *vert, float u, float v)
+{
+	int *origindex, i;
+	MLoopCol *basevcol;
+	MLoop *mloop;
+
+	origindex = RE_vertren_get_origindex(bs->obi->obr, vert, 0);
+	if (!origindex || *origindex == ORIGINDEX_NONE)
+		return;
+
+	/* Search for matching vertex index and apply shading. */
+	for (i = 0; i < bs->mpoly->totloop; i++) {
+		mloop = bs->mloop + i;
+		if (mloop->v != *origindex)
+			continue;
+		basevcol = bs->vcol;
+		bs->vcol = basevcol + i;
+		do_bake_shade(bs, 0, 0, u, v);
+		bs->vcol = basevcol;
+		break;
+	}
+}
+
+/* Bake all vertices of a face. Actually, this still works on a face-by-face
+ * basis, and each vertex on each face is shaded. Vertex colors are a property
+ * of loops, not vertices. */
+static void shade_verts(BakeShade *bs)
+{
+	VlakRen *vlr = bs->vlr;
+
+	/* Disable baking to image; write to vcol instead. vcol pointer is set in
+	 * bake_single_vertex. */
+	bs->ima = NULL;
+	bs->rect = NULL;
+	bs->rect_float = NULL;
+	bs->displacement_buffer = NULL;
+	bs->displacement_min = FLT_MAX;
+	bs->displacement_max = -FLT_MAX;
+
+	bs->quad = 0;
+
+	/* No anti-aliasing for vertices. */
+	zero_v3(bs->dxco);
+	zero_v3(bs->dyco);
+
+	/* Shade each vertex of the face. u and v are barycentric coordinates; since
+	 * we're only interested in vertices, these will be 0 or 1. */
+	if ((vlr->flag & R_FACE_SPLIT) == 0) {
+		/* Processing triangle face, whole quad, or first half of split quad. */
+
+		bake_single_vertex(bs, bs->vlr->v1, 1.0f, 0.0f);
+		bake_single_vertex(bs, bs->vlr->v2, 0.0f, 1.0f);
+		bake_single_vertex(bs, bs->vlr->v3, 0.0f, 0.0f);
+
+		if (vlr->v4) {
+			bs->quad = 1;
+			bake_single_vertex(bs, bs->vlr->v4, 0.0f, 0.0f);
+		}
+	}
+	else {
+		/* Processing second half of split quad. Only one vertex to go. */
+		if (vlr->flag & R_DIVIDE_24) {
+			bake_single_vertex(bs, bs->vlr->v2, 0.0f, 1.0f);
+		}
+		else {
+			bake_single_vertex(bs, bs->vlr->v3, 0.0f, 0.0f);
+		}
+	}
+}
+
+/* already have tested for tface and ima and zspan */
+static void shade_tface(BakeShade *bs)
+{
+	VlakRen *vlr = bs->vlr;
+	ObjectInstanceRen *obi = bs->obi;
+	ObjectRen *obr = obi->obr;
+	MTFace *tface = RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
+	Image *ima = tface->tpage;
+	float vec[4][2];
+	int a, i1, i2, i3;
+	
+	/* check valid zspan */
+	if (ima != bs->ima) {
+		BKE_image_release_ibuf(bs->ima, bs->ibuf, NULL);
+
+		bs->ima = ima;
+		bs->ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
+		/* note, these calls only free/fill contents of zspan struct, not zspan itself */
+		zbuf_free_span(bs->zspan);
+		zbuf_alloc_span(bs->zspan, bs->ibuf->x, bs->ibuf->y, R.clipcrop);
+	}
+
+	bs->rectx = bs->ibuf->x;
+	bs->recty = bs->ibuf->y;
+	bs->rect = bs->ibuf->rect;
+	bs->rect_colorspace = bs->ibuf->rect_colorspace;
+	bs->rect_float = bs->ibuf->rect_float;
+	bs->vcol = NULL;
+	bs->quad = 0;
+	bs->rect_mask = NULL;
+	bs->displacement_buffer = NULL;
+
+	if (bs->use_mask || bs->use_displacement_buffer) {
+		BakeImBufuserData *userdata = bs->ibuf->userdata;
+		if (userdata == NULL) {
+			BLI_lock_thread(LOCK_CUSTOM1);
+			userdata = bs->ibuf->userdata;
+			if (userdata == NULL) /* since the thread was locked, its possible another thread alloced the value */
+				userdata = MEM_callocN(sizeof(BakeImBufuserData), "BakeImBufuserData");
+
+			if (bs->use_mask) {
+				if (userdata->mask_buffer == NULL) {
+					userdata->mask_buffer = MEM_callocN(sizeof(char) * bs->rectx * bs->recty, "BakeMask");
+				}
+			}
+
+			if (bs->use_displacement_buffer)
+				userdata->displacement_buffer = MEM_callocN(sizeof(float) * bs->rectx * bs->recty, "BakeDisp");
+
+			bs->ibuf->userdata = userdata;
+
+			BLI_unlock_thread(LOCK_CUSTOM1);
+		}
+
+		bs->rect_mask = userdata->mask_buffer;
+		bs->displacement_buffer = userdata->displacement_buffer;
+	}
+	
+	/* get pixel level vertex coordinates */
+	for (a = 0; a < 4; a++) {
+		/* Note, workaround for pixel aligned UVs which are common and can screw up our intersection tests
+		 * where a pixel gets in between 2 faces or the middle of a quad,
+		 * camera aligned quads also have this problem but they are less common.
+		 * Add a small offset to the UVs, fixes bug #18685 - Campbell */
+		vec[a][0] = tface->uv[a][0] * (float)bs->rectx - (0.5f + 0.001f);
+		vec[a][1] = tface->uv[a][1] * (float)bs->recty - (0.5f + 0.002f);
+	}
+
+	/* UV indices have to be corrected for possible quad->tria splits */
+	i1 = 0; i2 = 1; i3 = 2;
+	vlr_set_uv_indices(vlr, &i1, &i2, &i3);
+	bake_set_vlr_dxyco(bs, vec[i1], vec[i2], vec[i3]);
+	zspan_scanconvert(bs->zspan, bs, vec[i1], vec[i2], vec[i3], do_bake_shade);
+	
+	if (vlr->v4) {
+		bs->quad = 1;
+		bake_set_vlr_dxyco(bs, vec[0], vec[2], vec[3]);
+		zspan_scanconvert(bs->zspan, bs, vec[0], vec[2], vec[3], do_bake_shade);
+	}
+}
+
+static void *do_bake_thread(void *bs_v)
+{
+	BakeShade *bs = bs_v;
+
+	while (get_next_bake_face(bs)) {
+		if (R.r.bake_flag & R_BAKE_VCOL) {
+			shade_verts(bs);
+		}
+		else {
+			shade_tface(bs);
+		}
+		
+		/* fast threadsafe break test */
+		if (R.test_break(R.tbh))
+			break;
+
+		/* access is not threadsafe but since its just true/false probably ok
+		 * only used for interactive baking */
+		if (bs->do_update) {
+			*bs->do_update = true;
+		}
+	}
+	bs->ready = true;
+
+	BKE_image_release_ibuf(bs->ima, bs->ibuf, NULL);
+
+	return NULL;
+}
+
+void RE_bake_ibuf_filter(ImBuf *ibuf, char *mask, const int filter)
+{
+	/* must check before filtering */
+	const short is_new_alpha = (ibuf->planes != R_IMF_PLANES_RGBA) && BKE_imbuf_alpha_test(ibuf);
+
+	/* Margin */
+	if (filter) {
+		IMB_filter_extend(ibuf, mask, filter);
+	}
+
+	/* if the bake results in new alpha then change the image setting */
+	if (is_new_alpha) {
+		ibuf->planes = R_IMF_PLANES_RGBA;
+	}
+	else {
+		if (filter && ibuf->planes != R_IMF_PLANES_RGBA) {
+			/* clear alpha added by filtering */
+			IMB_rectfill_alpha(ibuf, 1.0f);
+		}
+	}
+}
+
+void RE_bake_ibuf_normalize_displacement(ImBuf *ibuf, float *displacement, char *mask, float displacement_min, float displacement_max)
+{
+	int i;
+	float *current_displacement = displacement;
+	char *current_mask = mask;
+	float max_distance;
+
+	max_distance = max_ff(fabsf(displacement_min), fabsf(displacement_max));
+
+	for (i = 0; i < ibuf->x * ibuf->y; i++) {
+		if (*current_mask == FILTER_MASK_USED) {
+			float normalized_displacement;
+
+			if (max_distance > 1e-5f)
+				normalized_displacement = (*current_displacement + max_distance) / (max_distance * 2);
+			else
+				normalized_displacement = 0.5f;
+
+			if (ibuf->rect_float) {
+				/* currently baking happens to RGBA only */
+				float *fp = ibuf->rect_float + i * 4;
+				fp[0] = fp[1] = fp[2] = normalized_displacement;
+				fp[3] = 1.0f;
+			}
+
+			if (ibuf->rect) {
+				unsigned char *cp = (unsigned char *) (ibuf->rect + i);
+				cp[0] = cp[1] = cp[2] = FTOCHAR(normalized_displacement);
+				cp[3] = 255;
+			}
+		}
+
+		current_displacement++;
+		current_mask++;
+	}
+}
+
+/* using object selection tags, the faces with UV maps get baked */
+/* render should have been setup */
+/* returns 0 if nothing was handled */
+int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_update, float *progress)
+{
+	BakeShade *handles;
+	ListBase threads;
+	Image *ima;
+	int a, vdone = false, result = BAKE_RESULT_OK;
+	bool use_mask = false;
+	bool use_displacement_buffer = false;
+	
+	re->scene_color_manage = BKE_scene_check_color_management_enabled(re->scene);
+	
+	/* initialize render global */
+	R = *re;
+	R.bakebuf = NULL;
+
+	/* initialize static vars */
+	get_next_bake_face(NULL);
+	
+	/* do we need a mask? */
+	if (re->r.bake_filter)
+		use_mask = true;
+
+	/* do we need buffer to store displacements  */
+	if (type == RE_BAKE_DISPLACEMENT) {
+		if ((R.r.bake_flag & R_BAKE_NORMALIZE) && R.r.bake_maxdist == 0.0f) {
+			use_displacement_buffer = true;
+			use_mask = true;
+		}
+	}
+
+	/* baker uses this flag to detect if image was initialized */
+	if ((R.r.bake_flag & R_BAKE_VCOL) == 0) {
+		for (ima = G.main->image.first; ima; ima = ima->id.next) {
+			ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
+			ima->id.flag |= LIB_DOIT;
+			ima->flag &= ~IMA_USED_FOR_RENDER;
+			if (ibuf) {
+				ibuf->userdata = NULL; /* use for masking if needed */
+			}
+			BKE_image_release_ibuf(ima, ibuf, NULL);
+		}
+	}
+
+	BLI_init_threads(&threads, do_bake_thread, re->r.threads);
+
+	handles = MEM_callocN(sizeof(BakeShade) * re->r.threads, "BakeShade");
+
+	/* get the threads running */
+	for (a = 0; a < re->r.threads; a++) {
+		/* set defaults in handles */
+		handles[a].ssamp.shi[0].lay = re->lay;
+
+		if (type == RE_BAKE_SHADOW) {
+			handles[a].ssamp.shi[0].passflag = SCE_PASS_SHADOW;
+		}
+		else {
+			handles[a].ssamp.shi[0].passflag = SCE_PASS_COMBINED;
+		}
+		handles[a].ssamp.shi[0].combinedflag = ~(SCE_PASS_SPEC);
+		handles[a].ssamp.shi[0].thread = a;
+		handles[a].ssamp.tot = 1;
+
+		handles[a].type = type;
+		handles[a].actob = actob;
+		if (R.r.bake_flag & R_BAKE_VCOL)
+			handles[a].zspan = NULL;
+		else
+			handles[a].zspan = MEM_callocN(sizeof(ZSpan), "zspan for bake");
+		
+		handles[a].use_mask = use_mask;
+		handles[a].use_displacement_buffer = use_displacement_buffer;
+
+		handles[a].do_update = do_update; /* use to tell the view to update */
+		
+		handles[a].displacement_min = FLT_MAX;
+		handles[a].displacement_max = -FLT_MAX;
+
+		BLI_insert_thread(&threads, &handles[a]);
+	}
+	
+	/* wait for everything to be done */
+	a = 0;
+	while (a != re->r.threads) {
+		PIL_sleep_ms(50);
+
+		/* calculate progress */
+		for (vdone = false, a = 0; a < re->r.threads; a++)
+			vdone += handles[a].vdone;
+		if (progress)
+			*progress = (float)(vdone / (float)re->totvlak);
+
+		for (a = 0; a < re->r.threads; a++) {
+			if (handles[a].ready == false) {
+				break;
+			}
+		}
+	}
+
+	/* filter and refresh images */
+	if ((R.r.bake_flag & R_BAKE_VCOL) == 0) {
+		float displacement_min = FLT_MAX, displacement_max = -FLT_MAX;
+
+		if (use_displacement_buffer) {
+			for (a = 0; a < re->r.threads; a++) {
+				displacement_min = min_ff(displacement_min, handles[a].displacement_min);
+				displacement_max = max_ff(displacement_max, handles[a].displacement_max);
+			}
+		}
+
+		for (ima = G.main->image.first; ima; ima = ima->id.next) {
+			if ((ima->id.flag & LIB_DOIT) == 0) {
+				ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
+				BakeImBufuserData *userdata;
+
+				if (ima->flag & IMA_USED_FOR_RENDER)
+					result = BAKE_RESULT_FEEDBACK_LOOP;
+
+				if (!ibuf)
+					continue;
+
+				userdata = (BakeImBufuserData *)ibuf->userdata;
+				if (userdata) {
+					RE_bake_ibuf_filter(ibuf, userdata->mask_buffer, re->r.bake_filter);
+
+					if (use_displacement_buffer) {
+						RE_bake_ibuf_normalize_displacement(ibuf, userdata->displacement_buffer, userdata->mask_buffer,
+						                                    displacement_min, displacement_max);
+					}
+				}
+
+				ibuf->userflags |= IB_BITMAPDIRTY;
+				BKE_image_release_ibuf(ima, ibuf, NULL);
+			}
+		}
+
+		/* calculate return value */
+		for (a = 0; a < re->r.threads; a++) {
+			zbuf_free_span(handles[a].zspan);
+			MEM_freeN(handles[a].zspan);
+		}
+	}
+
+	MEM_freeN(handles);
+	
+	BLI_end_threads(&threads);
+
+	if (vdone == 0) {
+		result = BAKE_RESULT_NO_OBJECTS;
+	}
+
+	return result;
+}
+
+struct Image *RE_bake_shade_get_image(void)
+{
+	return R.bakebuf;
+}
+
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 6c5e558..b161bb7 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -150,6 +150,7 @@ static HaloRen *initstar(Render *re, ObjectRen *obr, const float vec[3], float h
 	har->hasize= hasize;
 	
 	har->zd= 0.0;
+	har->pool = re->pool;
 	
 	return har;
 }
@@ -3282,7 +3283,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
 	}
 	
 	/* origindex currently only used when baking to vertex colors */
-	if(re->flag & R_BAKING && re->r.bake_flag & R_BAKE_VCOL)
+	if (re->flag & R_BAKING && re->r.bake_flag & R_BAKE_VCOL)
 		need_origindex= 1;
 
 	/* check autosmooth and displacement, we then have to skip only-verts optimize */
@@ -4769,7 +4770,7 @@ static int allow_render_dupli_instance(Render *UNUSED(re), DupliObject *dob, Obj
 
 	if (totmaterial) {
 		for (a= 0; a<*totmaterial; a++) {
-			ma= give_current_material(obd, a);
+			ma= give_current_material(obd, a + 1);
 			if (ma && (ma->material_type == MA_TYPE_HALO))
 				return 0;
 		}
@@ -5081,8 +5082,8 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
 		 * following calls don't depend on 'RE_SetCamera' */
 		RE_SetCamera(re, camera);
 
-		normalize_m4(camera->obmat);
-		invert_m4_m4(mat, camera->obmat);
+		normalize_m4_m4(mat, camera->obmat);
+		invert_m4(mat);
 		RE_SetView(re, mat);
 		camera->recalc= OB_RECALC_OB; /* force correct matrix for scaled cameras */
 	}
@@ -5231,8 +5232,8 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la
 	
 	/* if no camera, viewmat should have been set! */
 	if (camera) {
-		normalize_m4(camera->obmat);
-		invert_m4_m4(mat, camera->obmat);
+		normalize_m4_m4(mat, camera->obmat);
+		invert_m4(mat);
 		RE_SetView(re, mat);
 	}
 	
@@ -5771,8 +5772,8 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
 	
 	/* if no camera, set unit */
 	if (camera) {
-		normalize_m4(camera->obmat);
-		invert_m4_m4(mat, camera->obmat);
+		normalize_m4_m4(mat, camera->obmat);
+		invert_m4(mat);
 		RE_SetView(re, mat);
 	}
 	else {
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index be8b7f6..9adae6f 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -668,7 +668,7 @@ static void set_dxtdyt(float r_dxt[3], float r_dyt[3], const float dxt[3], const
 
 /* ------------------------------------------------------------------------- */
 
-int envmaptex(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres)
+int envmaptex(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, struct ImagePool *pool)
 {
 	extern Render R;                /* only in this call */
 	/* texvec should be the already reflected normal */
@@ -687,12 +687,12 @@ int envmaptex(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int o
 		env->ima = tex->ima;
 		if (env->ima && env->ima->ok) {
 			if (env->cube[1] == NULL) {
-				ImBuf *ibuf_ima = BKE_image_acquire_ibuf(env->ima, NULL, NULL);
+				ImBuf *ibuf_ima = BKE_image_pool_acquire_ibuf(env->ima, NULL, pool);
 				if (ibuf_ima)
 					envmap_split_ima(env, ibuf_ima);
 				else
 					env->ok = 0;
-				BKE_image_release_ibuf(env->ima, ibuf_ima, NULL);
+				BKE_image_pool_release_ibuf(env->ima, ibuf_ima, pool);
 			}
 		}
 	}
@@ -720,7 +720,7 @@ int envmaptex(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int o
 			mul_mat3_m4_v3(R.viewinv, dyt);
 		}
 		set_dxtdyt(dxts, dyts, dxt, dyt, face);
-		imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, texres);
+		imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, texres, pool);
 		
 		/* edges? */
 		
@@ -737,7 +737,7 @@ int envmaptex(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int o
 			if (face != face1) {
 				ibuf = env->cube[face1];
 				set_dxtdyt(dxts, dyts, dxt, dyt, face1);
-				imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, &texr1);
+				imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, &texr1, pool);
 			}
 			else texr1.tr = texr1.tg = texr1.tb = texr1.ta = 0.0;
 			
@@ -750,7 +750,7 @@ int envmaptex(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int o
 			if (face != face1) {
 				ibuf = env->cube[face1];
 				set_dxtdyt(dxts, dyts, dxt, dyt, face1);
-				imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, &texr2);
+				imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, &texr2, pool);
 			}
 			else texr2.tr = texr2.tg = texr2.tb = texr2.ta = 0.0;
 			
@@ -766,7 +766,7 @@ int envmaptex(Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int o
 		}
 	}
 	else {
-		imagewrap(tex, NULL, ibuf, sco, texres);
+		imagewrap(tex, NULL, ibuf, sco, texres, pool);
 	}
 	
 	return 1;
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index 296c8b6..22a49bc 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -1,4 +1,5 @@
 /*
+
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -128,9 +129,20 @@ int RE_engine_is_external(Render *re)
 
 RenderEngine *RE_engine_create(RenderEngineType *type)
 {
+	return RE_engine_create_ex(type, FALSE);
+}
+
+RenderEngine *RE_engine_create_ex(RenderEngineType *type, int use_for_viewport)
+{
 	RenderEngine *engine = MEM_callocN(sizeof(RenderEngine), "RenderEngine");
 	engine->type = type;
 
+	if (use_for_viewport) {
+		engine->flag |= RE_ENGINE_USED_FOR_VIEWPORT;
+
+		BLI_begin_threaded_malloc();
+	}
+
 	return engine;
 }
 
@@ -142,6 +154,10 @@ void RE_engine_free(RenderEngine *engine)
 	}
 #endif
 
+	if (engine->flag & RE_ENGINE_USED_FOR_VIEWPORT) {
+		BLI_end_threaded_malloc();
+	}
+
 	if (engine->text)
 		MEM_freeN(engine->text);
 
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 4aaa624..12286fc 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -110,7 +110,7 @@ static void ibuf_get_color(float col[4], struct ImBuf *ibuf, int x, int y)
 	}
 }
 
-int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResult *texres)
+int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResult *texres, struct ImagePool *pool)
 {
 	float fx, fy, val1, val2, val3;
 	int x, y, retval;
@@ -130,13 +130,13 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
 		if (ima->ibufs.first==NULL && (R.r.scemode & R_NO_IMAGE_LOAD))
 			return retval;
 
-		ibuf= BKE_image_acquire_ibuf(ima, &tex->iuser, NULL);
+		ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, pool);
 
 		ima->flag|= IMA_USED_FOR_RENDER;
 	}
 	if (ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
 		if (ima)
-			BKE_image_release_ibuf(ima, ibuf, NULL);
+			BKE_image_pool_release_ibuf(ima, ibuf, pool);
 		return retval;
 	}
 	
@@ -164,14 +164,14 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
 			}
 			else {
 				if (ima)
-					BKE_image_release_ibuf(ima, ibuf, NULL);
+					BKE_image_pool_release_ibuf(ima, ibuf, pool);
 				return retval;
 			}
 		}
 		if ( (tex->flag & TEX_CHECKER_EVEN)==0) {
 			if ((xs+ys) & 1) {
 				if (ima)
-					BKE_image_release_ibuf(ima, ibuf, NULL);
+					BKE_image_pool_release_ibuf(ima, ibuf, pool);
 				return retval;
 			}
 		}
@@ -188,14 +188,14 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
 	if (tex->extend == TEX_CLIPCUBE) {
 		if (x<0 || y<0 || x>=ibuf->x || y>=ibuf->y || texvec[2]<-1.0f || texvec[2]>1.0f) {
 			if (ima)
-				BKE_image_release_ibuf(ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(ima, ibuf, pool);
 			return retval;
 		}
 	}
 	else if ( tex->extend==TEX_CLIP || tex->extend==TEX_CHECKER) {
 		if (x<0 || y<0 || x>=ibuf->x || y>=ibuf->y) {
 			if (ima)
-				BKE_image_release_ibuf(ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(ima, ibuf, pool);
 			return retval;
 		}
 	}
@@ -224,8 +224,10 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
 	}
 
 	/* keep this before interpolation [#29761] */
-	if ((tex->imaflag & TEX_CALCALPHA) == 0) {
-		texres->talpha = TRUE;
+	if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+		if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+			texres->talpha = TRUE;
+		}
 	}
 
 	/* interpolate */
@@ -302,10 +304,10 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
 		texres->tg*= fx;
 		texres->tb*= fx;
 	}
-	
+
 	if (ima)
-		BKE_image_release_ibuf(ima, ibuf, NULL);
-	
+		BKE_image_pool_release_ibuf(ima, ibuf, pool);
+
 	BRICONTRGB;
 	
 	return retval;
@@ -1040,12 +1042,16 @@ static void image_mipmap_test(Tex *tex, ImBuf *ibuf)
 					IMB_makemipmap(ibuf, tex->imaflag & TEX_GAUSS_MIP);
 				BLI_unlock_thread(LOCK_IMAGE);
 			}
+			/* if no mipmap could be made, fall back on non-mipmap render */
+			if (ibuf->mipmap[0] == NULL) {
+				tex->imaflag &= ~TEX_MIPMAP;
+			}
 		}
 	}
 	
 }
 
-static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], float dxt[2], float dyt[2], TexResult *texres)
+static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], float dxt[2], float dyt[2], TexResult *texres, struct ImagePool *pool)
 {
 	TexResult texr;
 	float fx, fy, minx, maxx, miny, maxy;
@@ -1076,12 +1082,12 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
 
 	if (ima) {	/* hack for icon render */
 		if ((ima->ibufs.first == NULL) && (R.r.scemode & R_NO_IMAGE_LOAD)) return retval;
-		ibuf = BKE_image_acquire_ibuf(ima, &tex->iuser, NULL);
+		ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, pool);
 	}
 
 	if ((ibuf == NULL) || ((ibuf->rect == NULL) && (ibuf->rect_float == NULL))) {
 		if (ima)
-			BKE_image_release_ibuf(ima, ibuf, NULL);
+			BKE_image_pool_release_ibuf(ima, ibuf, pool);
 		return retval;
 	}
 
@@ -1092,8 +1098,10 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
 	/* mipmap test */
 	image_mipmap_test(tex, ibuf);
 	
-	if ((tex->imaflag & TEX_CALCALPHA) == 0)
-		texres->talpha = 1;
+	if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+		if ((tex->imaflag & TEX_CALCALPHA) == 0)
+			texres->talpha = 1;
+	}
 	texr.talpha = texres->talpha;
 
 	if (tex->imaflag & TEX_IMAROT) {
@@ -1199,12 +1207,12 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
 			else {
 				if ((tex->flag & TEX_CHECKER_ODD) == 0 && ((xs + ys) & 1) == 0) {
 					if (ima)
-						BKE_image_release_ibuf(ima, ibuf, NULL);
+						BKE_image_pool_release_ibuf(ima, ibuf, pool);
 					return retval;
 				}
 				if ((tex->flag & TEX_CHECKER_EVEN) == 0 && (xs + ys) & 1) {
 					if (ima)
-						BKE_image_release_ibuf(ima, ibuf, NULL);
+						BKE_image_pool_release_ibuf(ima, ibuf, pool);
 					return retval;
 				}
 				fx -= xs;
@@ -1224,14 +1232,14 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
 	if (tex->extend == TEX_CLIPCUBE) {
 		if ((fx + minx) < 0.f || (fy + miny) < 0.f || (fx - minx) > 1.f || (fy - miny) > 1.f || texvec[2] < -1.f || texvec[2] > 1.f) {
 			if (ima)
-				BKE_image_release_ibuf(ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(ima, ibuf, pool);
 			return retval;
 		}
 	}
 	else if (tex->extend == TEX_CLIP || tex->extend == TEX_CHECKER) {
 		if ((fx + minx) < 0.f || (fy + miny) < 0.f || (fx - minx) > 1.f || (fy - miny) > 1.f) {
 			if (ima)
-				BKE_image_release_ibuf(ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(ima, ibuf, pool);
 			return retval;
 		}
 	}
@@ -1455,7 +1463,7 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
 	}
 
 	if (ima)
-		BKE_image_release_ibuf(ima, ibuf, NULL);
+		BKE_image_pool_release_ibuf(ima, ibuf, pool);
 
 	BRICONTRGB;
 	
@@ -1463,7 +1471,7 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
 }
 
 
-int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const float DXT[2], const float DYT[2], TexResult *texres)
+int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const float DXT[2], const float DYT[2], TexResult *texres, struct ImagePool *pool)
 {
 	TexResult texr;
 	float fx, fy, minx, maxx, miny, maxy, dx, dy, dxt[2], dyt[2];
@@ -1477,7 +1485,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
 
 	/* anisotropic filtering */
 	if (tex->texfilter != TXF_BOX)
-		return imagewraposa_aniso(tex, ima, ibuf, texvec, dxt, dyt, texres);
+		return imagewraposa_aniso(tex, ima, ibuf, texvec, dxt, dyt, texres, pool);
 
 	texres->tin= texres->ta= texres->tr= texres->tg= texres->tb= 0.0f;
 	
@@ -1493,21 +1501,23 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
 		if (ima->ibufs.first==NULL && (R.r.scemode & R_NO_IMAGE_LOAD))
 			return retval;
 		
-		ibuf= BKE_image_acquire_ibuf(ima, &tex->iuser, NULL);
+		ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, pool);
 
 		ima->flag|= IMA_USED_FOR_RENDER;
 	}
 	if (ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
 		if (ima)
-			BKE_image_release_ibuf(ima, ibuf, NULL);
+			BKE_image_pool_release_ibuf(ima, ibuf, pool);
 		return retval;
 	}
 	
 	/* mipmap test */
 	image_mipmap_test(tex, ibuf);
 
-	if ((tex->imaflag & TEX_CALCALPHA) == 0) {
-		texres->talpha = TRUE;
+	if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+		if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+			texres->talpha = TRUE;
+		}
 	}
 	
 	texr.talpha= texres->talpha;
@@ -1608,14 +1618,14 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
 					}
 					else {
 						if (ima)
-							BKE_image_release_ibuf(ima, ibuf, NULL);
+							BKE_image_pool_release_ibuf(ima, ibuf, pool);
 						return retval;
 					}
 				}
 				if ( (tex->flag & TEX_CHECKER_EVEN)==0) {
 					if ((xs + ys) & 1) {
 						if (ima)
-							BKE_image_release_ibuf(ima, ibuf, NULL);
+							BKE_image_pool_release_ibuf(ima, ibuf, pool);
 						return retval;
 					}
 				}
@@ -1652,14 +1662,14 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
 	if (tex->extend == TEX_CLIPCUBE) {
 		if (fx+minx<0.0f || fy+miny<0.0f || fx-minx>1.0f || fy-miny>1.0f || texvec[2]<-1.0f || texvec[2]>1.0f) {
 			if (ima)
-				BKE_image_release_ibuf(ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(ima, ibuf, pool);
 			return retval;
 		}
 	}
 	else if (tex->extend==TEX_CLIP || tex->extend==TEX_CHECKER) {
 		if (fx+minx<0.0f || fy+miny<0.0f || fx-minx>1.0f || fy-miny>1.0f) {
 			if (ima)
-				BKE_image_release_ibuf(ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(ima, ibuf, pool);
 			return retval;
 		}
 	}
@@ -1855,17 +1865,17 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
 	}
 
 	if (ima)
-		BKE_image_release_ibuf(ima, ibuf, NULL);
+		BKE_image_pool_release_ibuf(ima, ibuf, pool);
 
 	BRICONTRGB;
 	
 	return retval;
 }
 
-void image_sample(Image *ima, float fx, float fy, float dx, float dy, float result[4])
+void image_sample(Image *ima, float fx, float fy, float dx, float dy, float result[4], struct ImagePool *pool)
 {
 	TexResult texres;
-	ImBuf *ibuf= BKE_image_acquire_ibuf(ima, NULL, NULL);
+	ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, NULL, pool);
 	
 	if (UNLIKELY(ibuf == NULL)) {
 		zero_v4(result);
@@ -1884,7 +1894,7 @@ void image_sample(Image *ima, float fx, float fy, float dx, float dy, float resu
 
 	ima->flag|= IMA_USED_FOR_RENDER;
 
-	BKE_image_release_ibuf(ima, ibuf, NULL);
+	BKE_image_pool_release_ibuf(ima, ibuf, pool);
 }
 
 void ibuf_sample(ImBuf *ibuf, float fx, float fy, float dx, float dy, float result[4])
diff --git a/source/blender/render/intern/source/multires_bake.c b/source/blender/render/intern/source/multires_bake.c
index 091ba95..ea42049 100644
--- a/source/blender/render/intern/source/multires_bake.c
+++ b/source/blender/render/intern/source/multires_bake.c
@@ -60,14 +60,17 @@
 #include "rayobject.h"
 #include "rendercore.h"
 
-typedef void (*MPassKnownData)(DerivedMesh *lores_dm, DerivedMesh *hires_dm, const void *bake_data,
-                               ImBuf *ibuf, const int face_index, const int lvl, const float st[2],
-                               float tangmat[3][3], const int x, const int y);
+typedef void (*MPassKnownData)(DerivedMesh *lores_dm, DerivedMesh *hires_dm, void *thread_data,
+                               void *bake_data, ImBuf *ibuf, const int face_index, const int lvl,
+                               const float st[2], float tangmat[3][3], const int x, const int y);
 
 typedef void * (*MInitBakeData)(MultiresBakeRender *bkr, Image *ima);
-typedef void   (*MApplyBakeData)(void *bake_data);
 typedef void   (*MFreeBakeData)(void *bake_data);
 
+typedef struct MultiresBakeResult {
+	float height_min, height_max;
+} MultiresBakeResult;
+
 typedef struct {
 	MVert *mvert;
 	MFace *mface;
@@ -79,6 +82,7 @@ typedef struct {
 	int i0, i1, i2;
 	DerivedMesh *lores_dm, *hires_dm;
 	int lvl;
+	void *thread_data;
 	void *bake_data;
 	ImBuf *ibuf;
 	MPassKnownData pass_data;
@@ -95,7 +99,6 @@ typedef struct {
 
 typedef struct {
 	float *heights;
-	float height_min, height_max;
 	Image *ima;
 	DerivedMesh *ssdm;
 	const int *orig_index_mf_to_mpoly;
@@ -161,9 +164,11 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[],
 
 static void init_bake_rast(MBakeRast *bake_rast, const ImBuf *ibuf, const MResolvePixelData *data, MFlushPixel flush_pixel)
 {
+	BakeImBufuserData *userdata = (BakeImBufuserData *) ibuf->userdata;
+
 	memset(bake_rast, 0, sizeof(MBakeRast));
 
-	bake_rast->texels = ibuf->userdata;
+	bake_rast->texels = userdata->mask_buffer;
 	bake_rast->w = ibuf->x;
 	bake_rast->h = ibuf->y;
 	bake_rast->data = data;
@@ -222,7 +227,7 @@ static void flush_pixel(const MResolvePixelData *data, const int x, const int y)
 		zero_m3(to_tang);
 	}
 
-	data->pass_data(data->lores_dm, data->hires_dm, data->bake_data,
+	data->pass_data(data->lores_dm, data->hires_dm, data->thread_data, data->bake_data,
 	                data->ibuf, data->face_index, data->lvl, st, to_tang, x, y);
 }
 
@@ -348,6 +353,9 @@ typedef struct MultiresBakeThread {
 	/* thread-specific data */
 	MBakeRast bake_rast;
 	MResolvePixelData data;
+
+	/* displacement-specific data */
+	float height_min, height_max;
 } MultiresBakeThread;
 
 static int multires_bake_queue_next_face(MultiresBakeQueue *queue)
@@ -428,8 +436,29 @@ static void *do_multires_bake_thread(void *data_v)
 	return NULL;
 }
 
+/* some of arrays inside ccgdm are lazy-initialized, which will generally
+ * require lock around accessing such data
+ * this function will ensure all arrays are allocated before threading started
+ */
+static void init_ccgdm_arrays(DerivedMesh *dm)
+{
+	CCGElem **grid_data;
+	CCGKey key;
+	int grid_size;
+	int *grid_offset;
+
+	grid_size = dm->getGridSize(dm);
+	grid_data = dm->getGridData(dm);
+	grid_offset = dm->getGridOffset(dm);
+	dm->getGridKey(dm, &key);
+
+	(void) grid_size;
+	(void) grid_data;
+	(void) grid_offset;
+}
+
 static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, int require_tangent, MPassKnownData passKnownData,
-                             MInitBakeData initBakeData, MApplyBakeData applyBakeData, MFreeBakeData freeBakeData)
+                             MInitBakeData initBakeData, MFreeBakeData freeBakeData, MultiresBakeResult *result)
 {
 	DerivedMesh *dm = bkr->lores_dm;
 	const int lvl = bkr->lvl;
@@ -467,6 +496,8 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, int require_ta
 
 		handles = MEM_callocN(tot_thread * sizeof(MultiresBakeThread), "do_multires_bake handles");
 
+		init_ccgdm_arrays(bkr->hires_dm);
+
 		/* faces queue */
 		queue.cur_face = 0;
 		queue.tot_face = tot_face;
@@ -491,9 +522,13 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, int require_ta
 			handle->data.hires_dm = bkr->hires_dm;
 			handle->data.lvl = lvl;
 			handle->data.pass_data = passKnownData;
+			handle->data.thread_data = handle;
 			handle->data.bake_data = bake_data;
 			handle->data.ibuf = ibuf;
 
+			handle->height_min = FLT_MAX;
+			handle->height_max = -FLT_MAX;
+
 			init_bake_rast(&handle->bake_rast, ibuf, &handle->data, flush_pixel);
 
 			if (tot_thread > 1)
@@ -506,15 +541,23 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, int require_ta
 		else
 			do_multires_bake_thread(&handles[0]);
 
+		/* construct bake result */
+		result->height_min = handles[0].height_min;
+		result->height_max = handles[0].height_max;
+
+		for (i = 1; i < tot_thread; i++) {
+			result->height_min = min_ff(result->height_min, handles[i].height_min);
+			result->height_max = max_ff(result->height_max, handles[i].height_max);
+		}
+
 		BLI_spin_end(&queue.spin);
 
 		/* finalize baking */
-		if (applyBakeData)
-			applyBakeData(bake_data);
-
 		if (freeBakeData)
 			freeBakeData(bake_data);
 
+		MEM_freeN(handles);
+
 		BKE_image_release_ibuf(ima, ibuf, NULL);
 	}
 }
@@ -651,13 +694,15 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
 	MHeightBakeData *height_data;
 	ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
 	DerivedMesh *lodm = bkr->lores_dm;
+	BakeImBufuserData *userdata = ibuf->userdata;
+
+	if (userdata->displacement_buffer == NULL)
+		userdata->displacement_buffer = MEM_callocN(sizeof(float) * ibuf->x * ibuf->y, "MultiresBake heights");
 
 	height_data = MEM_callocN(sizeof(MHeightBakeData), "MultiresBake heightData");
 
 	height_data->ima = ima;
-	height_data->heights = MEM_callocN(sizeof(float) * ibuf->x * ibuf->y, "MultiresBake heights");
-	height_data->height_max = -FLT_MAX;
-	height_data->height_min = FLT_MAX;
+	height_data->heights = userdata->displacement_buffer;
 
 	if (!bkr->use_lores_mesh) {
 		SubsurfModifierData smd = {{NULL}};
@@ -673,6 +718,7 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
 				smd.subdivType = ME_SIMPLE_SUBSURF;
 
 			height_data->ssdm = subsurf_make_derived_from_derived(bkr->lores_dm, &smd, NULL, 0);
+			init_ccgdm_arrays(height_data->ssdm);
 		}
 	}
 
@@ -684,48 +730,6 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
 	return (void *)height_data;
 }
 
-static void apply_heights_data(void *bake_data)
-{
-	MHeightBakeData *height_data = (MHeightBakeData *)bake_data;
-	ImBuf *ibuf = BKE_image_acquire_ibuf(height_data->ima, NULL, NULL);
-	int x, y, i;
-	float height, *heights = height_data->heights;
-	float min = height_data->height_min, max = height_data->height_max;
-
-	for (x = 0; x < ibuf->x; x++) {
-		for (y = 0; y < ibuf->y; y++) {
-			i = ibuf->x * y + x;
-
-			if (((char *)ibuf->userdata)[i] != FILTER_MASK_USED)
-				continue;
-
-			if (ibuf->rect_float) {
-				float *rrgbf = ibuf->rect_float + i * 4;
-
-				if (max - min > 1e-5f) height = (heights[i] - min) / (max - min);
-				else height = 0;
-
-				rrgbf[0] = rrgbf[1] = rrgbf[2] = height;
-			}
-			else {
-				char *rrgb = (char *)ibuf->rect + i * 4;
-
-				if (max - min > 1e-5f) height = (heights[i] - min) / (max - min);
-				else height = 0;
-
-				rrgb[0] = rrgb[1] = rrgb[2] = FTOCHAR(height);
-			}
-		}
-	}
-
-	if (ibuf->rect_float)
-		ibuf->userflags |= IB_RECT_INVALID;
-
-	ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
-
-	BKE_image_release_ibuf(height_data->ima, ibuf, NULL);
-}
-
 static void free_heights_data(void *bake_data)
 {
 	MHeightBakeData *height_data = (MHeightBakeData *)bake_data;
@@ -733,7 +737,6 @@ static void free_heights_data(void *bake_data)
 	if (height_data->ssdm)
 		height_data->ssdm->release(height_data->ssdm);
 
-	MEM_freeN(height_data->heights);
 	MEM_freeN(height_data);
 }
 
@@ -743,13 +746,14 @@ static void free_heights_data(void *bake_data)
  *   - find coord of point and normal with specified UV in lo-res mesh (or subdivided lo-res
  *     mesh to make texture smoother) let's call this point p0 and n.
  *   - height wound be dot(n, p1-p0) */
-static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, const void *bake_data,
+static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, void *thread_data_v, void *bake_data,
                                    ImBuf *ibuf, const int face_index, const int lvl, const float st[2],
                                    float UNUSED(tangmat[3][3]), const int x, const int y)
 {
 	MTFace *mtface = CustomData_get_layer(&lores_dm->faceData, CD_MTFACE);
 	MFace mface;
 	MHeightBakeData *height_data = (MHeightBakeData *)bake_data;
+	MultiresBakeThread *thread_data = (MultiresBakeThread *) thread_data_v;
 	float uv[2], *st0, *st1, *st2, *st3;
 	int pixel = ibuf->x * y + x;
 	float vec[3], p0[3], p1[3], n[3], len;
@@ -771,12 +775,12 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
 	CLAMP(uv[1], 0.0f, 1.0f);
 
 	get_ccgdm_data(lores_dm, hires_dm,
-	               height_data->orig_index_mf_to_mpoly, height_data->orig_index_mf_to_mpoly,
+	               height_data->orig_index_mf_to_mpoly, height_data->orig_index_mp_to_orig,
 	               lvl, face_index, uv[0], uv[1], p1, 0);
 
 	if (height_data->ssdm) {
 		get_ccgdm_data(lores_dm, height_data->ssdm,
-		               height_data->orig_index_mf_to_mpoly, height_data->orig_index_mf_to_mpoly,
+		               height_data->orig_index_mf_to_mpoly, height_data->orig_index_mp_to_orig,
 		               0, face_index, uv[0], uv[1], p0, n);
 	}
 	else {
@@ -796,15 +800,18 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
 	len = dot_v3v3(n, vec);
 
 	height_data->heights[pixel] = len;
-	if (len < height_data->height_min) height_data->height_min = len;
-	if (len > height_data->height_max) height_data->height_max = len;
+
+	thread_data->height_min = min_ff(thread_data->height_min, len);
+	thread_data->height_max = max_ff(thread_data->height_max, len);
 
 	if (ibuf->rect_float) {
 		float *rrgbf = ibuf->rect_float + pixel * 4;
+		rrgbf[0] = rrgbf[1] = rrgbf[2] = len;
 		rrgbf[3] = 1.0f;
 	}
 	else {
 		char *rrgb = (char *)ibuf->rect + pixel * 4;
+		rrgb[0] = rrgb[1] = rrgb[2] = FTOCHAR(len);
 		rrgb[3] = 255;
 	}
 }
@@ -836,9 +843,9 @@ static void free_normal_data(void *bake_data)
  *   - find coord and normal of point with specified UV in hi-res mesh
  *   - multiply it by tangmat
  *   - vector in color space would be norm(vec) /2 + (0.5, 0.5, 0.5) */
-static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, const void *bake_data,
-                                   ImBuf *ibuf, const int face_index, const int lvl, const float st[2],
-                                   float tangmat[3][3], const int x, const int y)
+static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, void *UNUSED(thread_data),
+                                   void *bake_data, ImBuf *ibuf, const int face_index, const int lvl,
+                                   const float st[2], float tangmat[3][3], const int x, const int y)
 {
 	MTFace *mtface = CustomData_get_layer(&lores_dm->faceData, CD_MTFACE);
 	MFace mface;
@@ -931,17 +938,18 @@ static void build_permutation_table(unsigned short permutation[], unsigned short
 		permutation[i] = temp_permutation[entry];
 
 		/* delete entry */
-		for(k = entry; k < nr_entries_left - 1; k++)
+		for (k = entry; k < nr_entries_left - 1; k++) {
 			temp_permutation[k] = temp_permutation[k + 1];
+		}
 	}
 
 	/* verify permutation table
 	 * every entry must appear exactly once
 	 */
 #if 0
-	for(i = 0; i < number_of_rays; i++) temp_permutation[i] = 0;
-	for(i = 0; i < number_of_rays; i++) ++temp_permutation[permutation[i]];
-	for(i = 0; i < number_of_rays; i++) BLI_assert(temp_permutation[i] == 1);
+	for (i = 0; i < number_of_rays; i++) temp_permutation[i] = 0;
+	for (i = 0; i < number_of_rays; i++) ++temp_permutation[permutation[i]];
+	for (i = 0; i < number_of_rays; i++) BLI_assert(temp_permutation[i] == 1);
 #endif
 }
 
@@ -1073,9 +1081,9 @@ static int trace_ao_ray(MAOBakeData *ao_data, float ray_start[3], float ray_dire
 	return RE_rayobject_raycast(ao_data->raytree, &isect);
 }
 
-static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, const void *bake_data,
-                              ImBuf *ibuf, const int face_index, const int lvl, const float st[2],
-                              float UNUSED(tangmat[3][3]), const int x, const int y)
+static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, void *UNUSED(thread_data),
+                              void *bake_data, ImBuf *ibuf, const int face_index, const int lvl,
+                              const float st[2], float UNUSED(tangmat[3][3]), const int x, const int y)
 {
 	MAOBakeData *ao_data = (MAOBakeData *) bake_data;
 	MTFace *mtface = CustomData_get_layer(&lores_dm->faceData, CD_MTFACE);
@@ -1205,7 +1213,7 @@ static void count_images(MultiresBakeRender *bkr)
 		mtface[a].tpage->id.flag &= ~LIB_DOIT;
 }
 
-static void bake_images(MultiresBakeRender *bkr)
+static void bake_images(MultiresBakeRender *bkr, MultiresBakeResult *result)
 {
 	LinkData *link;
 
@@ -1214,18 +1222,19 @@ static void bake_images(MultiresBakeRender *bkr)
 		ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
 
 		if (ibuf->x > 0 && ibuf->y > 0) {
-			ibuf->userdata = MEM_callocN(ibuf->y * ibuf->x, "MultiresBake imbuf mask");
+			BakeImBufuserData *userdata = MEM_callocN(sizeof(BakeImBufuserData), "MultiresBake userdata");
+			userdata->mask_buffer = MEM_callocN(ibuf->y * ibuf->x, "MultiresBake imbuf mask");
+			ibuf->userdata = userdata;
 
 			switch (bkr->mode) {
 				case RE_BAKE_NORMALS:
-					do_multires_bake(bkr, ima, TRUE, apply_tangmat_callback, init_normal_data, NULL, free_normal_data);
+					do_multires_bake(bkr, ima, TRUE, apply_tangmat_callback, init_normal_data, free_normal_data, result);
 					break;
 				case RE_BAKE_DISPLACEMENT:
-					do_multires_bake(bkr, ima, FALSE, apply_heights_callback, init_heights_data,
-					                 apply_heights_data, free_heights_data);
+					do_multires_bake(bkr, ima, FALSE, apply_heights_callback, init_heights_data, free_heights_data, result);
 					break;
 				case RE_BAKE_AO:
-					do_multires_bake(bkr, ima, FALSE, apply_ao_callback, init_ao_data, NULL, free_ao_data);
+					do_multires_bake(bkr, ima, FALSE, apply_ao_callback, init_ao_data, free_ao_data, result);
 					break;
 			}
 		}
@@ -1236,18 +1245,25 @@ static void bake_images(MultiresBakeRender *bkr)
 	}
 }
 
-static void finish_images(MultiresBakeRender *bkr)
+static void finish_images(MultiresBakeRender *bkr, MultiresBakeResult *result)
 {
 	LinkData *link;
+	int use_displacement_buffer = bkr->mode == RE_BAKE_DISPLACEMENT;
 
 	for (link = bkr->image.first; link; link = link->next) {
 		Image *ima = (Image *)link->data;
 		ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
+		BakeImBufuserData *userdata = (BakeImBufuserData *) ibuf->userdata;
 
 		if (ibuf->x <= 0 || ibuf->y <= 0)
 			continue;
 
-		RE_bake_ibuf_filter(ibuf, (char *)ibuf->userdata, bkr->bake_filter);
+		RE_bake_ibuf_filter(ibuf, userdata->mask_buffer, bkr->bake_filter);
+
+		if (use_displacement_buffer) {
+			RE_bake_ibuf_normalize_displacement(ibuf, userdata->displacement_buffer, userdata->mask_buffer,
+			                                    result->height_min, result->height_max);
+		}
 
 		ibuf->userflags |= IB_BITMAPDIRTY | IB_DISPLAY_BUFFER_INVALID;
 
@@ -1260,7 +1276,11 @@ static void finish_images(MultiresBakeRender *bkr)
 		}
 
 		if (ibuf->userdata) {
-			MEM_freeN(ibuf->userdata);
+			if (userdata->displacement_buffer)
+				MEM_freeN(userdata->displacement_buffer);
+
+			MEM_freeN(userdata->mask_buffer);
+			MEM_freeN(userdata);
 			ibuf->userdata = NULL;
 		}
 
@@ -1270,7 +1290,9 @@ static void finish_images(MultiresBakeRender *bkr)
 
 void RE_multires_bake_images(MultiresBakeRender *bkr)
 {
+	MultiresBakeResult result;
+
 	count_images(bkr);
-	bake_images(bkr);
-	finish_images(bkr);
+	bake_images(bkr, &result);
+	finish_images(bkr, &result);
 }
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index dec11f0..e102416 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -469,7 +469,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
 		re->recty = winy;
 	}
 	
-	if (re->rectx < 2 || re->recty < 2 || (BKE_imtype_is_movie(rd->im_format.imtype) &&
+	if (re->rectx < 1 || re->recty < 1 || (BKE_imtype_is_movie(rd->im_format.imtype) &&
 	                                       (re->rectx < 16 || re->recty < 16) ))
 	{
 		BKE_report(re->reports, RPT_ERROR, "Image too small");
@@ -1322,6 +1322,7 @@ static void render_scene(Render *re, Scene *sce, int cfra)
 	resc->main = re->main;
 	resc->scene = sce;
 	resc->lay = sce->lay;
+	resc->scene_color_manage = BKE_scene_check_color_management_enabled(sce);
 	
 	/* ensure scene has depsgraph, base flags etc OK */
 	BKE_scene_set_background(re->main, sce);
@@ -1355,6 +1356,19 @@ static int composite_needs_render(Scene *sce, int this_scene)
 	return 0;
 }
 
+static bool rlayer_node_uses_alpha(bNodeTree *ntree, bNode *node)
+{
+	bNodeSocket *sock;
+
+	for (sock = node->outputs.first; sock; sock = sock->next) {
+		/* Weak! but how to make it better? */
+		if (!strcmp(sock->name, "Alpha") && nodeCountSocketLinks(ntree, sock) > 0)
+			return true;
+	}
+
+	return false;
+}
+
 static void tag_scenes_for_render(Render *re)
 {
 	bNode *node;
@@ -1372,6 +1386,21 @@ static void tag_scenes_for_render(Render *re)
 	for (node = re->scene->nodetree->nodes.first; node; node = node->next) {
 		if (node->type == CMP_NODE_R_LAYERS) {
 			if (node->id) {
+				if (!MAIN_VERSION_ATLEAST(re->main, 265, 5)) {
+					if (rlayer_node_uses_alpha(re->scene->nodetree, node)) {
+						Scene *scene = (Scene*) node->id;
+
+						if (scene->r.alphamode != R_ALPHAPREMUL) {
+							BKE_reportf(re->reports, RPT_WARNING, "Setting scene %s alpha mode to Premul\n", scene->id.name + 2);
+
+							/* also print, so feedback is immediate */
+							printf("2.66 versioning fix: setting scene %s alpha mode to Premul\n", scene->id.name + 2);
+
+							scene->r.alphamode = R_ALPHAPREMUL;
+						}
+					}
+				}
+
 				if (node->id != (ID *)re->scene)
 					node->id->flag |= LIB_DOIT;
 			}
@@ -1799,7 +1828,12 @@ static void do_render_all_options(Render *re)
 		re->display_draw(re->ddh, re->result, NULL);
 	}
 	else {
+		re->pool = BKE_image_pool_new();
+
 		do_render_composite_fields_blur_3d(re);
+
+		BKE_image_pool_free(re->pool);
+		re->pool = NULL;
 	}
 	
 	re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
@@ -2385,6 +2419,8 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
 
 	RE_InitState(re, NULL, &sce->r, NULL, winx, winy, NULL);
 
+	re->pool = BKE_image_pool_new();
+
 	re->main = bmain;
 	re->scene = sce;
 	re->scene_color_manage = BKE_scene_check_color_management_enabled(sce);
@@ -2394,6 +2430,9 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
 	RE_SetCamera(re, camera);
 
 	do_render_3d(re);
+
+	BKE_image_pool_free(re->pool);
+	re->pool = NULL;
 }
 
 /* note; repeated win/disprect calc... solve that nicer, also in compo */
diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c
index 21ff115..66fd220 100644
--- a/source/blender/render/intern/source/pixelblending.c
+++ b/source/blender/render/intern/source/pixelblending.c
@@ -120,7 +120,7 @@ void addalphaAddfacFloat(float dest[4], const float source[4], char addfac)
 	else 
 #endif
 	dest[0] = c;
-   
+
 	c = (m * dest[1]) + source[1];
 #ifdef RE_FLOAT_COLOR_CLIPPING
 	if (c >= RE_FULL_COLOR_FLOAT) dest[1] = RE_FULL_COLOR_FLOAT; 
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index 3420648..8a023a2 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -286,7 +286,7 @@ int shadeHaloFloat(HaloRen *har, float col[4], int zz,
 	/* fill in col */
 	float t, zn, radist, ringf=0.0f, linef=0.0f, alpha, si, co;
 	int a;
-   
+
 	if (R.wrld.mode & WO_MIST) {
 		if (har->type & HA_ONLYSKY) {
 			/* stars but no mist */
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index bef5902..fe23f31 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -433,14 +433,18 @@ void makeraytree(Render *re)
 		 * This is ONLY needed to kept a bogus behavior of SUN and HEMI lights */
 		INIT_MINMAX(min, max);
 		RE_rayobject_merge_bb(re->raytree, min, max);
+		if (min[0] > max[0]) {  /* empty raytree */
+			zero_v3(min);
+			zero_v3(max);
+		}
 		for (i=0; i<3; i++) {
+			/* TODO: explain why add top both min and max??? */
 			min[i] += 0.01f;
 			max[i] += 0.01f;
 			sub[i] = max[i]-min[i];
 		}
 
-		re->maxdist = dot_v3v3(sub, sub);
-		if (re->maxdist > 0.0f) re->maxdist= sqrt(re->maxdist);
+		re->maxdist = len_v3(sub);
 
 		re->i.infostr= "Raytree finished";
 		re->stats_draw(re->sdh, &re->i);
diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c
index 35b0638..c779b01 100644
--- a/source/blender/render/intern/source/render_result.c
+++ b/source/blender/render/intern/source/render_result.c
@@ -1094,6 +1094,10 @@ ImBuf *render_result_rect_to_ibuf(RenderResult *rr, RenderData *rd)
 		if (BKE_imtype_valid_depths(rd->im_format.imtype) & (R_IMF_CHAN_DEPTH_12 | R_IMF_CHAN_DEPTH_16 | R_IMF_CHAN_DEPTH_24 | R_IMF_CHAN_DEPTH_32)) {
 			IMB_float_from_rect(ibuf);
 		}
+		else  {
+			/* ensure no float buffer remained from previous frame */
+			ibuf->rect_float = NULL;
+		}
 	}
 
 	/* color -> grayscale */
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index e3bfd53..15ca865 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -171,9 +171,9 @@ static void tex_normal_derivate(Tex *tex, TexResult *texres)
 			do_colorband(tex->coba, texres->nor[2], col);
 			fac3= (col[0]+col[1]+col[2]);
 			
-			texres->nor[0]= 0.3333f*(fac0 - fac1);
-			texres->nor[1]= 0.3333f*(fac0 - fac2);
-			texres->nor[2]= 0.3333f*(fac0 - fac3);
+			texres->nor[0]= (fac0 - fac1) / 3.0f;
+			texres->nor[1]= (fac0 - fac2) / 3.0f;
+			texres->nor[2]= (fac0 - fac3) / 3.0f;
 			
 			return;
 		}
@@ -1099,7 +1099,7 @@ static void do_2d_mapping(MTex *mtex, float texvec[3], VlakRen *vlr, const float
 
 /* ************************************** */
 
-static int multitex(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, short which_output)
+static int multitex(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, short which_output, struct ImagePool *pool)
 {
 	float tmpvec[3];
 	int retval = 0; /* return value, int:0, col:1, nor:2, everything:3 */
@@ -1137,12 +1137,12 @@ static int multitex(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int o
 				retval = texnoise(tex, texres);
 				break;
 			case TEX_IMAGE:
-				if (osatex) retval = imagewraposa(tex, tex->ima, NULL, texvec, dxt, dyt, texres);
-				else        retval = imagewrap(tex, tex->ima, NULL, texvec, texres);
+				if (osatex) retval = imagewraposa(tex, tex->ima, NULL, texvec, dxt, dyt, texres, pool);
+				else        retval = imagewrap(tex, tex->ima, NULL, texvec, texres, pool);
 				BKE_image_tag_time(tex->ima); /* tag image as having being used */
 				break;
 			case TEX_ENVMAP:
-				retval = envmaptex(tex, texvec, dxt, dyt, osatex, texres);
+				retval = envmaptex(tex, texvec, dxt, dyt, osatex, texres, pool);
 				break;
 			case TEX_MUSGRAVE:
 				/* newnoise: musgrave types */
@@ -1214,7 +1214,7 @@ static int multitex(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int o
 
 /* this is called from the shader and texture nodes */
 int multitex_nodes(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres,
-                   const short thread, short which_output, ShadeInput *shi, MTex *mtex)
+                   const short thread, short which_output, ShadeInput *shi, MTex *mtex, struct ImagePool *pool)
 {
 	if (tex==NULL) {
 		memset(texres, 0, sizeof(TexResult));
@@ -1230,16 +1230,16 @@ int multitex_nodes(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int os
 		if (mtex) {
 			/* we have mtex, use it for 2d mapping images only */
 			do_2d_mapping(mtex, texvec, shi->vlr, shi->facenor, dxt, dyt);
-			rgbnor = multitex(tex, texvec, dxt, dyt, osatex, texres, thread, which_output);
+			rgbnor = multitex(tex, texvec, dxt, dyt, osatex, texres, thread, which_output, pool);
 
 			if (mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) {
-				ImBuf *ibuf = BKE_image_acquire_ibuf(tex->ima, &tex->iuser, NULL);
+				ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool);
 				
 				/* don't linearize float buffers, assumed to be linear */
 				if (ibuf && !(ibuf->rect_float) && R.scene_color_manage)
 					IMB_colormanagement_colorspace_to_scene_linear_v3(&texres->tr, ibuf->rect_colorspace);
 
-				BKE_image_release_ibuf(tex->ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(tex->ima, ibuf, pool);
 			}
 		}
 		else {
@@ -1263,28 +1263,28 @@ int multitex_nodes(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int os
 			}
 			
 			do_2d_mapping(&localmtex, texvec_l, NULL, NULL, dxt_l, dyt_l);
-			rgbnor= multitex(tex, texvec_l, dxt_l, dyt_l, osatex, texres, thread, which_output);
+			rgbnor = multitex(tex, texvec_l, dxt_l, dyt_l, osatex, texres, thread, which_output, pool);
 
 			{
-				ImBuf *ibuf = BKE_image_acquire_ibuf(tex->ima, &tex->iuser, NULL);
+				ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool);
 
 				/* don't linearize float buffers, assumed to be linear */
 				if (ibuf && !(ibuf->rect_float) && R.scene_color_manage)
 					IMB_colormanagement_colorspace_to_scene_linear_v3(&texres->tr, ibuf->rect_colorspace);
 
-				BKE_image_release_ibuf(tex->ima, ibuf, NULL);
+				BKE_image_pool_release_ibuf(tex->ima, ibuf, pool);
 			}
 		}
 
 		return rgbnor;
 	}
 	else {
-		return multitex(tex, texvec, dxt, dyt, osatex, texres, thread, which_output);
+		return multitex(tex, texvec, dxt, dyt, osatex, texres, thread, which_output, pool);
 	}
 }
 
 /* this is called for surface shading */
-static int multitex_mtex(ShadeInput *shi, MTex *mtex, float texvec[3], float dxt[3], float dyt[3], TexResult *texres)
+static int multitex_mtex(ShadeInput *shi, MTex *mtex, float texvec[3], float dxt[3], float dyt[3], TexResult *texres, struct ImagePool *pool)
 {
 	Tex *tex = mtex->tex;
 
@@ -1295,24 +1295,24 @@ static int multitex_mtex(ShadeInput *shi, MTex *mtex, float texvec[3], float dxt
 		                        tex, mtex->which_output, R.r.cfra, (R.r.scemode & R_TEXNODE_PREVIEW) != 0, shi, mtex);
 	}
 	else {
-		return multitex(mtex->tex, texvec, dxt, dyt, shi->osatex, texres, shi->thread, mtex->which_output);
+		return multitex(mtex->tex, texvec, dxt, dyt, shi->osatex, texres, shi->thread, mtex->which_output, pool);
 	}
 }
 
 /* Warning, if the texres's values are not declared zero, check the return value to be sure
  * the color values are set before using the r/g/b values, otherwise you may use uninitialized values - Campbell */
-int multitex_ext(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres)
+int multitex_ext(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, struct ImagePool *pool)
 {
-	return multitex_nodes(tex, texvec, dxt, dyt, osatex, texres, 0, 0, NULL, NULL);
+	return multitex_nodes(tex, texvec, dxt, dyt, osatex, texres, 0, 0, NULL, NULL, pool);
 }
 
 /* extern-tex doesn't support nodes (ntreeBeginExec() can't be called when rendering is going on) */
-int multitex_ext_safe(Tex *tex, float texvec[3], TexResult *texres)
+int multitex_ext_safe(Tex *tex, float texvec[3], TexResult *texres, struct ImagePool *pool)
 {
 	int use_nodes= tex->use_nodes, retval;
 	
 	tex->use_nodes = FALSE;
-	retval= multitex_nodes(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL);
+	retval= multitex_nodes(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL, pool);
 	tex->use_nodes= use_nodes;
 	
 	return retval;
@@ -1699,7 +1699,8 @@ static void compatible_bump_uv_derivs(CompatibleBump *compat_bump, ShadeInput *s
 }
 
 static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi, MTex *mtex, Tex *tex, TexResult *texres,
-                                   float Tnor, const float co[3], const float dx[3], const float dy[3], float texvec[3], float dxt[3], float dyt[3])
+                                   float Tnor, const float co[3], const float dx[3], const float dy[3], float texvec[3], float dxt[3], float dyt[3],
+                                   struct ImagePool *pool)
 {
 	TexResult ttexr = {0, 0, 0, 0, 0, texres->talpha, NULL};  /* temp TexResult */
 	float tco[3], texv[3], cd, ud, vd, du, dv, idu, idv;
@@ -1727,12 +1728,12 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
 	if (!shi->osatex && (tex->type == TEX_IMAGE) && tex->ima) {
 		/* in case we have no proper derivatives, fall back to
 		 * computing du/dv it based on image size */
-		ImBuf *ibuf = BKE_image_acquire_ibuf(tex->ima, &tex->iuser, NULL);
+		ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool);
 		if (ibuf) {
 			du = 1.f/(float)ibuf->x;
 			dv = 1.f/(float)ibuf->y;
 		}
-		BKE_image_release_ibuf(tex->ima, ibuf, NULL);
+		BKE_image_pool_release_ibuf(tex->ima, ibuf, pool);
 	}
 	else if (shi->osatex) {
 		/* we have derivatives, can compute proper du/dv */
@@ -1752,8 +1753,8 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
 
 	/* center, main return value */
 	texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
-	rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres);
-	cd = fromrgb ? (texres->tr + texres->tg + texres->tb)*0.33333333f : texres->tin;
+	rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres, pool);
+	cd = fromrgb ? (texres->tr + texres->tg + texres->tb) / 3.0f : texres->tin;
 
 	if (mtex->texco == TEXCO_UV) {
 		/* for the uv case, use the same value for both du/dv,
@@ -1766,16 +1767,16 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
 		tco[1] = co[1] + compat_bump->dvdnu*du;
 		tco[2] = 0.f;
 		texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
-		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr);
-		ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
+		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
+		ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
 
 		/* +v val */
 		tco[0] = co[0] + compat_bump->dudnv*du;
 		tco[1] = co[1] + compat_bump->dvdnv*du;
 		tco[2] = 0.f;
 		texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
-		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr);
-		vd = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
+		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
+		vd = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
 	}
 	else {
 		float tu[3], tv[3];
@@ -1808,16 +1809,16 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
 		tco[1] = co[1] + tu[1]*du;
 		tco[2] = co[2] + tu[2]*du;
 		texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
-		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr);
-		ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
+		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
+		ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
 
 		/* +v val */
 		tco[0] = co[0] + tv[0]*dv;
 		tco[1] = co[1] + tv[1]*dv;
 		tco[2] = co[2] + tv[2]*dv;
 		texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
-		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr);
-		vd = idv*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
+		multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
+		vd = idv*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
 	}
 
 	/* bumped normal */
@@ -1858,7 +1859,7 @@ static void ntap_bump_init(NTapBump *ntap_bump)
 
 static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, Tex *tex, TexResult *texres,
                              float Tnor, const float co[3], const float dx[3], const float dy[3],
-                             float texvec[3], float dxt[3], float dyt[3])
+                             float texvec[3], float dxt[3], float dyt[3], struct ImagePool *pool)
 {
 	TexResult ttexr = {0, 0, 0, 0, 0, texres->talpha, NULL};	/* temp TexResult */
 
@@ -1905,20 +1906,20 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
 
 	/* resolve image dimensions */
 	if (found_deriv_map || (mtex->texflag&MTEX_BUMP_TEXTURESPACE)!=0) {
-		ImBuf *ibuf = BKE_image_acquire_ibuf(tex->ima, &tex->iuser, NULL);
+		ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool);
 		if (ibuf) {
 			dimx = ibuf->x;
 			dimy = ibuf->y;
 			aspect = ((float) dimy) / dimx;
 		}
-		BKE_image_release_ibuf(tex->ima, ibuf, NULL);
+		BKE_image_pool_release_ibuf(tex->ima, ibuf, pool);
 	}
 	
 	if (found_deriv_map) {
 		float dBdu, dBdv, auto_bump = 1.0f;
 		float s = 1;		/* negate this if flipped texture coordinate */
 		texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
-		rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres);
+		rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres, pool);
 
 		if (shi->obr->ob->derivedFinal) {
 			auto_bump = shi->obr->ob->derivedFinal->auto_bump_scale;
@@ -1960,14 +1961,14 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
 		}
 
 		/* use texres for the center sample, set rgbnor */
-		rgbnor = multitex_mtex(shi, mtex, STll, dxt, dyt, texres);
+		rgbnor = multitex_mtex(shi, mtex, STll, dxt, dyt, texres, pool);
 		Hll = (fromrgb) ? rgb_to_grayscale(&texres->tr) : texres->tin;
 
 		/* use ttexr for the other 2 taps */
-		multitex_mtex(shi, mtex, STlr, dxt, dyt, &ttexr);
+		multitex_mtex(shi, mtex, STlr, dxt, dyt, &ttexr, pool);
 		Hlr = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin;
 
-		multitex_mtex(shi, mtex, STul, dxt, dyt, &ttexr);
+		multitex_mtex(shi, mtex, STul, dxt, dyt, &ttexr, pool);
 		Hul = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin;
 
 		dHdx = Hscale*(Hlr - Hll);
@@ -1998,17 +1999,17 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
 		}
 
 		/* use texres for the center sample, set rgbnor */
-		rgbnor = multitex_mtex(shi, mtex, STc, dxt, dyt, texres);
+		rgbnor = multitex_mtex(shi, mtex, STc, dxt, dyt, texres, pool);
 		/* Hc = (fromrgb) ? rgb_to_grayscale(&texres->tr) : texres->tin; */ /* UNUSED */
 
 		/* use ttexr for the other taps */
-		multitex_mtex(shi, mtex, STl, dxt, dyt, &ttexr);
+		multitex_mtex(shi, mtex, STl, dxt, dyt, &ttexr, pool);
 		Hl = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin;
-		multitex_mtex(shi, mtex, STr, dxt, dyt, &ttexr);
+		multitex_mtex(shi, mtex, STr, dxt, dyt, &ttexr, pool);
 		Hr = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin;
-		multitex_mtex(shi, mtex, STd, dxt, dyt, &ttexr);
+		multitex_mtex(shi, mtex, STd, dxt, dyt, &ttexr, pool);
 		Hd = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin;
-		multitex_mtex(shi, mtex, STu, dxt, dyt, &ttexr);
+		multitex_mtex(shi, mtex, STu, dxt, dyt, &ttexr, pool);
 		Hu = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin;
 
 		dHdx = Hscale*(Hr - Hl);
@@ -2285,20 +2286,22 @@ void do_material_tex(ShadeInput *shi, Render *re)
 			if (texres.nor && !((tex->type==TEX_IMAGE) && (tex->imaflag & TEX_NORMALMAP))) {
 				if (use_compat_bump) {
 					rgbnor = compatible_bump_compute(&compat_bump, shi, mtex, tex,
-					                                 &texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt);
+					                                 &texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt,
+					                                 re->pool);
 				}
 				else if (use_ntap_bump) {
 					rgbnor = ntap_bump_compute(&ntap_bump, shi, mtex, tex,
-					                           &texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt);
+					                           &texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt,
+					                           re->pool);
 				}
 				else {
 					texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
-					rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, &texres);
+					rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, &texres, re->pool);
 				}
 			}
 			else {
 				texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
-				rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, &texres);
+				rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, &texres, re->pool);
 			}
 
 			/* texture output */
@@ -2402,13 +2405,13 @@ void do_material_tex(ShadeInput *shi, Render *re)
 				/* inverse gamma correction */
 				if (tex->type==TEX_IMAGE) {
 					Image *ima = tex->ima;
-					ImBuf *ibuf = BKE_image_acquire_ibuf(ima, &tex->iuser, NULL);
+					ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, re->pool);
 					
 					/* don't linearize float buffers, assumed to be linear */
 					if (ibuf && !(ibuf->rect_float) && R.scene_color_manage)
 						IMB_colormanagement_colorspace_to_scene_linear_v3(tcol, ibuf->rect_colorspace);
 
-					BKE_image_release_ibuf(ima, ibuf, NULL);
+					BKE_image_pool_release_ibuf(ima, ibuf, re->pool);
 				}
 				
 				if (mtex->mapto & MAP_COL) {
@@ -2737,7 +2740,7 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float col_
 				else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
 			}
 			
-			rgbnor= multitex(tex, texvec, NULL, NULL, 0, &texres, 0, mtex->which_output);	/* NULL = dxt/dyt, 0 = shi->osatex - not supported */
+			rgbnor = multitex(tex, texvec, NULL, NULL, 0, &texres, 0, mtex->which_output, re->pool);	/* NULL = dxt/dyt, 0 = shi->osatex - not supported */
 			
 			/* texture output */
 
@@ -2904,7 +2907,7 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
 
 	if (mtex->tex->type==TEX_IMAGE) do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
 	
-	rgb= multitex(mtex->tex, texvec, dxt, dyt, osatex, &texres, 0, mtex->which_output);
+	rgb = multitex(mtex->tex, texvec, dxt, dyt, osatex, &texres, 0, mtex->which_output, har->pool);
 
 	/* texture output */
 	if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
@@ -2936,13 +2939,13 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
 		/* inverse gamma correction */
 		if (mtex->tex->type==TEX_IMAGE) {
 			Image *ima = mtex->tex->ima;
-			ImBuf *ibuf = BKE_image_acquire_ibuf(ima, &mtex->tex->iuser, NULL);
+			ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &mtex->tex->iuser, har->pool);
 			
 			/* don't linearize float buffers, assumed to be linear */
 			if (ibuf && !(ibuf->rect_float) && R.scene_color_manage)
 				IMB_colormanagement_colorspace_to_scene_linear_v3(&texres.tr, ibuf->rect_colorspace);
 
-			BKE_image_release_ibuf(ima, ibuf, NULL);
+			BKE_image_pool_release_ibuf(ima, ibuf, har->pool);
 		}
 
 		fact= texres.tin*mtex->colfac;
@@ -3109,7 +3112,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
 			/* texture */
 			if (tex->type==TEX_IMAGE) do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
 		
-			rgb= multitex(mtex->tex, texvec, dxt, dyt, R.osa, &texres, thread, mtex->which_output);
+			rgb = multitex(mtex->tex, texvec, dxt, dyt, R.osa, &texres, thread, mtex->which_output, R.pool);
 			
 			/* texture output */
 			if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
@@ -3157,13 +3160,13 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
 				/* inverse gamma correction */
 				if (tex->type==TEX_IMAGE) {
 					Image *ima = tex->ima;
-					ImBuf *ibuf = BKE_image_acquire_ibuf(ima, &tex->iuser, NULL);
+					ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, R.pool);
 					
 					/* don't linearize float buffers, assumed to be linear */
 					if (ibuf && !(ibuf->rect_float) && R.scene_color_manage)
 						IMB_colormanagement_colorspace_to_scene_linear_v3(tcol, ibuf->rect_colorspace);
 
-					BKE_image_release_ibuf(ima, ibuf, NULL);
+					BKE_image_pool_release_ibuf(ima, ibuf, R.pool);
 				}
 
 				if (mtex->mapto & WOMAP_HORIZ) {
@@ -3324,7 +3327,7 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
 				do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
 			}
 			
-			rgb= multitex(tex, texvec, dxt, dyt, shi->osatex, &texres, shi->thread, mtex->which_output);
+			rgb = multitex(tex, texvec, dxt, dyt, shi->osatex, &texres, shi->thread, mtex->which_output, R.pool);
 
 			/* texture output */
 			if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
@@ -3373,13 +3376,13 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
 				/* inverse gamma correction */
 				if (tex->type==TEX_IMAGE) {
 					Image *ima = tex->ima;
-					ImBuf *ibuf = BKE_image_acquire_ibuf(ima, &tex->iuser, NULL);
+					ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, R.pool);
 					
 					/* don't linearize float buffers, assumed to be linear */
 					if (ibuf && !(ibuf->rect_float) && R.scene_color_manage)
 						IMB_colormanagement_colorspace_to_scene_linear_v3(&texres.tr, ibuf->rect_colorspace);
 
-					BKE_image_release_ibuf(ima, ibuf, NULL);
+					BKE_image_pool_release_ibuf(ima, ibuf, R.pool);
 				}
 
 				/* lamp colors were premultiplied with this */
@@ -3395,7 +3398,7 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
 
 /* ------------------------------------------------------------------------- */
 
-int externtex(MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta, const int thread)
+int externtex(MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta, const int thread, struct ImagePool *pool)
 {
 	Tex *tex;
 	TexResult texr;
@@ -3421,7 +3424,7 @@ int externtex(MTex *mtex, const float vec[3], float *tin, float *tr, float *tg,
 		do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
 	}
 	
-	rgb= multitex(tex, texvec, dxt, dyt, 0, &texr, thread, mtex->which_output);
+	rgb = multitex(tex, texvec, dxt, dyt, 0, &texr, thread, mtex->which_output, pool);
 	
 	if (rgb) {
 		texr.tin = rgb_to_bw(&texr.tr);
@@ -3485,8 +3488,8 @@ void render_realtime_texture(ShadeInput *shi, Image *ima)
 	
 	texr.nor= NULL;
 	
-	if (shi->osatex) imagewraposa(tex, ima, NULL, texvec, dx, dy, &texr);
-	else imagewrap(tex, ima, NULL, texvec, &texr); 
+	if (shi->osatex) imagewraposa(tex, ima, NULL, texvec, dx, dy, &texr, R.pool);
+	else imagewrap(tex, ima, NULL, texvec, &texr, R.pool); 
 
 	shi->vcol[0]*= texr.tr;
 	shi->vcol[1]*= texr.tg;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 14586f1..2d0f575 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -20,7 +20,6 @@
  *
  * Contributors: Hos, Robert Wenzlaff.
  * Contributors: 2004/2005/2006 Blender Foundation, full recode
- * Contributors: Vertex color baking, Copyright 2011 AutoCRC
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -1139,7 +1138,7 @@ static void addAlphaOverFloatMask(float *dest, float *source, unsigned short dma
 		dest[3]+= source[3];
 		
 		return;
-	 }
+	}
 
 	dest[0]= (mul*dest[0]) + source[0];
 	dest[1]= (mul*dest[1]) + source[1];
@@ -1991,932 +1990,3 @@ void add_halo_flare(Render *re)
 	R.r.mode= mode;
 }
 
-/* ************************* bake ************************ */
-
-
-typedef struct BakeShade {
-	ShadeSample ssamp;
-	ObjectInstanceRen *obi;
-	VlakRen *vlr;
-	
-	ZSpan *zspan;
-	Image *ima;
-	ImBuf *ibuf;
-	
-	int rectx, recty, quad, type, vdone, ready;
-
-	float dir[3];
-	Object *actob;
-
-	/* Output: vertex color or image data. If vcol is not NULL, rect and
-	 * rect_float should be NULL. */
-	MPoly *mpoly;
-	MLoop *mloop;
-	MLoopCol *vcol;
-	
-	unsigned int *rect;
-	float *rect_float;
-	
-	int use_mask;
-	char *rect_mask; /* bake pixel mask */
-
-	float dxco[3], dyco[3];
-
-	short *do_update;
-
-	struct ColorSpace *rect_colorspace;
-} BakeShade;
-
-static void bake_set_shade_input(ObjectInstanceRen *obi, VlakRen *vlr, ShadeInput *shi, int quad, int UNUSED(isect), int x, int y, float u, float v)
-{
-	if (quad) 
-		shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3);
-	else
-		shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2);
-		
-	/* cache for shadow */
-	shi->samplenr= R.shadowsamplenr[shi->thread]++;
-
-	shi->mask= 0xFFFF; /* all samples */
-	
-	shi->u= -u;
-	shi->v= -v;
-	shi->xs= x;
-	shi->ys= y;
-	
-	shade_input_set_uv(shi);
-	shade_input_set_normals(shi);
-
-	/* no normal flip */
-	if (shi->flippednor)
-		shade_input_flip_normals(shi);
-
-	/* set up view vector to look right at the surface (note that the normal
-	 * is negated in the renderer so it does not need to be done here) */
-	shi->view[0]= shi->vn[0];
-	shi->view[1]= shi->vn[1];
-	shi->view[2]= shi->vn[2];
-}
-
-static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(quad), int x, int y, float UNUSED(u), float UNUSED(v), float *tvn, float *ttang)
-{
-	BakeShade *bs= handle;
-	ShadeSample *ssamp= &bs->ssamp;
-	ShadeResult shr;
-	VlakRen *vlr= shi->vlr;
-	
-	shade_input_init_material(shi);
-	
-	if (bs->type==RE_BAKE_AO) {
-		ambient_occlusion(shi);
-
-		if (R.r.bake_flag & R_BAKE_NORMALIZE) {
-			copy_v3_v3(shr.combined, shi->ao);
-		}
-		else {
-			zero_v3(shr.combined);
-			environment_lighting_apply(shi, &shr);
-		}
-	}
-	else {
-		if (bs->type==RE_BAKE_SHADOW) /* Why do shadows set the color anyhow?, ignore material color for baking */
-			shi->r = shi->g = shi->b = 1.0f;
-	
-		shade_input_set_shade_texco(shi);
-		
-		/* only do AO for a full bake (and obviously AO bakes)
-		 * AO for light bakes is a leftover and might not be needed */
-		if ( ELEM3(bs->type, RE_BAKE_ALL, RE_BAKE_AO, RE_BAKE_LIGHT))
-			shade_samples_do_AO(ssamp);
-		
-		if (shi->mat->nodetree && shi->mat->use_nodes) {
-			ntreeShaderExecTree(shi->mat->nodetree, shi, &shr);
-			shi->mat= vlr->mat;		/* shi->mat is being set in nodetree */
-		}
-		else
-			shade_material_loop(shi, &shr);
-		
-		if (bs->type==RE_BAKE_NORMALS) {
-			float nor[3];
-
-			copy_v3_v3(nor, shi->vn);
-
-			if (R.r.bake_normal_space == R_BAKE_SPACE_CAMERA) {
-				/* pass */
-			}
-			else if (R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
-				float mat[3][3], imat[3][3];
-
-				/* bitangent */
-				if (tvn && ttang) {
-					copy_v3_v3(mat[0], ttang);
-					cross_v3_v3v3(mat[1], tvn, ttang);
-					mul_v3_fl(mat[1], ttang[3]);
-					copy_v3_v3(mat[2], tvn);
-				}
-				else {
-					copy_v3_v3(mat[0], shi->nmaptang);
-					cross_v3_v3v3(mat[1], shi->nmapnorm, shi->nmaptang);
-					mul_v3_fl(mat[1], shi->nmaptang[3]);
-					copy_v3_v3(mat[2], shi->nmapnorm);
-				}
-
-				invert_m3_m3(imat, mat);
-				mul_m3_v3(imat, nor);
-			}
-			else if (R.r.bake_normal_space == R_BAKE_SPACE_OBJECT)
-				mul_mat3_m4_v3(ob->imat_ren, nor); /* ob->imat_ren includes viewinv! */
-			else if (R.r.bake_normal_space == R_BAKE_SPACE_WORLD)
-				mul_mat3_m4_v3(R.viewinv, nor);
-
-			normalize_v3(nor); /* in case object has scaling */
-
-			/* The invert of the red channel is to make
-			 * the normal map compliant with the outside world.
-			 * It needs to be done because in Blender
-			 * the normal used in the renderer points inward. It is generated
-			 * this way in calc_vertexnormals(). Should this ever change
-			 * this negate must be removed. */
-			shr.combined[0]= (-nor[0])/2.0f + 0.5f;
-			shr.combined[1]= nor[1]/2.0f + 0.5f;
-			shr.combined[2]= nor[2]/2.0f + 0.5f;
-		}
-		else if (bs->type==RE_BAKE_TEXTURE) {
-			shr.combined[0]= shi->r;
-			shr.combined[1]= shi->g;
-			shr.combined[2]= shi->b;
-			shr.alpha = shi->alpha;
-		}
-		else if (bs->type==RE_BAKE_SHADOW) {
-			copy_v3_v3(shr.combined, shr.shad);
-			shr.alpha = shi->alpha;
-		}
-		else if (bs->type==RE_BAKE_SPEC_COLOR) {
-			shr.combined[0]= shi->specr;
-			shr.combined[1]= shi->specg;
-			shr.combined[2]= shi->specb;
-			shr.alpha = 1.0f;
-		}
-		else if (bs->type==RE_BAKE_SPEC_INTENSITY) {
-			shr.combined[0]=
-			shr.combined[1]=
-			shr.combined[2]= shi->spec;
-			shr.alpha = 1.0f;
-		}
-		else if (bs->type==RE_BAKE_MIRROR_COLOR) {
-			shr.combined[0]= shi->mirr;
-			shr.combined[1]= shi->mirg;
-			shr.combined[2]= shi->mirb;
-			shr.alpha = 1.0f;
-		}
-		else if (bs->type==RE_BAKE_MIRROR_INTENSITY) {
-			shr.combined[0]=
-			shr.combined[1]=
-			shr.combined[2]= shi->ray_mirror;
-			shr.alpha = 1.0f;
-		}
-		else if (bs->type==RE_BAKE_ALPHA) {
-			shr.combined[0]=
-			shr.combined[1]=
-			shr.combined[2]= shi->alpha;
-			shr.alpha = 1.0f;
-		}
-		else if (bs->type==RE_BAKE_EMIT) {
-			shr.combined[0]=
-			shr.combined[1]=
-			shr.combined[2]= shi->emit;
-			shr.alpha = 1.0f;
-		}
-	}
-	
-	if (bs->rect_float && !bs->vcol) {
-		float *col= bs->rect_float + 4*(bs->rectx*y + x);
-		copy_v3_v3(col, shr.combined);
-		if (bs->type==RE_BAKE_ALL || bs->type==RE_BAKE_TEXTURE) {
-			col[3]= shr.alpha;
-		}
-		else {
-			col[3]= 1.0;
-		}
-	}
-	else {
-		/* Target is char (LDR). */
-		unsigned char col[4];
-
-		if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE)) {
-			float rgb[3];
-
-			copy_v3_v3(rgb, shr.combined);
-			if (R.scene_color_manage)
-				IMB_colormanagement_scene_linear_to_colorspace_v3(rgb, bs->rect_colorspace);
-			rgb_float_to_uchar(col, rgb);
-		}
-		else {
-			rgb_float_to_uchar(col, shr.combined);
-		}
-		
-		if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE)) {
-			col[3]= FTOCHAR(shr.alpha);
-		}
-		else {
-			col[3]= 255;
-		}
-
-		if (bs->vcol) {
-			/* Vertex colour baking. Vcol has no useful alpha channel (it exists
-			 * but is used only for vertex painting). */
-			bs->vcol->r = col[0];
-			bs->vcol->g = col[1];
-			bs->vcol->b = col[2];
-		}
-		else {
-			unsigned char *imcol= (unsigned char *)(bs->rect + bs->rectx*y + x);
-			copy_v4_v4_char((char *)imcol, (char *)col);
-		}
-
-	}
-	
-	if (bs->rect_mask) {
-		bs->rect_mask[bs->rectx*y + x] = FILTER_MASK_USED;
-	}
-}
-
-static void bake_displacement(void *handle, ShadeInput *UNUSED(shi), float dist, int x, int y)
-{
-	BakeShade *bs= handle;
-	float disp;
-	
-	if (R.r.bake_flag & R_BAKE_NORMALIZE && R.r.bake_maxdist) {
-		disp = (dist+R.r.bake_maxdist) / (R.r.bake_maxdist*2); /* alter the range from [-bake_maxdist, bake_maxdist] to [0, 1]*/
-	}
-	else {
-		disp = 0.5f + dist; /* alter the range from [-0.5,0.5] to [0,1]*/
-	}
-	
-	if (bs->rect_float && !bs->vcol) {
-		float *col= bs->rect_float + 4*(bs->rectx*y + x);
-		col[0] = col[1] = col[2] = disp;
-		col[3]= 1.0f;
-	}
-	else {
-		/* Target is char (LDR). */
-		unsigned char col[4];
-		col[0] = col[1] = col[2] = FTOCHAR(disp);
-		col[3] = 255;
-
-		if(bs->vcol) {
-			/* Vertex colour baking. Vcol has no useful alpha channel (it exists
-			 * but is used only for vertex painting). */
-			bs->vcol->r = col[0];
-			bs->vcol->g = col[1];
-			bs->vcol->b = col[2];
-		}
-		else {
-			char *imcol= (char *)(bs->rect + bs->rectx*y + x);
-			copy_v4_v4_char((char *)imcol, (char *)col);
-		}
-	}
-	if (bs->rect_mask) {
-		bs->rect_mask[bs->rectx*y + x] = FILTER_MASK_USED;
-	}
-}
-
-static int bake_intersect_tree(RayObject* raytree, Isect* isect, float *start, float *dir, float sign, float *hitco, float *dist)
-{
-	float maxdist;
-	int hit;
-
-	/* might be useful to make a user setting for maxsize*/
-	if (R.r.bake_maxdist > 0.0f)
-		maxdist= R.r.bake_maxdist;
-	else
-		maxdist= RE_RAYTRACE_MAXDIST + R.r.bake_biasdist;
-
-	/* 'dir' is always normalized */
-	madd_v3_v3v3fl(isect->start, start, dir, -R.r.bake_biasdist);
-
-	mul_v3_v3fl(isect->dir, dir, sign);
-
-	isect->dist = maxdist;
-
-	hit = RE_rayobject_raycast(raytree, isect);
-	if (hit) {
-		madd_v3_v3v3fl(hitco, isect->start, isect->dir, isect->dist);
-
-		*dist= isect->dist;
-	}
-
-	return hit;
-}
-
-static void bake_set_vlr_dxyco(BakeShade *bs, float *uv1, float *uv2, float *uv3)
-{
-	VlakRen *vlr= bs->vlr;
-	float A, d1, d2, d3, *v1, *v2, *v3;
-
-	if (bs->quad) {
-		v1= vlr->v1->co;
-		v2= vlr->v3->co;
-		v3= vlr->v4->co;
-	}
-	else {
-		v1= vlr->v1->co;
-		v2= vlr->v2->co;
-		v3= vlr->v3->co;
-	}
-
-	/* formula derived from barycentric coordinates:
-	 * (uvArea1*v1 + uvArea2*v2 + uvArea3*v3)/uvArea
-	 * then taking u and v partial derivatives to get dxco and dyco */
-	A= (uv2[0] - uv1[0])*(uv3[1] - uv1[1]) - (uv3[0] - uv1[0])*(uv2[1] - uv1[1]);
-
-	if (fabsf(A) > FLT_EPSILON) {
-		A= 0.5f/A;
-
-		d1= uv2[1] - uv3[1];
-		d2= uv3[1] - uv1[1];
-		d3= uv1[1] - uv2[1];
-		bs->dxco[0]= (v1[0]*d1 + v2[0]*d2 + v3[0]*d3)*A;
-		bs->dxco[1]= (v1[1]*d1 + v2[1]*d2 + v3[1]*d3)*A;
-		bs->dxco[2]= (v1[2]*d1 + v2[2]*d2 + v3[2]*d3)*A;
-
-		d1= uv3[0] - uv2[0];
-		d2= uv1[0] - uv3[0];
-		d3= uv2[0] - uv1[0];
-		bs->dyco[0]= (v1[0]*d1 + v2[0]*d2 + v3[0]*d3)*A;
-		bs->dyco[1]= (v1[1]*d1 + v2[1]*d2 + v3[1]*d3)*A;
-		bs->dyco[2]= (v1[2]*d1 + v2[2]*d2 + v3[2]*d3)*A;
-	}
-	else {
-		bs->dxco[0]= bs->dxco[1]= bs->dxco[2]= 0.0f;
-		bs->dyco[0]= bs->dyco[1]= bs->dyco[2]= 0.0f;
-	}
-
-	if (bs->obi->flag & R_TRANSFORMED) {
-		mul_m3_v3(bs->obi->nmat, bs->dxco);
-		mul_m3_v3(bs->obi->nmat, bs->dyco);
-	}
-}
-
-static void do_bake_shade(void *handle, int x, int y, float u, float v)
-{
-	BakeShade *bs= handle;
-	VlakRen *vlr= bs->vlr;
-	ObjectInstanceRen *obi= bs->obi;
-	Object *ob= obi->obr->ob;
-	float l, *v1, *v2, *v3, tvn[3], ttang[4];
-	int quad;
-	ShadeSample *ssamp= &bs->ssamp;
-	ShadeInput *shi= ssamp->shi;
-	
-	/* fast threadsafe break test */
-	if (R.test_break(R.tbh))
-		return;
-	
-	/* setup render coordinates */
-	if (bs->quad) {
-		v1= vlr->v1->co;
-		v2= vlr->v3->co;
-		v3= vlr->v4->co;
-	}
-	else {
-		v1= vlr->v1->co;
-		v2= vlr->v2->co;
-		v3= vlr->v3->co;
-	}
-
-	l= 1.0f-u-v;
-
-	/* shrink barycentric coordinates inwards slightly to avoid some issues
-	 * where baking selected to active might just miss the other face at the
-	 * near the edge of a face */
-	if (bs->actob) {
-		const float eps = 1.0f - 1e-4f;
-		float invsum;
-
-		u = (u - 0.5f)*eps + 0.5f;
-		v = (v - 0.5f)*eps + 0.5f;
-		l = (l - 0.5f)*eps + 0.5f;
-
-		invsum = 1.0f/(u + v + l);
-
-		u *= invsum;
-		v *= invsum;
-		l *= invsum;
-	}
-	
-	/* renderco */
-	shi->co[0]= l*v3[0]+u*v1[0]+v*v2[0];
-	shi->co[1]= l*v3[1]+u*v1[1]+v*v2[1];
-	shi->co[2]= l*v3[2]+u*v1[2]+v*v2[2];
-	
-	if (obi->flag & R_TRANSFORMED)
-		mul_m4_v3(obi->mat, shi->co);
-	
-	copy_v3_v3(shi->dxco, bs->dxco);
-	copy_v3_v3(shi->dyco, bs->dyco);
-
-	quad= bs->quad;
-	bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v);
-
-	if (bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
-		shade_input_set_shade_texco(shi);
-		copy_v3_v3(tvn, shi->nmapnorm);
-		copy_v4_v4(ttang, shi->nmaptang);
-	}
-
-	/* if we are doing selected to active baking, find point on other face */
-	if (bs->actob) {
-		Isect isec, minisec;
-		float co[3], minco[3], dist, mindist=0.0f;
-		int hit, sign, dir=1;
-		
-		/* intersect with ray going forward and backward*/
-		hit= 0;
-		memset(&minisec, 0, sizeof(minisec));
-		minco[0]= minco[1]= minco[2]= 0.0f;
-		
-		copy_v3_v3(bs->dir, shi->vn);
-		
-		for (sign=-1; sign<=1; sign+=2) {
-			memset(&isec, 0, sizeof(isec));
-			isec.mode= RE_RAY_MIRROR;
-
-			isec.orig.ob   = obi;
-			isec.orig.face = vlr;
-			isec.userdata= bs->actob;
-			isec.check = RE_CHECK_VLR_BAKE;
-			isec.skip = RE_SKIP_VLR_NEIGHBOUR;
-			
-			if (bake_intersect_tree(R.raytree, &isec, shi->co, shi->vn, sign, co, &dist)) {
-				if (!hit || len_squared_v3v3(shi->co, co) < len_squared_v3v3(shi->co, minco)) {
-					minisec= isec;
-					mindist= dist;
-					copy_v3_v3(minco, co);
-					hit= 1;
-					dir = sign;
-				}
-			}
-		}
-
-		if (bs->type==RE_BAKE_DISPLACEMENT) {
-			if (hit)
-				bake_displacement(handle, shi, (dir==-1)? mindist:-mindist, x, y);
-			else
-				bake_displacement(handle, shi, 0.0f, x, y);
-			return;
-		}
-
-		/* if hit, we shade from the new point, otherwise from point one starting face */
-		if (hit) {
-			obi = (ObjectInstanceRen *)minisec.hit.ob;
-			vlr = (VlakRen *)minisec.hit.face;
-			quad= (minisec.isect == 2);
-			copy_v3_v3(shi->co, minco);
-			
-			u= -minisec.u;
-			v= -minisec.v;
-			bake_set_shade_input(obi, vlr, shi, quad, 1, x, y, u, v);
-		}
-	}
-
-	if (bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT)
-		bake_shade(handle, ob, shi, quad, x, y, u, v, tvn, ttang);
-	else
-		bake_shade(handle, ob, shi, quad, x, y, u, v, 0, 0);
-}
-
-static int get_next_bake_face(BakeShade *bs)
-{
-	ObjectRen *obr;
-	VlakRen *vlr;
-	MTFace *tface;
-	static int v= 0, vdone = FALSE;
-	static ObjectInstanceRen *obi= NULL;
-	
-	if (bs==NULL) {
-		vlr= NULL;
-		v= vdone = FALSE;
-		obi= R.instancetable.first;
-		return 0;
-	}
-	
-	BLI_lock_thread(LOCK_CUSTOM1);
-
-	for (; obi; obi=obi->next, v=0) {
-		obr= obi->obr;
-
-		for (; v<obr->totvlak; v++) {
-			vlr= RE_findOrAddVlak(obr, v);
-
-			if ((bs->actob && bs->actob == obr->ob) || (!bs->actob && (obr->ob->flag & SELECT))) {
-				if(R.r.bake_flag & R_BAKE_VCOL) {
-					/* Gather face data for vertex colour bake */
-					Mesh *me;
-					int *origindex, vcollayer;
-					CustomDataLayer *cdl;
-
-					if(obr->ob->type != OB_MESH)
-						continue;
-					me = obr->ob->data;
-
-					origindex = RE_vlakren_get_origindex(obr, vlr, 0);
-					if(origindex == NULL)
-						continue;
-					if (*origindex >= me->totpoly) {
-						/* Small hack for Array modifier, which gives false
-						   original indices - z0r */
-						continue;
-					}
-#if 0
-					/* Only shade selected faces. */
-					if((me->mface[*origindex].flag & ME_FACE_SEL) == 0)
-						continue;
-#endif
-
-					vcollayer = CustomData_get_render_layer_index(&me->ldata, CD_MLOOPCOL);
-					if(vcollayer == -1)
-						continue;
-
-					cdl = &me->ldata.layers[vcollayer];
-					bs->mpoly = me->mpoly + *origindex;
-					bs->vcol = ((MLoopCol*)cdl->data) + bs->mpoly->loopstart;
-					bs->mloop = me->mloop + bs->mpoly->loopstart;
-
-					/* Tag mesh for reevaluation. */
-					DAG_id_tag_update(&me->id, 0);
-				}
-				else {
-					Image *ima = NULL;
-					ImBuf *ibuf = NULL;
-					const float vec_alpha[4]= {0.0f, 0.0f, 0.0f, 0.0f};
-					const float vec_solid[4]= {0.0f, 0.0f, 0.0f, 1.0f};
-
-					tface= RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
-
-					if (!tface || !tface->tpage)
-						continue;
-
-					ima = tface->tpage;
-					ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
-					
-					if (ibuf==NULL)
-						continue;
-					
-					if (ibuf->rect==NULL && ibuf->rect_float==NULL) {
-						BKE_image_release_ibuf(ima, ibuf, NULL);
-						continue;
-					}
-					
-					if (ibuf->rect_float && !(ibuf->channels==0 || ibuf->channels==4)) {
-						BKE_image_release_ibuf(ima, ibuf, NULL);
-						continue;
-					}
-					
-					if (ima->flag & IMA_USED_FOR_RENDER) {
-						ima->id.flag &= ~LIB_DOIT;
-						BKE_image_release_ibuf(ima, ibuf, NULL);
-						continue;
-					}
-					
-					/* find the image for the first time? */
-					if (ima->id.flag & LIB_DOIT) {
-						ima->id.flag &= ~LIB_DOIT;
-						
-						/* we either fill in float or char, this ensures things go fine */
-						if (ibuf->rect_float)
-							imb_freerectImBuf(ibuf);
-						/* clear image */
-						if (R.r.bake_flag & R_BAKE_CLEAR)
-							IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
-
-						/* might be read by UI to set active image for display */
-						R.bakebuf= ima;
-					}
-
-					/* Tag image for redraw. */
-					ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
-					BKE_image_release_ibuf(ima, ibuf, NULL);
-				}
-
-				bs->obi = obi;
-				bs->vlr = vlr;
-				bs->vdone++;	/* only for error message if nothing was rendered */
-				v++;
-				BLI_unlock_thread(LOCK_CUSTOM1);
-				return 1;
-			}
-		}
-	}
-	
-	BLI_unlock_thread(LOCK_CUSTOM1);
-	return 0;
-}
-
-static void bake_single_vertex(BakeShade *bs, VertRen *vert, float u, float v)
-{
-	int *origindex, i;
-	MLoopCol *basevcol;
-	MLoop *mloop;
-
-	origindex = RE_vertren_get_origindex(bs->obi->obr, vert, 0);
-	if (!origindex || *origindex == ORIGINDEX_NONE)
-		return;
-
-	/* Search for matching vertex index and apply shading. */
-	for (i = 0; i < bs->mpoly->totloop; i++) {
-		mloop = bs->mloop + i;
-		if (mloop->v != *origindex)
-			continue;
-		basevcol = bs->vcol;
-		bs->vcol = basevcol + i;
-		do_bake_shade(bs, 0, 0, u, v);
-		bs->vcol = basevcol;
-		break;
-	}
-}
-
-/* Bake all vertices of a face. Actually, this still works on a face-by-face
-   basis, and each vertex on each face is shaded. Vertex colors are a property
-   of loops, not vertices. */
-static void shade_verts(BakeShade *bs)
-{
-	VlakRen *vlr = bs->vlr;
-
-	/* Disable baking to image; write to vcol instead. vcol pointer is set in
-	 * bake_single_vertex. */
-	bs->ima = NULL;
-	bs->rect = NULL;
-	bs->rect_float = NULL;
-
-	bs->quad = 0;
-
-	/* No anti-aliasing for vertices. */
-	zero_v3(bs->dxco);
-	zero_v3(bs->dyco);
-
-	/* Shade each vertex of the face. u and v are barycentric coordinates; since
-	   we're only interested in vertices, these will be 0 or 1. */
-	if ((vlr->flag & R_FACE_SPLIT) == 0) {
-		/* Processing triangle face, whole quad, or first half of split quad. */
-
-		bake_single_vertex(bs, bs->vlr->v1, 1.0f, 0.0f);
-		bake_single_vertex(bs, bs->vlr->v2, 0.0f, 1.0f);
-		bake_single_vertex(bs, bs->vlr->v3, 0.0f, 0.0f);
-
-		if (vlr->v4) {
-			bs->quad = 1;
-			bake_single_vertex(bs, bs->vlr->v4, 0.0f, 0.0f);
-		}
-	}
-	else {
-		/* Processing second half of split quad. Only one vertex to go. */
-		if (vlr->flag & R_DIVIDE_24) {
-			bake_single_vertex(bs, bs->vlr->v2, 0.0f, 1.0f);
-		}
-		else {
-			bake_single_vertex(bs, bs->vlr->v3, 0.0f, 0.0f);
-		}
-	}
-}
-
-/* already have tested for tface and ima and zspan */
-static void shade_tface(BakeShade *bs)
-{
-	VlakRen *vlr= bs->vlr;
-	ObjectInstanceRen *obi= bs->obi;
-	ObjectRen *obr= obi->obr;
-	MTFace *tface= RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
-	Image *ima= tface->tpage;
-	float vec[4][2];
-	int a, i1, i2, i3;
-	
-	/* check valid zspan */
-	if (ima!=bs->ima) {
-		BKE_image_release_ibuf(bs->ima, bs->ibuf, NULL);
-
-		bs->ima= ima;
-		bs->ibuf= BKE_image_acquire_ibuf(ima, NULL, NULL);
-		/* note, these calls only free/fill contents of zspan struct, not zspan itself */
-		zbuf_free_span(bs->zspan);
-		zbuf_alloc_span(bs->zspan, bs->ibuf->x, bs->ibuf->y, R.clipcrop);
-	}
-	
-	bs->rectx= bs->ibuf->x;
-	bs->recty= bs->ibuf->y;
-	bs->rect= bs->ibuf->rect;
-	bs->rect_colorspace= bs->ibuf->rect_colorspace;
-	bs->rect_float= bs->ibuf->rect_float;
-	bs->vcol = NULL;
-	bs->quad= 0;
-	
-	if (bs->use_mask) {
-		if (bs->ibuf->userdata==NULL) {
-			BLI_lock_thread(LOCK_CUSTOM1);
-			if (bs->ibuf->userdata==NULL) /* since the thread was locked, its possible another thread alloced the value */
-				bs->ibuf->userdata = (void *)MEM_callocN(sizeof(char)*bs->rectx*bs->recty, "BakeMask");
-			bs->rect_mask= (char *)bs->ibuf->userdata;
-			BLI_unlock_thread(LOCK_CUSTOM1);
-		}
-		else {
-			bs->rect_mask= (char *)bs->ibuf->userdata;
-		}
-	}
-	
-	/* get pixel level vertex coordinates */
-	for (a=0; a<4; a++) {
-		/* Note, workaround for pixel aligned UVs which are common and can screw up our intersection tests
-		 * where a pixel gets in between 2 faces or the middle of a quad,
-		 * camera aligned quads also have this problem but they are less common.
-		 * Add a small offset to the UVs, fixes bug #18685 - Campbell */
-		vec[a][0]= tface->uv[a][0]*(float)bs->rectx - (0.5f + 0.001f);
-		vec[a][1]= tface->uv[a][1]*(float)bs->recty - (0.5f + 0.002f);
-	}
-	
-	/* UV indices have to be corrected for possible quad->tria splits */
-	i1= 0; i2= 1; i3= 2;
-	vlr_set_uv_indices(vlr, &i1, &i2, &i3);
-	bake_set_vlr_dxyco(bs, vec[i1], vec[i2], vec[i3]);
-	zspan_scanconvert(bs->zspan, bs, vec[i1], vec[i2], vec[i3], do_bake_shade);
-	
-	if (vlr->v4) {
-		bs->quad= 1;
-		bake_set_vlr_dxyco(bs, vec[0], vec[2], vec[3]);
-		zspan_scanconvert(bs->zspan, bs, vec[0], vec[2], vec[3], do_bake_shade);
-	}
-}
-
-static void *do_bake_thread(void *bs_v)
-{
-	BakeShade *bs= bs_v;
-	
-	while (get_next_bake_face(bs)) {
-		if (R.r.bake_flag & R_BAKE_VCOL)
-			shade_verts(bs);
-		else
-			shade_tface(bs);
-		
-		/* fast threadsafe break test */
-		if (R.test_break(R.tbh))
-			break;
-
-		/* access is not threadsafe but since its just true/false probably ok
-		 * only used for interactive baking */
-		if (bs->do_update)
-			*bs->do_update= TRUE;
-	}
-	bs->ready= 1;
-
-	BKE_image_release_ibuf(bs->ima, bs->ibuf, NULL);
-
-	return NULL;
-}
-
-void RE_bake_ibuf_filter(ImBuf *ibuf, char *mask, const int filter)
-{
-	/* must check before filtering */
-	const short is_new_alpha= (ibuf->planes != R_IMF_PLANES_RGBA) && BKE_imbuf_alpha_test(ibuf);
-
-	/* Margin */
-	if (filter) {
-		IMB_filter_extend(ibuf, mask, filter);
-	}
-
-	/* if the bake results in new alpha then change the image setting */
-	if (is_new_alpha) {
-		ibuf->planes= R_IMF_PLANES_RGBA;
-	}
-	else {
-		if (filter && ibuf->planes != R_IMF_PLANES_RGBA) {
-			/* clear alpha added by filtering */
-			IMB_rectfill_alpha(ibuf, 1.0f);
-		}
-	}
-}
-
-/* using object selection tags, the faces with UV maps get baked */
-/* render should have been setup */
-/* returns 0 if nothing was handled */
-int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_update, float *progress)
-{
-	BakeShade *handles;
-	ListBase threads;
-	Image *ima;
-	int a, vdone = FALSE, use_mask = FALSE, result = BAKE_RESULT_OK;
-	
-	re->scene_color_manage = BKE_scene_check_color_management_enabled(re->scene);
-	
-	/* initialize render global */
-	R= *re;
-	R.bakebuf= NULL;
-	
-	/* initialize static vars */
-	get_next_bake_face(NULL);
-	
-	/* do we need a mask? */
-	if (re->r.bake_filter)
-		use_mask = TRUE;
-	
-	/* baker uses this flag to detect if image was initialized */
-	if ((R.r.bake_flag & R_BAKE_VCOL) == 0) {
-		for (ima = G.main->image.first; ima; ima = ima->id.next) {
-			ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
-			ima->id.flag |= LIB_DOIT;
-			ima->flag &= ~IMA_USED_FOR_RENDER;
-			if (ibuf) {
-				ibuf->userdata = NULL; /* use for masking if needed */
-			}
-			BKE_image_release_ibuf(ima, ibuf, NULL);
-		}
-	}
-	
-	BLI_init_threads(&threads, do_bake_thread, re->r.threads);
-
-	handles= MEM_callocN(sizeof(BakeShade)*re->r.threads, "BakeShade");
-
-	/* get the threads running */
-	for (a=0; a<re->r.threads; a++) {
-		/* set defaults in handles */
-		handles[a].ssamp.shi[0].lay= re->lay;
-		
-		if (type==RE_BAKE_SHADOW) {
-			handles[a].ssamp.shi[0].passflag= SCE_PASS_SHADOW;
-		}
-		else {
-			handles[a].ssamp.shi[0].passflag= SCE_PASS_COMBINED;
-		}
-		handles[a].ssamp.shi[0].combinedflag= ~(SCE_PASS_SPEC);
-		handles[a].ssamp.shi[0].thread= a;
-		handles[a].ssamp.tot= 1;
-		
-		handles[a].type= type;
-		handles[a].actob= actob;
-		if (R.r.bake_flag & R_BAKE_VCOL)
-			handles[a].zspan = NULL;
-		else
-			handles[a].zspan = MEM_callocN(sizeof(ZSpan), "zspan for bake");
-		
-		handles[a].use_mask = use_mask;
-
-		handles[a].do_update = do_update; /* use to tell the view to update */
-		
-		BLI_insert_thread(&threads, &handles[a]);
-	}
-	
-	/* wait for everything to be done */
-	a= 0;
-	while (a!=re->r.threads) {
-		PIL_sleep_ms(50);
-
-		/* calculate progress */
-		for (vdone = FALSE, a=0; a<re->r.threads; a++)
-			vdone+= handles[a].vdone;
-		if (progress)
-			*progress = (float)(vdone / (float)re->totvlak);
-		
-		for (a=0; a<re->r.threads; a++) {
-			if (handles[a].ready==0)
-				break;
-		}
-	}
-	
-	/* filter and refresh images */
-	if ((R.r.bake_flag & R_BAKE_VCOL) == 0) {
-		for (ima = G.main->image.first; ima; ima = ima->id.next) {
-			if ((ima->id.flag & LIB_DOIT)==0) {
-				ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
-
-				if (ima->flag & IMA_USED_FOR_RENDER)
-					result = BAKE_RESULT_FEEDBACK_LOOP;
-
-				if (!ibuf)
-					continue;
-
-				RE_bake_ibuf_filter(ibuf, (char *)ibuf->userdata, re->r.bake_filter);
-
-				ibuf->userflags |= IB_BITMAPDIRTY;
-				BKE_image_release_ibuf(ima, ibuf, NULL);
-			}
-		}
-
-		/* calculate return value */
-		for (a = 0; a < re->r.threads; a++) {
-			zbuf_free_span(handles[a].zspan);
-			MEM_freeN(handles[a].zspan);
-		}
-	}
-
-	MEM_freeN(handles);
-	
-	BLI_end_threads(&threads);
-
-	if (vdone==0)
-		result= BAKE_RESULT_NO_OBJECTS;
-
-	return result;
-}
-
-struct Image *RE_bake_shade_get_image(void)
-{
-	return R.bakebuf;
-}
diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c
index 7ca4f01..0a8af1c 100644
--- a/source/blender/render/intern/source/renderdatabase.c
+++ b/source/blender/render/intern/source/renderdatabase.c
@@ -361,8 +361,8 @@ int *RE_vlakren_get_origindex(ObjectRen *obr, VlakRen *vlak, int verify)
 	int nr= vlak->index>>8;
 
 	origindex= obr->vlaknodes[nr].origindex;
-	if(origindex==NULL) {
-		if(verify)
+	if (origindex==NULL) {
+		if (verify)
 			origindex= obr->vlaknodes[nr].origindex= MEM_callocN(256*RE_VLAK_ORIGINDEX_ELEMS*sizeof(int), "origindex table");
 		else
 			return NULL;
@@ -440,7 +440,7 @@ VlakRen *RE_vlakren_copy(ObjectRen *obr, VlakRen *vlr)
 	}
 
 	origindex= RE_vlakren_get_origindex(obr, vlr, 0);
-	if(origindex) {
+	if (origindex) {
 		origindex1= RE_vlakren_get_origindex(obr, vlr1, 1);
 		/* Just an int, but memcpy for consistency. */
 		memcpy(origindex1, origindex, sizeof(int)*RE_VLAK_ORIGINDEX_ELEMS);
@@ -791,7 +791,7 @@ void free_renderdata_vlaknodes(VlakTableNode *vlaknodes)
 			MEM_freeN(vlaknodes[a].mtface);
 		if (vlaknodes[a].mcol)
 			MEM_freeN(vlaknodes[a].mcol);
-		if(vlaknodes[a].origindex)
+		if (vlaknodes[a].origindex)
 			MEM_freeN(vlaknodes[a].origindex);
 		if (vlaknodes[a].surfnor)
 			MEM_freeN(vlaknodes[a].surfnor);
@@ -1051,7 +1051,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma,
 				}
 			}
 
-			externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0);
+			externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0, re->pool);
 
 			yn= tin*mtex->colfac;
 			//zn= tin*mtex->alphafac;
@@ -1070,6 +1070,8 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma,
 		}
 	}
 
+	har->pool = re->pool;
+
 	return har;
 }
 
@@ -1180,7 +1182,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
 				copy_v3_v3(texvec, orco);
 			}
 
-			hasrgb = externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0);
+			hasrgb = externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0, re->pool);
 
 			//yn= tin*mtex->colfac;
 			//zn= tin*mtex->alphafac;
@@ -1223,6 +1225,8 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
 			//}
 		}
 
+	har->pool = re->pool;
+
 	return har;
 }
 
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 87912f5..1a24055 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -38,10 +38,6 @@
 #include "DNA_lamp_types.h"
 #include "DNA_material_types.h"
 
-#include "BKE_global.h"
-#include "BKE_scene.h"
-
-
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_jitter.h"
@@ -49,6 +45,9 @@
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_global.h"
+#include "BKE_scene.h"
+
 #include "PIL_time.h"
 
 #include "renderpipeline.h"
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index db93a21..bf0087d 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -151,6 +151,7 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
 /* do a shade, finish up some passes, apply mist */
 void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
 {
+	bool compat = false;
 	float alpha;
 	
 	/* ------  main shading loop -------- */
@@ -158,10 +159,11 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
 	memset(&shi->raycounter, 0, sizeof(shi->raycounter));
 #endif
 	
-	if (shi->mat->nodetree && shi->mat->use_nodes) {
-		ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
-	}
-	else {
+	if (shi->mat->nodetree && shi->mat->use_nodes)
+		compat = ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
+	
+	/* also run this when node shaders fail, due to incompatible shader nodes */
+	if (compat == false) {
 		/* copy all relevant material vars, note, keep this synced with render_types.h */
 		shade_input_init_material(shi);
 		
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index a37ffb1..8b83ca4 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -676,14 +676,14 @@ static void strand_render(Render *re, StrandSegment *sseg, float winmat[4][4], S
 	else {
 		float hoco1[4], hoco2[4];
 		int a, obi, index;
-  
+
 		obi= sseg->obi - re->objectinstance;
 		index= sseg->strand->index;
 
 		projectvert(p1->co, winmat, hoco1);
 		projectvert(p2->co, winmat, hoco2);
 
-  
+
 		for (a=0; a<totzspan; a++) {
 #if 0
 			/* render both strand and single pixel wire to counter aliasing */
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index 77d6644..9209906 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -185,7 +185,7 @@ static void load_frame_image_sequence(VoxelData *vd, Tex *tex)
 		for (y = 0; y < ibuf->y; y++) {
 			for (x = 0; x < ibuf->x; x++) {
 				/* currently averaged to monchrome */
-				vd->dataset[BLI_VOXEL_INDEX(x, y, z, vd->resol)] = (rf[0] + rf[1] + rf[2]) * 0.333f;
+				vd->dataset[BLI_VOXEL_INDEX(x, y, z, vd->resol)] = (rf[0] + rf[1] + rf[2]) / 3.0f;
 				rf += 4;
 			}
 		}
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index eb1aad7..a1437b7 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -131,6 +131,7 @@ void		*WM_paint_cursor_activate(struct wmWindowManager *wm,
 void		WM_paint_cursor_end(struct wmWindowManager *wm, void *handle);
 
 void		WM_cursor_warp		(struct wmWindow *win, int x, int y);
+float		WM_cursor_pressure	(const struct wmWindow *win);
 
 			/* event map */
 int			WM_userdef_event_map(int kmitype);
@@ -147,11 +148,11 @@ void		WM_event_remove_keymap_handler(ListBase *handlers, wmKeyMap *keymap);
 
 struct wmEventHandler *WM_event_add_ui_handler(
 		const struct bContext *C, ListBase *handlers,
-		int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
+		int (*func)(struct bContext *C, const struct wmEvent *event, void *userdata),
 		void (*remove)(struct bContext *C, void *userdata), void *userdata);
 
 void		WM_event_remove_ui_handler(ListBase *handlers,
-                                       int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
+                                       int (*func)(struct bContext *C, const struct wmEvent *event, void *userdata),
                                        void (*remove)(struct bContext *C, void *userdata),
                                        void *userdata, int postpone);
 void		WM_event_remove_area_handler(struct ListBase *handlers, void *area);
@@ -170,7 +171,7 @@ int			WM_modal_tweak_exit(struct wmEvent *evt, int tweak_event);
 void		WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference);
 void		WM_main_add_notifier(unsigned int type, void *reference);
 
-void		wm_event_add		(struct wmWindow *win, struct wmEvent *event_to_add); /* XXX only for warning */
+void		wm_event_add(struct wmWindow *win, const struct wmEvent *event_to_add);
 
 			/* at maximum, every timestep seconds it triggers event_type events */
 struct wmTimer *WM_event_add_timer(struct wmWindowManager *wm, struct wmWindow *win, int event_type, double timestep);
@@ -201,6 +202,7 @@ int			WM_operator_confirm_message(struct bContext *C, struct wmOperator *op, con
 		/* operator api */
 void		WM_operator_free		(struct wmOperator *op);
 void		WM_operator_stack_clear(struct wmWindowManager *wm);
+void		WM_operator_handlers_clear(wmWindowManager *wm, struct wmOperatorType *ot);
 
 struct wmOperatorType *WM_operatortype_find(const char *idnamem, int quiet);
 struct GHashIterator  *WM_operatortype_iter(void);
@@ -309,6 +311,8 @@ void		WM_event_fileselect_event(struct bContext *C, void *ophandle, int eventval
 void		WM_event_print(struct wmEvent *event);
 #endif
 
+void		WM_operator_region_active_win_set(struct bContext *C);
+
 			/* drag and drop */
 struct wmDrag		*WM_event_start_drag(struct bContext *C, int icon, int type, void *poin, double value);
 void				WM_event_drag_image(struct wmDrag *, struct ImBuf *, float scale, int sx, int sy);
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h
index 4336915..49ee759 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -64,7 +64,7 @@ wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, in
                                  int val, int modifier, int keymodifier);
 
 int			WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
-char		*WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len);
+int         WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, const int len);
 
 wmKeyMap	*WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
 wmKeyMap	*WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
@@ -81,6 +81,7 @@ wmKeyMap	*WM_modalkeymap_add(struct wmKeyConfig *keyconf, const char *idname, st
 wmKeyMap	*WM_modalkeymap_get(struct wmKeyConfig *keyconf, const char *idname);
 wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value);
 wmKeyMapItem *WM_modalkeymap_add_item_str(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, const char *value);
+wmKeyMapItem *WM_modalkeymap_find_propvalue(wmKeyMap *km, const int propvalue);
 void		WM_modalkeymap_assign(struct wmKeyMap *km, const char *opname);
 
 /* Keymap Editor */
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 96a7b15..bbaa655 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -188,7 +188,7 @@ enum {
 #define WM_UI_HANDLER_CONTINUE	0
 #define WM_UI_HANDLER_BREAK		1
 
-typedef int (*wmUIHandlerFunc)(struct bContext *C, struct wmEvent *event, void *userdata);
+typedef int (*wmUIHandlerFunc)(struct bContext *C, const struct wmEvent *event, void *userdata);
 typedef void (*wmUIHandlerRemoveFunc)(struct bContext *C, void *userdata);
 
 /* ************** Notifiers ****************** */
@@ -445,7 +445,10 @@ typedef struct wmEvent {
 	
 	/* keymap item, set by handler (weak?) */
 	const char *keymap_idname;
-	
+
+	/* tablet info, only use when the tablet is active */
+	struct wmTabletData *tablet_data;
+
 	/* custom data */
 	short custom;		/* custom data type, stylus, 6dof, see wm_event_types.h */
 	short customdatafree;
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 53e67e9..a01f730 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -149,6 +149,31 @@ void WM_operator_stack_clear(wmWindowManager *wm)
 	WM_main_add_notifier(NC_WM | ND_HISTORY, NULL);
 }
 
+/**
+ * This function is needed in the case when an addon id disabled
+ * while a modal operator it defined is running.
+ */
+void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
+{
+	wmWindow *win;
+	for (win = wm->windows.first; win; win = win->next) {
+		ListBase *lb[2] = {&win->handlers, &win->modalhandlers};
+		wmEventHandler *handler;
+		int i;
+
+		for (i = 0; i < 2; i++) {
+			for (handler = lb[i]->first; handler; handler = handler->next) {
+				if (handler->op && handler->op->type == ot) {
+					/* don't run op->cancel because it needs the context,
+					 * assume whoever unregisters the operator will cleanup */
+					handler->flag |= WM_HANDLER_DO_FREE;
+					WM_operator_free(handler->op);
+					handler->op = NULL;
+				}
+			}
+		}
+	}
+}
 
 /* ************ uiListType handling ************** */
 
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index ebde640..794bfdd 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -188,12 +188,26 @@ void WM_cursor_grab_enable(wmWindow *win, int wrap, int hide, int bounds[4])
 	 * It helps not to get a stuck WM when hitting a breakpoint  
 	 * */
 	GHOST_TGrabCursorMode mode = GHOST_kGrabNormal;
-
-	if (hide) mode = GHOST_kGrabHide;
-	else if (wrap) mode = GHOST_kGrabWrap;
+	float fac = GHOST_GetNativePixelSize(win->ghostwin);
+
+	/* in case pixel coords differ from window/mouse coords */
+	if (bounds) {
+		bounds[0] /= fac;
+		bounds[1] /= fac;
+		bounds[2] /= fac;
+		bounds[3] /= fac;
+	}
+	
+	if (hide) {
+		mode = GHOST_kGrabHide;
+	}
+	else if (wrap) {
+		mode = GHOST_kGrabWrap;
+	}
 	if ((G.debug & G_DEBUG) == 0) {
-		if (win && win->ghostwin) {
+		if (win->ghostwin) {
 			const GHOST_TabletData *tabletdata = GHOST_GetTabletData(win->ghostwin);
+			
 			/* Note: There is no tabletdata on Windows if no tablet device is connected. */
 			if (!tabletdata)
 				GHOST_SetCursorGrab(win->ghostwin, mode, bounds, NULL);
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 91be039..6044e3f 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -800,7 +800,7 @@ void wm_draw_update(bContext *C)
 
 		if (state == GHOST_kWindowStateMinimized) {
 			/* do not update minimized windows, it gives issues on intel drivers (see [#33223])
-			 * anyway, it seems logical to skip update for invisile windows
+			 * anyway, it seems logical to skip update for invisible windows
 			 */
 			continue;
 		}
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 48cad9e..206297d 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -84,16 +84,21 @@
 #  include "RNA_enum_types.h"
 #endif
 
+static void update_tablet_data(wmWindow *win, wmEvent *event);
+
 static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports,
                                      short context, short poll_only);
 
 /* ************ event management ************** */
 
-void wm_event_add(wmWindow *win, wmEvent *event_to_add)
+void wm_event_add(wmWindow *win, const wmEvent *event_to_add)
 {
-	wmEvent *event = MEM_callocN(sizeof(wmEvent), "wmEvent");
+	wmEvent *event = MEM_mallocN(sizeof(wmEvent), "wmEvent");
 	
 	*event = *event_to_add;
+
+	update_tablet_data(win, event);
+
 	BLI_addtail(&win->queue, event);
 }
 
@@ -108,6 +113,11 @@ void wm_event_free(wmEvent *event)
 				MEM_freeN(event->customdata);
 		}
 	}
+
+	if (event->tablet_data) {
+		MEM_freeN(event->tablet_data);
+	}
+
 	MEM_freeN(event);
 }
 
@@ -272,7 +282,7 @@ void wm_event_do_notifiers(bContext *C)
 				/* XXX context in notifiers? */
 				CTX_wm_window_set(C, win);
 
-				/* printf("notifier win %d screen %s cat %x\n", win->winid, win->screen->id.name+2, note->category); */
+				/* printf("notifier win %d screen %s cat %x\n", win->winid, win->screen->id.name + 2, note->category); */
 				ED_screen_do_listen(C, note);
 
 				for (ar = win->screen->regionbase.first; ar; ar = ar->next) {
@@ -443,6 +453,22 @@ static void wm_operator_print(bContext *C, wmOperator *op)
 	MEM_freeN(buf);
 }
 
+/**
+ * Sets the active region for this space from the context.
+ *
+ * \see #BKE_area_find_region_active_win
+ */
+void WM_operator_region_active_win_set(bContext *C)
+{
+	ScrArea *sa = CTX_wm_area(C);
+	if (sa) {
+		ARegion *ar = CTX_wm_region(C);
+		if (ar && ar->regiontype == RGN_TYPE_WINDOW) {
+			sa->region_active_win = BLI_findindex(&sa->regionbase, ar);
+		}
+	}
+}
+
 /* for debugging only, getting inspecting events manually is tedious */
 #ifndef NDEBUG
 
@@ -563,10 +589,16 @@ static void wm_operator_finished(bContext *C, wmOperator *op, int repeat)
 			MEM_freeN(buf);
 		}
 
-		if (wm_operator_register_check(wm, op->type))
+		if (wm_operator_register_check(wm, op->type)) {
+			/* take ownership of reports (in case python provided own) */
+			op->reports->flag |= RPT_FREE;
+
 			wm_operator_register(C, op);
-		else
+			WM_operator_region_active_win_set(C);
+		}
+		else {
 			WM_operator_free(op);
+		}
 	}
 }
 
@@ -906,6 +938,9 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
 			wm_operator_finished(C, op, 0);
 		}
 		else if (retval & OPERATOR_RUNNING_MODAL) {
+			/* take ownership of reports (in case python provided own) */
+			op->reports->flag |= RPT_FREE;
+
 			/* grab cursor during blocking modal ops (X11)
 			 * Also check for macro
 			 */
@@ -1035,7 +1070,14 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
 				}
 				
 				if (!(ar && ar->regiontype == type) && area) {
-					ARegion *ar1 = BKE_area_find_region_type(area, type);
+					ARegion *ar1;
+					if (type == RGN_TYPE_WINDOW) {
+						ar1 = BKE_area_find_region_active_win(area);
+					}
+					else {
+						ar1 = BKE_area_find_region_type(area, type);
+					}
+
 					if (ar1)
 						CTX_wm_region_set(C, ar1);
 				}
@@ -1134,13 +1176,6 @@ int WM_operator_call_py(bContext *C, wmOperatorType *ot, short context,
 	
 	if (!is_undo && wm && (wm == CTX_wm_manager(C))) wm->op_undo_depth--;
 
-	/* keep the reports around if needed later */
-	if ((retval & OPERATOR_RUNNING_MODAL) ||
-	    ((retval & OPERATOR_FINISHED) && wm_operator_register_check(CTX_wm_manager(C), ot)))
-	{
-		reports->flag |= RPT_FREE; /* let blender manage freeing */
-	}
-	
 	return retval;
 }
 
@@ -1347,8 +1382,8 @@ static void wm_event_modalkeymap(const bContext *C, wmOperator *op, wmEvent *eve
 	}
 	else {
 		/* modal keymap checking returns handled events fine, but all hardcoded modal
-		   handling typically swallows all events (OPERATOR_RUNNING_MODAL).
-		   This bypass just disables support for double clicks in hardcoded modal handlers */
+		 * handling typically swallows all events (OPERATOR_RUNNING_MODAL).
+		 * This bypass just disables support for double clicks in hardcoded modal handlers */
 		if (event->val == KM_DBL_CLICK) {
 			event->prevval = event->val;
 			event->val = KM_PRESS;
@@ -1407,20 +1442,10 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
 				if (ot->flag & OPTYPE_UNDO)
 					wm->op_undo_depth--;
 
-				/* putting back screen context, reval can pass trough after modal failures! */
-				if ((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) {
-					CTX_wm_area_set(C, area);
-					CTX_wm_region_set(C, region);
-				}
-				else {
-					/* this special cases is for areas and regions that get removed */
-					CTX_wm_area_set(C, NULL);
-					CTX_wm_region_set(C, NULL);
-				}
-
 				if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED))
 					wm_operator_reports(C, op, retval, FALSE);
 
+				/* important to run 'wm_operator_finished' before NULLing the context members */
 				if (retval & OPERATOR_FINISHED) {
 					wm_operator_finished(C, op, 0);
 					handler->op = NULL;
@@ -1430,6 +1455,17 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
 					handler->op = NULL;
 				}
 
+				/* putting back screen context, reval can pass trough after modal failures! */
+				if ((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) {
+					CTX_wm_area_set(C, area);
+					CTX_wm_region_set(C, region);
+				}
+				else {
+					/* this special cases is for areas and regions that get removed */
+					CTX_wm_area_set(C, NULL);
+					CTX_wm_region_set(C, NULL);
+				}
+
 				/* remove modal handler, operator itself should have been canceled and freed */
 				if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED)) {
 					WM_cursor_grab_disable(CTX_wm_window(C), NULL);
@@ -1729,6 +1765,10 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
 								break;
 							}
 							else {
+								if (action & WM_HANDLER_HANDLED)
+									if (G.debug & (G_DEBUG_EVENTS | G_DEBUG_HANDLERS))
+										printf("%s:       handled - and pass on! '%s'\n", __func__, kmi->idname);
+								
 #ifndef NDEBUG
 								if (do_debug_handler) {
 									printf("%s:       un-handled '%s'...", __func__, kmi->idname);
@@ -2652,9 +2692,12 @@ static void update_tablet_data(wmWindow *win, wmEvent *event)
 		wmtab->Xtilt = td->Xtilt;
 		wmtab->Ytilt = td->Ytilt;
 		
-		event->custom = EVT_DATA_TABLET;
-		event->customdata = wmtab;
-		event->customdatafree = 1;
+		event->tablet_data = wmtab;
+		// printf("%s: using tablet %.5f\n", __func__, wmtab->Pressure);
+	}
+	else {
+		event->tablet_data = NULL;
+		// printf("%s: not using tablet\n", __func__);
 	}
 }
 
@@ -2747,6 +2790,24 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi
 	return NULL;
 }
 
+static bool wm_event_is_double_click(wmEvent *event, wmEvent *event_state)
+{
+	if ((event->type == event_state->prevtype) &&
+	    (event_state->prevval == KM_RELEASE) &&
+	    (event->val == KM_PRESS))
+	{
+		if ((ISMOUSE(event->type) == false) || ((ABS(event->x - event_state->prevclickx)) <= 2 &&
+		                                        (ABS(event->y - event_state->prevclicky)) <= 2))
+		{
+			if ((PIL_check_seconds_timer() - event_state->prevclicktime) * 1000 < U.dbl_click_time) {
+				return true;
+			}
+		}
+	}
+
+	return false;
+}
+
 /* windows store own event queues, no bContext here */
 /* time is in 1000s of seconds, from ghost */
 void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int UNUSED(time), void *customdata)
@@ -2756,7 +2817,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 
 	/* initialize and copy state (only mouse x y and modifiers) */
 	event = *evt;
-	
+
 	switch (type) {
 		/* mouse move, also to inactive window (X11 does this) */
 		case GHOST_kEventCursorMove:
@@ -2778,7 +2839,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 			if (lastevent && lastevent->type == MOUSEMOVE)
 				lastevent->type = INBETWEEN_MOUSEMOVE;
 
-			update_tablet_data(win, &event);
 			wm_event_add(win, &event);
 			
 			/* also add to other window if event is there, this makes overdraws disappear nicely */
@@ -2791,7 +2851,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 				oevent.y = owin->eventstate->y = event.y;
 				oevent.type = MOUSEMOVE;
 				
-				update_tablet_data(owin, &oevent);
 				wm_event_add(owin, &oevent);
 			}
 				
@@ -2823,7 +2882,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 			event.prevx = event.x - pd->deltaX;
 			event.prevy = event.y - (-pd->deltaY);
 			
-			update_tablet_data(win, &event);
 			wm_event_add(win, &event);
 			break;
 		}
@@ -2868,15 +2926,10 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 			}
 			
 			/* double click test */
-			if (event.type == evt->prevtype && event.val == KM_PRESS) {
-				if ((ABS(event.x - evt->prevclickx)) <= 2 &&
-				    (ABS(event.y - evt->prevclicky)) <= 2 &&
-				    ((PIL_check_seconds_timer() - evt->prevclicktime) * 1000 < U.dbl_click_time))
-				{
-					if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
-						printf("%s Send double click\n", __func__);
-					event.val = KM_DBL_CLICK;
-				}
+			if (wm_event_is_double_click(&event, evt)) {
+				if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+					printf("%s Send double click\n", __func__);
+				event.val = KM_DBL_CLICK;
 			}
 			if (event.val == KM_PRESS) {
 				evt->prevclicktime = PIL_check_seconds_timer();
@@ -2894,11 +2947,9 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 				oevent.type = event.type;
 				oevent.val = event.val;
 				
-				update_tablet_data(owin, &oevent);
 				wm_event_add(owin, &oevent);
 			}
 			else {
-				update_tablet_data(win, &event);
 				wm_event_add(win, &event);
 			}
 			
@@ -2982,15 +3033,10 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 
 			/* double click test */
 			/* if previous event was same type, and previous was release, and now it presses... */
-			if (event.type == evt->prevtype && evt->prevval == KM_RELEASE && event.val == KM_PRESS) {
-				if ((ABS(event.x - evt->prevclickx)) <= 2 &&
-				    (ABS(event.y - evt->prevclicky)) <= 2 &&
-				    ((PIL_check_seconds_timer() - evt->prevclicktime) * 1000 < U.dbl_click_time))
-				{
-					if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
-						printf("%s Send double click\n", __func__);
-					evt->val = event.val = KM_DBL_CLICK;
-				}
+			if (wm_event_is_double_click(&event, evt)) {
+				if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+					printf("%s Send double click\n", __func__);
+				evt->val = event.val = KM_DBL_CLICK;
 			}
 			
 			/* this case happens on holding a key pressed, it should not generate
@@ -2999,7 +3045,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 				event.keymodifier = 0;
 						
 			/* this case happened with an external numpad, it's not really clear
-			 * why, but it's also impossible to map a key modifier to an unknwon
+			 * why, but it's also impossible to map a key modifier to an unknown
 			 * key, so it shouldn't harm */
 			if (event.keymodifier == UNKNOWNKEY)
 				event.keymodifier = 0;
@@ -3100,4 +3146,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 
 	}
 
+#if 0
+	WM_event_print(&event);
+#endif
 }
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index a9b3e42..45cc48c 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -302,11 +302,6 @@ static void wm_init_userdef(bContext *C)
 
 	/* update tempdir from user preferences */
 	BLI_init_temporary_dir(U.tempdir);
-	
-	/* displays with larger native pixels, like Macbook. Used to scale dpi with */
-	if (G.background == FALSE)
-		U.pixelsize = GHOST_GetNativePixelSize();
-	if (U.pixelsize == 0) U.pixelsize = 1;
 
 	BKE_userdef_state();
 }
@@ -525,14 +520,15 @@ int wm_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory
 	/* put aside screens to match with persistent windows later */
 	wm_window_match_init(C, &wmbase); 
 	
-	if (!from_memory && BLI_exists(startstr)) {
-		success = (BKE_read_file(C, startstr, NULL) != BKE_READ_FILE_FAIL);
-		
-	}
-	
-	if (U.themes.first == NULL) {
-		printf("\nNote: No (valid) "STRINGIFY (BLENDER_STARTUP_FILE)" found, fall back to built-in default.\n\n");
-		success = 0;
+	if (!from_memory) {
+		if (BLI_exists(startstr)) {
+			success = (BKE_read_file(C, startstr, NULL) != BKE_READ_FILE_FAIL);
+		}
+
+		if (U.themes.first == NULL) {
+			printf("\nNote: No (valid) '%s' found, fall back to built-in default.\n\n", startstr);
+			success = 0;
+		}
 	}
 
 	if (success == 0) {
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 168c231..302bf61 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -309,17 +309,19 @@ static void wm_gesture_draw_lasso(wmGesture *gt)
 static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
 {
 	rcti *rect = (rcti *)gt->customdata;
-	
+	int winsizex = WM_window_pixels_x(win);
+	int winsizey = WM_window_pixels_y(win);
+
 	glEnable(GL_LINE_STIPPLE);
 	glColor3ub(96, 96, 96);
 	glLineStipple(1, 0xCCCC);
-	sdrawline(rect->xmin - win->sizex, rect->ymin, rect->xmin + win->sizex, rect->ymin);
-	sdrawline(rect->xmin, rect->ymin - win->sizey, rect->xmin, rect->ymin + win->sizey);
+	sdrawline(rect->xmin - winsizex, rect->ymin, rect->xmin + winsizex, rect->ymin);
+	sdrawline(rect->xmin, rect->ymin - winsizey, rect->xmin, rect->ymin + winsizey);
 	
 	glColor3ub(255, 255, 255);
 	glLineStipple(1, 0x3333);
-	sdrawline(rect->xmin - win->sizex, rect->ymin, rect->xmin + win->sizex, rect->ymin);
-	sdrawline(rect->xmin, rect->ymin - win->sizey, rect->xmin, rect->ymin + win->sizey);
+	sdrawline(rect->xmin - winsizex, rect->ymin, rect->xmin + winsizex, rect->ymin);
+	sdrawline(rect->xmin, rect->ymin - winsizey, rect->xmin, rect->ymin + winsizey);
 	glDisable(GL_LINE_STIPPLE);
 }
 
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index de0da3d..da0c6dd 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -33,7 +33,7 @@
 #include <string.h>
 
 #ifdef WIN32
-#  include <Windows.h>
+#  include <windows.h>
 #endif
 
 #include "MEM_guardedalloc.h"
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 3739462..92a310a 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -126,10 +126,13 @@ static int wm_keymap_item_equals(wmKeyMapItem *a, wmKeyMapItem *b)
 /* properties can be NULL, otherwise the arg passed is used and ownership is given to the kmi */
 void WM_keymap_properties_reset(wmKeyMapItem *kmi, struct IDProperty *properties)
 {
-	WM_operator_properties_free(kmi->ptr);
-	MEM_freeN(kmi->ptr);
+	if (LIKELY(kmi->ptr)) {
+		WM_operator_properties_free(kmi->ptr);
+		MEM_freeN(kmi->ptr);
+
+		kmi->ptr = NULL;
+	}
 
-	kmi->ptr = NULL;
 	kmi->properties = properties;
 
 	wm_keymap_item_properties_set(kmi);
@@ -734,6 +737,24 @@ wmKeyMapItem *WM_modalkeymap_add_item_str(wmKeyMap *km, int type, int val, int m
 	return kmi;
 }
 
+wmKeyMapItem *WM_modalkeymap_find_propvalue(wmKeyMap *km, const int propvalue)
+{
+
+	if (km->flag & KEYMAP_MODAL) {
+		wmKeyMapItem *kmi;
+		for (kmi = km->items.first; kmi; kmi = kmi->next) {
+			if (kmi->propvalue == propvalue) {
+				return kmi;
+			}
+		}
+	}
+	else {
+		BLI_assert(!"called with non modal keymap");
+	}
+
+	return NULL;
+}
+
 void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
 {
 	wmOperatorType *ot = WM_operatortype_find(opname, 0);
@@ -782,7 +803,7 @@ const char *WM_key_event_string(short type)
 	return "";
 }
 
-char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len)
+int WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len)
 {
 	char buf[128];
 
@@ -815,9 +836,7 @@ char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len)
 	}
 
 	strcat(buf, WM_key_event_string(kmi->type));
-	BLI_strncpy(str, buf, len);
-
-	return str;
+	return BLI_snprintf(str, len, "%s", buf);
 }
 
 static wmKeyMapItem *wm_keymap_item_find_handlers(
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index b2c3c93..9562f6d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -69,6 +69,7 @@
 #include "BKE_library.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
+#include "BKE_material.h"
 #include "BKE_report.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h" /* BKE_ST_MAXNAME */
@@ -561,6 +562,7 @@ char *WM_operator_pystring(bContext *C, wmOperatorType *ot, PointerRNA *opptr, i
 }
 
 /* return NULL if no match is found */
+#if 0
 static char *wm_prop_pystring_from_context(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
 {
 
@@ -583,7 +585,7 @@ static char *wm_prop_pystring_from_context(bContext *C, PointerRNA *ptr, Propert
 
 	for (link = lb.first; link; link = link->next) {
 		const char *identifier = link->data;
-		PointerRNA ctx_item_ptr = {{0}}; // CTX_data_pointer_get(C, identifier);
+		PointerRNA ctx_item_ptr = {{0}} // CTX_data_pointer_get(C, identifier); // XXX, this isnt working
 
 		if (ctx_item_ptr.type == NULL) {
 			continue;
@@ -624,6 +626,94 @@ static char *wm_prop_pystring_from_context(bContext *C, PointerRNA *ptr, Propert
 
 	return ret;
 }
+#else
+
+/* use hard coded checks for now */
+static char *wm_prop_pystring_from_context(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
+{
+	const char *member_id = NULL;
+
+	char *prop_str = NULL;
+	char *ret = NULL;
+
+	if (ptr->id.data) {
+		ID *idptr = ptr->id.data;
+
+#define CTX_TEST_PTR_ID(C, member, idptr) \
+		{ \
+			const char *ctx_member = member; \
+			PointerRNA ctx_item_ptr = CTX_data_pointer_get(C, ctx_member); \
+			if (ctx_item_ptr.id.data == idptr) { \
+				member_id = ctx_member; \
+				break; \
+			} \
+		} (void)0
+
+#define CTX_TEST_PTR_ID_CAST(C, member, member_full, cast, idptr) \
+		{ \
+			const char *ctx_member = member; \
+			const char *ctx_member_full = member_full; \
+			PointerRNA ctx_item_ptr = CTX_data_pointer_get(C, ctx_member); \
+			if (ctx_item_ptr.id.data && cast(ctx_item_ptr.id.data) == idptr) { \
+				member_id = ctx_member_full; \
+				break; \
+			} \
+		} (void)0
+
+		switch (GS(idptr->name)) {
+			case ID_SCE:
+			{
+				CTX_TEST_PTR_ID(C, "scene", ptr->id.data);
+				break;
+			}
+			case ID_OB:
+			{
+				CTX_TEST_PTR_ID(C, "object", ptr->id.data);
+				break;
+			}
+			/* from rna_Main_objects_new */
+			case OB_DATA_SUPPORT_ID_CASE:
+			{
+#define ID_CAST_OBDATA(id_pt) (((Object *)(id_pt))->data)
+				CTX_TEST_PTR_ID_CAST(C, "object", "object.data", ID_CAST_OBDATA, ptr->id.data);
+				break;
+#undef ID_CAST_OBDATA
+			}
+			case ID_MA:
+			{
+#define ID_CAST_OBMATACT(id_pt) (give_current_material(((Object *)id_pt), ((Object *)id_pt)->actcol))
+				CTX_TEST_PTR_ID_CAST(C, "object", "object.active_material", ID_CAST_OBMATACT, ptr->id.data);
+				break;
+#undef ID_CAST_OBMATACT
+			}
+			case ID_WO:
+			{
+#define ID_CAST_SCENEWORLD(id_pt) (((Scene *)(id_pt))->world)
+				CTX_TEST_PTR_ID_CAST(C, "scene", "scene.world", ID_CAST_SCENEWORLD, ptr->id.data);
+				break;
+#undef ID_CAST_SCENEWORLD
+			}
+			case ID_SCR:
+			{
+				CTX_TEST_PTR_ID(C, "screen", ptr->id.data);
+				break;
+			}
+		}
+
+		if (member_id) {
+			prop_str = RNA_path_struct_property_py(ptr, prop, index);
+			if (prop_str) {
+				ret = BLI_sprintfN("bpy.context.%s.%s", member_id, prop_str);
+				MEM_freeN(prop_str);
+			}
+		}
+#undef CTX_TEST_PTR_ID
+#undef CTX_TEST_PTR_ID_CAST
+	}
+
+	return ret;
+}
+#endif
 
 char *WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
 {
@@ -1114,8 +1204,13 @@ void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
 	RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, "Y Start", "", INT_MIN, INT_MAX);
 	RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, "Y End", "", INT_MIN, INT_MAX);
 	
-	if (cursor)
-		RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, "Cursor", "Mouse cursor style to use during the modal operator", 0, INT_MAX);
+	if (cursor) {
+		PropertyRNA *prop;
+
+		prop = RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX,
+		                   "Cursor", "Mouse cursor style to use during the modal operator", 0, INT_MAX);
+		RNA_def_property_flag(prop, PROP_HIDDEN);
+	}
 }
 
 
@@ -1165,6 +1260,15 @@ static void wm_block_redo_cb(bContext *C, void *arg_op, int UNUSED(arg_event))
 	}
 }
 
+static void wm_block_redo_cancel_cb(bContext *C, void *arg_op)
+{
+	wmOperator *op = arg_op;
+
+	/* if operator never got executed, free it */
+	if (op != WM_operator_last_redo(C))
+		WM_operator_free(op);
+}
+
 static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
 {
 	wmOperator *op = arg_op;
@@ -1251,7 +1355,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
 	block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
 	uiBlockClearFlag(block, UI_BLOCK_LOOP);
 
-	/* intentionally don't use 'UI_BLOCK_MOVEMOUSE_QUIT', some dialogs have many items
+	/* intentionally don't use 'UI_BLOCK_MOVEMOUSE_QUIT', some dialogues have many items
 	 * where quitting by accident is very annoying */
 	uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
 
@@ -1307,7 +1411,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData)
 	return block;
 }
 
-static void wm_operator_ui_popup_cancel(void *userData)
+static void wm_operator_ui_popup_cancel(struct bContext *UNUSED(C), void *userData)
 {
 	wmOpPopUp *data = userData;
 	if (data->free_op && data->op) {
@@ -1357,7 +1461,7 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_
 	if (!(U.uiflag & USER_GLOBALUNDO))
 		return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, UI_UNIT_Y);
 
-	uiPupBlock(C, wm_block_create_redo, op);
+	uiPupBlockEx(C, wm_block_create_redo, NULL, wm_block_redo_cancel_cb, op);
 
 	if (do_call)
 		wm_block_redo_cb(C, op, 0);
@@ -1586,18 +1690,26 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
 	
 	split = uiLayoutSplit(layout, 0.0f, FALSE);
 	col = uiLayoutColumn(split, FALSE);
-	uiItemL(col, "Links", ICON_NONE);
-	uiItemStringO(col, IFACE_("Donations"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment");
-	uiItemStringO(col, IFACE_("Credits"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits");
-	uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-265");
-	uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.6/Manual");
+	uiItemL(col, IFACE_("Links"), ICON_NONE);
+	uiItemStringO(col, IFACE_("Donations"), ICON_URL, "WM_OT_url_open", "url",
+	              "http://www.blender.org/blenderorg/blender-foundation/donation-payment");
+	uiItemStringO(col, IFACE_("Credits"), ICON_URL, "WM_OT_url_open", "url",
+	              "http://www.blender.org/development/credits");
+	uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url",
+	              "http://www.blender.org/development/release-logs/blender-266");
+	uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url",
+	              "http://wiki.blender.org/index.php/Doc:2.6/Manual");
 	uiItemStringO(col, IFACE_("Blender Website"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org");
-	uiItemStringO(col, IFACE_("User Community"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community");
+	uiItemStringO(col, IFACE_("User Community"), ICON_URL, "WM_OT_url_open", "url",
+	              "http://www.blender.org/community/user-community");
 	if (strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release") == 0) {
-		BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION / 100, BLENDER_VERSION % 100);
+		BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d"
+		                               STRINGIFY(BLENDER_VERSION_CHAR) "_release",
+		             BLENDER_VERSION / 100, BLENDER_VERSION % 100);
 	}
 	else {
-		BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION);
+		BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d",
+		             BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION);
 	}
 	uiItemStringO(col, IFACE_("Python API Reference"), ICON_URL, "WM_OT_url_open", "url", url);
 	uiItemL(col, "", ICON_NONE);
@@ -1908,7 +2020,7 @@ static int wm_link_append_poll(bContext *C)
 	if (WM_operator_winactive(C)) {
 		/* linking changes active object which is pretty useful in general,
 		 * but which totally confuses edit mode (i.e. it becoming not so obvious
-		 * to leave from edit mode and inwalid tools in toolbar might be displayed)
+		 * to leave from edit mode and invalid tools in toolbar might be displayed)
 		 * so disable link/append when in edit mode (sergey) */
 		if (CTX_data_edit_object(C))
 			return 0;
@@ -3166,6 +3278,7 @@ static void radial_control_set_initial_mouse(RadialControl *rc, wmEvent *event)
 	rc->initial_mouse[1] = event->y;
 
 	switch (rc->subtype) {
+		case PROP_NONE:
 		case PROP_DISTANCE:
 			d[0] = rc->initial_value;
 			break;
@@ -3265,6 +3378,7 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
 	float zoom[2], col[3] = {1, 1, 1};
 
 	switch (rc->subtype) {
+		case PROP_NONE:
 		case PROP_DISTANCE:
 			r1 = rc->current_value;
 			r2 = rc->initial_value;
@@ -3286,6 +3400,11 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
 			break;
 	}
 
+	/* adjust for DPI, like BKE_brush_size_get */
+	r1 *= U.pixelsize;
+	r2 *= U.pixelsize;
+	tex_radius *= U.pixelsize;
+
 	/* Keep cursor in the original place */
 	x = rc->initial_mouse[0] - ar->winrct.xmin;
 	y = rc->initial_mouse[1] - ar->winrct.ymin;
@@ -3503,8 +3622,8 @@ static int radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
 	/* get subtype of property */
 	rc->subtype = RNA_property_subtype(rc->prop);
-	if (!ELEM3(rc->subtype, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE)) {
-		BKE_report(op->reports, RPT_ERROR, "Property must be a distance, a factor, or an angle");
+	if (!ELEM4(rc->subtype, PROP_NONE, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE)) {
+		BKE_report(op->reports, RPT_ERROR, "Property must be a none, distance, a factor, or an angle");
 		MEM_freeN(rc);
 		return OPERATOR_CANCELLED;
 	}
@@ -3588,6 +3707,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
 
 			/* calculate new value and apply snapping  */
 			switch (rc->subtype) {
+				case PROP_NONE:
 				case PROP_DISTANCE:
 					new_value = dist;
 					if (snap) new_value = ((int)new_value + 5) / 10 * 10;
@@ -3864,7 +3984,7 @@ static int wm_ndof_sensitivity_exec(bContext *UNUSED(C), wmOperator *op)
 
 static void WM_OT_ndof_sensitivity_change(wmOperatorType *ot)
 {
-	ot->name = "Change NDOF sensitivity";
+	ot->name = "Change NDOF Sensitivity";
 	ot->idname = "WM_OT_ndof_sensitivity_change";
 	ot->description = "Change NDOF sensitivity";
 	
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index 8b38719..fd44f4a 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -689,7 +689,8 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void)
 			break;
 		}
 		case GHOST_kEventWindowActivate:
-		case GHOST_kEventWindowDeactivate: {
+		case GHOST_kEventWindowDeactivate:
+		{
 			g_WS.qual &= ~WS_QUAL_MOUSE;
 			break;
 		}
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index 1ed9ffb..20406ac 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -255,7 +255,7 @@ void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct)
 	width  = BLI_rcti_size_x(&_curswin->winrct) + 1;
 	height = BLI_rcti_size_y(&_curswin->winrct) + 1;
 	glViewport(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height);
-
+	
 	if (srct) {
 		int width  = BLI_rcti_size_x(srct) + 1; /* only here */
 		int height = BLI_rcti_size_y(srct) + 1;
@@ -266,11 +266,10 @@ void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct)
 	
 	wmOrtho2(-GLA_PIXEL_OFS, (float)width - GLA_PIXEL_OFS, -GLA_PIXEL_OFS, (float)height - GLA_PIXEL_OFS);
 	glLoadIdentity();
-
+	
 	glFlush();
 }
 
-
 /* enable the WM versions of opengl calls */
 void wmSubWindowSet(wmWindow *win, int swinid)
 {
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 9e0f861..a1ab0de 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -43,6 +43,7 @@
 
 #include "GHOST_C-api.h"
 
+#include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 
@@ -75,6 +76,11 @@
 
 #include "UI_interface.h"
 
+/* for assert */
+#ifndef NDEBUG
+#  include "BLI_threads.h"
+#endif
+
 /* the global to talk to ghost */
 static GHOST_SystemHandle g_system = NULL;
 
@@ -109,6 +115,17 @@ void wm_get_screensize(int *width_r, int *height_r)
 	*height_r = uiheight;
 }
 
+/* size of all screens, useful since the mouse is bound by this */
+void wm_get_screensize_all(int *width_r, int *height_r)
+{
+	unsigned int uiwidth;
+	unsigned int uiheight;
+
+	GHOST_GetAllDisplayDimensions(g_system, &uiwidth, &uiheight);
+	*width_r = uiwidth;
+	*height_r = uiheight;
+}
+
 /* keeps offset and size within monitor bounds */
 /* XXX solve dual screen... */
 static void wm_window_check_position(rcti *rect)
@@ -377,7 +394,7 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
 		
 		/* displays with larger native pixels, like Macbook. Used to scale dpi with */
 		/* needed here, because it's used before it reads userdef */
-		U.pixelsize = GHOST_GetNativePixelSize();
+		U.pixelsize = GHOST_GetNativePixelSize(win->ghostwin);
 		BKE_userdef_state();
 		
 		/* store actual window size in blender window */
@@ -420,10 +437,19 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
 			wm_set_apple_prefsize(wm_init_state.size_x, wm_init_state.size_y);
 		}
 #else
+		/* note!, this isnt quite correct, active screen maybe offset 1000s if PX,
+		 * we'd need a wm_get_screensize like function that gives offset,
+		 * in practice the window manager will likely move to the correct monitor */
 		wm_init_state.start_x = 0;
 		wm_init_state.start_y = 0;
-		
 #endif
+
+#if !defined(__APPLE__) && !defined(WIN32)  /* X11 */
+		/* X11, start maximized but use default same size */
+		wm_init_state.size_x = min_ii(wm_init_state.size_x, WM_WIN_INIT_SIZE_X);
+		wm_init_state.size_y = min_ii(wm_init_state.size_y, WM_WIN_INIT_SIZE_Y);
+#endif
+
 	}
 	
 	for (win = wm->windows.first; win; win = win->next) {
@@ -434,8 +460,18 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
 				win->sizex = wm_init_state.size_x;
 				win->sizey = wm_init_state.size_y;
 
-				/* we can't properly resize a maximized window */
+#if !defined(__APPLE__) && !defined(WIN32)  /* X11 */
+				if (wm_init_state.override_flag & WIN_OVERRIDE_GEOM) {
+					/* we can't properly resize a maximized window */
+					win->windowstate = GHOST_kWindowStateNormal;
+				}
+				else {
+					/* loading without userpref, default to maximized */
+					win->windowstate = GHOST_kWindowStateMaximized;
+				}
+#else
 				win->windowstate = GHOST_kWindowStateNormal;
+#endif
 
 				wm_init_state.override_flag &= ~WIN_OVERRIDE_GEOM;
 			}
@@ -595,12 +631,13 @@ int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *UNUSED(op))
 
 static void wm_convert_cursor_position(wmWindow *win, int *x, int *y)
 {
-
+	float fac = GHOST_GetNativePixelSize(win->ghostwin);
+	
 	GHOST_ScreenToClient(win->ghostwin, *x, *y, x, y);
-	*x *= GHOST_GetNativePixelSize();
+	*x *= fac;
 	
 	*y = (win->sizey - 1) - *y;
-	*y *= GHOST_GetNativePixelSize();
+	*y *= fac;
 }
 
 
@@ -661,6 +698,10 @@ void wm_window_make_drawable(bContext *C, wmWindow *win)
 			printf("%s: set drawable %d\n", __func__, win->winid);
 		}
 		GHOST_ActivateWindowDrawingContext(win->ghostwin);
+		
+		/* this can change per window */
+		U.pixelsize = GHOST_GetNativePixelSize(win->ghostwin);
+		BKE_userdef_state();
 	}
 }
 
@@ -722,6 +763,9 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
 //				window_handle(win, INPUTCHANGE, win->active);
 				
 				/* bad ghost support for modifier keys... so on activate we set the modifiers again */
+
+				/* TODO: This is not correct since a modifier may be held when a window is activated...
+				 * better solve this at ghost level. attempted fix r54450 but it caused bug [#34255] */
 				kdata.ascii = '\0';
 				kdata.utf8_buf[0] = '\0';
 				if (win->eventstate->shift && !query_qual(SHIFT)) {
@@ -810,7 +854,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
 					
 					GHOST_DisposeRectangle(client_rect);
 					
-					wm_get_screensize(&scr_w, &scr_h);
+					wm_get_screensize_all(&scr_w, &scr_h);
 					sizex = r - l;
 					sizey = b - t;
 					posx = l;
@@ -947,6 +991,15 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
 				
 				break;
 			}
+			case GHOST_kEventNativeResolutionChange:
+				// printf("change, pixel size %f\n", GHOST_GetNativePixelSize(win->ghostwin));
+				
+				U.pixelsize = GHOST_GetNativePixelSize(win->ghostwin);
+				BKE_userdef_state();
+				WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL);
+				WM_event_add_notifier(C, NC_WINDOW | NA_EDITED, NULL);
+
+				break;
 			case GHOST_kEventTrackpad:
 			{
 				GHOST_TEventTrackpadData *pd = data;
@@ -1022,8 +1075,12 @@ static int wm_window_timer(const bContext *C)
 
 void wm_window_process_events(const bContext *C) 
 {
-	int hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
-	
+	int hasevent;
+
+	BLI_assert(BLI_thread_is_main());
+
+	hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
+
 	if (hasevent)
 		GHOST_DispatchEvents(g_system);
 	
@@ -1045,7 +1102,9 @@ void wm_window_testbreak(void)
 {
 	static double ltime = 0;
 	double curtime = PIL_check_seconds_timer();
-	
+
+	BLI_assert(BLI_thread_is_main());
+
 	/* only check for breaks every 50 milliseconds
 	 * if we get called more often.
 	 */
@@ -1289,7 +1348,7 @@ void WM_init_native_pixels(int do_it)
 void WM_cursor_warp(wmWindow *win, int x, int y)
 {
 	if (win && win->ghostwin) {
-		float f = GHOST_GetNativePixelSize();
+		float f = GHOST_GetNativePixelSize(win->ghostwin);
 		int oldx = x, oldy = y;
 
 		x = x / f;
@@ -1304,18 +1363,33 @@ void WM_cursor_warp(wmWindow *win, int x, int y)
 	}
 }
 
+/**
+ * Get the cursor pressure, in most cases you'll want to use wmTabletData from the event
+ */
+float WM_cursor_pressure(const struct wmWindow *win)
+{
+	const GHOST_TabletData *td = GHOST_GetTabletData(win->ghostwin);
+	/* if there's tablet data from an active tablet device then add it */
+	if ((td != NULL) && td->Active != GHOST_kTabletModeNone) {
+		return td->Pressure;
+	}
+	else {
+		return -1.0f;
+	}
+}
+
 /* support for native pixel size */
 /* mac retina opens window in size X, but it has up to 2 x more pixels */
 int WM_window_pixels_x(wmWindow *win)
 {
-	float f = GHOST_GetNativePixelSize();
+	float f = GHOST_GetNativePixelSize(win->ghostwin);
 	
 	return (int)(f * (float)win->sizex);
 }
 
 int WM_window_pixels_y(wmWindow *win)
 {
-	float f = GHOST_GetNativePixelSize();
+	float f = GHOST_GetNativePixelSize(win->ghostwin);
 	
 	return (int)(f * (float)win->sizey);
 	
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
index 2fbfdc4..d12e1d4 100644
--- a/source/blender/windowmanager/wm_event_system.h
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -45,7 +45,8 @@ struct ARegion;
 typedef struct wmEventHandler {
 	struct wmEventHandler *next, *prev;
 
-	int type, flag;                     /* type default=0, rest is custom */
+	int type;                           /* WM_HANDLER_DEFAULT, ... */
+	int flag;                           /* WM_HANDLER_BLOCKING, ... */
 
 	/* keymap handler */
 	wmKeyMap *keymap;                   /* pointer to builtin/custom keymaps */
@@ -72,21 +73,17 @@ typedef struct wmEventHandler {
 
 } wmEventHandler;
 
-
-/* handler flag */
-		/* after this handler all others are ignored */
-#define WM_HANDLER_BLOCKING     1
-		/* handler tagged to be freed in wm_handlers_do() */
-#define WM_HANDLER_DO_FREE      2
-
-
-
 /* custom types for handlers, for signalling, freeing */
 enum {
 	WM_HANDLER_DEFAULT,
 	WM_HANDLER_FILESELECT
 };
 
+/* handler flag */
+enum {
+	WM_HANDLER_BLOCKING    = 1,  /* after this handler all others are ignored */
+	WM_HANDLER_DO_FREE     = 2   /* handler tagged to be freed in wm_handlers_do() */
+};
 
 /* wm_event_system.c */
 void        wm_event_free_all       (wmWindow *win);
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 78a67a3..bc7e7ef 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -39,11 +39,10 @@
 #define __WM_EVENT_TYPES_H__
 
 /* customdata type */
-#define EVT_DATA_TABLET		1
-#define EVT_DATA_GESTURE	2
-#define EVT_DATA_TIMER		3
-#define EVT_DATA_LISTBASE	4
-#define EVT_DATA_NDOF_MOTION 5
+#define EVT_DATA_GESTURE        1
+#define EVT_DATA_TIMER          2
+#define EVT_DATA_LISTBASE       3
+#define EVT_DATA_NDOF_MOTION    4
 
 /* tablet active, matches GHOST_TTabletMode */
 #define EVT_TABLET_NONE		0
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index ce360f5..c4c64ed 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -40,6 +40,7 @@ void		wm_ghost_init			(bContext *C);
 void		wm_ghost_exit(void);
 
 void wm_get_screensize(int *width_r, int *height_r);
+void wm_get_screensize_all(int *width_r, int *height_r);
 
 wmWindow	*wm_window_new			(bContext *C);
 void		wm_window_free			(bContext *C, wmWindowManager *wm, wmWindow *win);
@@ -68,5 +69,11 @@ void		wm_window_testbreak		(void);
 int			wm_window_duplicate_exec(bContext *C, struct wmOperator *op);
 int			wm_window_fullscreen_toggle_exec(bContext *C, struct wmOperator *op);
 
+/* Initial (unmaximized) size to start with for
+ * systems that can't find it for themselves (X11).
+ * Clamped by real desktop limits */
+#define WM_WIN_INIT_SIZE_X 1800
+#define WM_WIN_INIT_SIZE_Y 1000
+
 #endif /* __WM_WINDOW_H__ */
 
diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt
index d606605..cd3edc1 100644
--- a/source/blenderplayer/CMakeLists.txt
+++ b/source/blenderplayer/CMakeLists.txt
@@ -95,6 +95,7 @@ endif()
 		bf_rna
 		bf_bmesh
 		bf_blenkernel
+		bf_intern_rigidbody
 		bf_blenloader
 		ge_blen_routines
 		bf_editor_datafiles
@@ -166,6 +167,7 @@ endif()
 
 	if(WITH_LIBMV)
 		list(APPEND BLENDER_SORTED_LIBS extern_libmv)
+		list(APPEND BLENDER_SORTED_LIBS extern_ssba)
 		list(APPEND BLENDER_SORTED_LIBS extern_ceres)
 	endif()
 
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index e457b57..36068b0 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -114,6 +114,7 @@ struct wmEvent;
 struct wmKeyConfig;
 struct wmKeyMap;
 struct wmOperator;
+struct wmOperatorType;
 struct wmWindow;
 struct wmWindowManager;
 
@@ -196,6 +197,7 @@ int WM_operator_props_dialog_popup(struct bContext *C, struct wmOperator *op, in
 int WM_operator_confirm(struct bContext *C, struct wmOperator *op, struct wmEvent *event) {return 0;}
 struct MenuType *WM_menutype_find(const char *idname, int quiet) {return (struct MenuType *) NULL;}
 void WM_operator_stack_clear(struct bContext *C) {}
+void WM_operator_handlers_clear(struct bContext *C, struct wmOperatorType *ot) {}
 
 void WM_autosave_init(struct bContext *C) {}
 void WM_jobs_kill_all_except(struct wmWindowManager *wm) {}
@@ -334,6 +336,7 @@ void uiLayoutSetEnabled(struct uiLayout *layout, int enabled) {}
 void uiLayoutSetAlignment(struct uiLayout *layout, int alignment) {}
 void uiLayoutSetScaleX(struct uiLayout *layout, float scale) {}
 void uiLayoutSetScaleY(struct uiLayout *layout, float scale) {}
+void uiTemplateIconView(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname) {}
 void ED_base_object_free_and_unlink(struct Scene *scene, struct Base *base) {}
 void ED_mesh_calc_normals(struct Mesh *me) {}
 void ED_mesh_geometry_add(struct Mesh *mesh, struct ReportList *reports, int verts, int edges, int faces) {}
@@ -370,6 +373,8 @@ int ED_space_image_check_show_maskedit(struct Scene *scene, struct SpaceImage *s
 
 void ED_nurb_set_spline_type(struct Nurb *nu, int type) {}
 
+void ED_mball_transform(struct MetaBall *mb, float *mat) {}
+
 void make_editLatt(struct Object *obedit) {}
 void load_editLatt(struct Object *obedit) {}
 
@@ -380,6 +385,7 @@ void make_editNurb(struct Object *obedit) {}
 void uiItemR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int flag, char *name, int icon) {}
 
 struct PointerRNA uiItemFullO(struct uiLayout *layout, char *idname, char *name, int icon, struct IDProperty *properties, int context, int flag) {struct PointerRNA a = {{0}}; return a;}
+PointerRNA uiItemFullO_ptr(struct uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, int context, int flag) {struct PointerRNA a = {{0}}; return a;}
 struct uiLayout *uiLayoutRow(struct uiLayout *layout, int align) {return (struct uiLayout *) NULL;}
 struct uiLayout *uiLayoutColumn(struct uiLayout *layout, int align) {return (struct uiLayout *) NULL;}
 struct uiLayout *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align) {return (struct uiLayout *) NULL;}
@@ -526,6 +532,7 @@ void macro_wrapper(struct wmOperatorType *ot, void *userdata) {}
 int pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id) { return 0; }
 struct PyObject *pyrna_id_CreatePyObject(struct ID *id) {return NULL; }
 void BPY_context_update(struct bContext *C) {};
+const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *msgid) { return msgid; }
 
 /* intern/dualcon */
 struct DualConMesh;
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 72f1132..bb10bdd 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -918,11 +918,12 @@ endif()
 	if(WITH_COMPOSITOR)
 		# added for opencl compositor
 		list_insert_before(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_compositor")
-		list_insert_after(BLENDER_SORTED_LIBS "bf_compositor" "bf_opencl")
+		list_insert_after(BLENDER_SORTED_LIBS "bf_compositor" "bf_intern_opencl")
 	endif()
 
 	if(WITH_LIBMV)
 		list(APPEND BLENDER_SORTED_LIBS extern_libmv)
+		list(APPEND BLENDER_SORTED_LIBS extern_ssba)
 		list(APPEND BLENDER_SORTED_LIBS extern_ceres)
 	endif()
 
@@ -970,6 +971,10 @@ endif()
 		list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
 	endif()
 
+	if(WITH_BULLET)
+		list_insert_after(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_intern_rigidbody")
+	endif()
+
 	if(WITH_BULLET AND NOT WITH_BULLET_SYSTEM)
 		list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
 	endif()
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 7012318..d7b2d87 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -46,16 +46,19 @@
 #else
 #  include <unistd.h> /* getpid */
 #endif
-/* for backtrace */
-#ifndef WIN32
-#  include <execinfo.h>
-#endif
 
 #ifdef WIN32
-#  include <Windows.h>
+#  include <windows.h>
 #  include "utfconv.h"
 #endif
 
+/* for backtrace */
+#if defined(__linux__) || defined(__APPLE__)
+#  include <execinfo.h>
+#elif defined(_MSV_VER)
+#  include <DbgHelp.h>
+#endif
+
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
@@ -85,6 +88,7 @@
 #include "BKE_depsgraph.h" /* for DAG_on_visible_update */
 #include "BKE_font.h"
 #include "BKE_global.h"
+#include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_material.h"
 #include "BKE_packedFile.h"
@@ -155,24 +159,28 @@ extern char build_system[];
 #endif
 
 /*	Local Function prototypes */
-#ifndef WITH_PYTHON_MODULE
+#ifdef WITH_PYTHON_MODULE
+int  main_python_enter(int argc, const char **argv);
+void main_python_exit(void);
+#else
 static int print_help(int argc, const char **argv, void *data);
 static int print_version(int argc, const char **argv, void *data);
 #endif
 
 /* for the callbacks: */
 
-#define BLEND_VERSION_STRING_FMT                                              \
-    "Blender %d.%02d (sub %d)\n",                                             \
-    BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION          \
+#define BLEND_VERSION_FMT         "Blender %d.%02d (sub %d)"
+#define BLEND_VERSION_ARG         BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION
+/* pass directly to printf */
+#define BLEND_VERSION_STRING_FMT  BLEND_VERSION_FMT "\n", BLEND_VERSION_ARG
 
 /* Initialize callbacks for the modules that need them */
 static void setCallbacks(void); 
 
-static bool use_crash_handler = true;
-
 #ifndef WITH_PYTHON_MODULE
 
+static bool use_crash_handler = true;
+
 /* set breakpoints here when running in debug mode, useful to catch floating point errors */
 #if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
 static void fpe_handler(int UNUSED(sig))
@@ -295,6 +303,7 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
 	printf("\n");
 
 	BLI_argsPrintArgDoc(ba, "--python");
+	BLI_argsPrintArgDoc(ba, "--python-text");
 	BLI_argsPrintArgDoc(ba, "--python-console");
 	BLI_argsPrintArgDoc(ba, "--addons");
 
@@ -444,9 +453,11 @@ static int set_fpe(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(dat
 	return 0;
 }
 
+#if defined(__linux__) || defined(__APPLE__)
+
+/* Unix */
 static void blender_crash_handler_backtrace(FILE *fp)
 {
-#ifndef WIN32
 #define SIZE 100
 	void *buffer[SIZE];
 	int nptrs;
@@ -465,11 +476,50 @@ static void blender_crash_handler_backtrace(FILE *fp)
 
 	free(strings);
 #undef SIZE
-#else  /* WIN32 */
-	/* TODO */
+}
+
+#elif defined(_MSV_VER)
+
+static void blender_crash_handler_backtrace(FILE *fp)
+{
 	(void)fp;
+
+#if 0
+#define MAXSYMBOL 256
+	unsigned short	i;
+	void *stack[SIZE];
+	unsigned short nframes;
+	SYMBOL_INFO	*symbolinfo;
+	HANDLE process;
+
+	process = GetCurrentProcess();
+
+	SymInitialize(process, NULL, TRUE);
+
+	nframes = CaptureStackBackTrace(0, SIZE, stack, NULL);
+	symbolinfo = MEM_callocN(sizeof(SYMBOL_INFO) + MAXSYMBOL * sizeof( char ), "crash Symbol table");
+	symbolinfo->MaxNameLen = MAXSYMBOL - 1;
+	symbolinfo->SizeOfStruct = sizeof(SYMBOL_INFO);
+
+	for (i = 0; i < nframes; i++) {
+		SymFromAddr(process, ( DWORD64 )( stack[ i ] ), 0, symbolinfo);
+
+		fprintf(fp, "%u: %s - 0x%0X\n", nframes - i - 1, symbolinfo->Name, symbolinfo->Address);
+	}
+
+	MEM_freeN(symbolinfo);
 #endif
 }
+
+#else  /* non msvc/osx/linux */
+
+static void blender_crash_handler_backtrace(FILE *fp)
+{
+	(void)fp;
+}
+
+#endif
+
 static void blender_crash_handler(int signum)
 {
 
@@ -499,17 +549,23 @@ static void blender_crash_handler(int signum)
 	char fname[FILE_MAX];
 
 	if (!G.main->name[0]) {
-		BLI_make_file_string("/", fname, BLI_temporary_dir(), "blender.crash.txt");
+		BLI_join_dirfile(fname, sizeof(fname), BLI_temporary_dir(), "blender.crash.txt");
 	}
 	else {
-		BLI_strncpy(fname, G.main->name, sizeof(fname));
+		BLI_join_dirfile(fname, sizeof(fname), BLI_temporary_dir(), BLI_path_basename(G.main->name));
 		BLI_replace_extension(fname, sizeof(fname), ".crash.txt");
 	}
 
 	printf("Writing: %s\n", fname);
 	fflush(stdout);
 
-	BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_STRING_FMT);
+	BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Revision: %s\n", BLEND_VERSION_ARG,
+#ifdef BUILD_DATE
+	             build_rev
+#else
+	             "Unknown"
+#endif
+	             );
 
 	/* open the crash log */
 	errno = 0;
@@ -534,8 +590,7 @@ static void blender_crash_handler(int signum)
 #ifndef WIN32
 	kill(getpid(), signum);
 #else
-	/* force crash on windows for now */
-	*((void **)NULL) = NULL;
+	TerminateProcess(GetCurrentProcess(), signum);
 #endif
 }
 
@@ -870,7 +925,7 @@ static int set_ge_parameters(int argc, const char **argv, void *data)
 			}
 
 
-		} /* if (*(argv[a+1]) == '=') */
+		} /* if (*(argv[a + 1]) == '=') */
 	}
 
 	return a;
@@ -1036,11 +1091,11 @@ static int set_skip_frame(int argc, const char **argv, void *data)
 			_cmd;                                                             \
 		}                                                                     \
 		CTX_data_scene_set(C, prevscene);                                     \
-	}                                                                         \
+	} (void)0                                                                 \
 
 #endif /* WITH_PYTHON */
 
-static int run_python(int argc, const char **argv, void *data)
+static int run_python_file(int argc, const char **argv, void *data)
 {
 #ifdef WITH_PYTHON
 	bContext *C = data;
@@ -1052,12 +1107,42 @@ static int run_python(int argc, const char **argv, void *data)
 		BLI_strncpy(filename, argv[1], sizeof(filename));
 		BLI_path_cwd(filename);
 
-		BPY_CTX_SETUP(BPY_filepath_exec(C, filename, NULL))
+		BPY_CTX_SETUP(BPY_filepath_exec(C, filename, NULL));
 
 		return 1;
 	}
 	else {
-		printf("\nError: you must specify a Python script after '-P / --python'.\n");
+		printf("\nError: you must specify a filepath after '%s'.\n", argv[0]);
+		return 0;
+	}
+#else
+	(void)argc; (void)argv; (void)data; /* unused */
+	printf("This blender was built without python support\n");
+	return 0;
+#endif /* WITH_PYTHON */
+}
+
+static int run_python_text(int argc, const char **argv, void *data)
+{
+#ifdef WITH_PYTHON
+	bContext *C = data;
+
+	/* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */
+	if (argc > 1) {
+		/* Make the path absolute because its needed for relative linked blends to be found */
+		struct Text *text = (struct Text *)BKE_libblock_find_name(ID_TXT, argv[1]);
+
+		if (text) {
+			BPY_CTX_SETUP(BPY_text_exec(C, text, NULL, false));
+			return 1;
+		}
+		else {
+			printf("\nError: text block not found %s.\n", argv[1]);
+			return 1;
+		}
+	}
+	else {
+		printf("\nError: you must specify a text block after '%s'.\n", argv[0]);
 		return 0;
 	}
 #else
@@ -1072,7 +1157,7 @@ static int run_python_console(int UNUSED(argc), const char **argv, void *data)
 #ifdef WITH_PYTHON
 	bContext *C = data;
 
-	BPY_CTX_SETUP(BPY_string_exec(C, "__import__('code').interact()"))
+	BPY_CTX_SETUP(BPY_string_exec(C, "__import__('code').interact()"));
 
 	return 0;
 #else
@@ -1281,7 +1366,7 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
 	BLI_argsAdd(ba, 2, "-p", "--window-geometry", "<sx> <sy> <w> <h>\n\tOpen with lower left corner at <sx>, <sy> and width and height as <w>, <h>", prefsize, NULL);
 	BLI_argsAdd(ba, 2, "-w", "--window-border", "\n\tForce opening with borders (default)", with_borders, NULL);
 	BLI_argsAdd(ba, 2, "-W", "--window-borderless", "\n\tForce opening without borders", without_borders, NULL);
-	BLI_argsAdd(ba, 2, "-con", "--start-console", "\n\tStart with the console window open (ignored if -b is set)", start_with_console, NULL);
+	BLI_argsAdd(ba, 2, "-con", "--start-console", "\n\tStart with the console window open (ignored if -b is set), (Windows only)", start_with_console, NULL);
 	BLI_argsAdd(ba, 2, "-R", NULL, "\n\tRegister .blend extension, then exit (Windows only)", register_extension, NULL);
 	BLI_argsAdd(ba, 2, "-r", NULL, "\n\tSilently register .blend extension, then exit (Windows only)", register_extension, ba);
 	BLI_argsAdd(ba, 2, NULL, "--no-native-pixels", "\n\tDo not use native pixel size, for high resolution displays (MacBook 'Retina')", native_pixels, ba);
@@ -1300,7 +1385,8 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
 	BLI_argsAdd(ba, 4, "-s", "--frame-start", "<frame>\n\tSet start to frame <frame> (use before the -a argument)", set_start_frame, C);
 	BLI_argsAdd(ba, 4, "-e", "--frame-end", "<frame>\n\tSet end to frame <frame> (use before the -a argument)", set_end_frame, C);
 	BLI_argsAdd(ba, 4, "-j", "--frame-jump", "<frames>\n\tSet number of frames to step forward after each rendered frame", set_skip_frame, C);
-	BLI_argsAdd(ba, 4, "-P", "--python", "<filename>\n\tRun the given Python script (filename or Blender Text)", run_python, C);
+	BLI_argsAdd(ba, 4, "-P", "--python", "<filename>\n\tRun the given Python script file", run_python_file, C);
+	BLI_argsAdd(ba, 4, NULL, "--python-text", "<name>\n\tRun the given Python script text block", run_python_text, C);
 	BLI_argsAdd(ba, 4, NULL, "--python-console", "\n\tRun blender with an interactive console", run_python_console, C);
 	BLI_argsAdd(ba, 4, NULL, "--addons", "\n\tComma separated list of addons (no spaces)", set_addons, C);
 
@@ -1418,12 +1504,15 @@ int main(int argc, const char **argv)
 	setupArguments(C, ba, &syshandle);
 
 	BLI_argsParse(ba, 1, NULL, NULL);
-#endif
 
 	if (use_crash_handler) {
 		/* after parsing args */
 		signal(SIGSEGV, blender_crash_handler);
 	}
+#else
+	G.factory_startup = true;  /* using preferences or user startup makes no sense for py-as-module */
+	(void)syshandle;
+#endif
 
 	/* after level 1 args, this is so playanim skips RNA init */
 	RNA_init();
@@ -1434,10 +1523,12 @@ int main(int argc, const char **argv)
 
 
 #if defined(WITH_PYTHON_MODULE) || defined(WITH_HEADLESS)
-	G.background = 1; /* python module mode ALWAYS runs in background mode (for now) */
+	G.background = true; /* python module mode ALWAYS runs in background mode (for now) */
 #else
 	/* for all platforms, even windos has it! */
-	if (G.background) signal(SIGINT, blender_esc);  /* ctrl c out bg render */
+	if (G.background) {
+		signal(SIGINT, blender_esc);  /* ctrl c out bg render */
+	}
 #endif
 
 	/* background render uses this font too */
diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt
index d833534..32efc5b 100644
--- a/source/gameengine/BlenderRoutines/CMakeLists.txt
+++ b/source/gameengine/BlenderRoutines/CMakeLists.txt
@@ -73,7 +73,7 @@ if(WITH_BULLET)
 	list(APPEND INC_SYS
 		${BULLET_INCLUDE_DIRS}
 	)
-	add_definitions(-DUSE_BULLET)
+	add_definitions(-DWITH_BULLET)
 endif()
 
 
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
index 719041e..6ab1d03 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
@@ -154,11 +154,11 @@ SetViewPort(
 	int x1, int y1,
 	int x2, int y2
 ) {
-	/*	x1 and y1 are the min pixel coordinate (e.g. 0)
-		x2 and y2 are the max pixel coordinate
-		the width,height is calculated including both pixels
-		therefore: max - min + 1
-	*/
+	/* x1 and y1 are the min pixel coordinate (e.g. 0)
+	 * x2 and y2 are the max pixel coordinate
+	 * the width,height is calculated including both pixels
+	 * therefore: max - min + 1
+	 */
 	int vp_width = (x2 - x1) + 1;
 	int vp_height = (y2 - y1) + 1;
 	int minx = m_frame_rect.GetLeft();
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
index 4117c13..430f956 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
@@ -58,8 +58,9 @@ struct wmWindow;
 class KX_BlenderCanvas : public RAS_ICanvas
 {
 private:
-	/** Rect that defines the area used for rendering,
-	    relative to the context */
+	/**
+	 * Rect that defines the area used for rendering,
+	 * relative to the context */
 	RAS_Rect m_displayarea;
 	int m_viewport[4];
 
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
index f8ad887..3a9a10d 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
@@ -121,6 +121,50 @@ static void DisableForText()
 	}
 }
 
+void BL_draw_gamedebug_box(int xco, int yco, int width, int height, float percentage)
+{
+	/* This is a rather important line :( The gl-mode hasn't been left
+	 * behind quite as neatly as we'd have wanted to. I don't know
+	 * what cause it, though :/ .*/
+	glDisable(GL_DEPTH_TEST);
+	
+	glMatrixMode(GL_PROJECTION);
+	glPushMatrix();
+	glLoadIdentity();
+	
+	glOrtho(0, width, 0, height, -100, 100);
+	
+	glMatrixMode(GL_MODELVIEW);
+	glPushMatrix();
+	glLoadIdentity();
+	
+	yco = height - yco;
+	int barsize = 50;
+
+	/* draw in black first*/
+	glColor3ub(0, 0, 0);
+	glBegin(GL_QUADS);
+	glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1 + 10);
+	glVertex2f(xco + 1, yco - 1 + 10);
+	glVertex2f(xco + 1, yco - 1);
+	glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1);
+	glEnd();
+	
+	glColor3ub(255, 255, 255);
+	glBegin(GL_QUADS);
+	glVertex2f(xco + 1 + barsize * percentage, yco + 10);
+	glVertex2f(xco, yco + 10);
+	glVertex2f(xco, yco);
+	glVertex2f(xco + 1 + barsize * percentage, yco);
+	glEnd();
+	
+	glMatrixMode(GL_PROJECTION);
+	glPopMatrix();
+	glMatrixMode(GL_MODELVIEW);
+	glPopMatrix();
+	glEnable(GL_DEPTH_TEST);
+}
+
 /* Print 3D text */
 void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* color, double* mat, float aspect)
 {
@@ -164,7 +208,9 @@ void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int
 
 	/* the actual drawing */
 	glColor3ub(255, 255, 255);
-	BLF_draw_default((float)xco, (float)(height-yco), 0.0f, (char *)text, 65535); /* XXX, use real len */
+	BLF_size(blf_mono_font, 11, 72);
+	BLF_position(blf_mono_font, (float)xco, (float)(height-yco), 0.0f);
+	BLF_draw(blf_mono_font, (char *)text, 65535); /* XXX, use real len */
 
 	glMatrixMode(GL_PROJECTION);
 	glPopMatrix();
@@ -193,9 +239,13 @@ void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int widt
 
 	/* draw in black first*/
 	glColor3ub(0, 0, 0);
-	BLF_draw_default((float)(xco+2), (float)(height-yco-2), 0.0f, text, 65535); /* XXX, use real len */
+	BLF_size(blf_mono_font, 11, 72);
+	BLF_position(blf_mono_font, (float)xco+1, (float)(height-yco-1), 0.0f);
+	BLF_draw(blf_mono_font, (char *)text, 65535);/* XXX, use real len */
+	
 	glColor3ub(255, 255, 255);
-	BLF_draw_default((float)xco, (float)(height-yco), 0.0f, text, 65535); /* XXX, use real len */
+	BLF_position(blf_mono_font, (float)xco, (float)(height-yco), 0.0f);
+	BLF_draw(blf_mono_font, (char *)text, 65535);
 
 	glMatrixMode(GL_PROJECTION);
 	glPopMatrix();
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.h b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
index 7ba612b..5c3f068 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
@@ -50,6 +50,7 @@ void	BL_HideMouse(struct wmWindow *win);
 void	BL_NormalMouse(struct wmWindow *win);
 void	BL_WaitMouse(struct wmWindow *win);
 
+void BL_draw_gamedebug_box(int xco, int yco, int width, int height, float percentage);
 void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* color, double* mat, float aspect);
 void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height);
 void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height);
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
index 19ba46e..5917ce4 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
@@ -49,8 +49,8 @@ KX_BlenderKeyboardDevice::~KX_BlenderKeyboardDevice()
 }
 
 /**
-	IsPressed gives boolean information about keyboard status, true if pressed, false if not
-*/
+ * IsPressed gives boolean information about keyboard status, true if pressed, false if not
+ */
 
 bool KX_BlenderKeyboardDevice::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)
 {
@@ -64,11 +64,11 @@ bool KX_BlenderKeyboardDevice::IsPressed(SCA_IInputDevice::KX_EnumInputs inputco
 	return m_eventStatusTables[m_currentTable][inputcode];
 }
 */
-/** 
-	NextFrame toggles currentTable with previousTable,
-	and copy relevant event information from previous to current
-	(pressed keys need to be remembered)
-*/
+/**
+ * NextFrame toggles currentTable with previousTable,
+ * and copy relevant event information from previous to current
+ * (pressed keys need to be remembered)
+ */
 void	KX_BlenderKeyboardDevice::NextFrame()
 {
 	SCA_IInputDevice::NextFrame();
@@ -87,13 +87,11 @@ void	KX_BlenderKeyboardDevice::NextFrame()
 	}
 }
 
-/** 
-	ConvertBlenderEvent translates blender keyboard events into ketsji kbd events
-	extra event information is stored, like ramp-mode (just released/pressed)
+/**
+ * ConvertBlenderEvent translates blender keyboard events into ketsji kbd events
+ * extra event information is stored, like ramp-mode (just released/pressed)
 */
-
-
-bool	KX_BlenderKeyboardDevice::ConvertBlenderEvent(unsigned short incode,short val)
+bool KX_BlenderKeyboardDevice::ConvertBlenderEvent(unsigned short incode, short val)
 {
 	bool result = false;
 	
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
index 8d90eac..0cdc102 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
@@ -46,8 +46,8 @@ KX_BlenderMouseDevice::~KX_BlenderMouseDevice()
 }
 
 /**
-	IsPressed gives boolean information about mouse status, true if pressed, false if not
-*/
+ * IsPressed gives boolean information about mouse status, true if pressed, false if not
+ */
 
 bool KX_BlenderMouseDevice::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)
 {
@@ -62,11 +62,11 @@ bool KX_BlenderMouseDevice::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)
 }
 */
 
-/** 
-	NextFrame toggles currentTable with previousTable,
-	and copy relevant event information from previous to current
-	(pressed keys need to be remembered)
-*/
+/**
+ * NextFrame toggles currentTable with previousTable,
+ * and copy relevant event information from previous to current
+ * (pressed keys need to be remembered)
+ */
 void	KX_BlenderMouseDevice::NextFrame()
 {
 	SCA_IInputDevice::NextFrame();
@@ -104,13 +104,11 @@ void	KX_BlenderMouseDevice::NextFrame()
 }
 
 
-/** 
-	ConvertBlenderEvent translates blender mouse events into ketsji kbd events
-	extra event information is stored, like ramp-mode (just released/pressed)
-*/
-
-
-bool	KX_BlenderMouseDevice::ConvertBlenderEvent(unsigned short incode,short val)
+/**
+ * ConvertBlenderEvent translates blender mouse events into ketsji kbd events
+ * extra event information is stored, like ramp-mode (just released/pressed)
+ */
+bool KX_BlenderMouseDevice::ConvertBlenderEvent(unsigned short incode, short val)
 {
 	bool result = false;
 	
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
index e32239b..64ed384 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
@@ -280,6 +280,16 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
 		}
 	}
 }
+
+void KX_BlenderRenderTools::RenderBox2D(int xco,
+			int yco,
+			int width,
+			int height,
+			float percentage)
+{
+	BL_draw_gamedebug_box(xco, yco, width, height, percentage);
+}
+
 void KX_BlenderRenderTools::RenderText3D(int fontid,
 										 const char* text,
 										 int size,
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
index 7195524..228763e 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
@@ -71,6 +71,13 @@ public:
 	void				DisableOpenGLLights();
 	void				ProcessLighting(RAS_IRasterizer *rasty, bool uselights, const MT_Transform& viewmat);
 
+	void				RenderBox2D(int xco,
+									int yco,
+									int width,
+									int height,
+									float percentage);
+
+	
 	void				RenderText3D(int fontid,
 	                                 const char* text,
 	                                 int size,
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 9267b2b..f7726eb 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -164,7 +164,7 @@ extern Material defmaterial;	/* material.c */
 #include "SG_Tree.h"
 
 #include "KX_ConvertPhysicsObject.h"
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "CcdPhysicsEnvironment.h"
 #include "CcdGraphicController.h"
 #endif
@@ -921,9 +921,6 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace
 		/* do Texture Face materials */
 		Image* bima = (tface)? (Image*)tface->tpage: NULL;
 		STR_String imastr =  (tface)? (bima? (bima)->id.name : "" ) : "";
-
-		if (!converter->GetCacheMaterials())
-			polymat = NULL;
 		
 		char alpha_blend=0;
 		short tile=0;
@@ -933,7 +930,7 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace
 		if (ma) {
 			alpha_blend = ma->game.alpha_blend;
 			/* Commented out for now. If we ever get rid of
-				* "Texture Face/Singletexture" we can then think about it */
+			 * "Texture Face/Singletexture" we can then think about it */
 
 			/* Texture Face mode ignores texture but requires "Face Textures to be True "*/
 	#if 0
@@ -1045,9 +1042,8 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace
 				polymat->m_specular.setValue(0.0f,0.0f,0.0f);
 				polymat->m_shininess = 35.0;
 			}
-			
-			if (converter->GetCacheMaterials())
-				converter->CachePolyMaterial(ma, polymat);
+
+			converter->CachePolyMaterial(ma, polymat);
 		}
 	}
 	
@@ -1526,7 +1522,7 @@ static void BL_CreateGraphicObjectNew(KX_GameObject* gameobj,
 	{
 		switch (physics_engine)
 		{
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 		case UseBullet:
 			{
 				CcdPhysicsEnvironment* env = (CcdPhysicsEnvironment*)kxscene->GetPhysicsEnvironment();
@@ -1829,7 +1825,7 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
 	
 	switch (physics_engine)
 	{
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 		case UseBullet:
 			KX_ConvertBulletObject(gameobj, meshobj, dm, kxscene, shapeprops, smmaterial, &objprop);
 			break;
@@ -1973,6 +1969,22 @@ static KX_GameObject *gameobject_from_blenderobject(
 			((ob->gameflag2 & OB_NEVER_DO_ACTIVITY_CULLING)!=0);
 		gameobj->SetIgnoreActivityCulling(ignoreActivityCulling);
 		gameobj->SetOccluder((ob->gameflag & OB_OCCLUDER) != 0, false);
+
+		// we only want obcolor used if there is a material in the mesh
+		// that requires it
+		Material *mat= NULL;
+		bool bUseObjectColor=false;
+		
+		for (int i=0;i<mesh->totcol;i++) {
+			mat=mesh->mat[i];
+			if (!mat) break;
+			if ((mat->shade_flag & MA_OBCOLOR)) {
+				bUseObjectColor = true;
+				break;
+			}
+		}
+		if (bUseObjectColor)
+			gameobj->SetObjectColor(ob->col);
 	
 		// two options exists for deform: shape keys and armature
 		// only support relative shape key
@@ -1980,7 +1992,7 @@ static KX_GameObject *gameobject_from_blenderobject(
 		bool bHasDvert = mesh->dvert != NULL && ob->defbase.first;
 		bool bHasArmature = (BL_ModifierDeformer::HasArmatureDeformer(ob) && ob->parent && ob->parent->type == OB_ARMATURE && bHasDvert);
 		bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(ob);
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 		bool bHasSoftBody = (!ob->parent && (ob->gameflag & OB_SOFT_BODY));
 #endif
 		if (bHasModifier) {
@@ -2007,7 +2019,7 @@ static KX_GameObject *gameobject_from_blenderobject(
 			BL_MeshDeformer *dcont = new BL_MeshDeformer((BL_DeformableGameObject*)gameobj,
 														  ob, meshobj);
 			((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont);
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 		} else if (bHasSoftBody) {
 			KX_SoftBodyDeformer *dcont = new KX_SoftBodyDeformer(meshobj, (BL_DeformableGameObject*)gameobj);
 			((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont);
diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt
index 8ac9e52..38c0d71 100644
--- a/source/gameengine/Converter/CMakeLists.txt
+++ b/source/gameengine/Converter/CMakeLists.txt
@@ -114,7 +114,7 @@ if(WITH_BULLET)
 	list(APPEND INC_SYS
 		${BULLET_INCLUDE_DIRS}
 	)
-	add_definitions(-DUSE_BULLET)
+	add_definitions(-DWITH_BULLET)
 endif()
 
 if(WITH_AUDASPACE)
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 5524612..cd5dec4 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -55,7 +55,7 @@
 
 #include "KX_ConvertPhysicsObject.h"
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "CcdPhysicsEnvironment.h"
 #endif
 
@@ -193,7 +193,7 @@ KX_BlenderSceneConverter::~KX_BlenderSceneConverter()
 		itm++;
 	}
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	KX_ClearBulletSharedShapes();
 #endif
 
@@ -254,7 +254,7 @@ Scene *KX_BlenderSceneConverter::GetBlenderSceneForName(const STR_String& name)
 }
 #include "KX_PythonInit.h"
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 
 #include "LinearMath/btIDebugDraw.h"
 
@@ -348,7 +348,7 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
 
 	switch (physics_engine)
 	{
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 		case UseBullet:
 			{
 				CcdPhysicsEnvironment* ccdPhysEnv = new CcdPhysicsEnvironment(useDbvtCulling);
@@ -398,7 +398,7 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
 	//that would result from this is fixed in RemoveScene()
 	m_map_mesh_to_gamemesh.clear();
 
-#ifndef USE_BULLET
+#ifndef WITH_BULLET
 	/* quiet compiler warning */
 	(void)useDbvtCulling;
 #endif
@@ -601,22 +601,24 @@ void KX_BlenderSceneConverter::RegisterPolyMaterial(RAS_IPolyMaterial *polymat)
 
 void KX_BlenderSceneConverter::CachePolyMaterial(struct Material *mat, RAS_IPolyMaterial *polymat)
 {
-	m_polymat_cache[mat] = polymat;
+	if (m_use_mat_cache)
+		m_polymat_cache[mat] = polymat;
 }
 
 RAS_IPolyMaterial *KX_BlenderSceneConverter::FindCachedPolyMaterial(struct Material *mat)
 {
-	return m_polymat_cache[mat];
+	return (m_use_mat_cache) ? m_polymat_cache[mat] : NULL;
 }
 
 void KX_BlenderSceneConverter::CacheBlenderMaterial(struct Material *mat, BL_Material *blmat)
 {
-	m_mat_cache[mat] = blmat;
+	if (m_use_mat_cache)
+		m_mat_cache[mat] = blmat;
 }
 
 BL_Material *KX_BlenderSceneConverter::FindCachedBlenderMaterial(struct Material *mat)
 {
-	return m_mat_cache[mat];
+	return (m_use_mat_cache) ? m_mat_cache[mat] : NULL;
 }
 
 void KX_BlenderSceneConverter::RegisterInterpolatorList(
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index 695bf0c..05da38d 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -180,7 +180,10 @@ void BL_ConvertActuators(const char* maggiename,
 				bitLocalFlag.LinearVelocity = bool((obact->flag & ACT_LIN_VEL_LOCAL)!=0);
 				bitLocalFlag.AngularVelocity = bool((obact->flag & ACT_ANG_VEL_LOCAL)!=0);
 				bitLocalFlag.ServoControl = bool(obact->type == ACT_OBJECT_SERVO);
+				bitLocalFlag.CharacterMotion = bool(obact->type == ACT_OBJECT_CHARACTER);
+				bitLocalFlag.CharacterJump = bool((obact->flag & ACT_CHAR_JUMP)!=0);
 				bitLocalFlag.AddOrSetLinV = bool((obact->flag & ACT_ADD_LIN_VEL)!=0);
+				bitLocalFlag.AddOrSetCharLoc = bool((obact->flag & ACT_ADD_CHAR_LOC)!=0);
 				if (obact->reference && bitLocalFlag.ServoControl)
 				{
 					obref = converter->FindGameObject(obact->reference);
diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp
index 72d0c87..d860b2e 100644
--- a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp
+++ b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp
@@ -42,7 +42,7 @@
 #include "CTR_Map.h"
 #include "CTR_HashedPtr.h"
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 
 #include "CcdPhysicsEnvironment.h"
 #include "CcdPhysicsController.h"
diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript
index 28ad742..ef546ce 100644
--- a/source/gameengine/Converter/SConscript
+++ b/source/gameengine/Converter/SConscript
@@ -64,7 +64,7 @@ if env['WITH_BF_CXX_GUARDEDALLOC']:
     defs.append('WITH_CXX_GUARDEDALLOC')
 
 if env['WITH_BF_BULLET']:
-    defs.append('USE_BULLET')
+    defs.append('WITH_BULLET')
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
     incs += ' ' + env['BF_PTHREADS_INC']
diff --git a/source/gameengine/Expressions/EmptyValue.cpp b/source/gameengine/Expressions/EmptyValue.cpp
index 2bb8f69..8170c58 100644
--- a/source/gameengine/Expressions/EmptyValue.cpp
+++ b/source/gameengine/Expressions/EmptyValue.cpp
@@ -30,9 +30,9 @@
 
 CEmptyValue::CEmptyValue()
 /*
-pre:
-effect: constructs a new CEmptyValue
-*/
+ * pre:
+ * effect: constructs a new CEmptyValue
+ */
 {
 	SetModified(false);
 }
@@ -41,9 +41,9 @@ effect: constructs a new CEmptyValue
 
 CEmptyValue::~CEmptyValue()
 /*
-pre:
-effect: deletes the object
-*/
+ * pre:
+ * effect: deletes the object
+ */
 {
 
 }
@@ -52,10 +52,10 @@ effect: deletes the object
 
 CValue * CEmptyValue::Calc(VALUE_OPERATOR op, CValue * val)
 /*
-pre:
-ret: a new object containing the result of applying operator op to this
-object and val
-*/
+ * pre:
+ * ret: a new object containing the result of applying operator op to this
+ * object and val
+ */
 {
 	return val->CalcFinal(VALUE_EMPTY_TYPE, op, this);
 	
@@ -65,10 +65,10 @@ object and val
 
 CValue * CEmptyValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue * val)
 /*
-pre: the type of val is dtype
-ret: a new object containing the result of applying operator op to val and
-this object
-*/
+ * pre: the type of val is dtype
+ * ret: a new object containing the result of applying operator op to val and
+ * this object
+ */
 {
 	return val->AddRef();
 }
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp
index 5a2075d..ed89fb1 100644
--- a/source/gameengine/Expressions/InputParser.cpp
+++ b/source/gameengine/Expressions/InputParser.cpp
@@ -260,7 +260,8 @@ void CParser::NextSym()
 				opkind = OPless;
 			}
 			break;
-		case '\"' : {
+		case '\"' :
+		{
 			int start;
 			sym = constsym;
 			constkind = stringtype;
@@ -464,7 +465,8 @@ CExpression *CParser::Ex(int i)
 		}
 		else {
 			switch (sym) {
-				case constsym: {
+				case constsym:
+				{
 					switch (constkind) {
 						case booltype:
 							e1 = new CConstExpr(new CBoolValue(boolvalue));
diff --git a/source/gameengine/Expressions/Operator2Expr.cpp b/source/gameengine/Expressions/Operator2Expr.cpp
index d0240b5..b03d00e 100644
--- a/source/gameengine/Expressions/Operator2Expr.cpp
+++ b/source/gameengine/Expressions/Operator2Expr.cpp
@@ -113,61 +113,61 @@ and m_rhs
 	
 }
 
-/*
+#if 0
 bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude)
 {
 	bool inside;
 	inside = false;
 	
-	switch (m_op) 
-	{
-	case VALUE_ADD_OPERATOR: {
-	//	inside = first || second; // optimized with early out if first is inside
-		// todo: calculate smallest leaf first ! is much faster...
-			
-		bool second;//first ;//,second;
-		
-		//first = m_lhs->IsInside(x,y,z);
-		second = m_rhs->IsInside(x,y,z,bBorderInclude);
-		if (second)
-			return true; //early out
-	
-	//	second = m_rhs->IsInside(x,y,z);
+	switch (m_op) {
+		case VALUE_ADD_OPERATOR:
+		{
+			//	inside = first || second; // optimized with early out if first is inside
+			// todo: calculate smallest leaf first ! is much faster...
 
-		return m_lhs->IsInside(x,y,z,bBorderInclude);
-			
-		break;
-							 }
-		
-	case VALUE_SUB_OPERATOR: {
-		//inside = first && !second; // optimized with early out
-		// todo: same as with add_operator: calc smallest leaf first
+			bool second;//first ;//,second;
 
-		bool second;//first ;//,second;
-		//first = m_lhs->IsInside(x,y,z);
-		second = m_rhs->IsInside(x,y,z,bBorderInclude);
-		if (second)
-			return false;
+			//first = m_lhs->IsInside(x,y,z);
+			second = m_rhs->IsInside(x,y,z,bBorderInclude);
+			if (second)
+				return true; //early out
 
-		// second space get subtracted -> negate!
-		//second = m_rhs->IsInside(x,y,z);
+			//	second = m_rhs->IsInside(x,y,z);
 
-		return (m_lhs->IsInside(x,y,z,bBorderInclude));
+			return m_lhs->IsInside(x,y,z,bBorderInclude);
 
-		
-		break;
-							 }
-	default:{
-		assert(false);
-		// not yet implemented, only add or sub csg operations
-			}
+			break;
+		}
+
+		case VALUE_SUB_OPERATOR:
+		{
+			//inside = first && !second; // optimized with early out
+			// todo: same as with add_operator: calc smallest leaf first
+
+			bool second;//first ;//,second;
+			//first = m_lhs->IsInside(x,y,z);
+			second = m_rhs->IsInside(x,y,z,bBorderInclude);
+			if (second)
+				return false;
+
+			// second space get subtracted -> negate!
+			//second = m_rhs->IsInside(x,y,z);
+
+			return (m_lhs->IsInside(x,y,z,bBorderInclude));
+
+
+			break;
+		}
+		default:
+		{
+			assert(false);
+			// not yet implemented, only add or sub csg operations
+		}
 	}
 	
 	return inside;
 }
 
-
-
 bool COperator2Expr::IsRightInside(float x, float y, float z,bool bBorderInclude)
 {
 	return m_rhs->IsInside(x,y,z,bBorderInclude);
@@ -177,7 +177,8 @@ bool COperator2Expr::IsLeftInside(float x, float y, float z,bool bBorderInclude)
 {
 	return m_lhs->IsInside(x,y,z,bBorderInclude);
 }
-*/
+#endif
+
 bool COperator2Expr::NeedsRecalculated()
 {
 	// added some lines, just for debugging purposes, it could be a one-liner :)
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 4e910a8..52ad95c 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -43,7 +43,7 @@
  * Center for the Neural Basis of Cognition (CNBC) 
  * http://www.python.org/doc/PyCPP.html
  *
-------------------------------*/
+ * ----------------------------- */
 #include <stdlib.h>
 #include <stddef.h>
 
@@ -103,7 +103,7 @@ void PyObjectPlus::InvalidateProxy()		// check typename of each parent
 
 /*------------------------------
  * PyObjectPlus Type		-- Every class, even the abstract one should have a Type
-------------------------------*/
+ * ----------------------------- */
 
 
 PyTypeObject PyObjectPlus::Type = {
@@ -217,8 +217,8 @@ PyObject *PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject
 }
 
 /**
-  * \param self A PyObjectPlus_Proxy
-  */
+ * \param self A PyObjectPlus_Proxy
+ */
 void PyObjectPlus::py_base_dealloc(PyObject *self)				// python wrapper
 {
 #ifdef USE_WEAKREFS
diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h
index 1a403f4..ceb9c1e 100644
--- a/source/gameengine/GameLogic/SCA_IInputDevice.h
+++ b/source/gameengine/GameLogic/SCA_IInputDevice.h
@@ -269,7 +269,7 @@ public:
 
 		KX_MAX_KEYS
 		
-	} ; // enum  
+	}; // enum
 
 
 protected:
@@ -301,17 +301,18 @@ public:
 	
 	virtual void		HookEscape();
 	
-	/* Next frame: we calculate the new key states. This goes as follows:
-	*
-	* KX_NO_INPUTSTATUS -> KX_NO_INPUTSTATUS
-	* KX_JUSTACTIVATED  -> KX_ACTIVE
-	* KX_ACTIVE         -> KX_ACTIVE
-	* KX_JUSTRELEASED   -> KX_NO_INPUTSTATUS
-	*
-	* Getting new events provides the
-	* KX_NO_INPUTSTATUS->KX_JUSTACTIVATED and
-	* KX_ACTIVE->KX_JUSTRELEASED transitions.
-	*/
+	/**
+	 * Next frame: we calculate the new key states. This goes as follows:
+	 *
+	 * KX_NO_INPUTSTATUS -> KX_NO_INPUTSTATUS
+	 * KX_JUSTACTIVATED  -> KX_ACTIVE
+	 * KX_ACTIVE         -> KX_ACTIVE
+	 * KX_JUSTRELEASED   -> KX_NO_INPUTSTATUS
+	 *
+	 * Getting new events provides the
+	 * KX_NO_INPUTSTATUS->KX_JUSTACTIVATED and
+	 * KX_ACTIVE->KX_JUSTRELEASED transitions.
+	 */
 	virtual void	NextFrame();
 
 
diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h
index 0189af0..365e2b0 100644
--- a/source/gameengine/GameLogic/SCA_IObject.h
+++ b/source/gameengine/GameLogic/SCA_IObject.h
@@ -221,7 +221,7 @@ public:
 		OBJ_ARMATURE=0,
 		OBJ_CAMERA=1,
 		OBJ_LIGHT=2,
-	}ObjectTypes;
+	} ObjectTypes;
 
 };
 
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h
index 6909301..4d8c200 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.h
+++ b/source/gameengine/GameLogic/SCA_LogicManager.h
@@ -52,7 +52,7 @@ using namespace std;
 typedef std::list<class SCA_IController*> controllerlist;
 typedef std::map<class SCA_ISensor*,controllerlist > sensormap_t;
 
-/** 
+/**
  * This manager handles sensor, controllers and actuators.
  * logic executes each frame the following way:
  * find triggering sensors
@@ -63,7 +63,7 @@ typedef std::map<class SCA_ISensor*,controllerlist > sensormap_t;
  * clear triggering sensors
  * clear triggered controllers
  * (actuators may be active during a longer timeframe)
-*/
+ */
 
 #include "SCA_ILogicBrick.h"
 #include "SCA_IActuator.h"
@@ -117,8 +117,8 @@ public:
 	void	RemoveGameObject(const STR_String& gameobjname);
 
 	/**
-	* remove Logic Bricks from the running logicmanager
-	*/
+	 * remove Logic Bricks from the running logicmanager
+	 */
 	void	RemoveSensor(SCA_ISensor* sensor);
 	void	RemoveController(SCA_IController* controller);
 	void	RemoveActuator(SCA_IActuator* actuator);
diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp
index 5568072..db6b4a6 100644
--- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp
@@ -178,23 +178,15 @@ bool SCA_RandomActuator::Update()
 	case KX_RANDOMACT_FLOAT_NORMAL: {
 		/* normal (big numbers): para1 = mean, para2 = std dev               */
 
-		/* 
-
-		   070301 - nzc - Changed the termination condition. I think I 
-		   made a small mistake here, but it only affects distro's where
-		   the seed equals 0. In that case, the algorithm locks. Let's
-		   just guard that case separately.
-
-		*/
+		/* 070301 - nzc: Changed the termination condition. I think I
+		 * made a small mistake here, but it only affects distro's where
+		 * the seed equals 0. In that case, the algorithm locks. Let's
+		 * just guard that case separately.
+		 */
 
 		float x = 0.0, y = 0.0, s = 0.0, t = 0.0;
 		if (m_base->GetSeed() == 0) {
-			/*
-
-			  070301 - nzc 
-			  Just taking the mean here seems reasonable.
-
-			 */
+			/* 070301 - nzc: Just taking the mean here seems reasonable. */
 			tmpval = new CFloatValue(m_parameter1);
 		}
 		else {
diff --git a/source/gameengine/GamePlayer/common/GPC_RawImage.cpp b/source/gameengine/GamePlayer/common/GPC_RawImage.cpp
index c0d6654..0e2585b 100644
--- a/source/gameengine/GamePlayer/common/GPC_RawImage.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RawImage.cpp
@@ -29,7 +29,6 @@
  *  \ingroup player
  */
 
-   
 #include <iostream>
 #include <string.h>
 
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
index dfc8665..bab4aa1 100644
--- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
@@ -283,6 +283,78 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in
 	}
 }
 
+void GPC_RenderTools::RenderBox2D(int xco,
+										int yco,
+										int width,
+										int height,
+										float percentage)
+{
+	// Save and change OpenGL settings
+	int texture2D;
+	glGetIntegerv(GL_TEXTURE_2D, (GLint*)&texture2D);
+	glDisable(GL_TEXTURE_2D);
+	int fog;
+	glGetIntegerv(GL_FOG, (GLint*)&fog);
+	glDisable(GL_FOG);
+	
+	int light;
+	glGetIntegerv(GL_LIGHTING, (GLint*)&light);
+	glDisable(GL_LIGHTING);
+	
+	glDisable(GL_DEPTH_TEST);
+	
+	// Set up viewing settings
+	glMatrixMode(GL_PROJECTION);
+	glPushMatrix();
+	glLoadIdentity();
+	glOrtho(0, width, 0, height, -1, 1);
+	glMatrixMode(GL_MODELVIEW);
+	glPushMatrix();
+	glLoadIdentity();
+	
+	yco = height - yco;
+	int barsize = 50;
+	
+	// draw in black first
+	glColor3ub(0, 0, 0);
+	glBegin(GL_QUADS);
+	glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1 + 10);
+	glVertex2f(xco + 1, yco - 1 + 10);
+	glVertex2f(xco + 1, yco - 1);
+	glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1);
+	glEnd();
+	
+	glColor3ub(255, 255, 255);
+	glBegin(GL_QUADS);
+	glVertex2f(xco + 1 + barsize * percentage, yco + 10);
+	glVertex2f(xco, yco + 10);
+	glVertex2f(xco, yco);
+	glVertex2f(xco + 1 + barsize * percentage, yco);
+	glEnd();
+	
+	// Restore view settings
+	glMatrixMode(GL_PROJECTION);
+	glPopMatrix();
+	glMatrixMode(GL_MODELVIEW);
+	glPopMatrix();
+	
+	// Restore OpenGL Settings
+	if (fog)
+		glEnable(GL_FOG);
+	else
+		glDisable(GL_FOG);
+	
+	if (texture2D)
+		glEnable(GL_TEXTURE_2D);
+	else
+		glDisable(GL_TEXTURE_2D);
+	if (light)
+		glEnable(GL_LIGHTING);
+	else
+		glDisable(GL_LIGHTING);
+}
+
+
 void GPC_RenderTools::RenderText3D(	int fontid,
 									const char* text,
 									int size,
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h
index 1030c09..f4dcddd 100644
--- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h
+++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h
@@ -70,6 +70,12 @@ public:
 	void				DisableOpenGLLights();
 	void				ProcessLighting(RAS_IRasterizer *rasty, bool uselights, const MT_Transform& viewmat);
 
+	void				RenderBox2D(int xco,
+						int yco,
+						int width,
+						int height,
+						float percentage);
+
 	void				RenderText3D(int fontid,
 									 const char* text,
 									 int size,
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 26e9bcb..5b2cfdd 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -258,10 +258,10 @@ static void usage(const char* program, bool isBlenderPlayer)
 static void get_filename(int argc, char **argv, char *filename)
 {
 #ifdef __APPLE__
-/* On Mac we park the game file (called game.blend) in the application bundle.
-* The executable is located in the bundle as well.
-* Therefore, we can locate the game relative to the executable.
-	*/
+	/* On Mac we park the game file (called game.blend) in the application bundle.
+	 * The executable is located in the bundle as well.
+	 * Therefore, we can locate the game relative to the executable.
+	 */
 	int srclen = ::strlen(argv[0]);
 	int len = 0;
 	char *gamefile = NULL;
@@ -471,7 +471,7 @@ int main(int argc, char** argv)
 			break;
 		case SCREEN_SAVER_MODE_PASSWORD:
 			/* This is W95 only, which we currently do not support.
-			   Fall-back to normal screen saver behavior in that case... */
+			 * Fall-back to normal screen saver behavior in that case... */
 		case SCREEN_SAVER_MODE_SAVER:
 			fullScreen = true;
 			fullScreenParFound = true;
@@ -907,7 +907,7 @@ int main(int argc, char** argv)
 							if (domeWarp)
 							{
 								//XXX to do: convert relative to absolute path
-								domeText= BKE_text_load(domeWarp, "");
+								domeText= BKE_text_load(G.main, domeWarp, "");
 								if (!domeText)
 									printf("error: invalid warpdata text file - %s\n", domeWarp);
 								else
diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt
index e42c2a7..fc322d8 100644
--- a/source/gameengine/Ketsji/CMakeLists.txt
+++ b/source/gameengine/Ketsji/CMakeLists.txt
@@ -254,7 +254,7 @@ if(WITH_BULLET)
 	list(APPEND INC
 		${BULLET_INCLUDE_DIRS}
 	)
-	add_definitions(-DUSE_BULLET)
+	add_definitions(-DWITH_BULLET)
 endif()
 
 blender_add_lib(ge_logic_ketsji "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index a55dd70..231ec27 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -400,6 +400,8 @@ KX_BlenderMaterial::ActivatShaders(
 	
 		if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)
 			tmp->setShaderData(true, rasty);
+		else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && IsAlpha() && !rasty->GetUsingOverrideShader())
+			tmp->setShaderData(true, rasty);
 		else
 			tmp->setShaderData(false, rasty);
 
@@ -445,6 +447,8 @@ KX_BlenderMaterial::ActivateBlenderShaders(
 	
 		if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)
 			tmp->setBlenderShaderData(true, rasty);
+		else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && IsAlpha() && !rasty->GetUsingOverrideShader())
+			tmp->setBlenderShaderData(true, rasty);
 		else
 			tmp->setBlenderShaderData(false, rasty);
 
@@ -494,6 +498,8 @@ KX_BlenderMaterial::ActivateMat(
 
 		if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)
 			tmp->setTexData( true,rasty  );
+		else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && IsAlpha() && !rasty->GetUsingOverrideShader())
+			tmp->setTexData(true, rasty);
 		else
 			tmp->setTexData( false,rasty);
 
@@ -628,7 +634,8 @@ void KX_BlenderMaterial::ActivatGLMaterials( RAS_IRasterizer* rasty )const
 
 void KX_BlenderMaterial::ActivateTexGen(RAS_IRasterizer *ras) const
 {
-	if (ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) {
+	if (ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED || 
+		(ras->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && IsAlpha() && !ras->GetUsingOverrideShader())) {
 		ras->SetAttribNum(0);
 		if (mShader && GLEW_ARB_shader_objects) {
 			if (mShader->GetAttribute() == BL_Shader::SHD_TANGENT) {
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
index 20c41b9..262ec54 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
@@ -4,7 +4,7 @@
 //under visual studio the #define in KX_ConvertPhysicsObject.h is quicker for recompilation
 #include "KX_ConvertPhysicsObject.h"
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 
 #include "KX_BulletPhysicsController.h"
 
@@ -75,6 +75,11 @@ void  KX_BulletPhysicsController::SetLinVelocityMin(float val)
 	CcdPhysicsController::SetLinVelocityMin(val);
 }
 
+void KX_BulletPhysicsController::Jump()
+{
+	CcdPhysicsController::Jump();
+}
+
 float KX_BulletPhysicsController::GetLinVelocityMax()
 {
 	return (float)CcdPhysicsController::GetLinVelocityMax();
@@ -119,6 +124,11 @@ void	KX_BulletPhysicsController::RelativeTranslate(const MT_Vector3& dloc,bool l
 
 }
 
+void	KX_BulletPhysicsController::SetWalkDirection(const MT_Vector3& dloc,bool local)
+{
+	CcdPhysicsController::SetWalkDirection(dloc[0],dloc[1],dloc[2],local);
+}
+
 void	KX_BulletPhysicsController::RelativeRotate(const MT_Matrix3x3& drot,bool local)
 {
 	float	rotval[9];
@@ -155,6 +165,13 @@ MT_Vector3 KX_BulletPhysicsController::GetVelocity(const MT_Point3& pos)
 	return MT_Vector3(linVel[0],linVel[1],linVel[2]);
 }
 
+MT_Vector3 KX_BulletPhysicsController::GetWalkDirection()
+{
+	float dir[3];
+	CcdPhysicsController::GetWalkDirection(dir[0], dir[1], dir[2]);
+	return MT_Vector3(dir[0], dir[1], dir[2]);
+}
+
 void	KX_BulletPhysicsController::SetAngularVelocity(const MT_Vector3& ang_vel,bool local)
 {
 	CcdPhysicsController::SetAngularVelocity(ang_vel.x(),ang_vel.y(),ang_vel.z(),local);
@@ -536,4 +553,4 @@ const char* KX_BulletPhysicsController::getName()
 	return 0;
 }
 
-#endif // USE_BULLET
+#endif // WITH_BULLET
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
index 4813b39..3d13744 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
@@ -8,7 +8,7 @@
 
 
 #include "KX_IPhysicsController.h"
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "CcdPhysicsController.h"
 #endif
 
@@ -25,7 +25,7 @@ private:
 	btCollisionShape* m_bulletChildShape;
 
 public:
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool character, bool compound);
 	virtual ~KX_BulletPhysicsController ();
 #endif
@@ -40,11 +40,14 @@ public:
 	virtual void	RelativeRotate(const MT_Matrix3x3& drot,bool local);
 	virtual void	ApplyTorque(const MT_Vector3& torque,bool local);
 	virtual void	ApplyForce(const MT_Vector3& force,bool local);
+	virtual void	SetWalkDirection(const MT_Vector3& dir,bool local);
 	virtual MT_Vector3 GetLinearVelocity();
 	virtual MT_Vector3 GetAngularVelocity();
 	virtual MT_Vector3 GetVelocity(const MT_Point3& pos);
+	virtual MT_Vector3 GetWalkDirection();
 	virtual void	SetAngularVelocity(const MT_Vector3& ang_vel,bool local);
 	virtual void	SetLinearVelocity(const MT_Vector3& lin_vel,bool local);
+	virtual void	Jump();
 	virtual	void	getOrientation(MT_Quaternion& orn);
 	virtual	void setOrientation(const MT_Matrix3x3& orn);
 	virtual	void setPosition(const MT_Point3& pos);
diff --git a/source/gameengine/Ketsji/KX_CharacterWrapper.cpp b/source/gameengine/Ketsji/KX_CharacterWrapper.cpp
index 64bbbb7..a669bdd 100644
--- a/source/gameengine/Ketsji/KX_CharacterWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_CharacterWrapper.cpp
@@ -5,6 +5,7 @@
 
 #include "KX_CharacterWrapper.h"
 #include "PHY_ICharacter.h"
+#include "KX_PyMath.h"
 
 KX_CharacterWrapper::KX_CharacterWrapper(PHY_ICharacter* character) :
 		PyObjectPlus(),
@@ -47,6 +48,7 @@ PyAttributeDef KX_CharacterWrapper::Attributes[] = {
 	KX_PYATTRIBUTE_RW_FUNCTION("gravity", KX_CharacterWrapper, pyattr_get_gravity, pyattr_set_gravity),
 	KX_PYATTRIBUTE_RW_FUNCTION("maxJumps", KX_CharacterWrapper, pyattr_get_max_jumps, pyattr_set_max_jumps),
 	KX_PYATTRIBUTE_RO_FUNCTION("jumpCount", KX_CharacterWrapper, pyattr_get_jump_count),
+	KX_PYATTRIBUTE_RW_FUNCTION("walkDirection", KX_CharacterWrapper, pyattr_get_walk_dir, pyattr_set_walk_dir),
 	{ NULL }	//Sentinel
 };
 
@@ -108,6 +110,33 @@ PyObject *KX_CharacterWrapper::pyattr_get_jump_count(void *self_v, const KX_PYAT
 	return PyLong_FromLong(self->m_character->GetJumpCount());
 }
 
+PyObject *KX_CharacterWrapper::pyattr_get_walk_dir(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+	KX_CharacterWrapper* self = static_cast<KX_CharacterWrapper*>(self_v);
+	PHY__Vector3 vec = self->m_character->GetWalkDirection();
+	MT_Vector3 retval = MT_Vector3(vec[0], vec[1], vec[2]);
+
+	return PyObjectFrom(retval);
+}
+
+int KX_CharacterWrapper::pyattr_set_walk_dir(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+	KX_CharacterWrapper* self = static_cast<KX_CharacterWrapper*>(self_v);
+	MT_Vector3 dir;
+	if (!PyVecTo(value, dir)) {
+		PyErr_SetString(PyExc_TypeError, "KX_CharacterWrapper.walkDirection: expected a vector");
+		return PY_SET_ATTR_FAIL;
+	}
+
+	PHY__Vector3 vec;
+	vec[0] = dir[0];
+	vec[1] = dir[1];
+	vec[2] = dir[2];
+
+	self->m_character->SetWalkDirection(vec);
+	return PY_SET_ATTR_SUCCESS;
+}
+
 PyMethodDef KX_CharacterWrapper::Methods[] = {
 	KX_PYMETHODTABLE_NOARGS(KX_CharacterWrapper, jump),
 	{NULL,NULL} //Sentinel
diff --git a/source/gameengine/Ketsji/KX_CharacterWrapper.h b/source/gameengine/Ketsji/KX_CharacterWrapper.h
index f1c977f..d4d8f19 100644
--- a/source/gameengine/Ketsji/KX_CharacterWrapper.h
+++ b/source/gameengine/Ketsji/KX_CharacterWrapper.h
@@ -29,6 +29,8 @@ public:
 	static PyObject*	pyattr_get_max_jumps(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
 	static int			pyattr_set_max_jumps(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
 	static PyObject*	pyattr_get_jump_count(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+	static PyObject*	pyattr_get_walk_dir(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+	static int			pyattr_set_walk_dir(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
 #endif // WITH_PYTHON
 
 private:
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
index e71037d..903966b 100644
--- a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
+++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
@@ -145,7 +145,7 @@ void	KX_ConvertDynamoObject(KX_GameObject* gameobj,
 	struct	KX_ObjectProperties*	objprop);
 
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 
 void	KX_ConvertBulletObject(	class	KX_GameObject* gameobj,
 	class	RAS_MeshObject* meshobj,
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
index ff3c46c..4a5a170 100644
--- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
+++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
@@ -58,7 +58,7 @@ extern "C"{
 	#include "BKE_DerivedMesh.h"
 }
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "BulletSoftBody/btSoftBody.h"
 
 #include "CcdPhysicsEnvironment.h"
@@ -574,4 +574,4 @@ bool KX_ReInstanceBulletShapeFromMesh(KX_GameObject *gameobj, KX_GameObject *fro
 	spc->ReplaceControllerShape(bm);
 	return true;
 }
-#endif // USE_BULLET
+#endif // WITH_BULLET
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index eec4566..3a60ccc 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1400,6 +1400,14 @@ CListValue* KX_GameObject::GetChildrenRecursive()
 	return list;
 }
 
+KX_Scene* KX_GameObject::GetScene()
+{
+	SG_Node* node = this->GetSGNode();
+	KX_Scene* scene = static_cast<KX_Scene*>(node->GetSGClientInfo());
+
+	return scene;
+}
+
 /* ---------------------------------------------------------------------
  * Some stuff taken from the header
  * --------------------------------------------------------------------- */
@@ -1754,8 +1762,7 @@ PyObject *KX_GameObject::PyReplaceMesh(PyObject *args)
 
 PyObject *KX_GameObject::PyEndObject()
 {
-	SG_Node* node = this->GetSGNode();
-	KX_Scene* scene = static_cast<KX_Scene*>(node->GetSGClientInfo());
+	KX_Scene* scene = GetScene();
 	
 	scene->DelayedRemoveObject(this);
 	
@@ -1777,7 +1784,7 @@ PyObject *KX_GameObject::PyReinstancePhysicsMesh(PyObject *args)
 		) {
 		return NULL;
 	}
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	/* gameobj and mesh can be NULL */
 	if (KX_ReInstanceBulletShapeFromMesh(this, gameobj, mesh))
 		Py_RETURN_TRUE;
@@ -2003,8 +2010,7 @@ PyObject *KX_GameObject::pyattr_get_group_members(void *self_v, const KX_PYATTRI
 PyObject* KX_GameObject::pyattr_get_scene(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
 	KX_GameObject *self = static_cast<KX_GameObject*>(self_v);
-	SG_Node *node = self->GetSGNode();
-	KX_Scene *scene = static_cast<KX_Scene *>(node->GetSGClientInfo());
+	KX_Scene *scene = self->GetScene();
 	if (scene) {
 		return scene->GetProxy();
 	}
@@ -3056,7 +3062,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
 	if (dist != 0.0f)
 		toPoint = fromPoint + dist * (toPoint-fromPoint).safe_normalized();
 	
-	PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
+	PHY_IPhysicsEnvironment* pe = GetScene()->GetPhysicsEnvironment();
 	KX_IPhysicsController *spc = GetPhysicsController();
 	KX_GameObject *parent = GetParent();
 	if (!spc && parent)
@@ -3202,7 +3208,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
 		return none_tuple_3();
 	}
 	
-	PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
+	PHY_IPhysicsEnvironment* pe = GetScene()->GetPhysicsEnvironment();
 	KX_IPhysicsController *spc = GetPhysicsController();
 	KX_GameObject *parent = GetParent();
 	if (!spc && parent)
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index e71af67..86c712e 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -501,8 +501,8 @@ public:
 	void SetUserCollisionGroup(short filter);
 	void SetUserCollisionMask(short mask);
 	/**
-	* Extra broadphase check for user controllable collisions
-	*/
+	 * Extra broadphase check for user controllable collisions
+	 */
 	bool CheckCollision(KX_GameObject *other);
 
 	/**
@@ -923,6 +923,8 @@ public:
 	CListValue* GetChildren();
 	CListValue* GetChildrenRecursive();
 
+	KX_Scene*	GetScene();
+
 #ifdef WITH_PYTHON
 	/**
 	 * \section Python interface functions.
diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h
index 280b181..2019be5 100644
--- a/source/gameengine/Ketsji/KX_IPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_IPhysicsController.h
@@ -70,11 +70,14 @@ public:
 	virtual void	RelativeRotate(const MT_Matrix3x3& drot,bool local)=0;
 	virtual void	ApplyTorque(const MT_Vector3& torque,bool local)=0;
 	virtual void	ApplyForce(const MT_Vector3& force,bool local)=0;
+	virtual void	SetWalkDirection(const MT_Vector3& dir,bool local)=0;
 	virtual MT_Vector3 GetLinearVelocity()=0;
 	virtual MT_Vector3 GetAngularVelocity()=0;
 	virtual MT_Vector3 GetVelocity(const MT_Point3& pos)=0;
+	virtual MT_Vector3 GetWalkDirection()=0;
 	virtual void	SetAngularVelocity(const MT_Vector3& ang_vel,bool local)=0;
 	virtual void	SetLinearVelocity(const MT_Vector3& lin_vel,bool local)=0;
+	virtual void	Jump()=0;
 	virtual void	resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) = 0;
 
 	virtual	void	getOrientation(MT_Quaternion& orn)=0;
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index 87683f8..23419f1 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -1446,7 +1446,7 @@ void KX_KetsjiEngine::RenderDebugProperties()
 	int xcoord = 12;	// mmmm, these constants were taken from blender source
 	int ycoord = 17;	// to 'mimic' behavior
 	
-	int profile_indent = 64;
+	int profile_indent = 72;
 
 	float tottime = m_logger->GetAverage();
 	if (tottime < 1e-6f) {
@@ -1457,15 +1457,14 @@ void KX_KetsjiEngine::RenderDebugProperties()
 	RAS_Rect viewport;
 	m_canvas->SetViewPort(0, 0, int(m_canvas->GetWidth()), int(m_canvas->GetHeight()));
 	
-	if (m_show_framerate || m_show_profile)	{
+	if (m_show_framerate || m_show_profile) {
 		/* Title for profiling("Profile") */
-		debugtxt.Format("Profile");
 		m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
-									debugtxt.Ptr(),
-									xcoord + const_xindent + title_xmargin, // Adds the constant x indent (0 for now) to the title x margin
-									ycoord,
-									m_canvas->GetWidth() /* RdV, TODO ?? */,
-									m_canvas->GetHeight() /* RdV, TODO ?? */);
+		                            "Profile",
+		                            xcoord + const_xindent + title_xmargin, // Adds the constant x indent (0 for now) to the title x margin
+		                            ycoord,
+		                            m_canvas->GetWidth() /* RdV, TODO ?? */,
+		                            m_canvas->GetHeight() /* RdV, TODO ?? */);
 
 		// Increase the indent by default increase
 		ycoord += const_ysize;
@@ -1475,46 +1474,44 @@ void KX_KetsjiEngine::RenderDebugProperties()
 
 	/* Framerate display */
 	if (m_show_framerate) {
-		debugtxt.Format("Frametime :");
-		m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED, 
-									debugtxt.Ptr(),
-									xcoord + const_xindent,
-									ycoord, 
-									m_canvas->GetWidth() /* RdV, TODO ?? */,
-									m_canvas->GetHeight() /* RdV, TODO ?? */);
+		m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
+		                            "Frametime :",
+		                            xcoord + const_xindent,
+		                            ycoord,
+		                            m_canvas->GetWidth() /* RdV, TODO ?? */,
+		                            m_canvas->GetHeight() /* RdV, TODO ?? */);
 		
-		debugtxt.Format("%5.1fms (%5.1f fps)", tottime * 1000.f, 1.0/tottime);
-		m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED, 
-									debugtxt.Ptr(),
-									xcoord + const_xindent + profile_indent,
-									ycoord,
-									m_canvas->GetWidth() /* RdV, TODO ?? */,
-									m_canvas->GetHeight() /* RdV, TODO ?? */);
+		debugtxt.Format("%5.1fms (%.1ffps)", tottime * 1000.f, 1.0/tottime);
+		m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
+		                            debugtxt.ReadPtr(),
+		                            xcoord + const_xindent + profile_indent,
+		                            ycoord,
+		                            m_canvas->GetWidth() /* RdV, TODO ?? */,
+		                            m_canvas->GetHeight() /* RdV, TODO ?? */);
 		// Increase the indent by default increase
 		ycoord += const_ysize;
 	}
 
 	/* Profile display */
-	if (m_show_profile)
-	{
-		for (int j = tc_first; j < tc_numCategories; j++)
-		{
-			debugtxt.Format(m_profileLabels[j]);
+	if (m_show_profile) {
+		for (int j = tc_first; j < tc_numCategories; j++) {
 			m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
-			                            debugtxt.Ptr(),
+			                            m_profileLabels[j],
 			                            xcoord + const_xindent,
-										ycoord,
+			                            ycoord,
 			                            m_canvas->GetWidth(),
 			                            m_canvas->GetHeight());
 
 			double time = m_logger->GetAverage((KX_TimeCategory)j);
 
-			debugtxt.Format("%5.2fms (%2d%%)", time*1000.f, (int)(time/tottime * 100.f));
+			debugtxt.Format("%5.2fms | %d%%", time*1000.f, (int)(time/tottime * 100.f));
 			m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
-			                            debugtxt.Ptr(),
+			                            debugtxt.ReadPtr(),
 			                            xcoord + const_xindent + profile_indent, ycoord,
 			                            m_canvas->GetWidth(),
 			                            m_canvas->GetHeight());
+
+			m_rendertools->RenderBox2D(xcoord + (int)(2.2 * profile_indent), ycoord, m_canvas->GetWidth(), m_canvas->GetHeight(), time/tottime);
 			ycoord += const_ysize;
 		}
 	}
@@ -1522,17 +1519,15 @@ void KX_KetsjiEngine::RenderDebugProperties()
 	ycoord += title_y_top_margin;
 
 	/* Property display*/
-	if (m_show_debug_properties && m_propertiesPresent)
-	{
+	if (m_show_debug_properties && m_propertiesPresent) {
 
 		/* Title for debugging("Debug properties") */
-		debugtxt.Format("Debug Properties");
-		m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED, 
-									debugtxt.Ptr(),
-									xcoord + const_xindent + title_xmargin, // Adds the constant x indent (0 for now) to the title x margin
-									ycoord, 
-									m_canvas->GetWidth() /* RdV, TODO ?? */, 
-									m_canvas->GetHeight() /* RdV, TODO ?? */);
+		m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
+		                            "Debug Properties",
+		                            xcoord + const_xindent + title_xmargin, // Adds the constant x indent (0 for now) to the title x margin
+		                            ycoord,
+		                            m_canvas->GetWidth() /* RdV, TODO ?? */,
+		                            m_canvas->GetHeight() /* RdV, TODO ?? */);
 
 		// Increase the indent by default increase
 		ycoord += const_ysize;
@@ -1540,20 +1535,18 @@ void KX_KetsjiEngine::RenderDebugProperties()
 		ycoord += title_y_bottom_margin;
 
 		KX_SceneList::iterator sceneit;
-		for (sceneit = m_scenes.begin();sceneit != m_scenes.end() ; sceneit++)
-		{
+		for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); sceneit++) {
 			KX_Scene* scene = *sceneit;
 			/* the 'normal' debug props */
 			vector<SCA_DebugProp*>& debugproplist = scene->GetDebugProperties();
 			
 			for (vector<SCA_DebugProp*>::iterator it = debugproplist.begin();
-				 !(it==debugproplist.end());it++)
+			     !(it==debugproplist.end());it++)
 			{
-				CValue* propobj = (*it)->m_obj;
+				CValue *propobj = (*it)->m_obj;
 				STR_String objname = propobj->GetName();
 				STR_String propname = (*it)->m_name;
-				if (propname == "__state__")
-				{
+				if (propname == "__state__") {
 					// reserve name for object state
 					KX_GameObject* gameobj = static_cast<KX_GameObject*>(propobj);
 					unsigned int state = gameobj->GetState();
@@ -1571,27 +1564,25 @@ void KX_KetsjiEngine::RenderDebugProperties()
 							first = false;
 						}
 					}
-					m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED, 
-													debugtxt.Ptr(),
-													xcoord + const_xindent,
-													ycoord,
-													m_canvas->GetWidth(),
-													m_canvas->GetHeight());
+					m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
+					                            debugtxt.ReadPtr(),
+					                            xcoord + const_xindent,
+					                            ycoord,
+					                            m_canvas->GetWidth(),
+					                            m_canvas->GetHeight());
 					ycoord += const_ysize;
 				}
-				else
-				{
-					CValue* propval = propobj->GetProperty(propname);
-					if (propval)
-					{
+				else {
+					CValue *propval = propobj->GetProperty(propname);
+					if (propval) {
 						STR_String text = propval->GetText();
 						debugtxt = objname + ": '" + propname + "' = " + text;
-						m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED, 
-													debugtxt.Ptr(),
-													xcoord + const_xindent,
-													ycoord,
-													m_canvas->GetWidth(),
-													m_canvas->GetHeight());
+						m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
+						                            debugtxt.ReadPtr(),
+						                            xcoord + const_xindent,
+						                            ycoord,
+						                            m_canvas->GetWidth(),
+						                            m_canvas->GetHeight());
 						ycoord += const_ysize;
 					}
 				}
@@ -1627,19 +1618,14 @@ KX_Scene* KX_KetsjiEngine::FindScene(const STR_String& scenename)
 void KX_KetsjiEngine::ConvertAndAddScene(const STR_String& scenename,bool overlay)
 {
 	// only add scene when it doesn't exist!
-	if (FindScene(scenename))
-	{
-		STR_String tmpname = scenename;
-		printf("warning: scene %s already exists, not added!\n",tmpname.Ptr());
+	if (FindScene(scenename)) {
+		printf("warning: scene %s already exists, not added!\n",scenename.ReadPtr());
 	}
-	else
-	{
-		if (overlay)
-		{
+	else {
+		if (overlay) {
 			m_addingOverlayScenes.insert(scenename);
 		}
-		else
-		{
+		else {
 			m_addingBackgroundScenes.insert(scenename);
 		}
 	}
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp
index 5414a4d..a8f309c 100644
--- a/source/gameengine/Ketsji/KX_Light.cpp
+++ b/source/gameengine/Ketsji/KX_Light.cpp
@@ -246,6 +246,9 @@ void KX_LightObject::BindShadowBuffer(RAS_IRasterizer *ras, RAS_ICanvas *canvas,
 	lamp = GetGPULamp();
 	GPU_lamp_shadow_buffer_bind(lamp, viewmat, &winsize, winmat);
 
+	if (GPU_lamp_shadow_buffer_type(lamp) == LA_SHADMAP_VARIANCE)
+		ras->SetUsingOverrideShader(true);
+
 	/* GPU_lamp_shadow_buffer_bind() changes the viewport, so update the canvas */
 	canvas->UpdateViewPort(0, 0, winsize, winsize);
 
@@ -276,6 +279,9 @@ void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras)
 {
 	GPULamp *lamp = GetGPULamp();
 	GPU_lamp_shadow_buffer_unbind(lamp);
+
+	if (GPU_lamp_shadow_buffer_type(lamp) == LA_SHADMAP_VARIANCE)
+		ras->SetUsingOverrideShader(false);
 }
 
 struct Image *KX_LightObject::GetTextureImage(short texslot)
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
index 931039b..9355ad0 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
@@ -81,6 +81,16 @@ KX_ObjectActuator(
 
 		m_pid = m_torque;
 	}
+	if (m_bitLocalFlag.CharacterMotion)
+	{
+		KX_GameObject *parent = static_cast<KX_GameObject *>(GetParent());
+
+		if (!parent->GetPhysicsController() || !parent->GetPhysicsController()->IsCharacter())
+		{
+			printf("Character motion enabled on non-character object (%s), falling back to simple motion.\n", parent->GetName().Ptr());
+			m_bitLocalFlag.CharacterMotion = false;
+		}
+	}
 	if (m_reference)
 		m_reference->RegisterActuator(this);
 	UpdateFuzzyFlags();
@@ -116,10 +126,10 @@ bool KX_ObjectActuator::Update()
 			m_active_combined_velocity = false;
 		}
 
-		// Explicitly stop the movement if we're using a character (apply movement is a little different for characters)
-		if (parent->GetPhysicsController() && parent->GetPhysicsController()->IsCharacter()) {
+		// Explicitly stop the movement if we're using character motion
+		if (m_bitLocalFlag.CharacterMotion) {
 			MT_Vector3 vec(0.0, 0.0, 0.0);
-			parent->ApplyMovement(vec, true);
+			parent->GetPhysicsController()->SetWalkDirection(vec, true);
 		}
 
 		m_linear_damping_active = false;
@@ -205,8 +215,31 @@ bool KX_ObjectActuator::Update()
 			m_previous_error = e;
 			m_error_accumulator = I;
 			parent->ApplyForce(m_force,(m_bitLocalFlag.LinearVelocity) != 0);
-		} else
+		} else if(m_bitLocalFlag.CharacterMotion)
 		{
+			MT_Vector3 dir = m_dloc;
+
+			if (m_bitLocalFlag.AddOrSetCharLoc) {
+				MT_Vector3 old_dir = parent->GetPhysicsController()->GetWalkDirection();
+				MT_Scalar mag = old_dir.length();
+				if (mag < MT_EPSILON)
+					mag = dir.length();
+				dir = (dir + old_dir).normalized() * mag;
+			}
+
+			// We always want to set the walk direction since a walk direction of (0, 0, 0) should stop the character
+			parent->GetPhysicsController()->SetWalkDirection(dir, (m_bitLocalFlag.DLoc) != 0);
+
+			if (!m_bitLocalFlag.ZeroDRot)
+			{
+				parent->ApplyRotation(m_drot,(m_bitLocalFlag.DRot) != 0);
+			}
+			if (m_bitLocalFlag.CharacterJump)
+			{
+				parent->GetPhysicsController()->Jump();
+			}
+		}
+		else {
 			if (!m_bitLocalFlag.ZeroForce)
 			{
 				parent->ApplyForce(m_force,(m_bitLocalFlag.Force) != 0);
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h
index b0efee5..1f2453e 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.h
@@ -54,7 +54,12 @@ struct KX_LocalFlags {
 		LinearVelocity(false),
 		AngularVelocity(false),
 		AddOrSetLinV(false),
+		AddOrSetCharLoc(false),
+		ServoControl(false),
+		CharacterMotion(false),
+		CharacterJump(false),
 		ZeroForce(false),
+		ZeroTorque(false),
 		ZeroDRot(false),
 		ZeroDLoc(false),
 		ZeroLinearVelocity(false),
@@ -69,7 +74,10 @@ struct KX_LocalFlags {
 	bool LinearVelocity;
 	bool AngularVelocity;
 	bool AddOrSetLinV;
+	bool AddOrSetCharLoc;
 	bool ServoControl;
+	bool CharacterMotion;
+	bool CharacterJump;
 	bool ZeroForce;
 	bool ZeroTorque;
 	bool ZeroDRot;
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index 9bb09d5..2e9b988 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -43,7 +43,7 @@
 
 #include "PyObjectPlus.h" 
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #  include "LinearMath/btIDebugDraw.h"
 #endif
 
@@ -716,7 +716,7 @@ PyObject *initPythonConstraintBinding()
 	PyDict_SetItemString(d, "error", ErrorObject);
 	Py_DECREF(ErrorObject);
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	//Debug Modes constants to be used with setDebugMode() python function
 	KX_MACRO_addTypesToDict(d, DBG_NODEBUG, btIDebugDraw::DBG_NoDebug);
 	KX_MACRO_addTypesToDict(d, DBG_DRAWWIREFRAME, btIDebugDraw::DBG_DrawWireframe);
@@ -732,7 +732,7 @@ PyObject *initPythonConstraintBinding()
 	KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTS, btIDebugDraw::DBG_DrawConstraints);
 	KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTLIMITS, btIDebugDraw::DBG_DrawConstraintLimits);
 	KX_MACRO_addTypesToDict(d, DBG_FASTWIREFRAME, btIDebugDraw::DBG_FastWireframe);
-#endif // USE_BULLET
+#endif // WITH_BULLET
 
 	//Constraint types to be used with createConstraint() python function
 	KX_MACRO_addTypesToDict(d, POINTTOPOINT_CONSTRAINT, PHY_POINT2POINT_CONSTRAINT);
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 55c9ff5..bb2f9a8 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -88,7 +88,7 @@
 #include "BL_DeformableGameObject.h"
 #include "KX_ObstacleSimulation.h"
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "KX_SoftBodyDeformer.h"
 #include "KX_ConvertPhysicsObject.h"
 #include "CcdPhysicsEnvironment.h"
@@ -1131,7 +1131,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
 				blendobj->parent &&							// original object had armature (not sure this test is needed)
 				blendobj->parent->type == OB_ARMATURE &&
 				blendmesh->dvert!=NULL;						// mesh has vertex group
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 			bool bHasSoftBody = (!parentobj && (blendobj->gameflag & OB_SOFT_BODY));
 #endif
 			bool releaseParent = true;
@@ -1222,7 +1222,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
 				);
 				newobj->SetDeformer(meshdeformer);
 			}
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 			else if (bHasSoftBody)
 			{
 				KX_SoftBodyDeformer *softdeformer = new KX_SoftBodyDeformer(mesh, newobj);
@@ -1239,7 +1239,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
 	gameobj->AddMeshUser();
 	}
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	if (use_phys) { /* update the new assigned mesh with the physics mesh */
 		KX_ReInstanceBulletShapeFromMesh(gameobj, NULL, use_gfx?NULL:mesh);
 	}
@@ -1756,7 +1756,7 @@ short KX_Scene::GetAnimationFPS()
 	return m_blenderScene->r.frs_sec;
 }
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "KX_BulletPhysicsController.h"
 #endif
 
@@ -1768,7 +1768,7 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to)
 	brick->Replace_NetworkScene(to->GetNetworkScene());
 
 	/* near sensors have physics controllers */
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	KX_TouchSensor *touch_sensor = dynamic_cast<class KX_TouchSensor *>(brick);
 	if (touch_sensor) {
 		touch_sensor->GetPhysicsController()->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
@@ -1789,7 +1789,7 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to)
 	}
 }
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 #include "CcdGraphicController.h" // XXX  ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
 #include "CcdPhysicsEnvironment.h" // XXX  ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
 #include "KX_BulletPhysicsController.h"
@@ -1858,7 +1858,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene
 			for (int i=0; i<children.size(); i++)
 					children[i]->SetSGClientInfo(to);
 		}
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 		SGControllerList::iterator contit;
 		SGControllerList& controllers = sg->GetSGControllerList();
 		for (contit = controllers.begin();contit!=controllers.end();++contit)
@@ -1867,7 +1867,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene
 			if (phys_ctrl)
 				phys_ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
 		}
-#endif // USE_BULLET
+#endif // WITH_BULLET
 	}
 	/* If the object is a light, update it's scene */
 	if (gameobj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT)
@@ -1886,7 +1886,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene
 
 bool KX_Scene::MergeScene(KX_Scene *other)
 {
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	CcdPhysicsEnvironment *env=			dynamic_cast<CcdPhysicsEnvironment *>(this->GetPhysicsEnvironment());
 	CcdPhysicsEnvironment *env_other=	dynamic_cast<CcdPhysicsEnvironment *>(other->GetPhysicsEnvironment());
 
@@ -1896,7 +1896,7 @@ bool KX_Scene::MergeScene(KX_Scene *other)
 		printf("\tsource %d, terget %d\n", (int)(env!=NULL), (int)(env_other!=NULL));
 		return false;
 	}
-#endif // USE_BULLET
+#endif // WITH_BULLET
 
 	if (GetSceneConverter() != other->GetSceneConverter()) {
 		printf("KX_Scene::MergeScene: converters differ, aborting\n");
@@ -1939,7 +1939,7 @@ bool KX_Scene::MergeScene(KX_Scene *other)
 	GetLightList()->MergeList(other->GetLightList());
 	other->GetLightList()->ReleaseAndRemoveAll();
 
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
 	if (env) /* bullet scene? - dummy scenes don't need touching */
 		env->MergeEnvironment(env_other);
 #endif
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 2a4f2b3..5438ae5 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -132,10 +132,13 @@ void KX_SoundActuator::play()
 		handle3d->setConeVolumeOuter(m_3d.cone_outer_gain);
 	}
 
-	if (loop)
-		m_handle->setLoopCount(-1);
-	m_handle->setPitch(m_pitch);
-	m_handle->setVolume(m_volume);
+	if (m_handle.get()) {
+		if (loop)
+			m_handle->setLoopCount(-1);
+		m_handle->setPitch(m_pitch);
+		m_handle->setVolume(m_volume);
+	}
+
 	m_isplaying = true;
 }
 
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
index 1597948..44a6e2f 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
@@ -294,7 +294,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame)
 			{
 				// (1.0 , 0.0 , 0.0 ) x direction is forward, z (0.0 , 0.0 , 1.0 ) up
 				left  = dir.safe_normalized();
-				dir = (left.cross(up)).safe_normalized();
+				dir = up.cross(left).safe_normalized();
 				mat.setValue (
 					left[0], dir[0],up[0], 
 					left[1], dir[1],up[1],
@@ -334,7 +334,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame)
 			{
 				// (1.0 , 0.0 , 0.0 ) x direction is forward, z (0.0 , 0.0 , 1.0 ) up
 				left  = -dir.safe_normalized();
-				dir = -(left.cross(up)).safe_normalized();
+				dir = up.cross(left).safe_normalized();
 				mat.setValue (
 					left[0], dir[0],up[0], 
 					left[1], dir[1],up[1],
@@ -373,7 +373,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame)
 			{
 				// (1.0 , 0.0 , 0.0 ) -x direction is forward, z (0.0 , 0.0 , 1.0 ) up
 				left  = -dir.safe_normalized();
-				dir = -(left.cross(up)).safe_normalized();
+				dir = up.cross(left).safe_normalized();
 				mat.setValue (
 					left[0], dir[0],up[0], 
 					left[1], dir[1],up[1],
diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript
index da1a72b..0690bdd 100644
--- a/source/gameengine/Ketsji/SConscript
+++ b/source/gameengine/Ketsji/SConscript
@@ -71,7 +71,7 @@ if env['WITH_BF_CXX_GUARDEDALLOC']:
     defs.append('WITH_CXX_GUARDEDALLOC')
 
 if env['WITH_BF_BULLET']:
-    defs.append('USE_BULLET')
+    defs.append('WITH_BULLET')
     incs += ' #source/gameengine/Physics/Bullet'
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
diff --git a/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h
index 7581486..8bbb1e9 100644
--- a/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h
+++ b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h
@@ -45,8 +45,8 @@ public:
 	virtual ~NG_LoopBackNetworkDeviceInterface();
 
 	/**
-	  * Clear message buffer
-	  */
+	 * Clear message buffer
+	 */
 	virtual void NextFrame();
 
 	bool Connect(char *address, unsigned int port, char *password,
diff --git a/source/gameengine/Network/NG_NetworkDeviceInterface.h b/source/gameengine/Network/NG_NetworkDeviceInterface.h
index 6da478e..7fcf799 100644
--- a/source/gameengine/Network/NG_NetworkDeviceInterface.h
+++ b/source/gameengine/Network/NG_NetworkDeviceInterface.h
@@ -49,16 +49,16 @@ public:
 	virtual void NextFrame()=0;
 
 	/**
-	  * Mark network connection online
-	  */
+	 * Mark network connection online
+	 */
 	void Online(void) { m_online = true; }
 	/**
-	  * Mark network connection offline
-	  */
+	 * Mark network connection offline
+	 */
 	void Offline(void) { m_online = false; }
 	/**
-	  * Is the network connection established ?
-	  */
+	 * Is the network connection established ?
+	 */
 	bool IsOnline(void) { return m_online; }
 
 	virtual bool Connect(char *address, unsigned int port, char *password,
@@ -67,9 +67,9 @@ public:
 
 	virtual void SendNetworkMessage(NG_NetworkMessage* msg)=0;
 	/**
-	  * read NG_NetworkMessage from library buffer, may be
-	  * irrelevant for loopbackdevices
-	  */
+	 * read NG_NetworkMessage from library buffer, may be
+	 * irrelevant for loopbackdevices
+	 */
 	
 	virtual std::vector<NG_NetworkMessage*> RetrieveNetworkMessages()=0;
 	
diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h
index 5185849..6ed2665 100644
--- a/source/gameengine/Network/NG_NetworkMessage.h
+++ b/source/gameengine/Network/NG_NetworkMessage.h
@@ -123,8 +123,8 @@ public:
 	}
 
 	/**
-	  * get the unique Network Message ID
-	  */
+	 * get the unique Network Message ID
+	 */
 	int GetMessageID() {
 		return m_uniqueMessageID;
 	}
diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt
index afb166e..c5b6013 100644
--- a/source/gameengine/Physics/Bullet/CMakeLists.txt
+++ b/source/gameengine/Physics/Bullet/CMakeLists.txt
@@ -62,7 +62,7 @@ if(WITH_BULLET)
 	list(APPEND INC
 		${BULLET_INCLUDE_DIRS}
 	)
-	add_definitions(-DUSE_BULLET)
+	add_definitions(-DWITH_BULLET)
 endif()
 
 blender_add_lib(ge_phys_bullet "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index cf96f22..0de21e3 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -78,6 +78,9 @@ BlenderBulletCharacterController::BlenderBulletCharacterController(btMotionState
 
 void BlenderBulletCharacterController::updateAction(btCollisionWorld *collisionWorld, btScalar dt)
 {
+	if (onGround())
+		m_jumps = 0;
+
 	btKinematicCharacterController::updateAction(collisionWorld,dt);
 	m_motionState->setWorldTransform(getGhostObject()->getWorldTransform());
 }
@@ -104,9 +107,6 @@ bool BlenderBulletCharacterController::canJump() const
 
 void BlenderBulletCharacterController::jump()
 {
-	if (onGround())
-		m_jumps = 0;
-
 	if (!canJump())
 		return;
 		
@@ -115,6 +115,11 @@ void BlenderBulletCharacterController::jump()
 	m_jumps++;
 }
 
+const btVector3& BlenderBulletCharacterController::getWalkDirection()
+{
+	return m_walkDirection;
+}
+
 CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci)
 :m_cci(ci)
 {
@@ -670,9 +675,9 @@ CcdPhysicsController::~CcdPhysicsController()
 }
 
 
-		/**
-			SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
-		*/
+/**
+ * SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
+ */
 bool		CcdPhysicsController::SynchronizeMotionStates(float time)
 {
 	//sync non-static to motionstate, and static from motionstate (todo: add kinematic etc.)
@@ -755,8 +760,8 @@ bool		CcdPhysicsController::SynchronizeMotionStates(float time)
 }
 
 		/**
-			WriteMotionStateToDynamics synchronizes dynas, kinematic and deformable entities (and do 'late binding')
-		*/
+		 * WriteMotionStateToDynamics synchronizes dynas, kinematic and deformable entities (and do 'late binding')
+		 */
 		
 void		CcdPhysicsController::WriteMotionStateToDynamics(bool nondynaonly)
 {
@@ -926,20 +931,27 @@ void		CcdPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dloc
 		if (local)
 			dloc = xform.getBasis()*dloc;
 
-		if (m_characterController)
-		{
-			m_characterController->setWalkDirection(dloc/GetPhysicsEnvironment()->getNumTimeSubSteps());
-		}
-		else
-		{
-
-			xform.setOrigin(xform.getOrigin() + dloc);
-			SetCenterOfMassTransform(xform);
-		}
+		xform.setOrigin(xform.getOrigin() + dloc);
+		SetCenterOfMassTransform(xform);
 	}
 
 }
 
+void		CcdPhysicsController::SetWalkDirection(float dirX,float dirY,float dirZ,bool local)
+{
+
+	if (m_object && m_characterController)
+	{
+		btVector3 dir(dirX,dirY,dirZ);
+		btTransform xform = m_object->getWorldTransform();
+
+		if (local)
+			dir = xform.getBasis()*dir;
+
+		m_characterController->setWalkDirection(dir/GetPhysicsEnvironment()->getNumTimeSubSteps());
+	}
+}
+
 void		CcdPhysicsController::RelativeRotate(const float rotval[9],bool local)
 {
 	if (m_object)
@@ -1267,6 +1279,13 @@ void		CcdPhysicsController::applyImpulse(float attachX,float attachY,float attac
 	}
 
 }
+
+void		CcdPhysicsController::Jump()
+{
+	if (m_object && m_characterController)
+		m_characterController->jump();
+}
+
 void		CcdPhysicsController::SetActive(bool active)
 {
 }
@@ -1323,6 +1342,24 @@ void		CcdPhysicsController::GetVelocity(const float posX,const float posY,const
 		linvZ = 0.f;
 	}
 }
+
+void		CcdPhysicsController::GetWalkDirection(float& dirX,float& dirY,float& dirZ)
+{
+	if (m_object && m_characterController)
+	{
+		const btVector3 dir = m_characterController->getWalkDirection();
+		dirX = dir.x();
+		dirY = dir.y();
+		dirZ = dir.z();
+	}
+	else
+	{
+		dirX = 0.f;
+		dirY = 0.f;
+		dirZ = 0.f;
+	}
+}
+
 void		CcdPhysicsController::getReactionForce(float& forceX,float& forceY,float& forceZ)
 {
 }
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
index b151c2f..b271b9c 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
@@ -417,6 +417,8 @@ public:
 	virtual bool canJump() const;
 
 	virtual void jump();
+
+	const btVector3& getWalkDirection();
 };
 
 ///CcdPhysicsController is a physics object that supports continuous collision detection and time of impact based physics resolution.
@@ -424,7 +426,7 @@ class CcdPhysicsController : public PHY_IPhysicsController
 {
 protected:
 	btCollisionObject* m_object;
-	btKinematicCharacterController* m_characterController;
+	BlenderBulletCharacterController* m_characterController;
 	
 
 	class PHY_IMotionState*		m_MotionState;
@@ -501,12 +503,12 @@ protected:
 
 
 		/**
-			SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
-		*/
+		 * SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
+		 */
 		virtual bool		SynchronizeMotionStates(float time);
 		/**
-			WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
-		*/
+		 * WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
+		 */
 		
 		virtual void		WriteMotionStateToDynamics(bool nondynaonly);
 		virtual	void		WriteDynamicsToMotionState();
@@ -517,6 +519,7 @@ protected:
 
 		// kinematic methods
 		virtual void		RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local);
+		virtual void		SetWalkDirection(float dirX,float dirY,float dirZ,bool local);
 		virtual void		RelativeRotate(const float drot[9],bool local);
 		virtual	void		getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal);
 		virtual	void		setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal);
@@ -531,6 +534,7 @@ protected:
 		virtual void		SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local);
 		virtual void		SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local);
 		virtual void		applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ);
+		virtual void		Jump();
 		virtual void		SetActive(bool active);
 
 		// reading out information from physics
@@ -538,6 +542,7 @@ protected:
 		virtual void		GetAngularVelocity(float& angVelX,float& angVelY,float& angVelZ);
 		virtual void		GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ); 
 		virtual	void		getReactionForce(float& forceX,float& forceY,float& forceZ);
+		virtual void		GetWalkDirection(float& dirX,float& dirY,float& dirZ);
 
 		// dyna's that are rigidbody are free in orientation, dyna's with non-rigidbody are restricted 
 		virtual	void		setRigidBody(bool rigid);
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index cadba97..254624c 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -310,6 +310,22 @@ public:
 	{
 		return m_controller->getJumpCount();
 	}
+
+	virtual void SetWalkDirection(PHY__Vector3 dir)
+	{
+		btVector3 vec = btVector3(dir[0], dir[1], dir[2]);
+		m_controller->setWalkDirection(vec);
+	}
+
+	virtual PHY__Vector3 GetWalkDirection()
+	{
+		btVector3 vec = m_controller->getWalkDirection();
+		PHY__Vector3 retval;
+		retval[0] = vec[0];
+		retval[1] = vec[1];
+		retval[2] = vec[2];
+		return retval;
+	}
 };
 
 class CcdOverlapFilterCallBack : public btOverlapFilterCallback
diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript
index 83239cf..6ef2750 100644
--- a/source/gameengine/Physics/Bullet/SConscript
+++ b/source/gameengine/Physics/Bullet/SConscript
@@ -56,6 +56,6 @@ if env['WITH_BF_CXX_GUARDEDALLOC']:
     defs.append('WITH_CXX_GUARDEDALLOC')
 
 if env['WITH_BF_BULLET']:
-    defs.append('USE_BULLET')
+    defs.append('WITH_BULLET')
 
 env.BlenderLib ( 'ge_phys_bullet', Split(sources), Split(incs), defs, libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Physics/common/PHY_ICharacter.h b/source/gameengine/Physics/common/PHY_ICharacter.h
index 63f6c0b..8a59945 100644
--- a/source/gameengine/Physics/common/PHY_ICharacter.h
+++ b/source/gameengine/Physics/common/PHY_ICharacter.h
@@ -15,6 +15,7 @@
 class PHY_ICharacter
 {
 public:	
+	virtual ~PHY_ICharacter(){};
 
 	virtual void Jump()= 0;
 	virtual bool OnGround()= 0;
@@ -27,6 +28,9 @@ public:
 
 	virtual int GetJumpCount()= 0;
 
+	virtual void SetWalkDirection(PHY__Vector3 dir)=0;
+	virtual PHY__Vector3 GetWalkDirection()=0;
+
 #ifdef WITH_CXX_GUARDEDALLOC
 	MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_ICharacter")
 #endif
diff --git a/source/gameengine/Physics/common/PHY_IController.h b/source/gameengine/Physics/common/PHY_IController.h
index 003c4ed..77864b7 100644
--- a/source/gameengine/Physics/common/PHY_IController.h
+++ b/source/gameengine/Physics/common/PHY_IController.h
@@ -41,10 +41,10 @@ class PHY_IPhysicsEnvironment;
 #endif
 
 /**
-	PHY_IController is the abstract simplified Interface to objects 
-	controlled by the physics engine. This includes the physics objects
-	and the graphics object for view frustrum and occlusion culling.
-*/
+ * PHY_IController is the abstract simplified Interface to objects
+ * controlled by the physics engine. This includes the physics objects
+ * and the graphics object for view frustrum and occlusion culling.
+ */
 class PHY_IController
 {
 	public:
diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h
index cb13eda..fb36481 100644
--- a/source/gameengine/Physics/common/PHY_IGraphicController.h
+++ b/source/gameengine/Physics/common/PHY_IGraphicController.h
@@ -36,16 +36,16 @@
 
 
 /**
-	PHY_IPhysicsController is the abstract simplified Interface to a physical object.
-	It contains the IMotionState and IDeformableMesh Interfaces.
-*/
+ * PHY_IPhysicsController is the abstract simplified Interface to a physical object.
+ * It contains the IMotionState and IDeformableMesh Interfaces.
+ */
 class PHY_IGraphicController : public PHY_IController
 {
 	public:
 		virtual ~PHY_IGraphicController();
 		/**
-			SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
-		*/
+		 * SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
+		 */
 		virtual bool SetGraphicTransform()=0;
 		virtual void Activate(bool active=true)=0;
 		virtual void setLocalAabb(const PHY__Vector3& aabbMin,const PHY__Vector3& aabbMax)=0;
diff --git a/source/gameengine/Physics/common/PHY_IMotionState.h b/source/gameengine/Physics/common/PHY_IMotionState.h
index ccf7cf7..61ed873 100644
--- a/source/gameengine/Physics/common/PHY_IMotionState.h
+++ b/source/gameengine/Physics/common/PHY_IMotionState.h
@@ -37,9 +37,9 @@
 #endif
 
 /**
-	PHY_IMotionState is the Interface to explicitly synchronize the world transformation.
-	Default implementations for mayor graphics libraries like OpenGL and DirectX can be provided.
-*/
+ * PHY_IMotionState is the Interface to explicitly synchronize the world transformation.
+ * Default implementations for mayor graphics libraries like OpenGL and DirectX can be provided.
+ */
 class	PHY_IMotionState
 
 {
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h
index bc7671a..871edee 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsController.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h
@@ -38,21 +38,21 @@ class PHY_IMotionState;
 class PHY_IPhysicsEnvironment;
 
 /**
-	PHY_IPhysicsController is the abstract simplified Interface to a physical object.
-	It contains the IMotionState and IDeformableMesh Interfaces.
-*/
+ * PHY_IPhysicsController is the abstract simplified Interface to a physical object.
+ * It contains the IMotionState and IDeformableMesh Interfaces.
+ */
 class PHY_IPhysicsController : public PHY_IController
 {
 
 	public:
 		virtual ~PHY_IPhysicsController();
 		/**
-			SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
-		*/
+		 * SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
+		 */
 		virtual bool		SynchronizeMotionStates(float time)=0;
 		/**
-			WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
-		*/
+		 * WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
+		 */
 		
 		virtual void		WriteMotionStateToDynamics(bool nondynaonly)=0;
 		virtual	void		WriteDynamicsToMotionState()=0;
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp
index 142318c..110ffc7 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp
@@ -33,9 +33,10 @@
 #include "PHY_IPhysicsEnvironment.h"
 
 /**
-*	Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.)
-*	A derived class may be able to 'construct' entities by loading and/or converting
-*/
+ * Physics Environment takes care of stepping the simulation and is a container for physics entities
+ * (rigidbodies,constraints, materials etc.)
+ * A derived class may be able to 'construct' entities by loading and/or converting
+ */
 
 
 
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
index bfbe570..6a76745 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
@@ -96,9 +96,10 @@ public:
 };
 
 /**
-*	Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.)
-*	A derived class may be able to 'construct' entities by loading and/or converting
-*/
+ * Physics Environment takes care of stepping the simulation and is a container for physics entities
+ * (rigidbodies,constraints, materials etc.)
+ * A derived class may be able to 'construct' entities by loading and/or converting
+ */
 class PHY_IPhysicsEnvironment
 {
 	public:
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index df72056..b2b766b 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -148,7 +148,8 @@ void RAS_BucketManager::RenderAlphaBuckets(
 	// Having depth masks disabled/enabled gives different artifacts in
 	// case no sorting is done or is done inexact. For compatibility, we
 	// disable it.
-	rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_DISABLED);
+	if (rasty->GetDrawingMode() != RAS_IRasterizer::KX_SHADOW)
+		rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_DISABLED);
 
 	OrderBuckets(cameratrans, m_AlphaBuckets, slots, true);
 	
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
index b267879..7aeeb36 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
@@ -177,8 +177,8 @@ public:
 	virtual void		Replace_IScene(SCA_IScene *val) {} /* overridden by KX_BlenderMaterial */
 
 	/**
-	* \return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode).
-	*/
+	 * \return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode).
+	 */
 	int					ConvertFaceMode(struct GameSettings *game, bool image) const;
 
 	/*
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 5a72085..99026fa 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -417,6 +417,8 @@ public:
 	virtual void	SetAnisotropicFiltering(short level)=0;
 	virtual short	GetAnisotropicFiltering()=0;
 
+	virtual void	SetUsingOverrideShader(bool val)=0;
+	virtual bool	GetUsingOverrideShader()=0;
 
 #ifdef WITH_CXX_GUARDEDALLOC
 	MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_IRasterizer")
diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h
index bccda63..6131abc 100644
--- a/source/gameengine/Rasterizer/RAS_IRenderTools.h
+++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h
@@ -100,6 +100,22 @@ public:
 		double* oglmatrix,
 		int drawingmode
 	)=0;
+	
+	/**
+	 * Renders 2D boxes.
+	 * \param xco			Position on the screen (origin in lower left corner).
+	 * \param yco			Position on the screen (origin in lower left corner).
+	 * \param width			Width of the canvas to draw to.
+	 * \param height		Height of the canvas to draw to.
+	 * \param percentage	Percentage of bar.
+	 */
+	virtual
+		void
+		RenderBox2D(int xco,
+					int yco,
+					int width,
+					int height,
+					float percentage) = 0;
 
 	/**
 	 * Renders 3D text string using BFL.
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index a9609a2..8c46618 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -93,6 +93,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas, int storage)
 	m_noOfScanlines(32),
 	m_motionblur(0),
 	m_motionblurvalue(-1.0),
+	m_usingoverrideshader(false),
 	m_texco_num(0),
 	m_attrib_num(0),
 	//m_last_alphablend(GPU_BLEND_SOLID),
@@ -1057,3 +1058,14 @@ short RAS_OpenGLRasterizer::GetAnisotropicFiltering()
 {
 	return (short)GPU_get_anisotropic();
 }
+
+void RAS_OpenGLRasterizer::SetUsingOverrideShader(bool val)
+{
+	m_usingoverrideshader = val;
+}
+
+bool RAS_OpenGLRasterizer::GetUsingOverrideShader()
+{
+	return m_usingoverrideshader;
+}
+
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index c156ee5..64c0735 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -103,6 +103,8 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer
 	int	m_motionblur;
 	float	m_motionblurvalue;
 
+	bool m_usingoverrideshader;
+
 protected:
 	int				m_drawingmode;
 	TexCoGen		m_texco[RAS_MAX_TEXCO];
@@ -115,8 +117,9 @@ protected:
 	/** Stores the caching information for the last material activated. */
 	RAS_IPolyMaterial::TCachingInfo m_materialCachingInfo;
 
-	/** Making use of a Strategy desing pattern for storage behavior.
-	    Examples of concrete strategies: Vertex Arrays, VBOs, Immediate Mode*/
+	/**
+	 * Making use of a Strategy desing pattern for storage behavior.
+	 * Examples of concrete strategies: Vertex Arrays, VBOs, Immediate Mode*/
 	int				m_storage_type;
 	RAS_IStorage*	m_storage;
 	RAS_IStorage*	m_failsafe_storage; //So derived mesh can use immediate mode
@@ -320,6 +323,8 @@ public:
 	virtual void	SetAnisotropicFiltering(short level);
 	virtual short	GetAnisotropicFiltering();
 
+	virtual void	SetUsingOverrideShader(bool val);
+	virtual bool	GetUsingOverrideShader();
 
 #ifdef WITH_CXX_GUARDEDALLOC
 	MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_OpenGLRasterizer")
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
index 490c26a..7bcc8dc 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
@@ -74,7 +74,7 @@ void RAS_StorageIM::TexCoord(const RAS_TexVert &tv)
 
 	if (GLEW_ARB_multitexture) {
 		for (unit = 0; unit < *m_texco_num; unit++) {
-			switch(m_texco[unit]) {
+			switch (m_texco[unit]) {
 				case RAS_IRasterizer::RAS_TEXCO_ORCO:
 				case RAS_IRasterizer::RAS_TEXCO_GLOB:
 					glMultiTexCoord3fvARB(GL_TEXTURE0_ARB + unit, tv.getXYZ());
@@ -97,7 +97,7 @@ void RAS_StorageIM::TexCoord(const RAS_TexVert &tv)
 	if (GLEW_ARB_vertex_program) {
 		int uv = 0;
 		for (unit = 0; unit < *m_attrib_num; unit++) {
-			switch(m_attrib[unit]) {
+			switch (m_attrib[unit]) {
 				case RAS_IRasterizer::RAS_TEXCO_ORCO:
 				case RAS_IRasterizer::RAS_TEXCO_GLOB:
 					glVertexAttrib3fvARB(unit, tv.getXYZ());
diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h
index 6e31499..ce45b42 100644
--- a/source/gameengine/SceneGraph/SG_ParentRelation.h
+++ b/source/gameengine/SceneGraph/SG_ParentRelation.h
@@ -29,7 +29,7 @@
 /** \file SG_ParentRelation.h
  *  \ingroup bgesg
  * \page SG_ParentRelationPage SG_ParentRelation   
-
+ *
  * \section SG_ParentRelationSection SG_ParentRelation
  * 
  * This is an abstract interface class to the Scene Graph library. 
@@ -48,7 +48,7 @@
  * should not be value types and should be allocated on the heap.
  *
  */
- 
+
 #ifndef __SG_PARENTRELATION_H__
 #define __SG_PARENTRELATION_H__
 
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index 10eef9e..93a1d09 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -1022,7 +1022,7 @@ AVFrame *VideoFFmpeg::grabFrame(long position)
 				AVFrame * input = m_frame;
 
 				/* This means the data wasnt read properly, 
-				this check stops crashing */
+				 * this check stops crashing */
 				if (   input->data[0]==0 && input->data[1]==0 
 					&& input->data[2]==0 && input->data[3]==0)
 				{
diff --git a/source/tests/batch_import.py b/source/tests/batch_import.py
index 177ab8e..a2c5fb5 100644
--- a/source/tests/batch_import.py
+++ b/source/tests/batch_import.py
@@ -112,7 +112,7 @@ def batch_import(operator="",
     for i, f in enumerate(files):
         print("    %s(filepath=%r) # %d of %d" % (operator, f, i + start, len(files)))
 
-        # hack so loading the new file doesnt undo our loaded addons
+        # hack so loading the new file doesn't undo our loaded addons
         addon_utils.reset_all = lambda: None  # XXX, hack
 
         bpy.ops.wm.read_factory_settings()
@@ -134,8 +134,7 @@ def batch_import(operator="",
             print("\tSaving: %r" % fout_blend)
 
             fout_dir = os.path.dirname(fout_blend)
-            if not os.path.exists(fout_dir):
-                os.makedirs(fout_dir)
+            os.makedirs(fout_dir, exist_ok=True)
 
             bpy.ops.wm.save_as_mainfile(filepath=fout_blend)
 
diff --git a/source/tests/bl_load_addons.py b/source/tests/bl_load_addons.py
index fab2e2e..83bdfb4 100644
--- a/source/tests/bl_load_addons.py
+++ b/source/tests/bl_load_addons.py
@@ -26,6 +26,7 @@ import addon_utils
 import sys
 import imp
 
+
 def disable_addons():
     # first disable all
     addons = bpy.context.user_preferences.addons
@@ -86,7 +87,7 @@ def reload_addons(do_reload=True, do_reverse=True):
                 imp.reload(sys.modules[mod_name])
 
             if do_reverse:
-                # in case order matters when it shouldnt
+                # in case order matters when it shouldn't
                 modules.reverse()
 
 
diff --git a/source/tests/bl_load_py_modules.py b/source/tests/bl_load_py_modules.py
index b634b4c..9677397 100644
--- a/source/tests/bl_load_py_modules.py
+++ b/source/tests/bl_load_py_modules.py
@@ -26,6 +26,12 @@ import addon_utils
 import sys
 import os
 
+BLACKLIST = {
+    "bl_i18n_utils",
+    "cycles",
+    "io_export_dxf",  # TODO, check on why this fails
+    }
+
 
 def source_list(path, filename_check=None):
     from os.path import join
@@ -73,20 +79,26 @@ def load_modules():
     for script_path in paths:
         for mod_dir in sys.path:
             if mod_dir.startswith(script_path):
-                module_paths.append(mod_dir)
+                if mod_dir not in module_paths:
+                    if os.path.exists(mod_dir):
+                        module_paths.append(mod_dir)
 
     #
     # collect modules from our paths.
-    module_names = set()
+    module_names = {}
     for mod_dir in module_paths:
         # print("mod_dir", mod_dir)
         for mod, mod_full in bpy.path.module_names(mod_dir):
+            if mod in BLACKLIST:
+                continue
             if mod in module_names:
-                raise Exception("Module found twice %r" % mod)
+                mod_dir_prev, mod_full_prev = module_names[mod]
+                raise Exception("Module found twice %r.\n    (%r -> %r, %r -> %r)" %
+                                (mod, mod_dir, mod_full, mod_dir_prev, mod_full_prev))
 
             modules.append(__import__(mod))
 
-            module_names.add(mod)
+            module_names[mod] = mod_dir, mod_full
     del module_names
 
     #
@@ -107,7 +119,7 @@ def load_modules():
                 modules.append(mod_imp)
 
     #
-    # check which filepaths we didnt load
+    # check which filepaths we didn't load
     source_files = []
     for mod_dir in module_paths:
         source_files.extend(source_list(mod_dir, filename_check=lambda f: f.endswith(".py")))
@@ -128,7 +140,7 @@ def load_modules():
     ignore_paths = [
         os.sep + "presets" + os.sep,
         os.sep + "templates" + os.sep,
-    ]
+    ] + [(os.sep + f + os.sep) for f in BLACKLIST]
 
     for f in source_files:
         ok = False
diff --git a/source/tests/bl_mesh_modifiers.py b/source/tests/bl_mesh_modifiers.py
index 92fae25..2f342f2 100644
--- a/source/tests/bl_mesh_modifiers.py
+++ b/source/tests/bl_mesh_modifiers.py
@@ -34,7 +34,7 @@ USE_QUICK_RENDER = False
 IS_BMESH = hasattr(__import__("bpy").types, "LoopColors")
 
 # -----------------------------------------------------------------------------
-# utility funcs
+# utility functions
 
 
 def render_gl(context, filepath, shade):
@@ -147,7 +147,7 @@ def ctx_viewport_camera(context):
 def ctx_camera_setup(context,
                      location=(0.0, 0.0, 0.0),
                      lookat=(0.0, 0.0, 0.0),
-                     # most likely the followuing vars can be left as defaults
+                     # most likely the following vars can be left as defaults
                      up=(0.0, 0.0, 1.0),
                      lookat_axis='-Z',
                      up_axis='Y',
@@ -258,7 +258,7 @@ def mesh_uv_add(obj):
     uv_lay = obj.data.uv_textures.new()
 
     if IS_BMESH:
-        # XXX, odd that we need to do this. until uvs and texface
+        # XXX, odd that we need to do this. until UV's and texface
         # are separated we will need to keep it
         uv_loops = obj.data.uv_layers[-1]
         uv_list = uv_loops.data[:]
diff --git a/source/tests/bl_mesh_validate.py b/source/tests/bl_mesh_validate.py
index a57a06d..ac5be7d 100644
--- a/source/tests/bl_mesh_validate.py
+++ b/source/tests/bl_mesh_validate.py
@@ -98,7 +98,7 @@ def test_meshes():
         data.loops.add(len(m[2]))
         for idx, v in enumerate(m[2]):
             data.loops[idx].vertex_index = v
-        # Polys.
+        # Polygons.
         data.polygons.add(len(m[3]))
         for idx, l in enumerate(m[3]):
             data.polygons[idx].loop_start = l[0]
@@ -131,7 +131,7 @@ def test_builtins():
                             data.loops[l].edge_index = \
                                 random.randrange(0, len(data.edges) * 2)
                     elif rnd == 3:
-                        # Make fun with some poly.
+                        # Make fun with some polygons.
                         p = random.randrange(0, len(data.polygons))
                         if random.randint(0, 1):
                             data.polygons[p].loop_start = \
diff --git a/source/tests/bl_rst_completeness.py b/source/tests/bl_rst_completeness.py
index e9e2779..6e67f8d 100644
--- a/source/tests/bl_rst_completeness.py
+++ b/source/tests/bl_rst_completeness.py
@@ -56,6 +56,7 @@ modules = (
     ("gpu.rst", "gpu", False),
 )
 
+
 def is_directive_pydata(filepath, directive):
     if directive.type in {"function", "method", "class", "attribute", "data"}:
         return True
@@ -113,7 +114,6 @@ def module_validate(filepath, mod, mod_name, doctree, partial_ok):
                                 print(directive_to_str(filepath, directive_child), end=" ")
                                 print("rst contains non existing class member %r" % attr_id)
 
-
     # MODULE member missing from RST ???
     doctree_dict = directive_members_dict(filepath, doctree)
     for attr in dir(mod):
@@ -136,7 +136,7 @@ def module_validate(filepath, mod, mod_name, doctree, partial_ok):
 
 
 def main():
-    
+
     if bge is None:
         print("Skipping BGE modules!")
 
@@ -151,7 +151,7 @@ def main():
         doctree = rst_to_doctree_mini.parse_rst_py(filepath)
         __import__(modname)
         mod = sys.modules[modname]
-        
+
         module_validate(filepath, mod, modname, doctree, partial_ok)
 
 
diff --git a/source/tests/bl_run_operators.py b/source/tests/bl_run_operators.py
index 5bb2553..0202f7c 100644
--- a/source/tests/bl_run_operators.py
+++ b/source/tests/bl_run_operators.py
@@ -26,6 +26,11 @@
 import bpy
 import sys
 
+USE_ATTRSET = False
+USE_RANDOM = False
+RANDOM_SEED = [1]  # so we can redo crashes
+RANDOM_RESET = 0.1  # 10% chance of resetting on each mew operator
+
 op_blacklist = (
     "script.reload",
     "export*.*",
@@ -36,18 +41,40 @@ op_blacklist = (
     "*.link_append",
     "render.render",
     "render.play_rendered_anim",
+    "sound.bake_animation",    # OK but slow
+    "sound.mixdown",           # OK but slow
+    "object.bake_image",       # OK but slow
+    "object.paths_calculate",  # OK but slow
+    "object.paths_update",     # OK but slow
+    "ptcache.bake_all",        # OK but slow
+    "nla.bake",                # OK but slow
     "*.*_export",
     "*.*_import",
+    "ed.undo_push",
     "wm.blenderplayer_start",
     "wm.url_open",
     "wm.doc_view",
+    "wm.doc_edit",
+    "wm.doc_view_manual",
     "wm.path_open",
     "wm.theme_install",
     "wm.context_*",
+    "wm.properties_add",
+    "wm.properties_remove",
+    "wm.properties_edit",
+    "wm.properties_context_change",
     "wm.operator_cheat_sheet",
-    "wm.keyconfig_test",     # just annoying - but harmless
-    "wm.memory_statistics",  # another annoying one
-    "console.*",             # just annoying - but harmless
+    "wm.interface_theme_*",
+    "wm.appconfig_*",           # just annoying - but harmless
+    "wm.keyitem_add",           # just annoying - but harmless
+    "wm.keyconfig_activate",    # just annoying - but harmless
+    "wm.keyconfig_preset_add",  # just annoying - but harmless
+    "wm.keyconfig_test",        # just annoying - but harmless
+    "wm.memory_statistics",     # another annoying one
+    "wm.dependency_relations",  # another annoying one
+    "wm.keymap_restore",        # another annoying one
+    "wm.addon_*",               # harmless, but dont change state
+    "console.*",                # just annoying - but harmless
     )
 
 
@@ -64,8 +91,112 @@ def filter_op_list(operators):
     operators[:] = [op for op in operators if is_op_ok(op[0])]
 
 
+def reset_blend():
+    bpy.ops.wm.read_factory_settings()
+    for scene in bpy.data.scenes:
+        # reduce range so any bake action doesnt take too long
+        scene.frame_start = 1
+        scene.frame_end = 5
+
+
+if USE_ATTRSET:
+    def build_property_typemap(skip_classes):
+
+        property_typemap = {}
+
+        for attr in dir(bpy.types):
+            cls = getattr(bpy.types, attr)
+            if issubclass(cls, skip_classes):
+                continue
+
+            ## to support skip-save we cant get all props
+            # properties = cls.bl_rna.properties.keys()
+            properties = []
+            for prop_id, prop in cls.bl_rna.properties.items():
+                if not prop.is_skip_save:
+                    properties.append(prop_id)
+
+            properties.remove("rna_type")
+            property_typemap[attr] = properties
+
+        return property_typemap
+    CLS_BLACKLIST = (
+        bpy.types.BrushTextureSlot,
+        bpy.types.Brush,
+        )
+    property_typemap = build_property_typemap(CLS_BLACKLIST)
+    bpy_struct_type = bpy.types.Struct.__base__
+
+    def id_walk(value, parent):
+        value_type = type(value)
+        value_type_name = value_type.__name__
+
+        value_id = getattr(value, "id_data", Ellipsis)
+        value_props = property_typemap.get(value_type_name, ())
+
+        for prop in value_props:
+            subvalue = getattr(value, prop)
+
+            if subvalue == parent:
+                continue
+
+            subvalue_type = type(subvalue)
+            yield value, prop, subvalue_type
+            subvalue_id = getattr(subvalue, "id_data", Ellipsis)
+
+            if value_id == subvalue_id:
+                if subvalue_type == float:
+                    pass
+                elif subvalue_type == int:
+                    pass
+                elif subvalue_type == bool:
+                    pass
+                elif subvalue_type == str:
+                    pass
+                elif hasattr(subvalue, "__len__"):
+                    for sub_item in subvalue[:]:
+                        if isinstance(sub_item, bpy_struct_type):
+                            subitem_id = getattr(sub_item, "id_data", Ellipsis)
+                            if subitem_id == subvalue_id:
+                                yield from id_walk(sub_item, value)
+
+                if subvalue_type.__name__ in property_typemap:
+                    yield from id_walk(subvalue, value)
+
+    # main function
+    _random_values = (
+        None, object,
+        1, 0.1, -1,
+        "", "test", b"", b"test",
+        (), [], {},
+        (10,), (10, 20), (0, 0, 0),
+        {},
+        )
+
+    def attrset_data():
+        for attr in dir(bpy.data):
+            if attr == "window_managers":
+                continue
+            seq = getattr(bpy.data, attr)
+            if seq.__class__.__name__ == 'bpy_prop_collection':
+                for id_data in seq:
+                    for val, prop, tp in id_walk(id_data, bpy.data):
+                        # print(id_data)
+                        for val_rnd in _random_values:
+                            try:
+                                setattr(val, prop, val_rnd)
+                            except:
+                                pass
+
+
 def run_ops(operators, setup_func=None, reset=True):
     print("\ncontext:", setup_func.__name__)
+
+    if USE_RANDOM:
+        import random
+        if random.random() < (1.0 - RANDOM_RESET):
+            reset = False
+
     # first invoke
     for op_id, op in operators:
         if op.poll():
@@ -74,9 +205,16 @@ def run_ops(operators, setup_func=None, reset=True):
 
             # disable will get blender in a bad state and crash easy!
             if reset:
-                bpy.ops.wm.read_factory_settings()
+                reset_blend()
 
-            setup_func()
+            if USE_RANDOM:
+                # we can't be sure it will work
+                try:
+                    setup_func()
+                except:
+                    pass
+            else:
+                setup_func()
 
             for mode in {'EXEC_DEFAULT', 'INVOKE_DEFAULT'}:
                 try:
@@ -86,11 +224,21 @@ def run_ops(operators, setup_func=None, reset=True):
                     #traceback.print_exc()
                     pass
 
+                if USE_ATTRSET:
+                    attrset_data()
+
     if not operators:
         # run test
         if reset:
-            bpy.ops.wm.read_factory_settings()
-        setup_func()
+            reset_blend()
+        if USE_RANDOM:
+            # we can't be sure it will work
+            try:
+                setup_func()
+            except:
+                pass
+        else:
+            setup_func()
 
 
 # contexts
@@ -217,7 +365,7 @@ def main():
 
     bpy_check_type_duplicates()
 
-    # bpy.ops.wm.read_factory_settings()
+    # reset_blend()
     import bpy
     operators = []
     for mod_name in dir(bpy.ops):
@@ -233,8 +381,10 @@ def main():
     # for testing, mix the list up.
     #operators.reverse()
 
-    #import random
-    #random.shuffle(operators)
+    if USE_RANDOM:
+        import random
+        random.seed(RANDOM_SEED[0])
+        random.shuffle(operators)
 
     # 2 passes, first just run setup_func to make sure they are ok
     for operators_test in ((), operators):
@@ -270,4 +420,7 @@ def main():
     print("Finished %r" % __file__)
 
 if __name__ == "__main__":
+    #~ for i in range(200):
+        #~ RANDOM_SEED[0] += 1
+        #~ main()
     main()
diff --git a/source/tests/pep8.py b/source/tests/pep8.py
index ccaaeb7..cb86953 100644
--- a/source/tests/pep8.py
+++ b/source/tests/pep8.py
@@ -21,20 +21,20 @@
 import os
 
 # depends on pep8, pyflakes, pylint
-# for ubuntu
+# for Ubuntu
 #
 #   sudo apt-get install pylint pyflakes
 #
 #   sudo apt-get install python-setuptools python-pip
 #   sudo pip install pep8
 #
-# in debian install pylint pyflakes pep8 with apt-get/aptitude/etc
+# in Debian install pylint pyflakes pep8 with apt-get/aptitude/etc
 #
 # on *nix run
 #   python source/tests/pep8.py > test_pep8.log 2>&1
 
 # how many lines to read into the file, pep8 comment
-# should be directly after the licence header, ~20 in most cases
+# should be directly after the license header, ~20 in most cases
 PEP8_SEEK_COMMENT = 40
 SKIP_PREFIX = "./tools", "./config", "./scons", "./extern"
 FORCE_PEP8_ALL = False
@@ -115,7 +115,7 @@ def main():
         # let pep8 complain about line length
         os.system("pylint "
                   "--disable="
-                  "C0111,"  # missing docstring
+                  "C0111,"  # missing doc string
                   "C0103,"  # invalid name
                   "W0613,"  # unused argument, may add this back
                             # but happens a lot for 'context' for eg.
diff --git a/source/tests/rna_info_dump.py b/source/tests/rna_info_dump.py
index 615c3b0..40d7b7c 100644
--- a/source/tests/rna_info_dump.py
+++ b/source/tests/rna_info_dump.py
@@ -18,7 +18,7 @@
 
 # <pep8 compliant>
 
-# Used for generating API diff's between releases
+# Used for generating API diffs between releases
 #  ./blender.bin --background -noaudio --python source/tests/rna_info_dump.py
 
 import bpy
diff --git a/source/tests/rst_to_doctree_mini.py b/source/tests/rst_to_doctree_mini.py
index 1810372..cb7b029 100644
--- a/source/tests/rst_to_doctree_mini.py
+++ b/source/tests/rst_to_doctree_mini.py
@@ -45,7 +45,7 @@ def parse_rst_py(filepath):
     # -->
     # ("foo", "bar")
     re_prefix = re.compile(r"^\.\.\s([a-zA-Z09\-]+)::\s*(.*)\s*$")
-    
+
     tree = collections.defaultdict(list)
     indent_map = {}
     indent_prev = 0
diff --git a/source/tools/CTS/FBlender.py b/source/tools/CTS/FBlender.py
index fc5c88e..58b4d39 100644
--- a/source/tools/CTS/FBlender.py
+++ b/source/tools/CTS/FBlender.py
@@ -153,7 +153,6 @@ print("\\n\\ndone testing.\\n\\n")"""
     
     def WriteImport(self, filename, logname, outputDir, settings, isAnimated, cameraRig, lightingRig):
         """WriteImport(filename, logname, outputDir, settings, isAnimated, cameraRig, lightingRig) -> list_of_str
-                
         """
         outputFormat = ".png"
         
diff --git a/source/tools/MakeGLStipple.py b/source/tools/MakeGLStipple.py
index 2099890..74e755c 100644
--- a/source/tools/MakeGLStipple.py
+++ b/source/tools/MakeGLStipple.py
@@ -19,7 +19,7 @@
 # <pep8-80 compliant>
 
 # Converts 32x32 XPM images written be the gimp to GL stipples
-# takes xpm files as arguments, prints out C style definitions.
+# takes XPM files as arguments, prints out C style definitions.
 
 import sys
 import os
diff --git a/source/tools/check_style_c.py b/source/tools/check_style_c.py
index 21819dd..d35f992 100755
--- a/source/tools/check_style_c.py
+++ b/source/tools/check_style_c.py
@@ -112,12 +112,14 @@ def tk_advance_ws(index, direction):
         index += direction
     return index
 
+
 def tk_advance_no_ws(index, direction):
     index += direction
     while tk_item_is_ws(tokens[index]) and index > 0:
         index += direction
     return index
 
+
 def tk_advance_ws_newline(index, direction):
     while tk_item_is_ws_newline(tokens[index + direction]) and index > 0:
         index += direction
@@ -205,7 +207,7 @@ def extract_cast(index):
     # first check we are not '()'
     if i_start + 1 == i_end:
         return None
-        
+
     # check we have punctuation before the cast
     i = i_start - 1
     while tokens[i].text.isspace():
@@ -274,6 +276,7 @@ def warning(message, index_kw_start, index_kw_end):
     else:
         print("%s:%d: warning: %s" % (filepath, tokens[index_kw_start].line, message))
 
+
 def warning_lineonly(message, line):
     if PRINT_QTC_TASKFORMAT:
         print("%s\t%d\t%s\t%s" % (filepath, line, "comment", message))
@@ -310,6 +313,14 @@ def blender_check_kw_if(index_kw_start, index_kw, index_kw_end):
         if tokens[index_kw].line != tokens[index_kw_end].line:
             warning("multi-line if should use a brace '%s (\\n\\n) statement;'" % tokens[index_kw].text, index_kw, index_kw_end)
 
+    # check for: if () { ... };
+    #
+    # no need to have semicolon after brace.
+    if tokens[index_next].text == "{":
+        index_final = tk_match_backet(index_next)
+        index_final_step = tk_advance_no_ws(index_final, 1)
+        if tokens[index_final_step].text == ";":
+            warning("semi-colon after brace '%s () { ... };'" % tokens[index_kw].text, index_final_step, index_final_step)
 
 def blender_check_kw_else(index_kw):
     # for 'else if' use the if check.
@@ -370,7 +381,7 @@ def blender_check_cast(index_kw_start, index_kw_end):
     if tokens[index_kw_end - 1].text.isspace():
         warning("cast has space before last bracket '... )'", index_kw_start, index_kw_end)
     # detect no space before operator: '(float*)'
-    
+
     for i in range(index_kw_start + 1, index_kw_end):
         if tokens[i].text == "*":
             # allow: '(*)'
@@ -405,6 +416,7 @@ def blender_check_period(index_kw):
     if tokens[index_kw + 1].type == Token.Text and tokens[index_kw + 1].text.isspace():
         warning("period space after it '. sometext", index_kw, index_kw)
 
+
 def _is_ws_pad(index_start, index_end):
     return (tokens[index_start - 1].text.isspace() and
             tokens[index_end + 1].text.isspace())
@@ -533,8 +545,8 @@ def blender_check_function_definition(i):
     # based on some fuzzy rules
 
     # assert(tokens[index] == "{")
-    
-    # check function declaraction is not:
+
+    # check function declaration is not:
     #  'void myfunc() {'
     # ... other uses are handled by checks for statements
     # this check is rather simplistic but tends to work well enough.
@@ -603,10 +615,10 @@ def quick_check_indentation(code):
     t_prev = -1
     m_comment_prev = False
     ls_prev = ""
-    
+
     for i, l in enumerate(code.split("\n")):
         skip = False
-        
+
         # skip blank lines
         ls = l.strip()
 
@@ -656,15 +668,15 @@ def scan_source(fp, args):
     is_cpp = fp.endswith((".cpp", ".cxx"))
 
     filepath = fp
-    
+
     #if "displist.c" not in filepath:
     #    return
-    
+
     filepath_base = os.path.basename(filepath)
 
     #print(highlight(code, CLexer(), RawTokenFormatter()).decode('utf-8'))
     code = open(filepath, 'r', encoding="utf-8").read()
-    
+
     quick_check_indentation(code)
     # return
 
@@ -701,7 +713,7 @@ def scan_source(fp, args):
                         # c++ can do delete []
                         pass
                     else:
-                        warning("space before '[' %s" % filepath_base, i, i)
+                        warning("space before '['", i, i)
             elif tok.text == "(":
                 # check if this is a cast, eg:
                 #  (char), (char **), (float (*)[3])
@@ -709,7 +721,11 @@ def scan_source(fp, args):
                 if item_range is not None:
                     blender_check_cast(item_range[0], item_range[1])
             elif tok.text == "{":
-                blender_check_function_definition(i);
+                # check previous character is either a '{' or whitespace.
+                if (tokens[i - 1].line == tok.line) and not (tokens[i - 1].text.isspace() or tokens[i - 1].text == "{"):
+                    warning("no space before '{'", i, i)
+
+                blender_check_function_definition(i)
 
         elif tok.type == Token.Operator:
             # we check these in pairs, only want first
diff --git a/source/tools/spell_check_source.py b/source/tools/spell_check_source.py
index 0bfc7b3..c09aa4c 100644
--- a/source/tools/spell_check_source.py
+++ b/source/tools/spell_check_source.py
@@ -157,7 +157,7 @@ def extract_c_comments(filepath):
     Extracts comments like this:
 
         /*
-         * This is a multiline comment, notice the '*'s are aligned.
+         * This is a multi-line comment, notice the '*'s are aligned.
          */
     """
     i = 0
@@ -194,9 +194,7 @@ def extract_c_comments(filepath):
             for directive in STRIP_DOXY_DIRECTIVES:
                 if directive in l:
                     l_split = l.split()
-                    value = l_split[l_split.index(directive) + 1]
-                    # print("remove:", value)
-                    l = l.replace(value, " ")
+                    l_split[l_split.index(directive) + 1] = " "
             block_split[i] = l
 
     comments = []
@@ -213,7 +211,7 @@ def extract_c_comments(filepath):
 
                 block = text[i:i_next + len(END)]
 
-                # add whitespace infront of the block (for alignment test)
+                # add whitespace in front of the block (for alignment test)
                 ws = []
                 j = i
                 while j > 0 and text[j - 1] != "\n":
diff --git a/source/tools/spell_check_source_config.py b/source/tools/spell_check_source_config.py
index 6621600..30e1b2e 100644
--- a/source/tools/spell_check_source_config.py
+++ b/source/tools/spell_check_source_config.py
@@ -40,7 +40,8 @@ dict_custom = {
     "enum", "enums",
     "int", "ints",
     "tuple", "tuples",
-    # python funcs
+    
+    # python functions
     "repr",
     "func",
 
@@ -69,6 +70,8 @@ dict_custom = {
     "metadata",
     "hashable",
     "stdin",
+    "stdout",
+    "stdin",
     "opengl",
     "boids",
     "keymap",
@@ -77,9 +80,21 @@ dict_custom = {
     "euler", "eulers",
     "booleans",
     "intrinsics",
-    "xml",
-
-    # spesific computer terms/brands
+    "XXX",
+    "segfault",
+    "wiki",
+    "foo",
+    "diff",
+    "diffs",
+    "sudo",
+    "http",
+    "url",
+    "usr",
+    "env",
+    "app",
+    "preprocessor",
+
+    # specific computer terms/brands
     "posix",
     "unix",
     "amiga",
@@ -87,11 +102,15 @@ dict_custom = {
     "mozilla",
     "irix",
     "kde",
+    "qtcreator",
+    "ack",
 
     # general computer graphics terms
     "colinear",
     "coplanar",
+    "barycentric",
     "bezier",
+    "fresnel",
     "radiosity",
     "reflectance",
     "specular",
@@ -105,15 +124,23 @@ dict_custom = {
     "centroid",
     "emissive",
     "quaternions",
+    "lacunarity",
+    "musgrave",
     "normals",
 
     # blender terms
+    "bmain",
+    "bmesh",
     "bpy",
+    "bge",
     "mathutils",
     "fcurve",
     "animviz",
     "animsys",
     "eekadoodle",
+    "editmode",
+    "obdata",
+    "doctree",
 
     # should have apostrophe but ignore for now
     # unless we want to get really picky!
@@ -147,8 +174,12 @@ dict_ignore = {
     "a-z",
     "id-block",
     "node-trees",
+    "pyflakes",
+    "pylint",
 
     # acronyms
+    "cpu",
+    "gpu",
     "nan",
     "utf",
     "rgb",
@@ -162,6 +193,15 @@ dict_ignore = {
     "lhs",
     "ik",
     "smpte",
+    "svn",
+    "hg",
+    "gl",
+    
+    # extensions
+    "xpm",
+    "xml",
+    "py",
+    "rst",
 
     # tags
     "fixme",
@@ -177,4 +217,5 @@ dict_ignore = {
     # names
     "jahka",
     "campbell",
+    "mikkelsen", "morten",
 }

-- 
blender packaging



More information about the pkg-multimedia-commits mailing list